@devtron-labs/devtron-fe-common-lib 0.5.2-beta-7 → 0.5.2-beta-9

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.
Files changed (79) hide show
  1. package/dist/Common/CIPipeline.Types.d.ts +0 -1
  2. package/dist/Common/Constants.d.ts +0 -3
  3. package/dist/Common/Policy.Types.d.ts +58 -22
  4. package/dist/Common/Types.d.ts +12 -11
  5. package/dist/Pages/App/AppConfigurations/index.d.ts +1 -0
  6. package/dist/Pages/App/AppConfigurations/utils.d.ts +2 -0
  7. package/dist/Pages/{Applications/DevtronApps/Details → App}/index.d.ts +0 -1
  8. package/dist/Pages/{Applications/DevtronApps/Details/CDPipeline → CDPipeline}/types.d.ts +4 -4
  9. package/dist/Pages/GlobalConfigurations/BuildInfra/Descriptor.d.ts +2 -2
  10. package/dist/Pages/GlobalConfigurations/BuildInfra/types.d.ts +1 -1
  11. package/dist/Pages/index.d.ts +2 -1
  12. package/dist/Shared/Components/Button/Button.component.d.ts +1 -1
  13. package/dist/Shared/Components/Button/types.d.ts +0 -6
  14. package/dist/Shared/Components/CICDHistory/DeploymentHistoryConfigDiff/DeploymentHistoryConfigDiff.d.ts +1 -1
  15. package/dist/Shared/Components/CICDHistory/DeploymentHistoryConfigDiff/DeploymentHistoryConfigDiffCompare.d.ts +1 -1
  16. package/dist/Shared/Components/CICDHistory/DeploymentHistoryConfigDiff/helpers.d.ts +1 -1
  17. package/dist/Shared/Components/CICDHistory/DeploymentHistoryConfigDiff/types.d.ts +3 -2
  18. package/dist/Shared/Components/CICDHistory/DeploymentHistoryConfigDiff/utils.d.ts +1 -1
  19. package/dist/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiff.component.d.ts +1 -1
  20. package/dist/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiff.types.d.ts +2 -4
  21. package/dist/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiffNavigation.d.ts +1 -1
  22. package/dist/Shared/Components/FeatureDescription/FeatureTitleWithInfo.d.ts +1 -1
  23. package/dist/Shared/Components/FeatureDescription/index.d.ts +1 -0
  24. package/dist/Shared/Components/FeatureDescription/types.d.ts +6 -0
  25. package/dist/Shared/Components/InfoIconTippy/InfoIconTippy.d.ts +1 -1
  26. package/dist/Shared/Components/Plugin/service.d.ts +3 -3
  27. package/dist/Shared/Components/Plugin/types.d.ts +19 -2
  28. package/dist/Shared/Components/SelectPicker/SelectPicker.component.d.ts +1 -1
  29. package/dist/Shared/Components/SelectPicker/common.d.ts +1 -1
  30. package/dist/Shared/Components/SelectPicker/type.d.ts +23 -15
  31. package/dist/Shared/Components/SelectPicker/utils.d.ts +2 -1
  32. package/dist/Shared/Components/TabGroup/TabGroup.types.d.ts +1 -9
  33. package/dist/Shared/Components/index.d.ts +0 -1
  34. package/dist/Shared/Hooks/useForm/useForm.d.ts +26 -29
  35. package/dist/Shared/Hooks/useForm/useForm.types.d.ts +8 -15
  36. package/dist/Shared/Hooks/useForm/useForm.utils.d.ts +1 -1
  37. package/dist/Shared/Services/app.types.d.ts +22 -35
  38. package/dist/Shared/constants.d.ts +1 -3
  39. package/dist/Shared/types.d.ts +4 -13
  40. package/dist/Shared/validations.d.ts +3 -0
  41. package/dist/assets/index.css +1 -1
  42. package/dist/{cssMode-BzAJNNfO.js → cssMode-DOv3Dlkj.js} +1 -1
  43. package/dist/{freemarker2-C5v7rdGk.js → freemarker2-BEtk-Svk.js} +1 -1
  44. package/dist/{handlebars-Cl_Athu7.js → handlebars-zsXZyBHa.js} +1 -1
  45. package/dist/{html-BhmbKvsl.js → html-DVjqtGIC.js} +1 -1
  46. package/dist/{htmlMode-Eh-qZm_q.js → htmlMode-e_0QgI09.js} +1 -1
  47. package/dist/{index-B3Nto1wx.js → index-DMVrUXQ_.js} +24620 -24784
  48. package/dist/index.d.ts +1 -0
  49. package/dist/index.js +527 -545
  50. package/dist/{javascript-C9CMizZO.js → javascript-WkNiZVyd.js} +1 -1
  51. package/dist/{jsonMode-CrNdCxMf.js → jsonMode-vJRocp88.js} +1 -1
  52. package/dist/{liquid-OSTTmxyA.js → liquid-DmPTZVVo.js} +1 -1
  53. package/dist/{mdx-Bl4Q7X-Y.js → mdx-DVnhrUzP.js} +1 -1
  54. package/dist/{python-BRbo-lxI.js → python-KfFzTGjQ.js} +1 -1
  55. package/dist/{razor-CH6gsgck.js → razor-Bd5uM0am.js} +1 -1
  56. package/dist/{tsMode-CD1RkTWx.js → tsMode-FauFmxDN.js} +1 -1
  57. package/dist/{typescript-CiU-skWG.js → typescript-CUPYQpTP.js} +1 -1
  58. package/dist/{xml-BKlUFTP7.js → xml-DZ04N_an.js} +1 -1
  59. package/dist/{yaml-B98Fk6S4.js → yaml-DJ8n3lsB.js} +1 -1
  60. package/package.json +1 -1
  61. package/dist/Pages/Applications/DevtronApps/Details/AppConfigurations/DeploymentTemplate/DTApplicationMetricsFormField.d.ts +0 -3
  62. package/dist/Pages/Applications/DevtronApps/Details/AppConfigurations/DeploymentTemplate/constants.d.ts +0 -2
  63. package/dist/Pages/Applications/DevtronApps/Details/AppConfigurations/DeploymentTemplate/index.d.ts +0 -4
  64. package/dist/Pages/Applications/DevtronApps/Details/AppConfigurations/DeploymentTemplate/service.d.ts +0 -4
  65. package/dist/Pages/Applications/DevtronApps/Details/AppConfigurations/DeploymentTemplate/types.d.ts +0 -171
  66. package/dist/Pages/Applications/DevtronApps/Details/AppConfigurations/OverrideStrategyTippyContent.d.ts +0 -2
  67. package/dist/Pages/Applications/DevtronApps/Details/AppConfigurations/constants.d.ts +0 -5
  68. package/dist/Pages/Applications/DevtronApps/Details/AppConfigurations/index.d.ts +0 -5
  69. package/dist/Pages/Applications/DevtronApps/Details/AppConfigurations/types.d.ts +0 -27
  70. package/dist/Pages/Applications/DevtronApps/Details/AppConfigurations/utils.d.ts +0 -2
  71. package/dist/Pages/Applications/DevtronApps/index.d.ts +0 -1
  72. package/dist/Pages/Applications/index.d.ts +0 -1
  73. package/dist/Shared/Components/InvalidYAMLTippy/InvalidYAMLTippyWrapper.d.ts +0 -3
  74. package/dist/Shared/Components/InvalidYAMLTippy/constants.d.ts +0 -1
  75. package/dist/Shared/Components/InvalidYAMLTippy/index.d.ts +0 -2
  76. package/dist/Shared/Components/InvalidYAMLTippy/types.d.ts +0 -6
  77. package/dist/Shared/Components/InvalidYAMLTippy/utils.d.ts +0 -2
  78. package/dist/Shared/Components/SelectPicker/constants.d.ts +0 -5
  79. /package/dist/Pages/{Applications/DevtronApps/Details/CDPipeline → CDPipeline}/index.d.ts +0 -0
