mirror of
https://github.com/Start9Labs/start-sdk.git
synced 2026-03-26 02:11:56 +00:00
beta4
This commit is contained in:
@@ -196,7 +196,7 @@ export class StartSdk<Manifest extends SDKManifest, Store> {
|
||||
setupMain: (
|
||||
fn: (o: {
|
||||
effects: Effects
|
||||
started(onTerm: () => void): null
|
||||
started(onTerm: () => PromiseLike<void>): PromiseLike<void>
|
||||
utils: Utils<Manifest, Store, {}>
|
||||
}) => Promise<Daemons<Manifest, any>>,
|
||||
) => setupMain<Manifest, Store>(fn),
|
||||
|
||||
@@ -2,7 +2,10 @@ import { Address } from "../types"
|
||||
import { Host, PortOptions } from "./Host"
|
||||
|
||||
export class Origin<T extends Host> {
|
||||
constructor(readonly host: T, readonly options: PortOptions) {}
|
||||
constructor(
|
||||
readonly host: T,
|
||||
readonly options: PortOptions,
|
||||
) {}
|
||||
|
||||
build({ username, path, search }: BuildOptions): Address {
|
||||
const qpEntries = Object.entries(search)
|
||||
|
||||
@@ -123,7 +123,7 @@ export class Daemons<Manifest extends SDKManifest, Ids extends string> {
|
||||
({
|
||||
status: "failing",
|
||||
message: "message" in err ? err.message : String(err),
|
||||
} as CheckResult),
|
||||
}) as CheckResult,
|
||||
)
|
||||
currentInput.lastResult = response.status || null
|
||||
if (!currentInput.hadSuccess && response.status === "passing") {
|
||||
|
||||
@@ -21,7 +21,7 @@ import { SDKManifest } from "../manifest/ManifestTypes"
|
||||
export const setupMain = <Manifest extends SDKManifest, Store>(
|
||||
fn: (o: {
|
||||
effects: Effects
|
||||
started(onTerm: () => void): null
|
||||
started(onTerm: () => PromiseLike<void>): PromiseLike<void>
|
||||
utils: Utils<Manifest, Store, {}>
|
||||
}) => Promise<Daemons<Manifest, any>>,
|
||||
): ExpectedExports.main => {
|
||||
@@ -30,6 +30,6 @@ export const setupMain = <Manifest extends SDKManifest, Store>(
|
||||
...options,
|
||||
utils: createMainUtils<Manifest, Store>(options.effects),
|
||||
})
|
||||
await result.build().then((x) => x.wait())
|
||||
return result
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ export namespace ExpectedExports {
|
||||
*/
|
||||
export type main = (options: {
|
||||
effects: Effects
|
||||
started(onTerm: () => Promise<void>): Promise<void>
|
||||
started(onTerm: () => PromiseLike<void>): PromiseLike<void>
|
||||
}) => Promise<Daemons<any, any>>
|
||||
|
||||
/**
|
||||
|
||||
@@ -6,7 +6,10 @@ import { Buffer } from "node:buffer"
|
||||
export const execFile = promisify(cp.execFile)
|
||||
|
||||
export class Overlay {
|
||||
private constructor(readonly effects: T.Effects, readonly rootfs: string) {}
|
||||
private constructor(
|
||||
readonly effects: T.Effects,
|
||||
readonly rootfs: string,
|
||||
) {}
|
||||
static async of(effects: T.Effects, imageId: string) {
|
||||
const rootfs = await effects.createOverlayedImage({ imageId })
|
||||
|
||||
|
||||
@@ -66,7 +66,11 @@ const addressHostToUrl = (
|
||||
{ options, username, suffix }: Address,
|
||||
host: HostName,
|
||||
): UrlString => {
|
||||
const scheme = host.endsWith('.onion') ? options.scheme : (options.addSsl ? options.addSsl.scheme : options.scheme) // TODO: encode whether hostname transport is "secure"?
|
||||
const scheme = host.endsWith(".onion")
|
||||
? options.scheme
|
||||
: options.addSsl
|
||||
? options.addSsl.scheme
|
||||
: options.scheme // TODO: encode whether hostname transport is "secure"?
|
||||
return `${scheme ? `${scheme}//` : ""}${
|
||||
username ? `${username}@` : ""
|
||||
}${host}${suffix}`
|
||||
|
||||
Reference in New Issue
Block a user