mirror of
https://github.com/OneUptime/oneuptime
synced 2024-11-23 15:49:10 +00:00
99 lines
1.3 KiB
TypeScript
Executable File
99 lines
1.3 KiB
TypeScript
Executable File
import { Column, Entity, Index } from 'typeorm';
|
|
import BaseModel from './BaseModel';
|
|
import User from './User';
|
|
import Project from './Project';
|
|
@Entity({
|
|
name: "UserAlerts"
|
|
})
|
|
export default class Model extends BaseModel{
|
|
|
|
@Column()
|
|
monitor: Monitor;
|
|
|
|
@Column()
|
|
project: Project;
|
|
|
|
@Column()
|
|
statusPage!: {
|
|
|
|
@Column()
|
|
type!: Schema.Types.Object;
|
|
|
|
@Column()
|
|
ref!: 'StatusPage';
|
|
|
|
@Column()
|
|
index!: true;
|
|
};
|
|
|
|
@Column()
|
|
alertVia!: {
|
|
|
|
@Column()
|
|
type!: string;
|
|
|
|
@Column()
|
|
enum!: ['sms', 'email', 'webhook'];
|
|
|
|
@Column()
|
|
required!: true;
|
|
};
|
|
|
|
@Column()
|
|
contactEmail!: string;
|
|
|
|
@Column()
|
|
contactPhone!: string;
|
|
|
|
@Column()
|
|
countryCode!: string;
|
|
|
|
@Column()
|
|
contactWebhook!: string;
|
|
|
|
@Column()
|
|
webhookMethod!: {
|
|
|
|
@Column()
|
|
type!: string;
|
|
|
|
@Column()
|
|
enum!: ['get', 'post'];
|
|
|
|
@Column()
|
|
required!: true;
|
|
};
|
|
|
|
@Column()
|
|
notificationType!: {
|
|
|
|
@Column()
|
|
incident!: boolean;
|
|
|
|
@Column()
|
|
announcement!: boolean;
|
|
|
|
@Column()
|
|
scheduledEvent!: boolean;
|
|
};
|
|
|
|
@Column()
|
|
createdAt: { type: Date; default!: Date.now }
|
|
|
|
|
|
@Column()
|
|
subscribed!: boolean;
|
|
|
|
@Column()
|
|
deletedByUser!: User;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|