Commit Graph

2725 Commits

Author SHA1 Message Date
Philip Korsholm
d8893d6b9f chore: Update release tag from staging to next (#2858) 2022-12-20 12:21:48 +01:00
Patrick
a027d5ff9e chore(oas): PascalCase for schemas + remove x-resourceId (#2847)
### What

Rename all JSDoc OAS `@schema` and `$ref: #/components/schemas/` from snake_case to PascalCase, `foo_bar -> FooBar`

Extra scope: Remove `x-resourceId` from JSDoc OAS.

### Why

Classes use PascalCase as a convention but the OAS @schemas describing them were using snake_case. OAS code generators tend to use the schema name when generating typed models.

In order to avoid mismatch between source code, the OAS, and the generated client code, it is advised to align OAS @schemas formatting to the classes they represent.

Extra scope: x-resourceId is not a widely used OAS property. It's current usage in our OAS does not provide additional value. Therefore, we recommend to remove it in order to have one less item to maintain.

### How

Good old search & replace. Regex search to further make sure we didn't miss any.

The scope is limited to `@schema` definition and their usage in `$ref: #/components/schemas/`.

### Test

* Ran OAS validator.
* Ran docs build script.

Expect no visible changes to the documentation.

Resolves: CORE-852, CORE-859
2022-12-20 10:58:57 +00:00
josetr
2e5ceb7950 feat(medusa): Allow custom database schema (#2819) 2022-12-20 10:04:47 +01:00
Philip Korsholm
79cddc23da feat(medusa-file-s3): Allow all AWS options in config (#2809) 2022-12-20 10:01:30 +01:00
Oliver Windall Juhl
4ef0bffff9 chore: Ignore integration tests for changesets (#2828) 2022-12-20 09:01:00 +00:00
Oliver Windall Juhl
ba6bb3e54b feat(medusa): Extract cron job logic to its own service (#2821)
**What**
Extract cron job logic from the `EventBusService` to its own service `JobSchedulerService`

**Why**
Preliminary step to extracting the event bus into a module

**Tests**
Tested with a local installation of Medusa

Resolved CORE-918
2022-12-19 19:04:46 +00:00
Adrien de Peretti
c8724da503 feat(medusa,medusa-payment-stripe): Move database mutation from plugin to core (#2743)
**what**
The goal of that PR is to first refactor the payment provider and payment plugin to support the new API that removes the data mutation from within the plugin to be done by the core instead. In any case, this pr does not include the steps of the deeper refactoring. The last part will come in later pr.

**How**
- The payment plugin is now capable to handle both the deprecated and new API and the plugin works the same as it use to works.
- The mutation made by the plugin have been moved into the core as well as the subscriber
- The tests have been updated to reflect the changed
- Remove all new methods introduced by the payment collections
  - Mutualise types
  - Update provider and payment collection services
  - cleanup around all those refactoring including cleanup of the payment collection
  - refactor stripe payment plugin

FIXES CORE-887
2022-12-19 14:37:35 +00:00
Carlos R. L. Rodrigues
8dcc805ccf feat(medusa): Validate required id before retrieving (#2738) 2022-12-19 09:49:18 +01:00
Kasper Fabricius Kristensen
9e05fef4b9 fix(medusa): Fix q param on /admin/price-lists/:id/products (#2813) 2022-12-18 20:11:38 +01:00
Adrien de Peretti
5e4decbc1c fix(medusa): Batch job not saving the errors properly (#2812) 2022-12-16 20:13:53 +01:00
Philip Korsholm
c16522d6ce feat(medusa): Add has_account to list-customers query params (#2811) 2022-12-16 12:16:34 +01:00
Philip Korsholm
6283010fd6 Fix(medusa): Totals on draft orders (#2785)
* test subtotals on draft order operations

* fetch cart with subtotals when doing draft order operations

* write test for updating discounts seeing changes in totals

* formatting

* udpate test

* force taxes

* missing select

* add import

* rm force_taxes
2022-12-16 10:21:53 +01:00
Frane Polić
ea460b4e0b feat(medusa): add q param to PKs sales channels retrieval (#2810)
**What**
- enable to filter sales channels of a Publishable API Key with a free text search param

Co-authored-by: Oliver Windall Juhl <59018053+olivermrbl@users.noreply.github.com>
2022-12-15 19:12:44 +00:00
Adrien de Peretti
0fa5042e35 feat(medusa): CSV formatter accounts for comma and semicolon (#2789)
Co-authored-by: Sebastian Rindom <skrindom@gmail.com>
2022-12-15 14:06:49 +01:00
Frane Polić
2d22b17b49 feat(medusa): Allow all relations on /admin/* endpoints (#2763) 2022-12-15 09:07:07 +01:00
Patrick
0a9c891853 chore: explicitly add devDependencies for monorepo peerDependencies (#2808) 2022-12-15 08:46:52 +01:00
Aaron Finocchiaro
b06794b08b feat(medusa-plugin-sendgrid) Add refund created event to sendgrid (#2740) 2022-12-14 19:37:01 +01:00
Adrien de Peretti
7cced6006a fix(medusa-core-utils): getConfigFile typings (#2783)
* fix: getConfigFile typeings

* Create brave-apes-carry.md

Co-authored-by: Oliver Windall Juhl <59018053+olivermrbl@users.noreply.github.com>
2022-12-14 19:35:16 +01:00
olivermrbl
7d28eaf8c6 Merge branch 'master' into develop 2022-12-14 19:34:47 +01:00
Shahed Nasser
e5e13cc40e docs: added order claim documentation (#2805) 2022-12-14 20:25:12 +02:00
Shahed Nasser
c1659f81ac chore: cleanup typedoc plugin (#2801)
* chore: added gitignore for typedoc plugin

* remove unnecessary files

* docs: added a note about building the plugin

* chore: added .yarn to gitignore

Co-authored-by: olivermrbl <oliver@mrbltech.com>
2022-12-14 19:48:48 +02:00
Adrien de Peretti
71b536e01e chore(medusa): Replace inline Redis cache in favour of the CacheService (#2802)
* chore: Replace all usage of redis for the cache in favour of the cache service

* Create four-bugs-mate.md

* chore: missing new line
2022-12-14 18:11:10 +01:00
Patrick
6b73d087b6 fix(medusa-js): missing devDependency was failing repo build task (#2804)
### What

Explicitly declare `@medusajs/medusa` as a devDependency for `@medusajs/medusa-js` client package.

### Why

With our latest version upgrade of `turbo`, peerDependencies aren't taken into account in the build graph. The recommendation is to also explicitly declare them in devDependencies.

### Test

* Run `yarn build --graph`
* Expect to see medusa-js having a dependency on medusa
```
"[root] @medusajs/medusa-js#build" -> "[root] @medusajs/medusa#build"
```
2022-12-14 17:55:34 +01:00
Patrick
7bb9cd6aff fix(medusa-js): missing devDependency was failing repo build task (#2804)
### What

Explicitly declare `@medusajs/medusa` as a devDependency for `@medusajs/medusa-js` client package.

### Why

With our latest version upgrade of `turbo`, peerDependencies aren't taken into account in the build graph. The recommendation is to also explicitly declare them in devDependencies.

### Test

* Run `yarn build --graph`
* Expect to see medusa-js having a dependency on medusa
```
"[root] @medusajs/medusa-js#build" -> "[root] @medusajs/medusa#build"
```
2022-12-14 16:46:08 +00:00
olivermrbl
8edf6a06ee Merge branch 'master' into develop 2022-12-14 14:47:23 +01:00
Shahed Nasser
fef2d997b2 chore: removed reference directory (#2800) 2022-12-14 14:59:11 +02:00
Jürgen
6531eb52ed docs: fixed typo in carts resource (#2798)
Co-authored-by: j.untch <j.untch@outlook.de>
2022-12-14 13:31:13 +02:00
Shahed Nasser
49383c0cbd docs: fix OAS comments in publishable api keys (#2796) 2022-12-14 11:29:39 +01:00
Shahed Nasser
e2b7f77ba9 docs: fix id used in endpoint path in OAS (#2795)
* docs: fix id used in endpoint path in OAS

* docs: small fixes to OAS comments

* revert changes in core package

* undo changes in core files
2022-12-14 11:54:31 +02:00
Philip Korsholm
e79794ea92 chore(medusa): Remove unused event from order service (#2793)
**What**
- remove unused event (legacy from claiming orders)
2022-12-14 09:43:47 +00:00
olivermrbl
01d521ed40 chore(medusa-js): Version package + add missing changeset 2022-12-14 09:37:20 +01:00
Patrick
17c3f34e3d chore(turbo): flip turbo caching glob from allow-list to deny-list (#2772)
### What

Flip Turborepo cache glob pattern from an allow-list to deny-list pattern.

### Why

Packages within medusa's monorepo will output their build to a `dist` directory. 

This convention does not apply to plugins since the core plugin loader expects the content of plugin packages `src` directory to be outputted at the root of the package. 

i.e. `packages/foobar-plugin/src/utils/index.ts` -> `packages/foobar-plugin/utils/index.js`

Manually maintaining an allow-list of known plugin output directories is not scalable. When a directory exists in a plugin package but is not know to the allow-list, the directory will not be re-built on subsequent builds. Troubleshooting the issue requires intimate knowledge of Turborepo caching strategies.

### How

By using a deny-list glob pattern, plugin packages can now declare any not-known directory within their `src` folder without facing any potential omission issues during the build process.

We declare `src` and its content as the only directory for turbo cache to ignore.

### Additional scope

* Use `turbo.json` file content in cache hashing algorithm in order to break CI cache when changes are made to the Turborepo config.
* Upgraded turbo minor verion.
* Added missing dependency to medusa package.

### Test
* Delete previously built output in packages. Run `yarn build --force` (replace any existing cache)
  * Expect all src content to be outputted
* Run `yarn build` right after
  * Expect a fast build time since cache will be fresh
* Add a new directory with an index.ts file in a plugin package src folder. Run `yarn build` 
  * Expect a fast build time, except for the modified plugin package.
  * Expect the newly added directory to be outputted.
* Delete the newly outputted directory. Run `yarn build`
  * Expect the outputted directory to reappear. 

### References
* 5093b82f3a/packages/medusa/src/loaders/plugins.ts
* https://turbo.build/repo/docs/reference/configuration#outputs
* https://turbo.build/repo/docs/reference/configuration#globaldependencies

Resolves CORE-891
2022-12-13 17:59:48 +00:00
Shahed Nasser
319bcc71b0 docs: updated event reference (#2791)
* docs: updated events reference

* docs: added noCopy metadata option for code blocks
2022-12-13 18:14:53 +02:00
Shahed Nasser
0d788e73c4 chore: fix API ref generator to run on push to master (#2787) 2022-12-13 13:22:05 +02:00
Shahed Nasser
52a8e90aac chore(docs): Generated API reference (#2788) 2022-12-13 12:52:58 +02:00
Shahed Nasser
a77b4a1b7e docs: changed the steps to run tests in local dev (#2786) 2022-12-13 12:47:21 +02:00
github-actions[bot]
e174443ecf chore(docs): Generated JS Client Reference (automated) (#2780)
Co-authored-by: olivermrbl <olivermrbl@users.noreply.github.com>
2022-12-13 12:40:33 +02:00
Shahed Nasser
76d35a1350 docs: made changes to CORS usage/config (#2784) 2022-12-13 12:32:51 +02:00
github-actions[bot]
5fab104b35 chore(docs): Generated Docs Announcement Bar (automated) (#2781)
Co-authored-by: olivermrbl <olivermrbl@users.noreply.github.com>
2022-12-13 11:53:42 +02:00
Shahed Nasser
7227c1539b docs: added a note about using Yarn for installation (#2778)
* docs: added a note about yarn being faster

* docs: fixed env variable used in admin deployment guide

* docs: fixed the use of noReport with npm2yarn
2022-12-13 11:52:55 +02:00
Shahed Nasser
6c796bf582 docs: added a minimum Node.js version for admin (#2779)
* docs: added a note about min node version in admin

* docs: added a link to Vite documentation
2022-12-13 11:52:37 +02:00
Shahed Nasser
beecd4947d docs: added an upgrade guide for 1.7.0 (#2750) 2022-12-13 10:36:52 +01:00
olivermrbl
29135c0519 chore(release): Publish 2022-12-13 10:34:07 +01:00
olivermrbl
98b91fe917 Merge branch 'master' into develop 2022-12-13 09:59:26 +01:00
Caleb Rogers
6b51dd0168 docs: update environment variable used in admin's deploy guides (#2748)
* docs: Update netlify deploy readme for clarity

It was unlcear why "Gatsby" was mentioned in the env name for the server URL. Also, the code shows precedence given to `MEDUSA_BACKEND_URL` now:

```
    __MEDUSA_BACKEND_URL__: JSON.stringify(
      env.MEDUSA_BACKEND_URL ||
        // Backwards-compat with Gatsby.
        env.GATSBY_MEDUSA_BACKEND_URL ||
        env.GATSBY_STORE_URL ||
        ""
    ),
```

Therefore, this should be indicated in the documentation.

* Update docs/content/deployments/admin/deploying-on-netlify.md

* Update deploying-on-netlify.md

Co-authored-by: Shahed Nasser <shahednasser@gmail.com>
2022-12-13 10:16:01 +02:00
Caleb Rogers
9021037397 docs: use correct publish directory for netlify deploy (#2741)
* Use correct publish directory for netlify deploy

Netlify automatically sets the Publish directory as "dist," but the netlify admin app's `build` command outputs files to `public`.

* Update docs/content/deployments/admin/deploying-on-netlify.md

Co-authored-by: Shahed Nasser <shahednasser@gmail.com>

* Netlify CLI instructions updated to match UI

* Update docs/content/deployments/admin/deploying-on-netlify.md

* Update docs/content/deployments/admin/deploying-on-netlify.md

* Update deploying-on-netlify.md

Co-authored-by: Shahed Nasser <shahednasser@gmail.com>
2022-12-13 10:12:58 +02:00
olivermrbl
bde50ade40 Merge branch 'master' into develop 2022-12-12 19:26:00 +01:00
Adrien de Peretti
b5d6682db6 feat(medusa): Allow regexp in CORS configuration (#1935) 2022-12-12 19:24:37 +01:00
Kasper Fabricius Kristensen
c2c38dd091 fix(medusa, medusa-react): Typing of optional fields on multiple product endpoints (#2771) 2022-12-12 19:10:06 +01:00
Frane Polić
3464617553 fix(medusa): Payment status on refunds (#2770) 2022-12-12 19:04:36 +01:00