Merge branch 'main' into new-admin
This commit is contained in:
commit
6fd4dbb33e
7 changed files with 72 additions and 37 deletions
|
@ -63,7 +63,17 @@ export function toNodeTokenResponse(node: StoredNode): NodeTokenResponse {
|
|||
|
||||
export function toDomainSpecificNodeResponse(node: StoredNode, nodeStateData: NodeStateData): DomainSpecificNodeResponse {
|
||||
return {
|
||||
...toNodeResponse(node),
|
||||
token: node.token,
|
||||
nickname: node.nickname,
|
||||
email: node.email,
|
||||
hostname: node.hostname,
|
||||
coords: node.coords,
|
||||
key: node.key,
|
||||
mac: node.mac,
|
||||
monitoring: node.monitoringState !== MonitoringState.DISABLED,
|
||||
monitoringConfirmed: node.monitoringState === MonitoringState.ACTIVE,
|
||||
monitoringState: node.monitoringState,
|
||||
modifiedAt: node.modifiedAt,
|
||||
site: nodeStateData.site,
|
||||
domain: nodeStateData.domain,
|
||||
onlineState: nodeStateData.state,
|
||||
|
|
|
@ -93,6 +93,14 @@ export function isBoolean(arg: unknown): arg is boolean {
|
|||
return typeof arg === "boolean"
|
||||
}
|
||||
|
||||
export function isUndefined(arg: unknown): arg is undefined {
|
||||
return arg === undefined;
|
||||
}
|
||||
|
||||
export function isNull(arg: unknown): arg is null {
|
||||
return arg === null;
|
||||
}
|
||||
|
||||
export function toIsArray<T>(isT: TypeGuard<T>): TypeGuard<T[]> {
|
||||
return (arg): arg is T[] => isArray(arg, isT);
|
||||
}
|
||||
|
@ -473,7 +481,7 @@ export const isDomain = isString;
|
|||
/**
|
||||
* Represents a node in the context of a Freifunk site and domain.
|
||||
*/
|
||||
export type DomainSpecificNodeResponse = NodeResponse & {
|
||||
export type DomainSpecificNodeResponse = Record<NodeSortField, any> & NodeResponse & {
|
||||
site?: Site,
|
||||
domain?: Domain,
|
||||
onlineState?: OnlineState,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue