Commit Graph

4912 Commits

Author SHA1 Message Date
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
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
3253e19b36 chore(ui): general updates and fixes to TSDocs and types (#10753) 2025-01-06 14:22:27 +02:00
Shahed Nasser
c440068d49 chore: small tsdoc changes for remoteLink and remoteQueryConfig (#10837) 2025-01-06 14:01:46 +02:00
Riqwan Thamir
f7ffa3540f fix(promotion): don't evaluate rule condition if conditions to evaluate is empty (#10795) 2025-01-06 09:31:58 +01: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
Shahed Nasser
152a94e1e1 feat(create-medusa-app): improve by adding depth to clone commands (#10812)
Improve command by passing `--depth 1` to decrease download size + improve for slow speed.

Closes TRI-742
2025-01-05 13:24:57 +00:00
Harminder Virk
988931a551 Fix/product variants filter (#10808)
Fixes: FRMW-2854
2025-01-03 14:00:02 +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
Riqwan Thamir
6d989bc8cd fix(pricing): pricing context calculations only takes into account existing rule attributes (#10771)
* fix(pricing): pricing context calculations only takes into account existing rule attributes

* chore: add changeset
2025-01-02 10:17:09 +01: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
1e6d56bc18 feat(create-medusa-app): allow passing project name on command line (#10755)
Allow passing the project name on the command line:

```bash
npx create-medusa-app@latest my-project
```
2024-12-29 09:41:15 +00:00
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
Ranjith kumar
83925f5c7a fix(medusa-cli): fix medusa develop command crashing on file change on windows (#10717)
* fix(medusa-cli): fix medusa develop command crashing on file change on windows

* chore: update changeset to patch
2024-12-24 20:00:46 +08: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
Shahed Nasser
3a0c69fbe0 fix(fulfillment): export schema types (#10700)
Export `ServiceZoneSchema` and `GeoZoneSchema` so that we can infer types correctly in references
2024-12-23 12:58:43 +00:00
github-actions[bot]
198fa53120 chore(docs): Updated API Reference (automated) (#10685)
Automated changes by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action

Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
Co-authored-by: Shahed Nasser <27354907+shahednasser@users.noreply.github.com>
2024-12-23 08:35:12 +00:00
Kasper Fabricius Kristensen
f7aaf2c8bb chore(ui,icons): Add React 19/19-rc to peer dependencies (#10458)
Resolves SUP-478
2024-12-20 12:18:30 +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
d08b71f9b8 fix(product): updating collections with products fix (#10668) 2024-12-19 16:31:45 +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
Eugene Pro
3efd25d06d feat(dashboard): ability to locate new admin route under existing route (#10587)
This PR add ability to locate new admin route under existing route in sidebar.

For example, new route Brands
![image](https://github.com/user-attachments/assets/1b297fb0-296c-4e94-a4cb-f84f4c676c53)
![image](https://github.com/user-attachments/assets/80336909-1c0a-49c9-b8e1-3b1137ae2e48)

https://github.com/user-attachments/assets/b46b1813-e92e-4b67-84a1-84660023ac7c
2024-12-19 12:23:21 +00: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
9133957a94 fix(notification): Only use enabled providers for notis (#10659) 2024-12-18 13:59:12 +01:00
Frane Polić
c7008bb569 fix: order details status (#10650) 2024-12-18 12:56:18 +01: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
Oli Juhl
f3eca7734e fix(medusa): Missing metadata field on order (#10651) 2024-12-18 10:09:35 +01:00
Shahed Nasser
570c85538b chore: fix redocly circular dependencies (#10642) 2024-12-17 19:45:57 +02:00