@k8slens/extensions 6.3.0-git.6d7090f8a7.0 → 6.3.0-git.8897bfc26b.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.
Files changed (72) hide show
  1. package/dist/src/common/certificate-authorities/inject-system-cas.injectable.d.ts +6 -0
  2. package/dist/src/{main/prometheus/index.d.ts → common/certificate-authorities/request-system-cas-token.d.ts} +1 -1
  3. package/dist/src/common/certificate-authorities/request-system-cas.injectable.darwin.d.ts +2 -0
  4. package/dist/src/common/certificate-authorities/request-system-cas.injectable.linux.d.ts +2 -0
  5. package/dist/src/common/certificate-authorities/request-system-cas.injectable.testing-env.d.ts +2 -0
  6. package/dist/src/common/certificate-authorities/request-system-cas.injectable.win32.d.ts +2 -0
  7. package/dist/src/common/fs/exec-file.injectable.d.ts +6 -3
  8. package/dist/src/common/ipc/cluster.d.ts +0 -2
  9. package/dist/src/common/k8s/create-resource-stack.injectable.d.ts +5 -0
  10. package/dist/src/common/k8s/resource-stack.d.ts +25 -6
  11. package/dist/src/common/k8s-api/endpoints/helm-releases.api/request-update.injectable.d.ts +2 -6
  12. package/dist/src/common/kube-helpers/channels.d.ts +25 -0
  13. package/dist/src/common/utils/binary-name.injectable.d.ts +2 -0
  14. package/dist/src/common/utils/bundled-binary-path.injectable.d.ts +2 -0
  15. package/dist/src/common/utils/channel/message-to-channel-injection-token.d.ts +1 -0
  16. package/dist/src/common/vars/normalized-platform.injectable.d.ts +2 -1
  17. package/dist/src/common/vars.d.ts +0 -27
  18. package/dist/src/extensions/common-api/k8s-api.d.ts +12 -1
  19. package/dist/src/extensions/extension-api.js +72 -905
  20. package/dist/src/features/shell-sync/common/failure-channel.d.ts +6 -0
  21. package/dist/src/{main/utils/shell-env → features/shell-sync/main}/compute-shell-environment.injectable.d.ts +0 -0
  22. package/dist/src/{main/utils/shell-env → features/shell-sync/main}/compute-unix-shell-environment.global-override-for-injectable.d.ts +0 -0
  23. package/dist/src/{main/utils/shell-env → features/shell-sync/main}/compute-unix-shell-environment.injectable.d.ts +0 -0
  24. package/dist/src/{main/utils/shell-env → features/shell-sync/main}/compute-unix-shell-environment.test.d.ts +0 -0
  25. package/dist/src/features/shell-sync/main/emit-failure.injectable.d.ts +2 -0
  26. package/dist/src/{main/utils/shell-env → features/shell-sync/main}/env.injectable.d.ts +0 -0
  27. package/dist/src/{main/utils/shell-env → features/shell-sync/main}/execPath.injectable.d.ts +0 -0
  28. package/dist/src/{main/start-main-application/runnables → features/shell-sync/main}/setup-shell.injectable.d.ts +0 -0
  29. package/dist/src/features/shell-sync/renderer/failure-listener.injectable.d.ts +5 -0
  30. package/dist/src/main/context-handler/context-handler.d.ts +12 -7
  31. package/dist/src/main/electron-app/runnables/setup-ipc-main-handlers/setup-ipc-main-handlers.d.ts +1 -3
  32. package/dist/src/main/helm/exec-helm/exec-env.global-override-for-injectable.d.ts +9 -0
  33. package/dist/src/main/helm/exec-helm/exec-env.injectable.d.ts +2 -0
  34. package/dist/src/main/helm/helm-service/update-helm-release.injectable.d.ts +1 -2
  35. package/dist/src/main/kube-auth-proxy/kube-auth-proxy-certificate.injectable.d.ts +7 -0
  36. package/dist/src/main/kube-auth-proxy/lens-k8s-proxy-path.injectable.d.ts +2 -0
  37. package/dist/src/main/kubectl/apply-all-handler.injectable.d.ts +5 -0
  38. package/dist/src/main/kubectl/binary-name.injectable.d.ts +1 -1
  39. package/dist/src/main/kubectl/delete-all-handler.injectable.d.ts +5 -0
  40. package/dist/src/main/kubectl/kubectl-apply-all.injectable.d.ts +2 -0
  41. package/dist/src/main/kubectl/kubectl-delete-all.injectable.d.ts +2 -0
  42. package/dist/src/main/kubectl/kubectl.d.ts +2 -1
  43. package/dist/src/main/prometheus/get-by-kind.injectable.d.ts +4 -0
  44. package/dist/src/main/prometheus/helm-14-provider.injectable.d.ts +6 -0
  45. package/dist/src/main/prometheus/helm-provider.injectable.d.ts +10 -0
  46. package/dist/src/main/prometheus/lens-provider.injectable.d.ts +10 -0
  47. package/dist/src/main/prometheus/operator-provider.injectable.ts.d.ts +10 -0
  48. package/dist/src/main/prometheus/provider.d.ts +38 -0
  49. package/dist/src/main/prometheus/providers.injectable.d.ts +2 -0
  50. package/dist/src/main/prometheus/stacklight-provider.injectable.d.ts +10 -0
  51. package/dist/src/main/resource-applier/resource-applier.d.ts +6 -5
  52. package/dist/src/main/routes/resource-applier/create-resource-route.injectable.d.ts +13 -1
  53. package/dist/src/main/shell-session/shell-session.d.ts +1 -1
  54. package/dist/src/renderer/components/dock/upgrade-chart/upgrade-chart-model.injectable.d.ts +2 -4
  55. package/dist/src/renderer/components/dock/upgrade-chart/view.d.ts +1 -1
  56. package/dist/src/renderer/ipc/index.d.ts +0 -8
  57. package/dist/src/renderer/kubectl/apply-all.injectable.d.ts +2 -0
  58. package/dist/src/renderer/kubectl/delete-all.injectable.d.ts +2 -0
  59. package/dist/src/test-utils/skippers.d.ts +13 -0
  60. package/package.json +1 -1
  61. package/dist/src/common/__tests__/system-ca.test.d.ts +0 -1
  62. package/dist/src/common/system-ca.d.ts +0 -24
  63. package/dist/src/common/utils/lazy-initialized.d.ts +0 -17
  64. package/dist/src/main/kube-auth-proxy/get-kube-auth-proxy-certificate.d.ts +0 -8
  65. package/dist/src/main/prometheus/helm-14.d.ts +0 -14
  66. package/dist/src/main/prometheus/helm.d.ts +0 -14
  67. package/dist/src/main/prometheus/lens.d.ts +0 -15
  68. package/dist/src/main/prometheus/operator.d.ts +0 -15
  69. package/dist/src/main/prometheus/prometheus-provider-registry.injectable.d.ts +0 -3
  70. package/dist/src/main/prometheus/provider-registry.d.ts +0 -27
  71. package/dist/src/main/prometheus/stacklight.d.ts +0 -15
  72. package/dist/src/main/start-main-application/runnables/setup-prometheus-registry.injectable.d.ts +0 -5
