Commit Graph

8467 Commits

Author SHA1 Message Date
Shahed Nasser
bc965eb6aa docs: improve module isolation chapter (#12565)
* docs: improve module isolation chapter

* add note about loaders running with migrations
2025-05-21 18:57:28 +03:00
Adrien de Peretti
499381d119 chore(index): Few adjustments (#12557)
**What**
- Adjust lock duration, it is in seconds and not in ms
- Log on lock release 
- Renew lock separately from the other promises
- Add more logs 
  - Log when lock can't be acquired. It can be expected in case two processes try to sync the same entity and in that case it can be ignored. But at least it gives some information in case it happens for another reason
  - Log when the release lock failed, the lock will remain in the locking provider for 1 minute before being removed. But it wont prevent other entities to be synced
2025-05-21 15:06:35 +00:00
Aditya Erlangga Wibowo
22687d694e Fix: Incorrect Example File Name in Subscriber Section (#12560)
Solving issue [#12559](https://github.com/medusajs/medusa/issues/12559) this PR corrects the example file name provided in the Events and Subscribers section of the documentation. Previously, the guide instructed users to create a file at:

_`src/subscribers/order-placed.ts`_
However, the appropriate file name should be:

_`src/subscribers/product-created.ts`_
This fix aligns the documentation with the actual subscriber example, ensuring clarity and preventing confusion for developers following the guide.

<img width="1497" alt="subscriber-wrong-file-name" src="https://github.com/user-attachments/assets/23320e3d-75ee-4df9-9a9c-5b77edfe08ff" />

Changes
Updated the incorrect file name in the Subscriber section example from order-placed.ts to product_created.ts.

Review
@shahednasser – kindly review when you get the chance. Thanks!
2025-05-21 14:54:43 +00:00
Shahed Nasser
e6b6c0d3b7 chore(types, utils): update TSDocs related to analytics module (#12564) 2025-05-21 14:43:09 +00:00
Frane Polić
3071d09a03 fix(core-flows): skip location check if inventory is not managed (#12540)
* fix: skip location check if inventory is not managed

* fix: rm todo

* chore: changeset
2025-05-21 15:37:43 +02:00
Shahed Nasser
db33616cf9 chore(core-flows): add tsdocs for hooks in complete cart (#12555) 2025-05-21 14:25:53 +03:00
Shahed Nasser
61d3bdde4a docs-util: extract feature flags in generated OAS (#12554) 2025-05-21 14:25:40 +03:00
Shahed Nasser
bda143673d docs: show hooks in when condition in workflows reference (#12552) 2025-05-21 13:00:15 +03:00
coded
13f29e5ca3 chore(docs): Update npm command (#12547)
`npm run install` in the first place is not a valid command, `yarn run install` will also be fixed by this change as we are using  **npm-to-yarn** package for its conversion (tested).

`yarn run start` is a valid command, i know `yarn start` is a **short-hand** but i cant help here as we have't hardcoded it in the docs its being converted through the same package mentioned above, anyways both are valid so should be fine ig.
2025-05-21 06:58:33 +00:00
Shahed Nasser
9f376ff1f1 fix(js-sdk): allow passing custom request body parameters in auth.register method (#12545)
The `auth.login` method of the JS SDK allows passing custom, which is useful for custom authentication providers. For example:

```ts
const response = await sdk.auth.login("customer", "phone-auth", {
      phone
    })
```

However, the `auth.register` method doesn't allow that, so we can't do the following:

```ts
const response = await sdk.auth.register("customer", "phone-auth", {
      phone
    })
```

Instead, we'd have to use the `client.fetch` method.

This PR fixes the input type of the payload passed to the `register` method to be similar to that of `login`,  which would allow using it with custom authentication providers
2025-05-20 16:27:13 +00:00
Harminder Virk
d9fdabe96d fix: mark posthog-node as a peer dependency (#12539)
Since the runtime of the `@medusajs/analytics-posthog` relies on `posthog-node` package. It should be either installed as a dependency or a peerDependency that will be satisfied by the user project.

In this PR, I have added it as a peer dependency
2025-05-20 14:51:51 +00:00
Adrien de Peretti
41054a3419 fix(product): Deep update data retrieval bottleneck (#12538)
* fix(product): Deep update data retrieval bottleneck

* Create shiny-spiders-matter.md

* fix(product): Deep update data retrieval bottleneck
2025-05-20 16:42:42 +02:00
Carlos R. L. Rodrigues
ebe5cc7acd chore(index): return ids only (#12543) 2025-05-20 11:16:02 -03:00
Harminder Virk
fca5ad77b4 feat: process import from pre-processed chunks (#12527)
Fixes: FRMW-2968

In this PR we have done two major things.

- First, we remove storing CSV contents within the workflow storage and neither store the JSON payloads to be created/updated in workflows. Earlier, they all were workflow inputs, hence were stored in the workflow
- Introduce a naive concept of chunks and process chunks one by one. The next PR making chunking a bit more robust while using streams, adding ability to resume from the failed chunk and so on.

> [!IMPORTANT]  
> The new endpoint `/admin/product/imports` is not in use yet. But it will be after the next (final) PR.

## Old context in workflow storage

![CleanShot 2025-05-19 at 17 11 08@2x](https://github.com/user-attachments/assets/798bdcc9-a368-4c1f-afdd-2a77f5ce43e0)

## New context in workflow storage

![CleanShot 2025-05-19 at 17 15 08@2x](https://github.com/user-attachments/assets/0463d035-403f-4600-a9cd-5af24d5fee7c)
2025-05-20 12:33:18 +00:00
Stevche Radevski
3e5794d657 fix: Correctly import MedusaError in the analytics module (#12542) 2025-05-20 13:29:51 +02:00
Shahed Nasser
07ecb8595a docs: added re-order guide (#12363)
* docs: added re-order guide

* reiteration to intro

* adjustment to title

* fix vale error

* generate

* fix vale
2025-05-20 13:10:31 +03:00
Cypress
54809b8499 fix(i18n): Correct Chinese translations in zhCN.json (#12537) 2025-05-20 09:47:41 +02:00
Carlos R. L. Rodrigues
59bbff62d8 fix(index): Apply various fixes to the index engine (#12501) 2025-05-19 15:14:25 -03:00
Carlos R. L. Rodrigues
32be40a2c0 fix(medusa): add estimate count to admin products (#12467)
what:
 * Add `estimate_count` property to `/admin/products` endpoint when index engine FF is on
2025-05-19 18:06:28 +00:00
Stevche Radevski
b9a51e217d feat: Add an analytics module and local and posthog providers (#12505)
* feat: Add an analytics module and local and posthog providers

* fix: Add tests and wire up in missing places

* fix: Address feedback and add missing module typing

* fix: Address feedback and add missing module typing

---------

Co-authored-by: Adrien de Peretti <adrien.deperetti@gmail.com>
Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
2025-05-19 19:57:13 +02:00
Adrien de Peretti
52bd9f9a53 chore(product, modules-sdk): Add missing index for select-in strategy + allow to pass top level strategy to force the behaviour (#12508)
**What**
- Add missing index for query that falls in select in strategy, specifically the heaviest one with variant IN filtering
- Allow to force the strategy to be sent to the entry point module when using the graph API. It is useful with big dataset where filtering is enough without pagination and select in can offer better performances

e.g
```ts
       await query.graph({
            entity: 'product',
            fields,
            filters,
            strategy: 'select-in' // <-- this will force the module to use receive this value and apply it accordingly 
        })
```
2025-05-19 15:57:58 +00:00
Shahed Nasser
397d353af6 docs: fix timeout in order-related workflows reference (#12533) 2025-05-19 17:30:21 +03:00
Frane Polić
b8ab053252 fix(dashboard): refund payment formatting (#12476)
* fix(dashboard): refund payment formatting

* fix: reduce SC pagination limit
2025-05-19 15:49:34 +02:00
Adrien de Peretti
dd66720404 feat(index): Only run the synchronisation in worker/shared mode (#12530)
* feat(index): Only run the synchronisation in worker/shared mode

* Create dirty-trees-smoke.md
2025-05-19 14:20:51 +02:00
Adrien de Peretti
ac49eb9a6c Typo/index logs (#12528)
* typo(index): Improve logs content

* typo(index): Improve logs content

* Create metal-knives-brake.md
2025-05-19 10:12:44 +02:00
Adrien de Peretti
e179f5c76e chore(test-cli-with-database): Update cli tag from latest to preview (#12529) 2025-05-19 09:59:00 +02:00
Shahed Nasser
2ced969396 docs: change recipes on homepage (#12520)
* docs: changed recipes on homepage

* export icon
2025-05-19 10:05:57 +03:00
Adrien de Peretti
85d2b3c992 fix(utils): Missing zod deps (#12518) 2025-05-18 15:49:59 +02:00
Shahed Nasser
a1f2e5cb52 docs: add vale rule for Next.js Starter Storefront (#12517) 2025-05-16 17:30:15 +03:00
Harminder Virk
5cd4ff6fe7 test: remove snapshots usage (#12516)
* test: remove snapshots usage

* test: remove unneeded assertions

* Create plenty-poems-reply.md

* update tests

* update tests

---------

Co-authored-by: adrien2p <adrien.deperetti@gmail.com>
2025-05-16 16:11:01 +02:00
Shahed Nasser
d73cf66196 docs: update recipe contents (#12515) 2025-05-16 16:37:52 +03:00
Adrien de Peretti
399dddc0c7 test(workflow-engine-redist): Update tests to ensure behaviour validation properly (#12514) 2025-05-16 15:03:38 +02:00
github-actions[bot]
aaf5407d29 chore(docs): Generated References (automated) (#12511)
Co-authored-by: olivermrbl <olivermrbl@users.noreply.github.com>
Co-authored-by: Shahed Nasser <shahednasser@gmail.com>
2025-05-16 15:29:29 +03:00
github-actions[bot]
251a063a2f chore(docs): Generated + Updated UI Reference (automated) (#12510)
Co-authored-by: olivermrbl <olivermrbl@users.noreply.github.com>
2025-05-16 13:20:54 +03:00
github-actions[bot]
03bfd760a4 chore(docs): Update version in documentation (automated) (#12509)
Co-authored-by: olivermrbl <olivermrbl@users.noreply.github.com>
2025-05-16 13:18:29 +03:00
Stevche Radevski
66ec80ec31 fix: Skip migration if module is not installed (#12507) 2025-05-16 11:57:06 +02:00
olivermrbl
d73d8e9903 chore: Release 2025-05-16 11:35:18 +02:00
olivermrbl
8c0b49fed4 chore: Version packages 2025-05-16 11:04:39 +02:00
Frane Polić
9f4d32b220 fix(core-flows): fulfilment cancelation with shared inventory kit item (#12503)
* fix(core-flows): fulfilment cancelation with shared inventory kit item

* fix: typos, check if iitem exists

* chore: typo
2025-05-16 10:50:10 +02:00
Harminder Virk
e149a99886 feat: define validators and use normalize-products step (#12473)
Fixes: FRMW-2965

In this PR we replace/remove the existing step to normalize a CSV file with the newly written CSV normalizer and also we validate the file contents further using a Zod schema.

I have duplicated the schema for now. But it is makes sense to re-use the schema for CSV validating and `/admin/products/batch`, then I can keep one source of truth under utils and re-export it. WDYT?

**Screenshots of some errors after validating the file strictly**

![CleanShot 2025-05-15 at 16 36 46@2x](https://github.com/user-attachments/assets/c7fa424f-b947-4898-9b94-47c48617c129)

![CleanShot 2025-05-15 at 16 36 34@2x](https://github.com/user-attachments/assets/0fefef79-148b-4eeb-8ef0-3077e8063ea8)
2025-05-16 08:37:25 +00:00
Pedro Guzman
2affc0d7d9 fix: fix weight/length/height/width types in updates (#12500) 2025-05-16 10:16:43 +02:00
Shahed Nasser
04acc5d219 docs: update examples in sendgrid guide (#12504)
* initial

* docs: update examples in sendgrid guide

* add note for local file module
2025-05-15 19:13:15 +03:00
Shahed Nasser
e91aa2493a chore(types, utils): TSDoc improvements for providers (#12498)
* chore(types, utils): TSDoc improvements for providers

* small iteration
2025-05-15 18:40:33 +03:00
Shahed Nasser
22cdcedddc docs: improve payment related guides (#12502)
* improve guide

* update guides

* small change
2025-05-15 18:40:21 +03:00
Shahed Nasser
b312a7e077 docs: add missing methods in guides and references (#12495)
* initial

* remove unused references
2025-05-15 14:22:23 +03:00
Shahed Nasser
b2984f48f5 fix(types): change update signature of IAuthProvider (#12496)
Change the signature of the `update` method in `IAuthProvider` to match other methods. this is necessary as in the generated references `update` was being inferred as a property rather than a method.
2025-05-15 11:02:05 +00:00
github-actions[bot]
e81d2333bc chore(docs): Generated References (automated) (#12492)
Generated the following references:
- `api_key_models`
- `auth_models`
- `cart_models`
- `core_flows`
- `currency_models`
- `customer_models`
- `fulfillment_models`
- `inventory_next_models`
- `js_sdk`
- `modules`
- `order_models`
- `payment_models`
- `pricing_models`
- `product_models`
- `promotion_models`
- `region_models`
- `sales_channel_models`
- `stock_location_next_models`
- `store_models`
- `tax_models`
- `types`
- `user_models`
- `utils`

Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
2025-05-15 08:36:24 +00:00
github-actions[bot]
d3d138bad3 chore(docs): Generated + Updated UI Reference (automated) (#12491)
Co-authored-by: olivermrbl <olivermrbl@users.noreply.github.com>
2025-05-15 11:27:28 +03:00
github-actions[bot]
4731f3f1ec chore(docs): Update version in documentation (automated) (#12490)
Co-authored-by: olivermrbl <olivermrbl@users.noreply.github.com>
2025-05-15 11:01:01 +03:00
olivermrbl
3e61715597 chore: Release 2025-05-15 09:51:07 +02:00