@devtron-labs/devtron-fe-common-lib 0.3.14-beta-2 → 0.3.15-beta-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/Common/Helper.d.ts +0 -1
- package/dist/Common/Toggle/Toggle.d.ts +1 -2
- package/dist/Common/Types.d.ts +0 -5
- package/dist/Common/index.d.ts +0 -1
- package/dist/Pages/App/AppConfigurations/utils.d.ts +1 -1
- package/dist/Shared/Components/CICDHistory/DeploymentHistoryDiff/DeploymentHistoryConfigList.component.d.ts +3 -0
- package/dist/Shared/Components/CICDHistory/DeploymentHistoryDiff/DeploymentHistoryDetailedView.d.ts +3 -0
- package/dist/Shared/Components/CICDHistory/{DeploymentHistoryConfigDiff → DeploymentHistoryDiff}/DeploymentHistoryDiffView.d.ts +1 -1
- package/dist/Shared/Components/CICDHistory/DeploymentHistoryDiff/DeploymentHistoryHeader.d.ts +3 -0
- package/dist/Shared/Components/CICDHistory/DeploymentHistoryDiff/DeploymentHistorySidebar.d.ts +3 -0
- package/dist/Shared/Components/CICDHistory/DeploymentHistoryDiff/index.d.ts +3 -0
- package/dist/Shared/Components/CICDHistory/DeploymentHistoryDiff/types.d.ts +35 -0
- package/dist/Shared/Components/CICDHistory/DeploymentHistoryDiff/utils.d.ts +11 -0
- package/dist/Shared/Components/CICDHistory/TriggerOutput.d.ts +1 -1
- package/dist/Shared/Components/CICDHistory/index.d.ts +1 -1
- package/dist/Shared/Components/CICDHistory/types.d.ts +4 -2
- package/dist/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiff.component.d.ts +1 -1
- package/dist/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiff.types.d.ts +10 -27
- package/dist/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiff.utils.d.ts +3 -10
- package/dist/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiffAccordion.d.ts +2 -9
- package/dist/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiffMain.d.ts +1 -1
- package/dist/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiffNavigation.d.ts +1 -1
- package/dist/Shared/Components/ImageCardAccordion/ImageCardAccordion.d.ts +1 -1
- package/dist/Shared/Components/ImageCardAccordion/types.d.ts +4 -1
- package/dist/Shared/Components/Security/SecurityModal/SecurityModal.d.ts +14 -0
- package/dist/Shared/Components/Security/SecurityModal/components/IndexedTextDisplay.d.ts +4 -0
- package/dist/Shared/Components/Security/SecurityModal/components/InfoCard.d.ts +4 -0
- package/dist/Shared/Components/Security/SecurityModal/components/OpenDetailViewButton.d.ts +4 -0
- package/dist/Shared/Components/Security/SecurityModal/components/Table.d.ts +4 -0
- package/dist/Shared/Components/Security/SecurityModal/components/index.d.ts +3 -0
- package/dist/Shared/Components/Security/SecurityModal/config/CodeScan.d.ts +100 -0
- package/dist/Shared/Components/Security/SecurityModal/config/EmptyState.d.ts +2 -0
- package/dist/Shared/Components/Security/SecurityModal/config/ImageScan.d.ts +4 -0
- package/dist/Shared/Components/Security/SecurityModal/config/InfoCard.d.ts +2 -0
- package/dist/Shared/Components/Security/SecurityModal/config/KubernetesManifest.d.ts +4 -0
- package/dist/Shared/Components/Security/SecurityModal/config/Sidebar.d.ts +2 -0
- package/dist/Shared/Components/Security/SecurityModal/config/Table.d.ts +2 -0
- package/dist/Shared/Components/Security/SecurityModal/config/index.d.ts +3 -0
- package/dist/Shared/Components/Security/SecurityModal/constants.d.ts +56 -0
- package/dist/Shared/Components/Security/SecurityModal/index.d.ts +6 -0
- package/dist/Shared/Components/Security/SecurityModal/service.d.ts +3 -0
- package/dist/Shared/Components/Security/SecurityModal/types.d.ts +264 -0
- package/dist/Shared/Components/Security/SecurityModal/utils.d.ts +34 -0
- package/dist/Shared/Components/Security/SecuritySummaryCard/SecuritySummaryCard.d.ts +3 -0
- package/dist/Shared/Components/Security/SecuritySummaryCard/index.d.ts +1 -0
- package/dist/Shared/Components/Security/SecuritySummaryCard/types.d.ts +12 -0
- package/dist/Shared/Components/{Vulnerabilities → Security/Vulnerabilities}/Vulnerabilities.d.ts +1 -1
- package/dist/Shared/Components/Security/Vulnerabilities/types.d.ts +24 -0
- package/dist/Shared/Components/Security/Vulnerabilities/utils.d.ts +6 -0
- package/dist/Shared/Components/Security/index.d.ts +4 -0
- package/dist/Shared/Components/Security/utils.d.ts +4 -0
- package/dist/Shared/Components/SelectPicker/type.d.ts +1 -6
- package/dist/Shared/Components/index.d.ts +1 -1
- package/dist/Shared/Helpers.d.ts +0 -13
- package/dist/Shared/Services/app.service.d.ts +1 -7
- package/dist/Shared/Services/app.types.d.ts +7 -34
- package/dist/Shared/constants.d.ts +4 -0
- package/dist/Shared/types.d.ts +1 -0
- package/dist/assets/index.css +1 -1
- package/dist/{cssMode-8G3MbCuv.js → cssMode-B75flUVR.js} +1 -1
- package/dist/{freemarker2-Cdms4rgp.js → freemarker2-CWe54stz.js} +1 -1
- package/dist/{handlebars-Dg3zpYFY.js → handlebars-rO7mEEEv.js} +1 -1
- package/dist/{html-iUPctsJZ.js → html-CwoFDRgy.js} +1 -1
- package/dist/{htmlMode-CQTplCMn.js → htmlMode-C3UVV2bH.js} +1 -1
- package/dist/{index-Cmo4Tc49.js → index-ZHrTp-NX.js} +50329 -48934
- package/dist/index.js +504 -500
- package/dist/{javascript-hGmfHDU3.js → javascript-4ewCrr0L.js} +1 -1
- package/dist/{jsonMode-Ba6fIHOv.js → jsonMode-DDK5J66q.js} +1 -1
- package/dist/{liquid-BwrItieM.js → liquid-DSbxUTYb.js} +1 -1
- package/dist/{mdx-lZEgCFP3.js → mdx-1j7UFmMS.js} +1 -1
- package/dist/{python-OCkf3aBj.js → python-CcrpriTV.js} +1 -1
- package/dist/{razor-BqWLThdb.js → razor-9VeGILnj.js} +1 -1
- package/dist/{tsMode-BQiLrbqV.js → tsMode-GmziVAdm.js} +1 -1
- package/dist/{typescript-CUOLGMm7.js → typescript-C8UX4alO.js} +1 -1
- package/dist/{xml-BIbLArL1.js → xml-uyZlQDCt.js} +1 -1
- package/dist/{yaml-vEYtbKD4.js → yaml-DNNifw2F.js} +1 -1
- package/package.json +5 -4
- package/dist/Common/Security/ScanVulnerabilitiesTable.d.ts +0 -2
- package/dist/Common/Security/types.d.ts +0 -4
- package/dist/Shared/Components/CICDHistory/DeploymentHistoryConfigDiff/DeploymentHistoryConfigDiff.d.ts +0 -2
- package/dist/Shared/Components/CICDHistory/DeploymentHistoryConfigDiff/DeploymentHistoryConfigDiffCompare.d.ts +0 -2
- package/dist/Shared/Components/CICDHistory/DeploymentHistoryConfigDiff/helpers.d.ts +0 -6
- package/dist/Shared/Components/CICDHistory/DeploymentHistoryConfigDiff/index.d.ts +0 -2
- package/dist/Shared/Components/CICDHistory/DeploymentHistoryConfigDiff/types.d.ts +0 -35
- package/dist/Shared/Components/CICDHistory/DeploymentHistoryConfigDiff/utils.d.ts +0 -20
- package/dist/Shared/Components/Vulnerabilities/constants.d.ts +0 -4
- package/dist/Shared/Components/Vulnerabilities/service.d.ts +0 -2
- package/dist/Shared/Components/Vulnerabilities/types.d.ts +0 -7
- package/dist/Shared/Components/Vulnerabilities/utils.d.ts +0 -4
- /package/dist/Shared/Components/{Vulnerabilities → Security/Vulnerabilities}/index.d.ts +0 -0
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { GenericEmptyStateType } from '../../../../Common/Types';
|
|
3
|
+
import { LastExecutionResultType, NodeType, Nodes } from '../../../types';
|
|
4
|
+
import { SegmentedBarChartProps } from '../../../../Common/SegmentedBarChart';
|
|
5
|
+
import { ServerErrors } from '../../../../Common/ServerError';
|
|
6
|
+
export interface GetResourceScanDetailsPayloadType {
|
|
7
|
+
name: string;
|
|
8
|
+
namespace: string;
|
|
9
|
+
group: string;
|
|
10
|
+
version: string;
|
|
11
|
+
kind: Nodes | NodeType;
|
|
12
|
+
clusterId: number;
|
|
13
|
+
appId?: string;
|
|
14
|
+
appType?: number;
|
|
15
|
+
deploymentType?: number;
|
|
16
|
+
isAppDetailView?: boolean;
|
|
17
|
+
}
|
|
18
|
+
export interface AppDetailsPayload {
|
|
19
|
+
appId?: number | string;
|
|
20
|
+
envId?: number | string;
|
|
21
|
+
installedAppId?: number | string;
|
|
22
|
+
artifactId?: number | string;
|
|
23
|
+
installedAppVersionHistoryId?: number | string;
|
|
24
|
+
}
|
|
25
|
+
export interface ExecutionDetailsPayload extends Partial<Pick<AppDetailsPayload, 'appId' | 'envId'>> {
|
|
26
|
+
imageScanDeployInfoId?: number | string;
|
|
27
|
+
artifactId?: number | string;
|
|
28
|
+
}
|
|
29
|
+
export declare const CATEGORIES: {
|
|
30
|
+
readonly IMAGE_SCAN: "imageScan";
|
|
31
|
+
readonly CODE_SCAN: "codeScan";
|
|
32
|
+
readonly KUBERNETES_MANIFEST: "kubernetesManifest";
|
|
33
|
+
};
|
|
34
|
+
export declare const SUB_CATEGORIES: {
|
|
35
|
+
readonly VULNERABILITIES: "vulnerability";
|
|
36
|
+
readonly LICENSE: "license";
|
|
37
|
+
readonly MISCONFIGURATIONS: "misConfigurations";
|
|
38
|
+
readonly EXPOSED_SECRETS: "exposedSecrets";
|
|
39
|
+
};
|
|
40
|
+
export declare enum SortOrderEnum {
|
|
41
|
+
'ASC' = 1,
|
|
42
|
+
'DESC' = -1
|
|
43
|
+
}
|
|
44
|
+
export type TableRowCellType = {
|
|
45
|
+
component: React.ReactNode | JSX.Element;
|
|
46
|
+
cellContent: string | object;
|
|
47
|
+
};
|
|
48
|
+
export type TableHeaderCellType = {
|
|
49
|
+
headerText: string;
|
|
50
|
+
isSortable: boolean;
|
|
51
|
+
width: number;
|
|
52
|
+
compareFunc?: (a: TableRowCellType['cellContent'], b: TableRowCellType['cellContent']) => number;
|
|
53
|
+
defaultSortOrder?: SortOrderEnum;
|
|
54
|
+
};
|
|
55
|
+
export interface TableRowType {
|
|
56
|
+
id: string | number;
|
|
57
|
+
cells: Array<TableRowCellType>;
|
|
58
|
+
expandableComponent: React.ReactNode | JSX.Element;
|
|
59
|
+
}
|
|
60
|
+
export interface TablePropsType {
|
|
61
|
+
headers: Array<TableHeaderCellType>;
|
|
62
|
+
rows: Array<TableRowType>;
|
|
63
|
+
defaultSortIndex?: number;
|
|
64
|
+
hasExpandableRows?: boolean;
|
|
65
|
+
headerTopPosition?: number;
|
|
66
|
+
}
|
|
67
|
+
export type TableSortStateType = {
|
|
68
|
+
index: number;
|
|
69
|
+
order: SortOrderEnum;
|
|
70
|
+
};
|
|
71
|
+
export interface InfoCardPropsType {
|
|
72
|
+
entities: SegmentedBarChartProps['entities'];
|
|
73
|
+
lastScanTimeString?: string;
|
|
74
|
+
scanToolId?: number;
|
|
75
|
+
}
|
|
76
|
+
export interface StatusType {
|
|
77
|
+
status: 'Completed' | 'Running' | 'Failed' | 'Progressing';
|
|
78
|
+
StartedOn: string;
|
|
79
|
+
scanToolName: 'TRIVY' | 'CLAIR';
|
|
80
|
+
}
|
|
81
|
+
export type DetailViewDataType = {
|
|
82
|
+
titlePrefix: string;
|
|
83
|
+
title: string;
|
|
84
|
+
status: StatusType['status'];
|
|
85
|
+
} & TablePropsType & InfoCardPropsType;
|
|
86
|
+
export type SecurityModalStateType = {
|
|
87
|
+
category: (typeof CATEGORIES)[keyof typeof CATEGORIES];
|
|
88
|
+
subCategory: (typeof SUB_CATEGORIES)[keyof typeof SUB_CATEGORIES];
|
|
89
|
+
detailViewData: DetailViewDataType[];
|
|
90
|
+
};
|
|
91
|
+
export interface SidebarPropsType {
|
|
92
|
+
isHelmApp: boolean;
|
|
93
|
+
modalState: SecurityModalStateType;
|
|
94
|
+
setModalState: React.Dispatch<React.SetStateAction<SecurityModalStateType>>;
|
|
95
|
+
isExternalCI: boolean;
|
|
96
|
+
}
|
|
97
|
+
export declare enum SeveritiesDTO {
|
|
98
|
+
CRITICAL = "CRITICAL",
|
|
99
|
+
HIGH = "HIGH",
|
|
100
|
+
MEDIUM = "MEDIUM",
|
|
101
|
+
LOW = "LOW",
|
|
102
|
+
UNKNOWN = "UNKNOWN",
|
|
103
|
+
FAILURES = "fail",
|
|
104
|
+
SUCCESSES = "success",
|
|
105
|
+
EXCEPTIONS = "exceptions"
|
|
106
|
+
}
|
|
107
|
+
type Summary<T extends 'severities' | 'status'> = Record<T, Partial<Record<SeveritiesDTO, number>>>;
|
|
108
|
+
type GenericGroupType<T> = {
|
|
109
|
+
list: T[];
|
|
110
|
+
};
|
|
111
|
+
type GenericGroupTypeWithSummary<T> = {
|
|
112
|
+
summary: Summary<'severities'>;
|
|
113
|
+
} & GenericGroupType<T>;
|
|
114
|
+
type GenericGroupTypeWithMisConfSummary<T> = {
|
|
115
|
+
misConfSummary: Summary<'status'>;
|
|
116
|
+
} & GenericGroupType<T>;
|
|
117
|
+
export interface CodeScanVulnerabilityType {
|
|
118
|
+
cveId: string;
|
|
119
|
+
severity: SeveritiesDTO;
|
|
120
|
+
package: string;
|
|
121
|
+
currentVersion: string;
|
|
122
|
+
fixedInVersion: string;
|
|
123
|
+
permission?: string;
|
|
124
|
+
}
|
|
125
|
+
export interface ImageScanVulnerabilityType extends CodeScanVulnerabilityType {
|
|
126
|
+
target?: string;
|
|
127
|
+
}
|
|
128
|
+
export interface ImageScanVulnerabilityListType extends StatusType {
|
|
129
|
+
image: string;
|
|
130
|
+
summary: Summary<'severities'>;
|
|
131
|
+
list: ImageScanVulnerabilityType[];
|
|
132
|
+
}
|
|
133
|
+
export interface CodeScanLicenseType {
|
|
134
|
+
classification: string;
|
|
135
|
+
severity: string;
|
|
136
|
+
license: string;
|
|
137
|
+
package: string;
|
|
138
|
+
source: string;
|
|
139
|
+
}
|
|
140
|
+
export interface ImageScanLicenseListType extends StatusType {
|
|
141
|
+
image: string;
|
|
142
|
+
summary: Summary<'severities'>;
|
|
143
|
+
list: CodeScanLicenseType[];
|
|
144
|
+
}
|
|
145
|
+
export type ImageScan = {
|
|
146
|
+
[SUB_CATEGORIES.VULNERABILITIES]: GenericGroupTypeWithSummary<ImageScanVulnerabilityListType>;
|
|
147
|
+
[SUB_CATEGORIES.LICENSE]: GenericGroupTypeWithSummary<ImageScanLicenseListType>;
|
|
148
|
+
};
|
|
149
|
+
export interface Line {
|
|
150
|
+
number: number;
|
|
151
|
+
content: string;
|
|
152
|
+
isCause: boolean;
|
|
153
|
+
truncated: boolean;
|
|
154
|
+
}
|
|
155
|
+
export interface CauseMetadata {
|
|
156
|
+
startLine: number;
|
|
157
|
+
EndLine: number;
|
|
158
|
+
lines?: Line[];
|
|
159
|
+
}
|
|
160
|
+
export interface CodeScanMisconfigurationsDetailListType {
|
|
161
|
+
id: string;
|
|
162
|
+
title: string;
|
|
163
|
+
message: string;
|
|
164
|
+
resolution: string;
|
|
165
|
+
status: string;
|
|
166
|
+
severity: string;
|
|
167
|
+
causeMetadata: CauseMetadata;
|
|
168
|
+
}
|
|
169
|
+
export interface CodeScanMisconfigurationsListType {
|
|
170
|
+
filePath: string;
|
|
171
|
+
link: string;
|
|
172
|
+
type: string;
|
|
173
|
+
misConfSummary: Summary<'status'>;
|
|
174
|
+
summary: Summary<'severities'>;
|
|
175
|
+
list: CodeScanMisconfigurationsDetailListType[];
|
|
176
|
+
}
|
|
177
|
+
export interface CodeScanExposedSecretsDetailListType {
|
|
178
|
+
severity: string;
|
|
179
|
+
ruleId: string;
|
|
180
|
+
category: string;
|
|
181
|
+
startLine: number;
|
|
182
|
+
EndLine: number;
|
|
183
|
+
title: string;
|
|
184
|
+
lines: Line[];
|
|
185
|
+
}
|
|
186
|
+
export interface CodeScanExposedSecretsListType {
|
|
187
|
+
filePath: string;
|
|
188
|
+
link: string;
|
|
189
|
+
summary: Summary<'severities'>;
|
|
190
|
+
list: CodeScanExposedSecretsDetailListType[];
|
|
191
|
+
}
|
|
192
|
+
export type CodeScan = {
|
|
193
|
+
[SUB_CATEGORIES.VULNERABILITIES]: GenericGroupTypeWithSummary<CodeScanVulnerabilityType>;
|
|
194
|
+
[SUB_CATEGORIES.LICENSE]: GenericGroupTypeWithSummary<CodeScanLicenseType>;
|
|
195
|
+
[SUB_CATEGORIES.MISCONFIGURATIONS]: GenericGroupTypeWithMisConfSummary<CodeScanMisconfigurationsListType>;
|
|
196
|
+
[SUB_CATEGORIES.EXPOSED_SECRETS]: GenericGroupTypeWithSummary<CodeScanExposedSecretsListType>;
|
|
197
|
+
} & StatusType;
|
|
198
|
+
export type KubernetesManifest = {
|
|
199
|
+
[SUB_CATEGORIES.MISCONFIGURATIONS]: GenericGroupTypeWithMisConfSummary<CodeScanMisconfigurationsListType>;
|
|
200
|
+
[SUB_CATEGORIES.EXPOSED_SECRETS]: GenericGroupTypeWithSummary<CodeScanExposedSecretsListType>;
|
|
201
|
+
} & StatusType;
|
|
202
|
+
export type ApiResponseResultType = {
|
|
203
|
+
scanned: boolean;
|
|
204
|
+
[CATEGORIES.IMAGE_SCAN]: ImageScan;
|
|
205
|
+
[CATEGORIES.CODE_SCAN]: CodeScan;
|
|
206
|
+
[CATEGORIES.KUBERNETES_MANIFEST]: KubernetesManifest;
|
|
207
|
+
};
|
|
208
|
+
interface SecurityModalBaseProps extends Partial<Pick<SidebarPropsType, 'isExternalCI'>> {
|
|
209
|
+
isLoading: boolean;
|
|
210
|
+
error: ServerErrors;
|
|
211
|
+
responseData: ApiResponseResultType;
|
|
212
|
+
handleModalClose: (event?: React.MouseEvent<HTMLElement>) => void;
|
|
213
|
+
Sidebar: React.FC<SidebarPropsType>;
|
|
214
|
+
isHelmApp?: boolean;
|
|
215
|
+
isResourceScan?: boolean;
|
|
216
|
+
isSecurityScanV2Enabled: boolean;
|
|
217
|
+
hidePolicy?: boolean;
|
|
218
|
+
}
|
|
219
|
+
export type SecurityModalPropsType = SecurityModalBaseProps;
|
|
220
|
+
export interface IndexedTextDisplayPropsType {
|
|
221
|
+
title: string;
|
|
222
|
+
lines: Line[];
|
|
223
|
+
link: string;
|
|
224
|
+
}
|
|
225
|
+
export type SidebarDataChildType = {
|
|
226
|
+
label: string;
|
|
227
|
+
value: {
|
|
228
|
+
category: (typeof CATEGORIES)[keyof typeof CATEGORIES];
|
|
229
|
+
subCategory: (typeof SUB_CATEGORIES)[keyof typeof SUB_CATEGORIES];
|
|
230
|
+
};
|
|
231
|
+
};
|
|
232
|
+
export type SidebarDataType = {
|
|
233
|
+
label: string;
|
|
234
|
+
isExpanded: boolean;
|
|
235
|
+
children: NonNullable<SidebarDataChildType[]>;
|
|
236
|
+
hideInHelmApp?: boolean;
|
|
237
|
+
};
|
|
238
|
+
export type EmptyStateType = Pick<GenericEmptyStateType, 'image' | 'SvgImage' | 'subTitle' | 'title' | 'children'>;
|
|
239
|
+
export declare const VulnerabilityState: {
|
|
240
|
+
readonly [-1]: "Failed";
|
|
241
|
+
readonly 0: "Progressing";
|
|
242
|
+
readonly 1: "Completed";
|
|
243
|
+
};
|
|
244
|
+
export interface ImageVulnerabilityType {
|
|
245
|
+
image: string;
|
|
246
|
+
state: keyof typeof VulnerabilityState;
|
|
247
|
+
error?: string;
|
|
248
|
+
scanResult: LastExecutionResultType | null;
|
|
249
|
+
}
|
|
250
|
+
export interface VulnerabilityCountType {
|
|
251
|
+
unknownVulnerabilitiesCount: number;
|
|
252
|
+
lowVulnerabilitiesCount: number;
|
|
253
|
+
mediumVulnerabilitiesCount: number;
|
|
254
|
+
highVulnerabilitiesCount: number;
|
|
255
|
+
criticalVulnerabilitiesCount: number;
|
|
256
|
+
}
|
|
257
|
+
export interface GetResourceScanDetailsResponseType extends VulnerabilityCountType {
|
|
258
|
+
imageVulnerabilities: ImageVulnerabilityType[];
|
|
259
|
+
}
|
|
260
|
+
export interface OpenDetailViewButtonProps {
|
|
261
|
+
detailViewData: DetailViewDataType;
|
|
262
|
+
setDetailViewData: (detailViewData: DetailViewDataType) => void;
|
|
263
|
+
}
|
|
264
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { ApiResponseResultType, SeveritiesDTO, GetResourceScanDetailsResponseType, ImageScanVulnerabilityType, ImageVulnerabilityType, VulnerabilityCountType } from './types';
|
|
2
|
+
import { SEVERITIES } from './constants';
|
|
3
|
+
export declare const mapSeveritiesToSegmentedBarChartEntities: (severities: Partial<Record<keyof typeof SEVERITIES, number>>) => {
|
|
4
|
+
color: "#B1B7BC" | "#B21212" | "#F33E3E" | "#FF7E5B" | "#FFB549" | "#1DAD70";
|
|
5
|
+
label: "Critical" | "High" | "Medium" | "Low" | "Unknown" | "Failures" | "Successes" | "Exceptions";
|
|
6
|
+
value: number;
|
|
7
|
+
}[];
|
|
8
|
+
export declare const stringifySeverities: (severities: Partial<Record<keyof typeof SEVERITIES, number>>) => string;
|
|
9
|
+
export declare const getSeverityWeight: (severity: SeveritiesDTO) => number;
|
|
10
|
+
export declare const compareSeverity: (a: SeveritiesDTO, b: SeveritiesDTO) => number;
|
|
11
|
+
export declare const getSecurityScanSeveritiesCount: (data: ApiResponseResultType) => {
|
|
12
|
+
critical: number;
|
|
13
|
+
high: number;
|
|
14
|
+
medium: number;
|
|
15
|
+
low: number;
|
|
16
|
+
unknown: number;
|
|
17
|
+
};
|
|
18
|
+
export declare const compareSeverities: (a: Record<SeveritiesDTO, number>, b: Record<SeveritiesDTO, number>) => number;
|
|
19
|
+
export declare const getScanCompletedEmptyState: (scanToolId: number) => {
|
|
20
|
+
SvgImage: import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
|
|
21
|
+
title: string;
|
|
22
|
+
children: JSX.Element;
|
|
23
|
+
};
|
|
24
|
+
export declare const compareStringAndObject: (a: string | object, b: string | object) => number;
|
|
25
|
+
export declare const parseExecutionDetailResponse: (scanResult: any) => ApiResponseResultType;
|
|
26
|
+
export declare const parseGetResourceScanDetailsResponse: (data: GetResourceScanDetailsResponseType) => ApiResponseResultType;
|
|
27
|
+
export declare const getTotalVulnerabilityCount: (scannedResult: ImageVulnerabilityType[]) => VulnerabilityCountType;
|
|
28
|
+
export declare const groupByTarget: (list: ImageScanVulnerabilityType[]) => {
|
|
29
|
+
source: string;
|
|
30
|
+
list: ImageScanVulnerabilityType[];
|
|
31
|
+
summary: {
|
|
32
|
+
severities: Partial<Record<SeveritiesDTO, number>>;
|
|
33
|
+
};
|
|
34
|
+
}[];
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { SecuritySummaryCardProps } from './types';
|
|
2
|
+
declare const SecuritySummaryCard: ({ severityCount, scanToolId, rootClassName, isHelmApp, SecurityModalSidebar, responseData, isSecurityScanV2Enabled, hidePolicy, }: SecuritySummaryCardProps) => JSX.Element;
|
|
3
|
+
export default SecuritySummaryCard;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as SecuritySummaryCard } from './SecuritySummaryCard';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { SeverityCount } from '../../../types';
|
|
2
|
+
import { ImageCardAccordionProps } from '@Shared/Components/ImageCardAccordion/types';
|
|
3
|
+
import { ApiResponseResultType } from '../SecurityModal';
|
|
4
|
+
export type SecuritySummaryCardProps = {
|
|
5
|
+
severityCount: SeverityCount;
|
|
6
|
+
scanToolId: number;
|
|
7
|
+
rootClassName?: string;
|
|
8
|
+
isHelmApp?: boolean;
|
|
9
|
+
isSecurityScanV2Enabled: boolean;
|
|
10
|
+
responseData: ApiResponseResultType;
|
|
11
|
+
hidePolicy?: boolean;
|
|
12
|
+
} & Pick<ImageCardAccordionProps, 'SecurityModalSidebar'>;
|
package/dist/Shared/Components/{Vulnerabilities → Security/Vulnerabilities}/Vulnerabilities.d.ts
RENAMED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { VulnerabilitiesProps } from './types';
|
|
2
|
-
declare const Vulnerabilities: ({ isScanned, isScanEnabled, artifactId, applicationId, environmentId, setVulnerabilityCount, }: VulnerabilitiesProps) => JSX.Element;
|
|
2
|
+
declare const Vulnerabilities: ({ isScanned, isScanEnabled, artifactId, applicationId, environmentId, setVulnerabilityCount, SecurityModalSidebar, getSecurityScan, }: VulnerabilitiesProps) => JSX.Element;
|
|
3
3
|
export default Vulnerabilities;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ResponseType } from '../../../../Common/Types';
|
|
2
|
+
import { ImageCardAccordionProps } from '@Shared/Components/ImageCardAccordion/types';
|
|
3
|
+
import { MaterialSecurityInfoType } from '../../../types';
|
|
4
|
+
import { ApiResponseResultType } from '../SecurityModal';
|
|
5
|
+
export interface VulnerabilitiesProps extends MaterialSecurityInfoType, Pick<ImageCardAccordionProps, 'SecurityModalSidebar' | 'getSecurityScan'> {
|
|
6
|
+
artifactId: number;
|
|
7
|
+
applicationId: number;
|
|
8
|
+
environmentId: number;
|
|
9
|
+
setVulnerabilityCount: React.Dispatch<React.SetStateAction<number>>;
|
|
10
|
+
}
|
|
11
|
+
export interface UseGetSecurityVulnerabilitiesProps extends Pick<ImageCardAccordionProps, 'getSecurityScan'> {
|
|
12
|
+
artifactId: string;
|
|
13
|
+
appId: string;
|
|
14
|
+
envId: number;
|
|
15
|
+
isScanned: boolean;
|
|
16
|
+
isScanEnabled: boolean;
|
|
17
|
+
isScanV2Enabled: boolean;
|
|
18
|
+
}
|
|
19
|
+
export interface UseGetSecurityVulnerabilitiesReturnType {
|
|
20
|
+
scanDetailsLoading: boolean;
|
|
21
|
+
scanResultResponse: ResponseType<ApiResponseResultType>;
|
|
22
|
+
scanDetailsError: any;
|
|
23
|
+
reloadScanDetails: () => void;
|
|
24
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { LastExecutionResponseType, LastExecutionResultType } from '../../../types';
|
|
2
|
+
import { UseGetSecurityVulnerabilitiesProps, UseGetSecurityVulnerabilitiesReturnType } from './types';
|
|
3
|
+
export declare const getSortedVulnerabilities: (vulnerabilities: any) => any;
|
|
4
|
+
export declare const getParsedScanResult: (scanResult: any) => LastExecutionResultType;
|
|
5
|
+
export declare const parseLastExecutionResponse: (response: any) => LastExecutionResponseType;
|
|
6
|
+
export declare const useGetSecurityVulnerabilities: ({ artifactId, appId, envId, isScanned, isScanEnabled, isScanV2Enabled, getSecurityScan, }: UseGetSecurityVulnerabilitiesProps) => UseGetSecurityVulnerabilitiesReturnType;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { SeverityCount } from '../../types';
|
|
2
|
+
import { SeveritiesDTO } from './SecurityModal/types';
|
|
3
|
+
export declare const getTotalSeverityCount: (severityCount: SeverityCount) => number;
|
|
4
|
+
export declare const getSeverityCountFromSummary: (scanResultSeverities: Partial<Record<SeveritiesDTO, number>>) => SeverityCount;
|
|
@@ -4,12 +4,11 @@ import { ComponentSizeType } from '../../constants';
|
|
|
4
4
|
import { MutableRefObject, ReactElement, ReactNode } from 'react';
|
|
5
5
|
import { GroupBase, GroupHeadingProps, Props as ReactSelectProps, SelectInstance } from 'react-select';
|
|
6
6
|
import { CreatableProps } from 'react-select/creatable';
|
|
7
|
-
import { TippyProps } from '@tippyjs/react';
|
|
8
7
|
export interface SelectPickerOptionType<OptionValue = string | number> extends OptionType<OptionValue, ReactNode> {
|
|
9
8
|
/**
|
|
10
9
|
* Description to be displayed for the option
|
|
11
10
|
*/
|
|
12
|
-
description?:
|
|
11
|
+
description?: string;
|
|
13
12
|
/**
|
|
14
13
|
* Icon at the start of the option
|
|
15
14
|
*/
|
|
@@ -18,10 +17,6 @@ export interface SelectPickerOptionType<OptionValue = string | number> extends O
|
|
|
18
17
|
* Icon at the end of the option
|
|
19
18
|
*/
|
|
20
19
|
endIcon?: ReactElement;
|
|
21
|
-
/**
|
|
22
|
-
* Props passed to show the tippy on option
|
|
23
|
-
*/
|
|
24
|
-
tooltipProps?: TippyProps;
|
|
25
20
|
}
|
|
26
21
|
type SelectProps<OptionValue, IsMulti extends boolean> = ReactSelectProps<SelectPickerOptionType<OptionValue>, IsMulti, GroupBase<SelectPickerOptionType<OptionValue>>>;
|
|
27
22
|
declare module 'react-select/base' {
|
|
@@ -5,7 +5,6 @@ export * from './ImageCard';
|
|
|
5
5
|
export * from './ImageCardAccordion';
|
|
6
6
|
export * from './ExcludedImageNode';
|
|
7
7
|
export * from './ScannedByToolModal';
|
|
8
|
-
export * from './Vulnerabilities';
|
|
9
8
|
export * from './FilterChips';
|
|
10
9
|
export * from './ActivityIndicator';
|
|
11
10
|
export * from './GenericSectionErrorState';
|
|
@@ -39,4 +38,5 @@ export * from './DetectBottom';
|
|
|
39
38
|
export * from './TabGroup';
|
|
40
39
|
export * from './EditImageFormField';
|
|
41
40
|
export * from './Collapse';
|
|
41
|
+
export * from './Security';
|
|
42
42
|
export * from './Button';
|
package/dist/Shared/Helpers.d.ts
CHANGED
|
@@ -50,17 +50,4 @@ export declare const getIsManualApprovalSpecific: (userApprovalConfig?: Pick<Use
|
|
|
50
50
|
*/
|
|
51
51
|
export declare const getHandleOpenURL: (url: string) => () => void;
|
|
52
52
|
export declare const getDefaultValueFromType: (value: unknown) => {};
|
|
53
|
-
/**
|
|
54
|
-
* Groups an array of objects by a specified key.
|
|
55
|
-
*
|
|
56
|
-
* This function takes an array of objects and a key, and groups the objects in the array
|
|
57
|
-
* based on the value of the specified key. If an object does not have the specified key,
|
|
58
|
-
* it will be grouped under the `'UNGROUPED'` key.
|
|
59
|
-
*
|
|
60
|
-
* @param array - The array of objects to be grouped.
|
|
61
|
-
* @param key - The key of the object used to group the array.
|
|
62
|
-
* @returns An object where the keys are the unique values of the specified key in the array,
|
|
63
|
-
* and the values are arrays of objects that share the same key value.
|
|
64
|
-
*/
|
|
65
|
-
export declare const groupArrayByObjectKey: <T extends Record<string, any>, K extends keyof T>(array: T[], key: K) => Record<string, T[]>;
|
|
66
53
|
export {};
|
|
@@ -5,10 +5,4 @@ export declare const getCITriggerInfo: (params: GetCITriggerInfoParamsType) => P
|
|
|
5
5
|
* The only difference between this and getCITriggerInfo is it doesn't have env and trigger related meta info
|
|
6
6
|
*/
|
|
7
7
|
export declare const getArtifactInfo: (params: Pick<GetCITriggerInfoParamsType, "ciArtifactId">) => Promise<CIMaterialInfoType>;
|
|
8
|
-
export declare const getAppEnvDeploymentConfig: (
|
|
9
|
-
params: AppEnvDeploymentConfigPayloadType;
|
|
10
|
-
payload?: {
|
|
11
|
-
values: string;
|
|
12
|
-
};
|
|
13
|
-
signal?: AbortSignal;
|
|
14
|
-
}) => Promise<ResponseType<AppEnvDeploymentConfigDTO>>;
|
|
8
|
+
export declare const getAppEnvDeploymentConfig: (params: AppEnvDeploymentConfigPayloadType, signal?: AbortSignal) => Promise<ResponseType<AppEnvDeploymentConfigDTO>>;
|
|
@@ -114,7 +114,6 @@ export interface DraftMetadataDTO {
|
|
|
114
114
|
draftId: number;
|
|
115
115
|
draftVersionId: number;
|
|
116
116
|
draftState: number;
|
|
117
|
-
draftResolvedValue: string;
|
|
118
117
|
approvers: string[];
|
|
119
118
|
canApprove: boolean;
|
|
120
119
|
commentsCount: number;
|
|
@@ -151,40 +150,26 @@ export interface ConfigMapSecretDataType {
|
|
|
151
150
|
export declare enum ConfigResourceType {
|
|
152
151
|
ConfigMap = "ConfigMap",
|
|
153
152
|
Secret = "Secret",
|
|
154
|
-
DeploymentTemplate = "Deployment Template"
|
|
155
|
-
PipelineStrategy = "Pipeline Strategy"
|
|
153
|
+
DeploymentTemplate = "Deployment Template"
|
|
156
154
|
}
|
|
157
155
|
export interface DeploymentTemplateDTO {
|
|
158
156
|
resourceType: ConfigResourceType.DeploymentTemplate;
|
|
159
|
-
data:
|
|
160
|
-
|
|
161
|
-
variableSnapshot: {
|
|
162
|
-
'Deployment Template': Record<string, string>;
|
|
157
|
+
data: {
|
|
158
|
+
[key: string]: any;
|
|
163
159
|
};
|
|
164
|
-
|
|
165
|
-
isAppMetricsEnabled?: true;
|
|
166
|
-
resolvedValue: Record<string, any>;
|
|
160
|
+
deploymentDraftData: ConfigMapSecretDataType | null;
|
|
167
161
|
}
|
|
168
162
|
export interface ConfigMapSecretDataDTO {
|
|
169
163
|
resourceType: Extract<ConfigResourceType, ConfigResourceType.ConfigMap | ConfigResourceType.Secret>;
|
|
170
164
|
data: ConfigMapSecretDataType;
|
|
171
|
-
variableSnapshot: Record<string, Record<string, string>>;
|
|
172
|
-
resolvedValue: string;
|
|
173
|
-
}
|
|
174
|
-
export interface PipelineConfigDataDTO {
|
|
175
|
-
resourceType: ConfigResourceType.PipelineStrategy;
|
|
176
|
-
data: Record<string, any>;
|
|
177
|
-
pipelineTriggerType: string;
|
|
178
|
-
Strategy: string;
|
|
179
165
|
}
|
|
180
166
|
export interface AppEnvDeploymentConfigDTO {
|
|
181
167
|
deploymentTemplate: DeploymentTemplateDTO | null;
|
|
182
168
|
configMapData: ConfigMapSecretDataDTO | null;
|
|
183
169
|
secretsData: ConfigMapSecretDataDTO | null;
|
|
184
|
-
pipelineConfigData?: PipelineConfigDataDTO;
|
|
185
170
|
isAppAdmin: boolean;
|
|
186
171
|
}
|
|
187
|
-
export
|
|
172
|
+
export interface AppEnvDeploymentConfigPayloadType {
|
|
188
173
|
appName: string;
|
|
189
174
|
envName: string;
|
|
190
175
|
configType: AppEnvDeploymentConfigType;
|
|
@@ -193,18 +178,7 @@ export type AppEnvDeploymentConfigPayloadType = {
|
|
|
193
178
|
resourceType?: ConfigResourceType;
|
|
194
179
|
resourceId?: number;
|
|
195
180
|
resourceName?: string;
|
|
196
|
-
|
|
197
|
-
} | {
|
|
198
|
-
appName: string;
|
|
199
|
-
envName: string;
|
|
200
|
-
configArea: 'ResolveData';
|
|
201
|
-
} | {
|
|
202
|
-
appName: string;
|
|
203
|
-
envName: string;
|
|
204
|
-
pipelineId: number;
|
|
205
|
-
configArea: 'CdRollback' | 'DeploymentHistory';
|
|
206
|
-
wfrId: number;
|
|
207
|
-
};
|
|
181
|
+
}
|
|
208
182
|
export declare enum TemplateListType {
|
|
209
183
|
DefaultVersions = 1,
|
|
210
184
|
PublishedOnEnvironments = 2,
|
|
@@ -238,7 +212,6 @@ export declare enum EnvResourceType {
|
|
|
238
212
|
ConfigMap = "configmap",
|
|
239
213
|
Secret = "secrets",
|
|
240
214
|
DeploymentTemplate = "deployment-template",
|
|
241
|
-
Manifest = "manifest"
|
|
242
|
-
PipelineStrategy = "pipeline-strategy"
|
|
215
|
+
Manifest = "manifest"
|
|
243
216
|
}
|
|
244
217
|
export {};
|
|
@@ -14,6 +14,10 @@ export declare const STAGE_TYPE: {
|
|
|
14
14
|
ROLLBACK: string;
|
|
15
15
|
};
|
|
16
16
|
export declare const SCAN_TOOL_ID_TRIVY = 3;
|
|
17
|
+
/**
|
|
18
|
+
* @description This is only used to show mapping for clair, scan tool id for clair can be either 1 or 2
|
|
19
|
+
* */
|
|
20
|
+
export declare const SCAN_TOOL_ID_CLAIR = 2;
|
|
17
21
|
export declare const IMAGE_SCAN_TOOL: {
|
|
18
22
|
Clair: string;
|
|
19
23
|
Trivy: string;
|
package/dist/Shared/types.d.ts
CHANGED
|
@@ -413,6 +413,7 @@ export interface LastExecutionResultType {
|
|
|
413
413
|
scanned?: boolean;
|
|
414
414
|
scanEnabled?: boolean;
|
|
415
415
|
scanToolId?: number;
|
|
416
|
+
imageScanDeployInfoId?: number;
|
|
416
417
|
}
|
|
417
418
|
export interface LastExecutionResponseType extends ResponseType<LastExecutionResultType> {
|
|
418
419
|
}
|