@oneuptime/common 12.0.7 → 12.0.9

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 (873) hide show
  1. package/Models/AnalyticsModels/MetricItemAggMV1mByK8sCluster.ts +1 -1
  2. package/Models/AnalyticsModels/MetricItemAggMV1mByService.ts +1 -1
  3. package/Models/DatabaseModels/AIConversation.ts +32 -0
  4. package/Models/DatabaseModels/AIConversationMessage.ts +41 -0
  5. package/Models/DatabaseModels/AlertEpisodeMember.ts +27 -0
  6. package/Models/DatabaseModels/IncidentEpisodeMember.ts +28 -0
  7. package/Models/DatabaseModels/Index.ts +12 -4
  8. package/Models/DatabaseModels/{TelemetryEntity.ts → InventoryItem.ts} +184 -9
  9. package/Models/DatabaseModels/InventoryItemCustomField.ts +434 -0
  10. package/Models/DatabaseModels/{TelemetryEntityRelationship.ts → InventoryItemRelationship.ts} +33 -7
  11. package/Models/DatabaseModels/NetworkDevice.ts +141 -0
  12. package/Models/DatabaseModels/NetworkDeviceLink.ts +699 -0
  13. package/Models/DatabaseModels/NetworkDeviceLinkRule.ts +467 -0
  14. package/Models/DatabaseModels/NetworkTopologySuppression.ts +429 -0
  15. package/Models/DatabaseModels/OnCallDutyPolicyFeed.ts +9 -0
  16. package/Models/DatabaseModels/Project.ts +78 -0
  17. package/Models/DatabaseModels/UserCall.ts +42 -0
  18. package/Models/DatabaseModels/UserEmail.ts +44 -0
  19. package/Models/DatabaseModels/UserNotificationRule.ts +425 -55
  20. package/Models/DatabaseModels/UserOnCallLogTimeline.ts +24 -2
  21. package/Models/DatabaseModels/UserPush.ts +49 -0
  22. package/Models/DatabaseModels/UserSMS.ts +43 -0
  23. package/Models/DatabaseModels/UserTelegram.ts +59 -0
  24. package/Models/DatabaseModels/UserWebhook.ts +52 -0
  25. package/Models/DatabaseModels/UserWhatsApp.ts +41 -0
  26. package/Models/DatabaseModels/WorkflowLog.ts +38 -0
  27. package/Models/DatabaseModels/WorkflowVariable.ts +12 -0
  28. package/Server/API/AIChatAPI.ts +315 -1
  29. package/Server/API/DashboardAPI.ts +217 -1
  30. package/Server/API/OnCallReadinessAPI.ts +841 -0
  31. package/Server/API/TeamComplianceAPI.ts +69 -17
  32. package/Server/API/TelemetryAPI.ts +220 -12
  33. package/Server/API/UserAPI.ts +16 -1
  34. package/Server/EnvironmentConfig.ts +52 -0
  35. package/Server/Infrastructure/Postgres/DataSourceOptions.ts +22 -0
  36. package/Server/Infrastructure/Postgres/SchemaMigrations/1786100000000-RestoreServiceLowerNameIndex.ts +4 -4
  37. package/Server/Infrastructure/Postgres/SchemaMigrations/1786200000000-RestoreDroppedUniqueIndexes.ts +5 -5
  38. package/Server/Infrastructure/Postgres/SchemaMigrations/1786551733814-MigrationName.ts +41 -0
  39. package/Server/Infrastructure/Postgres/SchemaMigrations/1786559879134-AddWorkflowLogStepTrace.ts +17 -0
  40. package/Server/Infrastructure/Postgres/SchemaMigrations/1786625176831-AddMonitoringMethodToNetworkDevice.ts +35 -0
  41. package/Server/Infrastructure/Postgres/SchemaMigrations/1786634985763-AddNetworkDeviceLink.ts +82 -0
  42. package/Server/Infrastructure/Postgres/SchemaMigrations/1786639512056-AddNetworkDeviceLinkRule.ts +91 -0
  43. package/Server/Infrastructure/Postgres/SchemaMigrations/1786639972982-AddNetworkTopologySuppression.ts +47 -0
  44. package/Server/Infrastructure/Postgres/SchemaMigrations/1786800000000-RenameTelemetryEntityToInventoryItem.ts +255 -0
  45. package/Server/Infrastructure/Postgres/SchemaMigrations/1786900000000-AddInventoryItemArchiveAndCustomFields.ts +107 -0
  46. package/Server/Infrastructure/Postgres/SchemaMigrations/1787000000000-AddOnCallNotificationFallbackColumns.ts +90 -0
  47. package/Server/Infrastructure/Postgres/SchemaMigrations/1787100000000-AddAIConversationPageContext.ts +39 -0
  48. package/Server/Infrastructure/Postgres/SchemaMigrations/1787200000000-AddAIChatMessageFeedback.ts +33 -0
  49. package/Server/Infrastructure/Postgres/SchemaMigrations/1787300000000-AddEpisodeMemberNotifyIndexes.ts +59 -0
  50. package/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts +24 -0
  51. package/Server/Infrastructure/Queue.ts +78 -13
  52. package/Server/Middleware/MasterAdminAuthorization.ts +11 -6
  53. package/Server/Middleware/PublicDashboardRateLimit.ts +593 -0
  54. package/Server/Services/AIService.ts +7 -0
  55. package/Server/Services/AlertEpisodeStateTimelineService.ts +29 -0
  56. package/Server/Services/AlertSeverityService.ts +63 -0
  57. package/Server/Services/DashboardService.ts +9 -10
  58. package/Server/Services/DatabaseService.ts +32 -2
  59. package/Server/Services/IncidentEpisodeStateTimelineService.ts +29 -0
  60. package/Server/Services/IncidentSeverityService.ts +76 -0
  61. package/Server/Services/Index.ts +12 -4
  62. package/Server/Services/InventoryItemCustomFieldService.ts +9 -0
  63. package/Server/Services/{TelemetryEntityRelationshipService.ts → InventoryItemRelationshipService.ts} +7 -4
  64. package/Server/Services/{TelemetryEntityService.ts → InventoryItemService.ts} +203 -21
  65. package/Server/Services/LogAggregationService.ts +45 -8
  66. package/Server/Services/MetricAggregationService.ts +121 -0
  67. package/Server/Services/MetricService.ts +7 -7
  68. package/Server/Services/NetworkDeviceLinkRuleService.ts +10 -0
  69. package/Server/Services/NetworkDeviceLinkService.ts +84 -0
  70. package/Server/Services/NetworkDeviceService.ts +140 -0
  71. package/Server/Services/NetworkSiteService.ts +77 -25
  72. package/Server/Services/NetworkTopologySuppressionService.ts +84 -0
  73. package/Server/Services/OnCallDutyPolicyEscalationRuleScheduleService.ts +41 -29
  74. package/Server/Services/OnCallDutyPolicyExecutionLogService.ts +8 -0
  75. package/Server/Services/OnCallDutyPolicyExecutionLogTimelineService.ts +62 -13
  76. package/Server/Services/OnCallDutyPolicyScheduleService.ts +61 -1
  77. package/Server/Services/OnCallNotificationAlertingService.ts +742 -0
  78. package/Server/Services/OnCallReadinessService.ts +2803 -0
  79. package/Server/Services/OnCallSetupReminderService.ts +955 -0
  80. package/Server/Services/ProfileAggregationService.ts +123 -0
  81. package/Server/Services/StatusPageService.ts +9 -10
  82. package/Server/Services/TeamComplianceService.ts +429 -252
  83. package/Server/Services/UserCallService.ts +26 -1
  84. package/Server/Services/UserEmailService.ts +26 -1
  85. package/Server/Services/UserNotificationRuleAdminService.ts +1183 -0
  86. package/Server/Services/UserNotificationRuleService.ts +3812 -333
  87. package/Server/Services/UserOnCallLogService.ts +561 -48
  88. package/Server/Services/UserPushService.ts +29 -0
  89. package/Server/Services/UserService.ts +11 -0
  90. package/Server/Services/UserSmsService.ts +26 -1
  91. package/Server/Services/UserTelegramService.ts +24 -1
  92. package/Server/Services/UserWebhookService.ts +28 -1
  93. package/Server/Services/UserWhatsAppService.ts +24 -1
  94. package/Server/Types/Database/Permissions/BasePermission.ts +19 -0
  95. package/Server/Types/Database/Permissions/CreatePermission.ts +164 -0
  96. package/Server/Types/Database/Permissions/OwnerOnlyColumnPermission.ts +340 -0
  97. package/Server/Types/Database/Permissions/QueryPermission.ts +48 -0
  98. package/Server/Types/Database/Permissions/TenantPermission.ts +8 -1
  99. package/Server/Types/Workflow/Components/API/Delete.ts +1 -1
  100. package/Server/Types/Workflow/Components/API/Get.ts +1 -1
  101. package/Server/Types/Workflow/Components/API/Patch.ts +1 -1
  102. package/Server/Types/Workflow/Components/API/Post.ts +1 -1
  103. package/Server/Types/Workflow/Components/API/Put.ts +1 -1
  104. package/Server/Types/Workflow/Components/API/Utils.ts +44 -1
  105. package/Server/Types/Workflow/Components/BaseModel/CreateManyBaseModel.ts +29 -5
  106. package/Server/Types/Workflow/Components/BaseModel/CreateOneBaseModel.ts +18 -10
  107. package/Server/Types/Workflow/Components/BaseModel/ModelArguments.ts +55 -0
  108. package/Server/Types/Workflow/Components/Conditions/IfElse.ts +3 -17
  109. package/Server/Types/Workflow/Components/Email.ts +25 -7
  110. package/Server/Types/Workflow/Components/JavaScript.ts +10 -3
  111. package/Server/Types/Workflow/Components/MicrosoftTeams/SendMessageToChannel.ts +1 -1
  112. package/Server/Types/Workflow/TriggerCode.ts +12 -0
  113. package/Server/Types/Workflow/Workflow.ts +5 -0
  114. package/Server/Utils/AI/Chat/ChatAgentRunner.ts +643 -48
  115. package/Server/Utils/AI/Chat/ObservabilityAssistant.ts +32 -3
  116. package/Server/Utils/AI/Chat/ObservabilityChatPrompt.ts +20 -6
  117. package/Server/Utils/AI/SRE/AIInvestigationEngine.ts +7 -0
  118. package/Server/Utils/AI/Toolbox/AIActionTools.ts +2 -2
  119. package/Server/Utils/AI/Toolbox/AIMetaTools.ts +863 -0
  120. package/Server/Utils/AI/Toolbox/AlertTools.ts +177 -15
  121. package/Server/Utils/AI/Toolbox/IncidentTools.ts +191 -10
  122. package/Server/Utils/AI/Toolbox/Index.ts +48 -0
  123. package/Server/Utils/AI/Toolbox/MonitorTools.ts +298 -11
  124. package/Server/Utils/AI/Toolbox/NoteWriteTools.ts +295 -0
  125. package/Server/Utils/AI/Toolbox/OnCallTools.ts +1246 -0
  126. package/Server/Utils/AI/Toolbox/RunbookTools.ts +424 -0
  127. package/Server/Utils/AI/Toolbox/SloTools.ts +456 -0
  128. package/Server/Utils/AI/Toolbox/StatusPageTools.ts +559 -0
  129. package/Server/Utils/AI/Toolbox/TeamTools.ts +327 -0
  130. package/Server/Utils/AI/Toolbox/TimelineTools.ts +615 -0
  131. package/Server/Utils/AI/Toolbox/WorkflowProbeTools.ts +664 -0
  132. package/Server/Utils/ClientIp.ts +221 -0
  133. package/Server/Utils/Dashboard/PublicDashboardResourceListPolicy.ts +47 -0
  134. package/Server/Utils/Dashboard/PublicDashboardSloHistoryPolicy.ts +163 -0
  135. package/Server/Utils/Dashboard/PublicDashboardSloWidget.ts +147 -0
  136. package/Server/Utils/Express.ts +12 -17
  137. package/Server/Utils/LLM/LLMService.ts +85 -8
  138. package/Server/Utils/Monitor/MonitorCriteriaEvaluator.ts +204 -10
  139. package/Server/Utils/SSRFProtection.ts +98 -23
  140. package/Server/Utils/StartServer.ts +12 -3
  141. package/Server/Utils/Telemetry/EntityRegistry.ts +205 -18
  142. package/Server/Utils/Telemetry/InventoryEntityRegistry.ts +689 -0
  143. package/Server/Utils/Telemetry/TelemetryEntity.ts +160 -52
  144. package/Server/Utils/VM/VMAPI.ts +56 -8
  145. package/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeams.ts +7 -3
  146. package/Tests/App/Dashboard/AdminNotificationRulesPage.test.tsx +2146 -0
  147. package/Tests/App/Dashboard/CreateWorkflowModal.test.tsx +561 -0
  148. package/Tests/App/Dashboard/EscalationRuleReadiness.test.tsx +2470 -0
  149. package/Tests/App/Dashboard/MonitorCriteriaAttributeFilter.test.tsx +574 -0
  150. package/Tests/App/Dashboard/OnCallPreventionGuards.test.tsx +1897 -0
  151. package/Tests/App/Dashboard/OnCallReadinessSurfaces.test.tsx +3606 -0
  152. package/Tests/App/Dashboard/OnCallRulesDeleteGuard.test.tsx +784 -0
  153. package/Tests/App/Dashboard/OnCallRulesTable.test.tsx +1119 -0
  154. package/Tests/App/Dashboard/SloWidgetFetching.test.tsx +531 -0
  155. package/Tests/App/Dashboard/UserSettingsSetupChecklistModel.test.ts +1312 -0
  156. package/Tests/App/Dashboard/UserSettingsSetupChecklistPage.test.tsx +1390 -0
  157. package/Tests/Models/InventoryItemModel.test.ts +174 -0
  158. package/Tests/Models/InventoryItemNaming.test.ts +302 -0
  159. package/Tests/Server/API/AIChatCancelAndFeedback.test.ts +437 -0
  160. package/Tests/Server/API/DashboardPublicRateLimit.test.ts +659 -0
  161. package/Tests/Server/API/DashboardPublicResourceListAPI.test.ts +18 -0
  162. package/Tests/Server/API/DashboardPublicSloAPI.test.ts +880 -0
  163. package/Tests/Server/API/Helpers.ts +24 -15
  164. package/Tests/Server/API/OnCallReadinessAPI.test.ts +2680 -0
  165. package/Tests/Server/API/OnCallSetupReminderAPI.test.ts +915 -0
  166. package/Tests/Server/API/UserProjectsAPI.test.ts +478 -4
  167. package/Tests/Server/Infrastructure/Postgres/EpisodeMemberNotifyIndexesMigration.test.ts +533 -0
  168. package/Tests/Server/Infrastructure/Postgres/InventoryItemArchiveMigration.test.ts +213 -0
  169. package/Tests/Server/Infrastructure/Postgres/RenameInventoryItemMigration.test.ts +432 -0
  170. package/Tests/Server/Infrastructure/Queue.test.ts +293 -0
  171. package/Tests/Server/Middleware/PublicDashboardRateLimit.test.ts +1645 -0
  172. package/Tests/Server/Services/AdminRuleEditGuards.test.ts +2848 -0
  173. package/Tests/Server/Services/DeliverNotificationForRuleExtraction.test.ts +1393 -0
  174. package/Tests/Server/Services/EpisodeRuleSeverityRepair.test.ts +1802 -0
  175. package/Tests/Server/Services/EpisodeStateTimelineNote.test.ts +304 -0
  176. package/Tests/Server/Services/InventoryItemDisplayName.test.ts +339 -0
  177. package/Tests/Server/Services/InventoryItemManualCreate.test.ts +248 -0
  178. package/Tests/Server/Services/IpAllowlistSpoofing.test.ts +450 -0
  179. package/Tests/Server/Services/LogAggregationService.test.ts +235 -1
  180. package/Tests/Server/Services/MetricAggregationService.test.ts +231 -0
  181. package/Tests/Server/Services/MetricEntityMVKeyParity.test.ts +80 -29
  182. package/Tests/Server/Services/MetricServiceAggregate.test.ts +30 -30
  183. package/Tests/Server/Services/NetworkSiteService.test.ts +18 -3
  184. package/Tests/Server/Services/NotificationChannelEventCoverage.test.ts +1728 -0
  185. package/Tests/Server/Services/NotificationDeletionImpact.test.ts +2402 -0
  186. package/Tests/Server/Services/OnCallDutyPolicyExecutionLogTimelineGapFeed.test.ts +394 -0
  187. package/Tests/Server/Services/OnCallNotificationFallback.test.ts +1744 -0
  188. package/Tests/Server/Services/OnCallReadinessService.test.ts +4295 -0
  189. package/Tests/Server/Services/OnCallSetupReminder.test.ts +1272 -0
  190. package/Tests/Server/Services/OnCallWeeklyReadinessDigest.test.ts +1021 -0
  191. package/Tests/Server/Services/ProfileAggregationService.test.ts +296 -0
  192. package/Tests/Server/Services/SeverityCreationRuleBackfill.test.ts +1536 -0
  193. package/Tests/Server/Services/SeverityRuleBackfill.test.ts +1818 -0
  194. package/Tests/Server/Services/TeamComplianceServiceBehaviour.test.ts +1845 -0
  195. package/Tests/Server/Services/UserNotificationRuleAdminGuards.test.ts +1394 -0
  196. package/Tests/Server/Services/UserNotificationRuleDefaultCreation.test.ts +1166 -0
  197. package/Tests/Server/Services/UserNotificationRuleExecuteItem.test.ts +1468 -0
  198. package/Tests/Server/Services/UserOnCallLogNoNotificationRules.test.ts +1457 -0
  199. package/Tests/Server/Types/Database/Permissions/AdminNotificationRuleAccess.test.ts +1546 -0
  200. package/Tests/Server/Types/Database/Permissions/CreateOwnershipScoping.test.ts +529 -0
  201. package/Tests/Server/Types/Database/Permissions/OwnerOnlyColumns.test.ts +1219 -0
  202. package/Tests/Server/Types/Database/Permissions/UserNotificationRuleScoping.test.ts +1089 -0
  203. package/Tests/Server/Types/Workflow/Components/ApiComponentErrorPort.test.ts +2 -1
  204. package/Tests/Server/Types/Workflow/Components/ApiComponentHeaders.test.ts +192 -0
  205. package/Tests/Server/Types/Workflow/Components/BaseModelDatabaseComponents.test.ts +190 -0
  206. package/Tests/Server/Types/Workflow/Components/ChatWebhookComponents.test.ts +44 -14
  207. package/Tests/Server/Types/Workflow/Components/Email.test.ts +151 -0
  208. package/Tests/Server/Types/Workflow/Components/IfElse.test.ts +98 -0
  209. package/Tests/Server/Types/Workflow/Components/JavaScript.test.ts +51 -0
  210. package/Tests/Server/Utils/AI/AIMetaTools.test.ts +586 -0
  211. package/Tests/Server/Utils/AI/AlertMonitorFilters.test.ts +582 -0
  212. package/Tests/Server/Utils/AI/ChatAgentRunner.test.ts +726 -0
  213. package/Tests/Server/Utils/AI/IncidentToolsFilters.test.ts +315 -0
  214. package/Tests/Server/Utils/AI/LLMServiceStopReason.test.ts +314 -0
  215. package/Tests/Server/Utils/AI/LLMServiceToolCalling.test.ts +26 -3
  216. package/Tests/Server/Utils/AI/NoteWriteTools.test.ts +268 -0
  217. package/Tests/Server/Utils/AI/ObservabilityChatPrompt.test.ts +169 -0
  218. package/Tests/Server/Utils/AI/OnCallTools.test.ts +664 -0
  219. package/Tests/Server/Utils/AI/RunbookTools.test.ts +325 -0
  220. package/Tests/Server/Utils/AI/SloTools.test.ts +306 -0
  221. package/Tests/Server/Utils/AI/StatusPageTools.test.ts +391 -0
  222. package/Tests/Server/Utils/AI/TeamTools.test.ts +257 -0
  223. package/Tests/Server/Utils/AI/TimelineTools.test.ts +472 -0
  224. package/Tests/Server/Utils/AI/WorkflowProbeTools.test.ts +428 -0
  225. package/Tests/Server/Utils/AnalyticsDatabase/QuerySettingsHelper.test.ts +152 -0
  226. package/Tests/Server/Utils/ClientIp.test.ts +438 -0
  227. package/Tests/Server/Utils/Dashboard/PublicDashboardResourceListPolicy.test.ts +171 -0
  228. package/Tests/Server/Utils/Dashboard/PublicDashboardSloHistoryPolicy.test.ts +383 -0
  229. package/Tests/Server/Utils/EntityRegistryRowFence.test.ts +23 -25
  230. package/Tests/Server/Utils/MicrosoftTeamsWebhookUrlValidation.test.ts +6 -0
  231. package/Tests/Server/Utils/Monitor/Criteria/DnssecMonitorCriteria.test.ts +307 -0
  232. package/Tests/Server/Utils/Monitor/Criteria/SSLMonitorCriteria.test.ts +468 -0
  233. package/Tests/Server/Utils/Monitor/MonitorCriteriaEvaluatorTelemetryDeepLinks.test.ts +460 -0
  234. package/Tests/Server/Utils/ResponseRateLimitStatusCodes.test.ts +137 -0
  235. package/Tests/Server/Utils/SSRFProtectionBypasses.test.ts +40 -8
  236. package/Tests/Server/Utils/SSRFProtectionUserInfo.test.ts +351 -0
  237. package/Tests/Server/Utils/Telemetry/EntityRegistryRetirement.test.ts +531 -0
  238. package/Tests/Server/Utils/Telemetry/InventoryEntityRegistry.test.ts +322 -0
  239. package/Tests/Server/Utils/Telemetry/TelemetryEntity.test.ts +356 -39
  240. package/Tests/Server/Utils/VM/VMAPISubstitution.test.ts +243 -0
  241. package/Tests/Types/IP/IP.test.ts +263 -0
  242. package/Tests/Types/IP/IPWhitelist.test.ts +197 -0
  243. package/Tests/Types/IP/IPv6.test.ts +12 -1
  244. package/Tests/Types/Monitor/SnmpOid.test.ts +64 -0
  245. package/Tests/Types/NetworkDevice/NetworkDeviceMonitoringMethod.test.ts +110 -0
  246. package/Tests/Types/OnCallDutyPolicy/LayerUtilMergeAudit.test.ts +106 -0
  247. package/Tests/Types/OnCallDutyPolicy/LayerUtilMergeDifferential.test.ts +511 -0
  248. package/Tests/Types/OnCallDutyPolicy/ScheduleCoverageEndToEnd.test.ts +489 -0
  249. package/Tests/Types/OnCallDutyPolicy/ScheduleCoverageGapTolerance.test.ts +479 -0
  250. package/Tests/Types/OnCallDutyPolicy/ScheduleCoverageState.test.ts +822 -0
  251. package/Tests/Types/SerializableObjectDictionaryImportCycle.test.ts +197 -0
  252. package/Tests/Types/Telemetry/EntityTypeGroups.test.ts +140 -0
  253. package/Tests/Types/Workflow/BaseModelComponents.test.ts +429 -0
  254. package/Tests/Types/Workflow/Components/BaseModel.test.ts +225 -0
  255. package/Tests/Types/Workflow/IntegrationCredentialMetadata.test.ts +100 -0
  256. package/Tests/Types/Workflow/StepTrace.test.ts +235 -0
  257. package/Tests/Types/Workflow/TemplateSyntax.test.ts +491 -0
  258. package/Tests/Types/Workflow/Templates.test.ts +1218 -0
  259. package/Tests/UI/Components/ActiveFilterChipsOpenRoute.test.tsx +82 -0
  260. package/Tests/UI/Components/ComponentsModal.test.tsx +564 -7
  261. package/Tests/UI/Components/CustomTimeRangeModal.test.tsx +459 -0
  262. package/Tests/UI/Components/DictionaryAttributeFilterRow.test.tsx +477 -0
  263. package/Tests/UI/Components/Forms/AnchoredFieldPopupKeyboard.test.tsx +382 -0
  264. package/Tests/UI/Components/Forms/ColorPickerPicking.test.tsx +569 -0
  265. package/Tests/UI/Components/Forms/ValidationJSON.test.ts +241 -0
  266. package/Tests/UI/Components/KeyboardShortcut.test.tsx +95 -0
  267. package/Tests/UI/Components/LogDetailsPanelCrossSignal.test.tsx +448 -0
  268. package/Tests/UI/Components/LogTimeRangePicker.test.tsx +42 -0
  269. package/Tests/UI/Components/LogsTableCrossLinks.test.tsx +263 -0
  270. package/Tests/UI/Components/ModalPortalDismissal.test.tsx +90 -0
  271. package/Tests/UI/Components/PendingProjectInvitations.test.tsx +913 -0
  272. package/Tests/UI/Components/SimpleLogViewer.test.tsx +228 -0
  273. package/Tests/UI/Components/TableRowSelectability.test.tsx +312 -0
  274. package/Tests/UI/Components/TelemetryTimeRangePicker.test.tsx +49 -7
  275. package/Tests/UI/Components/TimeRangePickerDropdown.test.tsx +325 -0
  276. package/Tests/UI/Components/Workflow/GraphLint.test.ts +893 -0
  277. package/Tests/UI/Components/Workflow/GraphLintSummary.test.ts +755 -0
  278. package/Tests/UI/Components/Workflow/ModelColumnEditor.test.ts +522 -0
  279. package/Tests/UI/Components/Workflow/ModelColumnEditorServerContract.test.ts +193 -0
  280. package/Tests/UI/Components/Workflow/ModelSchema.test.ts +388 -0
  281. package/Tests/UI/Components/Workflow/RunStatusWatcher.test.ts +210 -0
  282. package/Tests/UI/Components/Workflow/StepTraceViewer.test.tsx +256 -0
  283. package/Tests/UI/Components/Workflow/UseRunWatch.test.tsx +665 -0
  284. package/Tests/UI/Components/Workflow/Utils.test.ts +192 -0
  285. package/Tests/UI/Components/Workflow/WorkflowIssuesModal.test.tsx +485 -0
  286. package/Tests/UI/Components/Workflow/WorkflowLogModal.test.tsx +478 -0
  287. package/Tests/UI/Components/Workflow/WorkflowStatusBar.test.tsx +379 -0
  288. package/Tests/UI/EsbuildConfig.test.ts +607 -0
  289. package/Tests/UI/Monitor/MonitorStepCriteriaView.test.tsx +432 -0
  290. package/Tests/UI/Utils/Breadcrumb/fixtures/RealBreadcrumbTrails.ts +5 -0
  291. package/Tests/UI/Utils/Breadcrumb/fixtures/RealRoutePatterns.ts +11 -4
  292. package/Tests/UI/Utils/ModelAPICreateMiscData.test.ts +94 -0
  293. package/Tests/UI/Utils/Platform.test.ts +147 -0
  294. package/Tests/UI/Utils/ProjectInvitationDisplay.test.ts +357 -0
  295. package/Tests/Utils/Monitor/NetworkDeviceLinkRuleUtil.test.ts +198 -0
  296. package/Tests/Utils/Monitor/NetworkDeviceRoleUtil.test.ts +514 -0
  297. package/Tests/Utils/Monitor/NetworkTopologyUtil.test.ts +727 -0
  298. package/Tests/Utils/Schema/AnalyticsModelSchema.test.ts +469 -0
  299. package/Tests/Utils/Schema/ModelSchema.test.ts +268 -0
  300. package/Tests/Utils/Telemetry/CrossSignalScope.test.ts +698 -0
  301. package/Tests/Utils/Telemetry/EntityKeyNonTelemetry.test.ts +193 -0
  302. package/Tests/__mocks__/bullmq.js +55 -0
  303. package/Types/AI/AIChatMessageStatus.ts +8 -1
  304. package/Types/AI/AIChatTypes.ts +12 -0
  305. package/Types/Database/AccessControl/OwnerOnlyColumn.ts +88 -0
  306. package/Types/Exception/ExceptionCode.ts +2 -0
  307. package/Types/Exception/ServiceUnavailableException.ts +8 -0
  308. package/Types/Exception/TooManyRequestsException.ts +8 -0
  309. package/Types/IP/IP.ts +93 -47
  310. package/Types/Monitor/SnmpMonitor/NetworkTopology.ts +80 -3
  311. package/Types/NetworkDevice/NetworkDeviceMonitoringMethod.ts +55 -0
  312. package/Types/OnCallDutyPolicy/Layer.ts +203 -149
  313. package/Types/OnCallDutyPolicy/OnCallDutyPolicyStatus.ts +13 -0
  314. package/Types/OnCallDutyPolicy/ScheduleShiftUtil.ts +155 -10
  315. package/Types/Permission.ts +193 -0
  316. package/Types/SerializableObjectDictionary.ts +133 -39
  317. package/Types/Telemetry/EntityRelationshipType.ts +1 -1
  318. package/Types/Telemetry/EntitySource.ts +40 -0
  319. package/Types/Telemetry/EntityType.ts +28 -1
  320. package/Types/Telemetry/EntityTypeGroups.ts +65 -0
  321. package/Types/Workflow/Component.ts +29 -0
  322. package/Types/Workflow/Components/API.ts +35 -0
  323. package/Types/Workflow/Components/BaseModel.ts +77 -27
  324. package/Types/Workflow/Components/Discord.ts +1 -0
  325. package/Types/Workflow/Components/Email.ts +12 -3
  326. package/Types/Workflow/Components/JavaScript.ts +7 -0
  327. package/Types/Workflow/Components/MicrosoftTeams.ts +3 -2
  328. package/Types/Workflow/Components/Slack.ts +1 -0
  329. package/Types/Workflow/Components/Telegram.ts +1 -0
  330. package/Types/Workflow/StepTrace.ts +181 -0
  331. package/Types/Workflow/TemplateSyntax.ts +543 -0
  332. package/Types/Workflow/Templates.ts +2368 -0
  333. package/UI/Components/Calendar/Calendar.css +43 -0
  334. package/UI/Components/Calendar/Calendar.tsx +8 -0
  335. package/UI/Components/Card/Card.tsx +2 -2
  336. package/UI/Components/Checkbox/Checkbox.tsx +16 -0
  337. package/UI/Components/Date/CustomTimeRangeModal.tsx +278 -0
  338. package/UI/Components/Date/TimeRangePickerDropdown.tsx +250 -0
  339. package/UI/Components/Dictionary/Dictionary.tsx +71 -15
  340. package/UI/Components/FormModal/BasicFormModal.tsx +2 -1
  341. package/UI/Components/Forms/Fields/ColorPicker.tsx +66 -10
  342. package/UI/Components/Forms/Fields/IconPicker.tsx +48 -10
  343. package/UI/Components/Forms/Types/Field.ts +7 -0
  344. package/UI/Components/Forms/Validation.ts +63 -1
  345. package/UI/Components/Header/HeaderIconDropdownButton.tsx +53 -3
  346. package/UI/Components/Input/Input.tsx +32 -3
  347. package/UI/Components/KeyboardShortcut/KeyboardKey.ts +185 -0
  348. package/UI/Components/KeyboardShortcut/KeyboardShortcut.tsx +87 -0
  349. package/UI/Components/LogsViewer/LogsViewer.tsx +28 -0
  350. package/UI/Components/LogsViewer/components/ActiveFilterChips.tsx +31 -0
  351. package/UI/Components/LogsViewer/components/KeyboardShortcutsHelp.tsx +18 -18
  352. package/UI/Components/LogsViewer/components/LogDetailsPanel.tsx +363 -14
  353. package/UI/Components/LogsViewer/components/LogTimeRangePicker.tsx +11 -216
  354. package/UI/Components/LogsViewer/components/LogsAnalyticsView.tsx +11 -0
  355. package/UI/Components/LogsViewer/components/LogsTable.tsx +155 -12
  356. package/UI/Components/LogsViewer/components/LogsViewerToolbar.tsx +29 -0
  357. package/UI/Components/LogsViewer/types.ts +23 -0
  358. package/UI/Components/Markdown.tsx/MarkdownEditor.tsx +9 -2
  359. package/UI/Components/Modal/Modal.tsx +37 -4
  360. package/UI/Components/Navbar/NavBarMenuModal.tsx +15 -30
  361. package/UI/Components/ProjectInvitations/PendingProjectInvitations.tsx +442 -0
  362. package/UI/Components/SimpleLogViewer/SimpleLogViewer.tsx +23 -1
  363. package/UI/Components/Table/Table.tsx +49 -16
  364. package/UI/Components/Table/TableBody.tsx +53 -28
  365. package/UI/Components/Table/TableHeader.tsx +13 -0
  366. package/UI/Components/Table/TableRow.tsx +58 -26
  367. package/UI/Components/TelemetryViewer/components/TelemetryTimeRangePicker.tsx +11 -210
  368. package/UI/Components/Workflow/ArgumentsForm.tsx +341 -8
  369. package/UI/Components/Workflow/Component.tsx +28 -26
  370. package/UI/Components/Workflow/ComponentReturnValueViewer.tsx +26 -0
  371. package/UI/Components/Workflow/ComponentSettingsModal.tsx +79 -9
  372. package/UI/Components/Workflow/ComponentValuePickerModal.tsx +135 -7
  373. package/UI/Components/Workflow/ComponentsModal.tsx +116 -22
  374. package/UI/Components/Workflow/DocumentationViewer.tsx +59 -9
  375. package/UI/Components/Workflow/GraphLint.ts +628 -0
  376. package/UI/Components/Workflow/GraphLintSummary.ts +390 -0
  377. package/UI/Components/Workflow/ModelColumnEditor.tsx +528 -0
  378. package/UI/Components/Workflow/ModelSchema.ts +278 -0
  379. package/UI/Components/Workflow/RunForm.tsx +41 -7
  380. package/UI/Components/Workflow/RunStatusWatcher.ts +122 -0
  381. package/UI/Components/Workflow/StepTraceViewer.tsx +186 -0
  382. package/UI/Components/Workflow/UseRunWatch.ts +212 -0
  383. package/UI/Components/Workflow/Utils.ts +93 -1
  384. package/UI/Components/Workflow/VariableModal.tsx +6 -2
  385. package/UI/Components/Workflow/Workflow.tsx +126 -7
  386. package/UI/Components/Workflow/WorkflowIssuesModal.tsx +255 -0
  387. package/UI/Components/Workflow/WorkflowLogModal.tsx +128 -0
  388. package/UI/Components/Workflow/WorkflowStatusBar.tsx +224 -0
  389. package/UI/Types/LayeredDismissal.ts +31 -0
  390. package/UI/Types/UseAnchoredFieldPopup.ts +99 -0
  391. package/UI/Utils/AIChatExport/ConversationMarkdown.ts +10 -0
  392. package/UI/Utils/ModelAPI/ModelAPI.ts +7 -1
  393. package/UI/Utils/Platform.ts +149 -0
  394. package/UI/Utils/ProjectInvitationDisplay.ts +118 -0
  395. package/UI/esbuild-config.js +22 -1
  396. package/Utils/Monitor/NetworkDeviceLinkRuleUtil.ts +187 -0
  397. package/Utils/Monitor/NetworkDeviceRoleUtil.ts +533 -0
  398. package/Utils/Monitor/NetworkTopologyUtil.ts +917 -155
  399. package/Utils/Telemetry/CrossSignalScope.ts +502 -0
  400. package/Utils/Telemetry/EntityKey.ts +71 -5
  401. package/Utils/Telemetry/EntityRelationship.ts +1 -1
  402. package/build/dist/Models/AnalyticsModels/MetricItemAggMV1mByK8sCluster.js +1 -1
  403. package/build/dist/Models/AnalyticsModels/MetricItemAggMV1mByService.js +1 -1
  404. package/build/dist/Models/DatabaseModels/AIConversation.js +32 -0
  405. package/build/dist/Models/DatabaseModels/AIConversation.js.map +1 -1
  406. package/build/dist/Models/DatabaseModels/AIConversationMessage.js +42 -0
  407. package/build/dist/Models/DatabaseModels/AIConversationMessage.js.map +1 -1
  408. package/build/dist/Models/DatabaseModels/AlertEpisodeMember.js +28 -0
  409. package/build/dist/Models/DatabaseModels/AlertEpisodeMember.js.map +1 -1
  410. package/build/dist/Models/DatabaseModels/IncidentEpisodeMember.js +29 -0
  411. package/build/dist/Models/DatabaseModels/IncidentEpisodeMember.js.map +1 -1
  412. package/build/dist/Models/DatabaseModels/Index.js +12 -4
  413. package/build/dist/Models/DatabaseModels/Index.js.map +1 -1
  414. package/build/dist/Models/DatabaseModels/{TelemetryEntity.js → InventoryItem.js} +212 -29
  415. package/build/dist/Models/DatabaseModels/InventoryItem.js.map +1 -0
  416. package/build/dist/Models/DatabaseModels/InventoryItemCustomField.js +454 -0
  417. package/build/dist/Models/DatabaseModels/InventoryItemCustomField.js.map +1 -0
  418. package/build/dist/Models/DatabaseModels/{TelemetryEntityRelationship.js → InventoryItemRelationship.js} +52 -25
  419. package/build/dist/Models/DatabaseModels/InventoryItemRelationship.js.map +1 -0
  420. package/build/dist/Models/DatabaseModels/NetworkDevice.js +141 -0
  421. package/build/dist/Models/DatabaseModels/NetworkDevice.js.map +1 -1
  422. package/build/dist/Models/DatabaseModels/NetworkDeviceLink.js +719 -0
  423. package/build/dist/Models/DatabaseModels/NetworkDeviceLink.js.map +1 -0
  424. package/build/dist/Models/DatabaseModels/NetworkDeviceLinkRule.js +475 -0
  425. package/build/dist/Models/DatabaseModels/NetworkDeviceLinkRule.js.map +1 -0
  426. package/build/dist/Models/DatabaseModels/NetworkTopologySuppression.js +446 -0
  427. package/build/dist/Models/DatabaseModels/NetworkTopologySuppression.js.map +1 -0
  428. package/build/dist/Models/DatabaseModels/OnCallDutyPolicyFeed.js +9 -0
  429. package/build/dist/Models/DatabaseModels/OnCallDutyPolicyFeed.js.map +1 -1
  430. package/build/dist/Models/DatabaseModels/Project.js +80 -0
  431. package/build/dist/Models/DatabaseModels/Project.js.map +1 -1
  432. package/build/dist/Models/DatabaseModels/UserCall.js +46 -2
  433. package/build/dist/Models/DatabaseModels/UserCall.js.map +1 -1
  434. package/build/dist/Models/DatabaseModels/UserEmail.js +48 -2
  435. package/build/dist/Models/DatabaseModels/UserEmail.js.map +1 -1
  436. package/build/dist/Models/DatabaseModels/UserNotificationRule.js +424 -55
  437. package/build/dist/Models/DatabaseModels/UserNotificationRule.js.map +1 -1
  438. package/build/dist/Models/DatabaseModels/UserOnCallLogTimeline.js +24 -2
  439. package/build/dist/Models/DatabaseModels/UserOnCallLogTimeline.js.map +1 -1
  440. package/build/dist/Models/DatabaseModels/UserPush.js +51 -1
  441. package/build/dist/Models/DatabaseModels/UserPush.js.map +1 -1
  442. package/build/dist/Models/DatabaseModels/UserSMS.js +47 -2
  443. package/build/dist/Models/DatabaseModels/UserSMS.js.map +1 -1
  444. package/build/dist/Models/DatabaseModels/UserTelegram.js +65 -3
  445. package/build/dist/Models/DatabaseModels/UserTelegram.js.map +1 -1
  446. package/build/dist/Models/DatabaseModels/UserWebhook.js +56 -2
  447. package/build/dist/Models/DatabaseModels/UserWebhook.js.map +1 -1
  448. package/build/dist/Models/DatabaseModels/UserWhatsApp.js +45 -2
  449. package/build/dist/Models/DatabaseModels/UserWhatsApp.js.map +1 -1
  450. package/build/dist/Models/DatabaseModels/WorkflowLog.js +39 -0
  451. package/build/dist/Models/DatabaseModels/WorkflowLog.js.map +1 -1
  452. package/build/dist/Models/DatabaseModels/WorkflowVariable.js +12 -0
  453. package/build/dist/Models/DatabaseModels/WorkflowVariable.js.map +1 -1
  454. package/build/dist/Server/API/AIChatAPI.js +237 -1
  455. package/build/dist/Server/API/AIChatAPI.js.map +1 -1
  456. package/build/dist/Server/API/DashboardAPI.js +165 -13
  457. package/build/dist/Server/API/DashboardAPI.js.map +1 -1
  458. package/build/dist/Server/API/OnCallReadinessAPI.js +599 -0
  459. package/build/dist/Server/API/OnCallReadinessAPI.js.map +1 -0
  460. package/build/dist/Server/API/TeamComplianceAPI.js +68 -9
  461. package/build/dist/Server/API/TeamComplianceAPI.js.map +1 -1
  462. package/build/dist/Server/API/TelemetryAPI.js +129 -18
  463. package/build/dist/Server/API/TelemetryAPI.js.map +1 -1
  464. package/build/dist/Server/API/UserAPI.js +16 -1
  465. package/build/dist/Server/API/UserAPI.js.map +1 -1
  466. package/build/dist/Server/EnvironmentConfig.js +45 -0
  467. package/build/dist/Server/EnvironmentConfig.js.map +1 -1
  468. package/build/dist/Server/Infrastructure/Postgres/DataSourceOptions.js +22 -0
  469. package/build/dist/Server/Infrastructure/Postgres/DataSourceOptions.js.map +1 -1
  470. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1786100000000-RestoreServiceLowerNameIndex.js +4 -4
  471. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1786551733814-MigrationName.js +20 -0
  472. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1786551733814-MigrationName.js.map +1 -0
  473. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1786559879134-AddWorkflowLogStepTrace.js +12 -0
  474. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1786559879134-AddWorkflowLogStepTrace.js.map +1 -0
  475. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1786625176831-AddMonitoringMethodToNetworkDevice.js +18 -0
  476. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1786625176831-AddMonitoringMethodToNetworkDevice.js.map +1 -0
  477. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1786634985763-AddNetworkDeviceLink.js +39 -0
  478. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1786634985763-AddNetworkDeviceLink.js.map +1 -0
  479. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1786639512056-AddNetworkDeviceLinkRule.js +38 -0
  480. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1786639512056-AddNetworkDeviceLinkRule.js.map +1 -0
  481. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1786639972982-AddNetworkTopologySuppression.js +22 -0
  482. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1786639972982-AddNetworkTopologySuppression.js.map +1 -0
  483. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1786800000000-RenameTelemetryEntityToInventoryItem.js +150 -0
  484. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1786800000000-RenameTelemetryEntityToInventoryItem.js.map +1 -0
  485. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1786900000000-AddInventoryItemArchiveAndCustomFields.js +57 -0
  486. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1786900000000-AddInventoryItemArchiveAndCustomFields.js.map +1 -0
  487. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1787000000000-AddOnCallNotificationFallbackColumns.js +69 -0
  488. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1787000000000-AddOnCallNotificationFallbackColumns.js.map +1 -0
  489. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1787100000000-AddAIConversationPageContext.js +32 -0
  490. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1787100000000-AddAIConversationPageContext.js.map +1 -0
  491. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1787200000000-AddAIChatMessageFeedback.js +26 -0
  492. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1787200000000-AddAIChatMessageFeedback.js.map +1 -0
  493. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1787300000000-AddEpisodeMemberNotifyIndexes.js +48 -0
  494. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1787300000000-AddEpisodeMemberNotifyIndexes.js.map +1 -0
  495. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js +24 -0
  496. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js.map +1 -1
  497. package/build/dist/Server/Infrastructure/Queue.js +72 -13
  498. package/build/dist/Server/Infrastructure/Queue.js.map +1 -1
  499. package/build/dist/Server/Middleware/MasterAdminAuthorization.js +11 -6
  500. package/build/dist/Server/Middleware/MasterAdminAuthorization.js.map +1 -1
  501. package/build/dist/Server/Middleware/PublicDashboardRateLimit.js +399 -0
  502. package/build/dist/Server/Middleware/PublicDashboardRateLimit.js.map +1 -0
  503. package/build/dist/Server/Services/AIService.js +1 -0
  504. package/build/dist/Server/Services/AIService.js.map +1 -1
  505. package/build/dist/Server/Services/AlertEpisodeStateTimelineService.js +24 -3
  506. package/build/dist/Server/Services/AlertEpisodeStateTimelineService.js.map +1 -1
  507. package/build/dist/Server/Services/AlertSeverityService.js +54 -0
  508. package/build/dist/Server/Services/AlertSeverityService.js.map +1 -1
  509. package/build/dist/Server/Services/DashboardService.js +10 -9
  510. package/build/dist/Server/Services/DashboardService.js.map +1 -1
  511. package/build/dist/Server/Services/DatabaseService.js +24 -2
  512. package/build/dist/Server/Services/DatabaseService.js.map +1 -1
  513. package/build/dist/Server/Services/IncidentEpisodeStateTimelineService.js +24 -3
  514. package/build/dist/Server/Services/IncidentEpisodeStateTimelineService.js.map +1 -1
  515. package/build/dist/Server/Services/IncidentSeverityService.js +67 -0
  516. package/build/dist/Server/Services/IncidentSeverityService.js.map +1 -1
  517. package/build/dist/Server/Services/Index.js +12 -4
  518. package/build/dist/Server/Services/Index.js.map +1 -1
  519. package/build/dist/Server/Services/InventoryItemCustomFieldService.js +9 -0
  520. package/build/dist/Server/Services/InventoryItemCustomFieldService.js.map +1 -0
  521. package/build/dist/Server/Services/{TelemetryEntityRelationshipService.js → InventoryItemRelationshipService.js} +9 -6
  522. package/build/dist/Server/Services/InventoryItemRelationshipService.js.map +1 -0
  523. package/build/dist/Server/Services/{TelemetryEntityService.js → InventoryItemService.js} +158 -23
  524. package/build/dist/Server/Services/InventoryItemService.js.map +1 -0
  525. package/build/dist/Server/Services/LogAggregationService.js +27 -8
  526. package/build/dist/Server/Services/LogAggregationService.js.map +1 -1
  527. package/build/dist/Server/Services/MetricAggregationService.js +80 -0
  528. package/build/dist/Server/Services/MetricAggregationService.js.map +1 -1
  529. package/build/dist/Server/Services/MetricService.js +6 -6
  530. package/build/dist/Server/Services/MetricService.js.map +1 -1
  531. package/build/dist/Server/Services/NetworkDeviceLinkRuleService.js +9 -0
  532. package/build/dist/Server/Services/NetworkDeviceLinkRuleService.js.map +1 -0
  533. package/build/dist/Server/Services/NetworkDeviceLinkService.js +71 -0
  534. package/build/dist/Server/Services/NetworkDeviceLinkService.js.map +1 -0
  535. package/build/dist/Server/Services/NetworkDeviceService.js +113 -0
  536. package/build/dist/Server/Services/NetworkDeviceService.js.map +1 -1
  537. package/build/dist/Server/Services/NetworkSiteService.js +53 -13
  538. package/build/dist/Server/Services/NetworkSiteService.js.map +1 -1
  539. package/build/dist/Server/Services/NetworkTopologySuppressionService.js +85 -0
  540. package/build/dist/Server/Services/NetworkTopologySuppressionService.js.map +1 -0
  541. package/build/dist/Server/Services/OnCallDutyPolicyEscalationRuleScheduleService.js +48 -32
  542. package/build/dist/Server/Services/OnCallDutyPolicyEscalationRuleScheduleService.js.map +1 -1
  543. package/build/dist/Server/Services/OnCallDutyPolicyExecutionLogService.js +8 -0
  544. package/build/dist/Server/Services/OnCallDutyPolicyExecutionLogService.js.map +1 -1
  545. package/build/dist/Server/Services/OnCallDutyPolicyExecutionLogTimelineService.js +51 -12
  546. package/build/dist/Server/Services/OnCallDutyPolicyExecutionLogTimelineService.js.map +1 -1
  547. package/build/dist/Server/Services/OnCallDutyPolicyScheduleService.js +57 -13
  548. package/build/dist/Server/Services/OnCallDutyPolicyScheduleService.js.map +1 -1
  549. package/build/dist/Server/Services/OnCallNotificationAlertingService.js +548 -0
  550. package/build/dist/Server/Services/OnCallNotificationAlertingService.js.map +1 -0
  551. package/build/dist/Server/Services/OnCallReadinessService.js +1961 -0
  552. package/build/dist/Server/Services/OnCallReadinessService.js.map +1 -0
  553. package/build/dist/Server/Services/OnCallSetupReminderService.js +738 -0
  554. package/build/dist/Server/Services/OnCallSetupReminderService.js.map +1 -0
  555. package/build/dist/Server/Services/ProfileAggregationService.js +68 -4
  556. package/build/dist/Server/Services/ProfileAggregationService.js.map +1 -1
  557. package/build/dist/Server/Services/StatusPageService.js +11 -10
  558. package/build/dist/Server/Services/StatusPageService.js.map +1 -1
  559. package/build/dist/Server/Services/TeamComplianceService.js +312 -160
  560. package/build/dist/Server/Services/TeamComplianceService.js.map +1 -1
  561. package/build/dist/Server/Services/UserCallService.js +24 -1
  562. package/build/dist/Server/Services/UserCallService.js.map +1 -1
  563. package/build/dist/Server/Services/UserEmailService.js +24 -1
  564. package/build/dist/Server/Services/UserEmailService.js.map +1 -1
  565. package/build/dist/Server/Services/UserNotificationRuleAdminService.js +858 -0
  566. package/build/dist/Server/Services/UserNotificationRuleAdminService.js.map +1 -0
  567. package/build/dist/Server/Services/UserNotificationRuleService.js +2830 -175
  568. package/build/dist/Server/Services/UserNotificationRuleService.js.map +1 -1
  569. package/build/dist/Server/Services/UserOnCallLogService.js +488 -43
  570. package/build/dist/Server/Services/UserOnCallLogService.js.map +1 -1
  571. package/build/dist/Server/Services/UserPushService.js +26 -0
  572. package/build/dist/Server/Services/UserPushService.js.map +1 -1
  573. package/build/dist/Server/Services/UserService.js +10 -0
  574. package/build/dist/Server/Services/UserService.js.map +1 -1
  575. package/build/dist/Server/Services/UserSmsService.js +24 -1
  576. package/build/dist/Server/Services/UserSmsService.js.map +1 -1
  577. package/build/dist/Server/Services/UserTelegramService.js +22 -1
  578. package/build/dist/Server/Services/UserTelegramService.js.map +1 -1
  579. package/build/dist/Server/Services/UserWebhookService.js +25 -1
  580. package/build/dist/Server/Services/UserWebhookService.js.map +1 -1
  581. package/build/dist/Server/Services/UserWhatsAppService.js +22 -1
  582. package/build/dist/Server/Services/UserWhatsAppService.js.map +1 -1
  583. package/build/dist/Server/Types/Database/Permissions/BasePermission.js +12 -1
  584. package/build/dist/Server/Types/Database/Permissions/BasePermission.js.map +1 -1
  585. package/build/dist/Server/Types/Database/Permissions/CreatePermission.js +126 -0
  586. package/build/dist/Server/Types/Database/Permissions/CreatePermission.js.map +1 -1
  587. package/build/dist/Server/Types/Database/Permissions/OwnerOnlyColumnPermission.js +254 -0
  588. package/build/dist/Server/Types/Database/Permissions/OwnerOnlyColumnPermission.js.map +1 -0
  589. package/build/dist/Server/Types/Database/Permissions/QueryPermission.js +47 -2
  590. package/build/dist/Server/Types/Database/Permissions/QueryPermission.js.map +1 -1
  591. package/build/dist/Server/Types/Database/Permissions/TenantPermission.js +7 -0
  592. package/build/dist/Server/Types/Database/Permissions/TenantPermission.js.map +1 -1
  593. package/build/dist/Server/Types/Workflow/Components/API/Delete.js +1 -1
  594. package/build/dist/Server/Types/Workflow/Components/API/Delete.js.map +1 -1
  595. package/build/dist/Server/Types/Workflow/Components/API/Get.js +1 -1
  596. package/build/dist/Server/Types/Workflow/Components/API/Get.js.map +1 -1
  597. package/build/dist/Server/Types/Workflow/Components/API/Patch.js +1 -1
  598. package/build/dist/Server/Types/Workflow/Components/API/Patch.js.map +1 -1
  599. package/build/dist/Server/Types/Workflow/Components/API/Post.js +1 -1
  600. package/build/dist/Server/Types/Workflow/Components/API/Post.js.map +1 -1
  601. package/build/dist/Server/Types/Workflow/Components/API/Put.js +1 -1
  602. package/build/dist/Server/Types/Workflow/Components/API/Put.js.map +1 -1
  603. package/build/dist/Server/Types/Workflow/Components/API/Utils.js +28 -0
  604. package/build/dist/Server/Types/Workflow/Components/API/Utils.js.map +1 -1
  605. package/build/dist/Server/Types/Workflow/Components/BaseModel/CreateManyBaseModel.js +21 -5
  606. package/build/dist/Server/Types/Workflow/Components/BaseModel/CreateManyBaseModel.js.map +1 -1
  607. package/build/dist/Server/Types/Workflow/Components/BaseModel/CreateOneBaseModel.js +14 -10
  608. package/build/dist/Server/Types/Workflow/Components/BaseModel/CreateOneBaseModel.js.map +1 -1
  609. package/build/dist/Server/Types/Workflow/Components/BaseModel/ModelArguments.js +31 -0
  610. package/build/dist/Server/Types/Workflow/Components/BaseModel/ModelArguments.js.map +1 -1
  611. package/build/dist/Server/Types/Workflow/Components/Conditions/IfElse.js +3 -9
  612. package/build/dist/Server/Types/Workflow/Components/Conditions/IfElse.js.map +1 -1
  613. package/build/dist/Server/Types/Workflow/Components/Email.js +15 -4
  614. package/build/dist/Server/Types/Workflow/Components/Email.js.map +1 -1
  615. package/build/dist/Server/Types/Workflow/Components/JavaScript.js +7 -2
  616. package/build/dist/Server/Types/Workflow/Components/JavaScript.js.map +1 -1
  617. package/build/dist/Server/Types/Workflow/Components/MicrosoftTeams/SendMessageToChannel.js +1 -1
  618. package/build/dist/Server/Types/Workflow/Components/MicrosoftTeams/SendMessageToChannel.js.map +1 -1
  619. package/build/dist/Server/Types/Workflow/TriggerCode.js.map +1 -1
  620. package/build/dist/Server/Utils/AI/Chat/ChatAgentRunner.js +514 -56
  621. package/build/dist/Server/Utils/AI/Chat/ChatAgentRunner.js.map +1 -1
  622. package/build/dist/Server/Utils/AI/Chat/ObservabilityAssistant.js +20 -3
  623. package/build/dist/Server/Utils/AI/Chat/ObservabilityAssistant.js.map +1 -1
  624. package/build/dist/Server/Utils/AI/Chat/ObservabilityChatPrompt.js +19 -6
  625. package/build/dist/Server/Utils/AI/Chat/ObservabilityChatPrompt.js.map +1 -1
  626. package/build/dist/Server/Utils/AI/SRE/AIInvestigationEngine.js +7 -0
  627. package/build/dist/Server/Utils/AI/SRE/AIInvestigationEngine.js.map +1 -1
  628. package/build/dist/Server/Utils/AI/Toolbox/AIActionTools.js +2 -2
  629. package/build/dist/Server/Utils/AI/Toolbox/AIActionTools.js.map +1 -1
  630. package/build/dist/Server/Utils/AI/Toolbox/AIMetaTools.js +692 -0
  631. package/build/dist/Server/Utils/AI/Toolbox/AIMetaTools.js.map +1 -0
  632. package/build/dist/Server/Utils/AI/Toolbox/AlertTools.js +148 -12
  633. package/build/dist/Server/Utils/AI/Toolbox/AlertTools.js.map +1 -1
  634. package/build/dist/Server/Utils/AI/Toolbox/IncidentTools.js +157 -10
  635. package/build/dist/Server/Utils/AI/Toolbox/IncidentTools.js.map +1 -1
  636. package/build/dist/Server/Utils/AI/Toolbox/Index.js +37 -0
  637. package/build/dist/Server/Utils/AI/Toolbox/Index.js.map +1 -1
  638. package/build/dist/Server/Utils/AI/Toolbox/MonitorTools.js +259 -14
  639. package/build/dist/Server/Utils/AI/Toolbox/MonitorTools.js.map +1 -1
  640. package/build/dist/Server/Utils/AI/Toolbox/NoteWriteTools.js +235 -0
  641. package/build/dist/Server/Utils/AI/Toolbox/NoteWriteTools.js.map +1 -0
  642. package/build/dist/Server/Utils/AI/Toolbox/OnCallTools.js +1000 -0
  643. package/build/dist/Server/Utils/AI/Toolbox/OnCallTools.js.map +1 -0
  644. package/build/dist/Server/Utils/AI/Toolbox/RunbookTools.js +356 -0
  645. package/build/dist/Server/Utils/AI/Toolbox/RunbookTools.js.map +1 -0
  646. package/build/dist/Server/Utils/AI/Toolbox/SloTools.js +394 -0
  647. package/build/dist/Server/Utils/AI/Toolbox/SloTools.js.map +1 -0
  648. package/build/dist/Server/Utils/AI/Toolbox/StatusPageTools.js +465 -0
  649. package/build/dist/Server/Utils/AI/Toolbox/StatusPageTools.js.map +1 -0
  650. package/build/dist/Server/Utils/AI/Toolbox/TeamTools.js +280 -0
  651. package/build/dist/Server/Utils/AI/Toolbox/TeamTools.js.map +1 -0
  652. package/build/dist/Server/Utils/AI/Toolbox/TimelineTools.js +527 -0
  653. package/build/dist/Server/Utils/AI/Toolbox/TimelineTools.js.map +1 -0
  654. package/build/dist/Server/Utils/AI/Toolbox/WorkflowProbeTools.js +548 -0
  655. package/build/dist/Server/Utils/AI/Toolbox/WorkflowProbeTools.js.map +1 -0
  656. package/build/dist/Server/Utils/ClientIp.js +137 -0
  657. package/build/dist/Server/Utils/ClientIp.js.map +1 -0
  658. package/build/dist/Server/Utils/Dashboard/PublicDashboardResourceListPolicy.js +38 -0
  659. package/build/dist/Server/Utils/Dashboard/PublicDashboardResourceListPolicy.js.map +1 -1
  660. package/build/dist/Server/Utils/Dashboard/PublicDashboardSloHistoryPolicy.js +89 -0
  661. package/build/dist/Server/Utils/Dashboard/PublicDashboardSloHistoryPolicy.js.map +1 -0
  662. package/build/dist/Server/Utils/Dashboard/PublicDashboardSloWidget.js +77 -0
  663. package/build/dist/Server/Utils/Dashboard/PublicDashboardSloWidget.js.map +1 -0
  664. package/build/dist/Server/Utils/Express.js +12 -12
  665. package/build/dist/Server/Utils/Express.js.map +1 -1
  666. package/build/dist/Server/Utils/LLM/LLMService.js +70 -7
  667. package/build/dist/Server/Utils/LLM/LLMService.js.map +1 -1
  668. package/build/dist/Server/Utils/Monitor/MonitorCriteriaEvaluator.js +121 -11
  669. package/build/dist/Server/Utils/Monitor/MonitorCriteriaEvaluator.js.map +1 -1
  670. package/build/dist/Server/Utils/SSRFProtection.js +82 -21
  671. package/build/dist/Server/Utils/SSRFProtection.js.map +1 -1
  672. package/build/dist/Server/Utils/StartServer.js +12 -4
  673. package/build/dist/Server/Utils/StartServer.js.map +1 -1
  674. package/build/dist/Server/Utils/Telemetry/EntityRegistry.js +165 -18
  675. package/build/dist/Server/Utils/Telemetry/EntityRegistry.js.map +1 -1
  676. package/build/dist/Server/Utils/Telemetry/InventoryEntityRegistry.js +507 -0
  677. package/build/dist/Server/Utils/Telemetry/InventoryEntityRegistry.js.map +1 -0
  678. package/build/dist/Server/Utils/Telemetry/TelemetryEntity.js +122 -47
  679. package/build/dist/Server/Utils/Telemetry/TelemetryEntity.js.map +1 -1
  680. package/build/dist/Server/Utils/VM/VMAPI.js +51 -4
  681. package/build/dist/Server/Utils/VM/VMAPI.js.map +1 -1
  682. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeams.js +7 -3
  683. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeams.js.map +1 -1
  684. package/build/dist/Types/AI/AIChatMessageStatus.js +8 -1
  685. package/build/dist/Types/AI/AIChatMessageStatus.js.map +1 -1
  686. package/build/dist/Types/AI/AIChatTypes.js +12 -0
  687. package/build/dist/Types/AI/AIChatTypes.js.map +1 -1
  688. package/build/dist/Types/Database/AccessControl/OwnerOnlyColumn.js +60 -0
  689. package/build/dist/Types/Database/AccessControl/OwnerOnlyColumn.js.map +1 -0
  690. package/build/dist/Types/Exception/ExceptionCode.js +2 -0
  691. package/build/dist/Types/Exception/ExceptionCode.js.map +1 -1
  692. package/build/dist/Types/Exception/ServiceUnavailableException.js +8 -0
  693. package/build/dist/Types/Exception/ServiceUnavailableException.js.map +1 -0
  694. package/build/dist/Types/Exception/TooManyRequestsException.js +8 -0
  695. package/build/dist/Types/Exception/TooManyRequestsException.js.map +1 -0
  696. package/build/dist/Types/IP/IP.js +87 -43
  697. package/build/dist/Types/IP/IP.js.map +1 -1
  698. package/build/dist/Types/NetworkDevice/NetworkDeviceMonitoringMethod.js +50 -0
  699. package/build/dist/Types/NetworkDevice/NetworkDeviceMonitoringMethod.js.map +1 -0
  700. package/build/dist/Types/OnCallDutyPolicy/Layer.js +186 -123
  701. package/build/dist/Types/OnCallDutyPolicy/Layer.js.map +1 -1
  702. package/build/dist/Types/OnCallDutyPolicy/OnCallDutyPolicyStatus.js +13 -0
  703. package/build/dist/Types/OnCallDutyPolicy/OnCallDutyPolicyStatus.js.map +1 -1
  704. package/build/dist/Types/OnCallDutyPolicy/ScheduleShiftUtil.js +105 -11
  705. package/build/dist/Types/OnCallDutyPolicy/ScheduleShiftUtil.js.map +1 -1
  706. package/build/dist/Types/Permission.js +174 -0
  707. package/build/dist/Types/Permission.js.map +1 -1
  708. package/build/dist/Types/SerializableObjectDictionary.js +133 -39
  709. package/build/dist/Types/SerializableObjectDictionary.js.map +1 -1
  710. package/build/dist/Types/Telemetry/EntityRelationshipType.js +1 -1
  711. package/build/dist/Types/Telemetry/EntitySource.js +39 -0
  712. package/build/dist/Types/Telemetry/EntitySource.js.map +1 -0
  713. package/build/dist/Types/Telemetry/EntityType.js +28 -1
  714. package/build/dist/Types/Telemetry/EntityType.js.map +1 -1
  715. package/build/dist/Types/Telemetry/EntityTypeGroups.js +57 -0
  716. package/build/dist/Types/Telemetry/EntityTypeGroups.js.map +1 -0
  717. package/build/dist/Types/Workflow/Component.js +21 -0
  718. package/build/dist/Types/Workflow/Component.js.map +1 -1
  719. package/build/dist/Types/Workflow/Components/API.js +35 -0
  720. package/build/dist/Types/Workflow/Components/API.js.map +1 -1
  721. package/build/dist/Types/Workflow/Components/BaseModel.js +68 -26
  722. package/build/dist/Types/Workflow/Components/BaseModel.js.map +1 -1
  723. package/build/dist/Types/Workflow/Components/Discord.js +1 -0
  724. package/build/dist/Types/Workflow/Components/Discord.js.map +1 -1
  725. package/build/dist/Types/Workflow/Components/Email.js +12 -3
  726. package/build/dist/Types/Workflow/Components/Email.js.map +1 -1
  727. package/build/dist/Types/Workflow/Components/JavaScript.js +7 -0
  728. package/build/dist/Types/Workflow/Components/JavaScript.js.map +1 -1
  729. package/build/dist/Types/Workflow/Components/MicrosoftTeams.js +3 -2
  730. package/build/dist/Types/Workflow/Components/MicrosoftTeams.js.map +1 -1
  731. package/build/dist/Types/Workflow/Components/Slack.js +1 -0
  732. package/build/dist/Types/Workflow/Components/Slack.js.map +1 -1
  733. package/build/dist/Types/Workflow/Components/Telegram.js +1 -0
  734. package/build/dist/Types/Workflow/Components/Telegram.js.map +1 -1
  735. package/build/dist/Types/Workflow/StepTrace.js +104 -0
  736. package/build/dist/Types/Workflow/StepTrace.js.map +1 -0
  737. package/build/dist/Types/Workflow/TemplateSyntax.js +338 -0
  738. package/build/dist/Types/Workflow/TemplateSyntax.js.map +1 -0
  739. package/build/dist/Types/Workflow/Templates.js +2111 -0
  740. package/build/dist/Types/Workflow/Templates.js.map +1 -0
  741. package/build/dist/UI/Components/Calendar/Calendar.js +1 -1
  742. package/build/dist/UI/Components/Calendar/Calendar.js.map +1 -1
  743. package/build/dist/UI/Components/Checkbox/Checkbox.js +1 -1
  744. package/build/dist/UI/Components/Checkbox/Checkbox.js.map +1 -1
  745. package/build/dist/UI/Components/Date/CustomTimeRangeModal.js +126 -0
  746. package/build/dist/UI/Components/Date/CustomTimeRangeModal.js.map +1 -0
  747. package/build/dist/UI/Components/Date/TimeRangePickerDropdown.js +123 -0
  748. package/build/dist/UI/Components/Date/TimeRangePickerDropdown.js.map +1 -0
  749. package/build/dist/UI/Components/Dictionary/Dictionary.js +47 -17
  750. package/build/dist/UI/Components/Dictionary/Dictionary.js.map +1 -1
  751. package/build/dist/UI/Components/FormModal/BasicFormModal.js.map +1 -1
  752. package/build/dist/UI/Components/Forms/Fields/ColorPicker.js +52 -13
  753. package/build/dist/UI/Components/Forms/Fields/ColorPicker.js.map +1 -1
  754. package/build/dist/UI/Components/Forms/Fields/IconPicker.js +28 -12
  755. package/build/dist/UI/Components/Forms/Fields/IconPicker.js.map +1 -1
  756. package/build/dist/UI/Components/Forms/Validation.js +44 -0
  757. package/build/dist/UI/Components/Forms/Validation.js.map +1 -1
  758. package/build/dist/UI/Components/Header/HeaderIconDropdownButton.js +27 -4
  759. package/build/dist/UI/Components/Header/HeaderIconDropdownButton.js.map +1 -1
  760. package/build/dist/UI/Components/Input/Input.js +13 -4
  761. package/build/dist/UI/Components/Input/Input.js.map +1 -1
  762. package/build/dist/UI/Components/KeyboardShortcut/KeyboardKey.js +163 -0
  763. package/build/dist/UI/Components/KeyboardShortcut/KeyboardKey.js.map +1 -0
  764. package/build/dist/UI/Components/KeyboardShortcut/KeyboardShortcut.js +47 -0
  765. package/build/dist/UI/Components/KeyboardShortcut/KeyboardShortcut.js.map +1 -0
  766. package/build/dist/UI/Components/LogsViewer/LogsViewer.js +4 -4
  767. package/build/dist/UI/Components/LogsViewer/LogsViewer.js.map +1 -1
  768. package/build/dist/UI/Components/LogsViewer/components/ActiveFilterChips.js +11 -1
  769. package/build/dist/UI/Components/LogsViewer/components/ActiveFilterChips.js.map +1 -1
  770. package/build/dist/UI/Components/LogsViewer/components/KeyboardShortcutsHelp.js +10 -8
  771. package/build/dist/UI/Components/LogsViewer/components/KeyboardShortcutsHelp.js.map +1 -1
  772. package/build/dist/UI/Components/LogsViewer/components/LogDetailsPanel.js +227 -14
  773. package/build/dist/UI/Components/LogsViewer/components/LogDetailsPanel.js.map +1 -1
  774. package/build/dist/UI/Components/LogsViewer/components/LogTimeRangePicker.js +5 -108
  775. package/build/dist/UI/Components/LogsViewer/components/LogTimeRangePicker.js.map +1 -1
  776. package/build/dist/UI/Components/LogsViewer/components/LogsAnalyticsView.js +5 -0
  777. package/build/dist/UI/Components/LogsViewer/components/LogsAnalyticsView.js.map +1 -1
  778. package/build/dist/UI/Components/LogsViewer/components/LogsTable.js +69 -5
  779. package/build/dist/UI/Components/LogsViewer/components/LogsTable.js.map +1 -1
  780. package/build/dist/UI/Components/LogsViewer/components/LogsViewerToolbar.js +8 -0
  781. package/build/dist/UI/Components/LogsViewer/components/LogsViewerToolbar.js.map +1 -1
  782. package/build/dist/UI/Components/LogsViewer/types.js.map +1 -1
  783. package/build/dist/UI/Components/Markdown.tsx/MarkdownEditor.js +9 -2
  784. package/build/dist/UI/Components/Markdown.tsx/MarkdownEditor.js.map +1 -1
  785. package/build/dist/UI/Components/Modal/Modal.js +31 -5
  786. package/build/dist/UI/Components/Modal/Modal.js.map +1 -1
  787. package/build/dist/UI/Components/Navbar/NavBarMenuModal.js +8 -21
  788. package/build/dist/UI/Components/Navbar/NavBarMenuModal.js.map +1 -1
  789. package/build/dist/UI/Components/ProjectInvitations/PendingProjectInvitations.js +251 -0
  790. package/build/dist/UI/Components/ProjectInvitations/PendingProjectInvitations.js.map +1 -0
  791. package/build/dist/UI/Components/SimpleLogViewer/SimpleLogViewer.js +9 -2
  792. package/build/dist/UI/Components/SimpleLogViewer/SimpleLogViewer.js.map +1 -1
  793. package/build/dist/UI/Components/Table/Table.js +27 -15
  794. package/build/dist/UI/Components/Table/Table.js.map +1 -1
  795. package/build/dist/UI/Components/Table/TableBody.js +24 -18
  796. package/build/dist/UI/Components/Table/TableBody.js.map +1 -1
  797. package/build/dist/UI/Components/Table/TableHeader.js +9 -1
  798. package/build/dist/UI/Components/Table/TableHeader.js.map +1 -1
  799. package/build/dist/UI/Components/Table/TableRow.js +29 -21
  800. package/build/dist/UI/Components/Table/TableRow.js.map +1 -1
  801. package/build/dist/UI/Components/TelemetryViewer/components/TelemetryTimeRangePicker.js +5 -105
  802. package/build/dist/UI/Components/TelemetryViewer/components/TelemetryTimeRangePicker.js.map +1 -1
  803. package/build/dist/UI/Components/Workflow/ArgumentsForm.js +261 -14
  804. package/build/dist/UI/Components/Workflow/ArgumentsForm.js.map +1 -1
  805. package/build/dist/UI/Components/Workflow/Component.js +20 -19
  806. package/build/dist/UI/Components/Workflow/Component.js.map +1 -1
  807. package/build/dist/UI/Components/Workflow/ComponentReturnValueViewer.js +10 -1
  808. package/build/dist/UI/Components/Workflow/ComponentReturnValueViewer.js.map +1 -1
  809. package/build/dist/UI/Components/Workflow/ComponentSettingsModal.js +35 -7
  810. package/build/dist/UI/Components/Workflow/ComponentSettingsModal.js.map +1 -1
  811. package/build/dist/UI/Components/Workflow/ComponentValuePickerModal.js +57 -7
  812. package/build/dist/UI/Components/Workflow/ComponentValuePickerModal.js.map +1 -1
  813. package/build/dist/UI/Components/Workflow/ComponentsModal.js +53 -18
  814. package/build/dist/UI/Components/Workflow/ComponentsModal.js.map +1 -1
  815. package/build/dist/UI/Components/Workflow/DocumentationViewer.js +19 -6
  816. package/build/dist/UI/Components/Workflow/DocumentationViewer.js.map +1 -1
  817. package/build/dist/UI/Components/Workflow/GraphLint.js +425 -0
  818. package/build/dist/UI/Components/Workflow/GraphLint.js.map +1 -0
  819. package/build/dist/UI/Components/Workflow/GraphLintSummary.js +231 -0
  820. package/build/dist/UI/Components/Workflow/GraphLintSummary.js.map +1 -0
  821. package/build/dist/UI/Components/Workflow/ModelColumnEditor.js +320 -0
  822. package/build/dist/UI/Components/Workflow/ModelColumnEditor.js.map +1 -0
  823. package/build/dist/UI/Components/Workflow/ModelSchema.js +156 -0
  824. package/build/dist/UI/Components/Workflow/ModelSchema.js.map +1 -0
  825. package/build/dist/UI/Components/Workflow/RunForm.js +22 -6
  826. package/build/dist/UI/Components/Workflow/RunForm.js.map +1 -1
  827. package/build/dist/UI/Components/Workflow/RunStatusWatcher.js +76 -0
  828. package/build/dist/UI/Components/Workflow/RunStatusWatcher.js.map +1 -0
  829. package/build/dist/UI/Components/Workflow/StepTraceViewer.js +76 -0
  830. package/build/dist/UI/Components/Workflow/StepTraceViewer.js.map +1 -0
  831. package/build/dist/UI/Components/Workflow/UseRunWatch.js +123 -0
  832. package/build/dist/UI/Components/Workflow/UseRunWatch.js.map +1 -0
  833. package/build/dist/UI/Components/Workflow/Utils.js +73 -1
  834. package/build/dist/UI/Components/Workflow/Utils.js.map +1 -1
  835. package/build/dist/UI/Components/Workflow/VariableModal.js +3 -2
  836. package/build/dist/UI/Components/Workflow/VariableModal.js.map +1 -1
  837. package/build/dist/UI/Components/Workflow/Workflow.js +92 -7
  838. package/build/dist/UI/Components/Workflow/Workflow.js.map +1 -1
  839. package/build/dist/UI/Components/Workflow/WorkflowIssuesModal.js +99 -0
  840. package/build/dist/UI/Components/Workflow/WorkflowIssuesModal.js.map +1 -0
  841. package/build/dist/UI/Components/Workflow/WorkflowLogModal.js +56 -0
  842. package/build/dist/UI/Components/Workflow/WorkflowLogModal.js.map +1 -0
  843. package/build/dist/UI/Components/Workflow/WorkflowStatusBar.js +92 -0
  844. package/build/dist/UI/Components/Workflow/WorkflowStatusBar.js.map +1 -0
  845. package/build/dist/UI/Types/LayeredDismissal.js +21 -0
  846. package/build/dist/UI/Types/LayeredDismissal.js.map +1 -0
  847. package/build/dist/UI/Types/UseAnchoredFieldPopup.js +74 -1
  848. package/build/dist/UI/Types/UseAnchoredFieldPopup.js.map +1 -1
  849. package/build/dist/UI/Utils/AIChatExport/ConversationMarkdown.js +9 -0
  850. package/build/dist/UI/Utils/AIChatExport/ConversationMarkdown.js.map +1 -1
  851. package/build/dist/UI/Utils/ModelAPI/ModelAPI.js +1 -1
  852. package/build/dist/UI/Utils/ModelAPI/ModelAPI.js.map +1 -1
  853. package/build/dist/UI/Utils/Platform.js +118 -0
  854. package/build/dist/UI/Utils/Platform.js.map +1 -0
  855. package/build/dist/UI/Utils/ProjectInvitationDisplay.js +106 -0
  856. package/build/dist/UI/Utils/ProjectInvitationDisplay.js.map +1 -0
  857. package/build/dist/Utils/Monitor/NetworkDeviceLinkRuleUtil.js +108 -0
  858. package/build/dist/Utils/Monitor/NetworkDeviceLinkRuleUtil.js.map +1 -0
  859. package/build/dist/Utils/Monitor/NetworkDeviceRoleUtil.js +386 -0
  860. package/build/dist/Utils/Monitor/NetworkDeviceRoleUtil.js.map +1 -0
  861. package/build/dist/Utils/Monitor/NetworkTopologyUtil.js +661 -126
  862. package/build/dist/Utils/Monitor/NetworkTopologyUtil.js.map +1 -1
  863. package/build/dist/Utils/Telemetry/CrossSignalScope.js +328 -0
  864. package/build/dist/Utils/Telemetry/CrossSignalScope.js.map +1 -0
  865. package/build/dist/Utils/Telemetry/EntityKey.js +57 -5
  866. package/build/dist/Utils/Telemetry/EntityKey.js.map +1 -1
  867. package/build/dist/Utils/Telemetry/EntityRelationship.js +1 -1
  868. package/jest.config.json +1 -0
  869. package/package.json +1 -1
  870. package/build/dist/Models/DatabaseModels/TelemetryEntity.js.map +0 -1
  871. package/build/dist/Models/DatabaseModels/TelemetryEntityRelationship.js.map +0 -1
  872. package/build/dist/Server/Services/TelemetryEntityRelationshipService.js.map +0 -1
  873. package/build/dist/Server/Services/TelemetryEntityService.js.map +0 -1
