@k8slens/extensions 5.4.0-git.8480b2a1e5.0 → 5.4.0-git.8524f9d244.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.
- package/dist/src/common/catalog/catalog-category-registry.d.ts +2 -2
- package/dist/src/common/catalog-entities/kubernetes-cluster.d.ts +1 -1
- package/dist/src/common/k8s-api/kube-object.store.d.ts +2 -2
- package/dist/src/common/user-store/user-store.d.ts +1 -1
- package/dist/src/common/utils/collection-functions.d.ts +18 -4
- package/dist/src/common/utils/index.d.ts +1 -2
- package/dist/src/common/utils/objects.d.ts +2 -3
- package/dist/src/common/utils/openBrowser.d.ts +17 -0
- package/dist/src/extensions/common-api/registrations.d.ts +1 -0
- package/dist/src/extensions/common-api/utils.d.ts +1 -1
- package/dist/src/extensions/extension-api.js +55 -43
- package/dist/src/extensions/lens-extension.d.ts +1 -1
- package/dist/src/extensions/lens-main-extension.d.ts +15 -0
- package/dist/src/extensions/main-api/index.d.ts +2 -1
- package/dist/src/extensions/main-api/power.d.ts +24 -0
- package/dist/src/main/catalog-pusher.d.ts +2 -1
- package/dist/src/main/cluster-manager.d.ts +20 -2
- package/dist/src/main/helm/helm-repo-manager.d.ts +8 -9
- package/dist/src/main/shell-session/local-shell-session/local-shell-session.d.ts +6 -0
- package/dist/src/main/shell-session/shell-env-modifier/shell-env-modifier-registration.d.ts +9 -0
- package/dist/src/main/shell-session/shell-env-modifier/terminal-shell-env-modifiers.d.ts +12 -0
- package/dist/src/main/shell-session/shell-env-modifier/terminal-shell-env-modify.injectable.d.ts +7 -0
- package/dist/src/renderer/api/websocket-api.d.ts +1 -1
- package/dist/src/renderer/components/+config-secrets/secret-details.d.ts +1 -1
- package/dist/src/renderer/components/+preferences/add-helm-repo-dialog.d.ts +0 -1
- package/dist/src/renderer/components/+preferences/helm-charts.d.ts +4 -2
- package/dist/src/renderer/components/item-object-list/list-layout.d.ts +1 -2
- package/dist/src/renderer/components/kube-object-list-layout/kube-object-list-layout.d.ts +5 -1
- package/package.json +1 -1
- package/dist/src/common/utils/extended-map.d.ts +0 -30
- package/dist/src/common/utils/openExternal.d.ts +0 -5
|
@@ -41,7 +41,7 @@ export declare class LensExtension {
|
|
|
41
41
|
getExtensionFileFolder(): Promise<string>;
|
|
42
42
|
enable(register: (ext: LensExtension) => Promise<Disposer[]>): Promise<void>;
|
|
43
43
|
disable(): Promise<void>;
|
|
44
|
-
activate():
|
|
44
|
+
activate(): Promise<void>;
|
|
45
45
|
protected onActivate(): Promise<void> | void;
|
|
46
46
|
protected onDeactivate(): Promise<void> | void;
|
|
47
47
|
}
|
|
@@ -7,9 +7,24 @@ import type { CatalogEntity } from "../common/catalog";
|
|
|
7
7
|
import type { IObservableArray } from "mobx";
|
|
8
8
|
import type { MenuRegistration } from "../main/menu/menu-registration";
|
|
9
9
|
import type { TrayMenuRegistration } from "../main/tray/tray-menu-registration";
|
|
10
|
+
import type { ShellEnvModifier } from "../main/shell-session/shell-env-modifier/shell-env-modifier-registration";
|
|
10
11
|
export declare class LensMainExtension extends LensExtension {
|
|
11
12
|
appMenus: MenuRegistration[];
|
|
12
13
|
trayMenus: TrayMenuRegistration[];
|
|
14
|
+
/**
|
|
15
|
+
* implement this to modify the shell environment that Lens terminals are opened with. The ShellEnvModifier type has the signature
|
|
16
|
+
*
|
|
17
|
+
* (ctx: ShellEnvContext, env: Record<string, string | undefined>) => Record<string, string | undefined>
|
|
18
|
+
*
|
|
19
|
+
* @param ctx the shell environment context, specifically the relevant catalog entity for the terminal. This can be used, for example, to get
|
|
20
|
+
* cluster-specific information that can be made available in the shell environment by the implementation of terminalShellEnvModifier
|
|
21
|
+
*
|
|
22
|
+
* @param env the current shell environment that the terminal will be opened with. The implementation should modify this as desired.
|
|
23
|
+
*
|
|
24
|
+
* @returns the modified shell environment that the terminal will be opened with. The implementation must return env as passed in, if it
|
|
25
|
+
* does not modify the shell environment
|
|
26
|
+
*/
|
|
27
|
+
terminalShellEnvModifier?: ShellEnvModifier;
|
|
13
28
|
navigate(pageId?: string, params?: Record<string, any>, frameId?: number): Promise<void>;
|
|
14
29
|
addCatalogSource(id: string, source: IObservableArray<CatalogEntity>): void;
|
|
15
30
|
removeCatalogSource(id: string): void;
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
import * as Catalog from "./catalog";
|
|
6
6
|
import * as Navigation from "./navigation";
|
|
7
7
|
import * as K8sApi from "./k8s-api";
|
|
8
|
+
import * as Power from "./power";
|
|
8
9
|
import { IpcMain as Ipc } from "../ipc/ipc-main";
|
|
9
10
|
import { LensMainExtension as LensExtension } from "../lens-main-extension";
|
|
10
|
-
export { Catalog, Navigation, K8sApi, Ipc, LensExtension, };
|
|
11
|
+
export { Catalog, Navigation, K8sApi, Ipc, LensExtension, Power, };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { Disposer } from "../../common/utils/disposer";
|
|
2
|
+
/**
|
|
3
|
+
* Event listener for system power events
|
|
4
|
+
*/
|
|
5
|
+
export declare type PowerEventListener = () => void;
|
|
6
|
+
/**
|
|
7
|
+
* Adds event listener to system suspend events
|
|
8
|
+
* @param listener function which will be called on system suspend
|
|
9
|
+
* @returns function to remove event listener
|
|
10
|
+
*/
|
|
11
|
+
export declare const onSuspend: (listener: PowerEventListener) => Disposer;
|
|
12
|
+
/**
|
|
13
|
+
* Adds event listener to system resume event
|
|
14
|
+
* @param listener function which will be called on system resume
|
|
15
|
+
* @returns function to remove event listener
|
|
16
|
+
*/
|
|
17
|
+
export declare const onResume: (listener: PowerEventListener) => Disposer;
|
|
18
|
+
/**
|
|
19
|
+
* Adds event listener to the event which is emitted when
|
|
20
|
+
* the system is about to reboot or shut down
|
|
21
|
+
* @param listener function which will be called on system shutdown
|
|
22
|
+
* @returns function to remove event listener
|
|
23
|
+
*/
|
|
24
|
+
export declare const onShutdown: (listener: PowerEventListener) => Disposer;
|
|
@@ -4,4 +4,5 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import type { CatalogEntityRegistry } from "./catalog";
|
|
6
6
|
import "../common/catalog-entities/kubernetes-cluster";
|
|
7
|
-
export declare function pushCatalogToRenderer(catalog: CatalogEntityRegistry):
|
|
7
|
+
export declare function pushCatalogToRenderer(catalog: CatalogEntityRegistry): void;
|
|
8
|
+
export declare function startCatalogSyncToRenderer(catalog: CatalogEntityRegistry): import("../common/utils").ExtendableDisposer;
|
|
@@ -7,7 +7,7 @@ import "../common/ipc/cluster";
|
|
|
7
7
|
import type http from "http";
|
|
8
8
|
import { Cluster } from "../common/cluster/cluster";
|
|
9
9
|
import { Singleton } from "../common/utils";
|
|
10
|
-
import { KubernetesCluster } from "../common/catalog-entities/kubernetes-cluster";
|
|
10
|
+
import { KubernetesCluster, LensKubernetesClusterStatus } from "../common/catalog-entities/kubernetes-cluster";
|
|
11
11
|
import type { ClusterId } from "../common/cluster-types";
|
|
12
12
|
export declare class ClusterManager extends Singleton {
|
|
13
13
|
private store;
|
|
@@ -24,4 +24,22 @@ export declare class ClusterManager extends Singleton {
|
|
|
24
24
|
stop(): void;
|
|
25
25
|
getClusterForRequest(req: http.IncomingMessage): Cluster;
|
|
26
26
|
}
|
|
27
|
-
export declare function catalogEntityFromCluster(cluster: Cluster): KubernetesCluster
|
|
27
|
+
export declare function catalogEntityFromCluster(cluster: Cluster): KubernetesCluster<{
|
|
28
|
+
uid: string;
|
|
29
|
+
name: string;
|
|
30
|
+
source: string;
|
|
31
|
+
labels: {
|
|
32
|
+
[x: string]: string;
|
|
33
|
+
};
|
|
34
|
+
distro: string;
|
|
35
|
+
kubeVersion: string;
|
|
36
|
+
}, {
|
|
37
|
+
phase: LensKubernetesClusterStatus;
|
|
38
|
+
reason: string;
|
|
39
|
+
message: string;
|
|
40
|
+
active: boolean;
|
|
41
|
+
}, {
|
|
42
|
+
kubeconfigPath: string;
|
|
43
|
+
kubeconfigContext: string;
|
|
44
|
+
icon: {};
|
|
45
|
+
}>;
|
|
@@ -24,15 +24,14 @@ export interface HelmRepo {
|
|
|
24
24
|
export declare class HelmRepoManager extends Singleton {
|
|
25
25
|
protected repos: HelmRepo[];
|
|
26
26
|
protected helmEnv: HelmEnv;
|
|
27
|
-
protected
|
|
28
|
-
|
|
29
|
-
private
|
|
30
|
-
protected
|
|
27
|
+
protected didUpdateOnce: boolean;
|
|
28
|
+
loadAvailableRepos(): Promise<HelmRepo[]>;
|
|
29
|
+
private ensureInitialized;
|
|
30
|
+
protected parseHelmEnv(): Promise<HelmEnv>;
|
|
31
31
|
repo(name: string): Promise<HelmRepo>;
|
|
32
|
-
private
|
|
32
|
+
private list;
|
|
33
33
|
repositories(): Promise<HelmRepo[]>;
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
static removeRepo({ name, url }: HelmRepo): Promise<string>;
|
|
34
|
+
update(): Promise<string>;
|
|
35
|
+
addRepo({ name, url, insecureSkipTlsVerify, username, password, caFile, keyFile, certFile }: HelmRepo): Promise<string>;
|
|
36
|
+
removeRepo({ name, url }: HelmRepo): Promise<string>;
|
|
38
37
|
}
|
|
@@ -2,9 +2,15 @@
|
|
|
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 type WebSocket from "ws";
|
|
6
|
+
import type { Cluster } from "../../../common/cluster/cluster";
|
|
7
|
+
import type { ClusterId } from "../../../common/cluster-types";
|
|
5
8
|
import { ShellSession } from "../shell-session";
|
|
9
|
+
import type { Kubectl } from "../../kubectl/kubectl";
|
|
6
10
|
export declare class LocalShellSession extends ShellSession {
|
|
11
|
+
protected shellEnvModify: (clusterId: ClusterId, env: Record<string, string>) => Record<string, string>;
|
|
7
12
|
ShellType: string;
|
|
13
|
+
constructor(shellEnvModify: (clusterId: ClusterId, env: Record<string, string>) => Record<string, string>, kubectl: Kubectl, websocket: WebSocket, cluster: Cluster, terminalId: string);
|
|
8
14
|
protected getPathEntries(): string[];
|
|
9
15
|
protected get cwd(): string | undefined;
|
|
10
16
|
open(): Promise<void>;
|
|
@@ -0,0 +1,9 @@
|
|
|
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 { CatalogEntity } from "../../../common/catalog";
|
|
6
|
+
export interface ShellEnvContext {
|
|
7
|
+
catalogEntity: CatalogEntity;
|
|
8
|
+
}
|
|
9
|
+
export declare type ShellEnvModifier = (ctx: ShellEnvContext, env: Record<string, string | undefined>) => Record<string, string | undefined>;
|
|
@@ -0,0 +1,12 @@
|
|
|
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 { IComputedValue } from "mobx";
|
|
6
|
+
import type { ClusterId } from "../../../common/cluster-types";
|
|
7
|
+
import type { LensMainExtension } from "../../../extensions/lens-main-extension";
|
|
8
|
+
interface Dependencies {
|
|
9
|
+
extensions: IComputedValue<LensMainExtension[]>;
|
|
10
|
+
}
|
|
11
|
+
export declare const terminalShellEnvModify: ({ extensions }: Dependencies) => (clusterId: ClusterId, env: Record<string, string>) => Record<string, string>;
|
|
12
|
+
export {};
|
package/dist/src/main/shell-session/shell-env-modifier/terminal-shell-env-modify.injectable.d.ts
ADDED
|
@@ -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
|
+
/// <reference types="@ogre-tools/injectable" />
|
|
6
|
+
declare const terminalShellEnvModifyInjectable: import("@ogre-tools/injectable").Injectable<import("@ogre-tools/injectable").InjectionToken<(clusterId: string, env: Record<string, string>) => Record<string, string>, unknown>, (clusterId: string, env: Record<string, string>) => Record<string, string>, unknown>;
|
|
7
|
+
export default terminalShellEnvModifyInjectable;
|
|
@@ -52,7 +52,7 @@ export interface WebSocketEvents {
|
|
|
52
52
|
declare type Defaulted<Params, DefaultParams extends keyof Params> = Required<Pick<Params, DefaultParams>> & Omit<Params, DefaultParams>;
|
|
53
53
|
declare const WebSocketApi_base: new <T>() => TypedEventEmitter<T>;
|
|
54
54
|
export declare class WebSocketApi<Events extends WebSocketEvents> extends WebSocketApi_base<Events> {
|
|
55
|
-
protected socket
|
|
55
|
+
protected socket?: WebSocket | null;
|
|
56
56
|
protected pendingCommands: (string | ArrayBufferLike | Blob | ArrayBufferView)[];
|
|
57
57
|
protected reconnectTimer?: any;
|
|
58
58
|
protected pingTimer?: any;
|
|
@@ -13,7 +13,7 @@ export declare class SecretDetails extends React.Component<Props> {
|
|
|
13
13
|
data: {
|
|
14
14
|
[name: string]: string;
|
|
15
15
|
};
|
|
16
|
-
revealSecret:
|
|
16
|
+
revealSecret: import("mobx").ObservableSet<string>;
|
|
17
17
|
constructor(props: Props);
|
|
18
18
|
componentDidMount(): Promise<void>;
|
|
19
19
|
saveSecret: () => Promise<void>;
|
|
@@ -6,12 +6,14 @@ import React from "react";
|
|
|
6
6
|
import { HelmRepo } from "../../../main/helm/helm-repo-manager";
|
|
7
7
|
import { SelectOption } from "../select";
|
|
8
8
|
export declare class HelmCharts extends React.Component {
|
|
9
|
-
|
|
9
|
+
loadingRepos: boolean;
|
|
10
|
+
loadingAvailableRepos: boolean;
|
|
10
11
|
repos: HelmRepo[];
|
|
11
12
|
addedRepos: import("mobx").ObservableMap<string, HelmRepo>;
|
|
12
13
|
constructor(props: {});
|
|
13
14
|
get options(): SelectOption<HelmRepo>[];
|
|
14
|
-
componentDidMount():
|
|
15
|
+
componentDidMount(): void;
|
|
16
|
+
loadAvailableRepos(): Promise<void>;
|
|
15
17
|
loadRepos(): Promise<void>;
|
|
16
18
|
addRepo(repo: HelmRepo): Promise<void>;
|
|
17
19
|
removeRepo(repo: HelmRepo): Promise<void>;
|
|
@@ -25,8 +25,7 @@ export declare type HeaderCustomizer = (placeholders: HeaderPlaceholders) => Hea
|
|
|
25
25
|
export interface ItemListLayoutProps<I extends ItemObject> {
|
|
26
26
|
tableId?: string;
|
|
27
27
|
className: IClassName;
|
|
28
|
-
|
|
29
|
-
getItems?: () => I[];
|
|
28
|
+
getItems: () => I[];
|
|
30
29
|
store: ItemStore<I>;
|
|
31
30
|
dependentStores?: ItemStore<ItemObject>[];
|
|
32
31
|
preloadStores?: boolean;
|
|
@@ -6,9 +6,13 @@ import "./kube-object-list-layout.scss";
|
|
|
6
6
|
import type { KubeObject } from "../../../common/k8s-api/kube-object";
|
|
7
7
|
import { ItemListLayoutProps } from "../item-object-list/list-layout";
|
|
8
8
|
import type { KubeObjectStore } from "../../../common/k8s-api/kube-object.store";
|
|
9
|
-
|
|
9
|
+
declare type ItemListLayoutPropsWithoutGetItems<K extends KubeObject> = Omit<ItemListLayoutProps<K>, "getItems">;
|
|
10
|
+
export interface KubeObjectListLayoutProps<K extends KubeObject> extends ItemListLayoutPropsWithoutGetItems<K> {
|
|
11
|
+
items?: K[];
|
|
12
|
+
getItems?: () => K[];
|
|
10
13
|
store: KubeObjectStore<K>;
|
|
11
14
|
dependentStores?: KubeObjectStore<KubeObject>[];
|
|
12
15
|
subscribeStores?: boolean;
|
|
13
16
|
}
|
|
14
17
|
export declare function KubeObjectListLayout<K extends KubeObject>(props: KubeObjectListLayoutProps<K>): JSX.Element;
|
|
18
|
+
export {};
|
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.4.0-git.
|
|
5
|
+
"version": "5.4.0-git.8524f9d244.0",
|
|
6
6
|
"copyright": "© 2021 OpenLens Authors",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"main": "dist/src/extensions/extension-api.js",
|
|
@@ -1,30 +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 { ObservableMap } from "mobx";
|
|
6
|
-
export declare function multiSet<T, V>(map: Map<T, V>, newEntries: [T, V][]): void;
|
|
7
|
-
export declare class ExtendedMap<K, V> extends Map<K, V> {
|
|
8
|
-
static new<K, V>(entries?: readonly (readonly [K, V])[] | null): ExtendedMap<K, V>;
|
|
9
|
-
/**
|
|
10
|
-
* Get the value behind `key`. If it was not present, first insert the value returned by `getVal`
|
|
11
|
-
* @param key The key to insert into the map with
|
|
12
|
-
* @param getVal A function that returns a new instance of `V`.
|
|
13
|
-
* @returns The value in the map
|
|
14
|
-
*/
|
|
15
|
-
getOrInsert(key: K, getVal: () => V): V;
|
|
16
|
-
/**
|
|
17
|
-
* Set the value associated with `key` iff there was not a previous value
|
|
18
|
-
* @throws if `key` already in map
|
|
19
|
-
* @returns `this` so that `strictSet` can be chained
|
|
20
|
-
*/
|
|
21
|
-
strictSet(key: K, val: V): this;
|
|
22
|
-
/**
|
|
23
|
-
* Get the value associated with `key`
|
|
24
|
-
* @throws if `key` did not a value associated with it
|
|
25
|
-
*/
|
|
26
|
-
strictGet(key: K): V;
|
|
27
|
-
}
|
|
28
|
-
export declare class ExtendedObservableMap<K, V> extends ObservableMap<K, V> {
|
|
29
|
-
getOrInsert(key: K, getVal: () => V): V;
|
|
30
|
-
}
|