Releases: medusajs/medusa
Preview Release Update #9
Update existing project
Ensure your Medusa dependencies in package.json
are using the preview
tag:
{
"dependencies": {
"@medusajs/medusa": "preview",
"@medusajs/pricing": "preview",
"@medusajs/product": "preview",
...
}
}
To ensure an upgrade to a new version is completed correctly, run the following sequence of commands:
rm -rf node_modules
rm yarn.lock // or package-lock.json
yarn // If you are using yarn berry, you need to create the lock-file first
Highlights
Deprecated ModuleRegistrationName
Warning
Breaking change
We have deprecated ModuleRegistrationName
in favor of Modules
. ModuleRegistrationName
will be removed in a later preview release.
Modules are registered in the dependency container using these keys and are now resolved as follows:
import { Modules } from "@medusajs/utils"
const productModule = container.resolve(Modules.PRODUCT)
This is a breaking change if you have used strings for module resolution instead of ModuleRegistrationName
.
For example, if you have resolved the product module using its previous string resolution key, you will need to change it as follows:
-const productModule = container.resolve("productModuleService")
+const productModule = container.resolve(Modules.PRODUCT)
Enforced Publishable API Key in Store API
Warning
Breaking change
In the latest preview release, we require a Publishable API key header to access the Store API, i.e., all endpoints under the /store
resource. This will ensure your requests are scoped to at least one Sales Channel associated with the Publishable API key. Sales Channels are used to retrieve products, retrieve correct inventory quantities, create carts, and place orders.
The requirement has been introduced to ensure you can perform these operations without experiencing issues.
Disabled automatic MikroORM casing change
Warning
Breaking change
Refer to #9058 for a description of the issue, solution, and the minimal breaking change.
Fixed issue with many-to-many relations
Warning
Breaking change
In #9075, a bug with our many-to-many relation definition was identified. The solution to the problem lead to a minimal breaking change to the way many-to-many relations are defined when using our model
tool from @medusajs/framework
.
We now require the many-to-many relation to be defined on both sides and a mappedBy
definition on at least one side.
Features
- feat(create-medusa-app): add publishable API key environment variable to Next.js storefront by @shahednasser in #9029
- feat: Application types generation from project GQL schema's by @adrien2p in #8995
- feat: Reset password by @olivermrbl in #8962
- feat: Add support for refreshing JWT tokens by @sradevski in #9013
- feature: introduce types for query.graph method by @thetutlage in #9031
- feat: Add support for fetch streaming to js SDK by @sradevski in #9065
- fix(utils,medusa,order,cart): fix totals when promotions are included by @riqwan in #9014
- feat(payment): Payment providers are upserted upon loading by @riqwan in #9090
- feat(dashboard) modal search autofocus by @fPolic in #9038
- feat(utils,types,framework,medusa): store endpoints should require publishable key by @riqwan in #9068
- feat(core-flows): product type, option and tag events by @carlos-r-l-rodrigues in #9105
- feat(core-flows,dashboard,types,medusa): delete shipping methods when all inbound/outbound items are deleted by @riqwan in #9106
- feat(core-flows,types,medusa): validate deleting location level when quantities exist by @riqwan in #9086
- feat: introduce a thin wrapper on top of OpenTelemetry by @thetutlage in #9109
- feat(api-key,js-sdk,dashboard): allow deleting api keys only once its revoked by @riqwan in #9118
- feature: add telemetry to the HTTP layer by @thetutlage in #9116
- feature: add tracing to remote query by @thetutlage in #9128
- feat(core-flows,medusa,utils,types): adds delivered_quantity to order by @riqwan in #9130
Bugs
- fix(types): add inventory_quantity to http variant type by @shahednasser in #9030
- fix: Check for star actor types when allowing unregistered access by @sradevski in #9037
- fix(orchestration): filter out undefined items by @carlos-r-l-rodrigues in #9046
- fix(types, medusa): request / response types clean-up by @shahednasser in #9043
- fix: Allow specifying PORT for tests through environment by @sradevski in #9055
- breaking: turn off Mikro-ORM casing change with DML properties by @thetutlage in #9058
- fix(dashboard): rq cache and pending flag by @fPolic in #9063
- fix: JSON stringify DML json property default value by @thetutlage in #9074
- fix(dashboard): refresh order list when fulfilment status changes by @fPolic in #9076
- fix(medusa-test-utils): Run with modules without models by @adrien2p in #9062
- fix(core-flows): fix emitted event for deleting sales channel by @shahednasser in #9081
- fix(promotion): handle promotion buy X get X scenario by @riqwan in #9002
- fix(dashboard): campaign fixes by @fPolic in #9082
- fix: broken order page due to missing inventory by @riqwan in #9083
- fix: Update auth
app_metadata
when deleting users + customers by @olivermrbl in #9041 - fix: product options event names by @carlos-r-l-rodrigues in #9108
- fix(dashboard): product create - ignored variants in datagrid by @fPolic in #9087
- fix: wrap ModuleImplementations so that all methods are async by @Alexnortung in #9012
- fix:
instanceof MedusaError
does not work by @McTom234 in #9094 - fix(dml): Throw when many to many are not configured properly by @adrien2p in #9085
- fix: Remove test listeners after the event has happened by @sradevski in #9115
- fix(types, medusa): fix http type of exchanges and claims by @shahednasser in #9123
- fix(): Query Missing bindings by @adrien2p in #9131
- fix(core-flows): item id in reservations by @fPolic in #9097
- fix(dashboard): max call error onKeyDown handler by @kasperkristensen in #9141
- fix: OrderDTO add first class discount_subtotal var by @420coupe in #9112
- fix: Fixed misleading LinkDefinition import from the wrong package by @erickirt in #9139
Documentation
- chore: fix incorrect oas property name by @shahednasser in #9009
- docs: update auth docs + add new storefront guides by @shahednasser in #9020
- docs: fix admin actor type -> user by @shahednasser in #9028
- docs: document star actor types by @shahednasser in #9044
- oas: [2/2] improve store OAS by @shahednasser in #9035
- oas: [1/n] improve oas schemas by @shahednasser in #9039
- oas: [2/n] improve schema oas by @shahednasser in #9040
- oas: [1/n] improve store oas by @shahednasser in #8993
- oas: [3/n] improve oas schemas by @shahednasser in #9042
- docs: fix pricing query params in storefront guide + modules restructure by @shahednasser in #9021
- docs: added storefront development guide on retrieving variant inventory details by @shahednasser in #9032
- chore(utils): update auth provider TSDocs + fix errors stopping references build by @shahednasser in #9023
- chore: fix build errors in OAS by @shahednasser in #9059
- docs: add prerequisites link for test guides by @shahednasser in #9057
- oas:...
v1.20.10
Bugs
- fix: assign scheduled job worker to JobSchedulerService class by @u11d-bartlomiej-galezowski in #8891
- fix: Renamed the
JobSchedulerService
queue's name by @adevinwild in #9000 - fix(admin-ui): product category state in edit modal by @ikhvost in #9051
- fix:
instanceof MedusaError
does not work by @McTom234 in #9107
Documentation
- docs(v1): fix link to regions API reference by @shahednasser in #8867
- docs(v1.x): update PostgreSQL plan in heroku deployment guide by @shahednasser in #8931
Full Changelog: 1.20.10...v1.20.11
Preview Release Update #8
Update existing project
Ensure your Medusa dependencies in package.json
are using the preview
tag:
{
"dependencies": {
"@medusajs/medusa": "preview",
"@medusajs/pricing": "preview",
"@medusajs/product": "preview",
...
}
}
To ensure an upgrade to a new version is completed correctly, run the following sequence of commands:
rm -rf node_modules
rm yarn.lock // or package-lock.json
yarn // If you are using yarn berry, you need to create the lock-file first
Highlights
Restructured admin packages
| π§ Breaking change
Our admin packages have been restructured in #8988. This is a breaking change, as our extensions tool has been moved to a new package.
More specifically, defineWidgetConfig
and defineRouteConfig
should be imported from @medusajs/admin-sdk
instead of @medusajs/admin-shared
.
- import { defineRouteConfig, defineWidgetConfig } from "@medusajs/admin-shared"
+ import { defineRouteConfig, defineWidgetConfig } from "@medusajs/admin-sdk"
Additionally, the new admin package needs to be an explicit dependency in your project, so you should install it with your preferred package manager:
yarn add @medusajs/admin-sdk@preview
Features
- feat(dashboard,types): split damaged activity from received by @riqwan in #8859
- feat(medusa): order changes endpoint by @carlos-r-l-rodrigues in #8728
- feat(dashboard): order edits in timeline by @fPolic in #8899
- feat(notification): Handle long running transaction and add status support by @adrien2p in #8900
- feat(dashboard): allow custom shopping prices for claims/exchanges by @fPolic in #8912
- feat(core-flows,types): Refunds can only be performed when order is imbalanced by @riqwan in #8944
- chore(medusa): remove promotions in campaign validators + move tests to http by @riqwan in #8965
- feat(dashboard): Cancel claims and exchanges by @fPolic in #8958
- feat(dashboard): update create fulfillment UI part 1 by @fPolic in #8972
- feat(utils): dml to graphql by @carlos-r-l-rodrigues in #8951
- feat: Add github authentication provider by @sradevski in #8980
- feat: added totals tests for end 2 end RMA flow by @riqwan in #8906
- feat(types,medusa): add acknowledgement typing by @shahednasser in #8991
- feat(admin-sdk,admin-bundler,admin-shared,medusa): Restructure admin packages by @kasperkristensen in #8988
- feat(core-flows): custom price flag for order line items and shipping methods by @carlos-r-l-rodrigues in #8969
- feat(core-flows,types,promotion): register promotion campaign usage upon cart completion by @riqwan in #8970
- feat(product): product option value methods by @carlos-r-l-rodrigues in #9004
- feat(dashboard, user): prefill invite email by @fPolic in #9016
- feat(dashboard): add inventory kit info in order summary by @fPolic in #8990
Bugs
- fix(dashboard) RMAs shipping pricing by @fPolic in #8848
- fix(link-module): Migration planner not closing connection correctly by @adrien2p in #8881
- fix(order): populate version entities by @carlos-r-l-rodrigues in #8884
- feat(dashboard): refactor dismissed quantity by @fPolic in #8842
- fix(dashboard): Fetch tags + types in product forms by @olivermrbl in #8887
- fix(dashboard, js-sdk, types, medusa): separate between delete response with and without parent by @shahednasser in #8852
- fix: ignore metadata when computing relationships from payload by @thetutlage in #8895
- fix(dashboard): rma shipping floats by @fPolic in #8892
- fix: Shipping profile deletion with options by @adrien2p in #8910
- fix: Customer registration by @olivermrbl in #8896
- fix(medusa, types): fix more query types by @shahednasser in #8907
- fix(dashboard): Fix copy invite link by @kasperkristensen in #8933
- fix(dashboard): fix campaign end date by @riqwan in #8935
- fix: handle case where product to be updated does not exist by @thetutlage in #8897
- fix(dashboard): product option delete message by @fPolic in #8934
- fix(dashboard): format currency sign by @fPolic in #8936
- fix(medusa): Allow filtering customers by
has_account
by @kasperkristensen in #8947 - fix(core-flows): Handle variant creation duplicate inventory item ids by @adrien2p in #8937
- fix(dashboard): Product create price columns race condition by @kasperkristensen in #8943
- fix(types, medusa): fixes to draft order request types by @shahednasser in #8949
- fix(dashboard,admin-shared): Fixes to inventory page by @kasperkristensen in #8941
- fix(dashboard): receive return form by @fPolic in #8955
- fix(js-sdk): fix invite resend request being sent as GET instead of POST by @shahednasser in #8960
- fix(medusa): fix complete order API route to remove duplicate params by @shahednasser in #8961
- fix(medusa): change the request type of removing products from price list by @shahednasser in #8964
- fix(medusa): fix update promotion's request type by @shahednasser in #8966
- fix(order,utils): fix outstanding amount stuck on long orders by @riqwan in #8968
- fix(dashboard): Tab behaviour in DataGrid by @kasperkristensen in #8973
- fix(dashboard): Align product organization badges with design by @kasperkristensen in #8975
- fix(dashboard): Display breadcrumbs for variant route by @kasperkristensen in #8983
- fix(utils): graphql enum options by @carlos-r-l-rodrigues in #8985
- fix: Check actor type on account creation, fix github entity id by @sradevski in #8996
- fix: Remove deprecated method, generalize typings in auth by @sradevski in #8998
- fix(dashboard): import products labels by @fPolic in #9001
- fix(types,medusa): fix query types for some store routes by @shahednasser in #8994
- chore(core-flows): Add invite resent event by @olivermrbl in #8986
- fix(core-flows, types, medusa): fix batch delete types in workflows and routes by @shahednasser in #8974
- fix(dashboard): Fixes to campaign and promotions domains by @kasperkristensen in #9022
- fix: move get-port to main dependencies list by @thetutlage in #8938
- fix: Workflow always print "error:" even if there are none by @matteoxplo in #8978
Documentation
- docs: incorrect link fixes by @shahednasser in #8868
- docs-util: fixes in schema factory + other improvements by @shahednasser in #8874
- docs-util: include types in workflows.ts in generated references by @shahednasser in #8882
- docs: fix overflowing card description hidden by @shahednasser in #8871
- docs: fix tag filters in search by @shahednasser in #8862
- oas: [2/n] Improve admin OAS by @shahednasser in #8866
- oas: [1/n] Improve admin OAS by @shahednasser in #8850
- docs: use new x-sidebar-summary for sidebar items in api-reference if available by @shahednasser in #8865
- oas: [3/n] Improve admin OAS by @shahednasser in #8875
- docs: replace usages of migrations and links commands by @shahednasser in #8894
- Update page.mdx by @atistrcsn in #8908
- docs-util: fix clean script removing Auth tags by @shahednasser in #8911
- docs: fixe...
Preview Release Update #7
Highlights
Bulk Editor improvements
We have added error handling to our bulk editor to make bulk editing of resources more manageable.
error-bulk-editor.mp4
Order Exchanges, Returns, and Claims
We have finished the first iteration of Order Exchanges, Returns, and Claims. There is still some polishing to do on these flows, so please report any issues you find.
Recipe: Food-Delivery platform
We have published a new recipe taking you though building a food-delivery platform like UberEats.
We also have a demo project and repository if you are curious to dig into how this recipe is used in practice: https://github.com/medusajs/medusa-eats
Remote Joiner alias conflict
π§ Breaking change
Several models were named the same across modules, causing conflicts for our Remote Joiner engine. To resolve the issues with Remote Joiner, the name-clashing models have been renamed to be specific to the module they belong to.
Only the ORM models have been renamed β not the underlying tables.
Order Module:
- Address -> OrderAddress
- LineItem -> OrderLineItem
- LineItemAdjustment -> OrderLineItemAdjustment
- LineItemTaxLine -> OrderLineItemTaxLine
- ShippingMethod -> OrderShippingMethod
- ShippingMethodAdjustment -> OrderShippingMethodAdjustment
- ShippingMethodTaxLine -> OrderShippingMethodTaxLine
- Transaction -> OrderTransaction
Fulfillment Module:
- Address -> FulfillmentAddress
These changes affect the modules' methods since we auto-generate methods based on the model names. For example, createLineItem
in the Order Module is now createOrderLineItem
. More specifically, this change affects the models mentioned above, and the following methods of those:
- retrieve[ModelName]
- list[ModelName]
- listAndCount[ModelName]
- create[ModelName]
- update[ModelName]
- delete[ModelName]
- softDelete[ModelName]
- restore[ModelName]
Internal module events
We have decided to hide the logs of internal module events. These events are currently only emitted in a few modules and are not supposed to be used by end-users for subscribers and such. You should always use Workflow Events, which have replaced the event concept from V1.
Features
- feat(dashboard): summary shipping breakdown by @fPolic in #8779
- feature: add db:setup command by @thetutlage in #8830
- feat(js-sdk): Add API key by @olivermrbl in #8838
- feat(dashboard): DataGrid improvements [4/4] by @kasperkristensen in #8798
- feat: Add support for providers to validate their options at loading time by @adrien2p in #8853
- feat(notification-sendgrid): include ability to handle attachments by @420coupe in #8729
Bugs
- fix(order): run migration before setting not null by @riqwan in #8831
- fix(dashboard,js-sdk): fixes from rma flows testing by @riqwan in #8826
- fix(medusa): use correct request type for create cart API route by @shahednasser in #8820
- fix: Validate boolean query params by @olivermrbl in #8834
- fix(order): order change references by @carlos-r-l-rodrigues in #8845
- fix(medusa-oas-cli): fix download url for public OAS by @shahednasser in #8763
- fix(dashboard): align items inside quick view popover by @riqwan in #8847
- fix(dashboard,types): fix some http type names by @shahednasser in #8836
- fix(core-flows): use unit price of item in create cart and add to cart flows by @shahednasser in #8841
- fix(orchestration): remote joiner alias conflict by @carlos-r-l-rodrigues in #8844
- fix(dashboard): active RMA section border by @fPolic in #8849
- fix(utils): DML hasOne - belongsTo not behaving correctly by @adrien2p in #8813
- fix(dashboard): active rma z-index by @fPolic in #8854
- fix: product category types by @Alexnortung in #8833
- fix(dashboard): Pass query params to list SC request by @kasperkristensen in #8863
Documentation
- docs-util: fix for product type schemas by @shahednasser in #8837
- docs: improvements to base OAS by @shahednasser in #8835
- docs: uppercase HTTP methods in api reference by @shahednasser in #8821
- docs: add tracking for navigation usage by @shahednasser in #8819
- docs-util: fix removal of manually-added schemas in clean script by @shahednasser in #8840
- docs: add restaurant-delivery marketplace recipe by @shahednasser in #8817
Chores
- chore(medusa): Re enable plugin loading by @adrien2p in #8843
- chore: Treat internal event differently, primarely do not display info logs for those events by @adrien2p in #8767
- chore: Remove unused clients in admin + clean up js-sdk by @olivermrbl in #8839
Full Changelog: v2.0.6-preview...v2.0.7-preview
v2.0.6-preview
Highlights
Introduced identity registration in auth domain
π§ Breaking change
We have separated identity registration from authentication. For context about why this decision was made see #8683.
Introduced endpoint /auth/[scope]/[provider]/register
We have added an endpoint specifically for registering new identities. This change will only be used by providers that require registration, such as email-password.
Introduced method register
in auth provider and auth module
We have introduced a new method register
to the auth provider and auth module interfaces. This change will only be used by providers that require registration, such as email-password.
Examples of new authentication flows
Sign up with email-password:
POST /admin/invites -> admin creates invite
POST /auth/user/emailpass/register -> user registers identity
POST /admin/invites/accept -> invite is accepted passing the invite + auth token
Sign in with email-password:
POST /auth/user/emailpass -> authenticate with email-password
GET /admin/users/me -> get authenticated user
Sign up with Google:
POST /auth/user/google -> redirects to Google auth
POST /auth/user/google/callback -> Google hits callback URL, authenticates, and responds with user
POST /admin/invites/accept -> invite is accepted passing the invite + auth token
Sign up with Google:
POST /auth/user/google -> redirects to Google auth
POST /auth/user/google/callback -> Google hits callback URL, authenticates, and responds with user
GET /admin/users/me -> get authenticated user
Sign up as customer with email-password:
POST /auth/customer/emailpass/register -> customer registers identity
POST /store/customers -> customer is created
Sign in with email-password:
POST /auth/customer/emailpass -> authenticate customer with email-password
CLI commands to manage database operations
We have added a new namespace to our CLI specifically for database operations db:
.
Alongside the namespace, a range of new commands have been introduced:
db:create
: The command creates the database (if it is missing) and updates the .env filedb:migrate
: This command will run the migrations and sync the links, unless --skip-links flag is specifieddb:rollback
: Rolls-back last batch of migrations for one or more selected modulesdb:generate:
Generates migrations for one or more selected modulesdb:sync-links
: Ensures links between modules are in sync
Events
We have (re)introduced events in the product domain:
"product-category.created"
"product-category.updated"
"product-category.deleted"
"product-collection.created"
"product-collection.updated"
"product-collection.deleted"
"product-variant.updated"
"product-variant.created"
"product-variant.deleted"
"product.updated"
"product.created"
"product.deleted"
Documentation: Redesign completed
We have completed redesigning our documentation for Medusa 2.0, which includes an updated layout and a range of new components improving the overall user experience.
Explore the updated documentation here.
Documentation: Re-introduced AI assistant (beta)
We have (re)introduced our AI assistant for Medusa 2.0 to help guide you through our documentation and find what you are looking for as fast as possible.
Try out the new AI assistant here.
Features
- feat(dashboard): Hitting escape restores previous value by @kasperkristensen in #8654
- feat(workflows-sdk): log on error by @carlos-r-l-rodrigues in #8666
- feat(dashboard,core-flows,js-sdk,types,link-modules,payment): ability to copy payment link by @riqwan in #8630
- feat(dashboard): Wrap each route in an ErrorBoundary by @kasperkristensen in #8674
- feat(core-flows): create or update payment collections in RMA flows by @riqwan in #8676
- feat(dashboard,core-flows,js-sdk,types): ability to mark payment as paid by @riqwan in #8679
- feat(dashboard,core-flows): ability to refund payment post RMA flow by @riqwan in #8685
- fix(core-flows): account for unfulfilled items while generating order status by @riqwan in #8698
- feat(dashboard): add activities for order - claim, exchange, payment by @riqwan in #8702
- feat(core-flows): order edit request by @carlos-r-l-rodrigues in #8705
- chore(order): align mikroorm <> order module by @riqwan in #8710
- feat(fulfillment,order): add created_by fields to fulfillment, return, claim, exchange by @riqwan in #8711
- feat(medusa,types,core-flows): apply created_by values - claims, exchanges, returns, fulfillment by @riqwan in #8712
- feat: add missing crud to provider identity service by @christiananese in #8717
- feat(utils): use dotenv-expand to allow variables within env by @shahednasser in #8720
- feat(dashboard): order edit UI by @fPolic in #8700
- feat(core-flows,dashboard): adds item validations for claims, returns and exchanges by @riqwan in #8735
- feat(create-medusa-app): set database name to project name by @shahednasser in #8727
- feat(dashboard,types): add active order change panel - claims, exchanges & returns by @riqwan in #8738
- feat: add env editor utility to edit update .env files by @thetutlage in #8741
- feature: add db:create command by @thetutlage in #8760
- fix(dashboard): summary section return fixes by @fPolic in #8770
- feat: add sync links command by @thetutlage in #8775
- feat: move migrations commands to the new db namespace by @thetutlage in #8810
- feat: create auth provider identity by @christiananese in #8675
- feat: Separate registration from authentication in auth domain by @olivermrbl in #8683
- feat(dashboard): cancel return request by @fPolic in #8761
Bugs
- fix(dashboard): Use proper heading size by @kasperkristensen in #8658
- fix(promotion): validate rules accurately when attribute is scoped by context by @riqwan in #8655
- fix(payment-stripe): fix smallest unit calculation by @carlos-r-l-rodrigues in #8663
- fix: maintain connections pool by @thetutlage in #8670
- fix(dashboard): Fix minor issues with Reservations and Inventroy Create forms by @kasperkristensen in #8657
- chore(order): preview removed items by @carlos-r-l-rodrigues in #8680
- fix(dashboard): bust order preview cache to reset fulfilled quantity by @riqwan in #8687
- fix(types): pluralize by @carlos-r-l-rodrigues in #8709
- fix: enable next actions bar when refund is available by @riqwan in #8719
- fix(core-flows): allow backorder by @carlos-r-l-rodrigues in #8721
- fix: Log on error by default in async workflow executions by @sradevski in #8723
- chore(core-flows): test allow backorder by @carlos-r-l-rodrigues in #8725
- fix(admin-next,types): fixes order page from breaking in admin server by @riqwan in #8730
- fix(payment-stripe): fix rounding by @carlos-r-l-rodrigues in #8753
- fix: Doing update to cart with shipping options set removes them by @sradevski in #8752
- fix(orchestration, workflow-sdk): Local workflow separated orchestrator by @adrien2p in #8765
- fix: add missing typings to create provider identity by @christiananese in #8677
- fix: Cleanup error output and do not add red color to help output by @thetutlage in #8778
- fix(core-flows,order): return damaged items by @carlos-r-l-rodrigues in #8818
- fix(product): Add metadata to property to product category data model by @Alexnortung in #8766
Documentation
- docs: improve main docs and resources sidebar by @shahednasser in #8664
- docs: remove link to events reference by @shahednasser in #8669
- breaking: remove POSTGRES prefix env variables in favor of DATABASE prefix by @thetutlage in #8672
- docs: redesign notes by @shahednasser in #8661
- docs: redesign tables by @shahednasser in #8653
- docs: redesign footer by @shahednasser in https://github.com/...
v1.20.10
Bugs
- fix: Pass in data to PATCH call so cart amount is updated on quantity change by @Arsenalist in #8456
- fix(admin-ui): Fixed DropdownMenu inside a Modal zIndex issues by @adevinwild in #8358
- fix: Check if the SalesChannels FF is enabled on
/admin/products
by @adevinwild in #8357
Docs
- docs: fix service crud example by @MuhammadElsaeed in #8439
New Contributors
- @MuhammadElsaeed made their first contribution in #8439
Full Changelog: v1.20.9...1.20.10
v2.0.5-preview
Highlights
Product Category organizer component
We've polished the Product Category organizer component for a smoother drag-and-drop experience. As part of the polish, we've also fixed an issue with a dependency.
Email-pass as default authentication provider
π§ Breaking change
We've updated the default modules config to include email-password as a default authentication provider. This is a breaking change. To ensure your application will continue to run, you should install the preview version of the email-password provider package:
yarn add @medusajs/auth-emailpass@preview
Workflows Reference
We've introduced a reference of all workflows used in Medusa's core. It includes a visual representation of steps, hooks, and conditionals.
Explore the reference here.
Features
- feat: admin return reason list by @christiananese in #8482
- feat(medusa): filter shipping options by location by @riqwan in #8511
- feat(dashboard,js-sdk,types): ability to add refund reason and note by @riqwan in #8466
- feat(types,dashboard): ability to set shipping methods for claim by @riqwan in #8533
- feat: create return reason by @christiananese in #8516
- feat(create-medusa-app): prompt for database name with credentials by @shahednasser in #8552
- feat(core-flows,dashboard,medusa): fixes set of tiny bugs in claims flow by @riqwan in #8551
- feat(dashboard): BulkEditor Boolean cell behaviour by @kasperkristensen in #8418
- feat: Move userpass default definition to defineConfig instead of a hard-coded value by @sradevski in #8557
- feat(core-flows): introduce a generic create entities step by @riqwan in #8553
- feat(medusa-oas-cli): automatically fix missing circular references by @shahednasser in #8600
- feat(core-flow): order edit endpoints by @carlos-r-l-rodrigues in #8596
- feat(dashboard,core-flows,js-sdk,types,medusa): Add exchange UI + fixes by @riqwan in #8606
- feat(medusa,core-flows,types): API to create payment collections for order by @riqwan in #8617
Bugs
- fix(dashboard): Delete product media by @olivermrbl in #8506
- fix: Use local notification provider for feed channel by default by @sradevski in #8518
- fix(core-flows): fixes duplicate fulfillment issue by @riqwan in #8581
- fix(core-flows): fixes build fails by @riqwan in #8584
- fix(core-flows): add order transaction on capture by @carlos-r-l-rodrigues in #8591
- fix(chore-flows): update shipping method price by @carlos-r-l-rodrigues in #8592
- feat(core-flows,dashboard): add fixes to allow only outbound or inbound claims by @riqwan in #8590
- fix(notification): Disable notification providers by @olivermrbl in #8607
- fix(payment): Partial refunds by @olivermrbl in #8603
- fix(order): summary original_total by @carlos-r-l-rodrigues in #8616
- fix(pricing): Calculate price sets with amount 0 by @olivermrbl in #8622
- fix(order): order summary on order creation by @carlos-r-l-rodrigues in #8624
- fix: Remove the endpoint to create a user by @sradevski in #8629
- fix(order): update order summary when transactions change by @carlos-r-l-rodrigues in #8633
- chore: Remove create user tests that are no longer relevant by @sradevski in #8638
- fix(dashboard): Replace
react-nestable
with new SortableTree component by @kasperkristensen in #8599 - fix(dashboard): Check for displaying placeholder value by @kasperkristensen in #8649
- fix(dashboard): disable RMAs if there is no shipped items by @fPolic in #8652
Documentation
- docs-util: add support for workflows in markdown theme by @shahednasser in #8485
- docs: fix build errors + update medusa docs link by @shahednasser in #8550
- docs: added troubleshooting for using pnpm by @shahednasser in #8537
- docs: improve the workflow hooks guide by @shahednasser in #8538
- docs-util: associate an API route with the workflow it uses by @shahednasser in #8554
- docs: fixes and preparations for workflows reference by @shahednasser in #8579
- docs-util: fix OAS generation error by @shahednasser in #8577
- docs: redesign sidebar by @shahednasser in #8408
- docs: change from showing required to showing optional in types references by @shahednasser in #8593
- docs: add a section in the main docs on how to retrieve a relationship by @shahednasser in #8594
- docs: fix $lt and $gt in api reference by @shahednasser in #8580
- docs: change workflow diagram to list by @shahednasser in #8602
- docs: redesign pagination by @shahednasser in #8614
- docs: add associated workflow badge in api reference by @shahednasser in #8613
- docs: fix expand badge by @shahednasser in #8611
- docs: fix scroll top margin by @shahednasser in #8605
- docs: update colors and typography by @shahednasser in #8604
- docs: fix usage of AdminCreateProduct in validation of digital product recipe by @shahednasser in #8601
- docs: collapse sidebar by default in main docs + persist state by @shahednasser in #8608
- docs: redesign help button by @shahednasser in #8610
- docs-util: fix update OAS schema by @shahednasser in #8556
- docs: remove steps from workflows reference overview by @shahednasser in #8595
- docs: bug fixes for copy and color mode by @shahednasser in #8626
- docs: added edit date by @shahednasser in #8623
- docs: update algolia by @shahednasser in #8625
- docs: redesign code highlights + add default code titles by @shahednasser in #8628
Chores
- chore: normalize packages version by @carlos-r-l-rodrigues in #8492
- chore(core-flows): [4] export types and types, add basic TSDocs by @shahednasser in #8509
- chore(core-flows): [3] export types and types, add basic TSDocs by @shahednasser in #8507
- chore(core-flows): [2] export types and types, add basic TSDocs by @shahednasser in #8505
- chore(core-flows): [5] export types and types, add basic TSDocs by @shahednasser in #8510
- chore(core-flows): [6] export types and types, add basic TSDocs by @shahednasser in #8512
- chore(core-flows): [7] export types and types, add basic TSDocs by @shahednasser in #8514
- chore(core-flows): [8] export types and types, add basic TSDocs by @shahednasser in #8517
- chore(core-flows): [9] export types and types, add basic TSDocs by @shahednasser in #8519
- chore(core-flows): [11] export types and types, add basic TSDocs by @shahednasser in #8521
- chore(core-flows): [12] export types and types, add basic TSDocs by @shahednasser in #8522
- chore(core-flows): [14] export types and steps, add basic TSDocs by @shahednasser in #8524
- chore(core-flows): [16] export types and steps, add basic TSDocs by @shahednasser in #8527
- chore(core-flows): [17] export types and steps, add basic TSDocs by @shahednasser in #8528
- chore(core-flows): [18/18] export types and types, add basic TSDocs by @shahednasser in #8529
- chore(order): item update quantity by @carlos-r-l-rodrigue...
v2.0.4-preview
Highlights
Domain-specific Workflow Hooks
We recently introduced Workflow Hooks, allowing you to expose injection points in workflows for the consumer to perform custom logic.
Among Medusa's core workflows, you will find available hooks in the following domains:
- Products: create, update, and delete
- Orders: create, cancel, complete, create fulfillment, cancel fulfillment, and create shipment
- Promotions: create, update, delete, create campaign, update campaign, and delete campaign
- Carts: create and update
- Customers: create, update, delete, create address, update address, and delete address
Workflow hooks are consumed by registering a hook handler on the workflow. The hook handlers should be placed and registered in the /workflows/hooks
folder of your Medusa project. For example, here's how to use the product-created hook:
// workflows/hooks/product-created.ts
import { createProductsWorkflow } from "@medusajs/core-flows"
createProductsWorkflow.hooks.productCreated(( { products, additional_data }) => {
// run custom business logic
})
This hook receives the created products
and arbitrary additional_data
. The latter should be passed to the workflow upon running it:
await createProductsWorkflow(req.scope).run({
input: { products: [ ... ], additional_data: { ... } },
})
In combination with extending the request payload to receive additional data, you can achieve a range of different use cases with Workflow Hooks, e.g. linking a product with another resource. We will share recipes for many of these cases in the near future.
We will continuously add more Workflow Hooks to our core workflow, e.g. a hook to transform line item data and price before it's added to the cart. Keep an eye out for our preview release updates, as they will contain an overview of the new hooks.
Features
- feature: introduce additional_data to the product endpoints by @thetutlage in #8405
- feature: add hooks to customers modules workflows by @thetutlage in #8442
- feat(create-medusa-app, medusa): check Node.js version before installation. by @shahednasser in #8452
- feat(core-flows,order,medusa): exchange endpoints by @carlos-r-l-rodrigues in #8396
- feature: add hooks to campaigns by @thetutlage in #8450
- feat(core-flows,payment,medusa,types): Refund reasons management API by @riqwan in #8436
- feat: add claims/:id endpoint to admin api by @christiananese in #8465
- feature: add create and update cart hooks by @thetutlage in #8481
- feat(core-flows): manage inventory reservation of claims and exchanges by @carlos-r-l-rodrigues in #8448
- feat(dashboard): claims first implementation by @riqwan in #8468
- feat(core-flows,dashboard,medusa): ability to add and remove items to claim inbound by @riqwan in #8480
- feat(adshboard,types,medusa): enable adding notes/return reason to inbound claims by @riqwan in #8488
- feature: add workflows hooks to the order module by @thetutlage in #8496
- feature: share execution context with hook handlers by @thetutlage in #8501
Bugs
- fix(payment): validate total amount when refunding payment by @riqwan in #8437
- fix: Upgrade bullmq and adjust to breaking changes in repeatable jobs by @sradevski in #8446
- fix(order): return migration enum by @carlos-r-l-rodrigues in #8449
- fix(medusa): plus sign to space by @carlos-r-l-rodrigues in #8454
- fix: Use a global reference to distributed transaction and scheduler by @sradevski in #8462
- fix(core-flows): copy line items attribute by @carlos-r-l-rodrigues in #8471
- fix(core-flows): Unsetting reason on return items by @olivermrbl in #8470
- fix(core-flows): Allow return requests with no shipping by @olivermrbl in #8472
- fix(event-bus-redis): Consume job correct in worker by @olivermrbl in #8444
Documentation
- Update page.mdx by @420coupe in #8425
- docs: fix helloWorldLoader function definition by @letalumil in #8429
- docs: fix deployment link by @letalumil in #8431
- docs: fix ModuleRegistrationName import by @letalumil in #8434
- docs: fix node version in create-medusa-app reference by @shahednasser in #8443
- docs: added a chapter on how to emit an event by @shahednasser in #8414
- docs: added a section on sending requests to api routes in admin by @shahednasser in #8412
- docs: fix sidebar not updating when api reference path changes by @shahednasser in #8409
- docs: merge allOf in OAS to show all object types by @shahednasser in #8453
- docs: fixes to notification and file module guides by @shahednasser in #8451
- docs: added a note about admin customizations as arrow functions by @shahednasser in #8387
- docs-util: added workflows typedoc plugin by @shahednasser in #8463
- docs-util: added a namespaces plugin by @shahednasser in #8500
Chores
- chore(core-flows): add TSDocs to the emitEventStep by @shahednasser in #8413
- chore(utils): add missing imports in notification TSDocs by @shahednasser in #8447
- chore: added and updated TSDocs of order module service by @shahednasser in #8246
- chore(medusa,core-flows): cart payment collection link by @carlos-r-l-rodrigues in #8457
- chore: update notifcations drawer design by @christiananese in #8469
- chore(utils): improve to handle util by @carlos-r-l-rodrigues in #8487
- chore(core-flows): util to format inventory input by @carlos-r-l-rodrigues in #8483
- chore: fix actions generating docs by @shahednasser in #8486
- chore: use WithAdditionalData helper everywhere by @thetutlage in #8499
- chore(core-flows): [1] export types and types, add basic TSDocs by @shahednasser in #8504
New Contributors
- @420coupe made their first contribution in #8425
- @letalumil made their first contribution in #8429
- @christiananese made their first contribution in #8465
Full Changelog: v2.0.3-preview...v2.0.4-preview
v2.0.3-preview
Get started with a new project
To get started using the preview release, run the following command:
npx create-medusa-app@preview
This command will create a new Medusa project with our redesigned admin and a 2.0-compatible Next.js storefront. The Medusa application and the Next.js storefront are separate projects in separate folders.
Highlights
Workflow Hooks
π§ Breaking change
We have added a new helper, createHook
, to the workflows-sdk
. The createHook
helper exposes a hook from a workflow. Later (after the workflow has been composed), the workflow consumers can bind a handler to the hook to run custom logic.
Note
As of now, you can only register one hook handler, and the workflow orchestrator ignores the return value.
Exposing hook via createHook
import {
createStep,
createHook,
createWorkflow,
WorkflowResponse
} from '@medusajs/workflows-sdk'
const createProductStep = createStep('createProduct', function () {
// business logic for "createProduct"
})
const workflow = createWorkflow('name', function (input) {
createProductStep(input)
const productCreatedHook = createHook('productCreated', { productId: input.id })
return new WorkflowResponse(input, {
hooks: [productCreatedHook]
})
})
Points to note
- Unlike the
createStep
function, thecreateHook
method is called within the workflow composition callback. - You must return the created hooks from the composition callback. Returning of hooks is needed for the TypeScript engine to provide intellisense when registering a handler for the hook.
- Hooks are executed in the same position as they are defined within the composition callback
Registering the hook handler
The workflow user must register a hook handler to run custom logic within a workflow. They can do that as follows.
workflow.hooks.productCreated(() => {
// run custom business logic
})
Points to note
- The hook handler behaves similarly to a workflow step. It can run async code, will be retried, and can also have compensation behavior (defined as the 2nd parameter)
- There can only be one handler for a hook. If you need multiple handlers, you should create another workflow and register that as the hook handler (not supported yet).
- The return value of the hook handler is ignored in this first iteration.
Introducing the WorkflowResponse
class and breaking changes
The introduction of hooks has changed the return value of the createWorkflow
composition callback. Now, we must return both the workflow results and the configured hooks.
Instead of manually composing the return value, you can use the WorkflowResponse
class to construct the current response. The WorkflowResponse
class accepts the following parameters.
- The first parameter is the result of the workflow.
- The second parameter (optional) is a config object with configured hooks.
Product Import and Export
We have re-introduced Product Import and Export and simultaneously redesigned the notifications drawer in the dashboard.
Right now, we are polling for new notifications every third second, but we intend to introduce SSE (or a similar tech.) to enable real-time notifications.
Product Tag management UI
We have added Product Tag management in the dashboard. Find it in "Settings > Product Tags".
New Recipes: Subscriptions and Digital Products
We have added two new recipes covering how to add support for Subscriptions and Digital Product respectively. They both come with an example repository.
Check out the Subscription recipe here.
Check out the Digital Products recipe here.
Features
- feat(medusa): add stock_location_id filter to providers api by @riqwan in #8319
- Chore/order claims 2 by @carlos-r-l-rodrigues in #8312
- feat:Allow updating prices through product update workflow by @sradevski in #8316
- feat(orchestration,workflows-sdk): Skip step by @carlos-r-l-rodrigues in #8334
- feat: Add support for product export in UI by @sradevski in #8281
- feat(dashboard,icons,types,js-sdk): add providers to location UI by @riqwan in #8328
- feat: Add support for product imports by @sradevski in #8298
- breaking: implement workflow hooks (first iteration) by @thetutlage in #8346
- feat: Make product import v1 compatible by @sradevski in #8362
- feat(dashboard, types, js-sdk): Claims client, hooks and types by @fPolic in #8370
- feat: Cart API should also return billing_address.province by default by @josetr in #8293
- feat(core-flows, fulfillment): validate shipping options to stock locations by @riqwan in #8291
- feat(core-flows,medusa): add endpoint to add/remove fulfillment providers to location by @riqwan in #8299
- feat: update return request by @olivermrbl in #8302
- feat(dashboard,medusa,types): Add Product Tag management by @kasperkristensen in #8349
- feat(dashboard,js-sdk,types): add ability to capture payment from order page by @riqwan in #8368
- chore(core-flows): Order Exchange - initial workflows by @carlos-r-l-rodrigues in #8374
- feat: Add support for sorting export headers by @sradevski in #8386
- feat: Add
requested_at
+open
status to return by @olivermrbl in #8391 - feat: Show notice on new notifications by @sradevski in #8390
- feat: add hooks to product module's workflows by @thetutlage in #8389
- feat(dashboard,types,js-sdk,payment): ability to refund payment in order page by @riqwan in #8385
- feat(dashboard, js-sdk, types): receive return e2e by @fPolic in #8305
- feat: Use tag ids instead of values wherever possible by @sradevski in #8394
- feat: Add support for categories in product import and export by @sradevski in #8375
Bugs
- fix: Store private files in the static directory by default by @sradevski in #8325
- fix(core-flows,order): update action by @carlos-r-l-rodrigues in #8333
- fix(dashboard,types,js-sdk): Cleanup
settings/store
by @kasperkristensen in #8336 - fix(core-flows): delete receive return action by @carlos-r-l-rodrigues in #8350
- fix: Added more tests and fixed a couple of issues with product import by @sradevski in #8341
- fix(dashboard): Fix spacing, media, and missing tip in product create form by @kasperkristensen in #8338
- fix: Use region name in product pricing exports by @sradevski in #8373
- fix(framework): prepublish script by @adrien2p in #8377
- fix(framework): telemetry package version by @adrien2p in #8378
- fix: Correctly associate options to variants when variants for multiple products are created by @sradevski in #8285
- fix(core-flows): update receive returned item by @carlos-r-l-rodrigues in #8295
- fix(dashboard): Fix CountrySelect by @kasperkristensen in #8301
- fix(dashboard): Cell behaviour in DataGrid by @kasperkristensen in #8183
- fix: Updating product prices removed existing prices by @sradevski in #8388
- fix: Pass updatedCollections to the hook and not the step by @thetutlage in #8402
- fix(core-flows,utils,medusa): fix bug where payment collection across orders were getting updated by @riqwan in #8401
- fix: Check for existence of modules when seeding default data by @sradevski in #8406
- fix(framework/config): Properly resolve env variables by @adrien2p in #8411
- fix: Don't remove pricing if no variant is passed to update by @sradevski in #8416
Documentation
- docs: added guide on how to get product variant prices by @shahednasser in #8282
- docs: remove js client and medusa react references by @shahednasser in #8270
- docs: update deployment guides for storefront and admin by @shahednasser in #8279
- docs: added a service factory reference by @shahednasser in #8292
- docs-util: add docblock generator for models built with DML by @shahednasser in https:/...
v1.20.9
Fixes
- fix: Add fix for Stripe paid amount by @pepijn-vanvlaanderen in #8234
- fix: Pass cart_id so that prices can be calculated correctly. by @Arsenalist in #7554
- fix(admin): Allow
backend
to pass through in development by @kasperkristensen in #8231
Full Changelog: v1.20.8...v1.20.9