Commit Graph

4958 Commits

Author SHA1 Message Date
Frane Polić
911eefadbd fix(dashboard): delete user messages (#11004)
CLOSES CMRC-760
2025-01-16 19:20:46 +00:00
Riqwan Thamir
5eab9e7399 feat(promotion,dashboard,types,utils,medusa): Add statuses to promotions (#10950)
what:

- adds a status column to promotion table
- introduce active promotion query
- scope revert, register and compute actions to active promotions
- admin to create and update promotion with statuses

RESOLVES CMRC-845
RESOLVES CMRC-846
RESOLVES CMRC-847
RESOLVES CMRC-848
RESOLVES CMRC-849
RESOLVES CMRC-850
2025-01-16 19:17:22 +00:00
Shahed Nasser
effee5c8bb chore(js-sdk): update TSDocs of auth callback (#11005)
* chore(js-sdk): update TSDocs of auth callback

* generate doc
2025-01-16 20:13:01 +02:00
Shahed Nasser
32dd383e9a chore(core-flows,types): improve tsdocs of pricing-related workflows (#11000)
* chore(core-flows,types): improve tsdocs of pricing-related workflows

* fix build error
2025-01-16 20:12:45 +02:00
Shahed Nasser
8e7c13862d chore(core-flows): improve TSDocs for payment workflows / steps (#10998) 2025-01-16 20:12:25 +02:00
Stevche Radevski
f99f720dd4 feat: Add support for listing saved payment methods in module and Stripe (#10994) 2025-01-16 16:16:04 +01:00
Harminder Virk
114b2133aa chore: lazy import admin-bundler and run scripts during publish (#10996) 2025-01-16 20:28:17 +05:30
Adrien de Peretti
9a742911fe fix(framework): Exclude .d.ts files from the glob search and fix insert query (#10990)
**What**
- Exclude definition file from the glob search string
- Properly generate the insert query string
2025-01-16 14:29:09 +00:00
Shahed Nasser
b79dc40bc9 chore(core-flows): improve TSDocs of customer and customer groups workflows / steps (#10993)
* improve customer tsdocs

* finished improving tsdocs

* fix build error
2025-01-16 15:29:59 +02:00
Shahed Nasser
52f6cfe922 chore(core-flows,types): improve tsdocs of fulfillment (#10995) 2025-01-16 15:05:01 +02:00
Stevche Radevski
da8e173974 feat: Remove fields from payment models that were leftovers from v1 (#10987) 2025-01-16 10:10:03 +01:00
Shahed Nasser
8cd58b3092 chore(core-flows,types): improve TSDocs of cart workflows and steps (#10962)
* chore(core-flows,types): improve TSDocs of cart workflows and steps

* fix build errors

* fix build error

* fix errors
2025-01-16 09:44:52 +02:00
Stevche Radevski
f5235862c0 feat: Improvements to payment module and Stripe provider (#10980)
* fix: Correctly parse Stripe error, remove unused method

* fix: Isolate the payment provider error check function

* fix: Allow passing few extra parameters to Stripe

---------

Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
2025-01-16 08:12:53 +01:00
Stevche Radevski
44cd0224af fix: Put routes loader error inline (#10912) 2025-01-16 08:11:19 +01:00
Harminder Virk
c75678d6d4 feat: add support for loading admin extensions from the source (#10975) 2025-01-16 11:06:56 +05:30
Adrien de Peretti
8792d0c062 fix(index): Add type casting to raw order by (#10899)
**What**
Fix index engine query builder to include column type casting on order by

Co-authored-by: Carlos R. L. Rodrigues <37986729+carlos-r-l-rodrigues@users.noreply.github.com>
2025-01-15 23:51:16 +00:00
Carlos R. L. Rodrigues
11f98f374c feat(core-flows): validate hook in cart workflows (#10967)
* feat(core-flows): validate hook

* rm only
2025-01-15 18:49:46 -05:00
Kasper Fabricius Kristensen
2a25b4d95f chore(dashboard,icons): Update icons and switch icon in CategoryTree (#10961)
Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
2025-01-15 12:57:43 -05:00
Stevche Radevski
d845adc68b fix: Include is default billing and shipping fields in the address response (#10970)
Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
2025-01-15 12:52:51 -05:00
Adrien de Peretti
0924164e86 feat(core, medusa, cli): Enable migration scripts (#10960)
* feat(core, medusa): Enable migration scripts

* spacing

* rm unnecessary import

* Allow to skip script migration

* fix missing options

* add options

* add tests and small changes

* update

* add checks

* add lock mechanism to be extra safe

* Create six-bears-vanish.md

* update queries

* fix tests

---------

Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
2025-01-15 12:51:37 -05:00
Shahed Nasser
ff739045fa chore(core-flows,types): improve TSDocs of order workflows (#10983) 2025-01-15 19:46:31 +02:00
Shahed Nasser
8c2b4a5951 chore(core-flows,types): improve TSDocs of product workflows (#10966) 2025-01-15 19:46:03 +02:00
Carlos R. L. Rodrigues
c5a207144e fix(core-flows): missing variable of when condition (#10958) 2025-01-15 12:38:18 -05:00
Kasper Fabricius Kristensen
4bc3f5b845 feat(medusa,framework,cli,admin-bundler): Integrate admin extensions into medusa build:plugin (#10941)
**What**
Calls the `plugin` script from `@medusajs/admin-bundler` as part of `medusa plugin:build`.
2025-01-13 20:48:55 +00:00
Riqwan Thamir
1758bfb8d0 fix(dashboard, core-flows): improvements to order page on canceled orders (#10888)
what:

- Remove pending payment for canceled orders
- Hide unfulfilled items for canceled orders
- Disable non refundable payments from being refunded
- Populate refund created_by
- Disable order edit when canceled
- Fix bug https://github.com/medusajs/medusa/issues/10852

RESOLVES CMRC-842
2025-01-13 16:51:38 +00:00
Riqwan Thamir
7232a8a930 fix(core-flows): return refunded when all captured payments have been refunded (#10923)
what:

- returns refunded when all captured payments have been refunded
2025-01-13 16:25:39 +00:00
Shahed Nasser
60dc8f69c7 chore(core-flows,types): improve tsdocs of workflows [1] (#10940) 2025-01-13 18:09:55 +02:00
Adrien de Peretti
b7a3759824 feat(cli): Add plugin:publish and plugin:add commands support (#10938)
RESOLVES FRMW-2864
RESOLVES FRMW-2868

**What**
Add support for the following cli commands:
- `plugin:publish`
- `plugin:add`
2025-01-13 14:24:49 +00:00
Adrien de Peretti
c895ed8013 feat: Scaffold plugin in create-medusa-app (#10908)
RESOLVES FRMW-2862

**What**
This PR enable the `create-medusa-app` CLI to accept a new `--plugin` option to scaffold a plugin. This is complementary to all the plugin commands being created/adjusted separately to that pr.
Also, this pr brings a little refactoring around resource scaffolding, the idea was to contain the refactoring to a little area and not expend it to the entire create-medusa-app package to not disrupt and expand the scope for which the purpose was to introduce the plugin scaffolding capabilities

**Addition**
- medusa project will get their package.json name changed to the project name
- Remove build step from medusa project creation

**Plugin flow**

- in the plugin
  - `npx create-medsa-app --plugin`
  - `yarn dev`
- in the project
  - `yalc add plugin-name`
  - `yarn dev`

Any changes on the plugin will publish, push in the local registry which will fire the hot reload of the app and include the new changes from the plugin
2025-01-13 14:18:42 +00:00
Harminder Virk
b0f581cc7c feat: add plugin build command (#10935)
Fixes: FRMW-2863

Adds the `plugin:build` command that is used to compile the source code of a plugin for publishing it to a package registry. The command is similar to the `build` command, except it does not copy the `package.json` and the `lock` files to the build output
2025-01-13 13:33:54 +00:00
Harminder Virk
69e2a6d695 Feat/plugin develop (#10926)
Fixes: FRMW-2865

In this PR we add support for developing a plugin in watch mode. During the file change, we re-compile the source code (incrementally), publishes the package, and updates the installations of the plugin. 

We are using `yalc` under the hood and it must be installed as a dev dependency in the plugin project and the main Medusa app.
2025-01-13 13:08:02 +00:00
Rahul R.
ecf73780e0 [Fix] Update Repository Directory Paths for All Packages (#10910)
This PR updates the `repository.directory` field in the `package.json` files for packages located within the `modules` folder.
2025-01-13 12:49:50 +01:00
Kasper Fabricius Kristensen
1ba2fadf22 feat(admin-bundler,admin-vite-plugin,medusa): Add support for loading Admin Extensions from plugins (#10869)
Should not be merged before https://github.com/medusajs/medusa/pull/10895

**What**
- Introduces a new `plugin` command to `admin-bundler`, currently not used anywhere but will be called from `medusa build:plugin`
- Discovers plugins with extensions and add passes the to `admin-vite-plugin`.
- Updates `admin-vite-plugin` so its able to read built admin extensions.

Resolves CMRC-830, CMRC-839
2025-01-13 10:45:33 +00:00
Shahed Nasser
db338e4b5a chore(core-flows,types): add tsdocs for create cart workflow (#10928) 2025-01-13 11:23:58 +02:00
Kasper Fabricius Kristensen
bc22b81cdf feat(inventory,dashboard,types,core-flows,js-sdk,medusa): Improve inventory UX (#10630)
* feat(dashboard): Add UI for bulk editing inventory stock (#10556)

* progress

* cleanup types

* add changeset

* fix 0 values

* format schema

* add delete event and allow copy/pasting enabled for some fields

* add response types

* add tests

* work on fixing setValue behaviour

* cleanup toggle logic

* add loading state

* format schema

* add support for bidirectional actions in DataGrid and update Checkbox and RadioGroup

* update lock

* lint

* fix 404

* address feedback

* update cursor on bidirectional select
2025-01-12 19:07:14 -05:00
Carlos R. L. Rodrigues
01acf9e700 fix(orchestration): avoid retry when finished (#10913) 2025-01-10 13:12:08 -03:00
Harminder Virk
428fce5313 chore: move build utilities to Compiler class (#10904)
Fixes: FRMW-2866
2025-01-10 11:30:48 +00:00
Harminder Virk
c1930bd656 feat: Merge plugin modules (#10895)
Fixes: FRMW-2858

This PR merge the modules exported by the plugins with the modules defined within the user config. As a result, all modules get loaded without changing the internals of the loader.

However, you cannot disable the module of a plugin by re-adding it to the `modules` array. That is something we should handle separately. 

We've added the breaking change label because of the following fix:
We did broke the ability to completely disable modules in the past pr's, in this pr we re add the ability to disable a module and that this modules does not get loaded at all. ([here](6dd164f783))

Co-authored-by: Adrien de Peretti <25098370+adrien2p@users.noreply.github.com>
2025-01-10 10:02:09 +00:00
Shahed Nasser
ff725090bb fix(types): add missing inventory_items to input of createProductsWorkflow (#10892)
The `createProductsWorkflow` allows passing an `inventory_items` property to assign the inventory items of a product variant, and we even pass it in the `/admin/products` API route when creating a variant, but the workflow's input type doesn't include that property. This PR adds it to the workflow's input type.
2025-01-10 01:23:29 +00:00
Adrien de Peretti
c490e08142 fix(modules): Fix miss leading provider resolution error (#10900)
FIXES SUP-560

**What**
Currently, no matter the error when looking for a provider to exists in the container we are throwing a normalized error stating that the provider does not exists in the container. The issue is that the first initialization of the provider occurs the first time we resolve it, and the error can be that the provider failed to be instanciated for any reason. 

In this pr, we are explicitly checking for the error to be an awilix resolution error to throw the classic error and otherwise we provide the issue why the provider failed to be resolved.
2025-01-10 01:16:33 +00:00
Riqwan Thamir
3fec01ab49 fix(pricing): add null conditions for deleted at during price calculations (#10896) 2025-01-09 15:32:57 +01:00
Sze-Chi Wang
6747a1564b fix: event-bus-redis processor execute event before subscriber are loaded (#10823)
* fix(worker): run worker after application start

* test(event-bus-redis): worker should initiate with autorun:false

---------

Co-authored-by: Suki Wang <suki.wang@shoplineapp.com>
Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
2025-01-09 14:32:15 +01:00
Kasper Fabricius Kristensen
a625bce7b0 fix(pricing): PriceLists of type Sale should not override lower prices (#10882)
Resolves CMRC-840
2025-01-09 10:07:15 +00:00
Harminder Virk
28febfc643 feat: remove dead code and refactor the logic of resolving plugins (#10874) 2025-01-09 14:52:10 +05:30
Harminder Virk
67782350a9 feat: add default retry strategy for redis (#10880)
Fixes: FRMW-2861
2025-01-09 05:26:08 +00:00
Adrien de Peretti
899b1fba4a chore(medusa): Add handler path to the http tracing to be able to group by (#10835)
RESOLVES FRMW-2835

In this PR, we trace HTTP requests using the route pattern and not the request URL. This allows us to aggregate all HTTP requests under a single route.

In terms of implementation, we have to self find the route for a given request, since there is no API in express to do the same and we begin tracing even before the request is handed over to Express.

Since, the route matching happens via RegExp matches, we ensure that this does not add much performance overhead. The matching takes between 0.8ms-1.5ms for various different routes

Co-authored-by: Harminder Virk <1706381+thetutlage@users.noreply.github.com>
2025-01-07 13:16:20 +00:00
olivermrbl
3919b26eb6 chore: Version packages 2025-01-07 13:31:40 +01:00
Frane Polić
37aa804620 fix(dashboard): cancel order notifications (#10858)
* fix: cancel order notifications

* fix: label
2025-01-07 13:01:41 +01:00
Harminder Virk
e40878d9f3 chore: rename remote-query-entry-points.d.ts to query-entry-points.d.ts (#10831) 2025-01-07 16:44:49 +05:30
Shahed Nasser
632600ee11 fix(create-medusa-app): add default storefront url to auth CORS (#10853)
* fix(create-medusa-app): add default storefront url to auth CORS

* add docs cors to store / admin
2025-01-07 11:01:37 +02:00