@devtron-labs/devtron-fe-common-lib 0.0.9 → 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.
- package/dist/Common/CIPipeline.Types.d.ts +265 -0
- package/dist/Common/Constants.d.ts +5 -0
- package/dist/Common/Dialogs/Types.d.ts +1 -0
- package/dist/Common/Helper.d.ts +1 -0
- package/dist/Common/Policy.Types.d.ts +55 -0
- package/dist/Common/Types.d.ts +9 -1
- package/dist/Common/index.d.ts +2 -0
- package/dist/index.js +6023 -224
- package/package.json +2 -1
- package/src/Assets/Icon/ic-help.svg +3 -0
- package/src/Common/CIPipeline.Types.ts +277 -0
- package/src/Common/Constants.ts +6 -0
- package/src/Common/Dialogs/DeleteDialog.tsx +45 -27
- package/src/Common/Dialogs/Types.ts +1 -0
- package/src/Common/Helper.tsx +15 -0
- package/src/Common/Policy.Types.ts +62 -0
- package/src/Common/TippyCustomized.tsx +31 -2
- package/src/Common/Types.ts +18 -11
- package/src/Common/index.ts +2 -0
- /package/src/Assets/Img/{warning-medium.svg → delete-medium.svg} +0 -0
|
@@ -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 {};
|
package/dist/Common/Helper.d.ts
CHANGED
|
@@ -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
|
+
}
|
package/dist/Common/Types.d.ts
CHANGED
|
@@ -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;
|
|
@@ -234,12 +236,18 @@ export interface CommonNodeAttr {
|
|
|
234
236
|
approvalUsers?: string[];
|
|
235
237
|
userApprovalConfig?: UserApprovalConfigType;
|
|
236
238
|
requestedUserId?: number;
|
|
239
|
+
showPluginWarning?: boolean;
|
|
237
240
|
helmPackageName?: string;
|
|
238
241
|
isVirtualEnvironment?: boolean;
|
|
242
|
+
isCITriggerBlocked?: boolean;
|
|
243
|
+
ciBlockState?: {
|
|
244
|
+
action: any;
|
|
245
|
+
metadataField: string;
|
|
246
|
+
};
|
|
239
247
|
}
|
|
240
248
|
export interface VulnerabilityType {
|
|
241
249
|
name: string;
|
|
242
|
-
severity:
|
|
250
|
+
severity: 'CRITICAL' | 'MODERATE' | 'LOW';
|
|
243
251
|
package: string;
|
|
244
252
|
version: string;
|
|
245
253
|
fixedVersion: string;
|
package/dist/Common/index.d.ts
CHANGED
|
@@ -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';
|