@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.
Files changed (97) hide show
  1. package/dist/src/common/cluster/cluster.d.ts +13 -23
  2. package/dist/src/common/cluster/request-namespace-list-permissions.injectable.d.ts +18 -0
  3. package/dist/src/common/cluster-store/allowed-resources-injection-token.d.ts +2 -1
  4. package/dist/src/common/fetch/download-json/impl.d.ts +11 -0
  5. package/dist/src/common/fetch/download-json/normal.injectable.d.ts +2 -0
  6. package/dist/src/common/fetch/download-json/proxy.injectable.d.ts +2 -0
  7. package/dist/src/common/fetch/fetch-module.injectable.d.ts +7 -0
  8. package/dist/src/common/fetch/fetch.injectable.d.ts +1 -3
  9. package/dist/src/common/fetch/proxy-fetch.injectable.d.ts +3 -0
  10. package/dist/src/common/k8s-api/api-base-configs.d.ts +6 -0
  11. package/dist/src/common/k8s-api/api-base.injectable.d.ts +2 -0
  12. package/dist/src/common/k8s-api/api-manager/resource.store.d.ts +2 -1
  13. package/dist/src/common/k8s-api/endpoints/helm-charts.api/request-readme.injectable.d.ts +2 -1
  14. package/dist/src/common/k8s-api/endpoints/helm-charts.api/request-values.injectable.d.ts +2 -1
  15. package/dist/src/common/k8s-api/endpoints/resource-applier.api/request-patch.injectable.d.ts +2 -1
  16. package/dist/src/common/k8s-api/endpoints/resource-applier.api/request-update.injectable.d.ts +2 -1
  17. package/dist/src/common/k8s-api/kube-api.d.ts +5 -4
  18. package/dist/src/common/k8s-api/kube-object.store.d.ts +8 -16
  19. package/dist/src/common/logger.d.ts +2 -2
  20. package/dist/src/common/rbac.d.ts +12 -4
  21. package/dist/src/common/utils/computed-or.d.ts +6 -0
  22. package/dist/src/common/utils/iter.d.ts +2 -2
  23. package/dist/src/common/utils/with-concurrency-limit.d.ts +2 -0
  24. package/dist/src/common/vars.d.ts +0 -16
  25. package/dist/src/extensions/common-api/k8s-api.d.ts +21 -1
  26. package/dist/src/extensions/extension-api.js +2573 -1406
  27. package/dist/src/extensions/extension-discovery/bundled-extension-token.d.ts +11 -0
  28. package/dist/src/extensions/extension-discovery/extension-discovery.d.ts +1 -4
  29. package/dist/src/{common/configure-packages.d.ts → extensions/extension-loader/entry-point-name.d.ts} +1 -4
  30. package/dist/src/extensions/extension-loader/extension-loader.d.ts +12 -8
  31. package/dist/src/extensions/renderer-api/k8s-api.d.ts +1 -1
  32. package/dist/src/main/cluster/request-api-resources.injectable.d.ts +13 -0
  33. package/dist/src/main/cluster/request-api-versions.d.ts +11 -0
  34. package/dist/src/main/cluster/request-core-api-versions.injectable.d.ts +5 -0
  35. package/dist/src/main/cluster/request-kube-api-resources-for.injectable.d.ts +7 -0
  36. package/dist/src/main/cluster/request-non-core-api-versions.injectable.d.ts +5 -0
  37. package/dist/src/main/create-cluster/allowed-resources.injectable.d.ts +2 -1
  38. package/dist/src/main/extension-loader/entry-point-name.injectable.d.ts +2 -0
  39. package/dist/src/main/k8s/api-base-host-header.injectable.d.ts +2 -0
  40. package/dist/src/main/k8s/api-base-server-address.injectable.d.ts +2 -0
  41. package/dist/src/main/k8s-request.injectable.d.ts +2 -2
  42. package/dist/src/main/routes/resource-applier/create-resource-route.injectable.d.ts +5 -5
  43. package/dist/src/main/shell-session/node-shell-session/open.injectable.d.ts +2 -1
  44. package/dist/src/renderer/before-frame-starts/tokens.d.ts +5 -3
  45. package/dist/src/renderer/cluster/accessible-namespaces.injectable.d.ts +2 -0
  46. package/dist/src/renderer/{create-cluster → cluster}/create-cluster.injectable.d.ts +0 -0
  47. package/dist/src/renderer/cluster-frame-context/cluster-frame-context.d.ts +9 -14
  48. package/dist/src/renderer/cluster-frame-context/for-cluster-scoped-resources.injectable.d.ts +3 -0
  49. package/dist/src/renderer/cluster-frame-context/for-namespaced-resources.injectable.d.ts +3 -0
  50. package/dist/src/renderer/cluster-frame-context/should-show-resource.injectable.d.ts +3 -0
  51. package/dist/src/renderer/components/+cluster/cluster-overview-store/cluster-overview-store.d.ts +2 -1
  52. package/dist/src/renderer/components/+custom-resources/definition.store.d.ts +2 -2
  53. package/dist/src/renderer/components/+events/store.d.ts +4 -5
  54. package/dist/src/renderer/components/+namespaces/store.d.ts +5 -6
  55. package/dist/src/renderer/components/+nodes/store.d.ts +2 -2
  56. package/dist/src/renderer/components/+storage-classes/store.d.ts +2 -2
  57. package/dist/src/renderer/components/+workloads-cronjobs/store.d.ts +2 -2
  58. package/dist/src/renderer/components/+workloads-daemonsets/store.d.ts +2 -2
  59. package/dist/src/renderer/components/+workloads-deployments/store.d.ts +2 -2
  60. package/dist/src/renderer/components/+workloads-jobs/store.d.ts +2 -2
  61. package/dist/src/renderer/components/+workloads-overview/workloads/implementations/cron-jobs-workload.injectable.d.ts +4 -1
  62. package/dist/src/renderer/components/+workloads-overview/workloads/implementations/daemonsets-workload.injectable.d.ts +4 -1
  63. package/dist/src/renderer/components/+workloads-overview/workloads/implementations/deployments-workload.injectable.d.ts +4 -1
  64. package/dist/src/renderer/components/+workloads-overview/workloads/implementations/jobs-workload.injectable.d.ts +4 -1
  65. package/dist/src/renderer/components/+workloads-overview/workloads/implementations/pods-workload.injectable.d.ts +4 -1
  66. package/dist/src/renderer/components/+workloads-overview/workloads/implementations/replicasets-workload.injectable.d.ts +4 -1
  67. package/dist/src/renderer/components/+workloads-overview/workloads/implementations/statefulsets-workload.injectable.d.ts +4 -1
  68. package/dist/src/renderer/components/+workloads-overview/workloads/workload-injection-token.d.ts +2 -1
  69. package/dist/src/renderer/components/+workloads-overview/workloads/workloads.injectable.d.ts +1 -2
  70. package/dist/src/renderer/components/+workloads-pods/load-pods-from-all-namespaces.injectable.d.ts +6 -0
  71. package/dist/src/renderer/components/+workloads-pods/store.d.ts +2 -2
  72. package/dist/src/renderer/components/+workloads-replicasets/store.d.ts +4 -5
  73. package/dist/src/renderer/components/+workloads-statefulsets/store.d.ts +2 -2
  74. package/dist/src/renderer/components/input/search-input.d.ts +1 -11
  75. package/dist/src/renderer/components/test-utils/get-application-builder.d.ts +2 -2
  76. package/dist/src/renderer/extension-loader/entry-point-name.injectable.d.ts +2 -0
  77. package/dist/src/renderer/frames/cluster-frame/init-cluster-frame/init-cluster-frame.d.ts +5 -3
  78. package/dist/src/renderer/frames/load-extensions.injectable.d.ts +1 -4
  79. package/dist/src/renderer/k8s/api-base-host-header.injectable.d.ts +2 -0
  80. package/dist/src/renderer/k8s/api-base-server-address.injectable.d.ts +2 -0
  81. package/dist/src/renderer/kube-watch-api/kube-watch-api.d.ts +3 -3
  82. package/dist/src/renderer/navigation/events.d.ts +0 -2
  83. package/dist/src/renderer/navigation/setup-logging-for-navigation.injectable.d.ts +5 -0
  84. package/dist/src/test-utils/mock-responses.d.ts +8 -0
  85. package/package.json +1 -1
  86. package/dist/src/common/cluster/authorization-namespace-review.injectable.d.ts +0 -19
  87. package/dist/src/common/cluster/is-allowed-resource.d.ts +0 -1
  88. package/dist/src/common/cluster/list-api-resources.injectable.d.ts +0 -13
  89. package/dist/src/common/fetch/download-json.injectable.d.ts +0 -7
  90. package/dist/src/common/k8s-api/api-base.d.ts +0 -6
  91. package/dist/src/common/k8s-api/api-manager/auto-registration.injectable.d.ts +0 -2
  92. package/dist/src/common/k8s-api/cluster-context.d.ts +0 -11
  93. package/dist/src/common/utils/is-allowed-resource.injectable.d.ts +0 -4
  94. package/dist/src/main/k8s/api-base.injectable.d.ts +0 -2
  95. package/dist/src/renderer/cluster-frame-context/allowed-resources.injectable.d.ts +0 -2
  96. package/dist/src/renderer/cluster-frame-context/cluster-frame-context.injectable.d.ts +0 -3
  97. package/dist/src/renderer/k8s/api-base.injectable.d.ts +0 -2
