@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
|
@@ -18,11 +18,12 @@ import CodeEditor from "../CodeEditor/CodeEditor";
|
|
|
18
18
|
import ComponentLoader from "../ComponentLoader/ComponentLoader";
|
|
19
19
|
import DictionaryForm, { ValueType } from "../Dictionary/Dictionary";
|
|
20
20
|
import Icon from "../Icon/Icon";
|
|
21
|
-
import { findColumn, useModelSchema, } from "./ModelSchema";
|
|
21
|
+
import { findColumn, requiredWritableColumns, useModelSchema, } from "./ModelSchema";
|
|
22
22
|
import CodeType from "../../../Types/Code/CodeType";
|
|
23
23
|
import IconProp from "../../../Types/Icon/IconProp";
|
|
24
24
|
import { ObjectType } from "../../../Types/JSON";
|
|
25
|
-
import
|
|
25
|
+
import { maskTemplateExpressions } from "../../../Types/Workflow/TemplateSyntax";
|
|
26
|
+
import React, { useMemo, useState, } from "react";
|
|
26
27
|
export var ModelColumnEditorMode;
|
|
27
28
|
(function (ModelColumnEditorMode) {
|
|
28
29
|
/** Conditions that select records: column, operator, value. */
|
|
@@ -51,25 +52,52 @@ const REPRESENTABLE_OPERATOR_TYPES = [
|
|
|
51
52
|
ObjectType.Includes,
|
|
52
53
|
ObjectType.IncludesNone,
|
|
53
54
|
];
|
|
54
|
-
const
|
|
55
|
+
const isJSONObject = (value) => {
|
|
56
|
+
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
57
|
+
};
|
|
58
|
+
export const normalizeInitialValue = (value) => {
|
|
55
59
|
if (value === null || value === undefined || value === "") {
|
|
56
|
-
return { text: "", parsed: {} };
|
|
60
|
+
return { text: "", parsed: {}, hasTemplateExpressions: false };
|
|
57
61
|
}
|
|
58
62
|
if (typeof value === "object" && !Array.isArray(value)) {
|
|
59
|
-
return {
|
|
63
|
+
return {
|
|
64
|
+
text: JSON.stringify(value, null, 2),
|
|
65
|
+
parsed: value,
|
|
66
|
+
hasTemplateExpressions: false,
|
|
67
|
+
};
|
|
60
68
|
}
|
|
61
69
|
if (typeof value !== "string") {
|
|
62
|
-
return { text: String(value), parsed: null };
|
|
70
|
+
return { text: String(value), parsed: null, hasTemplateExpressions: false };
|
|
63
71
|
}
|
|
64
72
|
try {
|
|
65
73
|
const parsed = JSON.parse(value);
|
|
66
|
-
if (
|
|
67
|
-
return {
|
|
74
|
+
if (isJSONObject(parsed)) {
|
|
75
|
+
return {
|
|
76
|
+
text: value,
|
|
77
|
+
parsed: parsed,
|
|
78
|
+
hasTemplateExpressions: false,
|
|
79
|
+
};
|
|
68
80
|
}
|
|
69
|
-
return { text: value, parsed: null };
|
|
81
|
+
return { text: value, parsed: null, hasTemplateExpressions: false };
|
|
70
82
|
}
|
|
71
83
|
catch (_a) {
|
|
72
|
-
|
|
84
|
+
/*
|
|
85
|
+
* Same masking TemplateSyntax.checkJSONSyntax does, so this editor and the
|
|
86
|
+
* linter agree on which values are broken and which merely hold a
|
|
87
|
+
* reference.
|
|
88
|
+
*/
|
|
89
|
+
const masked = maskTemplateExpressions(value);
|
|
90
|
+
if (masked !== value) {
|
|
91
|
+
try {
|
|
92
|
+
if (isJSONObject(JSON.parse(masked))) {
|
|
93
|
+
return { text: value, parsed: null, hasTemplateExpressions: true };
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
catch (_b) {
|
|
97
|
+
// Still not JSON once the references are out of the way — genuinely broken.
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
return { text: value, parsed: null, hasTemplateExpressions: false };
|
|
73
101
|
}
|
|
74
102
|
};
|
|
75
103
|
/**
|
|
@@ -79,11 +107,15 @@ const normalizeInitialValue = (value) => {
|
|
|
79
107
|
* value silently rewritten into something that means something else is far
|
|
80
108
|
* worse than one the builder has to keep editing as text.
|
|
81
109
|
*/
|
|
82
|
-
export const classifyColumnValueCompatibility = (parsed, columns, mode) => {
|
|
110
|
+
export const classifyColumnValueCompatibility = (parsed, columns, mode, hasTemplateExpressions) => {
|
|
83
111
|
if (parsed === null) {
|
|
84
112
|
return {
|
|
85
113
|
compatible: false,
|
|
86
|
-
reasons: [
|
|
114
|
+
reasons: [
|
|
115
|
+
hasTemplateExpressions
|
|
116
|
+
? "This value uses a {{ }} reference where a value goes, which the rows can't show. It stays as JSON."
|
|
117
|
+
: "The current value isn't a JSON object.",
|
|
118
|
+
],
|
|
87
119
|
};
|
|
88
120
|
}
|
|
89
121
|
const reasons = [];
|
|
@@ -107,7 +139,14 @@ export const classifyColumnValueCompatibility = (parsed, columns, mode) => {
|
|
|
107
139
|
continue;
|
|
108
140
|
}
|
|
109
141
|
if (Array.isArray(value)) {
|
|
110
|
-
|
|
142
|
+
/*
|
|
143
|
+
* The "is any of" advice is Query-only: Record mode renders with
|
|
144
|
+
* enableOperators={false}, so it was telling half its readers to reach
|
|
145
|
+
* for a control that is not on their screen.
|
|
146
|
+
*/
|
|
147
|
+
reasons.push(mode === ModelColumnEditorMode.Query
|
|
148
|
+
? `"${key}" holds a list. Use the "is any of" operator instead, or keep editing as JSON.`
|
|
149
|
+
: `"${key}" holds a list, which the rows can't show. Keep editing as JSON.`);
|
|
111
150
|
continue;
|
|
112
151
|
}
|
|
113
152
|
if (typeof value === "object") {
|
|
@@ -140,13 +179,23 @@ export const classifyColumnValueCompatibility = (parsed, columns, mode) => {
|
|
|
140
179
|
*
|
|
141
180
|
* Empty collapses to "" rather than "{}" so a required argument still reads as
|
|
142
181
|
* empty to form validation and to the graph linter.
|
|
182
|
+
*
|
|
183
|
+
* In Record mode a row with no value is dropped. The record editor opens with a
|
|
184
|
+
* blank row for every column a create must be given, and those rows serialize
|
|
185
|
+
* to `""` — a non-empty string, which both validateRequired and
|
|
186
|
+
* isEmptyArgumentValue read as "filled in". Keeping them would make an
|
|
187
|
+
* untouched Create One look complete and let it save. Query mode keeps them,
|
|
188
|
+
* because matching a column against "" is a real condition.
|
|
143
189
|
*/
|
|
144
|
-
export const buildColumnValueJson = (value) => {
|
|
190
|
+
export const buildColumnValueJson = (value, mode) => {
|
|
145
191
|
const entries = {};
|
|
146
192
|
for (const key of Object.keys(value)) {
|
|
147
193
|
if (key.trim() === "") {
|
|
148
194
|
continue;
|
|
149
195
|
}
|
|
196
|
+
if (mode === ModelColumnEditorMode.Record && value[key] === "") {
|
|
197
|
+
continue;
|
|
198
|
+
}
|
|
150
199
|
entries[key] = value[key];
|
|
151
200
|
}
|
|
152
201
|
if (Object.keys(entries).length === 0) {
|
|
@@ -160,8 +209,16 @@ export const buildColumnValueJson = (value) => {
|
|
|
160
209
|
return JSON.stringify(entries);
|
|
161
210
|
};
|
|
162
211
|
const ModelColumnEditor = (props) => {
|
|
163
|
-
const schema = useModelSchema(props.tableName);
|
|
164
212
|
const isQuery = props.mode === ModelColumnEditorMode.Query;
|
|
213
|
+
/*
|
|
214
|
+
* A query names columns to filter on, so it wants the read gate. A record
|
|
215
|
+
* names columns to write, and the two lists genuinely differ: a write-only
|
|
216
|
+
* column (MonitorSecret.secretValue declares `read: []`) is absent from the
|
|
217
|
+
* read list, and asking for it under the read gate would leave the one column
|
|
218
|
+
* Create One Monitor Secret exists to write out of its own editor.
|
|
219
|
+
*/
|
|
220
|
+
const access = isQuery ? "read" : "write";
|
|
221
|
+
const schema = useModelSchema(props.tableName, access);
|
|
165
222
|
const initial = useMemo(() => {
|
|
166
223
|
return normalizeInitialValue(props.initialValue);
|
|
167
224
|
}, []);
|
|
@@ -169,11 +226,47 @@ const ModelColumnEditor = (props) => {
|
|
|
169
226
|
const [viewMode, setViewMode] = useState("builder");
|
|
170
227
|
/*
|
|
171
228
|
* The row editor is uncontrolled after mount (DictionaryForm seeds itself
|
|
172
|
-
* once), so
|
|
229
|
+
* once), so this is computed rather than held in state. It only has to be
|
|
230
|
+
* right on the render that first mounts DictionaryForm, which is the first
|
|
231
|
+
* render after the schema resolves — the loader below returns early until
|
|
232
|
+
* then.
|
|
233
|
+
*
|
|
234
|
+
* Record mode opens with a blank row for every column a create must be given
|
|
235
|
+
* a value for. Seeding is additive and never overwrites what was stored, and
|
|
236
|
+
* blank rows are dropped on the way back out (buildColumnValueJson), so
|
|
237
|
+
* opening a saved workflow and saving it again cannot change what it does.
|
|
238
|
+
*/
|
|
239
|
+
const initialRows = useMemo(() => {
|
|
240
|
+
const stored = (initial.parsed ||
|
|
241
|
+
{});
|
|
242
|
+
if (isQuery || !schema.columns) {
|
|
243
|
+
return stored;
|
|
244
|
+
}
|
|
245
|
+
const seeded = Object.assign({}, stored);
|
|
246
|
+
for (const column of requiredWritableColumns(schema.columns)) {
|
|
247
|
+
if (seeded[column.id] === undefined) {
|
|
248
|
+
seeded[column.id] = "";
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
return seeded;
|
|
252
|
+
}, [schema.columns, isQuery]);
|
|
253
|
+
/*
|
|
254
|
+
* The model's own example for each column, shown in the row it belongs to.
|
|
255
|
+
* MonitorSecret.secretValue ships example: "sk_test_1234567890abcdefghijklmnop",
|
|
256
|
+
* which answers "what goes in this box" better than any prose in the sidebar.
|
|
173
257
|
*/
|
|
174
|
-
const
|
|
258
|
+
const valuePlaceholders = useMemo(() => {
|
|
259
|
+
const placeholders = {};
|
|
260
|
+
for (const column of schema.columns || []) {
|
|
261
|
+
const hint = column.example || column.placeholder;
|
|
262
|
+
if (hint) {
|
|
263
|
+
placeholders[column.id] = hint;
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
return placeholders;
|
|
267
|
+
}, [schema.columns]);
|
|
175
268
|
const compatibility = useMemo(() => {
|
|
176
|
-
return classifyColumnValueCompatibility(initial.parsed, schema.columns || [], props.mode);
|
|
269
|
+
return classifyColumnValueCompatibility(initial.parsed, schema.columns || [], props.mode, initial.hasTemplateExpressions);
|
|
177
270
|
}, [schema.columns, props.mode]);
|
|
178
271
|
const columnKeys = useMemo(() => {
|
|
179
272
|
return (schema.columns || []).map((column) => {
|
|
@@ -190,7 +283,7 @@ const ModelColumnEditor = (props) => {
|
|
|
190
283
|
props.onChange(value);
|
|
191
284
|
};
|
|
192
285
|
const onRowsChange = (value) => {
|
|
193
|
-
const asJson = buildColumnValueJson(value);
|
|
286
|
+
const asJson = buildColumnValueJson(value, props.mode);
|
|
194
287
|
setJsonText(asJson);
|
|
195
288
|
props.onChange(asJson);
|
|
196
289
|
};
|
|
@@ -198,7 +291,9 @@ const ModelColumnEditor = (props) => {
|
|
|
198
291
|
schema.error && (React.createElement("p", { className: "text-sm text-amber-600 mb-2" },
|
|
199
292
|
"Couldn't load this model's columns (",
|
|
200
293
|
schema.error,
|
|
201
|
-
"). You can still write
|
|
294
|
+
"). You can still write ",
|
|
295
|
+
isQuery ? "the query" : "these fields",
|
|
296
|
+
" as JSON.")),
|
|
202
297
|
isLockedToJson && compatibility.reasons.length > 0 && (React.createElement("div", { className: "mb-2 rounded-md border border-amber-200 bg-amber-50 p-3" },
|
|
203
298
|
React.createElement("p", { className: "text-sm text-amber-800" }, "Editing as JSON, because:"),
|
|
204
299
|
React.createElement("ul", { className: "mt-1 list-disc pl-5 text-sm text-amber-700" }, compatibility.reasons.map((reason, i) => {
|
|
@@ -208,7 +303,7 @@ const ModelColumnEditor = (props) => {
|
|
|
208
303
|
React.createElement("ul", { className: "list-disc pl-5 text-sm text-amber-700" }, compatibility.reasons.map((reason, i) => {
|
|
209
304
|
return React.createElement("li", { key: i }, reason);
|
|
210
305
|
})))),
|
|
211
|
-
effectiveMode === "builder" ? (React.createElement(DictionaryForm, { keys: columnKeys, enableOperators: isQuery, valueTypes: [ValueType.Text, ValueType.Number, ValueType.Boolean], addButtonSuffix: isQuery ? "condition" : "field", keyPlaceholder: "Column", valuePlaceholder: "Value", initialValue: initialRows
|
|
306
|
+
effectiveMode === "builder" ? (React.createElement(DictionaryForm, { keys: columnKeys, enableOperators: isQuery, valueTypes: [ValueType.Text, ValueType.Number, ValueType.Boolean], addButtonSuffix: isQuery ? "condition" : "field", keyPlaceholder: "Column", valuePlaceholder: "Value", valuePlaceholders: valuePlaceholders, defaultValueSuggestions: props.valueSuggestions, initialValue: initialRows, onChange: onRowsChange })) : (React.createElement(CodeEditor, { type: CodeType.JSON, tabIndex: props.tabIndex, error: props.error, initialValue: initial.text, value: jsonText, placeholder: props.placeholder, onChange: onJsonChange })),
|
|
212
307
|
!isLockedToJson && (React.createElement("div", { className: "mt-2" },
|
|
213
308
|
React.createElement("button", { type: "button", className: "text-sm underline text-blue-500 hover:text-blue-600 cursor-pointer inline-flex items-center gap-1", onClick: () => {
|
|
214
309
|
setViewMode(effectiveMode === "builder" ? "json" : "builder");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModelColumnEditor.js","sourceRoot":"","sources":["../../../../../UI/Components/Workflow/ModelColumnEditor.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAClD,OAAO,eAAe,MAAM,oCAAoC,CAAC;AACjE,OAAO,cAAc,EAAE,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAErE,OAAO,IAAI,MAAM,cAAc,CAAC;AAChC,OAAO,
|
|
1
|
+
{"version":3,"file":"ModelColumnEditor.js","sourceRoot":"","sources":["../../../../../UI/Components/Workflow/ModelColumnEditor.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAClD,OAAO,eAAe,MAAM,oCAAoC,CAAC;AACjE,OAAO,cAAc,EAAE,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAErE,OAAO,IAAI,MAAM,cAAc,CAAC;AAChC,OAAO,EAIL,UAAU,EACV,uBAAuB,EACvB,cAAc,GACf,MAAM,eAAe,CAAC;AACvB,OAAO,QAAQ,MAAM,8BAA8B,CAAC;AAEpD,OAAO,QAAQ,MAAM,8BAA8B,CAAC;AACpD,OAAO,EAAc,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAC7D,O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;gBAChE,CAAC;gBAED,oBAAC,IAAI,IAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,EAAE,SAAS,EAAC,aAAa,GAAG;gBACpD,aAAa,KAAK,SAAS;oBAC1B,CAAC,CAAC,cAAc;oBAChB,CAAC,CAAC,OAAO;wBACP,CAAC,CAAC,oBAAoB;wBACtB,CAAC,CAAC,gBAAgB,CACf,CACL,CACP;QAEA,KAAK,CAAC,KAAK,IAAI,aAAa,KAAK,SAAS,IAAI,CAC7C,2BAAG,SAAS,EAAC,2BAA2B,IAAE,KAAK,CAAC,KAAK,CAAK,CAC3D,CACG,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
|
|
@@ -8,11 +8,19 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import HTTPErrorResponse from "../../../Types/API/HTTPErrorResponse";
|
|
10
10
|
import URL from "../../../Types/API/URL";
|
|
11
|
+
import TableColumnType from "../../../Types/Database/TableColumnType";
|
|
11
12
|
import { WORKFLOW_URL } from "../../Config";
|
|
12
13
|
import API from "../../Utils/API/API";
|
|
13
14
|
import { useEffect, useState } from "react";
|
|
14
|
-
export const fetchModelSchema = async (tableName) => {
|
|
15
|
+
export const fetchModelSchema = async (tableName, access = "read") => {
|
|
15
16
|
const url = URL.fromString(WORKFLOW_URL.toString()).addRoute(`/model-schema/${encodeURIComponent(tableName)}`);
|
|
17
|
+
/*
|
|
18
|
+
* Only sent when it is not the default, so the read requests the field picker
|
|
19
|
+
* and query builder make keep the exact URL they had.
|
|
20
|
+
*/
|
|
21
|
+
if (access === "write") {
|
|
22
|
+
url.addQueryParam("access", "write");
|
|
23
|
+
}
|
|
16
24
|
const result = await API.get({ url });
|
|
17
25
|
if (result instanceof HTTPErrorResponse) {
|
|
18
26
|
throw result;
|
|
@@ -27,7 +35,7 @@ export const fetchModelSchema = async (tableName) => {
|
|
|
27
35
|
* message in `error`, so a caller can fall back to its JSON editor rather than
|
|
28
36
|
* showing the builder a blank panel.
|
|
29
37
|
*/
|
|
30
|
-
export const useModelSchema = (tableName) => {
|
|
38
|
+
export const useModelSchema = (tableName, access = "read") => {
|
|
31
39
|
const [columns, setColumns] = useState(null);
|
|
32
40
|
const [isLoading, setIsLoading] = useState(Boolean(tableName));
|
|
33
41
|
const [error, setError] = useState(null);
|
|
@@ -42,7 +50,7 @@ export const useModelSchema = (tableName) => {
|
|
|
42
50
|
setIsLoading(true);
|
|
43
51
|
setError(null);
|
|
44
52
|
try {
|
|
45
|
-
const loaded = await fetchModelSchema(tableName);
|
|
53
|
+
const loaded = await fetchModelSchema(tableName, access);
|
|
46
54
|
if (cancelled) {
|
|
47
55
|
return;
|
|
48
56
|
}
|
|
@@ -65,50 +73,80 @@ export const useModelSchema = (tableName) => {
|
|
|
65
73
|
return () => {
|
|
66
74
|
cancelled = true;
|
|
67
75
|
};
|
|
68
|
-
|
|
76
|
+
// Re-fetches when the gate changes: the two access modes return different columns.
|
|
77
|
+
}, [tableName, access]);
|
|
69
78
|
return { columns: columns, isLoading: isLoading, error: error };
|
|
70
79
|
};
|
|
71
80
|
/*
|
|
72
81
|
* Column types that hold a single scalar the builder can sensibly type into a
|
|
73
|
-
* box. Everything else (relations, JSON blobs, buffers) needs
|
|
82
|
+
* box. Everything else (relations, JSON blobs, buffers, monitor steps) needs
|
|
83
|
+
* the JSON editor.
|
|
84
|
+
*
|
|
85
|
+
* These are spelled with the enum, not with string literals, because the wire
|
|
86
|
+
* carries the enum's *values* and several of them differ from the member name
|
|
87
|
+
* that reads like the obvious literal: ShortText is "Text", ObjectID is
|
|
88
|
+
* "Object ID", PositiveNumber is "Positive Number", LongURL is "URL". Written
|
|
89
|
+
* out by hand this list silently classified the two most-declared non-relation
|
|
90
|
+
* types as non-scalar, and the tests that covered it pinned the same mistake.
|
|
74
91
|
*/
|
|
75
92
|
const SCALAR_COLUMN_TYPES = [
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
93
|
+
TableColumnType.ShortText,
|
|
94
|
+
TableColumnType.LongText,
|
|
95
|
+
TableColumnType.VeryLongText,
|
|
96
|
+
TableColumnType.Slug,
|
|
97
|
+
TableColumnType.Email,
|
|
98
|
+
TableColumnType.Phone,
|
|
99
|
+
TableColumnType.Color,
|
|
100
|
+
TableColumnType.Domain,
|
|
101
|
+
TableColumnType.Name,
|
|
102
|
+
TableColumnType.Description,
|
|
103
|
+
TableColumnType.ObjectID,
|
|
104
|
+
TableColumnType.Number,
|
|
105
|
+
TableColumnType.SmallNumber,
|
|
106
|
+
TableColumnType.BigNumber,
|
|
107
|
+
TableColumnType.PositiveNumber,
|
|
108
|
+
TableColumnType.SmallPositiveNumber,
|
|
109
|
+
TableColumnType.BigPositiveNumber,
|
|
110
|
+
TableColumnType.Boolean,
|
|
111
|
+
TableColumnType.Date,
|
|
112
|
+
TableColumnType.Password,
|
|
113
|
+
TableColumnType.HashedString,
|
|
114
|
+
TableColumnType.Port,
|
|
115
|
+
TableColumnType.LongURL,
|
|
116
|
+
TableColumnType.ShortURL,
|
|
117
|
+
TableColumnType.IP,
|
|
118
|
+
TableColumnType.Version,
|
|
119
|
+
TableColumnType.Markdown,
|
|
120
|
+
TableColumnType.HTML,
|
|
121
|
+
TableColumnType.JavaScript,
|
|
122
|
+
TableColumnType.CSS,
|
|
123
|
+
TableColumnType.OTP,
|
|
124
|
+
];
|
|
125
|
+
const NUMERIC_COLUMN_TYPES = [
|
|
126
|
+
TableColumnType.Number,
|
|
127
|
+
TableColumnType.SmallNumber,
|
|
128
|
+
TableColumnType.BigNumber,
|
|
129
|
+
TableColumnType.PositiveNumber,
|
|
130
|
+
TableColumnType.SmallPositiveNumber,
|
|
131
|
+
TableColumnType.BigPositiveNumber,
|
|
132
|
+
TableColumnType.Port,
|
|
103
133
|
];
|
|
104
134
|
export const isScalarColumn = (column) => {
|
|
105
135
|
return !column.isRelation && SCALAR_COLUMN_TYPES.includes(column.type);
|
|
106
136
|
};
|
|
107
137
|
export const isNumericColumn = (column) => {
|
|
108
|
-
return column.
|
|
138
|
+
return !column.isRelation && NUMERIC_COLUMN_TYPES.includes(column.type);
|
|
109
139
|
};
|
|
110
140
|
export const isBooleanColumn = (column) => {
|
|
111
|
-
return column.type ===
|
|
141
|
+
return !column.isRelation && column.type === TableColumnType.Boolean;
|
|
142
|
+
};
|
|
143
|
+
export const requiredWritableColumns = (columns) => {
|
|
144
|
+
return columns.filter((column) => {
|
|
145
|
+
return (Boolean(column.required) &&
|
|
146
|
+
!column.hasDefault &&
|
|
147
|
+
!column.isTenantColumn &&
|
|
148
|
+
!column.isRelation);
|
|
149
|
+
});
|
|
112
150
|
};
|
|
113
151
|
export const findColumn = (columns, columnId) => {
|
|
114
152
|
return columns.find((column) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModelSchema.js","sourceRoot":"","sources":["../../../../../UI/Components/Workflow/ModelSchema.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,iBAAiB,MAAM,sCAAsC,CAAC;AAErE,OAAO,GAAG,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"ModelSchema.js","sourceRoot":"","sources":["../../../../../UI/Components/Workflow/ModelSchema.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,iBAAiB,MAAM,sCAAsC,CAAC;AAErE,OAAO,GAAG,MAAM,wBAAwB,CAAC;AACzC,OAAO,eAAe,MAAM,yCAAyC,CAAC;AAEtE,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,O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EAChB,EAAE;IACX,OAAO,CAAC,MAAM,CAAC,UAAU,IAAI,MAAM,CAAC,IAAI,KAAK,eAAe,CAAC,OAAO,CAAC;AACvE,CAAC,CAAC;AAeF,MAAM,CAAC,MAAM,uBAAuB,GAAoC,CACtE,OAAiC,EACP,EAAE;IAC5B,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC,MAAyB,EAAE,EAAE;QAClD,OAAO,CACL,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC;YACxB,CAAC,MAAM,CAAC,UAAU;YAClB,CAAC,MAAM,CAAC,cAAc;YACtB,CAAC,MAAM,CAAC,UAAU,CACnB,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAOF,MAAM,CAAC,MAAM,UAAU,GAAuB,CAC5C,OAAiC,EACjC,QAAgB,EACe,EAAE;IACjC,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC,MAAyB,EAAE,EAAE;QAChD,OAAO,MAAM,CAAC,EAAE,KAAK,QAAQ,CAAC;IAChC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC"}
|
|
@@ -58,7 +58,7 @@ export const decideRunWatch = (params) => {
|
|
|
58
58
|
return {
|
|
59
59
|
shouldContinue: false,
|
|
60
60
|
message: isFailedRunStatus(params.run.status)
|
|
61
|
-
? `Run ${params.run.status.toLowerCase()}. Open the
|
|
61
|
+
? `Run ${params.run.status.toLowerCase()}. Open the run log to see why.`
|
|
62
62
|
: "Run finished successfully.",
|
|
63
63
|
};
|
|
64
64
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RunStatusWatcher.js","sourceRoot":"","sources":["../../../../../UI/Components/Workflow/RunStatusWatcher.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,cAAc,MAAM,wCAAwC,CAAC;AAEpE;;;GAGG;AACH,MAAM,iBAAiB,GAA0B;IAC/C,cAAc,CAAC,OAAO;IACtB,cAAc,CAAC,KAAK;IACpB,cAA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C,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC;QAC3C,OAAO;YACL,cAAc,EAAE,KAAK;YACrB,OAAO,EAAE,iBAAiB,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC;gBAC3C,CAAC,CAAC,OAAO,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,WAAW,EAAE,gCAAgC;gBACxE,CAAC,CAAC,4BAA4B;SACjC,CAAC;IACJ,CAAC;IAED,IAAI,MAAM,CAAC,GAAG,CAAC,MAAM,KAAK,cAAc,CAAC,OAAO,EAAE,CAAC;QACjD,OAAO;YACL,cAAc,EAAE,KAAK;YACrB,OAAO,EACL,8EAA8E;SACjF,CAAC;IACJ,CAAC;IAED,OAAO;QACL,cAAc,EAAE,IAAI;QACpB,OAAO,EAAE,OAAO,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,WAAW,EAAE,GAAG;KACnD,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -61,7 +61,7 @@ const StepTraceViewer = (props) => {
|
|
|
61
61
|
var _a;
|
|
62
62
|
const steps = ((_a = props.trace) === null || _a === void 0 ? void 0 : _a.steps) || [];
|
|
63
63
|
if (steps.length === 0) {
|
|
64
|
-
return (React.createElement("p", { className: "text-sm text-gray-500" }, "This run has no recorded steps. Runs from before step recording was added show only
|
|
64
|
+
return (React.createElement("p", { className: "text-sm text-gray-500" }, "This run has no recorded steps. Runs from before step recording was added show only their full log."));
|
|
65
65
|
}
|
|
66
66
|
return (React.createElement("div", { className: "space-y-2" },
|
|
67
67
|
props.trace.truncated && (React.createElement("p", { className: "text-sm text-amber-700" },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StepTraceViewer.js","sourceRoot":"","sources":["../../../../../UI/Components/Workflow/StepTraceViewer.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,IAAI,MAAM,cAAc,CAAC;AAChC,OAAO,QAAQ,MAAM,8BAA8B,CAAC;AAEpD,OAAO,EACL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,EAAE,KAAK,EAAE,KAAK,GAAI,CAAC;QAC3D,CAAC,CAAC,CACE,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Following the run the builder just started, until it settles.
|
|
3
|
+
*
|
|
4
|
+
* RunStatusWatcher decides what to say and when to stop; this is the part that
|
|
5
|
+
* holds a timer, a generation counter and the run's log, and it lives here
|
|
6
|
+
* rather than in the page so it can be exercised through a real component
|
|
7
|
+
* lifecycle. Fetching is injected: the page knows how to ask the API for a
|
|
8
|
+
* run, and the hook only cares that asking returns one.
|
|
9
|
+
*/
|
|
10
|
+
import { RUN_WATCH_POLL_INTERVAL_MS, decideRunWatch, isFailedRunStatus, } from "./RunStatusWatcher";
|
|
11
|
+
import { emptyTrace, } from "../../../Types/Workflow/StepTrace";
|
|
12
|
+
import { useEffect, useRef, useState } from "react";
|
|
13
|
+
const useRunWatch = (params) => {
|
|
14
|
+
const [message, setMessage] = useState(null);
|
|
15
|
+
const [hasFailed, setHasFailed] = useState(false);
|
|
16
|
+
const [isWatching, setIsWatching] = useState(false);
|
|
17
|
+
const [logs, setLogs] = useState("");
|
|
18
|
+
const [stepTrace, setStepTrace] = useState(emptyTrace());
|
|
19
|
+
/*
|
|
20
|
+
* The page rebuilds its fetch function on every render. Reading it through a
|
|
21
|
+
* ref keeps a poll that is already in flight from being pinned to the
|
|
22
|
+
* function it started with.
|
|
23
|
+
*/
|
|
24
|
+
const fetchLatestRun = useRef(params.fetchLatestRun);
|
|
25
|
+
useEffect(() => {
|
|
26
|
+
fetchLatestRun.current = params.fetchLatestRun;
|
|
27
|
+
}, [params.fetchLatestRun]);
|
|
28
|
+
const pollTimer = useRef(null);
|
|
29
|
+
const runIdBeforeTrigger = useRef(null);
|
|
30
|
+
/*
|
|
31
|
+
* Which watch a poll belongs to. A poll is a pending promise, so starting a
|
|
32
|
+
* second run while the first is mid-request leaves that request in flight —
|
|
33
|
+
* it comes back, and without this would report on the wrong run and schedule
|
|
34
|
+
* a second chain of timers alongside the new one.
|
|
35
|
+
*/
|
|
36
|
+
const watchGeneration = useRef(0);
|
|
37
|
+
const isMounted = useRef(true);
|
|
38
|
+
useEffect(() => {
|
|
39
|
+
isMounted.current = true;
|
|
40
|
+
return () => {
|
|
41
|
+
isMounted.current = false;
|
|
42
|
+
if (pollTimer.current) {
|
|
43
|
+
clearTimeout(pollTimer.current);
|
|
44
|
+
pollTimer.current = null;
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
}, []);
|
|
48
|
+
const pollRun = async (pollCount, generation) => {
|
|
49
|
+
let run = null;
|
|
50
|
+
try {
|
|
51
|
+
run = await fetchLatestRun.current();
|
|
52
|
+
}
|
|
53
|
+
catch (_a) {
|
|
54
|
+
/*
|
|
55
|
+
* A failed poll is not a failed run. Keep watching — the next poll may
|
|
56
|
+
* well succeed, and the Logs tab is the fallback either way.
|
|
57
|
+
*/
|
|
58
|
+
run = null;
|
|
59
|
+
}
|
|
60
|
+
// This watch was replaced or the page went away while we were asking.
|
|
61
|
+
if (!isMounted.current || generation !== watchGeneration.current) {
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
// Not our run yet: the worker has not created its log.
|
|
65
|
+
if (run && run.runId === runIdBeforeTrigger.current) {
|
|
66
|
+
run = null;
|
|
67
|
+
}
|
|
68
|
+
if (run) {
|
|
69
|
+
setLogs(run.logs);
|
|
70
|
+
setStepTrace(run.stepTrace);
|
|
71
|
+
}
|
|
72
|
+
const decision = decideRunWatch({
|
|
73
|
+
run: run,
|
|
74
|
+
pollCount: pollCount,
|
|
75
|
+
});
|
|
76
|
+
setMessage(decision.message);
|
|
77
|
+
setHasFailed(isFailedRunStatus(run === null || run === void 0 ? void 0 : run.status));
|
|
78
|
+
if (!decision.shouldContinue) {
|
|
79
|
+
setIsWatching(false);
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
pollTimer.current = setTimeout(() => {
|
|
83
|
+
void pollRun(pollCount + 1, generation);
|
|
84
|
+
}, RUN_WATCH_POLL_INTERVAL_MS);
|
|
85
|
+
};
|
|
86
|
+
const captureRunBeforeTrigger = async () => {
|
|
87
|
+
try {
|
|
88
|
+
const existing = await fetchLatestRun.current();
|
|
89
|
+
runIdBeforeTrigger.current = existing ? existing.runId : null;
|
|
90
|
+
}
|
|
91
|
+
catch (_a) {
|
|
92
|
+
/*
|
|
93
|
+
* Without a baseline the first run we see counts as ours. That is the
|
|
94
|
+
* kinder failure: showing the previous run beats showing nothing.
|
|
95
|
+
*/
|
|
96
|
+
runIdBeforeTrigger.current = null;
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
const startWatchingRun = () => {
|
|
100
|
+
if (pollTimer.current) {
|
|
101
|
+
clearTimeout(pollTimer.current);
|
|
102
|
+
pollTimer.current = null;
|
|
103
|
+
}
|
|
104
|
+
watchGeneration.current = watchGeneration.current + 1;
|
|
105
|
+
setHasFailed(false);
|
|
106
|
+
setMessage("Starting run…");
|
|
107
|
+
setLogs("");
|
|
108
|
+
setStepTrace(emptyTrace());
|
|
109
|
+
setIsWatching(true);
|
|
110
|
+
void pollRun(0, watchGeneration.current);
|
|
111
|
+
};
|
|
112
|
+
return {
|
|
113
|
+
message: message,
|
|
114
|
+
hasFailed: hasFailed,
|
|
115
|
+
isWatching: isWatching,
|
|
116
|
+
logs: logs,
|
|
117
|
+
stepTrace: stepTrace,
|
|
118
|
+
captureRunBeforeTrigger: captureRunBeforeTrigger,
|
|
119
|
+
startWatchingRun: startWatchingRun,
|
|
120
|
+
};
|
|
121
|
+
};
|
|
122
|
+
export default useRunWatch;
|
|
123
|
+
//# sourceMappingURL=UseRunWatch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UseRunWatch.js","sourceRoot":"","sources":["../../../../../UI/Components/Workflow/UseRunWatch.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EACL,0B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