@oneuptime/common 12.0.8 → 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.
- package/Models/AnalyticsModels/MetricItemAggMV1mByK8sCluster.ts +1 -1
- package/Models/AnalyticsModels/MetricItemAggMV1mByService.ts +1 -1
- package/Models/DatabaseModels/AIConversation.ts +32 -0
- package/Models/DatabaseModels/AIConversationMessage.ts +41 -0
- package/Models/DatabaseModels/AlertEpisodeMember.ts +27 -0
- package/Models/DatabaseModels/IncidentEpisodeMember.ts +28 -0
- package/Models/DatabaseModels/Index.ts +12 -4
- package/Models/DatabaseModels/{TelemetryEntity.ts → InventoryItem.ts} +139 -9
- package/Models/DatabaseModels/InventoryItemCustomField.ts +434 -0
- package/Models/DatabaseModels/{TelemetryEntityRelationship.ts → InventoryItemRelationship.ts} +8 -8
- package/Models/DatabaseModels/NetworkDevice.ts +141 -0
- package/Models/DatabaseModels/NetworkDeviceLink.ts +699 -0
- package/Models/DatabaseModels/NetworkDeviceLinkRule.ts +467 -0
- package/Models/DatabaseModels/NetworkTopologySuppression.ts +429 -0
- package/Models/DatabaseModels/OnCallDutyPolicyFeed.ts +9 -0
- package/Models/DatabaseModels/Project.ts +78 -0
- package/Models/DatabaseModels/UserCall.ts +42 -0
- package/Models/DatabaseModels/UserEmail.ts +44 -0
- package/Models/DatabaseModels/UserNotificationRule.ts +425 -55
- package/Models/DatabaseModels/UserOnCallLogTimeline.ts +24 -2
- package/Models/DatabaseModels/UserPush.ts +49 -0
- package/Models/DatabaseModels/UserSMS.ts +43 -0
- package/Models/DatabaseModels/UserTelegram.ts +59 -0
- package/Models/DatabaseModels/UserWebhook.ts +52 -0
- package/Models/DatabaseModels/UserWhatsApp.ts +41 -0
- package/Models/DatabaseModels/WorkflowVariable.ts +12 -0
- package/Server/API/AIChatAPI.ts +315 -1
- package/Server/API/DashboardAPI.ts +217 -1
- package/Server/API/OnCallReadinessAPI.ts +841 -0
- package/Server/API/TeamComplianceAPI.ts +69 -17
- package/Server/API/TelemetryAPI.ts +220 -12
- package/Server/EnvironmentConfig.ts +52 -0
- package/Server/Infrastructure/Postgres/DataSourceOptions.ts +22 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1786100000000-RestoreServiceLowerNameIndex.ts +4 -4
- package/Server/Infrastructure/Postgres/SchemaMigrations/1786200000000-RestoreDroppedUniqueIndexes.ts +5 -5
- package/Server/Infrastructure/Postgres/SchemaMigrations/1786625176831-AddMonitoringMethodToNetworkDevice.ts +35 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1786634985763-AddNetworkDeviceLink.ts +82 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1786639512056-AddNetworkDeviceLinkRule.ts +91 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1786639972982-AddNetworkTopologySuppression.ts +47 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1786800000000-RenameTelemetryEntityToInventoryItem.ts +255 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1786900000000-AddInventoryItemArchiveAndCustomFields.ts +107 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1787000000000-AddOnCallNotificationFallbackColumns.ts +90 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1787100000000-AddAIConversationPageContext.ts +39 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1787200000000-AddAIChatMessageFeedback.ts +33 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1787300000000-AddEpisodeMemberNotifyIndexes.ts +59 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts +20 -0
- package/Server/Infrastructure/Queue.ts +78 -13
- package/Server/Middleware/PublicDashboardRateLimit.ts +593 -0
- package/Server/Services/AIService.ts +7 -0
- package/Server/Services/AlertEpisodeStateTimelineService.ts +29 -0
- package/Server/Services/AlertSeverityService.ts +63 -0
- package/Server/Services/DashboardService.ts +9 -10
- package/Server/Services/DatabaseService.ts +32 -2
- package/Server/Services/IncidentEpisodeStateTimelineService.ts +29 -0
- package/Server/Services/IncidentSeverityService.ts +76 -0
- package/Server/Services/Index.ts +12 -4
- package/Server/Services/InventoryItemCustomFieldService.ts +9 -0
- package/Server/Services/{TelemetryEntityRelationshipService.ts → InventoryItemRelationshipService.ts} +4 -4
- package/Server/Services/{TelemetryEntityService.ts → InventoryItemService.ts} +89 -20
- package/Server/Services/LogAggregationService.ts +45 -8
- package/Server/Services/MetricAggregationService.ts +121 -0
- package/Server/Services/MetricService.ts +7 -7
- package/Server/Services/NetworkDeviceLinkRuleService.ts +10 -0
- package/Server/Services/NetworkDeviceLinkService.ts +84 -0
- package/Server/Services/NetworkDeviceService.ts +140 -0
- package/Server/Services/NetworkSiteService.ts +77 -25
- package/Server/Services/NetworkTopologySuppressionService.ts +84 -0
- package/Server/Services/OnCallDutyPolicyEscalationRuleScheduleService.ts +41 -29
- package/Server/Services/OnCallDutyPolicyExecutionLogService.ts +8 -0
- package/Server/Services/OnCallDutyPolicyExecutionLogTimelineService.ts +62 -13
- package/Server/Services/OnCallDutyPolicyScheduleService.ts +61 -1
- package/Server/Services/OnCallNotificationAlertingService.ts +742 -0
- package/Server/Services/OnCallReadinessService.ts +2803 -0
- package/Server/Services/OnCallSetupReminderService.ts +955 -0
- package/Server/Services/ProfileAggregationService.ts +123 -0
- package/Server/Services/StatusPageService.ts +9 -10
- package/Server/Services/TeamComplianceService.ts +429 -252
- package/Server/Services/UserCallService.ts +26 -1
- package/Server/Services/UserEmailService.ts +26 -1
- package/Server/Services/UserNotificationRuleAdminService.ts +1183 -0
- package/Server/Services/UserNotificationRuleService.ts +3812 -333
- package/Server/Services/UserOnCallLogService.ts +561 -48
- package/Server/Services/UserPushService.ts +29 -0
- package/Server/Services/UserService.ts +11 -0
- package/Server/Services/UserSmsService.ts +26 -1
- package/Server/Services/UserTelegramService.ts +24 -1
- package/Server/Services/UserWebhookService.ts +28 -1
- package/Server/Services/UserWhatsAppService.ts +24 -1
- package/Server/Types/Database/Permissions/BasePermission.ts +19 -0
- package/Server/Types/Database/Permissions/CreatePermission.ts +164 -0
- package/Server/Types/Database/Permissions/OwnerOnlyColumnPermission.ts +340 -0
- package/Server/Types/Database/Permissions/QueryPermission.ts +48 -0
- package/Server/Types/Database/Permissions/TenantPermission.ts +8 -1
- package/Server/Types/Workflow/Components/API/Delete.ts +1 -1
- package/Server/Types/Workflow/Components/API/Get.ts +1 -1
- package/Server/Types/Workflow/Components/API/Patch.ts +1 -1
- package/Server/Types/Workflow/Components/API/Post.ts +1 -1
- package/Server/Types/Workflow/Components/API/Put.ts +1 -1
- package/Server/Types/Workflow/Components/BaseModel/CreateManyBaseModel.ts +29 -5
- package/Server/Types/Workflow/Components/BaseModel/CreateOneBaseModel.ts +18 -10
- package/Server/Types/Workflow/Components/BaseModel/ModelArguments.ts +55 -0
- package/Server/Types/Workflow/Components/Conditions/IfElse.ts +3 -17
- package/Server/Types/Workflow/Components/Email.ts +25 -7
- package/Server/Types/Workflow/Components/JavaScript.ts +10 -3
- package/Server/Types/Workflow/Components/MicrosoftTeams/SendMessageToChannel.ts +1 -1
- package/Server/Utils/AI/Chat/ChatAgentRunner.ts +643 -48
- package/Server/Utils/AI/Chat/ObservabilityAssistant.ts +32 -3
- package/Server/Utils/AI/Chat/ObservabilityChatPrompt.ts +20 -6
- package/Server/Utils/AI/SRE/AIInvestigationEngine.ts +7 -0
- package/Server/Utils/AI/Toolbox/AIActionTools.ts +2 -2
- package/Server/Utils/AI/Toolbox/AIMetaTools.ts +863 -0
- package/Server/Utils/AI/Toolbox/AlertTools.ts +177 -15
- package/Server/Utils/AI/Toolbox/IncidentTools.ts +191 -10
- package/Server/Utils/AI/Toolbox/Index.ts +48 -0
- package/Server/Utils/AI/Toolbox/MonitorTools.ts +298 -11
- package/Server/Utils/AI/Toolbox/NoteWriteTools.ts +295 -0
- package/Server/Utils/AI/Toolbox/OnCallTools.ts +1246 -0
- package/Server/Utils/AI/Toolbox/RunbookTools.ts +424 -0
- package/Server/Utils/AI/Toolbox/SloTools.ts +456 -0
- package/Server/Utils/AI/Toolbox/StatusPageTools.ts +559 -0
- package/Server/Utils/AI/Toolbox/TeamTools.ts +327 -0
- package/Server/Utils/AI/Toolbox/TimelineTools.ts +615 -0
- package/Server/Utils/AI/Toolbox/WorkflowProbeTools.ts +664 -0
- package/Server/Utils/ClientIp.ts +221 -0
- package/Server/Utils/Dashboard/PublicDashboardResourceListPolicy.ts +47 -0
- package/Server/Utils/Dashboard/PublicDashboardSloHistoryPolicy.ts +163 -0
- package/Server/Utils/Dashboard/PublicDashboardSloWidget.ts +147 -0
- package/Server/Utils/Express.ts +12 -17
- package/Server/Utils/LLM/LLMService.ts +85 -8
- package/Server/Utils/Monitor/MonitorCriteriaEvaluator.ts +204 -10
- package/Server/Utils/SSRFProtection.ts +98 -23
- package/Server/Utils/StartServer.ts +12 -3
- package/Server/Utils/Telemetry/EntityRegistry.ts +205 -18
- package/Server/Utils/Telemetry/InventoryEntityRegistry.ts +25 -25
- package/Server/Utils/Telemetry/TelemetryEntity.ts +160 -52
- package/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeams.ts +7 -3
- package/Tests/App/Dashboard/AdminNotificationRulesPage.test.tsx +2146 -0
- package/Tests/App/Dashboard/CreateWorkflowModal.test.tsx +561 -0
- package/Tests/App/Dashboard/EscalationRuleReadiness.test.tsx +2470 -0
- package/Tests/App/Dashboard/OnCallPreventionGuards.test.tsx +1897 -0
- package/Tests/App/Dashboard/OnCallReadinessSurfaces.test.tsx +3606 -0
- package/Tests/App/Dashboard/OnCallRulesDeleteGuard.test.tsx +784 -0
- package/Tests/App/Dashboard/OnCallRulesTable.test.tsx +1119 -0
- package/Tests/App/Dashboard/SloWidgetFetching.test.tsx +531 -0
- package/Tests/App/Dashboard/UserSettingsSetupChecklistModel.test.ts +1312 -0
- package/Tests/App/Dashboard/UserSettingsSetupChecklistPage.test.tsx +1390 -0
- package/Tests/Models/InventoryItemModel.test.ts +174 -0
- package/Tests/Models/InventoryItemNaming.test.ts +302 -0
- package/Tests/Server/API/AIChatCancelAndFeedback.test.ts +437 -0
- package/Tests/Server/API/DashboardPublicRateLimit.test.ts +659 -0
- package/Tests/Server/API/DashboardPublicResourceListAPI.test.ts +18 -0
- package/Tests/Server/API/DashboardPublicSloAPI.test.ts +880 -0
- package/Tests/Server/API/Helpers.ts +24 -15
- package/Tests/Server/API/OnCallReadinessAPI.test.ts +2680 -0
- package/Tests/Server/API/OnCallSetupReminderAPI.test.ts +915 -0
- package/Tests/Server/Infrastructure/Postgres/EpisodeMemberNotifyIndexesMigration.test.ts +533 -0
- package/Tests/Server/Infrastructure/Postgres/InventoryItemArchiveMigration.test.ts +213 -0
- package/Tests/Server/Infrastructure/Postgres/RenameInventoryItemMigration.test.ts +432 -0
- package/Tests/Server/Infrastructure/Queue.test.ts +293 -0
- package/Tests/Server/Middleware/PublicDashboardRateLimit.test.ts +1645 -0
- package/Tests/Server/Services/AdminRuleEditGuards.test.ts +2848 -0
- package/Tests/Server/Services/DeliverNotificationForRuleExtraction.test.ts +1393 -0
- package/Tests/Server/Services/EpisodeRuleSeverityRepair.test.ts +1802 -0
- package/Tests/Server/Services/EpisodeStateTimelineNote.test.ts +304 -0
- package/Tests/Server/Services/InventoryItemDisplayName.test.ts +339 -0
- package/Tests/Server/Services/{TelemetryEntityManualCreate.test.ts → InventoryItemManualCreate.test.ts} +27 -27
- package/Tests/Server/Services/IpAllowlistSpoofing.test.ts +450 -0
- package/Tests/Server/Services/LogAggregationService.test.ts +235 -1
- package/Tests/Server/Services/MetricAggregationService.test.ts +231 -0
- package/Tests/Server/Services/MetricEntityMVKeyParity.test.ts +80 -29
- package/Tests/Server/Services/MetricServiceAggregate.test.ts +30 -30
- package/Tests/Server/Services/NetworkSiteService.test.ts +18 -3
- package/Tests/Server/Services/NotificationChannelEventCoverage.test.ts +1728 -0
- package/Tests/Server/Services/NotificationDeletionImpact.test.ts +2402 -0
- package/Tests/Server/Services/OnCallDutyPolicyExecutionLogTimelineGapFeed.test.ts +394 -0
- package/Tests/Server/Services/OnCallNotificationFallback.test.ts +1744 -0
- package/Tests/Server/Services/OnCallReadinessService.test.ts +4295 -0
- package/Tests/Server/Services/OnCallSetupReminder.test.ts +1272 -0
- package/Tests/Server/Services/OnCallWeeklyReadinessDigest.test.ts +1021 -0
- package/Tests/Server/Services/ProfileAggregationService.test.ts +296 -0
- package/Tests/Server/Services/SeverityCreationRuleBackfill.test.ts +1536 -0
- package/Tests/Server/Services/SeverityRuleBackfill.test.ts +1818 -0
- package/Tests/Server/Services/TeamComplianceServiceBehaviour.test.ts +1845 -0
- package/Tests/Server/Services/UserNotificationRuleAdminGuards.test.ts +1394 -0
- package/Tests/Server/Services/UserNotificationRuleDefaultCreation.test.ts +1166 -0
- package/Tests/Server/Services/UserNotificationRuleExecuteItem.test.ts +1468 -0
- package/Tests/Server/Services/UserOnCallLogNoNotificationRules.test.ts +1457 -0
- package/Tests/Server/Types/Database/Permissions/AdminNotificationRuleAccess.test.ts +1546 -0
- package/Tests/Server/Types/Database/Permissions/CreateOwnershipScoping.test.ts +529 -0
- package/Tests/Server/Types/Database/Permissions/OwnerOnlyColumns.test.ts +1219 -0
- package/Tests/Server/Types/Database/Permissions/UserNotificationRuleScoping.test.ts +1089 -0
- package/Tests/Server/Types/Workflow/Components/ApiComponentErrorPort.test.ts +2 -1
- package/Tests/Server/Types/Workflow/Components/BaseModelDatabaseComponents.test.ts +190 -0
- package/Tests/Server/Types/Workflow/Components/ChatWebhookComponents.test.ts +44 -14
- package/Tests/Server/Types/Workflow/Components/Email.test.ts +151 -0
- package/Tests/Server/Types/Workflow/Components/IfElse.test.ts +98 -0
- package/Tests/Server/Types/Workflow/Components/JavaScript.test.ts +51 -0
- package/Tests/Server/Utils/AI/AIMetaTools.test.ts +586 -0
- package/Tests/Server/Utils/AI/AlertMonitorFilters.test.ts +582 -0
- package/Tests/Server/Utils/AI/ChatAgentRunner.test.ts +726 -0
- package/Tests/Server/Utils/AI/IncidentToolsFilters.test.ts +315 -0
- package/Tests/Server/Utils/AI/LLMServiceStopReason.test.ts +314 -0
- package/Tests/Server/Utils/AI/LLMServiceToolCalling.test.ts +26 -3
- package/Tests/Server/Utils/AI/NoteWriteTools.test.ts +268 -0
- package/Tests/Server/Utils/AI/ObservabilityChatPrompt.test.ts +169 -0
- package/Tests/Server/Utils/AI/OnCallTools.test.ts +664 -0
- package/Tests/Server/Utils/AI/RunbookTools.test.ts +325 -0
- package/Tests/Server/Utils/AI/SloTools.test.ts +306 -0
- package/Tests/Server/Utils/AI/StatusPageTools.test.ts +391 -0
- package/Tests/Server/Utils/AI/TeamTools.test.ts +257 -0
- package/Tests/Server/Utils/AI/TimelineTools.test.ts +472 -0
- package/Tests/Server/Utils/AI/WorkflowProbeTools.test.ts +428 -0
- package/Tests/Server/Utils/ClientIp.test.ts +438 -0
- package/Tests/Server/Utils/Dashboard/PublicDashboardResourceListPolicy.test.ts +171 -0
- package/Tests/Server/Utils/Dashboard/PublicDashboardSloHistoryPolicy.test.ts +383 -0
- package/Tests/Server/Utils/EntityRegistryRowFence.test.ts +23 -25
- package/Tests/Server/Utils/MicrosoftTeamsWebhookUrlValidation.test.ts +6 -0
- package/Tests/Server/Utils/Monitor/Criteria/DnssecMonitorCriteria.test.ts +307 -0
- package/Tests/Server/Utils/Monitor/Criteria/SSLMonitorCriteria.test.ts +468 -0
- package/Tests/Server/Utils/Monitor/MonitorCriteriaEvaluatorTelemetryDeepLinks.test.ts +460 -0
- package/Tests/Server/Utils/ResponseRateLimitStatusCodes.test.ts +137 -0
- package/Tests/Server/Utils/SSRFProtectionBypasses.test.ts +40 -8
- package/Tests/Server/Utils/SSRFProtectionUserInfo.test.ts +351 -0
- package/Tests/Server/Utils/Telemetry/EntityRegistryRetirement.test.ts +531 -0
- package/Tests/Server/Utils/Telemetry/InventoryEntityRegistry.test.ts +15 -15
- package/Tests/Server/Utils/Telemetry/TelemetryEntity.test.ts +356 -39
- package/Tests/Types/IP/IP.test.ts +263 -0
- package/Tests/Types/IP/IPWhitelist.test.ts +197 -0
- package/Tests/Types/IP/IPv6.test.ts +12 -1
- package/Tests/Types/Monitor/SnmpOid.test.ts +64 -0
- package/Tests/Types/NetworkDevice/NetworkDeviceMonitoringMethod.test.ts +110 -0
- package/Tests/Types/OnCallDutyPolicy/LayerUtilMergeAudit.test.ts +106 -0
- package/Tests/Types/OnCallDutyPolicy/LayerUtilMergeDifferential.test.ts +511 -0
- package/Tests/Types/OnCallDutyPolicy/ScheduleCoverageEndToEnd.test.ts +489 -0
- package/Tests/Types/OnCallDutyPolicy/ScheduleCoverageGapTolerance.test.ts +479 -0
- package/Tests/Types/OnCallDutyPolicy/ScheduleCoverageState.test.ts +822 -0
- package/Tests/Types/Telemetry/EntityTypeGroups.test.ts +6 -6
- package/Tests/Types/Workflow/BaseModelComponents.test.ts +429 -0
- package/Tests/Types/Workflow/Components/BaseModel.test.ts +225 -0
- package/Tests/Types/Workflow/IntegrationCredentialMetadata.test.ts +100 -0
- package/Tests/Types/Workflow/TemplateSyntax.test.ts +112 -0
- package/Tests/Types/Workflow/Templates.test.ts +916 -101
- package/Tests/UI/Components/ActiveFilterChipsOpenRoute.test.tsx +82 -0
- package/Tests/UI/Components/ComponentsModal.test.tsx +564 -7
- package/Tests/UI/Components/KeyboardShortcut.test.tsx +95 -0
- package/Tests/UI/Components/LogDetailsPanelCrossSignal.test.tsx +448 -0
- package/Tests/UI/Components/LogsTableCrossLinks.test.tsx +263 -0
- package/Tests/UI/Components/PendingProjectInvitations.test.tsx +913 -0
- package/Tests/UI/Components/SimpleLogViewer.test.tsx +228 -0
- package/Tests/UI/Components/TableRowSelectability.test.tsx +312 -0
- package/Tests/UI/Components/Workflow/GraphLint.test.ts +72 -0
- package/Tests/UI/Components/Workflow/GraphLintSummary.test.ts +755 -0
- package/Tests/UI/Components/Workflow/ModelColumnEditor.test.ts +242 -7
- package/Tests/UI/Components/Workflow/ModelColumnEditorServerContract.test.ts +15 -7
- package/Tests/UI/Components/Workflow/ModelSchema.test.ts +242 -28
- package/Tests/UI/Components/Workflow/RunStatusWatcher.test.ts +59 -1
- package/Tests/UI/Components/Workflow/StepTraceViewer.test.tsx +256 -0
- package/Tests/UI/Components/Workflow/UseRunWatch.test.tsx +665 -0
- package/Tests/UI/Components/Workflow/WorkflowIssuesModal.test.tsx +485 -0
- package/Tests/UI/Components/Workflow/WorkflowLogModal.test.tsx +478 -0
- package/Tests/UI/Components/Workflow/WorkflowStatusBar.test.tsx +379 -0
- package/Tests/UI/EsbuildConfig.test.ts +607 -0
- package/Tests/UI/Utils/Breadcrumb/fixtures/RealBreadcrumbTrails.ts +5 -0
- package/Tests/UI/Utils/Breadcrumb/fixtures/RealRoutePatterns.ts +11 -4
- package/Tests/UI/Utils/ModelAPICreateMiscData.test.ts +94 -0
- package/Tests/UI/Utils/Platform.test.ts +147 -0
- package/Tests/UI/Utils/ProjectInvitationDisplay.test.ts +357 -0
- package/Tests/Utils/Monitor/NetworkDeviceLinkRuleUtil.test.ts +198 -0
- package/Tests/Utils/Monitor/NetworkTopologyUtil.test.ts +487 -0
- package/Tests/Utils/Telemetry/CrossSignalScope.test.ts +698 -0
- package/Tests/__mocks__/bullmq.js +55 -0
- package/Types/AI/AIChatMessageStatus.ts +8 -1
- package/Types/AI/AIChatTypes.ts +12 -0
- package/Types/Database/AccessControl/OwnerOnlyColumn.ts +88 -0
- package/Types/Exception/ExceptionCode.ts +2 -0
- package/Types/Exception/ServiceUnavailableException.ts +8 -0
- package/Types/Exception/TooManyRequestsException.ts +8 -0
- package/Types/IP/IP.ts +93 -47
- package/Types/Monitor/SnmpMonitor/NetworkTopology.ts +49 -3
- package/Types/NetworkDevice/NetworkDeviceMonitoringMethod.ts +55 -0
- package/Types/OnCallDutyPolicy/Layer.ts +203 -149
- package/Types/OnCallDutyPolicy/OnCallDutyPolicyStatus.ts +13 -0
- package/Types/OnCallDutyPolicy/ScheduleShiftUtil.ts +155 -10
- package/Types/Permission.ts +193 -0
- package/Types/Telemetry/EntityRelationshipType.ts +1 -1
- package/Types/Telemetry/EntitySource.ts +1 -1
- package/Types/Telemetry/EntityType.ts +1 -1
- package/Types/Telemetry/EntityTypeGroups.ts +1 -1
- package/Types/Workflow/Components/BaseModel.ts +75 -29
- package/Types/Workflow/Components/Discord.ts +1 -0
- package/Types/Workflow/Components/Email.ts +12 -3
- package/Types/Workflow/Components/JavaScript.ts +7 -0
- package/Types/Workflow/Components/MicrosoftTeams.ts +3 -2
- package/Types/Workflow/Components/Slack.ts +1 -0
- package/Types/Workflow/Components/Telegram.ts +1 -0
- package/Types/Workflow/TemplateSyntax.ts +44 -0
- package/Types/Workflow/Templates.ts +2097 -45
- package/UI/Components/Calendar/Calendar.css +43 -0
- package/UI/Components/Calendar/Calendar.tsx +8 -0
- package/UI/Components/Card/Card.tsx +2 -2
- package/UI/Components/Checkbox/Checkbox.tsx +16 -0
- package/UI/Components/Dictionary/Dictionary.tsx +48 -9
- package/UI/Components/FormModal/BasicFormModal.tsx +2 -1
- package/UI/Components/Header/HeaderIconDropdownButton.tsx +53 -3
- package/UI/Components/Input/Input.tsx +1 -0
- package/UI/Components/KeyboardShortcut/KeyboardKey.ts +185 -0
- package/UI/Components/KeyboardShortcut/KeyboardShortcut.tsx +87 -0
- package/UI/Components/LogsViewer/LogsViewer.tsx +28 -0
- package/UI/Components/LogsViewer/components/ActiveFilterChips.tsx +31 -0
- package/UI/Components/LogsViewer/components/KeyboardShortcutsHelp.tsx +18 -18
- package/UI/Components/LogsViewer/components/LogDetailsPanel.tsx +363 -14
- package/UI/Components/LogsViewer/components/LogsAnalyticsView.tsx +11 -0
- package/UI/Components/LogsViewer/components/LogsTable.tsx +155 -12
- package/UI/Components/LogsViewer/components/LogsViewerToolbar.tsx +29 -0
- package/UI/Components/LogsViewer/types.ts +23 -0
- package/UI/Components/Markdown.tsx/MarkdownEditor.tsx +9 -2
- package/UI/Components/Navbar/NavBarMenuModal.tsx +15 -30
- package/UI/Components/ProjectInvitations/PendingProjectInvitations.tsx +442 -0
- package/UI/Components/SimpleLogViewer/SimpleLogViewer.tsx +23 -1
- package/UI/Components/Table/Table.tsx +49 -16
- package/UI/Components/Table/TableBody.tsx +53 -28
- package/UI/Components/Table/TableHeader.tsx +13 -0
- package/UI/Components/Table/TableRow.tsx +58 -26
- package/UI/Components/Workflow/ArgumentsForm.tsx +155 -9
- package/UI/Components/Workflow/ComponentReturnValueViewer.tsx +26 -0
- package/UI/Components/Workflow/ComponentSettingsModal.tsx +10 -1
- package/UI/Components/Workflow/ComponentValuePickerModal.tsx +135 -7
- package/UI/Components/Workflow/ComponentsModal.tsx +116 -22
- package/UI/Components/Workflow/DocumentationViewer.tsx +59 -9
- package/UI/Components/Workflow/GraphLint.ts +42 -5
- package/UI/Components/Workflow/GraphLintSummary.ts +390 -0
- package/UI/Components/Workflow/ModelColumnEditor.tsx +154 -22
- package/UI/Components/Workflow/ModelSchema.ts +115 -33
- package/UI/Components/Workflow/RunStatusWatcher.ts +1 -1
- package/UI/Components/Workflow/StepTraceViewer.tsx +1 -1
- package/UI/Components/Workflow/UseRunWatch.ts +212 -0
- package/UI/Components/Workflow/VariableModal.tsx +6 -2
- package/UI/Components/Workflow/Workflow.tsx +49 -3
- package/UI/Components/Workflow/WorkflowIssuesModal.tsx +255 -0
- package/UI/Components/Workflow/WorkflowLogModal.tsx +128 -0
- package/UI/Components/Workflow/WorkflowStatusBar.tsx +224 -0
- package/UI/Utils/AIChatExport/ConversationMarkdown.ts +10 -0
- package/UI/Utils/ModelAPI/ModelAPI.ts +7 -1
- package/UI/Utils/Platform.ts +149 -0
- package/UI/Utils/ProjectInvitationDisplay.ts +118 -0
- package/UI/esbuild-config.js +22 -1
- package/Utils/Monitor/NetworkDeviceLinkRuleUtil.ts +187 -0
- package/Utils/Monitor/NetworkTopologyUtil.ts +888 -164
- package/Utils/Telemetry/CrossSignalScope.ts +502 -0
- package/Utils/Telemetry/EntityKey.ts +5 -5
- package/Utils/Telemetry/EntityRelationship.ts +1 -1
- package/build/dist/Models/AnalyticsModels/MetricItemAggMV1mByK8sCluster.js +1 -1
- package/build/dist/Models/AnalyticsModels/MetricItemAggMV1mByService.js +1 -1
- package/build/dist/Models/DatabaseModels/AIConversation.js +32 -0
- package/build/dist/Models/DatabaseModels/AIConversation.js.map +1 -1
- package/build/dist/Models/DatabaseModels/AIConversationMessage.js +42 -0
- package/build/dist/Models/DatabaseModels/AIConversationMessage.js.map +1 -1
- package/build/dist/Models/DatabaseModels/AlertEpisodeMember.js +28 -0
- package/build/dist/Models/DatabaseModels/AlertEpisodeMember.js.map +1 -1
- package/build/dist/Models/DatabaseModels/IncidentEpisodeMember.js +29 -0
- package/build/dist/Models/DatabaseModels/IncidentEpisodeMember.js.map +1 -1
- package/build/dist/Models/DatabaseModels/Index.js +12 -4
- package/build/dist/Models/DatabaseModels/Index.js.map +1 -1
- package/build/dist/Models/DatabaseModels/{TelemetryEntity.js → InventoryItem.js} +167 -31
- package/build/dist/Models/DatabaseModels/InventoryItem.js.map +1 -0
- package/build/dist/Models/DatabaseModels/InventoryItemCustomField.js +454 -0
- package/build/dist/Models/DatabaseModels/InventoryItemCustomField.js.map +1 -0
- package/build/dist/Models/DatabaseModels/{TelemetryEntityRelationship.js → InventoryItemRelationship.js} +27 -27
- package/build/dist/Models/DatabaseModels/InventoryItemRelationship.js.map +1 -0
- package/build/dist/Models/DatabaseModels/NetworkDevice.js +141 -0
- package/build/dist/Models/DatabaseModels/NetworkDevice.js.map +1 -1
- package/build/dist/Models/DatabaseModels/NetworkDeviceLink.js +719 -0
- package/build/dist/Models/DatabaseModels/NetworkDeviceLink.js.map +1 -0
- package/build/dist/Models/DatabaseModels/NetworkDeviceLinkRule.js +475 -0
- package/build/dist/Models/DatabaseModels/NetworkDeviceLinkRule.js.map +1 -0
- package/build/dist/Models/DatabaseModels/NetworkTopologySuppression.js +446 -0
- package/build/dist/Models/DatabaseModels/NetworkTopologySuppression.js.map +1 -0
- package/build/dist/Models/DatabaseModels/OnCallDutyPolicyFeed.js +9 -0
- package/build/dist/Models/DatabaseModels/OnCallDutyPolicyFeed.js.map +1 -1
- package/build/dist/Models/DatabaseModels/Project.js +80 -0
- package/build/dist/Models/DatabaseModels/Project.js.map +1 -1
- package/build/dist/Models/DatabaseModels/UserCall.js +46 -2
- package/build/dist/Models/DatabaseModels/UserCall.js.map +1 -1
- package/build/dist/Models/DatabaseModels/UserEmail.js +48 -2
- package/build/dist/Models/DatabaseModels/UserEmail.js.map +1 -1
- package/build/dist/Models/DatabaseModels/UserNotificationRule.js +424 -55
- package/build/dist/Models/DatabaseModels/UserNotificationRule.js.map +1 -1
- package/build/dist/Models/DatabaseModels/UserOnCallLogTimeline.js +24 -2
- package/build/dist/Models/DatabaseModels/UserOnCallLogTimeline.js.map +1 -1
- package/build/dist/Models/DatabaseModels/UserPush.js +51 -1
- package/build/dist/Models/DatabaseModels/UserPush.js.map +1 -1
- package/build/dist/Models/DatabaseModels/UserSMS.js +47 -2
- package/build/dist/Models/DatabaseModels/UserSMS.js.map +1 -1
- package/build/dist/Models/DatabaseModels/UserTelegram.js +65 -3
- package/build/dist/Models/DatabaseModels/UserTelegram.js.map +1 -1
- package/build/dist/Models/DatabaseModels/UserWebhook.js +56 -2
- package/build/dist/Models/DatabaseModels/UserWebhook.js.map +1 -1
- package/build/dist/Models/DatabaseModels/UserWhatsApp.js +45 -2
- package/build/dist/Models/DatabaseModels/UserWhatsApp.js.map +1 -1
- package/build/dist/Models/DatabaseModels/WorkflowVariable.js +12 -0
- package/build/dist/Models/DatabaseModels/WorkflowVariable.js.map +1 -1
- package/build/dist/Server/API/AIChatAPI.js +237 -1
- package/build/dist/Server/API/AIChatAPI.js.map +1 -1
- package/build/dist/Server/API/DashboardAPI.js +165 -13
- package/build/dist/Server/API/DashboardAPI.js.map +1 -1
- package/build/dist/Server/API/OnCallReadinessAPI.js +599 -0
- package/build/dist/Server/API/OnCallReadinessAPI.js.map +1 -0
- package/build/dist/Server/API/TeamComplianceAPI.js +68 -9
- package/build/dist/Server/API/TeamComplianceAPI.js.map +1 -1
- package/build/dist/Server/API/TelemetryAPI.js +129 -18
- package/build/dist/Server/API/TelemetryAPI.js.map +1 -1
- package/build/dist/Server/EnvironmentConfig.js +45 -0
- package/build/dist/Server/EnvironmentConfig.js.map +1 -1
- package/build/dist/Server/Infrastructure/Postgres/DataSourceOptions.js +22 -0
- package/build/dist/Server/Infrastructure/Postgres/DataSourceOptions.js.map +1 -1
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1786100000000-RestoreServiceLowerNameIndex.js +4 -4
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1786625176831-AddMonitoringMethodToNetworkDevice.js +18 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1786625176831-AddMonitoringMethodToNetworkDevice.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1786634985763-AddNetworkDeviceLink.js +39 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1786634985763-AddNetworkDeviceLink.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1786639512056-AddNetworkDeviceLinkRule.js +38 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1786639512056-AddNetworkDeviceLinkRule.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1786639972982-AddNetworkTopologySuppression.js +22 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1786639972982-AddNetworkTopologySuppression.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1786800000000-RenameTelemetryEntityToInventoryItem.js +150 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1786800000000-RenameTelemetryEntityToInventoryItem.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1786900000000-AddInventoryItemArchiveAndCustomFields.js +57 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1786900000000-AddInventoryItemArchiveAndCustomFields.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1787000000000-AddOnCallNotificationFallbackColumns.js +69 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1787000000000-AddOnCallNotificationFallbackColumns.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1787100000000-AddAIConversationPageContext.js +32 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1787100000000-AddAIConversationPageContext.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1787200000000-AddAIChatMessageFeedback.js +26 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1787200000000-AddAIChatMessageFeedback.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1787300000000-AddEpisodeMemberNotifyIndexes.js +48 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1787300000000-AddEpisodeMemberNotifyIndexes.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js +20 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js.map +1 -1
- package/build/dist/Server/Infrastructure/Queue.js +72 -13
- package/build/dist/Server/Infrastructure/Queue.js.map +1 -1
- package/build/dist/Server/Middleware/PublicDashboardRateLimit.js +399 -0
- package/build/dist/Server/Middleware/PublicDashboardRateLimit.js.map +1 -0
- package/build/dist/Server/Services/AIService.js +1 -0
- package/build/dist/Server/Services/AIService.js.map +1 -1
- package/build/dist/Server/Services/AlertEpisodeStateTimelineService.js +24 -3
- package/build/dist/Server/Services/AlertEpisodeStateTimelineService.js.map +1 -1
- package/build/dist/Server/Services/AlertSeverityService.js +54 -0
- package/build/dist/Server/Services/AlertSeverityService.js.map +1 -1
- package/build/dist/Server/Services/DashboardService.js +10 -9
- package/build/dist/Server/Services/DashboardService.js.map +1 -1
- package/build/dist/Server/Services/DatabaseService.js +24 -2
- package/build/dist/Server/Services/DatabaseService.js.map +1 -1
- package/build/dist/Server/Services/IncidentEpisodeStateTimelineService.js +24 -3
- package/build/dist/Server/Services/IncidentEpisodeStateTimelineService.js.map +1 -1
- package/build/dist/Server/Services/IncidentSeverityService.js +67 -0
- package/build/dist/Server/Services/IncidentSeverityService.js.map +1 -1
- package/build/dist/Server/Services/Index.js +12 -4
- package/build/dist/Server/Services/Index.js.map +1 -1
- package/build/dist/Server/Services/InventoryItemCustomFieldService.js +9 -0
- package/build/dist/Server/Services/InventoryItemCustomFieldService.js.map +1 -0
- package/build/dist/Server/Services/{TelemetryEntityRelationshipService.js → InventoryItemRelationshipService.js} +6 -6
- package/build/dist/Server/Services/InventoryItemRelationshipService.js.map +1 -0
- package/build/dist/Server/Services/{TelemetryEntityService.js → InventoryItemService.js} +68 -23
- package/build/dist/Server/Services/InventoryItemService.js.map +1 -0
- package/build/dist/Server/Services/LogAggregationService.js +27 -8
- package/build/dist/Server/Services/LogAggregationService.js.map +1 -1
- package/build/dist/Server/Services/MetricAggregationService.js +80 -0
- package/build/dist/Server/Services/MetricAggregationService.js.map +1 -1
- package/build/dist/Server/Services/MetricService.js +6 -6
- package/build/dist/Server/Services/MetricService.js.map +1 -1
- package/build/dist/Server/Services/NetworkDeviceLinkRuleService.js +9 -0
- package/build/dist/Server/Services/NetworkDeviceLinkRuleService.js.map +1 -0
- package/build/dist/Server/Services/NetworkDeviceLinkService.js +71 -0
- package/build/dist/Server/Services/NetworkDeviceLinkService.js.map +1 -0
- package/build/dist/Server/Services/NetworkDeviceService.js +113 -0
- package/build/dist/Server/Services/NetworkDeviceService.js.map +1 -1
- package/build/dist/Server/Services/NetworkSiteService.js +53 -13
- package/build/dist/Server/Services/NetworkSiteService.js.map +1 -1
- package/build/dist/Server/Services/NetworkTopologySuppressionService.js +85 -0
- package/build/dist/Server/Services/NetworkTopologySuppressionService.js.map +1 -0
- package/build/dist/Server/Services/OnCallDutyPolicyEscalationRuleScheduleService.js +48 -32
- package/build/dist/Server/Services/OnCallDutyPolicyEscalationRuleScheduleService.js.map +1 -1
- package/build/dist/Server/Services/OnCallDutyPolicyExecutionLogService.js +8 -0
- package/build/dist/Server/Services/OnCallDutyPolicyExecutionLogService.js.map +1 -1
- package/build/dist/Server/Services/OnCallDutyPolicyExecutionLogTimelineService.js +51 -12
- package/build/dist/Server/Services/OnCallDutyPolicyExecutionLogTimelineService.js.map +1 -1
- package/build/dist/Server/Services/OnCallDutyPolicyScheduleService.js +57 -13
- package/build/dist/Server/Services/OnCallDutyPolicyScheduleService.js.map +1 -1
- package/build/dist/Server/Services/OnCallNotificationAlertingService.js +548 -0
- package/build/dist/Server/Services/OnCallNotificationAlertingService.js.map +1 -0
- package/build/dist/Server/Services/OnCallReadinessService.js +1961 -0
- package/build/dist/Server/Services/OnCallReadinessService.js.map +1 -0
- package/build/dist/Server/Services/OnCallSetupReminderService.js +738 -0
- package/build/dist/Server/Services/OnCallSetupReminderService.js.map +1 -0
- package/build/dist/Server/Services/ProfileAggregationService.js +68 -4
- package/build/dist/Server/Services/ProfileAggregationService.js.map +1 -1
- package/build/dist/Server/Services/StatusPageService.js +11 -10
- package/build/dist/Server/Services/StatusPageService.js.map +1 -1
- package/build/dist/Server/Services/TeamComplianceService.js +312 -160
- package/build/dist/Server/Services/TeamComplianceService.js.map +1 -1
- package/build/dist/Server/Services/UserCallService.js +24 -1
- package/build/dist/Server/Services/UserCallService.js.map +1 -1
- package/build/dist/Server/Services/UserEmailService.js +24 -1
- package/build/dist/Server/Services/UserEmailService.js.map +1 -1
- package/build/dist/Server/Services/UserNotificationRuleAdminService.js +858 -0
- package/build/dist/Server/Services/UserNotificationRuleAdminService.js.map +1 -0
- package/build/dist/Server/Services/UserNotificationRuleService.js +2830 -175
- package/build/dist/Server/Services/UserNotificationRuleService.js.map +1 -1
- package/build/dist/Server/Services/UserOnCallLogService.js +488 -43
- package/build/dist/Server/Services/UserOnCallLogService.js.map +1 -1
- package/build/dist/Server/Services/UserPushService.js +26 -0
- package/build/dist/Server/Services/UserPushService.js.map +1 -1
- package/build/dist/Server/Services/UserService.js +10 -0
- package/build/dist/Server/Services/UserService.js.map +1 -1
- package/build/dist/Server/Services/UserSmsService.js +24 -1
- package/build/dist/Server/Services/UserSmsService.js.map +1 -1
- package/build/dist/Server/Services/UserTelegramService.js +22 -1
- package/build/dist/Server/Services/UserTelegramService.js.map +1 -1
- package/build/dist/Server/Services/UserWebhookService.js +25 -1
- package/build/dist/Server/Services/UserWebhookService.js.map +1 -1
- package/build/dist/Server/Services/UserWhatsAppService.js +22 -1
- package/build/dist/Server/Services/UserWhatsAppService.js.map +1 -1
- package/build/dist/Server/Types/Database/Permissions/BasePermission.js +12 -1
- package/build/dist/Server/Types/Database/Permissions/BasePermission.js.map +1 -1
- package/build/dist/Server/Types/Database/Permissions/CreatePermission.js +126 -0
- package/build/dist/Server/Types/Database/Permissions/CreatePermission.js.map +1 -1
- package/build/dist/Server/Types/Database/Permissions/OwnerOnlyColumnPermission.js +254 -0
- package/build/dist/Server/Types/Database/Permissions/OwnerOnlyColumnPermission.js.map +1 -0
- package/build/dist/Server/Types/Database/Permissions/QueryPermission.js +47 -2
- package/build/dist/Server/Types/Database/Permissions/QueryPermission.js.map +1 -1
- package/build/dist/Server/Types/Database/Permissions/TenantPermission.js +7 -0
- package/build/dist/Server/Types/Database/Permissions/TenantPermission.js.map +1 -1
- package/build/dist/Server/Types/Workflow/Components/API/Delete.js +1 -1
- package/build/dist/Server/Types/Workflow/Components/API/Delete.js.map +1 -1
- package/build/dist/Server/Types/Workflow/Components/API/Get.js +1 -1
- package/build/dist/Server/Types/Workflow/Components/API/Get.js.map +1 -1
- package/build/dist/Server/Types/Workflow/Components/API/Patch.js +1 -1
- package/build/dist/Server/Types/Workflow/Components/API/Patch.js.map +1 -1
- package/build/dist/Server/Types/Workflow/Components/API/Post.js +1 -1
- package/build/dist/Server/Types/Workflow/Components/API/Post.js.map +1 -1
- package/build/dist/Server/Types/Workflow/Components/API/Put.js +1 -1
- package/build/dist/Server/Types/Workflow/Components/API/Put.js.map +1 -1
- package/build/dist/Server/Types/Workflow/Components/BaseModel/CreateManyBaseModel.js +21 -5
- package/build/dist/Server/Types/Workflow/Components/BaseModel/CreateManyBaseModel.js.map +1 -1
- package/build/dist/Server/Types/Workflow/Components/BaseModel/CreateOneBaseModel.js +14 -10
- package/build/dist/Server/Types/Workflow/Components/BaseModel/CreateOneBaseModel.js.map +1 -1
- package/build/dist/Server/Types/Workflow/Components/BaseModel/ModelArguments.js +31 -0
- package/build/dist/Server/Types/Workflow/Components/BaseModel/ModelArguments.js.map +1 -1
- package/build/dist/Server/Types/Workflow/Components/Conditions/IfElse.js +3 -9
- package/build/dist/Server/Types/Workflow/Components/Conditions/IfElse.js.map +1 -1
- package/build/dist/Server/Types/Workflow/Components/Email.js +15 -4
- package/build/dist/Server/Types/Workflow/Components/Email.js.map +1 -1
- package/build/dist/Server/Types/Workflow/Components/JavaScript.js +7 -2
- package/build/dist/Server/Types/Workflow/Components/JavaScript.js.map +1 -1
- package/build/dist/Server/Types/Workflow/Components/MicrosoftTeams/SendMessageToChannel.js +1 -1
- package/build/dist/Server/Types/Workflow/Components/MicrosoftTeams/SendMessageToChannel.js.map +1 -1
- package/build/dist/Server/Utils/AI/Chat/ChatAgentRunner.js +514 -56
- package/build/dist/Server/Utils/AI/Chat/ChatAgentRunner.js.map +1 -1
- package/build/dist/Server/Utils/AI/Chat/ObservabilityAssistant.js +20 -3
- package/build/dist/Server/Utils/AI/Chat/ObservabilityAssistant.js.map +1 -1
- package/build/dist/Server/Utils/AI/Chat/ObservabilityChatPrompt.js +19 -6
- package/build/dist/Server/Utils/AI/Chat/ObservabilityChatPrompt.js.map +1 -1
- package/build/dist/Server/Utils/AI/SRE/AIInvestigationEngine.js +7 -0
- package/build/dist/Server/Utils/AI/SRE/AIInvestigationEngine.js.map +1 -1
- package/build/dist/Server/Utils/AI/Toolbox/AIActionTools.js +2 -2
- package/build/dist/Server/Utils/AI/Toolbox/AIActionTools.js.map +1 -1
- package/build/dist/Server/Utils/AI/Toolbox/AIMetaTools.js +692 -0
- package/build/dist/Server/Utils/AI/Toolbox/AIMetaTools.js.map +1 -0
- package/build/dist/Server/Utils/AI/Toolbox/AlertTools.js +148 -12
- package/build/dist/Server/Utils/AI/Toolbox/AlertTools.js.map +1 -1
- package/build/dist/Server/Utils/AI/Toolbox/IncidentTools.js +157 -10
- package/build/dist/Server/Utils/AI/Toolbox/IncidentTools.js.map +1 -1
- package/build/dist/Server/Utils/AI/Toolbox/Index.js +37 -0
- package/build/dist/Server/Utils/AI/Toolbox/Index.js.map +1 -1
- package/build/dist/Server/Utils/AI/Toolbox/MonitorTools.js +259 -14
- package/build/dist/Server/Utils/AI/Toolbox/MonitorTools.js.map +1 -1
- package/build/dist/Server/Utils/AI/Toolbox/NoteWriteTools.js +235 -0
- package/build/dist/Server/Utils/AI/Toolbox/NoteWriteTools.js.map +1 -0
- package/build/dist/Server/Utils/AI/Toolbox/OnCallTools.js +1000 -0
- package/build/dist/Server/Utils/AI/Toolbox/OnCallTools.js.map +1 -0
- package/build/dist/Server/Utils/AI/Toolbox/RunbookTools.js +356 -0
- package/build/dist/Server/Utils/AI/Toolbox/RunbookTools.js.map +1 -0
- package/build/dist/Server/Utils/AI/Toolbox/SloTools.js +394 -0
- package/build/dist/Server/Utils/AI/Toolbox/SloTools.js.map +1 -0
- package/build/dist/Server/Utils/AI/Toolbox/StatusPageTools.js +465 -0
- package/build/dist/Server/Utils/AI/Toolbox/StatusPageTools.js.map +1 -0
- package/build/dist/Server/Utils/AI/Toolbox/TeamTools.js +280 -0
- package/build/dist/Server/Utils/AI/Toolbox/TeamTools.js.map +1 -0
- package/build/dist/Server/Utils/AI/Toolbox/TimelineTools.js +527 -0
- package/build/dist/Server/Utils/AI/Toolbox/TimelineTools.js.map +1 -0
- package/build/dist/Server/Utils/AI/Toolbox/WorkflowProbeTools.js +548 -0
- package/build/dist/Server/Utils/AI/Toolbox/WorkflowProbeTools.js.map +1 -0
- package/build/dist/Server/Utils/ClientIp.js +137 -0
- package/build/dist/Server/Utils/ClientIp.js.map +1 -0
- package/build/dist/Server/Utils/Dashboard/PublicDashboardResourceListPolicy.js +38 -0
- package/build/dist/Server/Utils/Dashboard/PublicDashboardResourceListPolicy.js.map +1 -1
- package/build/dist/Server/Utils/Dashboard/PublicDashboardSloHistoryPolicy.js +89 -0
- package/build/dist/Server/Utils/Dashboard/PublicDashboardSloHistoryPolicy.js.map +1 -0
- package/build/dist/Server/Utils/Dashboard/PublicDashboardSloWidget.js +77 -0
- package/build/dist/Server/Utils/Dashboard/PublicDashboardSloWidget.js.map +1 -0
- package/build/dist/Server/Utils/Express.js +12 -12
- package/build/dist/Server/Utils/Express.js.map +1 -1
- package/build/dist/Server/Utils/LLM/LLMService.js +70 -7
- package/build/dist/Server/Utils/LLM/LLMService.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorCriteriaEvaluator.js +121 -11
- package/build/dist/Server/Utils/Monitor/MonitorCriteriaEvaluator.js.map +1 -1
- package/build/dist/Server/Utils/SSRFProtection.js +82 -21
- package/build/dist/Server/Utils/SSRFProtection.js.map +1 -1
- package/build/dist/Server/Utils/StartServer.js +12 -4
- package/build/dist/Server/Utils/StartServer.js.map +1 -1
- package/build/dist/Server/Utils/Telemetry/EntityRegistry.js +165 -18
- package/build/dist/Server/Utils/Telemetry/EntityRegistry.js.map +1 -1
- package/build/dist/Server/Utils/Telemetry/InventoryEntityRegistry.js +11 -11
- package/build/dist/Server/Utils/Telemetry/InventoryEntityRegistry.js.map +1 -1
- package/build/dist/Server/Utils/Telemetry/TelemetryEntity.js +122 -47
- package/build/dist/Server/Utils/Telemetry/TelemetryEntity.js.map +1 -1
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeams.js +7 -3
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeams.js.map +1 -1
- package/build/dist/Types/AI/AIChatMessageStatus.js +8 -1
- package/build/dist/Types/AI/AIChatMessageStatus.js.map +1 -1
- package/build/dist/Types/AI/AIChatTypes.js +12 -0
- package/build/dist/Types/AI/AIChatTypes.js.map +1 -1
- package/build/dist/Types/Database/AccessControl/OwnerOnlyColumn.js +60 -0
- package/build/dist/Types/Database/AccessControl/OwnerOnlyColumn.js.map +1 -0
- package/build/dist/Types/Exception/ExceptionCode.js +2 -0
- package/build/dist/Types/Exception/ExceptionCode.js.map +1 -1
- package/build/dist/Types/Exception/ServiceUnavailableException.js +8 -0
- package/build/dist/Types/Exception/ServiceUnavailableException.js.map +1 -0
- package/build/dist/Types/Exception/TooManyRequestsException.js +8 -0
- package/build/dist/Types/Exception/TooManyRequestsException.js.map +1 -0
- package/build/dist/Types/IP/IP.js +87 -43
- package/build/dist/Types/IP/IP.js.map +1 -1
- package/build/dist/Types/NetworkDevice/NetworkDeviceMonitoringMethod.js +50 -0
- package/build/dist/Types/NetworkDevice/NetworkDeviceMonitoringMethod.js.map +1 -0
- package/build/dist/Types/OnCallDutyPolicy/Layer.js +186 -123
- package/build/dist/Types/OnCallDutyPolicy/Layer.js.map +1 -1
- package/build/dist/Types/OnCallDutyPolicy/OnCallDutyPolicyStatus.js +13 -0
- package/build/dist/Types/OnCallDutyPolicy/OnCallDutyPolicyStatus.js.map +1 -1
- package/build/dist/Types/OnCallDutyPolicy/ScheduleShiftUtil.js +105 -11
- package/build/dist/Types/OnCallDutyPolicy/ScheduleShiftUtil.js.map +1 -1
- package/build/dist/Types/Permission.js +174 -0
- package/build/dist/Types/Permission.js.map +1 -1
- package/build/dist/Types/Telemetry/EntityRelationshipType.js +1 -1
- package/build/dist/Types/Telemetry/EntitySource.js +1 -1
- package/build/dist/Types/Telemetry/EntityType.js +1 -1
- package/build/dist/Types/Telemetry/EntityTypeGroups.js +1 -1
- package/build/dist/Types/Telemetry/EntityTypeGroups.js.map +1 -1
- package/build/dist/Types/Workflow/Components/BaseModel.js +66 -28
- package/build/dist/Types/Workflow/Components/BaseModel.js.map +1 -1
- package/build/dist/Types/Workflow/Components/Discord.js +1 -0
- package/build/dist/Types/Workflow/Components/Discord.js.map +1 -1
- package/build/dist/Types/Workflow/Components/Email.js +12 -3
- package/build/dist/Types/Workflow/Components/Email.js.map +1 -1
- package/build/dist/Types/Workflow/Components/JavaScript.js +7 -0
- package/build/dist/Types/Workflow/Components/JavaScript.js.map +1 -1
- package/build/dist/Types/Workflow/Components/MicrosoftTeams.js +3 -2
- package/build/dist/Types/Workflow/Components/MicrosoftTeams.js.map +1 -1
- package/build/dist/Types/Workflow/Components/Slack.js +1 -0
- package/build/dist/Types/Workflow/Components/Slack.js.map +1 -1
- package/build/dist/Types/Workflow/Components/Telegram.js +1 -0
- package/build/dist/Types/Workflow/Components/Telegram.js.map +1 -1
- package/build/dist/Types/Workflow/TemplateSyntax.js +12 -0
- package/build/dist/Types/Workflow/TemplateSyntax.js.map +1 -1
- package/build/dist/Types/Workflow/Templates.js +1931 -38
- package/build/dist/Types/Workflow/Templates.js.map +1 -1
- package/build/dist/UI/Components/Calendar/Calendar.js +1 -1
- package/build/dist/UI/Components/Calendar/Calendar.js.map +1 -1
- package/build/dist/UI/Components/Checkbox/Checkbox.js +1 -1
- package/build/dist/UI/Components/Checkbox/Checkbox.js.map +1 -1
- package/build/dist/UI/Components/Dictionary/Dictionary.js +25 -11
- package/build/dist/UI/Components/Dictionary/Dictionary.js.map +1 -1
- package/build/dist/UI/Components/FormModal/BasicFormModal.js.map +1 -1
- package/build/dist/UI/Components/Header/HeaderIconDropdownButton.js +27 -4
- package/build/dist/UI/Components/Header/HeaderIconDropdownButton.js.map +1 -1
- package/build/dist/UI/Components/Input/Input.js +1 -0
- package/build/dist/UI/Components/Input/Input.js.map +1 -1
- package/build/dist/UI/Components/KeyboardShortcut/KeyboardKey.js +163 -0
- package/build/dist/UI/Components/KeyboardShortcut/KeyboardKey.js.map +1 -0
- package/build/dist/UI/Components/KeyboardShortcut/KeyboardShortcut.js +47 -0
- package/build/dist/UI/Components/KeyboardShortcut/KeyboardShortcut.js.map +1 -0
- package/build/dist/UI/Components/LogsViewer/LogsViewer.js +4 -4
- package/build/dist/UI/Components/LogsViewer/LogsViewer.js.map +1 -1
- package/build/dist/UI/Components/LogsViewer/components/ActiveFilterChips.js +11 -1
- package/build/dist/UI/Components/LogsViewer/components/ActiveFilterChips.js.map +1 -1
- package/build/dist/UI/Components/LogsViewer/components/KeyboardShortcutsHelp.js +10 -8
- package/build/dist/UI/Components/LogsViewer/components/KeyboardShortcutsHelp.js.map +1 -1
- package/build/dist/UI/Components/LogsViewer/components/LogDetailsPanel.js +227 -14
- package/build/dist/UI/Components/LogsViewer/components/LogDetailsPanel.js.map +1 -1
- package/build/dist/UI/Components/LogsViewer/components/LogsAnalyticsView.js +5 -0
- package/build/dist/UI/Components/LogsViewer/components/LogsAnalyticsView.js.map +1 -1
- package/build/dist/UI/Components/LogsViewer/components/LogsTable.js +69 -5
- package/build/dist/UI/Components/LogsViewer/components/LogsTable.js.map +1 -1
- package/build/dist/UI/Components/LogsViewer/components/LogsViewerToolbar.js +8 -0
- package/build/dist/UI/Components/LogsViewer/components/LogsViewerToolbar.js.map +1 -1
- package/build/dist/UI/Components/LogsViewer/types.js.map +1 -1
- package/build/dist/UI/Components/Markdown.tsx/MarkdownEditor.js +9 -2
- package/build/dist/UI/Components/Markdown.tsx/MarkdownEditor.js.map +1 -1
- package/build/dist/UI/Components/Navbar/NavBarMenuModal.js +8 -21
- package/build/dist/UI/Components/Navbar/NavBarMenuModal.js.map +1 -1
- package/build/dist/UI/Components/ProjectInvitations/PendingProjectInvitations.js +251 -0
- package/build/dist/UI/Components/ProjectInvitations/PendingProjectInvitations.js.map +1 -0
- package/build/dist/UI/Components/SimpleLogViewer/SimpleLogViewer.js +9 -2
- package/build/dist/UI/Components/SimpleLogViewer/SimpleLogViewer.js.map +1 -1
- package/build/dist/UI/Components/Table/Table.js +27 -15
- package/build/dist/UI/Components/Table/Table.js.map +1 -1
- package/build/dist/UI/Components/Table/TableBody.js +24 -18
- package/build/dist/UI/Components/Table/TableBody.js.map +1 -1
- package/build/dist/UI/Components/Table/TableHeader.js +9 -1
- package/build/dist/UI/Components/Table/TableHeader.js.map +1 -1
- package/build/dist/UI/Components/Table/TableRow.js +29 -21
- package/build/dist/UI/Components/Table/TableRow.js.map +1 -1
- package/build/dist/UI/Components/Workflow/ArgumentsForm.js +130 -12
- package/build/dist/UI/Components/Workflow/ArgumentsForm.js.map +1 -1
- package/build/dist/UI/Components/Workflow/ComponentReturnValueViewer.js +10 -1
- package/build/dist/UI/Components/Workflow/ComponentReturnValueViewer.js.map +1 -1
- package/build/dist/UI/Components/Workflow/ComponentSettingsModal.js +4 -4
- package/build/dist/UI/Components/Workflow/ComponentSettingsModal.js.map +1 -1
- package/build/dist/UI/Components/Workflow/ComponentValuePickerModal.js +57 -7
- package/build/dist/UI/Components/Workflow/ComponentValuePickerModal.js.map +1 -1
- package/build/dist/UI/Components/Workflow/ComponentsModal.js +53 -18
- package/build/dist/UI/Components/Workflow/ComponentsModal.js.map +1 -1
- package/build/dist/UI/Components/Workflow/DocumentationViewer.js +19 -6
- package/build/dist/UI/Components/Workflow/DocumentationViewer.js.map +1 -1
- package/build/dist/UI/Components/Workflow/GraphLint.js +33 -4
- package/build/dist/UI/Components/Workflow/GraphLint.js.map +1 -1
- package/build/dist/UI/Components/Workflow/GraphLintSummary.js +231 -0
- package/build/dist/UI/Components/Workflow/GraphLintSummary.js.map +1 -0
- package/build/dist/UI/Components/Workflow/ModelColumnEditor.js +116 -21
- package/build/dist/UI/Components/Workflow/ModelColumnEditor.js.map +1 -1
- package/build/dist/UI/Components/Workflow/ModelSchema.js +72 -34
- package/build/dist/UI/Components/Workflow/ModelSchema.js.map +1 -1
- package/build/dist/UI/Components/Workflow/RunStatusWatcher.js +1 -1
- package/build/dist/UI/Components/Workflow/RunStatusWatcher.js.map +1 -1
- package/build/dist/UI/Components/Workflow/StepTraceViewer.js +1 -1
- package/build/dist/UI/Components/Workflow/StepTraceViewer.js.map +1 -1
- package/build/dist/UI/Components/Workflow/UseRunWatch.js +123 -0
- package/build/dist/UI/Components/Workflow/UseRunWatch.js.map +1 -0
- package/build/dist/UI/Components/Workflow/VariableModal.js +3 -2
- package/build/dist/UI/Components/Workflow/VariableModal.js.map +1 -1
- package/build/dist/UI/Components/Workflow/Workflow.js +41 -1
- package/build/dist/UI/Components/Workflow/Workflow.js.map +1 -1
- package/build/dist/UI/Components/Workflow/WorkflowIssuesModal.js +99 -0
- package/build/dist/UI/Components/Workflow/WorkflowIssuesModal.js.map +1 -0
- package/build/dist/UI/Components/Workflow/WorkflowLogModal.js +56 -0
- package/build/dist/UI/Components/Workflow/WorkflowLogModal.js.map +1 -0
- package/build/dist/UI/Components/Workflow/WorkflowStatusBar.js +92 -0
- package/build/dist/UI/Components/Workflow/WorkflowStatusBar.js.map +1 -0
- package/build/dist/UI/Utils/AIChatExport/ConversationMarkdown.js +9 -0
- package/build/dist/UI/Utils/AIChatExport/ConversationMarkdown.js.map +1 -1
- package/build/dist/UI/Utils/ModelAPI/ModelAPI.js +1 -1
- package/build/dist/UI/Utils/ModelAPI/ModelAPI.js.map +1 -1
- package/build/dist/UI/Utils/Platform.js +118 -0
- package/build/dist/UI/Utils/Platform.js.map +1 -0
- package/build/dist/UI/Utils/ProjectInvitationDisplay.js +106 -0
- package/build/dist/UI/Utils/ProjectInvitationDisplay.js.map +1 -0
- package/build/dist/Utils/Monitor/NetworkDeviceLinkRuleUtil.js +108 -0
- package/build/dist/Utils/Monitor/NetworkDeviceLinkRuleUtil.js.map +1 -0
- package/build/dist/Utils/Monitor/NetworkTopologyUtil.js +642 -136
- package/build/dist/Utils/Monitor/NetworkTopologyUtil.js.map +1 -1
- package/build/dist/Utils/Telemetry/CrossSignalScope.js +328 -0
- package/build/dist/Utils/Telemetry/CrossSignalScope.js.map +1 -0
- package/build/dist/Utils/Telemetry/EntityKey.js +5 -5
- package/build/dist/Utils/Telemetry/EntityRelationship.js +1 -1
- package/jest.config.json +1 -0
- package/package.json +1 -1
- package/build/dist/Models/DatabaseModels/TelemetryEntity.js.map +0 -1
- package/build/dist/Models/DatabaseModels/TelemetryEntityRelationship.js.map +0 -1
- package/build/dist/Server/Services/TelemetryEntityRelationshipService.js.map +0 -1
- package/build/dist/Server/Services/TelemetryEntityService.js.map +0 -1
|
@@ -0,0 +1,460 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* The evaluator's import chain pulls the native isolated-vm addon
|
|
3
|
+
* (MonitorCriteriaEvaluator → VMAPI → VMRunner). Nothing under test here
|
|
4
|
+
* touches the sandbox, and the prebuilt binary cannot always dlopen in the
|
|
5
|
+
* test environment — so stub the module out before anything imports it.
|
|
6
|
+
*/
|
|
7
|
+
jest.mock("isolated-vm", () => {
|
|
8
|
+
return {};
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
import MonitorCriteriaEvaluator, {
|
|
12
|
+
TelemetryExplorerDeepLink,
|
|
13
|
+
} from "../../../../Server/Utils/Monitor/MonitorCriteriaEvaluator";
|
|
14
|
+
import { DashboardClientUrl } from "../../../../Server/EnvironmentConfig";
|
|
15
|
+
import Monitor from "../../../../Models/DatabaseModels/Monitor";
|
|
16
|
+
import MonitorStep from "../../../../Types/Monitor/MonitorStep";
|
|
17
|
+
import MonitorCriteriaInstance from "../../../../Types/Monitor/MonitorCriteriaInstance";
|
|
18
|
+
import MetricCriteriaContext from "../../../../Types/Monitor/MetricMonitor/MetricCriteriaContext";
|
|
19
|
+
import { CheckOn } from "../../../../Types/Monitor/CriteriaFilter";
|
|
20
|
+
import RollingTime from "../../../../Types/RollingTime/RollingTime";
|
|
21
|
+
import ObjectID from "../../../../Types/ObjectID";
|
|
22
|
+
import { describe, expect, test } from "@jest/globals";
|
|
23
|
+
|
|
24
|
+
/*
|
|
25
|
+
* Cross-signal sibling deep links: alongside the existing metric-explorer
|
|
26
|
+
* link, a metric breach now also carries Logs and Traces explorer links
|
|
27
|
+
* scoped to the same breach window, the criteria's attribute filters
|
|
28
|
+
* (overlaid with per-series labels) and the monitor step's telemetry
|
|
29
|
+
* service scope. These tests pin:
|
|
30
|
+
*
|
|
31
|
+
* - the URL shape each builder emits (path + params the explorers parse),
|
|
32
|
+
* - the breach window math (breach -30min .. +15min, last-hour fallback),
|
|
33
|
+
* - the scope hand-off (filterAttributes + seriesLabels + serviceIds),
|
|
34
|
+
* - that the existing metric-explorer link behavior is UNCHANGED,
|
|
35
|
+
* - the root-cause markdown attach point for all three links.
|
|
36
|
+
*/
|
|
37
|
+
|
|
38
|
+
type EvaluatorPrivate = {
|
|
39
|
+
buildMetricExplorerDeepLink: (input: {
|
|
40
|
+
monitor: Monitor;
|
|
41
|
+
ctx: MetricCriteriaContext;
|
|
42
|
+
}) => string | null;
|
|
43
|
+
buildLogsExplorerDeepLink: (input: {
|
|
44
|
+
monitor: Monitor;
|
|
45
|
+
ctx: MetricCriteriaContext;
|
|
46
|
+
monitorStep?: MonitorStep | undefined;
|
|
47
|
+
}) => TelemetryExplorerDeepLink | null;
|
|
48
|
+
buildTracesExplorerDeepLink: (input: {
|
|
49
|
+
monitor: Monitor;
|
|
50
|
+
ctx: MetricCriteriaContext;
|
|
51
|
+
monitorStep?: MonitorStep | undefined;
|
|
52
|
+
}) => TelemetryExplorerDeepLink | null;
|
|
53
|
+
buildMetricRootCauseContext: (input: {
|
|
54
|
+
criteriaInstance: MonitorCriteriaInstance;
|
|
55
|
+
monitor: Monitor;
|
|
56
|
+
monitorStep?: MonitorStep | undefined;
|
|
57
|
+
}) => string | null;
|
|
58
|
+
formatScopeDroppedHint: (dropped: Array<string>) => string;
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
const Evaluator: EvaluatorPrivate =
|
|
62
|
+
MonitorCriteriaEvaluator as unknown as EvaluatorPrivate;
|
|
63
|
+
|
|
64
|
+
const BREACH_TIME: Date = new Date("2026-08-14T10:30:00.000Z");
|
|
65
|
+
const EXPECTED_WINDOW_START: string = "2026-08-14T10:00:00.000Z";
|
|
66
|
+
const EXPECTED_WINDOW_END: string = "2026-08-14T10:45:00.000Z";
|
|
67
|
+
|
|
68
|
+
const SERVICE_ID_A: string = "651a000000000000000000aa";
|
|
69
|
+
const SERVICE_ID_B: string = "651a000000000000000000bb";
|
|
70
|
+
|
|
71
|
+
function makeMonitor(projectId?: ObjectID): Monitor {
|
|
72
|
+
const monitor: Monitor = new Monitor();
|
|
73
|
+
if (projectId) {
|
|
74
|
+
monitor.projectId = projectId;
|
|
75
|
+
}
|
|
76
|
+
return monitor;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
function makeContext(
|
|
80
|
+
overrides: Partial<MetricCriteriaContext> = {},
|
|
81
|
+
): MetricCriteriaContext {
|
|
82
|
+
return {
|
|
83
|
+
metricName: "container.cpu.time",
|
|
84
|
+
alias: "a",
|
|
85
|
+
unit: null,
|
|
86
|
+
aggregationType: null,
|
|
87
|
+
isFormula: false,
|
|
88
|
+
filterAttributes: {
|
|
89
|
+
"k8s.pod.name": "web-1",
|
|
90
|
+
"http.status_code": 500,
|
|
91
|
+
},
|
|
92
|
+
groupBy: [],
|
|
93
|
+
breachingSample: {
|
|
94
|
+
value: 97,
|
|
95
|
+
timestamp: BREACH_TIME,
|
|
96
|
+
attributes: {},
|
|
97
|
+
},
|
|
98
|
+
seriesLabels: { "host.name": "prod-01" },
|
|
99
|
+
...overrides,
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
function makeMetricMonitorStep(
|
|
104
|
+
telemetryServiceIds: Array<ObjectID>,
|
|
105
|
+
): MonitorStep {
|
|
106
|
+
const step: MonitorStep = new MonitorStep();
|
|
107
|
+
step.data!.metricMonitor = {
|
|
108
|
+
metricViewConfig: { queryConfigs: [], formulaConfigs: [] },
|
|
109
|
+
rollingTime: RollingTime.Past1Minute,
|
|
110
|
+
telemetryServiceIds,
|
|
111
|
+
};
|
|
112
|
+
return step;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
function getQueryParams(url: string): URLSearchParams {
|
|
116
|
+
return new URLSearchParams(url.split("?")[1] || "");
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
describe("MonitorCriteriaEvaluator - logs explorer deep link", () => {
|
|
120
|
+
test("builds the /logs URL with the filters tuples the logs explorer parses", () => {
|
|
121
|
+
const projectId: ObjectID = ObjectID.generate();
|
|
122
|
+
const step: MonitorStep = makeMetricMonitorStep([
|
|
123
|
+
new ObjectID(SERVICE_ID_A),
|
|
124
|
+
new ObjectID(SERVICE_ID_B),
|
|
125
|
+
]);
|
|
126
|
+
|
|
127
|
+
const link: TelemetryExplorerDeepLink | null =
|
|
128
|
+
Evaluator.buildLogsExplorerDeepLink({
|
|
129
|
+
monitor: makeMonitor(projectId),
|
|
130
|
+
ctx: makeContext(),
|
|
131
|
+
monitorStep: step,
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
expect(link).not.toBeNull();
|
|
135
|
+
expect(
|
|
136
|
+
link!.url.startsWith(
|
|
137
|
+
`${DashboardClientUrl.toString()}/${projectId.toString()}/logs?`,
|
|
138
|
+
),
|
|
139
|
+
).toBe(true);
|
|
140
|
+
|
|
141
|
+
const params: URLSearchParams = getQueryParams(link!.url);
|
|
142
|
+
|
|
143
|
+
// Shape: Array<[facetKey, values[]]> — LogsViewer.readInitialUrlState.
|
|
144
|
+
expect(JSON.parse(params.get("filters") as string)).toEqual([
|
|
145
|
+
["primaryEntityId", [SERVICE_ID_A, SERVICE_ID_B]],
|
|
146
|
+
["attributes.k8s.pod.name", ["web-1"]],
|
|
147
|
+
["attributes.http.status_code", ["500"]],
|
|
148
|
+
["attributes.host.name", ["prod-01"]],
|
|
149
|
+
]);
|
|
150
|
+
|
|
151
|
+
expect(link!.dropped).toEqual([]);
|
|
152
|
+
});
|
|
153
|
+
|
|
154
|
+
test("carries the breach window as a Custom range (breach -30min .. +15min)", () => {
|
|
155
|
+
const link: TelemetryExplorerDeepLink | null =
|
|
156
|
+
Evaluator.buildLogsExplorerDeepLink({
|
|
157
|
+
monitor: makeMonitor(ObjectID.generate()),
|
|
158
|
+
ctx: makeContext(),
|
|
159
|
+
});
|
|
160
|
+
|
|
161
|
+
const params: URLSearchParams = getQueryParams(link!.url);
|
|
162
|
+
|
|
163
|
+
expect(params.get("range")).toBe("Custom");
|
|
164
|
+
expect(params.get("start")).toBe(EXPECTED_WINDOW_START);
|
|
165
|
+
expect(params.get("end")).toBe(EXPECTED_WINDOW_END);
|
|
166
|
+
});
|
|
167
|
+
|
|
168
|
+
test("falls back to the last hour when there is no breaching sample", () => {
|
|
169
|
+
const before: number = Date.now();
|
|
170
|
+
const link: TelemetryExplorerDeepLink | null =
|
|
171
|
+
Evaluator.buildLogsExplorerDeepLink({
|
|
172
|
+
monitor: makeMonitor(ObjectID.generate()),
|
|
173
|
+
ctx: makeContext({ breachingSample: undefined }),
|
|
174
|
+
});
|
|
175
|
+
const after: number = Date.now();
|
|
176
|
+
|
|
177
|
+
const params: URLSearchParams = getQueryParams(link!.url);
|
|
178
|
+
const start: number = new Date(params.get("start") as string).getTime();
|
|
179
|
+
const end: number = new Date(params.get("end") as string).getTime();
|
|
180
|
+
|
|
181
|
+
expect(end - start).toBe(60 * 60 * 1000);
|
|
182
|
+
expect(end).toBeGreaterThanOrEqual(before);
|
|
183
|
+
expect(end).toBeLessThanOrEqual(after);
|
|
184
|
+
});
|
|
185
|
+
|
|
186
|
+
test("per-series labels override criteria filters on the same attribute key", () => {
|
|
187
|
+
const link: TelemetryExplorerDeepLink | null =
|
|
188
|
+
Evaluator.buildLogsExplorerDeepLink({
|
|
189
|
+
monitor: makeMonitor(ObjectID.generate()),
|
|
190
|
+
ctx: makeContext({
|
|
191
|
+
filterAttributes: { "host.name": "any-host" },
|
|
192
|
+
seriesLabels: { "host.name": "prod-01" },
|
|
193
|
+
}),
|
|
194
|
+
});
|
|
195
|
+
|
|
196
|
+
const params: URLSearchParams = getQueryParams(link!.url);
|
|
197
|
+
|
|
198
|
+
expect(JSON.parse(params.get("filters") as string)).toEqual([
|
|
199
|
+
["attributes.host.name", ["prod-01"]],
|
|
200
|
+
]);
|
|
201
|
+
});
|
|
202
|
+
|
|
203
|
+
test("non-primitive attribute values are not carried into the scope", () => {
|
|
204
|
+
const link: TelemetryExplorerDeepLink | null =
|
|
205
|
+
Evaluator.buildLogsExplorerDeepLink({
|
|
206
|
+
monitor: makeMonitor(ObjectID.generate()),
|
|
207
|
+
ctx: makeContext({
|
|
208
|
+
filterAttributes: {
|
|
209
|
+
"k8s.pod.name": "web-1",
|
|
210
|
+
nested: { not: "carried" },
|
|
211
|
+
},
|
|
212
|
+
seriesLabels: undefined,
|
|
213
|
+
}),
|
|
214
|
+
});
|
|
215
|
+
|
|
216
|
+
const params: URLSearchParams = getQueryParams(link!.url);
|
|
217
|
+
|
|
218
|
+
expect(JSON.parse(params.get("filters") as string)).toEqual([
|
|
219
|
+
["attributes.k8s.pod.name", ["web-1"]],
|
|
220
|
+
]);
|
|
221
|
+
});
|
|
222
|
+
|
|
223
|
+
test("no monitor step means no service scope — attribute filters only", () => {
|
|
224
|
+
const link: TelemetryExplorerDeepLink | null =
|
|
225
|
+
Evaluator.buildLogsExplorerDeepLink({
|
|
226
|
+
monitor: makeMonitor(ObjectID.generate()),
|
|
227
|
+
ctx: makeContext(),
|
|
228
|
+
});
|
|
229
|
+
|
|
230
|
+
const params: URLSearchParams = getQueryParams(link!.url);
|
|
231
|
+
const tuples: Array<[string, Array<string>]> = JSON.parse(
|
|
232
|
+
params.get("filters") as string,
|
|
233
|
+
);
|
|
234
|
+
|
|
235
|
+
for (const [facetKey] of tuples) {
|
|
236
|
+
expect(facetKey).not.toBe("primaryEntityId");
|
|
237
|
+
}
|
|
238
|
+
});
|
|
239
|
+
|
|
240
|
+
test("returns null when the monitor has no project id", () => {
|
|
241
|
+
expect(
|
|
242
|
+
Evaluator.buildLogsExplorerDeepLink({
|
|
243
|
+
monitor: makeMonitor(),
|
|
244
|
+
ctx: makeContext(),
|
|
245
|
+
}),
|
|
246
|
+
).toBeNull();
|
|
247
|
+
});
|
|
248
|
+
});
|
|
249
|
+
|
|
250
|
+
describe("MonitorCriteriaEvaluator - traces explorer deep link", () => {
|
|
251
|
+
test("builds the /traces URL with search tokens and service chips", () => {
|
|
252
|
+
const projectId: ObjectID = ObjectID.generate();
|
|
253
|
+
const step: MonitorStep = makeMetricMonitorStep([
|
|
254
|
+
new ObjectID(SERVICE_ID_A),
|
|
255
|
+
]);
|
|
256
|
+
|
|
257
|
+
const link: TelemetryExplorerDeepLink | null =
|
|
258
|
+
Evaluator.buildTracesExplorerDeepLink({
|
|
259
|
+
monitor: makeMonitor(projectId),
|
|
260
|
+
ctx: makeContext(),
|
|
261
|
+
monitorStep: step,
|
|
262
|
+
});
|
|
263
|
+
|
|
264
|
+
expect(link).not.toBeNull();
|
|
265
|
+
expect(
|
|
266
|
+
link!.url.startsWith(
|
|
267
|
+
`${DashboardClientUrl.toString()}/${projectId.toString()}/traces?`,
|
|
268
|
+
),
|
|
269
|
+
).toBe(true);
|
|
270
|
+
|
|
271
|
+
const params: URLSearchParams = getQueryParams(link!.url);
|
|
272
|
+
|
|
273
|
+
// The traces search DSL: @<attribute>:<value> tokens (TracesViewer.tsx).
|
|
274
|
+
expect(params.get("search")).toBe(
|
|
275
|
+
"@k8s.pod.name:web-1 @http.status_code:500 @host.name:prod-01",
|
|
276
|
+
);
|
|
277
|
+
|
|
278
|
+
// Shape: Array<[facetKey, value]> pairs — TracesViewer.readInitialUrlState.
|
|
279
|
+
expect(JSON.parse(params.get("filters") as string)).toEqual([
|
|
280
|
+
["primaryEntityId", SERVICE_ID_A],
|
|
281
|
+
]);
|
|
282
|
+
|
|
283
|
+
expect(params.get("range")).toBe("Custom");
|
|
284
|
+
expect(params.get("start")).toBe(EXPECTED_WINDOW_START);
|
|
285
|
+
expect(params.get("end")).toBe(EXPECTED_WINDOW_END);
|
|
286
|
+
|
|
287
|
+
expect(link!.dropped).toEqual([]);
|
|
288
|
+
});
|
|
289
|
+
|
|
290
|
+
test("attribute values the search DSL cannot carry become filter chips", () => {
|
|
291
|
+
const link: TelemetryExplorerDeepLink | null =
|
|
292
|
+
Evaluator.buildTracesExplorerDeepLink({
|
|
293
|
+
monitor: makeMonitor(ObjectID.generate()),
|
|
294
|
+
ctx: makeContext({
|
|
295
|
+
filterAttributes: { "cache.hit.ratio": "99%" },
|
|
296
|
+
seriesLabels: undefined,
|
|
297
|
+
}),
|
|
298
|
+
});
|
|
299
|
+
|
|
300
|
+
const params: URLSearchParams = getQueryParams(link!.url);
|
|
301
|
+
|
|
302
|
+
expect(params.get("search")).toBeNull();
|
|
303
|
+
expect(JSON.parse(params.get("filters") as string)).toEqual([
|
|
304
|
+
["attributes.cache.hit.ratio", "99%"],
|
|
305
|
+
]);
|
|
306
|
+
});
|
|
307
|
+
|
|
308
|
+
test("returns null when the monitor has no project id", () => {
|
|
309
|
+
expect(
|
|
310
|
+
Evaluator.buildTracesExplorerDeepLink({
|
|
311
|
+
monitor: makeMonitor(),
|
|
312
|
+
ctx: makeContext(),
|
|
313
|
+
}),
|
|
314
|
+
).toBeNull();
|
|
315
|
+
});
|
|
316
|
+
});
|
|
317
|
+
|
|
318
|
+
describe("MonitorCriteriaEvaluator - metric explorer deep link is unchanged", () => {
|
|
319
|
+
test("still builds the /metrics/view URL from metricQueries + startTime/endTime", () => {
|
|
320
|
+
const projectId: ObjectID = ObjectID.generate();
|
|
321
|
+
|
|
322
|
+
const url: string | null = Evaluator.buildMetricExplorerDeepLink({
|
|
323
|
+
monitor: makeMonitor(projectId),
|
|
324
|
+
ctx: makeContext(),
|
|
325
|
+
});
|
|
326
|
+
|
|
327
|
+
expect(url).not.toBeNull();
|
|
328
|
+
expect(
|
|
329
|
+
url!.startsWith(
|
|
330
|
+
`${DashboardClientUrl.toString()}/${projectId.toString()}/metrics/view?`,
|
|
331
|
+
),
|
|
332
|
+
).toBe(true);
|
|
333
|
+
|
|
334
|
+
const params: URLSearchParams = getQueryParams(url!);
|
|
335
|
+
|
|
336
|
+
/*
|
|
337
|
+
* The metric link keeps its historical scope: the criteria's
|
|
338
|
+
* filterAttributes with native types preserved (500 stays a number)
|
|
339
|
+
* and NO per-series labels, NO service scope, NO range token.
|
|
340
|
+
*/
|
|
341
|
+
expect(JSON.parse(params.get("metricQueries") as string)).toEqual([
|
|
342
|
+
{
|
|
343
|
+
metricName: "container.cpu.time",
|
|
344
|
+
attributes: {
|
|
345
|
+
"k8s.pod.name": "web-1",
|
|
346
|
+
"http.status_code": 500,
|
|
347
|
+
},
|
|
348
|
+
},
|
|
349
|
+
]);
|
|
350
|
+
|
|
351
|
+
expect(params.get("startTime")).toBe(EXPECTED_WINDOW_START);
|
|
352
|
+
expect(params.get("endTime")).toBe(EXPECTED_WINDOW_END);
|
|
353
|
+
expect(params.get("range")).toBeNull();
|
|
354
|
+
expect(params.get("filters")).toBeNull();
|
|
355
|
+
expect(params.get("search")).toBeNull();
|
|
356
|
+
});
|
|
357
|
+
|
|
358
|
+
test("still returns null without a project id", () => {
|
|
359
|
+
expect(
|
|
360
|
+
Evaluator.buildMetricExplorerDeepLink({
|
|
361
|
+
monitor: makeMonitor(),
|
|
362
|
+
ctx: makeContext(),
|
|
363
|
+
}),
|
|
364
|
+
).toBeNull();
|
|
365
|
+
});
|
|
366
|
+
});
|
|
367
|
+
|
|
368
|
+
describe("MonitorCriteriaEvaluator - root cause context carries all three links", () => {
|
|
369
|
+
function makeCriteriaInstance(
|
|
370
|
+
ctx: MetricCriteriaContext,
|
|
371
|
+
): MonitorCriteriaInstance {
|
|
372
|
+
const instance: MonitorCriteriaInstance = new MonitorCriteriaInstance();
|
|
373
|
+
instance.data!.filters = [
|
|
374
|
+
{
|
|
375
|
+
checkOn: CheckOn.MetricValue,
|
|
376
|
+
filterType: undefined,
|
|
377
|
+
value: undefined,
|
|
378
|
+
metricCriteriaContext: ctx,
|
|
379
|
+
},
|
|
380
|
+
];
|
|
381
|
+
return instance;
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
test("appends metric, logs and traces links in that order", () => {
|
|
385
|
+
const context: string | null = Evaluator.buildMetricRootCauseContext({
|
|
386
|
+
criteriaInstance: makeCriteriaInstance(makeContext()),
|
|
387
|
+
monitor: makeMonitor(ObjectID.generate()),
|
|
388
|
+
monitorStep: makeMetricMonitorStep([new ObjectID(SERVICE_ID_A)]),
|
|
389
|
+
});
|
|
390
|
+
|
|
391
|
+
expect(context).not.toBeNull();
|
|
392
|
+
expect(context).toContain("[Open metric in dashboard](");
|
|
393
|
+
expect(context).toContain("[Open logs in dashboard](");
|
|
394
|
+
expect(context).toContain("[Open traces in dashboard](");
|
|
395
|
+
|
|
396
|
+
const metricIndex: number = context!.indexOf("[Open metric in dashboard](");
|
|
397
|
+
const logsIndex: number = context!.indexOf("[Open logs in dashboard](");
|
|
398
|
+
const tracesIndex: number = context!.indexOf("[Open traces in dashboard](");
|
|
399
|
+
|
|
400
|
+
expect(metricIndex).toBeGreaterThan(-1);
|
|
401
|
+
expect(logsIndex).toBeGreaterThan(metricIndex);
|
|
402
|
+
expect(tracesIndex).toBeGreaterThan(logsIndex);
|
|
403
|
+
|
|
404
|
+
// The evaluator-derived scope carries fully, so no partial-scope hint.
|
|
405
|
+
expect(context).not.toContain("scope partially carried");
|
|
406
|
+
});
|
|
407
|
+
|
|
408
|
+
test("still emits sibling links when no monitor step is passed (backward compatible)", () => {
|
|
409
|
+
const context: string | null = Evaluator.buildMetricRootCauseContext({
|
|
410
|
+
criteriaInstance: makeCriteriaInstance(makeContext()),
|
|
411
|
+
monitor: makeMonitor(ObjectID.generate()),
|
|
412
|
+
});
|
|
413
|
+
|
|
414
|
+
expect(context).toContain("[Open metric in dashboard](");
|
|
415
|
+
expect(context).toContain("[Open logs in dashboard](");
|
|
416
|
+
expect(context).toContain("[Open traces in dashboard](");
|
|
417
|
+
});
|
|
418
|
+
|
|
419
|
+
test("emits no links at all when the monitor has no project id", () => {
|
|
420
|
+
const context: string | null = Evaluator.buildMetricRootCauseContext({
|
|
421
|
+
criteriaInstance: makeCriteriaInstance(makeContext()),
|
|
422
|
+
monitor: makeMonitor(),
|
|
423
|
+
});
|
|
424
|
+
|
|
425
|
+
expect(context).not.toBeNull();
|
|
426
|
+
expect(context).not.toContain("[Open metric in dashboard](");
|
|
427
|
+
expect(context).not.toContain("[Open logs in dashboard](");
|
|
428
|
+
expect(context).not.toContain("[Open traces in dashboard](");
|
|
429
|
+
});
|
|
430
|
+
|
|
431
|
+
test("returns null when no filter carries a metric context", () => {
|
|
432
|
+
const instance: MonitorCriteriaInstance = new MonitorCriteriaInstance();
|
|
433
|
+
instance.data!.filters = [
|
|
434
|
+
{
|
|
435
|
+
checkOn: CheckOn.MetricValue,
|
|
436
|
+
filterType: undefined,
|
|
437
|
+
value: undefined,
|
|
438
|
+
},
|
|
439
|
+
];
|
|
440
|
+
|
|
441
|
+
expect(
|
|
442
|
+
Evaluator.buildMetricRootCauseContext({
|
|
443
|
+
criteriaInstance: instance,
|
|
444
|
+
monitor: makeMonitor(ObjectID.generate()),
|
|
445
|
+
}),
|
|
446
|
+
).toBeNull();
|
|
447
|
+
});
|
|
448
|
+
});
|
|
449
|
+
|
|
450
|
+
describe("MonitorCriteriaEvaluator - partial-scope hint formatting", () => {
|
|
451
|
+
test("renders nothing when the scope carried fully", () => {
|
|
452
|
+
expect(Evaluator.formatScopeDroppedHint([])).toBe("");
|
|
453
|
+
});
|
|
454
|
+
|
|
455
|
+
test("names the fields that were not applied", () => {
|
|
456
|
+
expect(Evaluator.formatScopeDroppedHint(["severityTexts", "spanIds"])).toBe(
|
|
457
|
+
" _(scope partially carried — not applied: severityTexts, spanIds)_",
|
|
458
|
+
);
|
|
459
|
+
});
|
|
460
|
+
});
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { beforeEach, describe, expect, test } from "@jest/globals";
|
|
2
|
+
import { ExpressRequest, ExpressResponse } from "../../../Server/Utils/Express";
|
|
3
|
+
import ResponseUtil from "../../../Server/Utils/Response";
|
|
4
|
+
import ExceptionCode from "../../../Types/Exception/ExceptionCode";
|
|
5
|
+
import ServiceUnavailableException from "../../../Types/Exception/ServiceUnavailableException";
|
|
6
|
+
import TooManyRequestsException from "../../../Types/Exception/TooManyRequestsException";
|
|
7
|
+
import BadDataException from "../../../Types/Exception/BadDataException";
|
|
8
|
+
|
|
9
|
+
/*
|
|
10
|
+
* The public dashboard rate limiter answers by handing an exception to
|
|
11
|
+
* Response.sendErrorResponse, which turns `error.code` into the HTTP status.
|
|
12
|
+
* That indirection is the whole reason these two exception types exist, and it
|
|
13
|
+
* is where a refusal would silently degrade: an exception whose code is not a
|
|
14
|
+
* real status falls back to 500, and a client that sees 500 retries as if the
|
|
15
|
+
* server were broken instead of backing off.
|
|
16
|
+
*
|
|
17
|
+
* These tests pin the codes to the wire, not just to the constructor.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
interface CapturedResponse {
|
|
21
|
+
statusCode: number | null;
|
|
22
|
+
body: unknown;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
describe("rate limit responses on the wire", () => {
|
|
26
|
+
let captured: CapturedResponse;
|
|
27
|
+
let response: ExpressResponse;
|
|
28
|
+
let request: ExpressRequest;
|
|
29
|
+
|
|
30
|
+
beforeEach(() => {
|
|
31
|
+
captured = { statusCode: null, body: undefined };
|
|
32
|
+
|
|
33
|
+
response = {
|
|
34
|
+
status: (code: number): ExpressResponse => {
|
|
35
|
+
captured.statusCode = code;
|
|
36
|
+
return response;
|
|
37
|
+
},
|
|
38
|
+
send: (body: unknown): void => {
|
|
39
|
+
captured.body = body;
|
|
40
|
+
},
|
|
41
|
+
} as unknown as ExpressResponse;
|
|
42
|
+
|
|
43
|
+
request = {
|
|
44
|
+
headers: {},
|
|
45
|
+
socket: {},
|
|
46
|
+
} as unknown as ExpressRequest;
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
describe("TooManyRequestsException", () => {
|
|
50
|
+
test("carries 429", () => {
|
|
51
|
+
expect(new TooManyRequestsException("slow down").code).toBe(429);
|
|
52
|
+
expect(new TooManyRequestsException("slow down").code).toBe(
|
|
53
|
+
ExceptionCode.TooManyRequestsException,
|
|
54
|
+
);
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
test("keeps its message", () => {
|
|
58
|
+
expect(new TooManyRequestsException("slow down").message).toBe(
|
|
59
|
+
"slow down",
|
|
60
|
+
);
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
test("reaches the client as 429, not as a 500", () => {
|
|
64
|
+
ResponseUtil.sendErrorResponse(
|
|
65
|
+
request,
|
|
66
|
+
response,
|
|
67
|
+
new TooManyRequestsException(
|
|
68
|
+
"Too many requests. Please try again later.",
|
|
69
|
+
),
|
|
70
|
+
);
|
|
71
|
+
|
|
72
|
+
expect(captured.statusCode).toBe(429);
|
|
73
|
+
expect(captured.body).toEqual({
|
|
74
|
+
message: "Too many requests. Please try again later.",
|
|
75
|
+
});
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
describe("ServiceUnavailableException", () => {
|
|
80
|
+
test("carries 503", () => {
|
|
81
|
+
expect(new ServiceUnavailableException("try later").code).toBe(503);
|
|
82
|
+
expect(new ServiceUnavailableException("try later").code).toBe(
|
|
83
|
+
ExceptionCode.ServiceUnavailableException,
|
|
84
|
+
);
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
test("reaches the client as 503, not as a 500", () => {
|
|
88
|
+
ResponseUtil.sendErrorResponse(
|
|
89
|
+
request,
|
|
90
|
+
response,
|
|
91
|
+
new ServiceUnavailableException("Unable to verify the password."),
|
|
92
|
+
);
|
|
93
|
+
|
|
94
|
+
expect(captured.statusCode).toBe(503);
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
/*
|
|
98
|
+
* 503 rather than 500 matters: a viewer whose password attempt was refused
|
|
99
|
+
* because the counter was unreachable should be told to retry, not shown a
|
|
100
|
+
* server error that reads as "this dashboard is broken".
|
|
101
|
+
*/
|
|
102
|
+
test("is distinguishable from a server error", () => {
|
|
103
|
+
expect(ExceptionCode.ServiceUnavailableException).not.toBe(
|
|
104
|
+
ExceptionCode.ServerException,
|
|
105
|
+
);
|
|
106
|
+
});
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
describe("exception code table", () => {
|
|
110
|
+
test("does not collide the new codes with existing ones", () => {
|
|
111
|
+
const codes: Array<number> = Object.values(ExceptionCode).filter(
|
|
112
|
+
(value: unknown): value is number => {
|
|
113
|
+
return typeof value === "number";
|
|
114
|
+
},
|
|
115
|
+
);
|
|
116
|
+
|
|
117
|
+
expect(
|
|
118
|
+
codes.filter((code: number) => {
|
|
119
|
+
return code === 429;
|
|
120
|
+
}),
|
|
121
|
+
).toHaveLength(1);
|
|
122
|
+
|
|
123
|
+
expect(
|
|
124
|
+
codes.filter((code: number) => {
|
|
125
|
+
return code === 503;
|
|
126
|
+
}),
|
|
127
|
+
).toHaveLength(1);
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
/* The pre-existing mapping still holds, so nothing was shifted. */
|
|
131
|
+
test("leaves the existing codes alone", () => {
|
|
132
|
+
expect(new BadDataException("bad").code).toBe(400);
|
|
133
|
+
expect(ExceptionCode.NotFoundException).toBe(404);
|
|
134
|
+
expect(ExceptionCode.ServerException).toBe(500);
|
|
135
|
+
});
|
|
136
|
+
});
|
|
137
|
+
});
|
|
@@ -64,6 +64,25 @@ describe("SSRFProtection — IPv4-mapped and IPv4-embedding IPv6", () => {
|
|
|
64
64
|
["metadata, IPv4-compatible", "http://[::169.254.169.254]/"],
|
|
65
65
|
["metadata via NAT64 prefix", "http://[64:ff9b::169.254.169.254]/"],
|
|
66
66
|
["loopback via NAT64 prefix", "http://[64:ff9b::127.0.0.1]/"],
|
|
67
|
+
["metadata via 6to4", "http://[2002:a9fe:a9fe::]/"],
|
|
68
|
+
["loopback via 6to4", "http://[2002:7f00:0001::]/"],
|
|
69
|
+
["RFC-1918 via 6to4", "http://[2002:0a00:0001::]/"],
|
|
70
|
+
[
|
|
71
|
+
"metadata via Teredo",
|
|
72
|
+
"http://[2001:0000:4136:e378:8000:63bf:5601:5601]/",
|
|
73
|
+
],
|
|
74
|
+
[
|
|
75
|
+
"loopback via Teredo",
|
|
76
|
+
"http://[2001:0000:4136:e378:8000:63bf:80ff:fffe]/",
|
|
77
|
+
],
|
|
78
|
+
[
|
|
79
|
+
"RFC-1918 via Teredo",
|
|
80
|
+
"http://[2001:0000:4136:e378:8000:63bf:f5ff:fffe]/",
|
|
81
|
+
],
|
|
82
|
+
[
|
|
83
|
+
"loopback Teredo server with public client",
|
|
84
|
+
"http://[2001:0000:7f00:0001:8000:63bf:f7f7:f7f7]/",
|
|
85
|
+
],
|
|
67
86
|
];
|
|
68
87
|
|
|
69
88
|
test.each(blocked)("blocks %s", async (_label: string, url: string) => {
|
|
@@ -75,6 +94,11 @@ describe("SSRFProtection — IPv4-mapped and IPv4-embedding IPv6", () => {
|
|
|
75
94
|
const allowed: Array<[string, string]> = [
|
|
76
95
|
["a public address, IPv4-mapped", "http://[::ffff:8.8.8.8]/"],
|
|
77
96
|
["a public address via NAT64", "http://[64:ff9b::8.8.8.8]/"],
|
|
97
|
+
["a public address via 6to4", "http://[2002:0808:0808::]/"],
|
|
98
|
+
[
|
|
99
|
+
"a public address via Teredo",
|
|
100
|
+
"http://[2001:0000:4136:e378:8000:63bf:f7f7:f7f7]/",
|
|
101
|
+
],
|
|
78
102
|
];
|
|
79
103
|
|
|
80
104
|
test.each(allowed)("allows %s", async (_label: string, url: string) => {
|
|
@@ -195,12 +219,19 @@ describe("SSRFProtection — IPv4 ranges", () => {
|
|
|
195
219
|
});
|
|
196
220
|
});
|
|
197
221
|
|
|
198
|
-
describe("SSRFProtection — alternate IPv4 notations
|
|
222
|
+
describe("SSRFProtection — alternate IPv4 notations are decoded, not delegated", () => {
|
|
199
223
|
/*
|
|
200
|
-
* net.isIP rejects these, so
|
|
201
|
-
*
|
|
202
|
-
*
|
|
203
|
-
*
|
|
224
|
+
* net.isIP rejects all of these, so our own parser does not see a literal.
|
|
225
|
+
* WHATWG does: it decodes decimal, octal, hex and short-form IPv4 per the URL
|
|
226
|
+
* spec, and since the guard checks the host WHATWG names as well as our own,
|
|
227
|
+
* the address is judged directly.
|
|
228
|
+
*
|
|
229
|
+
* This used to be delegated to getaddrinfo instead - "not a literal" meant
|
|
230
|
+
* "send it to DNS and check the answer". That worked only where the platform
|
|
231
|
+
* resolver happened to decode the same notations, and macOS does not decode
|
|
232
|
+
* octal: "http://0177.0.0.1/" resolved to the public 177.0.0.1 and was
|
|
233
|
+
* ALLOWED, while axios connected to 127.0.0.1. Deciding it from the URL is
|
|
234
|
+
* both stricter and the same everywhere.
|
|
204
235
|
*/
|
|
205
236
|
const notations: Array<[string, string]> = [
|
|
206
237
|
["decimal", "http://2852039166/"],
|
|
@@ -210,11 +241,12 @@ describe("SSRFProtection — alternate IPv4 notations resolve before they are ju
|
|
|
210
241
|
];
|
|
211
242
|
|
|
212
243
|
test.each(notations)(
|
|
213
|
-
"blocks %s notation
|
|
244
|
+
"blocks %s notation without asking DNS",
|
|
214
245
|
async (_label: string, url: string) => {
|
|
215
|
-
|
|
246
|
+
// A resolver that answers "public" must not be able to rescue these.
|
|
247
|
+
lookupSpy.mockResolvedValue([{ address: "93.184.216.34", family: 4 }]);
|
|
216
248
|
expect(await isBlocked(url)).toBe(true);
|
|
217
|
-
expect(lookupSpy).toHaveBeenCalled();
|
|
249
|
+
expect(lookupSpy).not.toHaveBeenCalled();
|
|
218
250
|
},
|
|
219
251
|
);
|
|
220
252
|
});
|