ffffng/server/types/index.ts

40 lines
1,000 B
TypeScript
Raw Normal View History

2022-07-18 17:49:42 +02:00
import {Domain, EmailAddress, JSONObject, MonitoringToken, OnlineState, Site, toIsEnum} from "./shared";
2022-05-26 13:58:01 +02:00
export * from "./config";
export * from "./logger";
2022-02-22 15:39:39 +01:00
export * from "./shared";
export type NodeStateData = {
2022-05-26 13:58:01 +02:00
site: Site,
domain: Domain,
state: OnlineState,
}
// TODO: Complete interface / class declaration.
export type NodeSecrets = {
monitoringToken?: MonitoringToken,
};
2022-07-18 17:49:42 +02:00
export type MailId = number & { readonly __tag: unique symbol };
export type MailData = JSONObject;
export enum MailType {
MONITORING_OFFLINE_1 = "monitoring-offline-1",
MONITORING_OFFLINE_2 = "monitoring-offline-2",
MONITORING_OFFLINE_3 = "monitoring-offline-3",
MONITORING_ONLINE_AGAIN = "monitoring-online-again",
MONITORING_CONFIRMATION = "monitoring-confirmation",
}
export const isMailType = toIsEnum(MailType);
export interface Mail {
id: MailId,
email: MailType,
2022-07-18 17:49:42 +02:00
sender: EmailAddress,
recipient: EmailAddress,
data: MailData,
failures: number,
}