diff --git a/build.gradle.kts b/build.gradle.kts index 41dda4f5e6d..0401596d045 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -92,8 +92,8 @@ apply(from = "gradle/compatibility.gradle") plugins { id("org.jetbrains.dokka") version "1.7.20" apply false - id("org.jetbrains.kotlinx.binary-compatibility-validator") version "0.12.1" - id("kotlinx-atomicfu") version "0.19.0" apply false + id("org.jetbrains.kotlinx.binary-compatibility-validator") version "0.13.2" + id("kotlinx-atomicfu") version "0.22.0" apply false id("com.osacky.doctor") version "0.8.1" } diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index bd3faa9e984..11845b73978 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -3,8 +3,8 @@ */ plugins { - id("org.gradle.kotlin.kotlin-dsl") version "3.2.4" - kotlin("plugin.serialization") version "1.7.21" + id("org.gradle.kotlin.kotlin-dsl") version "4.1.0" + kotlin("plugin.serialization") version "1.9.0" } val buildSnapshotTrain = properties["build_snapshot_train"]?.toString()?.toBoolean() == true @@ -24,8 +24,8 @@ sourceSets.main { val ktor_version = "2.3.2" dependencies { - implementation(kotlin("gradle-plugin", "1.8.22")) - implementation(kotlin("serialization", "1.8.22")) + implementation(kotlin("gradle-plugin", "1.9.10")) + implementation(kotlin("serialization", "1.9.10")) val ktlint_version = libs.versions.ktlint.version.get() implementation("org.jmailen.gradle:kotlinter-gradle:$ktlint_version") diff --git a/buildSrc/src/main/kotlin/CommonConfig.kt b/buildSrc/src/main/kotlin/CommonConfig.kt index 25aed745d58..678cf75ac5d 100644 --- a/buildSrc/src/main/kotlin/CommonConfig.kt +++ b/buildSrc/src/main/kotlin/CommonConfig.kt @@ -9,13 +9,13 @@ fun Project.configureCommon() { kotlin { sourceSets { - val commonMain by getting { + commonMain { dependencies { api("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version") } } - val commonTest by getting { + commonTest { dependencies { implementation(kotlin("test")) } diff --git a/buildSrc/src/main/kotlin/JsConfig.kt b/buildSrc/src/main/kotlin/JsConfig.kt index b5cefa4ffeb..3a48d2fe5f1 100644 --- a/buildSrc/src/main/kotlin/JsConfig.kt +++ b/buildSrc/src/main/kotlin/JsConfig.kt @@ -27,20 +27,24 @@ private fun Project.configureJsTasks() { kotlin { js(IR) { nodejs { - testTask { - useMocha { - timeout = "10000" + testTask( + Action { + useMocha { + timeout = "10000" + } } - } + ) } browser { - testTask { - useKarma { - useChromeHeadless() - useConfigDirectory(File(project.rootProject.projectDir, "karma")) + testTask( + Action { + useKarma { + useChromeHeadless() + useConfigDirectory(File(project.rootProject.projectDir, "karma")) + } } - } + ) } binaries.library() diff --git a/buildSrc/src/main/kotlin/KotlinExtensions.kt b/buildSrc/src/main/kotlin/KotlinExtensions.kt index 47f6fcb9e55..6d4dbd34c81 100644 --- a/buildSrc/src/main/kotlin/KotlinExtensions.kt +++ b/buildSrc/src/main/kotlin/KotlinExtensions.kt @@ -27,6 +27,16 @@ fun KotlinMultiplatformExtension.createCInterop( } } +fun NamedDomainObjectContainer.commonMain(block: KotlinSourceSet.() -> Unit) { + val sourceSet = getByName("commonMain") + block(sourceSet) +} + +fun NamedDomainObjectContainer.commonTest(block: KotlinSourceSet.() -> Unit) { + val sourceSet = getByName("commonTest") + block(sourceSet) +} + fun NamedDomainObjectContainer.jvmAndNixMain(block: KotlinSourceSet.() -> Unit) { val sourceSet = findByName("jvmAndNixMain") ?: getByName("jvmMain") block(sourceSet) diff --git a/buildSrc/src/main/kotlin/Versions.kt b/buildSrc/src/main/kotlin/Versions.kt new file mode 100644 index 00000000000..3ae52dd5b7f --- /dev/null +++ b/buildSrc/src/main/kotlin/Versions.kt @@ -0,0 +1,11 @@ +/* + * Copyright 2014-2023 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. + */ + +object Versions { + val kotlin = "1.9.10" + val coroutines = "1.7.2" + val slf4j = "1.7.36" + val junit = "4.13.2" + val logback = "1.2.11" +} diff --git a/buildSrc/src/main/kotlin/test/server/ServerUtils.kt b/buildSrc/src/main/kotlin/test/server/ServerUtils.kt index 27030cca246..52063ca535b 100644 --- a/buildSrc/src/main/kotlin/test/server/ServerUtils.kt +++ b/buildSrc/src/main/kotlin/test/server/ServerUtils.kt @@ -29,6 +29,7 @@ fun List.makeString(): String = buildString { } } +@Suppress("DEPRECATION") private fun filenameContentTypeAndContentString(provider: () -> Input, headers: Headers): String { val dispositionHeader: String = headers.getAll(HttpHeaders.ContentDisposition)!!.joinToString(";") val disposition: ContentDisposition = ContentDisposition.parse(dispositionHeader) diff --git a/gradle.properties b/gradle.properties index bc91903b4ec..aeab587d9dd 100644 --- a/gradle.properties +++ b/gradle.properties @@ -10,7 +10,7 @@ ktor.ide.jvmAndCommonOnly=true kotlin.code.style=official # config -version=2.3.4 +version=2.3.5 # gradle org.gradle.daemon=true @@ -34,7 +34,7 @@ kotlin.native.binary.memoryModel=experimental kotlin_version=1.8.22 coroutines_version=1.7.1 -atomicfu_version=0.20.2 +atomicfu_version=0.22.2 slf4j_version=1.7.36 junit_version=4.13.2 logback_version=1.2.11 diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 3e050ffbf5f..64b0f15904e 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -2,7 +2,7 @@ kotlin-version = "1.8.22" kotlinx-html-version = "0.9.1" coroutines-version = "1.7.2" -atomicfu-version = "0.20.2" +atomicfu-version = "0.22.0" serialization-version = "1.5.1" validator-version = "0.8.0" ktlint-version = "3.15.0" diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 774fae87671..db9a6b825d7 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/kotlin-js-store/yarn.lock b/kotlin-js-store/yarn.lock index 9f66f585155..f7128b14e0f 100644 --- a/kotlin-js-store/yarn.lock +++ b/kotlin-js-store/yarn.lock @@ -2,27 +2,6 @@ # yarn lockfile v1 -"@babel/code-frame@^7.10.4": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.22.5.tgz#234d98e1551960604f1246e6475891a570ad5658" - integrity sha512-Xmwn266vad+6DAqEB2A6V/CcZVp62BbwVmcOJc2RPuwih1kw02TjQvWVWlcKGbBPd+8/0V5DEkOcizRGYsspYQ== - dependencies: - "@babel/highlight" "^7.22.5" - -"@babel/helper-validator-identifier@^7.22.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.5.tgz#9544ef6a33999343c8740fa51350f30eeaaaf193" - integrity sha512-aJXu+6lErq8ltp+JhkJUfk1MTGyuA4v7f3pA+BJ5HLfNC6nAQ0Cpi9uOquUj8Hehg0aUiHzWQbOVJGao6ztBAQ== - -"@babel/highlight@^7.22.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.22.5.tgz#aa6c05c5407a67ebce408162b7ede789b4d22031" - integrity sha512-BSKlD1hgnedS5XRnGOljZawtag7H1yPfQp0tdNJCHoH6AZ+Pcm9VvkrK59/Yy593Ypg0zMxH2BxD1VPYUQ7UIw== - dependencies: - "@babel/helper-validator-identifier" "^7.22.5" - chalk "^2.0.0" - js-tokens "^4.0.0" - "@colors/colors@1.5.0": version "1.5.0" resolved "https://registry.yarnpkg.com/@colors/colors/-/colors-1.5.0.tgz#bb504579c1cae923e6576a4f5da43d25f97bdbd9" @@ -47,6 +26,11 @@ resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz#2203b118c157721addfe69d47b70465463066d78" integrity sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w== +"@jridgewell/resolve-uri@^3.1.0": + version "3.1.1" + resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz#c08679063f279615a3326583ba3a90d1d82cc721" + integrity sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA== + "@jridgewell/set-array@^1.0.1": version "1.1.2" resolved "https://registry.yarnpkg.com/@jridgewell/set-array/-/set-array-1.1.2.tgz#7c6cf998d6d20b914c0a55a91ae928ff25965e72" @@ -65,11 +49,19 @@ resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz#add4c98d341472a289190b424efbdb096991bb24" integrity sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw== -"@jridgewell/sourcemap-codec@^1.4.10": +"@jridgewell/sourcemap-codec@^1.4.10", "@jridgewell/sourcemap-codec@^1.4.14": version "1.4.15" resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz#d7c6e6755c78567a951e04ab52ef0fd26de59f32" integrity sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg== +"@jridgewell/trace-mapping@^0.3.17": + version "0.3.19" + resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.19.tgz#f8a3249862f91be48d3127c3cfe992f79b4b8811" + integrity sha512-kf37QtfW+Hwx/buWGMPcR60iF9ziHa6r/CZJIHbmcm4+0qrXiVdxegAH0F6yddEVQ7zdkjcGCgCzUu+BcbhQxw== + dependencies: + "@jridgewell/resolve-uri" "^3.1.0" + "@jridgewell/sourcemap-codec" "^1.4.14" + "@jridgewell/trace-mapping@^0.3.9": version "0.3.18" resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.18.tgz#25783b2086daf6ff1dcb53c9249ae480e4dd4cd6" @@ -78,48 +70,6 @@ "@jridgewell/resolve-uri" "3.1.0" "@jridgewell/sourcemap-codec" "1.4.14" -"@rollup/plugin-commonjs@^21.0.1": - version "21.1.0" - resolved "https://registry.yarnpkg.com/@rollup/plugin-commonjs/-/plugin-commonjs-21.1.0.tgz#45576d7b47609af2db87f55a6d4b46e44fc3a553" - integrity sha512-6ZtHx3VHIp2ReNNDxHjuUml6ur+WcQ28N1yHgCQwsbNkQg2suhxGMDQGJOn/KuDxKtd1xuZP5xSTwBA4GQ8hbA== - dependencies: - "@rollup/pluginutils" "^3.1.0" - commondir "^1.0.1" - estree-walker "^2.0.1" - glob "^7.1.6" - is-reference "^1.2.1" - magic-string "^0.25.7" - resolve "^1.17.0" - -"@rollup/plugin-node-resolve@^13.1.3": - version "13.3.0" - resolved "https://registry.yarnpkg.com/@rollup/plugin-node-resolve/-/plugin-node-resolve-13.3.0.tgz#da1c5c5ce8316cef96a2f823d111c1e4e498801c" - integrity sha512-Lus8rbUo1eEcnS4yTFKLZrVumLPY+YayBdWXgFSHYhTT2iJbMhoaaBL3xl5NCdeRytErGr8tZ0L71BMRmnlwSw== - dependencies: - "@rollup/pluginutils" "^3.1.0" - "@types/resolve" "1.17.1" - deepmerge "^4.2.2" - is-builtin-module "^3.1.0" - is-module "^1.0.0" - resolve "^1.19.0" - -"@rollup/plugin-typescript@^8.3.0": - version "8.5.0" - resolved "https://registry.yarnpkg.com/@rollup/plugin-typescript/-/plugin-typescript-8.5.0.tgz#7ea11599a15b0a30fa7ea69ce3b791d41b862515" - integrity sha512-wMv1/scv0m/rXx21wD2IsBbJFba8wGF3ErJIr6IKRfRj49S85Lszbxb4DCo8iILpluTjk2GAAu9CoZt4G3ppgQ== - dependencies: - "@rollup/pluginutils" "^3.1.0" - resolve "^1.17.0" - -"@rollup/pluginutils@^3.0.9", "@rollup/pluginutils@^3.1.0": - version "3.1.0" - resolved "https://registry.yarnpkg.com/@rollup/pluginutils/-/pluginutils-3.1.0.tgz#706b4524ee6dc8b103b3c995533e5ad680c02b9b" - integrity sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg== - dependencies: - "@types/estree" "0.0.39" - estree-walker "^1.0.1" - picomatch "^2.2.2" - "@socket.io/component-emitter@~3.1.0": version "3.1.0" resolved "https://registry.yarnpkg.com/@socket.io/component-emitter/-/component-emitter-3.1.0.tgz#96116f2a912e0c02817345b3c10751069920d553" @@ -153,15 +103,15 @@ "@types/estree" "*" "@types/json-schema" "*" -"@types/estree@*", "@types/estree@^0.0.51": +"@types/estree@*": version "0.0.51" resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.51.tgz#cfd70924a25a3fd32b218e5e420e6897e1ac4f40" integrity sha512-CuPgU6f3eT/XgKKPqKd/gLZV1Xmvf1a2R5POBOGQa6uv82xpls89HU5zKeVoyR8XzHd1RGNOlQlvUe3CFkjWNQ== -"@types/estree@0.0.39": - version "0.0.39" - resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.39.tgz#e177e699ee1b8c22d23174caaa7422644389509f" - integrity sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw== +"@types/estree@^1.0.0": + version "1.0.2" + resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.2.tgz#ff02bc3dc8317cd668dfec247b750ba1f1d62453" + integrity sha512-VeiPZ9MMwXjO32/Xu7+OwflfmeoRwkE/qzndw42gGtgJwZopBnzy2gD//NN1+go1mADzkDcqf/KnFRSjTJ8xJA== "@types/json-schema@*", "@types/json-schema@^7.0.8": version "7.0.9" @@ -173,18 +123,6 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.18.tgz#3b4fed5cfb58010e3a2be4b6e74615e4847f1074" integrity sha512-eKj4f/BsN/qcculZiRSujogjvp5O/k4lOW5m35NopjZM/QwLOR075a8pJW5hD+Rtdm2DaCVPENS6KtSQnUD6BA== -"@types/node@^12.12.14": - version "12.20.55" - resolved "https://registry.yarnpkg.com/@types/node/-/node-12.20.55.tgz#c329cbd434c42164f846b909bd6f85b5537f6240" - integrity sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ== - -"@types/resolve@1.17.1": - version "1.17.1" - resolved "https://registry.yarnpkg.com/@types/resolve/-/resolve-1.17.1.tgz#3afd6ad8967c77e4376c598a82ddd58f46ec45d6" - integrity sha512-yy7HuzQhj0dhGpD8RLXSZWEkLsV9ibvxvi6EiJ3bkqLAO1RGo0WbkWQiwpRlSFymTJRz0d3k5LM3kkx8ArDbLw== - dependencies: - "@types/node" "*" - "@types/yauzl@^2.9.1": version "2.9.2" resolved "https://registry.yarnpkg.com/@types/yauzl/-/yauzl-2.9.2.tgz#c48e5d56aff1444409e39fa164b0b4d4552a7b7a" @@ -192,148 +130,141 @@ dependencies: "@types/node" "*" -"@ungap/promise-all-settled@1.1.2": - version "1.1.2" - resolved "https://registry.yarnpkg.com/@ungap/promise-all-settled/-/promise-all-settled-1.1.2.tgz#aa58042711d6e3275dd37dc597e5d31e8c290a44" - integrity sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q== - -"@webassemblyjs/ast@1.11.1": - version "1.11.1" - resolved "https://registry.yarnpkg.com/@webassemblyjs/ast/-/ast-1.11.1.tgz#2bfd767eae1a6996f432ff7e8d7fc75679c0b6a7" - integrity sha512-ukBh14qFLjxTQNTXocdyksN5QdM28S1CxHt2rdskFyL+xFV7VremuBLVbmCePj+URalXBENx/9Lm7lnhihtCSw== - dependencies: - "@webassemblyjs/helper-numbers" "1.11.1" - "@webassemblyjs/helper-wasm-bytecode" "1.11.1" - -"@webassemblyjs/floating-point-hex-parser@1.11.1": - version "1.11.1" - resolved "https://registry.yarnpkg.com/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.11.1.tgz#f6c61a705f0fd7a6aecaa4e8198f23d9dc179e4f" - integrity sha512-iGRfyc5Bq+NnNuX8b5hwBrRjzf0ocrJPI6GWFodBFzmFnyvrQ83SHKhmilCU/8Jv67i4GJZBMhEzltxzcNagtQ== - -"@webassemblyjs/helper-api-error@1.11.1": - version "1.11.1" - resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-api-error/-/helper-api-error-1.11.1.tgz#1a63192d8788e5c012800ba6a7a46c705288fd16" - integrity sha512-RlhS8CBCXfRUR/cwo2ho9bkheSXG0+NwooXcc3PAILALf2QLdFyj7KGsKRbVc95hZnhnERon4kW/D3SZpp6Tcg== - -"@webassemblyjs/helper-buffer@1.11.1": - version "1.11.1" - resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-buffer/-/helper-buffer-1.11.1.tgz#832a900eb444884cde9a7cad467f81500f5e5ab5" - integrity sha512-gwikF65aDNeeXa8JxXa2BAk+REjSyhrNC9ZwdT0f8jc4dQQeDQ7G4m0f2QCLPJiMTTO6wfDmRmj/pW0PsUvIcA== - -"@webassemblyjs/helper-numbers@1.11.1": - version "1.11.1" - resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-numbers/-/helper-numbers-1.11.1.tgz#64d81da219fbbba1e3bd1bfc74f6e8c4e10a62ae" - integrity sha512-vDkbxiB8zfnPdNK9Rajcey5C0w+QJugEglN0of+kmO8l7lDb77AnlKYQF7aarZuCrv+l0UvqL+68gSDr3k9LPQ== - dependencies: - "@webassemblyjs/floating-point-hex-parser" "1.11.1" - "@webassemblyjs/helper-api-error" "1.11.1" +"@webassemblyjs/ast@1.11.6", "@webassemblyjs/ast@^1.11.5": + version "1.11.6" + resolved "https://registry.yarnpkg.com/@webassemblyjs/ast/-/ast-1.11.6.tgz#db046555d3c413f8966ca50a95176a0e2c642e24" + integrity sha512-IN1xI7PwOvLPgjcf180gC1bqn3q/QaOCwYUahIOhbYUu8KA/3tw2RT/T0Gidi1l7Hhj5D/INhJxiICObqpMu4Q== + dependencies: + "@webassemblyjs/helper-numbers" "1.11.6" + "@webassemblyjs/helper-wasm-bytecode" "1.11.6" + +"@webassemblyjs/floating-point-hex-parser@1.11.6": + version "1.11.6" + resolved "https://registry.yarnpkg.com/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.11.6.tgz#dacbcb95aff135c8260f77fa3b4c5fea600a6431" + integrity sha512-ejAj9hfRJ2XMsNHk/v6Fu2dGS+i4UaXBXGemOfQ/JfQ6mdQg/WXtwleQRLLS4OvfDhv8rYnVwH27YJLMyYsxhw== + +"@webassemblyjs/helper-api-error@1.11.6": + version "1.11.6" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-api-error/-/helper-api-error-1.11.6.tgz#6132f68c4acd59dcd141c44b18cbebbd9f2fa768" + integrity sha512-o0YkoP4pVu4rN8aTJgAyj9hC2Sv5UlkzCHhxqWj8butaLvnpdc2jOwh4ewE6CX0txSfLn/UYaV/pheS2Txg//Q== + +"@webassemblyjs/helper-buffer@1.11.6": + version "1.11.6" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-buffer/-/helper-buffer-1.11.6.tgz#b66d73c43e296fd5e88006f18524feb0f2c7c093" + integrity sha512-z3nFzdcp1mb8nEOFFk8DrYLpHvhKC3grJD2ardfKOzmbmJvEf/tPIqCY+sNcwZIY8ZD7IkB2l7/pqhUhqm7hLA== + +"@webassemblyjs/helper-numbers@1.11.6": + version "1.11.6" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-numbers/-/helper-numbers-1.11.6.tgz#cbce5e7e0c1bd32cf4905ae444ef64cea919f1b5" + integrity sha512-vUIhZ8LZoIWHBohiEObxVm6hwP034jwmc9kuq5GdHZH0wiLVLIPcMCdpJzG4C11cHoQ25TFIQj9kaVADVX7N3g== + dependencies: + "@webassemblyjs/floating-point-hex-parser" "1.11.6" + "@webassemblyjs/helper-api-error" "1.11.6" "@xtuc/long" "4.2.2" -"@webassemblyjs/helper-wasm-bytecode@1.11.1": - version "1.11.1" - resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.11.1.tgz#f328241e41e7b199d0b20c18e88429c4433295e1" - integrity sha512-PvpoOGiJwXeTrSf/qfudJhwlvDQxFgelbMqtq52WWiXC6Xgg1IREdngmPN3bs4RoO83PnL/nFrxucXj1+BX62Q== +"@webassemblyjs/helper-wasm-bytecode@1.11.6": + version "1.11.6" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.11.6.tgz#bb2ebdb3b83aa26d9baad4c46d4315283acd51e9" + integrity sha512-sFFHKwcmBprO9e7Icf0+gddyWYDViL8bpPjJJl0WHxCdETktXdmtWLGVzoHbqUcY4Be1LkNfwTmXOJUFZYSJdA== -"@webassemblyjs/helper-wasm-section@1.11.1": - version "1.11.1" - resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.11.1.tgz#21ee065a7b635f319e738f0dd73bfbda281c097a" - integrity sha512-10P9No29rYX1j7F3EVPX3JvGPQPae+AomuSTPiF9eBQeChHI6iqjMIwR9JmOJXwpnn/oVGDk7I5IlskuMwU/pg== +"@webassemblyjs/helper-wasm-section@1.11.6": + version "1.11.6" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.11.6.tgz#ff97f3863c55ee7f580fd5c41a381e9def4aa577" + integrity sha512-LPpZbSOwTpEC2cgn4hTydySy1Ke+XEu+ETXuoyvuyezHO3Kjdu90KK95Sh9xTbmjrCsUwvWwCOQQNta37VrS9g== dependencies: - "@webassemblyjs/ast" "1.11.1" - "@webassemblyjs/helper-buffer" "1.11.1" - "@webassemblyjs/helper-wasm-bytecode" "1.11.1" - "@webassemblyjs/wasm-gen" "1.11.1" + "@webassemblyjs/ast" "1.11.6" + "@webassemblyjs/helper-buffer" "1.11.6" + "@webassemblyjs/helper-wasm-bytecode" "1.11.6" + "@webassemblyjs/wasm-gen" "1.11.6" -"@webassemblyjs/ieee754@1.11.1": - version "1.11.1" - resolved "https://registry.yarnpkg.com/@webassemblyjs/ieee754/-/ieee754-1.11.1.tgz#963929e9bbd05709e7e12243a099180812992614" - integrity sha512-hJ87QIPtAMKbFq6CGTkZYJivEwZDbQUgYd3qKSadTNOhVY7p+gfP6Sr0lLRVTaG1JjFj+r3YchoqRYxNH3M0GQ== +"@webassemblyjs/ieee754@1.11.6": + version "1.11.6" + resolved "https://registry.yarnpkg.com/@webassemblyjs/ieee754/-/ieee754-1.11.6.tgz#bb665c91d0b14fffceb0e38298c329af043c6e3a" + integrity sha512-LM4p2csPNvbij6U1f19v6WR56QZ8JcHg3QIJTlSwzFcmx6WSORicYj6I63f9yU1kEUtrpG+kjkiIAkevHpDXrg== dependencies: "@xtuc/ieee754" "^1.2.0" -"@webassemblyjs/leb128@1.11.1": - version "1.11.1" - resolved "https://registry.yarnpkg.com/@webassemblyjs/leb128/-/leb128-1.11.1.tgz#ce814b45574e93d76bae1fb2644ab9cdd9527aa5" - integrity sha512-BJ2P0hNZ0u+Th1YZXJpzW6miwqQUGcIHT1G/sf72gLVD9DZ5AdYTqPNbHZh6K1M5VmKvFXwGSWZADz+qBWxeRw== +"@webassemblyjs/leb128@1.11.6": + version "1.11.6" + resolved "https://registry.yarnpkg.com/@webassemblyjs/leb128/-/leb128-1.11.6.tgz#70e60e5e82f9ac81118bc25381a0b283893240d7" + integrity sha512-m7a0FhE67DQXgouf1tbN5XQcdWoNgaAuoULHIfGFIEVKA6tu/edls6XnIlkmS6FrXAquJRPni3ZZKjw6FSPjPQ== dependencies: "@xtuc/long" "4.2.2" -"@webassemblyjs/utf8@1.11.1": - version "1.11.1" - resolved "https://registry.yarnpkg.com/@webassemblyjs/utf8/-/utf8-1.11.1.tgz#d1f8b764369e7c6e6bae350e854dec9a59f0a3ff" - integrity sha512-9kqcxAEdMhiwQkHpkNiorZzqpGrodQQ2IGrHHxCy+Ozng0ofyMA0lTqiLkVs1uzTRejX+/O0EOT7KxqVPuXosQ== - -"@webassemblyjs/wasm-edit@1.11.1": - version "1.11.1" - resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-edit/-/wasm-edit-1.11.1.tgz#ad206ebf4bf95a058ce9880a8c092c5dec8193d6" - integrity sha512-g+RsupUC1aTHfR8CDgnsVRVZFJqdkFHpsHMfJuWQzWU3tvnLC07UqHICfP+4XyL2tnr1amvl1Sdp06TnYCmVkA== - dependencies: - "@webassemblyjs/ast" "1.11.1" - "@webassemblyjs/helper-buffer" "1.11.1" - "@webassemblyjs/helper-wasm-bytecode" "1.11.1" - "@webassemblyjs/helper-wasm-section" "1.11.1" - "@webassemblyjs/wasm-gen" "1.11.1" - "@webassemblyjs/wasm-opt" "1.11.1" - "@webassemblyjs/wasm-parser" "1.11.1" - "@webassemblyjs/wast-printer" "1.11.1" - -"@webassemblyjs/wasm-gen@1.11.1": - version "1.11.1" - resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-gen/-/wasm-gen-1.11.1.tgz#86c5ea304849759b7d88c47a32f4f039ae3c8f76" - integrity sha512-F7QqKXwwNlMmsulj6+O7r4mmtAlCWfO/0HdgOxSklZfQcDu0TpLiD1mRt/zF25Bk59FIjEuGAIyn5ei4yMfLhA== - dependencies: - "@webassemblyjs/ast" "1.11.1" - "@webassemblyjs/helper-wasm-bytecode" "1.11.1" - "@webassemblyjs/ieee754" "1.11.1" - "@webassemblyjs/leb128" "1.11.1" - "@webassemblyjs/utf8" "1.11.1" - -"@webassemblyjs/wasm-opt@1.11.1": - version "1.11.1" - resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-opt/-/wasm-opt-1.11.1.tgz#657b4c2202f4cf3b345f8a4c6461c8c2418985f2" - integrity sha512-VqnkNqnZlU5EB64pp1l7hdm3hmQw7Vgqa0KF/KCNO9sIpI6Fk6brDEiX+iCOYrvMuBWDws0NkTOxYEb85XQHHw== - dependencies: - "@webassemblyjs/ast" "1.11.1" - "@webassemblyjs/helper-buffer" "1.11.1" - "@webassemblyjs/wasm-gen" "1.11.1" - "@webassemblyjs/wasm-parser" "1.11.1" - -"@webassemblyjs/wasm-parser@1.11.1": - version "1.11.1" - resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-parser/-/wasm-parser-1.11.1.tgz#86ca734534f417e9bd3c67c7a1c75d8be41fb199" - integrity sha512-rrBujw+dJu32gYB7/Lup6UhdkPx9S9SnobZzRVL7VcBH9Bt9bCBLEuX/YXOOtBsOZ4NQrRykKhffRWHvigQvOA== - dependencies: - "@webassemblyjs/ast" "1.11.1" - "@webassemblyjs/helper-api-error" "1.11.1" - "@webassemblyjs/helper-wasm-bytecode" "1.11.1" - "@webassemblyjs/ieee754" "1.11.1" - "@webassemblyjs/leb128" "1.11.1" - "@webassemblyjs/utf8" "1.11.1" - -"@webassemblyjs/wast-printer@1.11.1": - version "1.11.1" - resolved "https://registry.yarnpkg.com/@webassemblyjs/wast-printer/-/wast-printer-1.11.1.tgz#d0c73beda8eec5426f10ae8ef55cee5e7084c2f0" - integrity sha512-IQboUWM4eKzWW+N/jij2sRatKMh99QEelo3Eb2q0qXkvPRISAj8Qxtmw5itwqK+TTkBuUIE45AxYPToqPtL5gg== - dependencies: - "@webassemblyjs/ast" "1.11.1" +"@webassemblyjs/utf8@1.11.6": + version "1.11.6" + resolved "https://registry.yarnpkg.com/@webassemblyjs/utf8/-/utf8-1.11.6.tgz#90f8bc34c561595fe156603be7253cdbcd0fab5a" + integrity sha512-vtXf2wTQ3+up9Zsg8sa2yWiQpzSsMyXj0qViVP6xKGCUT8p8YJ6HqI7l5eCnWx1T/FYdsv07HQs2wTFbbof/RA== + +"@webassemblyjs/wasm-edit@^1.11.5": + version "1.11.6" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-edit/-/wasm-edit-1.11.6.tgz#c72fa8220524c9b416249f3d94c2958dfe70ceab" + integrity sha512-Ybn2I6fnfIGuCR+Faaz7YcvtBKxvoLV3Lebn1tM4o/IAJzmi9AWYIPWpyBfU8cC+JxAO57bk4+zdsTjJR+VTOw== + dependencies: + "@webassemblyjs/ast" "1.11.6" + "@webassemblyjs/helper-buffer" "1.11.6" + "@webassemblyjs/helper-wasm-bytecode" "1.11.6" + "@webassemblyjs/helper-wasm-section" "1.11.6" + "@webassemblyjs/wasm-gen" "1.11.6" + "@webassemblyjs/wasm-opt" "1.11.6" + "@webassemblyjs/wasm-parser" "1.11.6" + "@webassemblyjs/wast-printer" "1.11.6" + +"@webassemblyjs/wasm-gen@1.11.6": + version "1.11.6" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-gen/-/wasm-gen-1.11.6.tgz#fb5283e0e8b4551cc4e9c3c0d7184a65faf7c268" + integrity sha512-3XOqkZP/y6B4F0PBAXvI1/bky7GryoogUtfwExeP/v7Nzwo1QLcq5oQmpKlftZLbT+ERUOAZVQjuNVak6UXjPA== + dependencies: + "@webassemblyjs/ast" "1.11.6" + "@webassemblyjs/helper-wasm-bytecode" "1.11.6" + "@webassemblyjs/ieee754" "1.11.6" + "@webassemblyjs/leb128" "1.11.6" + "@webassemblyjs/utf8" "1.11.6" + +"@webassemblyjs/wasm-opt@1.11.6": + version "1.11.6" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-opt/-/wasm-opt-1.11.6.tgz#d9a22d651248422ca498b09aa3232a81041487c2" + integrity sha512-cOrKuLRE7PCe6AsOVl7WasYf3wbSo4CeOk6PkrjS7g57MFfVUF9u6ysQBBODX0LdgSvQqRiGz3CXvIDKcPNy4g== + dependencies: + "@webassemblyjs/ast" "1.11.6" + "@webassemblyjs/helper-buffer" "1.11.6" + "@webassemblyjs/wasm-gen" "1.11.6" + "@webassemblyjs/wasm-parser" "1.11.6" + +"@webassemblyjs/wasm-parser@1.11.6", "@webassemblyjs/wasm-parser@^1.11.5": + version "1.11.6" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-parser/-/wasm-parser-1.11.6.tgz#bb85378c527df824004812bbdb784eea539174a1" + integrity sha512-6ZwPeGzMJM3Dqp3hCsLgESxBGtT/OeCvCZ4TA1JUPYgmhAx38tTPR9JaKy0S5H3evQpO/h2uWs2j6Yc/fjkpTQ== + dependencies: + "@webassemblyjs/ast" "1.11.6" + "@webassemblyjs/helper-api-error" "1.11.6" + "@webassemblyjs/helper-wasm-bytecode" "1.11.6" + "@webassemblyjs/ieee754" "1.11.6" + "@webassemblyjs/leb128" "1.11.6" + "@webassemblyjs/utf8" "1.11.6" + +"@webassemblyjs/wast-printer@1.11.6": + version "1.11.6" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wast-printer/-/wast-printer-1.11.6.tgz#a7bf8dd7e362aeb1668ff43f35cb849f188eff20" + integrity sha512-JM7AhRcE+yW2GWYaKeHL5vt4xqee5N2WcezptmgyhNS+ScggqcT1OtXykhAb13Sn5Yas0j2uv9tHgrjwvzAP4A== + dependencies: + "@webassemblyjs/ast" "1.11.6" "@xtuc/long" "4.2.2" -"@webpack-cli/configtest@^1.2.0": - version "1.2.0" - resolved "https://registry.yarnpkg.com/@webpack-cli/configtest/-/configtest-1.2.0.tgz#7b20ce1c12533912c3b217ea68262365fa29a6f5" - integrity sha512-4FB8Tj6xyVkyqjj1OaTqCjXYULB9FMkqQ8yGrZjRDrYh0nOE+7Lhs45WioWQQMV+ceFlE368Ukhe6xdvJM9Egg== +"@webpack-cli/configtest@^2.1.0": + version "2.1.1" + resolved "https://registry.yarnpkg.com/@webpack-cli/configtest/-/configtest-2.1.1.tgz#3b2f852e91dac6e3b85fb2a314fb8bef46d94646" + integrity sha512-wy0mglZpDSiSS0XHrVR+BAdId2+yxPSoJW8fsna3ZpYSlufjvxnP4YbKTCBZnNIcGN4r6ZPXV55X4mYExOfLmw== -"@webpack-cli/info@^1.5.0": - version "1.5.0" - resolved "https://registry.yarnpkg.com/@webpack-cli/info/-/info-1.5.0.tgz#6c78c13c5874852d6e2dd17f08a41f3fe4c261b1" - integrity sha512-e8tSXZpw2hPl2uMJY6fsMswaok5FdlGNRTktvFk2sD8RjH0hE2+XistawJx1vmKteh4NmGmNUrp+Tb2w+udPcQ== - dependencies: - envinfo "^7.7.3" +"@webpack-cli/info@^2.0.1": + version "2.0.2" + resolved "https://registry.yarnpkg.com/@webpack-cli/info/-/info-2.0.2.tgz#cc3fbf22efeb88ff62310cf885c5b09f44ae0fdd" + integrity sha512-zLHQdI/Qs1UyT5UBdWNqsARasIA+AaF8t+4u2aS2nEpBQh2mWIVb8qAklq0eUENnC5mOItrIB4LiS9xMtph18A== -"@webpack-cli/serve@^1.7.0": - version "1.7.0" - resolved "https://registry.yarnpkg.com/@webpack-cli/serve/-/serve-1.7.0.tgz#e1993689ac42d2b16e9194376cfb6753f6254db1" - integrity sha512-oxnCNGj88fL+xzV+dacXs44HcDwf1ovs3AuEzvP7mqXw7fQntqIhQ1BRmynh4qEKQSSSRSWVyXRjmTbZIX9V2Q== +"@webpack-cli/serve@^2.0.3": + version "2.0.5" + resolved "https://registry.yarnpkg.com/@webpack-cli/serve/-/serve-2.0.5.tgz#325db42395cd49fe6c14057f9a900e427df8810e" + integrity sha512-lqaoKnRYBdo1UgDX8uF24AfGMifWK19TxPmM5FHc2vAGxrJ/qtyUyFBWoY1tISZdelsQ5fBcOusifo5o5wSJxQ== "@xtuc/ieee754@^1.2.0": version "1.2.0" @@ -412,13 +343,6 @@ ansi-regex@^5.0.1: resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== -ansi-styles@^3.2.1: - version "3.2.1" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" - integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== - dependencies: - color-convert "^1.9.0" - ansi-styles@^4.0.0, ansi-styles@^4.1.0: version "4.3.0" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" @@ -439,11 +363,6 @@ argparse@^2.0.1: resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38" integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q== -atob@^2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9" - integrity sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg== - balanced-match@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" @@ -545,11 +464,6 @@ buffer@^5.2.1, buffer@^5.5.0: base64-js "^1.3.1" ieee754 "^1.1.13" -builtin-modules@^3.3.0: - version "3.3.0" - resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-3.3.0.tgz#cae62812b89801e9656336e46223e030386be7b6" - integrity sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw== - bytes@3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.1.tgz#3f018291cb4cbad9accb6e6970bca9c8889e879a" @@ -565,15 +479,6 @@ caniuse-lite@^1.0.30001286: resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001312.tgz#e11eba4b87e24d22697dae05455d5aea28550d5f" integrity sha512-Wiz1Psk2MEK0pX3rUzWaunLTZzqS2JYZFzNKqAiJGiuxIjRPLgV6+VDPOg6lQOUxmDwhTlh198JsTTi8Hzw6aQ== -chalk@^2.0.0: - version "2.4.2" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" - integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== - dependencies: - ansi-styles "^3.2.1" - escape-string-regexp "^1.0.5" - supports-color "^5.3.0" - chalk@^4.1.0: version "4.1.2" resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" @@ -625,13 +530,6 @@ clone-deep@^4.0.1: kind-of "^6.0.2" shallow-clone "^3.0.0" -color-convert@^1.9.0: - version "1.9.3" - resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" - integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== - dependencies: - color-name "1.1.3" - color-convert@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" @@ -639,11 +537,6 @@ color-convert@^2.0.1: dependencies: color-name "~1.1.4" -color-name@1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" - integrity sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw== - color-name@~1.1.4: version "1.1.4" resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" @@ -654,21 +547,16 @@ colorette@^2.0.14: resolved "https://registry.yarnpkg.com/colorette/-/colorette-2.0.16.tgz#713b9af84fdb000139f04546bd4a93f62a5085da" integrity sha512-hUewv7oMjCp+wkBv5Rm0v87eJhq4woh5rSR+42YSQJKecCqgIqNkZ6lAlQms/BwHPJA5NKMRlpxPRv0n8HQW6g== +commander@^10.0.1: + version "10.0.1" + resolved "https://registry.yarnpkg.com/commander/-/commander-10.0.1.tgz#881ee46b4f77d1c1dccc5823433aa39b022cbe06" + integrity sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug== + commander@^2.20.0: version "2.20.3" resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== -commander@^7.0.0: - version "7.2.0" - resolved "https://registry.yarnpkg.com/commander/-/commander-7.2.0.tgz#a36cb57d0b501ce108e4d20559a150a391d97ab7" - integrity sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw== - -commondir@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/commondir/-/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b" - integrity sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg== - concat-map@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" @@ -754,16 +642,6 @@ decamelize@^4.0.0: resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-4.0.0.tgz#aa472d7bf660eb15f3494efd531cab7f2a709837" integrity sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ== -decode-uri-component@^0.2.0: - version "0.2.2" - resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.2.tgz#e69dbe25d37941171dd540e024c444cd5188e1e9" - integrity sha512-FqUYQ+8o158GyGTrMFJms9qh3CqTKvAqgqsTnkLI8sKu0028orqBhxNMFkFen0zGyg6epACD32pjVk58ngIErQ== - -deepmerge@^4.2.2: - version "4.3.1" - resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-4.3.1.tgz#44b5f2147cd3b00d4b56137685966f26fd25dd4a" - integrity sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A== - depd@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9" @@ -842,10 +720,10 @@ engine.io@~6.2.1: engine.io-parser "~5.0.3" ws "~8.2.3" -enhanced-resolve@^5.10.0: - version "5.12.0" - resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.12.0.tgz#300e1c90228f5b570c4d35babf263f6da7155634" - integrity sha512-QHTXI/sZQmko1cbDoNAa3mJ5qhWUUNAq3vR0/YiD379fWQrcfuoX1+HW2S0MTt7XmoPLapdaDKUtelUSPic7hQ== +enhanced-resolve@^5.13.0: + version "5.15.0" + resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.15.0.tgz#1af946c7d93603eb88e9896cee4904dc012e9c35" + integrity sha512-LXYT42KJ7lpIKECr2mAXIaMldcNCh/7E0KBKOu4KSfkHmP+mZmSs+8V5gBAqisWBy0OO4W5Oyys0GO1Y8KtdKg== dependencies: graceful-fs "^4.2.4" tapable "^2.2.0" @@ -860,10 +738,10 @@ envinfo@^7.7.3: resolved "https://registry.yarnpkg.com/envinfo/-/envinfo-7.8.1.tgz#06377e3e5f4d379fea7ac592d5ad8927e0c4d475" integrity sha512-/o+BXHmB7ocbHEAs6F2EnG0ogybVVUdkRunTT2glZU9XAaGmhqskrvKwqXuDfNjEO0LZKWdejEEpnq8aM0tOaw== -es-module-lexer@^0.9.0: - version "0.9.3" - resolved "https://registry.yarnpkg.com/es-module-lexer/-/es-module-lexer-0.9.3.tgz#6f13db00cc38417137daf74366f535c8eb438f19" - integrity sha512-1HQ2M2sPtxwnvOvT1ZClHyQDiggdNjURWpY2we6aMKCQiUVxTmVs2UYPLIrD84sS+kMdUwfBSylbJPwNnBrnHQ== +es-module-lexer@^1.2.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/es-module-lexer/-/es-module-lexer-1.3.1.tgz#c1b0dd5ada807a3b3155315911f364dc4e909db1" + integrity sha512-JUFAyicQV9mXc3YRxPnDlrfBKpqt6hUYzz9/boprUJHs4e4KVr3XwOF70doO6gwXUor6EWZJAyWAfKki84t20Q== escalade@^3.1.1: version "3.1.1" @@ -880,11 +758,6 @@ escape-string-regexp@4.0.0: resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== -escape-string-regexp@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" - integrity sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg== - eslint-scope@5.1.1: version "5.1.1" resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.1.1.tgz#e786e59a66cb92b3f6c1fb0d508aab174848f48c" @@ -910,16 +783,6 @@ estraverse@^5.2.0: resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.3.0.tgz#2eea5290702f26ab8fe5370370ff86c965d21123" integrity sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA== -estree-walker@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-1.0.1.tgz#31bc5d612c96b704106b477e6dd5d8aa138cb700" - integrity sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg== - -estree-walker@^2.0.1: - version "2.0.2" - resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-2.0.2.tgz#52f010178c2a4c117a7757cfe942adb7d2da4cac" - integrity sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w== - event-target-shim@^5.0.0: version "5.0.1" resolved "https://registry.yarnpkg.com/event-target-shim/-/event-target-shim-5.0.1.tgz#5d4d3ebdf9583d63a5333ce2deb7480ab2b05789" @@ -1024,7 +887,7 @@ follow-redirects@^1.0.0: resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.14.8.tgz#016996fb9a11a100566398b1c6839337d7bfa8fc" integrity sha512-1x0S9UVJHsQprFcEC/qnNzBLcIxsjAV905f/UkQxbclCsoTWlacCNOpQa/anodLl2uaEKFhfWOvM2Qg77+15zA== -format-util@1.0.5, format-util@^1.0.5: +format-util@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/format-util/-/format-util-1.0.5.tgz#1ffb450c8a03e7bccffe40643180918cc297d271" integrity sha512-varLbTj0e0yVyRpqQhuWV+8hlePAgaoFRhNFj50BNjEIrw1/DphHSObtqwskVCPWNgzwPoQrZAbfa/SBiicNeg== @@ -1094,33 +957,21 @@ glob@7.2.0, glob@^7.1.3, glob@^7.1.7: once "^1.3.0" path-is-absolute "^1.0.0" -glob@^7.1.6: - version "7.2.3" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b" - integrity sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q== - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.1.1" - once "^1.3.0" - path-is-absolute "^1.0.0" - graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.4, graceful-fs@^4.2.6: version "4.2.9" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.9.tgz#041b05df45755e587a24942279b9d113146e1c96" integrity sha512-NtNxqUcXgpW2iMrfqSfR73Glt39K+BLwWsPs94yR63v45T0Wbej7eRmL5cWfwEgqXnmjQp3zaJTshdRW/qC2ZQ== +graceful-fs@^4.2.10: + version "4.2.11" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.11.tgz#4183e4e8bf08bb6e05bbb2f7d2e0c8f712ca40e3" + integrity sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ== + graceful-fs@^4.2.9: version "4.2.10" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.10.tgz#147d3a006da4ca3ce14728c7aefc287c367d7a6c" integrity sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA== -has-flag@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" - integrity sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw== - has-flag@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" @@ -1206,10 +1057,10 @@ inherits@2, inherits@2.0.4, inherits@^2.0.3, inherits@^2.0.4: resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== -interpret@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/interpret/-/interpret-2.2.0.tgz#1a78a0b5965c40a5416d007ad6f50ad27c417df9" - integrity sha512-Ju0Bz/cEia55xDwUWEa8+olFpCiQoypjnQySseKtmjNrnps3P+xfpUmGr90T7yjlVJmOtybRvPXhKMbHr+fWnw== +interpret@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/interpret/-/interpret-3.1.1.tgz#5be0ceed67ca79c6c4bc5cf0d7ee843dcea110c4" + integrity sha512-6xwYfHbajpoF0xLW+iwLkhwgvLoZDfjYfoFNu8ftMoXINzwuymNLd9u/KmwtdT2GbR+/Cz66otEGEVVUHX9QLQ== is-binary-path@~2.1.0: version "2.1.0" @@ -1218,32 +1069,13 @@ is-binary-path@~2.1.0: dependencies: binary-extensions "^2.0.0" -is-builtin-module@^3.1.0: - version "3.2.1" - resolved "https://registry.yarnpkg.com/is-builtin-module/-/is-builtin-module-3.2.1.tgz#f03271717d8654cfcaf07ab0463faa3571581169" - integrity sha512-BSLE3HnV2syZ0FK0iMA/yUGplUeMmNz4AW5fnTunbCIqZi4vG3WjJT9FHMy5D69xmAYBHXQhJdALdpwVxV501A== - dependencies: - builtin-modules "^3.3.0" - -is-core-module@^2.11.0: - version "2.12.1" - resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.12.1.tgz#0c0b6885b6f80011c71541ce15c8d66cf5a4f9fd" - integrity sha512-Q4ZuBAe2FUsKtyQJoQHlvP8OvBERxO3jEmy1I7hcRXcJBGGHFh/aJBswbXuS9sgrDH2QUO8ilkwNPHvHMd8clg== - dependencies: - has "^1.0.3" - -is-core-module@^2.8.1: - version "2.8.1" - resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.8.1.tgz#f59fdfca701d5879d0a6b100a40aa1560ce27211" - integrity sha512-SdNCUs284hr40hFTFP6l0IfZ/RSrMXF3qgoRHd3/79unUTvrFO/JoXwkGm+5J/Oe3E/b5GsnG330uUNgRpu1PA== +is-core-module@^2.13.0: + version "2.13.0" + resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.13.0.tgz#bb52aa6e2cbd49a30c2ba68c42bf3435ba6072db" + integrity sha512-Z7dk6Qo8pOCp3l4tsX2C5ZVas4V+UxwQodwZhLopL91TX8UyyHEXafPcyoeeWuLrwzHcr3igO78wNLwHJHsMCQ== dependencies: has "^1.0.3" -is-docker@^2.0.0: - version "2.2.1" - resolved "https://registry.yarnpkg.com/is-docker/-/is-docker-2.2.1.tgz#33eeabe23cfe86f14bde4408a02c0cfb853acdaa" - integrity sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ== - is-extglob@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" @@ -1261,11 +1093,6 @@ is-glob@^4.0.1, is-glob@~4.0.1: dependencies: is-extglob "^2.1.1" -is-module@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-module/-/is-module-1.0.0.tgz#3258fb69f78c14d5b815d664336b4cffb6441591" - integrity sha512-51ypPSPCoTEIN9dy5Oy+h4pShgJmPCygKfyRCISBI+JoWT/2oJvK8QPxmwv7b/p239jXrm9M1mlQbyKJ5A152g== - is-number@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" @@ -1283,25 +1110,11 @@ is-plain-object@^2.0.4: dependencies: isobject "^3.0.1" -is-reference@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/is-reference/-/is-reference-1.2.1.tgz#8b2dac0b371f4bc994fdeaba9eb542d03002d0b7" - integrity sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ== - dependencies: - "@types/estree" "*" - is-unicode-supported@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz#3f26c76a809593b52bfa2ecb5710ed2779b522a7" integrity sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw== -is-wsl@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/is-wsl/-/is-wsl-2.2.0.tgz#74a4c76e77ca9fd3f932f290c17ea326cd157271" - integrity sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww== - dependencies: - is-docker "^2.0.0" - isbinaryfile@^4.0.8: version "4.0.8" resolved "https://registry.yarnpkg.com/isbinaryfile/-/isbinaryfile-4.0.8.tgz#5d34b94865bd4946633ecc78a026fc76c5b11fcf" @@ -1317,15 +1130,6 @@ isobject@^3.0.1: resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" integrity sha1-TkMekrEalzFjaqH5yNHMvP2reN8= -jest-worker@^26.2.1: - version "26.6.2" - resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-26.6.2.tgz#7f72cbc4d643c365e27b9fd775f9d0eaa9c7a8ed" - integrity sha512-KWYVV1c4i+jbMpaBC+U++4Va0cp8OisU185o73T1vo99hqi7w8tSJfUXYswwqqrjzwxa6KpRK54WhPvwf5w6PQ== - dependencies: - "@types/node" "*" - merge-stream "^2.0.0" - supports-color "^7.0.0" - jest-worker@^27.4.5: version "27.5.1" resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-27.5.1.tgz#8d146f0900e8973b106b6f73cc1e9a8cb86f8db0" @@ -1335,11 +1139,6 @@ jest-worker@^27.4.5: merge-stream "^2.0.0" supports-color "^8.0.0" -js-tokens@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" - integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== - js-yaml@4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602" @@ -1364,10 +1163,10 @@ jsonfile@^4.0.0: optionalDependencies: graceful-fs "^4.1.6" -karma-chrome-launcher@3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/karma-chrome-launcher/-/karma-chrome-launcher-3.1.1.tgz#baca9cc071b1562a1db241827257bfe5cab597ea" - integrity sha512-hsIglcq1vtboGPAN+DGCISCFOxW+ZVnIqhDQcCMqqCp+4dmJ0Qpq5QAjkbA0X2L9Mi6OBkHi2Srrbmm7pUKkzQ== +karma-chrome-launcher@3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/karma-chrome-launcher/-/karma-chrome-launcher-3.2.0.tgz#eb9c95024f2d6dfbb3748d3415ac9b381906b9a9" + integrity sha512-rE9RkUPI7I9mAxByQWkGJFXfFD6lE4gC5nPuZdobf/QdTEJI6EU4yIay/cfU/xV4ZxlM5JiTv7zWYgA64NpS5Q== dependencies: which "^1.2.1" @@ -1378,12 +1177,12 @@ karma-mocha@2.0.1: dependencies: minimist "^1.2.3" -karma-sourcemap-loader@0.3.8: - version "0.3.8" - resolved "https://registry.yarnpkg.com/karma-sourcemap-loader/-/karma-sourcemap-loader-0.3.8.tgz#d4bae72fb7a8397328a62b75013d2df937bdcf9c" - integrity sha512-zorxyAakYZuBcHRJE+vbrK2o2JXLFWK8VVjiT/6P+ltLBUGUvqTEkUiQ119MGdOrK7mrmxXHZF1/pfT6GgIZ6g== +karma-sourcemap-loader@0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/karma-sourcemap-loader/-/karma-sourcemap-loader-0.4.0.tgz#b01d73f8f688f533bcc8f5d273d43458e13b5488" + integrity sha512-xCRL3/pmhAYF3I6qOrcn0uhbQevitc2DERMPH82FMnG+4WReoGcGFZb1pURf2a5apyrOHRdvD+O6K7NljqKHyA== dependencies: - graceful-fs "^4.1.2" + graceful-fs "^4.2.10" karma-webpack@5.0.0: version "5.0.0" @@ -1394,10 +1193,10 @@ karma-webpack@5.0.0: minimatch "^3.0.4" webpack-merge "^4.1.5" -karma@6.4.0: - version "6.4.0" - resolved "https://registry.yarnpkg.com/karma/-/karma-6.4.0.tgz#82652dfecdd853ec227b74ed718a997028a99508" - integrity sha512-s8m7z0IF5g/bS5ONT7wsOavhW4i4aFkzD4u4wgzAQWT4HGUeWI3i21cK2Yz6jndMAeHETp5XuNsRoyGJZXVd4w== +karma@6.4.2: + version "6.4.2" + resolved "https://registry.yarnpkg.com/karma/-/karma-6.4.2.tgz#a983f874cee6f35990c4b2dcc3d274653714de8e" + integrity sha512-C6SU/53LB31BEgRg+omznBEMY4SjHU3ricV6zBcAe1EeILKkeScr+fZXtaI5WyDbkVowJxxAI6h73NcFPmXolQ== dependencies: "@colors/colors" "1.5.0" body-parser "^1.19.0" @@ -1472,13 +1271,6 @@ log4js@^6.4.1: rfdc "^1.3.0" streamroller "^3.1.3" -magic-string@^0.25.7: - version "0.25.9" - resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.25.9.tgz#de7f9faf91ef8a1c91d02c2e5314c8277dbcdd1c" - integrity sha512-RmF0AsMzgt25qzqqLc1+MbHmhdx0ojF2Fvs4XnOqz2ZOBXzzkEwc/dJQZCYHAn7v1jbVOjAZfK8msRn4BxO4VQ== - dependencies: - sourcemap-codec "^1.4.8" - media-typer@0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" @@ -1520,13 +1312,6 @@ minimatch@^3.0.4: dependencies: brace-expansion "^1.1.7" -minimatch@^3.1.1: - version "3.1.2" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" - integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== - dependencies: - brace-expansion "^1.1.7" - minimist@^1.2.3: version "1.2.5" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602" @@ -1549,12 +1334,11 @@ mkdirp@^0.5.5: dependencies: minimist "^1.2.6" -mocha@10.0.0: - version "10.0.0" - resolved "https://registry.yarnpkg.com/mocha/-/mocha-10.0.0.tgz#205447d8993ec755335c4b13deba3d3a13c4def9" - integrity sha512-0Wl+elVUD43Y0BqPZBzZt8Tnkw9CMUdNYnUsTfOM1vuhJVZL+kiesFYsqwBkEEuEixaiPe5ZQdqDgX2jddhmoA== +mocha@10.2.0: + version "10.2.0" + resolved "https://registry.yarnpkg.com/mocha/-/mocha-10.2.0.tgz#1fd4a7c32ba5ac372e03a17eef435bd00e5c68b8" + integrity sha512-IDY7fl/BecMwFHzoqF2sg/SHHANeBoMMXFlS9r0OXKDssYE1M5O43wUY/9BVPeIvfH2zmEbBfseqN9gBQZzXkg== dependencies: - "@ungap/promise-all-settled" "1.1.2" ansi-colors "4.1.1" browser-stdout "1.3.1" chokidar "3.5.3" @@ -1711,7 +1495,7 @@ picocolors@^1.0.0: resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.0.tgz#cb5bdc74ff3f51892236eaf79d68bc44564ab81c" integrity sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ== -picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.2.2: +picomatch@^2.0.4, picomatch@^2.2.1: version "2.3.1" resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== @@ -1812,12 +1596,12 @@ readdirp@~3.6.0: dependencies: picomatch "^2.2.1" -rechoir@^0.7.0: - version "0.7.1" - resolved "https://registry.yarnpkg.com/rechoir/-/rechoir-0.7.1.tgz#9478a96a1ca135b5e88fc027f03ee92d6c645686" - integrity sha512-/njmZ8s1wVeR6pjTZ+0nCnv8SpZNRMT2D1RLOJQESlYFDBvwpTA4KWJpZ+sBJ4+vhjILRcK7JIFdGCdxEAAitg== +rechoir@^0.8.0: + version "0.8.0" + resolved "https://registry.yarnpkg.com/rechoir/-/rechoir-0.8.0.tgz#49f866e0d32146142da3ad8f0eff352b3215ff22" + integrity sha512-/vxpCXddiX8NGfGO/mTafwjq4aFa/71pvamip0++IQk3zG8cbCj0fifNPrjjF1XMXUne91jL9OoxmdykoEtifQ== dependencies: - resolve "^1.9.0" + resolve "^1.20.0" require-directory@^2.1.1: version "2.1.1" @@ -1841,21 +1625,12 @@ resolve-from@^5.0.0: resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-5.0.0.tgz#c35225843df8f776df21c57557bc087e9dfdfc69" integrity sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw== -resolve@^1.17.0, resolve@^1.19.0: - version "1.22.2" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.2.tgz#0ed0943d4e301867955766c9f3e1ae6d01c6845f" - integrity sha512-Sb+mjNHOULsBv818T40qSPeRiuWLyaGMa5ewydRLFimneixmVy2zdivRl+AF6jaYPC8ERxGDmFSiqui6SfPd+g== +resolve@^1.20.0: + version "1.22.6" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.6.tgz#dd209739eca3aef739c626fea1b4f3c506195362" + integrity sha512-njhxM7mV12JfufShqGy3Rz8j11RPdLy4xi15UurGJeoHLfJpVXKdh3ueuOqbYUcDZnffr6X739JBo5LzyahEsw== dependencies: - is-core-module "^2.11.0" - path-parse "^1.0.7" - supports-preserve-symlinks-flag "^1.0.0" - -resolve@^1.9.0: - version "1.22.0" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.0.tgz#5e0b8c67c15df57a89bdbabe603a002f21731198" - integrity sha512-Hhtrw0nLeSrFQ7phPp4OOcVjLPIeMnRlr5mcnVuMe7M/7eBn98A3hmFRLoFo3DLZkivSYwhRUJTyPyWAk56WLw== - dependencies: - is-core-module "^2.8.1" + is-core-module "^2.13.0" path-parse "^1.0.7" supports-preserve-symlinks-flag "^1.0.0" @@ -1871,31 +1646,6 @@ rimraf@3.0.2, rimraf@^3.0.0, rimraf@^3.0.2: dependencies: glob "^7.1.3" -rollup-plugin-sourcemaps@^0.6.3: - version "0.6.3" - resolved "https://registry.yarnpkg.com/rollup-plugin-sourcemaps/-/rollup-plugin-sourcemaps-0.6.3.tgz#bf93913ffe056e414419607f1d02780d7ece84ed" - integrity sha512-paFu+nT1xvuO1tPFYXGe+XnQvg4Hjqv/eIhG8i5EspfYYPBKL57X7iVbfv55aNVASg3dzWvES9dmWsL2KhfByw== - dependencies: - "@rollup/pluginutils" "^3.0.9" - source-map-resolve "^0.6.0" - -rollup-plugin-terser@^7.0.2: - version "7.0.2" - resolved "https://registry.yarnpkg.com/rollup-plugin-terser/-/rollup-plugin-terser-7.0.2.tgz#e8fbba4869981b2dc35ae7e8a502d5c6c04d324d" - integrity sha512-w3iIaU4OxcF52UUXiZNsNeuXIMDvFrr+ZXK6bFZ0Q60qyVfq4uLptoS4bbq3paG3x216eQllFZX7zt6TIImguQ== - dependencies: - "@babel/code-frame" "^7.10.4" - jest-worker "^26.2.1" - serialize-javascript "^4.0.0" - terser "^5.0.0" - -rollup@^2.68.0: - version "2.79.1" - resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.79.1.tgz#bedee8faef7c9f93a2647ac0108748f497f081c7" - integrity sha512-uKxbd0IhMZOhjAiD5oAFp7BqvkA4Dv47qpOCtaNvng4HBwdbWtdOh8f5nZNuk2rp51PMGk3bzfWu5oayNEuYnw== - optionalDependencies: - fsevents "~2.3.2" - safe-buffer@^5.1.0, safe-buffer@~5.2.0: version "5.2.1" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" @@ -1906,7 +1656,7 @@ safe-buffer@^5.1.0, safe-buffer@~5.2.0: resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== -schema-utils@^3.1.0, schema-utils@^3.1.1: +schema-utils@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-3.1.1.tgz#bc74c4b6b6995c1d88f76a8b77bea7219e0c8281" integrity sha512-Y5PQxS4ITlC+EahLuXaY86TXfR7Dc5lw294alXOq86JAHCihAIZfqv8nNCWvaEJvaC51uN9hbLGeV0cFBdH+Fw== @@ -1915,17 +1665,26 @@ schema-utils@^3.1.0, schema-utils@^3.1.1: ajv "^6.12.5" ajv-keywords "^3.5.2" -serialize-javascript@6.0.0, serialize-javascript@^6.0.0: +schema-utils@^3.1.2: + version "3.3.0" + resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-3.3.0.tgz#f50a88877c3c01652a15b622ae9e9795df7a60fe" + integrity sha512-pN/yOAvcC+5rQ5nERGuwrjLlYvLTbCibnZ1I7B1LaiAz9BRBlE9GMgE/eqV30P7aJQUf7Ddimy/RsbYO/GrVGg== + dependencies: + "@types/json-schema" "^7.0.8" + ajv "^6.12.5" + ajv-keywords "^3.5.2" + +serialize-javascript@6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-6.0.0.tgz#efae5d88f45d7924141da8b5c3a7a7e663fefeb8" integrity sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag== dependencies: randombytes "^2.1.0" -serialize-javascript@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-4.0.0.tgz#b525e1238489a5ecfc42afacc3fe99e666f4b1aa" - integrity sha512-GaNA54380uFefWghODBWEGisLZFj00nS5ACs6yHa9nLqlLpVLO8ChDGeKRjZnV4Nh4n0Qi7nhYZD/9fCPzEqkw== +serialize-javascript@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-6.0.1.tgz#b206efb27c3da0b0ab6b52f48d170b7996458e5c" + integrity sha512-owoXEFjWRllis8/M1Q+Cw5k8ZH40e3zhp/ovX+Xr/vi1qj6QesbyXXViFbpNvWvPNAD62SutwEXavefrLJWj7w== dependencies: randombytes "^2.1.0" @@ -1983,23 +1742,15 @@ source-map-js@^1.0.2: resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.0.2.tgz#adbc361d9c62df380125e7f161f71c826f1e490c" integrity sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw== -source-map-loader@4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/source-map-loader/-/source-map-loader-4.0.0.tgz#bdc6b118bc6c87ee4d8d851f2d4efcc5abdb2ef5" - integrity sha512-i3KVgM3+QPAHNbGavK+VBq03YoJl24m9JWNbLgsjTj8aJzXG9M61bantBTNBt7CNwY2FYf+RJRYJ3pzalKjIrw== +source-map-loader@4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/source-map-loader/-/source-map-loader-4.0.1.tgz#72f00d05f5d1f90f80974eda781cbd7107c125f2" + integrity sha512-oqXpzDIByKONVY8g1NUPOTQhe0UTU5bWUl32GSkqK2LjJj0HmwTMVKxcUip0RgAYhY1mqgOxjbQM48a0mmeNfA== dependencies: abab "^2.0.6" iconv-lite "^0.6.3" source-map-js "^1.0.2" -source-map-resolve@^0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.6.0.tgz#3d9df87e236b53f16d01e58150fc7711138e5ed2" - integrity sha512-KXBr9d/fO/bWo97NXsPIAW1bFSBOuCnjbNTBMO7N59hsv5i9yzRDfcYwwt0l04+VqnKC+EwzvJZIP/qkuMgR/w== - dependencies: - atob "^2.1.2" - decode-uri-component "^0.2.0" - source-map-support@0.5.21, source-map-support@~0.5.20: version "0.5.21" resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.21.tgz#04fe7c7f9e1ed2d662233c28cb2b35b9f63f6e4f" @@ -2013,16 +1764,6 @@ source-map@^0.6.0, source-map@^0.6.1: resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== -source-map@~0.7.2: - version "0.7.3" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.7.3.tgz#5302f8169031735226544092e64981f751750383" - integrity sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ== - -sourcemap-codec@^1.4.8: - version "1.4.8" - resolved "https://registry.yarnpkg.com/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz#ea804bd94857402e6992d05a38ef1ae35a9ab4c4" - integrity sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA== - "statuses@>= 1.5.0 < 2", statuses@~1.5.0: version "1.5.0" resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c" @@ -2072,14 +1813,7 @@ supports-color@8.1.1, supports-color@^8.0.0: dependencies: has-flag "^4.0.0" -supports-color@^5.3.0: - version "5.5.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" - integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== - dependencies: - has-flag "^3.0.0" - -supports-color@^7.0.0, supports-color@^7.1.0: +supports-color@^7.1.0: version "7.2.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== @@ -2117,36 +1851,27 @@ tar-stream@^2.1.4: inherits "^2.0.3" readable-stream "^3.1.1" -terser-webpack-plugin@^5.1.3: - version "5.3.1" - resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-5.3.1.tgz#0320dcc270ad5372c1e8993fabbd927929773e54" - integrity sha512-GvlZdT6wPQKbDNW/GDQzZFg/j4vKU96yl2q6mcUkzKOgW4gwf1Z8cZToUCrz31XHlPWH8MVb1r2tFtdDtTGJ7g== +terser-webpack-plugin@^5.3.7: + version "5.3.9" + resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-5.3.9.tgz#832536999c51b46d468067f9e37662a3b96adfe1" + integrity sha512-ZuXsqE07EcggTWQjXUj+Aot/OMcD0bMKGgF63f7UxYcu5/AJF53aIpK1YoP5xR9l6s/Hy2b+t1AM0bLNPRuhwA== dependencies: + "@jridgewell/trace-mapping" "^0.3.17" jest-worker "^27.4.5" schema-utils "^3.1.1" - serialize-javascript "^6.0.0" - source-map "^0.6.1" - terser "^5.7.2" + serialize-javascript "^6.0.1" + terser "^5.16.8" -terser@^5.0.0: - version "5.18.1" - resolved "https://registry.yarnpkg.com/terser/-/terser-5.18.1.tgz#6d8642508ae9fb7b48768e48f16d675c89a78460" - integrity sha512-j1n0Ao919h/Ai5r43VAnfV/7azUYW43GPxK7qSATzrsERfW7+y2QW9Cp9ufnRF5CQUWbnLSo7UJokSWCqg4tsQ== +terser@^5.16.8: + version "5.20.0" + resolved "https://registry.yarnpkg.com/terser/-/terser-5.20.0.tgz#ea42aea62578703e33def47d5c5b93c49772423e" + integrity sha512-e56ETryaQDyebBwJIWYB2TT6f2EZ0fL0sW/JRXNMN26zZdKi2u/E/5my5lG6jNxym6qsrVXfFRmOdV42zlAgLQ== dependencies: "@jridgewell/source-map" "^0.3.3" acorn "^8.8.2" commander "^2.20.0" source-map-support "~0.5.20" -terser@^5.7.2: - version "5.10.0" - resolved "https://registry.yarnpkg.com/terser/-/terser-5.10.0.tgz#b86390809c0389105eb0a0b62397563096ddafcc" - integrity sha512-AMmF99DMfEDiRJfxfY5jj5wNH/bYO09cniSqhfoyxc8sFoYIgkJy86G04UoZU5VjlpnplVu0K6Tx6E9b5+DlHA== - dependencies: - commander "^2.20.0" - source-map "~0.7.2" - source-map-support "~0.5.20" - through@^2.3.8: version "2.3.8" resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" @@ -2176,11 +1901,6 @@ tr46@~0.0.3: resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" integrity sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o= -tslib@^2.3.1: - version "2.6.0" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.0.tgz#b295854684dbda164e181d259a22cd779dcd7bc3" - integrity sha512-7At1WUettjcSRHXCyYtTselblcHl9PJFFVKiCAy/bY97+BPZXSQ2wbq0P9s8tK2G7dFQfNnlJnPAiArVBVBsfA== - type-is@~1.6.18: version "1.6.18" resolved "https://registry.yarnpkg.com/type-is/-/type-is-1.6.18.tgz#4e552cd05df09467dcbc4ef739de89f2cf37c131" @@ -2189,15 +1909,10 @@ type-is@~1.6.18: media-typer "0.3.0" mime-types "~2.1.24" -typescript@4.7.4: - version "4.7.4" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.7.4.tgz#1a88596d1cf47d59507a1bcdfb5b9dfe4d488235" - integrity sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ== - -typescript@^3.7.2: - version "3.9.10" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.9.10.tgz#70f3910ac7a51ed6bef79da7800690b19bf778b8" - integrity sha512-w6fIxVE/H1PkLKcCPsFqKE7Kv7QUwhU8qQY2MueZXWx5cPZdwFupLgKK3vntcK98BtNHZtAF4LA/yl2a7k8R6Q== +typescript@5.0.4: + version "5.0.4" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.0.4.tgz#b217fd20119bd61a94d4011274e0ab369058da3b" + integrity sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw== ua-parser-js@^0.7.30: version "0.7.32" @@ -2262,22 +1977,23 @@ webidl-conversions@^3.0.0: resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" integrity sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE= -webpack-cli@4.10.0: - version "4.10.0" - resolved "https://registry.yarnpkg.com/webpack-cli/-/webpack-cli-4.10.0.tgz#37c1d69c8d85214c5a65e589378f53aec64dab31" - integrity sha512-NLhDfH/h4O6UOy+0LSso42xvYypClINuMNBVVzX4vX98TmTaTUxwRbXdhucbFMd2qLaCTcLq/PdYrvi8onw90w== +webpack-cli@5.1.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/webpack-cli/-/webpack-cli-5.1.0.tgz#abc4b1f44b50250f2632d8b8b536cfe2f6257891" + integrity sha512-a7KRJnCxejFoDpYTOwzm5o21ZXMaNqtRlvS183XzGDUPRdVEzJNImcQokqYZ8BNTnk9DkKiuWxw75+DCCoZ26w== dependencies: "@discoveryjs/json-ext" "^0.5.0" - "@webpack-cli/configtest" "^1.2.0" - "@webpack-cli/info" "^1.5.0" - "@webpack-cli/serve" "^1.7.0" + "@webpack-cli/configtest" "^2.1.0" + "@webpack-cli/info" "^2.0.1" + "@webpack-cli/serve" "^2.0.3" colorette "^2.0.14" - commander "^7.0.0" + commander "^10.0.1" cross-spawn "^7.0.3" + envinfo "^7.7.3" fastest-levenshtein "^1.0.12" import-local "^3.0.2" - interpret "^2.2.0" - rechoir "^0.7.0" + interpret "^3.1.1" + rechoir "^0.8.0" webpack-merge "^5.7.3" webpack-merge@^4.1.5: @@ -2300,22 +2016,22 @@ webpack-sources@^3.2.3: resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-3.2.3.tgz#2d4daab8451fd4b240cc27055ff6a0c2ccea0cde" integrity sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w== -webpack@5.74.0: - version "5.74.0" - resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.74.0.tgz#02a5dac19a17e0bb47093f2be67c695102a55980" - integrity sha512-A2InDwnhhGN4LYctJj6M1JEaGL7Luj6LOmyBHjcI8529cm5p6VXiTIW2sn6ffvEAKmveLzvu4jrihwXtPojlAA== +webpack@5.82.0: + version "5.82.0" + resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.82.0.tgz#3c0d074dec79401db026b4ba0fb23d6333f88e7d" + integrity sha512-iGNA2fHhnDcV1bONdUu554eZx+XeldsaeQ8T67H6KKHl2nUSwX8Zm7cmzOA46ox/X1ARxf7Bjv8wQ/HsB5fxBg== dependencies: "@types/eslint-scope" "^3.7.3" - "@types/estree" "^0.0.51" - "@webassemblyjs/ast" "1.11.1" - "@webassemblyjs/wasm-edit" "1.11.1" - "@webassemblyjs/wasm-parser" "1.11.1" + "@types/estree" "^1.0.0" + "@webassemblyjs/ast" "^1.11.5" + "@webassemblyjs/wasm-edit" "^1.11.5" + "@webassemblyjs/wasm-parser" "^1.11.5" acorn "^8.7.1" acorn-import-assertions "^1.7.6" browserslist "^4.14.5" chrome-trace-event "^1.0.2" - enhanced-resolve "^5.10.0" - es-module-lexer "^0.9.0" + enhanced-resolve "^5.13.0" + es-module-lexer "^1.2.1" eslint-scope "5.1.1" events "^3.2.0" glob-to-regexp "^0.4.1" @@ -2324,9 +2040,9 @@ webpack@5.74.0: loader-runner "^4.2.0" mime-types "^2.1.27" neo-async "^2.6.2" - schema-utils "^3.1.0" + schema-utils "^3.1.2" tapable "^2.1.1" - terser-webpack-plugin "^5.1.3" + terser-webpack-plugin "^5.3.7" watchpack "^2.4.0" webpack-sources "^3.2.3" diff --git a/ktor-client/ktor-client-core/api/ktor-client-core.api b/ktor-client/ktor-client-core/api/ktor-client-core.api index eb7300814ad..83573b3c89e 100644 --- a/ktor-client/ktor-client-core/api/ktor-client-core.api +++ b/ktor-client/ktor-client-core/api/ktor-client-core.api @@ -212,6 +212,7 @@ public final class io/ktor/client/engine/ProxyType : java/lang/Enum { public static final field HTTP Lio/ktor/client/engine/ProxyType; public static final field SOCKS Lio/ktor/client/engine/ProxyType; public static final field UNKNOWN Lio/ktor/client/engine/ProxyType; + public static fun getEntries ()Lkotlin/enums/EnumEntries; public static fun valueOf (Ljava/lang/String;)Lio/ktor/client/engine/ProxyType; public static fun values ()[Lio/ktor/client/engine/ProxyType; } diff --git a/ktor-client/ktor-client-curl/desktop/src/io/ktor/client/engine/curl/Curl.kt b/ktor-client/ktor-client-curl/desktop/src/io/ktor/client/engine/curl/Curl.kt index 68322f5395a..da096cb9719 100644 --- a/ktor-client/ktor-client-curl/desktop/src/io/ktor/client/engine/curl/Curl.kt +++ b/ktor-client/ktor-client-curl/desktop/src/io/ktor/client/engine/curl/Curl.kt @@ -19,6 +19,7 @@ import libcurl.* @EagerInitialization private val curlGlobalInitReturnCode = curlInitBridge() +@OptIn(ExperimentalForeignApi::class) internal fun curlInitBridge(): Int = curl_global_init(CURL_GLOBAL_ALL.convert()).convert() @OptIn(ExperimentalStdlibApi::class) diff --git a/ktor-client/ktor-client-curl/desktop/src/io/ktor/client/engine/curl/CurlProcessor.kt b/ktor-client/ktor-client-curl/desktop/src/io/ktor/client/engine/curl/CurlProcessor.kt index fa3b0c8dea8..adf41f6e1aa 100644 --- a/ktor-client/ktor-client-curl/desktop/src/io/ktor/client/engine/curl/CurlProcessor.kt +++ b/ktor-client/ktor-client-curl/desktop/src/io/ktor/client/engine/curl/CurlProcessor.kt @@ -7,6 +7,7 @@ package io.ktor.client.engine.curl import io.ktor.client.engine.curl.internal.* import io.ktor.util.* import kotlinx.atomicfu.* +import kotlinx.cinterop.* import kotlinx.coroutines.* import kotlinx.coroutines.channels.* import kotlin.coroutines.* @@ -57,6 +58,7 @@ internal class CurlProcessor(coroutineContext: CoroutineContext) { } } + @OptIn(ExperimentalForeignApi::class) private suspend fun drainRequestQueue(api: CurlMultiApiHandler) { while (true) { val container = if (api.hasHandlers()) { @@ -91,6 +93,7 @@ internal class CurlProcessor(coroutineContext: CoroutineContext) { } } + @OptIn(ExperimentalForeignApi::class) private fun cancelRequest(easyHandle: EasyHandle, cause: Throwable) { curlScope.launch { curlApi!!.cancelRequest(easyHandle, cause) diff --git a/ktor-client/ktor-client-curl/desktop/src/io/ktor/client/engine/curl/internal/CurlAdapters.kt b/ktor-client/ktor-client-curl/desktop/src/io/ktor/client/engine/curl/internal/CurlAdapters.kt index 7a16556e457..ef270ec4693 100644 --- a/ktor-client/ktor-client-curl/desktop/src/io/ktor/client/engine/curl/internal/CurlAdapters.kt +++ b/ktor-client/ktor-client-curl/desktop/src/io/ktor/client/engine/curl/internal/CurlAdapters.kt @@ -14,10 +14,13 @@ import libcurl.* // These should have been CPointer and CPointer, I suppose, // but somehow cinterop tool makes them just opaque pointers. +@OptIn(ExperimentalForeignApi::class) internal typealias EasyHandle = COpaquePointer +@OptIn(ExperimentalForeignApi::class) internal typealias MultiHandle = COpaquePointer +@OptIn(ExperimentalForeignApi::class) internal fun CURLMcode.verify() { if (this != CURLM_OK) { @Suppress("DEPRECATION") @@ -25,6 +28,7 @@ internal fun CURLMcode.verify() { } } +@OptIn(ExperimentalForeignApi::class) internal fun CURLcode.verify() { if (this != CURLE_OK) { @Suppress("DEPRECATION") @@ -32,31 +36,37 @@ internal fun CURLcode.verify() { } } +@OptIn(ExperimentalForeignApi::class) internal fun EasyHandle.option(option: CURLoption, optionValue: Int) { curl_easy_setopt(this, option, optionValue).verify() } +@OptIn(ExperimentalForeignApi::class) internal fun EasyHandle.option(option: CURLoption, optionValue: Long) { curl_easy_setopt(this, option, optionValue).verify() } +@OptIn(ExperimentalForeignApi::class) internal fun EasyHandle.option(option: CURLoption, optionValue: CPointer<*>) { curl_easy_setopt(this, option, optionValue).verify() } +@OptIn(ExperimentalForeignApi::class) internal fun EasyHandle.option(option: CURLoption, optionValue: CValuesRef<*>) { curl_easy_setopt(this, option, optionValue).verify() } +@OptIn(ExperimentalForeignApi::class) internal fun EasyHandle.option(option: CURLoption, optionValue: String) { curl_easy_setopt(this, option, optionValue).verify() } +@OptIn(ExperimentalForeignApi::class) internal fun EasyHandle.getInfo(info: CURLINFO, optionValue: CPointer<*>) { curl_easy_getinfo(this, info, optionValue).verify() } -@OptIn(InternalAPI::class) +@OptIn(InternalAPI::class, ExperimentalForeignApi::class) internal fun HttpRequestData.headersToCurl(): CPointer { var result: CPointer? = null diff --git a/ktor-client/ktor-client-curl/desktop/src/io/ktor/client/engine/curl/internal/CurlCallbacks.kt b/ktor-client/ktor-client-curl/desktop/src/io/ktor/client/engine/curl/internal/CurlCallbacks.kt index c8e5c5f5ac0..68816039369 100644 --- a/ktor-client/ktor-client-curl/desktop/src/io/ktor/client/engine/curl/internal/CurlCallbacks.kt +++ b/ktor-client/ktor-client-curl/desktop/src/io/ktor/client/engine/curl/internal/CurlCallbacks.kt @@ -13,6 +13,7 @@ import libcurl.* import platform.posix.* import kotlin.coroutines.* +@OptIn(ExperimentalForeignApi::class) internal fun onHeadersReceived( buffer: CPointer, size: size_t, @@ -25,6 +26,8 @@ internal fun onHeadersReceived( return chunkSize } +@Suppress("DEPRECATION") +@OptIn(ExperimentalForeignApi::class) internal fun onBodyChunkReceived( buffer: CPointer, size: size_t, @@ -70,6 +73,8 @@ internal fun onBodyChunkReceived( return CURL_WRITEFUNC_PAUSE } +@Suppress("DEPRECATION") +@OptIn(ExperimentalForeignApi::class) internal fun onBodyChunkRequested( buffer: CPointer, size: size_t, diff --git a/ktor-client/ktor-client-curl/desktop/src/io/ktor/client/engine/curl/internal/CurlMultiApiHandler.kt b/ktor-client/ktor-client-curl/desktop/src/io/ktor/client/engine/curl/internal/CurlMultiApiHandler.kt index 7172fbdcaeb..95a34bbf084 100644 --- a/ktor-client/ktor-client-curl/desktop/src/io/ktor/client/engine/curl/internal/CurlMultiApiHandler.kt +++ b/ktor-client/ktor-client-curl/desktop/src/io/ktor/client/engine/curl/internal/CurlMultiApiHandler.kt @@ -12,11 +12,12 @@ import kotlinx.cinterop.* import kotlinx.coroutines.* import libcurl.* -private class RequestHolder( +private class RequestHolder @OptIn(ExperimentalForeignApi::class) constructor( val responseCompletable: CompletableDeferred, val requestWrapper: StableRef, val responseWrapper: StableRef, ) { + @OptIn(ExperimentalForeignApi::class) fun dispose() { requestWrapper.dispose() responseWrapper.dispose() @@ -24,17 +25,23 @@ private class RequestHolder( } internal class CurlMultiApiHandler : Closeable { + @OptIn(ExperimentalForeignApi::class) private val activeHandles = mutableMapOf() + @OptIn(ExperimentalForeignApi::class) private val cancelledHandles = mutableSetOf>() + @OptIn(ExperimentalForeignApi::class) @Suppress("DEPRECATION") private val multiHandle: MultiHandle = curl_multi_init() ?: throw CurlRuntimeException("Could not initialize curl multi handle") private val easyHandlesToUnpauseLock = SynchronizedObject() + + @OptIn(ExperimentalForeignApi::class) private val easyHandlesToUnpause = mutableListOf() + @OptIn(ExperimentalForeignApi::class) override fun close() { for ((handle, holder) in activeHandles) { curl_multi_remove_handle(multiHandle, handle).verify() @@ -46,6 +53,7 @@ internal class CurlMultiApiHandler : Closeable { curl_multi_cleanup(multiHandle).verify() } + @OptIn(ExperimentalForeignApi::class) fun scheduleRequest(request: CurlRequestData, deferred: CompletableDeferred): EasyHandle { val easyHandle = curl_easy_init() ?: throw @@ -121,11 +129,13 @@ internal class CurlMultiApiHandler : Closeable { return easyHandle } + @OptIn(ExperimentalForeignApi::class) internal fun cancelRequest(easyHandle: EasyHandle, cause: Throwable) { cancelledHandles += Pair(easyHandle, cause) curl_multi_remove_handle(multiHandle, easyHandle).verify() } + @OptIn(ExperimentalForeignApi::class) internal fun perform() { if (activeHandles.isEmpty()) return @@ -150,8 +160,10 @@ internal class CurlMultiApiHandler : Closeable { } } + @OptIn(ExperimentalForeignApi::class) internal fun hasHandlers(): Boolean = activeHandles.isNotEmpty() + @OptIn(ExperimentalForeignApi::class) private fun setupMethod( easyHandle: EasyHandle, method: String, @@ -175,6 +187,7 @@ internal class CurlMultiApiHandler : Closeable { } } + @OptIn(ExperimentalForeignApi::class) private fun setupUploadContent(easyHandle: EasyHandle, request: CurlRequestData): COpaquePointer { val requestPointer = CurlRequestBodyData( body = request.content, @@ -195,6 +208,7 @@ internal class CurlMultiApiHandler : Closeable { return requestPointer } + @OptIn(ExperimentalForeignApi::class) private fun handleCompleted() { for (cancellation in cancelledHandles) { val cancelled = processCancelledEasyHandle(cancellation.first, cancellation.second) @@ -232,6 +246,7 @@ internal class CurlMultiApiHandler : Closeable { } } + @OptIn(ExperimentalForeignApi::class) private fun processCancelledEasyHandle(easyHandle: EasyHandle, cause: Throwable): CurlFail = memScoped { try { val responseDataRef = alloc() @@ -249,6 +264,7 @@ internal class CurlMultiApiHandler : Closeable { } } + @OptIn(ExperimentalForeignApi::class) private fun processCompletedEasyHandle( message: CURLMSG?, easyHandle: EasyHandle, @@ -277,6 +293,7 @@ internal class CurlMultiApiHandler : Closeable { } } + @OptIn(ExperimentalForeignApi::class) private fun collectFailedResponse( message: CURLMSG?, request: CurlRequestData, @@ -317,6 +334,7 @@ internal class CurlMultiApiHandler : Closeable { ) } + @OptIn(ExperimentalForeignApi::class) private fun collectSuccessResponse(easyHandle: EasyHandle): CurlSuccess? = memScoped { val responseDataRef = alloc() val httpProtocolVersion = alloc() @@ -345,6 +363,7 @@ internal class CurlMultiApiHandler : Closeable { } } + @OptIn(ExperimentalForeignApi::class) fun wakeup() { curl_multi_wakeup(multiHandle) } diff --git a/ktor-client/ktor-client-curl/desktop/src/io/ktor/client/engine/curl/internal/CurlRaw.kt b/ktor-client/ktor-client-curl/desktop/src/io/ktor/client/engine/curl/internal/CurlRaw.kt index e6f8be72c75..376c48477a5 100644 --- a/ktor-client/ktor-client-curl/desktop/src/io/ktor/client/engine/curl/internal/CurlRaw.kt +++ b/ktor-client/ktor-client-curl/desktop/src/io/ktor/client/engine/curl/internal/CurlRaw.kt @@ -18,6 +18,7 @@ import kotlinx.coroutines.* import libcurl.* import kotlin.coroutines.* +@OptIn(ExperimentalForeignApi::class) internal suspend fun HttpRequestData.toCurlRequest(config: CurlClientEngineConfig): CurlRequestData = CurlRequestData( url = url.toString(), method = method.value, @@ -33,7 +34,7 @@ internal suspend fun HttpRequestData.toCurlRequest(config: CurlClientEngineConfi caPath = config.caPath ) -internal class CurlRequestData( +internal class CurlRequestData @OptIn(ExperimentalForeignApi::class) constructor( val url: String, val method: String, val headers: CPointer, @@ -53,7 +54,10 @@ internal class CurlRequestData( internal class CurlResponseBuilder(val request: CurlRequestData) { val headersBytes = BytePacketBuilder() - val bodyChannel = ByteChannel(true).apply { attachJob(request.executionContext) } + val bodyChannel = ByteChannel(true).apply { + @Suppress("DEPRECATION") + attachJob(request.executionContext) + } } internal sealed class CurlResponseData diff --git a/ktor-client/ktor-client-curl/desktop/src/io/ktor/client/engine/curl/internal/NativeUtils.kt b/ktor-client/ktor-client-curl/desktop/src/io/ktor/client/engine/curl/internal/NativeUtils.kt index 3f406d034f0..d6d7d0d678b 100644 --- a/ktor-client/ktor-client-curl/desktop/src/io/ktor/client/engine/curl/internal/NativeUtils.kt +++ b/ktor-client/ktor-client-curl/desktop/src/io/ktor/client/engine/curl/internal/NativeUtils.kt @@ -7,12 +7,15 @@ package io.ktor.client.engine.curl.internal import kotlinx.cinterop.* import platform.posix.* +@OptIn(ExperimentalForeignApi::class) internal fun ByteArray.copyToBuffer(buffer: CPointer, size: ULong, position: Int = 0) { usePinned { pinned -> memcpy(buffer, pinned.addressOf(position), size.convert()) } } +@OptIn(ExperimentalForeignApi::class) internal inline fun T.asStablePointer(): COpaquePointer = StableRef.create(this).asCPointer() +@OptIn(ExperimentalForeignApi::class) internal inline fun COpaquePointer.fromCPointer(): T = asStableRef().get() diff --git a/ktor-client/ktor-client-darwin-legacy/darwin/src/io/ktor/client/engine/darwin/certificates/LegacyCertificatePinner.kt b/ktor-client/ktor-client-darwin-legacy/darwin/src/io/ktor/client/engine/darwin/certificates/LegacyCertificatePinner.kt index 614ad768bee..0426700f927 100644 --- a/ktor-client/ktor-client-darwin-legacy/darwin/src/io/ktor/client/engine/darwin/certificates/LegacyCertificatePinner.kt +++ b/ktor-client/ktor-client-darwin-legacy/darwin/src/io/ktor/client/engine/darwin/certificates/LegacyCertificatePinner.kt @@ -113,6 +113,7 @@ public data class LegacyCertificatePinner internal constructor( private val validateTrust: Boolean ) : ChallengeHandler { + @OptIn(ExperimentalForeignApi::class) override fun invoke( session: NSURLSession, task: NSURLSessionTask, @@ -181,6 +182,7 @@ public data class LegacyCertificatePinner internal constructor( /** * Confirms that at least one of the certificates is pinned */ + @OptIn(ExperimentalForeignApi::class) private fun hasOnePinnedCertificate( certificates: List ): Boolean = certificates.any { certificate -> @@ -216,6 +218,7 @@ public data class LegacyCertificatePinner internal constructor( /** * Build an error string to display */ + @OptIn(ExperimentalForeignApi::class) private fun buildErrorMessage( certificates: List, hostname: String @@ -258,6 +261,7 @@ public data class LegacyCertificatePinner internal constructor( /** * Evaluates trust for the specified certificate and policies. */ + @OptIn(ExperimentalForeignApi::class) private fun SecTrustRef.trustIsValid(): Boolean { var isValid = false @@ -288,6 +292,7 @@ public data class LegacyCertificatePinner internal constructor( /** * Gets the public key from the SecCertificate */ + @OptIn(ExperimentalForeignApi::class) private fun SecCertificateRef.getPublicKeyBytes(): ByteArray? { val publicKeyRef = SecCertificateCopyKey(this) ?: return null @@ -321,6 +326,7 @@ public data class LegacyCertificatePinner internal constructor( /** * Checks that we support the key type and size */ + @OptIn(ExperimentalForeignApi::class) private fun checkValidKeyType(publicKeyType: NSString, publicKeySize: NSNumber): Boolean { val keyTypeRSA = CFBridgingRelease(kSecAttrKeyTypeRSA) as NSString val keyTypeECSECPrimeRandom = CFBridgingRelease(kSecAttrKeyTypeECSECPrimeRandom) as NSString @@ -339,6 +345,7 @@ public data class LegacyCertificatePinner internal constructor( * Get the [IntArray] of Asn1 headers needed to prepend to the public key to create the * encoding [ASN1Header](https://docs.oracle.com/middleware/11119/opss/SCRPJ/oracle/security/crypto/asn1/ASN1Header.html) */ + @OptIn(ExperimentalForeignApi::class) private fun getAsn1HeaderBytes(publicKeyType: NSString, publicKeySize: NSNumber): IntArray { val keyTypeRSA = CFBridgingRelease(kSecAttrKeyTypeRSA) as NSString val keyTypeECSECPrimeRandom = CFBridgingRelease(kSecAttrKeyTypeECSECPrimeRandom) as NSString @@ -356,7 +363,7 @@ public data class LegacyCertificatePinner internal constructor( /** * Converts a [ByteArray] into sha256 base 64 encoded string */ - @OptIn(ExperimentalUnsignedTypes::class) + @OptIn(ExperimentalUnsignedTypes::class, ExperimentalForeignApi::class) private fun ByteArray.toSha256String(): String { val digest = UByteArray(CC_SHA256_DIGEST_LENGTH) @@ -372,7 +379,7 @@ public data class LegacyCertificatePinner internal constructor( /** * Converts a [ByteArray] into sha1 base 64 encoded string */ - @OptIn(ExperimentalUnsignedTypes::class) + @OptIn(ExperimentalUnsignedTypes::class, ExperimentalForeignApi::class) private fun ByteArray.toSha1String(): String { val digest = UByteArray(CC_SHA1_DIGEST_LENGTH) diff --git a/ktor-client/ktor-client-darwin-legacy/darwin/src/io/ktor/client/engine/darwin/internal/legacy/DarwinLegacyTaskHandler.kt b/ktor-client/ktor-client-darwin-legacy/darwin/src/io/ktor/client/engine/darwin/internal/legacy/DarwinLegacyTaskHandler.kt index 5a384132a41..9ab4d9deb0d 100644 --- a/ktor-client/ktor-client-darwin-legacy/darwin/src/io/ktor/client/engine/darwin/internal/legacy/DarwinLegacyTaskHandler.kt +++ b/ktor-client/ktor-client-darwin-legacy/darwin/src/io/ktor/client/engine/darwin/internal/legacy/DarwinLegacyTaskHandler.kt @@ -4,7 +4,6 @@ package io.ktor.client.engine.darwin.internal.legacy -import io.ktor.client.engine.darwin.* import io.ktor.client.request.* import io.ktor.http.* import io.ktor.util.date.* @@ -68,7 +67,7 @@ internal class DarwinLegacyTaskHandler( bodyChunks.close() } - @OptIn(UnsafeNumber::class) + @OptIn(UnsafeNumber::class, ExperimentalForeignApi::class) fun NSHTTPURLResponse.toResponseData(): HttpResponseData = HttpResponseData( HttpStatusCode.fromValue(statusCode.convert()), requestTime, diff --git a/ktor-client/ktor-client-darwin-legacy/darwin/src/io/ktor/client/engine/darwin/internal/legacy/DarwinLegacyUtils.kt b/ktor-client/ktor-client-darwin-legacy/darwin/src/io/ktor/client/engine/darwin/internal/legacy/DarwinLegacyUtils.kt index 734ea6f3417..fe7fe2e1c13 100644 --- a/ktor-client/ktor-client-darwin-legacy/darwin/src/io/ktor/client/engine/darwin/internal/legacy/DarwinLegacyUtils.kt +++ b/ktor-client/ktor-client-darwin-legacy/darwin/src/io/ktor/client/engine/darwin/internal/legacy/DarwinLegacyUtils.kt @@ -8,7 +8,6 @@ import io.ktor.client.call.* import io.ktor.http.content.* import io.ktor.utils.io.* import io.ktor.utils.io.core.* -import io.ktor.utils.io.errors.* import kotlinx.cinterop.* import kotlinx.coroutines.* import platform.Foundation.* @@ -25,7 +24,7 @@ internal suspend fun OutgoingContent.toNSData(): NSData? = when (this) { else -> throw UnsupportedContentTypeException(this) } -@OptIn(UnsafeNumber::class) +@OptIn(UnsafeNumber::class, ExperimentalForeignApi::class) internal fun ByteArray.toNSData(): NSData = NSMutableData().apply { if (isEmpty()) return@apply this@toNSData.usePinned { @@ -33,7 +32,7 @@ internal fun ByteArray.toNSData(): NSData = NSMutableData().apply { } } -@OptIn(UnsafeNumber::class) +@OptIn(UnsafeNumber::class, ExperimentalForeignApi::class) internal fun NSData.toByteArray(): ByteArray { val result = ByteArray(length.toInt()) if (result.isEmpty()) return result @@ -49,6 +48,7 @@ internal fun NSData.toByteArray(): ByteArray { * Executes the given block function on this resource and then releases it correctly whether an * exception is thrown or not. */ +@OptIn(ExperimentalForeignApi::class) internal inline fun CPointer.use(block: (CPointer) -> R): R { try { return block(this) diff --git a/ktor-client/ktor-client-darwin/darwin/src/io/ktor/client/engine/darwin/DarwinUtils.kt b/ktor-client/ktor-client-darwin/darwin/src/io/ktor/client/engine/darwin/DarwinUtils.kt index 5d558253328..b0ef88cba68 100644 --- a/ktor-client/ktor-client-darwin/darwin/src/io/ktor/client/engine/darwin/DarwinUtils.kt +++ b/ktor-client/ktor-client-darwin/darwin/src/io/ktor/client/engine/darwin/DarwinUtils.kt @@ -30,7 +30,7 @@ internal suspend fun OutgoingContent.toDataOrStream(): Any? { val outputStreamPtr = nativeHeap.alloc>() val inputStreamPtr = nativeHeap.alloc>() - NSStream.getBoundStreamsWithBufferSize(4096, inputStreamPtr.ptr, outputStreamPtr.ptr) + NSStream.getBoundStreamsWithBufferSize(4096.convert(), inputStreamPtr.ptr, outputStreamPtr.ptr) val context = callContext() context[Job]!!.invokeOnCompletion { @@ -79,7 +79,7 @@ internal suspend fun OutgoingContent.toDataOrStream(): Any? { return inputStream } -@OptIn(UnsafeNumber::class) +@OptIn(UnsafeNumber::class, ExperimentalForeignApi::class) internal fun ByteArray.toNSData(): NSData = NSMutableData().apply { if (isEmpty()) return@apply this@toNSData.usePinned { @@ -87,7 +87,7 @@ internal fun ByteArray.toNSData(): NSData = NSMutableData().apply { } } -@OptIn(UnsafeNumber::class) +@OptIn(UnsafeNumber::class, ExperimentalForeignApi::class) internal fun NSData.toByteArray(): ByteArray { val result = ByteArray(length.toInt()) if (result.isEmpty()) return result @@ -103,6 +103,7 @@ internal fun NSData.toByteArray(): ByteArray { * Executes the given block function on this resource and then releases it correctly whether an * exception is thrown or not. */ +@OptIn(ExperimentalForeignApi::class) internal inline fun CPointer.use(block: (CPointer) -> R): R { try { return block(this) diff --git a/ktor-client/ktor-client-darwin/darwin/src/io/ktor/client/engine/darwin/certificates/CertificatePinner.kt b/ktor-client/ktor-client-darwin/darwin/src/io/ktor/client/engine/darwin/certificates/CertificatePinner.kt index 3e49a7cc2b2..d7d676b12ae 100644 --- a/ktor-client/ktor-client-darwin/darwin/src/io/ktor/client/engine/darwin/certificates/CertificatePinner.kt +++ b/ktor-client/ktor-client-darwin/darwin/src/io/ktor/client/engine/darwin/certificates/CertificatePinner.kt @@ -112,6 +112,7 @@ public data class CertificatePinner internal constructor( private val validateTrust: Boolean ) : ChallengeHandler { + @OptIn(ExperimentalForeignApi::class) override fun invoke( session: NSURLSession, task: NSURLSessionTask, @@ -180,6 +181,7 @@ public data class CertificatePinner internal constructor( /** * Confirms that at least one of the certificates is pinned */ + @OptIn(ExperimentalForeignApi::class) private fun hasOnePinnedCertificate( certificates: List ): Boolean = certificates.any { certificate -> @@ -215,6 +217,7 @@ public data class CertificatePinner internal constructor( /** * Build an error string to display */ + @OptIn(ExperimentalForeignApi::class) private fun buildErrorMessage( certificates: List, hostname: String @@ -257,6 +260,7 @@ public data class CertificatePinner internal constructor( /** * Evaluates trust for the specified certificate and policies. */ + @OptIn(ExperimentalForeignApi::class) private fun SecTrustRef.trustIsValid(): Boolean { var isValid = false @@ -287,6 +291,7 @@ public data class CertificatePinner internal constructor( /** * Gets the public key from the SecCertificate */ + @OptIn(ExperimentalForeignApi::class) private fun SecCertificateRef.getPublicKeyBytes(): ByteArray? { val publicKeyRef = SecCertificateCopyKey(this) ?: return null @@ -320,6 +325,7 @@ public data class CertificatePinner internal constructor( /** * Checks that we support the key type and size */ + @OptIn(ExperimentalForeignApi::class) private fun checkValidKeyType(publicKeyType: NSString, publicKeySize: NSNumber): Boolean { val keyTypeRSA = CFBridgingRelease(kSecAttrKeyTypeRSA) as NSString val keyTypeECSECPrimeRandom = CFBridgingRelease(kSecAttrKeyTypeECSECPrimeRandom) as NSString @@ -338,6 +344,7 @@ public data class CertificatePinner internal constructor( * Get the [IntArray] of Asn1 headers needed to prepend to the public key to create the * encoding [ASN1Header](https://docs.oracle.com/middleware/11119/opss/SCRPJ/oracle/security/crypto/asn1/ASN1Header.html) */ + @OptIn(ExperimentalForeignApi::class) private fun getAsn1HeaderBytes(publicKeyType: NSString, publicKeySize: NSNumber): IntArray { val keyTypeRSA = CFBridgingRelease(kSecAttrKeyTypeRSA) as NSString val keyTypeECSECPrimeRandom = CFBridgingRelease(kSecAttrKeyTypeECSECPrimeRandom) as NSString @@ -355,7 +362,7 @@ public data class CertificatePinner internal constructor( /** * Converts a [ByteArray] into sha256 base 64 encoded string */ - @OptIn(ExperimentalUnsignedTypes::class) + @OptIn(ExperimentalUnsignedTypes::class, ExperimentalForeignApi::class) private fun ByteArray.toSha256String(): String { val digest = UByteArray(CC_SHA256_DIGEST_LENGTH) @@ -371,7 +378,7 @@ public data class CertificatePinner internal constructor( /** * Converts a [ByteArray] into sha1 base 64 encoded string */ - @OptIn(ExperimentalUnsignedTypes::class) + @OptIn(ExperimentalUnsignedTypes::class, ExperimentalForeignApi::class) private fun ByteArray.toSha1String(): String { val digest = UByteArray(CC_SHA1_DIGEST_LENGTH) diff --git a/ktor-client/ktor-client-darwin/darwin/src/io/ktor/client/engine/darwin/internal/DarwinTaskHandler.kt b/ktor-client/ktor-client-darwin/darwin/src/io/ktor/client/engine/darwin/internal/DarwinTaskHandler.kt index 62828f4caea..88c174ade6a 100644 --- a/ktor-client/ktor-client-darwin/darwin/src/io/ktor/client/engine/darwin/internal/DarwinTaskHandler.kt +++ b/ktor-client/ktor-client-darwin/darwin/src/io/ktor/client/engine/darwin/internal/DarwinTaskHandler.kt @@ -5,7 +5,6 @@ package io.ktor.client.engine.darwin.internal import io.ktor.client.engine.darwin.* -import io.ktor.client.engine.darwin.handleNSError import io.ktor.client.request.* import io.ktor.http.* import io.ktor.util.date.* @@ -14,7 +13,6 @@ import io.ktor.utils.io.CancellationException import kotlinx.cinterop.* import kotlinx.coroutines.* import kotlinx.coroutines.channels.* -import platform.CoreAudioTypes.* import platform.Foundation.* import kotlin.coroutines.* @@ -70,7 +68,7 @@ internal class DarwinTaskHandler( bodyChunks.close() } - @OptIn(UnsafeNumber::class) + @OptIn(UnsafeNumber::class, ExperimentalForeignApi::class) fun NSHTTPURLResponse.toResponseData(): HttpResponseData = HttpResponseData( HttpStatusCode.fromValue(statusCode.convert()), requestTime, diff --git a/ktor-client/ktor-client-darwin/darwin/src/io/ktor/client/engine/darwin/internal/DarwinWebsocketSession.kt b/ktor-client/ktor-client-darwin/darwin/src/io/ktor/client/engine/darwin/internal/DarwinWebsocketSession.kt index 8a4caf56449..1ed11c83dd3 100644 --- a/ktor-client/ktor-client-darwin/darwin/src/io/ktor/client/engine/darwin/internal/DarwinWebsocketSession.kt +++ b/ktor-client/ktor-client-darwin/darwin/src/io/ktor/client/engine/darwin/internal/DarwinWebsocketSession.kt @@ -17,7 +17,7 @@ import platform.Foundation.* import platform.darwin.* import kotlin.coroutines.* -@OptIn(UnsafeNumber::class, ExperimentalCoroutinesApi::class) +@OptIn(UnsafeNumber::class, ExperimentalCoroutinesApi::class, ExperimentalForeignApi::class) internal class DarwinWebsocketSession( callContext: CoroutineContext, private val task: NSURLSessionWebSocketTask, @@ -35,6 +35,7 @@ internal class DarwinWebsocketSession( get() = true set(_) {} + @OptIn(ExperimentalForeignApi::class) override var maxFrameSize: Long get() = task.maximumMessageSize.convert() set(value) { diff --git a/ktor-client/ktor-client-darwin/darwin/test/DarwinEngineTest.kt b/ktor-client/ktor-client-darwin/darwin/test/DarwinEngineTest.kt index 1af2f45fecd..0be9654d981 100644 --- a/ktor-client/ktor-client-darwin/darwin/test/DarwinEngineTest.kt +++ b/ktor-client/ktor-client-darwin/darwin/test/DarwinEngineTest.kt @@ -201,7 +201,7 @@ class DarwinEngineTest { assertEquals("my header value", response.bodyAsText()) } - @OptIn(UnsafeNumber::class) + @OptIn(UnsafeNumber::class, ExperimentalForeignApi::class) @Test fun testConfigureWebsocketRequest(): Unit = runBlocking { var customChallengeCalled = false @@ -229,7 +229,6 @@ class DarwinEngineTest { session.close() } - @Test fun testWebSocketPingInterval() = testSuspend { val client = HttpClient(Darwin) { diff --git a/ktor-client/ktor-client-java/jvm/test/io/ktor/client/engine/java/JavaEngineTests.kt b/ktor-client/ktor-client-java/jvm/test/io/ktor/client/engine/java/JavaEngineTests.kt index c2f73f1c5b0..470551352ae 100644 --- a/ktor-client/ktor-client-java/jvm/test/io/ktor/client/engine/java/JavaEngineTests.kt +++ b/ktor-client/ktor-client-java/jvm/test/io/ktor/client/engine/java/JavaEngineTests.kt @@ -19,7 +19,6 @@ class JavaEngineTests { @Test fun testProxy() = runBlocking { - val client = HttpClient(Java) { engine { proxy = Proxy(Proxy.Type.HTTP, InetSocketAddress("localhost", 8082)) diff --git a/ktor-client/ktor-client-plugins/ktor-client-logging/api/ktor-client-logging.api b/ktor-client/ktor-client-plugins/ktor-client-logging/api/ktor-client-logging.api index 91de0e26db9..66c48459ea7 100644 --- a/ktor-client/ktor-client-plugins/ktor-client-logging/api/ktor-client-logging.api +++ b/ktor-client/ktor-client-plugins/ktor-client-logging/api/ktor-client-logging.api @@ -5,6 +5,7 @@ public final class io/ktor/client/plugins/logging/LogLevel : java/lang/Enum { public static final field INFO Lio/ktor/client/plugins/logging/LogLevel; public static final field NONE Lio/ktor/client/plugins/logging/LogLevel; public final fun getBody ()Z + public static fun getEntries ()Lkotlin/enums/EnumEntries; public final fun getHeaders ()Z public final fun getInfo ()Z public static fun valueOf (Ljava/lang/String;)Lio/ktor/client/plugins/logging/LogLevel; diff --git a/ktor-client/ktor-client-winhttp/windows/src/io/ktor/client/engine/winhttp/WinHttpClientEngine.kt b/ktor-client/ktor-client-winhttp/windows/src/io/ktor/client/engine/winhttp/WinHttpClientEngine.kt index acd665c929e..fe3840c2a00 100644 --- a/ktor-client/ktor-client-winhttp/windows/src/io/ktor/client/engine/winhttp/WinHttpClientEngine.kt +++ b/ktor-client/ktor-client-winhttp/windows/src/io/ktor/client/engine/winhttp/WinHttpClientEngine.kt @@ -12,6 +12,7 @@ import io.ktor.client.request.* import io.ktor.util.* import io.ktor.util.date.* import kotlinx.coroutines.* +import kotlin.coroutines.* internal class WinHttpClientEngine( override val config: WinHttpClientEngineConfig @@ -29,6 +30,8 @@ internal class WinHttpClientEngine( } } + override fun toString(): String = "WinHttp" + @OptIn(InternalAPI::class) override suspend fun execute(data: HttpRequestData): HttpResponseData { val callContext = callContext() diff --git a/ktor-http/api/ktor-http.api b/ktor-http/api/ktor-http.api index 7d5d2ee2bd6..58ea3afe709 100644 --- a/ktor-http/api/ktor-http.api +++ b/ktor-http/api/ktor-http.api @@ -40,6 +40,7 @@ public final class io/ktor/http/CacheControl$NoStore : io/ktor/http/CacheControl public final class io/ktor/http/CacheControl$Visibility : java/lang/Enum { public static final field Private Lio/ktor/http/CacheControl$Visibility; public static final field Public Lio/ktor/http/CacheControl$Visibility; + public static fun getEntries ()Lkotlin/enums/EnumEntries; public static fun valueOf (Ljava/lang/String;)Lio/ktor/http/CacheControl$Visibility; public static fun values ()[Lio/ktor/http/CacheControl$Visibility; } @@ -294,6 +295,7 @@ public final class io/ktor/http/CookieEncoding : java/lang/Enum { public static final field DQUOTES Lio/ktor/http/CookieEncoding; public static final field RAW Lio/ktor/http/CookieEncoding; public static final field URI_ENCODING Lio/ktor/http/CookieEncoding; + public static fun getEntries ()Lkotlin/enums/EnumEntries; public static fun valueOf (Ljava/lang/String;)Lio/ktor/http/CookieEncoding; public static fun values ()[Lio/ktor/http/CookieEncoding; } @@ -837,6 +839,7 @@ public final class io/ktor/http/QueryKt { public final class io/ktor/http/RangeUnits : java/lang/Enum { public static final field Bytes Lio/ktor/http/RangeUnits; public static final field None Lio/ktor/http/RangeUnits; + public static fun getEntries ()Lkotlin/enums/EnumEntries; public final fun getUnitToken ()Ljava/lang/String; public static fun valueOf (Ljava/lang/String;)Lio/ktor/http/RangeUnits; public static fun values ()[Lio/ktor/http/RangeUnits; @@ -1065,6 +1068,7 @@ public final class io/ktor/http/auth/HeaderValueEncoding : java/lang/Enum { public static final field QUOTED_ALWAYS Lio/ktor/http/auth/HeaderValueEncoding; public static final field QUOTED_WHEN_REQUIRED Lio/ktor/http/auth/HeaderValueEncoding; public static final field URI_ENCODE Lio/ktor/http/auth/HeaderValueEncoding; + public static fun getEntries ()Lkotlin/enums/EnumEntries; public static fun valueOf (Ljava/lang/String;)Lio/ktor/http/auth/HeaderValueEncoding; public static fun values ()[Lio/ktor/http/auth/HeaderValueEncoding; } @@ -1342,6 +1346,7 @@ public final class io/ktor/http/content/VersionCheckResult : java/lang/Enum { public static final field NOT_MODIFIED Lio/ktor/http/content/VersionCheckResult; public static final field OK Lio/ktor/http/content/VersionCheckResult; public static final field PRECONDITION_FAILED Lio/ktor/http/content/VersionCheckResult; + public static fun getEntries ()Lkotlin/enums/EnumEntries; public final fun getStatusCode ()Lio/ktor/http/HttpStatusCode; public static fun valueOf (Ljava/lang/String;)Lio/ktor/http/content/VersionCheckResult; public static fun values ()[Lio/ktor/http/content/VersionCheckResult; diff --git a/ktor-io/api/ktor-io.api b/ktor-io/api/ktor-io.api index 8034e21a864..3f5f23068cc 100644 --- a/ktor-io/api/ktor-io.api +++ b/ktor-io/api/ktor-io.api @@ -864,6 +864,7 @@ public final class io/ktor/utils/io/core/ByteOrder : java/lang/Enum { public static final field BIG_ENDIAN Lio/ktor/utils/io/core/ByteOrder; public static final field Companion Lio/ktor/utils/io/core/ByteOrder$Companion; public static final field LITTLE_ENDIAN Lio/ktor/utils/io/core/ByteOrder; + public static fun getEntries ()Lkotlin/enums/EnumEntries; public final fun getNioOrder ()Ljava/nio/ByteOrder; public static fun valueOf (Ljava/lang/String;)Lio/ktor/utils/io/core/ByteOrder; public static fun values ()[Lio/ktor/utils/io/core/ByteOrder; diff --git a/ktor-io/darwin/src/CharsetDarwin.kt b/ktor-io/darwin/src/CharsetDarwin.kt index 62686a6dadb..1321a46881f 100644 --- a/ktor-io/darwin/src/CharsetDarwin.kt +++ b/ktor-io/darwin/src/CharsetDarwin.kt @@ -140,7 +140,7 @@ internal actual fun CharsetEncoder.encodeToByteArrayImpl1( ?: throw MalformedInputException("Failed to convert String to Bytes using $charset") } -@OptIn(UnsafeNumber::class) +@OptIn(UnsafeNumber::class, ExperimentalForeignApi::class) private fun ByteArray.toNSData(): NSData = NSMutableData().apply { if (isEmpty()) return@apply this@toNSData.usePinned { @@ -148,7 +148,7 @@ private fun ByteArray.toNSData(): NSData = NSMutableData().apply { } } -@OptIn(UnsafeNumber::class) +@OptIn(UnsafeNumber::class, ExperimentalForeignApi::class) private fun NSData.toByteArray(): ByteArray { val result = ByteArray(length.toInt()) if (result.isEmpty()) return result diff --git a/ktor-io/js/src/io/ktor/utils/io/core/ByteReadPacket.kt b/ktor-io/js/src/io/ktor/utils/io/core/ByteReadPacket.kt index 35e9f22f034..060e9159cdf 100644 --- a/ktor-io/js/src/io/ktor/utils/io/core/ByteReadPacket.kt +++ b/ktor-io/js/src/io/ktor/utils/io/core/ByteReadPacket.kt @@ -19,6 +19,7 @@ public actual fun ByteReadPacket( else -> content.buffer.slice(offset, offset + length) } + @Suppress("DEPRECATION") val pool = object : SingleInstancePool() { override fun produceInstance(): ChunkBuffer = ChunkBuffer(Memory.of(sub), null, this) diff --git a/ktor-io/linux/src/CharsetLinux.kt b/ktor-io/linux/src/CharsetLinux.kt index 9e44fa72c93..e2918a90fb7 100644 --- a/ktor-io/linux/src/CharsetLinux.kt +++ b/ktor-io/linux/src/CharsetLinux.kt @@ -23,6 +23,7 @@ internal actual fun findCharset(name: String): Charset { return CharsetIconv(name) } +@OptIn(ExperimentalForeignApi::class) private class CharsetIconv(name: String) : Charset(name) { init { val v = iconv_open(name, "UTF-8") @@ -39,15 +40,17 @@ internal fun iconvCharsetName(name: String) = when (name) { else -> name } +@OptIn(ExperimentalForeignApi::class) private val negativePointer = (-1L).toCPointer() +@OptIn(ExperimentalForeignApi::class) internal fun checkErrors(iconvOpenResults: COpaquePointer?, charset: String) { if (iconvOpenResults == null || iconvOpenResults === negativePointer) { throw IllegalArgumentException("Failed to open iconv for charset $charset with error code ${posix_errno()}") } } -@OptIn(UnsafeNumber::class) +@OptIn(UnsafeNumber::class, ExperimentalForeignApi::class) internal actual fun CharsetEncoder.encodeImpl(input: CharSequence, fromIndex: Int, toIndex: Int, dst: Buffer): Int { val length = toIndex - fromIndex if (length == 0) return 0 @@ -90,7 +93,7 @@ internal actual fun CharsetEncoder.encodeImpl(input: CharSequence, fromIndex: In } } -@OptIn(UnsafeNumber::class) +@OptIn(UnsafeNumber::class, ExperimentalForeignApi::class) public actual fun CharsetDecoder.decode(input: Input, dst: Appendable, max: Int): Int { val charset = iconvCharsetName(charset.name) val cd = iconv_open(platformUtf16, charset) @@ -161,6 +164,7 @@ public actual fun CharsetDecoder.decode(input: Input, dst: Appendable, max: Int) } } +@OptIn(ExperimentalForeignApi::class) internal actual fun CharsetDecoder.decodeBuffer( input: Buffer, out: Appendable, @@ -243,6 +247,7 @@ internal actual fun CharsetEncoder.encodeToByteArrayImpl1( } } +@OptIn(ExperimentalForeignApi::class) public actual fun CharsetDecoder.decodeExactBytes(input: Input, inputLength: Int): String { if (inputLength == 0) return "" @@ -314,6 +319,7 @@ public actual fun CharsetDecoder.decodeExactBytes(input: Input, inputLength: Int } } +@OptIn(ExperimentalForeignApi::class) public actual fun CharsetEncoder.encodeUTF8(input: ByteReadPacket, dst: Output) { val cd = iconv_open(charset.name, "UTF-8") checkErrors(cd, "UTF-8") diff --git a/ktor-io/mingwX64/src/CharsetMingw.kt b/ktor-io/mingwX64/src/CharsetMingw.kt index ec49b00be6b..6a2c07e6917 100644 --- a/ktor-io/mingwX64/src/CharsetMingw.kt +++ b/ktor-io/mingwX64/src/CharsetMingw.kt @@ -15,6 +15,7 @@ public actual object Charsets { internal val UTF_16: Charset = CharsetIconv(platformUtf16) } +@OptIn(ExperimentalForeignApi::class) private class CharsetIconv(name: String) : Charset(name) { init { val v = iconv_open(name, "UTF-8") @@ -39,15 +40,18 @@ internal fun iconvCharsetName(name: String) = when (name) { else -> name } +@OptIn(ExperimentalForeignApi::class) private val negativePointer = (-1L).toCPointer() +@OptIn(ExperimentalForeignApi::class) internal fun checkErrors(iconvOpenResults: COpaquePointer?, charset: String) { if (iconvOpenResults == null || iconvOpenResults === negativePointer) { throw IllegalArgumentException("Failed to open iconv for charset $charset with error code ${posix_errno()}") } } -@OptIn(UnsafeNumber::class) +@Suppress("DEPRECATION") +@OptIn(UnsafeNumber::class, ExperimentalForeignApi::class) internal actual fun CharsetEncoder.encodeImpl(input: CharSequence, fromIndex: Int, toIndex: Int, dst: Buffer): Int { val length = toIndex - fromIndex if (length == 0) return 0 @@ -90,7 +94,8 @@ internal actual fun CharsetEncoder.encodeImpl(input: CharSequence, fromIndex: In } } -@OptIn(UnsafeNumber::class) +@Suppress("DEPRECATION") +@OptIn(UnsafeNumber::class, ExperimentalForeignApi::class) public actual fun CharsetDecoder.decode(input: Input, dst: Appendable, max: Int): Int { val charset = iconvCharsetName(charset.name) val cd = iconv_open(platformUtf16, charset) @@ -161,6 +166,7 @@ public actual fun CharsetDecoder.decode(input: Input, dst: Appendable, max: Int) } } +@OptIn(ExperimentalForeignApi::class) internal actual fun CharsetDecoder.decodeBuffer( input: Buffer, out: Appendable, @@ -243,6 +249,7 @@ internal actual fun CharsetEncoder.encodeToByteArrayImpl1( } } +@OptIn(ExperimentalForeignApi::class) public actual fun CharsetDecoder.decodeExactBytes(input: Input, inputLength: Int): String { if (inputLength == 0) return "" @@ -314,6 +321,7 @@ public actual fun CharsetDecoder.decodeExactBytes(input: Input, inputLength: Int } } +@OptIn(ExperimentalForeignApi::class) public actual fun CharsetEncoder.encodeUTF8(input: ByteReadPacket, dst: Output) { val cd = iconv_open(charset.name, "UTF-8") checkErrors(cd, "UTF-8") diff --git a/ktor-io/posix/src/io/ktor/utils/io/ByteChannelNative.kt b/ktor-io/posix/src/io/ktor/utils/io/ByteChannelNative.kt index 4fca955f427..f4ee3ccbe00 100644 --- a/ktor-io/posix/src/io/ktor/utils/io/ByteChannelNative.kt +++ b/ktor-io/posix/src/io/ktor/utils/io/ByteChannelNative.kt @@ -112,9 +112,11 @@ internal class ByteChannelNative( return result } + @OptIn(ExperimentalForeignApi::class) override suspend fun readAvailable(dst: CPointer, offset: Int, length: Int): Int = readAvailable(dst, offset.toLong(), length.toLong()) + @OptIn(ExperimentalForeignApi::class) override suspend fun readAvailable(dst: CPointer, offset: Long, length: Long): Int { require(offset >= 0L) require(length >= 0L) @@ -136,10 +138,12 @@ internal class ByteChannelNative( return size } + @OptIn(ExperimentalForeignApi::class) override suspend fun readFully(dst: CPointer, offset: Int, length: Int) { readFully(dst, offset.toLong(), length.toLong()) } + @OptIn(ExperimentalForeignApi::class) override suspend fun readFully(dst: CPointer, offset: Long, length: Long) { require(offset >= 0L) require(length >= 0L) @@ -159,6 +163,7 @@ internal class ByteChannelNative( } } + @OptIn(ExperimentalForeignApi::class) private suspend fun readFullySuspend(dst: CPointer, offset: Long, length: Long) { var position = offset var rem = length @@ -177,10 +182,12 @@ internal class ByteChannelNative( } } + @OptIn(ExperimentalForeignApi::class) override suspend fun writeFully(src: CPointer, offset: Int, length: Int) { return writeFully(src, offset.toLong(), length.toLong()) } + @OptIn(ExperimentalForeignApi::class) override suspend fun writeFully(src: CPointer, offset: Long, length: Long) { if (availableForWrite > 0) { val size = tryWriteCPointer(src, offset, length).toLong() @@ -197,6 +204,7 @@ internal class ByteChannelNative( return writeFullySuspend(src, offset, length) } + @OptIn(ExperimentalForeignApi::class) private suspend fun writeFullySuspend(src: CPointer, offset: Long, length: Long) { var remaining = length var position = offset @@ -230,9 +238,11 @@ internal class ByteChannelNative( return size } + @OptIn(ExperimentalForeignApi::class) override suspend fun writeAvailable(src: CPointer, offset: Int, length: Int): Int = writeAvailable(src, offset.toLong(), length.toLong()) + @OptIn(ExperimentalForeignApi::class) override suspend fun writeAvailable(src: CPointer, offset: Long, length: Long): Int { if (availableForWrite > 0) { val size = tryWriteCPointer(src, offset, length) @@ -262,11 +272,13 @@ internal class ByteChannelNative( return "ByteChannel[0x$hashCode, job: $attachedJob, cause: $closedCause]" } + @OptIn(ExperimentalForeignApi::class) private suspend fun writeAvailableSuspend(src: CPointer, offset: Long, length: Long): Int { awaitAtLeastNBytesAvailableForWrite(1) return writeAvailable(src, offset, length) } + @OptIn(ExperimentalForeignApi::class) private fun tryWriteCPointer(src: CPointer, offset: Long, length: Long): Int { val size = minOf(length, availableForWrite.toLong(), Int.MAX_VALUE.toLong()).toInt() val ptr: CPointer = (src + offset)!! @@ -274,6 +286,7 @@ internal class ByteChannelNative( return size } + @OptIn(ExperimentalForeignApi::class) private fun tryReadCPointer(dst: CPointer, offset: Long, length: Long): Int { val size = minOf(length, availableForRead.toLong(), Int.MAX_VALUE.toLong()).toInt() val ptr: CPointer = (dst + offset)!! diff --git a/ktor-io/posix/src/io/ktor/utils/io/ByteReadChannelNative.kt b/ktor-io/posix/src/io/ktor/utils/io/ByteReadChannelNative.kt index a41a93eae26..1a93a55e751 100644 --- a/ktor-io/posix/src/io/ktor/utils/io/ByteReadChannelNative.kt +++ b/ktor-io/posix/src/io/ktor/utils/io/ByteReadChannelNative.kt @@ -75,12 +75,14 @@ public actual interface ByteReadChannel { * Reads all available bytes to [dst] buffer and returns immediately or suspends if no bytes available * @return number of bytes were read or `-1` if the channel has been closed */ + @OptIn(ExperimentalForeignApi::class) public suspend fun readAvailable(dst: CPointer, offset: Int, length: Int): Int /** * Reads all available bytes to [dst] buffer and returns immediately or suspends if no bytes available * @return number of bytes were read or `-1` if the channel has been closed */ + @OptIn(ExperimentalForeignApi::class) public suspend fun readAvailable(dst: CPointer, offset: Long, length: Long): Int /** @@ -99,12 +101,14 @@ public actual interface ByteReadChannel { * Reads all [length] bytes to [dst] buffer or fails if channel has been closed. * Suspends if not enough bytes available. */ + @OptIn(ExperimentalForeignApi::class) public suspend fun readFully(dst: CPointer, offset: Int, length: Int) /** * Reads all [length] bytes to [dst] buffer or fails if channel has been closed. * Suspends if not enough bytes available. */ + @OptIn(ExperimentalForeignApi::class) public suspend fun readFully(dst: CPointer, offset: Long, length: Long) /** diff --git a/ktor-io/posix/src/io/ktor/utils/io/ByteWriteChannelNative.kt b/ktor-io/posix/src/io/ktor/utils/io/ByteWriteChannelNative.kt index f8fccdc46d8..20e4f697308 100644 --- a/ktor-io/posix/src/io/ktor/utils/io/ByteWriteChannelNative.kt +++ b/ktor-io/posix/src/io/ktor/utils/io/ByteWriteChannelNative.kt @@ -56,6 +56,7 @@ public actual interface ByteWriteChannel { * * @return number of consumed bytes or -1 if the block wasn't executed. */ + @Suppress("DEPRECATION") public fun writeAvailable(min: Int, block: (Buffer) -> Unit): Int /** @@ -71,11 +72,13 @@ public actual interface ByteWriteChannel { /** * Writes as much as possible and only suspends if buffer is full */ + @OptIn(ExperimentalForeignApi::class) public suspend fun writeAvailable(src: CPointer, offset: Int, length: Int): Int /** * Writes as much as possible and only suspends if buffer is full */ + @OptIn(ExperimentalForeignApi::class) public suspend fun writeAvailable(src: CPointer, offset: Long, length: Long): Int /** @@ -88,12 +91,14 @@ public actual interface ByteWriteChannel { * Writes all [src] bytes and suspends until all bytes written. Causes flush if buffer filled up or when [autoFlush] * Crashes if channel get closed while writing. */ + @OptIn(ExperimentalForeignApi::class) public suspend fun writeFully(src: CPointer, offset: Int, length: Int) /** * Writes all [src] bytes and suspends until all bytes written. Causes flush if buffer filled up or when [autoFlush] * Crashes if channel get closed while writing. */ + @OptIn(ExperimentalForeignApi::class) public suspend fun writeFully(src: CPointer, offset: Long, length: Long) @Suppress("DEPRECATION") diff --git a/ktor-io/posix/src/io/ktor/utils/io/bits/MemoryFactoryNative.kt b/ktor-io/posix/src/io/ktor/utils/io/bits/MemoryFactoryNative.kt index de05f991f35..608a4301dda 100644 --- a/ktor-io/posix/src/io/ktor/utils/io/bits/MemoryFactoryNative.kt +++ b/ktor-io/posix/src/io/ktor/utils/io/bits/MemoryFactoryNative.kt @@ -12,7 +12,7 @@ import kotlin.contracts.* * By default, if neither [offset] nor [length] specified, the whole array is used. * An instance of [Memory] provided into the [block] should be never captured and used outside of lambda. */ -@OptIn(ExperimentalContracts::class) +@OptIn(ExperimentalContracts::class, ExperimentalForeignApi::class) public actual inline fun ByteArray.useMemory(offset: Int, length: Int, block: (Memory) -> R): R { contract { callsInPlace(block, InvocationKind.EXACTLY_ONCE) @@ -32,7 +32,7 @@ public actual inline fun ByteArray.useMemory(offset: Int, length: Int, block * Create an instance of [Memory] view for memory region starting at * the specified [pointer] and having the specified [size] in bytes. */ -@OptIn(UnsafeNumber::class) +@OptIn(UnsafeNumber::class, ExperimentalForeignApi::class) public inline fun Memory.Companion.of(pointer: CPointer<*>, size: size_t): Memory { require(size.convert() <= Long.MAX_VALUE.convert()) { "At most ${Long.MAX_VALUE} (kotlin.Long.MAX_VALUE) bytes range is supported." @@ -45,6 +45,7 @@ public inline fun Memory.Companion.of(pointer: CPointer<*>, size: size_t): Memor * Create an instance of [Memory] view for memory region starting at * the specified [pointer] and having the specified [size] in bytes. */ +@OptIn(ExperimentalForeignApi::class) public inline fun Memory.Companion.of(pointer: CPointer<*>, size: Int): Memory { return Memory(pointer.reinterpret(), size.toLong()) } @@ -53,6 +54,7 @@ public inline fun Memory.Companion.of(pointer: CPointer<*>, size: Int): Memory { * Create an instance of [Memory] view for memory region starting at * the specified [pointer] and having the specified [size] in bytes. */ +@OptIn(ExperimentalForeignApi::class) public inline fun Memory.Companion.of(pointer: CPointer<*>, size: Long): Memory { return Memory(pointer.reinterpret(), size) } @@ -65,6 +67,7 @@ public inline fun Memory.Companion.of(pointer: CPointer<*>, size: Long): Memory * once the scope is leaved, all produced instances should be discarded and should be never used after the scope. * On the contrary instances created using [nativeHeap] do require release via [nativeHeap.free]. */ +@OptIn(ExperimentalForeignApi::class) public fun NativePlacement.allocMemory(size: Int): Memory { return allocMemory(size.toLong()) } @@ -77,6 +80,7 @@ public fun NativePlacement.allocMemory(size: Int): Memory { * once the scope is leaved, all produced instances should be discarded and should be never used after the scope. * On the contrary instances created using [nativeHeap] do require release via [nativeHeap.free]. */ +@OptIn(ExperimentalForeignApi::class) public fun NativePlacement.allocMemory(size: Long): Memory { return Memory(allocArray(size), size) } @@ -86,10 +90,12 @@ public fun NativePlacement.allocMemory(size: Long): Memory { * This function should be only used for memory instances that are produced by [allocMemory] function * otherwise an undefined behaviour may occur including crash or data corruption. */ +@OptIn(ExperimentalForeignApi::class) public fun NativeFreeablePlacement.free(memory: Memory) { free(memory.pointer) } +@OptIn(ExperimentalForeignApi::class) internal value class PlacementAllocator(private val placement: NativeFreeablePlacement) : Allocator { override fun alloc(size: Int): Memory = alloc(size.toLong()) @@ -100,5 +106,6 @@ internal value class PlacementAllocator(private val placement: NativeFreeablePla } } +@OptIn(ExperimentalForeignApi::class) @PublishedApi internal actual object DefaultAllocator : Allocator by PlacementAllocator(nativeHeap) diff --git a/ktor-io/posix/src/io/ktor/utils/io/bits/MemoryNative.kt b/ktor-io/posix/src/io/ktor/utils/io/bits/MemoryNative.kt index 3ef71e0938a..e1148496843 100644 --- a/ktor-io/posix/src/io/ktor/utils/io/bits/MemoryNative.kt +++ b/ktor-io/posix/src/io/ktor/utils/io/bits/MemoryNative.kt @@ -5,8 +5,9 @@ package io.ktor.utils.io.bits import io.ktor.utils.io.core.internal.* import kotlinx.cinterop.* import platform.posix.* +import kotlin.experimental.* -public actual class Memory constructor( +public actual class Memory @OptIn(ExperimentalForeignApi::class) constructor( public val pointer: CPointer, public actual inline val size: Long ) { @@ -23,16 +24,19 @@ public actual class Memory constructor( /** * Returns byte at [index] position. */ + @OptIn(ExperimentalForeignApi::class) public actual inline fun loadAt(index: Int): Byte = pointer[assertIndex(index, 1)] /** * Returns byte at [index] position. */ + @OptIn(ExperimentalForeignApi::class) public actual inline fun loadAt(index: Long): Byte = pointer[assertIndex(index, 1)] /** * Write [value] at the specified [index]. */ + @OptIn(ExperimentalForeignApi::class) public actual inline fun storeAt(index: Int, value: Byte) { pointer[assertIndex(index, 1)] = value } @@ -40,10 +44,12 @@ public actual class Memory constructor( /** * Write [value] at the specified [index] */ + @OptIn(ExperimentalForeignApi::class) public actual inline fun storeAt(index: Long, value: Byte) { pointer[assertIndex(index, 1)] = value } + @OptIn(ExperimentalForeignApi::class) public actual fun slice(offset: Long, length: Long): Memory { assertIndex(offset, length) if (offset == 0L && length == size) { @@ -53,6 +59,7 @@ public actual class Memory constructor( return Memory(pointer.plus(offset)!!, length) } + @OptIn(ExperimentalForeignApi::class) public actual fun slice(offset: Int, length: Int): Memory { assertIndex(offset, length) if (offset == 0 && length.toLong() == size) { @@ -67,7 +74,7 @@ public actual class Memory constructor( * to the [destination] at [destinationOffset]. * Copying bytes from a memory to itself is allowed. */ - @OptIn(UnsafeNumber::class) + @OptIn(UnsafeNumber::class, ExperimentalForeignApi::class) public actual fun copyTo(destination: Memory, offset: Int, length: Int, destinationOffset: Int) { require(offset >= 0) { "offset shouldn't be negative: $offset" } require(length >= 0) { "length shouldn't be negative: $length" } @@ -96,7 +103,7 @@ public actual class Memory constructor( * to the [destination] at [destinationOffset]. * Copying bytes from a memory to itself is allowed. */ - @OptIn(UnsafeNumber::class) + @OptIn(UnsafeNumber::class, ExperimentalForeignApi::class) public actual fun copyTo(destination: Memory, offset: Long, length: Long, destinationOffset: Long) { require(offset >= 0L) { "offset shouldn't be negative: $offset" } require(length >= 0L) { "length shouldn't be negative: $length" } @@ -121,6 +128,7 @@ public actual class Memory constructor( } public actual companion object { + @OptIn(ExperimentalForeignApi::class) public actual val Empty: Memory = Memory(nativeHeap.allocArray(0), 0L) } } @@ -129,6 +137,7 @@ public actual class Memory constructor( * Copies bytes from this memory range from the specified [offset] and [length] * to the [destination] at [destinationOffset]. */ +@OptIn(ExperimentalForeignApi::class) public actual fun Memory.copyTo( destination: ByteArray, offset: Int, @@ -154,6 +163,7 @@ public actual fun Memory.copyTo( * Copies bytes from this memory range from the specified [offset] and [length] * to the [destination] at [destinationOffset]. */ +@OptIn(ExperimentalForeignApi::class) public actual fun Memory.copyTo( destination: ByteArray, offset: Long, @@ -183,6 +193,7 @@ internal inline fun Memory.assertIndex(offset: Int, valueSize: Int): Int { return offset } +@OptIn(ExperimentalNativeApi::class) @PublishedApi internal inline fun Memory.assertIndex(offset: Long, valueSize: Long): Long { assert(offset in 0..size - valueSize) { @@ -191,6 +202,7 @@ internal inline fun Memory.assertIndex(offset: Long, valueSize: Long): Long { return offset } +@OptIn(ExperimentalNativeApi::class) @PublishedApi internal inline fun Short.toBigEndian(): Short { return when { @@ -199,24 +211,28 @@ internal inline fun Short.toBigEndian(): Short { } } +@OptIn(ExperimentalNativeApi::class) @PublishedApi internal inline fun Int.toBigEndian(): Int = when { !Platform.isLittleEndian -> this else -> reverseByteOrder() } +@OptIn(ExperimentalNativeApi::class) @PublishedApi internal inline fun Long.toBigEndian(): Long = when { !Platform.isLittleEndian -> this else -> reverseByteOrder() } +@OptIn(ExperimentalNativeApi::class) @PublishedApi internal inline fun Float.toBigEndian(): Float = when { !Platform.isLittleEndian -> this else -> reverseByteOrder() } +@OptIn(ExperimentalNativeApi::class) @PublishedApi internal inline fun Double.toBigEndian(): Double = when { !Platform.isLittleEndian -> this @@ -226,7 +242,7 @@ internal inline fun Double.toBigEndian(): Double = when { /** * Fill memory range starting at the specified [offset] with [value] repeated [count] times. */ -@OptIn(UnsafeNumber::class) +@OptIn(UnsafeNumber::class, ExperimentalForeignApi::class) public actual fun Memory.fill(offset: Long, count: Long, value: Byte) { requirePositiveIndex(offset, "offset") requirePositiveIndex(count, "count") @@ -241,7 +257,7 @@ public actual fun Memory.fill(offset: Long, count: Long, value: Byte) { /** * Fill memory range starting at the specified [offset] with [value] repeated [count] times. */ -@OptIn(UnsafeNumber::class) +@OptIn(UnsafeNumber::class, ExperimentalForeignApi::class) public actual fun Memory.fill(offset: Int, count: Int, value: Byte) { requirePositiveIndex(offset, "offset") requirePositiveIndex(count, "count") @@ -258,6 +274,7 @@ public actual fun Memory.fill(offset: Int, count: Int, value: Byte) { * Copy content bytes to the memory addressed by the [destination] pointer with * the specified [destinationOffset] in bytes. */ +@OptIn(ExperimentalForeignApi::class) public fun Memory.copyTo( destination: CPointer, offset: Int, @@ -271,7 +288,7 @@ public fun Memory.copyTo( * Copy content bytes to the memory addressed by the [destination] pointer with * the specified [destinationOffset] in bytes. */ -@OptIn(UnsafeNumber::class) +@OptIn(UnsafeNumber::class, ExperimentalForeignApi::class) public fun Memory.copyTo( destination: CPointer, offset: Long, @@ -290,6 +307,7 @@ public fun Memory.copyTo( * Copy [length] bytes to the [destination] at the specified [destinationOffset] * from the memory addressed by this pointer with [offset] in bytes. */ +@OptIn(ExperimentalForeignApi::class) public fun CPointer.copyTo(destination: Memory, offset: Int, length: Int, destinationOffset: Int) { copyTo(destination, offset.toLong(), length.toLong(), destinationOffset.toLong()) } @@ -298,7 +316,7 @@ public fun CPointer.copyTo(destination: Memory, offset: Int, length: In * Copy [length] bytes to the [destination] at the specified [destinationOffset] * from the memory addressed by this pointer with [offset] in bytes. */ -@OptIn(UnsafeNumber::class) +@OptIn(UnsafeNumber::class, ExperimentalForeignApi::class) public fun CPointer.copyTo(destination: Memory, offset: Long, length: Long, destinationOffset: Long) { requirePositiveIndex(offset, "offset") requirePositiveIndex(length, "length") diff --git a/ktor-io/posix/src/io/ktor/utils/io/bits/MemoryPrimitivesNative.kt b/ktor-io/posix/src/io/ktor/utils/io/bits/MemoryPrimitivesNative.kt index 157e0d243df..b5b5e120e14 100644 --- a/ktor-io/posix/src/io/ktor/utils/io/bits/MemoryPrimitivesNative.kt +++ b/ktor-io/posix/src/io/ktor/utils/io/bits/MemoryPrimitivesNative.kt @@ -5,6 +5,7 @@ package io.ktor.utils.io.bits import kotlinx.cinterop.* import kotlin.experimental.* +@OptIn(ExperimentalForeignApi::class) public actual inline fun Memory.loadShortAt(offset: Int): Short { assertIndex(offset, 2) val pointer = pointer.plus(offset)!! @@ -16,6 +17,7 @@ public actual inline fun Memory.loadShortAt(offset: Int): Short { } } +@OptIn(ExperimentalForeignApi::class) public actual inline fun Memory.loadShortAt(offset: Long): Short { assertIndex(offset, 2) val pointer = pointer.plus(offset)!! @@ -27,6 +29,7 @@ public actual inline fun Memory.loadShortAt(offset: Long): Short { } } +@OptIn(ExperimentalForeignApi::class) public actual inline fun Memory.loadIntAt(offset: Int): Int { assertIndex(offset, 4) val pointer = pointer.plus(offset)!! @@ -38,6 +41,7 @@ public actual inline fun Memory.loadIntAt(offset: Int): Int { } } +@OptIn(ExperimentalForeignApi::class) public actual inline fun Memory.loadIntAt(offset: Long): Int { assertIndex(offset, 4) val pointer = pointer.plus(offset)!! @@ -49,6 +53,7 @@ public actual inline fun Memory.loadIntAt(offset: Long): Int { } } +@OptIn(ExperimentalForeignApi::class) public actual inline fun Memory.loadLongAt(offset: Int): Long { assertIndex(offset, 8) val pointer = pointer.plus(offset)!! @@ -60,6 +65,7 @@ public actual inline fun Memory.loadLongAt(offset: Int): Long { } } +@OptIn(ExperimentalForeignApi::class) public actual inline fun Memory.loadLongAt(offset: Long): Long { assertIndex(offset, 8) val pointer = pointer.plus(offset)!! @@ -71,6 +77,7 @@ public actual inline fun Memory.loadLongAt(offset: Long): Long { } } +@OptIn(ExperimentalForeignApi::class) public actual inline fun Memory.loadFloatAt(offset: Int): Float { assertIndex(offset, 4) val pointer = pointer.plus(offset)!! @@ -82,6 +89,7 @@ public actual inline fun Memory.loadFloatAt(offset: Int): Float { } } +@OptIn(ExperimentalForeignApi::class) public actual inline fun Memory.loadFloatAt(offset: Long): Float { assertIndex(offset, 4) val pointer = pointer.plus(offset)!! @@ -93,6 +101,7 @@ public actual inline fun Memory.loadFloatAt(offset: Long): Float { } } +@OptIn(ExperimentalForeignApi::class) public actual inline fun Memory.loadDoubleAt(offset: Int): Double { assertIndex(offset, 8) val pointer = pointer.plus(offset)!! @@ -104,6 +113,7 @@ public actual inline fun Memory.loadDoubleAt(offset: Int): Double { } } +@OptIn(ExperimentalForeignApi::class) public actual inline fun Memory.loadDoubleAt(offset: Long): Double { assertIndex(offset, 8) val pointer = pointer.plus(offset)!! @@ -118,6 +128,7 @@ public actual inline fun Memory.loadDoubleAt(offset: Long): Double { /** * Write regular signed 32bit integer in the network byte order (Big Endian) */ +@OptIn(ExperimentalForeignApi::class) public actual inline fun Memory.storeIntAt(offset: Int, value: Int) { assertIndex(offset, 4) val pointer = pointer.plus(offset)!! @@ -132,6 +143,7 @@ public actual inline fun Memory.storeIntAt(offset: Int, value: Int) { /** * Write regular signed 32bit integer in the network byte order (Big Endian) */ +@OptIn(ExperimentalForeignApi::class) public actual inline fun Memory.storeIntAt(offset: Long, value: Int) { assertIndex(offset, 4) val pointer = pointer.plus(offset)!! @@ -146,6 +158,7 @@ public actual inline fun Memory.storeIntAt(offset: Long, value: Int) { /** * Write short signed 16bit integer in the network byte order (Big Endian) */ +@OptIn(ExperimentalForeignApi::class) public actual inline fun Memory.storeShortAt(offset: Int, value: Short) { assertIndex(offset, 2) val pointer = pointer.plus(offset)!! @@ -160,6 +173,7 @@ public actual inline fun Memory.storeShortAt(offset: Int, value: Short) { /** * Write short signed 16bit integer in the network byte order (Big Endian) */ +@OptIn(ExperimentalForeignApi::class) public actual inline fun Memory.storeShortAt(offset: Long, value: Short) { assertIndex(offset, 2) val pointer = pointer.plus(offset)!! @@ -174,6 +188,7 @@ public actual inline fun Memory.storeShortAt(offset: Long, value: Short) { /** * Write short signed 64bit integer in the network byte order (Big Endian) */ +@OptIn(ExperimentalForeignApi::class) public actual inline fun Memory.storeLongAt(offset: Int, value: Long) { assertIndex(offset, 8) val pointer = pointer.plus(offset)!! @@ -188,6 +203,7 @@ public actual inline fun Memory.storeLongAt(offset: Int, value: Long) { /** * Write short signed 64bit integer in the network byte order (Big Endian) */ +@OptIn(ExperimentalForeignApi::class) public actual inline fun Memory.storeLongAt(offset: Long, value: Long) { assertIndex(offset, 8) val pointer = pointer.plus(offset)!! @@ -202,6 +218,7 @@ public actual inline fun Memory.storeLongAt(offset: Long, value: Long) { /** * Write short signed 32bit floating point number in the network byte order (Big Endian) */ +@OptIn(ExperimentalForeignApi::class) public actual inline fun Memory.storeFloatAt(offset: Int, value: Float) { assertIndex(offset, 4) val pointer = pointer.plus(offset)!! @@ -216,6 +233,7 @@ public actual inline fun Memory.storeFloatAt(offset: Int, value: Float) { /** * Write short signed 32bit floating point number in the network byte order (Big Endian) */ +@OptIn(ExperimentalForeignApi::class) public actual inline fun Memory.storeFloatAt(offset: Long, value: Float) { assertIndex(offset, 4) val pointer = pointer.plus(offset)!! @@ -230,6 +248,7 @@ public actual inline fun Memory.storeFloatAt(offset: Long, value: Float) { /** * Write short signed 64bit floating point number in the network byte order (Big Endian) */ +@OptIn(ExperimentalForeignApi::class) public actual inline fun Memory.storeDoubleAt(offset: Int, value: Double) { assertIndex(offset, 8) val pointer = pointer.plus(offset)!! @@ -244,6 +263,7 @@ public actual inline fun Memory.storeDoubleAt(offset: Int, value: Double) { /** * Write short signed 64bit floating point number in the network byte order (Big Endian) */ +@OptIn(ExperimentalForeignApi::class) public actual inline fun Memory.storeDoubleAt(offset: Long, value: Double) { assertIndex(offset, 8) val pointer = pointer.plus(offset)!! @@ -255,12 +275,14 @@ public actual inline fun Memory.storeDoubleAt(offset: Long, value: Double) { } } +@OptIn(ExperimentalForeignApi::class) @PublishedApi internal inline fun storeShortSlowAt(pointer: CPointer, value: Short) { pointer[0] = (value.toInt() ushr 8).toByte() pointer[1] = (value and 0xff).toByte() } +@OptIn(ExperimentalForeignApi::class) @PublishedApi internal inline fun storeIntSlowAt(pointer: CPointer, value: Int) { pointer[0] = (value ushr 24).toByte() @@ -269,6 +291,7 @@ internal inline fun storeIntSlowAt(pointer: CPointer, value: Int) { pointer[3] = (value and 0xff).toByte() } +@OptIn(ExperimentalForeignApi::class) @PublishedApi internal inline fun storeLongSlowAt(pointer: CPointer, value: Long) { pointer[0] = (value ushr 56).toByte() @@ -281,21 +304,25 @@ internal inline fun storeLongSlowAt(pointer: CPointer, value: Long) { pointer[7] = (value and 0xff).toByte() } +@OptIn(ExperimentalForeignApi::class) @PublishedApi internal inline fun storeFloatSlowAt(pointer: CPointer, value: Float) { storeIntSlowAt(pointer, value.toRawBits()) } +@OptIn(ExperimentalForeignApi::class) @PublishedApi internal inline fun storeDoubleSlowAt(pointer: CPointer, value: Double) { storeLongSlowAt(pointer, value.toRawBits()) } +@OptIn(ExperimentalForeignApi::class) @PublishedApi internal inline fun loadShortSlowAt(pointer: CPointer): Short { return ((pointer[0].toInt() shl 8) or (pointer[1].toInt() and 0xff)).toShort() } +@OptIn(ExperimentalForeignApi::class) @PublishedApi internal inline fun loadIntSlowAt(pointer: CPointer): Int { return ( @@ -306,6 +333,7 @@ internal inline fun loadIntSlowAt(pointer: CPointer): Int { ) } +@OptIn(ExperimentalForeignApi::class) @PublishedApi internal inline fun loadLongSlowAt(pointer: CPointer): Long { return ( @@ -320,11 +348,13 @@ internal inline fun loadLongSlowAt(pointer: CPointer): Long { ) } +@OptIn(ExperimentalForeignApi::class) @PublishedApi internal inline fun loadFloatSlowAt(pointer: CPointer): Float { return Float.fromBits(loadIntSlowAt(pointer)) } +@OptIn(ExperimentalForeignApi::class) @PublishedApi internal inline fun loadDoubleSlowAt(pointer: CPointer): Double { return Double.fromBits(loadLongSlowAt(pointer)) diff --git a/ktor-io/posix/src/io/ktor/utils/io/bits/PrimitiveArraysNative.kt b/ktor-io/posix/src/io/ktor/utils/io/bits/PrimitiveArraysNative.kt index efa88f31bbb..b7f4e95d4b2 100644 --- a/ktor-io/posix/src/io/ktor/utils/io/bits/PrimitiveArraysNative.kt +++ b/ktor-io/posix/src/io/ktor/utils/io/bits/PrimitiveArraysNative.kt @@ -4,6 +4,7 @@ package io.ktor.utils.io.bits import kotlinx.cinterop.* import platform.posix.* +import kotlin.experimental.* /** * Copies short integers from this memory range from the specified [offset] and [count] @@ -24,7 +25,7 @@ public actual fun Memory.loadShortArray( * to the [destination] at [destinationOffset] interpreting numbers in the network order (Big Endian). * @param destinationOffset items */ -@OptIn(UnsafeNumber::class) +@OptIn(UnsafeNumber::class, ExperimentalForeignApi::class, ExperimentalNativeApi::class) public actual fun Memory.loadShortArray( offset: Long, destination: ShortArray, @@ -80,7 +81,7 @@ public actual fun Memory.loadIntArray( * to the [destination] at [destinationOffset] interpreting numbers in the network order (Big Endian). * @param destinationOffset items */ -@OptIn(UnsafeNumber::class) +@OptIn(UnsafeNumber::class, ExperimentalForeignApi::class, ExperimentalNativeApi::class) public actual fun Memory.loadIntArray( offset: Long, destination: IntArray, @@ -140,7 +141,7 @@ public actual fun Memory.loadLongArray( * to the [destination] at [destinationOffset] interpreting numbers in the network order (Big Endian). * @param destinationOffset items */ -@OptIn(UnsafeNumber::class) +@OptIn(UnsafeNumber::class, ExperimentalForeignApi::class, ExperimentalNativeApi::class) public actual fun Memory.loadLongArray( offset: Long, destination: LongArray, @@ -196,7 +197,7 @@ public actual fun Memory.loadFloatArray( * to the [destination] at [destinationOffset] interpreting numbers in the network order (Big Endian). * @param destinationOffset items */ -@OptIn(UnsafeNumber::class) +@OptIn(UnsafeNumber::class, ExperimentalForeignApi::class, ExperimentalNativeApi::class) public actual fun Memory.loadFloatArray( offset: Long, destination: FloatArray, @@ -252,7 +253,7 @@ public actual fun Memory.loadDoubleArray( * to the [destination] at [destinationOffset] interpreting numbers in the network order (Big Endian). * @param destinationOffset items */ -@OptIn(UnsafeNumber::class) +@OptIn(UnsafeNumber::class, ExperimentalForeignApi::class, ExperimentalNativeApi::class) public actual fun Memory.loadDoubleArray( offset: Long, destination: DoubleArray, @@ -308,6 +309,7 @@ public actual fun Memory.storeShortArray( * interpreting numbers in the network order (Big Endian). * @param sourceOffset items */ +@OptIn(ExperimentalForeignApi::class, ExperimentalNativeApi::class) public actual fun Memory.storeShortArray( offset: Long, source: ShortArray, @@ -353,6 +355,7 @@ public actual fun Memory.storeIntArray( * interpreting numbers in the network order (Big Endian). * @param sourceOffset items */ +@OptIn(ExperimentalForeignApi::class, ExperimentalNativeApi::class) public actual fun Memory.storeIntArray( offset: Long, source: IntArray, @@ -398,6 +401,7 @@ public actual fun Memory.storeLongArray( * interpreting numbers in the network order (Big Endian). * @param sourceOffset items */ +@OptIn(ExperimentalForeignApi::class, ExperimentalNativeApi::class) public actual fun Memory.storeLongArray( offset: Long, source: LongArray, @@ -443,6 +447,7 @@ public actual fun Memory.storeFloatArray( * interpreting numbers in the network order (Big Endian). * @param sourceOffset items */ +@OptIn(ExperimentalForeignApi::class, ExperimentalNativeApi::class) public actual fun Memory.storeFloatArray( offset: Long, source: FloatArray, @@ -488,6 +493,7 @@ public actual fun Memory.storeDoubleArray( * interpreting numbers in the network order (Big Endian). * @param sourceOffset items */ +@OptIn(ExperimentalForeignApi::class, ExperimentalNativeApi::class) public actual fun Memory.storeDoubleArray( offset: Long, source: DoubleArray, @@ -538,11 +544,16 @@ internal inline fun requireRange(offset: Long, length: Long, size: Long, name: S } } +@OptIn(ExperimentalForeignApi::class) internal inline fun Memory.isAlignedShort(offset: Long) = (pointer.toLong() + offset) and 0b1 == 0L + +@OptIn(ExperimentalForeignApi::class) internal inline fun Memory.isAlignedInt(offset: Long) = (pointer.toLong() + offset) and 0b11 == 0L + +@OptIn(ExperimentalForeignApi::class) internal inline fun Memory.isAlignedLong(offset: Long) = (pointer.toLong() + offset) and 0b111 == 0L -@OptIn(UnsafeNumber::class) +@OptIn(UnsafeNumber::class, ExperimentalForeignApi::class) private fun copy( source: IntArray, destinationPointer: CPointer, @@ -554,7 +565,7 @@ private fun copy( } } -@OptIn(UnsafeNumber::class) +@OptIn(UnsafeNumber::class, ExperimentalForeignApi::class) private fun copy( source: ShortArray, destinationPointer: CPointer, @@ -566,7 +577,7 @@ private fun copy( } } -@OptIn(UnsafeNumber::class) +@OptIn(UnsafeNumber::class, ExperimentalForeignApi::class) private fun copy( source: LongArray, destinationPointer: CPointer, @@ -578,7 +589,7 @@ private fun copy( } } -@OptIn(UnsafeNumber::class) +@OptIn(UnsafeNumber::class, ExperimentalForeignApi::class) private fun copy( source: FloatArray, destinationPointer: CPointer, @@ -590,7 +601,7 @@ private fun copy( } } -@OptIn(UnsafeNumber::class) +@OptIn(UnsafeNumber::class, ExperimentalForeignApi::class) private fun copy( source: DoubleArray, destinationPointer: CPointer, diff --git a/ktor-io/posix/src/io/ktor/utils/io/core/BufferUtilsNative.kt b/ktor-io/posix/src/io/ktor/utils/io/core/BufferUtilsNative.kt index b6f43d25ac3..3ece97213fa 100644 --- a/ktor-io/posix/src/io/ktor/utils/io/core/BufferUtilsNative.kt +++ b/ktor-io/posix/src/io/ktor/utils/io/core/BufferUtilsNative.kt @@ -10,21 +10,25 @@ import kotlin.contracts.* @PublishedApi internal val MAX_SIZE: size_t = size_t.MAX_VALUE +@OptIn(ExperimentalForeignApi::class) @Suppress("DEPRECATION") public fun ChunkBuffer(ptr: CPointer<*>, lengthInBytes: Int, origin: ChunkBuffer?): ChunkBuffer { return ChunkBuffer(Memory.of(ptr, lengthInBytes), origin, null) } +@OptIn(ExperimentalForeignApi::class) @Suppress("DEPRECATION") public fun ChunkBuffer(ptr: CPointer<*>, lengthInBytes: Long, origin: ChunkBuffer?): ChunkBuffer { return ChunkBuffer(Memory.of(ptr, lengthInBytes), origin, null) } +@OptIn(ExperimentalForeignApi::class) @Suppress("DEPRECATION") public fun Buffer.readFully(pointer: CPointer, offset: Int, length: Int) { readFully(pointer, offset.toLong(), length) } +@OptIn(ExperimentalForeignApi::class) @Suppress("DEPRECATION") public fun Buffer.readFully(pointer: CPointer, offset: Long, length: Int) { requirePositiveIndex(offset, "offset") @@ -34,11 +38,13 @@ public fun Buffer.readFully(pointer: CPointer, offset: Long, length: In } } +@OptIn(ExperimentalForeignApi::class) @Suppress("DEPRECATION") public fun Buffer.readAvailable(pointer: CPointer, offset: Int, length: Int): Int { return readAvailable(pointer, offset.toLong(), length) } +@OptIn(ExperimentalForeignApi::class) @Suppress("DEPRECATION") public fun Buffer.readAvailable(pointer: CPointer, offset: Long, length: Int): Int { val available = readRemaining @@ -48,6 +54,7 @@ public fun Buffer.readAvailable(pointer: CPointer, offset: Long, length return resultSize } +@OptIn(ExperimentalForeignApi::class) @Suppress("DEPRECATION") public fun Buffer.writeFully(pointer: CPointer, offset: Int, length: Int) { requirePositiveIndex(offset, "offset") @@ -58,6 +65,7 @@ public fun Buffer.writeFully(pointer: CPointer, offset: Int, length: In } } +@OptIn(ExperimentalForeignApi::class) @Suppress("DEPRECATION") public fun Buffer.writeFully(pointer: CPointer, offset: Long, length: Int) { requirePositiveIndex(offset, "offset") @@ -69,7 +77,7 @@ public fun Buffer.writeFully(pointer: CPointer, offset: Long, length: I } @Suppress("DEPRECATION") -@OptIn(ExperimentalContracts::class) +@OptIn(ExperimentalContracts::class, ExperimentalForeignApi::class) public inline fun Buffer.readDirect(block: (CPointer) -> Int): Int { contract { callsInPlace(block, InvocationKind.EXACTLY_ONCE) @@ -81,7 +89,7 @@ public inline fun Buffer.readDirect(block: (CPointer) -> Int): Int { } @Suppress("DEPRECATION") -@OptIn(ExperimentalContracts::class) +@OptIn(ExperimentalContracts::class, ExperimentalForeignApi::class) public inline fun Buffer.writeDirect(block: (CPointer) -> Int): Int { contract { callsInPlace(block, InvocationKind.EXACTLY_ONCE) diff --git a/ktor-io/posix/src/io/ktor/utils/io/core/BytePacketsNative.kt b/ktor-io/posix/src/io/ktor/utils/io/core/BytePacketsNative.kt index e8db6a2e885..1829ef971b9 100644 --- a/ktor-io/posix/src/io/ktor/utils/io/core/BytePacketsNative.kt +++ b/ktor-io/posix/src/io/ktor/utils/io/core/BytePacketsNative.kt @@ -7,6 +7,7 @@ import kotlinx.cinterop.* * Read at most [limit] bytes to the specified [dst] address * @return number of bytes copied */ +@OptIn(ExperimentalForeignApi::class) public fun ByteReadPacket.readAvailable(dst: CPointer, limit: Int): Int = readAsMuchAsPossible(dst, limit.toLong(), 0L).toInt() @@ -14,6 +15,7 @@ public fun ByteReadPacket.readAvailable(dst: CPointer, limit: Int): Int * Read at most [limit] bytes to the specified [dst] address * @return number of bytes copied */ +@OptIn(ExperimentalForeignApi::class) public fun ByteReadPacket.readAvailable(dst: CPointer, limit: Long): Long = readAsMuchAsPossible(dst, limit, 0L) @@ -21,6 +23,7 @@ public fun ByteReadPacket.readAvailable(dst: CPointer, limit: Long): Lo * Read exactly [size] bytes to the specified [dst] address * @return number of bytes copied */ +@OptIn(ExperimentalForeignApi::class) public fun ByteReadPacket.readFully(dst: CPointer, size: Int): Int { val rc = readAsMuchAsPossible(dst, size.toLong(), 0L) if (rc != size.toLong()) { @@ -33,18 +36,21 @@ public fun ByteReadPacket.readFully(dst: CPointer, size: Int): Int { * Read exactly [size] bytes to the specified [dst] address * @return number of bytes copied */ +@OptIn(ExperimentalForeignApi::class) public fun ByteReadPacket.readFully(dst: CPointer, size: Long): Long { val rc = readAsMuchAsPossible(dst, size, 0L) if (rc != size) throw EOFException("Not enough data in packet to fill buffer: ${size - rc} more bytes required") return rc } +@OptIn(ExperimentalForeignApi::class) private tailrec fun ByteReadPacket.readAsMuchAsPossible( buffer: CPointer, destinationCapacity: Long, copied: Long ): Long { if (destinationCapacity == 0L) return copied + @Suppress("DEPRECATION") val current: ChunkBuffer = prepareRead(1) ?: return copied val available = current.readRemaining.toLong() @@ -64,6 +70,8 @@ private tailrec fun ByteReadPacket.readAsMuchAsPossible( /** * Write all remaining [src] buffer bytes and change its position accordingly */ +@Suppress("DEPRECATION") +@OptIn(ExperimentalForeignApi::class) public fun BytePacketBuilder.writeFully(src: CPointer, size: Int) { var remaining = size var offset = 0 diff --git a/ktor-io/posix/src/io/ktor/utils/io/core/ByteReadPacket.kt b/ktor-io/posix/src/io/ktor/utils/io/core/ByteReadPacket.kt index b10d755bb1d..6b5dd6e829b 100644 --- a/ktor-io/posix/src/io/ktor/utils/io/core/ByteReadPacket.kt +++ b/ktor-io/posix/src/io/ktor/utils/io/core/ByteReadPacket.kt @@ -7,6 +7,7 @@ import io.ktor.utils.io.core.internal.* import io.ktor.utils.io.pool.* import kotlinx.cinterop.* +@OptIn(ExperimentalForeignApi::class) public actual fun ByteReadPacket( array: ByteArray, offset: Int, @@ -18,6 +19,7 @@ public actual fun ByteReadPacket( return ByteReadPacket.Empty } + @Suppress("DEPRECATION") val pool = object : SingleInstancePool() { private var pinned: Pinned<*>? = null diff --git a/ktor-io/posix/src/io/ktor/utils/io/core/InputArraysNative.kt b/ktor-io/posix/src/io/ktor/utils/io/core/InputArraysNative.kt index 686685b435c..921321ca8f8 100644 --- a/ktor-io/posix/src/io/ktor/utils/io/core/InputArraysNative.kt +++ b/ktor-io/posix/src/io/ktor/utils/io/core/InputArraysNative.kt @@ -2,21 +2,24 @@ package io.ktor.utils.io.core import kotlinx.cinterop.* -@Suppress("EXTENSION_SHADOWED_BY_MEMBER") +@OptIn(ExperimentalForeignApi::class) +@Suppress("EXTENSION_SHADOWED_BY_MEMBER", "DEPRECATION") public fun Input.readFully(dst: CPointer, offset: Int, length: Int) { if (readAvailable(dst, offset, length) != length) { prematureEndOfStream(length) } } -@Suppress("EXTENSION_SHADOWED_BY_MEMBER") +@OptIn(ExperimentalForeignApi::class) +@Suppress("EXTENSION_SHADOWED_BY_MEMBER", "DEPRECATION") public fun Input.readFully(dst: CPointer, offset: Long, length: Long) { if (readAvailable(dst, offset, length) != length) { prematureEndOfStream(length) } } -@Suppress("EXTENSION_SHADOWED_BY_MEMBER") +@OptIn(ExperimentalForeignApi::class) +@Suppress("EXTENSION_SHADOWED_BY_MEMBER", "DEPRECATION") public fun Input.readAvailable(dst: CPointer, offset: Int, length: Int): Int { var bytesCopied = 0 @@ -30,7 +33,8 @@ public fun Input.readAvailable(dst: CPointer, offset: Int, length: Int) return bytesCopied } -@Suppress("EXTENSION_SHADOWED_BY_MEMBER") +@OptIn(ExperimentalForeignApi::class) +@Suppress("EXTENSION_SHADOWED_BY_MEMBER", "DEPRECATION") public fun Input.readAvailable(dst: CPointer, offset: Long, length: Long): Long { var bytesCopied = 0L diff --git a/ktor-io/posix/src/io/ktor/utils/io/core/OutputArraysNative.kt b/ktor-io/posix/src/io/ktor/utils/io/core/OutputArraysNative.kt index 17a83e9195e..adabb581b4d 100644 --- a/ktor-io/posix/src/io/ktor/utils/io/core/OutputArraysNative.kt +++ b/ktor-io/posix/src/io/ktor/utils/io/core/OutputArraysNative.kt @@ -4,10 +4,14 @@ package io.ktor.utils.io.core import kotlinx.cinterop.* +@Suppress("DEPRECATION") +@OptIn(ExperimentalForeignApi::class) public fun Output.writeFully(src: CPointer, offset: Int, length: Int) { writeFully(src, offset.toLong(), length.toLong()) } +@Suppress("DEPRECATION") +@OptIn(ExperimentalForeignApi::class) public fun Output.writeFully(src: CPointer, offset: Long, length: Long) { require(length >= 0L) require(offset >= 0L) diff --git a/ktor-io/posix/src/io/ktor/utils/io/core/ScannerNative.kt b/ktor-io/posix/src/io/ktor/utils/io/core/ScannerNative.kt index 1b0ddc1aa35..31268ae6f81 100644 --- a/ktor-io/posix/src/io/ktor/utils/io/core/ScannerNative.kt +++ b/ktor-io/posix/src/io/ktor/utils/io/core/ScannerNative.kt @@ -3,6 +3,8 @@ package io.ktor.utils.io.core import kotlinx.cinterop.* import platform.posix.* +@Suppress("DEPRECATION") +@OptIn(ExperimentalForeignApi::class) internal actual fun Buffer.discardUntilDelimiterImpl(delimiter: Byte): Int { val content = content var idx = readPosition @@ -18,6 +20,8 @@ internal actual fun Buffer.discardUntilDelimiterImpl(delimiter: Byte): Int { return idx - start } +@OptIn(ExperimentalForeignApi::class) +@Suppress("DEPRECATION") internal actual fun Buffer.discardUntilDelimitersImpl(delimiter1: Byte, delimiter2: Byte): Int { val content = content var idx = readPosition @@ -34,6 +38,7 @@ internal actual fun Buffer.discardUntilDelimitersImpl(delimiter1: Byte, delimite return idx - start } +@Suppress("DEPRECATION") internal actual fun Buffer.readUntilDelimiterImpl( delimiter: Byte, dst: ByteArray, @@ -47,6 +52,7 @@ internal actual fun Buffer.readUntilDelimiterImpl( return readUntilImpl({ it == delimiter }, dst, offset, length) } +@Suppress("DEPRECATION") internal actual fun Buffer.readUntilDelimitersImpl( delimiter1: Byte, delimiter2: Byte, @@ -62,17 +68,20 @@ internal actual fun Buffer.readUntilDelimitersImpl( return readUntilImpl({ it == delimiter1 || it == delimiter2 }, dst, offset, length) } +@Suppress("DEPRECATION") internal actual fun Buffer.readUntilDelimiterImpl(delimiter: Byte, dst: Output): Int { return readUntilImpl({ it == delimiter }, dst) } +@Suppress("DEPRECATION") internal actual fun Buffer.readUntilDelimitersImpl(delimiter1: Byte, delimiter2: Byte, dst: Output): Int { check(delimiter1 != delimiter2) return readUntilImpl({ it == delimiter1 || it == delimiter2 }, dst) } -@OptIn(UnsafeNumber::class) +@OptIn(UnsafeNumber::class, ExperimentalForeignApi::class) +@Suppress("DEPRECATION") private inline fun Buffer.readUntilImpl( predicate: (Byte) -> Boolean, dst: ByteArray, @@ -103,7 +112,8 @@ private inline fun Buffer.readUntilImpl( return copied } -@OptIn(UnsafeNumber::class) +@Suppress("DEPRECATION") +@OptIn(UnsafeNumber::class, ExperimentalForeignApi::class) private inline fun Buffer.readUntilImpl( predicate: (Byte) -> Boolean, dst: Output @@ -136,4 +146,6 @@ private inline fun Buffer.readUntilImpl( return copiedTotal } +@OptIn(ExperimentalForeignApi::class) +@Suppress("DEPRECATION") internal inline val Buffer.content: CPointer get() = memory.pointer diff --git a/ktor-io/posix/src/io/ktor/utils/io/core/StringsNative.kt b/ktor-io/posix/src/io/ktor/utils/io/core/StringsNative.kt index 9c93c784b9e..29155ec042d 100644 --- a/ktor-io/posix/src/io/ktor/utils/io/core/StringsNative.kt +++ b/ktor-io/posix/src/io/ktor/utils/io/core/StringsNative.kt @@ -8,6 +8,7 @@ import kotlinx.cinterop.* * Create an instance of [String] from the specified [bytes] range starting at [offset] and bytes [length] * interpreting characters in the specified [charset]. */ +@OptIn(ExperimentalForeignApi::class) @Suppress("FunctionName") public actual fun String(bytes: ByteArray, offset: Int, length: Int, charset: Charset): String { if (length == 0 && offset <= bytes.size) return "" diff --git a/ktor-io/posix/src/io/ktor/utils/io/errors/PosixErrors.kt b/ktor-io/posix/src/io/ktor/utils/io/errors/PosixErrors.kt index 7028076616d..a06907c2e8b 100644 --- a/ktor-io/posix/src/io/ktor/utils/io/errors/PosixErrors.kt +++ b/ktor-io/posix/src/io/ktor/utils/io/errors/PosixErrors.kt @@ -72,6 +72,7 @@ public sealed class PosixException(public val errno: Int, message: String) : Exc * @param posixFunctionName optional function name to be included to the exception message * @return an instance of [PosixException] or it's subtype */ + @OptIn(ExperimentalForeignApi::class) public fun forErrno( errno: Int = platform.posix.errno, posixFunctionName: String? = null @@ -117,4 +118,5 @@ public sealed class PosixException(public val errno: Int, message: String) : Exc internal fun PosixException.wrapIO(): IOException = IOException("I/O operation failed due to posix error code $errno", this) +@OptIn(ExperimentalForeignApi::class) private fun posixErrorToString(errno: Int): String = strerror(errno)?.toKString() ?: "Unknown error code: $errno" diff --git a/ktor-io/posix/test/io/ktor/utils/io/ByteChannelNativeTests.kt b/ktor-io/posix/test/io/ktor/utils/io/ByteChannelNativeTests.kt index 9436c257fd3..7e76f90ad01 100644 --- a/ktor-io/posix/test/io/ktor/utils/io/ByteChannelNativeTests.kt +++ b/ktor-io/posix/test/io/ktor/utils/io/ByteChannelNativeTests.kt @@ -8,6 +8,7 @@ import kotlinx.cinterop.* import kotlin.test.* class ByteChannelNativeTests : ByteChannelTestBase(true) { + @OptIn(ExperimentalForeignApi::class) @Test fun testCPointersReadWriteFully() = runTest { val array = ByteArray(4) @@ -29,6 +30,7 @@ class ByteChannelNativeTests : ByteChannelTestBase(true) { assertTrue { array.contentEquals(result) } } + @OptIn(ExperimentalForeignApi::class) @Test fun testCPointersReadWriteFullyWithShift() = runTest { for (shift in 0..3) { @@ -54,6 +56,7 @@ class ByteChannelNativeTests : ByteChannelTestBase(true) { } } + @OptIn(ExperimentalForeignApi::class) @Test fun testCPointersReadAvailable() = runTest { val array = ByteArray(4) diff --git a/ktor-io/posix/test/io/ktor/utils/io/BytePacketBuilderExtendedTest.kt b/ktor-io/posix/test/io/ktor/utils/io/BytePacketBuilderExtendedTest.kt index 545481611cc..4a682a16421 100644 --- a/ktor-io/posix/test/io/ktor/utils/io/BytePacketBuilderExtendedTest.kt +++ b/ktor-io/posix/test/io/ktor/utils/io/BytePacketBuilderExtendedTest.kt @@ -11,8 +11,10 @@ import kotlin.test.* class BytePacketBuilderExtendedTest : BytePacketBuildTest() { override val pool = VerifyingChunkBufferPool() + @OptIn(ExperimentalForeignApi::class) private val buffer = nativeHeap.allocArray(8888) + @OptIn(ExperimentalForeignApi::class) @Test fun smokeSingleBufferTestExtended() { val p = buildPacket { @@ -46,6 +48,7 @@ class BytePacketBuilderExtendedTest : BytePacketBuildTest() { assertEquals("1|2|3", p.readUTF8Line()) } + @OptIn(ExperimentalForeignApi::class) @Test fun smokeMultiBufferTestExtended() { val p = buildPacket { @@ -88,6 +91,5 @@ class BytePacketBuilderExtendedTest : BytePacketBuildTest() { } } - companion object { - } + companion object } diff --git a/ktor-io/posix/test/io/ktor/utils/io/ChunkBufferNativeTest.kt b/ktor-io/posix/test/io/ktor/utils/io/ChunkBufferNativeTest.kt index a0e5d8923ac..57de09940e3 100644 --- a/ktor-io/posix/test/io/ktor/utils/io/ChunkBufferNativeTest.kt +++ b/ktor-io/posix/test/io/ktor/utils/io/ChunkBufferNativeTest.kt @@ -2,7 +2,6 @@ package io.ktor.utils.io import io.ktor.utils.io.core.* import io.ktor.utils.io.core.internal.* -import io.ktor.utils.io.pool.* import kotlinx.cinterop.* import kotlin.test.* @@ -14,6 +13,7 @@ class ChunkBufferNativeTest { buffer.release(ChunkBuffer.Pool) } + @OptIn(ExperimentalForeignApi::class) @Test fun testReadDirectOnEmpty() { var invoked: Boolean @@ -26,6 +26,7 @@ class ChunkBufferNativeTest { assertTrue(invoked) } + @OptIn(ExperimentalForeignApi::class) @Test fun testReadDirectNegativeResult() { assertFails { @@ -35,6 +36,7 @@ class ChunkBufferNativeTest { } } + @OptIn(ExperimentalForeignApi::class) @Test fun testReadDirectTooManyBytesResult() { assertFails { @@ -44,6 +46,7 @@ class ChunkBufferNativeTest { } } + @OptIn(ExperimentalForeignApi::class) @Test fun testReadDirect() { var result: Int @@ -59,6 +62,7 @@ class ChunkBufferNativeTest { assertEquals(8, buffer.readByte().toInt()) } + @OptIn(ExperimentalForeignApi::class) @Test fun testReadDirectAtEnd() { while (buffer.writeRemaining > 0) { @@ -78,6 +82,7 @@ class ChunkBufferNativeTest { } } + @OptIn(ExperimentalForeignApi::class) @Test fun testWriteDirect() { buffer.writeDirect { ptr -> @@ -93,6 +98,7 @@ class ChunkBufferNativeTest { assertEquals(2, buffer.readByte().toInt()) } + @OptIn(ExperimentalForeignApi::class) @Test fun testWriteDirectOnFull() { val size = buffer.writeRemaining diff --git a/ktor-io/posix/test/io/ktor/utils/io/PosixIoTest.kt b/ktor-io/posix/test/io/ktor/utils/io/PosixIoTest.kt index 53966d67dc2..98e42e077a3 100644 --- a/ktor-io/posix/test/io/ktor/utils/io/PosixIoTest.kt +++ b/ktor-io/posix/test/io/ktor/utils/io/PosixIoTest.kt @@ -28,12 +28,14 @@ class PosixIoTest { unlink(filename) } + @OptIn(ExperimentalForeignApi::class) @Suppress("unused") internal fun Int.checkError(action: String = ""): Int = when { this < 0 -> memScoped { throw PosixException.forErrno(posixFunctionName = action) } else -> this } + @OptIn(ExperimentalForeignApi::class) @Suppress("unused") internal fun Long.checkError(action: String = ""): Long = when { this < 0 -> memScoped { throw PosixException.forErrno(posixFunctionName = action) } @@ -42,6 +44,7 @@ class PosixIoTest { private val ZERO: size_t = 0u + @OptIn(ExperimentalForeignApi::class) @Suppress("unused") internal fun size_t.checkError(action: String = ""): size_t = when (this) { ZERO -> errno.let { errno -> diff --git a/ktor-network/api/ktor-network.api b/ktor-network/api/ktor-network.api index d150bccff29..004c051be68 100644 --- a/ktor-network/api/ktor-network.api +++ b/ktor-network/api/ktor-network.api @@ -29,6 +29,7 @@ public final class io/ktor/network/selector/SelectInterest : java/lang/Enum { public static final field Companion Lio/ktor/network/selector/SelectInterest$Companion; public static final field READ Lio/ktor/network/selector/SelectInterest; public static final field WRITE Lio/ktor/network/selector/SelectInterest; + public static fun getEntries ()Lkotlin/enums/EnumEntries; public final fun getFlag ()I public static fun valueOf (Ljava/lang/String;)Lio/ktor/network/selector/SelectInterest; public static fun values ()[Lio/ktor/network/selector/SelectInterest; diff --git a/ktor-network/darwin/src/io/ktor/network/selector/SelectUtilsDarwin.kt b/ktor-network/darwin/src/io/ktor/network/selector/SelectUtilsDarwin.kt index 5625fa65689..5ead6b355d9 100644 --- a/ktor-network/darwin/src/io/ktor/network/selector/SelectUtilsDarwin.kt +++ b/ktor-network/darwin/src/io/ktor/network/selector/SelectUtilsDarwin.kt @@ -6,9 +6,9 @@ package io.ktor.network.selector import kotlinx.cinterop.* import platform.darwin.* -import platform.posix.* import kotlin.Byte +@OptIn(ExperimentalForeignApi::class) internal actual fun inetNtopBridge( type: Int, address: CPointer<*>, diff --git a/ktor-network/darwin/src/io/ktor/network/util/SocketUtilsDarwin.kt b/ktor-network/darwin/src/io/ktor/network/util/SocketUtilsDarwin.kt index c83dcbf7695..ce0f0d18246 100644 --- a/ktor-network/darwin/src/io/ktor/network/util/SocketUtilsDarwin.kt +++ b/ktor-network/darwin/src/io/ktor/network/util/SocketUtilsDarwin.kt @@ -8,6 +8,7 @@ import kotlinx.cinterop.ByteVar import platform.darwin.* import platform.posix.* +@OptIn(ExperimentalForeignApi::class) internal actual fun ktor_inet_ntop( family: Int, src: CValuesRef<*>?, diff --git a/ktor-network/ios/src/io/ktor/network/util/SocketUtilsIos.kt b/ktor-network/ios/src/io/ktor/network/util/SocketUtilsIos.kt index 7f38167cdaf..56192cd3cb5 100644 --- a/ktor-network/ios/src/io/ktor/network/util/SocketUtilsIos.kt +++ b/ktor-network/ios/src/io/ktor/network/util/SocketUtilsIos.kt @@ -13,6 +13,7 @@ internal actual fun unpack_sockaddr_un( error("Address ${sockaddr.sa_family} is not supported on ios") } +@OptIn(ExperimentalForeignApi::class) internal actual fun pack_sockaddr_un( family: UShort, path: String, diff --git a/ktor-network/ktor-network-tls/api/ktor-network-tls.api b/ktor-network/ktor-network-tls/api/ktor-network-tls.api index fcf0749c678..a9aa8c1267b 100644 --- a/ktor-network/ktor-network-tls/api/ktor-network-tls.api +++ b/ktor-network/ktor-network-tls/api/ktor-network-tls.api @@ -59,6 +59,7 @@ public final class io/ktor/network/tls/CipherSuite { public final class io/ktor/network/tls/CipherType : java/lang/Enum { public static final field CBC Lio/ktor/network/tls/CipherType; public static final field GCM Lio/ktor/network/tls/CipherType; + public static fun getEntries ()Lkotlin/enums/EnumEntries; public static fun valueOf (Ljava/lang/String;)Lio/ktor/network/tls/CipherType; public static fun values ()[Lio/ktor/network/tls/CipherType; } @@ -112,6 +113,7 @@ public final class io/ktor/network/tls/OIDKt { public final class io/ktor/network/tls/SecretExchangeType : java/lang/Enum { public static final field ECDHE Lio/ktor/network/tls/SecretExchangeType; public static final field RSA Lio/ktor/network/tls/SecretExchangeType; + public static fun getEntries ()Lkotlin/enums/EnumEntries; public final fun getJvmName ()Ljava/lang/String; public static fun valueOf (Ljava/lang/String;)Lio/ktor/network/tls/SecretExchangeType; public static fun values ()[Lio/ktor/network/tls/SecretExchangeType; @@ -123,6 +125,7 @@ public final class io/ktor/network/tls/ServerKeyExchangeType : java/lang/Enum { public static final field ExplicitPrime Lio/ktor/network/tls/ServerKeyExchangeType; public static final field NamedCurve Lio/ktor/network/tls/ServerKeyExchangeType; public final fun getCode ()I + public static fun getEntries ()Lkotlin/enums/EnumEntries; public static fun valueOf (Ljava/lang/String;)Lio/ktor/network/tls/ServerKeyExchangeType; public static fun values ()[Lio/ktor/network/tls/ServerKeyExchangeType; } @@ -136,6 +139,7 @@ public final class io/ktor/network/tls/TLSAlertLevel : java/lang/Enum { public static final field FATAL Lio/ktor/network/tls/TLSAlertLevel; public static final field WARNING Lio/ktor/network/tls/TLSAlertLevel; public final fun getCode ()I + public static fun getEntries ()Lkotlin/enums/EnumEntries; public static fun valueOf (Ljava/lang/String;)Lio/ktor/network/tls/TLSAlertLevel; public static fun values ()[Lio/ktor/network/tls/TLSAlertLevel; } @@ -172,6 +176,7 @@ public final class io/ktor/network/tls/TLSAlertType : java/lang/Enum { public static final field UnsupportedExtension Lio/ktor/network/tls/TLSAlertType; public static final field UserCanceled Lio/ktor/network/tls/TLSAlertType; public final fun getCode ()I + public static fun getEntries ()Lkotlin/enums/EnumEntries; public static fun valueOf (Ljava/lang/String;)Lio/ktor/network/tls/TLSAlertType; public static fun values ()[Lio/ktor/network/tls/TLSAlertType; } @@ -230,6 +235,7 @@ public final class io/ktor/network/tls/TLSHandshakeType : java/lang/Enum { public static final field ServerHello Lio/ktor/network/tls/TLSHandshakeType; public static final field ServerKeyExchange Lio/ktor/network/tls/TLSHandshakeType; public final fun getCode ()I + public static fun getEntries ()Lkotlin/enums/EnumEntries; public static fun valueOf (Ljava/lang/String;)Lio/ktor/network/tls/TLSHandshakeType; public static fun values ()[Lio/ktor/network/tls/TLSHandshakeType; } @@ -252,6 +258,7 @@ public final class io/ktor/network/tls/TLSRecordType : java/lang/Enum { public static final field Companion Lio/ktor/network/tls/TLSRecordType$Companion; public static final field Handshake Lio/ktor/network/tls/TLSRecordType; public final fun getCode ()I + public static fun getEntries ()Lkotlin/enums/EnumEntries; public static fun valueOf (Ljava/lang/String;)Lio/ktor/network/tls/TLSRecordType; public static fun values ()[Lio/ktor/network/tls/TLSRecordType; } @@ -267,6 +274,7 @@ public final class io/ktor/network/tls/TLSVersion : java/lang/Enum { public static final field TLS11 Lio/ktor/network/tls/TLSVersion; public static final field TLS12 Lio/ktor/network/tls/TLSVersion; public final fun getCode ()I + public static fun getEntries ()Lkotlin/enums/EnumEntries; public static fun valueOf (Ljava/lang/String;)Lio/ktor/network/tls/TLSVersion; public static fun values ()[Lio/ktor/network/tls/TLSVersion; } @@ -286,6 +294,7 @@ public final class io/ktor/network/tls/extensions/HashAlgorithm : java/lang/Enum public static final field SHA384 Lio/ktor/network/tls/extensions/HashAlgorithm; public static final field SHA512 Lio/ktor/network/tls/extensions/HashAlgorithm; public final fun getCode ()B + public static fun getEntries ()Lkotlin/enums/EnumEntries; public final fun getMacName ()Ljava/lang/String; public final fun getOpenSSLName ()Ljava/lang/String; public static fun valueOf (Ljava/lang/String;)Lio/ktor/network/tls/extensions/HashAlgorithm; @@ -345,6 +354,7 @@ public final class io/ktor/network/tls/extensions/NamedCurve : java/lang/Enum { public static final field sect571k1 Lio/ktor/network/tls/extensions/NamedCurve; public static final field sect571r1 Lio/ktor/network/tls/extensions/NamedCurve; public final fun getCode ()S + public static fun getEntries ()Lkotlin/enums/EnumEntries; public final fun getFieldSize ()I public static fun valueOf (Ljava/lang/String;)Lio/ktor/network/tls/extensions/NamedCurve; public static fun values ()[Lio/ktor/network/tls/extensions/NamedCurve; @@ -363,6 +373,7 @@ public final class io/ktor/network/tls/extensions/PointFormat : java/lang/Enum { public static final field ANSIX962_COMPRESSED_PRIME Lio/ktor/network/tls/extensions/PointFormat; public static final field UNCOMPRESSED Lio/ktor/network/tls/extensions/PointFormat; public final fun getCode ()B + public static fun getEntries ()Lkotlin/enums/EnumEntries; public static fun valueOf (Ljava/lang/String;)Lio/ktor/network/tls/extensions/PointFormat; public static fun values ()[Lio/ktor/network/tls/extensions/PointFormat; } @@ -380,6 +391,7 @@ public final class io/ktor/network/tls/extensions/SignatureAlgorithm : java/lang public static final field ED448 Lio/ktor/network/tls/extensions/SignatureAlgorithm; public static final field RSA Lio/ktor/network/tls/extensions/SignatureAlgorithm; public final fun getCode ()B + public static fun getEntries ()Lkotlin/enums/EnumEntries; public static fun valueOf (Ljava/lang/String;)Lio/ktor/network/tls/extensions/SignatureAlgorithm; public static fun values ()[Lio/ktor/network/tls/extensions/SignatureAlgorithm; } @@ -405,6 +417,7 @@ public final class io/ktor/network/tls/extensions/TLSExtensionType : java/lang/E public static final field TRUNCATED_HMAC Lio/ktor/network/tls/extensions/TLSExtensionType; public static final field TRUSTED_CA_KEYS Lio/ktor/network/tls/extensions/TLSExtensionType; public final fun getCode ()S + public static fun getEntries ()Lkotlin/enums/EnumEntries; public static fun valueOf (Ljava/lang/String;)Lio/ktor/network/tls/extensions/TLSExtensionType; public static fun values ()[Lio/ktor/network/tls/extensions/TLSExtensionType; } diff --git a/ktor-network/ktor-network-tls/ktor-network-tls-certificates/api/ktor-network-tls-certificates.api b/ktor-network/ktor-network-tls/ktor-network-tls-certificates/api/ktor-network-tls-certificates.api index 52cbb0dad6d..faed41be721 100644 --- a/ktor-network/ktor-network-tls/ktor-network-tls-certificates/api/ktor-network-tls-certificates.api +++ b/ktor-network/ktor-network-tls/ktor-network-tls-certificates/api/ktor-network-tls-certificates.api @@ -45,6 +45,7 @@ public final class io/ktor/network/tls/certificates/KeyType : java/lang/Enum { public static final field CA Lio/ktor/network/tls/certificates/KeyType; public static final field Client Lio/ktor/network/tls/certificates/KeyType; public static final field Server Lio/ktor/network/tls/certificates/KeyType; + public static fun getEntries ()Lkotlin/enums/EnumEntries; public static fun valueOf (Ljava/lang/String;)Lio/ktor/network/tls/certificates/KeyType; public static fun values ()[Lio/ktor/network/tls/certificates/KeyType; } diff --git a/ktor-network/linux/src/io/ktor/network/selector/SelectUtilsLinux.kt b/ktor-network/linux/src/io/ktor/network/selector/SelectUtilsLinux.kt index 3c1e8252918..e0257341344 100644 --- a/ktor-network/linux/src/io/ktor/network/selector/SelectUtilsLinux.kt +++ b/ktor-network/linux/src/io/ktor/network/selector/SelectUtilsLinux.kt @@ -6,8 +6,8 @@ package io.ktor.network.selector import kotlinx.cinterop.* import platform.linux.* -import platform.posix.* +@OptIn(ExperimentalForeignApi::class) internal actual fun inetNtopBridge( type: Int, address: CPointer<*>, diff --git a/ktor-network/linux/src/io/ktor/network/util/SocketUtilsLinux.kt b/ktor-network/linux/src/io/ktor/network/util/SocketUtilsLinux.kt index e1584ce9aa4..16217dc0560 100644 --- a/ktor-network/linux/src/io/ktor/network/util/SocketUtilsLinux.kt +++ b/ktor-network/linux/src/io/ktor/network/util/SocketUtilsLinux.kt @@ -8,6 +8,7 @@ import kotlinx.cinterop.* import platform.linux.* import platform.posix.* +@OptIn(ExperimentalForeignApi::class) internal actual fun ktor_inet_ntop( family: Int, src: CValuesRef<*>?, @@ -15,6 +16,7 @@ internal actual fun ktor_inet_ntop( size: socklen_t ): CPointer? = inet_ntop(family, src, dst, size) +@OptIn(ExperimentalForeignApi::class) internal actual fun unpack_sockaddr_un( sockaddr: sockaddr, block: (family: UShort, path: String) -> T @@ -23,6 +25,7 @@ internal actual fun unpack_sockaddr_un( return block(address.sun_family, address.sun_path.toKString()) } +@OptIn(ExperimentalForeignApi::class) internal actual fun pack_sockaddr_un( family: UShort, path: String, diff --git a/ktor-network/macos/src/io/ktor/network/util/SocketUtilsMacos.kt b/ktor-network/macos/src/io/ktor/network/util/SocketUtilsMacos.kt index 3247ab62aa5..a3c439ee97d 100644 --- a/ktor-network/macos/src/io/ktor/network/util/SocketUtilsMacos.kt +++ b/ktor-network/macos/src/io/ktor/network/util/SocketUtilsMacos.kt @@ -7,6 +7,7 @@ import kotlinx.cinterop.* import platform.osx.* import platform.posix.* +@OptIn(ExperimentalForeignApi::class) internal actual fun unpack_sockaddr_un( sockaddr: sockaddr, block: (family: UShort, path: String) -> T @@ -15,6 +16,7 @@ internal actual fun unpack_sockaddr_un( return block(address.sun_family.convert(), address.sun_path.toKString()) } +@OptIn(ExperimentalForeignApi::class) internal actual fun pack_sockaddr_un( family: UShort, path: String, diff --git a/ktor-network/nix/src/io/ktor/network/selector/SelectUtils.kt b/ktor-network/nix/src/io/ktor/network/selector/SelectUtils.kt index 3d354a76bfa..9785248ac39 100644 --- a/ktor-network/nix/src/io/ktor/network/selector/SelectUtils.kt +++ b/ktor-network/nix/src/io/ktor/network/selector/SelectUtils.kt @@ -10,11 +10,11 @@ import io.ktor.util.collections.* import io.ktor.utils.io.errors.* import kotlinx.cinterop.* import kotlinx.coroutines.* -import kotlinx.coroutines.CancellationException import platform.posix.* import kotlin.coroutines.* import kotlin.math.* +@OptIn(ExperimentalForeignApi::class) internal expect fun inetNtopBridge(type: Int, address: CPointer<*>, addressOf: CPointer<*>, size: Int) @OptIn(InternalAPI::class) @@ -61,6 +61,7 @@ internal class SelectorHelper { wakeupSignal.signal() } + @OptIn(ExperimentalForeignApi::class) private fun selectionLoop() { val readSet = select_create_fd_set() val writeSet = select_create_fd_set() @@ -102,6 +103,7 @@ internal class SelectorHelper { } } + @OptIn(ExperimentalForeignApi::class) private fun fillHandlers( watchSet: MutableSet, readSet: CValue, @@ -127,6 +129,7 @@ internal class SelectorHelper { return maxDescriptor } + @OptIn(ExperimentalForeignApi::class) private fun addInterest( event: EventInfo, readSet: CValue, @@ -142,6 +145,7 @@ internal class SelectorHelper { check(select_fd_isset(event.descriptor, errorSet) != 0) } + @OptIn(ExperimentalForeignApi::class) private fun processSelectedEvents( watchSet: MutableSet, closeSet: MutableSet, @@ -189,6 +193,7 @@ internal class SelectorHelper { completed.clear() } + @OptIn(ExperimentalForeignApi::class) private fun descriptorSetByInterestKind( event: EventInfo, readSet: CValue, diff --git a/ktor-network/nix/src/io/ktor/network/selector/SignalPoint.kt b/ktor-network/nix/src/io/ktor/network/selector/SignalPoint.kt index b5218e6ad5c..631382d63c1 100644 --- a/ktor-network/nix/src/io/ktor/network/selector/SignalPoint.kt +++ b/ktor-network/nix/src/io/ktor/network/selector/SignalPoint.kt @@ -12,6 +12,7 @@ import kotlinx.atomicfu.locks.* import kotlinx.cinterop.* import platform.posix.* +@OptIn(ExperimentalForeignApi::class) internal class SignalPoint : Closeable { private val readDescriptor: Int private val writeDescriptor: Int diff --git a/ktor-network/nix/src/io/ktor/network/sockets/CIOReader.kt b/ktor-network/nix/src/io/ktor/network/sockets/CIOReader.kt index c48e4c6a82c..3cd9d59d6d2 100644 --- a/ktor-network/nix/src/io/ktor/network/sockets/CIOReader.kt +++ b/ktor-network/nix/src/io/ktor/network/sockets/CIOReader.kt @@ -11,7 +11,7 @@ import kotlinx.cinterop.* import kotlinx.coroutines.* import platform.posix.* -@OptIn(UnsafeNumber::class) +@OptIn(UnsafeNumber::class, ExperimentalForeignApi::class) internal fun CoroutineScope.attachForReadingImpl( userChannel: ByteChannel, descriptor: Int, diff --git a/ktor-network/nix/src/io/ktor/network/sockets/CIOWriter.kt b/ktor-network/nix/src/io/ktor/network/sockets/CIOWriter.kt index c754910722a..bc41084fa7f 100644 --- a/ktor-network/nix/src/io/ktor/network/sockets/CIOWriter.kt +++ b/ktor-network/nix/src/io/ktor/network/sockets/CIOWriter.kt @@ -12,7 +12,7 @@ import kotlinx.coroutines.* import platform.posix.* import kotlin.math.* -@OptIn(UnsafeNumber::class) +@OptIn(UnsafeNumber::class, ExperimentalForeignApi::class) internal fun CoroutineScope.attachForWritingImpl( userChannel: ByteChannel, descriptor: Int, diff --git a/ktor-network/nix/src/io/ktor/network/sockets/ConnectUtilsNative.kt b/ktor-network/nix/src/io/ktor/network/sockets/ConnectUtilsNative.kt index a8f3bb4faa6..1908f44cb41 100644 --- a/ktor-network/nix/src/io/ktor/network/sockets/ConnectUtilsNative.kt +++ b/ktor-network/nix/src/io/ktor/network/sockets/ConnectUtilsNative.kt @@ -11,7 +11,7 @@ import platform.posix.* private const val DEFAULT_BACKLOG_SIZE = 50 -@OptIn(UnsafeNumber::class) +@OptIn(UnsafeNumber::class, ExperimentalForeignApi::class) internal actual suspend fun connect( selector: SelectorManager, remoteAddress: SocketAddress, @@ -43,7 +43,7 @@ internal actual suspend fun connect( error("Failed to connect to $remoteAddress.") } -@OptIn(UnsafeNumber::class) +@OptIn(UnsafeNumber::class, ExperimentalForeignApi::class) internal actual fun bind( selector: SelectorManager, localAddress: SocketAddress?, diff --git a/ktor-network/nix/src/io/ktor/network/sockets/DatagramSendChannel.kt b/ktor-network/nix/src/io/ktor/network/sockets/DatagramSendChannel.kt index 45b8d409aa9..9686c2df76f 100644 --- a/ktor-network/nix/src/io/ktor/network/sockets/DatagramSendChannel.kt +++ b/ktor-network/nix/src/io/ktor/network/sockets/DatagramSendChannel.kt @@ -103,6 +103,7 @@ internal class DatagramSendChannel( } } + @OptIn(ExperimentalForeignApi::class) private fun sento(datagram: Datagram, bytes: ByteArray): Int { var bytesWritten: Int? = null bytes.usePinned { pinned -> @@ -124,7 +125,7 @@ internal class DatagramSendChannel( bytes.size.convert(), 0, null, - 0 + 0.convert() ).toInt() } } diff --git a/ktor-network/nix/src/io/ktor/network/sockets/DatagramSocketNative.kt b/ktor-network/nix/src/io/ktor/network/sockets/DatagramSocketNative.kt index 991aaf65496..6f878f5fa84 100644 --- a/ktor-network/nix/src/io/ktor/network/sockets/DatagramSocketNative.kt +++ b/ktor-network/nix/src/io/ktor/network/sockets/DatagramSocketNative.kt @@ -82,7 +82,7 @@ internal class DatagramSocketNative( } } - @OptIn(UnsafeNumber::class) + @OptIn(UnsafeNumber::class, ExperimentalForeignApi::class) private fun tryReadDatagram(): Datagram? = memScoped { val clientAddress = alloc() val clientAddressLength: UIntVarOf = alloc() diff --git a/ktor-network/nix/src/io/ktor/network/sockets/NativeSocketOptions.kt b/ktor-network/nix/src/io/ktor/network/sockets/NativeSocketOptions.kt index 42cd06fa67f..cbb20c279d7 100644 --- a/ktor-network/nix/src/io/ktor/network/sockets/NativeSocketOptions.kt +++ b/ktor-network/nix/src/io/ktor/network/sockets/NativeSocketOptions.kt @@ -20,6 +20,7 @@ internal fun assignOptions(descriptor: Int, options: SocketOptions) { } } +@OptIn(ExperimentalForeignApi::class) private fun setSocketFlag( descriptor: Int, optionName: Int, diff --git a/ktor-network/nix/src/io/ktor/network/sockets/TCPServerSocketNative.kt b/ktor-network/nix/src/io/ktor/network/sockets/TCPServerSocketNative.kt index ccaa3e2dd27..cb2a0d249b6 100644 --- a/ktor-network/nix/src/io/ktor/network/sockets/TCPServerSocketNative.kt +++ b/ktor-network/nix/src/io/ktor/network/sockets/TCPServerSocketNative.kt @@ -10,8 +10,8 @@ import kotlinx.cinterop.* import kotlinx.coroutines.* import platform.posix.* import kotlin.coroutines.* -import kotlin.native.concurrent.* +@OptIn(ExperimentalForeignApi::class) internal class TCPServerSocketNative( private val descriptor: Int, private val selectorManager: SelectorManager, diff --git a/ktor-network/nix/src/io/ktor/network/sockets/UDPSocketBuilderNative.kt b/ktor-network/nix/src/io/ktor/network/sockets/UDPSocketBuilderNative.kt index f3de7fca3d4..dd6210b211b 100644 --- a/ktor-network/nix/src/io/ktor/network/sockets/UDPSocketBuilderNative.kt +++ b/ktor-network/nix/src/io/ktor/network/sockets/UDPSocketBuilderNative.kt @@ -6,11 +6,10 @@ package io.ktor.network.sockets import io.ktor.network.selector.* import io.ktor.network.util.* -import io.ktor.util.network.* import kotlinx.cinterop.* import platform.posix.* -@OptIn(UnsafeNumber::class) +@OptIn(UnsafeNumber::class, ExperimentalForeignApi::class) internal actual fun UDPSocketBuilder.Companion.connectUDP( selector: SelectorManager, remoteAddress: SocketAddress, @@ -39,7 +38,7 @@ internal actual fun UDPSocketBuilder.Companion.connectUDP( ) } -@OptIn(UnsafeNumber::class) +@OptIn(UnsafeNumber::class, ExperimentalForeignApi::class) internal actual fun UDPSocketBuilder.Companion.bindUDP( selector: SelectorManager, localAddress: SocketAddress?, diff --git a/ktor-network/nix/src/io/ktor/network/util/NativeSocketAddress.kt b/ktor-network/nix/src/io/ktor/network/util/NativeSocketAddress.kt index d914282c0ba..03f3aec1862 100644 --- a/ktor-network/nix/src/io/ktor/network/util/NativeSocketAddress.kt +++ b/ktor-network/nix/src/io/ktor/network/util/NativeSocketAddress.kt @@ -13,6 +13,7 @@ import platform.posix.* */ @OptIn(UnsafeNumber::class) internal sealed class NativeSocketAddress(val family: sa_family_t) { + @OptIn(ExperimentalForeignApi::class) internal abstract fun nativeAddress(block: (address: CPointer, size: socklen_t) -> Unit) } @@ -37,6 +38,7 @@ internal class NativeIPv4SocketAddress( override fun toString(): String = "NativeIPv4SocketAddress[$ipString:$port]" + @ExperimentalForeignApi override fun nativeAddress(block: (address: CPointer, size: socklen_t) -> Unit) { cValue { sin_addr.s_addr = address @@ -47,6 +49,7 @@ internal class NativeIPv4SocketAddress( } } + @OptIn(ExperimentalForeignApi::class) override val ipString: String get() = memScoped { val string = allocArray(INET_ADDRSTRLEN) @@ -71,6 +74,7 @@ internal class NativeIPv6SocketAddress( private val flowInfo: uint32_t, private val scopeId: uint32_t ) : NativeInetSocketAddress(family, port) { + @ExperimentalForeignApi override fun nativeAddress(block: (address: CPointer, size: socklen_t) -> Unit) { cValue { sin6_family = family @@ -82,6 +86,7 @@ internal class NativeIPv6SocketAddress( } } + @OptIn(ExperimentalForeignApi::class) override val ipString: String get() = memScoped { val string = allocArray(INET6_ADDRSTRLEN) @@ -103,6 +108,7 @@ internal class NativeUnixSocketAddress( family: sa_family_t, val path: String, ) : NativeSocketAddress(family) { + @ExperimentalForeignApi override fun nativeAddress(block: (address: CPointer, size: socklen_t) -> Unit) { pack_sockaddr_un(family.convert(), path) { address, size -> block(address, size) diff --git a/ktor-network/nix/src/io/ktor/network/util/SocketAddressUtils.kt b/ktor-network/nix/src/io/ktor/network/util/SocketAddressUtils.kt index 4732919f2fa..0b76af75dce 100644 --- a/ktor-network/nix/src/io/ktor/network/util/SocketAddressUtils.kt +++ b/ktor-network/nix/src/io/ktor/network/util/SocketAddressUtils.kt @@ -13,8 +13,9 @@ internal val SocketAddress.address: NativeSocketAddress get() { return explicitAddress as? NativeSocketAddress ?: error("Failed to resolve address for $this") } -@OptIn(UnsafeNumber::class) +@OptIn(UnsafeNumber::class, ExperimentalForeignApi::class) internal fun SocketAddress.resolve(): List = when (this) { is InetSocketAddress -> getAddressInfo(hostname, port) is UnixSocketAddress -> listOf(NativeUnixSocketAddress(AF_UNIX.convert(), path)) + else -> error("Unsupported socket address: $this") } diff --git a/ktor-network/nix/src/io/ktor/network/util/SocketUtils.kt b/ktor-network/nix/src/io/ktor/network/util/SocketUtils.kt index dba5b88f538..3c5604435cf 100644 --- a/ktor-network/nix/src/io/ktor/network/util/SocketUtils.kt +++ b/ktor-network/nix/src/io/ktor/network/util/SocketUtils.kt @@ -8,6 +8,7 @@ import io.ktor.utils.io.bits.* import kotlinx.cinterop.* import platform.posix.* +@OptIn(ExperimentalForeignApi::class) internal fun getAddressInfo( hostname: String, portInfo: Int @@ -27,6 +28,7 @@ internal fun getAddressInfo( return result.pointed.toIpList() } +@OptIn(ExperimentalForeignApi::class) internal fun getLocalAddress(descriptor: Int): NativeSocketAddress = memScoped { val address = alloc() val length: UIntVarOf = alloc() @@ -37,6 +39,7 @@ internal fun getLocalAddress(descriptor: Int): NativeSocketAddress = memScoped { return@memScoped address.reinterpret().toNativeSocketAddress() } +@OptIn(ExperimentalForeignApi::class) internal fun getRemoteAddress(descriptor: Int): NativeSocketAddress = memScoped { val address = alloc() val length: UIntVarOf = alloc() @@ -47,6 +50,7 @@ internal fun getRemoteAddress(descriptor: Int): NativeSocketAddress = memScoped return@memScoped address.reinterpret().toNativeSocketAddress() } +@OptIn(ExperimentalForeignApi::class) internal fun addrinfo?.toIpList(): List { var current: addrinfo? = this val result = mutableListOf() @@ -59,7 +63,7 @@ internal fun addrinfo?.toIpList(): List { return result } -@OptIn(UnsafeNumber::class) +@OptIn(UnsafeNumber::class, ExperimentalForeignApi::class) internal fun sockaddr.toNativeSocketAddress(): NativeSocketAddress = when (sa_family.toInt()) { AF_INET -> { val address = ptr.reinterpret().pointed @@ -93,6 +97,7 @@ internal fun hostToNetworkOrder(value: UShort): UShort { return value.reverseByteOrder() } +@OptIn(ExperimentalForeignApi::class) internal expect fun ktor_inet_ntop( family: Int, src: CValuesRef<*>?, @@ -102,6 +107,7 @@ internal expect fun ktor_inet_ntop( internal expect fun unpack_sockaddr_un(sockaddr: sockaddr, block: (family: UShort, path: String) -> T): T +@OptIn(ExperimentalForeignApi::class) internal expect fun pack_sockaddr_un( family: UShort, path: String, diff --git a/ktor-network/watchos/src/io/ktor/network/util/SocketUtilsWatchos.kt b/ktor-network/watchos/src/io/ktor/network/util/SocketUtilsWatchos.kt index 6cb4094dbf6..97f84b0a1a8 100644 --- a/ktor-network/watchos/src/io/ktor/network/util/SocketUtilsWatchos.kt +++ b/ktor-network/watchos/src/io/ktor/network/util/SocketUtilsWatchos.kt @@ -13,6 +13,7 @@ internal actual fun unpack_sockaddr_un( error("Address ${sockaddr.sa_family} is not supported on watchos") } +@OptIn(ExperimentalForeignApi::class) internal actual fun pack_sockaddr_un( family: UShort, path: String, diff --git a/ktor-server/ktor-server-cio/jvmAndNix/test/io/ktor/tests/server/cio/RAWExample.kt b/ktor-server/ktor-server-cio/jvmAndNix/test/io/ktor/tests/server/cio/RAWExample.kt index b01edff5252..20fbe853444 100644 --- a/ktor-server/ktor-server-cio/jvmAndNix/test/io/ktor/tests/server/cio/RAWExample.kt +++ b/ktor-server/ktor-server-cio/jvmAndNix/test/io/ktor/tests/server/cio/RAWExample.kt @@ -12,7 +12,7 @@ import io.ktor.util.date.* import io.ktor.utils.io.* import io.ktor.utils.io.core.* import kotlinx.coroutines.* -import kotlin.jvm.* +import kotlin.concurrent.* @Volatile private var cachedDateText: String = GMTDate().toHttpDate() diff --git a/ktor-server/ktor-server-config-yaml/nix/src/io/ktor/server/config/yaml/YamlConfigNix.kt b/ktor-server/ktor-server-config-yaml/nix/src/io/ktor/server/config/yaml/YamlConfigNix.kt index 09d59ed220a..a1110ba8188 100644 --- a/ktor-server/ktor-server-config-yaml/nix/src/io/ktor/server/config/yaml/YamlConfigNix.kt +++ b/ktor-server/ktor-server-config-yaml/nix/src/io/ktor/server/config/yaml/YamlConfigNix.kt @@ -39,6 +39,7 @@ public actual fun YamlConfig(path: String?): YamlConfig? { return YamlConfig(yaml).apply { checkEnvironmentVariables() } } +@OptIn(ExperimentalForeignApi::class) private fun readFile(path: String): String { val fileDescriptor = fopen(path, "rb") ?: throw ApplicationConfigurationException("Can not read $path") val bytes = ByteArrayPool.borrow() @@ -62,7 +63,7 @@ private fun readFile(path: String): String { return packet.readText() } -@OptIn(UnsafeNumber::class) +@OptIn(UnsafeNumber::class, ExperimentalForeignApi::class) private fun CPointer.readFileChunk( bytes: ByteArray, size: Int @@ -70,4 +71,5 @@ private fun CPointer.readFileChunk( fread(pinned.addressOf(0), 1.convert(), size.convert(), this) }.convert() +@OptIn(ExperimentalForeignApi::class) internal actual fun getEnvironmentValue(key: String): String? = getenv(key)?.toKString() diff --git a/ktor-server/ktor-server-config-yaml/nix/test/YamlConfigTestNix.kt b/ktor-server/ktor-server-config-yaml/nix/test/YamlConfigTestNix.kt index e380861c97b..8736a154fc5 100644 --- a/ktor-server/ktor-server-config-yaml/nix/test/YamlConfigTestNix.kt +++ b/ktor-server/ktor-server-config-yaml/nix/test/YamlConfigTestNix.kt @@ -77,12 +77,12 @@ class YamlConfigTestNix { return result } - @OptIn(UnsafeNumber::class) + @OptIn(UnsafeNumber::class, ExperimentalForeignApi::class) private fun writeFile(path: String, content: String) { val file = fopen(path, "w") val bytes = content.toByteArray() bytes.usePinned { pinned -> - fwrite(pinned.addressOf(0), 1, bytes.size.convert(), file) + fwrite(pinned.addressOf(0), 1.convert(), bytes.size.convert(), file) } fclose(file) } diff --git a/ktor-server/ktor-server-core/api/ktor-server-core.api b/ktor-server/ktor-server-core/api/ktor-server-core.api index d97da6329e6..b0734a3d21c 100644 --- a/ktor-server/ktor-server-core/api/ktor-server-core.api +++ b/ktor-server/ktor-server-core/api/ktor-server-core.api @@ -356,6 +356,7 @@ public final class io/ktor/server/http/content/CompressedFileType : java/lang/En public static final field GZIP Lio/ktor/server/http/content/CompressedFileType; public final fun file (Ljava/io/File;)Ljava/io/File; public final fun getEncoding ()Ljava/lang/String; + public static fun getEntries ()Lkotlin/enums/EnumEntries; public final fun getExtension ()Ljava/lang/String; public static fun valueOf (Ljava/lang/String;)Lio/ktor/server/http/content/CompressedFileType; public static fun values ()[Lio/ktor/server/http/content/CompressedFileType; @@ -1307,6 +1308,7 @@ public final class io/ktor/server/routing/RoutingPathSegment { public final class io/ktor/server/routing/RoutingPathSegmentKind : java/lang/Enum { public static final field Constant Lio/ktor/server/routing/RoutingPathSegmentKind; public static final field Parameter Lio/ktor/server/routing/RoutingPathSegmentKind; + public static fun getEntries ()Lkotlin/enums/EnumEntries; public static fun valueOf (Ljava/lang/String;)Lio/ktor/server/routing/RoutingPathSegmentKind; public static fun values ()[Lio/ktor/server/routing/RoutingPathSegmentKind; } diff --git a/ktor-server/ktor-server-core/nix/src/io/ktor/server/config/ConfigLoadersNix.kt b/ktor-server/ktor-server-core/nix/src/io/ktor/server/config/ConfigLoadersNix.kt index 0ebef3d95fe..c78b7f9da25 100644 --- a/ktor-server/ktor-server-core/nix/src/io/ktor/server/config/ConfigLoadersNix.kt +++ b/ktor-server/ktor-server-core/nix/src/io/ktor/server/config/ConfigLoadersNix.kt @@ -12,6 +12,7 @@ internal actual val CONFIG_PATH: List get() = buildList { fromEnv("CONFIG_FILE")?.let { add(it) } } +@OptIn(ExperimentalForeignApi::class) private fun fromEnv(name: String): String? = getenv(name)?.toKString() /** diff --git a/ktor-server/ktor-server-host-common/nix/src/io/ktor/server/engine/EnvironmentUtilsNix.kt b/ktor-server/ktor-server-host-common/nix/src/io/ktor/server/engine/EnvironmentUtilsNix.kt index d68e2b6217a..6c2806ccf9b 100644 --- a/ktor-server/ktor-server-host-common/nix/src/io/ktor/server/engine/EnvironmentUtilsNix.kt +++ b/ktor-server/ktor-server-host-common/nix/src/io/ktor/server/engine/EnvironmentUtilsNix.kt @@ -21,6 +21,7 @@ internal actual fun ApplicationEngineEnvironmentBuilder.configureSSLConnectors( internal actual fun ApplicationEngineEnvironmentBuilder.configurePlatformProperties(args: Array) {} +@OptIn(ExperimentalForeignApi::class) internal actual fun getConfigFromEnvironment(): ApplicationConfig { var index = 0 val config = MapApplicationConfig() diff --git a/ktor-server/ktor-server-host-common/nix/src/io/ktor/server/engine/ServerEngineUtilsNix.kt b/ktor-server/ktor-server-host-common/nix/src/io/ktor/server/engine/ServerEngineUtilsNix.kt index d08532a36d7..0d5c3d50633 100644 --- a/ktor-server/ktor-server-host-common/nix/src/io/ktor/server/engine/ServerEngineUtilsNix.kt +++ b/ktor-server/ktor-server-host-common/nix/src/io/ktor/server/engine/ServerEngineUtilsNix.kt @@ -7,9 +7,9 @@ package io.ktor.server.engine import kotlinx.cinterop.* import platform.posix.* -@OptIn(UnsafeNumber::class) +@OptIn(UnsafeNumber::class, ExperimentalForeignApi::class) internal actual val WORKING_DIRECTORY_PATH: String get() = memScoped { val result = allocArray(512) - getcwd(result, 512) + getcwd(result, 512.convert()) result.toKString() } diff --git a/ktor-server/ktor-server-host-common/nix/src/io/ktor/server/engine/ShutdownHookNative.kt b/ktor-server/ktor-server-host-common/nix/src/io/ktor/server/engine/ShutdownHookNative.kt index 477ee8db822..6f26f98f8b8 100644 --- a/ktor-server/ktor-server-host-common/nix/src/io/ktor/server/engine/ShutdownHookNative.kt +++ b/ktor-server/ktor-server-host-common/nix/src/io/ktor/server/engine/ShutdownHookNative.kt @@ -6,9 +6,9 @@ package io.ktor.server.engine import kotlinx.cinterop.* import platform.posix.* -import kotlin.native.concurrent.* +import kotlin.concurrent.* -private val shutdownHook: FreezableAtomicReference<() -> Unit> = FreezableAtomicReference({}) +private val shutdownHook = AtomicReference {} /** * Adds automatic application shutdown hooks management. Should be used **before** starting the engine. @@ -17,6 +17,7 @@ private val shutdownHook: FreezableAtomicReference<() -> Unit> = FreezableAtomic * is already stopped then there will be no hook and no [stop] function invocation possible. * So [stop] block will be called once or never. */ +@OptIn(ExperimentalForeignApi::class) public actual fun ApplicationEngine.addShutdownHook(stop: () -> Unit) { shutdownHook.value = stop diff --git a/ktor-server/ktor-server-host-common/nix/src/io/ktor/server/engine/internal/ApplicationUtilsNix.kt b/ktor-server/ktor-server-host-common/nix/src/io/ktor/server/engine/internal/ApplicationUtilsNix.kt index a4dcd24e027..a03b050e230 100644 --- a/ktor-server/ktor-server-host-common/nix/src/io/ktor/server/engine/internal/ApplicationUtilsNix.kt +++ b/ktor-server/ktor-server-host-common/nix/src/io/ktor/server/engine/internal/ApplicationUtilsNix.kt @@ -6,6 +6,7 @@ package io.ktor.server.engine.internal import io.ktor.server.application.* import io.ktor.server.engine.* +import kotlinx.cinterop.* import kotlinx.coroutines.* import platform.posix.* @@ -13,6 +14,7 @@ internal actual fun availableProcessorsBridge(): Int = 1 internal actual val Dispatchers.IOBridge: CoroutineDispatcher get() = Default +@OptIn(ExperimentalForeignApi::class) internal actual fun printError(message: Any?) { fprintf(stderr, "%s", message?.toString()) } diff --git a/ktor-server/ktor-server-plugins/ktor-server-auth/api/ktor-server-auth.api b/ktor-server/ktor-server-plugins/ktor-server-auth/api/ktor-server-auth.api index ce44f63699d..4fbbc3d19f7 100644 --- a/ktor-server/ktor-server-plugins/ktor-server-auth/api/ktor-server-auth.api +++ b/ktor-server/ktor-server-plugins/ktor-server-auth/api/ktor-server-auth.api @@ -108,6 +108,7 @@ public final class io/ktor/server/auth/AuthenticationStrategy : java/lang/Enum { public static final field FirstSuccessful Lio/ktor/server/auth/AuthenticationStrategy; public static final field Optional Lio/ktor/server/auth/AuthenticationStrategy; public static final field Required Lio/ktor/server/auth/AuthenticationStrategy; + public static fun getEntries ()Lkotlin/enums/EnumEntries; public static fun valueOf (Ljava/lang/String;)Lio/ktor/server/auth/AuthenticationStrategy; public static fun values ()[Lio/ktor/server/auth/AuthenticationStrategy; } @@ -486,6 +487,7 @@ public final class io/ktor/server/auth/OAuthServerSettings$OAuth2ServerSettings public final class io/ktor/server/auth/OAuthVersion : java/lang/Enum { public static final field V10a Lio/ktor/server/auth/OAuthVersion; public static final field V20 Lio/ktor/server/auth/OAuthVersion; + public static fun getEntries ()Lkotlin/enums/EnumEntries; public static fun valueOf (Ljava/lang/String;)Lio/ktor/server/auth/OAuthVersion; public static fun values ()[Lio/ktor/server/auth/OAuthVersion; } diff --git a/ktor-server/ktor-server-plugins/ktor-server-call-logging/jvm/test/io/ktor/server/plugins/callloging/CallLoggingTest.kt b/ktor-server/ktor-server-plugins/ktor-server-call-logging/jvm/test/io/ktor/server/plugins/callloging/CallLoggingTest.kt index 515f5e50ed3..0ae8c8581c3 100644 --- a/ktor-server/ktor-server-plugins/ktor-server-call-logging/jvm/test/io/ktor/server/plugins/callloging/CallLoggingTest.kt +++ b/ktor-server/ktor-server-plugins/ktor-server-call-logging/jvm/test/io/ktor/server/plugins/callloging/CallLoggingTest.kt @@ -73,26 +73,26 @@ class CallLoggingTest { testApplication { environment { environment() } application { - hash = this.toString() + hash = hashCode().toString(radix = 16) } } assertTrue(messages.size >= 3, "It should be at least 3 message logged:\n$messages") - assertEquals( - "INFO: Application started: $hash", - messages[messages.size - 3], - "No started message logged:\n$messages" - ) - assertEquals( - "INFO: Application stopping: $hash", - messages[messages.size - 2], - "No stopping message logged:\n$messages" - ) - assertEquals( - "INFO: Application stopped: $hash", - messages[messages.size - 1], - "No stopped message logged:\n$messages" - ) + assertTrue { + messages[messages.size - 3].startsWith( + "INFO: Application started: class io.ktor.server.application.Application(0x$hash)" + ) + } + assertTrue { + messages[messages.size - 2].startsWith( + "INFO: Application stopping: class io.ktor.server.application.Application(0x$hash)" + ) + } + assertTrue { + messages[messages.size - 1].startsWith( + "INFO: Application stopped: class io.ktor.server.application.Application(0x$hash)" + ) + } } @Test @@ -374,7 +374,7 @@ class CallLoggingTest { } } } - var hash: String? = null + lateinit var hash: String testApplication { environment { @@ -385,11 +385,11 @@ class CallLoggingTest { } } } - application { hash = this.toString() } + application { hash = hashCode().toString(radix = 16) } } assertTrue(customMessages.isNotEmpty()) - assertTrue(customMessages.all { it.startsWith("CUSTOM TRACE:") && it.contains(hash!!) }) + assertTrue(customMessages.all { it.startsWith("CUSTOM TRACE:") && it.contains(hash) }) assertTrue(messages.isEmpty()) } diff --git a/ktor-server/ktor-server-plugins/ktor-server-jte/build.gradle.kts b/ktor-server/ktor-server-plugins/ktor-server-jte/build.gradle.kts index 7a805708671..51b54c0819e 100644 --- a/ktor-server/ktor-server-plugins/ktor-server-jte/build.gradle.kts +++ b/ktor-server/ktor-server-plugins/ktor-server-jte/build.gradle.kts @@ -4,12 +4,12 @@ kotlin.sourceSets { val jteVersion = "2.3.2" - val jvmMain by getting { + jvmMain { dependencies { api("gg.jte:jte:$jteVersion") } } - val jvmTest by getting { + jvmTest { dependencies { api(project(":ktor-server:ktor-server-plugins:ktor-server-status-pages")) api(project(":ktor-server:ktor-server-plugins:ktor-server-compression")) diff --git a/ktor-server/ktor-server-test-host/jvm/src/io/ktor/server/testing/HighLoadHttpGenerator.kt b/ktor-server/ktor-server-test-host/jvm/src/io/ktor/server/testing/HighLoadHttpGenerator.kt index 4f1606c8b45..73382b678a3 100644 --- a/ktor-server/ktor-server-test-host/jvm/src/io/ktor/server/testing/HighLoadHttpGenerator.kt +++ b/ktor-server/ktor-server-test-host/jvm/src/io/ktor/server/testing/HighLoadHttpGenerator.kt @@ -5,7 +5,7 @@ package io.ktor.server.testing import io.ktor.http.* -import io.ktor.http.cio.RequestResponseBuilder +import io.ktor.http.cio.* import io.ktor.utils.io.core.* import java.net.* import java.nio.* @@ -75,9 +75,11 @@ public class HighLoadHttpGenerator( private val writeErrors = AtomicLong() private val connectErrors = AtomicLong() + @OptIn(kotlin.ExperimentalStdlibApi::class) @Volatile private var cancelled = false + @OptIn(kotlin.ExperimentalStdlibApi::class) @Volatile private var shutdown = false diff --git a/ktor-server/ktor-server-test-suites/jvm/src/io/ktor/server/testing/suites/ContentTestSuite.kt b/ktor-server/ktor-server-test-suites/jvm/src/io/ktor/server/testing/suites/ContentTestSuite.kt index 92c6ad56f79..cc4423a91a0 100644 --- a/ktor-server/ktor-server-test-suites/jvm/src/io/ktor/server/testing/suites/ContentTestSuite.kt +++ b/ktor-server/ktor-server-test-suites/jvm/src/io/ktor/server/testing/suites/ContentTestSuite.kt @@ -224,9 +224,11 @@ abstract class ContentTestSuite { val size = collect_stack(thread) if (size < 0) throw IllegalArgumentException("Thread is stopped") diff --git a/ktor-utils/linux/src/io/ktor/util/ThreadInfoLinux.kt b/ktor-utils/linux/src/io/ktor/util/ThreadInfoLinux.kt index 91b97af16ad..616e0dec14b 100644 --- a/ktor-utils/linux/src/io/ktor/util/ThreadInfoLinux.kt +++ b/ktor-utils/linux/src/io/ktor/util/ThreadInfoLinux.kt @@ -9,6 +9,7 @@ import platform.linux.* import platform.posix.* import threadUtils.* +@OptIn(ExperimentalForeignApi::class) internal actual fun collectStack(thread: pthread_t): List { val size = collect_stack(thread) if (size < 0) throw IllegalArgumentException("Thread is stopped") diff --git a/ktor-utils/mingwX64/src/io/ktor/util/CryptoMingw.kt b/ktor-utils/mingwX64/src/io/ktor/util/CryptoMingw.kt index 1e8a853e599..d69089086d0 100644 --- a/ktor-utils/mingwX64/src/io/ktor/util/CryptoMingw.kt +++ b/ktor-utils/mingwX64/src/io/ktor/util/CryptoMingw.kt @@ -7,14 +7,14 @@ package io.ktor.util import kotlinx.cinterop.* import platform.windows.* -@OptIn(ExperimentalUnsignedTypes::class) +@OptIn(ExperimentalUnsignedTypes::class, ExperimentalForeignApi::class) internal actual fun secureRandom(bytes: ByteArray) { bytes.toUByteArray().usePinned { pinned -> val result = BCryptGenRandom( null, pinned.addressOf(0), bytes.size.convert(), - BCRYPT_USE_SYSTEM_PREFERRED_RNG + BCRYPT_USE_SYSTEM_PREFERRED_RNG.convert() ) if (result != 0) { error("Can't generate random values using BCryptGenRandom: $result") diff --git a/ktor-utils/mingwX64/src/io/ktor/util/date/DateMingw.kt b/ktor-utils/mingwX64/src/io/ktor/util/date/DateMingw.kt index 11ddb644d8c..b8df3367a4d 100644 --- a/ktor-utils/mingwX64/src/io/ktor/util/date/DateMingw.kt +++ b/ktor-utils/mingwX64/src/io/ktor/util/date/DateMingw.kt @@ -8,6 +8,7 @@ import kotlinx.cinterop.* import platform.posix.* import platform.windows.* +@OptIn(ExperimentalForeignApi::class) @Suppress("FunctionName") internal actual fun system_time(tm: CValuesRef?): Long { return _mkgmtime(tm).convert() @@ -17,6 +18,7 @@ internal actual fun system_time(tm: CValuesRef?): Long { * Gets current system time in milliseconds since a certain moment in the past, * only delta between two subsequent calls makes sense. */ +@OptIn(ExperimentalForeignApi::class) public actual fun getTimeMillis(): Long = memScoped { val timeHolder = alloc() GetSystemTimeAsFileTime(timeHolder.ptr) diff --git a/ktor-utils/nix/src/io/ktor/util/CryptoPosix.kt b/ktor-utils/nix/src/io/ktor/util/CryptoPosix.kt index e6bfd02e6bb..b48538c2ea9 100644 --- a/ktor-utils/nix/src/io/ktor/util/CryptoPosix.kt +++ b/ktor-utils/nix/src/io/ktor/util/CryptoPosix.kt @@ -7,7 +7,7 @@ package io.ktor.util import kotlinx.cinterop.* import platform.posix.* -@OptIn(ExperimentalUnsignedTypes::class, UnsafeNumber::class) +@OptIn(ExperimentalUnsignedTypes::class, UnsafeNumber::class, ExperimentalForeignApi::class) internal actual fun secureRandom(bytes: ByteArray) { val fd = fopen("/dev/urandom", "rb") ?: return val size = bytes.size diff --git a/ktor-utils/nix/src/io/ktor/util/date/DateNix.kt b/ktor-utils/nix/src/io/ktor/util/date/DateNix.kt index 944cb38538e..f1d9766f4a4 100644 --- a/ktor-utils/nix/src/io/ktor/util/date/DateNix.kt +++ b/ktor-utils/nix/src/io/ktor/util/date/DateNix.kt @@ -8,14 +8,14 @@ import kotlinx.cinterop.* import platform.posix.* @Suppress("FunctionName") -@OptIn(UnsafeNumber::class) +@OptIn(UnsafeNumber::class, ExperimentalForeignApi::class) internal actual fun system_time(tm: CValuesRef?): Long = timegm(tm).convert() /** * Gets current system time in milliseconds since a certain moment in the past, * only delta between two subsequent calls makes sense. */ -@OptIn(UnsafeNumber::class) +@OptIn(UnsafeNumber::class, ExperimentalForeignApi::class) public actual fun getTimeMillis(): Long = memScoped { val timeHolder = alloc() clock_gettime(CLOCK_REALTIME.convert(), timeHolder.ptr) diff --git a/ktor-utils/posix/src/io/ktor/util/CoroutineUtils.kt b/ktor-utils/posix/src/io/ktor/util/CoroutineUtils.kt index a9f5c8a0098..889bb2a4eda 100644 --- a/ktor-utils/posix/src/io/ktor/util/CoroutineUtils.kt +++ b/ktor-utils/posix/src/io/ktor/util/CoroutineUtils.kt @@ -14,15 +14,20 @@ import kotlin.native.concurrent.* public fun Dispatchers.createFixedThreadDispatcher(name: String, threads: Int): CloseableCoroutineDispatcher = MultiWorkerDispatcher(name, threads) +@OptIn(ObsoleteWorkersApi::class) private val CLOSE_WORKER: Worker by lazy { Worker.start(name = "CLOSE_WORKER") } -@OptIn(InternalAPI::class) +@OptIn(InternalAPI::class, ObsoleteWorkersApi::class) private class MultiWorkerDispatcher(name: String, workersCount: Int) : CloseableCoroutineDispatcher() { private val closed = atomic(false) private val tasksQueue = Channel(Channel.UNLIMITED) + + @OptIn(ObsoleteWorkersApi::class) private val workers = Array(workersCount) { Worker.start(name = "$name-$it") } + + @OptIn(ObsoleteWorkersApi::class) private val futures = mutableListOf>() init { diff --git a/ktor-utils/posix/src/io/ktor/util/ThreadInfo.kt b/ktor-utils/posix/src/io/ktor/util/ThreadInfo.kt index 3f9d0036867..16a4a75a871 100644 --- a/ktor-utils/posix/src/io/ktor/util/ThreadInfo.kt +++ b/ktor-utils/posix/src/io/ktor/util/ThreadInfo.kt @@ -5,7 +5,9 @@ package io.ktor.util import io.ktor.util.collections.* +import kotlinx.cinterop.* import platform.posix.* +import kotlin.experimental.* import kotlin.native.concurrent.* @Suppress("DEPRECATION") @@ -14,6 +16,7 @@ import kotlin.native.concurrent.* private val init = setSignalHandler() @InternalAPI +@OptIn(ObsoleteWorkersApi::class, ExperimentalForeignApi::class) public object ThreadInfo { private val threads = ConcurrentMap(initialCapacity = 32) @@ -21,16 +24,19 @@ public object ThreadInfo { init } + @OptIn(ObsoleteWorkersApi::class, ExperimentalForeignApi::class) public fun registerCurrentThread() { @Suppress("UNNECESSARY_NOT_NULL_ASSERTION") val thread = pthread_self()!! threads[Worker.current] = thread } + @OptIn(ObsoleteWorkersApi::class) public fun dropWorker(worker: Worker) { threads.remove(worker) } + @OptIn(ExperimentalNativeApi::class, ObsoleteWorkersApi::class) public fun getAllStackTraces(): List { if (kotlin.native.Platform.osFamily == OsFamily.WINDOWS) return emptyList() @@ -62,6 +68,7 @@ public object ThreadInfo { } } + @OptIn(ObsoleteWorkersApi::class) public fun stopAllWorkers() { for (worker in threads.keys) { if (worker == Worker.current) continue @@ -79,6 +86,7 @@ public class WorkerStacktrace( public val stacktrace: List ) +@OptIn(kotlinx.cinterop.ExperimentalForeignApi::class) internal expect fun collectStack(thread: pthread_t): List internal expect fun setSignalHandler() diff --git a/ktor-utils/posix/src/io/ktor/util/date/DateNative.kt b/ktor-utils/posix/src/io/ktor/util/date/DateNative.kt index 3ce00a409e9..7276a4e5701 100644 --- a/ktor-utils/posix/src/io/ktor/util/date/DateNative.kt +++ b/ktor-utils/posix/src/io/ktor/util/date/DateNative.kt @@ -11,7 +11,7 @@ import platform.posix.* * Create new gmt date from the [timestamp]. * @param timestamp is a number of epoch milliseconds (it is `now` by default). */ -@OptIn(UnsafeNumber::class) +@OptIn(UnsafeNumber::class, ExperimentalForeignApi::class) public actual fun GMTDate(timestamp: Long?): GMTDate = memScoped { val timeHolder = alloc() val current: Long = if (timestamp == null) { @@ -48,6 +48,7 @@ public actual fun GMTDate(timestamp: Long?): GMTDate = memScoped { /** * Create an instance of [GMTDate] from the specified date/time components */ +@OptIn(ExperimentalForeignApi::class) public actual fun GMTDate( seconds: Int, minutes: Int, @@ -76,5 +77,6 @@ public actual fun GMTDate( return GMTDate(timestamp * 1000L) } +@OptIn(ExperimentalForeignApi::class) @Suppress("FunctionName") internal expect fun system_time(tm: CValuesRef?): Long diff --git a/ktor-utils/posix/src/io/ktor/util/logging/KtorSimpleLoggerNative.kt b/ktor-utils/posix/src/io/ktor/util/logging/KtorSimpleLoggerNative.kt index 67a997cdcdf..09d469fc741 100644 --- a/ktor-utils/posix/src/io/ktor/util/logging/KtorSimpleLoggerNative.kt +++ b/ktor-utils/posix/src/io/ktor/util/logging/KtorSimpleLoggerNative.kt @@ -9,6 +9,7 @@ import platform.posix.* private val KTOR_LOG_LEVEL_KEY = "KTOR_LOG_LEVEL" +@OptIn(ExperimentalForeignApi::class) @Suppress("FunctionName") public actual fun KtorSimpleLogger( name: String @@ -16,7 +17,7 @@ public actual fun KtorSimpleLogger( override val level: LogLevel = getenv(KTOR_LOG_LEVEL_KEY)?.let { rawLevel -> val level = rawLevel.toKString() - LogLevel.values().firstOrNull { it.name == level } + LogLevel.entries.firstOrNull { it.name == level } } ?: LogLevel.INFO private fun log(level: LogLevel, message: String) { diff --git a/ktor-utils/posix/src/io/ktor/util/pipeline/PipelineContext.posix.kt b/ktor-utils/posix/src/io/ktor/util/pipeline/PipelineContext.posix.kt index 2fca05275c0..26f0c165652 100644 --- a/ktor-utils/posix/src/io/ktor/util/pipeline/PipelineContext.posix.kt +++ b/ktor-utils/posix/src/io/ktor/util/pipeline/PipelineContext.posix.kt @@ -7,4 +7,5 @@ package io.ktor.util.pipeline import kotlinx.cinterop.* import platform.posix.* +@OptIn(ExperimentalForeignApi::class) internal actual val DISABLE_SFG: Boolean = getenv("KTOR_INTERNAL_DISABLE_SFG")?.toKString() == "true"