feat(medusa-js, medusa-react, medusa): Prepare API for admin implementations (#3110)

********What********
Add `joinSalesChannels util to stock locations

Add the following endpoints to medusa-react
- inventory items
    - mutations
        - update
        - delete
        - update location level
        - delete location level
        - create location level
    - queries
        - list inventory items
        - get inventory item
        - list location levels
- Stock locations
    - mutations
        - create stock location
        - update stock location
        - delete stock location
    - queries
        - list stock locations
        - get stock locatoin
- Variants
    - queries
        - get inventory
- Reservations
    - mutations
        - create reservation
        - update reservation
        - delete reservation
    - queries
        - list reservations
        - get reservation
- sales channels 
  - mutations
    - associate location with sc
    - remove location association

**Why**
- Update clients to reflect new api endpoints in the core with inventory modules

Co-authored-by: Philip Korsholm <88927411+pKorsholm@users.noreply.github.com>
This commit is contained in:
Rares StefanandPhilip Korsholm authored and GitHub committed 2023-02-16 08:49:48 +00:00
1 parent 121b42acfe
commit 12d304307a
48 files changed
+1756 -57

No files matched your search

@@ -1140,6 +1140,46 @@
"updated_at": "2021-03-17 12:09:59.156058+01",
"metadata": null
},
"inventory_item": {
"id": "iitem_320ZXDBAB4WJVW6115VEM7",
"sku": "sku123",
"origin_country": "dk",
"hs_code": null,
"mid_code": null,
"material": null,
"weight": 10,
"lenght": 4,
"height": 5,
"width": 2,
"requires_shipping": true,
"created_at": "2021-03-17 11:58:56.975971+01",
"updated_at": "2021-03-17 12:09:59.156058+01",
"metadata": null,
"location_levels": [
{
"id": "ilev_320ZXDBAB4WJVW6115VEM7",
"inventory_item_id": "iitem_320ZXDBAB4WJVW6115VEM7",
"location_id": "loc_01F0ZXDBAB9KVZWJVW6115VEM7",
"stocked_quantity": 1,
"reserved_quantity": 0,
"incoming_quantity": 10
}
]
},
"stock_location": {
"id": "loc_01F0ZXDBAB9KVZWJVW6115VEM7",
"name": "Stock location 1",
"address_id": "addr_01F0ZXDBAB9KVZWJVW6115VEM7",
"created_at": "2021-03-17 11:58:56.975971+01",
"updated_at": "2021-03-17 12:09:59.156058+01"
},
"reservation": {
"id": "res_01F0ZXDBAB9KVZWJVW6115VEM7",
"line_item_id": "li_01F0ZXDBAB9KVZWJVW6115VEM7",
"inventory_item_id": "iitem_320ZXDBAB4WJVW6115VEM7",
"location_id": "loc_01F0ZXDBAB9KVZWJVW6115VEM7",
"quantity": 1
},
"invite": {
"id": "invite_320ZXDBAB4WJVW6115VEM7",
"user_email": "lebron@james.com",