@oneuptime/common 16.0.0 → 17.0.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/AnalyticsModels/RumProductAnalyticsEvent.js +15 -6
- package/Models/AnalyticsModels/RumProductAnalyticsSession.js +27 -10
- package/Models/AnalyticsModels/RumProductAnalyticsUser.js +16 -4
- package/Models/AnalyticsModels/RumSession.js +12 -0
- package/Models/DatabaseModels/AlertSeverity.js +12 -3
- package/Models/DatabaseModels/DataAsset.d.mts +1 -0
- package/Models/DatabaseModels/DataAsset.d.ts +1 -0
- package/Models/DatabaseModels/DataAsset.js +23 -0
- package/Models/DatabaseModels/DataBiConnection.d.mts +2 -1
- package/Models/DatabaseModels/DataBiConnection.d.ts +2 -1
- package/Models/DatabaseModels/DataBiConnection.js +15 -0
- package/Models/DatabaseModels/DataCheck.d.mts +3 -0
- package/Models/DatabaseModels/DataCheck.d.ts +3 -0
- package/Models/DatabaseModels/DataCheck.js +49 -0
- package/Models/DatabaseModels/DataDashboard.d.mts +1 -0
- package/Models/DatabaseModels/DataDashboard.d.ts +1 -0
- package/Models/DatabaseModels/DataDashboard.js +15 -0
- package/Models/DatabaseModels/DataPipeline.d.mts +1 -0
- package/Models/DatabaseModels/DataPipeline.d.ts +1 -0
- package/Models/DatabaseModels/DataPipeline.js +25 -0
- package/Models/DatabaseModels/DataPipelineOwnerTeam.d.mts +19 -0
- package/Models/DatabaseModels/DataPipelineOwnerTeam.d.ts +19 -0
- package/Models/DatabaseModels/DataPipelineOwnerTeam.js +477 -0
- package/Models/DatabaseModels/DataPipelineOwnerTeam.mjs +2 -0
- package/Models/DatabaseModels/DataPipelineOwnerUser.d.mts +18 -0
- package/Models/DatabaseModels/DataPipelineOwnerUser.d.ts +18 -0
- package/Models/DatabaseModels/DataPipelineOwnerUser.js +476 -0
- package/Models/DatabaseModels/DataPipelineOwnerUser.mjs +2 -0
- package/Models/DatabaseModels/DataStore.d.mts +1 -0
- package/Models/DatabaseModels/DataStore.d.ts +1 -0
- package/Models/DatabaseModels/DataStore.js +23 -0
- package/Models/DatabaseModels/DataStoreFinding.d.mts +2 -0
- package/Models/DatabaseModels/DataStoreFinding.d.ts +2 -0
- package/Models/DatabaseModels/DataStoreFinding.js +21 -0
- package/Models/DatabaseModels/EmailLog.d.mts +1 -0
- package/Models/DatabaseModels/EmailLog.d.ts +1 -0
- package/Models/DatabaseModels/EmailLog.js +35 -0
- package/Models/DatabaseModels/GlobalConfig.d.mts +5 -0
- package/Models/DatabaseModels/GlobalConfig.d.ts +5 -0
- package/Models/DatabaseModels/GlobalConfig.js +128 -0
- package/Models/DatabaseModels/GlobalOidc.d.mts +1 -0
- package/Models/DatabaseModels/GlobalOidc.d.ts +1 -0
- package/Models/DatabaseModels/GlobalOidc.js +29 -0
- package/Models/DatabaseModels/IncidentSeverity.js +12 -3
- package/Models/DatabaseModels/Index.js +6 -0
- package/Models/DatabaseModels/Monitor.js +18 -0
- package/Models/DatabaseModels/NetworkDevice.d.mts +1 -0
- package/Models/DatabaseModels/NetworkDevice.d.ts +1 -0
- package/Models/DatabaseModels/NetworkDevice.js +49 -0
- package/Models/DatabaseModels/NetworkDeviceAutoImportRule.js +2 -2
- package/Models/DatabaseModels/OnCallDutyPolicyEscalationRule.js +1 -1
- package/Models/DatabaseModels/OnCallDutyPolicyExecutionLog.d.mts +6 -0
- package/Models/DatabaseModels/OnCallDutyPolicyExecutionLog.d.ts +6 -0
- package/Models/DatabaseModels/OnCallDutyPolicyExecutionLog.js +156 -1
- package/Models/DatabaseModels/OnCallDutyPolicyScheduleLayer.js +1 -1
- package/Models/DatabaseModels/OnCallDutyPolicyScheduleLayerUser.js +1 -1
- package/Models/DatabaseModels/Probe.d.mts +4 -0
- package/Models/DatabaseModels/Probe.d.ts +4 -0
- package/Models/DatabaseModels/Probe.js +100 -0
- package/Models/DatabaseModels/ProductFeedback.d.mts +2 -1
- package/Models/DatabaseModels/ProductFeedback.d.ts +2 -1
- package/Models/DatabaseModels/ProductFeedback.js +34 -2
- package/Models/DatabaseModels/Project.d.mts +4 -1
- package/Models/DatabaseModels/Project.d.ts +4 -1
- package/Models/DatabaseModels/Project.js +147 -7
- package/Models/DatabaseModels/ProjectCallSMSConfig.js +8 -2
- package/Models/DatabaseModels/ProjectOidc.d.mts +1 -0
- package/Models/DatabaseModels/ProjectOidc.d.ts +1 -0
- package/Models/DatabaseModels/ProjectOidc.js +46 -0
- package/Models/DatabaseModels/Reseller.js +8 -2
- package/Models/DatabaseModels/ResellerPlan.js +12 -3
- package/Models/DatabaseModels/RumApplication.d.mts +1 -0
- package/Models/DatabaseModels/RumApplication.d.ts +1 -0
- package/Models/DatabaseModels/RumApplication.js +58 -0
- package/Models/DatabaseModels/RumSessionErasureRequest.d.mts +1 -0
- package/Models/DatabaseModels/RumSessionErasureRequest.d.ts +1 -0
- package/Models/DatabaseModels/RumSessionErasureRequest.js +40 -0
- package/Models/DatabaseModels/SecurityCaseTask.d.mts +1 -0
- package/Models/DatabaseModels/SecurityCaseTask.d.ts +1 -0
- package/Models/DatabaseModels/SecurityCaseTask.js +27 -0
- package/Models/DatabaseModels/ServerEmailLog.d.mts +12 -0
- package/Models/DatabaseModels/ServerEmailLog.d.ts +12 -0
- package/Models/DatabaseModels/ServerEmailLog.js +206 -0
- package/Models/DatabaseModels/ServerEmailLog.mjs +2 -0
- package/Models/DatabaseModels/StatusPageGroup.js +1 -1
- package/Models/DatabaseModels/StatusPageResource.js +1 -1
- package/Models/DatabaseModels/TelemetryException.js +15 -2
- package/Models/DatabaseModels/TelemetryIngestionKey.js +10 -0
- package/Models/DatabaseModels/User.d.mts +3 -0
- package/Models/DatabaseModels/User.d.ts +3 -0
- package/Models/DatabaseModels/User.js +66 -0
- package/Models/DatabaseModels/UserSession.d.mts +1 -0
- package/Models/DatabaseModels/UserSession.d.ts +1 -0
- package/Models/DatabaseModels/UserSession.js +32 -0
- package/Models/DatabaseModels/WorkspaceLiveMessage.js +21 -15
- package/Models/DatabaseModels/WorkspaceNotificationLog.js +17 -9
- package/Models/DatabaseModels/WorkspaceNotificationRule.js +8 -2
- package/Models/DatabaseModels/WorkspaceNotificationSummary.js +1 -1
- package/Server/Services/DatabaseService.d.mts +6 -0
- package/Server/Services/DatabaseService.d.ts +6 -0
- package/Server/Utils/Workspace/WorkspaceBase.d.mts +1 -0
- package/Server/Utils/Workspace/WorkspaceBase.d.ts +1 -0
- package/Types/AI/AIActionWords.js +1 -0
- package/Types/AI/AIChatPageContext.d.mts +1 -0
- package/Types/AI/AIChatPageContext.d.ts +1 -0
- package/Types/AI/AIChatPageContext.js +6 -0
- package/Types/AI/AIRunProducts.d.mts +14 -0
- package/Types/AI/AIRunProducts.d.ts +14 -0
- package/Types/AI/AIRunProducts.js +40 -0
- package/Types/AI/AIRunProducts.mjs +2 -0
- package/Types/AI/AskAiRatings.d.mts +31 -0
- package/Types/AI/AskAiRatings.d.ts +31 -0
- package/Types/AI/AskAiRatings.js +173 -0
- package/Types/AI/AskAiRatings.mjs +13 -0
- package/Types/Accounts/SignUpInvitation.d.mts +12 -0
- package/Types/Accounts/SignUpInvitation.d.ts +12 -0
- package/Types/Accounts/SignUpInvitation.js +84 -0
- package/Types/Accounts/SignUpInvitation.mjs +5 -0
- package/Types/Analytics/ActivationMilestone.d.mts +2 -1
- package/Types/Analytics/ActivationMilestone.d.ts +2 -1
- package/Types/Analytics/ActivationMilestone.js +11 -0
- package/Types/Analytics/ProductEvent.d.mts +11 -0
- package/Types/Analytics/ProductEvent.d.ts +11 -0
- package/Types/Analytics/ProductEvent.js +166 -13
- package/Types/Analytics/ProductEvent.mjs +3 -0
- package/Types/Backup/BackupScriptRun.d.mts +17 -0
- package/Types/Backup/BackupScriptRun.d.ts +17 -0
- package/Types/Backup/BackupScriptRun.js +96 -0
- package/Types/Backup/BackupScriptRun.mjs +6 -0
- package/Types/BaseDatabase/DatabaseCommonInteractionProps.d.mts +2 -0
- package/Types/BaseDatabase/DatabaseCommonInteractionProps.d.ts +2 -0
- package/Types/BaseDatabase/ReadAudience.d.mts +9 -0
- package/Types/BaseDatabase/ReadAudience.d.ts +9 -0
- package/Types/BaseDatabase/ReadAudience.js +2 -0
- package/Types/BaseDatabase/ReadAudience.mjs +1 -0
- package/Types/Cloud/CloudKeyMetricGroup.d.mts +17 -0
- package/Types/Cloud/CloudKeyMetricGroup.d.ts +17 -0
- package/Types/Cloud/CloudKeyMetricGroup.js +84 -0
- package/Types/Cloud/CloudKeyMetricGroup.mjs +5 -0
- package/Types/Cloud/CloudKeyMetrics.d.mts +28 -1
- package/Types/Cloud/CloudKeyMetrics.d.ts +28 -1
- package/Types/Cloud/CloudKeyMetrics.js +1209 -206
- package/Types/Cloud/CloudKeyMetrics.mjs +6 -0
- package/Types/Cloud/CloudResourceCatalog.js +43 -12
- package/Types/CloudConnection/CloudConnectionSetupCommands.d.mts +1 -0
- package/Types/CloudConnection/CloudConnectionSetupCommands.d.ts +1 -0
- package/Types/CloudConnection/CloudConnectionSetupCommands.js +49 -6
- package/Types/CloudConnection/CloudConnectionSetupCommands.mjs +1 -0
- package/Types/CloudConnection/CloudStreamTemplate.js +6 -2
- package/Types/CreateFormAddress.d.mts +3 -0
- package/Types/CreateFormAddress.d.ts +3 -0
- package/Types/CreateFormAddress.js +17 -0
- package/Types/CreateFormAddress.mjs +4 -0
- package/Types/DataObservability/DataAssetFreshness.d.mts +5 -0
- package/Types/DataObservability/DataAssetFreshness.d.ts +5 -0
- package/Types/DataObservability/DataAssetFreshness.js +28 -5
- package/Types/DataObservability/DataAssetFreshness.mjs +1 -0
- package/Types/DataObservability/DataBiLineage.d.mts +69 -0
- package/Types/DataObservability/DataBiLineage.d.ts +69 -0
- package/Types/DataObservability/DataBiLineage.js +198 -0
- package/Types/DataObservability/DataBiLineage.mjs +13 -0
- package/Types/DataObservability/DataLineageColumnTrail.d.mts +2 -1
- package/Types/DataObservability/DataLineageColumnTrail.d.ts +2 -1
- package/Types/DataObservability/DataLineageColumnTrail.js +41 -3
- package/Types/DataObservability/DataLineageColumnTrail.mjs +1 -0
- package/Types/DataObservability/DataLineageMap.d.mts +67 -1
- package/Types/DataObservability/DataLineageMap.d.ts +67 -1
- package/Types/DataObservability/DataLineageMap.js +335 -3
- package/Types/DataObservability/DataLineageMap.mjs +14 -0
- package/Types/DataObservability/DataObservabilityApiTypes.d.mts +42 -2
- package/Types/DataObservability/DataObservabilityApiTypes.d.ts +42 -2
- package/Types/DataObservability/DataObservabilityApiTypes.js +21 -1
- package/Types/DataObservability/DataObservabilityApiTypes.mjs +4 -0
- package/Types/DataObservability/DataObservabilityAttention.d.mts +5 -0
- package/Types/DataObservability/DataObservabilityAttention.d.ts +5 -0
- package/Types/DataObservability/DataObservabilityAttention.js +48 -1
- package/Types/DataObservability/DataObservabilityAttention.mjs +5 -0
- package/Types/DataObservability/DataPipelineSchedule.d.mts +4 -0
- package/Types/DataObservability/DataPipelineSchedule.d.ts +4 -0
- package/Types/DataObservability/DataPipelineSchedule.js +26 -6
- package/Types/DataObservability/DataPipelineSchedule.mjs +1 -0
- package/Types/DataObservability/DataTableLineage.d.mts +6 -0
- package/Types/DataObservability/DataTableLineage.d.ts +6 -0
- package/Types/DataSecurity/DataSecurityApiTypes.d.mts +24 -0
- package/Types/DataSecurity/DataSecurityApiTypes.d.ts +24 -0
- package/Types/DataSecurity/DataSecurityApiTypes.js +21 -1
- package/Types/DataSecurity/DataSecurityApiTypes.mjs +2 -0
- package/Types/DataSecurity/FindingSampleRecord.d.mts +16 -0
- package/Types/DataSecurity/FindingSampleRecord.d.ts +16 -0
- package/Types/DataSecurity/FindingSampleRecord.js +112 -0
- package/Types/DataSecurity/FindingSampleRecord.mjs +6 -0
- package/Types/Database/AccessControl/PermissionScopeNarrowing.js +6 -0
- package/Types/Database/MoveInList.d.mts +41 -0
- package/Types/Database/MoveInList.d.ts +41 -0
- package/Types/Database/MoveInList.js +177 -0
- package/Types/Database/MoveInList.mjs +4 -0
- package/Types/Email/ServerEmailLog.d.mts +41 -0
- package/Types/Email/ServerEmailLog.d.ts +41 -0
- package/Types/Email/ServerEmailLog.js +136 -0
- package/Types/Email/ServerEmailLog.mjs +11 -0
- package/Types/Exception/ProductSwitchedOffException.d.mts +12 -0
- package/Types/Exception/ProductSwitchedOffException.d.ts +12 -0
- package/Types/Exception/ProductSwitchedOffException.js +38 -0
- package/Types/Exception/ProductSwitchedOffException.mjs +2 -0
- package/Types/Exception/UnexplainedError.d.mts +7 -0
- package/Types/Exception/UnexplainedError.d.ts +7 -0
- package/Types/Exception/UnexplainedError.js +36 -1
- package/Types/Exception/UnexplainedError.mjs +2 -0
- package/Types/InstallationHealth/InstallationHealth.d.mts +39 -0
- package/Types/InstallationHealth/InstallationHealth.d.ts +39 -0
- package/Types/InstallationHealth/InstallationHealth.js +163 -0
- package/Types/Kubernetes/KubernetesHealth.d.mts +16 -0
- package/Types/Kubernetes/KubernetesHealth.d.ts +16 -0
- package/Types/Kubernetes/KubernetesHealth.js +128 -6
- package/Types/Kubernetes/KubernetesHealth.mjs +2 -0
- package/Types/Monitor/CloudAppAlertTemplates.d.mts +3 -13
- package/Types/Monitor/CloudAppAlertTemplates.d.ts +3 -13
- package/Types/Monitor/CloudAppAlertTemplates.js +13 -199
- package/Types/Monitor/CriteriaFilter.d.mts +2 -1
- package/Types/Monitor/CriteriaFilter.d.ts +2 -1
- package/Types/Monitor/CriteriaFilter.js +9 -1
- package/Types/Monitor/CriteriaFilterTerms.js +1 -0
- package/Types/Monitor/MessageQueueAlertTemplates.d.mts +6 -0
- package/Types/Monitor/MessageQueueAlertTemplates.d.ts +6 -0
- package/Types/Monitor/MessageQueueAlertTemplates.js +32 -0
- package/Types/Monitor/MessageQueueAlertTemplates.mjs +2 -0
- package/Types/Monitor/MonitorCriteriaInstance.d.mts +2 -0
- package/Types/Monitor/MonitorCriteriaInstance.d.ts +2 -0
- package/Types/Monitor/MonitorCriteriaInstance.js +52 -0
- package/Types/Monitor/MonitorMetricType.d.mts +2 -1
- package/Types/Monitor/MonitorMetricType.d.ts +2 -1
- package/Types/Monitor/MonitorMetricType.js +1 -0
- package/Types/Monitor/MonitorStepLimit.d.mts +8 -0
- package/Types/Monitor/MonitorStepLimit.d.ts +8 -0
- package/Types/Monitor/MonitorStepLimit.js +62 -0
- package/Types/Monitor/MonitorStepLimit.mjs +3 -0
- package/Types/Monitor/MonitorSteps.js +5 -0
- package/Types/Monitor/MonitorType.js +2 -1
- package/Types/Monitor/ProbeStatusMonitor/ProbeStatusMonitorResponse.d.mts +5 -0
- package/Types/Monitor/ProbeStatusMonitor/ProbeStatusMonitorResponse.d.ts +5 -0
- package/Types/Monitor/Recommendation/MonitorRecommendationCatalog.d.mts +1 -1
- package/Types/Monitor/Recommendation/MonitorRecommendationCatalog.d.ts +1 -1
- package/Types/Monitor/Recommendation/MonitorRecommendationCatalog.js +111 -1
- package/Types/Monitor/Recommendation/MonitorRecommendationTypes.d.mts +7 -1
- package/Types/Monitor/Recommendation/MonitorRecommendationTypes.d.ts +7 -1
- package/Types/Monitor/Recommendation/MonitorRecommendationTypes.js +15 -0
- package/Types/Monitor/RequestHealthAlertTemplates.d.mts +66 -0
- package/Types/Monitor/RequestHealthAlertTemplates.d.ts +66 -0
- package/Types/Monitor/RequestHealthAlertTemplates.js +227 -0
- package/Types/Monitor/RequestHealthAlertTemplates.mjs +4 -0
- package/Types/Monitor/ServerlessAlertTemplates.d.mts +23 -0
- package/Types/Monitor/ServerlessAlertTemplates.d.ts +23 -0
- package/Types/Monitor/ServerlessAlertTemplates.js +111 -0
- package/Types/Monitor/ServerlessAlertTemplates.mjs +7 -0
- package/Types/Monitor/ServiceAlertTemplates.d.mts +3 -0
- package/Types/Monitor/ServiceAlertTemplates.d.ts +3 -0
- package/Types/Monitor/ServiceAlertTemplates.js +61 -0
- package/Types/Monitor/ServiceAlertTemplates.mjs +2 -0
- package/Types/Monitor/TelemetryRulePreview.js +18 -6
- package/Types/Monitor/WhoIsTold.d.mts +71 -0
- package/Types/Monitor/WhoIsTold.d.ts +71 -0
- package/Types/Monitor/WhoIsTold.js +348 -121
- package/Types/Monitor/WhoIsTold.mjs +7 -0
- package/Types/NetworkAutomation/RuleRunResult.js +9 -5
- package/Types/NetworkDevice/DiscoveredDevice.d.mts +40 -0
- package/Types/NetworkDevice/DiscoveredDevice.d.ts +40 -0
- package/Types/NetworkDevice/DiscoveredDevice.js +205 -1
- package/Types/NetworkDevice/DiscoveredDevice.mjs +9 -0
- package/Types/NetworkDevice/DiscoveryImport.js +8 -3
- package/Types/NetworkDevice/NetworkDeviceDiscoveredDetails.d.mts +26 -3
- package/Types/NetworkDevice/NetworkDeviceDiscoveredDetails.d.ts +26 -3
- package/Types/NetworkDevice/NetworkDeviceDiscoveredDetails.js +75 -3
- package/Types/NetworkDevice/NetworkDeviceDiscoveredDetails.mjs +2 -0
- package/Types/Notification/WhoWasTold.d.mts +190 -0
- package/Types/Notification/WhoWasTold.d.ts +190 -0
- package/Types/Notification/WhoWasTold.js +662 -0
- package/Types/Notification/WhoWasTold.mjs +16 -0
- package/Types/NotificationRule/PagingLadderDefault.d.mts +75 -0
- package/Types/NotificationRule/PagingLadderDefault.d.ts +75 -0
- package/Types/NotificationRule/PagingLadderDefault.js +529 -0
- package/Types/NotificationRule/PagingLadderDefault.mjs +24 -0
- package/Types/OnCallDutyPolicy/EveryNewEventRules.d.mts +7 -0
- package/Types/OnCallDutyPolicy/EveryNewEventRules.d.ts +7 -0
- package/Types/OnCallDutyPolicy/EveryNewEventRules.js +53 -2
- package/Types/OnCallDutyPolicy/EveryNewEventRules.mjs +3 -0
- package/Types/OnCallDutyPolicy/NotificationSetupToFinish.d.mts +6 -0
- package/Types/OnCallDutyPolicy/NotificationSetupToFinish.d.ts +6 -0
- package/Types/OnCallDutyPolicy/NotificationSetupToFinish.js +27 -0
- package/Types/OnCallDutyPolicy/NotificationSetupToFinish.mjs +3 -0
- package/Types/OnCallDutyPolicy/OnCallFireDrill.d.mts +83 -0
- package/Types/OnCallDutyPolicy/OnCallFireDrill.d.ts +83 -0
- package/Types/OnCallDutyPolicy/OnCallFireDrill.js +105 -0
- package/Types/OnCallDutyPolicy/OnCallFireDrill.mjs +9 -0
- package/Types/OnCallDutyPolicy/OnCallPagePassOn.js +12 -4
- package/Types/OnCallDutyPolicy/OnCallRunLevel.d.mts +12 -0
- package/Types/OnCallDutyPolicy/OnCallRunLevel.d.ts +12 -0
- package/Types/OnCallDutyPolicy/OnCallRunLevel.js +69 -8
- package/Types/OnCallDutyPolicy/OnCallRunLevel.mjs +3 -0
- package/Types/OnCallDutyPolicy/OnCallTestPage.d.mts +4 -0
- package/Types/OnCallDutyPolicy/OnCallTestPage.d.ts +4 -0
- package/Types/OnCallDutyPolicy/OnCallTestPage.js +20 -7
- package/Types/OnCallDutyPolicy/OnCallTestPage.mjs +2 -0
- package/Types/OnCallDutyPolicy/ScheduleLayersSave.d.mts +2 -0
- package/Types/OnCallDutyPolicy/ScheduleLayersSave.d.ts +2 -0
- package/Types/OnCallDutyPolicy/ScheduleLayersSave.js +14 -1
- package/Types/OnCallDutyPolicy/ScheduleLayersSave.mjs +2 -0
- package/Types/OnCallDutyPolicy/UserOverrideEdit.d.mts +7 -0
- package/Types/OnCallDutyPolicy/UserOverrideEdit.d.ts +7 -0
- package/Types/OnCallDutyPolicy/UserOverrideEdit.js +63 -1
- package/Types/OnCallDutyPolicy/UserOverrideEdit.mjs +4 -0
- package/Types/OnCallDutyPolicy/UserOverrideOverlap.d.mts +21 -1
- package/Types/OnCallDutyPolicy/UserOverrideOverlap.d.ts +21 -1
- package/Types/OnCallDutyPolicy/UserOverrideOverlap.js +46 -2
- package/Types/Permission.d.mts +8 -0
- package/Types/Permission.d.ts +8 -0
- package/Types/Permission.js +84 -0
- package/Types/Probe/ProbeBehind.d.mts +48 -0
- package/Types/Probe/ProbeBehind.d.ts +48 -0
- package/Types/Probe/ProbeBehind.js +196 -0
- package/Types/Probe/ProbeBehind.mjs +6 -0
- package/Types/Product/ProductRecordTables.d.mts +8 -0
- package/Types/Product/ProductRecordTables.d.ts +8 -0
- package/Types/Product/ProductRecordTables.js +847 -0
- package/Types/Product/ProductRecordTables.mjs +5 -0
- package/Types/Product/ProductUsage.d.mts +2 -0
- package/Types/Product/ProductUsage.d.ts +2 -0
- package/Types/Product/ProductUsage.js +41 -6
- package/Types/Product/ProductUsage.mjs +2 -0
- package/Types/Product/ServerProductOffReason.d.mts +4 -0
- package/Types/Product/ServerProductOffReason.d.ts +4 -0
- package/Types/Product/ServerProductOffReason.js +19 -0
- package/Types/Product/ServerProductOffReason.mjs +2 -0
- package/Types/Product/ServerProducts.d.mts +2 -4
- package/Types/Product/ServerProducts.d.ts +2 -4
- package/Types/Product/ServerProducts.js +19 -17
- package/Types/ProductFeedback/ProductFeedback.d.mts +45 -1
- package/Types/ProductFeedback/ProductFeedback.d.ts +45 -1
- package/Types/ProductFeedback/ProductFeedback.js +185 -5
- package/Types/ProductFeedback/ProductFeedback.mjs +11 -0
- package/Types/PushNotification/PushNotificationCategory.d.mts +1 -0
- package/Types/PushNotification/PushNotificationCategory.d.ts +1 -0
- package/Types/PushNotification/PushNotificationCategory.js +17 -6
- package/Types/PushNotification/PushNotificationCategory.mjs +1 -0
- package/Types/Rules/RuleCriteriaFieldRegistry.d.mts +18 -0
- package/Types/Rules/RuleCriteriaFieldRegistry.d.ts +18 -0
- package/Types/Rules/RuleCriteriaFieldRegistry.js +34 -1
- package/Types/Rules/RuleCriteriaFieldRegistry.mjs +4 -0
- package/Types/Rum/ProductAnalytics.d.mts +9 -0
- package/Types/Rum/ProductAnalytics.d.ts +9 -0
- package/Types/Rum/ProductAnalytics.js +56 -8
- package/Types/Rum/ProductAnalytics.mjs +6 -0
- package/Types/Rum/ProductAnalyticsEvents.js +2 -1
- package/Types/Rum/SessionReplay.d.mts +3 -0
- package/Types/Rum/SessionReplay.d.ts +3 -0
- package/Types/Rum/SessionReplay.js +35 -1
- package/Types/Rum/SessionReplay.mjs +2 -0
- package/Types/Runbook/RunbookTriggerType.d.mts +1 -0
- package/Types/Runbook/RunbookTriggerType.d.ts +1 -0
- package/Types/Runbook/RunbookTriggerType.js +19 -1
- package/Types/Runbook/RunbookTriggerType.mjs +1 -0
- package/Types/SSO/IdentityProviderSignOut.d.mts +24 -0
- package/Types/SSO/IdentityProviderSignOut.d.ts +24 -0
- package/Types/SSO/IdentityProviderSignOut.js +124 -0
- package/Types/SSO/IdentityProviderSignOut.mjs +10 -0
- package/Types/SecurityCase/SecurityCaseEventEvidence.d.mts +4 -0
- package/Types/SecurityCase/SecurityCaseEventEvidence.d.ts +4 -0
- package/Types/SecurityCase/SecurityCaseEventEvidence.js +12 -0
- package/Types/SecurityCase/SecurityCaseMatches.d.mts +78 -0
- package/Types/SecurityCase/SecurityCaseMatches.d.ts +78 -0
- package/Types/SecurityCase/SecurityCaseMatches.js +252 -0
- package/Types/SecurityCase/SecurityCaseMatches.mjs +17 -0
- package/Types/ServerSending/ProjectCanSend.d.mts +10 -0
- package/Types/ServerSending/ProjectCanSend.d.ts +10 -0
- package/Types/ServerSending/ProjectCanSend.js +49 -0
- package/Types/ServerSending/ProjectCanSend.mjs +4 -0
- package/Types/ServerSending/ServerAlerts.d.mts +78 -0
- package/Types/ServerSending/ServerAlerts.d.ts +78 -0
- package/Types/ServerSending/ServerAlerts.js +393 -0
- package/Types/ServerSending/ServerAlerts.mjs +8 -0
- package/Types/ServerSending/ServerSendingStatus.d.mts +6 -0
- package/Types/ServerSending/ServerSendingStatus.d.ts +6 -0
- package/Types/ServerSending/ServerSendingStatus.js +23 -0
- package/Types/ServerSending/ServerSetUpProblem.d.mts +46 -0
- package/Types/ServerSending/ServerSetUpProblem.d.ts +46 -0
- package/Types/ServerSending/ServerSetUpProblem.js +164 -0
- package/Types/ServerSending/ServerSetUpProblem.mjs +6 -0
- package/Types/ServerSetup/ServerSetupChecklist.d.mts +35 -1
- package/Types/ServerSetup/ServerSetupChecklist.d.ts +35 -1
- package/Types/ServerSetup/ServerSetupChecklist.js +270 -33
- package/Types/ServerSetup/ServerSetupChecklist.mjs +5 -0
- package/Types/ServerSetup/ServerTestSend.d.mts +11 -0
- package/Types/ServerSetup/ServerTestSend.d.ts +11 -0
- package/Types/ServerSetup/ServerTestSend.js +60 -3
- package/Types/ServerSetup/ServerTestSend.mjs +2 -0
- package/Types/ServiceLevelObjective/SloStatus.d.mts +3 -0
- package/Types/ServiceLevelObjective/SloStatus.d.ts +3 -0
- package/Types/ServiceLevelObjective/SloStatus.js +38 -0
- package/Types/ServiceLevelObjective/SloStatus.mjs +2 -0
- package/Types/ServiceLevelObjective/SloStatusChange.d.mts +10 -0
- package/Types/ServiceLevelObjective/SloStatusChange.d.ts +10 -0
- package/Types/ServiceLevelObjective/SloStatusChange.js +71 -0
- package/Types/ServiceLevelObjective/SloStatusChange.mjs +5 -0
- package/Types/SetupHealth/SetupHealth.d.mts +31 -3
- package/Types/SetupHealth/SetupHealth.d.ts +31 -3
- package/Types/SetupHealth/SetupHealth.js +333 -4
- package/Types/SetupHealth/SetupHealth.mjs +5 -0
- package/Types/StatusPage/NewIncidentSubscriberNotificationDefault.js +8 -5
- package/Types/StatusPage/StatusPagePublicName.d.mts +6 -0
- package/Types/StatusPage/StatusPagePublicName.d.ts +6 -0
- package/Types/StatusPage/StatusPagePublicName.js +32 -0
- package/Types/StatusPage/StatusPagePublicName.mjs +3 -0
- package/Types/Team/InvitationEmailsNotSent.d.mts +28 -0
- package/Types/Team/InvitationEmailsNotSent.d.ts +28 -0
- package/Types/Team/InvitationEmailsNotSent.js +261 -0
- package/Types/Team/InvitationEmailsNotSent.mjs +13 -0
- package/Types/Team/ProjectMemberSearch.d.mts +15 -0
- package/Types/Team/ProjectMemberSearch.d.ts +15 -0
- package/Types/Team/ProjectMemberSearch.js +180 -0
- package/Types/Team/ProjectMemberSearch.mjs +10 -0
- package/Types/Team/ProjectRemovalReach.d.mts +15 -0
- package/Types/Team/ProjectRemovalReach.d.ts +15 -0
- package/Types/Team/ProjectRemovalReach.js +154 -0
- package/Types/Team/ProjectRemovalReach.mjs +8 -0
- package/Types/Team/ResendInvitation.d.mts +27 -0
- package/Types/Team/ResendInvitation.d.ts +27 -0
- package/Types/Team/ResendInvitation.js +123 -0
- package/Types/Team/ResendInvitation.mjs +12 -0
- package/Types/UsedBy/UsedBy.d.mts +1 -0
- package/Types/UsedBy/UsedBy.d.ts +1 -0
- package/Types/UsedBy/UsedBy.js +2 -0
- package/Types/UsedBy/UsedByServerProducts.js +1 -0
- package/Types/WelcomeChecklist/WelcomeChecklist.d.mts +27 -4
- package/Types/WelcomeChecklist/WelcomeChecklist.d.ts +27 -4
- package/Types/WelcomeChecklist/WelcomeChecklist.js +166 -42
- package/Types/WelcomeChecklist/WelcomeChecklist.mjs +8 -0
- package/Types/WelcomeChecklist/WelcomeChecklistAnswer.d.mts +4 -1
- package/Types/WelcomeChecklist/WelcomeChecklistAnswer.d.ts +4 -1
- package/Types/WelcomeChecklist/WelcomeChecklistAnswer.js +175 -33
- package/Types/WelcomeChecklist/WelcomeChecklistAnswer.mjs +1 -0
- package/Types/WelcomeChecklist/WelcomeChecklistState.d.mts +1 -0
- package/Types/WelcomeChecklist/WelcomeChecklistState.d.ts +1 -0
- package/Types/WelcomeChecklist/WelcomeChecklistState.js +30 -1
- package/Types/WelcomeChecklist/WelcomeChecklistState.mjs +1 -0
- package/Types/Workflow/Component.d.mts +0 -1
- package/Types/Workflow/Component.d.ts +0 -1
- package/Types/Workspace/NotificationRules/BaseNotificationRule.d.mts +1 -1
- package/Types/Workspace/NotificationRules/BaseNotificationRule.d.ts +1 -1
- package/Types/Workspace/NotificationRules/NotificationRuleCondition.d.mts +23 -0
- package/Types/Workspace/NotificationRules/NotificationRuleCondition.d.ts +23 -0
- package/Types/Workspace/NotificationRules/NotificationRuleUpdates.d.mts +12 -0
- package/Types/Workspace/NotificationRules/NotificationRuleUpdates.d.ts +12 -0
- package/Types/Workspace/NotificationRules/NotificationRuleUpdates.js +106 -4
- package/Types/Workspace/WorkspaceMessagePayload.d.mts +2 -0
- package/Types/Workspace/WorkspaceMessagePayload.d.ts +2 -0
- package/Types/Workspace/WorkspaceMessagePayload.js +6 -1
- package/Types/Workspace/WorkspaceMessagePayload.mjs +1 -0
- package/UI/Components/Dropdown/Dropdown.d.mts +2 -0
- package/UI/Components/Dropdown/Dropdown.d.ts +2 -0
- package/Utils/Dashboard/Components/DashboardProductAnalyticsFunnelComponent.js +6 -1
- package/Utils/Dashboard/Components/DashboardProductAnalyticsRetentionComponent.js +6 -1
- package/Utils/Dashboard/MonitorListWidgetFormat.d.mts +4 -1
- package/Utils/Dashboard/MonitorListWidgetFormat.d.ts +4 -1
- package/Utils/Dashboard/MonitorListWidgetFormat.js +9 -4
- package/Utils/DataSecurity/CustomDataTypeDetector.js +3 -1
- package/Utils/DataSecurity/DetectorPrefilter.d.mts +9 -0
- package/Utils/DataSecurity/DetectorPrefilter.d.ts +9 -0
- package/Utils/DataSecurity/DetectorPrefilter.js +471 -0
- package/Utils/DataSecurity/DetectorPrefilter.mjs +6 -0
- package/Utils/DataSecurity/FieldClassifier.d.mts +2 -0
- package/Utils/DataSecurity/FieldClassifier.d.ts +2 -0
- package/Utils/DataSecurity/FieldClassifier.js +38 -8
- package/Utils/DataSecurity/OccurrenceExcerpt.d.mts +22 -0
- package/Utils/DataSecurity/OccurrenceExcerpt.d.ts +22 -0
- package/Utils/DataSecurity/OccurrenceExcerpt.js +270 -0
- package/Utils/DataSecurity/OccurrenceExcerpt.mjs +5 -0
- package/Utils/DataSecurity/TextScanner.d.mts +4 -0
- package/Utils/DataSecurity/TextScanner.d.ts +4 -0
- package/Utils/Monitor/DeviceMonitorDuplicates.d.mts +34 -0
- package/Utils/Monitor/DeviceMonitorDuplicates.d.ts +34 -0
- package/Utils/Monitor/DeviceMonitorDuplicates.js +134 -0
- package/Utils/Monitor/DeviceMonitorDuplicates.mjs +7 -0
- package/Utils/Monitor/DeviceMonitorTemplateUtil.d.mts +4 -0
- package/Utils/Monitor/DeviceMonitorTemplateUtil.d.ts +4 -0
- package/Utils/Monitor/DeviceMonitorTemplateUtil.js +33 -6
- package/Utils/Monitor/MonitorMetricType.js +11 -1
- package/Utils/Monitor/MonitorOverviewPresentationUtil.js +21 -3
- package/Utils/Monitor/ProbeFailureCauses.js +4 -1
- package/Utils/Monitor/ProbeStatusMonitorUtil.d.mts +5 -1
- package/Utils/Monitor/ProbeStatusMonitorUtil.d.ts +5 -1
- package/Utils/Monitor/ProbeStatusMonitorUtil.js +106 -0
- package/Utils/NetworkDevice/NetworkDeviceAssetFacts.d.mts +3 -0
- package/Utils/NetworkDevice/NetworkDeviceAssetFacts.d.ts +3 -0
- package/Utils/NetworkDevice/NetworkDeviceAssetFacts.js +33 -4
- package/Utils/NetworkDevice/NetworkDeviceAssetFacts.mjs +1 -0
- package/Utils/NetworkDevice/NetworkDeviceStoredManufacturer.d.mts +33 -0
- package/Utils/NetworkDevice/NetworkDeviceStoredManufacturer.d.ts +33 -0
- package/Utils/NetworkDevice/NetworkDeviceStoredManufacturer.js +105 -0
- package/Utils/NetworkDevice/NetworkDeviceStoredManufacturer.mjs +8 -0
- package/Utils/NetworkDevice/SnmpCredentialUtil.d.mts +5 -0
- package/Utils/NetworkDevice/SnmpCredentialUtil.d.ts +5 -0
- package/Utils/NetworkDevice/SnmpCredentialUtil.js +28 -3
- package/Utils/NetworkDevice/SnmpCredentialUtil.mjs +3 -0
- package/Utils/NetworkDiscovery/DiscoveredEndpointDeviceBuilder.d.mts +1 -0
- package/Utils/NetworkDiscovery/DiscoveredEndpointDeviceBuilder.d.ts +1 -0
- package/Utils/NetworkDiscovery/DiscoveredEndpointDeviceBuilder.js +20 -1
- package/Utils/Rules/RuleCriteriaMatcher.d.mts +1 -0
- package/Utils/Rules/RuleCriteriaMatcher.d.ts +1 -0
- package/Utils/Rules/RuleCriteriaMatcher.js +6 -0
- package/Utils/Rules/RuleCriteriaOwnerMatch.d.mts +10 -0
- package/Utils/Rules/RuleCriteriaOwnerMatch.d.ts +10 -0
- package/Utils/Rules/RuleCriteriaOwnerMatch.js +83 -0
- package/Utils/Rules/RuleCriteriaOwnerMatch.mjs +4 -0
- package/Utils/SecurityCase/SecurityCaseMatchRules.d.mts +27 -0
- package/Utils/SecurityCase/SecurityCaseMatchRules.d.ts +27 -0
- package/Utils/SecurityCase/SecurityCaseMatchRules.js +377 -0
- package/Utils/SecurityCase/SecurityCaseMatchRules.mjs +9 -0
- package/Utils/Slo/SloBulkRecommendedPolicy.d.mts +35 -0
- package/Utils/Slo/SloBulkRecommendedPolicy.d.ts +35 -0
- package/Utils/Slo/SloBulkRecommendedPolicy.js +168 -0
- package/Utils/Slo/SloBulkRecommendedPolicy.mjs +6 -0
- package/Utils/Slo/SloBurnRateRuleState.js +3 -6
- package/Utils/Slo/SloErrorBudgetPolicy.d.mts +17 -0
- package/Utils/Slo/SloErrorBudgetPolicy.d.ts +17 -0
- package/Utils/Slo/SloErrorBudgetPolicy.js +72 -1
- package/Utils/Slo/SloErrorBudgetPolicy.mjs +4 -0
- package/Utils/Slo/SloFeedMarkdown.d.mts +5 -2
- package/Utils/Slo/SloFeedMarkdown.d.ts +5 -2
- package/Utils/Slo/SloFeedMarkdown.js +19 -7
- package/Utils/Slo/SloFeedMarkdown.mjs +1 -0
- package/Utils/Slo/SloHealth.d.mts +5 -0
- package/Utils/Slo/SloHealth.d.ts +5 -0
- package/Utils/Slo/SloHealth.js +27 -0
- package/Utils/Slo/SloListWidgetFormat.js +5 -3
- package/Utils/Slo/SloMetricType.js +6 -5
- package/Utils/Slo/SloMonitorsFirstCheck.d.mts +13 -0
- package/Utils/Slo/SloMonitorsFirstCheck.d.ts +13 -0
- package/Utils/Slo/SloMonitorsFirstCheck.js +78 -0
- package/Utils/Slo/SloMonitorsFirstCheck.mjs +3 -0
- package/Utils/Slo/SloOverviewText.js +7 -0
- package/Utils/Slo/SloStatusColor.d.mts +3 -0
- package/Utils/Slo/SloStatusColor.d.ts +3 -0
- package/Utils/Slo/SloStatusColor.js +3 -0
- package/Utils/Slo/SloStatusPosts.d.mts +18 -0
- package/Utils/Slo/SloStatusPosts.d.ts +18 -0
- package/Utils/Slo/SloStatusPosts.js +95 -0
- package/Utils/Slo/SloStatusPosts.mjs +3 -0
- package/Utils/StatusPage/GridAxisValues.d.mts +2 -0
- package/Utils/StatusPage/GridAxisValues.d.ts +2 -0
- package/Utils/StatusPage/GridAxisValues.js +33 -0
- package/Utils/StatusPage/GridAxisValues.mjs +3 -0
- package/Utils/StatusPage/GroupHierarchyView.d.mts +2 -2
- package/Utils/StatusPage/GroupHierarchyView.d.ts +2 -2
- package/Utils/StatusPage/GroupHierarchyView.js +13 -12
- package/Utils/StatusPage/GroupNestingLayout.d.mts +1 -0
- package/Utils/StatusPage/GroupNestingLayout.d.ts +1 -0
- package/Utils/StatusPage/GroupNestingLayout.js +25 -5
- package/Utils/StatusPage/ResourceExplorer.d.mts +2 -2
- package/Utils/StatusPage/ResourceExplorer.d.ts +2 -2
- package/Utils/StatusPage/ResourceExplorer.js +15 -21
- package/Utils/StatusPage/StatusColorsOnDark.d.mts +5 -3
- package/Utils/StatusPage/StatusColorsOnDark.d.ts +5 -3
- package/Utils/StatusPage/StatusColorsOnDark.js +18 -6
- package/Utils/StatusPage/StatusColorsOnDark.mjs +1 -0
- package/Utils/Telemetry/MobileAppFaults.d.mts +8 -0
- package/Utils/Telemetry/MobileAppFaults.d.ts +8 -0
- package/Utils/Telemetry/MobileAppFaults.js +69 -0
- package/Utils/Telemetry/MobileAppFaults.mjs +6 -0
- package/Utils/Workspace/WorkspaceRefusal.d.mts +108 -0
- package/Utils/Workspace/WorkspaceRefusal.d.ts +108 -0
- package/Utils/Workspace/WorkspaceRefusal.js +769 -0
- package/Utils/Workspace/WorkspaceRefusal.mjs +50 -0
- package/package.json +4 -1
|
@@ -0,0 +1,471 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MAX_PREFILTER_LENGTH = exports.RE2_MAX_REPEAT = void 0;
|
|
4
|
+
exports.expandBackReferences = expandBackReferences;
|
|
5
|
+
exports.toRe2Prefilter = toRe2Prefilter;
|
|
6
|
+
exports.getDataTypePrefilter = getDataTypePrefilter;
|
|
7
|
+
const Index_1 = require("./Detectors/Index");
|
|
8
|
+
const Parser_1 = require("../LinearRegExp/Parser");
|
|
9
|
+
/*
|
|
10
|
+
* A DATA TYPE'S PATTERNS, FOR THE DATABASE TO NARROW A SEARCH BY.
|
|
11
|
+
*
|
|
12
|
+
* Looking for the telemetry records that carry a finding's data - an IP
|
|
13
|
+
* address in a service's log lines - used to read the newest few hundred
|
|
14
|
+
* records with any value at the place, and check each one here. In a busy
|
|
15
|
+
* service those are the last seconds of its logs, and a type that turns up
|
|
16
|
+
* in one line of four hundred was never among them (issue #9549). This
|
|
17
|
+
* turns the type's own detectors into one regular expression ClickHouse can
|
|
18
|
+
* run (RE2), so the database hands over only records that could hold it,
|
|
19
|
+
* and each is still checked here with the detector itself.
|
|
20
|
+
*
|
|
21
|
+
* RE2 has no look-arounds and no back-references, and its \s and its case
|
|
22
|
+
* folding are not JavaScript's, so the expression is written to match at
|
|
23
|
+
* least everything the detector's pattern matches - more is fine, never
|
|
24
|
+
* less - read from the pattern's syntax tree (LinearRegExp/Parser):
|
|
25
|
+
*
|
|
26
|
+
* - a look-behind at the pattern's start and a look-ahead at its end are
|
|
27
|
+
* read as part of the match - the text is right there - so a type whose
|
|
28
|
+
* words sit in one (cvv: 123) still narrows by them;
|
|
29
|
+
* - every other look-around, and ^, $, \b and \B, are left out: each only
|
|
30
|
+
* narrows a match;
|
|
31
|
+
* - a back-reference becomes an optional copy of the group it names;
|
|
32
|
+
* - every character class, \s and the dot included, is written out as the
|
|
33
|
+
* code points JavaScript gives it, and a class holding UTF-16 surrogates
|
|
34
|
+
* takes every character beyond U+FFFF in their place;
|
|
35
|
+
* - a repeat beyond RE2's limit of 1000 has no upper bound;
|
|
36
|
+
* - case-insensitivity is RE2's (?i), which folds at least what
|
|
37
|
+
* JavaScript's i flag does.
|
|
38
|
+
*
|
|
39
|
+
* Anything it cannot write so - a u or v flag, a pattern the parser
|
|
40
|
+
* refuses - gives no expression, and the search reads every record with a
|
|
41
|
+
* value there, as it did.
|
|
42
|
+
*/
|
|
43
|
+
// RE2's largest repeat count.
|
|
44
|
+
exports.RE2_MAX_REPEAT = 1000;
|
|
45
|
+
// The longest expression handed to the database.
|
|
46
|
+
exports.MAX_PREFILTER_LENGTH = 32768;
|
|
47
|
+
const HIGH_SURROGATE_FIRST = 0xd800;
|
|
48
|
+
const LOW_SURROGATE_FIRST = 0xdc00;
|
|
49
|
+
const SURROGATE_LAST = 0xdfff;
|
|
50
|
+
const FIRST_ASTRAL = 0x10000;
|
|
51
|
+
const LAST_CODE_POINT = 0x10ffff;
|
|
52
|
+
class NotWritable extends Error {
|
|
53
|
+
}
|
|
54
|
+
function hex(codePoint) {
|
|
55
|
+
return `\\x{${codePoint.toString(16).toUpperCase()}}`;
|
|
56
|
+
}
|
|
57
|
+
function isPlainCharacter(codePoint) {
|
|
58
|
+
return ((codePoint >= 0x30 && codePoint <= 0x39) ||
|
|
59
|
+
(codePoint >= 0x41 && codePoint <= 0x5a) ||
|
|
60
|
+
(codePoint >= 0x61 && codePoint <= 0x7a));
|
|
61
|
+
}
|
|
62
|
+
function literal(codePoint) {
|
|
63
|
+
return isPlainCharacter(codePoint)
|
|
64
|
+
? String.fromCodePoint(codePoint)
|
|
65
|
+
: hex(codePoint);
|
|
66
|
+
}
|
|
67
|
+
function isHighSurrogate(codeUnit) {
|
|
68
|
+
return codeUnit >= HIGH_SURROGATE_FIRST && codeUnit < LOW_SURROGATE_FIRST;
|
|
69
|
+
}
|
|
70
|
+
function isLowSurrogate(codeUnit) {
|
|
71
|
+
return codeUnit >= LOW_SURROGATE_FIRST && codeUnit <= SURROGATE_LAST;
|
|
72
|
+
}
|
|
73
|
+
// Any one character beyond U+FFFF: what a lone surrogate stands for here.
|
|
74
|
+
const ANY_ASTRAL = `[${hex(FIRST_ASTRAL)}-${hex(LAST_CODE_POINT)}]`;
|
|
75
|
+
/*
|
|
76
|
+
* A class's members as RE2 writes them: the code points JavaScript gives
|
|
77
|
+
* it, surrogates taken out - for a class written as itself, every
|
|
78
|
+
* character beyond U+FFFF takes their place.
|
|
79
|
+
*/
|
|
80
|
+
function writeSet(set, negate) {
|
|
81
|
+
const ranges = set.ranges;
|
|
82
|
+
const parts = [];
|
|
83
|
+
let hadSurrogates = false;
|
|
84
|
+
const add = (first, last) => {
|
|
85
|
+
if (first > last) {
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
parts.push(first === last ? hex(first) : `${hex(first)}-${hex(last)}`);
|
|
89
|
+
};
|
|
90
|
+
for (let index = 0; index < ranges.length; index += 2) {
|
|
91
|
+
const first = ranges[index];
|
|
92
|
+
const last = ranges[index + 1];
|
|
93
|
+
if (last < HIGH_SURROGATE_FIRST || first > SURROGATE_LAST) {
|
|
94
|
+
add(first, last);
|
|
95
|
+
continue;
|
|
96
|
+
}
|
|
97
|
+
hadSurrogates = true;
|
|
98
|
+
add(first, HIGH_SURROGATE_FIRST - 1);
|
|
99
|
+
add(SURROGATE_LAST + 1, last);
|
|
100
|
+
}
|
|
101
|
+
if (negate) {
|
|
102
|
+
// [^...] in RE2 takes every character beyond U+FFFF already.
|
|
103
|
+
return parts.length > 0 ? `[^${parts.join("")}]` : "(?s:.)";
|
|
104
|
+
}
|
|
105
|
+
if (hadSurrogates) {
|
|
106
|
+
parts.push(`${hex(FIRST_ASTRAL)}-${hex(LAST_CODE_POINT)}`);
|
|
107
|
+
}
|
|
108
|
+
if (parts.length === 0) {
|
|
109
|
+
// A class of nothing: the pattern can match nothing, and is no prefilter.
|
|
110
|
+
throw new NotWritable("An empty class.");
|
|
111
|
+
}
|
|
112
|
+
return `[${parts.join("")}]`;
|
|
113
|
+
}
|
|
114
|
+
function withCase(text, ignoreCase, outerIgnoreCase) {
|
|
115
|
+
if (ignoreCase === outerIgnoreCase || text.length === 0) {
|
|
116
|
+
return text;
|
|
117
|
+
}
|
|
118
|
+
return ignoreCase ? `(?i:${text})` : `(?-i:${text})`;
|
|
119
|
+
}
|
|
120
|
+
function quantifier(min, max) {
|
|
121
|
+
const low = Math.min(min, exports.RE2_MAX_REPEAT);
|
|
122
|
+
const isUnbounded = !Number.isFinite(max) || max > exports.RE2_MAX_REPEAT || max < min;
|
|
123
|
+
if (isUnbounded) {
|
|
124
|
+
if (low === 0) {
|
|
125
|
+
return "*";
|
|
126
|
+
}
|
|
127
|
+
return low === 1 ? "+" : `{${low},}`;
|
|
128
|
+
}
|
|
129
|
+
if (low === 0 && max === 1) {
|
|
130
|
+
return "?";
|
|
131
|
+
}
|
|
132
|
+
return low === max ? `{${low}}` : `{${low},${max}}`;
|
|
133
|
+
}
|
|
134
|
+
function writeNode(node, outerIgnoreCase) {
|
|
135
|
+
switch (node.kind) {
|
|
136
|
+
case "Empty":
|
|
137
|
+
case "Assertion":
|
|
138
|
+
case "Lookaround":
|
|
139
|
+
return "";
|
|
140
|
+
case "Character":
|
|
141
|
+
return withCase(isHighSurrogate(node.codeUnit) || isLowSurrogate(node.codeUnit)
|
|
142
|
+
? ANY_ASTRAL
|
|
143
|
+
: literal(node.codeUnit), node.ignoreCase, outerIgnoreCase);
|
|
144
|
+
case "Set":
|
|
145
|
+
return withCase(writeSet(node.set, node.negate), node.ignoreCase, outerIgnoreCase);
|
|
146
|
+
case "Group": {
|
|
147
|
+
const body = writeNode(node.body, outerIgnoreCase);
|
|
148
|
+
return body ? `(?:${body})` : "";
|
|
149
|
+
}
|
|
150
|
+
case "Repeat": {
|
|
151
|
+
const body = writeNode(node.body, outerIgnoreCase);
|
|
152
|
+
return body ? `(?:${body})${quantifier(node.min, node.max)}` : "";
|
|
153
|
+
}
|
|
154
|
+
case "Alternation": {
|
|
155
|
+
const options = node.options.map((option) => {
|
|
156
|
+
return writeNode(option, outerIgnoreCase);
|
|
157
|
+
});
|
|
158
|
+
// An option that can match nothing at all makes the whole optional.
|
|
159
|
+
return `(?:${options.join("|")})`;
|
|
160
|
+
}
|
|
161
|
+
case "Sequence":
|
|
162
|
+
return writeSequence(node.items, outerIgnoreCase);
|
|
163
|
+
default:
|
|
164
|
+
throw new NotWritable("A node the writer does not know.");
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
/*
|
|
168
|
+
* A sequence's items one after another, a surrogate pair written as the one
|
|
169
|
+
* character beyond U+FFFF it is.
|
|
170
|
+
*/
|
|
171
|
+
function writeSequence(items, outerIgnoreCase) {
|
|
172
|
+
let text = "";
|
|
173
|
+
for (let index = 0; index < items.length; index++) {
|
|
174
|
+
const item = items[index];
|
|
175
|
+
const next = items[index + 1];
|
|
176
|
+
if (item.kind === "Character" &&
|
|
177
|
+
(next === null || next === void 0 ? void 0 : next.kind) === "Character" &&
|
|
178
|
+
isHighSurrogate(item.codeUnit) &&
|
|
179
|
+
isLowSurrogate(next.codeUnit) &&
|
|
180
|
+
item.ignoreCase === next.ignoreCase) {
|
|
181
|
+
const codePoint = FIRST_ASTRAL +
|
|
182
|
+
(item.codeUnit - HIGH_SURROGATE_FIRST) * 0x400 +
|
|
183
|
+
(next.codeUnit - LOW_SURROGATE_FIRST);
|
|
184
|
+
text += withCase(hex(codePoint), item.ignoreCase, outerIgnoreCase);
|
|
185
|
+
index++;
|
|
186
|
+
continue;
|
|
187
|
+
}
|
|
188
|
+
text += writeNode(item, outerIgnoreCase);
|
|
189
|
+
}
|
|
190
|
+
return text;
|
|
191
|
+
}
|
|
192
|
+
function isZeroWidth(node) {
|
|
193
|
+
return (node.kind === "Lookaround" ||
|
|
194
|
+
node.kind === "Assertion" ||
|
|
195
|
+
node.kind === "Empty");
|
|
196
|
+
}
|
|
197
|
+
/*
|
|
198
|
+
* A pattern whose words sit in a look-behind at its start - (?<=cvv: )[0-9]{3}
|
|
199
|
+
* - or in a look-ahead at its end keeps them: the text before or after the
|
|
200
|
+
* match is right there, so it can be read as part of it, and the expression
|
|
201
|
+
* still matches every text the pattern does. One look-behind and one
|
|
202
|
+
* look-ahead are kept so - two that start at the same place overlap - and
|
|
203
|
+
* any other look-around is left out.
|
|
204
|
+
*/
|
|
205
|
+
function withEdgeLookaroundsRead(root) {
|
|
206
|
+
if (root.kind !== "Sequence") {
|
|
207
|
+
return root;
|
|
208
|
+
}
|
|
209
|
+
const items = root.items;
|
|
210
|
+
const firstConsumed = items.findIndex((item) => {
|
|
211
|
+
return !isZeroWidth(item);
|
|
212
|
+
});
|
|
213
|
+
if (firstConsumed < 0) {
|
|
214
|
+
return root;
|
|
215
|
+
}
|
|
216
|
+
let lastConsumed = items.length - 1;
|
|
217
|
+
while (isZeroWidth(items[lastConsumed])) {
|
|
218
|
+
lastConsumed--;
|
|
219
|
+
}
|
|
220
|
+
// Every other zero-width item would be written as nothing anyway.
|
|
221
|
+
const before = items
|
|
222
|
+
.slice(0, firstConsumed)
|
|
223
|
+
.find((item) => {
|
|
224
|
+
return item.kind === "Lookaround" && item.behind && !item.negate;
|
|
225
|
+
});
|
|
226
|
+
const after = items
|
|
227
|
+
.slice(lastConsumed + 1)
|
|
228
|
+
.find((item) => {
|
|
229
|
+
return item.kind === "Lookaround" && !item.behind && !item.negate;
|
|
230
|
+
});
|
|
231
|
+
const asRead = (node) => {
|
|
232
|
+
return (node === null || node === void 0 ? void 0 : node.kind) === "Lookaround"
|
|
233
|
+
? [{ kind: "Group", captureIndex: 0, name: null, body: node.body }]
|
|
234
|
+
: [];
|
|
235
|
+
};
|
|
236
|
+
return {
|
|
237
|
+
kind: "Sequence",
|
|
238
|
+
items: [
|
|
239
|
+
...asRead(before),
|
|
240
|
+
...items.slice(firstConsumed, lastConsumed + 1),
|
|
241
|
+
...asRead(after),
|
|
242
|
+
],
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
/*
|
|
246
|
+
* Whether a node can match the empty text, as it is written for RE2: an
|
|
247
|
+
* expression that can is no narrowing at all.
|
|
248
|
+
*/
|
|
249
|
+
function canMatchEmpty(node) {
|
|
250
|
+
switch (node.kind) {
|
|
251
|
+
case "Character":
|
|
252
|
+
case "Set":
|
|
253
|
+
return false;
|
|
254
|
+
case "Group":
|
|
255
|
+
return canMatchEmpty(node.body);
|
|
256
|
+
case "Repeat":
|
|
257
|
+
return node.min === 0 || canMatchEmpty(node.body);
|
|
258
|
+
case "Alternation":
|
|
259
|
+
return node.options.some(canMatchEmpty);
|
|
260
|
+
case "Sequence":
|
|
261
|
+
return node.items.every(canMatchEmpty);
|
|
262
|
+
default:
|
|
263
|
+
return true;
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
/*
|
|
267
|
+
* Each capturing group's text, numbered as JavaScript numbers them, and
|
|
268
|
+
* whether the pattern has named ones. Escapes and classes are stepped over
|
|
269
|
+
* as JavaScript reads them.
|
|
270
|
+
*/
|
|
271
|
+
function readGroups(source) {
|
|
272
|
+
const groups = new Map();
|
|
273
|
+
const open = [];
|
|
274
|
+
let count = 0;
|
|
275
|
+
let hasNamed = false;
|
|
276
|
+
let inClass = false;
|
|
277
|
+
for (let position = 0; position < source.length; position++) {
|
|
278
|
+
const character = source[position];
|
|
279
|
+
if (character === "\\") {
|
|
280
|
+
position++;
|
|
281
|
+
continue;
|
|
282
|
+
}
|
|
283
|
+
if (inClass) {
|
|
284
|
+
inClass = character !== "]";
|
|
285
|
+
continue;
|
|
286
|
+
}
|
|
287
|
+
if (character === "[") {
|
|
288
|
+
inClass = true;
|
|
289
|
+
continue;
|
|
290
|
+
}
|
|
291
|
+
if (character === "(") {
|
|
292
|
+
if (source[position + 1] !== "?") {
|
|
293
|
+
count++;
|
|
294
|
+
open.push({ index: count, name: null, innerStart: position + 1 });
|
|
295
|
+
continue;
|
|
296
|
+
}
|
|
297
|
+
const named = source
|
|
298
|
+
.slice(position)
|
|
299
|
+
.match(/^\(\?<([A-Za-z_$][A-Za-z0-9_$]*)>/);
|
|
300
|
+
if (named) {
|
|
301
|
+
count++;
|
|
302
|
+
hasNamed = true;
|
|
303
|
+
open.push({
|
|
304
|
+
index: count,
|
|
305
|
+
name: named[1],
|
|
306
|
+
innerStart: position + named[0].length,
|
|
307
|
+
});
|
|
308
|
+
continue;
|
|
309
|
+
}
|
|
310
|
+
open.push({ index: null, name: null, innerStart: position + 1 });
|
|
311
|
+
continue;
|
|
312
|
+
}
|
|
313
|
+
if (character === ")") {
|
|
314
|
+
const group = open.pop();
|
|
315
|
+
if (group === null || group === void 0 ? void 0 : group.index) {
|
|
316
|
+
groups.set(group.index, {
|
|
317
|
+
index: group.index,
|
|
318
|
+
name: group.name,
|
|
319
|
+
inner: source.slice(group.innerStart, position),
|
|
320
|
+
});
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
return { groups, count, hasNamed };
|
|
325
|
+
}
|
|
326
|
+
// How many times back-references inside back-references are followed.
|
|
327
|
+
const MAX_BACK_REFERENCE_DEPTH = 8;
|
|
328
|
+
/*
|
|
329
|
+
* The pattern with each back-reference - \1, \k<name> - written as an
|
|
330
|
+
* optional copy of the group it names: the copy matches whatever the group
|
|
331
|
+
* matched, and nothing when the group took no part.
|
|
332
|
+
*/
|
|
333
|
+
function expandBackReferences(source, depth = 0) {
|
|
334
|
+
const { groups, count, hasNamed } = readGroups(source);
|
|
335
|
+
if (count === 0) {
|
|
336
|
+
return source;
|
|
337
|
+
}
|
|
338
|
+
if (depth > MAX_BACK_REFERENCE_DEPTH) {
|
|
339
|
+
throw new NotWritable("Back-references nested too deep.");
|
|
340
|
+
}
|
|
341
|
+
const byName = new Map();
|
|
342
|
+
for (const group of groups.values()) {
|
|
343
|
+
if (group.name) {
|
|
344
|
+
byName.set(group.name, group);
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
const copyOf = (group) => {
|
|
348
|
+
return group
|
|
349
|
+
? `(?:${expandBackReferences(group.inner, depth + 1)})?`
|
|
350
|
+
: "(?:)";
|
|
351
|
+
};
|
|
352
|
+
let written = "";
|
|
353
|
+
let inClass = false;
|
|
354
|
+
for (let position = 0; position < source.length; position++) {
|
|
355
|
+
const character = source[position];
|
|
356
|
+
if (character !== "\\") {
|
|
357
|
+
if (inClass) {
|
|
358
|
+
inClass = character !== "]";
|
|
359
|
+
}
|
|
360
|
+
else if (character === "[") {
|
|
361
|
+
inClass = true;
|
|
362
|
+
}
|
|
363
|
+
written += character;
|
|
364
|
+
continue;
|
|
365
|
+
}
|
|
366
|
+
const next = source[position + 1] || "";
|
|
367
|
+
if (!inClass && next >= "1" && next <= "9") {
|
|
368
|
+
const digits = (source.slice(position + 1).match(/^[0-9]+/) || [
|
|
369
|
+
"",
|
|
370
|
+
])[0];
|
|
371
|
+
const number = Number(digits);
|
|
372
|
+
if (number <= count) {
|
|
373
|
+
written += copyOf(groups.get(number));
|
|
374
|
+
position += digits.length;
|
|
375
|
+
continue;
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
if (!inClass && next === "k" && hasNamed) {
|
|
379
|
+
const named = source
|
|
380
|
+
.slice(position)
|
|
381
|
+
.match(/^\\k<([A-Za-z_$][A-Za-z0-9_$]*)>/);
|
|
382
|
+
if (named) {
|
|
383
|
+
written += copyOf(byName.get(named[1]));
|
|
384
|
+
position += named[0].length - 1;
|
|
385
|
+
continue;
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
written += character + next;
|
|
389
|
+
position++;
|
|
390
|
+
}
|
|
391
|
+
return written;
|
|
392
|
+
}
|
|
393
|
+
/*
|
|
394
|
+
* A JavaScript pattern as an RE2 expression that matches at least what the
|
|
395
|
+
* pattern matches, or null when it cannot be written so.
|
|
396
|
+
*/
|
|
397
|
+
function toRe2Prefilter(source, flags) {
|
|
398
|
+
if (flags.includes("u") || flags.includes("v")) {
|
|
399
|
+
return null;
|
|
400
|
+
}
|
|
401
|
+
const patternFlags = {
|
|
402
|
+
ignoreCase: flags.includes("i"),
|
|
403
|
+
multiline: flags.includes("m"),
|
|
404
|
+
dotAll: flags.includes("s"),
|
|
405
|
+
};
|
|
406
|
+
try {
|
|
407
|
+
// The engine decides what is a pattern at all, as LinearRegExp does.
|
|
408
|
+
new RegExp(source, flags.replace(/[^gimsy]/g, ""));
|
|
409
|
+
const root = withEdgeLookaroundsRead((0, Parser_1.parsePattern)(expandBackReferences(source), patternFlags).root);
|
|
410
|
+
// An expression that can match the empty text narrows nothing.
|
|
411
|
+
if (canMatchEmpty(root)) {
|
|
412
|
+
return null;
|
|
413
|
+
}
|
|
414
|
+
const written = writeNode(root, patternFlags.ignoreCase);
|
|
415
|
+
if (!written || written.length > exports.MAX_PREFILTER_LENGTH) {
|
|
416
|
+
return null;
|
|
417
|
+
}
|
|
418
|
+
return patternFlags.ignoreCase ? `(?i:${written})` : written;
|
|
419
|
+
}
|
|
420
|
+
catch (_a) {
|
|
421
|
+
return null;
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
// Where a detector's pattern is written: its own, or the one a project wrote.
|
|
425
|
+
function patternOf(detector) {
|
|
426
|
+
if ("pattern" in detector && detector.pattern instanceof RegExp) {
|
|
427
|
+
return { source: detector.pattern.source, flags: detector.pattern.flags };
|
|
428
|
+
}
|
|
429
|
+
if ("patternSource" in detector && detector.patternSource) {
|
|
430
|
+
return detector.patternSource;
|
|
431
|
+
}
|
|
432
|
+
return null;
|
|
433
|
+
}
|
|
434
|
+
/*
|
|
435
|
+
* One RE2 expression for every detector of a data type - the built-in
|
|
436
|
+
* ones, or the project's own type's - that matches at least what any of
|
|
437
|
+
* them matches: null when the type has none, or one of them cannot be
|
|
438
|
+
* written so, since the search would then miss what that one finds.
|
|
439
|
+
*/
|
|
440
|
+
function getDataTypePrefilter(data) {
|
|
441
|
+
const builtIn = (0, Index_1.getBuiltInDetectorsOf)(data.dataTypeId);
|
|
442
|
+
const detectors = builtIn.length > 0
|
|
443
|
+
? builtIn
|
|
444
|
+
: (data.customDetectors || []).filter((detector) => {
|
|
445
|
+
return detector.dataTypeId === data.dataTypeId;
|
|
446
|
+
});
|
|
447
|
+
if (detectors.length === 0) {
|
|
448
|
+
return null;
|
|
449
|
+
}
|
|
450
|
+
const expressions = [];
|
|
451
|
+
for (const detector of detectors) {
|
|
452
|
+
const pattern = patternOf(detector);
|
|
453
|
+
const expression = pattern
|
|
454
|
+
? toRe2Prefilter(pattern.source, pattern.flags)
|
|
455
|
+
: null;
|
|
456
|
+
if (!expression) {
|
|
457
|
+
return null;
|
|
458
|
+
}
|
|
459
|
+
if (!expressions.includes(expression)) {
|
|
460
|
+
expressions.push(expression);
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
const combined = expressions.length === 1
|
|
464
|
+
? expressions[0]
|
|
465
|
+
: expressions
|
|
466
|
+
.map((expression) => {
|
|
467
|
+
return `(?:${expression})`;
|
|
468
|
+
})
|
|
469
|
+
.join("|");
|
|
470
|
+
return combined.length <= exports.MAX_PREFILTER_LENGTH ? combined : null;
|
|
471
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import commonJsModule from "./DetectorPrefilter.js";
|
|
2
|
+
export const MAX_PREFILTER_LENGTH = commonJsModule.MAX_PREFILTER_LENGTH;
|
|
3
|
+
export const RE2_MAX_REPEAT = commonJsModule.RE2_MAX_REPEAT;
|
|
4
|
+
export const expandBackReferences = commonJsModule.expandBackReferences;
|
|
5
|
+
export const getDataTypePrefilter = commonJsModule.getDataTypePrefilter;
|
|
6
|
+
export const toRe2Prefilter = commonJsModule.toRe2Prefilter;
|
|
@@ -11,12 +11,14 @@ export interface FieldClassification extends DataTypeTallyJSON {
|
|
|
11
11
|
foundByName: boolean;
|
|
12
12
|
isAiSuggested?: boolean | undefined;
|
|
13
13
|
aiReason?: string | undefined;
|
|
14
|
+
matchedValueIndexes?: Array<number> | undefined;
|
|
14
15
|
}
|
|
15
16
|
export interface FieldClassifierOptions extends TextScanOptions {
|
|
16
17
|
extraHints?: ReadonlyArray<{
|
|
17
18
|
dataTypeId: string;
|
|
18
19
|
hints: ReadonlyArray<string>;
|
|
19
20
|
}> | undefined;
|
|
21
|
+
maxMatchedValueIndexes?: number | undefined;
|
|
20
22
|
}
|
|
21
23
|
export declare function toScannableValue(value: unknown): string | null;
|
|
22
24
|
export declare function classifyField(fieldPath: string, rawValues: ReadonlyArray<unknown>, options?: FieldClassifierOptions): Array<FieldClassification>;
|
|
@@ -11,12 +11,14 @@ export interface FieldClassification extends DataTypeTallyJSON {
|
|
|
11
11
|
foundByName: boolean;
|
|
12
12
|
isAiSuggested?: boolean | undefined;
|
|
13
13
|
aiReason?: string | undefined;
|
|
14
|
+
matchedValueIndexes?: Array<number> | undefined;
|
|
14
15
|
}
|
|
15
16
|
export interface FieldClassifierOptions extends TextScanOptions {
|
|
16
17
|
extraHints?: ReadonlyArray<{
|
|
17
18
|
dataTypeId: string;
|
|
18
19
|
hints: ReadonlyArray<string>;
|
|
19
20
|
}> | undefined;
|
|
21
|
+
maxMatchedValueIndexes?: number | undefined;
|
|
20
22
|
}
|
|
21
23
|
export declare function toScannableValue(value: unknown): string | null;
|
|
22
24
|
export declare function classifyField(fieldPath: string, rawValues: ReadonlyArray<unknown>, options?: FieldClassifierOptions): Array<FieldClassification>;
|
|
@@ -98,18 +98,44 @@ function matchesFieldShape(detector, value) {
|
|
|
98
98
|
function classifyField(fieldPath, rawValues, options = {}) {
|
|
99
99
|
var _a;
|
|
100
100
|
const values = [];
|
|
101
|
-
|
|
101
|
+
// Where each value read sits among the raw values: empty ones are skipped.
|
|
102
|
+
const rawIndexes = [];
|
|
103
|
+
for (let rawIndex = 0; rawIndex < rawValues.length; rawIndex++) {
|
|
102
104
|
if (values.length >= exports.MAX_FIELD_VALUES) {
|
|
103
105
|
break;
|
|
104
106
|
}
|
|
105
|
-
const value = toScannableValue(
|
|
107
|
+
const value = toScannableValue(rawValues[rawIndex]);
|
|
106
108
|
if (value !== null) {
|
|
107
109
|
values.push(value);
|
|
110
|
+
rawIndexes.push(rawIndex);
|
|
108
111
|
}
|
|
109
112
|
}
|
|
110
113
|
if (values.length === 0) {
|
|
111
114
|
return [];
|
|
112
115
|
}
|
|
116
|
+
const maxMatchedValueIndexes = Math.max(0, Math.trunc(options.maxMatchedValueIndexes || 0));
|
|
117
|
+
// The raw indexes of the values that held each type, while asked for.
|
|
118
|
+
const matchedValueIndexes = new Map();
|
|
119
|
+
const noteMatchedValue = (dataTypeId, valueIndex) => {
|
|
120
|
+
if (maxMatchedValueIndexes === 0) {
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
const indexes = matchedValueIndexes.get(dataTypeId) || [];
|
|
124
|
+
if (indexes.length < maxMatchedValueIndexes) {
|
|
125
|
+
indexes.push(rawIndexes[valueIndex]);
|
|
126
|
+
matchedValueIndexes.set(dataTypeId, indexes);
|
|
127
|
+
}
|
|
128
|
+
};
|
|
129
|
+
const withMatchedValueIndexes = (classification) => {
|
|
130
|
+
return maxMatchedValueIndexes > 0
|
|
131
|
+
? {
|
|
132
|
+
...classification,
|
|
133
|
+
matchedValueIndexes: [
|
|
134
|
+
...(matchedValueIndexes.get(classification.dataTypeId) || []),
|
|
135
|
+
],
|
|
136
|
+
}
|
|
137
|
+
: classification;
|
|
138
|
+
};
|
|
113
139
|
const hinted = (0, FieldNameHints_1.getHintedDataTypeIds)(fieldPath, options.extraHints);
|
|
114
140
|
for (const disabled of options.disabledDataTypeIds || []) {
|
|
115
141
|
hinted.delete(disabled);
|
|
@@ -151,7 +177,8 @@ function classifyField(fieldPath, rawValues, options = {}) {
|
|
|
151
177
|
}
|
|
152
178
|
}
|
|
153
179
|
}
|
|
154
|
-
for (
|
|
180
|
+
for (let valueIndex = 0; valueIndex < values.length; valueIndex++) {
|
|
181
|
+
const value = values[valueIndex];
|
|
155
182
|
const matches = (0, TextScanner_1.findSensitiveValues)(value, scanOptions);
|
|
156
183
|
// Types with a real match in the value, which its ratio counts.
|
|
157
184
|
const typesInValue = new Set();
|
|
@@ -193,6 +220,7 @@ function classifyField(fieldPath, rawValues, options = {}) {
|
|
|
193
220
|
}
|
|
194
221
|
for (const dataTypeId of typesInValue) {
|
|
195
222
|
valuesWithMatch.set(dataTypeId, (valuesWithMatch.get(dataTypeId) || 0) + 1);
|
|
223
|
+
noteMatchedValue(dataTypeId, valueIndex);
|
|
196
224
|
}
|
|
197
225
|
}
|
|
198
226
|
const results = [];
|
|
@@ -201,7 +229,7 @@ function classifyField(fieldPath, rawValues, options = {}) {
|
|
|
201
229
|
const withMatch = valuesWithMatch.get(tally.dataTypeId) || 0;
|
|
202
230
|
const ratio = withMatch / values.length;
|
|
203
231
|
const nameHinted = hinted.has(tally.dataTypeId);
|
|
204
|
-
results.push({
|
|
232
|
+
results.push(withMatchedValueIndexes({
|
|
205
233
|
...json,
|
|
206
234
|
confidence: isFreeText || json.matchCount === 0
|
|
207
235
|
? json.confidence
|
|
@@ -212,7 +240,7 @@ function classifyField(fieldPath, rawValues, options = {}) {
|
|
|
212
240
|
isFreeText,
|
|
213
241
|
nameHinted,
|
|
214
242
|
foundByName: false,
|
|
215
|
-
});
|
|
243
|
+
}));
|
|
216
244
|
}
|
|
217
245
|
// Types found from names only.
|
|
218
246
|
for (const dataTypeId of hinted) {
|
|
@@ -223,9 +251,11 @@ function classifyField(fieldPath, rawValues, options = {}) {
|
|
|
223
251
|
const shape = NAME_VALUE_SHAPES[dataTypeId];
|
|
224
252
|
let plausible = 0;
|
|
225
253
|
const samples = [];
|
|
226
|
-
for (
|
|
254
|
+
for (let valueIndex = 0; valueIndex < values.length; valueIndex++) {
|
|
255
|
+
const value = values[valueIndex];
|
|
227
256
|
if (!shape || shape.test(value)) {
|
|
228
257
|
plausible++;
|
|
258
|
+
noteMatchedValue(dataTypeId, valueIndex);
|
|
229
259
|
if (samples.length < 3) {
|
|
230
260
|
const masked = (0, Masking_1.maskValue)(dataTypeId, value);
|
|
231
261
|
if (!samples.includes(masked)) {
|
|
@@ -238,7 +268,7 @@ function classifyField(fieldPath, rawValues, options = {}) {
|
|
|
238
268
|
continue;
|
|
239
269
|
}
|
|
240
270
|
const ratio = plausible / values.length;
|
|
241
|
-
results.push({
|
|
271
|
+
results.push(withMatchedValueIndexes({
|
|
242
272
|
dataTypeId,
|
|
243
273
|
matchCount: plausible,
|
|
244
274
|
testValueCount: 0,
|
|
@@ -252,7 +282,7 @@ function classifyField(fieldPath, rawValues, options = {}) {
|
|
|
252
282
|
isFreeText,
|
|
253
283
|
nameHinted: true,
|
|
254
284
|
foundByName: true,
|
|
255
|
-
});
|
|
285
|
+
}));
|
|
256
286
|
}
|
|
257
287
|
return results;
|
|
258
288
|
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { DataSecurityOccurrenceExcerpt } from "../../Types/DataSecurity/DataSecurityApiTypes.mjs";
|
|
2
|
+
import { ScanDetector } from "./TextScanner.mjs";
|
|
3
|
+
export declare const EXCERPT_CONTEXT_BEFORE: number;
|
|
4
|
+
export declare const EXCERPT_CONTEXT_AFTER: number;
|
|
5
|
+
export interface OccurrenceExcerptOptions {
|
|
6
|
+
customDetectors?: ReadonlyArray<ScanDetector> | undefined;
|
|
7
|
+
extraHints?: ReadonlyArray<{
|
|
8
|
+
dataTypeId: string;
|
|
9
|
+
hints: ReadonlyArray<string>;
|
|
10
|
+
}> | undefined;
|
|
11
|
+
disabledDataTypeIds?: ReadonlySet<string> | undefined;
|
|
12
|
+
allowedValues?: ReadonlySet<string> | undefined;
|
|
13
|
+
}
|
|
14
|
+
export declare function toReadableText(text: string): string;
|
|
15
|
+
export declare function buildOccurrenceExcerpt(data: {
|
|
16
|
+
value: string;
|
|
17
|
+
dataTypeId: string;
|
|
18
|
+
location: string;
|
|
19
|
+
field?: string | undefined;
|
|
20
|
+
event?: string | undefined;
|
|
21
|
+
options?: OccurrenceExcerptOptions | undefined;
|
|
22
|
+
}): DataSecurityOccurrenceExcerpt;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { DataSecurityOccurrenceExcerpt } from "../../Types/DataSecurity/DataSecurityApiTypes";
|
|
2
|
+
import { ScanDetector } from "./TextScanner";
|
|
3
|
+
export declare const EXCERPT_CONTEXT_BEFORE: number;
|
|
4
|
+
export declare const EXCERPT_CONTEXT_AFTER: number;
|
|
5
|
+
export interface OccurrenceExcerptOptions {
|
|
6
|
+
customDetectors?: ReadonlyArray<ScanDetector> | undefined;
|
|
7
|
+
extraHints?: ReadonlyArray<{
|
|
8
|
+
dataTypeId: string;
|
|
9
|
+
hints: ReadonlyArray<string>;
|
|
10
|
+
}> | undefined;
|
|
11
|
+
disabledDataTypeIds?: ReadonlySet<string> | undefined;
|
|
12
|
+
allowedValues?: ReadonlySet<string> | undefined;
|
|
13
|
+
}
|
|
14
|
+
export declare function toReadableText(text: string): string;
|
|
15
|
+
export declare function buildOccurrenceExcerpt(data: {
|
|
16
|
+
value: string;
|
|
17
|
+
dataTypeId: string;
|
|
18
|
+
location: string;
|
|
19
|
+
field?: string | undefined;
|
|
20
|
+
event?: string | undefined;
|
|
21
|
+
options?: OccurrenceExcerptOptions | undefined;
|
|
22
|
+
}): DataSecurityOccurrenceExcerpt;
|