diff --git a/.editorconfig b/.editorconfig index c6aac2005..67a7c72fa 100644 --- a/.editorconfig +++ b/.editorconfig @@ -10,6 +10,10 @@ trim_trailing_whitespace = true charset = utf-8 indent_style = tab tab_width = 4 +# Disable wildcard imports in IntelliJ/Android Studio +ij_kotlin_name_count_to_use_star_import = 1000 +ij_kotlin_name_count_to_use_star_import_for_members = 1000 +ij_kotlin_packages_to_use_import_on_demand = [*.xml] charset = utf-8 diff --git a/buildSrc/src/main/kotlin/Publishing.kt b/buildSrc/src/main/kotlin/Publishing.kt index 8d0cd47ce..643e50738 100644 --- a/buildSrc/src/main/kotlin/Publishing.kt +++ b/buildSrc/src/main/kotlin/Publishing.kt @@ -2,7 +2,11 @@ import org.gradle.api.Project import org.gradle.api.publish.PublishingExtension import org.gradle.api.publish.maven.MavenPublication import org.gradle.api.publish.maven.plugins.MavenPublishPlugin -import org.gradle.kotlin.dsl.* +import org.gradle.kotlin.dsl.apply +import org.gradle.kotlin.dsl.configure +import org.gradle.kotlin.dsl.getByType +import org.gradle.kotlin.dsl.provideDelegate +import org.gradle.kotlin.dsl.withType import org.gradle.plugins.signing.SigningExtension import org.gradle.plugins.signing.SigningPlugin diff --git a/detekt.yaml b/detekt.yaml index b4416e99f..923ebbb52 100644 --- a/detekt.yaml +++ b/detekt.yaml @@ -13,8 +13,6 @@ complexity: ignoreDeprecated: true style: - WildcardImport: - active: false LoopWithTooManyJumpStatements: maxJumpCount: 6 ReturnCount: diff --git a/jellyfin-api/src/commonMain/kotlin/org/jellyfin/sdk/api/client/RawResponse.kt b/jellyfin-api/src/commonMain/kotlin/org/jellyfin/sdk/api/client/RawResponse.kt index 02b657478..b8f462355 100644 --- a/jellyfin-api/src/commonMain/kotlin/org/jellyfin/sdk/api/client/RawResponse.kt +++ b/jellyfin-api/src/commonMain/kotlin/org/jellyfin/sdk/api/client/RawResponse.kt @@ -1,6 +1,6 @@ package org.jellyfin.sdk.api.client -import io.ktor.utils.io.* +import io.ktor.utils.io.ByteReadChannel import org.jellyfin.sdk.api.client.util.ApiSerializer public class RawResponse( diff --git a/jellyfin-api/src/commonMain/kotlin/org/jellyfin/sdk/api/client/util/ApiSerializer.kt b/jellyfin-api/src/commonMain/kotlin/org/jellyfin/sdk/api/client/util/ApiSerializer.kt index 35f660e83..43714637a 100644 --- a/jellyfin-api/src/commonMain/kotlin/org/jellyfin/sdk/api/client/util/ApiSerializer.kt +++ b/jellyfin-api/src/commonMain/kotlin/org/jellyfin/sdk/api/client/util/ApiSerializer.kt @@ -1,8 +1,13 @@ package org.jellyfin.sdk.api.client.util -import io.ktor.utils.io.* -import kotlinx.serialization.* +import io.ktor.utils.io.ByteReadChannel +import io.ktor.utils.io.readRemaining +import kotlinx.serialization.ExperimentalSerializationApi +import kotlinx.serialization.InternalSerializationApi +import kotlinx.serialization.KSerializer +import kotlinx.serialization.decodeFromString import kotlinx.serialization.json.Json +import kotlinx.serialization.serializer @OptIn(ExperimentalSerializationApi::class, InternalSerializationApi::class) public object ApiSerializer { diff --git a/jellyfin-api/src/commonMain/kotlin/org/jellyfin/sdk/api/client/util/UrlBuilder.kt b/jellyfin-api/src/commonMain/kotlin/org/jellyfin/sdk/api/client/util/UrlBuilder.kt index e0719c6fd..148fdbfa8 100644 --- a/jellyfin-api/src/commonMain/kotlin/org/jellyfin/sdk/api/client/util/UrlBuilder.kt +++ b/jellyfin-api/src/commonMain/kotlin/org/jellyfin/sdk/api/client/util/UrlBuilder.kt @@ -1,7 +1,9 @@ package org.jellyfin.sdk.api.client.util -import io.ktor.http.* -import io.ktor.util.* +import io.ktor.http.URLBuilder +import io.ktor.http.encodeURLParameter +import io.ktor.http.takeFrom +import io.ktor.util.InternalAPI import org.jellyfin.sdk.api.client.exception.MissingPathVariableException public object UrlBuilder { diff --git a/jellyfin-api/src/commonTest/kotlin/org/jellyfin/sdk/api/client/util/ApiSerializerTests.kt b/jellyfin-api/src/commonTest/kotlin/org/jellyfin/sdk/api/client/util/ApiSerializerTests.kt index 58bf1e47f..04532c5cf 100644 --- a/jellyfin-api/src/commonTest/kotlin/org/jellyfin/sdk/api/client/util/ApiSerializerTests.kt +++ b/jellyfin-api/src/commonTest/kotlin/org/jellyfin/sdk/api/client/util/ApiSerializerTests.kt @@ -1,7 +1,7 @@ package org.jellyfin.sdk.api.client.util -import io.ktor.utils.io.* -import io.ktor.utils.io.charsets.* +import io.ktor.utils.io.ByteReadChannel +import io.ktor.utils.io.charsets.Charsets import kotlinx.coroutines.test.runTest import kotlin.test.Test import kotlin.test.assertEquals diff --git a/jellyfin-api/src/jvmMain/kotlin/org/jellyfin/sdk/api/client/KtorClient.kt b/jellyfin-api/src/jvmMain/kotlin/org/jellyfin/sdk/api/client/KtorClient.kt index cccfa3e8d..26212303b 100644 --- a/jellyfin-api/src/jvmMain/kotlin/org/jellyfin/sdk/api/client/KtorClient.kt +++ b/jellyfin-api/src/jvmMain/kotlin/org/jellyfin/sdk/api/client/KtorClient.kt @@ -1,14 +1,19 @@ package org.jellyfin.sdk.api.client -import io.ktor.client.* -import io.ktor.client.call.* -import io.ktor.client.features.* -import io.ktor.client.request.* -import io.ktor.client.statement.* -import io.ktor.content.* -import io.ktor.http.* -import io.ktor.network.sockets.* -import io.ktor.util.* +import io.ktor.client.HttpClient +import io.ktor.client.call.NoTransformationFoundException +import io.ktor.client.features.HttpRequestTimeoutException +import io.ktor.client.features.HttpTimeout +import io.ktor.client.request.header +import io.ktor.client.request.request +import io.ktor.client.statement.HttpResponse +import io.ktor.content.TextContent +import io.ktor.http.ContentType +import io.ktor.http.HttpHeaders +import io.ktor.http.isSuccess +import io.ktor.network.sockets.ConnectTimeoutException +import io.ktor.network.sockets.SocketTimeoutException +import io.ktor.util.toMap import kotlinx.serialization.SerializationException import mu.KotlinLogging import org.jellyfin.sdk.api.client.exception.ApiClientException diff --git a/jellyfin-api/src/jvmMain/kotlin/org/jellyfin/sdk/api/sockets/WebSocketApi.kt b/jellyfin-api/src/jvmMain/kotlin/org/jellyfin/sdk/api/sockets/WebSocketApi.kt index f44704799..e37e10d2d 100644 --- a/jellyfin-api/src/jvmMain/kotlin/org/jellyfin/sdk/api/sockets/WebSocketApi.kt +++ b/jellyfin-api/src/jvmMain/kotlin/org/jellyfin/sdk/api/sockets/WebSocketApi.kt @@ -1,30 +1,114 @@ package org.jellyfin.sdk.api.sockets -import io.ktor.client.* -import io.ktor.client.features.* -import io.ktor.client.features.websocket.* -import io.ktor.http.* -import io.ktor.http.cio.websocket.* -import io.ktor.util.* -import kotlinx.coroutines.* +import io.ktor.client.HttpClient +import io.ktor.client.features.HttpTimeout +import io.ktor.client.features.websocket.WebSockets +import io.ktor.client.features.websocket.ws +import io.ktor.http.URLProtocol +import io.ktor.http.cio.websocket.Frame +import io.ktor.http.cio.websocket.readText +import io.ktor.http.takeFrom +import io.ktor.util.error +import kotlinx.coroutines.CoroutineScope +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.ExperimentalCoroutinesApi +import kotlinx.coroutines.Job import kotlinx.coroutines.channels.Channel import kotlinx.coroutines.channels.Channel.Factory.BUFFERED import kotlinx.coroutines.channels.ReceiveChannel import kotlinx.coroutines.channels.SendChannel import kotlinx.coroutines.channels.awaitClose -import kotlinx.coroutines.flow.* +import kotlinx.coroutines.delay +import kotlinx.coroutines.flow.Flow +import kotlinx.coroutines.flow.callbackFlow +import kotlinx.coroutines.flow.catch +import kotlinx.coroutines.flow.collect +import kotlinx.coroutines.flow.consumeAsFlow +import kotlinx.coroutines.flow.onCompletion +import kotlinx.coroutines.flow.onEach +import kotlinx.coroutines.flow.receiveAsFlow +import kotlinx.coroutines.joinAll +import kotlinx.coroutines.launch import kotlinx.serialization.ExperimentalSerializationApi import kotlinx.serialization.KSerializer import kotlinx.serialization.encodeToString -import kotlinx.serialization.json.* +import kotlinx.serialization.json.JsonObject +import kotlinx.serialization.json.buildJsonObject +import kotlinx.serialization.json.decodeFromJsonElement +import kotlinx.serialization.json.jsonObject +import kotlinx.serialization.json.jsonPrimitive +import kotlinx.serialization.json.put +import kotlinx.serialization.json.putJsonObject import kotlinx.serialization.serializer import mu.KotlinLogging import org.jellyfin.sdk.api.client.ApiClient import org.jellyfin.sdk.api.client.util.ApiSerializer import org.jellyfin.sdk.api.operations.Api import org.jellyfin.sdk.model.api.SessionMessageType -import org.jellyfin.sdk.model.api.SessionMessageType.* -import org.jellyfin.sdk.model.socket.* +import org.jellyfin.sdk.model.api.SessionMessageType.ACTIVITY_LOG_ENTRY +import org.jellyfin.sdk.model.api.SessionMessageType.ACTIVITY_LOG_ENTRY_START +import org.jellyfin.sdk.model.api.SessionMessageType.ACTIVITY_LOG_ENTRY_STOP +import org.jellyfin.sdk.model.api.SessionMessageType.FORCE_KEEP_ALIVE +import org.jellyfin.sdk.model.api.SessionMessageType.GENERAL_COMMAND +import org.jellyfin.sdk.model.api.SessionMessageType.KEEP_ALIVE +import org.jellyfin.sdk.model.api.SessionMessageType.LIBRARY_CHANGED +import org.jellyfin.sdk.model.api.SessionMessageType.PACKAGE_INSTALLATION_CANCELLED +import org.jellyfin.sdk.model.api.SessionMessageType.PACKAGE_INSTALLATION_COMPLETED +import org.jellyfin.sdk.model.api.SessionMessageType.PACKAGE_INSTALLATION_FAILED +import org.jellyfin.sdk.model.api.SessionMessageType.PACKAGE_INSTALLING +import org.jellyfin.sdk.model.api.SessionMessageType.PACKAGE_UNINSTALLED +import org.jellyfin.sdk.model.api.SessionMessageType.PLAY +import org.jellyfin.sdk.model.api.SessionMessageType.PLAYSTATE +import org.jellyfin.sdk.model.api.SessionMessageType.REFRESH_PROGRESS +import org.jellyfin.sdk.model.api.SessionMessageType.RESTART_REQUIRED +import org.jellyfin.sdk.model.api.SessionMessageType.SCHEDULED_TASKS_INFO +import org.jellyfin.sdk.model.api.SessionMessageType.SCHEDULED_TASKS_INFO_START +import org.jellyfin.sdk.model.api.SessionMessageType.SCHEDULED_TASKS_INFO_STOP +import org.jellyfin.sdk.model.api.SessionMessageType.SCHEDULED_TASK_ENDED +import org.jellyfin.sdk.model.api.SessionMessageType.SERIES_TIMER_CANCELLED +import org.jellyfin.sdk.model.api.SessionMessageType.SERIES_TIMER_CREATED +import org.jellyfin.sdk.model.api.SessionMessageType.SERVER_RESTARTING +import org.jellyfin.sdk.model.api.SessionMessageType.SERVER_SHUTTING_DOWN +import org.jellyfin.sdk.model.api.SessionMessageType.SESSIONS +import org.jellyfin.sdk.model.api.SessionMessageType.SESSIONS_START +import org.jellyfin.sdk.model.api.SessionMessageType.SESSIONS_STOP +import org.jellyfin.sdk.model.api.SessionMessageType.SYNC_PLAY_COMMAND +import org.jellyfin.sdk.model.api.SessionMessageType.SYNC_PLAY_GROUP_UPDATE +import org.jellyfin.sdk.model.api.SessionMessageType.TIMER_CANCELLED +import org.jellyfin.sdk.model.api.SessionMessageType.TIMER_CREATED +import org.jellyfin.sdk.model.api.SessionMessageType.USER_DATA_CHANGED +import org.jellyfin.sdk.model.api.SessionMessageType.USER_DELETED +import org.jellyfin.sdk.model.api.SessionMessageType.USER_UPDATED +import org.jellyfin.sdk.model.socket.ActivityLogEntryMessage +import org.jellyfin.sdk.model.socket.ForceKeepAliveMessage +import org.jellyfin.sdk.model.socket.GeneralCommandMessage +import org.jellyfin.sdk.model.socket.IncomingSocketMessage +import org.jellyfin.sdk.model.socket.KeepAliveMessage +import org.jellyfin.sdk.model.socket.LibraryChangedMessage +import org.jellyfin.sdk.model.socket.OutgoingSocketMessage +import org.jellyfin.sdk.model.socket.PackageInstallationCancelledMessage +import org.jellyfin.sdk.model.socket.PackageInstallationCompletedMessage +import org.jellyfin.sdk.model.socket.PackageInstallationFailedMessage +import org.jellyfin.sdk.model.socket.PackageInstallingMessage +import org.jellyfin.sdk.model.socket.PackageUninstalledMessage +import org.jellyfin.sdk.model.socket.PlayMessage +import org.jellyfin.sdk.model.socket.PlayStateMessage +import org.jellyfin.sdk.model.socket.RefreshProgressMessage +import org.jellyfin.sdk.model.socket.RestartRequiredMessage +import org.jellyfin.sdk.model.socket.ScheduledTaskEndedMessage +import org.jellyfin.sdk.model.socket.ScheduledTasksInfoMessage +import org.jellyfin.sdk.model.socket.SeriesTimerCancelledMessage +import org.jellyfin.sdk.model.socket.SeriesTimerCreatedMessage +import org.jellyfin.sdk.model.socket.ServerRestartingMessage +import org.jellyfin.sdk.model.socket.ServerShuttingDownMessage +import org.jellyfin.sdk.model.socket.SessionsMessage +import org.jellyfin.sdk.model.socket.SyncPlayCommandMessage +import org.jellyfin.sdk.model.socket.SyncPlayGroupUpdateMessage +import org.jellyfin.sdk.model.socket.TimerCancelledMessage +import org.jellyfin.sdk.model.socket.TimerCreatedMessage +import org.jellyfin.sdk.model.socket.UserDataChangedMessage +import org.jellyfin.sdk.model.socket.UserDeletedMessage +import org.jellyfin.sdk.model.socket.UserUpdatedMessage private val logger = KotlinLogging.logger {} diff --git a/jellyfin-core/src/commonMain/kotlin/org/jellyfin/sdk/discovery/AddressCandidateHelper.kt b/jellyfin-core/src/commonMain/kotlin/org/jellyfin/sdk/discovery/AddressCandidateHelper.kt index f8f740d5f..749a2b96b 100644 --- a/jellyfin-core/src/commonMain/kotlin/org/jellyfin/sdk/discovery/AddressCandidateHelper.kt +++ b/jellyfin-core/src/commonMain/kotlin/org/jellyfin/sdk/discovery/AddressCandidateHelper.kt @@ -1,6 +1,10 @@ package org.jellyfin.sdk.discovery -import io.ktor.http.* +import io.ktor.http.URLBuilder +import io.ktor.http.URLParserException +import io.ktor.http.URLProtocol +import io.ktor.http.Url +import io.ktor.http.takeFrom import mu.KotlinLogging private val logger = KotlinLogging.logger {} diff --git a/jellyfin-model/src/jvmTest/kotlin/org/jellyfin/sdk/model/extensions/GeneralCommandMessageExtensionTests.kt b/jellyfin-model/src/jvmTest/kotlin/org/jellyfin/sdk/model/extensions/GeneralCommandMessageExtensionTests.kt index 1e4b94593..4624a4c1d 100644 --- a/jellyfin-model/src/jvmTest/kotlin/org/jellyfin/sdk/model/extensions/GeneralCommandMessageExtensionTests.kt +++ b/jellyfin-model/src/jvmTest/kotlin/org/jellyfin/sdk/model/extensions/GeneralCommandMessageExtensionTests.kt @@ -2,7 +2,7 @@ package org.jellyfin.sdk.model.extensions import org.jellyfin.sdk.model.api.GeneralCommandType import org.jellyfin.sdk.model.socket.GeneralCommandMessage -import java.util.* +import java.util.UUID import kotlin.test.Test import kotlin.test.assertEquals diff --git a/jellyfin-model/src/jvmTest/kotlin/org/jellyfin/sdk/model/extensions/PairExtensionTestsJvm.kt b/jellyfin-model/src/jvmTest/kotlin/org/jellyfin/sdk/model/extensions/PairExtensionTestsJvm.kt index 115340042..73a13609f 100644 --- a/jellyfin-model/src/jvmTest/kotlin/org/jellyfin/sdk/model/extensions/PairExtensionTestsJvm.kt +++ b/jellyfin-model/src/jvmTest/kotlin/org/jellyfin/sdk/model/extensions/PairExtensionTestsJvm.kt @@ -1,7 +1,7 @@ package org.jellyfin.sdk.model.extensions import org.jellyfin.sdk.model.api.NameGuidPair -import java.util.* +import java.util.UUID import kotlin.test.Test import kotlin.test.assertEquals diff --git a/jellyfin-model/src/jvmTest/kotlin/org/jellyfin/sdk/model/serializer/UUIDSerializerTests.kt b/jellyfin-model/src/jvmTest/kotlin/org/jellyfin/sdk/model/serializer/UUIDSerializerTests.kt index ed72653f5..c320817d5 100644 --- a/jellyfin-model/src/jvmTest/kotlin/org/jellyfin/sdk/model/serializer/UUIDSerializerTests.kt +++ b/jellyfin-model/src/jvmTest/kotlin/org/jellyfin/sdk/model/serializer/UUIDSerializerTests.kt @@ -1,7 +1,7 @@ package org.jellyfin.sdk.model.serializer import kotlinx.serialization.json.Json -import java.util.* +import java.util.UUID import kotlin.test.Test import kotlin.test.assertEquals diff --git a/openapi-generator/src/main/kotlin/org/jellyfin/openapi/MainModule.kt b/openapi-generator/src/main/kotlin/org/jellyfin/openapi/MainModule.kt index 32f490792..c715c6a48 100644 --- a/openapi-generator/src/main/kotlin/org/jellyfin/openapi/MainModule.kt +++ b/openapi-generator/src/main/kotlin/org/jellyfin/openapi/MainModule.kt @@ -1,6 +1,10 @@ package org.jellyfin.openapi -import org.jellyfin.openapi.builder.api.* +import org.jellyfin.openapi.builder.api.ApiBuilder +import org.jellyfin.openapi.builder.api.ApiClientExtensionsBuilder +import org.jellyfin.openapi.builder.api.ApiNameBuilder +import org.jellyfin.openapi.builder.api.OperationBuilder +import org.jellyfin.openapi.builder.api.OperationUrlBuilder import org.jellyfin.openapi.builder.extra.DeprecatedAnnotationSpecBuilder import org.jellyfin.openapi.builder.extra.DescriptionBuilder import org.jellyfin.openapi.builder.extra.FileSpecBuilder @@ -9,7 +13,11 @@ import org.jellyfin.openapi.builder.model.EmptyModelBuilder import org.jellyfin.openapi.builder.model.EnumModelBuilder import org.jellyfin.openapi.builder.model.ModelBuilder import org.jellyfin.openapi.builder.model.ObjectModelBuilder -import org.jellyfin.openapi.builder.openapi.* +import org.jellyfin.openapi.builder.openapi.OpenApiApiServicesBuilder +import org.jellyfin.openapi.builder.openapi.OpenApiConstantsBuilder +import org.jellyfin.openapi.builder.openapi.OpenApiModelBuilder +import org.jellyfin.openapi.builder.openapi.OpenApiReturnTypeBuilder +import org.jellyfin.openapi.builder.openapi.OpenApiTypeBuilder import org.koin.dsl.module val mainModule = module { diff --git a/openapi-generator/src/main/kotlin/org/jellyfin/openapi/builder/api/ApiBuilder.kt b/openapi-generator/src/main/kotlin/org/jellyfin/openapi/builder/api/ApiBuilder.kt index 33697ab39..da5eb075f 100644 --- a/openapi-generator/src/main/kotlin/org/jellyfin/openapi/builder/api/ApiBuilder.kt +++ b/openapi-generator/src/main/kotlin/org/jellyfin/openapi/builder/api/ApiBuilder.kt @@ -1,6 +1,10 @@ package org.jellyfin.openapi.builder.api -import com.squareup.kotlinpoet.* +import com.squareup.kotlinpoet.ClassName +import com.squareup.kotlinpoet.FunSpec +import com.squareup.kotlinpoet.KModifier +import com.squareup.kotlinpoet.PropertySpec +import com.squareup.kotlinpoet.TypeSpec import org.jellyfin.openapi.builder.Builder import org.jellyfin.openapi.constants.Classes import org.jellyfin.openapi.constants.Packages diff --git a/openapi-generator/src/main/kotlin/org/jellyfin/openapi/builder/api/OperationBuilder.kt b/openapi-generator/src/main/kotlin/org/jellyfin/openapi/builder/api/OperationBuilder.kt index 9bdcc7d8e..2af5e03c6 100644 --- a/openapi-generator/src/main/kotlin/org/jellyfin/openapi/builder/api/OperationBuilder.kt +++ b/openapi-generator/src/main/kotlin/org/jellyfin/openapi/builder/api/OperationBuilder.kt @@ -1,6 +1,11 @@ package org.jellyfin.openapi.builder.api -import com.squareup.kotlinpoet.* +import com.squareup.kotlinpoet.ClassName +import com.squareup.kotlinpoet.FunSpec +import com.squareup.kotlinpoet.KModifier +import com.squareup.kotlinpoet.MemberName +import com.squareup.kotlinpoet.ParameterSpec +import com.squareup.kotlinpoet.ParameterizedTypeName import com.squareup.kotlinpoet.ParameterizedTypeName.Companion.plusParameter import org.jellyfin.openapi.builder.Builder import org.jellyfin.openapi.builder.extra.DeprecatedAnnotationSpecBuilder @@ -9,7 +14,11 @@ import org.jellyfin.openapi.constants.Classes import org.jellyfin.openapi.constants.Packages import org.jellyfin.openapi.constants.Strings import org.jellyfin.openapi.constants.Types -import org.jellyfin.openapi.model.* +import org.jellyfin.openapi.model.ApiServiceOperation +import org.jellyfin.openapi.model.ApiServiceOperationParameter +import org.jellyfin.openapi.model.CustomDefaultValue +import org.jellyfin.openapi.model.IntRangeValidation +import org.jellyfin.openapi.model.ParameterValidation open class OperationBuilder( private val descriptionBuilder: DescriptionBuilder, diff --git a/openapi-generator/src/main/kotlin/org/jellyfin/openapi/builder/model/EnumModelBuilder.kt b/openapi-generator/src/main/kotlin/org/jellyfin/openapi/builder/model/EnumModelBuilder.kt index 3c9a8dcfb..39152cb95 100644 --- a/openapi-generator/src/main/kotlin/org/jellyfin/openapi/builder/model/EnumModelBuilder.kt +++ b/openapi-generator/src/main/kotlin/org/jellyfin/openapi/builder/model/EnumModelBuilder.kt @@ -1,6 +1,10 @@ package org.jellyfin.openapi.builder.model -import com.squareup.kotlinpoet.* +import com.squareup.kotlinpoet.AnnotationSpec +import com.squareup.kotlinpoet.FunSpec +import com.squareup.kotlinpoet.KModifier +import com.squareup.kotlinpoet.PropertySpec +import com.squareup.kotlinpoet.TypeSpec import net.pearx.kasechange.CaseFormat import net.pearx.kasechange.toPascalCase import net.pearx.kasechange.toScreamingSnakeCase diff --git a/openapi-generator/src/main/kotlin/org/jellyfin/openapi/builder/model/ModelBuilder.kt b/openapi-generator/src/main/kotlin/org/jellyfin/openapi/builder/model/ModelBuilder.kt index a3223346a..6240f1a43 100644 --- a/openapi-generator/src/main/kotlin/org/jellyfin/openapi/builder/model/ModelBuilder.kt +++ b/openapi-generator/src/main/kotlin/org/jellyfin/openapi/builder/model/ModelBuilder.kt @@ -2,7 +2,11 @@ package org.jellyfin.openapi.builder.model import org.jellyfin.openapi.OpenApiGeneratorError import org.jellyfin.openapi.builder.Builder -import org.jellyfin.openapi.model.* +import org.jellyfin.openapi.model.ApiModel +import org.jellyfin.openapi.model.EmptyApiModel +import org.jellyfin.openapi.model.EnumApiModel +import org.jellyfin.openapi.model.JellyFile +import org.jellyfin.openapi.model.ObjectApiModel class ModelBuilder( private val emptyModelBuilder: EmptyModelBuilder, diff --git a/openapi-generator/src/main/kotlin/org/jellyfin/openapi/builder/model/ObjectModelBuilder.kt b/openapi-generator/src/main/kotlin/org/jellyfin/openapi/builder/model/ObjectModelBuilder.kt index 63a18d0f9..64c7b217e 100644 --- a/openapi-generator/src/main/kotlin/org/jellyfin/openapi/builder/model/ObjectModelBuilder.kt +++ b/openapi-generator/src/main/kotlin/org/jellyfin/openapi/builder/model/ObjectModelBuilder.kt @@ -1,6 +1,12 @@ package org.jellyfin.openapi.builder.model -import com.squareup.kotlinpoet.* +import com.squareup.kotlinpoet.AnnotationSpec +import com.squareup.kotlinpoet.FunSpec +import com.squareup.kotlinpoet.KModifier +import com.squareup.kotlinpoet.ParameterSpec +import com.squareup.kotlinpoet.PropertySpec +import com.squareup.kotlinpoet.TypeName +import com.squareup.kotlinpoet.TypeSpec import net.pearx.kasechange.CaseFormat import net.pearx.kasechange.toPascalCase import org.jellyfin.openapi.builder.Builder diff --git a/openapi-generator/src/main/kotlin/org/jellyfin/openapi/builder/openapi/OpenApiApiServicesBuilder.kt b/openapi-generator/src/main/kotlin/org/jellyfin/openapi/builder/openapi/OpenApiApiServicesBuilder.kt index fdd975835..c9e82ea74 100644 --- a/openapi-generator/src/main/kotlin/org/jellyfin/openapi/builder/openapi/OpenApiApiServicesBuilder.kt +++ b/openapi-generator/src/main/kotlin/org/jellyfin/openapi/builder/openapi/OpenApiApiServicesBuilder.kt @@ -21,7 +21,12 @@ import org.jellyfin.openapi.constants.Types import org.jellyfin.openapi.hooks.ApiTypePath import org.jellyfin.openapi.hooks.DefaultValueHook import org.jellyfin.openapi.hooks.ServiceNameHook -import org.jellyfin.openapi.model.* +import org.jellyfin.openapi.model.ApiService +import org.jellyfin.openapi.model.ApiServiceOperation +import org.jellyfin.openapi.model.ApiServiceOperationParameter +import org.jellyfin.openapi.model.HttpMethod +import org.jellyfin.openapi.model.IntRangeValidation +import org.jellyfin.openapi.model.ParameterValidation private val logger = KotlinLogging.logger { } diff --git a/openapi-generator/src/main/kotlin/org/jellyfin/openapi/builder/openapi/OpenApiModelBuilder.kt b/openapi-generator/src/main/kotlin/org/jellyfin/openapi/builder/openapi/OpenApiModelBuilder.kt index 8bf4a7fd7..79e529a21 100644 --- a/openapi-generator/src/main/kotlin/org/jellyfin/openapi/builder/openapi/OpenApiModelBuilder.kt +++ b/openapi-generator/src/main/kotlin/org/jellyfin/openapi/builder/openapi/OpenApiModelBuilder.kt @@ -6,7 +6,11 @@ import net.pearx.kasechange.toCamelCase import org.jellyfin.openapi.builder.Builder import org.jellyfin.openapi.builder.model.ModelBuilder import org.jellyfin.openapi.hooks.ModelTypePath -import org.jellyfin.openapi.model.* +import org.jellyfin.openapi.model.EmptyApiModel +import org.jellyfin.openapi.model.EnumApiModel +import org.jellyfin.openapi.model.JellyFile +import org.jellyfin.openapi.model.ObjectApiModel +import org.jellyfin.openapi.model.ObjectApiModelProperty class OpenApiModelBuilder( private val openApiTypeBuilder: OpenApiTypeBuilder, diff --git a/openapi-generator/src/main/kotlin/org/jellyfin/openapi/builder/openapi/OpenApiTypeBuilder.kt b/openapi-generator/src/main/kotlin/org/jellyfin/openapi/builder/openapi/OpenApiTypeBuilder.kt index 6485b8fb5..5bbebbf19 100644 --- a/openapi-generator/src/main/kotlin/org/jellyfin/openapi/builder/openapi/OpenApiTypeBuilder.kt +++ b/openapi-generator/src/main/kotlin/org/jellyfin/openapi/builder/openapi/OpenApiTypeBuilder.kt @@ -4,7 +4,17 @@ import com.squareup.kotlinpoet.ClassName import com.squareup.kotlinpoet.ParameterizedTypeName import com.squareup.kotlinpoet.ParameterizedTypeName.Companion.plusParameter import com.squareup.kotlinpoet.TypeName -import io.swagger.v3.oas.models.media.* +import io.swagger.v3.oas.models.media.ArraySchema +import io.swagger.v3.oas.models.media.BinarySchema +import io.swagger.v3.oas.models.media.BooleanSchema +import io.swagger.v3.oas.models.media.ComposedSchema +import io.swagger.v3.oas.models.media.DateTimeSchema +import io.swagger.v3.oas.models.media.IntegerSchema +import io.swagger.v3.oas.models.media.MapSchema +import io.swagger.v3.oas.models.media.NumberSchema +import io.swagger.v3.oas.models.media.Schema +import io.swagger.v3.oas.models.media.StringSchema +import io.swagger.v3.oas.models.media.UUIDSchema import net.pearx.kasechange.CaseFormat import net.pearx.kasechange.toPascalCase import org.jellyfin.openapi.OpenApiGeneratorError diff --git a/samples/kotlin-cli/src/main/kotlin/org/jellyfin/sample/cli/Main.kt b/samples/kotlin-cli/src/main/kotlin/org/jellyfin/sample/cli/Main.kt index 25a6ceb85..26d82c052 100644 --- a/samples/kotlin-cli/src/main/kotlin/org/jellyfin/sample/cli/Main.kt +++ b/samples/kotlin-cli/src/main/kotlin/org/jellyfin/sample/cli/Main.kt @@ -2,7 +2,13 @@ package org.jellyfin.sample.cli import com.github.ajalt.clikt.core.NoOpCliktCommand import com.github.ajalt.clikt.core.subcommands -import org.jellyfin.sample.cli.command.* +import org.jellyfin.sample.cli.command.Bitrate +import org.jellyfin.sample.cli.command.Discover +import org.jellyfin.sample.cli.command.Libraries +import org.jellyfin.sample.cli.command.Login +import org.jellyfin.sample.cli.command.Observe +import org.jellyfin.sample.cli.command.Ping +import org.jellyfin.sample.cli.command.Users import org.jellyfin.sdk.createJellyfin import org.jellyfin.sdk.model.ClientInfo import org.jellyfin.sdk.model.DeviceInfo