@oneuptime/common 9.5.0 → 9.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/Models/DatabaseModels/CallLog.ts +61 -0
  2. package/Models/DatabaseModels/EmailLog.ts +61 -0
  3. package/Models/DatabaseModels/PushNotificationLog.ts +61 -0
  4. package/Models/DatabaseModels/SmsLog.ts +61 -0
  5. package/Models/DatabaseModels/WhatsAppLog.ts +59 -0
  6. package/Models/DatabaseModels/WorkspaceNotificationLog.ts +59 -0
  7. package/Server/Infrastructure/Postgres/SchemaMigrations/1770054293299-MigrationName.ts +117 -0
  8. package/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts +2 -0
  9. package/Server/Services/CallService.ts +2 -0
  10. package/Server/Services/MailService.ts +5 -0
  11. package/Server/Services/MonitorService.ts +2 -0
  12. package/Server/Services/PushNotificationService.ts +4 -0
  13. package/Server/Services/SmsService.ts +2 -0
  14. package/Server/Services/UserNotificationSettingService.ts +6 -0
  15. package/Server/Services/WhatsAppService.ts +5 -0
  16. package/build/dist/Models/DatabaseModels/CallLog.js +62 -0
  17. package/build/dist/Models/DatabaseModels/CallLog.js.map +1 -1
  18. package/build/dist/Models/DatabaseModels/EmailLog.js +62 -0
  19. package/build/dist/Models/DatabaseModels/EmailLog.js.map +1 -1
  20. package/build/dist/Models/DatabaseModels/PushNotificationLog.js +62 -0
  21. package/build/dist/Models/DatabaseModels/PushNotificationLog.js.map +1 -1
  22. package/build/dist/Models/DatabaseModels/SmsLog.js +62 -0
  23. package/build/dist/Models/DatabaseModels/SmsLog.js.map +1 -1
  24. package/build/dist/Models/DatabaseModels/WhatsAppLog.js +60 -0
  25. package/build/dist/Models/DatabaseModels/WhatsAppLog.js.map +1 -1
  26. package/build/dist/Models/DatabaseModels/WorkspaceNotificationLog.js +60 -0
  27. package/build/dist/Models/DatabaseModels/WorkspaceNotificationLog.js.map +1 -1
  28. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1770054293299-MigrationName.js +50 -0
  29. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1770054293299-MigrationName.js.map +1 -0
  30. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js +2 -0
  31. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js.map +1 -1
  32. package/build/dist/Server/Services/CallService.js +11 -10
  33. package/build/dist/Server/Services/CallService.js.map +1 -1
  34. package/build/dist/Server/Services/MailService.js +3 -0
  35. package/build/dist/Server/Services/MailService.js.map +1 -1
  36. package/build/dist/Server/Services/MonitorService.js +2 -0
  37. package/build/dist/Server/Services/MonitorService.js.map +1 -1
  38. package/build/dist/Server/Services/PushNotificationService.js +3 -0
  39. package/build/dist/Server/Services/PushNotificationService.js.map +1 -1
  40. package/build/dist/Server/Services/SmsService.js +11 -10
  41. package/build/dist/Server/Services/SmsService.js.map +1 -1
  42. package/build/dist/Server/Services/UserNotificationSettingService.js +5 -0
  43. package/build/dist/Server/Services/UserNotificationSettingService.js.map +1 -1
  44. package/build/dist/Server/Services/WhatsAppService.js +3 -0
  45. package/build/dist/Server/Services/WhatsAppService.js.map +1 -1
  46. package/package.json +1 -1
@@ -1,6 +1,7 @@
1
1
  import Project from "./Project";
2
2
  import Incident from "./Incident";
3
3
  import Alert from "./Alert";
4
+ import Monitor from "./Monitor";
4
5
  import ScheduledMaintenance from "./ScheduledMaintenance";
5
6
  import StatusPage from "./StatusPage";
6
7
  import StatusPageAnnouncement from "./StatusPageAnnouncement";
@@ -464,6 +465,66 @@ export default class CallLog extends BaseModel {
464
465
  })
465
466
  public alertId?: ObjectID = undefined;
466
467
 
