@k8slens/extensions 5.2.1-git.e2b096fae1.0 → 5.2.1-git.e329ffd52c.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 (47) 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-entities/__tests__/kubernetes-cluster.test.d.ts +1 -0
  4. package/dist/src/common/catalog-entities/kubernetes-cluster.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-object.d.ts +14 -1
  7. package/dist/src/common/k8s-api/kube-object.store.d.ts +3 -0
  8. package/dist/src/common/routes/catalog.d.ts +2 -0
  9. package/dist/src/common/user-store/preferences-helpers.d.ts +1 -0
  10. package/dist/src/common/user-store/user-store.d.ts +1 -0
  11. package/dist/src/extensions/extension-api.js +2294 -464
  12. package/dist/src/extensions/lens-renderer-extension.d.ts +9 -2
  13. package/dist/src/extensions/main-api/k8s-api.d.ts +1 -1
  14. package/dist/src/extensions/registries/command-registry.d.ts +2 -2
  15. package/dist/src/extensions/renderer-api/k8s-api.d.ts +1 -1
  16. package/dist/src/main/{routes/utils/index.d.ts → __test__/lens-proxy.test.d.ts} +1 -1
  17. package/dist/src/main/context-handler.d.ts +1 -1
  18. package/dist/src/main/lens-proxy.d.ts +1 -0
  19. package/dist/src/main/resource-applier.d.ts +9 -0
  20. package/dist/src/main/routes/resource-applier-route.d.ts +1 -0
  21. package/dist/src/main/utils/http-responses.d.ts +20 -1
  22. package/dist/src/main/{routes/utils → utils}/parse-query.d.ts +0 -0
  23. package/dist/src/renderer/api/catalog-category-registry.d.ts +1 -0
  24. package/dist/src/renderer/api/catalog-entity-registry.d.ts +3 -1
  25. package/dist/src/renderer/api/terminal-api.d.ts +0 -2
  26. package/dist/src/renderer/bootstrap.d.ts +1 -1
  27. package/dist/src/renderer/components/+add-cluster/add-cluster.d.ts +1 -1
  28. package/dist/src/renderer/components/+apps-helm-charts/helm-charts.d.ts +1 -0
  29. package/dist/src/renderer/components/+apps-releases/releases.d.ts +1 -0
  30. package/dist/src/renderer/components/+catalog/__tests__/catalog-add-button.test.d.ts +1 -0
  31. package/dist/src/renderer/components/+catalog/catalog-menu.d.ts +1 -1
  32. package/dist/src/renderer/components/+catalog/catalog.d.ts +1 -1
  33. package/dist/src/renderer/components/+entity-settings/entity-settings.d.ts +0 -1
  34. package/dist/src/renderer/components/activate-entity-command/activate-entity-command.d.ts +30 -0
  35. package/dist/src/renderer/components/activate-entity-command/index.d.ts +21 -0
  36. package/dist/src/renderer/components/app.d.ts +1 -1
  37. package/dist/src/renderer/components/delete-cluster-dialog/save-config.d.ts +1 -1
  38. package/dist/src/renderer/components/dock/create-resource.d.ts +1 -1
  39. package/dist/src/renderer/components/dock/edit-resource.store.d.ts +2 -0
  40. package/dist/src/renderer/components/dock/terminal.d.ts +2 -0
  41. package/dist/src/renderer/components/input/input.d.ts +1 -1
  42. package/dist/src/renderer/components/kube-detail-params/params.d.ts +1 -0
  43. package/dist/src/renderer/components/layout/sidebar.d.ts +1 -1
  44. package/dist/src/renderer/components/menu/menu.d.ts +6 -0
  45. package/dist/src/renderer/components/switch/switcher.d.ts +1 -1
  46. package/dist/src/renderer/lens-app.d.ts +1 -1
  47. package/package.json +4 -4
@@ -20,15 +20,24 @@
20
20
  */
21
21
  import { Disposer, ExtendedMap } from "../utils";
22
22
  import { CatalogCategory, CatalogEntityData, CatalogEntityKindData } from "./catalog-entity";
