diff --git a/.idea/kotlinc.xml b/.idea/kotlinc.xml index d4b7acc..03fcfb7 100644 --- a/.idea/kotlinc.xml +++ b/.idea/kotlinc.xml @@ -1,6 +1,6 @@ - \ No newline at end of file diff --git a/build.gradle.kts b/build.gradle.kts index a1a1d06..6e9d593 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -3,7 +3,7 @@ plugins { } group = "ai.neuon.utility" -version = "1.0.0" +version = "1.0.1" repositories { mavenCentral() diff --git a/core/build.gradle.kts b/core/build.gradle.kts index 844efce..ebd2e32 100644 --- a/core/build.gradle.kts +++ b/core/build.gradle.kts @@ -12,7 +12,6 @@ repositories { dependencies { implementation(libs.kotlinx.coroutines) - implementation(libs.kotlinx.datetime) implementation(libs.ktor.serialization.json) implementation(libs.ktor.server.data.conversion) implementation(libs.mongodb.bson) diff --git a/core/src/main/kotlin/ai/neuon/utility/json/JsonElement.kt b/core/src/main/kotlin/ai/neuon/utility/json/JsonElement.kt index 8304b77..e17b252 100644 --- a/core/src/main/kotlin/ai/neuon/utility/json/JsonElement.kt +++ b/core/src/main/kotlin/ai/neuon/utility/json/JsonElement.kt @@ -1,7 +1,8 @@ package ai.neuon.utility.json -import kotlinx.datetime.Instant import kotlinx.serialization.json.* +import kotlin.time.ExperimentalTime +import kotlin.time.Instant /** @@ -113,6 +114,7 @@ fun JsonElement.asBooleanOrNull(): Boolean? { /** * @throws IllegalArgumentException if the current element is not a valid ISO 8601 [String] */ +@OptIn(ExperimentalTime::class) fun JsonElement.asInstant(): Instant { val value = try { asString() @@ -125,6 +127,7 @@ fun JsonElement.asInstant(): Instant { /** * @return null if the current element is not a valid ISO 8601 [String] */ +@OptIn(ExperimentalTime::class) fun JsonElement.asInstantOrNull(): Instant? { return try { asInstant() diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 5cba7a6..0e636d8 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,20 +1,15 @@ [versions] dokka = "2.0.0" kotlinx-coroutines = "1.10.2" -kotlinx-datetime = "0.6.2" ktor = "3.2.0" mongodb = "5.5.1" -kotlin = "2.0.20" - +kotlin = "2.2.0" [libraries] kotlinx-coroutines = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-core", version.ref = "kotlinx-coroutines" } -kotlinx-datetime = { group = "org.jetbrains.kotlinx", name = "kotlinx-datetime", version.ref = "kotlinx-datetime" } ktor-server-data-conversion = { group = "io.ktor", name = "ktor-server-data-conversion", version.ref = "ktor" } ktor-serialization-json = { group = "io.ktor", name = "ktor-serialization-kotlinx-json", version.ref = "ktor" } mongodb-bson = { group = "org.mongodb", name = "bson", version.ref = "mongodb" } -mongodb-driver = { group = "org.mongodb", name = "mongodb-driver-kotlin-coroutine", version.ref = "mongodb" } - [plugins] dokka = { id = "org.jetbrains.dokka", version.ref = "dokka" }