@@ -0,0 +1,858 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ var __metadata = (this && this.__metadata) || function (k, v) {
8
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
+ };
10
+ import DatabaseConfig from "../DatabaseConfig";
11
+ import BaseService from "./BaseService";
12
+ import MailService from "./MailService";
13
+ import ProjectService from "./ProjectService";
14
+ import TeamMemberService from "./TeamMemberService";
15
+ import UserCallService from "./UserCallService";
16
+ import UserEmailService from "./UserEmailService";
17
+ import UserPushService from "./UserPushService";
18
+ import UserService from "./UserService";
19
+ import UserSmsService from "./UserSmsService";
20
+ import UserTelegramService from "./UserTelegramService";
21
+ import UserWebhookService from "./UserWebhookService";
22
+ import UserWhatsAppService from "./UserWhatsAppService";
23
+ import { resolveReferenceId } from "../Utils/Database/ProjectScopedReferenceValidator";
24
+ import logger from "../Utils/Logger";
25
+ import CaptureSpan from "../Utils/Telemetry/CaptureSpan";
26
+ import URL from "../../Types/API/URL";
27
+ import AuditLogAction from "../../Types/AuditLog/AuditLogAction";
28
+ import EmailTemplateType from "../../Types/Email/EmailTemplateType";
29
+ import BadDataException from "../../Types/Exception/BadDataException";
30
+ import ObjectID from "../../Types/ObjectID";
31
+ import UserNotificationRule from "../../Models/DatabaseModels/UserNotificationRule";
32
+ export class UserNotificationRuleAdminService extends BaseService {
33
+ /*
34
+ * Built per call, never hoisted to module scope.
35
+ *
36
+ * UserEmailService and its six siblings import UserNotificationRuleService,
37
+ * which imports this file — a genuine require cycle. Capturing the service
38
+ * objects in a module-level constant would read `default` while the sibling
39
+ * module is still mid-evaluation and freeze `undefined` into the table. Built
40
+ * inside a method, every service reference resolves at call time, long after
41
+ * the cycle has settled.
42
+ */
43
+ getNotificationMethodDescriptors() {
44
+ return [
45
+ {
46
+ idColumn: "userEmailId",
47
+ relationColumn: "userEmail",
48
+ label: "Email",
49
+ findOwnerUserId: async (methodId) => {
50
+ var _a;
51
+ return (_a = (await UserEmailService.findOneById({
52
+ id: methodId,
53
+ select: { _id: true, userId: true },
54
+ props: { isRoot: true },
55
+ }))) === null || _a === void 0 ? void 0 : _a.userId;
56
+ },
57
+ },
58
+ {
59
+ idColumn: "userSmsId",
60
+ relationColumn: "userSms",
61
+ label: "SMS",
62
+ findOwnerUserId: async (methodId) => {
63
+ var _a;
64
+ return (_a = (await UserSmsService.findOneById({
65
+ id: methodId,
66
+ select: { _id: true, userId: true },
67
+ props: { isRoot: true },
68
+ }))) === null || _a === void 0 ? void 0 : _a.userId;
69
+ },
70
+ },
71
+ {
72
+ idColumn: "userCallId",
73
+ relationColumn: "userCall",
74
+ label: "Call",
75
+ findOwnerUserId: async (methodId) => {
76
+ var _a;
77
+ return (_a = (await UserCallService.findOneById({
78
+ id: methodId,
79
+ select: { _id: true, userId: true },
80
+ props: { isRoot: true },
81
+ }))) === null || _a === void 0 ? void 0 : _a.userId;
82
+ },
83
+ },
84
+ {
85
+ idColumn: "userWhatsAppId",
86
+ relationColumn: "userWhatsApp",
87
+ label: "WhatsApp",
88
+ findOwnerUserId: async (methodId) => {
89
+ var _a;
90
+ return (_a = (await UserWhatsAppService.findOneById({
91
+ id: methodId,
92
+ select: { _id: true, userId: true },
93
+ props: { isRoot: true },
94
+ }))) === null || _a === void 0 ? void 0 : _a.userId;
95
+ },
96
+ },
97
+ {
98
+ idColumn: "userTelegramId",
99
+ relationColumn: "userTelegram",
100
+ label: "Telegram",
101
+ findOwnerUserId: async (methodId) => {
102
+ var _a;
103
+ return (_a = (await UserTelegramService.findOneById({
104
+ id: methodId,
105
+ select: { _id: true, userId: true },
106
+ props: { isRoot: true },
107
+ }))) === null || _a === void 0 ? void 0 : _a.userId;
108
+ },
109
+ },
110
+ {
111
+ idColumn: "userPushId",
112
+ relationColumn: "userPush",
113
+ label: "Push",
114
+ findOwnerUserId: async (methodId) => {
115
+ var _a;
116
+ return (_a = (await UserPushService.findOneById({
117
+ id: methodId,
118
+ select: { _id: true, userId: true },
119
+ props: { isRoot: true },
120
+ }))) === null || _a === void 0 ? void 0 : _a.userId;
121
+ },
122
+ },
123
+ {
124
+ idColumn: "userWebhookId",
125
+ relationColumn: "userWebhook",
126
+ label: "Webhook",
127
+ findOwnerUserId: async (methodId) => {
128
+ var _a;
129
+ return (_a = (await UserWebhookService.findOneById({
130
+ id: methodId,
131
+ select: { _id: true, userId: true },
132
+ props: { isRoot: true },
133
+ }))) === null || _a === void 0 ? void 0 : _a.userId;
134
+ },
135
+ },
136
+ ];
137
+ }
138
+ /*
139
+ * The seven FK columns, in one place, so a future eighth channel is a single
140
+ * entry rather than an eighth thing to remember. A guard that covers six of
141
+ * seven covers none: the attacker picks the seventh.
142
+ */
143
+ getNotificationMethodIdColumns() {
144
+ return this.getNotificationMethodDescriptors().map((descriptor) => {
145
+ return descriptor.idColumn;
146
+ });
147
+ }
148
+ /*
149
+ * The ownership column's two spellings, derived from the model rather than
150
+ * restated here as literals.
151
+ *
152
+ * `userId` is a declared @Column; `user` is a @ManyToOne whose @JoinColumn
153
+ * names that same physical column. Two decorated members, one join column,
154
+ * and a payload may carry either or both — exactly the situation that made
155
+ * the method FKs bypassable, reproduced on the column that decides whose
156
+ * pages the row selects.
157
+ *
158
+ * The derivation ("relation name is the scalar minus its `Id` suffix") is the
159
+ * one CreatePermission.checkCreateOwnership uses, and it is deliberate that
160
+ * both places derive rather than hard-code: a model that renames its
161
+ * ownership column must not leave a guard silently reading a property that no
162
+ * longer exists.
163
+ */
164
+ getRuleOwnerColumns() {
165
+ const idColumn = new UserNotificationRule().getUserColumn();
166
+ if (!idColumn || !idColumn.endsWith("Id")) {
167
+ /*
168
+ * No user-scoped column, or one that does not follow the convention, so
169
+ * there is no second spelling to reconcile. Genuinely a no-op rather than
170
+ * a guard opening: with no ownership column there is no ownership to
171
+ * disagree about. Same reasoning as CreatePermission's `if (!userColumn)`.
172
+ */
173
+ return null;
174
+ }
175
+ return {
176
+ idColumn: idColumn,
177
+ relationColumn: idColumn.slice(0, -2),
178
+ };
179
+ }
180
+ /**
181
+ * Refuse a payload whose two spellings of the ownership column name two
182
+ * different users.
183
+ *
184
+ * The exact counterpart of assertOneMethodPerNotificationChannel below, on
185
+ * the other half of the pair this file exists to keep in agreement. A payload
186
+ * saying `userId: <victim>, user: { _id: <me> }` is not a client mistake — no
187
+ * dashboard sends both — it is a request for the guard and the ORM to read
188
+ * different owners, which is precisely how a validated write becomes a
189
+ * different persisted row.
190
+ *
191
+ * Refusing rather than silently preferring one spelling means the correctness
192
+ * of this file never rests on our reading of TypeORM's precedence rule. The
193
+ * fold below then removes the surviving redundancy, so nothing downstream —
194
+ * the roster check, the method-ownership check, CreatePermission, the audit
195
+ * line — has a precedence question left to resolve.
196
+ */
197
+ assertOneRuleOwner(carrier) {
198
+ const columns = this.getRuleOwnerColumns();
199
+ if (!columns) {
200
+ return;
201
+ }
202
+ const fromIdColumn = resolveReferenceId(carrier[columns.idColumn]);
203
+ const fromRelation = resolveReferenceId(carrier[columns.relationColumn]);
204
+ if (!fromIdColumn || !fromRelation) {
205
+ return;
206
+ }
207
+ /*
208
+ * Case-insensitively, for the reason ProjectScopedReferenceValidator
209
+ * normalises ids: ObjectID keeps whatever case it was handed while Postgres
210
+ * renders `uuid` lower case, so one id in two cases is still one id and
211
+ * must not read as a contradiction.
212
+ */
213
+ if (fromIdColumn.toString().toLowerCase() ===
214
+ fromRelation.toString().toLowerCase()) {
215
+ return;
216
+ }
217
+ throw new BadDataException(`This notification rule names two different users: ${columns.idColumn} says ${fromIdColumn.toString()} and ${columns.relationColumn} says ${fromRelation.toString()}. Send only one of them.`);
218
+ }
219
+ /**
220
+ * Fold the ownership relation into the ownership scalar so exactly one
221
+ * spelling survives a create.
222
+ *
223
+ * This is the same reduction collapseNotificationMethodRelationsOnCreate
224
+ * performs for the seven method FKs, and the same one
225
+ * CreatePermission.checkCreateOwnership performs for this very column — it
226
+ * validates `user` identically to `userId` and then CLEARS it, because after
227
+ * clearing there is no second source of truth left to disagree with the
228
+ * first. What CreatePermission cannot do is cover the administrator: it
229
+ * returns early for a caller holding a real role permission in the model's
230
+ * create list, which is exactly the caller this phase introduced and exactly
231
+ * the caller who may legitimately name somebody else. On that path the
232
+ * relation reached TypeORM unreduced.
233
+ *
234
+ * The relation's id is what is kept, because that is the value TypeORM would
235
+ * have written: the declared @Column and the relation's @JoinColumn share one
236
+ * ColumnMetadata, and getEntityValue reads the relation slot first, falling
237
+ * back to the scalar only when the relation holds no object. A relation slot
238
+ * that is present but carries no id therefore resolves to nothing, and
239
+ * clearing the scalar alongside it reproduces the NULL the ORM would have
240
+ * written rather than inventing an owner the row will not have.
241
+ *
242
+ * CREATE ONLY, though for a different reason than the method columns: `user`
243
+ * and `userId` are `update: []` for BOTH spellings on this model, so there is
244
+ * no update-path fold to consider at all — an update naming either one is
245
+ * refused outright by ColumnPermission.
246
+ */
247
+ collapseRuleOwnerRelationOnCreate(carrier) {
248
+ const columns = this.getRuleOwnerColumns();
249
+ if (!columns) {
250
+ return;
251
+ }
252
+ const relationValue = carrier[columns.relationColumn];
253
+ if (relationValue === undefined || relationValue === null) {
254
+ // Nothing in this spelling; TypeORM falls through to the scalar already.
255
+ return;
256
+ }
257
+ const resolved = resolveReferenceId(relationValue);
258
+ carrier[columns.idColumn] = resolved
259
+ ? resolved instanceof ObjectID
260
+ ? resolved
261
+ : new ObjectID(resolved)
262
+ : undefined;
263
+ carrier[columns.relationColumn] = undefined;
264
+ }
265
+ /**
266
+ * Pull EVERY notification-method reference out of a create payload or an
267
+ * update patch — every channel, and every spelling of every channel.
268
+ *
269
+ * THE BUG THIS SHAPE EXISTS TO PREVENT. `userWebhookId` and `userWebhook` are
270
+ * two decorated members over ONE physical join column, and a request may
271
+ * carry both. This method used to resolve them as
272
+ * `carrier[idColumn] || carrier[relationColumn]`, which validates the FK
273
+ * column and never looks at the relation when both are present. TypeORM
274
+ * resolves the same conflict the other way round: the declared @Column and
275
+ * the relation's @JoinColumn share a single ColumnMetadata, and
276
+ * ColumnMetadata.getEntityValue reads the RELATION first, falling back to the
277
+ * scalar only when the relation slot holds no object.
278
+ *
279
+ * So the id that was checked and the id that was written were different ids,
280
+ * and the caller chose both. Put the rule owner's own method in the FK column
281
+ * to satisfy the guard, and your own row in the relation slot to be
282
+ * persisted, and R3 — the entire anti-hijack invariant — is a formality.
283
+ *
284
+ * The rule is therefore: never short-circuit. Emit one reference per spelling
285
+ * actually present, so the ownership check below has to answer for all of
286
+ * them, and a payload can no longer be right in the half that is inspected
287
+ * and wrong in the half that is written.
288
+ *
289
+ * Duplicates are folded only when they are the SAME id in the same column,
290
+ * where the second lookup could not produce a different answer. Two spellings
291
+ * naming two DIFFERENT ids stay two references on purpose — that is precisely
292
+ * the case worth an extra query.
293
+ *
294
+ * A rule that names no method at all yields an empty array and the ownership
295
+ * guard becomes a no-op — correct, because an opt-out row genuinely has no
296
+ * address to hijack.
297
+ */
298
+ collectNotificationMethodReferences(carrier) {
299
+ const references = [];
300
+ const seen = new Set();
301
+ for (const descriptor of this.getNotificationMethodDescriptors()) {
302
+ const spellings = [
303
+ descriptor.idColumn,
304
+ descriptor.relationColumn,
305
+ ];
306
+ for (const suppliedColumn of spellings) {
307
+ const resolved = resolveReferenceId(carrier[suppliedColumn]);
308
+ if (!resolved) {
309
+ continue;
310
+ }
311
+ const methodId = resolved instanceof ObjectID ? resolved : new ObjectID(resolved);
312
+ /*
313
+ * Ids are compared case-insensitively for the same reason
314
+ * ProjectScopedReferenceValidator normalises them: ObjectID keeps
315
+ * whatever case it was handed, while Postgres renders `uuid` in lower
316
+ * case, so an uppercase spelling and a lowercase one are one id.
317
+ */
318
+ const key = `${descriptor.idColumn}:${methodId
319
+ .toString()
320
+ .toLowerCase()}`;
321
+ if (seen.has(key)) {
322
+ continue;
323
+ }
324
+ seen.add(key);
325
+ references.push({
326
+ idColumn: descriptor.idColumn,
327
+ suppliedColumn: suppliedColumn,
328
+ label: descriptor.label,
329
+ methodId: methodId,
330
+ });
331
+ }
332
+ }
333
+ return references;
334
+ }
335
+ /**
336
+ * Refuse a payload whose two spellings of one method column name two
337
+ * different methods.
338
+ *
339
+ * Validating both spellings (above) closes the hijack: whichever one the ORM
340
+ * picks, it has been checked against the rule's owner. What it does not do is
341
+ * make the write PREDICTABLE — with both slots filled, which address the rule
342
+ * ends up delivering to is decided by a TypeORM precedence rule that no
343
+ * reader of this codebase should have to know, and that a TypeORM upgrade is
344
+ * free to change.
345
+ *
346
+ * "Both spellings, two different methods" is not something a client does by
347
+ * accident; the dashboard sends one. So there is no legitimate request to
348
+ * preserve here, and refusing is strictly better than guessing: the caller is
349
+ * told exactly what is contradictory, and nothing downstream has a precedence
350
+ * question left to resolve.
351
+ *
352
+ * Deliberately NOT run before the ownership check. A payload that is both
353
+ * ambiguous and a hijack attempt should be reported as the hijack — that is
354
+ * the finding an operator needs to see, and "you sent the same field twice"
355
+ * would bury it.
356
+ */
357
+ assertOneMethodPerNotificationChannel(carrier) {
358
+ for (const descriptor of this.getNotificationMethodDescriptors()) {
359
+ const fromIdColumn = resolveReferenceId(carrier[descriptor.idColumn]);
360
+ const fromRelation = resolveReferenceId(carrier[descriptor.relationColumn]);
361
+ if (!fromIdColumn || !fromRelation) {
362
+ continue;
363
+ }
364
+ if (fromIdColumn.toString().toLowerCase() ===
365
+ fromRelation.toString().toLowerCase()) {
366
+ continue;
367
+ }
368
+ throw new BadDataException(`This notification rule names two different ${descriptor.label} notification methods: ${descriptor.idColumn} says ${fromIdColumn.toString()} and ${descriptor.relationColumn} says ${fromRelation.toString()}. Send only one of them.`);
369
+ }
370
+ }
371
+ /**
372
+ * Fold the relation spelling into the FK column so exactly one spelling
373
+ * survives — the create-path reduction, and the reason the ORM never gets to
374
+ * choose.
375
+ *
376
+ * This mirrors CreatePermission.checkCreateOwnership, which validates the
377
+ * `user` relation identically to the `userId` scalar and then CLEARS it. The
378
+ * point of clearing rather than merely checking is that after it there is no
379
+ * second source of truth left to disagree with the first.
380
+ *
381
+ * The relation's id is what is kept, because that is the value TypeORM would
382
+ * have written: getEntityValue reads the relation slot first. A relation slot
383
+ * that is present but carries no id resolves to nothing, and clearing the FK
384
+ * column alongside it reproduces the NULL the ORM would have written — which
385
+ * matters, because that NULL is what turns a rule into one that pages
386
+ * nowhere, and the create invariants below have to be able to see it.
387
+ *
388
+ * CREATE ONLY. On update the two spellings do not have the same access
389
+ * control: the relation members are `update: []` on UserNotificationRule
390
+ * while the `*Id` members are open to an administrator, so moving a value
391
+ * from the relation slot into the FK column would launder a column write that
392
+ * ColumnPermission (which runs after the update hook) exists to refuse. On
393
+ * that path ambiguity is resolved by refusal instead — see
394
+ * assertOneMethodPerNotificationChannel.
395
+ */
396
+ collapseNotificationMethodRelationsOnCreate(carrier) {
397
+ for (const descriptor of this.getNotificationMethodDescriptors()) {
398
+ const relationValue = carrier[descriptor.relationColumn];
399
+ if (relationValue === undefined || relationValue === null) {
400
+ /*
401
+ * Nothing supplied in this spelling. TypeORM falls through to the
402
+ * scalar in exactly this case, so there is nothing to fold and nothing
403
+ * to clear.
404
+ */
405
+ continue;
406
+ }
407
+ const resolved = resolveReferenceId(relationValue);
408
+ carrier[descriptor.idColumn] = resolved
409
+ ? resolved instanceof ObjectID
410
+ ? resolved
411
+ : new ObjectID(resolved)
412
+ : undefined;
413
+ carrier[descriptor.relationColumn] = undefined;
414
+ }
415
+ }
416
+ /**
417
+ * Does this payload name a delivery address at all, in any channel, in either
418
+ * spelling?
419
+ *
420
+ * Driven off the descriptor table rather than a hand-written list of fourteen
421
+ * property names. A hand-written list is how an eighth channel ends up
422
+ * exempt from the "a rule must be able to reach somebody" invariant, and an
423
+ * exempt channel is a rule that silently pages nobody.
424
+ */
425
+ carriesAnyNotificationMethod(carrier) {
426
+ for (const descriptor of this.getNotificationMethodDescriptors()) {
427
+ if (carrier[descriptor.idColumn] || carrier[descriptor.relationColumn]) {
428
+ return true;
429
+ }
430
+ }
431
+ return false;
432
+ }
433
+ /**
434
+ * Does this patch MENTION a delivery address, whatever it sets it to?
435
+ *
436
+ * Distinct from carriesAnyNotificationMethod, and the difference is the whole
437
+ * point: `userEmailId: null` carries no method but very much mentions one. It
438
+ * is the write that removes a rule's only way of reaching somebody, so it is
439
+ * exactly the patch the coherence check must not skip.
440
+ */
441
+ mentionsAnyNotificationMethodColumn(carrier) {
442
+ for (const descriptor of this.getNotificationMethodDescriptors()) {
443
+ if (carrier[descriptor.idColumn] !== undefined ||
444
+ carrier[descriptor.relationColumn] !== undefined) {
445
+ return true;
446
+ }
447
+ }
448
+ return false;
449
+ }
450
+ /**
451
+ * The row's delivery addresses as they would stand AFTER a patch is applied.
452
+ *
453
+ * The create-time invariants ("a rule that pages must name a method", "an
454
+ * opt-out rule must not") are properties of the ROW, and update can break
455
+ * both of them: flipping `isOptOut` on a rule that carries an email, or
456
+ * nulling the only method on a rule that is still meant to page. Neither is
457
+ * visible from the patch alone, so the persisted row has to be read and the
458
+ * two combined.
459
+ *
460
+ * Precedence between the two spellings is the ORM's, not ours: the relation
461
+ * slot wins when it is present, because that is what would be written. A
462
+ * column the patch does not mention keeps whatever the row already had.
463
+ */
464
+ getNotificationMethodIdsAfterPatch(data) {
465
+ const methodIds = [];
466
+ for (const descriptor of this.getNotificationMethodDescriptors()) {
467
+ let resolved = undefined;
468
+ if (data.patch[descriptor.relationColumn] !== undefined) {
469
+ resolved = resolveReferenceId(data.patch[descriptor.relationColumn]);
470
+ }
471
+ else if (data.patch[descriptor.idColumn] !== undefined) {
472
+ resolved = resolveReferenceId(data.patch[descriptor.idColumn]);
473
+ }
474
+ else {
475
+ resolved = resolveReferenceId(data.currentRow[descriptor.idColumn]);
476
+ }
477
+ if (!resolved) {
478
+ continue;
479
+ }
480
+ methodIds.push(resolved instanceof ObjectID ? resolved : new ObjectID(resolved));
481
+ }
482
+ return methodIds;
483
+ }
484
+ /**
485
+ * R1 — the target of an on-behalf-of write must belong to the project the
486
+ * write is scoped to.
487
+ *
488
+ * The create-path ownership gate (CreatePermission.checkCreateOwnership)
489
+ * deliberately steps aside for a caller who holds a real role permission in
490
+ * the model's create list, so that this feature can exist at all. What it
491
+ * hands over is a caller who may name SOME other user — it says nothing about
492
+ * WHICH other users are in scope, because it has no notion of a project
493
+ * roster. Left there, holding ProjectAdmin on one throwaway project would be
494
+ * a licence to write notification rules for any user id in the installation.
495
+ *
496
+ * Membership is read straight from TeamMember with isRoot props and no cache.
497
+ * TeamMemberService.getTeamIdsForUser would have answered the same question
498
+ * with one fewer query, but it memoises for 60 seconds — and a security
499
+ * decision that keeps saying "yes" for a minute after the user was removed
500
+ * from the project is not a security decision.
501
+ *
502
+ * `hasAcceptedInvitation` is part of the test because it is this codebase's
503
+ * own definition of membership (the Owned permission scope resolves teams the
504
+ * same way), and because a pending invitation is an admin-created row: any
505
+ * admin can create one for any email address, so treating one as membership
506
+ * would hand back most of what this guard just took away. Nothing legitimate
507
+ * is lost — a rule must carry a notification method to be created at all, and
508
+ * a user who has not joined the project has none.
509
+ */
510
+ async assertTargetUserIsProjectMember(data) {
511
+ const projectId = data.props.tenantId;
512
+ if (!projectId) {
513
+ /*
514
+ * A non-root caller writing another user's rule without a tenant scope
515
+ * has nothing to be an admin OF. There is no roster to check them
516
+ * against, so there is no way to say yes.
517
+ */
518
+ throw new BadDataException("A project is required to create a notification rule for another user.");
519
+ }
520
+ const membership = await TeamMemberService.findOneBy({
521
+ query: {
522
+ userId: data.targetUserId,
523
+ projectId: projectId,
524
+ hasAcceptedInvitation: true,
525
+ },
526
+ select: {
527
+ _id: true,
528
+ },
529
+ props: {
530
+ isRoot: true,
531
+ },
532
+ });
533
+ if (!membership) {
534
+ throw new BadDataException(`Cannot create a notification rule for user ${data.targetUserId.toString()} because they are not a member of this project.`);
535
+ }
536
+ }
537
+ /**
538
+ * R3 — the anti-hijack invariant, and the single most important guard in this
539
+ * phase.
540
+ *
541
+ * A rule's method FK is the address its pages are delivered to. Its userId is
542
+ * whose pages select it. If those two can name different people, an admin
543
+ * editing a colleague's rule to point at the ADMIN's own webhook silently
544
+ * redirects that colleague's pages, and every surface either of them can see
545
+ * still reports a healthy configuration.
546
+ *
547
+ * `ownerUserId` MUST be the rule's persisted owner, not a value out of the
548
+ * request body. On update the caller controls the body, so a body-supplied
549
+ * userId lets them claim the row is theirs while writing somebody else's; the
550
+ * callers in UserNotificationRuleService therefore re-read it from the
551
+ * database first, and pass what the database said.
552
+ *
553
+ * A method row that does not exist is rejected rather than ignored. "Not
554
+ * found" and "not yours" are the same answer here — in both cases the caller
555
+ * named a row they have no business naming — and a guard whose failure mode
556
+ * is `undefined === undefined` is a guard that opens on the one input it was
557
+ * written to reject.
558
+ */
559
+ async assertNotificationMethodsBelongToUser(data) {
560
+ if (data.references.length === 0) {
561
+ return;
562
+ }
563
+ if (!data.ownerUserId) {
564
+ /*
565
+ * An unowned rule is not a safe rule. Its userId decides whose pages
566
+ * select it, so a row that names an address but no owner is a row nobody
567
+ * can be shown and nobody can audit. Reject rather than skip the check.
568
+ */
569
+ throw new BadDataException("A notification rule that names a notification method must have an owner.");
570
+ }
571
+ const descriptorsByColumn = new Map();
572
+ for (const descriptor of this.getNotificationMethodDescriptors()) {
573
+ descriptorsByColumn.set(descriptor.idColumn, descriptor);
574
+ }
575
+ for (const reference of data.references) {
576
+ const descriptor = descriptorsByColumn.get(reference.idColumn);
577
+ if (!descriptor) {
578
+ /*
579
+ * Unreachable while references only ever come from
580
+ * collectNotificationMethodReferences, which builds them from this same
581
+ * table. Refusing an unknown column rather than skipping it keeps that
582
+ * true if the two ever drift.
583
+ */
584
+ throw new BadDataException(`Unknown notification method column ${reference.idColumn}.`);
585
+ }
586
+ const methodOwnerUserId = await descriptor.findOwnerUserId(reference.methodId);
587
+ if (!methodOwnerUserId) {
588
+ throw new BadDataException(`The ${descriptor.label} notification method referenced by this rule does not exist.`);
589
+ }
590
+ if (methodOwnerUserId.toString() !== data.ownerUserId.toString()) {
591
+ /*
592
+ * The spelling is named at the end rather than woven into the sentence
593
+ * so that the wording support runbooks and tests match on stays intact.
594
+ * It earns its place because the two spellings are one column: told only
595
+ * "your Email method is wrong", a caller looking at a payload whose
596
+ * `userEmailId` is perfectly correct has no way to see that the relation
597
+ * slot beside it is the problem.
598
+ */
599
+ throw new BadDataException(`The ${descriptor.label} notification method referenced by this rule belongs to a different user. A notification rule can only use notification methods owned by the user the rule belongs to. The offending value was sent in ${reference.suppliedColumn}.`);
600
+ }
601
+ }
602
+ }
603
+ /**
604
+ * R6 — record and announce a change one person made to another person's
605
+ * paging configuration.
606
+ *
607
+ * Both halves are keyed on `props.userId` — the actor the SERVER resolved
608
+ * from the session — versus the row's PERSISTED userId, read back after the
609
+ * write. Nothing here reads the request body: the body is the thing under
610
+ * suspicion, and an audit line that an attacker can author is worse than no
611
+ * audit line, because it looks like evidence.
612
+ *
613
+ * Nothing in here may break the write. The row is already committed by the
614
+ * time this runs; throwing now would report a failure for a change that
615
+ * happened, and the caller would be entitled to believe it did not. So the
616
+ * whole body is a try/catch, and the mail is fire-and-forget on top of that.
617
+ */
618
+ async recordAdminRuleChange(data) {
619
+ var _a, _b;
620
+ try {
621
+ /*
622
+ * The dependable half of the trail. AuditLogService below only writes on
623
+ * enterprise builds with audit logs switched on for the project, which is
624
+ * a minority of installs — and "an admin edited somebody else's paging"
625
+ * is exactly the event an operator needs to be able to find on the other
626
+ * ones too.
627
+ */
628
+ logger.info(`On-call notification rule ${data.action.toLowerCase()}d for user ${data.ownerUserId.toString()} by a different user ${data.actorUserId.toString()}.`, {
629
+ projectId: (_a = data.projectId) === null || _a === void 0 ? void 0 : _a.toString(),
630
+ userId: data.ownerUserId.toString(),
631
+ actorUserId: data.actorUserId.toString(),
632
+ userNotificationRuleId: (_b = data.ruleId) === null || _b === void 0 ? void 0 : _b.toString(),
633
+ action: data.action,
634
+ });
635
+ await this.writeAuditLog(data);
636
+ if (!data.notifyOwner) {
637
+ return;
638
+ }
639
+ /*
640
+ * Fire-and-forget by construction: the owner's mail involves three more
641
+ * reads and an SMTP round trip, none of which the writing request should
642
+ * wait on and none of which may surface as a failed write.
643
+ */
644
+ this.notifyOwnerOfAdminChange({
645
+ action: data.action,
646
+ actorUserId: data.actorUserId,
647
+ ownerUserId: data.ownerUserId,
648
+ projectId: data.projectId,
649
+ }).catch((error) => {
650
+ logger.error(`UserNotificationRuleAdminService: failed to tell user ${data.ownerUserId.toString()} that an admin changed their on-call notification rules.`);
651
+ logger.error(error);
652
+ });
653
+ }
654
+ catch (error) {
655
+ logger.error("UserNotificationRuleAdminService: failed to record an administrative notification rule change.");
656
+ logger.error(error);
657
+ }
658
+ }
659
+ /*
660
+ * The AuditLog analytics row, written directly rather than through
661
+ * DatabaseService's own audit hook.
662
+ *
663
+ * DatabaseService writes one automatically for models decorated with
664
+ * @EnableAuditLog, and UserNotificationRule is not one of them — so without
665
+ * this call an administrative edit leaves no row at all. The decorator is
666
+ * checked anyway so that adding it later produces one entry rather than two:
667
+ * a duplicated audit record is not merely noise, it makes a reader count two
668
+ * changes where one happened.
669
+ *
670
+ * Required lazily for the same reason DatabaseService requires it lazily —
671
+ * AuditLogService depends on ProjectService and UserService, both of which
672
+ * extend DatabaseService, so a top-level import can leave the base class
673
+ * undefined at class-extension time.
674
+ */
675
+ async writeAuditLog(data) {
676
+ const model = new UserNotificationRule();
677
+ if (model.enableAuditLogOn) {
678
+ // DatabaseService already writes this row; a second one would double-count.
679
+ return;
680
+ }
681
+ const auditLogService =
682
+ // eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires
683
+ require("./AuditLogService").default;
684
+ if (data.action === AuditLogAction.Create && data.after) {
685
+ await auditLogService.recordCreate({
686
+ model: model,
687
+ createdItem: data.after,
688
+ props: data.props,
689
+ });
690
+ return;
691
+ }
692
+ if (data.action === AuditLogAction.Update && data.before && data.ruleId) {
693
+ await auditLogService.recordUpdate({
694
+ model: model,
695
+ before: data.before,
696
+ updatedFields: data.updatedFields || {},
697
+ itemId: data.ruleId,
698
+ props: data.props,
699
+ });
700
+ return;
701
+ }
702
+ /*
703
+ * Delete is the one action whose audit entry cannot be reconstructed after
704
+ * the fact. An edited row can still be read; a deleted one cannot, so the
705
+ * snapshot captured before the write is the entire record of what the
706
+ * responder's paging used to be.
707
+ */
708
+ if (data.action === AuditLogAction.Delete && data.before && data.ruleId) {
709
+ await auditLogService.recordDelete({
710
+ model: model,
711
+ deletedItem: data.before,
712
+ itemId: data.ruleId,
713
+ props: data.props,
714
+ });
715
+ }
716
+ }
717
+ /*
718
+ * Tell the person whose pages just changed.
719
+ *
720
+ * This is the part of the phase that makes admin repair safe to hand out
721
+ * rather than merely possible: an admin fixing a colleague's rules is a
722
+ * normal, welcome thing, and an attacker redirecting them is not, and from
723
+ * the server's side those two are the same request. The only reliable way to
724
+ * tell them apart is to ask the one person who always knows which it was.
725
+ */
726
+ async notifyOwnerOfAdminChange(data) {
727
+ var _a, _b;
728
+ const owner = await UserService.findOneById({
729
+ id: data.ownerUserId,
730
+ select: {
731
+ _id: true,
732
+ name: true,
733
+ email: true,
734
+ },
735
+ props: {
736
+ isRoot: true,
737
+ },
738
+ });
739
+ if (!owner || !owner.email) {
740
+ return;
741
+ }
742
+ const actor = await UserService.findOneById({
743
+ id: data.actorUserId,
744
+ select: {
745
+ _id: true,
746
+ name: true,
747
+ email: true,
748
+ },
749
+ props: {
750
+ isRoot: true,
751
+ },
752
+ });
753
+ /*
754
+ * Naming the actor by email as well as by name is deliberate. Display names
755
+ * are not unique and are user-editable, so "Alex changed your rules" is not
756
+ * something the reader can act on; an address is.
757
+ */
758
+ const actorDescription = actor
759
+ ? `${((_a = actor.name) === null || _a === void 0 ? void 0 : _a.toString()) || "A project administrator"} (${((_b = actor.email) === null || _b === void 0 ? void 0 : _b.toString()) || data.actorUserId.toString()})`
760
+ : `A project administrator (${data.actorUserId.toString()})`;
761
+ let projectName = "your project";
762
+ if (data.projectId) {
763
+ const project = await ProjectService.findOneById({
764
+ id: data.projectId,
765
+ select: {
766
+ _id: true,
767
+ name: true,
768
+ },
769
+ props: {
770
+ isRoot: true,
771
+ },
772
+ });
773
+ if (project === null || project === void 0 ? void 0 : project.name) {
774
+ projectName = project.name;
775
+ }
776
+ }
777
+ let verb = "changed";
778
+ if (data.action === AuditLogAction.Create) {
779
+ verb = "added";
780
+ }
781
+ if (data.action === AuditLogAction.Delete) {
782
+ verb = "deleted";
783
+ }
784
+ const subject = `Your on-call notification rules were ${verb} by an administrator`;
785
+ const settingsLink = data.projectId
786
+ ? (await this.getNotificationRulesLinkInDashboard(data.projectId)).toString()
787
+ : "";
788
+ /*
789
+ * Deletion gets its own sentence rather than the generic one. "Somebody
790
+ * changed your rules" is a prompt to go and look; "you may no longer be
791
+ * paged" is the consequence, and it is the only one of the three actions
792
+ * that can leave a responder silently unreachable — which is the failure
793
+ * this whole epic exists to stop happening unnoticed.
794
+ */
795
+ const consequence = data.action === AuditLogAction.Delete
796
+ ? "Your notification rules decide how OneUptime reaches you when you are paged. With them removed you may no longer be notified when you are on call, so add new rules if this was not what you expected, and tell your project owners."
797
+ : "Your notification rules decide how OneUptime reaches you when you are paged. If you were not expecting this change, review your rules now and tell your project owners.";
798
+ const message = `${this.escapeHtml(actorDescription)} ${verb} your on-call notification rules in ${this.escapeHtml(projectName)}.<br/><br/>${consequence}${settingsLink
799
+ ? `<br/><br/><a href="${this.escapeHtml(settingsLink)}">Review your notification rules</a>`
800
+ : ""}`;
801
+ const vars = {
802
+ subject: subject,
803
+ message: message,
804
+ };
805
+ await MailService.sendMail({
806
+ toEmail: owner.email,
807
+ templateType: EmailTemplateType.SimpleMessage,
808
+ vars: vars,
809
+ subject: subject,
810
+ }, {
811
+ projectId: data.projectId,
812
+ userId: owner.id,
813
+ });
814
+ }
815
+ async getNotificationRulesLinkInDashboard(projectId) {
816
+ const dashboardUrl = await DatabaseConfig.getDashboardUrl();
817
+ /*
818
+ * Spelled out rather than imported: Common/Server cannot reach the
819
+ * Dashboard's RouteMap, the same reason
820
+ * OnCallNotificationAlertingService.getNotificationRulesLinkInDashboard
821
+ * duplicates its path segments.
822
+ */
823
+ return URL.fromString(dashboardUrl.toString()).addRoute(`/${projectId.toString()}/user-settings/notification-methods`);
824
+ }
825
+ /*
826
+ * SimpleMessage.hbs renders `message` through a triple-stache InfoBlock
827
+ * partial, so nothing between here and the recipient's inbox escapes
828
+ * anything. Project names and user names are attacker-influenced free text.
829
+ */
830
+ escapeHtml(value) {
831
+ return value
832
+ .replace(/&/g, "&amp;")
833
+ .replace(/</g, "&lt;")
834
+ .replace(/>/g, "&gt;")
835
+ .replace(/"/g, "&quot;")
836
+ .replace(/'/g, "&#39;");
837
+ }
838
+ }
839
+ __decorate([
840
+ CaptureSpan(),
841
+ __metadata("design:type", Function),
842
+ __metadata("design:paramtypes", [Object]),
843
+ __metadata("design:returntype", Promise)
844
+ ], UserNotificationRuleAdminService.prototype, "assertTargetUserIsProjectMember", null);
845
+ __decorate([
846
+ CaptureSpan(),
847
+ __metadata("design:type", Function),
848
+ __metadata("design:paramtypes", [Object]),
849
+ __metadata("design:returntype", Promise)
850
+ ], UserNotificationRuleAdminService.prototype, "assertNotificationMethodsBelongToUser", null);
851
+ __decorate([
852
+ CaptureSpan(),
853
+ __metadata("design:type", Function),
854
+ __metadata("design:paramtypes", [Object]),
855
+ __metadata("design:returntype", Promise)
856
+ ], UserNotificationRuleAdminService.prototype, "recordAdminRuleChange", null);
857
+ export default new UserNotificationRuleAdminService();
858
+ //# sourceMappingURL=UserNotificationRuleAdminService.js.map