mirror of
https://github.com/Start9Labs/start-sdk.git
synced 2026-03-30 20:24:47 +00:00
chore: Add the wrapperData, bound effects, and sdk
This commit is contained in:
@@ -74,7 +74,6 @@ export class Daemons<Ids extends string | never> {
|
||||
const daemonsStarted = {} as Record<Ids, Promise<DaemonReturned>>;
|
||||
const { effects } = this;
|
||||
const daemons = this.daemons ?? [];
|
||||
const _config = await effects.getServiceConfig();
|
||||
for (const daemon of daemons) {
|
||||
const requiredPromise = Promise.all(
|
||||
daemon.requires?.map((id) => daemonsStarted[id]) ?? []
|
||||
|
||||
@@ -2,7 +2,7 @@ import { Effects } from "../types";
|
||||
import { LocalBinding } from "./LocalBinding";
|
||||
|
||||
export class LocalPort {
|
||||
constructor(readonly id: string, readonly effects: Effects) {}
|
||||
constructor(readonly effects: Effects, readonly id: string) {}
|
||||
async bindLan(internalPort: number) {
|
||||
const [localAddress, ipAddress] = await this.effects.bindLan({
|
||||
internalPort,
|
||||
|
||||
@@ -9,9 +9,9 @@ export class NetworkBuilder {
|
||||
private constructor(private effects: Effects) {}
|
||||
|
||||
getTorHostName(id: string) {
|
||||
return new TorHostname(id, this.effects);
|
||||
return new TorHostname(this.effects, id);
|
||||
}
|
||||
getPort(id: string) {
|
||||
return new LocalPort(id, this.effects);
|
||||
return new LocalPort(this.effects, id);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,10 @@ import { Effects } from "../types";
|
||||
import { TorBinding } from "./TorBinding";
|
||||
|
||||
export class TorHostname {
|
||||
constructor(readonly id: string, readonly effects: Effects) {}
|
||||
constructor(readonly effects: Effects, readonly id: string) {}
|
||||
static of(effects: Effects, id: string) {
|
||||
return new TorHostname(effects, id);
|
||||
}
|
||||
async bindTor(internalPort: number, externalPort: number) {
|
||||
const address = await this.effects.bindTor({
|
||||
internalPort,
|
||||
|
||||
Reference in New Issue
Block a user