@k8slens/extensions 5.3.0-git.f51ce1e34b.0 → 5.3.0-git.fa21b63c77.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 (42) hide show
  1. package/dist/src/common/catalog/catalog-entity.d.ts +4 -1
  2. package/dist/src/common/catalog-entities/kubernetes-cluster.d.ts +9 -1
  3. package/dist/src/common/catalog-entities/web-link.d.ts +2 -0
  4. package/dist/src/common/hotbar-store.d.ts +5 -0
  5. package/dist/src/common/k8s-api/endpoints/nodes.api.d.ts +25 -44
  6. package/dist/src/common/kube-helpers.d.ts +9 -14
  7. package/dist/src/common/user-store/preferences-helpers.d.ts +8 -1
  8. package/dist/src/common/user-store/user-store.d.ts +1 -1
  9. package/dist/src/common/utils/iter.d.ts +16 -9
  10. package/dist/src/extensions/common-api/catalog.d.ts +2 -1
  11. package/dist/src/extensions/extension-api.js +305 -699
  12. package/dist/src/main/cluster.d.ts +0 -1
  13. package/dist/src/main/helm/helm-chart-manager.d.ts +4 -0
  14. package/dist/src/main/helm/helm-repo-manager.d.ts +1 -0
  15. package/dist/src/main/kubectl.d.ts +1 -1
  16. package/dist/src/main/utils/update-channel.d.ts +6 -0
  17. package/dist/src/renderer/components/+catalog/catalog-entity-drawer-menu.d.ts +0 -1
  18. package/dist/src/renderer/components/+catalog/catalog-entity-item.d.ts +1 -1
  19. package/dist/src/renderer/components/+catalog/catalog.d.ts +2 -0
  20. package/dist/src/renderer/components/+catalog/hotbar-toggle-menu-item.d.ts +27 -0
  21. package/dist/src/renderer/components/+config-maps/config-map-details.d.ts +1 -1
  22. package/dist/src/renderer/components/+config-pod-disruption-budgets/pod-disruption-budgets-details.d.ts +1 -1
  23. package/dist/src/renderer/components/+config-resource-quotas/resource-quota-details.d.ts +1 -1
  24. package/dist/src/renderer/components/+config-secrets/secret-details.d.ts +1 -1
  25. package/dist/src/renderer/components/+custom-resources/crd-details.d.ts +1 -1
  26. package/dist/src/renderer/components/+custom-resources/crd-resource-details.d.ts +2 -2
  27. package/dist/src/renderer/components/+entity-settings/entity-settings.d.ts +1 -2
  28. package/dist/src/renderer/components/+events/event-details.d.ts +1 -1
  29. package/dist/src/renderer/components/+events/kube-event-details.d.ts +1 -1
  30. package/dist/src/renderer/components/+network-endpoints/endpoint-details.d.ts +1 -1
  31. package/dist/src/renderer/components/+network-ingresses/ingress-details.d.ts +1 -1
  32. package/dist/src/renderer/components/+network-policies/network-policy-details.d.ts +1 -1
  33. package/dist/src/renderer/components/+network-services/service-details.d.ts +1 -1
  34. package/dist/src/renderer/components/+pod-security-policies/pod-security-policy-details.d.ts +9 -8
  35. package/dist/src/renderer/components/+storage-classes/storage-class-details.d.ts +1 -1
  36. package/dist/src/renderer/components/+workloads-cronjobs/cronjob-details.d.ts +1 -1
  37. package/dist/src/{common/custom-errors.d.ts → renderer/components/__tests__/nodes.api.test.d.ts} +1 -3
  38. package/dist/src/renderer/components/hotbar/hotbar-entity-icon.d.ts +0 -2
  39. package/dist/src/renderer/components/kube-object-meta/kube-object-meta.d.ts +1 -1
  40. package/dist/src/renderer/components/layout/setting-layout.d.ts +0 -1
  41. package/dist/src/renderer/components/layout/sidebar.d.ts +3 -1
  42. package/package.json +1 -1
@@ -127,7 +127,10 @@ export interface CatalogEntitySettingsMenu {
127
127
  };
128
128
  }
