@k8slens/extensions 5.6.0-git.f12851ff3b.0 → 5.6.0-git.f8b6c4a427.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (67) hide show
  1. package/dist/src/common/app-paths/app-path-injection-token.d.ts +0 -1
  2. package/dist/src/common/application-update/selected-update-channel/default-update-channel.injectable.d.ts +2 -0
  3. package/dist/src/common/application-update/selected-update-channel/selected-update-channel.injectable.d.ts +8 -0
  4. package/dist/src/common/application-update/update-channels.d.ts +11 -0
  5. package/dist/src/common/ipc/index.d.ts +0 -1
  6. package/dist/src/common/k8s-api/endpoints/cluster.api.d.ts +7 -0
  7. package/dist/src/common/k8s-api/endpoints/custom-resource-definition.api.d.ts +8 -3
  8. package/dist/src/common/k8s-api/endpoints/metrics.api.d.ts +1 -1
  9. package/dist/src/common/{ipc-channel/channel.d.ts → k8s-api/endpoints/types/external-documentation.d.ts} +3 -3
  10. package/dist/src/common/k8s-api/endpoints/types/json-schema-props.d.ts +86 -0
  11. package/dist/src/common/k8s-api/kube-api.d.ts +9 -0
  12. package/dist/src/common/k8s-api/kube-object.store.d.ts +2 -2
  13. package/dist/src/common/terminal/channels.d.ts +28 -0
  14. package/dist/src/common/user-store/preferences-helpers.d.ts +2 -6
  15. package/dist/src/common/user-store/user-store.d.ts +7 -3
  16. package/dist/src/common/utils/buildUrl.d.ts +1 -1
  17. package/dist/src/common/utils/reject-promise.d.ts +2 -2
  18. package/dist/src/common/utils/type-narrowing.d.ts +5 -0
  19. package/dist/src/common/vars/base-bundled-binaries-dir.injectable.d.ts +2 -0
  20. package/dist/src/common/vars/bundled-resources-dir.injectable.d.ts +2 -0
  21. package/dist/src/common/vars/lens-resources-dir.injectable.d.ts +2 -0
  22. package/dist/src/common/vars/normalized-platform-architecture.injectable.d.ts +2 -0
  23. package/dist/src/common/vars/normalized-platform.injectable.d.ts +2 -0
  24. package/dist/src/common/vars/package-json.injectable.d.ts +352 -0
  25. package/dist/src/common/vars/static-files-directory.injectable.d.ts +2 -0
  26. package/dist/src/common/vars.d.ts +7 -9
  27. package/dist/src/extensions/extensions-store/extensions-store.d.ts +5 -4
  28. package/dist/src/extensions/registries/entity-setting-registry.d.ts +1 -1
  29. package/dist/src/main/app-paths/app-name/product-name.injectable.d.ts +2 -0
  30. package/dist/src/main/kube-auth-proxy/kube-auth-proxy.d.ts +1 -0
  31. package/dist/src/main/kubectl/kubectl.d.ts +18 -14
  32. package/dist/src/main/start-main-application/lens-window/application-window/application-window.injectable.d.ts +1 -1
  33. package/dist/src/main/start-main-application/lens-window/application-window/create-electron-window-for.injectable.d.ts +9 -1
  34. package/dist/src/main/start-main-application/lens-window/application-window/create-lens-window.injectable.d.ts +4 -4
  35. package/dist/src/main/start-main-application/lens-window/application-window/lens-window-injection-token.d.ts +1 -1
  36. package/dist/src/main/start-main-application/lens-window/navigate.injectable.d.ts +1 -1
  37. package/dist/src/main/start-main-application/lens-window/splash-window/splash-window.injectable.d.ts +1 -1
  38. package/dist/src/main/{app-paths/register-channel → utils/channel}/ipc-main/ipc-main.injectable.d.ts +0 -1
  39. package/dist/src/renderer/api/terminal-api.d.ts +2 -22
  40. package/dist/src/renderer/api/websocket-api.d.ts +4 -4
  41. package/dist/src/renderer/components/+namespaces/namespace-select.d.ts +1 -0
  42. package/dist/src/renderer/components/+user-management/+service-accounts/service-account-menu.d.ts +1 -0
  43. package/dist/src/renderer/components/animate/animate.d.ts +6 -1
  44. package/dist/src/renderer/components/animate/request-animation-frame.injectable.d.ts +2 -0
  45. package/dist/src/renderer/components/dock/dock/create-dock-tab.injectable.d.ts +1 -1
  46. package/dist/src/renderer/components/dock/terminal/terminal.d.ts +6 -3
  47. package/dist/src/renderer/components/drawer/drawer-item-labels.d.ts +1 -0
  48. package/dist/src/renderer/components/drawer/drawer-item.d.ts +7 -2
  49. package/dist/src/renderer/components/drawer/drawer-title.d.ts +5 -1
  50. package/dist/src/renderer/components/input/input.d.ts +7 -8
  51. package/dist/src/renderer/components/input/input_validators.d.ts +28 -15
  52. package/dist/src/renderer/components/item-object-list/filter-icon.d.ts +1 -0
  53. package/dist/src/renderer/components/notifications/notifications-store.injectable.d.ts +3 -0
  54. package/dist/src/renderer/components/notifications/notifications.d.ts +7 -12
  55. package/dist/src/renderer/components/notifications/notifications.store.d.ts +0 -1
  56. package/dist/src/renderer/components/resource-metrics/no-metrics.d.ts +1 -0
  57. package/dist/src/renderer/components/select/select.d.ts +1 -1
  58. package/dist/src/renderer/components/switch/form-switcher.d.ts +1 -0
  59. package/dist/src/renderer/components/table/table-cell.d.ts +0 -4
  60. package/dist/src/renderer/components/wizard/wizard.d.ts +2 -0
  61. package/dist/src/renderer/{app-paths/get-value-from-registered-channel/ipc-renderer → utils/channel}/ipc-renderer.injectable.d.ts +0 -1
  62. package/dist/src/renderer/utils/index.d.ts +0 -1
  63. package/package.json +2 -2
  64. package/dist/src/common/app-paths/directory-for-bundled-binaries/directory-for-bundled-binaries.injectable.d.ts +0 -2
  65. package/dist/src/common/ipc/update-available.d.ts +0 -19
  66. package/dist/src/common/ipc-channel/create-channel/create-channel.d.ts +0 -6
  67. package/dist/src/renderer/utils/display-booleans.d.ts +0 -6
