@devtron-labs/devtron-fe-common-lib 1.0.6 → 1.0.8

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 (32) hide show
  1. package/dist/Common/ClipboardButton/ClipboardButton.d.ts +2 -3
  2. package/dist/Common/ClipboardButton/types.d.ts +1 -2
  3. package/dist/Common/Common.service.d.ts +7 -0
  4. package/dist/Common/Constants.d.ts +14 -0
  5. package/dist/Common/Helper.d.ts +11 -4
  6. package/dist/Common/index.d.ts +1 -1
  7. package/dist/Pages/Applications/DevtronApps/Details/AppConfigurations/utils.d.ts +1 -1
  8. package/dist/Shared/Components/CICDHistory/CiPipelineSourceConfig.d.ts +2 -11
  9. package/dist/Shared/Components/CICDHistory/types.d.ts +11 -0
  10. package/dist/Shared/Components/GitCommitInfoGeneric/GitCommitInfoGeneric.d.ts +1 -1
  11. package/dist/Shared/Components/Security/SecurityModal/utils.d.ts +1 -1
  12. package/dist/Shared/Helpers.d.ts +14 -0
  13. package/dist/Shared/Services/app.types.d.ts +2 -1
  14. package/dist/assets/index.css +1 -1
  15. package/dist/{cssMode-FY2mW-Vn.js → cssMode-BmLpmvTM.js} +1 -1
  16. package/dist/{freemarker2-D6Bg4wQS.js → freemarker2-eZ0G3X_4.js} +1 -1
  17. package/dist/{handlebars-BhvZtc5a.js → handlebars-DPGRAVbW.js} +1 -1
  18. package/dist/{html-D7ogCfTN.js → html-DzHeG8lC.js} +1 -1
  19. package/dist/{htmlMode-CI-3hVVf.js → htmlMode-CLFpexPz.js} +1 -1
  20. package/dist/{index--crtiNwf.js → index-C17rlACJ.js} +20985 -21060
  21. package/dist/index.js +436 -430
  22. package/dist/{javascript-CqEszL_Q.js → javascript-BBdh_eOU.js} +1 -1
  23. package/dist/{jsonMode-C1KosL-1.js → jsonMode-t0fX31hE.js} +1 -1
  24. package/dist/{liquid-bq1F3JGe.js → liquid-Bh0FqdoX.js} +1 -1
  25. package/dist/{mdx-C7oY5cMg.js → mdx-CM_Cl5yZ.js} +1 -1
  26. package/dist/{python-BIZTOmGm.js → python-BAxpR0Pd.js} +1 -1
  27. package/dist/{razor-DV2i5NUD.js → razor-Du7iswWM.js} +1 -1
  28. package/dist/{tsMode-CD1awfsZ.js → tsMode-C12s8TUq.js} +1 -1
  29. package/dist/{typescript-CY8Mdht_.js → typescript-BL_jQX8Z.js} +1 -1
  30. package/dist/{xml-CNG8yc5g.js → xml-BlejnsJa.js} +1 -1
  31. package/dist/{yaml-BXj-NgLF.js → yaml-Cb2BDtD-.js} +1 -1
  32. package/package.json +1 -1
@@ -3,9 +3,8 @@ import { default as ClipboardProps } from './types';
3
3
  * @param content - Content to be copied
4
4
  * @param copiedTippyText - Text to be shown in the tippy when the content is copied, default 'Copied!'
5
5
  * @param duration - Duration for which the tippy should be shown, default 1000
6
- * @param trigger - To trigger the copy action outside the button, if set to true the content will be copied, use case being triggering the copy action from outside the component
7
- * @param setTrigger - Callback function to set the trigger outside the button
6
+ * @param copyToClipboardPromise - the promise returned by copyToClipboard util function
8
7
  * @param rootClassName - additional classes to add to button
9
8
  * @param iconSize - size of svg icon to be shown, default 16 (icon-dim-16)
10
9
  */
11
- export default function ClipboardButton({ content, copiedTippyText, duration, trigger, setTrigger, rootClassName, iconSize, }: ClipboardProps): JSX.Element;
10
+ export declare const ClipboardButton: ({ content, copiedTippyText, duration, copyToClipboardPromise, rootClassName, iconSize, }: ClipboardProps) => JSX.Element;
@@ -2,8 +2,7 @@ export default interface ClipboardProps {
2
2
  content: string;
3
3
  copiedTippyText?: string;
4
4
  duration?: number;
5
- trigger?: boolean;
6
- setTrigger?: React.Dispatch<React.SetStateAction<boolean>>;
5
+ copyToClipboardPromise?: Promise<void>;
7
6
  rootClassName?: string;
8
7
  iconSize?: number;
9
8
  }
@@ -27,4 +27,11 @@ export declare function getClusterListMin(): Promise<ResponseType<any>>;
27
27
  export declare const getResourceGroupListRaw: (clusterId: string) => Promise<ResponseType<ApiResourceType>>;
28
28
  export declare function getNamespaceListMin(clusterIdsCsv: string): Promise<EnvironmentListHelmResponse>;
