@prorobotech/openapi-k8s-toolkit 1.4.0-alpha.8 → 1.5.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 (115) hide show
  1. package/dist/{index-DGEm7Wqt.mjs → index-BFIWg9xn.mjs} +3515 -857
  2. package/dist/index-BFIWg9xn.mjs.map +1 -0
  3. package/dist/{index-DPPcb4Gw.mjs → index-_9cT8fBl.mjs} +29 -3
  4. package/dist/index-_9cT8fBl.mjs.map +1 -0
  5. package/dist/openapi-k8s-toolkit.es.js +1 -1
  6. package/dist/openapi-k8s-toolkit.umd.js +3543 -852
  7. package/dist/openapi-k8s-toolkit.umd.js.map +1 -1
  8. package/dist/types/api/bff/search/getKindsRaw.d.ts +4 -0
  9. package/dist/types/components/atoms/ErrorBoundary/ErrorBoundary.d.ts +38 -0
  10. package/dist/types/components/atoms/ErrorBoundary/ErrorBoundary.test.d.ts +1 -0
  11. package/dist/types/components/atoms/ErrorBoundary/ErrorBoundaryWithDataReset.d.ts +14 -0
  12. package/dist/types/components/atoms/ErrorBoundary/index.d.ts +2 -0
  13. package/dist/types/components/atoms/index.d.ts +1 -0
  14. package/dist/types/components/molecules/BlackholeForm/molecules/FormObjectFromSwagger/FormObjectFromSwagger.test.d.ts +1 -0
  15. package/dist/types/components/molecules/BlackholeForm/organisms/BlackholeForm/helpers/prefills.d.ts +6 -3
  16. package/dist/types/components/molecules/BlackholeForm/organisms/BlackholeFormProvider/BlackholeFormProvider.d.ts +1 -0
  17. package/dist/types/components/molecules/EnrichedTable/index.d.ts +2 -2
  18. package/dist/types/components/molecules/EnrichedTable/organisms/ClusterListTable/ClusterListTable.d.ts +27 -0
  19. package/dist/types/components/molecules/EnrichedTable/organisms/ClusterListTable/ClusterListTable.test.d.ts +1 -0
  20. package/dist/types/components/molecules/EnrichedTable/organisms/ClusterListTable/index.d.ts +2 -0
  21. package/dist/types/components/molecules/EnrichedTable/organisms/EnrichedTable/EnrichedTable.d.ts +11 -6
  22. package/dist/types/components/molecules/EnrichedTable/organisms/EnrichedTable/EnrichedTable.test.d.ts +1 -0
  23. package/dist/types/components/molecules/EnrichedTable/organisms/EnrichedTable/atoms/TrimmedTags/styled.d.ts +851 -0
  24. package/dist/types/components/molecules/EnrichedTable/organisms/EnrichedTable/utils.d.ts +10 -8
  25. package/dist/types/components/molecules/EnrichedTable/organisms/index.d.ts +2 -0
  26. package/dist/types/components/molecules/Events/Events.error.test.d.ts +2 -0
  27. package/dist/types/components/molecules/Events/types.d.ts +12 -1
  28. package/dist/types/components/molecules/YamlEditorSingleton/utils.d.ts +7 -0
  29. package/dist/types/components/molecules/YamlEditorSingleton/utils.test.d.ts +1 -0
  30. package/dist/types/components/molecules/index.d.ts +2 -2
  31. package/dist/types/components/organisms/DynamicComponents/molecules/ActionsDropdown/ActionsDropdown.test.d.ts +1 -0
  32. package/dist/types/components/organisms/DynamicComponents/molecules/ActionsDropdown/dropdownPlacement.d.ts +12 -0
  33. package/dist/types/components/organisms/DynamicComponents/molecules/ActionsDropdown/dropdownPlacement.test.d.ts +1 -0
  34. package/dist/types/components/organisms/DynamicComponents/molecules/ActionsDropdown/hooks/useActionsDropdownHandlers/actionHandlers.d.ts +23 -0
  35. package/dist/types/components/organisms/DynamicComponents/molecules/ActionsDropdown/hooks/useActionsDropdownHandlers/handlers/index.d.ts +6 -0
  36. package/dist/types/components/organisms/DynamicComponents/molecules/ActionsDropdown/hooks/useActionsDropdownHandlers/handlers/useCreateFromFilesHandlers.d.ts +11 -0
  37. package/dist/types/components/organisms/DynamicComponents/molecules/ActionsDropdown/hooks/useActionsDropdownHandlers/handlers/useDrainHandlers.d.ts +12 -0
  38. package/dist/types/components/organisms/DynamicComponents/molecules/ActionsDropdown/hooks/useActionsDropdownHandlers/handlers/useEvictHandlers.d.ts +9 -0
  39. package/dist/types/components/organisms/DynamicComponents/molecules/ActionsDropdown/hooks/useActionsDropdownHandlers/handlers/useRerunHandlers.d.ts +11 -0
  40. package/dist/types/components/organisms/DynamicComponents/molecules/ActionsDropdown/hooks/useActionsDropdownHandlers/handlers/useRollbackHandlers.d.ts +11 -0
  41. package/dist/types/components/organisms/DynamicComponents/molecules/ActionsDropdown/hooks/useActionsDropdownHandlers/handlers/useScaleHandlers.d.ts +11 -0
  42. package/dist/types/components/organisms/DynamicComponents/molecules/ActionsDropdown/hooks/useActionsDropdownHandlers/helpers.d.ts +25 -0
  43. package/dist/types/components/organisms/DynamicComponents/molecules/ActionsDropdown/hooks/useActionsDropdownHandlers/index.d.ts +3 -0
  44. package/dist/types/components/organisms/DynamicComponents/molecules/ActionsDropdown/hooks/useActionsDropdownHandlers/types.d.ts +65 -0
  45. package/dist/types/components/organisms/DynamicComponents/molecules/ActionsDropdown/hooks/useActionsDropdownHandlers/useActionsDropdownHandlers.d.ts +38 -0
  46. package/dist/types/components/organisms/DynamicComponents/molecules/ActionsDropdown/hooks/useActionsDropdownPermissions.d.ts +2 -3
  47. package/dist/types/components/organisms/DynamicComponents/molecules/ActionsDropdown/modals/CreateFromFilesModal.d.ts +12 -0
  48. package/dist/types/components/organisms/DynamicComponents/molecules/ActionsDropdown/modals/CreateFromFilesModal.test.d.ts +1 -0
  49. package/dist/types/components/organisms/DynamicComponents/molecules/ActionsDropdown/modals/DownloadAsFilesModal.d.ts +11 -0
  50. package/dist/types/components/organisms/DynamicComponents/molecules/ActionsDropdown/modals/DownloadAsFilesModal.test.d.ts +1 -0
  51. package/dist/types/components/organisms/DynamicComponents/molecules/ActionsDropdown/modals/ScaleModal.d.ts +10 -0
  52. package/dist/types/components/organisms/DynamicComponents/molecules/ActionsDropdown/permissionsMap.d.ts +7 -0
  53. package/dist/types/components/organisms/DynamicComponents/molecules/ActionsDropdown/utils.d.ts +9 -7
  54. package/dist/types/components/organisms/DynamicComponents/molecules/AntdResult/AntdResult.d.ts +6 -0
  55. package/dist/types/components/organisms/DynamicComponents/molecules/AntdResult/AntdResult.test.d.ts +1 -0
  56. package/dist/types/components/organisms/DynamicComponents/molecules/AntdResult/index.d.ts +1 -0
  57. package/dist/types/components/organisms/DynamicComponents/molecules/AntdResult/styled.d.ts +548 -0
  58. package/dist/types/components/organisms/DynamicComponents/molecules/AntdResult/utils.d.ts +33 -0
  59. package/dist/types/components/organisms/DynamicComponents/molecules/AntdResult/utils.test.d.ts +1 -0
  60. package/dist/types/components/organisms/DynamicComponents/molecules/EnrichedTable/EnrichedTable.error.test.d.ts +1 -0
  61. package/dist/types/components/organisms/DynamicComponents/molecules/Events/Events.permissions.test.d.ts +2 -0
  62. package/dist/types/components/organisms/DynamicComponents/molecules/LabelsToSearchParams/utils.d.ts +6 -0
  63. package/dist/types/components/organisms/DynamicComponents/molecules/MappedParsedText/MappedParsedText.d.ts +5 -0
  64. package/dist/types/components/organisms/DynamicComponents/molecules/MappedParsedText/index.d.ts +1 -0
  65. package/dist/types/components/organisms/DynamicComponents/molecules/ParsedText/ParsedText.test.d.ts +1 -0
  66. package/dist/types/components/organisms/DynamicComponents/molecules/PerRequestError/PerRequestError.d.ts +7 -0
  67. package/dist/types/components/organisms/DynamicComponents/molecules/PerRequestError/PerRequestError.test.d.ts +1 -0
  68. package/dist/types/components/organisms/DynamicComponents/molecules/PerRequestError/index.d.ts +1 -0
  69. package/dist/types/components/organisms/DynamicComponents/molecules/SecretBase64Plain/styled.d.ts +1 -0
  70. package/dist/types/components/organisms/DynamicComponents/molecules/SecretBase64Plain/utils.d.ts +2 -0
  71. package/dist/types/components/organisms/DynamicComponents/molecules/SecretBase64Plain/utils.test.d.ts +1 -0
  72. package/dist/types/components/organisms/DynamicComponents/molecules/Volumes/Volumes.d.ts +6 -0
  73. package/dist/types/components/organisms/DynamicComponents/molecules/Volumes/Volumes.test.d.ts +1 -0
  74. package/dist/types/components/organisms/DynamicComponents/molecules/Volumes/index.d.ts +1 -0
  75. package/dist/types/components/organisms/DynamicComponents/molecules/Volumes/utils.d.ts +46 -0
  76. package/dist/types/components/organisms/DynamicComponents/molecules/hooks/index.d.ts +1 -0
  77. package/dist/types/components/organisms/DynamicComponents/molecules/hooks/mergePerRequestErrors.d.ts +10 -0
  78. package/dist/types/components/organisms/DynamicComponents/molecules/hooks/types.d.ts +5 -0
  79. package/dist/types/components/organisms/DynamicComponents/molecules/hooks/useAutoPerRequestError.d.ts +15 -0
  80. package/dist/types/components/organisms/DynamicComponents/molecules/hooks/useAutoPerRequestError.test.d.ts +1 -0
  81. package/dist/types/components/organisms/DynamicComponents/molecules/index.d.ts +3 -0
  82. package/dist/types/components/organisms/DynamicComponents/molecules/utils.d.ts +19 -0
  83. package/dist/types/components/organisms/DynamicComponents/types/ActionsDropdown.d.ts +79 -17
  84. package/dist/types/components/organisms/DynamicComponents/types/LabelsToSearchParams.d.ts +1 -0
  85. package/dist/types/components/organisms/DynamicComponents/types/MappedParsedText.d.ts +7 -0
  86. package/dist/types/components/organisms/DynamicComponents/types/SecretBase64Plain.d.ts +10 -0
  87. package/dist/types/components/organisms/DynamicComponents/types/Volumes.d.ts +19 -0
  88. package/dist/types/components/organisms/DynamicComponents/types/antdComponents.d.ts +22 -1
  89. package/dist/types/components/organisms/DynamicComponents/types/index.d.ts +6 -1
  90. package/dist/types/components/organisms/DynamicComponents/types/parsedText.d.ts +1 -0
  91. package/dist/types/components/organisms/DynamicRendererWithProviders/DynamicRendererWithProviders.d.ts +2 -0
  92. package/dist/types/components/organisms/DynamicRendererWithProviders/EffectiveAntdResultWrapper/EffectiveAntdResultWrapper.d.ts +8 -0
  93. package/dist/types/components/organisms/DynamicRendererWithProviders/EffectiveAntdResultWrapper/EffectiveAntdResultWrapper.test.d.ts +1 -0
  94. package/dist/types/components/organisms/DynamicRendererWithProviders/EffectiveAntdResultWrapper/index.d.ts +1 -0
  95. package/dist/types/components/organisms/DynamicRendererWithProviders/providers/hybridDataProvider/hybridDataProvider.d.ts +4 -0
  96. package/dist/types/hooks/useApiResource.d.ts +2 -1
  97. package/dist/types/hooks/useApisResourceTypes.d.ts +4 -2
  98. package/dist/types/hooks/useBuiltinResource.d.ts +2 -1
  99. package/dist/types/hooks/useBuiltinResourceTypes.d.ts +2 -1
  100. package/dist/types/hooks/useClusterList.d.ts +6 -3
  101. package/dist/types/hooks/useDirectUnknownResource.d.ts +2 -1
  102. package/dist/types/hooks/useK8sSmartResource/useSmartResourceParams.d.ts +3 -2
  103. package/dist/types/hooks/useKindsRaw.d.ts +8 -0
  104. package/dist/types/hooks/useListThenWatch/types.d.ts +2 -0
  105. package/dist/types/hooks/useResourceScope/useResourceScope.d.ts +2 -1
  106. package/dist/types/index.d.ts +2 -1
  107. package/dist/types/localTypes/bff/form.d.ts +2 -0
  108. package/dist/types/localTypes/bff/table.d.ts +2 -1
  109. package/dist/types/localTypes/clusterList.d.ts +3 -2
  110. package/dist/types/localTypes/dynamicRender.d.ts +5 -0
  111. package/dist/types/localTypes/richTable.d.ts +4 -0
  112. package/package.json +5 -5
  113. package/dist/index-DGEm7Wqt.mjs.map +0 -1
  114. package/dist/index-DPPcb4Gw.mjs.map +0 -1
  115. package/dist/types/components/organisms/DynamicComponents/molecules/ActionsDropdown/hooks/useActionsDropdownHandlers.d.ts +0 -45
