Typescript migration: Major refactoring.
This commit is contained in:
parent
31ecc0cf4f
commit
52822207a5
31 changed files with 2068 additions and 2268 deletions
server/types
|
@ -1,4 +1,65 @@
|
|||
// TODO: Complete interface / class declaration.
|
||||
export interface NodeSecrets {
|
||||
monitoringToken: string; // TODO: Token type.
|
||||
// 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,
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue