@prorobotech/openapi-k8s-toolkit 1.2.0-alpha.13 → 1.2.0-alpha.15

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 (74) hide show
  1. package/dist/mockServiceWorker.js +349 -0
  2. package/dist/openapi-k8s-toolkit.es.js +49 -28
  3. package/dist/openapi-k8s-toolkit.es.js.map +1 -1
  4. package/dist/openapi-k8s-toolkit.umd.js +49 -27
  5. package/dist/openapi-k8s-toolkit.umd.js.map +1 -1
  6. package/dist/types/api/bff/search/getKinds.d.ts +1 -1
  7. package/dist/types/components/organisms/DynamicComponents/molecules/PrometheusGraph/hooks/index.d.ts +2 -0
  8. package/dist/types/components/organisms/DynamicComponents/molecules/PrometheusGraph/hooks/queryRangeMatrix/index.d.ts +2 -0
  9. package/dist/types/components/organisms/DynamicComponents/molecules/PrometheusGraph/hooks/queryRangeMatrix/multi/index.d.ts +1 -0
  10. package/dist/types/components/organisms/DynamicComponents/molecules/PrometheusGraph/hooks/queryRangeMatrix/multi/usePromMatrixToLineMulti.d.ts +7 -0
  11. package/dist/types/components/organisms/DynamicComponents/molecules/PrometheusGraph/hooks/queryRangeMatrix/single/index.d.ts +1 -0
  12. package/dist/types/components/organisms/DynamicComponents/molecules/PrometheusGraph/hooks/queryRangeMatrix/single/usePromMatrixToLineSingle.d.ts +7 -0
  13. package/dist/types/components/organisms/DynamicComponents/molecules/PrometheusGraph/hooks/queryVector/index.d.ts +1 -0
  14. package/dist/types/components/organisms/DynamicComponents/molecules/PrometheusGraph/hooks/queryVector/usePromVector.d.ts +6 -0
  15. package/dist/types/components/organisms/DynamicComponents/molecules/PrometheusGraph/hooks/queryVector/usePromVector.test.d.ts +1 -0
  16. package/dist/types/components/organisms/DynamicComponents/molecules/PrometheusGraph/organisms/matrix/toArea/MatrixToAreaMulti.d.ts +6 -0
  17. package/dist/types/components/organisms/DynamicComponents/molecules/PrometheusGraph/organisms/matrix/toArea/MatrixToAreaSingle.d.ts +6 -0
  18. package/dist/types/components/organisms/DynamicComponents/molecules/PrometheusGraph/organisms/matrix/toAreaStacked/MatrixToAreaStacked.d.ts +6 -0
  19. package/dist/types/components/organisms/DynamicComponents/molecules/PrometheusGraph/organisms/matrix/toLine/MatrixToLineMulti.d.ts +6 -0
  20. package/dist/types/components/organisms/DynamicComponents/molecules/PrometheusGraph/organisms/matrix/toLine/MatrixToLineSingle.d.ts +6 -0
  21. package/dist/types/components/organisms/DynamicComponents/molecules/PrometheusGraph/organisms/matrix/toReducedBar/MatrixToReducedBar.d.ts +7 -0
  22. package/dist/types/components/organisms/DynamicComponents/molecules/PrometheusGraph/organisms/matrix/toTableRows/MatrixToTableRows.d.ts +7 -0
  23. package/dist/types/components/organisms/DynamicComponents/molecules/PrometheusGraph/organisms/vector/toBar/VectorToBarHorizontal.d.ts +7 -0
  24. package/dist/types/components/organisms/DynamicComponents/molecules/PrometheusGraph/organisms/vector/toBar/VectorToBarVertical.d.ts +7 -0
  25. package/dist/types/components/organisms/DynamicComponents/molecules/PrometheusGraph/organisms/vector/toBarGauge/VectorToBarGauge.d.ts +8 -0
  26. package/dist/types/components/organisms/DynamicComponents/molecules/PrometheusGraph/organisms/vector/toGaugeRadial/VectorToGaugeRadial.d.ts +9 -0
  27. package/dist/types/components/organisms/DynamicComponents/molecules/PrometheusGraph/organisms/vector/toPie/VectorToPie.d.ts +7 -0
  28. package/dist/types/components/organisms/DynamicComponents/molecules/PrometheusGraph/organisms/vector/toTableRows/VectorToTableRows.d.ts +7 -0
  29. package/dist/types/components/organisms/DynamicComponents/molecules/PrometheusGraph/utils/{prometheus.d.ts → buildPrometheusRangeParams/buildPrometheusRangeParams.d.ts} +2 -2
  30. package/dist/types/components/organisms/DynamicComponents/molecules/PrometheusGraph/utils/buildPrometheusRangeParams/index.d.ts +2 -0
  31. package/dist/types/components/organisms/DynamicComponents/molecules/PrometheusGraph/utils/formatters/formatBytes.d.ts +1 -0
  32. package/dist/types/components/organisms/DynamicComponents/molecules/PrometheusGraph/utils/formatters/formatTimestamp.d.ts +1 -0
  33. package/dist/types/components/organisms/DynamicComponents/molecules/PrometheusGraph/utils/formatters/index.d.ts +2 -0
  34. package/dist/types/components/organisms/DynamicComponents/molecules/PrometheusGraph/utils/matrixAdapater/index.d.ts +9 -0
  35. package/dist/types/components/organisms/DynamicComponents/molecules/PrometheusGraph/utils/matrixAdapater/toAreaStacked/index.d.ts +2 -0
  36. package/dist/types/components/organisms/DynamicComponents/molecules/PrometheusGraph/utils/matrixAdapater/toAreaStacked/matrixToAreaStackedAdapter.d.ts +14 -0
  37. package/dist/types/components/organisms/DynamicComponents/molecules/PrometheusGraph/utils/matrixAdapater/toLine/index.d.ts +2 -0
  38. package/dist/types/components/organisms/DynamicComponents/molecules/PrometheusGraph/utils/matrixAdapater/toLine/matrixToLineAdapter.d.ts +12 -0
  39. package/dist/types/components/organisms/DynamicComponents/molecules/PrometheusGraph/utils/matrixAdapater/toLine/matrixToLineAdapter.test.d.ts +1 -0
  40. package/dist/types/components/organisms/DynamicComponents/molecules/PrometheusGraph/utils/matrixAdapater/toReducedVector/index.d.ts +2 -0
  41. package/dist/types/components/organisms/DynamicComponents/molecules/PrometheusGraph/utils/matrixAdapater/toReducedVector/matrixToReducedVectorAdapter.d.ts +8 -0
  42. package/dist/types/components/organisms/DynamicComponents/molecules/PrometheusGraph/utils/matrixAdapater/toReducedVector/matrixToReducedVectorAdapter.test.d.ts +1 -0
  43. package/dist/types/components/organisms/DynamicComponents/molecules/PrometheusGraph/utils/matrixAdapater/toTableRows/index.d.ts +2 -0
  44. package/dist/types/components/organisms/DynamicComponents/molecules/PrometheusGraph/utils/matrixAdapater/toTableRows/matrixToTableRowsAdapter.d.ts +12 -0
  45. package/dist/types/components/organisms/DynamicComponents/molecules/PrometheusGraph/utils/matrixAdapater/toTableRows/matrixToTableRowsAdapter.test.d.ts +1 -0
  46. package/dist/types/components/organisms/DynamicComponents/molecules/PrometheusGraph/utils/matrixAdapater/types.d.ts +10 -0
  47. package/dist/types/components/organisms/DynamicComponents/molecules/PrometheusGraph/utils/vectorAdapter/helpers.d.ts +1 -0
  48. package/dist/types/components/organisms/DynamicComponents/molecules/PrometheusGraph/utils/vectorAdapter/index.d.ts +11 -0
  49. package/dist/types/components/organisms/DynamicComponents/molecules/PrometheusGraph/utils/vectorAdapter/pickSeriesId.test.d.ts +1 -0
  50. package/dist/types/components/organisms/DynamicComponents/molecules/PrometheusGraph/utils/vectorAdapter/prometheusVectorUtils.test.d.ts +1 -0
  51. package/dist/types/components/organisms/DynamicComponents/molecules/PrometheusGraph/utils/vectorAdapter/toBar/index.d.ts +2 -0
  52. package/dist/types/components/organisms/DynamicComponents/molecules/PrometheusGraph/utils/vectorAdapter/toBar/vectorToBarAdapter.d.ts +18 -0
  53. package/dist/types/components/organisms/DynamicComponents/molecules/PrometheusGraph/utils/vectorAdapter/toBarGauge/index.d.ts +2 -0
  54. package/dist/types/components/organisms/DynamicComponents/molecules/PrometheusGraph/utils/vectorAdapter/toBarGauge/vectorToBarGaugeAdapter.d.ts +7 -0
  55. package/dist/types/components/organisms/DynamicComponents/molecules/PrometheusGraph/utils/vectorAdapter/toGaugeRadial/index.d.ts +2 -0
  56. package/dist/types/components/organisms/DynamicComponents/molecules/PrometheusGraph/utils/vectorAdapter/toGaugeRadial/vectorToGaugeRadialAdapter.d.ts +7 -0
  57. package/dist/types/components/organisms/DynamicComponents/molecules/PrometheusGraph/utils/vectorAdapter/toPie/index.d.ts +2 -0
  58. package/dist/types/components/organisms/DynamicComponents/molecules/PrometheusGraph/utils/vectorAdapter/toPie/vectorToPieAdapter.d.ts +7 -0
  59. package/dist/types/components/organisms/DynamicComponents/molecules/PrometheusGraph/utils/vectorAdapter/toTableRows/index.d.ts +2 -0
  60. package/dist/types/components/organisms/DynamicComponents/molecules/PrometheusGraph/utils/vectorAdapter/toTableRows/vectorToTableRowsAdapter.d.ts +8 -0
  61. package/dist/types/components/organisms/DynamicComponents/molecules/PrometheusGraph/utils/vectorAdapter/types.d.ts +10 -0
  62. package/dist/types/components/organisms/DynamicComponents/types.d.ts +2 -0
  63. package/dist/types/hooks/useKinds.d.ts +8 -0
  64. package/dist/types/index.d.ts +1 -0
  65. package/package.json +9 -2
  66. package/dist/types/components/organisms/DynamicComponents/molecules/PrometheusGraph/MemoryChart.d.ts +0 -6
  67. package/dist/types/components/organisms/DynamicComponents/molecules/PrometheusGraph/MemoryChartMulti.d.ts +0 -6
  68. package/dist/types/components/organisms/DynamicComponents/molecules/PrometheusGraph/hooks/usePrometheusQueryRange.d.ts +0 -7
  69. package/dist/types/components/organisms/DynamicComponents/molecules/PrometheusGraph/hooks/usePrometheusQueryRangeMulti.d.ts +0 -7
  70. package/dist/types/components/organisms/DynamicComponents/molecules/PrometheusGraph/utils/prometheusAdapter.d.ts +0 -21
  71. /package/dist/types/components/organisms/DynamicComponents/molecules/PrometheusGraph/hooks/{usePrometheusQueryRange.test.d.ts → queryRangeMatrix/multi/usePromMatrixToLineMulti.test.d.ts} +0 -0
  72. /package/dist/types/components/organisms/DynamicComponents/molecules/PrometheusGraph/hooks/{usePrometheusQueryRangeMulti.test.d.ts → queryRangeMatrix/single/usePromMatrixToLineSingle.test.d.ts} +0 -0
  73. /package/dist/types/components/organisms/DynamicComponents/molecules/PrometheusGraph/utils/{prometheus.test.d.ts → buildPrometheusRangeParams/buildPrometheusRangeParams.test.d.ts} +0 -0
  74. /package/dist/types/components/organisms/DynamicComponents/molecules/PrometheusGraph/utils/{prometheusAdapter.test.d.ts → matrixAdapater/toAreaStacked/matrixToAreaStackedAdapter.test.d.ts} +0 -0
