@oneuptime/common 7.0.4596 → 7.0.4604
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/ApiKey.ts +1 -3
- package/Models/DatabaseModels/ApiKeyPermission.ts +2 -2
- package/Models/DatabaseModels/GlobalConfig.ts +1 -1
- package/Models/DatabaseModels/Incident.ts +3 -5
- package/Models/DatabaseModels/Monitor.ts +5 -5
- package/Models/DatabaseModels/Project.ts +1 -2
- package/Models/DatabaseModels/ProjectCallSMSConfig.ts +1 -1
- package/Models/DatabaseModels/ProjectSmtpConfig.ts +2 -2
- package/Models/DatabaseModels/ProjectSso.ts +2 -2
- package/Models/DatabaseModels/PromoCode.ts +5 -1
- package/Models/DatabaseModels/ResellerPlan.ts +1 -1
- package/Models/DatabaseModels/StatusPageAnnouncement.ts +2 -2
- package/Models/DatabaseModels/StatusPageSso.ts +4 -4
- package/Models/DatabaseModels/TeamPermission.ts +2 -2
- package/Models/DatabaseModels/TelemetryException.ts +1 -1
- package/Models/DatabaseModels/User.ts +6 -2
- package/Models/DatabaseModels/UserNotificationSetting.ts +4 -4
- package/Server/API/ResellerPlanAPI.ts +1 -1
- package/Server/Services/AlertService.ts +2 -2
- package/Server/Services/DatabaseService.ts +1 -4
- package/Server/Services/IncidentService.ts +4 -4
- package/Server/Services/ScheduledMaintenanceService.ts +7 -7
- package/Server/Types/AnalyticsDatabase/ModelPermission.ts +0 -1
- package/Server/Types/Database/Permissions/ColumnPermission.ts +14 -14
- package/Tests/UI/Components/MarkdownEditor.test.tsx +4 -4
- package/Types/Text.ts +9 -9
- package/Types/Workspace/NotificationRules/BaseNotificationRule.ts +2 -2
- package/Utils/Schema/AnalyticsModelSchema.ts +202 -90
- package/Utils/Schema/ModelSchema.ts +235 -144
- package/build/dist/Models/DatabaseModels/ApiKey.js.map +1 -1
- package/build/dist/Models/DatabaseModels/GlobalConfig.js +1 -1
- package/build/dist/Models/DatabaseModels/Incident.js.map +1 -1
- package/build/dist/Models/DatabaseModels/Monitor.js.map +1 -1
- package/build/dist/Models/DatabaseModels/Project.js.map +1 -1
- package/build/dist/Models/DatabaseModels/ProjectCallSMSConfig.js +1 -1
- package/build/dist/Models/DatabaseModels/PromoCode.js +5 -1
- package/build/dist/Models/DatabaseModels/PromoCode.js.map +1 -1
- package/build/dist/Models/DatabaseModels/ResellerPlan.js +1 -1
- package/build/dist/Models/DatabaseModels/TelemetryException.js +1 -1
- package/build/dist/Models/DatabaseModels/TelemetryException.js.map +1 -1
- package/build/dist/Models/DatabaseModels/User.js +5 -1
- package/build/dist/Models/DatabaseModels/User.js.map +1 -1
- package/build/dist/Server/API/ResellerPlanAPI.js +1 -1
- package/build/dist/Server/API/ResellerPlanAPI.js.map +1 -1
- package/build/dist/Server/Services/AlertService.js +2 -2
- package/build/dist/Server/Services/AlertService.js.map +1 -1
- package/build/dist/Server/Services/DatabaseService.js +1 -2
- package/build/dist/Server/Services/DatabaseService.js.map +1 -1
- package/build/dist/Server/Services/IncidentService.js +4 -4
- package/build/dist/Server/Services/IncidentService.js.map +1 -1
- package/build/dist/Server/Services/ScheduledMaintenanceService.js +7 -7
- package/build/dist/Server/Services/ScheduledMaintenanceService.js.map +1 -1
- package/build/dist/Server/Types/AnalyticsDatabase/ModelPermission.js.map +1 -1
- package/build/dist/Tests/UI/Components/MarkdownEditor.test.js +4 -4
- package/build/dist/Tests/UI/Components/MarkdownEditor.test.js.map +1 -1
- package/build/dist/Types/Text.js +8 -8
- package/build/dist/Types/Text.js.map +1 -1
- package/build/dist/Utils/Schema/AnalyticsModelSchema.js +12 -4
- package/build/dist/Utils/Schema/AnalyticsModelSchema.js.map +1 -1
- package/build/dist/Utils/Schema/ModelSchema.js +49 -22
- package/build/dist/Utils/Schema/ModelSchema.js.map +1 -1
- package/package.json +1 -1
|
@@ -425,8 +425,8 @@ export default class APIKeyPermission extends BaseModel {
|
|
|
425
425
|
Permission.EditProjectApiKey,
|
|
426
426
|
],
|
|
427
427
|
})
|
|
428
|
-
@TableColumn({
|
|
429
|
-
isDefaultValueColumn: true,
|
|
428
|
+
@TableColumn({
|
|
429
|
+
isDefaultValueColumn: true,
|
|
430
430
|
type: TableColumnType.Boolean,
|
|
431
431
|
defaultValue: false,
|
|
432
432
|
})
|
|
@@ -260,7 +260,7 @@ export default class GlobalConfig extends GlobalConfigModel {
|
|
|
260
260
|
nullable: true,
|
|
261
261
|
unique: false,
|
|
262
262
|
})
|
|
263
|
-
public twilioSecondaryPhoneNumbers?: string = undefined; // phone numbers
|
|
263
|
+
public twilioSecondaryPhoneNumbers?: string = undefined; // phone numbers separated by comma
|
|
264
264
|
|
|
265
265
|
@ColumnAccessControl({
|
|
266
266
|
create: [],
|
|
@@ -505,7 +505,7 @@ export default class Incident extends BaseModel {
|
|
|
505
505
|
|
|
506
506
|
@ColumnAccessControl({
|
|
507
507
|
create: [
|
|
508
|
-
|
|
508
|
+
Permission.ProjectOwner,
|
|
509
509
|
Permission.ProjectAdmin,
|
|
510
510
|
Permission.ProjectMember,
|
|
511
511
|
Permission.CreateProjectIncident,
|
|
@@ -547,7 +547,7 @@ export default class Incident extends BaseModel {
|
|
|
547
547
|
|
|
548
548
|
@ColumnAccessControl({
|
|
549
549
|
create: [
|
|
550
|
-
|
|
550
|
+
Permission.ProjectOwner,
|
|
551
551
|
Permission.ProjectAdmin,
|
|
552
552
|
Permission.ProjectMember,
|
|
553
553
|
Permission.CreateProjectIncident,
|
|
@@ -1100,9 +1100,7 @@ export default class Incident extends BaseModel {
|
|
|
1100
1100
|
public telemetryQuery?: TelemetryQuery = undefined;
|
|
1101
1101
|
|
|
1102
1102
|
@ColumnAccessControl({
|
|
1103
|
-
create: [
|
|
1104
|
-
|
|
1105
|
-
],
|
|
1103
|
+
create: [],
|
|
1106
1104
|
read: [
|
|
1107
1105
|
Permission.ProjectOwner,
|
|
1108
1106
|
Permission.ProjectAdmin,
|
|
@@ -473,10 +473,10 @@ export default class Monitor extends BaseModel {
|
|
|
473
473
|
|
|
474
474
|
@ColumnAccessControl({
|
|
475
475
|
create: [
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
476
|
+
Permission.ProjectOwner,
|
|
477
|
+
Permission.ProjectAdmin,
|
|
478
|
+
Permission.ProjectMember,
|
|
479
|
+
Permission.CreateProjectIncident,
|
|
480
480
|
],
|
|
481
481
|
read: [
|
|
482
482
|
Permission.ProjectOwner,
|
|
@@ -495,7 +495,7 @@ export default class Monitor extends BaseModel {
|
|
|
495
495
|
@TableColumn({
|
|
496
496
|
type: TableColumnType.ObjectID,
|
|
497
497
|
required: true,
|
|
498
|
-
isDefaultValueColumn: true,
|
|
498
|
+
isDefaultValueColumn: true,
|
|
499
499
|
title: "Current Monitor Status ID",
|
|
500
500
|
description: "Whats the current status ID of this monitor?",
|
|
501
501
|
canReadOnRelationQuery: true,
|
|
@@ -828,8 +828,7 @@ export default class Project extends TenantModel {
|
|
|
828
828
|
hideColumnInDocumentation: true,
|
|
829
829
|
type: TableColumnType.Boolean,
|
|
830
830
|
title: "Not Enabled SMS or Call Notification Sent to Owners",
|
|
831
|
-
description:
|
|
832
|
-
"Not Enabled SMS or Call Notification Sent to Owners",
|
|
831
|
+
description: "Not Enabled SMS or Call Notification Sent to Owners",
|
|
833
832
|
defaultValue: false,
|
|
834
833
|
})
|
|
835
834
|
@Column({
|
|
@@ -457,5 +457,5 @@ export default class ProjectCallSMSConfig extends BaseModel {
|
|
|
457
457
|
nullable: true,
|
|
458
458
|
unique: false,
|
|
459
459
|
})
|
|
460
|
-
public twilioSecondaryPhoneNumbers?: string = undefined; // phone numbers
|
|
460
|
+
public twilioSecondaryPhoneNumbers?: string = undefined; // phone numbers separated by comma
|
|
461
461
|
}
|
|
@@ -512,8 +512,8 @@ export default class ProjectSmtpConfig extends BaseModel {
|
|
|
512
512
|
Permission.EditProjectSMTPConfig,
|
|
513
513
|
],
|
|
514
514
|
})
|
|
515
|
-
@TableColumn({
|
|
516
|
-
required: true,
|
|
515
|
+
@TableColumn({
|
|
516
|
+
required: true,
|
|
517
517
|
type: TableColumnType.Boolean,
|
|
518
518
|
defaultValue: true,
|
|
519
519
|
})
|
|
@@ -550,8 +550,8 @@ export default class ProjectSSO extends BaseModel {
|
|
|
550
550
|
Permission.EditProjectSSO,
|
|
551
551
|
],
|
|
552
552
|
})
|
|
553
|
-
@TableColumn({
|
|
554
|
-
isDefaultValueColumn: true,
|
|
553
|
+
@TableColumn({
|
|
554
|
+
isDefaultValueColumn: true,
|
|
555
555
|
type: TableColumnType.Boolean,
|
|
556
556
|
defaultValue: false,
|
|
557
557
|
})
|
|
@@ -344,7 +344,11 @@ export default class PromoCode extends BaseModel {
|
|
|
344
344
|
read: [],
|
|
345
345
|
update: [],
|
|
346
346
|
})
|
|
347
|
-
@TableColumn({
|
|
347
|
+
@TableColumn({
|
|
348
|
+
isDefaultValueColumn: true,
|
|
349
|
+
type: TableColumnType.Boolean,
|
|
350
|
+
defaultValue: false,
|
|
351
|
+
})
|
|
348
352
|
@Column({
|
|
349
353
|
type: ColumnType.Boolean,
|
|
350
354
|
default: false,
|
|
@@ -295,7 +295,7 @@ export default class ResellerPlan extends BaseModel {
|
|
|
295
295
|
canReadOnRelationQuery: true,
|
|
296
296
|
title: "Other Features",
|
|
297
297
|
description:
|
|
298
|
-
"Other Features of this Reseller Plan. This is shown on the dashboard. Its a comma
|
|
298
|
+
"Other Features of this Reseller Plan. This is shown on the dashboard. Its a comma separated list of features",
|
|
299
299
|
})
|
|
300
300
|
@Column({
|
|
301
301
|
nullable: true,
|
|
@@ -451,8 +451,8 @@ export default class StatusPageAnnouncement extends BaseModel {
|
|
|
451
451
|
],
|
|
452
452
|
update: [],
|
|
453
453
|
})
|
|
454
|
-
@TableColumn({
|
|
455
|
-
isDefaultValueColumn: true,
|
|
454
|
+
@TableColumn({
|
|
455
|
+
isDefaultValueColumn: true,
|
|
456
456
|
computed: true,
|
|
457
457
|
hideColumnInDocumentation: true,
|
|
458
458
|
type: TableColumnType.Boolean,
|
|
@@ -552,8 +552,8 @@ export default class StatusPageSSO extends BaseModel {
|
|
|
552
552
|
Permission.EditStatusPageSSO,
|
|
553
553
|
],
|
|
554
554
|
})
|
|
555
|
-
@TableColumn({
|
|
556
|
-
isDefaultValueColumn: true,
|
|
555
|
+
@TableColumn({
|
|
556
|
+
isDefaultValueColumn: true,
|
|
557
557
|
type: TableColumnType.Boolean,
|
|
558
558
|
defaultValue: false,
|
|
559
559
|
})
|
|
@@ -578,8 +578,8 @@ export default class StatusPageSSO extends BaseModel {
|
|
|
578
578
|
],
|
|
579
579
|
update: [],
|
|
580
580
|
})
|
|
581
|
-
@TableColumn({
|
|
582
|
-
isDefaultValueColumn: true,
|
|
581
|
+
@TableColumn({
|
|
582
|
+
isDefaultValueColumn: true,
|
|
583
583
|
type: TableColumnType.Boolean,
|
|
584
584
|
defaultValue: false,
|
|
585
585
|
})
|
|
@@ -431,8 +431,8 @@ export default class TeamPermission extends BaseModel {
|
|
|
431
431
|
Permission.EditProjectTeam,
|
|
432
432
|
],
|
|
433
433
|
})
|
|
434
|
-
@TableColumn({
|
|
435
|
-
isDefaultValueColumn: true,
|
|
434
|
+
@TableColumn({
|
|
435
|
+
isDefaultValueColumn: true,
|
|
436
436
|
type: TableColumnType.Boolean,
|
|
437
437
|
defaultValue: false,
|
|
438
438
|
})
|
|
@@ -965,7 +965,7 @@ export default class TelemetryException extends DatabaseBaseModel {
|
|
|
965
965
|
})
|
|
966
966
|
@TableColumn({
|
|
967
967
|
title: "Occurances",
|
|
968
|
-
description: "Number of times this exception has
|
|
968
|
+
description: "Number of times this exception has occurred",
|
|
969
969
|
isDefaultValueColumn: true,
|
|
970
970
|
required: true,
|
|
971
971
|
type: TableColumnType.Number,
|
|
@@ -151,7 +151,11 @@ class User extends UserModel {
|
|
|
151
151
|
|
|
152
152
|
update: [],
|
|
153
153
|
})
|
|
154
|
-
@TableColumn({
|
|
154
|
+
@TableColumn({
|
|
155
|
+
isDefaultValueColumn: true,
|
|
156
|
+
type: TableColumnType.Boolean,
|
|
157
|
+
defaultValue: false,
|
|
158
|
+
})
|
|
155
159
|
@Column({
|
|
156
160
|
type: ColumnType.Boolean,
|
|
157
161
|
default: false,
|
|
@@ -539,7 +543,7 @@ class User extends UserModel {
|
|
|
539
543
|
|
|
540
544
|
update: [],
|
|
541
545
|
})
|
|
542
|
-
@TableColumn({
|
|
546
|
+
@TableColumn({
|
|
543
547
|
type: TableColumnType.OTP,
|
|
544
548
|
computed: true,
|
|
545
549
|
})
|
|
@@ -245,8 +245,8 @@ class UserNotificationSetting extends BaseModel {
|
|
|
245
245
|
read: [Permission.CurrentUser],
|
|
246
246
|
update: [Permission.CurrentUser],
|
|
247
247
|
})
|
|
248
|
-
@TableColumn({
|
|
249
|
-
isDefaultValueColumn: true,
|
|
248
|
+
@TableColumn({
|
|
249
|
+
isDefaultValueColumn: true,
|
|
250
250
|
type: TableColumnType.Boolean,
|
|
251
251
|
defaultValue: false,
|
|
252
252
|
})
|
|
@@ -261,8 +261,8 @@ class UserNotificationSetting extends BaseModel {
|
|
|
261
261
|
read: [Permission.CurrentUser],
|
|
262
262
|
update: [Permission.CurrentUser],
|
|
263
263
|
})
|
|
264
|
-
@TableColumn({
|
|
265
|
-
isDefaultValueColumn: true,
|
|
264
|
+
@TableColumn({
|
|
265
|
+
isDefaultValueColumn: true,
|
|
266
266
|
type: TableColumnType.Boolean,
|
|
267
267
|
defaultValue: false,
|
|
268
268
|
})
|
|
@@ -31,7 +31,7 @@ export default class ResellerPlanAPI extends BaseAPI<
|
|
|
31
31
|
super(ResellerPlan, ResellerPlanService);
|
|
32
32
|
|
|
33
33
|
// Reseller Plan Action API
|
|
34
|
-
// TODO:
|
|
34
|
+
// TODO: Refactor this API and make it partner specific.
|
|
35
35
|
this.router.post(
|
|
36
36
|
`${new this.entityType()
|
|
37
37
|
.getCrudApiPath()
|
|
@@ -87,7 +87,7 @@ export class Service extends DatabaseService<Model> {
|
|
|
87
87
|
}
|
|
88
88
|
|
|
89
89
|
if (!alert.projectId) {
|
|
90
|
-
throw new BadDataException("
|
|
90
|
+
throw new BadDataException("Alert Project ID not found");
|
|
91
91
|
}
|
|
92
92
|
|
|
93
93
|
const ackAlertState: AlertState =
|
|
@@ -1240,7 +1240,7 @@ ${alertSeverity.name}
|
|
|
1240
1240
|
}
|
|
1241
1241
|
|
|
1242
1242
|
if (!alert.projectId) {
|
|
1243
|
-
throw new BadDataException("
|
|
1243
|
+
throw new BadDataException("Alert Project ID not found");
|
|
1244
1244
|
}
|
|
1245
1245
|
|
|
1246
1246
|
const resolvedAlertState: AlertState =
|
|
@@ -517,15 +517,12 @@ class DatabaseService<TBaseModel extends BaseModel> extends BaseService {
|
|
|
517
517
|
(data as any)[columnName] = null;
|
|
518
518
|
}
|
|
519
519
|
|
|
520
|
-
// if table columntype is file and file is base64 stirng then convert to buffer to save.
|
|
520
|
+
// if table columntype is file and file is base64 stirng then convert to buffer to save.
|
|
521
521
|
if (
|
|
522
522
|
tableColumnMetadata.type === TableColumnType.File &&
|
|
523
523
|
(data as any)[columnName] &&
|
|
524
524
|
typeof (data as any)[columnName] === Typeof.String
|
|
525
525
|
) {
|
|
526
|
-
|
|
527
|
-
console.log("Here!");
|
|
528
|
-
|
|
529
526
|
const fileBuffer: Buffer = Buffer.from(
|
|
530
527
|
(data as any)[columnName] as string,
|
|
531
528
|
"base64",
|
|
@@ -103,7 +103,7 @@ export class Service extends DatabaseService<Model> {
|
|
|
103
103
|
}
|
|
104
104
|
|
|
105
105
|
if (!incident.projectId) {
|
|
106
|
-
throw new BadDataException("
|
|
106
|
+
throw new BadDataException("Incident Project ID not found");
|
|
107
107
|
}
|
|
108
108
|
|
|
109
109
|
const resolvedIncidentState: IncidentState =
|
|
@@ -149,7 +149,7 @@ export class Service extends DatabaseService<Model> {
|
|
|
149
149
|
}
|
|
150
150
|
|
|
151
151
|
if (!incident.projectId) {
|
|
152
|
-
throw new BadDataException("
|
|
152
|
+
throw new BadDataException("Incident Project ID not found");
|
|
153
153
|
}
|
|
154
154
|
|
|
155
155
|
const ackIncidentState: IncidentState =
|
|
@@ -1584,7 +1584,7 @@ ${incidentSeverity.name}
|
|
|
1584
1584
|
}
|
|
1585
1585
|
|
|
1586
1586
|
if (!incident.projectId) {
|
|
1587
|
-
throw new BadDataException("
|
|
1587
|
+
throw new BadDataException("Incident Project ID not found");
|
|
1588
1588
|
}
|
|
1589
1589
|
|
|
1590
1590
|
// get incident state timeline
|
|
@@ -1617,7 +1617,7 @@ ${incidentSeverity.name}
|
|
|
1617
1617
|
const firstIncidentStateTimeline: IncidentStateTimeline | undefined =
|
|
1618
1618
|
incidentStateTimelines[0];
|
|
1619
1619
|
|
|
1620
|
-
// delete all the incident metrics with this incident id because
|
|
1620
|
+
// delete all the incident metrics with this incident id because it's a refresh.
|
|
1621
1621
|
|
|
1622
1622
|
await MetricService.deleteBy({
|
|
1623
1623
|
query: {
|
|
@@ -351,7 +351,7 @@ ${resourcesAffected ? `**Resources Affected:** ${resourcesAffected}` : ""}
|
|
|
351
351
|
});
|
|
352
352
|
|
|
353
353
|
if (!scheduledMaintenance) {
|
|
354
|
-
throw new BadDataException("Scheduled
|
|
354
|
+
throw new BadDataException("Scheduled Maintenance Event not found");
|
|
355
355
|
}
|
|
356
356
|
|
|
357
357
|
const startsAt: Date =
|
|
@@ -454,7 +454,7 @@ ${resourcesAffected ? `**Resources Affected:** ${resourcesAffected}` : ""}
|
|
|
454
454
|
logger.debug(`Notification date is in the past. Skipping.`);
|
|
455
455
|
}
|
|
456
456
|
|
|
457
|
-
// if this new date is less than the recurring date then set it to
|
|
457
|
+
// if this new date is less than the recurring date then set it to recurring date. We need to get the least date.
|
|
458
458
|
if (recurringDate) {
|
|
459
459
|
if (
|
|
460
460
|
OneUptimeDate.isBefore(notificationDate, recurringDate) &&
|
|
@@ -482,7 +482,7 @@ ${resourcesAffected ? `**Resources Affected:** ${resourcesAffected}` : ""}
|
|
|
482
482
|
): Promise<OnCreate<Model>> {
|
|
483
483
|
if (!createBy.props.tenantId && !createBy.data.projectId) {
|
|
484
484
|
throw new BadDataException(
|
|
485
|
-
"ProjectId required to create scheduled
|
|
485
|
+
"ProjectId required to create scheduled maintenance.",
|
|
486
486
|
);
|
|
487
487
|
}
|
|
488
488
|
|
|
@@ -666,13 +666,13 @@ ${createdItem.description || "No description provided."}
|
|
|
666
666
|
new ScheduledMaintenanceStateTimeline();
|
|
667
667
|
timeline.projectId = createdItem.projectId!;
|
|
668
668
|
timeline.scheduledMaintenanceId = createdItem.id!;
|
|
669
|
-
timeline.isOwnerNotified = true; // ignore notifying owners because you already notify for Scheduled Event,
|
|
669
|
+
timeline.isOwnerNotified = true; // ignore notifying owners because you already notify for Scheduled Event, no need to notify them for timeline event.
|
|
670
670
|
timeline.shouldStatusPageSubscribersBeNotified = Boolean(
|
|
671
671
|
createdItem.shouldStatusPageSubscribersBeNotifiedOnEventCreated,
|
|
672
672
|
);
|
|
673
673
|
timeline.isStatusPageSubscribersNotified = Boolean(
|
|
674
674
|
createdItem.shouldStatusPageSubscribersBeNotifiedOnEventCreated,
|
|
675
|
-
); // ignore notifying subscribers because you already notify for Scheduled Event,
|
|
675
|
+
); // ignore notifying subscribers because you already notify for Scheduled Event, no need to notify them for timeline event.
|
|
676
676
|
timeline.scheduledMaintenanceStateId =
|
|
677
677
|
createdItem.currentScheduledMaintenanceStateId!;
|
|
678
678
|
|
|
@@ -1233,7 +1233,7 @@ ${labels
|
|
|
1233
1233
|
}
|
|
1234
1234
|
|
|
1235
1235
|
if (!scheduledMaintenance.projectId) {
|
|
1236
|
-
throw new BadDataException("
|
|
1236
|
+
throw new BadDataException("Incident Project ID not found");
|
|
1237
1237
|
}
|
|
1238
1238
|
|
|
1239
1239
|
const resolvedScheduledMaintenanceState: ScheduledMaintenanceState =
|
|
@@ -1308,7 +1308,7 @@ ${labels
|
|
|
1308
1308
|
}
|
|
1309
1309
|
|
|
1310
1310
|
if (!scheduledMaintenance.projectId) {
|
|
1311
|
-
throw new BadDataException("
|
|
1311
|
+
throw new BadDataException("Incident Project ID not found");
|
|
1312
1312
|
}
|
|
1313
1313
|
|
|
1314
1314
|
const ackScheduledMaintenanceState: ScheduledMaintenanceState =
|
|
@@ -155,7 +155,6 @@ export default class ModelPermission {
|
|
|
155
155
|
continue; // this is a special case where we want to force the default value on create.
|
|
156
156
|
}
|
|
157
157
|
|
|
158
|
-
|
|
159
158
|
throw new BadDataException(
|
|
160
159
|
`User is not allowed to ${requestType} on ${key} column of ${model.singularName}`,
|
|
161
160
|
);
|
|
@@ -43,7 +43,7 @@ export default class ColumnPermissions {
|
|
|
43
43
|
public static getModelColumnsByPermissions<TBaseModel extends BaseModel>(
|
|
44
44
|
modelType: { new (): TBaseModel },
|
|
45
45
|
userPermissions: Array<UserPermission>,
|
|
46
|
-
requestType: DatabaseRequestType
|
|
46
|
+
requestType: DatabaseRequestType,
|
|
47
47
|
): Columns {
|
|
48
48
|
const model: BaseModel = new modelType();
|
|
49
49
|
const accessControl: Dictionary<ColumnAccessControl> =
|
|
@@ -54,7 +54,7 @@ export default class ColumnPermissions {
|
|
|
54
54
|
const permissions: Array<Permission> = userPermissions.map(
|
|
55
55
|
(item: UserPermission) => {
|
|
56
56
|
return item.permission;
|
|
57
|
-
}
|
|
57
|
+
},
|
|
58
58
|
);
|
|
59
59
|
|
|
60
60
|
for (const key in accessControl) {
|
|
@@ -80,7 +80,7 @@ export default class ColumnPermissions {
|
|
|
80
80
|
columnPermissions &&
|
|
81
81
|
PermissionHelper.doesPermissionsIntersect(
|
|
82
82
|
permissions,
|
|
83
|
-
columnPermissions
|
|
83
|
+
columnPermissions,
|
|
84
84
|
)
|
|
85
85
|
) {
|
|
86
86
|
columns.push(key);
|
|
@@ -95,19 +95,19 @@ export default class ColumnPermissions {
|
|
|
95
95
|
modelType: { new (): TBaseModel },
|
|
96
96
|
data: TBaseModel,
|
|
97
97
|
props: DatabaseCommonInteractionProps,
|
|
98
|
-
requestType: DatabaseRequestType
|
|
98
|
+
requestType: DatabaseRequestType,
|
|
99
99
|
): void {
|
|
100
100
|
const model: BaseModel = new modelType();
|
|
101
101
|
const userPermissions: Array<UserPermission> =
|
|
102
102
|
DatabaseCommonInteractionPropsUtil.getUserPermissions(
|
|
103
103
|
props,
|
|
104
|
-
PermissionType.Allow
|
|
104
|
+
PermissionType.Allow,
|
|
105
105
|
);
|
|
106
106
|
|
|
107
107
|
const permissionColumns: Columns = this.getModelColumnsByPermissions(
|
|
108
108
|
modelType,
|
|
109
109
|
userPermissions,
|
|
110
|
-
requestType
|
|
110
|
+
requestType,
|
|
111
111
|
);
|
|
112
112
|
|
|
113
113
|
const excludedColumnNames: Array<string> = this.getExcludedColumnNames();
|
|
@@ -132,7 +132,7 @@ export default class ColumnPermissions {
|
|
|
132
132
|
|
|
133
133
|
if (!tableColumnMetadata) {
|
|
134
134
|
throw new BadDataException(
|
|
135
|
-
`No TableColumnMetadata found for ${key} column of ${model.singularName}
|
|
135
|
+
`No TableColumnMetadata found for ${key} column of ${model.singularName}`,
|
|
136
136
|
);
|
|
137
137
|
}
|
|
138
138
|
|
|
@@ -159,7 +159,7 @@ export default class ColumnPermissions {
|
|
|
159
159
|
}
|
|
160
160
|
|
|
161
161
|
throw new BadDataException(
|
|
162
|
-
`User is not allowed to ${requestType} on ${key} column of ${model.singularName}
|
|
162
|
+
`User is not allowed to ${requestType} on ${key} column of ${model.singularName}`,
|
|
163
163
|
);
|
|
164
164
|
}
|
|
165
165
|
|
|
@@ -179,13 +179,13 @@ export default class ColumnPermissions {
|
|
|
179
179
|
!SubscriptionPlan.isFeatureAccessibleOnCurrentPlan(
|
|
180
180
|
billingAccessControl.create,
|
|
181
181
|
props.currentPlan,
|
|
182
|
-
getAllEnvVars()
|
|
182
|
+
getAllEnvVars(),
|
|
183
183
|
)
|
|
184
184
|
) {
|
|
185
185
|
throw new PaymentRequiredException(
|
|
186
186
|
"Please upgrade your plan to " +
|
|
187
187
|
billingAccessControl.create +
|
|
188
|
-
" to access this feature"
|
|
188
|
+
" to access this feature",
|
|
189
189
|
);
|
|
190
190
|
}
|
|
191
191
|
}
|
|
@@ -198,13 +198,13 @@ export default class ColumnPermissions {
|
|
|
198
198
|
!SubscriptionPlan.isFeatureAccessibleOnCurrentPlan(
|
|
199
199
|
billingAccessControl.read,
|
|
200
200
|
props.currentPlan,
|
|
201
|
-
getAllEnvVars()
|
|
201
|
+
getAllEnvVars(),
|
|
202
202
|
)
|
|
203
203
|
) {
|
|
204
204
|
throw new PaymentRequiredException(
|
|
205
205
|
"Please upgrade your plan to " +
|
|
206
206
|
billingAccessControl.read +
|
|
207
|
-
" to access this feature"
|
|
207
|
+
" to access this feature",
|
|
208
208
|
);
|
|
209
209
|
}
|
|
210
210
|
}
|
|
@@ -217,13 +217,13 @@ export default class ColumnPermissions {
|
|
|
217
217
|
!SubscriptionPlan.isFeatureAccessibleOnCurrentPlan(
|
|
218
218
|
billingAccessControl.update,
|
|
219
219
|
props.currentPlan,
|
|
220
|
-
getAllEnvVars()
|
|
220
|
+
getAllEnvVars(),
|
|
221
221
|
)
|
|
222
222
|
) {
|
|
223
223
|
throw new PaymentRequiredException(
|
|
224
224
|
"Please upgrade your plan to " +
|
|
225
225
|
billingAccessControl.update +
|
|
226
|
-
" to access this feature"
|
|
226
|
+
" to access this feature",
|
|
227
227
|
);
|
|
228
228
|
}
|
|
229
229
|
}
|
|
@@ -7,7 +7,7 @@ describe("MarkdownEditor with SpellCheck", () => {
|
|
|
7
7
|
test("should enable spell check by default", () => {
|
|
8
8
|
render(
|
|
9
9
|
<MarkdownEditor
|
|
10
|
-
initialValue="This is a test with
|
|
10
|
+
initialValue="This is a test with spelling errors"
|
|
11
11
|
placeholder="Enter markdown here..."
|
|
12
12
|
/>,
|
|
13
13
|
);
|
|
@@ -21,7 +21,7 @@ describe("MarkdownEditor with SpellCheck", () => {
|
|
|
21
21
|
test("should disable spell check when disableSpellCheck is true", () => {
|
|
22
22
|
render(
|
|
23
23
|
<MarkdownEditor
|
|
24
|
-
initialValue="This is a test with
|
|
24
|
+
initialValue="This is a test with spelling errors"
|
|
25
25
|
placeholder="Enter markdown here..."
|
|
26
26
|
disableSpellCheck={true}
|
|
27
27
|
/>,
|
|
@@ -36,7 +36,7 @@ describe("MarkdownEditor with SpellCheck", () => {
|
|
|
36
36
|
test("should handle spell check prop changes", () => {
|
|
37
37
|
const { rerender } = render(
|
|
38
38
|
<MarkdownEditor
|
|
39
|
-
initialValue="This is a test with
|
|
39
|
+
initialValue="This is a test with spelling errors"
|
|
40
40
|
placeholder="Enter markdown here..."
|
|
41
41
|
disableSpellCheck={false}
|
|
42
42
|
/>,
|
|
@@ -49,7 +49,7 @@ describe("MarkdownEditor with SpellCheck", () => {
|
|
|
49
49
|
|
|
50
50
|
rerender(
|
|
51
51
|
<MarkdownEditor
|
|
52
|
-
initialValue="This is a test with
|
|
52
|
+
initialValue="This is a test with spelling errors"
|
|
53
53
|
placeholder="Enter markdown here..."
|
|
54
54
|
disableSpellCheck={true}
|
|
55
55
|
/>,
|
package/Types/Text.ts
CHANGED
|
@@ -114,13 +114,13 @@ export default class Text {
|
|
|
114
114
|
}
|
|
115
115
|
|
|
116
116
|
public static isBase64(text: string): boolean {
|
|
117
|
-
if (!text || typeof text !==
|
|
117
|
+
if (!text || typeof text !== "string") {
|
|
118
118
|
return false;
|
|
119
119
|
}
|
|
120
120
|
|
|
121
121
|
// Remove data URI prefix if present (e.g., data:image/jpeg;base64,)
|
|
122
|
-
const base64String = text.replace(/^data:[^;]+;base64,/,
|
|
123
|
-
|
|
122
|
+
const base64String: string = text.replace(/^data:[^;]+;base64,/, "");
|
|
123
|
+
|
|
124
124
|
// Check if string is empty after removing prefix
|
|
125
125
|
if (!base64String) {
|
|
126
126
|
return false;
|
|
@@ -137,13 +137,13 @@ export default class Text {
|
|
|
137
137
|
}
|
|
138
138
|
|
|
139
139
|
public static extractBase64FromDataUri(text: string): string {
|
|
140
|
-
if (!text || typeof text !==
|
|
140
|
+
if (!text || typeof text !== "string") {
|
|
141
141
|
return text;
|
|
142
142
|
}
|
|
143
143
|
|
|
144
144
|
// Check if it's a data URI
|
|
145
|
-
if (text.startsWith(
|
|
146
|
-
const base64Index = text.indexOf(
|
|
145
|
+
if (text.startsWith("data:")) {
|
|
146
|
+
const base64Index: number = text.indexOf(";base64,");
|
|
147
147
|
if (base64Index !== -1) {
|
|
148
148
|
return text.substring(base64Index + 8); // 8 is length of ';base64,'
|
|
149
149
|
}
|
|
@@ -154,13 +154,13 @@ export default class Text {
|
|
|
154
154
|
}
|
|
155
155
|
|
|
156
156
|
public static extractMimeTypeFromDataUri(text: string): string | null {
|
|
157
|
-
if (!text || typeof text !==
|
|
157
|
+
if (!text || typeof text !== "string") {
|
|
158
158
|
return null;
|
|
159
159
|
}
|
|
160
160
|
|
|
161
161
|
// Check if it's a data URI
|
|
162
|
-
if (text.startsWith(
|
|
163
|
-
const mimeTypeEnd = text.indexOf(
|
|
162
|
+
if (text.startsWith("data:")) {
|
|
163
|
+
const mimeTypeEnd: number = text.indexOf(";");
|
|
164
164
|
if (mimeTypeEnd !== -1) {
|
|
165
165
|
return text.substring(5, mimeTypeEnd); // 5 is length of 'data:'
|
|
166
166
|
}
|
|
@@ -4,9 +4,9 @@ import NotificationRuleCondition from "./NotificationRuleCondition";
|
|
|
4
4
|
export default interface BaseNotificationRule {
|
|
5
5
|
_type: string;
|
|
6
6
|
// filters for notification rule
|
|
7
|
-
filterCondition: FilterCondition; //
|
|
7
|
+
filterCondition: FilterCondition; // AND or OR. Default is AND
|
|
8
8
|
filters: Array<NotificationRuleCondition>; // if this array is empty then it will be considered as all filters are matched.
|
|
9
9
|
|
|
10
10
|
shouldPostToExistingChannel: boolean;
|
|
11
|
-
existingChannelNames: string; //
|
|
11
|
+
existingChannelNames: string; // separate by comma
|
|
12
12
|
}
|