@devtron-labs/devtron-fe-common-lib 0.3.14-beta-1 → 0.3.15

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.
Files changed (90) hide show
  1. package/dist/Common/Helper.d.ts +0 -1
  2. package/dist/Common/Toggle/Toggle.d.ts +1 -2
  3. package/dist/Common/index.d.ts +0 -1
  4. package/dist/Pages/App/AppConfigurations/utils.d.ts +1 -1
  5. package/dist/Shared/Components/CICDHistory/DeploymentHistoryDiff/DeploymentHistoryConfigList.component.d.ts +3 -0
  6. package/dist/Shared/Components/CICDHistory/DeploymentHistoryDiff/DeploymentHistoryDetailedView.d.ts +3 -0
  7. package/dist/Shared/Components/CICDHistory/{DeploymentHistoryConfigDiff → DeploymentHistoryDiff}/DeploymentHistoryDiffView.d.ts +1 -1
  8. package/dist/Shared/Components/CICDHistory/DeploymentHistoryDiff/DeploymentHistoryHeader.d.ts +3 -0
  9. package/dist/Shared/Components/CICDHistory/DeploymentHistoryDiff/DeploymentHistorySidebar.d.ts +3 -0
  10. package/dist/Shared/Components/CICDHistory/DeploymentHistoryDiff/index.d.ts +3 -0
  11. package/dist/Shared/Components/CICDHistory/DeploymentHistoryDiff/types.d.ts +35 -0
  12. package/dist/Shared/Components/CICDHistory/DeploymentHistoryDiff/utils.d.ts +11 -0
  13. package/dist/Shared/Components/CICDHistory/TriggerOutput.d.ts +1 -1
  14. package/dist/Shared/Components/CICDHistory/index.d.ts +1 -1
  15. package/dist/Shared/Components/CICDHistory/types.d.ts +4 -2
  16. package/dist/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiff.component.d.ts +1 -1
  17. package/dist/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiff.types.d.ts +10 -25
  18. package/dist/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiff.utils.d.ts +3 -10
  19. package/dist/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiffAccordion.d.ts +2 -9
  20. package/dist/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiffMain.d.ts +1 -1
  21. package/dist/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiffNavigation.d.ts +1 -1
  22. package/dist/Shared/Components/ImageCardAccordion/ImageCardAccordion.d.ts +1 -1
  23. package/dist/Shared/Components/ImageCardAccordion/types.d.ts +4 -2
  24. package/dist/Shared/Components/Security/SecurityModal/SecurityModal.d.ts +14 -0
  25. package/dist/Shared/Components/Security/SecurityModal/components/IndexedTextDisplay.d.ts +4 -0
  26. package/dist/Shared/Components/Security/SecurityModal/components/InfoCard.d.ts +4 -0
  27. package/dist/Shared/Components/Security/SecurityModal/components/OpenDetailViewButton.d.ts +4 -0
  28. package/dist/Shared/Components/Security/SecurityModal/components/Table.d.ts +4 -0
  29. package/dist/Shared/Components/Security/SecurityModal/components/index.d.ts +3 -0
  30. package/dist/Shared/Components/Security/SecurityModal/config/CodeScan.d.ts +100 -0
  31. package/dist/Shared/Components/Security/SecurityModal/config/EmptyState.d.ts +2 -0
  32. package/dist/Shared/Components/Security/SecurityModal/config/ImageScan.d.ts +4 -0
  33. package/dist/Shared/Components/Security/SecurityModal/config/InfoCard.d.ts +2 -0
  34. package/dist/Shared/Components/Security/SecurityModal/config/KubernetesManifest.d.ts +4 -0
  35. package/dist/Shared/Components/Security/SecurityModal/config/Sidebar.d.ts +2 -0
  36. package/dist/Shared/Components/Security/SecurityModal/config/Table.d.ts +2 -0
  37. package/dist/Shared/Components/Security/SecurityModal/config/index.d.ts +3 -0
  38. package/dist/Shared/Components/Security/SecurityModal/constants.d.ts +56 -0
  39. package/dist/Shared/Components/Security/SecurityModal/index.d.ts +6 -0
  40. package/dist/Shared/Components/Security/SecurityModal/service.d.ts +3 -0
  41. package/dist/Shared/Components/Security/SecurityModal/types.d.ts +262 -0
  42. package/dist/Shared/Components/Security/SecurityModal/utils.d.ts +34 -0
  43. package/dist/Shared/Components/Security/SecuritySummaryCard/SecuritySummaryCard.d.ts +3 -0
  44. package/dist/Shared/Components/Security/SecuritySummaryCard/index.d.ts +1 -0
  45. package/dist/Shared/Components/Security/SecuritySummaryCard/types.d.ts +11 -0
  46. package/dist/Shared/Components/{Vulnerabilities → Security/Vulnerabilities}/Vulnerabilities.d.ts +1 -1
  47. package/dist/Shared/Components/{Vulnerabilities → Security/Vulnerabilities}/index.d.ts +1 -0
  48. package/dist/Shared/Components/Security/Vulnerabilities/service.d.ts +2 -0
  49. package/dist/Shared/Components/Security/Vulnerabilities/types.d.ts +24 -0
  50. package/dist/Shared/Components/Security/Vulnerabilities/utils.d.ts +6 -0
  51. package/dist/Shared/Components/Security/index.d.ts +4 -0
  52. package/dist/Shared/Components/Security/utils.d.ts +4 -0
  53. package/dist/Shared/Components/SelectPicker/type.d.ts +0 -5
  54. package/dist/Shared/Components/index.d.ts +1 -1
  55. package/dist/Shared/Helpers.d.ts +0 -13
  56. package/dist/Shared/Services/app.service.d.ts +1 -7
  57. package/dist/Shared/Services/app.types.d.ts +7 -34
  58. package/dist/Shared/constants.d.ts +4 -0
  59. package/dist/Shared/types.d.ts +1 -0
  60. package/dist/assets/index.css +1 -1
  61. package/dist/{cssMode-IylcoDbx.js → cssMode-C3fkhVx5.js} +1 -1
  62. package/dist/{freemarker2-Dc0BAReS.js → freemarker2-BAGTwlAk.js} +1 -1
  63. package/dist/{handlebars-D8d3oeeL.js → handlebars-DT60fTDQ.js} +1 -1
  64. package/dist/{html-DHIUzE39.js → html-B5LxnBsS.js} +1 -1
  65. package/dist/{htmlMode-C8ZDw4HO.js → htmlMode-C8GqAvmp.js} +1 -1
  66. package/dist/{index-ByVomRMV.js → index-POmD5FX4.js} +130440 -128981
  67. package/dist/index.js +501 -496
  68. package/dist/{javascript-ietUe3zr.js → javascript-DOVIaELP.js} +1 -1
  69. package/dist/{jsonMode-D-2SVjtk.js → jsonMode-DV3sK4zw.js} +1 -1
  70. package/dist/{liquid-rTZVyZ7L.js → liquid-DlzcPJtV.js} +1 -1
  71. package/dist/{mdx-DlWEeuen.js → mdx-CYRLLMLN.js} +1 -1
  72. package/dist/{python-CoQh6-mN.js → python-DKhxQWXv.js} +1 -1
  73. package/dist/{razor-B7QZez8l.js → razor-DDkZgsRQ.js} +1 -1
  74. package/dist/{tsMode-PD0LurRg.js → tsMode-BYPk8zNm.js} +1 -1
  75. package/dist/{typescript-Cl3AgiB7.js → typescript-Bmk5c7SJ.js} +1 -1
  76. package/dist/{xml-DUme7BW4.js → xml-C7p_z4wg.js} +1 -1
  77. package/dist/{yaml-CZ5BQ0MU.js → yaml-DhKCr5Iw.js} +1 -1
  78. package/package.json +4 -3
  79. package/dist/Common/Security/ScanVulnerabilitiesTable.d.ts +0 -2
  80. package/dist/Common/Security/types.d.ts +0 -4
  81. package/dist/Shared/Components/CICDHistory/DeploymentHistoryConfigDiff/DeploymentHistoryConfigDiff.d.ts +0 -2
  82. package/dist/Shared/Components/CICDHistory/DeploymentHistoryConfigDiff/DeploymentHistoryConfigDiffCompare.d.ts +0 -2
  83. package/dist/Shared/Components/CICDHistory/DeploymentHistoryConfigDiff/helpers.d.ts +0 -3
  84. package/dist/Shared/Components/CICDHistory/DeploymentHistoryConfigDiff/index.d.ts +0 -2
  85. package/dist/Shared/Components/CICDHistory/DeploymentHistoryConfigDiff/types.d.ts +0 -34
  86. package/dist/Shared/Components/CICDHistory/DeploymentHistoryConfigDiff/utils.d.ts +0 -21
  87. package/dist/Shared/Components/Vulnerabilities/constants.d.ts +0 -4
  88. package/dist/Shared/Components/Vulnerabilities/service.d.ts +0 -2
  89. package/dist/Shared/Components/Vulnerabilities/types.d.ts +0 -7
  90. package/dist/Shared/Components/Vulnerabilities/utils.d.ts +0 -4
