@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.
Files changed (66) hide show
  1. package/Models/DatabaseModels/Index.ts +4 -0
  2. package/Models/DatabaseModels/StatusPageSubscriberNotificationTemplate.ts +461 -0
  3. package/Models/DatabaseModels/StatusPageSubscriberNotificationTemplateStatusPage.ts +400 -0
  4. package/Server/Infrastructure/Postgres/SchemaMigrations/1765195603978-MigrationName.ts +107 -0
  5. package/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts +2 -0
  6. package/Server/Services/Index.ts +4 -0
  7. package/Server/Services/ScheduledMaintenanceService.ts +184 -63
  8. package/Server/Services/StatusPageSubscriberNotificationTemplateService.ts +272 -0
  9. package/Server/Services/StatusPageSubscriberNotificationTemplateStatusPageService.ts +10 -0
  10. package/Server/Types/Workflow/Components/Discord/SendMessageToChannel.ts +108 -0
  11. package/Server/Types/Workflow/Components/Index.ts +2 -0
  12. package/Tests/UI/Components/Loader.test.tsx +2 -2
  13. package/Types/Email/EmailTemplateType.ts +1 -0
  14. package/Types/Permission.ts +82 -0
  15. package/Types/StatusPage/StatusPageSubscriberNotificationEventType.ts +22 -0
  16. package/Types/StatusPage/StatusPageSubscriberNotificationMethod.ts +14 -0
  17. package/Types/Workflow/ComponentID.ts +1 -0
  18. package/Types/Workflow/Components/Discord.ts +68 -0
  19. package/Types/Workflow/Components.ts +7 -0
  20. package/UI/Components/Forms/BasicForm.tsx +2 -0
  21. package/UI/Components/Forms/Types/Field.ts +1 -0
  22. package/UI/Components/Loader/Loader.tsx +6 -6
  23. package/build/dist/Models/DatabaseModels/Index.js +4 -0
  24. package/build/dist/Models/DatabaseModels/Index.js.map +1 -1
  25. package/build/dist/Models/DatabaseModels/StatusPageSubscriberNotificationTemplate.js +482 -0
  26. package/build/dist/Models/DatabaseModels/StatusPageSubscriberNotificationTemplate.js.map +1 -0
  27. package/build/dist/Models/DatabaseModels/StatusPageSubscriberNotificationTemplateStatusPage.js +413 -0
  28. package/build/dist/Models/DatabaseModels/StatusPageSubscriberNotificationTemplateStatusPage.js.map +1 -0
  29. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1765195603978-MigrationName.js +42 -0
  30. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1765195603978-MigrationName.js.map +1 -0
  31. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js +2 -0
  32. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js.map +1 -1
  33. package/build/dist/Server/Services/Index.js +4 -0
  34. package/build/dist/Server/Services/Index.js.map +1 -1
  35. package/build/dist/Server/Services/ScheduledMaintenanceService.js +125 -50
  36. package/build/dist/Server/Services/ScheduledMaintenanceService.js.map +1 -1
  37. package/build/dist/Server/Services/StatusPageSubscriberNotificationTemplateService.js +236 -0
  38. package/build/dist/Server/Services/StatusPageSubscriberNotificationTemplateService.js.map +1 -0
  39. package/build/dist/Server/Services/StatusPageSubscriberNotificationTemplateStatusPageService.js +9 -0
  40. package/build/dist/Server/Services/StatusPageSubscriberNotificationTemplateStatusPageService.js.map +1 -0
  41. package/build/dist/Server/Types/Workflow/Components/Discord/SendMessageToChannel.js +92 -0
  42. package/build/dist/Server/Types/Workflow/Components/Discord/SendMessageToChannel.js.map +1 -0
  43. package/build/dist/Server/Types/Workflow/Components/Index.js +2 -0
  44. package/build/dist/Server/Types/Workflow/Components/Index.js.map +1 -1
  45. package/build/dist/Tests/UI/Components/Loader.test.js +2 -2
  46. package/build/dist/Tests/UI/Components/Loader.test.js.map +1 -1
  47. package/build/dist/Types/Email/EmailTemplateType.js +1 -0
  48. package/build/dist/Types/Email/EmailTemplateType.js.map +1 -1
  49. package/build/dist/Types/Permission.js +66 -0
  50. package/build/dist/Types/Permission.js.map +1 -1
  51. package/build/dist/Types/StatusPage/StatusPageSubscriberNotificationEventType.js +20 -0
  52. package/build/dist/Types/StatusPage/StatusPageSubscriberNotificationEventType.js.map +1 -0
  53. package/build/dist/Types/StatusPage/StatusPageSubscriberNotificationMethod.js +14 -0
  54. package/build/dist/Types/StatusPage/StatusPageSubscriberNotificationMethod.js.map +1 -0
  55. package/build/dist/Types/Workflow/ComponentID.js +1 -0
  56. package/build/dist/Types/Workflow/ComponentID.js.map +1 -1
  57. package/build/dist/Types/Workflow/Components/Discord.js +61 -0
  58. package/build/dist/Types/Workflow/Components/Discord.js.map +1 -0
  59. package/build/dist/Types/Workflow/Components.js +7 -0
  60. package/build/dist/Types/Workflow/Components.js.map +1 -1
  61. package/build/dist/UI/Components/Forms/BasicForm.js +3 -1
  62. package/build/dist/UI/Components/Forms/BasicForm.js.map +1 -1
  63. package/build/dist/UI/Components/Loader/Loader.js +2 -2
  64. package/build/dist/UI/Components/Loader/Loader.js.map +1 -1
  65. package/jest.config.json +1 -1
  66. package/package.json +1 -1
