@oneuptime/common 14.0.7 → 14.0.8
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/Incident.ts +267 -1
- package/Models/DatabaseModels/IncidentCustomField.ts +202 -0
- package/Models/DatabaseModels/IncidentEpisode.ts +30 -0
- package/Models/DatabaseModels/IncidentTemplate.ts +126 -1
- package/Models/DatabaseModels/StatusPage.ts +55 -0
- package/Models/DatabaseModels/StatusPageSubscriber.ts +128 -0
- package/Server/API/IncidentAPI.ts +162 -0
- package/Server/API/StatusPageAPI.ts +487 -171
- package/Server/API/StatusPageSubscriberAPI.ts +63 -15
- package/Server/Infrastructure/Postgres/SchemaMigrations/1795300000000-SkipHiddenIncidentCreatedNotifications.ts +49 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1795400000000-AddIncidentStatusPageScope.ts +108 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1795500000000-AddIncidentTemplateStatusPageScopeFlag.ts +33 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1795600000000-AddStatusPageSubscriberUnsubscribeToken.ts +51 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1795700000000-AddStatusPageSubscriberIsAddedByTeam.ts +33 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1795800000000-AddIncidentCustomFieldCreateAndNotificationSettings.ts +168 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1795900000000-AddSubscriberNotificationClaimedAt.ts +44 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts +14 -0
- package/Server/Infrastructure/Semaphore.ts +10 -0
- package/Server/Middleware/IdentityRateLimit.ts +108 -3
- package/Server/Middleware/SubscriberNotificationPreviewRateLimit.ts +237 -0
- package/Server/Middleware/SubscriberNotificationTestSendRateLimit.ts +304 -0
- package/Server/Services/DatabaseService.ts +93 -10
- package/Server/Services/IncidentCustomFieldService.ts +276 -1
- package/Server/Services/IncidentEpisodePublicNoteService.ts +28 -0
- package/Server/Services/IncidentEpisodeService.ts +15 -0
- package/Server/Services/IncidentEpisodeStateTimelineService.ts +27 -1
- package/Server/Services/IncidentPublicNoteService.ts +30 -1
- package/Server/Services/IncidentService.ts +1535 -65
- package/Server/Services/IncidentStateTimelineService.ts +13 -0
- package/Server/Services/IncidentTemplateService.ts +109 -0
- package/Server/Services/ScheduledMaintenancePublicNoteService.ts +30 -1
- package/Server/Services/ScheduledMaintenanceService.ts +68 -18
- package/Server/Services/SmsService.ts +10 -0
- package/Server/Services/StatusPageService.ts +65 -8
- package/Server/Services/StatusPageSubscriberNotificationTemplateService.ts +299 -37
- package/Server/Services/StatusPageSubscriberNotificationTemplateStatusPageService.ts +129 -0
- package/Server/Services/StatusPageSubscriberService.ts +1161 -64
- package/Server/Types/Markdown.ts +153 -6
- package/Server/Types/Workflow/Components/Email.ts +61 -2
- package/Server/Utils/CustomField/CustomFieldRename.ts +378 -0
- package/Server/Utils/DataSource/EgressGuard.ts +66 -21
- package/Server/Utils/Mail/PinnedSmtpSocket.ts +130 -0
- package/Server/Utils/Monitor/MonitorCriteriaObservationBuilder.ts +10 -0
- package/Server/Utils/SSRFProtection.ts +76 -16
- package/Server/Utils/StatusPage/IncidentStatusPageScope.ts +948 -0
- package/Server/Utils/StatusPage/IncidentSubscriberAudienceBuilder.ts +656 -0
- package/Server/Utils/StatusPage/IncidentTemplateVariableBuilder.ts +805 -0
- package/Server/Utils/StatusPage/StatusPageExclusion.ts +18 -0
- package/Server/Utils/StatusPage/StatusPageReadAccess.ts +125 -0
- package/Server/Utils/StatusPage/StatusPageSubscriberUnsubscribeNotice.ts +151 -0
- package/Server/Utils/StatusPage/StatusPageSubscriberUnsubscribeToken.ts +70 -0
- package/Server/Utils/StatusPage/SubscriberIncidentEmailBuilder.ts +421 -0
- package/Server/Utils/StatusPage/SubscriberNotificationClaim.ts +107 -0
- package/Server/Utils/StatusPage/SubscriberNotificationDeliveryRecord.ts +1049 -0
- package/Server/Utils/StatusPage/SubscriberNotificationFanOut.ts +180 -0
- package/Server/Utils/StatusPage/SubscriberNotificationPreviewBuilder.ts +839 -0
- package/Server/Utils/StatusPage/SubscriberNotificationResendAccess.ts +393 -0
- package/Server/Utils/StatusPage/SubscriberNotificationRunLimit.ts +246 -0
- package/Server/Utils/StatusPage/SubscriberNotificationTiming.ts +133 -0
- package/Server/Utils/StatusPage/SubscriberTemplateIncidentRecordAccess.ts +215 -0
- package/Server/Utils/StatusPageResource.ts +51 -20
- package/Server/Utils/VM/VMAPI.ts +1 -0
- package/Server/Utils/VM/VMRunner.ts +10 -0
- package/Server/Utils/Workflow/OAuth2TokenClient.ts +10 -0
- package/Server/Views/Partials/SensitiveUrlToken.ejs +8 -5
- package/Tests/App/Accounts/RegisterVerifyEmail.test.tsx +748 -0
- package/Tests/App/Accounts/ResendVerificationEmail.test.tsx +1222 -0
- package/Tests/App/Accounts/VerificationEmailResendUtils.test.ts +797 -0
- package/Tests/App/Accounts/VerifyEmailPending.test.tsx +538 -0
- package/Tests/App/Accounts/VerifyEmailResend.test.tsx +779 -0
- package/Tests/App/Dashboard/CustomFieldsSettingsIncidentOptions.test.tsx +357 -0
- package/Tests/App/Dashboard/EventNotes.test.tsx +776 -0
- package/Tests/App/Dashboard/EventNotesPages.test.tsx +119 -0
- package/Tests/App/Dashboard/EventNotesUtil.test.ts +116 -17
- package/Tests/App/Dashboard/EventOverviewPages.test.tsx +242 -5
- package/Tests/App/Dashboard/IncidentChangeStateNotifyDefault.test.tsx +91 -1
- package/Tests/App/Dashboard/IncidentCreateDetailsStep.test.tsx +643 -0
- package/Tests/App/Dashboard/IncidentCreateFromAlerts.test.tsx +8 -1
- package/Tests/App/Dashboard/IncidentCreateStatusPageScope.test.tsx +601 -0
- package/Tests/App/Dashboard/IncidentCustomFieldTemplateVariables.test.tsx +386 -0
- package/Tests/App/Dashboard/IncidentNoteTemplatePlaceholders.test.tsx +124 -0
- package/Tests/App/Dashboard/IncidentNoteTemplateVariablesLoader.test.ts +305 -0
- package/Tests/App/Dashboard/IncidentOverviewNotifyDefault.test.tsx +112 -0
- package/Tests/App/Dashboard/IncidentSettingsRenotifyOnPublish.test.tsx +674 -0
- package/Tests/App/Dashboard/IncidentSettingsStatusPageScope.test.tsx +1051 -0
- package/Tests/App/Dashboard/IncidentTemplateCustomFields.test.tsx +384 -0
- package/Tests/App/Dashboard/IncidentTemplateStatusPageScopeCard.test.tsx +215 -0
- package/Tests/App/Dashboard/PublicNotePagesNotifyDefault.test.tsx +113 -1
- package/Tests/App/Dashboard/SubscriberAudienceSummary.test.tsx +512 -0
- package/Tests/App/Dashboard/SubscriberNotificationPreviewModal.test.tsx +837 -0
- package/Tests/App/Dashboard/SubscriberNotificationStatusLabel.test.tsx +88 -0
- package/Tests/App/Dashboard/SubscriberNotificationStatusResend.test.tsx +473 -0
- package/Tests/App/Dashboard/SubscriberTemplateLivePreview.test.tsx +196 -0
- package/Tests/App/Dashboard/TeamAddedSubscribersUnsubscribedNotice.test.tsx +248 -0
- package/Tests/App/SensitiveUrlTokenBootstrap.test.ts +64 -3
- package/Tests/App/StatusPage/StatusPageUnsubscribePage.test.tsx +412 -0
- package/Tests/Models/IncidentCustomFieldApiSchemaContract.test.ts +217 -0
- package/Tests/Models/IncidentCustomFieldCreateSettingsColumns.test.ts +252 -0
- package/Tests/Models/StatusPageSubscriberUnsubscribeColumns.test.ts +218 -0
- package/Tests/Server/API/ExpiredSessionRouteGuards.test.ts +7 -0
- package/Tests/Server/API/IncidentSubscriberAudienceAPI.test.ts +1408 -0
- package/Tests/Server/API/StatusPageIncidentScope.test.ts +1868 -0
- package/Tests/Server/API/StatusPageIncidentScopePostgres.test.ts +790 -0
- package/Tests/Server/API/StatusPageManageSubscriptionRecipient.test.ts +10 -1
- package/Tests/Server/API/StatusPageManageSubscriptionTemplateVariables.test.ts +206 -18
- package/Tests/Server/API/StatusPagePostmortemVisibility.test.ts +14 -2
- package/Tests/Server/API/StatusPageSubscriberCreateResponse.test.ts +217 -0
- package/Tests/Server/API/StatusPageSubscriberOwnership.test.ts +103 -2
- package/Tests/Server/API/StatusPageUnsubscribeAPI.test.ts +396 -0
- package/Tests/Server/Infrastructure/Postgres/AddIncidentStatusPageScopeMigration.test.ts +395 -0
- package/Tests/Server/Infrastructure/Postgres/AddIncidentTemplateStatusPageScopeFlagMigration.test.ts +150 -0
- package/Tests/Server/Infrastructure/Postgres/AddSubscriberNotificationClaimedAtMigration.test.ts +156 -0
- package/Tests/Server/Infrastructure/Postgres/SkipHiddenIncidentCreatedNotificationsMigration.test.ts +410 -0
- package/Tests/Server/Middleware/IdentityRateLimit.test.ts +551 -1
- package/Tests/Server/Middleware/SubscriberNotificationPreviewRateLimit.test.ts +238 -0
- package/Tests/Server/Middleware/SubscriberNotificationTestSendRateLimit.test.ts +245 -0
- package/Tests/Server/Services/AddStatusPageSubscriberUnsubscribeTokenMigration.test.ts +152 -0
- package/Tests/Server/Services/CrossProjectRelationWriteGuard.test.ts +221 -36
- package/Tests/Server/Services/DatabaseServiceCompareAndSetColumns.test.ts +191 -0
- package/Tests/Server/Services/IncidentCreatedRenotifyOnPublish.test.ts +681 -0
- package/Tests/Server/Services/IncidentCreatedResend.test.ts +775 -0
- package/Tests/Server/Services/IncidentCustomFieldRenamePostgres.test.ts +713 -0
- package/Tests/Server/Services/IncidentCustomFieldService.test.ts +751 -0
- package/Tests/Server/Services/IncidentCustomFieldValueValidation.test.ts +556 -0
- package/Tests/Server/Services/IncidentStatusPageScope.test.ts +2971 -0
- package/Tests/Server/Services/IncidentStatusPageScopeFeed.test.ts +131 -0
- package/Tests/Server/Services/IncidentStatusPageScopePostgres.test.ts +625 -0
- package/Tests/Server/Services/IncidentTemplateCustomFieldsCopy.test.ts +311 -0
- package/Tests/Server/Services/IncidentTemplateStatusPageScope.test.ts +363 -0
- package/Tests/Server/Services/PublicNoteEditFeedEventType.test.ts +213 -0
- package/Tests/Server/Services/PublicNoteResendAccess.test.ts +994 -0
- package/Tests/Server/Services/ScheduledMaintenanceSubscriberTemplateFormats.test.ts +289 -9
- package/Tests/Server/Services/SmsServiceFailIfNotSent.test.ts +67 -0
- package/Tests/Server/Services/StatusPageReportIncidentCounts.test.ts +610 -0
- package/Tests/Server/Services/StatusPageSubscriberAudienceCounts.test.ts +201 -0
- package/Tests/Server/Services/StatusPageSubscriberAudienceCountsPostgres.test.ts +271 -0
- package/Tests/Server/Services/StatusPageSubscriberConfirmationTemplateEscaping.test.ts +200 -0
- package/Tests/Server/Services/StatusPageSubscriberNotificationLogRedaction.test.ts +54 -0
- package/Tests/Server/Services/StatusPageSubscriberNotificationTemplateCompile.test.ts +37 -0
- package/Tests/Server/Services/StatusPageSubscriberNotificationTemplateIncidentRecordAccess.test.ts +772 -0
- package/Tests/Server/Services/StatusPageSubscriberNotificationTemplateLookup.test.ts +506 -0
- package/Tests/Server/Services/StatusPageSubscriberNotificationTemplateLookupPostgres.test.ts +261 -0
- package/Tests/Server/Services/StatusPageSubscriberReport.test.ts +21 -5
- package/Tests/Server/Services/StatusPageSubscriberUnsubscribe.test.ts +1618 -0
- package/Tests/Server/Services/StatusPageSubscriberUnsubscribeLinkSenders.test.ts +373 -0
- package/Tests/Server/Services/StatusPageSubscriberUnsubscribePostgres.test.ts +388 -0
- package/Tests/Server/Services/SubscriberNotificationInFlightRequeue.test.ts +500 -0
- package/Tests/Server/Types/MarkdownEmailLinks.test.ts +320 -0
- package/Tests/Server/Types/Workflow/Components/Email.test.ts +491 -1
- package/Tests/Server/Types/Workflow/Components/EmailSmtpPinning.test.ts +398 -0
- package/Tests/Server/Utils/CustomField/CustomFieldRename.test.ts +586 -0
- package/Tests/Server/Utils/DataSource/EgressGuard.test.ts +246 -10
- package/Tests/Server/Utils/DataSource/EgressGuardDeploymentConfig.test.ts +226 -0
- package/Tests/Server/Utils/DataSource/EgressGuardPinning.test.ts +131 -0
- package/Tests/Server/Utils/DataSource/HttpFetch.test.ts +4 -0
- package/Tests/Server/Utils/EgressPolicyEnvironment.ts +45 -0
- package/Tests/Server/Utils/Mail/PinnedSmtpSocket.test.ts +409 -0
- package/Tests/Server/Utils/Monitor/MonitorCriteriaObservationBuilderUnits.test.ts +23 -0
- package/Tests/Server/Utils/SSRFProtection.test.ts +4 -0
- package/Tests/Server/Utils/SSRFProtectionCloudServiceAddresses.test.ts +4 -0
- package/Tests/Server/Utils/SSRFProtectionPrivateNetwork.test.ts +4 -0
- package/Tests/Server/Utils/SSRFProtectionResolutionDetail.test.ts +314 -0
- package/Tests/Server/Utils/StatusPage/IncidentStatusPageScope.test.ts +1699 -0
- package/Tests/Server/Utils/StatusPage/IncidentStatusPageScopeQueriesPostgres.test.ts +508 -0
- package/Tests/Server/Utils/StatusPage/IncidentSubscriberAudienceCallerPermission.test.ts +246 -0
- package/Tests/Server/Utils/StatusPage/IncidentTemplateVariableBuilder.test.ts +1348 -0
- package/Tests/Server/Utils/StatusPage/StatusPageReadAccess.test.ts +221 -0
- package/Tests/Server/Utils/StatusPage/StatusPageSubscriberUnsubscribeNotice.test.ts +132 -0
- package/Tests/Server/Utils/StatusPage/StatusPageSubscriberUnsubscribeToken.test.ts +155 -0
- package/Tests/Server/Utils/StatusPage/SubscriberIncidentEmailBuilder.test.ts +708 -0
- package/Tests/Server/Utils/StatusPage/SubscriberNotificationClaim.test.ts +255 -0
- package/Tests/Server/Utils/StatusPage/SubscriberNotificationClaimPostgres.test.ts +528 -0
- package/Tests/Server/Utils/StatusPage/SubscriberNotificationDeliveryRecord.test.ts +1238 -0
- package/Tests/Server/Utils/StatusPage/SubscriberNotificationFanOut.test.ts +472 -0
- package/Tests/Server/Utils/StatusPage/SubscriberNotificationPreviewBuilder.test.ts +1168 -0
- package/Tests/Server/Utils/StatusPage/SubscriberNotificationRunLimit.test.ts +275 -0
- package/Tests/Server/Utils/StatusPage/SubscriberNotificationTiming.test.ts +131 -0
- package/Tests/Server/Utils/StatusPageResource.test.ts +98 -0
- package/Tests/Server/Utils/VM/VMRunnerPrivateNetworkWiring.test.ts +17 -0
- package/Tests/Server/Utils/VM/VMRunnerSsrf.test.ts +75 -0
- package/Tests/Types/CustomField/CustomFieldSavedViews.test.ts +247 -0
- package/Tests/Types/CustomField/CustomFieldTemplateValues.test.ts +186 -0
- package/Tests/Types/CustomField/CustomFieldTypeCorrespondence.test.ts +48 -0
- package/Tests/Types/CustomField/CustomFieldValueFormat.test.ts +215 -0
- package/Tests/Types/CustomField/CustomFieldValueValidator.test.ts +343 -0
- package/Tests/Types/CustomField/CustomFieldVariableKey.test.ts +364 -0
- package/Tests/Types/SafeHtml.test.ts +102 -0
- package/Tests/Types/StatusPage/IncidentCreatedRenotify.test.ts +419 -0
- package/Tests/Types/StatusPage/IncidentCreatedResend.test.ts +118 -0
- package/Tests/Types/StatusPage/IncidentScopeAddedPagesNotification.test.ts +558 -0
- package/Tests/Types/StatusPage/IncidentSubscriberAudience.test.ts +284 -0
- package/Tests/Types/StatusPage/StatusPageSubscriberUnsubscribe.test.ts +341 -0
- package/Tests/Types/StatusPage/SubscriberNotificationPreview.test.ts +196 -0
- package/Tests/Types/StatusPage/SubscriberNotificationResend.test.ts +201 -0
- package/Tests/Types/StatusPage/SubscriberNotificationTemplateCompiler.test.ts +277 -0
- package/Tests/Types/StatusPage/SubscriberNotificationTemplatePreview.test.ts +179 -0
- package/Tests/Types/StatusPage/SubscriberNotificationTemplateVariables.test.ts +324 -0
- package/Tests/Types/StatusPage/SubscriberUpdateNotification.test.ts +60 -13
- package/Tests/UI/Components/CustomFields/CustomFieldFormFields.test.ts +432 -0
- package/Tests/UI/Components/CustomFields/CustomFieldModelFormFields.test.tsx +685 -0
- package/Tests/UI/Components/CustomFields/CustomFieldsDetailOrder.test.tsx +469 -0
- package/Tests/UI/Components/Forms/ModelFormCustomFieldInputs.test.tsx +325 -0
- package/Tests/UI/Components/Forms/ModelFormDropdownOptionsRefused.test.tsx +358 -0
- package/Tests/UI/Components/ModelTable/CustomFieldColumns.test.tsx +22 -0
- package/Tests/UI/Monitor/NetworkPathView.test.tsx +289 -0
- package/Tests/Utils/Incident/IncidentNoteTemplateVariables.test.ts +623 -0
- package/Tests/Utils/Markdown/MarkdownEscape.test.ts +89 -0
- package/Tests/Utils/ProbeNetworkFailureUtil.test.ts +992 -0
- package/Tests/Utils/RequestFailedDetails.test.ts +575 -0
- package/Types/CustomField/CustomFieldOrder.ts +55 -0
- package/Types/CustomField/CustomFieldSavedViews.ts +225 -0
- package/Types/CustomField/CustomFieldTemplateMerge.ts +71 -0
- package/Types/CustomField/CustomFieldType.ts +14 -0
- package/Types/CustomField/CustomFieldValueFormat.ts +161 -0
- package/Types/CustomField/CustomFieldValueValidator.ts +488 -0
- package/Types/CustomField/CustomFieldVariableKey.ts +211 -0
- package/Types/SafeHtml.ts +93 -0
- package/Types/StatusPage/IncidentCreatedRenotify.ts +224 -0
- package/Types/StatusPage/IncidentCreatedResend.ts +108 -0
- package/Types/StatusPage/IncidentScopeAddedPagesNotification.ts +343 -0
- package/Types/StatusPage/IncidentSubscriberAudience.ts +332 -0
- package/Types/StatusPage/StatusPageSubscriberUnsubscribe.ts +405 -0
- package/Types/StatusPage/SubscriberNotificationInterruption.ts +32 -0
- package/Types/StatusPage/SubscriberNotificationPreview.ts +322 -0
- package/Types/StatusPage/SubscriberNotificationResend.ts +132 -0
- package/Types/StatusPage/SubscriberNotificationTemplateCompiler.ts +180 -0
- package/Types/StatusPage/SubscriberNotificationTemplatePreview.ts +301 -0
- package/Types/StatusPage/SubscriberNotificationTemplateVariables.ts +217 -4
- package/Types/StatusPage/SubscriberUpdateNotification.ts +32 -11
- package/UI/Components/CustomFields/CustomFieldFormFields.ts +317 -0
- package/UI/Components/CustomFields/CustomFieldModelFormFields.tsx +395 -0
- package/UI/Components/CustomFields/CustomFieldsDetail.tsx +95 -55
- package/UI/Components/Forms/ModelForm.tsx +70 -8
- package/UI/Components/Forms/Validation.ts +1 -1
- package/UI/Components/ModelFormModal/ModelFormModal.tsx +2 -4
- package/UI/Components/ModelTable/AnalyticsModelTable.tsx +2 -6
- package/UI/Components/ModelTable/BaseModelTable.tsx +9 -8
- package/UI/Components/ModelTable/CustomFieldColumns.tsx +14 -1
- package/UI/Components/ModelTable/ModelTable.tsx +6 -7
- package/UI/Utils/SensitiveUrlToken.ts +10 -5
- package/Utils/API.ts +247 -2
- package/Utils/Incident/IncidentNoteTemplateVariables.ts +304 -0
- package/Utils/Markdown/MarkdownEscape.ts +65 -0
- package/Utils/ProbeNetworkFailureUtil.ts +673 -0
- package/build/dist/Models/DatabaseModels/Incident.js +267 -1
- package/build/dist/Models/DatabaseModels/Incident.js.map +1 -1
- package/build/dist/Models/DatabaseModels/IncidentCustomField.js +207 -1
- package/build/dist/Models/DatabaseModels/IncidentCustomField.js.map +1 -1
- package/build/dist/Models/DatabaseModels/IncidentEpisode.js +31 -0
- package/build/dist/Models/DatabaseModels/IncidentEpisode.js.map +1 -1
- package/build/dist/Models/DatabaseModels/IncidentTemplate.js +124 -1
- package/build/dist/Models/DatabaseModels/IncidentTemplate.js.map +1 -1
- package/build/dist/Models/DatabaseModels/StatusPage.js +56 -0
- package/build/dist/Models/DatabaseModels/StatusPage.js.map +1 -1
- package/build/dist/Models/DatabaseModels/StatusPageSubscriber.js +131 -0
- package/build/dist/Models/DatabaseModels/StatusPageSubscriber.js.map +1 -1
- package/build/dist/Server/API/IncidentAPI.js +100 -1
- package/build/dist/Server/API/IncidentAPI.js.map +1 -1
- package/build/dist/Server/API/StatusPageAPI.js +417 -176
- package/build/dist/Server/API/StatusPageAPI.js.map +1 -1
- package/build/dist/Server/API/StatusPageSubscriberAPI.js +52 -13
- package/build/dist/Server/API/StatusPageSubscriberAPI.js.map +1 -1
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1795300000000-SkipHiddenIncidentCreatedNotifications.js +41 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1795300000000-SkipHiddenIncidentCreatedNotifications.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1795400000000-AddIncidentStatusPageScope.js +57 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1795400000000-AddIncidentStatusPageScope.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1795500000000-AddIncidentTemplateStatusPageScopeFlag.js +23 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1795500000000-AddIncidentTemplateStatusPageScopeFlag.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1795600000000-AddStatusPageSubscriberUnsubscribeToken.js +40 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1795600000000-AddStatusPageSubscriberUnsubscribeToken.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1795700000000-AddStatusPageSubscriberIsAddedByTeam.js +26 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1795700000000-AddStatusPageSubscriberIsAddedByTeam.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1795800000000-AddIncidentCustomFieldCreateAndNotificationSettings.js +89 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1795800000000-AddIncidentCustomFieldCreateAndNotificationSettings.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1795900000000-AddSubscriberNotificationClaimedAt.js +29 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1795900000000-AddSubscriberNotificationClaimedAt.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js +14 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js.map +1 -1
- package/build/dist/Server/Infrastructure/Semaphore.js +3 -0
- package/build/dist/Server/Infrastructure/Semaphore.js.map +1 -1
- package/build/dist/Server/Middleware/IdentityRateLimit.js +89 -3
- package/build/dist/Server/Middleware/IdentityRateLimit.js.map +1 -1
- package/build/dist/Server/Middleware/SubscriberNotificationPreviewRateLimit.js +149 -0
- package/build/dist/Server/Middleware/SubscriberNotificationPreviewRateLimit.js.map +1 -0
- package/build/dist/Server/Middleware/SubscriberNotificationTestSendRateLimit.js +190 -0
- package/build/dist/Server/Middleware/SubscriberNotificationTestSendRateLimit.js.map +1 -0
- package/build/dist/Server/Services/DatabaseService.js +56 -7
- package/build/dist/Server/Services/DatabaseService.js.map +1 -1
- package/build/dist/Server/Services/IncidentCustomFieldService.js +204 -8
- package/build/dist/Server/Services/IncidentCustomFieldService.js.map +1 -1
- package/build/dist/Server/Services/IncidentEpisodePublicNoteService.js +24 -0
- package/build/dist/Server/Services/IncidentEpisodePublicNoteService.js.map +1 -1
- package/build/dist/Server/Services/IncidentEpisodeService.js +14 -0
- package/build/dist/Server/Services/IncidentEpisodeService.js.map +1 -1
- package/build/dist/Server/Services/IncidentEpisodeStateTimelineService.js +26 -0
- package/build/dist/Server/Services/IncidentEpisodeStateTimelineService.js.map +1 -1
- package/build/dist/Server/Services/IncidentPublicNoteService.js +26 -1
- package/build/dist/Server/Services/IncidentPublicNoteService.js.map +1 -1
- package/build/dist/Server/Services/IncidentService.js +1052 -0
- package/build/dist/Server/Services/IncidentService.js.map +1 -1
- package/build/dist/Server/Services/IncidentStateTimelineService.js +12 -0
- package/build/dist/Server/Services/IncidentStateTimelineService.js.map +1 -1
- package/build/dist/Server/Services/IncidentTemplateService.js +83 -0
- package/build/dist/Server/Services/IncidentTemplateService.js.map +1 -1
- package/build/dist/Server/Services/ScheduledMaintenancePublicNoteService.js +26 -1
- package/build/dist/Server/Services/ScheduledMaintenancePublicNoteService.js.map +1 -1
- package/build/dist/Server/Services/ScheduledMaintenanceService.js +47 -17
- package/build/dist/Server/Services/ScheduledMaintenanceService.js.map +1 -1
- package/build/dist/Server/Services/SmsService.js +2 -22
- package/build/dist/Server/Services/SmsService.js.map +1 -1
- package/build/dist/Server/Services/StatusPageService.js +47 -9
- package/build/dist/Server/Services/StatusPageService.js.map +1 -1
- package/build/dist/Server/Services/StatusPageSubscriberNotificationTemplateService.js +237 -32
- package/build/dist/Server/Services/StatusPageSubscriberNotificationTemplateService.js.map +1 -1
- package/build/dist/Server/Services/StatusPageSubscriberNotificationTemplateStatusPageService.js +109 -0
- package/build/dist/Server/Services/StatusPageSubscriberNotificationTemplateStatusPageService.js.map +1 -1
- package/build/dist/Server/Services/StatusPageSubscriberService.js +925 -99
- package/build/dist/Server/Services/StatusPageSubscriberService.js.map +1 -1
- package/build/dist/Server/Types/Markdown.js +110 -6
- package/build/dist/Server/Types/Markdown.js.map +1 -1
- package/build/dist/Server/Types/Workflow/Components/Email.js +55 -6
- package/build/dist/Server/Types/Workflow/Components/Email.js.map +1 -1
- package/build/dist/Server/Utils/CustomField/CustomFieldRename.js +211 -0
- package/build/dist/Server/Utils/CustomField/CustomFieldRename.js.map +1 -0
- package/build/dist/Server/Utils/DataSource/EgressGuard.js +41 -12
- package/build/dist/Server/Utils/DataSource/EgressGuard.js.map +1 -1
- package/build/dist/Server/Utils/Mail/PinnedSmtpSocket.js +101 -0
- package/build/dist/Server/Utils/Mail/PinnedSmtpSocket.js.map +1 -0
- package/build/dist/Server/Utils/Monitor/MonitorCriteriaObservationBuilder.js +9 -0
- package/build/dist/Server/Utils/Monitor/MonitorCriteriaObservationBuilder.js.map +1 -1
- package/build/dist/Server/Utils/SSRFProtection.js +48 -6
- package/build/dist/Server/Utils/SSRFProtection.js.map +1 -1
- package/build/dist/Server/Utils/StatusPage/IncidentStatusPageScope.js +631 -0
- package/build/dist/Server/Utils/StatusPage/IncidentStatusPageScope.js.map +1 -0
- package/build/dist/Server/Utils/StatusPage/IncidentSubscriberAudienceBuilder.js +403 -0
- package/build/dist/Server/Utils/StatusPage/IncidentSubscriberAudienceBuilder.js.map +1 -0
- package/build/dist/Server/Utils/StatusPage/IncidentTemplateVariableBuilder.js +451 -0
- package/build/dist/Server/Utils/StatusPage/IncidentTemplateVariableBuilder.js.map +1 -0
- package/build/dist/Server/Utils/StatusPage/StatusPageExclusion.js +13 -0
- package/build/dist/Server/Utils/StatusPage/StatusPageExclusion.js.map +1 -0
- package/build/dist/Server/Utils/StatusPage/StatusPageReadAccess.js +91 -0
- package/build/dist/Server/Utils/StatusPage/StatusPageReadAccess.js.map +1 -0
- package/build/dist/Server/Utils/StatusPage/StatusPageSubscriberUnsubscribeNotice.js +101 -0
- package/build/dist/Server/Utils/StatusPage/StatusPageSubscriberUnsubscribeNotice.js.map +1 -0
- package/build/dist/Server/Utils/StatusPage/StatusPageSubscriberUnsubscribeToken.js +47 -0
- package/build/dist/Server/Utils/StatusPage/StatusPageSubscriberUnsubscribeToken.js.map +1 -0
- package/build/dist/Server/Utils/StatusPage/SubscriberIncidentEmailBuilder.js +273 -0
- package/build/dist/Server/Utils/StatusPage/SubscriberIncidentEmailBuilder.js.map +1 -0
- package/build/dist/Server/Utils/StatusPage/SubscriberNotificationClaim.js +73 -0
- package/build/dist/Server/Utils/StatusPage/SubscriberNotificationClaim.js.map +1 -0
- package/build/dist/Server/Utils/StatusPage/SubscriberNotificationDeliveryRecord.js +722 -0
- package/build/dist/Server/Utils/StatusPage/SubscriberNotificationDeliveryRecord.js.map +1 -0
- package/build/dist/Server/Utils/StatusPage/SubscriberNotificationFanOut.js +102 -0
- package/build/dist/Server/Utils/StatusPage/SubscriberNotificationFanOut.js.map +1 -0
- package/build/dist/Server/Utils/StatusPage/SubscriberNotificationPreviewBuilder.js +527 -0
- package/build/dist/Server/Utils/StatusPage/SubscriberNotificationPreviewBuilder.js.map +1 -0
- package/build/dist/Server/Utils/StatusPage/SubscriberNotificationResendAccess.js +278 -0
- package/build/dist/Server/Utils/StatusPage/SubscriberNotificationResendAccess.js.map +1 -0
- package/build/dist/Server/Utils/StatusPage/SubscriberNotificationRunLimit.js +137 -0
- package/build/dist/Server/Utils/StatusPage/SubscriberNotificationRunLimit.js.map +1 -0
- package/build/dist/Server/Utils/StatusPage/SubscriberNotificationTiming.js +103 -0
- package/build/dist/Server/Utils/StatusPage/SubscriberNotificationTiming.js.map +1 -0
- package/build/dist/Server/Utils/StatusPage/SubscriberTemplateIncidentRecordAccess.js +114 -0
- package/build/dist/Server/Utils/StatusPage/SubscriberTemplateIncidentRecordAccess.js.map +1 -0
- package/build/dist/Server/Utils/StatusPageResource.js +39 -7
- package/build/dist/Server/Utils/StatusPageResource.js.map +1 -1
- package/build/dist/Server/Utils/VM/VMAPI.js.map +1 -1
- package/build/dist/Server/Utils/VM/VMRunner.js +1 -0
- package/build/dist/Server/Utils/VM/VMRunner.js.map +1 -1
- package/build/dist/Server/Utils/Workflow/OAuth2TokenClient.js +3 -0
- package/build/dist/Server/Utils/Workflow/OAuth2TokenClient.js.map +1 -1
- package/build/dist/Types/CustomField/CustomFieldOrder.js +36 -0
- package/build/dist/Types/CustomField/CustomFieldOrder.js.map +1 -0
- package/build/dist/Types/CustomField/CustomFieldSavedViews.js +135 -0
- package/build/dist/Types/CustomField/CustomFieldSavedViews.js.map +1 -0
- package/build/dist/Types/CustomField/CustomFieldTemplateMerge.js +27 -0
- package/build/dist/Types/CustomField/CustomFieldTemplateMerge.js.map +1 -0
- package/build/dist/Types/CustomField/CustomFieldType.js +12 -0
- package/build/dist/Types/CustomField/CustomFieldType.js.map +1 -1
- package/build/dist/Types/CustomField/CustomFieldValueFormat.js +126 -0
- package/build/dist/Types/CustomField/CustomFieldValueFormat.js.map +1 -0
- package/build/dist/Types/CustomField/CustomFieldValueValidator.js +280 -0
- package/build/dist/Types/CustomField/CustomFieldValueValidator.js.map +1 -0
- package/build/dist/Types/CustomField/CustomFieldVariableKey.js +150 -0
- package/build/dist/Types/CustomField/CustomFieldVariableKey.js.map +1 -0
- package/build/dist/Types/SafeHtml.js +84 -0
- package/build/dist/Types/SafeHtml.js.map +1 -0
- package/build/dist/Types/StatusPage/IncidentCreatedRenotify.js +117 -0
- package/build/dist/Types/StatusPage/IncidentCreatedRenotify.js.map +1 -0
- package/build/dist/Types/StatusPage/IncidentCreatedResend.js +86 -0
- package/build/dist/Types/StatusPage/IncidentCreatedResend.js.map +1 -0
- package/build/dist/Types/StatusPage/IncidentScopeAddedPagesNotification.js +246 -0
- package/build/dist/Types/StatusPage/IncidentScopeAddedPagesNotification.js.map +1 -0
- package/build/dist/Types/StatusPage/IncidentSubscriberAudience.js +183 -0
- package/build/dist/Types/StatusPage/IncidentSubscriberAudience.js.map +1 -0
- package/build/dist/Types/StatusPage/StatusPageSubscriberUnsubscribe.js +277 -0
- package/build/dist/Types/StatusPage/StatusPageSubscriberUnsubscribe.js.map +1 -0
- package/build/dist/Types/StatusPage/SubscriberNotificationInterruption.js +27 -0
- package/build/dist/Types/StatusPage/SubscriberNotificationInterruption.js.map +1 -0
- package/build/dist/Types/StatusPage/SubscriberNotificationPreview.js +190 -0
- package/build/dist/Types/StatusPage/SubscriberNotificationPreview.js.map +1 -0
- package/build/dist/Types/StatusPage/SubscriberNotificationResend.js +102 -0
- package/build/dist/Types/StatusPage/SubscriberNotificationResend.js.map +1 -0
- package/build/dist/Types/StatusPage/SubscriberNotificationTemplateCompiler.js +97 -0
- package/build/dist/Types/StatusPage/SubscriberNotificationTemplateCompiler.js.map +1 -0
- package/build/dist/Types/StatusPage/SubscriberNotificationTemplatePreview.js +175 -0
- package/build/dist/Types/StatusPage/SubscriberNotificationTemplatePreview.js.map +1 -0
- package/build/dist/Types/StatusPage/SubscriberNotificationTemplateVariables.js +144 -4
- package/build/dist/Types/StatusPage/SubscriberNotificationTemplateVariables.js.map +1 -1
- package/build/dist/Types/StatusPage/SubscriberUpdateNotification.js +29 -9
- package/build/dist/Types/StatusPage/SubscriberUpdateNotification.js.map +1 -1
- package/build/dist/UI/Components/CustomFields/CustomFieldFormFields.js +169 -0
- package/build/dist/UI/Components/CustomFields/CustomFieldFormFields.js.map +1 -0
- package/build/dist/UI/Components/CustomFields/CustomFieldModelFormFields.js +212 -0
- package/build/dist/UI/Components/CustomFields/CustomFieldModelFormFields.js.map +1 -0
- package/build/dist/UI/Components/CustomFields/CustomFieldsDetail.js +64 -49
- package/build/dist/UI/Components/CustomFields/CustomFieldsDetail.js.map +1 -1
- package/build/dist/UI/Components/Forms/ModelForm.js +39 -5
- package/build/dist/UI/Components/Forms/ModelForm.js.map +1 -1
- package/build/dist/UI/Components/Forms/Validation.js +1 -1
- package/build/dist/UI/Components/Forms/Validation.js.map +1 -1
- package/build/dist/UI/Components/ModelFormModal/ModelFormModal.js.map +1 -1
- package/build/dist/UI/Components/ModelTable/AnalyticsModelTable.js.map +1 -1
- package/build/dist/UI/Components/ModelTable/BaseModelTable.js +2 -2
- package/build/dist/UI/Components/ModelTable/BaseModelTable.js.map +1 -1
- package/build/dist/UI/Components/ModelTable/CustomFieldColumns.js +13 -1
- package/build/dist/UI/Components/ModelTable/CustomFieldColumns.js.map +1 -1
- package/build/dist/UI/Components/ModelTable/ModelTable.js +1 -1
- package/build/dist/UI/Components/ModelTable/ModelTable.js.map +1 -1
- package/build/dist/UI/Utils/SensitiveUrlToken.js +10 -5
- package/build/dist/UI/Utils/SensitiveUrlToken.js.map +1 -1
- package/build/dist/Utils/API.js +177 -1
- package/build/dist/Utils/API.js.map +1 -1
- package/build/dist/Utils/Incident/IncidentNoteTemplateVariables.js +155 -0
- package/build/dist/Utils/Incident/IncidentNoteTemplateVariables.js.map +1 -0
- package/build/dist/Utils/Markdown/MarkdownEscape.js +48 -0
- package/build/dist/Utils/Markdown/MarkdownEscape.js.map +1 -1
- package/build/dist/Utils/ProbeNetworkFailureUtil.js +460 -0
- package/build/dist/Utils/ProbeNetworkFailureUtil.js.map +1 -0
- package/package.json +1 -1
|
@@ -3037,6 +3037,61 @@ export default class StatusPage extends BaseModel {
|
|
|
3037
3037
|
})
|
|
3038
3038
|
public showIncidentsOnStatusPage?: boolean = undefined;
|
|
3039
3039
|
|
|
3040
|
+
/*
|
|
3041
|
+
* A page with this on shows, and notifies its subscribers of, only the
|
|
3042
|
+
* incidents scoped to it (Incident.statusPages). Unscoped incidents never
|
|
3043
|
+
* reach it. That matters for a monitor shared by many pages: incidents
|
|
3044
|
+
* created from it by monitor criteria, Slack, Teams, the API or AI carry no
|
|
3045
|
+
* scope, so without this switch they would reach every page within a minute.
|
|
3046
|
+
* With it, none of these pages hears about such an incident until someone
|
|
3047
|
+
* scopes it to them.
|
|
3048
|
+
*
|
|
3049
|
+
* Not plan-gated, unlike showIncidentsOnStatusPage: it only ever narrows
|
|
3050
|
+
* what a page shows.
|
|
3051
|
+
*/
|
|
3052
|
+
@ColumnAccessControl({
|
|
3053
|
+
create: [
|
|
3054
|
+
Permission.ProjectOwner,
|
|
3055
|
+
Permission.ProjectAdmin,
|
|
3056
|
+
Permission.ProjectMember,
|
|
3057
|
+
Permission.StatusPageAdmin,
|
|
3058
|
+
Permission.StatusPageMember,
|
|
3059
|
+
Permission.CreateProjectStatusPage,
|
|
3060
|
+
],
|
|
3061
|
+
read: [
|
|
3062
|
+
Permission.ProjectOwner,
|
|
3063
|
+
Permission.ProjectAdmin,
|
|
3064
|
+
Permission.ProjectMember,
|
|
3065
|
+
Permission.Viewer,
|
|
3066
|
+
Permission.StatusPageAdmin,
|
|
3067
|
+
Permission.StatusPageMember,
|
|
3068
|
+
Permission.StatusPageViewer,
|
|
3069
|
+
Permission.ReadProjectStatusPage,
|
|
3070
|
+
],
|
|
3071
|
+
update: [
|
|
3072
|
+
Permission.ProjectOwner,
|
|
3073
|
+
Permission.ProjectAdmin,
|
|
3074
|
+
Permission.ProjectMember,
|
|
3075
|
+
Permission.StatusPageAdmin,
|
|
3076
|
+
Permission.StatusPageMember,
|
|
3077
|
+
Permission.EditProjectStatusPage,
|
|
3078
|
+
],
|
|
3079
|
+
})
|
|
3080
|
+
@TableColumn({
|
|
3081
|
+
isDefaultValueColumn: true,
|
|
3082
|
+
type: TableColumnType.Boolean,
|
|
3083
|
+
title: "Only Show Incidents Scoped to This Page",
|
|
3084
|
+
description:
|
|
3085
|
+
"When on, this status page shows and notifies its subscribers about only the incidents limited to it. Incidents that are not limited to any status page never reach it.",
|
|
3086
|
+
defaultValue: false,
|
|
3087
|
+
})
|
|
3088
|
+
@Column({
|
|
3089
|
+
type: ColumnType.Boolean,
|
|
3090
|
+
default: false,
|
|
3091
|
+
nullable: false,
|
|
3092
|
+
})
|
|
3093
|
+
public onlyShowScopedIncidents?: boolean = undefined;
|
|
3094
|
+
|
|
3040
3095
|
@ColumnAccessControl({
|
|
3041
3096
|
create: [
|
|
3042
3097
|
Permission.ProjectOwner,
|
|
@@ -765,6 +765,134 @@ export default class StatusPageSubscriber extends BaseModel {
|
|
|
765
765
|
})
|
|
766
766
|
public isUnsubscribed?: boolean = undefined;
|
|
767
767
|
|
|
768
|
+
/*
|
|
769
|
+
* When this subscription was cancelled, whoever cancelled it: the recipient
|
|
770
|
+
* through the unsubscribe link or the manage page, or a teammate on the
|
|
771
|
+
* dashboard. Set by StatusPageSubscriberService when Is Unsubscribed turns
|
|
772
|
+
* on and cleared when it turns off, so the subscriber lists can show and
|
|
773
|
+
* filter on it. Subscriptions cancelled before this column existed have
|
|
774
|
+
* none.
|
|
775
|
+
*
|
|
776
|
+
* Computed and never taken from a client. Nobody can write it: the service
|
|
777
|
+
* writes it as root, after the caller's own update.
|
|
778
|
+
*/
|
|
779
|
+
@ColumnAccessControl({
|
|
780
|
+
create: [],
|
|
781
|
+
read: [
|
|
782
|
+
Permission.ProjectOwner,
|
|
783
|
+
Permission.ProjectAdmin,
|
|
784
|
+
Permission.ProjectMember,
|
|
785
|
+
Permission.Viewer,
|
|
786
|
+
Permission.StatusPageAdmin,
|
|
787
|
+
Permission.StatusPageMember,
|
|
788
|
+
Permission.StatusPageViewer,
|
|
789
|
+
Permission.ReadStatusPageSubscriber,
|
|
790
|
+
],
|
|
791
|
+
update: [],
|
|
792
|
+
})
|
|
793
|
+
@TableColumn({
|
|
794
|
+
computed: true,
|
|
795
|
+
required: false,
|
|
796
|
+
type: TableColumnType.Date,
|
|
797
|
+
title: "Unsubscribed At",
|
|
798
|
+
description:
|
|
799
|
+
"When this subscriber unsubscribed. Set by OneUptime when Is Unsubscribed is turned on, and cleared when it is turned off; any value sent for it is ignored.",
|
|
800
|
+
example: "2024-01-15T09:30:00.000Z",
|
|
801
|
+
})
|
|
802
|
+
@Column({
|
|
803
|
+
type: ColumnType.Date,
|
|
804
|
+
nullable: true,
|
|
805
|
+
})
|
|
806
|
+
public unsubscribedAt?: Date = undefined;
|
|
807
|
+
|
|
808
|
+
/*
|
|
809
|
+
* The secret in this subscriber's unsubscribe link
|
|
810
|
+
* ({statusPageUrl}/unsubscribe/{id}-{token}, see
|
|
811
|
+
* Common/Types/StatusPage/StatusPageSubscriberUnsubscribe). Holding the
|
|
812
|
+
* link is what lets its recipient unsubscribe without signing in, which is
|
|
813
|
+
* the only way a subscriber of a private status page can.
|
|
814
|
+
*
|
|
815
|
+
* 32 random bytes as hex, minted by StatusPageSubscriberService when the
|
|
816
|
+
* subscriber is created; rows that predate it were backfilled by the
|
|
817
|
+
* migration that added it. It is computed so a create from the dashboard or
|
|
818
|
+
* the API passes the column check (which exempts computed columns only on
|
|
819
|
+
* create) while the service overwrites anything a client sends, and nobody
|
|
820
|
+
* can read or change it: it only ever leaves the server inside a link sent
|
|
821
|
+
* to the subscription's own contact.
|
|
822
|
+
*/
|
|
823
|
+
@ColumnAccessControl({
|
|
824
|
+
create: [],
|
|
825
|
+
read: [],
|
|
826
|
+
update: [],
|
|
827
|
+
})
|
|
828
|
+
@TableColumn({
|
|
829
|
+
computed: true,
|
|
830
|
+
hideColumnInDocumentation: true,
|
|
831
|
+
required: false,
|
|
832
|
+
type: TableColumnType.ShortText,
|
|
833
|
+
title: "Unsubscribe Token",
|
|
834
|
+
description:
|
|
835
|
+
"Random secret in this subscriber's unsubscribe link. Generated by OneUptime; never readable through the API.",
|
|
836
|
+
})
|
|
837
|
+
@Column({
|
|
838
|
+
type: ColumnType.ShortText,
|
|
839
|
+
length: ColumnLength.ShortText,
|
|
840
|
+
nullable: true,
|
|
841
|
+
})
|
|
842
|
+
public unsubscribeToken?: string = undefined;
|
|
843
|
+
|
|
844
|
+
/*
|
|
845
|
+
* Whether the status page's team added this subscriber - from the
|
|
846
|
+
* dashboard, with an API key (the REST API, Terraform, a script loading a
|
|
847
|
+
* list of addresses) or by a workflow - rather than its owner signing up
|
|
848
|
+
* on the status page.
|
|
849
|
+
*
|
|
850
|
+
* A subscriber the team added may be a shared address, such as a site's
|
|
851
|
+
* mailing list, that any one reader could take off the page with the
|
|
852
|
+
* unsubscribe link. So when such a subscriber unsubscribes itself, the
|
|
853
|
+
* page's owners are emailed, the unsubscribe page warns the reader first,
|
|
854
|
+
* and the subscriber lists name it (see StatusPageSubscriberService).
|
|
855
|
+
*
|
|
856
|
+
* Created By (createdByUserId) cannot tell this on its own: only a
|
|
857
|
+
* signed-in user's create carries one, and an API key's or a workflow's
|
|
858
|
+
* does not. StatusPageSubscriberService sets this on every create - true
|
|
859
|
+
* unless the create is a sign-up on the status page - and nobody else can
|
|
860
|
+
* write it. Subscribers created before it existed were given it from
|
|
861
|
+
* Created By, so a subscriber an API key added before then reads as a
|
|
862
|
+
* sign-up.
|
|
863
|
+
*/
|
|
864
|
+
@ColumnAccessControl({
|
|
865
|
+
create: [],
|
|
866
|
+
read: [
|
|
867
|
+
Permission.ProjectOwner,
|
|
868
|
+
Permission.ProjectAdmin,
|
|
869
|
+
Permission.ProjectMember,
|
|
870
|
+
Permission.Viewer,
|
|
871
|
+
Permission.StatusPageAdmin,
|
|
872
|
+
Permission.StatusPageMember,
|
|
873
|
+
Permission.StatusPageViewer,
|
|
874
|
+
Permission.ReadStatusPageSubscriber,
|
|
875
|
+
],
|
|
876
|
+
update: [],
|
|
877
|
+
})
|
|
878
|
+
@TableColumn({
|
|
879
|
+
isDefaultValueColumn: true,
|
|
880
|
+
computed: true,
|
|
881
|
+
required: true,
|
|
882
|
+
type: TableColumnType.Boolean,
|
|
883
|
+
title: "Is Added By Team",
|
|
884
|
+
description:
|
|
885
|
+
"Whether your team added this subscriber (from the dashboard, with an API key or by a workflow) rather than the subscriber signing up on the status page. Set by OneUptime when the subscriber is created; any value sent for it is ignored.",
|
|
886
|
+
defaultValue: false,
|
|
887
|
+
example: true,
|
|
888
|
+
})
|
|
889
|
+
@Column({
|
|
890
|
+
type: ColumnType.Boolean,
|
|
891
|
+
nullable: false,
|
|
892
|
+
default: false,
|
|
893
|
+
})
|
|
894
|
+
public isAddedByTeam?: boolean = undefined;
|
|
895
|
+
|
|
768
896
|
@ColumnAccessControl({
|
|
769
897
|
create: [
|
|
770
898
|
Permission.ProjectOwner,
|
|
@@ -30,6 +30,13 @@ import IncidentAIContextBuilder, {
|
|
|
30
30
|
} from "../Utils/AI/IncidentAIContextBuilder";
|
|
31
31
|
import JSONFunctions from "../../Types/JSONFunctions";
|
|
32
32
|
import Permission, { UserPermission } from "../../Types/Permission";
|
|
33
|
+
import { JSONObject } from "../../Types/JSON";
|
|
34
|
+
import IncidentSubscriberAudience, {
|
|
35
|
+
IncidentSubscriberAudienceResult,
|
|
36
|
+
} from "../../Types/StatusPage/IncidentSubscriberAudience";
|
|
37
|
+
import IncidentSubscriberAudienceBuilder, {
|
|
38
|
+
IncidentSubscriberAudienceRequest,
|
|
39
|
+
} from "../Utils/StatusPage/IncidentSubscriberAudienceBuilder";
|
|
33
40
|
|
|
34
41
|
export default class IncidentAPI extends BaseAPI<
|
|
35
42
|
Incident,
|
|
@@ -83,6 +90,161 @@ export default class IncidentAPI extends BaseAPI<
|
|
|
83
90
|
}
|
|
84
91
|
},
|
|
85
92
|
);
|
|
93
|
+
|
|
94
|
+
/*
|
|
95
|
+
* Who an incident's status page notifications would reach, before it is
|
|
96
|
+
* declared or a public note is posted (see IncidentSubscriberAudience).
|
|
97
|
+
* A POST because the monitors and status pages of an incident being
|
|
98
|
+
* declared travel in the body.
|
|
99
|
+
*/
|
|
100
|
+
this.router.post(
|
|
101
|
+
`${new this.entityType()
|
|
102
|
+
.getCrudApiPath()
|
|
103
|
+
?.toString()}/subscriber-audience`,
|
|
104
|
+
UserMiddleware.getUserMiddleware,
|
|
105
|
+
UserMiddleware.requireUserAuthentication,
|
|
106
|
+
async (req: ExpressRequest, res: ExpressResponse, next: NextFunction) => {
|
|
107
|
+
try {
|
|
108
|
+
await this.getSubscriberAudience(req, res);
|
|
109
|
+
} catch (err) {
|
|
110
|
+
next(err);
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
private async getSubscriberAudience(
|
|
117
|
+
req: ExpressRequest,
|
|
118
|
+
res: ExpressResponse,
|
|
119
|
+
): Promise<void> {
|
|
120
|
+
const props: DatabaseCommonInteractionProps =
|
|
121
|
+
await CommonAPI.getDatabaseCommonInteractionProps(req);
|
|
122
|
+
|
|
123
|
+
/*
|
|
124
|
+
* The project is the caller's tenant. Project API keys are admitted like
|
|
125
|
+
* signed-in members: the permission check below and the reads the
|
|
126
|
+
* answer is built from are what bound it.
|
|
127
|
+
*/
|
|
128
|
+
const projectId: ObjectID = CommonAPI.assertTenantScoped(props);
|
|
129
|
+
|
|
130
|
+
// One of the roles that may see the audience (read as Allow grants).
|
|
131
|
+
IncidentSubscriberAudienceBuilder.assertCallerMaySeeAudience(props);
|
|
132
|
+
|
|
133
|
+
const request: IncidentSubscriberAudienceRequest =
|
|
134
|
+
IncidentAPI.parseSubscriberAudienceRequest({
|
|
135
|
+
body: req.body,
|
|
136
|
+
projectId: projectId,
|
|
137
|
+
props: props,
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
const audience: IncidentSubscriberAudienceResult =
|
|
141
|
+
await IncidentSubscriberAudienceBuilder.build(request);
|
|
142
|
+
|
|
143
|
+
Response.setNoCacheHeaders(res);
|
|
144
|
+
|
|
145
|
+
return Response.sendJsonObjectResponse(
|
|
146
|
+
req,
|
|
147
|
+
res,
|
|
148
|
+
IncidentSubscriberAudience.toJSON(audience),
|
|
149
|
+
);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/*
|
|
153
|
+
* The request body: {incidentId} for an incident that exists, or
|
|
154
|
+
* {monitorIds, statusPageIds} for one being declared - never both. With
|
|
155
|
+
* incidentId, excludeStatusPagesNotifiedOnCreation asks who a Retry of
|
|
156
|
+
* its 'created' notification reaches.
|
|
157
|
+
*/
|
|
158
|
+
public static parseSubscriberAudienceRequest(data: {
|
|
159
|
+
body: unknown;
|
|
160
|
+
projectId: ObjectID;
|
|
161
|
+
props: DatabaseCommonInteractionProps;
|
|
162
|
+
}): IncidentSubscriberAudienceRequest {
|
|
163
|
+
const body: JSONObject =
|
|
164
|
+
data.body && typeof data.body === "object" && !Array.isArray(data.body)
|
|
165
|
+
? (data.body as JSONObject)
|
|
166
|
+
: {};
|
|
167
|
+
|
|
168
|
+
const hasIncidentId: boolean =
|
|
169
|
+
body["incidentId"] !== undefined && body["incidentId"] !== null;
|
|
170
|
+
const hasDraft: boolean =
|
|
171
|
+
(body["monitorIds"] !== undefined && body["monitorIds"] !== null) ||
|
|
172
|
+
(body["statusPageIds"] !== undefined && body["statusPageIds"] !== null);
|
|
173
|
+
|
|
174
|
+
if (hasIncidentId && hasDraft) {
|
|
175
|
+
throw new BadDataException(
|
|
176
|
+
"Send either incidentId, or monitorIds and statusPageIds - not both.",
|
|
177
|
+
);
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
if (hasIncidentId) {
|
|
181
|
+
return {
|
|
182
|
+
projectId: data.projectId,
|
|
183
|
+
props: data.props,
|
|
184
|
+
incidentId: IncidentAPI.parseObjectID(body["incidentId"], "incidentId"),
|
|
185
|
+
// Who a Retry of its 'created' notification reaches: only a real yes.
|
|
186
|
+
...(body["excludeStatusPagesNotifiedOnCreation"] === true
|
|
187
|
+
? { excludeStatusPagesNotifiedOnCreation: true }
|
|
188
|
+
: {}),
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
if (!hasDraft) {
|
|
193
|
+
throw new BadDataException(
|
|
194
|
+
"Send incidentId, or monitorIds and statusPageIds.",
|
|
195
|
+
);
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
return {
|
|
199
|
+
projectId: data.projectId,
|
|
200
|
+
props: data.props,
|
|
201
|
+
monitorIds: IncidentAPI.parseObjectIDs(body["monitorIds"], "monitorIds"),
|
|
202
|
+
statusPageIds: IncidentAPI.parseObjectIDs(
|
|
203
|
+
body["statusPageIds"],
|
|
204
|
+
"statusPageIds",
|
|
205
|
+
),
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
// An id as a string or a serialized ObjectID.
|
|
210
|
+
private static parseObjectID(value: unknown, name: string): ObjectID {
|
|
211
|
+
let id: string = "";
|
|
212
|
+
|
|
213
|
+
if (typeof value === "string") {
|
|
214
|
+
id = value;
|
|
215
|
+
} else if (value instanceof ObjectID) {
|
|
216
|
+
id = value.toString();
|
|
217
|
+
} else if (value && typeof value === "object") {
|
|
218
|
+
id = new ObjectID(value as JSONObject).toString();
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
id = id.trim();
|
|
222
|
+
|
|
223
|
+
if (!id || !ObjectID.isValidUUID(id)) {
|
|
224
|
+
throw new BadDataException(`${name} must be a valid ID.`);
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
return new ObjectID(id);
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
private static parseObjectIDs(value: unknown, name: string): Array<ObjectID> {
|
|
231
|
+
if (value === undefined || value === null) {
|
|
232
|
+
return [];
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
if (!Array.isArray(value)) {
|
|
236
|
+
throw new BadDataException(`${name} must be a list of IDs.`);
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
if (value.length > IncidentSubscriberAudience.maxIdsPerRequest) {
|
|
240
|
+
throw new BadDataException(
|
|
241
|
+
`${name} can list at most ${IncidentSubscriberAudience.maxIdsPerRequest} IDs.`,
|
|
242
|
+
);
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
return value.map((item: unknown): ObjectID => {
|
|
246
|
+
return IncidentAPI.parseObjectID(item, name);
|
|
247
|
+
});
|
|
86
248
|
}
|
|
87
249
|
|
|
88
250
|
private async getPostmortemAttachment(
|