@@ -0,0 +1,262 @@
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
+ }
124
+ export interface ImageScanVulnerabilityType extends CodeScanVulnerabilityType {
125
+ target?: string;
126
+ }
127
+ export interface ImageScanVulnerabilityListType extends StatusType {
128
+ image: string;
129
+ summary: Summary<'severities'>;
130
+ list: ImageScanVulnerabilityType[];
131
+ }
132
+ export interface CodeScanLicenseType {
133
+ classification: string;
134
+ severity: string;
135
+ license: string;
136
+ package: string;
137
+ source: string;
138
+ }
139
+ export interface ImageScanLicenseListType extends StatusType {
140
+ image: string;
141
+ summary: Summary<'severities'>;
142
+ list: CodeScanLicenseType[];
143
+ }
144
+ export type ImageScan = {
145
+ [SUB_CATEGORIES.VULNERABILITIES]: GenericGroupTypeWithSummary<ImageScanVulnerabilityListType>;
146
+ [SUB_CATEGORIES.LICENSE]: GenericGroupTypeWithSummary<ImageScanLicenseListType>;
147
+ };
148
+ export interface Line {
149
+ number: number;
150
+ content: string;
151
+ isCause: boolean;
152
+ truncated: boolean;
153
+ }
154
+ export interface CauseMetadata {
155
+ startLine: number;
156
+ EndLine: number;
157
+ lines?: Line[];
158
+ }
159
+ export interface CodeScanMisconfigurationsDetailListType {
160
+ id: string;
161
+ title: string;
162
+ message: string;
163
+ resolution: string;
164
+ status: string;
165
+ severity: string;
166
+ causeMetadata: CauseMetadata;
167
+ }
168
+ export interface CodeScanMisconfigurationsListType {
169
+ filePath: string;
170
+ link: string;
171
+ type: string;
172
+ misConfSummary: Summary<'status'>;
173
+ summary: Summary<'severities'>;
174
+ list: CodeScanMisconfigurationsDetailListType[];
175
+ }
176
+ export interface CodeScanExposedSecretsDetailListType {
177
+ severity: string;
178
+ ruleId: string;
179
+ category: string;
180
+ startLine: number;
181
+ EndLine: number;
182
+ title: string;
183
+ lines: Line[];
184
+ }
185
+ export interface CodeScanExposedSecretsListType {
186
+ filePath: string;
187
+ link: string;
188
+ summary: Summary<'severities'>;
189
+ list: CodeScanExposedSecretsDetailListType[];
190
+ }
191
+ export type CodeScan = {
192
+ [SUB_CATEGORIES.VULNERABILITIES]: GenericGroupTypeWithSummary<CodeScanVulnerabilityType>;
193
+ [SUB_CATEGORIES.LICENSE]: GenericGroupTypeWithSummary<CodeScanLicenseType>;
194
+ [SUB_CATEGORIES.MISCONFIGURATIONS]: GenericGroupTypeWithMisConfSummary<CodeScanMisconfigurationsListType>;
195
+ [SUB_CATEGORIES.EXPOSED_SECRETS]: GenericGroupTypeWithSummary<CodeScanExposedSecretsListType>;
196
+ } & StatusType;
197
+ export type KubernetesManifest = {
198
+ [SUB_CATEGORIES.MISCONFIGURATIONS]: GenericGroupTypeWithMisConfSummary<CodeScanMisconfigurationsListType>;
199
+ [SUB_CATEGORIES.EXPOSED_SECRETS]: GenericGroupTypeWithSummary<CodeScanExposedSecretsListType>;
200
+ } & StatusType;
201
+ export type ApiResponseResultType = {
202
+ scanned: boolean;
203
+ [CATEGORIES.IMAGE_SCAN]: ImageScan;
204
+ [CATEGORIES.CODE_SCAN]: CodeScan;
205
+ [CATEGORIES.KUBERNETES_MANIFEST]: KubernetesManifest;
206
+ };
207
+ interface SecurityModalBaseProps extends Partial<Pick<SidebarPropsType, 'isExternalCI'>> {
208
+ isLoading: boolean;
209
+ error: ServerErrors;
210
+ responseData: ApiResponseResultType;
211
+ handleModalClose: (event?: React.MouseEvent<HTMLElement>) => void;
212
+ Sidebar: React.FC<SidebarPropsType>;
213
+ isHelmApp?: boolean;
214
+ isResourceScan?: boolean;
215
+ isSecurityScanV2Enabled: boolean;
216
+ }
217
+ export type SecurityModalPropsType = SecurityModalBaseProps;
218
+ export interface IndexedTextDisplayPropsType {
219
+ title: string;
220
+ lines: Line[];
221
+ link: string;
222
+ }
223
+ export type SidebarDataChildType = {
224
+ label: string;
225
+ value: {
226
+ category: (typeof CATEGORIES)[keyof typeof CATEGORIES];
227
+ subCategory: (typeof SUB_CATEGORIES)[keyof typeof SUB_CATEGORIES];
228
+ };
229
+ };
230
+ export type SidebarDataType = {
231
+ label: string;
232
+ isExpanded: boolean;
233
+ children: NonNullable<SidebarDataChildType[]>;
234
+ hideInHelmApp?: boolean;
235
+ };
236
+ export type EmptyStateType = Pick<GenericEmptyStateType, 'image' | 'SvgImage' | 'subTitle' | 'title' | 'children'>;
237
+ export declare const VulnerabilityState: {
238
+ readonly [-1]: "Failed";
239
+ readonly 0: "Progressing";
240
+ readonly 1: "Completed";
241
+ };
242
+ export interface ImageVulnerabilityType {
243
+ image: string;
244
+ state: keyof typeof VulnerabilityState;
245
+ error?: string;
246
+ scanResult: LastExecutionResultType | null;
247
+ }
248
+ export interface VulnerabilityCountType {
249
+ unknownVulnerabilitiesCount: number;
250
+ lowVulnerabilitiesCount: number;
251
+ mediumVulnerabilitiesCount: number;
252
+ highVulnerabilitiesCount: number;
253
+ criticalVulnerabilitiesCount: number;
254
+ }
255
+ export interface GetResourceScanDetailsResponseType extends VulnerabilityCountType {
256
+ imageVulnerabilities: ImageVulnerabilityType[];
257
+ }
258
+ export interface OpenDetailViewButtonProps {
259
+ detailViewData: DetailViewDataType;
260
+ setDetailViewData: (detailViewData: DetailViewDataType) => void;
261
+ }
262
+ 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, }: SecuritySummaryCardProps) => JSX.Element;
3
+ export default SecuritySummaryCard;
@@ -0,0 +1 @@
1
+ export { default as SecuritySummaryCard } from './SecuritySummaryCard';
@@ -0,0 +1,11 @@
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
+ } & Pick<ImageCardAccordionProps, 'SecurityModalSidebar'>;
@@ -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, setVulnerabilityCount, SecurityModalSidebar, getSecurityScan, }: VulnerabilitiesProps) => JSX.Element;
3
3
  export default Vulnerabilities;
