@devtron-labs/devtron-fe-common-lib 0.0.96 → 0.0.97-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.
Files changed (38) hide show
  1. package/dist/Common/Helper.d.ts +34 -5
  2. package/dist/Common/Reload.d.ts +3 -0
  3. package/dist/Shared/Components/ArtifactInfoModal/ArtifactInfoModal.component.d.ts +4 -0
  4. package/dist/Shared/Components/ArtifactInfoModal/index.d.ts +2 -0
  5. package/dist/Shared/Components/ArtifactInfoModal/types.d.ts +15 -0
  6. package/dist/Shared/Components/CommitChipCell/CommitChipCell.d.ts +4 -0
  7. package/dist/Shared/Components/CommitChipCell/index.d.ts +2 -0
  8. package/dist/Shared/Components/CommitChipCell/types.d.ts +6 -0
  9. package/dist/Shared/Components/ImageChipCell/ImageChipCell.component.d.ts +4 -0
  10. package/dist/Shared/Components/ImageChipCell/index.d.ts +2 -0
  11. package/dist/Shared/Components/ImageChipCell/types.d.ts +9 -0
  12. package/dist/Shared/Components/MaterialHistory/MaterialHistory.component.d.ts +4 -0
  13. package/dist/Shared/Components/MaterialHistory/index.d.ts +2 -0
  14. package/dist/Shared/Components/MaterialHistory/types.d.ts +8 -0
  15. package/dist/Shared/Components/index.d.ts +4 -0
  16. package/dist/Shared/Services/app.service.d.ts +7 -0
  17. package/dist/Shared/Services/app.types.d.ts +96 -0
  18. package/dist/Shared/Services/index.d.ts +2 -0
  19. package/dist/Shared/Services/utils.d.ts +3 -0
  20. package/dist/assets/index.css +1 -1
  21. package/dist/{cssMode-0e7eae31.js → cssMode-634afdb5.js} +1 -1
  22. package/dist/{freemarker2-44959768.js → freemarker2-12cf213d.js} +1 -1
  23. package/dist/{handlebars-35eafa74.js → handlebars-55e571fa.js} +1 -1
  24. package/dist/{html-d2d55459.js → html-2a4f86ac.js} +1 -1
  25. package/dist/{htmlMode-b26b2dbd.js → htmlMode-5a20eba9.js} +1 -1
  26. package/dist/{index-cdf4c791.js → index-e8587958.js} +22382 -23076
  27. package/dist/index.js +406 -397
  28. package/dist/{javascript-1c3775e9.js → javascript-8c1e3d73.js} +1 -1
  29. package/dist/{jsonMode-c314ac37.js → jsonMode-c5ed7ef5.js} +1 -1
  30. package/dist/{liquid-b2c139b9.js → liquid-01aaf37b.js} +1 -1
  31. package/dist/{mdx-1a9901b0.js → mdx-a792f0cb.js} +1 -1
  32. package/dist/{python-5b1fa217.js → python-4c0a4eb8.js} +1 -1
  33. package/dist/{razor-15bf38ec.js → razor-b04fc3e2.js} +1 -1
  34. package/dist/{tsMode-51d360df.js → tsMode-a53c4bdd.js} +1 -1
  35. package/dist/{typescript-14040f69.js → typescript-b685e4d4.js} +1 -1
  36. package/dist/{xml-0cf59e60.js → xml-00c5b29b.js} +1 -1
  37. package/dist/{yaml-ba343edb.js → yaml-69928256.js} +1 -1
  38. package/package.json +1 -2
@@ -60,11 +60,40 @@ export declare const customStyles: {
60
60
  dropdownIndicator: (base: any, state: any) => any;
61
61
  };
62
62
  export declare const getFilteredChartVersions: (charts: any, selectedChartType: any) => any;
63
- export declare function getUnlockedJSON(json: any, jsonPathArray: any, removeParentKeysAndEmptyArrays?: boolean): {
64
- newDocument: any;
65
- removedPatches: any[];
66
- };
67
- export declare function getLockedJSON(json: any, jsonPathArray: string[]): any;
63
+ /**
64
+ * Removes nulls from the arrays in the provided object
65
+ * @param {object} object from which we need to delete nulls in its arrays
66
+ * @returns object after removing (in-place) the null items in arrays
67
+ */
68
+ export declare const recursivelyRemoveNullsFromArraysInObject: (object: object) => object;
69
+ /**
70
+ * Merges the objects into one object
71
+ * @param {object[]} objects list of js objects
72
+ * @returns object after the merge
73
+ */
74
+ export declare const joinObjects: (objects: object[]) => {};
75
+ /**
76
+ * Builds an object from the provided path
77
+ * @param {string} path JSON pointer path of the form /path/to/1/...
78
+ * @param {any} value property value
79
+ * @returns final object formed from the path
80
+ */
81
+ export declare const buildObjectFromPath: (path: string, value: any) => any;
82
+ /**
83
+ * Returns the list of indices at which the regex matched
84
+ * @param string the string to process
85
+ * @param regex @RegExp
86
+ * @returns array of indices where the @regex matched in @string
87
+ */
88
+ export declare const getRegexMatchPositions: (string: string, regex: RegExp) => number[];
89
+ /**
90
+ * Returns all the substrings from 0th index to progressively next regex match position
91
+ * Eg. Suppose a string is /path/to/folder then it will return [/path, /path/to, /path/to/folder]
92
+ * @param strings list of strings
93
+ * @param regex that matches the separators for the substrings
94
+ * @returns set of substrings
95
+ */
96
+ export declare const powerSetOfSubstringsFromStart: (strings: string[], regex: RegExp) => string[];
68
97
  /**
69
98
  * Returns a debounced variant of the function
70
99
  */
