2020-06-30 01:10:18 +02:00
|
|
|
export * from "./config";
|
|
|
|
export * from "./logger";
|
2022-02-22 15:39:39 +01:00
|
|
|
export * from "./shared";
|
2020-06-30 01:10:18 +02:00
|
|
|
|
2020-04-10 00:43:15 +02:00
|
|
|
// TODO: Token type.
|
|
|
|
export type Token = string;
|
|
|
|
export type FastdKey = string;
|
2021-07-26 21:40:17 +02:00
|
|
|
export type MAC = string;
|
|
|
|
|
2021-08-09 21:54:13 +02:00
|
|
|
export type UnixTimestampSeconds = number;
|
|
|
|
export type UnixTimestampMilliseconds = number;
|
2020-04-10 00:43:15 +02:00
|
|
|
|
|
|
|
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;
|
2021-07-26 21:40:17 +02:00
|
|
|
mac: MAC;
|
2020-04-10 00:43:15 +02:00
|
|
|
monitoring: boolean;
|
|
|
|
monitoringConfirmed: boolean;
|
|
|
|
monitoringState: MonitoringState;
|
2021-08-09 21:54:13 +02:00
|
|
|
modifiedAt: UnixTimestampSeconds;
|
2020-04-10 00:43:15 +02:00
|
|
|
};
|
|
|
|
|
2020-04-08 21:25:33 +02:00
|
|
|
// TODO: Complete interface / class declaration.
|
2020-04-10 00:43:15 +02:00
|
|
|
export type NodeSecrets = {
|
|
|
|
monitoringToken?: MonitoringToken,
|
|
|
|
};
|
|
|
|
|
|
|
|
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,
|
2020-04-08 21:25:33 +02:00
|
|
|
}
|
2020-04-10 00:43:15 +02:00
|
|
|
|