@oneuptime/common 9.3.22 → 9.4.0

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 (121) hide show
  1. package/Models/DatabaseModels/IncomingCallLog.ts +521 -0
  2. package/Models/DatabaseModels/IncomingCallLogItem.ts +463 -0
  3. package/Models/DatabaseModels/IncomingCallPolicy.ts +811 -0
  4. package/Models/DatabaseModels/IncomingCallPolicyEscalationRule.ts +597 -0
  5. package/Models/DatabaseModels/Index.ts +18 -0
  6. package/Models/DatabaseModels/ProjectSCIMLog.ts +422 -0
  7. package/Models/DatabaseModels/StatusPageSCIMLog.ts +455 -0
  8. package/Models/DatabaseModels/User.ts +0 -15
  9. package/Models/DatabaseModels/UserIncomingCallNumber.ts +296 -0
  10. package/Server/API/UserIncomingCallNumberAPI.ts +128 -0
  11. package/Server/Infrastructure/Postgres/SchemaMigrations/1768583966447-MigrationName.ts +121 -0
  12. package/Server/Infrastructure/Postgres/SchemaMigrations/1768647802022-RemoveAlertPhoneNumberFromUser.ts +22 -0
  13. package/Server/Infrastructure/Postgres/SchemaMigrations/1768649699509-MigrationName.ts +787 -0
  14. package/Server/Infrastructure/Postgres/SchemaMigrations/1768682071562-MigrationName.ts +29 -0
  15. package/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts +8 -0
  16. package/Server/Services/IncomingCallLogItemService.ts +10 -0
  17. package/Server/Services/IncomingCallLogService.ts +10 -0
  18. package/Server/Services/IncomingCallPolicyEscalationRuleService.ts +267 -0
  19. package/Server/Services/IncomingCallPolicyService.ts +10 -0
  20. package/Server/Services/Index.ts +7 -0
  21. package/Server/Services/ProjectSCIMLogService.ts +11 -0
  22. package/Server/Services/StatusPageSCIMLogService.ts +11 -0
  23. package/Server/Services/UserCallService.ts +31 -0
  24. package/Server/Services/UserIncomingCallNumberService.ts +258 -0
  25. package/Server/Services/UserSmsService.ts +31 -0
  26. package/Server/Utils/StartServer.ts +5 -0
  27. package/Types/Call/CallProvider.ts +99 -0
  28. package/Types/Call/CallProviderType.ts +6 -0
  29. package/Types/Icon/IconProp.ts +1 -0
  30. package/Types/IncomingCall/IncomingCallStatus.ts +13 -0
  31. package/Types/Permission.ts +126 -0
  32. package/Types/Phone.ts +53 -4
  33. package/Types/SCIM/SCIMLogStatus.ts +7 -0
  34. package/UI/Components/Diagram/ConceptCards.tsx +74 -0
  35. package/UI/Components/Diagram/HorizontalStepChain.tsx +92 -0
  36. package/UI/Components/Diagram/Index.ts +11 -0
  37. package/UI/Components/Diagram/NumberedSteps.tsx +77 -0
  38. package/UI/Components/Diagram/VerticalFlowSteps.tsx +59 -0
  39. package/UI/Components/Icon/Icon.tsx +10 -0
  40. package/UI/Components/SimpleLogViewer/SimpleLogViewer.tsx +86 -2
  41. package/build/dist/Models/DatabaseModels/IncomingCallLog.js +565 -0
  42. package/build/dist/Models/DatabaseModels/IncomingCallLog.js.map +1 -0
  43. package/build/dist/Models/DatabaseModels/IncomingCallLogItem.js +497 -0
  44. package/build/dist/Models/DatabaseModels/IncomingCallLogItem.js.map +1 -0
  45. package/build/dist/Models/DatabaseModels/IncomingCallPolicy.js +840 -0
  46. package/build/dist/Models/DatabaseModels/IncomingCallPolicy.js.map +1 -0
  47. package/build/dist/Models/DatabaseModels/IncomingCallPolicyEscalationRule.js +619 -0
  48. package/build/dist/Models/DatabaseModels/IncomingCallPolicyEscalationRule.js.map +1 -0
  49. package/build/dist/Models/DatabaseModels/Index.js +16 -0
  50. package/build/dist/Models/DatabaseModels/Index.js.map +1 -1
  51. package/build/dist/Models/DatabaseModels/ProjectSCIMLog.js +455 -0
  52. package/build/dist/Models/DatabaseModels/ProjectSCIMLog.js.map +1 -0
  53. package/build/dist/Models/DatabaseModels/StatusPageSCIMLog.js +486 -0
  54. package/build/dist/Models/DatabaseModels/StatusPageSCIMLog.js.map +1 -0
  55. package/build/dist/Models/DatabaseModels/User.js +0 -16
  56. package/build/dist/Models/DatabaseModels/User.js.map +1 -1
  57. package/build/dist/Models/DatabaseModels/UserIncomingCallNumber.js +315 -0
  58. package/build/dist/Models/DatabaseModels/UserIncomingCallNumber.js.map +1 -0
  59. package/build/dist/Server/API/UserIncomingCallNumberAPI.js +72 -0
  60. package/build/dist/Server/API/UserIncomingCallNumberAPI.js.map +1 -0
  61. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1768583966447-MigrationName.js +48 -0
  62. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1768583966447-MigrationName.js.map +1 -0
  63. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1768647802022-RemoveAlertPhoneNumberFromUser.js +34 -0
  64. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1768647802022-RemoveAlertPhoneNumberFromUser.js.map +1 -0
  65. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1768649699509-MigrationName.js +270 -0
  66. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1768649699509-MigrationName.js.map +1 -0
  67. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1768682071562-MigrationName.js +16 -0
  68. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1768682071562-MigrationName.js.map +1 -0
  69. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js +8 -0
  70. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js.map +1 -1
  71. package/build/dist/Server/Services/IncomingCallLogItemService.js +9 -0
  72. package/build/dist/Server/Services/IncomingCallLogItemService.js.map +1 -0
  73. package/build/dist/Server/Services/IncomingCallLogService.js +9 -0
  74. package/build/dist/Server/Services/IncomingCallLogService.js.map +1 -0
  75. package/build/dist/Server/Services/IncomingCallPolicyEscalationRuleService.js +197 -0
  76. package/build/dist/Server/Services/IncomingCallPolicyEscalationRuleService.js.map +1 -0
  77. package/build/dist/Server/Services/IncomingCallPolicyService.js +9 -0
  78. package/build/dist/Server/Services/IncomingCallPolicyService.js.map +1 -0
  79. package/build/dist/Server/Services/Index.js +6 -0
  80. package/build/dist/Server/Services/Index.js.map +1 -1
  81. package/build/dist/Server/Services/ProjectSCIMLogService.js +10 -0
  82. package/build/dist/Server/Services/ProjectSCIMLogService.js.map +1 -0
  83. package/build/dist/Server/Services/StatusPageSCIMLogService.js +10 -0
  84. package/build/dist/Server/Services/StatusPageSCIMLogService.js.map +1 -0
  85. package/build/dist/Server/Services/UserCallService.js +21 -0
  86. package/build/dist/Server/Services/UserCallService.js.map +1 -1
  87. package/build/dist/Server/Services/UserIncomingCallNumberService.js +225 -0
  88. package/build/dist/Server/Services/UserIncomingCallNumberService.js.map +1 -0
  89. package/build/dist/Server/Services/UserSmsService.js +21 -0
  90. package/build/dist/Server/Services/UserSmsService.js.map +1 -1
  91. package/build/dist/Server/Utils/StartServer.js +5 -0
  92. package/build/dist/Server/Utils/StartServer.js.map +1 -1
  93. package/build/dist/Types/Call/CallProvider.js +2 -0
  94. package/build/dist/Types/Call/CallProvider.js.map +1 -0
  95. package/build/dist/Types/Call/CallProviderType.js +7 -0
  96. package/build/dist/Types/Call/CallProviderType.js.map +1 -0
  97. package/build/dist/Types/Icon/IconProp.js +1 -0
  98. package/build/dist/Types/Icon/IconProp.js.map +1 -1
  99. package/build/dist/Types/IncomingCall/IncomingCallStatus.js +14 -0
  100. package/build/dist/Types/IncomingCall/IncomingCallStatus.js.map +1 -0
  101. package/build/dist/Types/Permission.js +104 -0
  102. package/build/dist/Types/Permission.js.map +1 -1
  103. package/build/dist/Types/Phone.js +47 -3
  104. package/build/dist/Types/Phone.js.map +1 -1
  105. package/build/dist/Types/SCIM/SCIMLogStatus.js +8 -0
  106. package/build/dist/Types/SCIM/SCIMLogStatus.js.map +1 -0
  107. package/build/dist/UI/Components/Diagram/ConceptCards.js +30 -0
  108. package/build/dist/UI/Components/Diagram/ConceptCards.js.map +1 -0
  109. package/build/dist/UI/Components/Diagram/HorizontalStepChain.js +30 -0
  110. package/build/dist/UI/Components/Diagram/HorizontalStepChain.js.map +1 -0
  111. package/build/dist/UI/Components/Diagram/Index.js +5 -0
  112. package/build/dist/UI/Components/Diagram/Index.js.map +1 -0
  113. package/build/dist/UI/Components/Diagram/NumberedSteps.js +18 -0
  114. package/build/dist/UI/Components/Diagram/NumberedSteps.js.map +1 -0
  115. package/build/dist/UI/Components/Diagram/VerticalFlowSteps.js +16 -0
  116. package/build/dist/UI/Components/Diagram/VerticalFlowSteps.js.map +1 -0
  117. package/build/dist/UI/Components/Icon/Icon.js +4 -0
  118. package/build/dist/UI/Components/Icon/Icon.js.map +1 -1
  119. package/build/dist/UI/Components/SimpleLogViewer/SimpleLogViewer.js +30 -1
  120. package/build/dist/UI/Components/SimpleLogViewer/SimpleLogViewer.js.map +1 -1
  121. package/package.json +1 -1
