@oneuptime/common 11.5.9 → 11.5.11
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/Index.ts +13 -0
- package/Models/AnalyticsModels/MetricItemAggMV1mByContainer.ts +178 -0
- package/Models/AnalyticsModels/MetricItemAggMV1mByK8sCluster.ts +179 -0
- package/Models/AnalyticsModels/MetricItemAggMV1mByService.ts +179 -0
- package/Models/AnalyticsModels/NetworkFlow.ts +397 -0
- package/Models/DatabaseModels/EnterpriseLicenseInstance.ts +18 -0
- package/Models/DatabaseModels/GlobalConfig.ts +36 -0
- package/Models/DatabaseModels/Index.ts +2 -0
- package/Models/DatabaseModels/MarketingConversion.ts +198 -0
- package/Models/DatabaseModels/MetricSavedView.ts +34 -0
- package/Models/DatabaseModels/MetricType.ts +74 -0
- package/Models/DatabaseModels/NetworkDevice.ts +332 -0
- package/Models/DatabaseModels/NetworkDeviceDiscoveryScan.ts +113 -0
- package/Models/DatabaseModels/NetworkInterface.ts +58 -0
- package/Models/DatabaseModels/Project.ts +37 -0
- package/Models/DatabaseModels/User.ts +37 -0
- package/Server/API/BaseAnalyticsAPI.ts +23 -0
- package/Server/API/EnterpriseLicenseAPI.ts +14 -0
- package/Server/EnvironmentConfig.ts +84 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1784191414522-AddCounterSemanticsToMetricType.ts +38 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1784191414600-AddViewTypeToMetricSavedView.ts +28 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1784211212164-AddNetworkDeviceInventoryAndDiscoverySchedule.ts +108 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1784218257664-AddEnterpriseLicenseNotificationColumns.ts +31 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1784293516000-AddAttributionColumnsToUserAndProject.ts +29 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1784298000000-AddMarketingConversionTable.ts +35 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1784401962564-MigrationName.ts +101 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts +14 -0
- package/Server/Services/AnalyticsDatabaseService.ts +70 -1
- package/Server/Services/IncidentService.ts +13 -0
- package/Server/Services/Index.ts +10 -0
- package/Server/Services/MarketingConversionService.ts +10 -0
- package/Server/Services/MetricItemAggMV1mByContainerService.ts +31 -0
- package/Server/Services/MetricItemAggMV1mByK8sClusterService.ts +31 -0
- package/Server/Services/MetricItemAggMV1mByServiceService.ts +31 -0
- package/Server/Services/MetricService.ts +970 -122
- package/Server/Services/MonitorService.ts +14 -0
- package/Server/Services/NetworkDeviceOwnerTeamService.ts +42 -0
- package/Server/Services/NetworkDeviceOwnerUserService.ts +106 -0
- package/Server/Services/NetworkFlowService.ts +11 -0
- package/Server/Services/OnCallDutyPolicyService.ts +11 -1
- package/Server/Services/ProjectService.ts +136 -0
- package/Server/Services/SpanService.ts +13 -9
- package/Server/Services/StatusPageService.ts +10 -0
- package/Server/Services/TeamMemberService.ts +11 -0
- package/Server/Services/UserService.ts +59 -0
- package/Server/Types/AnalyticsDatabase/AggregateBy.ts +37 -7
- package/Server/Utils/Attribution.ts +99 -0
- package/Server/Utils/Marketing/ConversionUploadProvider.ts +103 -0
- package/Server/Utils/Marketing/ConversionUploadProviders.ts +22 -0
- package/Server/Utils/Marketing/Providers/GoogleAds.ts +270 -0
- package/Server/Utils/Marketing/Providers/LinkedIn.ts +147 -0
- package/Server/Utils/Marketing/Providers/Meta.ts +148 -0
- package/Server/Utils/Marketing/Providers/MicrosoftAds.ts +196 -0
- package/Server/Utils/Marketing/Providers/Reddit.ts +178 -0
- package/Server/Utils/Monitor/MonitorAlert.ts +71 -7
- package/Server/Utils/Monitor/MonitorCriteriaEvaluator.ts +31 -19
- package/Server/Utils/Monitor/MonitorIncident.ts +71 -7
- package/Server/Utils/Monitor/MonitorMetricUtil.ts +57 -0
- package/Server/Utils/Monitor/MonitorTemplateUtil.ts +94 -0
- package/Server/Utils/Monitor/NetworkDeviceHydrationUtil.ts +15 -0
- package/Server/Utils/Monitor/NetworkInventoryUtil.ts +125 -14
- package/Server/Utils/ProductAnalytics.ts +133 -0
- package/Server/Utils/Telemetry/Telemetry.ts +39 -0
- package/Server/Utils/Telemetry/TelemetryEntity.ts +21 -0
- package/Tests/Server/API/BaseAnalyticsAPI.test.ts +72 -0
- package/Tests/Server/Infrastructure/SemaphorePermit.test.ts +9 -1
- package/Tests/Server/Services/AnalyticsDatabaseService.test.ts +21 -2
- package/Tests/Server/Services/MetricEntityMVKeyParity.test.ts +173 -0
- package/Tests/Server/Services/MetricServiceAggregate.test.ts +1391 -0
- package/Tests/Server/Services/NetworkDeviceOwnerServices.test.ts +260 -0
- package/Tests/Server/Utils/Monitor/MonitorTemplateUtilNetworkDevice.test.ts +389 -0
- package/Tests/Server/Utils/Monitor/NetworkInventoryUtil.test.ts +764 -0
- package/Tests/Types/BaseDatabase/AggregationIntervalUtil.test.ts +111 -2
- package/Tests/Types/Database/EndsWith.test.ts +64 -0
- package/Tests/Types/Database/GreaterThan.test.ts +62 -0
- package/Tests/Types/Database/GreaterThanOrEqual.test.ts +65 -0
- package/Tests/Types/Database/GreaterThanOrNull.test.ts +63 -0
- package/Tests/Types/Database/Includes.test.ts +65 -0
- package/Tests/Types/Database/IncludesAll.test.ts +65 -0
- package/Tests/Types/Database/IncludesNone.test.ts +65 -0
- package/Tests/Types/Database/IsNull.test.ts +44 -0
- package/Tests/Types/Database/LessThan.test.ts +62 -0
- package/Tests/Types/Database/LessThanOrEqual.test.ts +62 -0
- package/Tests/Types/Database/LessThanOrNull.test.ts +62 -0
- package/Tests/Types/Database/MultiSearch.test.ts +81 -0
- package/Tests/Types/Database/NotContains.test.ts +64 -0
- package/Tests/Types/Database/NotNull.test.ts +44 -0
- package/Tests/Types/Database/StartsWith.test.ts +64 -0
- package/Tests/Types/Monitor/MonitorStepSqlMonitor.test.ts +83 -1
- package/Tests/Types/Monitor/SnmpV3EnumParsing.test.ts +247 -0
- package/Tests/Types/Monitor/SnmpVendorTemplate.test.ts +263 -0
- package/Tests/UI/Components/XAxis.test.ts +5 -3
- package/Tests/Utils/EnterpriseLicenseUsage.test.ts +76 -0
- package/Tests/Utils/Metrics/MetricExplorerUrl.test.ts +622 -0
- package/Tests/Utils/Metrics/MetricFormulaEvaluator.test.ts +474 -0
- package/Tests/Utils/Telemetry/HeartbeatAvailability.test.ts +52 -4
- package/Types/AnalyticsDatabase/AnalyticsTableName.ts +11 -0
- package/Types/BaseDatabase/AggregateBy.ts +31 -2
- package/Types/BaseDatabase/AggregatedResult.ts +22 -0
- package/Types/BaseDatabase/AggregationInterval.ts +11 -0
- package/Types/BaseDatabase/AggregationIntervalUtil.ts +30 -5
- package/Types/Dashboard/DashboardComponents/DashboardTraceChartComponent.ts +16 -0
- package/Types/Email/EmailTemplateType.ts +3 -0
- package/Types/Marketing/MarketingConversion.ts +11 -0
- package/Types/Metrics/MetricQueryConfigData.ts +21 -0
- package/Types/Metrics/MetricQueryData.ts +8 -0
- package/Types/Metrics/MetricViewData.ts +8 -0
- package/Types/Monitor/MonitorMetricType.ts +8 -0
- package/Types/Monitor/MonitorStep.ts +9 -0
- package/Types/Monitor/MonitorStepSqlMonitor.ts +12 -0
- package/Types/Monitor/MonitorType.ts +2 -1
- package/Types/Monitor/SSLMonitor/SslMonitorResponse.ts +17 -12
- package/Types/Monitor/SnmpMonitor/CdpNeighbor.ts +13 -0
- package/Types/Monitor/SnmpMonitor/NetworkTopology.ts +37 -3
- package/Types/Monitor/SnmpMonitor/SnmpAuthProtocol.ts +46 -0
- package/Types/Monitor/SnmpMonitor/SnmpEntityInfo.ts +15 -0
- package/Types/Monitor/SnmpMonitor/SnmpInterface.ts +8 -0
- package/Types/Monitor/SnmpMonitor/SnmpMonitorResponse.ts +17 -8
- package/Types/Monitor/SnmpMonitor/SnmpPrivProtocol.ts +53 -0
- package/Types/Monitor/SnmpMonitor/SnmpSecurityLevel.ts +43 -0
- package/Types/Monitor/SnmpMonitor/SnmpSystemInfo.ts +16 -0
- package/Types/Monitor/SnmpMonitor/SnmpVendorTemplate.ts +119 -3
- package/Types/NetFlow/NetworkFlowRecord.ts +25 -0
- package/Types/Syslog/SyslogMessage.ts +18 -0
- package/Types/Telemetry/TelemetrySavedViewState.ts +9 -0
- package/Types/Telemetry/TelemetrySavedViewType.ts +12 -0
- package/UI/Components/Charts/Area/AreaChart.tsx +51 -0
- package/UI/Components/Charts/Bar/BarChart.tsx +51 -1
- package/UI/Components/Charts/ChartGroup/ChartGroup.tsx +97 -26
- package/UI/Components/Charts/ChartLibrary/AreaChart/AreaChart.tsx +328 -1
- package/UI/Components/Charts/ChartLibrary/BarChart/BarChart.tsx +115 -0
- package/UI/Components/Charts/ChartLibrary/LineChart/LineChart.tsx +328 -1
- package/UI/Components/Charts/ChartLibrary/Types/ChartDataPoint.ts +7 -0
- package/UI/Components/Charts/ChartLibrary/Types/FormattedReferenceRegion.ts +15 -0
- package/UI/Components/Charts/ChartLibrary/Types/FormattedTimeReferenceLine.ts +13 -0
- package/UI/Components/Charts/Line/LineChart.tsx +51 -0
- package/UI/Components/Charts/Types/ReferenceRegionProps.ts +12 -0
- package/UI/Components/Charts/Types/TimeReferenceLineProps.ts +12 -0
- package/UI/Components/Charts/Types/XAxis/XAxisPrecision.ts +1 -0
- package/UI/Components/Charts/Utils/DataPoint.ts +0 -0
- package/UI/Components/Charts/Utils/TimeAnnotation.ts +169 -0
- package/UI/Components/Charts/Utils/XAxis.ts +28 -4
- package/UI/Components/Icon/Icon.tsx +33 -13
- package/UI/Components/Markdown.tsx/MarkdownViewer.tsx +9 -0
- package/UI/Components/MonitorTemplateVariables/TemplateVariablesCatalog.ts +67 -0
- package/UI/Components/Page/ModelPage.tsx +6 -1
- package/UI/Components/TelemetryViewer/components/SavedViewsDropdown.tsx +33 -4
- package/UI/Styles/Theme.css +10 -0
- package/UI/Utils/User.ts +41 -2
- package/Utils/Analytics.ts +8 -6
- package/Utils/EnterpriseLicense/EnterpriseLicenseUsage.ts +74 -0
- package/Utils/Metrics/MetricExplorerUrl.ts +771 -0
- package/Utils/Metrics/MetricFormulaEvaluator.ts +410 -46
- package/Utils/Monitor/NetworkTopologyUtil.ts +261 -49
- package/Utils/ValueFormatter.ts +22 -1
- package/build/dist/Models/AnalyticsModels/Index.js +13 -0
- package/build/dist/Models/AnalyticsModels/Index.js.map +1 -1
- package/build/dist/Models/AnalyticsModels/MetricItemAggMV1mByContainer.js +159 -0
- package/build/dist/Models/AnalyticsModels/MetricItemAggMV1mByContainer.js.map +1 -0
- package/build/dist/Models/AnalyticsModels/MetricItemAggMV1mByK8sCluster.js +158 -0
- package/build/dist/Models/AnalyticsModels/MetricItemAggMV1mByK8sCluster.js.map +1 -0
- package/build/dist/Models/AnalyticsModels/MetricItemAggMV1mByService.js +160 -0
- package/build/dist/Models/AnalyticsModels/MetricItemAggMV1mByService.js.map +1 -0
- package/build/dist/Models/AnalyticsModels/NetworkFlow.js +351 -0
- package/build/dist/Models/AnalyticsModels/NetworkFlow.js.map +1 -0
- package/build/dist/Models/DatabaseModels/EnterpriseLicenseInstance.js +19 -0
- package/build/dist/Models/DatabaseModels/EnterpriseLicenseInstance.js.map +1 -1
- package/build/dist/Models/DatabaseModels/GlobalConfig.js +38 -0
- package/build/dist/Models/DatabaseModels/GlobalConfig.js.map +1 -1
- package/build/dist/Models/DatabaseModels/Index.js +2 -0
- package/build/dist/Models/DatabaseModels/Index.js.map +1 -1
- package/build/dist/Models/DatabaseModels/MarketingConversion.js +219 -0
- package/build/dist/Models/DatabaseModels/MarketingConversion.js.map +1 -0
- package/build/dist/Models/DatabaseModels/MetricSavedView.js +35 -0
- package/build/dist/Models/DatabaseModels/MetricSavedView.js.map +1 -1
- package/build/dist/Models/DatabaseModels/MetricType.js +76 -0
- package/build/dist/Models/DatabaseModels/MetricType.js.map +1 -1
- package/build/dist/Models/DatabaseModels/NetworkDevice.js +341 -0
- package/build/dist/Models/DatabaseModels/NetworkDevice.js.map +1 -1
- package/build/dist/Models/DatabaseModels/NetworkDeviceDiscoveryScan.js +116 -0
- package/build/dist/Models/DatabaseModels/NetworkDeviceDiscoveryScan.js.map +1 -1
- package/build/dist/Models/DatabaseModels/NetworkInterface.js +60 -0
- package/build/dist/Models/DatabaseModels/NetworkInterface.js.map +1 -1
- package/build/dist/Models/DatabaseModels/Project.js +38 -0
- package/build/dist/Models/DatabaseModels/Project.js.map +1 -1
- package/build/dist/Models/DatabaseModels/User.js +38 -0
- package/build/dist/Models/DatabaseModels/User.js.map +1 -1
- package/build/dist/Server/API/BaseAnalyticsAPI.js +19 -0
- package/build/dist/Server/API/BaseAnalyticsAPI.js.map +1 -1
- package/build/dist/Server/API/EnterpriseLicenseAPI.js +8 -0
- package/build/dist/Server/API/EnterpriseLicenseAPI.js.map +1 -1
- package/build/dist/Server/EnvironmentConfig.js +51 -0
- package/build/dist/Server/EnvironmentConfig.js.map +1 -1
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1784191414522-AddCounterSemanticsToMetricType.js +27 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1784191414522-AddCounterSemanticsToMetricType.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1784191414600-AddViewTypeToMetricSavedView.js +21 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1784191414600-AddViewTypeToMetricSavedView.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1784211212164-AddNetworkDeviceInventoryAndDiscoverySchedule.js +47 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1784211212164-AddNetworkDeviceInventoryAndDiscoverySchedule.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1784218257664-AddEnterpriseLicenseNotificationColumns.js +16 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1784218257664-AddEnterpriseLicenseNotificationColumns.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1784293516000-AddAttributionColumnsToUserAndProject.js +18 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1784293516000-AddAttributionColumnsToUserAndProject.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1784298000000-AddMarketingConversionTable.js +20 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1784298000000-AddMarketingConversionTable.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1784401962564-MigrationName.js +40 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1784401962564-MigrationName.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js +14 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js.map +1 -1
- package/build/dist/Server/Services/AnalyticsDatabaseService.js +58 -4
- package/build/dist/Server/Services/AnalyticsDatabaseService.js.map +1 -1
- package/build/dist/Server/Services/IncidentService.js +12 -0
- package/build/dist/Server/Services/IncidentService.js.map +1 -1
- package/build/dist/Server/Services/Index.js +10 -0
- package/build/dist/Server/Services/Index.js.map +1 -1
- package/build/dist/Server/Services/MarketingConversionService.js +9 -0
- package/build/dist/Server/Services/MarketingConversionService.js.map +1 -0
- package/build/dist/Server/Services/MetricItemAggMV1mByContainerService.js +29 -0
- package/build/dist/Server/Services/MetricItemAggMV1mByContainerService.js.map +1 -0
- package/build/dist/Server/Services/MetricItemAggMV1mByK8sClusterService.js +29 -0
- package/build/dist/Server/Services/MetricItemAggMV1mByK8sClusterService.js.map +1 -0
- package/build/dist/Server/Services/MetricItemAggMV1mByServiceService.js +29 -0
- package/build/dist/Server/Services/MetricItemAggMV1mByServiceService.js.map +1 -0
- package/build/dist/Server/Services/MetricService.js +761 -125
- package/build/dist/Server/Services/MetricService.js.map +1 -1
- package/build/dist/Server/Services/MonitorService.js +18 -5
- package/build/dist/Server/Services/MonitorService.js.map +1 -1
- package/build/dist/Server/Services/NetworkDeviceOwnerTeamService.js +44 -0
- package/build/dist/Server/Services/NetworkDeviceOwnerTeamService.js.map +1 -1
- package/build/dist/Server/Services/NetworkDeviceOwnerUserService.js +88 -0
- package/build/dist/Server/Services/NetworkDeviceOwnerUserService.js.map +1 -1
- package/build/dist/Server/Services/NetworkFlowService.js +9 -0
- package/build/dist/Server/Services/NetworkFlowService.js.map +1 -0
- package/build/dist/Server/Services/OnCallDutyPolicyService.js +15 -6
- package/build/dist/Server/Services/OnCallDutyPolicyService.js.map +1 -1
- package/build/dist/Server/Services/ProjectService.js +107 -6
- package/build/dist/Server/Services/ProjectService.js.map +1 -1
- package/build/dist/Server/Services/SpanService.js +8 -6
- package/build/dist/Server/Services/SpanService.js.map +1 -1
- package/build/dist/Server/Services/StatusPageService.js +10 -0
- package/build/dist/Server/Services/StatusPageService.js.map +1 -1
- package/build/dist/Server/Services/TeamMemberService.js +11 -0
- package/build/dist/Server/Services/TeamMemberService.js.map +1 -1
- package/build/dist/Server/Services/UserService.js +52 -0
- package/build/dist/Server/Services/UserService.js.map +1 -1
- package/build/dist/Server/Types/AnalyticsDatabase/AggregateBy.js +33 -7
- package/build/dist/Server/Types/AnalyticsDatabase/AggregateBy.js.map +1 -1
- package/build/dist/Server/Utils/Attribution.js +74 -0
- package/build/dist/Server/Utils/Attribution.js.map +1 -0
- package/build/dist/Server/Utils/Marketing/ConversionUploadProvider.js +40 -0
- package/build/dist/Server/Utils/Marketing/ConversionUploadProvider.js.map +1 -0
- package/build/dist/Server/Utils/Marketing/ConversionUploadProviders.js +20 -0
- package/build/dist/Server/Utils/Marketing/ConversionUploadProviders.js.map +1 -0
- package/build/dist/Server/Utils/Marketing/Providers/GoogleAds.js +177 -0
- package/build/dist/Server/Utils/Marketing/Providers/GoogleAds.js.map +1 -0
- package/build/dist/Server/Utils/Marketing/Providers/LinkedIn.js +113 -0
- package/build/dist/Server/Utils/Marketing/Providers/LinkedIn.js.map +1 -0
- package/build/dist/Server/Utils/Marketing/Providers/Meta.js +109 -0
- package/build/dist/Server/Utils/Marketing/Providers/Meta.js.map +1 -0
- package/build/dist/Server/Utils/Marketing/Providers/MicrosoftAds.js +130 -0
- package/build/dist/Server/Utils/Marketing/Providers/MicrosoftAds.js.map +1 -0
- package/build/dist/Server/Utils/Marketing/Providers/Reddit.js +126 -0
- package/build/dist/Server/Utils/Marketing/Providers/Reddit.js.map +1 -0
- package/build/dist/Server/Utils/Monitor/MonitorAlert.js +53 -9
- package/build/dist/Server/Utils/Monitor/MonitorAlert.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorCriteriaEvaluator.js +21 -10
- package/build/dist/Server/Utils/Monitor/MonitorCriteriaEvaluator.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorIncident.js +54 -11
- package/build/dist/Server/Utils/Monitor/MonitorIncident.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorMetricUtil.js +43 -3
- package/build/dist/Server/Utils/Monitor/MonitorMetricUtil.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorTemplateUtil.js +68 -0
- package/build/dist/Server/Utils/Monitor/MonitorTemplateUtil.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/NetworkDeviceHydrationUtil.js +15 -0
- package/build/dist/Server/Utils/Monitor/NetworkDeviceHydrationUtil.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/NetworkInventoryUtil.js +100 -15
- package/build/dist/Server/Utils/Monitor/NetworkInventoryUtil.js.map +1 -1
- package/build/dist/Server/Utils/ProductAnalytics.js +111 -0
- package/build/dist/Server/Utils/ProductAnalytics.js.map +1 -0
- package/build/dist/Server/Utils/Telemetry/Telemetry.js +32 -5
- package/build/dist/Server/Utils/Telemetry/Telemetry.js.map +1 -1
- package/build/dist/Server/Utils/Telemetry/TelemetryEntity.js +17 -0
- package/build/dist/Server/Utils/Telemetry/TelemetryEntity.js.map +1 -1
- package/build/dist/Types/AnalyticsDatabase/AnalyticsTableName.js +11 -0
- package/build/dist/Types/AnalyticsDatabase/AnalyticsTableName.js.map +1 -1
- package/build/dist/Types/BaseDatabase/AggregationInterval.js +11 -0
- package/build/dist/Types/BaseDatabase/AggregationInterval.js.map +1 -1
- package/build/dist/Types/BaseDatabase/AggregationIntervalUtil.js +33 -5
- package/build/dist/Types/BaseDatabase/AggregationIntervalUtil.js.map +1 -1
- package/build/dist/Types/Email/EmailTemplateType.js +2 -0
- package/build/dist/Types/Email/EmailTemplateType.js.map +1 -1
- package/build/dist/Types/Marketing/MarketingConversion.js +13 -0
- package/build/dist/Types/Marketing/MarketingConversion.js.map +1 -0
- package/build/dist/Types/Monitor/MonitorMetricType.js +7 -0
- package/build/dist/Types/Monitor/MonitorMetricType.js.map +1 -1
- package/build/dist/Types/Monitor/MonitorStep.js +6 -0
- package/build/dist/Types/Monitor/MonitorStep.js.map +1 -1
- package/build/dist/Types/Monitor/MonitorStepSqlMonitor.js +3 -0
- package/build/dist/Types/Monitor/MonitorStepSqlMonitor.js.map +1 -1
- package/build/dist/Types/Monitor/MonitorType.js +2 -1
- package/build/dist/Types/Monitor/MonitorType.js.map +1 -1
- package/build/dist/Types/Monitor/SnmpMonitor/CdpNeighbor.js +2 -0
- package/build/dist/Types/Monitor/SnmpMonitor/CdpNeighbor.js.map +1 -0
- package/build/dist/Types/Monitor/SnmpMonitor/SnmpAuthProtocol.js +41 -0
- package/build/dist/Types/Monitor/SnmpMonitor/SnmpAuthProtocol.js.map +1 -1
- package/build/dist/Types/Monitor/SnmpMonitor/SnmpEntityInfo.js +2 -0
- package/build/dist/Types/Monitor/SnmpMonitor/SnmpEntityInfo.js.map +1 -0
- package/build/dist/Types/Monitor/SnmpMonitor/SnmpPrivProtocol.js +48 -0
- package/build/dist/Types/Monitor/SnmpMonitor/SnmpPrivProtocol.js.map +1 -1
- package/build/dist/Types/Monitor/SnmpMonitor/SnmpSecurityLevel.js +38 -0
- package/build/dist/Types/Monitor/SnmpMonitor/SnmpSecurityLevel.js.map +1 -1
- package/build/dist/Types/Monitor/SnmpMonitor/SnmpSystemInfo.js +2 -0
- package/build/dist/Types/Monitor/SnmpMonitor/SnmpSystemInfo.js.map +1 -0
- package/build/dist/Types/Monitor/SnmpMonitor/SnmpVendorTemplate.js +96 -3
- package/build/dist/Types/Monitor/SnmpMonitor/SnmpVendorTemplate.js.map +1 -1
- package/build/dist/Types/NetFlow/NetworkFlowRecord.js +2 -0
- package/build/dist/Types/NetFlow/NetworkFlowRecord.js.map +1 -0
- package/build/dist/Types/Syslog/SyslogMessage.js +2 -0
- package/build/dist/Types/Syslog/SyslogMessage.js.map +1 -0
- package/build/dist/Types/Telemetry/TelemetrySavedViewState.js +0 -7
- package/build/dist/Types/Telemetry/TelemetrySavedViewState.js.map +1 -1
- package/build/dist/Types/Telemetry/TelemetrySavedViewType.js +13 -0
- package/build/dist/Types/Telemetry/TelemetrySavedViewType.js.map +1 -0
- package/build/dist/UI/Components/Charts/Area/AreaChart.js +25 -1
- package/build/dist/UI/Components/Charts/Area/AreaChart.js.map +1 -1
- package/build/dist/UI/Components/Charts/Bar/BarChart.js +26 -2
- package/build/dist/UI/Components/Charts/Bar/BarChart.js.map +1 -1
- package/build/dist/UI/Components/Charts/ChartGroup/ChartGroup.js +36 -12
- package/build/dist/UI/Components/Charts/ChartGroup/ChartGroup.js.map +1 -1
- package/build/dist/UI/Components/Charts/ChartLibrary/AreaChart/AreaChart.js +208 -6
- package/build/dist/UI/Components/Charts/ChartLibrary/AreaChart/AreaChart.js.map +1 -1
- package/build/dist/UI/Components/Charts/ChartLibrary/BarChart/BarChart.js +52 -3
- package/build/dist/UI/Components/Charts/ChartLibrary/BarChart/BarChart.js.map +1 -1
- package/build/dist/UI/Components/Charts/ChartLibrary/LineChart/LineChart.js +208 -6
- package/build/dist/UI/Components/Charts/ChartLibrary/LineChart/LineChart.js.map +1 -1
- package/build/dist/UI/Components/Charts/ChartLibrary/Types/ChartDataPoint.js +6 -1
- package/build/dist/UI/Components/Charts/ChartLibrary/Types/ChartDataPoint.js.map +1 -1
- package/build/dist/UI/Components/Charts/ChartLibrary/Types/FormattedReferenceRegion.js +2 -0
- package/build/dist/UI/Components/Charts/ChartLibrary/Types/FormattedReferenceRegion.js.map +1 -0
- package/build/dist/UI/Components/Charts/ChartLibrary/Types/FormattedTimeReferenceLine.js +2 -0
- package/build/dist/UI/Components/Charts/ChartLibrary/Types/FormattedTimeReferenceLine.js.map +1 -0
- package/build/dist/UI/Components/Charts/Line/LineChart.js +25 -1
- package/build/dist/UI/Components/Charts/Line/LineChart.js.map +1 -1
- package/build/dist/UI/Components/Charts/Types/ReferenceRegionProps.js +2 -0
- package/build/dist/UI/Components/Charts/Types/ReferenceRegionProps.js.map +1 -0
- package/build/dist/UI/Components/Charts/Types/TimeReferenceLineProps.js +2 -0
- package/build/dist/UI/Components/Charts/Types/TimeReferenceLineProps.js.map +1 -0
- package/build/dist/UI/Components/Charts/Types/XAxis/XAxisPrecision.js +1 -0
- package/build/dist/UI/Components/Charts/Types/XAxis/XAxisPrecision.js.map +1 -1
- package/build/dist/UI/Components/Charts/Utils/DataPoint.js +0 -0
- package/build/dist/UI/Components/Charts/Utils/DataPoint.js.map +1 -1
- package/build/dist/UI/Components/Charts/Utils/TimeAnnotation.js +121 -0
- package/build/dist/UI/Components/Charts/Utils/TimeAnnotation.js.map +1 -0
- package/build/dist/UI/Components/Charts/Utils/XAxis.js +27 -4
- package/build/dist/UI/Components/Charts/Utils/XAxis.js.map +1 -1
- package/build/dist/UI/Components/Icon/Icon.js +15 -8
- package/build/dist/UI/Components/Icon/Icon.js.map +1 -1
- package/build/dist/UI/Components/Markdown.tsx/MarkdownViewer.js.map +1 -1
- package/build/dist/UI/Components/MonitorTemplateVariables/TemplateVariablesCatalog.js +58 -0
- package/build/dist/UI/Components/MonitorTemplateVariables/TemplateVariablesCatalog.js.map +1 -1
- package/build/dist/UI/Components/Page/ModelPage.js +7 -1
- package/build/dist/UI/Components/Page/ModelPage.js.map +1 -1
- package/build/dist/UI/Components/TelemetryViewer/components/SavedViewsDropdown.js +10 -4
- package/build/dist/UI/Components/TelemetryViewer/components/SavedViewsDropdown.js.map +1 -1
- package/build/dist/UI/Utils/User.js +35 -2
- package/build/dist/UI/Utils/User.js.map +1 -1
- package/build/dist/Utils/Analytics.js +8 -5
- package/build/dist/Utils/Analytics.js.map +1 -1
- package/build/dist/Utils/EnterpriseLicense/EnterpriseLicenseUsage.js +57 -0
- package/build/dist/Utils/EnterpriseLicense/EnterpriseLicenseUsage.js.map +1 -1
- package/build/dist/Utils/Metrics/MetricExplorerUrl.js +418 -0
- package/build/dist/Utils/Metrics/MetricExplorerUrl.js.map +1 -0
- package/build/dist/Utils/Metrics/MetricFormulaEvaluator.js +296 -37
- package/build/dist/Utils/Metrics/MetricFormulaEvaluator.js.map +1 -1
- package/build/dist/Utils/Monitor/NetworkTopologyUtil.js +176 -40
- package/build/dist/Utils/Monitor/NetworkTopologyUtil.js.map +1 -1
- package/build/dist/Utils/ValueFormatter.js +20 -1
- package/build/dist/Utils/ValueFormatter.js.map +1 -1
- package/package.json +4 -3
|
@@ -22,8 +22,45 @@ describe("AggregationIntervalUtil", () => {
|
|
|
22
22
|
3 * HOUR,
|
|
23
23
|
AggregationInterval.Minute,
|
|
24
24
|
],
|
|
25
|
-
[
|
|
26
|
-
|
|
25
|
+
[
|
|
26
|
+
"3 hours + 1ms -> FiveMinutes",
|
|
27
|
+
3 * HOUR + 1,
|
|
28
|
+
AggregationInterval.FiveMinutes,
|
|
29
|
+
],
|
|
30
|
+
["4 hours -> FiveMinutes", 4 * HOUR, AggregationInterval.FiveMinutes],
|
|
31
|
+
[
|
|
32
|
+
"exactly 12 hours -> FiveMinutes (inclusive bound)",
|
|
33
|
+
12 * HOUR,
|
|
34
|
+
AggregationInterval.FiveMinutes,
|
|
35
|
+
],
|
|
36
|
+
[
|
|
37
|
+
"12 hours + 1ms -> FifteenMinutes",
|
|
38
|
+
12 * HOUR + 1,
|
|
39
|
+
AggregationInterval.FifteenMinutes,
|
|
40
|
+
],
|
|
41
|
+
[
|
|
42
|
+
"18 hours -> FifteenMinutes",
|
|
43
|
+
18 * HOUR,
|
|
44
|
+
AggregationInterval.FifteenMinutes,
|
|
45
|
+
],
|
|
46
|
+
[
|
|
47
|
+
"exactly 24 hours -> FifteenMinutes (inclusive bound)",
|
|
48
|
+
24 * HOUR,
|
|
49
|
+
AggregationInterval.FifteenMinutes,
|
|
50
|
+
],
|
|
51
|
+
[
|
|
52
|
+
"24 hours + 1ms -> ThirtyMinutes",
|
|
53
|
+
24 * HOUR + 1,
|
|
54
|
+
AggregationInterval.ThirtyMinutes,
|
|
55
|
+
],
|
|
56
|
+
["2 days -> ThirtyMinutes", 2 * DAY, AggregationInterval.ThirtyMinutes],
|
|
57
|
+
[
|
|
58
|
+
"exactly 3 days -> ThirtyMinutes (inclusive bound)",
|
|
59
|
+
3 * DAY,
|
|
60
|
+
AggregationInterval.ThirtyMinutes,
|
|
61
|
+
],
|
|
62
|
+
["3 days + 1ms -> Hour", 3 * DAY + 1, AggregationInterval.Hour],
|
|
63
|
+
["5 days -> Hour", 5 * DAY, AggregationInterval.Hour],
|
|
27
64
|
[
|
|
28
65
|
"exactly 7 days -> Hour (inclusive bound)",
|
|
29
66
|
7 * DAY,
|
|
@@ -84,6 +121,9 @@ describe("AggregationIntervalUtil", () => {
|
|
|
84
121
|
test("returns the widest interval as the window grows", () => {
|
|
85
122
|
const order: Array<AggregationInterval> = [
|
|
86
123
|
AggregationInterval.Minute,
|
|
124
|
+
AggregationInterval.FiveMinutes,
|
|
125
|
+
AggregationInterval.FifteenMinutes,
|
|
126
|
+
AggregationInterval.ThirtyMinutes,
|
|
87
127
|
AggregationInterval.Hour,
|
|
88
128
|
AggregationInterval.Day,
|
|
89
129
|
AggregationInterval.Week,
|
|
@@ -92,7 +132,10 @@ describe("AggregationIntervalUtil", () => {
|
|
|
92
132
|
];
|
|
93
133
|
const durations: Array<number> = [
|
|
94
134
|
HOUR,
|
|
135
|
+
6 * HOUR,
|
|
136
|
+
18 * HOUR,
|
|
95
137
|
2 * DAY,
|
|
138
|
+
5 * DAY,
|
|
96
139
|
30 * DAY,
|
|
97
140
|
90 * DAY,
|
|
98
141
|
365 * DAY,
|
|
@@ -119,6 +162,9 @@ describe("AggregationIntervalUtil", () => {
|
|
|
119
162
|
describe("getAggregationIntervalMs", () => {
|
|
120
163
|
test.each([
|
|
121
164
|
[AggregationInterval.Minute, 1000 * 60],
|
|
165
|
+
[AggregationInterval.FiveMinutes, 1000 * 60 * 5],
|
|
166
|
+
[AggregationInterval.FifteenMinutes, 1000 * 60 * 15],
|
|
167
|
+
[AggregationInterval.ThirtyMinutes, 1000 * 60 * 30],
|
|
122
168
|
[AggregationInterval.Hour, 1000 * 60 * 60],
|
|
123
169
|
[AggregationInterval.Day, 1000 * 60 * 60 * 24],
|
|
124
170
|
[AggregationInterval.Week, 1000 * 60 * 60 * 24 * 7],
|
|
@@ -148,6 +194,9 @@ describe("AggregationIntervalUtil", () => {
|
|
|
148
194
|
test("intervals are strictly increasing in width", () => {
|
|
149
195
|
const ordered: Array<AggregationInterval> = [
|
|
150
196
|
AggregationInterval.Minute,
|
|
197
|
+
AggregationInterval.FiveMinutes,
|
|
198
|
+
AggregationInterval.FifteenMinutes,
|
|
199
|
+
AggregationInterval.ThirtyMinutes,
|
|
151
200
|
AggregationInterval.Hour,
|
|
152
201
|
AggregationInterval.Day,
|
|
153
202
|
AggregationInterval.Week,
|
|
@@ -164,4 +213,64 @@ describe("AggregationIntervalUtil", () => {
|
|
|
164
213
|
}
|
|
165
214
|
});
|
|
166
215
|
});
|
|
216
|
+
|
|
217
|
+
describe("floorDateToIntervalGrid", () => {
|
|
218
|
+
// 2020-01-01T00:00:00Z is on every sub-day epoch grid.
|
|
219
|
+
const gridOrigin: number = Date.UTC(2020, 0, 1, 0, 0, 0);
|
|
220
|
+
|
|
221
|
+
test.each([
|
|
222
|
+
// [interval, offset into the bucket, expected floored offset]
|
|
223
|
+
[AggregationInterval.Minute, 37 * 1000, 0],
|
|
224
|
+
[AggregationInterval.FiveMinutes, 4 * 60 * 1000 + 12 * 1000, 0],
|
|
225
|
+
[
|
|
226
|
+
AggregationInterval.FiveMinutes,
|
|
227
|
+
7 * 60 * 1000, // 00:07 floors to 00:05
|
|
228
|
+
5 * 60 * 1000,
|
|
229
|
+
],
|
|
230
|
+
[
|
|
231
|
+
AggregationInterval.FifteenMinutes,
|
|
232
|
+
22 * 60 * 1000, // 00:22 floors to 00:15
|
|
233
|
+
15 * 60 * 1000,
|
|
234
|
+
],
|
|
235
|
+
[
|
|
236
|
+
AggregationInterval.ThirtyMinutes,
|
|
237
|
+
44 * 60 * 1000, // 00:44 floors to 00:30
|
|
238
|
+
30 * 60 * 1000,
|
|
239
|
+
],
|
|
240
|
+
[AggregationInterval.Hour, 59 * 60 * 1000, 0],
|
|
241
|
+
])(
|
|
242
|
+
"floors %s timestamps down to the bucket boundary",
|
|
243
|
+
(
|
|
244
|
+
interval: AggregationInterval,
|
|
245
|
+
offsetMs: number,
|
|
246
|
+
expectedOffsetMs: number,
|
|
247
|
+
) => {
|
|
248
|
+
const floored: Date = AggregationIntervalUtil.floorDateToIntervalGrid(
|
|
249
|
+
new Date(gridOrigin + offsetMs),
|
|
250
|
+
interval,
|
|
251
|
+
);
|
|
252
|
+
expect(floored.getTime()).toBe(gridOrigin + expectedOffsetMs);
|
|
253
|
+
},
|
|
254
|
+
);
|
|
255
|
+
|
|
256
|
+
test("a timestamp already on the 15-minute grid is unchanged", () => {
|
|
257
|
+
const onGrid: Date = new Date(gridOrigin + 45 * 60 * 1000);
|
|
258
|
+
expect(
|
|
259
|
+
AggregationIntervalUtil.floorDateToIntervalGrid(
|
|
260
|
+
onGrid,
|
|
261
|
+
AggregationInterval.FifteenMinutes,
|
|
262
|
+
).getTime(),
|
|
263
|
+
).toBe(onGrid.getTime());
|
|
264
|
+
});
|
|
265
|
+
|
|
266
|
+
test("calendar intervals (Week) are returned unchanged", () => {
|
|
267
|
+
const midWeek: Date = new Date(gridOrigin + 3 * 24 * 60 * 60 * 1000);
|
|
268
|
+
expect(
|
|
269
|
+
AggregationIntervalUtil.floorDateToIntervalGrid(
|
|
270
|
+
midWeek,
|
|
271
|
+
AggregationInterval.Week,
|
|
272
|
+
).getTime(),
|
|
273
|
+
).toBe(midWeek.getTime());
|
|
274
|
+
});
|
|
275
|
+
});
|
|
167
276
|
});
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import EndsWith from "../../../Types/BaseDatabase/EndsWith";
|
|
2
|
+
import BadDataException from "../../../Types/Exception/BadDataException";
|
|
3
|
+
import { JSONObject } from "../../../Types/JSON";
|
|
4
|
+
import { describe, expect, it } from "@jest/globals";
|
|
5
|
+
|
|
6
|
+
describe("EndsWith", () => {
|
|
7
|
+
it("should create an EndsWith object with a valid value", () => {
|
|
8
|
+
const value: string = "oneuptime";
|
|
9
|
+
const obj: EndsWith<string> = new EndsWith<string>(value);
|
|
10
|
+
expect(obj.value).toBe(value);
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
it("should get and set the value property", () => {
|
|
14
|
+
const obj: EndsWith<string> = new EndsWith<string>("oldValue");
|
|
15
|
+
obj.value = "newValue";
|
|
16
|
+
expect(obj.value).toBe("newValue");
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
it("should return the value using toString", () => {
|
|
20
|
+
const obj: EndsWith<string> = new EndsWith<string>("oneuptime");
|
|
21
|
+
expect(obj.toString()).toBe("oneuptime");
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
it("should generate the correct JSON representation using toJSON", () => {
|
|
25
|
+
const obj: EndsWith<string> = new EndsWith<string>("oneuptime");
|
|
26
|
+
const expectedJSON: JSONObject = {
|
|
27
|
+
_type: "EndsWith",
|
|
28
|
+
value: "oneuptime",
|
|
29
|
+
};
|
|
30
|
+
expect(obj.toJSON()).toEqual(expectedJSON);
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
it("should create an EndsWith object from valid JSON input", () => {
|
|
34
|
+
const jsonInput: JSONObject = {
|
|
35
|
+
_type: "EndsWith",
|
|
36
|
+
value: "oneuptime",
|
|
37
|
+
};
|
|
38
|
+
const obj: EndsWith<string> = EndsWith.fromJSON(jsonInput);
|
|
39
|
+
expect(obj.value).toBe("oneuptime");
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
it("should default to an empty string when the JSON value is missing", () => {
|
|
43
|
+
const jsonInput: JSONObject = {
|
|
44
|
+
_type: "EndsWith",
|
|
45
|
+
};
|
|
46
|
+
const obj: EndsWith<string> = EndsWith.fromJSON(jsonInput);
|
|
47
|
+
expect(obj.value).toBe("");
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
it("should throw a BadDataException when using invalid JSON input", () => {
|
|
51
|
+
const jsonInput: JSONObject = {
|
|
52
|
+
_type: "InvalidType",
|
|
53
|
+
value: "oneuptime",
|
|
54
|
+
};
|
|
55
|
+
expect(() => {
|
|
56
|
+
return EndsWith.fromJSON(jsonInput);
|
|
57
|
+
}).toThrow(BadDataException);
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
it("should be an instance of EndsWith", () => {
|
|
61
|
+
const obj: EndsWith<string> = new EndsWith<string>("oneuptime");
|
|
62
|
+
expect(obj).toBeInstanceOf(EndsWith);
|
|
63
|
+
});
|
|
64
|
+
});
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import GreaterThan from "../../../Types/BaseDatabase/GreaterThan";
|
|
2
|
+
import BadDataException from "../../../Types/Exception/BadDataException";
|
|
3
|
+
import { JSONObject } from "../../../Types/JSON";
|
|
4
|
+
import { describe, expect, it } from "@jest/globals";
|
|
5
|
+
|
|
6
|
+
describe("GreaterThan", () => {
|
|
7
|
+
it("should create a GreaterThan object with a valid value", () => {
|
|
8
|
+
const value: number = 42;
|
|
9
|
+
const obj: GreaterThan<number> = new GreaterThan<number>(value);
|
|
10
|
+
expect(obj.value).toBe(value);
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
it("should get and set the value property", () => {
|
|
14
|
+
const obj: GreaterThan<number> = new GreaterThan<number>(1);
|
|
15
|
+
obj.value = 2;
|
|
16
|
+
expect(obj.value).toBe(2);
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
it("should return the correct string representation using toString", () => {
|
|
20
|
+
const obj: GreaterThan<number> = new GreaterThan<number>(42);
|
|
21
|
+
expect(obj.toString()).toBe("42");
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
it("should generate the correct JSON representation using toJSON", () => {
|
|
25
|
+
const obj: GreaterThan<number> = new GreaterThan<number>(42);
|
|
26
|
+
const expectedJSON: JSONObject = {
|
|
27
|
+
_type: "GreaterThan",
|
|
28
|
+
value: "42",
|
|
29
|
+
};
|
|
30
|
+
expect(obj.toJSON()).toEqual(expectedJSON);
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
it("should create a GreaterThan object from valid JSON input", () => {
|
|
34
|
+
const jsonInput: JSONObject = {
|
|
35
|
+
_type: "GreaterThan",
|
|
36
|
+
value: "42",
|
|
37
|
+
};
|
|
38
|
+
const obj: GreaterThan<number> = GreaterThan.fromJSON(jsonInput);
|
|
39
|
+
expect(obj.value).toBe("42");
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
it("should throw a BadDataException when using invalid JSON input", () => {
|
|
43
|
+
const jsonInput: JSONObject = {
|
|
44
|
+
_type: "InvalidType",
|
|
45
|
+
value: "42",
|
|
46
|
+
};
|
|
47
|
+
expect(() => {
|
|
48
|
+
return GreaterThan.fromJSON(jsonInput);
|
|
49
|
+
}).toThrow(BadDataException);
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
it("should be an instance of GreaterThan", () => {
|
|
53
|
+
const obj: GreaterThan<number> = new GreaterThan<number>(42);
|
|
54
|
+
expect(obj).toBeInstanceOf(GreaterThan);
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
it("should handle date values", () => {
|
|
58
|
+
const value: Date = new Date("2023-01-01");
|
|
59
|
+
const obj: GreaterThan<Date> = new GreaterThan<Date>(value);
|
|
60
|
+
expect(obj.value).toBe(value);
|
|
61
|
+
});
|
|
62
|
+
});
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import GreaterThanOrEqual from "../../../Types/BaseDatabase/GreaterThanOrEqual";
|
|
2
|
+
import BadDataException from "../../../Types/Exception/BadDataException";
|
|
3
|
+
import { JSONObject } from "../../../Types/JSON";
|
|
4
|
+
import { describe, expect, it } from "@jest/globals";
|
|
5
|
+
|
|
6
|
+
describe("GreaterThanOrEqual", () => {
|
|
7
|
+
it("should create a GreaterThanOrEqual object with a valid value", () => {
|
|
8
|
+
const value: number = 42;
|
|
9
|
+
const obj: GreaterThanOrEqual<number> = new GreaterThanOrEqual<number>(
|
|
10
|
+
value,
|
|
11
|
+
);
|
|
12
|
+
expect(obj.value).toBe(value);
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
it("should get and set the value property", () => {
|
|
16
|
+
const obj: GreaterThanOrEqual<number> = new GreaterThanOrEqual<number>(1);
|
|
17
|
+
obj.value = 2;
|
|
18
|
+
expect(obj.value).toBe(2);
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
it("should return the correct string representation using toString", () => {
|
|
22
|
+
const obj: GreaterThanOrEqual<number> = new GreaterThanOrEqual<number>(42);
|
|
23
|
+
expect(obj.toString()).toBe("42");
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
it("should generate the correct JSON representation using toJSON", () => {
|
|
27
|
+
const obj: GreaterThanOrEqual<number> = new GreaterThanOrEqual<number>(42);
|
|
28
|
+
const expectedJSON: JSONObject = {
|
|
29
|
+
_type: "GreaterThanOrEqual",
|
|
30
|
+
value: "42",
|
|
31
|
+
};
|
|
32
|
+
expect(obj.toJSON()).toEqual(expectedJSON);
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
it("should create a GreaterThanOrEqual object from valid JSON input", () => {
|
|
36
|
+
const jsonInput: JSONObject = {
|
|
37
|
+
_type: "GreaterThanOrEqual",
|
|
38
|
+
value: "42",
|
|
39
|
+
};
|
|
40
|
+
const obj: GreaterThanOrEqual<number> =
|
|
41
|
+
GreaterThanOrEqual.fromJSON(jsonInput);
|
|
42
|
+
expect(obj.value).toBe("42");
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
it("should throw a BadDataException when using invalid JSON input", () => {
|
|
46
|
+
const jsonInput: JSONObject = {
|
|
47
|
+
_type: "InvalidType",
|
|
48
|
+
value: "42",
|
|
49
|
+
};
|
|
50
|
+
expect(() => {
|
|
51
|
+
return GreaterThanOrEqual.fromJSON(jsonInput);
|
|
52
|
+
}).toThrow(BadDataException);
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
it("should be an instance of GreaterThanOrEqual", () => {
|
|
56
|
+
const obj: GreaterThanOrEqual<number> = new GreaterThanOrEqual<number>(42);
|
|
57
|
+
expect(obj).toBeInstanceOf(GreaterThanOrEqual);
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
it("should handle date values", () => {
|
|
61
|
+
const value: Date = new Date("2023-01-01");
|
|
62
|
+
const obj: GreaterThanOrEqual<Date> = new GreaterThanOrEqual<Date>(value);
|
|
63
|
+
expect(obj.value).toBe(value);
|
|
64
|
+
});
|
|
65
|
+
});
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import GreaterThanOrNull from "../../../Types/BaseDatabase/GreaterThanOrNull";
|
|
2
|
+
import BadDataException from "../../../Types/Exception/BadDataException";
|
|
3
|
+
import { JSONObject } from "../../../Types/JSON";
|
|
4
|
+
import { describe, expect, it } from "@jest/globals";
|
|
5
|
+
|
|
6
|
+
describe("GreaterThanOrNull", () => {
|
|
7
|
+
it("should create a GreaterThanOrNull object with a valid value", () => {
|
|
8
|
+
const value: number = 42;
|
|
9
|
+
const obj: GreaterThanOrNull<number> = new GreaterThanOrNull<number>(value);
|
|
10
|
+
expect(obj.value).toBe(value);
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
it("should get and set the value property", () => {
|
|
14
|
+
const obj: GreaterThanOrNull<number> = new GreaterThanOrNull<number>(1);
|
|
15
|
+
obj.value = 2;
|
|
16
|
+
expect(obj.value).toBe(2);
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
it("should return the correct string representation using toString", () => {
|
|
20
|
+
const obj: GreaterThanOrNull<number> = new GreaterThanOrNull<number>(42);
|
|
21
|
+
expect(obj.toString()).toBe("42");
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
it("should generate the correct JSON representation using toJSON", () => {
|
|
25
|
+
const obj: GreaterThanOrNull<number> = new GreaterThanOrNull<number>(42);
|
|
26
|
+
const expectedJSON: JSONObject = {
|
|
27
|
+
_type: "GreaterThanOrNull",
|
|
28
|
+
value: "42",
|
|
29
|
+
};
|
|
30
|
+
expect(obj.toJSON()).toEqual(expectedJSON);
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
it("should create a GreaterThanOrNull object from valid JSON input", () => {
|
|
34
|
+
const jsonInput: JSONObject = {
|
|
35
|
+
_type: "GreaterThanOrNull",
|
|
36
|
+
value: "42",
|
|
37
|
+
};
|
|
38
|
+
const obj: GreaterThanOrNull<number> =
|
|
39
|
+
GreaterThanOrNull.fromJSON(jsonInput);
|
|
40
|
+
expect(obj.value).toBe("42");
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
it("should throw a BadDataException when using invalid JSON input", () => {
|
|
44
|
+
const jsonInput: JSONObject = {
|
|
45
|
+
_type: "InvalidType",
|
|
46
|
+
value: "42",
|
|
47
|
+
};
|
|
48
|
+
expect(() => {
|
|
49
|
+
return GreaterThanOrNull.fromJSON(jsonInput);
|
|
50
|
+
}).toThrow(BadDataException);
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
it("should be an instance of GreaterThanOrNull", () => {
|
|
54
|
+
const obj: GreaterThanOrNull<number> = new GreaterThanOrNull<number>(42);
|
|
55
|
+
expect(obj).toBeInstanceOf(GreaterThanOrNull);
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
it("should handle date values", () => {
|
|
59
|
+
const value: Date = new Date("2023-01-01");
|
|
60
|
+
const obj: GreaterThanOrNull<Date> = new GreaterThanOrNull<Date>(value);
|
|
61
|
+
expect(obj.value).toBe(value);
|
|
62
|
+
});
|
|
63
|
+
});
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import Includes from "../../../Types/BaseDatabase/Includes";
|
|
2
|
+
import BadDataException from "../../../Types/Exception/BadDataException";
|
|
3
|
+
import { JSONObject } from "../../../Types/JSON";
|
|
4
|
+
import { describe, expect, it } from "@jest/globals";
|
|
5
|
+
|
|
6
|
+
describe("Includes", () => {
|
|
7
|
+
it("should create an Includes object with string values", () => {
|
|
8
|
+
const values: Array<string> = ["a", "b"];
|
|
9
|
+
const obj: Includes = new Includes(values);
|
|
10
|
+
expect(obj.values).toEqual(values);
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
it("should get and set the values property", () => {
|
|
14
|
+
const obj: Includes = new Includes(["a"]);
|
|
15
|
+
obj.values = ["c", "d"];
|
|
16
|
+
expect(obj.values).toEqual(["c", "d"]);
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
it("should handle numeric values", () => {
|
|
20
|
+
const values: Array<number> = [1, 2, 3];
|
|
21
|
+
const obj: Includes = new Includes(values);
|
|
22
|
+
expect(obj.values).toEqual(values);
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
it("should generate the correct JSON representation using toJSON", () => {
|
|
26
|
+
const obj: Includes = new Includes(["a", "b"]);
|
|
27
|
+
const expectedJSON: JSONObject = {
|
|
28
|
+
_type: "Includes",
|
|
29
|
+
value: ["a", "b"],
|
|
30
|
+
};
|
|
31
|
+
expect(obj.toJSON()).toEqual(expectedJSON);
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
it("should create an Includes object from valid JSON input", () => {
|
|
35
|
+
const jsonInput: JSONObject = {
|
|
36
|
+
_type: "Includes",
|
|
37
|
+
value: ["a", "b"],
|
|
38
|
+
};
|
|
39
|
+
const obj: Includes = Includes.fromJSON(jsonInput);
|
|
40
|
+
expect(obj.values).toEqual(["a", "b"]);
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
it("should default to an empty array when the JSON value is missing", () => {
|
|
44
|
+
const jsonInput: JSONObject = {
|
|
45
|
+
_type: "Includes",
|
|
46
|
+
};
|
|
47
|
+
const obj: Includes = Includes.fromJSON(jsonInput);
|
|
48
|
+
expect(obj.values).toEqual([]);
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
it("should throw a BadDataException when using invalid JSON input", () => {
|
|
52
|
+
const jsonInput: JSONObject = {
|
|
53
|
+
_type: "InvalidType",
|
|
54
|
+
value: [],
|
|
55
|
+
};
|
|
56
|
+
expect(() => {
|
|
57
|
+
return Includes.fromJSON(jsonInput);
|
|
58
|
+
}).toThrow(BadDataException);
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
it("should be an instance of Includes", () => {
|
|
62
|
+
const obj: Includes = new Includes(["a"]);
|
|
63
|
+
expect(obj).toBeInstanceOf(Includes);
|
|
64
|
+
});
|
|
65
|
+
});
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import IncludesAll from "../../../Types/BaseDatabase/IncludesAll";
|
|
2
|
+
import BadDataException from "../../../Types/Exception/BadDataException";
|
|
3
|
+
import { JSONObject } from "../../../Types/JSON";
|
|
4
|
+
import { describe, expect, it } from "@jest/globals";
|
|
5
|
+
|
|
6
|
+
describe("IncludesAll", () => {
|
|
7
|
+
it("should create an IncludesAll object with string values", () => {
|
|
8
|
+
const values: Array<string> = ["a", "b"];
|
|
9
|
+
const obj: IncludesAll = new IncludesAll(values);
|
|
10
|
+
expect(obj.values).toEqual(values);
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
it("should get and set the values property", () => {
|
|
14
|
+
const obj: IncludesAll = new IncludesAll(["a"]);
|
|
15
|
+
obj.values = ["c", "d"];
|
|
16
|
+
expect(obj.values).toEqual(["c", "d"]);
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
it("should handle numeric values", () => {
|
|
20
|
+
const values: Array<number> = [1, 2, 3];
|
|
21
|
+
const obj: IncludesAll = new IncludesAll(values);
|
|
22
|
+
expect(obj.values).toEqual(values);
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
it("should generate the correct JSON representation using toJSON", () => {
|
|
26
|
+
const obj: IncludesAll = new IncludesAll(["a", "b"]);
|
|
27
|
+
const expectedJSON: JSONObject = {
|
|
28
|
+
_type: "IncludesAll",
|
|
29
|
+
value: ["a", "b"],
|
|
30
|
+
};
|
|
31
|
+
expect(obj.toJSON()).toEqual(expectedJSON);
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
it("should create an IncludesAll object from valid JSON input", () => {
|
|
35
|
+
const jsonInput: JSONObject = {
|
|
36
|
+
_type: "IncludesAll",
|
|
37
|
+
value: ["a", "b"],
|
|
38
|
+
};
|
|
39
|
+
const obj: IncludesAll = IncludesAll.fromJSON(jsonInput);
|
|
40
|
+
expect(obj.values).toEqual(["a", "b"]);
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
it("should default to an empty array when the JSON value is missing", () => {
|
|
44
|
+
const jsonInput: JSONObject = {
|
|
45
|
+
_type: "IncludesAll",
|
|
46
|
+
};
|
|
47
|
+
const obj: IncludesAll = IncludesAll.fromJSON(jsonInput);
|
|
48
|
+
expect(obj.values).toEqual([]);
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
it("should throw a BadDataException when using invalid JSON input", () => {
|
|
52
|
+
const jsonInput: JSONObject = {
|
|
53
|
+
_type: "InvalidType",
|
|
54
|
+
value: [],
|
|
55
|
+
};
|
|
56
|
+
expect(() => {
|
|
57
|
+
return IncludesAll.fromJSON(jsonInput);
|
|
58
|
+
}).toThrow(BadDataException);
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
it("should be an instance of IncludesAll", () => {
|
|
62
|
+
const obj: IncludesAll = new IncludesAll(["a"]);
|
|
63
|
+
expect(obj).toBeInstanceOf(IncludesAll);
|
|
64
|
+
});
|
|
65
|
+
});
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import IncludesNone from "../../../Types/BaseDatabase/IncludesNone";
|
|
2
|
+
import BadDataException from "../../../Types/Exception/BadDataException";
|
|
3
|
+
import { JSONObject } from "../../../Types/JSON";
|
|
4
|
+
import { describe, expect, it } from "@jest/globals";
|
|
5
|
+
|
|
6
|
+
describe("IncludesNone", () => {
|
|
7
|
+
it("should create an IncludesNone object with string values", () => {
|
|
8
|
+
const values: Array<string> = ["a", "b"];
|
|
9
|
+
const obj: IncludesNone = new IncludesNone(values);
|
|
10
|
+
expect(obj.values).toEqual(values);
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
it("should get and set the values property", () => {
|
|
14
|
+
const obj: IncludesNone = new IncludesNone(["a"]);
|
|
15
|
+
obj.values = ["c", "d"];
|
|
16
|
+
expect(obj.values).toEqual(["c", "d"]);
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
it("should handle numeric values", () => {
|
|
20
|
+
const values: Array<number> = [1, 2, 3];
|
|
21
|
+
const obj: IncludesNone = new IncludesNone(values);
|
|
22
|
+
expect(obj.values).toEqual(values);
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
it("should generate the correct JSON representation using toJSON", () => {
|
|
26
|
+
const obj: IncludesNone = new IncludesNone(["a", "b"]);
|
|
27
|
+
const expectedJSON: JSONObject = {
|
|
28
|
+
_type: "IncludesNone",
|
|
29
|
+
value: ["a", "b"],
|
|
30
|
+
};
|
|
31
|
+
expect(obj.toJSON()).toEqual(expectedJSON);
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
it("should create an IncludesNone object from valid JSON input", () => {
|
|
35
|
+
const jsonInput: JSONObject = {
|
|
36
|
+
_type: "IncludesNone",
|
|
37
|
+
value: ["a", "b"],
|
|
38
|
+
};
|
|
39
|
+
const obj: IncludesNone = IncludesNone.fromJSON(jsonInput);
|
|
40
|
+
expect(obj.values).toEqual(["a", "b"]);
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
it("should default to an empty array when the JSON value is missing", () => {
|
|
44
|
+
const jsonInput: JSONObject = {
|
|
45
|
+
_type: "IncludesNone",
|
|
46
|
+
};
|
|
47
|
+
const obj: IncludesNone = IncludesNone.fromJSON(jsonInput);
|
|
48
|
+
expect(obj.values).toEqual([]);
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
it("should throw a BadDataException when using invalid JSON input", () => {
|
|
52
|
+
const jsonInput: JSONObject = {
|
|
53
|
+
_type: "InvalidType",
|
|
54
|
+
value: [],
|
|
55
|
+
};
|
|
56
|
+
expect(() => {
|
|
57
|
+
return IncludesNone.fromJSON(jsonInput);
|
|
58
|
+
}).toThrow(BadDataException);
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
it("should be an instance of IncludesNone", () => {
|
|
62
|
+
const obj: IncludesNone = new IncludesNone(["a"]);
|
|
63
|
+
expect(obj).toBeInstanceOf(IncludesNone);
|
|
64
|
+
});
|
|
65
|
+
});
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import IsNull from "../../../Types/BaseDatabase/IsNull";
|
|
2
|
+
import BadDataException from "../../../Types/Exception/BadDataException";
|
|
3
|
+
import { JSONObject } from "../../../Types/JSON";
|
|
4
|
+
import { describe, expect, it } from "@jest/globals";
|
|
5
|
+
|
|
6
|
+
describe("IsNull", () => {
|
|
7
|
+
it("should create an IsNull object", () => {
|
|
8
|
+
const obj: IsNull = new IsNull();
|
|
9
|
+
expect(obj).toBeInstanceOf(IsNull);
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
it("should return an empty string using toString", () => {
|
|
13
|
+
const obj: IsNull = new IsNull();
|
|
14
|
+
expect(obj.toString()).toBe("");
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
it("should generate the correct JSON representation using toJSON", () => {
|
|
18
|
+
const obj: IsNull = new IsNull();
|
|
19
|
+
const expectedJSON: JSONObject = {
|
|
20
|
+
_type: "IsNull",
|
|
21
|
+
value: null,
|
|
22
|
+
};
|
|
23
|
+
expect(obj.toJSON()).toEqual(expectedJSON);
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
it("should create an IsNull object from valid JSON input", () => {
|
|
27
|
+
const jsonInput: JSONObject = {
|
|
28
|
+
_type: "IsNull",
|
|
29
|
+
value: null,
|
|
30
|
+
};
|
|
31
|
+
const obj: IsNull = IsNull.fromJSON(jsonInput);
|
|
32
|
+
expect(obj).toBeInstanceOf(IsNull);
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
it("should throw a BadDataException when using invalid JSON input", () => {
|
|
36
|
+
const jsonInput: JSONObject = {
|
|
37
|
+
_type: "InvalidType",
|
|
38
|
+
value: null,
|
|
39
|
+
};
|
|
40
|
+
expect(() => {
|
|
41
|
+
return IsNull.fromJSON(jsonInput);
|
|
42
|
+
}).toThrow(BadDataException);
|
|
43
|
+
});
|
|
44
|
+
});
|