@oneuptime/common 14.0.98 → 14.0.99
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/CloudAccount.d.mts +8 -0
- package/Models/DatabaseModels/CloudAccount.d.ts +8 -0
- package/Models/DatabaseModels/CloudAccount.js +167 -0
- package/Models/DatabaseModels/CloudAccountFeed.d.mts +27 -0
- package/Models/DatabaseModels/CloudAccountFeed.d.ts +27 -0
- package/Models/DatabaseModels/CloudAccountFeed.js +557 -0
- package/Models/DatabaseModels/CloudAccountFeed.mjs +3 -0
- package/Models/DatabaseModels/DataSecurityCheckSetting.d.mts +17 -0
- package/Models/DatabaseModels/DataSecurityCheckSetting.d.ts +17 -0
- package/Models/DatabaseModels/DataSecurityCheckSetting.js +304 -0
- package/Models/DatabaseModels/DataSecurityCheckSetting.mjs +2 -0
- package/Models/DatabaseModels/DataSecurityCustomDataType.d.mts +25 -0
- package/Models/DatabaseModels/DataSecurityCustomDataType.d.ts +25 -0
- package/Models/DatabaseModels/DataSecurityCustomDataType.js +431 -0
- package/Models/DatabaseModels/DataSecurityCustomDataType.mjs +2 -0
- package/Models/DatabaseModels/DataSecurityFlow.d.mts +26 -0
- package/Models/DatabaseModels/DataSecurityFlow.d.ts +26 -0
- package/Models/DatabaseModels/DataSecurityFlow.js +456 -0
- package/Models/DatabaseModels/DataSecurityFlow.mjs +2 -0
- package/Models/DatabaseModels/DataSecurityIssue.d.mts +49 -0
- package/Models/DatabaseModels/DataSecurityIssue.d.ts +49 -0
- package/Models/DatabaseModels/DataSecurityIssue.js +797 -0
- package/Models/DatabaseModels/DataSecurityIssue.mjs +2 -0
- package/Models/DatabaseModels/DataSecurityIssueFeed.d.mts +43 -0
- package/Models/DatabaseModels/DataSecurityIssueFeed.d.ts +43 -0
- package/Models/DatabaseModels/DataSecurityIssueFeed.js +382 -0
- package/Models/DatabaseModels/DataSecurityIssueFeed.mjs +3 -0
- package/Models/DatabaseModels/DataSecurityResidencyRule.d.mts +18 -0
- package/Models/DatabaseModels/DataSecurityResidencyRule.d.ts +18 -0
- package/Models/DatabaseModels/DataSecurityResidencyRule.js +331 -0
- package/Models/DatabaseModels/DataSecurityResidencyRule.mjs +2 -0
- package/Models/DatabaseModels/DataSecurityScan.d.mts +29 -0
- package/Models/DatabaseModels/DataSecurityScan.d.ts +29 -0
- package/Models/DatabaseModels/DataSecurityScan.js +520 -0
- package/Models/DatabaseModels/DataSecurityScan.mjs +2 -0
- package/Models/DatabaseModels/DataSecuritySetting.d.mts +35 -0
- package/Models/DatabaseModels/DataSecuritySetting.d.ts +35 -0
- package/Models/DatabaseModels/DataSecuritySetting.js +631 -0
- package/Models/DatabaseModels/DataSecuritySetting.mjs +2 -0
- package/Models/DatabaseModels/DataStore.d.mts +83 -0
- package/Models/DatabaseModels/DataStore.d.ts +83 -0
- package/Models/DatabaseModels/DataStore.js +1343 -0
- package/Models/DatabaseModels/DataStore.mjs +2 -0
- package/Models/DatabaseModels/DataStoreAccess.d.mts +22 -0
- package/Models/DatabaseModels/DataStoreAccess.d.ts +22 -0
- package/Models/DatabaseModels/DataStoreAccess.js +407 -0
- package/Models/DatabaseModels/DataStoreAccess.mjs +2 -0
- package/Models/DatabaseModels/DataStoreFeed.d.mts +36 -0
- package/Models/DatabaseModels/DataStoreFeed.d.ts +36 -0
- package/Models/DatabaseModels/DataStoreFeed.js +613 -0
- package/Models/DatabaseModels/DataStoreFeed.mjs +3 -0
- package/Models/DatabaseModels/DataStoreFinding.d.mts +38 -0
- package/Models/DatabaseModels/DataStoreFinding.d.ts +38 -0
- package/Models/DatabaseModels/DataStoreFinding.js +683 -0
- package/Models/DatabaseModels/DataStoreFinding.mjs +2 -0
- package/Models/DatabaseModels/DataStoreLabelRule.d.mts +21 -0
- package/Models/DatabaseModels/DataStoreLabelRule.d.ts +21 -0
- package/Models/DatabaseModels/DataStoreLabelRule.js +623 -0
- package/Models/DatabaseModels/DataStoreLabelRule.mjs +2 -0
- package/Models/DatabaseModels/DataStoreOwnerRule.d.mts +24 -0
- package/Models/DatabaseModels/DataStoreOwnerRule.d.ts +24 -0
- package/Models/DatabaseModels/DataStoreOwnerRule.js +714 -0
- package/Models/DatabaseModels/DataStoreOwnerRule.mjs +2 -0
- package/Models/DatabaseModels/DataStoreOwnerTeam.d.mts +19 -0
- package/Models/DatabaseModels/DataStoreOwnerTeam.d.ts +19 -0
- package/Models/DatabaseModels/DataStoreOwnerTeam.js +477 -0
- package/Models/DatabaseModels/DataStoreOwnerTeam.mjs +2 -0
- package/Models/DatabaseModels/DataStoreOwnerUser.d.mts +18 -0
- package/Models/DatabaseModels/DataStoreOwnerUser.d.ts +18 -0
- package/Models/DatabaseModels/DataStoreOwnerUser.js +476 -0
- package/Models/DatabaseModels/DataStoreOwnerUser.mjs +2 -0
- package/Models/DatabaseModels/GlobalConfig.d.mts +5 -0
- package/Models/DatabaseModels/GlobalConfig.d.ts +5 -0
- package/Models/DatabaseModels/GlobalConfig.js +110 -0
- package/Models/DatabaseModels/Index.js +35 -0
- package/Models/DatabaseModels/OnCallDutyPolicyExecutionLog.d.mts +1 -0
- package/Models/DatabaseModels/OnCallDutyPolicyExecutionLog.d.ts +1 -0
- package/Models/DatabaseModels/OnCallDutyPolicyExecutionLog.js +43 -0
- package/Models/DatabaseModels/ResourceAiAgent.js +3 -1
- package/Models/DatabaseModels/SecurityEntityCriticality.js +7 -6
- package/Models/DatabaseModels/SecurityEntityRisk.js +2 -2
- package/Models/DatabaseModels/TelemetryException.d.mts +5 -0
- package/Models/DatabaseModels/TelemetryException.d.ts +5 -0
- package/Models/DatabaseModels/TelemetryException.js +170 -8
- package/Types/AI/AIChatPageContext.d.mts +4 -1
- package/Types/AI/AIChatPageContext.d.ts +4 -1
- package/Types/AI/AIChatPageContext.js +7 -0
- package/Types/AI/AIChatTypes.d.mts +6 -1
- package/Types/AI/AIChatTypes.d.ts +6 -1
- package/Types/AI/AIChatTypes.js +9 -0
- package/Types/AI/AiAffectedResources.js +5 -3
- package/Types/AI/CodeFixTaskContext.d.mts +21 -0
- package/Types/AI/CodeFixTaskContext.d.ts +21 -0
- package/Types/AI/CodeFixTaskContext.js +61 -4
- package/Types/AI/CodeFixTaskContext.mjs +2 -0
- package/Types/AI/CodeTask.d.mts +2 -0
- package/Types/AI/CodeTask.d.ts +2 -0
- package/Types/AI/CodeTask.js +4 -0
- package/Types/AI/ResourceAiAccessApi.d.mts +1 -0
- package/Types/AI/ResourceAiAccessApi.d.ts +1 -0
- package/Types/AI/ResourceAiAccessPermissions.js +6 -0
- package/Types/AutoRemediation/AiRemediationCommandPlan.d.mts +19 -0
- package/Types/AutoRemediation/AiRemediationCommandPlan.d.ts +19 -0
- package/Types/AutoRemediation/AiRemediationCommandPlan.js +85 -10
- package/Types/AutoRemediation/AiRemediationCommandPlan.mjs +4 -0
- package/Types/AutoRemediation/RemediationTryAgain.d.mts +17 -0
- package/Types/AutoRemediation/RemediationTryAgain.d.ts +17 -0
- package/Types/AutoRemediation/RemediationTryAgain.js +104 -0
- package/Types/AutoRemediation/RemediationTryAgain.mjs +6 -0
- package/Types/CloudConnection/CloudAiAgentCost.d.mts +19 -0
- package/Types/CloudConnection/CloudAiAgentCost.d.ts +19 -0
- package/Types/CloudConnection/CloudAiAgentCost.js +95 -0
- package/Types/CloudConnection/CloudAiAgentCost.mjs +15 -0
- package/Types/CloudConnection/CloudAiAgentSetupCommands.d.mts +70 -0
- package/Types/CloudConnection/CloudAiAgentSetupCommands.d.ts +70 -0
- package/Types/CloudConnection/CloudAiAgentSetupCommands.js +1107 -0
- package/Types/CloudConnection/CloudAiAgentSetupCommands.mjs +37 -0
- package/Types/CloudConnection/CloudConnectionCatalog.d.mts +8 -0
- package/Types/CloudConnection/CloudConnectionCatalog.d.ts +8 -0
- package/Types/CloudConnection/CloudConnectionCatalog.js +75 -1
- package/Types/CloudConnection/CloudConnectionCatalog.mjs +6 -0
- package/Types/CloudConnection/CloudConnectionSetupCommands.d.mts +48 -4
- package/Types/CloudConnection/CloudConnectionSetupCommands.d.ts +48 -4
- package/Types/CloudConnection/CloudConnectionSetupCommands.js +410 -16
- package/Types/CloudConnection/CloudConnectionSetupCommands.mjs +21 -0
- package/Types/CodeRepository/CodeHost.d.mts +2 -1
- package/Types/CodeRepository/CodeHost.d.ts +2 -1
- package/Types/CodeRepository/CodeHost.js +12 -5
- package/Types/CodeRepository/ProductionReview.d.mts +7 -0
- package/Types/CodeRepository/ProductionReview.d.ts +7 -0
- package/Types/CodeRepository/ProductionReview.js +67 -1
- package/Types/CodeRepository/ProductionReview.mjs +1 -0
- package/Types/DataSecurity/ComplianceFramework.d.mts +21 -0
- package/Types/DataSecurity/ComplianceFramework.d.ts +21 -0
- package/Types/DataSecurity/ComplianceFramework.js +97 -0
- package/Types/DataSecurity/ComplianceFramework.mjs +5 -0
- package/Types/DataSecurity/ComplianceRequirementCatalog.d.mts +41 -0
- package/Types/DataSecurity/ComplianceRequirementCatalog.d.ts +41 -0
- package/Types/DataSecurity/ComplianceRequirementCatalog.js +199 -0
- package/Types/DataSecurity/ComplianceRequirementCatalog.mjs +7 -0
- package/Types/DataSecurity/DataCategory.d.mts +15 -0
- package/Types/DataSecurity/DataCategory.d.ts +15 -0
- package/Types/DataSecurity/DataCategory.js +61 -0
- package/Types/DataSecurity/DataCategory.mjs +7 -0
- package/Types/DataSecurity/DataConfidence.d.mts +11 -0
- package/Types/DataSecurity/DataConfidence.d.ts +11 -0
- package/Types/DataSecurity/DataConfidence.js +49 -0
- package/Types/DataSecurity/DataConfidence.mjs +7 -0
- package/Types/DataSecurity/DataSecurityApiTypes.d.mts +106 -0
- package/Types/DataSecurity/DataSecurityApiTypes.d.ts +106 -0
- package/Types/DataSecurity/DataSecurityApiTypes.js +53 -0
- package/Types/DataSecurity/DataSecurityApiTypes.mjs +3 -0
- package/Types/DataSecurity/DataSecurityCheckCatalog.d.mts +93 -0
- package/Types/DataSecurity/DataSecurityCheckCatalog.d.ts +93 -0
- package/Types/DataSecurity/DataSecurityCheckCatalog.js +1183 -0
- package/Types/DataSecurity/DataSecurityCheckCatalog.mjs +10 -0
- package/Types/DataSecurity/DataSecurityIssueStatus.d.mts +10 -0
- package/Types/DataSecurity/DataSecurityIssueStatus.d.ts +10 -0
- package/Types/DataSecurity/DataSecurityIssueStatus.js +38 -0
- package/Types/DataSecurity/DataSecurityIssueStatus.mjs +5 -0
- package/Types/DataSecurity/DataSecurityResidency.d.mts +21 -0
- package/Types/DataSecurity/DataSecurityResidency.d.ts +21 -0
- package/Types/DataSecurity/DataSecurityResidency.js +92 -0
- package/Types/DataSecurity/DataSecurityResidency.mjs +5 -0
- package/Types/DataSecurity/DataSecurityResponseAction.d.mts +14 -0
- package/Types/DataSecurity/DataSecurityResponseAction.d.ts +14 -0
- package/Types/DataSecurity/DataSecurityResponseAction.js +115 -0
- package/Types/DataSecurity/DataSecurityResponseAction.mjs +11 -0
- package/Types/DataSecurity/DataSecurityRisk.d.mts +38 -0
- package/Types/DataSecurity/DataSecurityRisk.d.ts +38 -0
- package/Types/DataSecurity/DataSecurityRisk.js +138 -0
- package/Types/DataSecurity/DataSecurityRisk.mjs +7 -0
- package/Types/DataSecurity/DataSensitivity.d.mts +13 -0
- package/Types/DataSecurity/DataSensitivity.d.ts +13 -0
- package/Types/DataSecurity/DataSensitivity.js +68 -0
- package/Types/DataSecurity/DataSensitivity.mjs +8 -0
- package/Types/DataSecurity/DataStoreAccess.d.mts +27 -0
- package/Types/DataSecurity/DataStoreAccess.d.ts +27 -0
- package/Types/DataSecurity/DataStoreAccess.js +35 -0
- package/Types/DataSecurity/DataStoreAccess.mjs +4 -0
- package/Types/DataSecurity/DataStoreEnvironment.d.mts +11 -0
- package/Types/DataSecurity/DataStoreEnvironment.d.ts +11 -0
- package/Types/DataSecurity/DataStoreEnvironment.js +80 -0
- package/Types/DataSecurity/DataStoreEnvironment.mjs +5 -0
- package/Types/DataSecurity/DataStoreKey.d.mts +18 -0
- package/Types/DataSecurity/DataStoreKey.d.ts +18 -0
- package/Types/DataSecurity/DataStoreKey.js +49 -0
- package/Types/DataSecurity/DataStoreKey.mjs +7 -0
- package/Types/DataSecurity/DataStoreKind.d.mts +67 -0
- package/Types/DataSecurity/DataStoreKind.d.ts +67 -0
- package/Types/DataSecurity/DataStoreKind.js +230 -0
- package/Types/DataSecurity/DataStoreKind.mjs +10 -0
- package/Types/DataSecurity/DataStorePosture.d.mts +40 -0
- package/Types/DataSecurity/DataStorePosture.d.ts +40 -0
- package/Types/DataSecurity/DataStorePosture.js +100 -0
- package/Types/DataSecurity/DataStorePosture.mjs +7 -0
- package/Types/DataSecurity/DataTypeCatalog.d.mts +17 -0
- package/Types/DataSecurity/DataTypeCatalog.d.ts +17 -0
- package/Types/DataSecurity/DataTypeCatalog.js +434 -0
- package/Types/DataSecurity/DataTypeCatalog.mjs +4 -0
- package/Types/Email/EmailTemplateType.d.mts +1 -0
- package/Types/Email/EmailTemplateType.d.ts +1 -0
- package/Types/Email/EmailTemplateType.js +6 -0
- package/Types/Monitor/CephAlertTemplates.d.mts +2 -1
- package/Types/Monitor/CephAlertTemplates.d.ts +2 -1
- package/Types/Monitor/CephAlertTemplates.js +49 -0
- package/Types/Monitor/CephAlertTemplates.mjs +1 -0
- package/Types/Monitor/DockerAlertTemplates.d.mts +2 -1
- package/Types/Monitor/DockerAlertTemplates.d.ts +2 -1
- package/Types/Monitor/DockerAlertTemplates.js +109 -37
- package/Types/Monitor/DockerAlertTemplates.mjs +1 -0
- package/Types/Monitor/DockerMetricCatalog.d.mts +1 -0
- package/Types/Monitor/DockerMetricCatalog.d.ts +1 -0
- package/Types/Monitor/DockerMetricCatalog.js +26 -52
- package/Types/Monitor/DockerSwarmAlertTemplates.d.mts +1 -0
- package/Types/Monitor/DockerSwarmAlertTemplates.d.ts +1 -0
- package/Types/Monitor/DockerSwarmAlertTemplates.js +65 -8
- package/Types/Monitor/DockerSwarmAlertTemplates.mjs +1 -0
- package/Types/Monitor/DockerSwarmMetricCatalog.js +7 -4
- package/Types/Monitor/HostAlertTemplates.d.mts +2 -1
- package/Types/Monitor/HostAlertTemplates.d.ts +2 -1
- package/Types/Monitor/HostAlertTemplates.js +48 -0
- package/Types/Monitor/HostAlertTemplates.mjs +1 -0
- package/Types/Monitor/IotAlertTemplates.d.mts +1 -0
- package/Types/Monitor/IotAlertTemplates.d.ts +1 -0
- package/Types/Monitor/IotAlertTemplates.js +11 -0
- package/Types/Monitor/IotAlertTemplates.mjs +1 -0
- package/Types/Monitor/KubernetesAlertTemplates.d.mts +49 -1
- package/Types/Monitor/KubernetesAlertTemplates.d.ts +49 -1
- package/Types/Monitor/KubernetesAlertTemplates.js +392 -75
- package/Types/Monitor/KubernetesAlertTemplates.mjs +2 -0
- package/Types/Monitor/KubernetesMetricCatalog.js +12 -2
- package/Types/Monitor/MetricMonitor/MetricMonitorResponse.d.mts +4 -4
- package/Types/Monitor/MetricMonitor/MetricMonitorResponse.d.ts +4 -4
- package/Types/Monitor/MonitorCriteriaInstance.js +107 -10
- package/Types/Monitor/MonitorStep.js +50 -3
- package/Types/Monitor/MonitorStepDockerSwarmMonitor.d.mts +33 -11
- package/Types/Monitor/MonitorStepDockerSwarmMonitor.d.ts +33 -11
- package/Types/Monitor/MonitorStepDockerSwarmMonitor.js +65 -0
- package/Types/Monitor/MonitorStepKubernetesMonitor.d.mts +6 -0
- package/Types/Monitor/MonitorStepKubernetesMonitor.d.ts +6 -0
- package/Types/Monitor/MonitorStepKubernetesMonitor.js +38 -1
- package/Types/Monitor/MonitorStepKubernetesMonitor.mjs +2 -0
- package/Types/Monitor/MonitorType.d.mts +1 -0
- package/Types/Monitor/MonitorType.d.ts +1 -0
- package/Types/Monitor/MonitorType.js +18 -0
- package/Types/Monitor/PodmanAlertTemplates.d.mts +12 -1
- package/Types/Monitor/PodmanAlertTemplates.d.ts +12 -1
- package/Types/Monitor/PodmanAlertTemplates.js +161 -33
- package/Types/Monitor/PodmanAlertTemplates.mjs +2 -0
- package/Types/Monitor/PodmanMetricCatalog.d.mts +1 -0
- package/Types/Monitor/PodmanMetricCatalog.d.ts +1 -0
- package/Types/Monitor/PodmanMetricCatalog.js +26 -52
- package/Types/Monitor/ProxmoxAlertTemplates.d.mts +1 -0
- package/Types/Monitor/ProxmoxAlertTemplates.d.ts +1 -0
- package/Types/Monitor/ProxmoxAlertTemplates.js +49 -0
- package/Types/Monitor/ProxmoxAlertTemplates.mjs +1 -0
- package/Types/Monitor/Recommendation/RecommendationCriteriaBuilder.d.mts +19 -0
- package/Types/Monitor/Recommendation/RecommendationCriteriaBuilder.d.ts +19 -0
- package/Types/Monitor/Recommendation/RecommendationCriteriaBuilder.js +50 -2
- package/Types/Monitor/Recommendation/RecommendationCriteriaBuilder.mjs +2 -0
- package/Types/Monitor/SnmpMonitor/NetworkDeviceAlertPack.d.mts +2 -0
- package/Types/Monitor/SnmpMonitor/NetworkDeviceAlertPack.d.ts +2 -0
- package/Types/Monitor/SnmpMonitor/NetworkDeviceAlertPack.js +31 -2
- package/Types/Monitor/StorageArrayAlertTemplates.d.mts +2 -1
- package/Types/Monitor/StorageArrayAlertTemplates.d.ts +2 -1
- package/Types/Monitor/StorageArrayAlertTemplates.js +69 -0
- package/Types/Monitor/StorageArrayAlertTemplates.mjs +1 -0
- package/Types/Monitor/VMwareAlertTemplates.d.mts +2 -1
- package/Types/Monitor/VMwareAlertTemplates.d.ts +2 -1
- package/Types/Monitor/VMwareAlertTemplates.js +50 -0
- package/Types/Monitor/VMwareAlertTemplates.mjs +1 -0
- package/Types/OnCallDutyPolicy/OnCallPersonPage.d.mts +44 -0
- package/Types/OnCallDutyPolicy/OnCallPersonPage.d.ts +44 -0
- package/Types/OnCallDutyPolicy/OnCallPersonPage.js +171 -0
- package/Types/OnCallDutyPolicy/OnCallPersonPage.mjs +14 -0
- package/Types/Permission.d.mts +51 -0
- package/Types/Permission.d.ts +51 -0
- package/Types/Permission.js +542 -0
- package/Types/Probe/ProbeCapability.d.mts +2 -1
- package/Types/Probe/ProbeCapability.d.ts +2 -1
- package/Types/Probe/ProbeCapability.js +8 -0
- package/Types/ProviderLogo/ProviderLogo.d.mts +2 -0
- package/Types/ProviderLogo/ProviderLogo.d.ts +2 -0
- package/Types/ProviderLogo/ProviderLogo.js +4 -0
- package/Types/ResourceAiAgent/AiResourceType.d.mts +7 -1
- package/Types/ResourceAiAgent/AiResourceType.d.ts +7 -1
- package/Types/ResourceAiAgent/AiResourceType.js +76 -2
- package/Types/ResourceAiAgent/AiResourceType.mjs +3 -0
- package/Types/ResourceAiAgent/CloudAiAgentNames.d.mts +19 -0
- package/Types/ResourceAiAgent/CloudAiAgentNames.d.ts +19 -0
- package/Types/ResourceAiAgent/CloudAiAgentNames.js +75 -0
- package/Types/ResourceAiAgent/CloudAiAgentNames.mjs +16 -0
- package/Types/ResourceAiAgent/ResourceAiAccess.d.mts +12 -1
- package/Types/ResourceAiAgent/ResourceAiAccess.d.ts +12 -1
- package/Types/ResourceAiAgent/ResourceAiAccess.js +28 -1
- package/Types/ResourceAiAgent/ResourceAiAccess.mjs +6 -0
- package/Types/Rules/RuleCriteriaFieldRegistry.js +13 -0
- package/Types/Rules/RuleCriteriaSubject.d.mts +2 -1
- package/Types/Rules/RuleCriteriaSubject.d.ts +2 -1
- package/Types/Rules/RuleCriteriaSubject.js +3 -0
- package/Types/Rules/RuleRun.d.mts +2 -0
- package/Types/Rules/RuleRun.d.ts +2 -0
- package/Types/Rules/RuleRun.js +4 -0
- package/Types/SecurityCase/SecurityDetectionSource.d.mts +2 -1
- package/Types/SecurityCase/SecurityDetectionSource.d.ts +2 -1
- package/Types/SecurityCase/SecurityDetectionSource.js +5 -2
- package/Types/SecurityCase/SecurityEntity.d.mts +5 -0
- package/Types/SecurityCase/SecurityEntity.d.ts +5 -0
- package/Types/SecurityCase/SecurityEntity.js +39 -1
- package/Types/SecurityCase/SecurityEntity.mjs +4 -0
- package/Types/SecurityCase/SecurityEntityRisk.js +14 -6
- package/Types/SecurityEvent/Connectors/SecurityEventConnectorCatalog.d.mts +2 -0
- package/Types/SecurityEvent/Connectors/SecurityEventConnectorCatalog.d.ts +2 -0
- package/Types/SecurityEvent/Connectors/SecurityEventConnectorCatalog.js +124 -1
- package/Types/SecurityEvent/Connectors/SecurityEventConnectorCatalog.mjs +2 -0
- package/Types/SecurityEvent/Connectors/SecurityEventConnectorProvider.d.mts +3 -1
- package/Types/SecurityEvent/Connectors/SecurityEventConnectorProvider.d.ts +3 -1
- package/Types/SecurityEvent/Connectors/SecurityEventConnectorProvider.js +4 -0
- package/Types/SecurityEvent/DataSecuritySignal.d.mts +33 -0
- package/Types/SecurityEvent/DataSecuritySignal.d.ts +33 -0
- package/Types/SecurityEvent/DataSecuritySignal.js +114 -0
- package/Types/SecurityEvent/DataSecuritySignal.mjs +14 -0
- package/Types/SecurityEvent/DetectionRuleDataKind.d.mts +7 -1
- package/Types/SecurityEvent/DetectionRuleDataKind.d.ts +7 -1
- package/Types/SecurityEvent/DetectionRuleDataKind.js +74 -0
- package/Types/SecurityEvent/DetectionRuleLibrary.d.mts +2 -1
- package/Types/SecurityEvent/DetectionRuleLibrary.d.ts +2 -1
- package/Types/SecurityEvent/DetectionRuleLibrary.js +730 -0
- package/Types/SecurityEvent/OcsfEventClass.js +31 -2
- package/Types/SecurityEvent/SecurityLogFormat.d.mts +15 -0
- package/Types/SecurityEvent/SecurityLogFormat.d.ts +15 -0
- package/Types/SecurityEvent/SecurityLogFormat.js +123 -10
- package/Types/SecurityEvent/SecurityLogFormat.mjs +4 -0
- package/Types/SecurityPlaybook/SecurityPlaybookAction.d.mts +3 -0
- package/Types/SecurityPlaybook/SecurityPlaybookAction.d.ts +3 -0
- package/Types/SecurityPlaybook/SecurityPlaybookAction.js +37 -0
- package/Types/SecurityPlaybook/SecurityPlaybookStep.d.mts +3 -0
- package/Types/SecurityPlaybook/SecurityPlaybookStep.d.ts +3 -0
- package/Types/SecurityPlaybook/SecurityPlaybookStep.js +9 -0
- package/Types/SecurityPlaybook/SecurityProtectedEntity.js +8 -1
- package/Types/Telemetry/ExceptionAIDigest.d.mts +31 -0
- package/Types/Telemetry/ExceptionAIDigest.d.ts +31 -0
- package/Types/Telemetry/ExceptionAIDigest.js +131 -0
- package/Types/Telemetry/ExceptionAIDigest.mjs +13 -0
- package/Types/Telemetry/ExceptionAIExplanation.d.mts +37 -0
- package/Types/Telemetry/ExceptionAIExplanation.d.ts +37 -0
- package/Types/Telemetry/ExceptionAIExplanation.js +110 -0
- package/Types/Telemetry/ExceptionAIExplanation.mjs +12 -0
- package/Types/Telemetry/TraceSpanType.d.mts +1 -1
- package/Types/Telemetry/TraceSpanType.d.ts +1 -1
- package/Types/Telemetry/TraceSpanType.js +33 -8
- package/Types/Telemetry/TraceSpanType.mjs +1 -1
- package/Types/UpdateCheck/SecurityAdvisory.d.mts +39 -0
- package/Types/UpdateCheck/SecurityAdvisory.d.ts +39 -0
- package/Types/UpdateCheck/SecurityAdvisory.js +221 -0
- package/Types/UpdateCheck/SecurityAdvisory.mjs +7 -0
- package/Types/UpdateCheck/UpdateCheckFailure.d.mts +9 -0
- package/Types/UpdateCheck/UpdateCheckFailure.d.ts +9 -0
- package/Types/UpdateCheck/UpdateCheckFailure.js +32 -0
- package/Types/UpdateCheck/UpdateCheckFailure.mjs +3 -0
- package/Types/UpdateCheck/UpdateStatus.d.mts +44 -0
- package/Types/UpdateCheck/UpdateStatus.d.ts +44 -0
- package/Types/UpdateCheck/UpdateStatus.js +195 -0
- package/Types/UpdateCheck/UpdateStatus.mjs +3 -0
- package/Types/Workspace/WorkspaceMessagePayload.d.mts +1 -0
- package/Types/Workspace/WorkspaceMessagePayload.d.ts +1 -0
- package/Utils/AiRemediation/CloudChangeDryRunPlan.d.mts +17 -0
- package/Utils/AiRemediation/CloudChangeDryRunPlan.d.ts +17 -0
- package/Utils/AiRemediation/CloudChangeDryRunPlan.js +122 -0
- package/Utils/AiRemediation/CloudChangeDryRunPlan.mjs +7 -0
- package/Utils/AiRemediation/Resource/CloudCommandPolicy.d.mts +4 -0
- package/Utils/AiRemediation/Resource/CloudCommandPolicy.d.ts +4 -0
- package/Utils/AiRemediation/Resource/CloudCommandPolicy.js +177 -0
- package/Utils/AiRemediation/Resource/CloudCommandPolicy.mjs +4 -0
- package/Utils/AiRemediation/Resource/CloudOperationCatalog.d.mts +144 -0
- package/Utils/AiRemediation/Resource/CloudOperationCatalog.d.ts +144 -0
- package/Utils/AiRemediation/Resource/CloudOperationCatalog.js +1964 -0
- package/Utils/AiRemediation/Resource/CloudOperationCatalog.mjs +48 -0
- package/Utils/AiRemediation/Resource/ResourceCommandPolicy.js +4 -0
- package/Utils/DataSecurity/CustomDataTypeDetector.d.mts +23 -0
- package/Utils/DataSecurity/CustomDataTypeDetector.d.ts +23 -0
- package/Utils/DataSecurity/CustomDataTypeDetector.js +130 -0
- package/Utils/DataSecurity/CustomDataTypeDetector.mjs +8 -0
- package/Utils/DataSecurity/Detector.d.mts +26 -0
- package/Utils/DataSecurity/Detector.d.ts +26 -0
- package/Utils/DataSecurity/Detector.js +83 -0
- package/Utils/DataSecurity/Detector.mjs +8 -0
- package/Utils/DataSecurity/Detectors/ContactDetectors.d.mts +12 -0
- package/Utils/DataSecurity/Detectors/ContactDetectors.d.ts +12 -0
- package/Utils/DataSecurity/Detectors/ContactDetectors.js +915 -0
- package/Utils/DataSecurity/Detectors/ContactDetectors.mjs +12 -0
- package/Utils/DataSecurity/Detectors/DocumentMarkingDetectors.d.mts +3 -0
- package/Utils/DataSecurity/Detectors/DocumentMarkingDetectors.d.ts +3 -0
- package/Utils/DataSecurity/Detectors/DocumentMarkingDetectors.js +52 -0
- package/Utils/DataSecurity/Detectors/DocumentMarkingDetectors.mjs +3 -0
- package/Utils/DataSecurity/Detectors/FinancialDetectors.d.mts +8 -0
- package/Utils/DataSecurity/Detectors/FinancialDetectors.d.ts +8 -0
- package/Utils/DataSecurity/Detectors/FinancialDetectors.js +566 -0
- package/Utils/DataSecurity/Detectors/FinancialDetectors.mjs +8 -0
- package/Utils/DataSecurity/Detectors/GovernmentIdDetectors.d.mts +3 -0
- package/Utils/DataSecurity/Detectors/GovernmentIdDetectors.d.ts +3 -0
- package/Utils/DataSecurity/Detectors/GovernmentIdDetectors.js +2415 -0
- package/Utils/DataSecurity/Detectors/GovernmentIdDetectors.mjs +3 -0
- package/Utils/DataSecurity/Detectors/HealthIdentifierDetectors.d.mts +3 -0
- package/Utils/DataSecurity/Detectors/HealthIdentifierDetectors.d.ts +3 -0
- package/Utils/DataSecurity/Detectors/HealthIdentifierDetectors.js +258 -0
- package/Utils/DataSecurity/Detectors/HealthIdentifierDetectors.mjs +3 -0
- package/Utils/DataSecurity/Detectors/HealthRecordDetectors.d.mts +3 -0
- package/Utils/DataSecurity/Detectors/HealthRecordDetectors.d.ts +3 -0
- package/Utils/DataSecurity/Detectors/HealthRecordDetectors.js +115 -0
- package/Utils/DataSecurity/Detectors/HealthRecordDetectors.mjs +3 -0
- package/Utils/DataSecurity/Detectors/Index.d.mts +4 -0
- package/Utils/DataSecurity/Detectors/Index.d.ts +4 -0
- package/Utils/DataSecurity/Detectors/Index.js +47 -0
- package/Utils/DataSecurity/Detectors/Index.mjs +4 -0
- package/Utils/DataSecurity/Detectors/SecretDetectors.d.mts +11 -0
- package/Utils/DataSecurity/Detectors/SecretDetectors.d.ts +11 -0
- package/Utils/DataSecurity/Detectors/SecretDetectors.js +1733 -0
- package/Utils/DataSecurity/Detectors/SecretDetectors.mjs +11 -0
- package/Utils/DataSecurity/FieldClassifier.d.mts +20 -0
- package/Utils/DataSecurity/FieldClassifier.d.ts +20 -0
- package/Utils/DataSecurity/FieldClassifier.js +247 -0
- package/Utils/DataSecurity/FieldClassifier.mjs +5 -0
- package/Utils/DataSecurity/FieldCollector.d.mts +23 -0
- package/Utils/DataSecurity/FieldCollector.d.ts +23 -0
- package/Utils/DataSecurity/FieldCollector.js +81 -0
- package/Utils/DataSecurity/FieldCollector.mjs +3 -0
- package/Utils/DataSecurity/FieldNameHints.d.mts +9 -0
- package/Utils/DataSecurity/FieldNameHints.d.ts +9 -0
- package/Utils/DataSecurity/FieldNameHints.js +184 -0
- package/Utils/DataSecurity/FieldNameHints.mjs +6 -0
- package/Utils/DataSecurity/FindingTally.d.mts +44 -0
- package/Utils/DataSecurity/FindingTally.d.ts +44 -0
- package/Utils/DataSecurity/FindingTally.js +138 -0
- package/Utils/DataSecurity/FindingTally.mjs +6 -0
- package/Utils/DataSecurity/Masking.d.mts +6 -0
- package/Utils/DataSecurity/Masking.d.ts +6 -0
- package/Utils/DataSecurity/Masking.js +159 -0
- package/Utils/DataSecurity/Masking.mjs +7 -0
- package/Utils/DataSecurity/PathPattern.d.mts +3 -0
- package/Utils/DataSecurity/PathPattern.d.ts +3 -0
- package/Utils/DataSecurity/PathPattern.js +55 -0
- package/Utils/DataSecurity/PathPattern.mjs +4 -0
- package/Utils/DataSecurity/Sha256.d.mts +1 -0
- package/Utils/DataSecurity/Sha256.d.ts +1 -0
- package/Utils/DataSecurity/Sha256.js +94 -0
- package/Utils/DataSecurity/Sha256.mjs +2 -0
- package/Utils/DataSecurity/TextScanner.d.mts +35 -0
- package/Utils/DataSecurity/TextScanner.d.ts +35 -0
- package/Utils/DataSecurity/TextScanner.js +303 -0
- package/Utils/DataSecurity/TextScanner.mjs +8 -0
- package/Utils/DataSecurity/Validators.d.mts +16 -0
- package/Utils/DataSecurity/Validators.d.ts +16 -0
- package/Utils/DataSecurity/Validators.js +339 -0
- package/Utils/DataSecurity/Validators.mjs +17 -0
- package/Utils/Exceptions/ExceptionIssueState.d.mts +18 -0
- package/Utils/Exceptions/ExceptionIssueState.d.ts +18 -0
- package/Utils/Exceptions/ExceptionIssueState.js +131 -0
- package/Utils/Exceptions/ExceptionIssueState.mjs +8 -0
- package/Utils/HostCollector/HostCollectorDefaultConfig.d.mts +2 -0
- package/Utils/HostCollector/HostCollectorDefaultConfig.d.ts +2 -0
- package/Utils/HostCollector/HostCollectorDefaultConfig.js +39 -1
- package/Utils/HostCollector/HostCollectorDefaultConfig.mjs +2 -0
- package/Utils/LabelRuleImportExport.js +17 -3
- package/Utils/Monitor/PlatformResourceIdentity.js +7 -4
- package/Utils/SecurityAdvisoryMatcher.d.mts +33 -0
- package/Utils/SecurityAdvisoryMatcher.d.ts +33 -0
- package/Utils/SecurityAdvisoryMatcher.js +291 -0
- package/Utils/SecurityAdvisoryMatcher.mjs +2 -0
- package/Utils/SecurityEvent/Connectors/EntraIdNormalizer.d.mts +24 -0
- package/Utils/SecurityEvent/Connectors/EntraIdNormalizer.d.ts +24 -0
- package/Utils/SecurityEvent/Connectors/EntraIdNormalizer.js +380 -0
- package/Utils/SecurityEvent/Connectors/EntraIdNormalizer.mjs +15 -0
- package/Utils/SecurityEvent/Connectors/GoogleWorkspaceNormalizer.d.mts +29 -0
- package/Utils/SecurityEvent/Connectors/GoogleWorkspaceNormalizer.d.ts +29 -0
- package/Utils/SecurityEvent/Connectors/GoogleWorkspaceNormalizer.js +527 -0
- package/Utils/SecurityEvent/Connectors/GoogleWorkspaceNormalizer.mjs +13 -0
- package/Utils/SecurityEvent/Connectors/Microsoft365AuditNormalizer.d.mts +21 -0
- package/Utils/SecurityEvent/Connectors/Microsoft365AuditNormalizer.d.ts +21 -0
- package/Utils/SecurityEvent/Connectors/Microsoft365AuditNormalizer.js +365 -0
- package/Utils/SecurityEvent/Connectors/Microsoft365AuditNormalizer.mjs +11 -0
- package/Utils/SecurityEvent/LogParsers/AzureActivityLogParser.d.mts +17 -0
- package/Utils/SecurityEvent/LogParsers/AzureActivityLogParser.d.ts +17 -0
- package/Utils/SecurityEvent/LogParsers/AzureActivityLogParser.js +344 -0
- package/Utils/SecurityEvent/LogParsers/AzureActivityLogParser.mjs +12 -0
- package/Utils/SecurityEvent/LogParsers/GoogleCloudAuditLogParser.d.mts +27 -0
- package/Utils/SecurityEvent/LogParsers/GoogleCloudAuditLogParser.d.ts +27 -0
- package/Utils/SecurityEvent/LogParsers/GoogleCloudAuditLogParser.js +326 -0
- package/Utils/SecurityEvent/LogParsers/GoogleCloudAuditLogParser.mjs +10 -0
- package/Utils/SecurityEvent/LogParsers/SecurityDeviceLogParser.d.mts +38 -0
- package/Utils/SecurityEvent/LogParsers/SecurityDeviceLogParser.d.ts +38 -0
- package/Utils/SecurityEvent/LogParsers/SecurityDeviceLogParser.js +629 -0
- package/Utils/SecurityEvent/LogParsers/SecurityDeviceLogParser.mjs +13 -0
- package/Utils/SecurityEvent/LogParsers/SecurityLogLine.d.mts +9 -0
- package/Utils/SecurityEvent/LogParsers/SecurityLogLine.d.ts +9 -0
- package/Utils/SecurityEvent/LogParsers/SecurityLogLine.js +63 -3
- package/Utils/SecurityEvent/LogParsers/SecurityLogLine.mjs +4 -0
- package/Utils/SecurityEvent/LogParsers/SecurityLogParser.js +54 -0
- package/Utils/SecurityEvent/LogParsers/WindowsEventLogParser.d.mts +26 -0
- package/Utils/SecurityEvent/LogParsers/WindowsEventLogParser.d.ts +26 -0
- package/Utils/SecurityEvent/LogParsers/WindowsEventLogParser.js +1046 -0
- package/Utils/SecurityEvent/LogParsers/WindowsEventLogParser.mjs +11 -0
- package/Utils/SecurityEvent/LogParsers/WindowsEventRecord.d.mts +19 -0
- package/Utils/SecurityEvent/LogParsers/WindowsEventRecord.d.ts +19 -0
- package/Utils/SecurityEvent/LogParsers/WindowsEventRecord.js +724 -0
- package/Utils/SecurityEvent/LogParsers/WindowsEventRecord.mjs +7 -0
- package/Utils/SecurityEvent/SecurityRecordReading.d.mts +32 -0
- package/Utils/SecurityEvent/SecurityRecordReading.d.ts +32 -0
- package/Utils/SecurityEvent/SecurityRecordReading.js +78 -0
- package/Utils/SecurityEvent/SecurityRecordReading.mjs +2 -0
- package/Utils/Sms/OnCallPageSms.d.mts +1 -0
- package/Utils/Sms/OnCallPageSms.d.ts +1 -0
- package/Utils/Sms/OnCallPageSms.js +16 -2
- package/Utils/Suggestions/InvestigationCodeFixSuggestion.d.mts +44 -0
- package/Utils/Suggestions/InvestigationCodeFixSuggestion.d.ts +44 -0
- package/Utils/Suggestions/InvestigationCodeFixSuggestion.js +223 -0
- package/Utils/Suggestions/InvestigationCodeFixSuggestion.mjs +8 -0
- package/Utils/Syslog/LeefParser.d.mts +28 -0
- package/Utils/Syslog/LeefParser.d.ts +28 -0
- package/Utils/Syslog/LeefParser.js +326 -0
- package/Utils/Syslog/LeefParser.mjs +10 -0
- package/Utils/VersionRange.d.mts +34 -0
- package/Utils/VersionRange.d.ts +34 -0
- package/Utils/VersionRange.js +422 -0
- package/Utils/VersionRange.mjs +5 -0
- package/package.json +1 -1
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import commonJsModule from "./SecretDetectors.js";
|
|
2
|
+
export default commonJsModule.default;
|
|
3
|
+
export const SECRET_DETECTORS = commonJsModule.SECRET_DETECTORS;
|
|
4
|
+
export const basicCredentials = commonJsModule.basicCredentials;
|
|
5
|
+
export const decodeBase64 = commonJsModule.decodeBase64;
|
|
6
|
+
export const isAzureSasToken = commonJsModule.isAzureSasToken;
|
|
7
|
+
export const isExampleToken = commonJsModule.isExampleToken;
|
|
8
|
+
export const isGenericSecretValue = commonJsModule.isGenericSecretValue;
|
|
9
|
+
export const isJwtWithHeader = commonJsModule.isJwtWithHeader;
|
|
10
|
+
export const isPlaceholderSecret = commonJsModule.isPlaceholderSecret;
|
|
11
|
+
export const isSampleJwt = commonJsModule.isSampleJwt;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { DataTypeTallyJSON } from "./FindingTally.mjs";
|
|
2
|
+
import { TextScanOptions } from "./TextScanner.mjs";
|
|
3
|
+
export declare const MAX_FIELD_VALUES: number;
|
|
4
|
+
export declare const MAX_FIELD_VALUE_LENGTH: number;
|
|
5
|
+
export interface FieldClassification extends DataTypeTallyJSON {
|
|
6
|
+
matchRatio: number;
|
|
7
|
+
valueCount: number;
|
|
8
|
+
valuesWithMatch: number;
|
|
9
|
+
isFreeText: boolean;
|
|
10
|
+
nameHinted: boolean;
|
|
11
|
+
foundByName: boolean;
|
|
12
|
+
}
|
|
13
|
+
export interface FieldClassifierOptions extends TextScanOptions {
|
|
14
|
+
extraHints?: ReadonlyArray<{
|
|
15
|
+
dataTypeId: string;
|
|
16
|
+
hints: ReadonlyArray<string>;
|
|
17
|
+
}> | undefined;
|
|
18
|
+
}
|
|
19
|
+
export declare function toScannableValue(value: unknown): string | null;
|
|
20
|
+
export declare function classifyField(fieldPath: string, rawValues: ReadonlyArray<unknown>, options?: FieldClassifierOptions): Array<FieldClassification>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { DataTypeTallyJSON } from "./FindingTally";
|
|
2
|
+
import { TextScanOptions } from "./TextScanner";
|
|
3
|
+
export declare const MAX_FIELD_VALUES: number;
|
|
4
|
+
export declare const MAX_FIELD_VALUE_LENGTH: number;
|
|
5
|
+
export interface FieldClassification extends DataTypeTallyJSON {
|
|
6
|
+
matchRatio: number;
|
|
7
|
+
valueCount: number;
|
|
8
|
+
valuesWithMatch: number;
|
|
9
|
+
isFreeText: boolean;
|
|
10
|
+
nameHinted: boolean;
|
|
11
|
+
foundByName: boolean;
|
|
12
|
+
}
|
|
13
|
+
export interface FieldClassifierOptions extends TextScanOptions {
|
|
14
|
+
extraHints?: ReadonlyArray<{
|
|
15
|
+
dataTypeId: string;
|
|
16
|
+
hints: ReadonlyArray<string>;
|
|
17
|
+
}> | undefined;
|
|
18
|
+
}
|
|
19
|
+
export declare function toScannableValue(value: unknown): string | null;
|
|
20
|
+
export declare function classifyField(fieldPath: string, rawValues: ReadonlyArray<unknown>, options?: FieldClassifierOptions): Array<FieldClassification>;
|
|
@@ -0,0 +1,247 @@
|
|
|
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.MAX_FIELD_VALUE_LENGTH = exports.MAX_FIELD_VALUES = void 0;
|
|
7
|
+
exports.toScannableValue = toScannableValue;
|
|
8
|
+
exports.classifyField = classifyField;
|
|
9
|
+
const DataConfidence_1 = __importDefault(require("../../Types/DataSecurity/DataConfidence"));
|
|
10
|
+
const DataTypeCatalog_1 = require("../../Types/DataSecurity/DataTypeCatalog");
|
|
11
|
+
const Index_1 = require("./Detectors/Index");
|
|
12
|
+
const FieldNameHints_1 = require("./FieldNameHints");
|
|
13
|
+
const FindingTally_1 = require("./FindingTally");
|
|
14
|
+
const Masking_1 = require("./Masking");
|
|
15
|
+
const TextScanner_1 = require("./TextScanner");
|
|
16
|
+
/*
|
|
17
|
+
* WHAT ONE FIELD HOLDS: A COLUMN, A JSON KEY, A LOG ATTRIBUTE.
|
|
18
|
+
*
|
|
19
|
+
* A field is judged as a whole, from two kinds of evidence. Its name hints
|
|
20
|
+
* at a type (FieldNameHints.ts); its sampled values prove one. The share of
|
|
21
|
+
* values that pass a type's detector decides how sure the finding is:
|
|
22
|
+
*
|
|
23
|
+
* - 60% or more: High - the field holds that type.
|
|
24
|
+
* - 25% or more: High when the name agrees, Medium otherwise.
|
|
25
|
+
* - Fewer: Medium when the name agrees, Low otherwise - a few emails in a
|
|
26
|
+
* column of something else.
|
|
27
|
+
*
|
|
28
|
+
* A field of long free text (notes, messages, descriptions) is not expected
|
|
29
|
+
* to be one type, so its findings keep the confidence each match earned on
|
|
30
|
+
* its own, and are marked as free text.
|
|
31
|
+
*
|
|
32
|
+
* A type found only from names - a person's name, religion - is reported
|
|
33
|
+
* when the name matches and the field has values; its values are checked
|
|
34
|
+
* only for plausibility (NAME_VALUE_SHAPES), which lifts it to High.
|
|
35
|
+
*/
|
|
36
|
+
// The most values of one field read, and the most of one value.
|
|
37
|
+
exports.MAX_FIELD_VALUES = 1000;
|
|
38
|
+
exports.MAX_FIELD_VALUE_LENGTH = 16384;
|
|
39
|
+
// A field whose values average more than this many characters is free text.
|
|
40
|
+
const FREE_TEXT_AVERAGE_LENGTH = 80;
|
|
41
|
+
// Plausible values of a name-found type, checked whole.
|
|
42
|
+
const NAME_VALUE_SHAPES = {
|
|
43
|
+
"person-name": /^[\p{L}][\p{L}' .-]{0,63}$/u,
|
|
44
|
+
username: /^[A-Za-z0-9._@-]{2,64}$/,
|
|
45
|
+
gender: /^(?:m|f|x|u|male|female|man|woman|non-binary|nonbinary|other|unknown|prefer not to say)$/i,
|
|
46
|
+
nationality: /^[\p{L}][\p{L} .-]{1,47}$/u,
|
|
47
|
+
};
|
|
48
|
+
// A value as text, or null when it holds nothing to classify.
|
|
49
|
+
function toScannableValue(value) {
|
|
50
|
+
if (value === null || value === undefined || typeof value === "boolean") {
|
|
51
|
+
return null;
|
|
52
|
+
}
|
|
53
|
+
if (typeof value === "number" || typeof value === "bigint") {
|
|
54
|
+
return String(value);
|
|
55
|
+
}
|
|
56
|
+
if (typeof value === "string") {
|
|
57
|
+
const trimmed = value.trim();
|
|
58
|
+
return trimmed.length > 0 ? trimmed.slice(0, exports.MAX_FIELD_VALUE_LENGTH) : null;
|
|
59
|
+
}
|
|
60
|
+
if (value instanceof Date) {
|
|
61
|
+
return value.toISOString();
|
|
62
|
+
}
|
|
63
|
+
try {
|
|
64
|
+
const json = JSON.stringify(value);
|
|
65
|
+
return json && json.length > 2
|
|
66
|
+
? json.slice(0, exports.MAX_FIELD_VALUE_LENGTH)
|
|
67
|
+
: null;
|
|
68
|
+
}
|
|
69
|
+
catch (_a) {
|
|
70
|
+
return null;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
function confidenceForRatio(ratio, nameHinted) {
|
|
74
|
+
if (ratio >= 0.6) {
|
|
75
|
+
return DataConfidence_1.default.High;
|
|
76
|
+
}
|
|
77
|
+
if (ratio >= 0.25) {
|
|
78
|
+
return nameHinted ? DataConfidence_1.default.High : DataConfidence_1.default.Medium;
|
|
79
|
+
}
|
|
80
|
+
return nameHinted ? DataConfidence_1.default.Medium : DataConfidence_1.default.Low;
|
|
81
|
+
}
|
|
82
|
+
/*
|
|
83
|
+
* Whether a whole value has the shape a hinted type expects, for a field
|
|
84
|
+
* whose name is all the context its values have: a `cvv` column of "123".
|
|
85
|
+
*/
|
|
86
|
+
function matchesFieldShape(detector, value) {
|
|
87
|
+
if (!detector.fieldValuePattern || !detector.fieldValuePattern.test(value)) {
|
|
88
|
+
return null;
|
|
89
|
+
}
|
|
90
|
+
const normalized = detector.normalize
|
|
91
|
+
? detector.normalize(value)
|
|
92
|
+
: value;
|
|
93
|
+
if (detector.validate && !detector.validate(normalized, value)) {
|
|
94
|
+
return null;
|
|
95
|
+
}
|
|
96
|
+
return normalized;
|
|
97
|
+
}
|
|
98
|
+
function classifyField(fieldPath, rawValues, options = {}) {
|
|
99
|
+
var _a;
|
|
100
|
+
const values = [];
|
|
101
|
+
for (const raw of rawValues) {
|
|
102
|
+
if (values.length >= exports.MAX_FIELD_VALUES) {
|
|
103
|
+
break;
|
|
104
|
+
}
|
|
105
|
+
const value = toScannableValue(raw);
|
|
106
|
+
if (value !== null) {
|
|
107
|
+
values.push(value);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
if (values.length === 0) {
|
|
111
|
+
return [];
|
|
112
|
+
}
|
|
113
|
+
const hinted = (0, FieldNameHints_1.getHintedDataTypeIds)(fieldPath, options.extraHints);
|
|
114
|
+
for (const disabled of options.disabledDataTypeIds || []) {
|
|
115
|
+
hinted.delete(disabled);
|
|
116
|
+
}
|
|
117
|
+
const totalLength = values.reduce((sum, value) => {
|
|
118
|
+
return sum + value.length;
|
|
119
|
+
}, 0);
|
|
120
|
+
const isFreeText = totalLength / values.length > FREE_TEXT_AVERAGE_LENGTH;
|
|
121
|
+
const tallies = new Map();
|
|
122
|
+
const valuesWithMatch = new Map();
|
|
123
|
+
const tallyOf = (dataTypeId) => {
|
|
124
|
+
let tally = tallies.get(dataTypeId);
|
|
125
|
+
if (!tally) {
|
|
126
|
+
tally = new FindingTally_1.DataTypeTally(dataTypeId);
|
|
127
|
+
tallies.set(dataTypeId, tally);
|
|
128
|
+
}
|
|
129
|
+
return tally;
|
|
130
|
+
};
|
|
131
|
+
const scanOptions = Object.assign(Object.assign({}, options), { hintedDataTypeIds: hinted });
|
|
132
|
+
/*
|
|
133
|
+
* Detectors of hinted types that can judge a whole value by its shape:
|
|
134
|
+
* of the detectors the scan runs (every built-in one when none are
|
|
135
|
+
* given, as the scanner does), so a detector given in that list is never
|
|
136
|
+
* counted twice.
|
|
137
|
+
*/
|
|
138
|
+
const shapeDetectors = [];
|
|
139
|
+
for (const dataTypeId of hinted) {
|
|
140
|
+
const detectorsOfType = options.detectors
|
|
141
|
+
? options.detectors.filter((detector) => {
|
|
142
|
+
return detector.dataTypeId === dataTypeId;
|
|
143
|
+
})
|
|
144
|
+
: (0, Index_1.getBuiltInDetectorsOf)(dataTypeId);
|
|
145
|
+
for (const detector of detectorsOfType) {
|
|
146
|
+
if (detector.fieldValuePattern) {
|
|
147
|
+
shapeDetectors.push(detector);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
for (const value of values) {
|
|
152
|
+
const matches = (0, TextScanner_1.findSensitiveValues)(value, scanOptions);
|
|
153
|
+
// Types with a real match in the value, which its ratio counts.
|
|
154
|
+
const typesInValue = new Set();
|
|
155
|
+
// Types the value was counted for at all, test values too: once is enough.
|
|
156
|
+
const typesCounted = new Set();
|
|
157
|
+
for (const match of matches) {
|
|
158
|
+
tallyOf(match.dataTypeId).add({
|
|
159
|
+
normalized: match.normalized,
|
|
160
|
+
confidence: match.confidence,
|
|
161
|
+
isTestValue: match.isTestValue,
|
|
162
|
+
raw: value.slice(match.start, match.end),
|
|
163
|
+
});
|
|
164
|
+
typesCounted.add(match.dataTypeId);
|
|
165
|
+
if (!match.isTestValue) {
|
|
166
|
+
typesInValue.add(match.dataTypeId);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
if (!isFreeText) {
|
|
170
|
+
for (const detector of shapeDetectors) {
|
|
171
|
+
if (typesCounted.has(detector.dataTypeId)) {
|
|
172
|
+
continue;
|
|
173
|
+
}
|
|
174
|
+
const normalized = matchesFieldShape(detector, value);
|
|
175
|
+
if (normalized === null) {
|
|
176
|
+
continue;
|
|
177
|
+
}
|
|
178
|
+
const isTestValue = Boolean((_a = detector.isTestValue) === null || _a === void 0 ? void 0 : _a.call(detector, normalized));
|
|
179
|
+
tallyOf(detector.dataTypeId).add({
|
|
180
|
+
normalized,
|
|
181
|
+
confidence: DataConfidence_1.default.Medium,
|
|
182
|
+
isTestValue,
|
|
183
|
+
raw: value,
|
|
184
|
+
});
|
|
185
|
+
typesCounted.add(detector.dataTypeId);
|
|
186
|
+
if (!isTestValue) {
|
|
187
|
+
typesInValue.add(detector.dataTypeId);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
for (const dataTypeId of typesInValue) {
|
|
192
|
+
valuesWithMatch.set(dataTypeId, (valuesWithMatch.get(dataTypeId) || 0) + 1);
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
const results = [];
|
|
196
|
+
for (const tally of tallies.values()) {
|
|
197
|
+
const json = tally.toJSON();
|
|
198
|
+
const withMatch = valuesWithMatch.get(tally.dataTypeId) || 0;
|
|
199
|
+
const ratio = withMatch / values.length;
|
|
200
|
+
const nameHinted = hinted.has(tally.dataTypeId);
|
|
201
|
+
results.push(Object.assign(Object.assign({}, json), { confidence: isFreeText || json.matchCount === 0
|
|
202
|
+
? json.confidence
|
|
203
|
+
: confidenceForRatio(ratio, nameHinted), matchRatio: ratio, valueCount: values.length, valuesWithMatch: withMatch, isFreeText,
|
|
204
|
+
nameHinted, foundByName: false }));
|
|
205
|
+
}
|
|
206
|
+
// Types found from names only.
|
|
207
|
+
for (const dataTypeId of hinted) {
|
|
208
|
+
const info = (0, DataTypeCatalog_1.getBuiltInDataType)(dataTypeId);
|
|
209
|
+
if (!info || info.foundBy !== "name" || tallies.has(dataTypeId)) {
|
|
210
|
+
continue;
|
|
211
|
+
}
|
|
212
|
+
const shape = NAME_VALUE_SHAPES[dataTypeId];
|
|
213
|
+
let plausible = 0;
|
|
214
|
+
const samples = [];
|
|
215
|
+
for (const value of values) {
|
|
216
|
+
if (!shape || shape.test(value)) {
|
|
217
|
+
plausible++;
|
|
218
|
+
if (samples.length < 3) {
|
|
219
|
+
const masked = (0, Masking_1.maskValue)(dataTypeId, value);
|
|
220
|
+
if (!samples.includes(masked)) {
|
|
221
|
+
samples.push(masked);
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
if (plausible === 0) {
|
|
227
|
+
continue;
|
|
228
|
+
}
|
|
229
|
+
const ratio = plausible / values.length;
|
|
230
|
+
results.push({
|
|
231
|
+
dataTypeId,
|
|
232
|
+
matchCount: plausible,
|
|
233
|
+
testValueCount: 0,
|
|
234
|
+
confidence: shape && ratio >= 0.6 ? DataConfidence_1.default.High : DataConfidence_1.default.Medium,
|
|
235
|
+
maskedSamples: samples,
|
|
236
|
+
distinctValues: new Set(values).size,
|
|
237
|
+
distinctValuesCapped: false,
|
|
238
|
+
matchRatio: ratio,
|
|
239
|
+
valueCount: values.length,
|
|
240
|
+
valuesWithMatch: plausible,
|
|
241
|
+
isFreeText,
|
|
242
|
+
nameHinted: true,
|
|
243
|
+
foundByName: true,
|
|
244
|
+
});
|
|
245
|
+
}
|
|
246
|
+
return results;
|
|
247
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import commonJsModule from "./FieldClassifier.js";
|
|
2
|
+
export const MAX_FIELD_VALUES = commonJsModule.MAX_FIELD_VALUES;
|
|
3
|
+
export const MAX_FIELD_VALUE_LENGTH = commonJsModule.MAX_FIELD_VALUE_LENGTH;
|
|
4
|
+
export const classifyField = commonJsModule.classifyField;
|
|
5
|
+
export const toScannableValue = commonJsModule.toScannableValue;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export interface FieldCollectorLimits {
|
|
2
|
+
maxFields: number;
|
|
3
|
+
maxValuesPerField: number;
|
|
4
|
+
maxDepth: number;
|
|
5
|
+
maxValueLength: number;
|
|
6
|
+
}
|
|
7
|
+
export declare const DEFAULT_FIELD_COLLECTOR_LIMITS: FieldCollectorLimits;
|
|
8
|
+
export interface CollectedField {
|
|
9
|
+
path: string;
|
|
10
|
+
values: Array<unknown>;
|
|
11
|
+
}
|
|
12
|
+
export default class FieldCollector {
|
|
13
|
+
private readonly limits;
|
|
14
|
+
private readonly fields;
|
|
15
|
+
private recordCount;
|
|
16
|
+
constructor(limits?: Partial<FieldCollectorLimits>);
|
|
17
|
+
get records(): number;
|
|
18
|
+
addRecord(record: unknown, prefix?: string): void;
|
|
19
|
+
addValue(path: string, value: unknown): void;
|
|
20
|
+
getFields(): Array<CollectedField>;
|
|
21
|
+
private walk;
|
|
22
|
+
private push;
|
|
23
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export interface FieldCollectorLimits {
|
|
2
|
+
maxFields: number;
|
|
3
|
+
maxValuesPerField: number;
|
|
4
|
+
maxDepth: number;
|
|
5
|
+
maxValueLength: number;
|
|
6
|
+
}
|
|
7
|
+
export declare const DEFAULT_FIELD_COLLECTOR_LIMITS: FieldCollectorLimits;
|
|
8
|
+
export interface CollectedField {
|
|
9
|
+
path: string;
|
|
10
|
+
values: Array<unknown>;
|
|
11
|
+
}
|
|
12
|
+
export default class FieldCollector {
|
|
13
|
+
private readonly limits;
|
|
14
|
+
private readonly fields;
|
|
15
|
+
private recordCount;
|
|
16
|
+
constructor(limits?: Partial<FieldCollectorLimits>);
|
|
17
|
+
get records(): number;
|
|
18
|
+
addRecord(record: unknown, prefix?: string): void;
|
|
19
|
+
addValue(path: string, value: unknown): void;
|
|
20
|
+
getFields(): Array<CollectedField>;
|
|
21
|
+
private walk;
|
|
22
|
+
private push;
|
|
23
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* RECORDS, TURNED INTO FIELDS AND THEIR VALUES.
|
|
4
|
+
*
|
|
5
|
+
* Structured data - JSON documents, NDJSON lines, CSV rows, database rows,
|
|
6
|
+
* log attributes - is classified field by field (FieldClassifier.ts), so the
|
|
7
|
+
* records a scan reads are first gathered here: every leaf value under the
|
|
8
|
+
* dotted path that leads to it, with array positions folded into "[]" so
|
|
9
|
+
* the 500 items of `orders[]` are one field, not 500.
|
|
10
|
+
*
|
|
11
|
+
* Everything is bounded - fields, values per field, depth and value length -
|
|
12
|
+
* because a record is whatever the store holds, and one document can be
|
|
13
|
+
* deeper or wider than any scan should follow.
|
|
14
|
+
*/
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.DEFAULT_FIELD_COLLECTOR_LIMITS = void 0;
|
|
17
|
+
exports.DEFAULT_FIELD_COLLECTOR_LIMITS = {
|
|
18
|
+
maxFields: 500,
|
|
19
|
+
maxValuesPerField: 200,
|
|
20
|
+
maxDepth: 12,
|
|
21
|
+
maxValueLength: 16384,
|
|
22
|
+
};
|
|
23
|
+
class FieldCollector {
|
|
24
|
+
constructor(limits = {}) {
|
|
25
|
+
this.fields = new Map();
|
|
26
|
+
this.recordCount = 0;
|
|
27
|
+
this.limits = Object.assign(Object.assign({}, exports.DEFAULT_FIELD_COLLECTOR_LIMITS), limits);
|
|
28
|
+
}
|
|
29
|
+
get records() {
|
|
30
|
+
return this.recordCount;
|
|
31
|
+
}
|
|
32
|
+
addRecord(record, prefix = "") {
|
|
33
|
+
this.recordCount++;
|
|
34
|
+
this.walk(record, prefix, 0);
|
|
35
|
+
}
|
|
36
|
+
// One value under one path, for a source that is already flat.
|
|
37
|
+
addValue(path, value) {
|
|
38
|
+
this.push(path, value);
|
|
39
|
+
}
|
|
40
|
+
getFields() {
|
|
41
|
+
return [...this.fields.entries()].map(([path, values]) => {
|
|
42
|
+
return { path, values };
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
walk(value, path, depth) {
|
|
46
|
+
if (depth > this.limits.maxDepth) {
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
if (Array.isArray(value)) {
|
|
50
|
+
const itemPath = path + "[]";
|
|
51
|
+
for (const item of value.slice(0, this.limits.maxValuesPerField)) {
|
|
52
|
+
this.walk(item, itemPath, depth + 1);
|
|
53
|
+
}
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
if (value && typeof value === "object" && !(value instanceof Date)) {
|
|
57
|
+
for (const [key, child] of Object.entries(value)) {
|
|
58
|
+
this.walk(child, path ? path + "." + key : key, depth + 1);
|
|
59
|
+
}
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
this.push(path || "value", value);
|
|
63
|
+
}
|
|
64
|
+
push(path, value) {
|
|
65
|
+
let values = this.fields.get(path);
|
|
66
|
+
if (!values) {
|
|
67
|
+
if (this.fields.size >= this.limits.maxFields) {
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
values = [];
|
|
71
|
+
this.fields.set(path, values);
|
|
72
|
+
}
|
|
73
|
+
if (values.length >= this.limits.maxValuesPerField) {
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
values.push(typeof value === "string" && value.length > this.limits.maxValueLength
|
|
77
|
+
? value.slice(0, this.limits.maxValueLength)
|
|
78
|
+
: value);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
exports.default = FieldCollector;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { DataTypeInfo } from "../../Types/DataSecurity/DataTypeCatalog.mjs";
|
|
2
|
+
export declare function splitFieldName(name: string): Array<string>;
|
|
3
|
+
export declare function containsWordRun(words: ReadonlyArray<string>, hintWords: ReadonlyArray<string>): boolean;
|
|
4
|
+
export declare function getFieldNameWords(fieldPath: string): Array<string>;
|
|
5
|
+
export declare function getHintedDataTypeIds(fieldPath: string, extraHints?: ReadonlyArray<{
|
|
6
|
+
dataTypeId: string;
|
|
7
|
+
hints: ReadonlyArray<string>;
|
|
8
|
+
}>): Set<string>;
|
|
9
|
+
export declare function getNameOnlyDataTypes(): Array<DataTypeInfo>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { DataTypeInfo } from "../../Types/DataSecurity/DataTypeCatalog";
|
|
2
|
+
export declare function splitFieldName(name: string): Array<string>;
|
|
3
|
+
export declare function containsWordRun(words: ReadonlyArray<string>, hintWords: ReadonlyArray<string>): boolean;
|
|
4
|
+
export declare function getFieldNameWords(fieldPath: string): Array<string>;
|
|
5
|
+
export declare function getHintedDataTypeIds(fieldPath: string, extraHints?: ReadonlyArray<{
|
|
6
|
+
dataTypeId: string;
|
|
7
|
+
hints: ReadonlyArray<string>;
|
|
8
|
+
}>): Set<string>;
|
|
9
|
+
export declare function getNameOnlyDataTypes(): Array<DataTypeInfo>;
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.splitFieldName = splitFieldName;
|
|
4
|
+
exports.containsWordRun = containsWordRun;
|
|
5
|
+
exports.getFieldNameWords = getFieldNameWords;
|
|
6
|
+
exports.getHintedDataTypeIds = getHintedDataTypeIds;
|
|
7
|
+
exports.getNameOnlyDataTypes = getNameOnlyDataTypes;
|
|
8
|
+
const DataTypeCatalog_1 = require("../../Types/DataSecurity/DataTypeCatalog");
|
|
9
|
+
/*
|
|
10
|
+
* WHAT A FIELD'S NAME SAYS IT HOLDS.
|
|
11
|
+
*
|
|
12
|
+
* Column, key and attribute names are the cheapest evidence a scan has:
|
|
13
|
+
* `customer_email`, `dateOfBirth` and `http.request.header.authorization`
|
|
14
|
+
* say what they hold before a single value is read. A name is split into
|
|
15
|
+
* lower-case words - at every character that is not a letter or digit, at
|
|
16
|
+
* every lower-to-upper case change (`dateOfBirth`), at every run of capitals
|
|
17
|
+
* followed by a word (`SSNNumber` -> ssn, number) and between letters and
|
|
18
|
+
* digits - and a type's hint matches when the hint's words appear in that
|
|
19
|
+
* order, next to each other.
|
|
20
|
+
*
|
|
21
|
+
* Only the last segment of a dotted path is read as the field's own name, so
|
|
22
|
+
* `customer.address.city` is not a street address because of `address`;
|
|
23
|
+
* the segment before it is read too, so `card.number` still hints a card
|
|
24
|
+
* number.
|
|
25
|
+
*/
|
|
26
|
+
// The most words of a name read: a field name is never a paragraph.
|
|
27
|
+
const MAX_NAME_WORDS = 32;
|
|
28
|
+
function splitFieldName(name) {
|
|
29
|
+
const words = [];
|
|
30
|
+
let current = "";
|
|
31
|
+
let previousKind = "other";
|
|
32
|
+
const flush = () => {
|
|
33
|
+
if (current.length > 0 && words.length < MAX_NAME_WORDS) {
|
|
34
|
+
words.push(current.toLowerCase());
|
|
35
|
+
}
|
|
36
|
+
current = "";
|
|
37
|
+
};
|
|
38
|
+
const bounded = name.slice(0, 256);
|
|
39
|
+
for (let index = 0; index < bounded.length; index++) {
|
|
40
|
+
const character = bounded[index];
|
|
41
|
+
const code = bounded.charCodeAt(index);
|
|
42
|
+
let kind = "other";
|
|
43
|
+
if (code >= 97 && code <= 122) {
|
|
44
|
+
kind = "lower";
|
|
45
|
+
}
|
|
46
|
+
else if (code >= 65 && code <= 90) {
|
|
47
|
+
kind = "upper";
|
|
48
|
+
}
|
|
49
|
+
else if (code >= 48 && code <= 57) {
|
|
50
|
+
kind = "digit";
|
|
51
|
+
}
|
|
52
|
+
if (kind === "other") {
|
|
53
|
+
flush();
|
|
54
|
+
previousKind = kind;
|
|
55
|
+
continue;
|
|
56
|
+
}
|
|
57
|
+
if (current.length > 0) {
|
|
58
|
+
const lowerToUpper = previousKind === "lower" && kind === "upper";
|
|
59
|
+
const letterToDigit = (previousKind === "digit") !== (kind === "digit");
|
|
60
|
+
/*
|
|
61
|
+
* The last capital of a run that a lower-case letter follows starts
|
|
62
|
+
* the next word: "SSNNumber" is "SSN" then "Number".
|
|
63
|
+
*/
|
|
64
|
+
const nextCode = bounded.charCodeAt(index + 1);
|
|
65
|
+
const capitalRunEnds = previousKind === "upper" &&
|
|
66
|
+
kind === "upper" &&
|
|
67
|
+
nextCode >= 97 &&
|
|
68
|
+
nextCode <= 122;
|
|
69
|
+
if (lowerToUpper || letterToDigit || capitalRunEnds) {
|
|
70
|
+
flush();
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
current += character;
|
|
74
|
+
previousKind = kind;
|
|
75
|
+
}
|
|
76
|
+
flush();
|
|
77
|
+
return words;
|
|
78
|
+
}
|
|
79
|
+
// Whether `hintWords` appear in `words` in order and next to each other.
|
|
80
|
+
function containsWordRun(words, hintWords) {
|
|
81
|
+
if (hintWords.length === 0 || hintWords.length > words.length) {
|
|
82
|
+
return false;
|
|
83
|
+
}
|
|
84
|
+
for (let start = 0; start + hintWords.length <= words.length; start++) {
|
|
85
|
+
let matched = true;
|
|
86
|
+
for (let offset = 0; offset < hintWords.length; offset++) {
|
|
87
|
+
if (words[start + offset] !== hintWords[offset]) {
|
|
88
|
+
matched = false;
|
|
89
|
+
break;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
if (matched) {
|
|
93
|
+
return true;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
return false;
|
|
97
|
+
}
|
|
98
|
+
let compiledHints = null;
|
|
99
|
+
function getCompiledHints() {
|
|
100
|
+
if (!compiledHints) {
|
|
101
|
+
compiledHints = [];
|
|
102
|
+
for (const info of DataTypeCatalog_1.DATA_TYPE_CATALOG) {
|
|
103
|
+
for (const hint of info.nameHints) {
|
|
104
|
+
compiledHints.push({
|
|
105
|
+
dataTypeId: info.id,
|
|
106
|
+
words: hint.split(" "),
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
return compiledHints;
|
|
112
|
+
}
|
|
113
|
+
/*
|
|
114
|
+
* The words a field's name is read as: those of its last path segment, and
|
|
115
|
+
* of the one before it when the last is a generic word ("number", "value",
|
|
116
|
+
* "id") that needs its parent to mean anything.
|
|
117
|
+
*/
|
|
118
|
+
const GENERIC_LAST_SEGMENTS = new Set([
|
|
119
|
+
"number",
|
|
120
|
+
"no",
|
|
121
|
+
"num",
|
|
122
|
+
"value",
|
|
123
|
+
"id",
|
|
124
|
+
"code",
|
|
125
|
+
"key",
|
|
126
|
+
"token",
|
|
127
|
+
"data",
|
|
128
|
+
]);
|
|
129
|
+
// What separates a path's segments, and a segment that is an array index.
|
|
130
|
+
const PATH_SEPARATOR = /[.[\]/]/;
|
|
131
|
+
const ARRAY_INDEX = /^\d{1,9}$/;
|
|
132
|
+
function getFieldNameWords(fieldPath) {
|
|
133
|
+
const segments = fieldPath
|
|
134
|
+
.slice(0, 1024)
|
|
135
|
+
.split(PATH_SEPARATOR)
|
|
136
|
+
.filter((segment) => {
|
|
137
|
+
return segment.length > 0 && !ARRAY_INDEX.test(segment);
|
|
138
|
+
});
|
|
139
|
+
if (segments.length === 0) {
|
|
140
|
+
return [];
|
|
141
|
+
}
|
|
142
|
+
const last = splitFieldName(segments[segments.length - 1]);
|
|
143
|
+
if (segments.length > 1 &&
|
|
144
|
+
last.length === 1 &&
|
|
145
|
+
GENERIC_LAST_SEGMENTS.has(last[0])) {
|
|
146
|
+
return [...splitFieldName(segments[segments.length - 2]), ...last];
|
|
147
|
+
}
|
|
148
|
+
return last;
|
|
149
|
+
}
|
|
150
|
+
/*
|
|
151
|
+
* The data types a field's name hints at, for the built-in catalog and any
|
|
152
|
+
* extra hints a project's custom data types carry.
|
|
153
|
+
*/
|
|
154
|
+
function getHintedDataTypeIds(fieldPath, extraHints = []) {
|
|
155
|
+
const hinted = new Set();
|
|
156
|
+
if (!fieldPath) {
|
|
157
|
+
return hinted;
|
|
158
|
+
}
|
|
159
|
+
const words = getFieldNameWords(fieldPath);
|
|
160
|
+
if (words.length === 0) {
|
|
161
|
+
return hinted;
|
|
162
|
+
}
|
|
163
|
+
for (const hint of getCompiledHints()) {
|
|
164
|
+
if (containsWordRun(words, hint.words)) {
|
|
165
|
+
hinted.add(hint.dataTypeId);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
for (const extra of extraHints) {
|
|
169
|
+
for (const hint of extra.hints) {
|
|
170
|
+
const hintWords = splitFieldName(hint);
|
|
171
|
+
if (containsWordRun(words, hintWords)) {
|
|
172
|
+
hinted.add(extra.dataTypeId);
|
|
173
|
+
break;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
return hinted;
|
|
178
|
+
}
|
|
179
|
+
// The built-in types found from names only, which no value can confirm.
|
|
180
|
+
function getNameOnlyDataTypes() {
|
|
181
|
+
return DataTypeCatalog_1.DATA_TYPE_CATALOG.filter((info) => {
|
|
182
|
+
return info.foundBy === "name";
|
|
183
|
+
});
|
|
184
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import commonJsModule from "./FieldNameHints.js";
|
|
2
|
+
export const containsWordRun = commonJsModule.containsWordRun;
|
|
3
|
+
export const getFieldNameWords = commonJsModule.getFieldNameWords;
|
|
4
|
+
export const getHintedDataTypeIds = commonJsModule.getHintedDataTypeIds;
|
|
5
|
+
export const getNameOnlyDataTypes = commonJsModule.getNameOnlyDataTypes;
|
|
6
|
+
export const splitFieldName = commonJsModule.splitFieldName;
|