@k8slens/extensions 5.6.0-git.d0ed4e46b1.0 → 5.6.0-git.d5ee13c993.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/cluster.d.ts +2 -2
- package/dist/src/common/cluster/create-cluster-injection-token.d.ts +2 -2
- package/dist/src/common/cluster-store/cluster-store.d.ts +4 -1
- package/dist/src/common/cluster-store/read-cluster-config.injectable.d.ts +4 -0
- package/dist/src/common/cluster-types.d.ts +8 -0
- package/dist/src/common/fs/read-file-sync.injectable.d.ts +3 -0
- package/dist/src/common/k8s-api/endpoints/ingress.api.d.ts +1 -1
- package/dist/src/common/kube-helpers.d.ts +10 -2
- package/dist/src/common/utils/resolve-system-proxy/resolve-system-proxy-injection-token.d.ts +6 -0
- package/dist/src/common/vars/package-json.injectable.d.ts +1 -0
- package/dist/src/extensions/common-api/index.d.ts +2 -1
- package/dist/src/extensions/common-api/proxy.d.ts +10 -0
- package/dist/src/extensions/extension-loader/extension/extension.injectable.d.ts +7 -0
- package/dist/src/extensions/extension-loader/extension-loader.d.ts +2 -2
- package/dist/src/extensions/extension-loader/extension-registrator-injection-token.d.ts +7 -0
- package/dist/src/extensions/lens-renderer-extension.d.ts +2 -0
- package/dist/src/extensions/renderer-api/components.d.ts +1 -0
- package/dist/src/renderer/components/+preferences/app-preference-tab/app-preference-tab-registration.d.ts +9 -0
- package/dist/src/renderer/components/layout/sidebar-items.injectable.d.ts +0 -2
- package/dist/src/renderer/components/notifications/index.d.ts +0 -1
- package/package.json +1 -1
|
@@ -9,7 +9,7 @@ import type { KubeconfigManager } from "../../main/kubeconfig-manager/kubeconfig
|
|
|
9
9
|
import type { KubeResource } 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
|
-
import type { ClusterState, ClusterRefreshOptions, ClusterMetricsResourceType, ClusterId, ClusterMetadata, ClusterModel, ClusterPreferences, ClusterPrometheusPreferences, UpdateClusterModel } from "../cluster-types";
|
|
12
|
+
import type { ClusterState, ClusterRefreshOptions, ClusterMetricsResourceType, ClusterId, ClusterMetadata, ClusterModel, ClusterPreferences, ClusterPrometheusPreferences, UpdateClusterModel, ClusterConfigData } from "../cluster-types";
|
|
13
13
|
import { ClusterStatus } from "../cluster-types";
|
|
14
14
|
import type { CanI } from "./authorization-review.injectable";
|
|
15
15
|
import type { ListNamespaces } from "./list-namespaces.injectable";
|
|
@@ -187,7 +187,7 @@ export declare class Cluster implements ClusterModel, ClusterState {
|
|
|
187
187
|
* @internal
|
|
188
188
|
*/
|
|
189
189
|
get defaultNamespace(): string | undefined;
|
|
190
|
-
constructor(dependencies: ClusterDependencies, model: ClusterModel);
|
|
190
|
+
constructor(dependencies: ClusterDependencies, model: ClusterModel, configData: ClusterConfigData);
|
|
191
191
|
/**
|
|
192
192
|
* Update cluster data model
|
|
193
193
|
*
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ClusterModel } from "../cluster-types";
|
|
1
|
+
import type { ClusterConfigData, ClusterModel } from "../cluster-types";
|
|
2
2
|
import type { Cluster } from "./cluster";
|
|
3
|
-
export declare type CreateCluster = (model: ClusterModel) => Cluster;
|
|
3
|
+
export declare type CreateCluster = (model: ClusterModel, configData: ClusterConfigData) => Cluster;
|
|
4
4
|
export declare const createClusterInjectionToken: import("@ogre-tools/injectable").InjectionToken<CreateCluster, void>;
|
|
@@ -5,11 +5,14 @@
|
|
|
5
5
|
import { BaseStore } from "../base-store";
|
|
6
6
|
import { Cluster } from "../cluster/cluster";
|
|
7
7
|
import type { ClusterModel, ClusterId } from "../cluster-types";
|
|
8
|
+
import type { CreateCluster } from "../cluster/create-cluster-injection-token";
|
|
9
|
+
import type { ReadClusterConfigSync } from "./read-cluster-config.injectable";
|
|
8
10
|
export interface ClusterStoreModel {
|
|
9
11
|
clusters?: ClusterModel[];
|
|
10
12
|
}
|
|
11
13
|
interface Dependencies {
|
|
12
|
-
createCluster:
|
|
14
|
+
createCluster: CreateCluster;
|
|
15
|
+
readClusterConfigSync: ReadClusterConfigSync;
|
|
13
16
|
}
|
|
14
17
|
export declare class ClusterStore extends BaseStore<ClusterStoreModel> {
|
|
15
18
|
private dependencies;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ClusterConfigData, ClusterModel } from "../cluster-types";
|
|
2
|
+
export declare type ReadClusterConfigSync = (model: ClusterModel) => ClusterConfigData;
|
|
3
|
+
declare const readClusterConfigSyncInjectable: import("@ogre-tools/injectable").Injectable<ReadClusterConfigSync, unknown, void>;
|
|
4
|
+
export default readClusterConfigSyncInjectable;
|
|
@@ -53,6 +53,14 @@ export interface ClusterModel {
|
|
|
53
53
|
*/
|
|
54
54
|
labels?: Record<string, string>;
|
|
55
55
|
}
|
|
56
|
+
/**
|
|
57
|
+
* This data is retreived from the kubeconfig file before calling the cluster constructor.
|
|
58
|
+
*
|
|
59
|
+
* That is done to remove the external dependency on the construction of Cluster instances.
|
|
60
|
+
*/
|
|
61
|
+
export interface ClusterConfigData {
|
|
62
|
+
clusterServerUrl: string;
|
|
63
|
+
}
|
|
56
64
|
/**
|
|
57
65
|
* The complete set of cluster settings or preferences
|
|
58
66
|
*/
|
|
@@ -77,7 +77,7 @@ export interface IngressSpec {
|
|
|
77
77
|
}
|
|
78
78
|
export interface IngressStatus {
|
|
79
79
|
loadBalancer: {
|
|
80
|
-
ingress
|
|
80
|
+
ingress?: ILoadBalancerIngress[];
|
|
81
81
|
};
|
|
82
82
|
}
|
|
83
83
|
export declare class Ingress extends KubeObject<IngressStatus, IngressSpec, KubeObjectScope.Namespace> {
|
|
@@ -23,7 +23,7 @@ export interface ConfigResult {
|
|
|
23
23
|
export declare function loadConfigFromString(content: string): ConfigResult;
|
|
24
24
|
export interface SplitConfigEntry {
|
|
25
25
|
config: KubeConfig;
|
|
26
|
-
|
|
26
|
+
validationResult: ValidateKubeConfigResult;
|
|
27
27
|
}
|
|
28
28
|
/**
|
|
29
29
|
* Breaks kube config into several configs. Each context as it own KubeConfig object
|
|
@@ -35,10 +35,18 @@ export declare function splitConfig(kubeConfig: KubeConfig): SplitConfigEntry[];
|
|
|
35
35
|
* @returns The yaml representation of the kubeconfig object
|
|
36
36
|
*/
|
|
37
37
|
export declare function dumpConfigYaml(kubeConfig: PartialDeep<KubeConfig>): string;
|
|
38
|
+
export declare type ValidateKubeConfigResult = {
|
|
39
|
+
error: Error;
|
|
40
|
+
} | {
|
|
41
|
+
error?: undefined;
|
|
42
|
+
context: Context;
|
|
43
|
+
cluster: Cluster;
|
|
44
|
+
user: User;
|
|
45
|
+
};
|
|
38
46
|
/**
|
|
39
47
|
* Checks if `config` has valid `Context`, `User`, `Cluster`, and `exec` fields (if present when required)
|
|
40
48
|
*
|
|
41
49
|
* Note: This function returns an error instead of throwing it, returning `undefined` if the validation passes
|
|
42
50
|
*/
|
|
43
|
-
export declare function validateKubeConfig(config: KubeConfig, contextName: string):
|
|
51
|
+
export declare function validateKubeConfig(config: KubeConfig, contextName: string): ValidateKubeConfigResult;
|
|
44
52
|
export {};
|
|
@@ -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 type ResolveSystemProxy = (url: string) => Promise<string>;
|
|
6
|
+
export declare const resolveSystemProxyInjectionToken: import("@ogre-tools/injectable").InjectionToken<ResolveSystemProxy, void>;
|
|
@@ -136,6 +136,7 @@ declare const packageJsonInjectable: import("@ogre-tools/injectable").Injectable
|
|
|
136
136
|
"@ogre-tools/fp": string;
|
|
137
137
|
"@ogre-tools/injectable": string;
|
|
138
138
|
"@ogre-tools/injectable-extension-for-auto-registration": string;
|
|
139
|
+
"@ogre-tools/injectable-extension-for-mobx": string;
|
|
139
140
|
"@ogre-tools/injectable-react": string;
|
|
140
141
|
"@sentry/electron": string;
|
|
141
142
|
"@sentry/integrations": string;
|
|
@@ -8,5 +8,6 @@ import * as Store from "./stores";
|
|
|
8
8
|
import * as Util from "./utils";
|
|
9
9
|
import * as Catalog from "./catalog";
|
|
10
10
|
import * as Types from "./types";
|
|
11
|
+
import * as Proxy from "./proxy";
|
|
11
12
|
import logger from "../../common/logger";
|
|
12
|
-
export { App, EventBus, Catalog, Store, Types, Util, logger, };
|
|
13
|
+
export { App, EventBus, Catalog, Store, Types, Util, logger, Proxy, };
|
|
@@ -0,0 +1,10 @@
|
|
|
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
|
+
* Resolves URL-specific proxy information from system. See more here: https://www.electronjs.org/docs/latest/api/session#sesresolveproxyurl
|
|
7
|
+
* @param url - The URL for proxy information
|
|
8
|
+
* @returns Promise for proxy information as string
|
|
9
|
+
*/
|
|
10
|
+
export declare const resolveSystemProxy: import("../../common/utils/resolve-system-proxy/resolve-system-proxy-injection-token").ResolveSystemProxy;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { LensExtension } from "../../lens-extension";
|
|
2
|
+
export interface Extension {
|
|
3
|
+
register: () => void;
|
|
4
|
+
deregister: () => void;
|
|
5
|
+
}
|
|
6
|
+
declare const extensionInjectable: import("@ogre-tools/injectable").Injectable<Extension, unknown, LensExtension<import("../../lens-extension-set-dependencies").LensExtensionDependencies>>;
|
|
7
|
+
export default extensionInjectable;
|
|
@@ -9,12 +9,12 @@ import type { InstalledExtension } from "../extension-discovery/extension-discov
|
|
|
9
9
|
import type { LensExtension, LensExtensionConstructor, LensExtensionId } from "../lens-extension";
|
|
10
10
|
import type { LensExtensionState } from "../extensions-store/extensions-store";
|
|
11
11
|
import type { CreateExtensionInstance } from "./create-extension-instance.token";
|
|
12
|
+
import type { Extension } from "./extension/extension.injectable";
|
|
12
13
|
interface Dependencies {
|
|
13
14
|
updateExtensionsState: (extensionsState: Record<LensExtensionId, LensExtensionState>) => void;
|
|
14
15
|
createExtensionInstance: CreateExtensionInstance;
|
|
15
|
-
readonly extensionRegistrators: ((extension: LensExtension, extensionInstallationCount: number) => void)[];
|
|
16
|
-
readonly extensionInstallationCounter: Map<string, number>;
|
|
17
16
|
readonly extensionInstances: ObservableMap<LensExtensionId, LensExtension>;
|
|
17
|
+
getExtension: (instance: LensExtension) => Extension;
|
|
18
18
|
}
|
|
19
19
|
export interface ExtensionLoading {
|
|
20
20
|
isBundled: boolean;
|
|
@@ -0,0 +1,7 @@
|
|
|
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 { Injectable } from "@ogre-tools/injectable";
|
|
6
|
+
import type { LensExtension } from "../lens-extension";
|
|
7
|
+
export declare const extensionRegistratorInjectionToken: import("@ogre-tools/injectable").InjectionToken<(extension: LensExtension) => Injectable<any, any, any>[], void>;
|
|
@@ -22,12 +22,14 @@ import type { WorkloadsOverviewDetailRegistration } from "../renderer/components
|
|
|
22
22
|
import type { KubeObjectStatusRegistration } from "../renderer/components/kube-object-status-icon/kube-object-status-registration";
|
|
23
23
|
import type { LensRendererExtensionDependencies } from "./lens-extension-set-dependencies";
|
|
24
24
|
import type { KubeObjectHandlerRegistration } from "../renderer/kube-object/handler";
|
|
25
|
+
import type { AppPreferenceTabRegistration } from "../renderer/components/+preferences/app-preference-tab/app-preference-tab-registration";
|
|
25
26
|
export declare class LensRendererExtension extends LensExtension<LensRendererExtensionDependencies> {
|
|
26
27
|
globalPages: registries.PageRegistration[];
|
|
27
28
|
clusterPages: registries.PageRegistration[];
|
|
28
29
|
clusterPageMenus: registries.ClusterPageMenuRegistration[];
|
|
29
30
|
kubeObjectStatusTexts: KubeObjectStatusRegistration[];
|
|
30
31
|
appPreferences: AppPreferenceRegistration[];
|
|
32
|
+
appPreferenceTabs: AppPreferenceTabRegistration[];
|
|
31
33
|
entitySettings: registries.EntitySettingRegistration[];
|
|
32
34
|
statusBarItems: StatusBarRegistration[];
|
|
33
35
|
kubeObjectDetailItems: registries.KubeObjectDetailRegistration[];
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { IComputedValue } from "mobx";
|
|
3
|
-
import type { LensRendererExtension } from "../../../extensions/lens-renderer-extension";
|
|
4
3
|
export interface SidebarItemRegistration {
|
|
5
4
|
id: string;
|
|
6
5
|
parentId: string | null;
|
|
@@ -10,7 +9,6 @@ export interface SidebarItemRegistration {
|
|
|
10
9
|
isActive?: IComputedValue<boolean>;
|
|
11
10
|
isVisible?: IComputedValue<boolean>;
|
|
12
11
|
orderNumber: number;
|
|
13
|
-
extension?: LensRendererExtension;
|
|
14
12
|
}
|
|
15
13
|
export declare const sidebarItemsInjectionToken: import("@ogre-tools/injectable").InjectionToken<IComputedValue<SidebarItemRegistration[]>, void>;
|
|
16
14
|
export interface HierarchicalSidebarItem {
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@k8slens/extensions",
|
|
3
3
|
"productName": "OpenLens extensions",
|
|
4
4
|
"description": "OpenLens - Open Source Kubernetes IDE: extensions",
|
|
5
|
-
"version": "5.6.0-git.
|
|
5
|
+
"version": "5.6.0-git.d5ee13c993.0",
|
|
6
6
|
"copyright": "© 2022 OpenLens Authors",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"main": "dist/src/extensions/extension-api.js",
|