@@ -40,4 +40,3 @@ export * from './EditImageFormField';
40
40
  export * from './Collapse';
41
41
  export * from './Security';
42
42
  export * from './Button';
43
- export * from './InvalidYAMLTippy';
@@ -1,5 +1,5 @@
1
- import { BaseSyntheticEvent, ChangeEvent } from 'react';
2
- import { UseFormSubmitHandler, UseFormValidations, UseFormErrorHandler } from './useForm.types';
1
+ import { ChangeEvent, FormEvent } from 'react';
2
+ import { UseFormSubmitHandler, UseFormValidations } from './useForm.types';
3
3
  /**
4
4
  * A custom hook to manage form state, validation, and submission handling.
5
5
  *
@@ -16,19 +16,20 @@ export declare const useForm: <T extends Record<keyof T, any> = {}>(options?: {
16
16
  * - 'onBlur': Validation occurs when the input loses focus.
17
17
  * @default 'onChange'
18
18
  */
19
- validationMode?: "onChange" | "onBlur" | "onSubmit";
19
+ validationMode?: "onChange" | "onBlur";
20
20
  }) => {
21
21
  /** The current form data. */
22
22
  data: T;
23
23
  /** An object containing validation errors for each form field. */
24
- errors: Partial<Record<keyof T, string[]>>;
25
- register: <Value extends unknown, SFnReturnType extends unknown, CustomComponent extends boolean>(name: keyof T, registerOptions?: {
26
- /**
27
- * A function to sanitize the input value.
28
- * @param value The input value.
29
- * @returns The sanitized value.
30
- */
31
- sanitizeFn?: (value: CustomComponent extends true ? Value : string) => SFnReturnType;
24
+ errors: Partial<Record<keyof T, string | string[]>>;
25
+ /**
26
+ * Registers form input fields with onChange, onBlur and onFocus handlers.
27
+ *
28
+ * @param name - The key of the form field to register.
29
+ * @param sanitizeFn - An optional function to sanitize the input value.
30
+ * @returns An object containing form field `name`, `onChange`, `onBlur` and `onFocus` event handlers.
31
+ */
32
+ register: <V extends unknown = string, S extends unknown = unknown>(name: keyof T, sanitizeFn?: (value: V) => S, registerOptions?: {
32
33
  /**
33
34
  * Prevents the input value from being trimmed.
34
35
  *
@@ -38,30 +39,26 @@ export declare const useForm: <T extends Record<keyof T, any> = {}>(options?: {
38
39
  * @default false - By default, the input will be trimmed.
39
40
  */
40
41
  noTrim?: boolean;
41
- /** A boolean flag indicating if the input is a custom component. */
42
- isCustomComponent?: CustomComponent;
43
42
  }) => {
44
- onChange: (e: CustomComponent extends true ? Value : ChangeEvent<HTMLInputElement>) => void;
43
+ onChange: (e: ChangeEvent<HTMLInputElement>) => void;
45
44
  onBlur: () => void;
46
45
  onFocus: () => void;
47
46
  name: keyof T;
48
47
  };
49
- handleSubmit: (onValid: UseFormSubmitHandler<T>, onError?: UseFormErrorHandler<T>) => (e?: BaseSyntheticEvent) => Promise<void>;
48
+ /**
49
+ * Handles form submission, validates all form fields, and calls the provided `onValid` function if valid.
50
+ *
51
+ * @param onValid - A function to handle valid form data on submission.
52
+ * @returns The event handler for form submission.
53
+ */
54
+ handleSubmit: (onValid: UseFormSubmitHandler<T>) => (e: FormEvent<HTMLFormElement>) => void;
55
+ /**
56
+ * Manually triggers validation for specific form fields.
57
+ *
58
+ * @param name - The key(s) of the form field(s) to validate.
59
+ * @returns The validation error(s), if any.
60
+ */
50
61
  trigger: (name: keyof T | (keyof T)[]) => (string | string[]) | (string | string[])[];
51
- setValue: (name: keyof T, value: T[keyof T], valueOptions?: {
52
- /** A boolean indicating whether to mark the field as dirty after setting the value. */
53
- shouldDirty?: boolean;
54
- /** A boolean indicating whether to mark the field as touched after setting the value. */
55
- shouldTouch?: boolean;
56
- }) => void;
57
- reset: (formData: T, resetOptions?: {
58
- /** A boolean indicating whether to retain the current dirty state of the form fields. */
59
- keepDirty?: boolean;
60
- /** A boolean indicating whether to retain the current touched state of the form fields. */
61
- keepTouched?: boolean;
62
- /** A boolean indicating whether to retain the current error state of the form fields. */
63
- keepErrors?: boolean;
64
- }) => void;
65
62
  /** An object representing additional form state. */
66
63
  formState: {
67
64
  /** An object indicating which fields have been touched (interacted with). */
@@ -1,4 +1,4 @@
1
- import { BaseSyntheticEvent } from 'react';
1
+ import { FormEvent } from 'react';
2
2
  /**
3
3
  * Describes the "required" validation rule.
4
4
  * It can be a simple boolean or an object containing a boolean value and an error message.
@@ -24,10 +24,10 @@ type ValidationPattern = {
24
24
  * If validation fails, an error message is provided.
25
25
  */
26
26
  type ValidationCustom = {
27
- isValid: (value: any) => boolean;
27
+ isValid: (value: string) => boolean;
28
28
  message: string;
29
29
  } | {
30
- isValid: (value: any) => boolean;
30
+ isValid: (value: string) => boolean;
31
31
  message: string;
32
32
  }[];
33
33
  /**
@@ -41,9 +41,9 @@ export interface UseFormValidation {
41
41
  }
42
42
  /**
43
43
  * Represents the structure for form validation errors.
44
- * Maps each field to an array of error messages.
44
+ * Maps each field to an error message or an array of error messages.
45
45
  */
46
- export type UseFormErrors<T> = Partial<Record<keyof T, string[]>>;
46
+ export type UseFormErrors<T> = Partial<Record<keyof T, string | string[]>>;
47
47
  /**
48
48
  * Represents the fields that have been modified ("dirty") in the form.
49
49
  * Maps each field to a boolean value indicating whether it has been changed.
@@ -58,19 +58,12 @@ export type TouchedFields<T> = Partial<Record<keyof T, boolean>>;
58
58
  * Defines the structure for form validations.
59
59
  * Maps each form field to its corresponding validation rules.
60
60
  */
61
- export type UseFormValidations<T extends {}> = ((formData: T) => Partial<Record<keyof T, UseFormValidation>>) | Partial<Record<keyof T, UseFormValidation>>;
61
+ export type UseFormValidations<T extends {}> = Partial<Record<keyof T, UseFormValidation>>;
62
62
  /**
63
63
  * Describes the function signature for handling form submission.
64
64
  *
65
65
  * @param data - The form data collected during submission.
66
- * @param e - The event, optionally passed when `handleSubmit` is called.
66
+ * @param e - The form event, optionally passed when the form is submitted.
67
67
  */
68
- export type UseFormSubmitHandler<T extends {}> = (data: T, e?: BaseSyntheticEvent) => void;
69
- /**
70
- * A type defining the function signature for handling form validation errors.
71
- *
72
- * @param errors - An object containing the validation errors for form fields.
73
- * @param e - The event, optionally passed when `handleSubmit` is called.
74
- */
75
- export type UseFormErrorHandler<T extends {}> = (errors: UseFormErrors<T>, e?: BaseSyntheticEvent) => void;
68
+ export type UseFormSubmitHandler<T extends {}> = (data: T, e?: FormEvent<HTMLFormElement>) => void;
76
69
  export {};
@@ -7,4 +7,4 @@ import { UseFormValidation } from './useForm.types';
7
7
  * @param validation - The validation rules for the form field.
8
8
  * @returns Returns error message(s) or null if valid.
9
9
  */
10
- export declare const checkValidation: <T extends Record<keyof T, any> = {}>(value: T[keyof T], validation: UseFormValidation) => string[] | null;
10
+ export declare const checkValidation: <T extends Record<keyof T, any> = {}>(value: T[keyof T], validation: UseFormValidation) => string | string[] | null;
@@ -99,23 +99,12 @@ export declare enum AppEnvDeploymentConfigType {
99
99
  PREVIOUS_DEPLOYMENTS = "PreviousDeployments",
100
100
  DEFAULT_VERSION = "DefaultVersion"
101
101
  }
102
- export declare enum DraftState {
103
- Init = 1,
104
- Discarded = 2,
105
- Published = 3,
106
- AwaitApproval = 4
107
- }
108
- export declare enum DraftAction {
109
- Add = 1,
110
- Update = 2,
111
- Delete = 3
112
- }
113
102
  export interface DraftMetadataDTO {
114
103
  appId: number;
115
104
  envId: number;
116
105
  resource: number;
117
106
  resourceName: string;
118
- action: DraftAction;
107
+ action: number;
119
108
  data: string;
120
109
  userComment: string;
121
110
  changeProposed: boolean;
@@ -124,7 +113,7 @@ export interface DraftMetadataDTO {
124
113
  };
125
114
  draftId: number;
126
115
  draftVersionId: number;
127
- draftState: DraftState;
116
+ draftState: number;
128
117
  draftResolvedValue: string;
129
118
  approvers: string[];
130
119
  canApprove: boolean;
@@ -132,37 +121,24 @@ export interface DraftMetadataDTO {
132
121
  dataEncrypted: boolean;
133
122
  isAppAdmin: boolean;
134
123
  }
135
- export declare enum CMSecretExternalType {
136
- Internal = "",
137
- KubernetesConfigMap = "KubernetesConfigMap",
138
- KubernetesSecret = "KubernetesSecret",
139
- AWSSecretsManager = "AWSSecretsManager",
140
- AWSSystemManager = "AWSSystemManager",
141
- HashiCorpVault = "HashiCorpVault",
142
- ESO_GoogleSecretsManager = "ESO_GoogleSecretsManager",
143
- ESO_AWSSecretsManager = "ESO_AWSSecretsManager",
144
- ESO_AzureSecretsManager = "ESO_AzureSecretsManager",
145
- ESO_HashiCorpVault = "ESO_HashiCorpVault"
146
- }
147
124
  export interface ConfigDatum {
148
125
  name: string;
149
126
  type: string;
150
127
  external: boolean;
151
- data: Record<string, any>;
152
- defaultData: Record<string, any>;
128
+ data: Record<string, string>;
129
+ defaultData: Record<string, string>;
153
130
  global: boolean;
154
- externalType: CMSecretExternalType;
155
- esoSecretData: Record<string, any>;
156
- defaultESOSecretData: Record<string, any>;
157
- secretData: Record<string, any>[];
158
- defaultSecretData: Record<string, any>[];
131
+ externalType: string;
132
+ esoSecretData: {};
133
+ defaultESOSecretData: {};
134
+ secretData: Record<string, string>;
135
+ defaultSecretData: Record<string, string>;
159
136
  roleARN: string;
160
137
  subPath: boolean;
161
138
  filePermission: string;
162
139
  overridden: boolean;
163
- mountPath: string;
164
- defaultMountPath: string;
165
- esoSubPath: string[];
140
+ mountPath?: string;
141
+ defaultMountPath?: string;
166
142
  }
167
143
  export interface ConfigMapSecretDataConfigDatumDTO extends ConfigDatum {
168
144
  draftMetadata: DraftMetadataDTO;
@@ -244,6 +220,17 @@ export interface TemplateListDTO {
244
220
  pipelineId?: number;
245
221
  wfrId?: number;
246
222
  }
223
+ export interface ManifestTemplateDTO {
224
+ data: string;
225
+ resolvedData: string;
226
+ variableSnapshot: null;
227
+ }
228
+ export declare enum DraftState {
229
+ Init = 1,
230
+ Discarded = 2,
231
+ Published = 3,
232
+ AwaitApproval = 4
233
+ }
247
234
  export declare enum EnvResourceType {
248
235
  ConfigMap = "configmap",
249
236
  Secret = "secrets",
@@ -1,5 +1,5 @@
1
1
  import { OptionType } from '../Common/Types';
2
- import { CDMaterialSidebarType, ConfigKeysWithLockType, ConfigurationType } from './types';
2
+ import { CDMaterialSidebarType } from './types';
3
3
  export declare const ARTIFACT_STATUS: {
4
4
  PROGRESSING: string;
5
5
  DEGRADED: string;
@@ -411,5 +411,3 @@ export declare enum SelectAllGroupedResourceIdentifiers {
411
411
  }
412
412
  export declare const CD_MATERIAL_SIDEBAR_TABS: OptionType<CDMaterialSidebarType, CDMaterialSidebarType>[];
413
413
  export declare const TRIGGER_STATUS_PROGRESSING: string[];
414
- export declare const CONFIGURATION_TYPE_VALUES: ConfigurationType[];
415
- export declare const DEFAULT_LOCKED_KEYS_CONFIG: Readonly<ConfigKeysWithLockType>;
@@ -376,6 +376,7 @@ export declare enum ResourceKindType {
376
376
  installation = "installation",
377
377
  environment = "environment",
378
378
  cdPipeline = "cd-pipeline",
379
+ ciPipeline = "ci-pipeline",
379
380
  project = "project"
380
381
  }
381
382
  /**
@@ -395,7 +396,9 @@ export interface SeverityCount {
395
396
  unknown: number;
396
397
  }
397
398
  export declare enum PolicyKindType {
398
- lockConfiguration = "lock-configuration"
399
+ lockConfiguration = "lock-configuration",
400
+ imagePromotion = "image-promotion",
401
+ plugins = "plugin"
399
402
  }
400
403
  export interface LastExecutionResultType {
401
404
  lastExecution: string;
@@ -572,18 +575,6 @@ export type BaseFilterQueryParams<T> = {
572
575
  */
573
576
  showAll?: boolean;
574
577
  } & SortingParams<T>;
575
- export declare enum ConfigurationType {
576
- GUI = "GUI",
577
- YAML = "YAML"
578
- }
579
- export interface BaseURLParams {
580
- appId: string;
581
- envId: string;
582
- }
583
- export interface ConfigKeysWithLockType {
584
- config: string[];
585
- allowed: boolean;
586
- }
587
578
  export type DataAttributes = Record<`data-${string}`, unknown>;
588
579
  export interface RuntimeParamsListItemType extends KeyValueListType {
589
580
  id: number;
@@ -14,6 +14,8 @@ export declare const MESSAGES: {
14
14
  VALID_POSITIVE_INTEGER: string;
15
15
  MAX_SAFE_INTEGER: string;
16
16
  INVALID_SEMANTIC_VERSION: string;
17
+ INVALID_DATE: string;
18
+ DATE_BEFORE_CURRENT_TIME: string;
17
19
  };
18
20
  export declare const requiredField: (value: string) => ValidationResponseType;
19
21
  export declare const validateName: (name: string) => ValidationResponseType;
@@ -42,3 +44,4 @@ export declare const validateSemanticVersioning: (version: string) => Validation
42
44
  */
43
45
  export declare const validateDisplayName: (name: string) => ValidationResponseType;
44
46
  export declare const validateJSON: (json: string) => ValidationResponseType;
47
+ export declare const validateDateAndTime: (date: Date) => ValidationResponseType;