@oneuptime/common 10.2.3 → 10.2.4

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 (40) hide show
  1. package/Models/DatabaseModels/Index.ts +2 -0
  2. package/Models/DatabaseModels/StatusPage.ts +43 -0
  3. package/Models/DatabaseModels/StatusPageOidc.ts +689 -0
  4. package/Server/API/StatusPageAPI.ts +78 -3
  5. package/Server/Infrastructure/Postgres/SchemaMigrations/1778521361934-MigrationName.ts +17 -0
  6. package/Server/Infrastructure/Postgres/SchemaMigrations/1778522070962-AddStatusPageOIDC.ts +63 -0
  7. package/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts +4 -0
  8. package/Server/Services/Index.ts +2 -0
  9. package/Server/Services/ScheduledMaintenanceService.ts +34 -0
  10. package/Server/Services/StatusPageOidcService.ts +10 -0
  11. package/Server/Services/StatusPageSubscriberService.ts +101 -0
  12. package/Server/Utils/StatusPageSubscriberWebhook.ts +39 -0
  13. package/Types/Permission.ts +46 -0
  14. package/build/dist/Models/DatabaseModels/Index.js +2 -0
  15. package/build/dist/Models/DatabaseModels/Index.js.map +1 -1
  16. package/build/dist/Models/DatabaseModels/StatusPage.js +45 -0
  17. package/build/dist/Models/DatabaseModels/StatusPage.js.map +1 -1
  18. package/build/dist/Models/DatabaseModels/StatusPageOidc.js +718 -0
  19. package/build/dist/Models/DatabaseModels/StatusPageOidc.js.map +1 -0
  20. package/build/dist/Server/API/StatusPageAPI.js +80 -35
  21. package/build/dist/Server/API/StatusPageAPI.js.map +1 -1
  22. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1778521361934-MigrationName.js +12 -0
  23. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1778521361934-MigrationName.js.map +1 -0
  24. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1778522070962-AddStatusPageOIDC.js +28 -0
  25. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1778522070962-AddStatusPageOIDC.js.map +1 -0
  26. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js +4 -0
  27. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js.map +1 -1
  28. package/build/dist/Server/Services/Index.js +2 -0
  29. package/build/dist/Server/Services/Index.js.map +1 -1
  30. package/build/dist/Server/Services/ScheduledMaintenanceService.js +31 -2
  31. package/build/dist/Server/Services/ScheduledMaintenanceService.js.map +1 -1
  32. package/build/dist/Server/Services/StatusPageOidcService.js +9 -0
  33. package/build/dist/Server/Services/StatusPageOidcService.js.map +1 -0
  34. package/build/dist/Server/Services/StatusPageSubscriberService.js +99 -4
  35. package/build/dist/Server/Services/StatusPageSubscriberService.js.map +1 -1
  36. package/build/dist/Server/Utils/StatusPageSubscriberWebhook.js +19 -0
  37. package/build/dist/Server/Utils/StatusPageSubscriberWebhook.js.map +1 -0
  38. package/build/dist/Types/Permission.js +40 -0
  39. package/build/dist/Types/Permission.js.map +1 -1
  40. package/package.json +1 -1
