mirror of
https://github.com/Start9Labs/start-sdk.git
synced 2026-04-02 05:23:21 +00:00
feat: Change to a different interface
This commit is contained in:
@@ -38,37 +38,20 @@ const makeManyInterfaceFilled = async ({
|
||||
),
|
||||
),
|
||||
)
|
||||
const primaryHostIdsRecord = Object.fromEntries(
|
||||
await Promise.all(
|
||||
Array.from(
|
||||
new Set(
|
||||
interfaceValues.flatMap((x) => x.addresses).map((x) => x.hostId),
|
||||
),
|
||||
).map(
|
||||
async (hostId) =>
|
||||
[
|
||||
hostId,
|
||||
await effects.getPrimaryHostname({
|
||||
packageId,
|
||||
hostId,
|
||||
callback,
|
||||
}),
|
||||
] as const,
|
||||
),
|
||||
),
|
||||
)
|
||||
const fillAddress = filledAddress.bind(
|
||||
null,
|
||||
hostIdsRecord,
|
||||
primaryHostIdsRecord,
|
||||
)
|
||||
const fillAddress = filledAddress.bind(null, hostIdsRecord)
|
||||
|
||||
const interfacesFilled: NetworkInterfaceFilled[] = interfaceValues.map(
|
||||
(interfaceValue) =>
|
||||
const interfacesFilled: NetworkInterfaceFilled[] = await Promise.all(
|
||||
interfaceValues.map(async (interfaceValue) =>
|
||||
networkInterfaceFilled(
|
||||
interfaceValue,
|
||||
await effects.getPrimaryUrl({
|
||||
interfaceId: interfaceValue.interfaceId,
|
||||
packageId,
|
||||
callback,
|
||||
}),
|
||||
interfaceValue.addresses.map(fillAddress),
|
||||
),
|
||||
),
|
||||
)
|
||||
return interfacesFilled
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user