@prorobotech/openapi-k8s-toolkit 1.1.0-alpha.9 → 1.2.0-alpha.10
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/README.md +119 -0
- package/dist/openapi-k8s-toolkit.es.js +13172 -12249
- package/dist/openapi-k8s-toolkit.es.js.map +1 -1
- package/dist/openapi-k8s-toolkit.umd.js +13182 -12246
- package/dist/openapi-k8s-toolkit.umd.js.map +1 -1
- package/dist/types/api/bff/scopes/checkScopes.d.ts +6 -6
- package/dist/types/api/bff/scopes/filterScopes.d.ts +4 -4
- package/dist/types/api/bff/search/getKinds.d.ts +2 -2
- package/dist/types/api/bff/swagger/getSwagger.d.ts +2 -2
- package/dist/types/api/forms.d.ts +4 -0
- package/dist/types/api/getApiResource.d.ts +8 -8
- package/dist/types/api/getApiResourceTypes.d.ts +4 -4
- package/dist/types/api/getBuiltinResource.d.ts +8 -8
- package/dist/types/api/getBuiltinResourceTypes.d.ts +2 -2
- package/dist/types/api/getCrdData.d.ts +2 -2
- package/dist/types/api/getCrdResource.d.ts +5 -5
- package/dist/types/api/permissions.d.ts +4 -4
- package/dist/types/components/molecules/BlackholeForm/index.d.ts +0 -1
- package/dist/types/components/molecules/BlackholeForm/molecules/index.d.ts +0 -1
- package/dist/types/components/molecules/BlackholeForm/organisms/BlackholeForm/BlackholeForm.d.ts +3 -3
- package/dist/types/components/molecules/BlackholeForm/organisms/BlackholeFormProvider/BlackholeFormProvider.d.ts +3 -3
- package/dist/types/components/molecules/EnrichedTable/organisms/EnrichedTable/EnrichedTable.d.ts +2 -1
- package/dist/types/components/molecules/EnrichedTable/organisms/EnrichedTable/types.d.ts +2 -2
- package/dist/types/components/molecules/EnrichedTable/organisms/EnrichedTable/utils.d.ts +4 -2
- package/dist/types/components/molecules/EnrichedTable/organisms/EnrichedTableProvider/EnrichedTableProvider.d.ts +2 -2
- package/dist/types/components/molecules/EnrichedTable/organisms/EnrichedTableProvider/utils.d.ts +1 -1
- package/dist/types/components/molecules/Events/Events.d.ts +2 -2
- package/dist/types/components/molecules/ManageableSidebar/organisms/ManageableSidebarProvider/ManageableSidebarProvider.d.ts +1 -0
- package/dist/types/components/molecules/ManageableSidebar/organisms/ManageableSidebarProvider/utils.d.ts +2 -1
- package/dist/types/components/molecules/MarketPlace/MarketPlace.d.ts +3 -3
- package/dist/types/components/molecules/MarketPlace/molecules/AddEditFormModal/AddEditFormModal.d.ts +3 -3
- package/dist/types/components/molecules/MarketPlace/molecules/MarketplaceCard/MarketplaceCard.d.ts +1 -1
- package/dist/types/components/molecules/MarketPlace/molecules/MarketplaceCard/utils.d.ts +9 -9
- package/dist/types/components/molecules/ProjectInfoCard/ProjectInfoCard.d.ts +3 -3
- package/dist/types/components/molecules/{BlackholeForm/molecules/YamlEditorSingleton → YamlEditorSingleton}/YamlEditorSingleton.d.ts +2 -2
- package/dist/types/components/molecules/index.d.ts +2 -1
- package/dist/types/components/organisms/DynamicComponents/molecules/ConverterBytes/ConverterBytes.d.ts +13 -0
- package/dist/types/components/organisms/DynamicComponents/molecules/ConverterCores/ConverterCores.d.ts +19 -0
- package/dist/types/components/organisms/DynamicComponents/molecules/ConverterCores/index.d.ts +1 -0
- package/dist/types/components/organisms/DynamicComponents/molecules/OwnerRefs/organsisms/RefsList/RefsList.d.ts +3 -2
- package/dist/types/components/organisms/DynamicComponents/molecules/OwnerRefs/organsisms/RefsList/molecules/RefElement/RefElement.d.ts +1 -0
- package/dist/types/components/organisms/DynamicComponents/molecules/PrometheusGraph/MemoryChart.d.ts +6 -0
- package/dist/types/components/organisms/DynamicComponents/molecules/PrometheusGraph/MemoryChartMulti.d.ts +6 -0
- package/dist/types/components/organisms/DynamicComponents/molecules/PrometheusGraph/hooks/usePrometheusQueryRange.d.ts +7 -0
- package/dist/types/components/organisms/DynamicComponents/molecules/PrometheusGraph/hooks/usePrometheusQueryRangeMulti.d.ts +7 -0
- package/dist/types/components/organisms/DynamicComponents/molecules/PrometheusGraph/utils/prometheus.d.ts +10 -0
- package/dist/types/components/organisms/DynamicComponents/molecules/PrometheusGraph/utils/prometheus.test.d.ts +1 -0
- package/dist/types/components/organisms/DynamicComponents/molecules/PrometheusGraph/utils/prometheusAdapter.d.ts +21 -0
- package/dist/types/components/organisms/DynamicComponents/molecules/Toggler/Toggler.d.ts +6 -0
- package/dist/types/components/organisms/DynamicComponents/molecules/Toggler/index.d.ts +1 -0
- package/dist/types/components/organisms/DynamicComponents/molecules/TogglerSegmented/TogglerSegmented.d.ts +6 -0
- package/dist/types/components/organisms/DynamicComponents/molecules/TogglerSegmented/index.d.ts +1 -0
- package/dist/types/components/organisms/DynamicComponents/molecules/index.d.ts +3 -0
- package/dist/types/components/organisms/DynamicComponents/molecules/utils.d.ts +2 -1
- package/dist/types/components/organisms/DynamicComponents/molecules/utils.test.d.ts +1 -0
- package/dist/types/components/organisms/DynamicComponents/types.d.ts +89 -20
- package/dist/types/hooks/useApiResource.d.ts +8 -8
- package/dist/types/hooks/useApisResourceTypes.d.ts +4 -4
- package/dist/types/hooks/useBuiltinResource.d.ts +8 -8
- package/dist/types/hooks/useBuiltinResourceTypes.d.ts +2 -2
- package/dist/types/hooks/useCrdData.d.ts +2 -2
- package/dist/types/hooks/useCrdResource.d.ts +5 -5
- package/dist/types/hooks/useK8sSmartResource/index.d.ts +4 -0
- package/dist/types/hooks/useK8sSmartResource/useK8sSmartResource.d.ts +29 -0
- package/dist/types/hooks/{useK8sSmartResource.d.ts → useK8sSmartResource/useK8sSmartResourceWithoutKinds.d.ts} +5 -4
- package/dist/types/hooks/useK8sSmartResource/useManyK8sSmartResource.d.ts +18 -0
- package/dist/types/hooks/useK8sSmartResource/useSmartResourceParams.d.ts +9 -0
- package/dist/types/hooks/useListThenWatch/useListWatch.d.ts +1 -0
- package/dist/types/hooks/usePermissions.d.ts +4 -4
- package/dist/types/hooks/useResourceScope/index.d.ts +1 -0
- package/dist/types/hooks/useResourceScope/useResourceScope.d.ts +12 -0
- package/dist/types/index.d.ts +2 -1
- package/dist/types/localTypes/bff/form.d.ts +5 -5
- package/dist/types/localTypes/bff/scopes.d.ts +6 -6
- package/dist/types/localTypes/bff/table.d.ts +4 -3
- package/dist/types/localTypes/factories/converterBytes.d.ts +10 -0
- package/dist/types/localTypes/factories/converterCores.d.ts +7 -0
- package/dist/types/localTypes/form.d.ts +2 -2
- package/dist/types/localTypes/marketplace.d.ts +1 -1
- package/dist/types/localTypes/navigations.d.ts +3 -0
- package/dist/types/localTypes/richTable.d.ts +4 -0
- package/dist/types/utils/converterBytes/converterBytes.d.ts +32 -0
- package/dist/types/utils/converterBytes/converterBytes.test.d.ts +1 -0
- package/dist/types/utils/converterBytes/index.d.ts +1 -0
- package/dist/types/utils/converterCores/converterCores.d.ts +45 -0
- package/dist/types/utils/converterCores/converterCores.test.d.ts +1 -0
- package/dist/types/utils/converterCores/index.d.ts +1 -0
- package/dist/types/utils/getGroupsByCategory/getGroupsByCategory.d.ts +2 -2
- package/dist/types/utils/index.d.ts +2 -0
- package/dist/types/utils/tableLocations/tableLocations.d.ts +5 -5
- package/package.json +2 -1
- package/dist/types/components/organisms/DynamicComponents/molecules/ConverterBytes/types.d.ts +0 -10
- package/dist/types/components/organisms/DynamicComponents/molecules/ConverterBytes/utils.d.ts +0 -15
- /package/dist/types/components/molecules/{BlackholeForm/molecules/YamlEditorSingleton → YamlEditorSingleton}/index.d.ts +0 -0
- /package/dist/types/components/molecules/{BlackholeForm/molecules/YamlEditorSingleton → YamlEditorSingleton}/styled.d.ts +0 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export type PrometheusRangeResponse = {
|
|
2
|
+
status: 'success' | 'error';
|
|
3
|
+
data: {
|
|
4
|
+
resultType: 'matrix';
|
|
5
|
+
result: {
|
|
6
|
+
metric: Record<string, string>;
|
|
7
|
+
values: [number, string][];
|
|
8
|
+
}[];
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
export type ChartPoint = {
|
|
12
|
+
timestamp: number;
|
|
13
|
+
value: number;
|
|
14
|
+
};
|
|
15
|
+
export declare const prometheusToRechartsSingle: (resp: PrometheusRangeResponse) => ChartPoint[];
|
|
16
|
+
export type RechartsSeries = {
|
|
17
|
+
id: string;
|
|
18
|
+
metric: Record<string, string>;
|
|
19
|
+
data: ChartPoint[];
|
|
20
|
+
};
|
|
21
|
+
export declare const prometheusToRechartsMulti: (resp: PrometheusRangeResponse) => RechartsSeries[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Toggler } from './Toggler';
|
package/dist/types/components/organisms/DynamicComponents/molecules/TogglerSegmented/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { TogglerSegmented } from './TogglerSegmented';
|
|
@@ -31,7 +31,10 @@ export { Taints } from './Taints';
|
|
|
31
31
|
export { Tolerations } from './Tolerations';
|
|
32
32
|
export { Annotations } from './Annotations';
|
|
33
33
|
export { ConverterBytes } from './ConverterBytes';
|
|
34
|
+
export { ConverterCores } from './ConverterCores';
|
|
34
35
|
export { SecretBase64Plain } from './SecretBase64Plain';
|
|
35
36
|
export { ResourceBadge } from './ResourceBadge';
|
|
36
37
|
export { Events } from './Events';
|
|
37
38
|
export { OwnerRefs } from './OwnerRefs';
|
|
39
|
+
export { Toggler } from './Toggler';
|
|
40
|
+
export { TogglerSegmented } from './TogglerSegmented';
|
|
@@ -10,10 +10,11 @@ export declare const parseMutliqueryText: ({ text, multiQueryData, customFallbac
|
|
|
10
10
|
multiQueryData: TDataMap;
|
|
11
11
|
customFallback?: string | undefined;
|
|
12
12
|
}) => string;
|
|
13
|
-
export declare const parseJsonPathTemplate: ({ text, multiQueryData, customFallback, }: {
|
|
13
|
+
export declare const parseJsonPathTemplate: ({ text, multiQueryData, customFallback, replaceValues, }: {
|
|
14
14
|
text?: string | undefined;
|
|
15
15
|
multiQueryData: TDataMap;
|
|
16
16
|
customFallback?: string | undefined;
|
|
17
|
+
replaceValues?: Record<string, string | undefined> | undefined;
|
|
17
18
|
}) => string;
|
|
18
19
|
export declare const parseWithoutPartsOfUrl: ({ text, multiQueryData, customFallback, }: {
|
|
19
20
|
text: string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -4,7 +4,8 @@ import type { TextProps } from 'antd/es/typography/Text';
|
|
|
4
4
|
import type { LinkProps } from 'antd/es/typography/Link';
|
|
5
5
|
import type { TContentCardProps, TSpacerProps } from '../../atoms';
|
|
6
6
|
import type { TManageableSidebarProviderProps, TEnrichedTableProviderProps } from '../../molecules';
|
|
7
|
-
import type { TUnitInput } from '
|
|
7
|
+
import type { TUnitInput } from '../../../localTypes/factories/converterBytes';
|
|
8
|
+
import type { TCoreUnitInput } from '../../../localTypes/factories/converterCores';
|
|
8
9
|
export type TDynamicComponentsAppTypeMap = {
|
|
9
10
|
DefaultDiv: {
|
|
10
11
|
id: number | string;
|
|
@@ -53,26 +54,26 @@ export type TDynamicComponentsAppTypeMap = {
|
|
|
53
54
|
};
|
|
54
55
|
ProjectInfoCard: {
|
|
55
56
|
id: number | string;
|
|
56
|
-
|
|
57
|
-
|
|
57
|
+
cluster: string;
|
|
58
|
+
namespace: string;
|
|
58
59
|
baseApiGroup: string;
|
|
59
60
|
baseApiVersion: string;
|
|
60
61
|
baseProjectApiGroup: string;
|
|
61
62
|
baseProjectVersion: string;
|
|
62
|
-
|
|
63
|
-
|
|
63
|
+
projectPlural: string;
|
|
64
|
+
marketplacePlural: string;
|
|
64
65
|
accessGroups: string[];
|
|
65
66
|
baseprefix?: string;
|
|
66
67
|
showZeroResources?: boolean;
|
|
67
68
|
};
|
|
68
69
|
MarketplaceCard: {
|
|
69
70
|
id: number | string;
|
|
70
|
-
|
|
71
|
-
|
|
71
|
+
cluster: string;
|
|
72
|
+
namespace: string;
|
|
72
73
|
baseApiGroup: string;
|
|
73
74
|
baseApiVersion: string;
|
|
74
|
-
|
|
75
|
-
|
|
75
|
+
marketplacePlural: string;
|
|
76
|
+
marketplaceKind: string;
|
|
76
77
|
baseprefix?: string;
|
|
77
78
|
standalone?: boolean;
|
|
78
79
|
forceAddedMode?: boolean;
|
|
@@ -104,13 +105,14 @@ export type TDynamicComponentsAppTypeMap = {
|
|
|
104
105
|
id: number | string;
|
|
105
106
|
fetchUrl?: string;
|
|
106
107
|
k8sResourceToFetch?: {
|
|
107
|
-
|
|
108
|
-
|
|
108
|
+
apiGroup?: string;
|
|
109
|
+
apiVersion: string;
|
|
109
110
|
plural: string;
|
|
110
111
|
namespace?: string;
|
|
111
112
|
};
|
|
112
113
|
pathToItems: string | string[];
|
|
113
|
-
|
|
114
|
+
additionalReqsDataToEachItem?: number[];
|
|
115
|
+
cluster: string;
|
|
114
116
|
labelSelector?: Record<string, string>;
|
|
115
117
|
labelSelectorFull?: {
|
|
116
118
|
reqIndex: number;
|
|
@@ -145,7 +147,7 @@ export type TDynamicComponentsAppTypeMap = {
|
|
|
145
147
|
type: 'builtin' | 'apis';
|
|
146
148
|
apiGroup?: string;
|
|
147
149
|
apiVersion?: string;
|
|
148
|
-
|
|
150
|
+
plural: string;
|
|
149
151
|
forcedKind?: string;
|
|
150
152
|
prefillValuesRequestIndex: number;
|
|
151
153
|
pathToData?: string | string[];
|
|
@@ -281,7 +283,7 @@ export type TDynamicComponentsAppTypeMap = {
|
|
|
281
283
|
};
|
|
282
284
|
ConverterBytes: {
|
|
283
285
|
id: number | string;
|
|
284
|
-
bytesValue: string;
|
|
286
|
+
bytesValue: string | string[];
|
|
285
287
|
unit?: TUnitInput;
|
|
286
288
|
/** If true, returns "12.3 GiB" instead of just 12.3 */
|
|
287
289
|
format?: boolean;
|
|
@@ -292,6 +294,29 @@ export type TDynamicComponentsAppTypeMap = {
|
|
|
292
294
|
standard?: 'si' | 'iec';
|
|
293
295
|
notANumberText?: string;
|
|
294
296
|
style?: CSSProperties;
|
|
297
|
+
/** If provided, value is in this unit instead of raw bytes */
|
|
298
|
+
fromUnit?: TUnitInput;
|
|
299
|
+
/** If provided, convert to this explicit unit */
|
|
300
|
+
toUnit?: TUnitInput;
|
|
301
|
+
};
|
|
302
|
+
ConverterCores: {
|
|
303
|
+
id: number | string;
|
|
304
|
+
/** Raw text that may contain a number or number+unit like "0.5", "500m", "2 vcpu" */
|
|
305
|
+
coresValue: string | string[];
|
|
306
|
+
/** Target unit; omit to auto format (core vs mcore) */
|
|
307
|
+
unit?: TCoreUnitInput;
|
|
308
|
+
/** If true, returns "500 mcore" instead of just 500 */
|
|
309
|
+
format?: boolean;
|
|
310
|
+
/** Max fraction digits when formatting (default 2) */
|
|
311
|
+
precision?: number;
|
|
312
|
+
/** Locale for number formatting (default: undefined => user agent) */
|
|
313
|
+
locale?: string;
|
|
314
|
+
notANumberText?: string;
|
|
315
|
+
style?: CSSProperties;
|
|
316
|
+
/** If provided, value is in this unit instead of raw "cores" */
|
|
317
|
+
fromUnit?: TCoreUnitInput;
|
|
318
|
+
/** If provided, convert to this explicit unit; omit for auto-format */
|
|
319
|
+
toUnit?: TCoreUnitInput;
|
|
295
320
|
};
|
|
296
321
|
SecretBase64Plain: {
|
|
297
322
|
id: number | string;
|
|
@@ -313,7 +338,7 @@ export type TDynamicComponentsAppTypeMap = {
|
|
|
313
338
|
Events: {
|
|
314
339
|
id: number | string;
|
|
315
340
|
baseprefix?: string;
|
|
316
|
-
|
|
341
|
+
cluster: string;
|
|
317
342
|
wsUrl: string;
|
|
318
343
|
pageSize?: number;
|
|
319
344
|
substractHeight?: number;
|
|
@@ -329,13 +354,13 @@ export type TDynamicComponentsAppTypeMap = {
|
|
|
329
354
|
baseFactoryNamespacedBuiltinKey: string;
|
|
330
355
|
baseFactoryClusterSceopedBuiltinKey: string;
|
|
331
356
|
baseNamespaceFactoryKey: string;
|
|
332
|
-
|
|
333
|
-
|
|
357
|
+
baseNavigationPlural: string;
|
|
358
|
+
baseNavigationName: string;
|
|
334
359
|
};
|
|
335
360
|
OwnerRefs: {
|
|
336
361
|
id: number | string;
|
|
337
362
|
baseprefix?: string;
|
|
338
|
-
|
|
363
|
+
cluster: string;
|
|
339
364
|
reqIndex: string;
|
|
340
365
|
errorText: string;
|
|
341
366
|
notArrayErrorText: string;
|
|
@@ -344,13 +369,57 @@ export type TDynamicComponentsAppTypeMap = {
|
|
|
344
369
|
containerStyle?: CSSProperties;
|
|
345
370
|
listFlexProps?: FlexProps;
|
|
346
371
|
jsonPathToArrayOfRefs: string;
|
|
372
|
+
forcedApiVersion?: {
|
|
373
|
+
kind: string;
|
|
374
|
+
apiVersion: string;
|
|
375
|
+
}[];
|
|
376
|
+
forcedNamespace?: string;
|
|
347
377
|
keysToForcedLabel?: string | string[];
|
|
348
378
|
forcedRelatedValuePath?: string;
|
|
349
379
|
baseFactoryNamespacedAPIKey: string;
|
|
350
380
|
baseFactoryClusterSceopedAPIKey: string;
|
|
351
381
|
baseFactoryNamespacedBuiltinKey: string;
|
|
352
382
|
baseFactoryClusterSceopedBuiltinKey: string;
|
|
353
|
-
|
|
354
|
-
|
|
383
|
+
baseNavigationPlural: string;
|
|
384
|
+
baseNavigationName: string;
|
|
385
|
+
};
|
|
386
|
+
Toggler: {
|
|
387
|
+
id: number | string;
|
|
388
|
+
reqIndex: string;
|
|
389
|
+
jsonPathToValue: string;
|
|
390
|
+
criteria: {
|
|
391
|
+
type: 'forSuccess' | 'forError';
|
|
392
|
+
operator: 'exists' | 'equals';
|
|
393
|
+
valueToCompare?: string;
|
|
394
|
+
};
|
|
395
|
+
notificationSuccessMessage?: string;
|
|
396
|
+
notificationErrorMessage?: string;
|
|
397
|
+
notificationSuccessMessageDescription?: string;
|
|
398
|
+
notificationErrorMessageDescription?: string;
|
|
399
|
+
containerStyle?: CSSProperties;
|
|
400
|
+
endpoint: string;
|
|
401
|
+
pathToValue: string;
|
|
402
|
+
valueToSubmit: {
|
|
403
|
+
onValue: any;
|
|
404
|
+
offValue?: any;
|
|
405
|
+
toRemoveWhenOff?: boolean;
|
|
406
|
+
};
|
|
407
|
+
};
|
|
408
|
+
TogglerSegmented: {
|
|
409
|
+
id: number | string;
|
|
410
|
+
reqIndex: string;
|
|
411
|
+
jsonPathToValue: string;
|
|
412
|
+
notificationSuccessMessage?: string;
|
|
413
|
+
notificationErrorMessage?: string;
|
|
414
|
+
notificationSuccessMessageDescription?: string;
|
|
415
|
+
notificationErrorMessageDescription?: string;
|
|
416
|
+
containerStyle?: CSSProperties;
|
|
417
|
+
endpoint: string;
|
|
418
|
+
pathToValue: string;
|
|
419
|
+
possibleValues: any[];
|
|
420
|
+
valuesMap?: {
|
|
421
|
+
value: any;
|
|
422
|
+
renderedValue: string | number;
|
|
423
|
+
}[];
|
|
355
424
|
};
|
|
356
425
|
};
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import { TApiResources } from '../localTypes/k8s';
|
|
2
|
-
export declare const useApiResources: ({
|
|
3
|
-
|
|
2
|
+
export declare const useApiResources: ({ cluster, namespace, apiGroup, apiVersion, plural, name, labels, fields, limit, refetchInterval, isEnabled, }: {
|
|
3
|
+
cluster: string;
|
|
4
4
|
namespace?: string | undefined;
|
|
5
5
|
apiGroup: string;
|
|
6
6
|
apiVersion: string;
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
plural: string;
|
|
8
|
+
name?: string | undefined;
|
|
9
9
|
labels?: string[] | undefined;
|
|
10
10
|
fields?: string[] | undefined;
|
|
11
11
|
limit: string | null;
|
|
12
12
|
refetchInterval?: number | false | undefined;
|
|
13
13
|
isEnabled?: boolean | undefined;
|
|
14
14
|
}) => import("@tanstack/react-query/build/legacy/types").UseQueryResult<TApiResources, Error>;
|
|
15
|
-
export declare const useApiResourceSingle: ({
|
|
16
|
-
|
|
15
|
+
export declare const useApiResourceSingle: ({ cluster, namespace, apiGroup, apiVersion, plural, name, refetchInterval, }: {
|
|
16
|
+
cluster: string;
|
|
17
17
|
namespace?: string | undefined;
|
|
18
18
|
apiGroup: string;
|
|
19
19
|
apiVersion: string;
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
plural: string;
|
|
21
|
+
name: string;
|
|
22
22
|
refetchInterval?: number | false | undefined;
|
|
23
23
|
}) => import("@tanstack/react-query/build/legacy/types").UseQueryResult<{
|
|
24
24
|
metadata: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export declare const useApisResourceTypes: ({
|
|
2
|
-
|
|
1
|
+
export declare const useApisResourceTypes: ({ cluster }: {
|
|
2
|
+
cluster: string;
|
|
3
3
|
}) => import("@tanstack/react-query/build/legacy/types").UseQueryResult<{
|
|
4
4
|
apiVersion: string;
|
|
5
5
|
kind: string;
|
|
@@ -15,8 +15,8 @@ export declare const useApisResourceTypes: ({ clusterName }: {
|
|
|
15
15
|
};
|
|
16
16
|
}[];
|
|
17
17
|
}, Error>;
|
|
18
|
-
export declare const useApiResourceTypesByGroup: ({
|
|
19
|
-
|
|
18
|
+
export declare const useApiResourceTypesByGroup: ({ cluster, apiGroup, apiVersion, }: {
|
|
19
|
+
cluster: string;
|
|
20
20
|
apiGroup: string;
|
|
21
21
|
apiVersion: string;
|
|
22
22
|
}) => import("@tanstack/react-query/build/legacy/types").UseQueryResult<{
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { TBuiltinResources } from '../localTypes/k8s';
|
|
2
|
-
export declare const useBuiltinResources: ({
|
|
3
|
-
|
|
2
|
+
export declare const useBuiltinResources: ({ cluster, namespace, plural, name, labels, fields, limit, refetchInterval, isEnabled, }: {
|
|
3
|
+
cluster: string;
|
|
4
4
|
namespace?: string | undefined;
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
plural: string;
|
|
6
|
+
name?: string | undefined;
|
|
7
7
|
labels?: string[] | undefined;
|
|
8
8
|
fields?: string[] | undefined;
|
|
9
9
|
limit: string | null;
|
|
10
10
|
refetchInterval?: number | false | undefined;
|
|
11
11
|
isEnabled?: boolean | undefined;
|
|
12
12
|
}) => import("@tanstack/react-query/build/legacy/types").UseQueryResult<TBuiltinResources, Error>;
|
|
13
|
-
export declare const useBuiltinResourceSingle: ({
|
|
14
|
-
|
|
13
|
+
export declare const useBuiltinResourceSingle: ({ cluster, namespace, plural, name, refetchInterval, }: {
|
|
14
|
+
cluster: string;
|
|
15
15
|
namespace?: string | undefined;
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
plural: string;
|
|
17
|
+
name: string;
|
|
18
18
|
refetchInterval?: number | false | undefined;
|
|
19
19
|
}) => import("@tanstack/react-query/build/legacy/types").UseQueryResult<{
|
|
20
20
|
metadata: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { TBuiltinResourceTypeList } from '../localTypes/k8s';
|
|
2
|
-
export declare const useBuiltinResourceTypes: ({
|
|
3
|
-
|
|
2
|
+
export declare const useBuiltinResourceTypes: ({ cluster }: {
|
|
3
|
+
cluster: string;
|
|
4
4
|
}) => import("@tanstack/react-query/build/legacy/types").UseQueryResult<TBuiltinResourceTypeList, Error>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export declare const useCrdData: ({
|
|
2
|
-
|
|
1
|
+
export declare const useCrdData: ({ cluster, apiExtensionVersion, crdName, }: {
|
|
2
|
+
cluster: string;
|
|
3
3
|
apiExtensionVersion: string;
|
|
4
4
|
crdName: string;
|
|
5
5
|
}) => import("@tanstack/react-query/build/legacy/types").UseQueryResult<{
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { TJSON } from '../localTypes/JSON';
|
|
2
|
-
export declare const useCrdResources: <T = TJSON[]>({
|
|
3
|
-
|
|
2
|
+
export declare const useCrdResources: <T = TJSON[]>({ cluster, namespace, apiGroup, apiVersion, crdName, refetchInterval, isEnabled, }: {
|
|
3
|
+
cluster: string;
|
|
4
4
|
namespace?: string | undefined;
|
|
5
5
|
apiGroup: string;
|
|
6
6
|
apiVersion: string;
|
|
@@ -19,13 +19,13 @@ export declare const useCrdResources: <T = TJSON[]>({ clusterName, namespace, ap
|
|
|
19
19
|
reason?: string | undefined;
|
|
20
20
|
} | undefined;
|
|
21
21
|
}, Error>;
|
|
22
|
-
export declare const useCrdResourceSingle: ({
|
|
23
|
-
|
|
22
|
+
export declare const useCrdResourceSingle: ({ cluster, namespace, apiGroup, apiVersion, crdName, name, refetchInterval, }: {
|
|
23
|
+
cluster: string;
|
|
24
24
|
namespace?: string | undefined;
|
|
25
25
|
apiGroup: string;
|
|
26
26
|
apiVersion: string;
|
|
27
27
|
crdName: string;
|
|
28
|
-
|
|
28
|
+
name: string;
|
|
29
29
|
refetchInterval?: number | false | undefined;
|
|
30
30
|
}) => import("@tanstack/react-query/build/legacy/types").UseQueryResult<{
|
|
31
31
|
metadata: {
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { useK8sSmartResource } from './useK8sSmartResource';
|
|
2
|
+
export type { TUseK8sSmartResourceParams } from './useK8sSmartResourceWithoutKinds';
|
|
3
|
+
export { useManyK8sSmartResource } from './useManyK8sSmartResource';
|
|
4
|
+
export { useSmartResourceParams } from './useSmartResourceParams';
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { type TUseK8sSmartResourceParams } from './useK8sSmartResourceWithoutKinds';
|
|
2
|
+
/**
|
|
3
|
+
* If T has an `{ items: U[] }` field, we add `kind?: string` and `apiVersion?: string` to each item.
|
|
4
|
+
* Otherwise T is left unchanged.
|
|
5
|
+
*/
|
|
6
|
+
type TWithKindAndApiVersionOnItems<T> = T extends {
|
|
7
|
+
items: (infer U)[];
|
|
8
|
+
} ? Omit<T, 'items'> & {
|
|
9
|
+
items: (U & {
|
|
10
|
+
kind?: string;
|
|
11
|
+
apiVersion?: string;
|
|
12
|
+
})[];
|
|
13
|
+
} : T;
|
|
14
|
+
/**
|
|
15
|
+
* Same params as useK8sSmartResource.
|
|
16
|
+
* Returns the same shape as useK8sSmartResource,
|
|
17
|
+
* but if `data.items` exists, items are enriched with `kind`.
|
|
18
|
+
*/
|
|
19
|
+
export declare const useK8sSmartResource: <T>(params: TUseK8sSmartResourceParams<T>) => {
|
|
20
|
+
data: TWithKindAndApiVersionOnItems<T> | undefined;
|
|
21
|
+
isLoading: boolean;
|
|
22
|
+
isError: boolean;
|
|
23
|
+
error: string | Error | import("axios").AxiosError<unknown, any> | undefined;
|
|
24
|
+
_meta?: {
|
|
25
|
+
used: "disabled" | "list" | "watch" | "verbs-loading" | "verbs-error";
|
|
26
|
+
} | undefined;
|
|
27
|
+
debugTick?: number | undefined;
|
|
28
|
+
};
|
|
29
|
+
export {};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { AxiosError } from 'axios';
|
|
2
|
-
import { TSingleResource } from '
|
|
2
|
+
import { TSingleResource } from '../../localTypes/k8s';
|
|
3
3
|
export type TUseK8sSmartResourceParams<T> = {
|
|
4
4
|
cluster: string;
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
apiGroup?: string;
|
|
6
|
+
apiVersion: string;
|
|
7
7
|
plural: string;
|
|
8
8
|
namespace?: string;
|
|
9
9
|
fieldSelector?: string;
|
|
@@ -24,6 +24,7 @@ type SmartResult<T> = {
|
|
|
24
24
|
_meta?: {
|
|
25
25
|
used: 'list' | 'watch' | 'disabled' | 'verbs-loading' | 'verbs-error';
|
|
26
26
|
};
|
|
27
|
+
debugTick?: number;
|
|
27
28
|
};
|
|
28
|
-
export declare const
|
|
29
|
+
export declare const useK8sSmartResourceWithoutKinds: <T>({ cluster, apiGroup, apiVersion, plural, namespace, fieldSelector, labelSelector, isEnabled, listRefetchInterval, limit, mapListWatchState, }: TUseK8sSmartResourceParams<T>) => SmartResult<T>;
|
|
29
30
|
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { TUseK8sSmartResourceParams } from './useK8sSmartResourceWithoutKinds';
|
|
2
|
+
export declare const useManyK8sSmartResource: <T>(paramsList: readonly TUseK8sSmartResourceParams<T>[]) => {
|
|
3
|
+
data: (T extends {
|
|
4
|
+
items: (infer U)[];
|
|
5
|
+
} ? Omit<T, "items"> & {
|
|
6
|
+
items: (U & {
|
|
7
|
+
kind?: string | undefined;
|
|
8
|
+
apiVersion?: string | undefined;
|
|
9
|
+
})[];
|
|
10
|
+
} : T) | undefined;
|
|
11
|
+
isLoading: boolean;
|
|
12
|
+
isError: boolean;
|
|
13
|
+
error: string | Error | import("axios").AxiosError<unknown, any> | undefined;
|
|
14
|
+
_meta?: {
|
|
15
|
+
used: "disabled" | "list" | "watch" | "verbs-loading" | "verbs-error";
|
|
16
|
+
} | undefined;
|
|
17
|
+
debugTick?: number | undefined;
|
|
18
|
+
}[];
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { TUseK8sSmartResourceParams } from './useK8sSmartResourceWithoutKinds';
|
|
2
|
+
export declare const useSmartResourceParams: ({ cluster, namespace }: {
|
|
3
|
+
cluster: string;
|
|
4
|
+
namespace?: string | undefined;
|
|
5
|
+
}) => {
|
|
6
|
+
paramsList: TUseK8sSmartResourceParams<unknown>[];
|
|
7
|
+
scopesLoading: boolean;
|
|
8
|
+
scopesError: Error | null | undefined;
|
|
9
|
+
};
|
|
@@ -68,5 +68,6 @@ export type TUseListWatchReturn = {
|
|
|
68
68
|
setUrl: (next: string) => void;
|
|
69
69
|
/** Update the list/watch query (will reconnect if enabled) */
|
|
70
70
|
setQuery: (q: TUseListWatchQuery) => void;
|
|
71
|
+
debugTick?: number;
|
|
71
72
|
};
|
|
72
73
|
export declare const useListWatch: ({ wsUrl, pageSize, paused, ignoreRemove, onStatus, onError, autoDrain, preserveStateOnUrlChange, isEnabled, query, }: TUseListWatchOptions) => TUseListWatchReturn;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export declare const usePermissions: ({
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
export declare const usePermissions: ({ cluster, namespace, apiGroup, plural, verb, name, refetchInterval, enabler, }: {
|
|
2
|
+
cluster: string;
|
|
3
|
+
apiGroup?: string | undefined;
|
|
4
|
+
plural: string;
|
|
5
5
|
namespace?: string | undefined;
|
|
6
6
|
name?: string | undefined;
|
|
7
7
|
verb: 'create' | 'delete' | 'patch' | 'update';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useResourceScope } from './useResourceScope';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
type TUseResourceScopeArgs = {
|
|
2
|
+
cluster: string;
|
|
3
|
+
apiGroup?: string;
|
|
4
|
+
apiVersion?: string;
|
|
5
|
+
plural: string;
|
|
6
|
+
};
|
|
7
|
+
type TUseResourceScopeRes = {
|
|
8
|
+
isClusterWide: boolean;
|
|
9
|
+
isNamespaceScoped: boolean;
|
|
10
|
+
};
|
|
11
|
+
export declare const useResourceScope: ({ plural, cluster, apiGroup, apiVersion }: TUseResourceScopeArgs) => import("@tanstack/react-query/build/legacy/types").UseQueryResult<TUseResourceScopeRes, Error>;
|
|
12
|
+
export {};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -26,7 +26,8 @@ export { usePermissions } from './hooks/usePermissions';
|
|
|
26
26
|
export { useListWatch, useInfiniteSentinel } from './hooks/useListThenWatch';
|
|
27
27
|
export type { TConnStatus, TUseListWatchQuery, TUseListWatchOptions, TUseListWatchReturn, } from './hooks/useListThenWatch';
|
|
28
28
|
export { useK8sVerbs } from './hooks/useK8sVerbs';
|
|
29
|
-
export { useK8sSmartResource } from './hooks/useK8sSmartResource';
|
|
29
|
+
export { useK8sSmartResource, useManyK8sSmartResource, useSmartResourceParams } from './hooks/useK8sSmartResource';
|
|
30
|
+
export { useResourceScope } from './hooks/useResourceScope';
|
|
30
31
|
export type { TRequestError } from './localTypes/api';
|
|
31
32
|
export type { TClusterList } from './localTypes/clusterList';
|
|
32
33
|
export type { TItemTypeMap, TRenderableItem, TRendererComponents, TFactoryDataK8s, TFactoryResponse, TFactoryResource, } from './localTypes/dynamicRender';
|
|
@@ -5,24 +5,24 @@ import { TFormPrefill } from '../formExtensions';
|
|
|
5
5
|
export type TPrepareFormReq = {
|
|
6
6
|
data: {
|
|
7
7
|
type: 'builtin';
|
|
8
|
-
|
|
8
|
+
plural: string;
|
|
9
9
|
prefillValuesSchema?: TJSON;
|
|
10
10
|
prefillValueNamespaceOnly?: string;
|
|
11
11
|
} | {
|
|
12
12
|
type: 'apis';
|
|
13
13
|
apiGroup: string;
|
|
14
14
|
apiVersion: string;
|
|
15
|
-
|
|
15
|
+
plural: string;
|
|
16
16
|
prefillValuesSchema?: TJSON;
|
|
17
17
|
prefillValueNamespaceOnly?: string;
|
|
18
18
|
};
|
|
19
|
-
|
|
19
|
+
cluster: string;
|
|
20
20
|
customizationId?: string;
|
|
21
21
|
};
|
|
22
22
|
export type TPrepareFormRes = {
|
|
23
23
|
result: 'error';
|
|
24
24
|
error: string | undefined;
|
|
25
|
-
|
|
25
|
+
kind: string | undefined;
|
|
26
26
|
fallbackToManualMode: true;
|
|
27
27
|
isNamespaced: boolean;
|
|
28
28
|
} | {
|
|
@@ -35,7 +35,7 @@ export type TPrepareFormRes = {
|
|
|
35
35
|
expandedPaths: string[][] | undefined;
|
|
36
36
|
persistedPaths: string[][] | undefined;
|
|
37
37
|
sortPaths: string[][] | undefined;
|
|
38
|
-
|
|
38
|
+
kind: string | undefined;
|
|
39
39
|
isNamespaced: boolean;
|
|
40
40
|
formPrefills?: TFormPrefill;
|
|
41
41
|
namespacesData?: string[];
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { TApiGroupResourceTypeList, TBuiltinResourceTypeList } from '../k8s';
|
|
2
2
|
export type TCheckIfApiInstanceNamespaceScopedReq = {
|
|
3
|
-
|
|
3
|
+
plural: string;
|
|
4
4
|
apiGroup: string;
|
|
5
5
|
apiVersion: string;
|
|
6
|
-
|
|
6
|
+
cluster: string;
|
|
7
7
|
};
|
|
8
8
|
export type TCheckIfApiInstanceNamespaceScopedRes = {
|
|
9
9
|
isClusterWide: boolean;
|
|
10
10
|
isNamespaceScoped: boolean;
|
|
11
11
|
};
|
|
12
12
|
export type TCheckIfBuiltInInstanceNamespaceScopedReq = {
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
plural: string;
|
|
14
|
+
cluster: string;
|
|
15
15
|
};
|
|
16
16
|
export type TCheckIfBuiltInInstanceNamespaceScopedRes = {
|
|
17
17
|
isClusterWide: boolean;
|
|
@@ -22,12 +22,12 @@ export type TFilterIfApiInstanceNamespaceScopedReq = {
|
|
|
22
22
|
data?: TApiGroupResourceTypeList;
|
|
23
23
|
apiGroup: string;
|
|
24
24
|
apiVersion: string;
|
|
25
|
-
|
|
25
|
+
cluster: string;
|
|
26
26
|
};
|
|
27
27
|
export type TFilterIfApiInstanceNamespaceScopedRes = TApiGroupResourceTypeList['resources'] | undefined;
|
|
28
28
|
export type TFilterIfBuiltInInstanceNamespaceScopedReq = {
|
|
29
29
|
namespace?: string;
|
|
30
30
|
data?: TBuiltinResourceTypeList;
|
|
31
|
-
|
|
31
|
+
cluster: string;
|
|
32
32
|
};
|
|
33
33
|
export type TFilterIfBuiltInInstanceNamespaceScopedRes = TBuiltinResourceTypeList['resources'] | undefined;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { TAdditionalPrinterColumns, TAdditionalPrinterColumnsUndefinedValues, TAdditionalPrinterColumnsTrimLengths, TAdditionalPrinterColumnsColWidths, TAdditionalPrinterColumnsKeyTypeProps } from '../richTable';
|
|
1
|
+
import { TAdditionalPrinterColumns, TAdditionalPrinterColumnsUndefinedValues, TAdditionalPrinterColumnsTrimLengths, TAdditionalPrinterColumnsColWidths, TAdditionalPrinterColumnsKeyTypeProps, TAdditionalPrinterColumnsCustomSortersAndFilters } from '../richTable';
|
|
2
2
|
export type TPrepareTableReq = {
|
|
3
3
|
customizationId?: string;
|
|
4
4
|
tableMappingsReplaceValues?: Record<string, string | undefined>;
|
|
5
5
|
forceDefaultAdditionalPrinterColumns?: TAdditionalPrinterColumns;
|
|
6
|
-
|
|
6
|
+
cluster: string;
|
|
7
7
|
namespace?: string;
|
|
8
8
|
k8sResource?: {
|
|
9
|
-
|
|
9
|
+
plural: string;
|
|
10
10
|
apiGroup?: string;
|
|
11
11
|
apiVersion: string;
|
|
12
12
|
};
|
|
@@ -17,6 +17,7 @@ export type TPrepareTableRes = {
|
|
|
17
17
|
additionalPrinterColumnsTrimLengths?: TAdditionalPrinterColumnsTrimLengths;
|
|
18
18
|
additionalPrinterColumnsColWidths?: TAdditionalPrinterColumnsColWidths;
|
|
19
19
|
additionalPrinterColumnsKeyTypeProps?: TAdditionalPrinterColumnsKeyTypeProps;
|
|
20
|
+
additionalPrinterColumnsCustomSortersAndFilters?: TAdditionalPrinterColumnsCustomSortersAndFilters;
|
|
20
21
|
pathToNavigate?: string;
|
|
21
22
|
recordKeysForNavigation?: string | string[];
|
|
22
23
|
recordKeysForNavigationSecond?: string | string[];
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type TCanonicalUnit = 'B' | 'kB' | 'MB' | 'GB' | 'TB' | 'PB' | 'EB' | 'KiB' | 'MiB' | 'GiB' | 'TiB' | 'PiB' | 'EiB';
|
|
2
|
+
export type TUnitInput = TCanonicalUnit | 'b' | 'byte' | 'bytes' | 'k' | 'm' | 'g' | 't' | 'p' | 'e' | 'K' | 'M' | 'G' | 'T' | 'P' | 'E' | 'kb' | 'KB' | 'mb' | 'Mb' | 'MB' | 'gb' | 'Gb' | 'GB' | 'tb' | 'Tb' | 'TB' | 'pb' | 'Pb' | 'PB' | 'eb' | 'Eb' | 'EB' | 'ki' | 'mi' | 'gi' | 'ti' | 'pi' | 'ei' | 'kib' | 'mib' | 'gib' | 'tib' | 'pib' | 'eib' | 'Ki' | 'Mi' | 'Gi' | 'Ti' | 'Pi' | 'Ei' | 'KiB' | 'MiB' | 'GiB' | 'TiB' | 'PiB' | 'EiB';
|
|
3
|
+
export type TConvertOptions = {
|
|
4
|
+
/** If true, returns "12.3 GiB" instead of just 12.3 */
|
|
5
|
+
format?: boolean;
|
|
6
|
+
/** Max fraction digits when formatting (default 2) */
|
|
7
|
+
precision?: number;
|
|
8
|
+
/** Locale for number formatting (default: undefined => user agent) */
|
|
9
|
+
locale?: string;
|
|
10
|
+
};
|