Skip to content

14.0.0

Compare
Choose a tag to compare
@mvantellingen mvantellingen released this 05 Mar 07:47
· 46 commits to main since this release

Changes

  • Update the request builder pattern to match the commercetools SDK's for other languages.
    This means that the old pattern:

    from commercetools.client import Client
    
    client = Client()
    product = client.products.get_by_id("00633d11-c5bb-434e-b132-73f7e130b4e3")

    is replaced with the new pattern:

    from commercetools.platform.client import Client
    
    client = Client()
    product = (
      client
      .with_project_key("<your-project-key>")
      .products()
      .with_id("00633d11-c5bb-434e-b132-73f7e130b4e3")
      .get())

    The old pattern is deprecated but will remain backwards compatible for now

  • Regenerated code with latest commercetools api specs as of march 2022. This
    means that new features like the product selections api's are now available.

  • Allow passing custom HTTP adapter to BaseClient (@lime-green)

  • Add support for custom address fields and update actions

  • Testing framework

    • Add support for Order imports
    • Fixed issues with get_by_key lookups in certain testing backends
    • Added missing actions for Cart Discounts, Discount Codes and Extensions
    • Add datetime and list updater utils
    • Add setLocalizedDescription action for shipping_method
    • Add changeAttributeConstraint action for product_type
    • Add setLineItemCustomField action for cart and order
    • Fix helper function to set enum fields giving an error on fields that have no value

Notes on code generation

We moved our code generation to the code generation tool from Commercetools,
see https://github.com/commercetools/rmf-codegen

Reason for this is two-fold:

  1. We can now generate the code for the imporapi and the ml api
    specifications next to the platform sdk.
  2. It makes it easier for us to keep the code generation in sync with
    changes to the API specification.

The major difference is that it now also use the request builder pattern,
matching the SDK's for the other languages (e.g. TypeScript).

The package is backwards compatible for now, although deprecation warnings are
shown.