@k8slens/extensions 5.3.1-git.c0a0127d2d.0 → 5.3.1-git.d40071a9d5.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 (171) hide show
  1. package/dist/src/common/catalog/catalog-entity.d.ts +51 -0
  2. package/dist/src/common/catalog-entities/kubernetes-cluster.d.ts +1 -2
  3. package/dist/src/common/catalog-entities/web-link.d.ts +0 -2
  4. package/dist/src/common/hotbar-store.d.ts +16 -11
  5. package/dist/src/common/hotbar-store.injectable.d.ts +4 -0
  6. package/dist/src/common/hotbar-types.d.ts +5 -2
  7. package/dist/src/{extensions/registries/welcome-menu-registry.d.ts → common/ipc/catalog.d.ts} +9 -7
  8. package/dist/src/common/ipc/extension-loader.ipc.d.ts +21 -0
  9. package/dist/src/common/ipc/index.d.ts +2 -0
  10. package/dist/src/common/k8s-api/endpoints/crd.api.d.ts +29 -28
  11. package/dist/src/common/protocol-handler/router.d.ts +8 -2
  12. package/dist/src/common/user-store/preferences-helpers.d.ts +14 -0
  13. package/dist/src/common/user-store/user-store.d.ts +2 -1
  14. package/dist/src/common/utils/index.d.ts +1 -0
  15. package/dist/src/common/utils/promise-exec.d.ts +1 -2
  16. package/dist/src/common/vars.d.ts +1 -0
  17. package/dist/src/extensions/as-legacy-globals-for-extension-api/as-legacy-global-function-for-extension-api.d.ts +25 -0
  18. package/dist/src/extensions/as-legacy-globals-for-extension-api/as-legacy-global-object-for-extension-api.d.ts +24 -0
  19. package/dist/src/extensions/{registries/command-registry.d.ts → as-legacy-globals-for-extension-api/as-legacy-global-singleton-for-extension-api.d.ts} +8 -16
  20. package/dist/src/{main/tray.d.ts → extensions/as-legacy-globals-for-extension-api/legacy-global-di-for-extension-api.d.ts} +3 -5
  21. package/dist/src/extensions/extension-api.js +974 -1033
  22. package/dist/src/extensions/extension-discovery.d.ts +3 -1
  23. package/dist/src/extensions/{extension-loader.d.ts → extension-loader/extension-loader.d.ts} +15 -7
  24. package/dist/src/extensions/extension-loader/extension-loader.injectable.d.ts +4 -0
  25. package/dist/src/{main/initializers/registries.d.ts → extensions/extension-loader/index.d.ts} +1 -1
  26. package/dist/src/extensions/extensions.injectable.d.ts +3 -0
  27. package/dist/src/{renderer/components → extensions}/getDiForUnitTesting.d.ts +0 -0
  28. package/dist/src/extensions/lens-extension.d.ts +2 -1
  29. package/dist/src/extensions/lens-main-extension.d.ts +3 -1
  30. package/dist/src/extensions/lens-renderer-extension.d.ts +14 -7
  31. package/dist/src/extensions/main-extensions.injectable.d.ts +5 -0
  32. package/dist/src/extensions/registries/base-registry.d.ts +1 -1
  33. package/dist/src/extensions/registries/entity-setting-registry.d.ts +1 -1
  34. package/dist/src/extensions/registries/index.d.ts +0 -5
  35. package/dist/src/extensions/renderer-api/components.d.ts +1 -1
  36. package/dist/src/extensions/renderer-extensions.injectable.d.ts +5 -0
  37. package/dist/src/main/catalog-pusher.d.ts +1 -1
  38. package/dist/src/main/getDi.d.ts +22 -0
  39. package/dist/src/main/getDiForUnitTesting.d.ts +22 -0
  40. package/dist/src/main/helm/helm-release-manager.d.ts +9 -10
  41. package/dist/src/main/helm/helm-repo-manager.d.ts +2 -2
  42. package/dist/src/main/helm/helm-service.d.ts +2 -2
  43. package/dist/src/main/initializers/index.d.ts +0 -1
  44. package/dist/src/main/initializers/ipc.d.ts +3 -1
  45. package/dist/src/main/menu/electron-menu-items.injectable.d.ts +3 -0
  46. package/dist/src/main/menu/electron-menu-items.test.d.ts +1 -0
  47. package/dist/src/main/{menu.d.ts → menu/menu.d.ts} +6 -4
  48. package/dist/src/main/protocol-handler/index.d.ts +1 -1
  49. package/dist/src/main/protocol-handler/{router.d.ts → lens-protocol-router-main/lens-protocol-router-main.d.ts} +11 -5
  50. package/dist/src/main/protocol-handler/lens-protocol-router-main/lens-protocol-router-main.injectable.d.ts +4 -0
  51. package/dist/src/main/routes/port-forward-route.d.ts +0 -1
  52. package/dist/src/main/tray/tray-menu-items.injectable.d.ts +3 -0
  53. package/dist/src/main/tray/tray-menu-items.test.d.ts +1 -0
  54. package/dist/src/main/tray/tray.d.ts +27 -0
  55. package/dist/src/renderer/api/__tests__/catalog-entity-registry.test.d.ts +1 -1
  56. package/dist/src/renderer/api/catalog-entity-registry.d.ts +4 -0
  57. package/dist/src/renderer/api/catalog-entity.d.ts +1 -5
  58. package/dist/src/{main/catalog-sources → renderer/api}/helpers/general-active-sync.d.ts +0 -0
  59. package/dist/src/renderer/bootstrap.d.ts +3 -1
  60. package/dist/src/renderer/cluster-frame.d.ts +2 -1
  61. package/dist/src/renderer/components/+catalog/catalog-entity-details.d.ts +3 -3
  62. package/dist/src/renderer/components/+catalog/catalog-entity-drawer-menu.d.ts +1 -2
  63. package/dist/src/renderer/components/+catalog/catalog-entity.store.d.ts +4 -4
  64. package/dist/src/renderer/components/+catalog/catalog.d.ts +5 -6
  65. package/dist/src/renderer/components/{command-palette/command-overlay.d.ts → +catalog/helpers.d.ts} +5 -7
  66. package/dist/src/renderer/components/+custom-resources/custom-resources.injectable.d.ts +23 -0
  67. package/dist/src/renderer/components/+extensions/attempt-install/attempt-install.d.ts +32 -0
  68. package/dist/src/renderer/components/+extensions/attempt-install/attempt-install.injectable.d.ts +3 -0
  69. package/dist/src/renderer/components/+extensions/attempt-install/create-temp-files-and-validate/create-temp-files-and-validate.d.ts +11 -0
  70. package/dist/src/renderer/components/+extensions/attempt-install/get-extension-dest-folder/get-extension-dest-folder.d.ts +1 -0
  71. package/dist/src/renderer/components/+extensions/attempt-install/unpack-extension/unpack-extension.d.ts +28 -0
  72. package/dist/src/renderer/components/+extensions/attempt-install/unpack-extension/unpack-extension.injectable.d.ts +3 -0
  73. package/dist/src/renderer/components/+extensions/attempt-install/validate-package/validate-package.d.ts +22 -0
  74. package/dist/src/renderer/components/+extensions/attempt-install-by-info/attempt-install-by-info.d.ts +13 -0
  75. package/dist/src/renderer/components/+extensions/attempt-install-by-info/attempt-install-by-info.injectable.d.ts +3 -0
  76. package/dist/src/renderer/components/+extensions/attempt-installs/attempt-installs.d.ts +6 -0
  77. package/dist/src/renderer/components/+extensions/attempt-installs/attempt-installs.injectable.d.ts +3 -0
  78. package/dist/src/renderer/components/+extensions/confirm-uninstall-extension/confirm-uninstall-extension.d.ts +7 -0
  79. package/dist/src/renderer/components/+extensions/confirm-uninstall-extension/confirm-uninstall-extension.injectable.d.ts +3 -0
  80. package/dist/src/renderer/components/+extensions/disable-extension/disable-extension.d.ts +27 -0
  81. package/dist/src/renderer/components/+extensions/disable-extension/disable-extension.injectable.d.ts +3 -0
  82. package/dist/src/renderer/components/+extensions/enable-extension/enable-extension.d.ts +27 -0
  83. package/dist/src/renderer/components/+extensions/enable-extension/enable-extension.injectable.d.ts +3 -0
  84. package/dist/src/renderer/components/+extensions/extensions.d.ts +1 -15
  85. package/dist/src/{extensions/registries/menu-registry.d.ts → renderer/components/+extensions/get-base-registry-url/get-base-registry-url.d.ts} +5 -6
  86. package/dist/src/renderer/components/+extensions/get-base-registry-url/get-base-registry-url.injectable.d.ts +23 -0
  87. package/dist/src/renderer/components/+extensions/get-message-from-error/get-message-from-error.d.ts +21 -0
  88. package/dist/src/renderer/components/+extensions/install-from-input/install-from-input.d.ts +29 -0
  89. package/dist/src/renderer/components/+extensions/install-from-input/install-from-input.injectable.d.ts +3 -0
  90. package/dist/src/renderer/components/+extensions/install-from-select-file-dialog/install-from-select-file-dialog.d.ts +5 -0
  91. package/dist/src/renderer/components/+extensions/install-from-select-file-dialog/install-from-select-file-dialog.injectable.d.ts +3 -0
  92. package/dist/src/renderer/components/+extensions/install-on-drop/install-on-drop.d.ts +5 -0
  93. package/dist/src/renderer/components/+extensions/install-on-drop/install-on-drop.injectable.d.ts +3 -0
  94. package/dist/src/renderer/components/+extensions/read-file-notify/read-file-notify.d.ts +2 -0
  95. package/dist/src/renderer/components/+extensions/supported-extension-formats.d.ts +21 -0
  96. package/dist/src/renderer/components/+extensions/uninstall-extension/uninstall-extension.d.ts +27 -0
  97. package/dist/src/renderer/components/+extensions/uninstall-extension/uninstall-extension.injectable.d.ts +3 -0
  98. package/dist/src/renderer/components/+extensions/user-extensions/user-extensions.injectable.d.ts +3 -0
  99. package/dist/src/renderer/components/+network-port-forwards/port-forward-menu.d.ts +2 -0
  100. package/dist/src/renderer/components/+network-services/service-port-component.d.ts +1 -0
  101. package/dist/src/renderer/components/+preferences/extension-settings.d.ts +7 -0
  102. package/dist/src/renderer/components/+preferences/preferences.d.ts +0 -2
  103. package/dist/src/renderer/components/+welcome/welcome-banner-items/welcome-banner-items.injectable.d.ts +3 -0
  104. package/dist/src/renderer/components/+welcome/welcome-menu-items/get-welcome-menu-items.d.ts +27 -0
  105. package/dist/src/renderer/components/+welcome/welcome-menu-items/welcome-menu-items.injectable.d.ts +3 -0
  106. package/dist/src/renderer/components/+welcome/welcome.d.ts +1 -3
  107. package/dist/src/renderer/components/+workloads-pods/pod-container-port.d.ts +1 -0
  108. package/dist/src/renderer/components/activate-entity-command/activate-entity-command.d.ts +1 -9
  109. package/dist/src/renderer/components/catalog-entities/weblink-add-command.d.ts +1 -11
  110. package/dist/src/renderer/components/checkbox/checkbox.d.ts +0 -1
  111. package/dist/src/renderer/components/cluster-manager/active-hotbar-name.d.ts +2 -1
  112. package/dist/src/renderer/components/command-palette/command-container.d.ts +1 -7
  113. package/dist/src/renderer/components/command-palette/command-dialog.d.ts +1 -13
  114. package/dist/src/renderer/components/command-palette/command-overlay.injectable.d.ts +31 -0
  115. package/dist/src/renderer/components/command-palette/index.d.ts +1 -1
  116. package/dist/src/renderer/components/command-palette/registered-commands/internal-commands.injectable.d.ts +25 -0
  117. package/dist/src/renderer/components/command-palette/registered-commands/registered-commands.injectable.d.ts +25 -0
  118. package/dist/src/renderer/components/dock/terminal.d.ts +1 -1
  119. package/dist/src/renderer/components/hotbar/hotbar-add-command.d.ts +1 -6
  120. package/dist/src/renderer/components/hotbar/hotbar-menu.d.ts +1 -1
  121. package/dist/src/renderer/components/hotbar/hotbar-remove-command.d.ts +1 -9
  122. package/dist/src/renderer/components/hotbar/hotbar-rename-command.d.ts +1 -14
  123. package/dist/src/renderer/components/hotbar/hotbar-selector.d.ts +3 -3
  124. package/dist/src/renderer/components/hotbar/hotbar-switch-command.d.ts +1 -12
  125. package/dist/src/renderer/components/input/input.d.ts +1 -0
  126. package/dist/src/renderer/components/input/validators/unique-hotbar-name.injectable.d.ts +24 -0
  127. package/dist/src/renderer/components/kube-object-menu/dependencies/api-manager.injectable.d.ts +2 -23
  128. package/dist/src/renderer/components/kube-object-menu/dependencies/cluster-name.injectable.d.ts +2 -6
  129. package/dist/src/renderer/components/kube-object-menu/dependencies/cluster.injectable.d.ts +2 -3
  130. package/dist/src/renderer/components/kube-object-menu/dependencies/edit-resource-tab.injectable.d.ts +2 -2
  131. package/dist/src/renderer/components/kube-object-menu/dependencies/hide-details.injectable.d.ts +2 -2
  132. package/dist/src/renderer/components/kube-object-menu/dependencies/kube-object-menu-items/get-kube-object-menu-items.d.ts +2 -5
  133. package/dist/src/renderer/components/kube-object-menu/dependencies/kube-object-menu-items/kube-object-menu-items.injectable.d.ts +8 -23
  134. package/dist/src/renderer/components/kube-object-menu/dependencies/kube-object-menu-items/kube-object-menu-registry.injectable.d.ts +2 -2
  135. package/dist/src/renderer/components/kube-object-menu/index.d.ts +1 -1
  136. package/dist/src/renderer/components/kube-object-menu/kube-object-menu.d.ts +2 -21
  137. package/dist/src/renderer/components/layout/{topbar.d.ts → close-button.d.ts} +3 -3
  138. package/dist/src/renderer/components/layout/top-bar/top-bar-items/top-bar-items.injectable.d.ts +3 -0
  139. package/dist/src/renderer/components/layout/{__tests__/topbar-win-linux.test.d.ts → top-bar/top-bar-win-linux.test.d.ts} +0 -0
  140. package/dist/src/renderer/components/layout/top-bar/top-bar.d.ts +22 -0
  141. package/dist/src/renderer/components/layout/{__tests__/topbar.test.d.ts → top-bar/top-bar.test.d.ts} +0 -0
  142. package/dist/src/renderer/components/menu/menu-actions.d.ts +1 -1
  143. package/dist/src/renderer/components/monaco-editor/monaco-editor.d.ts +1 -1
  144. package/dist/src/renderer/{initializers/command-registry.d.ts → components/switch/__tests__/switch.test.d.ts} +1 -1
  145. package/dist/src/renderer/components/switch/form-switcher.d.ts +3 -0
  146. package/dist/src/renderer/components/switch/index.d.ts +1 -0
  147. package/dist/src/{extensions/registries/topbar-registry.d.ts → renderer/components/switch/switch.d.ts} +4 -9
  148. package/dist/src/renderer/components/switch/switcher.d.ts +4 -1
  149. package/dist/src/renderer/{components/hotbar/hotbar-display-label.d.ts → getDi.d.ts} +2 -2
  150. package/dist/src/renderer/{components/getDi.d.ts → getDiForUnitTesting.d.ts} +2 -2
  151. package/dist/src/renderer/initializers/catalog.d.ts +6 -1
  152. package/dist/src/renderer/initializers/index.d.ts +0 -2
  153. package/dist/src/renderer/initializers/ipc.d.ts +2 -1
  154. package/dist/src/renderer/navigation/helpers.d.ts +1 -1
  155. package/dist/src/renderer/port-forward/port-forward-dialog.d.ts +1 -1
  156. package/dist/src/renderer/port-forward/port-forward-item.d.ts +4 -4
  157. package/dist/src/renderer/port-forward/port-forward-notify.d.ts +1 -0
  158. package/dist/src/renderer/port-forward/port-forward.store.d.ts +56 -6
  159. package/dist/src/renderer/protocol-handler/bind-protocol-add-route-handlers/bind-protocol-add-route-handlers.d.ts +28 -0
  160. package/dist/src/renderer/protocol-handler/bind-protocol-add-route-handlers/bind-protocol-add-route-handlers.injectable.d.ts +3 -0
  161. package/dist/src/renderer/protocol-handler/index.d.ts +2 -2
  162. package/dist/src/renderer/protocol-handler/{router.d.ts → lens-protocol-router-renderer/lens-protocol-router-renderer.d.ts} +8 -1
  163. package/dist/src/renderer/protocol-handler/lens-protocol-router-renderer/lens-protocol-router-renderer.injectable.d.ts +4 -0
  164. package/dist/src/renderer/root-frame.d.ts +3 -1
  165. package/dist/src/renderer/theme.store.d.ts +0 -1
  166. package/dist/src/{extensions/registries/welcome-banner-registry.d.ts → renderer/window/event-listener.injectable.d.ts} +5 -18
  167. package/package.json +1 -1
  168. package/dist/src/renderer/components/kube-object-menu/kube-object-menu-container.d.ts +0 -2
  169. package/dist/src/renderer/components/kube-object-menu/kube-object-menu.injectable.d.ts +0 -5
  170. package/dist/src/renderer/initializers/welcome-menu-registry.d.ts +0 -21
  171. package/dist/src/renderer/protocol-handler/app-handlers.d.ts +0 -21
