From 8250a2a0212a667dfd1ba188e34537ee78a99c09 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Thu, 30 Jun 2022 13:14:06 +0600 Subject: [PATCH 1/4] start 0.11.11 --- CHANGELOG.md | 2 ++ gradle.properties | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ca0d593e9fe..e1fd315e4f5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ # Changelog +## 0.11.11 + ## 0.11.10 * `Repos`: diff --git a/gradle.properties b/gradle.properties index 368c2b7b56e..84fec20a63e 100644 --- a/gradle.properties +++ b/gradle.properties @@ -14,5 +14,5 @@ crypto_js_version=4.1.1 # Project data group=dev.inmo -version=0.11.10 -android_code_version=134 +version=0.11.11 +android_code_version=135 From d4c5e849bf62a618754023dd13843232a0da4f82 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Thu, 30 Jun 2022 13:15:19 +0600 Subject: [PATCH 2/4] deprecate BodyPair --- CHANGELOG.md | 4 ++++ .../ktor/client/StandardHttpClientGetPost.kt | 13 +++++++------ .../ktor/client/crud/KtorWriteStandardCrudRepo.kt | 8 ++++---- .../key_value/KtorWriteStandardKeyValueRepo.kt | 6 +++--- .../one_to_many/KtorWriteOneToManyKeyValueRepo.kt | 10 +++++----- 5 files changed, 23 insertions(+), 18 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e1fd315e4f5..f1b2c4f63ad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## 0.11.11 +* `Ktor`: + * `Client`: + * `BodyPair` has been deprecated + ## 0.11.10 * `Repos`: diff --git a/ktor/client/src/commonMain/kotlin/dev/inmo/micro_utils/ktor/client/StandardHttpClientGetPost.kt b/ktor/client/src/commonMain/kotlin/dev/inmo/micro_utils/ktor/client/StandardHttpClientGetPost.kt index 21c5b28aede..a36d817a06e 100644 --- a/ktor/client/src/commonMain/kotlin/dev/inmo/micro_utils/ktor/client/StandardHttpClientGetPost.kt +++ b/ktor/client/src/commonMain/kotlin/dev/inmo/micro_utils/ktor/client/StandardHttpClientGetPost.kt @@ -12,6 +12,7 @@ import io.ktor.http.* import io.ktor.utils.io.core.ByteReadPacket import kotlinx.serialization.* +@Deprecated("This class will be removed in next") typealias BodyPair = Pair, T> class UnifiedRequester( @@ -33,7 +34,7 @@ class UnifiedRequester( suspend fun unipost( url: String, - bodyInfo: BodyPair, + bodyInfo: Pair, BodyType>, resultDeserializer: DeserializationStrategy ) = client.unipost(url, bodyInfo, resultDeserializer, serialFormat) @@ -52,7 +53,7 @@ class UnifiedRequester( url: String, filename: String, inputProvider: InputProvider, - otherData: BodyPair, + otherData: Pair, BodyType>, resultDeserializer: DeserializationStrategy, mimetype: String = "*/*", additionalParametersBuilder: FormBuilder.() -> Unit = {}, @@ -75,7 +76,7 @@ class UnifiedRequester( suspend fun unimultipart( url: String, mppFile: MPPFile, - otherData: BodyPair, + otherData: Pair, BodyType>, resultDeserializer: DeserializationStrategy, mimetype: String = "*/*", additionalParametersBuilder: FormBuilder.() -> Unit = {}, @@ -120,7 +121,7 @@ fun SerializationStrategy.encodeUrlQueryValue( suspend fun HttpClient.unipost( url: String, - bodyInfo: BodyPair, + bodyInfo: Pair, BodyType>, resultDeserializer: DeserializationStrategy, serialFormat: StandardKtorSerialFormat = standardKtorSerialFormat ) = post(url) { @@ -162,7 +163,7 @@ suspend fun HttpClient.unimultipart( suspend fun HttpClient.unimultipart( url: String, filename: String, - otherData: BodyPair, + otherData: Pair, BodyType>, inputProvider: InputProvider, resultDeserializer: DeserializationStrategy, mimetype: String = "*/*", @@ -220,7 +221,7 @@ suspend fun HttpClient.unimultipart( suspend fun HttpClient.unimultipart( url: String, mppFile: MPPFile, - otherData: BodyPair, + otherData: Pair, BodyType>, resultDeserializer: DeserializationStrategy, mimetype: String = "*/*", additionalParametersBuilder: FormBuilder.() -> Unit = {}, diff --git a/repos/ktor/client/src/commonMain/kotlin/dev/inmo/micro_utils/repos/ktor/client/crud/KtorWriteStandardCrudRepo.kt b/repos/ktor/client/src/commonMain/kotlin/dev/inmo/micro_utils/repos/ktor/client/crud/KtorWriteStandardCrudRepo.kt index 1b417090bb5..e4dddd8f7e0 100644 --- a/repos/ktor/client/src/commonMain/kotlin/dev/inmo/micro_utils/repos/ktor/client/crud/KtorWriteStandardCrudRepo.kt +++ b/repos/ktor/client/src/commonMain/kotlin/dev/inmo/micro_utils/repos/ktor/client/crud/KtorWriteStandardCrudRepo.kt @@ -56,25 +56,25 @@ class KtorWriteStandardCrudRepo ( override suspend fun create(values: List): List = unifiedRequester.unipost( buildStandardUrl(baseUrl, createRouting), - BodyPair(listInputSerializer, values), + Pair(listInputSerializer, values), listObjectsSerializer ) override suspend fun update(id: IdType, value: InputValue): ObjectType? = unifiedRequester.unipost( buildStandardUrl(baseUrl, updateRouting), - BodyPair(inputUpdateSerializer, id to value), + Pair(inputUpdateSerializer, id to value), objectsNullableSerializer ) override suspend fun update(values: List>): List = unifiedRequester.unipost( buildStandardUrl(baseUrl, updateManyRouting), - BodyPair(listInputUpdateSerializer, values), + Pair(listInputUpdateSerializer, values), listObjectsSerializer ) override suspend fun deleteById(ids: List) = unifiedRequester.unipost( buildStandardUrl(baseUrl, deleteByIdRouting), - BodyPair(listIdsSerializer, ids), + Pair(listIdsSerializer, ids), Unit.serializer() ) } diff --git a/repos/ktor/client/src/commonMain/kotlin/dev/inmo/micro_utils/repos/ktor/client/key_value/KtorWriteStandardKeyValueRepo.kt b/repos/ktor/client/src/commonMain/kotlin/dev/inmo/micro_utils/repos/ktor/client/key_value/KtorWriteStandardKeyValueRepo.kt index 4b51836ab57..9ebf015600e 100644 --- a/repos/ktor/client/src/commonMain/kotlin/dev/inmo/micro_utils/repos/ktor/client/key_value/KtorWriteStandardKeyValueRepo.kt +++ b/repos/ktor/client/src/commonMain/kotlin/dev/inmo/micro_utils/repos/ktor/client/key_value/KtorWriteStandardKeyValueRepo.kt @@ -45,7 +45,7 @@ class KtorWriteStandardKeyValueRepo ( baseUrl, setRoute ), - BodyPair(keyValueMapSerializer, toSet), + Pair(keyValueMapSerializer, toSet), Unit.serializer() ) @@ -54,7 +54,7 @@ class KtorWriteStandardKeyValueRepo ( baseUrl, unsetRoute, ), - BodyPair(keysListSerializer, toUnset), + Pair(keysListSerializer, toUnset), Unit.serializer() ) @@ -63,7 +63,7 @@ class KtorWriteStandardKeyValueRepo ( baseUrl, unsetWithValuesRoute, ), - BodyPair(valuesListSerializer, toUnset), + Pair(valuesListSerializer, toUnset), Unit.serializer() ) } diff --git a/repos/ktor/client/src/commonMain/kotlin/dev/inmo/micro_utils/repos/ktor/client/one_to_many/KtorWriteOneToManyKeyValueRepo.kt b/repos/ktor/client/src/commonMain/kotlin/dev/inmo/micro_utils/repos/ktor/client/one_to_many/KtorWriteOneToManyKeyValueRepo.kt index 6430b7252e2..6a9670b345c 100644 --- a/repos/ktor/client/src/commonMain/kotlin/dev/inmo/micro_utils/repos/ktor/client/one_to_many/KtorWriteOneToManyKeyValueRepo.kt +++ b/repos/ktor/client/src/commonMain/kotlin/dev/inmo/micro_utils/repos/ktor/client/one_to_many/KtorWriteOneToManyKeyValueRepo.kt @@ -47,7 +47,7 @@ class KtorWriteOneToManyKeyValueRepo ( baseUrl, removeRoute, ), - BodyPair(keyValueMapSerializer, toRemove), + Pair(keyValueMapSerializer, toRemove), Unit.serializer(), ) @@ -56,7 +56,7 @@ class KtorWriteOneToManyKeyValueRepo ( baseUrl, addRoute, ), - BodyPair(keyValueMapSerializer, toAdd), + Pair(keyValueMapSerializer, toAdd), Unit.serializer(), ) override suspend fun clear(k: Key) = unifiedRequester.unipost( @@ -64,7 +64,7 @@ class KtorWriteOneToManyKeyValueRepo ( baseUrl, clearRoute, ), - BodyPair(keySerializer, k), + Pair(keySerializer, k), Unit.serializer(), ) @@ -73,7 +73,7 @@ class KtorWriteOneToManyKeyValueRepo ( baseUrl, clearWithValueRoute, ), - BodyPair(valueSerializer, v), + Pair(valueSerializer, v), Unit.serializer(), ) @@ -82,7 +82,7 @@ class KtorWriteOneToManyKeyValueRepo ( baseUrl, setRoute, ), - BodyPair(keyValueMapSerializer, toSet), + Pair(keyValueMapSerializer, toSet), Unit.serializer(), ) } From 905c7e8eda542698de09c664e3b5fd9b0743c7b6 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Thu, 30 Jun 2022 13:19:37 +0600 Subject: [PATCH 3/4] deprecate hmacSha256 --- CHANGELOG.md | 2 ++ crypto/src/commonMain/kotlin/dev/inmo/micro_utils/crypto/Sha.kt | 1 + .../src/jsMain/kotlin/dev/inmo/micro_utils/crypto/CryptoJs.kt | 1 + .../jvmMain/kotlin/dev/inmo/micro_utils/crypto/ShaHexActual.kt | 1 + 4 files changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f1b2c4f63ad..6ed0e6b4ce9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## 0.11.11 +* `Crypto`: + * `hmacSha256` has been deprecated * `Ktor`: * `Client`: * `BodyPair` has been deprecated diff --git a/crypto/src/commonMain/kotlin/dev/inmo/micro_utils/crypto/Sha.kt b/crypto/src/commonMain/kotlin/dev/inmo/micro_utils/crypto/Sha.kt index 52ea32f236e..6ad62b85b06 100644 --- a/crypto/src/commonMain/kotlin/dev/inmo/micro_utils/crypto/Sha.kt +++ b/crypto/src/commonMain/kotlin/dev/inmo/micro_utils/crypto/Sha.kt @@ -1,3 +1,4 @@ package dev.inmo.micro_utils.crypto +@Deprecated("Deprecated due to incorrect of work sometimes and redundancy. Can be replaced by korlibs krypto") expect fun SourceString.hmacSha256(key: String): String diff --git a/crypto/src/jsMain/kotlin/dev/inmo/micro_utils/crypto/CryptoJs.kt b/crypto/src/jsMain/kotlin/dev/inmo/micro_utils/crypto/CryptoJs.kt index f6ac57bb317..8bca58a1a15 100644 --- a/crypto/src/jsMain/kotlin/dev/inmo/micro_utils/crypto/CryptoJs.kt +++ b/crypto/src/jsMain/kotlin/dev/inmo/micro_utils/crypto/CryptoJs.kt @@ -8,6 +8,7 @@ external interface CryptoJs { @JsNonModule external val CryptoJS: CryptoJs +@Deprecated("Deprecated due to incorrect of work sometimes and redundancy. Can be replaced by korlibs krypto") actual fun SourceString.hmacSha256(key: String): String { return CryptoJS.asDynamic().HmacSHA256(this, key).toString().unsafeCast() } diff --git a/crypto/src/jvmMain/kotlin/dev/inmo/micro_utils/crypto/ShaHexActual.kt b/crypto/src/jvmMain/kotlin/dev/inmo/micro_utils/crypto/ShaHexActual.kt index 90c27879ad8..7158bb21c8e 100644 --- a/crypto/src/jvmMain/kotlin/dev/inmo/micro_utils/crypto/ShaHexActual.kt +++ b/crypto/src/jvmMain/kotlin/dev/inmo/micro_utils/crypto/ShaHexActual.kt @@ -3,6 +3,7 @@ package dev.inmo.micro_utils.crypto import javax.crypto.Mac import javax.crypto.spec.SecretKeySpec +@Deprecated("Deprecated due to incorrect of work sometimes and redundancy. Can be replaced by korlibs krypto") actual fun SourceString.hmacSha256(key: String): String { val mac = Mac.getInstance("HmacSHA256") From 8ca10c00bb11cf3f0430dde211ae0a7d77d14856 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Thu, 30 Jun 2022 13:41:12 +0600 Subject: [PATCH 4/4] update dokka workflow --- .github/workflows/dokka_push.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dokka_push.yml b/.github/workflows/dokka_push.yml index 9b97ff4e7ad..866c1445feb 100644 --- a/.github/workflows/dokka_push.yml +++ b/.github/workflows/dokka_push.yml @@ -15,7 +15,7 @@ jobs: continue-on-error: true run: cd /usr/local/lib/android/sdk/build-tools/32.0.0/ && mv d8 dx && cd lib && mv d8.jar dx.jar - name: Build - run: ./gradlew dokkaHtml + run: ./gradlew build && ./gradlew dokkaHtml - name: Publish KDocs uses: peaceiris/actions-gh-pages@v3 with: