Commit Graph

4937 Commits

Author SHA1 Message Date
Adrien de Peretti
27f4f0d724 fix(fulfillment): Wrong type usage (#6914)
**What**
Fix the types used in the fulfillment module service interface
2024-04-02 16:22:57 +00:00
Kasper Fabricius Kristensen
982fb44cde fix(dashboard): Combobox should not disable body after being closed (#6909)
**What**
- Fixes an issue where opening a Combobox inside a modal, and then closing the modal would result in the body preserving the `pointer-events: none;` style.
2024-04-02 14:31:27 +00:00
Adrien de Peretti
82a176e30e chore(medusa-test-utils):Handle errors gracefully (#6901)
**What**
- Better error handling and error message
- update deps management and dynamic import/require
- Pass a new flag to the modules loaders for the module loaders to be able to act depending on it. In that case, the module can determine what should be run or not. e.g in the workflow engine redis, when we are only partially loading the module, we do not want to set the Distributed transaction storage
2024-04-02 14:10:17 +00:00
Oli Juhl
7895ff3849 feat: add sales channel management (#6761)
Add V2 sales channel management to admin

`@medusajs/medusa`
- Add `POST /admin/sales-channels/:id/products/batch/remove`
- Refactor cross-module filter middleware to comply with the latest convention

`@medusajs/admin-next`
- Add all sales channel routes
- Moves the following sales channel UI to shared components in `modules/sales-channel`:
  - sales-channel-list
  - sales-channel-edit
  - sales-channel-details
    - sales-channel-general-section
  - sales-channel-create

The sales-channel-product-section is not shared because the API in V2 will change.
The sales-channel-add-products component is not shared because the API in V2 will change.

`@medusajs/core-flows`
- Add `detachProductsFromSalesChannelsStep`
- Add `removeProductsFromSalesChannelsWorkflow`
2024-04-02 13:38:33 +00:00
Stevche Radevski
3dee91426e feat: Correctly define all product module models and SQL migration script (#6906)
The only thing remaining is modifying `upsertWithReplace` to handle many-to-many constraints correctly and not cascade updates to them. This is something that we should do separately though.
2024-04-02 12:27:12 +00:00
github-actions[bot]
7fe164bc1d chore(docs): Generated References (#6904)
Generated the following references:
- `inventory`
- `js_client`
- `medusa`
- `medusa_config`
- `medusa_react`
- `modules`
- `payment`
- `pricing`
- `product`
- `services`
- `stock_location`
- `tax_calculation`
- `types`
- `workflows`

Co-authored-by: Shahed Nasser <27354907+shahednasser@users.noreply.github.com>
2024-04-02 10:06:06 +00:00
github-actions[bot]
85e5478873 chore(docs): Updated API Reference (#6831)
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-04-02 09:47:04 +00:00
Raiyan Sarker
9d466717f4 docs(plugin): paypal integration missing createOrder callback (#6401)
This PR adds missing information in paypal plugin docs which is crucial to its use. Previously, docs didn't mention about createOrder callback that is required by PayPal sdk to connect with backend for details like currency and amount to be charged. Medusa backend responds with required id for the PayPal sdk to use. Related to https://github.com/medusajs/nextjs-starter-medusa/issues/260#issuecomment-1944157985

Co-authored-by: Shahed Nasser <27354907+shahednasser@users.noreply.github.com>
2024-04-02 08:10:35 +00:00
Stevche Radevski
b3ce13d61e fix: Fixes to product module and improving tests (#6898) 2024-04-02 07:13:46 +00:00
Kasper Fabricius Kristensen
b2763647f7 feat(dashboard): Variant edit form (#6870)
**What**
- Adds form to edit variant details.
- If stock and inventory modules are installed we omit inputs for stock and inventory as they should be managed in a separate form in that case. (Still a bit unsure about this, but its what we have in the current admin)
2024-04-01 16:38:49 +00:00
Shahed Nasser
8363dbec4f chore: update TSDocs of the Product Module (#6897)
Updated TSDocs of the Product Module.
2024-04-01 15:46:40 +00:00
Shahed Nasser
1ea0778264 chore: added TSDocs to auth_cors configuration (#6895)
Added description of `auth_cors` configuration as TSDoc comment
2024-04-01 15:21:23 +00:00
Sebastian Rindom
2e914a5fc5 fix: ensure that shutdown works in loaderOnly mode (#6893) 2024-04-01 13:56:42 +00:00
github-actions[bot]
68aa0971a2 chore(docs): Generated References (#6896)
Generated the following references:
- `inventory`
- `js_client`
- `medusa`
- `medusa_config`
- `medusa_react`
- `modules`
- `payment`
- `pricing`
- `product`
- `services`
- `stock_location`
- `tax_calculation`
- `types`
- `workflows`

Co-authored-by: Shahed Nasser <27354907+shahednasser@users.noreply.github.com>
2024-04-01 13:35:12 +00:00
Oli Juhl
9fdced2c27 feat: Admin V2 users domain (#6844) 2024-04-01 15:03:48 +02:00
Stevche Radevski
585818eaf8 feat: Pricing update and refactor product API tests to not rely on internals (#6892)
This PR achieves the following
- Remove dependency on internals for seeding the tests (more work left, but major work done)
- Adds the workflow for updating variant's price

I will do a follow-up PR to further clean up the tests and remove all internal dependencies
2024-04-01 09:33:52 +00:00
Shahed Nasser
fe1d3a4a78 feat(create-medusa-app): Add a --verbose option. (#6027)
## What

Adds a `--verbose` option that shows the output of all underlying processes in real-time.

## Why

This is helpful for testing and debugging issues, especially issues that the community runs into. We can ask community members to pass the `--verbose` option and provide us with the outputted logs if they face problems.

## Caveats

When installing the Next.js starter then terminating the process, the main and child processes don't receive the abort signal as it seems to occur in the child process. This leads to the command continuing but then running into an error in the next step.

As this option is only used for debugging, I don't think it's a big issue.

## Testing

Run the `create-medusa-app` snapshot below with `--verbose` option. Or, change to the `packages/create-medusa-app` directory and run:

```bash
yarn dev --directory-path ~/some-dir --verbose
```

> The `--directory-path` option in this case is necessary as installing the medusa backend in the current `packages/create-medusa-app` directory leads to errors related to yarn workspaces.
2024-04-01 09:13:44 +00:00
Frane Polić
e58e81fd25 feat(dashboard): admin 3.0 order refund form (#6850) 2024-04-01 10:55:42 +02:00
Stevche Radevski
1a48fe0282 feat: Add v2 product types endpoints (#6880)
Also adjusts the product type module APIs to follow the conventions
2024-03-29 19:27:10 +00:00
Oli Juhl
1bcb13f892 feat: Remove sales channels from pub keys (#6876)
**What**
- Add workflow + step for detaching sales channels from pub API keys
- Tweak linking error message to be more helpful
- Add `removeRemoteLink` step to delete API key workflow
2024-03-29 15:01:10 +00:00
Adrien de Peretti
8fd1488938 chore: medusa shutdown (#6865)
* chore: medusa shutdown

* continue

* use shutdown

* on application shutdown

* consume shutdown

* more connection close

* more cleanup

* more cleanup

* update lock

* revert package

* graceful shutdown

* Create yellow-apples-attack.md

* graceful shutdown

* graceful shutdown

---------

Co-authored-by: Sebastian Rindom <skrindom@gmail.com>
Co-authored-by: Riqwan Thamir <rmthamir@gmail.com>
2024-03-29 09:22:29 -03:00
Riqwan Thamir
0c0b425de7 feat(medusa-react,medusa,types,dashboard): added empty state + table for promotions list page (#6827)
what:

- adds empty state for promotions list page
- lists all promotions with pagination

<img width="1663" alt="Screenshot 2024-03-26 at 14 19 27" src="https://github.com/medusajs/medusa/assets/5105988/ed0d5c65-d003-40f5-b899-540970d892f5">


<img width="1664" alt="Screenshot 2024-03-27 at 20 46 17" src="https://github.com/medusajs/medusa/assets/5105988/4aa40f09-fe3f-4f34-af7a-f5c183254c76">
2024-03-29 11:22:42 +00:00
pepijn-vanvlaanderen
6113af0a66 fix(medusa): Deleted discount missing on order (#6837)
* Fix deleted discount missing on order

* Added integration test

* Added changeset
2024-03-29 11:51:27 +01:00
Stevche Radevski
86f499de2f feat: Implemented price set update with prices and aligned pricing API (#6872) 2024-03-29 10:23:24 +00:00
Geoffroy Empain
85a27c3572 fix(inventory): cannot migrate existing products (#6877) (#6878)
* fix(inventory): cannot migrate existing products (#6877)

* chore: add changeset (#6821)

---------

Co-authored-by: Geoffroy Empain <geoffroy@charlie-bravo.be>
Co-authored-by: Stevche Radevski <sradevski@live.com>
2024-03-29 11:05:12 +01:00
Carlos R. L. Rodrigues
1c6ba4468e feat(modules-sdk): remote query retrieve (#6849)
What:

Remote Joiner options to check if keys exist on entry points or relations
2024-03-29 09:26:24 +00:00
Stevche Radevski
cbb5e6bd99 feat: Refactor the product module definitions and implementation (#6866)
There are several things done in this PR, namely:

Unify the service endpoints API to always work with a model rather than allowing to pass both ID and model (eg. both type_id and type being available in the request to create).
Start using upsertWithReplace to simplify the code and fix some deassociation bugs
Apply some changes to tests to deal with the pricing breaking changes
Correctly define the model relationships (with both ID and entity fields available)
All tests for the product are passing, which should bring us back to a great baseline.
2024-03-29 09:03:41 +00:00
Carlos R. L. Rodrigues
e603726985 fix(workflow-engine-*): subscribe response and error (#6869) 2024-03-29 08:23:41 +00:00
Oli Juhl
d97af91a8d feat(admin-next): Email password invite flow in admin 2.0 (#6821) 2024-03-29 08:05:11 +01:00
Carlos R. L. Rodrigues
45c49e89f2 chore(workflows-sdk): add idempotencyKey to shared context (#6860) 2024-03-28 17:51:29 +00:00
Shahed Nasser
412111e1ea chore: fix doc announcement actions (#6856)
- Fix error in doc announcement actions due to missing build step.
- Update the announcement in the docs to the latest version
2024-03-28 17:23:25 +00:00
Philip Korsholm
18438a695a feat(medusa, stock-location-next): add list-stock-locations endpoint to api-v2 (#6788)
* initial create

* add list for stock locations

* add changeset

* redo changes for stock locatino module'

* add changeset

* naming

* prep for pr

* move integration tests

* fix pr feedback

* add changeset

* update changeset

---------

Co-authored-by: Riqwan Thamir <rmthamir@gmail.com>
2024-03-28 17:33:26 +01:00
Stevche Radevski
a6562d2a41 feat: Modify the abstract repository upsert to handle subresources as per convention (#6813)
* feat: Modify the abstract repository upsert method to handle subresources correctly

* fix: Preserve the upsertWithResponse order in the response, and return all the data

* fix: Create integration tests folder for mikro orm utils that run against the DB

* fix: Remove many-to-one creation and additional changes based on PR review
2024-03-28 15:28:57 +01:00
Shahed Nasser
21156f945d docs-util: added AI generator (#6770)
## What

Adds an AI generator to the docblock tool that uses OpenAI.

The generator at the moment only generates examples for functions when the `--generate-examples` option is provided.

## Note

I've included the generated examples of the `IOrderModuleService` as a reference of the type of result provided by the AI generator, with minor tweeks I've made. I haven't made any changes to descriptions in that file.
2024-03-28 11:32:30 +00:00
Sebastian Rindom
6bf4d40856 chore(medusa-test-utils): create declaration file (#6858)
**What**
- Fixes tsconfig to ensure a declaration file is included in the build.

**Why**
- Ensure tsserver can understand things from medusa-test-utils
- Get rid of "Could not find a declaration file for module" warning in editors.
2024-03-28 10:43:25 +00:00
Oli Juhl
ea8d9d4d42 feat: API key sales channel link (#6851)
What
- Add link between API key and sales channels
- Add API route for batch adding sales channels to a publishable API key
- Clean up API key API routes responses
- Move API key test suite from `integration-tests/modules` to `integration-tests/api`
2024-03-28 10:15:11 +00:00
Adrien de Peretti
6ee2ee845c fix(): medusa test runner (#6857) 2024-03-28 10:33:40 +01:00
Riqwan Thamir
f176aa2b7b chore: remove noop tests (#6855) 2024-03-28 09:40:34 +01:00
Shahed Nasser
5e53b917f7 chore: add tsdocs for the Sales Channel Module (#6794)
Add/update TSDocs to the Sales Channel Module's resources
2024-03-27 18:24:00 +00:00
Philip Korsholm
ff84f749d5 feat(medusa): add list location levels endpoint in api v2 (#6741) 2024-03-27 18:59:38 +01:00
Adrien de Peretti
cf3c9b13b5 Fix/pricing data manipulation (#6845)
**What**
- Fix returned data order
- improve implentation
- rm unnecessary promises and/or promise all
- replace promise.all for promiseAll
2024-03-27 17:51:17 +00:00
github-actions[bot]
8e3e49fbbf chore(docs): Generated API Reference (#6755)
Co-authored-by: olivermrbl <olivermrbl@users.noreply.github.com>
2024-03-27 18:24:22 +01:00
Frane Polić
9766266b97 fix(admin-next): admin v2 flag parsing and loading user data (#6843) 2024-03-27 18:18:48 +01:00
Riqwan Thamir
8d9af2df81 fix: bust cache builds (#6847)
* chore: test cache build

* test turbo

* chore: intentionally break tests

* chore: fix test

* chore: rename test
2024-03-27 17:46:32 +01:00
Adrien de Peretti
d4d1f9b2f2 fix: integration tests modules expectations (#6848)
**What**
- fix tests
- cleanup deprecated jest conf
2024-03-27 15:39:20 +00:00
Adrien de Peretti
5d9aea053c fix(utils): Mikro orm prop filtering should check existence (#6842)
**What**
- Should return non decorated but visible properties.
- Should only prevent circular on non scalar fields
2024-03-27 14:31:26 +00:00
Adrien de Peretti
e0b02a1012 feat(utils): custom serialization that allows for non self ref (#6836)
* feat(utils): custom serialization that allows for non self ref

* Create fast-teachers-greet.md

* cleanup + tests

* cleanup + tests

* fix import

* fix map to pk relations
2024-03-27 12:31:04 +01:00
Philip Korsholm
4cf71af07d feat(core-flows, medusa): add update stock location endpoint to api-v2 (#6800)
* initial create

* add changeset

* redo changes for stock locatino module'

* initial update

* add changeset

* move integration tests

* update update method

* fix integration tests

* Update packages/stock-location-next/src/services/stock-location.ts

Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>

* update service

* initial fixes

* pr feedback

* update types

* expand revert clause for update

* update versioning

---------

Co-authored-by: Riqwan Thamir <rmthamir@gmail.com>
Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
2024-03-27 10:31:17 +01:00
Oli Juhl
0b23e7efb8 feat: Support invites in CLI for V2 (#6798)
**What**

- Add invite support to cli for 2.0
- Allow email to be passed upon accepting an invite
2024-03-26 20:02:56 +00:00
Shahed Nasser
16860cc883 docs: added doc pages for v1.20.4 (#6828)
- Added new documentation page for Medusa Worker.
- Updated Railway deployment guide with details on Medusa Worker.
- Small adjustments to the `worker_mode` option's TSDocs.
2024-03-26 19:19:57 +00:00