Commit Graph

9492 Commits

Author SHA1 Message Date
Oli Juhl
747ec9fc27 chore: Add Claude Code commands (#14438)
* chore: Add Claude Code commands

* chore: Improvements based on feedback
2026-01-05 10:56:03 +01:00
Shahed Nasser
4d632e7a5d docs: added tests for components in api-reference project (#14428)
* add tests (WIP)

* added test for h2

* finished adding tests

* fixes

* fixes

* fixes
2026-01-05 10:56:56 +02:00
calebro
fb772f0f6a docs: fix PostHog API Key link (#14433)
Update PostHog API Key link in page.mdx
2026-01-05 09:43:48 +02:00
Arpit Goyal
353f4712a0 docs: fix typo in Medusa API key instructions (#14435)
* Fix typo in Medusa API key instructions

* Update www/apps/resources/app/nextjs-starter/page.mdx

---------

Co-authored-by: Shahed Nasser <shahednasser@gmail.com>
2026-01-05 09:42:52 +02:00
Riqwan Thamir
43305a562c feat(medusa,utils,core-flows): add reset password metdata (#14417)
## Summary

**What**

Adds metadata field for reset password route that allows passing data from caller that can be found in the subscriber. 

## Checklist

Please ensure the following before requesting a review:

- [x] I have added a **changeset** for this PR
    - Every non-breaking change should be marked as a **patch**
    - To add a changeset, run `yarn changeset` and follow the prompts
- [x] The changes are covered by relevant **tests**
- [x] I have verified the code works as intended locally
- [ ] I have linked the related issue(s) if applicable


---

> [!NOTE]
> Introduces optional request `metadata` for reset-password and propagates it through to event subscribers.
> 
> - Accepts `metadata` in `ResetPasswordRequest` validator and `reset-password` route; forwards it to `generateResetPasswordTokenWorkflow`
> - Workflow now accepts `metadata` and includes it in emitted `auth.password_reset` event data
> - Updates event docs to mention `metadata` field
> - Adds integration test verifying `metadata` is emitted in the password reset event
> 
> <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 7f9855feabed284336e8872eebfb18fe3bd320db. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup>
2026-01-02 12:41:26 +00:00
Frane Polić
d06729d0d1 fix(dashboard): form reset for across allocation (#14369)
**What**
- fix an issue where switching between `across` promotion types in the create form wouldn't set `max_quantity` to null which would cause the create request to fail

---

CLOSES https://github.com/medusajs/medusa/issues/14365


---

> [!NOTE]
> Prevents invalid `max_quantity` when switching templates to an *across* allocation in the promotion creation flow.
> 
> - In `create-promotion-form.tsx`, after applying template defaults, explicitly sets `application_method.max_quantity` to `null` if `application_method.allocation` is `"across"` to avoid resetting it to `1`
> - Adds a changeset entry for `@medusajs/dashboard` patch release
> 
> <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 5b08c77fee741ec5de399b4f1f9e245ba69b5bee. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup>


Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
2026-01-02 10:46:50 +00:00
Nicolas Gorga
242f1d7d7f feat(dashboard,draft-order): Remove hardcoded strings and replace with translations in draft orders list page (#14400)
## Summary

**What** — What changes are introduced in this PR?

Add translations management to draft orders list page.

**Why** — Why are these changes relevant or necessary?  

We were using hardcoded English strings.

**How** — How have these changes been implemented?

Remove hardcoded strings and replace them with dynamic translations.

**Testing** — How have these changes been tested, or how can the reviewer test the feature?

*Please provide answer here*

---

## Examples

Provide examples or code snippets that demonstrate how this feature works, or how it can be used in practice.  
This helps with documentation and ensures maintainers can quickly understand and verify the change.

```ts
// Example usage
```

---

## Checklist

Please ensure the following before requesting a review:

- [x] I have added a **changeset** for this PR
    - Every non-breaking change should be marked as a **patch**
    - To add a changeset, run `yarn changeset` and follow the prompts
- [ ] The changes are covered by relevant **tests**
- [x] I have verified the code works as intended locally
- [x] I have linked the related issue(s) if applicable

---

## Additional Context

Add any additional context, related issues, or references that might help the reviewer understand this PR.

closes #14377
2026-01-02 10:44:42 +00:00
Nicolas Gorga
bf4cc12545 feat(core-flows,utils): Shipping options workflow events emission (#14388)
* Shipping options workflow events type

* Emit shipping options workflow events

* add changeset
2026-01-02 11:28:29 +01:00
Oli Juhl
7e3ed913a6 chore: Create publishable API key as part of the defaults (#14356)
* wip

* chore: fix tests

* Create tiny-carrots-bathe.md
2026-01-02 11:27:03 +01:00
Nicolas Gorga
11de7e3e34 feat(translation,core-flows): translate remaining core entities and sync shipping option <> method translations (#14358)
* Get translated shipping options step

* Apply translations on shipping options list methods.

* Pass shipping option naem when refreshing cart shipping methods, so if locale changed, we update the name

* Update translatable fields config

* Cart shipping method update translation tests

* Shipping options translations tests

* Add changeset

* Update order shipping method translations on update

* Remove unnecessary workflow and use step instead

* Translate shipping method on order edit

* Use new update shipping methods tranlsations step

* Draft order shipping method translation sync

* Translate shipping method on order exchange

* Translate returns shipping methods

* Translate claims shipping methods

* Remove unnecessary check

* Early return

* Fix import

---------

Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
2026-01-02 11:26:06 +01:00
Oli Juhl
5f807ee657 chore: Ensure isolated order deletion (#14405)
## Summary

Ensure that address deletion during order deletion is handled correctly with respect to cascading deletes. Currently, when deleting an order that does not have a shipping or billing address, we incorrectly attempt to delete all order addresses. This happens because `undefined` address IDs are not handled properly during deletion.

More specifically, when deleting an order without addresses, the following method is called with these arguments:
```ts
await deleteOrderAddresses([undefined, undefined])
```
This triggers deletion of all order addresses.

To make matters worse, because we have a cascade delete defined from order addresses to orders, the same call also deletes all associated orders.

The root cause is the following filtering logic:
```ts
const orderAddressIds = orders
      .map((order) => [order.shipping_address_id, order.billing_address_id])
      .flat(1)
```

For orders without addresses, this produces `[undefined, undefined]` as input filter, which our delete methods interpret as:
```ts
await delete({ '$or': [ { id: undefined }, { id: undefined } ] })
```

This effectively translates to “delete all addresses.”

In this PR, we make two changes to prevent this going forward:
1. Filter out undefined address IDs before attempting deletion
2. Remove the cascade delete from address to order, as this is an aggressive constraint

The latter change is open for discussion, but cascading deletes from a child entity to a parent is slightly off IMO. Let me know your thoughts.

## Checklist

Please ensure the following before requesting a review:

- [x] I have added a **changeset** for this PR
    - Every non-breaking change should be marked as a **patch**
    - To add a changeset, run `yarn changeset` and follow the prompts
- [x] The changes are covered by relevant **tests**
- [x] I have verified the code works as intended locally
- [ ] I have linked the related issue(s) if applicable

---

## Additional Context

Add any additional context, related issues, or references that might help the reviewer understand this PR.


---

> [!NOTE]
> Strengthens order deletion to avoid unintended cascades and validates behavior with tests.
> 
> - Update FK constraints in migration to `ON DELETE SET NULL` for `order.shipping_address_id` and `order.billing_address_id` (was `CASCADE`)
> - In `order-module-service.ts` `deleteOrders`, filter falsy address IDs and conditionally batch-delete `order_address`/`order_change` via `promiseAll`
> - Add integration tests `integration-tests/__tests__/delete-order.spec.ts` covering deletion of orders and associated entities, deleting orders without addresses (no cross-order impact), and address deletion setting `NULL` on the order
> - Add changeset marking `@medusajs/order` patch
> 
> <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 8e4ab59af407ec865f73fbf286ec93e710915c8e. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup>
2026-01-02 10:16:29 +00:00
Pedro Guzman
001923da2b feat: add Medusa Cloud OAuth provider (#14395)
* feat: add Medusa Cloud OAuth provider

* add Cloud login button

* fetch whether cloud auth is enabled through api

* allow unregistered to get session

* handle existing users

* address PR comments

* prevent double execution

* a few more fixes

* fix callback url

* fix spelling

* refresh session

* 200 instead of 201

* only allow cloud identities to create user

* fix condition
2025-12-30 17:30:10 +01:00
Shahed Nasser
499dec6d31 docs: added callouts in search and AI assistant (#14421)
* docs: added callouts in search and AI assistant

* added more suggestions

* fix search tests

* add mock for links
2025-12-30 16:57:18 +02:00
Shahed Nasser
1ed6e6b308 docs: add examples for migrations (#14420) 2025-12-30 15:42:34 +02:00
Shahed Nasser
40db4c22d3 docs: added support for tests in www workspace (#14415)
* tests for components (WIP)

* finished adding tests to components

* added tests for providers

* add test command to doc tests

* fix imports

* exclude test files

* remove import

* add vitest as dev dependency

* fix build error

* ignore test files from eslint

* fix test from docs-ui
2025-12-30 13:19:57 +02:00
Shahed Nasser
e110c08970 docs: add how-to guide for removing country code in storefront prefix (#14419) 2025-12-30 13:01:55 +02:00
Shahed Nasser
1de4d1e700 docs: use 200 for routes response across docs (#14418) 2025-12-30 09:36:10 +02:00
Shahed Nasser
4ac7b72d10 fix(dashboard): fix customer details page crashing when their order is refunded (#14413)
1. Fix the customer details page crashing when a customer's order is fully refunded. The error was originating from the payment collections of the order not being retrieved, since they're being used to calculate the refunded total.
2. Other: fix country not showing as well due to incorrectly trying to retrieving and access the shipping address's country

Closes #14409
2025-12-29 09:38:21 +00:00
Shahed Nasser
89a0adc612 fix(types): add missing completed_at property for carts (#14412) 2025-12-29 11:08:37 +02:00
Carlos R. L. Rodrigues
d347e369ce fix(medusa,framework): HMR file watch (#14390) 2025-12-27 15:52:38 +01:00
Nicolas Gorga
caa561badf feat(dashboard): Add first and last name inputs to update order shipping and billing address forms (#14394)
* Add first_name and last_name to order edit addresses forms

* Add changeset
2025-12-27 15:49:50 +01:00
Shahed Nasser
ba3a572a89 docs: various improvements to introduction guides (#14398) 2025-12-24 15:37:37 +02:00
Shahed Nasser
10dab3a47a docs: allow stop answer generation in AI assistant (#14387) 2025-12-23 08:58:16 +02:00
Shahed Nasser
662ec7430b docs: resolve example tag in DML properties (#14383) 2025-12-22 17:52:24 +02:00
Shahed Nasser
04a6343951 docs-utils: performance improvements for the clean OAS script (#14386) 2025-12-22 17:06:55 +02:00
Shahed Nasser
dc52dfd1dd docs: small fixes and improvements to text (#14385) 2025-12-22 17:06:25 +02:00
Shahed Nasser
b221e882d4 docs-utils: add operator map to docs generator knowledge base (#14382) 2025-12-22 14:41:01 +02:00
Shahed Nasser
cb33388202 docs: add line highlight validation (#14380)
* docs: add line highlight validation

* add to all projects

* fixes

* fixes

* fix

* fixes
2025-12-22 14:10:39 +02:00
Shahed Nasser
6380c1fdf4 fix(medusa): allow passing null to cart API routes (#14381)
Allow passing `null` as the locale for cart API route, as `optional` only allow passing `undefined`.
2025-12-22 08:51:01 +00:00
Shahed Nasser
e07f22c4eb docs: add admin extensions to navbar (#14368) 2025-12-19 19:51:05 +02:00
Adrien de Peretti
b21a599d11 feat(): Translation settings + user configuration + admin hook and js sdk + dashboard (#14355)
* feat(): Translation settings + user configuration

* feat(): Translation settings + user configuration

* Create gentle-bees-grow.md

* add entities end point

* add entities end point

* add admin hook and js sdk method

* update changeset

* fix tests

* fix tests

* rm unnecessary copy

* update dashboard to use the new resources

* update dashboard to use the new resources

* update dashboard to use the new resources

* allow type inference through interface augmentation in the defineConfig of medusa-config

* allow type inference through interface augmentation in the defineConfig of medusa-config

* exclude id and _id props

---------

Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
2025-12-19 15:29:48 +01:00
Shahed Nasser
797878af26 docs: fix total descriptions across docs (#14366) 2025-12-19 15:31:28 +02:00
Shahed Nasser
365468d3da chore: fix TSDocs of total fields to be accurate (#14367) 2025-12-19 15:16:55 +02:00
Irakli
1c89acc536 feat: added ka-GE to the default list of locales (#14364) 2025-12-19 12:48:57 +01:00
Adrien de Peretti
ee8d7221da Revert "add generated .medusa/types to local plugins (#13777)" (#14361)
This reverts commit 125694626e.
2025-12-19 11:10:38 +01:00
Adrien de Peretti
181d5fa671 feat(): Auto generated types generation upon build (#14337)
* feat(): Auto generated types generation upon build

* Create happy-steaks-cheer.md

* test(): default types true

* improvements

* improvements

* improvements

* improvements

* improvements
2025-12-19 10:13:17 +01:00
Leonardo Benini
125694626e add generated .medusa/types to local plugins (#13777)
Co-authored-by: Adrien de Peretti <adrien.deperetti@gmail.com>
2025-12-19 07:01:15 +01:00
Shahed Nasser
fb11f0f272 docs: fixes related to troubleshooting (#14353) 2025-12-18 17:00:59 +02:00
Adrien de Peretti
fb6a6b52fa fix(order): Prevent fetching all db adjustments when no items are pre… (#14351)
* fix(order): Prevent fetching all db adjustments when no items are present

* Create funny-suns-think.md
2025-12-18 15:21:32 +01:00
Shahed Nasser
7172995bde docs: add vite configuration to docker guide (#14352) 2025-12-18 15:52:27 +02:00
0xFl4g
0277062fec fix(translation): prevent duplicate locale error on server restart (#14345)
The translation module's defaults loader throws a warning on every server
restart after the first run because the upsert method uses `id` as the
unique key, but defaultLocales only contains `code` and `name`.

This causes the upsert to always attempt creation, which fails on the
unique `code` constraint with: "Locale with code: en-US, already exists."

Fix: Fetch existing locales first and map their IDs into defaultLocales
so upsert can properly identify existing records and update them.
2025-12-18 11:56:18 +01:00
Shahed Nasser
92d240d749 fix(medusa): fix type of product variant request param (#14342)
Fix type argument for requests which is necessary for generating OpenAPI specs

## Why

The `StoreVariantListRequest` type used in the `/store/product-variants` route doesn't match the convention of other routes since it doesn't accept a type parameter for the query (or body, but here that's not necessary). This makes it difficult for us to infer the query parameter type of the request.

This change would adapt the `StoreVariantListRequest` to match other conventions in our API routes so that we can generate correct OAS for docs
2025-12-17 16:20:54 +00:00
Shahed Nasser
1c4c4b8e9a docs: generate references manually for 2.12.3 (#14340) 2025-12-17 18:20:19 +02:00
Shahed Nasser
52e965f411 docs: generate API reference for 2.12.3 (#14341) 2025-12-17 18:19:46 +02:00
Shahed Nasser
c0ec54fc15 fix(core-flows): fix type of getTranslatedLineItemsStep (#14338)
Fix the return type of the `getTranslatedLineItemsStep`, otherwise our reference generator can't pick up the step's typing correctly
2025-12-17 15:56:38 +00:00
Shahed Nasser
07bb931254 docs: document cloud sign in methods, usage and add-on changes (#14333) 2025-12-17 16:27:34 +02:00
github-actions[bot]
c97c600656 chore(docs): Generated DML JSON files (automated) (#14335)
Co-authored-by: olivermrbl <olivermrbl@users.noreply.github.com>
2025-12-17 16:10:15 +02:00
github-actions[bot]
25bb8da9c8 chore(docs): Update version in documentation (automated) (#14334)
Co-authored-by: olivermrbl <olivermrbl@users.noreply.github.com>
2025-12-17 15:50:23 +02:00
github-actions[bot]
663bc8f662 chore(docs): Generated + Updated UI Reference (automated) (#14336)
Co-authored-by: olivermrbl <olivermrbl@users.noreply.github.com>
2025-12-17 15:50:04 +02:00
olivermrbl
74d2a8675a chore: Release 2025-12-17 14:01:39 +01:00