@devtron-labs/devtron-fe-common-lib 0.0.14 → 0.0.16-beta-2

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.
@@ -1,4 +1,21 @@
1
1
  import React from 'react';
2
+ export interface InputDetailType {
3
+ label: string;
4
+ defaultValue: string;
5
+ placeholder: string;
6
+ }
7
+ export interface RegistryTypeDetailType {
8
+ value: string;
9
+ label: string;
10
+ desiredFormat: string;
11
+ placeholderText: string;
12
+ gettingStartedLink: string;
13
+ defaultRegistryURL: string;
14
+ registryURL: InputDetailType;
15
+ id: InputDetailType;
16
+ password: InputDetailType;
17
+ }
18
+ export declare const REGISTRY_TYPE_MAP: Record<string, RegistryTypeDetailType>;
2
19
  export declare function showError(serverError: any, showToastOnUnknownError?: boolean, hideAccessError?: boolean): void;
3
20
  interface ConditionalWrapper<T> {
4
21
  condition: boolean;
@@ -267,6 +267,7 @@ export interface CommonNodeAttr {
267
267
  showPluginWarning?: boolean;
268
268
  helmPackageName?: string;
269
269
  isVirtualEnvironment?: boolean;
270
+ deploymentAppType?: DeploymentAppTypes;
270
271
  isCITriggerBlocked?: boolean;
271
272
  ciBlockState?: {
272
273
  action: any;
@@ -275,6 +276,12 @@ export interface CommonNodeAttr {
275
276
  appReleaseTagNames?: string[];
276
277
  tagsEditable?: boolean;
277
278
  }
279
+ export declare enum DeploymentAppTypes {
280
+ HELM = "helm",
281
+ GITOPS = "argo_cd",
282
+ MANIFEST_DOWNLOAD = "manifest_download",
283
+ MANIFEST_PUSH = "manifest_push"
284
+ }
278
285
  export interface VulnerabilityType {
279
286
  name: string;
280
287
  severity: 'CRITICAL' | 'MODERATE' | 'LOW';
package/dist/index.js CHANGED
@@ -255,7 +255,14 @@ exports.DeploymentNodeType = void 0;
255
255
  DeploymentNodeType["CD"] = "CD";
256
256
  DeploymentNodeType["POSTCD"] = "POSTCD";
257
257
  DeploymentNodeType["APPROVAL"] = "APPROVAL";
258
- })(exports.DeploymentNodeType || (exports.DeploymentNodeType = {}));
258
+ })(exports.DeploymentNodeType || (exports.DeploymentNodeType = {}));
259
+ exports.DeploymentAppTypes = void 0;
260
+ (function (DeploymentAppTypes) {
261
+ DeploymentAppTypes["HELM"] = "helm";
262
+ DeploymentAppTypes["GITOPS"] = "argo_cd";
263
+ DeploymentAppTypes["MANIFEST_DOWNLOAD"] = "manifest_download";
264
+ DeploymentAppTypes["MANIFEST_PUSH"] = "manifest_push";
265
+ })(exports.DeploymentAppTypes || (exports.DeploymentAppTypes = {}));
259
266
 
