@devtron-labs/devtron-fe-common-lib 0.3.5-beta-2 → 0.3.5-beta-3

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 (71) hide show
  1. package/dist/Common/Constants.d.ts +2 -0
  2. package/dist/Common/CustomInput/CustomInput.d.ts +1 -1
  3. package/dist/Common/CustomInput/Types.d.ts +1 -1
  4. package/dist/Common/DeleteComponentModal/types.d.ts +1 -4
  5. package/dist/Common/Helper.d.ts +6 -0
  6. package/dist/Common/index.d.ts +0 -1
  7. package/dist/Pages/App/AppConfigurations/utils.d.ts +1 -1
  8. package/dist/Shared/Components/ImageCardAccordion/ImageCardAccordion.d.ts +1 -1
  9. package/dist/Shared/Components/ImageCardAccordion/types.d.ts +1 -0
  10. package/dist/Shared/Components/Security/SecurityModal/SecurityModal.d.ts +14 -0
  11. package/dist/Shared/Components/Security/SecurityModal/components/IndexedTextDisplay.d.ts +4 -0
  12. package/dist/Shared/Components/Security/SecurityModal/components/InfoCard.d.ts +4 -0
  13. package/dist/Shared/Components/Security/SecurityModal/components/OpenDetailViewButton.d.ts +4 -0
  14. package/dist/Shared/Components/Security/SecurityModal/components/Sidebar.d.ts +4 -0
  15. package/dist/Shared/Components/Security/SecurityModal/components/Table.d.ts +4 -0
  16. package/dist/Shared/Components/Security/SecurityModal/components/index.d.ts +4 -0
  17. package/dist/Shared/Components/Security/SecurityModal/config/CodeScan.d.ts +100 -0
  18. package/dist/Shared/Components/Security/SecurityModal/config/EmptyState.d.ts +2 -0
  19. package/dist/Shared/Components/Security/SecurityModal/config/ImageScan.d.ts +4 -0
  20. package/dist/Shared/Components/Security/SecurityModal/config/InfoCard.d.ts +2 -0
  21. package/dist/Shared/Components/Security/SecurityModal/config/KubernetesManifest.d.ts +4 -0
  22. package/dist/Shared/Components/Security/SecurityModal/config/Sidebar.d.ts +2 -0
  23. package/dist/Shared/Components/Security/SecurityModal/config/Table.d.ts +2 -0
  24. package/dist/Shared/Components/Security/SecurityModal/config/index.d.ts +3 -0
  25. package/dist/Shared/Components/Security/SecurityModal/constants.d.ts +56 -0
  26. package/dist/Shared/Components/Security/SecurityModal/index.d.ts +4 -0
  27. package/dist/Shared/Components/Security/SecurityModal/service.d.ts +5 -0
  28. package/dist/Shared/Components/Security/SecurityModal/types.d.ts +269 -0
  29. package/dist/Shared/Components/Security/SecurityModal/utils.d.ts +34 -0
  30. package/dist/Shared/Components/Security/SecuritySummaryCard/SecuritySummaryCard.d.ts +3 -0
  31. package/dist/Shared/Components/Security/SecuritySummaryCard/index.d.ts +1 -0
  32. package/dist/Shared/Components/Security/SecuritySummaryCard/types.d.ts +16 -0
  33. package/dist/Shared/Components/{Vulnerabilities → Security/Vulnerabilities}/Vulnerabilities.d.ts +1 -1
  34. package/dist/Shared/Components/{Vulnerabilities → Security/Vulnerabilities}/index.d.ts +1 -0
  35. package/dist/Shared/Components/{Vulnerabilities → Security/Vulnerabilities}/service.d.ts +1 -1
  36. package/dist/Shared/Components/Security/Vulnerabilities/types.d.ts +25 -0
  37. package/dist/Shared/Components/Security/Vulnerabilities/utils.d.ts +13 -0
  38. package/dist/Shared/Components/Security/index.d.ts +4 -0
  39. package/dist/Shared/Components/Security/utils.d.ts +4 -0
  40. package/dist/Shared/Components/index.d.ts +1 -1
  41. package/dist/Shared/Hooks/index.d.ts +0 -1
  42. package/dist/Shared/constants.d.ts +4 -0
  43. package/dist/Shared/types.d.ts +1 -0
  44. package/dist/assets/index.css +1 -1
  45. package/dist/{cssMode-uwn3xArb.js → cssMode-C2DbOm5G.js} +1 -1
  46. package/dist/{freemarker2-CaMhuqPe.js → freemarker2-DIAXDvZh.js} +1 -1
  47. package/dist/{handlebars-CTnClFcN.js → handlebars-BNSBHLYi.js} +1 -1
  48. package/dist/{html-dSNw58aO.js → html-BYhqChCC.js} +1 -1
  49. package/dist/{htmlMode-YCmi4Oec.js → htmlMode-Yi80fKa_.js} +1 -1
  50. package/dist/{index-CQ_tnSZb.js → index-B_5eS34k.js} +34557 -32957
  51. package/dist/index.js +336 -328
  52. package/dist/{javascript-BOjyNMQb.js → javascript-qbJFaknq.js} +1 -1
  53. package/dist/{jsonMode-Wch8DjET.js → jsonMode-BIO3_Bhv.js} +1 -1
  54. package/dist/{liquid-yOyHP9Wm.js → liquid-BhQxjMmC.js} +1 -1
  55. package/dist/{mdx-CkdjZgHK.js → mdx-BcxpAgOj.js} +1 -1
  56. package/dist/{python-CuKcH7j4.js → python-lNzFF1gZ.js} +1 -1
  57. package/dist/{razor-CMkeVh_3.js → razor-Bt-aSObe.js} +1 -1
  58. package/dist/{tsMode-C6w4n8l9.js → tsMode-Dp7Djl6H.js} +1 -1
  59. package/dist/{typescript-isK37BH_.js → typescript-VVpDVimM.js} +1 -1
  60. package/dist/{xml-BlWNjX_p.js → xml-w67VngZW.js} +1 -1
  61. package/dist/{yaml-BFN6QLOY.js → yaml-DLRfXLkQ.js} +1 -1
  62. package/package.json +4 -3
  63. package/dist/Common/Security/ScanVulnerabilitiesTable.d.ts +0 -2
  64. package/dist/Common/Security/types.d.ts +0 -4
  65. package/dist/Shared/Components/Vulnerabilities/constants.d.ts +0 -4
  66. package/dist/Shared/Components/Vulnerabilities/types.d.ts +0 -7
  67. package/dist/Shared/Components/Vulnerabilities/utils.d.ts +0 -4
  68. package/dist/Shared/Hooks/useForm/index.d.ts +0 -2
  69. package/dist/Shared/Hooks/useForm/useForm.d.ts +0 -71
  70. package/dist/Shared/Hooks/useForm/useForm.types.d.ts +0 -69
  71. package/dist/Shared/Hooks/useForm/useForm.utils.d.ts +0 -10
