Sqlite upgrade and type refactorings
This commit is contained in:
parent
01691a0c20
commit
28c8429edd
20 changed files with 873 additions and 663 deletions
server/types
|
@ -1,4 +1,4 @@
|
|||
import {Domain, MonitoringToken, OnlineState, Site} from "./shared";
|
||||
import {Domain, EmailAddress, JSONObject, MonitoringToken, OnlineState, Site, toIsEnum} from "./shared";
|
||||
|
||||
export * from "./config";
|
||||
export * from "./logger";
|
||||
|
@ -15,15 +15,24 @@ export type NodeSecrets = {
|
|||
monitoringToken?: MonitoringToken,
|
||||
};
|
||||
|
||||
export type MailId = string;
|
||||
export type MailData = any;
|
||||
export type MailType = string;
|
||||
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,
|
||||
sender: string,
|
||||
recipient: string,
|
||||
sender: EmailAddress,
|
||||
recipient: EmailAddress,
|
||||
data: MailData,
|
||||
failures: number,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue