@devtron-labs/devtron-fe-common-lib 0.0.9-beta-11 → 0.0.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.
@@ -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,31 +188,6 @@ export interface UserApprovalMetadataType {
186
188
  approvedUsersData: ApprovalUserDataType[];
187
189
  requestedUserData: ApprovalUserDataType;
188
190
  }
189
- export interface CDMaterialType {
190
- index: number;
191
- id: string;
192
- materialInfo: MaterialInfo[];
193
- tab: CDModalTabType;
194
- scanEnabled: boolean;
195
- scanned: boolean;
196
- vulnerabilitiesLoading: boolean;
197
- lastExecution: string;
198
- vulnerabilities: VulnerabilityType[];
199
- vulnerable: boolean;
200
- deployedTime: string;
201
- deployedBy?: string;
202
- wfrId?: number;
203
- buildTime: string;
204
- image: string;
205
- isSelected: boolean;
206
- showSourceInfo: boolean;
207
- latest: boolean;
208
- runningOnParentCd?: boolean;
209
- userApprovalMetadata?: UserApprovalMetadataType;
210
- triggeredBy?: number;
211
- imageComment?: ImageComment;
212
- imageReleaseTags?: ReleaseTag[];
213
- }
214
191
  export interface CommonNodeAttr {
215
192
  connectingCiPipelineId?: number;
216
193
  parents: string | number[] | string[];
@@ -259,14 +236,18 @@ export interface CommonNodeAttr {
259
236
  approvalUsers?: string[];
260
237
  userApprovalConfig?: UserApprovalConfigType;
261
238
  requestedUserId?: number;
239
+ showPluginWarning?: boolean;
262
240
  helmPackageName?: string;
263
241
  isVirtualEnvironment?: boolean;
264
- appReleaseTagNames?: string[];
265
- tagsEditable?: boolean;
242
+ isCITriggerBlocked?: boolean;
243
+ ciBlockState?: {
244
+ action: any;
245
+ metadataField: string;
246
+ };
266
247
  }
267
248
  export interface VulnerabilityType {
268
249
  name: string;
269
- severity: "CRITICAL" | "MODERATE" | "LOW";
250
+ severity: 'CRITICAL' | 'MODERATE' | 'LOW';
270
251
  package: string;
271
252
  version: string;
272
253
  fixedVersion: string;
@@ -288,24 +269,33 @@ export interface MaterialInfo {
288
269
  url?: string;
289
270
  type?: string;
290
271
  }
272
+ export interface CDMaterialType {
273
+ index: number;
274
+ id: string;
275
+ materialInfo: MaterialInfo[];
276
+ tab: CDModalTabType;
277
+ scanEnabled: boolean;
278
+ scanned: boolean;
279
+ vulnerabilitiesLoading: boolean;
280
+ lastExecution: string;
281
+ vulnerabilities: VulnerabilityType[];
282
+ vulnerable: boolean;
283
+ deployedTime: string;
284
+ deployedBy?: string;
285
+ wfrId?: number;
286
+ buildTime: string;
287
+ image: string;
288
+ isSelected: boolean;
289
+ showSourceInfo: boolean;
290
+ latest: boolean;
291
+ runningOnParentCd?: boolean;
292
+ userApprovalMetadata?: UserApprovalMetadataType;
293
+ triggeredBy?: number;
294
+ }
291
295
  export interface CDMaterialResponseType {
292
296
  approvalUsers: string[];
293
297
  materials: any[];
294
298
  userApprovalConfig: UserApprovalConfigType;
295
299
  requestedUserId: number;
296
- tagsEditable: boolean;
297
- appReleaseTagNames: string[];
298
- }
299
- export interface ReleaseTag {
300
- id: number;
301
- tagName: string;
302
- appId: number;
303
- deleted: boolean;
304
- artifactId: number;
305
- }
306
- export interface ImageComment {
307
- id: number;
308
- comment: string;
309
- artifactId: number;
310
300
  }
311
301
  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';