@devtron-labs/devtron-fe-common-lib 0.3.9-beta-1 → 0.3.10

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 (73) hide show
  1. package/dist/Common/Drawer/Drawer.d.ts +1 -1
  2. package/dist/Common/RJSF/types.d.ts +8 -5
  3. package/dist/Common/RJSF/utils.d.ts +2 -0
  4. package/dist/Common/Security/ScanVulnerabilitiesTable.d.ts +2 -0
  5. package/dist/Common/Security/types.d.ts +4 -0
  6. package/dist/Common/Tooltip/constants.d.ts +3 -0
  7. package/dist/Common/Tooltip/index.d.ts +1 -0
  8. package/dist/Common/index.d.ts +1 -0
  9. package/dist/Pages/App/AppConfigurations/utils.d.ts +1 -1
  10. package/dist/Shared/Components/ImageCardAccordion/ImageCardAccordion.d.ts +1 -1
  11. package/dist/Shared/Components/ImageCardAccordion/types.d.ts +1 -4
  12. package/dist/Shared/Components/TabGroup/TabGroup.helpers.d.ts +7 -0
  13. package/dist/Shared/Components/TabGroup/TabGroup.types.d.ts +24 -9
  14. package/dist/Shared/Components/TabGroup/TabGroup.utils.d.ts +2 -2
  15. package/dist/Shared/Components/{Security/Vulnerabilities → Vulnerabilities}/Vulnerabilities.d.ts +1 -1
  16. package/dist/Shared/Components/Vulnerabilities/constants.d.ts +4 -0
  17. package/dist/Shared/Components/{Security/Vulnerabilities → Vulnerabilities}/index.d.ts +0 -1
  18. package/dist/Shared/Components/{Security/Vulnerabilities → Vulnerabilities}/service.d.ts +1 -1
  19. package/dist/Shared/Components/Vulnerabilities/types.d.ts +7 -0
  20. package/dist/Shared/Components/Vulnerabilities/utils.d.ts +4 -0
  21. package/dist/Shared/Components/index.d.ts +1 -2
  22. package/dist/Shared/Helpers.d.ts +2 -1
  23. package/dist/Shared/constants.d.ts +0 -4
  24. package/dist/Shared/types.d.ts +0 -1
  25. package/dist/assets/index.css +1 -1
  26. package/dist/{cssMode-BQyEMz-L.js → cssMode-Ci2SYp_2.js} +1 -1
  27. package/dist/{freemarker2-Bj0DygAe.js → freemarker2-DuzaBrLs.js} +1 -1
  28. package/dist/{handlebars-CHNNn0wb.js → handlebars-CetBX0xA.js} +1 -1
  29. package/dist/{html-ryEQ_Yz_.js → html-D5MQofMO.js} +1 -1
  30. package/dist/{htmlMode-vvcEHwY9.js → htmlMode-ODxwicMz.js} +1 -1
  31. package/dist/{index-CpSdT1pU.js → index-BL0bY-zv.js} +30875 -32492
  32. package/dist/index.js +496 -508
  33. package/dist/{javascript-BgyyM4XW.js → javascript-B9n3MeA7.js} +1 -1
  34. package/dist/{jsonMode-P-vuI-Fp.js → jsonMode-Bzo4h1Bf.js} +1 -1
  35. package/dist/{liquid-C2fqEGvd.js → liquid-bNDMiWzD.js} +1 -1
  36. package/dist/{mdx-2aw84pOi.js → mdx-DGQBelbh.js} +1 -1
  37. package/dist/{python-BuTQ7kSf.js → python-BP8l6k6r.js} +1 -1
  38. package/dist/{razor-DGlu_XPP.js → razor-CP819BQo.js} +1 -1
  39. package/dist/{tsMode-BqungwBn.js → tsMode-QWFAam_c.js} +1 -1
  40. package/dist/{typescript-BI6arj9L.js → typescript-CekVoJfn.js} +1 -1
  41. package/dist/{xml-CiL6lgOI.js → xml-D49rK_7Z.js} +1 -1
  42. package/dist/{yaml-BDBCgdGm.js → yaml-D8i4om3q.js} +1 -1
  43. package/package.json +5 -6
  44. package/dist/Shared/Components/FilterButton/FilterButton.d.ts +0 -4
  45. package/dist/Shared/Components/FilterButton/index.d.ts +0 -1
  46. package/dist/Shared/Components/FilterButton/types.d.ts +0 -11
  47. package/dist/Shared/Components/FilterButton/utils.d.ts +0 -15
  48. package/dist/Shared/Components/Security/SecurityModal/SecurityModal.d.ts +0 -14
  49. package/dist/Shared/Components/Security/SecurityModal/components/IndexedTextDisplay.d.ts +0 -4
  50. package/dist/Shared/Components/Security/SecurityModal/components/InfoCard.d.ts +0 -4
  51. package/dist/Shared/Components/Security/SecurityModal/components/OpenDetailViewButton.d.ts +0 -4
  52. package/dist/Shared/Components/Security/SecurityModal/components/Table.d.ts +0 -4
  53. package/dist/Shared/Components/Security/SecurityModal/components/index.d.ts +0 -3
  54. package/dist/Shared/Components/Security/SecurityModal/config/CodeScan.d.ts +0 -100
  55. package/dist/Shared/Components/Security/SecurityModal/config/EmptyState.d.ts +0 -2
  56. package/dist/Shared/Components/Security/SecurityModal/config/ImageScan.d.ts +0 -4
  57. package/dist/Shared/Components/Security/SecurityModal/config/InfoCard.d.ts +0 -2
  58. package/dist/Shared/Components/Security/SecurityModal/config/KubernetesManifest.d.ts +0 -4
  59. package/dist/Shared/Components/Security/SecurityModal/config/Sidebar.d.ts +0 -2
  60. package/dist/Shared/Components/Security/SecurityModal/config/Table.d.ts +0 -2
  61. package/dist/Shared/Components/Security/SecurityModal/config/index.d.ts +0 -3
  62. package/dist/Shared/Components/Security/SecurityModal/constants.d.ts +0 -56
  63. package/dist/Shared/Components/Security/SecurityModal/index.d.ts +0 -6
  64. package/dist/Shared/Components/Security/SecurityModal/service.d.ts +0 -3
  65. package/dist/Shared/Components/Security/SecurityModal/types.d.ts +0 -262
  66. package/dist/Shared/Components/Security/SecurityModal/utils.d.ts +0 -34
  67. package/dist/Shared/Components/Security/SecuritySummaryCard/SecuritySummaryCard.d.ts +0 -3
  68. package/dist/Shared/Components/Security/SecuritySummaryCard/index.d.ts +0 -1
  69. package/dist/Shared/Components/Security/SecuritySummaryCard/types.d.ts +0 -11
  70. package/dist/Shared/Components/Security/Vulnerabilities/types.d.ts +0 -26
  71. package/dist/Shared/Components/Security/Vulnerabilities/utils.d.ts +0 -6
  72. package/dist/Shared/Components/Security/index.d.ts +0 -4
  73. package/dist/Shared/Components/Security/utils.d.ts +0 -4
