From 0b66fc2bcadabb780823816874228259378af5c5 Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Wed, 6 Nov 2024 01:38:02 +0100 Subject: [PATCH] refactor: Move file to upper package --- .../revanced/api/configuration/{schema => }/APISchema.kt | 2 +- .../configuration/repository/AnnouncementRepository.kt | 8 ++++---- .../configuration/repository/ConfigurationRepository.kt | 2 +- .../revanced/api/configuration/routes/Announcements.kt | 6 +++--- .../app/revanced/api/configuration/routes/ApiRoute.kt | 1 - .../app/revanced/api/configuration/routes/ManagerRoute.kt | 4 ++-- .../app/revanced/api/configuration/routes/PatchesRoute.kt | 6 +++--- .../api/configuration/services/AnnouncementService.kt | 2 +- .../app/revanced/api/configuration/services/ApiService.kt | 2 +- .../api/configuration/services/AuthenticationService.kt | 2 +- .../revanced/api/configuration/services/ManagerService.kt | 4 ++-- .../revanced/api/configuration/services/PatchesService.kt | 6 +++--- .../api/configuration/services/AnnouncementServiceTest.kt | 2 +- 13 files changed, 23 insertions(+), 24 deletions(-) rename src/main/kotlin/app/revanced/api/configuration/{schema => }/APISchema.kt (98%) diff --git a/src/main/kotlin/app/revanced/api/configuration/schema/APISchema.kt b/src/main/kotlin/app/revanced/api/configuration/APISchema.kt similarity index 98% rename from src/main/kotlin/app/revanced/api/configuration/schema/APISchema.kt rename to src/main/kotlin/app/revanced/api/configuration/APISchema.kt index 2d3200d..c4432ae 100644 --- a/src/main/kotlin/app/revanced/api/configuration/schema/APISchema.kt +++ b/src/main/kotlin/app/revanced/api/configuration/APISchema.kt @@ -1,4 +1,4 @@ -package app.revanced.api.configuration.schema +package app.revanced.api.configuration import kotlinx.datetime.LocalDateTime import kotlinx.serialization.Serializable diff --git a/src/main/kotlin/app/revanced/api/configuration/repository/AnnouncementRepository.kt b/src/main/kotlin/app/revanced/api/configuration/repository/AnnouncementRepository.kt index b425a86..01d74e2 100644 --- a/src/main/kotlin/app/revanced/api/configuration/repository/AnnouncementRepository.kt +++ b/src/main/kotlin/app/revanced/api/configuration/repository/AnnouncementRepository.kt @@ -1,9 +1,9 @@ package app.revanced.api.configuration.repository -import app.revanced.api.configuration.schema.ApiAnnouncement -import app.revanced.api.configuration.schema.ApiAnnouncementTag -import app.revanced.api.configuration.schema.ApiResponseAnnouncement -import app.revanced.api.configuration.schema.ApiResponseAnnouncementId +import app.revanced.api.configuration.ApiAnnouncement +import app.revanced.api.configuration.ApiAnnouncementTag +import app.revanced.api.configuration.ApiResponseAnnouncement +import app.revanced.api.configuration.ApiResponseAnnouncementId import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.runBlocking import org.jetbrains.exposed.dao.IntEntity diff --git a/src/main/kotlin/app/revanced/api/configuration/repository/ConfigurationRepository.kt b/src/main/kotlin/app/revanced/api/configuration/repository/ConfigurationRepository.kt index 4e78c71..e898857 100644 --- a/src/main/kotlin/app/revanced/api/configuration/repository/ConfigurationRepository.kt +++ b/src/main/kotlin/app/revanced/api/configuration/repository/ConfigurationRepository.kt @@ -1,6 +1,6 @@ package app.revanced.api.configuration.repository -import app.revanced.api.configuration.schema.APIAbout +import app.revanced.api.configuration.APIAbout import app.revanced.api.configuration.services.ManagerService import app.revanced.api.configuration.services.PatchesService import kotlinx.serialization.ExperimentalSerializationApi diff --git a/src/main/kotlin/app/revanced/api/configuration/routes/Announcements.kt b/src/main/kotlin/app/revanced/api/configuration/routes/Announcements.kt index 126b17c..bf759fe 100644 --- a/src/main/kotlin/app/revanced/api/configuration/routes/Announcements.kt +++ b/src/main/kotlin/app/revanced/api/configuration/routes/Announcements.kt @@ -1,12 +1,12 @@ package app.revanced.api.configuration.routes +import app.revanced.api.configuration.ApiAnnouncement +import app.revanced.api.configuration.ApiResponseAnnouncement +import app.revanced.api.configuration.ApiResponseAnnouncementId import app.revanced.api.configuration.canRespondUnauthorized import app.revanced.api.configuration.installCache import app.revanced.api.configuration.installNotarizedRoute import app.revanced.api.configuration.respondOrNotFound -import app.revanced.api.configuration.schema.ApiAnnouncement -import app.revanced.api.configuration.schema.ApiResponseAnnouncement -import app.revanced.api.configuration.schema.ApiResponseAnnouncementId import app.revanced.api.configuration.services.AnnouncementService import io.bkbn.kompendium.core.metadata.DeleteInfo import io.bkbn.kompendium.core.metadata.GetInfo diff --git a/src/main/kotlin/app/revanced/api/configuration/routes/ApiRoute.kt b/src/main/kotlin/app/revanced/api/configuration/routes/ApiRoute.kt index 862a4d9..423c3e6 100644 --- a/src/main/kotlin/app/revanced/api/configuration/routes/ApiRoute.kt +++ b/src/main/kotlin/app/revanced/api/configuration/routes/ApiRoute.kt @@ -6,7 +6,6 @@ import app.revanced.api.configuration.installNoCache import app.revanced.api.configuration.installNotarizedRoute import app.revanced.api.configuration.repository.ConfigurationRepository import app.revanced.api.configuration.respondOrNotFound -import app.revanced.api.configuration.schema.* import app.revanced.api.configuration.services.ApiService import app.revanced.api.configuration.services.AuthenticationService import io.bkbn.kompendium.core.metadata.* diff --git a/src/main/kotlin/app/revanced/api/configuration/routes/ManagerRoute.kt b/src/main/kotlin/app/revanced/api/configuration/routes/ManagerRoute.kt index 04f217f..0217c4b 100644 --- a/src/main/kotlin/app/revanced/api/configuration/routes/ManagerRoute.kt +++ b/src/main/kotlin/app/revanced/api/configuration/routes/ManagerRoute.kt @@ -1,8 +1,8 @@ package app.revanced.api.configuration.routes +import app.revanced.api.configuration.ApiRelease +import app.revanced.api.configuration.ApiReleaseVersion import app.revanced.api.configuration.installNotarizedRoute -import app.revanced.api.configuration.schema.ApiRelease -import app.revanced.api.configuration.schema.ApiReleaseVersion import app.revanced.api.configuration.services.ManagerService import io.bkbn.kompendium.core.metadata.GetInfo import io.ktor.http.* diff --git a/src/main/kotlin/app/revanced/api/configuration/routes/PatchesRoute.kt b/src/main/kotlin/app/revanced/api/configuration/routes/PatchesRoute.kt index ccf3529..59086d0 100644 --- a/src/main/kotlin/app/revanced/api/configuration/routes/PatchesRoute.kt +++ b/src/main/kotlin/app/revanced/api/configuration/routes/PatchesRoute.kt @@ -1,10 +1,10 @@ package app.revanced.api.configuration.routes +import app.revanced.api.configuration.ApiAssetPublicKey +import app.revanced.api.configuration.ApiRelease +import app.revanced.api.configuration.ApiReleaseVersion import app.revanced.api.configuration.installCache import app.revanced.api.configuration.installNotarizedRoute -import app.revanced.api.configuration.schema.ApiAssetPublicKey -import app.revanced.api.configuration.schema.ApiRelease -import app.revanced.api.configuration.schema.ApiReleaseVersion import app.revanced.api.configuration.services.PatchesService import io.bkbn.kompendium.core.metadata.GetInfo import io.ktor.http.* diff --git a/src/main/kotlin/app/revanced/api/configuration/services/AnnouncementService.kt b/src/main/kotlin/app/revanced/api/configuration/services/AnnouncementService.kt index ab0b804..b32d9f9 100644 --- a/src/main/kotlin/app/revanced/api/configuration/services/AnnouncementService.kt +++ b/src/main/kotlin/app/revanced/api/configuration/services/AnnouncementService.kt @@ -1,7 +1,7 @@ package app.revanced.api.configuration.services +import app.revanced.api.configuration.ApiAnnouncement import app.revanced.api.configuration.repository.AnnouncementRepository -import app.revanced.api.configuration.schema.ApiAnnouncement internal class AnnouncementService( private val announcementRepository: AnnouncementRepository, diff --git a/src/main/kotlin/app/revanced/api/configuration/services/ApiService.kt b/src/main/kotlin/app/revanced/api/configuration/services/ApiService.kt index 0e12f12..8825292 100644 --- a/src/main/kotlin/app/revanced/api/configuration/services/ApiService.kt +++ b/src/main/kotlin/app/revanced/api/configuration/services/ApiService.kt @@ -1,8 +1,8 @@ package app.revanced.api.configuration.services +import app.revanced.api.configuration.* import app.revanced.api.configuration.repository.BackendRepository import app.revanced.api.configuration.repository.ConfigurationRepository -import app.revanced.api.configuration.schema.* import io.ktor.http.* import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.async diff --git a/src/main/kotlin/app/revanced/api/configuration/services/AuthenticationService.kt b/src/main/kotlin/app/revanced/api/configuration/services/AuthenticationService.kt index a3150b1..b691ada 100644 --- a/src/main/kotlin/app/revanced/api/configuration/services/AuthenticationService.kt +++ b/src/main/kotlin/app/revanced/api/configuration/services/AuthenticationService.kt @@ -1,6 +1,6 @@ package app.revanced.api.configuration.services -import app.revanced.api.configuration.schema.ApiToken +import app.revanced.api.configuration.ApiToken import com.auth0.jwt.JWT import com.auth0.jwt.algorithms.Algorithm import io.ktor.server.auth.* diff --git a/src/main/kotlin/app/revanced/api/configuration/services/ManagerService.kt b/src/main/kotlin/app/revanced/api/configuration/services/ManagerService.kt index c180043..af53621 100644 --- a/src/main/kotlin/app/revanced/api/configuration/services/ManagerService.kt +++ b/src/main/kotlin/app/revanced/api/configuration/services/ManagerService.kt @@ -1,10 +1,10 @@ package app.revanced.api.configuration.services +import app.revanced.api.configuration.ApiRelease +import app.revanced.api.configuration.ApiReleaseVersion import app.revanced.api.configuration.repository.BackendRepository import app.revanced.api.configuration.repository.BackendRepository.BackendOrganization.BackendRepository.BackendRelease.Companion.first import app.revanced.api.configuration.repository.ConfigurationRepository -import app.revanced.api.configuration.schema.ApiRelease -import app.revanced.api.configuration.schema.ApiReleaseVersion internal class ManagerService( private val backendRepository: BackendRepository, diff --git a/src/main/kotlin/app/revanced/api/configuration/services/PatchesService.kt b/src/main/kotlin/app/revanced/api/configuration/services/PatchesService.kt index 08b1fb9..b9d3608 100644 --- a/src/main/kotlin/app/revanced/api/configuration/services/PatchesService.kt +++ b/src/main/kotlin/app/revanced/api/configuration/services/PatchesService.kt @@ -1,11 +1,11 @@ package app.revanced.api.configuration.services +import app.revanced.api.configuration.ApiAssetPublicKey +import app.revanced.api.configuration.ApiRelease +import app.revanced.api.configuration.ApiReleaseVersion import app.revanced.api.configuration.repository.BackendRepository import app.revanced.api.configuration.repository.BackendRepository.BackendOrganization.BackendRepository.BackendRelease.Companion.first import app.revanced.api.configuration.repository.ConfigurationRepository -import app.revanced.api.configuration.schema.ApiAssetPublicKey -import app.revanced.api.configuration.schema.ApiRelease -import app.revanced.api.configuration.schema.ApiReleaseVersion import app.revanced.library.serializeTo import app.revanced.patcher.patch.loadPatchesFromJar import com.github.benmanes.caffeine.cache.Caffeine diff --git a/src/test/kotlin/app/revanced/api/configuration/services/AnnouncementServiceTest.kt b/src/test/kotlin/app/revanced/api/configuration/services/AnnouncementServiceTest.kt index 5d18646..b2007a7 100644 --- a/src/test/kotlin/app/revanced/api/configuration/services/AnnouncementServiceTest.kt +++ b/src/test/kotlin/app/revanced/api/configuration/services/AnnouncementServiceTest.kt @@ -1,7 +1,7 @@ package app.revanced.api.configuration.services +import app.revanced.api.configuration.ApiAnnouncement import app.revanced.api.configuration.repository.AnnouncementRepository -import app.revanced.api.configuration.schema.ApiAnnouncement import kotlinx.coroutines.runBlocking import kotlinx.datetime.toKotlinLocalDateTime import org.jetbrains.exposed.sql.Database