mirror of
https://github.com/Start9Labs/start-sdk.git
synced 2026-03-30 20:24:47 +00:00
add hasPrimary and disabled to network interfaces
This commit is contained in:
@@ -21,6 +21,8 @@ export class NetworkInterfaceBuilder {
|
|||||||
name: string
|
name: string
|
||||||
id: string
|
id: string
|
||||||
description: string
|
description: string
|
||||||
|
hasPrimary: boolean
|
||||||
|
disabled: boolean
|
||||||
ui: boolean
|
ui: boolean
|
||||||
username: null | string
|
username: null | string
|
||||||
path: string
|
path: string
|
||||||
@@ -39,7 +41,17 @@ export class NetworkInterfaceBuilder {
|
|||||||
async export<Origins extends Origin<Host>[]>(
|
async export<Origins extends Origin<Host>[]>(
|
||||||
origins: Origins,
|
origins: Origins,
|
||||||
): Promise<Address[] & AddressReceipt> {
|
): Promise<Address[] & AddressReceipt> {
|
||||||
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) =>
|
const addresses = Array.from(origins).map((o) =>
|
||||||
o.build({ username, path, search, scheme: null }),
|
o.build({ username, path, search, scheme: null }),
|
||||||
@@ -49,6 +61,8 @@ export class NetworkInterfaceBuilder {
|
|||||||
interfaceId: id,
|
interfaceId: id,
|
||||||
name,
|
name,
|
||||||
description,
|
description,
|
||||||
|
hasPrimary,
|
||||||
|
disabled,
|
||||||
addresses,
|
addresses,
|
||||||
ui,
|
ui,
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
import { MultiHost } from "../interfaces/Host"
|
|
||||||
import { NetworkInterfaceBuilder } from "../interfaces/NetworkInterfaceBuilder"
|
import { NetworkInterfaceBuilder } from "../interfaces/NetworkInterfaceBuilder"
|
||||||
import { Effects } from "../types"
|
import { Effects } from "../types"
|
||||||
import { createUtils } from "../util"
|
import { createUtils } from "../util"
|
||||||
import { sdk } from "./output.sdk"
|
|
||||||
|
|
||||||
describe("host", () => {
|
describe("host", () => {
|
||||||
test("Testing that the types work", () => {
|
test("Testing that the types work", () => {
|
||||||
@@ -15,6 +13,8 @@ describe("host", () => {
|
|||||||
name: "Foo",
|
name: "Foo",
|
||||||
id: "foo",
|
id: "foo",
|
||||||
description: "A Foo",
|
description: "A Foo",
|
||||||
|
hasPrimary: false,
|
||||||
|
disabled: false,
|
||||||
ui: true,
|
ui: true,
|
||||||
username: "bar",
|
username: "bar",
|
||||||
path: "/baz",
|
path: "/baz",
|
||||||
|
|||||||
@@ -185,6 +185,10 @@ export type NetworkInterface = {
|
|||||||
name: string
|
name: string
|
||||||
/** Human readable description, used as tooltip usually */
|
/** Human readable description, used as tooltip usually */
|
||||||
description: string
|
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 */
|
/** All URIs */
|
||||||
addresses: Address[]
|
addresses: Address[]
|
||||||
/** Defaults to false, but describes if this address can be opened in a browser as an
|
/** Defaults to false, but describes if this address can be opened in a browser as an
|
||||||
|
|||||||
@@ -57,6 +57,8 @@ export type Utils<Store, Vault, WrapperOverWrite = { const: never }> = {
|
|||||||
name: string
|
name: string
|
||||||
id: string
|
id: string
|
||||||
description: string
|
description: string
|
||||||
|
hasPrimary: boolean
|
||||||
|
disabled: boolean
|
||||||
ui: boolean
|
ui: boolean
|
||||||
username: null | string
|
username: null | string
|
||||||
path: string
|
path: string
|
||||||
@@ -149,6 +151,8 @@ export const utils = <
|
|||||||
name: string
|
name: string
|
||||||
id: string
|
id: string
|
||||||
description: string
|
description: string
|
||||||
|
hasPrimary: boolean
|
||||||
|
disabled: boolean
|
||||||
ui: boolean
|
ui: boolean
|
||||||
username: null | string
|
username: null | string
|
||||||
path: string
|
path: string
|
||||||
|
|||||||
Reference in New Issue
Block a user