@@ -1,262 +0,0 @@
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 {};
@@ -1,34 +0,0 @@
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
- }[];
@@ -1,3 +0,0 @@
1
- import { SecuritySummaryCardProps } from './types';
2
- declare const SecuritySummaryCard: ({ severityCount, scanToolId, rootClassName, isHelmApp, SecurityModalSidebar, responseData, isSecurityScanV2Enabled, }: SecuritySummaryCardProps) => JSX.Element;
3
- export default SecuritySummaryCard;
@@ -1 +0,0 @@
1
- export { default as SecuritySummaryCard } from './SecuritySummaryCard';
@@ -1,11 +0,0 @@
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,26 +0,0 @@
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 { getLastExecutionByArtifactAppEnv } from './service';
6
- export interface VulnerabilitiesProps extends MaterialSecurityInfoType, Pick<ImageCardAccordionProps, 'SecurityModalSidebar' | 'getSecurityScan'> {
7
- artifactId: number;
8
- applicationId: number;
9
- environmentId: number;
10
- setVulnerabilityCount: React.Dispatch<React.SetStateAction<number>>;
11
- }
12
- export interface UseGetSecurityVulnerabilitiesProps extends Pick<ImageCardAccordionProps, 'getSecurityScan'> {
13
- artifactId: string;
14
- appId: string;
15
- envId: string;
16
- isScanned: boolean;
17
- isScanEnabled: boolean;
18
- isScanV2Enabled: boolean;
19
- }
20
- export interface UseGetSecurityVulnerabilitiesReturnType {
21
- scanDetailsLoading: boolean;
22
- scanResultResponse: ResponseType<ApiResponseResultType>;
23
- executionDetailsResponse: Awaited<ReturnType<typeof getLastExecutionByArtifactAppEnv>>;
24
- scanDetailsError: any;
25
- reloadScanDetails: () => void;
26
- }
@@ -1,6 +0,0 @@
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;
@@ -1,4 +0,0 @@
1
- export * from './SecuritySummaryCard';
2
- export * from './Vulnerabilities';
3
- export * from './SecurityModal';
4
- export * from './utils';
@@ -1,4 +0,0 @@
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;