@k8slens/extensions 5.6.0-git.fba5892c8a.0 → 5.6.0-git.fc770b4b44.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/src/common/cluster/cluster.d.ts +2 -2
- package/dist/src/common/cluster/create-cluster-injection-token.d.ts +2 -2
- package/dist/src/common/cluster-store/allowed-resources-injection-token.d.ts +6 -0
- package/dist/src/common/cluster-store/cluster-store.d.ts +4 -1
- package/dist/src/common/cluster-store/read-cluster-config.injectable.d.ts +4 -0
- package/dist/src/common/cluster-types.d.ts +8 -0
- package/dist/src/common/front-end-routing/{route-injection-token.d.ts → front-end-route-injection-token.d.ts} +1 -1
- package/dist/src/common/front-end-routing/navigate-to-route-injection-token.d.ts +1 -1
- package/dist/src/common/front-end-routing/routes/catalog/catalog-route.injectable.d.ts +1 -1
- package/dist/src/common/front-end-routing/routes/cluster/custom-resources/custom-resources/custom-resources-route.injectable.d.ts +1 -1
- package/dist/src/common/front-end-routing/routes/cluster-view/cluster-view-route.injectable.d.ts +1 -1
- package/dist/src/common/fs/read-file-sync.injectable.d.ts +3 -0
- package/dist/src/common/k8s-api/endpoints/cluster.api.d.ts +7 -0
- package/dist/src/common/k8s-api/endpoints/ingress.api.d.ts +1 -1
- package/dist/src/common/k8s-api/endpoints/metrics.api.d.ts +1 -1
- package/dist/src/common/k8s-api/kube-api.d.ts +9 -0
- package/dist/src/common/k8s-api/kube-object.store.d.ts +2 -2
- package/dist/src/common/kube-helpers.d.ts +10 -2
- package/dist/src/common/terminal/channels.d.ts +28 -0
- package/dist/src/common/utils/buildUrl.d.ts +1 -1
- package/dist/src/common/utils/reject-promise.d.ts +2 -2
- package/dist/src/common/utils/resolve-system-proxy/resolve-system-proxy-injection-token.d.ts +6 -0
- package/dist/src/common/utils/type-narrowing.d.ts +5 -0
- package/dist/src/common/vars/base-bundled-binaries-dir.injectable.d.ts +2 -2
- package/dist/src/common/vars/normalized-platform-architecture.injectable.d.ts +2 -0
- package/dist/src/common/vars/package-json.injectable.d.ts +14 -10
- package/dist/src/common/vars.d.ts +1 -0
- package/dist/src/extensions/common-api/index.d.ts +2 -1
- package/dist/src/extensions/common-api/proxy.d.ts +10 -0
- package/dist/src/extensions/extension-loader/extension/extension.injectable.d.ts +7 -0
- package/dist/src/extensions/extension-loader/extension-loader.d.ts +2 -2
- package/dist/src/extensions/extension-loader/extension-registrator-injection-token.d.ts +7 -0
- package/dist/src/extensions/extensions-store/extensions-store.d.ts +5 -4
- package/dist/src/extensions/lens-extension-set-dependencies.d.ts +1 -1
- package/dist/src/extensions/lens-renderer-extension.d.ts +2 -0
- package/dist/src/extensions/registries/entity-setting-registry.d.ts +1 -1
- package/dist/src/extensions/renderer-api/components.d.ts +1 -0
- package/dist/src/main/kube-auth-proxy/kube-auth-proxy.d.ts +1 -0
- package/dist/src/main/start-main-application/lens-window/application-window/application-window.injectable.d.ts +1 -6
- package/dist/src/main/start-main-application/lens-window/application-window/{create-electron-window-for.injectable.d.ts → create-electron-window.injectable.d.ts} +4 -5
- package/dist/src/main/start-main-application/lens-window/application-window/create-lens-window.injectable.d.ts +6 -9
- package/dist/src/main/start-main-application/lens-window/application-window/lens-window-injection-token.d.ts +5 -2
- package/dist/src/main/start-main-application/lens-window/application-window/wait-until-bundled-extensions-are-loaded.injectable.d.ts +2 -0
- package/dist/src/main/start-main-application/lens-window/navigate.injectable.d.ts +1 -1
- package/dist/src/main/start-main-application/lens-window/splash-window/splash-window.injectable.d.ts +1 -6
- package/dist/src/main/utils/channel/ipc-main/ipc-main.injectable.d.ts +0 -1
- package/dist/src/renderer/api/terminal-api.d.ts +2 -22
- package/dist/src/renderer/api/websocket-api.d.ts +4 -4
- package/dist/src/{common/cluster-store → renderer/cluster-frame-context}/hosted-cluster-id.injectable.d.ts +0 -0
- package/dist/src/{common/cluster-store → renderer/cluster-frame-context}/hosted-cluster.injectable.d.ts +1 -1
- package/dist/src/renderer/components/+preferences/app-preference-tab/app-preference-tab-registration.d.ts +9 -0
- package/dist/src/renderer/components/dock/dock/create-dock-tab.injectable.d.ts +1 -1
- package/dist/src/renderer/components/dock/terminal/terminal.d.ts +6 -3
- package/dist/src/renderer/components/drawer/drawer-title.d.ts +5 -1
- package/dist/src/renderer/components/input/input.d.ts +7 -8
- package/dist/src/renderer/components/input/input_validators.d.ts +28 -15
- package/dist/src/renderer/components/layout/sidebar-items.injectable.d.ts +0 -2
- package/dist/src/renderer/components/notifications/index.d.ts +0 -1
- package/dist/src/renderer/components/notifications/notifications.d.ts +4 -4
- package/dist/src/renderer/components/select/select.d.ts +1 -1
- package/dist/src/renderer/components/wizard/wizard.d.ts +2 -0
- package/dist/src/renderer/routes/route-path-parameters.injectable.d.ts +1 -1
- package/dist/src/renderer/utils/channel/ipc-renderer.injectable.d.ts +0 -1
- package/package.json +2 -2
- package/dist/src/common/cluster-store/allowed-resources.injectable.d.ts +0 -2
- package/dist/src/common/vars/bundled-binaries-normalized-arch.injectable.d.ts +0 -2
@@ -9,7 +9,7 @@ import type { KubeconfigManager } from "../../main/kubeconfig-manager/kubeconfig
|
|
9
9
|
import type { KubeResource } from "../rbac";
|
10
10
|
import type { VersionDetector } from "../../main/cluster-detectors/version-detector";
|
11
11
|
import type { DetectorRegistry } from "../../main/cluster-detectors/detector-registry";
|
12
|
-
import type { ClusterState, ClusterRefreshOptions, ClusterMetricsResourceType, ClusterId, ClusterMetadata, ClusterModel, ClusterPreferences, ClusterPrometheusPreferences, UpdateClusterModel } from "../cluster-types";
|
12
|
+
import type { ClusterState, ClusterRefreshOptions, ClusterMetricsResourceType, ClusterId, ClusterMetadata, ClusterModel, ClusterPreferences, ClusterPrometheusPreferences, UpdateClusterModel, ClusterConfigData } from "../cluster-types";
|
13
13
|
import { ClusterStatus } from "../cluster-types";
|
14
14
|
import type { CanI } from "./authorization-review.injectable";
|
15
15
|
import type { ListNamespaces } from "./list-namespaces.injectable";
|
@@ -187,7 +187,7 @@ export declare class Cluster implements ClusterModel, ClusterState {
|
|
187
187
|
* @internal
|
188
188
|
*/
|
189
189
|
get defaultNamespace(): string | undefined;
|
190
|
-
constructor(dependencies: ClusterDependencies, model: ClusterModel);
|
190
|
+
constructor(dependencies: ClusterDependencies, model: ClusterModel, configData: ClusterConfigData);
|
191
191
|
/**
|
192
192
|
* Update cluster data model
|
193
193
|
*
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import type { ClusterModel } from "../cluster-types";
|
1
|
+
import type { ClusterConfigData, ClusterModel } from "../cluster-types";
|
2
2
|
import type { Cluster } from "./cluster";
|
3
|
-
export declare type CreateCluster = (model: ClusterModel) => Cluster;
|
3
|
+
export declare type CreateCluster = (model: ClusterModel, configData: ClusterConfigData) => Cluster;
|
4
4
|
export declare const createClusterInjectionToken: import("@ogre-tools/injectable").InjectionToken<CreateCluster, void>;
|
@@ -0,0 +1,6 @@
|
|
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 { IComputedValue } from "mobx";
|
6
|
+
export declare const allowedResourcesInjectionToken: import("@ogre-tools/injectable").InjectionToken<IComputedValue<Set<string>>, void>;
|
@@ -5,11 +5,14 @@
|
|
5
5
|
import { BaseStore } from "../base-store";
|
6
6
|
import { Cluster } from "../cluster/cluster";
|
7
7
|
import type { ClusterModel, ClusterId } from "../cluster-types";
|
8
|
+
import type { CreateCluster } from "../cluster/create-cluster-injection-token";
|
9
|
+
import type { ReadClusterConfigSync } from "./read-cluster-config.injectable";
|
8
10
|
export interface ClusterStoreModel {
|
9
11
|
clusters?: ClusterModel[];
|
10
12
|
}
|
11
13
|
interface Dependencies {
|
12
|
-
createCluster:
|
14
|
+
createCluster: CreateCluster;
|
15
|
+
readClusterConfigSync: ReadClusterConfigSync;
|
13
16
|
}
|
14
17
|
export declare class ClusterStore extends BaseStore<ClusterStoreModel> {
|
15
18
|
private dependencies;
|
@@ -0,0 +1,4 @@
|
|
1
|
+
import type { ClusterConfigData, ClusterModel } from "../cluster-types";
|
2
|
+
export declare type ReadClusterConfigSync = (model: ClusterModel) => ClusterConfigData;
|
3
|
+
declare const readClusterConfigSyncInjectable: import("@ogre-tools/injectable").Injectable<ReadClusterConfigSync, unknown, void>;
|
4
|
+
export default readClusterConfigSyncInjectable;
|
@@ -53,6 +53,14 @@ export interface ClusterModel {
|
|
53
53
|
*/
|
54
54
|
labels?: Record<string, string>;
|
55
55
|
}
|
56
|
+
/**
|
57
|
+
* This data is retreived from the kubeconfig file before calling the cluster constructor.
|
58
|
+
*
|
59
|
+
* That is done to remove the external dependency on the construction of Cluster instances.
|
60
|
+
*/
|
61
|
+
export interface ClusterConfigData {
|
62
|
+
clusterServerUrl: string;
|
63
|
+
}
|
56
64
|
/**
|
57
65
|
* The complete set of cluster settings or preferences
|
58
66
|
*/
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import type { IComputedValue } from "mobx";
|
2
2
|
import type { LensRendererExtension } from "../../extensions/lens-renderer-extension";
|
3
|
-
export declare const
|
3
|
+
export declare const frontEndRouteInjectionToken: import("@ogre-tools/injectable").InjectionToken<Route<unknown>, void>;
|
4
4
|
export interface Route<TParameter = void> {
|
5
5
|
path: string;
|
6
6
|
clusterFrame: boolean;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import type { Route } from "./route-injection-token";
|
1
|
+
import type { Route } from "./front-end-route-injection-token";
|
2
2
|
declare type InferParametersFrom<TRoute> = TRoute extends Route<infer TParameters> ? TParameters : never;
|
3
3
|
declare type RequiredKeys<T> = Exclude<{
|
4
4
|
[K in keyof T]: T extends Record<K, T[K]> ? K : never;
|
package/dist/src/common/front-end-routing/routes/cluster-view/cluster-view-route.injectable.d.ts
CHANGED
@@ -2,5 +2,5 @@ declare const clusterViewRouteInjectable: import("@ogre-tools/injectable").Injec
|
|
2
2
|
path: string;
|
3
3
|
clusterFrame: boolean;
|
4
4
|
isEnabled: import("mobx").IComputedValue<boolean>;
|
5
|
-
}, import("../../route-injection-token").Route<unknown>, void>;
|
5
|
+
}, import("../../front-end-route-injection-token").Route<unknown>, void>;
|
6
6
|
export default clusterViewRouteInjectable;
|
@@ -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
|
}
|
@@ -77,7 +77,7 @@ export interface IngressSpec {
|
|
77
77
|
}
|
78
78
|
export interface IngressStatus {
|
79
79
|
loadBalancer: {
|
80
|
-
ingress
|
80
|
+
ingress?: ILoadBalancerIngress[];
|
81
81
|
};
|
82
82
|
}
|
83
83
|
export declare class Ingress extends KubeObject<IngressStatus, IngressSpec, KubeObjectScope.Namespace> {
|
@@ -45,7 +45,7 @@ export interface IResourceMetrics<T extends MetricData> {
|
|
45
45
|
networkTransmit: T;
|
46
46
|
}
|
47
47
|
export declare const metricsApi: {
|
48
|
-
getMetrics<T = IMetricsQuery>(query: T, reqParams?: IMetricsReqParams): Promise<T extends object ? { [K in keyof
|
48
|
+
getMetrics<T = IMetricsQuery>(query: T, reqParams?: IMetricsReqParams): Promise<T extends object ? T extends infer T_1 ? { [K in keyof T_1]: MetricData; } : never : MetricData>;
|
49
49
|
getMetricProviders(): Promise<MetricProviderInfo[]>;
|
50
50
|
};
|
51
51
|
export declare function normalizeMetrics(metrics: MetricData | undefined | null, frames?: number): MetricData;
|
@@ -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="node" />
|
5
6
|
import type { KubeObjectConstructor, KubeJsonApiDataFor, KubeObjectMetadata, KubeObjectScope } from "./kube-object";
|
6
7
|
import { KubeObject } from "./kube-object";
|
7
8
|
import type { IKubeWatchEvent } from "./kube-watch-event";
|
@@ -10,6 +11,7 @@ import { KubeJsonApi } from "./kube-json-api";
|
|
10
11
|
import type { Disposer } from "../utils";
|
11
12
|
import type { RequestInit } from "node-fetch";
|
12
13
|
import type AbortController from "abort-controller";
|
14
|
+
import { Agent } from "https";
|
13
15
|
import type { Patch } from "rfc6902";
|
14
16
|
import type { PartialDeep } from "type-fest";
|
15
17
|
/**
|
@@ -137,6 +139,13 @@ export interface IRemoteKubeApiConfig {
|
|
137
139
|
clientCertificateData?: string;
|
138
140
|
clientKeyData?: string;
|
139
141
|
};
|
142
|
+
/**
|
143
|
+
* Custom instance of https.agent to use for the requests
|
144
|
+
*
|
145
|
+
* @remarks the custom agent replaced default agent, options skipTLSVerify,
|
146
|
+
* clientCertificateData, clientKeyData and caData are ignored.
|
147
|
+
*/
|
148
|
+
agent?: Agent;
|
140
149
|
}
|
141
150
|
export declare function forCluster<Object extends KubeObject<any, any, KubeObjectScope>, Api extends KubeApi<Object>, Data extends KubeJsonApiDataFor<Object>>(cluster: ILocalKubeApiConfig, kubeClass: KubeObjectConstructor<Object, Data>, apiClass: new (apiOpts: KubeApiOptions<Object>) => Api): Api;
|
142
151
|
export declare function forCluster<Object extends KubeObject<any, any, KubeObjectScope>, Data extends KubeJsonApiDataFor<Object>>(cluster: ILocalKubeApiConfig, kubeClass: KubeObjectConstructor<Object, Data>, apiClass?: new (apiOpts: KubeApiOptions<Object>) => KubeApi<Object>): KubeApi<Object>;
|
@@ -59,7 +59,7 @@ export interface KubeObjectStoreOptions {
|
|
59
59
|
}
|
60
60
|
export declare type KubeApiDataFrom<K extends KubeObject, A> = A extends KubeApi<K, infer D> ? D extends KubeJsonApiDataFor<K> ? D : never : never;
|
61
61
|
export declare abstract class KubeObjectStore<K extends KubeObject = KubeObject, A extends KubeApi<K, D> = KubeApi<K, KubeJsonApiDataFor<K>>, D extends KubeJsonApiDataFor<K> = KubeApiDataFrom<K, A>> extends ItemStore<K> {
|
62
|
-
static readonly defaultContext: import("mobx").IObservableValue<ClusterContext>;
|
62
|
+
static readonly defaultContext: import("mobx").IObservableValue<ClusterContext | undefined>;
|
63
63
|
readonly api: A;
|
64
64
|
readonly limit: number | undefined;
|
65
65
|
readonly bufferSize: number;
|
@@ -71,7 +71,7 @@ export declare abstract class KubeObjectStore<K extends KubeObject = KubeObject,
|
|
71
71
|
cancel(): void;
|
72
72
|
};
|
73
73
|
constructor(api: A, opts?: KubeObjectStoreOptions);
|
74
|
-
get context(): ClusterContext;
|
74
|
+
get context(): ClusterContext | undefined;
|
75
75
|
get contextItems(): K[];
|
76
76
|
getTotalCount(): number;
|
77
77
|
get query(): KubeApiQueryParams;
|
@@ -23,7 +23,7 @@ export interface ConfigResult {
|
|
23
23
|
export declare function loadConfigFromString(content: string): ConfigResult;
|
24
24
|
export interface SplitConfigEntry {
|
25
25
|
config: KubeConfig;
|
26
|
-
|
26
|
+
validationResult: ValidateKubeConfigResult;
|
27
27
|
}
|
28
28
|
/**
|
29
29
|
* Breaks kube config into several configs. Each context as it own KubeConfig object
|
@@ -35,10 +35,18 @@ export declare function splitConfig(kubeConfig: KubeConfig): SplitConfigEntry[];
|
|
35
35
|
* @returns The yaml representation of the kubeconfig object
|
36
36
|
*/
|
37
37
|
export declare function dumpConfigYaml(kubeConfig: PartialDeep<KubeConfig>): string;
|
38
|
+
export declare type ValidateKubeConfigResult = {
|
39
|
+
error: Error;
|
40
|
+
} | {
|
41
|
+
error?: undefined;
|
42
|
+
context: Context;
|
43
|
+
cluster: Cluster;
|
44
|
+
user: User;
|
45
|
+
};
|
38
46
|
/**
|
39
47
|
* Checks if `config` has valid `Context`, `User`, `Cluster`, and `exec` fields (if present when required)
|
40
48
|
*
|
41
49
|
* Note: This function returns an error instead of throwing it, returning `undefined` if the validation passes
|
42
50
|
*/
|
43
|
-
export declare function validateKubeConfig(config: KubeConfig, contextName: string):
|
51
|
+
export declare function validateKubeConfig(config: KubeConfig, contextName: string): ValidateKubeConfigResult;
|
44
52
|
export {};
|
@@ -0,0 +1,28 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright (c) OpenLens Authors. All rights reserved.
|
3
|
+
* Licensed under MIT License. See LICENSE in root directory for more information.
|
4
|
+
*/
|
5
|
+
export declare enum TerminalChannels {
|
6
|
+
STDIN = "stdin",
|
7
|
+
STDOUT = "stdout",
|
8
|
+
CONNECTED = "connected",
|
9
|
+
RESIZE = "resize",
|
10
|
+
PING = "ping"
|
11
|
+
}
|
12
|
+
export declare type TerminalMessage = {
|
13
|
+
type: TerminalChannels.STDIN;
|
14
|
+
data: string;
|
15
|
+
} | {
|
16
|
+
type: TerminalChannels.STDOUT;
|
17
|
+
data: string;
|
18
|
+
} | {
|
19
|
+
type: TerminalChannels.CONNECTED;
|
20
|
+
} | {
|
21
|
+
type: TerminalChannels.RESIZE;
|
22
|
+
data: {
|
23
|
+
width: number;
|
24
|
+
height: number;
|
25
|
+
};
|
26
|
+
} | {
|
27
|
+
type: TerminalChannels.PING;
|
28
|
+
};
|
@@ -12,4 +12,4 @@ export interface URLParams<P extends object = {}, Q extends object = {}> {
|
|
12
12
|
fragment?: string;
|
13
13
|
}
|
14
14
|
export declare function buildURL<P extends object = {}, Q extends object = {}>(path: string, { params, query, fragment }?: URLParams<P, Q>): string;
|
15
|
-
export declare function buildURLPositional<P extends object = {}, Q extends object = {}>(path: string): (params?: P
|
15
|
+
export declare function buildURLPositional<P extends object = {}, Q extends object = {}>(path: string): (params?: P, query?: Q, fragment?: string) => string;
|
@@ -2,11 +2,11 @@
|
|
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
|
-
import "abort-controller
|
5
|
+
import type { AbortSignal } from "abort-controller";
|
6
6
|
/**
|
7
7
|
* Creates a new promise that will be rejected when the signal rejects.
|
8
8
|
*
|
9
9
|
* Useful for `Promise.race()` applications.
|
10
10
|
* @param signal The AbortController's signal to reject with
|
11
11
|
*/
|
12
|
-
export declare function rejectPromiseBy(signal: AbortSignal): Promise<
|
12
|
+
export declare function rejectPromiseBy(signal: AbortSignal): Promise<never>;
|
@@ -0,0 +1,6 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright (c) OpenLens Authors. All rights reserved.
|
3
|
+
* Licensed under MIT License. See LICENSE in root directory for more information.
|
4
|
+
*/
|
5
|
+
export declare type ResolveSystemProxy = (url: string) => Promise<string>;
|
6
|
+
export declare const resolveSystemProxyInjectionToken: import("@ogre-tools/injectable").InjectionToken<ResolveSystemProxy, void>;
|
@@ -3,6 +3,9 @@
|
|
3
3
|
* Licensed under MIT License. See LICENSE in root directory for more information.
|
4
4
|
*/
|
5
5
|
/// <reference types="node" />
|
6
|
+
/// <reference types="node" />
|
7
|
+
/// <reference types="node" />
|
8
|
+
/// <reference types="node" />
|
6
9
|
import type { ExecException, ExecFileException } from "child_process";
|
7
10
|
import type { IncomingMessage } from "http";
|
8
11
|
/**
|
@@ -96,6 +99,8 @@ export declare function bindPredicate<FnArgs extends any[], T>(fn: (arg1: unknow
|
|
96
99
|
export declare function hasDefiniteField<Field extends keyof T, T>(field: Field): (val: T) => val is T & {
|
97
100
|
[f in Field]-?: NonNullable<T[Field]>;
|
98
101
|
};
|
102
|
+
export declare function isPromiseSettledRejected<T>(result: PromiseSettledResult<T>): result is PromiseRejectedResult;
|
103
|
+
export declare function isPromiseSettledFulfilled<T>(result: PromiseSettledResult<T>): result is PromiseFulfilledResult<T>;
|
99
104
|
export declare function isErrnoException(error: unknown): error is NodeJS.ErrnoException;
|
100
105
|
export declare function isExecException(error: unknown): error is ExecException;
|
101
106
|
export declare function isExecFileException(error: unknown): error is ExecFileException;
|
@@ -1,2 +1,2 @@
|
|
1
|
-
declare const
|
2
|
-
export default
|
1
|
+
declare const baseBundledBinariesDirectoryInjectable: import("@ogre-tools/injectable").Injectable<string, unknown, void>;
|
2
|
+
export default baseBundledBinariesDirectoryInjectable;
|
@@ -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;
|
@@ -58,8 +59,10 @@ declare const packageJsonInjectable: import("@ogre-tools/injectable").Injectable
|
|
58
59
|
collectCoverage: boolean;
|
59
60
|
verbose: boolean;
|
60
61
|
transform: {
|
61
|
-
"^.+\\.
|
62
|
+
"^.+\\.(t|j)sx?$": string[];
|
62
63
|
};
|
64
|
+
testEnvironment: string;
|
65
|
+
resolver: string;
|
63
66
|
moduleNameMapper: {
|
64
67
|
"\\.(css|scss)$": string;
|
65
68
|
"\\.(svg|png|jpg|eot|woff2?|ttf)$": string;
|
@@ -67,11 +70,7 @@ declare const packageJsonInjectable: import("@ogre-tools/injectable").Injectable
|
|
67
70
|
modulePathIgnorePatterns: string[];
|
68
71
|
setupFiles: string[];
|
69
72
|
setupFilesAfterEnv: string[];
|
70
|
-
|
71
|
-
"ts-jest": {
|
72
|
-
isolatedModules: boolean;
|
73
|
-
};
|
74
|
-
};
|
73
|
+
runtime: string;
|
75
74
|
};
|
76
75
|
build: {
|
77
76
|
generateUpdatesFilesForAllChannels: boolean;
|
@@ -134,12 +133,14 @@ declare const packageJsonInjectable: import("@ogre-tools/injectable").Injectable
|
|
134
133
|
"@hapi/subtext": string;
|
135
134
|
"@kubernetes/client-node": string;
|
136
135
|
"@material-ui/styles": string;
|
137
|
-
"@ogre-tools/injectable": string;
|
138
|
-
"@ogre-tools/injectable-react": string;
|
139
136
|
"@ogre-tools/fp": string;
|
137
|
+
"@ogre-tools/injectable": string;
|
140
138
|
"@ogre-tools/injectable-extension-for-auto-registration": string;
|
139
|
+
"@ogre-tools/injectable-extension-for-mobx": string;
|
140
|
+
"@ogre-tools/injectable-react": string;
|
141
141
|
"@sentry/electron": string;
|
142
142
|
"@sentry/integrations": string;
|
143
|
+
"@side/jest-runtime": string;
|
143
144
|
"@types/circular-dependency-plugin": string;
|
144
145
|
"abort-controller": string;
|
145
146
|
"auto-bind": string;
|
@@ -214,6 +215,8 @@ declare const packageJsonInjectable: import("@ogre-tools/injectable").Injectable
|
|
214
215
|
"@material-ui/lab": string;
|
215
216
|
"@pmmmwh/react-refresh-webpack-plugin": string;
|
216
217
|
"@sentry/types": string;
|
218
|
+
"@swc/core": string;
|
219
|
+
"@swc/jest": string;
|
217
220
|
"@testing-library/dom": string;
|
218
221
|
"@testing-library/jest-dom": string;
|
219
222
|
"@testing-library/react": string;
|
@@ -230,6 +233,8 @@ declare const packageJsonInjectable: import("@ogre-tools/injectable").Injectable
|
|
230
233
|
"@types/fs-extra": string;
|
231
234
|
"@types/glob-to-regexp": string;
|
232
235
|
"@types/gunzip-maybe": string;
|
236
|
+
"@types/hapi__call": string;
|
237
|
+
"@types/hapi__subtext": string;
|
233
238
|
"@types/html-webpack-plugin": string;
|
234
239
|
"@types/http-proxy": string;
|
235
240
|
"@types/jest": string;
|
@@ -302,6 +307,7 @@ declare const packageJsonInjectable: import("@ogre-tools/injectable").Injectable
|
|
302
307
|
"include-media": string;
|
303
308
|
jest: string;
|
304
309
|
"jest-canvas-mock": string;
|
310
|
+
"jest-environment-jsdom": string;
|
305
311
|
"jest-fetch-mock": string;
|
306
312
|
"jest-mock-extended": string;
|
307
313
|
"make-plural": string;
|
@@ -328,14 +334,12 @@ declare const packageJsonInjectable: import("@ogre-tools/injectable").Injectable
|
|
328
334
|
"style-loader": string;
|
329
335
|
tailwindcss: string;
|
330
336
|
"tar-stream": string;
|
331
|
-
"ts-jest": string;
|
332
337
|
"ts-loader": string;
|
333
338
|
"ts-node": string;
|
334
339
|
"type-fest": string;
|
335
340
|
"typed-emitter": string;
|
336
341
|
typedoc: string;
|
337
342
|
"typedoc-plugin-markdown": string;
|
338
|
-
"typeface-roboto": string;
|
339
343
|
typescript: string;
|
340
344
|
"typescript-plugin-css-modules": string;
|
341
345
|
webpack: string;
|
@@ -8,5 +8,6 @@ import * as Store from "./stores";
|
|
8
8
|
import * as Util from "./utils";
|
9
9
|
import * as Catalog from "./catalog";
|
10
10
|
import * as Types from "./types";
|
11
|
+
import * as Proxy from "./proxy";
|
11
12
|
import logger from "../../common/logger";
|
12
|
-
export { App, EventBus, Catalog, Store, Types, Util, logger, };
|
13
|
+
export { App, EventBus, Catalog, Store, Types, Util, logger, Proxy, };
|
@@ -0,0 +1,10 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright (c) OpenLens Authors. All rights reserved.
|
3
|
+
* Licensed under MIT License. See LICENSE in root directory for more information.
|
4
|
+
*/
|
5
|
+
/**
|
6
|
+
* Resolves URL-specific proxy information from system. See more here: https://www.electronjs.org/docs/latest/api/session#sesresolveproxyurl
|
7
|
+
* @param url - The URL for proxy information
|
8
|
+
* @returns Promise for proxy information as string
|
9
|
+
*/
|
10
|
+
export declare const resolveSystemProxy: import("../../common/utils/resolve-system-proxy/resolve-system-proxy-injection-token").ResolveSystemProxy;
|
@@ -0,0 +1,7 @@
|
|
1
|
+
import type { LensExtension } from "../../lens-extension";
|
2
|
+
export interface Extension {
|
3
|
+
register: () => void;
|
4
|
+
deregister: () => void;
|
5
|
+
}
|
6
|
+
declare const extensionInjectable: import("@ogre-tools/injectable").Injectable<Extension, unknown, LensExtension<import("../../lens-extension-set-dependencies").LensExtensionDependencies>>;
|
7
|
+
export default extensionInjectable;
|
@@ -9,12 +9,12 @@ import type { InstalledExtension } from "../extension-discovery/extension-discov
|
|
9
9
|
import type { LensExtension, LensExtensionConstructor, LensExtensionId } from "../lens-extension";
|
10
10
|
import type { LensExtensionState } from "../extensions-store/extensions-store";
|
11
11
|
import type { CreateExtensionInstance } from "./create-extension-instance.token";
|
12
|
+
import type { Extension } from "./extension/extension.injectable";
|
12
13
|
interface Dependencies {
|
13
14
|
updateExtensionsState: (extensionsState: Record<LensExtensionId, LensExtensionState>) => void;
|
14
15
|
createExtensionInstance: CreateExtensionInstance;
|
15
|
-
readonly extensionRegistrators: ((extension: LensExtension, extensionInstallationCount: number) => void)[];
|
16
|
-
readonly extensionInstallationCounter: Map<string, number>;
|
17
16
|
readonly extensionInstances: ObservableMap<LensExtensionId, LensExtension>;
|
17
|
+
getExtension: (instance: LensExtension) => Extension;
|
18
18
|
}
|
19
19
|
export interface ExtensionLoading {
|
20
20
|
isBundled: boolean;
|
@@ -0,0 +1,7 @@
|
|
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 { Injectable } from "@ogre-tools/injectable";
|
6
|
+
import type { LensExtension } from "../lens-extension";
|
7
|
+
export declare const extensionRegistratorInjectionToken: import("@ogre-tools/injectable").InjectionToken<(extension: LensExtension) => Injectable<any, any, any>[], void>;
|
@@ -11,15 +11,16 @@ export interface LensExtensionState {
|
|
11
11
|
enabled?: boolean;
|
12
12
|
name: string;
|
13
13
|
}
|
14
|
+
export interface IsEnabledExtensionDescriptor {
|
15
|
+
id: string;
|
16
|
+
isBundled: boolean;
|
17
|
+
}
|
14
18
|
export declare class ExtensionsStore extends BaseStore<LensExtensionsStoreModel> {
|
15
19
|
readonly displayName = "ExtensionsStore";
|
16
20
|
constructor();
|
17
21
|
get enabledExtensions(): string[];
|
18
22
|
protected state: import("mobx").ObservableMap<string, LensExtensionState>;
|
19
|
-
isEnabled({ id, isBundled }:
|
20
|
-
id: string;
|
21
|
-
isBundled: boolean;
|
22
|
-
}): boolean;
|
23
|
+
isEnabled({ id, isBundled }: IsEnabledExtensionDescriptor): boolean;
|
23
24
|
mergeState: (extensionsState: Record<LensExtensionId, LensExtensionState> | [LensExtensionId, LensExtensionState][]) => void;
|
24
25
|
protected fromStore({ extensions }: LensExtensionsStoreModel): void;
|
25
26
|
toJSON(): LensExtensionsStoreModel;
|
@@ -5,7 +5,7 @@
|
|
5
5
|
import type { IComputedValue } from "mobx";
|
6
6
|
import type { CatalogCategoryRegistry } from "../common/catalog";
|
7
7
|
import type { NavigateToRoute } from "../common/front-end-routing/navigate-to-route-injection-token";
|
8
|
-
import type { Route } from "../common/front-end-routing/route-injection-token";
|
8
|
+
import type { Route } from "../common/front-end-routing/front-end-route-injection-token";
|
9
9
|
import type { CatalogEntityRegistry as MainCatalogEntityRegistry } from "../main/catalog";
|
10
10
|
import type { CatalogEntityRegistry as RendererCatalogEntityRegistry } from "../renderer/api/catalog/entity/registry";
|
11
11
|
import type { GetExtensionPageParameters } from "../renderer/routes/get-extension-page-parameters.injectable";
|
@@ -22,12 +22,14 @@ import type { WorkloadsOverviewDetailRegistration } from "../renderer/components
|
|
22
22
|
import type { KubeObjectStatusRegistration } from "../renderer/components/kube-object-status-icon/kube-object-status-registration";
|
23
23
|
import type { LensRendererExtensionDependencies } from "./lens-extension-set-dependencies";
|
24
24
|
import type { KubeObjectHandlerRegistration } from "../renderer/kube-object/handler";
|
25
|
+
import type { AppPreferenceTabRegistration } from "../renderer/components/+preferences/app-preference-tab/app-preference-tab-registration";
|
25
26
|
export declare class LensRendererExtension extends LensExtension<LensRendererExtensionDependencies> {
|
26
27
|
globalPages: registries.PageRegistration[];
|
27
28
|
clusterPages: registries.PageRegistration[];
|
28
29
|
clusterPageMenus: registries.ClusterPageMenuRegistration[];
|
29
30
|
kubeObjectStatusTexts: KubeObjectStatusRegistration[];
|
30
31
|
appPreferences: AppPreferenceRegistration[];
|
32
|
+
appPreferenceTabs: AppPreferenceTabRegistration[];
|
31
33
|
entitySettings: registries.EntitySettingRegistration[];
|
32
34
|
statusBarItems: StatusBarRegistration[];
|
33
35
|
kubeObjectDetailItems: registries.KubeObjectDetailRegistration[];
|
@@ -26,5 +26,5 @@ export interface RegisteredEntitySetting extends EntitySettingRegistration {
|
|
26
26
|
}
|
27
27
|
export declare class EntitySettingRegistry extends BaseRegistry<EntitySettingRegistration, RegisteredEntitySetting> {
|
28
28
|
getRegisteredItem(item: EntitySettingRegistration): RegisteredEntitySetting;
|
29
|
-
getItemsForKind: (kind: string, apiVersion: string, source?: string
|
29
|
+
getItemsForKind: (kind: string, apiVersion: string, source?: string) => RegisteredEntitySetting[];
|
30
30
|
}
|
@@ -3,6 +3,7 @@
|
|
3
3
|
* Licensed under MIT License. See LICENSE in root directory for more information.
|
4
4
|
*/
|
5
5
|
/// <reference types="node" />
|
6
|
+
/// <reference types="node" />
|
6
7
|
import type { ChildProcess } from "child_process";
|
7
8
|
import type { Cluster } from "../../common/cluster/cluster";
|
8
9
|
import type { SelfSignedCert } from "selfsigned";
|
@@ -1,7 +1,2 @@
|
|
1
|
-
declare const applicationWindowInjectable: import("@ogre-tools/injectable").Injectable<
|
2
|
-
readonly visible: boolean;
|
3
|
-
show: () => Promise<void>;
|
4
|
-
close: () => void;
|
5
|
-
send: (args: import("./lens-window-injection-token").SendToViewArgs) => void;
|
6
|
-
}, import("./lens-window-injection-token").LensWindow, void>;
|
1
|
+
declare const applicationWindowInjectable: import("@ogre-tools/injectable").Injectable<import("./lens-window-injection-token").LensWindow, import("./lens-window-injection-token").LensWindow, void>;
|
7
2
|
export default applicationWindowInjectable;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import type {
|
1
|
+
import type { ElectronWindow } from "./create-lens-window.injectable";
|
2
2
|
import type { RequireExactlyOne } from "type-fest";
|
3
3
|
export declare type ElectronWindowTitleBarStyle = "hiddenInset" | "hidden" | "default" | "customButtonsOnHover";
|
4
4
|
export interface FileSource {
|
@@ -24,7 +24,6 @@ export interface ElectronWindowConfiguration {
|
|
24
24
|
onBlur?: () => void;
|
25
25
|
onDomReady?: () => void;
|
26
26
|
}
|
27
|
-
export declare type CreateElectronWindow = () =>
|
28
|
-
|
29
|
-
|
30
|
-
export default createElectronWindowFor;
|
27
|
+
export declare type CreateElectronWindow = (config: ElectronWindowConfiguration) => ElectronWindow;
|
28
|
+
declare const createElectronWindowInjectable: import("@ogre-tools/injectable").Injectable<CreateElectronWindow, unknown, void>;
|
29
|
+
export default createElectronWindowInjectable;
|
@@ -1,9 +1,11 @@
|
|
1
|
-
import type { SendToViewArgs } from "./lens-window-injection-token";
|
2
|
-
import type { ContentSource, ElectronWindowTitleBarStyle } from "./create-electron-window
|
3
|
-
export interface
|
1
|
+
import type { LensWindow, SendToViewArgs } from "./lens-window-injection-token";
|
2
|
+
import type { ContentSource, ElectronWindowTitleBarStyle } from "./create-electron-window.injectable";
|
3
|
+
export interface ElectronWindow {
|
4
4
|
show: () => void;
|
5
5
|
close: () => void;
|
6
6
|
send: (args: SendToViewArgs) => void;
|
7
|
+
loadFile: (filePath: string) => Promise<void>;
|
8
|
+
loadUrl: (url: string) => Promise<void>;
|
7
9
|
}
|
8
10
|
export interface LensWindowConfiguration {
|
9
11
|
id: string;
|
@@ -20,10 +22,5 @@ export interface LensWindowConfiguration {
|
|
20
22
|
onBlur?: () => void;
|
21
23
|
onDomReady?: () => void;
|
22
24
|
}
|
23
|
-
declare const createLensWindowInjectable: import("@ogre-tools/injectable").Injectable<(configuration: LensWindowConfiguration) =>
|
24
|
-
readonly visible: boolean;
|
25
|
-
show: () => Promise<void>;
|
26
|
-
close: () => void;
|
27
|
-
send: (args: SendToViewArgs) => void;
|
28
|
-
}, unknown, void>;
|
25
|
+
declare const createLensWindowInjectable: import("@ogre-tools/injectable").Injectable<(configuration: LensWindowConfiguration) => LensWindow, unknown, void>;
|
29
26
|
export default createLensWindowInjectable;
|
@@ -5,9 +5,12 @@ export interface SendToViewArgs {
|
|
5
5
|
data?: unknown[];
|
6
6
|
}
|
7
7
|
export interface LensWindow {
|
8
|
-
|
8
|
+
id: string;
|
9
|
+
start: () => Promise<void>;
|
9
10
|
close: () => void;
|
11
|
+
show: () => void;
|
10
12
|
send: (args: SendToViewArgs) => void;
|
11
|
-
|
13
|
+
isVisible: boolean;
|
14
|
+
isStarting: boolean;
|
12
15
|
}
|
13
16
|
export declare const lensWindowInjectionToken: import("@ogre-tools/injectable").InjectionToken<LensWindow, void>;
|
@@ -1,2 +1,2 @@
|
|
1
|
-
declare const navigateInjectable: import("@ogre-tools/injectable").Injectable<(url: string, frameId?: number
|
1
|
+
declare const navigateInjectable: import("@ogre-tools/injectable").Injectable<(url: string, frameId?: number) => Promise<void>, unknown, void>;
|
2
2
|
export default navigateInjectable;
|
package/dist/src/main/start-main-application/lens-window/splash-window/splash-window.injectable.d.ts
CHANGED
@@ -1,7 +1,2 @@
|
|
1
|
-
declare const splashWindowInjectable: import("@ogre-tools/injectable").Injectable<
|
2
|
-
readonly visible: boolean;
|
3
|
-
show: () => Promise<void>;
|
4
|
-
close: () => void;
|
5
|
-
send: (args: import("../application-window/lens-window-injection-token").SendToViewArgs) => void;
|
6
|
-
}, import("../application-window/lens-window-injection-token").LensWindow, void>;
|
1
|
+
declare const splashWindowInjectable: import("@ogre-tools/injectable").Injectable<import("../application-window/lens-window-injection-token").LensWindow, import("../application-window/lens-window-injection-token").LensWindow, void>;
|
7
2
|
export default splashWindowInjectable;
|
@@ -4,27 +4,7 @@
|
|
4
4
|
*/
|
5
5
|
import type { WebSocketEvents } from "./websocket-api";
|
6
6
|
import { WebSocketApi } from "./websocket-api";
|
7
|
-
|
8
|
-
STDIN = "stdin",
|
9
|
-
STDOUT = "stdout",
|
10
|
-
CONNECTED = "connected",
|
11
|
-
RESIZE = "resize"
|
12
|
-
}
|
13
|
-
export declare type TerminalMessage = {
|
14
|
-
type: TerminalChannels.STDIN;
|
15
|
-
data: string;
|
16
|
-
} | {
|
17
|
-
type: TerminalChannels.STDOUT;
|
18
|
-
data: string;
|
19
|
-
} | {
|
20
|
-
type: TerminalChannels.CONNECTED;
|
21
|
-
} | {
|
22
|
-
type: TerminalChannels.RESIZE;
|
23
|
-
data: {
|
24
|
-
width: number;
|
25
|
-
height: number;
|
26
|
-
};
|
27
|
-
};
|
7
|
+
import { type TerminalMessage } from "../../common/terminal/channels";
|
28
8
|
declare enum TerminalColor {
|
29
9
|
RED = "\u001B[31m",
|
30
10
|
GREEN = "\u001B[32m",
|
@@ -60,7 +40,7 @@ export declare class TerminalApi extends WebSocketApi<TerminalEvents> {
|
|
60
40
|
connect(): Promise<void>;
|
61
41
|
sendMessage(message: TerminalMessage): void;
|
62
42
|
sendTerminalSize(cols: number, rows: number): void;
|
63
|
-
protected _onMessage({ data, ...evt }: MessageEvent<
|
43
|
+
protected _onMessage({ data, ...evt }: MessageEvent<string>): void;
|
64
44
|
protected _onOpen(evt: Event): void;
|
65
45
|
protected _onClose(evt: CloseEvent): void;
|
66
46
|
protected emitStatus(data: string, options?: {
|
@@ -22,9 +22,9 @@ interface WebsocketApiParams {
|
|
22
22
|
/**
|
23
23
|
* The message for pinging the websocket
|
24
24
|
*
|
25
|
-
* @default "
|
25
|
+
* @default "{type: \"ping\"}"
|
26
26
|
*/
|
27
|
-
pingMessage?: string
|
27
|
+
pingMessage?: string;
|
28
28
|
/**
|
29
29
|
* If set to a number > 0, then the API will ping the socket on that interval.
|
30
30
|
*
|
@@ -53,7 +53,7 @@ export interface WebSocketEvents {
|
|
53
53
|
declare const WebSocketApi_base: new <T>() => TypedEventEmitter<T>;
|
54
54
|
export declare class WebSocketApi<Events extends WebSocketEvents> extends WebSocketApi_base<Events> {
|
55
55
|
protected socket: WebSocket | null;
|
56
|
-
protected pendingCommands:
|
56
|
+
protected pendingCommands: string[];
|
57
57
|
protected reconnectTimer?: number;
|
58
58
|
protected pingTimer?: number;
|
59
59
|
protected params: Defaulted<WebsocketApiParams, keyof typeof WebSocketApi["defaultParams"]>;
|
@@ -70,7 +70,7 @@ export declare class WebSocketApi<Events extends WebSocketEvents> extends WebSoc
|
|
70
70
|
reconnect(): void;
|
71
71
|
destroy(): void;
|
72
72
|
clearAllListeners(): void;
|
73
|
-
send(command: string
|
73
|
+
send(command: string): void;
|
74
74
|
protected flush(): void;
|
75
75
|
protected _onOpen(evt: Event): void;
|
76
76
|
protected _onMessage({ data }: MessageEvent): void;
|
File without changes
|
@@ -1,2 +1,2 @@
|
|
1
|
-
declare const hostedClusterInjectable: import("@ogre-tools/injectable").Injectable<import("
|
1
|
+
declare const hostedClusterInjectable: import("@ogre-tools/injectable").Injectable<import("../../common/cluster/cluster").Cluster | undefined, unknown, void>;
|
2
2
|
export default hostedClusterInjectable;
|
@@ -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
|
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
|
-
|
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: (
|
48
|
-
setFontFamily: (
|
50
|
+
setFontSize: (fontSize: number) => void;
|
51
|
+
setFontFamily: (fontFamily: string) => void;
|
49
52
|
keyHandler: (evt: KeyboardEvent) => boolean;
|
50
53
|
}
|
@@ -5,7 +5,11 @@
|
|
5
5
|
import React from "react";
|
6
6
|
export interface DrawerTitleProps {
|
7
7
|
className?: string;
|
8
|
-
children
|
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
|
-
|
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
|
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
|
7
|
-
|
8
|
-
|
9
|
-
export declare type
|
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
|
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
|
-
*
|
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:
|
25
|
-
message?:
|
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
|
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>;
|
@@ -1,6 +1,5 @@
|
|
1
1
|
/// <reference types="react" />
|
2
2
|
import type { IComputedValue } from "mobx";
|
3
|
-
import type { LensRendererExtension } from "../../../extensions/lens-renderer-extension";
|
4
3
|
export interface SidebarItemRegistration {
|
5
4
|
id: string;
|
6
5
|
parentId: string | null;
|
@@ -10,7 +9,6 @@ export interface SidebarItemRegistration {
|
|
10
9
|
isActive?: IComputedValue<boolean>;
|
11
10
|
isVisible?: IComputedValue<boolean>;
|
12
11
|
orderNumber: number;
|
13
|
-
extension?: LensRendererExtension;
|
14
12
|
}
|
15
13
|
export declare const sidebarItemsInjectionToken: import("@ogre-tools/injectable").InjectionToken<IComputedValue<SidebarItemRegistration[]>, void>;
|
16
14
|
export interface HierarchicalSidebarItem {
|
@@ -7,8 +7,8 @@ import React from "react";
|
|
7
7
|
import type { Notification, NotificationMessage } from "./notifications.store";
|
8
8
|
export declare const Notifications: React.FC<{}> & {
|
9
9
|
ok: (message: NotificationMessage) => () => void;
|
10
|
-
checkedError: (message: unknown, fallback: string, customOpts?: Partial<Omit<Notification, "message">>
|
11
|
-
error: (message: NotificationMessage, customOpts?: Partial<Omit<Notification, "message">>
|
12
|
-
shortInfo: (message: NotificationMessage, customOpts?: Partial<Omit<Notification, "message">>
|
13
|
-
info: (message: NotificationMessage, customOpts?: Partial<Omit<Notification, "message">>
|
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
14
|
};
|
@@ -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:
|
11
|
+
label: React.ReactNode;
|
12
12
|
isDisabled?: boolean;
|
13
13
|
isSelected?: boolean;
|
14
14
|
}
|
@@ -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,3 @@
|
|
1
|
-
import type { Route } from "../../common/front-end-routing/route-injection-token";
|
1
|
+
import type { Route } from "../../common/front-end-routing/front-end-route-injection-token";
|
2
2
|
declare const routePathParametersInjectable: import("@ogre-tools/injectable").Injectable<import("mobx").IComputedValue<Record<string, string>>, unknown, Route<unknown>>;
|
3
3
|
export default routePathParametersInjectable;
|
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.
|
6
|
-
"copyright": "©
|
5
|
+
"version": "5.6.0-git.fc770b4b44.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",
|