@oneuptime/common 8.0.5312 → 8.0.5326

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 (124) hide show
  1. package/Models/DatabaseModels/GlobalConfig.ts +90 -0
  2. package/Models/DatabaseModels/Index.ts +4 -0
  3. package/Models/DatabaseModels/Project.ts +27 -0
  4. package/Models/DatabaseModels/UserNotificationRule.ts +48 -0
  5. package/Models/DatabaseModels/UserNotificationSetting.ts +16 -0
  6. package/Models/DatabaseModels/UserOnCallLogTimeline.ts +48 -0
  7. package/Models/DatabaseModels/UserWhatsApp.ts +288 -0
  8. package/Models/DatabaseModels/WhatsAppLog.ts +884 -0
  9. package/Server/API/NotificationAPI.ts +4 -4
  10. package/Server/API/ProjectSSO.ts +41 -33
  11. package/Server/API/ShortLinkAPI.ts +33 -25
  12. package/Server/API/UserCallAPI.ts +82 -73
  13. package/Server/API/UserEmailAPI.ts +82 -73
  14. package/Server/API/UserOnCallLogTimelineAPI.ts +227 -214
  15. package/Server/API/UserPushAPI.ts +177 -169
  16. package/Server/API/UserSmsAPI.ts +82 -73
  17. package/Server/API/UserWhatsAppAPI.ts +136 -0
  18. package/Server/Infrastructure/Postgres/SchemaMigrations/1759838763506-MigrationName.ts +105 -0
  19. package/Server/Infrastructure/Postgres/SchemaMigrations/1759839342566-MigrationName.ts +71 -0
  20. package/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts +4 -0
  21. package/Server/Services/Index.ts +4 -0
  22. package/Server/Services/MonitorService.ts +32 -4
  23. package/Server/Services/OnCallDutyPolicyEscalationRuleScheduleService.ts +36 -4
  24. package/Server/Services/OnCallDutyPolicyEscalationRuleTeamService.ts +34 -4
  25. package/Server/Services/OnCallDutyPolicyEscalationRuleUserService.ts +34 -4
  26. package/Server/Services/OnCallDutyPolicyScheduleService.ts +47 -6
  27. package/Server/Services/ProbeService.ts +17 -2
  28. package/Server/Services/UserNotificationRuleService.ts +258 -7
  29. package/Server/Services/UserNotificationSettingService.ts +60 -0
  30. package/Server/Services/UserWhatsAppService.ts +203 -0
  31. package/Server/Services/WhatsAppLogService.ts +15 -0
  32. package/Server/Services/WhatsAppService.ts +141 -0
  33. package/Server/Types/Workflow/Components/BaseModel/OnTriggerBaseModel.ts +17 -5
  34. package/Server/Types/Workflow/Components/Webhook.ts +2 -2
  35. package/Server/Utils/StartServer.ts +57 -31
  36. package/Server/Utils/WhatsAppTemplateUtil.ts +247 -0
  37. package/Types/Icon/IconProp.ts +1 -0
  38. package/Types/WhatsApp/WhatsAppMessage.ts +12 -0
  39. package/Types/WhatsApp/WhatsAppTemplates.ts +197 -0
  40. package/Types/WhatsAppStatus.ts +8 -0
  41. package/UI/Components/Icon/Icon.tsx +12 -0
  42. package/build/dist/Models/DatabaseModels/GlobalConfig.js +98 -0
  43. package/build/dist/Models/DatabaseModels/GlobalConfig.js.map +1 -1
  44. package/build/dist/Models/DatabaseModels/Index.js +4 -0
  45. package/build/dist/Models/DatabaseModels/Index.js.map +1 -1
  46. package/build/dist/Models/DatabaseModels/Project.js +29 -0
  47. package/build/dist/Models/DatabaseModels/Project.js.map +1 -1
  48. package/build/dist/Models/DatabaseModels/UserNotificationRule.js +48 -0
  49. package/build/dist/Models/DatabaseModels/UserNotificationRule.js.map +1 -1
  50. package/build/dist/Models/DatabaseModels/UserNotificationSetting.js +18 -0
  51. package/build/dist/Models/DatabaseModels/UserNotificationSetting.js.map +1 -1
  52. package/build/dist/Models/DatabaseModels/UserOnCallLogTimeline.js +48 -0
  53. package/build/dist/Models/DatabaseModels/UserOnCallLogTimeline.js.map +1 -1
  54. package/build/dist/Models/DatabaseModels/UserWhatsApp.js +308 -0
  55. package/build/dist/Models/DatabaseModels/UserWhatsApp.js.map +1 -0
  56. package/build/dist/Models/DatabaseModels/WhatsAppLog.js +911 -0
  57. package/build/dist/Models/DatabaseModels/WhatsAppLog.js.map +1 -0
  58. package/build/dist/Server/API/NotificationAPI.js +2 -2
  59. package/build/dist/Server/API/NotificationAPI.js.map +1 -1
  60. package/build/dist/Server/API/ProjectSSO.js +26 -21
  61. package/build/dist/Server/API/ProjectSSO.js.map +1 -1
  62. package/build/dist/Server/API/ShortLinkAPI.js +17 -12
  63. package/build/dist/Server/API/ShortLinkAPI.js.map +1 -1
  64. package/build/dist/Server/API/UserCallAPI.js +54 -44
  65. package/build/dist/Server/API/UserCallAPI.js.map +1 -1
  66. package/build/dist/Server/API/UserEmailAPI.js +54 -44
  67. package/build/dist/Server/API/UserEmailAPI.js.map +1 -1
  68. package/build/dist/Server/API/UserOnCallLogTimelineAPI.js +142 -127
  69. package/build/dist/Server/API/UserOnCallLogTimelineAPI.js.map +1 -1
  70. package/build/dist/Server/API/UserPushAPI.js +111 -96
  71. package/build/dist/Server/API/UserPushAPI.js.map +1 -1
  72. package/build/dist/Server/API/UserSmsAPI.js +54 -44
  73. package/build/dist/Server/API/UserSmsAPI.js.map +1 -1
  74. package/build/dist/Server/API/UserWhatsAppAPI.js +76 -0
  75. package/build/dist/Server/API/UserWhatsAppAPI.js.map +1 -0
  76. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1759838763506-MigrationName.js +42 -0
  77. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1759838763506-MigrationName.js.map +1 -0
  78. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1759839342566-MigrationName.js +30 -0
  79. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1759839342566-MigrationName.js.map +1 -0
  80. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js +4 -0
  81. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js.map +1 -1
  82. package/build/dist/Server/Services/Index.js +4 -0
  83. package/build/dist/Server/Services/Index.js.map +1 -1
  84. package/build/dist/Server/Services/MonitorService.js +23 -2
  85. package/build/dist/Server/Services/MonitorService.js.map +1 -1
  86. package/build/dist/Server/Services/OnCallDutyPolicyEscalationRuleScheduleService.js +29 -6
  87. package/build/dist/Server/Services/OnCallDutyPolicyEscalationRuleScheduleService.js.map +1 -1
  88. package/build/dist/Server/Services/OnCallDutyPolicyEscalationRuleTeamService.js +27 -6
  89. package/build/dist/Server/Services/OnCallDutyPolicyEscalationRuleTeamService.js.map +1 -1
  90. package/build/dist/Server/Services/OnCallDutyPolicyEscalationRuleUserService.js +26 -5
  91. package/build/dist/Server/Services/OnCallDutyPolicyEscalationRuleUserService.js.map +1 -1
  92. package/build/dist/Server/Services/OnCallDutyPolicyScheduleService.js +34 -3
  93. package/build/dist/Server/Services/OnCallDutyPolicyScheduleService.js.map +1 -1
  94. package/build/dist/Server/Services/ProbeService.js +12 -1
  95. package/build/dist/Server/Services/ProbeService.js.map +1 -1
  96. package/build/dist/Server/Services/UserNotificationRuleService.js +196 -19
  97. package/build/dist/Server/Services/UserNotificationRuleService.js.map +1 -1
  98. package/build/dist/Server/Services/UserNotificationSettingService.js +45 -0
  99. package/build/dist/Server/Services/UserNotificationSettingService.js.map +1 -1
  100. package/build/dist/Server/Services/UserWhatsAppService.js +179 -0
  101. package/build/dist/Server/Services/UserWhatsAppService.js.map +1 -0
  102. package/build/dist/Server/Services/WhatsAppLogService.js +13 -0
  103. package/build/dist/Server/Services/WhatsAppLogService.js.map +1 -0
  104. package/build/dist/Server/Services/WhatsAppService.js +103 -0
  105. package/build/dist/Server/Services/WhatsAppService.js.map +1 -0
  106. package/build/dist/Server/Types/Workflow/Components/BaseModel/OnTriggerBaseModel.js +14 -4
  107. package/build/dist/Server/Types/Workflow/Components/BaseModel/OnTriggerBaseModel.js.map +1 -1
  108. package/build/dist/Server/Types/Workflow/Components/Webhook.js +2 -2
  109. package/build/dist/Server/Types/Workflow/Components/Webhook.js.map +1 -1
  110. package/build/dist/Server/Utils/StartServer.js +41 -19
  111. package/build/dist/Server/Utils/StartServer.js.map +1 -1
  112. package/build/dist/Server/Utils/WhatsAppTemplateUtil.js +124 -0
  113. package/build/dist/Server/Utils/WhatsAppTemplateUtil.js.map +1 -0
  114. package/build/dist/Types/Icon/IconProp.js +1 -0
  115. package/build/dist/Types/Icon/IconProp.js.map +1 -1
  116. package/build/dist/Types/WhatsApp/WhatsAppMessage.js +2 -0
  117. package/build/dist/Types/WhatsApp/WhatsAppMessage.js.map +1 -0
  118. package/build/dist/Types/WhatsApp/WhatsAppTemplates.js +118 -0
  119. package/build/dist/Types/WhatsApp/WhatsAppTemplates.js.map +1 -0
  120. package/build/dist/Types/WhatsAppStatus.js +9 -0
  121. package/build/dist/Types/WhatsAppStatus.js.map +1 -0
  122. package/build/dist/UI/Components/Icon/Icon.js +6 -0
  123. package/build/dist/UI/Components/Icon/Icon.js.map +1 -1
  124. package/package.json +1 -1
