@oneuptime/common 7.0.4041 → 7.0.4064
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Models/DatabaseModels/Index.ts +9 -1
- package/Models/DatabaseModels/OnCallDutyPolicy.ts +20 -0
- package/Models/DatabaseModels/OnCallDutyPolicyFeed.ts +527 -0
- package/Models/DatabaseModels/OnCallDutyPolicyOwnerTeam.ts +426 -0
- package/Models/DatabaseModels/OnCallDutyPolicyOwnerUser.ts +425 -0
- package/Server/API/SlackAPI.ts +14 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1744804990712-MigrationName.ts +17 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1744809770336-MigrationName.ts +173 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts +4 -0
- package/Server/Services/OnCallDutyPolicyEscalationRuleScheduleService.ts +71 -2
- package/Server/Services/OnCallDutyPolicyEscalationRuleService.ts +14 -0
- package/Server/Services/OnCallDutyPolicyEscalationRuleTeamService.ts +69 -2
- package/Server/Services/OnCallDutyPolicyEscalationRuleUserService.ts +77 -2
- package/Server/Services/OnCallDutyPolicyExecutionLogService.ts +1 -1
- package/Server/Services/OnCallDutyPolicyExecutionLogTimelineService.ts +1 -1
- package/Server/Services/OnCallDutyPolicyFeedService.ts +156 -0
- package/Server/Services/OnCallDutyPolicyOwnerTeamService.ts +181 -0
- package/Server/Services/OnCallDutyPolicyOwnerUserService.ts +174 -0
- package/Server/Services/OnCallDutyPolicyScheduleService.ts +101 -9
- package/Server/Services/OnCallDutyPolicyService.ts +219 -1
- package/Server/Services/OnCallDutyPolicyUserOverrideService.ts +184 -1
- package/Server/Services/WorkspaceNotificationRuleService.ts +93 -0
- package/Server/Utils/StartServer.ts +5 -2
- package/Server/Utils/Workspace/Slack/Actions/ActionTypes.ts +3 -0
- package/Server/Utils/Workspace/Slack/Actions/OnCallDutyPolicy.ts +48 -0
- package/Server/Utils/Workspace/Slack/Messages/OnCallDutyPolicy.ts +62 -0
- package/Server/Utils/Workspace/WorkspaceMessages/OnCallDutyPolicy.ts +75 -0
- package/Types/Permission.ts +112 -7
- package/Types/Workspace/NotificationRules/EventType.ts +1 -0
- package/Types/Workspace/NotificationRules/NotificationRuleCondition.ts +5 -0
- package/UI/webpack-middleware.js +65 -0
- package/build/dist/Models/DatabaseModels/Index.js +8 -0
- package/build/dist/Models/DatabaseModels/Index.js.map +1 -1
- package/build/dist/Models/DatabaseModels/OnCallDutyPolicy.js +20 -0
- package/build/dist/Models/DatabaseModels/OnCallDutyPolicy.js.map +1 -1
- package/build/dist/Models/DatabaseModels/OnCallDutyPolicyFeed.js +549 -0
- package/build/dist/Models/DatabaseModels/OnCallDutyPolicyFeed.js.map +1 -0
- package/build/dist/Models/DatabaseModels/OnCallDutyPolicyOwnerTeam.js +442 -0
- package/build/dist/Models/DatabaseModels/OnCallDutyPolicyOwnerTeam.js.map +1 -0
- package/build/dist/Models/DatabaseModels/OnCallDutyPolicyOwnerUser.js +441 -0
- package/build/dist/Models/DatabaseModels/OnCallDutyPolicyOwnerUser.js.map +1 -0
- package/build/dist/Server/API/SlackAPI.js +11 -0
- package/build/dist/Server/API/SlackAPI.js.map +1 -1
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1744804990712-MigrationName.js +12 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1744804990712-MigrationName.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1744809770336-MigrationName.js +66 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1744809770336-MigrationName.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js +4 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js.map +1 -1
- package/build/dist/Server/Services/OnCallDutyPolicyEscalationRuleScheduleService.js +52 -3
- package/build/dist/Server/Services/OnCallDutyPolicyEscalationRuleScheduleService.js.map +1 -1
- package/build/dist/Server/Services/OnCallDutyPolicyEscalationRuleService.js +12 -0
- package/build/dist/Server/Services/OnCallDutyPolicyEscalationRuleService.js.map +1 -1
- package/build/dist/Server/Services/OnCallDutyPolicyEscalationRuleTeamService.js +52 -3
- package/build/dist/Server/Services/OnCallDutyPolicyEscalationRuleTeamService.js.map +1 -1
- package/build/dist/Server/Services/OnCallDutyPolicyEscalationRuleUserService.js +63 -3
- package/build/dist/Server/Services/OnCallDutyPolicyEscalationRuleUserService.js.map +1 -1
- package/build/dist/Server/Services/OnCallDutyPolicyExecutionLogService.js +1 -1
- package/build/dist/Server/Services/OnCallDutyPolicyExecutionLogService.js.map +1 -1
- package/build/dist/Server/Services/OnCallDutyPolicyExecutionLogTimelineService.js +1 -1
- package/build/dist/Server/Services/OnCallDutyPolicyExecutionLogTimelineService.js.map +1 -1
- package/build/dist/Server/Services/OnCallDutyPolicyFeedService.js +119 -0
- package/build/dist/Server/Services/OnCallDutyPolicyFeedService.js.map +1 -0
- package/build/dist/Server/Services/OnCallDutyPolicyOwnerTeamService.js +161 -0
- package/build/dist/Server/Services/OnCallDutyPolicyOwnerTeamService.js.map +1 -0
- package/build/dist/Server/Services/OnCallDutyPolicyOwnerUserService.js +154 -0
- package/build/dist/Server/Services/OnCallDutyPolicyOwnerUserService.js.map +1 -0
- package/build/dist/Server/Services/OnCallDutyPolicyScheduleService.js +87 -20
- package/build/dist/Server/Services/OnCallDutyPolicyScheduleService.js.map +1 -1
- package/build/dist/Server/Services/OnCallDutyPolicyService.js +174 -2
- package/build/dist/Server/Services/OnCallDutyPolicyService.js.map +1 -1
- package/build/dist/Server/Services/OnCallDutyPolicyUserOverrideService.js +122 -0
- package/build/dist/Server/Services/OnCallDutyPolicyUserOverrideService.js.map +1 -1
- package/build/dist/Server/Services/WorkspaceNotificationRuleService.js +71 -0
- package/build/dist/Server/Services/WorkspaceNotificationRuleService.js.map +1 -1
- package/build/dist/Server/Utils/StartServer.js +5 -2
- package/build/dist/Server/Utils/StartServer.js.map +1 -1
- package/build/dist/Server/Utils/Workspace/Slack/Actions/ActionTypes.js +2 -0
- package/build/dist/Server/Utils/Workspace/Slack/Actions/ActionTypes.js.map +1 -1
- package/build/dist/Server/Utils/Workspace/Slack/Actions/OnCallDutyPolicy.js +50 -0
- package/build/dist/Server/Utils/Workspace/Slack/Actions/OnCallDutyPolicy.js.map +1 -0
- package/build/dist/Server/Utils/Workspace/Slack/Messages/OnCallDutyPolicy.js +52 -0
- package/build/dist/Server/Utils/Workspace/Slack/Messages/OnCallDutyPolicy.js.map +1 -0
- package/build/dist/Server/Utils/Workspace/WorkspaceMessages/OnCallDutyPolicy.js +69 -0
- package/build/dist/Server/Utils/Workspace/WorkspaceMessages/OnCallDutyPolicy.js.map +1 -0
- package/build/dist/Types/Permission.js +95 -7
- package/build/dist/Types/Permission.js.map +1 -1
- package/build/dist/Types/Workspace/NotificationRules/EventType.js +1 -0
- package/build/dist/Types/Workspace/NotificationRules/EventType.js.map +1 -1
- package/build/dist/Types/Workspace/NotificationRules/NotificationRuleCondition.js +4 -0
- package/build/dist/Types/Workspace/NotificationRules/NotificationRuleCondition.js.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,426 @@
|
|
|
1
|
+
import OnCallDutyPolicy from "./OnCallDutyPolicy";
|
|
2
|
+
import Project from "./Project";
|
|
3
|
+
import Team from "./Team";
|
|
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 { Column, Entity, Index, JoinColumn, ManyToOne } from "typeorm";
|
|
23
|
+
|
|
24
|
+
@EnableDocumentation()
|
|
25
|
+
@TenantColumn("projectId")
|
|
26
|
+
@TableBillingAccessControl({
|
|
27
|
+
create: PlanType.Growth,
|
|
28
|
+
read: PlanType.Free,
|
|
29
|
+
update: PlanType.Growth,
|
|
30
|
+
delete: PlanType.Free,
|
|
31
|
+
})
|
|
32
|
+
@TableAccessControl({
|
|
33
|
+
create: [
|
|
34
|
+
Permission.ProjectOwner,
|
|
35
|
+
Permission.ProjectAdmin,
|
|
36
|
+
Permission.ProjectMember,
|
|
37
|
+
Permission.CreateOnCallDutyPolicyOwnerTeam,
|
|
38
|
+
],
|
|
39
|
+
read: [
|
|
40
|
+
Permission.ProjectOwner,
|
|
41
|
+
Permission.ProjectAdmin,
|
|
42
|
+
Permission.ProjectMember,
|
|
43
|
+
Permission.ReadOnCallDutyPolicyOwnerTeam,
|
|
44
|
+
],
|
|
45
|
+
delete: [
|
|
46
|
+
Permission.ProjectOwner,
|
|
47
|
+
Permission.ProjectAdmin,
|
|
48
|
+
Permission.ProjectMember,
|
|
49
|
+
Permission.DeleteOnCallDutyPolicyOwnerTeam,
|
|
50
|
+
],
|
|
51
|
+
update: [
|
|
52
|
+
Permission.ProjectOwner,
|
|
53
|
+
Permission.ProjectAdmin,
|
|
54
|
+
Permission.ProjectMember,
|
|
55
|
+
Permission.EditOnCallDutyPolicyOwnerTeam,
|
|
56
|
+
],
|
|
57
|
+
})
|
|
58
|
+
@EnableWorkflow({
|
|
59
|
+
create: true,
|
|
60
|
+
delete: true,
|
|
61
|
+
update: true,
|
|
62
|
+
read: true,
|
|
63
|
+
})
|
|
64
|
+
@CrudApiEndpoint(new Route("/on-call-duty-policy-owner-team"))
|
|
65
|
+
@TableMetadata({
|
|
66
|
+
tableName: "OnCallDutyPolicyOwnerTeam",
|
|
67
|
+
singularName: "OnCallDutyPolicy Team Owner",
|
|
68
|
+
pluralName: "OnCallDutyPolicy Team Owners",
|
|
69
|
+
icon: IconProp.Signal,
|
|
70
|
+
tableDescription: "Add teams as owners to your onCallDutyPolicys.",
|
|
71
|
+
})
|
|
72
|
+
@Entity({
|
|
73
|
+
name: "OnCallDutyPolicyOwnerTeam",
|
|
74
|
+
})
|
|
75
|
+
export default class OnCallDutyPolicyOwnerTeam extends BaseModel {
|
|
76
|
+
@ColumnAccessControl({
|
|
77
|
+
create: [
|
|
78
|
+
Permission.ProjectOwner,
|
|
79
|
+
Permission.ProjectAdmin,
|
|
80
|
+
Permission.ProjectMember,
|
|
81
|
+
Permission.CreateOnCallDutyPolicyOwnerTeam,
|
|
82
|
+
],
|
|
83
|
+
read: [
|
|
84
|
+
Permission.ProjectOwner,
|
|
85
|
+
Permission.ProjectAdmin,
|
|
86
|
+
Permission.ProjectMember,
|
|
87
|
+
Permission.ReadOnCallDutyPolicyOwnerTeam,
|
|
88
|
+
],
|
|
89
|
+
update: [],
|
|
90
|
+
})
|
|
91
|
+
@TableColumn({
|
|
92
|
+
manyToOneRelationColumn: "projectId",
|
|
93
|
+
type: TableColumnType.Entity,
|
|
94
|
+
modelType: Project,
|
|
95
|
+
title: "Project",
|
|
96
|
+
description: "Relation to Project Resource in which this object belongs",
|
|
97
|
+
})
|
|
98
|
+
@ManyToOne(
|
|
99
|
+
() => {
|
|
100
|
+
return Project;
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
eager: false,
|
|
104
|
+
nullable: false,
|
|
105
|
+
onDelete: "CASCADE",
|
|
106
|
+
orphanedRowAction: "nullify",
|
|
107
|
+
},
|
|
108
|
+
)
|
|
109
|
+
@JoinColumn({ name: "projectId" })
|
|
110
|
+
public project?: Project = undefined;
|
|
111
|
+
|
|
112
|
+
@ColumnAccessControl({
|
|
113
|
+
create: [
|
|
114
|
+
Permission.ProjectOwner,
|
|
115
|
+
Permission.ProjectAdmin,
|
|
116
|
+
Permission.ProjectMember,
|
|
117
|
+
Permission.CreateOnCallDutyPolicyOwnerTeam,
|
|
118
|
+
],
|
|
119
|
+
read: [
|
|
120
|
+
Permission.ProjectOwner,
|
|
121
|
+
Permission.ProjectAdmin,
|
|
122
|
+
Permission.ProjectMember,
|
|
123
|
+
Permission.ReadOnCallDutyPolicyOwnerTeam,
|
|
124
|
+
],
|
|
125
|
+
update: [],
|
|
126
|
+
})
|
|
127
|
+
@Index()
|
|
128
|
+
@TableColumn({
|
|
129
|
+
type: TableColumnType.ObjectID,
|
|
130
|
+
required: true,
|
|
131
|
+
canReadOnRelationQuery: true,
|
|
132
|
+
title: "Project ID",
|
|
133
|
+
description: "ID of your OneUptime Project in which this object belongs",
|
|
134
|
+
})
|
|
135
|
+
@Column({
|
|
136
|
+
type: ColumnType.ObjectID,
|
|
137
|
+
nullable: false,
|
|
138
|
+
transformer: ObjectID.getDatabaseTransformer(),
|
|
139
|
+
})
|
|
140
|
+
public projectId?: ObjectID = undefined;
|
|
141
|
+
|
|
142
|
+
@ColumnAccessControl({
|
|
143
|
+
create: [
|
|
144
|
+
Permission.ProjectOwner,
|
|
145
|
+
Permission.ProjectAdmin,
|
|
146
|
+
Permission.ProjectMember,
|
|
147
|
+
Permission.CreateOnCallDutyPolicyOwnerTeam,
|
|
148
|
+
],
|
|
149
|
+
read: [
|
|
150
|
+
Permission.ProjectOwner,
|
|
151
|
+
Permission.ProjectAdmin,
|
|
152
|
+
Permission.ProjectMember,
|
|
153
|
+
Permission.ReadOnCallDutyPolicyOwnerTeam,
|
|
154
|
+
],
|
|
155
|
+
update: [],
|
|
156
|
+
})
|
|
157
|
+
@TableColumn({
|
|
158
|
+
manyToOneRelationColumn: "teamId",
|
|
159
|
+
type: TableColumnType.Entity,
|
|
160
|
+
modelType: Team,
|
|
161
|
+
title: "Team",
|
|
162
|
+
description:
|
|
163
|
+
"Team that is the owner. All users in this team will receive notifications. ",
|
|
164
|
+
})
|
|
165
|
+
@ManyToOne(
|
|
166
|
+
() => {
|
|
167
|
+
return Team;
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
eager: false,
|
|
171
|
+
nullable: true,
|
|
172
|
+
onDelete: "CASCADE",
|
|
173
|
+
orphanedRowAction: "nullify",
|
|
174
|
+
},
|
|
175
|
+
)
|
|
176
|
+
@JoinColumn({ name: "teamId" })
|
|
177
|
+
public team?: Team = undefined;
|
|
178
|
+
|
|
179
|
+
@ColumnAccessControl({
|
|
180
|
+
create: [
|
|
181
|
+
Permission.ProjectOwner,
|
|
182
|
+
Permission.ProjectAdmin,
|
|
183
|
+
Permission.ProjectMember,
|
|
184
|
+
Permission.CreateOnCallDutyPolicyOwnerTeam,
|
|
185
|
+
],
|
|
186
|
+
read: [
|
|
187
|
+
Permission.ProjectOwner,
|
|
188
|
+
Permission.ProjectAdmin,
|
|
189
|
+
Permission.ProjectMember,
|
|
190
|
+
Permission.ReadOnCallDutyPolicyOwnerTeam,
|
|
191
|
+
],
|
|
192
|
+
update: [],
|
|
193
|
+
})
|
|
194
|
+
@Index()
|
|
195
|
+
@TableColumn({
|
|
196
|
+
type: TableColumnType.ObjectID,
|
|
197
|
+
required: true,
|
|
198
|
+
canReadOnRelationQuery: true,
|
|
199
|
+
title: "Team ID",
|
|
200
|
+
description: "ID of your OneUptime Team in which this object belongs",
|
|
201
|
+
})
|
|
202
|
+
@Column({
|
|
203
|
+
type: ColumnType.ObjectID,
|
|
204
|
+
nullable: false,
|
|
205
|
+
transformer: ObjectID.getDatabaseTransformer(),
|
|
206
|
+
})
|
|
207
|
+
public teamId?: ObjectID = undefined;
|
|
208
|
+
|
|
209
|
+
@ColumnAccessControl({
|
|
210
|
+
create: [
|
|
211
|
+
Permission.ProjectOwner,
|
|
212
|
+
Permission.ProjectAdmin,
|
|
213
|
+
Permission.ProjectMember,
|
|
214
|
+
Permission.CreateOnCallDutyPolicyOwnerTeam,
|
|
215
|
+
],
|
|
216
|
+
read: [
|
|
217
|
+
Permission.ProjectOwner,
|
|
218
|
+
Permission.ProjectAdmin,
|
|
219
|
+
Permission.ProjectMember,
|
|
220
|
+
Permission.ReadOnCallDutyPolicyOwnerTeam,
|
|
221
|
+
],
|
|
222
|
+
update: [],
|
|
223
|
+
})
|
|
224
|
+
@TableColumn({
|
|
225
|
+
manyToOneRelationColumn: "onCallDutyPolicyId",
|
|
226
|
+
type: TableColumnType.Entity,
|
|
227
|
+
modelType: OnCallDutyPolicy,
|
|
228
|
+
title: "OnCallDutyPolicy",
|
|
229
|
+
description:
|
|
230
|
+
"Relation to OnCallDutyPolicy Resource in which this object belongs",
|
|
231
|
+
})
|
|
232
|
+
@ManyToOne(
|
|
233
|
+
() => {
|
|
234
|
+
return OnCallDutyPolicy;
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
eager: false,
|
|
238
|
+
nullable: true,
|
|
239
|
+
onDelete: "CASCADE",
|
|
240
|
+
orphanedRowAction: "nullify",
|
|
241
|
+
},
|
|
242
|
+
)
|
|
243
|
+
@JoinColumn({ name: "onCallDutyPolicyId" })
|
|
244
|
+
public onCallDutyPolicy?: OnCallDutyPolicy = undefined;
|
|
245
|
+
|
|
246
|
+
@ColumnAccessControl({
|
|
247
|
+
create: [
|
|
248
|
+
Permission.ProjectOwner,
|
|
249
|
+
Permission.ProjectAdmin,
|
|
250
|
+
Permission.ProjectMember,
|
|
251
|
+
Permission.CreateOnCallDutyPolicyOwnerTeam,
|
|
252
|
+
],
|
|
253
|
+
read: [
|
|
254
|
+
Permission.ProjectOwner,
|
|
255
|
+
Permission.ProjectAdmin,
|
|
256
|
+
Permission.ProjectMember,
|
|
257
|
+
Permission.ReadOnCallDutyPolicyOwnerTeam,
|
|
258
|
+
],
|
|
259
|
+
update: [],
|
|
260
|
+
})
|
|
261
|
+
@Index()
|
|
262
|
+
@TableColumn({
|
|
263
|
+
type: TableColumnType.ObjectID,
|
|
264
|
+
required: true,
|
|
265
|
+
canReadOnRelationQuery: true,
|
|
266
|
+
title: "OnCallDutyPolicy ID",
|
|
267
|
+
description:
|
|
268
|
+
"ID of your OneUptime OnCallDutyPolicy in which this object belongs",
|
|
269
|
+
})
|
|
270
|
+
@Column({
|
|
271
|
+
type: ColumnType.ObjectID,
|
|
272
|
+
nullable: false,
|
|
273
|
+
transformer: ObjectID.getDatabaseTransformer(),
|
|
274
|
+
})
|
|
275
|
+
public onCallDutyPolicyId?: ObjectID = undefined;
|
|
276
|
+
|
|
277
|
+
@ColumnAccessControl({
|
|
278
|
+
create: [
|
|
279
|
+
Permission.ProjectOwner,
|
|
280
|
+
Permission.ProjectAdmin,
|
|
281
|
+
Permission.ProjectMember,
|
|
282
|
+
Permission.CreateOnCallDutyPolicyOwnerTeam,
|
|
283
|
+
],
|
|
284
|
+
read: [
|
|
285
|
+
Permission.ProjectOwner,
|
|
286
|
+
Permission.ProjectAdmin,
|
|
287
|
+
Permission.ProjectMember,
|
|
288
|
+
Permission.ReadOnCallDutyPolicyOwnerTeam,
|
|
289
|
+
],
|
|
290
|
+
update: [],
|
|
291
|
+
})
|
|
292
|
+
@TableColumn({
|
|
293
|
+
manyToOneRelationColumn: "createdByUserId",
|
|
294
|
+
type: TableColumnType.Entity,
|
|
295
|
+
modelType: User,
|
|
296
|
+
title: "Created by User",
|
|
297
|
+
description:
|
|
298
|
+
"Relation to User who created this object (if this object was created by a User)",
|
|
299
|
+
})
|
|
300
|
+
@ManyToOne(
|
|
301
|
+
() => {
|
|
302
|
+
return User;
|
|
303
|
+
},
|
|
304
|
+
{
|
|
305
|
+
eager: false,
|
|
306
|
+
nullable: true,
|
|
307
|
+
onDelete: "SET NULL",
|
|
308
|
+
orphanedRowAction: "nullify",
|
|
309
|
+
},
|
|
310
|
+
)
|
|
311
|
+
@JoinColumn({ name: "createdByUserId" })
|
|
312
|
+
public createdByUser?: User = undefined;
|
|
313
|
+
|
|
314
|
+
@ColumnAccessControl({
|
|
315
|
+
create: [
|
|
316
|
+
Permission.ProjectOwner,
|
|
317
|
+
Permission.ProjectAdmin,
|
|
318
|
+
Permission.ProjectMember,
|
|
319
|
+
Permission.CreateOnCallDutyPolicyOwnerTeam,
|
|
320
|
+
],
|
|
321
|
+
read: [
|
|
322
|
+
Permission.ProjectOwner,
|
|
323
|
+
Permission.ProjectAdmin,
|
|
324
|
+
Permission.ProjectMember,
|
|
325
|
+
Permission.ReadOnCallDutyPolicyOwnerTeam,
|
|
326
|
+
],
|
|
327
|
+
update: [],
|
|
328
|
+
})
|
|
329
|
+
@TableColumn({
|
|
330
|
+
type: TableColumnType.ObjectID,
|
|
331
|
+
title: "Created by User ID",
|
|
332
|
+
description:
|
|
333
|
+
"User ID who created this object (if this object was created by a User)",
|
|
334
|
+
})
|
|
335
|
+
@Column({
|
|
336
|
+
type: ColumnType.ObjectID,
|
|
337
|
+
nullable: true,
|
|
338
|
+
transformer: ObjectID.getDatabaseTransformer(),
|
|
339
|
+
})
|
|
340
|
+
public createdByUserId?: ObjectID = undefined;
|
|
341
|
+
|
|
342
|
+
@ColumnAccessControl({
|
|
343
|
+
create: [],
|
|
344
|
+
read: [
|
|
345
|
+
Permission.ProjectOwner,
|
|
346
|
+
Permission.ProjectAdmin,
|
|
347
|
+
Permission.ProjectMember,
|
|
348
|
+
Permission.ReadOnCallDutyPolicyOwnerTeam,
|
|
349
|
+
],
|
|
350
|
+
update: [],
|
|
351
|
+
})
|
|
352
|
+
@TableColumn({
|
|
353
|
+
manyToOneRelationColumn: "deletedByUserId",
|
|
354
|
+
type: TableColumnType.Entity,
|
|
355
|
+
title: "Deleted by User",
|
|
356
|
+
description:
|
|
357
|
+
"Relation to User who deleted this object (if this object was deleted by a User)",
|
|
358
|
+
})
|
|
359
|
+
@ManyToOne(
|
|
360
|
+
() => {
|
|
361
|
+
return User;
|
|
362
|
+
},
|
|
363
|
+
{
|
|
364
|
+
cascade: false,
|
|
365
|
+
eager: false,
|
|
366
|
+
nullable: true,
|
|
367
|
+
onDelete: "SET NULL",
|
|
368
|
+
orphanedRowAction: "nullify",
|
|
369
|
+
},
|
|
370
|
+
)
|
|
371
|
+
@JoinColumn({ name: "deletedByUserId" })
|
|
372
|
+
public deletedByUser?: User = undefined;
|
|
373
|
+
|
|
374
|
+
@ColumnAccessControl({
|
|
375
|
+
create: [],
|
|
376
|
+
read: [
|
|
377
|
+
Permission.ProjectOwner,
|
|
378
|
+
Permission.ProjectAdmin,
|
|
379
|
+
Permission.ProjectMember,
|
|
380
|
+
Permission.ReadOnCallDutyPolicyOwnerTeam,
|
|
381
|
+
],
|
|
382
|
+
update: [],
|
|
383
|
+
})
|
|
384
|
+
@TableColumn({
|
|
385
|
+
type: TableColumnType.ObjectID,
|
|
386
|
+
title: "Deleted by User ID",
|
|
387
|
+
description:
|
|
388
|
+
"User ID who deleted this object (if this object was deleted by a User)",
|
|
389
|
+
})
|
|
390
|
+
@Column({
|
|
391
|
+
type: ColumnType.ObjectID,
|
|
392
|
+
nullable: true,
|
|
393
|
+
transformer: ObjectID.getDatabaseTransformer(),
|
|
394
|
+
})
|
|
395
|
+
public deletedByUserId?: ObjectID = undefined;
|
|
396
|
+
|
|
397
|
+
@ColumnAccessControl({
|
|
398
|
+
create: [
|
|
399
|
+
Permission.ProjectOwner,
|
|
400
|
+
Permission.ProjectAdmin,
|
|
401
|
+
Permission.ProjectMember,
|
|
402
|
+
Permission.CreateOnCallDutyPolicyOwnerTeam,
|
|
403
|
+
],
|
|
404
|
+
read: [
|
|
405
|
+
Permission.ProjectOwner,
|
|
406
|
+
Permission.ProjectAdmin,
|
|
407
|
+
Permission.ProjectMember,
|
|
408
|
+
Permission.ReadOnCallDutyPolicyOwnerTeam,
|
|
409
|
+
],
|
|
410
|
+
update: [],
|
|
411
|
+
})
|
|
412
|
+
@Index()
|
|
413
|
+
@TableColumn({
|
|
414
|
+
type: TableColumnType.Boolean,
|
|
415
|
+
required: true,
|
|
416
|
+
isDefaultValueColumn: true,
|
|
417
|
+
title: "Are Owners Notified",
|
|
418
|
+
description: "Are owners notified of this resource ownership?",
|
|
419
|
+
})
|
|
420
|
+
@Column({
|
|
421
|
+
type: ColumnType.Boolean,
|
|
422
|
+
nullable: false,
|
|
423
|
+
default: false,
|
|
424
|
+
})
|
|
425
|
+
public isOwnerNotified?: boolean = undefined;
|
|
426
|
+
}
|