@k8slens/extensions 6.3.0-git.fbaa9de007.0 → 6.3.1-git.6aee907dc5.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/src/common/cluster/cluster.d.ts +13 -23
- package/dist/src/common/cluster/request-namespace-list-permissions.injectable.d.ts +18 -0
- package/dist/src/common/cluster-store/allowed-resources-injection-token.d.ts +2 -1
- package/dist/src/common/fetch/download-json/impl.d.ts +11 -0
- package/dist/src/common/fetch/download-json/normal.injectable.d.ts +2 -0
- package/dist/src/common/fetch/download-json/proxy.injectable.d.ts +2 -0
- package/dist/src/common/fetch/fetch-module.injectable.d.ts +7 -0
- package/dist/src/common/fetch/fetch.injectable.d.ts +1 -3
- package/dist/src/common/fetch/proxy-fetch.injectable.d.ts +3 -0
- package/dist/src/common/k8s-api/api-base-configs.d.ts +6 -0
- package/dist/src/common/k8s-api/api-base.injectable.d.ts +2 -0
- package/dist/src/common/k8s-api/api-manager/resource.store.d.ts +2 -1
- package/dist/src/common/k8s-api/endpoints/helm-charts.api/request-readme.injectable.d.ts +2 -1
- package/dist/src/common/k8s-api/endpoints/helm-charts.api/request-values.injectable.d.ts +2 -1
- package/dist/src/common/k8s-api/endpoints/resource-applier.api/request-patch.injectable.d.ts +2 -1
- package/dist/src/common/k8s-api/endpoints/resource-applier.api/request-update.injectable.d.ts +2 -1
- package/dist/src/common/k8s-api/kube-api.d.ts +5 -4
- package/dist/src/common/k8s-api/kube-object.store.d.ts +8 -16
- package/dist/src/common/logger.d.ts +2 -2
- package/dist/src/common/rbac.d.ts +12 -4
- package/dist/src/common/utils/computed-or.d.ts +6 -0
- package/dist/src/common/utils/iter.d.ts +2 -2
- package/dist/src/common/utils/with-concurrency-limit.d.ts +2 -0
- package/dist/src/common/vars.d.ts +0 -16
- package/dist/src/extensions/common-api/k8s-api.d.ts +21 -1
- package/dist/src/extensions/extension-api.js +2573 -1406
- package/dist/src/extensions/extension-discovery/bundled-extension-token.d.ts +11 -0
- package/dist/src/extensions/extension-discovery/extension-discovery.d.ts +1 -4
- package/dist/src/{common/configure-packages.d.ts → extensions/extension-loader/entry-point-name.d.ts} +1 -4
- package/dist/src/extensions/extension-loader/extension-loader.d.ts +12 -8
- package/dist/src/extensions/renderer-api/k8s-api.d.ts +1 -1
- package/dist/src/main/cluster/request-api-resources.injectable.d.ts +13 -0
- package/dist/src/main/cluster/request-api-versions.d.ts +11 -0
- package/dist/src/main/cluster/request-core-api-versions.injectable.d.ts +5 -0
- package/dist/src/main/cluster/request-kube-api-resources-for.injectable.d.ts +7 -0
- package/dist/src/main/cluster/request-non-core-api-versions.injectable.d.ts +5 -0
- package/dist/src/main/create-cluster/allowed-resources.injectable.d.ts +2 -1
- package/dist/src/main/extension-loader/entry-point-name.injectable.d.ts +2 -0
- package/dist/src/main/k8s/api-base-host-header.injectable.d.ts +2 -0
- package/dist/src/main/k8s/api-base-server-address.injectable.d.ts +2 -0
- package/dist/src/main/k8s-request.injectable.d.ts +2 -2
- package/dist/src/main/routes/resource-applier/create-resource-route.injectable.d.ts +5 -5
- package/dist/src/main/shell-session/node-shell-session/open.injectable.d.ts +2 -1
- package/dist/src/renderer/before-frame-starts/tokens.d.ts +5 -3
- package/dist/src/renderer/cluster/accessible-namespaces.injectable.d.ts +2 -0
- package/dist/src/renderer/{create-cluster → cluster}/create-cluster.injectable.d.ts +0 -0
- package/dist/src/renderer/cluster-frame-context/cluster-frame-context.d.ts +9 -14
- package/dist/src/renderer/cluster-frame-context/for-cluster-scoped-resources.injectable.d.ts +3 -0
- package/dist/src/renderer/cluster-frame-context/for-namespaced-resources.injectable.d.ts +3 -0
- package/dist/src/renderer/cluster-frame-context/should-show-resource.injectable.d.ts +3 -0
- package/dist/src/renderer/components/+cluster/cluster-overview-store/cluster-overview-store.d.ts +2 -1
- package/dist/src/renderer/components/+custom-resources/definition.store.d.ts +2 -2
- package/dist/src/renderer/components/+events/store.d.ts +4 -5
- package/dist/src/renderer/components/+namespaces/store.d.ts +5 -6
- package/dist/src/renderer/components/+nodes/store.d.ts +2 -2
- package/dist/src/renderer/components/+storage-classes/store.d.ts +2 -2
- package/dist/src/renderer/components/+workloads-cronjobs/store.d.ts +2 -2
- package/dist/src/renderer/components/+workloads-daemonsets/store.d.ts +2 -2
- package/dist/src/renderer/components/+workloads-deployments/store.d.ts +2 -2
- package/dist/src/renderer/components/+workloads-jobs/store.d.ts +2 -2
- package/dist/src/renderer/components/+workloads-overview/workloads/implementations/cron-jobs-workload.injectable.d.ts +4 -1
- package/dist/src/renderer/components/+workloads-overview/workloads/implementations/daemonsets-workload.injectable.d.ts +4 -1
- package/dist/src/renderer/components/+workloads-overview/workloads/implementations/deployments-workload.injectable.d.ts +4 -1
- package/dist/src/renderer/components/+workloads-overview/workloads/implementations/jobs-workload.injectable.d.ts +4 -1
- package/dist/src/renderer/components/+workloads-overview/workloads/implementations/pods-workload.injectable.d.ts +4 -1
- package/dist/src/renderer/components/+workloads-overview/workloads/implementations/replicasets-workload.injectable.d.ts +4 -1
- package/dist/src/renderer/components/+workloads-overview/workloads/implementations/statefulsets-workload.injectable.d.ts +4 -1
- package/dist/src/renderer/components/+workloads-overview/workloads/workload-injection-token.d.ts +2 -1
- package/dist/src/renderer/components/+workloads-overview/workloads/workloads.injectable.d.ts +1 -2
- package/dist/src/renderer/components/+workloads-pods/load-pods-from-all-namespaces.injectable.d.ts +6 -0
- package/dist/src/renderer/components/+workloads-pods/store.d.ts +2 -2
- package/dist/src/renderer/components/+workloads-replicasets/store.d.ts +4 -5
- package/dist/src/renderer/components/+workloads-statefulsets/store.d.ts +2 -2
- package/dist/src/renderer/components/input/search-input.d.ts +1 -11
- package/dist/src/renderer/components/test-utils/get-application-builder.d.ts +2 -2
- package/dist/src/renderer/extension-loader/entry-point-name.injectable.d.ts +2 -0
- package/dist/src/renderer/frames/cluster-frame/init-cluster-frame/init-cluster-frame.d.ts +5 -3
- package/dist/src/renderer/frames/load-extensions.injectable.d.ts +1 -4
- package/dist/src/renderer/k8s/api-base-host-header.injectable.d.ts +2 -0
- package/dist/src/renderer/k8s/api-base-server-address.injectable.d.ts +2 -0
- package/dist/src/renderer/kube-watch-api/kube-watch-api.d.ts +3 -3
- package/dist/src/renderer/navigation/events.d.ts +0 -2
- package/dist/src/renderer/navigation/setup-logging-for-navigation.injectable.d.ts +5 -0
- package/dist/src/test-utils/mock-responses.d.ts +8 -0
- package/package.json +1 -1
- package/dist/src/common/cluster/authorization-namespace-review.injectable.d.ts +0 -19
- package/dist/src/common/cluster/is-allowed-resource.d.ts +0 -1
- package/dist/src/common/cluster/list-api-resources.injectable.d.ts +0 -13
- package/dist/src/common/fetch/download-json.injectable.d.ts +0 -7
- package/dist/src/common/k8s-api/api-base.d.ts +0 -6
- package/dist/src/common/k8s-api/api-manager/auto-registration.injectable.d.ts +0 -2
- package/dist/src/common/k8s-api/cluster-context.d.ts +0 -11
- package/dist/src/common/utils/is-allowed-resource.injectable.d.ts +0 -4
- package/dist/src/main/k8s/api-base.injectable.d.ts +0 -2
- package/dist/src/renderer/cluster-frame-context/allowed-resources.injectable.d.ts +0 -2
- package/dist/src/renderer/cluster-frame-context/cluster-frame-context.injectable.d.ts +0 -3
- package/dist/src/renderer/k8s/api-base.injectable.d.ts +0 -2
@@ -6,7 +6,7 @@ import type { ClusterContextHandler } from "../../main/context-handler/context-h
|
|
6
6
|
import type { 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
|
-
import type {
|
9
|
+
import type { KubeApiResourceDescriptor } from "../rbac";
|
10
10
|
import type { VersionDetector } from "../../main/cluster-detectors/version-detector";
|
11
11
|
import type { DetectorRegistry } from "../../main/cluster-detectors/detector-registry";
|
12
12
|
import type { ClusterState, ClusterMetricsResourceType, ClusterId, ClusterMetadata, ClusterModel, ClusterPreferences, ClusterPrometheusPreferences, UpdateClusterModel, ClusterConfigData } from "../cluster-types";
|
@@ -16,8 +16,8 @@ import type { ListNamespaces } from "./list-namespaces.injectable";
|
|
16
16
|
import type { Logger } from "../logger";
|
17
17
|
import type { BroadcastMessage } from "../ipc/broadcast-message.injectable";
|
18
18
|
import type { LoadConfigfromFile } from "../kube-helpers/load-config-from-file.injectable";
|
19
|
-
import type {
|
20
|
-
import type {
|
19
|
+
import type { RequestNamespaceListPermissions, RequestNamespaceListPermissionsFor } from "./request-namespace-list-permissions.injectable";
|
20
|
+
import type { RequestApiResources } from "../../main/cluster/request-api-resources.injectable";
|
21
21
|
export interface ClusterDependencies {
|
22
22
|
readonly directoryForKubeConfigs: string;
|
23
23
|
readonly logger: Logger;
|
@@ -26,8 +26,8 @@ export interface ClusterDependencies {
|
|
26
26
|
createContextHandler: (cluster: Cluster) => ClusterContextHandler;
|
27
27
|
createKubectl: (clusterVersion: string) => Kubectl;
|
28
28
|
createAuthorizationReview: (config: KubeConfig) => CanI;
|
29
|
-
|
30
|
-
|
29
|
+
requestApiResources: RequestApiResources;
|
30
|
+
requestNamespaceListPermissionsFor: RequestNamespaceListPermissionsFor;
|
31
31
|
createListNamespaces: (config: KubeConfig) => ListNamespaces;
|
32
32
|
createVersionDetector: (cluster: Cluster) => VersionDetector;
|
33
33
|
broadcastMessage: BroadcastMessage;
|
@@ -38,7 +38,7 @@ export interface ClusterDependencies {
|
|
38
38
|
*
|
39
39
|
* @beta
|
40
40
|
*/
|
41
|
-
export declare class Cluster implements ClusterModel
|
41
|
+
export declare class Cluster implements ClusterModel {
|
42
42
|
private readonly dependencies;
|
43
43
|
/** Unique id for a cluster */
|
44
44
|
readonly id: ClusterId;
|
@@ -52,7 +52,6 @@ export declare class Cluster implements ClusterModel, ClusterState {
|
|
52
52
|
protected readonly _proxyKubeconfigManager: KubeconfigManager | undefined;
|
53
53
|
protected readonly eventsDisposer: import("../utils").ExtendableDisposer;
|
54
54
|
protected activated: boolean;
|
55
|
-
private readonly resourceAccessStatuses;
|
56
55
|
get contextHandler(): ClusterContextHandler;
|
57
56
|
protected get proxyKubeconfigManager(): KubeconfigManager;
|
58
57
|
get whenReady(): Promise<void> & {
|
@@ -140,23 +139,14 @@ export declare class Cluster implements ClusterModel, ClusterState {
|
|
140
139
|
metadata: ClusterMetadata;
|
141
140
|
/**
|
142
141
|
* List of allowed namespaces verified via K8S::SelfSubjectAccessReview api
|
143
|
-
*
|
144
|
-
* @observable
|
145
142
|
*/
|
146
|
-
allowedNamespaces: string
|
147
|
-
/**
|
148
|
-
* List of allowed resources
|
149
|
-
*
|
150
|
-
* @observable
|
151
|
-
* @internal
|
152
|
-
*/
|
153
|
-
allowedResources: string[];
|
143
|
+
readonly allowedNamespaces: import("mobx").IObservableArray<string>;
|
154
144
|
/**
|
155
145
|
* List of accessible namespaces provided by user in the Cluster Settings
|
156
|
-
*
|
157
|
-
* @observable
|
158
146
|
*/
|
159
|
-
accessibleNamespaces: string
|
147
|
+
readonly accessibleNamespaces: import("mobx").IObservableArray<string>;
|
148
|
+
private readonly knownResources;
|
149
|
+
private readonly allowedResources;
|
160
150
|
/**
|
161
151
|
* Labels for the catalog entity
|
162
152
|
*/
|
@@ -280,9 +270,9 @@ export declare class Cluster implements ClusterModel, ClusterState {
|
|
280
270
|
* @internal
|
281
271
|
*/
|
282
272
|
broadcastConnectUpdate(message: string, isError?: boolean): void;
|
283
|
-
protected
|
284
|
-
protected getAllowedResources(
|
285
|
-
|
273
|
+
protected requestAllowedNamespaces(proxyConfig: KubeConfig): Promise<string[]>;
|
274
|
+
protected getAllowedResources(requestNamespaceListPermissions: RequestNamespaceListPermissions): Promise<string[]>;
|
275
|
+
shouldShowResource(resource: KubeApiResourceDescriptor): boolean;
|
286
276
|
isMetricHidden(resource: ClusterMetricsResourceType): boolean;
|
287
277
|
get nodeShellImage(): string;
|
288
278
|
get imagePullSecret(): string | undefined;
|
@@ -0,0 +1,18 @@
|
|
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 { KubeConfig } from "@kubernetes/client-node";
|
6
|
+
import type { KubeApiResource } from "../rbac";
|
7
|
+
export type CanListResource = (resource: KubeApiResource) => boolean;
|
8
|
+
/**
|
9
|
+
* Requests the permissions for actions on the kube cluster
|
10
|
+
* @param namespace The namespace of the resources
|
11
|
+
*/
|
12
|
+
export type RequestNamespaceListPermissions = (namespace: string) => Promise<CanListResource>;
|
13
|
+
/**
|
14
|
+
* @param proxyConfig This config's `currentContext` field must be set, and will be used as the target cluster
|
15
|
+
*/
|
16
|
+
export type RequestNamespaceListPermissionsFor = (proxyConfig: KubeConfig) => RequestNamespaceListPermissions;
|
17
|
+
declare const requestNamespaceListPermissionsForInjectable: import("@ogre-tools/injectable").Injectable<RequestNamespaceListPermissionsFor, unknown, void>;
|
18
|
+
export default requestNamespaceListPermissionsForInjectable;
|
@@ -3,4 +3,5 @@
|
|
3
3
|
* Licensed under MIT License. See LICENSE in root directory for more information.
|
4
4
|
*/
|
5
5
|
import type { IComputedValue } from "mobx";
|
6
|
-
|
6
|
+
import type { KubeApiResourceDescriptor } from "../rbac";
|
7
|
+
export declare const shouldShowResourceInjectionToken: import("@ogre-tools/injectable").InjectionToken<IComputedValue<boolean>, KubeApiResourceDescriptor>;
|
@@ -0,0 +1,11 @@
|
|
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 { AsyncResult } from "../../utils/async-result";
|
6
|
+
import type { Fetch } from "../fetch.injectable";
|
7
|
+
export interface DownloadJsonOptions {
|
8
|
+
signal?: AbortSignal | null | undefined;
|
9
|
+
}
|
10
|
+
export type DownloadJson = (url: string, opts?: DownloadJsonOptions) => Promise<AsyncResult<unknown, string>>;
|
11
|
+
export declare const downloadJsonWith: (fetch: Fetch) => DownloadJson;
|
@@ -0,0 +1,7 @@
|
|
1
|
+
import type * as FetchModule from "node-fetch";
|
2
|
+
/**
|
3
|
+
* NOTE: while using this module can cause side effects, this specific injectable is not marked as
|
4
|
+
* such since sometimes the request can be wholely within the perview of unit test
|
5
|
+
*/
|
6
|
+
declare const nodeFetchModuleInjectable: import("@ogre-tools/injectable").Injectable<typeof FetchModule, unknown, void>;
|
7
|
+
export default nodeFetchModuleInjectable;
|
@@ -1,6 +1,4 @@
|
|
1
|
-
import type
|
2
|
-
type Response = FetchModule.Response;
|
3
|
-
type RequestInit = FetchModule.RequestInit;
|
1
|
+
import type { RequestInit, Response } from "node-fetch";
|
4
2
|
export type Fetch = (url: string, init?: RequestInit) => Promise<Response>;
|
5
3
|
declare const fetchInjectable: import("@ogre-tools/injectable").Injectable<Fetch, unknown, void>;
|
6
4
|
export default fetchInjectable;
|
@@ -0,0 +1,6 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright (c) OpenLens Authors. All rights reserved.
|
3
|
+
* Licensed under MIT License. See LICENSE in root directory for more information.
|
4
|
+
*/
|
5
|
+
export declare const apiBaseServerAddressInjectionToken: import("@ogre-tools/injectable").InjectionToken<string, void>;
|
6
|
+
export declare const apiBaseHostHeaderInjectionToken: import("@ogre-tools/injectable").InjectionToken<string, void>;
|
@@ -3,8 +3,9 @@
|
|
3
3
|
* Licensed under MIT License. See LICENSE in root directory for more information.
|
4
4
|
*/
|
5
5
|
import type { KubeApi } from "../kube-api";
|
6
|
+
import type { KubeObjectStoreDependencies } from "../kube-object.store";
|
6
7
|
import { KubeObjectStore } from "../kube-object.store";
|
7
8
|
import type { KubeObject } from "../kube-object";
|
8
9
|
export declare class CustomResourceStore<K extends KubeObject> extends KubeObjectStore<K, KubeApi<K>> {
|
9
|
-
constructor(api: KubeApi<K>);
|
10
|
+
constructor(deps: KubeObjectStoreDependencies, api: KubeApi<K>);
|
10
11
|
}
|
@@ -1,3 +1,4 @@
|
|
1
|
-
|
1
|
+
import type { AsyncResult } from "../../../utils/async-result";
|
2
|
+
export type RequestHelmChartReadme = (repo: string, name: string, version?: string) => Promise<AsyncResult<string>>;
|
2
3
|
declare const requestHelmChartReadmeInjectable: import("@ogre-tools/injectable").Injectable<RequestHelmChartReadme, unknown, void>;
|
3
4
|
export default requestHelmChartReadmeInjectable;
|
@@ -1,3 +1,4 @@
|
|
1
|
-
|
1
|
+
import type { AsyncResult } from "../../../utils/async-result";
|
2
|
+
export type RequestHelmChartValues = (repo: string, name: string, version: string) => Promise<AsyncResult<string>>;
|
2
3
|
declare const requestHelmChartValuesInjectable: import("@ogre-tools/injectable").Injectable<RequestHelmChartValues, unknown, void>;
|
3
4
|
export default requestHelmChartValuesInjectable;
|
package/dist/src/common/k8s-api/endpoints/resource-applier.api/request-patch.injectable.d.ts
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
import type { Patch } from "rfc6902";
|
2
|
+
import type { AsyncResult } from "../../../utils/async-result";
|
2
3
|
import type { KubeJsonApiData } from "../../kube-json-api";
|
3
|
-
export type RequestKubeObjectPatch = (name: string, kind: string, ns: string | undefined, patch: Patch) => Promise<KubeJsonApiData
|
4
|
+
export type RequestKubeObjectPatch = (name: string, kind: string, ns: string | undefined, patch: Patch) => Promise<AsyncResult<KubeJsonApiData, string>>;
|
4
5
|
declare const requestKubeObjectPatchInjectable: import("@ogre-tools/injectable").Injectable<RequestKubeObjectPatch, unknown, void>;
|
5
6
|
export default requestKubeObjectPatchInjectable;
|
package/dist/src/common/k8s-api/endpoints/resource-applier.api/request-update.injectable.d.ts
CHANGED
@@ -1,4 +1,5 @@
|
|
1
|
+
import type { AsyncResult } from "../../../utils/async-result";
|
1
2
|
import type { KubeJsonApiData } from "../../kube-json-api";
|
2
|
-
export type RequestKubeObjectCreation = (resourceDescriptor: string) => Promise<KubeJsonApiData
|
3
|
+
export type RequestKubeObjectCreation = (resourceDescriptor: string) => Promise<AsyncResult<KubeJsonApiData, string>>;
|
3
4
|
declare const requestKubeObjectCreationInjectable: import("@ogre-tools/injectable").Injectable<RequestKubeObjectCreation, unknown, void>;
|
4
5
|
export default requestKubeObjectCreationInjectable;
|
@@ -210,15 +210,16 @@ export declare class KubeApi<Object extends KubeObject = KubeObject, Data extend
|
|
210
210
|
private computeApiBase;
|
211
211
|
/**
|
212
212
|
* This method differs from {@link formatUrlForNotListing} because this treats `""` as "all namespaces"
|
213
|
+
* NOTE: This is also useful for watching
|
213
214
|
* @param namespace The namespace to list in or `""` for all namespaces
|
214
215
|
*/
|
215
|
-
formatUrlForListing(namespace: string): string;
|
216
|
+
formatUrlForListing(namespace: string | undefined, query?: Partial<KubeApiQueryParams>): string;
|
216
217
|
/**
|
217
218
|
* Format a URL pathname and query for acting upon a specific resource.
|
218
219
|
*/
|
219
|
-
formatUrlForNotListing(
|
220
|
+
formatUrlForNotListing({ name, namespace }?: Partial<ResourceDescriptor>): string;
|
220
221
|
/**
|
221
|
-
* @deprecated use {@link formatUrlForNotListing} instead
|
222
|
+
* @deprecated use {@link formatUrlForNotListing} or {@link formatUrlForListing} instead
|
222
223
|
*/
|
223
224
|
getUrl(resource?: Partial<ResourceDescriptor>, query?: Partial<KubeApiQueryParams>): string;
|
224
225
|
protected normalizeQuery(query?: Partial<KubeApiQueryParams>): Partial<KubeApiQueryParams>;
|
@@ -234,6 +235,6 @@ export declare class KubeApi<Object extends KubeObject = KubeObject, Data extend
|
|
234
235
|
patch(desc: ResourceDescriptor, data: PartialDeep<Object> | Patch, strategy: KubeApiPatchType): Promise<Object | null>;
|
235
236
|
delete({ propagationPolicy, ...desc }: DeleteResourceDescriptor): Promise<KubeJsonApiData<import("./kube-object").KubeJsonApiObjectMetadata<import("./kube-object").KubeObjectScope>, unknown, unknown>>;
|
236
237
|
getWatchUrl(namespace?: string, query?: KubeApiQueryParams): string;
|
237
|
-
watch(opts?: KubeApiWatchOptions<Object, Data>):
|
238
|
+
watch(opts?: KubeApiWatchOptions<Object, Data>): Disposer;
|
238
239
|
protected modifyWatchEvent(event: IKubeWatchEvent<KubeJsonApiData<KubeObjectMetadata>>): void;
|
239
240
|
}
|
@@ -2,7 +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
|
-
import type { ClusterContext } from "./cluster-context";
|
6
5
|
import type { Disposer } from "../utils";
|
7
6
|
import type { KubeJsonApiDataFor, KubeObject } from "./kube-object";
|
8
7
|
import type { IKubeWatchEvent } from "./kube-watch-event";
|
@@ -12,6 +11,7 @@ import type { RequestInit } from "node-fetch";
|
|
12
11
|
import type { Patch } from "rfc6902";
|
13
12
|
import type { PartialDeep } from "type-fest";
|
14
13
|
import AbortController from "abort-controller";
|
14
|
+
import type { ClusterContext } from "../../renderer/cluster-frame-context/cluster-frame-context";
|
15
15
|
export type OnLoadFailure = (error: unknown) => void;
|
16
16
|
export interface KubeObjectStoreLoadingParams {
|
17
17
|
namespaces: string[];
|
@@ -59,24 +59,16 @@ export interface KubeObjectStoreOptions {
|
|
59
59
|
}
|
60
60
|
export type KubeApiDataFrom<K extends KubeObject, A> = A extends KubeApi<K, infer D> ? D extends KubeJsonApiDataFor<K> ? D : never : never;
|
61
61
|
export type JsonPatch = Patch;
|
62
|
+
export interface KubeObjectStoreDependencies {
|
63
|
+
readonly context: ClusterContext;
|
64
|
+
}
|
62
65
|
export declare abstract class KubeObjectStore<K extends KubeObject = KubeObject, A extends KubeApi<K, D> = KubeApi<K, KubeJsonApiDataFor<K>>, D extends KubeJsonApiDataFor<K> = KubeApiDataFrom<K, A>> extends ItemStore<K> {
|
63
|
-
|
66
|
+
protected readonly dependencies: KubeObjectStoreDependencies;
|
64
67
|
readonly api: A;
|
65
68
|
readonly limit: number | undefined;
|
66
69
|
readonly bufferSize: number;
|
67
|
-
private loadedNamespaces;
|
68
|
-
|
69
|
-
cancel(): void;
|
70
|
-
};
|
71
|
-
get namespacesReady(): Promise<void> & {
|
72
|
-
cancel(): void;
|
73
|
-
};
|
74
|
-
constructor(api: A, opts?: KubeObjectStoreOptions);
|
75
|
-
/**
|
76
|
-
* @deprecated Supply API instance through constructor
|
77
|
-
*/
|
78
|
-
constructor();
|
79
|
-
get context(): ClusterContext | undefined;
|
70
|
+
private readonly loadedNamespaces;
|
71
|
+
constructor(dependencies: KubeObjectStoreDependencies, api: A, opts?: KubeObjectStoreOptions);
|
80
72
|
get contextItems(): K[];
|
81
73
|
getTotalCount(): number;
|
82
74
|
get query(): KubeApiQueryParams;
|
@@ -118,7 +110,7 @@ export declare abstract class KubeObjectStore<K extends KubeObject = KubeObject,
|
|
118
110
|
remove(item: K): Promise<void>;
|
119
111
|
removeSelectedItems(): Promise<void>;
|
120
112
|
removeItems(items: K[]): Promise<void>;
|
121
|
-
protected eventsBuffer: import("mobx").IObservableArray<IKubeWatchEvent<D>>;
|
113
|
+
protected readonly eventsBuffer: import("mobx").IObservableArray<IKubeWatchEvent<D>>;
|
122
114
|
protected bindWatchEventsUpdater(delay?: number): void;
|
123
115
|
subscribe({ onLoadFailure, abortController }?: KubeObjectStoreSubscribeParams): Disposer;
|
124
116
|
private watchNamespace;
|
@@ -3,12 +3,20 @@
|
|
3
3
|
* Licensed under MIT License. See LICENSE in root directory for more information.
|
4
4
|
*/
|
5
5
|
export type KubeResource = "namespaces" | "nodes" | "events" | "resourcequotas" | "services" | "limitranges" | "leases" | "secrets" | "configmaps" | "ingresses" | "networkpolicies" | "persistentvolumeclaims" | "persistentvolumes" | "storageclasses" | "pods" | "daemonsets" | "deployments" | "statefulsets" | "replicasets" | "jobs" | "cronjobs" | "endpoints" | "customresourcedefinitions" | "horizontalpodautoscalers" | "podsecuritypolicies" | "poddisruptionbudgets" | "priorityclasses" | "runtimeclasses" | "roles" | "clusterroles" | "rolebindings" | "clusterrolebindings" | "serviceaccounts";
|
6
|
-
export interface KubeApiResource
|
7
|
-
|
6
|
+
export interface KubeApiResource {
|
7
|
+
kind: string;
|
8
|
+
group: string;
|
9
|
+
apiName: string;
|
10
|
+
namespaced: boolean;
|
11
|
+
}
|
12
|
+
export interface KubeApiResourceDescriptor {
|
13
|
+
apiName: string;
|
14
|
+
group: string;
|
8
15
|
}
|
16
|
+
export declare const formatKubeApiResource: (res: KubeApiResourceDescriptor) => string;
|
9
17
|
export interface KubeApiResourceData {
|
10
18
|
kind: string;
|
11
|
-
group
|
19
|
+
group: string;
|
20
|
+
namespaced: boolean;
|
12
21
|
}
|
13
22
|
export declare const apiResourceRecord: Record<KubeResource, KubeApiResourceData>;
|
14
|
-
export declare const apiResources: KubeApiResource[];
|
@@ -0,0 +1,6 @@
|
|
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 { IComputedValue } from "mobx";
|
6
|
+
export declare const computedOr: (...values: IComputedValue<boolean>[]) => IComputedValue<boolean>;
|
@@ -3,7 +3,7 @@
|
|
3
3
|
* Licensed under MIT License. See LICENSE in root directory for more information.
|
4
4
|
*/
|
5
5
|
export type Falsey = false | 0 | "" | null | undefined;
|
6
|
-
interface Iterator<T> {
|
6
|
+
interface Iterator<T> extends Iterable<T> {
|
7
7
|
filter(fn: (val: T) => unknown): Iterator<T>;
|
8
8
|
filterMap<U>(fn: (val: T) => Falsey | U): Iterator<U>;
|
9
9
|
find(fn: (val: T) => unknown): T | undefined;
|
@@ -12,7 +12,7 @@ interface Iterator<T> {
|
|
12
12
|
flatMap<U>(fn: (val: T) => U[]): Iterator<U>;
|
13
13
|
join(sep?: string): string;
|
14
14
|
}
|
15
|
-
export declare function
|
15
|
+
export declare function chain<T>(src: IterableIterator<T>): Iterator<T>;
|
16
16
|
/**
|
17
17
|
* Create a new type safe empty Iterable
|
18
18
|
* @returns An `Iterable` that yields 0 items
|
@@ -3,22 +3,6 @@
|
|
3
3
|
* Licensed under MIT License. See LICENSE in root directory for more information.
|
4
4
|
*/
|
5
5
|
import type { ThemeId } from "../renderer/themes/lens-theme";
|
6
|
-
/**
|
7
|
-
* @deprecated Switch to using isMacInjectable
|
8
|
-
*/
|
9
|
-
export declare const isMac: boolean;
|
10
|
-
/**
|
11
|
-
* @deprecated Switch to using isWindowsInjectable
|
12
|
-
*/
|
13
|
-
export declare const isWindows: boolean;
|
14
|
-
/**
|
15
|
-
* @deprecated Switch to using isLinuxInjectable
|
16
|
-
*/
|
17
|
-
export declare const isLinux: boolean;
|
18
|
-
/**
|
19
|
-
* @deprecated switch to using `isDebuggingInjectable`
|
20
|
-
*/
|
21
|
-
export declare const isDebugging: boolean;
|
22
6
|
/**
|
23
7
|
* @deprecated Switch to using isTestEnvInjectable
|
24
8
|
*/
|
@@ -4,6 +4,11 @@
|
|
4
4
|
*/
|
5
5
|
import type { ResourceApplyingStack } from "../../common/k8s/resource-stack";
|
6
6
|
import type { KubernetesCluster } from "./catalog";
|
7
|
+
import type { KubeApiDataFrom, KubeObjectStoreOptions } from "../../common/k8s-api/kube-object.store";
|
8
|
+
import { KubeObjectStore as InternalKubeObjectStore } from "../../common/k8s-api/kube-object.store";
|
9
|
+
import type { KubeJsonApiDataFor, KubeObject } from "../../common/k8s-api/kube-object";
|
10
|
+
import type { KubeApi } from "../../common/k8s-api/kube-api";
|
11
|
+
import type { ClusterContext } from "../../renderer/cluster-frame-context/cluster-frame-context";
|
7
12
|
export declare const apiManager: import("../../common/k8s-api/api-manager").ApiManager;
|
8
13
|
export declare const forCluster: import("../../common/k8s-api/create-kube-api-for-cluster.injectable").CreateKubeApiForCluster;
|
9
14
|
export declare const forRemoteCluster: import("../../common/k8s-api/create-kube-api-for-remote-cluster.injectable").CreateKubeApiForRemoteCluster;
|
@@ -30,5 +35,20 @@ export type { CreateKubeApiForRemoteClusterConfig as IRemoteKubeApiConfig } from
|
|
30
35
|
export type { CreateKubeApiForLocalClusterConfig as ILocalKubeApiConfig } from "../../common/k8s-api/create-kube-api-for-cluster.injectable";
|
31
36
|
export { KubeObject, KubeStatus, type OwnerReference, type KubeObjectMetadata, type NamespaceScopedMetadata, type ClusterScopedMetadata, type BaseKubeJsonApiObjectMetadata, type KubeJsonApiObjectMetadata, type KubeStatusData, } from "../../common/k8s-api/kube-object";
|
32
37
|
export { KubeJsonApi, type KubeJsonApiData, } from "../../common/k8s-api/kube-json-api";
|
33
|
-
export
|
38
|
+
export declare abstract class KubeObjectStore<K extends KubeObject = KubeObject, A extends KubeApi<K, D> = KubeApi<K, KubeJsonApiDataFor<K>>, D extends KubeJsonApiDataFor<K> = KubeApiDataFrom<K, A>> extends InternalKubeObjectStore<K, A, D> {
|
39
|
+
/**
|
40
|
+
* @deprecated This is no longer used and shouldn't have been every really used
|
41
|
+
*/
|
42
|
+
static readonly context: {
|
43
|
+
set: (ctx: ClusterContext) => void;
|
44
|
+
get: () => ClusterContext;
|
45
|
+
};
|
46
|
+
get context(): ClusterContext;
|
47
|
+
constructor(api: A, opts?: KubeObjectStoreOptions);
|
48
|
+
/**
|
49
|
+
* @deprecated Supply API instance through constructor
|
50
|
+
*/
|
51
|
+
constructor();
|
52
|
+
}
|
53
|
+
export { type JsonPatch, type KubeObjectStoreLoadAllParams, type KubeObjectStoreLoadingParams, type KubeObjectStoreSubscribeParams, } from "../../common/k8s-api/kube-object.store";
|
34
54
|
export { type Container as IPodContainer, type PodContainerStatus as IPodContainerStatus, Pod, PodApi as PodsApi, Node, NodeApi as NodesApi, Deployment, DeploymentApi, DaemonSet, StatefulSet, Job, CronJob, ConfigMap, type SecretReference as ISecretRef, Secret, ReplicaSet, ResourceQuota, LimitRange, HorizontalPodAutoscaler, PodDisruptionBudget, PriorityClass, Service, Endpoints as Endpoint, Ingress, IngressApi, NetworkPolicy, PersistentVolume, PersistentVolumeClaim, PersistentVolumeClaimApi as PersistentVolumeClaimsApi, StorageClass, Namespace, KubeEvent, ServiceAccount, Role, RoleBinding, ClusterRole, ClusterRoleBinding, CustomResourceDefinition, } from "../../common/k8s-api/endpoints";
|