@devtron-labs/devtron-fe-common-lib 0.0.9 → 0.0.10-beta-1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,265 @@
1
+ export interface MaterialType {
2
+ name: string;
3
+ type: string;
4
+ value: string;
5
+ gitMaterialId: number;
6
+ id: number;
7
+ isSelected: boolean;
8
+ gitHostId: number;
9
+ gitProviderId: number;
10
+ regex?: string;
11
+ isRegex: boolean;
12
+ }
13
+ export interface Githost {
14
+ id: number;
15
+ name: string;
16
+ active: boolean;
17
+ webhookSecret: string;
18
+ webhookUrl: string;
19
+ }
20
+ export interface WebhookEvent {
21
+ id: number;
22
+ gitHostId: number;
23
+ name: string;
24
+ isActive: boolean;
25
+ selectors: WebhookEventSelectors[];
26
+ }
27
+ interface WebhookEventSelectors {
28
+ id: number;
29
+ eventId: number;
30
+ name: string;
31
+ selector: string;
32
+ toShowInCiFilter: boolean;
33
+ fixValue: string;
34
+ toShow: boolean;
35
+ possibleValues: string;
36
+ isActive: boolean;
37
+ }
38
+ export interface CiPipelineSourceTypeOption {
39
+ label: string;
40
+ value: string;
41
+ isDisabled: boolean;
42
+ isSelected: boolean;
43
+ isWebhook: boolean;
44
+ }
45
+ export declare enum RefVariableType {
46
+ GLOBAL = "GLOBAL",
47
+ FROM_PREVIOUS_STEP = "FROM_PREVIOUS_STEP",
48
+ NEW = "NEW"
49
+ }
50
+ export declare enum PluginType {
51
+ INLINE = "INLINE",
52
+ PLUGIN_REF = "REF_PLUGIN"
53
+ }
54
+ export declare enum ScriptType {
55
+ SHELL = "SHELL",
56
+ DOCKERFILE = "DOCKERFILE",
57
+ CONTAINERIMAGE = "CONTAINER_IMAGE"
58
+ }
59
+ export declare enum MountPath {
60
+ TRUE = "Yes",
61
+ FALSE = "No"
62
+ }
63
+ export declare enum ConditionType {
64
+ SKIP = "SKIP",
65
+ TRIGGER = "TRIGGER",
66
+ PASS = "PASS",
67
+ FAIL = "FAIL"
68
+ }
69
+ export declare enum RefVariableStageType {
70
+ PRE_CI = "PRE_CI",
71
+ POST_CI = "POST_CI"
72
+ }
73
+ export interface VariableType {
74
+ id: number;
75
+ name: string;
76
+ value: string;
77
+ format: string;
78
+ description: string;
79
+ defaultValue: string;
80
+ variableType: RefVariableType;
81
+ refVariableStepIndex: number;
82
+ refVariableName: string;
83
+ refVariableStage?: RefVariableStageType;
84
+ variableStepIndexInPlugin?: number;
85
+ }
86
+ interface CommandArgsMap {
87
+ command: string;
88
+ args: string[];
89
+ }
90
+ export interface PortMapType {
91
+ portOnLocal: number;
92
+ portOnContainer: number;
93
+ }
94
+ interface ConditionDetails {
95
+ id: number;
96
+ conditionOnVariable: string;
97
+ conditionOperator: string;
98
+ conditionType: ConditionType;
99
+ conditionalValue: string;
100
+ }
101
+ interface InlineStepDetailType {
102
+ scriptType: ScriptType;
103
+ isMountCustomScript?: boolean;
104
+ script?: string;
105
+ dockerFileExists?: boolean;
106
+ mountPath?: string;
107
+ mountCodeToContainer?: boolean;
108
+ mountDirectoryFromHost?: boolean;
109
+ containerImagePath?: string;
110
+ imagePullSecret?: string;
111
+ commandArgsMap?: CommandArgsMap[];
112
+ portMap?: PortMapType[];
113
+ mountPathMap?: {
114
+ filePathOnDisk: string;
115
+ filePathOnContainer: string;
116
+ }[];
117
+ inputVariables?: VariableType[];
118
+ outputVariables?: VariableType[];
119
+ conditionDetails: ConditionDetails[];
120
+ }
121
+ interface PluginRefStepDetailType {
122
+ id: number;
123
+ pluginId: number;
124
+ inputVariables?: VariableType[];
125
+ outputVariables?: VariableType[];
126
+ conditionDetails?: ConditionDetails[];
127
+ }
128
+ export interface StepType {
129
+ id: number;
130
+ index: number;
131
+ name: string;
132
+ description: string;
133
+ stepType: PluginType;
134
+ outputDirectoryPath: string[];
135
+ inlineStepDetail?: InlineStepDetailType;
136
+ pluginRefStepDetail?: PluginRefStepDetailType;
137
+ triggerIfParentStageFail: boolean;
138
+ isMandatory?: boolean;
139
+ }
140
+ export interface BuildStageType {
141
+ id: number;
142
+ steps: StepType[];
143
+ }
144
+ export declare enum CIBuildType {
145
+ SELF_DOCKERFILE_BUILD_TYPE = "self-dockerfile-build",
146
+ MANAGED_DOCKERFILE_BUILD_TYPE = "managed-dockerfile-build",
147
+ BUILDPACK_BUILD_TYPE = "buildpack-build"
148
+ }
149
+ export interface BuildPackConfigType {
150
+ builderId: string;
151
+ language: string;
152
+ languageVersion: string;
153
+ projectPath: string;
154
+ builderLangEnvParam?: string;
155
+ currentBuilderLangEnvParam?: string;
156
+ buildPacks?: any;
157
+ args?: Record<string, string>;
158
+ }
159
+ export interface DockerBuildConfigType {
160
+ dockerfileContent: string;
161
+ dockerfileRelativePath: string;
162
+ buildContext: string;
163
+ dockerfilePath?: string;
164
+ dockerfileRepository?: string;
165
+ args?: Record<string, string>;
166
+ targetPlatform?: any;
167
+ language?: string;
168
+ languageFramework?: string;
169
+ }
170
+ export interface CIBuildConfigType {
171
+ buildPackConfig: BuildPackConfigType;
172
+ ciBuildType: CIBuildType;
173
+ dockerBuildConfig: DockerBuildConfigType;
174
+ gitMaterialId: number;
175
+ buildContextGitMaterialId: number;
176
+ id?: number;
177
+ useRootBuildContext: boolean;
178
+ }
179
+ export interface DockerConfigOverrideType {
180
+ dockerRegistry: string;
181
+ dockerRepository: string;
182
+ ciBuildConfig: CIBuildConfigType;
183
+ }
184
+ export interface FormType {
185
+ name: string;
186
+ args: {
187
+ key: string;
188
+ value: string;
189
+ }[];
190
+ materials: MaterialType[];
191
+ gitHost: Githost;
192
+ webhookEvents: WebhookEvent[];
193
+ ciPipelineSourceTypeOptions: CiPipelineSourceTypeOption[];
194
+ webhookConditionList: {
195
+ selectorId: number;
196
+ value: string;
197
+ }[];
198
+ triggerType: string;
199
+ scanEnabled?: boolean;
200
+ beforeDockerBuildScripts?: {
201
+ id: number;
202
+ name: string;
203
+ outputLocation: string;
204
+ script: string;
205
+ isCollapsed: boolean;
206
+ index: number;
207
+ }[];
208
+ afterDockerBuildScripts?: {
209
+ id: number;
210
+ name: string;
211
+ outputLocation: string;
212
+ script: string;
213
+ isCollapsed: boolean;
214
+ index: number;
215
+ }[];
216
+ ciPipelineEditable: true;
217
+ preBuildStage?: BuildStageType;
218
+ postBuildStage?: BuildStageType;
219
+ isDockerConfigOverridden?: boolean;
220
+ dockerConfigOverride?: DockerConfigOverrideType;
221
+ isOffendingMandatoryPlugin?: boolean;
222
+ }
223
+ export interface ErrorObj {
224
+ isValid: boolean;
225
+ message: string | null;
226
+ }
227
+ export interface TaskErrorObj {
228
+ isValid: boolean;
229
+ name: ErrorObj;
230
+ inlineStepDetail?: {
231
+ inputVariables?: ErrorObj[];
232
+ outputVariables?: ErrorObj[];
233
+ };
234
+ pluginRefStepDetail?: {
235
+ inputVariables?: ErrorObj[];
236
+ outputVariables?: ErrorObj[];
237
+ };
238
+ }
239
+ export interface FormErrorObjectType {
240
+ name: ErrorObj;
241
+ materials?: MaterialType[];
242
+ preBuildStage?: {
243
+ isValid: boolean;
244
+ steps: TaskErrorObj[];
245
+ };
246
+ buildStage?: {
247
+ isValid: boolean;
248
+ name: ErrorObj;
249
+ };
250
+ postBuildStage?: {
251
+ isValid: boolean;
252
+ steps: TaskErrorObj[];
253
+ };
254
+ }
255
+ export interface PluginDetailType {
256
+ id: number;
257
+ name: string;
258
+ type: string;
259
+ description: string;
260
+ icon: string;
261
+ tags: string[];
262
+ inputVariables?: VariableType[];
263
+ outputVariables?: VariableType[];
264
+ }
265
+ export {};
@@ -48,3 +48,8 @@ export declare const TriggerTypeMap: {
48
48
  automatic: string;
49
49
  manual: string;
50
50
  };
