Commit Graph

7979 Commits

Author SHA1 Message Date
Nicklas Gellner d24090e0bd Update page.mdx (#11841)
Co-authored-by: Shahed Nasser <27354907+shahednasser@users.noreply.github.com>
2025-03-14 06:56:34 +00:00
Riqwan Thamir 67b308c8eb fix(promotion): percentage value is accounted for in buyget promotions (#11799)
what:

- allows percentage value to be considered for buy get percentage

FIXES https://github.com/medusajs/medusa/issues/11259
2025-03-13 17:09:46 +00:00
Kasper Fabricius Kristensen 3063d6e601 fix(dashboard): Include thumbnail in default product query (#11825)
RESOLVES CMRC-984
2025-03-13 16:26:39 +00:00
Adrien de Peretti fc652ea51e fix(workflow-engine-*): scheduled jobs interval (#11800)
**What**
Currently only cron pattern are supported by scheduled jobs, this can lead to issue. for example you set the pattern to execute every hours at minute 0 and second 0 (as it is expected to execute at exactly this constraint) but due to the moment it gets executed we our out of the second 0 then the job wont get executed until the next scheduled cron table execution.

With this pr we introduce the `interval` configuration which allows you the specify a delay between execution in ms (e.g every minute -> 60 * 1000 ms) which ensure that once a job is executed another one is scheduled for a minute later.

**Usage**
```ts
// jobs/job-1.ts
const thirtySeconds = 30 * 1000

export const config = {
  name: "job-1",
  schedule: {
    interval: thirtySeconds
  },
}
```
2025-03-13 15:05:13 +00:00
Saryazdi-Saman e05491c24f fix: preserve payment sessions during certain Stripe errors for webhook reconciliation (#11798)
* fix: preserve payment sessions during certain Stripe errors for webhook reconciliation

fix: add retry mechanism for errors that might be fixed after retry

fix: authorizePaymentSession method will update payment_session.status regardless regardless of wether or not the authorization is successful

* Refactor: improve handling structure and syntax

-Move HandledErrorType definition to the top of stripe-base

- Use timers/promises for setTimeout

- Removed data in HandledErrorType when retry is true

* refactor: improve error handling flow and logic

- Simplify return statement in initiatePayment to handle null cases

- Remove redundant if-check in handleStripeError and rely on switch

- Reorder conditional checks in executeWithRetry for clearer flow

- Update executeWithRetry to check for retry=false condition first

* clean up

* fix: improve payment error handling and traceability

- Return structured error state for StripeAPIError instead of null

- Throw error when retries are exhausted and no payment intent exists

- Update type definitions to support error state tracking

* fix formatting and naming
2025-03-13 14:46:31 +01:00
Shahed Nasser 28b0d08591 docs: add documentation for Locking Module (#11824)
* add locking docs

* fix main navbar

* added implementation example links

* generate refs

* update architecture

* fix vale error
2025-03-13 12:20:24 +02:00
Carlos R. L. Rodrigues 5cf0bf4d93 chore: admin product list transform filter (#11821) 2025-03-12 13:21:09 -03:00
Stevche Radevski e0109540fa feat: Change customer to account_holder to be one-to-many (#11803) 2025-03-12 16:05:38 +01:00
Carlos R. L. Rodrigues 6053ec3976 chore(workflow-engine-redis): remove repeatable jobs from old queue (#11822)
What:
  * Old  deployments have repeatable jobs registered in a wrong queue. When the `server` instance picks that job, the workflow doesn't exist, it calls to remove the job, which then removes the job from the new queue.
  * This PR cleans up any repeatable job from the queue that is exclusive to handle workflows.
2025-03-12 14:54:10 +00:00
Shahed Nasser 76a0d8e1d8 chore(types): small fixes to locking TSDocs (#11823)
* chore(types): small fixes to locking TSDocs

* add missing return
2025-03-12 16:31:07 +02:00
Adrien de Peretti 72d2cf9207 fix(workflow-engines): race condition when retry interval is used (#11771) 2025-03-12 09:53:34 -03:00
Radek Napora c97eaa0e0d Polish translations improvements (#11808)
* Polish translations improvements

* Improve Polish pluralization rules

---------

Co-authored-by: Stevche Radevski <sradevski@live.com>
2025-03-12 11:58:48 +01:00
Shahed Nasser bed8918c31 chore(types): add tsdocs for locking module and provider (#11818) 2025-03-12 10:45:29 +02:00
Harminder Virk 375c4a5ab1 refactor: use module name as the snapshot name (#11802)
Fixes: FRMW-2930

This PR updates the MikroORM config to use the module name as the snapshot name when generating migration files. Otherwise, MikroORM defaults to the database name and every time you update the database name, it will create a new snapshot. 

Also, we migrate existing snapshot files to be same the new file name to avoid breaking changes.
2025-03-12 07:02:19 +00:00
Shahed Nasser 267af9f3f6 docs: add worker mode documentation + improvements (#11812) 2025-03-11 19:12:32 +02:00
Shahed Nasser ef66ff8f99 docs: improvement to sidebar (#11810)
* docs: improvement to sidebar

* fix sidebar
2025-03-11 16:48:01 +02:00
Shahed Nasser e0277e375e docs: add missing details related to links and migrations (#11809)
* docs: add missing details related to links and migrations

* reorder content

* small changes

* last changes

* improve examples

* fix lint error
2025-03-11 16:22:52 +02:00
Shahed Nasser de213a8aa9 docs: fix restaurant-delivery recipe after latest update (#11806) 2025-03-11 15:05:54 +02:00
Shahed Nasser 06c05e54c5 Merge pull request #11793 from medusajs/docs/change-arch
docs: update sidebars and navigation bar
2025-03-11 14:00:13 +02:00
Kasper Fabricius Kristensen ec56a8bc85 fix(medusa,utils,test-utils,types,framework,dashboard,admin-vite-plugin,admin-bundler): Fix broken plugin dependencies in development server (#11720)
**What**
- Reworks how admin extensions are loaded from plugins.
- Reworks how extensions are managed internally in the dashboard project.

**Why**
- Previously we loaded extensions from plugins the same way we do for extension found in a users application. This being scanning the source code for possible extensions in `.medusa/server/src/admin`, and including any extensions that were discovered in the final virtual modules.
- This was causing issues with how Vite optimizes dependencies, and would lead to CJS/ESM issues. Not sure of the exact cause of this, but the issue was pinpointed to Vite not being able to register correctly which dependencies to optimize when they were loaded through the virtual module from a plugin in `node_modules`.

**What changed**
- To circumvent the above issue we have changed to a different strategy for loading extensions from plugins. The changes are the following:
  - We now build plugins slightly different, if a plugin has admin extensions we now build those to `.medusa/server/src/admin/index.mjs` and `.medusa/server/src/admin/index.js` for a ESM and CJS build.
  - When determining how to load extensions from a source we follow these rules:
    - If the source has a `medusa-plugin-options.json` or is the root application we determine that it is a `local` extension source, and load extensions as previously through a virtual module.
    - If it has neither of the above, but has a `./admin` export in its package.json then we determine that it is a `package` extension, and we update the entry point for the dashboard to import the package and pass its extensions a long to the dashboard manager.

**Changes required by plugin authors**
- The change has no breaking changes, but requires plugin authors to update the `package.json` of their plugins to also include a `./admin` export. It should look like this:

```json
{
  "name": "@medusajs/plugin",
  "version": "0.0.1",
  "description": "A starter for Medusa plugins.",
  "author": "Medusa (https://medusajs.com)",
  "license": "MIT",
  "files": [
    ".medusa/server"
  ],
  "exports": {
    "./package.json": "./package.json",
    "./workflows": "./.medusa/server/src/workflows/index.js",
    "./.medusa/server/src/modules/*": "./.medusa/server/src/modules/*/index.js",
    "./modules/*": "./.medusa/server/src/modules/*/index.js",
    "./providers/*": "./.medusa/server/src/providers/*/index.js",
    "./*": "./.medusa/server/src/*.js",
    "./admin": {
      "import": "./.medusa/server/src/admin/index.mjs",
      "require": "./.medusa/server/src/admin/index.js",
      "default": "./.medusa/server/src/admin/index.js"
    }
  },
}
```
2025-03-11 11:28:33 +00:00
Shahed Nasser 6d5604f1d7 open UI sidebar items 2025-03-11 12:56:32 +02:00
Shahed Nasser 95307f9a1d remove broken link 2025-03-11 12:26:27 +02:00
Shahed Nasser 3dd8061ae6 fix incorrect dropdown link 2025-03-11 12:25:22 +02:00
Shahed Nasser a26f48fde2 finalize changes 2025-03-11 12:18:40 +02:00
Shahed Nasser 8d23c97af9 Merge branch 'develop' into docs/change-arch 2025-03-11 11:57:45 +02:00
Shahed Nasser c1057410d9 Merge pull request #11741 from medusajs/docs/quote-management-guide
feat: add Quote Management guide
2025-03-11 11:21:47 +02:00
Shahed Nasser 39ca808ae4 Merge branch 'develop' into docs/quote-management-guide 2025-03-11 11:00:22 +02:00
Shahed Nasser 6998c0c32d change meta image 2025-03-11 11:00:06 +02:00
Shahed Nasser ac989a6ed1 moved configurations page 2025-03-11 10:59:29 +02:00
github-actions[bot] 7cf66bdbd2 chore(docs): Generated References (automated) (#11795) 2025-03-10 18:22:05 +02:00
github-actions[bot] 27f9bbfcf5 chore(docs): Update version in documentation (automated) (#11794) 2025-03-10 17:59:58 +02:00
Shahed Nasser 5a5da0d6a1 remove main reference page 2025-03-10 17:34:45 +02:00
Shahed Nasser 0ba63ac29e change main navbar 2025-03-10 17:19:23 +02:00
olivermrbl b9edc066c8 chore: Release 2025-03-10 15:47:42 +01:00
olivermrbl f1cac99316 chore: Version packages 2025-03-10 15:44:09 +01:00
Shahed Nasser 0c71bce1e2 finish sidebar changes 2025-03-10 16:02:26 +02:00
Kasper Fabricius Kristensen 62e429178f fix(medusa): Use correct query config (#11789) 2025-03-10 13:13:46 +00:00
Shahed Nasser affd5e83d4 add references sidebar 2025-03-10 15:11:42 +02:00
Shahed Nasser 11db301f9b added tools section 2025-03-10 14:41:02 +02:00
Shahed Nasser d2c4323299 add storefront development sidebar 2025-03-10 14:20:29 +02:00
Shahed Nasser 46c9314f43 add integrations sidebar 2025-03-10 13:55:51 +02:00
Shahed Nasser e2d832ebc2 add how-to sidebar 2025-03-10 13:38:55 +02:00
Kasper Fabricius Kristensen 90964a404e fix(medusa): Apply middleware to GET customers/:id/addresses/:address_id (#11788) 2025-03-10 11:31:19 +00:00
Frane Polić 4c28efaadc fix(dashboard): display minute instead of month (#11731)
**What**
- display minutes instead of months
- remove manual offsetting since the server returns ISO format and JS date converts it to local time

---

CLOSES SUP-1069
2025-03-10 11:07:52 +00:00
Shahed Nasser 385620e824 docs: fix duplicate footer in user guide (#11785) 2025-03-10 11:17:24 +02:00
Shahed Nasser 8b1ee3705e split sidebars + optimize generated files loading 2025-03-10 10:32:45 +02:00
Shahed Nasser 783783101a generate sidebar 2025-03-10 08:37:10 +02:00
Shahed Nasser 4c4f97c940 Merge branch 'develop' into docs/quote-management-guide 2025-03-10 08:35:03 +02:00
Shahed Nasser 87b041800a fixes + added new sidebars 2025-03-10 08:33:21 +02:00
Frane Polić bd4428c40e fix(dashboard): allow creating fulfillment for items without shipping profile (#11733)
* fix: allow creating fulfillment of items without shipping profile

* fix: move quantity filtering
2025-03-09 13:48:41 +01:00