@@ -1,4 +1,4 @@
1
- import { conf as t, language as e } from "./typescript-isK37BH_.js";
1
+ import { conf as t, language as e } from "./typescript-VVpDVimM.js";
2
2
  /*!-----------------------------------------------------------------------------
3
3
  * Copyright (c) Microsoft Corporation. All rights reserved.
4
4
  * Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166)
@@ -1,7 +1,7 @@
1
1
  var $e = Object.defineProperty;
2
2
  var Ge = (e, n, i) => n in e ? $e(e, n, { enumerable: !0, configurable: !0, writable: !0, value: i }) : e[n] = i;
3
3
  var C = (e, n, i) => Ge(e, typeof n != "symbol" ? n + "" : n, i);
4
- import { m as Qe } from "./index-CQ_tnSZb.js";
4
+ import { m as Qe } from "./index-B_5eS34k.js";
5
5
  /*!-----------------------------------------------------------------------------
6
6
  * Copyright (c) Microsoft Corporation. All rights reserved.
7
7
  * Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166)
@@ -1,4 +1,4 @@
1
- import { m as l } from "./index-CQ_tnSZb.js";
1
+ import { m as l } from "./index-B_5eS34k.js";
2
2
  /*!-----------------------------------------------------------------------------
3
3
  * Copyright (c) Microsoft Corporation. All rights reserved.
4
4
  * Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166)
@@ -1,4 +1,4 @@
1
- import { m as s } from "./index-CQ_tnSZb.js";
1
+ import { m as s } from "./index-B_5eS34k.js";
2
2
  /*!-----------------------------------------------------------------------------
3
3
  * Copyright (c) Microsoft Corporation. All rights reserved.
4
4
  * Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166)
@@ -1,4 +1,4 @@
1
- import { m as i } from "./index-CQ_tnSZb.js";
1
+ import { m as i } from "./index-B_5eS34k.js";
2
2
  /*!-----------------------------------------------------------------------------
3
3
  * Copyright (c) Microsoft Corporation. All rights reserved.
4
4
  * Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166)
@@ -1,4 +1,4 @@
1
- import { m } from "./index-CQ_tnSZb.js";
1
+ import { m } from "./index-B_5eS34k.js";
2
2
  /*!-----------------------------------------------------------------------------
3
3
  * Copyright (c) Microsoft Corporation. All rights reserved.
4
4
  * Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166)
@@ -1,7 +1,7 @@
1
1
  var N = Object.defineProperty;
2
2
  var M = (e, t, r) => t in e ? N(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
3
3
  var _ = (e, t, r) => M(e, typeof t != "symbol" ? t + "" : t, r);
4
- import { t as R, m as K } from "./index-CQ_tnSZb.js";
4
+ import { t as R, m as K } from "./index-B_5eS34k.js";
5
5
  /*!-----------------------------------------------------------------------------
6
6
  * Copyright (c) Microsoft Corporation. All rights reserved.
7
7
  * Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166)
@@ -1,4 +1,4 @@
1
- import { m as s } from "./index-CQ_tnSZb.js";
1
+ import { m as s } from "./index-B_5eS34k.js";
2
2
  /*!-----------------------------------------------------------------------------
3
3
  * Copyright (c) Microsoft Corporation. All rights reserved.
4
4
  * Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166)
@@ -1,4 +1,4 @@
1
- import { m as r } from "./index-CQ_tnSZb.js";
1
+ import { m as r } from "./index-B_5eS34k.js";
2
2
  /*!-----------------------------------------------------------------------------
3
3
  * Copyright (c) Microsoft Corporation. All rights reserved.
4
4
  * Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166)
@@ -1,4 +1,4 @@
1
- import { m as l } from "./index-CQ_tnSZb.js";
1
+ import { m as l } from "./index-B_5eS34k.js";
2
2
  /*!-----------------------------------------------------------------------------
3
3
  * Copyright (c) Microsoft Corporation. All rights reserved.
4
4
  * Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devtron-labs/devtron-fe-common-lib",
3
- "version": "0.3.5-beta-2",
3
+ "version": "0.3.5-beta-3",
4
4
  "description": "Supporting common component library",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -73,7 +73,6 @@
73
73
  "vite-tsconfig-paths": "5.0.1"
74
74
  },
75
75
  "peerDependencies": {
76
- "react-select": "5.8.0",
77
76
  "@rjsf/core": "^5.13.3",
78
77
  "@rjsf/utils": "^5.13.3",
79
78
  "@rjsf/validator-ajv8": "^5.13.3",
@@ -87,15 +86,17 @@
87
86
  "react-mde": "^11.5.0",
88
87
  "react-router": "^5.3.0",
89
88
  "react-router-dom": "^5.3.0",
89
+ "react-select": "5.8.0",
90
90
  "rxjs": "^7.8.1",
91
91
  "yaml": "^2.4.1"
92
92
  },
93
93
  "dependencies": {
94
94
  "@types/react-dates": "^21.8.6",
95
95
  "ansi_up": "^5.2.1",
96
+ "dayjs": "^1.11.12",
96
97
  "fast-json-patch": "^3.1.1",
97
- "react-dates": "^21.8.0",
98
98
  "jsonpath-plus": "^9.0.0",
99
+ "react-dates": "^21.8.0",
99
100
  "react-monaco-editor": "^0.54.0",
100
101
  "sass": "^1.69.7",
101
102
  "tslib": "2.7.0"
@@ -1,2 +0,0 @@
1
- import { ScanVulnerabilitiesTableProps } from '../Types';
2
- export default function ScanVulnerabilitiesTable({ vulnerabilities, hidePolicy, shouldStick, }: ScanVulnerabilitiesTableProps): JSX.Element;
@@ -1,4 +0,0 @@
1
- export declare enum VulnerabilitiesTableSortKeys {
2
- SEVERITY = "severity",
3
- PACKAGE = "package"
4
- }
@@ -1,4 +0,0 @@
1
- export declare const NO_VULNERABILITY_TEXT: {
2
- SECURED: string;
3
- NO_VULNERABILITY_FOUND: string;
4
- };
@@ -1,7 +0,0 @@
1
- import { MaterialSecurityInfoType } from '../../types';
2
- export interface VulnerabilitiesProps extends MaterialSecurityInfoType {
3
- artifactId: number;
4
- applicationId: number;
5
- environmentId: number;
6
- setVulnerabilityCount: React.Dispatch<React.SetStateAction<number>>;
7
- }
@@ -1,4 +0,0 @@
1
- import { LastExecutionResponseType, LastExecutionResultType } from '../../types';
2
- export declare const getSortedVulnerabilities: (vulnerabilities: any) => any;
3
- export declare const getParsedScanResult: (scanResult: any) => LastExecutionResultType;
4
- export declare const parseLastExecutionResponse: (response: any) => LastExecutionResponseType;
@@ -1,2 +0,0 @@
1
- export * from './useForm';
2
- export * from './useForm.types';
@@ -1,71 +0,0 @@
1
- import { ChangeEvent, FormEvent } from 'react';
2
- import { UseFormSubmitHandler, UseFormValidations } from './useForm.types';
3
- /**
4
- * A custom hook to manage form state, validation, and submission handling.
5
- *
6
- * @param options - Optional configuration object for the form.
7
- * @returns The form state and utility methods
8
- */
9
- export declare const useForm: <T extends Record<keyof T, any> = {}>(options?: {
10
- /** An object containing validation rules for each form field. */
11
- validations?: UseFormValidations<T>;
12
- /** An object representing the initial values for the form fields. */
13
- initialValues?: Partial<T>;
14
- /** Defines when validation should occur:
15
- * - 'onChange': Validation occurs when the user modifies the input
16
- * - 'onBlur': Validation occurs when the input loses focus.
17
- * @default 'onChange'
18
- */
19
- validationMode?: "onChange" | "onBlur";
20
- }) => {
21
- /** The current form data. */
22
- data: T;
23
- /** An object containing validation errors for each form field. */
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?: {
33
- /**
34
- * Prevents the input value from being trimmed.
35
- *
36
- * If `noTrim` is set to true, the input value will not be automatically trimmed.\
37
- * This can be useful when whitespace is required for certain inputs.
38
- *
39
- * @default false - By default, the input will be trimmed.
40
- */
41
- noTrim?: boolean;
42
- }) => {
43
- onChange: (e: ChangeEvent<HTMLInputElement>) => void;
44
- onBlur: () => void;
45
- onFocus: () => void;
46
- name: keyof T;
47
- };
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
- */
61
- trigger: (name: keyof T | (keyof T)[]) => (string | string[]) | (string | string[])[];
62
- /** An object representing additional form state. */
63
- formState: {
64
- /** An object indicating which fields have been touched (interacted with). */
65
- touchedFields: Partial<Record<keyof T, boolean>>;
66
- /** An object indicating which fields have been modified. */
67
- dirtyFields: Partial<Record<keyof T, boolean>>;
68
- /** A boolean indicating if any field has been modified. */
69
- isDirty: boolean;
70
- };
71
- };
@@ -1,69 +0,0 @@
1
- import { FormEvent } from 'react';
2
- /**
3
- * Describes the "required" validation rule.
4
- * It can be a simple boolean or an object containing a boolean value and an error message.
5
- */
6
- type ValidationRequired = boolean | {
7
- value: boolean;
8
- message: string;
9
- };
10
- /**
11
- * Describes the "pattern" validation rule, which ensures a value matches a specific regular expression.
12
- * It can be a single validation object or an array of multiple patterns.
13
- */
14
- type ValidationPattern = {
15
- value: RegExp;
16
- message: string;
17
- } | {
18
- value: RegExp;
19
- message: string;
20
- }[];
21
- /**
22
- * Describes custom validation logic.
23
- * It checks if a value passes a custom validation function, which returns a boolean.
24
- * If validation fails, an error message is provided.
25
- */
26
- type ValidationCustom = {
27
- isValid: (value: string) => boolean;
28
- message: string;
29
- } | {
30
- isValid: (value: string) => boolean;
31
- message: string;
32
- }[];
33
- /**
34
- * Defines the validation rules for form fields.
35
- * Includes `required`, `pattern`, and `custom` validation types.
36
- */
37
- export interface UseFormValidation {
38
- required?: ValidationRequired;
39
- pattern?: ValidationPattern;
40
- custom?: ValidationCustom;
41
- }
42
- /**
43
- * Represents the structure for form validation errors.
44
- * Maps each field to an error message or an array of error messages.
45
- */
46
- export type UseFormErrors<T> = Partial<Record<keyof T, string | string[]>>;
47
- /**
48
- * Represents the fields that have been modified ("dirty") in the form.
49
- * Maps each field to a boolean value indicating whether it has been changed.
50
- */
51
- export type DirtyFields<T> = Partial<Record<keyof T, boolean>>;
52
- /**
53
- * Represents the fields that have been interacted with ("touched") in the form.
54
- * Maps each field to a boolean value indicating whether it has been focused or interacted with.
55
- */
56
- export type TouchedFields<T> = Partial<Record<keyof T, boolean>>;
57
- /**
58
- * Defines the structure for form validations.
59
- * Maps each form field to its corresponding validation rules.
60
- */
61
- export type UseFormValidations<T extends {}> = Partial<Record<keyof T, UseFormValidation>>;
62
- /**
63
- * Describes the function signature for handling form submission.
64
- *
65
- * @param data - The form data collected during submission.
66
- * @param e - The form event, optionally passed when the form is submitted.
67
- */
68
- export type UseFormSubmitHandler<T extends {}> = (data: T, e?: FormEvent<HTMLFormElement>) => void;
69
- export {};
@@ -1,10 +0,0 @@
1
- import { UseFormValidation } from './useForm.types';
2
- /**
3
- * Validates a form field based on the provided validation rules.
4
- *
5
- * @template T - A record type representing form data.
6
- * @param value - The value of the form field to be validated.
7
- * @param validation - The validation rules for the form field.
8
- * @returns Returns error message(s) or null if valid.
9
- */
10
- export declare const checkValidation: <T extends Record<keyof T, any> = {}>(value: T[keyof T], validation: UseFormValidation) => string | string[] | null;