@oneuptime/common 14.0.99 → 14.0.100
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/ExceptionInstance.d.mts +2 -0
- package/Models/AnalyticsModels/ExceptionInstance.d.ts +2 -0
- package/Models/AnalyticsModels/ExceptionInstance.js +31 -0
- package/Models/AnalyticsModels/LogCountBaseline.d.mts +6 -0
- package/Models/AnalyticsModels/LogCountBaseline.d.ts +6 -0
- package/Models/AnalyticsModels/LogCountBaseline.js +7 -1
- package/Models/AnalyticsModels/MetricBaselineHourly.d.mts +11 -6
- package/Models/AnalyticsModels/MetricBaselineHourly.d.ts +11 -6
- package/Models/AnalyticsModels/MetricBaselineHourly.js +12 -7
- package/Models/AnalyticsModels/RumSessionChunk.js +1 -1
- package/Models/AnalyticsModels/SpanCountBaseline.d.mts +17 -9
- package/Models/AnalyticsModels/SpanCountBaseline.d.ts +17 -9
- package/Models/AnalyticsModels/SpanCountBaseline.js +18 -10
- package/Models/DatabaseModels/CloudApp.d.mts +27 -0
- package/Models/DatabaseModels/CloudApp.d.ts +27 -0
- package/Models/DatabaseModels/CloudApp.js +414 -0
- package/Models/DatabaseModels/CloudApp.mjs +2 -0
- package/Models/DatabaseModels/CloudAppRevision.d.mts +23 -0
- package/Models/DatabaseModels/CloudAppRevision.d.ts +23 -0
- package/Models/DatabaseModels/CloudAppRevision.js +351 -0
- package/Models/DatabaseModels/CloudAppRevision.mjs +2 -0
- package/Models/DatabaseModels/CloudResourceFeed.d.mts +4 -1
- package/Models/DatabaseModels/CloudResourceFeed.d.ts +4 -1
- package/Models/DatabaseModels/CloudResourceFeed.js +17 -1
- package/Models/DatabaseModels/CloudResourceFeed.mjs +1 -0
- package/Models/DatabaseModels/CloudResourceInstance.d.mts +4 -0
- package/Models/DatabaseModels/CloudResourceInstance.d.ts +4 -0
- package/Models/DatabaseModels/CloudResourceInstance.js +60 -1
- package/Models/DatabaseModels/CloudResourceLabelRule.d.mts +2 -0
- package/Models/DatabaseModels/CloudResourceLabelRule.d.ts +2 -0
- package/Models/DatabaseModels/CloudResourceLabelRule.js +44 -1
- package/Models/DatabaseModels/CloudResourceOwnerRule.d.mts +2 -0
- package/Models/DatabaseModels/CloudResourceOwnerRule.d.ts +2 -0
- package/Models/DatabaseModels/CloudResourceOwnerRule.js +44 -1
- package/Models/DatabaseModels/Dashboard.d.mts +2 -0
- package/Models/DatabaseModels/Dashboard.d.ts +2 -0
- package/Models/DatabaseModels/Dashboard.js +88 -0
- package/Models/DatabaseModels/DataSecurityIdentity.d.mts +29 -0
- package/Models/DatabaseModels/DataSecurityIdentity.d.ts +29 -0
- package/Models/DatabaseModels/DataSecurityIdentity.js +535 -0
- package/Models/DatabaseModels/DataSecurityIdentity.mjs +2 -0
- package/Models/DatabaseModels/DataStore.d.mts +1 -0
- package/Models/DatabaseModels/DataStore.d.ts +1 -0
- package/Models/DatabaseModels/DataStore.js +16 -0
- package/Models/DatabaseModels/DataStoreAccess.d.mts +1 -0
- package/Models/DatabaseModels/DataStoreAccess.d.ts +1 -0
- package/Models/DatabaseModels/DataStoreAccess.js +20 -0
- package/Models/DatabaseModels/DataStoreFinding.d.mts +3 -0
- package/Models/DatabaseModels/DataStoreFinding.d.ts +3 -0
- package/Models/DatabaseModels/DataStoreFinding.js +63 -1
- package/Models/DatabaseModels/DetectionRule.d.mts +1 -0
- package/Models/DatabaseModels/DetectionRule.d.ts +1 -0
- package/Models/DatabaseModels/DetectionRule.js +31 -0
- package/Models/DatabaseModels/ExceptionSavedView.d.mts +16 -0
- package/Models/DatabaseModels/ExceptionSavedView.d.ts +16 -0
- package/Models/DatabaseModels/ExceptionSavedView.js +413 -0
- package/Models/DatabaseModels/ExceptionSavedView.mjs +2 -0
- package/Models/DatabaseModels/FormDomain.d.mts +28 -0
- package/Models/DatabaseModels/FormDomain.d.ts +28 -0
- package/Models/DatabaseModels/FormDomain.js +598 -0
- package/Models/DatabaseModels/FormDomain.mjs +2 -0
- package/Models/DatabaseModels/IncidentEpisodeRoleMember.js +10 -1
- package/Models/DatabaseModels/Index.js +12 -0
- package/Models/DatabaseModels/NetworkDeviceDiscoveryScan.d.mts +2 -1
- package/Models/DatabaseModels/NetworkDeviceDiscoveryScan.d.ts +2 -1
- package/Models/DatabaseModels/NetworkEndpoint.d.mts +2 -0
- package/Models/DatabaseModels/NetworkEndpoint.d.ts +2 -0
- package/Models/DatabaseModels/NetworkEndpoint.js +62 -1
- package/Models/DatabaseModels/ProxmoxCluster.d.mts +2 -0
- package/Models/DatabaseModels/ProxmoxCluster.d.ts +2 -0
- package/Models/DatabaseModels/ProxmoxCluster.js +66 -0
- package/Models/DatabaseModels/ProxmoxResource.d.mts +13 -0
- package/Models/DatabaseModels/ProxmoxResource.d.ts +13 -0
- package/Models/DatabaseModels/ProxmoxResource.js +292 -0
- package/Models/DatabaseModels/StatusPageSubscriber.d.mts +1 -0
- package/Models/DatabaseModels/StatusPageSubscriber.d.ts +1 -0
- package/Models/DatabaseModels/StatusPageSubscriber.js +52 -0
- package/Models/DatabaseModels/TelemetryException.d.mts +5 -0
- package/Models/DatabaseModels/TelemetryException.d.ts +5 -0
- package/Models/DatabaseModels/TelemetryException.js +183 -0
- package/Models/DatabaseModels/TelemetryExceptionActivity.d.mts +42 -0
- package/Models/DatabaseModels/TelemetryExceptionActivity.d.ts +42 -0
- package/Models/DatabaseModels/TelemetryExceptionActivity.js +527 -0
- package/Models/DatabaseModels/TelemetryExceptionActivity.mjs +3 -0
- package/Server/Services/DatabaseService.d.mts +10 -0
- package/Server/Services/DatabaseService.d.ts +10 -0
- package/Types/AI/AIResourceContext.d.mts +2 -0
- package/Types/AI/AIResourceContext.d.ts +2 -0
- package/Types/AI/AIResourceContext.js +5 -0
- package/Types/Analytics/CookieConsent.d.mts +1 -0
- package/Types/Analytics/CookieConsent.d.ts +1 -0
- package/Types/Analytics/CookieConsent.js +10 -0
- package/Types/Analytics/CookieConsent.mjs +2 -0
- package/Types/BaseDatabase/AggregateBy.d.mts +13 -0
- package/Types/BaseDatabase/AggregateBy.d.ts +13 -0
- package/Types/Billing/SubscriptionPlanPricing.d.mts +2 -0
- package/Types/Billing/SubscriptionPlanPricing.d.ts +2 -0
- package/Types/Billing/SubscriptionPlanPricing.js +30 -0
- package/Types/Billing/SubscriptionPlanPricing.mjs +2 -0
- package/Types/Cloud/CloudPlatform.d.mts +3 -0
- package/Types/Cloud/CloudPlatform.d.ts +3 -0
- package/Types/Cloud/CloudPlatform.js +50 -0
- package/Types/Cloud/CloudResourceKind.d.mts +11 -0
- package/Types/Cloud/CloudResourceKind.d.ts +11 -0
- package/Types/Cloud/CloudResourceKind.js +78 -9
- package/Types/Cloud/CloudResourceKind.mjs +5 -0
- package/Types/CloudConnection/CloudConnectionCatalog.js +10 -8
- package/Types/CloudConnection/CloudConnectionSetupCommands.js +32 -10
- package/Types/CustomField/CustomFieldFile.d.mts +69 -0
- package/Types/CustomField/CustomFieldFile.d.ts +69 -0
- package/Types/CustomField/CustomFieldFile.js +235 -0
- package/Types/CustomField/CustomFieldFile.mjs +16 -0
- package/Types/CustomField/CustomFieldRecordKinds.d.mts +25 -0
- package/Types/CustomField/CustomFieldRecordKinds.d.ts +25 -0
- package/Types/CustomField/CustomFieldRecordKinds.js +111 -0
- package/Types/CustomField/CustomFieldRecordKinds.mjs +6 -0
- package/Types/CustomField/CustomFieldType.d.mts +15 -1
- package/Types/CustomField/CustomFieldType.d.ts +15 -1
- package/Types/CustomField/CustomFieldType.js +14 -0
- package/Types/CustomField/CustomFieldValueFormat.d.mts +3 -2
- package/Types/CustomField/CustomFieldValueFormat.d.ts +3 -2
- package/Types/CustomField/CustomFieldValueFormat.js +8 -2
- package/Types/CustomField/CustomFieldValueMapping.js +31 -2
- package/Types/CustomField/CustomFieldValueValidator.js +41 -1
- package/Types/Dashboard/DashboardLanguage.d.mts +1 -0
- package/Types/Dashboard/DashboardLanguage.d.ts +1 -0
- package/Types/Dashboard/DashboardLanguage.js +7 -1
- package/Types/Dashboard/DashboardLanguage.mjs +1 -0
- package/Types/Dashboard/DashboardTemplateFallbackHints.d.mts +4 -0
- package/Types/Dashboard/DashboardTemplateFallbackHints.d.ts +4 -0
- package/Types/Dashboard/DashboardTemplateFallbackHints.js +42 -0
- package/Types/Dashboard/DashboardTemplateFallbackHints.mjs +4 -0
- package/Types/Dashboard/DashboardTemplates.js +34 -11
- package/Types/DataSecurity/ComplianceRequirementCatalog.js +4 -0
- package/Types/DataSecurity/DataSecurityCheckCatalog.d.mts +1 -0
- package/Types/DataSecurity/DataSecurityCheckCatalog.d.ts +1 -0
- package/Types/DataSecurity/DataSecurityCheckCatalog.js +53 -0
- package/Types/DataSecurity/DataSecurityIdentity.d.mts +27 -0
- package/Types/DataSecurity/DataSecurityIdentity.d.ts +27 -0
- package/Types/DataSecurity/DataSecurityIdentity.js +160 -0
- package/Types/DataSecurity/DataSecurityIdentity.mjs +14 -0
- package/Types/DataSecurity/DataSecurityResponseAction.d.mts +9 -1
- package/Types/DataSecurity/DataSecurityResponseAction.d.ts +9 -1
- package/Types/DataSecurity/DataSecurityResponseAction.js +113 -26
- package/Types/DataSecurity/DataSecurityResponseAction.mjs +2 -0
- package/Types/DataSecurity/DataStoreAccess.d.mts +7 -0
- package/Types/DataSecurity/DataStoreAccess.d.ts +7 -0
- package/Types/DataSecurity/DataStoreAccess.js +23 -1
- package/Types/DataSecurity/DataStoreAccess.mjs +2 -0
- package/Types/Date.d.mts +30 -1
- package/Types/Date.d.ts +30 -1
- package/Types/Date.js +173 -5
- package/Types/Email/EmailMessage.d.mts +1 -0
- package/Types/Email/EmailMessage.d.ts +1 -0
- package/Types/Episode/EpisodeMembersAdd.d.mts +2 -0
- package/Types/Episode/EpisodeMembersAdd.d.ts +2 -0
- package/Types/Episode/EpisodeMembersAdd.js +9 -1
- package/Types/Episode/EpisodeMembersAdd.mjs +2 -0
- package/Types/File/FileContentCheck.d.mts +13 -0
- package/Types/File/FileContentCheck.d.ts +13 -0
- package/Types/File/FileContentCheck.js +301 -0
- package/Types/File/FileContentCheck.mjs +4 -0
- package/Types/File/FileSize.d.mts +3 -0
- package/Types/File/FileSize.d.ts +3 -0
- package/Types/File/FileSize.js +30 -0
- package/Types/File/FileSize.mjs +3 -0
- package/Types/File/FileTypeIcon.d.mts +4 -0
- package/Types/File/FileTypeIcon.d.ts +4 -0
- package/Types/File/FileTypeIcon.js +26 -0
- package/Types/File/FileTypeIcon.mjs +3 -0
- package/Types/File/MimeTypeLabel.d.mts +3 -0
- package/Types/File/MimeTypeLabel.d.ts +3 -0
- package/Types/File/MimeTypeLabel.js +39 -0
- package/Types/File/MimeTypeLabel.mjs +3 -0
- package/Types/Form/FormCustomDomain.d.mts +19 -0
- package/Types/Form/FormCustomDomain.d.ts +19 -0
- package/Types/Form/FormCustomDomain.js +86 -0
- package/Types/Form/FormCustomDomain.mjs +13 -0
- package/Types/Form/FormField.js +6 -0
- package/Types/Form/FormFileAnswer.d.mts +34 -0
- package/Types/Form/FormFileAnswer.d.ts +34 -0
- package/Types/Form/FormFileAnswer.js +203 -0
- package/Types/Form/FormFileAnswer.mjs +10 -0
- package/Types/Form/FormPublic.d.mts +16 -1
- package/Types/Form/FormPublic.d.ts +16 -1
- package/Types/Form/FormPublic.js +184 -2
- package/Types/Form/FormPublic.mjs +5 -0
- package/Types/Form/FormSubmissionAnswer.js +29 -0
- package/Types/InstallScripts/InstallScripts.d.mts +28 -0
- package/Types/InstallScripts/InstallScripts.d.ts +28 -0
- package/Types/InstallScripts/InstallScripts.js +225 -0
- package/Types/InstallScripts/InstallScripts.mjs +11 -0
- package/Types/Kubernetes/KubernetesClusterProvider.d.mts +10 -0
- package/Types/Kubernetes/KubernetesClusterProvider.d.ts +10 -0
- package/Types/Kubernetes/KubernetesClusterProvider.js +95 -0
- package/Types/Kubernetes/KubernetesClusterProvider.mjs +8 -0
- package/Types/Kubernetes/KubernetesInventoryExtractor.js +23 -16
- package/Types/Kubernetes/KubernetesObjectParser.d.mts +24 -0
- package/Types/Kubernetes/KubernetesObjectParser.d.ts +24 -0
- package/Types/Kubernetes/KubernetesObjectParser.js +64 -0
- package/Types/Kubernetes/KubernetesObjectParser.mjs +3 -0
- package/Types/Kubernetes/OpenShiftObjectAttributes.d.mts +20 -0
- package/Types/Kubernetes/OpenShiftObjectAttributes.d.ts +20 -0
- package/Types/Kubernetes/OpenShiftObjectAttributes.js +124 -0
- package/Types/Kubernetes/OpenShiftObjectAttributes.mjs +5 -0
- package/Types/Kubernetes/OpenShiftObjectParser.d.mts +140 -0
- package/Types/Kubernetes/OpenShiftObjectParser.d.ts +140 -0
- package/Types/Kubernetes/OpenShiftObjectParser.js +436 -0
- package/Types/Kubernetes/OpenShiftObjectParser.mjs +22 -0
- package/Types/Metrics/MetricQueryConfigData.d.mts +2 -0
- package/Types/Metrics/MetricQueryConfigData.d.ts +2 -0
- package/Types/Metrics/MetricQueryFallback.d.mts +10 -0
- package/Types/Metrics/MetricQueryFallback.d.ts +10 -0
- package/Types/Metrics/MetricQueryFallback.js +2 -0
- package/Types/Metrics/MetricQueryFallback.mjs +1 -0
- package/Types/Monitor/CephAlertTemplates.d.mts +2 -2
- package/Types/Monitor/CephAlertTemplates.d.ts +2 -2
- package/Types/Monitor/CephAlertTemplates.js +17 -14
- package/Types/Monitor/CephMetricCatalog.d.mts +2 -0
- package/Types/Monitor/CephMetricCatalog.d.ts +2 -0
- package/Types/Monitor/CephMetricCatalog.js +72 -29
- package/Types/Monitor/CephMetricCatalog.mjs +2 -0
- package/Types/Monitor/CriteriaFilter.d.mts +17 -0
- package/Types/Monitor/CriteriaFilter.d.ts +17 -0
- package/Types/Monitor/CriteriaFilter.js +23 -1
- package/Types/Monitor/CriteriaFilter.mjs +3 -0
- package/Types/Monitor/DockerAlertTemplates.d.mts +1 -0
- package/Types/Monitor/DockerAlertTemplates.d.ts +1 -0
- package/Types/Monitor/DockerAlertTemplates.js +63 -52
- package/Types/Monitor/DockerMetricCatalog.js +16 -0
- package/Types/Monitor/DockerSwarmAlertTemplates.d.mts +1 -0
- package/Types/Monitor/DockerSwarmAlertTemplates.d.ts +1 -0
- package/Types/Monitor/DockerSwarmAlertTemplates.js +13 -2
- package/Types/Monitor/ExceptionMonitor/ExceptionMonitorEvaluation.d.mts +34 -0
- package/Types/Monitor/ExceptionMonitor/ExceptionMonitorEvaluation.d.ts +34 -0
- package/Types/Monitor/ExceptionMonitor/ExceptionMonitorEvaluation.js +170 -0
- package/Types/Monitor/ExceptionMonitor/ExceptionMonitorEvaluation.mjs +12 -0
- package/Types/Monitor/ExceptionMonitor/ExceptionMonitorResponse.d.mts +17 -0
- package/Types/Monitor/ExceptionMonitor/ExceptionMonitorResponse.d.ts +17 -0
- package/Types/Monitor/HostMetricCatalog.d.mts +2 -0
- package/Types/Monitor/HostMetricCatalog.d.ts +2 -0
- package/Types/Monitor/HostMetricCatalog.js +20 -11
- package/Types/Monitor/IotAlertTemplates.d.mts +1 -0
- package/Types/Monitor/IotAlertTemplates.d.ts +1 -0
- package/Types/Monitor/IotAlertTemplates.js +11 -7
- package/Types/Monitor/KubernetesAlertTemplates.d.mts +15 -12
- package/Types/Monitor/KubernetesAlertTemplates.d.ts +15 -12
- package/Types/Monitor/KubernetesAlertTemplates.js +155 -73
- package/Types/Monitor/KubernetesMetricCatalog.d.mts +2 -1
- package/Types/Monitor/KubernetesMetricCatalog.d.ts +2 -1
- package/Types/Monitor/KubernetesMetricCatalog.js +62 -1
- package/Types/Monitor/LogMonitor/LogMonitorResponse.d.mts +1 -0
- package/Types/Monitor/LogMonitor/LogMonitorResponse.d.ts +1 -0
- package/Types/Monitor/MetricMonitor/MetricCriteriaContext.d.mts +24 -1
- package/Types/Monitor/MetricMonitor/MetricCriteriaContext.d.ts +24 -1
- package/Types/Monitor/MonitorStepCephMonitor.d.mts +1 -0
- package/Types/Monitor/MonitorStepCephMonitor.d.ts +1 -0
- package/Types/Monitor/MonitorStepDockerMonitor.d.mts +1 -0
- package/Types/Monitor/MonitorStepDockerMonitor.d.ts +1 -0
- package/Types/Monitor/MonitorStepDockerSwarmMonitor.d.mts +10 -0
- package/Types/Monitor/MonitorStepDockerSwarmMonitor.d.ts +10 -0
- package/Types/Monitor/MonitorStepDockerSwarmMonitor.js +3 -1
- package/Types/Monitor/MonitorStepDockerSwarmMonitor.mjs +1 -0
- package/Types/Monitor/MonitorStepExceptionMonitor.d.mts +1 -0
- package/Types/Monitor/MonitorStepExceptionMonitor.d.ts +1 -0
- package/Types/Monitor/MonitorStepExceptionMonitor.js +13 -2
- package/Types/Monitor/MonitorStepHostMonitor.d.mts +1 -0
- package/Types/Monitor/MonitorStepHostMonitor.d.ts +1 -0
- package/Types/Monitor/MonitorStepIoTMonitor.d.mts +9 -0
- package/Types/Monitor/MonitorStepIoTMonitor.d.ts +9 -0
- package/Types/Monitor/MonitorStepIoTMonitor.js +21 -0
- package/Types/Monitor/MonitorStepKubernetesMonitor.d.mts +11 -1
- package/Types/Monitor/MonitorStepKubernetesMonitor.d.ts +11 -1
- package/Types/Monitor/MonitorStepKubernetesMonitor.js +15 -4
- package/Types/Monitor/MonitorStepKubernetesMonitor.mjs +2 -0
- package/Types/Monitor/MonitorStepPodmanMonitor.d.mts +1 -0
- package/Types/Monitor/MonitorStepPodmanMonitor.d.ts +1 -0
- package/Types/Monitor/MonitorStepProxmoxMonitor.d.mts +5 -3
- package/Types/Monitor/MonitorStepProxmoxMonitor.d.ts +5 -3
- package/Types/Monitor/MonitorStepProxmoxMonitor.js +1 -1
- package/Types/Monitor/MonitorStepStorageArrayMonitor.d.mts +1 -0
- package/Types/Monitor/MonitorStepStorageArrayMonitor.d.ts +1 -0
- package/Types/Monitor/MonitorStepVMwareMonitor.d.mts +1 -0
- package/Types/Monitor/MonitorStepVMwareMonitor.d.ts +1 -0
- package/Types/Monitor/OpenShiftAlertTemplates.d.mts +29 -0
- package/Types/Monitor/OpenShiftAlertTemplates.d.ts +29 -0
- package/Types/Monitor/OpenShiftAlertTemplates.js +220 -0
- package/Types/Monitor/OpenShiftAlertTemplates.mjs +9 -0
- package/Types/Monitor/PodmanAlertTemplates.d.mts +1 -10
- package/Types/Monitor/PodmanAlertTemplates.d.ts +1 -10
- package/Types/Monitor/PodmanAlertTemplates.js +40 -85
- package/Types/Monitor/PodmanAlertTemplates.mjs +0 -1
- package/Types/Monitor/PodmanMetricCatalog.js +16 -0
- package/Types/Monitor/ProxmoxAlertTemplates.d.mts +1 -0
- package/Types/Monitor/ProxmoxAlertTemplates.d.ts +1 -0
- package/Types/Monitor/ProxmoxAlertTemplates.js +190 -4
- package/Types/Monitor/ProxmoxAlertTemplates.mjs +1 -0
- package/Types/Monitor/ProxmoxMetricCatalog.js +43 -22
- package/Types/Monitor/ProxmoxNotificationAlertTemplates.d.mts +24 -0
- package/Types/Monitor/ProxmoxNotificationAlertTemplates.d.ts +24 -0
- package/Types/Monitor/ProxmoxNotificationAlertTemplates.js +251 -0
- package/Types/Monitor/ProxmoxNotificationAlertTemplates.mjs +12 -0
- package/Types/Monitor/Recommendation/MonitorRecommendationCatalog.js +71 -3
- package/Types/Monitor/Recommendation/MonitorRecommendationTypes.d.mts +1 -0
- package/Types/Monitor/Recommendation/MonitorRecommendationTypes.d.ts +1 -0
- package/Types/Monitor/Recommendation/MonitorRecommendationUtil.js +23 -7
- package/Types/Monitor/ServiceAlertTemplates.js +111 -3
- package/Types/Monitor/SnmpMonitor/NetworkTopology.d.mts +9 -0
- package/Types/Monitor/SnmpMonitor/NetworkTopology.d.ts +9 -0
- package/Types/Monitor/SnmpMonitor/SnmpHardwareIdentity.d.mts +5 -0
- package/Types/Monitor/SnmpMonitor/SnmpHardwareIdentity.d.ts +5 -0
- package/Types/Monitor/SnmpMonitor/SnmpHardwareIdentity.js +2 -0
- package/Types/Monitor/SnmpMonitor/SnmpHardwareIdentity.mjs +1 -0
- package/Types/Monitor/SnmpMonitor/SnmpVendorIdentity.d.mts +27 -0
- package/Types/Monitor/SnmpMonitor/SnmpVendorIdentity.d.ts +27 -0
- package/Types/Monitor/SnmpMonitor/SnmpVendorIdentity.js +97 -0
- package/Types/Monitor/SnmpMonitor/SnmpVendorIdentity.mjs +4 -0
- package/Types/Monitor/StorageArrayAlertTemplates.d.mts +1 -0
- package/Types/Monitor/StorageArrayAlertTemplates.d.ts +1 -0
- package/Types/Monitor/StorageArrayAlertTemplates.js +8 -1
- package/Types/Monitor/StorageArrayMetricCatalog.js +10 -1
- package/Types/Monitor/TelemetryAlertRule.d.mts +8 -1
- package/Types/Monitor/TelemetryAlertRule.d.ts +8 -1
- package/Types/Monitor/TelemetryAlertRule.js +62 -35
- package/Types/Monitor/TraceMonitor/TraceMonitorResponse.d.mts +1 -0
- package/Types/Monitor/TraceMonitor/TraceMonitorResponse.d.ts +1 -0
- package/Types/Monitor/VMwareAlertTemplates.d.mts +1 -0
- package/Types/Monitor/VMwareAlertTemplates.d.ts +1 -0
- package/Types/Monitor/VMwareAlertTemplates.js +41 -19
- package/Types/NetworkController/NetworkControllerProvider.d.mts +1 -0
- package/Types/NetworkController/NetworkControllerProvider.d.ts +1 -0
- package/Types/NetworkController/NetworkControllerProvider.js +8 -0
- package/Types/NetworkController/NetworkControllerProvider.mjs +1 -0
- package/Types/NetworkController/NetworkControllerReadSummary.d.mts +3 -0
- package/Types/NetworkController/NetworkControllerReadSummary.d.ts +3 -0
- package/Types/NetworkController/NetworkControllerReadSummary.js +7 -1
- package/Types/NetworkDevice/NetworkDeviceDiscoveredDetails.d.mts +49 -2
- package/Types/NetworkDevice/NetworkDeviceDiscoveredDetails.d.ts +49 -2
- package/Types/NetworkDevice/NetworkDeviceDiscoveredDetails.js +252 -17
- package/Types/NetworkDevice/NetworkDeviceDiscoveredDetails.mjs +7 -0
- package/Types/NotificationSetting/NotificationEmailRollupCategory.d.mts +1 -0
- package/Types/NotificationSetting/NotificationEmailRollupCategory.d.ts +1 -0
- package/Types/NotificationSetting/NotificationEmailRollupCategory.js +9 -0
- package/Types/NotificationSetting/NotificationSettingEventType.d.mts +1 -0
- package/Types/NotificationSetting/NotificationSettingEventType.d.ts +1 -0
- package/Types/NotificationSetting/NotificationSettingEventType.js +8 -0
- package/Types/Permission.d.mts +5 -0
- package/Types/Permission.d.ts +5 -0
- package/Types/Permission.js +59 -1
- package/Types/PrivateRecord/PrivateRecordHeld.d.mts +18 -0
- package/Types/PrivateRecord/PrivateRecordHeld.d.ts +18 -0
- package/Types/PrivateRecord/PrivateRecordHeld.js +101 -0
- package/Types/PrivateRecord/PrivateRecordHeld.mjs +2 -0
- package/Types/PrivateRecord/PrivateRecordParts.d.mts +14 -0
- package/Types/PrivateRecord/PrivateRecordParts.d.ts +14 -0
- package/Types/PrivateRecord/PrivateRecordParts.js +95 -0
- package/Types/PrivateRecord/PrivateRecordParts.mjs +4 -0
- package/Types/ReaderLanguage.d.mts +11 -0
- package/Types/ReaderLanguage.d.ts +11 -0
- package/Types/ReaderLanguage.js +173 -0
- package/Types/ReaderLanguage.mjs +12 -0
- package/Types/ReadingDirection.d.mts +4 -0
- package/Types/ReadingDirection.d.ts +4 -0
- package/Types/ReadingDirection.js +52 -1
- package/Types/ReadingDirection.mjs +4 -0
- package/Types/Rules/RuleCriteriaSubject.d.mts +3 -1
- package/Types/Rules/RuleCriteriaSubject.d.ts +3 -1
- package/Types/Rules/RuleCriteriaSubject.js +16 -1
- package/Types/Rules/RuleCriteriaSubject.mjs +1 -0
- package/Types/Rules/RuleRun.d.mts +5 -1
- package/Types/Rules/RuleRun.d.ts +5 -1
- package/Types/Rules/RuleRun.js +10 -2
- package/Types/Rum/SessionReplay.d.mts +1 -0
- package/Types/Rum/SessionReplay.d.ts +1 -0
- package/Types/Rum/SessionReplay.js +4 -2
- package/Types/Rum/SessionReplay.mjs +1 -0
- package/Types/Rum/UserFlow.d.mts +11 -0
- package/Types/Rum/UserFlow.d.ts +11 -0
- package/Types/Rum/UserFlow.js +27 -12
- package/Types/SecurityCase/SecurityCaseContext.d.mts +33 -1
- package/Types/SecurityCase/SecurityCaseContext.d.ts +33 -1
- package/Types/SecurityCase/SecurityCaseContext.js +6 -1
- package/Types/SecurityCase/SecurityCaseContext.mjs +2 -0
- package/Types/SecurityEvent/RealTimeDetection.d.mts +13 -0
- package/Types/SecurityEvent/RealTimeDetection.d.ts +13 -0
- package/Types/SecurityEvent/RealTimeDetection.js +60 -0
- package/Types/SecurityEvent/RealTimeDetection.mjs +8 -0
- package/Types/SecurityPlaybook/SecurityPlaybookAction.d.mts +7 -0
- package/Types/SecurityPlaybook/SecurityPlaybookAction.d.ts +7 -0
- package/Types/SecurityPlaybook/SecurityPlaybookAction.js +80 -3
- package/Types/SecurityPlaybook/SecurityPlaybookStep.d.mts +15 -1
- package/Types/SecurityPlaybook/SecurityPlaybookStep.d.ts +15 -1
- package/Types/SecurityPlaybook/SecurityPlaybookStep.js +112 -3
- package/Types/SecurityPlaybook/SecurityPlaybookStep.mjs +5 -0
- package/Types/SecurityPlaybook/SecurityPlaybookStepCondition.d.mts +44 -0
- package/Types/SecurityPlaybook/SecurityPlaybookStepCondition.d.ts +44 -0
- package/Types/SecurityPlaybook/SecurityPlaybookStepCondition.js +188 -0
- package/Types/SecurityPlaybook/SecurityPlaybookStepCondition.mjs +9 -0
- package/Types/SecurityPlaybook/SecurityPlaybookStepResult.d.mts +1 -0
- package/Types/SecurityPlaybook/SecurityPlaybookStepResult.d.ts +1 -0
- package/Types/SecurityPlaybook/SecurityPlaybookStepResult.js +1 -0
- package/Types/SecurityPlaybook/SecurityPlaybookTemplates.d.mts +2 -0
- package/Types/SecurityPlaybook/SecurityPlaybookTemplates.d.ts +2 -0
- package/Types/SecurityPlaybook/SecurityPlaybookTemplates.js +67 -16
- package/Types/SecurityPlaybook/SecurityPlaybookTemplates.mjs +2 -0
- package/Types/StatusPage/DefaultStatusNames.d.mts +4 -0
- package/Types/StatusPage/DefaultStatusNames.d.ts +4 -0
- package/Types/StatusPage/DefaultStatusNames.js +50 -0
- package/Types/StatusPage/DefaultStatusNames.mjs +4 -0
- package/Types/StatusPage/StateChangeNoteMessage.d.mts +18 -1
- package/Types/StatusPage/StateChangeNoteMessage.d.ts +18 -1
- package/Types/StatusPage/StateChangeNoteMessage.js +60 -9
- package/Types/StatusPage/StateChangeNoteMessage.mjs +1 -0
- package/Types/StatusPage/StatusPageLanguage.d.mts +2 -0
- package/Types/StatusPage/StatusPageLanguage.d.ts +2 -0
- package/Types/StatusPage/StatusPageLanguage.js +10 -1
- package/Types/StatusPage/StatusPageLanguage.mjs +2 -0
- package/Types/Telemetry/ExceptionFingerprintLookup.d.mts +9 -0
- package/Types/Telemetry/ExceptionFingerprintLookup.d.ts +9 -0
- package/Types/Telemetry/ExceptionFingerprintLookup.js +55 -0
- package/Types/Telemetry/ExceptionFingerprintLookup.mjs +4 -0
- package/Types/Telemetry/ExceptionGroupFingerprints.d.mts +10 -0
- package/Types/Telemetry/ExceptionGroupFingerprints.d.ts +10 -0
- package/Types/Telemetry/ExceptionGroupFingerprints.js +114 -0
- package/Types/Telemetry/ExceptionGroupFingerprints.mjs +6 -0
- package/Types/Telemetry/ExceptionListStats.d.mts +19 -0
- package/Types/Telemetry/ExceptionListStats.d.ts +19 -0
- package/Types/Telemetry/ExceptionListStats.js +122 -0
- package/Types/Telemetry/ExceptionListStats.mjs +9 -0
- package/Types/Telemetry/ExceptionSpanScope.d.mts +3 -0
- package/Types/Telemetry/ExceptionSpanScope.d.ts +3 -0
- package/Types/Telemetry/ExceptionSpanScope.js +39 -3
- package/Types/Telemetry/ExceptionSpanScope.mjs +2 -0
- package/Types/Telemetry/SimilarExceptions.d.mts +33 -0
- package/Types/Telemetry/SimilarExceptions.d.ts +33 -0
- package/Types/Telemetry/SimilarExceptions.js +109 -0
- package/Types/Telemetry/SimilarExceptions.mjs +10 -0
- package/Types/Telemetry/TelemetrySavedViewState.d.mts +4 -0
- package/Types/Telemetry/TelemetrySavedViewState.d.ts +4 -0
- package/Types/Telemetry/TraceSpanType.d.mts +1 -0
- package/Types/Telemetry/TraceSpanType.d.ts +1 -0
- package/Types/Telemetry/TraceSpanType.js +17 -3
- package/Types/Telemetry/TraceSpanType.mjs +1 -0
- package/Types/Theme/ThemePreference.js +2 -1
- package/Types/Translator.d.mts +77 -0
- package/Types/Translator.d.ts +77 -0
- package/Types/Translator.js +582 -0
- package/Types/Translator.mjs +18 -0
- package/Types/VideoCall/VideoCallProvider.js +6 -3
- package/Types/Workflow/ComponentID.d.mts +5 -0
- package/Types/Workflow/ComponentID.d.ts +5 -0
- package/Types/Workflow/ComponentID.js +12 -0
- package/Types/Workflow/Components/API.js +91 -0
- package/Types/Workflow/Components/ApiGetById.d.mts +16 -0
- package/Types/Workflow/Components/ApiGetById.d.ts +16 -0
- package/Types/Workflow/Components/ApiGetById.js +69 -0
- package/Types/Workflow/Components/ApiGetById.mjs +4 -0
- package/Types/Workflow/Components/FromAnotherTool.d.mts +94 -0
- package/Types/Workflow/Components/FromAnotherTool.d.ts +94 -0
- package/Types/Workflow/Components/FromAnotherTool.js +541 -0
- package/Types/Workflow/Components/FromAnotherTool.mjs +23 -0
- package/Types/Workflow/Components/JavaScriptCheck.d.mts +16 -0
- package/Types/Workflow/Components/JavaScriptCheck.d.ts +16 -0
- package/Types/Workflow/Components/JavaScriptCheck.js +145 -0
- package/Types/Workflow/Components/JavaScriptCheck.mjs +5 -0
- package/Types/Workflow/Components/Zabbix.d.mts +62 -0
- package/Types/Workflow/Components/Zabbix.d.ts +62 -0
- package/Types/Workflow/Components/Zabbix.js +343 -0
- package/Types/Workflow/Components/Zabbix.mjs +17 -0
- package/Types/Workflow/Components.js +21 -0
- package/Types/Workflow/Documentation/APIDocumentation.d.mts +1 -0
- package/Types/Workflow/Documentation/APIDocumentation.d.ts +1 -0
- package/Types/Workflow/Documentation/APIDocumentation.js +48 -1
- package/Types/Workflow/Documentation/APIDocumentation.mjs +1 -0
- package/Types/Workflow/Documentation/DocumentationContext.js +2 -0
- package/Types/Workflow/Documentation/DocumentationLinks.d.mts +3 -0
- package/Types/Workflow/Documentation/DocumentationLinks.d.ts +3 -0
- package/Types/Workflow/Documentation/DocumentationLinks.js +3 -0
- package/Types/Workflow/Documentation/FromAnotherToolDocumentation.d.mts +5 -0
- package/Types/Workflow/Documentation/FromAnotherToolDocumentation.d.ts +5 -0
- package/Types/Workflow/Documentation/FromAnotherToolDocumentation.js +89 -0
- package/Types/Workflow/Documentation/FromAnotherToolDocumentation.mjs +3 -0
- package/Types/Workflow/Documentation/Index.js +7 -0
- package/Types/Workflow/Documentation/UtilityDocumentation.d.mts +1 -0
- package/Types/Workflow/Documentation/UtilityDocumentation.d.ts +1 -0
- package/Types/Workflow/Documentation/UtilityDocumentation.js +40 -1
- package/Types/Workflow/Documentation/UtilityDocumentation.mjs +1 -0
- package/Types/Workflow/Documentation/ZabbixDocumentation.d.mts +4 -0
- package/Types/Workflow/Documentation/ZabbixDocumentation.d.ts +4 -0
- package/Types/Workflow/Documentation/ZabbixDocumentation.js +67 -0
- package/Types/Workflow/Documentation/ZabbixDocumentation.mjs +2 -0
- package/Types/Workflow/TemplateLayout.d.mts +44 -0
- package/Types/Workflow/TemplateLayout.d.ts +44 -0
- package/Types/Workflow/TemplateLayout.js +125 -0
- package/Types/Workflow/TemplateLayout.mjs +7 -0
- package/Types/Workflow/Templates.d.mts +42 -12
- package/Types/Workflow/Templates.d.ts +42 -12
- package/Types/Workflow/Templates.js +2046 -6220
- package/Types/Workflow/Templates.mjs +1 -0
- package/Types/Workflow/UnhandledStepFailure.d.mts +15 -0
- package/Types/Workflow/UnhandledStepFailure.d.ts +15 -0
- package/Types/Workflow/UnhandledStepFailure.js +68 -0
- package/Types/Workflow/UnhandledStepFailure.mjs +5 -0
- package/Types/Workspace/MicrosoftTeamsCloud.d.mts +26 -0
- package/Types/Workspace/MicrosoftTeamsCloud.d.ts +26 -0
- package/Types/Workspace/MicrosoftTeamsCloud.js +214 -0
- package/Types/Workspace/MicrosoftTeamsCloud.mjs +4 -0
- package/Types/Workspace/WorkspaceChannelLink.d.mts +1 -0
- package/Types/Workspace/WorkspaceChannelLink.d.ts +1 -0
- package/Types/Workspace/WorkspaceChannelLink.js +45 -6
- package/UI/Utils/TranslateTemplate.d.mts +3 -68
- package/UI/Utils/TranslateTemplate.d.ts +3 -68
- package/Utils/Dashboard/DashboardBoardLayout.d.mts +46 -0
- package/Utils/Dashboard/DashboardBoardLayout.d.ts +46 -0
- package/Utils/Dashboard/DashboardBoardLayout.js +238 -0
- package/Utils/Dashboard/DashboardBoardLayout.mjs +11 -0
- package/Utils/Dashboard/ValueWidgetLayout.js +9 -1
- package/Utils/Dashboard/VariableInterpolation.d.mts +1 -0
- package/Utils/Dashboard/VariableInterpolation.d.ts +1 -0
- package/Utils/Dashboard/VariableInterpolation.js +19 -0
- package/Utils/DataSecurity/FieldClassifier.d.mts +2 -0
- package/Utils/DataSecurity/FieldClassifier.d.ts +2 -0
- package/Utils/DataSecurity/UnplacedFields.d.mts +35 -0
- package/Utils/DataSecurity/UnplacedFields.d.ts +35 -0
- package/Utils/DataSecurity/UnplacedFields.js +407 -0
- package/Utils/DataSecurity/UnplacedFields.mjs +19 -0
- package/Utils/Exceptions/ExceptionActivity.d.mts +22 -0
- package/Utils/Exceptions/ExceptionActivity.d.ts +22 -0
- package/Utils/Exceptions/ExceptionActivity.js +141 -0
- package/Utils/Exceptions/ExceptionActivity.mjs +6 -0
- package/Utils/Exceptions/ExceptionUserId.d.mts +8 -0
- package/Utils/Exceptions/ExceptionUserId.d.ts +8 -0
- package/Utils/Exceptions/ExceptionUserId.js +79 -0
- package/Utils/Exceptions/ExceptionUserId.mjs +6 -0
- package/Utils/Inventory/InventoryAssetDetails.d.mts +7 -0
- package/Utils/Inventory/InventoryAssetDetails.d.ts +7 -0
- package/Utils/Inventory/InventoryAssetDetails.js +70 -1
- package/Utils/Inventory/InventoryAssetDetails.mjs +1 -0
- package/Utils/Metrics/MetricQueryFallback.d.mts +24 -0
- package/Utils/Metrics/MetricQueryFallback.d.ts +24 -0
- package/Utils/Metrics/MetricQueryFallback.js +208 -0
- package/Utils/Metrics/MetricQueryFallback.mjs +2 -0
- package/Utils/Monitor/EndpointAttachmentUtil.d.mts +15 -2
- package/Utils/Monitor/EndpointAttachmentUtil.d.ts +15 -2
- package/Utils/Monitor/EndpointAttachmentUtil.js +83 -1
- package/Utils/Monitor/EndpointAttachmentUtil.mjs +1 -0
- package/Utils/Monitor/NeighborIdentityUtil.d.mts +15 -0
- package/Utils/Monitor/NeighborIdentityUtil.d.ts +15 -0
- package/Utils/Monitor/NeighborIdentityUtil.js +58 -0
- package/Utils/Monitor/NeighborIdentityUtil.mjs +3 -0
- package/Utils/Monitor/NetworkTopologyUtil.d.mts +13 -0
- package/Utils/Monitor/NetworkTopologyUtil.d.ts +13 -0
- package/Utils/Monitor/NetworkTopologyUtil.js +293 -70
- package/Utils/NetworkDevice/DeviceOwnMacUtil.d.mts +20 -0
- package/Utils/NetworkDevice/DeviceOwnMacUtil.d.ts +20 -0
- package/Utils/NetworkDevice/DeviceOwnMacUtil.js +81 -0
- package/Utils/NetworkDevice/DeviceOwnMacUtil.mjs +4 -0
- package/Utils/NetworkDevice/DeviceWebUiUtil.d.mts +20 -0
- package/Utils/NetworkDevice/DeviceWebUiUtil.d.ts +20 -0
- package/Utils/NetworkDevice/DeviceWebUiUtil.js +139 -0
- package/Utils/NetworkDevice/DeviceWebUiUtil.mjs +4 -0
- package/Utils/NetworkDevice/NetworkDeviceAssetFacts.d.mts +1 -0
- package/Utils/NetworkDevice/NetworkDeviceAssetFacts.d.ts +1 -0
- package/Utils/NetworkDevice/NetworkDeviceAssetFacts.js +64 -6
- package/Utils/NetworkDevice/SystemDescriptionUtil.d.mts +10 -0
- package/Utils/NetworkDevice/SystemDescriptionUtil.d.ts +10 -0
- package/Utils/NetworkDevice/SystemDescriptionUtil.js +69 -5
- package/Utils/NetworkDevice/SystemDescriptionUtil.mjs +2 -0
- package/Utils/NetworkDiscovery/DiscoveredDetailsPlan.d.mts +1 -0
- package/Utils/NetworkDiscovery/DiscoveredDetailsPlan.d.ts +1 -0
- package/Utils/NetworkDiscovery/DiscoveredDetailsPlan.js +19 -6
- package/Utils/NetworkDiscovery/DiscoveredHostUtil.d.mts +1 -1
- package/Utils/NetworkDiscovery/DiscoveredHostUtil.d.ts +1 -1
- package/Utils/NetworkDiscovery/DiscoveredHostUtil.js +18 -1
- package/Utils/Proxmox/ProxmoxNotifications.d.mts +62 -0
- package/Utils/Proxmox/ProxmoxNotifications.d.ts +62 -0
- package/Utils/Proxmox/ProxmoxNotifications.js +458 -0
- package/Utils/Proxmox/ProxmoxNotifications.mjs +20 -0
- package/Utils/Rules/RuleRunSummary.d.mts +6 -3
- package/Utils/Rules/RuleRunSummary.d.ts +6 -3
- package/Utils/Rules/RuleRunSummary.js +11 -7
- package/Utils/Rum/UserFlow.d.mts +20 -0
- package/Utils/Rum/UserFlow.d.ts +20 -0
- package/Utils/Rum/UserFlow.js +41 -3
- package/Utils/Rum/UserFlow.mjs +1 -0
- package/Utils/Schema/MonitorSchemas.js +2 -0
- package/Utils/Sms/Gsm7Text.d.mts +3 -0
- package/Utils/Sms/Gsm7Text.d.ts +3 -0
- package/Utils/Sms/Gsm7Text.js +109 -8
- package/Utils/Sms/Gsm7Text.mjs +3 -0
- package/Utils/Sms/SubscriberSms.js +9 -1
- package/Utils/Telemetry/ChangeEventFields.d.mts +11 -0
- package/Utils/Telemetry/ChangeEventFields.d.ts +11 -0
- package/Utils/Telemetry/ChangeEventFields.js +33 -3
- package/Utils/Telemetry/CloudAppRevisionName.d.mts +4 -0
- package/Utils/Telemetry/CloudAppRevisionName.d.ts +4 -0
- package/Utils/Telemetry/CloudAppRevisionName.js +27 -0
- package/Utils/Telemetry/CloudAppRevisionName.mjs +2 -0
- package/Utils/Telemetry/CloudInstanceIdentity.d.mts +1 -0
- package/Utils/Telemetry/CloudInstanceIdentity.d.ts +1 -0
- package/Utils/Telemetry/CloudInstanceIdentity.js +10 -0
- package/Utils/Telemetry/CloudInstanceIdentity.mjs +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,582 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getTemplateAround = exports.getSentencePartsAndLanguage = exports.getSentenceParts = exports.translateNamedAction = exports.getSentenceLanguage = exports.formatList = exports.createTranslator = exports.fillTemplate = exports.getTemplatePlaceholders = exports.getPluralCategory = exports.toSentenceTerm = exports.DEFAULT_LANGUAGE = exports.translationKey = exports.isComposedValue = exports.composedValue = exports.isTranslatableTerm = exports.translatableTerm = void 0;
|
|
4
|
+
const DateLanguage_1 = require("./DateLanguage");
|
|
5
|
+
const ReadingDirection_1 = require("./ReadingDirection");
|
|
6
|
+
const translatableTerm = (text, options) => {
|
|
7
|
+
return {
|
|
8
|
+
translatableTerm: text,
|
|
9
|
+
inSentence: Boolean(options === null || options === void 0 ? void 0 : options.inSentence),
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
exports.translatableTerm = translatableTerm;
|
|
13
|
+
const isTranslatableTerm = (value) => {
|
|
14
|
+
return (typeof value === "object" &&
|
|
15
|
+
value !== null &&
|
|
16
|
+
typeof value.translatableTerm === "string");
|
|
17
|
+
};
|
|
18
|
+
exports.isTranslatableTerm = isTranslatableTerm;
|
|
19
|
+
const composedValue = (compose) => {
|
|
20
|
+
return { compose };
|
|
21
|
+
};
|
|
22
|
+
exports.composedValue = composedValue;
|
|
23
|
+
const isComposedValue = (value) => {
|
|
24
|
+
return (typeof value === "object" &&
|
|
25
|
+
value !== null &&
|
|
26
|
+
typeof value.compose === "function");
|
|
27
|
+
};
|
|
28
|
+
exports.isComposedValue = isComposedValue;
|
|
29
|
+
/*
|
|
30
|
+
* Declares a string as a translation key without translating it yet - for a
|
|
31
|
+
* constant or a map of sentences that are looked up later. It returns the
|
|
32
|
+
* text unchanged; its only job is to let the Dashboard's extraction script
|
|
33
|
+
* (npm run i18n:extract) find the string and add it to en.json.
|
|
34
|
+
*/
|
|
35
|
+
const translationKey = (text) => {
|
|
36
|
+
return text;
|
|
37
|
+
};
|
|
38
|
+
exports.translationKey = translationKey;
|
|
39
|
+
exports.DEFAULT_LANGUAGE = "en";
|
|
40
|
+
// The language part of a code: "zh-CN" -> "zh", "pt" -> "pt".
|
|
41
|
+
const getBaseLanguage = (language) => {
|
|
42
|
+
return (language || exports.DEFAULT_LANGUAGE).split(/[-_]/)[0].toLowerCase();
|
|
43
|
+
};
|
|
44
|
+
/*
|
|
45
|
+
* Languages that capitalize every noun, so a name keeps its capital in the
|
|
46
|
+
* middle of a sentence. Languages without letter case (Japanese, Chinese,
|
|
47
|
+
* Korean, Hindi, Persian) are unaffected by lower-casing either way.
|
|
48
|
+
*/
|
|
49
|
+
const LANGUAGES_THAT_CAPITALIZE_NOUNS = ["de", "lb"];
|
|
50
|
+
/*
|
|
51
|
+
* Proper nouns that keep their capital wherever they appear. Acronyms
|
|
52
|
+
* ("API", "SLOs") and words with a capital inside them ("OneUptime",
|
|
53
|
+
* "GitHub", "IoT") are kept without being listed.
|
|
54
|
+
*/
|
|
55
|
+
const PROPER_NOUNS = [
|
|
56
|
+
"Azure",
|
|
57
|
+
"Ceph",
|
|
58
|
+
"Discord",
|
|
59
|
+
"Docker",
|
|
60
|
+
"Google",
|
|
61
|
+
"Grafana",
|
|
62
|
+
"Huntress",
|
|
63
|
+
"Jira",
|
|
64
|
+
"Kubernetes",
|
|
65
|
+
"Linux",
|
|
66
|
+
"Microsoft",
|
|
67
|
+
"Okta",
|
|
68
|
+
"OpenTelemetry",
|
|
69
|
+
"Podman",
|
|
70
|
+
"Prometheus",
|
|
71
|
+
"Proxmox",
|
|
72
|
+
"Slack",
|
|
73
|
+
"Swarm",
|
|
74
|
+
"Telegram",
|
|
75
|
+
"Terraform",
|
|
76
|
+
"Twilio",
|
|
77
|
+
"Windows",
|
|
78
|
+
];
|
|
79
|
+
/*
|
|
80
|
+
* Proper nouns of two words: the second keeps its capital after the first
|
|
81
|
+
* ("Google Cloud project", but "cloud resources").
|
|
82
|
+
*/
|
|
83
|
+
const PROPER_NOUN_PAIRS = [["Google", "Cloud"]];
|
|
84
|
+
// "API", "SLOs": two capitals in a row.
|
|
85
|
+
const ACRONYM_PATTERN = /\p{Lu}{2,}/u;
|
|
86
|
+
// "OneUptime", "GitHub", "iOS": a capital after the first letter.
|
|
87
|
+
const INNER_CAPITAL_PATTERN = /^.+\p{Lu}/u;
|
|
88
|
+
const keepsItsCase = (part) => {
|
|
89
|
+
return (ACRONYM_PATTERN.test(part) ||
|
|
90
|
+
INNER_CAPITAL_PATTERN.test(part) ||
|
|
91
|
+
PROPER_NOUNS.includes(part));
|
|
92
|
+
};
|
|
93
|
+
/*
|
|
94
|
+
* A label as it is written in the middle of a sentence in `language`:
|
|
95
|
+
* "On-Call Duty Policies" -> "on-call duty policies", "API Keys" -> "API
|
|
96
|
+
* keys", "Kubernetes Clusters" -> "Kubernetes clusters"; unchanged in German.
|
|
97
|
+
* Runs of spaces collapse and the ends are trimmed.
|
|
98
|
+
*/
|
|
99
|
+
const toSentenceTerm = (text, language) => {
|
|
100
|
+
const words = text.trim().split(/\s+/).filter(Boolean);
|
|
101
|
+
if (LANGUAGES_THAT_CAPITALIZE_NOUNS.includes(getBaseLanguage(language))) {
|
|
102
|
+
return words.join(" ");
|
|
103
|
+
}
|
|
104
|
+
return words
|
|
105
|
+
.map((word, index) => {
|
|
106
|
+
const previous = words[index - 1];
|
|
107
|
+
/*
|
|
108
|
+
* The second word of a two-word name keeps its capital, alone or as
|
|
109
|
+
* the first part of a compound ("Google Cloud-projekt" in Danish).
|
|
110
|
+
*/
|
|
111
|
+
const followsPairStart = (part) => {
|
|
112
|
+
return (previous !== undefined &&
|
|
113
|
+
PROPER_NOUN_PAIRS.some((pair) => {
|
|
114
|
+
return pair[0] === previous && pair[1] === part;
|
|
115
|
+
}));
|
|
116
|
+
};
|
|
117
|
+
return word
|
|
118
|
+
.split("-")
|
|
119
|
+
.map((part, partIndex) => {
|
|
120
|
+
if (keepsItsCase(part) ||
|
|
121
|
+
(partIndex === 0 && followsPairStart(part))) {
|
|
122
|
+
return part;
|
|
123
|
+
}
|
|
124
|
+
try {
|
|
125
|
+
return part.toLocaleLowerCase(language || exports.DEFAULT_LANGUAGE);
|
|
126
|
+
}
|
|
127
|
+
catch (_a) {
|
|
128
|
+
return part.toLowerCase();
|
|
129
|
+
}
|
|
130
|
+
})
|
|
131
|
+
.join("-");
|
|
132
|
+
})
|
|
133
|
+
.join(" ");
|
|
134
|
+
};
|
|
135
|
+
exports.toSentenceTerm = toSentenceTerm;
|
|
136
|
+
/*
|
|
137
|
+
* The CLDR plural category of `count` in `language` - "one", "few",
|
|
138
|
+
* "many", "other"... - which is also i18next's key suffix for that form.
|
|
139
|
+
*/
|
|
140
|
+
const getPluralCategory = (language, count) => {
|
|
141
|
+
try {
|
|
142
|
+
return new Intl.PluralRules(language).select(count);
|
|
143
|
+
}
|
|
144
|
+
catch (_a) {
|
|
145
|
+
return count === 1 ? "one" : "other";
|
|
146
|
+
}
|
|
147
|
+
};
|
|
148
|
+
exports.getPluralCategory = getPluralCategory;
|
|
149
|
+
const PLACEHOLDER = /\{\{\s*([\w.]+)\s*\}\}/g;
|
|
150
|
+
/*
|
|
151
|
+
* Slot markers are private-use characters, which no translation or name
|
|
152
|
+
* contains: "\uE000" + the slot's index + "\uE000" (getSentenceParts).
|
|
153
|
+
*/
|
|
154
|
+
const SLOT_PATTERN = /\uE000(\d+)\uE000/;
|
|
155
|
+
// One slot's marker, alone.
|
|
156
|
+
const WHOLE_SLOT_PATTERN = /^\uE000\d+\uE000$/;
|
|
157
|
+
/*
|
|
158
|
+
* A marker no name contains, put where the slot goes so the translated
|
|
159
|
+
* sentence can be cut around it (translateTemplateAround).
|
|
160
|
+
*/
|
|
161
|
+
const SLOT_MARKER = "\u0000";
|
|
162
|
+
/*
|
|
163
|
+
* Whether a value is where a caller draws an element of its own - a name in
|
|
164
|
+
* bold, a link - between the pieces of the sentence.
|
|
165
|
+
*/
|
|
166
|
+
const isSlotMarker = (value) => {
|
|
167
|
+
return value === SLOT_MARKER || WHOLE_SLOT_PATTERN.test(value);
|
|
168
|
+
};
|
|
169
|
+
/*
|
|
170
|
+
* The {{placeholders}} a template names, each once, in the order they first
|
|
171
|
+
* appear - read with the same rule fillTemplate fills them by. A caller that
|
|
172
|
+
* draws some of them as elements (TranslatedSentence's slots) passes exactly
|
|
173
|
+
* these: a slot the sentence lacks, or one left over, falls back to English.
|
|
174
|
+
*/
|
|
175
|
+
const getTemplatePlaceholders = (template) => {
|
|
176
|
+
const names = [];
|
|
177
|
+
for (const match of template.matchAll(PLACEHOLDER)) {
|
|
178
|
+
const name = match[1] || "";
|
|
179
|
+
if (name && !names.includes(name)) {
|
|
180
|
+
names.push(name);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
return names;
|
|
184
|
+
};
|
|
185
|
+
exports.getTemplatePlaceholders = getTemplatePlaceholders;
|
|
186
|
+
// Whether a template has words of its own besides its placeholders.
|
|
187
|
+
const LETTER = /\p{L}/u;
|
|
188
|
+
const hasWords = (template) => {
|
|
189
|
+
return LETTER.test(template.replace(PLACEHOLDER, ""));
|
|
190
|
+
};
|
|
191
|
+
// A value as the English sentence shows it.
|
|
192
|
+
const englishValue = (value) => {
|
|
193
|
+
if ((0, exports.isTranslatableTerm)(value)) {
|
|
194
|
+
return value.inSentence
|
|
195
|
+
? (0, exports.toSentenceTerm)(value.translatableTerm, exports.DEFAULT_LANGUAGE)
|
|
196
|
+
: value.translatableTerm.trim();
|
|
197
|
+
}
|
|
198
|
+
if ((0, exports.isComposedValue)(value)) {
|
|
199
|
+
return value.compose(getEnglishTranslator());
|
|
200
|
+
}
|
|
201
|
+
return String(value);
|
|
202
|
+
};
|
|
203
|
+
/*
|
|
204
|
+
* The values as an English sentence takes them: a date, a time or a duration
|
|
205
|
+
* written in the reader's language goes back to its English.
|
|
206
|
+
*/
|
|
207
|
+
const englishDateValues = (values) => {
|
|
208
|
+
var _a;
|
|
209
|
+
const result = {};
|
|
210
|
+
for (const key of Object.keys(values)) {
|
|
211
|
+
const value = values[key];
|
|
212
|
+
result[key] =
|
|
213
|
+
typeof value === "string" ? (_a = (0, DateLanguage_1.getEnglishOf)(value)) !== null && _a !== void 0 ? _a : value : value;
|
|
214
|
+
}
|
|
215
|
+
return result;
|
|
216
|
+
};
|
|
217
|
+
/*
|
|
218
|
+
* Every value as the English sentence shows it, as text: a date in the
|
|
219
|
+
* reader's language goes back to its English (englishDateValues).
|
|
220
|
+
*/
|
|
221
|
+
const englishTextValues = (values) => {
|
|
222
|
+
const dated = englishDateValues(values);
|
|
223
|
+
const result = {};
|
|
224
|
+
for (const key of Object.keys(dated)) {
|
|
225
|
+
result[key] = englishValue(dated[key]);
|
|
226
|
+
}
|
|
227
|
+
return result;
|
|
228
|
+
};
|
|
229
|
+
/*
|
|
230
|
+
* The values as a sentence that reads `direction` holds them: each set
|
|
231
|
+
* apart in a Unicode isolate where it could move the words around it
|
|
232
|
+
* (ReadingDirection's setApartInSentence) - in a Persian sentence a name in
|
|
233
|
+
* Latin letters, an address, a time or a count; in an English one a
|
|
234
|
+
* Persian name. A slot's marker (TranslatedSentence, translateTemplateAround)
|
|
235
|
+
* is set apart in a sentence read right to left when asked to
|
|
236
|
+
* (SentenceOptions' setsSlotsApart), so what is drawn there as an element is
|
|
237
|
+
* too; otherwise it is left as it is.
|
|
238
|
+
*/
|
|
239
|
+
const setApartValues = (values, direction, setsSlotsApart) => {
|
|
240
|
+
const result = {};
|
|
241
|
+
for (const key of Object.keys(values)) {
|
|
242
|
+
const value = values[key];
|
|
243
|
+
if (isSlotMarker(value)) {
|
|
244
|
+
result[key] =
|
|
245
|
+
setsSlotsApart && direction === ReadingDirection_1.RIGHT_TO_LEFT
|
|
246
|
+
? `${ReadingDirection_1.FIRST_STRONG_ISOLATE}${value}${ReadingDirection_1.POP_DIRECTIONAL_ISOLATE}`
|
|
247
|
+
: value;
|
|
248
|
+
continue;
|
|
249
|
+
}
|
|
250
|
+
result[key] = (0, ReadingDirection_1.setApartInSentence)(value, direction);
|
|
251
|
+
}
|
|
252
|
+
return result;
|
|
253
|
+
};
|
|
254
|
+
/*
|
|
255
|
+
* Fills {{key}} placeholders from values. A placeholder with no value is left
|
|
256
|
+
* as it is, which a test notices and a reader at least recognises as a slot.
|
|
257
|
+
* Each value goes in literally: braces or "$t(" inside a name are never
|
|
258
|
+
* looked up again.
|
|
259
|
+
*/
|
|
260
|
+
const fillTemplate = (template, values = {}) => {
|
|
261
|
+
return template.replace(PLACEHOLDER, (match, key) => {
|
|
262
|
+
return Object.prototype.hasOwnProperty.call(values, key)
|
|
263
|
+
? englishValue(values[key])
|
|
264
|
+
: match;
|
|
265
|
+
});
|
|
266
|
+
};
|
|
267
|
+
exports.fillTemplate = fillTemplate;
|
|
268
|
+
const createTranslator = (lookup, language) => {
|
|
269
|
+
const activeLanguage = language || exports.DEFAULT_LANGUAGE;
|
|
270
|
+
// The stored wording for `key`, or undefined when nothing has one.
|
|
271
|
+
const find = (key) => {
|
|
272
|
+
if (!lookup || !key) {
|
|
273
|
+
return undefined;
|
|
274
|
+
}
|
|
275
|
+
try {
|
|
276
|
+
const result = lookup(key);
|
|
277
|
+
return typeof result === "string" && result.length > 0 && result !== key
|
|
278
|
+
? result
|
|
279
|
+
: undefined;
|
|
280
|
+
}
|
|
281
|
+
catch (_a) {
|
|
282
|
+
return undefined;
|
|
283
|
+
}
|
|
284
|
+
};
|
|
285
|
+
const translateText = (text) => {
|
|
286
|
+
var _a;
|
|
287
|
+
if (typeof text !== "string" || text.length === 0) {
|
|
288
|
+
return text;
|
|
289
|
+
}
|
|
290
|
+
return (_a = find(text)) !== null && _a !== void 0 ? _a : text;
|
|
291
|
+
};
|
|
292
|
+
const hasTranslation = (text) => {
|
|
293
|
+
return find(text) !== undefined;
|
|
294
|
+
};
|
|
295
|
+
const translateTerm = (text, options) => {
|
|
296
|
+
var _a;
|
|
297
|
+
if (!text) {
|
|
298
|
+
return "";
|
|
299
|
+
}
|
|
300
|
+
const translated = (_a = find(text)) !== null && _a !== void 0 ? _a : text;
|
|
301
|
+
if (!(options === null || options === void 0 ? void 0 : options.inSentence)) {
|
|
302
|
+
return translated.trim();
|
|
303
|
+
}
|
|
304
|
+
/*
|
|
305
|
+
* Cased the reader's way, translated or not: a German noun spelled as in
|
|
306
|
+
* English ("Labels", "Monitor") keeps its capital in a German sentence.
|
|
307
|
+
* An English sentence never comes here - it is filled by fillTemplate.
|
|
308
|
+
*/
|
|
309
|
+
return (0, exports.toSentenceTerm)(translated, activeLanguage);
|
|
310
|
+
};
|
|
311
|
+
// Every value as the translated sentence shows it.
|
|
312
|
+
const translatedValues = (values) => {
|
|
313
|
+
const result = {};
|
|
314
|
+
for (const key of Object.keys(values)) {
|
|
315
|
+
const value = values[key];
|
|
316
|
+
if ((0, exports.isTranslatableTerm)(value)) {
|
|
317
|
+
result[key] = translateTerm(value.translatableTerm, {
|
|
318
|
+
inSentence: value.inSentence,
|
|
319
|
+
});
|
|
320
|
+
}
|
|
321
|
+
else if ((0, exports.isComposedValue)(value)) {
|
|
322
|
+
result[key] = value.compose(translator);
|
|
323
|
+
}
|
|
324
|
+
else {
|
|
325
|
+
result[key] = String(value);
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
return result;
|
|
329
|
+
};
|
|
330
|
+
// The way the reader's language reads: its sentences', and their values'.
|
|
331
|
+
const readerDirection = (0, ReadingDirection_1.getReadingDirection)(activeLanguage);
|
|
332
|
+
/*
|
|
333
|
+
* The sentence is translated when its stored wording differs from the
|
|
334
|
+
* English one; then its terms are translated too. Otherwise the English
|
|
335
|
+
* sentence is filled with the English terms - except for a template with no
|
|
336
|
+
* words of its own ("{{action}} {{itemName}}"), which belongs to no
|
|
337
|
+
* language and always takes the reader's words.
|
|
338
|
+
*
|
|
339
|
+
* Asked to (SentenceOptions), each value is set apart from the sentence
|
|
340
|
+
* where it could move the words around it (setApartValues), by the way the
|
|
341
|
+
* sentence reads: the reader's language's, or English's.
|
|
342
|
+
*/
|
|
343
|
+
const fill = (stored, english, values, options) => {
|
|
344
|
+
const setsValuesApart = Boolean(options === null || options === void 0 ? void 0 : options.setsValuesApart);
|
|
345
|
+
const setsSlotsApart = Boolean(options === null || options === void 0 ? void 0 : options.setsSlotsApart);
|
|
346
|
+
if (stored === undefined || stored === english) {
|
|
347
|
+
if (hasWords(english)) {
|
|
348
|
+
return setsValuesApart
|
|
349
|
+
? (0, exports.fillTemplate)(english, setApartValues(englishTextValues(values), ReadingDirection_1.LEFT_TO_RIGHT, setsSlotsApart))
|
|
350
|
+
: (0, exports.fillTemplate)(english, englishDateValues(values));
|
|
351
|
+
}
|
|
352
|
+
return (0, exports.fillTemplate)(english, setsValuesApart
|
|
353
|
+
? setApartValues(translatedValues(values), readerDirection, setsSlotsApart)
|
|
354
|
+
: translatedValues(values));
|
|
355
|
+
}
|
|
356
|
+
return (0, exports.fillTemplate)(stored, setsValuesApart
|
|
357
|
+
? setApartValues(translatedValues(values), readerDirection, setsSlotsApart)
|
|
358
|
+
: translatedValues(values));
|
|
359
|
+
};
|
|
360
|
+
const translateTemplate = (template, values = {}, options) => {
|
|
361
|
+
return fill(find(template), template, values, options);
|
|
362
|
+
};
|
|
363
|
+
const formatNumber = (value) => {
|
|
364
|
+
try {
|
|
365
|
+
return value.toLocaleString(activeLanguage);
|
|
366
|
+
}
|
|
367
|
+
catch (_a) {
|
|
368
|
+
return value.toLocaleString();
|
|
369
|
+
}
|
|
370
|
+
};
|
|
371
|
+
/*
|
|
372
|
+
* The form for `count` the way i18next resolves it: the language's own
|
|
373
|
+
* category ("few" for 3 in Russian) under the key plus "_few", else the key
|
|
374
|
+
* itself, which holds the language's general (other) form.
|
|
375
|
+
*/
|
|
376
|
+
const findPlural = (key, count) => {
|
|
377
|
+
const category = (0, exports.getPluralCategory)(activeLanguage, count);
|
|
378
|
+
if (category !== "other") {
|
|
379
|
+
const form = find(`${key}_${category}`);
|
|
380
|
+
if (form !== undefined) {
|
|
381
|
+
return form;
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
return find(key);
|
|
385
|
+
};
|
|
386
|
+
const translatePlural = (template, count, values = {}, options) => {
|
|
387
|
+
// English has two forms: exactly one, and everything else.
|
|
388
|
+
const english = count === 1 ? template.one : template.other;
|
|
389
|
+
const stored = findPlural(template.other, count);
|
|
390
|
+
/*
|
|
391
|
+
* An English form left in a locale is a placeholder, not a translation:
|
|
392
|
+
* the sentence is English, in English's form for the count. Russian puts
|
|
393
|
+
* 21 in its "one" form, French puts 0 there - neither may borrow the
|
|
394
|
+
* English "1 row" for it.
|
|
395
|
+
*/
|
|
396
|
+
const translated = stored === template.one || stored === template.other ? undefined : stored;
|
|
397
|
+
// {{count}} is written the reader's way unless the caller passes its own.
|
|
398
|
+
return fill(translated, english, Object.assign({ count: formatNumber(count) }, values), options);
|
|
399
|
+
};
|
|
400
|
+
// A composed value in a translated sentence is built with this translator.
|
|
401
|
+
const translator = {
|
|
402
|
+
language: activeLanguage,
|
|
403
|
+
translateText,
|
|
404
|
+
hasTranslation,
|
|
405
|
+
translateTemplate,
|
|
406
|
+
translatePlural,
|
|
407
|
+
translateTerm,
|
|
408
|
+
formatNumber,
|
|
409
|
+
};
|
|
410
|
+
return translator;
|
|
411
|
+
};
|
|
412
|
+
exports.createTranslator = createTranslator;
|
|
413
|
+
/*
|
|
414
|
+
* The translator an English sentence's composed values are built with: no
|
|
415
|
+
* lookup, so every piece is English too.
|
|
416
|
+
*/
|
|
417
|
+
let englishTranslator = null;
|
|
418
|
+
const getEnglishTranslator = () => {
|
|
419
|
+
if (!englishTranslator) {
|
|
420
|
+
englishTranslator = (0, exports.createTranslator)(undefined, exports.DEFAULT_LANGUAGE);
|
|
421
|
+
}
|
|
422
|
+
return englishTranslator;
|
|
423
|
+
};
|
|
424
|
+
// How a language separates a list's items, where it is not a comma.
|
|
425
|
+
const LIST_SEPARATORS = {
|
|
426
|
+
fa: "، ",
|
|
427
|
+
ja: "、",
|
|
428
|
+
zh: "、",
|
|
429
|
+
};
|
|
430
|
+
/*
|
|
431
|
+
* Names listed with the language's own separator and no "and" or "or": "a, b,
|
|
432
|
+
* c", "a、b、c". For a list that says what is left out rather than a clause.
|
|
433
|
+
*/
|
|
434
|
+
const formatList = (names, translator) => {
|
|
435
|
+
return names.join(LIST_SEPARATORS[getBaseLanguage(translator.language)] || ", ");
|
|
436
|
+
};
|
|
437
|
+
exports.formatList = formatList;
|
|
438
|
+
/*
|
|
439
|
+
* The language a sentence is drawn in: the reader's when their language has
|
|
440
|
+
* its own wording of it, or when it has no words of its own ("{{label}}
|
|
441
|
+
* {{time}}"), and English otherwise. A date drawn inside the sentence (a
|
|
442
|
+
* TranslatedSentence slot) is written in it.
|
|
443
|
+
*/
|
|
444
|
+
const getSentenceLanguage = (translator, template) => {
|
|
445
|
+
const english = typeof template === "string" ? template : template.other;
|
|
446
|
+
if (!hasWords(english) || translator.hasTranslation(english)) {
|
|
447
|
+
return translator.language;
|
|
448
|
+
}
|
|
449
|
+
return exports.DEFAULT_LANGUAGE;
|
|
450
|
+
};
|
|
451
|
+
exports.getSentenceLanguage = getSentenceLanguage;
|
|
452
|
+
/*
|
|
453
|
+
* An action on a named kind of thing - "Create Incident", "Edit Monitor",
|
|
454
|
+
* "Delete Status Page" - from a template with an {{itemName}} slot. The whole
|
|
455
|
+
* English phrase is looked up first, so a locale can word one model's button
|
|
456
|
+
* its own way (gender, case); otherwise the template is filled with the
|
|
457
|
+
* locale's word for the name. `values` fill any other placeholder - the verb
|
|
458
|
+
* of "{{action}} {{itemName}}", for one.
|
|
459
|
+
*/
|
|
460
|
+
const translateNamedAction = (translator, data) => {
|
|
461
|
+
// The slot is {{itemName}}, or {{itemsName}} for a plural name.
|
|
462
|
+
const phrase = (0, exports.fillTemplate)(data.template, Object.assign(Object.assign({}, (data.values || {})), { itemName: data.itemName.trim(), itemsName: data.itemName.trim() }));
|
|
463
|
+
if (translator.hasTranslation(phrase)) {
|
|
464
|
+
return translator.translateText(phrase) || phrase;
|
|
465
|
+
}
|
|
466
|
+
return translator.translateTemplate(data.template, Object.assign(Object.assign({}, (data.values || {})), { itemName: (0, exports.translatableTerm)(data.itemName), itemsName: (0, exports.translatableTerm)(data.itemName) }));
|
|
467
|
+
};
|
|
468
|
+
exports.translateNamedAction = translateNamedAction;
|
|
469
|
+
/*
|
|
470
|
+
* A translated sentence in pieces, for a caller that draws some of its values
|
|
471
|
+
* itself - a field name in bold, a link - between the pieces of text.
|
|
472
|
+
* `slots` are the placeholders the caller draws; `values` fill the rest.
|
|
473
|
+
*
|
|
474
|
+
* A translation that lost one of the slots or repeated it cannot be drawn
|
|
475
|
+
* whole, so the English sentence is used instead.
|
|
476
|
+
*/
|
|
477
|
+
const getSentenceParts = (data) => {
|
|
478
|
+
return (0, exports.getSentencePartsAndLanguage)(data).parts;
|
|
479
|
+
};
|
|
480
|
+
exports.getSentenceParts = getSentenceParts;
|
|
481
|
+
// getSentenceParts, with the language the sentence came out in.
|
|
482
|
+
const getSentencePartsAndLanguage = (data) => {
|
|
483
|
+
var _a;
|
|
484
|
+
const withMarkers = Object.assign({}, (data.values || {}));
|
|
485
|
+
data.slots.forEach((slot, index) => {
|
|
486
|
+
withMarkers[slot] = `\uE000${index}\uE000`;
|
|
487
|
+
});
|
|
488
|
+
const split = (sentence) => {
|
|
489
|
+
const pieces = sentence.split(SLOT_PATTERN);
|
|
490
|
+
const parts = [];
|
|
491
|
+
const seen = [];
|
|
492
|
+
pieces.forEach((piece, index) => {
|
|
493
|
+
if (index % 2 === 1) {
|
|
494
|
+
const slotIndex = Number(piece);
|
|
495
|
+
seen.push(slotIndex);
|
|
496
|
+
parts.push({ kind: "slot", slot: data.slots[slotIndex] });
|
|
497
|
+
}
|
|
498
|
+
else if (piece) {
|
|
499
|
+
parts.push({ kind: "text", text: piece });
|
|
500
|
+
}
|
|
501
|
+
});
|
|
502
|
+
const isWhole = seen.length === data.slots.length &&
|
|
503
|
+
data.slots.every((_slot, index) => {
|
|
504
|
+
return seen.includes(index);
|
|
505
|
+
});
|
|
506
|
+
return isWhole ? parts : null;
|
|
507
|
+
};
|
|
508
|
+
const count = (_a = data.count) !== null && _a !== void 0 ? _a : 0;
|
|
509
|
+
const isPlural = typeof data.template !== "string";
|
|
510
|
+
const englishTemplate = typeof data.template === "string"
|
|
511
|
+
? data.template
|
|
512
|
+
: count === 1
|
|
513
|
+
? data.template.one
|
|
514
|
+
: data.template.other;
|
|
515
|
+
/*
|
|
516
|
+
* Drawn on the page and nothing else: its values (and its slots, in a
|
|
517
|
+
* sentence read right to left) are set apart from its words
|
|
518
|
+
* (SentenceOptions).
|
|
519
|
+
*/
|
|
520
|
+
const options = {
|
|
521
|
+
setsValuesApart: true,
|
|
522
|
+
setsSlotsApart: Boolean(data.setsSlotsApart),
|
|
523
|
+
};
|
|
524
|
+
const translated = typeof data.template === "string"
|
|
525
|
+
? data.translator.translateTemplate(data.template, withMarkers, options)
|
|
526
|
+
: data.translator.translatePlural(data.template, count, withMarkers, options);
|
|
527
|
+
const englishValues = isPlural
|
|
528
|
+
? Object.assign({ count: data.translator.formatNumber(count) }, withMarkers) : withMarkers;
|
|
529
|
+
const translatedParts = split(translated);
|
|
530
|
+
if (translatedParts) {
|
|
531
|
+
return {
|
|
532
|
+
parts: translatedParts,
|
|
533
|
+
language: (0, exports.getSentenceLanguage)(data.translator, data.template),
|
|
534
|
+
};
|
|
535
|
+
}
|
|
536
|
+
return {
|
|
537
|
+
parts: split((0, exports.fillTemplate)(englishTemplate, setApartValues(englishTextValues(englishValues), ReadingDirection_1.LEFT_TO_RIGHT, false))) || [
|
|
538
|
+
{
|
|
539
|
+
kind: "text",
|
|
540
|
+
text: (0, exports.fillTemplate)(englishTemplate, englishDateValues(Object.assign(Object.assign({}, (isPlural ? { count: data.translator.formatNumber(count) } : {})), (data.values || {})))),
|
|
541
|
+
},
|
|
542
|
+
],
|
|
543
|
+
language: exports.DEFAULT_LANGUAGE,
|
|
544
|
+
};
|
|
545
|
+
};
|
|
546
|
+
exports.getSentencePartsAndLanguage = getSentencePartsAndLanguage;
|
|
547
|
+
/*
|
|
548
|
+
* The translated sentence cut in two around one {{slot}}, for a caller that
|
|
549
|
+
* draws the slot's value itself - in bold, say - between the two halves,
|
|
550
|
+
* in `translator`'s language (translateTemplateAround, outside React: the
|
|
551
|
+
* global i18next instance's).
|
|
552
|
+
*
|
|
553
|
+
* The value never goes through the translation: whatever a name contains
|
|
554
|
+
* (braces, "$t(", markup), it is drawn as text by the caller.
|
|
555
|
+
*/
|
|
556
|
+
const getTemplateAround = (translator, template, slot, values = {}, options) => {
|
|
557
|
+
const withMarker = Object.assign(Object.assign({}, values), { [slot]: SLOT_MARKER });
|
|
558
|
+
const split = (sentence) => {
|
|
559
|
+
const parts = sentence.split(SLOT_MARKER);
|
|
560
|
+
if (parts.length !== 2) {
|
|
561
|
+
return null;
|
|
562
|
+
}
|
|
563
|
+
return { before: parts[0], after: parts[1] };
|
|
564
|
+
};
|
|
565
|
+
/*
|
|
566
|
+
* A translation that lost its slot, or repeated it, cannot be drawn with the
|
|
567
|
+
* name in it - fall back to English rather than drop the name.
|
|
568
|
+
*
|
|
569
|
+
* Drawn on the page and nothing else: the values, and the slot in a
|
|
570
|
+
* sentence read right to left unless its halves are boxes of their own
|
|
571
|
+
* (TemplateAroundOptions), set apart from its words (SentenceOptions).
|
|
572
|
+
*/
|
|
573
|
+
return (split(translator.translateTemplate(template, withMarker, {
|
|
574
|
+
setsValuesApart: true,
|
|
575
|
+
setsSlotsApart: (options === null || options === void 0 ? void 0 : options.setsSlotApart) !== false,
|
|
576
|
+
})) ||
|
|
577
|
+
split((0, exports.fillTemplate)(template, englishDateValues(withMarker))) || {
|
|
578
|
+
before: (0, exports.fillTemplate)(template, englishDateValues(values)),
|
|
579
|
+
after: "",
|
|
580
|
+
});
|
|
581
|
+
};
|
|
582
|
+
exports.getTemplateAround = getTemplateAround;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import commonJsModule from "./Translator.js";
|
|
2
|
+
export const DEFAULT_LANGUAGE = commonJsModule.DEFAULT_LANGUAGE;
|
|
3
|
+
export const composedValue = commonJsModule.composedValue;
|
|
4
|
+
export const createTranslator = commonJsModule.createTranslator;
|
|
5
|
+
export const fillTemplate = commonJsModule.fillTemplate;
|
|
6
|
+
export const formatList = commonJsModule.formatList;
|
|
7
|
+
export const getPluralCategory = commonJsModule.getPluralCategory;
|
|
8
|
+
export const getSentenceLanguage = commonJsModule.getSentenceLanguage;
|
|
9
|
+
export const getSentenceParts = commonJsModule.getSentenceParts;
|
|
10
|
+
export const getSentencePartsAndLanguage = commonJsModule.getSentencePartsAndLanguage;
|
|
11
|
+
export const getTemplateAround = commonJsModule.getTemplateAround;
|
|
12
|
+
export const getTemplatePlaceholders = commonJsModule.getTemplatePlaceholders;
|
|
13
|
+
export const isComposedValue = commonJsModule.isComposedValue;
|
|
14
|
+
export const isTranslatableTerm = commonJsModule.isTranslatableTerm;
|
|
15
|
+
export const toSentenceTerm = commonJsModule.toSentenceTerm;
|
|
16
|
+
export const translatableTerm = commonJsModule.translatableTerm;
|
|
17
|
+
export const translateNamedAction = commonJsModule.translateNamedAction;
|
|
18
|
+
export const translationKey = commonJsModule.translationKey;
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.AllVideoCallProviders = void 0;
|
|
4
7
|
exports.isVideoCallProvider = isVideoCallProvider;
|
|
@@ -6,6 +9,7 @@ exports.getVideoCallProviderDisplayName = getVideoCallProviderDisplayName;
|
|
|
6
9
|
exports.getVideoCallNoun = getVideoCallNoun;
|
|
7
10
|
exports.getVideoCallLabel = getVideoCallLabel;
|
|
8
11
|
exports.detectVideoCallProviderFromUrl = detectVideoCallProviderFromUrl;
|
|
12
|
+
const MicrosoftTeamsCloud_1 = __importDefault(require("../Workspace/MicrosoftTeamsCloud"));
|
|
9
13
|
/*
|
|
10
14
|
* Where an incident or alert call is held. The value is stored on
|
|
11
15
|
* VideoCallConnection.provider (a provider a project connects once) and on
|
|
@@ -117,9 +121,8 @@ function detectVideoCallProviderFromUrl(url) {
|
|
|
117
121
|
if (hostname === "meet.google.com") {
|
|
118
122
|
return VideoCallProvider.GoogleMeet;
|
|
119
123
|
}
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
hostname === "teams.cloud.microsoft") {
|
|
124
|
+
// A Teams meeting's link, in any Microsoft cloud (GCC High and DoD too).
|
|
125
|
+
if (MicrosoftTeamsCloud_1.default.isTeamsMeetingHost(hostname)) {
|
|
123
126
|
return VideoCallProvider.MicrosoftTeams;
|
|
124
127
|
}
|
|
125
128
|
if (hostname === "app.slack.com" &&
|
|
@@ -11,11 +11,13 @@ declare enum ComponentID {
|
|
|
11
11
|
MattermostSendMessageToChannel = "mattermost-send-message-to-channel",
|
|
12
12
|
Schedule = "schedule",
|
|
13
13
|
JavaScriptCode = "javascript",
|
|
14
|
+
JavaScriptCheck = "javascript-check",
|
|
14
15
|
Manual = "manual",
|
|
15
16
|
JsonToText = "json-to-text",
|
|
16
17
|
TextToJson = "text-to-json",
|
|
17
18
|
MergeJson = "merge-json",
|
|
18
19
|
ApiGet = "api-get",
|
|
20
|
+
ApiGetById = "api-get-by-id",
|
|
19
21
|
ApiPut = "api-put",
|
|
20
22
|
ApiPost = "api-post",
|
|
21
23
|
ApiDelete = "api-delete",
|
|
@@ -26,6 +28,9 @@ declare enum ComponentID {
|
|
|
26
28
|
WorkflowRun = "workflow-run",
|
|
27
29
|
Sleep = "sleep",
|
|
28
30
|
AIGenerateText = "ai-generate-text",
|
|
31
|
+
IncidentFromAnotherTool = "incident-from-another-tool",
|
|
32
|
+
AlertFromAnotherTool = "alert-from-another-tool",
|
|
33
|
+
ZabbixUpdateProblem = "zabbix-update-problem",
|
|
29
34
|
PageUsers = "page-users",
|
|
30
35
|
PageTeam = "page-team",
|
|
31
36
|
PageOnCall = "page-on-call",
|
|
@@ -11,11 +11,13 @@ declare enum ComponentID {
|
|
|
11
11
|
MattermostSendMessageToChannel = "mattermost-send-message-to-channel",
|
|
12
12
|
Schedule = "schedule",
|
|
13
13
|
JavaScriptCode = "javascript",
|
|
14
|
+
JavaScriptCheck = "javascript-check",
|
|
14
15
|
Manual = "manual",
|
|
15
16
|
JsonToText = "json-to-text",
|
|
16
17
|
TextToJson = "text-to-json",
|
|
17
18
|
MergeJson = "merge-json",
|
|
18
19
|
ApiGet = "api-get",
|
|
20
|
+
ApiGetById = "api-get-by-id",
|
|
19
21
|
ApiPut = "api-put",
|
|
20
22
|
ApiPost = "api-post",
|
|
21
23
|
ApiDelete = "api-delete",
|
|
@@ -26,6 +28,9 @@ declare enum ComponentID {
|
|
|
26
28
|
WorkflowRun = "workflow-run",
|
|
27
29
|
Sleep = "sleep",
|
|
28
30
|
AIGenerateText = "ai-generate-text",
|
|
31
|
+
IncidentFromAnotherTool = "incident-from-another-tool",
|
|
32
|
+
AlertFromAnotherTool = "alert-from-another-tool",
|
|
33
|
+
ZabbixUpdateProblem = "zabbix-update-problem",
|
|
29
34
|
PageUsers = "page-users",
|
|
30
35
|
PageTeam = "page-team",
|
|
31
36
|
PageOnCall = "page-on-call",
|