23
+ export declare type CategoryFilter = (category: CatalogCategory) => any;
23
24
  export declare class CatalogCategoryRegistry {
24
25
  protected categories: import("mobx").ObservableSet<CatalogCategory>;
25
26
  protected groupKinds: ExtendedMap<string, ExtendedMap<string, CatalogCategory>>;
27
+ protected filters: import("mobx").ObservableSet<CategoryFilter>;
26
28
  constructor();
27
29
  add(category: CatalogCategory): Disposer;
28
30
  get items(): CatalogCategory[];
31
+ get filteredItems(): CatalogCategory[];
29
32
  getForGroupKind<T extends CatalogCategory>(group: string, kind: string): T | undefined;
30
33
  getEntityForData(data: CatalogEntityData & CatalogEntityKindData): import("./catalog-entity").CatalogEntity<import("./catalog-entity").CatalogEntityMetadata, import("./catalog-entity").CatalogEntityStatus, import("./catalog-entity").CatalogEntitySpec>;
31
34
  getCategoryForEntity<T extends CatalogCategory>(data: CatalogEntityData & CatalogEntityKindData): T | undefined;
32
35
  getByName(name: string): CatalogCategory;
36
+ /**
37
+ * Add a new filter to the set of category filters
38
+ * @param fn The function that should return a truthy value if that category should be displayed
39
+ * @returns A function to remove that filter
40
+ */
41
+ addCatalogCategoryFilter(fn: CategoryFilter): Disposer;
33
42
  }
34
43
  export declare const catalogCategoryRegistry: CatalogCategoryRegistry;
@@ -20,6 +20,7 @@
20
20
  */
21
21
  /// <reference types="react" />
22
22
  import type TypedEmitter from "typed-emitter";
23
+ import { Disposer } from "../utils";
23
24
  declare type ExtractEntityMetadataType<Entity> = Entity extends CatalogEntity<infer Metadata> ? Metadata : never;
24
25
  declare type ExtractEntityStatusType<Entity> = Entity extends CatalogEntity<any, infer Status> ? Status : never;
25
26
  declare type ExtractEntitySpecType<Entity> = Entity extends CatalogEntity<any, any, infer Spec> ? Spec : never;
@@ -35,6 +36,10 @@ export interface CatalogCategorySpec {
35
36
  kind: string;
36
37
  };
37
38
  }
39
+ /**
40
+ * If the filter returns true, the menu item is displayed
41
+ */
42
+ export declare type AddMenuFilter = (menu: CatalogEntityAddMenu) => any;
38
43
  export interface CatalogCategoryEvents {
39
44
  load: () => void;
40
45
  catalogAddMenu: (context: CatalogEntityAddMenuContext) => void;
@@ -49,11 +54,24 @@ export declare abstract class CatalogCategory extends CatalogCategory_base {
49
54
  icon: string;
50
55
  };
51
56
  abstract spec: CatalogCategorySpec;
57
+ protected filters: import("mobx").ObservableSet<AddMenuFilter>;
52
58
  static parseId(id?: string): {
53
59
  group?: string;
54
60
  kind?: string;
55
61
  };
56
62
  getId(): string;
63
+ /**
64
+ * Add a filter for menu items of catalogAddMenu
65
+ * @param fn The function that should return a truthy value if that menu item should be displayed
66
+ * @returns A function to remove that filter
67
+ */
68
+ addMenuFilter(fn: AddMenuFilter): Disposer;
69
+ /**
70
+ * Filter menuItems according to the Category's set filters
71
+ * @param menuItems menu items to filter
72
+ * @returns filtered menu items
73
+ */
74
+ filteredItems(menuItems: CatalogEntityAddMenu[]): CatalogEntityAddMenu[];
57
75
  }
58
76
  export interface CatalogEntityMetadata {
59
77
  uid: string;
@@ -42,6 +42,7 @@ export interface KubernetesClusterSpec extends CatalogEntitySpec {
42
42
  material?: string;
43
43
  background?: string;
44
44
  };
45
+ accessibleNamespaces?: string[];
45
46
  }
