mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Fixup type errors
Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
parent
2301270d54
commit
45b630553a
@ -5,7 +5,7 @@
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { generalCatalogEntityInjectionToken } from "../general-catalog-entity-injection-token";
|
||||
import { GeneralEntity } from "../../index";
|
||||
import { buildURL } from "@k8slens/utilities/src/buildUrl";
|
||||
import { buildURL } from "@k8slens/utilities";
|
||||
import welcomeRouteInjectable from "../../../front-end-routing/routes/welcome/welcome-route.injectable";
|
||||
|
||||
const welcomeCatalogEntityInjectable = getInjectable({
|
||||
|
||||
@ -10,7 +10,7 @@ import { autorun, action, observable } from "mobx";
|
||||
import type { KubeApi } from "../kube-api";
|
||||
import type { KubeObject, ObjectReference } from "../kube-object";
|
||||
import { parseKubeApi, createKubeApiURL } from "../kube-api-parse";
|
||||
import { chain, find } from "@k8slens/utilities/src/iter";
|
||||
import { chain, find } from "@k8slens/utilities";
|
||||
|
||||
export type RegisterableStore<Store> = Store extends KubeObjectStore<any, any, any>
|
||||
? Store
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
|
||||
import { getLegacyGlobalDiForExtensionApi } from "../../../extensions/as-legacy-globals-for-extension-api/legacy-global-di-for-extension-api";
|
||||
import customResourcesRouteInjectable from "../../front-end-routing/routes/cluster/custom-resources/custom-resources/custom-resources-route.injectable";
|
||||
import { buildURL } from "@k8slens/utilities/src/buildUrl";
|
||||
import { buildURL } from "@k8slens/utilities";
|
||||
import type { BaseKubeObjectCondition, ClusterScopedMetadata } from "../kube-object";
|
||||
import { KubeObject } from "../kube-object";
|
||||
import type { DerivedKubeApiOptions, KubeApiDependencies } from "../kube-api";
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { urlBuilderFor } from "@k8slens/utilities/src/buildUrl";
|
||||
import { urlBuilderFor } from "@k8slens/utilities";
|
||||
import { HelmChart } from "../helm-charts.api";
|
||||
import type { RawHelmChart } from "../helm-charts.api";
|
||||
import { isDefined } from "@k8slens/utilities";
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { urlBuilderFor } from "@k8slens/utilities/src/buildUrl";
|
||||
import { urlBuilderFor } from "@k8slens/utilities";
|
||||
import apiBaseInjectable from "../../api-base.injectable";
|
||||
|
||||
export type RequestHelmReleaseConfiguration = (
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
import yaml from "js-yaml";
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import type { HelmReleaseUpdateDetails } from "../helm-releases.api";
|
||||
import { urlBuilderFor } from "@k8slens/utilities/src/buildUrl";
|
||||
import { urlBuilderFor } from "@k8slens/utilities";
|
||||
import apiBaseInjectable from "../../api-base.injectable";
|
||||
|
||||
interface HelmReleaseCreatePayload {
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { urlBuilderFor } from "@k8slens/utilities/src/buildUrl";
|
||||
import { urlBuilderFor } from "@k8slens/utilities";
|
||||
import apiBaseInjectable from "../../api-base.injectable";
|
||||
|
||||
export type RequestDeleteHelmRelease = (name: string, namespace: string) => Promise<void>;
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import type { KubeJsonApiData } from "../../kube-json-api";
|
||||
import { urlBuilderFor } from "@k8slens/utilities/src/buildUrl";
|
||||
import { urlBuilderFor } from "@k8slens/utilities";
|
||||
import apiBaseInjectable from "../../api-base.injectable";
|
||||
|
||||
export interface HelmReleaseDetails {
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { urlBuilderFor } from "@k8slens/utilities/src/buildUrl";
|
||||
import { urlBuilderFor } from "@k8slens/utilities";
|
||||
import apiBaseInjectable from "../../api-base.injectable";
|
||||
|
||||
export interface HelmReleaseRevision {
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { urlBuilderFor } from "@k8slens/utilities/src/buildUrl";
|
||||
import { urlBuilderFor } from "@k8slens/utilities";
|
||||
import apiBaseInjectable from "../../api-base.injectable";
|
||||
import type { HelmReleaseDto } from "../helm-releases.api";
|
||||
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { urlBuilderFor } from "@k8slens/utilities/src/buildUrl";
|
||||
import { urlBuilderFor } from "@k8slens/utilities";
|
||||
import apiBaseInjectable from "../../api-base.injectable";
|
||||
|
||||
export type RequestHelmReleaseRollback = (name: string, namespace: string, revision: number) => Promise<void>;
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { urlBuilderFor } from "@k8slens/utilities/src/buildUrl";
|
||||
import { urlBuilderFor } from "@k8slens/utilities";
|
||||
import type { AsyncResult } from "@k8slens/utilities";
|
||||
import apiBaseInjectable from "../../api-base.injectable";
|
||||
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { urlBuilderFor } from "@k8slens/utilities/src/buildUrl";
|
||||
import { urlBuilderFor } from "@k8slens/utilities";
|
||||
import apiBaseInjectable from "../../api-base.injectable";
|
||||
|
||||
export type RequestHelmReleaseValues = (name: string, namespace: string, all?: boolean) => Promise<string>;
|
||||
|
||||
@ -12,7 +12,7 @@ import navigateInjectable from "../../renderer/navigation/navigate.injectable";
|
||||
import { asLegacyGlobalFunctionForExtensionApi } from "../as-legacy-globals-for-extension-api/as-legacy-global-function-for-extension-api";
|
||||
|
||||
export type { PageParamInit, PageParam } from "../../renderer/navigation/page-param";
|
||||
export type { URLParams } from "@k8slens/utilities/src/buildUrl";
|
||||
export type { URLParams } from "@k8slens/utilities";
|
||||
|
||||
export const getDetailsUrl = asLegacyGlobalFunctionForExtensionApi(getDetailsUrlInjectable);
|
||||
export const showDetails = asLegacyGlobalFunctionForExtensionApi(showDetailsInjectable);
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { generalCatalogEntityInjectionToken } from "../../../common/catalog-entities/general-catalog-entities/general-catalog-entity-injection-token";
|
||||
import { GeneralEntity } from "../../../common/catalog-entities";
|
||||
import { buildURL } from "@k8slens/utilities/src/buildUrl";
|
||||
import { buildURL } from "@k8slens/utilities";
|
||||
import preferencesRouteInjectable from "./preferences-route.injectable";
|
||||
|
||||
const preferencesCatalogEntityInjectable = getInjectable({
|
||||
|
||||
@ -8,7 +8,7 @@ import loggerInjectable from "../../common/logger.injectable";
|
||||
import type { KubeApiResource } from "../../common/rbac";
|
||||
import type { Cluster } from "../../common/cluster/cluster";
|
||||
import { requestApiVersionsInjectionToken } from "./request-api-versions";
|
||||
import { withConcurrencyLimit } from "@k8slens/utilities/src/with-concurrency-limit";
|
||||
import { withConcurrencyLimit } from "@k8slens/utilities";
|
||||
import requestKubeApiResourcesForInjectable from "./request-kube-api-resources-for.injectable";
|
||||
import type { AsyncResult } from "../../common/utils/async-result";
|
||||
import { backoffCaller } from "../../common/utils/backoff-caller";
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
*/
|
||||
import type { V1APIGroupList } from "@kubernetes/client-node";
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { chain } from "@k8slens/utilities/src/iter";
|
||||
import { chain } from "@k8slens/utilities";
|
||||
import k8sRequestInjectable from "../k8s-request.injectable";
|
||||
import { requestApiVersionsInjectionToken } from "./request-api-versions";
|
||||
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { navigateToUrlInjectionToken } from "../../common/front-end-routing/navigate-to-url-injection-token";
|
||||
import { navigateToRouteInjectionToken } from "../../common/front-end-routing/navigate-to-route-injection-token";
|
||||
import { buildURL } from "@k8slens/utilities/src/buildUrl";
|
||||
import { buildURL } from "@k8slens/utilities";
|
||||
|
||||
const navigateToRouteInjectable = getInjectable({
|
||||
id: "navigate-to-route",
|
||||
|
||||
@ -8,7 +8,7 @@ import styles from "./badge.module.scss";
|
||||
import React, { useEffect, useRef, useState } from "react";
|
||||
import { action, observable } from "mobx";
|
||||
import { observer } from "mobx-react";
|
||||
import { cssNames } from "@k8slens/utilities/src/cssNames";
|
||||
import { cssNames } from "@k8slens/utilities";
|
||||
import { withTooltip } from "../tooltip";
|
||||
|
||||
export interface BadgeProps extends React.HTMLAttributes<HTMLDivElement> {
|
||||
|
||||
@ -17,7 +17,7 @@ import catalogPreviousActiveTabStorageInjectable from "../+catalog/catalog-previ
|
||||
import type { IComputedValue } from "mobx";
|
||||
import currentRouteComponentInjectable from "../../routes/current-route-component.injectable";
|
||||
import welcomeRouteInjectable from "../../../common/front-end-routing/routes/welcome/welcome-route.injectable";
|
||||
import { buildURL } from "@k8slens/utilities/src/buildUrl";
|
||||
import { buildURL } from "@k8slens/utilities";
|
||||
import type { StorageLayer } from "@k8slens/utilities";
|
||||
import type { WatchForGeneralEntityNavigation } from "../../api/helpers/watch-for-general-entity-navigation.injectable";
|
||||
import watchForGeneralEntityNavigationInjectable from "../../api/helpers/watch-for-general-entity-navigation.injectable";
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
import type { IComputedValue } from "mobx";
|
||||
import { observable } from "mobx";
|
||||
import type { PodLogsQuery, Pod } from "../../../../common/k8s-api/endpoints";
|
||||
import { waitUntilDefined } from "@k8slens/utilities/src/wait";
|
||||
import { waitUntilDefined } from "@k8slens/utilities";
|
||||
import type { IntervalFn } from "@k8slens/utilities";
|
||||
import { getOrInsertWith, interval } from "@k8slens/utilities";
|
||||
import type { TabId } from "../dock/store";
|
||||
|
||||
@ -6,7 +6,7 @@ import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { when } from "mobx";
|
||||
import loggerInjectable from "../../../../common/logger.injectable";
|
||||
import { TerminalChannels } from "../../../../common/terminal/channels";
|
||||
import { waitUntilDefined } from "@k8slens/utilities/src/wait";
|
||||
import { waitUntilDefined } from "@k8slens/utilities";
|
||||
import { noop } from "@k8slens/utilities";
|
||||
import showSuccessNotificationInjectable from "../../notifications/show-success-notification.injectable";
|
||||
import selectDockTabInjectable from "../dock/select-dock-tab.injectable";
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import apiBaseInjectable from "../../../common/k8s-api/api-base.injectable";
|
||||
import type { ServiceAccount } from "../../../common/k8s-api/endpoints";
|
||||
import { urlBuilderFor } from "@k8slens/utilities/src/buildUrl";
|
||||
import { urlBuilderFor } from "@k8slens/utilities";
|
||||
import openKubeconfigDialogInjectable from "./open.injectable";
|
||||
|
||||
export type OpenServiceAccountKubeConfigDialog = (account: ServiceAccount) => void;
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import apiBaseInjectable from "../../../common/k8s-api/api-base.injectable";
|
||||
import loggerInjectable from "../../../common/logger.injectable";
|
||||
import { urlBuilderFor } from "@k8slens/utilities/src/buildUrl";
|
||||
import { urlBuilderFor } from "@k8slens/utilities";
|
||||
import type { ForwardedPort } from "../port-forward-item";
|
||||
|
||||
export type RequestActivePortForward = (portForward: ForwardedPort) => Promise<ForwardedPort | undefined>;
|
||||
|
||||
@ -6,7 +6,7 @@ import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { navigateToUrlInjectionToken } from "../../common/front-end-routing/navigate-to-url-injection-token";
|
||||
import { navigateToRouteInjectionToken } from "../../common/front-end-routing/navigate-to-route-injection-token";
|
||||
import currentlyInClusterFrameInjectable from "./currently-in-cluster-frame.injectable";
|
||||
import { buildURL } from "@k8slens/utilities/src/buildUrl";
|
||||
import { buildURL } from "@k8slens/utilities";
|
||||
|
||||
const navigateToRouteInjectable = getInjectable({
|
||||
id: "navigate-to-route",
|
||||
|
||||
@ -3,9 +3,9 @@
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
|
||||
import type { AsyncResult } from "./async-result";
|
||||
import type { AsyncResult, Result } from "./result";
|
||||
import { delay } from "./delay";
|
||||
import { noop } from "@k8slens/utilities/src/noop";
|
||||
import { noop } from "./noop";
|
||||
|
||||
/**
|
||||
* @param error The error that resulted in the failure
|
||||
@ -25,7 +25,7 @@ export interface BackoffCallerOptions<E> {
|
||||
maxAttempts?: number;
|
||||
|
||||
/**
|
||||
* In miliseconds
|
||||
* In milliseconds
|
||||
* @default 1000
|
||||
*/
|
||||
initialTimeout?: number;
|
||||
@ -41,7 +41,7 @@ export interface BackoffCallerOptions<E> {
|
||||
* @param fn The function to repeatedly attempt
|
||||
* @returns The first success or the last failure
|
||||
*/
|
||||
export const backoffCaller = async <T, E, R extends AsyncResult<T, E>>(fn: () => Promise<R>, options?: BackoffCallerOptions<E>): Promise<R> => {
|
||||
export const backoffCaller = async <T, E>(fn: () => AsyncResult<T, E>, options?: BackoffCallerOptions<E>): AsyncResult<T, E> => {
|
||||
const {
|
||||
initialTimeout = 1000,
|
||||
maxAttempts = 5,
|
||||
@ -51,7 +51,7 @@ export const backoffCaller = async <T, E, R extends AsyncResult<T, E>>(fn: () =>
|
||||
|
||||
let timeout = initialTimeout;
|
||||
let attempt = 0;
|
||||
let result: R;
|
||||
let result: Result<T, E>;
|
||||
|
||||
do {
|
||||
result = await fn();
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
import { camelCase } from "lodash";
|
||||
import type { SingleOrMany } from "./types";
|
||||
import { isObject, isString } from "./type-narrowing";
|
||||
import * as object from "./object";
|
||||
import { object } from "./object";
|
||||
|
||||
export function toCamelCase<T extends Record<string, unknown>[]>(obj: T): T;
|
||||
export function toCamelCase<T extends Record<string, unknown>>(obj: T): T;
|
||||
|
||||
@ -3,8 +3,8 @@
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
|
||||
import * as iter from "./iter";
|
||||
import * as object from "./object";
|
||||
import { iter } from "./iter";
|
||||
import { object } from "./object";
|
||||
import { isObject } from "./type-narrowing";
|
||||
|
||||
export type IgnoredClassNames = number | symbol | Function;
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
*/
|
||||
|
||||
import type { IInterceptable, IInterceptor, IListenable, ISetWillChange, ObservableMap } from "mobx";
|
||||
import { action, observable, ObservableSet } from "mobx";
|
||||
import { observable, ObservableSet, runInAction } from "mobx";
|
||||
|
||||
export function makeIterableIterator<T>(iterator: Iterator<T>): IterableIterator<T> {
|
||||
(iterator as IterableIterator<T>)[Symbol.iterator] = () => iterator as IterableIterator<T>;
|
||||
@ -138,8 +138,8 @@ export class ObservableHashSet<T> implements Set<T>, IInterceptable<ISetWillChan
|
||||
this.#hashmap = observable.map<string, T>(Array.from(initialValues, value => [this.hasher(value), value]), undefined);
|
||||
}
|
||||
|
||||
@action
|
||||
replace(other: ObservableHashSet<T> | ObservableSet<T> | Set<T> | readonly T[]): this {
|
||||
return runInAction(() => {
|
||||
if (other === null || other === undefined) {
|
||||
return this;
|
||||
}
|
||||
@ -155,6 +155,7 @@ export class ObservableHashSet<T> implements Set<T>, IInterceptable<ISetWillChan
|
||||
}
|
||||
|
||||
return this;
|
||||
});
|
||||
}
|
||||
|
||||
clear(): void {
|
||||
@ -167,8 +168,8 @@ export class ObservableHashSet<T> implements Set<T>, IInterceptable<ISetWillChan
|
||||
return this;
|
||||
}
|
||||
|
||||
@action
|
||||
toggle(value: T): void {
|
||||
runInAction(() => {
|
||||
const hash = this.hasher(value);
|
||||
|
||||
if (this.#hashmap.has(hash)) {
|
||||
@ -176,6 +177,7 @@ export class ObservableHashSet<T> implements Set<T>, IInterceptable<ISetWillChan
|
||||
} else {
|
||||
this.#hashmap.set(hash, value);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
delete(value: T): boolean {
|
||||
|
||||
@ -3,8 +3,6 @@
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
|
||||
import type { WindowEventListener } from "../window/event-listener.injectable";
|
||||
|
||||
function parseKeyDownDescriptor(descriptor: string): (event: KeyboardEvent) => boolean {
|
||||
const parts = new Set((
|
||||
descriptor
|
||||
@ -43,7 +41,7 @@ function parseKeyDownDescriptor(descriptor: string): (event: KeyboardEvent) => b
|
||||
};
|
||||
}
|
||||
|
||||
export function onKeyboardShortcut(descriptor: string, action: () => void): WindowEventListener<"keydown"> {
|
||||
export function onKeyboardShortcut(descriptor: string, action: () => void): (this: Window, ev: WindowEventMap["keydown"]) => any {
|
||||
const isMatchingEvent = parseKeyDownDescriptor(descriptor);
|
||||
|
||||
return (event) => {
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
*/
|
||||
|
||||
import path from "path";
|
||||
import * as iter from "@k8slens/utilities/src/iter";
|
||||
import { iter } from "./iter";
|
||||
|
||||
/**
|
||||
* Join all entires with a PATH env var delimited string together
|
||||
|
||||
Loading…
Reference in New Issue
Block a user