Skip to content

Commit ea991fc

Browse files
committed
Merge remote-tracking branch 'origin/master' into composite_products
# Conflicts: # src/main/kotlin/com/ecwid/apiclient/v3/dto/order/result/FetchedOrder.kt # src/test/kotlin/com/ecwid/apiclient/v3/rule/nullablepropertyrules/FetchedOrderRules.kt
2 parents 5e25e2f + bcc7cf1 commit ea991fc

21 files changed

+482
-20
lines changed

build.gradle.kts

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ dependencies {
2626

2727
api("com.google.code.gson:gson:2.10")
2828
api("org.apache.httpcomponents:httpclient:4.5.13")
29+
api("org.apache.httpcomponents.client5:httpclient5:5.5")
2930
api("io.prometheus:prometheus-metrics-core:1.1.0")
3031

3132
testImplementation(kotlin("test"))
@@ -206,6 +207,8 @@ nexusPublishing {
206207
useStaging.set(!project.isSnapshotVersion())
207208
packageGroup.set(PublicationSettings.STAGING_PACKAGE_GROUP)
208209
stagingProfileId.set(PublicationSettings.STAGING_PROFILE_ID)
210+
nexusUrl.set(uri("https://ossrh-staging-api.central.sonatype.com/service/local/"))
211+
snapshotRepositoryUrl.set(uri("https://central.sonatype.com/repository/maven-snapshots/"))
209212
username.set(settingsProvider.ossrhUsername)
210213
password.set(settingsProvider.ossrhPassword)
211214
}
@@ -251,12 +254,6 @@ fun printFinalReleaseNote(groupId: String, artifactId: String, sanitizedVersion:
251254
println("Discover on Maven Central:")
252255
println(" https://repo1.maven.org/maven2/${groupId.replace('.', '/')}/$artifactId/")
253256
println()
254-
println("Edit or delete artifacts on OSS Nexus Repository Manager:")
255-
println(" https://oss.sonatype.org/#nexus-search;gav~$groupId~~~~")
256-
println()
257-
println("Control staging repositories on OSS Nexus Repository Manager:")
258-
println(" https://oss.sonatype.org/#stagingRepositories")
259-
println()
260257
println("========================================================")
261258
println()
262259
}
@@ -271,10 +268,7 @@ fun printDevSnapshotReleaseNote(groupId: String, artifactId: String, sanitizedVe
271268
println(" version: $sanitizedVersion")
272269
println()
273270
println("Discover on Maven Central:")
274-
println(" https://oss.sonatype.org/content/groups/public/${groupId.replace('.', '/')}/$artifactId/")
275-
println()
276-
println("Edit or delete artifacts on OSS Nexus Repository Manager:")
277-
println(" https://oss.sonatype.org/#nexus-search;gav~$groupId~~~~")
271+
println(" https://central.sonatype.com/repository/maven-snapshots/${groupId.replace('.', '/')}/$artifactId/$sanitizedVersion/maven-metadata.xml")
278272
println()
279273
println("========================================================")
280274
println()

src/main/kotlin/com/ecwid/apiclient/v3/ApiClient.kt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ import com.ecwid.apiclient.v3.dto.variation.result.*
5050
import com.ecwid.apiclient.v3.httptransport.HttpTransport
5151
import com.ecwid.apiclient.v3.impl.*
5252
import com.ecwid.apiclient.v3.jsontransformer.JsonTransformerProvider
53+
import java.io.Closeable
5354
import kotlin.reflect.KClass
5455

5556
open class ApiClient private constructor(
@@ -98,7 +99,8 @@ open class ApiClient private constructor(
9899
SlugInfoApiClient by slugInfoApiClient,
99100
ProductReviewsApiClient by productReviewsApiClient,
100101
StoreExtrafieldsApiClient by storeExtrafieldsApiClient,
101-
SwatchesApiClient by swatchesApiClient {
102+
SwatchesApiClient by swatchesApiClient,
103+
Closeable {
102104

103105
constructor(apiClientHelper: ApiClientHelper) : this(
104106
apiClientHelper = apiClientHelper,
@@ -126,6 +128,10 @@ open class ApiClient private constructor(
126128
swatchesApiClient = SwatchesApiClientImpl(apiClientHelper),
127129
)
128130

131+
override fun close() {
132+
apiClientHelper.httpTransport.close()
133+
}
134+
129135
companion object {
130136

131137
fun create(

src/main/kotlin/com/ecwid/apiclient/v3/converter/FetchedOrder.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ fun FetchedOrder.OrderItem.toUpdated(): UpdatedOrder.OrderItem {
175175
discounts = discounts?.map(FetchedOrder.OrderItemDiscounts::toUpdated),
176176
externalReferenceId = externalReferenceId,
177177
isPreorder = isPreorder,
178+
taxClassCode = taxClassCode,
178179
)
179180
}
180181

src/main/kotlin/com/ecwid/apiclient/v3/dto/cart/request/OrderForCalculate.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,8 @@ data class OrderForCalculate(
104104
val taxes: List<OrderItemTax>? = null,
105105
val files: List<OrderItemProductFile>? = null,
106106
val dimensions: ProductDimensions? = null,
107-
val discounts: List<OrderItemDiscounts>? = null
107+
val discounts: List<OrderItemDiscounts>? = null,
108+
val taxClassCode: String? = null
108109
)
109110

110111
data class OrderItemOption(

src/main/kotlin/com/ecwid/apiclient/v3/dto/order/request/UpdatedOrder.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ data class UpdatedOrder(
180180
val discounts: List<OrderItemDiscounts>? = null,
181181
val externalReferenceId: String? = null,
182182
val isPreorder: Boolean? = null,
183+
val taxClassCode: String? = null,
183184
)
184185

185186
data class OrderItemSelectedOption(

src/main/kotlin/com/ecwid/apiclient/v3/dto/order/result/FetchedOrder.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@ data class FetchedOrder(
219219
val externalReferenceId: String? = null,
220220
val isPreorder: Boolean? = null,
221221
val attributes: List<OrderItemAttributeValue>? = null,
222+
val taxClassCode: String? = null,
222223
val compositeComponents: List<FetchedProductComponent>? = null,
223224
)
224225

src/main/kotlin/com/ecwid/apiclient/v3/dto/profile/result/FetchedStoreProfile.kt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -751,6 +751,15 @@ data class FetchedStoreProfile(
751751

752752
@JsonFieldName("show_signin_link_with_unified_account_page")
753753
val showSigninLinkWithUnifiedAccountPage: Boolean? = null,
754+
755+
@JsonFieldName("swatches_product_option_shape")
756+
val swatchesProductOptionShape: String? = null,
757+
758+
@JsonFieldName("swatches_product_option_size")
759+
val swatchesProductOptionSize: String? = null,
760+
761+
@JsonFieldName("product_details_show_image_alt_text_as_visible_description")
762+
val productDetailsShowAltTextAsVisibleAsDescription: Boolean? = null,
754763
)
755764

756765
data class ProductFilterItem(

src/main/kotlin/com/ecwid/apiclient/v3/dto/report/enums/ReportType.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,6 @@ enum class ReportType {
4646
siteAddressActivity,
4747
siteLocationMapActivity,
4848
siteContactWidgetActivity,
49+
siteSocialActivity,
50+
siteAggregatedActivity,
4951
}
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package com.ecwid.apiclient.v3.httptransport
22

3-
interface HttpTransport {
3+
import java.io.Closeable
4+
5+
interface HttpTransport : Closeable {
46
fun makeHttpRequest(httpRequest: HttpRequest): HttpResponse
57
}

src/main/kotlin/com/ecwid/apiclient/v3/httptransport/impl/ApacheCommonsHttpClientTransport.kt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import org.apache.http.client.HttpClient
88
import org.apache.http.client.config.RequestConfig
99
import org.apache.http.impl.client.HttpClientBuilder
1010
import org.apache.http.impl.conn.PoolingHttpClientConnectionManager
11+
import java.io.Closeable
1112
import java.io.IOException
1213

1314
private const val DEFAULT_CONNECTION_TIMEOUT = 10_000 // 10 sec
@@ -33,6 +34,7 @@ internal const val MAX_RATE_LIMIT_RETRY_INTERVAL_SECONDS = 60L
3334
val EMPTY_WAITING_REACTION: (Long) -> Unit = { }
3435
val EMPTY_BEFORE_REQUEST_ACTION: () -> Unit = { }
3536

37+
@Deprecated("Use ApacheCommonsHttpClientTransport from client5 package")
3638
open class ApacheCommonsHttpClientTransport(
3739
private val httpClient: HttpClient = buildHttpClient(),
3840
private val rateLimitRetryStrategy: RateLimitRetryStrategy = SleepForRetryAfterRateLimitRetryStrategy(),
@@ -106,6 +108,12 @@ open class ApacheCommonsHttpClientTransport(
106108
}
107109
}
108110

111+
override fun close() {
112+
if (httpClient is Closeable) {
113+
httpClient.close()
114+
}
115+
}
116+
109117
companion object {
110118

111119
private fun buildHttpClient(

0 commit comments

Comments
 (0)