@@ -0,0 +1,689 @@
1
+ import Project from "./Project";
2
+ import StatusPage from "./StatusPage";
3
+ import User from "./User";
4
+ import BaseModel from "./DatabaseBaseModel/DatabaseBaseModel";
5
+ import Route from "../../Types/API/Route";
6
+ import URL from "../../Types/API/URL";
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 ColumnLength from "../../Types/Database/ColumnLength";
12
+ import ColumnType from "../../Types/Database/ColumnType";
13
+ import CrudApiEndpoint from "../../Types/Database/CrudApiEndpoint";
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 UniqueColumnBy from "../../Types/Database/UniqueColumnBy";
19
+ import IconProp from "../../Types/Icon/IconProp";
20
+ import ObjectID from "../../Types/ObjectID";
21
+ import Permission from "../../Types/Permission";
22
+ import { Column, Entity, Index, JoinColumn, ManyToOne } from "typeorm";
23
+
24
+ @TableBillingAccessControl({
25
+ create: PlanType.Scale,
26
+ read: PlanType.Scale,
27
+ update: PlanType.Scale,
28
+ delete: PlanType.Scale,
29
+ })
30
+ @TenantColumn("projectId")
31
+ @TableAccessControl({
32
+ create: [
33
+ Permission.ProjectOwner,
34
+ Permission.ProjectAdmin,
35
+ Permission.CreateStatusPageOIDC,
36
+ ],
37
+ read: [
38
+ Permission.ProjectOwner,
39
+ Permission.ProjectUser,
40
+ Permission.Public,
41
+ Permission.ProjectAdmin,
42
+ Permission.ReadStatusPageOIDC,
43
+ Permission.ReadAllProjectResources,
44
+ ],
45
+ delete: [
46
+ Permission.ProjectOwner,
47
+ Permission.ProjectAdmin,
48
+ Permission.DeleteStatusPageOIDC,
49
+ ],
50
+ update: [
51
+ Permission.ProjectOwner,
52
+ Permission.ProjectAdmin,
53
+ Permission.EditStatusPageOIDC,
54
+ ],
55
+ })
56
+ @CrudApiEndpoint(new Route("/status-page-oidc"))
57
+ @TableMetadata({
58
+ tableName: "StatusPageOIDC",
59
+ singularName: "Status Page OIDC",
60
+ pluralName: "Status Page OIDC",
61
+ icon: IconProp.Lock,
62
+ tableDescription:
63
+ "Manage OpenID Connect (OIDC) authentication for your status page",
64
+ })
65
+ @Entity({
66
+ name: "StatusPageOIDC",
67
+ })
68
+ export default class StatusPageOIDC extends BaseModel {
69
+ @ColumnAccessControl({
70
+ create: [
71
+ Permission.ProjectOwner,
72
+ Permission.ProjectAdmin,
73
+ Permission.CreateStatusPageOIDC,
74
+ ],
75
+ read: [
76
+ Permission.ProjectOwner,
77
+ Permission.ProjectAdmin,
78
+ Permission.ProjectUser,
79
+ Permission.Public,
80
+ Permission.ReadStatusPageOIDC,
81
+ Permission.ReadAllProjectResources,
82
+ ],
83
+ update: [],
84
+ })
85
+ @TableColumn({
86
+ manyToOneRelationColumn: "projectId",
87
+ type: TableColumnType.Entity,
88
+ modelType: Project,
89
+ title: "Project",
90
+ description: "Relation to Project Resource in which this object belongs",
91
+ })
92
+ @ManyToOne(
93
+ () => {
94
+ return Project;
95
+ },
96
+ {
97
+ eager: false,
98
+ nullable: true,
99
+ onDelete: "CASCADE",
100
+ orphanedRowAction: "nullify",
101
+ },
102
+ )
103
+ @JoinColumn({ name: "projectId" })
104
+ public project?: Project = undefined;
105
+
106
+ @ColumnAccessControl({
107
+ create: [
108
+ Permission.ProjectOwner,
109
+ Permission.ProjectAdmin,
110
+ Permission.CreateStatusPageOIDC,
111
+ ],
112
+ read: [
113
+ Permission.ProjectOwner,
114
+ Permission.ProjectAdmin,
115
+ Permission.ProjectUser,
116
+ Permission.Public,
117
+ Permission.ReadStatusPageOIDC,
118
+ Permission.ReadAllProjectResources,
119
+ ],
120
+ update: [],
121
+ })
122
+ @Index()
123
+ @TableColumn({
124
+ type: TableColumnType.ObjectID,
125
+ required: true,
126
+ canReadOnRelationQuery: true,
127
+ title: "Project ID",
128
+ description: "ID of your OneUptime Project in which this object belongs",
129
+ example: "5f8b9c0d-e1a2-4b3c-8d5e-6f7a8b9c0d1e",
130
+ })
131
+ @Column({
132
+ type: ColumnType.ObjectID,
133
+ nullable: false,
134
+ transformer: ObjectID.getDatabaseTransformer(),
135
+ })
136
+ public projectId?: ObjectID = undefined;
137
+
138
+ @ColumnAccessControl({
139
+ create: [
140
+ Permission.ProjectOwner,
141
+ Permission.ProjectAdmin,
142
+ Permission.ProjectMember,
143
+ Permission.StatusPageManager,
144
+ Permission.CreateStatusPageOIDC,
145
+ ],
146
+ read: [
147
+ Permission.ProjectOwner,
148
+ Permission.ProjectAdmin,
149
+ Permission.ProjectMember,
150
+ Permission.Viewer,
151
+ Permission.StatusPageManager,
152
+ Permission.ReadStatusPageOIDC,
153
+ Permission.ReadAllProjectResources,
154
+ ],
155
+ update: [],
156
+ })
157
+ @TableColumn({
158
+ manyToOneRelationColumn: "statusPageId",
159
+ type: TableColumnType.Entity,
160
+ modelType: StatusPage,
161
+ title: "Status Page",
162
+ description:
163
+ "Relation to Status Page Resource in which this object belongs",
164
+ })
165
+ @ManyToOne(
166
+ () => {
167
+ return StatusPage;
168
+ },
169
+ {
170
+ eager: false,
171
+ nullable: true,
172
+ onDelete: "CASCADE",
173
+ orphanedRowAction: "nullify",
174
+ },
175
+ )
176
+ @JoinColumn({ name: "statusPageId" })
177
+ public statusPage?: StatusPage = undefined;
178
+
179
+ @ColumnAccessControl({
180
+ create: [
181
+ Permission.ProjectOwner,
182
+ Permission.ProjectAdmin,
183
+ Permission.ProjectMember,
184
+ Permission.StatusPageManager,
185
+ Permission.CreateStatusPageOIDC,
186
+ ],
187
+ read: [
188
+ Permission.ProjectOwner,
189
+ Permission.ProjectAdmin,
190
+ Permission.ProjectMember,
191
+ Permission.Viewer,
192
+ Permission.StatusPageManager,
193
+ Permission.ReadStatusPageOIDC,
194
+ Permission.ReadAllProjectResources,
195
+ ],
196
+ update: [],
197
+ })
198
+ @Index()
199
+ @TableColumn({
200
+ type: TableColumnType.ObjectID,
201
+ required: true,
202
+ title: "Status Page ID",
203
+ description: "ID of your Status Page resource where this object belongs",
204
+ example: "a1b2c3d4-e5f6-7890-a1b2-c3d4e5f67890",
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.CreateStatusPageOIDC,
218
+ ],
219
+ read: [
220
+ Permission.ProjectOwner,
221
+ Permission.ProjectAdmin,
222
+ Permission.ProjectUser,
223
+ Permission.Public,
224
+ Permission.ReadStatusPageOIDC,
225
+ Permission.ReadAllProjectResources,
226
+ ],
227
+ update: [
228
+ Permission.ProjectOwner,
229
+ Permission.ProjectAdmin,
230
+ Permission.EditStatusPageOIDC,
231
+ ],
232
+ })
233
+ @TableColumn({
234
+ required: true,
235
+ type: TableColumnType.ShortText,
236
+ canReadOnRelationQuery: true,
237
+ title: "Name",
238
+ description: "Any friendly name of this object",
239
+ example: "Okta OIDC",
240
+ })
241
+ @Column({
242
+ nullable: false,
243
+ type: ColumnType.ShortText,
244
+ length: ColumnLength.ShortText,
245
+ })
246
+ @UniqueColumnBy("statusPageId")
247
+ public name?: string = undefined;
248
+
249
+ @ColumnAccessControl({
250
+ create: [
251
+ Permission.ProjectOwner,
252
+ Permission.ProjectAdmin,
253
+ Permission.CreateStatusPageOIDC,
254
+ ],
255
+ read: [
256
+ Permission.ProjectOwner,
257
+ Permission.ProjectAdmin,
258
+ Permission.ProjectUser,
259
+ Permission.Public,
260
+ Permission.ReadStatusPageOIDC,
261
+ Permission.ReadAllProjectResources,
262
+ ],
263
+ update: [
264
+ Permission.ProjectOwner,
265
+ Permission.ProjectAdmin,
266
+ Permission.EditStatusPageOIDC,
267
+ ],
268
+ })
269
+ @TableColumn({
270
+ required: true,
271
+ type: TableColumnType.LongText,
272
+ canReadOnRelationQuery: true,
273
+ example:
274
+ "Sign in to the status page using your corporate OpenID Connect provider.",
275
+ })
276
+ @Column({
277
+ nullable: false,
278
+ type: ColumnType.LongText,
279
+ })
280
+ public description?: string = undefined;
281
+
282
+ @ColumnAccessControl({
283
+ create: [
284
+ Permission.ProjectOwner,
285
+ Permission.ProjectAdmin,
286
+ Permission.CreateStatusPageOIDC,
287
+ ],
288
+ read: [
289
+ Permission.ProjectOwner,
290
+ Permission.ProjectAdmin,
291
+ Permission.ReadStatusPageOIDC,
292
+ Permission.ReadAllProjectResources,
293
+ ],
294
+ update: [
295
+ Permission.ProjectOwner,
296
+ Permission.ProjectAdmin,
297
+ Permission.EditStatusPageOIDC,
298
+ ],
299
+ })
300
+ @TableColumn({
301
+ required: true,
302
+ type: TableColumnType.LongURL,
303
+ canReadOnRelationQuery: true,
304
+ description:
305
+ "OIDC discovery URL (typically ends in /.well-known/openid-configuration). Used to discover authorization, token, JWKS and userinfo endpoints.",
306
+ example: "https://accounts.google.com/.well-known/openid-configuration",
307
+ })
308
+ @Column({
309
+ nullable: false,
310
+ type: ColumnType.LongURL,
311
+ transformer: URL.getDatabaseTransformer(),
312
+ })
313
+ public discoveryURL?: URL = undefined;
314
+
315
+ @ColumnAccessControl({
316
+ create: [
317
+ Permission.ProjectOwner,
318
+ Permission.ProjectAdmin,
319
+ Permission.CreateStatusPageOIDC,
320
+ ],
321
+ read: [
322
+ Permission.ProjectOwner,
323
+ Permission.ProjectAdmin,
324
+ Permission.ReadStatusPageOIDC,
325
+ Permission.ReadAllProjectResources,
326
+ ],
327
+ update: [
328
+ Permission.ProjectOwner,
329
+ Permission.ProjectAdmin,
330
+ Permission.EditStatusPageOIDC,
331
+ ],
332
+ })
333
+ @TableColumn({
334
+ required: true,
335
+ type: TableColumnType.LongURL,
336
+ canReadOnRelationQuery: true,
337
+ description:
338
+ "Expected OIDC issuer URL. Must match the 'iss' claim in the ID token returned by the identity provider.",
339
+ example: "https://accounts.google.com",
340
+ })
341
+ @Column({
342
+ nullable: false,
343
+ type: ColumnType.LongURL,
344
+ transformer: URL.getDatabaseTransformer(),
345
+ })
346
+ public issuerURL?: URL = undefined;
347
+
348
+ @ColumnAccessControl({
349
+ create: [
350
+ Permission.ProjectOwner,
351
+ Permission.ProjectAdmin,
352
+ Permission.CreateStatusPageOIDC,
353
+ ],
354
+ read: [
355
+ Permission.ProjectOwner,
356
+ Permission.ProjectAdmin,
357
+ Permission.ReadStatusPageOIDC,
358
+ Permission.ReadAllProjectResources,
359
+ ],
360
+ update: [
361
+ Permission.ProjectOwner,
362
+ Permission.ProjectAdmin,
363
+ Permission.EditStatusPageOIDC,
364
+ ],
365
+ })
366
+ @TableColumn({
367
+ required: true,
368
+ type: TableColumnType.ShortText,
369
+ canReadOnRelationQuery: true,
370
+ description: "OIDC client ID issued by the identity provider.",
371
+ example: "1234567890-abcdefgh.apps.googleusercontent.com",
372
+ })
373
+ @Column({
374
+ nullable: false,
375
+ type: ColumnType.ShortText,
376
+ length: ColumnLength.ShortText,
377
+ })
378
+ public clientId?: string = undefined;
379
+
380
+ @ColumnAccessControl({
381
+ create: [
382
+ Permission.ProjectOwner,
383
+ Permission.ProjectAdmin,
384
+ Permission.CreateStatusPageOIDC,
385
+ ],
386
+ read: [
387
+ Permission.ProjectOwner,
388
+ Permission.ProjectAdmin,
389
+ Permission.ReadStatusPageOIDC,
390
+ Permission.ReadAllProjectResources,
391
+ ],
392
+ update: [
393
+ Permission.ProjectOwner,
394
+ Permission.ProjectAdmin,
395
+ Permission.EditStatusPageOIDC,
396
+ ],
397
+ })
398
+ @TableColumn({
399
+ required: true,
400
+ type: TableColumnType.LongText,
401
+ title: "Client Secret",
402
+ description:
403
+ "OIDC client secret issued by the identity provider. Stored encrypted at rest.",
404
+ encrypted: true,
405
+ })
406
+ @Column({
407
+ nullable: false,
408
+ type: ColumnType.LongText,
409
+ })
410
+ public clientSecret?: string = undefined;
411
+
412
+ @ColumnAccessControl({
413
+ create: [
414
+ Permission.ProjectOwner,
415
+ Permission.ProjectAdmin,
416
+ Permission.CreateStatusPageOIDC,
417
+ ],
418
+ read: [
419
+ Permission.ProjectOwner,
420
+ Permission.ProjectAdmin,
421
+ Permission.ReadStatusPageOIDC,
422
+ Permission.ReadAllProjectResources,
423
+ ],
424
+ update: [
425
+ Permission.ProjectOwner,
426
+ Permission.ProjectAdmin,
427
+ Permission.EditStatusPageOIDC,
428
+ ],
429
+ })
430
+ @TableColumn({
431
+ required: true,
432
+ type: TableColumnType.ShortText,
433
+ canReadOnRelationQuery: true,
434
+ description:
435
+ "Space-separated list of OIDC scopes to request. Must include 'openid'.",
436
+ example: "openid email profile",
437
+ })
438
+ @Column({
439
+ nullable: false,
440
+ type: ColumnType.ShortText,
441
+ length: ColumnLength.ShortText,
442
+ })
443
+ public scopes?: string = undefined;
444
+
445
+ @ColumnAccessControl({
446
+ create: [
447
+ Permission.ProjectOwner,
448
+ Permission.ProjectAdmin,
449
+ Permission.CreateStatusPageOIDC,
450
+ ],
451
+ read: [
452
+ Permission.ProjectOwner,
453
+ Permission.ProjectAdmin,
454
+ Permission.ReadStatusPageOIDC,
455
+ Permission.ReadAllProjectResources,
456
+ ],
457
+ update: [
458
+ Permission.ProjectOwner,
459
+ Permission.ProjectAdmin,
460
+ Permission.EditStatusPageOIDC,
461
+ ],
462
+ })
463
+ @TableColumn({
464
+ required: true,
465
+ type: TableColumnType.ShortText,
466
+ canReadOnRelationQuery: true,
467
+ description:
468
+ "Claim name in the ID token (or userinfo response) that contains the user's email address.",
469
+ example: "email",
470
+ })
471
+ @Column({
472
+ nullable: false,
473
+ type: ColumnType.ShortText,
474
+ length: ColumnLength.ShortText,
475
+ })
476
+ public emailClaimName?: string = undefined;
477
+
478
+ @ColumnAccessControl({
479
+ create: [
480
+ Permission.ProjectOwner,
481
+ Permission.ProjectAdmin,
482
+ Permission.CreateStatusPageOIDC,
483
+ ],
484
+ read: [
485
+ Permission.ProjectOwner,
486
+ Permission.ProjectAdmin,
487
+ Permission.ReadStatusPageOIDC,
488
+ Permission.ReadAllProjectResources,
489
+ ],
490
+ update: [
491
+ Permission.ProjectOwner,
492
+ Permission.ProjectAdmin,
493
+ Permission.EditStatusPageOIDC,
494
+ ],
495
+ })
496
+ @TableColumn({
497
+ required: false,
498
+ type: TableColumnType.ShortText,
499
+ canReadOnRelationQuery: true,
500
+ description:
501
+ "Claim name in the ID token (or userinfo response) that contains the user's display name.",
502
+ example: "name",
503
+ })
504
+ @Column({
505
+ nullable: true,
506
+ type: ColumnType.ShortText,
507
+ length: ColumnLength.ShortText,
508
+ })
509
+ public nameClaimName?: string = undefined;
510
+
511
+ @ColumnAccessControl({
512
+ create: [
513
+ Permission.ProjectOwner,
514
+ Permission.ProjectAdmin,
515
+ Permission.CreateStatusPageOIDC,
516
+ ],
517
+ read: [
518
+ Permission.ProjectOwner,
519
+ Permission.ProjectAdmin,
520
+ Permission.ReadStatusPageOIDC,
521
+ Permission.ReadAllProjectResources,
522
+ ],
523
+ update: [],
524
+ })
525
+ @TableColumn({
526
+ manyToOneRelationColumn: "createdByUserId",
527
+ type: TableColumnType.Entity,
528
+ modelType: User,
529
+ title: "Created by User",
530
+ description:
531
+ "Relation to User who created this object (if this object was created by a User)",
532
+ })
533
+ @ManyToOne(
534
+ () => {
535
+ return User;
536
+ },
537
+ {
538
+ eager: false,
539
+ nullable: true,
540
+ onDelete: "SET NULL",
541
+ orphanedRowAction: "nullify",
542
+ },
543
+ )
544
+ @JoinColumn({ name: "createdByUserId" })
545
+ public createdByUser?: User = undefined;
546
+
547
+ @ColumnAccessControl({
548
+ create: [
549
+ Permission.ProjectOwner,
550
+ Permission.ProjectAdmin,
551
+ Permission.CreateStatusPageOIDC,
552
+ ],
553
+ read: [
554
+ Permission.ProjectOwner,
555
+ Permission.ProjectAdmin,
556
+ Permission.ReadStatusPageOIDC,
557
+ Permission.ReadAllProjectResources,
558
+ ],
559
+ update: [],
560
+ })
561
+ @TableColumn({
562
+ type: TableColumnType.ObjectID,
563
+ title: "Created by User ID",
564
+ description:
565
+ "User ID who created this object (if this object was created by a User)",
566
+ example: "b2c3d4e5-f6a7-8901-b2c3-d4e5f6a78901",
567
+ })
568
+ @Column({
569
+ type: ColumnType.ObjectID,
570
+ nullable: true,
571
+ transformer: ObjectID.getDatabaseTransformer(),
572
+ })
573
+ public createdByUserId?: ObjectID = undefined;
574
+
575
+ @ColumnAccessControl({
576
+ create: [],
577
+ read: [
578
+ Permission.ProjectOwner,
579
+ Permission.ProjectAdmin,
580
+ Permission.ReadStatusPageOIDC,
581
+ Permission.ReadAllProjectResources,
582
+ ],
583
+ update: [],
584
+ })
585
+ @TableColumn({
586
+ manyToOneRelationColumn: "deletedByUserId",
587
+ type: TableColumnType.Entity,
588
+ title: "Deleted by User",
589
+ modelType: User,
590
+ description:
591
+ "Relation to User who deleted this object (if this object was deleted by a User)",
592
+ })
593
+ @ManyToOne(
594
+ () => {
595
+ return User;
596
+ },
597
+ {
598
+ cascade: false,
599
+ eager: false,
600
+ nullable: true,
601
+ onDelete: "SET NULL",
602
+ orphanedRowAction: "nullify",
603
+ },
604
+ )
605
+ @JoinColumn({ name: "deletedByUserId" })
606
+ public deletedByUser?: User = undefined;
607
+
608
+ @ColumnAccessControl({
609
+ create: [],
610
+ read: [
611
+ Permission.ProjectOwner,
612
+ Permission.ProjectAdmin,
613
+ Permission.ReadStatusPageOIDC,
614
+ Permission.ReadAllProjectResources,
615
+ ],
616
+ update: [],
617
+ })
618
+ @TableColumn({
619
+ type: TableColumnType.ObjectID,
620
+ title: "Deleted by User ID",
621
+ description:
622
+ "User ID who deleted this object (if this object was deleted by a User)",
623
+ example: "c3d4e5f6-a7b8-9012-c3d4-e5f6a7b89012",
624
+ })
625
+ @Column({
626
+ type: ColumnType.ObjectID,
627
+ nullable: true,
628
+ transformer: ObjectID.getDatabaseTransformer(),
629
+ })
630
+ public deletedByUserId?: ObjectID = undefined;
631
+
632
+ @ColumnAccessControl({
633
+ create: [
634
+ Permission.ProjectOwner,
635
+ Permission.ProjectAdmin,
636
+ Permission.CreateStatusPageOIDC,
637
+ ],
638
+ read: [
639
+ Permission.ProjectOwner,
640
+ Permission.ProjectAdmin,
641
+ Permission.ProjectUser,
642
+ Permission.Public,
643
+ Permission.ReadStatusPageOIDC,
644
+ Permission.ReadAllProjectResources,
645
+ ],
646
+ update: [
647
+ Permission.ProjectOwner,
648
+ Permission.ProjectAdmin,
649
+ Permission.EditStatusPageOIDC,
650
+ ],
651
+ })
652
+ @TableColumn({
653
+ isDefaultValueColumn: true,
654
+ type: TableColumnType.Boolean,
655
+ defaultValue: false,
656
+ example: true,
657
+ })
658
+ @Column({
659
+ type: ColumnType.Boolean,
660
+ default: false,
661
+ })
662
+ public isEnabled?: boolean = undefined;
663
+
664
+ @ColumnAccessControl({
665
+ create: [
666
+ Permission.ProjectOwner,
667
+ Permission.ProjectAdmin,
668
+ Permission.CreateStatusPageOIDC,
669
+ ],
670
+ read: [
671
+ Permission.ProjectOwner,
672
+ Permission.ProjectAdmin,
673
+ Permission.ReadStatusPageOIDC,
674
+ Permission.ReadAllProjectResources,
675
+ ],
676
+ update: [],
677
+ })
678
+ @TableColumn({
679
+ isDefaultValueColumn: true,
680
+ type: TableColumnType.Boolean,
681
+ defaultValue: false,
682
+ example: false,
683
+ })
684
+ @Column({
685
+ type: ColumnType.Boolean,
686
+ default: false,
687
+ })
688
+ public isTested?: boolean = undefined;
689
+ }