@k8slens/extensions 5.4.0-git.8480b2a1e5.0 → 5.4.0-git.9d04c23290.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 (31) hide show
  1. package/dist/src/common/catalog/catalog-category-registry.d.ts +2 -2
  2. package/dist/src/common/catalog-entities/kubernetes-cluster.d.ts +1 -1
  3. package/dist/src/common/k8s-api/kube-object.store.d.ts +2 -2
  4. package/dist/src/common/user-store/user-store.d.ts +1 -1
  5. package/dist/src/common/utils/collection-functions.d.ts +18 -4
  6. package/dist/src/common/utils/index.d.ts +1 -2
  7. package/dist/src/common/utils/objects.d.ts +2 -3
  8. package/dist/src/common/utils/openBrowser.d.ts +17 -0
  9. package/dist/src/extensions/common-api/registrations.d.ts +1 -0
  10. package/dist/src/extensions/common-api/utils.d.ts +1 -1
  11. package/dist/src/extensions/extension-api.js +55 -43
  12. package/dist/src/extensions/lens-extension.d.ts +1 -1
  13. package/dist/src/extensions/lens-main-extension.d.ts +15 -0
  14. package/dist/src/extensions/main-api/index.d.ts +2 -1
  15. package/dist/src/extensions/main-api/power.d.ts +24 -0
  16. package/dist/src/main/catalog-pusher.d.ts +2 -1
  17. package/dist/src/main/cluster-manager.d.ts +20 -2
  18. package/dist/src/main/helm/helm-repo-manager.d.ts +8 -9
  19. package/dist/src/main/shell-session/local-shell-session/local-shell-session.d.ts +6 -0
  20. package/dist/src/main/shell-session/shell-env-modifier/shell-env-modifier-registration.d.ts +9 -0
  21. package/dist/src/main/shell-session/shell-env-modifier/terminal-shell-env-modifiers.d.ts +12 -0
  22. package/dist/src/main/shell-session/shell-env-modifier/terminal-shell-env-modify.injectable.d.ts +7 -0
  23. package/dist/src/renderer/api/websocket-api.d.ts +1 -1
  24. package/dist/src/renderer/components/+config-secrets/secret-details.d.ts +1 -1
  25. package/dist/src/renderer/components/+preferences/add-helm-repo-dialog.d.ts +0 -1
  26. package/dist/src/renderer/components/+preferences/helm-charts.d.ts +4 -2
  27. package/dist/src/renderer/components/item-object-list/list-layout.d.ts +1 -2
  28. package/dist/src/renderer/components/kube-object-list-layout/kube-object-list-layout.d.ts +5 -1
  29. package/package.json +1 -1
  30. package/dist/src/common/utils/extended-map.d.ts +0 -30
  31. package/dist/src/common/utils/openExternal.d.ts +0 -5
@@ -2,12 +2,12 @@
2
2
  * Copyright (c) OpenLens Authors. All rights reserved.
3
3
  * Licensed under MIT License. See LICENSE in root directory for more information.
4
4
  */
5
- import { Disposer, ExtendedMap } from "../utils";
5
+ import type { Disposer } from "../utils";
6
6
  import { CatalogCategory, CatalogEntityData, CatalogEntityKindData } from "./catalog-entity";
7
7
  export declare type CategoryFilter = (category: CatalogCategory) => any;
