@oneuptime/common 12.0.29 → 12.0.30
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 +11 -0
- package/Models/DatabaseModels/OnCallDutyPolicySchedule.ts +43 -0
- package/Models/DatabaseModels/OnCallDutyPolicyScheduleCalendarFeed.ts +662 -0
- package/Models/DatabaseModels/ProjectOnCallCalendarFeed.ts +584 -0
- package/Models/DatabaseModels/UserOnCallCalendarFeed.ts +546 -0
- package/Models/DatabaseModels/UserOnCallShiftReminder.ts +231 -0
- package/Models/DatabaseModels/UserOnCallShiftReminderLog.ts +331 -0
- package/Server/API/OnCallCalendarAPI.ts +2194 -0
- package/Server/EnvironmentConfig.ts +138 -0
- package/Server/Infrastructure/OnCallCalendarFeedCache.ts +1050 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1790400000000-AddOnCallCalendarFeeds.ts +253 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts +2 -0
- package/Server/Middleware/OnCallCalendarFeedRateLimit.ts +487 -0
- package/Server/Services/Index.ts +12 -0
- package/Server/Services/OnCallDutyPolicyEscalationRuleScheduleService.ts +32 -0
- package/Server/Services/OnCallDutyPolicyScheduleCalendarFeedService.ts +260 -0
- package/Server/Services/OnCallDutyPolicyScheduleLayerService.ts +70 -3
- package/Server/Services/OnCallDutyPolicyScheduleLayerUserService.ts +138 -3
- package/Server/Services/OnCallDutyPolicyScheduleService.ts +1465 -134
- package/Server/Services/OnCallDutyPolicyUserOverrideService.ts +167 -31
- package/Server/Services/ProjectOnCallCalendarFeedService.ts +192 -0
- package/Server/Services/TeamMemberService.ts +489 -1
- package/Server/Services/TeamService.ts +50 -0
- package/Server/Services/UserNotificationSettingService.ts +44 -1
- package/Server/Services/UserOnCallCalendarFeedService.ts +159 -0
- package/Server/Services/UserOnCallShiftReminderLogService.ts +151 -0
- package/Server/Services/UserOnCallShiftReminderService.ts +112 -0
- package/Server/Utils/OnCall/CalendarFeedToken.ts +241 -0
- package/Server/Utils/OnCall/OnCallCalendarFeedRenderer.ts +1488 -0
- package/Server/Utils/OnCall/OnCallCalendarFeedUrls.ts +230 -0
- package/Server/Utils/OnCall/OnCallShiftChangeListeners.ts +227 -0
- package/Server/Utils/OnCall/OnCallShiftMaterializer.ts +1127 -0
- package/Server/Utils/OnCall/OnCallShiftReminderListener.ts +174 -0
- package/Server/Utils/OnCall/OnCallShiftReminderRunner.ts +2584 -0
- package/Server/Utils/Response.ts +134 -0
- package/Server/Utils/StartServer.ts +10 -0
- package/Server/Utils/Telemetry/AppMetrics.ts +51 -0
- package/Tests/App/Dashboard/OnCallCalendarFeedLinks.test.tsx +229 -0
- package/Tests/App/Dashboard/OnCallCalendarFeedPlanGate.test.tsx +489 -0
- package/Tests/App/Dashboard/OnCallCalendarFeedSideMenus.test.tsx +149 -0
- package/Tests/App/Dashboard/OnCallCalendarFeedUtil.test.ts +855 -0
- package/Tests/App/Dashboard/OnCallPersonalCalendarFeed.test.tsx +1209 -0
- package/Tests/App/Dashboard/OnCallSharedCalendarFeedCard.test.tsx +1019 -0
- package/Tests/App/Dashboard/OnCallShiftRemindersAndUpcomingShifts.test.tsx +655 -0
- package/Tests/App/Dashboard/UserSettingsSetupChecklistModel.test.ts +73 -0
- package/Tests/Models/OnCallCalendarFeedModels.test.ts +642 -0
- package/Tests/Models/OnCallDutyPolicyScheduleCalendarFeed.test.ts +288 -0
- package/Tests/Models/OnCallDutyPolicyScheduleShiftConfigVersion.test.ts +88 -0
- package/Tests/Models/UserOnCallShiftReminderModels.test.ts +368 -0
- package/Tests/Server/API/Helpers.ts +8 -0
- package/Tests/Server/API/OnCallCalendarAPI.test.ts +4461 -0
- package/Tests/Server/EnvironmentConfigOnCallCalendarFeed.test.ts +357 -0
- package/Tests/Server/Infrastructure/OnCallCalendarFeedCache.test.ts +1589 -0
- package/Tests/Server/Infrastructure/Postgres/AddOnCallCalendarFeedsMigration.test.ts +369 -0
- package/Tests/Server/Middleware/OnCallCalendarFeedRateLimit.test.ts +1365 -0
- package/Tests/Server/Services/FeedRetentionConsistency.test.ts +70 -0
- package/Tests/Server/Services/OnCallCalendarFeedServices.test.ts +1103 -0
- package/Tests/Server/Services/OnCallDutyPolicyScheduleResolver.test.ts +1037 -0
- package/Tests/Server/Services/OnCallShiftConfigPropagation.test.ts +1270 -0
- package/Tests/Server/Services/TeamDeleteMemberCleanup.test.ts +156 -0
- package/Tests/Server/Services/TeamMemberOnCallCleanup.test.ts +755 -0
- package/Tests/Server/Services/UserNotificationSettingShiftReminderDefaults.test.ts +267 -0
- package/Tests/Server/Services/UserOnCallShiftReminderServices.test.ts +583 -0
- package/Tests/Server/Types/Database/Permissions/OnCallCalendarFeedPermissions.test.ts +254 -0
- package/Tests/Server/Utils/OnCall/CalendarFeedToken.test.ts +467 -0
- package/Tests/Server/Utils/OnCall/OnCallCalendarFeedRenderer.test.ts +2142 -0
- package/Tests/Server/Utils/OnCall/OnCallCalendarFeedUrls.test.ts +278 -0
- package/Tests/Server/Utils/OnCall/OnCallResolverTestHarness.ts +440 -0
- package/Tests/Server/Utils/OnCall/OnCallShiftChangeListeners.test.ts +314 -0
- package/Tests/Server/Utils/OnCall/OnCallShiftMaterializer.test.ts +1502 -0
- package/Tests/Server/Utils/OnCall/OnCallShiftReminderListener.test.ts +491 -0
- package/Tests/Server/Utils/OnCall/OnCallShiftReminderRunner.test.ts +3088 -0
- package/Tests/Server/Utils/OnCall/OnCallShiftReminderTestHarness.ts +910 -0
- package/Tests/Server/Utils/ResponseSendCalendarResponse.test.ts +561 -0
- package/Tests/Server/Utils/StartServerEncryptionSecretWarning.test.ts +64 -0
- package/Tests/Server/Utils/Telemetry/AppMetrics.test.ts +29 -0
- package/Tests/Types/Calendar/ICalendar.test.ts +488 -0
- package/Tests/Types/NotificationSetting/NotificationSettingEventType.test.ts +53 -0
- package/Tests/Types/OnCallDutyPolicy/CalendarFeedTestFixtures.ts +310 -0
- package/Tests/Types/OnCallDutyPolicy/CalendarFeedWindow.test.ts +205 -0
- package/Tests/Types/OnCallDutyPolicy/LayerUtilLayerMetaAndIterationCap.test.ts +458 -0
- package/Tests/Types/OnCallDutyPolicy/MaterializedShift.test.ts +197 -0
- package/Tests/Types/OnCallDutyPolicy/OnCallCalendarFeedUtil.test.ts +1986 -0
- package/Tests/Types/OnCallDutyPolicy/ScheduleShiftUtilGroupKey.test.ts +678 -0
- package/Tests/Types/OnCallDutyPolicy/ShiftSeamUtil.test.ts +417 -0
- package/Tests/UI/Utils/Breadcrumb/fixtures/RealBreadcrumbTrails.ts +10 -0
- package/Tests/UI/Utils/Breadcrumb/fixtures/RealRoutePatterns.ts +2 -0
- package/Types/Calendar/ICalendar.ts +442 -0
- package/Types/Email/EmailTemplateType.ts +2 -0
- package/Types/NotificationSetting/NotificationSettingEventType.ts +4 -0
- package/Types/OnCallDutyPolicy/CalendarFeedWindow.ts +140 -0
- package/Types/OnCallDutyPolicy/Layer.ts +190 -35
- package/Types/OnCallDutyPolicy/MaterializedShift.ts +274 -0
- package/Types/OnCallDutyPolicy/OnCallCalendarFeedUtil.ts +1415 -0
- package/Types/OnCallDutyPolicy/ScheduleShiftUtil.ts +159 -4
- package/Types/OnCallDutyPolicy/ShiftSeamUtil.ts +106 -0
- package/build/dist/Models/DatabaseModels/Index.js +11 -0
- package/build/dist/Models/DatabaseModels/Index.js.map +1 -1
- package/build/dist/Models/DatabaseModels/OnCallDutyPolicySchedule.js +44 -0
- package/build/dist/Models/DatabaseModels/OnCallDutyPolicySchedule.js.map +1 -1
- package/build/dist/Models/DatabaseModels/OnCallDutyPolicyScheduleCalendarFeed.js +699 -0
- package/build/dist/Models/DatabaseModels/OnCallDutyPolicyScheduleCalendarFeed.js.map +1 -0
- package/build/dist/Models/DatabaseModels/ProjectOnCallCalendarFeed.js +620 -0
- package/build/dist/Models/DatabaseModels/ProjectOnCallCalendarFeed.js.map +1 -0
- package/build/dist/Models/DatabaseModels/UserOnCallCalendarFeed.js +585 -0
- package/build/dist/Models/DatabaseModels/UserOnCallCalendarFeed.js.map +1 -0
- package/build/dist/Models/DatabaseModels/UserOnCallShiftReminder.js +247 -0
- package/build/dist/Models/DatabaseModels/UserOnCallShiftReminder.js.map +1 -0
- package/build/dist/Models/DatabaseModels/UserOnCallShiftReminderLog.js +355 -0
- package/build/dist/Models/DatabaseModels/UserOnCallShiftReminderLog.js.map +1 -0
- package/build/dist/Server/API/OnCallCalendarAPI.js +1371 -0
- package/build/dist/Server/API/OnCallCalendarAPI.js.map +1 -0
- package/build/dist/Server/EnvironmentConfig.js +102 -0
- package/build/dist/Server/EnvironmentConfig.js.map +1 -1
- package/build/dist/Server/Infrastructure/OnCallCalendarFeedCache.js +663 -0
- package/build/dist/Server/Infrastructure/OnCallCalendarFeedCache.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1790400000000-AddOnCallCalendarFeeds.js +103 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1790400000000-AddOnCallCalendarFeeds.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/OnCallCalendarFeedRateLimit.js +342 -0
- package/build/dist/Server/Middleware/OnCallCalendarFeedRateLimit.js.map +1 -0
- package/build/dist/Server/Services/Index.js +12 -0
- package/build/dist/Server/Services/Index.js.map +1 -1
- package/build/dist/Server/Services/OnCallDutyPolicyEscalationRuleScheduleService.js +20 -0
- package/build/dist/Server/Services/OnCallDutyPolicyEscalationRuleScheduleService.js.map +1 -1
- package/build/dist/Server/Services/OnCallDutyPolicyScheduleCalendarFeedService.js +219 -0
- package/build/dist/Server/Services/OnCallDutyPolicyScheduleCalendarFeedService.js.map +1 -0
- package/build/dist/Server/Services/OnCallDutyPolicyScheduleLayerService.js +47 -3
- package/build/dist/Server/Services/OnCallDutyPolicyScheduleLayerService.js.map +1 -1
- package/build/dist/Server/Services/OnCallDutyPolicyScheduleLayerUserService.js +112 -3
- package/build/dist/Server/Services/OnCallDutyPolicyScheduleLayerUserService.js.map +1 -1
- package/build/dist/Server/Services/OnCallDutyPolicyScheduleService.js +955 -9
- package/build/dist/Server/Services/OnCallDutyPolicyScheduleService.js.map +1 -1
- package/build/dist/Server/Services/OnCallDutyPolicyUserOverrideService.js +93 -6
- package/build/dist/Server/Services/OnCallDutyPolicyUserOverrideService.js.map +1 -1
- package/build/dist/Server/Services/ProjectOnCallCalendarFeedService.js +157 -0
- package/build/dist/Server/Services/ProjectOnCallCalendarFeedService.js.map +1 -0
- package/build/dist/Server/Services/TeamMemberService.js +396 -1
- package/build/dist/Server/Services/TeamMemberService.js.map +1 -1
- package/build/dist/Server/Services/TeamService.js +43 -0
- package/build/dist/Server/Services/TeamService.js.map +1 -1
- package/build/dist/Server/Services/UserNotificationSettingService.js +26 -1
- package/build/dist/Server/Services/UserNotificationSettingService.js.map +1 -1
- package/build/dist/Server/Services/UserOnCallCalendarFeedService.js +140 -0
- package/build/dist/Server/Services/UserOnCallCalendarFeedService.js.map +1 -0
- package/build/dist/Server/Services/UserOnCallShiftReminderLogService.js +116 -0
- package/build/dist/Server/Services/UserOnCallShiftReminderLogService.js.map +1 -0
- package/build/dist/Server/Services/UserOnCallShiftReminderService.js +92 -0
- package/build/dist/Server/Services/UserOnCallShiftReminderService.js.map +1 -0
- package/build/dist/Server/Utils/OnCall/CalendarFeedToken.js +161 -0
- package/build/dist/Server/Utils/OnCall/CalendarFeedToken.js.map +1 -0
- package/build/dist/Server/Utils/OnCall/OnCallCalendarFeedRenderer.js +983 -0
- package/build/dist/Server/Utils/OnCall/OnCallCalendarFeedRenderer.js.map +1 -0
- package/build/dist/Server/Utils/OnCall/OnCallCalendarFeedUrls.js +155 -0
- package/build/dist/Server/Utils/OnCall/OnCallCalendarFeedUrls.js.map +1 -0
- package/build/dist/Server/Utils/OnCall/OnCallShiftChangeListeners.js +145 -0
- package/build/dist/Server/Utils/OnCall/OnCallShiftChangeListeners.js.map +1 -0
- package/build/dist/Server/Utils/OnCall/OnCallShiftMaterializer.js +752 -0
- package/build/dist/Server/Utils/OnCall/OnCallShiftMaterializer.js.map +1 -0
- package/build/dist/Server/Utils/OnCall/OnCallShiftReminderListener.js +92 -0
- package/build/dist/Server/Utils/OnCall/OnCallShiftReminderListener.js.map +1 -0
- package/build/dist/Server/Utils/OnCall/OnCallShiftReminderRunner.js +1786 -0
- package/build/dist/Server/Utils/OnCall/OnCallShiftReminderRunner.js.map +1 -0
- package/build/dist/Server/Utils/Response.js +97 -0
- package/build/dist/Server/Utils/Response.js.map +1 -1
- package/build/dist/Server/Utils/StartServer.js +9 -1
- package/build/dist/Server/Utils/StartServer.js.map +1 -1
- package/build/dist/Server/Utils/Telemetry/AppMetrics.js +41 -0
- package/build/dist/Server/Utils/Telemetry/AppMetrics.js.map +1 -1
- package/build/dist/Types/Calendar/ICalendar.js +290 -0
- package/build/dist/Types/Calendar/ICalendar.js.map +1 -0
- package/build/dist/Types/Email/EmailTemplateType.js +2 -0
- package/build/dist/Types/Email/EmailTemplateType.js.map +1 -1
- package/build/dist/Types/NotificationSetting/NotificationSettingEventType.js +3 -0
- package/build/dist/Types/NotificationSetting/NotificationSettingEventType.js.map +1 -1
- package/build/dist/Types/OnCallDutyPolicy/CalendarFeedWindow.js +97 -0
- package/build/dist/Types/OnCallDutyPolicy/CalendarFeedWindow.js.map +1 -0
- package/build/dist/Types/OnCallDutyPolicy/Layer.js +113 -19
- package/build/dist/Types/OnCallDutyPolicy/Layer.js.map +1 -1
- package/build/dist/Types/OnCallDutyPolicy/MaterializedShift.js +134 -0
- package/build/dist/Types/OnCallDutyPolicy/MaterializedShift.js.map +1 -0
- package/build/dist/Types/OnCallDutyPolicy/OnCallCalendarFeedUtil.js +800 -0
- package/build/dist/Types/OnCallDutyPolicy/OnCallCalendarFeedUtil.js.map +1 -0
- package/build/dist/Types/OnCallDutyPolicy/ScheduleShiftUtil.js +97 -3
- package/build/dist/Types/OnCallDutyPolicy/ScheduleShiftUtil.js.map +1 -1
- package/build/dist/Types/OnCallDutyPolicy/ShiftSeamUtil.js +77 -0
- package/build/dist/Types/OnCallDutyPolicy/ShiftSeamUtil.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,584 @@
|
|
|
1
|
+
import Project from "./Project";
|
|
2
|
+
import User from "./User";
|
|
3
|
+
import BaseModel from "./DatabaseBaseModel/DatabaseBaseModel";
|
|
4
|
+
import Route from "../../Types/API/Route";
|
|
5
|
+
import { PlanType } from "../../Types/Billing/SubscriptionPlan";
|
|
6
|
+
import AllowAccessIfSubscriptionIsUnpaid from "../../Types/Database/AccessControl/AllowAccessIfSubscriptionIsUnpaid";
|
|
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 ColumnLength from "../../Types/Database/ColumnLength";
|
|
11
|
+
import ColumnType from "../../Types/Database/ColumnType";
|
|
12
|
+
import CrudApiEndpoint from "../../Types/Database/CrudApiEndpoint";
|
|
13
|
+
import TableColumn from "../../Types/Database/TableColumn";
|
|
14
|
+
import TableColumnType from "../../Types/Database/TableColumnType";
|
|
15
|
+
import TableMetadata from "../../Types/Database/TableMetadata";
|
|
16
|
+
import TenantColumn from "../../Types/Database/TenantColumn";
|
|
17
|
+
import IconProp from "../../Types/Icon/IconProp";
|
|
18
|
+
import ObjectID from "../../Types/ObjectID";
|
|
19
|
+
import Permission from "../../Types/Permission";
|
|
20
|
+
import { Column, Entity, Index, JoinColumn, ManyToOne } from "typeorm";
|
|
21
|
+
|
|
22
|
+
/*
|
|
23
|
+
* The project-wide shared calendar feed: the capability token behind
|
|
24
|
+
* `GET /on-call-calendar/project/:token/project.ics`, which renders
|
|
25
|
+
* everybody's shifts on EVERY schedule in the project (plus opt-in
|
|
26
|
+
* coverage-gap events).
|
|
27
|
+
*
|
|
28
|
+
* Identical in shape and access to OnCallDutyPolicyScheduleCalendarFeed minus
|
|
29
|
+
* the schedule relation: one row per project (projectId is UNIQUE), the four
|
|
30
|
+
* table access lists copied verbatim from OnCallDutyPolicySchedule, tokens
|
|
31
|
+
* minted only by the service and never readable through CRUD. No
|
|
32
|
+
* @CanAccessIfCanReadOn - there is no single parent row to scope by.
|
|
33
|
+
*/
|
|
34
|
+
const createPermissions: Array<Permission> = [
|
|
35
|
+
Permission.ProjectOwner,
|
|
36
|
+
Permission.ProjectAdmin,
|
|
37
|
+
Permission.ProjectMember,
|
|
38
|
+
Permission.OnCallAdmin,
|
|
39
|
+
Permission.OnCallMember,
|
|
40
|
+
Permission.CreateProjectOnCallDutyPolicySchedule,
|
|
41
|
+
];
|
|
42
|
+
|
|
43
|
+
const readPermissions: Array<Permission> = [
|
|
44
|
+
Permission.ProjectOwner,
|
|
45
|
+
Permission.ProjectAdmin,
|
|
46
|
+
Permission.ProjectMember,
|
|
47
|
+
Permission.Viewer,
|
|
48
|
+
Permission.OnCallAdmin,
|
|
49
|
+
Permission.OnCallMember,
|
|
50
|
+
Permission.OnCallViewer,
|
|
51
|
+
Permission.ReadProjectOnCallDutyPolicySchedule,
|
|
52
|
+
];
|
|
53
|
+
|
|
54
|
+
const updatePermissions: Array<Permission> = [
|
|
55
|
+
Permission.ProjectOwner,
|
|
56
|
+
Permission.ProjectAdmin,
|
|
57
|
+
Permission.ProjectMember,
|
|
58
|
+
Permission.OnCallAdmin,
|
|
59
|
+
Permission.OnCallMember,
|
|
60
|
+
Permission.EditProjectOnCallDutyPolicySchedule,
|
|
61
|
+
];
|
|
62
|
+
|
|
63
|
+
@TableBillingAccessControl({
|
|
64
|
+
create: PlanType.Growth,
|
|
65
|
+
read: PlanType.Growth,
|
|
66
|
+
update: PlanType.Growth,
|
|
67
|
+
delete: PlanType.Growth,
|
|
68
|
+
})
|
|
69
|
+
@TenantColumn("projectId")
|
|
70
|
+
@AllowAccessIfSubscriptionIsUnpaid()
|
|
71
|
+
@TableAccessControl({
|
|
72
|
+
create: [
|
|
73
|
+
Permission.ProjectOwner,
|
|
74
|
+
Permission.ProjectAdmin,
|
|
75
|
+
Permission.ProjectMember,
|
|
76
|
+
Permission.OnCallAdmin,
|
|
77
|
+
Permission.OnCallMember,
|
|
78
|
+
Permission.CreateProjectOnCallDutyPolicySchedule,
|
|
79
|
+
],
|
|
80
|
+
read: [
|
|
81
|
+
Permission.ProjectOwner,
|
|
82
|
+
Permission.ProjectAdmin,
|
|
83
|
+
Permission.ProjectMember,
|
|
84
|
+
Permission.Viewer,
|
|
85
|
+
Permission.OnCallAdmin,
|
|
86
|
+
Permission.OnCallMember,
|
|
87
|
+
Permission.OnCallViewer,
|
|
88
|
+
Permission.ReadProjectOnCallDutyPolicySchedule,
|
|
89
|
+
],
|
|
90
|
+
delete: [
|
|
91
|
+
Permission.ProjectOwner,
|
|
92
|
+
Permission.ProjectAdmin,
|
|
93
|
+
Permission.ProjectMember,
|
|
94
|
+
Permission.OnCallAdmin,
|
|
95
|
+
Permission.OnCallMember,
|
|
96
|
+
Permission.DeleteProjectOnCallDutyPolicySchedule,
|
|
97
|
+
],
|
|
98
|
+
update: [
|
|
99
|
+
Permission.ProjectOwner,
|
|
100
|
+
Permission.ProjectAdmin,
|
|
101
|
+
Permission.ProjectMember,
|
|
102
|
+
Permission.OnCallAdmin,
|
|
103
|
+
Permission.OnCallMember,
|
|
104
|
+
Permission.EditProjectOnCallDutyPolicySchedule,
|
|
105
|
+
],
|
|
106
|
+
})
|
|
107
|
+
@CrudApiEndpoint(new Route("/project-on-call-calendar-feed"))
|
|
108
|
+
@Entity({
|
|
109
|
+
name: "ProjectOnCallCalendarFeed",
|
|
110
|
+
})
|
|
111
|
+
@TableMetadata({
|
|
112
|
+
tableName: "ProjectOnCallCalendarFeed",
|
|
113
|
+
singularName: "Project On-Call Calendar Feed",
|
|
114
|
+
pluralName: "Project On-Call Calendar Feeds",
|
|
115
|
+
icon: IconProp.Calendar,
|
|
116
|
+
tableDescription:
|
|
117
|
+
"A shared calendar-subscription link that renders everybody's shifts on every on-call schedule in the project.",
|
|
118
|
+
})
|
|
119
|
+
@Index(["projectId"], { unique: true })
|
|
120
|
+
export default class ProjectOnCallCalendarFeed extends BaseModel {
|
|
121
|
+
@ColumnAccessControl({
|
|
122
|
+
create: createPermissions,
|
|
123
|
+
read: readPermissions,
|
|
124
|
+
update: [],
|
|
125
|
+
})
|
|
126
|
+
@TableColumn({
|
|
127
|
+
manyToOneRelationColumn: "projectId",
|
|
128
|
+
type: TableColumnType.Entity,
|
|
129
|
+
modelType: Project,
|
|
130
|
+
title: "Project",
|
|
131
|
+
description: "Relation to Project Resource in which this object belongs",
|
|
132
|
+
example: "5f8b9c0d-e1a2-4b3c-8d5e-6f7a8b9c0d1e",
|
|
133
|
+
})
|
|
134
|
+
@ManyToOne(
|
|
135
|
+
() => {
|
|
136
|
+
return Project;
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
eager: false,
|
|
140
|
+
nullable: true,
|
|
141
|
+
onDelete: "CASCADE",
|
|
142
|
+
orphanedRowAction: "nullify",
|
|
143
|
+
},
|
|
144
|
+
)
|
|
145
|
+
@JoinColumn({ name: "projectId" })
|
|
146
|
+
public project?: Project = undefined;
|
|
147
|
+
|
|
148
|
+
@ColumnAccessControl({
|
|
149
|
+
create: createPermissions,
|
|
150
|
+
read: readPermissions,
|
|
151
|
+
update: [],
|
|
152
|
+
})
|
|
153
|
+
@TableColumn({
|
|
154
|
+
type: TableColumnType.ObjectID,
|
|
155
|
+
required: true,
|
|
156
|
+
canReadOnRelationQuery: true,
|
|
157
|
+
title: "Project ID",
|
|
158
|
+
description: "ID of your OneUptime Project in which this object belongs",
|
|
159
|
+
example: "5f8b9c0d-e1a2-4b3c-8d5e-6f7a8b9c0d1e",
|
|
160
|
+
})
|
|
161
|
+
@Column({
|
|
162
|
+
type: ColumnType.ObjectID,
|
|
163
|
+
nullable: false,
|
|
164
|
+
transformer: ObjectID.getDatabaseTransformer(),
|
|
165
|
+
})
|
|
166
|
+
public projectId?: ObjectID = undefined;
|
|
167
|
+
|
|
168
|
+
@ColumnAccessControl({
|
|
169
|
+
create: [],
|
|
170
|
+
read: [],
|
|
171
|
+
update: [],
|
|
172
|
+
})
|
|
173
|
+
@TableColumn({
|
|
174
|
+
type: TableColumnType.ShortText,
|
|
175
|
+
required: true,
|
|
176
|
+
computed: true,
|
|
177
|
+
canReadOnRelationQuery: false,
|
|
178
|
+
title: "Token Hash",
|
|
179
|
+
description: "SHA-256 digest of the feed token; the lookup key",
|
|
180
|
+
hideColumnInDocumentation: true,
|
|
181
|
+
})
|
|
182
|
+
@Column({
|
|
183
|
+
type: ColumnType.ShortText,
|
|
184
|
+
length: ColumnLength.ShortText,
|
|
185
|
+
nullable: false,
|
|
186
|
+
unique: true,
|
|
187
|
+
})
|
|
188
|
+
public tokenHash?: string = undefined;
|
|
189
|
+
|
|
190
|
+
@ColumnAccessControl({
|
|
191
|
+
create: [],
|
|
192
|
+
read: [],
|
|
193
|
+
update: [],
|
|
194
|
+
})
|
|
195
|
+
@TableColumn({
|
|
196
|
+
type: TableColumnType.VeryLongText,
|
|
197
|
+
computed: true,
|
|
198
|
+
encrypted: true,
|
|
199
|
+
canReadOnRelationQuery: false,
|
|
200
|
+
title: "Token",
|
|
201
|
+
description: "Encrypted feed token, re-displayed only to schedule readers",
|
|
202
|
+
hideColumnInDocumentation: true,
|
|
203
|
+
})
|
|
204
|
+
@Column({
|
|
205
|
+
type: ColumnType.VeryLongText,
|
|
206
|
+
nullable: true,
|
|
207
|
+
})
|
|
208
|
+
public token?: string = undefined;
|
|
209
|
+
|
|
210
|
+
@ColumnAccessControl({
|
|
211
|
+
create: [],
|
|
212
|
+
read: [],
|
|
213
|
+
update: [],
|
|
214
|
+
})
|
|
215
|
+
@Index()
|
|
216
|
+
@TableColumn({
|
|
217
|
+
type: TableColumnType.ShortText,
|
|
218
|
+
computed: true,
|
|
219
|
+
canReadOnRelationQuery: false,
|
|
220
|
+
title: "Previous Token Hash",
|
|
221
|
+
description: "Digest of the rotated-out token, honoured with an empty feed",
|
|
222
|
+
hideColumnInDocumentation: true,
|
|
223
|
+
})
|
|
224
|
+
@Column({
|
|
225
|
+
type: ColumnType.ShortText,
|
|
226
|
+
length: ColumnLength.ShortText,
|
|
227
|
+
nullable: true,
|
|
228
|
+
})
|
|
229
|
+
public previousTokenHash?: string = undefined;
|
|
230
|
+
|
|
231
|
+
@ColumnAccessControl({
|
|
232
|
+
create: [],
|
|
233
|
+
read: [],
|
|
234
|
+
update: [],
|
|
235
|
+
})
|
|
236
|
+
@TableColumn({
|
|
237
|
+
type: TableColumnType.Date,
|
|
238
|
+
computed: true,
|
|
239
|
+
canReadOnRelationQuery: false,
|
|
240
|
+
title: "Previous Token Expires At",
|
|
241
|
+
description: "When the rotated-out token stops being honoured",
|
|
242
|
+
hideColumnInDocumentation: true,
|
|
243
|
+
})
|
|
244
|
+
@Column({
|
|
245
|
+
type: ColumnType.Date,
|
|
246
|
+
nullable: true,
|
|
247
|
+
})
|
|
248
|
+
public previousTokenExpiresAt?: Date = undefined;
|
|
249
|
+
|
|
250
|
+
@ColumnAccessControl({
|
|
251
|
+
create: [],
|
|
252
|
+
read: readPermissions,
|
|
253
|
+
update: [],
|
|
254
|
+
})
|
|
255
|
+
@TableColumn({
|
|
256
|
+
type: TableColumnType.ShortText,
|
|
257
|
+
computed: true,
|
|
258
|
+
canReadOnRelationQuery: false,
|
|
259
|
+
title: "Token Hint",
|
|
260
|
+
description: "Last four characters of the feed token, for display",
|
|
261
|
+
example: "k3Qx",
|
|
262
|
+
})
|
|
263
|
+
@Column({
|
|
264
|
+
type: ColumnType.ShortText,
|
|
265
|
+
length: ColumnLength.ShortText,
|
|
266
|
+
nullable: true,
|
|
267
|
+
})
|
|
268
|
+
public tokenHint?: string = undefined;
|
|
269
|
+
|
|
270
|
+
@ColumnAccessControl({
|
|
271
|
+
create: createPermissions,
|
|
272
|
+
read: readPermissions,
|
|
273
|
+
update: updatePermissions,
|
|
274
|
+
})
|
|
275
|
+
@TableColumn({
|
|
276
|
+
isDefaultValueColumn: true,
|
|
277
|
+
type: TableColumnType.Boolean,
|
|
278
|
+
defaultValue: true,
|
|
279
|
+
title: "Enabled",
|
|
280
|
+
description:
|
|
281
|
+
"When off, the link keeps working but serves an empty calendar so subscribed apps clear their copy.",
|
|
282
|
+
example: true,
|
|
283
|
+
})
|
|
284
|
+
@Column({
|
|
285
|
+
type: ColumnType.Boolean,
|
|
286
|
+
default: true,
|
|
287
|
+
nullable: false,
|
|
288
|
+
})
|
|
289
|
+
public isEnabled?: boolean = undefined;
|
|
290
|
+
|
|
291
|
+
@ColumnAccessControl({
|
|
292
|
+
create: createPermissions,
|
|
293
|
+
read: readPermissions,
|
|
294
|
+
update: updatePermissions,
|
|
295
|
+
})
|
|
296
|
+
@TableColumn({
|
|
297
|
+
isDefaultValueColumn: true,
|
|
298
|
+
type: TableColumnType.Boolean,
|
|
299
|
+
defaultValue: false,
|
|
300
|
+
title: "Include Coverage Gaps",
|
|
301
|
+
description:
|
|
302
|
+
"Emit a 'No coverage' event where a schedule's layers intended coverage but nobody is on call.",
|
|
303
|
+
example: false,
|
|
304
|
+
})
|
|
305
|
+
@Column({
|
|
306
|
+
type: ColumnType.Boolean,
|
|
307
|
+
default: false,
|
|
308
|
+
nullable: false,
|
|
309
|
+
})
|
|
310
|
+
public includeCoverageGaps?: boolean = undefined;
|
|
311
|
+
|
|
312
|
+
@ColumnAccessControl({
|
|
313
|
+
create: createPermissions,
|
|
314
|
+
read: readPermissions,
|
|
315
|
+
update: updatePermissions,
|
|
316
|
+
})
|
|
317
|
+
@TableColumn({
|
|
318
|
+
isDefaultValueColumn: true,
|
|
319
|
+
type: TableColumnType.Number,
|
|
320
|
+
defaultValue: 60,
|
|
321
|
+
title: "Minimum Gap Minutes",
|
|
322
|
+
description:
|
|
323
|
+
"Coverage gaps shorter than this many minutes are not emitted as events.",
|
|
324
|
+
example: 60,
|
|
325
|
+
})
|
|
326
|
+
@Column({
|
|
327
|
+
type: ColumnType.Number,
|
|
328
|
+
default: 60,
|
|
329
|
+
nullable: false,
|
|
330
|
+
})
|
|
331
|
+
public minimumGapMinutes?: number = undefined;
|
|
332
|
+
|
|
333
|
+
@ColumnAccessControl({
|
|
334
|
+
create: createPermissions,
|
|
335
|
+
read: readPermissions,
|
|
336
|
+
update: updatePermissions,
|
|
337
|
+
})
|
|
338
|
+
@TableColumn({
|
|
339
|
+
isDefaultValueColumn: true,
|
|
340
|
+
type: TableColumnType.Number,
|
|
341
|
+
defaultValue: 2,
|
|
342
|
+
title: "Past Days",
|
|
343
|
+
description:
|
|
344
|
+
"How many days of past shifts the feed includes. Past shifts reflect the current rotation, not who was actually paged.",
|
|
345
|
+
example: 2,
|
|
346
|
+
})
|
|
347
|
+
@Column({
|
|
348
|
+
type: ColumnType.Number,
|
|
349
|
+
default: 2,
|
|
350
|
+
nullable: false,
|
|
351
|
+
})
|
|
352
|
+
public pastDays?: number = undefined;
|
|
353
|
+
|
|
354
|
+
@ColumnAccessControl({
|
|
355
|
+
create: createPermissions,
|
|
356
|
+
read: readPermissions,
|
|
357
|
+
update: updatePermissions,
|
|
358
|
+
})
|
|
359
|
+
@TableColumn({
|
|
360
|
+
isDefaultValueColumn: true,
|
|
361
|
+
type: TableColumnType.Number,
|
|
362
|
+
defaultValue: 90,
|
|
363
|
+
title: "Future Days",
|
|
364
|
+
description: "How many days of upcoming shifts the feed includes.",
|
|
365
|
+
example: 90,
|
|
366
|
+
})
|
|
367
|
+
@Column({
|
|
368
|
+
type: ColumnType.Number,
|
|
369
|
+
default: 90,
|
|
370
|
+
nullable: false,
|
|
371
|
+
})
|
|
372
|
+
public futureDays?: number = undefined;
|
|
373
|
+
|
|
374
|
+
@ColumnAccessControl({
|
|
375
|
+
create: createPermissions,
|
|
376
|
+
read: readPermissions,
|
|
377
|
+
update: updatePermissions,
|
|
378
|
+
})
|
|
379
|
+
@TableColumn({
|
|
380
|
+
isDefaultValueColumn: true,
|
|
381
|
+
type: TableColumnType.Boolean,
|
|
382
|
+
defaultValue: false,
|
|
383
|
+
title: "Rotate When Member Leaves",
|
|
384
|
+
description:
|
|
385
|
+
"Automatically regenerate this link whenever a user leaves the project.",
|
|
386
|
+
example: false,
|
|
387
|
+
})
|
|
388
|
+
@Column({
|
|
389
|
+
type: ColumnType.Boolean,
|
|
390
|
+
default: false,
|
|
391
|
+
nullable: false,
|
|
392
|
+
})
|
|
393
|
+
public rotateWhenMemberLeaves?: boolean = undefined;
|
|
394
|
+
|
|
395
|
+
@ColumnAccessControl({
|
|
396
|
+
create: [],
|
|
397
|
+
read: readPermissions,
|
|
398
|
+
update: [],
|
|
399
|
+
})
|
|
400
|
+
@TableColumn({
|
|
401
|
+
type: TableColumnType.Date,
|
|
402
|
+
computed: true,
|
|
403
|
+
title: "Rotated At",
|
|
404
|
+
description: "When the current token was minted",
|
|
405
|
+
})
|
|
406
|
+
@Column({
|
|
407
|
+
type: ColumnType.Date,
|
|
408
|
+
nullable: true,
|
|
409
|
+
})
|
|
410
|
+
public rotatedAt?: Date = undefined;
|
|
411
|
+
|
|
412
|
+
@ColumnAccessControl({
|
|
413
|
+
create: [],
|
|
414
|
+
read: readPermissions,
|
|
415
|
+
update: [],
|
|
416
|
+
})
|
|
417
|
+
@TableColumn({
|
|
418
|
+
type: TableColumnType.Date,
|
|
419
|
+
computed: true,
|
|
420
|
+
title: "Last Fetched At",
|
|
421
|
+
description: "When a calendar client last fetched this feed",
|
|
422
|
+
})
|
|
423
|
+
@Column({
|
|
424
|
+
type: ColumnType.Date,
|
|
425
|
+
nullable: true,
|
|
426
|
+
})
|
|
427
|
+
public lastFetchedAt?: Date = undefined;
|
|
428
|
+
|
|
429
|
+
@ColumnAccessControl({
|
|
430
|
+
create: [],
|
|
431
|
+
read: readPermissions,
|
|
432
|
+
update: [],
|
|
433
|
+
})
|
|
434
|
+
@TableColumn({
|
|
435
|
+
type: TableColumnType.ShortText,
|
|
436
|
+
computed: true,
|
|
437
|
+
title: "Last Fetched Client",
|
|
438
|
+
description:
|
|
439
|
+
"Coarse family of the calendar client that last fetched this feed (for example Google Calendar)",
|
|
440
|
+
example: "Google Calendar",
|
|
441
|
+
})
|
|
442
|
+
@Column({
|
|
443
|
+
type: ColumnType.ShortText,
|
|
444
|
+
length: ColumnLength.ShortText,
|
|
445
|
+
nullable: true,
|
|
446
|
+
})
|
|
447
|
+
public lastFetchedClient?: string = undefined;
|
|
448
|
+
|
|
449
|
+
@ColumnAccessControl({
|
|
450
|
+
create: [],
|
|
451
|
+
read: readPermissions,
|
|
452
|
+
update: [],
|
|
453
|
+
})
|
|
454
|
+
@TableColumn({
|
|
455
|
+
isDefaultValueColumn: true,
|
|
456
|
+
type: TableColumnType.Number,
|
|
457
|
+
defaultValue: 0,
|
|
458
|
+
computed: true,
|
|
459
|
+
title: "Fetch Count",
|
|
460
|
+
description: "Approximate number of times this feed has been fetched",
|
|
461
|
+
example: 143,
|
|
462
|
+
})
|
|
463
|
+
@Column({
|
|
464
|
+
type: ColumnType.Number,
|
|
465
|
+
default: 0,
|
|
466
|
+
nullable: false,
|
|
467
|
+
})
|
|
468
|
+
public fetchCount?: number = undefined;
|
|
469
|
+
|
|
470
|
+
@ColumnAccessControl({
|
|
471
|
+
create: [],
|
|
472
|
+
read: readPermissions,
|
|
473
|
+
update: [],
|
|
474
|
+
})
|
|
475
|
+
@TableColumn({
|
|
476
|
+
isDefaultValueColumn: true,
|
|
477
|
+
type: TableColumnType.Boolean,
|
|
478
|
+
defaultValue: false,
|
|
479
|
+
computed: true,
|
|
480
|
+
title: "Last Render Truncated",
|
|
481
|
+
description:
|
|
482
|
+
"Whether the last render had to shrink the window or stop early to stay within limits",
|
|
483
|
+
example: false,
|
|
484
|
+
})
|
|
485
|
+
@Column({
|
|
486
|
+
type: ColumnType.Boolean,
|
|
487
|
+
default: false,
|
|
488
|
+
nullable: false,
|
|
489
|
+
})
|
|
490
|
+
public lastRenderTruncated?: boolean = undefined;
|
|
491
|
+
|
|
492
|
+
@ColumnAccessControl({
|
|
493
|
+
create: createPermissions,
|
|
494
|
+
read: readPermissions,
|
|
495
|
+
update: [],
|
|
496
|
+
})
|
|
497
|
+
@TableColumn({
|
|
498
|
+
manyToOneRelationColumn: "createdByUserId",
|
|
499
|
+
type: TableColumnType.Entity,
|
|
500
|
+
modelType: User,
|
|
501
|
+
title: "Created by User",
|
|
502
|
+
description:
|
|
503
|
+
"Relation to User who created this object (if this object was created by a User)",
|
|
504
|
+
})
|
|
505
|
+
@ManyToOne(
|
|
506
|
+
() => {
|
|
507
|
+
return User;
|
|
508
|
+
},
|
|
509
|
+
{
|
|
510
|
+
eager: false,
|
|
511
|
+
nullable: true,
|
|
512
|
+
onDelete: "SET NULL",
|
|
513
|
+
orphanedRowAction: "nullify",
|
|
514
|
+
},
|
|
515
|
+
)
|
|
516
|
+
@JoinColumn({ name: "createdByUserId" })
|
|
517
|
+
public createdByUser?: User = undefined;
|
|
518
|
+
|
|
519
|
+
@ColumnAccessControl({
|
|
520
|
+
create: createPermissions,
|
|
521
|
+
read: readPermissions,
|
|
522
|
+
update: [],
|
|
523
|
+
})
|
|
524
|
+
@TableColumn({
|
|
525
|
+
type: TableColumnType.ObjectID,
|
|
526
|
+
title: "Created by User ID",
|
|
527
|
+
description:
|
|
528
|
+
"User ID who created this object (if this object was created by a User)",
|
|
529
|
+
example: "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
|
|
530
|
+
})
|
|
531
|
+
@Column({
|
|
532
|
+
type: ColumnType.ObjectID,
|
|
533
|
+
nullable: true,
|
|
534
|
+
transformer: ObjectID.getDatabaseTransformer(),
|
|
535
|
+
})
|
|
536
|
+
public createdByUserId?: ObjectID = undefined;
|
|
537
|
+
|
|
538
|
+
@ColumnAccessControl({
|
|
539
|
+
create: [],
|
|
540
|
+
read: [],
|
|
541
|
+
update: [],
|
|
542
|
+
})
|
|
543
|
+
@TableColumn({
|
|
544
|
+
manyToOneRelationColumn: "deletedByUserId",
|
|
545
|
+
type: TableColumnType.Entity,
|
|
546
|
+
title: "Deleted by User",
|
|
547
|
+
modelType: User,
|
|
548
|
+
description:
|
|
549
|
+
"Relation to User who deleted this object (if this object was deleted by a User)",
|
|
550
|
+
})
|
|
551
|
+
@ManyToOne(
|
|
552
|
+
() => {
|
|
553
|
+
return User;
|
|
554
|
+
},
|
|
555
|
+
{
|
|
556
|
+
cascade: false,
|
|
557
|
+
eager: false,
|
|
558
|
+
nullable: true,
|
|
559
|
+
onDelete: "SET NULL",
|
|
560
|
+
orphanedRowAction: "nullify",
|
|
561
|
+
},
|
|
562
|
+
)
|
|
563
|
+
@JoinColumn({ name: "deletedByUserId" })
|
|
564
|
+
public deletedByUser?: User = undefined;
|
|
565
|
+
|
|
566
|
+
@ColumnAccessControl({
|
|
567
|
+
create: [],
|
|
568
|
+
read: [],
|
|
569
|
+
update: [],
|
|
570
|
+
})
|
|
571
|
+
@TableColumn({
|
|
572
|
+
type: TableColumnType.ObjectID,
|
|
573
|
+
title: "Deleted by User ID",
|
|
574
|
+
description:
|
|
575
|
+
"User ID who deleted this object (if this object was deleted by a User)",
|
|
576
|
+
example: "b2c3d4e5-f6a7-8901-bcde-f12345678901",
|
|
577
|
+
})
|
|
578
|
+
@Column({
|
|
579
|
+
type: ColumnType.ObjectID,
|
|
580
|
+
nullable: true,
|
|
581
|
+
transformer: ObjectID.getDatabaseTransformer(),
|
|
582
|
+
})
|
|
583
|
+
public deletedByUserId?: ObjectID = undefined;
|
|
584
|
+
}
|