29
29
  export declare function getWebhookEventsForEventId(eventId: string | number): Promise<ResponseType<any>>;
30
+ /**
31
+ *
32
+ * @param gitUrl Git URL of the repository
33
+ * @param branchName Branch name
34
+ * @returns URL to the branch in the Git repository
35
+ */
36
+ export declare const getGitBranchUrl: (gitUrl: string, branchName: string) => string | null;
30
37
  export {};
@@ -294,3 +294,17 @@ export declare const VULNERABILITIES_SORT_PRIORITY: {
294
294
  unknown: number;
295
295
  };
296
296
  export declare const IS_PLATFORM_MAC_OS: boolean;
297
+ /**
298
+ * Git provider types
299
+ */
300
+ export declare enum GitProviderType {
301
+ GITHUB = "github",
302
+ GITLAB = "gitlab",
303
+ BITBUCKET = "bitbucket",
304
+ AZURE = "azure",
305
+ GITEA = "gitea"
306
+ }
307
+ /**
308
+ * Formats the schema removing any irregularity in the existing schema
309
+ */
310
+ export declare const getFormattedSchema: (schema?: string) => string;
@@ -28,12 +28,11 @@ export declare const closeOnEscKeyPressed: (e: any, actionClose: () => void) =>
28
28
  export declare function useJsonYaml(value: any, tabSize?: number, language?: string, shouldRun?: boolean): any[];
29
29
  export declare function cleanKubeManifest(manifestJsonString: string): string;
30
30
  /**
31
- * It will copy the passed content to clipboard and invoke the callback function, in case of error it will show the toast message.
32
- * On HTTP system clipboard is not supported, so it will use the unsecureCopyToClipboard function
31
+ * This is a promise<void> that will resolve if str is successfully copied
32
+ * On HTTP (other than localhost) system clipboard is not supported, so it will use the unsecureCopyToClipboard function
33
33
  * @param str
34
- * @param callback
35
34
  */
36
- export declare function copyToClipboard(str: any, callback?: typeof noop): void;
35
+ export declare function copyToClipboard(str: string): Promise<void>;
37
36
  export declare function useAsync<T>(func: (...rest: any[]) => Promise<T>, dependencyArray?: any[], shouldRun?: boolean, options?: AsyncOptions): [boolean, T, any | null, () => void, React.Dispatch<any>, any[]];
38
37
  export declare const processDeployedTime: (lastDeployed: any, isArgoInstalled: any) => string;
39
38
  /**
@@ -121,6 +120,14 @@ export declare function mapByKey<T = Map<any, any>>(arr: any[], id: string): T;
121
120
  export declare function asyncWrap(promise: any): any[];
122
121
  export declare const prefixZeroIfSingleDigit: (value?: number) => string | number;
123
122
  export declare const throttle: <T extends (...args: unknown[]) => unknown>(func: T, delay?: number) => ((...args: Parameters<T>) => void);
123
+ /**
124
+ *
125
+ * @param sourceType - SourceTypeMap
126
+ * @param _isRegex - boolean
127
+ * @param webhookEventName - WebhookEventNameType
128
+ * @returns - Icon
129
+ */
130
+ export declare const getBranchIcon: (sourceType: any, _isRegex?: boolean, webhookEventName?: string) => string;
124
131
  export declare const getSanitizedIframe: (iframeString: string) => string;
