@k8slens/extensions 5.2.3 → 5.3.0-git.07c8177a97.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 (66) hide show
  1. package/dist/src/common/catalog/catalog-category-registry.d.ts +9 -0
  2. package/dist/src/common/catalog/catalog-entity.d.ts +18 -0
  3. package/dist/src/common/catalog/catalog-run-event.d.ts +30 -0
  4. package/dist/src/common/catalog-entities/__tests__/kubernetes-cluster.test.d.ts +1 -0
  5. package/dist/src/common/k8s-api/endpoints/resource-applier.api.d.ts +4 -4
  6. package/dist/src/common/k8s-api/kube-api.d.ts +20 -2
  7. package/dist/src/common/k8s-api/kube-object.d.ts +18 -1
  8. package/dist/src/common/k8s-api/kube-object.store.d.ts +3 -0
  9. package/dist/src/common/routes/catalog.d.ts +2 -0
  10. package/dist/src/common/routes/index.d.ts +1 -0
  11. package/dist/src/common/routes/port-forwards.d.ts +25 -0
  12. package/dist/src/common/user-store/preferences-helpers.d.ts +1 -0
  13. package/dist/src/common/user-store/user-store.d.ts +1 -0
  14. package/dist/src/extensions/extension-api.js +3313 -354
  15. package/dist/src/extensions/lens-renderer-extension.d.ts +9 -2
  16. package/dist/src/extensions/main-api/k8s-api.d.ts +2 -2
  17. package/dist/src/extensions/registries/command-registry.d.ts +2 -2
  18. package/dist/src/extensions/renderer-api/catalog.d.ts +11 -0
  19. package/dist/src/extensions/renderer-api/k8s-api.d.ts +2 -2
  20. package/dist/src/main/{routes/utils/index.d.ts → __test__/lens-proxy.test.d.ts} +1 -1
  21. package/dist/src/main/context-handler.d.ts +1 -1
  22. package/dist/src/main/lens-proxy.d.ts +1 -0
  23. package/dist/src/main/resource-applier.d.ts +9 -0
  24. package/dist/src/main/routes/port-forward-route.d.ts +3 -0
  25. package/dist/src/main/routes/resource-applier-route.d.ts +1 -0
  26. package/dist/src/main/utils/__test__/update-channel.test.d.ts +21 -0
  27. package/dist/src/main/utils/http-responses.d.ts +20 -1
  28. package/dist/src/main/{routes/utils → utils}/parse-query.d.ts +0 -0
  29. package/dist/src/main/utils/update-channel.d.ts +21 -0
  30. package/dist/src/renderer/api/catalog-category-registry.d.ts +1 -0
  31. package/dist/src/renderer/api/catalog-entity-registry.d.ts +20 -0
  32. package/dist/src/renderer/bootstrap.d.ts +1 -1
  33. package/dist/src/renderer/components/+add-cluster/add-cluster.d.ts +1 -1
  34. package/dist/src/renderer/components/+catalog/__tests__/catalog-add-button.test.d.ts +1 -0
  35. package/dist/src/renderer/components/+catalog/catalog-entity-details.d.ts +1 -1
  36. package/dist/src/renderer/components/+catalog/catalog-entity-drawer-menu.d.ts +1 -1
  37. package/dist/src/renderer/components/+catalog/catalog-entity-item.d.ts +23 -0
  38. package/dist/src/renderer/components/+catalog/catalog-entity.store.d.ts +7 -23
  39. package/dist/src/renderer/components/+catalog/catalog-menu.d.ts +1 -1
  40. package/dist/src/renderer/components/+catalog/catalog.d.ts +6 -1
  41. package/dist/src/renderer/components/+catalog/catalog.test.d.ts +21 -0
  42. package/dist/src/renderer/components/+entity-settings/entity-settings.d.ts +0 -1
  43. package/dist/src/renderer/{keyboard-shortcuts → components/+network-port-forwards}/index.d.ts +1 -1
  44. package/dist/src/renderer/components/+network-port-forwards/port-forward-menu.d.ts +33 -0
  45. package/dist/src/renderer/components/+network-port-forwards/port-forwards.d.ts +28 -0
  46. package/dist/src/renderer/components/+network-services/service-port-component.d.ts +6 -0
  47. package/dist/src/renderer/components/+workloads-pods/pod-container-port.d.ts +6 -0
  48. package/dist/src/renderer/components/+workloads-pods/pod-details-container.d.ts +1 -0
  49. package/dist/src/renderer/components/activate-entity-command/activate-entity-command.d.ts +30 -0
  50. package/dist/src/renderer/components/activate-entity-command/index.d.ts +21 -0
  51. package/dist/src/renderer/components/app.d.ts +1 -1
  52. package/dist/src/renderer/components/dock/create-resource.d.ts +1 -1
  53. package/dist/src/renderer/components/dock/dock.store.d.ts +1 -1
  54. package/dist/src/renderer/components/dock/edit-resource.store.d.ts +2 -0
  55. package/dist/src/renderer/components/dock/log-tab.store.d.ts +1 -1
  56. package/dist/src/renderer/components/dock/terminal.d.ts +2 -0
  57. package/dist/src/renderer/components/hotbar/hotbar-menu.d.ts +1 -1
  58. package/dist/src/renderer/components/menu/menu.d.ts +6 -0
  59. package/dist/src/renderer/components/switch/switcher.d.ts +1 -1
  60. package/dist/src/renderer/lens-app.d.ts +1 -1
  61. package/dist/src/renderer/navigation/history.d.ts +2 -2
  62. package/dist/src/renderer/port-forward/index.d.ts +23 -0
  63. package/dist/src/renderer/port-forward/port-forward-dialog.d.ts +46 -0
  64. package/dist/src/renderer/port-forward/port-forward-item.d.ts +46 -0
  65. package/dist/src/renderer/port-forward/port-forward.store.d.ts +39 -0
  66. package/package.json +4 -4
