v2.0.5
medusajs/medusav2.0.5Nov 25, 2024by olivermrbl
AI Summary
This release introduces product image ordering and customer transfer on carts, along with support for several new languages.
Key Highlights
- Product images now support re-ordering via a `rank` field.
- Carts can be transferred from guest customers to registered customers.
- New languages added: German, Spanish, Turkish, and Polish.
Breaking Changes
- Relationship between product and images changed from many-to-many to one-to-many.
- Pivot table `product_images` has been dropped.
- `rank` and `product_id` columns added to the `image` table.
New Features
- Order add quantity diff.
- Make product option value linkable.
- Request & accept order transfer.
- Add optional fields.
- Add API to update cart's customer.
- Request order transfer storefront API.
- Add updateCustomer to JS SDK.
- Add support for making relationships searchable.
- Allow re-ordering images.
Full Release Notes
<!--

# v2.0.5
This version introduces product image ordering and customer transfer on carts.
CMS_BREAK -->
## Highlights
### Product image reordering
> [!WARNING]
Schema changes
We have introduced support for re-ordering product images. Product images now have a `rank` field. The field is set based on the index of the image in the `images` payload to create and update products.
For example:
```sh
POST /admin/products
{ images: [{ url: "one" }, { url: "two" }]
```
Will translate to the following:
```sh
{ ..., images: [{ url: "one", rank: 0 }, { url: "two", rank: 1 }]
```
The same pattern is followed when updating the product.
Images are always sorted by the rank.
**Schema changes**
This feature comes with changes to the data models of the product module:
- The relationship between product and images has changed from a many-to-many to one-to-many. As a result, the pivot table `product_images` has been dropped
- `rank` has been added to the `image` table
- `product_id` has been added to the `image` table
**Upgrade guide**
To apply the latest migrations run the following command:
```bash
npx medusa db:migrate
```
### Cart customer transfers
We have added support for transferring carts from a guest to a registered customer.
The flow is as follows:
**Create cart with guest customer**
```sh
POST /store/carts
{ email: "guest@customer.com" }
```
**Transfer cart to registered customer**
```sh
POST /store/carts/:id/customer
```
The call to transfer assumes you are signed in and uses the customer ID from the authentication context on the request.
### New languages
Our admin dashboard has been translated into German, Spaning, Turkish, and Polish
## Features
* feat(core-flows): order add quantity diff by @carlos-r-l-rodrigues in https://github.com/medusajs/medusa/pull/10065
* feat(product): Make product option value linkable by @adrien2p in https://github.com/medusajs/medusa/pull/10116
* feat(medusa, types, utils, core-flows, order) request & accept order transfer by @fPolic in https://github.com/medusajs/medusa/pull/10106
* feat: add optional fields by @thetutlage in https://github.com/medusajs/medusa/pull/10150
* fix(dashboard): order edit - display item quantity change correctly by @fPolic in https://github.com/medusajs/medusa/pull/10078
* feat(core-flows,medusa): Add API to update cart's customer by @riqwan in https://github.com/medusajs/medusa/pull/10151
* feat(medusa): request order transfer storefront API by @fPolic in https://github.com/medusajs/medusa/pull/10156
* feat(types, js-sdk): add updateCustomer to js-sdk by @riqwan in https://github.com/medusajs/medusa/pull/10158
* feat: add support for making relationships searchable by @thetutlage in https://github.com/medusajs/medusa/pull/10172
* feat(workflows-sdk): add response to permanent failure by @carlos-r-l-rodrigues in https://github.com/medusajs/medusa/pull/10177
* feat(medusa): skip draft orders on order list by @riqwan in https://github.com/medusajs/medusa/pull/10195
* feat(core-flows,medusa): remove cart customer validation + rename workflow by @riqwan in https://github.com/medusajs/medusa/pull/10207
* feat(dashboard): transfer order admin by @fPolic in https://github.com/medusajs/medusa/pull/10189
* feat(medusa,core-flows,types,js-sdk): decline / cancel order transfer by @fPolic in https://github.com/medusajs/medusa/pull/10202
* feat(product,dashboard): Allow re-ordering images by @kasperkristensen in https://github.com/medusajs/medusa/pull/10187
## Bugs
* fix(orchestration): fix set step failure by @carlos-r-l-rodrigues in https://github.com/medusajs/medusa/pull/10031
* fix(core-flows): capture before order created by @carlos-r-l-rodrigues in https://github.com/medusajs/medusa/pull/9980
* fix: do not update the .env.template file with the database name by @thetutlage in https://github.com/medusajs/medusa/pull/10073
* fix(core-flows): Fix date usage accross workflows by @adrien2p in https://github.com/medusajs/medusa/pull/10100
* fix(admin-shared,dashboard): Add missing injection zones by @kasperkristensen in https://github.com/medusajs/medusa/pull/10098
* fix(dashboard): Fix active nav link styling for built-in routes by @kasperkristensen in https://github.com/medusajs/medusa/pull/10082
* fix(dashboard): Add missing inventory list zones by @kasperkristensen in https://github.com/medusajs/medusa/pull/10117
* fix(dashboard): Add Breadcrumb components by @kasperkristensen in https://github.com/medusajs/medusa/pull/10079
* fix(product): wrong snapshot name and inexistent script by @adrien2p in https://github.com/medusajs/medusa/pull/10119
* fix(inventory): update reservation quantity by @carlos-r-l-rodrigues in https://github.com/medusajs/medusa/pull/10139
* fix(payment): Idempotent cancellation and proper creationg fail handling by @adrien2p in https://github.com/medusajs/medusa/pull/10135
* fix: add address and customer metadata to tax calc context by @srindom in https://github.com/medusajs/medusa/pull/10122
* fix(core-flows): Add missing cart sales channel id fields to be part of the application context by @adrien2p in https://github.com/medusajs/medusa/pull/10142
* fix(product): Update full descendant tree mpath when updating parent category id by @adrien2p in https://github.com/medusajs/medusa/pull/10144
* fix(dashboard): updated variant title is used when creating product by @riqwan in https://github.com/medusajs/medusa/pull/10155
* fix(framework,types): correct example of database driver options by @riqwan in https://github.com/medusajs/medusa/pull/10166
* fix: Remove undefined from events in update by @olivermrbl in https://github.com/medusajs/medusa/pull/10170
* fix(types): fix AdminBatchProductRequest to have product ID by @shahednasser in https://github.com/medusajs/medusa/pull/10168
* fix: incorrect changeset breaks preview builds by @riqwan in https://github.com/medusajs/medusa/pull/10173
* fix: move transfer cart under cart by @riqwan in https://github.com/medusajs/medusa/pull/10175
* fix(framework): handle deprecated Dirent path by @carlos-r-l-rodrigues in https://github.com/medusajs/medusa/pull/10179
* feat(medusa): enable price list prices for product endpoints by @riqwan in https://github.com/medusajs/medusa/pull/10197
* fix: Update js-sdk with token by @olivermrbl in https://github.com/medusajs/medusa/pull/10211
* fix(types): Graph types fixes by @adrien2p in https://github.com/medusajs/medusa/pull/10220
* fix(js-sdk): Preserve `path` in `baseUrl` by @kasperkristensen in https://github.com/medusajs/medusa/pull/10222
* fix(admin-vite-plugin): Move @babel/types to dependencies from devDependencies to make it compatible with Yarn PnP by @kasperkristensen in https://github.com/medusajs/medusa/pull/10236
## Documentation
* Fix grammar issue in the doc by @webgodo in https://github.com/medusajs/medusa/pull/10064
* Fix Typo in Documentation by @hadicph in https://github.com/medusajs/medusa/pull/9989
* docs: fix slugs pointing to admin rather than store routes by @shahednasser in https://github.com/medusajs/medusa/pull/10063
* docs: remove duplicate buttons in code actions by @shahednasser in https://github.com/medusajs/medusa/pull/10061
* docs: add documentation on validateAndTransformQuery by @shahednasser in https://github.com/medusajs/medusa/pull/10060
* docs: fix error to medusa configuration guide by @shahednasser in https://github.com/medusajs/medusa/pull/10059
* docs: update event module guide by @shahednasser in https://github.com/medusajs/medusa/pull/10056
* docs: document multiple steps usage in a workflow by @shahednasser in https://github.com/medusajs/medusa/pull/10053
* docs: change useRemoteQueryStep to useQueryGraphStep by @shahednasser in https://github.com/medusajs/medusa/pull/10051
* docs-util: fix helper step settings by @shahednasser in https://github.com/medusajs/medusa/pull/10045
* docs: added note about test timeout by @shahednasser in https://github.com/medusajs/medusa/pull/10041
* docs: fix outdated links by @shahednasser in https://github.com/medusajs/medusa/pull/10040
* docs: add emit events + types documentation by @shahednasser in https://github.com/medusajs/medusa/pull/10026
* docs: fix types of injection zone props by @shahednasser in https://github.com/medusajs/medusa/pull/10074
* docs: added + updated build and deployment guides by @shahednasser in https://github.com/medusajs/medusa/pull/10019
* docs: update to next 15 + eslint 9 by @shahednasser in https://github.com/medusajs/medusa/pull/9839
* docs: fix oneOf design hiding more than three items by @shahednasser in https://github.com/medusajs/medusa/pull/10077
* docs-utils: make reference table of content in alphabetical order by @shahednasser in https://github.com/medusajs/medusa/pull/10084
* docs: improv version detection + fix breadcrumbs by @shahednasser in https://github.com/medusajs/medusa/pull/10083
* docs: add missing import in digital product recipe by @shahednasser in https://github.com/medusajs/medusa/pull/10094
* docs: fix client error for learning path by @shahednasser in https://github.com/medusajs/medusa/pull/10102
* docs: add guide on how to translate admin by @shahednasser in https://github.com/medusajs/medusa/pull/10095
* docs: update admin injection zones list by @shahednasser in https://github.com/medusajs/medusa/pull/10103
* docs: add note about using dates in workflows by @shahednasser in https://github.com/medusajs/medusa/pull/10107
* docs: document nested UI routes by @shahednasser in https://github.com/medusajs/medusa/pull/10104
* docs: fix copy in code blocks with tabs by @shahednasser in https://github.com/medusajs/medusa/pull/10123
* docs: add missing prerequisite in stripe's storefront integration by @shahednasser in https://github.com/medusajs/medusa/pull/10097
* docs: S3 providers - add example for DigitalOcean Spaces endpoint by @JohnGemstone in https://github.com/medusajs/medusa/pull/10145
* docs: fix error on collapsing prerequisites by @shahednasser in https://github.com/medusajs/medusa/pull/10153
* docs: remove section on updating cart's customer by @shahednasser in https://github.com/medusajs/medusa/pull/10154
* docs: fix provider ID in payment's webhook URL by @shahednasser in https://github.com/medusajs/medusa/pull/10157
* docs: change report issue link by @shahednasser in https://github.com/medusajs/medusa/pull/10160
* docs-util: remove duplicate methods from JS SDK reference by @shahednasser in https://github.com/medusajs/medusa/pull/10161
* docs: add section on querying records from a link's table by @shahednasser in https://github.com/medusajs/medusa/pull/10165
* docs: fix heading import in ui route docs by @shahednasser in https://github.com/medusajs/medusa/pull/10167
* chore(js-sdk,types): add tsdocs for admin JS SDK methods [6/n] by @shahednasser in https://github.com/medusajs/medusa/pull/10028
* docs: add Sanity integration guide by @shahednasser in https://github.com/medusajs/medusa/pull/10152
* chore: optimize sanity opengraph image by @shahednasser in https://github.com/medusajs/medusa/pull/10181
* docs: revise intro pages by @shahednasser in https://github.com/medusajs/medusa/pull/10182
* docs: fix font smoothing across projects by @shahednasser in https://github.com/medusajs/medusa/pull/10183
* docs: add default value if PAK environment variable isn't set by @shahednasser in https://github.com/medusajs/medusa/pull/10185
* docs: revise medusa container chapter by @shahednasser in https://github.com/medusajs/medusa/pull/10192
* docs: migrate Kapa by @shahednasser in https://github.com/medusajs/medusa/pull/10198
* Set proper name for the steps in the schedule-task page by @webgodo in https://github.com/medusajs/medusa/pull/9716
* docs: fix og image for sanity guide by @shahednasser in https://github.com/medusajs/medusa/pull/10205
* docs: update og images by @shahednasser in https://github.com/medusajs/medusa/pull/10206
* docs: change logo by @shahednasser in https://github.com/medusajs/medusa/pull/10208
* docs: revise modules by @shahednasser in https://github.com/medusajs/medusa/pull/10204
* docs: revise commerce modules by @shahednasser in https://github.com/medusajs/medusa/pull/10209
* docs: revise loaders documentation by @shahednasser in https://github.com/medusajs/medusa/pull/10224
* chore: fix cURL example in create payment collection route by @shahednasser in https://github.com/medusajs/medusa/pull/10219
* docs: revise events and subscribers by @shahednasser in https://github.com/medusajs/medusa/pull/10227
* docs: fix base path not added to hash links by @shahednasser in https://github.com/medusajs/medusa/pull/10235
## Chores
* chore(event-bus): event bus error handling by @carlos-r-l-rodrigues in https://github.com/medusajs/medusa/pull/10085
* chore(local-file): throw error if file exist by @carlos-r-l-rodrigues in https://github.com/medusajs/medusa/pull/10087
* chore(workflows-sdk): Display each error individually instead of packed by @adrien2p in https://github.com/medusajs/medusa/pull/10072
* chore(): Update module provider retrieval error message and type by @adrien2p in https://github.com/medusajs/medusa/pull/10138
* chore(core-flows,types): add TSDocs for useQueryGraphStep by @shahednasser in https://github.com/medusajs/medusa/pull/10042
* chore(medusa): remove unfinished update order endpoint by @riqwan in https://github.com/medusajs/medusa/pull/10169
* fix(stripe): Wrong container type by @adrien2p in https://github.com/medusajs/medusa/pull/10223
## Other Changes
* Feat: add german language support by @pixelwiese in https://github.com/medusajs/medusa/pull/9892
* test: add tests for self relationships by @thetutlage in https://github.com/medusajs/medusa/pull/10071
* feature: Add email to google provider-identity metadata by @Furman1331 in https://github.com/medusajs/medusa/pull/10081
* feat: Add Turkish Language by @ertyurk in https://github.com/medusajs/medusa/pull/10109
* refactor: rename workflow to singular by @thetutlage in https://github.com/medusajs/medusa/pull/10134
* Refactor/finish rename order by @thetutlage in https://github.com/medusajs/medusa/pull/10136
* Revert "feat: add optional fields" by @thetutlage in https://github.com/medusajs/medusa/pull/10159
* docs: fix fulfillment module container name by @mimukit in https://github.com/medusajs/medusa/pull/10111
* update CreateOrderFulfillmentWorkflowInput by @420coupe in https://github.com/medusajs/medusa/pull/9479
* Fix typo in db error message by @Stenz123 in https://github.com/medusajs/medusa/pull/9612
* fix typo in page.mdx by @pedrotigre in https://github.com/medusajs/medusa/pull/10210
* Support spanish translation by @ederwii in https://github.com/medusajs/medusa/pull/10213
* fix: correct ID used for refetching after updating customer by @oDestroyeRo in https://github.com/medusajs/medusa/pull/10231
## New Contributors
* @pixelwiese made their first contribution in https://github.com/medusajs/medusa/pull/9892
* @hadicph made their first contribution in https://github.com/medusajs/medusa/pull/9989
* @Furman1331 made their first contribution in https://github.com/medusajs/medusa/pull/10081
* @ertyurk made their first contribution in https://github.com/medusajs/medusa/pull/10109
* @JohnGemstone made their first contribution in https://github.com/medusajs/medusa/pull/10145
* @mimukit made their first contribution in https://github.com/medusajs/medusa/pull/10111
* @Stenz123 made their first contribution in https://github.com/medusajs/medusa/pull/9612
* @ederwii made their first contribution in https://github.com/medusajs/medusa/pull/10213
**Full Changelog**: https://github.com/medusajs/medusa/compare/v2.0.4...v2.0.5