8
8
  export declare class CatalogCategoryRegistry {
9
9
  protected categories: import("mobx").ObservableSet<CatalogCategory>;
10
- protected groupKinds: ExtendedMap<string, ExtendedMap<string, CatalogCategory>>;
10
+ protected groupKinds: Map<string, Map<string, CatalogCategory>>;
11
11
  protected filters: import("mobx").ObservableSet<CategoryFilter>;
12
12
  constructor();
13
13
  add(category: CatalogCategory): Disposer;
@@ -43,7 +43,7 @@ export interface KubernetesClusterMetadata extends CatalogEntityMetadata {
43
43
  export declare type KubernetesClusterStatusPhase = "connected" | "connecting" | "disconnected" | "deleting";
44
44
  export interface KubernetesClusterStatus extends CatalogEntityStatus {
45
45
  }
46
- export declare class KubernetesCluster extends CatalogEntity<KubernetesClusterMetadata, KubernetesClusterStatus, KubernetesClusterSpec> {
46
+ export declare class KubernetesCluster<Metadata extends KubernetesClusterMetadata = KubernetesClusterMetadata, Status extends KubernetesClusterStatus = KubernetesClusterStatus, Spec extends KubernetesClusterSpec = KubernetesClusterSpec> extends CatalogEntity<Metadata, Status, Spec> {
47
47
  static readonly apiVersion: string;
48
48
  static readonly kind: string;
49
49
  readonly apiVersion: string;
@@ -95,10 +95,10 @@ export declare abstract class KubeObjectStore<T extends KubeObject> extends Item
95
95
  name: string;
96
96
  namespace?: string;
97
97
  }, data?: Partial<T>): Promise<T>;
98
- create: (params: {
98
+ create(params: {
99
99
  name: string;
100
100
  namespace?: string;
101
- }, data?: Partial<T>) => Promise<T>;
101
+ }, data?: Partial<T>): Promise<T>;
102
102
  private postUpdate;
103
103
  patch(item: T, patch: Patch): Promise<T>;
104
104
  update(item: T, data: Partial<T>): Promise<T>;
@@ -3,7 +3,7 @@
3
3
  * Licensed under MIT License. See LICENSE in root directory for more information.
4
4
  */
5
5
  import { BaseStore } from "../base-store";
6
- import { EditorConfiguration, ExtensionRegistry, KubeconfigSyncValue, UserPreferencesModel, TerminalConfig } from "./preferences-helpers";
6
+ import type { EditorConfiguration, ExtensionRegistry, KubeconfigSyncValue, UserPreferencesModel, TerminalConfig } from "./preferences-helpers";
7
7
  export interface UserStoreModel {
8
8
  lastSeenAppVersion: string;
9
9
  preferences: UserPreferencesModel;
@@ -11,8 +11,8 @@
11
11
  */
12
12
  export declare function getOrInsert<K, V>(map: Map<K, V>, key: K, value: V): V;
13
13
  /**
14
- * Like `getOrInsert` but specifically for when `V` is `Map<any, any>` so that
15
- * the typings are inferred.
14
+ * Like `getOrInsert` but specifically for when `V` is `Map<MK, MV>` so that
15
+ * the typings are inferred correctly.
16
16
  */
17
17
  export declare function getOrInsertMap<K, MK, MV>(map: Map<K, Map<MK, MV>>, key: K): Map<MK, MV>;
18
18
  /**
@@ -21,9 +21,23 @@ export declare function getOrInsertMap<K, MK, MV>(map: Map<K, Map<MK, MV>>, key:
21
21
  */
22
22
  export declare function getOrInsertSet<K, SK>(map: Map<K, Set<SK>>, key: K): Set<SK>;
23
23
  /**
24
- * Like `getOrInsert` but with delayed creation of the item
24
+ * Like `getOrInsert` but with delayed creation of the item. Which is useful
25
+ * if it is very expensive to create the initial value.
26
+ */
27
+ export declare function getOrInsertWith<K, V>(map: Map<K, V>, key: K, builder: () => V): V;
28
+ /**
29
+ * Set the value associated with `key` iff there was not a previous value
30
+ * @param map The map to interact with
31
+ * @throws if `key` already in map
32
+ * @returns `this` so that `strictSet` can be chained
33
+ */
34
+ export declare function strictSet<K, V>(map: Map<K, V>, key: K, val: V): typeof map;
35
+ /**
36
+ * Get the value associated with `key`
37
+ * @param map The map to interact with
38
+ * @throws if `key` did not a value associated with it
25
39
  */
26
- export declare function getOrInsertWith<K, V>(map: Map<K, V>, key: K, value: () => V): V;
40
+ export declare function strictGet<K, V>(map: Map<K, V>, key: K): V;
27
41
  /**
28
42
  * If `key` is in `set`, remove it otherwise add it.
29
43
  * @param set The set to manipulate
@@ -21,13 +21,12 @@ export * from "./delay";
21
21
  export * from "./disposer";
22
22
  export * from "./downloadFile";
23
23
  export * from "./escapeRegExp";
24
- export * from "./extended-map";
25
24
  export * from "./formatDuration";
26
25
  export * from "./getRandId";
27
26
  export * from "./hash-set";
28
27
  export * from "./n-fircate";
29
28
  export * from "./objects";
30
- export * from "./openExternal";
29
+ export * from "./openBrowser";
31
30
  export * from "./paths";
32
31
  export * from "./promise-exec";
33
32
  export * from "./reject-promise";
@@ -6,6 +6,5 @@
6
6
  * A better typed version of `Object.fromEntries` where the keys are known to
7
7
  * be a specific subset
8
8
  */
9
- export declare function fromEntries<T, Key extends string>(entries: Iterable<readonly [Key, T]>): {
10
- [k in Key]: T;
11
- };
9
+ export declare function fromEntries<T, Key extends string>(entries: Iterable<readonly [Key, T]>): Record<Key, T>;
10
+ export declare function entries<T extends Record<string, any>>(obj: T): [keyof T, T[keyof T]][];
@@ -0,0 +1,17 @@
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
+ * Opens a link using the program configured as the default browser
7
+ * on the target platform. Will reject URLs with a scheme other than
8
+ * http or https to prevent programs other than the default browser
9
+ * running.
10
+ *
11
+ * @param url The URL to open
12
+ */
13
+ export declare function openBrowser(url: string): Promise<void>;
14
+ /**
15
+ * @deprecated use openBrowser
16
+ */
17
+ export declare const openExternal: typeof openBrowser;
@@ -11,3 +11,4 @@ export type { PageRegistration, RegisteredPage, PageParams, PageComponentProps,
11
11
  export type { ClusterPageMenuRegistration, ClusterPageMenuComponents } from "../registries/page-menu-registry";
12
12
  export type { ProtocolHandlerRegistration, RouteParams as ProtocolRouteParams, RouteHandler as ProtocolRouteHandler } from "../registries/protocol-handler";
13
13
  export type { CustomCategoryViewProps, CustomCategoryViewComponents, CustomCategoryViewRegistration } from "../../renderer/components/+catalog/custom-views";
14
+ export type { ShellEnvModifier, ShellEnvContext } from "../../main/shell-session/shell-env-modifier/shell-env-modifier-registration";
@@ -2,6 +2,6 @@
2
2
  * Copyright (c) OpenLens Authors. All rights reserved.
3
3
  * Licensed under MIT License. See LICENSE in root directory for more information.
4
4
  */
5
- export { Singleton, openExternal } from "../../common/utils";
5
+ export { Singleton, openExternal, openBrowser } from "../../common/utils";
6
6
  export { prevDefault, stopPropagation } from "../../renderer/utils/prevDefault";
7
7
  export { cssNames } from "../../renderer/utils/cssNames";