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>
This commit is contained in:
Zakaria El Asri
2022-02-02 17:10:56 +01:00
committed by GitHub
co-authored by Sebastian Rindom Sebastian Rindom
parent 24175025d1
commit 2e384842d5
209 changed files with 27917 additions and 2727 deletions
@@ -556,6 +556,7 @@
"user": {
"id": "admin_user",
"email": "admin@medusa.js",
"role": "admin",
"first_name": null,
"last_name": null,
"api_token": "test_token",
@@ -1050,6 +1051,175 @@
"updated_at": "2021-03-17 12:09:59.156058+01",
"metadata": null,
"parent_return_reason_id": null
},
"product_type": {
"id": "ptype_ZXDBABWJVW6115VEMZXDBAB",
"value": "clothing",
"created_at": "2021-03-16T21:24:35.828Z",
"updated_at": "2021-03-16T21:24:35.828Z",
"deleted_at": null,
"metadata": null
},
"product_tag": {
"id": "ptag_ZXDBABWJVW6115VEMZXDBAB",
"value": "pants",
"created_at": "2021-03-16T21:24:35.828Z",
"updated_at": "2021-03-16T21:24:35.828Z",
"deleted_at": null,
"metadata": null
},
"note": {
"id": "note_01F0ZXDBAB9KVZWJVW6115VEM7",
"value": "customer contacted",
"resource_type": "swap",
"resource_id": "swap_01F0YET86Y9G92D3YDR9Y6V676",
"author_id": "admin_user",
"created_at": "2021-03-17 11:58:56.975971+01",
"updated_at": "2021-03-17 12:09:59.156058+01",
"metadata": null
},
"invite": {
"id": "invite_320ZXDBAB4WJVW6115VEM7",
"user_email": "lebron@james.com",
"role": "admin",
"accepted": true,
"token": "secret_token",
"expires_at": "2021-03-18 11:58:56.975971+01",
"created_at": "2021-03-17 11:58:56.975971+01",
"updated_at": "2021-03-17 12:09:59.156058+01",
"metadata": null
},
"draft_order": {
"id": "dorder_01FGKMYKMJ4E8HP3RGEW28E7CZ",
"status": "open",
"display_id": 1,
"cart_id": "cart_01FGKMYKM9V8FVEJE23Q26FG5B",
"cart": {
"id": "cart_01FGKMYKM9V8FVEJE23Q26FG5B",
"email": "jane@medusa.test",
"billing_address_id": null,
"billing_address": null,
"shipping_address_id": "addr_01FGKMYKKQ3S1Q4ZC9HV4REXC6",
"shipping_address": {
"id": "addr_01FGKMYKKQ3S1Q4ZC9HV4REXC6",
"customer_id": null,
"company": null,
"first_name": "Jane",
"last_name": "Medusan",
"address_1": null,
"address_2": null,
"city": null,
"country_code": "dk",
"province": null,
"postal_code": null,
"phone": null,
"created_at": "2021-09-27T12:51:21.335Z",
"updated_at": "2021-09-27T12:51:21.335Z",
"deleted_at": null,
"metadata": null
},
"items": [
{
"id": "item_01FGKMYKM9AKV5D146N28QFPX7",
"cart_id": "cart_01FGKMYKM9V8FVEJE23Q26FG5B",
"order_id": null,
"swap_id": null,
"claim_order_id": null,
"title": "Basic Tee - One Size",
"description": "Soft and sweet",
"thumbnail": "https://test.js/1234",
"is_giftcard": false,
"should_merge": true,
"allow_discounts": true,
"has_shipping": null,
"unit_price": 8000,
"variant_id": "variant_01FGKMYKJVY3DYDZWCRB2GZS0G",
"variant": {
"id": "variant_01FGKMYKJVY3DYDZWCRB2GZS0G",
"title": "One Size",
"product_id": "prod_01FGKMYKJJMZ6XFN37JBGTZ46G",
"sku": null,
"barcode": null,
"ean": null,
"upc": null,
"inventory_quantity": 1,
"allow_backorder": false,
"manage_inventory": true,
"hs_code": null,
"origin_country": null,
"mid_code": null,
"material": null,
"weight": null,
"length": null,
"height": null,
"width": null,
"created_at": "2021-09-27T12:51:21.307Z",
"updated_at": "2021-09-27T12:51:21.307Z",
"deleted_at": null,
"metadata": null
},
"quantity": 1,
"fulfilled_quantity": 1,
"returned_quantity": null,
"shipped_quantity": null,
"created_at": "2021-09-27T12:51:21.352Z",
"updated_at": "2021-09-27T12:51:21.352Z",
"metadata": null
}
],
"region_id": "reg_01FGKMYKKG6ACZANRNHR3XVRN3",
"region": {
"id": "reg_01FGKMYKKG6ACZANRNHR3XVRN3",
"name": "United States",
"currency_code": "usd",
"tax_rate": "0",
"tax_code": null,
"payment_providers": [
{
"id": "test-pay",
"is_installed": true
}
],
"fulfillment_providers": [],
"created_at": "2021-09-27T12:51:21.328Z",
"updated_at": "2021-09-27T12:51:21.328Z",
"deleted_at": null,
"metadata": null
},
"discounts": [],
"gift_cards": [],
"customer_id": "cus_01FGKMYKM2TAKTGZ1XMEW45RJZ",
"payment_sessions": [],
"payment_id": null,
"payment": null,
"shipping_methods": [],
"type": "draft_order",
"completed_at": null,
"payment_authorized_at": null,
"created_at": "2021-09-27T12:51:21.352Z",
"updated_at": "2021-09-27T12:51:21.352Z",
"deleted_at": null,
"metadata": null,
"idempotency_key": null,
"context": null,
"shipping_total": 0,
"discount_total": 0,
"tax_total": 0,
"gift_card_total": 0,
"subtotal": 8000,
"total": 8000
},
"order_id": null,
"order": null,
"canceled_at": null,
"created_at": "2021-09-27T12:51:21.360Z",
"updated_at": "2021-09-27T12:51:21.360Z",
"no_notification_order": null,
"metadata": null
},
"fulfillment_option": {
"provider_id": "test-ful",
"options": []
}
}
}