@k8slens/extensions 5.4.0-git.76f48df56b.0 → 5.4.0-git.81819dbbe9.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/cluster/authorization-review.injectable.d.ts +13 -0
- package/dist/src/common/cluster/cluster.d.ts +11 -21
- package/dist/src/common/cluster/list-namespaces.injectable.d.ts +10 -0
- package/dist/src/common/item.store.d.ts +3 -1
- package/dist/src/common/k8s-api/kube-object.store.d.ts +3 -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 +2 -1
- package/dist/src/extensions/common-api/utils.d.ts +1 -1
- package/dist/src/extensions/extension-api.js +47 -47
- 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/lens-renderer-extension.d.ts +1 -1
- 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/create-cluster/create-cluster.injectable.d.ts +1 -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/+catalog/custom-category-columns.d.ts +1 -1
- package/dist/src/renderer/components/+config-secrets/secret-details.d.ts +1 -1
- package/dist/src/renderer/components/+custom-resources/route-tabs.injectable.d.ts +1 -1
- package/dist/src/renderer/components/+custom-resources/route.d.ts +1 -4
- 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/content.d.ts +1 -1
- package/dist/src/renderer/components/item-object-list/list-layout.d.ts +2 -4
- package/dist/src/renderer/components/kube-object-list-layout/kube-object-list-layout.d.ts +5 -1
- package/dist/src/renderer/components/layout/tab-routes-sidebar-items.d.ts +8 -4
- package/dist/src/renderer/components/status-bar/registered-status-bar-items.injectable.d.ts +14 -0
- package/dist/src/renderer/components/status-bar/status-bar-items.injectable.d.ts +3 -0
- package/dist/src/renderer/components/status-bar/status-bar-registration.d.ts +38 -0
- package/dist/src/renderer/components/{cluster-manager/bottom-bar.d.ts → status-bar/status-bar.d.ts} +3 -1
- package/dist/src/renderer/components/{cluster-manager/bottom-bar.test.d.ts → status-bar/status-bar.test.d.ts} +0 -0
- package/dist/src/renderer/create-cluster/create-cluster.injectable.d.ts +1 -2
- package/dist/src/renderer/port-forward/port-forward-store/port-forward-store.d.ts +1 -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
- package/dist/src/renderer/components/cluster-manager/bottom-bar-items.injectable.d.ts +0 -4
- package/dist/src/renderer/components/cluster-manager/status-bar-registration.d.ts +0 -24
|
@@ -2,12 +2,12 @@
|
|
|
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 { Disposer
|
|
5
|
+
import type { Disposer } from "../utils";
|
|
6
6
|
import { CatalogCategory, CatalogEntityData, CatalogEntityKindData } from "./catalog-entity";
|
|
7
7
|
export declare type CategoryFilter = (category: CatalogCategory) => any;
|
|
8
8
|
export declare class CatalogCategoryRegistry {
|
|
9
9
|
protected categories: import("mobx").ObservableSet<CatalogCategory>;
|
|
10
|
-
protected groupKinds:
|
|
10
|
+
protected groupKinds: Map<string, Map<string, CatalogCategory>>;
|
|
11
11
|
protected filters: import("mobx").ObservableSet<CategoryFilter>;
|
|
12
12
|
constructor();
|
|
13
13
|
add(category: CatalogCategory): Disposer;
|
|
@@ -43,7 +43,7 @@ export interface KubernetesClusterMetadata extends CatalogEntityMetadata {
|
|
|
43
43
|
export declare type KubernetesClusterStatusPhase = "connected" | "connecting" | "disconnected" | "deleting";
|
|
44
44
|
export interface KubernetesClusterStatus extends CatalogEntityStatus {
|
|
45
45
|
}
|
|
46
|
-
export declare class KubernetesCluster extends
|
|
46
|
+
export declare class KubernetesCluster<Metadata extends KubernetesClusterMetadata = KubernetesClusterMetadata, Status extends KubernetesClusterStatus = KubernetesClusterStatus, Spec extends KubernetesClusterSpec = KubernetesClusterSpec> extends CatalogEntity<Metadata, Status, Spec> {
|
|
47
47
|
static readonly apiVersion: string;
|
|
48
48
|
static readonly kind: string;
|
|
49
49
|
readonly apiVersion: string;
|
|
@@ -0,0 +1,13 @@
|
|
|
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
|
+
import { KubeConfig, V1ResourceAttributes } from "@kubernetes/client-node";
|
|
7
|
+
export declare type CanI = (resourceAttributes: V1ResourceAttributes) => Promise<boolean>;
|
|
8
|
+
/**
|
|
9
|
+
* @param proxyConfig This config's `currentContext` field must be set, and will be used as the target cluster
|
|
10
|
+
*/
|
|
11
|
+
export declare function authorizationReview(proxyConfig: KubeConfig): CanI;
|
|
12
|
+
declare const authorizationReviewInjectable: import("@ogre-tools/injectable").Injectable<import("@ogre-tools/injectable").InjectionToken<typeof authorizationReview, unknown>, typeof authorizationReview, unknown>;
|
|
13
|
+
export default authorizationReviewInjectable;
|
|
@@ -3,17 +3,21 @@
|
|
|
3
3
|
* Licensed under MIT License. See LICENSE in root directory for more information.
|
|
4
4
|
*/
|
|
5
5
|
import type { ContextHandler } from "../../main/context-handler/context-handler";
|
|
6
|
-
import { KubeConfig
|
|
6
|
+
import { KubeConfig } from "@kubernetes/client-node";
|
|
7
7
|
import type { Kubectl } from "../../main/kubectl/kubectl";
|
|
8
8
|
import type { KubeconfigManager } from "../../main/kubeconfig-manager/kubeconfig-manager";
|
|
9
9
|
import { KubeResource } from "../rbac";
|
|
10
10
|
import type { ClusterState, ClusterRefreshOptions, ClusterMetricsResourceType, ClusterId, ClusterMetadata, ClusterModel, ClusterPreferences, ClusterPrometheusPreferences, UpdateClusterModel } from "../cluster-types";
|
|
11
11
|
import { ClusterStatus } from "../cluster-types";
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
import type { CanI } from "./authorization-review.injectable";
|
|
13
|
+
import type { ListNamespaces } from "./list-namespaces.injectable";
|
|
14
|
+
export interface ClusterDependencies {
|
|
15
|
+
readonly directoryForKubeConfigs: string;
|
|
14
16
|
createKubeconfigManager: (cluster: Cluster) => KubeconfigManager;
|
|
15
17
|
createContextHandler: (cluster: Cluster) => ContextHandler;
|
|
16
18
|
createKubectl: (clusterVersion: string) => Kubectl;
|
|
19
|
+
createAuthorizationReview: (config: KubeConfig) => CanI;
|
|
20
|
+
createListNamespaces: (config: KubeConfig) => ListNamespaces;
|
|
17
21
|
}
|
|
18
22
|
/**
|
|
19
23
|
* Cluster
|
|
@@ -21,7 +25,7 @@ interface Dependencies {
|
|
|
21
25
|
* @beta
|
|
22
26
|
*/
|
|
23
27
|
export declare class Cluster implements ClusterModel, ClusterState {
|
|
24
|
-
private dependencies;
|
|
28
|
+
private readonly dependencies;
|
|
25
29
|
/** Unique id for a cluster */
|
|
26
30
|
readonly id: ClusterId;
|
|
27
31
|
private kubeCtl;
|
|
@@ -175,7 +179,7 @@ export declare class Cluster implements ClusterModel, ClusterState {
|
|
|
175
179
|
* @internal
|
|
176
180
|
*/
|
|
177
181
|
get defaultNamespace(): string;
|
|
178
|
-
constructor(dependencies:
|
|
182
|
+
constructor(dependencies: ClusterDependencies, model: ClusterModel);
|
|
179
183
|
/**
|
|
180
184
|
* Update cluster data model
|
|
181
185
|
*
|
|
@@ -234,19 +238,6 @@ export declare class Cluster implements ClusterModel, ClusterState {
|
|
|
234
238
|
*/
|
|
235
239
|
getProxyKubeconfigPath(): Promise<string>;
|
|
236
240
|
protected getConnectionStatus(): Promise<ClusterStatus>;
|
|
237
|
-
/**
|
|
238
|
-
* @internal
|
|
239
|
-
* @param resourceAttributes resource attributes
|
|
240
|
-
*/
|
|
241
|
-
canI(resourceAttributes: V1ResourceAttributes): Promise<boolean>;
|
|
242
|
-
/**
|
|
243
|
-
* @internal
|
|
244
|
-
*/
|
|
245
|
-
isClusterAdmin(): Promise<boolean>;
|
|
246
|
-
/**
|
|
247
|
-
* @internal
|
|
248
|
-
*/
|
|
249
|
-
canUseWatchApi(customizeResource?: V1ResourceAttributes): Promise<boolean>;
|
|
250
241
|
toJSON(): ClusterModel;
|
|
251
242
|
/**
|
|
252
243
|
* Serializable cluster-state used for sync btw main <-> renderer
|
|
@@ -275,12 +266,11 @@ export declare class Cluster implements ClusterModel, ClusterState {
|
|
|
275
266
|
* @internal
|
|
276
267
|
*/
|
|
277
268
|
broadcastConnectUpdate(message: string, isError?: boolean): void;
|
|
278
|
-
protected getAllowedNamespaces(): Promise<string[]>;
|
|
279
|
-
protected getAllowedResources(): Promise<KubeResource[]>;
|
|
269
|
+
protected getAllowedNamespaces(proxyConfig: KubeConfig): Promise<string[]>;
|
|
270
|
+
protected getAllowedResources(canI: CanI): Promise<KubeResource[]>;
|
|
280
271
|
isAllowedResource(kind: string): boolean;
|
|
281
272
|
isMetricHidden(resource: ClusterMetricsResourceType): boolean;
|
|
282
273
|
get nodeShellImage(): string;
|
|
283
274
|
get imagePullSecret(): string | undefined;
|
|
284
275
|
isInLocalKubeconfig(): boolean;
|
|
285
276
|
}
|
|
286
|
-
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="@ogre-tools/injectable" />
|
|
2
|
+
/**
|
|
3
|
+
* Copyright (c) OpenLens Authors. All rights reserved.
|
|
4
|
+
* Licensed under MIT License. See LICENSE in root directory for more information.
|
|
5
|
+
*/
|
|
6
|
+
import { KubeConfig } from "@kubernetes/client-node";
|
|
7
|
+
export declare type ListNamespaces = () => Promise<string[]>;
|
|
8
|
+
export declare function listNamespaces(config: KubeConfig): ListNamespaces;
|
|
9
|
+
declare const listNamespacesInjectable: import("@ogre-tools/injectable").Injectable<import("@ogre-tools/injectable").InjectionToken<typeof listNamespaces, unknown>, typeof listNamespaces, unknown>;
|
|
10
|
+
export default listNamespacesInjectable;
|
|
@@ -13,9 +13,10 @@ export declare abstract class ItemStore<Item extends ItemObject> {
|
|
|
13
13
|
isLoading: boolean;
|
|
14
14
|
isLoaded: boolean;
|
|
15
15
|
items: import("mobx").IObservableArray<Item>;
|
|
16
|
-
selectedItemsIds: import("mobx").
|
|
16
|
+
selectedItemsIds: import("mobx").ObservableSet<string>;
|
|
17
17
|
constructor();
|
|
18
18
|
get selectedItems(): Item[];
|
|
19
|
+
pickOnlySelected(items: Item[]): Item[];
|
|
19
20
|
getItems(): Item[];
|
|
20
21
|
getTotalCount(): number;
|
|
21
22
|
getByName(name: string, ...args: any[]): Item;
|
|
@@ -44,5 +45,6 @@ export declare abstract class ItemStore<Item extends ItemObject> {
|
|
|
44
45
|
resetSelection(): void;
|
|
45
46
|
reset(): void;
|
|
46
47
|
removeSelectedItems?(): Promise<any>;
|
|
48
|
+
removeItems?(items: Item[]): Promise<void>;
|
|
47
49
|
[Symbol.iterator](): Generator<Item, void, undefined>;
|
|
48
50
|
}
|
|
@@ -95,15 +95,16 @@ export declare abstract class KubeObjectStore<T extends KubeObject> extends Item
|
|
|
95
95
|
name: string;
|
|
96
96
|
namespace?: string;
|
|
97
97
|
}, data?: Partial<T>): Promise<T>;
|
|
98
|
-
create
|
|
98
|
+
create(params: {
|
|
99
99
|
name: string;
|
|
100
100
|
namespace?: string;
|
|
101
|
-
}, data?: Partial<T>)
|
|
101
|
+
}, data?: Partial<T>): Promise<T>;
|
|
102
102
|
private postUpdate;
|
|
103
103
|
patch(item: T, patch: Patch): Promise<T>;
|
|
104
104
|
update(item: T, data: Partial<T>): Promise<T>;
|
|
105
105
|
remove(item: T): Promise<void>;
|
|
106
106
|
removeSelectedItems(): Promise<void[]>;
|
|
107
|
+
removeItems(items: T[]): Promise<void>;
|
|
107
108
|
protected eventsBuffer: import("mobx").IObservableArray<IKubeWatchEvent<KubeJsonApiData>>;
|
|
108
109
|
protected bindWatchEventsUpdater(delay?: number): void;
|
|
109
110
|
subscribe({ onLoadFailure, abortController }?: KubeObjectStoreSubscribeParams): Disposer;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Licensed under MIT License. See LICENSE in root directory for more information.
|
|
4
4
|
*/
|
|
5
5
|
import { BaseStore } from "../base-store";
|
|
6
|
-
import { EditorConfiguration, ExtensionRegistry, KubeconfigSyncValue, UserPreferencesModel, TerminalConfig } from "./preferences-helpers";
|
|
6
|
+
import type { EditorConfiguration, ExtensionRegistry, KubeconfigSyncValue, UserPreferencesModel, TerminalConfig } from "./preferences-helpers";
|
|
7
7
|
export interface UserStoreModel {
|
|
8
8
|
lastSeenAppVersion: string;
|
|
9
9
|
preferences: UserPreferencesModel;
|
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
*/
|
|
12
12
|
export declare function getOrInsert<K, V>(map: Map<K, V>, key: K, value: V): V;
|
|
13
13
|
/**
|
|
14
|
-
* Like `getOrInsert` but specifically for when `V` is `Map<
|
|
15
|
-
* the typings are inferred.
|
|
14
|
+
* Like `getOrInsert` but specifically for when `V` is `Map<MK, MV>` so that
|
|
15
|
+
* the typings are inferred correctly.
|
|
16
16
|
*/
|
|
17
17
|
export declare function getOrInsertMap<K, MK, MV>(map: Map<K, Map<MK, MV>>, key: K): Map<MK, MV>;
|
|
18
18
|
/**
|
|
@@ -21,9 +21,23 @@ export declare function getOrInsertMap<K, MK, MV>(map: Map<K, Map<MK, MV>>, key:
|
|
|
21
21
|
*/
|
|
22
22
|
export declare function getOrInsertSet<K, SK>(map: Map<K, Set<SK>>, key: K): Set<SK>;
|
|
23
23
|
/**
|
|
24
|
-
* Like `getOrInsert` but with delayed creation of the item
|
|
24
|
+
* Like `getOrInsert` but with delayed creation of the item. Which is useful
|
|
25
|
+
* if it is very expensive to create the initial value.
|
|
26
|
+
*/
|
|
27
|
+
export declare function getOrInsertWith<K, V>(map: Map<K, V>, key: K, builder: () => V): V;
|
|
28
|
+
/**
|
|
29
|
+
* Set the value associated with `key` iff there was not a previous value
|
|
30
|
+
* @param map The map to interact with
|
|
31
|
+
* @throws if `key` already in map
|
|
32
|
+
* @returns `this` so that `strictSet` can be chained
|
|
33
|
+
*/
|
|
34
|
+
export declare function strictSet<K, V>(map: Map<K, V>, key: K, val: V): typeof map;
|
|
35
|
+
/**
|
|
36
|
+
* Get the value associated with `key`
|
|
37
|
+
* @param map The map to interact with
|
|
38
|
+
* @throws if `key` did not a value associated with it
|
|
25
39
|
*/
|
|
26
|
-
export declare function
|
|
40
|
+
export declare function strictGet<K, V>(map: Map<K, V>, key: K): V;
|
|
27
41
|
/**
|
|
28
42
|
* If `key` is in `set`, remove it otherwise add it.
|
|
29
43
|
* @param set The set to manipulate
|
|
@@ -21,13 +21,12 @@ export * from "./delay";
|
|
|
21
21
|
export * from "./disposer";
|
|
22
22
|
export * from "./downloadFile";
|
|
23
23
|
export * from "./escapeRegExp";
|
|
24
|
-
export * from "./extended-map";
|
|
25
24
|
export * from "./formatDuration";
|
|
26
25
|
export * from "./getRandId";
|
|
27
26
|
export * from "./hash-set";
|
|
28
27
|
export * from "./n-fircate";
|
|
29
28
|
export * from "./objects";
|
|
30
|
-
export * from "./
|
|
29
|
+
export * from "./openBrowser";
|
|
31
30
|
export * from "./paths";
|
|
32
31
|
export * from "./promise-exec";
|
|
33
32
|
export * from "./reject-promise";
|
|
@@ -6,6 +6,5 @@
|
|
|
6
6
|
* A better typed version of `Object.fromEntries` where the keys are known to
|
|
7
7
|
* be a specific subset
|
|
8
8
|
*/
|
|
9
|
-
export declare function fromEntries<T, Key extends string>(entries: Iterable<readonly [Key, T]>):
|
|
10
|
-
|
|
11
|
-
};
|
|
9
|
+
export declare function fromEntries<T, Key extends string>(entries: Iterable<readonly [Key, T]>): Record<Key, T>;
|
|
10
|
+
export declare function entries<T extends Record<string, any>>(obj: T): [keyof T, T[keyof T]][];
|
|
@@ -0,0 +1,17 @@
|
|
|
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
|
+
* Opens a link using the program configured as the default browser
|
|
7
|
+
* on the target platform. Will reject URLs with a scheme other than
|
|
8
|
+
* http or https to prevent programs other than the default browser
|
|
9
|
+
* running.
|
|
10
|
+
*
|
|
11
|
+
* @param url The URL to open
|
|
12
|
+
*/
|
|
13
|
+
export declare function openBrowser(url: string): Promise<void>;
|
|
14
|
+
/**
|
|
15
|
+
* @deprecated use openBrowser
|
|
16
|
+
*/
|
|
17
|
+
export declare const openExternal: typeof openBrowser;
|
|
@@ -2,7 +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
|
-
export type { StatusBarRegistration } from "../../renderer/components/
|
|
5
|
+
export type { StatusBarRegistration } from "../../renderer/components/status-bar/status-bar-registration";
|
|
6
6
|
export type { KubeObjectMenuRegistration, KubeObjectMenuComponents } from "../../renderer/components/kube-object-menu/dependencies/kube-object-menu-items/kube-object-menu-registration";
|
|
7
7
|
export type { AppPreferenceRegistration, AppPreferenceComponents } from "../../renderer/components/+preferences/app-preferences/app-preference-registration";
|
|
8
8
|
export type { KubeObjectDetailRegistration, KubeObjectDetailComponents } from "../registries/kube-object-detail-registry";
|
|
@@ -11,3 +11,4 @@ export type { PageRegistration, RegisteredPage, PageParams, PageComponentProps,
|
|
|
11
11
|
export type { ClusterPageMenuRegistration, ClusterPageMenuComponents } from "../registries/page-menu-registry";
|
|
12
12
|
export type { ProtocolHandlerRegistration, RouteParams as ProtocolRouteParams, RouteHandler as ProtocolRouteHandler } from "../registries/protocol-handler";
|
|
13
13
|
export type { CustomCategoryViewProps, CustomCategoryViewComponents, CustomCategoryViewRegistration } from "../../renderer/components/+catalog/custom-views";
|
|
14
|
+
export type { ShellEnvModifier, ShellEnvContext } from "../../main/shell-session/shell-env-modifier/shell-env-modifier-registration";
|
|
@@ -2,6 +2,6 @@
|
|
|
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
|
-
export { Singleton, openExternal } from "../../common/utils";
|
|
5
|
+
export { Singleton, openExternal, openBrowser } from "../../common/utils";
|
|
6
6
|
export { prevDefault, stopPropagation } from "../../renderer/utils/prevDefault";
|
|
7
7
|
export { cssNames } from "../../renderer/utils/cssNames";
|