@@ -0,0 +1,597 @@
1
+ import IncomingCallPolicy from "./IncomingCallPolicy";
2
+ import OnCallDutyPolicySchedule from "./OnCallDutyPolicySchedule";
3
+ import Project from "./Project";
4
+ import User from "./User";
5
+ import BaseModel from "./DatabaseBaseModel/DatabaseBaseModel";
6
+ import Route from "../../Types/API/Route";
7
+ import ColumnAccessControl from "../../Types/Database/AccessControl/ColumnAccessControl";
8
+ import TableAccessControl from "../../Types/Database/AccessControl/TableAccessControl";
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 TableColumn from "../../Types/Database/TableColumn";
14
+ import TableColumnType from "../../Types/Database/TableColumnType";
15
+ import TableMetadata from "../../Types/Database/TableMetadata";
16
+ import TenantColumn from "../../Types/Database/TenantColumn";
17
+ import IconProp from "../../Types/Icon/IconProp";
18
+ import ObjectID from "../../Types/ObjectID";
19
+ import Permission from "../../Types/Permission";
20
+ import { Column, Entity, Index, JoinColumn, ManyToOne } from "typeorm";
21
+ import EnableWorkflow from "../../Types/Database/EnableWorkflow";
22
+
23
+ @EnableDocumentation()
24
+ @TenantColumn("projectId")
25
+ @EnableWorkflow({
26
+ create: true,
27
+ delete: true,
28
+ update: true,
29
+ read: true,
30
+ })
31
+ @TableAccessControl({
32
+ create: [
33
+ Permission.ProjectOwner,
34
+ Permission.ProjectAdmin,
35
+ Permission.ProjectMember,
36
+ Permission.CreateProjectIncomingCallPolicyEscalationRule,
37
+ ],
38
+ read: [
39
+ Permission.ProjectOwner,
40
+ Permission.ProjectAdmin,
41
+ Permission.ProjectMember,
42
+ Permission.ReadProjectIncomingCallPolicyEscalationRule,
43
+ ],
44
+ delete: [
45
+ Permission.ProjectOwner,
46
+ Permission.ProjectAdmin,
47
+ Permission.ProjectMember,
48
+ Permission.DeleteProjectIncomingCallPolicyEscalationRule,
49
+ ],
50
+ update: [
51
+ Permission.ProjectOwner,
52
+ Permission.ProjectAdmin,
53
+ Permission.ProjectMember,
54
+ Permission.EditProjectIncomingCallPolicyEscalationRule,
55
+ ],
56
+ })
57
+ @CrudApiEndpoint(new Route("/incoming-call-policy-escalation-rule"))
58
+ @Entity({
59
+ name: "IncomingCallPolicyEscalationRule",
60
+ })
61
+ @TableMetadata({
62
+ tableName: "IncomingCallPolicyEscalationRule",
63
+ singularName: "Incoming Call Policy Escalation Rule",
64
+ pluralName: "Incoming Call Policy Escalation Rules",
65
+ icon: IconProp.Call,
66
+ tableDescription:
67
+ "Manage escalation rules for incoming call policies that define who to call and in what order",
68
+ })
69
+ export default class IncomingCallPolicyEscalationRule extends BaseModel {
70
+ @ColumnAccessControl({
71
+ create: [
72
+ Permission.ProjectOwner,
73
+ Permission.ProjectAdmin,
74
+ Permission.ProjectMember,
75
+ Permission.CreateProjectIncomingCallPolicyEscalationRule,
76
+ ],
77
+ read: [
78
+ Permission.ProjectOwner,
79
+ Permission.ProjectAdmin,
80
+ Permission.ProjectMember,
81
+ Permission.ReadProjectIncomingCallPolicyEscalationRule,
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.ProjectMember,
111
+ Permission.CreateProjectIncomingCallPolicyEscalationRule,
112
+ ],
113
+ read: [
114
+ Permission.ProjectOwner,
115
+ Permission.ProjectAdmin,
116
+ Permission.ProjectMember,
117
+ Permission.ReadProjectIncomingCallPolicyEscalationRule,
118
+ ],
119
+ update: [],
120
+ })
121
+ @Index()
122
+ @TableColumn({
123
+ type: TableColumnType.ObjectID,
124
+ required: true,
125
+ canReadOnRelationQuery: true,
126
+ title: "Project ID",
127
+ description: "ID of your OneUptime Project in which this object belongs",
128
+ })
129
+ @Column({
130
+ type: ColumnType.ObjectID,
131
+ nullable: false,
132
+ transformer: ObjectID.getDatabaseTransformer(),
133
+ })
134
+ public projectId?: ObjectID = undefined;
135
+
136
+ @ColumnAccessControl({
137
+ create: [
138
+ Permission.ProjectOwner,
139
+ Permission.ProjectAdmin,
140
+ Permission.ProjectMember,
141
+ Permission.CreateProjectIncomingCallPolicyEscalationRule,
142
+ ],
143
+ read: [
144
+ Permission.ProjectOwner,
145
+ Permission.ProjectAdmin,
146
+ Permission.ProjectMember,
147
+ Permission.ReadProjectIncomingCallPolicyEscalationRule,
148
+ ],
149
+ update: [],
150
+ })
151
+ @TableColumn({
152
+ manyToOneRelationColumn: "incomingCallPolicyId",
153
+ type: TableColumnType.Entity,
154
+ modelType: IncomingCallPolicy,
155
+ title: "Incoming Call Policy",
156
+ description: "Relation to the parent Incoming Call Policy",
157
+ })
158
+ @ManyToOne(
159
+ () => {
160
+ return IncomingCallPolicy;
161
+ },
162
+ {
163
+ eager: false,
164
+ nullable: false,
165
+ onDelete: "CASCADE",
166
+ orphanedRowAction: "nullify",
167
+ },
168
+ )
169
+ @JoinColumn({ name: "incomingCallPolicyId" })
170
+ public incomingCallPolicy?: IncomingCallPolicy = undefined;
171
+
172
+ @ColumnAccessControl({
173
+ create: [
174
+ Permission.ProjectOwner,
175
+ Permission.ProjectAdmin,
176
+ Permission.ProjectMember,
177
+ Permission.CreateProjectIncomingCallPolicyEscalationRule,
178
+ ],
179
+ read: [
180
+ Permission.ProjectOwner,
181
+ Permission.ProjectAdmin,
182
+ Permission.ProjectMember,
183
+ Permission.ReadProjectIncomingCallPolicyEscalationRule,
184
+ ],
185
+ update: [],
186
+ })
187
+ @Index()
188
+ @TableColumn({
189
+ type: TableColumnType.ObjectID,
190
+ required: true,
191
+ canReadOnRelationQuery: true,
192
+ title: "Incoming Call Policy ID",
193
+ description: "ID of the parent Incoming Call Policy",
194
+ })
195
+ @Column({
196
+ type: ColumnType.ObjectID,
197
+ nullable: false,
198
+ transformer: ObjectID.getDatabaseTransformer(),
199
+ })
200
+ public incomingCallPolicyId?: ObjectID = undefined;
201
+
202
+ @ColumnAccessControl({
203
+ create: [
204
+ Permission.ProjectOwner,
205
+ Permission.ProjectAdmin,
206
+ Permission.ProjectMember,
207
+ Permission.CreateProjectIncomingCallPolicyEscalationRule,
208
+ ],
209
+ read: [
210
+ Permission.ProjectOwner,
211
+ Permission.ProjectAdmin,
212
+ Permission.ProjectMember,
213
+ Permission.ReadProjectIncomingCallPolicyEscalationRule,
214
+ ],
215
+ update: [
216
+ Permission.ProjectOwner,
217
+ Permission.ProjectAdmin,
218
+ Permission.ProjectMember,
219
+ Permission.EditProjectIncomingCallPolicyEscalationRule,
220
+ ],
221
+ })
222
+ @TableColumn({
223
+ required: false,
224
+ type: TableColumnType.ShortText,
225
+ title: "Name",
226
+ description: "Rule name (e.g., 'Primary On-Call', 'Backup Engineer')",
227
+ canReadOnRelationQuery: true,
228
+ })
229
+ @Column({
230
+ nullable: true,
231
+ type: ColumnType.ShortText,
232
+ length: ColumnLength.ShortText,
233
+ })
234
+ public name?: string = undefined;
235
+
236
+ @ColumnAccessControl({
237
+ create: [
238
+ Permission.ProjectOwner,
239
+ Permission.ProjectAdmin,
240
+ Permission.ProjectMember,
241
+ Permission.CreateProjectIncomingCallPolicyEscalationRule,
242
+ ],
243
+ read: [
244
+ Permission.ProjectOwner,
245
+ Permission.ProjectAdmin,
246
+ Permission.ProjectMember,
247
+ Permission.ReadProjectIncomingCallPolicyEscalationRule,
248
+ ],
249
+ update: [
250
+ Permission.ProjectOwner,
251
+ Permission.ProjectAdmin,
252
+ Permission.ProjectMember,
253
+ Permission.EditProjectIncomingCallPolicyEscalationRule,
254
+ ],
255
+ })
256
+ @TableColumn({
257
+ required: false,
258
+ type: TableColumnType.LongText,
259
+ title: "Description",
260
+ description: "Optional description of this escalation rule",
261
+ })
262
+ @Column({
263
+ nullable: true,
264
+ type: ColumnType.LongText,
265
+ length: ColumnLength.LongText,
266
+ })
267
+ public description?: string = undefined;
268
+
269
+ @ColumnAccessControl({
270
+ create: [
271
+ Permission.ProjectOwner,
272
+ Permission.ProjectAdmin,
273
+ Permission.ProjectMember,
274
+ Permission.CreateProjectIncomingCallPolicyEscalationRule,
275
+ ],
276
+ read: [
277
+ Permission.ProjectOwner,
278
+ Permission.ProjectAdmin,
279
+ Permission.ProjectMember,
280
+ Permission.ReadProjectIncomingCallPolicyEscalationRule,
281
+ ],
282
+ update: [
283
+ Permission.ProjectOwner,
284
+ Permission.ProjectAdmin,
285
+ Permission.ProjectMember,
286
+ Permission.EditProjectIncomingCallPolicyEscalationRule,
287
+ ],
288
+ })
289
+ @Index()
290
+ @TableColumn({
291
+ isDefaultValueColumn: false,
292
+ type: TableColumnType.Number,
293
+ title: "Order",
294
+ description: "Execution order (1, 2, 3...)",
295
+ canReadOnRelationQuery: true,
296
+ })
297
+ @Column({
298
+ type: ColumnType.Number,
299
+ })
300
+ public order?: number = undefined;
301
+
302
+ @ColumnAccessControl({
303
+ create: [
304
+ Permission.ProjectOwner,
305
+ Permission.ProjectAdmin,
306
+ Permission.ProjectMember,
307
+ Permission.CreateProjectIncomingCallPolicyEscalationRule,
308
+ ],
309
+ read: [
310
+ Permission.ProjectOwner,
311
+ Permission.ProjectAdmin,
312
+ Permission.ProjectMember,
313
+ Permission.ReadProjectIncomingCallPolicyEscalationRule,
314
+ ],
315
+ update: [
316
+ Permission.ProjectOwner,
317
+ Permission.ProjectAdmin,
318
+ Permission.ProjectMember,
319
+ Permission.EditProjectIncomingCallPolicyEscalationRule,
320
+ ],
321
+ })
322
+ @TableColumn({
323
+ required: true,
324
+ isDefaultValueColumn: true,
325
+ type: TableColumnType.Number,
326
+ title: "Escalate After (Seconds)",
327
+ description: "Seconds before escalating to next rule",
328
+ defaultValue: 30,
329
+ })
330
+ @Column({
331
+ nullable: false,
332
+ type: ColumnType.Number,
333
+ default: 30,
334
+ })
335
+ public escalateAfterSeconds?: number = undefined;
336
+
337
+ // Either onCallDutyPolicyScheduleId OR userId must be set, never both
338
+ @ColumnAccessControl({
339
+ create: [
340
+ Permission.ProjectOwner,
341
+ Permission.ProjectAdmin,
342
+ Permission.ProjectMember,
343
+ Permission.CreateProjectIncomingCallPolicyEscalationRule,
344
+ ],
345
+ read: [
346
+ Permission.ProjectOwner,
347
+ Permission.ProjectAdmin,
348
+ Permission.ProjectMember,
349
+ Permission.ReadProjectIncomingCallPolicyEscalationRule,
350
+ ],
351
+ update: [
352
+ Permission.ProjectOwner,
353
+ Permission.ProjectAdmin,
354
+ Permission.ProjectMember,
355
+ Permission.EditProjectIncomingCallPolicyEscalationRule,
356
+ ],
357
+ })
358
+ @TableColumn({
359
+ manyToOneRelationColumn: "onCallDutyPolicyScheduleId",
360
+ type: TableColumnType.Entity,
361
+ modelType: OnCallDutyPolicySchedule,
362
+ title: "On-Call Schedule",
363
+ description: "Reference to on-call schedule (mutually exclusive with user)",
364
+ })
365
+ @ManyToOne(
366
+ () => {
367
+ return OnCallDutyPolicySchedule;
368
+ },
369
+ {
370
+ eager: false,
371
+ nullable: true,
372
+ onDelete: "CASCADE",
373
+ orphanedRowAction: "nullify",
374
+ },
375
+ )
376
+ @JoinColumn({ name: "onCallDutyPolicyScheduleId" })
377
+ public onCallDutyPolicySchedule?: OnCallDutyPolicySchedule = undefined;
378
+
379
+ @ColumnAccessControl({
380
+ create: [
381
+ Permission.ProjectOwner,
382
+ Permission.ProjectAdmin,
383
+ Permission.ProjectMember,
384
+ Permission.CreateProjectIncomingCallPolicyEscalationRule,
385
+ ],
386
+ read: [
387
+ Permission.ProjectOwner,
388
+ Permission.ProjectAdmin,
389
+ Permission.ProjectMember,
390
+ Permission.ReadProjectIncomingCallPolicyEscalationRule,
391
+ ],
392
+ update: [
393
+ Permission.ProjectOwner,
394
+ Permission.ProjectAdmin,
395
+ Permission.ProjectMember,
396
+ Permission.EditProjectIncomingCallPolicyEscalationRule,
397
+ ],
398
+ })
399
+ @TableColumn({
400
+ type: TableColumnType.ObjectID,
401
+ title: "On-Call Schedule ID",
402
+ description:
403
+ "ID of the on-call schedule to route to (mutually exclusive with userId)",
404
+ })
405
+ @Column({
406
+ type: ColumnType.ObjectID,
407
+ nullable: true,
408
+ transformer: ObjectID.getDatabaseTransformer(),
409
+ })
410
+ public onCallDutyPolicyScheduleId?: ObjectID = undefined;
411
+
412
+ @ColumnAccessControl({
413
+ create: [
414
+ Permission.ProjectOwner,
415
+ Permission.ProjectAdmin,
416
+ Permission.ProjectMember,
417
+ Permission.CreateProjectIncomingCallPolicyEscalationRule,
418
+ ],
419
+ read: [
420
+ Permission.ProjectOwner,
421
+ Permission.ProjectAdmin,
422
+ Permission.ProjectMember,
423
+ Permission.ReadProjectIncomingCallPolicyEscalationRule,
424
+ ],
425
+ update: [
426
+ Permission.ProjectOwner,
427
+ Permission.ProjectAdmin,
428
+ Permission.ProjectMember,
429
+ Permission.EditProjectIncomingCallPolicyEscalationRule,
430
+ ],
431
+ })
432
+ @TableColumn({
433
+ manyToOneRelationColumn: "userId",
434
+ type: TableColumnType.Entity,
435
+ modelType: User,
436
+ title: "User",
437
+ description:
438
+ "Direct user reference (mutually exclusive with on-call schedule)",
439
+ })
440
+ @ManyToOne(
441
+ () => {
442
+ return User;
443
+ },
444
+ {
445
+ eager: false,
446
+ nullable: true,
447
+ onDelete: "CASCADE",
448
+ orphanedRowAction: "nullify",
449
+ },
450
+ )
451
+ @JoinColumn({ name: "userId" })
452
+ public user?: User = undefined;
453
+
454
+ @ColumnAccessControl({
455
+ create: [
456
+ Permission.ProjectOwner,
457
+ Permission.ProjectAdmin,
458
+ Permission.ProjectMember,
459
+ Permission.CreateProjectIncomingCallPolicyEscalationRule,
460
+ ],
461
+ read: [
462
+ Permission.ProjectOwner,
463
+ Permission.ProjectAdmin,
464
+ Permission.ProjectMember,
465
+ Permission.ReadProjectIncomingCallPolicyEscalationRule,
466
+ ],
467
+ update: [
468
+ Permission.ProjectOwner,
469
+ Permission.ProjectAdmin,
470
+ Permission.ProjectMember,
471
+ Permission.EditProjectIncomingCallPolicyEscalationRule,
472
+ ],
473
+ })
474
+ @TableColumn({
475
+ type: TableColumnType.ObjectID,
476
+ title: "User ID",
477
+ description:
478
+ "ID of the user to route to directly (mutually exclusive with onCallDutyPolicyScheduleId)",
479
+ })
480
+ @Column({
481
+ type: ColumnType.ObjectID,
482
+ nullable: true,
483
+ transformer: ObjectID.getDatabaseTransformer(),
484
+ })
485
+ public userId?: ObjectID = undefined;
486
+
487
+ @ColumnAccessControl({
488
+ create: [
489
+ Permission.ProjectOwner,
490
+ Permission.ProjectAdmin,
491
+ Permission.ProjectMember,
492
+ Permission.CreateProjectIncomingCallPolicyEscalationRule,
493
+ ],
494
+ read: [
495
+ Permission.ProjectOwner,
496
+ Permission.ProjectAdmin,
497
+ Permission.ProjectMember,
498
+ Permission.ReadProjectIncomingCallPolicyEscalationRule,
499
+ ],
500
+ update: [],
501
+ })
502
+ @TableColumn({
503
+ manyToOneRelationColumn: "createdByUserId",
504
+ type: TableColumnType.Entity,
505
+ modelType: User,
506
+ title: "Created by User",
507
+ description:
508
+ "Relation to User who created this object (if this object was created by a User)",
509
+ })
510
+ @ManyToOne(
511
+ () => {
512
+ return User;
513
+ },
514
+ {
515
+ eager: false,
516
+ nullable: true,
517
+ onDelete: "SET NULL",
518
+ orphanedRowAction: "nullify",
519
+ },
520
+ )
521
+ @JoinColumn({ name: "createdByUserId" })
522
+ public createdByUser?: User = undefined;
523
+
524
+ @ColumnAccessControl({
525
+ create: [
526
+ Permission.ProjectOwner,
527
+ Permission.ProjectAdmin,
528
+ Permission.ProjectMember,
529
+ Permission.CreateProjectIncomingCallPolicyEscalationRule,
530
+ ],
531
+ read: [
532
+ Permission.ProjectOwner,
533
+ Permission.ProjectAdmin,
534
+ Permission.ProjectMember,
535
+ Permission.ReadProjectIncomingCallPolicyEscalationRule,
536
+ ],
537
+ update: [],
538
+ })
539
+ @TableColumn({
540
+ type: TableColumnType.ObjectID,
541
+ title: "Created by User ID",
542
+ description:
543
+ "User ID who created this object (if this object was created by a User)",
544
+ })
545
+ @Column({
546
+ type: ColumnType.ObjectID,
547
+ nullable: true,
548
+ transformer: ObjectID.getDatabaseTransformer(),
549
+ })
550
+ public createdByUserId?: ObjectID = undefined;
551
+
552
+ @ColumnAccessControl({
553
+ create: [],
554
+ read: [],
555
+ update: [],
556
+ })
557
+ @TableColumn({
558
+ manyToOneRelationColumn: "deletedByUserId",
559
+ type: TableColumnType.Entity,
560
+ title: "Deleted by User",
561
+ modelType: User,
562
+ description:
563
+ "Relation to User who deleted this object (if this object was deleted by a User)",
564
+ })
565
+ @ManyToOne(
566
+ () => {
567
+ return User;
568
+ },
569
+ {
570
+ cascade: false,
571
+ eager: false,
572
+ nullable: true,
573
+ onDelete: "SET NULL",
574
+ orphanedRowAction: "nullify",
575
+ },
576
+ )
577
+ @JoinColumn({ name: "deletedByUserId" })
578
+ public deletedByUser?: User = undefined;
579
+
580
+ @ColumnAccessControl({
581
+ create: [],
582
+ read: [],
583
+ update: [],
584
+ })
585
+ @TableColumn({
586
+ type: TableColumnType.ObjectID,
587
+ title: "Deleted by User ID",
588
+ description:
589
+ "User ID who deleted this object (if this object was deleted by a User)",
590
+ })
591
+ @Column({
592
+ type: ColumnType.ObjectID,
593
+ nullable: true,
594
+ transformer: ObjectID.getDatabaseTransformer(),
595
+ })
596
+ public deletedByUserId?: ObjectID = undefined;
597
+ }
@@ -69,6 +69,12 @@ import OnCallDutyPolicyScheduleLayer from "./OnCallDutyPolicyScheduleLayer";
69
69
  import OnCallDutyPolicyScheduleLayerUser from "./OnCallDutyPolicyScheduleLayerUser";