@@ -1,4 +1,4 @@
1
1
  import { TKindIndex } from '../../../localTypes/bff/search';
2
2
  export declare const getKinds: ({ cluster }: {
3
3
  cluster: string;
4
- }) => Promise<TKindIndex>;
4
+ }) => Promise<import("axios").AxiosResponse<TKindIndex, any, {}>>;
@@ -0,0 +1,2 @@
1
+ export { usePromMatrixToLineSingle, usePromMatrixToLineMulti } from './queryRangeMatrix';
2
+ export { usePromVector } from './queryVector';
@@ -0,0 +1,2 @@
1
+ export { usePromMatrixToLineSingle } from './single';
2
+ export { usePromMatrixToLineMulti } from './multi';
@@ -0,0 +1 @@
1
+ export { usePromMatrixToLineMulti } from './usePromMatrixToLineMulti';
@@ -0,0 +1,7 @@
1
+ import { TRechartsSeries } from '../../../utils/matrixAdapater/toLine';
2
+ export declare const usePromMatrixToLineMulti: ({ query, range, refetchInterval, enabled, }: {
3
+ query: string;
4
+ range?: string | undefined;
5
+ refetchInterval?: number | false | undefined;
6
+ enabled?: boolean | undefined;
7
+ }) => import("@tanstack/react-query/build/legacy/types").UseQueryResult<TRechartsSeries[], Error>;
@@ -0,0 +1 @@
1
+ export { usePromMatrixToLineSingle } from './usePromMatrixToLineSingle';
@@ -0,0 +1,7 @@
1
+ import { TChartPoint } from '../../../utils/matrixAdapater/toLine';
2
+ export declare const usePromMatrixToLineSingle: ({ query, range, refetchInterval, enabled, }: {
3
+ query: string;
4
+ range?: string | undefined;
5
+ refetchInterval?: number | false | undefined;
6
+ enabled?: boolean | undefined;
7
+ }) => import("@tanstack/react-query/build/legacy/types").UseQueryResult<TChartPoint[], Error>;
@@ -0,0 +1 @@
1
+ export { usePromVector } from './usePromVector';
@@ -0,0 +1,6 @@
1
+ import { TPrometheusVectorResponse } from '../../utils/vectorAdapter';
2
+ export declare const usePromVector: ({ query, refetchInterval, enabled, }: {
3
+ query: string;
4
+ refetchInterval?: number | false | undefined;
5
+ enabled?: boolean | undefined;
6
+ }) => import("@tanstack/react-query/build/legacy/types").UseQueryResult<TPrometheusVectorResponse, Error>;
@@ -0,0 +1,6 @@
1
+ import { FC } from 'react';
2
+ type TMatrixToAreaMultiProps = {
3
+ range?: string;
4
+ };
5
+ export declare const MatrixToAreaMulti: FC<TMatrixToAreaMultiProps>;
6
+ export {};
@@ -0,0 +1,6 @@
1
+ import { FC } from 'react';
2
+ type TMatrixToAreaSingleProps = {
3
+ range?: string;
4
+ };
5
+ export declare const MatrixToAreaSingle: FC<TMatrixToAreaSingleProps>;
6
+ export {};
@@ -0,0 +1,6 @@
1
+ import { FC } from 'react';
2
+ type TMatrixToAreaStackedProps = {
3
+ range?: string;
4
+ };
5
+ export declare const MatrixToAreaStacked: FC<TMatrixToAreaStackedProps>;
6
+ export {};
@@ -0,0 +1,6 @@
1
+ import { FC } from 'react';
2
+ type TMatrixToLineMultiProps = {
3
+ range?: string;
4
+ };
5
+ export declare const MatrixToLineMulti: FC<TMatrixToLineMultiProps>;
6
+ export {};
@@ -0,0 +1,6 @@
1
+ import { FC } from 'react';
2
+ type TMatrixToLineSingleProps = {
3
+ range?: string;
4
+ };
5
+ export declare const MatrixToLineSingle: FC<TMatrixToLineSingleProps>;
6
+ export {};
@@ -0,0 +1,7 @@
1
+ import { FC } from 'react';
2
+ type TMatrixToReducedBarProps = {
3
+ range?: string;
4
+ mode?: 'last' | 'avg' | 'sum' | 'max' | 'min';
5
+ };
6
+ export declare const MatrixToReducedBar: FC<TMatrixToReducedBarProps>;
7
+ export {};
@@ -0,0 +1,7 @@
1
+ import { FC } from 'react';
2
+ type TMatrixToTableRowsProps = {
3
+ range?: string;
4
+ title?: string;
5
+ };
6
+ export declare const MatrixToTableRows: FC<TMatrixToTableRowsProps>;
7
+ export {};
@@ -0,0 +1,7 @@
1
+ import { FC } from 'react';
2
+ type TVectorToBarHorizontalProps = {
3
+ query?: string;
4
+ title?: string;
5
+ };
6
+ export declare const VectorToBarHorizontal: FC<TVectorToBarHorizontalProps>;
7
+ export {};
@@ -0,0 +1,7 @@
1
+ import { FC } from 'react';
2
+ type TVectorToBarVerticalProps = {
3
+ query?: string;
4
+ title?: string;
5
+ };
6
+ export declare const VectorToBarVertical: FC<TVectorToBarVerticalProps>;
7
+ export {};
@@ -0,0 +1,8 @@
1
+ import { FC } from 'react';
2
+ type TVectorToBarGaugeProps = {
3
+ query?: string;
4
+ title?: string;
5
+ topN?: number;
6
+ };
7
+ export declare const VectorToBarGauge: FC<TVectorToBarGaugeProps>;
8
+ export {};
@@ -0,0 +1,9 @@
1
+ import { FC } from 'react';
2
+ type TVectorToGaugeRadialProps = {
3
+ query?: string;
4
+ title?: string;
5
+ min?: number;
6
+ max?: number;
7
+ };
8
+ export declare const VectorToGaugeRadial: FC<TVectorToGaugeRadialProps>;
9
+ export {};
@@ -0,0 +1,7 @@
1
+ import { FC } from 'react';
2
+ type TVectorToPieProps = {
3
+ query?: string;
4
+ title?: string;
5
+ };
6
+ export declare const VectorToPie: FC<TVectorToPieProps>;
7
+ export {};
@@ -0,0 +1,7 @@
1
+ import { FC } from 'react';
2
+ type TVectorToTableRowsProps = {
3
+ query?: string;
4
+ title?: string;
5
+ };
6
+ export declare const VectorToTableRows: FC<TVectorToTableRowsProps>;
7
+ export {};
@@ -1,4 +1,4 @@
1
- export type PrometheusRangeParams = {
1
+ export type TPrometheusRangeParams = {
2
2
  start: string;
3
3
  end: string;
4
4
  step: string;
@@ -7,4 +7,4 @@ export type PrometheusRangeParams = {
7
7
  * Converts a duration string like "30m", "2h", "7d" into start/end ISO timestamps
8
8
  * and a safe step value to ensure < 11k data points for Prometheus query_range.
9
9
  */
10
- export declare const buildPrometheusRangeParams: (range?: string) => PrometheusRangeParams;
10
+ export declare const buildPrometheusRangeParams: (range?: string) => TPrometheusRangeParams;
@@ -0,0 +1,2 @@
1
+ export { buildPrometheusRangeParams } from './buildPrometheusRangeParams';
2
+ export type { TPrometheusRangeParams } from './buildPrometheusRangeParams';
@@ -0,0 +1 @@
1
+ export declare const formatBytes: (raw: unknown) => string;
@@ -0,0 +1 @@
1
+ export declare const formatTimestamp: (raw: unknown) => string;
@@ -0,0 +1,2 @@
1
+ export { formatBytes } from './formatBytes';
2
+ export { formatTimestamp } from './formatTimestamp';
@@ -0,0 +1,9 @@
1
+ export type { TPrometheusRangeResponse } from './types';
2
+ export { matrixToLineSingle, matrixToLineMulti } from './toLine';
3
+ export type { TChartPoint, TRechartsSeries } from './toLine';
4
+ export { seriesToStackedAreaData } from './toAreaStacked';
5
+ export type { TStackedAreaPoint } from './toAreaStacked';
6
+ export { seriesToReducedVector } from './toReducedVector';
7
+ export type { TReducedVectorItem, TAggregationMode } from './toReducedVector';
8
+ export { matrixToTableMinMaxCurrent } from './toTableRows';
9
+ export type { TSeriesStatsRow } from './toTableRows';
@@ -0,0 +1,2 @@
1
+ export { seriesToStackedAreaData } from './matrixToAreaStackedAdapter';
2
+ export type { TStackedAreaPoint } from './matrixToAreaStackedAdapter';
@@ -0,0 +1,14 @@
1
+ import { TRechartsSeries } from '../toLine';
2
+ export type TStackedAreaPoint = {
3
+ timestamp: number;
4
+ [seriesId: string]: number;
5
+ };
6
+ /**
7
+ * Builds stacked-area-compatible data from TRechartsSeries[].
8
+ * Shape:
9
+ * [
10
+ * { timestamp: 1000, c1: 1, p2: 3 },
11
+ * { timestamp: 2000, c1: 2 },
12
+ * ]
13
+ */
14
+ export declare const seriesToStackedAreaData: (series: TRechartsSeries[] | undefined) => TStackedAreaPoint[];
@@ -0,0 +1,2 @@
1
+ export { matrixToLineSingle, matrixToLineMulti } from './matrixToLineAdapter';
2
+ export type { TChartPoint, TRechartsSeries } from './matrixToLineAdapter';
@@ -0,0 +1,12 @@
1
+ import { TPrometheusRangeResponse } from '../types';
2
+ export type TChartPoint = {
3
+ timestamp: number;
4
+ value: number;
5
+ };
6
+ export declare const matrixToLineSingle: (resp: TPrometheusRangeResponse) => TChartPoint[];
7
+ export type TRechartsSeries = {
8
+ id: string;
9
+ metric: Record<string, string>;
10
+ data?: TChartPoint[];
11
+ };
12
+ export declare const matrixToLineMulti: (resp: TPrometheusRangeResponse) => TRechartsSeries[];
@@ -0,0 +1,2 @@
1
+ export { seriesToReducedVector } from './matrixToReducedVectorAdapter';
2
+ export type { TReducedVectorItem, TAggregationMode } from './matrixToReducedVectorAdapter';
@@ -0,0 +1,8 @@
1
+ import type { TRechartsSeries } from '../toLine';
2
+ export type TReducedVectorItem = {
3
+ id: string;
4
+ metric: Record<string, string>;
5
+ value: number;
6
+ };
7
+ export type TAggregationMode = 'last' | 'avg' | 'sum' | 'max' | 'min';
8
+ export declare const seriesToReducedVector: (series: TRechartsSeries[] | undefined, mode?: TAggregationMode) => TReducedVectorItem[];
@@ -0,0 +1,2 @@
1
+ export { matrixToTableMinMaxCurrent } from './matrixToTableRowsAdapter';
2
+ export type { TSeriesStatsRow } from './matrixToTableRowsAdapter';
@@ -0,0 +1,12 @@
1
+ import { TPrometheusRangeResponse } from '../types';
2
+ export type TSeriesStatsRow = {
3
+ id: string;
4
+ metric: Record<string, string>;
5
+ min: number | null;
6
+ max: number | null;
7
+ current: number | null;
8
+ minTs?: number | null;
9
+ maxTs?: number | null;
10
+ currentTs?: number | null;
11
+ };
12
+ export declare const matrixToTableMinMaxCurrent: (resp: TPrometheusRangeResponse) => TSeriesStatsRow[];
@@ -0,0 +1,10 @@
1
+ export type TPrometheusRangeResponse = {
2
+ status: 'success' | 'error';
3
+ data: {
4
+ resultType: 'matrix';
5
+ result: {
6
+ metric: Record<string, string>;
7
+ values: [number, string][];
8
+ }[];
9
+ };
10
+ };
@@ -0,0 +1 @@
1
+ export declare const pickSeriesId: (metric: Record<string, string>, idx: number) => string;
@@ -0,0 +1,11 @@
1
+ export type { TPrometheusVectorResponse } from './types';
2
+ export { vectorToBarVertical, vectorToBarHorizontal } from './toBar';
3
+ export type { TBarItem } from './toBar';
4
+ export { vectorToBarGauge } from './toBarGauge';
5
+ export type { TBarGaugeItem } from './toBarGauge';
6
+ export { vectorToGaugeRadial } from './toGaugeRadial';
7
+ export type { TRadialGaugeValue } from './toGaugeRadial';
8
+ export { vectorToPie } from './toPie';
9
+ export type { TPieSlice } from './toPie';
10
+ export { vectorToTableRows } from './toTableRows';
11
+ export type { TTableRow } from './toTableRows';
@@ -0,0 +1,2 @@
1
+ export { vectorToBarVertical, vectorToBarHorizontal } from './vectorToBarAdapter';
2
+ export type { TBarItem } from './vectorToBarAdapter';
@@ -0,0 +1,18 @@
1
+ import { TPrometheusVectorResponse } from '../types';
2
+ export type TBarItem = {
3
+ id: string;
4
+ metric: Record<string, string>;
5
+ timestamp?: number;
6
+ value: number;
7
+ };
8
+ /**
9
+ * Vertical bar: typically X = id (category), Y = value.
10
+ * Return: [{ id, value, metric, timestamp? }, ...]
11
+ */
12
+ export declare const vectorToBarVertical: (resp: TPrometheusVectorResponse) => TBarItem[];
13
+ /**
14
+ * Horizontal bar: often Y = id (category), X = value.
15
+ * Data shape can be identical; the chart config swaps axes.
16
+ * Return: [{ id, value, metric, timestamp? }, ...]
17
+ */
18
+ export declare const vectorToBarHorizontal: (resp: TPrometheusVectorResponse) => TBarItem[];
@@ -0,0 +1,2 @@
1
+ export { vectorToBarGauge } from './vectorToBarGaugeAdapter';
2
+ export type { TBarGaugeItem } from './vectorToBarGaugeAdapter';
@@ -0,0 +1,7 @@
1
+ import { TPrometheusVectorResponse } from '../types';
2
+ export type TBarGaugeItem = {
3
+ id: string;
4
+ value: number;
5
+ metric: Record<string, string>;
6
+ };
7
+ export declare const vectorToBarGauge: (resp: TPrometheusVectorResponse) => TBarGaugeItem[];
@@ -0,0 +1,2 @@
1
+ export { vectorToGaugeRadial } from './vectorToGaugeRadialAdapter';
2
+ export type { TRadialGaugeValue } from './vectorToGaugeRadialAdapter';
@@ -0,0 +1,7 @@
1
+ import { TPrometheusVectorResponse } from '../types';
2
+ export type TRadialGaugeValue = {
3
+ id: string;
4
+ value: number;
5
+ metric: Record<string, string>;
6
+ };
7
+ export declare const vectorToGaugeRadial: (resp: TPrometheusVectorResponse) => TRadialGaugeValue | null;
@@ -0,0 +1,2 @@
1
+ export { vectorToPie } from './vectorToPieAdapter';
2
+ export type { TPieSlice } from './vectorToPieAdapter';
@@ -0,0 +1,7 @@
1
+ import { TPrometheusVectorResponse } from '../types';
2
+ export type TPieSlice = {
3
+ id: string;
4
+ value: number;
5
+ metric: Record<string, string>;
6
+ };
7
+ export declare const vectorToPie: (resp: TPrometheusVectorResponse) => TPieSlice[];
@@ -0,0 +1,2 @@
1
+ export { vectorToTableRows } from './vectorToTableRowsAdapter';
2
+ export type { TTableRow } from './vectorToTableRowsAdapter';
@@ -0,0 +1,8 @@
1
+ import { TPrometheusVectorResponse } from '../types';
2
+ export type TTableRow = {
3
+ id: string;
4
+ value: number;
5
+ timestamp: number;
6
+ metric: Record<string, string>;
7
+ };
8
+ export declare const vectorToTableRows: (resp: TPrometheusVectorResponse) => TTableRow[];
@@ -0,0 +1,10 @@
1
+ export type TPrometheusVectorResponse = {
2
+ status: 'success' | 'error';
3
+ data: {
4
+ resultType: 'vector';
5
+ result: {
6
+ metric: Record<string, string>;
7
+ value: [number, string];
8
+ }[];
9
+ };
10
+ };
@@ -157,6 +157,8 @@ export type TDynamicComponentsAppTypeMap = {
157
157
  VisibilityContainer: {
158
158
  id: number | string;
159
159
  value: string;
160
+ criteria?: 'equals' | 'notEquals' | 'exists' | 'notExists';
161
+ valueToCompare?: string | string[];
160
162
  };
161
163
  ArrayOfObjectsToKeyValues: {
162
164
  id: number | string;
@@ -0,0 +1,8 @@
1
+ export declare const useKinds: ({ cluster, refetchInterval, isEnabled, }: {
2
+ cluster: string;
3
+ refetchInterval?: number | false | undefined;
4
+ isEnabled?: boolean | undefined;
5
+ }) => import("@tanstack/react-query/build/legacy/types").UseQueryResult<{
6
+ kindIndex: import("..").TKindIndex;
7
+ kindsWithVersion: import("..").TKindWithVersion[];
8
+ }, Error>;
@@ -28,6 +28,7 @@ export type { TConnStatus, TUseListWatchQuery, TUseListWatchOptions, TUseListWat
28
28
  export { useK8sVerbs } from './hooks/useK8sVerbs';
29
29
  export { useK8sSmartResource, useManyK8sSmartResource, useSmartResourceParams } from './hooks/useK8sSmartResource';
30
30
  export { useResourceScope } from './hooks/useResourceScope';
31
+ export { useKinds } from './hooks/useKinds';
31
32
  export type { TRequestError } from './localTypes/api';
32
33
  export type { TClusterList } from './localTypes/clusterList';
33
34
  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.2.0-alpha.13",
3
+ "version": "1.2.0-alpha.15",
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",
@@ -96,6 +96,8 @@
96
96
  "jest": "29.7.0",
97
97
  "jest-environment-jsdom": "29.7.0",
98
98
  "jest-styled-components": "^7.2.0",
99
+ "msw": "2.12.4",
100
+ "msw-storybook-addon": "2.0.6",
99
101
  "postcss": "8.5.2",
100
102
  "postcss-styled-syntax": "0.7.1",
101
103
  "prettier": "3.0.2",
@@ -127,5 +129,10 @@
127
129
  },
128
130
  "keywords": [],
129
131
  "author": "",
130
- "license": "MIT"
132
+ "license": "MIT",
133
+ "msw": {
134
+ "workerDirectory": [
135
+ "public"
136
+ ]
137
+ }
131
138
  }
@@ -1,6 +0,0 @@
1
- import { FC } from 'react';
2
- type MemoryChartProps = {
3
- range?: string;
4
- };
5
- export declare const MemoryChart: FC<MemoryChartProps>;
6
- export {};
@@ -1,6 +0,0 @@
1
- import { FC } from 'react';
2
- type MemoryChartProps = {
3
- range?: string;
4
- };
5
- export declare const MemoryChartMulti: FC<MemoryChartProps>;
6
- export {};
@@ -1,7 +0,0 @@
1
- import { ChartPoint } from '../utils/prometheusAdapter';
2
- export declare const usePrometheusQueryRange: ({ query, range, refetchInterval, enabled, }: {
3
- query: string;
4
- range?: string | undefined;
5
- refetchInterval?: number | false | undefined;
6
- enabled?: boolean | undefined;
7
- }) => import("@tanstack/react-query/build/legacy/types").UseQueryResult<ChartPoint[], Error>;
@@ -1,7 +0,0 @@
1
- import { RechartsSeries } from '../utils/prometheusAdapter';
2
- export declare const usePrometheusQueryRangeMulti: ({ query, range, refetchInterval, enabled, }: {
3
- query: string;
4
- range?: string | undefined;
5
- refetchInterval?: number | false | undefined;
6
- enabled?: boolean | undefined;
7
- }) => import("@tanstack/react-query/build/legacy/types").UseQueryResult<RechartsSeries[], Error>;
@@ -1,21 +0,0 @@
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[];