@@ -0,0 +1,400 @@
1
+ import Project from "./Project";
2
+ import StatusPage from "./StatusPage";
3
+ import StatusPageSubscriberNotificationTemplate from "./StatusPageSubscriberNotificationTemplate";
4
+ import User from "./User";
5
+ import BaseModel from "./DatabaseBaseModel/DatabaseBaseModel";
6
+ import Route from "../../Types/API/Route";
7
+ import { PlanType } from "../../Types/Billing/SubscriptionPlan";
8
+ import ColumnAccessControl from "../../Types/Database/AccessControl/ColumnAccessControl";
9
+ import TableAccessControl from "../../Types/Database/AccessControl/TableAccessControl";
10
+ import TableBillingAccessControl from "../../Types/Database/AccessControl/TableBillingAccessControl";
11
+ import ColumnType from "../../Types/Database/ColumnType";
12
+ import CrudApiEndpoint from "../../Types/Database/CrudApiEndpoint";
13
+ import EnableDocumentation from "../../Types/Database/EnableDocumentation";
14
+ import EnableWorkflow from "../../Types/Database/EnableWorkflow";
15
+ import TableColumn from "../../Types/Database/TableColumn";
16
+ import TableColumnType from "../../Types/Database/TableColumnType";
17
+ import TableMetadata from "../../Types/Database/TableMetadata";
18
+ import TenantColumn from "../../Types/Database/TenantColumn";
19
+ import IconProp from "../../Types/Icon/IconProp";
20
+ import ObjectID from "../../Types/ObjectID";
21
+ import Permission from "../../Types/Permission";
22
+ import CanAccessIfCanReadOn from "../../Types/Database/CanAccessIfCanReadOn";
23
+ import { Column, Entity, Index, JoinColumn, ManyToOne } from "typeorm";
24
+
25
+ @EnableDocumentation()
26
+ @TenantColumn("projectId")
27
+ @CanAccessIfCanReadOn("statusPage")
28
+ @TableBillingAccessControl({
29
+ create: PlanType.Scale,
30
+ read: PlanType.Scale,
31
+ update: PlanType.Scale,
32
+ delete: PlanType.Scale,
33
+ })
34
+ @TableAccessControl({
35
+ create: [
36
+ Permission.ProjectOwner,
37
+ Permission.ProjectAdmin,
38
+ Permission.ProjectMember,
39
+ Permission.CreateStatusPageSubscriberNotificationTemplateStatusPage,
40
+ ],
41
+ read: [
42
+ Permission.ProjectOwner,
43
+ Permission.ProjectAdmin,
44
+ Permission.ProjectMember,
45
+ Permission.ReadStatusPageSubscriberNotificationTemplateStatusPage,
46
+ ],
47
+ delete: [
48
+ Permission.ProjectOwner,
49
+ Permission.ProjectAdmin,
50
+ Permission.ProjectMember,
51
+ Permission.DeleteStatusPageSubscriberNotificationTemplateStatusPage,
52
+ ],
53
+ update: [
54
+ Permission.ProjectOwner,
55
+ Permission.ProjectAdmin,
56
+ Permission.ProjectMember,
57
+ Permission.EditStatusPageSubscriberNotificationTemplateStatusPage,
58
+ ],
59
+ })
60
+ @EnableWorkflow({
61
+ create: true,
62
+ delete: true,
63
+ update: true,
64
+ read: true,
65
+ })
66
+ @CrudApiEndpoint(
67
+ new Route("/status-page-subscriber-notification-template-status-page"),
68
+ )
69
+ @TableMetadata({
70
+ tableName: "StatusPageSubscriberNotificationTemplateStatusPage",
71
+ singularName: "Subscriber Notification Template",
72
+ pluralName: "Subscriber Notification Templates",
73
+ icon: IconProp.Link,
74
+ tableDescription:
75
+ "Links subscriber notification templates to specific status pages. This allows you to use different notification templates for different status pages.",
76
+ })
77
+ @Entity({
78
+ name: "StatusPageSubscriberNotificationTemplateStatusPage",
79
+ })
80
+ export default class StatusPageSubscriberNotificationTemplateStatusPage extends BaseModel {
81
+ @ColumnAccessControl({
82
+ create: [
83
+ Permission.ProjectOwner,
84
+ Permission.ProjectAdmin,
85
+ Permission.ProjectMember,
86
+ Permission.CreateStatusPageSubscriberNotificationTemplateStatusPage,
87
+ ],
88
+ read: [
89
+ Permission.ProjectOwner,
90
+ Permission.ProjectAdmin,
91
+ Permission.ProjectMember,
92
+ Permission.ReadStatusPageSubscriberNotificationTemplateStatusPage,
93
+ ],
94
+ update: [],
95
+ })
96
+ @TableColumn({
97
+ manyToOneRelationColumn: "projectId",
98
+ type: TableColumnType.Entity,
99
+ modelType: Project,
100
+ title: "Project",
101
+ description: "Relation to Project Resource in which this object belongs",
102
+ })
103
+ @ManyToOne(
104
+ () => {
105
+ return Project;
106
+ },
107
+ {
108
+ eager: false,
109
+ nullable: true,
110
+ onDelete: "CASCADE",
111
+ orphanedRowAction: "nullify",
112
+ },
113
+ )
114
+ @JoinColumn({ name: "projectId" })
115
+ public project?: Project = undefined;
116
+
117
+ @ColumnAccessControl({
118
+ create: [
119
+ Permission.ProjectOwner,
120
+ Permission.ProjectAdmin,
121
+ Permission.ProjectMember,
122
+ Permission.CreateStatusPageSubscriberNotificationTemplateStatusPage,
123
+ ],
124
+ read: [
125
+ Permission.ProjectOwner,
126
+ Permission.ProjectAdmin,
127
+ Permission.ProjectMember,
128
+ Permission.ReadStatusPageSubscriberNotificationTemplateStatusPage,
129
+ ],
130
+ update: [],
131
+ })
132
+ @Index()
133
+ @TableColumn({
134
+ type: TableColumnType.ObjectID,
135
+ required: true,
136
+ canReadOnRelationQuery: true,
137
+ title: "Project ID",
138
+ description: "ID of your OneUptime Project in which this object belongs",
139
+ })
140
+ @Column({
141
+ type: ColumnType.ObjectID,
142
+ nullable: false,
143
+ transformer: ObjectID.getDatabaseTransformer(),
144
+ })
145
+ public projectId?: ObjectID = undefined;
146
+
147
+ @ColumnAccessControl({
148
+ create: [
149
+ Permission.ProjectOwner,
150
+ Permission.ProjectAdmin,
151
+ Permission.ProjectMember,
152
+ Permission.CreateStatusPageSubscriberNotificationTemplateStatusPage,
153
+ ],
154
+ read: [
155
+ Permission.ProjectOwner,
156
+ Permission.ProjectAdmin,
157
+ Permission.ProjectMember,
158
+ Permission.ReadStatusPageSubscriberNotificationTemplateStatusPage,
159
+ ],
160
+ update: [],
161
+ })
162
+ @TableColumn({
163
+ manyToOneRelationColumn: "statusPageId",
164
+ type: TableColumnType.Entity,
165
+ modelType: StatusPage,
166
+ title: "Status Page",
167
+ description: "Status Page this template is linked to",
168
+ })
169
+ @ManyToOne(
170
+ () => {
171
+ return StatusPage;
172
+ },
173
+ {
174
+ eager: false,
175
+ nullable: false,
176
+ onDelete: "CASCADE",
177
+ orphanedRowAction: "nullify",
178
+ },
179
+ )
180
+ @JoinColumn({ name: "statusPageId" })
181
+ public statusPage?: StatusPage = undefined;
182
+
183
+ @ColumnAccessControl({
184
+ create: [
185
+ Permission.ProjectOwner,
186
+ Permission.ProjectAdmin,
187
+ Permission.ProjectMember,
188
+ Permission.CreateStatusPageSubscriberNotificationTemplateStatusPage,
189
+ ],
190
+ read: [
191
+ Permission.ProjectOwner,
192
+ Permission.ProjectAdmin,
193
+ Permission.ProjectMember,
194
+ Permission.ReadStatusPageSubscriberNotificationTemplateStatusPage,
195
+ ],
196
+ update: [],
197
+ })
198
+ @Index()
199
+ @TableColumn({
200
+ type: TableColumnType.ObjectID,
201
+ required: true,
202
+ canReadOnRelationQuery: true,
203
+ title: "Status Page ID",
204
+ description: "ID of the Status Page this template is linked to",
205
+ })
206
+ @Column({
207
+ type: ColumnType.ObjectID,
208
+ nullable: false,
209
+ transformer: ObjectID.getDatabaseTransformer(),
210
+ })
211
+ public statusPageId?: ObjectID = undefined;
212
+
213
+ @ColumnAccessControl({
214
+ create: [
215
+ Permission.ProjectOwner,
216
+ Permission.ProjectAdmin,
217
+ Permission.ProjectMember,
218
+ Permission.CreateStatusPageSubscriberNotificationTemplateStatusPage,
219
+ ],
220
+ read: [
221
+ Permission.ProjectOwner,
222
+ Permission.ProjectAdmin,
223
+ Permission.ProjectMember,
224
+ Permission.ReadStatusPageSubscriberNotificationTemplateStatusPage,
225
+ ],
226
+ update: [
227
+ Permission.ProjectOwner,
228
+ Permission.ProjectAdmin,
229
+ Permission.ProjectMember,
230
+ Permission.EditStatusPageSubscriberNotificationTemplateStatusPage,
231
+ ],
232
+ })
233
+ @TableColumn({
234
+ manyToOneRelationColumn: "statusPageSubscriberNotificationTemplateId",
235
+ type: TableColumnType.Entity,
236
+ modelType: StatusPageSubscriberNotificationTemplate,
237
+ title: "Notification Template",
238
+ description: "The notification template to use for this status page",
239
+ })
240
+ @ManyToOne(
241
+ () => {
242
+ return StatusPageSubscriberNotificationTemplate;
243
+ },
244
+ {
245
+ eager: false,
246
+ nullable: false,
247
+ onDelete: "CASCADE",
248
+ orphanedRowAction: "nullify",
249
+ },
250
+ )
251
+ @JoinColumn({ name: "statusPageSubscriberNotificationTemplateId" })
252
+ public statusPageSubscriberNotificationTemplate?: StatusPageSubscriberNotificationTemplate =
253
+ undefined;
254
+
255
+ @ColumnAccessControl({
256
+ create: [
257
+ Permission.ProjectOwner,
258
+ Permission.ProjectAdmin,
259
+ Permission.ProjectMember,
260
+ Permission.CreateStatusPageSubscriberNotificationTemplateStatusPage,
261
+ ],
262
+ read: [
263
+ Permission.ProjectOwner,
264
+ Permission.ProjectAdmin,
265
+ Permission.ProjectMember,
266
+ Permission.ReadStatusPageSubscriberNotificationTemplateStatusPage,
267
+ ],
268
+ update: [
269
+ Permission.ProjectOwner,
270
+ Permission.ProjectAdmin,
271
+ Permission.ProjectMember,
272
+ Permission.EditStatusPageSubscriberNotificationTemplateStatusPage,
273
+ ],
274
+ })
275
+ @Index()
276
+ @TableColumn({
277
+ type: TableColumnType.ObjectID,
278
+ required: true,
279
+ canReadOnRelationQuery: true,
280
+ title: "Notification Template ID",
281
+ description: "ID of the notification template linked to this status page",
282
+ })
283
+ @Column({
284
+ type: ColumnType.ObjectID,
285
+ nullable: false,
286
+ transformer: ObjectID.getDatabaseTransformer(),
287
+ })
288
+ public statusPageSubscriberNotificationTemplateId?: ObjectID = undefined;
289
+
290
+ @ColumnAccessControl({
291
+ create: [],
292
+ read: [
293
+ Permission.ProjectOwner,
294
+ Permission.ProjectAdmin,
295
+ Permission.ProjectMember,
296
+ Permission.ReadStatusPageSubscriberNotificationTemplateStatusPage,
297
+ ],
298
+ update: [],
299
+ })
300
+ @TableColumn({
301
+ manyToOneRelationColumn: "createdByUserId",
302
+ type: TableColumnType.Entity,
303
+ modelType: User,
304
+ title: "Created by User",
305
+ description:
306
+ "Relation to User who created this object (if this object was created by a User)",
307
+ })
308
+ @ManyToOne(
309
+ () => {
310
+ return User;
311
+ },
312
+ {
313
+ eager: false,
314
+ nullable: true,
315
+ onDelete: "SET NULL",
316
+ orphanedRowAction: "nullify",
317
+ },
318
+ )
319
+ @JoinColumn({ name: "createdByUserId" })
320
+ public createdByUser?: User = undefined;
321
+
322
+ @ColumnAccessControl({
323
+ create: [
324
+ Permission.ProjectOwner,
325
+ Permission.ProjectAdmin,
326
+ Permission.ProjectMember,
327
+ Permission.CreateStatusPageSubscriberNotificationTemplateStatusPage,
328
+ ],
329
+ read: [
330
+ Permission.ProjectOwner,
331
+ Permission.ProjectAdmin,
332
+ Permission.ProjectMember,
333
+ Permission.ReadStatusPageSubscriberNotificationTemplateStatusPage,
334
+ ],
335
+ update: [],
336
+ })
337
+ @TableColumn({
338
+ type: TableColumnType.ObjectID,
339
+ title: "Created by User ID",
340
+ description:
341
+ "User ID who created this object (if this object was created by a User)",
342
+ })
343
+ @Column({
344
+ type: ColumnType.ObjectID,
345
+ nullable: true,
346
+ transformer: ObjectID.getDatabaseTransformer(),
347
+ })
348
+ public createdByUserId?: ObjectID = undefined;
349
+
350
+ @ColumnAccessControl({
351
+ create: [],
352
+ read: [
353
+ Permission.ProjectOwner,
354
+ Permission.ProjectAdmin,
355
+ Permission.ProjectMember,
356
+ Permission.ReadStatusPageSubscriberNotificationTemplateStatusPage,
357
+ ],
358
+ update: [],
359
+ })
360
+ @TableColumn({
361
+ manyToOneRelationColumn: "deletedByUserId",
362
+ type: TableColumnType.Entity,
363
+ title: "Deleted by User",
364
+ modelType: User,
365
+ description:
366
+ "Relation to User who deleted this object (if this object was deleted by a User)",
367
+ })
368
+ @ManyToOne(
369
+ () => {
370
+ return User;
371
+ },
372
+ {
373
+ cascade: false,
374
+ eager: false,
375
+ nullable: true,
376
+ onDelete: "SET NULL",
377
+ orphanedRowAction: "nullify",
378
+ },
379
+ )
380
+ @JoinColumn({ name: "deletedByUserId" })
381
+ public deletedByUser?: User = undefined;
382
+
383
+ @ColumnAccessControl({
384
+ create: [],
385
+ read: [],
386
+ update: [],
387
+ })
388
+ @TableColumn({
389
+ type: TableColumnType.ObjectID,
390
+ title: "Deleted by User ID",
391
+ description:
392
+ "User ID who deleted this object (if this object was deleted by a User)",
393
+ })
394
+ @Column({
395
+ type: ColumnType.ObjectID,
396
+ nullable: true,
397
+ transformer: ObjectID.getDatabaseTransformer(),
398
+ })
399
+ public deletedByUserId?: ObjectID = undefined;
400
+ }
@@ -0,0 +1,107 @@
1
+ import { MigrationInterface, QueryRunner } from "typeorm";
2
+
3
+ export class MigrationName1765195603978 implements MigrationInterface {
4
+ public name = "MigrationName1765195603978";
5
+
6
+ public async up(queryRunner: QueryRunner): Promise<void> {
7
+ await queryRunner.query(
8
+ `CREATE TABLE "StatusPageSubscriberNotificationTemplate" ("_id" uuid NOT NULL DEFAULT uuid_generate_v4(), "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "updatedAt" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "deletedAt" TIMESTAMP WITH TIME ZONE, "version" integer NOT NULL, "projectId" uuid NOT NULL, "templateName" character varying(100) NOT NULL, "templateDescription" character varying(500), "eventType" character varying(100) NOT NULL, "notificationMethod" character varying(100) NOT NULL, "emailSubject" character varying(100), "templateBody" text NOT NULL, "createdByUserId" uuid, "deletedByUserId" uuid, CONSTRAINT "PK_888aab2dd71014a62b1e63d0a84" PRIMARY KEY ("_id"))`,
9
+ );
10
+ await queryRunner.query(
11
+ `CREATE INDEX "IDX_4e26098c2348c3c174445f684c" ON "StatusPageSubscriberNotificationTemplate" ("projectId") `,
12
+ );
13
+ await queryRunner.query(
14
+ `CREATE INDEX "IDX_a96cca1609d2b6c6c304591919" ON "StatusPageSubscriberNotificationTemplate" ("eventType") `,
15
+ );
16
+ await queryRunner.query(
17
+ `CREATE INDEX "IDX_2e059fde7e7d36c351b9781aee" ON "StatusPageSubscriberNotificationTemplate" ("notificationMethod") `,
18
+ );
19
+ await queryRunner.query(
20
+ `CREATE TABLE "StatusPageSubscriberNotificationTemplateStatusPage" ("_id" uuid NOT NULL DEFAULT uuid_generate_v4(), "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "updatedAt" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "deletedAt" TIMESTAMP WITH TIME ZONE, "version" integer NOT NULL, "projectId" uuid NOT NULL, "statusPageId" uuid NOT NULL, "statusPageSubscriberNotificationTemplateId" uuid NOT NULL, "createdByUserId" uuid, "deletedByUserId" uuid, CONSTRAINT "PK_4e9d88b250d2b9ade6e9ed8835a" PRIMARY KEY ("_id"))`,
21
+ );
22
+ await queryRunner.query(
23
+ `CREATE INDEX "IDX_0f5949a20800915de6803e1c90" ON "StatusPageSubscriberNotificationTemplateStatusPage" ("projectId") `,
24
+ );
25
+ await queryRunner.query(
26
+ `CREATE INDEX "IDX_8c9b514bad5354de082eb0df3f" ON "StatusPageSubscriberNotificationTemplateStatusPage" ("statusPageId") `,
27
+ );
28
+ await queryRunner.query(
29
+ `CREATE INDEX "IDX_9bdd3b77bb407157739b625d66" ON "StatusPageSubscriberNotificationTemplateStatusPage" ("statusPageSubscriberNotificationTemplateId") `,
30
+ );
31
+ await queryRunner.query(
32
+ `ALTER TABLE "StatusPageSubscriberNotificationTemplate" ADD CONSTRAINT "FK_4e26098c2348c3c174445f684c8" FOREIGN KEY ("projectId") REFERENCES "Project"("_id") ON DELETE CASCADE ON UPDATE NO ACTION`,
33
+ );
34
+ await queryRunner.query(
35
+ `ALTER TABLE "StatusPageSubscriberNotificationTemplate" ADD CONSTRAINT "FK_bf757acb0d1e9fc9fa8275e9253" FOREIGN KEY ("createdByUserId") REFERENCES "User"("_id") ON DELETE SET NULL ON UPDATE NO ACTION`,
36
+ );
37
+ await queryRunner.query(
38
+ `ALTER TABLE "StatusPageSubscriberNotificationTemplate" ADD CONSTRAINT "FK_3816e7182ec941de644cd50f0c6" FOREIGN KEY ("deletedByUserId") REFERENCES "User"("_id") ON DELETE SET NULL ON UPDATE NO ACTION`,
39
+ );
40
+ await queryRunner.query(
41
+ `ALTER TABLE "StatusPageSubscriberNotificationTemplateStatusPage" ADD CONSTRAINT "FK_0f5949a20800915de6803e1c90c" FOREIGN KEY ("projectId") REFERENCES "Project"("_id") ON DELETE CASCADE ON UPDATE NO ACTION`,
42
+ );
43
+ await queryRunner.query(
44
+ `ALTER TABLE "StatusPageSubscriberNotificationTemplateStatusPage" ADD CONSTRAINT "FK_8c9b514bad5354de082eb0df3f1" FOREIGN KEY ("statusPageId") REFERENCES "StatusPage"("_id") ON DELETE CASCADE ON UPDATE NO ACTION`,
45
+ );
46
+ await queryRunner.query(
47
+ `ALTER TABLE "StatusPageSubscriberNotificationTemplateStatusPage" ADD CONSTRAINT "FK_9bdd3b77bb407157739b625d66e" FOREIGN KEY ("statusPageSubscriberNotificationTemplateId") REFERENCES "StatusPageSubscriberNotificationTemplate"("_id") ON DELETE CASCADE ON UPDATE NO ACTION`,
48
+ );
49
+ await queryRunner.query(
50
+ `ALTER TABLE "StatusPageSubscriberNotificationTemplateStatusPage" ADD CONSTRAINT "FK_0a2c2209fd6900274784ca6e0ec" FOREIGN KEY ("createdByUserId") REFERENCES "User"("_id") ON DELETE SET NULL ON UPDATE NO ACTION`,
51
+ );
52
+ await queryRunner.query(
53
+ `ALTER TABLE "StatusPageSubscriberNotificationTemplateStatusPage" ADD CONSTRAINT "FK_4284edba6904c9f02ce7d85c445" FOREIGN KEY ("deletedByUserId") REFERENCES "User"("_id") ON DELETE SET NULL ON UPDATE NO ACTION`,
54
+ );
55
+ }
56
+
57
+ public async down(queryRunner: QueryRunner): Promise<void> {
58
+ await queryRunner.query(
59
+ `ALTER TABLE "StatusPageSubscriberNotificationTemplateStatusPage" DROP CONSTRAINT "FK_4284edba6904c9f02ce7d85c445"`,
60
+ );
61
+ await queryRunner.query(
62
+ `ALTER TABLE "StatusPageSubscriberNotificationTemplateStatusPage" DROP CONSTRAINT "FK_0a2c2209fd6900274784ca6e0ec"`,
63
+ );
64
+ await queryRunner.query(
65
+ `ALTER TABLE "StatusPageSubscriberNotificationTemplateStatusPage" DROP CONSTRAINT "FK_9bdd3b77bb407157739b625d66e"`,
66
+ );
67
+ await queryRunner.query(
68
+ `ALTER TABLE "StatusPageSubscriberNotificationTemplateStatusPage" DROP CONSTRAINT "FK_8c9b514bad5354de082eb0df3f1"`,
69
+ );
70
+ await queryRunner.query(
71
+ `ALTER TABLE "StatusPageSubscriberNotificationTemplateStatusPage" DROP CONSTRAINT "FK_0f5949a20800915de6803e1c90c"`,
72
+ );
73
+ await queryRunner.query(
74
+ `ALTER TABLE "StatusPageSubscriberNotificationTemplate" DROP CONSTRAINT "FK_3816e7182ec941de644cd50f0c6"`,
75
+ );
76
+ await queryRunner.query(
77
+ `ALTER TABLE "StatusPageSubscriberNotificationTemplate" DROP CONSTRAINT "FK_bf757acb0d1e9fc9fa8275e9253"`,
78
+ );
79
+ await queryRunner.query(
80
+ `ALTER TABLE "StatusPageSubscriberNotificationTemplate" DROP CONSTRAINT "FK_4e26098c2348c3c174445f684c8"`,
81
+ );
82
+ await queryRunner.query(
83
+ `DROP INDEX "public"."IDX_9bdd3b77bb407157739b625d66"`,
84
+ );
85
+ await queryRunner.query(
86
+ `DROP INDEX "public"."IDX_8c9b514bad5354de082eb0df3f"`,
87
+ );
88
+ await queryRunner.query(
89
+ `DROP INDEX "public"."IDX_0f5949a20800915de6803e1c90"`,
90
+ );
91
+ await queryRunner.query(
92
+ `DROP TABLE "StatusPageSubscriberNotificationTemplateStatusPage"`,
93
+ );
94
+ await queryRunner.query(
95
+ `DROP INDEX "public"."IDX_2e059fde7e7d36c351b9781aee"`,
96
+ );
97
+ await queryRunner.query(
98
+ `DROP INDEX "public"."IDX_a96cca1609d2b6c6c304591919"`,
99
+ );
100
+ await queryRunner.query(
101
+ `DROP INDEX "public"."IDX_4e26098c2348c3c174445f684c"`,
102
+ );
103
+ await queryRunner.query(
104
+ `DROP TABLE "StatusPageSubscriberNotificationTemplate"`,
105
+ );
106
+ }
107
+ }
@@ -191,6 +191,7 @@ import { MigrationName1764762146063 } from "./1764762146063-MigrationName";
191
191
  import { MigrationName1764767371788 } from "./1764767371788-MigrationName";
