@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
|
@@ -9,15 +9,18 @@ export type TNavigationResource = unknown & {
|
|
|
9
9
|
projects?: {
|
|
10
10
|
clear: string;
|
|
11
11
|
change: string;
|
|
12
|
+
aliasPath?: string;
|
|
12
13
|
};
|
|
13
14
|
instances?: {
|
|
14
15
|
clear: string;
|
|
15
16
|
change: string;
|
|
16
17
|
mapOptionsPattern?: string;
|
|
18
|
+
aliasPath?: string;
|
|
17
19
|
};
|
|
18
20
|
namespaces?: {
|
|
19
21
|
clear: string;
|
|
20
22
|
change: string;
|
|
23
|
+
aliasPath?: string;
|
|
21
24
|
};
|
|
22
25
|
baseFactoriesMapping?: Record<string, string>;
|
|
23
26
|
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { TUnitInput, TConvertOptions } from '../../localTypes/factories/converterBytes';
|
|
2
|
+
/**
|
|
3
|
+
* Convert bytes -> target unit.
|
|
4
|
+
* @returns number by default (e.g., 1.5), or "1.50 GiB" if format=true
|
|
5
|
+
*/
|
|
6
|
+
export declare const convertBytes: (bytes: number, unit: TUnitInput, opts?: TConvertOptions) => number | string;
|
|
7
|
+
/**
|
|
8
|
+
* Optional helper: auto-scale bytes to the "best" unit in SI or IEC.
|
|
9
|
+
* standard: "si" (powers of 1000) or "iec" (powers of 1024). Default "si".
|
|
10
|
+
*/
|
|
11
|
+
export declare const formatBytesAuto: (bytes: number, options?: {
|
|
12
|
+
standard?: 'si' | 'iec';
|
|
13
|
+
precision?: number;
|
|
14
|
+
locale?: string;
|
|
15
|
+
}) => string;
|
|
16
|
+
/** Internal helper: convert value in given unit -> bytes (number) */
|
|
17
|
+
export declare const toBytes: (value: number, from: TUnitInput) => number;
|
|
18
|
+
/**
|
|
19
|
+
* Generic helper: convert value in some unit -> target unit.
|
|
20
|
+
* Uses bytes as intermediate.
|
|
21
|
+
*/
|
|
22
|
+
export declare const convertStorage: (value: number, from: TUnitInput, to: TUnitInput, opts?: TConvertOptions) => number | string;
|
|
23
|
+
/**
|
|
24
|
+
* Try to parse a string like:
|
|
25
|
+
* "12312312Ki"
|
|
26
|
+
* " 12.5 GiB"
|
|
27
|
+
* "1000" (no unit -> unit undefined)
|
|
28
|
+
*/
|
|
29
|
+
export declare const parseValueWithUnit: (input: string) => {
|
|
30
|
+
value: number;
|
|
31
|
+
unit?: TUnitInput | undefined;
|
|
32
|
+
} | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { convertBytes, formatBytesAuto, toBytes, convertStorage, parseValueWithUnit } from './converterBytes';
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { TCoreUnitInput, TCoreConvertOptions } from '../../localTypes/factories/converterCores';
|
|
2
|
+
/**
|
|
3
|
+
* Convert cores -> target unit (core/mcore/ucore/ncore).
|
|
4
|
+
* The input `cores` is ALWAYS in **cores** (base unit).
|
|
5
|
+
*
|
|
6
|
+
* @returns number by default (e.g., 0.5 -> 500 when unit="mcore"),
|
|
7
|
+
* or "500 mcore" if format=true
|
|
8
|
+
*/
|
|
9
|
+
export declare const convertCores: (cores: number, unit: TCoreUnitInput, opts?: TCoreConvertOptions) => number | string;
|
|
10
|
+
/**
|
|
11
|
+
* Auto-scale cores across core/mcore/ucore/ncore.
|
|
12
|
+
*
|
|
13
|
+
* - cores >= 1 -> core
|
|
14
|
+
* - 1e-3 <= cores < 1 -> mcore
|
|
15
|
+
* - 1e-6 <= cores < 1e-3 -> ucore
|
|
16
|
+
* - cores < 1e-6 -> ncore
|
|
17
|
+
*/
|
|
18
|
+
export declare const formatCoresAuto: (cores: number, options?: {
|
|
19
|
+
precision?: number;
|
|
20
|
+
locale?: string;
|
|
21
|
+
}) => string;
|
|
22
|
+
/** Internal helper: convert value in given unit -> cores (number). */
|
|
23
|
+
export declare const toCores: (value: number, from: TCoreUnitInput) => number;
|
|
24
|
+
/**
|
|
25
|
+
* Generic helper: convert value in some unit -> target unit.
|
|
26
|
+
* Uses cores as intermediate.
|
|
27
|
+
*
|
|
28
|
+
* Examples:
|
|
29
|
+
* convertCompute(500, "m", "core") // 0.5
|
|
30
|
+
* convertCompute(2, "core", "m", {format: true}) // "2,000 mcore" (or locale variant)
|
|
31
|
+
* convertCompute(1_000_000, "n", "core") // 0.001
|
|
32
|
+
*/
|
|
33
|
+
export declare const convertCompute: (value: number, from: TCoreUnitInput, to: TCoreUnitInput, opts?: TCoreConvertOptions) => number | string;
|
|
34
|
+
/**
|
|
35
|
+
* Try to parse a string like:
|
|
36
|
+
* "500m"
|
|
37
|
+
* " 0.5 core"
|
|
38
|
+
* "2 vcpu"
|
|
39
|
+
* "1000000n"
|
|
40
|
+
* "1.5" (no unit -> unit undefined, treated as raw number-of-cores upstream)
|
|
41
|
+
*/
|
|
42
|
+
export declare const parseCoresWithUnit: (input: string) => {
|
|
43
|
+
value: number;
|
|
44
|
+
unit?: string | undefined;
|
|
45
|
+
} | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { convertCores, formatCoresAuto, toCores, convertCompute, parseCoresWithUnit } from './converterCores';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { TApiGroupList, TBuiltinResourceTypeList } from '../../localTypes/k8s';
|
|
2
|
-
export declare const getGroupsByCategory: ({
|
|
3
|
-
|
|
2
|
+
export declare const getGroupsByCategory: ({ cluster, apiGroupListData, builtinResourceTypesData, namespace, noncrds, }: {
|
|
3
|
+
cluster: string;
|
|
4
4
|
namespace?: string | undefined;
|
|
5
5
|
apiGroupListData?: {
|
|
6
6
|
apiVersion: string;
|
|
@@ -23,3 +23,5 @@ export { getLinkToBuiltinForm, getLinkToApiForm, getLinkToForm } from './tableLo
|
|
|
23
23
|
export { isMultilineString, isMultilineFromYaml } from './isMultilineString';
|
|
24
24
|
export { includesArray } from './nestedStringsArrayInclude';
|
|
25
25
|
export { getResourceLink, getNamespaceLink } from './getResourceLink';
|
|
26
|
+
export { convertBytes, formatBytesAuto, toBytes, convertStorage, parseValueWithUnit } from './converterBytes';
|
|
27
|
+
export { convertCores, formatCoresAuto, toCores, convertCompute, parseCoresWithUnit } from './converterCores';
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
export declare const getBackLinkToTable: ({ fullPath }: {
|
|
2
2
|
fullPath: string;
|
|
3
3
|
}) => string;
|
|
4
|
-
export declare const getLinkToBuiltinForm: ({ cluster, baseprefix, namespace, syntheticProject,
|
|
4
|
+
export declare const getLinkToBuiltinForm: ({ cluster, baseprefix, namespace, syntheticProject, plural, inside, fullPath, }: {
|
|
5
5
|
cluster: string;
|
|
6
6
|
baseprefix?: string | undefined;
|
|
7
7
|
namespace?: string | undefined;
|
|
8
8
|
syntheticProject?: string | undefined;
|
|
9
|
-
|
|
9
|
+
plural: string;
|
|
10
10
|
inside?: boolean | undefined;
|
|
11
11
|
fullPath: string;
|
|
12
12
|
}) => string;
|
|
13
|
-
export declare const getLinkToApiForm: ({ cluster, baseprefix, namespace, syntheticProject, apiGroup, apiVersion,
|
|
13
|
+
export declare const getLinkToApiForm: ({ cluster, baseprefix, namespace, syntheticProject, apiGroup, apiVersion, plural, inside, fullPath, }: {
|
|
14
14
|
cluster: string;
|
|
15
15
|
baseprefix?: string | undefined;
|
|
16
16
|
namespace?: string | undefined;
|
|
17
17
|
syntheticProject?: string | undefined;
|
|
18
18
|
apiGroup?: string | undefined;
|
|
19
19
|
apiVersion?: string | undefined;
|
|
20
|
-
|
|
20
|
+
plural: string;
|
|
21
21
|
inside?: boolean | undefined;
|
|
22
22
|
fullPath: string;
|
|
23
23
|
searchMount?: boolean | undefined;
|
|
@@ -29,7 +29,7 @@ export declare const getLinkToForm: ({ apiGroup, ...rest }: {
|
|
|
29
29
|
syntheticProject?: string | undefined;
|
|
30
30
|
apiGroup?: string | undefined;
|
|
31
31
|
apiVersion?: string | undefined;
|
|
32
|
-
|
|
32
|
+
plural: string;
|
|
33
33
|
inside?: boolean | undefined;
|
|
34
34
|
fullPath: string;
|
|
35
35
|
searchMount?: boolean | undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prorobotech/openapi-k8s-toolkit",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0-alpha.10",
|
|
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",
|
|
@@ -54,6 +54,7 @@
|
|
|
54
54
|
"lodash": "4.17.21",
|
|
55
55
|
"openapi-types": "12.1.3",
|
|
56
56
|
"react-redux": "9.1.2",
|
|
57
|
+
"recharts": "3.5.1",
|
|
57
58
|
"spoiled": "0.4.0",
|
|
58
59
|
"styled-components": "6.0.7",
|
|
59
60
|
"typescript": "4.9.5",
|
package/dist/types/components/organisms/DynamicComponents/molecules/ConverterBytes/types.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export type TCanonicalUnit = 'B' | 'kB' | 'MB' | 'GB' | 'TB' | 'PB' | 'EB' | 'KiB' | 'MiB' | 'GiB' | 'TiB' | 'PiB' | 'EiB';
|
|
2
|
-
export type TUnitInput = TCanonicalUnit | 'k' | 'm' | 'g' | 't' | 'p' | 'e' | 'K' | 'M' | 'G' | 'T' | 'P' | 'E' | 'KB' | 'Mb' | 'MB' | 'Gb' | 'GB' | 'Tb' | 'TB' | 'Pb' | 'PB' | 'Eb' | 'EB' | '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
|
-
};
|
package/dist/types/components/organisms/DynamicComponents/molecules/ConverterBytes/utils.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { TUnitInput, TConvertOptions } from './types';
|
|
2
|
-
/**
|
|
3
|
-
* Convert bytes -> target unit.
|
|
4
|
-
* @returns number by default (e.g., 1.5), or "1.50 GiB" if format=true
|
|
5
|
-
*/
|
|
6
|
-
export declare const convertBytes: (bytes: number, unit: TUnitInput, opts?: TConvertOptions) => number | string;
|
|
7
|
-
/**
|
|
8
|
-
* Optional helper: auto-scale bytes to the "best" unit in SI or IEC.
|
|
9
|
-
* standard: "si" (powers of 1000) or "iec" (powers of 1024). Default "si".
|
|
10
|
-
*/
|
|
11
|
-
export declare const formatBytesAuto: (bytes: number, options?: {
|
|
12
|
-
standard?: 'si' | 'iec';
|
|
13
|
-
precision?: number;
|
|
14
|
-
locale?: string;
|
|
15
|
-
}) => string;
|
|
File without changes
|