468
+ @ColumnAccessControl({
469
+ create: [],
470
+ read: [
471
+ Permission.ProjectOwner,
472
+ Permission.ProjectAdmin,
473
+ Permission.ProjectMember,
474
+ Permission.ReadCallLog,
475
+ Permission.ReadAllProjectResources,
476
+ ],
477
+ update: [],
478
+ })
479
+ @TableColumn({
480
+ manyToOneRelationColumn: "monitorId",
481
+ type: TableColumnType.Entity,
482
+ modelType: Monitor,
483
+ title: "Monitor",
484
+ description: "Monitor associated with this Call (if any)",
485
+ example: "d4e5f6a7-89ab-23de-f456-456789abcdef",
486
+ })
487
+ @ManyToOne(
488
+ () => {
489
+ return Monitor;
490
+ },
491
+ {
492
+ eager: false,
493
+ nullable: true,
494
+ onDelete: "CASCADE",
495
+ orphanedRowAction: "nullify",
496
+ },
497
+ )
498
+ @JoinColumn({ name: "monitorId" })
499
+ public monitor?: Monitor = undefined;
500
+
501
+ @ColumnAccessControl({
502
+ create: [],
503
+ read: [
504
+ Permission.ProjectOwner,
505
+ Permission.ProjectAdmin,
506
+ Permission.ProjectMember,
507
+ Permission.ReadCallLog,
508
+ Permission.ReadAllProjectResources,
509
+ ],
510
+ update: [],
511
+ })
512
+ @Index()
513
+ @TableColumn({
514
+ type: TableColumnType.ObjectID,
515
+ required: false,
516
+ canReadOnRelationQuery: true,
517
+ title: "Monitor ID",
518
+ description: "ID of Monitor associated with this Call (if any)",
519
+ example: "d4e5f6a7-89ab-23de-f456-456789abcdef",
520
+ })
521
+ @Column({
522
+ type: ColumnType.ObjectID,
523
+ nullable: true,
524
+ transformer: ObjectID.getDatabaseTransformer(),
525
+ })
526
+ public monitorId?: ObjectID = undefined;
527
+
467
528
  @ColumnAccessControl({
468
529
  create: [],
469
530
  read: [
@@ -1,6 +1,7 @@
1
1
  import Project from "./Project";
2
2
  import Incident from "./Incident";
3
3
  import Alert from "./Alert";
4
+ import Monitor from "./Monitor";
4
5
  import ScheduledMaintenance from "./ScheduledMaintenance";
5
6
  import StatusPage from "./StatusPage";
6
7
  import ProjectSmtpConfig from "./ProjectSmtpConfig";
@@ -499,6 +500,66 @@ export default class EmailLog extends BaseModel {
499
500
  })
500
501
  public alertId?: ObjectID = undefined;
501
502
 
503
+ @ColumnAccessControl({
504
+ create: [],
505
+ read: [
506
+ Permission.ProjectOwner,
507
+ Permission.ProjectAdmin,
508
+ Permission.ProjectMember,
509
+ Permission.ReadEmailLog,
510
+ Permission.ReadAllProjectResources,
511
+ ],
512
+ update: [],
513
+ })
514
+ @TableColumn({
515
+ manyToOneRelationColumn: "monitorId",
516
+ type: TableColumnType.Entity,
517
+ modelType: Monitor,
518
+ title: "Monitor",
519
+ description: "Monitor associated with this email (if any)",
520
+ example: "d4e5f6a7-89ab-23de-f456-456789abcdef",
521
+ })
522
+ @ManyToOne(
523
+ () => {
524
+ return Monitor;
525
+ },
526
+ {
527
+ eager: false,
528
+ nullable: true,
529
+ onDelete: "CASCADE",
530
+ orphanedRowAction: "nullify",
531
+ },
532
+ )
533
+ @JoinColumn({ name: "monitorId" })
534
+ public monitor?: Monitor = undefined;
535
+
536
+ @ColumnAccessControl({
537
+ create: [],
538
+ read: [
539
+ Permission.ProjectOwner,
540
+ Permission.ProjectAdmin,
541
+ Permission.ProjectMember,
542
+ Permission.ReadEmailLog,
543
+ Permission.ReadAllProjectResources,
544
+ ],
545
+ update: [],
546
+ })
547
+ @Index()
548
+ @TableColumn({
549
+ type: TableColumnType.ObjectID,
550
+ required: false,
551
+ canReadOnRelationQuery: true,
552
+ title: "Monitor ID",
553
+ description: "ID of Monitor associated with this email (if any)",
554
+ example: "d4e5f6a7-89ab-23de-f456-456789abcdef",
555
+ })
556
+ @Column({
557
+ type: ColumnType.ObjectID,
558
+ nullable: true,
559
+ transformer: ObjectID.getDatabaseTransformer(),
560
+ })
561
+ public monitorId?: ObjectID = undefined;
562
+
502
563
  @ColumnAccessControl({
503
564
  create: [],
504
565
  read: [
@@ -1,6 +1,7 @@
1
1
  import Project from "./Project";
2
2
  import Incident from "./Incident";
3
3
  import Alert from "./Alert";
4
+ import Monitor from "./Monitor";
4
5
  import ScheduledMaintenance from "./ScheduledMaintenance";
5
6
  import StatusPage from "./StatusPage";
6
7
  import StatusPageAnnouncement from "./StatusPageAnnouncement";
@@ -458,6 +459,66 @@ export default class PushNotificationLog extends BaseModel {
458
459
  })
459
460
  public alertId?: ObjectID = undefined;
460
461
 
462
+ @ColumnAccessControl({
463
+ create: [],
464
+ read: [
465
+ Permission.ProjectOwner,
466
+ Permission.ProjectAdmin,
467
+ Permission.ProjectMember,
468
+ Permission.ReadPushLog,
469
+ Permission.ReadAllProjectResources,
470
+ ],
471
+ update: [],
472
+ })
473
+ @TableColumn({
474
+ manyToOneRelationColumn: "monitorId",
475
+ type: TableColumnType.Entity,
476
+ modelType: Monitor,
477
+ title: "Monitor",
478
+ description: "Monitor associated with this Push (if any)",
479
+ example: "d4e5f6a7-89ab-23de-f456-456789abcdef",
480
+ })
481
+ @ManyToOne(
482
+ () => {
483
+ return Monitor;
484
+ },
485
+ {
486
+ eager: false,
487
+ nullable: true,
488
+ onDelete: "CASCADE",
489
+ orphanedRowAction: "nullify",
490
+ },
491
+ )
492
+ @JoinColumn({ name: "monitorId" })
493
+ public monitor?: Monitor = undefined;
494
+
495
+ @ColumnAccessControl({
496
+ create: [],
497
+ read: [
498
+ Permission.ProjectOwner,
499
+ Permission.ProjectAdmin,
500
+ Permission.ProjectMember,
501
+ Permission.ReadPushLog,
502
+ Permission.ReadAllProjectResources,
503
+ ],
504
+ update: [],
505
+ })
506
+ @Index()
507
+ @TableColumn({
508
+ type: TableColumnType.ObjectID,
509
+ required: false,
510
+ canReadOnRelationQuery: true,
511
+ title: "Monitor ID",
512
+ description: "ID of Monitor associated with this Push (if any)",
513
+ example: "d4e5f6a7-89ab-23de-f456-456789abcdef",
514
+ })
515
+ @Column({
516
+ type: ColumnType.ObjectID,
517
+ nullable: true,
518
+ transformer: ObjectID.getDatabaseTransformer(),
519
+ })
520
+ public monitorId?: ObjectID = undefined;
521
+
461
522
  @ColumnAccessControl({
462
523
  create: [],
463
524
  read: [
@@ -1,6 +1,7 @@
1
1
  import Project from "./Project";
2
2
  import Incident from "./Incident";
3
3
  import Alert from "./Alert";
4
+ import Monitor from "./Monitor";
4
5
  import ScheduledMaintenance from "./ScheduledMaintenance";
5
6
  import StatusPage from "./StatusPage";
6
7
  import StatusPageAnnouncement from "./StatusPageAnnouncement";
@@ -465,6 +466,66 @@ export default class SmsLog extends BaseModel {
465
466
  })
466
467
  public alertId?: ObjectID = undefined;
467
468
 
469
+ @ColumnAccessControl({
470
+ create: [],
471
+ read: [
472
+ Permission.ProjectOwner,
473
+ Permission.ProjectAdmin,
474
+ Permission.ProjectMember,
475
+ Permission.ReadSmsLog,
476
+ Permission.ReadAllProjectResources,
477
+ ],
478
+ update: [],
479
+ })
480
+ @TableColumn({
481
+ manyToOneRelationColumn: "monitorId",
482
+ type: TableColumnType.Entity,
483
+ modelType: Monitor,
484
+ title: "Monitor",
485
+ description: "Monitor associated with this SMS (if any)",
486
+ example: "d4e5f6a7-89ab-23de-f456-456789abcdef",
487
+ })
488
+ @ManyToOne(
489
+ () => {
490
+ return Monitor;
491
+ },
492
+ {
493
+ eager: false,
494
+ nullable: true,
495
+ onDelete: "CASCADE",
496
+ orphanedRowAction: "nullify",
497
+ },
498
+ )
499
+ @JoinColumn({ name: "monitorId" })
500
+ public monitor?: Monitor = undefined;
501
+
502
+ @ColumnAccessControl({
503
+ create: [],
504
+ read: [
505
+ Permission.ProjectOwner,
506
+ Permission.ProjectAdmin,
507
+ Permission.ProjectMember,
508
+ Permission.ReadSmsLog,
509
+ Permission.ReadAllProjectResources,
510
+ ],
511
+ update: [],
512
+ })
513
+ @Index()
514
+ @TableColumn({
515
+ type: TableColumnType.ObjectID,
516
+ required: false,
517
+ canReadOnRelationQuery: true,
518
+ title: "Monitor ID",
519
+ description: "ID of Monitor associated with this SMS (if any)",
520
+ example: "d4e5f6a7-89ab-23de-f456-456789abcdef",
521
+ })
522
+ @Column({
523
+ type: ColumnType.ObjectID,
524
+ nullable: true,
525
+ transformer: ObjectID.getDatabaseTransformer(),
526
+ })
527
+ public monitorId?: ObjectID = undefined;
528
+
468
529
  @ColumnAccessControl({
469
530
  create: [],
470
531
  read: [
@@ -1,6 +1,7 @@
1
1
  import Project from "./Project";
2
2
  import Incident from "./Incident";
3
3
  import Alert from "./Alert";
4
+ import Monitor from "./Monitor";
4
5
  import ScheduledMaintenance from "./ScheduledMaintenance";
5
6
  import StatusPage from "./StatusPage";
6
7
  import StatusPageAnnouncement from "./StatusPageAnnouncement";
@@ -476,6 +477,64 @@ export default class WhatsAppLog extends BaseModel {
476
477
  })
477
478
  public alertId?: ObjectID = undefined;
478
479
 
480
+ @ColumnAccessControl({
481
+ create: [],
482
+ read: [
483
+ Permission.ProjectOwner,
484
+ Permission.ProjectAdmin,
485
+ Permission.ProjectMember,
486
+ Permission.ReadWhatsAppLog,
487
+ Permission.ReadAllProjectResources,
488
+ ],
489
+ update: [],
490
+ })
491
+ @TableColumn({
492
+ manyToOneRelationColumn: "monitorId",
493
+ type: TableColumnType.Entity,
494
+ modelType: Monitor,
495
+ title: "Monitor",
496
+ description: "Monitor associated with this message (if any)",
497
+ })
498
+ @ManyToOne(
499
+ () => {
500
+ return Monitor;
501
+ },
502
+ {
503
+ eager: false,
504
+ nullable: true,
505
+ onDelete: "CASCADE",
506
+ orphanedRowAction: "nullify",
507
+ },
508
+ )
509
+ @JoinColumn({ name: "monitorId" })
510
+ public monitor?: Monitor = undefined;
511
+
512
+ @ColumnAccessControl({
513
+ create: [],
514
+ read: [
515
+ Permission.ProjectOwner,
516
+ Permission.ProjectAdmin,
517
+ Permission.ProjectMember,
518
+ Permission.ReadWhatsAppLog,
519
+ Permission.ReadAllProjectResources,
520
+ ],
521
+ update: [],
522
+ })
523
+ @Index()
524
+ @TableColumn({
525
+ type: TableColumnType.ObjectID,
526
+ required: false,
527
+ canReadOnRelationQuery: true,
528
+ title: "Monitor ID",
529
+ description: "ID of Monitor associated with this message (if any)",
530
+ })
531
+ @Column({
532
+ type: ColumnType.ObjectID,
533
+ nullable: true,
534
+ transformer: ObjectID.getDatabaseTransformer(),
535
+ })
536
+ public monitorId?: ObjectID = undefined;
537
+
479
538
  @ColumnAccessControl({
480
539
  create: [],
481
540
  read: [
@@ -3,6 +3,7 @@ import Incident from "./Incident";
3
3
  import Alert from "./Alert";
4
4
  import AlertEpisode from "./AlertEpisode";
5
5
  import IncidentEpisode from "./IncidentEpisode";
6
+ import Monitor from "./Monitor";
6
7
  import ScheduledMaintenance from "./ScheduledMaintenance";
7
8
  import StatusPage from "./StatusPage";
8
9
  import StatusPageAnnouncement from "./StatusPageAnnouncement";
@@ -501,6 +502,64 @@ export default class WorkspaceNotificationLog extends BaseModel {
501
502
  })
502
503
  public alertId?: ObjectID = undefined;
503
504
 
505
+ @ColumnAccessControl({
506
+ create: [],
507
+ read: [
508
+ Permission.ProjectOwner,
509
+ Permission.ProjectAdmin,
510
+ Permission.ProjectMember,
511
+ Permission.ReadWorkspaceNotificationLog,
512
+ Permission.ReadAllProjectResources,
513
+ ],
514
+ update: [],
515
+ })
516
+ @TableColumn({
517
+ manyToOneRelationColumn: "monitorId",
518
+ type: TableColumnType.Entity,
519
+ modelType: Monitor,
520
+ title: "Monitor",
521
+ description: "Monitor associated with this message (if any)",
522
+ })
523
+ @ManyToOne(
524
+ () => {
525
+ return Monitor;
526
+ },
527
+ {
528
+ eager: false,
529
+ nullable: true,
530
+ onDelete: "CASCADE",
531
+ orphanedRowAction: "nullify",
532
+ },
533
+ )
534
+ @JoinColumn({ name: "monitorId" })
535
+ public monitor?: Monitor = undefined;
536
+
537
+ @ColumnAccessControl({
538
+ create: [],
539
+ read: [
540
+ Permission.ProjectOwner,
541
+ Permission.ProjectAdmin,
542
+ Permission.ProjectMember,
543
+ Permission.ReadWorkspaceNotificationLog,
544
+ Permission.ReadAllProjectResources,
545
+ ],
546
+ update: [],
547
+ })
548
+ @Index()
549
+ @TableColumn({
550
+ type: TableColumnType.ObjectID,
551
+ required: false,
552
+ canReadOnRelationQuery: true,
553
+ title: "Monitor ID",
554
+ description: "ID of Monitor associated with this message (if any)",
555
+ })
556
+ @Column({
557
+ type: ColumnType.ObjectID,
558
+ nullable: true,
559
+ transformer: ObjectID.getDatabaseTransformer(),
560
+ })
561
+ public monitorId?: ObjectID = undefined;
562
+
504
563
  @ColumnAccessControl({
505
564
  create: [],
506
565
  read: [
@@ -0,0 +1,117 @@
1
+ import { MigrationInterface, QueryRunner } from "typeorm";
2
+
3
+ export class MigrationName1770054293299 implements MigrationInterface {
4
+ public name = "MigrationName1770054293299";
5
+
6
+ public async up(queryRunner: QueryRunner): Promise<void> {
7
+ await queryRunner.query(`ALTER TABLE "CallLog" ADD "monitorId" uuid`);
8
+ await queryRunner.query(`ALTER TABLE "EmailLog" ADD "monitorId" uuid`);
9
+ await queryRunner.query(`ALTER TABLE "SmsLog" ADD "monitorId" uuid`);
10
+ await queryRunner.query(`ALTER TABLE "WhatsAppLog" ADD "monitorId" uuid`);
11
+ await queryRunner.query(
12
+ `ALTER TABLE "PushNotificationLog" ADD "monitorId" uuid`,
13
+ );
14
+ await queryRunner.query(
15
+ `ALTER TABLE "WorkspaceNotificationLog" ADD "monitorId" uuid`,
16
+ );
17
+ await queryRunner.query(
18
+ `ALTER TABLE "OnCallDutyPolicyScheduleLayer" ALTER COLUMN "rotation" SET DEFAULT '{"_type":"Recurring","value":{"intervalType":"Day","intervalCount":{"_type":"PositiveNumber","value":1}}}'`,
19
+ );
20
+ await queryRunner.query(
21
+ `ALTER TABLE "OnCallDutyPolicyScheduleLayer" ALTER COLUMN "restrictionTimes" SET DEFAULT '{"_type":"RestrictionTimes","value":{"restictionType":"None","dayRestrictionTimes":null,"weeklyRestrictionTimes":[]}}'`,
22
+ );
23
+ await queryRunner.query(
24
+ `CREATE INDEX "IDX_dae47ce94b4f0bd1e27f9c5b34" ON "CallLog" ("monitorId") `,
25
+ );
26
+ await queryRunner.query(
27
+ `CREATE INDEX "IDX_51bdfa7eca53b8fbd7e1de3557" ON "EmailLog" ("monitorId") `,
28
+ );
29
+ await queryRunner.query(
30
+ `CREATE INDEX "IDX_0df98915051e60a98a99db94de" ON "SmsLog" ("monitorId") `,
31
+ );
32
+ await queryRunner.query(
33
+ `CREATE INDEX "IDX_6c9e7c1df0058db3cb6d9a6e96" ON "WhatsAppLog" ("monitorId") `,
34
+ );
35
+ await queryRunner.query(
36
+ `CREATE INDEX "IDX_be5e4a65d5e061fa3e40dae6df" ON "PushNotificationLog" ("monitorId") `,
37
+ );
38
+ await queryRunner.query(
39
+ `CREATE INDEX "IDX_c8788e8f074fc4f8e9efd08af7" ON "WorkspaceNotificationLog" ("monitorId") `,
40
+ );
41
+ await queryRunner.query(
42
+ `ALTER TABLE "CallLog" ADD CONSTRAINT "FK_dae47ce94b4f0bd1e27f9c5b345" FOREIGN KEY ("monitorId") REFERENCES "Monitor"("_id") ON DELETE CASCADE ON UPDATE NO ACTION`,
43
+ );
44
+ await queryRunner.query(
45
+ `ALTER TABLE "EmailLog" ADD CONSTRAINT "FK_51bdfa7eca53b8fbd7e1de35573" FOREIGN KEY ("monitorId") REFERENCES "Monitor"("_id") ON DELETE CASCADE ON UPDATE NO ACTION`,
46
+ );
47
+ await queryRunner.query(
48
+ `ALTER TABLE "SmsLog" ADD CONSTRAINT "FK_0df98915051e60a98a99db94de0" FOREIGN KEY ("monitorId") REFERENCES "Monitor"("_id") ON DELETE CASCADE ON UPDATE NO ACTION`,
49
+ );
50
+ await queryRunner.query(
51
+ `ALTER TABLE "WhatsAppLog" ADD CONSTRAINT "FK_6c9e7c1df0058db3cb6d9a6e965" FOREIGN KEY ("monitorId") REFERENCES "Monitor"("_id") ON DELETE CASCADE ON UPDATE NO ACTION`,
52
+ );
53
+ await queryRunner.query(
54
+ `ALTER TABLE "PushNotificationLog" ADD CONSTRAINT "FK_be5e4a65d5e061fa3e40dae6dff" FOREIGN KEY ("monitorId") REFERENCES "Monitor"("_id") ON DELETE CASCADE ON UPDATE NO ACTION`,
55
+ );
56
+ await queryRunner.query(
57
+ `ALTER TABLE "WorkspaceNotificationLog" ADD CONSTRAINT "FK_c8788e8f074fc4f8e9efd08af76" FOREIGN KEY ("monitorId") REFERENCES "Monitor"("_id") ON DELETE CASCADE ON UPDATE NO ACTION`,
58
+ );
59
+ }
60
+
61
+ public async down(queryRunner: QueryRunner): Promise<void> {
62
+ await queryRunner.query(
63
+ `ALTER TABLE "WorkspaceNotificationLog" DROP CONSTRAINT "FK_c8788e8f074fc4f8e9efd08af76"`,
64
+ );
65
+ await queryRunner.query(
66
+ `ALTER TABLE "PushNotificationLog" DROP CONSTRAINT "FK_be5e4a65d5e061fa3e40dae6dff"`,
67
+ );
68
+ await queryRunner.query(
69
+ `ALTER TABLE "WhatsAppLog" DROP CONSTRAINT "FK_6c9e7c1df0058db3cb6d9a6e965"`,
70
+ );
71
+ await queryRunner.query(
72
+ `ALTER TABLE "SmsLog" DROP CONSTRAINT "FK_0df98915051e60a98a99db94de0"`,
73
+ );
74
+ await queryRunner.query(
75
+ `ALTER TABLE "EmailLog" DROP CONSTRAINT "FK_51bdfa7eca53b8fbd7e1de35573"`,
76
+ );
77
+ await queryRunner.query(
78
+ `ALTER TABLE "CallLog" DROP CONSTRAINT "FK_dae47ce94b4f0bd1e27f9c5b345"`,
79
+ );
80
+ await queryRunner.query(
81
+ `DROP INDEX "public"."IDX_c8788e8f074fc4f8e9efd08af7"`,
82
+ );
83
+ await queryRunner.query(
84
+ `DROP INDEX "public"."IDX_be5e4a65d5e061fa3e40dae6df"`,
85
+ );
86
+ await queryRunner.query(
87
+ `DROP INDEX "public"."IDX_6c9e7c1df0058db3cb6d9a6e96"`,
88
+ );
89
+ await queryRunner.query(
90
+ `DROP INDEX "public"."IDX_0df98915051e60a98a99db94de"`,
91
+ );
92
+ await queryRunner.query(
93
+ `DROP INDEX "public"."IDX_51bdfa7eca53b8fbd7e1de3557"`,
94
+ );
95
+ await queryRunner.query(
96
+ `DROP INDEX "public"."IDX_dae47ce94b4f0bd1e27f9c5b34"`,
97
+ );
98
+ await queryRunner.query(
99
+ `ALTER TABLE "OnCallDutyPolicyScheduleLayer" ALTER COLUMN "restrictionTimes" SET DEFAULT '{"_type": "RestrictionTimes", "value": {"restictionType": "None", "dayRestrictionTimes": null, "weeklyRestrictionTimes": []}}'`,
100
+ );
101
+ await queryRunner.query(
102
+ `ALTER TABLE "OnCallDutyPolicyScheduleLayer" ALTER COLUMN "rotation" SET DEFAULT '{"_type": "Recurring", "value": {"intervalType": "Day", "intervalCount": {"_type": "PositiveNumber", "value": 1}}}'`,
103
+ );
104
+ await queryRunner.query(
105
+ `ALTER TABLE "WorkspaceNotificationLog" DROP COLUMN "monitorId"`,
106
+ );
107
+ await queryRunner.query(
108
+ `ALTER TABLE "PushNotificationLog" DROP COLUMN "monitorId"`,
109
+ );
110
+ await queryRunner.query(
111
+ `ALTER TABLE "WhatsAppLog" DROP COLUMN "monitorId"`,
112
+ );
113
+ await queryRunner.query(`ALTER TABLE "SmsLog" DROP COLUMN "monitorId"`);
114
+ await queryRunner.query(`ALTER TABLE "EmailLog" DROP COLUMN "monitorId"`);
115
+ await queryRunner.query(`ALTER TABLE "CallLog" DROP COLUMN "monitorId"`);
116
+ }
117
+ }
@@ -248,6 +248,7 @@ import { MigrationName1769772215532 } from "./1769772215532-MigrationName";
248
248
  import { MigrationName1769774527481 } from "./1769774527481-MigrationName";
249
249
  import { MigrationName1769780297584 } from "./1769780297584-MigrationName";
250
250
  import { MigrationName1769802715014 } from "./1769802715014-MigrationName";
251
+ import { MigrationName1770054293299 } from "./1770054293299-MigrationName";
251
252
 
252
253
  export default [
253
254
  InitialMigration,
@@ -500,4 +501,5 @@ export default [
500
501
  MigrationName1769774527481,
501
502
  MigrationName1769780297584,
502
503
  MigrationName1769802715014,
504
+ MigrationName1770054293299,
503
505
  ];
@@ -30,6 +30,7 @@ export class CallService extends BaseService {
30
30
  alertId?: ObjectID | undefined;
31
31
  alertEpisodeId?: ObjectID | undefined;
32
32
  incidentEpisodeId?: ObjectID | undefined;
33
+ monitorId?: ObjectID | undefined;
33
34
  scheduledMaintenanceId?: ObjectID | undefined;
34
35
  statusPageId?: ObjectID | undefined;
35
36
  statusPageAnnouncementId?: ObjectID | undefined;
@@ -60,6 +61,7 @@ export class CallService extends BaseService {
60
61
  incidentId: options.incidentId?.toString(),
61
62
  alertId: options.alertId?.toString(),
62
63
  alertEpisodeId: options.alertEpisodeId?.toString(),
64
+ monitorId: options.monitorId?.toString(),
63
65
  scheduledMaintenanceId: options.scheduledMaintenanceId?.toString(),
64
66
  statusPageId: options.statusPageId?.toString(),
65
67
  statusPageAnnouncementId: options.statusPageAnnouncementId?.toString(),
@@ -25,6 +25,7 @@ export class MailService extends BaseService {
25
25
  alertId?: ObjectID | undefined;
26
26
  alertEpisodeId?: ObjectID | undefined;
27
27
  incidentEpisodeId?: ObjectID | undefined;
28
+ monitorId?: ObjectID | undefined;
28
29
  scheduledMaintenanceId?: ObjectID | undefined;
29
30
  statusPageId?: ObjectID | undefined;
30
31
  statusPageAnnouncementId?: ObjectID | undefined;
@@ -74,6 +75,10 @@ export class MailService extends BaseService {
74
75
  body["alertEpisodeId"] = options.alertEpisodeId.toString();
75
76
  }
76
77
 
78
+ if (options?.monitorId) {
79
+ body["monitorId"] = options.monitorId.toString();
80
+ }
81
+
77
82
  if (options?.scheduledMaintenanceId) {
78
83
  body["scheduledMaintenanceId"] =
79
84
  options.scheduledMaintenanceId.toString();
@@ -1314,6 +1314,7 @@ ${createdItem.description?.trim() || "No description provided."}
1314
1314
  }),
1315
1315
  whatsAppMessage,
1316
1316
  eventType,
1317
+ monitorId: monitor.id!,
1317
1318
  });
1318
1319
  }
1319
1320
  }
@@ -1440,6 +1441,7 @@ ${createdItem.description?.trim() || "No description provided."}
1440
1441
  }),
1441
1442
  whatsAppMessage,
1442
1443
  eventType,
1444
+ monitorId: monitor.id!,
1443
1445
  });
1444
1446
  }
1445
1447
  }
@@ -26,6 +26,7 @@ export interface PushNotificationOptions {
26
26
  incidentId?: ObjectID | undefined;
27
27
  alertId?: ObjectID | undefined;
28
28
  alertEpisodeId?: ObjectID | undefined;
29
+ monitorId?: ObjectID | undefined;
29
30
  scheduledMaintenanceId?: ObjectID | undefined;
30
31
  statusPageId?: ObjectID | undefined;
31
32
  statusPageAnnouncementId?: ObjectID | undefined;
@@ -163,6 +164,9 @@ export default class PushNotificationService {
163
164
  if (options.alertId) {
164
165
  log.alertId = options.alertId;
165
166
  }
167
+ if (options.monitorId) {
168
+ log.monitorId = options.monitorId;
169
+ }
166
170
  if (options.scheduledMaintenanceId) {
167
171
  log.scheduledMaintenanceId = options.scheduledMaintenanceId;
168
172
  }
@@ -30,6 +30,7 @@ export class SmsService extends BaseService {
30
30
  alertId?: ObjectID | undefined;
31
31
  alertEpisodeId?: ObjectID | undefined;
32
32
  incidentEpisodeId?: ObjectID | undefined;
33
+ monitorId?: ObjectID | undefined;
33
34
  scheduledMaintenanceId?: ObjectID | undefined;
34
35
  statusPageId?: ObjectID | undefined;
35
36
  statusPageAnnouncementId?: ObjectID | undefined;
@@ -61,6 +62,7 @@ export class SmsService extends BaseService {
61
62
  incidentId: options.incidentId?.toString(),
62
63
  alertId: options.alertId?.toString(),
63
64
  alertEpisodeId: options.alertEpisodeId?.toString(),
65
+ monitorId: options.monitorId?.toString(),
64
66
  scheduledMaintenanceId: options.scheduledMaintenanceId?.toString(),
65
67
  statusPageId: options.statusPageId?.toString(),
66
68
  statusPageAnnouncementId: options.statusPageAnnouncementId?.toString(),