@@ -1,3 +1,6 @@
1
1
  import { ReloadType } from './Types';
2
2
 
3
+ /**
4
+ * @deprecated Use APIResponseHandler (Preferred) or error screen manager instead
5
+ */
3
6
  export default function Reload({ reload, className, heightToDeduct }: ReloadType): JSX.Element;
@@ -0,0 +1,4 @@
1
+ import { ArtifactInfoModalProps } from './types';
2
+
3
+ declare const ArtifactInfoModal: ({ envId, ciArtifactId, handleClose, renderCIListHeader, fetchOnlyArtifactInfo, }: ArtifactInfoModalProps) => JSX.Element;
4
+ export default ArtifactInfoModal;
@@ -0,0 +1,2 @@
1
+ export { default as ArtifactInfoModal } from './ArtifactInfoModal.component';
2
+ export type { ArtifactInfoModalProps } from './types';
@@ -0,0 +1,15 @@
1
+ import { ArtifactType } from '../CICDHistory';
2
+
3
+ export type ArtifactInfoModalProps = Pick<ArtifactType, 'renderCIListHeader'> & {
4
+ ciArtifactId: number;
5
+ handleClose: () => void;
6
+ } & ({
7
+ envId: number | string;
8
+ fetchOnlyArtifactInfo?: false;
9
+ } | {
10
+ envId?: never;
11
+ /**
12
+ * If true, the env and trigger meta data is not fetched
13
+ */
14
+ fetchOnlyArtifactInfo: true;
15
+ });
@@ -0,0 +1,4 @@
1
+ import { CommitChipCellProps } from './types';
2
+
3
+ declare const CommitChipCell: ({ handleClick, commits }: CommitChipCellProps) => JSX.Element;
4
+ export default CommitChipCell;
@@ -0,0 +1,2 @@
1
+ export { default as CommitChipCell } from './CommitChipCell';
2
+ export type { CommitChipCellProps } from './types';
@@ -0,0 +1,6 @@
1
+ import { SyntheticEvent } from 'react';
2
+
3
+ export interface CommitChipCellProps {
4
+ handleClick: (e: SyntheticEvent) => void;
5
+ commits?: string[];
6
+ }
@@ -0,0 +1,4 @@
1
+ import { ImageChipCellProps } from './types';
2
+
3
+ declare const ImageChipCell: ({ handleClick, imagePath, isExpanded, registryType }: ImageChipCellProps) => JSX.Element;
4
+ export default ImageChipCell;
@@ -0,0 +1,2 @@
1
+ export { default as ImageChipCell } from './ImageChipCell.component';
2
+ export type { ImageChipCellProps } from './types';
@@ -0,0 +1,9 @@
1
+ import { RegistryType } from '../../types';
2
+ import { SyntheticEvent } from 'react';
3
+
4
+ export interface ImageChipCellProps {
5
+ handleClick: (e: SyntheticEvent) => void;
6
+ imagePath: string;
7
+ isExpanded: boolean;
8
+ registryType: RegistryType;
9
+ }
@@ -0,0 +1,4 @@
1
+ import { MaterialHistoryProps } from './types';
2
+
3
+ declare const MaterialHistory: ({ material, pipelineName, ciPipelineId, selectCommit }: MaterialHistoryProps) => JSX.Element;
4
+ export default MaterialHistory;
@@ -0,0 +1,2 @@
1
+ export { default as MaterialHistory } from './MaterialHistory.component';
2
+ export type { MaterialHistoryProps } from './types';
@@ -0,0 +1,8 @@
1
+ import { CIMaterialType } from '../../Services/app.types';
2
+
3
+ export interface MaterialHistoryProps {
4
+ material: CIMaterialType;
5
+ pipelineName: string;
6
+ ciPipelineId?: string;
7
+ selectCommit?: (materialId: string, commit: string, ciPipelineId?: string) => void;
8
+ }
@@ -24,4 +24,8 @@ export * from './FeatureDescription';
24
24
  export * from './CICDHistory';
25
25
  export * from './GitCommitInfoGeneric';
26
26
  export * from './Error';
27
+ export * from './CommitChipCell';
28
+ export * from './ImageChipCell';
29
+ export * from './ArtifactInfoModal';
30
+ export * from './MaterialHistory';
27
31
  export * from './IframeContainer';
