@datadog/datadog-ci-plugin-sarif 5.12.1 → 5.13.1
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/dist/bundle.d.ts +345 -0
- package/dist/bundle.js +90116 -0
- package/dist/bundle.js.LEGAL.txt +1667 -0
- package/dist/bundle.js.map +1 -0
- package/dist/commands/upload.js +2 -164
- package/package.json +18 -13
- package/dist/api.d.ts +0 -7
- package/dist/api.js +0 -49
- package/dist/api.js.map +0 -1
- package/dist/commands/upload.d.ts +0 -9
- package/dist/commands/upload.js.map +0 -1
- package/dist/interfaces.d.ts +0 -12
- package/dist/interfaces.js +0 -3
- package/dist/interfaces.js.map +0 -1
- package/dist/json-schema/sarif-schema-2.1.0.json +0 -2885
- package/dist/renderer.d.ts +0 -11
- package/dist/renderer.js +0 -101
- package/dist/renderer.js.map +0 -1
- package/dist/utils.d.ts +0 -21
- package/dist/utils.js +0 -75
- package/dist/utils.js.map +0 -1
- package/dist/validation.d.ts +0 -16
- package/dist/validation.js +0 -102
- package/dist/validation.js.map +0 -1
package/dist/commands/upload.js
CHANGED
|
@@ -1,164 +1,2 @@
|
|
|
1
|
-
"use strict"
|
|
2
|
-
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.PluginCommand = void 0;
|
|
16
|
-
const fs_1 = __importDefault(require("fs"));
|
|
17
|
-
const upload_1 = require("@datadog/datadog-ci-base/commands/sarif/upload");
|
|
18
|
-
const constants_1 = require("@datadog/datadog-ci-base/constants");
|
|
19
|
-
const concurrency_1 = require("@datadog/datadog-ci-base/helpers/concurrency");
|
|
20
|
-
const env_1 = require("@datadog/datadog-ci-base/helpers/env");
|
|
21
|
-
const fips_1 = require("@datadog/datadog-ci-base/helpers/fips");
|
|
22
|
-
const glob_1 = require("@datadog/datadog-ci-base/helpers/glob");
|
|
23
|
-
const retry_1 = require("@datadog/datadog-ci-base/helpers/retry");
|
|
24
|
-
const tags_1 = require("@datadog/datadog-ci-base/helpers/tags");
|
|
25
|
-
const utils_1 = require("@datadog/datadog-ci-base/helpers/utils");
|
|
26
|
-
const chalk_1 = __importDefault(require("chalk"));
|
|
27
|
-
const upath_1 = __importDefault(require("upath"));
|
|
28
|
-
const api_1 = require("../api");
|
|
29
|
-
const renderer_1 = require("../renderer");
|
|
30
|
-
const utils_2 = require("../utils");
|
|
31
|
-
const validation_1 = require("../validation");
|
|
32
|
-
class PluginCommand extends upload_1.SarifUploadCommand {
|
|
33
|
-
constructor() {
|
|
34
|
-
var _a, _b;
|
|
35
|
-
super(...arguments);
|
|
36
|
-
this.config = {
|
|
37
|
-
apiKey: process.env.DATADOG_API_KEY || process.env.DD_API_KEY,
|
|
38
|
-
env: process.env.DD_ENV,
|
|
39
|
-
envVarTags: process.env.DD_TAGS,
|
|
40
|
-
};
|
|
41
|
-
this.fipsConfig = {
|
|
42
|
-
fips: (_a = (0, env_1.toBoolean)(process.env[constants_1.FIPS_ENV_VAR])) !== null && _a !== void 0 ? _a : false,
|
|
43
|
-
fipsIgnoreError: (_b = (0, env_1.toBoolean)(process.env[constants_1.FIPS_IGNORE_ERROR_ENV_VAR])) !== null && _b !== void 0 ? _b : false,
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
execute() {
|
|
47
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
48
|
-
(0, fips_1.enableFips)(this.fips || this.fipsConfig.fips, this.fipsIgnoreError || this.fipsConfig.fipsIgnoreError);
|
|
49
|
-
const githubEvent = process.env.GITHUB_EVENT_NAME;
|
|
50
|
-
const gitlabEvent = process.env.CI_PIPELINE_SOURCE;
|
|
51
|
-
const azureReason = process.env.BUILD_REASON;
|
|
52
|
-
if (githubEvent === 'pull_request') {
|
|
53
|
-
// https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-commands#example-setting-an-error-message
|
|
54
|
-
this.context.stdout.write('::error title=Unsupported Trigger::The `pull_request` event is not supported by Datadog Code Security and will cause issues with the product. ' +
|
|
55
|
-
'To continue using Datadog Code Security, use `push` instead. See: https://docs.datadoghq.com/security/code_security/static_analysis/github_actions/#workflow for more information.');
|
|
56
|
-
return 1;
|
|
57
|
-
}
|
|
58
|
-
if (gitlabEvent === 'merge_request_event') {
|
|
59
|
-
this.context.stderr.write('The `merge_request_event` pipeline source is not supported by Datadog Code Security and will cause issues with the product. ' +
|
|
60
|
-
'To continue using Datadog Code Security, use `push` instead. See: https://docs.datadoghq.com/security/code_security/static_analysis/generic_ci_providers/ for more information.');
|
|
61
|
-
return 1;
|
|
62
|
-
}
|
|
63
|
-
if (azureReason === 'PullRequest') {
|
|
64
|
-
// https://learn.microsoft.com/en-us/azure/devops/pipelines/scripts/logging-commands?view=azure-devops&tabs=bash#logging-commands-for-build-pipelines
|
|
65
|
-
this.context.stdout.write('##vso[task.logissue type=error]The `PullRequest` build reason is not supported by Datadog Code Security and will cause issues with the product. ' +
|
|
66
|
-
'To continue using Datadog Code Security, use `push` instead. See: https://docs.datadoghq.com/security/code_security/static_analysis/generic_ci_providers/ for more information.');
|
|
67
|
-
return 1;
|
|
68
|
-
}
|
|
69
|
-
if (!this.basePaths || !this.basePaths.length) {
|
|
70
|
-
this.context.stderr.write('Missing basePath\n');
|
|
71
|
-
return 1;
|
|
72
|
-
}
|
|
73
|
-
if (!this.config.env) {
|
|
74
|
-
this.config.env = this.env;
|
|
75
|
-
}
|
|
76
|
-
const api = this.getApiHelper();
|
|
77
|
-
// Normalizing the basePath to resolve .. and .
|
|
78
|
-
this.basePaths = this.basePaths.map((basePath) => upath_1.default.normalize(basePath));
|
|
79
|
-
const spanTags = yield (0, tags_1.getSpanTags)(this.config, this.tags, !this.noCiTags, this.gitPath);
|
|
80
|
-
// Gather any missing mandatory git fields to display to the user
|
|
81
|
-
const missingGitFields = (0, tags_1.getMissingRequiredGitTags)(spanTags);
|
|
82
|
-
if (missingGitFields.length > 0) {
|
|
83
|
-
this.context.stdout.write((0, renderer_1.renderMissingTags)(missingGitFields));
|
|
84
|
-
return 1;
|
|
85
|
-
}
|
|
86
|
-
const payloads = yield this.getMatchingSarifReports(spanTags);
|
|
87
|
-
if (payloads.length === 0) {
|
|
88
|
-
this.context.stdout.write((0, renderer_1.renderFilesNotFound)(this.basePaths));
|
|
89
|
-
return 1;
|
|
90
|
-
}
|
|
91
|
-
const sha = spanTags[tags_1.GIT_SHA] || 'sha-not-found';
|
|
92
|
-
const env = this.config.env || 'env-not-set';
|
|
93
|
-
this.context.stdout.write((0, renderer_1.renderCommandInfo)(this.basePaths, env, sha, this.maxConcurrency, this.dryRun, this.noVerify));
|
|
94
|
-
const upload = (payload) => this.uploadSarifReport(api, payload);
|
|
95
|
-
const initialTime = new Date().getTime();
|
|
96
|
-
yield (0, concurrency_1.doWithMaxConcurrency)(this.maxConcurrency, payloads, upload);
|
|
97
|
-
const totalTimeSeconds = (Date.now() - initialTime) / 1000;
|
|
98
|
-
this.context.stdout.write((0, renderer_1.renderSuccessfulCommand)(payloads.length, totalTimeSeconds));
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
|
-
uploadSarifReport(api, sarifReport) {
|
|
102
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
103
|
-
if (this.dryRun) {
|
|
104
|
-
this.context.stdout.write((0, renderer_1.renderDryRunUpload)(sarifReport));
|
|
105
|
-
return;
|
|
106
|
-
}
|
|
107
|
-
try {
|
|
108
|
-
yield (0, retry_1.retryRequest)(() => api.uploadSarifReport(sarifReport, this.context.stdout.write.bind(this.context.stdout)), {
|
|
109
|
-
onRetry: (e, attempt) => {
|
|
110
|
-
this.context.stderr.write((0, renderer_1.renderRetriedUpload)(sarifReport, e.message, attempt));
|
|
111
|
-
},
|
|
112
|
-
retries: 5,
|
|
113
|
-
});
|
|
114
|
-
}
|
|
115
|
-
catch (error) {
|
|
116
|
-
this.context.stderr.write((0, renderer_1.renderFailedUpload)(sarifReport, error));
|
|
117
|
-
throw error;
|
|
118
|
-
}
|
|
119
|
-
});
|
|
120
|
-
}
|
|
121
|
-
getApiHelper() {
|
|
122
|
-
if (!this.config.apiKey) {
|
|
123
|
-
this.context.stdout.write(`Neither ${chalk_1.default.red.bold('DATADOG_API_KEY')} nor ${chalk_1.default.red.bold('DD_API_KEY')} is in your environment.\n`);
|
|
124
|
-
throw new Error('API key is missing');
|
|
125
|
-
}
|
|
126
|
-
return (0, api_1.apiConstructor)((0, utils_2.getBaseIntakeUrl)(), this.config.apiKey);
|
|
127
|
-
}
|
|
128
|
-
getMatchingSarifReports(spanTags) {
|
|
129
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
130
|
-
const sarifReports = (this.basePaths || []).reduce((acc, basePath) => {
|
|
131
|
-
const isFile = !!upath_1.default.extname(basePath);
|
|
132
|
-
if (isFile) {
|
|
133
|
-
return acc.concat(fs_1.default.existsSync(basePath) ? [basePath] : []);
|
|
134
|
-
}
|
|
135
|
-
return acc.concat((0, glob_1.globSync)((0, utils_1.buildPath)(basePath, '*.sarif'), { dotRelative: true }));
|
|
136
|
-
}, []);
|
|
137
|
-
const validUniqueFiles = [...new Set(sarifReports)].filter((sarifReport) => {
|
|
138
|
-
if (this.noVerify) {
|
|
139
|
-
return true;
|
|
140
|
-
}
|
|
141
|
-
const validationErrorMessage = (0, validation_1.validateSarif)(sarifReport);
|
|
142
|
-
if (validationErrorMessage) {
|
|
143
|
-
this.context.stdout.write((0, renderer_1.renderInvalidFile)(sarifReport, [validationErrorMessage]));
|
|
144
|
-
return false;
|
|
145
|
-
}
|
|
146
|
-
const potentialErrors = (0, validation_1.checkForError)(sarifReport);
|
|
147
|
-
if (potentialErrors.length > 0) {
|
|
148
|
-
this.context.stdout.write((0, renderer_1.renderInvalidFile)(sarifReport, potentialErrors));
|
|
149
|
-
return false;
|
|
150
|
-
}
|
|
151
|
-
return true;
|
|
152
|
-
});
|
|
153
|
-
return validUniqueFiles.map((sarifReport) => {
|
|
154
|
-
return {
|
|
155
|
-
reportPath: sarifReport,
|
|
156
|
-
spanTags,
|
|
157
|
-
service: (0, utils_2.getServiceFromSarifTool)(sarifReport),
|
|
158
|
-
};
|
|
159
|
-
});
|
|
160
|
-
});
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
exports.PluginCommand = PluginCommand;
|
|
164
|
-
//# sourceMappingURL=upload.js.map
|
|
1
|
+
"use strict"
|
|
2
|
+
module.exports = require("../bundle.js").commands["upload"]
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@datadog/datadog-ci-plugin-sarif",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.13.1",
|
|
4
4
|
"description": "Datadog CI plugin for `sarif` commands",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"keywords": [
|
|
@@ -14,15 +14,25 @@
|
|
|
14
14
|
"url": "https://github.com/DataDog/datadog-ci.git",
|
|
15
15
|
"directory": "packages/plugin-sarif"
|
|
16
16
|
},
|
|
17
|
+
"main": "dist/bundle.js",
|
|
18
|
+
"types": "dist/bundle.d.ts",
|
|
17
19
|
"exports": {
|
|
18
20
|
"./package.json": "./package.json",
|
|
21
|
+
".": {
|
|
22
|
+
"types": "./dist/bundle.d.ts",
|
|
23
|
+
"default": "./dist/bundle.js"
|
|
24
|
+
},
|
|
19
25
|
"./commands/*": {
|
|
20
26
|
"development": "./src/commands/*.ts",
|
|
21
27
|
"default": "./dist/commands/*.js"
|
|
22
28
|
}
|
|
23
29
|
},
|
|
24
30
|
"files": [
|
|
25
|
-
"dist
|
|
31
|
+
"dist/bundle.js",
|
|
32
|
+
"dist/bundle.js.map",
|
|
33
|
+
"dist/bundle.js.LEGAL.txt",
|
|
34
|
+
"dist/bundle.d.ts",
|
|
35
|
+
"dist/commands/*.js",
|
|
26
36
|
"README",
|
|
27
37
|
"LICENSE"
|
|
28
38
|
],
|
|
@@ -32,23 +42,18 @@
|
|
|
32
42
|
"scripts": {
|
|
33
43
|
"build": "yarn package:clean; yarn package:build",
|
|
34
44
|
"lint": "yarn package:lint",
|
|
35
|
-
"prepack": "yarn package:clean-dist"
|
|
45
|
+
"prepack": "yarn package:clean-dist; yarn package:bundle:npm"
|
|
36
46
|
},
|
|
37
|
-
"
|
|
38
|
-
"@datadog/datadog-ci-base": "5.
|
|
39
|
-
|
|
40
|
-
|
|
47
|
+
"devDependencies": {
|
|
48
|
+
"@datadog/datadog-ci-base": "5.13.1",
|
|
49
|
+
"@types/jest": "29.5.3",
|
|
50
|
+
"@types/uuid": "9.0.8",
|
|
41
51
|
"ajv": "8.18.0",
|
|
42
52
|
"ajv-formats": "3.0.1",
|
|
43
53
|
"chalk": "3.0.0",
|
|
44
54
|
"form-data": "4.0.4",
|
|
55
|
+
"simple-git": "3.33.0",
|
|
45
56
|
"upath": "2.0.1",
|
|
46
57
|
"uuid": "9.0.1"
|
|
47
|
-
},
|
|
48
|
-
"devDependencies": {
|
|
49
|
-
"@types/jest": "29.5.3",
|
|
50
|
-
"@types/uuid": "9.0.8",
|
|
51
|
-
"axios": "1.13.5",
|
|
52
|
-
"simple-git": "3.33.0"
|
|
53
58
|
}
|
|
54
59
|
}
|
package/dist/api.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { Payload } from './interfaces';
|
|
2
|
-
import type { AxiosPromise, AxiosRequestConfig, AxiosResponse } from 'axios';
|
|
3
|
-
import type { Writable } from 'stream';
|
|
4
|
-
export declare const uploadSarifReport: (request: (args: AxiosRequestConfig) => AxiosPromise<AxiosResponse>) => (sarifReport: Payload, write: Writable['write']) => Promise<AxiosResponse<AxiosResponse<any, any, {}>, any, {}>>;
|
|
5
|
-
export declare const apiConstructor: (baseIntakeUrl: string, apiKey: string) => {
|
|
6
|
-
uploadSarifReport: (sarifReport: Payload, write: Writable['write']) => Promise<AxiosResponse<AxiosResponse<any, any, {}>, any, {}>>;
|
|
7
|
-
};
|
package/dist/api.js
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.apiConstructor = exports.uploadSarifReport = void 0;
|
|
16
|
-
const fs_1 = __importDefault(require("fs"));
|
|
17
|
-
const zlib_1 = require("zlib");
|
|
18
|
-
const utils_1 = require("@datadog/datadog-ci-base/helpers/utils");
|
|
19
|
-
const form_data_1 = __importDefault(require("form-data"));
|
|
20
|
-
const uuid_1 = require("uuid");
|
|
21
|
-
const renderer_1 = require("./renderer");
|
|
22
|
-
// Dependency follows-redirects sets a default maxBodyLength of 10 MB https://github.com/follow-redirects/follow-redirects/blob/b774a77e582b97174813b3eaeb86931becba69db/index.js#L391
|
|
23
|
-
// We don't want any hard limit enforced by the CLI, the backend will enforce a max size by returning 413 errors.
|
|
24
|
-
const maxBodyLength = Infinity;
|
|
25
|
-
const uploadSarifReport = (request) => (sarifReport, write) => __awaiter(void 0, void 0, void 0, function* () {
|
|
26
|
-
const form = new form_data_1.default();
|
|
27
|
-
write((0, renderer_1.renderUpload)(sarifReport));
|
|
28
|
-
const metadata = Object.assign(Object.assign({ service: sarifReport.service }, sarifReport.spanTags), { event_type: 'static_analysis', event_format_name: 'sarif', event_format_version: '2.1.0' });
|
|
29
|
-
form.append('event', JSON.stringify(metadata), { filename: 'event.json' });
|
|
30
|
-
form.append('sarif_report_file', fs_1.default.createReadStream(sarifReport.reportPath).pipe((0, zlib_1.createGzip)()), {
|
|
31
|
-
filename: `${(0, uuid_1.v4)()}.sarif.gz`,
|
|
32
|
-
});
|
|
33
|
-
return request({
|
|
34
|
-
data: form,
|
|
35
|
-
headers: form.getHeaders(),
|
|
36
|
-
maxBodyLength,
|
|
37
|
-
method: 'POST',
|
|
38
|
-
url: 'api/v2/cicodescan',
|
|
39
|
-
});
|
|
40
|
-
});
|
|
41
|
-
exports.uploadSarifReport = uploadSarifReport;
|
|
42
|
-
const apiConstructor = (baseIntakeUrl, apiKey) => {
|
|
43
|
-
const requestIntake = (0, utils_1.getRequestBuilder)({ baseUrl: baseIntakeUrl, apiKey });
|
|
44
|
-
return {
|
|
45
|
-
uploadSarifReport: (0, exports.uploadSarifReport)(requestIntake),
|
|
46
|
-
};
|
|
47
|
-
};
|
|
48
|
-
exports.apiConstructor = apiConstructor;
|
|
49
|
-
//# sourceMappingURL=api.js.map
|
package/dist/api.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"api.js","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":";;;;;;;;;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O,EAAE,aAAa,EAAE,MAAM,EAAC,CAAC,CAAA;IAEzE,OAAO;QACL,iBAAiB,EAAE,IAAA,yBAAiB,EAAC,aAAa,CAAC;KACpD,CAAA;AACH,CAAC,CAAA;AANY,QAAA,cAAc,kBAM1B"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { SarifUploadCommand } from '@datadog/datadog-ci-base/commands/sarif/upload';
|
|
2
|
-
export declare class PluginCommand extends SarifUploadCommand {
|
|
3
|
-
private config;
|
|
4
|
-
private fipsConfig;
|
|
5
|
-
execute(): Promise<1 | undefined>;
|
|
6
|
-
private uploadSarifReport;
|
|
7
|
-
private getApiHelper;
|
|
8
|
-
private getMatchingSarifReports;
|
|
9
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"upload.js","sourceRoot":"","sources":["../../src/commands/upload.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,4CAAmB;AAMnB,2EAAiF;AACjF,kEAA0F;AAC1F,8EAAiF;AACjF,8DAA8D;AAC9D,gEAAgE;AAChE,gEAA8D;AAC9D,kEAAmE;AACnE,gEAAqG;AACrG,kEAAgE;AAChE,kDAAyB;AACzB,kDAAyB;AAEzB,gCAAqC;AACrC,0CASoB;AACpB,oCAAkE;AAClE,8CAA0D;AAE1D,MAAa,aAAc,SAAQ,2BAAkB;IAArD;;;QACU,WAAM,GAAoB;YAChC,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,eAAe,IAAI,OAAO,CAAC,GAAG,CAAC,UAAU;YAC7D,GAAG,EAAE,OAAO,CAAC,GAAG,CAAC,MAAM;YACvB,UAAU,EAAE,OAAO,CAAC,GAAG,CAAC,OAAO;SAChC,CAAA;QAEO,eAAU,GAAG;YACnB,IAAI,EAAE,MAAA,IAAA,eAAS,EAAC,OAAO,CAAC,GAAG,CAAC,wBAAY,CAAC,CAAC,mCAAI,KAAK;YACnD,eAAe,EAAE,MAAA,IAAA,eAAS,EAAC,OAAO,CAAC,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AAG,CAAC,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,WAAW,EAAE,EAAE;gBACzE,IAAI,IAAI,CAAC,QAAQ,EAAE;oBACjB,OAAO,IAAI,CAAA;iBACZ;gBAED,MAAM,sBAAsB,GAAG,IAAA,0BAAa,EAAC,WAAW,CAAC,CAAA;gBACzD,IAAI,sBAAsB,EAAE;oBAC1B,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAA,4BAAiB,EAAC,WAAW,EAAE,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAA;oBAEnF,OAAO,KAAK,CAAA;iBACb;gBAED,MAAM,eAAe,GAAG,IAAA,0BAAa,EAAC,WAAW,CAAC,CAAA;gBAClD,IAAI,eAAe,CAAC,MAAM,GAAG,CAAC,EAAE;oBAC9B,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAA,4BAAiB,EAAC,WAAW,EAAE,eAAe,CAAC,CAAC,CAAA;oBAE1E,OAAO,KAAK,CAAA;iBACb;gBAED,OAAO,IAAI,CAAA;YACb,CAAC,CAAC,CAAA;YAEF,OAAO,gBAAgB,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE,EAAE;gBAC1C,OAAO;oBACL,UAAU,EAAE,WAAW;oBACvB,QAAQ;oBACR,OAAO,EAAE,IAAA,+BAAuB,EAAC,WAAW,CAAC;iBAC9C,CAAA;YACH,CAAC,CAAC,CAAA;QACJ,CAAC;KAAA;CACF;AAzKD,sCAyKC"}
|
package/dist/interfaces.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import type { SpanTags } from '@datadog/datadog-ci-base/helpers/interfaces';
|
|
3
|
-
import type { AxiosPromise, AxiosResponse } from 'axios';
|
|
4
|
-
import type { Writable } from 'stream';
|
|
5
|
-
export interface Payload {
|
|
6
|
-
reportPath: string;
|
|
7
|
-
spanTags: SpanTags;
|
|
8
|
-
service: string;
|
|
9
|
-
}
|
|
10
|
-
export interface APIHelper {
|
|
11
|
-
uploadSarifReport(sarifReport: Payload, write: Writable['write']): AxiosPromise<AxiosResponse>;
|
|
12
|
-
}
|
package/dist/interfaces.js
DELETED
package/dist/interfaces.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../src/interfaces.ts"],"names":[],"mappings":""}
|