@k8slens/extensions 5.6.0-git.1b7dd717a5.0 → 5.6.0-git.2eb585e88e.0

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.
@@ -7,7 +7,13 @@ import { KubeObject } from "../kube-object";
7
7
  import type { DerivedKubeApiOptions, IgnoredKubeApiOptions } from "../kube-api";
8
8
  import { KubeApi } from "../kube-api";
9
9
  export declare class ClusterApi extends KubeApi<Cluster> {
10
+ /**
11
+ * @deprecated This field is legacy and never used.
12
+ */
10
13
  static kind: string;
14
+ /**
15
+ * @deprecated This field is legacy and never used.
16
+ */
11
17
  static namespaced: boolean;
12
18
  constructor(opts?: DerivedKubeApiOptions & IgnoredKubeApiOptions);
13
19
  }
@@ -68,5 +74,6 @@ export interface Cluster {
68
74
  export declare class Cluster extends KubeObject {
69
75
  static kind: string;
70
76
  static apiBase: string;
77
+ static namespaced: boolean;
71
78
  getStatus(): ClusterStatus;
72
79
  }
@@ -96,6 +96,8 @@ export declare function bindPredicate<FnArgs extends any[], T>(fn: (arg1: unknow
96
96
  export declare function hasDefiniteField<Field extends keyof T, T>(field: Field): (val: T) => val is T & {
97
97
  [f in Field]-?: NonNullable<T[Field]>;
98
98
  };
99
+ export declare function isPromiseSettledRejected<T>(result: PromiseSettledResult<T>): result is PromiseRejectedResult;
100
+ export declare function isPromiseSettledFulfilled<T>(result: PromiseSettledResult<T>): result is PromiseFulfilledResult<T>;
99
101
  export declare function isErrnoException(error: unknown): error is NodeJS.ErrnoException;
100
102
  export declare function isExecException(error: unknown): error is ExecException;
101
103
  export declare function isExecFileException(error: unknown): error is ExecFileException;
@@ -1,2 +1,2 @@
1
- declare const baseBundeledBinariesDirectoryInjectable: import("@ogre-tools/injectable").Injectable<string, unknown, void>;
2
- export default baseBundeledBinariesDirectoryInjectable;
1
+ declare const baseBundledBinariesDirectoryInjectable: import("@ogre-tools/injectable").Injectable<string, unknown, void>;
2
+ export default baseBundledBinariesDirectoryInjectable;
@@ -0,0 +1,2 @@
1
+ declare const normalizedPlatformArchitectureInjectable: import("@ogre-tools/injectable").Injectable<"arm64" | "x64" | "ia32", unknown, void>;
2
+ export default normalizedPlatformArchitectureInjectable;
@@ -50,6 +50,7 @@ declare const packageJsonInjectable: import("@ogre-tools/injectable").Injectable
50
50
  bundledKubectlVersion: string;
51
51
  bundledHelmVersion: string;
52
52
  sentryDsn: string;
53
+ contentSecurityPolicy: string;
53
54
  };
54
55
  engines: {
55
56
  node: string;
@@ -81,3 +81,4 @@ export declare const kubernetesDocumentationWeblinkId = "kubernetes-documentatio
81
81
  export declare const appSemVer: SemVer;
82
82
  export declare const docsUrl: string;
83
83
  export declare const sentryDsn: string;
84
+ export declare const contentSecurityPolicy: string;
@@ -1,3 +1,2 @@
1
- /// <reference types="electron" />
2
1
  declare const ipcMainInjectable: import("@ogre-tools/injectable").Injectable<Electron.IpcMain, unknown, void>;
3
2
  export default ipcMainInjectable;
@@ -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;
@@ -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>;
@@ -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;
package/package.json CHANGED
@@ -2,7 +2,7 @@
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.1b7dd717a5.0",
5
+ "version": "5.6.0-git.2eb585e88e.0",
6
6
  "copyright": "© 2021 OpenLens Authors",
7
7
  "license": "MIT",
8
8
  "main": "dist/src/extensions/extension-api.js",
@@ -1,2 +0,0 @@
1
- declare const bundledBinariesNormalizedArchInjectable: import("@ogre-tools/injectable").Injectable<"arm64" | "x64" | "ia32", unknown, void>;
2
- export default bundledBinariesNormalizedArchInjectable;