129
129
  export interface CatalogEntityContextMenuContext {
130
- navigate: (url: string) => void;
130
+ /**
131
+ * Navigate to the specified pathname
132
+ */
133
+ navigate: (pathname: string) => void;
131
134
  menuItems: CatalogEntityContextMenu[];
132
135
  }
133
136
  export interface CatalogEntitySettingsContext {
@@ -44,13 +44,21 @@ export interface KubernetesClusterSpec extends CatalogEntitySpec {
44
44
  };
45
45
  accessibleNamespaces?: string[];
46
46
  }
47
+ export declare enum LensKubernetesClusterStatus {
48
+ DELETING = "deleting",
49
+ CONNECTING = "connecting",
50
+ CONNECTED = "connected",
51
+ DISCONNECTED = "disconnected"
52
+ }
47
53
  export interface KubernetesClusterMetadata extends CatalogEntityMetadata {
48
54
  distro?: string;
49
55
  kubeVersion?: string;
50
56
  }
57
+ /**
58
+ * @deprecated This is no longer used as it is incorrect. Other sources can add more values
59
+ */
51
60
  export declare type KubernetesClusterStatusPhase = "connected" | "connecting" | "disconnected" | "deleting";
52
61
  export interface KubernetesClusterStatus extends CatalogEntityStatus {
53
- phase: KubernetesClusterStatusPhase;
54
62
  }
