@prorobotech/openapi-k8s-toolkit 1.1.0-alpha.20 → 1.1.0-alpha.21

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.
@@ -110,6 +110,7 @@ export type TDynamicComponentsAppTypeMap = {
110
110
  namespace?: string;
111
111
  };
112
112
  pathToItems: string | string[];
113
+ additionalReqsDataToEachItem?: number[];
113
114
  cluster: string;
114
115
  labelSelector?: Record<string, string>;
115
116
  labelSelectorFull?: {
@@ -1,2 +1,4 @@
1
1
  export { useK8sSmartResource } from './useK8sSmartResource';
2
2
  export type { TUseK8sSmartResourceParams } from './useK8sSmartResourceWithoutKinds';
3
+ export { useManyK8sSmartResource } from './useManyK8sSmartResource';
4
+ export { useSmartResourceParams } from './useSmartResourceParams';
@@ -0,0 +1,17 @@
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
+ }[];
@@ -0,0 +1,9 @@
1
+ import type { TUseK8sSmartResourceParams } from './useK8sSmartResourceWithoutKinds';
2
+ /**
3
+ * A single hook whose return value is a plain constant array,
4
+ * safe to pass to `useManyK8sSmartResource`.
5
+ */
6
+ export declare const useSmartResourceParams: ({ cluster, namespace }: {
7
+ cluster: string;
8
+ namespace?: string | undefined;
9
+ }) => TUseK8sSmartResourceParams<unknown>[];
@@ -26,7 +26,7 @@ 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
30
  export type { TRequestError } from './localTypes/api';
31
31
  export type { TClusterList } from './localTypes/clusterList';
32
32
  export type { TItemTypeMap, TRenderableItem, TRendererComponents, TFactoryDataK8s, TFactoryResponse, TFactoryResource, } from './localTypes/dynamicRender';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prorobotech/openapi-k8s-toolkit",
3
- "version": "1.1.0-alpha.20",
3
+ "version": "1.1.0-alpha.21",
4
4
  "description": "ProRobotech OpenAPI k8s tools",
5
5
  "main": "dist/openapi-k8s-toolkit.cjs.js",
6
6
  "module": "dist/openapi-k8s-toolkit.es.js",