260
267
  var responseMessages = {
261
268
  100: 'Continue',
@@ -9659,6 +9666,169 @@ toast.configure({
9659
9666
  toastClassName: 'devtron-toast',
9660
9667
  bodyClassName: 'devtron-toast__body',
9661
9668
  });
9669
+ var REGISTRY_TYPE_MAP = {
9670
+ ecr: {
9671
+ value: 'ecr',
9672
+ label: 'ECR',
9673
+ desiredFormat: '(desired format: repo-name)',
9674
+ placeholderText: 'Eg. repo_name',
9675
+ gettingStartedLink: 'https://docs.aws.amazon.com/AmazonECR/latest/userguide/get-set-up-for-amazon-ecr.html',
9676
+ defaultRegistryURL: '',
9677
+ registryURL: {
9678
+ label: 'Registry URL',
9679
+ defaultValue: '',
9680
+ placeholder: 'Eg. xxxxxxxxxxxx.dkr.ecr.region.amazonaws.com',
9681
+ },
9682
+ id: {
9683
+ label: 'Access key ID',
9684
+ defaultValue: '',
9685
+ placeholder: '',
9686
+ },
9687
+ password: {
9688
+ label: 'Secret access key',
9689
+ defaultValue: '',
9690
+ placeholder: '',
9691
+ },
9692
+ },
9693
+ 'docker-hub': {
9694
+ value: 'docker-hub',
9695
+ label: 'Docker',
9696
+ desiredFormat: '(desired format: username/repo-name)',
9697
+ placeholderText: 'Eg. username/repo_name',
9698
+ gettingStartedLink: 'https://docs.docker.com/docker-hub/',
9699
+ defaultRegistryURL: 'docker.io',
9700
+ registryURL: {
9701
+ label: 'Registry URL',
9702
+ defaultValue: 'docker.io',
9703
+ placeholder: '',
9704
+ },
9705
+ id: {
9706
+ label: 'Username',
9707
+ defaultValue: '',
9708
+ placeholder: '',
9709
+ },
9710
+ password: {
9711
+ label: 'Password/Token (Recommended: Token)',
9712
+ defaultValue: '',
9713
+ placeholder: '',
9714
+ },
9715
+ },
9716
+ acr: {
9717
+ value: 'acr',
9718
+ label: 'Azure',
9719
+ desiredFormat: '(desired format: repo-name)',
9720
+ placeholderText: 'Eg. repo_name',
9721
+ gettingStartedLink: 'https://docs.microsoft.com/en-us/azure/container-registry/container-registry-get-started-portal',
9722
+ defaultRegistryURL: '',
9723
+ registryURL: {
9724
+ label: 'Registry URL/Login Server',
9725
+ defaultValue: '',
9726
+ placeholder: 'Eg. xxx.azurecr.io',
9727
+ },
9728
+ id: {
9729
+ label: 'Username/Registry Name',
9730
+ defaultValue: '',
9731
+ placeholder: '',
9732
+ },
9733
+ password: {
9734
+ label: 'Password',
9735
+ defaultValue: '',
9736
+ placeholder: '',
9737
+ },
9738
+ },
9739
+ 'artifact-registry': {
9740
+ value: 'artifact-registry',
9741
+ label: 'Artifact Registry (GCP)',
9742
+ desiredFormat: '(desired format: project-id/artifacts-repo/repo-name)',
9743
+ placeholderText: 'Eg. project-id/artifacts-repo/repo-name',
9744
+ gettingStartedLink: 'https://cloud.google.com/artifact-registry/docs/manage-repos?hl=en_US',
9745
+ defaultRegistryURL: '',
9746
+ registryURL: {
9747
+ label: 'Registry URL',
9748
+ defaultValue: '',
9749
+ placeholder: 'Eg. region-docker.pkg.dev',
9750
+ },
9751
+ id: {
9752
+ label: 'Username',
9753
+ defaultValue: '_json_key',
9754
+ placeholder: '',
9755
+ },
9756
+ password: {
9757
+ label: 'Service Account JSON File',
9758
+ defaultValue: '',
9759
+ placeholder: 'Paste json file content here',
9760
+ },
9761
+ },
9762
+ gcr: {
9763
+ value: 'gcr',
9764
+ label: 'GCR',
9765
+ desiredFormat: '(desired format: project-id/repo-name)',
9766
+ placeholderText: 'Eg. project-id/repo_name',
9767
+ gettingStartedLink: 'https://cloud.google.com/container-registry/docs/quickstart',
9768
+ defaultRegistryURL: 'gcr.io',
9769
+ registryURL: {
9770
+ label: 'Registry URL',
9771
+ defaultValue: 'gcr.io',
9772
+ placeholder: '',
9773
+ },
9774
+ id: {
9775
+ label: 'Username',
9776
+ defaultValue: '_json_key',
9777
+ placeholder: '',
9778
+ },
9779
+ password: {
9780
+ label: 'Service Account JSON File',
9781
+ defaultValue: '',
9782
+ placeholder: 'Paste json file content here',
9783
+ },
9784
+ },
9785
+ quay: {
9786
+ value: 'quay',
9787
+ label: 'Quay',
9788
+ desiredFormat: '(desired format: username/repo-name)',
9789
+ placeholderText: 'Eg. username/repo_name',
9790
+ gettingStartedLink: '',
9791
+ defaultRegistryURL: 'quay.io',
9792
+ registryURL: {
9793
+ label: 'Registry URL',
9794
+ defaultValue: 'quay.io',
9795
+ placeholder: '',
9796
+ },
9797
+ id: {
9798
+ label: 'Username',
9799
+ defaultValue: '',
9800
+ placeholder: '',
9801
+ },
9802
+ password: {
9803
+ label: 'Token',
9804
+ defaultValue: '',
9805
+ placeholder: '',
9806
+ },
9807
+ },
9808
+ other: {
9809
+ value: 'other',
9810
+ label: 'Other',
9811
+ desiredFormat: '',
9812
+ placeholderText: '',
9813
+ gettingStartedLink: '',
9814
+ defaultRegistryURL: '',
9815
+ registryURL: {
9816
+ label: 'Registry URL',
9817
+ defaultValue: '',
9818
+ placeholder: '',
9819
+ },
9820
+ id: {
9821
+ label: 'Username',
9822
+ defaultValue: '',
9823
+ placeholder: '',
9824
+ },
9825
+ password: {
9826
+ label: 'Password/Token',
9827
+ defaultValue: '',
9828
+ placeholder: '',
9829
+ },
9830
+ },
9831
+ };
9662
9832
  function showError(serverError, showToastOnUnknownError, hideAccessError) {
9663
9833
  if (showToastOnUnknownError === void 0) { showToastOnUnknownError = true; }
9664
9834
  if (hideAccessError === void 0) { hideAccessError = false; }
@@ -23053,6 +23223,7 @@ exports.PATTERNS = PATTERNS;
23053
23223
  exports.PopupMenu = PopupMenu;
23054
23224
  exports.Progressing = Progressing;
23055
23225
  exports.PropagateTagInfo = PropagateTagInfo;
23226
+ exports.REGISTRY_TYPE_MAP = REGISTRY_TYPE_MAP;
23056
23227
  exports.ROUTES = ROUTES;
23057
23228
  exports.RadioGroup = RadioGroup$1;
23058
23229
  exports.RadioGroupItem = RadioGroupItem;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devtron-labs/devtron-fe-common-lib",
3
- "version": "0.0.14",
3
+ "version": "0.0.16-beta-2",
4
4
  "description": "Supporting common component library",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -18,6 +18,189 @@ toast.configure({
18
18
  bodyClassName: 'devtron-toast__body',
19
19
  })
20
20
 
21
+ export interface InputDetailType {
22
+ label: string
23
+ defaultValue: string
24
+ placeholder: string
25
+ }
26
+
27
+ export interface RegistryTypeDetailType {
28
+ value: string
29
+ label: string
30
+ desiredFormat: string
31
+ placeholderText: string
32
+ gettingStartedLink: string
33
+ defaultRegistryURL: string
34
+ registryURL: InputDetailType
35
+ id: InputDetailType
36
+ password: InputDetailType
37
+ }
38
+
39
+ export const REGISTRY_TYPE_MAP: Record<string, RegistryTypeDetailType> = {
40
+ ecr: {
41
+ value: 'ecr',
42
+ label: 'ECR',
43
+ desiredFormat: '(desired format: repo-name)',
44
+ placeholderText: 'Eg. repo_name',
45
+ gettingStartedLink: 'https://docs.aws.amazon.com/AmazonECR/latest/userguide/get-set-up-for-amazon-ecr.html',
46
+ defaultRegistryURL: '',
47
+ registryURL: {
48
+ label: 'Registry URL',
49
+ defaultValue: '',
50
+ placeholder: 'Eg. xxxxxxxxxxxx.dkr.ecr.region.amazonaws.com',
51
+ },
52
+ id: {
53
+ label: 'Access key ID',
54
+ defaultValue: '',
55
+ placeholder: '',
56
+ },
57
+ password: {
58
+ label: 'Secret access key',
59
+ defaultValue: '',
60
+ placeholder: '',
61
+ },
62
+ },
63
+ 'docker-hub': {
64
+ value: 'docker-hub',
65
+ label: 'Docker',
66
+ desiredFormat: '(desired format: username/repo-name)',
67
+ placeholderText: 'Eg. username/repo_name',
68
+ gettingStartedLink: 'https://docs.docker.com/docker-hub/',
69
+ defaultRegistryURL: 'docker.io',
70
+ registryURL: {
71
+ label: 'Registry URL',
72
+ defaultValue: 'docker.io',
73
+ placeholder: '',
74
+ },
75
+ id: {
76
+ label: 'Username',
77
+ defaultValue: '',
78
+ placeholder: '',
79
+ },
80
+ password: {
81
+ label: 'Password/Token (Recommended: Token)',
82
+ defaultValue: '',
83
+ placeholder: '',
84
+ },
85
+ },
86
+ acr: {
87
+ value: 'acr',
88
+ label: 'Azure',
89
+ desiredFormat: '(desired format: repo-name)',
90
+ placeholderText: 'Eg. repo_name',
91
+ gettingStartedLink:
92
+ 'https://docs.microsoft.com/en-us/azure/container-registry/container-registry-get-started-portal',
93
+ defaultRegistryURL: '',
94
+ registryURL: {
95
+ label: 'Registry URL/Login Server',
96
+ defaultValue: '',
97
+ placeholder: 'Eg. xxx.azurecr.io',
98
+ },
99
+ id: {
100
+ label: 'Username/Registry Name',
101
+ defaultValue: '',
102
+ placeholder: '',
103
+ },
104
+ password: {
105
+ label: 'Password',
106
+ defaultValue: '',
107
+ placeholder: '',
108
+ },
109
+ },
110
+ 'artifact-registry': {
111
+ value: 'artifact-registry',
112
+ label: 'Artifact Registry (GCP)',
113
+ desiredFormat: '(desired format: project-id/artifacts-repo/repo-name)',
114
+ placeholderText: 'Eg. project-id/artifacts-repo/repo-name',
115
+ gettingStartedLink: 'https://cloud.google.com/artifact-registry/docs/manage-repos?hl=en_US',
116
+ defaultRegistryURL: '',
117
+ registryURL: {
118
+ label: 'Registry URL',
119
+ defaultValue: '',
120
+ placeholder: 'Eg. region-docker.pkg.dev',
121
+ },
122
+ id: {
123
+ label: 'Username',
124
+ defaultValue: '_json_key',
125
+ placeholder: '',
126
+ },
127
+ password: {
128
+ label: 'Service Account JSON File',
129
+ defaultValue: '',
130
+ placeholder: 'Paste json file content here',
131
+ },
132
+ },
133
+ gcr: {
134
+ value: 'gcr',
135
+ label: 'GCR',
136
+ desiredFormat: '(desired format: project-id/repo-name)',
137
+ placeholderText: 'Eg. project-id/repo_name',
138
+ gettingStartedLink: 'https://cloud.google.com/container-registry/docs/quickstart',
139
+ defaultRegistryURL: 'gcr.io',
140
+ registryURL: {
141
+ label: 'Registry URL',
142
+ defaultValue: 'gcr.io',
143
+ placeholder: '',
144
+ },
145
+ id: {
146
+ label: 'Username',
147
+ defaultValue: '_json_key',
148
+ placeholder: '',
149
+ },
150
+ password: {
151
+ label: 'Service Account JSON File',
152
+ defaultValue: '',
153
+ placeholder: 'Paste json file content here',
154
+ },
155
+ },
156
+ quay: {
157
+ value: 'quay',
158
+ label: 'Quay',
159
+ desiredFormat: '(desired format: username/repo-name)',
160
+ placeholderText: 'Eg. username/repo_name',
161
+ gettingStartedLink: '',
162
+ defaultRegistryURL: 'quay.io',
163
+ registryURL: {
164
+ label: 'Registry URL',
165
+ defaultValue: 'quay.io',
166
+ placeholder: '',
167
+ },
168
+ id: {
169
+ label: 'Username',
170
+ defaultValue: '',
171
+ placeholder: '',
172
+ },
173
+ password: {
174
+ label: 'Token',
175
+ defaultValue: '',
176
+ placeholder: '',
177
+ },
178
+ },
179
+ other: {
180
+ value: 'other',
181
+ label: 'Other',
182
+ desiredFormat: '',
183
+ placeholderText: '',
184
+ gettingStartedLink: '',
185
+ defaultRegistryURL: '',
186
+ registryURL: {
187
+ label: 'Registry URL',
188
+ defaultValue: '',
189
+ placeholder: '',
190
+ },
191
+ id: {
192
+ label: 'Username',
193
+ defaultValue: '',
194
+ placeholder: '',
195
+ },
196
+ password: {
197
+ label: 'Password/Token',
198
+ defaultValue: '',
199
+ placeholder: '',
200
+ },
201
+ },
202
+ }
203
+
21
204
  export function showError(serverError, showToastOnUnknownError = true, hideAccessError = false) {
22
205
  if (serverError instanceof ServerErrors && Array.isArray(serverError.errors)) {
23
206
  serverError.errors.map(({ userMessage, internalMessage }) => {
@@ -292,6 +292,7 @@ export interface CommonNodeAttr {
292
292
  showPluginWarning?: boolean
293
293
  helmPackageName?: string
294
294
  isVirtualEnvironment?: boolean
295
+ deploymentAppType?: DeploymentAppTypes
295
296
  isCITriggerBlocked?: boolean
296
297
  ciBlockState?: {
297
298
  action: any,
@@ -301,6 +302,13 @@ export interface CommonNodeAttr {
301
302
  tagsEditable?: boolean
302
303
  }
303
304
 
305
+ export enum DeploymentAppTypes {
306
+ HELM = 'helm',
307
+ GITOPS = 'argo_cd',
308
+ MANIFEST_DOWNLOAD = 'manifest_download',
309
+ MANIFEST_PUSH='manifest_push'
310
+ }
311
+
304
312
  export interface VulnerabilityType {
305
313
  name: string
306
314
  severity: 'CRITICAL' | 'MODERATE' | 'LOW'