@@ -0,0 +1,884 @@
1
+ import Project from "./Project";
2
+ import Incident from "./Incident";
3
+ import Alert from "./Alert";
4
+ import ScheduledMaintenance from "./ScheduledMaintenance";
5
+ import StatusPage from "./StatusPage";
6
+ import StatusPageAnnouncement from "./StatusPageAnnouncement";
7
+ import User from "./User";
8
+ import OnCallDutyPolicy from "./OnCallDutyPolicy";
9
+ import OnCallDutyPolicyEscalationRule from "./OnCallDutyPolicyEscalationRule";
10
+ import OnCallDutyPolicySchedule from "./OnCallDutyPolicySchedule";
11
+ import Team from "./Team";
12
+ import BaseModel from "./DatabaseBaseModel/DatabaseBaseModel";
13
+ import Route from "../../Types/API/Route";
14
+ import ColumnAccessControl from "../../Types/Database/AccessControl/ColumnAccessControl";
15
+ import TableAccessControl from "../../Types/Database/AccessControl/TableAccessControl";
16
+ import ColumnLength from "../../Types/Database/ColumnLength";
17
+ import ColumnType from "../../Types/Database/ColumnType";
18
+ import CrudApiEndpoint from "../../Types/Database/CrudApiEndpoint";
19
+ import EnableDocumentation from "../../Types/Database/EnableDocumentation";
20
+ import EnableWorkflow from "../../Types/Database/EnableWorkflow";
21
+ import TableColumn from "../../Types/Database/TableColumn";
22
+ import TableColumnType from "../../Types/Database/TableColumnType";
23
+ import TableMetadata from "../../Types/Database/TableMetadata";
24
+ import TenantColumn from "../../Types/Database/TenantColumn";
25
+ import IconProp from "../../Types/Icon/IconProp";
26
+ import ObjectID from "../../Types/ObjectID";
27
+ import Permission from "../../Types/Permission";
28
+ import Phone from "../../Types/Phone";
29
+ import WhatsAppStatus from "../../Types/WhatsAppStatus";
30
+ import { Column, Entity, Index, JoinColumn, ManyToOne } from "typeorm";
31
+
32
+ @EnableDocumentation()
33
+ @TenantColumn("projectId")
34
+ @TableAccessControl({
35
+ create: [],
36
+ read: [
37
+ Permission.ProjectOwner,
38
+ Permission.ProjectAdmin,
39
+ Permission.ProjectMember,
40
+ Permission.ReadSmsLog,
41
+ ],
42
+ delete: [],
43
+ update: [],
44
+ })
45
+ @CrudApiEndpoint(new Route("/whatsapp-log"))
46
+ @Entity({
47
+ name: "WhatsAppLog",
48
+ })
49
+ @EnableWorkflow({
50
+ create: true,
51
+ delete: false,
52
+ update: false,
53
+ })
54
+ @TableMetadata({
55
+ tableName: "WhatsAppLog",
56
+ singularName: "WhatsApp Log",
57
+ pluralName: "WhatsApp Logs",
58
+ icon: IconProp.WhatsApp,
59
+ tableDescription:
60
+ "Logs of all the WhatsApp messages sent out to all users and subscribers for this project.",
61
+ })
62
+ export default class WhatsAppLog extends BaseModel {
63
+ @ColumnAccessControl({
64
+ create: [],
65
+ read: [
66
+ Permission.ProjectOwner,
67
+ Permission.ProjectAdmin,
68
+ Permission.ProjectMember,
69
+ Permission.ReadSmsLog,
70
+ ],
71
+ update: [],
72
+ })
73
+ @TableColumn({
74
+ manyToOneRelationColumn: "projectId",
75
+ type: TableColumnType.Entity,
76
+ modelType: Project,
77
+ title: "Project",
78
+ description: "Relation to Project Resource in which this object belongs",
79
+ })
80
+ @ManyToOne(
81
+ () => {
82
+ return Project;
83
+ },
84
+ {
85
+ eager: false,
86
+ nullable: true,
87
+ onDelete: "CASCADE",
88
+ orphanedRowAction: "nullify",
89
+ },
90
+ )
91
+ @JoinColumn({ name: "projectId" })
92
+ public project?: Project = undefined;
93
+
94
+ @ColumnAccessControl({
95
+ create: [],
96
+ read: [
97
+ Permission.ProjectOwner,
98
+ Permission.ProjectAdmin,
99
+ Permission.ProjectMember,
100
+ Permission.ReadSmsLog,
101
+ ],
102
+ update: [],
103
+ })
104
+ @Index()
105
+ @TableColumn({
106
+ type: TableColumnType.ObjectID,
107
+ required: true,
108
+ canReadOnRelationQuery: true,
109
+ title: "Project ID",
110
+ description: "ID of your OneUptime Project in which this object belongs",
111
+ })
112
+ @Column({
113
+ type: ColumnType.ObjectID,
114
+ nullable: false,
115
+ transformer: ObjectID.getDatabaseTransformer(),
116
+ })
117
+ public projectId?: ObjectID = undefined;
118
+
119
+ @ColumnAccessControl({
120
+ create: [],
121
+ read: [
122
+ Permission.ProjectOwner,
123
+ Permission.ProjectAdmin,
124
+ Permission.ProjectMember,
125
+ Permission.ReadSmsLog,
126
+ ],
127
+ update: [],
128
+ })
129
+ @Index()
130
+ @TableColumn({
131
+ required: true,
132
+ type: TableColumnType.Phone,
133
+ title: "To Number",
134
+ description: "Phone Number WhatsApp message was sent to",
135
+ canReadOnRelationQuery: false,
136
+ })
137
+ @Column({
138
+ nullable: false,
139
+ type: ColumnType.Phone,
140
+ length: ColumnLength.Phone,
141
+ transformer: Phone.getDatabaseTransformer(),
142
+ })
143
+ public toNumber?: Phone = undefined;
144
+
145
+ @ColumnAccessControl({
146
+ create: [],
147
+ read: [
148
+ Permission.ProjectOwner,
149
+ Permission.ProjectAdmin,
150
+ Permission.ProjectMember,
151
+ Permission.ReadSmsLog,
152
+ ],
153
+ update: [],
154
+ })
155
+ @Index()
156
+ @TableColumn({
157
+ required: false,
158
+ type: TableColumnType.Phone,
159
+ title: "From Number",
160
+ description:
161
+ "Phone Number WhatsApp message was sent from (Business Number ID)",
162
+ canReadOnRelationQuery: false,
163
+ })
164
+ @Column({
165
+ nullable: true,
166
+ type: ColumnType.Phone,
167
+ length: ColumnLength.Phone,
168
+ transformer: Phone.getDatabaseTransformer(),
169
+ })
170
+ public fromNumber?: Phone = undefined;
171
+
172
+ @ColumnAccessControl({
173
+ create: [],
174
+ read: [
175
+ Permission.ProjectOwner,
176
+ Permission.ProjectAdmin,
177
+ Permission.ProjectMember,
178
+ Permission.ReadSmsLog,
179
+ ],
180
+ update: [],
181
+ })
182
+ @TableColumn({
183
+ required: false,
184
+ type: TableColumnType.VeryLongText,
185
+ title: "Message Text",
186
+ description: "Text content of the WhatsApp message",
187
+ canReadOnRelationQuery: false,
188
+ })
189
+ @Column({
190
+ nullable: true,
191
+ type: ColumnType.VeryLongText,
192
+ })
193
+ public messageText?: string = undefined;
194
+
195
+ @ColumnAccessControl({
196
+ create: [],
197
+ read: [
198
+ Permission.ProjectOwner,
199
+ Permission.ProjectAdmin,
200
+ Permission.ProjectMember,
201
+ Permission.ReadSmsLog,
202
+ ],
203
+ update: [],
204
+ })
205
+ @TableColumn({
206
+ required: false,
207
+ type: TableColumnType.LongText,
208
+ title: "Status Message",
209
+ description: "Status Message (if any)",
210
+ canReadOnRelationQuery: false,
211
+ })
212
+ @Column({
213
+ nullable: true,
214
+ type: ColumnType.LongText,
215
+ length: ColumnLength.LongText,
216
+ })
217
+ public statusMessage?: string = undefined;
218
+
219
+ @ColumnAccessControl({
220
+ create: [],
221
+ read: [
222
+ Permission.ProjectOwner,
223
+ Permission.ProjectAdmin,
224
+ Permission.ProjectMember,
225
+ Permission.ReadSmsLog,
226
+ ],
227
+ update: [],
228
+ })
229
+ @TableColumn({
230
+ required: true,
231
+ type: TableColumnType.ShortText,
232
+ title: "Status of the WhatsApp Message",
233
+ description: "Status of the WhatsApp message sent",
234
+ canReadOnRelationQuery: false,
235
+ })
236
+ @Column({
237
+ nullable: false,
238
+ type: ColumnType.ShortText,
239
+ length: ColumnLength.ShortText,
240
+ })
241
+ public status?: WhatsAppStatus = undefined;
242
+
243
+ @ColumnAccessControl({
244
+ create: [],
245
+ read: [
246
+ Permission.ProjectOwner,
247
+ Permission.ProjectAdmin,
248
+ Permission.ProjectMember,
249
+ Permission.ReadSmsLog,
250
+ ],
251
+ update: [],
252
+ })
253
+ @Index()
254
+ @TableColumn({
255
+ required: true,
256
+ type: TableColumnType.Number,
257
+ title: "WhatsApp Cost",
258
+ description: "WhatsApp Message Cost in USD Cents",
259
+ canReadOnRelationQuery: false,
260
+ isDefaultValueColumn: true,
261
+ defaultValue: 0,
262
+ })
263
+ @Column({
264
+ nullable: false,
265
+ default: 0,
266
+ type: ColumnType.Number,
267
+ })
268
+ public whatsAppCostInUSDCents?: number = undefined;
269
+
270
+ @ColumnAccessControl({
271
+ create: [],
272
+ read: [
273
+ Permission.ProjectOwner,
274
+ Permission.ProjectAdmin,
275
+ Permission.ProjectMember,
276
+ Permission.ReadSmsLog,
277
+ ],
278
+ update: [],
279
+ })
280
+ @TableColumn({
281
+ manyToOneRelationColumn: "incidentId",
282
+ type: TableColumnType.Entity,
283
+ modelType: Incident,
284
+ title: "Incident",
285
+ description: "Incident associated with this message (if any)",
286
+ })
287
+ @ManyToOne(
288
+ () => {
289
+ return Incident;
290
+ },
291
+ {
292
+ eager: false,
293
+ nullable: true,
294
+ onDelete: "CASCADE",
295
+ orphanedRowAction: "nullify",
296
+ },
297
+ )
298
+ @JoinColumn({ name: "incidentId" })
299
+ public incident?: Incident = undefined;
300
+
301
+ @ColumnAccessControl({
302
+ create: [],
303
+ read: [
304
+ Permission.ProjectOwner,
305
+ Permission.ProjectAdmin,
306
+ Permission.ProjectMember,
307
+ Permission.ReadSmsLog,
308
+ ],
309
+ update: [],
310
+ })
311
+ @Index()
312
+ @TableColumn({
313
+ type: TableColumnType.ObjectID,
314
+ required: false,
315
+ canReadOnRelationQuery: true,
316
+ title: "Incident ID",
317
+ description: "ID of Incident associated with this message (if any)",
318
+ })
319
+ @Column({
320
+ type: ColumnType.ObjectID,
321
+ nullable: true,
322
+ transformer: ObjectID.getDatabaseTransformer(),
323
+ })
324
+ public incidentId?: ObjectID = undefined;
325
+
326
+ @ColumnAccessControl({
327
+ create: [],
328
+ read: [
329
+ Permission.ProjectOwner,
330
+ Permission.ProjectAdmin,
331
+ Permission.ProjectMember,
332
+ Permission.ReadSmsLog,
333
+ ],
334
+ update: [],
335
+ })
336
+ @TableColumn({
337
+ manyToOneRelationColumn: "userId",
338
+ type: TableColumnType.Entity,
339
+ modelType: User,
340
+ title: "User",
341
+ description: "User who initiated this message (if any)",
342
+ })
343
+ @ManyToOne(
344
+ () => {
345
+ return User;
346
+ },
347
+ {
348
+ eager: false,
349
+ nullable: true,
350
+ onDelete: "CASCADE",
351
+ orphanedRowAction: "nullify",
352
+ },
353
+ )
354
+ @JoinColumn({ name: "userId" })
355
+ public user?: User = undefined;
356
+
357
+ @ColumnAccessControl({
358
+ create: [],
359
+ read: [
360
+ Permission.ProjectOwner,
361
+ Permission.ProjectAdmin,
362
+ Permission.ProjectMember,
363
+ Permission.ReadSmsLog,
364
+ ],
365
+ update: [],
366
+ })
367
+ @Index()
368
+ @TableColumn({
369
+ type: TableColumnType.ObjectID,
370
+ required: false,
371
+ canReadOnRelationQuery: true,
372
+ title: "User ID",
373
+ description: "ID of User who initiated this message (if any)",
374
+ })
375
+ @Column({
376
+ type: ColumnType.ObjectID,
377
+ nullable: true,
378
+ transformer: ObjectID.getDatabaseTransformer(),
379
+ })
380
+ public userId?: ObjectID = undefined;
381
+
382
+ @ColumnAccessControl({
383
+ create: [],
384
+ read: [
385
+ Permission.ProjectOwner,
386
+ Permission.ProjectAdmin,
387
+ Permission.ProjectMember,
388
+ Permission.ReadSmsLog,
389
+ ],
390
+ update: [],
391
+ })
392
+ @TableColumn({
393
+ manyToOneRelationColumn: "alertId",
394
+ type: TableColumnType.Entity,
395
+ modelType: Alert,
396
+ title: "Alert",
397
+ description: "Alert associated with this message (if any)",
398
+ })
399
+ @ManyToOne(
400
+ () => {
401
+ return Alert;
402
+ },
403
+ {
404
+ eager: false,
405
+ nullable: true,
406
+ onDelete: "CASCADE",
407
+ orphanedRowAction: "nullify",
408
+ },
409
+ )
410
+ @JoinColumn({ name: "alertId" })
411
+ public alert?: Alert = undefined;
412
+
413
+ @ColumnAccessControl({
414
+ create: [],
415
+ read: [
416
+ Permission.ProjectOwner,
417
+ Permission.ProjectAdmin,
418
+ Permission.ProjectMember,
419
+ Permission.ReadSmsLog,
420
+ ],
421
+ update: [],
422
+ })
423
+ @Index()
424
+ @TableColumn({
425
+ type: TableColumnType.ObjectID,
426
+ required: false,
427
+ canReadOnRelationQuery: true,
428
+ title: "Alert ID",
429
+ description: "ID of Alert associated with this message (if any)",
430
+ })
431
+ @Column({
432
+ type: ColumnType.ObjectID,
433
+ nullable: true,
434
+ transformer: ObjectID.getDatabaseTransformer(),
435
+ })
436
+ public alertId?: ObjectID = undefined;
437
+
438
+ @ColumnAccessControl({
439
+ create: [],
440
+ read: [
441
+ Permission.ProjectOwner,
442
+ Permission.ProjectAdmin,
443
+ Permission.ProjectMember,
444
+ Permission.ReadSmsLog,
445
+ ],
446
+ update: [],
447
+ })
448
+ @TableColumn({
449
+ manyToOneRelationColumn: "scheduledMaintenanceId",
450
+ type: TableColumnType.Entity,
451
+ modelType: ScheduledMaintenance,
452
+ title: "Scheduled Maintenance",
453
+ description: "Scheduled Maintenance associated with this message (if any)",
454
+ })
455
+ @ManyToOne(
456
+ () => {
457
+ return ScheduledMaintenance;
458
+ },
459
+ {
460
+ eager: false,
461
+ nullable: true,
462
+ onDelete: "CASCADE",
463
+ orphanedRowAction: "nullify",
464
+ },
465
+ )
466
+ @JoinColumn({ name: "scheduledMaintenanceId" })
467
+ public scheduledMaintenance?: ScheduledMaintenance = undefined;
468
+
469
+ @ColumnAccessControl({
470
+ create: [],
471
+ read: [
472
+ Permission.ProjectOwner,
473
+ Permission.ProjectAdmin,
474
+ Permission.ProjectMember,
475
+ Permission.ReadSmsLog,
476
+ ],
477
+ update: [],
478
+ })
479
+ @Index()
480
+ @TableColumn({
481
+ type: TableColumnType.ObjectID,
482
+ required: false,
483
+ canReadOnRelationQuery: true,
484
+ title: "Scheduled Maintenance ID",
485
+ description:
486
+ "ID of Scheduled Maintenance associated with this message (if any)",
487
+ })
488
+ @Column({
489
+ type: ColumnType.ObjectID,
490
+ nullable: true,
491
+ transformer: ObjectID.getDatabaseTransformer(),
492
+ })
493
+ public scheduledMaintenanceId?: ObjectID = undefined;
494
+
495
+ @ColumnAccessControl({
496
+ create: [],
497
+ read: [
498
+ Permission.ProjectOwner,
499
+ Permission.ProjectAdmin,
500
+ Permission.ProjectMember,
501
+ Permission.ReadSmsLog,
502
+ ],
503
+ update: [],
504
+ })
505
+ @TableColumn({
506
+ manyToOneRelationColumn: "statusPageId",
507
+ type: TableColumnType.Entity,
508
+ modelType: StatusPage,
509
+ title: "Status Page",
510
+ description: "Status Page associated with this message (if any)",
511
+ })
512
+ @ManyToOne(
513
+ () => {
514
+ return StatusPage;
515
+ },
516
+ {
517
+ eager: false,
518
+ nullable: true,
519
+ onDelete: "CASCADE",
520
+ orphanedRowAction: "nullify",
521
+ },
522
+ )
523
+ @JoinColumn({ name: "statusPageId" })
524
+ public statusPage?: StatusPage = undefined;
525
+
526
+ @ColumnAccessControl({
527
+ create: [],
528
+ read: [
529
+ Permission.ProjectOwner,
530
+ Permission.ProjectAdmin,
531
+ Permission.ProjectMember,
532
+ Permission.ReadSmsLog,
533
+ ],
534
+ update: [],
535
+ })
536
+ @Index()
537
+ @TableColumn({
538
+ type: TableColumnType.ObjectID,
539
+ required: false,
540
+ canReadOnRelationQuery: true,
541
+ title: "Status Page ID",
542
+ description: "ID of Status Page associated with this message (if any)",
543
+ })
544
+ @Column({
545
+ type: ColumnType.ObjectID,
546
+ nullable: true,
547
+ transformer: ObjectID.getDatabaseTransformer(),
548
+ })
549
+ public statusPageId?: ObjectID = undefined;
550
+
551
+ @ColumnAccessControl({
552
+ create: [],
553
+ read: [
554
+ Permission.ProjectOwner,
555
+ Permission.ProjectAdmin,
556
+ Permission.ProjectMember,
557
+ Permission.ReadSmsLog,
558
+ ],
559
+ update: [],
560
+ })
561
+ @TableColumn({
562
+ manyToOneRelationColumn: "statusPageAnnouncementId",
563
+ type: TableColumnType.Entity,
564
+ modelType: StatusPageAnnouncement,
565
+ title: "Status Page Announcement",
566
+ description:
567
+ "Status Page Announcement associated with this message (if any)",
568
+ })
569
+ @ManyToOne(
570
+ () => {
571
+ return StatusPageAnnouncement;
572
+ },
573
+ {
574
+ eager: false,
575
+ nullable: true,
576
+ onDelete: "CASCADE",
577
+ orphanedRowAction: "nullify",
578
+ },
579
+ )
580
+ @JoinColumn({ name: "statusPageAnnouncementId" })
581
+ public statusPageAnnouncement?: StatusPageAnnouncement = undefined;
582
+
583
+ @ColumnAccessControl({
584
+ create: [],
585
+ read: [
586
+ Permission.ProjectOwner,
587
+ Permission.ProjectAdmin,
588
+ Permission.ProjectMember,
589
+ Permission.ReadSmsLog,
590
+ ],
591
+ update: [],
592
+ })
593
+ @Index()
594
+ @TableColumn({
595
+ type: TableColumnType.ObjectID,
596
+ required: false,
597
+ canReadOnRelationQuery: true,
598
+ title: "Status Page Announcement ID",
599
+ description:
600
+ "ID of Status Page Announcement associated with this message (if any)",
601
+ })
602
+ @Column({
603
+ type: ColumnType.ObjectID,
604
+ nullable: true,
605
+ transformer: ObjectID.getDatabaseTransformer(),
606
+ })
607
+ public statusPageAnnouncementId?: ObjectID = undefined;
608
+
609
+ @ColumnAccessControl({
610
+ create: [],
611
+ read: [
612
+ Permission.ProjectOwner,
613
+ Permission.ProjectAdmin,
614
+ Permission.ProjectMember,
615
+ Permission.ReadSmsLog,
616
+ ],
617
+ update: [],
618
+ })
619
+ @TableColumn({
620
+ manyToOneRelationColumn: "teamId",
621
+ type: TableColumnType.Entity,
622
+ modelType: Team,
623
+ title: "Team",
624
+ description: "Team associated with this message (if any)",
625
+ })
626
+ @ManyToOne(
627
+ () => {
628
+ return Team;
629
+ },
630
+ {
631
+ eager: false,
632
+ nullable: true,
633
+ onDelete: "CASCADE",
634
+ orphanedRowAction: "nullify",
635
+ },
636
+ )
637
+ @JoinColumn({ name: "teamId" })
638
+ public team?: Team = undefined;
639
+
640
+ @ColumnAccessControl({
641
+ create: [],
642
+ read: [
643
+ Permission.ProjectOwner,
644
+ Permission.ProjectAdmin,
645
+ Permission.ProjectMember,
646
+ Permission.ReadSmsLog,
647
+ ],
648
+ update: [],
649
+ })
650
+ @Index()
651
+ @TableColumn({
652
+ type: TableColumnType.ObjectID,
653
+ required: false,
654
+ canReadOnRelationQuery: true,
655
+ title: "Team ID",
656
+ description: "ID of Team associated with this message (if any)",
657
+ })
658
+ @Column({
659
+ type: ColumnType.ObjectID,
660
+ nullable: true,
661
+ transformer: ObjectID.getDatabaseTransformer(),
662
+ })
663
+ public teamId?: ObjectID = undefined;
664
+
665
+ @ColumnAccessControl({
666
+ create: [],
667
+ read: [
668
+ Permission.ProjectOwner,
669
+ Permission.ProjectAdmin,
670
+ Permission.ProjectMember,
671
+ Permission.ReadSmsLog,
672
+ ],
673
+ update: [],
674
+ })
675
+ @TableColumn({
676
+ manyToOneRelationColumn: "onCallDutyPolicyId",
677
+ type: TableColumnType.Entity,
678
+ modelType: OnCallDutyPolicy,
679
+ title: "On-Call Duty Policy",
680
+ description: "On-Call Duty Policy associated with this message (if any)",
681
+ })
682
+ @ManyToOne(
683
+ () => {
684
+ return OnCallDutyPolicy;
685
+ },
686
+ {
687
+ eager: false,
688
+ nullable: true,
689
+ onDelete: "CASCADE",
690
+ orphanedRowAction: "nullify",
691
+ },
692
+ )
693
+ @JoinColumn({ name: "onCallDutyPolicyId" })
694
+ public onCallDutyPolicy?: OnCallDutyPolicy = undefined;
695
+
696
+ @ColumnAccessControl({
697
+ create: [],
698
+ read: [
699
+ Permission.ProjectOwner,
700
+ Permission.ProjectAdmin,
701
+ Permission.ProjectMember,
702
+ Permission.ReadSmsLog,
703
+ ],
704
+ update: [],
705
+ })
706
+ @Index()
707
+ @TableColumn({
708
+ type: TableColumnType.ObjectID,
709
+ required: false,
710
+ canReadOnRelationQuery: true,
711
+ title: "On-Call Duty Policy ID",
712
+ description:
713
+ "ID of On-Call Duty Policy associated with this message (if any)",
714
+ })
715
+ @Column({
716
+ type: ColumnType.ObjectID,
717
+ nullable: true,
718
+ transformer: ObjectID.getDatabaseTransformer(),
719
+ })
720
+ public onCallDutyPolicyId?: ObjectID = undefined;
721
+
722
+ @ColumnAccessControl({
723
+ create: [],
724
+ read: [
725
+ Permission.ProjectOwner,
726
+ Permission.ProjectAdmin,
727
+ Permission.ProjectMember,
728
+ Permission.ReadSmsLog,
729
+ ],
730
+ update: [],
731
+ })
732
+ @TableColumn({
733
+ manyToOneRelationColumn: "onCallDutyPolicyEscalationRuleId",
734
+ type: TableColumnType.Entity,
735
+ modelType: OnCallDutyPolicyEscalationRule,
736
+ title: "On-Call Duty Policy Escalation Rule",
737
+ description:
738
+ "On-Call Duty Policy Escalation Rule associated with this message (if any)",
739
+ })
740
+ @ManyToOne(
741
+ () => {
742
+ return OnCallDutyPolicyEscalationRule;
743
+ },
744
+ {
745
+ eager: false,
746
+ nullable: true,
747
+ onDelete: "CASCADE",
748
+ orphanedRowAction: "nullify",
749
+ },
750
+ )
751
+ @JoinColumn({ name: "onCallDutyPolicyEscalationRuleId" })
752
+ public onCallDutyPolicyEscalationRule?: OnCallDutyPolicyEscalationRule =
753
+ undefined;
754
+
755
+ @ColumnAccessControl({
756
+ create: [],
757
+ read: [
758
+ Permission.ProjectOwner,
759
+ Permission.ProjectAdmin,
760
+ Permission.ProjectMember,
761
+ Permission.ReadSmsLog,
762
+ ],
763
+ update: [],
764
+ })
765
+ @Index()
766
+ @TableColumn({
767
+ type: TableColumnType.ObjectID,
768
+ required: false,
769
+ canReadOnRelationQuery: true,
770
+ title: "On-Call Duty Policy Escalation Rule ID",
771
+ description:
772
+ "ID of On-Call Duty Policy Escalation Rule associated with this message (if any)",
773
+ })
774
+ @Column({
775
+ type: ColumnType.ObjectID,
776
+ nullable: true,
777
+ transformer: ObjectID.getDatabaseTransformer(),
778
+ })
779
+ public onCallDutyPolicyEscalationRuleId?: ObjectID = undefined;
780
+
781
+ @ColumnAccessControl({
782
+ create: [],
783
+ read: [
784
+ Permission.ProjectOwner,
785
+ Permission.ProjectAdmin,
786
+ Permission.ProjectMember,
787
+ Permission.ReadSmsLog,
788
+ ],
789
+ update: [],
790
+ })
791
+ @TableColumn({
792
+ manyToOneRelationColumn: "onCallDutyPolicyScheduleId",
793
+ type: TableColumnType.Entity,
794
+ modelType: OnCallDutyPolicySchedule,
795
+ title: "On-Call Duty Policy Schedule",
796
+ description:
797
+ "On-Call Duty Policy Schedule associated with this message (if any)",
798
+ })
799
+ @ManyToOne(
800
+ () => {
801
+ return OnCallDutyPolicySchedule;
802
+ },
803
+ {
804
+ eager: false,
805
+ nullable: true,
806
+ onDelete: "CASCADE",
807
+ orphanedRowAction: "nullify",
808
+ },
809
+ )
810
+ @JoinColumn({ name: "onCallDutyPolicyScheduleId" })
811
+ public onCallDutyPolicySchedule?: OnCallDutyPolicySchedule = undefined;
812
+
813
+ @ColumnAccessControl({
814
+ create: [],
815
+ read: [
816
+ Permission.ProjectOwner,
817
+ Permission.ProjectAdmin,
818
+ Permission.ProjectMember,
819
+ Permission.ReadSmsLog,
820
+ ],
821
+ update: [],
822
+ })
823
+ @Index()
824
+ @TableColumn({
825
+ type: TableColumnType.ObjectID,
826
+ required: false,
827
+ canReadOnRelationQuery: true,
828
+ title: "On-Call Duty Policy Schedule ID",
829
+ description:
830
+ "ID of On-Call Duty Policy Schedule associated with this message (if any)",
831
+ })
832
+ @Column({
833
+ type: ColumnType.ObjectID,
834
+ nullable: true,
835
+ transformer: ObjectID.getDatabaseTransformer(),
836
+ })
837
+ public onCallDutyPolicyScheduleId?: ObjectID = undefined;
838
+
839
+ @ColumnAccessControl({
840
+ create: [],
841
+ read: [],
842
+ update: [],
843
+ })
844
+ @TableColumn({
845
+ manyToOneRelationColumn: "deletedByUserId",
846
+ type: TableColumnType.Entity,
847
+ title: "Deleted by User",
848
+ modelType: User,
849
+ description:
850
+ "Relation to User who deleted this object (if this object was deleted by a User)",
851
+ })
852
+ @ManyToOne(
853
+ () => {
854
+ return User;
855
+ },
856
+ {
857
+ cascade: false,
858
+ eager: false,
859
+ nullable: true,
860
+ onDelete: "SET NULL",
861
+ orphanedRowAction: "nullify",
862
+ },
863
+ )
864
+ @JoinColumn({ name: "deletedByUserId" })
865
+ public deletedByUser?: User = undefined;
866
+
867
+ @ColumnAccessControl({
868
+ create: [],
869
+ read: [],
870
+ update: [],
871
+ })
872
+ @TableColumn({
873
+ type: TableColumnType.ObjectID,
874
+ title: "Deleted by User ID",
875
+ description:
876
+ "User ID who deleted this object (if this object was deleted by a User)",
877
+ })
878
+ @Column({
879
+ type: ColumnType.ObjectID,
880
+ nullable: true,
881
+ transformer: ObjectID.getDatabaseTransformer(),
882
+ })
883
+ public deletedByUserId?: ObjectID = undefined;
884
+ }