diff --git a/Common/Models/AlertCharge.ts b/Common/Models/AlertCharge.ts index 20b9152626..42b26f171c 100644 --- a/Common/Models/AlertCharge.ts +++ b/Common/Models/AlertCharge.ts @@ -11,26 +11,26 @@ import Project from './Project'; }) export default class Model extends BaseModel { @Column() - project!: Project; + public project!: Project; @Column() - chargeAmount!: number; + public chargeAmount!: number; @Column() - closingAccountBalance!: number; + public closingAccountBalance!: number; @Column() - userAlert!: UserAlert; + public userAlert!: UserAlert; @Column() - subscriberAlert!: SubscriberAlert; + public subscriberAlert!: SubscriberAlert; @Column() - monitor!: Monitor; + public monitor!: Monitor; @Column() - incident!: Incident; + public incident!: Incident; @Column() - sentTo!: string; + public sentTo!: string; } diff --git a/Common/Models/Announcement.ts b/Common/Models/Announcement.ts index 0c07cef9bb..c14fba9a32 100644 --- a/Common/Models/Announcement.ts +++ b/Common/Models/Announcement.ts @@ -9,29 +9,29 @@ import StatusPage from './StatusPage'; }) export default class Announcement extends BaseModel { @Column() - statusPage!: StatusPage; + public statusPage!: StatusPage; @Column() - project!: Project; + public project!: Project; @Column() - slug!: string; + public slug!: string; @Column() - hideAnnouncement!: boolean; + public hideAnnouncement!: boolean; @Column() - deletedByUser!: User; + public deletedByUser!: User; @Column() - createdByUser!: User; + public createdByUser!: User; @Column() - name!: string; + public name!: string; @Column() - description!: string; + public description!: string; @Column() - resolved!: boolean; + public resolved!: boolean; } diff --git a/Common/Models/AnnouncementLog.ts b/Common/Models/AnnouncementLog.ts index 5ea8da1c58..70ed982192 100644 --- a/Common/Models/AnnouncementLog.ts +++ b/Common/Models/AnnouncementLog.ts @@ -10,27 +10,27 @@ import Project from './Project'; }) export default class AnnouncementLog extends BaseModel { @Column() - announcement!: Announcement; + public announcement!: Announcement; @Index() @Column() - project!: Project; + public project!: Project; @Column() - statusPage!: StatusPage; + public statusPage!: StatusPage; @Column() - startDate!: Date; + public startDate!: Date; @Column() - endDate!: Date; + public endDate!: Date; @Column() - deletedByUser!: User; + public deletedByUser!: User; @Column() - createdByUser!: User; + public createdByUser!: User; @Column() - active!: boolean; + public active!: boolean; } diff --git a/Common/Models/ApplicationLog.ts b/Common/Models/ApplicationLog.ts index 066732dc55..02ceecaf43 100644 --- a/Common/Models/ApplicationLog.ts +++ b/Common/Models/ApplicationLog.ts @@ -1,40 +1,28 @@ -import { Column, Entity, Index } from 'typeorm'; +import { Column, Entity } from 'typeorm'; import BaseModel from './BaseModel'; import User from './User'; -import Project from './Project'; import ApplicationLogContainer from './ApplicationLogContainer'; import ApplicationLogType from '../Types/ApplicationLog/ApplicationLogType'; import Tags from '../Types/Tags'; @Entity({ - name: "UserAlerts" + name: 'UserAlerts', }) export default class Model extends BaseModel { + @Column() + public applicationLogContainer!: ApplicationLogContainer; - @Column() - applicationLogContainer!: ApplicationLogContainer + @Column() + public content!: string; - @Column() - content!: string; + @Column() + public type!: ApplicationLogType; + @Column() + public tags!: Tags; - @Column() - type!: ApplicationLogType + @Column() + public createdByUser!: User; - @Column() - tags!: Tags - - @Column() - createdByUser!: User; - - @Column() - deletedByUser!: User; + @Column() + public deletedByUser!: User; } - - - - - - - - - diff --git a/Common/Models/ApplicationLogContainer.ts b/Common/Models/ApplicationLogContainer.ts index 2b95827fad..db2191da79 100644 --- a/Common/Models/ApplicationLogContainer.ts +++ b/Common/Models/ApplicationLogContainer.ts @@ -11,30 +11,30 @@ import Component from './Component'; export default class ApplicationLogContainer extends BaseModel { @Index() @Column() - project!: Project; + public project!: Project; @Index() @Column() - component!: Component; + public component!: Component; @Column() - name!: string; + public name!: string; @Column() - slug!: string; + public slug!: string; @Column() - key!: string; + public key!: string; @Column() - resourceLabel!: ResourceLabel; + public resourceLabel!: ResourceLabel; @Column() - showQuickStart!: boolean; + public showQuickStart!: boolean; @Column() - createdByUser!: User; + public createdByUser!: User; @Column() - deletedByUser!: User; + public deletedByUser!: User; } diff --git a/Common/Models/ApplicationSecurity.ts b/Common/Models/ApplicationSecurity.ts index 59f600d55e..6399f9b687 100644 --- a/Common/Models/ApplicationSecurity.ts +++ b/Common/Models/ApplicationSecurity.ts @@ -8,29 +8,29 @@ import GitCredential from './GitCredential'; }) export default class Model extends BaseModel { @Column() - name!: string; + public name!: string; @Column() - slug!: string; + public slug!: string; @Column() - gitRepositoryurl!: string; + public gitRepositoryurl!: string; @Column() - gitCredential!: GitCredential; + public gitCredential!: GitCredential; @Column() - component!: Component; + public component!: Component; @Column() - resourceLabel!: ResourceLabel; + public resourceLabel!: ResourceLabel; @Column() - lastScan!: Date; + public lastScan!: Date; @Column() - scanned!: boolean; + public scanned!: boolean; @Column() - scanning!: boolean; + public scanning!: boolean; } diff --git a/Common/Models/ApplicationSecurityRunInstance.ts b/Common/Models/ApplicationSecurityRunInstance.ts index 444ca1b53c..c28283a650 100644 --- a/Common/Models/ApplicationSecurityRunInstance.ts +++ b/Common/Models/ApplicationSecurityRunInstance.ts @@ -8,8 +8,8 @@ import ApplicationSecurity from './ApplicationSecurity'; }) export default class ApplicationSecurityRunInstance extends BaseModel { @Column() - security!: ApplicationSecurity; + public security!: ApplicationSecurity; @Column() - component!: Component; + public component!: Component; } diff --git a/Common/Models/ApplicationSecurityRunInstanceLog.ts b/Common/Models/ApplicationSecurityRunInstanceLog.ts index d3ba7a553a..ac318b1adf 100644 --- a/Common/Models/ApplicationSecurityRunInstanceLog.ts +++ b/Common/Models/ApplicationSecurityRunInstanceLog.ts @@ -8,11 +8,11 @@ import SecuritySeverity from '../Types/SecuritySeverity'; }) export default class ApplicationSecurityRunInstanceLog extends BaseModel { @Column() - applicationSeurityRunInstance!: ApplicationSecurityRunInstance; + public applicationSeurityRunInstance!: ApplicationSecurityRunInstance; @Column() - severity!: SecuritySeverity; + public severity!: SecuritySeverity; @Column() - log!: string; + public log!: string; } diff --git a/Common/Models/AutomatedScript.ts b/Common/Models/AutomatedScript.ts index 1bced2763a..540e932c2c 100644 --- a/Common/Models/AutomatedScript.ts +++ b/Common/Models/AutomatedScript.ts @@ -1,42 +1,32 @@ -import { Column, Entity, Index } from 'typeorm'; +import { Column, Entity } from 'typeorm'; import BaseModel from './BaseModel'; import User from './User'; import Project from './Project'; export enum ScriptType { - JavaScript = "JavaScript", - Bash = "Bash" + JavaScript = 'JavaScript', + Bash = 'Bash', } @Entity({ - name: "AutomatedScripts" + name: 'AutomatedScripts', }) export default class AutomatedScript extends BaseModel { + @Column() + public name!: string; - @Column() - name!: string; + @Column() + public script!: string; - @Column() - script!: string; + @Column() + public scriptType!: ScriptType; - @Column() - scriptType!: ScriptType; + @Column() + public slug!: string; - @Column() - slug!: string; - - @Column() - project!: Project - - @Column() - deletedByUser!: User + @Column() + public project!: Project; + @Column() + public deletedByUser!: User; } - - - - - - - - diff --git a/Common/Models/AutomatedScriptOnEvent.ts b/Common/Models/AutomatedScriptOnEvent.ts index 983f6c9563..3e88d1d694 100644 --- a/Common/Models/AutomatedScriptOnEvent.ts +++ b/Common/Models/AutomatedScriptOnEvent.ts @@ -8,9 +8,9 @@ import AutomatedScript from './AutomatedScript'; }) export default class AutomatedScriptOnEvent extends BaseModel { @Column() - automatedScript!: AutomatedScript; + public automatedScript!: AutomatedScript; @Column() - executeAutomatedScript!: AutomatedScript; + public executeAutomatedScript!: AutomatedScript; @Column() - eventType!: OperationResult; + public eventType!: OperationResult; } diff --git a/Common/Models/AutomatedScriptRunInstance.ts b/Common/Models/AutomatedScriptRunInstance.ts index c08048e2f3..9b142840a3 100644 --- a/Common/Models/AutomatedScriptRunInstance.ts +++ b/Common/Models/AutomatedScriptRunInstance.ts @@ -11,29 +11,29 @@ import OperationStatus from '../Types/OperationStatus'; }) export default class AutomationScriptRunInstance extends BaseModel { @Column() - automationScript!: AutomatedScript; + public automationScript!: AutomatedScript; @Column() - project!: Project; + public project!: Project; @Column() - triggerByUser!: User; + public triggerByUser!: User; @Column() - triggerByScript!: AutomatedScript; + public triggerByScript!: AutomatedScript; @Column() - triggerByIncident!: Incident; + public triggerByIncident!: Incident; @Column() - scriptStatus!: OperationStatus; + public scriptStatus!: OperationStatus; @Column() - deletedByUser!: User; + public deletedByUser!: User; @Column() - executionTime!: Number; + public executionTime!: Number; @Column() - errorDescription!: string; + public errorDescription!: string; } diff --git a/Common/Models/AutomatedScriptsLog.ts b/Common/Models/AutomatedScriptsLog.ts index c50120c1fb..31fff708bd 100644 --- a/Common/Models/AutomatedScriptsLog.ts +++ b/Common/Models/AutomatedScriptsLog.ts @@ -7,8 +7,8 @@ import AutomatedScriptRunInstance from './AutomatedScriptRunInstance'; }) export default class ApplicationSecurityRunInstanceLog extends BaseModel { @Column() - automatedScriptRunInstance!: AutomatedScriptRunInstance; + public automatedScriptRunInstance!: AutomatedScriptRunInstance; @Column() - log!: string; + public log!: string; } diff --git a/Common/Models/BaseModel.ts b/Common/Models/BaseModel.ts index 17eb0a8419..5d7aa66ae3 100644 --- a/Common/Models/BaseModel.ts +++ b/Common/Models/BaseModel.ts @@ -9,17 +9,17 @@ import { export default class BaseModel extends BaseEntity { @PrimaryGeneratedColumn('uuid') - id!: string; + public id!: string; @CreateDateColumn() - createdAt!: Date; + public createdAt!: Date; @UpdateDateColumn() - updatedAt!: Date; + public updatedAt!: Date; @DeleteDateColumn() deletedAt?: Date; @VersionColumn() - version!: number; + public version!: number; } diff --git a/Common/Models/Component.ts b/Common/Models/Component.ts index bd80b3a1a9..c213e2c3e7 100755 --- a/Common/Models/Component.ts +++ b/Common/Models/Component.ts @@ -8,17 +8,17 @@ import Project from './Project'; }) export default class ComponentModel extends BaseModel { @Column() - project!: Project; + public project!: Project; @Column() - name!: string; + public name!: string; @Column() - slug!: string; + public slug!: string; @Column() - createdByUser!: User; + public createdByUser!: User; @Column() - deletedByUser!: User; + public deletedByUser!: User; } diff --git a/Common/Models/ContainerSecurity.ts b/Common/Models/ContainerSecurity.ts index 4a1bcb0aa6..c6e8a10a22 100644 --- a/Common/Models/ContainerSecurity.ts +++ b/Common/Models/ContainerSecurity.ts @@ -1,53 +1,43 @@ -import { Column, Entity, Index } from 'typeorm'; +import { Column, Entity } from 'typeorm'; import BaseModel from './BaseModel'; import DockerCredential from './DockerCredential'; import Component from './Component'; import ResourceLabel from './ResourceLabel'; - @Entity({ - name: "UserAlerts" + name: 'UserAlerts', }) export default class Model extends BaseModel { + @Column() + public name!: string; - @Column() - name!: string; + @Column() + public slug!: string; - @Column() - slug!: string; + @Column() + public dockerCredential!: DockerCredential; - @Column() - dockerCredential!: DockerCredential + @Column() + public imagePath!: string; - @Column() - imagePath!: string; + @Column() + public imageTags!: string; - @Column() - imageTags!: string; + @Column() + public component!: Component; - @Column() - component!: Component + @Column() + public resourceLabel!: ResourceLabel; - @Column() - resourceLabel!: ResourceLabel + @Column() + public deleteAt!: Date; - @Column() - deleteAt!: Date; + @Column() + public lastScan!: Date; - @Column() - lastScan!: Date; + @Column() + public scanned!: boolean; - @Column() - scanned!: boolean; - - @Column() - scanning!: boolean; + @Column() + public scanning!: boolean; } - - - - - - - - diff --git a/Common/Models/ContainerSecurityLog.ts b/Common/Models/ContainerSecurityLog.ts index f434b64dd3..081d8b3fb7 100644 --- a/Common/Models/ContainerSecurityLog.ts +++ b/Common/Models/ContainerSecurityLog.ts @@ -8,14 +8,14 @@ import Component from './Component'; }) export default class ContainerSecurityLog extends BaseModel { @Column() - security!: ContainerSecurity; + public security!: ContainerSecurity; @Column() - component!: Component; + public component!: Component; @Column() - data!: Object; + public data!: Object; @Column() - deleteAt!: Date; + public deleteAt!: Date; } diff --git a/Common/Models/CustomField.ts b/Common/Models/CustomField.ts index ccdff0fd53..89f5bc0155 100644 --- a/Common/Models/CustomField.ts +++ b/Common/Models/CustomField.ts @@ -12,14 +12,14 @@ export enum CustomFieldType { }) export default class CustomField extends BaseModel { @Column() - fieldName!: string; + public fieldName!: string; @Column() - fieldType!: CustomFieldType; + public fieldType!: CustomFieldType; @Column() - project!: Project; + public project!: Project; @Column() - uniqueField!: boolean; + public uniqueField!: boolean; } diff --git a/Common/Models/DockerCredential.ts b/Common/Models/DockerCredential.ts index fb71cada7f..6786848c91 100644 --- a/Common/Models/DockerCredential.ts +++ b/Common/Models/DockerCredential.ts @@ -8,24 +8,24 @@ import Project from './Project'; }) export default class DockerCredential extends BaseModel { @Column() - dockerRegistryUrl!: URL; + public dockerRegistryUrl!: URL; @Column() - dockerUsername!: string; + public dockerUsername!: string; @Column() - dockerPassword!: string; + public dockerPassword!: string; @Column() - iv!: Buffer; + public iv!: Buffer; @Index() @Column() - project!: Project; + public project!: Project; @Column() - createdByUser!: User; + public createdByUser!: User; @Column() - deletedByUser!: User; + public deletedByUser!: User; } diff --git a/Common/Models/DomainVerificationToken.ts b/Common/Models/DomainVerificationToken.ts index c6a3c84a6a..b9e0116425 100644 --- a/Common/Models/DomainVerificationToken.ts +++ b/Common/Models/DomainVerificationToken.ts @@ -8,17 +8,17 @@ import Project from './Project'; export default class Model extends BaseModel { @Index() @Column() - domain!: string; // The main or base domain eg oneuptime.com + public domain!: string; // The main or base domain eg oneuptime.com @Column() - verificationToken!: string; + public verificationToken!: string; @Column() - verified!: boolean; + public verified!: boolean; @Column() - verifiedAt!: Date; + public verifiedAt!: Date; @Column() - project!: Project; + public project!: Project; } diff --git a/Common/Models/EmailLog.ts b/Common/Models/EmailLog.ts index 080faeccd8..87e550c70a 100644 --- a/Common/Models/EmailLog.ts +++ b/Common/Models/EmailLog.ts @@ -8,35 +8,35 @@ import Project from './Project'; }) export default class EmailLog extends BaseModel { @Column() - fromEmail!: string; + public fromEmail!: string; @Column() - fromName!: string; + public fromName!: string; @Column() - project!: Project; + public project!: Project; @Column() - toEmail!: string; + public toEmail!: string; @Column() - subject!: string; + public subject!: string; @Column() - body!: string; + public body!: string; @Column() - templateType!: string; + public templateType!: string; @Column() - status!: string; + public status!: string; @Column() - errorDescription!: string; + public errorDescription!: string; @Column() - smtpHost!: string; + public smtpHost!: string; @Column() - deletedByUser!: User; + public deletedByUser!: User; } diff --git a/Common/Models/EmailTemplate.ts b/Common/Models/EmailTemplate.ts index 082f134c92..46c6c57c21 100755 --- a/Common/Models/EmailTemplate.ts +++ b/Common/Models/EmailTemplate.ts @@ -9,20 +9,20 @@ import EmailTemplateType from '../Types/Email/EmailTemplateType'; }) export default class EmailTemplate extends BaseModel { @Column() - project!: Project; + public project!: Project; @Column() - subject!: string; + public subject!: string; @Column() - body!: string; + public body!: string; @Column() - emailType!: EmailTemplateType; + public emailType!: EmailTemplateType; @Column() - allowedVariables!: Array; + public allowedVariables!: Array; @Column() - deletedByUser!: User; + public deletedByUser!: User; } diff --git a/Common/Models/ErrorEvent.ts b/Common/Models/ErrorEvent.ts index 01720b38a6..70e120c429 100644 --- a/Common/Models/ErrorEvent.ts +++ b/Common/Models/ErrorEvent.ts @@ -1,42 +1,31 @@ -import { Column, Entity, Index } from 'typeorm'; +import { Column, Entity } from 'typeorm'; import BaseModel from './BaseModel'; import ErrorTrackerContainer from './ErrorTrackerContainer'; import Issue from './Issue'; @Entity({ - name: "UserAlerts" + name: 'UserAlerts', }) export default class Model extends BaseModel { + @Column() + public errorTracker!: ErrorTrackerContainer; + @Column() + public issue!: Issue; - @Column() - errorTracker!: ErrorTrackerContainer - @Column() - issue!: Issue + @Column() + public content!: Object; - @Column() - content!: Object; + @Column() + public timeline!: Object; - @Column() - timeline!: Object + @Column() + public tags!: Object; - @Column() - tags!: Object + @Column() + public sdk!: Object; - @Column() - sdk!: Object; + @Column() + public fingerprintHash!: string; - @Column() - fingerprintHash!: string; - - @Column() - device!: Object; + @Column() + public device!: Object; } - - - - - - - - - - diff --git a/Common/Models/ErrorTrackerContainer.ts b/Common/Models/ErrorTrackerContainer.ts index e7d240ebcb..812dc6b2ef 100644 --- a/Common/Models/ErrorTrackerContainer.ts +++ b/Common/Models/ErrorTrackerContainer.ts @@ -9,26 +9,26 @@ import ResourceLabel from './ResourceLabel'; }) export default class ErrorTrackerContainer extends BaseModel { @Column() - component!: Component; + public component!: Component; @Column() - name!: string; + public name!: string; @Column() - slug!: string; + public slug!: string; @Column() - key!: string; + public key!: string; @Column() - showQuickStart!: boolean; + public showQuickStart!: boolean; @Column() - resourceLabel!: ResourceLabel; + public resourceLabel!: ResourceLabel; @Column() - createdByUser!: User; + public createdByUser!: User; @Column() - deletedByUser!: User; + public deletedByUser!: User; } diff --git a/Common/Models/Escalation.ts b/Common/Models/Escalation.ts index b2194159f2..2d2803203a 100755 --- a/Common/Models/Escalation.ts +++ b/Common/Models/Escalation.ts @@ -1,69 +1,58 @@ -import { Column, Entity, Index } from 'typeorm'; +import { Column, Entity } from 'typeorm'; import BaseModel from './BaseModel'; import User from './User'; import Project from './Project'; -import TeamMemberSchema from './EscalationTeamMember'; import OnCallDutySchedule from './OnCallDutySchedule'; @Entity({ - name: "UserAlerts" + name: 'UserAlerts', }) -export default class Model extends BaseModel{ - - @Column() - project!: Project - - @Column() - callReminders:number; - - @Column() - emailReminders:number; - - @Column() - smsReminders:number; - - @Column() - pushReminders:number; - - @Column() - rotateBy: string; - - @Column() - rotationInterval:number; - - @Column() - firstRotationOn!: Date; - - @Column() - rotationTimezone!: string; - - @Column() - call!: boolean; - - @Column() - email!: boolean; - - @Column() - sms!: boolean; - - @Column() - push!: boolean; - - @Column() - createdByUser!: User; - - @Column() - schedule!: OnCallDutySchedule; - - @Column() - deletedByUser!: User; +export default class Model extends BaseModel { + @Column() + public project!: Project; + + @Column() + public callReminders!: number; + + @Column() + public emailReminders!: number; + + @Column() + public smsReminders!: number; + + @Column() + public pushReminders!: number; + + @Column() + public rotateBy!: string; + + @Column() + public rotationInterval!: number; + + @Column() + public firstRotationOn!: Date; + + @Column() + public rotationTimezone!: string; + + @Column() + public call!: boolean; + + @Column() + public email!: boolean; + + @Column() + public sms!: boolean; + + @Column() + public push!: boolean; + + @Column() + public createdByUser!: User; + + @Column() + public schedule!: OnCallDutySchedule; + + @Column() + public deletedByUser!: User; } - - - - - - - - - diff --git a/Common/Models/EscalationTeamMember.ts b/Common/Models/EscalationTeamMember.ts index f4eb4f644b..a89cb53757 100644 --- a/Common/Models/EscalationTeamMember.ts +++ b/Common/Models/EscalationTeamMember.ts @@ -1,26 +1,24 @@ -import { Column, Entity, Index } from 'typeorm'; +import { Column, Entity } from 'typeorm'; import BaseModel from './BaseModel'; import Team from './Team'; import User from './User'; @Entity({ - name: "UserAlerts" + name: 'UserAlerts', }) export default class Model extends BaseModel { + @Column() + public startTime!: Date; @Column() - startTime!: Date; + public endTime!: Date; @Column() - endTime!: Date; + public timezone!: string; @Column() - timezone!: string; + public user!: User; @Column() - user!: User; - - @Column() - team!: Team - + public team!: Team; } diff --git a/Common/Models/ExternalStatusPage.ts b/Common/Models/ExternalStatusPage.ts index 34b07bdb9c..17a59e2d90 100644 --- a/Common/Models/ExternalStatusPage.ts +++ b/Common/Models/ExternalStatusPage.ts @@ -9,22 +9,22 @@ import StatusPage from './StatusPage'; }) export default class ExternalStatusPage extends BaseModel { @Column() - name!: string; + public name!: string; @Column() - url!: URL; + public url!: URL; @Column() - description!: string; + public description!: string; @Column() - statusPage!: StatusPage; + public statusPage!: StatusPage; @Column() - project!: Project; + public project!: Project; @Column() - deletedByUser!: User; + public deletedByUser!: User; @Column() - createdByUser!: User; + public createdByUser!: User; } diff --git a/Common/Models/Feedback.ts b/Common/Models/Feedback.ts index d33aa47bfc..68cf88aeb5 100755 --- a/Common/Models/Feedback.ts +++ b/Common/Models/Feedback.ts @@ -8,17 +8,17 @@ import Project from './Project'; }) export default class Feedback extends BaseModel { @Column() - project!: Project; + public project!: Project; @Column() - createdByUser!: User; + public createdByUser!: User; @Column() - message!: string; + public message!: string; @Column() - pageUrl!: string; + public pageUrl!: string; @Column() - deletedByUser!: User; + public deletedByUser!: User; } diff --git a/Common/Models/GitCredential.ts b/Common/Models/GitCredential.ts index af5aac5281..0a4a4899e1 100644 --- a/Common/Models/GitCredential.ts +++ b/Common/Models/GitCredential.ts @@ -8,27 +8,27 @@ import Project from './Project'; }) export default class GitCredential extends BaseModel { @Column() - gitUsername!: string; + public gitUsername!: string; @Column() - gitPassword!: string; + public gitPassword!: string; @Column() - sshTitle!: string; + public sshTitle!: string; @Column() - sshPrivateKey!: string; + public sshPrivateKey!: string; @Column() - iv!: Buffer; + public iv!: Buffer; @Index() @Column() - project!: Project; + public project!: Project; @Column() - createdByUser!: User; + public createdByUser!: User; @Column() - deletedByUser!: User; + public deletedByUser!: User; } diff --git a/Common/Models/GlobalConfig.ts b/Common/Models/GlobalConfig.ts index d430a91e99..faa9b867c5 100755 --- a/Common/Models/GlobalConfig.ts +++ b/Common/Models/GlobalConfig.ts @@ -6,11 +6,11 @@ import BaseModel from './BaseModel'; }) export default class GlobalConfig extends BaseModel { @Column() - name!: string; + public name!: string; @Column() - value!: Object; + public value!: Object; @Column() - iv!: Buffer; + public iv!: Buffer; } diff --git a/Common/Models/Incident.ts b/Common/Models/Incident.ts index 78c998efd5..3eaefb0d38 100755 --- a/Common/Models/Incident.ts +++ b/Common/Models/Incident.ts @@ -1,4 +1,4 @@ -import { Column, Entity, Index } from 'typeorm'; +import { Column, Entity } from 'typeorm'; import BaseModel from './BaseModel'; import User from './User'; import Project from './Project'; @@ -8,128 +8,114 @@ import ResourceStatus from './ResourceStatus'; import IncidentPriority from './IncidentPriority'; export enum IncidentState { - Identified = "Identified", - Acknowledged = "Acknowledged", - Resolved = "Resolved" + Identified = 'Identified', + Acknowledged = 'Acknowledged', + Resolved = 'Resolved', } @Entity({ - name: "Incident" + name: 'Incident', }) export default class Incident extends BaseModel { + @Column() + public idNumber!: number; - @Column() - idNumber!: number + @Column() + public project!: Project; - @Column() - project!: Project; + @Column() + public title!: string; - @Column() - title!: string + @Column() + public description!: string; - @Column() - description!: string + @Column() + public reason!: string; - @Column() - reason!: string + @Column() + public response!: Object; - @Column() - response!: Object; + @Column() + public notifications!: Notification; - @Column() - notifications!: Notification + @Column() + public incidentPriority!: IncidentPriority; - @Column() - incidentPriority!: IncidentPriority + @Column() + public acknowledged!: boolean; - @Column() - acknowledged!: boolean; + @Column() + public acknowledgedBy!: User; - @Column() - acknowledgedBy!: User; + @Column() + public acknowledgedAt!: Date; - @Column() - acknowledgedAt!: Date + @Column() + public acknowledgedByZapier!: boolean; - @Column() - acknowledgedByZapier!: boolean; + @Column() + public resolved!: boolean; - @Column() - resolved!: boolean; + @Column() + public resourceStatus!: ResourceStatus; - @Column() - resourceStatus!: ResourceStatus + @Column() + public resolvedBy!: User; - @Column() - resolvedBy!: User; + @Column() + public resolvedAt!: Date; - @Column() - resolvedAt!: Date; + @Column() + public resolvedByZapier!: boolean; - @Column() - resolvedByZapier!: boolean; + @Column() + public internalNote!: string; + @Column() + public investigationNote!: string; - @Column() - internalNote!: string; + @Column() + public createdByUser!: User; - @Column() - investigationNote!: string; + @Column() + public createdByApi!: boolean; - @Column() - createdByUser!: User; + @Column() + public createdByZapier!: boolean; - @Column() - createdByApi!: boolean; + @Column() + public acknowledgedByApi!: boolean; + @Column() + public resolvedByApi!: boolean; - @Column() - createdByZapier!: boolean; + @Column() + public manuallyCreated!: boolean; - @Column() - acknowledgedByApi!: boolean; + @Column() + public criterionCause!: Object; - @Column() - resolvedByApi!: boolean; + @Column() + public deletedByUser!: User; - @Column() - manuallyCreated!: boolean; + @Column() + public breachedCommunicationSla!: boolean; - @Column() - criterionCause!: Object; + @Column() + public customFields!: IncidentCustomFields; + @Column() + public acknowledgedByIncomingHttpRequest!: IncomingRequest; - @Column() - deletedByUser!: User; + @Column() + public resolvedByIncomingHttpRequest!: IncomingRequest; - @Column() - breachedCommunicationSla!: boolean; + @Column() + public createdByIncomingHttpRequest!: IncomingRequest; - @Column() - customFields!: IncidentCustomFields + @Column() + public hideIncident!: boolean; - @Column() - acknowledgedByIncomingHttpRequest!: IncomingRequest; - - @Column() - resolvedByIncomingHttpRequest!: IncomingRequest; - - @Column() - createdByIncomingHttpRequest!: IncomingRequest; - - @Column() - hideIncident!: boolean; - - - @Column() - slug!: string; + @Column() + public slug!: string; } - - - - - - - - - diff --git a/Common/Models/IncidentCommunicationSla.ts b/Common/Models/IncidentCommunicationSla.ts index 5f389af747..878199d826 100644 --- a/Common/Models/IncidentCommunicationSla.ts +++ b/Common/Models/IncidentCommunicationSla.ts @@ -1,34 +1,22 @@ -import { Column, Entity, Index } from 'typeorm'; +import { Column, Entity } from 'typeorm'; import BaseModel from './BaseModel'; -import User from './User'; import Project from './Project'; @Entity({ - name: "UserAlerts" + name: 'UserAlerts', }) export default class Model extends BaseModel { + @Column() + public name!: string; - @Column() - name!: string; + @Column() + public project!: Project; - @Column() - project!: Project; + @Column() + public isDefault!: boolean; - @Column() - isDefault!: boolean; - - @Column() - duration!: number; - - @Column() - alertTime!: string; + @Column() + public duration!: number; + @Column() + public alertTime!: string; } - - - - - - - - - diff --git a/Common/Models/IncidentNote.ts b/Common/Models/IncidentNote.ts index 1ef4266a92..9eba827bad 100644 --- a/Common/Models/IncidentNote.ts +++ b/Common/Models/IncidentNote.ts @@ -13,23 +13,23 @@ export enum IncidentMessageType { }) export default class IncidentNote extends BaseModel { @Column() - incident!: Incident; + public incident!: Incident; @Column() - content!: string; + public content!: string; @Column() - type!: IncidentMessageType; + public type!: IncidentMessageType; @Column() - incidentState!: IncidentState; + public incidentState!: IncidentState; @Column() - createdByUser!: User; + public createdByUser!: User; @Column() - deletedByUser!: User; + public deletedByUser!: User; @Column() - postOnStatusPage!: boolean; + public postOnStatusPage!: boolean; } diff --git a/Common/Models/IncidentNoteTemplate.ts b/Common/Models/IncidentNoteTemplate.ts index 75b5bc8620..e50ad5fca0 100644 --- a/Common/Models/IncidentNoteTemplate.ts +++ b/Common/Models/IncidentNoteTemplate.ts @@ -7,11 +7,11 @@ import { IncidentState } from './Incident'; }) export default class IncidentNoteTemplate extends BaseModel { @Column() - project!: Project; + public project!: Project; @Column() - incidentState!: IncidentState; + public incidentState!: IncidentState; @Column() - incidentNote!: string; + public incidentNote!: string; } diff --git a/Common/Models/IncidentPriority.ts b/Common/Models/IncidentPriority.ts index 7ee3e8633a..b6e3e35dcc 100644 --- a/Common/Models/IncidentPriority.ts +++ b/Common/Models/IncidentPriority.ts @@ -8,14 +8,14 @@ import Project from './Project'; }) export default class IncidentPriority extends BaseModel { @Column() - project!: Project; + public project!: Project; @Column() - name!: string; + public name!: string; @Column() - color!: string; + public color!: string; @Column() - deletedByUser!: User; + public deletedByUser!: User; } diff --git a/Common/Models/IncidentResource.ts b/Common/Models/IncidentResource.ts index f96a29d131..2cefb3d8e8 100644 --- a/Common/Models/IncidentResource.ts +++ b/Common/Models/IncidentResource.ts @@ -1,7 +1,5 @@ import { Column, Entity } from 'typeorm'; import BaseModel from './BaseModel'; -import StatusPage from './StatusPage'; -import StatusPageCategory from './StatusPageCategory'; import Monitor from './Monitor'; import Incident from './Incident'; @@ -10,8 +8,8 @@ import Incident from './Incident'; }) export default class IncidentResource extends BaseModel { @Column() - incident!: Incident; + public incident!: Incident; @Column() - monitor!: Monitor; + public monitor!: Monitor; } diff --git a/Common/Models/IncidentSMSAction.ts b/Common/Models/IncidentSMSAction.ts index c45252a129..553bdfca43 100755 --- a/Common/Models/IncidentSMSAction.ts +++ b/Common/Models/IncidentSMSAction.ts @@ -1,41 +1,29 @@ -import { Column, Entity, Index } from 'typeorm'; +import { Column, Entity } from 'typeorm'; import BaseModel from './BaseModel'; import User from './User'; -import Project from './Project'; import Incident from './Incident'; @Entity({ - name: "UserAlerts" + name: 'UserAlerts', }) export default class Model extends BaseModel { + @Column() + incident: Incident; - @Column() - incident: Incident + @Column() + public user!: User; // Which User will perfom this action. - @Column() - user!: User; // Which User will perfom this action. + @Column() + public number!: string; - @Column() - number!: string; + @Column() + public name!: string; - @Column() - name!: string; + @Column() + public resolved!: boolean; + @Column() + public acknowledged!: boolean; - @Column() - resolved!: boolean; - - @Column() - acknowledged!: boolean; - - - @Column() - deletedByUser!: User; + @Column() + public deletedByUser!: User; } - - - - - - - - diff --git a/Common/Models/IncidentSetting.ts b/Common/Models/IncidentSetting.ts index b9fdb7e24d..0f8b346836 100644 --- a/Common/Models/IncidentSetting.ts +++ b/Common/Models/IncidentSetting.ts @@ -9,23 +9,23 @@ import IncidentPriority from './IncidentPriority'; }) export default class IncidentSetting extends BaseModel { @Column() - project!: Project; + public project!: Project; @Column() - title!: string; + public title!: string; @Column() - description!: string; + public description!: string; @Column() - incidentPriority!: IncidentPriority; + public incidentPriority!: IncidentPriority; @Column() - isDefault!: boolean; + public isDefault!: boolean; @Column() - name!: string; + public name!: string; @Column() - deletedByUser!: User; + public deletedByUser!: User; } diff --git a/Common/Models/IncidentTimeline.ts b/Common/Models/IncidentTimeline.ts index 0931da8ac0..64cf7f86a5 100644 --- a/Common/Models/IncidentTimeline.ts +++ b/Common/Models/IncidentTimeline.ts @@ -1,45 +1,34 @@ -import { Column, Entity, Index } from 'typeorm'; +import { Column, Entity } from 'typeorm'; import BaseModel from './BaseModel'; import Incident from './Incident'; import Probe from './Probe'; import User from './User'; - @Entity({ - name: "UserAlerts" + name: 'UserAlerts', }) export default class Model extends BaseModel { + @Column() + public incident!: Incident; - @Column() - incident!: Incident; + @Column() + public createdByUser!: User; // user - @Column() - createdByUser!: User; // user + @Column() + public probe!: Probe; - @Column() - probe!: Probe; + @Column() + public createdByZapier!: boolean; // Is true when zapier creates incident - @Column() - createdByZapier!: boolean; // Is true when zapier creates incident + @Column() + public createdByApi!: boolean; - @Column() - createdByApi!: boolean; + @Column() + public status!: string; - @Column() - status!: string; + @Column() + incident_public state!: string; - @Column() - incident_state!: string; - - @Column() - deletedByUser!: User; + @Column() + public deletedByUser!: User; } - - - - - - - - - diff --git a/Common/Models/IncomingCallRouting.ts b/Common/Models/IncomingCallRouting.ts index 5fb2a6f79d..8a9da6cbb7 100644 --- a/Common/Models/IncomingCallRouting.ts +++ b/Common/Models/IncomingCallRouting.ts @@ -1,61 +1,50 @@ -import { Column, Entity, Index } from 'typeorm'; +import { Column, Entity } from 'typeorm'; import BaseModel from './BaseModel'; import User from './User'; import Project from './Project'; @Entity({ - name: "UserAlerts" + name: 'UserAlerts', }) export default class Model extends BaseModel { + @Column() + public project!: Project; - @Column() - project!: Project; + @Column() + public deletedByUser!: User; - @Column() - deletedByUser!: User; + @Column() + public phoneNumber!: string; - @Column() - phoneNumber!: string; + @Column() + public locality!: string; - @Column() - locality!: string; + @Column() + public region!: string; - @Column() - region!: string; + @Column() + public mmsCapabilities!: boolean; - @Column() - mmsCapabilities!: boolean; + @Column() + public smsCapabilities!: boolean; - @Column() - smsCapabilities!: boolean; + @Column() + public voiceCapabilities!: boolean; - @Column() - voiceCapabilities!: boolean; + @Column() + public sid!: string; + @Column() + public price!: string; + @Column() + public priceUnit!: string; - @Column() - sid!: string; + @Column() + public countryCode!: string; - @Column() - price!: string; + @Column() + public numberType!: string; - @Column() - priceUnit!: string; - - @Column() - countryCode!: string; - - @Column() - numberType!: string; - - @Column() - stripeSubscriptionId!: string; + @Column() + public stripeSubscriptionId!: string; } - - - - - - - - diff --git a/Common/Models/IncomingCallRoutingLog.ts b/Common/Models/IncomingCallRoutingLog.ts index 16e4b77f70..6aa0e3f140 100644 --- a/Common/Models/IncomingCallRoutingLog.ts +++ b/Common/Models/IncomingCallRoutingLog.ts @@ -1,4 +1,4 @@ -import { Column, Entity, Index } from 'typeorm'; +import { Column, Entity } from 'typeorm'; import BaseModel from './BaseModel'; import User from './User'; import Project from './Project'; @@ -6,52 +6,42 @@ import IncomingCallRouting from './IncomingCallRouting'; import OnCallDutySchedule from './OnCallDutySchedule'; import OperationStatus from '../Types/Operation/OperationStatus'; @Entity({ - name: "UserAlerts" + name: 'UserAlerts', }) export default class Model extends BaseModel { + @Column() + public project!: Project; - @Column() - project!: Project; + @Column() + public callRouting!: IncomingCallRouting; - @Column() - callRouting!: IncomingCallRouting; + @Column() + public deletedByUser!: User; - @Column() - deletedByUser!: User; + @Column() + public callSid!: string; - @Column() - callSid!: string; + @Column() + public price!: string; - @Column() - price!: string; + @Column() + public calledFrom!: string; - @Column() - calledFrom!: string; + @Column() + public calledTo!: string; - @Column() - calledTo!: string; + @Column() + public duration!: string; - @Column() - duration!: string; + @Column() + public user!: User; // User that call was forwarded to - @Column() - user!: User; // User that call was forwarded to + @Column() + public schedule!: OnCallDutySchedule; - @Column() - schedule!: OnCallDutySchedule - - @Column() - phoneNumber!: string; // Phone number that call was forwarded to - - @Column() - status!: OperationStatus + @Column() + public phoneNumber!: string; // Phone number that call was forwarded to + @Column() + public status!: OperationStatus; } - - - - - - - - diff --git a/Common/Models/IncomingCallRoutingSchema.ts b/Common/Models/IncomingCallRoutingSchema.ts index f731b599aa..d74cd3df84 100644 --- a/Common/Models/IncomingCallRoutingSchema.ts +++ b/Common/Models/IncomingCallRoutingSchema.ts @@ -1,26 +1,22 @@ -import { Column, Entity, Index } from 'typeorm'; +import { Column, Entity } from 'typeorm'; import BaseModel from './BaseModel'; -import User from './User'; -import Project from './Project'; import IncomingCallRouting from './IncomingCallRouting'; import OnCallDutySchedule from './OnCallDutySchedule'; @Entity({ - name: "UserAlerts" + name: 'UserAlerts', }) export default class Model extends BaseModel { + @Column() + public incomingCallRouting!: IncomingCallRouting; + @Column() + public onCallDutySchedule!: OnCallDutySchedule; @Column() - incomingCallRouting!: IncomingCallRouting; - @Column() - onCallDutySchedule!: OnCallDutySchedule; + public introText!: string; @Column() - introText!: string; + public introAudio!: string; @Column() - introAudio!: string; - - @Column() - introAudioName!: string; - + public introAudioName!: string; } diff --git a/Common/Models/IncomingRequest.ts b/Common/Models/IncomingRequest.ts index 0b2408b745..b5d4aed9fb 100644 --- a/Common/Models/IncomingRequest.ts +++ b/Common/Models/IncomingRequest.ts @@ -1,115 +1,73 @@ -import { Column, Entity, Index } from 'typeorm'; +import { Column, Entity } from 'typeorm'; import BaseModel from './BaseModel'; -import User from './User'; import Project from './Project'; import IncidentPriority from './IncidentPriority'; import IncomingRequestCustomFields from '../Types/IncomingRequest/IncomingRequestCustomFields'; +import Filter from '../Types/Filter/Filter'; @Entity({ - name: "UserAlerts" + name: 'UserAlerts', }) -export default class Model extends BaseModel{ - - @Column() - name!: string; - - @Column() - project!: Project; - - @Column() - isDefault!: boolean; - - @Column() - selectAllMonitors!: boolean; - - @Column() - createIncident!: boolean; - - @Column() - acknowledgeIncident!: boolean; - - @Column() - resolveIncident!: boolean; - - @Column() - updateIncidentNote!: boolean; - - @Column() - updateInternalNote!: boolean; - - @Column() - noteContent!: string; - - @Column() - incidentState!: string; - - @Column() - url!: URL; - - @Column() - enabled!: boolean; - - - @Column() - incidentTitle!: string; - - @Column() - incidentType!: string; - - @Column() - incidentPriority!:IncidentPriority - - @Column() - incidentDescription!: string; - - @Column() - customFields!: IncomingRequestCustomFields - - @Column() - filterMatch!: string; - - @Column() - filters!: [ - { - - @Column() - filterCriteria!: string; - - @Column() - filterCondition!: { - - @Column() - type!: string; - - @Column() - enum!: [ - 'equalTo'; - 'notEqualTo'; - 'lessThan'; - 'greaterThan'; - 'greaterThanOrEqualTo'; - 'lessThanOrEqualTo'; - ]; - }; - - @Column() - filterText!: Schema.Types.Mixed; - }; - ]; - - @Column() - createSeparateIncident!: boolean; - - @Column() - postOnsStatusPage!: boolean; - }; - +export default class Model extends BaseModel { + @Column() + public name!: string; + @Column() + public project!: Project; + + @Column() + public isDefault!: boolean; + + @Column() + public selectAllMonitors!: boolean; + + @Column() + public createIncident!: boolean; + + @Column() + public acknowledgeIncident!: boolean; + + @Column() + public resolveIncident!: boolean; + + @Column() + public updateIncidentNote!: boolean; + + @Column() + public updateInternalNote!: boolean; + + @Column() + public noteContent!: string; + + @Column() + public incidentState!: string; + + @Column() + public url!: URL; + + @Column() + public enabled!: boolean; + + @Column() + public incidentTitle!: string; + + @Column() + public incidentType!: string; + + @Column() + public incidentPriority!: IncidentPriority; + + @Column() + public incidentDescription!: string; + + @Column() + public customFields!: IncomingRequestCustomFields; + + @Column() + public createSeparateIncident!: boolean; + + @Column() + public postOnsStatusPage!: boolean; + + @Column() + public filter!: Filter; } - - - - - - - - diff --git a/Common/Models/IncomingRequestFilter.ts b/Common/Models/IncomingRequestFilter.ts new file mode 100644 index 0000000000..e69de29bb2 diff --git a/Common/Models/IncomingRequestResource.ts b/Common/Models/IncomingRequestResource.ts index c4b1824394..4249844656 100644 --- a/Common/Models/IncomingRequestResource.ts +++ b/Common/Models/IncomingRequestResource.ts @@ -1,7 +1,5 @@ import { Column, Entity } from 'typeorm'; import BaseModel from './BaseModel'; -import StatusPage from './StatusPage'; -import StatusPageCategory from './StatusPageCategory'; import Monitor from './Monitor'; import IncomingRequest from './IncomingRequest'; @@ -10,8 +8,8 @@ import IncomingRequest from './IncomingRequest'; }) export default class StatusPageChartType extends BaseModel { @Column() - incomingRequest!: IncomingRequest; + public incomingRequest!: IncomingRequest; @Column() - monitor!: Monitor; + public monitor!: Monitor; } diff --git a/Common/Models/Integration.ts b/Common/Models/Integration.ts index a1e108124c..be94ef7605 100755 --- a/Common/Models/Integration.ts +++ b/Common/Models/Integration.ts @@ -1,55 +1,45 @@ -import { Column, Entity, Index } from 'typeorm'; +import { Column, Entity } from 'typeorm'; import BaseModel from './BaseModel'; import User from './User'; import Project from './Project'; export enum IntegrationType { - Slack = "Slack", - Webhook = "Webhook", - MicrosoftTeams = "MicrosoftTeams" + Slack = 'Slack', + Webhook = 'Webhook', + MicrosoftTeams = 'MicrosoftTeams', } @Entity({ - name: "UserAlerts" + name: 'UserAlerts', }) export default class Model extends BaseModel { + @Column() + public webHookName!: string; - @Column() - webHookName!: string; + @Column() + public project!: Project; - @Column() - project!: Project; + @Column() + public createdByUser!: User; - @Column() - createdByUser!: User; + @Column() + public integrationType!: IntegrationType; - @Column() - integrationType!: IntegrationType + @Column() + public data!: Object; - @Column() - data!: Object + @Column() + public incidentCreatedNotification!: boolean; + @Column() + public incidentAcknowledgedNotification!: boolean; - @Column() - incidentCreatedNotification!: boolean; + @Column() + public incidentResolvedNotification!: boolean; - @Column() - incidentAcknowledgedNotification!: boolean; + @Column() + public incidentNoteAddedNotification!: boolean; - @Column() - incidentResolvedNotification!: boolean; - - @Column() - incidentNoteAddedNotification!: boolean; - - @Column() - deletedByUser!: User; + @Column() + public deletedByUser!: User; } - - - - - - - - diff --git a/Common/Models/IntegrationResource.ts b/Common/Models/IntegrationResource.ts index d43595bcee..c829747c25 100644 --- a/Common/Models/IntegrationResource.ts +++ b/Common/Models/IntegrationResource.ts @@ -8,8 +8,8 @@ import Integration from './Integration'; }) export default class StatusPageChartType extends BaseModel { @Column() - integration!: Integration; + public integration!: Integration; @Column() - monitor!: Monitor; + public monitor!: Monitor; } diff --git a/Common/Models/Issue.ts b/Common/Models/Issue.ts index d74f3c81a7..c5ed0a7819 100644 --- a/Common/Models/Issue.ts +++ b/Common/Models/Issue.ts @@ -1,61 +1,51 @@ -import { Column, Entity, Index } from 'typeorm'; +import { Column, Entity } from 'typeorm'; import BaseModel from './BaseModel'; import User from './User'; import ErrorTrackerContainer from './ErrorTrackerContainer'; export enum IssueType { - Exception = "Exception", - Message = "Message", - Error = "Error" + Exception = 'Exception', + Message = 'Message', + Error = 'Error', } @Entity({ - name: "UserAlerts" + name: 'UserAlerts', }) export default class Model extends BaseModel { + @Column() + public name!: string; - @Column() - name!: string; + @Column() + public description!: string; - @Column() - description!: string; + @Column() + public errorTracker!: ErrorTrackerContainer; - @Column() - errorTracker!: ErrorTrackerContainer + @Column() + public type!: IssueType; - @Column() - type!: IssueType + @Column() + public fingerprintHash!: string; - @Column() - fingerprintHash!: string; + @Column() + public deletedByUser!: User; - @Column() - deletedByUser!: User; + @Column() + public resolved!: boolean; - @Column() - resolved!: boolean; + @Column() + public resolvedAt!: Date; - @Column() - resolvedAt!: Date + @Column() + public resolvedBy!: User; - @Column() - resolvedBy!: User; + @Column() + public ignored!: boolean; - @Column() - ignored!: boolean; + @Column() + public ignoredAt!: Date; - @Column() - ignoredAt!: Date - - @Column() - ignoredBy!: User; + @Column() + public ignoredBy!: User; } - - - - - - - - - diff --git a/Common/Models/IssueMember.ts b/Common/Models/IssueMember.ts index 327c6322d9..f0c3b23c33 100644 --- a/Common/Models/IssueMember.ts +++ b/Common/Models/IssueMember.ts @@ -1,32 +1,27 @@ -import { Column, Entity, Index } from 'typeorm'; +import { Column, Entity } from 'typeorm'; import BaseModel from './BaseModel'; import User from './User'; -import Project from './Project'; import Issue from './Issue'; - @Entity({ - name: "UserAlerts" + name: 'UserAlerts', }) export default class Model extends BaseModel { + @Column() + public issue!: Issue; - @Column() - issue!: Issue + @Column() + public user!: User; - @Column() - user!: User + @Column() + public createdByUser!: User; - @Column() - createdByUser!: User; + @Column() + public removed!: boolean; - @Column() - removed!: boolean; + @Column() + public removedAt!: Date; - @Column() - removedAt!: Date - - @Column() - removedBy!: User; + @Column() + public removedBy!: User; } - - diff --git a/Common/Models/IssueTimeline.ts b/Common/Models/IssueTimeline.ts index 5e9f9204cd..7b0916a2d3 100644 --- a/Common/Models/IssueTimeline.ts +++ b/Common/Models/IssueTimeline.ts @@ -15,14 +15,14 @@ export enum IssueStatus { }) export default class IssueTimeline extends BaseModel { @Column() - issue!: Issue; + public issue!: Issue; @Column() - createdByUser!: User; + public createdByUser!: User; @Column() - status!: IssueStatus; + public status!: IssueStatus; @Column() - deletedByUser!: User; + public deletedByUser!: User; } diff --git a/Common/Models/Lead.ts b/Common/Models/Lead.ts index b57b8f62ed..46c0a404d9 100755 --- a/Common/Models/Lead.ts +++ b/Common/Models/Lead.ts @@ -6,29 +6,29 @@ import BaseModel from './BaseModel'; }) export default class Lead extends BaseModel { @Column() - name!: string; + public name!: string; @Column() - email!: string; + public email!: string; @Column() - website!: string; + public website!: string; @Column() - phone!: string; + public phone!: string; @Column() - nameOfInterestedResource!: string; + public nameOfInterestedResource!: string; @Column() - country!: string; + public country!: string; @Column() - companySize!: string; + public companySize!: string; @Column() - message!: string; + public message!: string; @Column() - source!: string; + public source!: string; } diff --git a/Common/Models/LetsEncryptCertificateStore.ts b/Common/Models/LetsEncryptCertificateStore.ts index c995b8d842..5a418901be 100644 --- a/Common/Models/LetsEncryptCertificateStore.ts +++ b/Common/Models/LetsEncryptCertificateStore.ts @@ -1,35 +1,25 @@ -import { Column, Entity, Index } from 'typeorm'; +import { Column, Entity } from 'typeorm'; import BaseModel from './BaseModel'; @Entity({ - name: "UserAlerts" + name: 'UserAlerts', }) export default class Model extends BaseModel { + @Column() + public certificateId!: string; - @Column() - certificateId!: string; + @Column() + public privateKeyPem!: string; - @Column() - privateKeyPem!: string; + @Column() + public privateKeyJwk!: string; - @Column() - privateKeyJwk!: string; + @Column() + public publicKeyPem!: string; - @Column() - publicKeyPem!: string; + @Column() + public publicKeyJwk!: string; - @Column() - publicKeyJwk!: string; - - @Column() - key!: string; + @Column() + public key!: string; } - - - - - - - - - diff --git a/Common/Models/LetsEncryptManager.ts b/Common/Models/LetsEncryptManager.ts index c7a9f96f25..30b4f53fcc 100644 --- a/Common/Models/LetsEncryptManager.ts +++ b/Common/Models/LetsEncryptManager.ts @@ -1,44 +1,31 @@ -import { Column, Entity, Index } from 'typeorm'; +import { Column, Entity } from 'typeorm'; import BaseModel from './BaseModel'; -import User from './User'; -import Project from './Project'; - @Entity({ - name: "UserAlerts" + name: 'UserAlerts', }) export default class Model extends BaseModel { + @Column() + public store!: Object; - @Column() - store!: Object + @Column() + public challenges!: Object; - @Column() - challenges!: Object + @Column() + public renewOffset!: string; - @Column() - renewOffset!: string; + @Column() + public renewStagger!: string; - @Column() - renewStagger!: string; + @Column() + public accountKeyType!: string; - @Column() - accountKeyType!: string; + @Column() + public serverKeyType!: string; - @Column() - serverKeyType!: string; + @Column() + public subscriberEmail!: string; - @Column() - subscriberEmail!: string; - - @Column() - agreeToTerms!: boolean; + @Column() + public agreeToTerms!: boolean; } - - - - - - - - - diff --git a/Common/Models/LighthouseLog.ts b/Common/Models/LighthouseLog.ts index d0403dae8a..ac5c550c58 100644 --- a/Common/Models/LighthouseLog.ts +++ b/Common/Models/LighthouseLog.ts @@ -6,29 +6,29 @@ import BaseModel from './BaseModel'; }) export default class LighthouseLog extends BaseModel { @Column() - monitor!: Monitor; + public monitor!: Monitor; @Column() - data!: Object; + public data!: Object; @Column() - url!: URL; + public url!: URL; @Column() - performance!: Number; + public performance!: Number; @Column() - accessibility!: Number; + public accessibility!: Number; @Column() - bestPractices!: Number; + public bestPractices!: Number; @Column() - seo!: Number; + public seo!: Number; @Column() - pwa!: Number; + public pwa!: Number; @Column() - scanning!: Boolean; + public scanning!: Boolean; } diff --git a/Common/Models/LoginHistory.ts b/Common/Models/LoginHistory.ts index 90661a4f4b..d9fda88d82 100755 --- a/Common/Models/LoginHistory.ts +++ b/Common/Models/LoginHistory.ts @@ -6,26 +6,26 @@ import User from './User'; }) export default class LoginHistory extends BaseModel { @Column() - user!: User; + public user!: User; @Column() - ipLocationCity!: string; + public ipLocationCity!: string; @Column() - ipLocationNeighbourhood!: string; + public ipLocationNeighbourhood!: string; @Column() - ipLocationCountry!: string; + public ipLocationCountry!: string; @Column() - browserName!: string; + public browserName!: string; @Column() - browserVersion!: string; + public browserVersion!: string; @Column() - deviceName!: string; + public deviceName!: string; @Column() - loginStatus!: string; + public loginStatus!: string; } diff --git a/Common/Models/Monitor.ts b/Common/Models/Monitor.ts index a84e75ab35..9f31469f3e 100755 --- a/Common/Models/Monitor.ts +++ b/Common/Models/Monitor.ts @@ -1,4 +1,4 @@ -import { Column, Entity, Index } from 'typeorm'; +import { Column, Entity } from 'typeorm'; import BaseModel from './BaseModel'; import User from './User'; import Project from './Project'; @@ -12,110 +12,100 @@ import HTTPMethod from '../Types/API/HTTPMethod'; import MonitorCriteria from '../Types/Monitor/MonitorCriteria'; import Component from './Component'; - @Entity({ - name: "UserAlerts" + name: 'UserAlerts', }) export default class Model extends BaseModel { + @Column() + public project!: Project; //Which project this monitor belongs to. - @Column() - project!: Project; //Which project this monitor belongs to. + @Column() + public component!: Component; - @Column() - component!: Component + @Column() + public name!: string; - @Column() - name!: string; + @Column() + public slug!: string; - @Column() - slug!: string; + @Column() + public config!: Object; - @Column() - config!: Object + @Column() + public createdByUser!: User; //user. - @Column() - createdByUser!: User; //user. + @Column() + public type!: MonitorType; - @Column() - type!: MonitorType + @Column() + public agentlessConfig!: string; - @Column() - agentlessConfig!: string; + @Column() + public kubernetesConfig!: string; - @Column() - kubernetesConfig!: string; + @Column() + public kubernetesNamespace!: string; - @Column() - kubernetesNamespace!: string + @Column() + public lastPingTime!: Date; - @Column() - lastPingTime!: Date + @Column() + public updateTime!: Date; - @Column() - updateTime!: Date + @Column() + public criteria!: MonitorCriteria; - @Column() - criteria!: MonitorCriteria + @Column() + public lastMatchedCriterion!: MonitorCriteriaInstance; - @Column() - lastMatchedCriterion!: MonitorCriteriaInstance + @Column() + public method!: HTTPMethod; + @Column() + public bodyType!: string; - @Column() - method!: HTTPMethod; + @Column() + public formData!: FormData; - @Column() - bodyType!: string; + @Column() + public text!: string; - @Column() - formData!: FormData; + @Column() + public headers!: Headers; - @Column() - text!: string; + @Column() + public disabled!: boolean; - @Column() - headers!: Headers; + @Column() + public deletedByUser!: User; - @Column() - disabled!: boolean + @Column() + public scriptRunStatus!: string; - @Column() - deletedByUser!: User; + @Column() + public scriptRunBy!: Probe; - @Column() - scriptRunStatus!: string; + @Column() + public lighthouseScannedAt!: Date; - @Column() - scriptRunBy!: Probe + @Column() + public lighthouseScanStatus!: string; - @Column() - lighthouseScannedAt!: Date; + @Column() + public siteUrls!: Array; - @Column() - lighthouseScanStatus!: string; + @Column() + public incidentCommunicationSla!: IncidentCommunicationSla; - @Column() - siteUrls!: Array; + @Column() + public monitorSla!: MonitorSla; - @Column() - incidentCommunicationSla!: IncidentCommunicationSla + @Column() + public customFields!: MonitorCustomFields; - @Column() - monitorSla!: MonitorSla + @Column() + public disableMonitoring!: boolean; - @Column() - customFields!: MonitorCustomFields - - @Column() - disableMonitoring!: boolean; - - @Column() - monitorStatus!: ResourceStatus; + @Column() + public monitorStatus!: ResourceStatus; } - - - - - - - diff --git a/Common/Models/MonitorCustomField.ts b/Common/Models/MonitorCustomField.ts index 0d36dc0af3..33a8f3b486 100644 --- a/Common/Models/MonitorCustomField.ts +++ b/Common/Models/MonitorCustomField.ts @@ -8,14 +8,14 @@ import { CustomFieldType } from './CustomField'; }) export default class MonitorCustomField extends BaseModel { @Column() - fieldName!: string; + public fieldName!: string; @Column() - fieldType!: CustomFieldType; + public fieldType!: CustomFieldType; @Column() - project!: Project; + public project!: Project; @Column() - uniqueField!: boolean; + public uniqueField!: boolean; } diff --git a/Common/Models/MonitorLog.ts b/Common/Models/MonitorLog.ts index 3fab8ccd0d..bd581684f3 100755 --- a/Common/Models/MonitorLog.ts +++ b/Common/Models/MonitorLog.ts @@ -8,61 +8,61 @@ import Incident from './Incident'; }) export default class Model extends BaseModel { @Column() - monitor!: Monitor; + public monitor!: Monitor; @Column() - probe!: Probe; + public probe!: Probe; @Column() - status!: string; + public status!: string; @Column() - responseTime!: Number; + public responseTime!: Number; @Column() - responseStatus!: Number; + public responseStatus!: Number; @Column() - responseBody!: string; + public responseBody!: string; @Column() - responseHeader!: Object; + public responseHeader!: Object; @Column() - cpuLoad!: Number; + public cpuLoad!: Number; @Column() - avgCpuLoad!: Number; + public avgCpuLoad!: Number; @Column() - cpuCores!: Number; + public cpuCores!: Number; @Column() - memoryUsed!: Number; + public memoryUsed!: Number; @Column() - totalMemory!: Number; + public totalMemory!: Number; @Column() - swapUsed!: Number; + public swapUsed!: Number; @Column() - storageUsed!: Number; + public storageUsed!: Number; @Column() - totalStorage!: Number; + public totalStorage!: Number; @Column() - storageUsage!: Number; + public storageUsage!: Number; @Column() - mainTemp!: Number; + public mainTemp!: Number; @Column() - maxTemp!: Number; + public maxTemp!: Number; @Column() - incident!: Incident; + public incident!: Incident; @Column() - sslCertificate!: Object; + public sslCertificate!: Object; @Column() - kubernetesLog!: Object; + public kubernetesLog!: Object; } diff --git a/Common/Models/MonitorSla.ts b/Common/Models/MonitorSla.ts index 48ea0c9911..29fe55b292 100644 --- a/Common/Models/MonitorSla.ts +++ b/Common/Models/MonitorSla.ts @@ -6,17 +6,17 @@ import Project from './Project'; }) export default class Model extends BaseModel { @Column() - name!: string; + public name!: string; @Column() - project!: Project; + public project!: Project; @Column() - isDefault!: boolean; + public isDefault!: boolean; @Column() - frequency!: string; // Measured in days + public frequency!: string; // Measured in days @Column() - monitorUptime!: string; + public monitorUptime!: string; } diff --git a/Common/Models/MonitorStatus.ts b/Common/Models/MonitorStatus.ts index 765ffee64e..7900997390 100755 --- a/Common/Models/MonitorStatus.ts +++ b/Common/Models/MonitorStatus.ts @@ -10,29 +10,29 @@ import Monitor from './Monitor'; }) export default class Model extends BaseModel { @Column() - monitor!: Monitor; + public monitor!: Monitor; @Column() - probe!: Probe; + public probe!: Probe; @Column() - incident!: Incident; + public incident!: Incident; @Column() - status!: ResourceStatus; + public status!: ResourceStatus; @Column() - manuallyCreated!: boolean; + public manuallyCreated!: boolean; @Column() - startTime!: Date; + public startTime!: Date; @Column() - endTime!: Date; + public endTime!: Date; @Column() - lastStatus!: string; + public lastStatus!: string; @Column() - deletedByUser!: User; + public deletedByUser!: User; } diff --git a/Common/Models/Notification.ts b/Common/Models/Notification.ts index 7faa89d910..08aff18156 100755 --- a/Common/Models/Notification.ts +++ b/Common/Models/Notification.ts @@ -6,11 +6,11 @@ import Project from './Project'; }) export default class Model extends BaseModel { @Column() - project!: Project; + public project!: Project; @Column() - message!: string; + public message!: string; @Column() - icon!: string; + public icon!: string; } diff --git a/Common/Models/NotificationUserStatus.ts b/Common/Models/NotificationUserStatus.ts index 18c17a083d..8e2c0d4a8b 100644 --- a/Common/Models/NotificationUserStatus.ts +++ b/Common/Models/NotificationUserStatus.ts @@ -7,11 +7,11 @@ import User from './User'; }) export default class NotificationUserStatus extends BaseModel { @Column() - notification!: Notification; + public notification!: Notification; @Column() - user!: User; + public user!: User; @Column() - read!: boolean; + public read!: boolean; } diff --git a/Common/Models/OnCallDutyEscalation.ts b/Common/Models/OnCallDutyEscalation.ts index dcada0987e..bf85238c8d 100644 --- a/Common/Models/OnCallDutyEscalation.ts +++ b/Common/Models/OnCallDutyEscalation.ts @@ -9,50 +9,50 @@ import OnCallDutySchedule from './OnCallDutySchedule'; }) export default class Model extends BaseModel { @Column() - project!: Project; + public project!: Project; @Column() - callReminders!: number; + public callReminders!: number; @Column() - emailReminders!: number; + public emailReminders!: number; @Column() - smsReminders!: number; + public smsReminders!: number; @Column() - pushReminders!: number; + public pushReminders!: number; @Column() - rotateBy!: string; + public rotateBy!: string; @Column() - rotationInterval!: number; + public rotationInterval!: number; @Column() - firstRotationOn!: Date; + public firstRotationOn!: Date; @Column() - rotationTimezone!: string; + public rotationTimezone!: string; @Column() - call!: boolean; + public call!: boolean; @Column() - email!: boolean; + public email!: boolean; @Column() - sms!: boolean; + public sms!: boolean; @Column() - push!: boolean; + public push!: boolean; @Column() - createdByUser!: User; + public createdByUser!: User; @Column() - onCallDutySchedule!: OnCallDutySchedule; + public onCallDutySchedule!: OnCallDutySchedule; @Column() - deletedByUser!: User; + public deletedByUser!: User; } diff --git a/Common/Models/OnCallDutyEscalationTeam.ts b/Common/Models/OnCallDutyEscalationTeam.ts index fbbd18de83..67f4fa1599 100644 --- a/Common/Models/OnCallDutyEscalationTeam.ts +++ b/Common/Models/OnCallDutyEscalationTeam.ts @@ -12,8 +12,8 @@ import Team from './Team'; }) export default class ResourceStatus extends BaseModel { @Column() - onCallDutyEscalation!: OnCallDutyEscalation; + public onCallDutyEscalation!: OnCallDutyEscalation; @Column() - team!: Team; + public team!: Team; } diff --git a/Common/Models/OnCallDutySchedule.ts b/Common/Models/OnCallDutySchedule.ts index a699da3da3..4a9a73874e 100755 --- a/Common/Models/OnCallDutySchedule.ts +++ b/Common/Models/OnCallDutySchedule.ts @@ -8,17 +8,17 @@ import Project from './Project'; }) export default class Model extends BaseModel { @Column() - name!: string; + public name!: string; @Column() - slug!: string; + public slug!: string; @Column() - project!: Project; + public project!: Project; @Column() - createdByUser!: User; + public createdByUser!: User; @Column() - deletedByUser!: User; + public deletedByUser!: User; } diff --git a/Common/Models/OnCallDutyScheduleEscalationStatus.ts b/Common/Models/OnCallDutyScheduleEscalationStatus.ts index 09be42a4a3..6845e6c28e 100644 --- a/Common/Models/OnCallDutyScheduleEscalationStatus.ts +++ b/Common/Models/OnCallDutyScheduleEscalationStatus.ts @@ -1,32 +1,26 @@ -import { Column, Entity, Index } from 'typeorm'; +import { Column, Entity } from 'typeorm'; import BaseModel from './BaseModel'; -import User from './User'; -import Project from './Project'; -import Incident from './Incident'; -import OnCallDutySchedule from './OnCallDutySchedule'; import Escalation from './Escalation'; import OnCallDutyScheduleStatus from './OnCallDutyScheduleStatus'; - @Entity({ - name: "UserAlerts" + name: 'UserAlerts', }) export default class Model extends BaseModel { + @Column() + public escalation!: Escalation; @Column() - escalation!: Escalation; + public callRemindersSent!: number; @Column() - callRemindersSent!: number; + public smsRemindersSent!: number; @Column() - smsRemindersSent!: number; + public emailRemindersSent!: number; @Column() - emailRemindersSent!: number; + public pushRemindersSent!: number; - @Column() - pushRemindersSent!: number; - - onCallDutyScheduleStatus!: OnCallDutyScheduleStatus + public onCallDutyScheduleStatus!: OnCallDutyScheduleStatus; } diff --git a/Common/Models/OnCallDutyScheduleResource.ts b/Common/Models/OnCallDutyScheduleResource.ts index 6491024f55..1fd2a6a3ff 100644 --- a/Common/Models/OnCallDutyScheduleResource.ts +++ b/Common/Models/OnCallDutyScheduleResource.ts @@ -8,8 +8,8 @@ import OnCallDutySchedule from './OnCallDutySchedule'; }) export default class OnCallDutyScheduleResource extends BaseModel { @Column() - onCallDutySchedule!: OnCallDutySchedule; + public onCallDutySchedule!: OnCallDutySchedule; @Column() - monitor!: Monitor; + public monitor!: Monitor; } diff --git a/Common/Models/OnCallDutyScheduleStatus.ts b/Common/Models/OnCallDutyScheduleStatus.ts index cbc22a060d..1f9f2868f5 100644 --- a/Common/Models/OnCallDutyScheduleStatus.ts +++ b/Common/Models/OnCallDutyScheduleStatus.ts @@ -1,45 +1,32 @@ -import { Column, Entity, Index } from 'typeorm'; +import { Column, Entity } from 'typeorm'; import BaseModel from './BaseModel'; import User from './User'; import Project from './Project'; import Incident from './Incident'; import OnCallDutySchedule from './OnCallDutySchedule'; - @Entity({ - name: "UserAlerts" + name: 'UserAlerts', }) export default class Model extends BaseModel { + @Column() + public project!: Project; + @Column() + public onCallDutySchedule!: OnCallDutySchedule; - @Column() - project!: Project; + @Column() + public incident!: Incident; - @Column() - onCallDutySchedule!: OnCallDutySchedule; + @Column() + public incidentAcknowledged!: boolean; - @Column() - incident!: Incident + @Column() + public deletedByUser!: User; - @Column() - incidentAcknowledged!: boolean; + @Column() + public isOnDuty!: boolean; - - @Column() - deletedByUser!: User; - - @Column() - isOnDuty!: boolean; - - - @Column() - alertedEveryone!: boolean; + @Column() + public alertedEveryone!: boolean; } - - - - - - - - diff --git a/Common/Models/PerformanceTracker.ts b/Common/Models/PerformanceTracker.ts index af15a6c0f5..ca1ec193e5 100644 --- a/Common/Models/PerformanceTracker.ts +++ b/Common/Models/PerformanceTracker.ts @@ -8,23 +8,23 @@ import Component from './Component'; }) export default class Model extends BaseModel { @Column() - component!: Component; + public component!: Component; @Column() - name!: string; + public name!: string; @Column() - slug!: string; + public slug!: string; @Column() - key!: string; + public key!: string; @Column() - showQuickStart!: boolean; + public showQuickStart!: boolean; @Column() - createdByUser!: User; + public createdByUser!: User; @Column() - deletedByUser!: User; + public deletedByUser!: User; } diff --git a/Common/Models/PerformanceTrackerMetric.ts b/Common/Models/PerformanceTrackerMetric.ts index 26a2f5bcf6..d7b159af52 100644 --- a/Common/Models/PerformanceTrackerMetric.ts +++ b/Common/Models/PerformanceTrackerMetric.ts @@ -7,17 +7,17 @@ import PerformanceTracker from './PerformanceTracker'; }) export default class Model extends BaseModel { @Column() - type!: string; + public type!: string; @Column() - metrics!: Object; + public metrics!: Object; @Column() - callentifier!: string; + public callentifier!: string; @Column() - method!: string; + public method!: string; @Column() - performanceTracker!: PerformanceTracker; + public performanceTracker!: PerformanceTracker; } diff --git a/Common/Models/Probe.ts b/Common/Models/Probe.ts index e8115af821..41663196d4 100755 --- a/Common/Models/Probe.ts +++ b/Common/Models/Probe.ts @@ -8,27 +8,27 @@ import Project from './Project'; }) export default class Probe extends BaseModel { @Column({ nullable: false }) - key!: string; + public key!: string; @Column({ nullable: false }) - name!: string; + public name!: string; @Column({ nullable: false }) - slug!: string; + public slug!: string; @Column({ nullable: false }) - probeVersion!: string; + public probeVersion!: string; @Column({ nullable: false, default: Date.now() }) - lastAlive!: Date; + public lastAlive!: Date; @Column({ nullable: true }) - icon!: string; + public icon!: string; // If this probe is custom to the project and only monitoring reosurces in this project. @Column({ nullable: true }) project?: Project; @Column({ nullable: true }) - deletedByUser!: User; + public deletedByUser!: User; } diff --git a/Common/Models/Project.ts b/Common/Models/Project.ts index a043c277ba..8cb38c0c1c 100644 --- a/Common/Models/Project.ts +++ b/Common/Models/Project.ts @@ -8,110 +8,110 @@ import Project from './Project'; }) export default class Model extends BaseModel { @Column() - name!: string; + public name!: string; @Column() - slug!: string; + public slug!: string; @Column() - stripePlanId!: string; + public stripePlanId!: string; @Column() - stripeSubscriptionId!: string; + public stripeSubscriptionId!: string; @Column() - parentproject!: Project; + public parentproject!: Project; @Column() - seats!: number; + public seats!: number; @Column() - deletedByUser!: User; + public deletedByUser!: User; @Column() - apiKey!: string; + public apiKey!: string; @Column() - alertEnable!: boolean; + public alertEnable!: boolean; @Column() - alertLimit!: string; + public alertLimit!: string; @Column() - alertLimitReached!: boolean; + public alertLimitReached!: boolean; @Column() - balance!: number; + public balance!: number; @Column() - isBlocked!: boolean; + public isBlocked!: boolean; @Column() - sendCreatedIncidentNotificationSms!: boolean; + public sendCreatedIncidentNotificationSms!: boolean; @Column() - sendAcknowledgedIncidentNotificationSms!: boolean; + public sendAcknowledgedIncidentNotificationSms!: boolean; @Column() - sendResolvedIncidentNotificationSms!: boolean; + public sendResolvedIncidentNotificationSms!: boolean; @Column() - sendCreatedIncidentNotificationEmail!: boolean; + public sendCreatedIncidentNotificationEmail!: boolean; @Column() - sendAcknowledgedIncidentNotificationEmail!: boolean; + public sendAcknowledgedIncidentNotificationEmail!: boolean; @Column() - sendResolvedIncidentNotificationEmail!: boolean; + public sendResolvedIncidentNotificationEmail!: boolean; @Column() - enableInvestigationNoteNotificationSMS!: boolean; + public enableInvestigationNoteNotificationSMS!: boolean; @Column() - enableInvestigationNoteNotificationEmail!: boolean; + public enableInvestigationNoteNotificationEmail!: boolean; @Column() - sendAnnouncementNotificationSms!: boolean; + public sendAnnouncementNotificationSms!: boolean; @Column() - sendAnnouncementNotificationEmail!: boolean; + public sendAnnouncementNotificationEmail!: boolean; @Column() - sendCreatedScheduledEventNotificationSms!: boolean; + public sendCreatedScheduledEventNotificationSms!: boolean; @Column() - sendCreatedScheduledEventNotificationEmail!: boolean; + public sendCreatedScheduledEventNotificationEmail!: boolean; @Column() - sendScheduledEventResolvedNotificationSms!: boolean; + public sendScheduledEventResolvedNotificationSms!: boolean; @Column() - sendScheduledEventResolvedNotificationEmail!: boolean; + public sendScheduledEventResolvedNotificationEmail!: boolean; @Column() - sendNewScheduledEventInvestigationNoteNotificationSms!: boolean; + public sendNewScheduledEventInvestigationNoteNotificationSms!: boolean; @Column() - sendNewScheduledEventInvestigationNoteNotificationEmail!: boolean; + public sendNewScheduledEventInvestigationNoteNotificationEmail!: boolean; @Column() - sendScheduledEventCancelledNotificationSms!: boolean; + public sendScheduledEventCancelledNotificationSms!: boolean; @Column() - sendScheduledEventCancelledNotificationEmail!: boolean; + public sendScheduledEventCancelledNotificationEmail!: boolean; @Column() - enableInvestigationNoteNotificationWebhook!: boolean; + public enableInvestigationNoteNotificationWebhook!: boolean; @Column() - replyAddress!: string; + public replyAddress!: string; @Column() - unpaidSubscriptionNotifications!: number; + public unpaidSubscriptionNotifications!: number; @Column() - paymentFailedDate!: Date; + public paymentFailedDate!: Date; @Column() - paymentSuccessDate!: Date; + public paymentSuccessDate!: Date; } diff --git a/Common/Models/ProjectAdminNotes.ts b/Common/Models/ProjectAdminNotes.ts index e2fb1517e1..b61d676b26 100644 --- a/Common/Models/ProjectAdminNotes.ts +++ b/Common/Models/ProjectAdminNotes.ts @@ -8,11 +8,11 @@ import User from './User'; }) export default class ProjectAdminNote extends BaseModel { @Column({ nullable: false }) - project!: Project; + public project!: Project; @Column({ type: 'text', nullable: false }) - note!: string; + public note!: string; @Column({ nullable: false }) - createdByUser!: User; + public createdByUser!: User; } diff --git a/Common/Models/ProjectAlertBalance.ts b/Common/Models/ProjectAlertBalance.ts index 26c7dbb04f..68f7b272df 100644 --- a/Common/Models/ProjectAlertBalance.ts +++ b/Common/Models/ProjectAlertBalance.ts @@ -6,17 +6,17 @@ import BaseModel from './BaseModel'; }) export default class ProjectAlertBalance extends BaseModel { @Column({ nullable: false }) - minimumBalance!: number; + public minimumBalance!: number; @Column({ type: 'text', nullable: false }) - rechargeToBalance!: number; + public rechargeToBalance!: number; @Column({ nullable: false }) - sendAlertsToUS!: boolean; + public sendAlertsToUS!: boolean; @Column({ nullable: false }) - sendAlertsToNonUS!: boolean; + public sendAlertsToNonUS!: boolean; @Column({ nullable: false }) - sendAlertsToHighRisk!: boolean; + public sendAlertsToHighRisk!: boolean; } diff --git a/Common/Models/ProjectSmtpConfig.ts b/Common/Models/ProjectSmtpConfig.ts index 62acf2fc52..892f65d6d4 100755 --- a/Common/Models/ProjectSmtpConfig.ts +++ b/Common/Models/ProjectSmtpConfig.ts @@ -11,55 +11,55 @@ export default class ProjectSmtpConfig extends BaseModel { nullable: false, }) @Index() - project!: Project; + public project!: Project; @Column({ nullable: false, }) - useranme!: string; + public useranme!: string; @Column({ nullable: false, }) - password!: string; + public password!: string; @Column({ nullable: false, }) - host!: string; + public host!: string; @Column({ nullable: false, }) - port!: number; + public port!: number; @Column({ nullable: false, }) - fromEmail!: string; + public fromEmail!: string; @Column({ nullable: false, }) - fromName!: string; + public fromName!: string; @Column({ nullable: false, }) - iv!: Buffer; + public iv!: Buffer; @Column({ nullable: false, default: true, }) - secure!: boolean; + public secure!: boolean; @Column({ nullable: false, default: true, }) - enabled!: boolean; + public enabled!: boolean; @Column() - deletedByUser!: User; + public deletedByUser!: User; } diff --git a/Common/Models/ProjectUser.ts b/Common/Models/ProjectUser.ts index e6b580b41d..1e82853d46 100644 --- a/Common/Models/ProjectUser.ts +++ b/Common/Models/ProjectUser.ts @@ -9,11 +9,11 @@ import User from './User'; }) export default class ProjectAdminNote extends BaseModel { @Column({ nullable: false }) - project!: Project; + public project!: Project; @Column({ type: 'text', nullable: false }) - user!: User; + public user!: User; @Column({ nullable: false }) - role!: Role; + public role!: Role; } diff --git a/Common/Models/ResourceLabel.ts b/Common/Models/ResourceLabel.ts index 45863bd851..4cd470134f 100755 --- a/Common/Models/ResourceLabel.ts +++ b/Common/Models/ResourceLabel.ts @@ -9,14 +9,14 @@ import Project from './Project'; export default class ResourceLabel extends BaseModel { @Column() @Index() - project!: Project; + public project!: Project; @Column() - name!: string; + public name!: string; @Column() - createdByUser!: User; + public createdByUser!: User; @Column() - deletedByUser!: User; + public deletedByUser!: User; } diff --git a/Common/Models/ResourceStatus.ts b/Common/Models/ResourceStatus.ts index 35d93da73f..039bb71eb7 100644 --- a/Common/Models/ResourceStatus.ts +++ b/Common/Models/ResourceStatus.ts @@ -12,17 +12,17 @@ import Project from './Project'; }) export default class ResourceStatus extends BaseModel { @Column() - project!: Project; + public project!: Project; @Column() - name!: string; + public name!: string; @Column() - color!: string; + public color!: string; @Column() - createdByUser!: User; + public createdByUser!: User; @Column() - deletedByUser!: User; + public deletedByUser!: User; } diff --git a/Common/Models/ScheduledEvent.ts b/Common/Models/ScheduledEvent.ts index 0ce6e4995a..fbe71a4715 100755 --- a/Common/Models/ScheduledEvent.ts +++ b/Common/Models/ScheduledEvent.ts @@ -8,62 +8,62 @@ import Project from './Project'; }) export default class Model extends BaseModel { @Column() - project!: Project; + public project!: Project; @Column() - name!: string; + public name!: string; @Column() - cancelled!: boolean; + public cancelled!: boolean; @Column() - cancelledAt!: Date; + public cancelledAt!: Date; @Column() - cancelledBy!: User; + public cancelledBy!: User; @Column() - slug!: string; + public slug!: string; @Column() - createdByUser!: User; + public createdByUser!: User; @Column() - deletedByUser!: User; + public deletedByUser!: User; @Column() - startDate!: Date; + public startDate!: Date; @Column() - endDate!: Date; + public endDate!: Date; @Column() - description!: string; + public description!: string; @Column() - showEventOnStatusPage!: boolean; + public showEventOnStatusPage!: boolean; @Column() - callScheduleOnEvent!: boolean; + public callScheduleOnEvent!: boolean; @Column() - monitorDuringEvent!: boolean; + public monitorDuringEvent!: boolean; @Column() - recurring!: boolean; + public recurring!: boolean; @Column() - interval!: string; + public interval!: string; @Column() - alertSubscriber!: boolean; + public alertSubscriber!: boolean; @Column() - resolved!: boolean; + public resolved!: boolean; @Column() - resolvedBy!: User; + public resolvedBy!: User; @Column() - resolvedAt!: Date; + public resolvedAt!: Date; } diff --git a/Common/Models/ScheduledEventNote.ts b/Common/Models/ScheduledEventNote.ts index 3ea332abc3..f7891b4ae2 100644 --- a/Common/Models/ScheduledEventNote.ts +++ b/Common/Models/ScheduledEventNote.ts @@ -13,23 +13,23 @@ export enum ScheduledEventNote { }) export default class Model extends BaseModel { @Column() - scheduledEvent!: ScheduledEvent; + public scheduledEvent!: ScheduledEvent; @Column() - content!: string; + public content!: string; @Column() - type!: ScheduledEventNote; + public type!: ScheduledEventNote; @Column() - eventState!: ScheduledEventState; + public eventState!: ScheduledEventState; @Column() - createdByUser!: User; + public createdByUser!: User; @Column() - updated!: boolean; + public updated!: boolean; @Column() - deletedByUser!: User; + public deletedByUser!: User; } diff --git a/Common/Models/ScheduledEventResource.ts b/Common/Models/ScheduledEventResource.ts index ca6eddedf5..4135609fb8 100644 --- a/Common/Models/ScheduledEventResource.ts +++ b/Common/Models/ScheduledEventResource.ts @@ -8,8 +8,8 @@ import ScheduledEvent from './ScheduledEvent'; }) export default class StatusPageChartType extends BaseModel { @Column() - scheduledEvent!: ScheduledEvent; + public scheduledEvent!: ScheduledEvent; @Column() - monitor!: Monitor; + public monitor!: Monitor; } diff --git a/Common/Models/SmsCount.ts b/Common/Models/SmsCount.ts index 377e78b2bc..017c1f729f 100644 --- a/Common/Models/SmsCount.ts +++ b/Common/Models/SmsCount.ts @@ -8,23 +8,23 @@ import Project from './Project'; }) export default class Model extends BaseModel { @Column() - user!: User; + public user!: User; @Column() - sentTo!: string; + public sentTo!: string; @Column() - project!: Project; + public project!: Project; @Column() - content!: string; + public content!: string; @Column() - deletedByUser!: User; + public deletedByUser!: User; @Column() - status!: string; + public status!: string; @Column() - error!: string; + public error!: string; } diff --git a/Common/Models/SmsProvider.ts b/Common/Models/SmsProvider.ts index ffc9fb18e4..26c56d54ca 100755 --- a/Common/Models/SmsProvider.ts +++ b/Common/Models/SmsProvider.ts @@ -13,20 +13,20 @@ export enum SMSProviderType { }) export default class Model extends BaseModel { @Column() - project!: Project; + public project!: Project; @Column() - enabled!: boolean; + public enabled!: boolean; @Column() - provider!: SMSProviderType; + public provider!: SMSProviderType; @Column() - credentials!: JSONObject; + public credentials!: JSONObject; @Column() - deletedByUser!: User; + public deletedByUser!: User; @Column() - createdByUser!: User; + public createdByUser!: User; } diff --git a/Common/Models/SmsTemplate.ts b/Common/Models/SmsTemplate.ts index d3764ffc88..5b1a60c8d5 100755 --- a/Common/Models/SmsTemplate.ts +++ b/Common/Models/SmsTemplate.ts @@ -9,20 +9,20 @@ import SmsTemplateType from '../Types/SMS/SmsTemplateType'; }) export default class SmsTemplate extends BaseModel { @Column() - project!: Project; + public project!: Project; @Column() - content!: string; + public content!: string; @Column() - smsType!: SmsTemplateType; + public smsType!: SmsTemplateType; @Column({ array: true, type: 'text', }) - allowedVariables!: Array; + public allowedVariables!: Array; @Column() - deletedByUser!: User; + public deletedByUser!: User; } diff --git a/Common/Models/SslCertificate.ts b/Common/Models/SslCertificate.ts index 440f3dc87a..334842b95b 100644 --- a/Common/Models/SslCertificate.ts +++ b/Common/Models/SslCertificate.ts @@ -6,32 +6,32 @@ import BaseModel from './BaseModel'; }) export default class SslCertificate extends BaseModel { @Column() - certificateId!: string; + public certificateId!: string; @Column() - privateKeyPem!: string; + public privateKeyPem!: string; @Column() - privateKeyJwk!: string; + public privateKeyJwk!: string; @Column() - cert!: string; + public cert!: string; @Column() - chain!: string; + public chain!: string; @Column() - privKey!: string; + public privKey!: string; @Column() - subject!: string; + public subject!: string; @Column() - altnames!: string; + public altnames!: string; @Column() - issuedAt!: Date; + public issuedAt!: Date; @Column() - expiresAt!: Date; + public expiresAt!: Date; } diff --git a/Common/Models/SslCertificateManager.ts b/Common/Models/SslCertificateManager.ts index 2334277304..ed296458d3 100644 --- a/Common/Models/SslCertificateManager.ts +++ b/Common/Models/SslCertificateManager.ts @@ -6,17 +6,17 @@ import BaseModel from './BaseModel'; }) export default class Model extends BaseModel { @Column() - subject!: string; + public subject!: string; @Column() - altnames!: Array; + public altnames!: Array; @Column() - renewAt!: Date; + public renewAt!: Date; @Column() - expiresAt!: Date; + public expiresAt!: Date; @Column() - issuedAt!: Date; + public issuedAt!: Date; } diff --git a/Common/Models/SslVerificationCahllenge.ts b/Common/Models/SslVerificationCahllenge.ts index 8dabe1c882..b23376dbe4 100644 --- a/Common/Models/SslVerificationCahllenge.ts +++ b/Common/Models/SslVerificationCahllenge.ts @@ -6,11 +6,11 @@ import BaseModel from './BaseModel'; }) export default class SslVerificationChallenge extends BaseModel { @Column() - token!: string; + public token!: string; @Column() - keyAuthorization!: string; + public keyAuthorization!: string; @Column() - challengeUrl!: string; + public challengeUrl!: string; } diff --git a/Common/Models/SsoConfig.ts b/Common/Models/SsoConfig.ts index 4e78188767..11b1f015d2 100644 --- a/Common/Models/SsoConfig.ts +++ b/Common/Models/SsoConfig.ts @@ -8,31 +8,31 @@ import Project from './Project'; }) export default class SsoConfig extends BaseModel { @Column({ nullable: false }) - enabled!: boolean; + public enabled!: boolean; @Index() @Column({ nullable: false }) - domain!: string; + public domain!: string; @Column({ nullable: false }) - entity!: string; + public entity!: string; @Column({ nullable: false }) - loginUrl!: string; + public loginUrl!: string; @Column() - certificateFingerprint!: string; + public certificateFingerprint!: string; @Column({ nullable: false }) - logoutUrl!: string; + public logoutUrl!: string; @Column() - ipRanges!: string; + public ipRanges!: string; @Column({ nullable: false }) - deletedByUser!: User; + public deletedByUser!: User; @Index() @Column({ nullable: false }) - project!: Project; + public project!: Project; } diff --git a/Common/Models/SsoDefaultRole.ts b/Common/Models/SsoDefaultRole.ts index 9ab6e72a73..21f9924264 100644 --- a/Common/Models/SsoDefaultRole.ts +++ b/Common/Models/SsoDefaultRole.ts @@ -9,14 +9,14 @@ import Role from '../Types/Role'; }) export default class SsoDefaultRole extends BaseModel { @Column() - domain!: string; + public domain!: string; @Column() - project!: Project; + public project!: Project; @Column() - role!: Role; + public role!: Role; @Column() - deletedByUser!: User; + public deletedByUser!: User; } diff --git a/Common/Models/StatusPage.ts b/Common/Models/StatusPage.ts index 821d684eaf..49b9a80adf 100755 --- a/Common/Models/StatusPage.ts +++ b/Common/Models/StatusPage.ts @@ -7,132 +7,132 @@ import Project from './Project'; }) export default class Model extends BaseModel { @Column() - project!: Project; + public project!: Project; @Column() - slug!: string; + public slug!: string; @Column() - title!: string; + public title!: string; @Column() - name!: string; + public name!: string; @Column() - isPrivate!: boolean; + public isPrivate!: boolean; @Column() - isSubscriberEnabled!: boolean; + public isSubscriberEnabled!: boolean; @Column() - isGroupedByMonitorCategory!: boolean; + public isGroupedByMonitorCategory!: boolean; @Column() - showScheduledEvents!: boolean; + public showScheduledEvents!: boolean; // Show incident to the top of status page @Column() - moveIncidentToTheTop!: boolean; + public moveIncidentToTheTop!: boolean; // Show or hide the probe bar @Column() - hideProbeBar!: boolean; + public hideProbeBar!: boolean; // Show or hide uptime (%) on the status page @Column() - hideUptime!: boolean; + public hideUptime!: boolean; @Column() - multipleNotificationTypes!: boolean; + public multipleNotificationTypes!: boolean; // Show or hide resolved incident on the status page @Column() - hideResolvedIncident!: boolean; + public hideResolvedIncident!: boolean; @Column() - description!: string; + public description!: string; @Column() - copyright!: string; + public copyright!: string; @Column() - faviconPath!: string; + public faviconPath!: string; @Column() - logoPath!: string; + public logoPath!: string; @Column() - bannerPath!: string; + public bannerPath!: string; @Column() - colors!: Object; + public colors!: Object; @Column() - layout!: Object; + public layout!: Object; @Column() - headerHTML!: string; + public headerHTML!: string; @Column() - footerHTML!: string; + public footerHTML!: string; @Column() - customCSS!: string; + public customCSS!: string; @Column() - customJS!: string; + public customJS!: string; @Column() - statusBubble!: string; + public statusBubble!: string; @Column() - embeddedCss!: string; + public embeddedCss!: string; @Column() - enableRSSFeed!: boolean; + public enableRSSFeed!: boolean; @Column() - emailNotification!: boolean; + public emailNotification!: boolean; @Column() - smsNotification!: boolean; + public smsNotification!: boolean; @Column() - webhookNotification!: boolean; + public webhookNotification!: boolean; @Column() - selectIndividualMonitors!: boolean; + public selectIndividualMonitors!: boolean; @Column() - enableIpWhitelist!: boolean; + public enableIpWhitelist!: boolean; @Column() - incidentHistoryDays!: number; + public incidentHistoryDays!: number; @Column() - scheduleHistoryDays!: number; + public scheduleHistoryDays!: number; @Column() - announcementLogsHistory!: number; + public announcementLogsHistory!: number; @Column() - onlineText!: string; + public onlineText!: string; @Column() - offlineText!: string; + public offlineText!: string; @Column() - degradedText!: string; + public degradedText!: string; @Column() - twitterHandle!: string; + public twitterHandle!: string; @Column() - enableMultipleLanguage!: boolean; + public enableMultipleLanguage!: boolean; @Column() - deletedByUser!: User; + public deletedByUser!: User; @Column() - theme!: string; + public theme!: string; } diff --git a/Common/Models/StatusPageCategory.ts b/Common/Models/StatusPageCategory.ts index eadbd9812d..d3e4b10a04 100644 --- a/Common/Models/StatusPageCategory.ts +++ b/Common/Models/StatusPageCategory.ts @@ -8,14 +8,14 @@ import StatusPage from './StatusPage'; }) export default class Model extends BaseModel { @Column() - statusPage!: StatusPage; + public statusPage!: StatusPage; @Column() - name!: string; + public name!: string; @Column() - createdByUser!: User; + public createdByUser!: User; @Column() - deletedByUser!: User; + public deletedByUser!: User; } diff --git a/Common/Models/StatusPageDomains.ts b/Common/Models/StatusPageDomains.ts index ec5e714662..f130a0bb0b 100644 --- a/Common/Models/StatusPageDomains.ts +++ b/Common/Models/StatusPageDomains.ts @@ -9,20 +9,20 @@ import DomainVerificationToken from './DomainVerificationToken'; }) export default class StatusPageDomains extends BaseModel { @Column() - statusPage!: StatusPage; + public statusPage!: StatusPage; @Column() - domain!: string; + public domain!: string; @Column() - certificate!: User; + public certificate!: User; @Column() - privateKey!: User; + public privateKey!: User; @Column() - autoProvisioning!: boolean; + public autoProvisioning!: boolean; @Column() - domainVerificationToken!: DomainVerificationToken; + public domainVerificationToken!: DomainVerificationToken; } diff --git a/Common/Models/StatusPageFooterLink.ts b/Common/Models/StatusPageFooterLink.ts index ed800b96a9..175b0dd43b 100644 --- a/Common/Models/StatusPageFooterLink.ts +++ b/Common/Models/StatusPageFooterLink.ts @@ -8,17 +8,17 @@ import StatusPage from './StatusPage'; }) export default class Model extends BaseModel { @Column() - statusPage!: StatusPage; + public statusPage!: StatusPage; @Column() - title!: string; + public title!: string; @Column() - url!: string; + public url!: string; @Column() - createdByUser!: User; + public createdByUser!: User; @Column() - deletedByUser!: User; + public deletedByUser!: User; } diff --git a/Common/Models/StatusPageIpWhiteList.ts b/Common/Models/StatusPageIpWhiteList.ts index 45edc7cf35..d51187ae01 100644 --- a/Common/Models/StatusPageIpWhiteList.ts +++ b/Common/Models/StatusPageIpWhiteList.ts @@ -8,14 +8,14 @@ import StatusPage from './StatusPage'; }) export default class Model extends BaseModel { @Column() - statusPage!: StatusPage; + public statusPage!: StatusPage; @Column() - ipWhitelist!: string; + public ipWhitelist!: string; @Column() - createdByUser!: User; + public createdByUser!: User; @Column() - deletedByUser!: User; + public deletedByUser!: User; } diff --git a/Common/Models/StatusPageLanguages.ts b/Common/Models/StatusPageLanguages.ts index 56c86bee7e..7c4aa7a42f 100644 --- a/Common/Models/StatusPageLanguages.ts +++ b/Common/Models/StatusPageLanguages.ts @@ -8,14 +8,14 @@ import StatusPage from './StatusPage'; }) export default class Model extends BaseModel { @Column() - statusPage!: StatusPage; + public statusPage!: StatusPage; @Column() - language!: string; + public language!: string; @Column() - createdByUser!: User; + public createdByUser!: User; @Column() - deletedByUser!: User; + public deletedByUser!: User; } diff --git a/Common/Models/StatusPageResource.ts b/Common/Models/StatusPageResource.ts index 3bfc32ffa6..7a919754e6 100644 --- a/Common/Models/StatusPageResource.ts +++ b/Common/Models/StatusPageResource.ts @@ -9,17 +9,17 @@ import Monitor from './Monitor'; }) export default class StatusPageChartType extends BaseModel { @Column() - statusPage!: StatusPage; + public statusPage!: StatusPage; @Column() - monitor!: Monitor; + public monitor!: Monitor; @Column() - statusPageCategory!: StatusPageCategory; + public statusPageCategory!: StatusPageCategory; @Column() - resourceDescription!: string; + public resourceDescription!: string; @Column() - chartTypes!: Array; + public chartTypes!: Array; } diff --git a/Common/Models/Subscriber.ts b/Common/Models/Subscriber.ts index 1d443097a2..1dc8372465 100755 --- a/Common/Models/Subscriber.ts +++ b/Common/Models/Subscriber.ts @@ -1,4 +1,4 @@ -import { Column, Entity, Index } from 'typeorm'; +import { Column, Entity } from 'typeorm'; import BaseModel from './BaseModel'; import User from './User'; import Project from './Project'; @@ -7,62 +7,49 @@ import Monitor from './Monitor'; import AlertType from '../Types/Alerts/AlertType'; import HTTPMethod from '../Types/API/HTTPMethod'; - @Entity({ - name: "UserAlerts" + name: 'UserAlerts', }) export default class Model extends BaseModel { + @Column() + public monitor!: Monitor; - @Column() - monitor!: Monitor; + @Column() + public project!: Project; - @Column() - project!: Project; + @Column() + public statusPage!: StatusPage; - @Column() - statusPage!: StatusPage + @Column() + public alertType!: AlertType; - @Column() - alertType!: AlertType + @Column() + public contactEmail!: string; - @Column() - contactEmail!: string; + @Column() + public contactPhone!: string; - @Column() - contactPhone!: string; + @Column() + public countryCode!: string; - @Column() - countryCode!: string; + @Column() + public contactWebhook!: string; - @Column() - contactWebhook!: string; + @Column() + public webhookMethod!: HTTPMethod; - @Column() - webhookMethod!: HTTPMethod + @Column() + public incidentNotification!: boolean; + @Column() + public announcementNotification!: boolean; - @Column() - incidentNotification!: boolean; + @Column() + public scheduledEventNotification!: boolean; - @Column() - announcementNotification!: boolean; + @Column() + public subscribed!: boolean; - @Column() - scheduledEventNotification!: boolean; - - - @Column() - subscribed!: boolean; - - @Column() - deletedByUser!: User; + @Column() + public deletedByUser!: User; } - - - - - - - - - diff --git a/Common/Models/SubscriberAlert.ts b/Common/Models/SubscriberAlert.ts index 86dce7ff2c..e9e90b3e31 100755 --- a/Common/Models/SubscriberAlert.ts +++ b/Common/Models/SubscriberAlert.ts @@ -1,4 +1,4 @@ -import { Column, Entity, Index } from 'typeorm'; +import { Column, Entity } from 'typeorm'; import BaseModel from './BaseModel'; import User from './User'; import Project from './Project'; @@ -7,43 +7,31 @@ import Incident from './Incident'; import AlertType from '../Types/Alerts/AlertType'; import OperationResult from '../Types/Operation/OperationResult'; - @Entity({ - name: "UserAlerts" + name: 'UserAlerts', }) export default class Model extends BaseModel { + @Column() + public project!: Project; - @Column() - project!: Project; + @Column() + public subscriber!: Subscriber; - @Column() - subscriber!: Subscriber; + @Column() + public incident!: Incident; - @Column() - incident!: Incident; + @Column() + public alertVia!: AlertType; - @Column() - alertVia!: AlertType + @Column() + public status!: OperationResult; - @Column() - status!: OperationResult; + @Column() + public eventType!: AlertEventType; - @Column() - eventType!: AlertEventType - - @Column() - errorMessage!: string - - @Column() - deletedByUser!: User; + @Column() + public errorMessage!: string; + @Column() + public deletedByUser!: User; } - - - - - - - - - diff --git a/Common/Models/Team.ts b/Common/Models/Team.ts index d85da4df60..af2bd9311c 100644 --- a/Common/Models/Team.ts +++ b/Common/Models/Team.ts @@ -9,14 +9,14 @@ import Project from './Project'; export default class Team extends BaseModel { @Column() @Index() - project!: Project; + public project!: Project; @Column() - name!: string; + public name!: string; @Column() - createdByUser!: User; + public createdByUser!: User; @Column() - deletedByUser!: User; + public deletedByUser!: User; } diff --git a/Common/Models/TeamMember.ts b/Common/Models/TeamMember.ts index 0ebe4b8666..a840fa178a 100644 --- a/Common/Models/TeamMember.ts +++ b/Common/Models/TeamMember.ts @@ -8,14 +8,14 @@ import User from './User'; export default class TeamMember extends BaseModel { @Column() @Index() - team!: Team; + public team!: Team; @Column() - user!: User; + public user!: User; @Column() - createdByUser!: User; + public createdByUser!: User; @Column() - deletedByUser!: User; + public deletedByUser!: User; } diff --git a/Common/Models/User.ts b/Common/Models/User.ts index f0f4c2a7f9..90cf941dc1 100644 --- a/Common/Models/User.ts +++ b/Common/Models/User.ts @@ -8,100 +8,100 @@ import SSO from './SsoConfig'; }) export default class User extends BaseModel { @Column({ type: 'text', length: 100 }) - name!: string; + public name!: string; @Column({ type: 'text', length: 200, unique: true }) - email!: string; + public email!: string; @Column({ type: 'text', length: 200 }) - temporaryEmail!: string; + public temporaryEmail!: string; @Column({ type: 'text', length: 200 }) - password!: string; + public password!: string; @Column({ type: 'boolean' }) - isEmailVerified!: boolean; + public isEmailVerified!: boolean; @Column() - sso!: SSO; + public sso!: SSO; @Column({ type: 'text', length: 200 }) - companyName!: string; + public companyName!: string; @Column({ type: 'text', length: 100 }) - companyRole!: string; + public companyRole!: string; @Column({ type: 'text', length: 100 }) - companySize!: string; + public companySize!: string; @Column({ type: 'text', length: 100 }) - referral!: string; + public referral!: string; @Column({ type: 'text', length: 200 }) - companyPhoneNumber!: string; + public companyPhoneNumber!: string; @Column({ type: 'text', length: 200 }) - profilePic!: string; + public profilePic!: string; @Column() - twoFactorAuthEnabled!: boolean; + public twoFactorAuthEnabled!: boolean; @Column() - twoFactorSecretCode!: string; + public twoFactorSecretCode!: string; @Column() - otpauth_url!: URL; + otpauth_public url!: URL; @Column() - backupCodes!: Array; + public backupCodes!: Array; @Column() - jwtRefreshToken!: string; + public jwtRefreshToken!: string; @Column() - stripeCustomer!: string; + public stripeCustomer!: string; @Column() - resetPasswordToken!: string; + public resetPasswordToken!: string; @Column() - resetPasswordExpires!: string; + public resetPasswordExpires!: string; @Column() - timezone!: string; + public timezone!: string; @Column() - lastActive!: Date; + public lastActive!: Date; @Column() - coupon!: string; + public coupon!: string; @Column() - disabled!: boolean; + public disabled!: boolean; @Column() - paymentFailedDate!: Date; + public paymentFailedDate!: Date; @Column() - role!: Role; + public role!: Role; @Column() - isBlocked!: boolean; + public isBlocked!: boolean; @Column() - deletedByUser!: User; + public deletedByUser!: User; @Column() - alertPhoneNumber!: string; + public alertPhoneNumber!: string; @Column() - alertPhoneVerificationCode!: string; + public alertPhoneVerificationCode!: string; @Column() - alertPhoneVerificationCodeRequestTime!: Date; + public alertPhoneVerificationCodeRequestTime!: Date; @Column() - tempAlertPhoneNumber!: string; + public tempAlertPhoneNumber!: string; @Column() createdBy: User; diff --git a/Common/Models/UserAdminNote.ts b/Common/Models/UserAdminNote.ts index 219b400c2f..c2f6071e0a 100644 --- a/Common/Models/UserAdminNote.ts +++ b/Common/Models/UserAdminNote.ts @@ -7,11 +7,11 @@ import User from './User'; }) export default class UserAdminNotes extends BaseModel { @Column({ nullable: false }) - forUser!: User; + public forUser!: User; @Column({ type: 'text', nullable: false }) - note!: string; + public note!: string; @Column({ nullable: false }) - postedByUser!: User; + public postedByUser!: User; } diff --git a/Common/Models/UserAlertCallLogs.ts b/Common/Models/UserAlertCallLogs.ts index 627e9cf8ca..89a643d182 100644 --- a/Common/Models/UserAlertCallLogs.ts +++ b/Common/Models/UserAlertCallLogs.ts @@ -9,23 +9,23 @@ import OperationStatus from '../Types/OperationStatus'; }) export default class CallLog extends BaseModel { @Column() - fromNumber!: string; + public fromNumber!: string; @Column() - toNumber!: string; + public toNumber!: string; @Column() - project!: Project; + public project!: Project; @Column() - deletedByUser!: User; + public deletedByUser!: User; @Column() - content!: string; + public content!: string; @Column() - status!: OperationStatus; + public status!: OperationStatus; @Column() - errorDescription!: string; + public errorDescription!: string; } diff --git a/Common/Models/UserAlerts.ts b/Common/Models/UserAlerts.ts index d4bd87af0f..230909ef25 100755 --- a/Common/Models/UserAlerts.ts +++ b/Common/Models/UserAlerts.ts @@ -1,66 +1,56 @@ -import { Column, Entity, Index } from 'typeorm'; +import { Column, Entity } from 'typeorm'; import BaseModel from './BaseModel'; import User from './User'; import Project from './Project'; import Incident, { IncidentState } from './Incident'; import Escalation from './Escalation'; import Schedule from './OnCallDutySchedule'; +import OnCallDutySchedule from './OnCallDutySchedule'; @Entity({ - name: "UserAlerts" + name: 'UserAlerts', }) - export default class UserAlerts extends BaseModel { + @Column({ + nullable: false, + }) + public project!: Project; @Column({ - nullable: false, + nullable: false, }) - project!: Project; - - @Column({ - nullable: false, - }) - user!: User; + public user!: User; @Column() - alertType!: string; + public alertType!: string; @Column() - alertStatus!: string; + public alertStatus!: string; @Column() - eventType!: IncidentState + public eventType!: IncidentState; @Column() - incident!: Incident; + public incident!: Incident; @Column() - onCallScheduleStatus!: OnCallSchedule; + public onCallScheduleStatus!: OnCallDutySchedule; @Column() - schedule!: Schedule; + public schedule!: Schedule; @Column() - escalation!: Escalation; + public escalation!: Escalation; @Column() - error!: boolean; + public error!: boolean; @Column() - errorMessage!: string; + public errorMessage!: string; @Column() - alertProgress!: string + public alertProgress!: string; @Column() - deletedByUser!: User; + public deletedByUser!: User; } - - - - - - - - - diff --git a/Common/Models/UserVerificationToken.ts b/Common/Models/UserVerificationToken.ts index 646a3eff75..128f93cbe4 100755 --- a/Common/Models/UserVerificationToken.ts +++ b/Common/Models/UserVerificationToken.ts @@ -7,12 +7,12 @@ import User from './User'; }) export default class UserVerificationToken extends BaseModel { @Column({ nullable: false }) - user!: User; + public user!: User; @Index() @Column({ nullable: false }) - token!: string; + public token!: string; @Column({ nullable: false }) - expires!: Date; + public expires!: Date; } diff --git a/Common/Models/Zapier.ts b/Common/Models/Zapier.ts index 2f18d00281..6b39156e84 100755 --- a/Common/Models/Zapier.ts +++ b/Common/Models/Zapier.ts @@ -7,14 +7,14 @@ import Project from './Project'; }) export default class Zapier extends BaseModel { @Column() - project!: Project; + public project!: Project; @Column() - url!: URL; + public url!: URL; @Column() - type!: string; + public type!: string; @Column() - monitors!: [String]; + public monitors!: [String]; } diff --git a/Common/Types/Alerts/AlertEventType.ts b/Common/Types/Alerts/AlertEventType.ts index 2b2e680a23..2409de9797 100644 --- a/Common/Types/Alerts/AlertEventType.ts +++ b/Common/Types/Alerts/AlertEventType.ts @@ -9,4 +9,4 @@ enum AlertEventType { ScheduledMaintenanceEesolved = 'Scheduled maintenance resolved', ScheduledMaintenanceCancelled = 'Scheduled maintenance cancelled', AnnouncementNotificationCreated = 'Announcement notification created', -} \ No newline at end of file +} diff --git a/Common/Types/Alerts/AlertType.ts b/Common/Types/Alerts/AlertType.ts index c125d4a1fc..5baa256696 100644 --- a/Common/Types/Alerts/AlertType.ts +++ b/Common/Types/Alerts/AlertType.ts @@ -1,10 +1,9 @@ enum AlertType { - Webhook = "Webhook", - Email = "Email", - SMS = "SMS", - Call = "Call", - PushNotification = "PushNotification" + Webhook = 'Webhook', + Email = 'Email', + SMS = 'SMS', + Call = 'Call', + PushNotification = 'PushNotification', } - -export default AlertType; \ No newline at end of file +export default AlertType; diff --git a/Common/Types/ApplicationLog/ApplicationLogType.ts b/Common/Types/ApplicationLog/ApplicationLogType.ts index b4d942e378..af3c38cdd4 100644 --- a/Common/Types/ApplicationLog/ApplicationLogType.ts +++ b/Common/Types/ApplicationLog/ApplicationLogType.ts @@ -1,8 +1,7 @@ -enum ApplicationLogType { - Info = "Info", - Erorr = "Error", - Warning = "Warning" +enum ApplicationLogType { + Info = 'Info', + Erorr = 'Error', + Warning = 'Warning', } - -export default ApplicationLogType; \ No newline at end of file +export default ApplicationLogType; diff --git a/Common/Types/Filter/Filter.ts b/Common/Types/Filter/Filter.ts new file mode 100644 index 0000000000..379973d1af --- /dev/null +++ b/Common/Types/Filter/Filter.ts @@ -0,0 +1 @@ +export default class Filter {} diff --git a/Common/Types/Filter/FilterCondition.ts b/Common/Types/Filter/FilterCondition.ts new file mode 100644 index 0000000000..18324995e6 --- /dev/null +++ b/Common/Types/Filter/FilterCondition.ts @@ -0,0 +1,6 @@ +enum FilterCondition { + And = 'And', + Or = 'Or', +} + +export default FilterCondition; diff --git a/Common/Types/Filter/FilterType.ts b/Common/Types/Filter/FilterType.ts new file mode 100644 index 0000000000..73c7647218 --- /dev/null +++ b/Common/Types/Filter/FilterType.ts @@ -0,0 +1,10 @@ +enum FilterType { + EqualTo = 'EqualTo', + NotEqualTo = 'NotEqualTo', + LessThan = 'LessThan', + GreaterThan = 'GreaterThan', + GreaterThanOrEqualTo = 'GreaterThanOrEqualTo', + LessThanOrEqualTo = 'LessThanOrEqualTo', +} + +export default FilterType; diff --git a/Common/Types/IP/IP.ts b/Common/Types/IP/IP.ts index e17968f083..09326c5b57 100644 --- a/Common/Types/IP/IP.ts +++ b/Common/Types/IP/IP.ts @@ -9,7 +9,7 @@ export default class IP { this._ip = v; } - private constructor(ip: string) { + public constructor(ip: string) { this.ip = ip; } diff --git a/Common/Types/Incident/IncidentCustomFields.ts b/Common/Types/Incident/IncidentCustomFields.ts index 0f54bfe427..2307831c32 100644 --- a/Common/Types/Incident/IncidentCustomFields.ts +++ b/Common/Types/Incident/IncidentCustomFields.ts @@ -1,3 +1 @@ -export default class MonitorCustomFields { - -} \ No newline at end of file +export default class MonitorCustomFields {} diff --git a/Common/Types/IncomingRequest/IncomingRequestCustomFields.ts b/Common/Types/IncomingRequest/IncomingRequestCustomFields.ts index b1cd10e56a..863487f2bf 100644 --- a/Common/Types/IncomingRequest/IncomingRequestCustomFields.ts +++ b/Common/Types/IncomingRequest/IncomingRequestCustomFields.ts @@ -1,3 +1 @@ -export default class IncomingRequestCustomFields { - -} \ No newline at end of file +export default class IncomingRequestCustomFields {} diff --git a/Common/Types/Monitor/MonitorCriteria.ts b/Common/Types/Monitor/MonitorCriteria.ts index 30f5ced777..bd00b7ce84 100644 --- a/Common/Types/Monitor/MonitorCriteria.ts +++ b/Common/Types/Monitor/MonitorCriteria.ts @@ -1,12 +1,12 @@ export default class MonitorCriteria { /** * @Column() - up: { type: [criterionEventSchema], default !: [] }; - - @Column() - degraded: { type: [criterionEventSchema], default !: [] }; - - @Column() - down: { type: [criterionEventSchema], default !: [] }; + *up: { type: [criterionEventSchema], default !: [] }; + * + *@Column() + *degraded: { type: [criterionEventSchema], default !: [] }; + * + *@Column() + *down: { type: [criterionEventSchema], default !: [] }; */ -} \ No newline at end of file +} diff --git a/Common/Types/Monitor/MonitorCriteriaInstance.ts b/Common/Types/Monitor/MonitorCriteriaInstance.ts index 6d58322cf0..956b3a7f97 100644 --- a/Common/Types/Monitor/MonitorCriteriaInstance.ts +++ b/Common/Types/Monitor/MonitorCriteriaInstance.ts @@ -1,142 +1,208 @@ -export default class MonitorCriteriaInstance { - -} +export default class MonitorCriteriaInstance {} +/* + * @Column() + * const criterionEventSchema!: Schema = new Schema({ + */ -// @Column() -// const criterionEventSchema!: Schema = new Schema({ - -// @Column() -// schedules!: [String]; +/* + * @Column() + * schedules!: [String]; + */ -// @Column() -// createAlert!: boolean; +/* + * @Column() + * createAlert!: boolean; + */ -// @Column() -// autoAcknowledge!: boolean; +/* + * @Column() + * autoAcknowledge!: boolean; + */ -// @Column() -// autoResolve!: boolean; +/* + * @Column() + * autoResolve!: boolean; + */ -// @Column() -// title: { type: string, default !: '' }; +/* + * @Column() + * title: { type: string, default !: '' }; + */ -// @Column() -// description: { type: string, default !: '' }; +/* + * @Column() + * description: { type: string, default !: '' }; + */ -// @Column() -// default !: boolean; +/* + * @Column() + * default !: boolean; + */ -// @Column() -// name!: string; +/* + * @Column() + * name!: string; + */ -// @Column() -// criteria!: { +/* + * @Column() + * criteria!: { + */ -// @Column() -// condition!: string; +/* + * @Column() + * condition!: string; + */ -// @Column() -// criteria!: [Schema.Types.Mixed]; -// }; +/* + * @Column() + * criteria!: [Schema.Types.Mixed]; + * }; + */ -// @Column() -// scripts!: [ -// { - -// @Column() -// script!: { +/* + * @Column() + * scripts!: [ + * { + */ -// @Column() -// type!: Schema.Types.Object; +/* + * @Column() + * script!: { + */ -// @Column() -// ref!: 'AutomationSript'; +/* + * @Column() + * type!: Schema.Types.Object; + */ -// @Column() -// index!: true; -// }; -// }; -// ]; -// } +/* + * @Column() + * ref!: 'AutomationSript'; + */ +/* + * @Column() + * index!: true; + * }; + * }; + * ]; + * } + */ // /** // * SAMPLE STRUCTURE OF HOW CRITERIA WILL BE STRUCTURED IN THE DB // * Depending of on the level, criteria will house all the conditions; // * in addition to nested condition if present (the nested condition will follow the same structural pattern) // * - -// @Column() -// * criteria!: { - -// @Column() -// * condition!: 'and'; - -// @Column() -// * criteria!: [ -// * { - -// @Column() -// * condition!: 'or'; - -// @Column() -// * criteria!: [ -// * { - -// @Column() -// * "responseType"!: "requestBody"; - -// @Column() -// * "filter"!: "equalTo"; - -// @Column() -// * "field1"!: "ok" -// * }; -// * { - -// @Column() -// * "responseType"!: "requestBody"; - -// @Column() -// * "filter"!: "equalTo"; - -// @Column() -// * "field1"!: "healthy" -// * }; -// * { - -// @Column() -// * condition!: 'and'; - -// @Column() -// * criteria!: [{}, {}; ...] -// * } -// * ] -// * }; -// * { - -// @Column() -// * "responseType"!: "statusCode"; - -// @Column() -// * "filter"!: "equalTo"; - -// @Column() -// * "field1"!: "200" -// * }; -// * { - -// @Column() -// * "responseType"!: "requestTime"; - -// @Column() -// * "filter"!: "lessthan"; - + +/* + * @Column() + * * criteria!: { + */ + +/* + * @Column() + * * condition!: 'and'; + */ + +/* + * @Column() + * * criteria!: [ + * * { + */ + +/* + * @Column() + * * condition!: 'or'; + */ + +/* + * @Column() + * * criteria!: [ + * * { + */ + +/* + * @Column() + * * "responseType"!: "requestBody"; + */ + +/* + * @Column() + * * "filter"!: "equalTo"; + */ + +/* + * @Column() + * * "field1"!: "ok" + * * }; + * * { + */ + +/* + * @Column() + * * "responseType"!: "requestBody"; + */ + +/* + * @Column() + * * "filter"!: "equalTo"; + */ + +/* + * @Column() + * * "field1"!: "healthy" + * * }; + * * { + */ + +/* + * @Column() + * * condition!: 'and'; + */ + +/* + * @Column() + * * criteria!: [{}, {}; ...] + * * } + * * ] + * * }; + * * { + */ + +/* + * @Column() + * * "responseType"!: "statusCode"; + */ + +/* + * @Column() + * * "filter"!: "equalTo"; + */ + +/* + * @Column() + * * "field1"!: "200" + * * }; + * * { + */ + +/* + * @Column() + * * "responseType"!: "requestTime"; + */ + +/* + * @Column() + * * "filter"!: "lessthan"; + */ + // @Column() // * "field1"!: "1000" // * }; // * ... // * ] // * } -// */ \ No newline at end of file +// */ diff --git a/Common/Types/Monitor/MonitorCustomFields.ts b/Common/Types/Monitor/MonitorCustomFields.ts index 0f54bfe427..2307831c32 100644 --- a/Common/Types/Monitor/MonitorCustomFields.ts +++ b/Common/Types/Monitor/MonitorCustomFields.ts @@ -1,3 +1 @@ -export default class MonitorCustomFields { - -} \ No newline at end of file +export default class MonitorCustomFields {} diff --git a/Common/Types/Tags.ts b/Common/Types/Tags.ts index 035fc15ab8..42075772e3 100644 --- a/Common/Types/Tags.ts +++ b/Common/Types/Tags.ts @@ -1,3 +1 @@ -export default class Tags { - -} \ No newline at end of file +export default class Tags {}