@oneuptime/common 14.0.6 → 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.
Files changed (556) hide show
  1. package/Models/DatabaseModels/Incident.ts +267 -1
  2. package/Models/DatabaseModels/IncidentCustomField.ts +202 -0
  3. package/Models/DatabaseModels/IncidentEpisode.ts +30 -0
  4. package/Models/DatabaseModels/IncidentTemplate.ts +126 -1
  5. package/Models/DatabaseModels/InventoryItem.ts +23 -12
  6. package/Models/DatabaseModels/StatusPage.ts +55 -0
  7. package/Models/DatabaseModels/StatusPageSubscriber.ts +128 -0
  8. package/Server/API/IncidentAPI.ts +162 -0
  9. package/Server/API/StatusPageAPI.ts +487 -171
  10. package/Server/API/StatusPageSubscriberAPI.ts +63 -15
  11. package/Server/Infrastructure/Postgres/SchemaMigrations/1795200000000-AddInventoryItemProjectEntityKeyIndex.ts +217 -0
  12. package/Server/Infrastructure/Postgres/SchemaMigrations/1795300000000-SkipHiddenIncidentCreatedNotifications.ts +49 -0
  13. package/Server/Infrastructure/Postgres/SchemaMigrations/1795400000000-AddIncidentStatusPageScope.ts +108 -0
  14. package/Server/Infrastructure/Postgres/SchemaMigrations/1795500000000-AddIncidentTemplateStatusPageScopeFlag.ts +33 -0
  15. package/Server/Infrastructure/Postgres/SchemaMigrations/1795600000000-AddStatusPageSubscriberUnsubscribeToken.ts +51 -0
  16. package/Server/Infrastructure/Postgres/SchemaMigrations/1795700000000-AddStatusPageSubscriberIsAddedByTeam.ts +33 -0
  17. package/Server/Infrastructure/Postgres/SchemaMigrations/1795800000000-AddIncidentCustomFieldCreateAndNotificationSettings.ts +168 -0
  18. package/Server/Infrastructure/Postgres/SchemaMigrations/1795900000000-AddSubscriberNotificationClaimedAt.ts +44 -0
  19. package/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts +16 -0
  20. package/Server/Infrastructure/Semaphore.ts +10 -0
  21. package/Server/Middleware/IdentityRateLimit.ts +108 -3
  22. package/Server/Middleware/SubscriberNotificationPreviewRateLimit.ts +237 -0
  23. package/Server/Middleware/SubscriberNotificationTestSendRateLimit.ts +304 -0
  24. package/Server/Services/AlertService.ts +32 -36
  25. package/Server/Services/DatabaseService.ts +93 -10
  26. package/Server/Services/IncidentAlertService.ts +609 -2
  27. package/Server/Services/IncidentCustomFieldService.ts +276 -1
  28. package/Server/Services/IncidentEpisodePublicNoteService.ts +28 -0
  29. package/Server/Services/IncidentEpisodeService.ts +15 -0
  30. package/Server/Services/IncidentEpisodeStateTimelineService.ts +27 -1
  31. package/Server/Services/IncidentPublicNoteService.ts +30 -1
  32. package/Server/Services/IncidentService.ts +1663 -103
  33. package/Server/Services/IncidentStateTimelineService.ts +13 -0
  34. package/Server/Services/IncidentTemplateService.ts +109 -0
  35. package/Server/Services/InventoryItemService.ts +38 -0
  36. package/Server/Services/IoTDeviceCredentialService.ts +13 -4
  37. package/Server/Services/ScheduledMaintenancePublicNoteService.ts +30 -1
  38. package/Server/Services/ScheduledMaintenanceService.ts +118 -64
  39. package/Server/Services/SmsService.ts +10 -0
  40. package/Server/Services/StatusPageService.ts +65 -8
  41. package/Server/Services/StatusPageSubscriberNotificationTemplateService.ts +299 -37
  42. package/Server/Services/StatusPageSubscriberNotificationTemplateStatusPageService.ts +129 -0
  43. package/Server/Services/StatusPageSubscriberService.ts +1161 -64
  44. package/Server/Services/UserNotificationRuleService.ts +55 -53
  45. package/Server/Services/WorkspaceNotificationSummaryService.ts +38 -20
  46. package/Server/Types/Markdown.ts +153 -6
  47. package/Server/Types/Workflow/Components/Email.ts +61 -2
  48. package/Server/Utils/AffectedResources/LinkedAffectedResources.ts +576 -0
  49. package/Server/Utils/Alert/AlertStateChangeAuthorization.ts +129 -0
  50. package/Server/Utils/CustomField/CustomFieldRename.ts +378 -0
  51. package/Server/Utils/DataSource/EgressGuard.ts +66 -21
  52. package/Server/Utils/Inventory/InventoryOverviewAggregation.ts +111 -0
  53. package/Server/Utils/Mail/PinnedSmtpSocket.ts +130 -0
  54. package/Server/Utils/Monitor/MonitorCriteriaObservationBuilder.ts +10 -0
  55. package/Server/Utils/Response.ts +31 -0
  56. package/Server/Utils/SSRFProtection.ts +76 -16
  57. package/Server/Utils/StatusPage/IncidentStatusPageScope.ts +948 -0
  58. package/Server/Utils/StatusPage/IncidentSubscriberAudienceBuilder.ts +656 -0
  59. package/Server/Utils/StatusPage/IncidentTemplateVariableBuilder.ts +805 -0
  60. package/Server/Utils/StatusPage/StatusPageExclusion.ts +18 -0
  61. package/Server/Utils/StatusPage/StatusPageReadAccess.ts +125 -0
  62. package/Server/Utils/StatusPage/StatusPageSubscriberUnsubscribeNotice.ts +151 -0
  63. package/Server/Utils/StatusPage/StatusPageSubscriberUnsubscribeToken.ts +70 -0
  64. package/Server/Utils/StatusPage/SubscriberIncidentEmailBuilder.ts +421 -0
  65. package/Server/Utils/StatusPage/SubscriberNotificationClaim.ts +107 -0
  66. package/Server/Utils/StatusPage/SubscriberNotificationDeliveryRecord.ts +1049 -0
  67. package/Server/Utils/StatusPage/SubscriberNotificationFanOut.ts +180 -0
  68. package/Server/Utils/StatusPage/SubscriberNotificationPreviewBuilder.ts +839 -0
  69. package/Server/Utils/StatusPage/SubscriberNotificationResendAccess.ts +393 -0
  70. package/Server/Utils/StatusPage/SubscriberNotificationRunLimit.ts +246 -0
  71. package/Server/Utils/StatusPage/SubscriberNotificationTiming.ts +133 -0
  72. package/Server/Utils/StatusPage/SubscriberTemplateIncidentRecordAccess.ts +215 -0
  73. package/Server/Utils/StatusPageResource.ts +51 -20
  74. package/Server/Utils/Topology/TopologyConcurrencyLimiter.ts +229 -0
  75. package/Server/Utils/Topology/TopologyQueries.ts +1350 -0
  76. package/Server/Utils/Topology/TopologyRequest.ts +463 -0
  77. package/Server/Utils/Topology/TopologyResponseCache.ts +183 -0
  78. package/Server/Utils/Topology/TopologySql.ts +1024 -0
  79. package/Server/Utils/VM/VMAPI.ts +1 -0
  80. package/Server/Utils/VM/VMRunner.ts +10 -0
  81. package/Server/Utils/Workflow/OAuth2TokenClient.ts +10 -0
  82. package/Server/Views/Partials/SensitiveUrlToken.ejs +8 -5
  83. package/Tests/App/Accounts/RegisterVerifyEmail.test.tsx +748 -0
  84. package/Tests/App/Accounts/ResendVerificationEmail.test.tsx +1222 -0
  85. package/Tests/App/Accounts/VerificationEmailResendUtils.test.ts +797 -0
  86. package/Tests/App/Accounts/VerifyEmailPending.test.tsx +538 -0
  87. package/Tests/App/Accounts/VerifyEmailResend.test.tsx +779 -0
  88. package/Tests/App/Dashboard/AcknowledgeAlertsOnDeclare.test.ts +369 -0
  89. package/Tests/App/Dashboard/AffectedResourcesSlo.test.tsx +1 -1
  90. package/Tests/App/Dashboard/AffectedResourcesSummaryStep.test.tsx +510 -123
  91. package/Tests/App/Dashboard/AlertsTableAffectedResources.test.tsx +490 -0
  92. package/Tests/App/Dashboard/ChangeAlertStateDeclareIncident.test.tsx +886 -0
  93. package/Tests/App/Dashboard/CreateReviewStepRoleSummary.test.tsx +1250 -0
  94. package/Tests/App/Dashboard/CreateReviewStepSelectionSummary.test.tsx +738 -0
  95. package/Tests/App/Dashboard/CustomFieldsSettingsIncidentOptions.test.tsx +357 -0
  96. package/Tests/App/Dashboard/DeclareIncidentFromAlert.test.ts +417 -0
  97. package/Tests/App/Dashboard/EntityDetailPanel.test.tsx +1948 -229
  98. package/Tests/App/Dashboard/EntityDetailPanelLifecycle.test.tsx +493 -0
  99. package/Tests/App/Dashboard/EntityDetailPanelNavigation.test.tsx +439 -0
  100. package/Tests/App/Dashboard/EventNotes.test.tsx +776 -0
  101. package/Tests/App/Dashboard/EventNotesPages.test.tsx +119 -0
  102. package/Tests/App/Dashboard/EventNotesUtil.test.ts +116 -17
  103. package/Tests/App/Dashboard/EventOverviewPages.test.tsx +534 -6
  104. package/Tests/App/Dashboard/EventStatusPanel.test.tsx +798 -2
  105. package/Tests/App/Dashboard/FetchStateAndSeverityElements.test.tsx +669 -0
  106. package/Tests/App/Dashboard/FetchUsers.test.tsx +230 -0
  107. package/Tests/App/Dashboard/IncidentChangeStateNotifyDefault.test.tsx +91 -1
  108. package/Tests/App/Dashboard/IncidentCreateAcknowledgeAlerts.test.tsx +1611 -0
  109. package/Tests/App/Dashboard/IncidentCreateDetailsStep.test.tsx +643 -0
  110. package/Tests/App/Dashboard/IncidentCreateFromAlerts.test.tsx +8 -1
  111. package/Tests/App/Dashboard/IncidentCreateStatusPageScope.test.tsx +601 -0
  112. package/Tests/App/Dashboard/IncidentCustomFieldTemplateVariables.test.tsx +386 -0
  113. package/Tests/App/Dashboard/IncidentNoteTemplatePlaceholders.test.tsx +124 -0
  114. package/Tests/App/Dashboard/IncidentNoteTemplateVariablesLoader.test.ts +305 -0
  115. package/Tests/App/Dashboard/IncidentOverviewNotifyDefault.test.tsx +112 -0
  116. package/Tests/App/Dashboard/IncidentSettingsRenotifyOnPublish.test.tsx +674 -0
  117. package/Tests/App/Dashboard/IncidentSettingsStatusPageScope.test.tsx +1051 -0
  118. package/Tests/App/Dashboard/IncidentTemplateCustomFields.test.tsx +384 -0
  119. package/Tests/App/Dashboard/IncidentTemplateStatusPageScopeCard.test.tsx +215 -0
  120. package/Tests/App/Dashboard/InfrastructureExplorer.test.tsx +1365 -57
  121. package/Tests/App/Dashboard/InfrastructureGraph.test.tsx +964 -23
  122. package/Tests/App/Dashboard/InventoryRelationships.test.tsx +885 -0
  123. package/Tests/App/Dashboard/PublicNotePagesNotifyDefault.test.tsx +113 -1
  124. package/Tests/App/Dashboard/ServiceMapDatabaseLink.test.tsx +201 -15
  125. package/Tests/App/Dashboard/ServiceMapGraph.test.tsx +508 -36
  126. package/Tests/App/Dashboard/SubscriberAudienceSummary.test.tsx +512 -0
  127. package/Tests/App/Dashboard/SubscriberNotificationPreviewModal.test.tsx +837 -0
  128. package/Tests/App/Dashboard/SubscriberNotificationStatusLabel.test.tsx +88 -0
  129. package/Tests/App/Dashboard/SubscriberNotificationStatusResend.test.tsx +473 -0
  130. package/Tests/App/Dashboard/SubscriberTemplateLivePreview.test.tsx +196 -0
  131. package/Tests/App/Dashboard/TeamAddedSubscribersUnsubscribedNotice.test.tsx +248 -0
  132. package/Tests/App/Dashboard/TopologyDataLifecycle.test.tsx +583 -0
  133. package/Tests/App/Dashboard/TopologyDataLoading.test.tsx +982 -218
  134. package/Tests/App/Dashboard/TopologyPageNavigation.test.tsx +818 -114
  135. package/Tests/App/SensitiveUrlTokenBootstrap.test.ts +64 -3
  136. package/Tests/App/StatusPage/StatusPageUnsubscribePage.test.tsx +412 -0
  137. package/Tests/Models/IncidentCustomFieldApiSchemaContract.test.ts +217 -0
  138. package/Tests/Models/IncidentCustomFieldCreateSettingsColumns.test.ts +252 -0
  139. package/Tests/Models/StatusPageSubscriberUnsubscribeColumns.test.ts +218 -0
  140. package/Tests/Server/API/ExpiredSessionRouteGuards.test.ts +7 -0
  141. package/Tests/Server/API/IncidentSubscriberAudienceAPI.test.ts +1408 -0
  142. package/Tests/Server/API/StatusPageIncidentScope.test.ts +1868 -0
  143. package/Tests/Server/API/StatusPageIncidentScopePostgres.test.ts +790 -0
  144. package/Tests/Server/API/StatusPageManageSubscriptionRecipient.test.ts +10 -1
  145. package/Tests/Server/API/StatusPageManageSubscriptionTemplateVariables.test.ts +206 -18
  146. package/Tests/Server/API/StatusPagePostmortemVisibility.test.ts +14 -2
  147. package/Tests/Server/API/StatusPageSubscriberCreateResponse.test.ts +217 -0
  148. package/Tests/Server/API/StatusPageSubscriberOwnership.test.ts +103 -2
  149. package/Tests/Server/API/StatusPageUnsubscribeAPI.test.ts +396 -0
  150. package/Tests/Server/Infrastructure/Postgres/AddIncidentStatusPageScopeMigration.test.ts +395 -0
  151. package/Tests/Server/Infrastructure/Postgres/AddIncidentTemplateStatusPageScopeFlagMigration.test.ts +150 -0
  152. package/Tests/Server/Infrastructure/Postgres/AddSubscriberNotificationClaimedAtMigration.test.ts +156 -0
  153. package/Tests/Server/Infrastructure/Postgres/RenameInventoryItemMigration.test.ts +90 -21
  154. package/Tests/Server/Infrastructure/Postgres/SkipHiddenIncidentCreatedNotificationsMigration.test.ts +410 -0
  155. package/Tests/Server/Middleware/IdentityRateLimit.test.ts +551 -1
  156. package/Tests/Server/Middleware/SubscriberNotificationPreviewRateLimit.test.ts +238 -0
  157. package/Tests/Server/Middleware/SubscriberNotificationTestSendRateLimit.test.ts +245 -0
  158. package/Tests/Server/Services/AddStatusPageSubscriberUnsubscribeTokenMigration.test.ts +152 -0
  159. package/Tests/Server/Services/CrossProjectRelationWriteGuard.test.ts +221 -36
  160. package/Tests/Server/Services/DatabaseServiceCompareAndSetColumns.test.ts +191 -0
  161. package/Tests/Server/Services/DomainService.test.ts +525 -0
  162. package/Tests/Server/Services/IncidentAlertAcknowledgeOnDeclare.test.ts +2630 -0
  163. package/Tests/Server/Services/IncidentAlertPostgres.test.ts +1625 -1
  164. package/Tests/Server/Services/IncidentCreatedRenotifyOnPublish.test.ts +681 -0
  165. package/Tests/Server/Services/IncidentCreatedResend.test.ts +775 -0
  166. package/Tests/Server/Services/IncidentCustomFieldRenamePostgres.test.ts +713 -0
  167. package/Tests/Server/Services/IncidentCustomFieldService.test.ts +751 -0
  168. package/Tests/Server/Services/IncidentCustomFieldValueValidation.test.ts +556 -0
  169. package/Tests/Server/Services/IncidentDeclareAcknowledgeAlerts.test.ts +2189 -0
  170. package/Tests/Server/Services/IncidentStatusPageScope.test.ts +2971 -0
  171. package/Tests/Server/Services/IncidentStatusPageScopeFeed.test.ts +131 -0
  172. package/Tests/Server/Services/IncidentStatusPageScopePostgres.test.ts +625 -0
  173. package/Tests/Server/Services/IncidentTemplateCustomFieldsCopy.test.ts +311 -0
  174. package/Tests/Server/Services/IncidentTemplateStatusPageScope.test.ts +363 -0
  175. package/Tests/Server/Services/InventoryItemServiceOverviewCounts.test.ts +345 -0
  176. package/Tests/Server/Services/InventoryOverviewPostgres.test.ts +254 -0
  177. package/Tests/Server/Services/IoTDeviceCredentialService.test.ts +819 -0
  178. package/Tests/Server/Services/LinkedAffectedResourcesCreatedFeed.test.ts +420 -0
  179. package/Tests/Server/Services/PublicNoteEditFeedEventType.test.ts +213 -0
  180. package/Tests/Server/Services/PublicNoteResendAccess.test.ts +994 -0
  181. package/Tests/Server/Services/ScheduledMaintenanceSubscriberTemplateFormats.test.ts +289 -9
  182. package/Tests/Server/Services/SloAffectedResourceCreatedFeed.test.ts +92 -36
  183. package/Tests/Server/Services/SmsServiceFailIfNotSent.test.ts +67 -0
  184. package/Tests/Server/Services/StatusPageReportIncidentCounts.test.ts +610 -0
  185. package/Tests/Server/Services/StatusPageSubscriberAudienceCounts.test.ts +201 -0
  186. package/Tests/Server/Services/StatusPageSubscriberAudienceCountsPostgres.test.ts +271 -0
  187. package/Tests/Server/Services/StatusPageSubscriberConfirmationTemplateEscaping.test.ts +200 -0
  188. package/Tests/Server/Services/StatusPageSubscriberNotificationLogRedaction.test.ts +54 -0
  189. package/Tests/Server/Services/StatusPageSubscriberNotificationTemplateCompile.test.ts +37 -0
  190. package/Tests/Server/Services/StatusPageSubscriberNotificationTemplateIncidentRecordAccess.test.ts +772 -0
  191. package/Tests/Server/Services/StatusPageSubscriberNotificationTemplateLookup.test.ts +506 -0
  192. package/Tests/Server/Services/StatusPageSubscriberNotificationTemplateLookupPostgres.test.ts +261 -0
  193. package/Tests/Server/Services/StatusPageSubscriberReport.test.ts +21 -5
  194. package/Tests/Server/Services/StatusPageSubscriberUnsubscribe.test.ts +1618 -0
  195. package/Tests/Server/Services/StatusPageSubscriberUnsubscribeLinkSenders.test.ts +373 -0
  196. package/Tests/Server/Services/StatusPageSubscriberUnsubscribePostgres.test.ts +388 -0
  197. package/Tests/Server/Services/SubscriberNotificationInFlightRequeue.test.ts +500 -0
  198. package/Tests/Server/Types/MarkdownEmailLinks.test.ts +320 -0
  199. package/Tests/Server/Types/Workflow/Components/Email.test.ts +491 -1
  200. package/Tests/Server/Types/Workflow/Components/EmailSmtpPinning.test.ts +398 -0
  201. package/Tests/Server/Utils/AffectedResources/LinkedAffectedResources.test.ts +858 -0
  202. package/Tests/Server/Utils/Alert/AlertStateChangeAuthorization.test.ts +1172 -0
  203. package/Tests/Server/Utils/CustomField/CustomFieldRename.test.ts +586 -0
  204. package/Tests/Server/Utils/DataSource/EgressGuard.test.ts +246 -10
  205. package/Tests/Server/Utils/DataSource/EgressGuardDeploymentConfig.test.ts +226 -0
  206. package/Tests/Server/Utils/DataSource/EgressGuardPinning.test.ts +131 -0
  207. package/Tests/Server/Utils/DataSource/HttpFetch.test.ts +4 -0
  208. package/Tests/Server/Utils/EgressPolicyEnvironment.ts +45 -0
  209. package/Tests/Server/Utils/Mail/PinnedSmtpSocket.test.ts +409 -0
  210. package/Tests/Server/Utils/Monitor/MonitorCriteriaObservationBuilderUnits.test.ts +23 -0
  211. package/Tests/Server/Utils/SSRFProtection.test.ts +4 -0
  212. package/Tests/Server/Utils/SSRFProtectionCloudServiceAddresses.test.ts +4 -0
  213. package/Tests/Server/Utils/SSRFProtectionPrivateNetwork.test.ts +4 -0
  214. package/Tests/Server/Utils/SSRFProtectionResolutionDetail.test.ts +314 -0
  215. package/Tests/Server/Utils/StatusPage/IncidentStatusPageScope.test.ts +1699 -0
  216. package/Tests/Server/Utils/StatusPage/IncidentStatusPageScopeQueriesPostgres.test.ts +508 -0
  217. package/Tests/Server/Utils/StatusPage/IncidentSubscriberAudienceCallerPermission.test.ts +246 -0
  218. package/Tests/Server/Utils/StatusPage/IncidentTemplateVariableBuilder.test.ts +1348 -0
  219. package/Tests/Server/Utils/StatusPage/StatusPageReadAccess.test.ts +221 -0
  220. package/Tests/Server/Utils/StatusPage/StatusPageSubscriberUnsubscribeNotice.test.ts +132 -0
  221. package/Tests/Server/Utils/StatusPage/StatusPageSubscriberUnsubscribeToken.test.ts +155 -0
  222. package/Tests/Server/Utils/StatusPage/SubscriberIncidentEmailBuilder.test.ts +708 -0
  223. package/Tests/Server/Utils/StatusPage/SubscriberNotificationClaim.test.ts +255 -0
  224. package/Tests/Server/Utils/StatusPage/SubscriberNotificationClaimPostgres.test.ts +528 -0
  225. package/Tests/Server/Utils/StatusPage/SubscriberNotificationDeliveryRecord.test.ts +1238 -0
  226. package/Tests/Server/Utils/StatusPage/SubscriberNotificationFanOut.test.ts +472 -0
  227. package/Tests/Server/Utils/StatusPage/SubscriberNotificationPreviewBuilder.test.ts +1168 -0
  228. package/Tests/Server/Utils/StatusPage/SubscriberNotificationRunLimit.test.ts +275 -0
  229. package/Tests/Server/Utils/StatusPage/SubscriberNotificationTiming.test.ts +131 -0
  230. package/Tests/Server/Utils/StatusPageResource.test.ts +98 -0
  231. package/Tests/Server/Utils/Topology/InventoryItemEntityKeyIndexMigration.test.ts +386 -0
  232. package/Tests/Server/Utils/Topology/InventoryItemEntityKeyIndexMigrationPostgres.test.ts +430 -0
  233. package/Tests/Server/Utils/Topology/TopologyActivityParityPostgres.test.ts +279 -0
  234. package/Tests/Server/Utils/Topology/TopologyConcurrencyLimiter.test.ts +534 -0
  235. package/Tests/Server/Utils/Topology/TopologyEstateGenerator.ts +624 -0
  236. package/Tests/Server/Utils/Topology/TopologyJsonResponse.test.ts +90 -0
  237. package/Tests/Server/Utils/Topology/TopologyQueries.test.ts +1634 -0
  238. package/Tests/Server/Utils/Topology/TopologyQueriesDifferentialPostgres.test.ts +683 -0
  239. package/Tests/Server/Utils/Topology/TopologyQueriesPostgres.test.ts +2624 -0
  240. package/Tests/Server/Utils/Topology/TopologyReference.ts +1018 -0
  241. package/Tests/Server/Utils/Topology/TopologyRequest.test.ts +643 -0
  242. package/Tests/Server/Utils/Topology/TopologyResponseCache.test.ts +305 -0
  243. package/Tests/Server/Utils/Topology/TopologySql.test.ts +973 -0
  244. package/Tests/Server/Utils/VM/VMRunnerPrivateNetworkWiring.test.ts +17 -0
  245. package/Tests/Server/Utils/VM/VMRunnerSsrf.test.ts +75 -0
  246. package/Tests/Types/CustomField/CustomFieldSavedViews.test.ts +247 -0
  247. package/Tests/Types/CustomField/CustomFieldTemplateValues.test.ts +186 -0
  248. package/Tests/Types/CustomField/CustomFieldTypeCorrespondence.test.ts +48 -0
  249. package/Tests/Types/CustomField/CustomFieldValueFormat.test.ts +215 -0
  250. package/Tests/Types/CustomField/CustomFieldValueValidator.test.ts +343 -0
  251. package/Tests/Types/CustomField/CustomFieldVariableKey.test.ts +364 -0
  252. package/Tests/Types/SafeHtml.test.ts +102 -0
  253. package/Tests/Types/StatusPage/IncidentCreatedRenotify.test.ts +419 -0
  254. package/Tests/Types/StatusPage/IncidentCreatedResend.test.ts +118 -0
  255. package/Tests/Types/StatusPage/IncidentScopeAddedPagesNotification.test.ts +558 -0
  256. package/Tests/Types/StatusPage/IncidentSubscriberAudience.test.ts +284 -0
  257. package/Tests/Types/StatusPage/StatusPageSubscriberUnsubscribe.test.ts +341 -0
  258. package/Tests/Types/StatusPage/SubscriberNotificationPreview.test.ts +196 -0
  259. package/Tests/Types/StatusPage/SubscriberNotificationResend.test.ts +201 -0
  260. package/Tests/Types/StatusPage/SubscriberNotificationTemplateCompiler.test.ts +277 -0
  261. package/Tests/Types/StatusPage/SubscriberNotificationTemplatePreview.test.ts +179 -0
  262. package/Tests/Types/StatusPage/SubscriberNotificationTemplateVariables.test.ts +324 -0
  263. package/Tests/Types/StatusPage/SubscriberUpdateNotification.test.ts +60 -13
  264. package/Tests/Types/Topology/TopologyTypeRules.test.ts +176 -0
  265. package/Tests/UI/Components/CustomFields/CustomFieldFormFields.test.ts +432 -0
  266. package/Tests/UI/Components/CustomFields/CustomFieldModelFormFields.test.tsx +685 -0
  267. package/Tests/UI/Components/CustomFields/CustomFieldsDetailOrder.test.tsx +469 -0
  268. package/Tests/UI/Components/Forms/ModelFormCustomFieldInputs.test.tsx +325 -0
  269. package/Tests/UI/Components/Forms/ModelFormDropdownOptionsRefused.test.tsx +358 -0
  270. package/Tests/UI/Components/ModelTable/CustomFieldColumns.test.tsx +22 -0
  271. package/Tests/UI/Monitor/NetworkPathView.test.tsx +289 -0
  272. package/Tests/Utils/Incident/IncidentFromAlerts.test.ts +302 -0
  273. package/Tests/Utils/Incident/IncidentNoteTemplateVariables.test.ts +623 -0
  274. package/Tests/Utils/Markdown/MarkdownEscape.test.ts +89 -0
  275. package/Tests/Utils/ProbeNetworkFailureUtil.test.ts +992 -0
  276. package/Tests/Utils/RequestFailedDetails.test.ts +575 -0
  277. package/Types/CustomField/CustomFieldOrder.ts +55 -0
  278. package/Types/CustomField/CustomFieldSavedViews.ts +225 -0
  279. package/Types/CustomField/CustomFieldTemplateMerge.ts +71 -0
  280. package/Types/CustomField/CustomFieldType.ts +14 -0
  281. package/Types/CustomField/CustomFieldValueFormat.ts +161 -0
  282. package/Types/CustomField/CustomFieldValueValidator.ts +488 -0
  283. package/Types/CustomField/CustomFieldVariableKey.ts +211 -0
  284. package/Types/Incident/IncidentAlertLink.ts +19 -0
  285. package/Types/SafeHtml.ts +93 -0
  286. package/Types/StatusPage/IncidentCreatedRenotify.ts +224 -0
  287. package/Types/StatusPage/IncidentCreatedResend.ts +108 -0
  288. package/Types/StatusPage/IncidentScopeAddedPagesNotification.ts +343 -0
  289. package/Types/StatusPage/IncidentSubscriberAudience.ts +332 -0
  290. package/Types/StatusPage/StatusPageSubscriberUnsubscribe.ts +405 -0
  291. package/Types/StatusPage/SubscriberNotificationInterruption.ts +32 -0
  292. package/Types/StatusPage/SubscriberNotificationPreview.ts +322 -0
  293. package/Types/StatusPage/SubscriberNotificationResend.ts +132 -0
  294. package/Types/StatusPage/SubscriberNotificationTemplateCompiler.ts +180 -0
  295. package/Types/StatusPage/SubscriberNotificationTemplatePreview.ts +301 -0
  296. package/Types/StatusPage/SubscriberNotificationTemplateVariables.ts +217 -4
  297. package/Types/StatusPage/SubscriberUpdateNotification.ts +32 -11
  298. package/Types/Telemetry/InventoryLiveness.ts +26 -0
  299. package/Types/Topology/TopologyApi.ts +428 -0
  300. package/Types/Topology/TopologyTypeRules.ts +191 -0
  301. package/UI/Components/CustomFields/CustomFieldFormFields.ts +317 -0
  302. package/UI/Components/CustomFields/CustomFieldModelFormFields.tsx +395 -0
  303. package/UI/Components/CustomFields/CustomFieldsDetail.tsx +95 -55
  304. package/UI/Components/Forms/ModelForm.tsx +70 -8
  305. package/UI/Components/Forms/Validation.ts +1 -1
  306. package/UI/Components/ModelFormModal/ModelFormModal.tsx +2 -4
  307. package/UI/Components/ModelTable/AnalyticsModelTable.tsx +2 -6
  308. package/UI/Components/ModelTable/BaseModelTable.tsx +9 -8
  309. package/UI/Components/ModelTable/CustomFieldColumns.tsx +14 -1
  310. package/UI/Components/ModelTable/ModelTable.tsx +6 -7
  311. package/UI/Utils/SensitiveUrlToken.ts +10 -5
  312. package/Utils/API.ts +247 -2
  313. package/Utils/Incident/IncidentFromAlerts.ts +78 -0
  314. package/Utils/Incident/IncidentNoteTemplateVariables.ts +304 -0
  315. package/Utils/Markdown/MarkdownEscape.ts +65 -0
  316. package/Utils/ProbeNetworkFailureUtil.ts +673 -0
  317. package/build/dist/Models/DatabaseModels/Incident.js +267 -1
  318. package/build/dist/Models/DatabaseModels/Incident.js.map +1 -1
  319. package/build/dist/Models/DatabaseModels/IncidentCustomField.js +207 -1
  320. package/build/dist/Models/DatabaseModels/IncidentCustomField.js.map +1 -1
  321. package/build/dist/Models/DatabaseModels/IncidentEpisode.js +31 -0
  322. package/build/dist/Models/DatabaseModels/IncidentEpisode.js.map +1 -1
  323. package/build/dist/Models/DatabaseModels/IncidentTemplate.js +124 -1
  324. package/build/dist/Models/DatabaseModels/IncidentTemplate.js.map +1 -1
  325. package/build/dist/Models/DatabaseModels/InventoryItem.js +20 -11
  326. package/build/dist/Models/DatabaseModels/InventoryItem.js.map +1 -1
  327. package/build/dist/Models/DatabaseModels/StatusPage.js +56 -0
  328. package/build/dist/Models/DatabaseModels/StatusPage.js.map +1 -1
  329. package/build/dist/Models/DatabaseModels/StatusPageSubscriber.js +131 -0
  330. package/build/dist/Models/DatabaseModels/StatusPageSubscriber.js.map +1 -1
  331. package/build/dist/Server/API/IncidentAPI.js +100 -1
  332. package/build/dist/Server/API/IncidentAPI.js.map +1 -1
  333. package/build/dist/Server/API/StatusPageAPI.js +417 -176
  334. package/build/dist/Server/API/StatusPageAPI.js.map +1 -1
  335. package/build/dist/Server/API/StatusPageSubscriberAPI.js +52 -13
  336. package/build/dist/Server/API/StatusPageSubscriberAPI.js.map +1 -1
  337. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1795200000000-AddInventoryItemProjectEntityKeyIndex.js +165 -0
  338. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1795200000000-AddInventoryItemProjectEntityKeyIndex.js.map +1 -0
  339. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1795300000000-SkipHiddenIncidentCreatedNotifications.js +41 -0
  340. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1795300000000-SkipHiddenIncidentCreatedNotifications.js.map +1 -0
  341. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1795400000000-AddIncidentStatusPageScope.js +57 -0
  342. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1795400000000-AddIncidentStatusPageScope.js.map +1 -0
  343. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1795500000000-AddIncidentTemplateStatusPageScopeFlag.js +23 -0
  344. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1795500000000-AddIncidentTemplateStatusPageScopeFlag.js.map +1 -0
  345. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1795600000000-AddStatusPageSubscriberUnsubscribeToken.js +40 -0
  346. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1795600000000-AddStatusPageSubscriberUnsubscribeToken.js.map +1 -0
  347. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1795700000000-AddStatusPageSubscriberIsAddedByTeam.js +26 -0
  348. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1795700000000-AddStatusPageSubscriberIsAddedByTeam.js.map +1 -0
  349. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1795800000000-AddIncidentCustomFieldCreateAndNotificationSettings.js +89 -0
  350. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1795800000000-AddIncidentCustomFieldCreateAndNotificationSettings.js.map +1 -0
  351. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1795900000000-AddSubscriberNotificationClaimedAt.js +29 -0
  352. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1795900000000-AddSubscriberNotificationClaimedAt.js.map +1 -0
  353. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js +16 -0
  354. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js.map +1 -1
  355. package/build/dist/Server/Infrastructure/Semaphore.js +3 -0
  356. package/build/dist/Server/Infrastructure/Semaphore.js.map +1 -1
  357. package/build/dist/Server/Middleware/IdentityRateLimit.js +89 -3
  358. package/build/dist/Server/Middleware/IdentityRateLimit.js.map +1 -1
  359. package/build/dist/Server/Middleware/SubscriberNotificationPreviewRateLimit.js +149 -0
  360. package/build/dist/Server/Middleware/SubscriberNotificationPreviewRateLimit.js.map +1 -0
  361. package/build/dist/Server/Middleware/SubscriberNotificationTestSendRateLimit.js +190 -0
  362. package/build/dist/Server/Middleware/SubscriberNotificationTestSendRateLimit.js.map +1 -0
  363. package/build/dist/Server/Services/AlertService.js +21 -33
  364. package/build/dist/Server/Services/AlertService.js.map +1 -1
  365. package/build/dist/Server/Services/DatabaseService.js +56 -7
  366. package/build/dist/Server/Services/DatabaseService.js.map +1 -1
  367. package/build/dist/Server/Services/IncidentAlertService.js +457 -3
  368. package/build/dist/Server/Services/IncidentAlertService.js.map +1 -1
  369. package/build/dist/Server/Services/IncidentCustomFieldService.js +204 -8
  370. package/build/dist/Server/Services/IncidentCustomFieldService.js.map +1 -1
  371. package/build/dist/Server/Services/IncidentEpisodePublicNoteService.js +24 -0
  372. package/build/dist/Server/Services/IncidentEpisodePublicNoteService.js.map +1 -1
  373. package/build/dist/Server/Services/IncidentEpisodeService.js +14 -0
  374. package/build/dist/Server/Services/IncidentEpisodeService.js.map +1 -1
  375. package/build/dist/Server/Services/IncidentEpisodeStateTimelineService.js +26 -0
  376. package/build/dist/Server/Services/IncidentEpisodeStateTimelineService.js.map +1 -1
  377. package/build/dist/Server/Services/IncidentPublicNoteService.js +26 -1
  378. package/build/dist/Server/Services/IncidentPublicNoteService.js.map +1 -1
  379. package/build/dist/Server/Services/IncidentService.js +1148 -42
  380. package/build/dist/Server/Services/IncidentService.js.map +1 -1
  381. package/build/dist/Server/Services/IncidentStateTimelineService.js +12 -0
  382. package/build/dist/Server/Services/IncidentStateTimelineService.js.map +1 -1
  383. package/build/dist/Server/Services/IncidentTemplateService.js +83 -0
  384. package/build/dist/Server/Services/IncidentTemplateService.js.map +1 -1
  385. package/build/dist/Server/Services/InventoryItemService.js +31 -0
  386. package/build/dist/Server/Services/InventoryItemService.js.map +1 -1
  387. package/build/dist/Server/Services/IoTDeviceCredentialService.js +12 -5
  388. package/build/dist/Server/Services/IoTDeviceCredentialService.js.map +1 -1
  389. package/build/dist/Server/Services/ScheduledMaintenancePublicNoteService.js +26 -1
  390. package/build/dist/Server/Services/ScheduledMaintenancePublicNoteService.js.map +1 -1
  391. package/build/dist/Server/Services/ScheduledMaintenanceService.js +84 -57
  392. package/build/dist/Server/Services/ScheduledMaintenanceService.js.map +1 -1
  393. package/build/dist/Server/Services/SmsService.js +2 -22
  394. package/build/dist/Server/Services/SmsService.js.map +1 -1
  395. package/build/dist/Server/Services/StatusPageService.js +47 -9
  396. package/build/dist/Server/Services/StatusPageService.js.map +1 -1
  397. package/build/dist/Server/Services/StatusPageSubscriberNotificationTemplateService.js +237 -32
  398. package/build/dist/Server/Services/StatusPageSubscriberNotificationTemplateService.js.map +1 -1
  399. package/build/dist/Server/Services/StatusPageSubscriberNotificationTemplateStatusPageService.js +109 -0
  400. package/build/dist/Server/Services/StatusPageSubscriberNotificationTemplateStatusPageService.js.map +1 -1
  401. package/build/dist/Server/Services/StatusPageSubscriberService.js +925 -99
  402. package/build/dist/Server/Services/StatusPageSubscriberService.js.map +1 -1
  403. package/build/dist/Server/Services/UserNotificationRuleService.js +55 -51
  404. package/build/dist/Server/Services/UserNotificationRuleService.js.map +1 -1
  405. package/build/dist/Server/Services/WorkspaceNotificationSummaryService.js +42 -25
  406. package/build/dist/Server/Services/WorkspaceNotificationSummaryService.js.map +1 -1
  407. package/build/dist/Server/Types/Markdown.js +110 -6
  408. package/build/dist/Server/Types/Markdown.js.map +1 -1
  409. package/build/dist/Server/Types/Workflow/Components/Email.js +55 -6
  410. package/build/dist/Server/Types/Workflow/Components/Email.js.map +1 -1
  411. package/build/dist/Server/Utils/AffectedResources/LinkedAffectedResources.js +405 -0
  412. package/build/dist/Server/Utils/AffectedResources/LinkedAffectedResources.js.map +1 -0
  413. package/build/dist/Server/Utils/Alert/AlertStateChangeAuthorization.js +112 -0
  414. package/build/dist/Server/Utils/Alert/AlertStateChangeAuthorization.js.map +1 -0
  415. package/build/dist/Server/Utils/CustomField/CustomFieldRename.js +211 -0
  416. package/build/dist/Server/Utils/CustomField/CustomFieldRename.js.map +1 -0
  417. package/build/dist/Server/Utils/DataSource/EgressGuard.js +41 -12
  418. package/build/dist/Server/Utils/DataSource/EgressGuard.js.map +1 -1
  419. package/build/dist/Server/Utils/Inventory/InventoryOverviewAggregation.js +81 -0
  420. package/build/dist/Server/Utils/Inventory/InventoryOverviewAggregation.js.map +1 -0
  421. package/build/dist/Server/Utils/Mail/PinnedSmtpSocket.js +101 -0
  422. package/build/dist/Server/Utils/Mail/PinnedSmtpSocket.js.map +1 -0
  423. package/build/dist/Server/Utils/Monitor/MonitorCriteriaObservationBuilder.js +9 -0
  424. package/build/dist/Server/Utils/Monitor/MonitorCriteriaObservationBuilder.js.map +1 -1
  425. package/build/dist/Server/Utils/Response.js +30 -0
  426. package/build/dist/Server/Utils/Response.js.map +1 -1
  427. package/build/dist/Server/Utils/SSRFProtection.js +48 -6
  428. package/build/dist/Server/Utils/SSRFProtection.js.map +1 -1
  429. package/build/dist/Server/Utils/StatusPage/IncidentStatusPageScope.js +631 -0
  430. package/build/dist/Server/Utils/StatusPage/IncidentStatusPageScope.js.map +1 -0
  431. package/build/dist/Server/Utils/StatusPage/IncidentSubscriberAudienceBuilder.js +403 -0
  432. package/build/dist/Server/Utils/StatusPage/IncidentSubscriberAudienceBuilder.js.map +1 -0
  433. package/build/dist/Server/Utils/StatusPage/IncidentTemplateVariableBuilder.js +451 -0
  434. package/build/dist/Server/Utils/StatusPage/IncidentTemplateVariableBuilder.js.map +1 -0
  435. package/build/dist/Server/Utils/StatusPage/StatusPageExclusion.js +13 -0
  436. package/build/dist/Server/Utils/StatusPage/StatusPageExclusion.js.map +1 -0
  437. package/build/dist/Server/Utils/StatusPage/StatusPageReadAccess.js +91 -0
  438. package/build/dist/Server/Utils/StatusPage/StatusPageReadAccess.js.map +1 -0
  439. package/build/dist/Server/Utils/StatusPage/StatusPageSubscriberUnsubscribeNotice.js +101 -0
  440. package/build/dist/Server/Utils/StatusPage/StatusPageSubscriberUnsubscribeNotice.js.map +1 -0
  441. package/build/dist/Server/Utils/StatusPage/StatusPageSubscriberUnsubscribeToken.js +47 -0
  442. package/build/dist/Server/Utils/StatusPage/StatusPageSubscriberUnsubscribeToken.js.map +1 -0
  443. package/build/dist/Server/Utils/StatusPage/SubscriberIncidentEmailBuilder.js +273 -0
  444. package/build/dist/Server/Utils/StatusPage/SubscriberIncidentEmailBuilder.js.map +1 -0
  445. package/build/dist/Server/Utils/StatusPage/SubscriberNotificationClaim.js +73 -0
  446. package/build/dist/Server/Utils/StatusPage/SubscriberNotificationClaim.js.map +1 -0
  447. package/build/dist/Server/Utils/StatusPage/SubscriberNotificationDeliveryRecord.js +722 -0
  448. package/build/dist/Server/Utils/StatusPage/SubscriberNotificationDeliveryRecord.js.map +1 -0
  449. package/build/dist/Server/Utils/StatusPage/SubscriberNotificationFanOut.js +102 -0
  450. package/build/dist/Server/Utils/StatusPage/SubscriberNotificationFanOut.js.map +1 -0
  451. package/build/dist/Server/Utils/StatusPage/SubscriberNotificationPreviewBuilder.js +527 -0
  452. package/build/dist/Server/Utils/StatusPage/SubscriberNotificationPreviewBuilder.js.map +1 -0
  453. package/build/dist/Server/Utils/StatusPage/SubscriberNotificationResendAccess.js +278 -0
  454. package/build/dist/Server/Utils/StatusPage/SubscriberNotificationResendAccess.js.map +1 -0
  455. package/build/dist/Server/Utils/StatusPage/SubscriberNotificationRunLimit.js +137 -0
  456. package/build/dist/Server/Utils/StatusPage/SubscriberNotificationRunLimit.js.map +1 -0
  457. package/build/dist/Server/Utils/StatusPage/SubscriberNotificationTiming.js +103 -0
  458. package/build/dist/Server/Utils/StatusPage/SubscriberNotificationTiming.js.map +1 -0
  459. package/build/dist/Server/Utils/StatusPage/SubscriberTemplateIncidentRecordAccess.js +114 -0
  460. package/build/dist/Server/Utils/StatusPage/SubscriberTemplateIncidentRecordAccess.js.map +1 -0
  461. package/build/dist/Server/Utils/StatusPageResource.js +39 -7
  462. package/build/dist/Server/Utils/StatusPageResource.js.map +1 -1
  463. package/build/dist/Server/Utils/Topology/TopologyConcurrencyLimiter.js +178 -0
  464. package/build/dist/Server/Utils/Topology/TopologyConcurrencyLimiter.js.map +1 -0
  465. package/build/dist/Server/Utils/Topology/TopologyQueries.js +884 -0
  466. package/build/dist/Server/Utils/Topology/TopologyQueries.js.map +1 -0
  467. package/build/dist/Server/Utils/Topology/TopologyRequest.js +275 -0
  468. package/build/dist/Server/Utils/Topology/TopologyRequest.js.map +1 -0
  469. package/build/dist/Server/Utils/Topology/TopologyResponseCache.js +146 -0
  470. package/build/dist/Server/Utils/Topology/TopologyResponseCache.js.map +1 -0
  471. package/build/dist/Server/Utils/Topology/TopologySql.js +688 -0
  472. package/build/dist/Server/Utils/Topology/TopologySql.js.map +1 -0
  473. package/build/dist/Server/Utils/VM/VMAPI.js.map +1 -1
  474. package/build/dist/Server/Utils/VM/VMRunner.js +1 -0
  475. package/build/dist/Server/Utils/VM/VMRunner.js.map +1 -1
  476. package/build/dist/Server/Utils/Workflow/OAuth2TokenClient.js +3 -0
  477. package/build/dist/Server/Utils/Workflow/OAuth2TokenClient.js.map +1 -1
  478. package/build/dist/Types/CustomField/CustomFieldOrder.js +36 -0
  479. package/build/dist/Types/CustomField/CustomFieldOrder.js.map +1 -0
  480. package/build/dist/Types/CustomField/CustomFieldSavedViews.js +135 -0
  481. package/build/dist/Types/CustomField/CustomFieldSavedViews.js.map +1 -0
  482. package/build/dist/Types/CustomField/CustomFieldTemplateMerge.js +27 -0
  483. package/build/dist/Types/CustomField/CustomFieldTemplateMerge.js.map +1 -0
  484. package/build/dist/Types/CustomField/CustomFieldType.js +12 -0
  485. package/build/dist/Types/CustomField/CustomFieldType.js.map +1 -1
  486. package/build/dist/Types/CustomField/CustomFieldValueFormat.js +126 -0
  487. package/build/dist/Types/CustomField/CustomFieldValueFormat.js.map +1 -0
  488. package/build/dist/Types/CustomField/CustomFieldValueValidator.js +280 -0
  489. package/build/dist/Types/CustomField/CustomFieldValueValidator.js.map +1 -0
  490. package/build/dist/Types/CustomField/CustomFieldVariableKey.js +150 -0
  491. package/build/dist/Types/CustomField/CustomFieldVariableKey.js.map +1 -0
  492. package/build/dist/Types/Incident/IncidentAlertLink.js +17 -0
  493. package/build/dist/Types/Incident/IncidentAlertLink.js.map +1 -1
  494. package/build/dist/Types/SafeHtml.js +84 -0
  495. package/build/dist/Types/SafeHtml.js.map +1 -0
  496. package/build/dist/Types/StatusPage/IncidentCreatedRenotify.js +117 -0
  497. package/build/dist/Types/StatusPage/IncidentCreatedRenotify.js.map +1 -0
  498. package/build/dist/Types/StatusPage/IncidentCreatedResend.js +86 -0
  499. package/build/dist/Types/StatusPage/IncidentCreatedResend.js.map +1 -0
  500. package/build/dist/Types/StatusPage/IncidentScopeAddedPagesNotification.js +246 -0
  501. package/build/dist/Types/StatusPage/IncidentScopeAddedPagesNotification.js.map +1 -0
  502. package/build/dist/Types/StatusPage/IncidentSubscriberAudience.js +183 -0
  503. package/build/dist/Types/StatusPage/IncidentSubscriberAudience.js.map +1 -0
  504. package/build/dist/Types/StatusPage/StatusPageSubscriberUnsubscribe.js +277 -0
  505. package/build/dist/Types/StatusPage/StatusPageSubscriberUnsubscribe.js.map +1 -0
  506. package/build/dist/Types/StatusPage/SubscriberNotificationInterruption.js +27 -0
  507. package/build/dist/Types/StatusPage/SubscriberNotificationInterruption.js.map +1 -0
  508. package/build/dist/Types/StatusPage/SubscriberNotificationPreview.js +190 -0
  509. package/build/dist/Types/StatusPage/SubscriberNotificationPreview.js.map +1 -0
  510. package/build/dist/Types/StatusPage/SubscriberNotificationResend.js +102 -0
  511. package/build/dist/Types/StatusPage/SubscriberNotificationResend.js.map +1 -0
  512. package/build/dist/Types/StatusPage/SubscriberNotificationTemplateCompiler.js +97 -0
  513. package/build/dist/Types/StatusPage/SubscriberNotificationTemplateCompiler.js.map +1 -0
  514. package/build/dist/Types/StatusPage/SubscriberNotificationTemplatePreview.js +175 -0
  515. package/build/dist/Types/StatusPage/SubscriberNotificationTemplatePreview.js.map +1 -0
  516. package/build/dist/Types/StatusPage/SubscriberNotificationTemplateVariables.js +144 -4
  517. package/build/dist/Types/StatusPage/SubscriberNotificationTemplateVariables.js.map +1 -1
  518. package/build/dist/Types/StatusPage/SubscriberUpdateNotification.js +29 -9
  519. package/build/dist/Types/StatusPage/SubscriberUpdateNotification.js.map +1 -1
  520. package/build/dist/Types/Telemetry/InventoryLiveness.js +23 -0
  521. package/build/dist/Types/Telemetry/InventoryLiveness.js.map +1 -1
  522. package/build/dist/Types/Topology/TopologyApi.js +55 -0
  523. package/build/dist/Types/Topology/TopologyApi.js.map +1 -0
  524. package/build/dist/Types/Topology/TopologyTypeRules.js +165 -0
  525. package/build/dist/Types/Topology/TopologyTypeRules.js.map +1 -0
  526. package/build/dist/UI/Components/CustomFields/CustomFieldFormFields.js +169 -0
  527. package/build/dist/UI/Components/CustomFields/CustomFieldFormFields.js.map +1 -0
  528. package/build/dist/UI/Components/CustomFields/CustomFieldModelFormFields.js +212 -0
  529. package/build/dist/UI/Components/CustomFields/CustomFieldModelFormFields.js.map +1 -0
  530. package/build/dist/UI/Components/CustomFields/CustomFieldsDetail.js +64 -49
  531. package/build/dist/UI/Components/CustomFields/CustomFieldsDetail.js.map +1 -1
  532. package/build/dist/UI/Components/Forms/ModelForm.js +39 -5
  533. package/build/dist/UI/Components/Forms/ModelForm.js.map +1 -1
  534. package/build/dist/UI/Components/Forms/Validation.js +1 -1
  535. package/build/dist/UI/Components/Forms/Validation.js.map +1 -1
  536. package/build/dist/UI/Components/ModelFormModal/ModelFormModal.js.map +1 -1
  537. package/build/dist/UI/Components/ModelTable/AnalyticsModelTable.js.map +1 -1
  538. package/build/dist/UI/Components/ModelTable/BaseModelTable.js +2 -2
  539. package/build/dist/UI/Components/ModelTable/BaseModelTable.js.map +1 -1
  540. package/build/dist/UI/Components/ModelTable/CustomFieldColumns.js +13 -1
  541. package/build/dist/UI/Components/ModelTable/CustomFieldColumns.js.map +1 -1
  542. package/build/dist/UI/Components/ModelTable/ModelTable.js +1 -1
  543. package/build/dist/UI/Components/ModelTable/ModelTable.js.map +1 -1
  544. package/build/dist/UI/Utils/SensitiveUrlToken.js +10 -5
  545. package/build/dist/UI/Utils/SensitiveUrlToken.js.map +1 -1
  546. package/build/dist/Utils/API.js +177 -1
  547. package/build/dist/Utils/API.js.map +1 -1
  548. package/build/dist/Utils/Incident/IncidentFromAlerts.js +38 -0
  549. package/build/dist/Utils/Incident/IncidentFromAlerts.js.map +1 -1
  550. package/build/dist/Utils/Incident/IncidentNoteTemplateVariables.js +155 -0
  551. package/build/dist/Utils/Incident/IncidentNoteTemplateVariables.js.map +1 -0
  552. package/build/dist/Utils/Markdown/MarkdownEscape.js +48 -0
  553. package/build/dist/Utils/Markdown/MarkdownEscape.js.map +1 -1
  554. package/build/dist/Utils/ProbeNetworkFailureUtil.js +460 -0
  555. package/build/dist/Utils/ProbeNetworkFailureUtil.js.map +1 -0
  556. package/package.json +1 -1
