Commit Graph

974 Commits

Author SHA1 Message Date
Adrien de Peretti
9321920227 fix: Medusa package version should use ~ instead of ^ (#11077)
RESOLVES FRMW-2859
2025-01-22 15:15:30 +00:00
Harminder Virk
e53b8b0a97 fix: Flaky behavior of Yalc (#11084) 2025-01-22 14:26:07 +05:30
Shahed Nasser
2d0e50624f fix(core-flows): change some types to interfaces (#11061) 2025-01-22 10:29:31 +02:00
Adrien de Peretti
da3906efa4 fix: Unique constraint should account for soft deleted records (#11048)
FIXES FRMW-2878

**What**
Currently, the `one-to-one` unique constraints does not account for deleted record. This prevents from inserting a new record wth the same fk if another one is deleted.

**Caveat**
`hasOne` with FK option is meant to be a special case, for example a many to one - one to many without defining the other side of the relation. In that case we don't handle this behaviour and keep it as it is
2025-01-22 07:42:06 +00:00
Adrien de Peretti
ecc8efcb04 fix(event): Subscriber ID miss usage (#11047)
PARTIALLY RESOLVES FRMW-2876

**What**
Fix wrong usage of the `subscriberId` in the event bus. It happens that the subscriber id coming from the context was not used at all. This issue lead to duplicated event subscriber with the same subscriber id, it also prevent unsubscribing from event since rand id will be assigned.

**NOTE**
This PR does not handle overide strategy for subscribers with the same id. this still needs to be discussed
2025-01-22 07:40:31 +00:00
Carlos R. L. Rodrigues
cc73802ab3 chore(order): dml (#10292)
* ../../core/types/src/dml/index.ts

* ../../core/types/src/dml/index.ts

* fix: relationships mapping

* handle nullable foreign keys types

* handle nullable foreign keys types

* handle nullable foreign keys types

* continue to update product category repository

* fix all product category repositories issues

* fix product category service types

* fix product module service types

* fix product module service types

* fix repository template type

* refactor: use a singleton DMLToMikroORM factory instance

Since the MikroORM MetadataStorage is global, we will also have to turn DML
to MikroORM entities conversion use a global bucket as well

* refactor: update product module to use DML in tests

* wip: tests

* WIP product linkable fixes

* continue type fixing and start test fixing

* test: fix more tests

* fix repository

* fix pivot table computaion + fix mikro orm repository

* fix many to many management and configuration

* fix many to many management and configuration

* fix many to many management and configuration

* update product tag relation configuration

* Introduce experimental dml hooks to fix some issues with categories

* more fixes

* fix product tests

* add missing id prefixes

* fix product category handle management

* test: fix more failing tests

* test: make it all green

* test: fix breaking tests

* fix: build issues

* fix: build issues

* fix: more breaking tests

* refactor: fix issues after merge

* refactor: fix issues after merge

* refactor: surpress types error

* test: fix DML failing tests

* improve many to many inference + tests

* Wip fix columns from product entity

* remove product model before create hook and manage handle validation and transformation at the service level

* test: fix breaking unit tests

* fix: product module service to not update handle on product update

* fix define link and joiner config

* test: fix joiner config test

* test: fix joiner config test

* fix joiner config primary keys

* Fix joiner config builder

* Fix joiner config builder

* test: remove only modifier from test

* refactor: remove hooks usage from product collection

* refactor: remove hooks usage from product-option

* refactor: remove hooks usage for computing category handle

* refactor: remove hooks usage from productCategory model

* refactor: remove hooks from DML

* refactor: remove cruft

* order dml

* cleanup

* re add foerign key indexes

* wip

* chore: remove unused types

* wip

* changes

* rm raw

* autoincrement

* wip

* rel

* refactor: cleanup

* migration and models configuration adjustments

* cleanup

* number searchable

* fix random ordering

* fix

* test: fix product-category tests

* test: update breaking DML tests

* test: array assertion to not care about ordering

* fix: temporarily apply id ordering for products

* types

* wip

* WIP type improvements

* update order models

* partially fix types temporarely

* rel

* fix: recursive type issue

* improve type inference breaks

* improve type inference breaks

* update models

* rm nullable

* default value

* repository

* update default value handling

* fix unit tests

* WIP

* toMikroORM

* fix relations

* cascades

* fix

* experimental dml hooks

* rm migration

* serial

* nullable autoincrement

* fix model

* model changes

* fix one to one DML

* order test

* fix addresses

* fix unit tests

* Re align dml entity name inference

* update model table name config

* update model table name config

* revert

* update return relation

* WIP

* hasOne

* models

* fix

* model

* initial commit

* cart service

* order module

* utils unit test

* index engine

* changeset

* merge

* fix hasOne with fk

* update

* free text filter per entity

* tests

* prod category

* property string many to many

* fix big number

* link modules migration set names

* merge

* shipping option rules

* serializer

* unit test

* fix test mikro orm init

* fix test mikro orm init

* Maintain merge object properties

* fix test mikro orm init

* prevent unit test from connecting to db

* wip

* fix test

* fix test

* link test

* schema

* models

* auto increment

* hook

* model hooks

* order

* wip

* orm version

* request return field

* fix return configuration on order model

* workflows

* core flows

* unit test

* test

* base repo

* test

* base repo

* test fix

* inventory move

* locking inventory

* test

* free text fix

* rm timeout mock

* migrate fulfillment values

* v6.4.3

* cleanup

* link-modules update sql

* revert test

* remove fake timers

---------

Co-authored-by: adrien2p <adrien.deperetti@gmail.com>
Co-authored-by: Harminder Virk <virk.officials@gmail.com>
Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
2025-01-21 08:04:47 -05:00
Stevche Radevski
05c8a67d8e feat: Add support for creating payment methods to payment module (#11063)
CLOSES CLO-407
2025-01-21 11:31:44 +00:00
Adrien de Peretti
13fe2f6776 fix(framework): migration scripts regexp (#11072)
FIXES FRMW-2879

**What**
The exclusion regexp was broken and instead use the ignore options of the glob sync function to properly ignore definition files
2025-01-21 09:34:57 +00:00
Kasper Fabricius Kristensen
d4e042e9ad fix(dashboard,js-sdk,types): Remove redundant body for markAsDelivered (#10964)
Resolves CMRC-623
2025-01-20 17:17:48 +00:00
Shahed Nasser
45b47bf813 fix(medusa): use correct request and response types for batch location levels route (#11055)
Use HTTP types for request / response types of the new batch location levels route
2025-01-20 17:03:07 +00:00
olivermrbl
57e9a7a5bf chore: Version packages 2025-01-20 07:41:15 -05:00
Harminder Virk
171088b47a fix: missing dependencies in the framework package (#11049)
In the framework package we are directly importing many uninstalled dependencies. The issue does not occur for transitive dependencies. However, the `glob` package is not a transitive dependency of any production dependency and hence it fails.

Fixes: #11044
Fixes: FRMW-2877
2025-01-20 11:51:44 +00:00
Shahed Nasser
e4487341b6 chore(core-flows): general fixes to core-flows TSDocs (#11046) 2025-01-20 11:11:37 +02:00
Frane Polić
c1385c7002 fix(core-flows): cart validate sales channel (#11024) 2025-01-18 10:48:58 -05:00
Shahed Nasser
f15fb4d4fa chore(framework): update the TSDocs for a plugin in the medusa config (#10991)
* chore(framework): update the TSDocs for a plugin in the medusa config

* change version
2025-01-17 17:41:05 +02:00
olivermrbl
efe141f54b chore: Version packages 2025-01-17 10:29:04 -05:00
Shahed Nasser
544580e6a5 chore(core-flows,types): improve TSDocs for remaining workflows (#11021) 2025-01-17 16:13:00 +02:00
Shahed Nasser
c1cbd548e2 chore(core-flows, types): improve TSDocs of tax and region related workflows (#11018) 2025-01-17 15:17:32 +02:00
Shahed Nasser
5582bd2038 chore(core-flows,types): improve TSDocs of user-related workflows (#11017) 2025-01-17 13:41:02 +02:00
Shahed Nasser
bae3ddcde0 chore(core-flows,types): update TSDocs related to promotion workflows (#11014) 2025-01-17 13:01:11 +02:00
Shahed Nasser
7be47354e1 fix(core-flows,medusa): use deleteRefundReasonsWorkflow in delete /admin/refund-reasons/:id (#11012) 2025-01-17 11:22:10 +02:00
Shahed Nasser
c09d7e5ba8 chore(core-flows,types): improve TSDocs of inventory-related workflows (#11013) 2025-01-17 11:07:12 +02: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
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
Harminder Virk
c75678d6d4 feat: add support for loading admin extensions from the source (#10975) 2025-01-16 11:06:56 +05:30
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
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
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
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