@oneuptime/common 9.2.9 → 9.2.11
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.
- package/Models/DatabaseModels/Index.ts +4 -0
- package/Models/DatabaseModels/StatusPageSubscriberNotificationTemplate.ts +461 -0
- package/Models/DatabaseModels/StatusPageSubscriberNotificationTemplateStatusPage.ts +400 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1765195603978-MigrationName.ts +107 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts +2 -0
- package/Server/Services/Index.ts +4 -0
- package/Server/Services/ScheduledMaintenanceService.ts +184 -63
- package/Server/Services/StatusPageSubscriberNotificationTemplateService.ts +272 -0
- package/Server/Services/StatusPageSubscriberNotificationTemplateStatusPageService.ts +10 -0
- package/Server/Types/Workflow/Components/Discord/SendMessageToChannel.ts +108 -0
- package/Server/Types/Workflow/Components/Index.ts +2 -0
- package/Tests/UI/Components/Loader.test.tsx +2 -2
- package/Types/Email/EmailTemplateType.ts +1 -0
- package/Types/Permission.ts +82 -0
- package/Types/StatusPage/StatusPageSubscriberNotificationEventType.ts +22 -0
- package/Types/StatusPage/StatusPageSubscriberNotificationMethod.ts +14 -0
- package/Types/Workflow/ComponentID.ts +1 -0
- package/Types/Workflow/Components/Discord.ts +68 -0
- package/Types/Workflow/Components.ts +7 -0
- package/UI/Components/Forms/BasicForm.tsx +2 -0
- package/UI/Components/Forms/Types/Field.ts +1 -0
- package/UI/Components/Loader/Loader.tsx +6 -6
- package/build/dist/Models/DatabaseModels/Index.js +4 -0
- package/build/dist/Models/DatabaseModels/Index.js.map +1 -1
- package/build/dist/Models/DatabaseModels/StatusPageSubscriberNotificationTemplate.js +482 -0
- package/build/dist/Models/DatabaseModels/StatusPageSubscriberNotificationTemplate.js.map +1 -0
- package/build/dist/Models/DatabaseModels/StatusPageSubscriberNotificationTemplateStatusPage.js +413 -0
- package/build/dist/Models/DatabaseModels/StatusPageSubscriberNotificationTemplateStatusPage.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1765195603978-MigrationName.js +42 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1765195603978-MigrationName.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js +2 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js.map +1 -1
- package/build/dist/Server/Services/Index.js +4 -0
- package/build/dist/Server/Services/Index.js.map +1 -1
- package/build/dist/Server/Services/ScheduledMaintenanceService.js +125 -50
- package/build/dist/Server/Services/ScheduledMaintenanceService.js.map +1 -1
- package/build/dist/Server/Services/StatusPageSubscriberNotificationTemplateService.js +236 -0
- package/build/dist/Server/Services/StatusPageSubscriberNotificationTemplateService.js.map +1 -0
- package/build/dist/Server/Services/StatusPageSubscriberNotificationTemplateStatusPageService.js +9 -0
- package/build/dist/Server/Services/StatusPageSubscriberNotificationTemplateStatusPageService.js.map +1 -0
- package/build/dist/Server/Types/Workflow/Components/Discord/SendMessageToChannel.js +92 -0
- package/build/dist/Server/Types/Workflow/Components/Discord/SendMessageToChannel.js.map +1 -0
- package/build/dist/Server/Types/Workflow/Components/Index.js +2 -0
- package/build/dist/Server/Types/Workflow/Components/Index.js.map +1 -1
- package/build/dist/Tests/UI/Components/Loader.test.js +2 -2
- package/build/dist/Tests/UI/Components/Loader.test.js.map +1 -1
- package/build/dist/Types/Email/EmailTemplateType.js +1 -0
- package/build/dist/Types/Email/EmailTemplateType.js.map +1 -1
- package/build/dist/Types/Permission.js +66 -0
- package/build/dist/Types/Permission.js.map +1 -1
- package/build/dist/Types/StatusPage/StatusPageSubscriberNotificationEventType.js +20 -0
- package/build/dist/Types/StatusPage/StatusPageSubscriberNotificationEventType.js.map +1 -0
- package/build/dist/Types/StatusPage/StatusPageSubscriberNotificationMethod.js +14 -0
- package/build/dist/Types/StatusPage/StatusPageSubscriberNotificationMethod.js.map +1 -0
- package/build/dist/Types/Workflow/ComponentID.js +1 -0
- package/build/dist/Types/Workflow/ComponentID.js.map +1 -1
- package/build/dist/Types/Workflow/Components/Discord.js +61 -0
- package/build/dist/Types/Workflow/Components/Discord.js.map +1 -0
- package/build/dist/Types/Workflow/Components.js +7 -0
- package/build/dist/Types/Workflow/Components.js.map +1 -1
- package/build/dist/UI/Components/Forms/BasicForm.js +3 -1
- package/build/dist/UI/Components/Forms/BasicForm.js.map +1 -1
- package/build/dist/UI/Components/Loader/Loader.js +2 -2
- package/build/dist/UI/Components/Loader/Loader.js.map +1 -1
- package/jest.config.json +1 -1
- package/package.json +1 -1
|
@@ -123,6 +123,8 @@ import StatusPageResource from "./StatusPageResource";
|
|
|
123
123
|
import StatusPageSCIM from "./StatusPageSCIM";
|
|
124
124
|
import StatusPageSSO from "./StatusPageSso";
|
|
125
125
|
import StatusPageSubscriber from "./StatusPageSubscriber";
|
|
126
|
+
import StatusPageSubscriberNotificationTemplate from "./StatusPageSubscriberNotificationTemplate";
|
|
127
|
+
import StatusPageSubscriberNotificationTemplateStatusPage from "./StatusPageSubscriberNotificationTemplateStatusPage";
|
|
126
128
|
// Team
|
|
127
129
|
import Team from "./Team";
|
|
128
130
|
import TeamMember from "./TeamMember";
|
|
@@ -265,6 +267,8 @@ const AllModelTypes: Array<{
|
|
|
265
267
|
StatusPageAnnouncement,
|
|
266
268
|
StatusPageAnnouncementTemplate,
|
|
267
269
|
StatusPageSubscriber,
|
|
270
|
+
StatusPageSubscriberNotificationTemplate,
|
|
271
|
+
StatusPageSubscriberNotificationTemplateStatusPage,
|
|
268
272
|
StatusPageFooterLink,
|
|
269
273
|
StatusPageHeaderLink,
|
|
270
274
|
StatusPagePrivateUser,
|
|
@@ -0,0 +1,461 @@
|
|
|
1
|
+
import Project from "./Project";
|
|
2
|
+
import User from "./User";
|
|
3
|
+
import BaseModel from "./DatabaseBaseModel/DatabaseBaseModel";
|
|
4
|
+
import Route from "../../Types/API/Route";
|
|
5
|
+
import { PlanType } from "../../Types/Billing/SubscriptionPlan";
|
|
6
|
+
import ColumnAccessControl from "../../Types/Database/AccessControl/ColumnAccessControl";
|
|
7
|
+
import TableAccessControl from "../../Types/Database/AccessControl/TableAccessControl";
|
|
8
|
+
import TableBillingAccessControl from "../../Types/Database/AccessControl/TableBillingAccessControl";
|
|
9
|
+
import ColumnLength from "../../Types/Database/ColumnLength";
|
|
10
|
+
import ColumnType from "../../Types/Database/ColumnType";
|
|
11
|
+
import CrudApiEndpoint from "../../Types/Database/CrudApiEndpoint";
|
|
12
|
+
import EnableDocumentation from "../../Types/Database/EnableDocumentation";
|
|
13
|
+
import EnableWorkflow from "../../Types/Database/EnableWorkflow";
|
|
14
|
+
import TableColumn from "../../Types/Database/TableColumn";
|
|
15
|
+
import TableColumnType from "../../Types/Database/TableColumnType";
|
|
16
|
+
import TableMetadata from "../../Types/Database/TableMetadata";
|
|
17
|
+
import TenantColumn from "../../Types/Database/TenantColumn";
|
|
18
|
+
import IconProp from "../../Types/Icon/IconProp";
|
|
19
|
+
import ObjectID from "../../Types/ObjectID";
|
|
20
|
+
import Permission from "../../Types/Permission";
|
|
21
|
+
import StatusPageSubscriberNotificationEventType from "../../Types/StatusPage/StatusPageSubscriberNotificationEventType";
|
|
22
|
+
import StatusPageSubscriberNotificationMethod from "../../Types/StatusPage/StatusPageSubscriberNotificationMethod";
|
|
23
|
+
import { Column, Entity, Index, JoinColumn, ManyToOne } from "typeorm";
|
|
24
|
+
|
|
25
|
+
@EnableDocumentation()
|
|
26
|
+
@TenantColumn("projectId")
|
|
27
|
+
@TableBillingAccessControl({
|
|
28
|
+
create: PlanType.Scale,
|
|
29
|
+
read: PlanType.Scale,
|
|
30
|
+
update: PlanType.Scale,
|
|
31
|
+
delete: PlanType.Free,
|
|
32
|
+
})
|
|
33
|
+
@TableAccessControl({
|
|
34
|
+
create: [
|
|
35
|
+
Permission.ProjectOwner,
|
|
36
|
+
Permission.ProjectAdmin,
|
|
37
|
+
Permission.ProjectMember,
|
|
38
|
+
Permission.CreateStatusPageSubscriberNotificationTemplate,
|
|
39
|
+
],
|
|
40
|
+
read: [
|
|
41
|
+
Permission.ProjectOwner,
|
|
42
|
+
Permission.ProjectAdmin,
|
|
43
|
+
Permission.ProjectMember,
|
|
44
|
+
Permission.ReadStatusPageSubscriberNotificationTemplate,
|
|
45
|
+
],
|
|
46
|
+
delete: [
|
|
47
|
+
Permission.ProjectOwner,
|
|
48
|
+
Permission.ProjectAdmin,
|
|
49
|
+
Permission.ProjectMember,
|
|
50
|
+
Permission.DeleteStatusPageSubscriberNotificationTemplate,
|
|
51
|
+
],
|
|
52
|
+
update: [
|
|
53
|
+
Permission.ProjectOwner,
|
|
54
|
+
Permission.ProjectAdmin,
|
|
55
|
+
Permission.ProjectMember,
|
|
56
|
+
Permission.EditStatusPageSubscriberNotificationTemplate,
|
|
57
|
+
],
|
|
58
|
+
})
|
|
59
|
+
@EnableWorkflow({
|
|
60
|
+
create: true,
|
|
61
|
+
delete: true,
|
|
62
|
+
update: true,
|
|
63
|
+
read: true,
|
|
64
|
+
})
|
|
65
|
+
@CrudApiEndpoint(new Route("/status-page-subscriber-notification-template"))
|
|
66
|
+
@TableMetadata({
|
|
67
|
+
tableName: "StatusPageSubscriberNotificationTemplate",
|
|
68
|
+
singularName: "Subscriber Notification Template",
|
|
69
|
+
pluralName: "Subscriber Notification Templates",
|
|
70
|
+
icon: IconProp.Email,
|
|
71
|
+
tableDescription:
|
|
72
|
+
"Manage custom notification templates for status page subscribers. These templates can be used to customize the notifications sent to subscribers via Email, SMS, Slack, Microsoft Teams, and Webhooks.",
|
|
73
|
+
})
|
|
74
|
+
@Entity({
|
|
75
|
+
name: "StatusPageSubscriberNotificationTemplate",
|
|
76
|
+
})
|
|
77
|
+
export default class StatusPageSubscriberNotificationTemplate extends BaseModel {
|
|
78
|
+
@ColumnAccessControl({
|
|
79
|
+
create: [
|
|
80
|
+
Permission.ProjectOwner,
|
|
81
|
+
Permission.ProjectAdmin,
|
|
82
|
+
Permission.ProjectMember,
|
|
83
|
+
Permission.CreateStatusPageSubscriberNotificationTemplate,
|
|
84
|
+
],
|
|
85
|
+
read: [
|
|
86
|
+
Permission.ProjectOwner,
|
|
87
|
+
Permission.ProjectAdmin,
|
|
88
|
+
Permission.ProjectMember,
|
|
89
|
+
Permission.ReadStatusPageSubscriberNotificationTemplate,
|
|
90
|
+
],
|
|
91
|
+
update: [],
|
|
92
|
+
})
|
|
93
|
+
@TableColumn({
|
|
94
|
+
manyToOneRelationColumn: "projectId",
|
|
95
|
+
type: TableColumnType.Entity,
|
|
96
|
+
modelType: Project,
|
|
97
|
+
title: "Project",
|
|
98
|
+
description: "Relation to Project Resource in which this object belongs",
|
|
99
|
+
})
|
|
100
|
+
@ManyToOne(
|
|
101
|
+
() => {
|
|
102
|
+
return Project;
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
eager: false,
|
|
106
|
+
nullable: true,
|
|
107
|
+
onDelete: "CASCADE",
|
|
108
|
+
orphanedRowAction: "nullify",
|
|
109
|
+
},
|
|
110
|
+
)
|
|
111
|
+
@JoinColumn({ name: "projectId" })
|
|
112
|
+
public project?: Project = undefined;
|
|
113
|
+
|
|
114
|
+
@ColumnAccessControl({
|
|
115
|
+
create: [
|
|
116
|
+
Permission.ProjectOwner,
|
|
117
|
+
Permission.ProjectAdmin,
|
|
118
|
+
Permission.ProjectMember,
|
|
119
|
+
Permission.CreateStatusPageSubscriberNotificationTemplate,
|
|
120
|
+
],
|
|
121
|
+
read: [
|
|
122
|
+
Permission.ProjectOwner,
|
|
123
|
+
Permission.ProjectAdmin,
|
|
124
|
+
Permission.ProjectMember,
|
|
125
|
+
Permission.ReadStatusPageSubscriberNotificationTemplate,
|
|
126
|
+
],
|
|
127
|
+
update: [],
|
|
128
|
+
})
|
|
129
|
+
@Index()
|
|
130
|
+
@TableColumn({
|
|
131
|
+
type: TableColumnType.ObjectID,
|
|
132
|
+
required: true,
|
|
133
|
+
canReadOnRelationQuery: true,
|
|
134
|
+
title: "Project ID",
|
|
135
|
+
description: "ID of your OneUptime Project in which this object belongs",
|
|
136
|
+
})
|
|
137
|
+
@Column({
|
|
138
|
+
type: ColumnType.ObjectID,
|
|
139
|
+
nullable: false,
|
|
140
|
+
transformer: ObjectID.getDatabaseTransformer(),
|
|
141
|
+
})
|
|
142
|
+
public projectId?: ObjectID = undefined;
|
|
143
|
+
|
|
144
|
+
@ColumnAccessControl({
|
|
145
|
+
create: [
|
|
146
|
+
Permission.ProjectOwner,
|
|
147
|
+
Permission.ProjectAdmin,
|
|
148
|
+
Permission.ProjectMember,
|
|
149
|
+
Permission.CreateStatusPageSubscriberNotificationTemplate,
|
|
150
|
+
],
|
|
151
|
+
read: [
|
|
152
|
+
Permission.ProjectOwner,
|
|
153
|
+
Permission.ProjectAdmin,
|
|
154
|
+
Permission.ProjectMember,
|
|
155
|
+
Permission.ReadStatusPageSubscriberNotificationTemplate,
|
|
156
|
+
],
|
|
157
|
+
update: [
|
|
158
|
+
Permission.ProjectOwner,
|
|
159
|
+
Permission.ProjectAdmin,
|
|
160
|
+
Permission.ProjectMember,
|
|
161
|
+
Permission.EditStatusPageSubscriberNotificationTemplate,
|
|
162
|
+
],
|
|
163
|
+
})
|
|
164
|
+
@TableColumn({
|
|
165
|
+
required: true,
|
|
166
|
+
type: TableColumnType.ShortText,
|
|
167
|
+
title: "Template Name",
|
|
168
|
+
description: "A friendly name for this notification template",
|
|
169
|
+
canReadOnRelationQuery: true,
|
|
170
|
+
})
|
|
171
|
+
@Column({
|
|
172
|
+
nullable: false,
|
|
173
|
+
type: ColumnType.ShortText,
|
|
174
|
+
length: ColumnLength.ShortText,
|
|
175
|
+
})
|
|
176
|
+
public templateName?: string = undefined;
|
|
177
|
+
|
|
178
|
+
@ColumnAccessControl({
|
|
179
|
+
create: [
|
|
180
|
+
Permission.ProjectOwner,
|
|
181
|
+
Permission.ProjectAdmin,
|
|
182
|
+
Permission.ProjectMember,
|
|
183
|
+
Permission.CreateStatusPageSubscriberNotificationTemplate,
|
|
184
|
+
],
|
|
185
|
+
read: [
|
|
186
|
+
Permission.ProjectOwner,
|
|
187
|
+
Permission.ProjectAdmin,
|
|
188
|
+
Permission.ProjectMember,
|
|
189
|
+
Permission.ReadStatusPageSubscriberNotificationTemplate,
|
|
190
|
+
],
|
|
191
|
+
update: [
|
|
192
|
+
Permission.ProjectOwner,
|
|
193
|
+
Permission.ProjectAdmin,
|
|
194
|
+
Permission.ProjectMember,
|
|
195
|
+
Permission.EditStatusPageSubscriberNotificationTemplate,
|
|
196
|
+
],
|
|
197
|
+
})
|
|
198
|
+
@TableColumn({
|
|
199
|
+
required: false,
|
|
200
|
+
type: TableColumnType.LongText,
|
|
201
|
+
title: "Template Description",
|
|
202
|
+
description: "A description for this notification template",
|
|
203
|
+
})
|
|
204
|
+
@Column({
|
|
205
|
+
nullable: true,
|
|
206
|
+
type: ColumnType.LongText,
|
|
207
|
+
length: ColumnLength.LongText,
|
|
208
|
+
})
|
|
209
|
+
public templateDescription?: string = undefined;
|
|
210
|
+
|
|
211
|
+
@ColumnAccessControl({
|
|
212
|
+
create: [
|
|
213
|
+
Permission.ProjectOwner,
|
|
214
|
+
Permission.ProjectAdmin,
|
|
215
|
+
Permission.ProjectMember,
|
|
216
|
+
Permission.CreateStatusPageSubscriberNotificationTemplate,
|
|
217
|
+
],
|
|
218
|
+
read: [
|
|
219
|
+
Permission.ProjectOwner,
|
|
220
|
+
Permission.ProjectAdmin,
|
|
221
|
+
Permission.ProjectMember,
|
|
222
|
+
Permission.ReadStatusPageSubscriberNotificationTemplate,
|
|
223
|
+
],
|
|
224
|
+
update: [
|
|
225
|
+
Permission.ProjectOwner,
|
|
226
|
+
Permission.ProjectAdmin,
|
|
227
|
+
Permission.ProjectMember,
|
|
228
|
+
Permission.EditStatusPageSubscriberNotificationTemplate,
|
|
229
|
+
],
|
|
230
|
+
})
|
|
231
|
+
@Index()
|
|
232
|
+
@TableColumn({
|
|
233
|
+
required: true,
|
|
234
|
+
type: TableColumnType.ShortText,
|
|
235
|
+
title: "Event Type",
|
|
236
|
+
description:
|
|
237
|
+
"The type of event this template is for (e.g., Incident Created, Announcement Created)",
|
|
238
|
+
canReadOnRelationQuery: true,
|
|
239
|
+
})
|
|
240
|
+
@Column({
|
|
241
|
+
nullable: false,
|
|
242
|
+
type: ColumnType.ShortText,
|
|
243
|
+
length: ColumnLength.ShortText,
|
|
244
|
+
})
|
|
245
|
+
public eventType?: StatusPageSubscriberNotificationEventType = undefined;
|
|
246
|
+
|
|
247
|
+
@ColumnAccessControl({
|
|
248
|
+
create: [
|
|
249
|
+
Permission.ProjectOwner,
|
|
250
|
+
Permission.ProjectAdmin,
|
|
251
|
+
Permission.ProjectMember,
|
|
252
|
+
Permission.CreateStatusPageSubscriberNotificationTemplate,
|
|
253
|
+
],
|
|
254
|
+
read: [
|
|
255
|
+
Permission.ProjectOwner,
|
|
256
|
+
Permission.ProjectAdmin,
|
|
257
|
+
Permission.ProjectMember,
|
|
258
|
+
Permission.ReadStatusPageSubscriberNotificationTemplate,
|
|
259
|
+
],
|
|
260
|
+
update: [
|
|
261
|
+
Permission.ProjectOwner,
|
|
262
|
+
Permission.ProjectAdmin,
|
|
263
|
+
Permission.ProjectMember,
|
|
264
|
+
Permission.EditStatusPageSubscriberNotificationTemplate,
|
|
265
|
+
],
|
|
266
|
+
})
|
|
267
|
+
@Index()
|
|
268
|
+
@TableColumn({
|
|
269
|
+
required: true,
|
|
270
|
+
type: TableColumnType.ShortText,
|
|
271
|
+
title: "Notification Method",
|
|
272
|
+
description:
|
|
273
|
+
"The notification method this template is for (Email, SMS, Slack, Microsoft Teams, Webhook)",
|
|
274
|
+
canReadOnRelationQuery: true,
|
|
275
|
+
})
|
|
276
|
+
@Column({
|
|
277
|
+
nullable: false,
|
|
278
|
+
type: ColumnType.ShortText,
|
|
279
|
+
length: ColumnLength.ShortText,
|
|
280
|
+
})
|
|
281
|
+
public notificationMethod?: StatusPageSubscriberNotificationMethod =
|
|
282
|
+
undefined;
|
|
283
|
+
|
|
284
|
+
@ColumnAccessControl({
|
|
285
|
+
create: [
|
|
286
|
+
Permission.ProjectOwner,
|
|
287
|
+
Permission.ProjectAdmin,
|
|
288
|
+
Permission.ProjectMember,
|
|
289
|
+
Permission.CreateStatusPageSubscriberNotificationTemplate,
|
|
290
|
+
],
|
|
291
|
+
read: [
|
|
292
|
+
Permission.ProjectOwner,
|
|
293
|
+
Permission.ProjectAdmin,
|
|
294
|
+
Permission.ProjectMember,
|
|
295
|
+
Permission.ReadStatusPageSubscriberNotificationTemplate,
|
|
296
|
+
],
|
|
297
|
+
update: [
|
|
298
|
+
Permission.ProjectOwner,
|
|
299
|
+
Permission.ProjectAdmin,
|
|
300
|
+
Permission.ProjectMember,
|
|
301
|
+
Permission.EditStatusPageSubscriberNotificationTemplate,
|
|
302
|
+
],
|
|
303
|
+
})
|
|
304
|
+
@TableColumn({
|
|
305
|
+
required: false,
|
|
306
|
+
type: TableColumnType.ShortText,
|
|
307
|
+
title: "Subject (Email only)",
|
|
308
|
+
description:
|
|
309
|
+
"The subject line for email notifications. Only used for Email notification method.",
|
|
310
|
+
})
|
|
311
|
+
@Column({
|
|
312
|
+
nullable: true,
|
|
313
|
+
type: ColumnType.ShortText,
|
|
314
|
+
length: ColumnLength.ShortText,
|
|
315
|
+
})
|
|
316
|
+
public emailSubject?: string = undefined;
|
|
317
|
+
|
|
318
|
+
@ColumnAccessControl({
|
|
319
|
+
create: [
|
|
320
|
+
Permission.ProjectOwner,
|
|
321
|
+
Permission.ProjectAdmin,
|
|
322
|
+
Permission.ProjectMember,
|
|
323
|
+
Permission.CreateStatusPageSubscriberNotificationTemplate,
|
|
324
|
+
],
|
|
325
|
+
read: [
|
|
326
|
+
Permission.ProjectOwner,
|
|
327
|
+
Permission.ProjectAdmin,
|
|
328
|
+
Permission.ProjectMember,
|
|
329
|
+
Permission.ReadStatusPageSubscriberNotificationTemplate,
|
|
330
|
+
],
|
|
331
|
+
update: [
|
|
332
|
+
Permission.ProjectOwner,
|
|
333
|
+
Permission.ProjectAdmin,
|
|
334
|
+
Permission.ProjectMember,
|
|
335
|
+
Permission.EditStatusPageSubscriberNotificationTemplate,
|
|
336
|
+
],
|
|
337
|
+
})
|
|
338
|
+
@TableColumn({
|
|
339
|
+
required: true,
|
|
340
|
+
type: TableColumnType.HTML,
|
|
341
|
+
title: "Template Body",
|
|
342
|
+
description:
|
|
343
|
+
"The template body content. For Email: HTML template. For SMS: Plain text. For Slack/Teams: Markdown.",
|
|
344
|
+
})
|
|
345
|
+
@Column({
|
|
346
|
+
nullable: false,
|
|
347
|
+
type: ColumnType.HTML,
|
|
348
|
+
})
|
|
349
|
+
public templateBody?: string = undefined;
|
|
350
|
+
|
|
351
|
+
@ColumnAccessControl({
|
|
352
|
+
create: [],
|
|
353
|
+
read: [
|
|
354
|
+
Permission.ProjectOwner,
|
|
355
|
+
Permission.ProjectAdmin,
|
|
356
|
+
Permission.ProjectMember,
|
|
357
|
+
Permission.ReadStatusPageSubscriberNotificationTemplate,
|
|
358
|
+
],
|
|
359
|
+
update: [],
|
|
360
|
+
})
|
|
361
|
+
@TableColumn({
|
|
362
|
+
manyToOneRelationColumn: "createdByUserId",
|
|
363
|
+
type: TableColumnType.Entity,
|
|
364
|
+
modelType: User,
|
|
365
|
+
title: "Created by User",
|
|
366
|
+
description:
|
|
367
|
+
"Relation to User who created this object (if this object was created by a User)",
|
|
368
|
+
})
|
|
369
|
+
@ManyToOne(
|
|
370
|
+
() => {
|
|
371
|
+
return User;
|
|
372
|
+
},
|
|
373
|
+
{
|
|
374
|
+
eager: false,
|
|
375
|
+
nullable: true,
|
|
376
|
+
onDelete: "SET NULL",
|
|
377
|
+
orphanedRowAction: "nullify",
|
|
378
|
+
},
|
|
379
|
+
)
|
|
380
|
+
@JoinColumn({ name: "createdByUserId" })
|
|
381
|
+
public createdByUser?: User = undefined;
|
|
382
|
+
|
|
383
|
+
@ColumnAccessControl({
|
|
384
|
+
create: [
|
|
385
|
+
Permission.ProjectOwner,
|
|
386
|
+
Permission.ProjectAdmin,
|
|
387
|
+
Permission.ProjectMember,
|
|
388
|
+
Permission.CreateStatusPageSubscriberNotificationTemplate,
|
|
389
|
+
],
|
|
390
|
+
read: [
|
|
391
|
+
Permission.ProjectOwner,
|
|
392
|
+
Permission.ProjectAdmin,
|
|
393
|
+
Permission.ProjectMember,
|
|
394
|
+
Permission.ReadStatusPageSubscriberNotificationTemplate,
|
|
395
|
+
],
|
|
396
|
+
update: [],
|
|
397
|
+
})
|
|
398
|
+
@TableColumn({
|
|
399
|
+
type: TableColumnType.ObjectID,
|
|
400
|
+
title: "Created by User ID",
|
|
401
|
+
description:
|
|
402
|
+
"User ID who created this object (if this object was created by a User)",
|
|
403
|
+
})
|
|
404
|
+
@Column({
|
|
405
|
+
type: ColumnType.ObjectID,
|
|
406
|
+
nullable: true,
|
|
407
|
+
transformer: ObjectID.getDatabaseTransformer(),
|
|
408
|
+
})
|
|
409
|
+
public createdByUserId?: ObjectID = undefined;
|
|
410
|
+
|
|
411
|
+
@ColumnAccessControl({
|
|
412
|
+
create: [],
|
|
413
|
+
read: [
|
|
414
|
+
Permission.ProjectOwner,
|
|
415
|
+
Permission.ProjectAdmin,
|
|
416
|
+
Permission.ProjectMember,
|
|
417
|
+
Permission.ReadStatusPageSubscriberNotificationTemplate,
|
|
418
|
+
],
|
|
419
|
+
update: [],
|
|
420
|
+
})
|
|
421
|
+
@TableColumn({
|
|
422
|
+
manyToOneRelationColumn: "deletedByUserId",
|
|
423
|
+
type: TableColumnType.Entity,
|
|
424
|
+
title: "Deleted by User",
|
|
425
|
+
modelType: User,
|
|
426
|
+
description:
|
|
427
|
+
"Relation to User who deleted this object (if this object was deleted by a User)",
|
|
428
|
+
})
|
|
429
|
+
@ManyToOne(
|
|
430
|
+
() => {
|
|
431
|
+
return User;
|
|
432
|
+
},
|
|
433
|
+
{
|
|
434
|
+
cascade: false,
|
|
435
|
+
eager: false,
|
|
436
|
+
nullable: true,
|
|
437
|
+
onDelete: "SET NULL",
|
|
438
|
+
orphanedRowAction: "nullify",
|
|
439
|
+
},
|
|
440
|
+
)
|
|
441
|
+
@JoinColumn({ name: "deletedByUserId" })
|
|
442
|
+
public deletedByUser?: User = undefined;
|
|
443
|
+
|
|
444
|
+
@ColumnAccessControl({
|
|
445
|
+
create: [],
|
|
446
|
+
read: [],
|
|
447
|
+
update: [],
|
|
448
|
+
})
|
|
449
|
+
@TableColumn({
|
|
450
|
+
type: TableColumnType.ObjectID,
|
|
451
|
+
title: "Deleted by User ID",
|
|
452
|
+
description:
|
|
453
|
+
"User ID who deleted this object (if this object was deleted by a User)",
|
|
454
|
+
})
|
|
455
|
+
@Column({
|
|
456
|
+
type: ColumnType.ObjectID,
|
|
457
|
+
nullable: true,
|
|
458
|
+
transformer: ObjectID.getDatabaseTransformer(),
|
|
459
|
+
})
|
|
460
|
+
public deletedByUserId?: ObjectID = undefined;
|
|
461
|
+
}
|