@oneuptime/common 10.0.36 → 10.0.37

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 (46) hide show
  1. package/Models/DatabaseModels/Index.ts +2 -0
  2. package/Models/DatabaseModels/WorkspaceNotificationSummary.ts +819 -0
  3. package/Server/API/StatusPageAPI.ts +7 -0
  4. package/Server/API/WorkspaceNotificationSummaryAPI.ts +67 -0
  5. package/Server/Infrastructure/Postgres/SchemaMigrations/1774355321449-MigrationName.ts +51 -0
  6. package/Server/Infrastructure/Postgres/SchemaMigrations/1774357353502-MigrationName.ts +29 -0
  7. package/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts +4 -0
  8. package/Server/Middleware/MasterAdminAuthorization.ts +55 -0
  9. package/Server/Services/Index.ts +2 -0
  10. package/Server/Services/WorkspaceNotificationSummaryService.ts +1450 -0
  11. package/Server/Utils/Greenlock/Greenlock.ts +1 -0
  12. package/Types/Permission.ts +42 -0
  13. package/Types/Workspace/NotificationSummary/WorkspaceNotificationSummaryItem.ts +13 -0
  14. package/Types/Workspace/NotificationSummary/WorkspaceNotificationSummaryType.ts +8 -0
  15. package/UI/Components/GanttChart/Bar/Index.tsx +23 -5
  16. package/build/dist/Models/DatabaseModels/Index.js +2 -0
  17. package/build/dist/Models/DatabaseModels/Index.js.map +1 -1
  18. package/build/dist/Models/DatabaseModels/WorkspaceNotificationSummary.js +857 -0
  19. package/build/dist/Models/DatabaseModels/WorkspaceNotificationSummary.js.map +1 -0
  20. package/build/dist/Server/API/StatusPageAPI.js +2 -0
  21. package/build/dist/Server/API/StatusPageAPI.js.map +1 -1
  22. package/build/dist/Server/API/WorkspaceNotificationSummaryAPI.js +40 -0
  23. package/build/dist/Server/API/WorkspaceNotificationSummaryAPI.js.map +1 -0
  24. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1774355321449-MigrationName.js +24 -0
  25. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1774355321449-MigrationName.js.map +1 -0
  26. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1774357353502-MigrationName.js +16 -0
  27. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1774357353502-MigrationName.js.map +1 -0
  28. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js +4 -0
  29. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js.map +1 -1
  30. package/build/dist/Server/Middleware/MasterAdminAuthorization.js +25 -0
  31. package/build/dist/Server/Middleware/MasterAdminAuthorization.js.map +1 -0
  32. package/build/dist/Server/Services/Index.js +2 -0
  33. package/build/dist/Server/Services/Index.js.map +1 -1
  34. package/build/dist/Server/Services/WorkspaceNotificationSummaryService.js +1122 -0
  35. package/build/dist/Server/Services/WorkspaceNotificationSummaryService.js.map +1 -0
  36. package/build/dist/Server/Utils/Greenlock/Greenlock.js +1 -0
  37. package/build/dist/Server/Utils/Greenlock/Greenlock.js.map +1 -1
  38. package/build/dist/Types/Permission.js +36 -0
  39. package/build/dist/Types/Permission.js.map +1 -1
  40. package/build/dist/Types/Workspace/NotificationSummary/WorkspaceNotificationSummaryItem.js +14 -0
  41. package/build/dist/Types/Workspace/NotificationSummary/WorkspaceNotificationSummaryItem.js.map +1 -0
  42. package/build/dist/Types/Workspace/NotificationSummary/WorkspaceNotificationSummaryType.js +9 -0
  43. package/build/dist/Types/Workspace/NotificationSummary/WorkspaceNotificationSummaryType.js.map +1 -0
  44. package/build/dist/UI/Components/GanttChart/Bar/Index.js +15 -3
  45. package/build/dist/UI/Components/GanttChart/Bar/Index.js.map +1 -1
  46. package/package.json +1 -1