@@ -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 { MessageChannel } from "../../../common/utils/channel/message-channel-listener-injection-token";
6
+ export declare const shellSyncFailedChannel: MessageChannel<string>;
@@ -0,0 +1,2 @@
1
+ declare const emitShellSyncFailedInjectable: import("@ogre-tools/injectable").Injectable<(message: string) => void, unknown, void>;
2
+ export default emitShellSyncFailedInjectable;
@@ -0,0 +1,5 @@
1
+ declare const shellSyncFailureListenerInjectable: import("@ogre-tools/injectable").Injectable<{
2
+ channel: import("../../../common/utils/channel/message-channel-listener-injection-token").MessageChannel<string>;
3
+ handler: (message: string) => void;
4
+ }, import("../../../common/utils/channel/message-channel-listener-injection-token").MessageChannelListener<import("../../../common/utils/channel/message-channel-listener-injection-token").MessageChannel<unknown>>, void>;
5
+ export default shellSyncFailureListenerInjectable;
@@ -3,13 +3,16 @@
3
3
  * Licensed under MIT License. See LICENSE in root directory for more information.
4
4
  */
5
5
  /// <reference types="node" />
6
- import type { PrometheusProvider, PrometheusService, PrometheusProviderRegistry } from "../prometheus/provider-registry";
6
+ import type { PrometheusProvider, PrometheusService } from "../prometheus/provider";
7
7
  import type { ClusterPrometheusPreferences } from "../../common/cluster-types";
8
8
  import type { Cluster } from "../../common/cluster/cluster";
9
9
  import type httpProxy from "http-proxy";
10
10
  import type { UrlWithStringQuery } from "url";
11
11
  import type { KubeAuthProxy } from "../kube-auth-proxy/kube-auth-proxy";
12
12
  import type { CreateKubeAuthProxy } from "../kube-auth-proxy/create-kube-auth-proxy.injectable";
