mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-26 10:21:52 +00:00
* wip * initialize callbacks * wip * smtp * list_service_interfaces * wip * wip * fix domains * fix hostname handling in NetService * misc fixes * getInstalledPackages * misc fixes * publish v6 lib * refactor service effects * fix import * fix container runtime * fix tests * apply suggestions from review
55 lines
1.2 KiB
TypeScript
55 lines
1.2 KiB
TypeScript
import { types as T } from "@start9labs/start-sdk"
|
|
import { RpcResult } from "../Adapters/RpcListener"
|
|
import { Effects } from "../Models/Effects"
|
|
import { CallbackHolder } from "../Models/CallbackHolder"
|
|
import { MainEffects } from "@start9labs/start-sdk/cjs/lib/StartSdk"
|
|
|
|
export type Procedure =
|
|
| "/init"
|
|
| "/uninit"
|
|
| "/config/set"
|
|
| "/config/get"
|
|
| "/backup/create"
|
|
| "/backup/restore"
|
|
| "/actions/metadata"
|
|
| "/properties"
|
|
| `/actions/${string}/get`
|
|
| `/actions/${string}/run`
|
|
| `/dependencies/${string}/query`
|
|
| `/dependencies/${string}/update`
|
|
|
|
export type ExecuteResult =
|
|
| { ok: unknown }
|
|
| { err: { code: number; message: string } }
|
|
export type System = {
|
|
init(): Promise<void>
|
|
|
|
start(effects: MainEffects): Promise<void>
|
|
callCallback(callback: number, args: any[]): void
|
|
stop(): Promise<void>
|
|
|
|
execute(
|
|
effects: Effects,
|
|
options: {
|
|
procedure: Procedure
|
|
input: unknown
|
|
timeout?: number
|
|
},
|
|
): Promise<RpcResult>
|
|
sandbox(
|
|
effects: Effects,
|
|
options: {
|
|
procedure: Procedure
|
|
input: unknown
|
|
timeout?: number
|
|
},
|
|
): Promise<RpcResult>
|
|
|
|
exit(): Promise<void>
|
|
}
|
|
|
|
export type RunningMain = {
|
|
callbacks: CallbackHolder
|
|
stop(): Promise<void>
|
|
}
|