@@ -1,2 +1,3 @@
1
1
  export { default as Vulnerabilities } from './Vulnerabilities';
2
2
  export * from './utils';
3
+ export * from './service';
@@ -0,0 +1,2 @@
1
+ import { LastExecutionResponseType } from '../../../types';
2
+ export declare function getLastExecutionByArtifactApp(artifactId: string | number, appId: number | string): Promise<LastExecutionResponseType>;
@@ -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
+ import { getLastExecutionByArtifactApp } from './service';
6
+ export interface VulnerabilitiesProps extends MaterialSecurityInfoType, Pick<ImageCardAccordionProps, 'SecurityModalSidebar' | 'getSecurityScan'> {
7
+ artifactId: number;
8
+ applicationId: number;
9
+ setVulnerabilityCount: React.Dispatch<React.SetStateAction<number>>;
10
+ }
11
+ export interface UseGetSecurityVulnerabilitiesProps extends Pick<ImageCardAccordionProps, 'getSecurityScan'> {
12
+ artifactId: string;
13
+ appId: string;
14
+ isScanned: boolean;
15
+ isScanEnabled: boolean;
16
+ isScanV2Enabled: boolean;
17
+ }
18
+ export interface UseGetSecurityVulnerabilitiesReturnType {
19
+ scanDetailsLoading: boolean;
20
+ scanResultResponse: ResponseType<ApiResponseResultType>;
21
+ executionDetailsResponse: Awaited<ReturnType<typeof getLastExecutionByArtifactApp>>;
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, isScanned, isScanEnabled, isScanV2Enabled, getSecurityScan, }: UseGetSecurityVulnerabilitiesProps) => UseGetSecurityVulnerabilitiesReturnType;
@@ -0,0 +1,4 @@
1
+ export * from './SecuritySummaryCard';
2
+ export * from './Vulnerabilities';
3
+ export * from './SecurityModal';
4
+ export * from './utils';
@@ -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,7 +4,6 @@ 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
@@ -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';
@@ -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: ({ params, payload, signal, }: {
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: Record<string, any>;
160
- deploymentDraftData: ConfigMapSecretDataType | null;
161
- variableSnapshot: {
162
- 'Deployment Template': Record<string, string>;
157
+ data: {
158
+ [key: string]: any;
163
159
  };
164
- templateVersion: string;
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 type AppEnvDeploymentConfigPayloadType = {
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
- configArea?: 'AppConfiguration';
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
- PipelineConfiguration = "pipeline-configuration"
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;
@@ -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
  }