@prorobotech/openapi-k8s-toolkit 0.0.1-alpha.99 → 1.1.0-alpha.1

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 (147) hide show
  1. package/dist/openapi-k8s-toolkit.es.js +42361 -37787
  2. package/dist/openapi-k8s-toolkit.es.js.map +1 -1
  3. package/dist/openapi-k8s-toolkit.umd.js +52019 -47422
  4. package/dist/openapi-k8s-toolkit.umd.js.map +1 -1
  5. package/dist/types/api/bff/search/getKinds.d.ts +4 -0
  6. package/dist/types/api/forms.d.ts +4 -4
  7. package/dist/types/api/getApiResource.d.ts +6 -3
  8. package/dist/types/api/getApiResourceTypes.d.ts +2 -2
  9. package/dist/types/api/getBuiltinResource.d.ts +6 -3
  10. package/dist/types/api/getBuiltinResourceTypes.d.ts +1 -1
  11. package/dist/types/api/getCrdData.d.ts +1 -1
  12. package/dist/types/api/getCrdResource.d.ts +2 -2
  13. package/dist/types/api/getDirectUnknownResource.d.ts +1 -1
  14. package/dist/types/api/permissions.d.ts +4 -3
  15. package/dist/types/components/atoms/CursorDefaultDiv/CursorDefaultDiv.d.ts +6 -0
  16. package/dist/types/components/atoms/CursorDefaultDiv/index.d.ts +1 -0
  17. package/dist/types/components/atoms/CursorPointerTagMinContent/CursorPointerTagMinContent.d.ts +285 -0
  18. package/dist/types/components/atoms/CursorPointerTagMinContent/index.d.ts +1 -0
  19. package/dist/types/components/atoms/Icons/BackToDefaultIcon.d.ts +5 -1
  20. package/dist/types/components/atoms/Icons/DeleteIcon.d.ts +6 -1
  21. package/dist/types/components/atoms/Icons/DownIcon.d.ts +5 -1
  22. package/dist/types/components/atoms/Icons/EarthIcon.d.ts +6 -0
  23. package/dist/types/components/atoms/Icons/EditIcon.d.ts +6 -1
  24. package/dist/types/components/atoms/Icons/LockedIcon.d.ts +5 -1
  25. package/dist/types/components/atoms/Icons/LookingGlassIcon.d.ts +7 -0
  26. package/dist/types/components/atoms/Icons/MinusIcon.d.ts +5 -1
  27. package/dist/types/components/atoms/Icons/PauseCircleIcon.d.ts +5 -1
  28. package/dist/types/components/atoms/Icons/PlusIcon.d.ts +5 -1
  29. package/dist/types/components/atoms/Icons/ResumeCircleIcon.d.ts +5 -1
  30. package/dist/types/components/atoms/Icons/SuccessIcon.d.ts +5 -1
  31. package/dist/types/components/atoms/Icons/UnlockedIcon.d.ts +5 -1
  32. package/dist/types/components/atoms/Icons/UpIcon.d.ts +5 -1
  33. package/dist/types/components/atoms/Icons/index.d.ts +2 -0
  34. package/dist/types/components/atoms/PaddingContainer/PaddingContainer.d.ts +6 -0
  35. package/dist/types/components/atoms/PaddingContainer/index.d.ts +1 -0
  36. package/dist/types/components/atoms/index.d.ts +3 -0
  37. package/dist/types/components/molecules/BlackholeForm/atoms/HiddenContainer/HiddenContainer.d.ts +2 -4
  38. package/dist/types/components/molecules/BlackholeForm/atoms/HiddenContainer/utils.d.ts +3 -0
  39. package/dist/types/components/molecules/BlackholeForm/molecules/FormInlineYamlEditor/FormInlineYamlEditor.d.ts +7 -0
  40. package/dist/types/components/molecules/BlackholeForm/molecules/FormInlineYamlEditor/index.d.ts +1 -0
  41. package/dist/types/components/molecules/BlackholeForm/molecules/FormInlineYamlEditor/styled.d.ts +8 -0
  42. package/dist/types/components/molecules/BlackholeForm/molecules/FormListInput/utils.d.ts +5 -0
  43. package/dist/types/components/molecules/BlackholeForm/molecules/FormStringMultilineInput/FormStringMultilineInput.d.ts +20 -0
  44. package/dist/types/components/molecules/BlackholeForm/molecules/FormStringMultilineInput/helpers.d.ts +2 -0
  45. package/dist/types/components/molecules/BlackholeForm/molecules/FormStringMultilineInput/index.d.ts +1 -0
  46. package/dist/types/components/molecules/BlackholeForm/molecules/FormStringMultilineInput/styled.d.ts +548 -0
  47. package/dist/types/components/molecules/BlackholeForm/molecules/YamlEditor/YamlEditor.d.ts +1 -0
  48. package/dist/types/components/molecules/BlackholeForm/molecules/YamlEditor/styled.d.ts +5 -273
  49. package/dist/types/components/molecules/BlackholeForm/molecules/YamlEditorSingleton/YamlEditorSingleton.d.ts +1 -0
  50. package/dist/types/components/molecules/BlackholeForm/molecules/YamlEditorSingleton/styled.d.ts +1 -0
  51. package/dist/types/components/molecules/BlackholeForm/molecules/index.d.ts +2 -0
  52. package/dist/types/components/molecules/BlackholeForm/organisms/BlackholeForm/BlackholeForm.d.ts +1 -0
  53. package/dist/types/components/molecules/BlackholeForm/organisms/BlackholeForm/helpers/casts.d.ts +43 -0
  54. package/dist/types/components/molecules/BlackholeForm/organisms/BlackholeForm/helpers/debugs.d.ts +8 -0
  55. package/dist/types/components/molecules/BlackholeForm/organisms/BlackholeForm/helpers/getSortedPropertyKeys.d.ts +9 -0
  56. package/dist/types/components/molecules/BlackholeForm/organisms/BlackholeForm/helpers/hiddenExpanded.d.ts +8 -0
  57. package/dist/types/components/molecules/BlackholeForm/organisms/BlackholeForm/helpers/prefills.d.ts +10 -0
  58. package/dist/types/components/molecules/BlackholeForm/organisms/BlackholeForm/utils.d.ts +22 -3
  59. package/dist/types/components/molecules/EnrichedTable/molecules/TableFactory/TableFactory.d.ts +9 -0
  60. package/dist/types/components/molecules/EnrichedTable/molecules/TableFactory/index.d.ts +1 -0
  61. package/dist/types/components/molecules/EnrichedTable/molecules/index.d.ts +1 -0
  62. package/dist/types/components/molecules/EnrichedTable/organisms/EnrichedTable/EnrichedTable.d.ts +5 -4
  63. package/dist/types/components/molecules/EnrichedTable/organisms/EnrichedTable/utils.d.ts +16 -2
  64. package/dist/types/components/molecules/EnrichedTable/organisms/EnrichedTableProvider/EnrichedTableProvider.d.ts +10 -8
  65. package/dist/types/components/molecules/Events/Events.d.ts +16 -0
  66. package/dist/types/components/molecules/Events/index.d.ts +1 -0
  67. package/dist/types/components/molecules/Events/molecules/EventRow/EventRow.d.ts +16 -0
  68. package/dist/types/components/molecules/Events/molecules/EventRow/index.d.ts +1 -0
  69. package/dist/types/components/molecules/Events/molecules/EventRow/styled.d.ts +830 -0
  70. package/dist/types/components/molecules/Events/molecules/EventRow/utils.d.ts +24 -0
  71. package/dist/types/components/molecules/Events/molecules/index.d.ts +1 -0
  72. package/dist/types/components/molecules/Events/reducer.d.ts +20 -0
  73. package/dist/types/components/molecules/Events/styled.d.ts +1650 -0
  74. package/dist/types/components/molecules/Events/types.d.ts +57 -0
  75. package/dist/types/components/molecules/Events/utils.d.ts +11 -0
  76. package/dist/types/components/molecules/ManageableBreadcrumbs/ManageableBreadcrumbs.d.ts +4 -2
  77. package/dist/types/components/molecules/ManageableBreadcrumbs/utils.d.ts +2 -2
  78. package/dist/types/components/molecules/ManageableSidebar/ManageableSidebar.d.ts +4 -2
  79. package/dist/types/components/molecules/ManageableSidebar/types.d.ts +1 -0
  80. package/dist/types/components/molecules/ManageableSidebar/utils.d.ts +1 -0
  81. package/dist/types/components/molecules/MarketPlace/MarketPlace.d.ts +2 -0
  82. package/dist/types/components/molecules/MarketPlace/molecules/MarketplaceCard/MarketplaceCard.d.ts +1 -0
  83. package/dist/types/components/molecules/ProjectInfoCard/ProjectInfoCard.d.ts +1 -0
  84. package/dist/types/components/molecules/Search/Search.d.ts +18 -0
  85. package/dist/types/components/molecules/Search/index.d.ts +1 -0
  86. package/dist/types/components/molecules/Search/styled.d.ts +3361 -0
  87. package/dist/types/components/molecules/index.d.ts +2 -0
  88. package/dist/types/components/organisms/DynamicComponents/molecules/ConverterBytes/ConverterBytes.d.ts +5 -0
  89. package/dist/types/components/organisms/DynamicComponents/molecules/ConverterBytes/index.d.ts +1 -0
  90. package/dist/types/components/organisms/DynamicComponents/molecules/ConverterBytes/types.d.ts +10 -0
  91. package/dist/types/components/organisms/DynamicComponents/molecules/ConverterBytes/utils.d.ts +15 -0
  92. package/dist/types/components/organisms/DynamicComponents/molecules/EnrichedTable/utils.d.ts +1 -0
  93. package/dist/types/components/organisms/DynamicComponents/molecules/Events/Events.d.ts +6 -0
  94. package/dist/types/components/organisms/DynamicComponents/molecules/Events/index.d.ts +1 -0
  95. package/dist/types/components/organisms/DynamicComponents/molecules/Events/utils.d.ts +1 -0
  96. package/dist/types/components/organisms/DynamicComponents/molecules/LabelsToSearchParams/utils.d.ts +1 -0
  97. package/dist/types/components/organisms/DynamicComponents/molecules/ResourceBadge/ResourceBadge.d.ts +5 -0
  98. package/dist/types/components/organisms/DynamicComponents/molecules/ResourceBadge/index.d.ts +1 -0
  99. package/dist/types/components/organisms/DynamicComponents/molecules/ResourceBadge/styled.d.ts +8 -0
  100. package/dist/types/components/organisms/DynamicComponents/molecules/SecretBase64Plain/SecretBase64Plain.d.ts +5 -0
  101. package/dist/types/components/organisms/DynamicComponents/molecules/SecretBase64Plain/index.d.ts +1 -0
  102. package/dist/types/components/organisms/DynamicComponents/molecules/SecretBase64Plain/styled.d.ts +282 -0
  103. package/dist/types/components/organisms/DynamicComponents/molecules/StatusText/utils.d.ts +4 -2
  104. package/dist/types/components/organisms/DynamicComponents/molecules/index.d.ts +4 -0
  105. package/dist/types/components/organisms/DynamicComponents/types.d.ts +74 -10
  106. package/dist/types/components/organisms/DynamicRendererWithProviders/DynamicRendererWithProviders.d.ts +2 -0
  107. package/dist/types/components/organisms/DynamicRendererWithProviders/multiQueryProvider.d.ts +1 -0
  108. package/dist/types/hooks/useApiResource.d.ts +5 -1
  109. package/dist/types/hooks/useBuiltinResource.d.ts +5 -1
  110. package/dist/types/hooks/useCrdResource.d.ts +2 -1
  111. package/dist/types/hooks/useListThenWatch/index.d.ts +3 -0
  112. package/dist/types/hooks/useListThenWatch/reducer.d.ts +20 -0
  113. package/dist/types/hooks/useListThenWatch/types.d.ts +30 -0
  114. package/dist/types/hooks/useListThenWatch/useInfiniteSentinel.d.ts +2 -0
  115. package/dist/types/hooks/useListThenWatch/useListWatch.d.ts +71 -0
  116. package/dist/types/hooks/useListThenWatch/utils.d.ts +11 -0
  117. package/dist/types/hooks/usePermissions.d.ts +5 -4
  118. package/dist/types/index.d.ts +5 -0
  119. package/dist/types/localTypes/bff/form.d.ts +1 -0
  120. package/dist/types/localTypes/bff/search.d.ts +20 -0
  121. package/dist/types/localTypes/bff/table.d.ts +11 -4
  122. package/dist/types/localTypes/formExtensions.d.ts +9 -9
  123. package/dist/types/localTypes/richTable.d.ts +7 -2
  124. package/dist/types/localTypes/search.d.ts +7 -0
  125. package/dist/types/utils/deepMerge/deepMerge.d.ts +7 -0
  126. package/dist/types/utils/deepMerge/index.d.ts +1 -0
  127. package/dist/types/utils/getSortedKinds/getSortedKinds.d.ts +3 -0
  128. package/dist/types/utils/getSortedKinds/index.d.ts +1 -0
  129. package/dist/types/utils/getSortedKindsAll/getSortedKindsAll.d.ts +8 -0
  130. package/dist/types/utils/getSortedKindsAll/index.d.ts +1 -0
  131. package/dist/types/utils/getUppercase/getUppercase.d.ts +1 -0
  132. package/dist/types/utils/getUppercase/index.d.ts +1 -0
  133. package/dist/types/utils/hslFromString/hslFromString.d.ts +9 -0
  134. package/dist/types/utils/hslFromString/index.d.ts +1 -0
  135. package/dist/types/utils/index.d.ts +10 -0
  136. package/dist/types/utils/isMultilineString/index.d.ts +1 -0
  137. package/dist/types/utils/isMultilineString/isMultilineString.d.ts +13 -0
  138. package/dist/types/utils/isMultilineString/isMultilineString.test.d.ts +1 -0
  139. package/dist/types/utils/kindByGvr/index.d.ts +1 -0
  140. package/dist/types/utils/kindByGvr/kindByGvr.d.ts +6 -0
  141. package/dist/types/utils/namespacedByGvr/index.d.ts +1 -0
  142. package/dist/types/utils/namespacedByGvr/namespacedByGvr.d.ts +6 -0
  143. package/dist/types/utils/pluralByKind/index.d.ts +1 -0
  144. package/dist/types/utils/pluralByKind/pluralByKind.d.ts +10 -0
  145. package/dist/types/utils/tableLocations/index.d.ts +1 -0
  146. package/dist/types/utils/tableLocations/tableLocations.d.ts +36 -0
  147. package/package.json +3 -2
