Skip to content

Commit 7f79a90

Browse files
committed
Merge remote-tracking branch 'origin/master'
2 parents 85b4f59 + 8ff0a40 commit 7f79a90

37 files changed

Lines changed: 644 additions & 43 deletions

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: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ import com.ecwid.apiclient.v3.dto.customer.request.*
2424
import com.ecwid.apiclient.v3.dto.customer.result.*
2525
import com.ecwid.apiclient.v3.dto.customergroup.request.*
2626
import com.ecwid.apiclient.v3.dto.customergroup.result.*
27+
import com.ecwid.apiclient.v3.dto.images.request.ImagesMainColorsRequest
28+
import com.ecwid.apiclient.v3.dto.images.result.FetchedImagesMainColorsResult
2729
import com.ecwid.apiclient.v3.dto.instantsite.redirects.request.*
2830
import com.ecwid.apiclient.v3.dto.instantsite.redirects.result.*
2931
import com.ecwid.apiclient.v3.dto.productreview.request.*
@@ -50,6 +52,7 @@ import com.ecwid.apiclient.v3.dto.variation.result.*
5052
import com.ecwid.apiclient.v3.httptransport.HttpTransport
5153
import com.ecwid.apiclient.v3.impl.*
5254
import com.ecwid.apiclient.v3.jsontransformer.JsonTransformerProvider
55+
import java.io.Closeable
5356
import kotlin.reflect.KClass
5457

