Commit Graph

2228 Commits

Author SHA1 Message Date
github-actions[bot]
0f51e3a400 chore: Release (#3818)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Oliver Windall Juhl <59018053+olivermrbl@users.noreply.github.com>
2023-04-14 11:18:39 +02:00
Adrien de Peretti
6bb1654b61 fix(medusa): List products end points (#3829)
* fix(medusa): List products end points

* lint

* Create fast-toes-know.md
2023-04-13 21:33:08 +02:00
Riqwan Thamir
95d338262b feat(medusa): allow category list api to be filtered by handle (#3825)
what:

- Introduce a filter to the list endpoint to query by handle

why:

- Storefronts mostly interact through handles and not IDs for readability and seo purposes - Take an example of a url `site.com/category/mens-wear`

RESOLVES CORE-1325
2023-04-13 17:57:30 +00:00
Shahed Nasser
69bea8cc13 docs: added details about sort order in pagination (#3824) 2023-04-13 14:53:34 +03:00
Riqwan Thamir
4f58ddee03 feat(medusa,utils): add server level configurable http compression (#3785)
* feat(medusa,utils): add server level configurable http compression

* chore: remove unwanted middleware

* chore: add a log for running compression

* chore: change package position

* chore: reposition options

* chore: change equality
2023-04-13 12:39:13 +02:00
Patrick
1456056e8f feat(oas): new medusa-oas docs for Redocly and circular references (#3745)
## What

New `medusa-oas docs` to improve OAS compatibility with for Redocly API documentation viewer and handle deep circular references.

## Why

We wish to share the tooling we have been using to generate our public API documentation.

## How

* Move `/docs-utils/redocly` under `medusa-oas-cli` package.
* Move  some of the operations from `oas-github-ci/scripts/build-openapi.js` under the `medusa-oas docs` command.
* Improve DevX when dealing with circular references by outputting precise troubleshooting recommendations in the error message.
* Extract some common operations in utility methods.

## Tests

### Step 1
* Run `yarn install`
* Run `yarn build`
* Run `yarn openapi:generate --dry-run`
* Expect same behaviour as before where OAS is validated and circular references are checked.

### Step 2
* Run `yarn openapi:generate`
* Expect same behaviour as before where API documentation is generated in `/docs`

### Step 3
* Move to the `packages/oas/medusa-oas-cli`
* Run `yarn medusa-oas oas --type store --out-dir ~/tmp/oas` to generate the raw OAS file.
* Run `yarn medusa-oas docs --src-file ~/tmp/oas/store.oas.json --preview`
* Open url from the console output in a browser
* Expect a preview of the API documentation using Redocly.

### Step 4
* Run `yarn medusa-oas docs --src-file ~/tmp/oas/store.oas.json --out-dir ~/tmp/docs/store --clean --split`
* Expect a similiar output as `yarn openapi:generate`

### Step 5
* Run `yarn medusa-oas docs --src-file ~/tmp/oas/store.oas.json --out-dir ~/tmp/docs/store --clean --html`
* Expect `index.html` to have been created.
* Run `npx http-server ~/tmp/docs/store -p 8000`
* Open http://127.0.0.1:8000 in a browser.
* Expect a zero-dependency static rendering of the API documentation using Redocly.

### Step 6
* To emulate an unhandled circular reference, edit [packages/oas/medusa-oas-cli/redocly/redocly-config.yaml](d180f47e16/packages/oas/medusa-oas-cli/redocly/redocly-config.yaml (L9-L10)) and comment out "Address: - Customer"
* Run `yarn medusa-oas docs --src-file ~/tmp/oas/store.oas.json --dry-run`
* Expect an error message with a hint on how to resolve the issue.
* Create a file `~/tmp/redocly-config.yaml` and paste in the recommendation from the error message.
* Run `yarn medusa-oas docs --src-file ~/tmp/oas/store.oas.json --dry-run --config ~/tmp/redocly-config.yaml` 
* Expect Dry run to succeed.
2023-04-12 17:16:15 +00:00
github-actions[bot]
3efe13eefd chore: Release (#3782)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Oliver Windall Juhl <59018053+olivermrbl@users.noreply.github.com>
2023-04-12 11:32:05 +02:00
Shahed Nasser
1651cfd4ac docs: added currency documentation pages (#3803)
* docs: added currency documentation pages

* fixes to OAS
2023-04-11 21:39:24 +03:00
Oliver Windall Juhl
654a546223 chore: Bump Typeorm (#3778) 2023-04-11 18:43:40 +02:00
Frane Polić
78ff64e783 fix(medusa): validate customer for group discount (#3797)
* fix: validate customer for group discount

* fix: remove logger

* fix: add generated desc

* fix: add an integration test case

* refactor: update error message

* fix: typo

* refactor: move condition

---------

Co-authored-by: fPolic <frane@medusajs.com>
2023-04-11 14:16:18 +02:00
Oliver Windall Juhl
7f6dc44beb fix(medusa): Add totals when retrieving order by cart id (#3777)
* fix(medusa): Add totals when retrieving order by cart id

* fix: Unit test

* Create .changeset/stupid-rockets-smile.md
2023-04-11 11:40:13 +02:00
Oliver Windall Juhl
085fedb1f7 chore(medusa): Upgrade ioredis-mock (#3704)
* chore(medusa): Upgrade ioredis-mock

* Create .changeset/old-spoons-bow.md

* chore: Increas jest timeout

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-04-09 16:10:04 +02:00
Rares Stefan
4104d9ccb2 fix(medusa-plugin-economic,medusa-plugin-mailchimp,medusa-plugin-restock-notification,medusa-plugin-sendgrid,medusa-plugin-wishlist): Temporarily remove payload validation in some plugins (#3763)
* Temporarily remove payload validation in some plugins

* Add changeset

* chore: Remove commented out code

* Revert discount generator plugin

---------

Co-authored-by: olivermrbl <oliver@mrbltech.com>
Co-authored-by: Oliver Windall Juhl <59018053+olivermrbl@users.noreply.github.com>
2023-04-08 21:09:13 +02:00
Adrien de Peretti
282e239dfc chore(medusa): Migrate price list repository (#3725)
* chore(medusa): Migrate price list repository

* Create grumpy-cars-tease.md

* fixes

* fix

* fix

* cleanup

---------

Co-authored-by: Riqwan Thamir <rmthamir@gmail.com>
2023-04-08 18:54:08 +02:00
Adrien de Peretti
1a60c6f58d fix(medusa): Throw on line item generation if variant does not have a price (#3766) 2023-04-08 18:32:59 +02:00
Riqwan Thamir
d533caa4c2 feat(medusa, admin-ui): add description field to product categories (#3768)
* feat(medusa): add description field to product categories

* chore: set nullable to false

* chore: added UI for description

* chore: added codegen files
2023-04-08 18:29:12 +02:00
Riqwan Thamir
abdb74d997 chore(medusa, utils): rename buildLegacyFieldsListFrom to objectToStringPath (#3738)
* chore(medusa): rename buildLegacyFieldsListFrom to objectToStringPath

* chore: address pr comments
2023-04-07 10:27:13 +02:00
Frane Polić
08f85fa33b fix(medusa): export product prices in human-readable format (#3739)
* fix: export product prices in human-readable format

* feat: add changesets

* fix: update snaps

* fix: update more snaps

---------

Co-authored-by: fPolic <frane@medusajs.com>
2023-04-07 09:59:28 +02:00
Shahed Nasser
f04f5c3498 docs(oas): fixed OAS comments for 1.8 endpoints (#3751)
* docs(oas): fixed oas comments for 1.8 endpoints

* generated changes
2023-04-06 18:28:27 +03:00
Shahed Nasser
162c4e6e41 chore: added maintenance note to gatsby-source-medusa (#3759) 2023-04-06 18:00:44 +03:00
Frane Polić
6f48cc57bc fix(admin-ui): "cancel fulfillment" notification text (#3750)
* fix: "cancel fulfillment" notification text

* fix: add changesets

---------

Co-authored-by: fPolic <frane@medusajs.com>
2023-04-06 15:45:54 +02:00
Frane Polić
c24c2a9732 fix(medusa-react): update customer hook payload type (#3752)
Co-authored-by: fPolic <frane@medusajs.com>
2023-04-06 15:42:55 +02:00
Frane Polić
72b76bbd3c fix(admin-ui): display SC update notification (#3755)
Co-authored-by: fPolic <frane@medusajs.com>
2023-04-06 15:21:03 +02:00
Riqwan Thamir
713d85a92c chore(medusa): migrate SalesChannel / ProductCategory repository (#3728)
* chore: Migrate sales channel repository

* chore: migrated product categories

* chore: remove alias + rename changset

* chore(medusa): Cleanup publishable api key sales channel repo

* rm comment

---------

Co-authored-by: adrien2p <adrien.deperetti@gmail.com>
2023-04-05 18:33:16 +02:00
Rares Stefan
30ee10fddd fix(react): Fix input type on useAdminUpdateReservation mutation hook (#3732)
The hook was incorrectly expecting the input type for the creation mutation.

Resolves CORE-1316
2023-04-05 14:24:32 +00:00
Patrick
0b3c6fde30 feat(codegen:test): coverage x-expanded-relation + x-codegen.queryParams (#3675)
## What

Adding tests to cover `x-expanded-relation` and  `x-codegen.queryParams` handling

## Why

The logic that processes these OAS extension can be complex to reason with. Therefore, we should have automated tests to prevent unintentional regression.

## How

* Focus on `getModels` method and its sub-routines.
* Add coverage to getOperation codegen parsing.
* Add coverage to model and operation spec property.
2023-04-05 14:01:29 +00:00
Adrien de Peretti
60abb91b7c chore(medusa): Migrate payment collection repository api (#3724)
* chore(medusa): Migrate payment repository api

* Create fresh-ties-hide.md
2023-04-05 12:39:46 +02:00
Adrien de Peretti
eab2d22f7d chore(medusa): Migrate product tag repository (#3726)
* chore(medusa): Migrate product tag repository

* chore(medusa): cleanup

* chore(medusa): cleanup

* Create healthy-lies-eat.md

* chore(medusa): naming

* fix repo
2023-04-05 12:39:28 +02:00
Adrien de Peretti
4d69d8ef6a chore(medusa): Migrate product type repository (#3727)
* chore(medusa): Migrate product type repository

* Create pink-socks-brake.md
2023-04-05 12:39:15 +02:00
Adrien de Peretti
914d57336b chores(medusa): cleanup registrations life time (#3699) 2023-04-05 12:15:44 +02:00
olivermrbl
4c268238a4 Merge branch 'master' into develop 2023-04-05 09:18:48 +02:00
olivermrbl
66c59d54ff chore(release): v1.8.0 2023-04-04 18:35:27 +02:00
olivermrbl
f0d37b4d2d chore(release): v1.8.0-rc.8 2023-04-04 17:37:13 +02:00
Adrien de Peretti
4488ec6852 fix(medusa): Ignore categories seeding for sqlite (#3713) 2023-04-04 17:33:49 +02:00
olivermrbl
7a3194c313 chore(release): v1.8.0-rc.7 2023-04-04 16:07:48 +02:00
Adrien de Peretti
dae8da1099 fix(admin): Duplicate product without prices (#3706)
* fix(admin): Duplicate product without prices

* Create honest-ways-eat.md
2023-04-04 16:04:31 +02:00
Adrien de Peretti
e5a2e9c8d2 fix(medusa): circular loading (#3705) 2023-04-04 16:02:35 +02:00
Patrick
089f1eb19e feat(tests): harmonize and clean-up yarn test commands convention (#3695)
## What

Harmonize and clean-up yarn test commands convention.

## Why

Current strategy to filter integration tests from unit tests was cumbersome to maintain. Also, some packages declared `test:unit` which ended up being an alias to `test`.

## How

* Remove all occurrences of `test:unit`
* Rename all `test` commands under `/integration-tests/**/package.json` to `test:integration`
* In the root `package.json`, rewrite `test:integration` command to run `turbo run test:integration`
* In the root `package.json`, remove filtering on the `test` command
* Introduce a new `test:integration` task in the Turborepo config.
2023-04-04 13:47:54 +00:00
Philip Korsholm
748833383f hotfix(medusa): Temporary multi-warehouse support for draft orders (#3665)
* remove reservations from draft order creation and show correct inventory

* add changeset

* add integration tests

* adjust inventory on payment if no inventory service is installed
2023-04-04 11:36:51 +02:00
olivermrbl
bb9df09e37 chore(release): v1.8.0-rc.6 2023-04-03 18:05:12 +02:00
Patrick
d06ab92994 fix(medusa-react): export product-categories store hooks (#3689) 2023-04-03 17:32:02 +02:00
Philip Korsholm
7f87c4f2c8 fix(medusa-react): Query key invalidation (#3686) 2023-04-03 17:29:48 +02:00
Oliver Windall Juhl
a0c919a8d0 chore(medusa-cli): Add missing utils dep (#3688) 2023-04-03 17:18:38 +02:00
Shahed Nasser
c6bfad14d8 docs: add documentation for v1.8 (#3669) 2023-04-03 13:50:59 +02:00
Philip Korsholm
0cca13779d Fix(medusa): stocked quantity counting when listing products (#3684)
* count stocked quantity correctly when listing products

* add integration test

* add changeset
2023-04-03 11:07:56 +02:00
Kasper Fabricius Kristensen
788ddc0f43 fix(medusa, admin-ui, medusa-react): Gift Card update fixes and admin UI cleanup (#3676)
* fix gc domain issues

* add changeset

* update changeset

* more minor fixes, remove breadcrumb

* more cleanup

* address feedback
2023-04-02 19:04:32 +02:00
Philip Korsholm
a5ad6c0542 fix(admin-ui, medusa): Require name in create stock location (#3670)
* initial fix

* add changeset

* remove company from required fields
2023-04-02 11:57:41 +02:00
Philip Korsholm
eed784d7d0 fix(admin-ui, medusa): Allocations and fulfillments for variants without inventory items (#3660)
* fix fulfillment for order lines without inventory items

* fix summary card on order for variants without inventory items

* add changeset

* minor fixes

* remove variants without inventory items from allocate modal

* naming

* Update .changeset/kind-rings-wave.md

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

* remove line item indicator

* cleanup

---------

Co-authored-by: Oliver Windall Juhl <59018053+olivermrbl@users.noreply.github.com>
2023-03-31 15:53:56 +02:00
Rares Stefan
ca3b32d53c fix(admin-ui): Make copy on manage locations modal better when no locations (#3666) 2023-03-31 14:38:01 +02:00
Carlos R. L. Rodrigues
bd12a95083 chore: Initialize method for modules (#3649)
What:
- Export initialize methods for all modules to be used as a package.
- Export `runMigrations` and `revertMigration` on modules that DB migrations are available

```typescript
import {
  initialize as initializeInventory,
  InventoryServiceInitializeOptions,
  runMigrations as runMigrationsInventory,
} from "@medusajs/inventory";

import { initialize as eventBusInitialize } from "@medusajs/event-bus-redis";

import { initialize as cacheInitialize } from "@medusajs/cache-redis";

const eventBus = await eventBusInitialize({
  redisUrl: "localhost",
});

const cache = await cacheInitialize({
  redisUrl: "localhost",
});

const options: InventoryServiceInitializeOptions = {
  database: {
    type: "postgres",
    url: `postgres://postgres:@localhost/inventory`,
  },
};

await runMigrationsInventory({
  options,
});

const inventoryService = await initializeInventory(options, {
  eventBusService: eventBus,
});

const sku = "sku_123"
const item = await service.createInventoryItem({
  sku,
});

cache.set(sku, { item });

```
2023-03-31 12:09:04 +00:00