Server side type refactoring.
This commit is contained in:
parent
4c77f9f5ab
commit
b6b16f5250
6 changed files with 122 additions and 57 deletions
server/types
|
@ -1,49 +1,15 @@
|
|||
import {Domain, MonitoringToken, OnlineState, Site} from "./shared";
|
||||
|
||||
export * from "./config";
|
||||
export * from "./logger";
|
||||
export * from "./shared";
|
||||
|
||||
// TODO: Token type.
|
||||
export type Token = string;
|
||||
export type FastdKey = string;
|
||||
export type MAC = string;
|
||||
|
||||
export type UnixTimestampSeconds = number;
|
||||
export type UnixTimestampMilliseconds = number;
|
||||
|
||||
export type MonitoringToken = string;
|
||||
export enum MonitoringState {
|
||||
ACTIVE = "active",
|
||||
PENDING = "pending",
|
||||
DISABLED = "disabled",
|
||||
}
|
||||
|
||||
export type NodeId = string;
|
||||
|
||||
export enum NodeState {
|
||||
ONLINE = "ONLINE",
|
||||
OFFLINE = "OFFLINE",
|
||||
}
|
||||
|
||||
export type NodeStateData = {
|
||||
site: string,
|
||||
domain: string,
|
||||
state: NodeState,
|
||||
site: Site,
|
||||
domain: Domain,
|
||||
state: OnlineState,
|
||||
}
|
||||
|
||||
export type Node = {
|
||||
token: Token;
|
||||
nickname: string;
|
||||
email: string;
|
||||
hostname: string;
|
||||
coords?: string; // TODO: Use object with longitude and latitude.
|
||||
key?: FastdKey;
|
||||
mac: MAC;
|
||||
monitoring: boolean;
|
||||
monitoringConfirmed: boolean;
|
||||
monitoringState: MonitoringState;
|
||||
modifiedAt: UnixTimestampSeconds;
|
||||
};
|
||||
|
||||
// TODO: Complete interface / class declaration.
|
||||
export type NodeSecrets = {
|
||||
monitoringToken?: MonitoringToken,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue