@k8slens/extensions 5.4.0-git.d44b859c23.0 → 5.4.0-git.d4d2da1d28.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/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 +1 -0
- package/dist/src/extensions/extension-api.js +7 -7
- package/dist/src/main/create-cluster/create-cluster.injectable.d.ts +1 -2
- 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/item-object-list/content.d.ts +1 -1
- package/dist/src/renderer/components/item-object-list/list-layout.d.ts +1 -2
- package/dist/src/renderer/components/layout/tab-routes-sidebar-items.d.ts +8 -4
- 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
|
@@ -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
|
}
|
|
@@ -104,6 +104,7 @@ export declare abstract class KubeObjectStore<T extends KubeObject> extends Item
|
|
|
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;
|