192
192
  import { MigrationName1764789433216 } from "./1764789433216-MigrationName";
193
193
  import { MigrationName1764850876394 } from "./1764850876394-MigrationName";
194
+ import { MigrationName1765195603978 } from "./1765195603978-MigrationName";
194
195
 
195
196
  export default [
196
197
  InitialMigration,
@@ -386,4 +387,5 @@ export default [
386
387
  MigrationName1764767371788,
387
388
  MigrationName1764789433216,
388
389
  MigrationName1764850876394,
390
+ MigrationName1765195603978,
389
391
  ];
@@ -112,6 +112,8 @@ import StatusPageResourceService from "./StatusPageResourceService";
112
112
  import StatusPageService from "./StatusPageService";
113
113
  import StatusPageSsoService from "./StatusPageSsoService";
114
114
  import StatusPageSubscriberService from "./StatusPageSubscriberService";
115
+ import StatusPageSubscriberNotificationTemplateService from "./StatusPageSubscriberNotificationTemplateService";
116
+ import StatusPageSubscriberNotificationTemplateStatusPageService from "./StatusPageSubscriberNotificationTemplateStatusPageService";
115
117
  import TeamMemberService from "./TeamMemberService";
116
118
  import TeamPermissionService from "./TeamPermissionService";
117
119
  import TeamComplianceSettingService from "./TeamComplianceSettingService";
@@ -273,6 +275,8 @@ const services: Array<BaseService> = [
273
275
  StatusPageService,
274
276
  StatusPageSsoService,
275
277
  StatusPageSubscriberService,
278
+ StatusPageSubscriberNotificationTemplateService,
279
+ StatusPageSubscriberNotificationTemplateStatusPageService,
276
280
  StatusPageHistoryChartBarColorRuleService,
277
281
 
278
282
  TeamMemberService,