@@ -0,0 +1,7 @@
1
+ import { CIMaterialInfoType, GetCITriggerInfoParamsType } from './app.types';
2
+
3
+ export declare const getCITriggerInfo: (params: GetCITriggerInfoParamsType) => Promise<CIMaterialInfoType>;
4
+ /**
5
+ * The only difference between this and getCITriggerInfo is it doesn't have env and trigger related meta info
6
+ */
7
+ export declare const getArtifactInfo: (params: Pick<GetCITriggerInfoParamsType, 'ciArtifactId'>) => Promise<CIMaterialInfoType>;
@@ -0,0 +1,96 @@
1
+ import { ReleaseTag } from '../../Common';
2
+
3
+ interface WebhookDataType {
4
+ id: number;
5
+ eventActionType: string;
6
+ data: any;
7
+ }
8
+ interface MaterialHistoryDTO {
9
+ Commit: string;
10
+ Author: string;
11
+ Date: string;
12
+ Message: string;
13
+ Changes: unknown[];
14
+ WebhookData: WebhookDataType;
15
+ }
16
+ interface MaterialHistoryType {
17
+ commitURL: string;
18
+ commit: MaterialHistoryDTO['Commit'];
19
+ author: MaterialHistoryDTO['Author'];
20
+ date: MaterialHistoryDTO['Date'];
21
+ message: MaterialHistoryDTO['Message'];
22
+ changes: MaterialHistoryDTO['Changes'];
23
+ webhookData: MaterialHistoryDTO['WebhookData'];
24
+ showChanges: boolean;
25
+ isSelected: boolean;
26
+ excluded?: boolean;
27
+ }
28
+ interface CIMaterialDTO {
29
+ id: number;
30
+ gitMaterialId: number;
31
+ gitMaterialName: string;
32
+ type: string;
33
+ value: string;
34
+ active: boolean;
35
+ history: MaterialHistoryDTO[];
36
+ lastFetchTime: string;
37
+ url: string;
38
+ }
39
+ interface CIMaterialMetaType {
40
+ isRepoError?: boolean;
41
+ repoErrorMsg?: string;
42
+ isBranchError?: boolean;
43
+ branchErrorMsg?: string;
44
+ isMaterialLoading?: boolean;
45
+ regex?: string;
46
+ searchText?: string;
47
+ noSearchResultsMsg?: string;
48
+ noSearchResult?: boolean;
49
+ isRegex?: boolean;
50
+ isDockerFileError?: boolean;
51
+ dockerFileErrorMsg?: string;
52
+ showAllCommits?: boolean;
53
+ isMaterialSelectionError?: boolean;
54
+ materialSelectionErrorMsg?: string;
55
+ }
56
+ export interface CIMaterialType extends Pick<CIMaterialDTO, 'id' | 'gitMaterialId' | 'gitMaterialName' | 'type' | 'value' | 'active' | 'lastFetchTime'>, CIMaterialMetaType {
57
+ gitURL: CIMaterialDTO['url'];
58
+ history: MaterialHistoryType[];
59
+ isSelected: boolean;
60
+ }
61
+ interface ImageCommentDTO {
62
+ id: number;
63
+ comment: string;
64
+ artifactId: number;
65
+ }
66
+ interface ImageCommentType extends ImageCommentDTO {
67
+ }
68
+ interface ImageTaggingDataDTO {
69
+ imageReleaseTags: ReleaseTag[];
70
+ appReleaseTags: string[];
71
+ imageComment: ImageCommentDTO;
72
+ tagsEditable: boolean;
73
+ }
74
+ interface ImageTaggingDataType extends Pick<ImageTaggingDataDTO, 'imageReleaseTags' | 'appReleaseTags' | 'tagsEditable'> {
75
+ imageComment: ImageCommentType;
76
+ }
77
+ export interface CIMaterialInfoDTO {
78
+ ciPipelineId: number;
79
+ ciMaterials: CIMaterialDTO[];
80
+ triggeredByEmail: string;
81
+ lastDeployedTime: string;
82
+ appId: number;
83
+ appName: string;
84
+ environmentId: number;
85
+ environmentName: string;
86
+ imageTaggingData: ImageTaggingDataDTO;
87
+ image: string;
88
+ }
89
+ export interface CIMaterialInfoType extends Pick<CIMaterialInfoDTO, 'triggeredByEmail' | 'lastDeployedTime' | 'appId' | 'appName' | 'environmentId' | 'environmentName' | 'image' | 'ciPipelineId'>, ImageTaggingDataType {
90
+ materials: CIMaterialType[];
91
+ }
92
+ export interface GetCITriggerInfoParamsType {
93
+ envId: number | string;
94
+ ciArtifactId: number | string;
95
+ }
96
+ export {};
@@ -1,2 +1,4 @@
1
1
  export * from './types';
2
+ export * from './app.types';
3
+ export * from './app.service';
2
4
  export * from './common.service';
@@ -0,0 +1,3 @@
1
+ import { CIMaterialInfoDTO, CIMaterialInfoType } from './app.types';
2
+
3
+ export declare const getParsedCIMaterialInfo: (ciMaterialData: CIMaterialInfoDTO) => CIMaterialInfoType;