@devtron-labs/devtron-fe-common-lib 1.3.8-beta-1 → 1.3.9
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/{@code-editor-BTdeB8Tp.js → @code-editor--JGVkfVq.js} +5661 -5505
- package/dist/{@common-rjsf-Cc6HRMyo.js → @common-rjsf-BJZae-C6.js} +1 -1
- package/dist/Common/Common.service.d.ts +2 -1
- package/dist/Common/Constants.d.ts +1 -1
- package/dist/Common/Types.d.ts +49 -40
- package/dist/Pages/Applications/DevtronApps/Details/CDPipeline/types.d.ts +1 -2
- package/dist/Shared/Components/FeatureDescription/FeatureDescriptionModal.d.ts +1 -1
- package/dist/Shared/Components/FeatureDescription/FeatureTitleWithInfo.d.ts +1 -1
- package/dist/Shared/Components/FeatureDescription/types.d.ts +34 -6
- package/dist/Shared/Components/ImageCardAccordion/ImageCardAccordion.d.ts +1 -1
- package/dist/Shared/Components/ImageCardAccordion/types.d.ts +3 -2
- package/dist/Shared/Components/Security/SecurityModal/config/CodeScan.d.ts +2 -2
- package/dist/Shared/Components/Security/SecurityModal/config/EmptyState.d.ts +2 -2
- package/dist/Shared/Components/Security/SecurityModal/config/ImageScan.d.ts +2 -2
- package/dist/Shared/Components/Security/SecurityModal/config/InfoCard.d.ts +2 -2
- package/dist/Shared/Components/Security/SecurityModal/config/KubernetesManifest.d.ts +2 -2
- package/dist/Shared/Components/Security/SecurityModal/config/Sidebar.d.ts +2 -2
- package/dist/Shared/Components/Security/SecurityModal/config/Table.d.ts +2 -2
- package/dist/Shared/Components/Security/SecurityModal/config/index.d.ts +1 -1
- package/dist/Shared/Components/Security/SecurityModal/constants.d.ts +5 -5
- package/dist/Shared/Components/Security/SecurityModal/index.d.ts +4 -4
- package/dist/Shared/Components/Security/SecurityModal/service.d.ts +2 -2
- package/dist/Shared/Components/Security/SecurityModal/types.d.ts +19 -12
- package/dist/Shared/Components/Security/SecurityModal/utils.d.ts +4 -3
- package/dist/Shared/Components/Security/SecuritySummaryCard/SecuritySummaryCard.d.ts +1 -1
- package/dist/Shared/Components/Security/SecuritySummaryCard/types.d.ts +4 -2
- package/dist/Shared/Components/Security/Vulnerabilities/Vulnerabilities.d.ts +1 -1
- package/dist/Shared/Components/Security/Vulnerabilities/types.d.ts +17 -1
- package/dist/Shared/Components/Security/Vulnerabilities/utils.d.ts +5 -0
- package/dist/Shared/Components/Security/utils.d.ts +3 -6
- package/dist/Shared/Helpers.d.ts +4 -3
- package/dist/Shared/Providers/types.d.ts +0 -1
- package/dist/Shared/Services/app.types.d.ts +8 -1
- package/dist/Shared/constants.d.ts +7 -0
- package/dist/Shared/types.d.ts +19 -5
- package/dist/assets/{ic-arrow-square-out.1be837ac.svg → ic-arrow-square-out.3d1a0d41.svg} +1 -1
- package/dist/assets/ic-check-circle-dots.6229180e.svg +4 -0
- package/dist/assets/{ic-edit-file.a782640f.svg → ic-edit-file.aea811d8.svg} +3 -3
- package/dist/index.d.ts +2 -0
- package/dist/index.js +673 -662
- package/package.json +2 -2
- package/dist/assets/ic-stamp.526499d2.svg +0 -7
@@ -2,7 +2,7 @@ import { j as n, J as A } from "./@vendor-RA_nL1Ml.js";
|
|
2
2
|
import E, { forwardRef as $ } from "react";
|
3
3
|
import L, { getDefaultRegistry as k } from "@rjsf/core";
|
4
4
|
import D from "@rjsf/validator-ajv8";
|
5
|
-
import { T as y, c as H, a as U, i as J, d as w } from "./@code-editor
|
5
|
+
import { T as y, c as H, a as U, i as J, d as w } from "./@code-editor--JGVkfVq.js";
|
6
6
|
import M, { components as O } from "react-select";
|
7
7
|
import { getUiOptions as B, getTemplate as I, getSubmitButtonOptions as W, ADDITIONAL_PROPERTY_FLAG as P, errorId as V, englishStringTranslator as q, TranslatableString as K, titleId as Y, canExpand as z, deepEquals as G } from "@rjsf/utils";
|
8
8
|
import { ReactComponent as Q } from "./assets/ic-chevron-down.fc70d7a7.svg";
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { MutableRefObject } from 'react';
|
2
2
|
import { RuntimeParamsAPIResponseType, RuntimePluginVariables } from '../Shared/types';
|
3
|
-
import { TeamList, ResponseType, DeploymentNodeType, CDMaterialServiceEnum, CDMaterialServiceQueryParams, CDMaterialResponseType, CDMaterialFilterQuery, EnvironmentListHelmResponse, GlobalVariableOptionType } from './Types';
|
3
|
+
import { TeamList, ResponseType, DeploymentNodeType, CDMaterialServiceEnum, CDMaterialServiceQueryParams, CDMaterialResponseType, CDMaterialFilterQuery, EnvironmentListHelmResponse, UserApprovalMetadataType, GlobalVariableOptionType } from './Types';
|
4
4
|
import { ApiResourceType } from '../Pages';
|
5
5
|
export declare const getTeamListMin: () => Promise<TeamList>;
|
6
6
|
interface UserRole extends ResponseType {
|
@@ -16,6 +16,7 @@ export declare const SourceTypeMap: {
|
|
16
16
|
};
|
17
17
|
export declare function getUserRole(appName?: string): Promise<UserRole>;
|
18
18
|
export declare function setImageTags(request: any, pipelineId: number, artifactId: number): Promise<ResponseType<any>>;
|
19
|
+
export declare const sanitizeUserApprovalMetadata: (userApprovalMetadata: UserApprovalMetadataType) => UserApprovalMetadataType;
|
19
20
|
export declare const parseRuntimeParams: (response: RuntimeParamsAPIResponseType) => RuntimePluginVariables[];
|
20
21
|
export declare const processCDMaterialServiceResponse: (cdMaterialsResult: any, stage: DeploymentNodeType, offset: number, filter: CDMaterialFilterQuery, disableDefaultSelection?: boolean) => CDMaterialResponseType;
|
21
22
|
export declare const genericCDMaterialsService: (serviceType: CDMaterialServiceEnum, cdMaterialID: number, stage: DeploymentNodeType, signal: AbortSignal, queryParams?: CDMaterialServiceQueryParams) => Promise<CDMaterialResponseType>;
|
@@ -67,7 +67,7 @@ export declare const ROUTES: {
|
|
67
67
|
CD_MATERIAL_GET: string;
|
68
68
|
DEPLOYMENT_TEMPLATE_LIST: string;
|
69
69
|
INFRA_CONFIG_PROFILE: string;
|
70
|
-
|
70
|
+
SECURITY_SCAN_EXECUTION_DETAILS: string;
|
71
71
|
NOTIFIER: string;
|
72
72
|
APP_LIST: string;
|
73
73
|
TELEMETRY_EVENT: string;
|
package/dist/Common/Types.d.ts
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
import { default as React, ReactNode, CSSProperties, ReactElement, MutableRefObject } from 'react';
|
2
2
|
import { TippyProps } from '@tippyjs/react';
|
3
|
-
import { Placement } from 'tippy.js';
|
4
3
|
import { UserGroupDTO } from '../Pages/GlobalConfigurations';
|
5
4
|
import { ImageComment, ReleaseTag } from './ImageTags.Types';
|
6
5
|
import { MandatoryPluginBaseStateType, RegistryType, RuntimePluginVariables, Severity, PolicyBlockInfo } from '../Shared';
|
@@ -74,7 +73,7 @@ export interface TippyCustomizedProps extends Pick<TippyProps, 'appendTo'> {
|
|
74
73
|
noHeadingBorder?: boolean;
|
75
74
|
infoTextHeading?: string;
|
76
75
|
hideHeading?: boolean;
|
77
|
-
placement?:
|
76
|
+
placement?: TippyProps['placement'];
|
78
77
|
className?: string;
|
79
78
|
Icon?: React.FunctionComponent<React.SVGProps<SVGSVGElement>>;
|
80
79
|
iconPath?: string;
|
@@ -296,21 +295,6 @@ export declare enum ManualApprovalType {
|
|
296
295
|
any = "ANY",
|
297
296
|
notConfigured = "NOT_CONFIGURED"
|
298
297
|
}
|
299
|
-
export interface UserGroupApproverType {
|
300
|
-
email: string;
|
301
|
-
hasAccess: boolean;
|
302
|
-
}
|
303
|
-
export interface ImageApprovalPolicyUserGroupDataType {
|
304
|
-
dataStore: Record<string, UserGroupApproverType>;
|
305
|
-
requiredCount: number;
|
306
|
-
emails: string[];
|
307
|
-
}
|
308
|
-
export interface ImageApprovalPolicyType {
|
309
|
-
isPolicyConfigured: boolean;
|
310
|
-
specificUsersData: ImageApprovalPolicyUserGroupDataType;
|
311
|
-
userGroupData: Record<string, ImageApprovalPolicyUserGroupDataType>;
|
312
|
-
validGroups: string[];
|
313
|
-
}
|
314
298
|
export type ImageApprovalUsersInfoDTO = Record<string, Pick<UserGroupDTO, 'identifier' | 'name'>[]>;
|
315
299
|
export interface UserApprovalConfigType {
|
316
300
|
type: ManualApprovalType;
|
@@ -323,13 +307,6 @@ export interface UserApprovalConfigType {
|
|
323
307
|
requiredCount: number;
|
324
308
|
})[];
|
325
309
|
}
|
326
|
-
export type UserApprovalConfigPayloadType = ({
|
327
|
-
type: ManualApprovalType.any;
|
328
|
-
} & Pick<UserApprovalConfigType, 'requiredCount'>) | ({
|
329
|
-
type: ManualApprovalType.specific;
|
330
|
-
} & Pick<UserApprovalConfigType, 'userGroups' | 'specificUsers'>) | {
|
331
|
-
type: ManualApprovalType.notConfigured;
|
332
|
-
};
|
333
310
|
interface ApprovalUserDataType {
|
334
311
|
dataId: number;
|
335
312
|
userActionTime: string;
|
@@ -339,12 +316,45 @@ interface ApprovalUserDataType {
|
|
339
316
|
userResponse: number;
|
340
317
|
userGroups?: Pick<UserGroupDTO, 'identifier' | 'name'>[];
|
341
318
|
}
|
319
|
+
export interface UserApprovalInfo {
|
320
|
+
requiredCount: number;
|
321
|
+
currentCount: number;
|
322
|
+
approverList: {
|
323
|
+
hasApproved: boolean;
|
324
|
+
canApprove: boolean;
|
325
|
+
identifier: string;
|
326
|
+
}[];
|
327
|
+
}
|
328
|
+
export declare enum ApprovalConfigDataKindType {
|
329
|
+
configMap = "configuration/config-map",
|
330
|
+
configSecret = "configuration/config-secret",
|
331
|
+
deploymentTemplate = "configuration/deployment-template",
|
332
|
+
deploymentTrigger = "approval/deployment"
|
333
|
+
}
|
334
|
+
export interface ApprovalConfigDataType extends Pick<UserApprovalInfo, 'currentCount' | 'requiredCount'> {
|
335
|
+
kind: ApprovalConfigDataKindType | null;
|
336
|
+
anyUserApprovedInfo: UserApprovalInfo;
|
337
|
+
specificUsersApprovedInfo: UserApprovalInfo;
|
338
|
+
userGroupsApprovedInfo: Pick<UserApprovalInfo, 'currentCount' | 'requiredCount'> & {
|
339
|
+
userGroups: (UserApprovalInfo & {
|
340
|
+
groupIdentifier: UserGroupDTO['identifier'];
|
341
|
+
groupName: UserGroupDTO['name'];
|
342
|
+
})[];
|
343
|
+
};
|
344
|
+
}
|
345
|
+
export declare enum ApprovalRuntimeStateType {
|
346
|
+
init = 0,
|
347
|
+
requested = 1,
|
348
|
+
approved = 2,
|
349
|
+
consumed = 3
|
350
|
+
}
|
342
351
|
export interface UserApprovalMetadataType {
|
343
352
|
approvalRequestId: number;
|
344
|
-
approvalRuntimeState:
|
345
|
-
approvedUsersData: ApprovalUserDataType[];
|
353
|
+
approvalRuntimeState: ApprovalRuntimeStateType;
|
346
354
|
requestedUserData: ApprovalUserDataType;
|
347
|
-
|
355
|
+
hasCurrentUserApproved: boolean;
|
356
|
+
canCurrentUserApprove: boolean;
|
357
|
+
approvalConfigData: ApprovalConfigDataType;
|
348
358
|
}
|
349
359
|
export declare enum FilterStates {
|
350
360
|
ALLOWED = 0,
|
@@ -401,7 +411,6 @@ export interface CDMaterialListModalServiceUtilProps {
|
|
401
411
|
artifactId?: number;
|
402
412
|
artifactStatus?: string;
|
403
413
|
disableDefaultSelection?: boolean;
|
404
|
-
userApprovalConfig?: UserApprovalConfigType;
|
405
414
|
}
|
406
415
|
export interface CDMaterialType {
|
407
416
|
index: number;
|
@@ -550,8 +559,7 @@ export interface CommonNodeAttr extends Pick<MandatoryPluginBaseStateType, 'isTr
|
|
550
559
|
primaryBranchAfterRegex?: string;
|
551
560
|
storageConfigured?: boolean;
|
552
561
|
deploymentAppDeleteRequest?: boolean;
|
553
|
-
|
554
|
-
userApprovalConfig?: UserApprovalConfigType;
|
562
|
+
approvalConfigData: ApprovalConfigDataType;
|
555
563
|
requestedUserId?: number;
|
556
564
|
showPluginWarning: boolean;
|
557
565
|
helmPackageName?: string;
|
@@ -609,14 +617,17 @@ export interface FilterConditionsListType {
|
|
609
617
|
description: string;
|
610
618
|
conditions: FilterConditionsInfo[];
|
611
619
|
}
|
620
|
+
export interface DeploymentApprovalInfoType {
|
621
|
+
eligibleApprovers: {
|
622
|
+
specificUsers: Pick<UserApprovalInfo, 'approverList'>;
|
623
|
+
anyUsers: Pick<UserApprovalInfo, 'approverList'>;
|
624
|
+
userGroups: (Pick<ApprovalConfigDataType['userGroupsApprovedInfo']['userGroups'][number], 'groupIdentifier' | 'groupName'> & Pick<UserApprovalInfo, 'approverList'>)[];
|
625
|
+
};
|
626
|
+
approvalConfigData: ApprovalConfigDataType;
|
627
|
+
}
|
612
628
|
export interface CDMaterialsApprovalInfo {
|
613
|
-
approvalUsers: string[];
|
614
|
-
userApprovalConfig: UserApprovalConfigType;
|
615
629
|
canApproverDeploy: boolean;
|
616
|
-
|
617
|
-
* Only available incase of approvals do'nt use in cd materials or any other flow since approvalUsers are not present there
|
618
|
-
*/
|
619
|
-
imageApprovalPolicyDetails: ImageApprovalPolicyType;
|
630
|
+
deploymentApprovalInfo: DeploymentApprovalInfoType;
|
620
631
|
}
|
621
632
|
export interface CDMaterialsMetaInfo {
|
622
633
|
tagsEditable: boolean;
|
@@ -696,7 +707,6 @@ export interface AppEnvironment {
|
|
696
707
|
appStatus?: string;
|
697
708
|
deploymentAppDeleteRequest?: boolean;
|
698
709
|
isVirtualEnvironment?: boolean;
|
699
|
-
isProtected?: boolean;
|
700
710
|
pipelineId?: number;
|
701
711
|
latestCdWorkflowRunnerId?: number;
|
702
712
|
commits?: string[];
|
@@ -747,7 +757,6 @@ export interface CdPipeline extends Partial<Pick<CommonNodeAttr, 'triggerBlocked
|
|
747
757
|
parentPipelineType?: string;
|
748
758
|
deploymentAppDeleteRequest?: boolean;
|
749
759
|
deploymentAppCreated?: boolean;
|
750
|
-
userApprovalConfig?: UserApprovalConfigType;
|
751
760
|
isVirtualEnvironment?: boolean;
|
752
761
|
deploymentAppType: DeploymentAppTypes;
|
753
762
|
helmPackageName?: string;
|
@@ -756,6 +765,7 @@ export interface CdPipeline extends Partial<Pick<CommonNodeAttr, 'triggerBlocked
|
|
756
765
|
isProdEnv?: boolean;
|
757
766
|
isGitOpsRepoNotConfigured?: boolean;
|
758
767
|
isDeploymentBlocked?: boolean;
|
768
|
+
approvalConfigData: ApprovalConfigDataType;
|
759
769
|
isTriggerBlocked?: boolean;
|
760
770
|
}
|
761
771
|
export interface ExternalCiConfig {
|
@@ -858,12 +868,11 @@ export interface Point {
|
|
858
868
|
export interface EdgeNodeType {
|
859
869
|
height: number;
|
860
870
|
width: number;
|
861
|
-
userApprovalConfig?: UserApprovalConfigType;
|
862
871
|
type?: any;
|
863
872
|
id?: number | string;
|
864
873
|
}
|
865
874
|
export interface EdgeEndNodeType extends EdgeNodeType {
|
866
|
-
|
875
|
+
approvalConfigData: ApprovalConfigDataType;
|
867
876
|
}
|
868
877
|
/**
|
869
878
|
* Search params for sorting configuration
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { BuildStageType, FormType } from '../../../../../Common/CIPipeline.Types';
|
2
|
-
import { DeploymentAppTypes
|
2
|
+
import { DeploymentAppTypes } from '../../../../../Common/Types';
|
3
3
|
import { DeploymentStrategy } from '../../../../../Shared/Components';
|
4
4
|
import { EnvListMinDTO } from '../../../../../Shared/types';
|
5
5
|
interface ConfigSecretType {
|
@@ -53,7 +53,6 @@ export interface CDFormType {
|
|
53
53
|
secrets: ConfigSecretType[];
|
54
54
|
};
|
55
55
|
requiredApprovals: string;
|
56
|
-
userApprovalConfig?: UserApprovalConfigType;
|
57
56
|
isClusterCdActive: boolean;
|
58
57
|
deploymentAppCreated: boolean;
|
59
58
|
clusterId: string;
|
@@ -1,2 +1,2 @@
|
|
1
1
|
import { FeatureDescriptionModalProps } from './types';
|
2
|
-
export declare const FeatureDescriptionModal: ({ title, renderDescriptionContent, closeModalText, docLink, closeModal, imageVariant, SVGImage, imageStyles, }: FeatureDescriptionModalProps) => JSX.Element;
|
2
|
+
export declare const FeatureDescriptionModal: ({ title, renderDescriptionContent, closeModalText, docLink, closeModal, imageVariant, SVGImage, imageStyles, tabsConfig, }: FeatureDescriptionModalProps) => JSX.Element;
|
@@ -1,3 +1,3 @@
|
|
1
1
|
import { DescriptorProps } from './types';
|
2
|
-
declare const FeatureTitleWithInfo: ({ additionalContainerClasses, breadCrumbs, children, iconClassName, title, renderDescriptionContent, closeModalText, docLink, SVGImage, showInfoIconTippy, docLinkText, dataTestId, additionalContent, showInfoIcon, }: DescriptorProps) => JSX.Element;
|
2
|
+
declare const FeatureTitleWithInfo: ({ additionalContainerClasses, breadCrumbs, children, iconClassName, title, renderDescriptionContent, closeModalText, docLink, SVGImage, showInfoIconTippy, docLinkText, dataTestId, additionalContent, showInfoIcon, tabsConfig, }: DescriptorProps) => JSX.Element;
|
3
3
|
export default FeatureTitleWithInfo;
|
@@ -1,17 +1,44 @@
|
|
1
1
|
import { default as React, ReactNode } from 'react';
|
2
2
|
import { ImageType } from '../../../Common';
|
3
3
|
import { Breadcrumb } from '../../../Common/BreadCrumb/Types';
|
4
|
-
|
5
|
-
title: string;
|
4
|
+
interface BaseFeatureDescriptionModalProps {
|
6
5
|
renderDescriptionContent?: () => ReactNode;
|
7
|
-
closeModalText?: string;
|
8
6
|
docLink?: string;
|
9
|
-
closeModal?: () => void;
|
10
7
|
imageVariant?: ImageType;
|
11
8
|
SVGImage?: React.FunctionComponent<React.SVGProps<SVGSVGElement>>;
|
12
9
|
imageStyles?: React.CSSProperties;
|
13
10
|
}
|
14
|
-
|
11
|
+
type FeatureDescriptionModalWithTabsConfig = {
|
12
|
+
/**
|
13
|
+
* If provided, tabs are shown and have higher precedence over normal modal
|
14
|
+
*/
|
15
|
+
tabsConfig: ({
|
16
|
+
/**
|
17
|
+
* Unique id of the tab
|
18
|
+
*/
|
19
|
+
id: string;
|
20
|
+
/**
|
21
|
+
* Title for the tab
|
22
|
+
*/
|
23
|
+
title: string;
|
24
|
+
} & BaseFeatureDescriptionModalProps)[];
|
25
|
+
} & {
|
26
|
+
renderDescriptionContent?: never;
|
27
|
+
docLink?: never;
|
28
|
+
imageVariant?: never;
|
29
|
+
SVGImage?: never;
|
30
|
+
imageStyles?: never;
|
31
|
+
};
|
32
|
+
export type FeatureDescriptionModalProps = {
|
33
|
+
title: string;
|
34
|
+
closeModalText?: string;
|
35
|
+
closeModal?: () => void;
|
36
|
+
} & ((BaseFeatureDescriptionModalProps & {
|
37
|
+
tabsConfig?: never;
|
38
|
+
}) | FeatureDescriptionModalWithTabsConfig);
|
39
|
+
export type DescriptorProps = ((Omit<FeatureDescriptionModalProps, 'tabsConfig'> & {
|
40
|
+
tabsConfig?: never;
|
41
|
+
}) | (Pick<FeatureDescriptionModalProps, 'title' | 'closeModalText' | 'closeModal'> & FeatureDescriptionModalWithTabsConfig)) & {
|
15
42
|
breadCrumbs?: Breadcrumb[];
|
16
43
|
additionalContainerClasses?: string;
|
17
44
|
iconClassName?: string;
|
@@ -26,4 +53,5 @@ export interface DescriptorProps extends FeatureDescriptionModalProps {
|
|
26
53
|
* @default false
|
27
54
|
*/
|
28
55
|
showInfoIcon?: boolean;
|
29
|
-
}
|
56
|
+
};
|
57
|
+
export {};
|
@@ -1,3 +1,3 @@
|
|
1
1
|
import { ImageCardAccordionProps } from './types';
|
2
|
-
declare const ImageCardAccordion: ({ isSecurityModuleInstalled, artifactId, applicationId, environmentId, changesCard, isScanned, isScanEnabled, SecurityModalSidebar, }: ImageCardAccordionProps) => JSX.Element;
|
2
|
+
declare const ImageCardAccordion: ({ isSecurityModuleInstalled, artifactId, applicationId, environmentId, changesCard, isScanned, isScanEnabled, SecurityModalSidebar, getSecurityScan, }: ImageCardAccordionProps) => JSX.Element;
|
3
3
|
export default ImageCardAccordion;
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { default as React, ReactNode } from 'react';
|
2
|
-
import { CDModalTabType, VulnerabilityType } from '../../../Common';
|
2
|
+
import { CDModalTabType, ResponseType, VulnerabilityType } from '../../../Common';
|
3
3
|
import { MaterialSecurityInfoType } from '../../types';
|
4
|
-
import { SidebarPropsType } from '../Security';
|
4
|
+
import { ApiResponseResultType, AppDetailsPayload, SidebarPropsType } from '../Security';
|
5
5
|
export interface ImageCardAccordionProps extends MaterialSecurityInfoType {
|
6
6
|
isSecurityModuleInstalled: boolean;
|
7
7
|
artifactId: number;
|
@@ -11,6 +11,7 @@ export interface ImageCardAccordionProps extends MaterialSecurityInfoType {
|
|
11
11
|
isScanned: boolean;
|
12
12
|
isScanEnabled: boolean;
|
13
13
|
SecurityModalSidebar: React.FC<SidebarPropsType>;
|
14
|
+
getSecurityScan: (props: Pick<AppDetailsPayload, 'appId' | 'artifactId'>) => Promise<ResponseType<ApiResponseResultType>>;
|
14
15
|
}
|
15
16
|
export interface SecurityDetailsType {
|
16
17
|
vulnerabilities: VulnerabilityType[];
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import {
|
1
|
+
import { ApiResponseResultType, CodeScan, DetailViewDataType, EmptyStateType, InfoCardPropsType, OpenDetailViewButtonProps, SecurityModalStateType, StatusType, TablePropsType } from '../types';
|
2
2
|
export declare const getCodeScanVulnerabilities: (data: CodeScan["vulnerability"], hidePolicy: boolean) => {
|
3
3
|
headers: ({
|
4
4
|
headerText: string;
|
@@ -97,4 +97,4 @@ export declare const getCodeScanExposedSecrets: (data: CodeScan["exposedSecrets"
|
|
97
97
|
};
|
98
98
|
export declare const getCodeScanTableData: (data: CodeScan, subCategory: SecurityModalStateType["subCategory"], setDetailViewData: OpenDetailViewButtonProps["setDetailViewData"], hidePolicy: boolean) => TablePropsType;
|
99
99
|
export declare const getCodeScanInfoCardData: (data: CodeScan, subCategory: SecurityModalStateType["subCategory"]) => InfoCardPropsType;
|
100
|
-
export declare const getCodeScanEmptyState: (data:
|
100
|
+
export declare const getCodeScanEmptyState: (data: ApiResponseResultType, subCategory: SecurityModalStateType["subCategory"], detailViewData: DetailViewDataType) => EmptyStateType;
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import {
|
2
|
-
export declare const getEmptyStateValues: (data:
|
1
|
+
import { ApiResponseResultType, DetailViewDataType, SecurityModalStateType } from '../types';
|
2
|
+
export declare const getEmptyStateValues: (data: ApiResponseResultType, category: SecurityModalStateType["category"], subCategory: SecurityModalStateType["subCategory"], detailViewData: DetailViewDataType) => import('../types').EmptyStateType;
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import { DetailViewDataType, ImageScan, SecurityModalStateType, TablePropsType, StatusType, InfoCardPropsType, EmptyStateType,
|
1
|
+
import { DetailViewDataType, ImageScan, SecurityModalStateType, TablePropsType, StatusType, InfoCardPropsType, EmptyStateType, ApiResponseResultType, OpenDetailViewButtonProps } from '../types';
|
2
2
|
export declare const getProgressingStateForStatus: (status: StatusType["status"]) => JSX.Element;
|
3
3
|
export declare const getImageScanTableData: (data: ImageScan, subCategory: SecurityModalStateType["subCategory"], setDetailViewData: OpenDetailViewButtonProps["setDetailViewData"], hidePolicy: boolean) => TablePropsType;
|
4
4
|
export declare const getImageScanInfoCardData: (data: ImageScan, subCategory: SecurityModalStateType["subCategory"]) => InfoCardPropsType;
|
5
|
-
export declare const getImageScanEmptyState: (data:
|
5
|
+
export declare const getImageScanEmptyState: (data: ApiResponseResultType, subCategory: SecurityModalStateType["subCategory"], detailViewData: DetailViewDataType) => EmptyStateType;
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import { InfoCardPropsType,
|
2
|
-
export declare const getInfoCardData: (data:
|
1
|
+
import { InfoCardPropsType, ApiResponseResultType, SecurityModalStateType } from '../types';
|
2
|
+
export declare const getInfoCardData: (data: ApiResponseResultType, category: SecurityModalStateType["category"], subCategory: SecurityModalStateType["subCategory"]) => InfoCardPropsType;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import {
|
1
|
+
import { ApiResponseResultType, DetailViewDataType, EmptyStateType, InfoCardPropsType, KubernetesManifest, OpenDetailViewButtonProps, SecurityModalStateType, TablePropsType } from '../types';
|
2
2
|
export declare const getKubernetesManifestTableData: (data: KubernetesManifest, subCategory: SecurityModalStateType["subCategory"], setDetailViewData: OpenDetailViewButtonProps["setDetailViewData"]) => TablePropsType;
|
3
3
|
export declare const getKubernetesManifestInfoCardData: (data: KubernetesManifest, subCategory: SecurityModalStateType["subCategory"]) => InfoCardPropsType;
|
4
|
-
export declare const getKubernetesManifestEmptyState: (data:
|
4
|
+
export declare const getKubernetesManifestEmptyState: (data: ApiResponseResultType, subCategory: SecurityModalStateType["subCategory"], detailViewData: DetailViewDataType) => EmptyStateType;
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import { SidebarDataType
|
2
|
-
export declare const
|
1
|
+
import { SidebarDataType } from '../types';
|
2
|
+
export declare const SIDEBAR_DATA: SidebarDataType[];
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import {
|
2
|
-
export declare const getTableData: (data:
|
1
|
+
import { ApiResponseResultType, OpenDetailViewButtonProps, SecurityModalStateType, TablePropsType } from '../types';
|
2
|
+
export declare const getTableData: (data: ApiResponseResultType, category: SecurityModalStateType["category"], subCategory: SecurityModalStateType["subCategory"], setDetailViewData: OpenDetailViewButtonProps["setDetailViewData"], hidePolicy: boolean) => TablePropsType;
|
@@ -16,23 +16,23 @@ export declare const SUB_CATEGORY_LABELS: {
|
|
16
16
|
readonly EXPOSED_SECRETS: "Exposed Secrets";
|
17
17
|
};
|
18
18
|
export declare const SEVERITIES: {
|
19
|
-
readonly
|
19
|
+
readonly CRITICAL: {
|
20
20
|
readonly label: "Critical";
|
21
21
|
readonly color: "#B21212";
|
22
22
|
};
|
23
|
-
readonly
|
23
|
+
readonly HIGH: {
|
24
24
|
readonly label: "High";
|
25
25
|
readonly color: "#F33E3E";
|
26
26
|
};
|
27
|
-
readonly
|
27
|
+
readonly MEDIUM: {
|
28
28
|
readonly label: "Medium";
|
29
29
|
readonly color: "#FF7E5B";
|
30
30
|
};
|
31
|
-
readonly
|
31
|
+
readonly LOW: {
|
32
32
|
readonly label: "Low";
|
33
33
|
readonly color: "#FFB549";
|
34
34
|
};
|
35
|
-
readonly
|
35
|
+
readonly UNKNOWN: {
|
36
36
|
readonly label: "Unknown";
|
37
37
|
readonly color: "#B1B7BC";
|
38
38
|
};
|
@@ -1,6 +1,6 @@
|
|
1
1
|
export { default as SecurityModal } from './SecurityModal';
|
2
|
-
export { getSecurityScanSeveritiesCount, getTotalVulnerabilityCount, parseGetResourceScanDetailsResponse, } from './utils';
|
3
|
-
export type {
|
4
|
-
export {
|
2
|
+
export { getSecurityScanSeveritiesCount, getTotalVulnerabilityCount, parseGetResourceScanDetailsResponse, parseExecutionDetailResponse, } from './utils';
|
3
|
+
export type { AppDetailsPayload, ExecutionDetailsPayload, ApiResponseResultType, SidebarPropsType, SidebarDataChildType, SidebarDataType, GetResourceScanDetailsPayloadType, GetResourceScanDetailsResponseType, } from './types';
|
4
|
+
export { SIDEBAR_DATA, getProgressingStateForStatus } from './config';
|
5
5
|
export { CATEGORY_LABELS } from './constants';
|
6
|
-
export {
|
6
|
+
export { getExecutionDetails } from './service';
|
@@ -1,3 +1,3 @@
|
|
1
1
|
import { ResponseType } from '../../../../Common/Types';
|
2
|
-
import {
|
3
|
-
export declare const
|
2
|
+
import { ApiResponseResultType, ExecutionDetailsPayload } from './types';
|
3
|
+
export declare const getExecutionDetails: (executionDetailPayload: ExecutionDetailsPayload) => Promise<ResponseType<ApiResponseResultType>>;
|
@@ -15,13 +15,17 @@ export interface GetResourceScanDetailsPayloadType {
|
|
15
15
|
deploymentType?: number;
|
16
16
|
isAppDetailView?: boolean;
|
17
17
|
}
|
18
|
-
export interface
|
18
|
+
export interface AppDetailsPayload {
|
19
19
|
appId?: number | string;
|
20
20
|
envId?: number | string;
|
21
21
|
installedAppId?: number | string;
|
22
22
|
artifactId?: number | string;
|
23
23
|
installedAppVersionHistoryId?: number | string;
|
24
24
|
}
|
25
|
+
export interface ExecutionDetailsPayload extends Partial<Pick<AppDetailsPayload, 'appId' | 'envId'>> {
|
26
|
+
imageScanDeployInfoId?: number | string;
|
27
|
+
artifactId?: number | string;
|
28
|
+
}
|
25
29
|
export declare const CATEGORIES: {
|
26
30
|
readonly IMAGE_SCAN: "imageScan";
|
27
31
|
readonly CODE_SCAN: "codeScan";
|
@@ -85,16 +89,17 @@ export type SecurityModalStateType = {
|
|
85
89
|
detailViewData: DetailViewDataType[];
|
86
90
|
};
|
87
91
|
export interface SidebarPropsType {
|
92
|
+
isHelmApp: boolean;
|
88
93
|
modalState: SecurityModalStateType;
|
89
94
|
setModalState: React.Dispatch<React.SetStateAction<SecurityModalStateType>>;
|
90
|
-
|
95
|
+
isExternalCI: boolean;
|
91
96
|
}
|
92
97
|
export declare enum SeveritiesDTO {
|
93
|
-
CRITICAL = "
|
94
|
-
HIGH = "
|
95
|
-
MEDIUM = "
|
96
|
-
LOW = "
|
97
|
-
UNKNOWN = "
|
98
|
+
CRITICAL = "CRITICAL",
|
99
|
+
HIGH = "HIGH",
|
100
|
+
MEDIUM = "MEDIUM",
|
101
|
+
LOW = "LOW",
|
102
|
+
UNKNOWN = "UNKNOWN",
|
98
103
|
FAILURES = "fail",
|
99
104
|
SUCCESSES = "success",
|
100
105
|
EXCEPTIONS = "exceptions"
|
@@ -194,19 +199,21 @@ export type KubernetesManifest = {
|
|
194
199
|
[SUB_CATEGORIES.MISCONFIGURATIONS]: GenericGroupTypeWithMisConfSummary<CodeScanMisconfigurationsListType>;
|
195
200
|
[SUB_CATEGORIES.EXPOSED_SECRETS]: GenericGroupTypeWithSummary<CodeScanExposedSecretsListType>;
|
196
201
|
} & StatusType;
|
197
|
-
export type
|
202
|
+
export type ApiResponseResultType = {
|
198
203
|
scanned: boolean;
|
199
|
-
isImageScanEnabled: boolean;
|
200
204
|
[CATEGORIES.IMAGE_SCAN]: ImageScan;
|
201
205
|
[CATEGORIES.CODE_SCAN]: CodeScan;
|
202
206
|
[CATEGORIES.KUBERNETES_MANIFEST]: KubernetesManifest;
|
203
207
|
};
|
204
|
-
interface SecurityModalBaseProps {
|
208
|
+
interface SecurityModalBaseProps extends Partial<Pick<SidebarPropsType, 'isExternalCI'>> {
|
205
209
|
isLoading: boolean;
|
206
210
|
error: ServerErrors;
|
207
|
-
responseData:
|
211
|
+
responseData: ApiResponseResultType;
|
208
212
|
handleModalClose: (event?: React.MouseEvent<HTMLElement>) => void;
|
209
|
-
Sidebar
|
213
|
+
Sidebar: React.FC<SidebarPropsType>;
|
214
|
+
isHelmApp?: boolean;
|
215
|
+
isResourceScan?: boolean;
|
216
|
+
isSecurityScanV2Enabled: boolean;
|
210
217
|
hidePolicy?: boolean;
|
211
218
|
}
|
212
219
|
export type SecurityModalPropsType = SecurityModalBaseProps;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import {
|
1
|
+
import { ApiResponseResultType, SeveritiesDTO, GetResourceScanDetailsResponseType, ImageScanVulnerabilityType, ImageVulnerabilityType, VulnerabilityCountType } from './types';
|
2
2
|
import { SEVERITIES } from './constants';
|
3
3
|
export declare const mapSeveritiesToSegmentedBarChartEntities: (severities: Partial<Record<keyof typeof SEVERITIES, number>>) => {
|
4
4
|
color: "#B1B7BC" | "#B21212" | "#F33E3E" | "#FF7E5B" | "#FFB549" | "#1DAD70";
|
@@ -8,7 +8,7 @@ export declare const mapSeveritiesToSegmentedBarChartEntities: (severities: Part
|
|
8
8
|
export declare const stringifySeverities: (severities: Partial<Record<keyof typeof SEVERITIES, number>>) => string;
|
9
9
|
export declare const getSeverityWeight: (severity: SeveritiesDTO) => number;
|
10
10
|
export declare const compareSeverity: (a: SeveritiesDTO, b: SeveritiesDTO) => number;
|
11
|
-
export declare const getSecurityScanSeveritiesCount: (data:
|
11
|
+
export declare const getSecurityScanSeveritiesCount: (data: ApiResponseResultType) => {
|
12
12
|
critical: number;
|
13
13
|
high: number;
|
14
14
|
medium: number;
|
@@ -22,7 +22,8 @@ export declare const getScanCompletedEmptyState: (scanToolId: number) => {
|
|
22
22
|
children: JSX.Element;
|
23
23
|
};
|
24
24
|
export declare const compareStringAndObject: (a: string | object, b: string | object) => number;
|
25
|
-
export declare const
|
25
|
+
export declare const parseExecutionDetailResponse: (scanResult: any) => ApiResponseResultType;
|
26
|
+
export declare const parseGetResourceScanDetailsResponse: (data: GetResourceScanDetailsResponseType) => ApiResponseResultType;
|
26
27
|
export declare const getTotalVulnerabilityCount: (scannedResult: ImageVulnerabilityType[]) => VulnerabilityCountType;
|
27
28
|
export declare const groupByTarget: (list: ImageScanVulnerabilityType[]) => {
|
28
29
|
source: string;
|
@@ -1,3 +1,3 @@
|
|
1
1
|
import { SecuritySummaryCardProps } from './types';
|
2
|
-
declare const SecuritySummaryCard: ({ severityCount, scanToolId, rootClassName, SecurityModalSidebar, responseData, hidePolicy, }: SecuritySummaryCardProps) => JSX.Element;
|
2
|
+
declare const SecuritySummaryCard: ({ severityCount, scanToolId, rootClassName, isHelmApp, SecurityModalSidebar, responseData, isSecurityScanV2Enabled, hidePolicy, }: SecuritySummaryCardProps) => JSX.Element;
|
3
3
|
export default SecuritySummaryCard;
|
@@ -1,10 +1,12 @@
|
|
1
1
|
import { SeverityCount } from '../../../types';
|
2
2
|
import { ImageCardAccordionProps } from '@Shared/Components/ImageCardAccordion/types';
|
3
|
-
import {
|
3
|
+
import { ApiResponseResultType } from '../SecurityModal';
|
4
4
|
export type SecuritySummaryCardProps = {
|
5
5
|
severityCount: SeverityCount;
|
6
6
|
scanToolId: number;
|
7
7
|
rootClassName?: string;
|
8
|
-
|
8
|
+
isHelmApp?: boolean;
|
9
|
+
isSecurityScanV2Enabled: boolean;
|
10
|
+
responseData: ApiResponseResultType;
|
9
11
|
hidePolicy?: boolean;
|
10
12
|
} & Pick<ImageCardAccordionProps, 'SecurityModalSidebar'>;
|
@@ -1,3 +1,3 @@
|
|
1
1
|
import { VulnerabilitiesProps } from './types';
|
2
|
-
declare const Vulnerabilities: ({ isScanned, isScanEnabled, artifactId, applicationId, environmentId, setVulnerabilityCount, SecurityModalSidebar, }: VulnerabilitiesProps) => JSX.Element;
|
2
|
+
declare const Vulnerabilities: ({ isScanned, isScanEnabled, artifactId, applicationId, environmentId, setVulnerabilityCount, SecurityModalSidebar, getSecurityScan, }: VulnerabilitiesProps) => JSX.Element;
|
3
3
|
export default Vulnerabilities;
|
@@ -1,8 +1,24 @@
|
|
1
|
+
import { ResponseType } from '../../../../Common/Types';
|
1
2
|
import { ImageCardAccordionProps } from '@Shared/Components/ImageCardAccordion/types';
|
2
3
|
import { MaterialSecurityInfoType } from '../../../types';
|
3
|
-
|
4
|
+
import { ApiResponseResultType } from '../SecurityModal';
|
5
|
+
export interface VulnerabilitiesProps extends MaterialSecurityInfoType, Pick<ImageCardAccordionProps, 'SecurityModalSidebar' | 'getSecurityScan'> {
|
4
6
|
artifactId: number;
|
5
7
|
applicationId: number;
|
6
8
|
environmentId: number;
|
7
9
|
setVulnerabilityCount: React.Dispatch<React.SetStateAction<number>>;
|
8
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
|
+
}
|
@@ -1 +1,6 @@
|
|
1
|
+
import { LastExecutionResponseType, LastExecutionResultType } from '../../../types';
|
2
|
+
import { UseGetSecurityVulnerabilitiesProps, UseGetSecurityVulnerabilitiesReturnType } from './types';
|
1
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,8 +1,5 @@
|
|
1
1
|
import { SeverityCount } from '../../types';
|
2
|
-
import {
|
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;
|
3
5
|
export declare const getCVEUrlFromCVEName: (cveName: string) => string;
|
4
|
-
export declare const getScanToolAndSeverityCount: (scanResult: ScanResultDTO) => {
|
5
|
-
scanToolId: number;
|
6
|
-
severityCount: SeverityCount;
|
7
|
-
totalCount: number;
|
8
|
-
};
|