feat: add effect for creating overlay

This commit is contained in:
J H
2024-01-26 14:09:35 -07:00
parent 4651dfdc3a
commit 27acf55339

View File

@@ -5,8 +5,6 @@ import { PortOptions } from "./interfaces/Host"
import { UrlString } from "./util/getNetworkInterface"
import { NetworkInterfaceType } from "./util/utils"
export type Signals = "SIGINT" | "SIGTERM" | "SIGKILL" | "SIGHUP"
export type ExportedAction = (options: {
effects: Effects
input?: Record<string, unknown>
@@ -130,7 +128,7 @@ export type DaemonReceipt = {
}
export type Daemon = {
wait(): Promise<string>
term(options?: { signal?: Signals; timeout?: number }): Promise<void>
term(): Promise<void>
[DaemonProof]: never
}
@@ -150,7 +148,7 @@ export type CommandType<A extends string> =
export type DaemonReturned = {
wait(): Promise<string>
term(options?: { signal?: Signals; timeout?: number }): Promise<void>
term(): Promise<void>
}
export type ActionMetadata = {
@@ -224,10 +222,14 @@ export type ExposeUiPaths<Store> = Array<{
export type Effects = {
executeAction<Input>(opts: {
serviceId?: string
actionId: string
input: Input
}): Promise<unknown>
/** The idea is that we can mount the imageId, and it returns us the location of the mount. */
createOverlayImage(options: { imageId: string }): Promise<String>
/** Sandbox mode lets us read but not write */
is_sandboxed(): Promise<boolean>
/** Removes all network bindings */
clearBindings(): Promise<void>
/** Creates a host connected to the specified port with the provided options */
@@ -397,8 +399,6 @@ export type Effects = {
message?: string
}): Promise<void>
setMainStatus(o: { status: "running" | "stopped" }): Promise<void>
/** Set the dependencies of what the service needs, usually ran during the set config as a best practice */
setDependencies(dependencies: Dependencies): Promise<DependenciesReceipt>
/** Exists could be useful during the runtime to know if some service exists, option dep */