70
70
  import OnCallDutyPolicyTimeLog from "./OnCallDutyPolicyTimeLog";
71
71
 
72
+ // Incoming Call Policy
73
+ import IncomingCallPolicy from "./IncomingCallPolicy";
74
+ import IncomingCallPolicyEscalationRule from "./IncomingCallPolicyEscalationRule";
75
+ import IncomingCallLog from "./IncomingCallLog";
76
+ import IncomingCallLogItem from "./IncomingCallLogItem";
77
+
72
78
  import Probe from "./Probe";
73
79
  import ProbeOwnerTeam from "./ProbeOwnerTeam";
74
80
  import ProbeOwnerUser from "./ProbeOwnerUser";
@@ -152,6 +158,7 @@ import UserNotificationSetting from "./UserNotificationSetting";
152
158
  import UserOnCallLog from "./UserOnCallLog";
153
159
  import UserOnCallLogTimeline from "./UserOnCallLogTimeline";
154
160
  import UserSms from "./UserSMS";
161
+ import UserIncomingCallNumber from "./UserIncomingCallNumber";
155
162
  // Workflows.
156
163
  import Workflow from "./Workflow";
157
164
  import WorkflowLog from "./WorkflowLog";
@@ -197,6 +204,8 @@ import OnCallDutyPolicyUserOverride from "./OnCallDutyPolicyUserOverride";
197
204
  import MonitorFeed from "./MonitorFeed";