@@ -0,0 +1,2 @@
1
+ declare const requestAnimationFrameInjectable: import("@ogre-tools/injectable").Injectable<(callback: () => void) => number, unknown, void>;
2
+ export default requestAnimationFrameInjectable;
@@ -1,3 +1,3 @@
1
1
  import type { DockTab, DockTabCreate } from "./store";
2
- declare const createDockTabInjectable: import("@ogre-tools/injectable").Injectable<(rawTabDesc: DockTabCreate, addNumber?: boolean | undefined) => DockTab, unknown, void>;
2
+ declare const createDockTabInjectable: import("@ogre-tools/injectable").Injectable<(rawTabDesc: DockTabCreate, addNumber?: boolean) => DockTab, unknown, void>;
3
3
  export default createDockTabInjectable;
@@ -30,7 +30,10 @@ export declare class Terminal {
30
30
  private get viewport();
31
31
  attachTo(parentElem: HTMLElement): void;
32
32
  detach(): void;
33
- constructor(dependencies: TerminalDependencies, { tabId, api }: TerminalArguments);
33
+ get fontFamily(): string;
34
+ get fontSize(): number;
35
+ get theme(): Record<string, string>;
36
+ constructor(dependencies: TerminalDependencies, { tabId, api, }: TerminalArguments);
34
37
  destroy(): void;
35
38
  fit: () => void;
36
39
  fitLazy: import("lodash").DebouncedFunc<() => void>;
@@ -44,7 +47,7 @@ export declare class Terminal {
44
47
  onClickLink: (evt: MouseEvent, link: string) => void;
45
48
  onContextMenu: () => void;
46
49
  onSelectionChange: () => void;
47
- setFontSize: (size: number) => void;
48
- setFontFamily: (family: string) => void;
50
+ setFontSize: (fontSize: number) => void;
51
+ setFontFamily: (fontFamily: string) => void;
49
52
  keyHandler: (evt: KeyboardEvent) => boolean;
50
53
  }
@@ -2,6 +2,7 @@
2
2
  * Copyright (c) OpenLens Authors. All rights reserved.
3
3
  * Licensed under MIT License. See LICENSE in root directory for more information.
4
4
  */
5
+ /// <reference types="react" />
5
6
  import type { DrawerItemProps } from "./drawer-item";
6
7
  export interface DrawerItemLabelsProps extends DrawerItemProps {
7
8
  labels: string[] | Partial<Record<string, string>>;
@@ -9,6 +9,11 @@ export interface DrawerItemProps extends React.HTMLAttributes<HTMLDivElement> {
9
9
  title?: string;
10
10
  labelsOnly?: boolean;
11
11
  hidden?: boolean;
12
- renderBoolean?: boolean;
12
+ /**
13
+ * @deprecated This prop is no longer used, you should stringify the booleans yourself.
14
+ *
15
+ * This was only meant to be an internal prop anyway.
16
+ */
17
+ renderBooleans?: boolean;
13
18
  }
14
- export declare function DrawerItem({ name, title, labelsOnly, children, hidden, className, renderBoolean, ...elemProps }: DrawerItemProps): JSX.Element | null;
19
+ export declare function DrawerItem({ name, title, labelsOnly, children, hidden, className, ...elemProps }: DrawerItemProps): JSX.Element | null;
@@ -5,7 +5,11 @@
5
5
  import React from "react";
6
6
  export interface DrawerTitleProps {
7
7
  className?: string;
8
- children: React.ReactNode;
8
+ children?: React.ReactNode;
9
+ /**
10
+ * @deprecated Prefer passing the value as `children`
11
+ */
12
+ title?: React.ReactNode;
9
13
  /**
10
14
  * Specifies how large this title is
11
15
  *
@@ -8,10 +8,9 @@ import type { DOMAttributes, InputHTMLAttributes, TextareaHTMLAttributes } from
8
8
  import React from "react";
9
9
  import type { TooltipProps } from "../tooltip";
10
10
  import * as Validators from "./input_validators";
11
- import type { InputValidator } from "./input_validators";
12
- declare const InputValidators: {
13
- inputValidator<IsAsync extends boolean = false>(validator: Validators.InputValidator<IsAsync>): Validators.InputValidator<IsAsync>;
14
- AsyncInputValidationError: typeof Validators.AsyncInputValidationError;
11
+ import type { InputValidator, InputValidation, InputValidationResult, SyncValidationMessage } from "./input_validators";
12
+ declare const asyncInputValidator: typeof Validators.asyncInputValidator, inputValidator: typeof Validators.inputValidator, isAsyncValidator: typeof Validators.isAsyncValidator, unionInputValidatorsAsync: typeof Validators.unionInputValidatorsAsync, InputValidators: {
13
+ unionInputValidators(baseValidator: Pick<Validators.InputValidator<false>, "message" | "condition">, ...validators: Validators.InputValidator<false>[]): Validators.InputValidator<false>;
15
14
  isRequired: Validators.InputValidator<false>;
16
15
  isEmail: Validators.InputValidator<false>;
17
16
  isNumber: Validators.InputValidator<false>;
@@ -30,8 +29,8 @@ declare const InputValidators: {
30
29
  systemName: Validators.InputValidator<false>;
31
30
  accountId: Validators.InputValidator<false>;
32
31
  };
33
- export { InputValidators };
34
- export type { InputValidator };
32
+ export { InputValidators, asyncInputValidator, inputValidator, isAsyncValidator, unionInputValidatorsAsync, };
33
+ export type { InputValidator, InputValidation, InputValidationResult, SyncValidationMessage, };
35
34
  declare type InputElement = HTMLInputElement | HTMLTextAreaElement;
36
35
  declare type InputElementProps = InputHTMLAttributes<HTMLInputElement> & TextareaHTMLAttributes<HTMLTextAreaElement> & DOMAttributes<InputElement>;
37
36
  export interface IconDataFnArg {
@@ -75,7 +74,7 @@ interface State {
75
74
  export declare class Input extends React.Component<InputProps, State> {
76
75
  static defaultProps: object;
77
76
  input: InputElement | null;
78
- validators: InputValidator<boolean>[];
77
+ validators: InputValidator[];
79
78
  state: State;
80
79
  constructor(props: InputProps);
81
80
  componentWillUnmount(): void;
@@ -94,7 +93,7 @@ export declare class Input extends React.Component<InputProps, State> {
94
93
  onFocus(evt: React.FocusEvent<InputElement>): void;
95
94
  onBlur(evt: React.FocusEvent<InputElement>): void;
96
95
  setDirtyOnChange: import("lodash").DebouncedFunc<() => void>;
97
- onChange(evt: React.ChangeEvent<any>): void;
96
+ onChange(evt: React.ChangeEvent<any>): Promise<void>;
98
97
  onKeyDown(evt: React.KeyboardEvent<InputElement>): void;
99
98
  get showMaxLenIndicator(): boolean | 0 | undefined;
100
99
  get isUncontrolled(): boolean;
@@ -3,29 +3,42 @@
3
3
  * Licensed under MIT License. See LICENSE in root directory for more information.
4
4
  */
5
5
  import type { InputProps } from "./input";
6
- import type { ReactNode } from "react";
7
- export declare class AsyncInputValidationError extends Error {
8
- }
9
- export declare type InputValidator<IsAsync extends boolean> = {
6
+ import type React from "react";
7
+ import type { SetRequired } from "type-fest";
8
+ export declare type InputValidationResult<IsAsync extends boolean> = IsAsync extends true ? Promise<void> : boolean;
9
+ export declare type InputValidation<IsAsync extends boolean> = (value: string, props?: InputProps) => InputValidationResult<IsAsync>;
10
+ export declare type SyncValidationMessage = React.ReactNode | ((value: string, props?: InputProps) => React.ReactNode);
11
+ export declare type InputValidator<IsAsync extends boolean = boolean> = {
10
12
  /**
11
13
  * Filters itself based on the input props
12
14
  */
13
15
  condition?: (props: InputProps) => any;
14
- } & (IsAsync extends false ? {
15
- validate: (value: string, props: InputProps) => boolean;
16
- message: ReactNode | ((value: string, props: InputProps) => ReactNode | string);
17
- debounce?: undefined;
18
- } : {
16
+ } & (IsAsync extends true ? {
19
17
  /**
20
- * If asyncronous then the rejection message is the error message
21
- *
22
- * This function MUST reject with an instance of {@link AsyncInputValidationError}
18
+ * The validation message maybe either specified from the `message` field (higher priority)
19
+ * or if that is not provided then the message will retrived from the rejected with value
23
20
  */
24
- validate: (value: string, props: InputProps) => Promise<void>;
25
- message?: undefined;
21
+ validate: InputValidation<true>;
22
+ message?: SyncValidationMessage;
26
23
  debounce: number;
24
+ } : {
25
+ validate: InputValidation<false>;
26
+ message: SyncValidationMessage;
27
+ debounce?: undefined;
27
28
  });
28
- export declare function inputValidator<IsAsync extends boolean = false>(validator: InputValidator<IsAsync>): InputValidator<IsAsync>;
29
+ export declare function isAsyncValidator(validator: InputValidator<boolean>): validator is InputValidator<true>;
30
+ export declare function asyncInputValidator(validator: InputValidator<true>): InputValidator<true>;
31
+ export declare function inputValidator(validator: InputValidator<false>): InputValidator<false>;
32
+ /**
33
+ * Create a new input validator from a list of syncronous input validators. Will match as valid if
34
+ * one of the input validators matches the input
35
+ */
36
+ export declare function unionInputValidators(baseValidator: Pick<InputValidator<false>, "condition" | "message">, ...validators: InputValidator<false>[]): InputValidator<false>;
37
+ /**
38
+ * Create a new input validator from a list of syncronous or async input validators. Will match as
39
+ * valid if one of the input validators matches the input
40
+ */
41
+ export declare function unionInputValidatorsAsync(baseValidator: SetRequired<Pick<InputValidator<boolean>, "condition" | "message">, "message">, ...validators: InputValidator<boolean>[]): InputValidator<true>;
29
42
  export declare const isRequired: InputValidator<false>;
30
43
  export declare const isEmail: InputValidator<false>;
31
44
  export declare const isNumber: InputValidator<false>;
@@ -2,6 +2,7 @@
2
2
  * Copyright (c) OpenLens Authors. All rights reserved.
3
3
  * Licensed under MIT License. See LICENSE in root directory for more information.
4
4
  */
5
+ /// <reference types="react" />
5
6
  import type { IconProps } from "../icon";
6
7
  import { FilterType } from "./page-filters/store";
7
8
  export interface FilterIconProps extends Partial<IconProps> {
@@ -0,0 +1,3 @@
1
+ import { NotificationsStore } from "./notifications.store";
2
+ declare const notificationsStoreInjectable: import("@ogre-tools/injectable").Injectable<NotificationsStore, unknown, void>;
3
+ export default notificationsStoreInjectable;
@@ -5,15 +5,10 @@
5
5
  import "./notifications.scss";
6
6
  import React from "react";
7
7
  import type { Notification, NotificationMessage } from "./notifications.store";
8
- export declare class Notifications extends React.Component {
9
- elem: HTMLDivElement | null;
10
- static ok(message: NotificationMessage): () => void;
11
- static checkedError(message: unknown, fallback: string, customOpts?: Partial<Omit<Notification, "message">>): () => void;
12
- static error(message: NotificationMessage, customOpts?: Partial<Omit<Notification, "message">>): () => void;
13
- static shortInfo(message: NotificationMessage, customOpts?: Partial<Omit<Notification, "message">>): () => void;
14
- static info(message: NotificationMessage, customOpts?: Partial<Omit<Notification, "message">>): () => void;
15
- componentDidMount(): void;
16
- scrollToLastNotification(): void;
17
- getMessage(notification: Notification): (React.ReactChild | React.ReactFragment | React.ReactPortal)[];
18
- render(): JSX.Element;
19
- }
8
+ export declare const Notifications: React.FC<{}> & {
9
+ ok: (message: NotificationMessage) => () => void;
10
+ checkedError: (message: unknown, fallback: string, customOpts?: Partial<Omit<Notification, "message">>) => () => void;
11
+ error: (message: NotificationMessage, customOpts?: Partial<Omit<Notification, "message">>) => () => void;
12
+ shortInfo: (message: NotificationMessage, customOpts?: Partial<Omit<Notification, "message">>) => () => void;
13
+ info: (message: NotificationMessage, customOpts?: Partial<Omit<Notification, "message">>) => () => void;
14
+ };
@@ -28,4 +28,3 @@ export declare class NotificationsStore {
28
28
  add(rawNotification: Notification): () => void;
29
29
  remove(id: NotificationId): void;
30
30
  }
31
- export declare const notificationsStore: NotificationsStore;
@@ -2,4 +2,5 @@
2
2
  * Copyright (c) OpenLens Authors. All rights reserved.
3
3
  * Licensed under MIT License. See LICENSE in root directory for more information.
4
4
  */
5
+ /// <reference types="react" />
5
6
  export declare function NoMetrics(): JSX.Element;
@@ -8,7 +8,7 @@ import type { ObservableSet } from "mobx";
8
8
  import type { Props as ReactSelectProps, GroupBase, PropsValue } from "react-select";
9
9
  export interface SelectOption<Value> {
10
10
  value: Value;
11
- label: string;
11
+ label: React.ReactNode;
12
12
  isDisabled?: boolean;
13
13
  isSelected?: boolean;
14
14
  }
@@ -2,6 +2,7 @@
2
2
  * Copyright (c) OpenLens Authors. All rights reserved.
3
3
  * Licensed under MIT License. See LICENSE in root directory for more information.
4
4
  */
5
+ /// <reference types="react" />
5
6
  import type { FormControlLabelProps } from "@material-ui/core/FormControlLabel";
6
7
  /**
7
8
  * @deprecated Use <Switch/> instead from "../switch.tsx".
@@ -32,10 +32,6 @@ export interface TableCellProps extends React.DOMAttributes<HTMLDivElement> {
32
32
  * mark checkbox as checked or not
33
33
  */
34
34
  isChecked?: boolean;
35
- /**
36
- * show "true" or "false" for all of the children elements are "typeof boolean"
37
- */
38
- renderBoolean?: boolean;
39
35
  /**
40
36
  * column name, must be same as key in sortable object <Table sortable={}/>
41
37
  */
@@ -64,6 +64,8 @@ export interface WizardStepProps<D> extends WizardCommonProps<D> {
64
64
  skip?: boolean;
65
65
  scrollable?: boolean;
66
66
  children?: React.ReactNode | React.ReactNode[];
67
+ testIdForNext?: string;
68
+ testIdForPrev?: string;
67
69
  }
68
70
  interface WizardStepState {
69
71
  waiting?: boolean;
@@ -1,3 +1,2 @@
1
- /// <reference types="electron" />
2
1
  declare const ipcRendererInjectable: import("@ogre-tools/injectable").Injectable<Electron.IpcRenderer, unknown, void>;
3
2
  export default ipcRendererInjectable;
@@ -6,7 +6,6 @@ export * from "../../common/utils";
6
6
  export * from "../../common/event-emitter";
7
7
  export * from "./cssNames";
8
8
  export * from "./cssVar";
9
- export * from "./display-booleans";
10
9
  export * from "./display-mode";
11
10
  export * from "./interval";
12
11
  export * from "./isMiddleClick";
package/package.json CHANGED
@@ -2,8 +2,8 @@
2
2
  "name": "@k8slens/extensions",
3
3
  "productName": "OpenLens extensions",
4
4
  "description": "OpenLens - Open Source Kubernetes IDE: extensions",
5
- "version": "5.6.0-git.f12851ff3b.0",
6
- "copyright": "© 2021 OpenLens Authors",
5
+ "version": "5.6.0-git.f8b6c4a427.0",
6
+ "copyright": "© 2022 OpenLens Authors",
7
7
  "license": "MIT",
8
8
  "main": "dist/src/extensions/extension-api.js",
9
9
  "types": "dist/src/extensions/extension-api.d.ts",
@@ -1,2 +0,0 @@
1
- declare const directoryForBundledBinariesInjectable: import("@ogre-tools/injectable").Injectable<string, unknown, void>;
2
- export default directoryForBundledBinariesInjectable;
@@ -1,19 +0,0 @@
1
- /**
2
- * Copyright (c) OpenLens Authors. All rights reserved.
3
- * Licensed under MIT License. See LICENSE in root directory for more information.
4
- */
5
- import type { UpdateInfo } from "electron-updater";
6
- export declare const UpdateAvailableChannel = "update-available";
7
- export declare const AutoUpdateChecking = "auto-update:checking";
8
- export declare const AutoUpdateNoUpdateAvailable = "auto-update:no-update";
9
- export declare const AutoUpdateLogPrefix = "[UPDATE-CHECKER]";
10
- export declare type UpdateAvailableFromMain = [backChannel: string, updateInfo: UpdateInfo];
11
- export declare function areArgsUpdateAvailableFromMain(args: unknown[]): args is UpdateAvailableFromMain;
12
- export declare type BackchannelArg = {
13
- doUpdate: false;
14
- } | {
15
- doUpdate: true;
16
- now: boolean;
17
- };
18
- export declare type UpdateAvailableToBackchannel = [updateDecision: BackchannelArg];
19
- export declare function areArgsUpdateAvailableToBackchannel(args: unknown[]): args is UpdateAvailableToBackchannel;
@@ -1,6 +0,0 @@
1
- /**
2
- * Copyright (c) OpenLens Authors. All rights reserved.
3
- * Licensed under MIT License. See LICENSE in root directory for more information.
4
- */
5
- import type { Channel } from "../channel";
6
- export declare const createChannel: <Message>(name: string) => Channel<Message>;
@@ -1,6 +0,0 @@
1
- /**
2
- * Copyright (c) OpenLens Authors. All rights reserved.
3
- * Licensed under MIT License. See LICENSE in root directory for more information.
4
- */
5
- import type React from "react";
6
- export declare function displayBooleans(shouldShow: boolean | undefined, from: React.ReactNode): React.ReactNode;