Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget

plugins {
kotlin("multiplatform"){{^omitGradlePluginVersions}} version "2.0.21" // kotlin_version{{/omitGradlePluginVersions}}
kotlin("plugin.serialization"){{^omitGradlePluginVersions}} version "2.0.21" // kotlin_version{{/omitGradlePluginVersions}}
kotlin("multiplatform"){{^omitGradlePluginVersions}} version "2.1.21" // kotlin_version{{/omitGradlePluginVersions}}
kotlin("plugin.serialization"){{^omitGradlePluginVersions}} version "2.1.21" // kotlin_version{{/omitGradlePluginVersions}}
}

group = "{{groupId}}"
version = "{{artifactVersion}}"

val kotlin_version = "2.0.21"
val coroutines_version = "1.9.0"
val serialization_version = "1.7.3"
val ktor_version = "3.0.3"
val kotlin_version = "2.1.21"
val coroutines_version = "1.10.2"
val serialization_version = "1.8.1"
val ktor_version = "3.1.3"

repositories {
mavenCentral()
Expand Down Expand Up @@ -43,7 +43,7 @@ kotlin {
api("io.ktor:ktor-serialization-kotlinx-json:$ktor_version")

{{#kotlinx-datetime}}
api("org.jetbrains.kotlinx:kotlinx-datetime:0.4.1")
api("org.jetbrains.kotlinx:kotlinx-datetime:0.6.2")
{{/kotlinx-datetime}}
}
}
Expand Down Expand Up @@ -79,12 +79,6 @@ kotlin {
api("io.ktor:ktor-client-js:$ktor_version")
}
}

all {
languageSettings.apply {
optIn("kotlin.Experimental")
}
}
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package {{packageName}}.infrastructure

import io.ktor.utils.io.core.*
import kotlinx.io.Source
import kotlinx.io.readByteArray
import kotlin.experimental.and

private val digits = "0123456789abcdef".toCharArray()
Expand All @@ -14,7 +16,8 @@ private fun ByteArray.clearFrom(from: Int) = (from until size).forEach { this[it
private fun Int.toBase64(): Char = BASE64_ALPHABET[this]
private fun Byte.fromBase64(): Byte = BASE64_INVERSE_ALPHABET[toInt() and 0xff].toByte() and BASE64_MASK
internal fun ByteArray.encodeBase64(): String = buildPacket { writeFully(this@encodeBase64) }.encodeBase64()
internal fun String.decodeBase64Bytes(): ByteArray = buildPacket { writeText(dropLastWhile { it == BASE64_PAD }) }.decodeBase64Bytes().readBytes()
internal fun String.decodeBase64Bytes(): ByteArray =
buildPacket { writeText(dropLastWhile { it == BASE64_PAD }) }.decodeBase64Bytes().readByteArray()

/**
* Encode [bytes] as a HEX string with no spaces, newlines and `0x` prefixes.
Expand Down Expand Up @@ -57,7 +60,7 @@ internal fun hex(s: String): ByteArray {
*
* Taken from https://github.com/ktorio/ktor/blob/424d1d2cfaa3281302c60af9500f738c8c2fc846/ktor-utils/common/src/io/ktor/util/Base64.kt
*/
private fun ByteReadPacket.encodeBase64(): String = buildString {
private fun Source.encodeBase64(): String = buildString {
val data = ByteArray(3)
while (remaining > 0) {
val read = readAvailable(data)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget

plugins {
kotlin("multiplatform") version "2.0.21" // kotlin_version
kotlin("plugin.serialization") version "2.0.21" // kotlin_version
kotlin("multiplatform") version "2.1.21" // kotlin_version
kotlin("plugin.serialization") version "2.1.21" // kotlin_version
}

group = "org.openapitools"
version = "1.0.0"

val kotlin_version = "2.0.21"
val coroutines_version = "1.9.0"
val serialization_version = "1.7.3"
val ktor_version = "3.0.3"
val kotlin_version = "2.1.21"
val coroutines_version = "1.10.2"
val serialization_version = "1.8.1"
val ktor_version = "3.1.3"

repositories {
mavenCentral()
Expand All @@ -38,7 +38,7 @@ kotlin {
api("io.ktor:ktor-client-content-negotiation:$ktor_version")
api("io.ktor:ktor-serialization-kotlinx-json:$ktor_version")

api("org.jetbrains.kotlinx:kotlinx-datetime:0.4.1")
api("org.jetbrains.kotlinx:kotlinx-datetime:0.6.2")
}
}

Expand Down Expand Up @@ -73,12 +73,6 @@ kotlin {
api("io.ktor:ktor-client-js:$ktor_version")
}
}

all {
languageSettings.apply {
optIn("kotlin.Experimental")
}
}
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package org.openapitools.client.infrastructure

import io.ktor.utils.io.core.*
import kotlinx.io.Source
import kotlinx.io.readByteArray
import kotlin.experimental.and

private val digits = "0123456789abcdef".toCharArray()
Expand All @@ -14,7 +16,8 @@ private fun ByteArray.clearFrom(from: Int) = (from until size).forEach { this[it
private fun Int.toBase64(): Char = BASE64_ALPHABET[this]
private fun Byte.fromBase64(): Byte = BASE64_INVERSE_ALPHABET[toInt() and 0xff].toByte() and BASE64_MASK
internal fun ByteArray.encodeBase64(): String = buildPacket { writeFully(this@encodeBase64) }.encodeBase64()
internal fun String.decodeBase64Bytes(): ByteArray = buildPacket { writeText(dropLastWhile { it == BASE64_PAD }) }.decodeBase64Bytes().readBytes()
internal fun String.decodeBase64Bytes(): ByteArray =
buildPacket { writeText(dropLastWhile { it == BASE64_PAD }) }.decodeBase64Bytes().readByteArray()

/**
* Encode [bytes] as a HEX string with no spaces, newlines and `0x` prefixes.
Expand Down Expand Up @@ -57,7 +60,7 @@ internal fun hex(s: String): ByteArray {
*
* Taken from https://github.com/ktorio/ktor/blob/424d1d2cfaa3281302c60af9500f738c8c2fc846/ktor-utils/common/src/io/ktor/util/Base64.kt
*/
private fun ByteReadPacket.encodeBase64(): String = buildString {
private fun Source.encodeBase64(): String = buildString {
val data = ByteArray(3)
while (remaining > 0) {
val read = readAvailable(data)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget

plugins {
kotlin("multiplatform") version "2.0.21" // kotlin_version
kotlin("plugin.serialization") version "2.0.21" // kotlin_version
kotlin("multiplatform") version "2.1.21" // kotlin_version
kotlin("plugin.serialization") version "2.1.21" // kotlin_version
}

group = "org.openapitools"
version = "1.0.0"

val kotlin_version = "2.0.21"
val coroutines_version = "1.9.0"
val serialization_version = "1.7.3"
val ktor_version = "3.0.3"
val kotlin_version = "2.1.21"
val coroutines_version = "1.10.2"
val serialization_version = "1.8.1"
val ktor_version = "3.1.3"

repositories {
mavenCentral()
Expand All @@ -38,7 +38,7 @@ kotlin {
api("io.ktor:ktor-client-content-negotiation:$ktor_version")
api("io.ktor:ktor-serialization-kotlinx-json:$ktor_version")

api("org.jetbrains.kotlinx:kotlinx-datetime:0.4.1")
api("org.jetbrains.kotlinx:kotlinx-datetime:0.6.2")
}
}

Expand Down Expand Up @@ -73,12 +73,6 @@ kotlin {
api("io.ktor:ktor-client-js:$ktor_version")
}
}

all {
languageSettings.apply {
optIn("kotlin.Experimental")
}
}
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package org.openapitools.client.infrastructure

import io.ktor.utils.io.core.*
import kotlinx.io.Source
import kotlinx.io.readByteArray
import kotlin.experimental.and

private val digits = "0123456789abcdef".toCharArray()
Expand All @@ -14,7 +16,8 @@ private fun ByteArray.clearFrom(from: Int) = (from until size).forEach { this[it
private fun Int.toBase64(): Char = BASE64_ALPHABET[this]
private fun Byte.fromBase64(): Byte = BASE64_INVERSE_ALPHABET[toInt() and 0xff].toByte() and BASE64_MASK
internal fun ByteArray.encodeBase64(): String = buildPacket { writeFully(this@encodeBase64) }.encodeBase64()
internal fun String.decodeBase64Bytes(): ByteArray = buildPacket { writeText(dropLastWhile { it == BASE64_PAD }) }.decodeBase64Bytes().readBytes()
internal fun String.decodeBase64Bytes(): ByteArray =
buildPacket { writeText(dropLastWhile { it == BASE64_PAD }) }.decodeBase64Bytes().readByteArray()

/**
* Encode [bytes] as a HEX string with no spaces, newlines and `0x` prefixes.
Expand Down Expand Up @@ -57,7 +60,7 @@ internal fun hex(s: String): ByteArray {
*
* Taken from https://github.com/ktorio/ktor/blob/424d1d2cfaa3281302c60af9500f738c8c2fc846/ktor-utils/common/src/io/ktor/util/Base64.kt
*/
private fun ByteReadPacket.encodeBase64(): String = buildString {
private fun Source.encodeBase64(): String = buildString {
val data = ByteArray(3)
while (remaining > 0) {
val read = readAvailable(data)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget

plugins {
kotlin("multiplatform") version "2.0.21" // kotlin_version
kotlin("plugin.serialization") version "2.0.21" // kotlin_version
kotlin("multiplatform") version "2.1.21" // kotlin_version
kotlin("plugin.serialization") version "2.1.21" // kotlin_version
}

group = "org.openapitools"
version = "1.0.0"

val kotlin_version = "2.0.21"
val coroutines_version = "1.9.0"
val serialization_version = "1.7.3"
val ktor_version = "3.0.3"
val kotlin_version = "2.1.21"
val coroutines_version = "1.10.2"
val serialization_version = "1.8.1"
val ktor_version = "3.1.3"

repositories {
mavenCentral()
Expand All @@ -38,7 +38,7 @@ kotlin {
api("io.ktor:ktor-client-content-negotiation:$ktor_version")
api("io.ktor:ktor-serialization-kotlinx-json:$ktor_version")

api("org.jetbrains.kotlinx:kotlinx-datetime:0.4.1")
api("org.jetbrains.kotlinx:kotlinx-datetime:0.6.2")
}
}

Expand Down Expand Up @@ -73,12 +73,6 @@ kotlin {
api("io.ktor:ktor-client-js:$ktor_version")
}
}

all {
languageSettings.apply {
optIn("kotlin.Experimental")
}
}
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package org.openapitools.client.infrastructure

import io.ktor.utils.io.core.*
import kotlinx.io.Source
import kotlinx.io.readByteArray
import kotlin.experimental.and

private val digits = "0123456789abcdef".toCharArray()
Expand All @@ -14,7 +16,8 @@ private fun ByteArray.clearFrom(from: Int) = (from until size).forEach { this[it
private fun Int.toBase64(): Char = BASE64_ALPHABET[this]
private fun Byte.fromBase64(): Byte = BASE64_INVERSE_ALPHABET[toInt() and 0xff].toByte() and BASE64_MASK
internal fun ByteArray.encodeBase64(): String = buildPacket { writeFully(this@encodeBase64) }.encodeBase64()
internal fun String.decodeBase64Bytes(): ByteArray = buildPacket { writeText(dropLastWhile { it == BASE64_PAD }) }.decodeBase64Bytes().readBytes()
internal fun String.decodeBase64Bytes(): ByteArray =
buildPacket { writeText(dropLastWhile { it == BASE64_PAD }) }.decodeBase64Bytes().readByteArray()

/**
* Encode [bytes] as a HEX string with no spaces, newlines and `0x` prefixes.
Expand Down Expand Up @@ -57,7 +60,7 @@ internal fun hex(s: String): ByteArray {
*
* Taken from https://github.com/ktorio/ktor/blob/424d1d2cfaa3281302c60af9500f738c8c2fc846/ktor-utils/common/src/io/ktor/util/Base64.kt
*/
private fun ByteReadPacket.encodeBase64(): String = buildString {
private fun Source.encodeBase64(): String = buildString {
val data = ByteArray(3)
while (remaining > 0) {
val read = readAvailable(data)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget

plugins {
kotlin("multiplatform") version "2.0.21" // kotlin_version
kotlin("plugin.serialization") version "2.0.21" // kotlin_version
kotlin("multiplatform") version "2.1.21" // kotlin_version
kotlin("plugin.serialization") version "2.1.21" // kotlin_version
}

group = "org.openapitools"
version = "1.0.0"

val kotlin_version = "2.0.21"
val coroutines_version = "1.9.0"
val serialization_version = "1.7.3"
val ktor_version = "3.0.3"
val kotlin_version = "2.1.21"
val coroutines_version = "1.10.2"
val serialization_version = "1.8.1"
val ktor_version = "3.1.3"

repositories {
mavenCentral()
Expand All @@ -38,7 +38,7 @@ kotlin {
api("io.ktor:ktor-client-content-negotiation:$ktor_version")
api("io.ktor:ktor-serialization-kotlinx-json:$ktor_version")

api("org.jetbrains.kotlinx:kotlinx-datetime:0.4.1")
api("org.jetbrains.kotlinx:kotlinx-datetime:0.6.2")
}
}

Expand Down Expand Up @@ -73,12 +73,6 @@ kotlin {
api("io.ktor:ktor-client-js:$ktor_version")
}
}

all {
languageSettings.apply {
optIn("kotlin.Experimental")
}
}
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package org.openapitools.client.infrastructure

import io.ktor.utils.io.core.*
import kotlinx.io.Source
import kotlinx.io.readByteArray
import kotlin.experimental.and

private val digits = "0123456789abcdef".toCharArray()
Expand All @@ -14,7 +16,8 @@ private fun ByteArray.clearFrom(from: Int) = (from until size).forEach { this[it
private fun Int.toBase64(): Char = BASE64_ALPHABET[this]
private fun Byte.fromBase64(): Byte = BASE64_INVERSE_ALPHABET[toInt() and 0xff].toByte() and BASE64_MASK
internal fun ByteArray.encodeBase64(): String = buildPacket { writeFully(this@encodeBase64) }.encodeBase64()
internal fun String.decodeBase64Bytes(): ByteArray = buildPacket { writeText(dropLastWhile { it == BASE64_PAD }) }.decodeBase64Bytes().readBytes()
internal fun String.decodeBase64Bytes(): ByteArray =
buildPacket { writeText(dropLastWhile { it == BASE64_PAD }) }.decodeBase64Bytes().readByteArray()

/**
* Encode [bytes] as a HEX string with no spaces, newlines and `0x` prefixes.
Expand Down Expand Up @@ -57,7 +60,7 @@ internal fun hex(s: String): ByteArray {
*
* Taken from https://github.com/ktorio/ktor/blob/424d1d2cfaa3281302c60af9500f738c8c2fc846/ktor-utils/common/src/io/ktor/util/Base64.kt
*/
private fun ByteReadPacket.encodeBase64(): String = buildString {
private fun Source.encodeBase64(): String = buildString {
val data = ByteArray(3)
while (remaining > 0) {
val read = readAvailable(data)
Expand Down
Loading
Loading