@k8slens/extensions 5.3.1-git.448fdd1ef2.0 → 5.3.1-git.7ce4a87ac8.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/k8s-api/cluster-context.d.ts +1 -0
- package/dist/src/common/k8s-api/endpoints/metrics.api.d.ts +2 -0
- package/dist/src/common/k8s-api/endpoints/pods.api.d.ts +2 -0
- package/dist/src/common/k8s-api/kube-api.d.ts +26 -25
- package/dist/src/common/k8s-api/kube-object.d.ts +3 -2
- package/dist/src/common/k8s-api/kube-object.store.d.ts +11 -7
- package/dist/src/common/k8s-api/kube-watch-api.d.ts +7 -30
- package/dist/src/extensions/extension-api.js +660 -2112
- package/dist/src/main/cluster.d.ts +3 -7
- package/dist/src/main/kube-auth-proxy.d.ts +5 -7
- package/dist/src/main/kubeconfig-manager.d.ts +16 -4
- package/dist/src/renderer/bootstrap.d.ts +2 -1
- package/dist/src/renderer/components/+events/kube-event-details.d.ts +1 -1
- package/dist/src/renderer/components/+namespaces/namespace-details.d.ts +0 -1
- package/dist/src/renderer/components/+namespaces/namespace-select.d.ts +0 -1
- package/dist/src/renderer/components/+namespaces/namespace.store.d.ts +1 -1
- package/dist/src/renderer/components/+network-ingresses/ingress-details.d.ts +1 -1
- package/dist/src/renderer/components/+nodes/node-details.d.ts +1 -2
- package/dist/src/renderer/components/+storage-classes/storage-class-details.d.ts +1 -1
- package/dist/src/renderer/components/+storage-volume-claims/volume-claim-details.d.ts +1 -1
- package/dist/src/renderer/components/+workloads-cronjobs/cronjob-details.d.ts +1 -1
- package/dist/src/renderer/components/+workloads-daemonsets/daemonset-details.d.ts +0 -1
- package/dist/src/renderer/components/+workloads-deployments/deployment-details.d.ts +0 -1
- package/dist/src/renderer/components/+workloads-jobs/job-details.d.ts +1 -1
- package/dist/src/renderer/components/+workloads-overview/overview-workload-status.d.ts +2 -7
- package/dist/src/renderer/components/+workloads-overview/overview.d.ts +2 -0
- package/dist/src/renderer/components/+workloads-replicasets/replicaset-details.d.ts +1 -2
- package/dist/src/renderer/components/+workloads-statefulsets/statefulset-details.d.ts +0 -1
- package/dist/src/renderer/components/context.d.ts +8 -1
- package/dist/src/renderer/components/drawer/drawer.d.ts +14 -3
- package/dist/src/renderer/components/getDi.d.ts +22 -0
- package/dist/src/renderer/components/getDiForUnitTesting.d.ts +22 -0
- package/dist/src/renderer/components/hotbar/hotbar-menu.d.ts +3 -0
- package/dist/src/renderer/components/kube-object-list-layout/kube-object-list-layout.d.ts +2 -0
- package/dist/src/renderer/components/resizing-anchor/resizing-anchor.d.ts +3 -1
- package/dist/src/renderer/port-forward/port-forward.store.d.ts +1 -1
- package/package.json +1 -1
|
@@ -106,6 +106,26 @@ export declare type KubeApiWatchOptions = {
|
|
|
106
106
|
timeout?: number;
|
|
107
107
|
};
|
|
108
108
|
export declare type KubeApiPatchType = "merge" | "json" | "strategic";
|
|
109
|
+
export interface ResourceDescriptor {
|
|
110
|
+
/**
|
|
111
|
+
* The name of the kubernetes resource
|
|
112
|
+
*/
|
|
113
|
+
name: string;
|
|
114
|
+
/**
|
|
115
|
+
* The namespace that the resource lives in (if the resource is namespaced)
|
|
116
|
+
*
|
|
117
|
+
* Note: if not provided and the resource kind is namespaced, then this defaults to `"default"`
|
|
118
|
+
*/
|
|
119
|
+
namespace?: string;
|
|
120
|
+
}
|
|
121
|
+
export interface DeleteResourceDescriptor extends ResourceDescriptor {
|
|
122
|
+
/**
|
|
123
|
+
* This determinines how child resources should be handled by kubernetes
|
|
124
|
+
*
|
|
125
|
+
* @default "Background"
|
|
126
|
+
*/
|
|
127
|
+
propagationPolicy?: PropagationPolicy;
|
|
128
|
+
}
|
|
109
129
|
export declare class KubeApi<T extends KubeObject> {
|
|
110
130
|
protected options: IKubeApiOptions<T>;
|
|
111
131
|
readonly kind: string;
|
|
@@ -136,34 +156,15 @@ export declare class KubeApi<T extends KubeObject> {
|
|
|
136
156
|
setResourceVersion(namespace: string, newVersion: string): void;
|
|
137
157
|
getResourceVersion(namespace?: string): string;
|
|
138
158
|
refreshResourceVersion(params?: KubeApiListOptions): Promise<T[]>;
|
|
139
|
-
getUrl({ name, namespace }?:
|
|
140
|
-
name?: string;
|
|
141
|
-
namespace?: string;
|
|
142
|
-
}, query?: Partial<IKubeApiQueryParams>): string;
|
|
159
|
+
getUrl({ name, namespace }?: Partial<ResourceDescriptor>, query?: Partial<IKubeApiQueryParams>): string;
|
|
143
160
|
protected normalizeQuery(query?: Partial<IKubeApiQueryParams>): Partial<IKubeApiQueryParams>;
|
|
144
161
|
protected parseResponse(data: unknown, namespace?: string): T | T[] | null;
|
|
145
162
|
list({ namespace, reqInit }?: KubeApiListOptions, query?: IKubeApiQueryParams): Promise<T[] | null>;
|
|
146
|
-
get(
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
name?: string;
|
|
152
|
-
namespace?: string;
|
|
153
|
-
}, data?: Partial<T>): Promise<T | null>;
|
|
154
|
-
update({ name, namespace }?: {
|
|
155
|
-
name?: string;
|
|
156
|
-
namespace?: string;
|
|
157
|
-
}, data?: Partial<T>): Promise<T | null>;
|
|
158
|
-
patch({ name, namespace }?: {
|
|
159
|
-
name?: string;
|
|
160
|
-
namespace?: string;
|
|
161
|
-
}, data?: Partial<T> | Patch, strategy?: KubeApiPatchType): Promise<T | null>;
|
|
162
|
-
delete({ name, namespace, propagationPolicy }: {
|
|
163
|
-
name: string;
|
|
164
|
-
namespace?: string;
|
|
165
|
-
propagationPolicy?: PropagationPolicy;
|
|
166
|
-
}): Promise<KubeJsonApiData>;
|
|
163
|
+
get(desc: ResourceDescriptor, query?: IKubeApiQueryParams): Promise<T | null>;
|
|
164
|
+
create({ name, namespace }: Partial<ResourceDescriptor>, data?: Partial<T>): Promise<T | null>;
|
|
165
|
+
update({ name, namespace }: ResourceDescriptor, data: Partial<T>): Promise<T | null>;
|
|
166
|
+
patch(desc: ResourceDescriptor, data?: Partial<T> | Patch, strategy?: KubeApiPatchType): Promise<T | null>;
|
|
167
|
+
delete({ propagationPolicy, ...desc }: DeleteResourceDescriptor): Promise<KubeJsonApiData>;
|
|
167
168
|
getWatchUrl(namespace?: string, query?: IKubeApiQueryParams): string;
|
|
168
169
|
watch(opts?: KubeApiWatchOptions): () => void;
|
|
169
170
|
protected modifyWatchEvent(event: IKubeWatchEvent<KubeJsonApiData>): void;
|
|
@@ -82,8 +82,9 @@ export declare class KubeCreationError extends Error {
|
|
|
82
82
|
constructor(message: string, data: any);
|
|
83
83
|
}
|
|
84
84
|
export declare class KubeObject<Metadata extends KubeObjectMetadata = KubeObjectMetadata, Status = any, Spec = any> implements ItemObject {
|
|
85
|
-
static readonly kind
|
|
86
|
-
static readonly namespaced
|
|
85
|
+
static readonly kind?: string;
|
|
86
|
+
static readonly namespaced?: boolean;
|
|
87
|
+
static readonly apiBase?: string;
|
|
87
88
|
apiVersion: string;
|
|
88
89
|
kind: string;
|
|
89
90
|
metadata: Metadata;
|
|
@@ -25,10 +25,10 @@ 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 AbortController from "abort-controller";
|
|
28
29
|
import type { Patch } from "rfc6902";
|
|
29
|
-
export interface KubeObjectStoreLoadingParams
|
|
30
|
+
export interface KubeObjectStoreLoadingParams {
|
|
30
31
|
namespaces: string[];
|
|
31
|
-
api?: KubeApi<K>;
|
|
32
32
|
reqInit?: RequestInit;
|
|
33
33
|
/**
|
|
34
34
|
* A function that is called when listing fails. If set then blocks errors
|
|
@@ -52,6 +52,10 @@ export interface KubeObjectStoreSubscribeParams {
|
|
|
52
52
|
* being rejected with
|
|
53
53
|
*/
|
|
54
54
|
onLoadFailure?: (err: any) => void;
|
|
55
|
+
/**
|
|
56
|
+
* An optional parent abort controller
|
|
57
|
+
*/
|
|
58
|
+
abortController?: AbortController;
|
|
55
59
|
}
|
|
56
60
|
export declare abstract class KubeObjectStore<T extends KubeObject> extends ItemStore<T> {
|
|
57
61
|
static defaultContext: import("mobx").IObservableValue<ClusterContext>;
|
|
@@ -78,16 +82,16 @@ export declare abstract class KubeObjectStore<T extends KubeObject> extends Item
|
|
|
78
82
|
getByLabel(labels: string[] | {
|
|
79
83
|
[label: string]: string;
|
|
80
84
|
}): T[];
|
|
81
|
-
protected loadItems({ namespaces,
|
|
85
|
+
protected loadItems({ namespaces, reqInit, onLoadFailure }: KubeObjectStoreLoadingParams): Promise<T[]>;
|
|
82
86
|
protected filterItemsOnLoad(items: T[]): T[];
|
|
83
|
-
loadAll(
|
|
87
|
+
loadAll({ namespaces, merge, reqInit, onLoadFailure }?: KubeObjectStoreLoadAllParams): Promise<void | T[]>;
|
|
84
88
|
reloadAll(opts?: {
|
|
85
89
|
force?: boolean;
|
|
86
90
|
namespaces?: string[];
|
|
87
91
|
merge?: boolean;
|
|
88
92
|
}): Promise<void | T[]>;
|
|
89
|
-
protected mergeItems(partialItems: T[], {
|
|
90
|
-
|
|
93
|
+
protected mergeItems(partialItems: T[], { merge, updateStore, sort, filter }?: {
|
|
94
|
+
merge?: boolean;
|
|
91
95
|
updateStore?: boolean;
|
|
92
96
|
sort?: boolean;
|
|
93
97
|
filter?: boolean;
|
|
@@ -117,7 +121,7 @@ export declare abstract class KubeObjectStore<T extends KubeObject> extends Item
|
|
|
117
121
|
removeSelectedItems(): Promise<void[]>;
|
|
118
122
|
protected eventsBuffer: import("mobx").IObservableArray<IKubeWatchEvent<KubeJsonApiData>>;
|
|
119
123
|
protected bindWatchEventsUpdater(delay?: number): void;
|
|
120
|
-
subscribe(
|
|
124
|
+
subscribe({ onLoadFailure, abortController }?: KubeObjectStoreSubscribeParams): () => void;
|
|
121
125
|
private watchNamespace;
|
|
122
126
|
protected updateFromEventsBuffer(): void;
|
|
123
127
|
}
|
|
@@ -21,57 +21,34 @@
|
|
|
21
21
|
import type { KubeObjectStore } from "./kube-object.store";
|
|
22
22
|
import type { ClusterContext } from "./cluster-context";
|
|
23
23
|
import { Disposer } from "../utils";
|
|
24
|
-
import type { KubeApi } from "./kube-api";
|
|
25
24
|
import type { KubeJsonApiData } from "./kube-json-api";
|
|
26
25
|
import type { KubeObject } from "./kube-object";
|
|
27
26
|
export interface IKubeWatchEvent<T extends KubeJsonApiData> {
|
|
28
27
|
type: "ADDED" | "MODIFIED" | "DELETED" | "ERROR";
|
|
29
28
|
object?: T;
|
|
30
29
|
}
|
|
31
|
-
interface
|
|
30
|
+
export interface KubeWatchSubscribeStoreOptions {
|
|
32
31
|
/**
|
|
33
32
|
* The namespaces to watch
|
|
34
|
-
* @default all
|
|
33
|
+
* @default all selected namespaces
|
|
35
34
|
*/
|
|
36
35
|
namespaces?: string[];
|
|
37
|
-
/**
|
|
38
|
-
* Whether to skip loading if the store is already loaded
|
|
39
|
-
* @default false
|
|
40
|
-
*/
|
|
41
|
-
loadOnce?: boolean;
|
|
42
36
|
/**
|
|
43
37
|
* A function that is called when listing fails. If set then blocks errors
|
|
44
38
|
* being rejected with
|
|
45
39
|
*/
|
|
46
40
|
onLoadFailure?: (err: any) => void;
|
|
47
41
|
}
|
|
48
|
-
export interface KubeWatchSubscribeStoreOptions extends KubeWatchPreloadOptions {
|
|
49
|
-
/**
|
|
50
|
-
* Whether to subscribe only after loading all stores
|
|
51
|
-
* @default true
|
|
52
|
-
*/
|
|
53
|
-
waitUntilLoaded?: boolean;
|
|
54
|
-
/**
|
|
55
|
-
* Whether to preload the stores before watching
|
|
56
|
-
* @default true
|
|
57
|
-
*/
|
|
58
|
-
preload?: boolean;
|
|
59
|
-
}
|
|
60
42
|
export interface IKubeWatchLog {
|
|
61
43
|
message: string | string[] | Error;
|
|
62
44
|
meta?: object;
|
|
63
45
|
cssStyle?: string;
|
|
64
46
|
}
|
|
65
47
|
export declare class KubeWatchApi {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
cancelLoading: () => void;
|
|
72
|
-
};
|
|
73
|
-
subscribeStores(stores: KubeObjectStore<KubeObject>[], opts?: KubeWatchSubscribeStoreOptions): Disposer;
|
|
74
|
-
protected log({ message, cssStyle, meta }: IKubeWatchLog): void;
|
|
48
|
+
#private;
|
|
49
|
+
static context: ClusterContext;
|
|
50
|
+
private subscribeStore;
|
|
51
|
+
subscribeStores(stores: KubeObjectStore<KubeObject>[], { namespaces, onLoadFailure }?: KubeWatchSubscribeStoreOptions): Disposer;
|
|
52
|
+
protected log(message: any, meta: any): void;
|
|
75
53
|
}
|
|
76
54
|
export declare const kubeWatchApi: KubeWatchApi;
|
|
77
|
-
export {};
|