55
63
  export declare class KubernetesCluster extends CatalogEntity<KubernetesClusterMetadata, KubernetesClusterStatus, KubernetesClusterSpec> {
56
64
  static readonly apiVersion = "entity.k8slens.dev/v1alpha1";
@@ -27,6 +27,8 @@ export declare type WebLinkSpec = {
27
27
  url: string;
28
28
  };
29
29
  export declare class WebLink extends CatalogEntity<CatalogEntityMetadata, WebLinkStatus, WebLinkSpec> {
30
+ static readonly apiVersion = "entity.k8slens.dev/v1alpha1";
31
+ static readonly kind = "WebLink";
30
32
  readonly apiVersion = "entity.k8slens.dev/v1alpha1";
31
33
  readonly kind = "WebLink";
32
34
  onRun(): Promise<void>;
@@ -55,4 +55,9 @@ export declare class HotbarStore extends BaseStore<HotbarStoreModel> {
55
55
  restackItems(from: number, to: number): void;
56
56
  switchToPrevious(): void;
57
57
  switchToNext(): void;
58
+ /**
59
+ * Checks if entity already pinned to hotbar
60
+ * @returns boolean
61
+ */
62
+ isAddedToActive(entity: CatalogEntity): boolean;
58
63
  }
@@ -36,6 +36,21 @@ export interface INodeMetrics<T = IMetrics> {
36
36
  fsUsage: T;
37
37
  fsSize: T;
38
38
  }
39
+ export interface NodeTaint {
40
+ key: string;
41
+ value?: string;
42
+ effect: string;
43
+ timeAdded: string;
44
+ }
45
+ export declare function formatNodeTaint(taint: NodeTaint): string;
46
+ export interface NodeCondition {
47
+ type: string;
48
+ status: string;
49
+ lastHeartbeatTime?: string;
50
+ lastTransitionTime?: string;
51
+ reason?: string;
52
+ message?: string;
53
+ }
39
54
  export interface Node {
40
55
  spec: {
41
56
  podCIDR?: string;
@@ -45,12 +60,7 @@ export interface Node {
45
60
  * @deprecated see https://issues.k8s.io/61966
46
61
  */
47
62
  externalID?: string;
48
- taints?: {
49
- key: string;
50
- value: string;
51
- effect: string;
52
- timeAdded: string;
53
- }[];
63
+ taints?: NodeTaint[];
54
64
  unschedulable?: boolean;
55
65
  };
56
66
  status: {
@@ -70,14 +80,7 @@ export interface Node {
70
80
  memory: string;
71
81
  pods: string;
72
82
  };
73
- conditions?: {
74
- type: string;
75
- status: string;
76
- lastHeartbeatTime?: string;
77
- lastTransitionTime?: string;
78
- reason?: string;
79
- message?: string;
80
- }[];
83
+ conditions?: NodeCondition[];
81
84
  addresses?: {
82
85
  type: string;
83
86
  address: string;
@@ -115,40 +118,18 @@ export declare class Node extends KubeObject {
115
118
  static namespaced: boolean;
116
119
  static apiBase: string;
117
120
  constructor(data: KubeJsonApiData);
121
+ /**
122
+ * Returns the concatination of all current condition types which have a status
123
+ * of `"True"`
124
+ */
118
125
  getNodeConditionText(): string;
119
- getTaints(): {
120
- key: string;
121
- value: string;
122
- effect: string;
123
- timeAdded: string;
124
- }[];
126
+ getTaints(): NodeTaint[];
125
127
  getRoleLabels(): string;
126
128
  getCpuCapacity(): number;
127
129
  getMemoryCapacity(): number;
128
- getConditions(): {
129
- type: string;
130
- status: string;
131
- lastHeartbeatTime?: string;
132
- lastTransitionTime?: string;
133
- reason?: string;
134
- message?: string;
135
- }[];
136
- getActiveConditions(): {
137
- type: string;
138
- status: string;
139
- lastHeartbeatTime?: string;
140
- lastTransitionTime?: string;
141
- reason?: string;
142
- message?: string;
143
- }[];
144
- getWarningConditions(): {
145
- type: string;
146
- status: string;
147
- lastHeartbeatTime?: string;
148
- lastTransitionTime?: string;
149
- reason?: string;
150
- message?: string;
151
- }[];
130
+ getConditions(): NodeCondition[];
131
+ getActiveConditions(): NodeCondition[];
132
+ getWarningConditions(): NodeCondition[];
152
133
  getKubeletVersion(): string;
153
134
  getOperatingSystem(): string;
154
135
  isUnschedulable(): boolean;
@@ -18,27 +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 { KubeConfig, V1Node, V1Pod } from "@kubernetes/client-node";
21
+ import { KubeConfig } from "@kubernetes/client-node";
22
22
  import { Cluster, Context, User } from "@kubernetes/client-node/dist/config_types";
23
23
  import Joi from "joi";
24
- export declare type KubeConfigValidationOpts = {
25
- validateCluster?: boolean;
26
- validateUser?: boolean;
27
- validateExec?: boolean;
28
- };
29
24
  export declare const kubeConfigDefaultPath: string;
30
25
  export declare function loadConfigFromFileSync(filePath: string): ConfigResult;
31
26
  export declare function loadConfigFromFile(filePath: string): Promise<ConfigResult>;
32
- export interface KubeConfigOptions {
27
+ interface KubeConfigOptions {
33
28
  clusters: Cluster[];
34
29
  users: User[];
35
30
  contexts: Context[];
36
31
  currentContext?: string;
37
32
  }
38
- export interface OptionsResult {
39
- options: KubeConfigOptions;
40
- error: Joi.ValidationError;
41
- }
42
33
  export declare function loadFromOptions(options: KubeConfigOptions): KubeConfig;
43
34
  export interface ConfigResult {
44
35
  config: KubeConfig;
@@ -53,12 +44,16 @@ export interface SplitConfigEntry {
53
44
  * Breaks kube config into several configs. Each context as it own KubeConfig object
54
45
  */
55
46
  export declare function splitConfig(kubeConfig: KubeConfig): SplitConfigEntry[];
47
+ /**
48
+ * Pretty format the object as human readable yaml, such as would be on the filesystem
49
+ * @param kubeConfig The kubeconfig object to format as pretty yaml
50
+ * @returns The yaml representation of the kubeconfig object
51
+ */
56
52
  export declare function dumpConfigYaml(kubeConfig: Partial<KubeConfig>): string;
57
- export declare function podHasIssues(pod: V1Pod): boolean;
58
- export declare function getNodeWarningConditions(node: V1Node): import("@kubernetes/client-node").V1NodeCondition[];
59
53
  /**
60
54
  * Checks if `config` has valid `Context`, `User`, `Cluster`, and `exec` fields (if present when required)
61
55
  *
62
56
  * Note: This function returns an error instead of throwing it, returning `undefined` if the validation passes
63
57
  */
64
- export declare function validateKubeConfig(config: KubeConfig, contextName: string, validationOpts?: KubeConfigValidationOpts): Error | undefined;
58
+ export declare function validateKubeConfig(config: KubeConfig, contextName: string): Error | undefined;
59
+ export {};
@@ -18,6 +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
+ /// <reference types="node" />
21
22
  import { ObservableToggleSet } from "../utils";
22
23
  import type { monaco } from "react-monaco-editor";
23
24
  export interface KubeconfigSyncEntry extends KubeconfigSyncValue {
@@ -35,6 +36,13 @@ interface PreferenceDescription<T, R = T> {
35
36
  fromStore(val: T | undefined): R;
36
37
  toStore(val: R): T | undefined;
37
38
  }
39
+ export interface DownloadMirror {
40
+ url: string;
41
+ label: string;
42
+ platforms: Set<NodeJS.Platform>;
43
+ }
44
+ export declare const defaultPackageMirror = "default";
45
+ export declare const packageMirrors: Map<string, DownloadMirror>;
38
46
  declare type PreferencesModelType<field extends keyof typeof DESCRIPTORS> = typeof DESCRIPTORS[field] extends PreferenceDescription<infer T, any> ? T : never;
39
47
  declare type UserStoreModelType<field extends keyof typeof DESCRIPTORS> = typeof DESCRIPTORS[field] extends PreferenceDescription<any, infer T> ? T : never;
40
48
  export declare type UserStoreFlatModel = {
@@ -63,7 +71,6 @@ export declare const DESCRIPTORS: {
63
71
  updateChannel: PreferenceDescription<string, string>;
64
72
  };
65
73
  export declare const CONSTANTS: {
66
- defaultUpdateChannel: string;
67
74
  updateChannels: Map<string, {
68
75
  label: string;
69
76
  }>;
@@ -67,7 +67,7 @@ export declare class UserStore extends BaseStore<UserStoreModel> {
67
67
  syncKubeconfigEntries: import("mobx").ObservableMap<string, KubeconfigSyncValue>;
68
68
  get isNewVersion(): boolean;
69
69
  get resolvedShell(): string | undefined;
70
- get isAllowedToDowngrade(): boolean;
70
+ readonly isAllowedToDowngrade: boolean;
71
71
  startMainReactions(): void;
72
72
  getEditorOptions(): monaco.editor.IStandaloneEditorConstructionOptions;
73
73
  setEditorLineNumbers(lineNumbers: monaco.editor.LineNumbersType): void;
@@ -23,54 +23,54 @@ export declare type Falsey = false | 0 | "" | null | undefined;
23
23
  * Create a new type safe empty Iterable
24
24
  * @returns An `Iterable` that yields 0 items
25
25
  */
26
- export declare function newEmpty<T>(): Iterable<T>;
26
+ export declare function newEmpty<T>(): IterableIterator<T>;
27
27
  /**
28
28
  * Creates a new `Iterable` that yields at most n items from src.
29
29
  * Does not modify `src` which can be used later.
30
30
  * @param src An initial iterator
31
31
  * @param n The maximum number of elements to take from src. Yields up to the floor of `n` and 0 items if n < 0
32
32
  */
33
- export declare function take<T>(src: Iterable<T>, n: number): Iterable<T>;
33
+ export declare function take<T>(src: Iterable<T>, n: number): IterableIterator<T>;
34
34
  /**
35
35
  * Creates a new iterator that iterates (lazily) over its input and yields the
36
36
  * result of `fn` for each item.
37
37
  * @param src A type that can be iterated over
38
38
  * @param fn The function that is called for each value
39
39
  */
40
- export declare function map<T, U>(src: Iterable<T>, fn: (from: T) => U): Iterable<U>;
40
+ export declare function map<T, U>(src: Iterable<T>, fn: (from: T) => U): IterableIterator<U>;
41
41
  /**
42
42
  * The single layer flattening of an iterator, discarding `Falsey` values.
43
43
  * @param src A type that can be iterated over
44
44
  * @param fn The function that returns either an iterable over items that should be filtered out or a `Falsey` value indicating that it should be ignored
45
45
  */
46
- export declare function filterFlatMap<T, U>(src: Iterable<T>, fn: (from: T) => Iterable<U | Falsey> | Falsey): Iterable<U>;
46
+ export declare function filterFlatMap<T, U>(src: Iterable<T>, fn: (from: T) => Iterable<U | Falsey> | Falsey): IterableIterator<U>;
47
47
  /**
48
48
  * Returns a new iterator that yields the items that each call to `fn` would produce
49
49
  * @param src A type that can be iterated over
50
50
  * @param fn A function that returns an iterator
51
51
  */
52
- export declare function flatMap<T, U>(src: Iterable<T>, fn: (from: T) => Iterable<U>): Iterable<U>;
52
+ export declare function flatMap<T, U>(src: Iterable<T>, fn: (from: T) => Iterable<U>): IterableIterator<U>;
53
53
  /**
54
54
  * Creates a new iterator that iterates (lazily) over its input and yields the
55
55
  * items that return a `truthy` value from `fn`.
56
56
  * @param src A type that can be iterated over
57
57
  * @param fn The function that is called for each value
58
58
  */
59
- export declare function filter<T>(src: Iterable<T>, fn: (from: T) => any): Iterable<T>;
59
+ export declare function filter<T>(src: Iterable<T>, fn: (from: T) => any): IterableIterator<T>;
60
60
  /**
61
61
  * Creates a new iterator that iterates (lazily) over its input and yields the
62
62
  * result of `fn` when it is `truthy`
63
63
  * @param src A type that can be iterated over
64
64
  * @param fn The function that is called for each value
65
65
  */
66
- export declare function filterMap<T, U>(src: Iterable<T>, fn: (from: T) => U | Falsey): Iterable<U>;
66
+ export declare function filterMap<T, U>(src: Iterable<T>, fn: (from: T) => U | Falsey): IterableIterator<U>;
67
67
  /**
68
68
  * Creates a new iterator that iterates (lazily) over its input and yields the
69
69
  * result of `fn` when it is not null or undefined
70
70
  * @param src A type that can be iterated over
71
71
  * @param fn The function that is called for each value
72
72
  */
73
- export declare function filterMapStrict<T, U>(src: Iterable<T>, fn: (from: T) => U | null | undefined): Iterable<U>;
73
+ export declare function filterMapStrict<T, U>(src: Iterable<T>, fn: (from: T) => U | null | undefined): IterableIterator<U>;
74
74
  /**
75
75
  * Iterate through `src` until `match` returns a truthy value
76
76
  * @param src A type that can be iterated over
@@ -85,4 +85,11 @@ export declare function find<T>(src: Iterable<T>, match: (i: T) => any): T | und
85
85
  * @param reducer A function for producing the next item from an accumilation and the current item
86
86
  * @param initial The initial value for the iteration
87
87
  */
88
- export declare function reduce<T, R>(src: Iterable<T>, reducer: (acc: Iterable<R>, cur: T) => Iterable<R>, initial: Iterable<R>): Iterable<R>;
88
+ export declare function reduce<T, R extends Iterable<any>>(src: Iterable<T>, reducer: (acc: R, cur: T) => R, initial: R): R;
89
+ /**
90
+ * A convenience function for reducing over an iterator of strings and concatenating them together
91
+ * @param src The value to iterate over
92
+ * @param connector The string value to intersperse between the yielded values
93
+ * @returns The concatenated entries of `src` interspersed with copies of `connector`
94
+ */
95
+ export declare function join(src: Iterable<string>, connector?: string): string;
@@ -18,5 +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
- export * from "../../common/catalog-entities";
21
+ export { KubernetesCluster, kubernetesClusterCategory, GeneralEntity, WebLink, } from "../../common/catalog-entities";
22
+ export type { KubernetesClusterPrometheusMetrics, KubernetesClusterSpec, KubernetesClusterMetadata, WebLinkSpec, WebLinkStatus, WebLinkStatusPhase, KubernetesClusterStatusPhase, KubernetesClusterStatus, } from "../../common/catalog-entities";
22
23
  export * from "../../common/catalog/catalog-entity";