@prorobotech/openapi-k8s-toolkit 1.4.0-alpha.2 → 1.4.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.
Files changed (90) hide show
  1. package/dist/{index-BueNoIOU.mjs → index-BIeCsSQi.mjs} +3221 -880
  2. package/dist/index-BIeCsSQi.mjs.map +1 -0
  3. package/dist/{index-C5osPo0p.mjs → index-CVP6M61v.mjs} +3 -36
  4. package/dist/index-CVP6M61v.mjs.map +1 -0
  5. package/dist/openapi-k8s-toolkit.es.js +1 -1
  6. package/dist/openapi-k8s-toolkit.umd.js +3323 -1014
  7. package/dist/openapi-k8s-toolkit.umd.js.map +1 -1
  8. package/dist/types/components/molecules/BlackholeForm/molecules/FormObjectFromSwagger/FormObjectFromSwagger.test.d.ts +1 -0
  9. package/dist/types/components/molecules/BlackholeForm/molecules/helpers/validation.d.ts +6 -0
  10. package/dist/types/components/molecules/BlackholeForm/molecules/helpers/validation.test.d.ts +1 -0
  11. package/dist/types/components/molecules/EnrichedTable/index.d.ts +2 -2
  12. package/dist/types/components/molecules/EnrichedTable/organisms/ClusterListTable/ClusterListTable.d.ts +24 -0
  13. package/dist/types/components/molecules/EnrichedTable/organisms/ClusterListTable/index.d.ts +2 -0
  14. package/dist/types/components/molecules/EnrichedTable/organisms/EnrichedTable/EnrichedTable.d.ts +2 -1
  15. package/dist/types/components/molecules/EnrichedTable/organisms/EnrichedTable/atoms/TrimmedTags/styled.d.ts +851 -0
  16. package/dist/types/components/molecules/EnrichedTable/organisms/EnrichedTable/utils.d.ts +3 -2
  17. package/dist/types/components/molecules/EnrichedTable/organisms/index.d.ts +2 -0
  18. package/dist/types/components/molecules/Events/Events.error.test.d.ts +2 -0
  19. package/dist/types/components/molecules/Events/types.d.ts +12 -1
  20. package/dist/types/components/molecules/ManageableSidebar/organisms/ManageableSidebarProvider/ManageableSidebarProvider.d.ts +1 -0
  21. package/dist/types/components/molecules/ManageableSidebar/organisms/ManageableSidebarProvider/types.d.ts +10 -0
  22. package/dist/types/components/molecules/ManageableSidebar/organisms/ManageableSidebarProvider/utils.d.ts +23 -1
  23. package/dist/types/components/molecules/MarketPlace/MarketPlace.d.ts +1 -1
  24. package/dist/types/components/molecules/YamlEditorSingleton/utils.d.ts +7 -0
  25. package/dist/types/components/molecules/YamlEditorSingleton/utils.test.d.ts +1 -0
  26. package/dist/types/components/molecules/index.d.ts +2 -2
  27. package/dist/types/components/organisms/DynamicComponents/molecules/ActionsDropdown/ActionsDropdown.test.d.ts +1 -0
  28. package/dist/types/components/organisms/DynamicComponents/molecules/ActionsDropdown/dropdownPlacement.d.ts +12 -0
  29. package/dist/types/components/organisms/DynamicComponents/molecules/ActionsDropdown/dropdownPlacement.test.d.ts +1 -0
  30. package/dist/types/components/organisms/DynamicComponents/molecules/ActionsDropdown/hooks/useActionsDropdownHandlers/actionHandlers.d.ts +23 -0
  31. package/dist/types/components/organisms/DynamicComponents/molecules/ActionsDropdown/hooks/useActionsDropdownHandlers/handlers/index.d.ts +6 -0
  32. package/dist/types/components/organisms/DynamicComponents/molecules/ActionsDropdown/hooks/useActionsDropdownHandlers/handlers/useCreateFromFilesHandlers.d.ts +11 -0
  33. package/dist/types/components/organisms/DynamicComponents/molecules/ActionsDropdown/hooks/useActionsDropdownHandlers/handlers/useDrainHandlers.d.ts +12 -0
  34. package/dist/types/components/organisms/DynamicComponents/molecules/ActionsDropdown/hooks/useActionsDropdownHandlers/handlers/useEvictHandlers.d.ts +9 -0
  35. package/dist/types/components/organisms/DynamicComponents/molecules/ActionsDropdown/hooks/useActionsDropdownHandlers/handlers/useRerunHandlers.d.ts +11 -0
  36. package/dist/types/components/organisms/DynamicComponents/molecules/ActionsDropdown/hooks/useActionsDropdownHandlers/handlers/useRollbackHandlers.d.ts +11 -0
  37. package/dist/types/components/organisms/DynamicComponents/molecules/ActionsDropdown/hooks/useActionsDropdownHandlers/handlers/useScaleHandlers.d.ts +11 -0
  38. package/dist/types/components/organisms/DynamicComponents/molecules/ActionsDropdown/hooks/useActionsDropdownHandlers/helpers.d.ts +25 -0
  39. package/dist/types/components/organisms/DynamicComponents/molecules/ActionsDropdown/hooks/useActionsDropdownHandlers/index.d.ts +3 -0
  40. package/dist/types/components/organisms/DynamicComponents/molecules/ActionsDropdown/hooks/useActionsDropdownHandlers/types.d.ts +65 -0
  41. package/dist/types/components/organisms/DynamicComponents/molecules/ActionsDropdown/hooks/useActionsDropdownHandlers/useActionsDropdownHandlers.d.ts +38 -0
  42. package/dist/types/components/organisms/DynamicComponents/molecules/ActionsDropdown/hooks/useActionsDropdownPermissions.d.ts +2 -3
  43. package/dist/types/components/organisms/DynamicComponents/molecules/ActionsDropdown/modals/CreateFromFilesModal.d.ts +12 -0
  44. package/dist/types/components/organisms/DynamicComponents/molecules/ActionsDropdown/modals/CreateFromFilesModal.test.d.ts +1 -0
  45. package/dist/types/components/organisms/DynamicComponents/molecules/ActionsDropdown/modals/DownloadAsFilesModal.d.ts +11 -0
  46. package/dist/types/components/organisms/DynamicComponents/molecules/ActionsDropdown/modals/DownloadAsFilesModal.test.d.ts +1 -0
  47. package/dist/types/components/organisms/DynamicComponents/molecules/ActionsDropdown/modals/OpenKubeletConfigModal.d.ts +9 -0
  48. package/dist/types/components/organisms/DynamicComponents/molecules/ActionsDropdown/modals/ScaleModal.d.ts +10 -0
  49. package/dist/types/components/organisms/DynamicComponents/molecules/ActionsDropdown/permissionsMap.d.ts +7 -0
  50. package/dist/types/components/organisms/DynamicComponents/molecules/ActionsDropdown/renderActionModal.d.ts +8 -0
  51. package/dist/types/components/organisms/DynamicComponents/molecules/ActionsDropdown/utils.d.ts +9 -12
  52. package/dist/types/components/organisms/DynamicComponents/molecules/AntdLink/utils.d.ts +1 -0
  53. package/dist/types/components/organisms/DynamicComponents/molecules/AntdLink/utils.test.d.ts +1 -0
  54. package/dist/types/components/organisms/DynamicComponents/molecules/EnrichedTable/EnrichedTable.error.test.d.ts +1 -0
  55. package/dist/types/components/organisms/DynamicComponents/molecules/EnrichedTable/utils.d.ts +1 -0
  56. package/dist/types/components/organisms/DynamicComponents/molecules/EnrichedTable/utils.test.d.ts +1 -0
  57. package/dist/types/components/organisms/DynamicComponents/molecules/Events/Events.permissions.test.d.ts +2 -0
  58. package/dist/types/components/organisms/DynamicComponents/molecules/LabelsToSearchParams/utils.d.ts +6 -0
  59. package/dist/types/components/organisms/DynamicComponents/molecules/MappedParsedText/MappedParsedText.d.ts +5 -0
  60. package/dist/types/components/organisms/DynamicComponents/molecules/MappedParsedText/index.d.ts +1 -0
  61. package/dist/types/components/organisms/DynamicComponents/molecules/SecretBase64Plain/styled.d.ts +1 -0
  62. package/dist/types/components/organisms/DynamicComponents/molecules/SecretBase64Plain/utils.d.ts +2 -0
  63. package/dist/types/components/organisms/DynamicComponents/molecules/SecretBase64Plain/utils.test.d.ts +1 -0
  64. package/dist/types/components/organisms/DynamicComponents/molecules/StatusText/utils.d.ts +2 -2
  65. package/dist/types/components/organisms/DynamicComponents/molecules/Volumes/Volumes.d.ts +6 -0
  66. package/dist/types/components/organisms/DynamicComponents/molecules/Volumes/index.d.ts +1 -0
  67. package/dist/types/components/organisms/DynamicComponents/molecules/index.d.ts +2 -0
  68. package/dist/types/components/organisms/DynamicComponents/types/ActionsDropdown.d.ts +82 -18
  69. package/dist/types/components/organisms/DynamicComponents/types/Annotations.d.ts +1 -0
  70. package/dist/types/components/organisms/DynamicComponents/types/LabelsToSearchParams.d.ts +2 -0
  71. package/dist/types/components/organisms/DynamicComponents/types/MappedParsedText.d.ts +7 -0
  72. package/dist/types/components/organisms/DynamicComponents/types/MarketplaceCard.d.ts +1 -1
  73. package/dist/types/components/organisms/DynamicComponents/types/SecretBase64Plain.d.ts +10 -0
  74. package/dist/types/components/organisms/DynamicComponents/types/StatusText.d.ts +1 -1
  75. package/dist/types/components/organisms/DynamicComponents/types/Taints.d.ts +1 -0
  76. package/dist/types/components/organisms/DynamicComponents/types/Tolerations.d.ts +1 -0
  77. package/dist/types/components/organisms/DynamicComponents/types/Volumes.d.ts +8 -0
  78. package/dist/types/components/organisms/DynamicComponents/types/antdComponents.d.ts +3 -0
  79. package/dist/types/components/organisms/DynamicComponents/types/index.d.ts +4 -0
  80. package/dist/types/hooks/useClusterList.d.ts +6 -3
  81. package/dist/types/hooks/useDirectUnknownResource.d.ts +2 -1
  82. package/dist/types/hooks/useListThenWatch/types.d.ts +2 -0
  83. package/dist/types/localTypes/bff/form.d.ts +2 -0
  84. package/dist/types/localTypes/bff/table.d.ts +2 -1
  85. package/dist/types/localTypes/dynamicRender.d.ts +1 -0
  86. package/dist/types/localTypes/richTable.d.ts +4 -0
  87. package/package.json +5 -5
  88. package/dist/index-BueNoIOU.mjs.map +0 -1
  89. package/dist/index-C5osPo0p.mjs.map +0 -1
  90. package/dist/types/components/organisms/DynamicComponents/molecules/ActionsDropdown/hooks/useActionsDropdownHandlers.d.ts +0 -45