51
+ export declare const BuildStageVariable: {
52
+ PreBuild: string;
53
+ Build: string;
54
+ PostBuild: string;
55
+ };
@@ -8,6 +8,7 @@ export interface DeleteDialogProps {
8
8
  deletePostfix?: string;
9
9
  apiCallInProgress?: boolean;
10
10
  dataTestId?: string;
11
+ buttonPrimaryText?: string;
11
12
  }
12
13
  export interface ForceDeleteDialogType {
13
14
  onClickDelete: () => void;
@@ -39,4 +39,5 @@ export declare function CustomInput({ name, value, error, onChange, onBlur, onFo
39
39
  tabIndex?: number;
40
40
  dataTestid?: string;
41
41
  }): JSX.Element;
42
+ export declare function handleUTCTime(ts: string, isRelativeTime?: boolean): string;
42
43
  export {};
@@ -0,0 +1,55 @@
1
+ import { VariableType } from "./CIPipeline.Types";
2
+ import { ResponseType } from "./Types";
3
+ export declare enum ApplyPolicyToStage {
4
+ PRE_CI = "PRE_CI",
5
+ POST_CI = "POST_CI",
6
+ PRE_OR_POST_CI = "PRE_OR_POST_CI"
7
+ }
8
+ export declare enum PluginRequiredStage {
9
+ PRE_CI = "preBuildStage",
10
+ POST_CI = "postBuildStage",
11
+ PRE_OR_POST_CI = "PRE_OR_POST_CI"
12
+ }
13
+ export interface DefinitionSourceType {
14
+ projectName: string;
15
+ isDueToProductionEnvironment: boolean;
16
+ isDueToLinkedPipeline: boolean;
17
+ policyName: string;
18
+ appName?: string;
19
+ clusterName?: string;
20
+ environmentName?: string;
21
+ branchNames?: string[];
22
+ ciPipelineName?: string;
23
+ }
24
+ export interface MandatoryPluginDetailType {
25
+ id: number;
26
+ name: string;
27
+ description?: string;
28
+ requiredIn: PluginRequiredStage;
29
+ applied?: boolean;
30
+ inputVariables?: VariableType[];
31
+ outputVariables?: VariableType[];
32
+ definitionSources?: DefinitionSourceType[];
33
+ }
34
+ export interface MandatoryPluginDataType {
35
+ pluginData: MandatoryPluginDetailType[];
36
+ isValidPre: boolean;
37
+ isValidPost: boolean;
38
+ }
39
+ export declare enum ConsequenceAction {
40
+ BLOCK = "BLOCK",
41
+ ALLOW_UNTIL_TIME = "ALLOW_UNTIL_TIME",
42
+ ALLOW_FOREVER = "ALLOW_FOREVER"
43
+ }
44
+ export interface ConsequenceType {
45
+ action: ConsequenceAction;
46
+ metadataField: string;
47
+ }
48
+ export interface BlockedStateData {
49
+ isOffendingMandatoryPlugin: boolean;
50
+ isCITriggerBlocked: boolean;
51
+ ciBlockState: ConsequenceType;
52
+ }
53
+ export interface GetBlockedStateResponse extends ResponseType {
54
+ result?: BlockedStateData;
55
+ }
@@ -46,6 +46,8 @@ export interface TippyCustomizedProps {
46
46
  theme: TippyTheme;
47
47
  visible?: boolean;
48
48
  heading?: ReactNode | string;
49
+ headingInfo?: ReactNode | string;
50
+ noHeadingBorder?: boolean;
49
51
  infoTextHeading?: string;
50
52
  placement: Placement;
51
53
  className?: string;
@@ -186,6 +188,31 @@ export interface UserApprovalMetadataType {
186
188
  approvedUsersData: ApprovalUserDataType[];
187
189
  requestedUserData: ApprovalUserDataType;
188
190
  }
191
+ export interface CDMaterialType {
192
+ index: number;
193
+ id: string;
194
+ materialInfo: MaterialInfo[];
195
+ tab: CDModalTabType;
196
+ scanEnabled: boolean;
197
+ scanned: boolean;
198
+ vulnerabilitiesLoading: boolean;
199
+ lastExecution: string;
200
+ vulnerabilities: VulnerabilityType[];
201
+ vulnerable: boolean;
202
+ deployedTime: string;
203
+ deployedBy?: string;
204
+ wfrId?: number;
205
+ buildTime: string;
206
+ image: string;
207
+ isSelected: boolean;
208
+ showSourceInfo: boolean;
209
+ latest: boolean;
210
+ runningOnParentCd?: boolean;
211
+ userApprovalMetadata?: UserApprovalMetadataType;
212
+ triggeredBy?: number;
213
+ imageComment?: ImageComment;
214
+ imageReleaseTags?: ReleaseTag[];
215
+ }
189
216
  export interface CommonNodeAttr {
190
217
  connectingCiPipelineId?: number;
191
218
  parents: string | number[] | string[];
@@ -234,12 +261,20 @@ export interface CommonNodeAttr {
234
261
  approvalUsers?: string[];
235
262
  userApprovalConfig?: UserApprovalConfigType;
236
263
  requestedUserId?: number;
264
+ showPluginWarning?: boolean;
237
265
  helmPackageName?: string;
238
266
  isVirtualEnvironment?: boolean;
267
+ isCITriggerBlocked?: boolean;
268
+ ciBlockState?: {
269
+ action: any;
270
+ metadataField: string;
271
+ };
272
+ appReleaseTagNames?: string[];
273
+ tagsEditable?: boolean;
239
274
  }
240
275
  export interface VulnerabilityType {
241
276
  name: string;
242
- severity: "CRITICAL" | "MODERATE" | "LOW";
277
+ severity: 'CRITICAL' | 'MODERATE' | 'LOW';
243
278
  package: string;
244
279
  version: string;
245
280
  fixedVersion: string;
@@ -261,33 +296,24 @@ export interface MaterialInfo {
261
296
  url?: string;
262
297
  type?: string;
263
298
  }
264
- export interface CDMaterialType {
265
- index: number;
266
- id: string;
267
- materialInfo: MaterialInfo[];
268
- tab: CDModalTabType;
269
- scanEnabled: boolean;
270
- scanned: boolean;
271
- vulnerabilitiesLoading: boolean;
272
- lastExecution: string;
273
- vulnerabilities: VulnerabilityType[];
274
- vulnerable: boolean;
275
- deployedTime: string;
276
- deployedBy?: string;
277
- wfrId?: number;
278
- buildTime: string;
279
- image: string;
280
- isSelected: boolean;
281
- showSourceInfo: boolean;
282
- latest: boolean;
283
- runningOnParentCd?: boolean;
284
- userApprovalMetadata?: UserApprovalMetadataType;
285
- triggeredBy?: number;
286
- }
287
299
  export interface CDMaterialResponseType {
288
300
  approvalUsers: string[];
289
301
  materials: any[];
290
302
  userApprovalConfig: UserApprovalConfigType;
291
303
  requestedUserId: number;
304
+ tagsEditable: boolean;
305
+ appReleaseTagNames: string[];
306
+ }
307
+ export interface ReleaseTag {
308
+ id: number;
309
+ tagName: string;
310
+ appId: number;
311
+ deleted: boolean;
312
+ artifactId: number;
313
+ }
314
+ export interface ImageComment {
315
+ id: number;
316
+ comment: string;
317
+ artifactId: number;
292
318
  }
293
319
  export {};
@@ -29,4 +29,6 @@ export { default as GenericEmptyState } from './EmptyState/GenericEmptyState';
29
29
  export { default as Toggle } from './Toggle/Toggle';
30
30
  export { default as ScanVulnerabilitiesTable } from './Security/ScanVulnerabilitiesTable';
31
31
  export { default as StyledRadioGroup } from './RadioGroup/RadioGroup';
32
+ export * from './CIPipeline.Types';
33
+ export * from './Policy.Types';
32
34
  export { default as DeleteComponent } from './DeleteComponentModal/DeleteComponent';