@@ -4,9 +4,9 @@
4
4
  */
5
5
  import type { GetPodsByOwnerId } from "../+workloads-pods/get-pods-by-owner-id.injectable";
6
6
  import type { StatefulSet, StatefulSetApi } from "../../../common/k8s-api/endpoints";
7
- import type { KubeObjectStoreOptions } from "../../../common/k8s-api/kube-object.store";
7
+ import type { KubeObjectStoreDependencies, KubeObjectStoreOptions } from "../../../common/k8s-api/kube-object.store";
8
8
  import { KubeObjectStore } from "../../../common/k8s-api/kube-object.store";
9
- interface Dependencies {
9
+ interface Dependencies extends KubeObjectStoreDependencies {
10
10
  getPodsByOwnerId: GetPodsByOwnerId;
11
11
  }
12
12
  export declare class StatefulSetStore extends KubeObjectStore<StatefulSet, StatefulSetApi> {
@@ -11,14 +11,4 @@ export interface SearchInputProps extends InputProps {
11
11
  showClearIcon?: boolean;
12
12
  onClear?(): void;
13
13
  }
14
- export declare class SearchInput extends React.Component<SearchInputProps> {
15
- static defaultProps: object;
16
- private inputRef;
17
- constructor(props: SearchInputProps);
18
- componentDidMount(): void;
19
- componentWillUnmount(): void;
20
- onGlobalKey(evt: KeyboardEvent): void;
21
- onKeyDown(evt: React.KeyboardEvent<any>): void;
22
- clear(): void;
23
- render(): JSX.Element;
24
- }
14
+ export declare const SearchInput: React.FunctionComponent<SearchInputProps>;
@@ -5,7 +5,7 @@
5
5
  import type { LensRendererExtension } from "../../../extensions/lens-renderer-extension";
6
6
  import type { ObservableMap } from "mobx";
7
7
  import type { RenderResult } from "@testing-library/react";
8
- import type { KubeResource } from "../../../common/rbac";
8
+ import type { KubeApiResourceDescriptor } from "../../../common/rbac";
9
9
  import type { DiContainer, Injectable } from "@ogre-tools/injectable";
10
10
  import type { NavigateToHelmCharts } from "../../../common/front-end-routing/routes/cluster/helm/charts/navigate-to-helm-charts.injectable";
11
11
  import type { MinimalTrayMenuItem } from "../../../main/tray/electron-tray/electron-tray.injectable";
@@ -39,7 +39,7 @@ export interface ApplicationBuilder {
39
39
  getAll: () => LensWindowWithHelpers[];
40
40
  create: (id: string) => LensWindowWithHelpers;
41
41
  };
42
- allowKubeResource: (resourceName: KubeResource) => ApplicationBuilder;
42
+ allowKubeResource: (resource: KubeApiResourceDescriptor) => ApplicationBuilder;
43
43
  beforeApplicationStart: (callback: Callback) => ApplicationBuilder;
44
44
  afterApplicationStart: (callback: Callback) => ApplicationBuilder;
45
45
  beforeWindowStart: (callback: Callback) => ApplicationBuilder;
@@ -0,0 +1,2 @@
1
+ declare const extensionEntryPointNameInjectable: import("@ogre-tools/injectable").Injectable<"renderer", "main" | "renderer", void>;
2
+ export default extensionEntryPointNameInjectable;
@@ -4,15 +4,17 @@
4
4
  */
5
5
  import type { Cluster } from "../../../../common/cluster/cluster";
6
6
  import type { CatalogEntityRegistry } from "../../../api/catalog/entity/registry";
7
- import type { ClusterFrameContext } from "../../../cluster-frame-context/cluster-frame-context";
7
+ import type { ShowNotification } from "../../../components/notifications";
8
8
  import type { EmitAppEvent } from "../../../../common/app-event-bus/emit-event.injectable";
9
+ import type { Logger } from "../../../../common/logger";
9
10
  interface Dependencies {
10
11
  hostedCluster: Cluster;
11
12
  loadExtensions: () => void;
12
13
  catalogEntityRegistry: CatalogEntityRegistry;
13
14
  frameRoutingId: number;
14
15
  emitAppEvent: EmitAppEvent;
15
- clusterFrameContext: ClusterFrameContext;
16
+ logger: Logger;
17
+ showErrorNotification: ShowNotification;
16
18
  }
17
- export declare const initClusterFrame: ({ hostedCluster, loadExtensions, catalogEntityRegistry, frameRoutingId, emitAppEvent, clusterFrameContext, }: Dependencies) => (unmountRoot: () => void) => Promise<void>;
19
+ export declare const initClusterFrame: ({ hostedCluster, loadExtensions, catalogEntityRegistry, frameRoutingId, emitAppEvent, logger, showErrorNotification, }: Dependencies) => (unmountRoot: () => void) => Promise<void>;
18
20
  export {};
@@ -1,5 +1,2 @@
1
- declare const loadExtensionsInjectable: import("@ogre-tools/injectable").Injectable<() => Promise<{
2
- isBundled: boolean;
3
- loaded: Promise<void>;
4
- }[]>, unknown, void>;
1
+ declare const loadExtensionsInjectable: import("@ogre-tools/injectable").Injectable<() => Promise<import("../../extensions/extension-loader").ExtensionLoading[]>, unknown, void>;
5
2
  export default loadExtensionsInjectable;
@@ -0,0 +1,2 @@
1
+ declare const apiBaseHostHeaderInjectable: import("@ogre-tools/injectable").Injectable<string, string, void>;
2
+ export default apiBaseHostHeaderInjectable;
@@ -0,0 +1,2 @@
1
+ declare const apiBaseServerAddressInjectable: import("@ogre-tools/injectable").Injectable<string, string, void>;
2
+ export default apiBaseServerAddressInjectable;
@@ -1,6 +1,6 @@
1
1
  import type { Disposer } from "../../common/utils";
2
- import type { ClusterFrameContext } from "../cluster-frame-context/cluster-frame-context";
3
2
  import type { KubeObjectStoreLoadAllParams, KubeObjectStoreSubscribeParams } from "../../common/k8s-api/kube-object.store";
3
+ import type { ClusterContext } from "../cluster-frame-context/cluster-frame-context";
4
4
  export interface KubeWatchSubscribeStoreOptions {
5
5
  /**
6
6
  * The namespaces to watch
@@ -14,7 +14,7 @@ export interface KubeWatchSubscribeStoreOptions {
14
14
  onLoadFailure?: (err: any) => void;
15
15
  }
16
16
  interface Dependencies {
17
- clusterFrameContext: ClusterFrameContext;
17
+ readonly clusterContext: ClusterContext;
18
18
  }
19
19
  export interface SubscribableStore {
20
20
  readonly api: {
@@ -28,7 +28,7 @@ export interface SubscribableStore {
28
28
  export type SubscribeStores = (stores: SubscribableStore[], opts?: KubeWatchSubscribeStoreOptions) => Disposer;
29
29
  export declare class KubeWatchApi {
30
30
  #private;
31
- private dependencies;
31
+ private readonly dependencies;
32
32
  constructor(dependencies: Dependencies);
33
33
  private subscribeStore;
34
34
  subscribeStores: SubscribeStores;
@@ -3,9 +3,7 @@
3
3
  * Licensed under MIT License. See LICENSE in root directory for more information.
4
4
  */
5
5
  export declare const enum IpcRendererNavigationEvents {
6
- CLUSTER_VIEW_CURRENT_ID = "renderer:cluster-id-of-active-view",
7
6
  NAVIGATE_IN_APP = "renderer:navigate",
8
7
  NAVIGATE_IN_CLUSTER = "renderer:navigate-in-cluster",
9
8
  LOADED = "renderer:loaded"
10
9
  }
11
- export declare function bindEvents(): void;
@@ -0,0 +1,5 @@
1
+ declare const setupLoggingForNavigationInjectable: import("@ogre-tools/injectable").Injectable<{
2
+ id: string;
3
+ run: () => void;
4
+ }, import("../../common/runnable/run-many-for").Runnable<void>, void>;
5
+ export default setupLoggingForNavigationInjectable;
@@ -0,0 +1,8 @@
1
+ /// <reference types="jest" />
2
+ /**
3
+ * Copyright (c) OpenLens Authors. All rights reserved.
4
+ * Licensed under MIT License. See LICENSE in root directory for more information.
5
+ */
6
+ import type { Response } from "node-fetch";
7
+ export declare const createMockResponseFromString: (url: string, data: string, statusCode?: number) => jest.Mocked<Response>;
8
+ export declare const createMockResponseFromStream: (url: string, stream: NodeJS.ReadableStream, statusCode?: number) => jest.Mocked<Response>;
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.fbaa9de007.0",
5
+ "version": "6.3.1-git.6aee907dc5.0",
6
6
  "copyright": "© 2022 OpenLens Authors",
7
7
  "license": "MIT",
8
8
  "main": "dist/src/extensions/extension-api.js",
@@ -1,19 +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 { KubeConfig } from "@kubernetes/client-node";
6
- import type { KubeApiResource } from "../rbac";
7
- /**
8
- * Requests the permissions for actions on the kube cluster
9
- * @param namespace The namespace of the resources
10
- * @param availableResources List of available resources in the cluster to resolve glob values fir api groups
11
- * @returns list of allowed resources names
12
- */
13
- export type RequestNamespaceResources = (namespace: string, availableResources: KubeApiResource[]) => Promise<string[]>;
14
- /**
15
- * @param proxyConfig This config's `currentContext` field must be set, and will be used as the target cluster
16
- */
17
- export type AuthorizationNamespaceReview = (proxyConfig: KubeConfig) => RequestNamespaceResources;
18
- declare const authorizationNamespaceReviewInjectable: import("@ogre-tools/injectable").Injectable<AuthorizationNamespaceReview, unknown, void>;
19
- export default authorizationNamespaceReviewInjectable;
@@ -1 +0,0 @@
1
- export declare const isAllowedResource: (allowedResources: string[]) => (kind: string) => boolean;
@@ -1,13 +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 { KubeApiResource } from "../rbac";
6
- import type { Cluster } from "./cluster";
7
- export type RequestListApiResources = () => Promise<KubeApiResource[]>;
8
- /**
9
- * @param proxyConfig This config's `currentContext` field must be set, and will be used as the target cluster
10
- */
11
- export type ListApiResources = (cluster: Cluster) => RequestListApiResources;
12
- declare const listApiResourcesInjectable: import("@ogre-tools/injectable").Injectable<ListApiResources, unknown, void>;
13
- export default listApiResourcesInjectable;
@@ -1,7 +0,0 @@
1
- import type { AsyncResult } from "../utils/async-result";
2
- export interface DownloadJsonOptions {
3
- signal?: AbortSignal | null | undefined;
4
- }
5
- export type DownloadJson = (url: string, opts?: DownloadJsonOptions) => Promise<AsyncResult<unknown, string>>;
6
- declare const downloadJsonInjectable: import("@ogre-tools/injectable").Injectable<DownloadJson, unknown, void>;
7
- export default downloadJsonInjectable;
@@ -1,6 +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 { JsonApi } from "./json-api";
6
- export declare const apiBaseInjectionToken: import("@ogre-tools/injectable").InjectionToken<JsonApi<import("./json-api").JsonApiData, import("./json-api").JsonApiParams<import("./json-api").JsonApiData>>, void>;
@@ -1,2 +0,0 @@
1
- declare const autoRegistrationInjectable: import("@ogre-tools/injectable").Injectable<void, unknown, void>;
2
- export default autoRegistrationInjectable;
@@ -1,11 +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 { Cluster } from "../cluster/cluster";
6
- export interface ClusterContext {
7
- cluster: Cluster;
8
- allNamespaces: string[];
9
- contextNamespaces: string[];
10
- hasSelectedAll: boolean;
11
- }
@@ -1,4 +0,0 @@
1
- import type { KubeResource } from "../rbac";
2
- export type IsAllowedResource = (resource: KubeResource) => boolean;
3
- declare const isAllowedResourceInjectable: import("@ogre-tools/injectable").Injectable<import("mobx").IComputedValue<boolean>, unknown, string>;
4
- export default isAllowedResourceInjectable;
@@ -1,2 +0,0 @@
1
- declare const apiBaseInjectable: import("@ogre-tools/injectable").Injectable<import("../../common/k8s-api/json-api").JsonApi<import("../../common/k8s-api/json-api").JsonApiData, import("../../common/k8s-api/json-api").JsonApiParams<import("../../common/k8s-api/json-api").JsonApiData>>, import("../../common/k8s-api/json-api").JsonApi<import("../../common/k8s-api/json-api").JsonApiData, import("../../common/k8s-api/json-api").JsonApiParams<import("../../common/k8s-api/json-api").JsonApiData>>, void>;
2
- export default apiBaseInjectable;
@@ -1,2 +0,0 @@
1
- declare const allowedResourcesInjectable: import("@ogre-tools/injectable").Injectable<import("mobx").IComputedValue<Set<string>>, import("mobx").IComputedValue<Set<string>>, void>;
2
- export default allowedResourcesInjectable;
@@ -1,3 +0,0 @@
1
- import { ClusterFrameContext } from "./cluster-frame-context";
2
- declare const clusterFrameContextInjectable: import("@ogre-tools/injectable").Injectable<ClusterFrameContext, unknown, void>;
3
- export default clusterFrameContextInjectable;
@@ -1,2 +0,0 @@
1
- declare const apiBaseInjectable: import("@ogre-tools/injectable").Injectable<import("../../common/k8s-api/json-api").JsonApi<import("../../common/k8s-api/json-api").JsonApiData, import("../../common/k8s-api/json-api").JsonApiParams<import("../../common/k8s-api/json-api").JsonApiData>>, import("../../common/k8s-api/json-api").JsonApi<import("../../common/k8s-api/json-api").JsonApiData, import("../../common/k8s-api/json-api").JsonApiParams<import("../../common/k8s-api/json-api").JsonApiData>>, void>;
2
- export default apiBaseInjectable;