46
47
  export interface KubernetesClusterMetadata extends CatalogEntityMetadata {
47
48
  distro?: string;
@@ -19,7 +19,7 @@
19
19
  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20
20
  */
21
21
  import type { KubeJsonApiData } from "../kube-json-api";
22
- export declare const resourceApplierApi: {
23
- annotations: string[];
24
- update(resource: object | string): Promise<KubeJsonApiData | null>;
25
- };
22
+ import type { Patch } from "rfc6902";
23
+ export declare const annotations: string[];
24
+ export declare function update(resource: object | string): Promise<KubeJsonApiData>;
25
+ export declare function patch(name: string, kind: string, ns: string, patch: Patch): Promise<KubeJsonApiData>;
@@ -21,6 +21,7 @@
21
21
  import type { KubeJsonApiData, KubeJsonApiDataList, KubeJsonApiListMetadata, KubeJsonApiMetadata } from "./kube-json-api";
22
22
  import type { ItemObject } from "../item.store";
23
23
  import type { JsonApiParams } from "./json-api";
24
+ import type { Patch } from "rfc6902";
24
25
  export declare type KubeObjectConstructor<K extends KubeObject> = (new (data: KubeJsonApiData | any) => K) & {
25
26
  kind?: string;
26
27
  namespaced?: boolean;
@@ -96,7 +97,11 @@ export declare class KubeObject<Metadata extends KubeObjectMetadata = KubeObject
96
97
  static stringifyLabels(labels?: {
97
98
  [name: string]: string;
98
99
  }): string[];
99
- protected static readonly nonEditableFields: string[];
100
+ /**
101
+ * These must be RFC6902 compliant paths
102
+ */
103
+ private static readonly nonEditiablePathPrefixes;
104
+ private static readonly nonEditablePaths;
100
105
  constructor(data: KubeJsonApiData);
101
106
  get selfLink(): string;
102
107
  getId(): string;
@@ -119,6 +124,14 @@ export declare class KubeObject<Metadata extends KubeObjectMetadata = KubeObject
119
124
  }[];
120
125
  getSearchFields(): string[];
121
126
  toPlainObject(): object;
127
+ patch(patch: Patch): Promise<KubeJsonApiData | null>;
128
+ /**
129
+ * Perform a full update (or more specifically a replace)
130
+ *
131
+ * Note: this is brittle if `data` is not actually partial (but instead whole).
132
+ * As fields such as `resourceVersion` will probably out of date. This is a
133
+ * common race condition.
134
+ */
122
135
  update(data: Partial<this>): Promise<KubeJsonApiData | null>;
123
136
  delete(params?: JsonApiParams): Promise<KubeJsonApiData>;
124
137
  }
@@ -25,6 +25,7 @@ import { ItemStore } from "../item.store";
25
25
  import { IKubeApiQueryParams, KubeApi } from "./kube-api";
26
26
  import type { KubeJsonApiData } from "./kube-json-api";
27
27
  import type { RequestInit } from "node-fetch";
28
+ import type { Patch } from "rfc6902";
28
29
  export interface KubeObjectStoreLoadingParams<K extends KubeObject> {
29
30
  namespaces: string[];
30
31
  api?: KubeApi<K>;
@@ -91,6 +92,8 @@ export declare abstract class KubeObjectStore<T extends KubeObject> extends Item
91
92
  name: string;
92
93
  namespace?: string;
93
94
  }, data?: Partial<T>): Promise<T>;
95
+ private postUpdate;
96
+ patch(item: T, patch: Patch): Promise<T>;
94
97
  update(item: T, data: Partial<T>): Promise<T>;
95
98
  remove(item: T): Promise<void>;
96
99
  removeSelectedItems(): Promise<void[]>;
@@ -24,4 +24,6 @@ export interface CatalogViewRouteParam {
24
24
  kind?: string;
25
25
  }
26
26
  export declare const catalogRoute: RouteProps;
27
+ export declare const getPreviousTabUrl: (path: string) => string;
27
28
  export declare const catalogURL: ({ params, query, fragment }?: import("../utils/buildUrl").URLParams<CatalogViewRouteParam, {}>) => string;
29
+ export declare const browseCatalogTab = "browse";
@@ -59,5 +59,6 @@ export declare const DESCRIPTORS: {
59
59
  hiddenTableColumns: PreferenceDescription<[string, string[]][], Map<string, ObservableToggleSet<string>>>;
60
60
  syncKubeconfigEntries: PreferenceDescription<KubeconfigSyncEntry[], Map<string, KubeconfigSyncValue>>;
61
61
  editorConfiguration: PreferenceDescription<EditorConfiguration, EditorConfiguration>;
62
+ terminalCopyOnSelect: PreferenceDescription<boolean, boolean>;
62
63
  };
63
64
  export {};
@@ -45,6 +45,7 @@ export declare class UserStore extends BaseStore<UserStoreModel> {
45
45
  shell?: string;
46
46
  downloadBinariesPath?: string;
47
47
  kubectlBinariesPath?: string;
48
+ terminalCopyOnSelect: boolean;
48
49
  /**
49
50
  * Download kubectl binaries matching cluster version
50
51
  */