-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathTypes.ts
More file actions
1124 lines (1017 loc) · 27.5 KB
/
Types.ts
File metadata and controls
1124 lines (1017 loc) · 27.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
* Copyright (c) 2024. Devtron Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import React, { ReactNode, CSSProperties, ReactElement, MutableRefObject } from 'react'
import { TippyProps } from '@tippyjs/react'
import { UserGroupDTO } from '@Pages/GlobalConfigurations'
import { ImageComment, ReleaseTag } from './ImageTags.Types'
import {
MandatoryPluginBaseStateType,
RegistryType,
RuntimePluginVariables,
Severity,
PolicyBlockInfo,
TargetPlatformItemDTO,
ButtonProps,
ComponentLayoutType,
StatusType,
} from '../Shared'
import {
ACTION_STATE,
DEPLOYMENT_WINDOW_TYPE,
DockerConfigOverrideType,
RefVariableType,
SortingOrder,
TaskErrorObj,
VariableTypeFormat,
} from '.'
/**
* Generic response type object with support for overriding the result type
*
* @example Default usage:
* ```ts
* interface UserResponse extends ResponseType {}
* ```
*
* @example Override the response type:
* ```ts
* interface UserResponse extends ResponseType<Record<string, string>> {}
* ```
*/
export interface ResponseType<T = any> {
code: number
status: string
result?: T
errors?: any
}
export interface APIOptions {
timeout?: number
/**
* @deprecated Use abortController instead
*/
signal?: AbortSignal
abortControllerRef?: MutableRefObject<AbortController>
/**
* @default false
*/
preventAutoLogout?: boolean
/**
* @default false
*/
preventLicenseRedirect?: boolean
/**
* @default false
*/
shouldParseServerErrorForUnauthorizedUser?: boolean
}
export interface OptionType<T = string, K = string> {
value: T
label: K
}
export enum TippyTheme {
black = 'black',
white = 'white',
}
export interface TeamList extends ResponseType {
result: Teams[]
}
export interface Teams {
id: number
name: string
active: boolean
}
export enum CHECKBOX_VALUE {
CHECKED = 'CHECKED',
INTERMEDIATE = 'INTERMEDIATE',
BULK_CHECKED = 'BULK_CHECKED',
}
export interface CheckboxProps {
onChange: (event) => void
isChecked: boolean
// FIXME: Need to replace this CHECKBOX_VALUE enum, and replace string instances in dashboard
value: 'CHECKED' | 'INTERMEDIATE' | 'BULK_CHECKED'
name?: string
disabled?: boolean
tabIndex?: number
rootClassName?: string
onClick?: (event) => void
id?: string
dataTestId?: string
children?: ReactNode
}
export interface TippyCustomizedProps extends Pick<TippyProps, 'appendTo'> {
theme: TippyTheme
visible?: boolean
heading?: ReactNode | string
headingInfo?: ReactNode | string
noHeadingBorder?: boolean
infoTextHeading?: string
hideHeading?: boolean
placement?: TippyProps['placement']
className?: string
Icon?: React.FunctionComponent<React.SVGProps<SVGSVGElement>>
iconPath?: string
iconClass?: string
iconSize?: number // E.g. 16, 20, etc.. Currently, there are around 12 sizes supported. Check `icons.css` or `base.scss` for supported sizes or add new size (class names starts with `icon-dim-`).
onImageLoadError?: (e) => void
onClose?: () => void
infoText?: React.ReactNode
showCloseButton?: boolean
arrow?: boolean
interactive?: boolean
showOnCreate?: boolean
trigger?: string
animation?: string
duration?: number
additionalContent?: ReactNode
documentationLink?: string
documentationLinkText?: string
children: React.ReactElement<any>
disableClose?: boolean
}
export interface InfoIconTippyProps
extends Pick<
TippyCustomizedProps,
| 'heading'
| 'infoText'
| 'iconClass'
| 'documentationLink'
| 'documentationLinkText'
| 'additionalContent'
| 'placement'
| 'Icon'
| 'headingInfo'
> {
dataTestid?: string
children?: TippyCustomizedProps['children']
iconClassName?: string
buttonPadding?: string
}
export interface GenericEmptyStateType {
title: ReactNode
image?
classname?: string
subTitle?: ReactNode
isButtonAvailable?: boolean
styles?: CSSProperties
imageType?: string
SvgImage?
renderButton?: () => JSX.Element
imageClassName?: string
children?: ReactNode
noImage?: boolean
imageStyles?: CSSProperties
/**
* @default 'column'
*/
layout?: ComponentLayoutType
contentClassName?: string
}
export interface ErrorPageType
extends Pick<GenericEmptyStateType, 'image' | 'title' | 'subTitle' | 'renderButton' | 'imageType'>,
Pick<ErrorScreenManagerProps, 'reload' | 'redirectURL'> {
code: number
redirectURL?: string
reload?: () => void
}
export interface ErrorScreenManagerProps {
code?: number
imageType?: ImageType
reload?: (...args) => any
subtitle?: React.ReactChild
reloadClass?: string
/**
* Would be used to redirect URL in case of 404
* @default - APP_LIST
*/
redirectURL?: string
}
export interface ErrorScreenNotAuthorizedProps {
subtitle?: React.ReactChild
title?: string
}
export enum ImageType {
Large = 'large',
Medium = 'medium',
SMALL = 'small',
}
interface InfoColourBarTextConfigType {
/**
* If given would be shown above the description, in bold
*/
heading?: string
/**
* If given would be shown below the heading (if given)
*/
description: string
actionButtonConfig?: ButtonProps
}
type InfoColourBarMessageProp =
| {
message: ReactNode
linkText?: ReactNode
redirectLink?: string
linkOnClick?: () => void
linkClass?: string
internalLink?: boolean
textConfig?: never
}
| {
textConfig: InfoColourBarTextConfigType
message?: never
linkText?: never
redirectLink?: never
linkOnClick?: () => never
linkClass?: never
internalLink?: never
}
export type InfoColourBarType = InfoColourBarMessageProp & {
classname: string
Icon
iconClass?: string
iconSize?: number // E.g. 16, 20, etc.. Currently, there are around 12 sizes supported. Check `icons.css` or `base.scss` for supported sizes or add new size (class names starts with `icon-dim-`).
renderActionButton?: () => JSX.Element
styles?: CSSProperties
/**
* If true, the icon is not shown
*
* @default false
*/
hideIcon?: boolean
}
export interface ReloadType {
reload?: (event?: any) => void
className?: string
}
export interface RadioGroupItemProps {
value: string
dataTestId?: string
disabled?: boolean
children: ReactNode
}
export interface RadioGroupInterface {
name: string
onChange: any
initialTab: string
children: ReactNode
disabled?: boolean
className?: string
}
export interface RadioInterface {
children: ReactNode
value: string
className?: string
showTippy?: boolean
tippyContent?: any
tippyPlacement?: string
/**
* If false would make radio group controlled
*/
canSelect?: boolean
isDisabled?: boolean
tippyClass?: string
dataTestId?: string
}
export interface RadioGroupComposition {
Radio?: React.FC<any>
}
export interface RadioGroupProps {
children: ReactNode
value: string
name: string
disabled?: boolean
onChange: (event) => void
className?: string
}
export interface ProgressingProps {
pageLoader?: boolean
loadingText?: string
size?: number
fullHeight?: boolean
theme?: 'white' | 'default'
styles?: React.CSSProperties
children?: React.ReactNode
fillColor?: string
}
export interface PopupMenuType {
children?: any
onToggleCallback?: (isOpen: boolean) => void
autoClose?: boolean
autoPosition?: boolean
shouldPreventDefault?: boolean
}
export interface PopupMenuButtonType {
children?: ReactNode
disabled?: boolean
rootClassName?: string
tabIndex?: number
onHover?: boolean
isKebab?: boolean
dataTestId?: string
}
export interface PopupMenuBodyType {
children?: ReactNode
rootClassName?: string
style?: React.CSSProperties
autoWidth?: boolean
preventWheelDisable?: boolean
noBackDrop?: boolean
}
export interface ModalType {
style?: React.CSSProperties
children?: ReactNode
modal?: boolean
rootClassName?: string
onClick?: any
callbackRef?: (element?: any) => any
preventWheelDisable?: boolean
noBackDrop?: boolean
}
export type CDModalTabType = 'SECURITY' | 'CHANGES'
export const CDModalTab = {
Security: <CDModalTabType>'SECURITY',
Changes: <CDModalTabType>'CHANGES',
}
export enum DeploymentNodeType {
PRECD = 'PRECD',
CD = 'CD',
POSTCD = 'POSTCD',
APPROVAL = 'APPROVAL',
}
export enum ManualApprovalType {
specific = 'SPECIFIC',
any = 'ANY',
notConfigured = 'NOT_CONFIGURED',
}
export type ImageApprovalUsersInfoDTO = Record<string, Pick<UserGroupDTO, 'identifier' | 'name'>[]>
export interface UserApprovalConfigType {
type: ManualApprovalType
requiredCount: number
specificUsers: {
identifiers: string[]
// FIXME: Remove this ? check later when time permits
requiredCount?: number
}
userGroups: (Pick<UserGroupDTO, 'identifier'> & {
requiredCount: number
})[]
}
interface ApprovalUserDataType {
dataId: number
userActionTime: string
userComment: string
userEmail: string
userId: number
userResponse: number
userGroups?: Pick<UserGroupDTO, 'identifier' | 'name'>[]
}
export interface UserApprovalInfo {
requiredCount: number
currentCount: number
approverList: {
hasApproved: boolean
canApprove: boolean
identifier: string
}[]
}
export enum ApprovalConfigDataKindType {
configMap = 'configuration/config-map',
configSecret = 'configuration/config-secret',
deploymentTemplate = 'configuration/deployment-template',
deploymentTrigger = 'approval/deployment',
}
export interface ApprovalConfigDataType extends Pick<UserApprovalInfo, 'currentCount' | 'requiredCount'> {
kind: ApprovalConfigDataKindType | null
anyUserApprovedInfo: UserApprovalInfo
specificUsersApprovedInfo: UserApprovalInfo
userGroupsApprovedInfo: Pick<UserApprovalInfo, 'currentCount' | 'requiredCount'> & {
userGroups: (UserApprovalInfo & {
groupIdentifier: UserGroupDTO['identifier']
groupName: UserGroupDTO['name']
})[]
}
isExceptionUser: boolean
}
export enum ApprovalRuntimeStateType {
init = 0,
requested = 1,
approved = 2,
consumed = 3,
}
export interface UserApprovalMetadataType {
approvalRequestId: number
approvalRuntimeState: ApprovalRuntimeStateType
requestedUserData: ApprovalUserDataType
hasCurrentUserApproved: boolean
canCurrentUserApprove: boolean
approvalConfigData: ApprovalConfigDataType
}
export enum FilterStates {
ALLOWED = 0,
BLOCKED = 1,
ERROR = 2,
}
export enum MaterialDataSource {
EXTERNAL = 'ext',
}
export enum ImagePromotionRuntimeState {
AWAITING = 'AWAITING',
PROMOTED = 'PROMOTED',
CANCELLED = 'CANCELLED',
STALE = 'STALE',
}
export interface ImagePromotionPolicyApprovalMetadata {
approverCount: number
allowRequesterFromApprove: boolean
allowImageBuilderFromApprove: boolean
allowApproverFromDeploy: boolean
}
export interface ImagePromotionPolicyInfoType {
name: string
id: number
description: string
conditions: FilterConditionsInfo[]
approvalMetadata: ImagePromotionPolicyApprovalMetadata
}
export interface PromotionApprovalMetadataType {
approvalRequestId: number
approvalRuntimeState: ImagePromotionRuntimeState
approvedUsersData: ApprovalUserDataType[]
requestedUserData: ApprovalUserDataType
policy: ImagePromotionPolicyInfoType
promotedFrom?: string
promotedFromType?: CDMaterialResourceQuery
}
export interface DeploymentWindowArtifactMetadata {
id: number
name: string
type: DEPLOYMENT_WINDOW_TYPE
}
export interface ArtifactReleaseMappingType {
id: number
identifier: string
releaseVersion: string
name: string
kind: string
version: string
}
export interface CDMaterialListModalServiceUtilProps {
artifacts: any[]
offset: number
artifactId?: number
artifactStatus?: string
disableDefaultSelection?: boolean
}
export interface CDMaterialType {
index: number
id: string
materialInfo: MaterialInfo[]
tab: CDModalTabType
scanEnabled: boolean
scanned: boolean
vulnerabilitiesLoading: boolean
lastExecution: string // timestamp
vulnerabilities: VulnerabilityType[]
vulnerable: boolean
deployedTime: string
deployedBy?: string
wfrId?: number
buildTime: string
image: string
isSelected: boolean
showSourceInfo: boolean
latest: boolean
runningOnParentCd?: boolean
userApprovalMetadata?: UserApprovalMetadataType
triggeredBy?: number
imageComment?: ImageComment
imageReleaseTags?: ReleaseTag[]
artifactStatus?: string
filterState: FilterStates
registryType?: RegistryType
imagePath?: string
registryName?: string
// Not even coming from API but required in CDMaterials for Security which makes its own api call but stores data in CDMaterials
scanToolId?: number
appliedFiltersTimestamp?: string
appliedFilters?: FilterConditionsListType[]
appliedFiltersState?: FilterStates
createdTime?: string
deployed?: boolean
dataSource?: MaterialDataSource
/**
* The below two keys: `promotionApprovalMetaData`, `deployedOnEnvironments` are used in image promotion
* and may not be available to cater other use-cases.
*/
promotionApprovalMetadata?: PromotionApprovalMetadataType
deployedOnEnvironments?: string[]
deploymentWindowArtifactMetadata?: DeploymentWindowArtifactMetadata
/**
* Will only be present in case of release
*/
configuredInReleases: ArtifactReleaseMappingType[]
/**
* Would currently only be received in case of release
*/
appWorkflowId: number
/**
* Denotes trigger blocking due to mandatory tags, (might be used for plugins and other features in future)
*/
deploymentBlockedState?: PolicyBlockInfo
targetPlatforms: TargetPlatformItemDTO[]
}
export enum CDMaterialServiceEnum {
ROLLBACK = 'rollback',
CD_MATERIALS = 'cd-materials',
IMAGE_PROMOTION = 'image-promotion',
}
export enum CDMaterialResourceQuery {
PENDING_APPROVAL = 'PENDING_APPROVAL',
PROMOTION_APPROVAL_PENDING_NODE = 'PROMOTION_APPROVAL_PENDING_NODE',
CI = 'CI',
ENVIRONMENT = 'ENVIRONMENT',
WEBHOOK = 'WEBHOOK',
LINKED_CI = 'LINKED-CI',
CI_JOB = 'CI-JOB',
LINKED_CD = 'LINKED-CD',
}
export enum CDMaterialFilterQuery {
RESOURCE = 'ELIGIBLE_RESOURCES',
ALL = 'ALL_RESOURCES',
}
export interface CDMaterialServiceQueryParams {
search?: string
offset?: number
size?: number
resource?: CDMaterialResourceQuery
resourceName?: string
resourceId?: number
workflowId?: number
appId?: number
pendingForCurrentUser?: boolean
filter?: CDMaterialFilterQuery
}
export interface DownstreamNodesEnvironmentsType {
environmentId: number
environmentName: string
}
export enum TriggerBlockType {
MANDATORY_TAG = 'mandatory-tags',
MANDATORY_PLUGIN = 'mandatory-plugins',
SECURITY_SCAN = 'security-scan',
}
export interface TriggerBlockedInfo {
blockedBy: TriggerBlockType
blockedReason?: string
}
export interface CommonNodeAttr extends Pick<MandatoryPluginBaseStateType, 'isTriggerBlocked' | 'pluginBlockState'> {
connectingCiPipelineId?: number
parents: string | number[] | string[]
x: number
y: number
title: string
description?: string
triggerType?: string
id: string
icon?: string
status?: string
isSource: boolean
isGitSource: boolean
isRoot: boolean
downstreams: string[]
type: 'CI' | 'GIT' | 'PRECD' | 'CD' | 'POSTCD' | 'WEBHOOK'
parentCiPipeline?: number
parentAppId?: number
url?: string
branch?: string
sourceType?: string
colorCode?: string
isExternalCI?: boolean
isLinkedCI?: boolean
isLinkedCD?: boolean
isJobCI?: boolean // used for Job type CI in Devtron Apps
environmentName?: string // used for CDs
environmentId?: number
inputMaterialList?: any[]
rollbackMaterialList?: any[] // used for CDs
linkedCount?: number // used for CI
deploymentStrategy?: string
height: number
width: number
preNode?: CommonNodeAttr // used for CDs
postNode?: CommonNodeAttr // used for CDs
stageIndex?: number // used for CDs
sourceNodes?: Array<CommonNodeAttr> // used for CI
downstreamNodes?: Array<CommonNodeAttr>
parentPipelineId?: string
parentPipelineType?: string
parentEnvironmentName?: string
isRegex?: boolean
regex?: string
primaryBranchAfterRegex?: string
storageConfigured?: boolean
deploymentAppDeleteRequest?: boolean
approvalConfigData: ApprovalConfigDataType
requestedUserId?: number
showPluginWarning: boolean
helmPackageName?: string
isVirtualEnvironment?: boolean
deploymentAppType?: DeploymentAppTypes
appReleaseTagNames?: string[]
tagsEditable?: boolean
isGitOpsRepoNotConfigured?: boolean
deploymentAppCreated?: boolean
isLast?: boolean
downstreamEnvironments?: DownstreamNodesEnvironmentsType[]
cipipelineId?: number
isDeploymentBlocked?: boolean
triggerBlockedInfo?: TriggerBlockedInfo
}
export enum DeploymentAppTypes {
HELM = 'helm',
GITOPS = 'argo_cd',
MANIFEST_DOWNLOAD = 'manifest_download',
MANIFEST_PUSH = 'manifest_push',
FLUX = 'flux',
}
export interface VulnerabilityType {
name: string
severity: Severity
package: string
version: string
fixedVersion: string
policy: string
url?: string
}
export interface MaterialInfo {
revision: string
modifiedTime: string | Date
author: string
message: string
commitLink: string
tag: string
webhookData: string
branch: string
url?: string
type?: string
}
export enum FilterConditionType {
PASS = 1,
FAIL = 0,
}
export interface FilterConditionsInfo {
conditionType: FilterConditionType
expression: string
}
export interface FilterConditionsListType {
id: number
name: string
description: string
conditions: FilterConditionsInfo[]
}
export interface DeploymentApprovalInfoType {
eligibleApprovers: {
specificUsers: Pick<UserApprovalInfo, 'approverList'>
anyUsers: Pick<UserApprovalInfo, 'approverList'>
userGroups: (Pick<
ApprovalConfigDataType['userGroupsApprovedInfo']['userGroups'][number],
'groupIdentifier' | 'groupName'
> &
Pick<UserApprovalInfo, 'approverList'>)[]
}
approvalConfigData: ApprovalConfigDataType
}
export interface CDMaterialsApprovalInfo {
canApproverDeploy: boolean
deploymentApprovalInfo: DeploymentApprovalInfoType
}
export interface CDMaterialsMetaInfo {
tagsEditable: boolean
appReleaseTagNames: string[]
hideImageTaggingHardDelete: boolean
resourceFilters?: FilterConditionsListType[]
totalCount: number
/**
* This is the ID of user that has request the material
*/
requestedUserId: number
deploymentBlockedState?: PolicyBlockInfo
runtimeParams: RuntimePluginVariables[]
}
export interface ImagePromotionMaterialInfo {
isApprovalPendingForPromotion: boolean
imagePromotionApproverEmails: string[]
}
export interface CDMaterialResponseType
extends CDMaterialsMetaInfo,
CDMaterialsApprovalInfo,
ImagePromotionMaterialInfo {
materials: CDMaterialType[]
}
export interface InputDetailType {
label: string
defaultValue: string
placeholder: string
}
export interface RegistryTypeDetailType {
value: string
label: string
desiredFormat: string
placeholderText: string
gettingStartedLink: string
defaultRegistryURL: string
registryURL: InputDetailType
id: InputDetailType
password: InputDetailType
startIcon: ReactElement
}
export interface UseSearchString {
queryParams: URLSearchParams
searchParams: {
[key: string]: string
}
}
export interface AsyncState<T> {
loading: boolean
result: T
error: null
dependencies: any[]
}
export interface AsyncOptions {
resetOnChange: boolean
}
export interface AppEnvironment {
environmentId: number
environmentName: string
appMetrics: boolean
infraMetrics: boolean
prod: boolean
chartRefId?: number
lastDeployed?: string
lastDeployedBy?: string
lastDeployedImage?: string
appStatus?: string
deploymentAppDeleteRequest?: boolean
isVirtualEnvironment?: boolean
pipelineId?: number
latestCdWorkflowRunnerId?: number
commits?: string[]
ciArtifactId?: number
}
export interface Strategy {
deploymentTemplate: string
config: any
default?: boolean
}
export interface CDStage extends Partial<Pick<CommonNodeAttr, 'triggerBlockedInfo' | 'isTriggerBlocked'>> {
status: string
name: string
triggerType: 'AUTOMATIC' | 'MANUAL'
config: string
}
export interface CDStageConfigMapSecretNames {
configMaps: any[]
secrets: any[]
}
export interface PrePostDeployStageType
extends MandatoryPluginBaseStateType,
Partial<Pick<CommonNodeAttr, 'triggerBlockedInfo'>> {
isValid: boolean
steps: TaskErrorObj[]
triggerType: string
name: string
status: string
}
export interface CdPipeline extends Partial<Pick<CommonNodeAttr, 'triggerBlockedInfo'>> {
id: number
environmentId: number
environmentName?: string
description?: string
ciPipelineId: number
triggerType: 'AUTOMATIC' | 'MANUAL'
name: string
strategies?: Strategy[]
namespace?: string
appWorkflowId?: number
deploymentTemplate?: string
preStage?: CDStage
postStage?: CDStage
preStageConfigMapSecretNames?: CDStageConfigMapSecretNames
postStageConfigMapSecretNames?: CDStageConfigMapSecretNames
runPreStageInEnv?: boolean
runPostStageInEnv?: boolean
isClusterCdActive?: boolean
parentPipelineId?: number
parentPipelineType?: string
deploymentAppDeleteRequest?: boolean
deploymentAppCreated?: boolean
isVirtualEnvironment?: boolean
deploymentAppType: DeploymentAppTypes
helmPackageName?: string
preDeployStage?: PrePostDeployStageType
postDeployStage?: PrePostDeployStageType
isProdEnv?: boolean
isGitOpsRepoNotConfigured?: boolean
isDeploymentBlocked?: boolean
approvalConfigData: ApprovalConfigDataType
isTriggerBlocked?: boolean
}
export interface ExternalCiConfig {
id: number
webhookUrl: string
payload: string
accessKey: string
}
export interface Source {
type: string
value?: string
regex?: string
}
export interface CiMaterial {
source: Source
gitMaterialId: number
id: number
gitMaterialName: string
isRegex?: boolean
/**
* Available only for template view
*/
gitMaterialUrl: string
}
export interface Task {
name?: string
type?: string
cmd?: string
args?: Array<string>
}
export interface CiScript {
id: number
index: number
name: string
script: string
outputLocation?: string
}
export interface CiPipeline {
isManual: boolean
dockerArgs?: Map<string, string>
isExternal: boolean
parentCiPipeline: number
parentAppId: number
externalCiConfig: ExternalCiConfig
ciMaterial?: CiMaterial[]
name?: string
id?: number
active?: boolean
linkedCount: number
scanEnabled: boolean
deleted?: boolean
version?: string
beforeDockerBuild?: Array<Task>
afterDockerBuild?: Array<Task>
appWorkflowId?: number
beforeDockerBuildScripts?: Array<CiScript>
afterDockerBuildScripts?: Array<CiScript>
isDockerConfigOverridden?: boolean
dockerConfigOverride?: DockerConfigOverrideType
appName?: string
appId?: string
componentId?: number
isCITriggerBlocked?: boolean
ciBlockState?: {
action: any
metadataField: string
}
isOffendingMandatoryPlugin?: boolean
pipelineType?: string
}
export interface ChartVersionAndTypeSelectorProps {
setSelectedChartRefId: React.Dispatch<React.SetStateAction<number>>
}
export enum PipelineType {
CI_PIPELINE = 'CI_PIPELINE',
CD_PIPELINE = 'CD_PIPELINE',
WEBHOOK = 'WEBHOOK',
LINKED_CD = 'LINKED_CD',
}
export enum WorkflowNodeType {
GIT = 'GIT',
CI = 'CI',
WEBHOOK = 'WEBHOOK',