chore: Remove effects

There are effects that we don't need now that we are going node first.
This commit is contained in:
Blu-J
2023-06-08 10:23:49 -06:00
parent 68c5a326cf
commit 5b7a0e17ec

View File

@@ -219,20 +219,6 @@ export type ExposeUiPaths<Store> = Array<{
}> }>
/** Used to reach out from the pure js runtime */ /** Used to reach out from the pure js runtime */
export type Effects = { export type Effects = {
runCommand<A extends string>(
command: ValidIfNoStupidEscape<A> | [string, ...string[]],
options?: {
timeoutMillis?: number
env?: Record<string, string>
},
): Promise<string>
runDaemon<A extends string>(
command: ValidIfNoStupidEscape<A> | [string, ...string[]],
options?: {
env?: Record<string, string>
},
): DaemonReturned
executeAction<Input>(opts: { executeAction<Input>(opts: {
serviceId?: string serviceId?: string
input: Input input: Input
@@ -265,44 +251,22 @@ export type Effects = {
callback: () => void callback: () => void
}): Promise<[HostName, ...HostName[]]> }): Promise<[HostName, ...HostName[]]>
/** Similar to the fetch api via the mdn, this is simplified but the point is // /**
* to get something from some website, and return the response. // * Run rsync between two volumes. This is used to backup data between volumes.
*/ // * This is a long running process, and a structure that we can either wait for, or get the progress of.
fetch( // */
url: string, // runRsync(options: {
options?: { // srcVolume: string
method?: "GET" | "POST" | "PUT" | "DELETE" | "HEAD" | "PATCH" // dstVolume: string
headers?: Record<string, string> // srcPath: string
body?: string // dstPath: string
}, // // rsync options: https://linux.die.net/man/1/rsync
): Promise<{ // options: BackupOptions
method: string // }): {
ok: boolean // id: () => Promise<string>
status: number // wait: () => Promise<null>
headers: Record<string, string> // progress: () => Promise<number>
body?: string | null // }
/// Returns the body as a string
text(): Promise<string>
/// Returns the body as a json
json(): Promise<unknown>
}>
/**
* Run rsync between two volumes. This is used to backup data between volumes.
* This is a long running process, and a structure that we can either wait for, or get the progress of.
*/
runRsync(options: {
srcVolume: string
dstVolume: string
srcPath: string
dstPath: string
// rsync options: https://linux.die.net/man/1/rsync
options: BackupOptions
}): {
id: () => Promise<string>
wait: () => Promise<null>
progress: () => Promise<number>
}
store: { store: {
/** Get a value in a json like data, can be observed and subscribed */ /** Get a value in a json like data, can be observed and subscribed */