@oneuptime/common 14.0.110 → 14.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Models/DatabaseModels/AIRunRecording.d.mts +12 -0
- package/Models/DatabaseModels/AIRunRecording.d.ts +12 -0
- package/Models/DatabaseModels/AIRunRecording.js +181 -0
- package/Models/DatabaseModels/AIRunRecording.mjs +2 -0
- package/Models/DatabaseModels/Alert.d.mts +1 -0
- package/Models/DatabaseModels/Alert.d.ts +1 -0
- package/Models/DatabaseModels/Alert.js +52 -2
- package/Models/DatabaseModels/AutoRemediationSuggestion.d.mts +2 -0
- package/Models/DatabaseModels/AutoRemediationSuggestion.d.ts +2 -0
- package/Models/DatabaseModels/AutoRemediationSuggestion.js +62 -0
- package/Models/DatabaseModels/DataStore.js +9 -0
- package/Models/DatabaseModels/EmailLog.js +2 -2
- package/Models/DatabaseModels/Form.js +3 -3
- package/Models/DatabaseModels/FormSubmission.js +4 -4
- package/Models/DatabaseModels/GlobalConfig.js +46 -45
- package/Models/DatabaseModels/Incident.d.mts +1 -0
- package/Models/DatabaseModels/Incident.d.ts +1 -0
- package/Models/DatabaseModels/Incident.js +53 -2
- package/Models/DatabaseModels/IncidentPostmortemActionItem.d.mts +31 -0
- package/Models/DatabaseModels/IncidentPostmortemActionItem.d.ts +31 -0
- package/Models/DatabaseModels/IncidentPostmortemActionItem.js +591 -0
- package/Models/DatabaseModels/IncidentPostmortemActionItem.mjs +3 -0
- package/Models/DatabaseModels/IncidentSlaRule.js +2 -2
- package/Models/DatabaseModels/Index.js +6 -0
- package/Models/DatabaseModels/InventoryItem.js +11 -0
- package/Models/DatabaseModels/Monitor.js +51 -17
- package/Models/DatabaseModels/MonitorNetworkDevice.d.mts +11 -0
- package/Models/DatabaseModels/MonitorNetworkDevice.d.ts +11 -0
- package/Models/DatabaseModels/MonitorNetworkDevice.js +189 -0
- package/Models/DatabaseModels/MonitorNetworkDevice.mjs +2 -0
- package/Models/DatabaseModels/MonitorProbe.js +22 -5
- package/Models/DatabaseModels/NetworkDevice.js +23 -7
- package/Models/DatabaseModels/NetworkEndpoint.d.mts +1 -0
- package/Models/DatabaseModels/NetworkEndpoint.d.ts +1 -0
- package/Models/DatabaseModels/NetworkEndpoint.js +39 -7
- package/Models/DatabaseModels/NetworkInterface.js +5 -5
- package/Models/DatabaseModels/OnCallDutyPolicyExecutionLog.js +19 -5
- package/Models/DatabaseModels/OnCallDutyPolicyFeed.d.mts +1 -0
- package/Models/DatabaseModels/OnCallDutyPolicyFeed.d.ts +1 -0
- package/Models/DatabaseModels/OnCallDutyPolicyFeed.js +2 -0
- package/Models/DatabaseModels/OnCallDutyPolicyUserOverride.js +35 -7
- package/Models/DatabaseModels/OpenStackCloudCheck.js +8 -1
- package/Models/DatabaseModels/Project.d.mts +1 -0
- package/Models/DatabaseModels/Project.d.ts +1 -0
- package/Models/DatabaseModels/Project.js +46 -3
- package/Models/DatabaseModels/ProjectCallSMSConfig.js +3 -1
- package/Models/DatabaseModels/ProjectSmtpConfig.js +2 -0
- package/Models/DatabaseModels/PublicNoteApprovalRequest.js +3 -3
- package/Models/DatabaseModels/PublicNoteApprovalStep.js +1 -1
- package/Models/DatabaseModels/RunbookExecution.js +2 -2
- package/Models/DatabaseModels/RunbookRule.js +6 -6
- package/Models/DatabaseModels/ScheduledMaintenance.js +3 -3
- package/Models/DatabaseModels/ScheduledMaintenanceCalendarFeed.js +1 -1
- package/Models/DatabaseModels/ScheduledMaintenanceLabelRule.js +1 -1
- package/Models/DatabaseModels/ScheduledMaintenanceMeasurement.js +7 -7
- package/Models/DatabaseModels/ScheduledMaintenanceMeasurementValue.js +1 -1
- package/Models/DatabaseModels/ScheduledMaintenanceOwnerRule.js +6 -6
- package/Models/DatabaseModels/ScheduledMaintenanceOwnerTeam.js +4 -4
- package/Models/DatabaseModels/ScheduledMaintenanceOwnerUser.js +4 -4
- package/Models/DatabaseModels/ScheduledMaintenancePublicNote.js +3 -3
- package/Models/DatabaseModels/ScheduledMaintenanceReminderRule.js +4 -4
- package/Models/DatabaseModels/ScheduledMaintenanceStateTimeline.js +3 -3
- package/Models/DatabaseModels/ScheduledMaintenanceTemplate.js +5 -5
- package/Models/DatabaseModels/TeamMember.js +10 -1
- package/Models/DatabaseModels/TelemetryIngestionKey.js +1 -1
- package/Models/DatabaseModels/WorkspaceNotificationRule.js +36 -1
- package/Models/DatabaseModels/WorkspaceNotificationSummary.js +1 -1
- package/Models/DatabaseModels/WorkspacePublicNoteApprovalMessage.js +3 -3
- package/Server/Services/DatabaseService.d.mts +4 -1
- package/Server/Services/DatabaseService.d.ts +4 -1
- package/Server/Types/Database/CountBy.d.mts +1 -0
- package/Server/Types/Database/CountBy.d.ts +1 -0
- package/Server/Types/Database/UpdateLimit.d.mts +6 -0
- package/Server/Types/Database/UpdateLimit.d.ts +6 -0
- package/Types/AI/AIActionWords.d.mts +28 -2
- package/Types/AI/AIActionWords.d.ts +28 -2
- package/Types/AI/AIActionWords.js +235 -3
- package/Types/AI/AIActionWords.mjs +8 -0
- package/Types/AI/AIChatTypes.d.mts +3 -1
- package/Types/AI/AIChatTypes.d.ts +3 -1
- package/Types/AI/AIReadTableWords.d.mts +192 -0
- package/Types/AI/AIReadTableWords.d.ts +192 -0
- package/Types/AI/AIReadTableWords.js +368 -0
- package/Types/AI/AIReadTableWords.mjs +18 -0
- package/Types/AI/AiOutcomes.d.mts +57 -0
- package/Types/AI/AiOutcomes.d.ts +57 -0
- package/Types/AI/AiOutcomes.js +67 -0
- package/Types/AI/AiOutcomes.mjs +10 -0
- package/Types/AI/AiRunRefusal.d.mts +48 -0
- package/Types/AI/AiRunRefusal.d.ts +48 -0
- package/Types/AI/AiRunRefusal.js +208 -0
- package/Types/AI/AiRunRefusal.mjs +12 -0
- package/Types/AI/InvestigationRecording.d.mts +46 -0
- package/Types/AI/InvestigationRecording.d.ts +46 -0
- package/Types/AI/InvestigationRecording.js +42 -0
- package/Types/AI/InvestigationRecording.mjs +7 -0
- package/Types/AI/ResourceAiAccessPermissions.js +7 -18
- package/Types/API/HTTPResponse.d.mts +3 -0
- package/Types/API/HTTPResponse.d.ts +3 -0
- package/Types/API/HTTPResponse.js +15 -0
- package/Types/AuditLog/AuditLogActionLabel.js +19 -9
- package/Types/BaseDatabase/AggregateBy.d.mts +16 -0
- package/Types/BaseDatabase/AggregateBy.d.ts +16 -0
- package/Types/BaseDatabase/AggregationIntervalUtil.d.mts +32 -1
- package/Types/BaseDatabase/AggregationIntervalUtil.d.ts +32 -1
- package/Types/BaseDatabase/AggregationIntervalUtil.js +199 -2
- package/Types/BaseDatabase/ListResult.d.mts +1 -0
- package/Types/BaseDatabase/ListResult.d.ts +1 -0
- package/Types/CallAndSMS/ServerTwilioEnvironment.d.mts +47 -0
- package/Types/CallAndSMS/ServerTwilioEnvironment.d.ts +47 -0
- package/Types/CallAndSMS/ServerTwilioEnvironment.js +282 -0
- package/Types/CallAndSMS/ServerTwilioEnvironment.mjs +7 -0
- package/Types/Cloud/CloudResourceHealth.d.mts +30 -1
- package/Types/Cloud/CloudResourceHealth.d.ts +30 -1
- package/Types/Cloud/CloudResourceHealth.js +405 -13
- package/Types/Cloud/CloudResourceHealth.mjs +28 -0
- package/Types/Dashboard/DashboardAutoRefresh.d.mts +1 -0
- package/Types/Dashboard/DashboardAutoRefresh.d.ts +1 -0
- package/Types/Dashboard/DashboardAutoRefresh.js +21 -0
- package/Types/Dashboard/DashboardAutoRefresh.mjs +1 -0
- package/Types/DataObservability/DataCheckRefusals.d.mts +32 -0
- package/Types/DataObservability/DataCheckRefusals.d.ts +32 -0
- package/Types/DataObservability/DataCheckRefusals.js +77 -0
- package/Types/DataObservability/DataCheckRefusals.mjs +8 -0
- package/Types/Database/AccessControl/PermissionScopeNarrowing.js +4 -0
- package/Types/Date.d.mts +8 -1
- package/Types/Date.d.ts +8 -1
- package/Types/Date.js +61 -7
- package/Types/Date.mjs +1 -0
- package/Types/DateLanguage.d.mts +2 -0
- package/Types/DateLanguage.d.ts +2 -0
- package/Types/DateLanguage.js +8 -5
- package/Types/Email/EmailTemplateType.d.mts +1 -0
- package/Types/Email/EmailTemplateType.d.ts +1 -0
- package/Types/Email/EmailTemplateType.js +2 -0
- package/Types/Email/ServerEmailEnvironment.d.mts +85 -0
- package/Types/Email/ServerEmailEnvironment.d.ts +85 -0
- package/Types/Email/ServerEmailEnvironment.js +793 -0
- package/Types/Email/ServerEmailEnvironment.mjs +14 -0
- package/Types/Exception/AiRunRefusalException.d.mts +6 -0
- package/Types/Exception/AiRunRefusalException.d.ts +6 -0
- package/Types/Exception/AiRunRefusalException.js +23 -0
- package/Types/Exception/AiRunRefusalException.mjs +2 -0
- package/Types/Exception/EgressGuardException.js +1 -1
- package/Types/Exception/ErrorMessageRule.d.mts +1 -0
- package/Types/Exception/ErrorMessageRule.d.ts +1 -0
- package/Types/Exception/ErrorMessageRule.js +67 -13
- package/Types/Exception/ErrorMessageRule.mjs +1 -0
- package/Types/Exception/ExceptionMessages.d.mts +2 -0
- package/Types/Exception/ExceptionMessages.d.ts +2 -0
- package/Types/Exception/ExceptionMessages.js +2 -0
- package/Types/Form/FormTargetCatalog.js +2 -2
- package/Types/Form/FormTargetType.js +2 -2
- package/Types/Incident/PostmortemActionItemStatus.d.mts +17 -0
- package/Types/Incident/PostmortemActionItemStatus.d.ts +17 -0
- package/Types/Incident/PostmortemActionItemStatus.js +74 -0
- package/Types/Incident/PostmortemActionItemStatus.mjs +5 -0
- package/Types/JSONFunctions.js +10 -3
- package/Types/Link.d.mts +1 -0
- package/Types/Link.d.ts +1 -0
- package/Types/ListData.d.mts +2 -0
- package/Types/ListData.d.ts +2 -0
- package/Types/ListData.js +4 -0
- package/Types/MeaningKeys.d.mts +4 -0
- package/Types/MeaningKeys.d.ts +4 -0
- package/Types/MeaningKeys.js +74 -0
- package/Types/MeaningKeys.mjs +5 -0
- package/Types/Monitor/MonitorCriteriaInstance.js +9 -0
- package/Types/Monitor/MonitorNotCheckedReason.d.mts +7 -0
- package/Types/Monitor/MonitorNotCheckedReason.d.ts +7 -0
- package/Types/Monitor/MonitorNotCheckedReason.js +36 -0
- package/Types/Monitor/MonitorNotCheckedReason.mjs +4 -0
- package/Types/Monitor/SnmpMonitor/NetworkTopology.d.mts +6 -0
- package/Types/Monitor/SnmpMonitor/NetworkTopology.d.ts +6 -0
- package/Types/Monitor/UptimeHistoryLabels.js +2 -2
- package/Types/Monitor/WhoIsTold.d.mts +3 -0
- package/Types/Monitor/WhoIsTold.d.ts +3 -0
- package/Types/Monitor/WhoIsTold.js +63 -13
- package/Types/NoBreakSpaces.d.mts +16 -0
- package/Types/NoBreakSpaces.d.ts +16 -0
- package/Types/NoBreakSpaces.js +419 -0
- package/Types/NoBreakSpaces.mjs +9 -0
- package/Types/NotificationRule/PagingLadder.d.mts +12 -0
- package/Types/NotificationRule/PagingLadder.d.ts +12 -0
- package/Types/NotificationRule/PagingLadder.js +159 -11
- package/Types/NotificationRule/PagingLadder.mjs +3 -0
- package/Types/OnCallDutyPolicy/GlobalUserOverrideAccess.d.mts +1 -0
- package/Types/OnCallDutyPolicy/GlobalUserOverrideAccess.d.ts +1 -0
- package/Types/OnCallDutyPolicy/GlobalUserOverrideAccess.js +12 -9
- package/Types/OnCallDutyPolicy/GlobalUserOverrideAccess.mjs +1 -0
- package/Types/OnCallDutyPolicy/OnCallAcknowledgePage.d.mts +3 -1
- package/Types/OnCallDutyPolicy/OnCallAcknowledgePage.d.ts +3 -1
- package/Types/OnCallDutyPolicy/OnCallAcknowledgePage.js +24 -6
- package/Types/OnCallDutyPolicy/OnCallAcknowledgePage.mjs +1 -0
- package/Types/OnCallDutyPolicy/OnCallPagePassOn.d.mts +1 -0
- package/Types/OnCallDutyPolicy/OnCallPagePassOn.d.ts +1 -0
- package/Types/OnCallDutyPolicy/OnCallPageRecordGone.d.mts +3 -0
- package/Types/OnCallDutyPolicy/OnCallPageRecordGone.d.ts +3 -0
- package/Types/OnCallDutyPolicy/OnCallPageRecordGone.js +42 -0
- package/Types/OnCallDutyPolicy/OnCallPageRecordGone.mjs +4 -0
- package/Types/OnCallDutyPolicy/OnCallPageWords.d.mts +6 -2
- package/Types/OnCallDutyPolicy/OnCallPageWords.d.ts +6 -2
- package/Types/OnCallDutyPolicy/OnCallPageWords.js +21 -20
- package/Types/OnCallDutyPolicy/OnCallPersonPage.d.mts +4 -0
- package/Types/OnCallDutyPolicy/OnCallPersonPage.d.ts +4 -0
- package/Types/OnCallDutyPolicy/OnCallPersonPage.js +125 -1
- package/Types/OnCallDutyPolicy/OnCallPersonPage.mjs +1 -0
- package/Types/OnCallDutyPolicy/OnCallPolicyStartedByHand.d.mts +12 -0
- package/Types/OnCallDutyPolicy/OnCallPolicyStartedByHand.d.ts +12 -0
- package/Types/OnCallDutyPolicy/OnCallPolicyStartedByHand.js +38 -0
- package/Types/OnCallDutyPolicy/OnCallPolicyStartedByHand.mjs +3 -0
- package/Types/OnCallDutyPolicy/OnCallTestPage.d.mts +2 -0
- package/Types/OnCallDutyPolicy/OnCallTestPage.d.ts +2 -0
- package/Types/OnCallDutyPolicy/OnCallTestPage.js +12 -0
- package/Types/OnCallDutyPolicy/OnCallTestPage.mjs +1 -0
- package/Types/OnCallDutyPolicy/ScheduleLayersSave.d.mts +92 -0
- package/Types/OnCallDutyPolicy/ScheduleLayersSave.d.ts +92 -0
- package/Types/OnCallDutyPolicy/ScheduleLayersSave.js +512 -0
- package/Types/OnCallDutyPolicy/ScheduleLayersSave.mjs +7 -0
- package/Types/OnCallDutyPolicy/UserOverrideEdit.d.mts +23 -0
- package/Types/OnCallDutyPolicy/UserOverrideEdit.d.ts +23 -0
- package/Types/OnCallDutyPolicy/UserOverrideEdit.js +105 -0
- package/Types/OnCallDutyPolicy/UserOverrideEdit.mjs +6 -0
- package/Types/OnCallDutyPolicy/UserOverrideOverlap.d.mts +64 -0
- package/Types/OnCallDutyPolicy/UserOverrideOverlap.d.ts +64 -0
- package/Types/OnCallDutyPolicy/UserOverrideOverlap.js +237 -0
- package/Types/OnCallDutyPolicy/UserOverrideOverlap.mjs +14 -0
- package/Types/OpenStack/OpenStackCapacity.js +12 -5
- package/Types/Permission.d.mts +4 -0
- package/Types/Permission.d.ts +4 -0
- package/Types/Permission.js +66 -10
- package/Types/Probe/ProbeCapability.d.mts +2 -1
- package/Types/Probe/ProbeCapability.d.ts +2 -1
- package/Types/Probe/ProbeCapability.js +10 -0
- package/Types/Product/ProductUsage.js +2 -1
- package/Types/Product/ProjectProductsAnswer.js +2 -1
- package/Types/ReaderLanguage.d.mts +1 -0
- package/Types/ReaderLanguage.d.ts +1 -0
- package/Types/ReaderLanguage.js +13 -1
- package/Types/ReaderLanguage.mjs +1 -0
- package/Types/ResourceAiAgent/AiResourceType.d.mts +1 -0
- package/Types/ResourceAiAgent/AiResourceType.d.ts +1 -0
- package/Types/ResourceAiAgent/AiResourceType.js +12 -0
- package/Types/Rules/RuleRun.js +2 -2
- package/Types/Rum/ProductAnalyticsEventReads.js +10 -1
- package/Types/Rum/ProductAnalyticsEvents.js +13 -1
- package/Types/Rum/SessionReplayCustomEvents.d.mts +4 -1
- package/Types/Rum/SessionReplayCustomEvents.d.ts +4 -1
- package/Types/Rum/SessionReplayCustomEvents.js +12 -0
- package/Types/Rum/SessionReplayCustomEvents.mjs +1 -0
- package/Types/ScheduledMaintenance/MaintenanceCalendar.js +1 -1
- package/Types/ServerSending/ServerSendingStatus.d.mts +7 -0
- package/Types/ServerSending/ServerSendingStatus.d.ts +7 -0
- package/Types/ServerSending/ServerSendingStatus.js +49 -2
- package/Types/ServerSetup/ServerSetupChecklist.js +3 -3
- package/Types/SetupHealth/SetupHealth.d.mts +1 -0
- package/Types/SetupHealth/SetupHealth.d.ts +1 -0
- package/Types/SetupHealth/SetupHealth.js +13 -5
- package/Types/StateTimeline/RowsKeptOnDelete.js +1 -1
- package/Types/StatusPage/DefaultStatusNames.d.mts +11 -3
- package/Types/StatusPage/DefaultStatusNames.d.ts +11 -3
- package/Types/StatusPage/DefaultStatusNames.js +74 -28
- package/Types/StatusPage/DefaultStatusNames.mjs +9 -2
- package/Types/StatusPage/NewIncidentSubscriberNotificationDefault.d.mts +8 -0
- package/Types/StatusPage/NewIncidentSubscriberNotificationDefault.d.ts +8 -0
- package/Types/StatusPage/NewIncidentSubscriberNotificationDefault.js +50 -0
- package/Types/StatusPage/NewIncidentSubscriberNotificationDefault.mjs +3 -0
- package/Types/StatusPage/PublicNoteSubscriberNotificationDefault.js +1 -1
- package/Types/StatusPage/StateChangeNoteMessage.d.mts +3 -2
- package/Types/StatusPage/StateChangeNoteMessage.d.ts +3 -2
- package/Types/StatusPage/StateChangeNoteMessage.js +16 -13
- package/Types/Telemetry/CompatibleIngest.d.mts +20 -0
- package/Types/Telemetry/CompatibleIngest.d.ts +20 -0
- package/Types/Telemetry/CompatibleIngest.js +123 -0
- package/Types/Telemetry/CompatibleIngest.mjs +21 -0
- package/Types/Telemetry/TelemetryIngestSurface.d.mts +5 -0
- package/Types/Telemetry/TelemetryIngestSurface.d.ts +5 -0
- package/Types/Telemetry/TelemetryIngestSurface.js +48 -7
- package/Types/Telemetry/TelemetryIngestionKeyType.js +7 -6
- package/Types/TimezoneAlias.d.mts +1 -0
- package/Types/TimezoneAlias.d.ts +1 -0
- package/Types/TimezoneAlias.js +13 -0
- package/Types/Translator.d.mts +1 -0
- package/Types/Translator.d.ts +1 -0
- package/Types/Translator.js +470 -63
- package/Types/Translator.mjs +1 -0
- package/Types/UserSession/SessionLength.d.mts +33 -0
- package/Types/UserSession/SessionLength.d.ts +33 -0
- package/Types/UserSession/SessionLength.js +134 -5
- package/Types/UserSession/SessionLength.mjs +5 -0
- package/Types/Workflow/RunRecord.js +1 -1
- package/Types/Workflow/Templates.js +2 -2
- package/Types/Workflow/WorkflowStatus.js +21 -10
- package/Types/Workspace/NotificationRules/BaseNotificationRule.d.mts +2 -0
- package/Types/Workspace/NotificationRules/BaseNotificationRule.d.ts +2 -0
- package/Types/Workspace/NotificationRules/NotificationRuleCondition.d.mts +26 -1
- package/Types/Workspace/NotificationRules/NotificationRuleCondition.d.ts +26 -1
- package/Types/Workspace/NotificationRules/NotificationRuleUpdates.d.mts +84 -0
- package/Types/Workspace/NotificationRules/NotificationRuleUpdates.d.ts +84 -0
- package/Types/Workspace/NotificationRules/NotificationRuleUpdates.js +456 -0
- package/Types/Workspace/NotificationRules/NotificationRuleUpdates.mjs +5 -0
- package/Utils/AI/InvestigationReport.js +2 -2
- package/Utils/API.d.mts +0 -11
- package/Utils/API.d.ts +0 -11
- package/Utils/API.js +0 -432
- package/Utils/AiRemediation/Resource/ResourceCommandPolicy.js +2 -2
- package/Utils/AiRemediation/VerifiedFixRunbook.d.mts +39 -0
- package/Utils/AiRemediation/VerifiedFixRunbook.d.ts +39 -0
- package/Utils/AiRemediation/VerifiedFixRunbook.js +231 -0
- package/Utils/AiRemediation/VerifiedFixRunbook.mjs +10 -0
- package/Utils/Dashboard/DashboardWidgetSorts.js +11 -2
- package/Utils/Dashboard/MonitorListWidgetFormat.d.mts +2 -1
- package/Utils/Dashboard/MonitorListWidgetFormat.d.ts +2 -1
- package/Utils/Dashboard/MonitorListWidgetFormat.js +5 -3
- package/Utils/Dashboard/ValueWidgetSeries.d.mts +2 -0
- package/Utils/Dashboard/ValueWidgetSeries.d.ts +2 -0
- package/Utils/Dashboard/ValueWidgetSeries.js +75 -0
- package/Utils/DefaultRecordNames.d.mts +6 -0
- package/Utils/DefaultRecordNames.d.ts +6 -0
- package/Utils/DefaultRecordNames.js +122 -0
- package/Utils/DefaultRecordNames.mjs +6 -0
- package/Utils/DeveloperDocs/ExampleBuilder.js +1 -1
- package/Utils/DeveloperDocs/ResourceProfiles.js +2 -2
- package/Utils/Grok/Grok.js +7 -4
- package/Utils/GuidedSetup/StatusPageRecords.d.mts +5 -0
- package/Utils/GuidedSetup/StatusPageRecords.d.ts +5 -0
- package/Utils/GuidedSetup/StatusPageRecords.js +27 -2
- package/Utils/GuidedSetup/StatusPageRecords.mjs +1 -0
- package/Utils/GuidedSetup/WebsiteMonitorRecords.js +6 -0
- package/Utils/HostAddressUtil.d.mts +1 -0
- package/Utils/HostAddressUtil.d.ts +1 -0
- package/Utils/HostAddressUtil.js +30 -0
- package/Utils/Incident/PostmortemActionItemCodeTask.d.mts +20 -0
- package/Utils/Incident/PostmortemActionItemCodeTask.d.ts +20 -0
- package/Utils/Incident/PostmortemActionItemCodeTask.js +107 -0
- package/Utils/Incident/PostmortemActionItemCodeTask.mjs +10 -0
- package/Utils/Incident/PostmortemActionItemMarkdown.d.mts +39 -0
- package/Utils/Incident/PostmortemActionItemMarkdown.d.ts +39 -0
- package/Utils/Incident/PostmortemActionItemMarkdown.js +118 -0
- package/Utils/Incident/PostmortemActionItemMarkdown.mjs +12 -0
- package/Utils/Incident/PostmortemNoteActionItems.d.mts +29 -0
- package/Utils/Incident/PostmortemNoteActionItems.d.ts +29 -0
- package/Utils/Incident/PostmortemNoteActionItems.js +544 -0
- package/Utils/Incident/PostmortemNoteActionItems.mjs +7 -0
- package/Utils/LinearRegExp/LinearRegExp.js +5 -1
- package/Utils/LookupTable.d.mts +3 -0
- package/Utils/LookupTable.d.ts +3 -0
- package/Utils/LookupTable.js +61 -0
- package/Utils/LookupTable.mjs +3 -0
- package/Utils/Markdown/LinkReferenceDefinitions.d.mts +2 -0
- package/Utils/Markdown/LinkReferenceDefinitions.d.ts +2 -0
- package/Utils/Markdown/LinkReferenceDefinitions.js +101 -1
- package/Utils/Markdown/LinkReferenceDefinitions.mjs +2 -0
- package/Utils/Markdown/OverLongText.js +296 -2
- package/Utils/Markdown/SlowMarkdown.d.mts +1 -0
- package/Utils/Markdown/SlowMarkdown.d.ts +1 -0
- package/Utils/Markdown/SlowMarkdown.js +354 -4
- package/Utils/Markdown/SlowMarkdown.mjs +1 -0
- package/Utils/Metrics/MetricFormulaEvaluator.js +10 -4
- package/Utils/Metrics/MetricSeriesFingerprint.js +13 -4
- package/Utils/Metrics/MetricSeriesScope.d.mts +5 -0
- package/Utils/Metrics/MetricSeriesScope.d.ts +5 -0
- package/Utils/Metrics/MetricSeriesScope.js +5 -1
- package/Utils/Milliseconds.d.mts +7 -0
- package/Utils/Milliseconds.d.ts +7 -0
- package/Utils/Milliseconds.js +60 -0
- package/Utils/Milliseconds.mjs +4 -0
- package/Utils/Monitor/EndpointAttachmentUtil.d.mts +8 -0
- package/Utils/Monitor/EndpointAttachmentUtil.d.ts +8 -0
- package/Utils/Monitor/EndpointAttachmentUtil.js +91 -21
- package/Utils/Monitor/EndpointAttachmentUtil.mjs +4 -0
- package/Utils/Monitor/InterfaceInventoryUtil.d.mts +40 -0
- package/Utils/Monitor/InterfaceInventoryUtil.d.ts +40 -0
- package/Utils/Monitor/InterfaceInventoryUtil.js +217 -5
- package/Utils/Monitor/InterfaceInventoryUtil.mjs +8 -0
- package/Utils/Monitor/MonitorOverviewPresentationUtil.js +63 -29
- package/Utils/Monitor/MonitorOverviewProbeUtil.js +13 -2
- package/Utils/Monitor/MonitorRootCauseWording.d.mts +5 -0
- package/Utils/Monitor/MonitorRootCauseWording.d.ts +5 -0
- package/Utils/Monitor/MonitorRootCauseWording.js +148 -5
- package/Utils/Monitor/MonitoringOff.d.mts +2 -0
- package/Utils/Monitor/MonitoringOff.d.ts +2 -0
- package/Utils/Monitor/MonitoringOff.js +21 -0
- package/Utils/Monitor/NetworkTopologyUtil.d.mts +2 -1
- package/Utils/Monitor/NetworkTopologyUtil.d.ts +2 -1
- package/Utils/Monitor/NetworkTopologyUtil.js +10 -0
- package/Utils/Monitor/NotOperationalMonitorQuery.d.mts +2 -1
- package/Utils/Monitor/NotOperationalMonitorQuery.d.ts +2 -1
- package/Utils/Monitor/NotOperationalMonitorQuery.js +23 -4
- package/Utils/Monitor/ProbeAgreementRule.d.mts +10 -0
- package/Utils/Monitor/ProbeAgreementRule.d.ts +10 -0
- package/Utils/Monitor/ProbeAgreementRule.js +58 -0
- package/Utils/Monitor/ProbeAgreementRule.mjs +3 -0
- package/Utils/Monitor/ProbeFailureReading.d.mts +18 -0
- package/Utils/Monitor/ProbeFailureReading.d.ts +18 -0
- package/Utils/Monitor/ProbeFailureReading.js +166 -0
- package/Utils/Monitor/ProbeFailureReading.mjs +8 -0
- package/Utils/Monitor/RequestFailureDescriptions.d.mts +61 -0
- package/Utils/Monitor/RequestFailureDescriptions.d.ts +61 -0
- package/Utils/Monitor/RequestFailureDescriptions.js +252 -0
- package/Utils/Monitor/RequestFailureDescriptions.mjs +6 -0
- package/Utils/NetworkDevice/BoundMonitorNotChecked.d.mts +9 -0
- package/Utils/NetworkDevice/BoundMonitorNotChecked.d.ts +9 -0
- package/Utils/NetworkDevice/BoundMonitorNotChecked.js +15 -0
- package/Utils/NetworkDevice/BoundMonitorNotChecked.mjs +2 -0
- package/Utils/Project/NextNumber.js +1 -1
- package/Utils/PromQL/PromQLAst.d.mts +159 -0
- package/Utils/PromQL/PromQLAst.d.ts +159 -0
- package/Utils/PromQL/PromQLAst.js +118 -0
- package/Utils/PromQL/PromQLAst.mjs +12 -0
- package/Utils/PromQL/PromQLDuration.d.mts +2 -0
- package/Utils/PromQL/PromQLDuration.d.ts +2 -0
- package/Utils/PromQL/PromQLDuration.js +78 -0
- package/Utils/PromQL/PromQLDuration.mjs +3 -0
- package/Utils/PromQL/PromQLEngine.d.mts +15 -0
- package/Utils/PromQL/PromQLEngine.d.ts +15 -0
- package/Utils/PromQL/PromQLEngine.js +974 -0
- package/Utils/PromQL/PromQLEngine.mjs +7 -0
- package/Utils/PromQL/PromQLEngineTypes.d.mts +84 -0
- package/Utils/PromQL/PromQLEngineTypes.d.ts +84 -0
- package/Utils/PromQL/PromQLEngineTypes.js +10 -0
- package/Utils/PromQL/PromQLEngineTypes.mjs +2 -0
- package/Utils/PromQL/PromQLError.d.mts +11 -0
- package/Utils/PromQL/PromQLError.d.ts +11 -0
- package/Utils/PromQL/PromQLError.js +27 -0
- package/Utils/PromQL/PromQLError.mjs +3 -0
- package/Utils/PromQL/PromQLFunctionEvaluators.d.mts +8 -0
- package/Utils/PromQL/PromQLFunctionEvaluators.d.ts +8 -0
- package/Utils/PromQL/PromQLFunctionEvaluators.js +829 -0
- package/Utils/PromQL/PromQLFunctionEvaluators.mjs +3 -0
- package/Utils/PromQL/PromQLFunctions.d.mts +10 -0
- package/Utils/PromQL/PromQLFunctions.d.ts +10 -0
- package/Utils/PromQL/PromQLFunctions.js +127 -0
- package/Utils/PromQL/PromQLFunctions.mjs +4 -0
- package/Utils/PromQL/PromQLLabelOrder.d.mts +8 -0
- package/Utils/PromQL/PromQLLabelOrder.d.ts +8 -0
- package/Utils/PromQL/PromQLLabelOrder.js +212 -0
- package/Utils/PromQL/PromQLLabelOrder.mjs +6 -0
- package/Utils/PromQL/PromQLLabels.d.mts +11 -0
- package/Utils/PromQL/PromQLLabels.d.ts +11 -0
- package/Utils/PromQL/PromQLLabels.js +219 -0
- package/Utils/PromQL/PromQLLabels.mjs +9 -0
- package/Utils/PromQL/PromQLLexer.d.mts +39 -0
- package/Utils/PromQL/PromQLLexer.d.ts +39 -0
- package/Utils/PromQL/PromQLLexer.js +391 -0
- package/Utils/PromQL/PromQLLexer.mjs +3 -0
- package/Utils/PromQL/PromQLMath.d.mts +19 -0
- package/Utils/PromQL/PromQLMath.d.ts +19 -0
- package/Utils/PromQL/PromQLMath.js +200 -0
- package/Utils/PromQL/PromQLMath.mjs +9 -0
- package/Utils/PromQL/PromQLMetricNames.d.mts +21 -0
- package/Utils/PromQL/PromQLMetricNames.d.ts +21 -0
- package/Utils/PromQL/PromQLMetricNames.js +205 -0
- package/Utils/PromQL/PromQLMetricNames.mjs +8 -0
- package/Utils/PromQL/PromQLParser.d.mts +4 -0
- package/Utils/PromQL/PromQLParser.d.ts +4 -0
- package/Utils/PromQL/PromQLParser.js +836 -0
- package/Utils/PromQL/PromQLParser.mjs +4 -0
- package/Utils/PromQL/PromQLRegex.d.mts +20 -0
- package/Utils/PromQL/PromQLRegex.d.ts +20 -0
- package/Utils/PromQL/PromQLRegex.js +1014 -0
- package/Utils/PromQL/PromQLRegex.mjs +5 -0
- package/Utils/PromQL/PrometheusResponse.d.mts +25 -0
- package/Utils/PromQL/PrometheusResponse.d.ts +25 -0
- package/Utils/PromQL/PrometheusResponse.js +92 -0
- package/Utils/PromQL/PrometheusResponse.mjs +3 -0
- package/Utils/PromQL/RE2CharacterClass.d.mts +24 -0
- package/Utils/PromQL/RE2CharacterClass.d.ts +24 -0
- package/Utils/PromQL/RE2CharacterClass.js +532 -0
- package/Utils/PromQL/RE2CharacterClass.mjs +16 -0
- package/Utils/RequestFailedDetailsUtil.d.mts +15 -0
- package/Utils/RequestFailedDetailsUtil.d.ts +15 -0
- package/Utils/RequestFailedDetailsUtil.js +452 -0
- package/Utils/RequestFailedDetailsUtil.mjs +2 -0
- package/Utils/Rum/PathInSentence.d.mts +5 -0
- package/Utils/Rum/PathInSentence.d.ts +5 -0
- package/Utils/Rum/PathInSentence.js +46 -0
- package/Utils/Rum/PathInSentence.mjs +6 -0
- package/Utils/Rum/UrlScrubber.d.mts +5 -1
- package/Utils/Rum/UrlScrubber.d.ts +5 -1
- package/Utils/Rum/UrlScrubber.js +153 -7
- package/Utils/Rum/UserFlow.d.mts +1 -1
- package/Utils/Rum/UserFlow.d.ts +1 -1
- package/Utils/Rum/UserFlow.js +202 -29
- package/Utils/Rum/UserFlow.mjs +1 -1
- package/Utils/Runbook/RunbookStepsSignature.d.mts +3 -0
- package/Utils/Runbook/RunbookStepsSignature.d.ts +3 -0
- package/Utils/Runbook/RunbookStepsSignature.js +30 -0
- package/Utils/Runbook/RunbookStepsSignature.mjs +3 -0
- package/Utils/Schema/TypeSchemas.js +6 -0
- package/Utils/SecurityCase/SecurityOverviewMetrics.d.mts +11 -1
- package/Utils/SecurityCase/SecurityOverviewMetrics.d.ts +11 -1
- package/Utils/SecurityCase/SecurityOverviewMetrics.js +99 -17
- package/Utils/SecurityCase/SecurityOverviewMetrics.mjs +3 -0
- package/Utils/Slo/SloDuration.d.mts +5 -2
- package/Utils/Slo/SloDuration.d.ts +5 -2
- package/Utils/Slo/SloDuration.js +11 -6
- package/Utils/Slo/SloHealth.js +1 -1
- package/Utils/Sms/OnCallPageSms.d.mts +2 -0
- package/Utils/Sms/OnCallPageSms.d.ts +2 -0
- package/Utils/Sms/OnCallPageSms.js +3 -1
- package/Utils/StateListType.d.mts +11 -0
- package/Utils/StateListType.d.ts +11 -0
- package/Utils/StateListType.js +21 -0
- package/Utils/StateListType.mjs +2 -0
- package/Utils/StateOrder.d.mts +8 -11
- package/Utils/StateOrder.d.ts +8 -11
- package/Utils/StateOrder.js +50 -88
- package/Utils/StateOrder.mjs +2 -0
- package/Utils/StateTimeline/StateTimelineRowDelete.js +1 -1
- package/Utils/Suggestions/ActionItemCodeTaskSuggestion.d.mts +9 -0
- package/Utils/Suggestions/ActionItemCodeTaskSuggestion.d.ts +9 -0
- package/Utils/Suggestions/ActionItemCodeTaskSuggestion.js +25 -0
- package/Utils/Suggestions/ActionItemCodeTaskSuggestion.mjs +2 -0
- package/Utils/Suggestions/VerifiedFixRunbookSuggestion.d.mts +5 -0
- package/Utils/Suggestions/VerifiedFixRunbookSuggestion.d.ts +5 -0
- package/Utils/Suggestions/VerifiedFixRunbookSuggestion.js +39 -0
- package/Utils/Suggestions/VerifiedFixRunbookSuggestion.mjs +2 -0
- package/Utils/Syslog/SyslogMessageParser.js +16 -6
- package/Utils/Telemetry/HeartbeatAvailability.d.mts +4 -0
- package/Utils/Telemetry/HeartbeatAvailability.d.ts +4 -0
- package/Utils/Telemetry/HeartbeatAvailability.js +113 -26
- package/Utils/Uptime/DayUptimeGraphUtil.js +2 -2
- package/Utils/ValueFormatter.d.mts +1 -0
- package/Utils/ValueFormatter.d.ts +1 -0
- package/Utils/ValueFormatter.js +258 -18
- package/package.json +1 -1
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export declare enum PromQLTokenType {
|
|
2
|
+
Identifier = "Identifier",
|
|
3
|
+
MetricIdentifier = "MetricIdentifier",
|
|
4
|
+
Number = "Number",
|
|
5
|
+
Duration = "Duration",
|
|
6
|
+
String = "String",
|
|
7
|
+
LeftParen = "(",
|
|
8
|
+
RightParen = ")",
|
|
9
|
+
LeftBrace = "{",
|
|
10
|
+
RightBrace = "}",
|
|
11
|
+
LeftBracket = "[",
|
|
12
|
+
RightBracket = "]",
|
|
13
|
+
Comma = ",",
|
|
14
|
+
Colon = ":",
|
|
15
|
+
At = "@",
|
|
16
|
+
Add = "+",
|
|
17
|
+
Sub = "-",
|
|
18
|
+
Mul = "*",
|
|
19
|
+
Div = "/",
|
|
20
|
+
Mod = "%",
|
|
21
|
+
Pow = "^",
|
|
22
|
+
Eql = "==",
|
|
23
|
+
Neq = "!=",
|
|
24
|
+
Gtr = ">",
|
|
25
|
+
Lss = "<",
|
|
26
|
+
Gte = ">=",
|
|
27
|
+
Lte = "<=",
|
|
28
|
+
Assign = "=",
|
|
29
|
+
RegexMatch = "=~",
|
|
30
|
+
RegexNoMatch = "!~",
|
|
31
|
+
EOF = "EOF"
|
|
32
|
+
}
|
|
33
|
+
export interface PromQLToken {
|
|
34
|
+
type: PromQLTokenType;
|
|
35
|
+
text: string;
|
|
36
|
+
start: number;
|
|
37
|
+
end: number;
|
|
38
|
+
}
|
|
39
|
+
export declare const tokenizePromQL: (input: string) => Array<PromQLToken>;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export declare enum PromQLTokenType {
|
|
2
|
+
Identifier = "Identifier",
|
|
3
|
+
MetricIdentifier = "MetricIdentifier",
|
|
4
|
+
Number = "Number",
|
|
5
|
+
Duration = "Duration",
|
|
6
|
+
String = "String",
|
|
7
|
+
LeftParen = "(",
|
|
8
|
+
RightParen = ")",
|
|
9
|
+
LeftBrace = "{",
|
|
10
|
+
RightBrace = "}",
|
|
11
|
+
LeftBracket = "[",
|
|
12
|
+
RightBracket = "]",
|
|
13
|
+
Comma = ",",
|
|
14
|
+
Colon = ":",
|
|
15
|
+
At = "@",
|
|
16
|
+
Add = "+",
|
|
17
|
+
Sub = "-",
|
|
18
|
+
Mul = "*",
|
|
19
|
+
Div = "/",
|
|
20
|
+
Mod = "%",
|
|
21
|
+
Pow = "^",
|
|
22
|
+
Eql = "==",
|
|
23
|
+
Neq = "!=",
|
|
24
|
+
Gtr = ">",
|
|
25
|
+
Lss = "<",
|
|
26
|
+
Gte = ">=",
|
|
27
|
+
Lte = "<=",
|
|
28
|
+
Assign = "=",
|
|
29
|
+
RegexMatch = "=~",
|
|
30
|
+
RegexNoMatch = "!~",
|
|
31
|
+
EOF = "EOF"
|
|
32
|
+
}
|
|
33
|
+
export interface PromQLToken {
|
|
34
|
+
type: PromQLTokenType;
|
|
35
|
+
text: string;
|
|
36
|
+
start: number;
|
|
37
|
+
end: number;
|
|
38
|
+
}
|
|
39
|
+
export declare const tokenizePromQL: (input: string) => Array<PromQLToken>;
|
|
@@ -0,0 +1,391 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.tokenizePromQL = exports.PromQLTokenType = void 0;
|
|
7
|
+
const PromQLError_1 = __importDefault(require("./PromQLError"));
|
|
8
|
+
/*
|
|
9
|
+
* Splits a PromQL query into tokens (promql/parser/lex.go).
|
|
10
|
+
*
|
|
11
|
+
* A hand-written scanner: PromQL's strings carry Go's escapes, its durations
|
|
12
|
+
* are a number glued to a unit (`5m`), and `#` starts a comment, none of which
|
|
13
|
+
* a regular expression tokenizer gets right on its own.
|
|
14
|
+
*/
|
|
15
|
+
var PromQLTokenType;
|
|
16
|
+
(function (PromQLTokenType) {
|
|
17
|
+
PromQLTokenType["Identifier"] = "Identifier";
|
|
18
|
+
// An identifier with a colon in it, which only a metric name may have.
|
|
19
|
+
PromQLTokenType["MetricIdentifier"] = "MetricIdentifier";
|
|
20
|
+
PromQLTokenType["Number"] = "Number";
|
|
21
|
+
PromQLTokenType["Duration"] = "Duration";
|
|
22
|
+
PromQLTokenType["String"] = "String";
|
|
23
|
+
PromQLTokenType["LeftParen"] = "(";
|
|
24
|
+
PromQLTokenType["RightParen"] = ")";
|
|
25
|
+
PromQLTokenType["LeftBrace"] = "{";
|
|
26
|
+
PromQLTokenType["RightBrace"] = "}";
|
|
27
|
+
PromQLTokenType["LeftBracket"] = "[";
|
|
28
|
+
PromQLTokenType["RightBracket"] = "]";
|
|
29
|
+
PromQLTokenType["Comma"] = ",";
|
|
30
|
+
PromQLTokenType["Colon"] = ":";
|
|
31
|
+
PromQLTokenType["At"] = "@";
|
|
32
|
+
PromQLTokenType["Add"] = "+";
|
|
33
|
+
PromQLTokenType["Sub"] = "-";
|
|
34
|
+
PromQLTokenType["Mul"] = "*";
|
|
35
|
+
PromQLTokenType["Div"] = "/";
|
|
36
|
+
PromQLTokenType["Mod"] = "%";
|
|
37
|
+
PromQLTokenType["Pow"] = "^";
|
|
38
|
+
PromQLTokenType["Eql"] = "==";
|
|
39
|
+
PromQLTokenType["Neq"] = "!=";
|
|
40
|
+
PromQLTokenType["Gtr"] = ">";
|
|
41
|
+
PromQLTokenType["Lss"] = "<";
|
|
42
|
+
PromQLTokenType["Gte"] = ">=";
|
|
43
|
+
PromQLTokenType["Lte"] = "<=";
|
|
44
|
+
PromQLTokenType["Assign"] = "=";
|
|
45
|
+
PromQLTokenType["RegexMatch"] = "=~";
|
|
46
|
+
PromQLTokenType["RegexNoMatch"] = "!~";
|
|
47
|
+
PromQLTokenType["EOF"] = "EOF";
|
|
48
|
+
})(PromQLTokenType || (exports.PromQLTokenType = PromQLTokenType = {}));
|
|
49
|
+
const isDigit = (character) => {
|
|
50
|
+
return character >= "0" && character <= "9";
|
|
51
|
+
};
|
|
52
|
+
const isAlpha = (character) => {
|
|
53
|
+
return ((character >= "a" && character <= "z") ||
|
|
54
|
+
(character >= "A" && character <= "Z") ||
|
|
55
|
+
character === "_");
|
|
56
|
+
};
|
|
57
|
+
const isAlphaNumeric = (character) => {
|
|
58
|
+
return isAlpha(character) || isDigit(character);
|
|
59
|
+
};
|
|
60
|
+
const isHexDigit = (character) => {
|
|
61
|
+
return (isDigit(character) ||
|
|
62
|
+
(character >= "a" && character <= "f") ||
|
|
63
|
+
(character >= "A" && character <= "F"));
|
|
64
|
+
};
|
|
65
|
+
const isWhiteSpace = (character) => {
|
|
66
|
+
return (character === " " ||
|
|
67
|
+
character === "\t" ||
|
|
68
|
+
character === "\n" ||
|
|
69
|
+
character === "\r");
|
|
70
|
+
};
|
|
71
|
+
const DURATION_UNITS = [
|
|
72
|
+
"ms",
|
|
73
|
+
"y",
|
|
74
|
+
"w",
|
|
75
|
+
"d",
|
|
76
|
+
"h",
|
|
77
|
+
"m",
|
|
78
|
+
"s",
|
|
79
|
+
];
|
|
80
|
+
const SIMPLE_ESCAPES = {
|
|
81
|
+
a: "\x07",
|
|
82
|
+
b: "\b",
|
|
83
|
+
f: "\f",
|
|
84
|
+
n: "\n",
|
|
85
|
+
r: "\r",
|
|
86
|
+
t: "\t",
|
|
87
|
+
v: "\v",
|
|
88
|
+
"\\": "\\",
|
|
89
|
+
"'": "'",
|
|
90
|
+
'"': '"',
|
|
91
|
+
};
|
|
92
|
+
const TWO_CHARACTER_OPERATORS = {
|
|
93
|
+
"==": PromQLTokenType.Eql,
|
|
94
|
+
"!=": PromQLTokenType.Neq,
|
|
95
|
+
">=": PromQLTokenType.Gte,
|
|
96
|
+
"<=": PromQLTokenType.Lte,
|
|
97
|
+
"=~": PromQLTokenType.RegexMatch,
|
|
98
|
+
"!~": PromQLTokenType.RegexNoMatch,
|
|
99
|
+
};
|
|
100
|
+
const ONE_CHARACTER_TOKENS = {
|
|
101
|
+
"(": PromQLTokenType.LeftParen,
|
|
102
|
+
")": PromQLTokenType.RightParen,
|
|
103
|
+
"{": PromQLTokenType.LeftBrace,
|
|
104
|
+
"}": PromQLTokenType.RightBrace,
|
|
105
|
+
"[": PromQLTokenType.LeftBracket,
|
|
106
|
+
"]": PromQLTokenType.RightBracket,
|
|
107
|
+
",": PromQLTokenType.Comma,
|
|
108
|
+
":": PromQLTokenType.Colon,
|
|
109
|
+
"@": PromQLTokenType.At,
|
|
110
|
+
"+": PromQLTokenType.Add,
|
|
111
|
+
"-": PromQLTokenType.Sub,
|
|
112
|
+
"*": PromQLTokenType.Mul,
|
|
113
|
+
"/": PromQLTokenType.Div,
|
|
114
|
+
"%": PromQLTokenType.Mod,
|
|
115
|
+
"^": PromQLTokenType.Pow,
|
|
116
|
+
">": PromQLTokenType.Gtr,
|
|
117
|
+
"<": PromQLTokenType.Lss,
|
|
118
|
+
"=": PromQLTokenType.Assign,
|
|
119
|
+
};
|
|
120
|
+
class PromQLLexer {
|
|
121
|
+
constructor(input) {
|
|
122
|
+
this.position = 0;
|
|
123
|
+
this.tokens = [];
|
|
124
|
+
this.input = input;
|
|
125
|
+
}
|
|
126
|
+
tokenize() {
|
|
127
|
+
while (this.position < this.input.length) {
|
|
128
|
+
const character = this.input[this.position];
|
|
129
|
+
if (isWhiteSpace(character)) {
|
|
130
|
+
this.position++;
|
|
131
|
+
continue;
|
|
132
|
+
}
|
|
133
|
+
// A comment runs to the end of its line.
|
|
134
|
+
if (character === "#") {
|
|
135
|
+
while (this.position < this.input.length &&
|
|
136
|
+
this.input[this.position] !== "\n") {
|
|
137
|
+
this.position++;
|
|
138
|
+
}
|
|
139
|
+
continue;
|
|
140
|
+
}
|
|
141
|
+
if (isDigit(character) || (character === "." && isDigit(this.peek(1)))) {
|
|
142
|
+
this.scanNumberOrDuration();
|
|
143
|
+
continue;
|
|
144
|
+
}
|
|
145
|
+
if (isAlpha(character) || character === ":") {
|
|
146
|
+
/*
|
|
147
|
+
* A colon is part of a metric name (`job:rate5m`) except where it
|
|
148
|
+
* separates a subquery's range from its step, which always follows
|
|
149
|
+
* a duration and is caught by the bracket rule below.
|
|
150
|
+
*/
|
|
151
|
+
if (character === ":" && this.isInsideSubqueryBrackets()) {
|
|
152
|
+
this.push(PromQLTokenType.Colon, ":", this.position, ++this.position);
|
|
153
|
+
continue;
|
|
154
|
+
}
|
|
155
|
+
this.scanIdentifier();
|
|
156
|
+
continue;
|
|
157
|
+
}
|
|
158
|
+
if (character === '"' || character === "'") {
|
|
159
|
+
this.scanQuotedString(character);
|
|
160
|
+
continue;
|
|
161
|
+
}
|
|
162
|
+
if (character === "`") {
|
|
163
|
+
this.scanRawString();
|
|
164
|
+
continue;
|
|
165
|
+
}
|
|
166
|
+
const pair = this.input.slice(this.position, this.position + 2);
|
|
167
|
+
const pairType = TWO_CHARACTER_OPERATORS[pair];
|
|
168
|
+
if (pairType) {
|
|
169
|
+
this.push(pairType, pair, this.position, this.position + 2);
|
|
170
|
+
this.position += 2;
|
|
171
|
+
continue;
|
|
172
|
+
}
|
|
173
|
+
const singleType = ONE_CHARACTER_TOKENS[character];
|
|
174
|
+
if (singleType) {
|
|
175
|
+
this.push(singleType, character, this.position, this.position + 1);
|
|
176
|
+
this.position++;
|
|
177
|
+
continue;
|
|
178
|
+
}
|
|
179
|
+
throw new PromQLError_1.default(`Unexpected character "${character}" at position ${this.position + 1}.`, undefined, { start: this.position, end: this.position + 1 });
|
|
180
|
+
}
|
|
181
|
+
this.push(PromQLTokenType.EOF, "", this.input.length, this.input.length);
|
|
182
|
+
return this.tokens;
|
|
183
|
+
}
|
|
184
|
+
peek(offset) {
|
|
185
|
+
return this.input[this.position + offset] || "";
|
|
186
|
+
}
|
|
187
|
+
push(type, text, start, end) {
|
|
188
|
+
this.tokens.push({ type, text, start, end });
|
|
189
|
+
}
|
|
190
|
+
/*
|
|
191
|
+
* True while the scanner sits between `[` and `]` right after a duration:
|
|
192
|
+
* `[5m:1m]`. Brackets never nest in PromQL, so the last bracket token
|
|
193
|
+
* decides.
|
|
194
|
+
*/
|
|
195
|
+
isInsideSubqueryBrackets() {
|
|
196
|
+
for (let index = this.tokens.length - 1; index >= 0; index--) {
|
|
197
|
+
const token = this.tokens[index];
|
|
198
|
+
if (token.type === PromQLTokenType.RightBracket) {
|
|
199
|
+
return false;
|
|
200
|
+
}
|
|
201
|
+
if (token.type === PromQLTokenType.LeftBracket) {
|
|
202
|
+
const previous = this.tokens[this.tokens.length - 1];
|
|
203
|
+
return (previous !== undefined &&
|
|
204
|
+
(previous.type === PromQLTokenType.Duration ||
|
|
205
|
+
previous.type === PromQLTokenType.Number));
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
return false;
|
|
209
|
+
}
|
|
210
|
+
scanIdentifier() {
|
|
211
|
+
const start = this.position;
|
|
212
|
+
while (this.position < this.input.length &&
|
|
213
|
+
(isAlphaNumeric(this.input[this.position]) ||
|
|
214
|
+
this.input[this.position] === ":")) {
|
|
215
|
+
this.position++;
|
|
216
|
+
}
|
|
217
|
+
const text = this.input.slice(start, this.position);
|
|
218
|
+
this.push(text.includes(":")
|
|
219
|
+
? PromQLTokenType.MetricIdentifier
|
|
220
|
+
: PromQLTokenType.Identifier, text, start, this.position);
|
|
221
|
+
}
|
|
222
|
+
scanNumberOrDuration() {
|
|
223
|
+
const start = this.position;
|
|
224
|
+
// Hexadecimal: 0x1F.
|
|
225
|
+
if (this.input[this.position] === "0" &&
|
|
226
|
+
(this.peek(1) === "x" || this.peek(1) === "X") &&
|
|
227
|
+
isHexDigit(this.peek(2))) {
|
|
228
|
+
this.position += 2;
|
|
229
|
+
while (this.position < this.input.length &&
|
|
230
|
+
isHexDigit(this.input[this.position])) {
|
|
231
|
+
this.position++;
|
|
232
|
+
}
|
|
233
|
+
this.finishNumber(start);
|
|
234
|
+
return;
|
|
235
|
+
}
|
|
236
|
+
while (this.position < this.input.length &&
|
|
237
|
+
isDigit(this.input[this.position])) {
|
|
238
|
+
this.position++;
|
|
239
|
+
}
|
|
240
|
+
// A duration: digits glued to a unit, possibly several (`1h30m`).
|
|
241
|
+
if (this.startsDurationUnit()) {
|
|
242
|
+
this.scanDurationRest(start);
|
|
243
|
+
return;
|
|
244
|
+
}
|
|
245
|
+
if (this.input[this.position] === ".") {
|
|
246
|
+
this.position++;
|
|
247
|
+
while (this.position < this.input.length &&
|
|
248
|
+
isDigit(this.input[this.position])) {
|
|
249
|
+
this.position++;
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
if (this.input[this.position] === "e" ||
|
|
253
|
+
this.input[this.position] === "E") {
|
|
254
|
+
const afterExponent = this.peek(1);
|
|
255
|
+
const signed = afterExponent === "+" || afterExponent === "-";
|
|
256
|
+
if (isDigit(signed ? this.peek(2) : afterExponent)) {
|
|
257
|
+
this.position += signed ? 2 : 1;
|
|
258
|
+
while (this.position < this.input.length &&
|
|
259
|
+
isDigit(this.input[this.position])) {
|
|
260
|
+
this.position++;
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
this.finishNumber(start);
|
|
265
|
+
}
|
|
266
|
+
finishNumber(start) {
|
|
267
|
+
// `1x` is neither a number nor a duration.
|
|
268
|
+
if (this.position < this.input.length &&
|
|
269
|
+
isAlpha(this.input[this.position])) {
|
|
270
|
+
throw new PromQLError_1.default(`"${this.input.slice(start, this.position + 1)}" is not a number or a duration. Write a number such as 1.5, or a duration such as 5m.`, undefined, { start, end: this.position + 1 });
|
|
271
|
+
}
|
|
272
|
+
this.push(PromQLTokenType.Number, this.input.slice(start, this.position), start, this.position);
|
|
273
|
+
}
|
|
274
|
+
startsDurationUnit() {
|
|
275
|
+
for (const unit of DURATION_UNITS) {
|
|
276
|
+
if (this.input.startsWith(unit, this.position)) {
|
|
277
|
+
const after = this.input[this.position + unit.length] || "";
|
|
278
|
+
// `5m` but not `5min`: a unit ends where the letters end.
|
|
279
|
+
if (!isAlphaNumeric(after) || isDigit(after)) {
|
|
280
|
+
return true;
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
return false;
|
|
285
|
+
}
|
|
286
|
+
scanDurationRest(start) {
|
|
287
|
+
while (this.position < this.input.length) {
|
|
288
|
+
let matchedUnit = undefined;
|
|
289
|
+
for (const unit of DURATION_UNITS) {
|
|
290
|
+
if (this.input.startsWith(unit, this.position)) {
|
|
291
|
+
const after = this.input[this.position + unit.length] || "";
|
|
292
|
+
if (!isAlphaNumeric(after) || isDigit(after)) {
|
|
293
|
+
matchedUnit = unit;
|
|
294
|
+
break;
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
if (!matchedUnit) {
|
|
299
|
+
break;
|
|
300
|
+
}
|
|
301
|
+
this.position += matchedUnit.length;
|
|
302
|
+
if (!isDigit(this.input[this.position] || "")) {
|
|
303
|
+
break;
|
|
304
|
+
}
|
|
305
|
+
while (this.position < this.input.length &&
|
|
306
|
+
isDigit(this.input[this.position])) {
|
|
307
|
+
this.position++;
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
const text = this.input.slice(start, this.position);
|
|
311
|
+
if (this.position < this.input.length &&
|
|
312
|
+
isAlpha(this.input[this.position])) {
|
|
313
|
+
throw new PromQLError_1.default(`"${text}${this.input[this.position]}" is not a duration. Write a duration such as 30s, 5m, 1h or 1h30m.`, undefined, { start, end: this.position + 1 });
|
|
314
|
+
}
|
|
315
|
+
this.push(PromQLTokenType.Duration, text, start, this.position);
|
|
316
|
+
}
|
|
317
|
+
scanQuotedString(quote) {
|
|
318
|
+
const start = this.position;
|
|
319
|
+
this.position++;
|
|
320
|
+
let value = "";
|
|
321
|
+
while (this.position < this.input.length) {
|
|
322
|
+
const character = this.input[this.position];
|
|
323
|
+
if (character === quote) {
|
|
324
|
+
this.position++;
|
|
325
|
+
this.push(PromQLTokenType.String, value, start, this.position);
|
|
326
|
+
return;
|
|
327
|
+
}
|
|
328
|
+
if (character === "\n") {
|
|
329
|
+
break;
|
|
330
|
+
}
|
|
331
|
+
if (character === "\\") {
|
|
332
|
+
value += this.scanEscape(start);
|
|
333
|
+
continue;
|
|
334
|
+
}
|
|
335
|
+
value += character;
|
|
336
|
+
this.position++;
|
|
337
|
+
}
|
|
338
|
+
throw new PromQLError_1.default(`The string that starts at position ${start + 1} is not closed. End it with ${quote}.`, undefined, { start, end: this.input.length });
|
|
339
|
+
}
|
|
340
|
+
scanEscape(stringStart) {
|
|
341
|
+
const escapeStart = this.position;
|
|
342
|
+
const next = this.peek(1);
|
|
343
|
+
const simple = SIMPLE_ESCAPES[next];
|
|
344
|
+
if (simple !== undefined) {
|
|
345
|
+
this.position += 2;
|
|
346
|
+
return simple;
|
|
347
|
+
}
|
|
348
|
+
const readHex = (length) => {
|
|
349
|
+
const digits = this.input.slice(this.position + 2, this.position + 2 + length);
|
|
350
|
+
if (digits.length !== length || !Array.from(digits).every(isHexDigit)) {
|
|
351
|
+
throw new PromQLError_1.default(`The escape at position ${escapeStart + 1} is not complete: \\${next} takes ${length} hexadecimal digits.`, undefined, { start: stringStart, end: escapeStart + 2 + length });
|
|
352
|
+
}
|
|
353
|
+
this.position += 2 + length;
|
|
354
|
+
return String.fromCodePoint(parseInt(digits, 16));
|
|
355
|
+
};
|
|
356
|
+
if (next === "x") {
|
|
357
|
+
return readHex(2);
|
|
358
|
+
}
|
|
359
|
+
if (next === "u") {
|
|
360
|
+
return readHex(4);
|
|
361
|
+
}
|
|
362
|
+
if (next === "U") {
|
|
363
|
+
return readHex(8);
|
|
364
|
+
}
|
|
365
|
+
// Three octal digits: \101 is "A".
|
|
366
|
+
if (next >= "0" && next <= "7") {
|
|
367
|
+
const digits = this.input.slice(this.position + 1, this.position + 4);
|
|
368
|
+
if (digits.length === 3 &&
|
|
369
|
+
Array.from(digits).every((digit) => {
|
|
370
|
+
return digit >= "0" && digit <= "7";
|
|
371
|
+
})) {
|
|
372
|
+
this.position += 4;
|
|
373
|
+
return String.fromCharCode(parseInt(digits, 8));
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
throw new PromQLError_1.default(`Unknown escape "\\${next}" at position ${escapeStart + 1}. Write a backslash as \\\\.`, undefined, { start: stringStart, end: escapeStart + 2 });
|
|
377
|
+
}
|
|
378
|
+
scanRawString() {
|
|
379
|
+
const start = this.position;
|
|
380
|
+
const end = this.input.indexOf("`", start + 1);
|
|
381
|
+
if (end === -1) {
|
|
382
|
+
throw new PromQLError_1.default(`The string that starts at position ${start + 1} is not closed. End it with \`.`, undefined, { start, end: this.input.length });
|
|
383
|
+
}
|
|
384
|
+
this.position = end + 1;
|
|
385
|
+
this.push(PromQLTokenType.String, this.input.slice(start + 1, end), start, this.position);
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
const tokenizePromQL = (input) => {
|
|
389
|
+
return new PromQLLexer(input).tokenize();
|
|
390
|
+
};
|
|
391
|
+
exports.tokenizePromQL = tokenizePromQL;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface KahanSum {
|
|
2
|
+
sum: number;
|
|
3
|
+
compensation: number;
|
|
4
|
+
}
|
|
5
|
+
export declare const kahanAdd: (state: KahanSum, value: number) => void;
|
|
6
|
+
export declare const kahanResult: (state: KahanSum) => number;
|
|
7
|
+
export declare const promQLQuantile: (phi: number, values: Array<number>) => number;
|
|
8
|
+
export declare const compareWithNaNFirst: (a: number, b: number) => number;
|
|
9
|
+
export declare const linearRegression: (timestampsMs: ArrayLike<number>, values: ArrayLike<number>, interceptTimeMs: number) => {
|
|
10
|
+
slope: number;
|
|
11
|
+
intercept: number;
|
|
12
|
+
};
|
|
13
|
+
export interface HistogramBucket {
|
|
14
|
+
upperBound: number;
|
|
15
|
+
count: number;
|
|
16
|
+
}
|
|
17
|
+
export declare const bucketQuantile: (phi: number, input: Array<HistogramBucket>) => number;
|
|
18
|
+
export declare const promQLPow: (base: number, exponent: number) => number;
|
|
19
|
+
export declare const upperBound: (sorted: ArrayLike<number>, value: number) => number;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface KahanSum {
|
|
2
|
+
sum: number;
|
|
3
|
+
compensation: number;
|
|
4
|
+
}
|
|
5
|
+
export declare const kahanAdd: (state: KahanSum, value: number) => void;
|
|
6
|
+
export declare const kahanResult: (state: KahanSum) => number;
|
|
7
|
+
export declare const promQLQuantile: (phi: number, values: Array<number>) => number;
|
|
8
|
+
export declare const compareWithNaNFirst: (a: number, b: number) => number;
|
|
9
|
+
export declare const linearRegression: (timestampsMs: ArrayLike<number>, values: ArrayLike<number>, interceptTimeMs: number) => {
|
|
10
|
+
slope: number;
|
|
11
|
+
intercept: number;
|
|
12
|
+
};
|
|
13
|
+
export interface HistogramBucket {
|
|
14
|
+
upperBound: number;
|
|
15
|
+
count: number;
|
|
16
|
+
}
|
|
17
|
+
export declare const bucketQuantile: (phi: number, input: Array<HistogramBucket>) => number;
|
|
18
|
+
export declare const promQLPow: (base: number, exponent: number) => number;
|
|
19
|
+
export declare const upperBound: (sorted: ArrayLike<number>, value: number) => number;
|