@@ -0,0 +1,20 @@
1
+ import { TSingleResource } from '../../localTypes/k8s';
2
+ type TState = {
3
+ order: string[];
4
+ byKey: Record<string, TSingleResource>;
5
+ };
6
+ type TAction = {
7
+ type: 'RESET';
8
+ items: TSingleResource[];
9
+ } | {
10
+ type: 'APPEND_PAGE';
11
+ items: TSingleResource[];
12
+ } | {
13
+ type: 'UPSERT';
14
+ item: TSingleResource;
15
+ } | {
16
+ type: 'REMOVE';
17
+ key: string;
18
+ };
19
+ export declare const reducer: (state: TState, action: TAction) => TState;
20
+ export {};
@@ -0,0 +1,30 @@
1
+ import { TSingleResource } from '../../localTypes/k8s';
2
+ type TWatchPhase = 'ADDED' | 'MODIFIED' | 'DELETED' | 'BOOKMARK';
3
+ type TInitialFrame = {
4
+ type: 'INITIAL';
5
+ items: TSingleResource[];
6
+ continue?: string;
7
+ remainingItemCount?: number;
8
+ resourceVersion?: string;
9
+ };
10
+ type TPageFrame = {
11
+ type: 'PAGE';
12
+ items: TSingleResource[];
13
+ continue?: string;
14
+ remainingItemCount?: number;
15
+ };
16
+ type TPageErrorFrame = {
17
+ type: 'PAGE_ERROR';
18
+ error: string;
19
+ };
20
+ type TDeltaFrame = {
21
+ type: TWatchPhase;
22
+ item: TSingleResource;
23
+ };
24
+ export type TServerFrame = TInitialFrame | TPageFrame | TPageErrorFrame | TDeltaFrame;
25
+ export type TScrollMsg = {
26
+ type: 'SCROLL';
27
+ continue: string;
28
+ limit?: number;
29
+ };
30
+ export {};
@@ -0,0 +1,2 @@
1
+ import { RefObject } from 'react';
2
+ export declare const useInfiniteSentinel: (sentinelRef: RefObject<HTMLElement>, hasMore: boolean, onNeedMore: () => void) => void;
@@ -0,0 +1,71 @@
1
+ import { TSingleResource } from '../../localTypes/k8s';
2
+ export type TConnStatus = 'connecting' | 'open' | 'closed';
3
+ /**
4
+ * Parameters that define which resource collection we are listing/watching.
5
+ * These map to common Kubernetes list params and discovery fields.
6
+ */
7
+ export type TUseListWatchQuery = {
8
+ namespace?: string;
9
+ apiGroup?: string;
10
+ apiVersion: string;
11
+ plural: string;
12
+ fieldSelector?: string;
13
+ labelSelector?: string;
14
+ initialLimit?: number;
15
+ initialContinue?: string;
16
+ };
17
+ /**
18
+ * Hook configuration flags and callbacks.
19
+ */
20
+ export type TUseListWatchOptions = {
21
+ /** Base WebSocket URL or path (http[s] will be auto-upgraded to ws[s]) */
22
+ wsUrl: string;
23
+ /** Page size for subsequent SCROLL requests */
24
+ pageSize?: number;
25
+ /** Temporarily pause applying ADDED/MODIFIED/DELETED updates */
26
+ paused?: boolean;
27
+ /** Skip applying DELETED events when true */
28
+ ignoreRemove?: boolean;
29
+ /** Optional connection status observer */
30
+ onStatus?: (s: TConnStatus) => void;
31
+ /** Optional error observer */
32
+ onError?: (msg: string) => void;
33
+ /** If true, auto-fetch all remaining pages after snapshot */
34
+ autoDrain?: boolean;
35
+ /** If false, reset state when URL or query changes */
36
+ preserveStateOnUrlChange?: boolean;
37
+ /** Gate the hook on/off. When false, no WebSocket is opened. */
38
+ isEnabled?: boolean;
39
+ /** What to list/watch */
40
+ query: TUseListWatchQuery;
41
+ };
42
+ /**
43
+ * Values returned from the hook for rendering and control.
44
+ */
45
+ export type TUseListWatchReturn = {
46
+ state: {
47
+ order: string[];
48
+ byKey: Record<string, TSingleResource>;
49
+ };
50
+ total: number;
51
+ hasMore: boolean;
52
+ continueToken?: string;
53
+ status: TConnStatus;
54
+ lastError?: string;
55
+ setPaused: (v: boolean) => void;
56
+ setIgnoreRemove: (v: boolean) => void;
57
+ /** Ask the server for the next page (if any) */
58
+ sendScroll: () => void;
59
+ /** Drain multiple pages sequentially (client-side pagination helper) */
60
+ drainAll: (opts?: {
61
+ maxPages?: number;
62
+ maxItems?: number;
63
+ }) => Promise<number>;
64
+ /** Manually reconnect the socket (cancels any pending auto-reconnect) */
65
+ reconnect: () => void;
66
+ /** Change the base WebSocket URL (will reconnect if enabled) */
67
+ setUrl: (next: string) => void;
68
+ /** Update the list/watch query (will reconnect if enabled) */
69
+ setQuery: (q: TUseListWatchQuery) => void;
70
+ };
71
+ export declare const useListWatch: ({ wsUrl, pageSize, paused, ignoreRemove, onStatus, onError, autoDrain, preserveStateOnUrlChange, isEnabled, query, }: TUseListWatchOptions) => TUseListWatchReturn;
@@ -0,0 +1,11 @@
1
+ import { TSingleResource } from '../../localTypes/k8s';
2
+ export declare const eventKey: (e: TSingleResource) => string;
3
+ export declare const compareRV: (a: string, b: string) => number;
4
+ type WithRV = {
5
+ metadata?: {
6
+ resourceVersion?: string;
7
+ };
8
+ };
9
+ export declare const getRV: (item: WithRV) => string | undefined;
10
+ export declare const getMaxRV: <T extends WithRV>(items: readonly T[]) => string | undefined;
11
+ export {};
@@ -1,8 +1,9 @@
1
- export declare const usePermissions: ({ clusterName, namespace, apiGroup, typeName, verb, refetchInterval, enabler, }: {
1
+ export declare const usePermissions: ({ clusterName, namespace, group, resource, verb, name, refetchInterval, enabler, }: {
2
2
  clusterName: string;
3
- apiGroup: string;
4
- typeName: string;
5
- namespace: string;
3
+ group?: string | undefined;
4
+ resource: string;
5
+ namespace?: string | undefined;
6
+ name?: string | undefined;
6
7
  verb: 'create' | 'delete' | 'patch' | 'update';
7
8
  refetchInterval?: number | false | undefined;
8
9
  enabler?: boolean | undefined;
@@ -13,6 +13,7 @@ export { checkPermission } from './api/permissions';
13
13
  export { getSwagger } from './api/bff/swagger/getSwagger';
14
14
  export { filterIfApiInstanceNamespaceScoped, filterIfBuiltInInstanceNamespaceScoped, } from './api/bff/scopes/filterScopes';
15
15
  export { checkIfApiInstanceNamespaceScoped, checkIfBuiltInInstanceNamespaceScoped } from './api/bff/scopes/checkScopes';
16
+ export { getKinds } from './api/bff/search/getKinds';
16
17
  export { useClusterList } from './hooks/useClusterList';
17
18
  export { useApiResources, useApiResourceSingle } from './hooks/useApiResource';
18
19
  export { useBuiltinResources, useBuiltinResourceSingle } from './hooks/useBuiltinResource';
@@ -22,6 +23,8 @@ export { useBuiltinResourceTypes } from './hooks/useBuiltinResourceTypes';
22
23
  export { useCrdData } from './hooks/useCrdData';
23
24
  export { useDirectUnknownResource } from './hooks/useDirectUnknownResource';
24
25
  export { usePermissions } from './hooks/usePermissions';
26
+ export { useListWatch, useInfiniteSentinel } from './hooks/useListThenWatch';
27
+ export type { TConnStatus, TUseListWatchQuery, TUseListWatchOptions, TUseListWatchReturn, } from './hooks/useListThenWatch';
25
28
  export type { TRequestError } from './localTypes/api';
26
29
  export type { TClusterList } from './localTypes/clusterList';
27
30
  export type { TItemTypeMap, TRenderableItem, TRendererComponents, TFactoryDataK8s, TFactoryResponse, TFactoryResource, } from './localTypes/dynamicRender';
@@ -32,4 +35,6 @@ export type { TApiGroupList, TApiGroupResourceTypeList, TBuiltinResourceTypeList
32
35
  export type { TMarketPlacePanel, TMarketPlacePanelResource, TMarketPlacePanelResponse } from './localTypes/marketplace';
33
36
  export type { TAdditionalPrinterColumns, TAdditionalPrinterColumnsUndefinedValues, TAdditionalPrinterColumnsTrimLengths, TAdditionalPrinterColumnsColWidths, } from './localTypes/richTable';
34
37
  export type { TFilterIfApiInstanceNamespaceScopedReq, TFilterIfApiInstanceNamespaceScopedRes, TFilterIfBuiltInInstanceNamespaceScopedReq, TFilterIfBuiltInInstanceNamespaceScopedRes, } from './localTypes/bff/scopes';
38
+ export type { TVersionEntry, TKindItem, TKindIndex } from './localTypes/bff/search';
35
39
  export type { TGetDerefedSwaggerRes } from './localTypes/bff/swagger';
40
+ export type { TKindWithVersion } from './localTypes/search';
@@ -34,6 +34,7 @@ export type TPrepareFormRes = {
34
34
  hiddenPaths: string[][] | undefined;
35
35
  expandedPaths: string[][] | undefined;
36
36
  persistedPaths: string[][] | undefined;
37
+ sortPaths: string[][] | undefined;
37
38
  kindName: string | undefined;
38
39
  isNamespaced: boolean;
39
40
  formPrefills?: TFormPrefill;
@@ -0,0 +1,20 @@
1
+ export type TVersionEntry = Readonly<{
2
+ version: string;
3
+ groupVersion: string;
4
+ preferred: boolean;
5
+ namespaced: boolean;
6
+ resource: string;
7
+ verbs?: string[];
8
+ }>;
9
+ export type TKindItem = {
10
+ group: string;
11
+ kind: string;
12
+ versions: TVersionEntry[];
13
+ };
14
+ export type TKindIndex = {
15
+ kind: 'KindIndex';
16
+ apiVersion: 'v1';
17
+ generatedAt: string;
18
+ count: number;
19
+ items: TKindItem[];
20
+ };
@@ -1,16 +1,23 @@
1
- import { TAdditionalPrinterColumns, TAdditionalPrinterColumnsUndefinedValues, TAdditionalPrinterColumnsTrimLengths, TAdditionalPrinterColumnsColWidths } from '../richTable';
1
+ import { TAdditionalPrinterColumns, TAdditionalPrinterColumnsUndefinedValues, TAdditionalPrinterColumnsTrimLengths, TAdditionalPrinterColumnsColWidths, TAdditionalPrinterColumnsKeyTypeProps } from '../richTable';
2
2
  export type TPrepareTableReq = {
3
3
  customizationId?: string;
4
4
  tableMappingsReplaceValues?: Record<string, string | undefined>;
5
5
  forceDefaultAdditionalPrinterColumns?: TAdditionalPrinterColumns;
6
+ namespace?: string;
7
+ k8sResource?: {
8
+ resource: string;
9
+ apiGroup?: string;
10
+ apiVersion: string;
11
+ };
6
12
  };
7
13
  export type TPrepareTableRes = {
8
14
  additionalPrinterColumns: TAdditionalPrinterColumns;
9
15
  additionalPrinterColumnsUndefinedValues?: TAdditionalPrinterColumnsUndefinedValues;
10
16
  additionalPrinterColumnsTrimLengths?: TAdditionalPrinterColumnsTrimLengths;
11
17
  additionalPrinterColumnsColWidths?: TAdditionalPrinterColumnsColWidths;
18
+ additionalPrinterColumnsKeyTypeProps?: TAdditionalPrinterColumnsKeyTypeProps;
12
19
  pathToNavigate?: string;
13
- recordKeysForNavigation?: string[];
14
- recordKeysForNavigationSecond?: string[];
15
- recordKeysForNavigationThird?: string[];
20
+ recordKeysForNavigation?: string | string[];
21
+ recordKeysForNavigationSecond?: string | string[];
22
+ recordKeysForNavigationThird?: string | string[];
16
23
  };
@@ -13,19 +13,19 @@ export type TRangeInputCustomValue = {
13
13
  } | {
14
14
  type: 'substractResourceValues';
15
15
  firstValueUri: string;
16
- firstValuesKeysToValue: string[];
16
+ firstValuesKeysToValue: string | string[];
17
17
  secondValueUri: string;
18
- secondValuesKeysToValue: string[];
18
+ secondValuesKeysToValue: string | string[];
19
19
  } | {
20
20
  type: 'addResourceValues';
21
21
  firstValueUri: string;
22
- firstValuesKeysToValue: string[];
22
+ firstValuesKeysToValue: string | string[];
23
23
  secondValueUri: string;
24
- secondValuesKeysToValue: string[];
24
+ secondValuesKeysToValue: string | string[];
25
25
  } | {
26
26
  type: 'resourceValue';
27
27
  valueUri: string;
28
- keysToValue: string[];
28
+ keysToValue: string | string[];
29
29
  };
30
30
  export type TRangeInputCustomValuesBlock = {
31
31
  min: TRangeInputCustomValue;
@@ -39,14 +39,14 @@ export type TRangeInputCustomProps = {
39
39
  };
40
40
  export type TListInputCustomProps = {
41
41
  valueUri: string;
42
- keysToValue: string[];
43
- keysToLabel?: string[];
42
+ keysToValue: string | string[];
43
+ keysToLabel?: string | string[];
44
44
  mode?: 'multiple' | 'tags';
45
45
  criteria?: {
46
- keysToValue: string[];
46
+ keysToValue: string | string[];
47
47
  type: 'equals' | 'notEquals';
48
48
  value: unknown;
49
49
  keepPrefilled?: boolean;
50
50
  };
51
- relatedValuePath?: string[];
51
+ relatedValuePath?: string;
52
52
  };
@@ -1,7 +1,8 @@
1
1
  export type TAdditionalPrinterColumns = {
2
2
  name: string;
3
- type: string;
4
- jsonPath: string;
3
+ jsonPath?: string;
4
+ type?: string;
5
+ customProps?: unknown;
5
6
  }[];
6
7
  export type TAdditionalPrinterColumnsUndefinedValues = {
7
8
  key: string;
@@ -15,3 +16,7 @@ export type TAdditionalPrinterColumnsColWidths = {
15
16
  key: string;
16
17
  value: string;
17
18
  }[];
19
+ export type TAdditionalPrinterColumnsKeyTypeProps = Record<string, {
20
+ type: string;
21
+ customProps?: unknown;
22
+ }>;
@@ -0,0 +1,7 @@
1
+ import { TVersionEntry } from './bff/search';
2
+ export type TKindWithVersion = {
3
+ group: string;
4
+ kind: string;
5
+ version: TVersionEntry;
6
+ notUnique?: true;
7
+ };
@@ -0,0 +1,7 @@
1
+ type PlainObject = Record<string, any>;
2
+ /**
3
+ * Deeply merges two objects A and B, returning a new object
4
+ * whose type is the intersection A & B.
5
+ */
6
+ export declare const deepMerge: <A extends PlainObject, B extends PlainObject>(a: A, b: B) => A & B;
7
+ export {};
@@ -0,0 +1 @@
1
+ export * from './deepMerge';
@@ -0,0 +1,3 @@
1
+ import { TKindIndex } from '../../localTypes/bff/search';
2
+ import { TKindWithVersion } from '../../localTypes/search';
3
+ export declare const getSortedKinds: (index: TKindIndex) => TKindWithVersion[];
@@ -0,0 +1 @@
1
+ export * from './getSortedKinds';
@@ -0,0 +1,8 @@
1
+ import { TKindIndex } from '../../localTypes/bff/search';
2
+ import { TKindWithVersion } from '../../localTypes/search';
3
+ /**
4
+ * RETURNS ALL VERSIONS (one row per version).
5
+ * The first row for each {group, kind} will be the preferred (if any),
6
+ * otherwise the best-sorted version. Others follow right after.
7
+ */
8
+ export declare const getSortedKindsAll: (index: TKindIndex) => TKindWithVersion[];
@@ -0,0 +1 @@
1
+ export * from './getSortedKindsAll';
@@ -0,0 +1 @@
1
+ export declare const getUppercase: (s: string) => string;
@@ -0,0 +1 @@
1
+ export * from './getUppercase';
@@ -0,0 +1,9 @@
1
+ type Theme = 'light' | 'dark';
2
+ /**
3
+ * Deterministic, functional mapper from (value, theme) -> HSL string.
4
+ * - Hue spans full 0..359 based on a stable FNV-1a hash of the string.
5
+ * - Saturation/Lightness are derived from disjoint hash segments and
6
+ * constrained to your specified ranges per theme.
7
+ */
8
+ export declare const hslFromString: (value: string, theme: Theme) => string;
9
+ export {};
@@ -0,0 +1 @@
1
+ export * from './hslFromString';
@@ -10,3 +10,13 @@ export * from './groupsToTreeData';
10
10
  export * from './getGroupsByCategory';
11
11
  export * from './createContextFactory';
12
12
  export * from './prepareUrlsToFetchForDynamicRenderer';
13
+ export * from './deepMerge';
14
+ export * from './getSortedKinds';
15
+ export * from './getSortedKindsAll';
16
+ export * from './hslFromString';
17
+ export * from './getUppercase';
18
+ export * from './kindByGvr';
19
+ export * from './pluralByKind';
20
+ export * from './namespacedByGvr';
21
+ export * from './tableLocations';
22
+ export * from './isMultilineString';
@@ -0,0 +1 @@
1
+ export { isMultilineString, isMultilineFromYaml } from './isMultilineString';
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Determines if a string should be treated as multiline in YAML
3
+ * @param value - The string value to check
4
+ * @returns true if the string should be multiline, false otherwise
5
+ */
6
+ export declare const isMultilineString: (value: string) => boolean;
7
+ /**
8
+ * Determines if a string should be treated as multiline based on YAML content
9
+ * @param yamlContent - The YAML content to analyze
10
+ * @param fieldPath - The path to the field in the YAML
11
+ * @returns true if the field should be multiline, false otherwise
12
+ */
13
+ export declare const isMultilineFromYaml: (yamlContent: string, fieldPath: string[]) => boolean;
@@ -0,0 +1 @@
1
+ export * from './kindByGvr';
@@ -0,0 +1,6 @@
1
+ import { TKindWithVersion } from '../../localTypes/search';
2
+ /**
3
+ * Build a lookup function: given "group~version~resource" return the unique kind.
4
+ * Functional, side-effect free, and tolerant of empty group (e.g. "~v1~bindings").
5
+ */
6
+ export declare const kindByGvr: (entries: readonly TKindWithVersion[]) => (gvr: string) => string | undefined;
@@ -0,0 +1 @@
1
+ export * from './namespacedByGvr';
@@ -0,0 +1,6 @@
1
+ import { TKindWithVersion } from '../../localTypes/search';
2
+ /**
3
+ * Build a lookup function: given "group~version~resource" return the unique namespaced value.
4
+ * Functional, side-effect free, and tolerant of empty group (e.g. "~v1~bindings").
5
+ */
6
+ export declare const namespacedByGvr: (entries: readonly TKindWithVersion[]) => (gvr: string) => boolean | undefined;
@@ -0,0 +1 @@
1
+ export * from './pluralByKind';
@@ -0,0 +1,10 @@
1
+ import { TKindWithVersion } from '../../localTypes/search';
2
+ type ApiVersion = string;
3
+ /**
4
+ * Build a lookup function: given (kind, apiVersion?) return the plural resource.
5
+ * - apiVersion can be "group/version" or just "v1" for core.
6
+ * - If apiVersion is omitted, we return the plural for the preferred version of that kind.
7
+ * - Returns undefined if not uniquely determined.
8
+ */
9
+ export declare const pluralByKind: (entries: readonly TKindWithVersion[]) => (kind: string, apiVersion?: ApiVersion) => string | undefined;
10
+ export {};
@@ -0,0 +1 @@
1
+ export * from './tableLocations';
@@ -0,0 +1,36 @@
1
+ export declare const getBackLinkToTable: ({ fullPath }: {
2
+ fullPath: string;
3
+ }) => string;
4
+ export declare const getLinkToBuiltinForm: ({ cluster, baseprefix, namespace, syntheticProject, typeName, inside, fullPath, }: {
5
+ cluster: string;
6
+ baseprefix?: string | undefined;
7
+ namespace?: string | undefined;
8
+ syntheticProject?: string | undefined;
9
+ typeName: string;
10
+ inside?: boolean | undefined;
11
+ fullPath: string;
12
+ }) => string;
13
+ export declare const getLinkToApiForm: ({ cluster, baseprefix, namespace, syntheticProject, apiGroup, apiVersion, typeName, inside, fullPath, }: {
14
+ cluster: string;
15
+ baseprefix?: string | undefined;
16
+ namespace?: string | undefined;
17
+ syntheticProject?: string | undefined;
18
+ apiGroup?: string | undefined;
19
+ apiVersion?: string | undefined;
20
+ typeName: string;
21
+ inside?: boolean | undefined;
22
+ fullPath: string;
23
+ searchMount?: boolean | undefined;
24
+ }) => string;
25
+ export declare const getLinkToForm: ({ apiGroup, ...rest }: {
26
+ cluster: string;
27
+ baseprefix?: string | undefined;
28
+ namespace?: string | undefined;
29
+ syntheticProject?: string | undefined;
30
+ apiGroup?: string | undefined;
31
+ apiVersion?: string | undefined;
32
+ typeName: string;
33
+ inside?: boolean | undefined;
34
+ fullPath: string;
35
+ searchMount?: boolean | undefined;
36
+ }) => string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prorobotech/openapi-k8s-toolkit",
3
- "version": "0.0.1-alpha.99",
3
+ "version": "1.1.0-alpha.1",
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",
@@ -47,13 +47,14 @@
47
47
  "@xterm/addon-attach": "0.11.0",
48
48
  "@xterm/addon-fit": "0.10.0",
49
49
  "@xterm/xterm": "5.5.0",
50
- "axios": "1.4.0",
50
+ "axios": "1.12.2",
51
51
  "cross-env": "7.0.3",
52
52
  "dotenv": "16.4.7",
53
53
  "jsonpath": "1.1.1",
54
54
  "lodash": "4.17.21",
55
55
  "openapi-types": "12.1.3",
56
56
  "react-redux": "9.1.2",
57
+ "spoiled": "0.4.0",
57
58
  "styled-components": "6.0.7",
58
59
  "typescript": "4.9.5",
59
60
  "usehooks-ts": "3.1.1",