@@ -23,6 +23,7 @@ import IoTFleet from "./IoTFleet";
23
23
  import DockerSwarmCluster from "./DockerSwarmCluster";
24
24
  import Service from "./Service";
25
25
  import ServiceLevelObjective from "./ServiceLevelObjective";
26
+ import StatusPage from "./StatusPage";
26
27
  import User from "./User";
27
28
  import File from "./File";
28
29
  import BaseModel from "./DatabaseBaseModel/DatabaseBaseModel";
@@ -1947,6 +1948,37 @@ export default class Incident extends BaseModel {
1947
1948
  })
1948
1949
  public subscriberNotificationStatusMessage?: string = undefined;
1949
1950
 
1951
+ /*
1952
+ * When a subscriber job last claimed the 'incident created' notification
1953
+ * (SubscriberNotificationClaim), which the sweeper
1954
+ * (StatusPageSubscriber:TimeoutStuckNotifications) times a notification
1955
+ * still In progress from. Not updatedAt: other code writes this row on a
1956
+ * schedule while the incident is open - the owners' reminders, state
1957
+ * changes, scope and field edits - so updatedAt could keep an interrupted
1958
+ * send from ever looking stuck, and Retry, Resend and the added-pages
1959
+ * notification all wait for it to settle. Written by the claim only;
1960
+ * nobody reads or writes it through the API.
1961
+ */
1962
+ @ColumnAccessControl({
1963
+ create: [],
1964
+ read: [],
1965
+ update: [],
1966
+ })
1967
+ @TableColumn({
1968
+ computed: true,
1969
+ hideColumnInDocumentation: true,
1970
+ required: false,
1971
+ type: TableColumnType.Date,
1972
+ title: "Subscriber Notification Claimed At on Incident Created",
1973
+ description:
1974
+ "When a subscriber notification job last started sending the notification that this incident was created.",
1975
+ })
1976
+ @Column({
1977
+ type: ColumnType.Date,
1978
+ nullable: true,
1979
+ })
1980
+ public subscriberNotificationClaimedAtOnIncidentCreated?: Date = undefined;
1981
+
1950
1982
  @ColumnAccessControl({
1951
1983
  create: [
1952
1984
  Permission.ProjectOwner,
@@ -2036,6 +2068,38 @@ export default class Incident extends BaseModel {
2036
2068
  public subscriberNotificationStatusMessageOnPostmortemPublished?: string =
2037
2069
  undefined;
2038
2070
 
2071
+ /*
2072
+ * When a subscriber job last claimed the postmortem notification
2073
+ * (SubscriberNotificationClaim), which the sweeper
2074
+ * (StatusPageSubscriber:TimeoutStuckNotifications) times a notification
2075
+ * still In progress from. Not updatedAt: other code writes this row on a
2076
+ * schedule while the incident is open - the owners' reminders, state
2077
+ * changes, scope and field edits - so updatedAt could keep an interrupted
2078
+ * send from ever looking stuck, and Retry, Resend and the added-pages
2079
+ * notification all wait for it to settle. Written by the claim only;
2080
+ * nobody reads or writes it through the API.
2081
+ */
2082
+ @ColumnAccessControl({
2083
+ create: [],
2084
+ read: [],
2085
+ update: [],
2086
+ })
2087
+ @TableColumn({
2088
+ computed: true,
2089
+ hideColumnInDocumentation: true,
2090
+ required: false,
2091
+ type: TableColumnType.Date,
2092
+ title: "Subscriber Notification Claimed At on Postmortem Published",
2093
+ description:
2094
+ "When a subscriber notification job last started sending the notification about this incident's postmortem.",
2095
+ })
2096
+ @Column({
2097
+ type: ColumnType.Date,
2098
+ nullable: true,
2099
+ })
2100
+ public subscriberNotificationClaimedAtOnPostmortemPublished?: Date =
2101
+ undefined;
2102
+
2039
2103
  @ColumnAccessControl({
2040
2104
  create: [
2041
2105
  Permission.ProjectOwner,
@@ -2104,7 +2168,8 @@ export default class Incident extends BaseModel {
2104
2168
  required: false,
2105
2169
  type: TableColumnType.JSON,
2106
2170
  title: "Custom Fields",
2107
- description: "Custom Fields on this resource.",
2171
+ description:
2172
+ "The incident's custom field values, keyed by each incident custom field's name. When a user or an API key creates or updates an incident, each value it sets or changes must fit its field - a number for a Number field, true or false for a Boolean, one of the options for a Dropdown, and so on - or the request is refused. Values left as they were, keys that are not the name of a field and empty values are not checked. Required on Create is not enforced here: it applies to the dashboard's Declare Incident form only.",
2108
2173
  })
2109
2174
  @Column({
2110
2175
  type: ColumnType.JSON,
@@ -2882,6 +2947,207 @@ export default class Incident extends BaseModel {
2882
2947
  })
2883
2948
  public isVisibleOnStatusPage?: boolean = undefined;
2884
2949
 
2950
+ /*
2951
+ * The status pages this incident is limited to. An incident reaches a
2952
+ * status page through its monitors: every page that lists one of them shows
2953
+ * it and notifies its subscribers. So a monitor shared by ten site pages
2954
+ * used to tell all ten sites about an outage that affects two. Picking
2955
+ * pages here narrows that: a scoped incident shows on, and notifies, only
2956
+ * the selected pages among those its monitors already reach (the two sets
2957
+ * intersect - a scope never puts an incident on a page that does not list
2958
+ * its monitors). Empty means unscoped: every page its monitors reach, as
2959
+ * before. Status pages that only show scoped incidents
2960
+ * (StatusPage.onlyShowScopedIncidents) never show an unscoped one.
2961
+ *
2962
+ * Shaped like ScheduledMaintenance.statusPages, with the access control of
2963
+ * the monitors list above. Whether an incident is scoped is kept separately
2964
+ * in isScopedToStatusPages, so the status page queries can filter on it.
2965
+ *
2966
+ * Like the monitors list, the pages are part of the incident: anyone who
2967
+ * can read it sees their names (StatusPage.name is readable on a relation
2968
+ * query), whether or not they can read those status pages. Picking a page
2969
+ * needs read access to it (StatusPageReadAccess).
2970
+ */
2971
+ @ColumnAccessControl({
2972
+ create: [
2973
+ Permission.ProjectOwner,
2974
+ Permission.ProjectAdmin,
2975
+ Permission.ProjectMember,
2976
+ Permission.IncidentAdmin,
2977
+ Permission.IncidentMember,
2978
+ Permission.CreateProjectIncident,
2979
+ ],
2980
+ read: [
2981
+ Permission.ProjectOwner,
2982
+ Permission.ProjectAdmin,
2983
+ Permission.ProjectMember,
2984
+ Permission.Viewer,
2985
+ Permission.IncidentAdmin,
2986
+ Permission.IncidentMember,
2987
+ Permission.IncidentViewer,
2988
+ Permission.ReadProjectIncident,
2989
+ ],
2990
+ update: [
2991
+ Permission.ProjectOwner,
2992
+ Permission.ProjectAdmin,
2993
+ Permission.ProjectMember,
2994
+ Permission.IncidentAdmin,
2995
+ Permission.IncidentMember,
2996
+ Permission.EditProjectIncident,
2997
+ ],
2998
+ })
2999
+ @TableColumn({
3000
+ required: false,
3001
+ type: TableColumnType.EntityArray,
3002
+ modelType: StatusPage,
3003
+ title: "Status Pages",
3004
+ description:
3005
+ "Limit this incident to these status pages. When set, the incident is shown on, and notifies the subscribers of, only these pages among the status pages that list its monitors. Leave empty to reach every status page that lists its monitors.",
3006
+ })
3007
+ @ManyToMany(
3008
+ () => {
3009
+ return StatusPage;
3010
+ },
3011
+ { eager: false },
3012
+ )
3013
+ @JoinTable({
3014
+ name: "IncidentStatusPage",
3015
+ inverseJoinColumn: {
3016
+ name: "statusPageId",
3017
+ referencedColumnName: "_id",
3018
+ },
3019
+ joinColumn: {
3020
+ name: "incidentId",
3021
+ referencedColumnName: "_id",
3022
+ },
3023
+ })
3024
+ public statusPages?: Array<StatusPage> = undefined;
3025
+
3026
+ /*
3027
+ * Whether this incident is limited to the status pages in statusPages. The
3028
+ * status page queries split on it (unscoped incidents by monitor, scoped
3029
+ * ones by monitor AND page), which keeps the scope in SQL rather than in a
3030
+ * post-filter that a LIMIT could silently cut.
3031
+ *
3032
+ * IncidentService derives it from writes to statusPages and ignores any
3033
+ * value a client sends. It is deliberately never recomputed when join rows
3034
+ * disappear: deleting the only status page an incident is scoped to
3035
+ * cascades its join row away, and the incident stays scoped - to nothing -
3036
+ * so it is hidden everywhere rather than widened to every page its monitors
3037
+ * reach.
3038
+ *
3039
+ * Computed, so a client cannot set it on create. Its update access control
3040
+ * matches statusPages all the same: the service writes it into the caller's
3041
+ * own update, and the column check that runs after the hook exempts computed
3042
+ * columns only on create.
3043
+ *
3044
+ * Not indexed. It is false on nearly every row, so an index cannot help the
3045
+ * unscoped half of those queries, and the scoped half reaches its incidents
3046
+ * through the IncidentStatusPage join table's statusPageId index. Building
3047
+ * one would also have held the lock of the migration's ALTER TABLE on
3048
+ * Incident - reads included - for as long as it took on a large table.
3049
+ */
3050
+ @ColumnAccessControl({
3051
+ create: [
3052
+ Permission.ProjectOwner,
3053
+ Permission.ProjectAdmin,
3054
+ Permission.ProjectMember,
3055
+ Permission.IncidentAdmin,
3056
+ Permission.IncidentMember,
3057
+ Permission.CreateProjectIncident,
3058
+ ],
3059
+ read: [
3060
+ Permission.ProjectOwner,
3061
+ Permission.ProjectAdmin,
3062
+ Permission.ProjectMember,
3063
+ Permission.Viewer,
3064
+ Permission.IncidentAdmin,
3065
+ Permission.IncidentMember,
3066
+ Permission.IncidentViewer,
3067
+ Permission.ReadProjectIncident,
3068
+ ],
3069
+ update: [
3070
+ Permission.ProjectOwner,
3071
+ Permission.ProjectAdmin,
3072
+ Permission.ProjectMember,
3073
+ Permission.IncidentAdmin,
3074
+ Permission.IncidentMember,
3075
+ Permission.EditProjectIncident,
3076
+ ],
3077
+ })
3078
+ @TableColumn({
3079
+ isDefaultValueColumn: true,
3080
+ computed: true,
3081
+ hideColumnInDocumentation: true,
3082
+ required: true,
3083
+ type: TableColumnType.Boolean,
3084
+ title: "Is Scoped To Status Pages",
3085
+ description:
3086
+ "Whether this incident is limited to the status pages in Status Pages. Derived from Status Pages; any value sent for it is ignored.",
3087
+ defaultValue: false,
3088
+ })
3089
+ @Column({
3090
+ type: ColumnType.Boolean,
3091
+ nullable: false,
3092
+ default: false,
3093
+ })
3094
+ public isScopedToStatusPages?: boolean = undefined;
3095
+
3096
+ /*
3097
+ * The ids of the status pages whose subscribers were sent this incident's
3098
+ * 'created' notification. A status page added to the scope later can then
3099
+ * be told exactly once, without telling the pages that already heard.
3100
+ *
3101
+ * The Incident:SendNotificationToSubscribers job writes it as root, once per
3102
+ * send, with the status it settles on. It is computed and never taken from
3103
+ * a client; its update access control matches
3104
+ * subscriberNotificationStatusOnIncidentCreated so IncidentService can write
3105
+ * it inside the caller's own update: it empties it when the update resends
3106
+ * the notification to every page (the status set back to Pending), and when
3107
+ * pages are added to an incident whose notification was skipped, it lists
3108
+ * the pages the incident was limited to before, which were deliberately not
3109
+ * told, so only the added ones are (see IncidentScopeAddedPagesNotification).
3110
+ *
3111
+ * Null means no send has settled since the column was added: an incident
3112
+ * whose notification went out before then has no record, and pages added to
3113
+ * it are not sent the notification again.
3114
+ */
3115
+ @ColumnAccessControl({
3116
+ create: [],
3117
+ read: [
3118
+ Permission.ProjectOwner,
3119
+ Permission.ProjectAdmin,
3120
+ Permission.ProjectMember,
3121
+ Permission.Viewer,
3122
+ Permission.IncidentAdmin,
3123
+ Permission.IncidentMember,
3124
+ Permission.IncidentViewer,
3125
+ Permission.ReadProjectIncident,
3126
+ ],
3127
+ update: [
3128
+ Permission.ProjectOwner,
3129
+ Permission.ProjectAdmin,
3130
+ Permission.ProjectMember,
3131
+ Permission.IncidentAdmin,
3132
+ Permission.IncidentMember,
3133
+ Permission.EditProjectIncident,
3134
+ ],
3135
+ })
3136
+ @TableColumn({
3137
+ required: false,
3138
+ computed: true,
3139
+ hideColumnInDocumentation: true,
3140
+ type: TableColumnType.JSON,
3141
+ title: "Status Pages Notified On Creation",
3142
+ description:
3143
+ "IDs of the status pages whose subscribers were sent the notification that this incident was created.",
3144
+ })
3145
+ @Column({
3146
+ type: ColumnType.JSON,
3147
+ nullable: true,
3148
+ })
3149
+ public statusPagesNotifiedOnCreation?: Array<string> = undefined;
3150
+
2885
3151
  @ColumnAccessControl({
2886
3152
  create: [
2887
3153
  Permission.ProjectOwner,
@@ -68,6 +68,7 @@ import { Column, Entity, Index, JoinColumn, ManyToOne } from "typeorm";
68
68
  @Entity({
69
69
  name: "IncidentCustomField",
70
70
  })
71
+ @Index(["projectId", "variableKey"], { unique: true })
71
72
  export default class IncidentCustomField extends BaseModel {
72
73
  @ColumnAccessControl({
73
74
  create: [
@@ -360,6 +361,207 @@ export default class IncidentCustomField extends BaseModel {
360
361
  })
361
362
  public mapFromCustomFieldName?: string = undefined;
362
363
 
364
+ /*
365
+ * The four columns below are incident-only on purpose: the other eight
366
+ * custom field definition tables do not have them, and the shared settings
367
+ * page and Custom Fields card offer them only for a definition model that
368
+ * has the column (DatabaseBaseModel.hasColumn).
369
+ */
370
+
371
+ @ColumnAccessControl({
372
+ create: [
373
+ Permission.ProjectOwner,
374
+ Permission.ProjectAdmin,
375
+ Permission.CreateIncidentCustomField,
376
+ ],
377
+ read: [
378
+ Permission.ProjectOwner,
379
+ Permission.ProjectAdmin,
380
+ Permission.ProjectMember,
381
+ Permission.Viewer,
382
+ Permission.IncidentAdmin,
383
+ Permission.IncidentMember,
384
+ Permission.IncidentViewer,
385
+ Permission.ReadIncidentCustomField,
386
+ ],
387
+ update: [
388
+ Permission.ProjectOwner,
389
+ Permission.ProjectAdmin,
390
+ Permission.EditIncidentCustomField,
391
+ ],
392
+ })
393
+ @TableColumn({
394
+ isDefaultValueColumn: true,
395
+ type: TableColumnType.Boolean,
396
+ title: "Required on Create",
397
+ description:
398
+ "When on, an incident declared from the dashboard cannot be created until this field is filled in (a Boolean field must be ticked). It applies only to fields shown on create. Incidents created by monitors, the API, Slack, Microsoft Teams or AI can leave it empty, and it stays optional when an incident is edited later.",
399
+ defaultValue: false,
400
+ example: false,
401
+ })
402
+ @Column({
403
+ type: ColumnType.Boolean,
404
+ nullable: false,
405
+ default: false,
406
+ })
407
+ public isRequiredOnCreate?: boolean = undefined;
408
+
409
+ @ColumnAccessControl({
410
+ create: [
411
+ Permission.ProjectOwner,
412
+ Permission.ProjectAdmin,
413
+ Permission.CreateIncidentCustomField,
414
+ ],
415
+ read: [
416
+ Permission.ProjectOwner,
417
+ Permission.ProjectAdmin,
418
+ Permission.ProjectMember,
419
+ Permission.Viewer,
420
+ Permission.IncidentAdmin,
421
+ Permission.IncidentMember,
422
+ Permission.IncidentViewer,
423
+ Permission.ReadIncidentCustomField,
424
+ ],
425
+ update: [
426
+ Permission.ProjectOwner,
427
+ Permission.ProjectAdmin,
428
+ Permission.EditIncidentCustomField,
429
+ ],
430
+ })
431
+ @TableColumn({
432
+ required: false,
433
+ type: TableColumnType.Number,
434
+ title: "Order",
435
+ description:
436
+ "Where this field appears among the incident's custom fields, lowest first. Fields with no order come after the ones that have one.",
437
+ example: 1,
438
+ })
439
+ @Column({
440
+ type: ColumnType.Number,
441
+ nullable: true,
442
+ })
443
+ public sortOrder?: number = undefined;
444
+
445
+ @ColumnAccessControl({
446
+ create: [
447
+ Permission.ProjectOwner,
448
+ Permission.ProjectAdmin,
449
+ Permission.CreateIncidentCustomField,
450
+ ],
451
+ read: [
452
+ Permission.ProjectOwner,
453
+ Permission.ProjectAdmin,
454
+ Permission.ProjectMember,
455
+ Permission.Viewer,
456
+ Permission.IncidentAdmin,
457
+ Permission.IncidentMember,
458
+ Permission.IncidentViewer,
459
+ Permission.ReadIncidentCustomField,
460
+ ],
461
+ update: [
462
+ Permission.ProjectOwner,
463
+ Permission.ProjectAdmin,
464
+ Permission.EditIncidentCustomField,
465
+ ],
466
+ })
467
+ @TableColumn({
468
+ isDefaultValueColumn: true,
469
+ type: TableColumnType.Boolean,
470
+ title: "Show on Create",
471
+ description:
472
+ "When on, this field is asked for in a Details step when an incident is declared from the dashboard, and incident templates can fill it in.",
473
+ defaultValue: false,
474
+ example: true,
475
+ })
476
+ @Column({
477
+ type: ColumnType.Boolean,
478
+ nullable: false,
479
+ default: false,
480
+ })
481
+ public showOnCreate?: boolean = undefined;
482
+
483
+ @ColumnAccessControl({
484
+ create: [
485
+ Permission.ProjectOwner,
486
+ Permission.ProjectAdmin,
487
+ Permission.CreateIncidentCustomField,
488
+ ],
489
+ read: [
490
+ Permission.ProjectOwner,
491
+ Permission.ProjectAdmin,
492
+ Permission.ProjectMember,
493
+ Permission.Viewer,
494
+ Permission.IncidentAdmin,
495
+ Permission.IncidentMember,
496
+ Permission.IncidentViewer,
497
+ Permission.ReadIncidentCustomField,
498
+ ],
499
+ update: [
500
+ Permission.ProjectOwner,
501
+ Permission.ProjectAdmin,
502
+ Permission.EditIncidentCustomField,
503
+ ],
504
+ })
505
+ @TableColumn({
506
+ isDefaultValueColumn: true,
507
+ type: TableColumnType.Boolean,
508
+ title: "Include in Subscriber Notifications",
509
+ description:
510
+ "When on, this field and its value appear in the messages status page subscribers get about an incident: the default email, Slack and Microsoft Teams messages, and webhooks (under customFields, by the field's template variable key). The default SMS is kept short and leaves it out. Subscribers are usually people outside your team, so turn this on only for fields that are safe to share with them.",
511
+ defaultValue: false,
512
+ example: false,
513
+ })
514
+ @Column({
515
+ type: ColumnType.Boolean,
516
+ nullable: false,
517
+ default: false,
518
+ })
519
+ public includeInSubscriberNotifications?: boolean = undefined;
520
+
521
+ /*
522
+ * The key templates reach this field by, {{customFields.<variableKey>}}.
523
+ * Made from the name when the field is created
524
+ * (IncidentCustomFieldService.onBeforeCreate, with
525
+ * generateCustomFieldVariableKey) and never changed afterwards, so renaming
526
+ * a field does not break the templates that use it.
527
+ *
528
+ * Computed with an empty create and update access control: whatever a
529
+ * client sends for it is replaced on create and dropped on update. Unique
530
+ * per project, which the index below holds even against two fields created
531
+ * at the same moment. Nullable only so the column could be added to a table
532
+ * that already had rows; the migration that added it gave every one a key.
533
+ */
534
+ @ColumnAccessControl({
535
+ create: [],
536
+ read: [
537
+ Permission.ProjectOwner,
538
+ Permission.ProjectAdmin,
539
+ Permission.ProjectMember,
540
+ Permission.Viewer,
541
+ Permission.IncidentAdmin,
542
+ Permission.IncidentMember,
543
+ Permission.IncidentViewer,
544
+ Permission.ReadIncidentCustomField,
545
+ ],
546
+ update: [],
547
+ })
548
+ @TableColumn({
549
+ computed: true,
550
+ required: false,
551
+ type: TableColumnType.ShortText,
552
+ canReadOnRelationQuery: true,
553
+ title: "Template Variable Key",
554
+ description:
555
+ "The key this field is reached by in templates, as {{customFields.<key>}}. Made from the field's name when it is created - lowercase letters, digits and underscores, with _2, _3 and so on added when another field already has it - and never changed afterwards, so renaming the field does not break templates that use it.",
556
+ example: "expected_resolution",
557
+ })
558
+ @Column({
559
+ nullable: true,
560
+ type: ColumnType.ShortText,
561
+ length: ColumnLength.ShortText,
562
+ })
563
+ public variableKey?: string = undefined;
564
+
363
565
  @ColumnAccessControl({
364
566
  create: [
365
567
  Permission.ProjectOwner,
@@ -1693,6 +1693,36 @@ export default class IncidentEpisode extends BaseModel {
1693
1693
  })
1694
1694
  public subscriberNotificationStatusMessage?: string = undefined;
1695
1695
 
1696
+ /*
1697
+ * When a subscriber job last claimed the 'episode created' notification
1698
+ * (SubscriberNotificationClaim), which the sweeper
1699
+ * (StatusPageSubscriber:TimeoutStuckNotifications) times a notification
1700
+ * still In progress from. Not updatedAt: other code writes this row all
1701
+ * the time while it is open - incidents joining it, its severity and
1702
+ * state, edits - so updatedAt could keep an interrupted send from ever
1703
+ * looking stuck, and Retry waits for it to settle. Written by the claim
1704
+ * only; nobody reads or writes it through the API.
1705
+ */
1706
+ @ColumnAccessControl({
1707
+ create: [],
1708
+ read: [],
1709
+ update: [],
1710
+ })
1711
+ @TableColumn({
1712
+ computed: true,
1713
+ hideColumnInDocumentation: true,
1714
+ required: false,
1715
+ type: TableColumnType.Date,
1716
+ title: "Subscriber Notification Claimed At on Episode Created",
1717
+ description:
1718
+ "When a subscriber notification job last started sending the notification that this episode was created.",
1719
+ })
1720
+ @Column({
1721
+ type: ColumnType.Date,
1722
+ nullable: true,
1723
+ })
1724
+ public subscriberNotificationClaimedAtOnEpisodeCreated?: Date = undefined;
1725
+
1696
1726
  @ColumnAccessControl({
1697
1727
  create: [
1698
1728
  Permission.ProjectOwner,
@@ -10,6 +10,7 @@ import MonitorStatus from "./MonitorStatus";
10
10
  import OnCallDutyPolicy from "./OnCallDutyPolicy";
11
11
  import Project from "./Project";
12
12
  import Service from "./Service";
13
+ import StatusPage from "./StatusPage";
13
14
  import User from "./User";
14
15
  import BaseModel from "./DatabaseBaseModel/DatabaseBaseModel";
15
16
  import Route from "../../Types/API/Route";
@@ -900,6 +901,129 @@ export default class IncidentTemplate extends BaseModel {
900
901
  })
901
902
  public onCallDutyPolicies?: Array<OnCallDutyPolicy> = undefined; // on-call duty policies affected by this incident template.
902
903
 
904
+ /*
905
+ * The status pages an incident declared from this template is limited to
906
+ * (see Incident.statusPages). A 'Region East outage' template can carry the
907
+ * East site pages, so declaring from it scopes the incident in one step.
908
+ */
909
+ @ColumnAccessControl({
910
+ create: [
911
+ Permission.ProjectOwner,
912
+ Permission.ProjectAdmin,
913
+ Permission.ProjectMember,
914
+ Permission.IncidentAdmin,
915
+ Permission.IncidentMember,
916
+ Permission.CreateIncidentTemplate,
917
+ ],
918
+ read: [
919
+ Permission.ProjectOwner,
920
+ Permission.ProjectAdmin,
921
+ Permission.ProjectMember,
922
+ Permission.Viewer,
923
+ Permission.IncidentAdmin,
924
+ Permission.IncidentMember,
925
+ Permission.IncidentViewer,
926
+ Permission.ReadIncidentTemplate,
927
+ ],
928
+ update: [
929
+ Permission.ProjectOwner,
930
+ Permission.ProjectAdmin,
931
+ Permission.ProjectMember,
932
+ Permission.IncidentAdmin,
933
+ Permission.IncidentMember,
934
+ Permission.EditIncidentTemplate,
935
+ ],
936
+ })
937
+ @TableColumn({
938
+ required: false,
939
+ type: TableColumnType.EntityArray,
940
+ modelType: StatusPage,
941
+ title: "Status Pages",
942
+ description:
943
+ "Limit incidents declared from this template to these status pages. Leave empty to reach every status page that lists the incident's monitors.",
944
+ })
945
+ @ManyToMany(
946
+ () => {
947
+ return StatusPage;
948
+ },
949
+ { eager: false },
950
+ )
951
+ @JoinTable({
952
+ name: "IncidentTemplateStatusPage",
953
+ inverseJoinColumn: {
954
+ name: "statusPageId",
955
+ referencedColumnName: "_id",
956
+ },
957
+ joinColumn: {
958
+ name: "incidentTemplateId",
959
+ referencedColumnName: "_id",
960
+ },
961
+ })
962
+ public statusPages?: Array<StatusPage> = undefined;
963
+
964
+ /*
965
+ * Whether this template limits the incidents declared from it to status
966
+ * pages - kept apart from statusPages for the same reason as
967
+ * Incident.isScopedToStatusPages. Deleting a status page cascades its row
968
+ * in IncidentTemplateStatusPage away, and a template whose every page was
969
+ * deleted would otherwise look unscoped, so its incidents would reach
970
+ * every status page that lists their monitors - exactly the audience the
971
+ * template was set up to avoid. With the flag, IncidentService declares
972
+ * such an incident scoped to nothing (hidden from every status page), and
973
+ * the dashboard warns about the template.
974
+ *
975
+ * IncidentTemplateService derives it from writes to statusPages and ignores
976
+ * any value a client sends; it is never recomputed when join rows
977
+ * disappear. Computed, so a client cannot set it on create; its update
978
+ * access control matches statusPages because the service writes it into
979
+ * the caller's own update.
980
+ */
981
+ @ColumnAccessControl({
982
+ create: [
983
+ Permission.ProjectOwner,
984
+ Permission.ProjectAdmin,
985
+ Permission.ProjectMember,
986
+ Permission.IncidentAdmin,
987
+ Permission.IncidentMember,
988
+ Permission.CreateIncidentTemplate,
989
+ ],
990
+ read: [
991
+ Permission.ProjectOwner,
992
+ Permission.ProjectAdmin,
993
+ Permission.ProjectMember,
994
+ Permission.Viewer,
995
+ Permission.IncidentAdmin,
996
+ Permission.IncidentMember,
997
+ Permission.IncidentViewer,
998
+ Permission.ReadIncidentTemplate,
999
+ ],
1000
+ update: [
1001
+ Permission.ProjectOwner,
1002
+ Permission.ProjectAdmin,
1003
+ Permission.ProjectMember,
1004
+ Permission.IncidentAdmin,
1005
+ Permission.IncidentMember,
1006
+ Permission.EditIncidentTemplate,
1007
+ ],
1008
+ })
1009
+ @TableColumn({
1010
+ isDefaultValueColumn: true,
1011
+ computed: true,
1012
+ hideColumnInDocumentation: true,
1013
+ required: true,
1014
+ type: TableColumnType.Boolean,
1015
+ title: "Is Scoped To Status Pages",
1016
+ description:
1017
+ "Whether incidents declared from this template are limited to the status pages in Status Pages. Derived from Status Pages; any value sent for it is ignored.",
1018
+ defaultValue: false,
1019
+ })
1020
+ @Column({
1021
+ type: ColumnType.Boolean,
1022
+ nullable: false,
1023
+ default: false,
1024
+ })
1025
+ public isScopedToStatusPages?: boolean = undefined;
1026
+
903
1027
  @ColumnAccessControl({
904
1028
  create: [
905
1029
  Permission.ProjectOwner,
@@ -1252,7 +1376,8 @@ export default class IncidentTemplate extends BaseModel {
1252
1376
  required: false,
1253
1377
  type: TableColumnType.JSON,
1254
1378
  title: "Custom Fields",
1255
- description: "Custom Fields on this resource.",
1379
+ description:
1380
+ "The custom field values incidents declared from this template start with, keyed by each incident custom field's name. They are merged one field at a time under the values the request or the Declare Incident form supplies.",
1256
1381
  example: {
1257
1382
  priority: "high",
1258
1383
  category: "infrastructure",