Commit Graph

936 Commits

Author SHA1 Message Date
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
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
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
olivermrbl
3919b26eb6 chore: Version packages 2025-01-07 13:31:40 +01:00
Shahed Nasser
a989c50051 chore: fix version number in tsdocs (#10856) 2025-01-07 10:52:44 +02:00
Frane Polić
16b0672f8a feat(core-flows,fulfillment, fulfillment-manual, types): make fulfillment typings more specific (#10677)
**What**
- attempt to add more specific type definitions around fulfillment provider APIs

---

CLOSES CMRC-814
CLOSES CMRC-816
CLOSES CMRC-817
2025-01-07 08:08:45 +00:00
Riqwan Thamir
47594192b7 feat(dashboard,core-flows,types,utils,medusa): Order cancelations will refund payments (#10667)
* feat(order, types): Add Credit Line to order module

* chore: add action to inject credit lines

* WIP

* chore: add fixes + observe

* chore: fix balances

* chore: add canceled badge

* chore: fix i18n schema

* chore: remove redunddant query

* chore: add changeset

* chore: add credit lines for all cancel cases

* chore: add accounting total

* chore: address review & cleanup
2025-01-07 07:56:28 +01:00
Riqwan Thamir
99a06102a2 fix(stock-location,core-flows,types): updates existing address when updating stock location (#10832)
* fix(stock-location,core-flows,types): updates existing address when updating stock location address

* chore: use hasOne instead of hasMany
2025-01-07 07:55:28 +01:00
Stevche Radevski
fde73dbfae feat(auth-google,auth-github): Allow passing a custom callbackUrl to … (#10829)
* feat(auth-google,auth-github): Allow passing a custom callbackUrl to oauth providers

* feat: Add state management in auth providers

* chore: Changes based on PR review
2025-01-06 17:33:29 +01:00
Shahed Nasser
c440068d49 chore: small tsdoc changes for remoteLink and remoteQueryConfig (#10837) 2025-01-06 14:01:46 +02:00
Anuchit
79c87c09de fix(core-flow): invalid update quantity in update line item in cart workflow (#10405)
* fix: invalid update quantity in update line item in cart workflow

* test: update cart workflow test

* fix: rm shallow copy in transform
2025-01-05 14:39:29 +01:00
Adrien de Peretti
7d8f6cf39f fix(): Workflow cancellation + gracefully handle non serializable state (#10674)
FIXES FRMW-2852

**What**
A workflow distributed transaction expect any response and error to be serializable. When it is not the case, the distributed transaction might fail during the save checkpoint that occurs for async steps. This can lead to unexpected behaviour.

With this pr, we introduce a way to handle non serialazable object in a more sustainable manner, this means the following:

- If a workflow throw any non serialazable error (e.g AWS error that contains full IncomingMessage object that related to network communication, think of req/res) then we identify that this object is not serialzable and we clean up the object to make it serializable without loosing the main information, add a new error to the workflow to informed of this issue and can be handled by the user.
- If a response is not serializable (which should not happen at this point because it is handled before by the value resolver), in that case, we wont be able to reuse that response to continue the workflow which means that the workflow is in a non runnable state. In that case we throw a specific error stating that a non serializable context is being provided

**second what**
This pr refactor the `runAsStep` to add better support for workflow cancelation, especially async ones
2025-01-05 13:30:17 +00:00
Harminder Virk
ecc09fd77d feat: generate modules mappings at runtime (#10791) 2025-01-03 15:49:47 +05:30
Harminder Virk
5e9d86d75d feat: deprecate remoteQueryConfig in favor of queryConfig (#10773)
Fixes: FRMW-2783
2025-01-03 08:46:23 +00:00
Ranjith kumar
1ef3e4b8de docs: update fulfillment provider module docs to reflect CalculatedShippingOptionPrice (#10778)
The return value below the example for the `calculatePrice` method is shown correctly as `CalculatedShippingOptionPrice` but the example is not updated in the guide "How to Create a Fulfillment Provider Module"

This PR updates the example in the guide and the TS doc
2024-12-31 11:44:17 +00:00
Harminder Virk
bbf790ea44 feat: deprecate remote link (#10768)
Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
2024-12-30 14:57:43 +05:30
Shahed Nasser
ce51c36ecf chore: improve payment provider tsdocs + generate reference (#10742) 2024-12-26 14:11:52 +02:00
Shahed Nasser
688e1e60a5 chore(js-sdk): add tags to js-sdk (#10739) 2024-12-26 11:18:02 +02:00
Stevche Radevski
c8f9938865 feat(medusa): Add health endpoint for all running modes of medusa (#10737) 2024-12-26 13:53:12 +08:00
Shahed Nasser
699bb6dc24 fix(core-flows): export updateTaxRegionsStep (#10732)
Export `updateTaxRegionsStep` to ensure it's included in generated references
2024-12-25 09:08:09 +00:00
Shahed Nasser
13ddf27c68 fix(medusa,types,js-sdk): fix request query parameter types for store product routes (#10707)
* fix(medusa,types): fix request query parameter types for store product routes

* fix test errors
2024-12-23 18:10:08 +02:00
Harminder Virk
0559d54c18 fix: pluralization of words ending in y, where y follows a vowel (#10697)
Fixes: FRMW-2851
2024-12-23 13:07:27 +00:00
olivermrbl
348f866ffe chore: Version packages 2024-12-20 11:25:36 +01:00
Frane Polić
fc321e96ce fix(core-flows): select stock locations for reservation from correct SC (#10661)
* fix: add stock location for reservations only if related to correct SC

* fix: update spec

* fix: wrong SC id get in OE flow

* fix: ensure test case has multiple SC and SLs
2024-12-20 09:25:19 +01:00
Adrien de Peretti
100da64242 chore(fulfillment, utils): Migrate module to DML (#10617)
**What**
- Allow to provide `foreignKeyName` option for hasOne and belongsTo relationships
  - `model.hasOne(() => OtherEntity, { foreignKey: true, foreignKeyName: 'other_entity_something_id' })`
  - The above will also output a generated type that takes into consideration the custom fk name 🔽 
- Update types to account for defined custom foreign key name
- Fix joiner config linkable generation to account for custom linkable keys that provide a public API for their model but are not part of the list of the models included in the MedusaService
  - This was supposed to be handled correctly but the implementation was not considering that custom linkable keys could reference models not part of the one provided to medusa service
- Migrate fulfillment module to DML
- Fix has one with fk behaviour and hooks (the relation should be assigned but not the fk)
- Fix has one belongsTo hooks (the relation should be assigned but not the fk)
- Fix hasOneWithFk and belongsTo non persisted fk to be selectable
- Allow to define `belongsTo` without other side definition for `ManyToOne` with no counter part defined
  - Meaning that if a user defined `belongsTo` on one side andnot mapped by and no counter part on the other entity it will be considered as a `ManyToOne`
- `orphanRemoval` on `OneToOne` have been removed, this means that when assigning a new object relation to an entity, the previous one gets deconected but not deleted automatically. This prevent removing data un volountarely

**NOTE**
As per our convention here are some information to keep in mind

**HasOne <> BelongsTo**
Define `OneToOne`, The foreign key is owned by the belongs to and the relation needs to be provided to cascade if wanted

**HasMany <> BelongsTo**
Define `OneToMane` <> `ManyToOne`, the foreign key is owned by the many to one and for those relation no cascade will be performed, the foreign key must be provided. For the `HasMany` the cascade is available

**HasOne (with FK)**
Will act similarly to belongs to with **HasOne <> BelongsTo**

Co-authored-by: Carlos R. L. Rodrigues <37986729+carlos-r-l-rodrigues@users.noreply.github.com>
2024-12-19 16:40:11 +00:00
Frane Polić
1118e35924 feat(core-flows): pass fields variant details when creating fulfillment (#10665) 2024-12-19 16:39:04 +01:00
Riqwan Thamir
5d1098ceb9 fix(core-flows): refresh payment collections upon shipping changes (#10673)
* fix(core-flows): refresh payment collections upon shipping changes

* chore: fix spec
2024-12-19 16:31:17 +01:00
Riqwan Thamir
3f4d574748 feat(order, types): Add Credit Line to order module (#10636)
* feat(order, types): Add Credit Line to order module

* chore: add action to inject credit lines
2024-12-19 10:36:59 +01:00
Shahed Nasser
fec24aa7eb chore: improve tsdocs of fulfillment provider (#10649)
* initial changes

* small changes
2024-12-19 10:04:12 +02:00
Frane Polić
3dba551ad2 fix(core-flows): data passed to to fulfillment provider context (#10660)
* fix: cart data passed to context, from location in validation

* refactor: extract common fields to a const
2024-12-18 21:23:06 +01:00
Shahed Nasser
9d85e663b8 fix(core-flows): use useQueryGraphStep instead of useQueryStep (#10643)
Replace usage of `useQueryStep` with `useGraphQueryStep` and remove `useQueryStep`, as it's not exported by the package and seems to be a duplicate of `useGraphQueryStep`
2024-12-18 17:18:51 +00:00
Adrien de Peretti
048620884b chore(types): Keep intelisense while being more loosen (#10657)
**What**
Keep the autocompletion for the fields API in Query APIs while being more flexible in order to prevent limitation from our depth limit but also to be more flexible when assigning string[] coming from the API for example.
2024-12-18 17:12:31 +00:00
Oli Juhl
c9b8db04c1 feat: Custom line items (#10408)
* feat: Custom line items

* fix tests

* fix migration

* Allow custom items in update line item workflow

* throw if line item doesn't have a price

* minor things

* wip

* fix flows

* fix test

* add default

* add to type
2024-12-18 12:53:57 +01:00
Frane Polić
bde4b82194 feat(core-flows,dashboard,js-sdk,medusa,types): support Fulfillment Options (#10622)
**What**
- add a list point for fetching fulfillment options for a provider
- add FO support on SO create & update on dashboard
- pass `cart` and `stockLocation` to `validateFufillmentData` context

---

CLOSES CMRC-789
CLOSES CMRC-790
2024-12-18 09:16:26 +00:00
Shahed Nasser
1232a43fce fix(core-flows): export getItemTaxLinesStep (#10640) 2024-12-17 19:31:55 +02:00
Nathan John
2ad08c4c44 Add FilterableRefundReason filter by description and label (#10606) 2024-12-17 15:54:06 +00:00
Riqwan Thamir
632c340bf5 chore(utils): add comments + cleanup util functions (#10628)
remnants from https://github.com/medusajs/medusa/pull/10579
2024-12-17 14:22:33 +00:00