ffffng/server/types/index.ts

66 lines
1.2 KiB
TypeScript

// TODO: Token type.
export type Token = string;
export type FastdKey = string;
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,
}
export type Node = {
token: Token;
nickname: string;
email: string;
hostname: string;
coords?: string; // TODO: Use object with longitude and latitude.
key?: FastdKey;
mac: string;
monitoring: boolean;
monitoringConfirmed: boolean;
monitoringState: MonitoringState;
};
// TODO: Complete interface / class declaration.
export type NodeSecrets = {
monitoringToken?: MonitoringToken,
};
export type NodeStatistics = {
registered: number,
withVPN: number,
withCoords: number,
monitoring: {
active: number,
pending: number
}
};
export type MailId = string;
export type MailData = any;
export type MailType = string;
export interface Mail {
id: MailId,
email: MailType,
sender: string,
recipient: string,
data: MailData,
failures: number,
}