@oneuptime/common 7.0.4868 → 7.0.4877
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 +4 -0
- package/Models/DatabaseModels/StatusPageSCIM.ts +469 -0
- package/Server/EnvironmentConfig.ts +9 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1754384418632-MigrationName.ts +63 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts +2 -0
- package/Server/Middleware/SCIMAuthorization.ts +57 -24
- package/Server/Services/StatusPageSCIMService.ts +27 -0
- package/build/dist/Models/DatabaseModels/Index.js +3 -0
- package/build/dist/Models/DatabaseModels/Index.js.map +1 -1
- package/build/dist/Models/DatabaseModels/StatusPageSCIM.js +492 -0
- package/build/dist/Models/DatabaseModels/StatusPageSCIM.js.map +1 -0
- package/build/dist/Server/EnvironmentConfig.js +3 -1
- package/build/dist/Server/EnvironmentConfig.js.map +1 -1
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1754384418632-MigrationName.js +28 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1754384418632-MigrationName.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js +2 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js.map +1 -1
- package/build/dist/Server/Middleware/SCIMAuthorization.js +48 -18
- package/build/dist/Server/Middleware/SCIMAuthorization.js.map +1 -1
- package/build/dist/Server/Services/StatusPageSCIMService.js +20 -0
- package/build/dist/Server/Services/StatusPageSCIMService.js.map +1 -0
- package/package.json +1 -1
|
@@ -114,6 +114,7 @@ import StatusPageOwnerTeam from "./StatusPageOwnerTeam";
|
|
|
114
114
|
import StatusPageOwnerUser from "./StatusPageOwnerUser";
|
|
115
115
|
import StatusPagePrivateUser from "./StatusPagePrivateUser";
|
|
116
116
|
import StatusPageResource from "./StatusPageResource";
|
|
117
|
+
import StatusPageSCIM from "./StatusPageSCIM";
|
|
117
118
|
import StatusPageSSO from "./StatusPageSso";
|
|
118
119
|
import StatusPageSubscriber from "./StatusPageSubscriber";
|
|
119
120
|
// Team
|
|
@@ -277,6 +278,7 @@ const AllModelTypes: Array<{
|
|
|
277
278
|
|
|
278
279
|
ProjectSSO,
|
|
279
280
|
StatusPageSSO,
|
|
281
|
+
StatusPageSCIM,
|
|
280
282
|
|
|
281
283
|
MonitorProbe,
|
|
282
284
|
|
|
@@ -383,6 +385,8 @@ const AllModelTypes: Array<{
|
|
|
383
385
|
OnCallDutyPolicyTimeLog,
|
|
384
386
|
|
|
385
387
|
ProjectSCIM,
|
|
388
|
+
|
|
389
|
+
StatusPageSCIM,
|
|
386
390
|
];
|
|
387
391
|
|
|
388
392
|
const modelTypeMap: { [key: string]: { new (): BaseModel } } = {};
|
|
@@ -0,0 +1,469 @@
|
|
|
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 { PlanType } from "../../Types/Billing/SubscriptionPlan";
|
|
7
|
+
import ColumnAccessControl from "../../Types/Database/AccessControl/ColumnAccessControl";
|
|
8
|
+
import TableAccessControl from "../../Types/Database/AccessControl/TableAccessControl";
|
|
9
|
+
import TableBillingAccessControl from "../../Types/Database/AccessControl/TableBillingAccessControl";
|
|
10
|
+
import CanAccessIfCanReadOn from "../../Types/Database/CanAccessIfCanReadOn";
|
|
11
|
+
import ColumnLength from "../../Types/Database/ColumnLength";
|
|
12
|
+
import ColumnType from "../../Types/Database/ColumnType";
|
|
13
|
+
import CrudApiEndpoint from "../../Types/Database/CrudApiEndpoint";
|
|
14
|
+
import EnableDocumentation from "../../Types/Database/EnableDocumentation";
|
|
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 UniqueColumnBy from "../../Types/Database/UniqueColumnBy";
|
|
20
|
+
import IconProp from "../../Types/Icon/IconProp";
|
|
21
|
+
import ObjectID from "../../Types/ObjectID";
|
|
22
|
+
import Permission from "../../Types/Permission";
|
|
23
|
+
import { Column, Entity, Index, JoinColumn, ManyToOne } from "typeorm";
|
|
24
|
+
|
|
25
|
+
@EnableDocumentation()
|
|
26
|
+
@TableBillingAccessControl({
|
|
27
|
+
create: PlanType.Scale,
|
|
28
|
+
read: PlanType.Scale,
|
|
29
|
+
update: PlanType.Scale,
|
|
30
|
+
delete: PlanType.Scale,
|
|
31
|
+
})
|
|
32
|
+
@CanAccessIfCanReadOn("statusPage")
|
|
33
|
+
@TenantColumn("projectId")
|
|
34
|
+
@TableAccessControl({
|
|
35
|
+
create: [
|
|
36
|
+
Permission.ProjectOwner,
|
|
37
|
+
Permission.ProjectAdmin,
|
|
38
|
+
Permission.CreateStatusPageSSO,
|
|
39
|
+
],
|
|
40
|
+
read: [
|
|
41
|
+
Permission.ProjectOwner,
|
|
42
|
+
Permission.ProjectAdmin,
|
|
43
|
+
Permission.ProjectMember,
|
|
44
|
+
Permission.ReadStatusPageSSO,
|
|
45
|
+
],
|
|
46
|
+
delete: [
|
|
47
|
+
Permission.ProjectOwner,
|
|
48
|
+
Permission.ProjectAdmin,
|
|
49
|
+
Permission.DeleteStatusPageSSO,
|
|
50
|
+
],
|
|
51
|
+
update: [
|
|
52
|
+
Permission.ProjectOwner,
|
|
53
|
+
Permission.ProjectAdmin,
|
|
54
|
+
Permission.EditStatusPageSSO,
|
|
55
|
+
],
|
|
56
|
+
})
|
|
57
|
+
@CrudApiEndpoint(new Route("/status-page-scim"))
|
|
58
|
+
@TableMetadata({
|
|
59
|
+
tableName: "StatusPageSCIM",
|
|
60
|
+
singularName: "Status Page SCIM",
|
|
61
|
+
pluralName: "Status Page SCIM",
|
|
62
|
+
icon: IconProp.Lock,
|
|
63
|
+
tableDescription: "Manage SCIM auto-provisioning for your status page",
|
|
64
|
+
})
|
|
65
|
+
@Entity({
|
|
66
|
+
name: "StatusPageSCIM",
|
|
67
|
+
})
|
|
68
|
+
export default class StatusPageSCIM extends BaseModel {
|
|
69
|
+
@ColumnAccessControl({
|
|
70
|
+
create: [
|
|
71
|
+
Permission.ProjectOwner,
|
|
72
|
+
Permission.ProjectAdmin,
|
|
73
|
+
Permission.CreateStatusPageSSO,
|
|
74
|
+
],
|
|
75
|
+
read: [
|
|
76
|
+
Permission.ProjectOwner,
|
|
77
|
+
Permission.ProjectAdmin,
|
|
78
|
+
Permission.ProjectMember,
|
|
79
|
+
Permission.ReadStatusPageSSO,
|
|
80
|
+
],
|
|
81
|
+
update: [],
|
|
82
|
+
})
|
|
83
|
+
@TableColumn({
|
|
84
|
+
manyToOneRelationColumn: "projectId",
|
|
85
|
+
type: TableColumnType.Entity,
|
|
86
|
+
modelType: Project,
|
|
87
|
+
title: "Project",
|
|
88
|
+
description: "Relation to Project Resource in which this object belongs",
|
|
89
|
+
})
|
|
90
|
+
@ManyToOne(
|
|
91
|
+
() => {
|
|
92
|
+
return Project;
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
eager: false,
|
|
96
|
+
nullable: true,
|
|
97
|
+
onDelete: "CASCADE",
|
|
98
|
+
orphanedRowAction: "nullify",
|
|
99
|
+
},
|
|
100
|
+
)
|
|
101
|
+
@JoinColumn({ name: "projectId" })
|
|
102
|
+
public project?: Project = undefined;
|
|
103
|
+
|
|
104
|
+
@ColumnAccessControl({
|
|
105
|
+
create: [
|
|
106
|
+
Permission.ProjectOwner,
|
|
107
|
+
Permission.ProjectAdmin,
|
|
108
|
+
Permission.CreateStatusPageSSO,
|
|
109
|
+
],
|
|
110
|
+
read: [
|
|
111
|
+
Permission.ProjectOwner,
|
|
112
|
+
Permission.ProjectAdmin,
|
|
113
|
+
Permission.ProjectMember,
|
|
114
|
+
Permission.ReadStatusPageSSO,
|
|
115
|
+
],
|
|
116
|
+
update: [],
|
|
117
|
+
})
|
|
118
|
+
@Index()
|
|
119
|
+
@TableColumn({
|
|
120
|
+
type: TableColumnType.ObjectID,
|
|
121
|
+
required: true,
|
|
122
|
+
canReadOnRelationQuery: true,
|
|
123
|
+
title: "Project ID",
|
|
124
|
+
description: "ID of your OneUptime Project in which this object belongs",
|
|
125
|
+
})
|
|
126
|
+
@Column({
|
|
127
|
+
type: ColumnType.ObjectID,
|
|
128
|
+
nullable: false,
|
|
129
|
+
transformer: ObjectID.getDatabaseTransformer(),
|
|
130
|
+
})
|
|
131
|
+
public projectId?: ObjectID = undefined;
|
|
132
|
+
|
|
133
|
+
@ColumnAccessControl({
|
|
134
|
+
create: [
|
|
135
|
+
Permission.ProjectOwner,
|
|
136
|
+
Permission.ProjectAdmin,
|
|
137
|
+
Permission.CreateStatusPageSSO,
|
|
138
|
+
],
|
|
139
|
+
read: [
|
|
140
|
+
Permission.ProjectOwner,
|
|
141
|
+
Permission.ProjectAdmin,
|
|
142
|
+
Permission.ProjectMember,
|
|
143
|
+
Permission.ReadStatusPageSSO,
|
|
144
|
+
],
|
|
145
|
+
update: [],
|
|
146
|
+
})
|
|
147
|
+
@TableColumn({
|
|
148
|
+
manyToOneRelationColumn: "statusPageId",
|
|
149
|
+
type: TableColumnType.Entity,
|
|
150
|
+
modelType: StatusPage,
|
|
151
|
+
title: "Status Page",
|
|
152
|
+
description:
|
|
153
|
+
"Relation to Status Page Resource in which this object belongs",
|
|
154
|
+
})
|
|
155
|
+
@ManyToOne(
|
|
156
|
+
() => {
|
|
157
|
+
return StatusPage;
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
eager: false,
|
|
161
|
+
nullable: true,
|
|
162
|
+
onDelete: "CASCADE",
|
|
163
|
+
orphanedRowAction: "nullify",
|
|
164
|
+
},
|
|
165
|
+
)
|
|
166
|
+
@JoinColumn({ name: "statusPageId" })
|
|
167
|
+
public statusPage?: StatusPage = undefined;
|
|
168
|
+
|
|
169
|
+
@ColumnAccessControl({
|
|
170
|
+
create: [
|
|
171
|
+
Permission.ProjectOwner,
|
|
172
|
+
Permission.ProjectAdmin,
|
|
173
|
+
Permission.CreateStatusPageSSO,
|
|
174
|
+
],
|
|
175
|
+
read: [
|
|
176
|
+
Permission.ProjectOwner,
|
|
177
|
+
Permission.ProjectAdmin,
|
|
178
|
+
Permission.ProjectMember,
|
|
179
|
+
Permission.ReadStatusPageSSO,
|
|
180
|
+
],
|
|
181
|
+
update: [],
|
|
182
|
+
})
|
|
183
|
+
@Index()
|
|
184
|
+
@TableColumn({
|
|
185
|
+
type: TableColumnType.ObjectID,
|
|
186
|
+
required: true,
|
|
187
|
+
title: "Status Page ID",
|
|
188
|
+
description: "ID of your Status Page resource where this object belongs",
|
|
189
|
+
})
|
|
190
|
+
@Column({
|
|
191
|
+
type: ColumnType.ObjectID,
|
|
192
|
+
nullable: false,
|
|
193
|
+
transformer: ObjectID.getDatabaseTransformer(),
|
|
194
|
+
})
|
|
195
|
+
public statusPageId?: ObjectID = undefined;
|
|
196
|
+
|
|
197
|
+
@ColumnAccessControl({
|
|
198
|
+
create: [
|
|
199
|
+
Permission.ProjectOwner,
|
|
200
|
+
Permission.ProjectAdmin,
|
|
201
|
+
Permission.CreateStatusPageSSO,
|
|
202
|
+
],
|
|
203
|
+
read: [
|
|
204
|
+
Permission.ProjectOwner,
|
|
205
|
+
Permission.ProjectAdmin,
|
|
206
|
+
Permission.ProjectMember,
|
|
207
|
+
Permission.ReadStatusPageSSO,
|
|
208
|
+
],
|
|
209
|
+
update: [
|
|
210
|
+
Permission.ProjectOwner,
|
|
211
|
+
Permission.ProjectAdmin,
|
|
212
|
+
Permission.EditStatusPageSSO,
|
|
213
|
+
],
|
|
214
|
+
})
|
|
215
|
+
@TableColumn({
|
|
216
|
+
required: true,
|
|
217
|
+
type: TableColumnType.ShortText,
|
|
218
|
+
canReadOnRelationQuery: true,
|
|
219
|
+
title: "Name",
|
|
220
|
+
description: "Any friendly name for this SCIM configuration",
|
|
221
|
+
})
|
|
222
|
+
@Column({
|
|
223
|
+
nullable: false,
|
|
224
|
+
type: ColumnType.ShortText,
|
|
225
|
+
length: ColumnLength.ShortText,
|
|
226
|
+
})
|
|
227
|
+
@UniqueColumnBy("statusPageId")
|
|
228
|
+
public name?: string = undefined;
|
|
229
|
+
|
|
230
|
+
@ColumnAccessControl({
|
|
231
|
+
create: [
|
|
232
|
+
Permission.ProjectOwner,
|
|
233
|
+
Permission.ProjectAdmin,
|
|
234
|
+
Permission.CreateStatusPageSSO,
|
|
235
|
+
],
|
|
236
|
+
read: [
|
|
237
|
+
Permission.ProjectOwner,
|
|
238
|
+
Permission.ProjectAdmin,
|
|
239
|
+
Permission.ProjectMember,
|
|
240
|
+
Permission.ReadStatusPageSSO,
|
|
241
|
+
],
|
|
242
|
+
update: [
|
|
243
|
+
Permission.ProjectOwner,
|
|
244
|
+
Permission.ProjectAdmin,
|
|
245
|
+
Permission.EditStatusPageSSO,
|
|
246
|
+
],
|
|
247
|
+
})
|
|
248
|
+
@TableColumn({
|
|
249
|
+
required: false,
|
|
250
|
+
type: TableColumnType.LongText,
|
|
251
|
+
title: "Description",
|
|
252
|
+
description: "Friendly description to help you remember",
|
|
253
|
+
})
|
|
254
|
+
@Column({
|
|
255
|
+
nullable: true,
|
|
256
|
+
type: ColumnType.LongText,
|
|
257
|
+
length: ColumnLength.LongText,
|
|
258
|
+
})
|
|
259
|
+
public description?: string = undefined;
|
|
260
|
+
|
|
261
|
+
@ColumnAccessControl({
|
|
262
|
+
create: [
|
|
263
|
+
Permission.ProjectOwner,
|
|
264
|
+
Permission.ProjectAdmin,
|
|
265
|
+
Permission.CreateStatusPageSSO,
|
|
266
|
+
],
|
|
267
|
+
read: [
|
|
268
|
+
Permission.ProjectOwner,
|
|
269
|
+
Permission.ProjectAdmin,
|
|
270
|
+
Permission.ReadStatusPageSSO,
|
|
271
|
+
],
|
|
272
|
+
update: [
|
|
273
|
+
Permission.ProjectOwner,
|
|
274
|
+
Permission.ProjectAdmin,
|
|
275
|
+
Permission.EditStatusPageSSO,
|
|
276
|
+
],
|
|
277
|
+
})
|
|
278
|
+
@TableColumn({
|
|
279
|
+
required: true,
|
|
280
|
+
type: TableColumnType.LongText,
|
|
281
|
+
title: "Bearer Token",
|
|
282
|
+
description: "Bearer token for SCIM authentication. Keep this secure.",
|
|
283
|
+
})
|
|
284
|
+
@Column({
|
|
285
|
+
nullable: false,
|
|
286
|
+
type: ColumnType.LongText,
|
|
287
|
+
length: ColumnLength.LongText,
|
|
288
|
+
})
|
|
289
|
+
public bearerToken?: string = undefined;
|
|
290
|
+
|
|
291
|
+
@ColumnAccessControl({
|
|
292
|
+
create: [
|
|
293
|
+
Permission.ProjectOwner,
|
|
294
|
+
Permission.ProjectAdmin,
|
|
295
|
+
Permission.CreateStatusPageSSO,
|
|
296
|
+
],
|
|
297
|
+
read: [
|
|
298
|
+
Permission.ProjectOwner,
|
|
299
|
+
Permission.ProjectAdmin,
|
|
300
|
+
Permission.ProjectMember,
|
|
301
|
+
Permission.ReadStatusPageSSO,
|
|
302
|
+
],
|
|
303
|
+
update: [
|
|
304
|
+
Permission.ProjectOwner,
|
|
305
|
+
Permission.ProjectAdmin,
|
|
306
|
+
Permission.EditStatusPageSSO,
|
|
307
|
+
],
|
|
308
|
+
})
|
|
309
|
+
@TableColumn({
|
|
310
|
+
isDefaultValueColumn: true,
|
|
311
|
+
type: TableColumnType.Boolean,
|
|
312
|
+
title: "Auto Provision Users",
|
|
313
|
+
description:
|
|
314
|
+
"Automatically create status page users when they are added via SCIM",
|
|
315
|
+
defaultValue: true,
|
|
316
|
+
})
|
|
317
|
+
@Column({
|
|
318
|
+
type: ColumnType.Boolean,
|
|
319
|
+
default: true,
|
|
320
|
+
})
|
|
321
|
+
public autoProvisionUsers?: boolean = undefined;
|
|
322
|
+
|
|
323
|
+
@ColumnAccessControl({
|
|
324
|
+
create: [
|
|
325
|
+
Permission.ProjectOwner,
|
|
326
|
+
Permission.ProjectAdmin,
|
|
327
|
+
Permission.CreateStatusPageSSO,
|
|
328
|
+
],
|
|
329
|
+
read: [
|
|
330
|
+
Permission.ProjectOwner,
|
|
331
|
+
Permission.ProjectAdmin,
|
|
332
|
+
Permission.ProjectMember,
|
|
333
|
+
Permission.ReadStatusPageSSO,
|
|
334
|
+
],
|
|
335
|
+
update: [
|
|
336
|
+
Permission.ProjectOwner,
|
|
337
|
+
Permission.ProjectAdmin,
|
|
338
|
+
Permission.EditStatusPageSSO,
|
|
339
|
+
],
|
|
340
|
+
})
|
|
341
|
+
@TableColumn({
|
|
342
|
+
isDefaultValueColumn: true,
|
|
343
|
+
type: TableColumnType.Boolean,
|
|
344
|
+
title: "Auto Deprovision Users",
|
|
345
|
+
description:
|
|
346
|
+
"Automatically remove status page users when they are removed via SCIM",
|
|
347
|
+
defaultValue: true,
|
|
348
|
+
})
|
|
349
|
+
@Column({
|
|
350
|
+
type: ColumnType.Boolean,
|
|
351
|
+
default: true,
|
|
352
|
+
})
|
|
353
|
+
public autoDeprovisionUsers?: boolean = undefined;
|
|
354
|
+
|
|
355
|
+
@ColumnAccessControl({
|
|
356
|
+
create: [],
|
|
357
|
+
read: [
|
|
358
|
+
Permission.ProjectOwner,
|
|
359
|
+
Permission.ProjectAdmin,
|
|
360
|
+
Permission.ProjectMember,
|
|
361
|
+
Permission.ReadStatusPageSSO,
|
|
362
|
+
],
|
|
363
|
+
update: [],
|
|
364
|
+
})
|
|
365
|
+
@TableColumn({
|
|
366
|
+
manyToOneRelationColumn: "createdByUserId",
|
|
367
|
+
type: TableColumnType.Entity,
|
|
368
|
+
modelType: User,
|
|
369
|
+
title: "Created by User",
|
|
370
|
+
description:
|
|
371
|
+
"Relation to User who created this object (if this object was created by a User)",
|
|
372
|
+
})
|
|
373
|
+
@ManyToOne(
|
|
374
|
+
() => {
|
|
375
|
+
return User;
|
|
376
|
+
},
|
|
377
|
+
{
|
|
378
|
+
eager: false,
|
|
379
|
+
nullable: true,
|
|
380
|
+
onDelete: "SET NULL",
|
|
381
|
+
orphanedRowAction: "nullify",
|
|
382
|
+
},
|
|
383
|
+
)
|
|
384
|
+
@JoinColumn({ name: "createdByUserId" })
|
|
385
|
+
public createdByUser?: User = undefined;
|
|
386
|
+
|
|
387
|
+
@ColumnAccessControl({
|
|
388
|
+
create: [
|
|
389
|
+
Permission.ProjectOwner,
|
|
390
|
+
Permission.ProjectAdmin,
|
|
391
|
+
Permission.CreateStatusPageSSO,
|
|
392
|
+
],
|
|
393
|
+
read: [
|
|
394
|
+
Permission.ProjectOwner,
|
|
395
|
+
Permission.ProjectAdmin,
|
|
396
|
+
Permission.ProjectMember,
|
|
397
|
+
Permission.ReadStatusPageSSO,
|
|
398
|
+
],
|
|
399
|
+
update: [],
|
|
400
|
+
})
|
|
401
|
+
@TableColumn({
|
|
402
|
+
type: TableColumnType.ObjectID,
|
|
403
|
+
title: "Created by User ID",
|
|
404
|
+
description:
|
|
405
|
+
"User ID who created this object (if this object was created by a User)",
|
|
406
|
+
})
|
|
407
|
+
@Column({
|
|
408
|
+
type: ColumnType.ObjectID,
|
|
409
|
+
nullable: true,
|
|
410
|
+
transformer: ObjectID.getDatabaseTransformer(),
|
|
411
|
+
})
|
|
412
|
+
public createdByUserId?: ObjectID = undefined;
|
|
413
|
+
|
|
414
|
+
@ColumnAccessControl({
|
|
415
|
+
create: [],
|
|
416
|
+
read: [
|
|
417
|
+
Permission.ProjectOwner,
|
|
418
|
+
Permission.ProjectAdmin,
|
|
419
|
+
Permission.ProjectMember,
|
|
420
|
+
Permission.ReadStatusPageSSO,
|
|
421
|
+
],
|
|
422
|
+
update: [],
|
|
423
|
+
})
|
|
424
|
+
@TableColumn({
|
|
425
|
+
manyToOneRelationColumn: "deletedByUserId",
|
|
426
|
+
type: TableColumnType.Entity,
|
|
427
|
+
modelType: User,
|
|
428
|
+
title: "Deleted by User",
|
|
429
|
+
description:
|
|
430
|
+
"Relation to User who deleted this object (if this object was deleted by a User)",
|
|
431
|
+
})
|
|
432
|
+
@ManyToOne(
|
|
433
|
+
() => {
|
|
434
|
+
return User;
|
|
435
|
+
},
|
|
436
|
+
{
|
|
437
|
+
cascade: false,
|
|
438
|
+
eager: false,
|
|
439
|
+
nullable: true,
|
|
440
|
+
onDelete: "SET NULL",
|
|
441
|
+
orphanedRowAction: "nullify",
|
|
442
|
+
},
|
|
443
|
+
)
|
|
444
|
+
@JoinColumn({ name: "deletedByUserId" })
|
|
445
|
+
public deletedByUser?: User = undefined;
|
|
446
|
+
|
|
447
|
+
@ColumnAccessControl({
|
|
448
|
+
create: [],
|
|
449
|
+
read: [
|
|
450
|
+
Permission.ProjectOwner,
|
|
451
|
+
Permission.ProjectAdmin,
|
|
452
|
+
Permission.ProjectMember,
|
|
453
|
+
Permission.ReadStatusPageSSO,
|
|
454
|
+
],
|
|
455
|
+
update: [],
|
|
456
|
+
})
|
|
457
|
+
@TableColumn({
|
|
458
|
+
type: TableColumnType.ObjectID,
|
|
459
|
+
title: "Deleted by User ID",
|
|
460
|
+
description:
|
|
461
|
+
"User ID who deleted this object (if this object was deleted by a User)",
|
|
462
|
+
})
|
|
463
|
+
@Column({
|
|
464
|
+
type: ColumnType.ObjectID,
|
|
465
|
+
nullable: true,
|
|
466
|
+
transformer: ObjectID.getDatabaseTransformer(),
|
|
467
|
+
})
|
|
468
|
+
public deletedByUserId?: ObjectID = undefined;
|
|
469
|
+
}
|
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
DashboardRoute,
|
|
5
5
|
AppApiRoute,
|
|
6
6
|
StatusPageApiRoute,
|
|
7
|
+
DocsRoute,
|
|
7
8
|
} from "../ServiceRoute";
|
|
8
9
|
import BillingConfig from "./BillingConfig";
|
|
9
10
|
import Protocol from "../Types/API/Protocol";
|
|
@@ -150,6 +151,12 @@ export const AdminDashboardHostname: Hostname = Hostname.fromString(
|
|
|
150
151
|
}`,
|
|
151
152
|
);
|
|
152
153
|
|
|
154
|
+
export const DocsHostname: Hostname = Hostname.fromString(
|
|
155
|
+
`${process.env["SERVER_DOCS_HOSTNAME"] || "localhost"}:${
|
|
156
|
+
process.env["DOCS_PORT"] || 80
|
|
157
|
+
}`,
|
|
158
|
+
);
|
|
159
|
+
|
|
153
160
|
export const Env: string = process.env["NODE_ENV"] || "production";
|
|
154
161
|
|
|
155
162
|
// Redis does not require password.
|
|
@@ -318,6 +325,8 @@ export const AccountsClientUrl: URL = new URL(
|
|
|
318
325
|
AccountsRoute,
|
|
319
326
|
);
|
|
320
327
|
|
|
328
|
+
export const DocsClientUrl: URL = new URL(HttpProtocol, Host, DocsRoute);
|
|
329
|
+
|
|
321
330
|
export const DisableTelemetry: boolean =
|
|
322
331
|
process.env["DISABLE_TELEMETRY"] === "true";
|
|
323
332
|
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { MigrationInterface, QueryRunner } from "typeorm";
|
|
2
|
+
|
|
3
|
+
export class MigrationName1754384418632 implements MigrationInterface {
|
|
4
|
+
public name = "MigrationName1754384418632";
|
|
5
|
+
|
|
6
|
+
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
7
|
+
await queryRunner.query(
|
|
8
|
+
`CREATE TABLE "StatusPageSCIM" ("_id" uuid NOT NULL DEFAULT uuid_generate_v4(), "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "updatedAt" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "deletedAt" TIMESTAMP WITH TIME ZONE, "version" integer NOT NULL, "projectId" uuid NOT NULL, "statusPageId" uuid NOT NULL, "name" character varying(100) NOT NULL, "description" character varying(500), "bearerToken" character varying(500) NOT NULL, "autoProvisionUsers" boolean NOT NULL DEFAULT true, "autoDeprovisionUsers" boolean NOT NULL DEFAULT true, "createdByUserId" uuid, "deletedByUserId" uuid, CONSTRAINT "PK_9d65d486be515b9608347cf66d4" PRIMARY KEY ("_id"))`,
|
|
9
|
+
);
|
|
10
|
+
await queryRunner.query(
|
|
11
|
+
`CREATE INDEX "IDX_0a241118fe6b4a8665deef444b" ON "StatusPageSCIM" ("projectId") `,
|
|
12
|
+
);
|
|
13
|
+
await queryRunner.query(
|
|
14
|
+
`CREATE INDEX "IDX_7200e368657773fde2836c57eb" ON "StatusPageSCIM" ("statusPageId") `,
|
|
15
|
+
);
|
|
16
|
+
await queryRunner.query(
|
|
17
|
+
`ALTER TABLE "OnCallDutyPolicyScheduleLayer" ALTER COLUMN "rotation" SET DEFAULT '{"_type":"Recurring","value":{"intervalType":"Day","intervalCount":{"_type":"PositiveNumber","value":1}}}'`,
|
|
18
|
+
);
|
|
19
|
+
await queryRunner.query(
|
|
20
|
+
`ALTER TABLE "OnCallDutyPolicyScheduleLayer" ALTER COLUMN "restrictionTimes" SET DEFAULT '{"_type":"RestrictionTimes","value":{"restictionType":"None","dayRestrictionTimes":null,"weeklyRestrictionTimes":[]}}'`,
|
|
21
|
+
);
|
|
22
|
+
await queryRunner.query(
|
|
23
|
+
`ALTER TABLE "StatusPageSCIM" ADD CONSTRAINT "FK_0a241118fe6b4a8665deef444b2" FOREIGN KEY ("projectId") REFERENCES "Project"("_id") ON DELETE CASCADE ON UPDATE NO ACTION`,
|
|
24
|
+
);
|
|
25
|
+
await queryRunner.query(
|
|
26
|
+
`ALTER TABLE "StatusPageSCIM" ADD CONSTRAINT "FK_7200e368657773fde2836c57ebe" FOREIGN KEY ("statusPageId") REFERENCES "StatusPage"("_id") ON DELETE CASCADE ON UPDATE NO ACTION`,
|
|
27
|
+
);
|
|
28
|
+
await queryRunner.query(
|
|
29
|
+
`ALTER TABLE "StatusPageSCIM" ADD CONSTRAINT "FK_adb05dd1cbe0e734a76b3dbdcf1" FOREIGN KEY ("createdByUserId") REFERENCES "User"("_id") ON DELETE SET NULL ON UPDATE NO ACTION`,
|
|
30
|
+
);
|
|
31
|
+
await queryRunner.query(
|
|
32
|
+
`ALTER TABLE "StatusPageSCIM" ADD CONSTRAINT "FK_2fded7c784a5c2f56ad2553cb80" FOREIGN KEY ("deletedByUserId") REFERENCES "User"("_id") ON DELETE SET NULL ON UPDATE NO ACTION`,
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
37
|
+
await queryRunner.query(
|
|
38
|
+
`ALTER TABLE "StatusPageSCIM" DROP CONSTRAINT "FK_2fded7c784a5c2f56ad2553cb80"`,
|
|
39
|
+
);
|
|
40
|
+
await queryRunner.query(
|
|
41
|
+
`ALTER TABLE "StatusPageSCIM" DROP CONSTRAINT "FK_adb05dd1cbe0e734a76b3dbdcf1"`,
|
|
42
|
+
);
|
|
43
|
+
await queryRunner.query(
|
|
44
|
+
`ALTER TABLE "StatusPageSCIM" DROP CONSTRAINT "FK_7200e368657773fde2836c57ebe"`,
|
|
45
|
+
);
|
|
46
|
+
await queryRunner.query(
|
|
47
|
+
`ALTER TABLE "StatusPageSCIM" DROP CONSTRAINT "FK_0a241118fe6b4a8665deef444b2"`,
|
|
48
|
+
);
|
|
49
|
+
await queryRunner.query(
|
|
50
|
+
`ALTER TABLE "OnCallDutyPolicyScheduleLayer" ALTER COLUMN "restrictionTimes" SET DEFAULT '{"_type": "RestrictionTimes", "value": {"restictionType": "None", "dayRestrictionTimes": null, "weeklyRestrictionTimes": []}}'`,
|
|
51
|
+
);
|
|
52
|
+
await queryRunner.query(
|
|
53
|
+
`ALTER TABLE "OnCallDutyPolicyScheduleLayer" ALTER COLUMN "rotation" SET DEFAULT '{"_type": "Recurring", "value": {"intervalType": "Day", "intervalCount": {"_type": "PositiveNumber", "value": 1}}}'`,
|
|
54
|
+
);
|
|
55
|
+
await queryRunner.query(
|
|
56
|
+
`DROP INDEX "public"."IDX_7200e368657773fde2836c57eb"`,
|
|
57
|
+
);
|
|
58
|
+
await queryRunner.query(
|
|
59
|
+
`DROP INDEX "public"."IDX_0a241118fe6b4a8665deef444b"`,
|
|
60
|
+
);
|
|
61
|
+
await queryRunner.query(`DROP TABLE "StatusPageSCIM"`);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
@@ -148,6 +148,7 @@ import { AddPerformanceIndexes1753378524062 } from "./1753378524062-AddPerforman
|
|
|
148
148
|
import { MigrationName1753383711511 } from "./1753383711511-MigrationName";
|
|
149
149
|
import { MigrationName1754304193228 } from "./1754304193228-MigrationName";
|
|
150
150
|
import { MigrationName1754315774827 } from "./1754315774827-MigrationName";
|
|
151
|
+
import { MigrationName1754384418632 } from "./1754384418632-MigrationName";
|
|
151
152
|
|
|
152
153
|
export default [
|
|
153
154
|
InitialMigration,
|
|
@@ -300,4 +301,5 @@ export default [
|
|
|
300
301
|
MigrationName1753383711511,
|
|
301
302
|
MigrationName1754304193228,
|
|
302
303
|
MigrationName1754315774827,
|
|
304
|
+
MigrationName1754384418632,
|
|
303
305
|
];
|