@@ -1,7 +1,7 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { NavigateFunction } from 'react-router-dom';
3
3
  import { TableProps } from 'antd';
4
- import { TAdditionalPrinterColumnsColWidths, TAdditionalPrinterColumnsTrimLengths, TAdditionalPrinterColumnsUndefinedValues, TAdditionalPrinterColumnsKeyTypeProps, TAdditionalPrinterColumnsCustomSortersAndFilters } from '../../../../../localTypes/richTable';
4
+ import { TAdditionalPrinterColumnsColWidths, TAdditionalPrinterColumnsTrimLengths, TAdditionalPrinterColumnsUndefinedValues, TAdditionalPrinterColumnsTooltips, TAdditionalPrinterColumnsKeyTypeProps, TAdditionalPrinterColumnsCustomSortersAndFilters } from '../../../../../localTypes/richTable';
5
5
  import { TJSON } from '../../../../../localTypes/JSON';
6
6
  export declare const getCellRender: ({ value, record, possibleTrimLength, possibleUndefinedValue, possibleCustomTypeWithProps, theme, }: {
7
7
  value: TJSON;
@@ -14,11 +14,12 @@ export declare const getCellRender: ({ value, record, possibleTrimLength, possib
14
14
  } | undefined;
15
15
  theme: 'dark' | 'light';
16
16
  }) => JSX.Element;
17
- export declare const getEnrichedColumns: ({ columns, additionalPrinterColumnsUndefinedValues, additionalPrinterColumnsTrimLengths, additionalPrinterColumnsColWidths, additionalPrinterColumnsKeyTypeProps, additionalPrinterColumnsCustomSortersAndFilters, theme, getRowKey, }: {
17
+ export declare const getEnrichedColumns: ({ columns, additionalPrinterColumnsUndefinedValues, additionalPrinterColumnsTrimLengths, additionalPrinterColumnsColWidths, additionalPrinterColumnsTooltips, additionalPrinterColumnsKeyTypeProps, additionalPrinterColumnsCustomSortersAndFilters, theme, getRowKey, }: {
18
18
  columns: TableProps['columns'];
19
19
  additionalPrinterColumnsUndefinedValues?: TAdditionalPrinterColumnsUndefinedValues | undefined;
20
20
  additionalPrinterColumnsTrimLengths?: TAdditionalPrinterColumnsTrimLengths | undefined;
21
21
  additionalPrinterColumnsColWidths?: TAdditionalPrinterColumnsColWidths | undefined;
22
+ additionalPrinterColumnsTooltips?: TAdditionalPrinterColumnsTooltips | undefined;
22
23
  additionalPrinterColumnsKeyTypeProps?: TAdditionalPrinterColumnsKeyTypeProps | undefined;
23
24
  additionalPrinterColumnsCustomSortersAndFilters?: TAdditionalPrinterColumnsCustomSortersAndFilters | undefined;
24
25
  theme: 'dark' | 'light';
@@ -1,4 +1,6 @@
1
1
  export { EnrichedTable, getEnrichedColumns, getEnrichedColumnsWithControls } from './EnrichedTable';
2
2
  export type { TEnrichedTableProps } from './EnrichedTable';
3
+ export { ClusterListTable } from './ClusterListTable';
4
+ export type { TClusterListTableProps } from './ClusterListTable';
3
5
  export { EnrichedTableProvider } from './EnrichedTableProvider';
4
6
  export type { TEnrichedTableProviderProps } from './EnrichedTableProvider';
@@ -0,0 +1,2 @@
1
+ /** @jest-environment jsdom */
2
+ export {};
@@ -44,11 +44,22 @@ type TPageErrorFrame = {
44
44
  type: 'PAGE_ERROR';
45
45
  error: string;
46
46
  };
47
+ type TInitialErrorFrame = {
48
+ type: 'INITIAL_ERROR';
49
+ message: string;
50
+ statusCode?: number;
51
+ reason?: string;
52
+ };
53
+ type TServerLogFrame = {
54
+ type: 'SERVER_LOG';
55
+ level: 'info' | 'warn' | 'error';
56
+ message: string;
57
+ };
47
58
  type TDeltaFrame = {
48
59
  type: TWatchPhase;
49
60
  item: TEventsV1Event;
50
61
  };
51
- export type TServerFrame = TInitialFrame | TPageFrame | TPageErrorFrame | TDeltaFrame;
62
+ export type TServerFrame = TInitialFrame | TPageFrame | TPageErrorFrame | TInitialErrorFrame | TServerLogFrame | TDeltaFrame;
52
63
  export type TScrollMsg = {
53
64
  type: 'SCROLL';
54
65
  continue: string;
@@ -6,6 +6,7 @@ export type TManageableSidebarProviderProps = {
6
6
  plural: string;
7
7
  isEnabled?: boolean;
8
8
  replaceValues: Record<string, string | undefined>;
9
+ multiQueryData?: Record<string, unknown>;
9
10
  pathname: string;
10
11
  searchParams?: string;
11
12
  idToCompare: string;
@@ -1,7 +1,17 @@
1
+ export type TResourcesList = {
2
+ cluster: string;
3
+ apiGroup?: string;
4
+ apiVersion: string;
5
+ plural: string;
6
+ namespace?: string;
7
+ linkToResource: string;
8
+ jsonPathToName: string;
9
+ };
1
10
  export type TLink = {
2
11
  key: string;
3
12
  label: string;
4
13
  link?: string;
14
+ resourcesList?: TResourcesList;
5
15
  children?: TLink[];
6
16
  };
7
17
  export type TCrdResource = {
@@ -1,6 +1,24 @@
1
1
  import { ItemType } from 'antd/es/menu/interface';
2
2
  import { TLink } from './types';
3
- export declare const prepareDataForManageableSidebar: ({ data, replaceValues, pathname, searchParams, idToCompare, fallbackIdToCompare, currentTags, }: {
3
+ export type TResourcesListFetchEntry = {
4
+ nodePath: string;
5
+ k8sParams: {
6
+ cluster: string;
7
+ apiGroup?: string;
8
+ apiVersion: string;
9
+ plural: string;
10
+ namespace?: string;
11
+ isEnabled: boolean;
12
+ };
13
+ };
14
+ export declare const collectLinksWithResourcesList: ({ items, parentPath, replaceValues, multiQueryData, isEnabled, }: {
15
+ items: TLink[];
16
+ parentPath?: string | undefined;
17
+ replaceValues: Record<string, string | undefined>;
18
+ multiQueryData: Record<string, unknown>;
19
+ isEnabled?: boolean | undefined;
20
+ }) => TResourcesListFetchEntry[];
21
+ export declare const prepareDataForManageableSidebar: ({ data, replaceValues, multiQueryData, pathname, searchParams, idToCompare, fallbackIdToCompare, currentTags, resourcesListData, }: {
4
22
  data: {
5
23
  id: string;
6
24
  menuItems: TLink[];
@@ -8,11 +26,15 @@ export declare const prepareDataForManageableSidebar: ({ data, replaceValues, pa
8
26
  externalKeys?: string[];
9
27
  }[];
10
28
  replaceValues: Record<string, string | undefined>;
29
+ multiQueryData?: Record<string, unknown> | undefined;
11
30
  pathname: string;
12
31
  searchParams?: string | undefined;
13
32
  idToCompare: string;
14
33
  fallbackIdToCompare?: string | undefined;
15
34
  currentTags?: string[] | undefined;
35
+ resourcesListData?: Record<string, {
36
+ items?: Record<string, unknown>[] | undefined;
37
+ }> | undefined;
16
38
  }) => {
17
39
  menuItems: ItemType[];
18
40
  selectedKeys: string[];
@@ -8,7 +8,7 @@ export type TMarketPlaceProps = {
8
8
  marketplaceKind: string;
9
9
  baseprefix?: string;
10
10
  standalone?: boolean;
11
- forceAddedMode?: boolean;
11
+ addedMode?: boolean;
12
12
  showZeroResources?: boolean;
13
13
  };
14
14
  export declare const MarketPlace: FC<TMarketPlaceProps>;
@@ -0,0 +1,7 @@
1
+ import type * as monaco from 'monaco-editor';
2
+ export declare const findManagedFieldsLine: (model: monaco.editor.ITextModel) => number | null;
3
+ export declare const findManagedFieldsRange: (model: monaco.editor.ITextModel) => {
4
+ startLineNumber: number;
5
+ endLineNumber: number;
6
+ } | null;
7
+ export declare const collapseManagedFieldsInEditor: (editor: monaco.editor.IStandaloneCodeEditor) => Promise<boolean>;
@@ -2,8 +2,8 @@ export { ManageableBreadcrumbsProvider, prepareDataForManageableBreadcrumbs, Man
2
2
  export type { TManageableBreadcrumbsProviderProps, TManageableBreadcrumbsProps } from './ManageableBreadcrumbs';
3
3
  export { ManageableSidebarProvider, prepareDataForManageableSidebar, ManageableSidebar } from './ManageableSidebar';
4
4
  export type { TManageableSidebarProviderProps, TManageableSidebarProps } from './ManageableSidebar';
5
- export { EnrichedTableProvider, EnrichedTable, getEnrichedColumns, getEnrichedColumnsWithControls, } from './EnrichedTable';
6
- export type { TEnrichedTableProviderProps, TEnrichedTableProps } from './EnrichedTable';
5
+ export { EnrichedTableProvider, EnrichedTable, ClusterListTable, getEnrichedColumns, getEnrichedColumnsWithControls, } from './EnrichedTable';
6
+ export type { TEnrichedTableProviderProps, TEnrichedTableProps, TClusterListTableProps } from './EnrichedTable';
7
7
  export { YamlEditorSingleton } from './YamlEditorSingleton';
8
8
  export { BlackholeFormProvider, BlackholeForm, getObjectFormItemsDraft } from './BlackholeForm';
9
9
  export type { TBlackholeFormProviderProps, TBlackholeFormProps } from './BlackholeForm';
@@ -0,0 +1,12 @@
1
+ export type TActionsDropdownPlacement = 'bottomLeft' | 'topLeft';
2
+ export type TComputeActionsDropdownPlacementParams = {
3
+ triggerTop: number;
4
+ triggerBottom: number;
5
+ viewportHeight: number;
6
+ actionsCount: number;
7
+ };
8
+ export declare const DEFAULT_MENU_MAX_HEIGHT_PX = 320;
9
+ export declare const getDropdownPlacement: ({ triggerTop, triggerBottom, viewportHeight, actionsCount, }: TComputeActionsDropdownPlacementParams) => {
10
+ placement: TActionsDropdownPlacement;
11
+ maxMenuHeightPx: number;
12
+ };
@@ -0,0 +1,23 @@
1
+ import type { TActionUnion } from '../../../../types/ActionsDropdown';
2
+ import type { TDeleteModalData, TNotificationCallbacks, TParseContext } from './types';
3
+ export declare const handleEditAction: (action: Extract<TActionUnion, {
4
+ type: 'edit';
5
+ }>, ctx: TParseContext, fullPath: string, navigate: (url: string) => void) => void;
6
+ export declare const handleDeleteAction: (action: Extract<TActionUnion, {
7
+ type: 'delete';
8
+ }>, ctx: TParseContext, setDeleteModalData: (data: TDeleteModalData) => void) => void;
9
+ export declare const handlePatchActions: (action: Extract<TActionUnion, {
10
+ type: 'cordon' | 'uncordon' | 'suspend' | 'resume';
11
+ }>, ctx: TParseContext, onSuccess: (label: string) => void, onError: (label: string, error: unknown) => void) => void;
12
+ export declare const handleRolloutRestartAction: (action: Extract<TActionUnion, {
13
+ type: 'rolloutRestart';
14
+ }>, ctx: TParseContext, onSuccess: (label: string) => void, onError: (label: string, error: unknown) => void) => void;
15
+ export declare const handleOpenKubeletConfigAction: (action: Extract<TActionUnion, {
16
+ type: 'openKubeletConfig';
17
+ }>, ctx: TParseContext, setActiveAction: (action: TActionUnion) => void, setModalOpen: (open: boolean) => void) => void;
18
+ export declare const fireTriggerRunAction: (action: Extract<TActionUnion, {
19
+ type: 'triggerRun';
20
+ }>, ctx: TParseContext, multiQueryData: Record<string, unknown>, { showSuccess, showError }: TNotificationCallbacks) => void;
21
+ export declare const handleDownloadAsFilesAction: (action: Extract<TActionUnion, {
22
+ type: 'downloadAsFiles';
23
+ }>, ctx: TParseContext, setActiveAction: (action: TActionUnion) => void, setModalOpen: (open: boolean) => void) => void;
@@ -0,0 +1,6 @@
1
+ export { useScaleHandlers } from './useScaleHandlers';
2
+ export { useEvictHandlers } from './useEvictHandlers';
3
+ export { useRerunHandlers } from './useRerunHandlers';
4
+ export { useDrainHandlers } from './useDrainHandlers';
5
+ export { useRollbackHandlers } from './useRollbackHandlers';
6
+ export { useCreateFromFilesHandlers } from './useCreateFromFilesHandlers';
@@ -0,0 +1,11 @@
1
+ import type { TActionUnion } from '../../../../../types/ActionsDropdown';
2
+ import type { TCreateFromFilesModalData, TNotificationCallbacks, TParseContext } from '../types';
3
+ export declare const useCreateFromFilesHandlers: (ctx: TParseContext, { showSuccess, showError }: TNotificationCallbacks) => {
4
+ createFromFilesModalData: TCreateFromFilesModalData | null;
5
+ isCreateFromFilesLoading: boolean;
6
+ handleCreateFromFilesAction: (action: Extract<TActionUnion, {
7
+ type: 'createFromFiles';
8
+ }>) => void;
9
+ handleCreateFromFilesConfirm: (name: string, data: Record<string, string>, binaryData: Record<string, string>) => void;
10
+ handleCreateFromFilesCancel: () => void;
11
+ };
@@ -0,0 +1,12 @@
1
+ import type { NotificationInstance } from 'antd/es/notification/interface';
2
+ import type { TActionUnion } from '../../../../../types/ActionsDropdown';
3
+ import type { TDrainModalData, TNotificationCallbacks, TParseContext } from '../types';
4
+ export declare const useDrainHandlers: (ctx: TParseContext, { showError }: Pick<TNotificationCallbacks, 'showError'>, notificationApi: NotificationInstance, invalidateMultiQuery: () => void) => {
5
+ drainModalData: TDrainModalData | null;
6
+ isDrainLoading: boolean;
7
+ handleDrainAction: (action: Extract<TActionUnion, {
8
+ type: 'drain';
9
+ }>) => void;
10
+ handleDrainConfirm: () => void;
11
+ handleDrainCancel: () => void;
12
+ };
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ import type { TEvictModalData, TNotificationCallbacks } from '../types';
3
+ export declare const useEvictHandlers: ({ showSuccess, showError }: TNotificationCallbacks) => {
4
+ evictModalData: TEvictModalData | null;
5
+ isEvictLoading: boolean;
6
+ setEvictModalData: import("react").Dispatch<import("react").SetStateAction<TEvictModalData | null>>;
7
+ handleEvictConfirm: () => void;
8
+ handleEvictCancel: () => void;
9
+ };
@@ -0,0 +1,11 @@
1
+ import type { TActionUnion } from '../../../../../types/ActionsDropdown';
2
+ import type { TNotificationCallbacks, TParseContext, TRerunModalData } from '../types';
3
+ export declare const useRerunHandlers: (ctx: TParseContext, multiQueryData: Record<string, unknown>, { showSuccess, showError }: TNotificationCallbacks) => {
4
+ rerunModalData: TRerunModalData | null;
5
+ isRerunLoading: boolean;
6
+ handleRerunLastAction: (action: Extract<TActionUnion, {
7
+ type: 'rerunLast';
8
+ }>) => void;
9
+ handleRerunConfirm: () => void;
10
+ handleRerunCancel: () => void;
11
+ };
@@ -0,0 +1,11 @@
1
+ import type { TActionUnion } from '../../../../../types/ActionsDropdown';
2
+ import type { TNotificationCallbacks, TParseContext, TRollbackModalData } from '../types';
3
+ export declare const useRollbackHandlers: (ctx: TParseContext, { showSuccess, showError }: TNotificationCallbacks) => {
4
+ rollbackModalData: TRollbackModalData | null;
5
+ isRollbackLoading: boolean;
6
+ handleRollbackAction: (action: Extract<TActionUnion, {
7
+ type: 'rollback';
8
+ }>) => void;
9
+ handleRollbackConfirm: () => void;
10
+ handleRollbackCancel: () => void;
11
+ };
@@ -0,0 +1,11 @@
1
+ import type { TActionUnion } from '../../../../../types/ActionsDropdown';
2
+ import type { TNotificationCallbacks, TParseContext, TScaleModalData } from '../types';
3
+ export declare const useScaleHandlers: (ctx: TParseContext, { showSuccess, showError }: TNotificationCallbacks) => {
4
+ scaleModalData: TScaleModalData | null;
5
+ isScaleLoading: boolean;
6
+ handleScaleAction: (action: Extract<TActionUnion, {
7
+ type: 'scale';
8
+ }>) => void;
9
+ handleScaleConfirm: (newReplicas: number) => void;
10
+ handleScaleCancel: () => void;
11
+ };
@@ -0,0 +1,25 @@
1
+ import React from 'react';
2
+ import type { TActionUnion, TEvictActionProps } from '../../../../types/ActionsDropdown';
3
+ import type { TDeleteChildrenModalData, TDrainResponse, TEvictModalData, TParseContext } from './types';
4
+ export declare const parseValueIfString: (value: unknown, ctx: TParseContext) => unknown;
5
+ export declare const resolveObjectByReqIndexAndJsonPath: ({ reqIndex, jsonPathToObj, multiQueryData, }: {
6
+ reqIndex: string;
7
+ jsonPathToObj: string;
8
+ multiQueryData: Record<string, unknown>;
9
+ }) => Record<string, unknown> | undefined;
10
+ export declare const buildEvictModalData: (props: TEvictActionProps, ctx: TParseContext) => TEvictModalData;
11
+ export declare const buildEvictBody: (data: TEvictModalData) => {
12
+ deleteOptions?: Record<string, unknown> | undefined;
13
+ apiVersion: string;
14
+ kind: string;
15
+ metadata: {
16
+ namespace?: string | undefined;
17
+ name: string;
18
+ };
19
+ };
20
+ export declare const buildDeleteChildrenData: (action: Extract<TActionUnion, {
21
+ type: 'deleteChildren';
22
+ }>, ctx: TParseContext) => TDeleteChildrenModalData;
23
+ export declare const generateDnsCompliantName: (prefix: string, maxLength?: number) => string;
24
+ export declare const stripMetadataForRerun: (sourceObj: Record<string, unknown>, sourceJobName: string) => Record<string, unknown>;
25
+ export declare const buildDrainFailureDescription: ({ drained, failed, skipped }: TDrainResponse) => React.ReactNode;
@@ -0,0 +1,3 @@
1
+ export { useActionsDropdownHandlers } from './useActionsDropdownHandlers';
2
+ export type { TCreateFromFilesModalData, TDeleteChildrenModalData, TDrainModalData, TDrainResponse, TEvictModalData, TParseContext, TRerunModalData, TRollbackModalData, TScaleModalData, } from './types';
3
+ export { buildDeleteChildrenData, buildEvictBody, buildEvictModalData, parseValueIfString, resolveObjectByReqIndexAndJsonPath, stripMetadataForRerun, } from './helpers';
@@ -0,0 +1,65 @@
1
+ import type { TResourceKind } from '../../../../types/ActionsDropdown';
2
+ export type TDeleteModalData = {
3
+ name: string;
4
+ endpoint: string;
5
+ redirectTo?: string;
6
+ };
7
+ export type TEvictModalData = {
8
+ name: string;
9
+ endpoint: string;
10
+ namespace?: string;
11
+ apiVersion: string;
12
+ gracePeriodSeconds?: number;
13
+ dryRun?: string[];
14
+ };
15
+ export type TScaleModalData = {
16
+ endpoint: string;
17
+ currentReplicas: number;
18
+ name: string;
19
+ namespace?: string;
20
+ apiVersion: string;
21
+ };
22
+ export type TDeleteChildrenModalData = {
23
+ children: {
24
+ name: string;
25
+ endpoint: string;
26
+ }[];
27
+ childResourceName: string;
28
+ };
29
+ export type TRerunModalData = {
30
+ createEndpoint: string;
31
+ sourceName: string;
32
+ sourceSpec: Record<string, unknown>;
33
+ };
34
+ export type TDrainModalData = {
35
+ bffEndpoint: string;
36
+ nodeName: string;
37
+ };
38
+ export type TDrainResponse = {
39
+ drained: number;
40
+ failed: {
41
+ name: string;
42
+ namespace: string;
43
+ error: string;
44
+ }[];
45
+ skipped: number;
46
+ };
47
+ export type TRollbackModalData = {
48
+ bffEndpoint: string;
49
+ resourceName: string;
50
+ resourceEndpoint: string;
51
+ };
52
+ export type TParseContext = {
53
+ replaceValues: Record<string, string | undefined>;
54
+ multiQueryData: Record<string, unknown>;
55
+ };
56
+ export type TNotificationCallbacks = {
57
+ showSuccess: (label: string) => void;
58
+ showError: (label: string, error: unknown) => void;
59
+ };
60
+ export type TCreateFromFilesModalData = {
61
+ createEndpoint: string;
62
+ namespace: string;
63
+ resourceKind: TResourceKind;
64
+ apiVersion: string;
65
+ };
@@ -0,0 +1,38 @@
1
+ /// <reference types="react" />
2
+ import type { TActionUnion } from '../../../../types/ActionsDropdown';
3
+ import type { TDeleteChildrenModalData, TDeleteModalData, TParseContext } from './types';
4
+ export declare const useActionsDropdownHandlers: ({ replaceValues, multiQueryData }: TParseContext) => {
5
+ notificationContextHolder: import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
6
+ activeAction: TActionUnion | null;
7
+ modalOpen: boolean;
8
+ deleteModalData: TDeleteModalData | null;
9
+ evictModalData: import("./types").TEvictModalData | null;
10
+ isEvictLoading: boolean;
11
+ scaleModalData: import("./types").TScaleModalData | null;
12
+ isScaleLoading: boolean;
13
+ deleteChildrenModalData: TDeleteChildrenModalData | null;
14
+ rerunModalData: import("./types").TRerunModalData | null;
15
+ isRerunLoading: boolean;
16
+ drainModalData: import("./types").TDrainModalData | null;
17
+ isDrainLoading: boolean;
18
+ rollbackModalData: import("./types").TRollbackModalData | null;
19
+ isRollbackLoading: boolean;
20
+ handleActionClick: (action: TActionUnion) => void;
21
+ handleCloseModal: () => void;
22
+ handleDeleteModalClose: () => void;
23
+ handleEvictConfirm: () => void;
24
+ handleEvictCancel: () => void;
25
+ handleScaleConfirm: (newReplicas: number) => void;
26
+ handleScaleCancel: () => void;
27
+ handleDeleteChildrenClose: () => void;
28
+ handleRerunConfirm: () => void;
29
+ handleRerunCancel: () => void;
30
+ handleDrainConfirm: () => void;
31
+ handleDrainCancel: () => void;
32
+ handleRollbackConfirm: () => void;
33
+ handleRollbackCancel: () => void;
34
+ createFromFilesModalData: import("./types").TCreateFromFilesModalData | null;
35
+ isCreateFromFilesLoading: boolean;
36
+ handleCreateFromFilesConfirm: (name: string, data: Record<string, string>, binaryData: Record<string, string>) => void;
37
+ handleCreateFromFilesCancel: () => void;
38
+ };
@@ -1,11 +1,10 @@
1
- import type { TActionUnion, TActionsPermissions, TPermissionContext } from '../../../types/ActionsDropdown';
1
+ import type { TActionUnion, TActionsPermissions } from '../../../types/ActionsDropdown';
2
2
  type TUseActionsDropdownPermissionsParams = {
3
3
  actions: TActionUnion[];
4
4
  permissions?: TActionsPermissions;
5
- permissionContext?: TPermissionContext;
6
5
  replaceValues: Record<string, string | undefined>;
7
6
  multiQueryData: Record<string, unknown>;
8
7
  isMultiQueryLoading: boolean;
9
8
  };
10
- export declare const useActionsDropdownPermissions: ({ actions, permissions, permissionContext, replaceValues, multiQueryData, isMultiQueryLoading, }: TUseActionsDropdownPermissionsParams) => TActionsPermissions;
9
+ export declare const useActionsDropdownPermissions: ({ actions, permissions, replaceValues, multiQueryData, isMultiQueryLoading, }: TUseActionsDropdownPermissionsParams) => TActionsPermissions;
11
10
  export {};
@@ -0,0 +1,12 @@
1
+ import { FC } from 'react';
2
+ import type { TResourceKind } from '../../../types/ActionsDropdown';
3
+ type TCreateFromFilesModalProps = {
4
+ open: boolean;
5
+ onClose: () => void;
6
+ onConfirm: (name: string, data: Record<string, string>, binaryData: Record<string, string>) => void;
7
+ resourceKind: TResourceKind;
8
+ namespace: string;
9
+ isLoading: boolean;
10
+ };
11
+ export declare const CreateFromFilesModal: FC<TCreateFromFilesModalProps>;
12
+ export {};
@@ -0,0 +1,11 @@
1
+ import { FC } from 'react';
2
+ import type { TResourceKind } from '../../../types/ActionsDropdown';
3
+ type TDownloadAsFilesModalProps = {
4
+ open: boolean;
5
+ onClose: () => void;
6
+ endpoint: string;
7
+ resourceKind: TResourceKind;
8
+ name: string;
9
+ };
10
+ export declare const DownloadAsFilesModal: FC<TDownloadAsFilesModalProps>;
11
+ export {};
@@ -0,0 +1,9 @@
1
+ import { FC } from 'react';
2
+ import type { TOpenKubeletConfigActionProps } from '../../../types/ActionsDropdown';
3
+ type TOpenKubeletConfigModalProps = {
4
+ open: boolean;
5
+ onClose: () => void;
6
+ props: TOpenKubeletConfigActionProps;
7
+ };
8
+ export declare const OpenKubeletConfigModal: FC<TOpenKubeletConfigModalProps>;
9
+ export {};
@@ -0,0 +1,10 @@
1
+ import { FC } from 'react';
2
+ export type TScaleModalProps = {
3
+ open: boolean;
4
+ onClose: () => void;
5
+ onConfirm: (replicas: number) => void;
6
+ currentReplicas: number;
7
+ name: string;
8
+ isLoading: boolean;
9
+ };
10
+ export declare const ScaleModal: FC<TScaleModalProps>;
@@ -0,0 +1,7 @@
1
+ import type { TPermissionVerb } from '../../../../../localTypes/permissions';
2
+ import type { TActionUnion } from '../../types/ActionsDropdown';
3
+ export type TRequiredPermission = {
4
+ verb: TPermissionVerb;
5
+ subresource?: string;
6
+ };
7
+ export declare const ACTION_REQUIRED_PERMISSIONS: Record<TActionUnion['type'], TRequiredPermission>;
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import { TActionUnion } from '../../types/ActionsDropdown';
3
+ type TModalExtraProps = {
4
+ open: boolean;
5
+ onClose: () => void;
6
+ };
7
+ export declare const renderActionModal: (action: TActionUnion, extraProps: TModalExtraProps) => React.ReactNode;
8
+ export {};
@@ -1,23 +1,20 @@
1
1
  import React from 'react';
2
- import type { TPermissionVerb } from '../../../../../localTypes/permissions';
3
2
  import { TActionUnion, TEditActionProps, TActionsPermissions } from '../../types/ActionsDropdown';
4
- type TModalExtraProps = {
5
- open: boolean;
6
- onClose: () => void;
7
- };
3
+ import { TRequiredPermission } from './permissionsMap';
8
4
  type TVisibilityContext = {
9
5
  replaceValues: Record<string, string | undefined>;
10
6
  multiQueryData: Record<string, unknown>;
11
7
  };
12
- export type TRequiredPermission = {
13
- verb: TPermissionVerb;
14
- subresource?: string;
15
- };
16
8
  export declare const getRequiredPermissions: (actions: TActionUnion[]) => TRequiredPermission[];
17
- export declare const getVisibleActions: (actions: TActionUnion[], { replaceValues, multiQueryData }: TVisibilityContext) => TActionUnion[];
9
+ export declare const getVisibleActions: (actions: TActionUnion[], { replaceValues, multiQueryData }: TVisibilityContext) => {
10
+ action: TActionUnion;
11
+ actionKey: string;
12
+ }[];
18
13
  export declare const buildEditUrl: (props: TEditActionProps, fullPath: string) => string;
19
- export declare const renderActionModal: (action: TActionUnion, extraProps: TModalExtraProps) => React.ReactNode;
20
- export declare const getMenuItems: (actions: TActionUnion[], onActionClick: (action: TActionUnion) => void, permissions: TActionsPermissions) => {
14
+ export declare const getMenuItems: (visibleActions: {
15
+ action: TActionUnion;
16
+ actionKey: string;
17
+ }[], onActionClick: (action: TActionUnion) => void, permissions: TActionsPermissions) => {
21
18
  key: string;
22
19
  label: string | import("react/jsx-runtime").JSX.Element;
23
20
  icon: React.ReactNode;
@@ -0,0 +1 @@
1
+ export declare const isExternalHref: (href: string) => boolean;
@@ -0,0 +1 @@
1
+ export declare const isValidLabelSelectorObject: (input: unknown) => input is Record<string, string | number>;
@@ -0,0 +1,2 @@
1
+ /** @jest-environment jsdom */
2
+ export {};
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ export declare const handleLabelsToSearchParamsLinkClick: ({ e, hrefPrepared, navigate, }: {
3
+ e: React.MouseEvent<HTMLElement>;
4
+ hrefPrepared: string;
5
+ navigate: (to: string) => void;
6
+ }) => void;
@@ -0,0 +1,5 @@
1
+ import { FC } from 'react';
2
+ import { TDynamicComponentsAppTypeMap } from '../../types';
3
+ export declare const MappedParsedText: FC<{
4
+ data: TDynamicComponentsAppTypeMap['MappedParsedText'];
5
+ }>;
@@ -0,0 +1 @@
1
+ export { MappedParsedText } from './MappedParsedText';
@@ -277,6 +277,7 @@ export declare const Styled: {
277
277
  onTransitionEndCapture?: import("react").TransitionEventHandler<HTMLDivElement> | undefined;
278
278
  }>;
279
279
  DisabledInput: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").Substitute<import("antd").InputProps & import("react").RefAttributes<import("antd").InputRef>, TDisabledInputProps>>;
280
+ DisabledTextArea: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").Substitute<import("antd/es/input").TextAreaProps & import("react").RefAttributes<import("antd/es/input/TextArea").TextAreaRef>, TDisabledInputProps>>;
280
281
  NotificationOverrides: import("react").NamedExoticComponent<import("styled-components").ExecutionProps & object>;
281
282
  };
282
283
  export {};
@@ -0,0 +1,2 @@
1
+ export declare const decodeIfBase64: (value: string, shouldDecode: boolean) => string;
2
+ export declare const resolveMultilineRows: (value: string, multilineRows?: number) => number;
@@ -1,8 +1,8 @@
1
- export declare const getResult: ({ valuesPrepared, criteriaSuccess, criteriaError, stategySuccess, strategyError, valueToCompareSuccess, valueToCompareError, successText, errorText, fallbackText, }: {
1
+ export declare const getResult: ({ valuesPrepared, criteriaSuccess, criteriaError, strategySuccess, strategyError, valueToCompareSuccess, valueToCompareError, successText, errorText, fallbackText, }: {
2
2
  valuesPrepared: string[];
3
3
  criteriaSuccess: 'equals' | 'notEquals';
4
4
  criteriaError: 'equals' | 'notEquals';
5
- stategySuccess?: "every" | "some" | undefined;
5
+ strategySuccess?: "every" | "some" | undefined;
6
6
  strategyError?: "every" | "some" | undefined;
7
7
  valueToCompareSuccess: unknown[];
8
8
  valueToCompareError: unknown[];