@mercurjs/vendor 2.1.6 → 2.2.0-canary.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/[id]-A55T2ORL.js +3066 -0
- package/dist/[id]-B4YZTANM.js +1571 -0
- package/dist/{[id]-UTKO3VG4.js → [id]-EKLRGVBA.js} +10 -10
- package/dist/{[id]-TO6KT3ZE.js → [id]-FE5GYYVZ.js} +28 -25
- package/dist/{[id]-4VCL3MMM.js → [id]-GBT6VB4S.js} +29 -23
- package/dist/{[id]-3G5G7ZFV.js → [id]-GC3ZYPK4.js} +25 -22
- package/dist/{[id]-6PXEWRG7.js → [id]-J6BZG5PU.js} +14 -14
- package/dist/{[id]-B3LHVQM5.js → [id]-QOEO3JOV.js} +29 -23
- package/dist/{[id]-H3C3ZSC6.js → [id]-QQU5HVFU.js} +29 -23
- package/dist/{[id]-PDGHF5J2.js → [id]-SHAJTJNZ.js} +43 -36
- package/dist/{[id]-X4DDKOMQ.js → [id]-T5ECVBPF.js} +30 -24
- package/dist/{[id]-T2ROPEGY.js → [id]-U5KZEQDR.js} +7 -7
- package/dist/{[id]-7RUAH3TI.js → [id]-YPCO3DJV.js} +5 -5
- package/dist/{[id]-Y7GAMNC5.js → [id]-ZCMSBEVM.js} +4 -4
- package/dist/{[location_id]-D55RQOXT.js → [location_id]-NUBXDDJC.js} +9 -9
- package/dist/{[province_id]-OFH2ZOFQ.js → [province_id]-6GUA4PV5.js} +23 -20
- package/dist/{add-C6OX5C54.js → add-NTRYWOJF.js} +42 -35
- package/dist/add-RU3WL4YB.js +428 -0
- package/dist/{add-customer-groups-PJRJUWS2.js → add-customer-groups-U5RZWW4B.js} +19 -16
- package/dist/{add-products-INOLNPO6.js → add-products-Q4MMDQKT.js} +26 -20
- package/dist/{add-promotions-AHDOP52Q.js → add-promotions-3AYXQXTP.js} +8 -8
- package/dist/{add-to-campaign-HL6NGRR4.js → add-to-campaign-QKYQCSR2.js} +4 -4
- package/dist/{address-KRENKSLP.js → address-77Y3AOQ3.js} +19 -16
- package/dist/{adjust-inventory-H4EUP7J3.js → adjust-inventory-AFJLWF5R.js} +2 -2
- package/dist/{allocate-items-SUCUZU4D.js → allocate-items-TCM5A55Y.js} +141 -126
- package/dist/{areas-UUMZDXLX.js → areas-XUC5V5UO.js} +8 -8
- package/dist/{attributes-CALEHJJG.js → attributes-SZP2MM5L.js} +3 -3
- package/dist/{breadcrumb-KQSFIXQ4.js → breadcrumb-2XA2WOK7.js} +1 -1
- package/dist/{breadcrumb-IG7VZGW2.js → breadcrumb-5NP23D6X.js} +15 -12
- package/dist/{breadcrumb-TW5JEOYS.js → breadcrumb-EVZIOB2G.js} +14 -11
- package/dist/{breadcrumb-OIGGCB3L.js → breadcrumb-FPWBT76A.js} +8 -2
- package/dist/{breadcrumb-BS7Y5OKF.js → breadcrumb-IK6XCQOQ.js} +2 -2
- package/dist/{breadcrumb-M5Z5WA6I.js → breadcrumb-KTARIL65.js} +2 -2
- package/dist/{breadcrumb-VNNZ3TTW.js → breadcrumb-PBR27GGX.js} +3 -3
- package/dist/breadcrumb-THJ2HPRB.js +26 -0
- package/dist/{breadcrumb-6W2VP3OZ.js → breadcrumb-TNJSGX4T.js} +15 -12
- package/dist/{campaigns-HS6MIO7X.js → campaigns-JAQTSA4Z.js} +6 -6
- package/dist/{categories-PKWR3FM3.js → categories-T4QJYX4R.js} +8 -8
- package/dist/{chunk-4URLUCTD.js → chunk-25E4KME5.js} +3 -3
- package/dist/chunk-27KRIXMQ.js +71 -0
- package/dist/{chunk-SFQKKIHA.js → chunk-27WLUOI2.js} +1 -1
- package/dist/{chunk-ZYOXKUKZ.js → chunk-2QTNCGKX.js} +1 -1
- package/dist/{chunk-5UD4P6YL.js → chunk-2USXZSTK.js} +4 -4
- package/dist/{chunk-PXYDR7WQ.js → chunk-3BXCPHN6.js} +3 -2
- package/dist/{chunk-VQ5EKDA3.js → chunk-3PMM6AMP.js} +3 -3
- package/dist/{chunk-J6BRLL3F.js → chunk-463CNCJC.js} +3 -3
- package/dist/{chunk-Y2QI7KWS.js → chunk-4LVP635F.js} +408 -664
- package/dist/{chunk-UL4O5M4S.js → chunk-4S6XGIC6.js} +1 -18
- package/dist/{chunk-RUE5BPC2.js → chunk-5QI3NDJG.js} +1 -1
- package/dist/{chunk-PPLC4IKI.js → chunk-5T6UWTRU.js} +10 -5
- package/dist/{chunk-WITQNQXN.js → chunk-6FUIK3PX.js} +4 -4
- package/dist/{chunk-HGQTL7NX.js → chunk-6K6EQOJF.js} +3 -3
- package/dist/{chunk-KAZ5BYTQ.js → chunk-6OUPJNYO.js} +5 -3
- package/dist/{chunk-PEKANQ3T.js → chunk-6UZERVBI.js} +2 -2
- package/dist/{chunk-RTAWYMQP.js → chunk-7CMRFP5Q.js} +2 -2
- package/dist/{chunk-I2IKYOZX.js → chunk-7IPCLQ5V.js} +19 -19
- package/dist/chunk-ADGVQVHP.js +101 -0
- package/dist/{chunk-IZ5RG5XI.js → chunk-AJLGY3LQ.js} +1 -21
- package/dist/chunk-BER45EYD.js +82 -0
- package/dist/{chunk-PCMNEUMV.js → chunk-BXRNZS5K.js} +1 -1
- package/dist/chunk-CFRWIQIZ.js +43 -0
- package/dist/{chunk-RL7SFZOF.js → chunk-DDJQRV6E.js} +1 -1
- package/dist/{chunk-D2MA5TAP.js → chunk-DO4F5FIO.js} +2 -2
- package/dist/{chunk-X4FLOQ45.js → chunk-DQKK43PR.js} +3 -3
- package/dist/{chunk-6WY5X4PE.js → chunk-E6W57UP3.js} +35 -125
- package/dist/chunk-FP6U6BPH.js +61 -0
- package/dist/chunk-FWPGOIFA.js +22 -0
- package/dist/{chunk-BLVJAKBA.js → chunk-FWS4YJ4B.js} +1 -1
- package/dist/chunk-GAE6TKOR.js +811 -0
- package/dist/{chunk-3CK6OINO.js → chunk-GDWBOQI5.js} +3 -5
- package/dist/{chunk-PDQSPKG5.js → chunk-GN6KB75Z.js} +1 -1
- package/dist/chunk-HDEOZN2Q.js +60 -0
- package/dist/chunk-IBEUR3J7.js +173 -0
- package/dist/chunk-J6XCRFBW.js +30 -0
- package/dist/{chunk-ZEVYT6IX.js → chunk-JAUZ73XE.js} +151 -266
- package/dist/{chunk-CNLP35S7.js → chunk-K6LOZ4S3.js} +54 -18
- package/dist/{chunk-JQP7MOFH.js → chunk-KIFSQOM2.js} +2 -2
- package/dist/{chunk-DARJTN4I.js → chunk-L4KBTV57.js} +9 -2
- package/dist/chunk-L57USMYC.js +39 -0
- package/dist/chunk-LARLBYU6.js +127 -0
- package/dist/chunk-LDZCCWJB.js +518 -0
- package/dist/chunk-LEWA4BPH.js +18 -0
- package/dist/chunk-LFX6WU4A.js +36 -0
- package/dist/{chunk-ITI54CII.js → chunk-LKUW5SV4.js} +6 -6
- package/dist/{chunk-LPOAVK6Y.js → chunk-LQD232FW.js} +47 -12
- package/dist/{chunk-4MFMCZEJ.js → chunk-MJCL3WID.js} +2 -2
- package/dist/{chunk-32RYSB2V.js → chunk-NBKWY6XN.js} +2 -2
- package/dist/{chunk-GYV6SKY7.js → chunk-O7VOGTLX.js} +4 -6
- package/dist/{chunk-KQGVSLUI.js → chunk-OYKUQXJX.js} +1926 -957
- package/dist/{chunk-CYTNBXWF.js → chunk-OZ44ATGE.js} +8 -8
- package/dist/{chunk-7Q5SDEK7.js → chunk-PAVZ6FPK.js} +7 -7
- package/dist/{chunk-2RHAI7WK.js → chunk-QLBIBLOY.js} +2 -2
- package/dist/chunk-RXV7INUV.js +426 -0
- package/dist/chunk-S23FD6FA.js +210 -0
- package/dist/{chunk-NYDJTWRL.js → chunk-SGR4DMCW.js} +4 -4
- package/dist/{chunk-OXXL4WQU.js → chunk-SPOHNK4X.js} +6 -6
- package/dist/{chunk-AIF2KTEE.js → chunk-SSUUT5LK.js} +12 -2
- package/dist/{chunk-QX45GVAL.js → chunk-SZBERGA4.js} +8 -8
- package/dist/{chunk-6SBMVLJ2.js → chunk-T5MJWWDX.js} +2 -2
- package/dist/chunk-T6LHVNWO.js +27 -0
- package/dist/chunk-TBYCZRZ7.js +248 -0
- package/dist/chunk-TF6V3TFG.js +438 -0
- package/dist/chunk-TW324MAT.js +185 -0
- package/dist/{chunk-4ZGFODSC.js → chunk-TYESCFYW.js} +1 -1
- package/dist/chunk-U5G3AVED.js +64 -0
- package/dist/chunk-U6PBLMXD.js +14 -0
- package/dist/{chunk-GZMXTNDN.js → chunk-UCYSCKZV.js} +1432 -1380
- package/dist/{chunk-P3ZTO6T2.js → chunk-UFFVRF4V.js} +2 -2
- package/dist/chunk-UM7ZR3VU.js +14 -0
- package/dist/chunk-UORPTGV2.js +114 -0
- package/dist/{chunk-5M3SL4UZ.js → chunk-VCOQ7WQ2.js} +30 -106
- package/dist/chunk-VCUUITW6.js +35 -0
- package/dist/{chunk-PTW7JNAP.js → chunk-VDHW6H5F.js} +5 -5
- package/dist/chunk-VZUA5SRD.js +62 -0
- package/dist/{chunk-DKQ4XMSN.js → chunk-X4GWB6AT.js} +6 -6
- package/dist/{chunk-6YA3C4NB.js → chunk-XCIMOIX6.js} +3 -12
- package/dist/chunk-XP23ZVQT.js +2183 -0
- package/dist/{chunk-WBI7FEGI.js → chunk-Y2MQ5EMD.js} +29 -24
- package/dist/chunk-YBF45CX5.js +23 -0
- package/dist/{chunk-N7OVXN72.js → chunk-YGJCJBPM.js} +1 -1
- package/dist/{chunk-WNVEMFIK.js → chunk-YHIJCI4U.js} +3 -3
- package/dist/{chunk-WFE6CT6M.js → chunk-YQZBAP3S.js} +22 -76
- package/dist/chunk-ZHFFTT3I.js +17 -0
- package/dist/{collections-DJZI2RM2.js → collections-URH2TCWJ.js} +28 -24
- package/dist/{configuration-GN3TO77H.js → configuration-7IYZ6GNP.js} +3 -3
- package/dist/{configuration-RHPIO2QT.js → configuration-C4IGBNXH.js} +1 -1
- package/dist/{create-7S7CZWEN.js → create-5PSOIHIT.js} +4 -4
- package/dist/create-7R6CZU53.js +215 -0
- package/dist/{create-3EK5CNNX.js → create-A7B3MLJX.js} +41 -34
- package/dist/create-F5R76QML.js +1178 -0
- package/dist/create-FKRYB7ZS.js +1784 -0
- package/dist/create-GGACODDN.js +1914 -0
- package/dist/{create-YO55Z3YD.js → create-HVZYJ3YC.js} +35 -38
- package/dist/{create-IDVCZHIX.js → create-JF2OUZQA.js} +16 -13
- package/dist/{create-3ZVXEPX5.js → create-JGYG5SBM.js} +29 -23
- package/dist/{create-G4T2PAJH.js → create-MS6KKFSV.js} +21 -18
- package/dist/{create-OCFPLNNY.js → create-MZYXMGKP.js} +6 -6
- package/dist/{create-HKJVSFB7.js → create-O35JRZEF.js} +25 -22
- package/dist/{create-OGLPDVOI.js → create-ODOFJF5N.js} +40 -37
- package/dist/{create-GHM7OTCR.js → create-R7K3ECN6.js} +1 -1
- package/dist/{create-D6EW3EWC.js → create-SFU3W3ZH.js} +1 -1
- package/dist/create-TKXH5KQY.js +239 -0
- package/dist/{create-33TRLASX.js → create-UPYB65PD.js} +1 -1
- package/dist/{create-KGYL7FBM.js → create-XVHOCZHJ.js} +1 -1
- package/dist/{create-4AE3VTWN.js → create-YBF4YGWG.js} +2 -2
- package/dist/{customers-6ZLE65UX.js → customers-SOLJ2KQQ.js} +5 -5
- package/dist/{edit-QBISX7D3.js → edit-2R5QCPTB.js} +16 -13
- package/dist/{edit-IR6V2IDN.js → edit-3E4ZO7HT.js} +21 -18
- package/dist/{edit-ZSOI56BQ.js → edit-4G5D7TES.js} +52 -40
- package/dist/{edit-B5B3XKDM.js → edit-522DG3BY.js} +1 -1
- package/dist/{edit-B75KK5ZX.js → edit-5CROKEJE.js} +41 -34
- package/dist/{edit-ATXE6CM5.js → edit-C4OCKQVU.js} +1 -1
- package/dist/{edit-7HTH2UJF.js → edit-FXNXTVIW.js} +3 -3
- package/dist/{edit-RNT555GP.js → edit-G2E5SNGU.js} +15 -12
- package/dist/{edit-4HZHLYI3.js → edit-GQNIINRR.js} +1 -1
- package/dist/{edit-2KRJIPRK.js → edit-HTLLYECP.js} +21 -18
- package/dist/{edit-LRRJTHV2.js → edit-KAKVPHZZ.js} +1 -1
- package/dist/{edit-GIJXLMC3.js → edit-O4JLGKQR.js} +2 -2
- package/dist/{edit-FNDDSSMT.js → edit-OKU6FMHJ.js} +60 -9
- package/dist/{edit-5CJZRHAA.js → edit-ORXS3A2Y.js} +1 -1
- package/dist/{edit-FC64DWB2.js → edit-Q3UQIOLS.js} +1 -1
- package/dist/edit-VVLITC2E.js +910 -0
- package/dist/edit-XSICGAVO.js +176 -0
- package/dist/{edit-7GVP6SRA.js → edit-ZAHCMF5U.js} +1 -1
- package/dist/{edit-MYSWY6W4.js → edit-ZMERG3L7.js} +1 -1
- package/dist/{edit-budget-J27CSEZH.js → edit-budget-L3CCEWNF.js} +1 -1
- package/dist/{edit-inventory-item-US77M2FF.js → edit-inventory-item-ZKXXL3QK.js} +2 -2
- package/dist/{edit-inventory-item-attributes-UGAE2NAZ.js → edit-inventory-item-attributes-GSKUMORD.js} +3 -3
- package/dist/{fulfillment-DCS67LTK.js → fulfillment-76IVZ266.js} +32 -22
- package/dist/{fulfillment-providers-GM5PO6N3.js → fulfillment-providers-G2L6LEVO.js} +24 -20
- package/dist/index.css +104 -65
- package/dist/index.d.ts +3 -10
- package/dist/index.js +549 -456
- package/dist/{inventory-OPZ2FSEE.js → inventory-WSFLTA6Z.js} +7 -7
- package/dist/{invite-KEJLNXEZ.js → invite-2673PU4I.js} +17 -13
- package/dist/{invite-CQCKEQW2.js → invite-HRXZ5YBP.js} +28 -24
- package/dist/loader-VDYPD3RI.js +31 -0
- package/dist/{locations-ZVPTQCQY.js → locations-INS6FTMJ.js} +4 -4
- package/dist/{login-OUHRNNXA.js → login-TWUBU6I6.js} +14 -11
- package/dist/{manage-locations-YUKEFCBJ.js → manage-locations-XHH5DVIR.js} +2 -2
- package/dist/{media-4KYFHB5V.js → media-Z4N5MKFG.js} +42 -9
- package/dist/{metadata-AWUKZ25V.js → metadata-5BPOBBU2.js} +3 -3
- package/dist/{metadata-OCE6A3JE.js → metadata-D6M66NQK.js} +17 -14
- package/dist/{metadata-PYY4IB7K.js → metadata-NIDIBXJT.js} +17 -14
- package/dist/{metadata-XP3ZYW2M.js → metadata-Q74OJWUD.js} +18 -15
- package/dist/{metadata-NYYL26MQ.js → metadata-REQIFWWH.js} +18 -15
- package/dist/{metadata-G7KZXVNE.js → metadata-YVHJPDLD.js} +17 -14
- package/dist/offer-create-page-E4FLSDJQ.js +743 -0
- package/dist/offer-detail-page-6SIBQTLP.js +492 -0
- package/dist/offer-edit-page-3MO566RP.js +151 -0
- package/dist/offer-inventory-batch-page-BD6PMDLW.js +290 -0
- package/dist/offer-pricing-edit-page-4TINK42V.js +199 -0
- package/dist/offers-GVN5LCK6.js +32 -0
- package/dist/{onboarding-WXZHW62K.js → onboarding-MK2RIFD4.js} +24 -21
- package/dist/{orders-LWJ472VM.js → orders-TVQDR4OJ.js} +30 -26
- package/dist/organization-XO3T2K2X.js +340 -0
- package/dist/{organize-RFOMQCBG.js → organize-5XRZWD5C.js} +4 -4
- package/dist/{organize-OVKJ3HZO.js → organize-Z7JTTDH4.js} +4 -4
- package/dist/pages/index.d.ts +439 -758
- package/dist/pages/index.js +85 -78
- package/dist/{payment-details-UVXYCTUK.js → payment-details-CFTX3QDL.js} +19 -16
- package/dist/{payouts-TR7K5I37.js → payouts-7Q7D4FET.js} +8 -8
- package/dist/{price-lists-S2WNELFZ.js → price-lists-6TFLA53G.js} +9 -9
- package/dist/{pricing-UF27DAXA.js → pricing-ECXV6K7G.js} +41 -37
- package/dist/{product-tags-2CKH2M6D.js → product-tags-5O7ZG6SA.js} +40 -33
- package/dist/{product-types-FX43JEO2.js → product-types-PKUEL7X5.js} +6 -6
- package/dist/product-variant-detail-PUWOMVHQ.js +210 -0
- package/dist/{product-variant-edit-P3DSIFE3.js → product-variant-edit-WZNO4CQX.js} +134 -66
- package/dist/{products-H5EMRJYS.js → products-BM3IIH5P.js} +27 -21
- package/dist/{products-2LHGS7X3.js → products-CPTRYL2Z.js} +44 -45
- package/dist/{professional-details-HYKTH44B.js → professional-details-ED4HNYXY.js} +18 -15
- package/dist/{profile-PB27WIRW.js → profile-6TGCNNUU.js} +21 -18
- package/dist/{promotions-5EYPGHJP.js → promotions-4336KI7E.js} +9 -9
- package/dist/receive-224KLULH.js +578 -0
- package/dist/refund-IGMSXQNX.js +268 -0
- package/dist/{register-X45K325N.js → register-OZ5CRANZ.js} +18 -15
- package/dist/{reset-password-GTWLBOFK.js → reset-password-5UHZU4D3.js} +1 -1
- package/dist/{return-reasons-LOKYRGMI.js → return-reasons-QJRA2ZX6.js} +21 -17
- package/dist/{sales-channels-Y4LRP7JC.js → sales-channels-CZDU7VTE.js} +7 -6
- package/dist/{sales-channels-7R2IY3KG.js → sales-channels-U55MUDQP.js} +7 -6
- package/dist/{settings-2XDLFYMS.js → settings-2GCQQTO6.js} +47 -40
- package/dist/shipment-HWQHMX2L.js +242 -0
- package/dist/{shipping-profile-R3NABPQF.js → shipping-profile-ZP7M6VSS.js} +2 -2
- package/dist/{shipping-profiles-QVKNFLCW.js → shipping-profiles-C5WBXWZ2.js} +21 -18
- package/dist/{stock-5RXNUPUT.js → stock-MQA7PRO6.js} +21 -18
- package/dist/{store-MPYOWMZT.js → store-5ZHZR4JI.js} +84 -149
- package/dist/{store-closure-DNMCHUXD.js → store-closure-H5WHV3LA.js} +24 -16
- package/dist/{store-select-UTPJ7DM7.js → store-select-PZS556FB.js} +19 -16
- package/dist/{tax-regions-UD6P5FVC.js → tax-regions-HDLBFZVG.js} +6 -6
- package/dist/{team-IMS66MVP.js → team-CLKJCZNH.js} +29 -26
- package/dist/types-CtCEtTE6.d.ts +16 -0
- package/package.json +5 -5
- package/dist/[id]-BYP37PU4.js +0 -1314
- package/dist/[id]-INOFZHL7.js +0 -1219
- package/dist/add-KRAGFFBJ.js +0 -158
- package/dist/bulk-edit-3SMBLIOA.js +0 -244
- package/dist/chunk-47SXTGLN.js +0 -397
- package/dist/chunk-4KX6CBJ4.js +0 -178
- package/dist/chunk-DLNNTQRY.js +0 -217
- package/dist/chunk-FX4V5JCF.js +0 -37
- package/dist/chunk-GC33DBKG.js +0 -143
- package/dist/chunk-LQYMBSRQ.js +0 -66
- package/dist/chunk-NK4NR6MN.js +0 -173
- package/dist/chunk-PFU6FSXY.js +0 -430
- package/dist/chunk-QJEOPT2P.js +0 -330
- package/dist/chunk-QSGR43JM.js +0 -30
- package/dist/chunk-STR3NGWE.js +0 -3736
- package/dist/create-3DOO3RNH.js +0 -716
- package/dist/create-I7HV3RM6.js +0 -150
- package/dist/edit-K2AD335I.js +0 -237
- package/dist/edit-VO5XLIEL.js +0 -362
- package/dist/edit-stocks-and-prices-MHHQFWFA.js +0 -408
- package/dist/organization-LPYQRTQC.js +0 -303
- package/dist/prices-3OXV5RGY.js +0 -270
- package/dist/product-variant-detail-WV4KXVXR.js +0 -590
- package/dist/shipment-4GW2JFWB.js +0 -174
- package/dist/stock-GPC3BCL6.js +0 -500
- package/dist/{chunk-SDSEW72R.js → chunk-E2HQPY32.js} +3 -3
- /package/dist/{chunk-CAS74NLJ.js → chunk-YV6MK4PZ.js} +0 -0
|
@@ -0,0 +1,438 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ordersQueryKeys
|
|
3
|
+
} from "./chunk-Y2MQ5EMD.js";
|
|
4
|
+
import {
|
|
5
|
+
queryClient
|
|
6
|
+
} from "./chunk-RHKRREUU.js";
|
|
7
|
+
import {
|
|
8
|
+
queryKeysFactory
|
|
9
|
+
} from "./chunk-ZA2KFUFR.js";
|
|
10
|
+
import {
|
|
11
|
+
sdk
|
|
12
|
+
} from "./chunk-RIN4CBRB.js";
|
|
13
|
+
|
|
14
|
+
// src/hooks/api/returns.tsx
|
|
15
|
+
import {
|
|
16
|
+
useMutation,
|
|
17
|
+
useQuery
|
|
18
|
+
} from "@tanstack/react-query";
|
|
19
|
+
var RETURNS_QUERY_KEY = "returns";
|
|
20
|
+
var returnsQueryKeys = queryKeysFactory(RETURNS_QUERY_KEY);
|
|
21
|
+
var useReturn = (id, query, options) => {
|
|
22
|
+
const { data, ...rest } = useQuery({
|
|
23
|
+
queryFn: async () => sdk.vendor.returns.$id.query({ $id: id, ...query }),
|
|
24
|
+
queryKey: returnsQueryKeys.detail(id, query),
|
|
25
|
+
...options
|
|
26
|
+
});
|
|
27
|
+
return { ...data, ...rest };
|
|
28
|
+
};
|
|
29
|
+
var useReturns = (query, options) => {
|
|
30
|
+
const { data, ...rest } = useQuery({
|
|
31
|
+
queryFn: async () => sdk.vendor.returns.query({ ...query }),
|
|
32
|
+
queryKey: returnsQueryKeys.list(query),
|
|
33
|
+
...options
|
|
34
|
+
});
|
|
35
|
+
return { ...data, ...rest };
|
|
36
|
+
};
|
|
37
|
+
var useInitiateReturn = (orderId, options) => {
|
|
38
|
+
return useMutation({
|
|
39
|
+
mutationFn: (payload) => sdk.vendor.returns.mutate(payload),
|
|
40
|
+
onSuccess: (data, variables, context) => {
|
|
41
|
+
queryClient.invalidateQueries({
|
|
42
|
+
queryKey: ordersQueryKeys.details()
|
|
43
|
+
});
|
|
44
|
+
queryClient.invalidateQueries({
|
|
45
|
+
queryKey: ordersQueryKeys.preview(orderId)
|
|
46
|
+
});
|
|
47
|
+
options?.onSuccess?.(data, variables, context);
|
|
48
|
+
},
|
|
49
|
+
...options
|
|
50
|
+
});
|
|
51
|
+
};
|
|
52
|
+
var useCancelReturn = (id, orderId, options) => {
|
|
53
|
+
return useMutation({
|
|
54
|
+
mutationFn: () => sdk.vendor.returns.$id.cancel.mutate({ $id: id }),
|
|
55
|
+
onSuccess: (data, variables, context) => {
|
|
56
|
+
queryClient.invalidateQueries({
|
|
57
|
+
queryKey: ordersQueryKeys.details()
|
|
58
|
+
});
|
|
59
|
+
queryClient.invalidateQueries({
|
|
60
|
+
queryKey: ordersQueryKeys.preview(orderId),
|
|
61
|
+
refetchType: "all"
|
|
62
|
+
// We want preview to be updated in the cache immediately
|
|
63
|
+
});
|
|
64
|
+
queryClient.invalidateQueries({
|
|
65
|
+
queryKey: returnsQueryKeys.details()
|
|
66
|
+
});
|
|
67
|
+
queryClient.invalidateQueries({
|
|
68
|
+
queryKey: returnsQueryKeys.lists()
|
|
69
|
+
});
|
|
70
|
+
options?.onSuccess?.(data, variables, context);
|
|
71
|
+
},
|
|
72
|
+
...options
|
|
73
|
+
});
|
|
74
|
+
};
|
|
75
|
+
var useConfirmReturnRequest = (id, orderId, options) => {
|
|
76
|
+
return useMutation({
|
|
77
|
+
mutationFn: (payload) => sdk.vendor.returns.$id.request.mutate({ $id: id, ...payload }),
|
|
78
|
+
onSuccess: (data, variables, context) => {
|
|
79
|
+
queryClient.invalidateQueries({
|
|
80
|
+
queryKey: ordersQueryKeys.details()
|
|
81
|
+
});
|
|
82
|
+
queryClient.invalidateQueries({
|
|
83
|
+
queryKey: ordersQueryKeys.preview(orderId)
|
|
84
|
+
});
|
|
85
|
+
queryClient.invalidateQueries({
|
|
86
|
+
queryKey: returnsQueryKeys.details()
|
|
87
|
+
});
|
|
88
|
+
queryClient.invalidateQueries({
|
|
89
|
+
queryKey: returnsQueryKeys.lists()
|
|
90
|
+
});
|
|
91
|
+
options?.onSuccess?.(data, variables, context);
|
|
92
|
+
},
|
|
93
|
+
...options
|
|
94
|
+
});
|
|
95
|
+
};
|
|
96
|
+
var useCancelReturnRequest = (id, orderId, options) => {
|
|
97
|
+
return useMutation({
|
|
98
|
+
mutationFn: () => sdk.vendor.returns.$id.request.delete({ $id: id }),
|
|
99
|
+
onSuccess: (data, variables, context) => {
|
|
100
|
+
queryClient.invalidateQueries({
|
|
101
|
+
queryKey: ordersQueryKeys.details()
|
|
102
|
+
});
|
|
103
|
+
queryClient.invalidateQueries({
|
|
104
|
+
queryKey: ordersQueryKeys.preview(orderId),
|
|
105
|
+
refetchType: "all"
|
|
106
|
+
// We want preview to be updated in the cache immediately
|
|
107
|
+
});
|
|
108
|
+
queryClient.invalidateQueries({
|
|
109
|
+
queryKey: returnsQueryKeys.details()
|
|
110
|
+
});
|
|
111
|
+
queryClient.invalidateQueries({
|
|
112
|
+
queryKey: returnsQueryKeys.lists()
|
|
113
|
+
});
|
|
114
|
+
options?.onSuccess?.(data, variables, context);
|
|
115
|
+
},
|
|
116
|
+
...options
|
|
117
|
+
});
|
|
118
|
+
};
|
|
119
|
+
var useAddReturnItem = (id, orderId, options) => {
|
|
120
|
+
return useMutation({
|
|
121
|
+
mutationFn: (payload) => sdk.vendor.returns.$id.requestItems.mutate({ $id: id, ...payload }),
|
|
122
|
+
onSuccess: (data, variables, context) => {
|
|
123
|
+
queryClient.invalidateQueries({
|
|
124
|
+
queryKey: ordersQueryKeys.details()
|
|
125
|
+
});
|
|
126
|
+
queryClient.invalidateQueries({
|
|
127
|
+
queryKey: ordersQueryKeys.preview(orderId)
|
|
128
|
+
});
|
|
129
|
+
options?.onSuccess?.(data, variables, context);
|
|
130
|
+
},
|
|
131
|
+
...options
|
|
132
|
+
});
|
|
133
|
+
};
|
|
134
|
+
var useUpdateReturnItem = (id, orderId, options) => {
|
|
135
|
+
return useMutation({
|
|
136
|
+
mutationFn: ({ actionId, ...payload }) => {
|
|
137
|
+
return sdk.vendor.returns.$id.requestItems.$actionId.mutate({
|
|
138
|
+
$id: id,
|
|
139
|
+
$actionId: actionId,
|
|
140
|
+
...payload
|
|
141
|
+
});
|
|
142
|
+
},
|
|
143
|
+
onSuccess: (data, variables, context) => {
|
|
144
|
+
queryClient.invalidateQueries({
|
|
145
|
+
queryKey: ordersQueryKeys.details()
|
|
146
|
+
});
|
|
147
|
+
queryClient.invalidateQueries({
|
|
148
|
+
queryKey: ordersQueryKeys.preview(orderId)
|
|
149
|
+
});
|
|
150
|
+
options?.onSuccess?.(data, variables, context);
|
|
151
|
+
},
|
|
152
|
+
...options
|
|
153
|
+
});
|
|
154
|
+
};
|
|
155
|
+
var useRemoveReturnItem = (id, orderId, options) => {
|
|
156
|
+
return useMutation({
|
|
157
|
+
mutationFn: (actionId) => sdk.vendor.returns.$id.requestItems.$actionId.delete({ $id: id, $actionId: actionId }),
|
|
158
|
+
onSuccess: (data, variables, context) => {
|
|
159
|
+
queryClient.invalidateQueries({
|
|
160
|
+
queryKey: ordersQueryKeys.details()
|
|
161
|
+
});
|
|
162
|
+
queryClient.invalidateQueries({
|
|
163
|
+
queryKey: ordersQueryKeys.preview(orderId)
|
|
164
|
+
});
|
|
165
|
+
queryClient.invalidateQueries({
|
|
166
|
+
queryKey: returnsQueryKeys.details()
|
|
167
|
+
});
|
|
168
|
+
options?.onSuccess?.(data, variables, context);
|
|
169
|
+
},
|
|
170
|
+
...options
|
|
171
|
+
});
|
|
172
|
+
};
|
|
173
|
+
var useUpdateReturn = (id, orderId, options) => {
|
|
174
|
+
return useMutation({
|
|
175
|
+
mutationFn: (payload) => {
|
|
176
|
+
return sdk.vendor.returns.$id.mutate({ $id: id, ...payload });
|
|
177
|
+
},
|
|
178
|
+
onSuccess: (data, variables, context) => {
|
|
179
|
+
queryClient.invalidateQueries({
|
|
180
|
+
queryKey: ordersQueryKeys.details()
|
|
181
|
+
});
|
|
182
|
+
queryClient.invalidateQueries({
|
|
183
|
+
queryKey: ordersQueryKeys.preview(orderId)
|
|
184
|
+
});
|
|
185
|
+
options?.onSuccess?.(data, variables, context);
|
|
186
|
+
},
|
|
187
|
+
...options
|
|
188
|
+
});
|
|
189
|
+
};
|
|
190
|
+
var useAddReturnShipping = (id, orderId, options) => {
|
|
191
|
+
return useMutation({
|
|
192
|
+
mutationFn: (payload) => sdk.vendor.returns.$id.shippingMethod.mutate({ $id: id, ...payload }),
|
|
193
|
+
onSuccess: (data, variables, context) => {
|
|
194
|
+
queryClient.invalidateQueries({
|
|
195
|
+
queryKey: ordersQueryKeys.details()
|
|
196
|
+
});
|
|
197
|
+
queryClient.invalidateQueries({
|
|
198
|
+
queryKey: ordersQueryKeys.preview(orderId)
|
|
199
|
+
});
|
|
200
|
+
options?.onSuccess?.(data, variables, context);
|
|
201
|
+
},
|
|
202
|
+
...options
|
|
203
|
+
});
|
|
204
|
+
};
|
|
205
|
+
var useUpdateReturnShipping = (id, orderId, options) => {
|
|
206
|
+
return useMutation({
|
|
207
|
+
mutationFn: ({ actionId, ...payload }) => sdk.vendor.returns.$id.shippingMethod.$actionId.mutate({
|
|
208
|
+
$id: id,
|
|
209
|
+
$actionId: actionId,
|
|
210
|
+
...payload
|
|
211
|
+
}),
|
|
212
|
+
onSuccess: (data, variables, context) => {
|
|
213
|
+
queryClient.invalidateQueries({
|
|
214
|
+
queryKey: ordersQueryKeys.details()
|
|
215
|
+
});
|
|
216
|
+
queryClient.invalidateQueries({
|
|
217
|
+
queryKey: ordersQueryKeys.preview(orderId)
|
|
218
|
+
});
|
|
219
|
+
options?.onSuccess?.(data, variables, context);
|
|
220
|
+
},
|
|
221
|
+
...options
|
|
222
|
+
});
|
|
223
|
+
};
|
|
224
|
+
var useDeleteReturnShipping = (id, orderId, options) => {
|
|
225
|
+
return useMutation({
|
|
226
|
+
mutationFn: (actionId) => sdk.vendor.returns.$id.shippingMethod.$actionId.delete({ $id: id, $actionId: actionId }),
|
|
227
|
+
onSuccess: (data, variables, context) => {
|
|
228
|
+
queryClient.invalidateQueries({
|
|
229
|
+
queryKey: ordersQueryKeys.details()
|
|
230
|
+
});
|
|
231
|
+
queryClient.invalidateQueries({
|
|
232
|
+
queryKey: ordersQueryKeys.preview(orderId)
|
|
233
|
+
});
|
|
234
|
+
queryClient.invalidateQueries({
|
|
235
|
+
queryKey: returnsQueryKeys.details()
|
|
236
|
+
});
|
|
237
|
+
options?.onSuccess?.(data, variables, context);
|
|
238
|
+
},
|
|
239
|
+
...options
|
|
240
|
+
});
|
|
241
|
+
};
|
|
242
|
+
var useInitiateReceiveReturn = (id, orderId, options) => {
|
|
243
|
+
return useMutation({
|
|
244
|
+
mutationFn: (payload) => sdk.vendor.returns.$id.receive.mutate({ $id: id, ...payload }),
|
|
245
|
+
onSuccess: (data, variables, context) => {
|
|
246
|
+
queryClient.invalidateQueries({
|
|
247
|
+
queryKey: ordersQueryKeys.details()
|
|
248
|
+
});
|
|
249
|
+
queryClient.invalidateQueries({
|
|
250
|
+
queryKey: ordersQueryKeys.preview(orderId)
|
|
251
|
+
});
|
|
252
|
+
options?.onSuccess?.(data, variables, context);
|
|
253
|
+
},
|
|
254
|
+
...options
|
|
255
|
+
});
|
|
256
|
+
};
|
|
257
|
+
var useAddReceiveItems = (id, orderId, options) => {
|
|
258
|
+
return useMutation({
|
|
259
|
+
mutationFn: (payload) => sdk.vendor.returns.$id.receiveItems.mutate({ $id: id, ...payload }),
|
|
260
|
+
onSuccess: (data, variables, context) => {
|
|
261
|
+
queryClient.invalidateQueries({
|
|
262
|
+
queryKey: ordersQueryKeys.details()
|
|
263
|
+
});
|
|
264
|
+
queryClient.invalidateQueries({
|
|
265
|
+
queryKey: ordersQueryKeys.preview(orderId)
|
|
266
|
+
});
|
|
267
|
+
options?.onSuccess?.(data, variables, context);
|
|
268
|
+
},
|
|
269
|
+
...options
|
|
270
|
+
});
|
|
271
|
+
};
|
|
272
|
+
var useUpdateReceiveItem = (id, orderId, options) => {
|
|
273
|
+
return useMutation({
|
|
274
|
+
mutationFn: ({ actionId, ...payload }) => {
|
|
275
|
+
return sdk.vendor.returns.$id.receiveItems.$actionId.mutate({
|
|
276
|
+
$id: id,
|
|
277
|
+
$actionId: actionId,
|
|
278
|
+
...payload
|
|
279
|
+
});
|
|
280
|
+
},
|
|
281
|
+
onSuccess: (data, variables, context) => {
|
|
282
|
+
queryClient.invalidateQueries({
|
|
283
|
+
queryKey: ordersQueryKeys.details()
|
|
284
|
+
});
|
|
285
|
+
queryClient.invalidateQueries({
|
|
286
|
+
queryKey: ordersQueryKeys.preview(orderId)
|
|
287
|
+
});
|
|
288
|
+
options?.onSuccess?.(data, variables, context);
|
|
289
|
+
},
|
|
290
|
+
...options
|
|
291
|
+
});
|
|
292
|
+
};
|
|
293
|
+
var useRemoveReceiveItems = (id, orderId, options) => {
|
|
294
|
+
return useMutation({
|
|
295
|
+
mutationFn: (actionId) => {
|
|
296
|
+
return sdk.vendor.returns.$id.receiveItems.$actionId.delete({
|
|
297
|
+
$id: id,
|
|
298
|
+
$actionId: actionId
|
|
299
|
+
});
|
|
300
|
+
},
|
|
301
|
+
onSuccess: (data, variables, context) => {
|
|
302
|
+
queryClient.invalidateQueries({
|
|
303
|
+
queryKey: ordersQueryKeys.details()
|
|
304
|
+
});
|
|
305
|
+
queryClient.invalidateQueries({
|
|
306
|
+
queryKey: ordersQueryKeys.preview(orderId)
|
|
307
|
+
});
|
|
308
|
+
options?.onSuccess?.(data, variables, context);
|
|
309
|
+
},
|
|
310
|
+
...options
|
|
311
|
+
});
|
|
312
|
+
};
|
|
313
|
+
var useAddDismissItems = (id, orderId, options) => {
|
|
314
|
+
return useMutation({
|
|
315
|
+
mutationFn: (payload) => sdk.vendor.returns.$id.dismissItems.mutate({ $id: id, ...payload }),
|
|
316
|
+
onSuccess: (data, variables, context) => {
|
|
317
|
+
queryClient.invalidateQueries({
|
|
318
|
+
queryKey: ordersQueryKeys.details()
|
|
319
|
+
});
|
|
320
|
+
queryClient.invalidateQueries({
|
|
321
|
+
queryKey: ordersQueryKeys.preview(orderId)
|
|
322
|
+
});
|
|
323
|
+
options?.onSuccess?.(data, variables, context);
|
|
324
|
+
},
|
|
325
|
+
...options
|
|
326
|
+
});
|
|
327
|
+
};
|
|
328
|
+
var useUpdateDismissItem = (id, orderId, options) => {
|
|
329
|
+
return useMutation({
|
|
330
|
+
mutationFn: ({ actionId, ...payload }) => {
|
|
331
|
+
return sdk.vendor.returns.$id.dismissItems.$actionId.mutate({
|
|
332
|
+
$id: id,
|
|
333
|
+
$actionId: actionId,
|
|
334
|
+
...payload
|
|
335
|
+
});
|
|
336
|
+
},
|
|
337
|
+
onSuccess: (data, variables, context) => {
|
|
338
|
+
queryClient.invalidateQueries({
|
|
339
|
+
queryKey: ordersQueryKeys.details()
|
|
340
|
+
});
|
|
341
|
+
queryClient.invalidateQueries({
|
|
342
|
+
queryKey: ordersQueryKeys.preview(orderId)
|
|
343
|
+
});
|
|
344
|
+
options?.onSuccess?.(data, variables, context);
|
|
345
|
+
},
|
|
346
|
+
...options
|
|
347
|
+
});
|
|
348
|
+
};
|
|
349
|
+
var useRemoveDismissItem = (id, orderId, options) => {
|
|
350
|
+
return useMutation({
|
|
351
|
+
mutationFn: (actionId) => {
|
|
352
|
+
return sdk.vendor.returns.$id.dismissItems.$actionId.delete({
|
|
353
|
+
$id: id,
|
|
354
|
+
$actionId: actionId
|
|
355
|
+
});
|
|
356
|
+
},
|
|
357
|
+
onSuccess: (data, variables, context) => {
|
|
358
|
+
queryClient.invalidateQueries({
|
|
359
|
+
queryKey: ordersQueryKeys.details()
|
|
360
|
+
});
|
|
361
|
+
queryClient.invalidateQueries({
|
|
362
|
+
queryKey: ordersQueryKeys.preview(orderId)
|
|
363
|
+
});
|
|
364
|
+
options?.onSuccess?.(data, variables, context);
|
|
365
|
+
},
|
|
366
|
+
...options
|
|
367
|
+
});
|
|
368
|
+
};
|
|
369
|
+
var useConfirmReturnReceive = (id, orderId, options) => {
|
|
370
|
+
return useMutation({
|
|
371
|
+
mutationFn: (payload) => sdk.vendor.returns.$id.receive.confirm.mutate({ $id: id, ...payload }),
|
|
372
|
+
onSuccess: (data, variables, context) => {
|
|
373
|
+
queryClient.invalidateQueries({
|
|
374
|
+
queryKey: ordersQueryKeys.details()
|
|
375
|
+
});
|
|
376
|
+
queryClient.invalidateQueries({
|
|
377
|
+
queryKey: ordersQueryKeys.preview(orderId)
|
|
378
|
+
});
|
|
379
|
+
queryClient.invalidateQueries({
|
|
380
|
+
queryKey: returnsQueryKeys.details()
|
|
381
|
+
});
|
|
382
|
+
queryClient.invalidateQueries({
|
|
383
|
+
queryKey: returnsQueryKeys.lists()
|
|
384
|
+
});
|
|
385
|
+
options?.onSuccess?.(data, variables, context);
|
|
386
|
+
},
|
|
387
|
+
...options
|
|
388
|
+
});
|
|
389
|
+
};
|
|
390
|
+
var useCancelReceiveReturn = (id, orderId, options) => {
|
|
391
|
+
return useMutation({
|
|
392
|
+
mutationFn: () => sdk.vendor.returns.$id.receive.delete({ $id: id }),
|
|
393
|
+
onSuccess: (data, variables, context) => {
|
|
394
|
+
queryClient.invalidateQueries({
|
|
395
|
+
queryKey: ordersQueryKeys.details()
|
|
396
|
+
});
|
|
397
|
+
queryClient.invalidateQueries({
|
|
398
|
+
queryKey: ordersQueryKeys.preview(orderId),
|
|
399
|
+
refetchType: "all"
|
|
400
|
+
// We want preview to be updated in the cache immediately
|
|
401
|
+
});
|
|
402
|
+
queryClient.invalidateQueries({
|
|
403
|
+
queryKey: returnsQueryKeys.details()
|
|
404
|
+
});
|
|
405
|
+
queryClient.invalidateQueries({
|
|
406
|
+
queryKey: returnsQueryKeys.lists()
|
|
407
|
+
});
|
|
408
|
+
options?.onSuccess?.(data, variables, context);
|
|
409
|
+
},
|
|
410
|
+
...options
|
|
411
|
+
});
|
|
412
|
+
};
|
|
413
|
+
|
|
414
|
+
export {
|
|
415
|
+
returnsQueryKeys,
|
|
416
|
+
useReturn,
|
|
417
|
+
useReturns,
|
|
418
|
+
useInitiateReturn,
|
|
419
|
+
useCancelReturn,
|
|
420
|
+
useConfirmReturnRequest,
|
|
421
|
+
useCancelReturnRequest,
|
|
422
|
+
useAddReturnItem,
|
|
423
|
+
useUpdateReturnItem,
|
|
424
|
+
useRemoveReturnItem,
|
|
425
|
+
useUpdateReturn,
|
|
426
|
+
useAddReturnShipping,
|
|
427
|
+
useUpdateReturnShipping,
|
|
428
|
+
useDeleteReturnShipping,
|
|
429
|
+
useInitiateReceiveReturn,
|
|
430
|
+
useAddReceiveItems,
|
|
431
|
+
useUpdateReceiveItem,
|
|
432
|
+
useRemoveReceiveItems,
|
|
433
|
+
useAddDismissItems,
|
|
434
|
+
useUpdateDismissItem,
|
|
435
|
+
useRemoveDismissItem,
|
|
436
|
+
useConfirmReturnReceive,
|
|
437
|
+
useCancelReceiveReturn
|
|
438
|
+
};
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ordersQueryKeys
|
|
3
|
+
} from "./chunk-Y2MQ5EMD.js";
|
|
4
|
+
import {
|
|
5
|
+
queryClient
|
|
6
|
+
} from "./chunk-RHKRREUU.js";
|
|
7
|
+
import {
|
|
8
|
+
queryKeysFactory
|
|
9
|
+
} from "./chunk-ZA2KFUFR.js";
|
|
10
|
+
import {
|
|
11
|
+
sdk
|
|
12
|
+
} from "./chunk-RIN4CBRB.js";
|
|
13
|
+
|
|
14
|
+
// src/hooks/api/exchanges.tsx
|
|
15
|
+
import {
|
|
16
|
+
useMutation,
|
|
17
|
+
useQuery
|
|
18
|
+
} from "@tanstack/react-query";
|
|
19
|
+
var EXCHANGES_QUERY_KEY = "exchanges";
|
|
20
|
+
var exchangesQueryKeys = queryKeysFactory(EXCHANGES_QUERY_KEY);
|
|
21
|
+
var invalidateOrder = (orderId) => {
|
|
22
|
+
queryClient.invalidateQueries({ queryKey: ordersQueryKeys.details() });
|
|
23
|
+
queryClient.invalidateQueries({ queryKey: ordersQueryKeys.preview(orderId) });
|
|
24
|
+
queryClient.invalidateQueries({ queryKey: ordersQueryKeys.changes(orderId) });
|
|
25
|
+
queryClient.invalidateQueries({ queryKey: exchangesQueryKeys.lists() });
|
|
26
|
+
};
|
|
27
|
+
var useExchanges = (query, options) => {
|
|
28
|
+
const { data, ...rest } = useQuery({
|
|
29
|
+
queryFn: async () => sdk.vendor.exchanges.query({ ...query }),
|
|
30
|
+
queryKey: exchangesQueryKeys.list(query),
|
|
31
|
+
...options
|
|
32
|
+
});
|
|
33
|
+
return { ...data, ...rest };
|
|
34
|
+
};
|
|
35
|
+
var useCreateExchange = (orderId, options) => {
|
|
36
|
+
return useMutation({
|
|
37
|
+
mutationFn: (payload) => sdk.vendor.exchanges.mutate(payload),
|
|
38
|
+
onSuccess: (data, variables, context) => {
|
|
39
|
+
invalidateOrder(orderId);
|
|
40
|
+
options?.onSuccess?.(data, variables, context);
|
|
41
|
+
},
|
|
42
|
+
...options
|
|
43
|
+
});
|
|
44
|
+
};
|
|
45
|
+
var useCancelExchangeBegin = (exchangeId, orderId, options) => {
|
|
46
|
+
return useMutation({
|
|
47
|
+
mutationFn: () => sdk.vendor.exchanges.$id.request.delete({ $id: exchangeId }),
|
|
48
|
+
onSuccess: (data, variables, context) => {
|
|
49
|
+
invalidateOrder(orderId);
|
|
50
|
+
options?.onSuccess?.(data, variables, context);
|
|
51
|
+
},
|
|
52
|
+
...options
|
|
53
|
+
});
|
|
54
|
+
};
|
|
55
|
+
var useRequestExchange = (exchangeId, orderId, options) => {
|
|
56
|
+
return useMutation({
|
|
57
|
+
mutationFn: () => sdk.vendor.exchanges.$id.request.mutate({ $id: exchangeId }),
|
|
58
|
+
onSuccess: (data, variables, context) => {
|
|
59
|
+
invalidateOrder(orderId);
|
|
60
|
+
options?.onSuccess?.(data, variables, context);
|
|
61
|
+
},
|
|
62
|
+
...options
|
|
63
|
+
});
|
|
64
|
+
};
|
|
65
|
+
var useAddExchangeInboundItems = (exchangeId, orderId, options) => {
|
|
66
|
+
return useMutation({
|
|
67
|
+
mutationFn: (payload) => sdk.vendor.exchanges.$id.inbound.items.mutate({
|
|
68
|
+
$id: exchangeId,
|
|
69
|
+
...payload
|
|
70
|
+
}),
|
|
71
|
+
onSuccess: (data, variables, context) => {
|
|
72
|
+
invalidateOrder(orderId);
|
|
73
|
+
options?.onSuccess?.(data, variables, context);
|
|
74
|
+
},
|
|
75
|
+
...options
|
|
76
|
+
});
|
|
77
|
+
};
|
|
78
|
+
var useUpdateExchangeInboundItem = (exchangeId, orderId, options) => {
|
|
79
|
+
return useMutation({
|
|
80
|
+
mutationFn: ({ $actionId, ...payload }) => sdk.vendor.exchanges.$id.inbound.items.$actionId.mutate({
|
|
81
|
+
$id: exchangeId,
|
|
82
|
+
$actionId,
|
|
83
|
+
...payload
|
|
84
|
+
}),
|
|
85
|
+
onSuccess: (data, variables, context) => {
|
|
86
|
+
invalidateOrder(orderId);
|
|
87
|
+
options?.onSuccess?.(data, variables, context);
|
|
88
|
+
},
|
|
89
|
+
...options
|
|
90
|
+
});
|
|
91
|
+
};
|
|
92
|
+
var useRemoveExchangeInboundItem = (exchangeId, orderId, options) => {
|
|
93
|
+
return useMutation({
|
|
94
|
+
mutationFn: (actionId) => sdk.vendor.exchanges.$id.inbound.items.$actionId.delete({
|
|
95
|
+
$id: exchangeId,
|
|
96
|
+
$actionId: actionId
|
|
97
|
+
}),
|
|
98
|
+
onSuccess: (data, variables, context) => {
|
|
99
|
+
invalidateOrder(orderId);
|
|
100
|
+
options?.onSuccess?.(data, variables, context);
|
|
101
|
+
},
|
|
102
|
+
...options
|
|
103
|
+
});
|
|
104
|
+
};
|
|
105
|
+
var useAddExchangeOutboundItems = (exchangeId, orderId, options) => {
|
|
106
|
+
return useMutation({
|
|
107
|
+
mutationFn: (payload) => sdk.vendor.exchanges.$id.outbound.items.mutate({
|
|
108
|
+
$id: exchangeId,
|
|
109
|
+
...payload
|
|
110
|
+
}),
|
|
111
|
+
onSuccess: (data, variables, context) => {
|
|
112
|
+
invalidateOrder(orderId);
|
|
113
|
+
options?.onSuccess?.(data, variables, context);
|
|
114
|
+
},
|
|
115
|
+
...options
|
|
116
|
+
});
|
|
117
|
+
};
|
|
118
|
+
var useUpdateExchangeOutboundItem = (exchangeId, orderId, options) => {
|
|
119
|
+
return useMutation({
|
|
120
|
+
mutationFn: ({ $actionId, ...payload }) => sdk.vendor.exchanges.$id.outbound.items.$actionId.mutate({
|
|
121
|
+
$id: exchangeId,
|
|
122
|
+
$actionId,
|
|
123
|
+
...payload
|
|
124
|
+
}),
|
|
125
|
+
onSuccess: (data, variables, context) => {
|
|
126
|
+
invalidateOrder(orderId);
|
|
127
|
+
options?.onSuccess?.(data, variables, context);
|
|
128
|
+
},
|
|
129
|
+
...options
|
|
130
|
+
});
|
|
131
|
+
};
|
|
132
|
+
var useRemoveExchangeOutboundItem = (exchangeId, orderId, options) => {
|
|
133
|
+
return useMutation({
|
|
134
|
+
mutationFn: (actionId) => sdk.vendor.exchanges.$id.outbound.items.$actionId.delete({
|
|
135
|
+
$id: exchangeId,
|
|
136
|
+
$actionId: actionId
|
|
137
|
+
}),
|
|
138
|
+
onSuccess: (data, variables, context) => {
|
|
139
|
+
invalidateOrder(orderId);
|
|
140
|
+
options?.onSuccess?.(data, variables, context);
|
|
141
|
+
},
|
|
142
|
+
...options
|
|
143
|
+
});
|
|
144
|
+
};
|
|
145
|
+
var useAddExchangeInboundShipping = (exchangeId, orderId, options) => {
|
|
146
|
+
return useMutation({
|
|
147
|
+
mutationFn: (payload) => sdk.vendor.exchanges.$id.inbound.shippingMethod.mutate({
|
|
148
|
+
$id: exchangeId,
|
|
149
|
+
...payload
|
|
150
|
+
}),
|
|
151
|
+
onSuccess: (data, variables, context) => {
|
|
152
|
+
invalidateOrder(orderId);
|
|
153
|
+
options?.onSuccess?.(data, variables, context);
|
|
154
|
+
},
|
|
155
|
+
...options
|
|
156
|
+
});
|
|
157
|
+
};
|
|
158
|
+
var useAddExchangeOutboundShipping = (exchangeId, orderId, options) => {
|
|
159
|
+
return useMutation({
|
|
160
|
+
mutationFn: (payload) => sdk.vendor.exchanges.$id.outbound.shippingMethod.mutate({
|
|
161
|
+
$id: exchangeId,
|
|
162
|
+
...payload
|
|
163
|
+
}),
|
|
164
|
+
onSuccess: (data, variables, context) => {
|
|
165
|
+
invalidateOrder(orderId);
|
|
166
|
+
options?.onSuccess?.(data, variables, context);
|
|
167
|
+
},
|
|
168
|
+
...options
|
|
169
|
+
});
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
export {
|
|
173
|
+
useExchanges,
|
|
174
|
+
useCreateExchange,
|
|
175
|
+
useCancelExchangeBegin,
|
|
176
|
+
useRequestExchange,
|
|
177
|
+
useAddExchangeInboundItems,
|
|
178
|
+
useUpdateExchangeInboundItem,
|
|
179
|
+
useRemoveExchangeInboundItem,
|
|
180
|
+
useAddExchangeOutboundItems,
|
|
181
|
+
useUpdateExchangeOutboundItem,
|
|
182
|
+
useRemoveExchangeOutboundItem,
|
|
183
|
+
useAddExchangeInboundShipping,
|
|
184
|
+
useAddExchangeOutboundShipping
|
|
185
|
+
};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import {
|
|
2
|
+
StatusCell
|
|
3
|
+
} from "./chunk-DB6ANJBO.js";
|
|
4
|
+
import {
|
|
5
|
+
PlaceholderCell
|
|
6
|
+
} from "./chunk-PHOCVOZ5.js";
|
|
7
|
+
import {
|
|
8
|
+
require_dist
|
|
9
|
+
} from "./chunk-UCYSCKZV.js";
|
|
10
|
+
import {
|
|
11
|
+
__toESM
|
|
12
|
+
} from "./chunk-NBMM2TZK.js";
|
|
13
|
+
|
|
14
|
+
// src/components/table/table-cells/product/category-cell/category-cell.tsx
|
|
15
|
+
import { Tooltip } from "@medusajs/ui";
|
|
16
|
+
import { useTranslation } from "react-i18next";
|
|
17
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
18
|
+
var CategoryCell = ({ categories }) => {
|
|
19
|
+
const { t } = useTranslation();
|
|
20
|
+
if (!categories || !categories.length) {
|
|
21
|
+
return /* @__PURE__ */ jsx(PlaceholderCell, {});
|
|
22
|
+
}
|
|
23
|
+
const [first, ...rest] = categories;
|
|
24
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex h-full w-full items-center gap-x-1 overflow-hidden", children: [
|
|
25
|
+
/* @__PURE__ */ jsx("span", { title: first.name, className: "truncate", children: first.name }),
|
|
26
|
+
rest.length > 0 && /* @__PURE__ */ jsx(
|
|
27
|
+
Tooltip,
|
|
28
|
+
{
|
|
29
|
+
content: /* @__PURE__ */ jsx("ul", { children: rest.map((c) => /* @__PURE__ */ jsx("li", { children: c.name }, c.id)) }),
|
|
30
|
+
children: /* @__PURE__ */ jsx("span", { className: "text-ui-fg-subtle txt-compact-small", children: t("general.plusCountMore", { count: rest.length }) })
|
|
31
|
+
}
|
|
32
|
+
)
|
|
33
|
+
] });
|
|
34
|
+
};
|
|
35
|
+
var CategoryHeader = () => {
|
|
36
|
+
const { t } = useTranslation();
|
|
37
|
+
return /* @__PURE__ */ jsx("div", { className: "flex h-full w-full items-center", children: /* @__PURE__ */ jsx("span", { children: t("fields.category") }) });
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
// src/components/table/table-cells/product/product-status-cell/product-status-cell.tsx
|
|
41
|
+
import { useTranslation as useTranslation2 } from "react-i18next";
|
|
42
|
+
var import_types = __toESM(require_dist(), 1);
|
|
43
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
44
|
+
var ProductStatusCell = ({ status }) => {
|
|
45
|
+
const { t } = useTranslation2();
|
|
46
|
+
const [color, text] = {
|
|
47
|
+
[import_types.ProductStatus.DRAFT]: ["grey", t("products.productStatus.draft")],
|
|
48
|
+
[import_types.ProductStatus.PROPOSED]: ["orange", t("products.productStatus.proposed")],
|
|
49
|
+
[import_types.ProductStatus.PUBLISHED]: ["green", t("products.productStatus.published")],
|
|
50
|
+
[import_types.ProductStatus.REJECTED]: ["red", t("products.productStatus.rejected")]
|
|
51
|
+
}[status];
|
|
52
|
+
return /* @__PURE__ */ jsx2(StatusCell, { color, children: text });
|
|
53
|
+
};
|
|
54
|
+
var ProductStatusHeader = () => {
|
|
55
|
+
const { t } = useTranslation2();
|
|
56
|
+
return /* @__PURE__ */ jsx2("div", { className: "flex h-full w-full items-center", children: /* @__PURE__ */ jsx2("span", { children: t("fields.status") }) });
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
export {
|
|
60
|
+
CategoryCell,
|
|
61
|
+
CategoryHeader,
|
|
62
|
+
ProductStatusCell,
|
|
63
|
+
ProductStatusHeader
|
|
64
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// src/pages/products/common/constants.ts
|
|
2
|
+
var PRODUCT_DETAIL_FIELDS = [
|
|
3
|
+
"*variants.images",
|
|
4
|
+
"*categories",
|
|
5
|
+
"+additional_data",
|
|
6
|
+
"*scoped_attributes",
|
|
7
|
+
"+attribute_values.*",
|
|
8
|
+
"+attribute_values.attribute.*"
|
|
9
|
+
].join(",");
|
|
10
|
+
var PRODUCT_DETAIL_QUERY = { fields: PRODUCT_DETAIL_FIELDS };
|
|
11
|
+
|
|
12
|
+
export {
|
|
13
|
+
PRODUCT_DETAIL_QUERY
|
|
14
|
+
};
|