@oneuptime/common 13.0.8 → 14.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Models/AnalyticsModels/AuditLog.ts +23 -15
- package/Models/DatabaseModels/GlobalConfig.ts +24 -0
- package/Models/DatabaseModels/Monitor.ts +3 -2
- package/Models/DatabaseModels/MonitorTemplate.ts +2 -1
- package/Scripts/generate-service-worker.js +65 -4
- package/Server/API/BaseAPI.ts +26 -5
- package/Server/API/GlobalConfigAPI.ts +228 -462
- package/Server/API/ProjectOIDC.ts +25 -16
- package/Server/API/ProjectSSO.ts +24 -16
- package/Server/API/StatusPageAPI.ts +100 -42
- package/Server/API/TeamMemberAPI.ts +10 -1
- package/Server/Enterprise/EnterpriseEdition.ts +649 -0
- package/Server/Enterprise/EnterpriseFeature.ts +48 -0
- package/Server/Enterprise/EnterpriseLicenseSnapshot.ts +192 -0
- package/Server/Enterprise/EnterpriseServerModule.ts +233 -0
- package/Server/EnvironmentConfig.ts +147 -2
- package/Server/Infrastructure/Postgres/SchemaMigrations/1793900000000-AddEnterpriseEditionFirstSeenAt.ts +25 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts +2 -0
- package/Server/Middleware/UserAuthorization.ts +38 -16
- package/Server/Services/AuditLogService.ts +84 -1079
- package/Server/Services/EnterpriseLicenseService.ts +38 -0
- package/Server/Services/GlobalConfigService.ts +80 -1
- package/Server/Services/MonitorProbeService.ts +116 -20
- package/Server/Services/MonitorService.ts +56 -4
- package/Server/Services/MonitorStatusTimelineService.ts +284 -0
- package/Server/Services/MonitorTemplateService.ts +26 -0
- package/Server/Services/ProjectService.ts +284 -0
- package/Server/Services/RumSessionPinService.ts +25 -6
- package/Server/Services/StatusPagePrivateUserService.ts +7 -3
- package/Server/Services/StatusPageService.ts +78 -1
- package/Server/Services/TeamMemberService.ts +11 -0
- package/Server/Services/TeamService.ts +10 -0
- package/Server/Services/UserService.ts +10 -17
- package/Server/Types/Database/Permissions/CreatePermission.ts +15 -0
- package/Server/Types/Database/Permissions/EditionPermission.ts +208 -18
- package/Server/Types/Database/Permissions/TablePermission.ts +10 -3
- package/Server/Types/Database/Permissions/UpdatePermission.ts +29 -0
- package/Server/Types/Markdown.ts +41 -0
- package/Server/Utils/CommunityEditionSsoReport.ts +361 -0
- package/Server/Utils/EditionEnforcement.ts +233 -0
- package/Server/Utils/FrontendEnvironment.ts +41 -2
- package/Server/Utils/InstanceHealth/RedisHealth.ts +12 -277
- package/Server/Utils/Monitor/AffectedResourceList.ts +190 -0
- package/Server/Utils/Monitor/Criteria/EvaluateOverTime.ts +10 -1
- package/Server/Utils/Monitor/MonitorCriteriaEvaluator.ts +543 -333
- package/Server/Utils/Monitor/MonitoringIntervalValidator.ts +116 -0
- package/Server/Utils/Workspace/Slack/Slack.ts +423 -10
- package/Tests/App/Accounts/LoginPasskey.test.tsx +18 -0
- package/Tests/App/Accounts/LoginSsoEdition.test.tsx +616 -0
- package/Tests/App/AdminDashboard/AdminAuthenticationSsoEdition.test.tsx +217 -0
- package/Tests/App/AdminDashboard/AdminEnterprisePluginPage.test.tsx +357 -0
- package/Tests/App/AdminDashboard/EnterpriseLicensesShell.test.tsx +214 -0
- package/Tests/App/AdminDashboard/GlobalSSOEnterpriseShells.test.tsx +271 -0
- package/Tests/App/AdminDashboard/HealthShells.test.tsx +659 -0
- package/Tests/App/Dashboard/AuditLogsAndComplianceShells.test.tsx +572 -0
- package/Tests/App/Dashboard/EnterpriseFeatureUpgrade.test.tsx +547 -0
- package/Tests/App/Dashboard/EnterprisePluginPage.test.tsx +667 -0
- package/Tests/App/Dashboard/IdentityEnterpriseShells.test.tsx +319 -0
- package/Tests/App/Dashboard/OnboardingSsoEmptyState.test.tsx +185 -0
- package/Tests/App/Dashboard/SecurityEventConnectionDiagnostics.test.tsx +45 -9
- package/Tests/App/Dashboard/SecurityEventDetailPanel.test.tsx +399 -0
- package/Tests/App/Dashboard/SecurityEventListRow.test.tsx +214 -0
- package/Tests/App/Dashboard/SecurityEventsEmptyState.test.tsx +1 -83
- package/Tests/App/Dashboard/SecurityEventsNavTabs.test.tsx +248 -0
- package/Tests/App/Dashboard/SecurityEventsViewer.test.tsx +1203 -0
- package/Tests/App/Dashboard/UserEmailCallSites.test.tsx +11 -91
- package/Tests/App/StatusPage/StatusPageSsoEmptyState.test.tsx +319 -0
- package/Tests/Helpers/RefreshAwareApiScan.ts +757 -0
- package/Tests/Helpers/TenantScopedRequestScan.ts +515 -0
- package/Tests/Scripts/GenerateServiceWorker.test.ts +931 -0
- package/Tests/Server/API/BaseAPICreateItemDoesNotMutateModel.test.ts +130 -0
- package/Tests/Server/API/GlobalConfigLicense.test.ts +742 -497
- package/Tests/Server/API/OnCallReadinessAPI.test.ts +35 -909
- package/Tests/Server/API/SsoProviderListingsEdition.test.ts +432 -0
- package/Tests/Server/API/TeamMemberLeaveScimLockEdition.test.ts +252 -0
- package/Tests/Server/Enterprise/EnterpriseEdition.test.ts +824 -0
- package/Tests/Server/Enterprise/EnterpriseFeatureActive.test.ts +643 -0
- package/Tests/Server/Enterprise/EnterpriseLicenseSnapshot.test.ts +294 -0
- package/Tests/Server/Enterprise/EnterpriseModelFeatureMap.test.ts +93 -0
- package/Tests/Server/Enterprise/EnterpriseOnlyModulesLiveInEe.test.ts +582 -0
- package/Tests/Server/Enterprise/EnterpriseServerModule.test.ts +247 -0
- package/Tests/Server/Enterprise/FakeEnterpriseModule.ts +502 -0
- package/Tests/Server/Enterprise/TestBillingFlag.ts +70 -0
- package/Tests/Server/EnvironmentConfigEnterpriseEdition.test.ts +314 -0
- package/Tests/Server/Infrastructure/ContainerBootConfiguration.test.ts +289 -0
- package/Tests/Server/Infrastructure/E2EClickHouseFixtureAccess.test.ts +5 -1
- package/Tests/Server/Middleware/UserAuthorization.test.ts +37 -2
- package/Tests/Server/Middleware/UserAuthorizationEditionEnforcement.test.ts +516 -0
- package/Tests/Server/Services/AuditLogService.test.ts +460 -990
- package/Tests/Server/Services/CreateAndReadResponsesKeepIds.test.ts +263 -0
- package/Tests/Server/Services/EnterpriseLicenseServiceKeyGeneration.test.ts +151 -0
- package/Tests/Server/Services/GlobalConfigServiceLicenseColumns.test.ts +357 -0
- package/Tests/Server/Services/MonitorDestinationInfoIPv6.test.ts +101 -0
- package/Tests/Server/Services/MonitorProbeServiceIntervalScheduling.test.ts +333 -0
- package/Tests/Server/Services/MonitorStatusTimelineDailyAggregates.test.ts +303 -0
- package/Tests/Server/Services/ProjectServiceAuditLogLicense.test.ts +701 -0
- package/Tests/Server/Services/ProjectServiceAuditLogSettingsCache.test.ts +31 -35
- package/Tests/Server/Services/ScimPushGroupsTeamLocksEdition.test.ts +431 -0
- package/Tests/Server/Services/SsoRequirementReadMasking.test.ts +419 -0
- package/Tests/Server/Services/SsoRequirementWriteGuard.test.ts +769 -0
- package/Tests/Server/Services/StatusPagePrivateUserInvitationPolicy.test.ts +94 -0
- package/Tests/Server/Services/UserAuthenticationService.test.ts +35 -0
- package/Tests/Server/Services/UserServiceSeatLimit.test.ts +94 -56
- package/Tests/Server/Types/Database/Permissions/EditionPermission.test.ts +1823 -0
- package/Tests/Server/Types/Markdown.test.ts +181 -0
- package/Tests/Server/Utils/CommunityEditionSsoReport.test.ts +565 -0
- package/Tests/Server/Utils/EditionEnforcement.test.ts +303 -0
- package/Tests/Server/Utils/FrontendEnvironment.test.ts +367 -0
- package/Tests/Server/Utils/InstanceHealth/RedisHealth.test.ts +38 -418
- package/Tests/Server/Utils/Monitor/AffectedResourceList.test.ts +518 -0
- package/Tests/Server/Utils/Monitor/Criteria/EvaluateOverTime.test.ts +24 -4
- package/Tests/Server/Utils/Monitor/MonitorCriteriaEvaluator.test.ts +934 -96
- package/Tests/Server/Utils/Monitor/MonitoringIntervalValidator.test.ts +188 -0
- package/Tests/Server/Utils/Workspace/Slack/SlackMarkdownSectionSplit.test.ts +1209 -0
- package/Tests/Types/API/HostnameFromAuthority.test.ts +20 -10
- package/Tests/Types/API/HostnameIPv6.test.ts +149 -0
- package/Tests/Types/Database/CanonicalModelInstance.test.ts +190 -0
- package/Tests/UI/Components/EditionLabelLapseCopy.ts +104 -0
- package/Tests/UI/Components/EditionLabelLicenseManagerWiring.test.tsx +254 -0
- package/Tests/UI/Components/EditionLabelLicenseRefresh.test.tsx +84 -178
- package/Tests/UI/Components/EditionLabelLicenseStatus.test.tsx +1586 -0
- package/Tests/UI/Components/EditionLabelLicenseWritesGuard.test.tsx +157 -0
- package/Tests/UI/Components/Graphs/DayUptimeGraph.test.tsx +49 -2
- package/Tests/UI/Components/MarkdownConverters.test.ts +684 -0
- package/Tests/UI/Components/ModelListEmptyState.test.tsx +289 -0
- package/Tests/UI/Components/TelemetryViewer/TelemetryViewerEmptyContent.test.tsx +131 -0
- package/Tests/UI/EsbuildEnterpriseAlias.test.ts +1127 -0
- package/Tests/Utils/HostAddressUtil.test.ts +138 -0
- package/Tests/Utils/Monitor/MonitorDestinationUtil.test.ts +313 -0
- package/Tests/Utils/Monitor/MonitoringIntervalUtil.test.ts +304 -0
- package/Tests/Utils/StatusPage/UptimeDailyAggregateUtil.test.ts +248 -0
- package/Types/API/Hostname.ts +63 -16
- package/Types/Database/AccessControl/ColumnAccessControl.ts +19 -7
- package/Types/Database/AccessControl/ColumnBillingAccessControl.ts +19 -7
- package/Types/Database/AccessControl/OwnerOnlyColumn.ts +15 -6
- package/Types/Database/CanonicalModelInstance.ts +102 -0
- package/Types/Database/TableColumn.ts +20 -6
- package/Types/EnterpriseLicense/EnterpriseLicensePeriods.ts +29 -0
- package/Types/IP/IPv6.ts +6 -1
- package/Types/Monitor/MonitorStep.ts +6 -1
- package/Types/Monitor/ProxmoxAlertTemplates.ts +1 -1
- package/Types/StatusPage/UptimeDailyAggregate.ts +110 -0
- package/UI/Components/EditionLabel/EditionLabel.tsx +796 -1195
- package/UI/Components/EditionLabel/LicenseManager.ts +119 -0
- package/UI/Components/Graphs/DayUptimeGraph.tsx +123 -15
- package/UI/Components/Markdown.tsx/MarkdownConverters.ts +0 -0
- package/UI/Components/ModelList/ModelList.tsx +11 -1
- package/UI/Components/MonitorGraphs/Uptime.tsx +69 -0
- package/UI/Components/TelemetryViewer/TelemetryViewer.tsx +28 -12
- package/UI/esbuild-enterprise.js +263 -0
- package/Utils/EnterpriseLicense/EnterpriseLicenseUsage.ts +7 -2
- package/Utils/HostAddressUtil.ts +94 -0
- package/Utils/Monitor/MonitorDestinationUtil.ts +157 -0
- package/Utils/Monitor/MonitoringIntervalUtil.ts +436 -0
- package/Utils/StatusPage/UptimeDailyAggregateUtil.ts +192 -0
- package/build/dist/Models/AnalyticsModels/AuditLog.js +23 -15
- package/build/dist/Models/AnalyticsModels/AuditLog.js.map +1 -1
- package/build/dist/Models/DatabaseModels/GlobalConfig.js +25 -0
- package/build/dist/Models/DatabaseModels/GlobalConfig.js.map +1 -1
- package/build/dist/Models/DatabaseModels/Monitor.js +2 -2
- package/build/dist/Models/DatabaseModels/Monitor.js.map +1 -1
- package/build/dist/Models/DatabaseModels/MonitorTemplate.js +2 -1
- package/build/dist/Models/DatabaseModels/MonitorTemplate.js.map +1 -1
- package/build/dist/Server/API/BaseAPI.js +26 -5
- package/build/dist/Server/API/BaseAPI.js.map +1 -1
- package/build/dist/Server/API/GlobalConfigAPI.js +148 -344
- package/build/dist/Server/API/GlobalConfigAPI.js.map +1 -1
- package/build/dist/Server/API/ProjectOIDC.js +24 -16
- package/build/dist/Server/API/ProjectOIDC.js.map +1 -1
- package/build/dist/Server/API/ProjectSSO.js +24 -16
- package/build/dist/Server/API/ProjectSSO.js.map +1 -1
- package/build/dist/Server/API/StatusPageAPI.js +93 -43
- package/build/dist/Server/API/StatusPageAPI.js.map +1 -1
- package/build/dist/Server/API/TeamMemberAPI.js +8 -1
- package/build/dist/Server/API/TeamMemberAPI.js.map +1 -1
- package/build/dist/Server/Enterprise/EnterpriseEdition.js +466 -0
- package/build/dist/Server/Enterprise/EnterpriseEdition.js.map +1 -0
- package/build/dist/Server/Enterprise/EnterpriseFeature.js +39 -0
- package/build/dist/Server/Enterprise/EnterpriseFeature.js.map +1 -0
- package/build/dist/Server/Enterprise/EnterpriseLicenseSnapshot.js +70 -0
- package/build/dist/Server/Enterprise/EnterpriseLicenseSnapshot.js.map +1 -0
- package/build/dist/Server/Enterprise/EnterpriseServerModule.js +84 -0
- package/build/dist/Server/Enterprise/EnterpriseServerModule.js.map +1 -0
- package/build/dist/Server/EnvironmentConfig.js +84 -2
- package/build/dist/Server/EnvironmentConfig.js.map +1 -1
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1793900000000-AddEnterpriseEditionFirstSeenAt.js +18 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1793900000000-AddEnterpriseEditionFirstSeenAt.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js +2 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js.map +1 -1
- package/build/dist/Server/Middleware/UserAuthorization.js +30 -11
- package/build/dist/Server/Middleware/UserAuthorization.js.map +1 -1
- package/build/dist/Server/Services/AuditLogService.js +71 -740
- package/build/dist/Server/Services/AuditLogService.js.map +1 -1
- package/build/dist/Server/Services/EnterpriseLicenseService.js +34 -0
- package/build/dist/Server/Services/EnterpriseLicenseService.js.map +1 -1
- package/build/dist/Server/Services/GlobalConfigService.js +63 -0
- package/build/dist/Server/Services/GlobalConfigService.js.map +1 -1
- package/build/dist/Server/Services/MonitorProbeService.js +90 -17
- package/build/dist/Server/Services/MonitorProbeService.js.map +1 -1
- package/build/dist/Server/Services/MonitorService.js +45 -4
- package/build/dist/Server/Services/MonitorService.js.map +1 -1
- package/build/dist/Server/Services/MonitorStatusTimelineService.js +242 -0
- package/build/dist/Server/Services/MonitorStatusTimelineService.js.map +1 -1
- package/build/dist/Server/Services/MonitorTemplateService.js +16 -0
- package/build/dist/Server/Services/MonitorTemplateService.js.map +1 -1
- package/build/dist/Server/Services/ProjectService.js +214 -0
- package/build/dist/Server/Services/ProjectService.js.map +1 -1
- package/build/dist/Server/Services/RumSessionPinService.js +24 -6
- package/build/dist/Server/Services/RumSessionPinService.js.map +1 -1
- package/build/dist/Server/Services/StatusPagePrivateUserService.js +7 -3
- package/build/dist/Server/Services/StatusPagePrivateUserService.js.map +1 -1
- package/build/dist/Server/Services/StatusPageService.js +71 -0
- package/build/dist/Server/Services/StatusPageService.js.map +1 -1
- package/build/dist/Server/Services/TeamMemberService.js +10 -0
- package/build/dist/Server/Services/TeamMemberService.js.map +1 -1
- package/build/dist/Server/Services/TeamService.js +9 -0
- package/build/dist/Server/Services/TeamService.js.map +1 -1
- package/build/dist/Server/Services/UserService.js +10 -16
- package/build/dist/Server/Services/UserService.js.map +1 -1
- package/build/dist/Server/Types/Database/Permissions/CreatePermission.js +10 -0
- package/build/dist/Server/Types/Database/Permissions/CreatePermission.js.map +1 -1
- package/build/dist/Server/Types/Database/Permissions/EditionPermission.js +154 -14
- package/build/dist/Server/Types/Database/Permissions/EditionPermission.js.map +1 -1
- package/build/dist/Server/Types/Database/Permissions/TablePermission.js +10 -3
- package/build/dist/Server/Types/Database/Permissions/TablePermission.js.map +1 -1
- package/build/dist/Server/Types/Database/Permissions/UpdatePermission.js +17 -0
- package/build/dist/Server/Types/Database/Permissions/UpdatePermission.js.map +1 -1
- package/build/dist/Server/Types/Markdown.js +31 -0
- package/build/dist/Server/Types/Markdown.js.map +1 -1
- package/build/dist/Server/Utils/CommunityEditionSsoReport.js +223 -0
- package/build/dist/Server/Utils/CommunityEditionSsoReport.js.map +1 -0
- package/build/dist/Server/Utils/EditionEnforcement.js +187 -0
- package/build/dist/Server/Utils/EditionEnforcement.js.map +1 -0
- package/build/dist/Server/Utils/FrontendEnvironment.js +31 -2
- package/build/dist/Server/Utils/FrontendEnvironment.js.map +1 -1
- package/build/dist/Server/Utils/InstanceHealth/RedisHealth.js +6 -193
- package/build/dist/Server/Utils/InstanceHealth/RedisHealth.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/AffectedResourceList.js +96 -0
- package/build/dist/Server/Utils/Monitor/AffectedResourceList.js.map +1 -0
- package/build/dist/Server/Utils/Monitor/Criteria/EvaluateOverTime.js +8 -1
- package/build/dist/Server/Utils/Monitor/Criteria/EvaluateOverTime.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorCriteriaEvaluator.js +449 -261
- package/build/dist/Server/Utils/Monitor/MonitorCriteriaEvaluator.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/MonitoringIntervalValidator.js +88 -0
- package/build/dist/Server/Utils/Monitor/MonitoringIntervalValidator.js.map +1 -0
- package/build/dist/Server/Utils/Workspace/Slack/Slack.js +331 -11
- package/build/dist/Server/Utils/Workspace/Slack/Slack.js.map +1 -1
- package/build/dist/Types/API/Hostname.js +59 -11
- package/build/dist/Types/API/Hostname.js.map +1 -1
- package/build/dist/Types/Database/AccessControl/ColumnAccessControl.js +19 -7
- package/build/dist/Types/Database/AccessControl/ColumnAccessControl.js.map +1 -1
- package/build/dist/Types/Database/AccessControl/ColumnBillingAccessControl.js +19 -7
- package/build/dist/Types/Database/AccessControl/ColumnBillingAccessControl.js.map +1 -1
- package/build/dist/Types/Database/AccessControl/OwnerOnlyColumn.js +13 -6
- package/build/dist/Types/Database/AccessControl/OwnerOnlyColumn.js.map +1 -1
- package/build/dist/Types/Database/CanonicalModelInstance.js +88 -0
- package/build/dist/Types/Database/CanonicalModelInstance.js.map +1 -0
- package/build/dist/Types/Database/TableColumn.js +19 -6
- package/build/dist/Types/Database/TableColumn.js.map +1 -1
- package/build/dist/Types/EnterpriseLicense/EnterpriseLicensePeriods.js +28 -0
- package/build/dist/Types/EnterpriseLicense/EnterpriseLicensePeriods.js.map +1 -0
- package/build/dist/Types/IP/IPv6.js +6 -1
- package/build/dist/Types/IP/IPv6.js.map +1 -1
- package/build/dist/Types/Monitor/MonitorStep.js +5 -0
- package/build/dist/Types/Monitor/MonitorStep.js.map +1 -1
- package/build/dist/Types/Monitor/ProxmoxAlertTemplates.js +1 -1
- package/build/dist/Types/StatusPage/UptimeDailyAggregate.js +32 -0
- package/build/dist/Types/StatusPage/UptimeDailyAggregate.js.map +1 -0
- package/build/dist/UI/Components/EditionLabel/EditionLabel.js +414 -585
- package/build/dist/UI/Components/EditionLabel/EditionLabel.js.map +1 -1
- package/build/dist/UI/Components/EditionLabel/LicenseManager.js +2 -0
- package/build/dist/UI/Components/EditionLabel/LicenseManager.js.map +1 -0
- package/build/dist/UI/Components/Graphs/DayUptimeGraph.js +90 -17
- package/build/dist/UI/Components/Graphs/DayUptimeGraph.js.map +1 -1
- package/build/dist/UI/Components/Markdown.tsx/MarkdownConverters.js +0 -0
- package/build/dist/UI/Components/Markdown.tsx/MarkdownConverters.js.map +1 -1
- package/build/dist/UI/Components/ModelList/ModelList.js +4 -1
- package/build/dist/UI/Components/ModelList/ModelList.js.map +1 -1
- package/build/dist/UI/Components/MonitorGraphs/Uptime.js +42 -1
- package/build/dist/UI/Components/MonitorGraphs/Uptime.js.map +1 -1
- package/build/dist/UI/Components/TelemetryViewer/TelemetryViewer.js +2 -2
- package/build/dist/UI/Components/TelemetryViewer/TelemetryViewer.js.map +1 -1
- package/build/dist/Utils/EnterpriseLicense/EnterpriseLicenseUsage.js +6 -2
- package/build/dist/Utils/EnterpriseLicense/EnterpriseLicenseUsage.js.map +1 -1
- package/build/dist/Utils/HostAddressUtil.js +80 -0
- package/build/dist/Utils/HostAddressUtil.js.map +1 -0
- package/build/dist/Utils/Monitor/MonitorDestinationUtil.js +127 -0
- package/build/dist/Utils/Monitor/MonitorDestinationUtil.js.map +1 -0
- package/build/dist/Utils/Monitor/MonitoringIntervalUtil.js +374 -0
- package/build/dist/Utils/Monitor/MonitoringIntervalUtil.js.map +1 -0
- package/build/dist/Utils/StatusPage/UptimeDailyAggregateUtil.js +148 -0
- package/build/dist/Utils/StatusPage/UptimeDailyAggregateUtil.js.map +1 -0
- package/jest.config.json +3 -1
- package/package.json +1 -1
- package/test-setup.sh +103 -34
- package/tsconfig.json +13 -0
- package/Server/API/EnterpriseLicenseAPI.ts +0 -925
- package/Server/API/TeamComplianceAPI.ts +0 -158
- package/Server/Middleware/SCIMAuthorization.ts +0 -141
- package/Server/Services/TeamComplianceService.ts +0 -733
- package/Server/Utils/EnterpriseLicense/EnterpriseLicenseSeatUtil.ts +0 -186
- package/Server/Utils/InstanceHealth/PostgresHealth.ts +0 -286
- package/Tests/App/AdminDashboard/EnterpriseLicenseInstanceActivity.test.tsx +0 -451
- package/Tests/App/Dashboard/AuditLogsTable.test.tsx +0 -598
- package/Tests/App/Dashboard/SecurityEventsExplorer.test.tsx +0 -761
- package/Tests/App/Dashboard/SecurityEventsSideMenu.test.tsx +0 -247
- package/Tests/App/Dashboard/SecurityEventsTableColumns.test.tsx +0 -382
- package/Tests/App/Dashboard/SecurityEventsVolumeChart.test.tsx +0 -321
- package/Tests/Server/API/EnterpriseLicenseReportUserCount.test.ts +0 -1851
- package/Tests/Server/Middleware/SCIMAuthorization.test.ts +0 -525
- package/Tests/Server/Services/TeamComplianceServiceBehaviour.test.ts +0 -1845
- package/Tests/Server/Utils/EnterpriseLicense/EnterpriseLicenseSeatUtil.test.ts +0 -495
- package/Tests/Server/Utils/InstanceHealth/PostgresHealth.test.ts +0 -337
- package/Tests/Utils/EnterpriseLicenseSeats.test.ts +0 -576
- package/Tests/Utils/EnterpriseLicenseSync.test.ts +0 -568
- package/Utils/EnterpriseLicense/EnterpriseLicenseSeats.ts +0 -287
- package/Utils/EnterpriseLicense/EnterpriseLicenseSync.ts +0 -244
- package/build/dist/Server/API/EnterpriseLicenseAPI.js +0 -646
- package/build/dist/Server/API/EnterpriseLicenseAPI.js.map +0 -1
- package/build/dist/Server/API/TeamComplianceAPI.js +0 -111
- package/build/dist/Server/API/TeamComplianceAPI.js.map +0 -1
- package/build/dist/Server/Middleware/SCIMAuthorization.js +0 -124
- package/build/dist/Server/Middleware/SCIMAuthorization.js.map +0 -1
- package/build/dist/Server/Services/TeamComplianceService.js +0 -537
- package/build/dist/Server/Services/TeamComplianceService.js.map +0 -1
- package/build/dist/Server/Utils/EnterpriseLicense/EnterpriseLicenseSeatUtil.js +0 -145
- package/build/dist/Server/Utils/EnterpriseLicense/EnterpriseLicenseSeatUtil.js.map +0 -1
- package/build/dist/Server/Utils/InstanceHealth/PostgresHealth.js +0 -194
- package/build/dist/Server/Utils/InstanceHealth/PostgresHealth.js.map +0 -1
- package/build/dist/Utils/EnterpriseLicense/EnterpriseLicenseSeats.js +0 -168
- package/build/dist/Utils/EnterpriseLicense/EnterpriseLicenseSeats.js.map +0 -1
- package/build/dist/Utils/EnterpriseLicense/EnterpriseLicenseSync.js +0 -174
- package/build/dist/Utils/EnterpriseLicense/EnterpriseLicenseSync.js.map +0 -1
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
import { describe, expect, test } from "@jest/globals";
|
|
2
|
+
import EnterpriseFeature, {
|
|
3
|
+
ALL_ENTERPRISE_FEATURES,
|
|
4
|
+
ENTERPRISE_FEATURE_WILDCARD,
|
|
5
|
+
parseEnterpriseFeature,
|
|
6
|
+
} from "../../../Server/Enterprise/EnterpriseFeature";
|
|
7
|
+
import {
|
|
8
|
+
ENTERPRISE_LICENSE_GRACE_PERIOD_IN_DAYS,
|
|
9
|
+
ENTERPRISE_LICENSE_TRIAL_PERIOD_IN_DAYS,
|
|
10
|
+
EnterpriseLicenseSnapshot,
|
|
11
|
+
EnterpriseLicenseSnapshotUtil,
|
|
12
|
+
EnterpriseLicenseStatus,
|
|
13
|
+
} from "../../../Server/Enterprise/EnterpriseLicenseSnapshot";
|
|
14
|
+
import {
|
|
15
|
+
createLicenseSnapshot,
|
|
16
|
+
createLicenseSnapshotWithStatus,
|
|
17
|
+
} from "./FakeEnterpriseModule";
|
|
18
|
+
|
|
19
|
+
describe("EnterpriseFeature", () => {
|
|
20
|
+
test("the license claim values are the documented strings", () => {
|
|
21
|
+
/*
|
|
22
|
+
* These strings are part of every issued license. Changing one silently
|
|
23
|
+
* revokes that feature from licenses already in the field.
|
|
24
|
+
*/
|
|
25
|
+
expect(EnterpriseFeature.SSO).toBe("sso");
|
|
26
|
+
expect(EnterpriseFeature.SCIM).toBe("scim");
|
|
27
|
+
expect(EnterpriseFeature.TeamCompliance).toBe("team-compliance");
|
|
28
|
+
expect(EnterpriseFeature.AuditLogs).toBe("audit-logs");
|
|
29
|
+
expect(EnterpriseFeature.InstanceHealth).toBe("instance-health");
|
|
30
|
+
expect(ENTERPRISE_FEATURE_WILDCARD).toBe("*");
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
test("ALL_ENTERPRISE_FEATURES lists every feature exactly once", () => {
|
|
34
|
+
expect([...ALL_ENTERPRISE_FEATURES].sort()).toEqual(
|
|
35
|
+
[
|
|
36
|
+
"audit-logs",
|
|
37
|
+
"instance-health",
|
|
38
|
+
"scim",
|
|
39
|
+
"sso",
|
|
40
|
+
"team-compliance",
|
|
41
|
+
].sort(),
|
|
42
|
+
);
|
|
43
|
+
expect(new Set(ALL_ENTERPRISE_FEATURES).size).toBe(
|
|
44
|
+
ALL_ENTERPRISE_FEATURES.length,
|
|
45
|
+
);
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
test.each(
|
|
49
|
+
ALL_ENTERPRISE_FEATURES.map((feature: EnterpriseFeature) => {
|
|
50
|
+
return [feature];
|
|
51
|
+
}),
|
|
52
|
+
)("parseEnterpriseFeature accepts %s", (feature: EnterpriseFeature) => {
|
|
53
|
+
expect(parseEnterpriseFeature(feature)).toBe(feature);
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
test.each([
|
|
57
|
+
"*",
|
|
58
|
+
"SSO",
|
|
59
|
+
" sso",
|
|
60
|
+
"sso ",
|
|
61
|
+
"future-feature",
|
|
62
|
+
"",
|
|
63
|
+
null,
|
|
64
|
+
undefined,
|
|
65
|
+
7,
|
|
66
|
+
["sso"],
|
|
67
|
+
{ feature: "sso" },
|
|
68
|
+
] as Array<unknown>)(
|
|
69
|
+
"parseEnterpriseFeature rejects %p without throwing",
|
|
70
|
+
(value: unknown) => {
|
|
71
|
+
expect(parseEnterpriseFeature(value)).toBeNull();
|
|
72
|
+
},
|
|
73
|
+
);
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
describe("EnterpriseLicenseSnapshotUtil", () => {
|
|
77
|
+
/*
|
|
78
|
+
* Two periods, two lengths (the owner's decision): 30 days of grace after a
|
|
79
|
+
* license expires, and a 14-day trial for an Enterprise install that never
|
|
80
|
+
* had a license.
|
|
81
|
+
*/
|
|
82
|
+
test("the grace period after a license expires is thirty days", () => {
|
|
83
|
+
expect(ENTERPRISE_LICENSE_GRACE_PERIOD_IN_DAYS).toBe(30);
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
test("the trial of an install with no license is fourteen days", () => {
|
|
87
|
+
expect(ENTERPRISE_LICENSE_TRIAL_PERIOD_IN_DAYS).toBe(14);
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
test("the server reads the same constants the browser copy derives from", () => {
|
|
91
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires
|
|
92
|
+
const periods: typeof import("../../../Types/EnterpriseLicense/EnterpriseLicensePeriods") = require("../../../Types/EnterpriseLicense/EnterpriseLicensePeriods");
|
|
93
|
+
|
|
94
|
+
expect(ENTERPRISE_LICENSE_GRACE_PERIOD_IN_DAYS).toBe(
|
|
95
|
+
periods.ENTERPRISE_LICENSE_GRACE_PERIOD_IN_DAYS,
|
|
96
|
+
);
|
|
97
|
+
expect(ENTERPRISE_LICENSE_TRIAL_PERIOD_IN_DAYS).toBe(
|
|
98
|
+
periods.ENTERPRISE_LICENSE_TRIAL_PERIOD_IN_DAYS,
|
|
99
|
+
);
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
test.each([
|
|
103
|
+
["valid", true],
|
|
104
|
+
["grace", true],
|
|
105
|
+
["missing", false],
|
|
106
|
+
["expired", false],
|
|
107
|
+
["invalid", false],
|
|
108
|
+
] as Array<[EnterpriseLicenseStatus, boolean]>)(
|
|
109
|
+
"a %s license is usable: %s",
|
|
110
|
+
(status: EnterpriseLicenseStatus, usable: boolean) => {
|
|
111
|
+
expect(
|
|
112
|
+
EnterpriseLicenseSnapshotUtil.isUsable(
|
|
113
|
+
createLicenseSnapshotWithStatus(status),
|
|
114
|
+
),
|
|
115
|
+
).toBe(usable);
|
|
116
|
+
},
|
|
117
|
+
);
|
|
118
|
+
|
|
119
|
+
test("no snapshot is not usable and includes nothing", () => {
|
|
120
|
+
expect(EnterpriseLicenseSnapshotUtil.isUsable(null)).toBe(false);
|
|
121
|
+
expect(
|
|
122
|
+
EnterpriseLicenseSnapshotUtil.includesFeature(
|
|
123
|
+
null,
|
|
124
|
+
EnterpriseFeature.SSO,
|
|
125
|
+
),
|
|
126
|
+
).toBe(false);
|
|
127
|
+
expect(
|
|
128
|
+
EnterpriseLicenseSnapshotUtil.entitles(null, EnterpriseFeature.SSO),
|
|
129
|
+
).toBe(false);
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
test("an 'all' license includes every feature", () => {
|
|
133
|
+
const snapshot: EnterpriseLicenseSnapshot = createLicenseSnapshot({
|
|
134
|
+
features: "all",
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
for (const feature of ALL_ENTERPRISE_FEATURES) {
|
|
138
|
+
expect(
|
|
139
|
+
EnterpriseLicenseSnapshotUtil.includesFeature(snapshot, feature),
|
|
140
|
+
).toBe(true);
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
test("a subset license includes only its features", () => {
|
|
145
|
+
const snapshot: EnterpriseLicenseSnapshot = createLicenseSnapshot({
|
|
146
|
+
features: [EnterpriseFeature.SSO, EnterpriseFeature.AuditLogs],
|
|
147
|
+
});
|
|
148
|
+
|
|
149
|
+
expect(
|
|
150
|
+
EnterpriseLicenseSnapshotUtil.includesFeature(
|
|
151
|
+
snapshot,
|
|
152
|
+
EnterpriseFeature.SSO,
|
|
153
|
+
),
|
|
154
|
+
).toBe(true);
|
|
155
|
+
expect(
|
|
156
|
+
EnterpriseLicenseSnapshotUtil.includesFeature(
|
|
157
|
+
snapshot,
|
|
158
|
+
EnterpriseFeature.AuditLogs,
|
|
159
|
+
),
|
|
160
|
+
).toBe(true);
|
|
161
|
+
expect(
|
|
162
|
+
EnterpriseLicenseSnapshotUtil.includesFeature(
|
|
163
|
+
snapshot,
|
|
164
|
+
EnterpriseFeature.SCIM,
|
|
165
|
+
),
|
|
166
|
+
).toBe(false);
|
|
167
|
+
});
|
|
168
|
+
|
|
169
|
+
test("an empty or malformed features value includes nothing", () => {
|
|
170
|
+
for (const features of [
|
|
171
|
+
[],
|
|
172
|
+
"everything",
|
|
173
|
+
undefined,
|
|
174
|
+
null,
|
|
175
|
+
] as Array<unknown>) {
|
|
176
|
+
const snapshot: EnterpriseLicenseSnapshot = createLicenseSnapshot({
|
|
177
|
+
features: features as EnterpriseLicenseSnapshot["features"],
|
|
178
|
+
});
|
|
179
|
+
|
|
180
|
+
expect(
|
|
181
|
+
EnterpriseLicenseSnapshotUtil.includesFeature(
|
|
182
|
+
snapshot,
|
|
183
|
+
EnterpriseFeature.SSO,
|
|
184
|
+
),
|
|
185
|
+
).toBe(false);
|
|
186
|
+
}
|
|
187
|
+
});
|
|
188
|
+
|
|
189
|
+
test("entitles needs both a usable status and the feature", () => {
|
|
190
|
+
expect(
|
|
191
|
+
EnterpriseLicenseSnapshotUtil.entitles(
|
|
192
|
+
createLicenseSnapshotWithStatus("grace", {
|
|
193
|
+
features: [EnterpriseFeature.SCIM],
|
|
194
|
+
}),
|
|
195
|
+
EnterpriseFeature.SCIM,
|
|
196
|
+
),
|
|
197
|
+
).toBe(true);
|
|
198
|
+
expect(
|
|
199
|
+
EnterpriseLicenseSnapshotUtil.entitles(
|
|
200
|
+
createLicenseSnapshotWithStatus("expired", { features: "all" }),
|
|
201
|
+
EnterpriseFeature.SCIM,
|
|
202
|
+
),
|
|
203
|
+
).toBe(false);
|
|
204
|
+
expect(
|
|
205
|
+
EnterpriseLicenseSnapshotUtil.entitles(
|
|
206
|
+
createLicenseSnapshotWithStatus("valid", {
|
|
207
|
+
features: [EnterpriseFeature.SSO],
|
|
208
|
+
}),
|
|
209
|
+
EnterpriseFeature.SCIM,
|
|
210
|
+
),
|
|
211
|
+
).toBe(false);
|
|
212
|
+
});
|
|
213
|
+
|
|
214
|
+
test("createMissing is an unverified-nothing snapshot with a message", () => {
|
|
215
|
+
const snapshot: EnterpriseLicenseSnapshot =
|
|
216
|
+
EnterpriseLicenseSnapshotUtil.createMissing();
|
|
217
|
+
|
|
218
|
+
expect(snapshot).toEqual({
|
|
219
|
+
status: "missing",
|
|
220
|
+
verification: "none",
|
|
221
|
+
userLimit: null,
|
|
222
|
+
isEvaluation: false,
|
|
223
|
+
features: [],
|
|
224
|
+
message: "No OneUptime Enterprise license is installed.",
|
|
225
|
+
});
|
|
226
|
+
expect(EnterpriseLicenseSnapshotUtil.isUsable(snapshot)).toBe(false);
|
|
227
|
+
expect(EnterpriseLicenseSnapshotUtil.createMissing("custom").message).toBe(
|
|
228
|
+
"custom",
|
|
229
|
+
);
|
|
230
|
+
});
|
|
231
|
+
|
|
232
|
+
describe("isTrialStartUnknown", () => {
|
|
233
|
+
test("is true only for 'missing' with no graceEndsAt", () => {
|
|
234
|
+
expect(
|
|
235
|
+
EnterpriseLicenseSnapshotUtil.isTrialStartUnknown(
|
|
236
|
+
createLicenseSnapshotWithStatus("missing", {
|
|
237
|
+
graceEndsAt: undefined,
|
|
238
|
+
}),
|
|
239
|
+
),
|
|
240
|
+
).toBe(true);
|
|
241
|
+
// What the provider answers when nothing could be read at all.
|
|
242
|
+
expect(
|
|
243
|
+
EnterpriseLicenseSnapshotUtil.isTrialStartUnknown(
|
|
244
|
+
EnterpriseLicenseSnapshotUtil.createMissing(),
|
|
245
|
+
),
|
|
246
|
+
).toBe(true);
|
|
247
|
+
});
|
|
248
|
+
|
|
249
|
+
test("a trial that is known to be over is not unknown", () => {
|
|
250
|
+
expect(
|
|
251
|
+
EnterpriseLicenseSnapshotUtil.isTrialStartUnknown(
|
|
252
|
+
createLicenseSnapshotWithStatus("missing", {
|
|
253
|
+
graceEndsAt: new Date(Date.now() - 1000),
|
|
254
|
+
}),
|
|
255
|
+
),
|
|
256
|
+
).toBe(false);
|
|
257
|
+
// The test kit's "missing" is the known lapse.
|
|
258
|
+
expect(
|
|
259
|
+
EnterpriseLicenseSnapshotUtil.isTrialStartUnknown(
|
|
260
|
+
createLicenseSnapshotWithStatus("missing"),
|
|
261
|
+
),
|
|
262
|
+
).toBe(false);
|
|
263
|
+
});
|
|
264
|
+
|
|
265
|
+
test("every other status, and no snapshot, is not about the trial start", () => {
|
|
266
|
+
for (const status of [
|
|
267
|
+
"valid",
|
|
268
|
+
"grace",
|
|
269
|
+
"expired",
|
|
270
|
+
"invalid",
|
|
271
|
+
] as Array<EnterpriseLicenseStatus>) {
|
|
272
|
+
expect(
|
|
273
|
+
EnterpriseLicenseSnapshotUtil.isTrialStartUnknown(
|
|
274
|
+
createLicenseSnapshotWithStatus(status, { graceEndsAt: undefined }),
|
|
275
|
+
),
|
|
276
|
+
).toBe(false);
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
expect(EnterpriseLicenseSnapshotUtil.isTrialStartUnknown(null)).toBe(
|
|
280
|
+
false,
|
|
281
|
+
);
|
|
282
|
+
});
|
|
283
|
+
});
|
|
284
|
+
|
|
285
|
+
test("createMissing returns a fresh object each time", () => {
|
|
286
|
+
const first: EnterpriseLicenseSnapshot =
|
|
287
|
+
EnterpriseLicenseSnapshotUtil.createMissing();
|
|
288
|
+
const second: EnterpriseLicenseSnapshot =
|
|
289
|
+
EnterpriseLicenseSnapshotUtil.createMissing();
|
|
290
|
+
|
|
291
|
+
expect(first).not.toBe(second);
|
|
292
|
+
expect(first.features).not.toBe(second.features);
|
|
293
|
+
});
|
|
294
|
+
});
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { describe, expect, test } from "@jest/globals";
|
|
2
|
+
import AllModelTypes from "../../../Models/DatabaseModels/Index";
|
|
3
|
+
import BaseModel from "../../../Models/DatabaseModels/DatabaseBaseModel/DatabaseBaseModel";
|
|
4
|
+
import GlobalOIDC from "../../../Models/DatabaseModels/GlobalOidc";
|
|
5
|
+
import GlobalOIDCProject from "../../../Models/DatabaseModels/GlobalOidcProject";
|
|
6
|
+
import GlobalSSO from "../../../Models/DatabaseModels/GlobalSso";
|
|
7
|
+
import GlobalSSOProject from "../../../Models/DatabaseModels/GlobalSsoProject";
|
|
8
|
+
import ProjectOIDC from "../../../Models/DatabaseModels/ProjectOidc";
|
|
9
|
+
import ProjectSCIM from "../../../Models/DatabaseModels/ProjectSCIM";
|
|
10
|
+
import ProjectSSO from "../../../Models/DatabaseModels/ProjectSso";
|
|
11
|
+
import StatusPageOIDC from "../../../Models/DatabaseModels/StatusPageOidc";
|
|
12
|
+
import StatusPageSCIM from "../../../Models/DatabaseModels/StatusPageSCIM";
|
|
13
|
+
import StatusPageSSO from "../../../Models/DatabaseModels/StatusPageSso";
|
|
14
|
+
import TeamComplianceSetting from "../../../Models/DatabaseModels/TeamComplianceSetting";
|
|
15
|
+
import Project from "../../../Models/DatabaseModels/Project";
|
|
16
|
+
import Monitor from "../../../Models/DatabaseModels/Monitor";
|
|
17
|
+
import EnterpriseEdition from "../../../Server/Enterprise/EnterpriseEdition";
|
|
18
|
+
import EnterpriseFeature from "../../../Server/Enterprise/EnterpriseFeature";
|
|
19
|
+
|
|
20
|
+
type ModelType = { new (): BaseModel };
|
|
21
|
+
|
|
22
|
+
/*
|
|
23
|
+
* The facade owns the model -> feature map so the eleven model files stay
|
|
24
|
+
* unchanged. These guards keep that map and the models'
|
|
25
|
+
* @TableEditionAccessControl({ requiresEnterprise: true }) decorators from
|
|
26
|
+
* drifting apart: a new enterprise model with no feature would otherwise be
|
|
27
|
+
* gated by nothing, or by the wrong license feature.
|
|
28
|
+
*/
|
|
29
|
+
describe("EnterpriseEdition.getModelFeature against the real models", () => {
|
|
30
|
+
test.each([
|
|
31
|
+
[GlobalSSO, EnterpriseFeature.SSO],
|
|
32
|
+
[GlobalOIDC, EnterpriseFeature.SSO],
|
|
33
|
+
[GlobalSSOProject, EnterpriseFeature.SSO],
|
|
34
|
+
[GlobalOIDCProject, EnterpriseFeature.SSO],
|
|
35
|
+
[ProjectSSO, EnterpriseFeature.SSO],
|
|
36
|
+
[ProjectOIDC, EnterpriseFeature.SSO],
|
|
37
|
+
[StatusPageSSO, EnterpriseFeature.SSO],
|
|
38
|
+
[StatusPageOIDC, EnterpriseFeature.SSO],
|
|
39
|
+
[ProjectSCIM, EnterpriseFeature.SCIM],
|
|
40
|
+
[StatusPageSCIM, EnterpriseFeature.SCIM],
|
|
41
|
+
[TeamComplianceSetting, EnterpriseFeature.TeamCompliance],
|
|
42
|
+
] as Array<[ModelType, EnterpriseFeature]>)(
|
|
43
|
+
"%p is gated by the expected feature",
|
|
44
|
+
(modelType: ModelType, feature: EnterpriseFeature) => {
|
|
45
|
+
expect(EnterpriseEdition.getModelFeature(modelType)).toBe(feature);
|
|
46
|
+
expect(new modelType().requiresEnterprise).toBe(true);
|
|
47
|
+
},
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
test("ordinary models map to no feature", () => {
|
|
51
|
+
expect(EnterpriseEdition.getModelFeature(Project)).toBeNull();
|
|
52
|
+
expect(EnterpriseEdition.getModelFeature(Monitor)).toBeNull();
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
test("every model marked requiresEnterprise has a feature", () => {
|
|
56
|
+
const unmapped: Array<string> = [];
|
|
57
|
+
|
|
58
|
+
for (const modelType of AllModelTypes as Array<ModelType>) {
|
|
59
|
+
const model: BaseModel = new modelType();
|
|
60
|
+
|
|
61
|
+
if (!model.requiresEnterprise) {
|
|
62
|
+
continue;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
if (!EnterpriseEdition.getModelFeature(modelType)) {
|
|
66
|
+
unmapped.push(model.tableName || modelType.name);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
expect(unmapped).toEqual([]);
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
test("every mapped table belongs to a registered model marked requiresEnterprise", () => {
|
|
74
|
+
const enterpriseTables: Set<string> = new Set<string>();
|
|
75
|
+
|
|
76
|
+
for (const modelType of AllModelTypes as Array<ModelType>) {
|
|
77
|
+
const model: BaseModel = new modelType();
|
|
78
|
+
|
|
79
|
+
if (model.requiresEnterprise && model.tableName) {
|
|
80
|
+
enterpriseTables.add(model.tableName);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
expect(
|
|
85
|
+
EnterpriseEdition.getMappedTableNames().filter((tableName: string) => {
|
|
86
|
+
return !enterpriseTables.has(tableName);
|
|
87
|
+
}),
|
|
88
|
+
).toEqual([]);
|
|
89
|
+
expect(enterpriseTables.size).toBe(
|
|
90
|
+
EnterpriseEdition.getMappedTableNames().length,
|
|
91
|
+
);
|
|
92
|
+
});
|
|
93
|
+
});
|