@@ -0,0 +1,857 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ var __metadata = (this && this.__metadata) || function (k, v) {
8
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
+ };
10
+ import Project from "./Project";
11
+ import User from "./User";
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 TableColumn from "../../Types/Database/TableColumn";
20
+ import TableColumnType from "../../Types/Database/TableColumnType";
21
+ import TableMetadata from "../../Types/Database/TableMetadata";
22
+ import TenantColumn from "../../Types/Database/TenantColumn";
23
+ import IconProp from "../../Types/Icon/IconProp";
24
+ import ObjectID from "../../Types/ObjectID";
25
+ import { Column, Entity, Index, JoinColumn, ManyToOne } from "typeorm";
26
+ import WorkspaceType from "../../Types/Workspace/WorkspaceType";
27
+ import WorkspaceNotificationSummaryType from "../../Types/Workspace/NotificationSummary/WorkspaceNotificationSummaryType";
28
+ import Permission from "../../Types/Permission";
29
+ import TableBillingAccessControl from "../../Types/Database/AccessControl/TableBillingAccessControl";
30
+ import { PlanType } from "../../Types/Billing/SubscriptionPlan";
31
+ import EnableDocumentation from "../../Types/Database/EnableDocumentation";
32
+ import Recurring from "../../Types/Events/Recurring";
33
+ import FilterCondition from "../../Types/Filter/FilterCondition";
34
+ let WorkspaceNotificationSummary = class WorkspaceNotificationSummary extends BaseModel {
35
+ constructor() {
36
+ super(...arguments);
37
+ this.project = undefined;
38
+ this.projectId = undefined;
39
+ this.name = undefined;
40
+ this.description = undefined;
41
+ this.workspaceType = undefined;
42
+ this.summaryType = undefined;
43
+ this.recurringInterval = undefined;
44
+ this.numberOfDaysOfData = undefined;
45
+ this.sendFirstReportAt = undefined;
46
+ this.channelNames = undefined;
47
+ this.teamName = undefined;
48
+ this.summaryItems = undefined;
49
+ this.filters = undefined;
50
+ this.filterCondition = undefined;
51
+ this.nextSendAt = undefined;
52
+ this.lastSentAt = undefined;
53
+ this.isEnabled = undefined;
54
+ this.createdByUser = undefined;
55
+ this.createdByUserId = undefined;
56
+ this.deletedByUser = undefined;
57
+ this.deletedByUserId = undefined;
58
+ }
59
+ };
60
+ __decorate([
61
+ ColumnAccessControl({
62
+ create: [
63
+ Permission.ProjectAdmin,
64
+ Permission.ProjectOwner,
65
+ Permission.ProjectMember,
66
+ Permission.CreateWorkspaceNotificationSummary,
67
+ ],
68
+ read: [
69
+ Permission.ProjectAdmin,
70
+ Permission.ProjectOwner,
71
+ Permission.ProjectMember,
72
+ Permission.ReadWorkspaceNotificationSummary,
73
+ Permission.ReadAllProjectResources,
74
+ ],
75
+ update: [],
76
+ }),
77
+ TableColumn({
78
+ manyToOneRelationColumn: "projectId",
79
+ type: TableColumnType.Entity,
80
+ modelType: Project,
81
+ title: "Project",
82
+ description: "Relation to Project Resource in which this object belongs",
83
+ }),
84
+ ManyToOne(() => {
85
+ return Project;
86
+ }, {
87
+ eager: false,
88
+ nullable: true,
89
+ onDelete: "CASCADE",
90
+ orphanedRowAction: "nullify",
91
+ }),
92
+ JoinColumn({ name: "projectId" }),
93
+ __metadata("design:type", Project)
94
+ ], WorkspaceNotificationSummary.prototype, "project", void 0);
95
+ __decorate([
96
+ ColumnAccessControl({
97
+ create: [
98
+ Permission.ProjectAdmin,
99
+ Permission.ProjectOwner,
100
+ Permission.ProjectMember,
101
+ Permission.CreateWorkspaceNotificationSummary,
102
+ ],
103
+ read: [
104
+ Permission.ProjectAdmin,
105
+ Permission.ProjectOwner,
106
+ Permission.ProjectMember,
107
+ Permission.ReadWorkspaceNotificationSummary,
108
+ Permission.ReadAllProjectResources,
109
+ ],
110
+ update: [],
111
+ }),
112
+ Index(),
113
+ TableColumn({
114
+ type: TableColumnType.ObjectID,
115
+ required: true,
116
+ canReadOnRelationQuery: true,
117
+ title: "Project ID",
118
+ description: "ID of your OneUptime Project in which this object belongs",
119
+ }),
120
+ Column({
121
+ type: ColumnType.ObjectID,
122
+ nullable: false,
123
+ transformer: ObjectID.getDatabaseTransformer(),
124
+ }),
125
+ __metadata("design:type", ObjectID)
126
+ ], WorkspaceNotificationSummary.prototype, "projectId", void 0);
127
+ __decorate([
128
+ ColumnAccessControl({
129
+ create: [
130
+ Permission.ProjectAdmin,
131
+ Permission.ProjectOwner,
132
+ Permission.ProjectMember,
133
+ Permission.CreateWorkspaceNotificationSummary,
134
+ ],
135
+ read: [
136
+ Permission.ProjectAdmin,
137
+ Permission.ProjectOwner,
138
+ Permission.ProjectMember,
139
+ Permission.ReadWorkspaceNotificationSummary,
140
+ Permission.ReadAllProjectResources,
141
+ ],
142
+ update: [
143
+ Permission.ProjectAdmin,
144
+ Permission.ProjectOwner,
145
+ Permission.ProjectMember,
146
+ Permission.EditWorkspaceNotificationSummary,
147
+ ],
148
+ }),
149
+ TableColumn({
150
+ title: "Summary Name",
151
+ description: "Name of the Summary Rule",
152
+ required: true,
153
+ unique: false,
154
+ type: TableColumnType.LongText,
155
+ canReadOnRelationQuery: true,
156
+ }),
157
+ Column({
158
+ type: ColumnType.LongText,
159
+ length: ColumnLength.LongText,
160
+ unique: false,
161
+ nullable: false,
162
+ }),
163
+ __metadata("design:type", String)
164
+ ], WorkspaceNotificationSummary.prototype, "name", void 0);
165
+ __decorate([
166
+ ColumnAccessControl({
167
+ create: [
168
+ Permission.ProjectAdmin,
169
+ Permission.ProjectOwner,
170
+ Permission.ProjectMember,
171
+ Permission.CreateWorkspaceNotificationSummary,
172
+ ],
173
+ read: [
174
+ Permission.ProjectAdmin,
175
+ Permission.ProjectOwner,
176
+ Permission.ProjectMember,
177
+ Permission.ReadWorkspaceNotificationSummary,
178
+ Permission.ReadAllProjectResources,
179
+ ],
180
+ update: [
181
+ Permission.ProjectAdmin,
182
+ Permission.ProjectOwner,
183
+ Permission.ProjectMember,
184
+ Permission.EditWorkspaceNotificationSummary,
185
+ ],
186
+ }),
187
+ TableColumn({
188
+ title: "Summary Description",
189
+ description: "Description of the Summary Rule",
190
+ required: false,
191
+ unique: false,
192
+ type: TableColumnType.LongText,
193
+ canReadOnRelationQuery: true,
194
+ }),
195
+ Column({
196
+ type: ColumnType.LongText,
197
+ length: ColumnLength.LongText,
198
+ unique: false,
199
+ nullable: true,
200
+ }),
201
+ __metadata("design:type", String)
202
+ ], WorkspaceNotificationSummary.prototype, "description", void 0);
203
+ __decorate([
204
+ ColumnAccessControl({
205
+ create: [
206
+ Permission.ProjectAdmin,
207
+ Permission.ProjectOwner,
208
+ Permission.ProjectMember,
209
+ Permission.CreateWorkspaceNotificationSummary,
210
+ ],
211
+ read: [
212
+ Permission.ProjectAdmin,
213
+ Permission.ProjectOwner,
214
+ Permission.ProjectMember,
215
+ Permission.ReadWorkspaceNotificationSummary,
216
+ Permission.ReadAllProjectResources,
217
+ ],
218
+ update: [
219
+ Permission.ProjectAdmin,
220
+ Permission.ProjectOwner,
221
+ Permission.ProjectMember,
222
+ Permission.EditWorkspaceNotificationSummary,
223
+ ],
224
+ }),
225
+ TableColumn({
226
+ title: "Workspace Type",
227
+ description: "Type of Workspace - Slack, Microsoft Teams, etc.",
228
+ required: true,
229
+ unique: false,
230
+ type: TableColumnType.LongText,
231
+ canReadOnRelationQuery: true,
232
+ }),
233
+ Column({
234
+ type: ColumnType.LongText,
235
+ length: ColumnLength.LongText,
236
+ unique: false,
237
+ nullable: false,
238
+ }),
239
+ __metadata("design:type", String)
240
+ ], WorkspaceNotificationSummary.prototype, "workspaceType", void 0);
241
+ __decorate([
242
+ ColumnAccessControl({
243
+ create: [
244
+ Permission.ProjectAdmin,
245
+ Permission.ProjectOwner,
246
+ Permission.ProjectMember,
247
+ Permission.CreateWorkspaceNotificationSummary,
248
+ ],
249
+ read: [
250
+ Permission.ProjectAdmin,
251
+ Permission.ProjectOwner,
252
+ Permission.ProjectMember,
253
+ Permission.ReadWorkspaceNotificationSummary,
254
+ Permission.ReadAllProjectResources,
255
+ ],
256
+ update: [
257
+ Permission.ProjectAdmin,
258
+ Permission.ProjectOwner,
259
+ Permission.ProjectMember,
260
+ Permission.EditWorkspaceNotificationSummary,
261
+ ],
262
+ }),
263
+ TableColumn({
264
+ title: "Summary Type",
265
+ description: "Type of summary - Incident, Alert, Incident Episode, or Alert Episode",
266
+ required: true,
267
+ unique: false,
268
+ type: TableColumnType.ShortText,
269
+ canReadOnRelationQuery: true,
270
+ }),
271
+ Column({
272
+ type: ColumnType.ShortText,
273
+ unique: false,
274
+ nullable: false,
275
+ }),
276
+ __metadata("design:type", String)
277
+ ], WorkspaceNotificationSummary.prototype, "summaryType", void 0);
278
+ __decorate([
279
+ ColumnAccessControl({
280
+ create: [
281
+ Permission.ProjectAdmin,
282
+ Permission.ProjectOwner,
283
+ Permission.ProjectMember,
284
+ Permission.CreateWorkspaceNotificationSummary,
285
+ ],
286
+ read: [
287
+ Permission.ProjectAdmin,
288
+ Permission.ProjectOwner,
289
+ Permission.ProjectMember,
290
+ Permission.ReadWorkspaceNotificationSummary,
291
+ Permission.ReadAllProjectResources,
292
+ ],
293
+ update: [
294
+ Permission.ProjectAdmin,
295
+ Permission.ProjectOwner,
296
+ Permission.ProjectMember,
297
+ Permission.EditWorkspaceNotificationSummary,
298
+ ],
299
+ }),
300
+ TableColumn({
301
+ type: TableColumnType.JSON,
302
+ title: "Recurring Interval",
303
+ description: "How often should the summary be sent?",
304
+ required: true,
305
+ }),
306
+ Column({
307
+ type: ColumnType.JSON,
308
+ nullable: false,
309
+ transformer: Recurring.getDatabaseTransformer(),
310
+ }),
311
+ __metadata("design:type", Recurring)
312
+ ], WorkspaceNotificationSummary.prototype, "recurringInterval", void 0);
313
+ __decorate([
314
+ ColumnAccessControl({
315
+ create: [
316
+ Permission.ProjectAdmin,
317
+ Permission.ProjectOwner,
318
+ Permission.ProjectMember,
319
+ Permission.CreateWorkspaceNotificationSummary,
320
+ ],
321
+ read: [
322
+ Permission.ProjectAdmin,
323
+ Permission.ProjectOwner,
324
+ Permission.ProjectMember,
325
+ Permission.ReadWorkspaceNotificationSummary,
326
+ Permission.ReadAllProjectResources,
327
+ ],
328
+ update: [
329
+ Permission.ProjectAdmin,
330
+ Permission.ProjectOwner,
331
+ Permission.ProjectMember,
332
+ Permission.EditWorkspaceNotificationSummary,
333
+ ],
334
+ }),
335
+ TableColumn({
336
+ type: TableColumnType.Number,
337
+ title: "Number of Days of Data",
338
+ description: "How many days of data to include in the summary",
339
+ required: true,
340
+ }),
341
+ Column({
342
+ type: ColumnType.Number,
343
+ nullable: false,
344
+ default: 7,
345
+ }),
346
+ __metadata("design:type", Number)
347
+ ], WorkspaceNotificationSummary.prototype, "numberOfDaysOfData", void 0);
348
+ __decorate([
349
+ ColumnAccessControl({
350
+ create: [
351
+ Permission.ProjectAdmin,
352
+ Permission.ProjectOwner,
353
+ Permission.ProjectMember,
354
+ Permission.CreateWorkspaceNotificationSummary,
355
+ ],
356
+ read: [
357
+ Permission.ProjectAdmin,
358
+ Permission.ProjectOwner,
359
+ Permission.ProjectMember,
360
+ Permission.ReadWorkspaceNotificationSummary,
361
+ Permission.ReadAllProjectResources,
362
+ ],
363
+ update: [
364
+ Permission.ProjectAdmin,
365
+ Permission.ProjectOwner,
366
+ Permission.ProjectMember,
367
+ Permission.EditWorkspaceNotificationSummary,
368
+ ],
369
+ }),
370
+ TableColumn({
371
+ title: "Send First Report At",
372
+ description: "When should the first summary report be sent? Subsequent reports will follow the recurring interval from this date.",
373
+ required: false,
374
+ unique: false,
375
+ type: TableColumnType.Date,
376
+ }),
377
+ Column({
378
+ type: ColumnType.Date,
379
+ nullable: true,
380
+ }),
381
+ __metadata("design:type", Date)
382
+ ], WorkspaceNotificationSummary.prototype, "sendFirstReportAt", void 0);
383
+ __decorate([
384
+ ColumnAccessControl({
385
+ create: [
386
+ Permission.ProjectAdmin,
387
+ Permission.ProjectOwner,
388
+ Permission.ProjectMember,
389
+ Permission.CreateWorkspaceNotificationSummary,
390
+ ],
391
+ read: [
392
+ Permission.ProjectAdmin,
393
+ Permission.ProjectOwner,
394
+ Permission.ProjectMember,
395
+ Permission.ReadWorkspaceNotificationSummary,
396
+ Permission.ReadAllProjectResources,
397
+ ],
398
+ update: [
399
+ Permission.ProjectAdmin,
400
+ Permission.ProjectOwner,
401
+ Permission.ProjectMember,
402
+ Permission.EditWorkspaceNotificationSummary,
403
+ ],
404
+ }),
405
+ TableColumn({
406
+ type: TableColumnType.JSON,
407
+ title: "Channel Names",
408
+ description: "List of channel names to post the summary to",
409
+ required: true,
410
+ }),
411
+ Column({
412
+ type: ColumnType.JSON,
413
+ nullable: false,
414
+ }),
415
+ __metadata("design:type", Array)
416
+ ], WorkspaceNotificationSummary.prototype, "channelNames", void 0);
417
+ __decorate([
418
+ ColumnAccessControl({
419
+ create: [
420
+ Permission.ProjectAdmin,
421
+ Permission.ProjectOwner,
422
+ Permission.ProjectMember,
423
+ Permission.CreateWorkspaceNotificationSummary,
424
+ ],
425
+ read: [
426
+ Permission.ProjectAdmin,
427
+ Permission.ProjectOwner,
428
+ Permission.ProjectMember,
429
+ Permission.ReadWorkspaceNotificationSummary,
430
+ Permission.ReadAllProjectResources,
431
+ ],
432
+ update: [
433
+ Permission.ProjectAdmin,
434
+ Permission.ProjectOwner,
435
+ Permission.ProjectMember,
436
+ Permission.EditWorkspaceNotificationSummary,
437
+ ],
438
+ }),
439
+ TableColumn({
440
+ title: "Team Name",
441
+ description: "Microsoft Teams team name (only for Microsoft Teams)",
442
+ required: false,
443
+ unique: false,
444
+ type: TableColumnType.LongText,
445
+ }),
446
+ Column({
447
+ type: ColumnType.LongText,
448
+ length: ColumnLength.LongText,
449
+ unique: false,
450
+ nullable: true,
451
+ }),
452
+ __metadata("design:type", String)
453
+ ], WorkspaceNotificationSummary.prototype, "teamName", void 0);
454
+ __decorate([
455
+ ColumnAccessControl({
456
+ create: [
457
+ Permission.ProjectAdmin,
458
+ Permission.ProjectOwner,
459
+ Permission.ProjectMember,
460
+ Permission.CreateWorkspaceNotificationSummary,
461
+ ],
462
+ read: [
463
+ Permission.ProjectAdmin,
464
+ Permission.ProjectOwner,
465
+ Permission.ProjectMember,
466
+ Permission.ReadWorkspaceNotificationSummary,
467
+ Permission.ReadAllProjectResources,
468
+ ],
469
+ update: [
470
+ Permission.ProjectAdmin,
471
+ Permission.ProjectOwner,
472
+ Permission.ProjectMember,
473
+ Permission.EditWorkspaceNotificationSummary,
474
+ ],
475
+ }),
476
+ TableColumn({
477
+ type: TableColumnType.JSON,
478
+ title: "Summary Items",
479
+ description: "Checklist of items to include in the summary",
480
+ required: true,
481
+ }),
482
+ Column({
483
+ type: ColumnType.JSON,
484
+ nullable: false,
485
+ }),
486
+ __metadata("design:type", Array)
487
+ ], WorkspaceNotificationSummary.prototype, "summaryItems", void 0);
488
+ __decorate([
489
+ ColumnAccessControl({
490
+ create: [
491
+ Permission.ProjectAdmin,
492
+ Permission.ProjectOwner,
493
+ Permission.ProjectMember,
494
+ Permission.CreateWorkspaceNotificationSummary,
495
+ ],
496
+ read: [
497
+ Permission.ProjectAdmin,
498
+ Permission.ProjectOwner,
499
+ Permission.ProjectMember,
500
+ Permission.ReadWorkspaceNotificationSummary,
501
+ Permission.ReadAllProjectResources,
502
+ ],
503
+ update: [
504
+ Permission.ProjectAdmin,
505
+ Permission.ProjectOwner,
506
+ Permission.ProjectMember,
507
+ Permission.EditWorkspaceNotificationSummary,
508
+ ],
509
+ }),
510
+ TableColumn({
511
+ type: TableColumnType.JSON,
512
+ title: "Filters",
513
+ description: "Filter conditions for which items to include in the summary",
514
+ required: false,
515
+ }),
516
+ Column({
517
+ type: ColumnType.JSON,
518
+ nullable: true,
519
+ }),
520
+ __metadata("design:type", Array)
521
+ ], WorkspaceNotificationSummary.prototype, "filters", void 0);
522
+ __decorate([
523
+ ColumnAccessControl({
524
+ create: [
525
+ Permission.ProjectAdmin,
526
+ Permission.ProjectOwner,
527
+ Permission.ProjectMember,
528
+ Permission.CreateWorkspaceNotificationSummary,
529
+ ],
530
+ read: [
531
+ Permission.ProjectAdmin,
532
+ Permission.ProjectOwner,
533
+ Permission.ProjectMember,
534
+ Permission.ReadWorkspaceNotificationSummary,
535
+ Permission.ReadAllProjectResources,
536
+ ],
537
+ update: [
538
+ Permission.ProjectAdmin,
539
+ Permission.ProjectOwner,
540
+ Permission.ProjectMember,
541
+ Permission.EditWorkspaceNotificationSummary,
542
+ ],
543
+ }),
544
+ TableColumn({
545
+ title: "Filter Condition",
546
+ description: "How to combine filters - Any or All",
547
+ required: false,
548
+ unique: false,
549
+ type: TableColumnType.ShortText,
550
+ }),
551
+ Column({
552
+ type: ColumnType.ShortText,
553
+ unique: false,
554
+ nullable: true,
555
+ }),
556
+ __metadata("design:type", String)
557
+ ], WorkspaceNotificationSummary.prototype, "filterCondition", void 0);
558
+ __decorate([
559
+ ColumnAccessControl({
560
+ create: [
561
+ Permission.ProjectAdmin,
562
+ Permission.ProjectOwner,
563
+ Permission.ProjectMember,
564
+ Permission.CreateWorkspaceNotificationSummary,
565
+ ],
566
+ read: [
567
+ Permission.ProjectAdmin,
568
+ Permission.ProjectOwner,
569
+ Permission.ProjectMember,
570
+ Permission.ReadWorkspaceNotificationSummary,
571
+ Permission.ReadAllProjectResources,
572
+ ],
573
+ update: [
574
+ Permission.ProjectAdmin,
575
+ Permission.ProjectOwner,
576
+ Permission.ProjectMember,
577
+ Permission.EditWorkspaceNotificationSummary,
578
+ ],
579
+ }),
580
+ TableColumn({
581
+ type: TableColumnType.Date,
582
+ title: "Next Send At",
583
+ description: "When the next summary should be sent",
584
+ }),
585
+ Column({
586
+ type: ColumnType.Date,
587
+ nullable: true,
588
+ }),
589
+ __metadata("design:type", Date)
590
+ ], WorkspaceNotificationSummary.prototype, "nextSendAt", void 0);
591
+ __decorate([
592
+ ColumnAccessControl({
593
+ create: [
594
+ Permission.ProjectAdmin,
595
+ Permission.ProjectOwner,
596
+ Permission.ProjectMember,
597
+ Permission.CreateWorkspaceNotificationSummary,
598
+ ],
599
+ read: [
600
+ Permission.ProjectAdmin,
601
+ Permission.ProjectOwner,
602
+ Permission.ProjectMember,
603
+ Permission.ReadWorkspaceNotificationSummary,
604
+ Permission.ReadAllProjectResources,
605
+ ],
606
+ update: [
607
+ Permission.ProjectAdmin,
608
+ Permission.ProjectOwner,
609
+ Permission.ProjectMember,
610
+ Permission.EditWorkspaceNotificationSummary,
611
+ ],
612
+ }),
613
+ TableColumn({
614
+ type: TableColumnType.Date,
615
+ title: "Last Sent At",
616
+ description: "When the last summary was sent",
617
+ }),
618
+ Column({
619
+ type: ColumnType.Date,
620
+ nullable: true,
621
+ }),
622
+ __metadata("design:type", Date)
623
+ ], WorkspaceNotificationSummary.prototype, "lastSentAt", void 0);
624
+ __decorate([
625
+ ColumnAccessControl({
626
+ create: [
627
+ Permission.ProjectAdmin,
628
+ Permission.ProjectOwner,
629
+ Permission.ProjectMember,
630
+ Permission.CreateWorkspaceNotificationSummary,
631
+ ],
632
+ read: [
633
+ Permission.ProjectAdmin,
634
+ Permission.ProjectOwner,
635
+ Permission.ProjectMember,
636
+ Permission.ReadWorkspaceNotificationSummary,
637
+ Permission.ReadAllProjectResources,
638
+ ],
639
+ update: [
640
+ Permission.ProjectAdmin,
641
+ Permission.ProjectOwner,
642
+ Permission.ProjectMember,
643
+ Permission.EditWorkspaceNotificationSummary,
644
+ ],
645
+ }),
646
+ TableColumn({
647
+ type: TableColumnType.Boolean,
648
+ title: "Enabled",
649
+ description: "Is this summary rule enabled?",
650
+ required: true,
651
+ }),
652
+ Column({
653
+ type: ColumnType.Boolean,
654
+ nullable: false,
655
+ default: true,
656
+ }),
657
+ __metadata("design:type", Boolean)
658
+ ], WorkspaceNotificationSummary.prototype, "isEnabled", void 0);
659
+ __decorate([
660
+ ColumnAccessControl({
661
+ create: [
662
+ Permission.ProjectAdmin,
663
+ Permission.ProjectOwner,
664
+ Permission.ProjectMember,
665
+ Permission.CreateWorkspaceNotificationSummary,
666
+ ],
667
+ read: [
668
+ Permission.ProjectAdmin,
669
+ Permission.ProjectOwner,
670
+ Permission.ProjectMember,
671
+ Permission.ReadWorkspaceNotificationSummary,
672
+ Permission.ReadAllProjectResources,
673
+ ],
674
+ update: [
675
+ Permission.ProjectAdmin,
676
+ Permission.ProjectOwner,
677
+ Permission.ProjectMember,
678
+ Permission.EditWorkspaceNotificationSummary,
679
+ ],
680
+ }),
681
+ TableColumn({
682
+ manyToOneRelationColumn: "createdByUserId",
683
+ type: TableColumnType.Entity,
684
+ modelType: User,
685
+ title: "Created by User",
686
+ description: "Relation to User who created this object (if this object was created by a User)",
687
+ }),
688
+ ManyToOne(() => {
689
+ return User;
690
+ }, {
691
+ eager: false,
692
+ nullable: true,
693
+ onDelete: "SET NULL",
694
+ orphanedRowAction: "nullify",
695
+ }),
696
+ JoinColumn({ name: "createdByUserId" }),
697
+ __metadata("design:type", User)
698
+ ], WorkspaceNotificationSummary.prototype, "createdByUser", void 0);
699
+ __decorate([
700
+ ColumnAccessControl({
701
+ create: [
702
+ Permission.ProjectAdmin,
703
+ Permission.ProjectOwner,
704
+ Permission.ProjectMember,
705
+ Permission.CreateWorkspaceNotificationSummary,
706
+ ],
707
+ read: [
708
+ Permission.ProjectAdmin,
709
+ Permission.ProjectOwner,
710
+ Permission.ProjectMember,
711
+ Permission.ReadWorkspaceNotificationSummary,
712
+ Permission.ReadAllProjectResources,
713
+ ],
714
+ update: [
715
+ Permission.ProjectAdmin,
716
+ Permission.ProjectOwner,
717
+ Permission.ProjectMember,
718
+ Permission.EditWorkspaceNotificationSummary,
719
+ ],
720
+ }),
721
+ TableColumn({
722
+ type: TableColumnType.ObjectID,
723
+ title: "Created by User ID",
724
+ description: "User ID who created this object (if this object was created by a User)",
725
+ }),
726
+ Column({
727
+ type: ColumnType.ObjectID,
728
+ nullable: true,
729
+ transformer: ObjectID.getDatabaseTransformer(),
730
+ }),
731
+ __metadata("design:type", ObjectID)
732
+ ], WorkspaceNotificationSummary.prototype, "createdByUserId", void 0);
733
+ __decorate([
734
+ ColumnAccessControl({
735
+ create: [
736
+ Permission.ProjectAdmin,
737
+ Permission.ProjectOwner,
738
+ Permission.ProjectMember,
739
+ Permission.CreateWorkspaceNotificationSummary,
740
+ ],
741
+ read: [
742
+ Permission.ProjectAdmin,
743
+ Permission.ProjectOwner,
744
+ Permission.ProjectMember,
745
+ Permission.ReadWorkspaceNotificationSummary,
746
+ Permission.ReadAllProjectResources,
747
+ ],
748
+ update: [
749
+ Permission.ProjectAdmin,
750
+ Permission.ProjectOwner,
751
+ Permission.ProjectMember,
752
+ Permission.EditWorkspaceNotificationSummary,
753
+ ],
754
+ }),
755
+ TableColumn({
756
+ manyToOneRelationColumn: "deletedByUserId",
757
+ type: TableColumnType.Entity,
758
+ title: "Deleted by User",
759
+ modelType: User,
760
+ description: "Relation to User who deleted this object (if this object was deleted by a User)",
761
+ }),
762
+ ManyToOne(() => {
763
+ return User;
764
+ }, {
765
+ cascade: false,
766
+ eager: false,
767
+ nullable: true,
768
+ onDelete: "SET NULL",
769
+ orphanedRowAction: "nullify",
770
+ }),
771
+ JoinColumn({ name: "deletedByUserId" }),
772
+ __metadata("design:type", User)
773
+ ], WorkspaceNotificationSummary.prototype, "deletedByUser", void 0);
774
+ __decorate([
775
+ ColumnAccessControl({
776
+ create: [
777
+ Permission.ProjectAdmin,
778
+ Permission.ProjectOwner,
779
+ Permission.ProjectMember,
780
+ Permission.CreateWorkspaceNotificationSummary,
781
+ ],
782
+ read: [
783
+ Permission.ProjectAdmin,
784
+ Permission.ProjectOwner,
785
+ Permission.ProjectMember,
786
+ Permission.ReadWorkspaceNotificationSummary,
787
+ Permission.ReadAllProjectResources,
788
+ ],
789
+ update: [
790
+ Permission.ProjectAdmin,
791
+ Permission.ProjectOwner,
792
+ Permission.ProjectMember,
793
+ Permission.EditWorkspaceNotificationSummary,
794
+ ],
795
+ }),
796
+ TableColumn({
797
+ type: TableColumnType.ObjectID,
798
+ title: "Deleted by User ID",
799
+ description: "User ID who deleted this object (if this object was deleted by a User)",
800
+ }),
801
+ Column({
802
+ type: ColumnType.ObjectID,
803
+ nullable: true,
804
+ transformer: ObjectID.getDatabaseTransformer(),
805
+ }),
806
+ __metadata("design:type", ObjectID)
807
+ ], WorkspaceNotificationSummary.prototype, "deletedByUserId", void 0);
808
+ WorkspaceNotificationSummary = __decorate([
809
+ EnableDocumentation(),
810
+ TenantColumn("projectId"),
811
+ TableAccessControl({
812
+ create: [
813
+ Permission.ProjectAdmin,
814
+ Permission.ProjectOwner,
815
+ Permission.ProjectMember,
816
+ Permission.CreateWorkspaceNotificationSummary,
817
+ ],
818
+ read: [
819
+ Permission.ProjectAdmin,
820
+ Permission.ProjectOwner,
821
+ Permission.ProjectMember,
822
+ Permission.ReadWorkspaceNotificationSummary,
823
+ Permission.ReadAllProjectResources,
824
+ ],
825
+ delete: [
826
+ Permission.ProjectAdmin,
827
+ Permission.ProjectOwner,
828
+ Permission.ProjectMember,
829
+ Permission.DeleteWorkspaceNotificationSummary,
830
+ ],
831
+ update: [
832
+ Permission.ProjectAdmin,
833
+ Permission.ProjectOwner,
834
+ Permission.ProjectMember,
835
+ Permission.EditWorkspaceNotificationSummary,
836
+ ],
837
+ }),
838
+ TableBillingAccessControl({
839
+ create: PlanType.Growth,
840
+ read: PlanType.Growth,
841
+ update: PlanType.Growth,
842
+ delete: PlanType.Growth,
843
+ }),
844
+ CrudApiEndpoint(new Route("/workspace-notification-summary")),
845
+ Entity({
846
+ name: "WorkspaceNotificationSummary",
847
+ }),
848
+ TableMetadata({
849
+ tableName: "WorkspaceNotificationSummary",
850
+ singularName: "Workspace Notification Summary",
851
+ pluralName: "Workspace Notification Summaries",
852
+ icon: IconProp.ChartBar,
853
+ tableDescription: "Recurring summary reports for incidents and alerts sent to Slack or Microsoft Teams",
854
+ })
855
+ ], WorkspaceNotificationSummary);
856
+ export default WorkspaceNotificationSummary;
857
+ //# sourceMappingURL=WorkspaceNotificationSummary.js.map