5558
open class ApiClient private constructor(
@@ -76,6 +79,7 @@ open class ApiClient private constructor(
7679
productReviewsApiClient: ProductReviewsApiClientImpl,
7780
storeExtrafieldsApiClient: StoreExtrafieldsApiClientImpl,
7881
swatchesApiClient: SwatchesApiClientImpl,
82+
imagesApiClient: ImagesApiClientImpl,
7983
) :
8084
StoreProfileApiClient by storeProfileApiClient,
8185
BrandsApiClient by brandsApiClient,
@@ -98,7 +102,9 @@ open class ApiClient private constructor(
98102
SlugInfoApiClient by slugInfoApiClient,
99103
ProductReviewsApiClient by productReviewsApiClient,
100104
StoreExtrafieldsApiClient by storeExtrafieldsApiClient,
101-
SwatchesApiClient by swatchesApiClient {
105+
SwatchesApiClient by swatchesApiClient,
106+
ImagesApiClient by imagesApiClient,
107+
Closeable {
102108

103109
constructor(apiClientHelper: ApiClientHelper) : this(
104110
apiClientHelper = apiClientHelper,
@@ -124,8 +130,13 @@ open class ApiClient private constructor(
124130
productReviewsApiClient = ProductReviewsApiClientImpl(apiClientHelper),
125131
storeExtrafieldsApiClient = StoreExtrafieldsApiClientImpl(apiClientHelper),
126132
swatchesApiClient = SwatchesApiClientImpl(apiClientHelper),
133+
imagesApiClient = ImagesApiClientImpl(apiClientHelper),
127134
)
128135

136+
override fun close() {
137+
apiClientHelper.httpTransport.close()
138+
}
139+
129140
companion object {
130141

131142
fun create(
@@ -326,3 +337,7 @@ interface ProductReviewsApiClient {
326337
interface SwatchesApiClient {
327338
fun getRecentSwatchColors(request: RecentSwatchColorsGetRequest): FetchedSwatchColorsResult
328339
}
340+
341+
interface ImagesApiClient {
342+
fun getImagesMainColors(request: ImagesMainColorsRequest): FetchedImagesMainColorsResult
343+
}

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ data class OrderForCalculate(
1414
val customerTaxExempt: Boolean? = null,
1515
val customerTaxId: String? = null,
1616
val reversedTaxApplied: Boolean? = null,
17+
val taxAlreadyDeductedFromShipping: Boolean? = null,
1718
val discountCoupon: DiscountCouponInfo? = null,
1819
val items: List<OrderItem>? = null,
1920
val billingPerson: PersonInfo? = null,
@@ -78,7 +79,10 @@ data class OrderForCalculate(
7879

7980
val price: Double? = null,
8081
val productPrice: Double? = null,
82+
val taxAlreadyDeductedFromPrice: Boolean? = null,
8183
val needCalculateWholesalePrice: Boolean? = null,
84+
val isCustomerSetPrice: Boolean? = null,
85+
val selectedPrice: SelectedPrice? = null,
8286
val shipping: Double? = null,
8387
val tax: Double? = null,
8488
val fixedShippingRate: Double? = null,
@@ -275,4 +279,8 @@ data class OrderForCalculate(
275279
data class PaymentOption(
276280
val paymentId: String? = null,
277281
)
282+
283+
data class SelectedPrice(
284+
val value: Double? = null
285+
)
278286
}

src/main/kotlin/com/ecwid/apiclient/v3/dto/cart/result/CalculateOrderDetailsResult.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ data class CalculateOrderDetailsResult(
136136
val categoryId: Int? = null,
137137

138138
val price: Double? = null,
139+
val priceWithoutTax: Double? = null,
139140
val productPrice: Double? = null,
140141
val shipping: Double? = null,
141142
val tax: Double? = null,
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
package com.ecwid.apiclient.v3.dto.images.request
2+
3+
import com.ecwid.apiclient.v3.dto.ApiRequest
4+
import com.ecwid.apiclient.v3.dto.common.ApiRequestDTO
5+
import com.ecwid.apiclient.v3.httptransport.HttpBody
6+
import com.ecwid.apiclient.v3.impl.RequestInfo
7+
8+
data class ImagesMainColorsRequest(
9+
val imagesMainColorsRequest: ImagesMainColorsRequestBody = ImagesMainColorsRequestBody()
10+
) : ApiRequest {
11+
override fun toRequestInfo(): RequestInfo {
12+
return RequestInfo.createPostRequest(
13+
pathSegments = listOf(
14+
"images",
15+
"main-colors",
16+
),
17+
httpBody = HttpBody.JsonBody(
18+
obj = imagesMainColorsRequest,
19+
)
20+
)
21+
}
22+
}
23+
24+
data class ImagesMainColorsRequestBody(
25+
val imageUrls: List<String> = emptyList(),
26+
val colorsCount: Int = 5,
27+
) : ApiRequestDTO
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package com.ecwid.apiclient.v3.dto.images.result
2+
3+
import com.ecwid.apiclient.v3.dto.common.ApiResultDTO
4+
5+
data class FetchedImagesMainColorsResult(
6+
val result: Map<String, FetchedImageMainColors> = emptyMap(),
7+
) : ApiResultDTO
8+
9+
10+
data class FetchedImageMainColors(
11+
val colors: List<String> = emptyList(),
12+
) : ApiResultDTO

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import com.ecwid.apiclient.v3.dto.common.OrderedStringToStringMap
99
import com.ecwid.apiclient.v3.dto.customer.enums.CommercialRelationshipScheme
1010
import com.ecwid.apiclient.v3.dto.order.enums.*
1111
import com.ecwid.apiclient.v3.dto.order.request.UpdatedOrder
12+
import com.ecwid.apiclient.v3.dto.productcomponent.result.FetchedProductComponent
1213
import com.ecwid.apiclient.v3.jsontransformer.JsonFieldName
1314
import java.util.*
1415

@@ -218,7 +219,8 @@ data class FetchedOrder(
218219
val externalReferenceId: String? = null,
219220
val isPreorder: Boolean? = null,
220221
val attributes: List<OrderItemAttributeValue>? = null,
221-
val taxClassCode: String? = null
222+
val taxClassCode: String? = null,
223+
val compositeComponents: List<FetchedProductComponent>? = null,
222224
)
223225

224226
data class RecurringChargeSettings(

src/main/kotlin/com/ecwid/apiclient/v3/dto/product/result/FetchedProduct.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import com.ecwid.apiclient.v3.dto.common.*
44
import com.ecwid.apiclient.v3.dto.common.ApiFetchedDTO.ModifyKind
55
import com.ecwid.apiclient.v3.dto.product.enums.*
66
import com.ecwid.apiclient.v3.dto.product.request.UpdatedProduct
7+
import com.ecwid.apiclient.v3.dto.productcomponent.result.FetchedProductComponent
78
import com.ecwid.apiclient.v3.dto.producttype.enums.AttributeType
89
import com.ecwid.apiclient.v3.dto.variation.result.FetchedVariation
910
import java.util.*
@@ -142,6 +143,7 @@ data class FetchedProduct(
142143
val rating: Double? = null,
143144
val reviewsModerated: Int? = null,
144145
val reviewsPublished: Int? = null,
146+
val compositeComponents: List<FetchedProductComponent>? = null,
145147
) : ApiFetchedDTO, ApiResultDTO {
146148

147149
data class BorderInfo(
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package com.ecwid.apiclient.v3.dto.productcomponent.result
2+
3+
import com.ecwid.apiclient.v3.dto.common.ApiFetchedDTO
4+
import com.ecwid.apiclient.v3.dto.common.ApiResultDTO
5+
6+
data class FetchedProductComponent(
7+
val productId: Long = 0L,
8+
val combinationId: Long? = null,
9+
val quantity: Int = 0,
10+
) : ApiFetchedDTO, ApiResultDTO {
11+
12+
override fun getModifyKind() = ApiFetchedDTO.ModifyKind.ReadOnly
13+
14+
}

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

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,9 @@ data class FetchedStoreProfile(
446446
@JsonFieldName("feedback_message_position")
447447
val feedbackMessagePosition: String? = null,
448448

449+
@JsonFieldName("hide_category_block_show_all_enabled_products")
450+
val hideCategoryBlockShowAllEnabledProducts: Boolean? = null,
451+
449452
@JsonFieldName("legal_pages_show_page_links")
450453
val legalPagesShowPageLinks: Boolean? = null,
451454

@@ -751,6 +754,21 @@ data class FetchedStoreProfile(
751754

752755
@JsonFieldName("show_signin_link_with_unified_account_page")
753756
val showSigninLinkWithUnifiedAccountPage: Boolean? = null,
757+
758+
@JsonFieldName("swatches_product_option_shape")
759+
val swatchesProductOptionShape: String? = null,
760+
761+
@JsonFieldName("swatches_product_option_size")
762+
val swatchesProductOptionSize: String? = null,
763+
764+
@JsonFieldName("product_details_show_image_alt_text_as_visible_description")
765+
val productDetailsShowAltTextAsVisibleAsDescription: Boolean? = null,
766+
767+
@JsonFieldName("product_filters_orientation")
768+
val productFiltersOrientation: String? = null,
769+
770+
@JsonFieldName("product_list_swatches_product_option_behavior")
771+
val productListSwatchesProductOptionBehavior: String? = null,
754772
)
755773

756774
data class ProductFilterItem(

0 commit comments

Comments
 (0)