mirror of
https://github.com/Start9Labs/start-sdk.git
synced 2026-03-30 20:24:47 +00:00
feat: creating the rest of the sdk
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
import { HealthReceipt } from "../health/HealthReceipt"
|
||||
import { CheckResult } from "../health/checkFns"
|
||||
import { Trigger } from "../health/trigger"
|
||||
import { TriggerInput } from "../health/trigger/TriggerInput"
|
||||
import { defaultTrigger } from "../health/trigger/defaultTrigger"
|
||||
import { Trigger } from "../trigger"
|
||||
import { TriggerInput } from "../trigger/TriggerInput"
|
||||
import { defaultTrigger } from "../trigger/defaultTrigger"
|
||||
import { DaemonReturned, Effects, ValidIfNoStupidEscape } from "../types"
|
||||
import { InterfaceReceipt } from "./interfaceReceipt"
|
||||
type Daemon<Ids extends string, Command extends string, Id extends string> = {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { Effects, ExpectedExports } from "../types"
|
||||
import { createMainUtils, Utils, utils } from "../util"
|
||||
import { createMainUtils } from "../util"
|
||||
import { Utils, utils } from "../util/utils"
|
||||
import { Daemons } from "./Daemons"
|
||||
import "./exportInterfaces"
|
||||
import "./LocalBinding"
|
||||
@@ -11,7 +12,6 @@ import "./TorBinding"
|
||||
import "./TorHostname"
|
||||
|
||||
import "./Daemons"
|
||||
import { WrapperDataContract } from "../wrapperData/wrapperDataContract"
|
||||
|
||||
/**
|
||||
* Used to ensure that the main function is running with the valid proofs.
|
||||
@@ -23,18 +23,17 @@ import { WrapperDataContract } from "../wrapperData/wrapperDataContract"
|
||||
* @param fn
|
||||
* @returns
|
||||
*/
|
||||
export const setupMain = <WD>(
|
||||
wrapperDataContract: WrapperDataContract<WD>,
|
||||
export const setupMain = <Store>(
|
||||
fn: (o: {
|
||||
effects: Effects
|
||||
started(onTerm: () => void): null
|
||||
utils: Utils<WD, {}>
|
||||
utils: Utils<Store, {}>
|
||||
}) => Promise<Daemons<any>>,
|
||||
): ExpectedExports.main => {
|
||||
return async (options) => {
|
||||
const result = await fn({
|
||||
...options,
|
||||
utils: createMainUtils(wrapperDataContract, options.effects),
|
||||
utils: createMainUtils<Store>(options.effects),
|
||||
})
|
||||
await result.build().then((x) => x.wait())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user