@@ -1,7 +1,8 @@
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 { AnyObject } from 'antd/es/_util/type';
5
+ import { TAdditionalPrinterColumnsColWidths, TAdditionalPrinterColumnsTrimLengths, TAdditionalPrinterColumnsUndefinedValues, TAdditionalPrinterColumnsTooltips, TAdditionalPrinterColumnsKeyTypeProps, TAdditionalPrinterColumnsCustomSortersAndFilters } from '../../../../../localTypes/richTable';
5
6
  import { TJSON } from '../../../../../localTypes/JSON';
6
7
  export declare const getCellRender: ({ value, record, possibleTrimLength, possibleUndefinedValue, possibleCustomTypeWithProps, theme, }: {
7
8
  value: TJSON;
@@ -14,20 +15,21 @@ export declare const getCellRender: ({ value, record, possibleTrimLength, possib
14
15
  } | undefined;
15
16
  theme: 'dark' | 'light';
16
17
  }) => JSX.Element;
17
- export declare const getEnrichedColumns: ({ columns, additionalPrinterColumnsUndefinedValues, additionalPrinterColumnsTrimLengths, additionalPrinterColumnsColWidths, additionalPrinterColumnsKeyTypeProps, additionalPrinterColumnsCustomSortersAndFilters, theme, getRowKey, }: {
18
- columns: TableProps['columns'];
18
+ export declare const getEnrichedColumns: <T extends AnyObject = AnyObject>({ columns, additionalPrinterColumnsUndefinedValues, additionalPrinterColumnsTrimLengths, additionalPrinterColumnsColWidths, additionalPrinterColumnsTooltips, additionalPrinterColumnsKeyTypeProps, additionalPrinterColumnsCustomSortersAndFilters, theme, getRowKey, }: {
19
+ columns: import("antd").TableColumnsType<T> | undefined;
19
20
  additionalPrinterColumnsUndefinedValues?: TAdditionalPrinterColumnsUndefinedValues | undefined;
20
21
  additionalPrinterColumnsTrimLengths?: TAdditionalPrinterColumnsTrimLengths | undefined;
21
22
  additionalPrinterColumnsColWidths?: TAdditionalPrinterColumnsColWidths | undefined;
23
+ additionalPrinterColumnsTooltips?: TAdditionalPrinterColumnsTooltips | undefined;
22
24
  additionalPrinterColumnsKeyTypeProps?: TAdditionalPrinterColumnsKeyTypeProps | undefined;
23
25
  additionalPrinterColumnsCustomSortersAndFilters?: TAdditionalPrinterColumnsCustomSortersAndFilters | undefined;
24
26
  theme: 'dark' | 'light';
25
- getRowKey: (record: any) => React.Key;
26
- }) => TableProps['columns'] | undefined;
27
- export declare const getEnrichedColumnsWithControls: ({ enrichedColumns, navigate, baseprefix, editIcon, deleteIcon, }: {
28
- enrichedColumns: TableProps['columns'];
27
+ getRowKey: (record: T) => React.Key;
28
+ }) => import("antd").TableColumnsType<T> | undefined;
29
+ export declare const getEnrichedColumnsWithControls: <T extends AnyObject = AnyObject>({ enrichedColumns, navigate, baseprefix, editIcon, deleteIcon, }: {
30
+ enrichedColumns: import("antd").TableColumnsType<T> | undefined;
29
31
  navigate: NavigateFunction;
30
32
  baseprefix?: string | undefined;
31
33
  editIcon?: ReactNode;
32
34
  deleteIcon?: ReactNode;
33
- }) => TableProps['columns'] | undefined;
35
+ }) => import("antd").TableColumnsType<T> | undefined;
@@ -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;
@@ -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,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>;
@@ -1,18 +1,20 @@
1
1
  import React from 'react';
2
- import type { TPermissionVerb } from '../../../../../localTypes/permissions';
3
2
  import { TActionUnion, TEditActionProps, TActionsPermissions } from '../../types/ActionsDropdown';
3
+ import { TRequiredPermission } from './permissionsMap';
4
4
  type TVisibilityContext = {
5
5
  replaceValues: Record<string, string | undefined>;
6
6
  multiQueryData: Record<string, unknown>;
7
7
  };
8
- export type TRequiredPermission = {
9
- verb: TPermissionVerb;
10
- subresource?: string;
11
- };
12
8
  export declare const getRequiredPermissions: (actions: TActionUnion[]) => TRequiredPermission[];
13
- 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
+ }[];
14
13
  export declare const buildEditUrl: (props: TEditActionProps, fullPath: string) => string;
15
- 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) => {
16
18
  key: string;
17
19
  label: string | import("react/jsx-runtime").JSX.Element;
18
20
  icon: React.ReactNode;
@@ -0,0 +1,6 @@
1
+ import { FC } from 'react';
2
+ import { TDynamicComponentsAppTypeMap } from '../../types';
3
+ export declare const AntdResult: FC<{
4
+ data: TDynamicComponentsAppTypeMap['antdResult'];
5
+ children?: any;
6
+ }>;
@@ -0,0 +1 @@
1
+ export { AntdResult } from './AntdResult';