@fabasoad/sarif-to-slack 0.2.5 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/release.yml +1 -1
- package/.github/workflows/security.yml +0 -1
- package/.github/workflows/send-sarif-to-slack.yml +145 -73
- package/.gitleaksignore +8 -0
- package/.pre-commit-config.yaml +3 -3
- package/.tool-versions +1 -1
- package/dist/Logger.js +4 -1
- package/dist/SarifToSlackClient.d.ts +33 -0
- package/dist/SarifToSlackClient.d.ts.map +1 -0
- package/dist/SarifToSlackClient.js +178 -0
- package/dist/SlackMessageBuilder.js +34 -82
- package/dist/System.d.ts +1 -3
- package/dist/System.d.ts.map +1 -1
- package/dist/System.js +10 -3
- package/dist/index.cjs +826 -472
- package/dist/index.d.ts +35 -12
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +36 -12
- package/dist/model/Color.d.ts +80 -0
- package/dist/model/Color.d.ts.map +1 -0
- package/dist/model/Color.js +106 -0
- package/dist/model/Finding.d.ts +2 -0
- package/dist/model/Finding.d.ts.map +1 -0
- package/dist/model/Finding.js +93 -0
- package/dist/model/FindingsArray.d.ts +2 -0
- package/dist/model/FindingsArray.d.ts.map +1 -0
- package/dist/model/FindingsArray.js +24 -0
- package/dist/processors/CodeQLProcessor.d.ts +2 -0
- package/dist/processors/CodeQLProcessor.d.ts.map +1 -0
- package/dist/processors/CodeQLProcessor.js +17 -0
- package/dist/processors/CommonProcessor.d.ts +2 -0
- package/dist/processors/CommonProcessor.d.ts.map +1 -0
- package/dist/processors/CommonProcessor.js +84 -0
- package/dist/processors/ProcessorFactory.d.ts +2 -0
- package/dist/processors/ProcessorFactory.d.ts.map +1 -0
- package/dist/processors/ProcessorFactory.js +22 -0
- package/dist/processors/SnykProcessor.d.ts +2 -0
- package/dist/processors/SnykProcessor.d.ts.map +1 -0
- package/dist/processors/SnykProcessor.js +18 -0
- package/dist/representations/CompactGroupByRepresentation.d.ts +2 -0
- package/dist/representations/CompactGroupByRepresentation.d.ts.map +1 -0
- package/dist/representations/CompactGroupByRepresentation.js +58 -0
- package/dist/representations/CompactGroupByRunPerLevelRepresentation.d.ts +2 -0
- package/dist/representations/CompactGroupByRunPerLevelRepresentation.d.ts.map +1 -0
- package/dist/representations/CompactGroupByRunPerLevelRepresentation.js +13 -0
- package/dist/representations/CompactGroupByRunPerSeverityRepresentation.d.ts +2 -0
- package/dist/representations/CompactGroupByRunPerSeverityRepresentation.d.ts.map +1 -0
- package/dist/representations/CompactGroupByRunPerSeverityRepresentation.js +13 -0
- package/dist/representations/CompactGroupByRunRepresentation.d.ts +2 -0
- package/dist/representations/CompactGroupByRunRepresentation.d.ts.map +1 -0
- package/dist/representations/CompactGroupByRunRepresentation.js +39 -0
- package/dist/representations/CompactGroupBySarifPerLevelRepresentation.d.ts +2 -0
- package/dist/representations/CompactGroupBySarifPerLevelRepresentation.d.ts.map +1 -0
- package/dist/representations/CompactGroupBySarifPerLevelRepresentation.js +13 -0
- package/dist/representations/CompactGroupBySarifPerSeverityRepresentation.d.ts +2 -0
- package/dist/representations/CompactGroupBySarifPerSeverityRepresentation.d.ts.map +1 -0
- package/dist/representations/CompactGroupBySarifPerSeverityRepresentation.js +13 -0
- package/dist/representations/CompactGroupBySarifRepresentation.d.ts +2 -0
- package/dist/representations/CompactGroupBySarifRepresentation.d.ts.map +1 -0
- package/dist/representations/CompactGroupBySarifRepresentation.js +40 -0
- package/dist/representations/CompactGroupByToolNamePerLevelRepresentation.d.ts +2 -0
- package/dist/representations/CompactGroupByToolNamePerLevelRepresentation.d.ts.map +1 -0
- package/dist/representations/CompactGroupByToolNamePerLevelRepresentation.js +13 -0
- package/dist/representations/CompactGroupByToolNamePerSeverityRepresentation.d.ts +2 -0
- package/dist/representations/CompactGroupByToolNamePerSeverityRepresentation.d.ts.map +1 -0
- package/dist/representations/CompactGroupByToolNamePerSeverityRepresentation.js +13 -0
- package/dist/representations/CompactGroupByToolNameRepresentation.d.ts +2 -0
- package/dist/representations/CompactGroupByToolNameRepresentation.d.ts.map +1 -0
- package/dist/representations/CompactGroupByToolNameRepresentation.js +39 -0
- package/dist/representations/CompactTotalPerLevelRepresentation.d.ts +2 -0
- package/dist/representations/CompactTotalPerLevelRepresentation.d.ts.map +1 -0
- package/dist/representations/CompactTotalPerLevelRepresentation.js +13 -0
- package/dist/representations/CompactTotalPerSeverityRepresentation.d.ts +2 -0
- package/dist/representations/CompactTotalPerSeverityRepresentation.d.ts.map +1 -0
- package/dist/representations/CompactTotalPerSeverityRepresentation.js +13 -0
- package/dist/representations/CompactTotalRepresentation.d.ts +2 -0
- package/dist/representations/CompactTotalRepresentation.d.ts.map +1 -0
- package/dist/representations/CompactTotalRepresentation.js +25 -0
- package/dist/representations/Representation.d.ts +2 -0
- package/dist/representations/Representation.d.ts.map +1 -0
- package/dist/representations/Representation.js +28 -0
- package/dist/representations/RepresentationFactory.d.ts +2 -0
- package/dist/representations/RepresentationFactory.d.ts.map +1 -0
- package/dist/representations/RepresentationFactory.js +37 -0
- package/dist/sarif-to-slack.d.ts +347 -85
- package/dist/tsdoc-metadata.json +1 -1
- package/dist/types.d.ts +215 -51
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +225 -33
- package/dist/utils/Comparators.d.ts +2 -0
- package/dist/utils/Comparators.d.ts.map +1 -0
- package/dist/utils/Comparators.js +18 -0
- package/dist/utils/ExtendedArray.d.ts +2 -0
- package/dist/utils/ExtendedArray.d.ts.map +1 -0
- package/dist/utils/ExtendedArray.js +11 -0
- package/dist/utils/FileUtils.d.ts +2 -0
- package/dist/utils/FileUtils.d.ts.map +1 -0
- package/dist/utils/FileUtils.js +51 -0
- package/dist/utils/SarifUtils.js +20 -54
- package/etc/sarif-to-slack.api.md +162 -99
- package/jest.config.json +2 -2
- package/package.json +7 -7
- package/scripts/save-metadata.sh +12 -10
- package/src/Logger.ts +4 -0
- package/src/SarifToSlackClient.ts +202 -0
- package/src/SlackMessageBuilder.ts +35 -115
- package/src/System.ts +9 -2
- package/src/index.ts +47 -20
- package/src/model/Color.ts +195 -0
- package/src/model/Finding.ts +137 -0
- package/src/model/FindingsArray.ts +27 -0
- package/src/processors/CodeQLProcessor.ts +19 -0
- package/src/processors/CommonProcessor.ts +103 -0
- package/src/processors/ProcessorFactory.ts +23 -0
- package/src/processors/SnykProcessor.ts +19 -0
- package/src/representations/CompactGroupByRepresentation.ts +67 -0
- package/src/representations/CompactGroupByRunPerLevelRepresentation.ts +14 -0
- package/src/representations/CompactGroupByRunPerSeverityRepresentation.ts +14 -0
- package/src/representations/CompactGroupByRunRepresentation.ts +44 -0
- package/src/representations/CompactGroupBySarifPerLevelRepresentation.ts +15 -0
- package/src/representations/CompactGroupBySarifPerSeverityRepresentation.ts +15 -0
- package/src/representations/CompactGroupBySarifRepresentation.ts +45 -0
- package/src/representations/CompactGroupByToolNamePerLevelRepresentation.ts +15 -0
- package/src/representations/CompactGroupByToolNamePerSeverityRepresentation.ts +15 -0
- package/src/representations/CompactGroupByToolNameRepresentation.ts +44 -0
- package/src/representations/CompactTotalPerLevelRepresentation.ts +14 -0
- package/src/representations/CompactTotalPerSeverityRepresentation.ts +14 -0
- package/src/representations/CompactTotalRepresentation.ts +27 -0
- package/src/representations/Representation.ts +35 -0
- package/src/representations/RepresentationFactory.ts +49 -0
- package/src/types.ts +270 -53
- package/src/utils/Comparators.ts +19 -0
- package/src/utils/ExtendedArray.ts +11 -0
- package/src/utils/FileUtils.ts +60 -0
- package/src/utils/SarifUtils.ts +20 -72
- package/test-data/sarif/codeql-python.sarif +1448 -1
- package/test-data/sarif/codeql-typescript.sarif +3474 -1
- package/test-data/sarif/grype-github-actions.sarif +65 -0
- package/test-data/sarif/osv-scanner-composer.sarif +972 -0
- package/test-data/sarif/osv-scanner-container.sarif +2278 -0
- package/test-data/sarif/osv-scanner-gomodules.sarif +813 -0
- package/test-data/sarif/osv-scanner-hex.sarif +147 -0
- package/test-data/sarif/osv-scanner-maven.sarif +171 -0
- package/test-data/sarif/osv-scanner-npm.sarif +627 -0
- package/test-data/sarif/osv-scanner-pip.sarif +206 -0
- package/test-data/sarif/osv-scanner-pipenv.sarif +243 -0
- package/test-data/sarif/osv-scanner-pnpm.sarif +174 -0
- package/test-data/sarif/osv-scanner-poetry.sarif +1893 -0
- package/test-data/sarif/osv-scanner-rubygems.sarif +402 -0
- package/test-data/sarif/osv-scanner-uv.sarif +206 -0
- package/test-data/sarif/osv-scanner-yarn.sarif +5207 -0
- package/test-data/sarif/runs-0.sarif +5 -0
- package/test-data/sarif/runs-2-tools-2-results-0.sarif +1 -1
- package/test-data/sarif/runs-2-tools-2.sarif +1 -1
- package/test-data/sarif/runs-3-tools-2-results-0.sarif +1 -1
- package/test-data/sarif/runs-3-tools-2.sarif +1 -1
- package/test-data/sarif/tmp/codeql-csharp.sarif +1 -0
- package/test-data/sarif/tmp/grype-container.sarif +1774 -0
- package/test-data/sarif/tmp/runs-1-tools-1-results-0.sarif +18 -0
- package/test-data/sarif/tmp/runs-2-tools-2.sarif +686 -0
- package/test-data/sarif/trivy-iac.sarif +1 -1
- package/tests/integration/SendSarifToSlack.spec.ts +95 -27
- package/tsconfig.json +2 -0
- package/dist/Processors.d.ts +0 -2
- package/dist/Processors.d.ts.map +0 -1
- package/dist/Processors.js +0 -61
- package/dist/SarifToSlackService.d.ts +0 -39
- package/dist/SarifToSlackService.d.ts.map +0 -1
- package/dist/SarifToSlackService.js +0 -104
- package/dist/metadata.d.ts +0 -2
- package/dist/metadata.d.ts.map +0 -1
- package/dist/metadata.js +0 -11
- package/dist/model/SarifModelPerRun.d.ts +0 -2
- package/dist/model/SarifModelPerRun.d.ts.map +0 -1
- package/dist/model/SarifModelPerRun.js +0 -90
- package/dist/model/SarifModelPerSarif.d.ts +0 -2
- package/dist/model/SarifModelPerSarif.d.ts.map +0 -1
- package/dist/model/SarifModelPerSarif.js +0 -102
- package/dist/model/types.d.ts +0 -2
- package/dist/model/types.d.ts.map +0 -1
- package/dist/model/types.js +0 -49
- package/dist/utils/SortUtils.d.ts +0 -2
- package/dist/utils/SortUtils.d.ts.map +0 -1
- package/dist/utils/SortUtils.js +0 -20
- package/src/Processors.ts +0 -68
- package/src/SarifToSlackService.ts +0 -117
- package/src/metadata.ts +0 -10
- package/src/model/SarifModelPerRun.ts +0 -120
- package/src/model/SarifModelPerSarif.ts +0 -126
- package/src/model/types.ts +0 -50
- package/src/utils/SortUtils.ts +0 -33
- package/tests/Processors.spec.ts +0 -76
package/dist/types.d.ts
CHANGED
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
/**
|
|
3
|
-
* Type representing a SARIF log.
|
|
4
|
-
* @public
|
|
5
|
-
*/
|
|
6
|
-
export type SarifLog = Log;
|
|
1
|
+
import { ColorOptions } from './model/Color';
|
|
7
2
|
/**
|
|
8
3
|
* Interface for a Slack message that can be sent.
|
|
9
4
|
* @public
|
|
@@ -14,10 +9,10 @@ export interface SlackMessage {
|
|
|
14
9
|
* @returns A promise that resolves to the response from the Slack webhook.
|
|
15
10
|
*/
|
|
16
11
|
send: () => Promise<string>;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
12
|
+
withActor(actor?: string): void;
|
|
13
|
+
withFooter(text?: string, type?: FooterType): void;
|
|
14
|
+
withHeader(header?: string): void;
|
|
15
|
+
withRun(): void;
|
|
21
16
|
}
|
|
22
17
|
/**
|
|
23
18
|
* Enum representing log levels for the service.
|
|
@@ -99,55 +94,93 @@ export type FooterOptions = IncludeAwareWithValueOptions & {
|
|
|
99
94
|
type?: FooterType;
|
|
100
95
|
};
|
|
101
96
|
/**
|
|
102
|
-
*
|
|
97
|
+
* This represents what type of message should be sent. There are various options
|
|
98
|
+
* to show information from SARIF in Slack message.
|
|
103
99
|
* @public
|
|
104
100
|
*/
|
|
105
|
-
export declare enum
|
|
101
|
+
export declare enum RepresentationType {
|
|
106
102
|
/**
|
|
107
|
-
*
|
|
108
|
-
*
|
|
103
|
+
* Compact information about findings grouped by Run with the level representation.
|
|
104
|
+
* @example
|
|
105
|
+
* ```text
|
|
106
|
+
* [Run 1] Grype
|
|
107
|
+
* Error: 1, Warning: 4
|
|
108
|
+
* [Run 2] Grype
|
|
109
|
+
* Warning: 1, Note: 20
|
|
110
|
+
* ```
|
|
109
111
|
*/
|
|
110
|
-
|
|
112
|
+
CompactGroupByRunPerLevel = 0,
|
|
111
113
|
/**
|
|
112
|
-
*
|
|
114
|
+
* Compact information about findings grouped by Run with the severity representation.
|
|
115
|
+
* @example
|
|
116
|
+
* ```text
|
|
117
|
+
* [Run 1] Grype
|
|
118
|
+
* Critical: 1, High: 3, Medium: 1
|
|
119
|
+
* [Run 2] Grype
|
|
120
|
+
* Medium: 1, Low: 20
|
|
121
|
+
* ```
|
|
113
122
|
*/
|
|
114
|
-
|
|
123
|
+
CompactGroupByRunPerSeverity = 1,
|
|
115
124
|
/**
|
|
116
|
-
*
|
|
117
|
-
*
|
|
125
|
+
* Compact information about findings grouped by tool name with the level representation.
|
|
126
|
+
* @example
|
|
127
|
+
* ```text
|
|
128
|
+
* Grype
|
|
129
|
+
* Error: 1, Warning: 5, Note: 20
|
|
130
|
+
* ```
|
|
118
131
|
*/
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
132
|
+
CompactGroupByToolNamePerLevel = 2,
|
|
133
|
+
/**
|
|
134
|
+
* Compact information about findings grouped by tool name with the severity representation.
|
|
135
|
+
* @example
|
|
136
|
+
* ```text
|
|
137
|
+
* Grype
|
|
138
|
+
* Critical: 1, High: 3, Medium: 2, Low: 20
|
|
139
|
+
* ```
|
|
140
|
+
*/
|
|
141
|
+
CompactGroupByToolNamePerSeverity = 3,
|
|
142
|
+
/**
|
|
143
|
+
* Compact information about findings grouped by SARIF file with the level representation.
|
|
144
|
+
* @example
|
|
145
|
+
* ```text
|
|
146
|
+
* grype-results-01.sarif
|
|
147
|
+
* Error: 1, Warning: 2, Note: 1
|
|
148
|
+
* grype-results-02.sarif
|
|
149
|
+
* Warning: 3, Note: 19
|
|
150
|
+
* ```
|
|
151
|
+
*/
|
|
152
|
+
CompactGroupBySarifPerLevel = 4,
|
|
153
|
+
/**
|
|
154
|
+
* Compact information about findings grouped by SARIF file with the severity
|
|
155
|
+
* representation.
|
|
156
|
+
* @example
|
|
157
|
+
* ```text
|
|
158
|
+
* grype-results-01.sarif
|
|
159
|
+
* High: 3, Medium: 1, Low: 11
|
|
160
|
+
* grype-results-02.sarif
|
|
161
|
+
* Critical: 1, Medium: 1, Low: 9
|
|
162
|
+
* ```
|
|
163
|
+
*/
|
|
164
|
+
CompactGroupBySarifPerSeverity = 5,
|
|
126
165
|
/**
|
|
127
|
-
*
|
|
128
|
-
*
|
|
129
|
-
*
|
|
130
|
-
*
|
|
131
|
-
*
|
|
166
|
+
* Compact information about findings with the level representation.
|
|
167
|
+
* @example
|
|
168
|
+
* ```text
|
|
169
|
+
* Total
|
|
170
|
+
* Error: 1, Warning: 5, Note: 20
|
|
171
|
+
* ```
|
|
132
172
|
*/
|
|
133
|
-
|
|
173
|
+
CompactTotalPerLevel = 6,
|
|
134
174
|
/**
|
|
135
|
-
*
|
|
136
|
-
*
|
|
137
|
-
*
|
|
138
|
-
*
|
|
139
|
-
*
|
|
175
|
+
* Compact information about findings with the severity representation.
|
|
176
|
+
* @example
|
|
177
|
+
* ```text
|
|
178
|
+
* Total
|
|
179
|
+
* Critical: 1, High: 3, Medium: 2, Low: 20
|
|
180
|
+
* ```
|
|
140
181
|
*/
|
|
141
|
-
|
|
182
|
+
CompactTotalPerSeverity = 7
|
|
142
183
|
}
|
|
143
|
-
/**
|
|
144
|
-
* Options for how to output the results in the Slack message.
|
|
145
|
-
* @public
|
|
146
|
-
*/
|
|
147
|
-
export type SarifToSlackOutput = {
|
|
148
|
-
groupBy?: GroupResultsBy;
|
|
149
|
-
calculateBy?: CalculateResultsBy;
|
|
150
|
-
};
|
|
151
184
|
/**
|
|
152
185
|
* Options for logging.
|
|
153
186
|
* @public
|
|
@@ -161,20 +194,151 @@ export type LogOptions = {
|
|
|
161
194
|
colored?: boolean;
|
|
162
195
|
};
|
|
163
196
|
/**
|
|
164
|
-
*
|
|
197
|
+
* SARIF file extension.
|
|
198
|
+
* @public
|
|
199
|
+
*/
|
|
200
|
+
export type SarifFileExtension = 'sarif' | 'json';
|
|
201
|
+
/**
|
|
202
|
+
* Represents options for the provided SARIF file(s), such as path, should files
|
|
203
|
+
* from this path be retrieved recursively or not, and file extension.
|
|
204
|
+
* @public
|
|
205
|
+
*/
|
|
206
|
+
export type SarifOptions = {
|
|
207
|
+
path: string;
|
|
208
|
+
recursive?: boolean;
|
|
209
|
+
extension?: SarifFileExtension;
|
|
210
|
+
};
|
|
211
|
+
/**
|
|
212
|
+
* This enum represents the condition on when message should be sent. If this
|
|
213
|
+
* condition is satisfied then message is sent, otherwise - message is not sent.
|
|
214
|
+
* @public
|
|
215
|
+
*/
|
|
216
|
+
export declare enum SendIf {
|
|
217
|
+
/**
|
|
218
|
+
* Send message only if there is at least one finding with "Critical" severity.
|
|
219
|
+
* Since it is the higher possible severity, it is the same as "Critical" or
|
|
220
|
+
* higher.
|
|
221
|
+
*/
|
|
222
|
+
SeverityCritical = 0,
|
|
223
|
+
/**
|
|
224
|
+
* Send message only if there is at least one finding with "High" severity.
|
|
225
|
+
*/
|
|
226
|
+
SeverityHigh = 1,
|
|
227
|
+
/**
|
|
228
|
+
* Send message only if there is at least one finding with "High" severity or
|
|
229
|
+
* higher, that includes "High" and "Critical".
|
|
230
|
+
*/
|
|
231
|
+
SeverityHighOrHigher = 2,
|
|
232
|
+
/**
|
|
233
|
+
* Send message only if there is at least one finding with "Medium" severity.
|
|
234
|
+
*/
|
|
235
|
+
SeverityMedium = 3,
|
|
236
|
+
/**
|
|
237
|
+
* Send message only if there is at least one finding with "Medium" severity
|
|
238
|
+
* or higher, that includes "Medium", "High" and "Critical".
|
|
239
|
+
*/
|
|
240
|
+
SeverityMediumOrHigher = 4,
|
|
241
|
+
/**
|
|
242
|
+
* Send message only if there is at least one finding with "Low" severity.
|
|
243
|
+
*/
|
|
244
|
+
SeverityLow = 5,
|
|
245
|
+
/**
|
|
246
|
+
* Send message only if there is at least one finding with "Low" severity or
|
|
247
|
+
* higher, that includes "Low", "Medium", "High" and "Critical".
|
|
248
|
+
*/
|
|
249
|
+
SeverityLowOrHigher = 6,
|
|
250
|
+
/**
|
|
251
|
+
* Send message only if there is at least one finding with "None" severity.
|
|
252
|
+
*/
|
|
253
|
+
SeverityNone = 7,
|
|
254
|
+
/**
|
|
255
|
+
* Send message only if there is at least one finding with "None" severity or
|
|
256
|
+
* higher, that includes "None", "Low", "Medium", "High" and "Critical".
|
|
257
|
+
*/
|
|
258
|
+
SeverityNoneOrHigher = 8,
|
|
259
|
+
/**
|
|
260
|
+
* Send message only if there is at least one finding with "Unknown" severity.
|
|
261
|
+
*/
|
|
262
|
+
SeverityUnknown = 9,
|
|
263
|
+
/**
|
|
264
|
+
* Send message only if there is at least one finding with "Unknown" severity
|
|
265
|
+
* or higher, that includes "Unknown", "None", "Low", "Medium", "High" and "Critical".
|
|
266
|
+
*/
|
|
267
|
+
SeverityUnknownOrHigher = 10,
|
|
268
|
+
/**
|
|
269
|
+
* Send message only if there is at least one finding with "Error" level.
|
|
270
|
+
* Since it is the higher possible level, it is the same as "Error" or higher.
|
|
271
|
+
*/
|
|
272
|
+
LevelError = 11,
|
|
273
|
+
/**
|
|
274
|
+
* Send message only if there is at least one finding with "Warning" level.
|
|
275
|
+
*/
|
|
276
|
+
LevelWarning = 12,
|
|
277
|
+
/**
|
|
278
|
+
* Send message only if there is at least one finding with "Warning" level or
|
|
279
|
+
* higher, that includes "Warning" and "Error".
|
|
280
|
+
*/
|
|
281
|
+
LevelWarningOrHigher = 13,
|
|
282
|
+
/**
|
|
283
|
+
* Send message only if there is at least one finding with "Note" level.
|
|
284
|
+
*/
|
|
285
|
+
LevelNote = 14,
|
|
286
|
+
/**
|
|
287
|
+
* Send message only if there is at least one finding with "Note" level or
|
|
288
|
+
* higher, that includes "Note", "Warning" and "Error.
|
|
289
|
+
*/
|
|
290
|
+
LevelNoteOrHigher = 15,
|
|
291
|
+
/**
|
|
292
|
+
* Send message only if there is at least one finding with "None" level.
|
|
293
|
+
*/
|
|
294
|
+
LevelNone = 16,
|
|
295
|
+
/**
|
|
296
|
+
* Send message only if there is at least one finding with "None" level or
|
|
297
|
+
* higher, that includes "None", "Note", "Warning" and "Error.
|
|
298
|
+
*/
|
|
299
|
+
LevelNoneOrHigher = 17,
|
|
300
|
+
/**
|
|
301
|
+
* Send message only if there is at least one finding with "Unknown" level.
|
|
302
|
+
*/
|
|
303
|
+
LevelUnknown = 18,
|
|
304
|
+
/**
|
|
305
|
+
* Send message only if there is at least one finding with "Unknown" level or
|
|
306
|
+
* higher, that includes "Unknown", "None", "Note", "Warning" and "Error.
|
|
307
|
+
*/
|
|
308
|
+
LevelUnknownOrHigher = 19,
|
|
309
|
+
/**
|
|
310
|
+
* Always send a message.
|
|
311
|
+
*/
|
|
312
|
+
Always = 20,
|
|
313
|
+
/**
|
|
314
|
+
* Send a message if at least 1 vulnerability is found.
|
|
315
|
+
*/
|
|
316
|
+
Some = 21,
|
|
317
|
+
/**
|
|
318
|
+
* Send a message only if no vulnerabilities are found.
|
|
319
|
+
*/
|
|
320
|
+
Empty = 22,
|
|
321
|
+
/**
|
|
322
|
+
* Never send a message.
|
|
323
|
+
*/
|
|
324
|
+
Never = 23
|
|
325
|
+
}
|
|
326
|
+
/**
|
|
327
|
+
* Options for the SarifToSlackClient.
|
|
165
328
|
* @public
|
|
166
329
|
*/
|
|
167
|
-
export type
|
|
330
|
+
export type SarifToSlackClientOptions = {
|
|
168
331
|
webhookUrl: string;
|
|
169
|
-
|
|
332
|
+
sarif: SarifOptions;
|
|
170
333
|
username?: string;
|
|
171
334
|
iconUrl?: string;
|
|
172
|
-
color?:
|
|
335
|
+
color?: ColorOptions;
|
|
173
336
|
log?: LogOptions;
|
|
174
337
|
header?: IncludeAwareWithValueOptions;
|
|
175
338
|
footer?: FooterOptions;
|
|
176
339
|
actor?: IncludeAwareWithValueOptions;
|
|
177
340
|
run?: IncludeAwareOptions;
|
|
178
|
-
|
|
341
|
+
representation?: RepresentationType;
|
|
342
|
+
sendIf?: SendIf;
|
|
179
343
|
};
|
|
180
344
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAG5C;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B;;;OAGG;IACH,IAAI,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAA;IAC3B,SAAS,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC/B,UAAU,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,UAAU,GAAG,IAAI,CAAA;IAClD,UAAU,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACjC,OAAO,IAAI,IAAI,CAAA;CAChB;AAED;;;GAGG;AACH,oBAAY,QAAQ;IAClB;;;OAGG;IACH,KAAK,IAAI;IACT;;OAEG;IACH,KAAK,IAAI;IACT;;;OAGG;IACH,KAAK,IAAI;IACT;;;OAGG;IACH,IAAI,IAAI;IACR;;;OAGG;IACH,OAAO,IAAI;IACX;;;OAGG;IACH,KAAK,IAAI;IACT;;;OAGG;IACH,KAAK,IAAI;CACV;AAED;;;;GAIG;AACH,MAAM,MAAM,mBAAmB,GAAG;IAChC,OAAO,EAAE,OAAO,CAAA;CACjB,CAAA;AAED;;;;GAIG;AACH,MAAM,MAAM,4BAA4B,GAAG,mBAAmB,GAAG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H,WAAW,IAAA;IACX;;;OAGG;IACH,mBAAmB,IAAA;IACnB;;OAEG;IACH,YAAY,IAAA;IACZ;;;OAGG;IACH,oBAAoB,IAAA;IACpB;;OAEG;IACH,eAAe,IAAA;IACf;;;OAGG;IACH,uBAAuB,KAAA;IACvB;;;OAGG;IACH,UAAU,KAAA;IACV;;OAEG;IACH,YAAY,KAAA;IACZ;;;OAGG;IACH,oBAAoB,KAAA;IACpB;;OAEG;IACH,SAAS,KAAA;IACT;;;OAGG;IACH,iBAAiB,KAAA;IACjB;;OAEG;IACH,SAAS,KAAA;IACT;;;OAGG;IACH,iBAAiB,KAAA;IACjB;;OAEG;IACH,YAAY,KAAA;IACZ;;;OAGG;IACH,oBAAoB,KAAA;IACpB;;OAEG;IACH,MAAM,KAAA;IACN;;OAEG;IACH,IAAI,KAAA;IACJ;;OAEG;IACH,KAAK,KAAA;IACL;;OAEG;IACH,KAAK,KAAA;CACN;AAED;;;GAGG;AACH,MAAM,MAAM,yBAAyB,GAAG;IACtC,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,YAAY,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB,GAAG,CAAC,EAAE,UAAU,CAAC;IACjB,MAAM,CAAC,EAAE,4BAA4B,CAAC;IACtC,MAAM,CAAC,EAAE,aAAa,CAAC;IACvB,KAAK,CAAC,EAAE,4BAA4B,CAAC;IACrC,GAAG,CAAC,EAAE,mBAAmB,CAAC;IAC1B,cAAc,CAAC,EAAE,kBAAkB,CAAC;IACpC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAA"}
|
package/dist/types.js
CHANGED
|
@@ -56,47 +56,239 @@ export var FooterType;
|
|
|
56
56
|
FooterType["Markdown"] = "mrkdwn";
|
|
57
57
|
})(FooterType || (FooterType = {}));
|
|
58
58
|
/**
|
|
59
|
-
*
|
|
59
|
+
* This represents what type of message should be sent. There are various options
|
|
60
|
+
* to show information from SARIF in Slack message.
|
|
60
61
|
* @public
|
|
61
62
|
*/
|
|
62
|
-
export var
|
|
63
|
-
(function (
|
|
63
|
+
export var RepresentationType;
|
|
64
|
+
(function (RepresentationType) {
|
|
64
65
|
/**
|
|
65
|
-
*
|
|
66
|
-
*
|
|
66
|
+
* Compact information about findings grouped by Run with the level representation.
|
|
67
|
+
* @example
|
|
68
|
+
* ```text
|
|
69
|
+
* [Run 1] Grype
|
|
70
|
+
* Error: 1, Warning: 4
|
|
71
|
+
* [Run 2] Grype
|
|
72
|
+
* Warning: 1, Note: 20
|
|
73
|
+
* ```
|
|
67
74
|
*/
|
|
68
|
-
|
|
75
|
+
RepresentationType[RepresentationType["CompactGroupByRunPerLevel"] = 0] = "CompactGroupByRunPerLevel";
|
|
69
76
|
/**
|
|
70
|
-
*
|
|
77
|
+
* Compact information about findings grouped by Run with the severity representation.
|
|
78
|
+
* @example
|
|
79
|
+
* ```text
|
|
80
|
+
* [Run 1] Grype
|
|
81
|
+
* Critical: 1, High: 3, Medium: 1
|
|
82
|
+
* [Run 2] Grype
|
|
83
|
+
* Medium: 1, Low: 20
|
|
84
|
+
* ```
|
|
71
85
|
*/
|
|
72
|
-
|
|
86
|
+
RepresentationType[RepresentationType["CompactGroupByRunPerSeverity"] = 1] = "CompactGroupByRunPerSeverity";
|
|
73
87
|
/**
|
|
74
|
-
*
|
|
75
|
-
*
|
|
88
|
+
* Compact information about findings grouped by tool name with the level representation.
|
|
89
|
+
* @example
|
|
90
|
+
* ```text
|
|
91
|
+
* Grype
|
|
92
|
+
* Error: 1, Warning: 5, Note: 20
|
|
93
|
+
* ```
|
|
76
94
|
*/
|
|
77
|
-
|
|
78
|
-
|
|
95
|
+
RepresentationType[RepresentationType["CompactGroupByToolNamePerLevel"] = 2] = "CompactGroupByToolNamePerLevel";
|
|
96
|
+
/**
|
|
97
|
+
* Compact information about findings grouped by tool name with the severity representation.
|
|
98
|
+
* @example
|
|
99
|
+
* ```text
|
|
100
|
+
* Grype
|
|
101
|
+
* Critical: 1, High: 3, Medium: 2, Low: 20
|
|
102
|
+
* ```
|
|
103
|
+
*/
|
|
104
|
+
RepresentationType[RepresentationType["CompactGroupByToolNamePerSeverity"] = 3] = "CompactGroupByToolNamePerSeverity";
|
|
105
|
+
/**
|
|
106
|
+
* Compact information about findings grouped by SARIF file with the level representation.
|
|
107
|
+
* @example
|
|
108
|
+
* ```text
|
|
109
|
+
* grype-results-01.sarif
|
|
110
|
+
* Error: 1, Warning: 2, Note: 1
|
|
111
|
+
* grype-results-02.sarif
|
|
112
|
+
* Warning: 3, Note: 19
|
|
113
|
+
* ```
|
|
114
|
+
*/
|
|
115
|
+
RepresentationType[RepresentationType["CompactGroupBySarifPerLevel"] = 4] = "CompactGroupBySarifPerLevel";
|
|
116
|
+
/**
|
|
117
|
+
* Compact information about findings grouped by SARIF file with the severity
|
|
118
|
+
* representation.
|
|
119
|
+
* @example
|
|
120
|
+
* ```text
|
|
121
|
+
* grype-results-01.sarif
|
|
122
|
+
* High: 3, Medium: 1, Low: 11
|
|
123
|
+
* grype-results-02.sarif
|
|
124
|
+
* Critical: 1, Medium: 1, Low: 9
|
|
125
|
+
* ```
|
|
126
|
+
*/
|
|
127
|
+
RepresentationType[RepresentationType["CompactGroupBySarifPerSeverity"] = 5] = "CompactGroupBySarifPerSeverity";
|
|
128
|
+
/**
|
|
129
|
+
* Compact information about findings with the level representation.
|
|
130
|
+
* @example
|
|
131
|
+
* ```text
|
|
132
|
+
* Total
|
|
133
|
+
* Error: 1, Warning: 5, Note: 20
|
|
134
|
+
* ```
|
|
135
|
+
*/
|
|
136
|
+
RepresentationType[RepresentationType["CompactTotalPerLevel"] = 6] = "CompactTotalPerLevel";
|
|
137
|
+
/**
|
|
138
|
+
* Compact information about findings with the severity representation.
|
|
139
|
+
* @example
|
|
140
|
+
* ```text
|
|
141
|
+
* Total
|
|
142
|
+
* Critical: 1, High: 3, Medium: 2, Low: 20
|
|
143
|
+
* ```
|
|
144
|
+
*/
|
|
145
|
+
RepresentationType[RepresentationType["CompactTotalPerSeverity"] = 7] = "CompactTotalPerSeverity";
|
|
146
|
+
})(RepresentationType || (RepresentationType = {}));
|
|
79
147
|
/**
|
|
80
|
-
*
|
|
148
|
+
* This enum represents the condition on when message should be sent. If this
|
|
149
|
+
* condition is satisfied then message is sent, otherwise - message is not sent.
|
|
81
150
|
* @public
|
|
82
151
|
*/
|
|
83
|
-
export var
|
|
84
|
-
(function (
|
|
85
|
-
/**
|
|
86
|
-
*
|
|
87
|
-
*
|
|
88
|
-
*
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
*
|
|
97
|
-
*
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
152
|
+
export var SendIf;
|
|
153
|
+
(function (SendIf) {
|
|
154
|
+
/**
|
|
155
|
+
* Send message only if there is at least one finding with "Critical" severity.
|
|
156
|
+
* Since it is the higher possible severity, it is the same as "Critical" or
|
|
157
|
+
* higher.
|
|
158
|
+
*/
|
|
159
|
+
SendIf[SendIf["SeverityCritical"] = 0] = "SeverityCritical";
|
|
160
|
+
/**
|
|
161
|
+
* Send message only if there is at least one finding with "High" severity.
|
|
162
|
+
*/
|
|
163
|
+
SendIf[SendIf["SeverityHigh"] = 1] = "SeverityHigh";
|
|
164
|
+
/**
|
|
165
|
+
* Send message only if there is at least one finding with "High" severity or
|
|
166
|
+
* higher, that includes "High" and "Critical".
|
|
167
|
+
*/
|
|
168
|
+
SendIf[SendIf["SeverityHighOrHigher"] = 2] = "SeverityHighOrHigher";
|
|
169
|
+
/**
|
|
170
|
+
* Send message only if there is at least one finding with "Medium" severity.
|
|
171
|
+
*/
|
|
172
|
+
SendIf[SendIf["SeverityMedium"] = 3] = "SeverityMedium";
|
|
173
|
+
/**
|
|
174
|
+
* Send message only if there is at least one finding with "Medium" severity
|
|
175
|
+
* or higher, that includes "Medium", "High" and "Critical".
|
|
176
|
+
*/
|
|
177
|
+
SendIf[SendIf["SeverityMediumOrHigher"] = 4] = "SeverityMediumOrHigher";
|
|
178
|
+
/**
|
|
179
|
+
* Send message only if there is at least one finding with "Low" severity.
|
|
180
|
+
*/
|
|
181
|
+
SendIf[SendIf["SeverityLow"] = 5] = "SeverityLow";
|
|
182
|
+
/**
|
|
183
|
+
* Send message only if there is at least one finding with "Low" severity or
|
|
184
|
+
* higher, that includes "Low", "Medium", "High" and "Critical".
|
|
185
|
+
*/
|
|
186
|
+
SendIf[SendIf["SeverityLowOrHigher"] = 6] = "SeverityLowOrHigher";
|
|
187
|
+
/**
|
|
188
|
+
* Send message only if there is at least one finding with "None" severity.
|
|
189
|
+
*/
|
|
190
|
+
SendIf[SendIf["SeverityNone"] = 7] = "SeverityNone";
|
|
191
|
+
/**
|
|
192
|
+
* Send message only if there is at least one finding with "None" severity or
|
|
193
|
+
* higher, that includes "None", "Low", "Medium", "High" and "Critical".
|
|
194
|
+
*/
|
|
195
|
+
SendIf[SendIf["SeverityNoneOrHigher"] = 8] = "SeverityNoneOrHigher";
|
|
196
|
+
/**
|
|
197
|
+
* Send message only if there is at least one finding with "Unknown" severity.
|
|
198
|
+
*/
|
|
199
|
+
SendIf[SendIf["SeverityUnknown"] = 9] = "SeverityUnknown";
|
|
200
|
+
/**
|
|
201
|
+
* Send message only if there is at least one finding with "Unknown" severity
|
|
202
|
+
* or higher, that includes "Unknown", "None", "Low", "Medium", "High" and "Critical".
|
|
203
|
+
*/
|
|
204
|
+
SendIf[SendIf["SeverityUnknownOrHigher"] = 10] = "SeverityUnknownOrHigher";
|
|
205
|
+
/**
|
|
206
|
+
* Send message only if there is at least one finding with "Error" level.
|
|
207
|
+
* Since it is the higher possible level, it is the same as "Error" or higher.
|
|
208
|
+
*/
|
|
209
|
+
SendIf[SendIf["LevelError"] = 11] = "LevelError";
|
|
210
|
+
/**
|
|
211
|
+
* Send message only if there is at least one finding with "Warning" level.
|
|
212
|
+
*/
|
|
213
|
+
SendIf[SendIf["LevelWarning"] = 12] = "LevelWarning";
|
|
214
|
+
/**
|
|
215
|
+
* Send message only if there is at least one finding with "Warning" level or
|
|
216
|
+
* higher, that includes "Warning" and "Error".
|
|
217
|
+
*/
|
|
218
|
+
SendIf[SendIf["LevelWarningOrHigher"] = 13] = "LevelWarningOrHigher";
|
|
219
|
+
/**
|
|
220
|
+
* Send message only if there is at least one finding with "Note" level.
|
|
221
|
+
*/
|
|
222
|
+
SendIf[SendIf["LevelNote"] = 14] = "LevelNote";
|
|
223
|
+
/**
|
|
224
|
+
* Send message only if there is at least one finding with "Note" level or
|
|
225
|
+
* higher, that includes "Note", "Warning" and "Error.
|
|
226
|
+
*/
|
|
227
|
+
SendIf[SendIf["LevelNoteOrHigher"] = 15] = "LevelNoteOrHigher";
|
|
228
|
+
/**
|
|
229
|
+
* Send message only if there is at least one finding with "None" level.
|
|
230
|
+
*/
|
|
231
|
+
SendIf[SendIf["LevelNone"] = 16] = "LevelNone";
|
|
232
|
+
/**
|
|
233
|
+
* Send message only if there is at least one finding with "None" level or
|
|
234
|
+
* higher, that includes "None", "Note", "Warning" and "Error.
|
|
235
|
+
*/
|
|
236
|
+
SendIf[SendIf["LevelNoneOrHigher"] = 17] = "LevelNoneOrHigher";
|
|
237
|
+
/**
|
|
238
|
+
* Send message only if there is at least one finding with "Unknown" level.
|
|
239
|
+
*/
|
|
240
|
+
SendIf[SendIf["LevelUnknown"] = 18] = "LevelUnknown";
|
|
241
|
+
/**
|
|
242
|
+
* Send message only if there is at least one finding with "Unknown" level or
|
|
243
|
+
* higher, that includes "Unknown", "None", "Note", "Warning" and "Error.
|
|
244
|
+
*/
|
|
245
|
+
SendIf[SendIf["LevelUnknownOrHigher"] = 19] = "LevelUnknownOrHigher";
|
|
246
|
+
/**
|
|
247
|
+
* Always send a message.
|
|
248
|
+
*/
|
|
249
|
+
SendIf[SendIf["Always"] = 20] = "Always";
|
|
250
|
+
/**
|
|
251
|
+
* Send a message if at least 1 vulnerability is found.
|
|
252
|
+
*/
|
|
253
|
+
SendIf[SendIf["Some"] = 21] = "Some";
|
|
254
|
+
/**
|
|
255
|
+
* Send a message only if no vulnerabilities are found.
|
|
256
|
+
*/
|
|
257
|
+
SendIf[SendIf["Empty"] = 22] = "Empty";
|
|
258
|
+
/**
|
|
259
|
+
* Never send a message.
|
|
260
|
+
*/
|
|
261
|
+
SendIf[SendIf["Never"] = 23] = "Never";
|
|
262
|
+
})(SendIf || (SendIf = {}));
|
|
263
|
+
/**
|
|
264
|
+
* Enum of security severity.
|
|
265
|
+
* @privateRemarks Order should remain unchanged. It is used in multiple places,
|
|
266
|
+
* such as sorting in Slack message (more important come first) and to identify
|
|
267
|
+
* provided severity if it is requested severity or higher.
|
|
268
|
+
* @internal
|
|
269
|
+
*/
|
|
270
|
+
export var SecuritySeverity;
|
|
271
|
+
(function (SecuritySeverity) {
|
|
272
|
+
SecuritySeverity[SecuritySeverity["Unknown"] = 0] = "Unknown";
|
|
273
|
+
SecuritySeverity[SecuritySeverity["None"] = 1] = "None";
|
|
274
|
+
SecuritySeverity[SecuritySeverity["Low"] = 2] = "Low";
|
|
275
|
+
SecuritySeverity[SecuritySeverity["Medium"] = 3] = "Medium";
|
|
276
|
+
SecuritySeverity[SecuritySeverity["High"] = 4] = "High";
|
|
277
|
+
SecuritySeverity[SecuritySeverity["Critical"] = 5] = "Critical";
|
|
278
|
+
})(SecuritySeverity || (SecuritySeverity = {}));
|
|
279
|
+
/**
|
|
280
|
+
* Enum of security level.
|
|
281
|
+
* @privateRemarks Order should remain unchanged. It is used in multiple places,
|
|
282
|
+
* such as sorting in Slack message (more important come first) and to identify
|
|
283
|
+
* provided level if it is requested level or higher.
|
|
284
|
+
* @internal
|
|
285
|
+
*/
|
|
286
|
+
export var SecurityLevel;
|
|
287
|
+
(function (SecurityLevel) {
|
|
288
|
+
SecurityLevel[SecurityLevel["Unknown"] = 0] = "Unknown";
|
|
289
|
+
SecurityLevel[SecurityLevel["None"] = 1] = "None";
|
|
290
|
+
SecurityLevel[SecurityLevel["Note"] = 2] = "Note";
|
|
291
|
+
SecurityLevel[SecurityLevel["Warning"] = 3] = "Warning";
|
|
292
|
+
SecurityLevel[SecurityLevel["Error"] = 4] = "Error";
|
|
293
|
+
})(SecurityLevel || (SecurityLevel = {}));
|
|
294
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHlwZXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvdHlwZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBb0JBOzs7R0FHRztBQUNILE1BQU0sQ0FBTixJQUFZLFFBbUNYO0FBbkNELFdBQVksUUFBUTtJQUNsQjs7O09BR0c7SUFDSCx5Q0FBUyxDQUFBO0lBQ1Q7O09BRUc7SUFDSCx5Q0FBUyxDQUFBO0lBQ1Q7OztPQUdHO0lBQ0gseUNBQVMsQ0FBQTtJQUNUOzs7T0FHRztJQUNILHVDQUFRLENBQUE7SUFDUjs7O09BR0c7SUFDSCw2Q0FBVyxDQUFBO0lBQ1g7OztPQUdHO0lBQ0gseUNBQVMsQ0FBQTtJQUNUOzs7T0FHRztJQUNILHlDQUFTLENBQUE7QUFDWCxDQUFDLEVBbkNXLFFBQVEsS0FBUixRQUFRLFFBbUNuQjtBQW9CRDs7O0dBR0c7QUFDSCxNQUFNLENBQU4sSUFBWSxVQVVYO0FBVkQsV0FBWSxVQUFVO0lBQ3BCOztPQUVHO0lBQ0gsc0NBQXdCLENBQUE7SUFDeEI7OztPQUdHO0lBQ0gsaUNBQW1CLENBQUE7QUFDckIsQ0FBQyxFQVZXLFVBQVUsS0FBVixVQUFVLFFBVXJCO0FBV0Q7Ozs7R0FJRztBQUNILE1BQU0sQ0FBTixJQUFZLGtCQWtGWDtBQWxGRCxXQUFZLGtCQUFrQjtJQUM1Qjs7Ozs7Oz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1
|
+
/**
|
|
2
|
+
* This function returns a comparator function based on the property of the
|
|
3
|
+
* {@link Finding} object.
|
|
4
|
+
* @param key Property name of the {@link Finding} object.
|
|
5
|
+
* @internal
|
|
6
|
+
*/
|
|
7
|
+
export function findingsComparatorByKey(key) {
|
|
8
|
+
return (a, b) => {
|
|
9
|
+
switch (key) {
|
|
10
|
+
case 'severity': return b.severity - a.severity;
|
|
11
|
+
case 'level': return b.level - a.level;
|
|
12
|
+
case 'runId': return a.runId - b.runId;
|
|
13
|
+
case 'toolName': return a.toolName.toLowerCase().localeCompare(b.toolName.toLowerCase());
|
|
14
|
+
default: return 1;
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiQ29tcGFyYXRvcnMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvdXRpbHMvQ29tcGFyYXRvcnMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBRUE7Ozs7O0dBS0c7QUFDSCxNQUFNLFVBQVUsdUJBQXVCLENBQTBCLEdBQU07SUFDckUsT0FBTyxDQUFDLENBQVUsRUFBRSxDQUFVLEVBQVUsRUFBRTtRQUN4QyxRQUFRLEdBQUcsRUFBRSxDQUFDO1lBQ1osS0FBSyxVQUFVLENBQUMsQ0FBQyxPQUFPLENBQUMsQ0FBQyxRQUFRLEdBQUcsQ0FBQyxDQUFDLFFBQVEsQ0FBQTtZQUMvQyxLQUFLLE9BQU8sQ0FBQyxDQUFDLE9BQU8sQ0FBQyxDQUFDLEtBQUssR0FBRyxDQUFDLENBQUMsS0FBSyxDQUFBO1lBQ3RDLEtBQUssT0FBTyxDQUFDLENBQUMsT0FBTyxDQUFDLENBQUMsS0FBSyxHQUFHLENBQUMsQ0FBQyxLQUFLLENBQUE7WUFDdEMsS0FBSyxVQUFVLENBQUMsQ0FBQyxPQUFPLENBQUMsQ0FBQyxRQUFRLENBQUMsV0FBVyxFQUFFLENBQUMsYUFBYSxDQUFDLENBQUMsQ0FBQyxRQUFRLENBQUMsV0FBVyxFQUFFLENBQUMsQ0FBQTtZQUN4RixPQUFPLENBQUMsQ0FBQyxPQUFPLENBQUMsQ0FBQTtRQUNuQixDQUFDO0lBQ0gsQ0FBQyxDQUFBO0FBQ0gsQ0FBQyJ9
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExtendedArray.d.ts","sourceRoot":"","sources":["../../src/utils/ExtendedArray.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This class is an extension for the {@link Array} class. It adds some additional
|
|
3
|
+
* useful methods.
|
|
4
|
+
* @internal
|
|
5
|
+
*/
|
|
6
|
+
export default class ExtendedArray extends Array {
|
|
7
|
+
findByProperty(prop, value) {
|
|
8
|
+
return this.find((v) => v[prop] === value);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiRXh0ZW5kZWRBcnJheS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91dGlscy9FeHRlbmRlZEFycmF5LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOzs7O0dBSUc7QUFDSCxNQUFNLENBQUMsT0FBTyxPQUFPLGFBQWlCLFNBQVEsS0FBUTtJQUU3QyxjQUFjLENBQW9CLElBQU8sRUFBRSxLQUFXO1FBQzNELE9BQU8sSUFBSSxDQUFDLElBQUksQ0FBQyxDQUFDLENBQUksRUFBVyxFQUFFLENBQUMsQ0FBQyxDQUFDLElBQUksQ0FBQyxLQUFLLEtBQUssQ0FBQyxDQUFBO0lBQ3hELENBQUM7Q0FDRiJ9
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FileUtils.d.ts","sourceRoot":"","sources":["../../src/utils/FileUtils.ts"],"names":[],"mappings":""}
|