diff --git a/lib/interfaces/NetworkInterfaceBuilder.ts b/lib/interfaces/NetworkInterfaceBuilder.ts index dc1124f..ff9e430 100644 --- a/lib/interfaces/NetworkInterfaceBuilder.ts +++ b/lib/interfaces/NetworkInterfaceBuilder.ts @@ -21,6 +21,8 @@ export class NetworkInterfaceBuilder { name: string id: string description: string + hasPrimary: boolean + disabled: boolean ui: boolean username: null | string path: string @@ -39,7 +41,17 @@ export class NetworkInterfaceBuilder { async export[]>( origins: Origins, ): Promise { - const { name, description, id, ui, username, path, search } = this.options + const { + name, + description, + hasPrimary, + disabled, + id, + ui, + username, + path, + search, + } = this.options const addresses = Array.from(origins).map((o) => o.build({ username, path, search, scheme: null }), @@ -49,6 +61,8 @@ export class NetworkInterfaceBuilder { interfaceId: id, name, description, + hasPrimary, + disabled, addresses, ui, }) diff --git a/lib/test/host.test.ts b/lib/test/host.test.ts index 1d2fcf0..559c4cc 100644 --- a/lib/test/host.test.ts +++ b/lib/test/host.test.ts @@ -1,8 +1,6 @@ -import { MultiHost } from "../interfaces/Host" import { NetworkInterfaceBuilder } from "../interfaces/NetworkInterfaceBuilder" import { Effects } from "../types" import { createUtils } from "../util" -import { sdk } from "./output.sdk" describe("host", () => { test("Testing that the types work", () => { @@ -15,6 +13,8 @@ describe("host", () => { name: "Foo", id: "foo", description: "A Foo", + hasPrimary: false, + disabled: false, ui: true, username: "bar", path: "/baz", diff --git a/lib/types.ts b/lib/types.ts index 73f9a22..e9280c5 100644 --- a/lib/types.ts +++ b/lib/types.ts @@ -185,6 +185,10 @@ export type NetworkInterface = { name: string /** Human readable description, used as tooltip usually */ description: string + /** Whether or not one address must be the primary address */ + hasPrimary: boolean + /** Disabled interfaces do not serve, but they retain their metadata and addresses */ + disabled: boolean /** All URIs */ addresses: Address[] /** Defaults to false, but describes if this address can be opened in a browser as an diff --git a/lib/util/utils.ts b/lib/util/utils.ts index cabaa5c..dcf4586 100644 --- a/lib/util/utils.ts +++ b/lib/util/utils.ts @@ -57,6 +57,8 @@ export type Utils = { name: string id: string description: string + hasPrimary: boolean + disabled: boolean ui: boolean username: null | string path: string @@ -149,6 +151,8 @@ export const utils = < name: string id: string description: string + hasPrimary: boolean + disabled: boolean ui: boolean username: null | string path: string