public final class ReleaseNotes extends Object
AddProductOrderFromCartDraft.getCustom() ()}Customer.getAuthenticationMode() and related update action SetAuthenticationModeCustomer.getAuthenticationMode() and related update action SetAuthenticationModeOrderPaymentAddedMessageApiClient.getAccessTokenValiditySeconds() and ApiClient.getRefreshTokenValiditySeconds() as for ApiClient as for ApiClientDraftProductsHead, ProductByIdHead and ProductByKeyHeadDelivery.getCustom() and created update action for Order and OrderEdit SetDeliveryCustomType, SetDeliveryCustomField, SetDeliveryCustomType and SetDeliveryCustomFieldProductSelectionProductProjectionInStoreByIdGet, ProductProjectionInStoreQuery and ProductProjectionByKeyGetParcel and ParcelDraft and added related update actions for Order and OrderEdit SetParcelCustomField, SetParcelCustomType, SetParcelCustomType and SetParcelCustomFieldReturnItem and ReturnItemDraft and added related update actions for Order and OrderEdit SetReturnItemCustomField, SetReturnItemCustomType, SetReturnItemCustomType and SetReturnItemCustomFieldSetTransactionCustomField and SetTransactionCustomType LineItem.getProductKey() SetLineItemSupplyChannelUserProvidedIdentifiers.getContainerAndKey() and related classes ContainerAndKey and ContainerAndKeyImpl InventoryEntryQuantitySetMessage SetReturnInfo and the related message ReturnInfoSetMessage SetLineItemDistributionChannel and related message OrderLineItemDistributionChannelSetMessage ResourceDeletedPayload.getDataErasure() CustomerDeletedMessage ShippingMethod.getLocalizedName() and ShippingMethodDraft.getLocalizedName() and related action SetLocalizedName StoreCreatedMessage and StoreDeletedMessage OrderStateTransitionMessage.getOldState() io.sphere.sdk.customers.commands.CustomerInStoreChangePasswordCommandpdate ShoppingList.getStore(), ShoppingListDraft.getStore() and related update actions PriceDraftBuilder.of(Price) and PriceDraftBuilder.of(PriceDraft). In introduced the method to set tiers directly by PriceDraftDsl.withTiers(List)
RetryAction.ofScheduledRetry(long, Function) in case of exception
CustomerPasswordUpdatedMessageCustomerDraft.getAnonymousCartId() and replaced with CustomerDraft.getAnonymousCart() support anonymousCart into the CustomerDraftBuilder, into the CustomerSignInCommand and in the CustomerInStoreSignInCommandPriceDraft.getDiscounted()
CustomLineItemImportDraft.getShippingDetails()//docs.commercetools.com/api/errors#top PriceDraft.getCustomerGroup() is of type ResourceIdentifier instead of ReferenceSetSupplyChannels, AddSupplyChannel and RemoveSupplyChannelAddLineItem.getAddedAt()Custom.getCustom() adding related updated actions SetCustomField and SetCustomTypeProductVariantAddedMessageCartDraft.getDiscountCodes()Cart.getKey(), support update action SetKey, support CartByKeyGet, support CartReplicationDraft.getKey()OrderFromCartDraft.getId() and related methods, it has been replaced with support OrderFromCartDraft.getCart(); support of method for the Cart OrderFromCartDraft#of(Cart)SetCustomerGroup, SetCustomerGroup, SetCustomerGroupSetCustomer, SetCustomerLineItem.getLastModifiedAt()AddShippingAddressId, AddBillingAddressId, RemoveBillingAddressId and RemoveShippingAddressIdProjectNotConfiguredForLanguagesError and MissingRoleOnChannelError PriceCollectionQueryModel.channel()CartsConfiguration.getCountryTaxRateFallbackEnabled() and the related update action changeCountryTaxRateFallbackEnabled in the Project Project# Order.getStore() and OrderStoreSet message OrderStoreSetMessage SetDistributionChannels, AddDistributionChannel and RemoveDistributionChannelLanguageUsedInStoresShoppingList.getAnonymousId()ProductDraft.getState()ShoppingListDraft.getCustomer()ShippingMethodsByOrderEditGet.InventoryEntryCreatedMessage.StateByKeyGet and now update and delete can be by Key as well.ExternalTaxRateDraft.isIncludedInPrice() and added it to builder ExternalTaxRateDraftBuilder#includedInPrice()UpdateCommandDsl.withAdditionalHttpQueryParameters(NameValuePair) and search endpoints MetaModelSearchDsl.withAdditionalQueryParameter(NameValuePair).ShippingMethodDraft.getLocalizedDescription() and added it to builder ShippingMethodDraftBuilder#localizedDescription()SetLocalizedDescription and deprecated the attribute "description" and the action "setDescription" Store.getLanguages() and StoreDraft.getLanguages() and added update action SetLanguages PriceSelection#getLocaleProjection() and PriceSelection#getStoreProjection() and also in the PriceSelectionBuilder GeoJSONQueryModel.withinCircle(Point, Double) with default locale not using '.' as decimal delimiter.TransactionDraftDsl is now publicParcelDraft.of(TrackingData, List)Project CorrelationIdRequestDecorator to attach a user-defined correlation id as a value for a header with key "X-Correlation-ID" on requests going to the commercetools Composable Commerce.GenericMessageImpl json deserialization where GenericMessageImpl.getResourceUserProvidedIdentifiers() was missing SphereProjectScopeAddStore, SetStores, RemoveStoreOrderMessage json deserialization bug where type field wouldn't get deserialized ProductImageUploadCommand.withContentType(String) ignoring provided content typeOrderImportDraftnow treats headers as case insensitiveCustomer.getStores() fieldProductAddedToCategoryMessage and ProductRemovedFromCategoryMessageCategory, CategoryDraft, ProductLike and ProductDraft now extend the WithKey interface.PagedSearchResult.empty() now creates an instance with the PagedResult.getLimit() field set to 20, instead of 0ProductDiscount.getKey() and ProductDiscountDraft.getKey() ()} fields.ProductByKeyGet, ProductUpdateCommand.ofKey(String, Long, UpdateAction), ProductDiscountDeleteCommand.ofKey(String, Long) commandsSetKey update actionCustomerToken.getExpiresAt() fieldCartDiscount and CartDiscountDraftAuthorizationHeaderAuthentication for api extensions.AddLineItem staged update action structureStoreCartInStoreCreateCommand, CartInStoreDeleteCommand, CartInStoreUpdateCommand, CartInStoreByCustomerIdGet, CartInStoreByIdGet, CartInStoreQuery, OrderFromCartInStoreCreateCommand, OrderInStoreDeleteByIdCommand, OrderInStoreDeleteByOrderNumberCommand, OrderInStoreUpdateByIdCommand, OrderInStoreUpdateByOrderNumberCommand, OrderInStoreByIdGet, OrderInStoreByOrderNumberGet, OrderInStoreQuerySetShippingMethod.of(ResourceIdentifier) methodSetSupplyChannel.of(ResourceIdentifier) methodSetTaxCategory.of(ResourceIdentifier) methodRemoveZone.of(ResourceIdentifier) methodReferenceable got their names changed to 'ofReferencable' and are now deprecated. This was done for the following update actions: SetShippingMethod, SetSupplyChannel, SetTaxCategory, RemoveZoneType update actions : ChangeEnumValueLabel, ChangeInputHint, ChangeLocalizedEnumValueLabelExtension and ExtensionDraftCustomerCreatePasswordTokenCommand commandProject.getExternalOAuth() to specify external auth providers in the project levelZonedDateTime formatter now always include milliseconds even if they are equal to 0CustomObjectByIdGet and CustomObjectByKeyGet now support expansion parameterAttribute.of(String, AttributeAccess, Object) now works properly with Set of ReferenceChangeAttributeOrder is now deprecatedChangeAttributeOrderByName addedOrderEdit with create, query, update and delete commandsOrderEdit update and staged actionsOrderEditApplyCommandOrderEdit message typesProductCatalogData.getCurrentUnsafe() methodCartDraft.getShippingMethod(), CartShippingInfo.getTaxCategory(), {CustomLineItemDraft.getTaxCategory(), AddCustomLineItem.getTaxCategory(), SetCustomShippingMethod.getTaxCategory(), SetShippingMethod.getShippingMethod(), InventoryEntryDraft.getSupplyChannel(), SetSupplyChannel.getSupplyChannel(), OrderShippingInfo.getTaxCategory(), ProductDraft.getTaxCategory(), SetTaxCategory.getTaxCategory() return type from Reference to ResourceIdentifier OrderImportDraft.getShippingInfo() is of type ShippingInfoImportDraft instead of OrderShippingInfoApiClient has a new attribute ApiClient.getDeleteAt() which marks when the project key would be deletedApiClientDraft has a new attribute ApiClientDraft.getDeleteDaysAfterCreation() which allows to specifiy the key life length LineItemDraft.getSupplyChannel() and LineItemDraft.getDistributionChannel() are now of type ResourceIdentifier instead of ReferencePriceDraft.getChannel() is of type ResourceIdentifier instead of ReferenceAddLineItem.of(String, int, long)AddLineItem.of(ProductIdentifiable, int, long)ProductVariantDraft.getPrices(), ProductVariantDraft.getAttributes() and ProductVariantDraft.getImages() are now optionalAddVariant action now includes assets field ShippingMethodDraft accepts List instead of ListZone and ZoneDraft contains a key propertyZone is updatable, deletable by key SetKey to set key for a zone RemoveZone.getZone() return a ResourceIdentifier instead of ReferenceGiftLineItemCartDiscountValue.getProduct(), GiftLineItemCartDiscountValue.getDistributionChannel(), GiftLineItemCartDiscountValue.getSupplyChannel() changed return type from Reference to ResourceIdentifierChangeTaxCategory accept ResourceIdentifier as a parameter now ShippingMethodDraftBuilder accept a ResourceIdentifier which is a Reference generalization
ReturnItem has two specializations LineItemReturnItem and CustomLineItemReturnItem UserProvidedIdentifiers.getCustomerNumber() to reflect customer number in change messagesApiClients programmatically, that was possible only via user interface beforePayload.getResourceUserProvidedIdentifiers() and Message.getResourceUserProvidedIdentifiers() to reference user defined identifiers.CartDiscount, Channel, DiscountCode, Extension, ProductDiscount, ShoppingList, Subscription, State, TaxCategory, Type, Order.getRefusedGifts() in Order OrderCustomerGroupSetMessage SphereProjectScope.MANAGE_EXTENSIONS and SphereProjectScope.MANAGE_PROJECT_SETTINGS ProductProjectionSortSearchModel.score() in ProductProjectionSearch ChangeMessagesConfiguration update actionProductPriceDiscountsSetMessage and ProductPriceExternalDiscountSetMessageSetShippingRateInput`, which was not properly working beforeResourceCreatedPayload, ResourceUpdatedPayload and ResourceDeletedPayload Subscription.getStatus()OrderFromCartDraft.getOrderState() and OrderFromCartDraft.getState()SetValidFromAndUntil to ProductDiscountAddAttributeDefinition.of(AttributeDefinition) changed parameter to AddAttributeDefinition.of(AttributeDefinitionDraft) insteadSetCustomerId which would result in a OrderCustomerSetMessageSetValidFromAndUntil to CartDiscountSetValidFromAndUntil to DiscountCodeOrderDeletedMessage.ShippingMethodsByCartGet.ShippingMethodsByLocationGetProductVariantImportDraftBuilder.prices(List) argument from List to ListChangeParent has an additional method ChangeParent.of(ResourceIdentifier) to point out the changed parent via its resource identifier.PubSubDestination MessageSubscriptionPayload.getPaylaodNotIncluded() to PayloadNotIncluded to give more details when the payload is not included in a messageOrderFromCartDraft.getShipmentState() to OrderFromCartDraftCustomerQueryModel.title() and CustomerQueryModel.middleName() to CustomerQueryModelLineItemImportDraftBuilder.of(ProductVariantImportDraft, long, PriceDraft, LocalizedString) accepts price draft instead of priceLineItemImportDraftBuilder.of(ProductVariantImportDraft, long, Price, LocalizedString) deprecatedProductVariantImportDraft.getPrices() returns a PriceDraft instead PriceCustomFields addition to PriceDraftAbstractRemoveLineItem.getShippingDetailsToRemove() to RemoveLineItemCart.getCustomerGroup() and Customer.getCustomerGroup() from Reference to ResourceIdentifierHighPrecisionMoneyImpl to enable high precision money in Composable Commerce when needed.CustomerDeleteCommand,OrderDeleteCommand, CartDeleteCommand, PaymentDeleteCommand,
ShoppingListDeleteCommand, ReviewDeleteCommand, DiscountCodeDeleteCommand, CustomObjectDeleteCommand.
SphereJsonUtils.configureObjectMapper(ObjectMapper) to configure
an existing jackson object mapper for usage with our JVM SDK
Payment.getAnonymousId(), PaymentDraft.getAnonymousId()
and corresponding update action SetAnonymousIdSetLineItemShippingDetails,
SetCustomLineItemShippingDetails,
AddItemShippingAddress
RemoveItemShippingAddress
UpdateItemShippingAddress,
supported now in our SDK.
ItemShippingDetails.getTargets() returns Map instead of MapAWSLambdaDestinationMatchingProductDiscountGet Query to lockup matching product discount.SetAssetCustomType.ofSkuAndAssetKey(String, String, CustomFieldsDraft), previously named ofSkuAndAssetKeyAndAssetKeyExtensionResourceType.ORDERCustomerAddressAddedMessage,
CustomerAddressChangedMessage,
CustomerAddressRemovedMessage,
CustomerCompanyNameSetMessage,
CustomerDateOfBirthSetMessage,
CustomerEmailChangedMessage,
CustomerEmailVerifiedMessage,
CustomerGroupSetMessage
CartReplicationCommand and CartReplicationDraftProductLike interface to public.ExtensionResourceType in order to add type check while creating Trigger.getResourceTypeId() field, instead of using string laterals.ProductTypeDraft.getAttributes() from List for ListProductTypeDraft.getAttributes() from List for ListProductTypeDraftDsl.getAttributes() from List for ListItemShippingDetails.getTargetsMap() convenience method.ChangeEnumKey and ChangeAttributeName update actions to ProductTypeassetKey to ChangeAssetName.getAssetKey() and SetAssetCustomField.getAssetKey().CustomFields to CustomerGroupStateRole.RETURN to StateRole enumerationDiscountCode.getGroups() to DiscountCodeParcelItemsUpdatedMessageDiscountCodeState.APPLICATION_STOPPED_BY_PREVIOUS_DISCOUNT and DiscountCodeState.NOT_VALID to DiscountCodeState CartOrigin to Cart and Order with the associated import actions and draftsCart.getItemShippingAddresses() field to Cart and Order and associated drafts ItemShippingDetails to CustomLineItem and LineItem and associated drafts CoreProductVariantQueryModel.key() to ProductVariantQueryModel ItemShippingDetails and ItemShippingTarget as support for new multiple shipping addresses feature from backend.CategoryDraft.getParent() changed return type from Reference to ResourceIdentifierCategoryDraftBuilder.parent(Referenceable) is now deprecated and should be replaced by the new method CategoryDraftBuilderBase.parent(ResourceIdentifier)ParcelDraft.getItems()DiscountCode.getValidFrom() and DiscountCode.getValidUntil()ProductDiscount.getValidFrom() and ProductDiscount.getValidUntil()OrderReturnShipmentStateChangedMessageOrderShipmentStateChangedMessageTaxCategoryQuery.byKey(String) to TaxCategoryQueryPagedSearchResult.empty() for API consistency reasonsOrderExpansionModel.state() for API consistency reasonsExtension and query, delete, update actions all listed in the new in io.sphere.sdk.extensions package.ParcelDraftBuilderOrderImportDraft.getTaxCalculationMode().OrderReturnShipmentStateChangedMessage
and OrderShipmentStateChangedMessage.OrderImportDraft.getTaxCalculationMode().AddDelivery.getAddress().LocalizedEnumValue.ChangeAttributeConstraint.Asset.getKey() property to identify an asset:
RemoveAsset, SetAssetTags, ChangeAssetName, SetAssetDescription, SetAssetSources, SetAssetCustomType,
SetAssetCustomField.
Asset.getKey() property to identify an asset:
RemoveAsset, SetAssetTags,
ChangeAssetName, SetAssetDescription,
SetAssetSources, SetAssetCustomType,
SetAssetCustomField.
AddAsset.getPosition() and AddAsset.getPosition()
RevertStagedVariantChanges.CartDiscount.getCustom(), CartDiscountDraft.getCustom() and the
update action SetCustomField and
SetCustomType.SetPredicate.
LineItemDraft.getSku().
Cart.getTaxCalculationMode(), CartDraft.getTaxCalculationMode()
and the corresponding update action ChangeTaxCalculationMode.
MultiBuyCustomLineItemsTarget,
SelectionMode.
OrderByOrderNumberGet,
updating OrderUpdateCommand.ofOrderNumber(String, Long, UpdateAction) and
deleting OrderDeleteCommand.ofOrderNumber(String, Long) of an order by order number.
CustomerSignInCommand.updateProductData property to CustomerSignInCommand.
CategoryTree with CategoryTree.findByKey(String).Order.getShippingRateInput() and Project.getShippingRateInputType().
Added new tiered shipping rates property in ShippingRate.getTiers().
Parcel.getItems() and ParcelMeasurements.getItems().
RemoveEnumValues.SetImageLabel.CartDiscount.getStackingMode(), CartDiscountDraft.getStackingMode() and enum StackingMode.QueryExecutionUtils helper class by providing the query method
QueryExecutionUtils.queryAll(SphereClient, QueryDsl, Consumer) .
ProductDraft.getMasterVariant() as nullable.LineItemDraft.getCustom() to CustomFieldsDraft.
This breaking change might require changes in your source code.
LineItemDraftBuilderBase.custom(CustomFieldsDraft) builder method
to replace now deprecated LineItemDraftBuilder.custom(CustomFields) builder method.
Payment.getAmountAuthorized(), Payment.getAmountPaid(), Payment.getAmountRefunded(),
Payment.getAuthorizedUntil() and Payment.getExternalId()
PaymentDraft.getAmountAuthorized(), PaymentDraft.getAmountPaid(), PaymentDraft.getAmountRefunded(),
PaymentDraft.getAuthorizedUntil() and PaymentDraft.getExternalId()
SetAmountPaid, SetAmountRefunded,
SetAuthorization and SetExternalId
NullPointerException in TypeDraftBuilderBase.plusFieldDefinitions(FieldDefinition).DiscountCode.getCustom(), DiscountCodeDraft.getCustom() and
corresponding update actions SetCustomType, SetCustomField
ChangeCountries,
ChangeCurrencies, ChangeLanguages,
ChangeMessages, ChangeMessagesEnabled
and ChangeName.
plus* methods to generated draft builder to ease working with list properties
(e.g. ShoppingListDraftBuilderBase.plusLineItems(io.sphere.sdk.shoppinglists.LineItemDraft),
ShoppingListDraftBuilderBase.plusLineItems(List)).
PaymentByKeyGet query,
PaymentDeleteCommand.ofKey(String, Long) and<
PaymentUpdateCommand.ofKey(String, Long, UpdateAction) commands.
MultiBuyLineItemsTarget,
SelectionMode.
PriceDraftBuilder.of(Price).ShippingMethod.getPredicate(), ShippingMethodDraft.getPredicate().CartShippingInfo.getShippingMethodState().CartPredicate which generalizes and deprecates the
CartDiscountPredicate.TaxMode.EXTERNAL_AMOUNT. Added new ExternalTaxAmountDraft type, which can be used to set the external tax amount
with the new update actions SetLineItemTaxAmount, SetCustomLineItemTaxAmount,
SetShippingMethodTaxAmount and SetCartTotalTax.ShippingMethodByKeyGet and updating ShippingMethodUpdateCommand.ofKey(String, Long, UpdateAction)
a shipping method by key.SetAnonymousId cart update action.Customer.getKey(), CustomerDraft.getKey() and corresponding update action SetKey.
Added CustomerByKeyGet, CustomerDeleteCommand.ofKey(String, Long) and CustomerUpdateCommand.ofKey(String, Long, UpdateAction).PublishScope, Publish.ofScope(PublishScope) and ProductPublishedMessage.getScope().SphereRequest.TaxCategory.getKey(), TaxCategoryDraft.getKey() and
corresponding update action SetKey.
TaxCategoryByKeyGet and
TaxCategoryDeleteCommand.ofKey(String, Long).
LineItemDraft.getSku().ShippingMethod.getKey(),
ShippingMethodDraft.getKey() and update action
SetKey.
ShippingMethodDeleteCommand.ofKey(String, Long).
CartDraft.getCustomerGroup() and update action
SetCustomerGroup.CustomerGroup.getKey() and CustomerGroupDraft.getKey().ProductPublishedMessage.getRemovedImageUrls().CustomerByEmailTokenGet to retrieve a customer by email token.SetInputTip update action.CustomerByPasswordTokenGet now uses the new endpoint.ProductDraft.getCategories() from Set<Reference<Category>> to Set<ResourceIdentifier<Category>>.
This breaking change may require an update of your source code, depending on how you use the ProductDraft type.
The previously returned Reference instances provided a Reference.getObj() method
that is not available from ResourceIdentifier. If you relied on the Reference.getObj() method to retrieve the id or key of the referenced object, you now have
to use the ResourceIdentifier.getId() and ResourceIdentifier.getKey() as exposed by the ResourceIdentifier interface.
SphereProjectScope from an enum to a class and added missing scopes. This change doesn't require changes to your source code,
but requires a recompilation of all projects that depend on this class.AzureServiceBusDestination.LineItemDraft.getExternalPrice(), LineItemPriceMode.EXTERNAL_PRICE.ChangeInputHint update action for product types/attribute definitions.CustomerInvalidCurrentPassword error.CustomFieldsDraftBuilder.of(CustomFields), where the id was confused with the typeId.SphereClient.getConfig() for accessing the SphereApiConfig.OrderPaymentStateChangedMessage, PaymentStatusInterfaceCodeSetMessage,
ProductRevertedStagedChangesMessage, ProductVariantDeletedMessage and ProductDeletedMessage.GiftLineItemCartDiscountValue for gift line items LineItem.getLineItemMode(),
LineItemMode.GIFT_LINE_ITEM.Category.getKey(), CategoryDraft.getKey() and corresponding update action SetKey.Customer.getSalutation(), CustomerDraft.getSalutation() and
corresponding update action ().ProductImageUploadCommand, which previously was only available via a separate module.Nullable annotations to PagedSearchResult.ProductDraftBuilder class is now using a generated base class. This change doesn't require changes to your source code,
but requires a recompilation of all projects that depend on this class.CategoryQuery now
supports sorting by Category.getOrderHint() via CategoryQueryModel.orderHint().SetAssetSources update action for products.ProductImageAddedMessage.LineItem.getVariant() ProductVariant.getIdentifier()
is now correctly initialized.InventoryEntryDraft.getQuantityOnStock().Payment.getKey(), PaymentDraft.getKey() and
corresponding update action SetKey.CategoryDraftBuilderBase.of(Category),
InventoryEntryDraftBuilder.of(InventoryEntry), AssetDraftBuilderBase.of(Asset), PriceDraftBuilder.of(Price),
ProductVariantDraftBuilderBase.of(ProductVariant), AttributeDraftBuilder.of(Attribute) and
ProductTypeDraftBuilder.of(ProductType)) to convert from a resource to the corresponding resource draft.
These changes don't require changes to your source code, but they require a recompilation of all projects that depend on these classes.ChangeSubscription and
message subscriptions MessageSubscription.
ShippingRate.isMatching().ShippingRate from class to interface.
This change doesn't require you to change your source code, but requires a recompilation of all projects that depend on this class.
PriceTierQueryModel for tiered prices PriceQueryModel.tiers().LineItemExpansionModel.variant() so that it works correctly.
This is a breaking change, but the previous version was incorrect and didn't work.PriceTier for tired prices, which are accessible via Price.getTiers() and PriceDraft.getTiers()OrderImportDraft now provides custom fields OrderImportDraft.getCustom()LineItemImportDraft now provides custom fields LineItemImportDraft.getCustom()CustomerSignInResultExpansionModel now provides expansion of the cart CustomerSignInResultExpansionModel.cart()ProductVariantAvailabilityFilterSearchModel now provides filtering by isOnStockInChannels via ProductVariantAvailabilityFilterSearchModel.onStockInChannels()ShoppingList and ShoppingListDraft now provide time to live attribute ShoppingList.getDeleteDaysAfterLastModification() and ShoppingListDraft.getDeleteDaysAfterLastModification()Cart and CartDraft now provide time to live attribute Cart.getDeleteDaysAfterLastModification() and CartDraft.getDeleteDaysAfterLastModification()ProductVariantSortSearchModel now provides sorting by sku ProductVariantSortSearchModel.sku()staged parameter<Draft>Dsl types.
This change doesn't require you to change your source code, but requires a recompilation of all projects that depend on these classes.
The following classes changed:
CartDiscountDraftBuilderCategoryDraftBuilderCustomerGroupDraftBuilderInventoryEntryDraftBuilderPaymentDraftBuilderProductDiscountDraftBuilderProductVariantDraftBuilderProductTypeDraftBuilderReviewDraftBuilderShippingMethodDraftBuilderTaxCategoryDraftBuilderTypeDraftBuilderZoneDraftBuilderZoneDraftBuilderProductVariantDraftBuilderBase.of(ProductVariantDraft) now correctly copies all attributes of the given templateChannel.getGeoLocation(), added support for it in ChannelQueryModel.geoLocation() and support for withinCircle
predicate GeoJSONQueryModel.withinCircle(Point, Double).ShoppingList with new cart update action AddShoppingList.CustomObjectBigIntegerNumberGenerator so that it retries when the id already exists.org.asynchttpclient:async-http-client version of the sdk-http-ahc-2_0 module to version 2.0.28.Assets on categoriesOrderImportDraft can now provide the inventoryMode to track inventorySet types preserve input order, see #1294ProductDraftBuilder was not preserving the key when using a ProductDraftChangeTaxRoundingMode. When creating an Order from a Cart, the Order has the tax rounding mode of the Cart it was created from.LineItem.getProductType()LineItem.getPriceMode()PriceUtils class to assist on some typical price calculations, such as gross and net conversionsCartLike.calculateSubTotalPrice() and CartLike.calculateTotalAppliedTaxes()CustomerQueryModel.customerGroup(), InventoryEntryQueryModel.supplyChannel() and OrderQueryModel.cart() returns a ReferenceOptionalQueryModel instead of ReferenceQueryModel to enable additional query predicates.CustomerQueryModel.customerNumber() String and CompletionStageCustomer.getShippingAddressIds() and Customer.getBillingAddressIds() as well as the update actions AddBillingAddressId, RemoveBillingAddressId, AddShippingAddressId, RemoveShippingAddressIdio.sphere.sdk.products.commands.ProductCreateCommand#withDraft(Object) FilteredFacetResult.getProductCount() DraftBuilder classes the build() method returns a DraftDsl class instead of its corresponding Draft interface. Similarly some methods relying on these builders have changed their return type to DraftDsl as well. The following methods are affected by this change: CartDiscountDraftBuilderBase.build(), CategoryDraftBuilderBase.build(), CustomerDraftBuilderBase.build(), InventoryEntryDraftBuilder.build(), PaymentDraftBuilder.build(), ProductDiscountDraftBuilderBase.build(), ReviewDraftBuilderBase.build(), TypeDraftBuilderBase.build(), StateDraftDsl.withRoles(io.sphere.sdk.states.StateRole), StateDraftDslBase.withRoles(Set) and StateDraftDslBase.withTransitions(Set).SetDiscountedPriceAddress.getExternalId() ProductProjectionSearch.withMarkingMatchingVariants(Boolean)ChangePlainEnumValueLabel and ChangeLocalizedEnumValueLabelSetAttribute: SetAttribute.ofVariantId(java.lang.Integer, java.lang.String, java.lang.Object), SetAttribute.ofSku(java.lang.String, java.lang.String, java.lang.Object)PriceChangedErrorProductDraftBuilder.of(ResourceIdentifiable, LocalizedString, LocalizedString, List) to pass all variants as one listRange constructor no longer throws InvertedBoundsException. See #1247CustomObjectBigIntegerNumberGenerator does retries only on ConcurrentModificationExceptions.Assets on productsSetLineItemTotalPriceChangeCustomLineItemQuantity and ChangeCustomLineItemMoneycommercetools-jvm-sdk/1.5.0 (AHC/2.0) Java/1.8.0_101-b13 (Linux; amd64)" from originally "commercetools JVM SDK 1.4.0". It is also possible to add a solution info, see SolutionInfo.SphereClient will attempt to fetch a new token if an InvalidTokenException occurs.LocalizedString.slugified() and LocalizedString.slugifiedUnique() generate a String with a max length of 256 to be valid for commercetools Composable Commerce. In addition, only allowed characters like [-_a-zA-Z0-9] will be in the output. Before that it was possible to keep for example a "+".State.getRoles(), AddRoles, RemoveRoles and SetRoles Reference.ofResourceTypeIdAndId(String, String) and othersProductLike.getKey(), ProductProjection.getKey(), ProductVariant.getKey(), ProductDeleteCommand.ofKey(String, Long), ProductUpdateCommand.ofKey(String, Long, List)AddVariant.withImages(List), AddVariant.withKey(String), AddVariant.withSku(String), SetKey, SetProductVariantKey, ProductByKeyGet, ProductProjectionByKeyGetOutOfStockErrorSetShippingMethod.ofId(String) which is easier to use in a form than SetShippingMethod#of(Referenceable) RemoveImage now support to address a ProductVariant by using the SKU with RemoveImage.ofSku(String, String) ChangeEnumValueOrder, ChangeFieldDefinitionOrder and ChangeLocalizedEnumValueOrderCustomer.findAddressById(String) CustomObjects as storage: CustomObjectBigIntegerNumberGeneratorInventoryEntryDeletedMessageInventoryEntrysMoveImageToPositionPaymentTransactionStateChangedMessage.getTransactionId() CartShippingInfo.getDiscountedPrice() and the ShippingInfoExpansionModel.discountedPrice() to receive the value of discounts for shipping costs and maybe expand in the Cart the CartDiscount objects.Categorys Category#toString() is now using reflection so former missing fields like "metaTitle" will be included in the output.JsonNodeQuery.of(String) accepts now also query parametersProductDraftBuilderBase.of(ProductDraft) is not leaky anymore, in previous versions not all fields were copiedChannel.getAddress() and SetAddressOrder, Cart and CustomerAddress.getFax() PaymentTransactionStateChangedMessage.getTransactionId() Thanks to Cristian for his contributions!
CategoryDraft and CategoryDraftBuilder
contain the fields "metaTitle", "metaDescription" and "metaKeywords".Project.getMessages()Order:
SetCustomerEmail,
SetShippingAddress and
SetBillingAddressOrder: OrderCustomerEmailSetMessage,
OrderShippingAddressSetMessage and
OrderBillingAddressSetMessageThanks to Sarah and Martin for their contributions!
AnonymousCartSignInModePriceSelection for
ProductProjectionQuery.withPriceSelection(PriceSelection),
PriceSelectionRequestDsl.withPriceSelection(PriceSelection),
PriceSelectionRequestDsl.withPriceSelection(PriceSelection),
PriceSelectionRequestDsl.withPriceSelection(PriceSelection),
PriceSelectionRequestDsl.withPriceSelection(PriceSelection) CartLike.getAnonymousId(),
Cart.getAnonymousId(), CartDraft.getAnonymousId(),
CustomerSignInCommand.withAnonymousId(String) ProductProjectionSearch.bySlug(Locale, String),
ProductProjectionSearch.bySku(String), ProductProjectionSearch.bySku(List) JavaAndJsonSphereRequest which returns the Java object and the JSON from a SphereRequestJavaAndHttpResponseSphereRequest which returns the Java object and the HTTP response from a SphereRequest which can be useful to retrieve HTTP headersRecalculate.withUpdateProductData(Boolean) ProductProjectionSortSearchModel.id() to sort search results by the product IDProductDiscountDraftBuilderLocalizedString.get(String) SphereJsonUtils.newObjectMapper() does not use anymore "SerializationFeature.FAIL_ON_EMPTY_BEANS"RetrySphereClientDecorator to deal with server errors and retry requestsProductProjectionSearch.withFuzzyLevel(java.lang.Integer) to configure the fuzzy level in the product searchTokensDiscountedLineItemPortionDiscountedLineItemPriceDiscountedLineItemPriceForQuantityItemStatePaymentInfoTaxPortionDiscountCodeInfoParcelReturnInfoReturnItemSyncInfoTrackingDataPaymentMethodInfoPaymentStatusTransactionDiscountedPriceProjectZoneRateFieldDefinitionLocationEnumValueLocalizedEnumValuePagedQueryResultPagedResultPagedSearchResultSearchKeywordSearchKeywordsTermStatsio.sphere.sdk.customers.commands.CustomerCreateTokenCommand, use CustomerCreatePasswordTokenCommand insteadio.sphere.sdk.client.SphereAccessTokenSupplierFactory, use static methods of SphereAccessTokenSupplier SphereClientFactorytypeId in resourcesCartDraftDsl.witCustomLineItem#getDiscountedPrice() and CustomLineItem#getDiscountedPrice()getVersion() in CustomerCreateEmailTokenCommandCustomerByTokenGetCustomObjectDeleteCommand#of(CustomObject<?>)CustomObjectDeleteCommand#of(String, String)CustomObjectByKeyGet#of(String, String)CustomObjectQuery#of()ProductProjection#findVariantBySkyAttributeDefinition#getIsRequiredAttributeDefinition#getIsSearchableProductAttributeFacetSearchModel#ofLocalizableEnum(String)ProductAttributeFacetSearchModel#ofLocalizableEnumSet(String)ProductAttributeFacetedSearchSearchModel#ofLocalizableEnum(String)ProductAttributeFacetedSearchSearchModel#ofLocalizableEnumSet(String)ProductAttributeFilterSearchModel#ofLocalizableEnum(String)ProductAttributeFilterSearchModel#ofLocalizableEnumSet(String)ProductAttributeSortSearchModel#ofLocalizableEnum(String)ProductAttributeSortSearchModel#ofLocalizableEnumSet(String)ProductTypeDraft#of(String, String, List)TaxRate#equalsIgnoreId(TaxRate)SetCustomTypeBase#getTypeId()SetCustomTypeBase#getTypeKey()LocalizedString#ofEnglishLocale(String)FilterDsl withers taking FilterExpression as argumentgetTermFacetResult(final TermFacetExpression<T> facetExpression), getRangeFacetResult(final RangeFacetExpression<T> facetExpression), and getFilteredFacetResult(final FilteredFacetExpression<T> facetExpression) in PagedSearchResultbyIterableUtils, MapUtils, SetUtils, StringUtils, PatternMatcher and UrlUtilsFormUrlEncodedHttpRequestBody#getData()ProductProjectionFilterSearchModel.slug() CustomerQueryModel.lowercaseEmail()CompletableFutureUtils.listOfFuturesToFutureOfList(List),
CompletableFutureUtils.exceptionallyCompletedFuture(Throwable) and
CompletableFutureUtils.recoverWith(CompletionStage, Function, Executor) LineItem.getTaxedPrice(), CustomLineItem.getTaxedPrice() and CartShippingInfo.getTaxedPrice() ProductCategoriesIdTermFilterSearchModel
and ProductCategoriesIdTermFacetSearchModel to filter and facet for products in category treesTaxMode to enable external tax calculationTaxRate has been split into TaxRate (response object) and TaxRateDraft (input object)CompletableFutureUtils.recoverWith(CompletionStage, Function) could hang under some circumstancesQuerySortingModel#sort(io.sphere.sdk.queries.QuerySortDirection), use QuerySortingModel.sort() and then DirectionlessQuerySort.asc()/DirectionlessQuerySort.desc() insteadFieldsQueryModel to support the more field typesChannelChannelQueryModel so channels can be queried by rolesPagedResult.getCount() PagedResult#size() in favor of PagedResult.getCount()ProductProjectionQueryBuilder public (was not possible to instantiate)ProductDataExpansionModel.allVariants()ProductVariantAvailabilityFacetSearchModelSuggestQuery.withFuzzy(boolean) ChangeMasterVariantProductDraftBuilderBase.publish(Boolean) to create published productsSearchModel.TokensFacade.fetchCustomerPasswordFlowTokens(SphereAuthConfig, String, String) to get the access token for a customer for example to give the token to a mobile appSphereAuthConfig.getScopes() to configure the scope of the access tokenProductVariantAvailabilityFilterSearchModel.isOnStock() and ProductVariantAvailabilityFilterSearchModel.availableQuantity()ProductVariantAvailabilitySortSearchModel.restockableInDays() and ProductVariantAvailabilitySortSearchModel.availableQuantity()SetSku executes the action setSku which is staged,
previous to this version it was setSKU (upper case 'K' and 'U')
which updates in staged and current and has been moved to the deprecated class LegacySetSku.
See also the HTTP API doc of SetSku.CustomerCreateEmailTokenCommand, CustomerVerifyEmailCommand and CustomerPasswordResetCommand do not use anymore optimistic concurrency control,
so it won't fail with ConcurrentModificationException and it is not necessary to load the customer version.
CustomerCreateEmailTokenCommand#getVersion()CustomerPasswordResetCommand.of(io.sphere.sdk.models.Versioned, java.lang.String, java.lang.String)CustomerPasswordResetCommand.of(io.sphere.sdk.models.Versioned, io.sphere.sdk.customers.CustomerToken, java.lang.String)CustomerPasswordResetCommand.getId()CustomerPasswordResetCommand.getVersion()CustomerVerifyEmailCommand.of(io.sphere.sdk.models.Versioned, java.lang.String)CustomerVerifyEmailCommand.of(io.sphere.sdk.models.Versioned, io.sphere.sdk.customers.CustomerToken)CustomerVerifyEmailCommand.getId()CustomerVerifyEmailCommand.getVersion()ProductTypeQueryBuilder was a builder for CategoryQuery, it builds now ProductTypeQuery.SetPrices to update all prices in a ProductVariantmissing filters for product search exists filters for product search ProductVariantFilterSearchModel.sku()ProductProjection.getState() TransitionState, TransitionState, TransitionState)Carts by CartQueryModel.cartState() DuplicateFieldErrorSetKey to update the key of a ProductTypeChangeKey to update the key of a TypeAttributeDefinition.getInputHint() and AttributeDefinitionBuilder.inputTip(LocalizedString) ProductSlugChangedMessageSphereResources was empty after the migration from SBT to Maven.ProductVariantFilterSearchModel.scopedPrice() ChangeIsSearchableCategoryTree.findSiblings(Collection),
CategoryTree.getSubtree(Collection),
CategoryTree.getSubtreeRoots() and
CategoryTree.getRootAncestor(Identifiable)commercetools-java-client to 121 seconds so GatewayTimeoutException can occurChangeAmountPlannedTypeDeleteCommand.ofKey(String, Long) and TypeUpdateCommand.ofKey(String, Long, List) OrderState.CONFIRMED and ShipmentState.DELAYEDBlockingSphereClient by including the corresponding SphereRequest into the messagePrice is now an interface instead of a final classCartDiscountDraftBuilderBase.of(CartDiscountDraft)CartDraftBuilderBase.of(CartDraft)CategoryDraftBuilderBase.of(CategoryDraft)PaymentDraftBuilder.of(PaymentDraft)TransactionDraftBuilder.of(TransactionDraft)ProductDraftBuilderBase.of(ProductDraft)ProductVariantDraftBuilderBase.of(ProductVariantDraft)ReviewDraftBuilderBase.of(ReviewDraft)CustomFieldsDraftBuilderTypeDraftBuilderBase.of(TypeDraft)CustomObjects can be queried by value, see CustomObjectQueryModel.value()ObservedTotalDuration.getErrorResult(),
ObservedTotalDuration.getSuccessResult(),
ObservedDeserializationDuration.getHttpResponse()
and ObservedDeserializationDuration.getResult()
for better analysis of metrics with the
SimpleMetricsSphereClientDefaultProductAttributeFormatter.format(Attribute, Referenceable)
for
DefaultProductAttributeFormatter.convert(Attribute, Referenceable)PriceDraftBuilder.countryCode(String), PriceDraftBuilder.customerGroupId(String)ProductTypeLocalRepository.findByKey(String) and ProductTypeLocalRepository.getAll() SphereClientUtils supports methods to collect async results, for example SphereClientUtils.blockingWaitForEach(List, Duration) LocalizedStringEntry.of(String, String) ProductVariant.getPrice() and
ProductProjectionSearch.withPriceSelection(PriceSelection)ConcurrentModificationException.getCurrentVersion()
and ConcurrentModificationError
to get the current version number when a version conflict occursLocalizedToStringProductAttributeConverter
to DefaultProductAttributeFormatterDefaultProductAttributeFormatter publicMoneyImpls toString method has been alteredDuration using methods did not use the correct timeout,
for example SphereClientUtils.blockingWait(CompletionStage, Duration)
and BlockingSphereClient.of(SphereClient, Duration) were affectedSimpleMetricsSphereClient makes durations for requests observableJsonNodeQuery to use the query endpoints and get directly JsonNode instancesDuration API for SphereClientUtils.blockingWait(CompletionStage, Duration) and BlockingSphereClient.of(SphereClient, Duration) LocalizedString.ofStringToStringMap(Map) TokensFacade to conveniently just get an access token
MessageQuery.forMessageTypes(List)io.sphere.sdk.http.HttpClient as logger name with debug level to log the http method and the path (currently works only for the default HTTP client)LocalizedString#ofEnglishLocale(String), use LocalizedString.ofEnglish(String) insteadVariantIdentifier became ByIdVariantIdentifier and use VariantIdentifier as super interface for ByIdVariantIdentifier and BySkuVariantIdentifierProductProjectionSearch uses POST instead of GETio.sphere.sdk.client.SphereAccessTokenSupplierFactory, use SphereAccessTokenSupplier methods insteadSphereRequestBase, use SphereRequestUtils insteadExperimentalReactiveStreamUtils is not experimental anymore and has been moved out of commercetools-convenience to a separate repository: https://github.com/commercetools/commercetools-jvm-sdk-reactive-streams-add-onsCustomObjectDraft#withVersion(String, String, JsonNode)HttpQueryParameter classInvalidQueryOffsetExceptionProductProjectionSearchModel methods with the Query DSL, e.g. is instead of by, isIn instead of byAny and isBetween instead of byRangeTermFacetResult, RangeFacetResult and FilteredFacetResult into the same method name getFacetResultFacetAndFilter Expression and its Search Model have been renamed to FacetedSearch to better reflect the use caseReviews.ProductProjectionQueryBuilder
to build ProductProjectionQuery and
ProductProjectionSearchBuilder
to build ProductProjectionSearch.
The new way with builders (code with side effects)
@Nullable final String term = getTerm(); final ProductProjectionSearchBuilder searchBuilder = ProductProjectionSearchBuilder.ofCurrent() .limit(30) .sort(m -> m.name().locale(Locale.ENGLISH).asc()); if (StringUtils.isNotBlank(term)) { searchBuilder.text(Locale.ENGLISH, term); } final ProductProjectionSearch result = searchBuilder.build();See the test code.
The classic way (immutable objects, reassigning)
@Nullable final String term = getTerm(); ProductProjectionSearch search = ProductProjectionSearch.ofCurrent() .withLimit(30) .withSort(m -> m.name().locale(Locale.ENGLISH).asc()); if (StringUtils.isNotBlank(term)) { search = search.withText(Locale.ENGLISH, term); } final ProductProjectionSearch result = search;See the test code.
SetTitle,
SetFirstName,
SetMiddleName and
SetLastName.CustomObjectQuery supports now predicates containing key.
final CustomObjectQuery<JsonNode> customObjectQuery = CustomObjectQuery.ofJsonNode() .withPredicates(m -> m.container().is("my-container")) .plusPredicates(m -> m.key().isIn(asList("key1", "key2", "key3")));See the test code.
Project.getCurrencies() and Project.getCurrencyUnits() so you can get your enabled currencies for the Project.Attribute.getValueAsLong() and Attribute.getValueAsString(). For all see Attribute.LocalizedToStringProductAttributeConverter which provides some defaults to present product attribute (including monetary amounts and date) values as String. The behaviour can be changed through subclasses.HttpResponse.getResponseBody() returns the unpacked body.BlockingSphereClient which does not execute asynchronous: import io.sphere.sdk.client.BlockingSphereClient;
import io.sphere.sdk.client.SphereRequest;
import io.sphere.sdk.projects.Project;
import io.sphere.sdk.projects.queries.ProjectGet;
import static org.assertj.core.api.AssertionsForClassTypes.assertThat;
public class BlockingClientValueGetDemo { public static void demo(final BlockingSphereClient client, final String expectedProjectKey) { final SphereRequest<Project> sphereRequest = ProjectGet.of(); final Project project = client.executeBlocking(sphereRequest);//returns result directly, no CompletionStage assertThat(project.getKey()).isEqualTo(expectedProjectKey); } }See the test code.
ProductProjectionExpansionModel.allVariants() for expanding objects in masterVariant and the other variants with one code expression. final List<ExpansionPath<ProductProjection>> expansionPaths = ProductProjectionExpansionModel.of().allVariants().prices().customerGroup().expansionPaths(); assertThat(expansionPaths.stream().map(ExpansionPath::toSphereExpand).collect(Collectors.toList())) .containsExactly("masterVariant.prices[*].customerGroup", "variants[*].prices[*].customerGroup");See the test code.
GraphQL ExampleFieldDefinition.of(FieldType, String, LocalizedString, Boolean).SphereClientFactory.createClientOfApiConfigAndAccessToken(SphereApiConfig, String) and
SphereClientFactory.createClientOfApiConfigAndAccessToken(SphereApiConfig, String, HttpClient)
ProductDraftBuilder.plusVariants(List) and ProductDraftBuilder.plusVariants(ProductVariantDraft)SphereClientUtils.blockingWait(CompletionStage, long, TimeUnit) for waiting for sphere requestsCartLike.getCurrency() which gets the currency for a cart or an orderResourceTypeIdsSetBuilder which helps to find the resource type ids for creation Types.ResourceIdentifier, for example for creating products with the product type key: ProductDraftBuilder.of(ResourceIdentifiable, LocalizedString, LocalizedString, ProductVariantDraft) ProductVariant.isMatchingVariant().TestDoubleSphereClientFactory.createHttpTestDouble(Function)
and TestDoubleSphereClientFactory.createObjectTestDouble(Function) instead of methods from SphereClientFactory for test doubles.CartDraftBuilderTypes by resourceTypeIds and fieldDefinitions.Order by empty or not empty syncInfo.QueryDsl.plusSort(List).StateType.ProductProjectionQuery.bySku(List).TaxCategoryByIdGet.SphereClientFactory also auto discovers the Apache HTTP client SDK module if this is in the classpath and not the Async HTTP Client module.CustomFields.getFieldsJsonMap().DiscountedLineItemPriceForQuantity and RemoveLineItem uses long for quantity. Versioned.getVersion() is of type Long instead of long.FormUrlEncodedHttpRequestBody did not respect the order of elements and possible duplicates.
Use FormUrlEncodedHttpRequestBody.of(List) for construction and FormUrlEncodedHttpRequestBody.getParameters() for getting the data.
FormUrlEncodedHttpRequestBody#getData() is deprecated.SphereClientConfig.ofProperties(Properties, String) to get the Composable Commerce credentials form a properties file.AttributeDefinition#getIsRequired() and AttributeDefinition#getIsSearchable() ()} have been
deprecated in favor of AttributeDefinition.isRequired() and AttributeDefinition.isSearchable().
ChangeTransactionTimestamp,
ChangeTransactionInteractionId and
ChangeTransactionState
Transaction.getId() and Transaction.getState()Transaction has been split to TransactionDraft as input object
and Transaction as output object of the API.ProductProjection#findVariantBySky(String), use ProductProjection.findVariantBySku(String)search documentation, section Faceted Search.SearchExpression.value() and FacetExpression.alias() for the Search API.RangeTermFacetSearchModel.allRanges() to request a range facet for all values.io.sphere.sdk.search.model.RangeFacetBaseSearchModel#onlyRangeAsString(java.lang.String, java.lang.String) in favour of a more generic io.sphere.sdk.search.model.RangeFacetBaseSearchModel#onlyRangeAsString(FacetRange).SortSearchModel implementation classes have now static factory constructors, these class constructors have been removed from the public API.Range filter/facet search models to RangeTerm to emphasize that you can build both range and term oriented search expressions with them.CartExpansionModel.shippingInfo() and OrderExpansionModel.shippingInfo()ProductType.getKey()ProductTypeDraft#of(String, String, List) has been deprecated in favor of ProductTypeDraft.of(String, String, String, List) since it is a very good practice to create a ProductType with a key.SetShippingMethod.ofRemove() to be able to remove a ShippingMethod from a CartOrderFromCartCreateCommand contains an exampleMonetaryAmount with centAmount: MoneyImpl.ofCents(long, CurrencyUnit)state field to QueryModel for Products, Reviews and Orders.Price.getCustom()Price and PriceDraft.
Places where PriceDraft has to be used:
AddPriceChangePriceProductVariantDraftBuilder.price(PriceDraft)ProductVariantDraftBuilderBase.prices(List)AddVariantTo roughly compare a Price with a PriceDraft, use PriceDraft.of(Price) to create a draft out of the price and then compare the drafts.
query.withSort(m -> m.createdAt().sort(DESC)); is deprecated, use it with query.withSort(m -> m.createdAt().sort().desc());io.sphere.sdk.queries.ExperimentalReactiveStreamUtils#publisherOf(QueryDsl, SphereClient) on multiple parallel request(n) calls. See 809.LineItem is null. See 771.SortExpression instead of a single value.PagedSearchResult.getTermFacetResult(java.lang.String), PagedSearchResult.getRangeFacetResult(java.lang.String) and PagedSearchResult.getFilteredFacetResult(java.lang.String) that accept the facet path.io.sphere.sdk.search.model.TermFilterSearchModel#byAny and io.sphere.sdk.search.model.TermFilterSearchModel#byAll (OR and AND semantics, respectively), along with the counterpart for range filters io.sphere.sdk.search.model.RangeTermFilterSearchModel#byAnyRange and io.sphere.sdk.search.model.RangeTermFilterSearchModel#byAllRanges), change that affected the signature of all filter methods which now return a list of FilterExpression instead of a single value.io.sphere.sdk.search.model.SortSearchModel#byAsc and io.sphere.sdk.search.model.SortSearchModel#byDesc, as well as io.sphere.sdk.search.model.MultiValueSortSearchModel#byAscWithMax and io.sphere.sdk.search.model.MultiValueSortSearchModel#byDescWithMin for multi-valued attributes.io.sphere.sdk.search.UntypedSearchModel class and instead provide methods to give filter and facet parameters as simple strings.
final ProductProjectionSearch search = ProductProjectionSearch.ofStaged() .plusQueryFilters(productModel -> productModel.allVariants().attribute().ofNumber(ATTR_NAME_SIZE).containsAnyAsString(asList("36", "38"))); testResultIds(search, resultIds -> assertThat(resultIds).containsOnly(product1.getId(), product2.getId()));See the test code.
attribute + action + parameters, now it changed to action + attribute + parameters, in order to split the model into 3 independent models: Search Filter Model, Search Facet Model and Search Sort Model.
ProductProjectionSearch search = ProductProjectionSearch.ofStaged()
.plusQueryFilters(product -> product.name().locale(ENGLISH).filtered().by("shoes"));
PagedSearchResult<ProductProjection> result = client.execute(search);
Now it is built as follows:
ProductProjectionSearch search = ProductProjectionSearch.ofStaged()
.plusQueryFilters(filter -> filter.name().locale(ENGLISH).by("shoes"));
PagedSearchResult<ProductProjection> result = client.execute(search);
SearchSort to SortExpression, which now shares the same properties as FacetExpression and FilterExpression under the SearchExpression interface.FacetExpression is now located in TermFacetExpression, RangeFacetExpression and FilteredFacetExpression, so that a facet expression for the corresponding type is obtained.io.sphere.sdk.search to io.sphere.sdk.search.model package, to clearly separate the Search Model from the Search API classes.TermFacetResult, RangeFacetResult and FilteredFacetResult, which now return simple strings as they are received from Composable Commerce.ProductProjection.getCategoryOrderHints() and ProductProjectionQueryModel.categoryOrderHints(). It can be used for search as shown in the following example, but the meta model comes in a later release.
final ProductProjectionSearch searchRequest = ProductProjectionSearch.ofStaged() .withQueryFilters(productModel -> productModel.categories().id().is(categoryId)) .withSort(productModel -> productModel.categoryOrderHints().category(categoryId).asc()); return client().executeBlocking(searchRequest).getResults();See the test code.
Order.getState(), Product.getState(), io.sphere.sdk.reviews.Review#getState()LineItem.getTotalPrice(), LineItem.getDiscountedPricePerQuantity(), CustomLineItem.getTotalPrice() and CustomLineItem.getDiscountedPricePerQuantity()LineItem#getDiscountedPrice() and CustomLineItem#getDiscountedPrice() since they are deprecated in the HTTP APIVersioned.Payment.io.sphere.sdk.carts.CartDraft#witCustom(CustomFieldsDraft), use io.sphere.sdk.carts.CartDraft#withCustom(CustomFieldsDraft) instead.io.sphere.sdk.customers.queries.CustomerByTokenGet, use CustomerByPasswordTokenGet instead.CustomObjectByIdGet and CustomObjectDeleteCommand.of(String, Long, Class) which can delete a CustomObject by ID.TypeReference for the endpoint result only the class of the value of the custom object needs to be provided.
Before:
final CustomObjectQuery<Pojo> query = CustomObjectQuery.of(new TypeReference<PagedQueryResult<CustomObject<Pojo>>>(){});
After:
final CustomObjectQuery<Pojo> query = CustomObjectQuery.of(Pojo.class);
This change applies for other endpoints, too.
CustomObjectDeleteCommand#of(io.sphere.sdk.customobjects.CustomObject)CustomObjectDeleteCommand.ofJsonNode(CustomObject)CustomObjectDeleteCommand#of(java.lang.String, java.lang.String)CustomObjectDeleteCommand.ofJsonNode(java.lang.String, java.lang.String)CustomObjectByKeyGet#of(java.lang.String, java.lang.String)CustomObjectByKeyGet.ofJsonNode(java.lang.String, java.lang.String)CustomObjectQuery#of()CustomObjectQuery.ofJsonNode()ProductProjectionSearch.withFuzzy(Boolean)Customercustom fieldsTermStats contains not anymore "T" and "F" but "true" and "false".io.sphere.sdk.customers.commands.CustomerCreateTokenCommand, use CustomerCreatePasswordTokenCommand insteadProductProjection is also a Versioned for ProductAttributeAccess.ofInteger(), AttributeAccess.ofIntegerSet(), AttributeAccess.ofLong(), AttributeAccess.ofLongSet()TaxCategoryUpdateCommandProductDraftBuilder.taxCategory(Referenceable), ProductDraftBuilderBase.searchKeywords(SearchKeywords)Reference<Void> and Reference<Object> is now Reference<JsonNode>UpdateCommand.getUpdateActions()ProductPublishedMessage, ProductUnpublishedMessageAddress.equalsIgnoreId(Address), io.sphere.sdk.products.Price#equalsIgnoreId(Price), io.sphere.sdk.taxcategories.TaxRate#equalsIgnoreId(TaxRate)This release is intended to be the last release before 1.0.0-RC1.
ProductDiscountCreateCommand,
ProductDiscountUpdateCommand,
ProductDiscountDeleteCommand,
ProductDiscountByIdGet,
ProductDiscountQuery
product attribute tutorial.category tutorial.message endpoint.MoneyImpl.ofCents(long, CurrencyUnit) can be used to create monetary valuesChangeQuantity to update InventoryEntrys.ChannelRole.PRODUCT_DISTRIBUTION.LineItem.getDistributionChannel().ProductProjectionSearch.plusFacetFilters(Function).QueryDocumentation.FormattingDocumentation.ProductTypeUpdateCommand.QueryDsl.withFetchTotal(boolean).QueryPredicates can be negated with QueryPredicate.negate()CartState.ORDERED and Order.getCart().io.sphere.sdk.products.ProductProjection#findVariantBySky(String).Optional as return type for optional values has been removed, now the annotation Nullable is used to mark objects as not mandatory. This change was necessary to provide a stable API, to provide later serializable Objects and sparse representations for objects.SphereClient has been changed, see GettingStarted and SphereClientFactory.product attribute tutorial.ChangePrice, RemovePrice. Keep in mind that io.sphere.sdk.products.Price#equals(Object) includes the ID.ProductProjectionByIdFetch is now ProductProjectionByIdGetJsonUtils have been renamed to SphereJsonUtils, this is an internal utility class working for the Composable Commerce context, it is not intended to build apps or libs on it.ChannelRoles have been renamed to ChannelRole.SearchText is now LocalizedStringEntryProductUpdateScope, so all product update actions update only staged.TestingDocumentation to build the objects anyway.InequalityQueryModel.isGreaterThan(Object) and other methods do not quote strings correctly. See 558.io.sphere.sdk.products.search.ExperimentalProductProjectionSearchModel#productType() enables you to build search expressions with the Product Type reference of productsProductVariant.getIdentifier() enables to get the product id and the variant id from the variant. This is nice, since this data is often needed and on the product variant level the product ID is not available.LineItem.getProductSlug()CategoryExpansionModel.ancestors(int).ProductProjectionByIdGet.withExpansionPaths(ExpansionPath).QueryDsl<Category> will be CategoryQuery
Benefits of the new API:
final ProductProjectionQuery query = ProductProjectionQuery.ofCurrent() .withPredicates(m -> m.productType().id().is("product-type-id-1")) .withSort(m -> m.name().lang(Locale.ENGLISH).sort().asc()) .withExpansionPaths(m -> m.productType());See the test code.
//you need to know and import this classes final ProductProjectionQueryModel queryModel = ProductProjectionQueryModel.of(); final ProductProjectionExpansionModel<ProductProjection> expansionModel = ProductProjectionExpansionModel.of(); final ProductProjectionQuery query = ProductProjectionQuery.ofCurrent() .withPredicates(queryModel.productType().id().is("product-type-id-1")) .withSort(queryModel.name().lang(Locale.ENGLISH).sort().asc()) .withExpansionPaths(expansionModel.productType());See the test code.
val query = ProductProjectionQuery.ofCurrent()
.withPredicateScala(_.productType.id.is("product-type-id-1"))
.withSortScala(_.name.lang(ENGLISH).sort.asc)
.withExpansionPathsScala(_.productType)
final ProductProjectionQuery query = ProductProjectionQuery.ofCurrent() .withExpansionPaths(m -> m.masterVariant().attributes().value()); assertThat(query.expansionPaths().get(0).toSphereExpand()) .isEqualTo("masterVariant.attributes[*].value");See the test code.
io.sphere.sdk.reviews.commands.ReviewDeleteCommandSphereClientConfig.ofEnvironmentVariables(String) to get the ProductAttributeDocumentation how it works now.SphereClient implements AutoCloseable instead of Closeable.Instant to ZonedDateTime since the latter also contains a timezone which better reflects the date time data of Composable Commerce.CategoryTree.findChildren(Identifiable).Category#getPathInTree()ExperimentalProductImageUploadCommand, but you can find a similar command here: https://github.com/commercetools/commercetools-jvm-sdk-experimental-java-add-onsPrice: Price.getValidFrom() and Price.getValidUntil().ProductProjectionQueryModel.allVariants() to formulate a predicate for all variants. In Composable Commerce, the json fields masterVariant (object) and variants (array of objects) together contain all variants.ProductProjectionQuery.ofCurrent() and ProductProjectionQuery.ofStaged() saves you the import of ProductProjectionType.CompletionStage does not support by default timeouts which are quite important in a reactive application so you can decorate the SphereClient with TimeoutSphereClientDecorator to get a TimeoutException after a certain amount of time. But this does NOT cancel the request to Composable Commerce.io.sphere.sdk.reviews.Review endpoints and models are implemented, but we suggest to not use it, since io.sphere.sdk.reviews.Reviews cannot be deleted or marked as hidden.ProjectGet to get the currencies, countries and languages of the Project.Category.getMetaTitle(), Category.getMetaDescription() and Category.getMetaKeywords() and
update actions SetMetaTitle, SetMetaDescription and SetMetaKeywords.CartDiscountCreateCommand.DiscountCodeCreateCommand.SphereApiConfig, SphereAuthConfig, SphereClientConfig validates the input, so for example you cannot enter null or whitespace for the project key.ProductProjectionSearchModel are using ZonedDateTime instead of LocalDateTime.ProductProjectionSearchModel has been improved with better naming and better documentation.io.sphere.sdk.queries.Predicate has been renamed to QueryPredicate.io.sphere.sdk.products.commands.updateactions.SetMetaAttributes has been removed since it is deprecated in Composable Commerce.
Use SetMetaTitle,
SetMetaDescription,
SetMetaKeywords or MetaAttributesUpdateActions for all together.
CustomerSignInCommand shows more problem details. See #397.io.sphere.sdk.client.SphereClientFactory#createClient(io.sphere.sdk.client.SphereClientConfig) was used.
It created twice a http client instance and closed just one.LocalizedString.mapValue(BiFunction) and LocalizedString.stream()
can be used transform LocalizedString, for example for creating slugs or formatting.CompletableFutureUtils to work with Java 8 Futures.AsyncDocumentation documents how to work with CompletableFuture and CompletionStage.SphereExceptions may give hint to developers how to recover from errors. For example on typical elasticsearch related problems it suggests to reindex the product index.io.sphere.sdk.states.StateBuilder contributed by Ansgar BraunerProductVariantQueryModel#where(java.util.function.Function).OrderQuery.byCustomerId(java.lang.String) and OrderQuery.byCustomerEmail(java.lang.String)ChannelUpdateCommandChannelByIdGetCustomerQuery.byEmail(java.lang.String)SphereRequest has been refactored:Function<HttpResponse, T> resultMapper() is now SphereRequest.deserialize(HttpResponse)boolean canHandleResponse(final HttpResponse response) is now SphereRequest.canDeserialize(HttpResponse)CompletableFuture has been replaced with CompletionStage.
You can convert from CompletionStage to CompletableFuture with CompletionStage.toCompletableFuture().
The opposite direction can be achieved with assigning CompletableFuture (implementation) to CompletionStage (interface).SphereClient, <T> CompletionStage<T> execute(final SphereRequest<T> sphereRequest)
is now SphereClient.execute(SphereRequest) which returns CompletionStage instead of CompletableFuture.
LineItem.getTaxRate() is optional.LineItem.getState() now returns a set instead of a list.ProductProjection.getCategories() now returns a set instead of a list.OrderImportCommand.io.sphere.sdk.attributes.AttributeAccess#ofNested() + io.sphere.sdk.attributes.AttributeAccess#ofNestedSet().SphereServiceException.getJsonBody().HttpResponse also contains HttpHeaders.ProductProjectionSearchModel. See also SearchDocumentation.ProductType creation has been simplified (TextAttributeDefinition, LocalizedStringsAttributeDefinition, ... are just AttributeDefinition), see ProductTypeCreateCommand how to create them.TermFacetResult and
RangeFacetResult are using generics.
TermFacetResult uses long instead of int for some methods like TermFacetResult.getMissing().SearchDsl have been renamed.io.sphere.sdk.search.RangeStats#getMean() now returns a double.HttpHeaders allows reoccurring headers.io.sphere.sdk.client.HttpRequestIntent@7308a939[httpMethod=POST,path=/categories,headers={},body=Optional[io.sphere.sdk.http.StringHttpRequestBody@216ec9be[body={invalidJson :)]]] to HttpRequestIntent[httpMethod=POST,path=/categories,headers={},body=Optional[StringHttpRequestBody[body={invalidJson :)]]]SphereException.getMessage() now returns also the project debug info.SphereClient architecture has been refactored, so it is now possible to inject access token suppliers and custom HTTP clients.
AsyncHttpClientAdapter enables to use a custom underlying Ning HTTP client for settings like proxies or max connections per host.java-client-apache-async contains an adapter to use the Apache HTTP client instead of the current default client Ning.QueueSphereClientDecorator enables to limit the amount of concurrent requests to Composable Commerce with a task queue.io.sphere.sdk.client.SphereAccessTokenSupplierFactory is a starting point to create custom access token suppliers for one token (either fetched from Composable Commerce or as String) or auto refreshing for online shops.SphereRequestDecorator to decorate SphereRequests.Exception hierarchy, relocated some exceptions and deleted some.
SphereError from a ErrorResponseExceptionJsonException.IllegalArgumentException.HttpRequest has changed tasks and structure, now it contains the full information for a HTTP request whereas now HttpRequestIntent is an element to describe an endpoint of sphere project independent.JsonEndpoint moved to the client packageGet class names end now with Fetch for consistency, so for example CartFetchById is now CartByIdGet.DeleteCommand implementations don't have ById or ByKey in the class name and the of factory method returns the interface, not the implementation, example CategoryDeleteCommand.of(io.sphere.sdk.models.Versioned).State models, creation and deletion contributed by Ansgar BraunerAddVariant, RemoveFromCategory, RemoveVariant, RevertStagedChanges, SetAttribute, SetAttributeInAllVariants, SetSearchKeywordsCustomObject models and endpoints. There is also a tutorial for custom objects.Zone models and endpoints.ShippingMethod models and endpoints../activator ui or on Windows with activator ui.UpdateCommand fails because of concurrent usage.DeleteCommand and the resource is referenced by another resource and cannot be deleted before deleting the other resource.SetShippingMethod and SetCustomerId.SetCustomerId.Referenceable.hasSameIdAs(io.sphere.sdk.models.Referenceable) to check if a similar object has the same ID.AttributeAccess#ofName(String) as alias to io.sphere.sdk.attributes.AttributeAccess#getterSetter(String).UpdateActionImpl.
Example: List<ChangeName> can be assigned where ChangeName extends UpdateActionImpl.Address.of(com.neovisionaries.i18n.CountryCode).io.sphere.sdk.carts.Cart#getLineItem(String) and io.sphere.sdk.carts.Cart#getCustomLineItem(String) to find items in a cart.ProductProjection.getAllVariants() to receive master variant and all other variants in one call. ProductProjection.getVariants() just returns all variants except the master variant.ProductProjection.getVariant(int) and ProductProjection.getVariantOrMaster(int) to find a product variant by id.VariantIdentifier to have a container to address product variants which needs a product ID and a variant ID.CustomerDeleteCommand to delete customers.AddExternalImage to connect products with images not hosted by Composable Commerce.RemoveImage to disconnect images from a product (external images and ones hosted by Composable Commerce).SphereAccessTokenSupplier as authentication method in the SphereClient.
It is possible to automatically refresh a token or just pass a token to the client, see SphereClientFactory.createClient(io.sphere.sdk.client.SphereApiConfig, io.sphere.sdk.client.SphereAccessTokenSupplier) and SphereAccessTokenSupplier.ofConstantToken(String).Reference is not instantiated with new.UrlQueryBuilder is not instantiated with new.ClientRequest has been renamed to SphereRequest and therefore ClientRequestBase to io.sphere.sdk.client.SphereRequestBase. ClientRequest has been renamed to SphereRequest and therefore ClientRequestBase to io.sphere.sdk.client.SphereRequestBase. JavaClient has been renamed to SphereClient and uses the SphereClientFactory to initialized a client, JavaClientIml has been removed, see GettingStarted.
The typesafe config library is not used anymore. The class HttpClientTestDouble has been removed, use io.sphere.sdk.client.SphereClientFactory#createHttpTestDouble(java.util.function.Function) instead.
SphereRequestExecutor and SphereRequestExecutorTestDouble have been removed, use io.sphere.sdk.client.SphereClientFactory#createObjectTestDouble(java.util.function.Function) instead.
TaxPortion.getAmount() instead of getMoney().ImageDimensions which caused adding external images to a product to fail.io.sphere.sdk.products.commands.ExperimentalProductImageUploadCommand.Image.Image contains directly getters for width Image#getWidth()
and height Image#getHeight().PagedQueryResult is constructable for empty results. Before this, the SDK throwed an Exception.quantity are now of type long instead of int.how to construct objects.Carts, Customers, CustomerGroups and Orders.ProductByIdGet take now a string parameter for the ID and not an Identifiable.CategoryCreateCommand.of(io.sphere.sdk.categories.CategoryDraft). The instantiation by constructor is not supported anymore.NewCategory have been renamed to CategoryDraft. ProductTypeDraft has now only
factory methods with an explicit parameter for the attribute declarations to prevent to use
the getter ProductTypeDraft.getAttributes() and list add operations. LocalizedString has been renamed to LocalizedString, since it is not a container for one string and a locale, but for multiple strings of different locals. It is like a map.Get classes have been renamed. From FetchRESOURCEByWhatever to RESOURCEFetchByWhateverSphereResources contains now also a listing of queries and commands for the resources.ProductProjectionSearch for full-text, filtered and faceted search.io.sphere.sdk.products.ProductUpdateScope makes it more visible that product update operations can be for only staged or for current and staged. The product update actions will be affected by that.ProductProjectionQuery.QueryDocumentation to document the query API.MetaAttributes in common module and make it an interface.ProductProjection.isPublished().ProductDiscount models.external id fields and methods for categories.ProductCatalogData.getCurrent() return an optional ProductData, since current should not be accessible if ProductCatalogData.isPublished() returns false.ProductDraftBuilder mandatory.io.sphere.sdk.jvm.JsonUtils.readObjectFromJsonFileInClasspath to JsonUtils.readObjectFromResource.ProductProjections.io.sphere.sdk.categories.queries.CategoryQuery#model().Getting Started page.Features of the SDK page.PriceBuilder.CategoryTree.of(java.util.List) instead of CategoryTreeFactory is to be used for creating a category tree.AddressBuilder out of the Address class.requests package to httpStringQueryModel.isGreaterThanOrEqualTo(String),
StringQueryModel.isNot(String),
io.sphere.sdk.queries.StringQueryModel#isNotIn(String, String...) or StringQueryModel.isNotPresent().QueryPredicate.of(String).io.sphere.jvmsdk.sphere.products.responses.queries logs only the responses of the queries for products. The trace level logs the JSON of responses and requests as pretty printed JSON.io.sphere.sdk.models.Referenceable which enables to use a model or a reference to a model as parameter, so no direct call of io.sphere.sdk.models.DefaultModel#toReference() is needed anymore for model classes.io.sphere.sdk.test.DefaultModelAssert, io.sphere.sdk.test.LocalizedStringAssert and io.sphere.sdk.test.ReferenceAssert.Versioned contains a type parameter to prevent copy and paste errors.