Commit Graph

3056 Commits

Author SHA1 Message Date
Kasper Fabricius Kristensen
40de54b010 feat(admin,admin-ui,medusa): Add Medusa Admin plugin (#3334) 2023-03-03 10:09:16 +01:00
Adrien de Peretti
d6b1ad1ccd feat(medusa): Performance improvement of DraftOrder creation (#3350)
* chore(medusa): Improve draft order creation

* cleanup

* fix unit tests

* fix unit tests 2

* Create beige-ties-hunt.md

* cleanup feedback

---------

Co-authored-by: Oliver Windall Juhl <59018053+olivermrbl@users.noreply.github.com>
2023-03-02 18:03:04 +01:00
Adrien de Peretti
f033711ad6 feat(medusa): Add Lifetime support on project/plugin services (#3349)
* feat(medusa): Add Lifetime support on project/plugin services

* Create kind-dogs-argue.md

---------

Co-authored-by: Oliver Windall Juhl <59018053+olivermrbl@users.noreply.github.com>
2023-03-02 16:33:11 +01:00
olivermrbl
f5ed47053c fix: Merge conflicts with master 2023-03-01 18:58:59 +01:00
olivermrbl
6e3b339b22 chore(release): v1.7.10 2023-03-01 18:55:21 +01:00
olivermrbl
947687d3f7 Merge branch 'master' into develop 2023-03-01 18:33:28 +01:00
Adrien de Peretti
e143a86976 fix(medusa): Plugin repository loader (#3345)
* fix(medusa): Plugin repository loader

* Create brave-goats-pay.md

---------

Co-authored-by: Oliver Windall Juhl <59018053+olivermrbl@users.noreply.github.com>
2023-03-01 18:14:36 +01:00
Oliver Windall Juhl
4b114cc419 feat(medusa): Use Bull jobId option to identify duplicates (#3351)
* feat(medusa): Use Bull jobId option to identify duplicates

* Create pink-emus-drum.md
2023-03-01 18:11:30 +01:00
Adrien de Peretti
b458615ed5 fix(medusa): Delete all payment sessions when cart total is 0 (#3346)
* Fix(medusa): On cart total amount at 0 the non initialised payment sessions are not delete

* fix test

* Create good-crews-pull.md
2023-03-01 13:22:25 +01:00
Philip Korsholm
8424236799 fix(medusa): Update typescript types to reflect oas and return types (#3344)
* update typescript types to reflect oas and return types

* add changeset

---------

Co-authored-by: Oliver Windall Juhl <59018053+olivermrbl@users.noreply.github.com>
2023-02-28 19:19:24 +01:00
Adrien de Peretti
589d1c09b0 feat(medusa-payment-stripe): Stripe PaymentProcessor implementation (#3257) 2023-02-28 18:44:24 +01:00
Philip Korsholm
d61d6c7b7f fix(medusa): Account for multiple inventory items in get-inventory (#3094)
* use pvi service method instead of inventory service method to get quantity for sales channel

* save a few invocations

* rename quantity

* omit || 0

* add changeset

* extract method for retrieving variant inventory quantity

* update pr with feedback
2023-02-28 17:09:20 +01:00
Philip Korsholm
5eb61fa0ef fix(medusa): update create fulfillment flow (#3172)
* update create fulfillment flow

* move transaction service creation close to where it's used

* integration tests

* fix feedback

* use transformBody

* add changeset
2023-02-28 16:28:11 +01:00
olivermrbl
7738525401 fix: Merge conflicts with master 2023-02-28 11:24:46 +01:00
Philip Korsholm
a1e59313c9 feat(medusa, stock-location): Sales channel filtering when listing locations (#3324)
* only add ordering select if not already selected

* add integration test

* add changeset

* remove catch

* linting and suggestion from adrien

* add sales channel filtering when listing locations

* add changeset

* add exception back into sales channel location service

---------

Co-authored-by: Oliver Windall Juhl <59018053+olivermrbl@users.noreply.github.com>
2023-02-28 10:41:59 +01:00
Adrien de Peretti
cbbf3ca054 fix(medusa): Clean response data usage for admin and store fields/expand (#3323)
* fix(medusa): Clean response data usage for admin and store fields/expand

* cleanup

* Create mighty-ads-fold.md

* fix integration

* fix integration

* refactor transform query and cleanup

* fix missing re naming

* Update packages/medusa/src/api/middlewares/transform-query.ts

---------

Co-authored-by: Oliver Windall Juhl <59018053+olivermrbl@users.noreply.github.com>
2023-02-28 09:48:08 +01:00
github-actions[bot]
84b6fe1d93 chore(docs): Generated Docs Announcement Bar (automated) (#3339) 2023-02-28 09:07:21 +01:00
olivermrbl
83d70f7965 chore(release): v1.7.9 2023-02-28 08:57:57 +01:00
pepijn-vanvlaanderen
370bd472ed fix(medusa): Fix regression in job scheduler service (#3335)
The queue registration of jobs has stopped working due to a small issue in how the jobs are added to the queue.

Co-authored-by: Oliver Windall Juhl <59018053+olivermrbl@users.noreply.github.com>
2023-02-28 07:53:51 +00:00
Philip Korsholm
0a02b70e59 fix(medusa): Reservation routes and VariantInventory type (#3328) 2023-02-26 13:42:16 +01:00
Philip Korsholm
08c8aa46c5 fix(medusa): Only add ordering select if not already present (#3319) 2023-02-26 13:08:06 +01:00
Riqwan Thamir
6323868f65 feat(medusa) allow querying category descendants with a param in list endpoint (#3321)
What:

Allowing the list endpoint to return a full tree when requested. 

Why:

When scoped with parent_category_id=null and include_descendant_tree=true, the query cost is fairly low. This allows for fast querying and prevent FE from building out the entire tree from a flat list repeatedly. By default, it is set to false, so this should be an intentional change knowing the costs of doing it for the entire result set. 

How:

When include_descendants_tree is included in the request parameter or the service parameter, we do a loop on results of product categories and do a call to fetch the descendants of that product category. 

RESOLVES CORE-1128
2023-02-24 08:46:52 +00:00
Carlos R. L. Rodrigues
ad7f56506f Feat(medusa,modules-sdk): Modules SDK package (#3294) 2023-02-23 13:09:35 -03:00
github-actions[bot]
89ed4cd2b1 chore(docs): Generated API Reference (#3326)
Co-authored-by: shahednasser <shahednasser@users.noreply.github.com>
2023-02-23 17:49:38 +02:00
Shahed Nasser
8d453d35a9 docs: added details about expand, fields, and parameter types (#3325) 2023-02-23 17:12:51 +02:00
Patrick
f3bf351d21 feat(oas): pluralize OAS tags (#3315)
## What

Pluralize OAS tags

## Why

OAS tags are commonly used by code generator to group routes under a name space based on a tag. 

Our JS client convention is to use plural, e.g: client.products, client.customers. In order to minimize friction when migrating to a client generated from OAS, tags should be plural as well.

## How

Match tag naming with JS client resource naming.

## Test

* Run `yarn build`
* Run `yarn openapi:generate`
* Run `yarn redocly preview-docs docs/api/admin/openapi.yaml --config=./docs-util/redocly/config.yaml`
* Expect side menu items to be plural.
* Run `yarn redocly preview-docs docs/api/store/openapi.yaml --config=./docs-util/redocly/config.yaml`
* Expect side menu items to be plural.
2023-02-23 13:31:51 +00:00
olivermrbl
e1b92e9b04 fix: Merge conflicts with master 2023-02-22 17:38:49 +01:00
Patrick
935870e010 fix(oas): add missing x-codegen + fix schema naming and $ref (#3312)
## What

Add missing x-codegen + fix schema naming and $ref 

## Why

OAS code generator was missing information to be able to match current JS client.

## How

Ensure OAS matches JS client methods.
2023-02-22 16:25:48 +00:00
Patrick
287c829c9c feat(oas): include /admin and /store in paths URLs (#3314)
## What

Include `/admin` and `/store` in OAS paths URLs

## Why

Allow for generating a combined OAS that include routes for both "admin" and "store" endpoint.

Fix potential issues with code generator where routes are not prefixed with "admin" and "store" leading to 404 errors.

## Test

* Run `yarn build`
* Run `yarn openapi:generate`
* Run `yarn redocly preview-docs docs/api/admin/openapi.yaml --config=./docs-util/redocly/config.yaml`
* Expect paths to be prefixed with /admin.
* Run `yarn redocly preview-docs docs/api/store/openapi.yaml --config=./docs-util/redocly/config.yaml`
* Expect paths to be prefixed with /store.
2023-02-22 15:43:41 +00:00
Riqwan Thamir
68496ffe60 fix(medusa): fixes bug for mpath incorrectly updated for nested categories (#3311)
* chore: fix issue with mpath being incorrectly set

* chore: address review changes
2023-02-22 15:43:58 +01:00
github-actions[bot]
8e5ebc9a1d chore(docs): Generated Docs Announcement Bar (automated) (#3310)
Co-authored-by: olivermrbl <olivermrbl@users.noreply.github.com>
2023-02-22 14:45:49 +02:00
github-actions[bot]
e3305188bd chore(docs): Generated API Reference (#3308)
Co-authored-by: olivermrbl <olivermrbl@users.noreply.github.com>
2023-02-22 14:45:23 +02:00
github-actions[bot]
3f5b7fbe7e chore(docs): Generated Services Reference (automated) (#3309)
Co-authored-by: olivermrbl <olivermrbl@users.noreply.github.com>
2023-02-22 14:44:52 +02:00
olivermrbl
fefc248a41 chore(release): v1.7.8 2023-02-22 13:13:48 +01:00
Adrien de Peretti
5301a1e9d6 chore(medusa): Revert AbstractPaymentService deprecation (#3298) 2023-02-21 20:40:40 +01:00
Patrick
e8e7d7bb53 fix(medusa-dev): include packages/ subdirectories in discovery (#3293)
## What

Include packages/ subdirectories in medusa-dev packages discovery.

## Why

We started to use subdirectories in the monorepo `packages/` directory in order to better organize packages.

Packages in subdirectories were invisible to `medusa-dev` and could not be copied.

## How

Rely on monorepo package.json workspace glob patterns to discover packages that can be published to the local npm registry.
2023-02-21 16:12:02 +00:00
Shahed Nasser
3084de0c02 chore: changed trigger for docs generation actions (#3304) 2023-02-21 18:11:32 +02:00
Adrien de Peretti
d11ab924b8 feat(medusa): Configurable returnable_items on order decorate totals (#3276) 2023-02-21 14:48:49 +01:00
Adrien de Peretti
f43e9f0f20 feat(medusa): Load PaymentProcessors + integrate in PaymentProviderService (#2978)
* feat: Add payment process support into the loader and payment provider

* WIP

* feat: continue payment provider alignment

* fix tests and defer payment service resolution

* continue to add support to payment provider

* continue to add support to payment provider

* fix fixtures

* chore: add updateSessionData unsupported error

* chore: Adress feedback

* chore: Adress feedback

* chore: fix default loader

* cleanup

* cleanup

* fix unit tests

* Create purple-sloths-confess.md

* address feedback

* minor changes

* fix unit test

---------

Co-authored-by: Oliver Windall Juhl <59018053+olivermrbl@users.noreply.github.com>
2023-02-21 09:48:32 +01:00
Patrick
1c40346e9e feat(codegen): openapi-typescript-codegen fork (#3272)
## What

Allow `medusa-oas` CLI to generate API client code from an OAS json file.

## Why

Manually maintaining API clients is time consuming and error prone. We wish to automate the process by using code generation strategies.

We also wish to eliminate direct import from `@medusajs/medusa` in clients which can lead to unwanted side effects like importing unnecessary dependencies.

## How

Fork and customize an OAS code generator library that is TypeScript friendly.

Attempt to match the interface and signature of our current client packages: `@medusajs/medusa-js`, `medusa-react`

Add a new `client` command to the `medusa-oas` CLI as the main interface to interact with the code generation tooling.

## Test

### Prerequisites 
* From the root of the monorepo:
* `yarn install`
* `yarn build`

### Case - all in one build
* From the root of the monorepo:
* Run `yarn medusa-oas oas --out-dir ~/tmp/oas --type store`
* Run `yarn medusa-oas client --src-file ~/tmp/oas/store.oas.json --out-dir ~/tmp/client-store --type store`
* Expect `~/tmp/client-store` to contain the following files and directories:
```
core/
hooks/
models/
services/
index.ts
MedusaStore.ts
useMedusaStore.tsx
```

### Case - types only
* From the root of the monorepo:
* Run `yarn medusa-oas oas --out-dir ~/tmp/oas --type store`
* Run `yarn medusa-oas client --src-file ~/tmp/oas/store.oas.json --out-dir ~/tmp/client-types --type store --component types`
* Expect `~/tmp/client-types` to contain the following files and directories:
```
models/
index.ts
```

### Case - client only
* From the root of the monorepo:
* Run `yarn medusa-oas oas --out-dir ~/tmp/oas --type store`
* Run `yarn medusa-oas client --src-file ~/tmp/oas/store.oas.json --out-dir ~/tmp/client-only --type store --component client --types-package @medusajs/client-types`
* Expect `~/tmp/client-only` to contain the following files and directories:
```
core/
services/
index.ts
MedusaStore.ts
```
2023-02-20 20:50:39 +00:00
Frane Polić
6c04624727 chore(medusa): remove PublishableAPIKeys feature flag (#3087) 2023-02-20 21:16:08 +01:00
Adrien de Peretti
46547f29c7 chore(medusa): Improve store list products (#3252)
* chore(medusa): Improve list products by 46.5 percents

* fix handler

* todo's

* Create tricky-terms-wash.md

---------

Co-authored-by: Oliver Windall Juhl <59018053+olivermrbl@users.noreply.github.com>
2023-02-20 12:45:05 +01:00
github-actions[bot]
b393d74a10 chore(docs): Removed Docs Announcement Bar (automated) (#3292)
Co-authored-by: shahednasser <shahednasser@users.noreply.github.com>
2023-02-20 09:54:13 +02:00
Pevey
13c200ad2f feat(medusa-file-s3): S3 file service reusing a single AWS client (#3260) 2023-02-19 19:17:35 +01:00
Patrick
7d585f5f84 fix(oas): fix paths and fix schema names to match convention (#3288) 2023-02-19 18:11:02 +01:00
Patrick
38503fff56 feat(oas): identify required fields in responses - store (#3282)
## Scope

Store routes

## What

Add OAS `required` to response schemas.

## Why

Code generator can use the `required` property of a schema to mark fields as optional or not when generating TS types.

## Test

* Run `yarn build`
* Run `yarn openapi:generate`
* Run `yarn redocly preview-docs docs/api/store/openapi.yaml --config=docs-util/redocly/config.yaml`
* Open the documentation preview URL in a browser (http://127.0.0.1:8080)
* Expect responses to have their fields declared as `required`
2023-02-17 15:28:01 +00:00
Shahed Nasser
7e6f15d4a9 docs: added details about expand, fields, and filtering (#3287) 2023-02-17 16:53:22 +02:00
Patrick
48ad2426aa feat(oas): identify required fields in responses - admin (#3278)
## Scope

Admin routes

## What

Add OAS `required` to response schemas.

## Why

Code generator can use the `required` property of a schema to mark fields as optional or not when generating TS types.

## Test

* Run `yarn build`
* Run `yarn openapi:generate`
* Run `yarn redocly preview-docs docs/api/admin/openapi.yaml --config=docs-util/redocly/config.yaml`
* Open the documentation preview URL in a browser (http://127.0.0.1:8080)
* Expect responses to have their fields declared as `required`
2023-02-17 14:19:13 +00:00
Shahed Nasser
d8dcc4ce9a docs: added CORS common examples (#3284)
* docs: added CORS common examples

* fix lint errors
2023-02-17 15:42:46 +02:00
Shahed Nasser
d1abe7cd85 chore(docs): manually generated API reference to fix load issue (#3286) 2023-02-17 15:23:20 +02:00