@oneuptime/common 7.0.4428 → 7.0.4518
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/Alert.ts +1 -1
- package/Models/DatabaseModels/AlertCustomField.ts +1 -1
- package/Models/DatabaseModels/BillingPaymentMethod.ts +1 -1
- package/Models/DatabaseModels/DatabaseBaseModel/FileModel.ts +1 -1
- package/Models/DatabaseModels/IncidentCustomField.ts +1 -1
- package/Models/DatabaseModels/Index.ts +2 -0
- package/Models/DatabaseModels/MonitorCustomField.ts +1 -1
- package/Models/DatabaseModels/OnCallDutyPolicyCustomField.ts +1 -1
- package/Models/DatabaseModels/ScheduledMaintenanceCustomField.ts +1 -1
- package/Models/DatabaseModels/ScheduledMaintenanceTemplate.ts +1 -1
- package/Models/DatabaseModels/StatusPageAnnouncement.ts +1 -1
- package/Models/DatabaseModels/StatusPageAnnouncementTemplate.ts +473 -0
- package/Models/DatabaseModels/StatusPageCustomField.ts +1 -1
- package/Server/API/FileAPI.ts +2 -2
- package/Server/API/StatusPageAPI.ts +4 -4
- package/Server/Infrastructure/Postgres/SchemaMigrations/1749813704371-MigrationName.ts +67 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1750250435756-MigrationName.ts +59 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts +4 -0
- package/Server/Middleware/ProjectAuthorization.ts +2 -4
- package/Server/Services/BillingPaymentMethodService.ts +1 -1
- package/Server/Services/Index.ts +2 -0
- package/Server/Services/StatusPageAnnouncementTemplateService.ts +10 -0
- package/Server/Utils/OpenAPI.ts +12 -10
- package/Server/Utils/Response.ts +1 -1
- package/Server/Utils/Workspace/Slack/Slack.ts +62 -10
- package/Tests/Server/Middleware/ProjectAuthorization.test.ts +3 -1
- package/Tests/UI/Components/FilePicker.test.tsx +2 -2
- package/Tests/UI/Components/Input.test.tsx +22 -0
- package/Tests/UI/Components/MarkdownEditor.test.tsx +61 -0
- package/Tests/UI/Components/TextArea.test.tsx +22 -0
- package/Types/Permission.ts +80 -8
- package/UI/Components/Checkbox/Checkbox.tsx +1 -1
- package/UI/Components/CodeEditor/CodeEditor.tsx +36 -2
- package/UI/Components/CustomFields/CustomFieldsDetail.tsx +3 -3
- package/UI/Components/Detail/Detail.tsx +3 -2
- package/UI/Components/Detail/Field.ts +1 -1
- package/UI/Components/Detail/FieldLabel.tsx +1 -1
- package/UI/Components/FilePicker/FilePicker.tsx +2 -2
- package/UI/Components/Forms/Fields/FormField.tsx +4 -1
- package/UI/Components/Forms/ModelForm.tsx +1 -1
- package/UI/Components/Forms/Types/Field.ts +4 -1
- package/UI/Components/Image/Image.tsx +2 -2
- package/UI/Components/Input/Input.tsx +2 -0
- package/UI/Components/Markdown.tsx/MarkdownEditor.tsx +2 -0
- package/UI/Components/ModelDetail/ModelDetail.tsx +1 -1
- package/UI/Components/ModelTable/BaseModelTable.tsx +1 -1
- package/UI/Components/TextArea/TextArea.tsx +2 -0
- package/UI/Utils/Markdown.tsx +22 -0
- package/Utils/Schema/AnalyticsModelSchema.ts +0 -5
- package/Utils/Schema/ModelSchema.ts +0 -26
- package/build/dist/Models/DatabaseModels/Alert.js +1 -1
- package/build/dist/Models/DatabaseModels/Alert.js.map +1 -1
- package/build/dist/Models/DatabaseModels/AlertCustomField.js +2 -2
- package/build/dist/Models/DatabaseModels/AlertCustomField.js.map +1 -1
- package/build/dist/Models/DatabaseModels/BillingPaymentMethod.js +2 -2
- package/build/dist/Models/DatabaseModels/BillingPaymentMethod.js.map +1 -1
- package/build/dist/Models/DatabaseModels/DatabaseBaseModel/FileModel.js +2 -2
- package/build/dist/Models/DatabaseModels/DatabaseBaseModel/FileModel.js.map +1 -1
- package/build/dist/Models/DatabaseModels/IncidentCustomField.js +2 -2
- package/build/dist/Models/DatabaseModels/IncidentCustomField.js.map +1 -1
- package/build/dist/Models/DatabaseModels/Index.js +2 -0
- package/build/dist/Models/DatabaseModels/Index.js.map +1 -1
- package/build/dist/Models/DatabaseModels/MonitorCustomField.js +2 -2
- package/build/dist/Models/DatabaseModels/MonitorCustomField.js.map +1 -1
- package/build/dist/Models/DatabaseModels/OnCallDutyPolicyCustomField.js +2 -2
- package/build/dist/Models/DatabaseModels/OnCallDutyPolicyCustomField.js.map +1 -1
- package/build/dist/Models/DatabaseModels/ScheduledMaintenanceCustomField.js +2 -2
- package/build/dist/Models/DatabaseModels/ScheduledMaintenanceCustomField.js.map +1 -1
- package/build/dist/Models/DatabaseModels/ScheduledMaintenanceTemplate.js +1 -1
- package/build/dist/Models/DatabaseModels/ScheduledMaintenanceTemplate.js.map +1 -1
- package/build/dist/Models/DatabaseModels/StatusPageAnnouncement.js +1 -1
- package/build/dist/Models/DatabaseModels/StatusPageAnnouncement.js.map +1 -1
- package/build/dist/Models/DatabaseModels/StatusPageAnnouncementTemplate.js +488 -0
- package/build/dist/Models/DatabaseModels/StatusPageAnnouncementTemplate.js.map +1 -0
- package/build/dist/Models/DatabaseModels/StatusPageCustomField.js +2 -2
- package/build/dist/Models/DatabaseModels/StatusPageCustomField.js.map +1 -1
- package/build/dist/Server/API/FileAPI.js +2 -2
- package/build/dist/Server/API/FileAPI.js.map +1 -1
- package/build/dist/Server/API/StatusPageAPI.js +4 -4
- package/build/dist/Server/API/StatusPageAPI.js.map +1 -1
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1749813704371-MigrationName.js +30 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1749813704371-MigrationName.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1750250435756-MigrationName.js +26 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1750250435756-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/Middleware/ProjectAuthorization.js +2 -2
- package/build/dist/Server/Middleware/ProjectAuthorization.js.map +1 -1
- package/build/dist/Server/Services/BillingPaymentMethodService.js +1 -1
- package/build/dist/Server/Services/BillingPaymentMethodService.js.map +1 -1
- package/build/dist/Server/Services/Index.js +2 -0
- package/build/dist/Server/Services/Index.js.map +1 -1
- package/build/dist/Server/Services/StatusPageAnnouncementTemplateService.js +9 -0
- package/build/dist/Server/Services/StatusPageAnnouncementTemplateService.js.map +1 -0
- package/build/dist/Server/Utils/OpenAPI.js +12 -10
- package/build/dist/Server/Utils/OpenAPI.js.map +1 -1
- package/build/dist/Server/Utils/Response.js +1 -1
- package/build/dist/Server/Utils/Response.js.map +1 -1
- package/build/dist/Server/Utils/Workspace/Slack/Slack.js +36 -0
- package/build/dist/Server/Utils/Workspace/Slack/Slack.js.map +1 -1
- package/build/dist/Tests/Server/Middleware/ProjectAuthorization.test.js +1 -1
- package/build/dist/Tests/Server/Middleware/ProjectAuthorization.test.js.map +1 -1
- package/build/dist/Tests/UI/Components/FilePicker.test.js +1 -1
- package/build/dist/Tests/UI/Components/FilePicker.test.js.map +1 -1
- package/build/dist/Tests/UI/Components/Input.test.js +16 -0
- package/build/dist/Tests/UI/Components/Input.test.js.map +1 -1
- package/build/dist/Tests/UI/Components/MarkdownEditor.test.js +25 -0
- package/build/dist/Tests/UI/Components/MarkdownEditor.test.js.map +1 -0
- package/build/dist/Tests/UI/Components/TextArea.test.js +16 -1
- package/build/dist/Tests/UI/Components/TextArea.test.js.map +1 -1
- package/build/dist/Types/Permission.js +69 -8
- package/build/dist/Types/Permission.js.map +1 -1
- package/build/dist/UI/Components/CodeEditor/CodeEditor.js +29 -2
- package/build/dist/UI/Components/CodeEditor/CodeEditor.js.map +1 -1
- package/build/dist/UI/Components/CustomFields/CustomFieldsDetail.js +3 -3
- package/build/dist/UI/Components/CustomFields/CustomFieldsDetail.js.map +1 -1
- package/build/dist/UI/Components/Detail/Detail.js +3 -2
- package/build/dist/UI/Components/Detail/Detail.js.map +1 -1
- package/build/dist/UI/Components/FilePicker/FilePicker.js +2 -2
- package/build/dist/UI/Components/FilePicker/FilePicker.js.map +1 -1
- package/build/dist/UI/Components/Forms/Fields/FormField.js +2 -2
- package/build/dist/UI/Components/Forms/Fields/FormField.js.map +1 -1
- package/build/dist/UI/Components/Forms/ModelForm.js +1 -1
- package/build/dist/UI/Components/Forms/ModelForm.js.map +1 -1
- package/build/dist/UI/Components/Image/Image.js +2 -2
- package/build/dist/UI/Components/Image/Image.js.map +1 -1
- package/build/dist/UI/Components/Input/Input.js +1 -1
- package/build/dist/UI/Components/Input/Input.js.map +1 -1
- package/build/dist/UI/Components/Markdown.tsx/MarkdownEditor.js +1 -1
- package/build/dist/UI/Components/Markdown.tsx/MarkdownEditor.js.map +1 -1
- package/build/dist/UI/Components/ModelDetail/ModelDetail.js +1 -1
- package/build/dist/UI/Components/ModelDetail/ModelDetail.js.map +1 -1
- package/build/dist/UI/Components/ModelTable/BaseModelTable.js +1 -1
- package/build/dist/UI/Components/ModelTable/BaseModelTable.js.map +1 -1
- package/build/dist/UI/Components/TextArea/TextArea.js +1 -1
- package/build/dist/UI/Components/TextArea/TextArea.js.map +1 -1
- package/build/dist/UI/Utils/Markdown.js +15 -0
- package/build/dist/UI/Utils/Markdown.js.map +1 -0
- package/build/dist/Utils/Schema/AnalyticsModelSchema.js +0 -2
- package/build/dist/Utils/Schema/AnalyticsModelSchema.js.map +1 -1
- package/build/dist/Utils/Schema/ModelSchema.js +2 -10
- package/build/dist/Utils/Schema/ModelSchema.js.map +1 -1
- package/package.json +1 -1
|
@@ -217,7 +217,7 @@ export default class Alert extends BaseModel {
|
|
|
217
217
|
type: TableColumnType.Markdown,
|
|
218
218
|
title: "Description",
|
|
219
219
|
description:
|
|
220
|
-
"Short description of this alert. This
|
|
220
|
+
"Short description of this alert. This will be visible on the status page. This is in markdown.",
|
|
221
221
|
})
|
|
222
222
|
@Column({
|
|
223
223
|
nullable: true,
|
|
@@ -218,7 +218,7 @@ export default class AlertCustomField extends BaseModel {
|
|
|
218
218
|
type: ColumnType.ShortText,
|
|
219
219
|
length: ColumnLength.ShortText,
|
|
220
220
|
})
|
|
221
|
-
public
|
|
221
|
+
public customFieldType?: CustomFieldType = undefined;
|
|
222
222
|
|
|
223
223
|
@ColumnAccessControl({
|
|
224
224
|
create: [
|
|
@@ -70,7 +70,7 @@ export default class FileModel extends BaseModel {
|
|
|
70
70
|
type: ColumnType.ShortText,
|
|
71
71
|
length: ColumnLength.ShortText,
|
|
72
72
|
})
|
|
73
|
-
public
|
|
73
|
+
public fileType?: MimeType = undefined;
|
|
74
74
|
|
|
75
75
|
@ColumnAccessControl({
|
|
76
76
|
create: [Permission.CurrentUser],
|
|
@@ -218,7 +218,7 @@ export default class IncidentCustomField extends BaseModel {
|
|
|
218
218
|
type: ColumnType.ShortText,
|
|
219
219
|
length: ColumnLength.ShortText,
|
|
220
220
|
})
|
|
221
|
-
public
|
|
221
|
+
public customFieldType?: CustomFieldType = undefined;
|
|
222
222
|
|
|
223
223
|
@ColumnAccessControl({
|
|
224
224
|
create: [
|
|
@@ -103,6 +103,7 @@ import SmsLog from "./SmsLog";
|
|
|
103
103
|
// Status Page
|
|
104
104
|
import StatusPage from "./StatusPage";
|
|
105
105
|
import StatusPageAnnouncement from "./StatusPageAnnouncement";
|
|
106
|
+
import StatusPageAnnouncementTemplate from "./StatusPageAnnouncementTemplate";
|
|
106
107
|
import StatusPageCustomField from "./StatusPageCustomField";
|
|
107
108
|
import StatusPageDomain from "./StatusPageDomain";
|
|
108
109
|
import StatusPageFooterLink from "./StatusPageFooterLink";
|
|
@@ -247,6 +248,7 @@ const AllModelTypes: Array<{
|
|
|
247
248
|
StatusPageResource,
|
|
248
249
|
|
|
249
250
|
StatusPageAnnouncement,
|
|
251
|
+
StatusPageAnnouncementTemplate,
|
|
250
252
|
StatusPageSubscriber,
|
|
251
253
|
StatusPageFooterLink,
|
|
252
254
|
StatusPageHeaderLink,
|
|
@@ -218,7 +218,7 @@ export default class MonitorCustomField extends BaseModel {
|
|
|
218
218
|
type: ColumnType.ShortText,
|
|
219
219
|
length: ColumnLength.ShortText,
|
|
220
220
|
})
|
|
221
|
-
public
|
|
221
|
+
public customFieldType?: CustomFieldType = undefined;
|
|
222
222
|
|
|
223
223
|
@ColumnAccessControl({
|
|
224
224
|
create: [
|
|
@@ -218,7 +218,7 @@ export default class OnCallDutyPolicyCustomField extends BaseModel {
|
|
|
218
218
|
type: ColumnType.ShortText,
|
|
219
219
|
length: ColumnLength.ShortText,
|
|
220
220
|
})
|
|
221
|
-
public
|
|
221
|
+
public customFieldType?: CustomFieldType = undefined;
|
|
222
222
|
|
|
223
223
|
@ColumnAccessControl({
|
|
224
224
|
create: [
|
|
@@ -218,7 +218,7 @@ export default class ScheduledMaintenanceCustomField extends BaseModel {
|
|
|
218
218
|
type: ColumnType.ShortText,
|
|
219
219
|
length: ColumnLength.ShortText,
|
|
220
220
|
})
|
|
221
|
-
public
|
|
221
|
+
public customFieldType?: CustomFieldType = undefined;
|
|
222
222
|
|
|
223
223
|
@ColumnAccessControl({
|
|
224
224
|
create: [
|
|
@@ -287,7 +287,7 @@ export default class ScheduledMaintenanceTemplate extends BaseModel {
|
|
|
287
287
|
type: TableColumnType.Markdown,
|
|
288
288
|
title: "Description",
|
|
289
289
|
description:
|
|
290
|
-
"Description of this scheduled event that will show up on Status Page. This is
|
|
290
|
+
"Description of this scheduled event that will show up on Status Page. This is a markdown field.",
|
|
291
291
|
})
|
|
292
292
|
@Column({
|
|
293
293
|
nullable: true,
|
|
@@ -318,7 +318,7 @@ export default class StatusPageAnnouncement extends BaseModel {
|
|
|
318
318
|
required: true,
|
|
319
319
|
type: TableColumnType.Markdown,
|
|
320
320
|
title: "Announcement Description",
|
|
321
|
-
description: "Text of the announcement. This
|
|
321
|
+
description: "Text of the announcement. This can be in Markdown format.",
|
|
322
322
|
})
|
|
323
323
|
@Column({
|
|
324
324
|
nullable: false,
|
|
@@ -0,0 +1,473 @@
|
|
|
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 EnableWorkflow from "../../Types/Database/EnableWorkflow";
|
|
16
|
+
import SlugifyColumn from "../../Types/Database/SlugifyColumn";
|
|
17
|
+
import TableColumn from "../../Types/Database/TableColumn";
|
|
18
|
+
import TableColumnType from "../../Types/Database/TableColumnType";
|
|
19
|
+
import TableMetadata from "../../Types/Database/TableMetadata";
|
|
20
|
+
import TenantColumn from "../../Types/Database/TenantColumn";
|
|
21
|
+
import IconProp from "../../Types/Icon/IconProp";
|
|
22
|
+
import ObjectID from "../../Types/ObjectID";
|
|
23
|
+
import Permission from "../../Types/Permission";
|
|
24
|
+
import {
|
|
25
|
+
Column,
|
|
26
|
+
Entity,
|
|
27
|
+
Index,
|
|
28
|
+
JoinColumn,
|
|
29
|
+
JoinTable,
|
|
30
|
+
ManyToMany,
|
|
31
|
+
ManyToOne,
|
|
32
|
+
} from "typeorm";
|
|
33
|
+
|
|
34
|
+
@EnableDocumentation()
|
|
35
|
+
@TenantColumn("projectId")
|
|
36
|
+
@CanAccessIfCanReadOn("statusPages")
|
|
37
|
+
@TableBillingAccessControl({
|
|
38
|
+
create: PlanType.Growth,
|
|
39
|
+
read: PlanType.Growth,
|
|
40
|
+
update: PlanType.Growth,
|
|
41
|
+
delete: PlanType.Growth,
|
|
42
|
+
})
|
|
43
|
+
@TableAccessControl({
|
|
44
|
+
create: [
|
|
45
|
+
Permission.ProjectOwner,
|
|
46
|
+
Permission.ProjectAdmin,
|
|
47
|
+
Permission.ProjectMember,
|
|
48
|
+
Permission.CreateStatusPageAnnouncementTemplate,
|
|
49
|
+
],
|
|
50
|
+
read: [
|
|
51
|
+
Permission.ProjectOwner,
|
|
52
|
+
Permission.ProjectAdmin,
|
|
53
|
+
Permission.ProjectMember,
|
|
54
|
+
Permission.ReadStatusPageAnnouncementTemplate,
|
|
55
|
+
],
|
|
56
|
+
delete: [
|
|
57
|
+
Permission.ProjectOwner,
|
|
58
|
+
Permission.ProjectAdmin,
|
|
59
|
+
Permission.ProjectMember,
|
|
60
|
+
Permission.DeleteStatusPageAnnouncementTemplate,
|
|
61
|
+
],
|
|
62
|
+
update: [
|
|
63
|
+
Permission.ProjectOwner,
|
|
64
|
+
Permission.ProjectAdmin,
|
|
65
|
+
Permission.ProjectMember,
|
|
66
|
+
Permission.EditStatusPageAnnouncementTemplate,
|
|
67
|
+
],
|
|
68
|
+
})
|
|
69
|
+
@EnableWorkflow({
|
|
70
|
+
create: true,
|
|
71
|
+
delete: true,
|
|
72
|
+
update: true,
|
|
73
|
+
read: true,
|
|
74
|
+
})
|
|
75
|
+
@CrudApiEndpoint(new Route("/status-page-announcement-template"))
|
|
76
|
+
@SlugifyColumn("templateName", "slug")
|
|
77
|
+
@TableMetadata({
|
|
78
|
+
tableName: "StatusPageAnnouncementTemplate",
|
|
79
|
+
singularName: "Status Page Announcement Template",
|
|
80
|
+
pluralName: "Status Page Announcement Templates",
|
|
81
|
+
icon: IconProp.Announcement,
|
|
82
|
+
tableDescription: "Manage announcement templates for your status page",
|
|
83
|
+
})
|
|
84
|
+
@Entity({
|
|
85
|
+
name: "StatusPageAnnouncementTemplate",
|
|
86
|
+
})
|
|
87
|
+
export default class StatusPageAnnouncementTemplate extends BaseModel {
|
|
88
|
+
@ColumnAccessControl({
|
|
89
|
+
create: [
|
|
90
|
+
Permission.ProjectOwner,
|
|
91
|
+
Permission.ProjectAdmin,
|
|
92
|
+
Permission.ProjectMember,
|
|
93
|
+
Permission.CreateStatusPageAnnouncementTemplate,
|
|
94
|
+
],
|
|
95
|
+
read: [
|
|
96
|
+
Permission.ProjectOwner,
|
|
97
|
+
Permission.ProjectAdmin,
|
|
98
|
+
Permission.ProjectMember,
|
|
99
|
+
Permission.ReadStatusPageAnnouncementTemplate,
|
|
100
|
+
],
|
|
101
|
+
update: [],
|
|
102
|
+
})
|
|
103
|
+
@TableColumn({
|
|
104
|
+
manyToOneRelationColumn: "projectId",
|
|
105
|
+
type: TableColumnType.Entity,
|
|
106
|
+
modelType: Project,
|
|
107
|
+
title: "Project",
|
|
108
|
+
description: "Relation to Project Resource in which this object belongs",
|
|
109
|
+
})
|
|
110
|
+
@ManyToOne(
|
|
111
|
+
() => {
|
|
112
|
+
return Project;
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
eager: false,
|
|
116
|
+
nullable: true,
|
|
117
|
+
onDelete: "CASCADE",
|
|
118
|
+
orphanedRowAction: "nullify",
|
|
119
|
+
},
|
|
120
|
+
)
|
|
121
|
+
@JoinColumn({ name: "projectId" })
|
|
122
|
+
public project?: Project = undefined;
|
|
123
|
+
|
|
124
|
+
@ColumnAccessControl({
|
|
125
|
+
create: [
|
|
126
|
+
Permission.ProjectOwner,
|
|
127
|
+
Permission.ProjectAdmin,
|
|
128
|
+
Permission.ProjectMember,
|
|
129
|
+
Permission.CreateStatusPageAnnouncementTemplate,
|
|
130
|
+
],
|
|
131
|
+
read: [
|
|
132
|
+
Permission.ProjectOwner,
|
|
133
|
+
Permission.ProjectAdmin,
|
|
134
|
+
Permission.ProjectMember,
|
|
135
|
+
Permission.ReadStatusPageAnnouncementTemplate,
|
|
136
|
+
],
|
|
137
|
+
update: [],
|
|
138
|
+
})
|
|
139
|
+
@Index()
|
|
140
|
+
@TableColumn({
|
|
141
|
+
type: TableColumnType.ObjectID,
|
|
142
|
+
required: true,
|
|
143
|
+
canReadOnRelationQuery: true,
|
|
144
|
+
title: "Project ID",
|
|
145
|
+
description: "ID of your OneUptime Project in which this object belongs",
|
|
146
|
+
})
|
|
147
|
+
@Column({
|
|
148
|
+
type: ColumnType.ObjectID,
|
|
149
|
+
nullable: false,
|
|
150
|
+
transformer: ObjectID.getDatabaseTransformer(),
|
|
151
|
+
})
|
|
152
|
+
public projectId?: ObjectID = undefined;
|
|
153
|
+
|
|
154
|
+
@ColumnAccessControl({
|
|
155
|
+
create: [
|
|
156
|
+
Permission.ProjectOwner,
|
|
157
|
+
Permission.ProjectAdmin,
|
|
158
|
+
Permission.ProjectMember,
|
|
159
|
+
Permission.CreateStatusPageAnnouncementTemplate,
|
|
160
|
+
],
|
|
161
|
+
read: [
|
|
162
|
+
Permission.ProjectOwner,
|
|
163
|
+
Permission.ProjectAdmin,
|
|
164
|
+
Permission.ProjectMember,
|
|
165
|
+
Permission.ReadStatusPageAnnouncementTemplate,
|
|
166
|
+
],
|
|
167
|
+
update: [
|
|
168
|
+
Permission.ProjectOwner,
|
|
169
|
+
Permission.ProjectAdmin,
|
|
170
|
+
Permission.ProjectMember,
|
|
171
|
+
Permission.EditStatusPageAnnouncementTemplate,
|
|
172
|
+
],
|
|
173
|
+
})
|
|
174
|
+
@TableColumn({
|
|
175
|
+
required: true,
|
|
176
|
+
type: TableColumnType.ShortText,
|
|
177
|
+
title: "Template Name",
|
|
178
|
+
description: "Name of the announcement template",
|
|
179
|
+
})
|
|
180
|
+
@Column({
|
|
181
|
+
nullable: false,
|
|
182
|
+
type: ColumnType.ShortText,
|
|
183
|
+
length: ColumnLength.ShortText,
|
|
184
|
+
})
|
|
185
|
+
public templateName?: string = undefined;
|
|
186
|
+
|
|
187
|
+
@ColumnAccessControl({
|
|
188
|
+
create: [
|
|
189
|
+
Permission.ProjectOwner,
|
|
190
|
+
Permission.ProjectAdmin,
|
|
191
|
+
Permission.ProjectMember,
|
|
192
|
+
Permission.CreateStatusPageAnnouncementTemplate,
|
|
193
|
+
],
|
|
194
|
+
read: [
|
|
195
|
+
Permission.ProjectOwner,
|
|
196
|
+
Permission.ProjectAdmin,
|
|
197
|
+
Permission.ProjectMember,
|
|
198
|
+
Permission.ReadStatusPageAnnouncementTemplate,
|
|
199
|
+
],
|
|
200
|
+
update: [
|
|
201
|
+
Permission.ProjectOwner,
|
|
202
|
+
Permission.ProjectAdmin,
|
|
203
|
+
Permission.ProjectMember,
|
|
204
|
+
Permission.EditStatusPageAnnouncementTemplate,
|
|
205
|
+
],
|
|
206
|
+
})
|
|
207
|
+
@TableColumn({
|
|
208
|
+
required: false,
|
|
209
|
+
type: TableColumnType.LongText,
|
|
210
|
+
title: "Template Description",
|
|
211
|
+
description: "Description of the announcement template",
|
|
212
|
+
})
|
|
213
|
+
@Column({
|
|
214
|
+
nullable: true,
|
|
215
|
+
type: ColumnType.LongText,
|
|
216
|
+
length: ColumnLength.LongText,
|
|
217
|
+
})
|
|
218
|
+
public templateDescription?: string = undefined;
|
|
219
|
+
|
|
220
|
+
@ColumnAccessControl({
|
|
221
|
+
create: [
|
|
222
|
+
Permission.ProjectOwner,
|
|
223
|
+
Permission.ProjectAdmin,
|
|
224
|
+
Permission.ProjectMember,
|
|
225
|
+
Permission.CreateStatusPageAnnouncementTemplate,
|
|
226
|
+
],
|
|
227
|
+
read: [
|
|
228
|
+
Permission.ProjectOwner,
|
|
229
|
+
Permission.ProjectAdmin,
|
|
230
|
+
Permission.ProjectMember,
|
|
231
|
+
Permission.ReadStatusPageAnnouncementTemplate,
|
|
232
|
+
],
|
|
233
|
+
update: [
|
|
234
|
+
Permission.ProjectOwner,
|
|
235
|
+
Permission.ProjectAdmin,
|
|
236
|
+
Permission.ProjectMember,
|
|
237
|
+
Permission.EditStatusPageAnnouncementTemplate,
|
|
238
|
+
],
|
|
239
|
+
})
|
|
240
|
+
@TableColumn({
|
|
241
|
+
required: true,
|
|
242
|
+
type: TableColumnType.ShortText,
|
|
243
|
+
title: "Announcement Title",
|
|
244
|
+
description: "Title of the announcement",
|
|
245
|
+
})
|
|
246
|
+
@Column({
|
|
247
|
+
nullable: false,
|
|
248
|
+
type: ColumnType.ShortText,
|
|
249
|
+
length: ColumnLength.ShortText,
|
|
250
|
+
})
|
|
251
|
+
public title?: string = undefined;
|
|
252
|
+
|
|
253
|
+
@ColumnAccessControl({
|
|
254
|
+
create: [
|
|
255
|
+
Permission.ProjectOwner,
|
|
256
|
+
Permission.ProjectAdmin,
|
|
257
|
+
Permission.ProjectMember,
|
|
258
|
+
Permission.CreateStatusPageAnnouncementTemplate,
|
|
259
|
+
],
|
|
260
|
+
read: [
|
|
261
|
+
Permission.ProjectOwner,
|
|
262
|
+
Permission.ProjectAdmin,
|
|
263
|
+
Permission.ProjectMember,
|
|
264
|
+
Permission.ReadStatusPageAnnouncementTemplate,
|
|
265
|
+
],
|
|
266
|
+
update: [
|
|
267
|
+
Permission.ProjectOwner,
|
|
268
|
+
Permission.ProjectAdmin,
|
|
269
|
+
Permission.ProjectMember,
|
|
270
|
+
Permission.EditStatusPageAnnouncementTemplate,
|
|
271
|
+
],
|
|
272
|
+
})
|
|
273
|
+
@TableColumn({
|
|
274
|
+
required: true,
|
|
275
|
+
type: TableColumnType.Markdown,
|
|
276
|
+
title: "Announcement Description",
|
|
277
|
+
description: "Text of the announcement. This is in Markdown.",
|
|
278
|
+
})
|
|
279
|
+
@Column({
|
|
280
|
+
nullable: false,
|
|
281
|
+
type: ColumnType.Markdown,
|
|
282
|
+
})
|
|
283
|
+
public description?: string = undefined;
|
|
284
|
+
|
|
285
|
+
@ColumnAccessControl({
|
|
286
|
+
create: [
|
|
287
|
+
Permission.ProjectOwner,
|
|
288
|
+
Permission.ProjectAdmin,
|
|
289
|
+
Permission.ProjectMember,
|
|
290
|
+
Permission.CreateStatusPageAnnouncementTemplate,
|
|
291
|
+
],
|
|
292
|
+
read: [
|
|
293
|
+
Permission.ProjectOwner,
|
|
294
|
+
Permission.ProjectAdmin,
|
|
295
|
+
Permission.ProjectMember,
|
|
296
|
+
Permission.ReadStatusPageAnnouncementTemplate,
|
|
297
|
+
],
|
|
298
|
+
update: [
|
|
299
|
+
Permission.ProjectOwner,
|
|
300
|
+
Permission.ProjectAdmin,
|
|
301
|
+
Permission.ProjectMember,
|
|
302
|
+
Permission.EditStatusPageAnnouncementTemplate,
|
|
303
|
+
],
|
|
304
|
+
})
|
|
305
|
+
@TableColumn({
|
|
306
|
+
required: false,
|
|
307
|
+
type: TableColumnType.EntityArray,
|
|
308
|
+
modelType: StatusPage,
|
|
309
|
+
title: "Status Pages",
|
|
310
|
+
description: "Status Pages to show this announcement on.",
|
|
311
|
+
})
|
|
312
|
+
@ManyToMany(
|
|
313
|
+
() => {
|
|
314
|
+
return StatusPage;
|
|
315
|
+
},
|
|
316
|
+
{ eager: false },
|
|
317
|
+
)
|
|
318
|
+
@JoinTable({
|
|
319
|
+
name: "AnnouncementTemplateStatusPage",
|
|
320
|
+
inverseJoinColumn: {
|
|
321
|
+
name: "statusPageId",
|
|
322
|
+
referencedColumnName: "_id",
|
|
323
|
+
},
|
|
324
|
+
joinColumn: {
|
|
325
|
+
name: "announcementTemplateId",
|
|
326
|
+
referencedColumnName: "_id",
|
|
327
|
+
},
|
|
328
|
+
})
|
|
329
|
+
public statusPages?: Array<StatusPage> = undefined;
|
|
330
|
+
|
|
331
|
+
@ColumnAccessControl({
|
|
332
|
+
create: [
|
|
333
|
+
Permission.ProjectOwner,
|
|
334
|
+
Permission.ProjectAdmin,
|
|
335
|
+
Permission.ProjectMember,
|
|
336
|
+
Permission.CreateStatusPageAnnouncementTemplate,
|
|
337
|
+
],
|
|
338
|
+
read: [
|
|
339
|
+
Permission.ProjectOwner,
|
|
340
|
+
Permission.ProjectAdmin,
|
|
341
|
+
Permission.ProjectMember,
|
|
342
|
+
Permission.ReadStatusPageAnnouncementTemplate,
|
|
343
|
+
],
|
|
344
|
+
update: [
|
|
345
|
+
Permission.ProjectOwner,
|
|
346
|
+
Permission.ProjectAdmin,
|
|
347
|
+
Permission.ProjectMember,
|
|
348
|
+
Permission.EditStatusPageAnnouncementTemplate,
|
|
349
|
+
],
|
|
350
|
+
})
|
|
351
|
+
@TableColumn({
|
|
352
|
+
isDefaultValueColumn: true,
|
|
353
|
+
type: TableColumnType.Boolean,
|
|
354
|
+
title: "Should subscribers be notified?",
|
|
355
|
+
description:
|
|
356
|
+
"Should subscribers be notified about announcements created from this template?",
|
|
357
|
+
})
|
|
358
|
+
@Column({
|
|
359
|
+
type: ColumnType.Boolean,
|
|
360
|
+
default: true,
|
|
361
|
+
})
|
|
362
|
+
public shouldStatusPageSubscribersBeNotified?: boolean = undefined;
|
|
363
|
+
|
|
364
|
+
@ColumnAccessControl({
|
|
365
|
+
create: [],
|
|
366
|
+
read: [
|
|
367
|
+
Permission.ProjectOwner,
|
|
368
|
+
Permission.ProjectAdmin,
|
|
369
|
+
Permission.ProjectMember,
|
|
370
|
+
Permission.ReadStatusPageAnnouncementTemplate,
|
|
371
|
+
],
|
|
372
|
+
update: [],
|
|
373
|
+
})
|
|
374
|
+
@TableColumn({
|
|
375
|
+
manyToOneRelationColumn: "createdByUserId",
|
|
376
|
+
type: TableColumnType.Entity,
|
|
377
|
+
modelType: User,
|
|
378
|
+
title: "Created by User",
|
|
379
|
+
description:
|
|
380
|
+
"Relation to User who created this object (if this object was created by a User)",
|
|
381
|
+
})
|
|
382
|
+
@ManyToOne(
|
|
383
|
+
() => {
|
|
384
|
+
return User;
|
|
385
|
+
},
|
|
386
|
+
{
|
|
387
|
+
eager: false,
|
|
388
|
+
nullable: true,
|
|
389
|
+
onDelete: "SET NULL",
|
|
390
|
+
orphanedRowAction: "nullify",
|
|
391
|
+
},
|
|
392
|
+
)
|
|
393
|
+
@JoinColumn({ name: "createdByUserId" })
|
|
394
|
+
public createdByUser?: User = undefined;
|
|
395
|
+
|
|
396
|
+
@ColumnAccessControl({
|
|
397
|
+
create: [
|
|
398
|
+
Permission.ProjectOwner,
|
|
399
|
+
Permission.ProjectAdmin,
|
|
400
|
+
Permission.ProjectMember,
|
|
401
|
+
Permission.CreateStatusPageAnnouncementTemplate,
|
|
402
|
+
],
|
|
403
|
+
read: [
|
|
404
|
+
Permission.ProjectOwner,
|
|
405
|
+
Permission.ProjectAdmin,
|
|
406
|
+
Permission.ProjectMember,
|
|
407
|
+
Permission.ReadStatusPageAnnouncementTemplate,
|
|
408
|
+
],
|
|
409
|
+
update: [],
|
|
410
|
+
})
|
|
411
|
+
@TableColumn({
|
|
412
|
+
type: TableColumnType.ObjectID,
|
|
413
|
+
title: "Created by User ID",
|
|
414
|
+
description:
|
|
415
|
+
"User ID who created this object (if this object was created by a User)",
|
|
416
|
+
})
|
|
417
|
+
@Column({
|
|
418
|
+
type: ColumnType.ObjectID,
|
|
419
|
+
nullable: true,
|
|
420
|
+
transformer: ObjectID.getDatabaseTransformer(),
|
|
421
|
+
})
|
|
422
|
+
public createdByUserId?: ObjectID = undefined;
|
|
423
|
+
|
|
424
|
+
@ColumnAccessControl({
|
|
425
|
+
create: [],
|
|
426
|
+
read: [
|
|
427
|
+
Permission.ProjectOwner,
|
|
428
|
+
Permission.ProjectAdmin,
|
|
429
|
+
Permission.ProjectMember,
|
|
430
|
+
Permission.ReadStatusPageAnnouncementTemplate,
|
|
431
|
+
],
|
|
432
|
+
update: [],
|
|
433
|
+
})
|
|
434
|
+
@TableColumn({
|
|
435
|
+
manyToOneRelationColumn: "deletedByUserId",
|
|
436
|
+
type: TableColumnType.Entity,
|
|
437
|
+
title: "Deleted by User",
|
|
438
|
+
description:
|
|
439
|
+
"Relation to User who deleted this object (if this object was deleted by a User)",
|
|
440
|
+
})
|
|
441
|
+
@ManyToOne(
|
|
442
|
+
() => {
|
|
443
|
+
return User;
|
|
444
|
+
},
|
|
445
|
+
{
|
|
446
|
+
cascade: false,
|
|
447
|
+
eager: false,
|
|
448
|
+
nullable: true,
|
|
449
|
+
onDelete: "SET NULL",
|
|
450
|
+
orphanedRowAction: "nullify",
|
|
451
|
+
},
|
|
452
|
+
)
|
|
453
|
+
@JoinColumn({ name: "deletedByUserId" })
|
|
454
|
+
public deletedByUser?: User = undefined;
|
|
455
|
+
|
|
456
|
+
@ColumnAccessControl({
|
|
457
|
+
create: [],
|
|
458
|
+
read: [],
|
|
459
|
+
update: [],
|
|
460
|
+
})
|
|
461
|
+
@TableColumn({
|
|
462
|
+
type: TableColumnType.ObjectID,
|
|
463
|
+
title: "Deleted by User ID",
|
|
464
|
+
description:
|
|
465
|
+
"User ID who deleted this object (if this object was deleted by a User)",
|
|
466
|
+
})
|
|
467
|
+
@Column({
|
|
468
|
+
type: ColumnType.ObjectID,
|
|
469
|
+
nullable: true,
|
|
470
|
+
transformer: ObjectID.getDatabaseTransformer(),
|
|
471
|
+
})
|
|
472
|
+
public deletedByUserId?: ObjectID = undefined;
|
|
473
|
+
}
|
|
@@ -218,7 +218,7 @@ export default class StatusPageCustomField extends BaseModel {
|
|
|
218
218
|
type: ColumnType.ShortText,
|
|
219
219
|
length: ColumnLength.ShortText,
|
|
220
220
|
})
|
|
221
|
-
public
|
|
221
|
+
public customFieldType?: CustomFieldType = undefined;
|
|
222
222
|
|
|
223
223
|
@ColumnAccessControl({
|
|
224
224
|
create: [
|
package/Server/API/FileAPI.ts
CHANGED
|
@@ -31,11 +31,11 @@ export default class FileAPI extends BaseAPI<File, FileServiceType> {
|
|
|
31
31
|
},
|
|
32
32
|
select: {
|
|
33
33
|
file: true,
|
|
34
|
-
|
|
34
|
+
fileType: true,
|
|
35
35
|
},
|
|
36
36
|
});
|
|
37
37
|
|
|
38
|
-
if (!file || !file.file || !file.
|
|
38
|
+
if (!file || !file.file || !file.fileType) {
|
|
39
39
|
return Response.sendErrorResponse(
|
|
40
40
|
req,
|
|
41
41
|
res,
|
|
@@ -246,7 +246,7 @@ export default class StatusPageAPI extends BaseAPI<
|
|
|
246
246
|
faviconFile: {
|
|
247
247
|
file: true,
|
|
248
248
|
_id: true,
|
|
249
|
-
|
|
249
|
+
fileType: true,
|
|
250
250
|
name: true,
|
|
251
251
|
},
|
|
252
252
|
},
|
|
@@ -510,19 +510,19 @@ export default class StatusPageAPI extends BaseAPI<
|
|
|
510
510
|
coverImageFile: {
|
|
511
511
|
file: true,
|
|
512
512
|
_id: true,
|
|
513
|
-
|
|
513
|
+
fileType: true,
|
|
514
514
|
name: true,
|
|
515
515
|
},
|
|
516
516
|
faviconFile: {
|
|
517
517
|
file: true,
|
|
518
518
|
_id: true,
|
|
519
|
-
|
|
519
|
+
fileType: true,
|
|
520
520
|
name: true,
|
|
521
521
|
},
|
|
522
522
|
logoFile: {
|
|
523
523
|
file: true,
|
|
524
524
|
_id: true,
|
|
525
|
-
|
|
525
|
+
fileType: true,
|
|
526
526
|
name: true,
|
|
527
527
|
},
|
|
528
528
|
showIncidentsOnStatusPage: true,
|