125
132
  /**
126
133
  * This method adds default attributes to iframe - title, loading ="lazy", width="100%", height="100%"
@@ -38,7 +38,7 @@ export * from './ResizableTextarea';
38
38
  export { default as DebouncedSearch } from './DebouncedSearch/DebouncedSearch';
39
39
  export { default as Grid } from './Grid/Grid';
40
40
  export { default as Select } from './Select/Select';
41
- export { default as ClipboardButton } from './ClipboardButton/ClipboardButton';
41
+ export { ClipboardButton } from './ClipboardButton/ClipboardButton';
42
42
  export * from './Hooks';
43
43
  export * from './RJSF';
44
44
  export * from './DevtronProgressing';
@@ -1,2 +1,2 @@
1
1
  import { DeploymentStageType } from '../../../../../Shared/constants';
2
- export declare const getDeploymentStageTitle: (stage: DeploymentStageType) => "-" | "deployment" | "pre-deployment" | "post-deployment";
2
+ export declare const getDeploymentStageTitle: (stage: DeploymentStageType) => "deployment" | "pre-deployment" | "post-deployment" | "-";
@@ -1,11 +1,2 @@
1
- export interface CIPipelineSourceConfigInterface {
2
- sourceType: any;
3
- sourceValue: any;
4
- showTooltip?: boolean;
5
- showIcons?: boolean;
6
- baseText?: string;
7
- regex?: any;
8
- isRegex?: boolean;
9
- primaryBranchAfterRegex?: string;
10
- }
11
- export declare const CiPipelineSourceConfig: ({ sourceType, sourceValue, showTooltip, showIcons, baseText, regex, isRegex, primaryBranchAfterRegex, }: CIPipelineSourceConfigInterface) => JSX.Element;
1
+ import { CIPipelineSourceConfigInterface } from './types';
2
+ export declare const CiPipelineSourceConfig: ({ sourceType, sourceValue, showTooltip, showIcons, baseText, regex, isRegex, primaryBranchAfterRegex, rootClassName, }: CIPipelineSourceConfigInterface) => JSX.Element;
@@ -666,4 +666,15 @@ export type CreateMarkupPropsType = {
666
666
  export type TriggerHistoryFilterCriteriaType = `${string}|${string}|${string}`[];
667
667
  export declare const terminalStatus: Set<string>;
668
668
  export declare const statusSet: Set<string>;
669
+ export interface CIPipelineSourceConfigInterface {
670
+ sourceType: string;
671
+ sourceValue: any;
672
+ showTooltip?: boolean;
673
+ showIcons?: boolean;
674
+ baseText?: string;
675
+ regex?: any;
676
+ isRegex?: boolean;
677
+ primaryBranchAfterRegex?: string;
678
+ rootClassName?: string;
679
+ }
669
680
  export {};
@@ -1,3 +1,3 @@
1
1
  import { GitCommitInfoGenericProps } from './types';
2
- declare const GitCommitInfoGeneric: ({ materialSourceType, materialSourceValue, commitInfo, selectedCommitInfo, materialUrl, showMaterialInfoHeader, canTriggerBuild, index, isExcluded, }: GitCommitInfoGenericProps) => JSX.Element;
2
+ declare const GitCommitInfoGeneric: ({ materialSourceType, materialSourceValue, commitInfo, selectedCommitInfo, materialUrl, showMaterialInfoHeader, index, isExcluded, }: GitCommitInfoGenericProps) => JSX.Element;
3
3
  export default GitCommitInfoGeneric;
@@ -2,7 +2,7 @@ import { ApiResponseResultType, SeveritiesDTO, GetResourceScanDetailsResponseTyp
2
2
  import { SEVERITIES } from './constants';
3
3
  export declare const mapSeveritiesToSegmentedBarChartEntities: (severities: Partial<Record<keyof typeof SEVERITIES, number>>) => {
4
4
  color: "#B1B7BC" | "#B21212" | "#F33E3E" | "#FF7E5B" | "#FFB549" | "#1DAD70";
5
- label: "Critical" | "High" | "Medium" | "Low" | "Unknown" | "Failures" | "Successes" | "Exceptions";
5
+ label: "Unknown" | "Critical" | "High" | "Medium" | "Low" | "Failures" | "Successes" | "Exceptions";
6
6
  value: number;
7
7
  }[];
8
8
  export declare const stringifySeverities: (severities: Partial<Record<keyof typeof SEVERITIES, number>>) => string;
@@ -1,5 +1,6 @@
1
1
  import { ReactElement } from 'react';
2
2
  import { Pair } from 'yaml';
3
+ import { MaterialHistoryType } from '@Shared/Services/app.types';
3
4
  import { MaterialInfo, SortingOrder, UserApprovalConfigType } from '../Common';
4
5
  import { GitTriggers, IntersectionChangeHandler, IntersectionOptions, WebhookEventNameType } from './types';
5
6
  import { AggregatedNodes, DeploymentStatusDetailsBreakdownDataType, DeploymentStatusDetailsType, PodMetadatum } from './Components';
@@ -63,4 +64,17 @@ export declare const getDefaultValueFromType: (value: unknown) => {};
63
64
  * and the values are arrays of objects that share the same key value.
64
65
  */
65
66
  export declare const groupArrayByObjectKey: <T extends Record<string, any>, K extends keyof T>(array: T[], key: K) => Record<string, T[]>;
67
+ /**
68
+ * @description - Function to get the lower case object
69
+ * @param input - The input object
70
+ * @returns Record<string, any>
71
+ */
72
+ export declare const getLowerCaseObject: (input: any) => Record<string, any>;
73
+ /**
74
+ * @description - Function to get the webhook date
75
+ * @param materialSourceType - The type of material source (e.g., WEBHOOK)
76
+ * @param history - The history object containing commit information
77
+ * @returns - Formatted webhook date if available, otherwise an empty string
78
+ */
79
+ export declare const getWebhookDate: (materialSourceType: string, history: MaterialHistoryType) => string;
66
80
  export {};
@@ -12,7 +12,7 @@ interface MaterialHistoryDTO {
12
12
  Changes: unknown[];
13
13
  WebhookData: WebhookDataType;
14
14
  }
15
- interface MaterialHistoryType {
15
+ export interface MaterialHistoryType {
16
16
  commitURL: string;
17
17
  commit: MaterialHistoryDTO['Commit'];
18
18
  author: MaterialHistoryDTO['Author'];
@@ -56,6 +56,7 @@ export interface CIMaterialType extends Pick<CIMaterialDTO, 'id' | 'gitMaterialI
56
56
  gitURL: CIMaterialDTO['url'];
57
57
  history: MaterialHistoryType[];
58
58
  isSelected: boolean;
59
+ gitMaterialUrl?: string;
59
60
  }
60
61
  interface ImageCommentDTO {
61
62
  id: number;