198
205
  import MetricType from "./MetricType";
199
206
  import ProjectSCIM from "./ProjectSCIM";
207
+ import ProjectSCIMLog from "./ProjectSCIMLog";
208
+ import StatusPageSCIMLog from "./StatusPageSCIMLog";
200
209
 
201
210
  const AllModelTypes: Array<{
202
211
  new (): BaseModel;
@@ -226,6 +235,12 @@ const AllModelTypes: Array<{
226
235
  OnCallDutyPolicyExecutionLogTimeline,
227
236
  OnCallDutyPolicyUserOverride,
228
237
 
238
+ // Incoming Call Policy
239
+ IncomingCallPolicy,
240
+ IncomingCallPolicyEscalationRule,
241
+ IncomingCallLog,
242
+ IncomingCallLogItem,
243
+
229
244
  Monitor,
230
245
  MonitorSecret,
231
246
  MonitorStatus,
@@ -324,6 +339,7 @@ const AllModelTypes: Array<{
324
339
  UserCall,
325
340
  UserPush,
326
341
  UserWhatsApp,
342
+ UserIncomingCallNumber,
327
343
 
328
344
  UserNotificationRule,
329
345
  UserOnCallLog,
@@ -417,6 +433,8 @@ const AllModelTypes: Array<{
417
433
  OnCallDutyPolicyTimeLog,
418
434
 
419
435
  ProjectSCIM,
436
+ ProjectSCIMLog,
437
+ StatusPageSCIMLog,
420
438
  ];
421
439
 
422
440
  const modelTypeMap: { [key: string]: { new (): BaseModel } } = {};