@@ -26,13 +26,42 @@ declare type ExtractEntityStatusType<Entity> = Entity extends CatalogEntity<any,
26
26
  declare type ExtractEntitySpecType<Entity> = Entity extends CatalogEntity<any, any, infer Spec> ? Spec : never;
27
27
  export declare type CatalogEntityConstructor<Entity extends CatalogEntity> = ((new (data: CatalogEntityData<ExtractEntityMetadataType<Entity>, ExtractEntityStatusType<Entity>, ExtractEntitySpecType<Entity>>) => Entity));
28
28
  export interface CatalogCategoryVersion<Entity extends CatalogEntity> {
29
+ /**
30
+ * The specific version that the associated constructor is for. This MUST be
31
+ * a DNS label and SHOULD be of the form `vN`, `vNalphaY`, or `vNbetaY` where
32
+ * `N` and `Y` are both integers greater than 0.
33
+ *
34
+ * Examples: The following are valid values for this field.
35
+ * - `v1`
36
+ * - `v1beta1`
37
+ * - `v1alpha2`
38
+ * - `v3beta2`
39
+ */
29
40
  name: string;
41
+ /**
42
+ * The constructor for the entities.
43
+ */
30
44
  entityClass: CatalogEntityConstructor<Entity>;
31
45
  }
