@k8slens/extensions 5.2.3 → 5.3.0-git.07c8177a97.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 +9 -0
- package/dist/src/common/catalog/catalog-entity.d.ts +18 -0
- package/dist/src/common/catalog/catalog-run-event.d.ts +30 -0
- package/dist/src/common/catalog-entities/__tests__/kubernetes-cluster.test.d.ts +1 -0
- package/dist/src/common/k8s-api/endpoints/resource-applier.api.d.ts +4 -4
- package/dist/src/common/k8s-api/kube-api.d.ts +20 -2
- package/dist/src/common/k8s-api/kube-object.d.ts +18 -1
- package/dist/src/common/k8s-api/kube-object.store.d.ts +3 -0
- package/dist/src/common/routes/catalog.d.ts +2 -0
- package/dist/src/common/routes/index.d.ts +1 -0
- package/dist/src/common/routes/port-forwards.d.ts +25 -0
- package/dist/src/common/user-store/preferences-helpers.d.ts +1 -0
- package/dist/src/common/user-store/user-store.d.ts +1 -0
- package/dist/src/extensions/extension-api.js +3313 -354
- package/dist/src/extensions/lens-renderer-extension.d.ts +9 -2
- package/dist/src/extensions/main-api/k8s-api.d.ts +2 -2
- package/dist/src/extensions/registries/command-registry.d.ts +2 -2
- package/dist/src/extensions/renderer-api/catalog.d.ts +11 -0
- package/dist/src/extensions/renderer-api/k8s-api.d.ts +2 -2
- package/dist/src/main/{routes/utils/index.d.ts → __test__/lens-proxy.test.d.ts} +1 -1
- package/dist/src/main/context-handler.d.ts +1 -1
- package/dist/src/main/lens-proxy.d.ts +1 -0
- package/dist/src/main/resource-applier.d.ts +9 -0
- package/dist/src/main/routes/port-forward-route.d.ts +3 -0
- package/dist/src/main/routes/resource-applier-route.d.ts +1 -0
- package/dist/src/main/utils/__test__/update-channel.test.d.ts +21 -0
- package/dist/src/main/utils/http-responses.d.ts +20 -1
- package/dist/src/main/{routes/utils → utils}/parse-query.d.ts +0 -0
- package/dist/src/main/utils/update-channel.d.ts +21 -0
- package/dist/src/renderer/api/catalog-category-registry.d.ts +1 -0
- package/dist/src/renderer/api/catalog-entity-registry.d.ts +20 -0
- package/dist/src/renderer/bootstrap.d.ts +1 -1
- package/dist/src/renderer/components/+add-cluster/add-cluster.d.ts +1 -1
- package/dist/src/renderer/components/+catalog/__tests__/catalog-add-button.test.d.ts +1 -0
- package/dist/src/renderer/components/+catalog/catalog-entity-details.d.ts +1 -1
- package/dist/src/renderer/components/+catalog/catalog-entity-drawer-menu.d.ts +1 -1
- package/dist/src/renderer/components/+catalog/catalog-entity-item.d.ts +23 -0
- package/dist/src/renderer/components/+catalog/catalog-entity.store.d.ts +7 -23
- package/dist/src/renderer/components/+catalog/catalog-menu.d.ts +1 -1
- package/dist/src/renderer/components/+catalog/catalog.d.ts +6 -1
- package/dist/src/renderer/components/+catalog/catalog.test.d.ts +21 -0
- package/dist/src/renderer/components/+entity-settings/entity-settings.d.ts +0 -1
- package/dist/src/renderer/{keyboard-shortcuts → components/+network-port-forwards}/index.d.ts +1 -1
- package/dist/src/renderer/components/+network-port-forwards/port-forward-menu.d.ts +33 -0
- package/dist/src/renderer/components/+network-port-forwards/port-forwards.d.ts +28 -0
- package/dist/src/renderer/components/+network-services/service-port-component.d.ts +6 -0
- package/dist/src/renderer/components/+workloads-pods/pod-container-port.d.ts +6 -0
- package/dist/src/renderer/components/+workloads-pods/pod-details-container.d.ts +1 -0
- package/dist/src/renderer/components/activate-entity-command/activate-entity-command.d.ts +30 -0
- package/dist/src/renderer/components/activate-entity-command/index.d.ts +21 -0
- package/dist/src/renderer/components/app.d.ts +1 -1
- package/dist/src/renderer/components/dock/create-resource.d.ts +1 -1
- package/dist/src/renderer/components/dock/dock.store.d.ts +1 -1
- package/dist/src/renderer/components/dock/edit-resource.store.d.ts +2 -0
- package/dist/src/renderer/components/dock/log-tab.store.d.ts +1 -1
- package/dist/src/renderer/components/dock/terminal.d.ts +2 -0
- package/dist/src/renderer/components/hotbar/hotbar-menu.d.ts +1 -1
- package/dist/src/renderer/components/menu/menu.d.ts +6 -0
- package/dist/src/renderer/components/switch/switcher.d.ts +1 -1
- package/dist/src/renderer/lens-app.d.ts +1 -1
- package/dist/src/renderer/navigation/history.d.ts +2 -2
- package/dist/src/renderer/port-forward/index.d.ts +23 -0
- package/dist/src/renderer/port-forward/port-forward-dialog.d.ts +46 -0
- package/dist/src/renderer/port-forward/port-forward-item.d.ts +46 -0
- package/dist/src/renderer/port-forward/port-forward.store.d.ts +39 -0
- package/package.json +4 -4
|
@@ -20,15 +20,24 @@
|
|
|
20
20
|
*/
|
|
21
21
|
import { Disposer, ExtendedMap } from "../utils";
|
|
22
22
|
import { CatalogCategory, CatalogEntityData, CatalogEntityKindData } from "./catalog-entity";
|
|
23
|
+
export declare type CategoryFilter = (category: CatalogCategory) => any;
|
|
23
24
|
export declare class CatalogCategoryRegistry {
|
|
24
25
|
protected categories: import("mobx").ObservableSet<CatalogCategory>;
|
|
25
26
|
protected groupKinds: ExtendedMap<string, ExtendedMap<string, CatalogCategory>>;
|
|
27
|
+
protected filters: import("mobx").ObservableSet<CategoryFilter>;
|
|
26
28
|
constructor();
|
|
27
29
|
add(category: CatalogCategory): Disposer;
|
|
28
30
|
get items(): CatalogCategory[];
|
|
31
|
+
get filteredItems(): CatalogCategory[];
|
|
29
32
|
getForGroupKind<T extends CatalogCategory>(group: string, kind: string): T | undefined;
|
|
30
33
|
getEntityForData(data: CatalogEntityData & CatalogEntityKindData): import("./catalog-entity").CatalogEntity<import("./catalog-entity").CatalogEntityMetadata, import("./catalog-entity").CatalogEntityStatus, import("./catalog-entity").CatalogEntitySpec>;
|
|
31
34
|
getCategoryForEntity<T extends CatalogCategory>(data: CatalogEntityData & CatalogEntityKindData): T | undefined;
|
|
32
35
|
getByName(name: string): CatalogCategory;
|
|
36
|
+
/**
|
|
37
|
+
* Add a new filter to the set of category filters
|
|
38
|
+
* @param fn The function that should return a truthy value if that category should be displayed
|
|
39
|
+
* @returns A function to remove that filter
|
|
40
|
+
*/
|
|
41
|
+
addCatalogCategoryFilter(fn: CategoryFilter): Disposer;
|
|
33
42
|
}
|
|
34
43
|
export declare const catalogCategoryRegistry: CatalogCategoryRegistry;
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
*/
|
|
21
21
|
/// <reference types="react" />
|
|
22
22
|
import type TypedEmitter from "typed-emitter";
|
|
23
|
+
import { Disposer } from "../utils";
|
|
23
24
|
declare type ExtractEntityMetadataType<Entity> = Entity extends CatalogEntity<infer Metadata> ? Metadata : never;
|
|
24
25
|
declare type ExtractEntityStatusType<Entity> = Entity extends CatalogEntity<any, infer Status> ? Status : never;
|
|
25
26
|
declare type ExtractEntitySpecType<Entity> = Entity extends CatalogEntity<any, any, infer Spec> ? Spec : never;
|
|
@@ -35,6 +36,10 @@ export interface CatalogCategorySpec {
|
|
|
35
36
|
kind: string;
|
|
36
37
|
};
|
|
37
38
|
}
|
|
39
|
+
/**
|
|
40
|
+
* If the filter returns true, the menu item is displayed
|
|
41
|
+
*/
|
|
42
|
+
export declare type AddMenuFilter = (menu: CatalogEntityAddMenu) => any;
|
|
38
43
|
export interface CatalogCategoryEvents {
|
|
39
44
|
load: () => void;
|
|
40
45
|
catalogAddMenu: (context: CatalogEntityAddMenuContext) => void;
|
|
@@ -49,11 +54,24 @@ export declare abstract class CatalogCategory extends CatalogCategory_base {
|
|
|
49
54
|
icon: string;
|
|
50
55
|
};
|
|
51
56
|
abstract spec: CatalogCategorySpec;
|
|
57
|
+
protected filters: import("mobx").ObservableSet<AddMenuFilter>;
|
|
52
58
|
static parseId(id?: string): {
|
|
53
59
|
group?: string;
|
|
54
60
|
kind?: string;
|
|
55
61
|
};
|
|
56
62
|
getId(): string;
|
|
63
|
+
/**
|
|
64
|
+
* Add a filter for menu items of catalogAddMenu
|
|
65
|
+
* @param fn The function that should return a truthy value if that menu item should be displayed
|
|
66
|
+
* @returns A function to remove that filter
|
|
67
|
+
*/
|
|
68
|
+
addMenuFilter(fn: AddMenuFilter): Disposer;
|
|
69
|
+
/**
|
|
70
|
+
* Filter menuItems according to the Category's set filters
|
|
71
|
+
* @param menuItems menu items to filter
|
|
72
|
+
* @returns filtered menu items
|
|
73
|
+
*/
|
|
74
|
+
filteredItems(menuItems: CatalogEntityAddMenu[]): CatalogEntityAddMenu[];
|
|
57
75
|
}
|
|
58
76
|
export interface CatalogEntityMetadata {
|
|
59
77
|
uid: string;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2021 OpenLens Authors
|
|
3
|
+
*
|
|
4
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
5
|
+
* this software and associated documentation files (the "Software"), to deal in
|
|
6
|
+
* the Software without restriction, including without limitation the rights to
|
|
7
|
+
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
8
|
+
* the Software, and to permit persons to whom the Software is furnished to do so,
|
|
9
|
+
* subject to the following conditions:
|
|
10
|
+
*
|
|
11
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
12
|
+
* copies or substantial portions of the Software.
|
|
13
|
+
*
|
|
14
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
15
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
16
|
+
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
17
|
+
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
18
|
+
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
19
|
+
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
20
|
+
*/
|
|
21
|
+
import type { CatalogEntity } from "../catalog";
|
|
22
|
+
export declare class CatalogRunEvent {
|
|
23
|
+
#private;
|
|
24
|
+
get defaultPrevented(): boolean;
|
|
25
|
+
get target(): CatalogEntity<import("./catalog-entity").CatalogEntityMetadata, import("./catalog-entity").CatalogEntityStatus, import("./catalog-entity").CatalogEntitySpec>;
|
|
26
|
+
constructor({ target }: {
|
|
27
|
+
target: CatalogEntity;
|
|
28
|
+
});
|
|
29
|
+
preventDefault(): void;
|
|
30
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
20
20
|
*/
|
|
21
21
|
import type { KubeJsonApiData } from "../kube-json-api";
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
import type { Patch } from "rfc6902";
|
|
23
|
+
export declare const annotations: string[];
|
|
24
|
+
export declare function update(resource: object | string): Promise<KubeJsonApiData>;
|
|
25
|
+
export declare function patch(name: string, kind: string, ns: string, patch: Patch): Promise<KubeJsonApiData>;
|
|
@@ -69,12 +69,30 @@ export interface IKubeResourceList {
|
|
|
69
69
|
verbs: string[];
|
|
70
70
|
}[];
|
|
71
71
|
}
|
|
72
|
-
export interface
|
|
72
|
+
export interface ILocalKubeApiConfig {
|
|
73
73
|
metadata: {
|
|
74
74
|
uid: string;
|
|
75
75
|
};
|
|
76
76
|
}
|
|
77
|
-
|
|
77
|
+
/**
|
|
78
|
+
* @deprecated
|
|
79
|
+
*/
|
|
80
|
+
export interface IKubeApiCluster extends ILocalKubeApiConfig {
|
|
81
|
+
}
|
|
82
|
+
export interface IRemoteKubeApiConfig {
|
|
83
|
+
cluster: {
|
|
84
|
+
server: string;
|
|
85
|
+
caData?: string;
|
|
86
|
+
skipTLSVerify?: boolean;
|
|
87
|
+
};
|
|
88
|
+
user: {
|
|
89
|
+
token?: string;
|
|
90
|
+
clientCertificateData?: string;
|
|
91
|
+
clientKeyData?: string;
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
export declare function forCluster<T extends KubeObject>(cluster: ILocalKubeApiConfig, kubeClass: KubeObjectConstructor<T>): KubeApi<T>;
|
|
95
|
+
export declare function forRemoteCluster<T extends KubeObject>(config: IRemoteKubeApiConfig, kubeClass: KubeObjectConstructor<T>): KubeApi<T>;
|
|
78
96
|
export declare function ensureObjectSelfLink(api: KubeApi<KubeObject>, object: KubeJsonApiData): void;
|
|
79
97
|
export declare type KubeApiWatchCallback = (data: IKubeWatchEvent<KubeJsonApiData>, error: any) => void;
|
|
80
98
|
export declare type KubeApiWatchOptions = {
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
import type { KubeJsonApiData, KubeJsonApiDataList, KubeJsonApiListMetadata, KubeJsonApiMetadata } from "./kube-json-api";
|
|
22
22
|
import type { ItemObject } from "../item.store";
|
|
23
23
|
import type { JsonApiParams } from "./json-api";
|
|
24
|
+
import type { Patch } from "rfc6902";
|
|
24
25
|
export declare type KubeObjectConstructor<K extends KubeObject> = (new (data: KubeJsonApiData | any) => K) & {
|
|
25
26
|
kind?: string;
|
|
26
27
|
namespaced?: boolean;
|
|
@@ -76,6 +77,10 @@ export interface KubeObjectStatus {
|
|
|
76
77
|
}[];
|
|
77
78
|
}
|
|
78
79
|
export declare type KubeMetaField = keyof KubeObjectMetadata;
|
|
80
|
+
export declare class KubeCreationError extends Error {
|
|
81
|
+
data: any;
|
|
82
|
+
constructor(message: string, data: any);
|
|
83
|
+
}
|
|
79
84
|
export declare class KubeObject<Metadata extends KubeObjectMetadata = KubeObjectMetadata, Status = any, Spec = any> implements ItemObject {
|
|
80
85
|
static readonly kind: string;
|
|
81
86
|
static readonly namespaced: boolean;
|
|
@@ -96,7 +101,11 @@ export declare class KubeObject<Metadata extends KubeObjectMetadata = KubeObject
|
|
|
96
101
|
static stringifyLabels(labels?: {
|
|
97
102
|
[name: string]: string;
|
|
98
103
|
}): string[];
|
|
99
|
-
|
|
104
|
+
/**
|
|
105
|
+
* These must be RFC6902 compliant paths
|
|
106
|
+
*/
|
|
107
|
+
private static readonly nonEditiablePathPrefixes;
|
|
108
|
+
private static readonly nonEditablePaths;
|
|
100
109
|
constructor(data: KubeJsonApiData);
|
|
101
110
|
get selfLink(): string;
|
|
102
111
|
getId(): string;
|
|
@@ -119,6 +128,14 @@ export declare class KubeObject<Metadata extends KubeObjectMetadata = KubeObject
|
|
|
119
128
|
}[];
|
|
120
129
|
getSearchFields(): string[];
|
|
121
130
|
toPlainObject(): object;
|
|
131
|
+
patch(patch: Patch): Promise<KubeJsonApiData | null>;
|
|
132
|
+
/**
|
|
133
|
+
* Perform a full update (or more specifically a replace)
|
|
134
|
+
*
|
|
135
|
+
* Note: this is brittle if `data` is not actually partial (but instead whole).
|
|
136
|
+
* As fields such as `resourceVersion` will probably out of date. This is a
|
|
137
|
+
* common race condition.
|
|
138
|
+
*/
|
|
122
139
|
update(data: Partial<this>): Promise<KubeJsonApiData | null>;
|
|
123
140
|
delete(params?: JsonApiParams): Promise<KubeJsonApiData>;
|
|
124
141
|
}
|
|
@@ -25,6 +25,7 @@ import { ItemStore } from "../item.store";
|
|
|
25
25
|
import { IKubeApiQueryParams, KubeApi } from "./kube-api";
|
|
26
26
|
import type { KubeJsonApiData } from "./kube-json-api";
|
|
27
27
|
import type { RequestInit } from "node-fetch";
|
|
28
|
+
import type { Patch } from "rfc6902";
|
|
28
29
|
export interface KubeObjectStoreLoadingParams<K extends KubeObject> {
|
|
29
30
|
namespaces: string[];
|
|
30
31
|
api?: KubeApi<K>;
|
|
@@ -91,6 +92,8 @@ export declare abstract class KubeObjectStore<T extends KubeObject> extends Item
|
|
|
91
92
|
name: string;
|
|
92
93
|
namespace?: string;
|
|
93
94
|
}, data?: Partial<T>): Promise<T>;
|
|
95
|
+
private postUpdate;
|
|
96
|
+
patch(item: T, patch: Patch): Promise<T>;
|
|
94
97
|
update(item: T, data: Partial<T>): Promise<T>;
|
|
95
98
|
remove(item: T): Promise<void>;
|
|
96
99
|
removeSelectedItems(): Promise<void[]>;
|
|
@@ -24,4 +24,6 @@ export interface CatalogViewRouteParam {
|
|
|
24
24
|
kind?: string;
|
|
25
25
|
}
|
|
26
26
|
export declare const catalogRoute: RouteProps;
|
|
27
|
+
export declare const getPreviousTabUrl: (path: string) => string;
|
|
27
28
|
export declare const catalogURL: ({ params, query, fragment }?: import("../utils/buildUrl").URLParams<CatalogViewRouteParam, {}>) => string;
|
|
29
|
+
export declare const browseCatalogTab = "browse";
|
|
@@ -39,6 +39,7 @@ export * from "./network-policies";
|
|
|
39
39
|
export * from "./network";
|
|
40
40
|
export * from "./nodes";
|
|
41
41
|
export * from "./pod-disruption-budgets";
|
|
42
|
+
export * from "./port-forwards";
|
|
42
43
|
export * from "./preferences";
|
|
43
44
|
export * from "./releases";
|
|
44
45
|
export * from "./resource-quotas";
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2021 OpenLens Authors
|
|
3
|
+
*
|
|
4
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
5
|
+
* this software and associated documentation files (the "Software"), to deal in
|
|
6
|
+
* the Software without restriction, including without limitation the rights to
|
|
7
|
+
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
8
|
+
* the Software, and to permit persons to whom the Software is furnished to do so,
|
|
9
|
+
* subject to the following conditions:
|
|
10
|
+
*
|
|
11
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
12
|
+
* copies or substantial portions of the Software.
|
|
13
|
+
*
|
|
14
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
15
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
16
|
+
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
17
|
+
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
18
|
+
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
19
|
+
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
20
|
+
*/
|
|
21
|
+
import type { RouteProps } from "react-router";
|
|
22
|
+
export declare const portForwardsRoute: RouteProps;
|
|
23
|
+
export interface PortForwardsRouteParams {
|
|
24
|
+
}
|
|
25
|
+
export declare const portForwardsURL: ({ params, query, fragment }?: import("../utils/buildUrl").URLParams<PortForwardsRouteParams, {}>) => string;
|
|
@@ -59,5 +59,6 @@ export declare const DESCRIPTORS: {
|
|
|
59
59
|
hiddenTableColumns: PreferenceDescription<[string, string[]][], Map<string, ObservableToggleSet<string>>>;
|
|
60
60
|
syncKubeconfigEntries: PreferenceDescription<KubeconfigSyncEntry[], Map<string, KubeconfigSyncValue>>;
|
|
61
61
|
editorConfiguration: PreferenceDescription<EditorConfiguration, EditorConfiguration>;
|
|
62
|
+
terminalCopyOnSelect: PreferenceDescription<boolean, boolean>;
|
|
62
63
|
};
|
|
63
64
|
export {};
|