mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Make ResourceStack fully injectable (#6591)
Signed-off-by: Sebastian Malton <sebastian@malton.name> Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
1 parent
055a13d4a9
commit
6142aad5ab
15 files changed
+343
-140
No files matched your search
@@ -0,0 +1,43 @@
|
||||
/**
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
|
||||
import { getInjectionToken } from "@ogre-tools/injectable";
|
||||
import type { Asyncify } from "type-fest";
|
||||
import type { RequestChannelHandler } from "../../main/utils/channel/channel-listeners/listener-tokens";
|
||||
import type { ClusterId } from "../cluster-types";
|
||||
import type { AsyncResult } from "../utils/async-result";
|
||||
import type { RequestChannel } from "../utils/channel/request-channel-listener-injection-token";
|
||||
|
||||
export interface KubectlApplyAllArgs {
|
||||
clusterId: ClusterId;
|
||||
resources: string[];
|
||||
extraArgs: string[];
|
||||
}
|
||||
|
||||
export const kubectlApplyAllChannel: RequestChannel<KubectlApplyAllArgs, AsyncResult<string, string>> = {
|
||||
id: "kubectl-apply-all",
|
||||
};
|
||||
|
||||
export type KubectlApplyAll = Asyncify<RequestChannelHandler<typeof kubectlApplyAllChannel>>;
|
||||
|
||||
export const kubectlApplyAllInjectionToken = getInjectionToken<KubectlApplyAll>({
|
||||
id: "kubectl-apply-all",
|
||||
});
|
||||
|
||||
export interface KubectlDeleteAllArgs {
|
||||
clusterId: ClusterId;
|
||||
resources: string[];
|
||||
extraArgs: string[];
|
||||
}
|
||||
|
||||
export const kubectlDeleteAllChannel: RequestChannel<KubectlDeleteAllArgs, AsyncResult<string, string>> = {
|
||||
id: "kubectl-delete-all",
|
||||
};
|
||||
|
||||
export type KubectlDeleteAll = Asyncify<RequestChannelHandler<typeof kubectlDeleteAllChannel>>;
|
||||
|
||||
export const kubectlDeleteAllInjectionToken = getInjectionToken<KubectlDeleteAll>({
|
||||
id: "kubectl-delete-all",
|
||||
});
|
||||
Reference in new issue
Block a user