13
+ import type { GetPrometheusProviderByKind } from "../prometheus/get-by-kind.injectable";
14
+ import type { IComputedValue } from "mobx";
15
+ import type { Logger } from "../../common/logger";
13
16
  export interface PrometheusDetails {
14
17
  prometheusPath: string;
15
18
  provider: PrometheusProvider;
@@ -20,10 +23,12 @@ interface PrometheusServicePreferences {
20
23
  port: number;
21
24
  prefix: string;
22
25
  }
23
- interface Dependencies {
24
- readonly createKubeAuthProxy: CreateKubeAuthProxy;
26
+ export interface ContextHandlerDependencies {
27
+ createKubeAuthProxy: CreateKubeAuthProxy;
28
+ getPrometheusProviderByKind: GetPrometheusProviderByKind;
25
29
  readonly authProxyCa: string;
26
- readonly prometheusProviderRegistry: PrometheusProviderRegistry;
30
+ readonly prometheusProviders: IComputedValue<PrometheusProvider[]>;
31
+ readonly logger: Logger;
27
32
  }
28
33
  export interface ClusterContextHandler {
29
34
  readonly clusterUrl: UrlWithStringQuery;
@@ -37,14 +42,14 @@ export interface ClusterContextHandler {
37
42
  stopServer(): void;
38
43
  }
39
44
  export declare class ContextHandler implements ClusterContextHandler {
40
- private dependencies;
41
- protected cluster: Cluster;
45
+ private readonly dependencies;
46
+ protected readonly cluster: Cluster;
42
47
  readonly clusterUrl: UrlWithStringQuery;
43
48
  protected kubeAuthProxy?: KubeAuthProxy;
44
49
  protected apiTarget?: httpProxy.ServerOptions;
45
50
  protected prometheusProvider?: string;
46
51
  protected prometheus?: PrometheusServicePreferences;
47
- constructor(dependencies: Dependencies, cluster: Cluster);
52
+ constructor(dependencies: ContextHandlerDependencies, cluster: Cluster);
48
53
  setupPrometheus(preferences?: ClusterPrometheusPreferences): void;
49
54
  getPrometheusDetails(): Promise<PrometheusDetails>;
50
55
  protected ensurePrometheusPath({ service, namespace, port }: PrometheusService): string;
@@ -7,7 +7,6 @@ import type { ApplicationMenuItemTypes } from "../../../../features/application-
7
7
  import type { Composite } from "../../../../common/utils/composite/get-composite/get-composite";
8
8
  import type { MenuItemRoot } from "../../../../features/application-menu/main/application-menu-item-composite.injectable";
9
9
  import type { EmitAppEvent } from "../../../../common/app-event-bus/emit-event.injectable";
10
- import type { CreateResourceApplier } from "../../../resource-applier/create-resource-applier.injectable";
11
10
  interface Dependencies {
12
11
  applicationMenuItemComposite: IComputedValue<Composite<ApplicationMenuItemTypes | MenuItemRoot>>;
13
12
  catalogEntityRegistry: CatalogEntityRegistry;
@@ -15,7 +14,6 @@ interface Dependencies {
15
14
  operatingSystemTheme: IComputedValue<Theme>;
16
15
  askUserForFilePaths: AskUserForFilePaths;
17
16
  emitAppEvent: EmitAppEvent;
18
- createResourceApplier: CreateResourceApplier;
19
17
  }
20
- export declare const setupIpcMainHandlers: ({ applicationMenuItemComposite, catalogEntityRegistry, clusterStore, operatingSystemTheme, askUserForFilePaths, emitAppEvent, createResourceApplier, }: Dependencies) => void;
18
+ export declare const setupIpcMainHandlers: ({ applicationMenuItemComposite, catalogEntityRegistry, clusterStore, operatingSystemTheme, askUserForFilePaths, emitAppEvent, }: Dependencies) => void;
21
19
  export {};
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Copyright (c) OpenLens Authors. All rights reserved.
3
+ * Licensed under MIT License. See LICENSE in root directory for more information.
4
+ */
5
+ declare const _default: {
6
+ injectable: import("@ogre-tools/injectable").Injectable<import("mobx").IComputedValue<Partial<Record<string, string>>>, unknown, void>;
7
+ overridingInstantiate: import("@ogre-tools/injectable").Instantiate<import("mobx").IComputedValue<Partial<Record<string, string>>>, void>;
8
+ };
9
+ export default _default;
@@ -0,0 +1,2 @@
1
+ declare const execHelmEnvInjectable: import("@ogre-tools/injectable").Injectable<import("mobx").IComputedValue<Partial<Record<string, string>>>, unknown, void>;
2
+ export default execHelmEnvInjectable;
@@ -1,8 +1,7 @@
1
1
  import type { Cluster } from "../../../common/cluster/cluster";
2
- import type { JsonObject } from "type-fest";
3
2
  export interface UpdateChartArgs {
4
3
  chart: string;
5
- values: JsonObject;
4
+ values: string;
6
5
  version: string;
7
6
  }
8
7
  declare const updateHelmReleaseInjectable: import("@ogre-tools/injectable").Injectable<(cluster: Cluster, releaseName: string, namespace: string, data: UpdateChartArgs) => Promise<{
@@ -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
+ /// <reference types="selfsigned" />
6
+ declare const kubeAuthProxyCertificateInjectable: import("@ogre-tools/injectable").Injectable<import("selfsigned").SelfSignedCert, unknown, string>;
7
+ export default kubeAuthProxyCertificateInjectable;
@@ -0,0 +1,2 @@
1
+ declare const lensK8sProxyPathInjectable: import("@ogre-tools/injectable").Injectable<string, unknown, void>;
2
+ export default lensK8sProxyPathInjectable;
@@ -0,0 +1,5 @@
1
+ declare const kubectlApplyAllChannelHandlerInjectable: import("@ogre-tools/injectable").Injectable<{
2
+ channel: import("../../common/utils/channel/request-channel-listener-injection-token").RequestChannel<import("../../common/kube-helpers/channels").KubectlApplyAllArgs, import("../../common/utils/async-result").AsyncResult<string, string>>;
3
+ handler: (req: import("../../common/kube-helpers/channels").KubectlApplyAllArgs) => import("../../common/utils/async-result").AsyncResult<string, string> | Promise<import("../../common/utils/async-result").AsyncResult<string, string>>;
4
+ }, import("../utils/channel/channel-listeners/listener-tokens").RequestChannelListener<import("../../common/utils/channel/request-channel-listener-injection-token").RequestChannel<unknown, unknown>>, void>;
5
+ export default kubectlApplyAllChannelHandlerInjectable;
@@ -1,2 +1,2 @@
1
- declare const kubectlBinaryNameInjectable: import("@ogre-tools/injectable").Injectable<"kubectl.exe" | "kubectl", unknown, void>;
1
+ declare const kubectlBinaryNameInjectable: import("@ogre-tools/injectable").Injectable<string, unknown, void>;
2
2
  export default kubectlBinaryNameInjectable;
@@ -0,0 +1,5 @@
1
+ declare const kubectlDeleteAllChannelHandlerInjectable: import("@ogre-tools/injectable").Injectable<{
2
+ channel: import("../../common/utils/channel/request-channel-listener-injection-token").RequestChannel<import("../../common/kube-helpers/channels").KubectlDeleteAllArgs, import("../../common/utils/async-result").AsyncResult<string, string>>;
3
+ handler: (req: import("../../common/kube-helpers/channels").KubectlDeleteAllArgs) => import("../../common/utils/async-result").AsyncResult<string, string> | Promise<import("../../common/utils/async-result").AsyncResult<string, string>>;
4
+ }, import("../utils/channel/channel-listeners/listener-tokens").RequestChannelListener<import("../../common/utils/channel/request-channel-listener-injection-token").RequestChannel<unknown, unknown>>, void>;
5
+ export default kubectlDeleteAllChannelHandlerInjectable;
@@ -0,0 +1,2 @@
1
+ declare const kubectlApplyAllInjectable: import("@ogre-tools/injectable").Injectable<(req: import("../../common/kube-helpers/channels").KubectlApplyAllArgs) => Promise<import("../../common/utils/async-result").AsyncResult<string, string>>, (req: import("../../common/kube-helpers/channels").KubectlApplyAllArgs) => Promise<import("../../common/utils/async-result").AsyncResult<string, string>>, void>;
2
+ export default kubectlApplyAllInjectable;
@@ -0,0 +1,2 @@
1
+ declare const kubectlDeleteAllInjectable: import("@ogre-tools/injectable").Injectable<(req: import("../../common/kube-helpers/channels").KubectlDeleteAllArgs) => Promise<import("../../common/utils/async-result").AsyncResult<string, string>>, (req: import("../../common/kube-helpers/channels").KubectlDeleteAllArgs) => Promise<import("../../common/utils/async-result").AsyncResult<string, string>>, void>;
2
+ export default kubectlDeleteAllInjectable;
@@ -5,9 +5,10 @@
5
5
  import type { JoinPaths } from "../../common/path/join-paths.injectable";
6
6
  import type { GetDirnameOfPath } from "../../common/path/get-dirname.injectable";
7
7
  import type { GetBasenameOfPath } from "../../common/path/get-basename.injectable";
8
+ import type { NormalizedPlatform } from "../../common/vars/normalized-platform.injectable";
8
9
  export interface KubectlDependencies {
9
10
  readonly directoryForKubectlBinaries: string;
10
- readonly normalizedDownloadPlatform: "darwin" | "linux" | "windows";
11
+ readonly normalizedDownloadPlatform: NormalizedPlatform;
11
12
  readonly normalizedDownloadArch: "amd64" | "arm64" | "386";
12
13
  readonly kubectlBinaryName: string;
13
14
  readonly bundledKubectlBinaryPath: string;
@@ -0,0 +1,4 @@
1
+ import type { PrometheusProvider } from "./provider";
2
+ export type GetPrometheusProviderByKind = (kind: string) => PrometheusProvider;
3
+ declare const getPrometheusProviderByKindInjectable: import("@ogre-tools/injectable").Injectable<GetPrometheusProviderByKind, unknown, void>;
4
+ export default getPrometheusProviderByKindInjectable;
@@ -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
+ declare const helm14PrometheusProviderInjectable: import("@ogre-tools/injectable").Injectable<import("./provider").PrometheusProvider, import("./provider").PrometheusProvider, void>;
6
+ export default helm14PrometheusProviderInjectable;
@@ -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
+ import type { PrometheusProvider } from "./provider";
6
+ export declare const getHelmLikeQueryFor: ({ rateAccuracy }: {
7
+ rateAccuracy: string;
8
+ }) => PrometheusProvider["getQuery"];
9
+ declare const helmPrometheusProviderInjectable: import("@ogre-tools/injectable").Injectable<PrometheusProvider, PrometheusProvider, void>;
10
+ export default helmPrometheusProviderInjectable;
@@ -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
+ import type { PrometheusProvider } from "./provider";
6
+ export declare const getLensLikeQueryFor: ({ rateAccuracy }: {
7
+ rateAccuracy: string;
8
+ }) => PrometheusProvider["getQuery"];
9
+ declare const lensPrometheusProviderInjectable: import("@ogre-tools/injectable").Injectable<PrometheusProvider, PrometheusProvider, void>;
10
+ export default lensPrometheusProviderInjectable;
@@ -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
+ import type { PrometheusProvider } from "./provider";
6
+ export declare const getOperatorLikeQueryFor: ({ rateAccuracy }: {
7
+ rateAccuracy: string;
8
+ }) => PrometheusProvider["getQuery"];
9
+ declare const operatorPrometheusProviderInjectable: import("@ogre-tools/injectable").Injectable<PrometheusProvider, PrometheusProvider, void>;
10
+ export default operatorPrometheusProviderInjectable;
@@ -0,0 +1,38 @@
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 { CoreV1Api } from "@kubernetes/client-node";
6
+ export interface PrometheusService extends PrometheusServiceInfo {
7
+ kind: string;
8
+ }
9
+ export interface PrometheusServiceInfo {
10
+ namespace: string;
11
+ service: string;
12
+ port: number;
13
+ }
14
+ export interface PrometheusProvider {
15
+ readonly kind: string;
16
+ readonly name: string;
17
+ readonly isConfigurable: boolean;
18
+ getQuery(opts: Record<string, string>, queryName: string): string;
19
+ getPrometheusService(client: CoreV1Api): Promise<PrometheusService>;
20
+ }
21
+ export interface CreatePrometheusProviderOpts {
22
+ readonly kind: string;
23
+ readonly name: string;
24
+ readonly isConfigurable: boolean;
25
+ getQuery(opts: Record<string, string>, queryName: string): string;
26
+ getService(client: CoreV1Api): Promise<PrometheusServiceInfo>;
27
+ }
28
+ export declare const createPrometheusProvider: ({ getService, ...opts }: CreatePrometheusProviderOpts) => PrometheusProvider;
29
+ export declare function findFirstNamespacedService(client: CoreV1Api, ...selectors: string[]): Promise<PrometheusServiceInfo>;
30
+ export declare function findNamespacedService(client: CoreV1Api, name: string, namespace: string): Promise<PrometheusServiceInfo>;
31
+ export interface BytesSentArgs {
32
+ rateAccuracy: string;
33
+ ingress: string;
34
+ namespace: string;
35
+ statuses: string;
36
+ }
37
+ export declare function bytesSent({ rateAccuracy, ingress, namespace, statuses }: BytesSentArgs): string;
38
+ export declare const prometheusProviderInjectionToken: import("@ogre-tools/injectable").InjectionToken<PrometheusProvider, void>;
@@ -0,0 +1,2 @@
1
+ declare const prometheusProvidersInjectable: import("@ogre-tools/injectable").Injectable<import("mobx").IComputedValue<import("./provider").PrometheusProvider[]>, unknown, void>;
2
+ export default prometheusProvidersInjectable;
@@ -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
+ import type { PrometheusProvider } from "./provider";
6
+ export declare const getStacklightLikeQueryFor: ({ rateAccuracy }: {
7
+ rateAccuracy: string;
8
+ }) => PrometheusProvider["getQuery"];
9
+ declare const stacklightPrometheusProviderInjectable: import("@ogre-tools/injectable").Injectable<PrometheusProvider, PrometheusProvider, void>;
10
+ export default stacklightPrometheusProviderInjectable;
@@ -10,6 +10,7 @@ import type { WriteFile } from "../../common/fs/write-file.injectable";
10
10
  import type { DeleteFile } from "../../common/fs/delete-file.injectable";
11
11
  import type { ExecFile } from "../../common/fs/exec-file.injectable";
12
12
  import type { JoinPaths } from "../../common/path/join-paths.injectable";
13
+ import type { AsyncResult } from "../../common/utils/async-result";
13
14
  export interface ResourceApplierDependencies {
14
15
  emitAppEvent: EmitAppEvent;
15
16
  writeFile: WriteFile;
@@ -30,10 +31,10 @@ export declare class ResourceApplier {
30
31
  * @param ns The optional namespace of the kube resource
31
32
  */
32
33
  patch(name: string, kind: string, patch: Patch, ns?: string): Promise<string>;
33
- create(resource: string): Promise<string>;
34
- protected kubectlApply(content: string): Promise<string>;
35
- kubectlApplyAll(resources: string[], extraArgs?: string[]): Promise<string>;
36
- kubectlDeleteAll(resources: string[], extraArgs?: string[]): Promise<string>;
37
- protected kubectlCmdAll(subCmd: string, resources: string[], parentArgs?: string[]): Promise<string>;
34
+ create(resource: string): Promise<AsyncResult<string, string>>;
35
+ protected kubectlApply(content: string): Promise<AsyncResult<string, string>>;
36
+ kubectlApplyAll(resources: string[], extraArgs?: string[]): Promise<AsyncResult<string, string>>;
37
+ kubectlDeleteAll(resources: string[], extraArgs?: string[]): Promise<AsyncResult<string, string>>;
38
+ protected kubectlCmdAll(subCmd: string, resources: string[], parentArgs?: string[]): Promise<AsyncResult<string, string>>;
38
39
  protected sanitizeObject(resource: string): string;
39
40
  }
@@ -1,2 +1,14 @@
1
- declare const createResourceRouteInjectable: import("@ogre-tools/injectable").Injectable<import("../../router/route").Route<string, "/api/stack">, import("../../router/route").Route<string, "/api/stack">, void>;
1
+ declare const createResourceRouteInjectable: import("@ogre-tools/injectable").Injectable<import("../../router/route").Route<{
2
+ callWasSuccessful: true;
3
+ response: string;
4
+ } | {
5
+ callWasSuccessful: false;
6
+ error: string;
7
+ }, "/api/stack">, import("../../router/route").Route<{
8
+ callWasSuccessful: true;
9
+ response: string;
10
+ } | {
11
+ callWasSuccessful: false;
12
+ error: string;
13
+ }, "/api/stack">, void>;
2
14
  export default createResourceRouteInjectable;
@@ -8,7 +8,7 @@ import type WebSocket from "ws";
8
8
  import type * as pty from "node-pty";
9
9
  import { type TerminalMessage } from "../../common/terminal/channels";
10
10
  import type { Logger } from "../../common/logger";
11
- import type { ComputeShellEnvironment } from "../utils/shell-env/compute-shell-environment.injectable";
11
+ import type { ComputeShellEnvironment } from "../../features/shell-sync/main/compute-shell-environment.injectable";
12
12
  import type { SpawnPty } from "./spawn-pty.injectable";
13
13
  import type { InitializableState } from "../../common/initializable-state/create";
14
14
  import type { EmitAppEvent } from "../../common/app-event-bus/emit-event.injectable";
@@ -2,6 +2,7 @@ import type { IComputedValue } from "mobx";
2
2
  import type { SingleValue } from "react-select";
3
3
  import type { HelmChartVersion } from "../../+helm-charts/helm-charts/versions";
4
4
  import type { HelmRelease } from "../../../../common/k8s-api/endpoints/helm-releases.api";
5
+ import type { AsyncResult } from "../../../../common/utils/async-result";
5
6
  import type { SelectOption } from "../../select";
6
7
  export interface UpgradeChartModel {
7
8
  readonly release: HelmRelease;
@@ -16,10 +17,7 @@ export interface UpgradeChartModel {
16
17
  readonly value: IComputedValue<HelmChartVersion | undefined>;
17
18
  set: (value: SingleValue<SelectOption<HelmChartVersion>>) => void;
18
19
  };
19
- submit: () => Promise<UpgradeChartSubmitResult>;
20
- }
21
- export interface UpgradeChartSubmitResult {
22
- completedSuccessfully: boolean;
20
+ submit: () => Promise<AsyncResult<void, string>>;
23
21
  }
24
22
  declare const upgradeChartModelInjectable: import("@ogre-tools/injectable").Injectable<Promise<UpgradeChartModel>, unknown, Required<import("../dock/store").DockTabCreate>>;
25
23
  export default upgradeChartModelInjectable;
@@ -14,7 +14,7 @@ interface Dependencies {
14
14
  model: UpgradeChartModel;
15
15
  }
16
16
  export declare class NonInjectedUpgradeChart extends React.Component<UpgradeChartProps & Dependencies> {
17
- upgrade: () => Promise<JSX.Element | null>;
17
+ upgrade: () => Promise<JSX.Element>;
18
18
  render(): JSX.Element;
19
19
  }
20
20
  export declare const UpgradeChart: React.FunctionComponent<UpgradeChartProps>;
@@ -22,14 +22,6 @@ export declare function requestInitialClusterStates(): Promise<{
22
22
  id: string;
23
23
  state: ClusterState;
24
24
  }[]>;
25
- export declare function requestKubectlApplyAll(clusterId: ClusterId, resources: string[], kubectlArgs: string[]): Promise<{
26
- stderr?: string;
27
- stdout?: string;
28
- }>;
29
- export declare function requestKubectlDeleteAll(clusterId: ClusterId, resources: string[], kubectlArgs: string[]): Promise<{
30
- stderr?: string;
31
- stdout?: string;
32
- }>;
33
25
  export declare function requestInitialExtensionDiscovery(): Promise<{
34
26
  isLoaded: boolean;
35
27
  }>;
@@ -0,0 +1,2 @@
1
+ declare const kubectlApplyAllInjectable: import("@ogre-tools/injectable").Injectable<(req: import("../../common/kube-helpers/channels").KubectlApplyAllArgs) => Promise<import("../../common/utils/async-result").AsyncResult<string, string>>, (req: import("../../common/kube-helpers/channels").KubectlApplyAllArgs) => Promise<import("../../common/utils/async-result").AsyncResult<string, string>>, void>;
2
+ export default kubectlApplyAllInjectable;
@@ -0,0 +1,2 @@
1
+ declare const kubectlDeleteAllInjectable: import("@ogre-tools/injectable").Injectable<(req: import("../../common/kube-helpers/channels").KubectlDeleteAllArgs) => Promise<import("../../common/utils/async-result").AsyncResult<string, string>>, (req: import("../../common/kube-helpers/channels").KubectlDeleteAllArgs) => Promise<import("../../common/utils/async-result").AsyncResult<string, string>>, void>;
2
+ export default kubectlDeleteAllInjectable;
@@ -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="jest" />
6
+ /**
7
+ * Conditionally run a test
8
+ */
9
+ export declare function itIf(condition: boolean): jest.It;
10
+ /**
11
+ * Conditionally run a block of tests
12
+ */
13
+ export declare function describeIf(condition: boolean): jest.Describe;
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": "6.3.0-git.6d7090f8a7.0",
5
+ "version": "6.3.0-git.8897bfc26b.0",
6
6
  "copyright": "© 2022 OpenLens Authors",
7
7
  "license": "MIT",
8
8
  "main": "dist/src/extensions/extension-api.js",
@@ -1 +0,0 @@
1
- export {};
@@ -1,24 +0,0 @@
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 DSTRootCAX3 = "-----BEGIN CERTIFICATE-----\nMIIDSjCCAjKgAwIBAgIQRK+wgNajJ7qJMDmGLvhAazANBgkqhkiG9w0BAQUFADA/\nMSQwIgYDVQQKExtEaWdpdGFsIFNpZ25hdHVyZSBUcnVzdCBDby4xFzAVBgNVBAMT\nDkRTVCBSb290IENBIFgzMB4XDTAwMDkzMDIxMTIxOVoXDTIxMDkzMDE0MDExNVow\nPzEkMCIGA1UEChMbRGlnaXRhbCBTaWduYXR1cmUgVHJ1c3QgQ28uMRcwFQYDVQQD\nEw5EU1QgUm9vdCBDQSBYMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB\nAN+v6ZdQCINXtMxiZfaQguzH0yxrMMpb7NnDfcdAwRgUi+DoM3ZJKuM/IUmTrE4O\nrz5Iy2Xu/NMhD2XSKtkyj4zl93ewEnu1lcCJo6m67XMuegwGMoOifooUMM0RoOEq\nOLl5CjH9UL2AZd+3UWODyOKIYepLYYHsUmu5ouJLGiifSKOeDNoJjj4XLh7dIN9b\nxiqKqy69cK3FCxolkHRyxXtqqzTWMIn/5WgTe1QLyNau7Fqckh49ZLOMxt+/yUFw\n7BZy1SbsOFU5Q9D8/RhcQPGX69Wam40dutolucbY38EVAjqr2m7xPi71XAicPNaD\naeQQmxkqtilX4+U9m5/wAl0CAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNV\nHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFMSnsaR7LHH62+FLkHX/xBVghYkQMA0GCSqG\nSIb3DQEBBQUAA4IBAQCjGiybFwBcqR7uKGY3Or+Dxz9LwwmglSBd49lZRNI+DT69\nikugdB/OEIKcdBodfpga3csTS7MgROSR6cz8faXbauX+5v3gTt23ADq1cEmv8uXr\nAvHRAosZy5Q6XkjEGB5YGV8eAlrwDPGxrancWYaLbumR9YbK+rlmM6pZW87ipxZz\nR8srzJmwN0jP41ZL9c8PDHIyh8bwRLtTcm1D9SZImlJnt1ir/md2cXjbDaJWFBM5\nJDGFoqgCWjBH4d1QB7wCCZAA62RjYJsWvIjJEubSfZGL+T0yjWW06XyxV3bqxbYo\nOb8VZRzI9neWagqNdwvYkQsEjgfbKbYK7p2CNTUQ\n-----END CERTIFICATE-----\n";
6
- export declare function isCertActive(cert: string): boolean;
7
- /**
8
- * Get root CA certificate from MacOSX system keychain
9
- * Only return non-expred certificates.
10
- */
11
- export declare function getMacRootCA(): Promise<string[]>;
12
- /**
13
- * Get root CA certificate from Windows system certificate store.
14
- * Only return non-expred certificates.
15
- */
16
- export declare function getWinRootCA(): Promise<string[]>;
17
- /**
18
- * Add (or merge) CAs to https.globalAgent.options.ca
19
- */
20
- export declare function injectCAs(CAs: string[]): void;
21
- /**
22
- * Inject CAs found in OS's (Windoes/MacOSX only) root certificate store to https.globalAgent.options.ca
23
- */
24
- export declare function injectSystemCAs(): Promise<void>;
@@ -1,17 +0,0 @@
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
- * A OnceCell is an object that wraps some function that produces a value.
7
- *
8
- * It then only calls the function on the first call to `get()` and returns the
9
- * same instance/value on every subsequent call.
10
- */
11
- export interface LazyInitialized<T> {
12
- get(): T;
13
- }
14
- /**
15
- * A function to make a `OnceCell<T>`
16
- */
17
- export declare function lazyInitialized<T>(builder: () => T): LazyInitialized<T>;
@@ -1,8 +0,0 @@
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 * as selfsigned from "selfsigned";
6
- type SelfSignedGenerate = typeof selfsigned.generate;
7
- export declare function getKubeAuthProxyCertificate(hostname: string, generate: SelfSignedGenerate): selfsigned.SelfSignedCert;
8
- export {};
@@ -1,14 +0,0 @@
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 { PrometheusLens } from "./lens";
6
- import type { CoreV1Api } from "@kubernetes/client-node";
7
- import type { PrometheusService } from "./provider-registry";
8
- export declare class PrometheusHelm14 extends PrometheusLens {
9
- readonly id: string;
10
- readonly name: string;
11
- readonly rateAccuracy: string;
12
- readonly isConfigurable: boolean;
13
- getPrometheusService(client: CoreV1Api): Promise<PrometheusService>;
14
- }
@@ -1,14 +0,0 @@
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 { CoreV1Api } from "@kubernetes/client-node";
6
- import { PrometheusProvider, type PrometheusService } from "./provider-registry";
7
- export declare class PrometheusHelm extends PrometheusProvider {
8
- readonly id: string;
9
- readonly name: string;
10
- readonly rateAccuracy: string;
11
- readonly isConfigurable: boolean;
12
- getPrometheusService(client: CoreV1Api): Promise<PrometheusService>;
13
- getQuery(opts: Record<string, string>, queryName: string): string;
14
- }
@@ -1,15 +0,0 @@
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 { PrometheusService } from "./provider-registry";
6
- import { PrometheusProvider } from "./provider-registry";
7
- import type { CoreV1Api } from "@kubernetes/client-node";
8
- export declare class PrometheusLens extends PrometheusProvider {
9
- readonly id: string;
10
- readonly name: string;
11
- readonly rateAccuracy: string;
12
- readonly isConfigurable: boolean;
13
- getPrometheusService(client: CoreV1Api): Promise<PrometheusService>;
14
- getQuery(opts: Record<string, string>, queryName: string): string;
15
- }
@@ -1,15 +0,0 @@
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 { PrometheusService } from "./provider-registry";
6
- import { PrometheusProvider } from "./provider-registry";
7
- import type { CoreV1Api } from "@kubernetes/client-node";
8
- export declare class PrometheusOperator extends PrometheusProvider {
9
- readonly rateAccuracy: string;
10
- readonly id: string;
11
- readonly name: string;
12
- readonly isConfigurable: boolean;
13
- getPrometheusService(client: CoreV1Api): Promise<PrometheusService>;
14
- getQuery(opts: Record<string, string>, queryName: string): string;
15
- }
@@ -1,3 +0,0 @@
1
- import { PrometheusProviderRegistry } from "./provider-registry";
2
- declare const prometheusProviderRegistryInjectable: import("@ogre-tools/injectable").Injectable<PrometheusProviderRegistry, unknown, void>;
3
- export default prometheusProviderRegistryInjectable;
@@ -1,27 +0,0 @@
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 { CoreV1Api } from "@kubernetes/client-node";
6
- export interface PrometheusService {
7
- id: string;
8
- namespace: string;
9
- service: string;
10
- port: number;
11
- }
12
- export declare abstract class PrometheusProvider {
13
- abstract readonly id: string;
14
- abstract readonly name: string;
15
- abstract readonly rateAccuracy: string;
16
- abstract readonly isConfigurable: boolean;
17
- abstract getQuery(opts: Record<string, string>, queryName: string): string;
18
- abstract getPrometheusService(client: CoreV1Api): Promise<PrometheusService | undefined>;
19
- protected bytesSent(ingress: string, namespace: string, statuses: string): string;
20
- protected getFirstNamespacedService(client: CoreV1Api, ...selectors: string[]): Promise<PrometheusService>;
21
- protected getNamespacedService(client: CoreV1Api, name: string, namespace: string): Promise<PrometheusService>;
22
- }
23
- export declare class PrometheusProviderRegistry {
24
- providers: Map<string, PrometheusProvider>;
25
- getByKind(kind: string): PrometheusProvider;
26
- registerProvider(provider: PrometheusProvider): this;
27
- }
@@ -1,15 +0,0 @@
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 { PrometheusService } from "./provider-registry";
6
- import { PrometheusProvider } from "./provider-registry";
7
- import type { CoreV1Api } from "@kubernetes/client-node";
8
- export declare class PrometheusStacklight extends PrometheusProvider {
9
- readonly id: string;
10
- readonly name: string;
11
- readonly rateAccuracy: string;
12
- readonly isConfigurable: boolean;
13
- getPrometheusService(client: CoreV1Api): Promise<PrometheusService>;
14
- getQuery(opts: Record<string, string>, queryName: string): string;
15
- }
@@ -1,5 +0,0 @@
1
- declare const setupPrometheusRegistryInjectable: import("@ogre-tools/injectable").Injectable<{
2
- id: string;
3
- run: () => void;
4
- }, import("../../../common/runnable/run-many-for").Runnable<void>, void>;
5
- export default setupPrometheusRegistryInjectable;