@@ -24,6 +24,7 @@ import { LensExtension } from "./lens-extension";
24
24
  import type { CatalogEntity } from "../common/catalog";
25
25
  import type { Disposer } from "../common/utils";
26
26
  import { EntityFilter } from "../renderer/api/catalog-entity-registry";
27
+ import { CategoryFilter } from "../renderer/api/catalog-category-registry";
27
28
  export declare class LensRendererExtension extends LensExtension {
28
29
  globalPages: registries.PageRegistration[];
29
30
  clusterPages: registries.PageRegistration[];
@@ -46,9 +47,15 @@ export declare class LensRendererExtension extends LensExtension {
46
47
  */
47
48
  isEnabledForCluster(cluster: Cluster): Promise<Boolean>;
48
49
  /**
49
- * Add a filtering function for the catalog. This will be removed if the extension is disabled.
50
- * @param fn The function which should return a truthy value for those entities which should be kepted
50
+ * Add a filtering function for the catalog entities. This will be removed if the extension is disabled.
51
+ * @param fn The function which should return a truthy value for those entities which should be kept.
51
52
  * @returns A function to clean up the filter
52
53
  */
53
54
  addCatalogFilter(fn: EntityFilter): Disposer;
55
+ /**
56
+ * Add a filtering function for the catalog categories. This will be removed if the extension is disabled.
57
+ * @param fn The function which should return a truthy value for those categories which should be kept.
58
+ * @returns A function to clean up the filter
59
+ */
60
+ addCatalogCategoryFilter(fn: CategoryFilter): Disposer;
54
61
  }
@@ -21,7 +21,7 @@
21
21
  export { isAllowedResource } from "../../common/utils/allowed-resource";
22
22
  export { ResourceStack } from "../../common/k8s/resource-stack";
23
23
  export { apiManager } from "../../common/k8s-api/api-manager";
24
- export { KubeApi, forCluster } from "../../common/k8s-api/kube-api";
24
+ export { KubeApi, forCluster, forRemoteCluster } from "../../common/k8s-api/kube-api";
25
25
  export { KubeObject } from "../../common/k8s-api/kube-object";
26
26
  export { KubeObjectStore } from "../../common/k8s-api/kube-object.store";
27
27
  export { Pod, podsApi, PodsApi } from "../../common/k8s-api/endpoints/pods.api";
@@ -53,6 +53,6 @@ export { RoleBinding, roleBindingApi } from "../../common/k8s-api/endpoints/role
53
53
  export { ClusterRole, clusterRoleApi } from "../../common/k8s-api/endpoints/cluster-role.api";
54
54
  export { ClusterRoleBinding, clusterRoleBindingApi } from "../../common/k8s-api/endpoints/cluster-role-binding.api";
55
55
  export { CustomResourceDefinition, crdApi } from "../../common/k8s-api/endpoints/crd.api";
56
- export type { IKubeApiCluster } from "../../common/k8s-api/kube-api";
56
+ export type { ILocalKubeApiConfig, IRemoteKubeApiConfig, IKubeApiCluster } from "../../common/k8s-api/kube-api";
57
57
  export type { IPodContainer, IPodContainerStatus } from "../../common/k8s-api/endpoints/pods.api";
58
58
  export type { ISecretRef } from "../../common/k8s-api/endpoints/secret.api";
@@ -21,9 +21,9 @@
21
21
  import { BaseRegistry } from "./base-registry";
22
22
  import type { LensExtension } from "../lens-extension";
23
23
  import type { CatalogEntity } from "../../common/catalog";
24
- export declare type CommandContext = {
24
+ export interface CommandContext {
25
25
  entity?: CatalogEntity;
26
- };
26
+ }
27
27
  export interface CommandRegistration {
28
28
  id: string;
29
29
  title: string;
@@ -19,6 +19,8 @@
19
19
  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20
20
  */
21
21
  import type { CatalogCategory, CatalogEntity } from "../../common/catalog";
22
+ import type { CatalogEntityOnBeforeRun } from "../../renderer/api/catalog-entity-registry";
23
+ import type { Disposer } from "../../common/utils";
22
24
  export { catalogCategoryRegistry as catalogCategories } from "../../common/catalog/catalog-category-registry";
23
25
  export declare class CatalogEntityRegistry {
24
26
  /**
@@ -29,5 +31,14 @@ export declare class CatalogEntityRegistry {
29
31
  getById(id: string): CatalogEntity<import("../../common/catalog").CatalogEntityMetadata, import("../../common/catalog").CatalogEntityStatus, import("../../common/catalog").CatalogEntitySpec>;
30
32
  getItemsForApiKind<T extends CatalogEntity>(apiVersion: string, kind: string): T[];
31
33
  getItemsForCategory<T extends CatalogEntity>(category: CatalogCategory): T[];
34
+ /**
35
+ * Add a onBeforeRun hook to a catalog entities. If `onBeforeRun` was previously
36
+ * added then it will not be added again.
37
+ * @param onBeforeRun The function to be called with a `CatalogRunEvent`
38
+ * event target will be the catalog entity. onBeforeRun hook can call event.preventDefault()
39
+ * to stop run sequence
40
+ * @returns A function to remove that hook
41
+ */
42
+ addOnBeforeRun(onBeforeRun: CatalogEntityOnBeforeRun): Disposer;
32
43
  }
33
44
  export declare const catalogEntities: CatalogEntityRegistry;
@@ -22,7 +22,7 @@ export { isAllowedResource } from "../../common/utils/allowed-resource";
22
22
  export { ResourceStack } from "../../common/k8s/resource-stack";
23
23
  export { apiManager } from "../../common/k8s-api/api-manager";
24
24
  export { KubeObjectStore } from "../../common/k8s-api/kube-object.store";
25
- export { KubeApi, forCluster } from "../../common/k8s-api/kube-api";
25
+ export { KubeApi, forCluster, forRemoteCluster } from "../../common/k8s-api/kube-api";
26
26
  export { KubeObject } from "../../common/k8s-api/kube-object";
27
27
  export { Pod, podsApi, PodsApi } from "../../common/k8s-api/endpoints";
28
28
  export { Node, nodesApi, NodesApi } from "../../common/k8s-api/endpoints";
@@ -54,7 +54,7 @@ export { ClusterRole, clusterRoleApi } from "../../common/k8s-api/endpoints";
54
54
  export { ClusterRoleBinding, clusterRoleBindingApi } from "../../common/k8s-api/endpoints";
55
55
  export { CustomResourceDefinition, crdApi } from "../../common/k8s-api/endpoints";
56
56
  export { KubeObjectStatusLevel } from "./kube-object-status";
57
- export type { IKubeApiCluster } from "../../common/k8s-api/kube-api";
57
+ export type { ILocalKubeApiConfig, IRemoteKubeApiConfig, IKubeApiCluster } from "../../common/k8s-api/kube-api";
58
58
  export type { IPodContainer, IPodContainerStatus } from "../../common/k8s-api/endpoints";
59
59
  export type { ISecretRef } from "../../common/k8s-api/endpoints";
60
60
  export type { KubeObjectStatus } from "./kube-object-status";
@@ -18,4 +18,4 @@
18
18
  * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
19
19
  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20
20
  */
21
- export * from "./parse-query";
21
+ export {};
@@ -40,7 +40,7 @@ export declare class ContextHandler {
40
40
  getPrometheusService(): Promise<PrometheusService | undefined>;
41
41
  getPrometheusPath(): Promise<string>;
42
42
  resolveAuthProxyUrl(): Promise<string>;
43
- getApiTarget(isWatchRequest?: boolean): Promise<httpProxy.ServerOptions>;
43
+ getApiTarget(isLongRunningRequest?: boolean): Promise<httpProxy.ServerOptions>;
44
44
  protected newApiTarget(timeout: number): Promise<httpProxy.ServerOptions>;
45
45
  ensureServer(): Promise<void>;
46
46
  stopServer(): void;
@@ -32,6 +32,7 @@ export interface LensProxyFunctions {
32
32
  shellApiRequest: (args: ProxyApiRequestArgs) => void | Promise<void>;
33
33
  kubeApiRequest: (args: ProxyApiRequestArgs) => void | Promise<void>;
34
34
  }
35
+ export declare function isLongRunningRequest(reqUrl: string): boolean;
35
36
  export declare class LensProxy extends Singleton {
36
37
  protected router: Router;
37
38
  protected origin: string;
@@ -20,9 +20,18 @@
20
20
  */
21
21
  import type { Cluster } from "./cluster";
22
22
  import type { KubernetesObject } from "@kubernetes/client-node";
23
+ import type { Patch } from "rfc6902";
23
24
  export declare class ResourceApplier {
24
25
  protected cluster: Cluster;
25
26
  constructor(cluster: Cluster);
27
+ /**
28
+ * Patch a kube resource's manifest, throwing any error that occurs.
29
+ * @param name The name of the kube resource
30
+ * @param kind The kind of the kube resource
31
+ * @param patch The list of JSON operations
32
+ * @param ns The optional namespace of the kube resource
33
+ */
34
+ patch(name: string, kind: string, patch: Patch, ns?: string): Promise<string>;
26
35
  apply(resource: KubernetesObject | any): Promise<string>;
27
36
  protected kubectlApply(content: string): Promise<string>;
28
37
  kubectlApplyAll(resources: string[], extraArgs?: string[]): Promise<string>;
@@ -21,4 +21,7 @@
21
21
  import type { LensApiRequest } from "../router";
22
22
  export declare class PortForwardRoute {
23
23
  static routePortForward(request: LensApiRequest): Promise<void>;
24
+ static routeCurrentPortForward(request: LensApiRequest): Promise<void>;
25
+ static routeAllPortForwards(request: LensApiRequest): Promise<void>;
26
+ static routeCurrentPortForwardStop(request: LensApiRequest): Promise<void>;
24
27
  }
@@ -21,4 +21,5 @@
21
21
  import type { LensApiRequest } from "../router";
22
22
  export declare class ResourceApplierApiRoute {
23
23
  static applyResource(request: LensApiRequest): Promise<void>;
24
+ static patchResource(request: LensApiRequest): Promise<void>;
24
25
  }
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Copyright (c) 2021 OpenLens Authors
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
5
+ * this software and associated documentation files (the "Software"), to deal in
6
+ * the Software without restriction, including without limitation the rights to
7
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
8
+ * the Software, and to permit persons to whom the Software is furnished to do so,
9
+ * subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in all
12
+ * copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
16
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
17
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
18
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
19
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20
+ */
21
+ export {};
@@ -20,6 +20,25 @@
20
20
  */
21
21
  /// <reference types="node" />
22
22
  import type http from "http";
23
- export declare function respondJson(res: http.ServerResponse, content: any, status?: number): void;
23
+ /**
24
+ * Respond to a HTTP request with a body of JSON data
25
+ * @param res The HTTP response to write data to
26
+ * @param content The data or its JSON stringified version of it
27
+ * @param status [200] The status code to respond with
28
+ */
29
+ export declare function respondJson(res: http.ServerResponse, content: Object | string, status?: number): void;
30
+ /**
31
+ * Respond to a HTTP request with a body of plain text data
32
+ * @param res The HTTP response to write data to
33
+ * @param content The string data to respond with
34
+ * @param status [200] The status code to respond with
35
+ */
24
36
  export declare function respondText(res: http.ServerResponse, content: string, status?: number): void;
37
+ /**
38
+ * Respond to a HTTP request with a body of plain text data
39
+ * @param res The HTTP response to write data to
40
+ * @param content The string data to respond with
41
+ * @param contentType The HTTP Content-Type header value
42
+ * @param status [200] The status code to respond with
43
+ */
25
44
  export declare function respond(res: http.ServerResponse, content: string, contentType: string, status?: number): void;
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Copyright (c) 2021 OpenLens Authors
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
5
+ * this software and associated documentation files (the "Software"), to deal in
6
+ * the Software without restriction, including without limitation the rights to
7
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
8
+ * the Software, and to permit persons to whom the Software is furnished to do so,
9
+ * subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in all
12
+ * copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
16
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
17
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
18
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
19
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20
+ */
21
+ export declare function nextUpdateChannel(defaultChannel: string, channel: string): string;
@@ -19,3 +19,4 @@
19
19
  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20
20
  */
21
21
  export { catalogCategoryRegistry } from "../../common/catalog";
22
+ export type { CategoryFilter } from "../../common/catalog";
@@ -22,12 +22,15 @@ import { CatalogCategory, CatalogEntity, CatalogEntityData, CatalogCategoryRegis
22
22
  import "../../common/catalog-entities";
23
23
  import type { Cluster } from "../../main/cluster";
24
24
  import { Disposer } from "../utils";
25
+ import { CatalogRunEvent } from "../../common/catalog/catalog-run-event";
25
26
  export declare type EntityFilter = (entity: CatalogEntity) => any;
27
+ export declare type CatalogEntityOnBeforeRun = (event: CatalogRunEvent) => void | Promise<void>;
26
28
  export declare class CatalogEntityRegistry {
27
29
  private categoryRegistry;
28
30
  protected activeEntityId: string | undefined;
29
31
  protected _entities: import("mobx").ObservableMap<string, CatalogEntity<import("../../common/catalog").CatalogEntityMetadata, import("../../common/catalog").CatalogEntityStatus, import("../../common/catalog").CatalogEntitySpec>>;
30
32
  protected filters: import("mobx").ObservableSet<EntityFilter>;
33
+ protected onBeforeRunHooks: import("mobx").ObservableSet<CatalogEntityOnBeforeRun>;
31
34
  /**
32
35
  * Buffer for keeping entities that don't yet have CatalogCategory synced
33
36
  */
@@ -56,6 +59,23 @@ export declare class CatalogEntityRegistry {
56
59
  * @returns A function to remove that filter
57
60
  */
58
61
  addCatalogFilter(fn: EntityFilter): Disposer;
62
+ /**
63
+ * Add a onBeforeRun hook. If `onBeforeRun` was previously added then it will not be added again
64
+ * @param onBeforeRun The function that should return a boolean if the onRun of catalog entity should be triggered.
65
+ * @returns A function to remove that hook
66
+ */
67
+ addOnBeforeRun(onBeforeRun: CatalogEntityOnBeforeRun): Disposer;
68
+ /**
69
+ * Runs all the registered `onBeforeRun` hooks, short circuiting on the first event that's preventDefaulted
70
+ * @param entity The entity to run the hooks on
71
+ * @returns Whether the entities `onRun` method should be executed
72
+ */
73
+ onBeforeRun(entity: CatalogEntity): Promise<boolean>;
74
+ /**
75
+ * Perform the onBeforeRun check and, if successful, then proceed to call `entity`'s onRun method
76
+ * @param entity The instance to invoke the hooks and then execute the onRun
77
+ */
78
+ onRun(entity: CatalogEntity): void;
59
79
  }
60
80
  export declare const catalogEntityRegistry: CatalogEntityRegistry;
61
81
  export declare function getActiveClusterEntity(): Cluster | undefined;
@@ -27,7 +27,7 @@ import * as ReactRouterDom from "react-router-dom";
27
27
  import * as LensExtensionsCommonApi from "../extensions/common-api";
28
28
  import * as LensExtensionsRendererApi from "../extensions/renderer-api";
29
29
  declare type AppComponent = React.ComponentType & {
30
- init?(): Promise<void>;
30
+ init?(rootElem: HTMLElement): Promise<void>;
31
31
  };
32
32
  export declare function bootstrap(App: AppComponent): Promise<void>;
33
33
  /**
@@ -30,7 +30,7 @@ export declare class AddCluster extends React.Component {
30
30
  kubeContexts: import("mobx").ObservableMap<string, Option>;
31
31
  customConfig: string;
32
32
  isWaiting: boolean;
33
- errorText: string;
33
+ errors: string[];
34
34
  constructor(props: {});
35
35
  componentDidMount(): void;
36
36
  get allErrors(): string[];
@@ -21,7 +21,7 @@
21
21
  import "./catalog-entity-details.scss";
22
22
  import { Component } from "react";
23
23
  import type { CatalogCategory, CatalogEntity } from "../../../common/catalog";
24
- import type { CatalogEntityItem } from "./catalog-entity.store";
24
+ import type { CatalogEntityItem } from "./catalog-entity-item";
25
25
  interface Props<T extends CatalogEntity> {
26
26
  item: CatalogEntityItem<T> | null | undefined;
27
27
  hideDetails(): void;
@@ -21,7 +21,7 @@
21
21
  import React from "react";
22
22
  import { MenuActionsProps } from "../menu/menu-actions";
23
23
  import type { CatalogEntity, CatalogEntityContextMenu } from "../../api/catalog-entity";
24
- import type { CatalogEntityItem } from "./catalog-entity.store";
24
+ import type { CatalogEntityItem } from "./catalog-entity-item";
25
25
  export interface CatalogEntityDrawerMenuProps<T extends CatalogEntity> extends MenuActionsProps {
26
26
  item: CatalogEntityItem<T> | null | undefined;
27
27
  }
@@ -0,0 +1,23 @@
1
+ import React from "react";
2
+ import type { CatalogEntity } from "../../api/catalog-entity";
3
+ import type { ItemObject } from "../../../common/item.store";
4
+ import type { CatalogEntityRegistry } from "../../api/catalog-entity-registry";
5
+ export declare class CatalogEntityItem<T extends CatalogEntity> implements ItemObject {
6
+ entity: T;
7
+ private registry;
8
+ constructor(entity: T, registry: CatalogEntityRegistry);
9
+ get kind(): string;
10
+ get apiVersion(): string;
11
+ get name(): string;
12
+ getName(): string;
13
+ get id(): string;
14
+ getId(): string;
15
+ get phase(): string;
16
+ get enabled(): boolean;
17
+ get labels(): string[];
18
+ getLabelBadges(onClick?: React.MouseEventHandler<any>): JSX.Element[];
19
+ get source(): string;
20
+ get searchFields(): string[];
21
+ onRun(): void;
22
+ onContextMenuOpen(ctx: any): Promise<void>;
23
+ }
@@ -18,34 +18,18 @@
18
18
  * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
19
19
  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20
20
  */
21
- import React from "react";
22
- import type { CatalogEntity, CatalogEntityActionContext } from "../../api/catalog-entity";
23
- import { ItemObject, ItemStore } from "../../../common/item.store";
21
+ import { CatalogEntityRegistry } from "../../api/catalog-entity-registry";
22
+ import type { CatalogEntity } from "../../api/catalog-entity";
23
+ import { ItemStore } from "../../../common/item.store";
24
24
  import { CatalogCategory } from "../../../common/catalog";
25
- export declare class CatalogEntityItem<T extends CatalogEntity> implements ItemObject {
26
- entity: T;
27
- constructor(entity: T);
28
- get kind(): string;
29
- get apiVersion(): string;
30
- get name(): string;
31
- getName(): string;
32
- get id(): string;
33
- getId(): string;
34
- get phase(): string;
35
- get enabled(): boolean;
36
- get labels(): string[];
37
- getLabelBadges(onClick?: React.MouseEventHandler<any>): JSX.Element[];
38
- get source(): string;
39
- get searchFields(): string[];
40
- onRun(ctx: CatalogEntityActionContext): void;
41
- onContextMenuOpen(ctx: any): Promise<void>;
42
- }
25
+ import { CatalogEntityItem } from "./catalog-entity-item";
43
26
  export declare class CatalogEntityStore extends ItemStore<CatalogEntityItem<CatalogEntity>> {
44
- constructor();
27
+ private registry;
28
+ constructor(registry?: CatalogEntityRegistry);
45
29
  activeCategory?: CatalogCategory;
46
30
  selectedItemId?: string;
47
31
  get entities(): CatalogEntityItem<CatalogEntity<import("../../../common/catalog").CatalogEntityMetadata, import("../../../common/catalog").CatalogEntityStatus, import("../../../common/catalog").CatalogEntitySpec>>[];
48
32
  get selectedItem(): CatalogEntityItem<CatalogEntity<import("../../../common/catalog").CatalogEntityMetadata, import("../../../common/catalog").CatalogEntityStatus, import("../../../common/catalog").CatalogEntitySpec>>;
49
- watch(): () => void;
33
+ watch(): import("../../../common/utils").ExtendableDisposer;
50
34
  loadAll(): Promise<any>;
51
35
  }
@@ -22,5 +22,5 @@ declare type Props = {
22
22
  activeItem: string;
23
23
  onItemClick: (id: string) => void;
24
24
  };
25
- export declare function CatalogMenu(props: Props): JSX.Element;
25
+ export declare const CatalogMenu: (props: Props) => JSX.Element;
26
26
  export {};
@@ -19,19 +19,24 @@
19
19
  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20
20
  */
21
21
  import React from "react";
22
- import { CatalogEntityItem } from "./catalog-entity.store";
22
+ import { CatalogEntityStore } from "./catalog-entity.store";
23
+ import type { CatalogEntityItem } from "./catalog-entity-item";
23
24
  import type { CatalogEntityContextMenu } from "../../api/catalog-entity";
24
25
  import { CatalogEntity } from "../../../common/catalog";
25
26
  import type { RouteComponentProps } from "react-router";
26
27
  import { CatalogViewRouteParam } from "../../../common/routes";
27
28
  export declare const previousActiveTab: import("../../utils").StorageHelper<string>;
28
29
  interface Props extends RouteComponentProps<CatalogViewRouteParam> {
30
+ catalogEntityStore?: CatalogEntityStore;
29
31
  }
30
32
  export declare class Catalog extends React.Component<Props> {
31
33
  private catalogEntityStore?;
32
34
  private contextMenu;
33
35
  activeTab?: string;
34
36
  constructor(props: Props);
37
+ static defaultProps: {
38
+ catalogEntityStore: CatalogEntityStore;
39
+ };
35
40
  get routeActiveTab(): string;
36
41
  componentDidMount(): Promise<void>;
37
42
  addToHotbar(item: CatalogEntityItem<CatalogEntity>): void;
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Copyright (c) 2021 OpenLens Authors
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
5
+ * this software and associated documentation files (the "Software"), to deal in
6
+ * the Software without restriction, including without limitation the rights to
7
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
8
+ * the Software, and to permit persons to whom the Software is furnished to do so,
9
+ * subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in all
12
+ * copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
16
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
17
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
18
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
19
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20
+ */
21
+ export {};
@@ -18,7 +18,6 @@
18
18
  * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
19
19
  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20
20
  */
21
- import "./entity-settings.scss";
22
21
  import React from "react";
23
22
  import type { RouteComponentProps } from "react-router";
24
23
  import type { CatalogEntity } from "../../api/catalog-entity";
@@ -18,4 +18,4 @@
18
18
  * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
19
19
  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20
20
  */
21
- export declare function registerKeyboardShortcuts(): void;
21
+ export * from "./port-forwards";
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Copyright (c) 2021 OpenLens Authors
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
5
+ * this software and associated documentation files (the "Software"), to deal in
6
+ * the Software without restriction, including without limitation the rights to
7
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
8
+ * the Software, and to permit persons to whom the Software is furnished to do so,
9
+ * subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in all
12
+ * copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
16
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
17
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
18
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
19
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20
+ */
21
+ import React from "react";
22
+ import { PortForwardItem } from "../../port-forward";
23
+ import { MenuActionsProps } from "../menu/menu-actions";
24
+ interface Props extends MenuActionsProps {
25
+ portForward: PortForwardItem;
26
+ hideDetails?(): void;
27
+ }
28
+ export declare class PortForwardMenu extends React.Component<Props> {
29
+ remove(): Promise<void>;
30
+ renderContent(): JSX.Element;
31
+ render(): JSX.Element;
32
+ }
33
+ export {};
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Copyright (c) 2021 OpenLens Authors
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
5
+ * this software and associated documentation files (the "Software"), to deal in
6
+ * the Software without restriction, including without limitation the rights to
7
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
8
+ * the Software, and to permit persons to whom the Software is furnished to do so,
9
+ * subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in all
12
+ * copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
16
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
17
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
18
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
19
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20
+ */
21
+ import "./port-forwards.scss";
22
+ import React from "react";
23
+ import { PortForwardItem } from "../../port-forward";
24
+ export declare class PortForwards extends React.Component {
25
+ componentDidMount(): void;
26
+ renderRemoveDialogMessage(selectedItems: PortForwardItem[]): JSX.Element;
27
+ render(): JSX.Element;
28
+ }
@@ -27,8 +27,14 @@ interface Props {
27
27
  }
28
28
  export declare class ServicePortComponent extends React.Component<Props> {
29
29
  waiting: boolean;
30
+ forwardPort: number;
31
+ isPortForwarded: boolean;
30
32
  constructor(props: Props);
33
+ componentDidMount(): void;
34
+ init(): void;
35
+ checkExistingPortForwarding(): Promise<void>;
31
36
  portForward(): Promise<void>;
37
+ stopPortForward(): Promise<void>;
32
38
  render(): JSX.Element;
33
39
  }
34
40
  export {};
@@ -31,8 +31,14 @@ interface Props {
31
31
  }
32
32
  export declare class PodContainerPort extends React.Component<Props> {
33
33
  waiting: boolean;
34
+ forwardPort: number;
35
+ isPortForwarded: boolean;
34
36
  constructor(props: Props);
37
+ componentDidMount(): void;
38
+ init(): void;
39
+ checkExistingPortForwarding(): Promise<void>;
35
40
  portForward(): Promise<void>;
41
+ stopPortForward(): Promise<void>;
36
42
  render(): JSX.Element;
37
43
  }
38
44
  export {};
@@ -30,6 +30,7 @@ interface Props {
30
30
  };
31
31
  }
32
32
  export declare class PodDetailsContainer extends React.Component<Props> {
33
+ componentDidMount(): void;
33
34
  renderStatus(state: string, status: IPodContainerStatus): JSX.Element;
34
35
  renderLastState(lastState: string, status: IPodContainerStatus): JSX.Element;
35
36
  render(): JSX.Element;
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Copyright (c) 2021 OpenLens Authors
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
5
+ * this software and associated documentation files (the "Software"), to deal in
6
+ * the Software without restriction, including without limitation the rights to
7
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
8
+ * the Software, and to permit persons to whom the Software is furnished to do so,
9
+ * subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in all
12
+ * copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
16
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
17
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
18
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
19
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20
+ */
21
+ import React from "react";
22
+ import type { CatalogEntity } from "../../api/catalog-entity";
23
+ export declare class ActivateEntityCommand extends React.Component {
24
+ get options(): {
25
+ label: string;
26
+ value: CatalogEntity<import("../../../common/catalog").CatalogEntityMetadata, import("../../../common/catalog").CatalogEntityStatus, import("../../../common/catalog").CatalogEntitySpec>;
27
+ }[];
28
+ onSelect(entity: CatalogEntity): void;
29
+ render(): JSX.Element;
30
+ }
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Copyright (c) 2021 OpenLens Authors
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
5
+ * this software and associated documentation files (the "Software"), to deal in
6
+ * the Software without restriction, including without limitation the rights to
7
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
8
+ * the Software, and to permit persons to whom the Software is furnished to do so,
9
+ * subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in all
12
+ * copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
16
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
17
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
18
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
19
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20
+ */
21
+ export * from "./activate-entity-command";