@oneuptime/common 7.0.4922 → 7.0.4972

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