Commit Graph

48 Commits

Author SHA1 Message Date
Kasper Fabricius Kristensen
7a1e394b9d Feat/expand on list discounts (#1304) 2022-04-21 15:22:07 +02:00
Oliver Windall Juhl
9acee2799e fix(medusa): Remove unsupported Discount endpoints (#1367) 2022-04-19 13:39:49 +02:00
Philip Korsholm
b164977a19 Feat: Medusa react price list (#1258)
* export everything from price lists in core

* medusa-js price list

* feat: add product list for price lists

* feat: add product list for price lists

* add price list to admin module

* add price list hooks initial

* refactor: product list controller

* fix: add integration test for price list products

* update types

* add tests for price lists

* update medusa react tests

* update update request for price lists

* Apply suggestions from code review

Co-authored-by: Sebastian Rindom <skrindom@gmail.com>

* rename methods

* pr feedback

* list products from price list

* fix errors after merge

* update medusa react with medusa-js method name changes

* redo changes

* update hook names

* fix: routes in msw handler

Co-authored-by: Sebastian Rindom <skrindom@gmail.com>
Co-authored-by: Zakaria El Asri <zakaria.elas@gmail.com>
2022-04-03 20:48:49 +02:00
Frane Polić
b7f699654b feat: customer group customers client endpoints (#1221)
* feat: add `listCustomers` (by group) to `medusa-js`

* feat: add `useAdminCustomerGroupCustomers` hook

* fix: remove log

* fix: import/export

* fix: change query keys

* wip: sublist query keys

* fix: revert query factory changes

* fix: add query as a param when building the "detail" key

* fix: revert keys logic, use special case

* fix: query path, change batch keys

* change admin customer groups cache key generation

* spread query params

Co-authored-by: fPolic <frane@medusajs.com>
2022-03-23 20:07:13 +01:00
Frane Polić
218b20b26d fix: CustomerGroups missing features in the clients (#1159)
* feat: support for query params in customer groups retrieve method

* feat: add `useAdminDeleteCustomerGroup`hook

* fix: formatting

* fix: pass `query` object in `useAdminCustomerGroup` hook

Co-authored-by: fPolic <frane@medusajs.com>
2022-03-10 13:10:18 +01:00
Kasper Fabricius Kristensen
4e7435e4d7 fix: default POST request payloads to an empty object (#1141)
* defaulted carts.create payload to an empty object

* fix linting

* requested changes
2022-03-09 17:19:38 +01:00
Frane Polić
daf49bcaf3 feat: customer groups react hooks (#1153)
* fix: msw handlers for medusa-react storybook

* feat: add customer groups query hooks

* feat: add create/update customer groups hooks

* feat: add customer group batch  hooks

* feat: add test files, fix import

* add customer groups fixture

* add customer gorup mock endpoints

* add test cases

* add hook comments

* fix: typos

* fix: comments refactor

* fix: comment

Co-authored-by: fPolic <frane@medusajs.com>
2022-03-07 12:52:48 +01:00
Frane Polić
93426bfc02 feat: customer groups client endpoints (#1147)
* feat: WIP add customer group endpoints, fix generated type exports from api

* fix: export api types, add `list`method

* fix: export customer groups types from the `medusa-js` package

* fix: cleanup type exports from customer groups api

* feat: add customer group batch methods

* fix: refactor comments

* fix: address PR comments

Co-authored-by: fPolic <frane@medusajs.com>
2022-03-03 03:52:40 +01:00
Sebastian Rindom
c56660fca9 feat: new tax api (#979)
* feat: add tax calculation strategy (#885)

* feat: add tax calculation strategy

* fix: adds strategy loader

* fix: eslint ignore

* chore: cleanup

* fix: allow plugin overwrites

* fix: allow plugin overwrites

* fix: fake region

* Update packages/medusa/src/loaders/strategies.ts

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

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

* feat: adds tax related db entities + tax provider (#896)

* feat: adds tax related db entities + tax provider

* fix: add tax provider tests

* fix: add tax service unit tests

* fix: tests + migrations

* fix: add inherited tax lines

* chore: rm tax-line repo

* fix: test

* fix: pr comments

* fix: unit test

* feat: totals service to ts (#911)

* feat: adds tax related db entities + tax provider

* fix: add tax provider tests

* fix: add tax service unit tests

* fix: tests + migrations

* feat: totals service to ts

* fix: remove totals.js

* fix: add shipping methods

* fix: add inherited tax lines

* chore: rm tax-line repo

* fix: test

* fix: tests

* fix: tests

* fix: unit test

* fix: adds TotalsServiceProps

* feat: adds integration tests for automatic tax calculation + shipping tax rates (#945)

* feat: adds tax related db entities + tax provider

* fix: add tax provider tests

* fix: add tax service unit tests

* fix: tests + migrations

* feat: totals service to ts

* fix: remove totals.js

* fix: add shipping methods

* fix: add inherited tax lines

* chore: rm tax-line repo

* fix: test

* fix: tests

* fix: tests

* fix: unit test

* fix: integration test helpers

* fix: adds factories + tests automatic tax rates

* fix: remove verbose

* fix: adds TotalsServiceProps

* fix: add shipping tax lines

* fix: add migration for shipping taxes

* fix: integration tests for shipping taxes

* fix: integration tests for shipping taxes

* fix: jsdoc types

* Feat/manual taxes (#950)

* feat: adds tax related db entities + tax provider

* fix: add tax provider tests

* fix: add tax service unit tests

* fix: tests + migrations

* feat: totals service to ts

* fix: remove totals.js

* fix: add shipping methods

* fix: add inherited tax lines

* chore: rm tax-line repo

* fix: test

* fix: tests

* fix: tests

* fix: unit test

* fix: integration test helpers

* fix: adds factories + tests automatic tax rates

* fix: remove verbose

* fix: adds TotalsServiceProps

* fix: add shipping tax lines

* fix: add migration for shipping taxes

* fix: integration tests for shipping taxes

* fix: integration tests for shipping taxes

* fix: add integration tests for manual taxes

* fix: cart service - cleanup jsdoc

* feat: add /carts/id/taxes to manually calculate taxes

* feat: add integration tests for order tax calculations

* fix: unit tests

* fix: merge

* fix: rm verbose

* fix: unit tests

* fix: object -> cartOrOrder

* fix: rounding

* Feat/complete order w tax lines (#951)

* feat: adds tax related db entities + tax provider

* fix: add tax provider tests

* fix: add tax service unit tests

* fix: tests + migrations

* feat: totals service to ts

* fix: remove totals.js

* fix: add shipping methods

* fix: add inherited tax lines

* chore: rm tax-line repo

* fix: test

* fix: tests

* fix: tests

* fix: unit test

* fix: integration test helpers

* fix: adds factories + tests automatic tax rates

* fix: remove verbose

* fix: adds TotalsServiceProps

* fix: add shipping tax lines

* fix: add migration for shipping taxes

* fix: integration tests for shipping taxes

* fix: integration tests for shipping taxes

* fix: add integration tests for manual taxes

* fix: cart service - cleanup jsdoc

* feat: add /carts/id/taxes to manually calculate taxes

* feat: add integration tests for order tax calculations

* feat: adds cart completion strategy + create order w. tax lines

* fix: unit tests

* fix: merge

* fix: rm verbose

* fix: unit tests

* fix: unit tests

* fix: unit tests

* fix: ensure calculation for list orders

* fix: unit tests

* fix: integration tests

* fix: adds cart order type gaurds

* Docs/tax api (#954)

* feat: adds tax related db entities + tax provider

* fix: add tax provider tests

* fix: add tax service unit tests

* fix: tests + migrations

* feat: totals service to ts

* fix: remove totals.js

* fix: add shipping methods

* fix: add inherited tax lines

* chore: rm tax-line repo

* fix: test

* fix: tests

* fix: tests

* fix: unit test

* fix: integration test helpers

* fix: adds factories + tests automatic tax rates

* fix: remove verbose

* fix: adds TotalsServiceProps

* fix: add shipping tax lines

* fix: add migration for shipping taxes

* fix: integration tests for shipping taxes

* fix: integration tests for shipping taxes

* fix: add integration tests for manual taxes

* fix: cart service - cleanup jsdoc

* feat: add /carts/id/taxes to manually calculate taxes

* feat: add integration tests for order tax calculations

* feat: adds cart completion strategy + create order w. tax lines

* fix: unit tests

* fix: merge

* fix: rm verbose

* fix: unit tests

* fix: unit tests

* fix: unit tests

* fix: ensure calculation for list orders

* fix: unit tests

* fix: integration tests

* docs: documents tax related methods and types

* fix: require either item_id or shipping_method_id

* feat: product type tax rate (#969)

* feat: adds tax related db entities + tax provider

* fix: add tax provider tests

* fix: add tax service unit tests

* fix: tests + migrations

* feat: totals service to ts

* fix: remove totals.js

* fix: add shipping methods

* fix: add inherited tax lines

* chore: rm tax-line repo

* fix: test

* fix: tests

* fix: tests

* fix: unit test

* fix: integration test helpers

* fix: adds factories + tests automatic tax rates

* fix: remove verbose

* fix: adds TotalsServiceProps

* fix: add shipping tax lines

* fix: add migration for shipping taxes

* fix: integration tests for shipping taxes

* fix: integration tests for shipping taxes

* fix: add integration tests for manual taxes

* fix: cart service - cleanup jsdoc

* feat: add /carts/id/taxes to manually calculate taxes

* feat: add integration tests for order tax calculations

* feat: adds cart completion strategy + create order w. tax lines

* fix: unit tests

* fix: merge

* fix: rm verbose

* fix: unit tests

* fix: unit tests

* fix: unit tests

* fix: ensure calculation for list orders

* fix: unit tests

* fix: integration tests

* docs: documents tax related methods and types

* fix: require either item_id or shipping_method_id

* feat: adds returns tests for new tax system

* feat: adds return lines + integration tests for swaps

* feat: return integration tests

* feat: adds product type tax rates

* feat: add tax management endpoints

* fix: create single migration

* fix: adds tax rates to js client

* fix: strats

* Fix/plugin tests (#998)

* plugin testing setup

* fix: test sendgrid plugin

* fix: test sendgrid plugin

* chore: clean

* chore: clean

* fix: clean up tests

* fix: remove dirty import

* fix: sendgrid + brightpearl

* fix: plugin integration tests

* fix: klarna

* fix: shipping method tax

* fix: remove taxrates

* fix: unit tests

* fix: integration

* fix: integration

* fix: plugins tests

* fix: ignore plugins

* fix: tests

* fix: taxes (#1017)

* fix: taxes

* fix: taxes

* fix: faulty ref

* fix: create tax-lines with claim items

* fix: snapshot tax-liens

* fix: allows integration test teardown to force deleting tables

* fix: tests

* fix: merge

* fix: adds tax-rates to client

* fix: adds tax-rates to medusa-react

* fix: tests

* fix: tests

* fix: add product types

* fix: adds tax provider endpoint + cascaded deletes on tax rate relations

* fix: move errors to service layer

* fix: cleanup api

* fix: unit tests

* fix: error handler in base-service

* fix: Add order region to swap on createFulfillment (#1110)

Co-authored-by: Oliver Windall Juhl <59018053+olivermrbl@users.noreply.github.com>
2022-02-24 20:14:09 +01:00
Niel Swart
9ab0568b47 Changed medusa-client default request payload to null (#1044) 2022-02-24 12:37:23 +01:00
Adrien de Peretti
22d387dcce Feat(medusajs) Allow to pass custom headers (#1009)
* Feat(medusajs) Allow to pass custom headers

* fix: axios exprexted output

* fix: integration test cart

* refactor: Update types object > Record<string, any>

Co-authored-by: Sebastian Rindom <skrindom@gmail.com>
2022-02-17 16:50:03 +01:00
Rishi Kumar Ray
22d3d4a2f6 Mark draft order endpoint wrong in medusa-js (#1046) 2022-02-16 12:59:16 +01:00
Oliver Windall Juhl
7ae754bb61 fix: use /admin/returns/:id/receive for swap returns (#1041) 2022-02-15 14:15:00 +01:00
Sebastian Rindom
3bf32e5dc9 fix: adds order by functionality to products (#1021)
* fix: adds order by functionality to products

* feat: adds product tags list

* fix: adds client and react support for product tags

* fix: unit test

* Update packages/medusa/src/services/product-tag.ts

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

* Update packages/medusa/src/services/product-tag.ts

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

* Update packages/medusa/src/services/product-tag.ts

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

* Update packages/medusa/src/services/product-tag.ts

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

* Update packages/medusa/src/services/product-tag.ts

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

* Update packages/medusa/src/services/product-tag.ts

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

Co-authored-by: Oliver Windall Juhl <59018053+olivermrbl@users.noreply.github.com>
2022-02-03 19:03:15 +01:00
Zakaria El Asri
2e384842d5 feat: medusa-react admin hooks (#978)
* add: medusa admin hooks + tests

* fix: remove unneeded props

* fix: deps

* fix: deps

* fix: deps

* fix: failing tests

* fix: failing tests

* fix: query key

* add: yarn workspaces

* fix: linting medusa-react

* fix: add prepare script

* fix: buildOptions

* fix: useAdminShippingOptions query

* fix: use qs instead for query params (#1019)

* fix: formatting

* debug: ci pipeline

* debug: log node_modules structure

* debug: use lerna bootstrap

* debug: update node version

* debug: print pkgs in workspace

* debug: print pkgs in workspace

* debug: print pkgs in workspace

* debug: print pkgs in workspace

* debug: add explicit build step

* fix: jsdoc

* debug: run build step

* debug: fix build errors

* debug: add build step to integration tests

* fix: failing test

* cleanup

Co-authored-by: Sebastian Rindom <seb@medusajs.com>
Co-authored-by: Sebastian Rindom <skrindom@gmail.com>
2022-02-02 17:10:56 +01:00
Adrien de Peretti
f115855282 Fix(request) retries is broken (#1005)
At the moment, when the method `shouldRetryCondition` is called, the condition are using OR which does not take in count 0 which is also considered as false
a simple fix is the usage of nullish coalescing
2022-02-01 17:25:16 +01:00
Zakaria El Asri
7cc3640796 fix: medusa-js admin endpoint types (#968) 2022-01-07 11:44:59 +01:00
Adrien de Peretti
0ac52b70fa fix: Type in AdminProductListTagsRes to use tags instead of types (#958) 2022-01-06 17:45:15 +01:00
Philip Korsholm
5754534beb Feat: Client admin uploads (#952)
* convert uploads to ts

* add custom headers to request

* uploads resource

* uploads routes updates

* index export

* add oas

* remove delete uploads endpoint

* add new package for form-data

* remove exports for delete upload endpoint

* remove dev package from medusa-js

* automatic package upgrade of medusa
2022-01-04 16:18:17 +01:00
Zakaria El Asri
2efab08040 fix: client admin endpoints (#956) 2021-12-25 13:57:07 +01:00
Philip Korsholm
f405e9c874 notifications client (#949) 2021-12-20 14:09:12 +01:00
Philip Korsholm
e0be2da15e Feat: Client admin products (#930)
* add exports in product

* add product resource

* fix failling tests

* import reflect metadata

Co-authored-by: Oliver Windall Juhl <59018053+olivermrbl@users.noreply.github.com>
2021-12-17 12:30:04 +01:00
Philip Korsholm
59e268b919 Feat: Add users endpoint to medusajs (#925)
* add users endpoint to medusajs

* add exports to medusa

* use native omit

Co-authored-by: Sebastian Rindom <seb@medusajs.com>
2021-12-16 16:22:40 +01:00
Zakaria El Asri
31fad7439c feat: add store admin endpoints to medusa-js (#938)
* add: store admin endpoint to medusa-js

* add: resource to admin class

Co-authored-by: Sebastian Rindom <seb@medusajs.com>
Co-authored-by: Oliver Windall Juhl <59018053+olivermrbl@users.noreply.github.com>
2021-12-16 16:14:58 +01:00
Zakaria El Asri
b9d6f95dbd feat: add returns admin endpoints to medusa-js (#935)
* add: returns admin endpoint to medusa-js

* fix: http verbs

* fix duplicate import

* fix: type for cancel

* fix: conflicting import

Co-authored-by: Sebastian Rindom <seb@medusajs.com>
2021-12-16 15:10:41 +01:00
Zakaria El Asri
8b1b551260 feat: medusa js admin shipping options (#934)
* add: shipping-options admin endpoint to medusa-js

* fix: retrieve return type for Collections

* fix typo in routes

Co-authored-by: Sebastian Rindom <seb@medusajs.com>
2021-12-16 14:55:03 +01:00
Philip Korsholm
01b915585b Feat/client admin orders (#932)
* add export to medusa index

* add orders to medusa-client

* correct update entity

* add orders to admin resource

Co-authored-by: Sebastian Rindom <seb@medusajs.com>
2021-12-16 14:43:16 +01:00
Zakaria El Asri
0acc462e1e feat: medusa-js admin return reasons (#931)
* add: return-reasons admin endpoint to medusa-js

* fix types

* fix jsdoc

* fix typo jsdoc collection

Co-authored-by: Sebastian Rindom <seb@medusajs.com>
2021-12-16 14:34:14 +01:00
Zakaria El Asri
8532c966b5 feat: medusa js admin regions (#939) 2021-12-16 14:30:03 +01:00
Philip Korsholm
3da46723a0 Feat: add variants to medusa client (#927) 2021-12-16 14:28:54 +01:00
Philip Korsholm
f5d3e4de10 swaps in admin resources (#928) 2021-12-15 16:57:39 +01:00
Philip Korsholm
b70df6be94 Feat: client admin shipping profiles (#929)
* shipping profiles resource

* spelling
2021-12-15 14:21:43 +01:00
Zakaria El Asri
d0d8dd7bf6 feat: add medusa-react (#913) 2021-12-14 19:09:36 +01:00
Philip Korsholm
40f6e88875 Feat/medusa js admin collections (#916)
* feat: Add Auth Admin routes to JS client

* include api key verification for admin

* add admin/collections to medusa-js

* undo file changes

* jsdoc

Co-authored-by: olivermrbl <oliver@mrbltech.com>
2021-12-14 17:33:55 +01:00
Philip Korsholm
fee4e46ea7 Feat/client authentication api key (#915)
* feat: Add Auth Admin routes to JS client

* include api key verification for admin

* undo changes

* undo file changes

* improve api key auth

* auth documentation in readme

* pr feedback

* typo

Co-authored-by: olivermrbl <oliver@mrbltech.com>
2021-12-14 16:55:20 +01:00
Oliver Windall Juhl
85ef51ad34 Adds admin giftcard API to medusa-js (#921) 2021-12-14 16:06:39 +01:00
Oliver Windall Juhl
006e67eea1 Adds admin invites API to medusa-js (#922) 2021-12-14 15:34:23 +01:00
Oliver Windall Juhl
4ffe50a798 Adds admin notes API to medusa-js (#923) 2021-12-14 15:27:31 +01:00
Oliver Windall Juhl
7f4a7cbed0 Adds DraftOrder Admin routes to JS client (#920) 2021-12-14 09:48:16 +01:00
Oliver Windall Juhl
2ca1a8762d feat: Add Discount Admin endpoint to JS client (#919) 2021-12-14 09:47:15 +01:00
Oliver Windall Juhl
25fe224a10 feat: Adds Customer Admin routes to JS client (#918) 2021-12-13 21:32:47 +01:00
Oliver Windall Juhl
5c47184b10 feat: Adds Auth Admin API to medusa-js (#917) 2021-12-13 19:35:57 +01:00
Zakaria El Asri
2e837fcdee fix: complete cart return type (#902) 2021-12-08 22:37:13 +01:00
Zakaria El Asri
487356a96f fix: medusa-js complete cart types + oas comments (#889) 2021-12-07 11:02:53 +01:00
Zakaria El Asri
e0064026ed fix: update payment session route (#887) 2021-12-07 10:11:03 +01:00
Zakaria El Asri
ded496cee5 fix: medusa-js fine-tuning (#836) 2021-11-22 23:30:36 +01:00
Sebastian Rindom
5fa4848b17 fix: release 2021-11-19 10:50:47 +01:00
Oliver Windall Juhl
373532ecbc feat: Typescript for API layer (#817)
Co-authored-by: Philip Korsholm <88927411+pKorsholm@users.noreply.github.com>
Co-authored-by: Zakaria El Asri <33696020+zakariaelas@users.noreply.github.com>
Co-authored-by: Kasper Fabricius Kristensen <45367945+kasperkristensen@users.noreply.github.com>
Co-authored-by: Philip Korsholm <philip.korsholm@hotmail.com>
Co-authored-by: Sebastian Rindom <seb@medusa-commerce.com>
2021-11-18 15:19:17 +01:00