32
46
  export interface CatalogCategorySpec {
47
+ /**
48
+ * The grouping for for the category. This MUST be a DNS label.
49
+ */
33
50
  group: string;
51
+ /**
52
+ * The specific versions of the constructors.
53
+ *
54
+ * NOTE: the field `.apiVersion` after construction MUST match `{.group}/{.versions.[] | .name}`.
55
+ * For example, if `group = "entity.k8slens.dev"` and there is an entry in `.versions` with
56
+ * `name = "v1alpha1"` then the resulting `.apiVersion` MUST be `entity.k8slens.dev/v1alpha1`
57
+ */
34
58
  versions: CatalogCategoryVersion<CatalogEntity>[];
35
59
  names: {
60
+ /**
61
+ * The kind of entity that this category is for. This value MUST be a DNS
62
+ * label and MUST be equal to the `kind` fields that are produced by the
63
+ * `.versions.[] | .entityClass` fields.
64
+ */
36
65
  kind: string;
37
66
  };
38
67
  }
@@ -76,6 +105,7 @@ export declare abstract class CatalogCategory extends CatalogCategory_base {
76
105
  export interface CatalogEntityMetadata {
77
106
  uid: string;
78
107
  name: string;
108
+ shortName?: string;
79
109
  description?: string;
80
110
  source?: string;
81
111
  labels: Record<string, string>;
@@ -151,14 +181,35 @@ export interface CatalogEntityKindData {
151
181
  readonly kind: string;
152
182
  }
153
183
  export declare abstract class CatalogEntity<Metadata extends CatalogEntityMetadata = CatalogEntityMetadata, Status extends CatalogEntityStatus = CatalogEntityStatus, Spec extends CatalogEntitySpec = CatalogEntitySpec> implements CatalogEntityKindData {
184
+ /**
185
+ * The group and version of this class.
186
+ */
154
187
  abstract readonly apiVersion: string;
188
+ /**
189
+ * A DNS label name of the entity.
190
+ */
155
191
  abstract readonly kind: string;
156
192
  metadata: Metadata;
157
193
  status: Status;
158
194
  spec: Spec;
159
195
  constructor(data: CatalogEntityData<Metadata, Status, Spec>);
196
+ /**
197
+ * Get the UID of this entity
198
+ */
160
199
  getId(): string;
200
+ /**
201
+ * Get the name of this entity
202
+ */
161
203
  getName(): string;
204
+ /**
205
+ * Get the specified source of this entity, defaulting to `"unknown"` if not
206
+ * provided
207
+ */
208
+ getSource(): string;
209
+ /**
210
+ * Get if this entity is enabled.
211
+ */
212
+ isEnabled(): boolean;
162
213
  abstract onRun?(context: CatalogEntityActionContext): void | Promise<void>;
163
214
  abstract onContextMenuOpen(context: CatalogEntityContextMenuContext): void | Promise<void>;
164
215
  abstract onSettingsOpen(context: CatalogEntitySettingsContext): void | Promise<void>;
@@ -18,8 +18,7 @@
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 { CatalogEntity, CatalogEntityActionContext, CatalogEntityContextMenuContext, CatalogEntityMetadata, CatalogEntityStatus } from "../catalog";
22
- import { CatalogCategory, CatalogCategorySpec } from "../catalog";
21
+ import { CatalogEntity, CatalogEntityActionContext, CatalogEntityContextMenuContext, CatalogEntityMetadata, CatalogEntityStatus, CatalogCategory, CatalogCategorySpec } from "../catalog";
23
22
  import type { CatalogEntitySpec } from "../catalog/catalog-entity";
24
23
  export interface KubernetesClusterPrometheusMetrics {
25
24
  address?: {
@@ -52,6 +52,4 @@ export declare class WebLinkCategory extends CatalogCategory {
52
52
  kind: string;
53
53
  };
54
54
  };
55
- static onAdd?: () => void;
56
- constructor();
57
55
  }
@@ -20,7 +20,7 @@
20
20
  */
21
21
  import { BaseStore } from "./base-store";
22
22
  import { CatalogEntity } from "./catalog";
23
- import { Hotbar, HotbarCreateOptions } from "./hotbar-types";
23
+ import { Hotbar, CreateHotbarData, CreateHotbarOptions } from "./hotbar-types";
24
24
  export interface HotbarStoreModel {
25
25
  hotbars: Hotbar[];
26
26
  activeHotbarId: string;
@@ -31,19 +31,22 @@ export declare class HotbarStore extends BaseStore<HotbarStoreModel> {
31
31
  private _activeHotbarId;
32
32
  constructor();
33
33
  get activeHotbarId(): string;
34
- set activeHotbarId(id: string);
35
- hotbarIndex(id: string): number;
34
+ /**
35
+ * If `hotbar` points to a known hotbar, make it active. Otherwise, ignore
36
+ * @param hotbar The hotbar instance, or the index, or its ID
37
+ */
38
+ setActiveHotbar(hotbar: Hotbar | number | string): void;
39
+ private hotbarIndexById;
40
+ private hotbarIndex;
36
41
  get activeHotbarIndex(): number;
37
42
  protected fromStore(data?: Partial<HotbarStoreModel>): void;
38
43
  toJSON(): HotbarStoreModel;
39
- getActive(): Required<HotbarCreateOptions>;
40
- getByName(name: string): Required<HotbarCreateOptions>;
41
- getById(id: string): Required<HotbarCreateOptions>;
42
- add(data: HotbarCreateOptions, { setActive }?: {
43
- setActive?: boolean;
44
- }): void;
45
- setHotbarName(id: string, name: string): void;
46
- remove(hotbar: Hotbar): void;
44
+ getActive(): Required<CreateHotbarData>;
45
+ getByName(name: string): Required<CreateHotbarData>;
46
+ getById(id: string): Required<CreateHotbarData>;
47
+ add: (data: CreateHotbarData, { setActive }?: CreateHotbarOptions) => void;
48
+ setHotbarName: (id: string, name: string) => any;
49
+ remove: (hotbar: Hotbar) => void;
47
50
  addToHotbar(item: CatalogEntity, cellIndex?: number): void;
48
51
  removeFromHotbar(uid: string): void;
49
52
  /**
@@ -61,4 +64,6 @@ export declare class HotbarStore extends BaseStore<HotbarStoreModel> {
61
64
  * @returns boolean
62
65
  */
63
66
  isAddedToActive(entity: CatalogEntity): boolean;
67
+ getDisplayLabel(hotbar: Hotbar): string;
68
+ getDisplayIndex(hotbar: Hotbar): string;
64
69
  }
@@ -0,0 +1,4 @@
1
+ /// <reference types="@ogre-tools/injectable" />
2
+ import { HotbarStore } from "./hotbar-store";
3
+ declare const hotbarManagerInjectable: import("@ogre-tools/injectable").Injectable<import("@ogre-tools/injectable").InjectionToken<HotbarStore, unknown>, HotbarStore, unknown>;
4
+ export default hotbarManagerInjectable;
@@ -29,11 +29,14 @@ export interface HotbarItem {
29
29
  [key: string]: string;
30
30
  };
31
31
  }
32
- export declare type Hotbar = Required<HotbarCreateOptions>;
33
- export interface HotbarCreateOptions {
32
+ export declare type Hotbar = Required<CreateHotbarData>;
33
+ export interface CreateHotbarData {
34
34
  id?: string;
35
35
  name: string;
36
36
  items?: Tuple<HotbarItem | null, typeof defaultHotbarCells>;
37
37
  }
38
+ export interface CreateHotbarOptions {
39
+ setActive?: boolean;
40
+ }
38
41
  export declare const defaultHotbarCells = 12;
39
42
  export declare function getEmptyHotbar(name: string, id?: string): Hotbar;
@@ -18,11 +18,13 @@
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 { BaseRegistry } from "./base-registry";
22
- export interface WelcomeMenuRegistration {
23
- title: string | (() => string);
24
- icon: string;
25
- click: () => void | Promise<void>;
26
- }
27
- export declare class WelcomeMenuRegistry extends BaseRegistry<WelcomeMenuRegistration> {
21
+ export declare enum CatalogIpcEvents {
22
+ /**
23
+ * This is broadcast on whenever there is an update to any catalog item
24
+ */
25
+ ITEMS = "catalog:items",
26
+ /**
27
+ * This can be sent from renderer to main to initialize a broadcast of ITEMS
28
+ */
29
+ INIT = "catalog:init"
28
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 declare const BundledExtensionsLoaded = "extension-loader:bundled-extensions-loaded";
@@ -19,9 +19,11 @@
19
19
  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20
20
  */
21
21
  export declare const dialogShowOpenDialogHandler = "dialog:show-open-dialog";
22
+ export declare const catalogEntityRunListener = "catalog-entity:run";
22
23
  export * from "./ipc";
23
24
  export * from "./invalid-kubeconfig";
24
25
  export * from "./update-available.ipc";
25
26
  export * from "./cluster.ipc";
26
27
  export * from "./type-enforced-ipc";
27
28
  export * from "./hotbar";
29
+ export * from "./extension-loader.ipc";
@@ -40,34 +40,35 @@ export interface CRDVersion {
40
40
  schema?: object;
41
41
  additionalPrinterColumns?: AdditionalPrinterColumnsV1[];
42
42
  }
43
- export interface CustomResourceDefinition {
44
- spec: {
45
- group: string;
46
- /**
47
- * @deprecated for apiextensions.k8s.io/v1 but used previously
48
- */
49
- version?: string;
50
- names: {
51
- plural: string;
52
- singular: string;
53
- kind: string;
54
- listKind: string;
55
- };
56
- scope: "Namespaced" | "Cluster" | string;
57
- /**
58
- * @deprecated for apiextensions.k8s.io/v1 but used previously
59
- */
60
- validation?: object;
61
- versions?: CRDVersion[];
62
- conversion: {
63
- strategy?: string;
64
- webhook?: any;
65
- };
66
- /**
67
- * @deprecated for apiextensions.k8s.io/v1 but used previously
68
- */
69
- additionalPrinterColumns?: AdditionalPrinterColumnsV1Beta[];
43
+ export interface CustomResourceDefinitionSpec {
44
+ group: string;
45
+ /**
46
+ * @deprecated for apiextensions.k8s.io/v1 but used in v1beta1
47
+ */
48
+ version?: string;
49
+ names: {
50
+ plural: string;
51
+ singular: string;
52
+ kind: string;
53
+ listKind: string;
70
54
  };
55
+ scope: "Namespaced" | "Cluster";
56
+ /**
57
+ * @deprecated for apiextensions.k8s.io/v1 but used in v1beta1
58
+ */
59
+ validation?: object;
60
+ versions?: CRDVersion[];
61
+ conversion: {
62
+ strategy?: string;
63
+ webhook?: any;
64
+ };
65
+ /**
66
+ * @deprecated for apiextensions.k8s.io/v1 but used in v1beta1
67
+ */
68
+ additionalPrinterColumns?: AdditionalPrinterColumnsV1Beta[];
69
+ }
70
+ export interface CustomResourceDefinition {
71
+ spec: CustomResourceDefinitionSpec;
71
72
  status: {
72
73
  conditions: {
73
74
  lastTransitionTime: string;
@@ -100,7 +101,7 @@ export declare class CustomResourceDefinition extends KubeObject {
100
101
  getResourceKind(): string;
101
102
  getResourceTitle(): string;
102
103
  getGroup(): string;
103
- getScope(): string;
104
+ getScope(): "Namespaced" | "Cluster";
104
105
  getPreferedVersion(): CRDVersion;
105
106
  getVersion(): string;
106
107
  isNamespaced(): boolean;
@@ -19,8 +19,8 @@
19
19
  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20
20
  */
21
21
  import { match } from "react-router";
22
- import { Singleton } from "../utils";
23
22
  import type Url from "url-parse";
23
+ import type { ExtensionLoader as ExtensionLoaderType } from "../../extensions/extension-loader/extension-loader";
24
24
  import type { LensExtension } from "../../extensions/lens-extension";
25
25
  import type { RouteHandler } from "../../extensions/registries/protocol-handler";
26
26
  export declare const ProtocolHandlerIpcPrefix = "protocol-handler";
@@ -54,10 +54,15 @@ export declare enum RouteAttempt {
54
54
  MISSING_EXTENSION = "no-extension"
55
55
  }
56
56
  export declare function foldAttemptResults(mainAttempt: RouteAttempt, rendererAttempt: RouteAttempt): RouteAttempt;
57
- export declare abstract class LensProtocolRouter extends Singleton {
57
+ interface Dependencies {
58
+ extensionLoader: ExtensionLoaderType;
59
+ }
60
+ export declare abstract class LensProtocolRouter {
61
+ protected dependencies: Dependencies;
58
62
  protected internalRoutes: Map<string, RouteHandler>;
59
63
  static readonly LoggingPrefix = "[PROTOCOL ROUTER]";
60
64
  static readonly ExtensionUrlSchema: string;
65
+ constructor(dependencies: Dependencies);
61
66
  /**
62
67
  * Attempts to route the given URL to all internal routes that have been registered
63
68
  * @param url the parsed URL that initiated the `lens://` protocol
@@ -108,3 +113,4 @@ export declare abstract class LensProtocolRouter extends Singleton {
108
113
  */
109
114
  removeInternalHandler(urlSchema: string): void;
110
115
  }
116
+ export {};
@@ -39,6 +39,19 @@ export interface DownloadMirror {
39
39
  }
40
40
  export declare const defaultPackageMirror = "default";
41
41
  export declare const packageMirrors: Map<string, DownloadMirror>;
42
+ export declare enum ExtensionRegistryLocation {
43
+ DEFAULT = "default",
44
+ NPMRC = "npmrc",
45
+ CUSTOM = "custom"
46
+ }
47
+ export declare type ExtensionRegistry = {
48
+ location: ExtensionRegistryLocation.DEFAULT | ExtensionRegistryLocation.NPMRC;
49
+ customUrl?: undefined;
50
+ } | {
51
+ location: ExtensionRegistryLocation.CUSTOM;
52
+ customUrl: string;
53
+ };
54
+ export declare const defaultExtensionRegistryUrl = "https://registry.npmjs.org";
42
55
  declare type PreferencesModelType<field extends keyof typeof DESCRIPTORS> = typeof DESCRIPTORS[field] extends PreferenceDescription<infer T, any> ? T : never;
43
56
  declare type UserStoreModelType<field extends keyof typeof DESCRIPTORS> = typeof DESCRIPTORS[field] extends PreferenceDescription<any, infer T> ? T : never;
44
57
  export declare type UserStoreFlatModel = {
@@ -65,6 +78,7 @@ export declare const DESCRIPTORS: {
65
78
  editorConfiguration: PreferenceDescription<EditorConfiguration, EditorConfiguration>;
66
79
  terminalCopyOnSelect: PreferenceDescription<boolean, boolean>;
67
80
  updateChannel: PreferenceDescription<string, string>;
81
+ extensionRegistryUrl: PreferenceDescription<ExtensionRegistry, ExtensionRegistry>;
68
82
  };
69
83
  export declare const CONSTANTS: {
70
84
  updateChannels: Map<string, {
@@ -20,7 +20,7 @@
20
20
  */
21
21
  import { BaseStore } from "../base-store";
22
22
  import { ObservableToggleSet } from "../../renderer/utils";
23
- import { EditorConfiguration, KubeconfigSyncValue, UserPreferencesModel } from "./preferences-helpers";
23
+ import { EditorConfiguration, ExtensionRegistry, KubeconfigSyncValue, UserPreferencesModel } from "./preferences-helpers";
24
24
  export interface UserStoreModel {
25
25
  lastSeenAppVersion: string;
26
26
  preferences: UserPreferencesModel;
@@ -47,6 +47,7 @@ export declare class UserStore extends BaseStore<UserStoreModel> {
47
47
  kubectlBinariesPath?: string;
48
48
  terminalCopyOnSelect: boolean;
49
49
  updateChannel?: string;
50
+ extensionRegistryUrl: ExtensionRegistry;
50
51
  /**
51
52
  * Download kubectl binaries matching cluster version
52
53
  */
@@ -44,6 +44,7 @@ export * from "./n-fircate";
44
44
  export * from "./objects";
45
45
  export * from "./openExternal";
46
46
  export * from "./paths";
47
+ export * from "./promise-exec";
47
48
  export * from "./reject-promise";
48
49
  export * from "./singleton";
49
50
  export * from "./sort-compare";
@@ -19,6 +19,5 @@
19
19
  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20
20
  */
21
21
  /// <reference types="node" />
22
- import { exec, execFile } from "child_process";
23
- export declare const promiseExec: typeof exec.__promisify__;
22
+ import { execFile } from "child_process";
24
23
  export declare const promiseExecFile: typeof execFile.__promisify__;
@@ -33,6 +33,7 @@ export declare const isIntegrationTesting: boolean;
33
33
  export declare const productName: string;
34
34
  export declare const appName: string;
35
35
  export declare const publicPath: string;
36
+ export declare const defaultTheme: string;
36
37
  export declare const contextDir: string;
37
38
  export declare const buildDir: string;
38
39
  export declare const preloadEntrypoint: string;
@@ -0,0 +1,25 @@
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 type { Injectable } from "@ogre-tools/injectable";
22
+ declare type TentativeTuple<T> = T extends object ? [T] : [undefined?];
23
+ declare type FactoryType = <TInjectable extends Injectable<unknown, TInstance, TInstantiationParameter>, TInstantiationParameter, TInstance extends (...args: unknown[]) => any, TFunction extends (...args: unknown[]) => any = Awaited<ReturnType<TInjectable["instantiate"]>>>(injectableKey: TInjectable, ...instantiationParameter: TentativeTuple<TInstantiationParameter>) => (...args: Parameters<TFunction>) => ReturnType<TFunction>;
24
+ export declare const asLegacyGlobalFunctionForExtensionApi: FactoryType;
25
+ export {};
@@ -0,0 +1,24 @@
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 type { Injectable } from "@ogre-tools/injectable";
22
+ declare type TentativeTuple<T> = T extends object ? [T] : [undefined?];
23
+ export declare const asLegacyGlobalObjectForExtensionApi: <TInjectable extends Injectable<unknown, unknown, TInstantiationParameter>, TInstantiationParameter>(injectableKey: TInjectable, ...instantiationParameter: TentativeTuple<TInstantiationParameter>) => ReturnType<TInjectable["instantiate"]>;
24
+ export {};
@@ -18,19 +18,11 @@
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 { BaseRegistry } from "./base-registry";
22
- import type { LensExtension } from "../lens-extension";
23
- import type { CatalogEntity } from "../../common/catalog";
24
- export interface CommandContext {
25
- entity?: CatalogEntity;
26
- }
27
- export interface CommandRegistration {
28
- id: string;
29
- title: string;
30
- scope: "entity" | "global";
31
- action: (context: CommandContext) => void;
32
- isActive?: (context: CommandContext) => boolean;
33
- }
34
- export declare class CommandRegistry extends BaseRegistry<CommandRegistration> {
35
- add(items: CommandRegistration | CommandRegistration[], extension?: LensExtension): () => void;
36
- }
21
+ import type { Injectable } from "@ogre-tools/injectable";
22
+ declare type TentativeTuple<T> = T extends object ? [T] : [undefined?];
23
+ export declare const asLegacyGlobalSingletonForExtensionApi: <TClass extends abstract new (...args: any[]) => any, TInjectable extends Injectable<unknown, unknown, TInstantiationParameter>, TInstantiationParameter>(Class: TClass, injectableKey: TInjectable, ...instantiationParameter: TentativeTuple<TInstantiationParameter>) => InstanceType<TClass> & {
24
+ getInstance: () => InstanceType<TClass>;
25
+ createInstance: () => InstanceType<TClass>;
26
+ resetInstance: () => void;
27
+ };
28
+ export {};
@@ -18,8 +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 { Tray } from "electron";
22
- import type { WindowManager } from "./window-manager";
23
- export declare let tray: Tray;
24
- export declare function getTrayIcon(): string;
25
- export declare function initTray(windowManager: WindowManager): () => void;
21
+ import type { DependencyInjectionContainer } from "@ogre-tools/injectable";
22
+ export declare const setLegacyGlobalDiForExtensionApi: (di: DependencyInjectionContainer) => void;
23
+ export declare const getLegacyGlobalDiForExtensionApi: () => DependencyInjectionContainer;