@devtron-labs/devtron-fe-common-lib 0.1.11-beta-1 → 0.1.11-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.
- package/dist/Common/CIPipeline.Types.d.ts +10 -0
- package/dist/Common/CodeEditor/types.d.ts +1 -0
- package/dist/Common/Constants.d.ts +0 -4
- package/dist/Common/Helper.d.ts +0 -4
- package/dist/Common/Policy.Types.d.ts +0 -8
- package/dist/Common/RJSF/templates/ArrayFieldItemTemplate.d.ts +1 -1
- package/dist/Common/RJSF/templates/ObjectFieldTemplate.d.ts +1 -2
- package/dist/Common/RJSF/types.d.ts +0 -12
- package/dist/Common/RJSF/utils.d.ts +2 -2
- package/dist/Common/Types.d.ts +1 -1
- package/dist/Common/index.d.ts +0 -1
- package/dist/Pages/GlobalConfigurations/Authorization/index.d.ts +1 -1
- package/dist/Pages/GlobalConfigurations/Authorization/types.d.ts +19 -1
- package/dist/Shared/Components/CICDHistory/DetectBottom.d.ts +4 -0
- package/dist/Shared/Components/FeatureDescription/FeatureTitleWithInfo.d.ts +1 -1
- package/dist/Shared/Components/FeatureDescription/types.d.ts +2 -7
- package/dist/Shared/Components/FilterChips/FilterChips.component.d.ts +1 -1
- package/dist/Shared/Components/FilterChips/types.d.ts +19 -12
- package/dist/Shared/Components/ReactSelect/utils.d.ts +1 -5
- package/dist/Shared/Components/index.d.ts +0 -1
- package/dist/Shared/Hooks/index.d.ts +1 -0
- package/dist/Shared/Hooks/useGetResourceKindsOptions/index.d.ts +2 -0
- package/dist/Shared/Hooks/useGetResourceKindsOptions/service.d.ts +9 -0
- package/dist/Shared/Hooks/useGetResourceKindsOptions/types.d.ts +31 -0
- package/dist/Shared/Hooks/useGetResourceKindsOptions/useGetResourceKindsOptions.d.ts +16 -0
- package/dist/Shared/Hooks/useGetResourceKindsOptions/utils.d.ts +4 -0
- package/dist/Shared/Services/common.service.d.ts +3 -2
- package/dist/Shared/Services/types.d.ts +15 -4
- package/dist/Shared/types.d.ts +8 -20
- package/dist/assets/index.css +1 -1
- package/dist/{cssMode-984ba35b.js → cssMode-c3b49a22.js} +1 -1
- package/dist/{freemarker2-1a341ac5.js → freemarker2-a23b547d.js} +1 -1
- package/dist/{handlebars-6e7e98c9.js → handlebars-3ab70804.js} +1 -1
- package/dist/{html-01969f5d.js → html-173d6f4b.js} +1 -1
- package/dist/{htmlMode-3fed92f2.js → htmlMode-cd5b4e94.js} +1 -1
- package/dist/{index-184343e1.js → index-08e72af8.js} +30784 -33379
- package/dist/index.js +405 -420
- package/dist/{javascript-a4c5d186.js → javascript-7dfc1aae.js} +1 -1
- package/dist/{jsonMode-78d67b0c.js → jsonMode-e4e3bb06.js} +1 -1
- package/dist/{liquid-c7b81dc3.js → liquid-35bd99b6.js} +1 -1
- package/dist/{mdx-690feaa9.js → mdx-20526694.js} +1 -1
- package/dist/{python-39045491.js → python-1ffe9348.js} +1 -1
- package/dist/{razor-e5c7d1d5.js → razor-00e603a8.js} +1 -1
- package/dist/{tsMode-e8d94dba.js → tsMode-83f263b7.js} +1 -1
- package/dist/{typescript-b94c1598.js → typescript-c9eff357.js} +1 -1
- package/dist/{xml-4c9d7525.js → xml-2b6d8024.js} +1 -1
- package/dist/{yaml-e010f4d2.js → yaml-3c4eb3e1.js} +1 -1
- package/package.json +2 -3
- package/dist/Common/Tippy.d.ts +0 -4
- package/dist/Shared/Components/DetectBottom/DetectBottom.component.d.ts +0 -5
- package/dist/Shared/Components/DetectBottom/index.d.ts +0 -1
- package/dist/Shared/Components/Plugin/PluginCard.d.ts +0 -4
- package/dist/Shared/Components/Plugin/PluginCardSkeletonList.d.ts +0 -4
- package/dist/Shared/Components/Plugin/PluginImageContainer.d.ts +0 -4
- package/dist/Shared/Components/Plugin/PluginList.d.ts +0 -4
- package/dist/Shared/Components/Plugin/PluginListContainer.d.ts +0 -4
- package/dist/Shared/Components/Plugin/PluginTagSelect.d.ts +0 -4
- package/dist/Shared/Components/Plugin/PluginTagsContainer.d.ts +0 -4
- package/dist/Shared/Components/Plugin/constants.d.ts +0 -5
- package/dist/Shared/Components/Plugin/index.d.ts +0 -7
- package/dist/Shared/Components/Plugin/service.d.ts +0 -5
- package/dist/Shared/Components/Plugin/types.d.ts +0 -180
- package/dist/Shared/Components/Plugin/utils.d.ts +0 -20
|
@@ -252,4 +252,14 @@ export interface FormErrorObjectType {
|
|
|
252
252
|
steps: TaskErrorObj[];
|
|
253
253
|
};
|
|
254
254
|
}
|
|
255
|
+
export interface PluginDetailType {
|
|
256
|
+
id: number;
|
|
257
|
+
name: string;
|
|
258
|
+
type: string;
|
|
259
|
+
description: string;
|
|
260
|
+
icon: string;
|
|
261
|
+
tags: string[];
|
|
262
|
+
inputVariables?: VariableType[];
|
|
263
|
+
outputVariables?: VariableType[];
|
|
264
|
+
}
|
|
255
265
|
export {};
|
|
@@ -9,7 +9,6 @@ export declare const DOCUMENTATION: {
|
|
|
9
9
|
APP_TAGS: string;
|
|
10
10
|
APP_OVERVIEW_TAGS: string;
|
|
11
11
|
BLOB_STORAGE: string;
|
|
12
|
-
GLOBAL_CONFIG_BUILD_INFRA: string;
|
|
13
12
|
};
|
|
14
13
|
export declare const PATTERNS: {
|
|
15
14
|
KUBERNETES_KEY_PREFIX: RegExp;
|
|
@@ -75,9 +74,6 @@ export declare const ROUTES: {
|
|
|
75
74
|
CONFIG_CD_PIPELINE: string;
|
|
76
75
|
MODULE_CONFIGURED: string;
|
|
77
76
|
RESOURCE_HISTORY_DEPLOYMENT: string;
|
|
78
|
-
PLUGIN_GLOBAL_LIST_DETAIL_V2: string;
|
|
79
|
-
PLUGIN_GLOBAL_LIST_V2: string;
|
|
80
|
-
PLUGIN_GLOBAL_LIST_TAGS: string;
|
|
81
77
|
};
|
|
82
78
|
export declare enum KEY_VALUE {
|
|
83
79
|
KEY = "key",
|
package/dist/Common/Helper.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { default as React, SyntheticEvent } from 'react';
|
|
2
|
-
import { JSONPathOptions } from 'jsonpath-plus';
|
|
3
2
|
import { AsyncOptions, UseSearchString } from './Types';
|
|
4
3
|
import { scrollableInterface } from '../Shared';
|
|
5
4
|
|
|
@@ -95,9 +94,6 @@ export declare const getRegexMatchPositions: (string: string, regex: RegExp) =>
|
|
|
95
94
|
* @returns set of substrings
|
|
96
95
|
*/
|
|
97
96
|
export declare const powerSetOfSubstringsFromStart: (strings: string[], regex: RegExp) => string[];
|
|
98
|
-
export declare const convertJSONPointerToJSONPath: (pointer: string) => string;
|
|
99
|
-
export declare const flatMapOfJSONPaths: (paths: string[], json: object, resultType?: JSONPathOptions['resultType']) => string[];
|
|
100
|
-
export declare const applyCompareDiffOnUneditedDocument: (uneditedDocument: object, editedDocument: object) => object;
|
|
101
97
|
/**
|
|
102
98
|
* Returns a debounced variant of the function
|
|
103
99
|
*/
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import { PluginDataStoreType } from '../Shared';
|
|
2
1
|
import { VariableType } from './CIPipeline.Types';
|
|
3
|
-
import { ServerErrors } from './ServerError';
|
|
4
2
|
import { ResponseType } from './Types';
|
|
5
3
|
|
|
6
4
|
export declare enum ApplyPolicyToStage {
|
|
@@ -26,7 +24,6 @@ export interface DefinitionSourceType {
|
|
|
26
24
|
}
|
|
27
25
|
export interface MandatoryPluginDetailType {
|
|
28
26
|
id: number;
|
|
29
|
-
parentPluginId: number;
|
|
30
27
|
icon: string;
|
|
31
28
|
name: string;
|
|
32
29
|
description?: string;
|
|
@@ -41,11 +38,6 @@ export interface MandatoryPluginDataType {
|
|
|
41
38
|
isValidPre: boolean;
|
|
42
39
|
isValidPost: boolean;
|
|
43
40
|
}
|
|
44
|
-
export interface ProcessPluginDataReturnType {
|
|
45
|
-
mandatoryPluginData: MandatoryPluginDataType;
|
|
46
|
-
pluginDataStore: PluginDataStoreType;
|
|
47
|
-
mandatoryPluginsError?: ServerErrors;
|
|
48
|
-
}
|
|
49
41
|
export declare enum ConsequenceAction {
|
|
50
42
|
BLOCK = "BLOCK",
|
|
51
43
|
ALLOW_UNTIL_TIME = "ALLOW_UNTIL_TIME",
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { ArrayFieldTemplateItemType } from '@rjsf/utils';
|
|
2
2
|
|
|
3
|
-
export declare const ArrayFieldItemTemplate: ({ children, disabled, hasToolbar, hasRemove, index, onDropIndexClick, readonly, registry, uiSchema, }: ArrayFieldTemplateItemType) => JSX.Element;
|
|
3
|
+
export declare const ArrayFieldItemTemplate: ({ children, className, disabled, hasToolbar, hasRemove, index, onDropIndexClick, readonly, registry, uiSchema, }: ArrayFieldTemplateItemType) => JSX.Element;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
import { ObjectFieldTemplateProps } from '@rjsf/utils';
|
|
2
|
-
import { RJSFFormSchema } from '../types';
|
|
3
2
|
|
|
4
|
-
export declare const ObjectFieldTemplate: (props: ObjectFieldTemplateProps
|
|
3
|
+
export declare const ObjectFieldTemplate: (props: ObjectFieldTemplateProps) => JSX.Element;
|
|
@@ -1,16 +1,4 @@
|
|
|
1
1
|
import { ComponentProps } from 'react';
|
|
2
2
|
import { default as RJSFForm } from '@rjsf/core';
|
|
3
|
-
import { StrictRJSFSchema } from '@rjsf/utils';
|
|
4
3
|
|
|
5
4
|
export type FormProps = Omit<ComponentProps<typeof RJSFForm>, 'validator'>;
|
|
6
|
-
interface Hidden {
|
|
7
|
-
condition: boolean;
|
|
8
|
-
match: string;
|
|
9
|
-
}
|
|
10
|
-
export interface RJSFFormSchema extends StrictRJSFSchema {
|
|
11
|
-
properties: {
|
|
12
|
-
[key: string]: RJSFFormSchema;
|
|
13
|
-
};
|
|
14
|
-
hidden: Hidden;
|
|
15
|
-
}
|
|
16
|
-
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TranslatableString } from '@rjsf/utils';
|
|
2
|
-
import { default as Tippy } from '
|
|
2
|
+
import { default as Tippy } from '@tippyjs/react';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Override for the TranslatableString from RJSF
|
|
@@ -25,4 +25,4 @@ export declare const getRedirectionProps: (url: string) => import('react').Ancho
|
|
|
25
25
|
* Infers the type for json schema from value type
|
|
26
26
|
*/
|
|
27
27
|
export declare const getInferredTypeFromValueType: (value: any) => "string" | "number" | "boolean" | "object" | "array" | "null";
|
|
28
|
-
export declare const getTippyWrapperWithContent: (content: any, placement?: React.ComponentProps<typeof Tippy>['placement']
|
|
28
|
+
export declare const getTippyWrapperWithContent: (content: any, placement?: React.ComponentProps<typeof Tippy>['placement']) => (children: any) => JSX.Element;
|
package/dist/Common/Types.d.ts
CHANGED
package/dist/Common/index.d.ts
CHANGED
|
@@ -1,6 +1,24 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { SortingParams } from '../../../Common/Types';
|
|
2
2
|
import { UserListSortableKeys, UserStatus } from './constants';
|
|
3
3
|
|
|
4
|
+
export type BaseFilterQueryParams<T> = {
|
|
5
|
+
/**
|
|
6
|
+
* Offset for the list result
|
|
7
|
+
*/
|
|
8
|
+
offset?: number;
|
|
9
|
+
/**
|
|
10
|
+
* Number of items required in the list
|
|
11
|
+
*/
|
|
12
|
+
size?: number;
|
|
13
|
+
/**
|
|
14
|
+
* Search string (if any)
|
|
15
|
+
*/
|
|
16
|
+
searchKey?: string;
|
|
17
|
+
/**
|
|
18
|
+
* If true, all items are returned with any search / filtering applied without pagination
|
|
19
|
+
*/
|
|
20
|
+
showAll?: boolean;
|
|
21
|
+
} & SortingParams<T>;
|
|
4
22
|
export type UserListFilterParams = BaseFilterQueryParams<UserListSortableKeys> & {
|
|
5
23
|
/**
|
|
6
24
|
* Selected statuses (if any)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { DescriptorProps } from './types';
|
|
2
2
|
|
|
3
|
-
declare const FeatureTitleWithInfo: ({ additionalContainerClasses, breadCrumbs, children, iconClassName, title, renderDescriptionContent, closeModalText, docLink, SVGImage,
|
|
3
|
+
declare const FeatureTitleWithInfo: ({ additionalContainerClasses, breadCrumbs, children, iconClassName, title, renderDescriptionContent, closeModalText, docLink, SVGImage, }: DescriptorProps) => JSX.Element;
|
|
4
4
|
export default FeatureTitleWithInfo;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { default as React, ReactNode } from 'react';
|
|
2
1
|
import { ImageType } from '../../../Common';
|
|
3
2
|
import { Breadcrumb } from '../../../Common/BreadCrumb/Types';
|
|
4
3
|
|
|
5
4
|
export interface FeatureDescriptionModalProps {
|
|
6
5
|
title: string;
|
|
7
|
-
renderDescriptionContent?: () =>
|
|
6
|
+
renderDescriptionContent?: () => JSX.Element;
|
|
8
7
|
closeModalText?: string;
|
|
9
8
|
docLink?: string;
|
|
10
9
|
closeModal?: () => void;
|
|
@@ -13,12 +12,8 @@ export interface FeatureDescriptionModalProps {
|
|
|
13
12
|
imageStyles?: React.CSSProperties;
|
|
14
13
|
}
|
|
15
14
|
export interface DescriptorProps extends FeatureDescriptionModalProps {
|
|
16
|
-
breadCrumbs
|
|
15
|
+
breadCrumbs: Breadcrumb[];
|
|
17
16
|
additionalContainerClasses?: string;
|
|
18
17
|
iconClassName?: string;
|
|
19
18
|
children?: React.ReactNode;
|
|
20
|
-
showInfoIconTippy?: boolean;
|
|
21
|
-
docLinkText?: string;
|
|
22
|
-
dataTestId?: string;
|
|
23
|
-
additionalContent?: ReactNode;
|
|
24
19
|
}
|
|
@@ -3,5 +3,5 @@ import { FilterChipsProps } from './types';
|
|
|
3
3
|
/**
|
|
4
4
|
* Component for rendering the applied filter chips
|
|
5
5
|
*/
|
|
6
|
-
declare const FilterChips: <T = Record<string, unknown>>({ filterConfig, clearFilters, onRemoveFilter, getFormattedLabel, getFormattedValue, className, clearButtonClassName,
|
|
6
|
+
declare const FilterChips: <T = Record<string, unknown>>({ filterConfig, clearFilters, onRemoveFilter, getFormattedLabel, getFormattedValue, className, clearButtonClassName, showClearAndRemove, }: FilterChipsProps<T>) => JSX.Element;
|
|
7
7
|
export default FilterChips;
|
|
@@ -4,7 +4,7 @@ export interface FilterChipProps {
|
|
|
4
4
|
/**
|
|
5
5
|
* Filter label
|
|
6
6
|
*/
|
|
7
|
-
label
|
|
7
|
+
label: string;
|
|
8
8
|
/**
|
|
9
9
|
* Corresponding value of the filter
|
|
10
10
|
*/
|
|
@@ -21,17 +21,28 @@ export interface FilterChipProps {
|
|
|
21
21
|
* If passed, the label will be formatted accordingly
|
|
22
22
|
*/
|
|
23
23
|
getFormattedValue?: (filterKey: string, filterValue: unknown) => ReactNode;
|
|
24
|
-
|
|
25
|
-
* If true, would hide the label
|
|
26
|
-
* @default false
|
|
27
|
-
*/
|
|
28
|
-
shouldHideLabel?: boolean;
|
|
24
|
+
showRemoveIcon: boolean;
|
|
29
25
|
}
|
|
30
|
-
export
|
|
26
|
+
export type FilterChipsProps<T = Record<string, unknown>> = Pick<FilterChipProps, 'getFormattedLabel' | 'getFormattedValue'> & {
|
|
31
27
|
/**
|
|
32
28
|
* Current filter configuration
|
|
33
29
|
*/
|
|
34
30
|
filterConfig: T;
|
|
31
|
+
/**
|
|
32
|
+
* Class name for the container
|
|
33
|
+
*/
|
|
34
|
+
className?: string;
|
|
35
|
+
} & ({
|
|
36
|
+
/**
|
|
37
|
+
* If false, anything related to removing filters is not shown
|
|
38
|
+
* @default 'true'
|
|
39
|
+
*/
|
|
40
|
+
showClearAndRemove: false;
|
|
41
|
+
clearFilters?: never;
|
|
42
|
+
onRemoveFilter?: never;
|
|
43
|
+
clearButtonClassName?: never;
|
|
44
|
+
} | {
|
|
45
|
+
showClearAndRemove?: true;
|
|
35
46
|
/**
|
|
36
47
|
* Callback handler for removing the filters
|
|
37
48
|
*/
|
|
@@ -40,12 +51,8 @@ export interface FilterChipsProps<T = Record<string, unknown>> extends Pick<Filt
|
|
|
40
51
|
* Handler for removing a applied filter
|
|
41
52
|
*/
|
|
42
53
|
onRemoveFilter: (filterConfig: T) => void;
|
|
43
|
-
/**
|
|
44
|
-
* Class name for the container
|
|
45
|
-
*/
|
|
46
|
-
className?: string;
|
|
47
54
|
/**
|
|
48
55
|
* Class name for the clear filter button
|
|
49
56
|
*/
|
|
50
57
|
clearButtonClassName?: string;
|
|
51
|
-
}
|
|
58
|
+
});
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { MenuListProps
|
|
2
|
-
import { OptionType } from '../../../Common';
|
|
1
|
+
import { MenuListProps } from 'react-select';
|
|
3
2
|
|
|
4
3
|
export declare const getCommonSelectStyle: (styleOverrides?: {}) => {
|
|
5
4
|
container: (base: any, state: any) => any;
|
|
@@ -34,6 +33,3 @@ export declare const commonSelectStyles: {
|
|
|
34
33
|
export declare const MenuListWithApplyButton: ({ handleApplyFilter, ...props }: MenuListProps<unknown, boolean, import('react-select').GroupBase<unknown>> & {
|
|
35
34
|
handleApplyFilter: () => void;
|
|
36
35
|
}) => JSX.Element;
|
|
37
|
-
export declare const MultiSelectValueContainer: ({ title, ...props }: ValueContainerProps<OptionType<string, string>, true, import('react-select').GroupBase<OptionType<string, string>>> & {
|
|
38
|
-
title: string;
|
|
39
|
-
}) => JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Teams } from '../../../Common/Types';
|
|
2
|
+
import { ClusterType } from '../../Services';
|
|
3
|
+
import { EnvironmentType } from '../../types';
|
|
4
|
+
import { AppsGroupedByProjectsType } from './types';
|
|
5
|
+
|
|
6
|
+
export declare const getAppOptionsGroupedByProjects: () => Promise<AppsGroupedByProjectsType>;
|
|
7
|
+
export declare const getProjectOptions: () => Promise<Pick<Teams, 'id' | 'name'>[]>;
|
|
8
|
+
export declare const getClusterOptions: () => Promise<ClusterType[]>;
|
|
9
|
+
export declare const getEnvironmentOptions: () => Promise<EnvironmentType[]>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ResourceKindType } from '../../types';
|
|
2
|
+
import { ServerErrors } from '../../../Common/ServerError';
|
|
3
|
+
import { getAppOptionsGroupedByProjects, getClusterOptions, getEnvironmentOptions, getProjectOptions } from './service';
|
|
4
|
+
|
|
5
|
+
export interface AppType {
|
|
6
|
+
name: string;
|
|
7
|
+
}
|
|
8
|
+
export type AppsGroupedByProjectsType = {
|
|
9
|
+
projectId: number;
|
|
10
|
+
projectName: string;
|
|
11
|
+
appList: AppType[];
|
|
12
|
+
}[];
|
|
13
|
+
export interface ClusterDTO {
|
|
14
|
+
id: number;
|
|
15
|
+
cluster_name: string;
|
|
16
|
+
isVirtualCluster: boolean;
|
|
17
|
+
}
|
|
18
|
+
export interface UseGetResourceKindsOptionsProps {
|
|
19
|
+
resourcesToFetch: Extract<ResourceKindType, ResourceKindType.devtronApplication | ResourceKindType.project | ResourceKindType.cluster | ResourceKindType.environment>[];
|
|
20
|
+
}
|
|
21
|
+
export interface UseGetResourceKindOptionsReturnType {
|
|
22
|
+
isResourcesOptionsLoading: boolean;
|
|
23
|
+
resourcesOptionsMap: {
|
|
24
|
+
[ResourceKindType.devtronApplication]: Awaited<ReturnType<typeof getAppOptionsGroupedByProjects>>;
|
|
25
|
+
[ResourceKindType.project]: Awaited<ReturnType<typeof getProjectOptions>>;
|
|
26
|
+
[ResourceKindType.cluster]: Awaited<ReturnType<typeof getClusterOptions>>;
|
|
27
|
+
[ResourceKindType.environment]: Awaited<ReturnType<typeof getEnvironmentOptions>>;
|
|
28
|
+
};
|
|
29
|
+
resourcesOptionsError: ServerErrors;
|
|
30
|
+
refetchResourcesOptions: () => void;
|
|
31
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { UseGetResourceKindOptionsReturnType, UseGetResourceKindsOptionsProps } from './types';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Generic hook to fetch the options list for the supported resource kinds.
|
|
5
|
+
*
|
|
6
|
+
* Note: no call would be made for empty resource kind list
|
|
7
|
+
*
|
|
8
|
+
* @example Usage
|
|
9
|
+
* ```tsx
|
|
10
|
+
* const data = useGetResourceKindsOptions({
|
|
11
|
+
* resourcesToFetch: [ResourceKindType.devtronApplication, ResourceKindType.environment]
|
|
12
|
+
* })
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
declare const useGetResourceKindsOptions: ({ resourcesToFetch, }: UseGetResourceKindsOptionsProps) => UseGetResourceKindOptionsReturnType;
|
|
16
|
+
export default useGetResourceKindsOptions;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ResourceKindType } from '../../types';
|
|
2
|
+
import { UseGetResourceKindsOptionsProps } from './types';
|
|
3
|
+
|
|
4
|
+
export declare const getResourcesToFetchMap: (resourcesToFetch: UseGetResourceKindsOptionsProps['resourcesToFetch']) => Record<ResourceKindType.devtronApplication | ResourceKindType.cluster | ResourceKindType.environment | ResourceKindType.project, boolean>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import { GetResourceApiUrlProps } from './types';
|
|
1
|
+
import { GetPolicyApiUrlProps, GetResourceApiUrlProps } from './types';
|
|
2
2
|
|
|
3
|
-
export declare const getResourceApiUrl: <T>({ baseUrl, kind, version, queryParams }: GetResourceApiUrlProps<T>) => string;
|
|
3
|
+
export declare const getResourceApiUrl: <T>({ baseUrl, kind, version, suffix, queryParams }: GetResourceApiUrlProps<T>) => string;
|
|
4
|
+
export declare const getPolicyApiUrl: <T>({ kind, version, queryParams, suffix }: GetPolicyApiUrlProps<T>) => string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getUrlWithSearchParams } from '../../Common';
|
|
2
|
-
import { ResourceKindType, ResourceVersionType } from '../types';
|
|
2
|
+
import { PolicyKindType, ResourceKindType, ResourceVersionType } from '../types';
|
|
3
3
|
|
|
4
4
|
export interface ClusterType {
|
|
5
5
|
id: number;
|
|
@@ -9,9 +9,20 @@ export interface ClusterType {
|
|
|
9
9
|
*/
|
|
10
10
|
isVirtual: boolean;
|
|
11
11
|
}
|
|
12
|
-
|
|
12
|
+
/**
|
|
13
|
+
* T => Type of query params
|
|
14
|
+
* K => Type of kind
|
|
15
|
+
* P => Type of version
|
|
16
|
+
*/
|
|
17
|
+
interface BaseGetApiUrlProps<T, K extends ResourceKindType | PolicyKindType, P extends ResourceVersionType> {
|
|
13
18
|
baseUrl: string;
|
|
14
|
-
kind:
|
|
15
|
-
version:
|
|
19
|
+
kind: K;
|
|
20
|
+
version: P;
|
|
21
|
+
suffix?: string;
|
|
16
22
|
queryParams?: T extends Parameters<typeof getUrlWithSearchParams>[1] ? T : never;
|
|
17
23
|
}
|
|
24
|
+
export interface GetResourceApiUrlProps<T> extends BaseGetApiUrlProps<T, ResourceKindType, ResourceVersionType> {
|
|
25
|
+
}
|
|
26
|
+
export interface GetPolicyApiUrlProps<T> extends Omit<BaseGetApiUrlProps<T, PolicyKindType, ResourceVersionType>, 'baseUrl'> {
|
|
27
|
+
}
|
|
28
|
+
export {};
|
package/dist/Shared/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { OptionType, CommonNodeAttr, ResponseType, UserApprovalConfigType, VulnerabilityType, DeploymentAppTypes, ServerErrors
|
|
1
|
+
import { OptionType, CommonNodeAttr, ResponseType, UserApprovalConfigType, VulnerabilityType, DeploymentAppTypes, ServerErrors } from '../Common';
|
|
2
2
|
import { EnvironmentTypeEnum, PatchOperationType } from './constants';
|
|
3
3
|
|
|
4
4
|
export declare enum EnvType {
|
|
@@ -354,15 +354,21 @@ export declare enum ResourceKindType {
|
|
|
354
354
|
tenant = "tenant",
|
|
355
355
|
installation = "installation",
|
|
356
356
|
environment = "environment",
|
|
357
|
-
cdPipeline = "cd-pipeline"
|
|
357
|
+
cdPipeline = "cd-pipeline",
|
|
358
|
+
project = "project"
|
|
358
359
|
}
|
|
359
360
|
/**
|
|
360
361
|
* Versions support for the resources on BE
|
|
362
|
+
*
|
|
363
|
+
* TODO: Rename to ApiVersionType
|
|
361
364
|
*/
|
|
362
365
|
export declare enum ResourceVersionType {
|
|
363
366
|
v1 = "v1",
|
|
364
367
|
alpha1 = "alpha1"
|
|
365
368
|
}
|
|
369
|
+
export declare enum PolicyKindType {
|
|
370
|
+
lockConfiguration = "lock-configuration"
|
|
371
|
+
}
|
|
366
372
|
export interface LastExecutionResultType {
|
|
367
373
|
lastExecution: string;
|
|
368
374
|
severityCount: {
|
|
@@ -516,22 +522,4 @@ export interface BatchConfigType {
|
|
|
516
522
|
export interface scrollableInterface {
|
|
517
523
|
autoBottomScroll: boolean;
|
|
518
524
|
}
|
|
519
|
-
export type BaseFilterQueryParams<T> = {
|
|
520
|
-
/**
|
|
521
|
-
* Offset for the list result
|
|
522
|
-
*/
|
|
523
|
-
offset?: number;
|
|
524
|
-
/**
|
|
525
|
-
* Number of items required in the list
|
|
526
|
-
*/
|
|
527
|
-
size?: number;
|
|
528
|
-
/**
|
|
529
|
-
* Search string (if any)
|
|
530
|
-
*/
|
|
531
|
-
searchKey?: string;
|
|
532
|
-
/**
|
|
533
|
-
* If true, all items are returned with any search / filtering applied without pagination
|
|
534
|
-
*/
|
|
535
|
-
showAll?: boolean;
|
|
536
|
-
} & SortingParams<T>;
|
|
537
525
|
export {};
|