@commercelayer/sdk 7.0.0-rc.10 → 7.0.0-rc.12
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/lib/{api-DF66S5Gh.d.ts → api-BIiVfx1G.d.ts} +66 -47
- package/lib/{api-2OqdnITp.d.cts → api-xIgvzFhW.d.cts} +66 -47
- package/lib/api.cjs +24 -24
- package/lib/api.d.cts +1 -1
- package/lib/api.d.ts +1 -1
- package/lib/api.js +12 -12
- package/lib/bundle.cjs +26 -26
- package/lib/bundle.cjs.map +1 -1
- package/lib/bundle.d.cts +1 -1
- package/lib/bundle.d.ts +1 -1
- package/lib/bundle.js +13 -13
- package/lib/bundle.js.map +1 -1
- package/lib/chunk-2AFNQJXP.cjs.map +1 -1
- package/lib/chunk-2AMKJ6V7.cjs.map +1 -1
- package/lib/chunk-2HLQW5MF.cjs.map +1 -1
- package/lib/chunk-2HPO4UZA.cjs.map +1 -1
- package/lib/chunk-2JOYLKTP.cjs.map +1 -1
- package/lib/chunk-2KKHO6QF.js.map +1 -1
- package/lib/chunk-2L2ZM3VD.js.map +1 -1
- package/lib/chunk-2P6AFRJL.js.map +1 -1
- package/lib/chunk-2PYM3QGA.js.map +1 -1
- package/lib/chunk-2THU5NEW.cjs.map +1 -1
- package/lib/{chunk-BF7OPORP.js → chunk-2UUZHL2R.js} +2 -2
- package/lib/{chunk-BF7OPORP.js.map → chunk-2UUZHL2R.js.map} +1 -1
- package/lib/chunk-2XGMKMF5.cjs.map +1 -1
- package/lib/chunk-34H2NFDA.js.map +1 -1
- package/lib/chunk-35OHXDG3.cjs.map +1 -1
- package/lib/chunk-3ADITMLN.cjs.map +1 -1
- package/lib/chunk-3ANXNJ6U.cjs.map +1 -1
- package/lib/chunk-3AOPII3W.js.map +1 -1
- package/lib/chunk-3DFZ5QLR.js.map +1 -1
- package/lib/chunk-3I5BJF3J.js.map +1 -1
- package/lib/chunk-3N2MNKA3.js.map +1 -1
- package/lib/chunk-3NWQH32A.js.map +1 -1
- package/lib/chunk-3OBFBFUV.js.map +1 -1
- package/lib/chunk-3PVKJIA3.js.map +1 -1
- package/lib/chunk-3RR27O3T.js.map +1 -1
- package/lib/chunk-3TGZNMLP.cjs.map +1 -1
- package/lib/chunk-3URHH3S6.js.map +1 -1
- package/lib/chunk-3WKN5OCU.cjs.map +1 -1
- package/lib/chunk-3XWE56FL.cjs.map +1 -1
- package/lib/chunk-42DT6ZET.cjs.map +1 -1
- package/lib/chunk-432EXURP.js.map +1 -1
- package/lib/chunk-4IH4EHXT.cjs.map +1 -1
- package/lib/chunk-4KFJUIFD.js.map +1 -1
- package/lib/chunk-4KO5LZ7F.js.map +1 -1
- package/lib/chunk-4L4MGCUZ.js.map +1 -1
- package/lib/chunk-4L73LJKG.js.map +1 -1
- package/lib/{chunk-RWPFE3LF.cjs → chunk-4NI5SICY.cjs} +2 -2
- package/lib/chunk-4NI5SICY.cjs.map +1 -0
- package/lib/chunk-4SCFKFIM.cjs.map +1 -1
- package/lib/chunk-57XXD3GQ.cjs.map +1 -1
- package/lib/chunk-5EXCGVF2.cjs.map +1 -1
- package/lib/chunk-5FZNBGAF.cjs.map +1 -1
- package/lib/{chunk-NMVACSMG.js → chunk-5NMDIVXH.js} +2 -2
- package/lib/chunk-5NMDIVXH.js.map +1 -0
- package/lib/chunk-5OQQBNVB.js.map +1 -1
- package/lib/chunk-5P5Z7NXC.js.map +1 -1
- package/lib/chunk-5R76TU4I.cjs.map +1 -1
- package/lib/chunk-627I2FYX.cjs.map +1 -1
- package/lib/chunk-66JDSPFD.cjs.map +1 -1
- package/lib/chunk-67QVA2J3.cjs.map +1 -1
- package/lib/chunk-6AJSOS56.cjs.map +1 -1
- package/lib/chunk-6B66AQKB.cjs.map +1 -1
- package/lib/chunk-6OHA2TO3.cjs.map +1 -1
- package/lib/chunk-6PWK52UZ.cjs.map +1 -1
- package/lib/chunk-6SCAIB4K.cjs.map +1 -1
- package/lib/chunk-6SOWFGBP.cjs.map +1 -1
- package/lib/chunk-7CQTUOR4.cjs.map +1 -1
- package/lib/chunk-7ISS2FDY.js.map +1 -1
- package/lib/chunk-7JLRB7QH.js.map +1 -1
- package/lib/chunk-7SG4WU7W.js.map +1 -1
- package/lib/chunk-7SZY5BWE.js.map +1 -1
- package/lib/chunk-7VSYXEXL.js.map +1 -1
- package/lib/chunk-7Z2U4MHU.cjs.map +1 -1
- package/lib/chunk-A6BT5FSV.cjs.map +1 -1
- package/lib/chunk-A7BEMDVP.cjs.map +1 -1
- package/lib/chunk-AD73LDFJ.cjs.map +1 -1
- package/lib/{chunk-P3NADEGE.cjs → chunk-AGNIOGQC.cjs} +2 -2
- package/lib/chunk-AGNIOGQC.cjs.map +1 -0
- package/lib/chunk-AIGQRBCY.cjs.map +1 -1
- package/lib/chunk-ANCLAYJV.cjs.map +1 -1
- package/lib/chunk-AQFAND5D.cjs.map +1 -1
- package/lib/chunk-ARIBIRKF.cjs.map +1 -1
- package/lib/{chunk-EJSNNH47.js → chunk-AVJX4OEZ.js} +3 -3
- package/lib/{chunk-EJSNNH47.js.map → chunk-AVJX4OEZ.js.map} +1 -1
- package/lib/chunk-AW3TRBZ7.js.map +1 -1
- package/lib/chunk-AYTBSAHY.js.map +1 -1
- package/lib/chunk-B72FREUL.cjs.map +1 -1
- package/lib/chunk-BBEMCANC.cjs.map +1 -1
- package/lib/{chunk-JN4JL4WT.cjs → chunk-BJYOKKGX.cjs} +2 -2
- package/lib/{chunk-JN4JL4WT.cjs.map → chunk-BJYOKKGX.cjs.map} +1 -1
- package/lib/chunk-BN6XJAZH.cjs.map +1 -1
- package/lib/chunk-BTAKU6V5.cjs.map +1 -1
- package/lib/chunk-CG2ACHGS.js.map +1 -1
- package/lib/chunk-CHYP5F26.js.map +1 -1
- package/lib/chunk-CK6RZLVM.cjs.map +1 -1
- package/lib/chunk-CNCZCBI3.js.map +1 -1
- package/lib/chunk-CRRYP7ZN.js.map +1 -1
- package/lib/chunk-CTXBUDGO.cjs.map +1 -1
- package/lib/chunk-CUNOMS5N.js.map +1 -1
- package/lib/chunk-D26KDUDM.cjs.map +1 -1
- package/lib/chunk-D5E4OGXU.js.map +1 -1
- package/lib/chunk-D7KNSKNJ.js.map +1 -1
- package/lib/chunk-DAXKXBA3.js.map +1 -1
- package/lib/{chunk-465K3KVE.js → chunk-DGW3ZSW6.js} +2 -2
- package/lib/chunk-DGW3ZSW6.js.map +1 -0
- package/lib/chunk-DJ572MZB.cjs.map +1 -1
- package/lib/chunk-DOFPDQMJ.cjs.map +1 -1
- package/lib/chunk-DOGEZ6XX.cjs.map +1 -1
- package/lib/chunk-DSKZRVXS.js.map +1 -1
- package/lib/chunk-DTGODPCN.js.map +1 -1
- package/lib/chunk-DYZGWPZ6.js.map +1 -1
- package/lib/chunk-E3FDHGI7.js.map +1 -1
- package/lib/chunk-E4DYW6HB.cjs.map +1 -1
- package/lib/{chunk-ZFG533LP.js → chunk-E65GENXB.js} +2 -2
- package/lib/{chunk-ZFG533LP.js.map → chunk-E65GENXB.js.map} +1 -1
- package/lib/chunk-E6TBQVLK.cjs.map +1 -1
- package/lib/chunk-EADFDBOR.cjs.map +1 -1
- package/lib/chunk-ECMCBU3N.js.map +1 -1
- package/lib/chunk-EEFOL62K.js.map +1 -1
- package/lib/chunk-EHWAGYNX.js.map +1 -1
- package/lib/chunk-ELBOXOTA.js.map +1 -1
- package/lib/chunk-EP22KKHR.js.map +1 -1
- package/lib/chunk-EP7MAEQH.cjs.map +1 -1
- package/lib/chunk-EQD223JW.cjs.map +1 -1
- package/lib/{chunk-LCLXLB2R.cjs → chunk-ESMKOP42.cjs} +5 -2
- package/lib/chunk-ESMKOP42.cjs.map +1 -0
- package/lib/chunk-F6MSHDB7.cjs.map +1 -1
- package/lib/chunk-FAU5EILL.js.map +1 -1
- package/lib/{chunk-HLCGKY7R.js → chunk-FO7WBEPF.js} +2 -2
- package/lib/chunk-FO7WBEPF.js.map +1 -0
- package/lib/chunk-FSFXOZ35.cjs.map +1 -1
- package/lib/chunk-FTAZDUH6.js.map +1 -1
- package/lib/chunk-FVJDRHG7.js.map +1 -1
- package/lib/chunk-FXE62CPP.cjs.map +1 -1
- package/lib/chunk-FYKIHWAM.cjs.map +1 -1
- package/lib/chunk-G74OZ4M6.js.map +1 -1
- package/lib/chunk-GD4WRDF2.js.map +1 -1
- package/lib/chunk-GE6OHQR6.cjs.map +1 -1
- package/lib/chunk-GHLCA7BX.js.map +1 -1
- package/lib/chunk-GLSPCG3M.cjs.map +1 -1
- package/lib/chunk-H2USYPU6.js.map +1 -1
- package/lib/chunk-H4PUXGNI.cjs.map +1 -1
- package/lib/chunk-H4SVEI6E.js.map +1 -1
- package/lib/chunk-HAAE23MQ.js.map +1 -1
- package/lib/chunk-HBUDZOK7.cjs.map +1 -1
- package/lib/chunk-HCBXRHD7.js.map +1 -1
- package/lib/chunk-HDYENVKD.js.map +1 -1
- package/lib/{chunk-LEWK7QET.cjs → chunk-HERQULAV.cjs} +2 -2
- package/lib/chunk-HERQULAV.cjs.map +1 -0
- package/lib/chunk-HNHF6T2I.cjs.map +1 -1
- package/lib/{chunk-HQ35KQFG.cjs → chunk-HNONYIDO.cjs} +2 -2
- package/lib/chunk-HNONYIDO.cjs.map +1 -0
- package/lib/chunk-HQ5STEMD.js.map +1 -1
- package/lib/chunk-HQ6TJSB7.cjs.map +1 -1
- package/lib/chunk-HSILJQCD.js.map +1 -1
- package/lib/chunk-I3SKGXTB.cjs.map +1 -1
- package/lib/chunk-IDAOX5RB.cjs.map +1 -1
- package/lib/chunk-IITNQS6D.js.map +1 -1
- package/lib/chunk-IKENWSRH.cjs.map +1 -1
- package/lib/chunk-IKHD5UQP.cjs.map +1 -1
- package/lib/chunk-INJ7FRDA.cjs.map +1 -1
- package/lib/chunk-INZD34YD.cjs.map +1 -1
- package/lib/chunk-J4CTOHX6.cjs.map +1 -1
- package/lib/chunk-J6NBJHWL.cjs.map +1 -1
- package/lib/chunk-J6PTNG3D.js.map +1 -1
- package/lib/chunk-J7ZSBB35.js.map +1 -1
- package/lib/chunk-JAQECLCE.js.map +1 -1
- package/lib/chunk-JECYKPCC.cjs.map +1 -1
- package/lib/chunk-JPUF5YXX.js.map +1 -1
- package/lib/chunk-JRTJ6LWK.js.map +1 -1
- package/lib/chunk-JT7HVLLW.cjs.map +1 -1
- package/lib/chunk-JVF5KY2J.cjs.map +1 -1
- package/lib/chunk-JWC2GSYH.cjs.map +1 -1
- package/lib/chunk-JYOFP6BM.js.map +1 -1
- package/lib/chunk-JYXAF775.js.map +1 -1
- package/lib/chunk-K2CU5HIV.js.map +1 -1
- package/lib/chunk-K6WSCQKS.cjs.map +1 -1
- package/lib/chunk-KH5OQRQL.js.map +1 -1
- package/lib/{chunk-7X36B7N6.js → chunk-KITKWF6F.js} +2 -2
- package/lib/chunk-KITKWF6F.js.map +1 -0
- package/lib/{chunk-KBN3FFXD.cjs → chunk-KPRWSW6P.cjs} +2 -2
- package/lib/chunk-KPRWSW6P.cjs.map +1 -0
- package/lib/{chunk-7GVHCOUC.js → chunk-KU5U6DTU.js} +2 -2
- package/lib/{chunk-7GVHCOUC.js.map → chunk-KU5U6DTU.js.map} +1 -1
- package/lib/chunk-KWRDUU7K.js.map +1 -1
- package/lib/chunk-L4LPS3DV.cjs.map +1 -1
- package/lib/chunk-L4TDKOAC.js.map +1 -1
- package/lib/chunk-L5NEDGXK.js.map +1 -1
- package/lib/chunk-L6IGO47T.js.map +1 -1
- package/lib/chunk-LCNT6GY3.js.map +1 -1
- package/lib/chunk-LIT4FEIU.cjs.map +1 -1
- package/lib/chunk-LJ2EP6AL.cjs.map +1 -1
- package/lib/chunk-LNMY5BDT.js.map +1 -1
- package/lib/chunk-LTLMRGB7.js.map +1 -1
- package/lib/chunk-M2ZERG2X.cjs.map +1 -1
- package/lib/chunk-MADGMICB.js.map +1 -1
- package/lib/{chunk-VDZUWCIN.cjs → chunk-MCGX2ZDC.cjs} +2 -2
- package/lib/{chunk-VDZUWCIN.cjs.map → chunk-MCGX2ZDC.cjs.map} +1 -1
- package/lib/chunk-MJRMRWP3.js.map +1 -1
- package/lib/chunk-MPSHBMZS.js.map +1 -1
- package/lib/chunk-MQZSDICO.cjs.map +1 -1
- package/lib/chunk-MUPRLXGP.js.map +1 -1
- package/lib/chunk-MWYBER5I.cjs.map +1 -1
- package/lib/chunk-MZNHRIXE.js.map +1 -1
- package/lib/chunk-N4P7A3RY.js.map +1 -1
- package/lib/chunk-N6MHUHGE.cjs.map +1 -1
- package/lib/chunk-N753UD4K.cjs.map +1 -1
- package/lib/chunk-NAWKHFBZ.js.map +1 -1
- package/lib/chunk-NBYV35R4.cjs.map +1 -1
- package/lib/chunk-NDPDO54G.js.map +1 -1
- package/lib/chunk-NEC22ZSI.cjs.map +1 -1
- package/lib/{chunk-OPQJPXLM.cjs → chunk-NIHOABAW.cjs} +2 -2
- package/lib/chunk-NIHOABAW.cjs.map +1 -0
- package/lib/chunk-NJYMO7FP.cjs.map +1 -1
- package/lib/chunk-NODKE6P4.js.map +1 -1
- package/lib/chunk-OGLS27LJ.js.map +1 -1
- package/lib/chunk-OYFNK2SE.cjs.map +1 -1
- package/lib/chunk-PEU5GGGE.js.map +1 -1
- package/lib/chunk-PNSVP3KP.cjs.map +1 -1
- package/lib/chunk-PQS6KXZ2.cjs.map +1 -1
- package/lib/chunk-PV7MUP5Z.js.map +1 -1
- package/lib/chunk-PZZLLHJP.js.map +1 -1
- package/lib/chunk-Q2ZSQM7I.js.map +1 -1
- package/lib/chunk-Q66HILUF.js.map +1 -1
- package/lib/chunk-Q66JEOCJ.cjs.map +1 -1
- package/lib/chunk-Q7YHSPJL.js.map +1 -1
- package/lib/chunk-QGE4ELJO.cjs.map +1 -1
- package/lib/chunk-QK5MFD4L.js.map +1 -1
- package/lib/chunk-QK7D6L3W.js.map +1 -1
- package/lib/chunk-QYDOENWU.cjs.map +1 -1
- package/lib/chunk-QZTNLPOD.cjs.map +1 -1
- package/lib/chunk-QZWQNPKC.js.map +1 -1
- package/lib/chunk-R2LRLUUY.js.map +1 -1
- package/lib/chunk-R755X3AG.cjs.map +1 -1
- package/lib/chunk-RHARO4TQ.cjs.map +1 -1
- package/lib/{chunk-QHRQCFDB.js → chunk-RL7Y22OT.js} +2 -2
- package/lib/chunk-RL7Y22OT.js.map +1 -0
- package/lib/chunk-ROPOLXIV.js.map +1 -1
- package/lib/chunk-RT7XLEV6.js.map +1 -1
- package/lib/chunk-RTDD2NRL.cjs.map +1 -1
- package/lib/chunk-RTGW34KX.cjs.map +1 -1
- package/lib/{chunk-RTLW5O74.cjs → chunk-S3MCPCGR.cjs} +4 -4
- package/lib/{chunk-RTLW5O74.cjs.map → chunk-S3MCPCGR.cjs.map} +1 -1
- package/lib/chunk-SGOUEVJ3.cjs.map +1 -1
- package/lib/chunk-SGWRNEJB.cjs.map +1 -1
- package/lib/chunk-SKFA2ZIK.js.map +1 -1
- package/lib/chunk-SN6BP777.js.map +1 -1
- package/lib/chunk-SOXJJRL2.js.map +1 -1
- package/lib/chunk-SPLHKBWG.cjs.map +1 -1
- package/lib/chunk-SRW7OWVS.cjs.map +1 -1
- package/lib/chunk-SUJCEUOZ.cjs.map +1 -1
- package/lib/chunk-SWWPX4V4.cjs.map +1 -1
- package/lib/chunk-THO6KQJZ.js.map +1 -1
- package/lib/chunk-THVPSJTK.cjs.map +1 -1
- package/lib/chunk-TIJIXGNJ.cjs.map +1 -1
- package/lib/chunk-TM5OCFYV.cjs.map +1 -1
- package/lib/{chunk-VLLLEX5J.js → chunk-TOV6ECTA.js} +2 -2
- package/lib/chunk-TOV6ECTA.js.map +1 -0
- package/lib/chunk-TQFODT4D.cjs.map +1 -1
- package/lib/chunk-TSD2PK6H.js.map +1 -1
- package/lib/chunk-TSLXKI72.js.map +1 -1
- package/lib/chunk-U5FTZYJJ.js.map +1 -1
- package/lib/chunk-U6PW4AZV.js.map +1 -1
- package/lib/chunk-UB6JC3W7.js.map +1 -1
- package/lib/chunk-UBXNH6J3.js.map +1 -1
- package/lib/chunk-UP7FR6HD.cjs.map +1 -1
- package/lib/chunk-VNWOCO65.cjs.map +1 -1
- package/lib/chunk-VPXMI42G.cjs.map +1 -1
- package/lib/chunk-VRFSITD3.js.map +1 -1
- package/lib/chunk-VUCYIRSC.cjs.map +1 -1
- package/lib/{chunk-NJQDJCFB.cjs → chunk-W6AL2GJ4.cjs} +2 -2
- package/lib/{chunk-NJQDJCFB.cjs.map → chunk-W6AL2GJ4.cjs.map} +1 -1
- package/lib/{chunk-EKGR3EB3.js → chunk-W6YJDUYD.js} +2 -2
- package/lib/chunk-W6YJDUYD.js.map +1 -0
- package/lib/chunk-WAL76UPE.cjs.map +1 -1
- package/lib/chunk-WBPEFNL7.cjs.map +1 -1
- package/lib/{chunk-NKJBVNTV.cjs → chunk-WC4Z7ENS.cjs} +2 -2
- package/lib/chunk-WC4Z7ENS.cjs.map +1 -0
- package/lib/{chunk-BOPK7T5K.js → chunk-WI5IVLYL.js} +2 -2
- package/lib/chunk-WI5IVLYL.js.map +1 -0
- package/lib/chunk-WKN5RLNR.js.map +1 -1
- package/lib/chunk-WP3L72CW.js.map +1 -1
- package/lib/chunk-WTHX574O.js.map +1 -1
- package/lib/{chunk-IIR3UVU2.js → chunk-WVAW33XQ.js} +3 -3
- package/lib/chunk-WVAW33XQ.js.map +1 -0
- package/lib/{chunk-JENLN6VJ.js → chunk-WVKEXOIY.js} +5 -2
- package/lib/chunk-WVKEXOIY.js.map +1 -0
- package/lib/chunk-WXD4O4UY.js.map +1 -1
- package/lib/{chunk-RIMDGLIA.cjs → chunk-WXE5KXJC.cjs} +3 -3
- package/lib/chunk-WXE5KXJC.cjs.map +1 -0
- package/lib/chunk-X2D47UM7.cjs.map +1 -1
- package/lib/chunk-X6PHZA6P.cjs.map +1 -1
- package/lib/chunk-XD7GS4QW.js.map +1 -1
- package/lib/chunk-XMDDYWH5.js.map +1 -1
- package/lib/chunk-XPF5Z2WY.js.map +1 -1
- package/lib/chunk-XR3KEV7U.js.map +1 -1
- package/lib/chunk-XUC3BYL2.cjs.map +1 -1
- package/lib/chunk-Y2IGLW5N.js.map +1 -1
- package/lib/chunk-Y3BFYVWA.js.map +1 -1
- package/lib/{chunk-VMJUXZ67.cjs → chunk-Y5BP4C42.cjs} +2 -2
- package/lib/chunk-Y5BP4C42.cjs.map +1 -0
- package/lib/chunk-YAKNUPNE.cjs.map +1 -1
- package/lib/chunk-YAVHAWTZ.js.map +1 -1
- package/lib/chunk-YBXRC6MC.js.map +1 -1
- package/lib/chunk-YHYBOXVX.cjs.map +1 -1
- package/lib/chunk-YIDX7HVR.cjs.map +1 -1
- package/lib/chunk-YN4M5CNJ.js.map +1 -1
- package/lib/chunk-YOHBJHTH.cjs.map +1 -1
- package/lib/chunk-YUGZUUAU.js.map +1 -1
- package/lib/chunk-YY5ENJSH.cjs.map +1 -1
- package/lib/chunk-Z2QVXW6T.cjs.map +1 -1
- package/lib/chunk-Z667GAZJ.js.map +1 -1
- package/lib/chunk-Z7DKPFKZ.js.map +1 -1
- package/lib/chunk-ZAISVVBE.cjs.map +1 -1
- package/lib/chunk-ZASD6IUL.js.map +1 -1
- package/lib/chunk-ZEEB5YAU.js.map +1 -1
- package/lib/chunk-ZQSCFH5J.cjs.map +1 -1
- package/lib/chunk-ZTVQSWSD.cjs.map +1 -1
- package/lib/chunk-ZU7GFVQ6.js.map +1 -1
- package/lib/chunk-ZZF34M2E.cjs.map +1 -1
- package/lib/client.d.cts +3 -1
- package/lib/commercelayer.cjs +5 -5
- package/lib/commercelayer.d.cts +6 -4
- package/lib/commercelayer.d.ts +3 -3
- package/lib/commercelayer.js +1 -1
- package/lib/enum.d.cts +1 -1
- package/lib/enum.d.ts +1 -1
- package/lib/index.cjs +29 -29
- package/lib/index.d.cts +5 -2
- package/lib/index.d.ts +1 -1
- package/lib/index.js +14 -14
- package/lib/jsonapi.d.cts +1 -1
- package/lib/jsonapi.d.ts +1 -1
- package/lib/model.d.cts +1 -1
- package/lib/model.d.ts +1 -1
- package/lib/query.d.cts +1 -1
- package/lib/query.d.ts +1 -1
- package/lib/resource.d.cts +1 -1
- package/lib/resource.d.ts +1 -1
- package/lib/resources/addresses.d.cts +4 -1
- package/lib/resources/addresses.d.ts +1 -1
- package/lib/resources/adjustments.d.cts +4 -1
- package/lib/resources/adjustments.d.ts +1 -1
- package/lib/resources/adyen_gateways.d.cts +4 -1
- package/lib/resources/adyen_gateways.d.ts +1 -1
- package/lib/resources/adyen_payments.cjs +2 -2
- package/lib/resources/adyen_payments.d.cts +4 -1
- package/lib/resources/adyen_payments.d.ts +1 -1
- package/lib/resources/adyen_payments.js +1 -1
- package/lib/resources/applications.cjs +2 -2
- package/lib/resources/applications.d.cts +4 -1
- package/lib/resources/applications.d.ts +1 -1
- package/lib/resources/applications.js +1 -1
- package/lib/resources/attachments.d.cts +4 -1
- package/lib/resources/attachments.d.ts +1 -1
- package/lib/resources/authorizations.d.cts +4 -1
- package/lib/resources/authorizations.d.ts +1 -1
- package/lib/resources/avalara_accounts.d.cts +4 -1
- package/lib/resources/avalara_accounts.d.ts +1 -1
- package/lib/resources/axerve_gateways.d.cts +4 -1
- package/lib/resources/axerve_gateways.d.ts +1 -1
- package/lib/resources/axerve_payments.d.cts +4 -1
- package/lib/resources/axerve_payments.d.ts +1 -1
- package/lib/resources/bing_geocoders.d.cts +4 -1
- package/lib/resources/bing_geocoders.d.ts +1 -1
- package/lib/resources/braintree_gateways.d.cts +4 -1
- package/lib/resources/braintree_gateways.d.ts +1 -1
- package/lib/resources/braintree_payments.d.cts +4 -1
- package/lib/resources/braintree_payments.d.ts +1 -1
- package/lib/resources/bundles.d.cts +4 -1
- package/lib/resources/bundles.d.ts +1 -1
- package/lib/resources/buy_x_pay_y_promotions.d.cts +4 -1
- package/lib/resources/buy_x_pay_y_promotions.d.ts +1 -1
- package/lib/resources/captures.d.cts +4 -1
- package/lib/resources/captures.d.ts +1 -1
- package/lib/resources/carrier_accounts.d.cts +4 -1
- package/lib/resources/carrier_accounts.d.ts +1 -1
- package/lib/resources/checkout_com_gateways.d.cts +4 -1
- package/lib/resources/checkout_com_gateways.d.ts +1 -1
- package/lib/resources/checkout_com_payments.cjs +2 -2
- package/lib/resources/checkout_com_payments.d.cts +4 -1
- package/lib/resources/checkout_com_payments.d.ts +1 -1
- package/lib/resources/checkout_com_payments.js +1 -1
- package/lib/resources/cleanups.d.cts +4 -1
- package/lib/resources/cleanups.d.ts +1 -1
- package/lib/resources/coupon_codes_promotion_rules.d.cts +4 -1
- package/lib/resources/coupon_codes_promotion_rules.d.ts +1 -1
- package/lib/resources/coupon_recipients.d.cts +4 -1
- package/lib/resources/coupon_recipients.d.ts +1 -1
- package/lib/resources/coupons.d.cts +4 -1
- package/lib/resources/coupons.d.ts +1 -1
- package/lib/resources/custom_promotion_rules.d.cts +4 -1
- package/lib/resources/custom_promotion_rules.d.ts +1 -1
- package/lib/resources/customer_addresses.d.cts +4 -1
- package/lib/resources/customer_addresses.d.ts +1 -1
- package/lib/resources/customer_groups.d.cts +4 -1
- package/lib/resources/customer_groups.d.ts +1 -1
- package/lib/resources/customer_password_resets.d.cts +4 -1
- package/lib/resources/customer_password_resets.d.ts +1 -1
- package/lib/resources/customer_payment_sources.d.cts +4 -1
- package/lib/resources/customer_payment_sources.d.ts +1 -1
- package/lib/resources/customer_subscriptions.d.cts +4 -1
- package/lib/resources/customer_subscriptions.d.ts +1 -1
- package/lib/resources/customers.cjs +2 -2
- package/lib/resources/customers.d.cts +4 -1
- package/lib/resources/customers.d.ts +1 -1
- package/lib/resources/customers.js +1 -1
- package/lib/resources/delivery_lead_times.d.cts +4 -1
- package/lib/resources/delivery_lead_times.d.ts +1 -1
- package/lib/resources/discount_engine_items.d.cts +4 -1
- package/lib/resources/discount_engine_items.d.ts +1 -1
- package/lib/resources/discount_engines.d.cts +4 -1
- package/lib/resources/discount_engines.d.ts +1 -1
- package/lib/resources/easypost_pickups.d.cts +4 -1
- package/lib/resources/easypost_pickups.d.ts +1 -1
- package/lib/resources/event_callbacks.d.cts +4 -1
- package/lib/resources/event_callbacks.d.ts +1 -1
- package/lib/resources/events.d.cts +4 -1
- package/lib/resources/events.d.ts +1 -1
- package/lib/resources/exports.d.cts +4 -1
- package/lib/resources/exports.d.ts +1 -1
- package/lib/resources/external_gateways.d.cts +4 -1
- package/lib/resources/external_gateways.d.ts +1 -1
- package/lib/resources/external_payments.d.cts +4 -1
- package/lib/resources/external_payments.d.ts +1 -1
- package/lib/resources/external_promotions.d.cts +4 -1
- package/lib/resources/external_promotions.d.ts +1 -1
- package/lib/resources/external_tax_calculators.d.cts +4 -1
- package/lib/resources/external_tax_calculators.d.ts +1 -1
- package/lib/resources/fixed_amount_promotions.d.cts +4 -1
- package/lib/resources/fixed_amount_promotions.d.ts +1 -1
- package/lib/resources/fixed_price_promotions.d.cts +4 -1
- package/lib/resources/fixed_price_promotions.d.ts +1 -1
- package/lib/resources/flex_promotions.cjs +2 -2
- package/lib/resources/flex_promotions.d.cts +4 -1
- package/lib/resources/flex_promotions.d.ts +1 -1
- package/lib/resources/flex_promotions.js +1 -1
- package/lib/resources/free_gift_promotions.d.cts +4 -1
- package/lib/resources/free_gift_promotions.d.ts +1 -1
- package/lib/resources/free_shipping_promotions.d.cts +4 -1
- package/lib/resources/free_shipping_promotions.d.ts +1 -1
- package/lib/resources/geocoders.d.cts +4 -1
- package/lib/resources/geocoders.d.ts +1 -1
- package/lib/resources/gift_card_recipients.d.cts +4 -1
- package/lib/resources/gift_card_recipients.d.ts +1 -1
- package/lib/resources/gift_cards.d.cts +4 -1
- package/lib/resources/gift_cards.d.ts +1 -1
- package/lib/resources/google_geocoders.d.cts +4 -1
- package/lib/resources/google_geocoders.d.ts +1 -1
- package/lib/resources/imports.d.cts +4 -1
- package/lib/resources/imports.d.ts +1 -1
- package/lib/resources/in_stock_subscriptions.d.cts +4 -1
- package/lib/resources/in_stock_subscriptions.d.ts +1 -1
- package/lib/resources/inventory_models.d.cts +4 -1
- package/lib/resources/inventory_models.d.ts +1 -1
- package/lib/resources/inventory_return_locations.d.cts +4 -1
- package/lib/resources/inventory_return_locations.d.ts +1 -1
- package/lib/resources/inventory_stock_locations.d.cts +4 -1
- package/lib/resources/inventory_stock_locations.d.ts +1 -1
- package/lib/resources/klarna_gateways.d.cts +4 -1
- package/lib/resources/klarna_gateways.d.ts +1 -1
- package/lib/resources/klarna_payments.d.cts +4 -1
- package/lib/resources/klarna_payments.d.ts +1 -1
- package/lib/resources/line_item_options.d.cts +4 -1
- package/lib/resources/line_item_options.d.ts +1 -1
- package/lib/resources/line_items.cjs +2 -2
- package/lib/resources/line_items.d.cts +4 -1
- package/lib/resources/line_items.d.ts +1 -1
- package/lib/resources/line_items.js +1 -1
- package/lib/resources/links.d.cts +4 -1
- package/lib/resources/links.d.ts +1 -1
- package/lib/resources/manual_gateways.d.cts +4 -1
- package/lib/resources/manual_gateways.d.ts +1 -1
- package/lib/resources/manual_tax_calculators.d.cts +4 -1
- package/lib/resources/manual_tax_calculators.d.ts +1 -1
- package/lib/resources/markets.d.cts +4 -1
- package/lib/resources/markets.d.ts +1 -1
- package/lib/resources/merchants.d.cts +4 -1
- package/lib/resources/merchants.d.ts +1 -1
- package/lib/resources/notifications.d.cts +4 -1
- package/lib/resources/notifications.d.ts +1 -1
- package/lib/resources/order_amount_promotion_rules.d.cts +4 -1
- package/lib/resources/order_amount_promotion_rules.d.ts +1 -1
- package/lib/resources/order_copies.d.cts +4 -1
- package/lib/resources/order_copies.d.ts +1 -1
- package/lib/resources/order_factories.d.cts +4 -1
- package/lib/resources/order_factories.d.ts +1 -1
- package/lib/resources/order_subscription_items.d.cts +4 -1
- package/lib/resources/order_subscription_items.d.ts +1 -1
- package/lib/resources/order_subscriptions.d.cts +4 -1
- package/lib/resources/order_subscriptions.d.ts +1 -1
- package/lib/resources/orders.d.cts +4 -1
- package/lib/resources/orders.d.ts +1 -1
- package/lib/resources/organizations.d.cts +4 -1
- package/lib/resources/organizations.d.ts +1 -1
- package/lib/resources/packages.d.cts +4 -1
- package/lib/resources/packages.d.ts +1 -1
- package/lib/resources/parcel_line_items.d.cts +4 -1
- package/lib/resources/parcel_line_items.d.ts +1 -1
- package/lib/resources/parcels.d.cts +4 -1
- package/lib/resources/parcels.d.ts +1 -1
- package/lib/resources/payment_gateways.d.cts +4 -1
- package/lib/resources/payment_gateways.d.ts +1 -1
- package/lib/resources/payment_methods.cjs +2 -2
- package/lib/resources/payment_methods.d.cts +4 -1
- package/lib/resources/payment_methods.d.ts +1 -1
- package/lib/resources/payment_methods.js +1 -1
- package/lib/resources/payment_options.cjs +2 -2
- package/lib/resources/payment_options.d.cts +4 -1
- package/lib/resources/payment_options.d.ts +1 -1
- package/lib/resources/payment_options.js +1 -1
- package/lib/resources/paypal_gateways.d.cts +4 -1
- package/lib/resources/paypal_gateways.d.ts +1 -1
- package/lib/resources/paypal_payments.d.cts +4 -1
- package/lib/resources/paypal_payments.d.ts +1 -1
- package/lib/resources/percentage_discount_promotions.d.cts +4 -1
- package/lib/resources/percentage_discount_promotions.d.ts +1 -1
- package/lib/resources/pickups.d.cts +4 -1
- package/lib/resources/pickups.d.ts +1 -1
- package/lib/resources/price_frequency_tiers.d.cts +4 -1
- package/lib/resources/price_frequency_tiers.d.ts +1 -1
- package/lib/resources/price_list_schedulers.d.cts +4 -1
- package/lib/resources/price_list_schedulers.d.ts +1 -1
- package/lib/resources/price_lists.cjs +2 -2
- package/lib/resources/price_lists.d.cts +4 -1
- package/lib/resources/price_lists.d.ts +1 -1
- package/lib/resources/price_lists.js +1 -1
- package/lib/resources/price_tiers.d.cts +4 -1
- package/lib/resources/price_tiers.d.ts +1 -1
- package/lib/resources/price_volume_tiers.d.cts +4 -1
- package/lib/resources/price_volume_tiers.d.ts +1 -1
- package/lib/resources/prices.cjs +2 -2
- package/lib/resources/prices.d.cts +4 -1
- package/lib/resources/prices.d.ts +1 -1
- package/lib/resources/prices.js +1 -1
- package/lib/resources/promotion_rules.d.cts +4 -1
- package/lib/resources/promotion_rules.d.ts +1 -1
- package/lib/resources/promotions.d.cts +4 -1
- package/lib/resources/promotions.d.ts +1 -1
- package/lib/resources/recurring_order_copies.d.cts +4 -1
- package/lib/resources/recurring_order_copies.d.ts +1 -1
- package/lib/resources/refunds.d.cts +4 -1
- package/lib/resources/refunds.d.ts +1 -1
- package/lib/resources/reserved_stocks.d.cts +4 -1
- package/lib/resources/reserved_stocks.d.ts +1 -1
- package/lib/resources/resource_errors.d.cts +4 -1
- package/lib/resources/resource_errors.d.ts +1 -1
- package/lib/resources/return_line_items.d.cts +4 -1
- package/lib/resources/return_line_items.d.ts +1 -1
- package/lib/resources/returns.d.cts +4 -1
- package/lib/resources/returns.d.ts +1 -1
- package/lib/resources/satispay_gateways.d.cts +4 -1
- package/lib/resources/satispay_gateways.d.ts +1 -1
- package/lib/resources/satispay_payments.d.cts +4 -1
- package/lib/resources/satispay_payments.d.ts +1 -1
- package/lib/resources/shipments.d.cts +4 -1
- package/lib/resources/shipments.d.ts +1 -1
- package/lib/resources/shipping_categories.d.cts +4 -1
- package/lib/resources/shipping_categories.d.ts +1 -1
- package/lib/resources/shipping_method_tiers.d.cts +4 -1
- package/lib/resources/shipping_method_tiers.d.ts +1 -1
- package/lib/resources/shipping_methods.cjs +2 -2
- package/lib/resources/shipping_methods.d.cts +4 -1
- package/lib/resources/shipping_methods.d.ts +1 -1
- package/lib/resources/shipping_methods.js +1 -1
- package/lib/resources/shipping_weight_tiers.d.cts +4 -1
- package/lib/resources/shipping_weight_tiers.d.ts +1 -1
- package/lib/resources/shipping_zones.d.cts +4 -1
- package/lib/resources/shipping_zones.d.ts +1 -1
- package/lib/resources/sku_list_items.d.cts +4 -1
- package/lib/resources/sku_list_items.d.ts +1 -1
- package/lib/resources/sku_list_promotion_rules.d.cts +4 -1
- package/lib/resources/sku_list_promotion_rules.d.ts +1 -1
- package/lib/resources/sku_lists.d.cts +4 -1
- package/lib/resources/sku_lists.d.ts +1 -1
- package/lib/resources/sku_options.d.cts +4 -1
- package/lib/resources/sku_options.d.ts +1 -1
- package/lib/resources/skus.d.cts +4 -1
- package/lib/resources/skus.d.ts +1 -1
- package/lib/resources/stock_items.d.cts +4 -1
- package/lib/resources/stock_items.d.ts +1 -1
- package/lib/resources/stock_line_items.d.cts +4 -1
- package/lib/resources/stock_line_items.d.ts +1 -1
- package/lib/resources/stock_locations.d.cts +4 -1
- package/lib/resources/stock_locations.d.ts +1 -1
- package/lib/resources/stock_reservations.d.cts +4 -1
- package/lib/resources/stock_reservations.d.ts +1 -1
- package/lib/resources/stock_transfers.d.cts +4 -1
- package/lib/resources/stock_transfers.d.ts +1 -1
- package/lib/resources/stores.d.cts +4 -1
- package/lib/resources/stores.d.ts +1 -1
- package/lib/resources/stripe_gateways.d.cts +4 -1
- package/lib/resources/stripe_gateways.d.ts +1 -1
- package/lib/resources/stripe_payments.d.cts +4 -1
- package/lib/resources/stripe_payments.d.ts +1 -1
- package/lib/resources/stripe_tax_accounts.d.cts +4 -1
- package/lib/resources/stripe_tax_accounts.d.ts +1 -1
- package/lib/resources/subscription_models.d.cts +4 -1
- package/lib/resources/subscription_models.d.ts +1 -1
- package/lib/resources/tags.d.cts +4 -1
- package/lib/resources/tags.d.ts +1 -1
- package/lib/resources/talon_one_accounts.cjs +2 -2
- package/lib/resources/talon_one_accounts.d.cts +4 -1
- package/lib/resources/talon_one_accounts.d.ts +1 -1
- package/lib/resources/talon_one_accounts.js +1 -1
- package/lib/resources/tax_calculators.d.cts +4 -1
- package/lib/resources/tax_calculators.d.ts +1 -1
- package/lib/resources/tax_categories.d.cts +4 -1
- package/lib/resources/tax_categories.d.ts +1 -1
- package/lib/resources/tax_rules.d.cts +4 -1
- package/lib/resources/tax_rules.d.ts +1 -1
- package/lib/resources/taxjar_accounts.d.cts +4 -1
- package/lib/resources/taxjar_accounts.d.ts +1 -1
- package/lib/resources/transactions.d.cts +4 -1
- package/lib/resources/transactions.d.ts +1 -1
- package/lib/resources/versions.d.cts +4 -1
- package/lib/resources/versions.d.ts +1 -1
- package/lib/resources/vertex_accounts.d.cts +4 -1
- package/lib/resources/vertex_accounts.d.ts +1 -1
- package/lib/resources/voids.d.cts +4 -1
- package/lib/resources/voids.d.ts +1 -1
- package/lib/resources/webhooks.d.cts +4 -1
- package/lib/resources/webhooks.d.ts +1 -1
- package/lib/resources/wire_transfers.d.cts +4 -1
- package/lib/resources/wire_transfers.d.ts +1 -1
- package/lib/static.cjs +3 -3
- package/lib/static.d.cts +1 -1
- package/lib/static.d.ts +1 -1
- package/lib/static.js +2 -2
- package/package.json +8 -8
- package/lib/chunk-465K3KVE.js.map +0 -1
- package/lib/chunk-7X36B7N6.js.map +0 -1
- package/lib/chunk-BOPK7T5K.js.map +0 -1
- package/lib/chunk-EKGR3EB3.js.map +0 -1
- package/lib/chunk-HLCGKY7R.js.map +0 -1
- package/lib/chunk-HQ35KQFG.cjs.map +0 -1
- package/lib/chunk-IIR3UVU2.js.map +0 -1
- package/lib/chunk-JENLN6VJ.js.map +0 -1
- package/lib/chunk-KBN3FFXD.cjs.map +0 -1
- package/lib/chunk-LCLXLB2R.cjs.map +0 -1
- package/lib/chunk-LEWK7QET.cjs.map +0 -1
- package/lib/chunk-NKJBVNTV.cjs.map +0 -1
- package/lib/chunk-NMVACSMG.js.map +0 -1
- package/lib/chunk-OPQJPXLM.cjs.map +0 -1
- package/lib/chunk-P3NADEGE.cjs.map +0 -1
- package/lib/chunk-QHRQCFDB.js.map +0 -1
- package/lib/chunk-RIMDGLIA.cjs.map +0 -1
- package/lib/chunk-RWPFE3LF.cjs.map +0 -1
- package/lib/chunk-VLLLEX5J.js.map +0 -1
- package/lib/chunk-VMJUXZ67.cjs.map +0 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/resources/skus.ts"],"names":["ApiResource"],"mappings":";;;;;AA6OA,IAAM,IAAA,GAAN,MAAM,KAAA,SAAaA,6BAAiB,CAAA;AAAA,EAEnC,OAAgB,IAAgB,GAAA,MAAA;AAAA,EAEhC,MAAM,MAAA,CAAO,QAAqB,EAAA,MAAA,EAAmC,OAAyC,EAAA;AAC7G,IAAO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AAA;AAC7C,EAEA,sBAAsB,GAAyB,EAAA;AAC9C,IAAO,OAAA,KAAA,CAAM,qBAA8B,CAAA,GAAG,GAAG,CAAA;AAAA;AAClD,EAGA,IAAgB,GAAA;AACf,IAAA,OAAO,KAAK,CAAA,IAAA;AAAA;AAGd,CAAA;AAGA,IAAM,QAAA,GAAW,IAAI,IAAK,EAAA;AAC1B,IAAO,YAAQ,GAAA","file":"chunk-Z2QVXW6T.cjs","sourcesContent":["import { ApiResource } from '../resource'\nimport type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse, ResourceSort, /* ResourceFilter */ } from '../resource'\nimport type { QueryParamsRetrieve, QueryParamsList } from '../query'\n\nimport type { ShippingCategory, ShippingCategoryType } from './shipping_categories'\nimport type { Price } from './prices'\nimport type { StockItem } from './stock_items'\nimport type { StockReservation } from './stock_reservations'\nimport type { DeliveryLeadTime } from './delivery_lead_times'\nimport type { SkuOption } from './sku_options'\nimport type { SkuListItem } from './sku_list_items'\nimport type { SkuList } from './sku_lists'\nimport type { Attachment } from './attachments'\nimport type { Link } from './links'\nimport type { Event } from './events'\nimport type { Tag, TagType } from './tags'\nimport type { Version } from './versions'\nimport type { Customer } from './customers'\nimport type { Market } from './markets'\nimport type { StockLocation } from './stock_locations'\n\n\ntype SkuType = 'skus'\ntype SkuRel = ResourceRel & { type: SkuType }\ntype ShippingCategoryRel = ResourceRel & { type: ShippingCategoryType }\ntype TagRel = ResourceRel & { type: TagType }\n\n\nexport type SkuSort = Pick<Sku, 'id' | 'code' | 'name' | 'do_not_ship' | 'do_not_track'> & ResourceSort\n// export type SkuFilter = Pick<Sku, 'id' | 'code' | 'name' | 'description' | 'image_url' | 'do_not_ship' | 'do_not_track'> & ResourceFilter\n\n\ninterface Sku extends Resource {\n\t\n\treadonly type: SkuType\n\n\t/** \n\t * The SKU code, that uniquely identifies the SKU within the organization.\n\t * @example ```\"TSHIRTMM000000FFFFFFXLXX\"```\n\t */\n\tcode: string\n\t/** \n\t * The internal name of the SKU.\n\t * @example ```\"Men's Black T-shirt with White Logo (XL)\"```\n\t */\n\tname: string\n\t/** \n\t * An internal description of the SKU.\n\t * @example ```\"Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\"```\n\t */\n\tdescription?: string | null\n\t/** \n\t * The URL of an image that represents the SKU.\n\t * @example ```\"https://img.yourdomain.com/skus/xYZkjABcde.png\"```\n\t */\n\timage_url?: string | null\n\t/** \n\t * The number of pieces that compose the SKU. This is useful to describe sets and bundles.\n\t * @example ```6```\n\t */\n\tpieces_per_pack?: number | null\n\t/** \n\t * The weight of the SKU. If present, it will be used to calculate the shipping rates.\n\t * @example ```300```\n\t */\n\tweight?: number | null\n\t/** \n\t * The unit of weight. One of 'gr', 'oz', or 'lb'.\n\t * @example ```\"gr\"```\n\t */\n\tunit_of_weight?: 'gr' | 'oz' | 'lb' | null\n\t/** \n\t * The Harmonized System Code used by customs to identify the products shipped across international borders.\n\t * @example ```\"4901.91.0020\"```\n\t */\n\ths_tariff_number?: string | null\n\t/** \n\t * Indicates if the SKU doesn't generate shipments.\n\t */\n\tdo_not_ship?: boolean | null\n\t/** \n\t * Indicates if the SKU doesn't track the stock inventory.\n\t */\n\tdo_not_track?: boolean | null\n\t/** \n\t * Aggregated information about the SKU's inventory. Returned only when retrieving a single SKU.\n\t * @example ```{\"available\":true,\"quantity\":10,\"levels\":[{\"quantity\":4,\"delivery_lead_times\":[{\"shipping_method\":{\"name\":\"Standard Shipping\",\"reference\":null,\"price_amount_cents\":700,\"free_over_amount_cents\":9900,\"formatted_price_amount\":\"€7,00\",\"formatted_free_over_amount\":\"€99,00\"},\"min\":{\"hours\":72,\"days\":3},\"max\":{\"hours\":120,\"days\":5}},{\"shipping_method\":{\"name\":\"Express Delivery\",\"reference\":null,\"price_amount_cents\":1200,\"free_over_amount_cents\":null,\"formatted_price_amount\":\"€12,00\",\"formatted_free_over_amount\":null},\"min\":{\"hours\":48,\"days\":2},\"max\":{\"hours\":72,\"days\":3}}]},{\"quantity\":6,\"delivery_lead_times\":[{\"shipping_method\":{\"name\":\"Standard Shipping\",\"reference\":null,\"price_amount_cents\":700,\"free_over_amount_cents\":9900,\"formatted_price_amount\":\"€7,00\",\"formatted_free_over_amount\":\"€99,00\"},\"min\":{\"hours\":96,\"days\":4},\"max\":{\"hours\":144,\"days\":6}},{\"shipping_method\":{\"name\":\"Express Delivery\",\"reference\":null,\"price_amount_cents\":1200,\"free_over_amount_cents\":null,\"formatted_price_amount\":\"€12,00\",\"formatted_free_over_amount\":null},\"min\":{\"hours\":72,\"days\":3},\"max\":{\"hours\":96,\"days\":4}}]}]}```\n\t */\n\tinventory?: Record<string, any> | null\n\t/** \n\t * The custom_claim attached to the current JWT (if any).\n\t * @example ```{}```\n\t */\n\tjwt_custom_claim?: Record<string, any> | null\n\n\tshipping_category?: ShippingCategory | null\n\tprices?: Price[] | null\n\tstock_items?: StockItem[] | null\n\tstock_reservations?: StockReservation[] | null\n\tdelivery_lead_times?: DeliveryLeadTime[] | null\n\tsku_options?: SkuOption[] | null\n\tsku_list_items?: SkuListItem[] | null\n\tsku_lists?: SkuList[] | null\n\tattachments?: Attachment[] | null\n\tlinks?: Link[] | null\n\tevents?: Event[] | null\n\ttags?: Tag[] | null\n\tversions?: Version[] | null\n\tjwt_customer?: Customer | null\n\tjwt_markets?: Market[] | null\n\tjwt_stock_locations?: StockLocation[] | null\n\n}\n\n\ninterface SkuCreate extends ResourceCreate {\n\t\n\t/** \n\t * The SKU code, that uniquely identifies the SKU within the organization.\n\t * @example ```\"TSHIRTMM000000FFFFFFXLXX\"```\n\t */\n\tcode: string\n\t/** \n\t * The internal name of the SKU.\n\t * @example ```\"Men's Black T-shirt with White Logo (XL)\"```\n\t */\n\tname: string\n\t/** \n\t * An internal description of the SKU.\n\t * @example ```\"Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\"```\n\t */\n\tdescription?: string | null\n\t/** \n\t * The URL of an image that represents the SKU.\n\t * @example ```\"https://img.yourdomain.com/skus/xYZkjABcde.png\"```\n\t */\n\timage_url?: string | null\n\t/** \n\t * The number of pieces that compose the SKU. This is useful to describe sets and bundles.\n\t * @example ```6```\n\t */\n\tpieces_per_pack?: number | null\n\t/** \n\t * The weight of the SKU. If present, it will be used to calculate the shipping rates.\n\t * @example ```300```\n\t */\n\tweight?: number | null\n\t/** \n\t * The unit of weight. One of 'gr', 'oz', or 'lb'.\n\t * @example ```\"gr\"```\n\t */\n\tunit_of_weight?: 'gr' | 'oz' | 'lb' | null\n\t/** \n\t * The Harmonized System Code used by customs to identify the products shipped across international borders.\n\t * @example ```\"4901.91.0020\"```\n\t */\n\ths_tariff_number?: string | null\n\t/** \n\t * Indicates if the SKU doesn't generate shipments.\n\t */\n\tdo_not_ship?: boolean | null\n\t/** \n\t * Indicates if the SKU doesn't track the stock inventory.\n\t */\n\tdo_not_track?: boolean | null\n\n\tshipping_category: ShippingCategoryRel\n\ttags?: TagRel[] | null\n\n}\n\n\ninterface SkuUpdate extends ResourceUpdate {\n\t\n\t/** \n\t * The SKU code, that uniquely identifies the SKU within the organization.\n\t * @example ```\"TSHIRTMM000000FFFFFFXLXX\"```\n\t */\n\tcode?: string | null\n\t/** \n\t * The internal name of the SKU.\n\t * @example ```\"Men's Black T-shirt with White Logo (XL)\"```\n\t */\n\tname?: string | null\n\t/** \n\t * An internal description of the SKU.\n\t * @example ```\"Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\"```\n\t */\n\tdescription?: string | null\n\t/** \n\t * The URL of an image that represents the SKU.\n\t * @example ```\"https://img.yourdomain.com/skus/xYZkjABcde.png\"```\n\t */\n\timage_url?: string | null\n\t/** \n\t * The number of pieces that compose the SKU. This is useful to describe sets and bundles.\n\t * @example ```6```\n\t */\n\tpieces_per_pack?: number | null\n\t/** \n\t * The weight of the SKU. If present, it will be used to calculate the shipping rates.\n\t * @example ```300```\n\t */\n\tweight?: number | null\n\t/** \n\t * The unit of weight. One of 'gr', 'oz', or 'lb'.\n\t * @example ```\"gr\"```\n\t */\n\tunit_of_weight?: 'gr' | 'oz' | 'lb' | null\n\t/** \n\t * The Harmonized System Code used by customs to identify the products shipped across international borders.\n\t * @example ```\"4901.91.0020\"```\n\t */\n\ths_tariff_number?: string | null\n\t/** \n\t * Indicates if the SKU doesn't generate shipments.\n\t */\n\tdo_not_ship?: boolean | null\n\t/** \n\t * Indicates if the SKU doesn't track the stock inventory.\n\t */\n\tdo_not_track?: boolean | null\n\t/** \n\t * Comma separated list of tags to be added. Duplicates, invalid and non existing ones are discarded. Cannot be passed by sales channels.\n\t */\n\t_add_tags?: string | null\n\t/** \n\t * Comma separated list of tags to be removed. Duplicates, invalid and non existing ones are discarded. Cannot be passed by sales channels.\n\t */\n\t_remove_tags?: string | null\n\n\tshipping_category?: ShippingCategoryRel | null\n\ttags?: TagRel[] | null\n\n}\n\n\nclass Skus extends ApiResource<Sku> {\n\n\tstatic readonly TYPE: SkuType = 'skus' as const\n\n\tasync create(resource: SkuCreate, params?: QueryParamsRetrieve<Sku>, options?: ResourcesConfig): Promise<Sku> {\n\t\treturn this.resources.create<SkuCreate, Sku>({ ...resource, type: Skus.TYPE }, params, options)\n\t}\n\n\tasync update(resource: SkuUpdate, params?: QueryParamsRetrieve<Sku>, options?: ResourcesConfig): Promise<Sku> {\n\t\treturn this.resources.update<SkuUpdate, Sku>({ ...resource, type: Skus.TYPE }, params, options)\n\t}\n\n\tasync delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void> {\n\t\tawait this.resources.delete((typeof id === 'string')? { id, type: Skus.TYPE } : id, options)\n\t}\n\n\tasync shipping_category(skuId: string | Sku, params?: QueryParamsRetrieve<ShippingCategory>, options?: ResourcesConfig): Promise<ShippingCategory> {\n\t\tconst _skuId = (skuId as Sku).id || skuId as string\n\t\treturn this.resources.fetch<ShippingCategory>({ type: 'shipping_categories' }, `skus/${_skuId}/shipping_category`, params, options) as unknown as ShippingCategory\n\t}\n\n\tasync prices(skuId: string | Sku, params?: QueryParamsList<Price>, options?: ResourcesConfig): Promise<ListResponse<Price>> {\n\t\tconst _skuId = (skuId as Sku).id || skuId as string\n\t\treturn this.resources.fetch<Price>({ type: 'prices' }, `skus/${_skuId}/prices`, params, options) as unknown as ListResponse<Price>\n\t}\n\n\tasync stock_items(skuId: string | Sku, params?: QueryParamsList<StockItem>, options?: ResourcesConfig): Promise<ListResponse<StockItem>> {\n\t\tconst _skuId = (skuId as Sku).id || skuId as string\n\t\treturn this.resources.fetch<StockItem>({ type: 'stock_items' }, `skus/${_skuId}/stock_items`, params, options) as unknown as ListResponse<StockItem>\n\t}\n\n\tasync stock_reservations(skuId: string | Sku, params?: QueryParamsList<StockReservation>, options?: ResourcesConfig): Promise<ListResponse<StockReservation>> {\n\t\tconst _skuId = (skuId as Sku).id || skuId as string\n\t\treturn this.resources.fetch<StockReservation>({ type: 'stock_reservations' }, `skus/${_skuId}/stock_reservations`, params, options) as unknown as ListResponse<StockReservation>\n\t}\n\n\tasync delivery_lead_times(skuId: string | Sku, params?: QueryParamsList<DeliveryLeadTime>, options?: ResourcesConfig): Promise<ListResponse<DeliveryLeadTime>> {\n\t\tconst _skuId = (skuId as Sku).id || skuId as string\n\t\treturn this.resources.fetch<DeliveryLeadTime>({ type: 'delivery_lead_times' }, `skus/${_skuId}/delivery_lead_times`, params, options) as unknown as ListResponse<DeliveryLeadTime>\n\t}\n\n\tasync sku_options(skuId: string | Sku, params?: QueryParamsList<SkuOption>, options?: ResourcesConfig): Promise<ListResponse<SkuOption>> {\n\t\tconst _skuId = (skuId as Sku).id || skuId as string\n\t\treturn this.resources.fetch<SkuOption>({ type: 'sku_options' }, `skus/${_skuId}/sku_options`, params, options) as unknown as ListResponse<SkuOption>\n\t}\n\n\tasync sku_list_items(skuId: string | Sku, params?: QueryParamsList<SkuListItem>, options?: ResourcesConfig): Promise<ListResponse<SkuListItem>> {\n\t\tconst _skuId = (skuId as Sku).id || skuId as string\n\t\treturn this.resources.fetch<SkuListItem>({ type: 'sku_list_items' }, `skus/${_skuId}/sku_list_items`, params, options) as unknown as ListResponse<SkuListItem>\n\t}\n\n\tasync sku_lists(skuId: string | Sku, params?: QueryParamsList<SkuList>, options?: ResourcesConfig): Promise<ListResponse<SkuList>> {\n\t\tconst _skuId = (skuId as Sku).id || skuId as string\n\t\treturn this.resources.fetch<SkuList>({ type: 'sku_lists' }, `skus/${_skuId}/sku_lists`, params, options) as unknown as ListResponse<SkuList>\n\t}\n\n\tasync attachments(skuId: string | Sku, params?: QueryParamsList<Attachment>, options?: ResourcesConfig): Promise<ListResponse<Attachment>> {\n\t\tconst _skuId = (skuId as Sku).id || skuId as string\n\t\treturn this.resources.fetch<Attachment>({ type: 'attachments' }, `skus/${_skuId}/attachments`, params, options) as unknown as ListResponse<Attachment>\n\t}\n\n\tasync links(skuId: string | Sku, params?: QueryParamsList<Link>, options?: ResourcesConfig): Promise<ListResponse<Link>> {\n\t\tconst _skuId = (skuId as Sku).id || skuId as string\n\t\treturn this.resources.fetch<Link>({ type: 'links' }, `skus/${_skuId}/links`, params, options) as unknown as ListResponse<Link>\n\t}\n\n\tasync events(skuId: string | Sku, params?: QueryParamsList<Event>, options?: ResourcesConfig): Promise<ListResponse<Event>> {\n\t\tconst _skuId = (skuId as Sku).id || skuId as string\n\t\treturn this.resources.fetch<Event>({ type: 'events' }, `skus/${_skuId}/events`, params, options) as unknown as ListResponse<Event>\n\t}\n\n\tasync tags(skuId: string | Sku, params?: QueryParamsList<Tag>, options?: ResourcesConfig): Promise<ListResponse<Tag>> {\n\t\tconst _skuId = (skuId as Sku).id || skuId as string\n\t\treturn this.resources.fetch<Tag>({ type: 'tags' }, `skus/${_skuId}/tags`, params, options) as unknown as ListResponse<Tag>\n\t}\n\n\tasync versions(skuId: string | Sku, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>> {\n\t\tconst _skuId = (skuId as Sku).id || skuId as string\n\t\treturn this.resources.fetch<Version>({ type: 'versions' }, `skus/${_skuId}/versions`, params, options) as unknown as ListResponse<Version>\n\t}\n\n\tasync jwt_customer(skuId: string | Sku, params?: QueryParamsRetrieve<Customer>, options?: ResourcesConfig): Promise<Customer> {\n\t\tconst _skuId = (skuId as Sku).id || skuId as string\n\t\treturn this.resources.fetch<Customer>({ type: 'customers' }, `skus/${_skuId}/jwt_customer`, params, options) as unknown as Customer\n\t}\n\n\tasync jwt_markets(skuId: string | Sku, params?: QueryParamsList<Market>, options?: ResourcesConfig): Promise<ListResponse<Market>> {\n\t\tconst _skuId = (skuId as Sku).id || skuId as string\n\t\treturn this.resources.fetch<Market>({ type: 'markets' }, `skus/${_skuId}/jwt_markets`, params, options) as unknown as ListResponse<Market>\n\t}\n\n\tasync jwt_stock_locations(skuId: string | Sku, params?: QueryParamsList<StockLocation>, options?: ResourcesConfig): Promise<ListResponse<StockLocation>> {\n\t\tconst _skuId = (skuId as Sku).id || skuId as string\n\t\treturn this.resources.fetch<StockLocation>({ type: 'stock_locations' }, `skus/${_skuId}/jwt_stock_locations`, params, options) as unknown as ListResponse<StockLocation>\n\t}\n\n\tasync _add_tags(id: string | Sku, triggerValue: string, params?: QueryParamsRetrieve<Sku>, options?: ResourcesConfig): Promise<Sku> {\n\t\treturn this.resources.update<SkuUpdate, Sku>({ id: (typeof id === 'string')? id: id.id, type: Skus.TYPE, _add_tags: triggerValue }, params, options)\n\t}\n\n\tasync _remove_tags(id: string | Sku, triggerValue: string, params?: QueryParamsRetrieve<Sku>, options?: ResourcesConfig): Promise<Sku> {\n\t\treturn this.resources.update<SkuUpdate, Sku>({ id: (typeof id === 'string')? id: id.id, type: Skus.TYPE, _remove_tags: triggerValue }, params, options)\n\t}\n\n\n\tisSku(resource: any): resource is Sku {\n\t\treturn resource.type && (resource.type === Skus.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): SkuRel {\n\t\treturn super.relationshipOneToOne<SkuRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): SkuRel[] {\n\t\treturn super.relationshipOneToMany<SkuRel>(...ids)\n\t}\n\n\n\ttype(): SkuType {\n\t\treturn Skus.TYPE\n\t}\n\n}\n\n\nconst instance = new Skus()\nexport default instance\n\nexport type { Skus, Sku, SkuCreate, SkuUpdate, SkuType }\n"]}
|
1
|
+
{"version":3,"sources":["../src/resources/skus.ts"],"names":["ApiResource"],"mappings":";;;;;AA6OA,IAAM,IAAA,GAAN,MAAM,KAAA,SAAaA,6BAAA,CAAiB;AAAA,EAEnC,OAAgB,IAAA,GAAgB,MAAA;AAAA,EAEhC,MAAM,MAAA,CAAO,QAAA,EAAqB,MAAA,EAAmC,OAAA,EAAyC;AAC7G,IAAA,OAAO,IAAA,CAAK,SAAA,CAAU,MAAA,CAAuB,EAAE,GAAG,QAAA,EAAU,IAAA,EAAM,KAAA,CAAK,IAAA,EAAK,EAAG,MAAA,EAAQ,OAAO,CAAA;AAAA;AAC/F,EAEA,MAAM,MAAA,CAAO,QAAA,EAAqB,MAAA,EAAmC,OAAA,EAAyC;AAC7G,IAAA,OAAO,IAAA,CAAK,SAAA,CAAU,MAAA,CAAuB,EAAE,GAAG,QAAA,EAAU,IAAA,EAAM,KAAA,CAAK,IAAA,EAAK,EAAG,MAAA,EAAQ,OAAO,CAAA;AAAA;AAC/F,EAEA,MAAM,MAAA,CAAO,EAAA,EAAyB,OAAA,EAA0C;AAC/E,IAAA,MAAM,IAAA,CAAK,SAAA,CAAU,MAAA,CAAQ,OAAO,EAAA,KAAO,QAAA,GAAW,EAAE,EAAA,EAAI,IAAA,EAAM,KAAA,CAAK,IAAA,EAAK,GAAI,IAAI,OAAO,CAAA;AAAA;AAC5F,EAEA,MAAM,iBAAA,CAAkB,KAAA,EAAqB,MAAA,EAAgD,OAAA,EAAsD;AAClJ,IAAA,MAAM,MAAA,GAAU,MAAc,EAAA,IAAM,KAAA;AACpC,IAAA,OAAO,IAAA,CAAK,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AM,YAAA,CAAa,EAAA,EAAkB,YAAA,EAAsB,QAAmC,OAAA,EAAyC;AACtI,IAAA,OAAO,KAAK,SAAA,CAAU,MAAA,CAAuB,EAAE,EAAA,EAAK,OAAO,OAAO,QAAA,GAAW,EAAA,GAAI,EAAA,CAAG,EAAA,EAAI,MAAM,KAAA,CAAK,IAAA,EAAM,cAAc,YAAA,EAAa,EAAG,QAAQ,OAAO,CAAA;AAAA;AACvJ,EAGA,MAAM,QAAA,EAAgC;AACrC,IAAA,OAAO,QAAA,CAAS,IAAA,IAAS,QAAA,CAAS,IAAA,KAAS,KAAA,CAAK,IAAA;AAAA;AACjD,EAGA,aAAa,EAAA,EAAwC;AACpD,IAAA,OAAO,KAAA,CAAM,qBAA6B,EAAE,CAAA;AAAA;AAC7C,EAEA,sBAAsB,GAAA,EAAyB;AAC9C,IAAA,OAAO,KAAA,CAAM,qBAAA,CAA8B,GAAG,GAAG,CAAA;AAAA;AAClD,EAGA,IAAA,GAAgB;AACf,IAAA,OAAO,KAAA,CAAK,IAAA;AAAA;AAGd,CAAA;AAGA,IAAM,QAAA,GAAW,IAAI,IAAA,EAAK;AAC1B,IAAO,YAAA,GAAQ","file":"chunk-Z2QVXW6T.cjs","sourcesContent":["import { ApiResource } from '../resource'\nimport type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse, ResourceSort, /* ResourceFilter */ } from '../resource'\nimport type { QueryParamsRetrieve, QueryParamsList } from '../query'\n\nimport type { ShippingCategory, ShippingCategoryType } from './shipping_categories'\nimport type { Price } from './prices'\nimport type { StockItem } from './stock_items'\nimport type { StockReservation } from './stock_reservations'\nimport type { DeliveryLeadTime } from './delivery_lead_times'\nimport type { SkuOption } from './sku_options'\nimport type { SkuListItem } from './sku_list_items'\nimport type { SkuList } from './sku_lists'\nimport type { Attachment } from './attachments'\nimport type { Link } from './links'\nimport type { Event } from './events'\nimport type { Tag, TagType } from './tags'\nimport type { Version } from './versions'\nimport type { Customer } from './customers'\nimport type { Market } from './markets'\nimport type { StockLocation } from './stock_locations'\n\n\ntype SkuType = 'skus'\ntype SkuRel = ResourceRel & { type: SkuType }\ntype ShippingCategoryRel = ResourceRel & { type: ShippingCategoryType }\ntype TagRel = ResourceRel & { type: TagType }\n\n\nexport type SkuSort = Pick<Sku, 'id' | 'code' | 'name' | 'do_not_ship' | 'do_not_track'> & ResourceSort\n// export type SkuFilter = Pick<Sku, 'id' | 'code' | 'name' | 'description' | 'image_url' | 'do_not_ship' | 'do_not_track'> & ResourceFilter\n\n\ninterface Sku extends Resource {\n\t\n\treadonly type: SkuType\n\n\t/** \n\t * The SKU code, that uniquely identifies the SKU within the organization.\n\t * @example ```\"TSHIRTMM000000FFFFFFXLXX\"```\n\t */\n\tcode: string\n\t/** \n\t * The internal name of the SKU.\n\t * @example ```\"Men's Black T-shirt with White Logo (XL)\"```\n\t */\n\tname: string\n\t/** \n\t * An internal description of the SKU.\n\t * @example ```\"Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\"```\n\t */\n\tdescription?: string | null\n\t/** \n\t * The URL of an image that represents the SKU.\n\t * @example ```\"https://img.yourdomain.com/skus/xYZkjABcde.png\"```\n\t */\n\timage_url?: string | null\n\t/** \n\t * The number of pieces that compose the SKU. This is useful to describe sets and bundles.\n\t * @example ```6```\n\t */\n\tpieces_per_pack?: number | null\n\t/** \n\t * The weight of the SKU. If present, it will be used to calculate the shipping rates.\n\t * @example ```300```\n\t */\n\tweight?: number | null\n\t/** \n\t * The unit of weight. One of 'gr', 'oz', or 'lb'.\n\t * @example ```\"gr\"```\n\t */\n\tunit_of_weight?: 'gr' | 'oz' | 'lb' | null\n\t/** \n\t * The Harmonized System Code used by customs to identify the products shipped across international borders.\n\t * @example ```\"4901.91.0020\"```\n\t */\n\ths_tariff_number?: string | null\n\t/** \n\t * Indicates if the SKU doesn't generate shipments.\n\t */\n\tdo_not_ship?: boolean | null\n\t/** \n\t * Indicates if the SKU doesn't track the stock inventory.\n\t */\n\tdo_not_track?: boolean | null\n\t/** \n\t * Aggregated information about the SKU's inventory. Returned only when retrieving a single SKU.\n\t * @example ```{\"available\":true,\"quantity\":10,\"levels\":[{\"quantity\":4,\"delivery_lead_times\":[{\"shipping_method\":{\"name\":\"Standard Shipping\",\"reference\":null,\"price_amount_cents\":700,\"free_over_amount_cents\":9900,\"formatted_price_amount\":\"€7,00\",\"formatted_free_over_amount\":\"€99,00\"},\"min\":{\"hours\":72,\"days\":3},\"max\":{\"hours\":120,\"days\":5}},{\"shipping_method\":{\"name\":\"Express Delivery\",\"reference\":null,\"price_amount_cents\":1200,\"free_over_amount_cents\":null,\"formatted_price_amount\":\"€12,00\",\"formatted_free_over_amount\":null},\"min\":{\"hours\":48,\"days\":2},\"max\":{\"hours\":72,\"days\":3}}]},{\"quantity\":6,\"delivery_lead_times\":[{\"shipping_method\":{\"name\":\"Standard Shipping\",\"reference\":null,\"price_amount_cents\":700,\"free_over_amount_cents\":9900,\"formatted_price_amount\":\"€7,00\",\"formatted_free_over_amount\":\"€99,00\"},\"min\":{\"hours\":96,\"days\":4},\"max\":{\"hours\":144,\"days\":6}},{\"shipping_method\":{\"name\":\"Express Delivery\",\"reference\":null,\"price_amount_cents\":1200,\"free_over_amount_cents\":null,\"formatted_price_amount\":\"€12,00\",\"formatted_free_over_amount\":null},\"min\":{\"hours\":72,\"days\":3},\"max\":{\"hours\":96,\"days\":4}}]}]}```\n\t */\n\tinventory?: Record<string, any> | null\n\t/** \n\t * The custom_claim attached to the current JWT (if any).\n\t * @example ```{}```\n\t */\n\tjwt_custom_claim?: Record<string, any> | null\n\n\tshipping_category?: ShippingCategory | null\n\tprices?: Price[] | null\n\tstock_items?: StockItem[] | null\n\tstock_reservations?: StockReservation[] | null\n\tdelivery_lead_times?: DeliveryLeadTime[] | null\n\tsku_options?: SkuOption[] | null\n\tsku_list_items?: SkuListItem[] | null\n\tsku_lists?: SkuList[] | null\n\tattachments?: Attachment[] | null\n\tlinks?: Link[] | null\n\tevents?: Event[] | null\n\ttags?: Tag[] | null\n\tversions?: Version[] | null\n\tjwt_customer?: Customer | null\n\tjwt_markets?: Market[] | null\n\tjwt_stock_locations?: StockLocation[] | null\n\n}\n\n\ninterface SkuCreate extends ResourceCreate {\n\t\n\t/** \n\t * The SKU code, that uniquely identifies the SKU within the organization.\n\t * @example ```\"TSHIRTMM000000FFFFFFXLXX\"```\n\t */\n\tcode: string\n\t/** \n\t * The internal name of the SKU.\n\t * @example ```\"Men's Black T-shirt with White Logo (XL)\"```\n\t */\n\tname: string\n\t/** \n\t * An internal description of the SKU.\n\t * @example ```\"Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\"```\n\t */\n\tdescription?: string | null\n\t/** \n\t * The URL of an image that represents the SKU.\n\t * @example ```\"https://img.yourdomain.com/skus/xYZkjABcde.png\"```\n\t */\n\timage_url?: string | null\n\t/** \n\t * The number of pieces that compose the SKU. This is useful to describe sets and bundles.\n\t * @example ```6```\n\t */\n\tpieces_per_pack?: number | null\n\t/** \n\t * The weight of the SKU. If present, it will be used to calculate the shipping rates.\n\t * @example ```300```\n\t */\n\tweight?: number | null\n\t/** \n\t * The unit of weight. One of 'gr', 'oz', or 'lb'.\n\t * @example ```\"gr\"```\n\t */\n\tunit_of_weight?: 'gr' | 'oz' | 'lb' | null\n\t/** \n\t * The Harmonized System Code used by customs to identify the products shipped across international borders.\n\t * @example ```\"4901.91.0020\"```\n\t */\n\ths_tariff_number?: string | null\n\t/** \n\t * Indicates if the SKU doesn't generate shipments.\n\t */\n\tdo_not_ship?: boolean | null\n\t/** \n\t * Indicates if the SKU doesn't track the stock inventory.\n\t */\n\tdo_not_track?: boolean | null\n\n\tshipping_category: ShippingCategoryRel\n\ttags?: TagRel[] | null\n\n}\n\n\ninterface SkuUpdate extends ResourceUpdate {\n\t\n\t/** \n\t * The SKU code, that uniquely identifies the SKU within the organization.\n\t * @example ```\"TSHIRTMM000000FFFFFFXLXX\"```\n\t */\n\tcode?: string | null\n\t/** \n\t * The internal name of the SKU.\n\t * @example ```\"Men's Black T-shirt with White Logo (XL)\"```\n\t */\n\tname?: string | null\n\t/** \n\t * An internal description of the SKU.\n\t * @example ```\"Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\"```\n\t */\n\tdescription?: string | null\n\t/** \n\t * The URL of an image that represents the SKU.\n\t * @example ```\"https://img.yourdomain.com/skus/xYZkjABcde.png\"```\n\t */\n\timage_url?: string | null\n\t/** \n\t * The number of pieces that compose the SKU. This is useful to describe sets and bundles.\n\t * @example ```6```\n\t */\n\tpieces_per_pack?: number | null\n\t/** \n\t * The weight of the SKU. If present, it will be used to calculate the shipping rates.\n\t * @example ```300```\n\t */\n\tweight?: number | null\n\t/** \n\t * The unit of weight. One of 'gr', 'oz', or 'lb'.\n\t * @example ```\"gr\"```\n\t */\n\tunit_of_weight?: 'gr' | 'oz' | 'lb' | null\n\t/** \n\t * The Harmonized System Code used by customs to identify the products shipped across international borders.\n\t * @example ```\"4901.91.0020\"```\n\t */\n\ths_tariff_number?: string | null\n\t/** \n\t * Indicates if the SKU doesn't generate shipments.\n\t */\n\tdo_not_ship?: boolean | null\n\t/** \n\t * Indicates if the SKU doesn't track the stock inventory.\n\t */\n\tdo_not_track?: boolean | null\n\t/** \n\t * Comma separated list of tags to be added. Duplicates, invalid and non existing ones are discarded. Cannot be passed by sales channels.\n\t */\n\t_add_tags?: string | null\n\t/** \n\t * Comma separated list of tags to be removed. Duplicates, invalid and non existing ones are discarded. Cannot be passed by sales channels.\n\t */\n\t_remove_tags?: string | null\n\n\tshipping_category?: ShippingCategoryRel | null\n\ttags?: TagRel[] | null\n\n}\n\n\nclass Skus extends ApiResource<Sku> {\n\n\tstatic readonly TYPE: SkuType = 'skus' as const\n\n\tasync create(resource: SkuCreate, params?: QueryParamsRetrieve<Sku>, options?: ResourcesConfig): Promise<Sku> {\n\t\treturn this.resources.create<SkuCreate, Sku>({ ...resource, type: Skus.TYPE }, params, options)\n\t}\n\n\tasync update(resource: SkuUpdate, params?: QueryParamsRetrieve<Sku>, options?: ResourcesConfig): Promise<Sku> {\n\t\treturn this.resources.update<SkuUpdate, Sku>({ ...resource, type: Skus.TYPE }, params, options)\n\t}\n\n\tasync delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void> {\n\t\tawait this.resources.delete((typeof id === 'string')? { id, type: Skus.TYPE } : id, options)\n\t}\n\n\tasync shipping_category(skuId: string | Sku, params?: QueryParamsRetrieve<ShippingCategory>, options?: ResourcesConfig): Promise<ShippingCategory> {\n\t\tconst _skuId = (skuId as Sku).id || skuId as string\n\t\treturn this.resources.fetch<ShippingCategory>({ type: 'shipping_categories' }, `skus/${_skuId}/shipping_category`, params, options) as unknown as ShippingCategory\n\t}\n\n\tasync prices(skuId: string | Sku, params?: QueryParamsList<Price>, options?: ResourcesConfig): Promise<ListResponse<Price>> {\n\t\tconst _skuId = (skuId as Sku).id || skuId as string\n\t\treturn this.resources.fetch<Price>({ type: 'prices' }, `skus/${_skuId}/prices`, params, options) as unknown as ListResponse<Price>\n\t}\n\n\tasync stock_items(skuId: string | Sku, params?: QueryParamsList<StockItem>, options?: ResourcesConfig): Promise<ListResponse<StockItem>> {\n\t\tconst _skuId = (skuId as Sku).id || skuId as string\n\t\treturn this.resources.fetch<StockItem>({ type: 'stock_items' }, `skus/${_skuId}/stock_items`, params, options) as unknown as ListResponse<StockItem>\n\t}\n\n\tasync stock_reservations(skuId: string | Sku, params?: QueryParamsList<StockReservation>, options?: ResourcesConfig): Promise<ListResponse<StockReservation>> {\n\t\tconst _skuId = (skuId as Sku).id || skuId as string\n\t\treturn this.resources.fetch<StockReservation>({ type: 'stock_reservations' }, `skus/${_skuId}/stock_reservations`, params, options) as unknown as ListResponse<StockReservation>\n\t}\n\n\tasync delivery_lead_times(skuId: string | Sku, params?: QueryParamsList<DeliveryLeadTime>, options?: ResourcesConfig): Promise<ListResponse<DeliveryLeadTime>> {\n\t\tconst _skuId = (skuId as Sku).id || skuId as string\n\t\treturn this.resources.fetch<DeliveryLeadTime>({ type: 'delivery_lead_times' }, `skus/${_skuId}/delivery_lead_times`, params, options) as unknown as ListResponse<DeliveryLeadTime>\n\t}\n\n\tasync sku_options(skuId: string | Sku, params?: QueryParamsList<SkuOption>, options?: ResourcesConfig): Promise<ListResponse<SkuOption>> {\n\t\tconst _skuId = (skuId as Sku).id || skuId as string\n\t\treturn this.resources.fetch<SkuOption>({ type: 'sku_options' }, `skus/${_skuId}/sku_options`, params, options) as unknown as ListResponse<SkuOption>\n\t}\n\n\tasync sku_list_items(skuId: string | Sku, params?: QueryParamsList<SkuListItem>, options?: ResourcesConfig): Promise<ListResponse<SkuListItem>> {\n\t\tconst _skuId = (skuId as Sku).id || skuId as string\n\t\treturn this.resources.fetch<SkuListItem>({ type: 'sku_list_items' }, `skus/${_skuId}/sku_list_items`, params, options) as unknown as ListResponse<SkuListItem>\n\t}\n\n\tasync sku_lists(skuId: string | Sku, params?: QueryParamsList<SkuList>, options?: ResourcesConfig): Promise<ListResponse<SkuList>> {\n\t\tconst _skuId = (skuId as Sku).id || skuId as string\n\t\treturn this.resources.fetch<SkuList>({ type: 'sku_lists' }, `skus/${_skuId}/sku_lists`, params, options) as unknown as ListResponse<SkuList>\n\t}\n\n\tasync attachments(skuId: string | Sku, params?: QueryParamsList<Attachment>, options?: ResourcesConfig): Promise<ListResponse<Attachment>> {\n\t\tconst _skuId = (skuId as Sku).id || skuId as string\n\t\treturn this.resources.fetch<Attachment>({ type: 'attachments' }, `skus/${_skuId}/attachments`, params, options) as unknown as ListResponse<Attachment>\n\t}\n\n\tasync links(skuId: string | Sku, params?: QueryParamsList<Link>, options?: ResourcesConfig): Promise<ListResponse<Link>> {\n\t\tconst _skuId = (skuId as Sku).id || skuId as string\n\t\treturn this.resources.fetch<Link>({ type: 'links' }, `skus/${_skuId}/links`, params, options) as unknown as ListResponse<Link>\n\t}\n\n\tasync events(skuId: string | Sku, params?: QueryParamsList<Event>, options?: ResourcesConfig): Promise<ListResponse<Event>> {\n\t\tconst _skuId = (skuId as Sku).id || skuId as string\n\t\treturn this.resources.fetch<Event>({ type: 'events' }, `skus/${_skuId}/events`, params, options) as unknown as ListResponse<Event>\n\t}\n\n\tasync tags(skuId: string | Sku, params?: QueryParamsList<Tag>, options?: ResourcesConfig): Promise<ListResponse<Tag>> {\n\t\tconst _skuId = (skuId as Sku).id || skuId as string\n\t\treturn this.resources.fetch<Tag>({ type: 'tags' }, `skus/${_skuId}/tags`, params, options) as unknown as ListResponse<Tag>\n\t}\n\n\tasync versions(skuId: string | Sku, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>> {\n\t\tconst _skuId = (skuId as Sku).id || skuId as string\n\t\treturn this.resources.fetch<Version>({ type: 'versions' }, `skus/${_skuId}/versions`, params, options) as unknown as ListResponse<Version>\n\t}\n\n\tasync jwt_customer(skuId: string | Sku, params?: QueryParamsRetrieve<Customer>, options?: ResourcesConfig): Promise<Customer> {\n\t\tconst _skuId = (skuId as Sku).id || skuId as string\n\t\treturn this.resources.fetch<Customer>({ type: 'customers' }, `skus/${_skuId}/jwt_customer`, params, options) as unknown as Customer\n\t}\n\n\tasync jwt_markets(skuId: string | Sku, params?: QueryParamsList<Market>, options?: ResourcesConfig): Promise<ListResponse<Market>> {\n\t\tconst _skuId = (skuId as Sku).id || skuId as string\n\t\treturn this.resources.fetch<Market>({ type: 'markets' }, `skus/${_skuId}/jwt_markets`, params, options) as unknown as ListResponse<Market>\n\t}\n\n\tasync jwt_stock_locations(skuId: string | Sku, params?: QueryParamsList<StockLocation>, options?: ResourcesConfig): Promise<ListResponse<StockLocation>> {\n\t\tconst _skuId = (skuId as Sku).id || skuId as string\n\t\treturn this.resources.fetch<StockLocation>({ type: 'stock_locations' }, `skus/${_skuId}/jwt_stock_locations`, params, options) as unknown as ListResponse<StockLocation>\n\t}\n\n\tasync _add_tags(id: string | Sku, triggerValue: string, params?: QueryParamsRetrieve<Sku>, options?: ResourcesConfig): Promise<Sku> {\n\t\treturn this.resources.update<SkuUpdate, Sku>({ id: (typeof id === 'string')? id: id.id, type: Skus.TYPE, _add_tags: triggerValue }, params, options)\n\t}\n\n\tasync _remove_tags(id: string | Sku, triggerValue: string, params?: QueryParamsRetrieve<Sku>, options?: ResourcesConfig): Promise<Sku> {\n\t\treturn this.resources.update<SkuUpdate, Sku>({ id: (typeof id === 'string')? id: id.id, type: Skus.TYPE, _remove_tags: triggerValue }, params, options)\n\t}\n\n\n\tisSku(resource: any): resource is Sku {\n\t\treturn resource.type && (resource.type === Skus.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): SkuRel {\n\t\treturn super.relationshipOneToOne<SkuRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): SkuRel[] {\n\t\treturn super.relationshipOneToMany<SkuRel>(...ids)\n\t}\n\n\n\ttype(): SkuType {\n\t\treturn Skus.TYPE\n\t}\n\n}\n\n\nconst instance = new Skus()\nexport default instance\n\nexport type { Skus, Sku, SkuCreate, SkuUpdate, SkuType }\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/resources/custom_promotion_rules.ts"],"names":[],"mappings":";;;AAyEA,IAAM,oBAAA,GAAN,MAAM,qBAAA,SAA6B,
|
1
|
+
{"version":3,"sources":["../src/resources/custom_promotion_rules.ts"],"names":[],"mappings":";;;AAyEA,IAAM,oBAAA,GAAN,MAAM,qBAAA,SAA6B,WAAA,CAAiC;AAAA,EAEnE,OAAgB,IAAA,GAAgC,wBAAA;AAAA,EAEhD,MAAM,MAAA,CAAO,QAAA,EAAqC,MAAA,EAAmD,OAAA,EAAyD;AAC7J,IAAA,OAAO,IAAA,CAAK,SAAA,CAAU,MAAA,CAAuD,EAAE,GAAG,QAAA,EAAU,IAAA,EAAM,qBAAA,CAAqB,IAAA,EAAK,EAAG,MAAA,EAAQ,OAAO,CAAA;AAAA;AAC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AQ","file":"chunk-Z667GAZJ.js","sourcesContent":["import { ApiResource } from '../resource'\nimport type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse, ResourceSort, /* ResourceFilter */ } from '../resource'\nimport type { QueryParamsRetrieve, QueryParamsList } from '../query'\n\nimport type { Version } from './versions'\nimport type { PercentageDiscountPromotion, PercentageDiscountPromotionType } from './percentage_discount_promotions'\nimport type { FreeShippingPromotion, FreeShippingPromotionType } from './free_shipping_promotions'\nimport type { BuyXPayYPromotion, BuyXPayYPromotionType } from './buy_x_pay_y_promotions'\nimport type { FreeGiftPromotion, FreeGiftPromotionType } from './free_gift_promotions'\nimport type { FixedPricePromotion, FixedPricePromotionType } from './fixed_price_promotions'\nimport type { ExternalPromotion, ExternalPromotionType } from './external_promotions'\nimport type { FixedAmountPromotion, FixedAmountPromotionType } from './fixed_amount_promotions'\nimport type { FlexPromotion, FlexPromotionType } from './flex_promotions'\n\n\ntype CustomPromotionRuleType = 'custom_promotion_rules'\ntype CustomPromotionRuleRel = ResourceRel & { type: CustomPromotionRuleType }\ntype PercentageDiscountPromotionRel = ResourceRel & { type: PercentageDiscountPromotionType }\ntype FreeShippingPromotionRel = ResourceRel & { type: FreeShippingPromotionType }\ntype BuyXPayYPromotionRel = ResourceRel & { type: BuyXPayYPromotionType }\ntype FreeGiftPromotionRel = ResourceRel & { type: FreeGiftPromotionType }\ntype FixedPricePromotionRel = ResourceRel & { type: FixedPricePromotionType }\ntype ExternalPromotionRel = ResourceRel & { type: ExternalPromotionType }\ntype FixedAmountPromotionRel = ResourceRel & { type: FixedAmountPromotionType }\ntype FlexPromotionRel = ResourceRel & { type: FlexPromotionType }\n\n\nexport type CustomPromotionRuleSort = Pick<CustomPromotionRule, 'id'> & ResourceSort\n// export type CustomPromotionRuleFilter = Pick<CustomPromotionRule, 'id'> & ResourceFilter\n\n\ninterface CustomPromotionRule extends Resource {\n\t\n\treadonly type: CustomPromotionRuleType\n\n\t/** \n\t * The filters used to trigger promotion on the matching order and its relationships attributes.\n\t * @example ```{\"status_eq\":\"pending\",\"line_items_sku_code_eq\":\"AAA\"}```\n\t */\n\tfilters?: Record<string, any> | null\n\n\tpromotion?: PercentageDiscountPromotion | FreeShippingPromotion | BuyXPayYPromotion | FreeGiftPromotion | FixedPricePromotion | ExternalPromotion | FixedAmountPromotion | FlexPromotion | null\n\tversions?: Version[] | null\n\n}\n\n\ninterface CustomPromotionRuleCreate extends ResourceCreate {\n\t\n\t/** \n\t * The filters used to trigger promotion on the matching order and its relationships attributes.\n\t * @example ```{\"status_eq\":\"pending\",\"line_items_sku_code_eq\":\"AAA\"}```\n\t */\n\tfilters?: Record<string, any> | null\n\n\tpromotion: PercentageDiscountPromotionRel | FreeShippingPromotionRel | BuyXPayYPromotionRel | FreeGiftPromotionRel | FixedPricePromotionRel | ExternalPromotionRel | FixedAmountPromotionRel | FlexPromotionRel\n\n}\n\n\ninterface CustomPromotionRuleUpdate extends ResourceUpdate {\n\t\n\t/** \n\t * The filters used to trigger promotion on the matching order and its relationships attributes.\n\t * @example ```{\"status_eq\":\"pending\",\"line_items_sku_code_eq\":\"AAA\"}```\n\t */\n\tfilters?: Record<string, any> | null\n\n\tpromotion?: PercentageDiscountPromotionRel | FreeShippingPromotionRel | BuyXPayYPromotionRel | FreeGiftPromotionRel | FixedPricePromotionRel | ExternalPromotionRel | FixedAmountPromotionRel | FlexPromotionRel | null\n\n}\n\n\nclass CustomPromotionRules extends ApiResource<CustomPromotionRule> {\n\n\tstatic readonly TYPE: CustomPromotionRuleType = 'custom_promotion_rules' as const\n\n\tasync create(resource: CustomPromotionRuleCreate, params?: QueryParamsRetrieve<CustomPromotionRule>, options?: ResourcesConfig): Promise<CustomPromotionRule> {\n\t\treturn this.resources.create<CustomPromotionRuleCreate, CustomPromotionRule>({ ...resource, type: CustomPromotionRules.TYPE }, params, options)\n\t}\n\n\tasync update(resource: CustomPromotionRuleUpdate, params?: QueryParamsRetrieve<CustomPromotionRule>, options?: ResourcesConfig): Promise<CustomPromotionRule> {\n\t\treturn this.resources.update<CustomPromotionRuleUpdate, CustomPromotionRule>({ ...resource, type: CustomPromotionRules.TYPE }, params, options)\n\t}\n\n\tasync delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void> {\n\t\tawait this.resources.delete((typeof id === 'string')? { id, type: CustomPromotionRules.TYPE } : id, options)\n\t}\n\n\tasync versions(customPromotionRuleId: string | CustomPromotionRule, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>> {\n\t\tconst _customPromotionRuleId = (customPromotionRuleId as CustomPromotionRule).id || customPromotionRuleId as string\n\t\treturn this.resources.fetch<Version>({ type: 'versions' }, `custom_promotion_rules/${_customPromotionRuleId}/versions`, params, options) as unknown as ListResponse<Version>\n\t}\n\n\n\tisCustomPromotionRule(resource: any): resource is CustomPromotionRule {\n\t\treturn resource.type && (resource.type === CustomPromotionRules.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): CustomPromotionRuleRel {\n\t\treturn super.relationshipOneToOne<CustomPromotionRuleRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): CustomPromotionRuleRel[] {\n\t\treturn super.relationshipOneToMany<CustomPromotionRuleRel>(...ids)\n\t}\n\n\n\ttype(): CustomPromotionRuleType {\n\t\treturn CustomPromotionRules.TYPE\n\t}\n\n}\n\n\nconst instance = new CustomPromotionRules()\nexport default instance\n\nexport type { CustomPromotionRules, CustomPromotionRule, CustomPromotionRuleCreate, CustomPromotionRuleUpdate, CustomPromotionRuleType }\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/resources/tax_calculators.ts"],"names":[],"mappings":";;;AAoCA,IAAM,cAAA,GAAN,MAAM,eAAA,SAAuB,
|
1
|
+
{"version":3,"sources":["../src/resources/tax_calculators.ts"],"names":[],"mappings":";;;AAoCA,IAAM,cAAA,GAAN,MAAM,eAAA,SAAuB,WAAA,CAA2B;AAAA,EAEvD,OAAgB,IAAA,GAA0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AAC3H,EAGA,gBAAgB,QAAA,EAA0C;AACzD,IAAA,OAAO,QAAA,CAAS,IAAA,IAAS,QAAA,CAAS,IAAA,KAAS,eAAA,CAAe,IAAA;AAAA;AAC3D,EAGA,aAAa,EAAA,EAAkD;AAC9D,IAAA,OAAO,KAAA,CAAM,qBAAuC,EAAE,CAAA;AAAA;AACvD,EAEA,sBAAsB,GAAA,EAAmC;AACxD,IAAA,OAAO,KAAA,CAAM,qBAAA,CAAwC,GAAG,GAAG,CAAA;AAAA;AAC5D,EAGA,IAAA,GAA0B;AACzB,IAAA,OAAO,eAAA,CAAe,IAAA;AAAA;AAGxB,CAAA;AAGA,IAAM,QAAA,GAAW,IAAI,cAAA,EAAe;AACpC,IAAO,uBAAA,GAAQ","file":"chunk-Z7DKPFKZ.js","sourcesContent":["import { ApiResource } from '../resource'\nimport type { Resource, ResourceId, ResourcesConfig, ResourceRel, ListResponse, ResourceSort, /* ResourceFilter */ } from '../resource'\nimport type { QueryParamsList } from '../query'\n\nimport type { Market } from './markets'\nimport type { Attachment } from './attachments'\nimport type { Event } from './events'\nimport type { Version } from './versions'\n\n\ntype TaxCalculatorType = 'tax_calculators'\ntype TaxCalculatorRel = ResourceRel & { type: TaxCalculatorType }\n\n\nexport type TaxCalculatorSort = Pick<TaxCalculator, 'id' | 'name'> & ResourceSort\n// export type TaxCalculatorFilter = Pick<TaxCalculator, 'id' | 'name'> & ResourceFilter\n\n\ninterface TaxCalculator extends Resource {\n\t\n\treadonly type: TaxCalculatorType\n\n\t/** \n\t * The tax calculator's internal name.\n\t * @example ```\"Personal tax calculator\"```\n\t */\n\tname: string\n\n\tmarkets?: Market[] | null\n\tattachments?: Attachment[] | null\n\tevents?: Event[] | null\n\tversions?: Version[] | null\n\n}\n\n\nclass TaxCalculators extends ApiResource<TaxCalculator> {\n\n\tstatic readonly TYPE: TaxCalculatorType = 'tax_calculators' as const\n\n\tasync markets(taxCalculatorId: string | TaxCalculator, params?: QueryParamsList<Market>, options?: ResourcesConfig): Promise<ListResponse<Market>> {\n\t\tconst _taxCalculatorId = (taxCalculatorId as TaxCalculator).id || taxCalculatorId as string\n\t\treturn this.resources.fetch<Market>({ type: 'markets' }, `tax_calculators/${_taxCalculatorId}/markets`, params, options) as unknown as ListResponse<Market>\n\t}\n\n\tasync attachments(taxCalculatorId: string | TaxCalculator, params?: QueryParamsList<Attachment>, options?: ResourcesConfig): Promise<ListResponse<Attachment>> {\n\t\tconst _taxCalculatorId = (taxCalculatorId as TaxCalculator).id || taxCalculatorId as string\n\t\treturn this.resources.fetch<Attachment>({ type: 'attachments' }, `tax_calculators/${_taxCalculatorId}/attachments`, params, options) as unknown as ListResponse<Attachment>\n\t}\n\n\tasync events(taxCalculatorId: string | TaxCalculator, params?: QueryParamsList<Event>, options?: ResourcesConfig): Promise<ListResponse<Event>> {\n\t\tconst _taxCalculatorId = (taxCalculatorId as TaxCalculator).id || taxCalculatorId as string\n\t\treturn this.resources.fetch<Event>({ type: 'events' }, `tax_calculators/${_taxCalculatorId}/events`, params, options) as unknown as ListResponse<Event>\n\t}\n\n\tasync versions(taxCalculatorId: string | TaxCalculator, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>> {\n\t\tconst _taxCalculatorId = (taxCalculatorId as TaxCalculator).id || taxCalculatorId as string\n\t\treturn this.resources.fetch<Version>({ type: 'versions' }, `tax_calculators/${_taxCalculatorId}/versions`, params, options) as unknown as ListResponse<Version>\n\t}\n\n\n\tisTaxCalculator(resource: any): resource is TaxCalculator {\n\t\treturn resource.type && (resource.type === TaxCalculators.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): TaxCalculatorRel {\n\t\treturn super.relationshipOneToOne<TaxCalculatorRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): TaxCalculatorRel[] {\n\t\treturn super.relationshipOneToMany<TaxCalculatorRel>(...ids)\n\t}\n\n\n\ttype(): TaxCalculatorType {\n\t\treturn TaxCalculators.TYPE\n\t}\n\n}\n\n\nconst instance = new TaxCalculators()\nexport default instance\n\nexport type { TaxCalculators, TaxCalculator, TaxCalculatorType }\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/resources/taxjar_accounts.ts"],"names":["ApiResource"],"mappings":";;;;;AA2EA,IAAM,cAAA,GAAN,MAAM,eAAA,SAAuBA,
|
1
|
+
{"version":3,"sources":["../src/resources/taxjar_accounts.ts"],"names":["ApiResource"],"mappings":";;;;;AA2EA,IAAM,cAAA,GAAN,MAAM,eAAA,SAAuBA,6BAAA,CAA2B;AAAA,EAEvD,OAAgB,IAAA,GAA0B,iBAAA;AAAA,EAE1C,MAAM,MAAA,CAAO,QAAA,EAA+B,MAAA,EAA6C,OAAA,EAAmD;AAC3I,IAAA,OAAO,IAAA,CAAK,SAAA,CAAU,MAAA,CAA2C,EAAE,GAAG,QAAA,EAAU,IAAA,EAAM,eAAA,CAAe,IAAA,EAAK,EAAG,MAAA,EAAQ,OAAO,CAAA;AAAA;AAC7H,EAEA,MAAM,MAAA,CAAO,QAAA,EAA+B,MAAA,EAA6C,OAAA,EAAmD;AAC3I,IAAA,OAAO,IAAA,CAAK,SAAA,CAAU,MAAA,CAA2C,EAAE,GAAG,QAAA,EAAU,IAAA,EAAM,eAAA,CAAe,IAAA,EAAK,EAAG,MAAA,EAAQ,OAAO,CAAA;AAAA;AAC7H,EAEA,MAAM,MAAA,CAAO,EAAA,EAAyB,OAAA,EAA0C;AAC/E,IAAA,MAAM,IAAA,CAAK,SAAA,CAAU,MAAA,CAAQ,OAAO,EAAA,KAAO,QAAA,GAAW,EAAE,EAAA,EAAI,IAAA,EAAM,eAAA,CAAe,IAAA,EAAK,GAAI,IAAI,OAAO,CAAA;AAAA;AACtG,EAEA,MAAM,OAAA,CAAQ,eAAA,EAAyC,MAAA,EAAkC,OAAA,EAA0D;AAClJ,IAAA,MAAM,gBAAA,GAAoB,gBAAkC,EAAA,IAAM,eAAA;AAClE,IAAA,OAAO,IAAA,CAAK,SAAA,CA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AmB,EAAE,IAAA,EAAM,gBAAA,EAAiB,EAAG,CAAA,gBAAA,EAAmB,gBAAgB,CAAA,eAAA,CAAA,EAAmB,MAAA,EAAQ,OAAO,CAAA;AAAA;AAC3I,EAGA,gBAAgB,QAAA,EAA0C;AACzD,IAAA,OAAO,QAAA,CAAS,IAAA,IAAS,QAAA,CAAS,IAAA,KAAS,eAAA,CAAe,IAAA;AAAA;AAC3D,EAGA,aAAa,EAAA,EAAkD;AAC9D,IAAA,OAAO,KAAA,CAAM,qBAAuC,EAAE,CAAA;AAAA;AACvD,EAEA,sBAAsB,GAAA,EAAmC;AACxD,IAAA,OAAO,KAAA,CAAM,qBAAA,CAAwC,GAAG,GAAG,CAAA;AAAA;AAC5D,EAGA,IAAA,GAA0B;AACzB,IAAA,OAAO,eAAA,CAAe,IAAA;AAAA;AAGxB,CAAA;AAGA,IAAM,QAAA,GAAW,IAAI,cAAA,EAAe;AACpC,IAAO,uBAAA,GAAQ","file":"chunk-ZAISVVBE.cjs","sourcesContent":["import { ApiResource } from '../resource'\nimport type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse, ResourceSort, /* ResourceFilter */ } from '../resource'\nimport type { QueryParamsRetrieve, QueryParamsList } from '../query'\n\nimport type { Market } from './markets'\nimport type { Attachment } from './attachments'\nimport type { Event } from './events'\nimport type { Version } from './versions'\nimport type { TaxCategory, TaxCategoryType } from './tax_categories'\n\n\ntype TaxjarAccountType = 'taxjar_accounts'\ntype TaxjarAccountRel = ResourceRel & { type: TaxjarAccountType }\ntype TaxCategoryRel = ResourceRel & { type: TaxCategoryType }\n\n\nexport type TaxjarAccountSort = Pick<TaxjarAccount, 'id' | 'name'> & ResourceSort\n// export type TaxjarAccountFilter = Pick<TaxjarAccount, 'id' | 'name'> & ResourceFilter\n\n\ninterface TaxjarAccount extends Resource {\n\t\n\treadonly type: TaxjarAccountType\n\n\t/** \n\t * The tax calculator's internal name.\n\t * @example ```\"Personal tax calculator\"```\n\t */\n\tname: string\n\n\tmarkets?: Market[] | null\n\tattachments?: Attachment[] | null\n\tevents?: Event[] | null\n\tversions?: Version[] | null\n\ttax_categories?: TaxCategory[] | null\n\n}\n\n\ninterface TaxjarAccountCreate extends ResourceCreate {\n\t\n\t/** \n\t * The tax calculator's internal name.\n\t * @example ```\"Personal tax calculator\"```\n\t */\n\tname: string\n\t/** \n\t * The TaxJar account API key.\n\t * @example ```\"TAXJAR_API_KEY\"```\n\t */\n\tapi_key: string\n\n\ttax_categories?: TaxCategoryRel[] | null\n\n}\n\n\ninterface TaxjarAccountUpdate extends ResourceUpdate {\n\t\n\t/** \n\t * The tax calculator's internal name.\n\t * @example ```\"Personal tax calculator\"```\n\t */\n\tname?: string | null\n\t/** \n\t * The TaxJar account API key.\n\t * @example ```\"TAXJAR_API_KEY\"```\n\t */\n\tapi_key?: string | null\n\n\ttax_categories?: TaxCategoryRel[] | null\n\n}\n\n\nclass TaxjarAccounts extends ApiResource<TaxjarAccount> {\n\n\tstatic readonly TYPE: TaxjarAccountType = 'taxjar_accounts' as const\n\n\tasync create(resource: TaxjarAccountCreate, params?: QueryParamsRetrieve<TaxjarAccount>, options?: ResourcesConfig): Promise<TaxjarAccount> {\n\t\treturn this.resources.create<TaxjarAccountCreate, TaxjarAccount>({ ...resource, type: TaxjarAccounts.TYPE }, params, options)\n\t}\n\n\tasync update(resource: TaxjarAccountUpdate, params?: QueryParamsRetrieve<TaxjarAccount>, options?: ResourcesConfig): Promise<TaxjarAccount> {\n\t\treturn this.resources.update<TaxjarAccountUpdate, TaxjarAccount>({ ...resource, type: TaxjarAccounts.TYPE }, params, options)\n\t}\n\n\tasync delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void> {\n\t\tawait this.resources.delete((typeof id === 'string')? { id, type: TaxjarAccounts.TYPE } : id, options)\n\t}\n\n\tasync markets(taxjarAccountId: string | TaxjarAccount, params?: QueryParamsList<Market>, options?: ResourcesConfig): Promise<ListResponse<Market>> {\n\t\tconst _taxjarAccountId = (taxjarAccountId as TaxjarAccount).id || taxjarAccountId as string\n\t\treturn this.resources.fetch<Market>({ type: 'markets' }, `taxjar_accounts/${_taxjarAccountId}/markets`, params, options) as unknown as ListResponse<Market>\n\t}\n\n\tasync attachments(taxjarAccountId: string | TaxjarAccount, params?: QueryParamsList<Attachment>, options?: ResourcesConfig): Promise<ListResponse<Attachment>> {\n\t\tconst _taxjarAccountId = (taxjarAccountId as TaxjarAccount).id || taxjarAccountId as string\n\t\treturn this.resources.fetch<Attachment>({ type: 'attachments' }, `taxjar_accounts/${_taxjarAccountId}/attachments`, params, options) as unknown as ListResponse<Attachment>\n\t}\n\n\tasync events(taxjarAccountId: string | TaxjarAccount, params?: QueryParamsList<Event>, options?: ResourcesConfig): Promise<ListResponse<Event>> {\n\t\tconst _taxjarAccountId = (taxjarAccountId as TaxjarAccount).id || taxjarAccountId as string\n\t\treturn this.resources.fetch<Event>({ type: 'events' }, `taxjar_accounts/${_taxjarAccountId}/events`, params, options) as unknown as ListResponse<Event>\n\t}\n\n\tasync versions(taxjarAccountId: string | TaxjarAccount, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>> {\n\t\tconst _taxjarAccountId = (taxjarAccountId as TaxjarAccount).id || taxjarAccountId as string\n\t\treturn this.resources.fetch<Version>({ type: 'versions' }, `taxjar_accounts/${_taxjarAccountId}/versions`, params, options) as unknown as ListResponse<Version>\n\t}\n\n\tasync tax_categories(taxjarAccountId: string | TaxjarAccount, params?: QueryParamsList<TaxCategory>, options?: ResourcesConfig): Promise<ListResponse<TaxCategory>> {\n\t\tconst _taxjarAccountId = (taxjarAccountId as TaxjarAccount).id || taxjarAccountId as string\n\t\treturn this.resources.fetch<TaxCategory>({ type: 'tax_categories' }, `taxjar_accounts/${_taxjarAccountId}/tax_categories`, params, options) as unknown as ListResponse<TaxCategory>\n\t}\n\n\n\tisTaxjarAccount(resource: any): resource is TaxjarAccount {\n\t\treturn resource.type && (resource.type === TaxjarAccounts.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): TaxjarAccountRel {\n\t\treturn super.relationshipOneToOne<TaxjarAccountRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): TaxjarAccountRel[] {\n\t\treturn super.relationshipOneToMany<TaxjarAccountRel>(...ids)\n\t}\n\n\n\ttype(): TaxjarAccountType {\n\t\treturn TaxjarAccounts.TYPE\n\t}\n\n}\n\n\nconst instance = new TaxjarAccounts()\nexport default instance\n\nexport type { TaxjarAccounts, TaxjarAccount, TaxjarAccountCreate, TaxjarAccountUpdate, TaxjarAccountType }\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/resources/skus.ts"],"names":[],"mappings":";;;AA6OA,IAAM,IAAA,GAAN,MAAM,KAAA,SAAa,WAAiB,CAAA;AAAA,EAEnC,OAAgB,IAAgB,GAAA,MAAA;AAAA,EAEhC,MAAM,MAAA,CAAO,QAAqB,EAAA,MAAA,EAAmC,OAAyC,EAAA;AAC7G,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,MAAA,CAAuB,EAAE,GAAG,QAAU,EAAA,IAAA,EAAM,KAAK,CAAA,IAAA,EAAQ,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AAC/F,EAEA,MAAM,MAAA,CAAO,QAAqB,EAAA,MAAA,EAAmC,OAAyC,EAAA;AAC7G,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,MAAA,CAAuB,EAAE,GAAG,QAAU,EAAA,IAAA,EAAM,KAAK,CAAA,IAAA,EAAQ,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AAC/F,EAEA,MAAM,MAAO,CAAA,EAAA,EAAyB,OAA0C,EAAA;AAC/E,IAAA,MAAM,IAAK,CAAA,SAAA,CAAU,MAAQ,CAAA,OAAO,EAAO,KAAA,QAAA,GAAW,EAAE,EAAA,EAAI,IAAM,EAAA,KAAA,CAAK,IAAK,EAAA,GAAI,IAAI,OAAO,CAAA;AAAA;AAC5F,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O,OAAO,QAAW,GAAA,EAAA,GAAI,EAAG,CAAA,EAAA,EAAI,MAAM,KAAK,CAAA,IAAA,EAAM,WAAW,YAAa,EAAA,EAAG,QAAQ,OAAO,CAAA;AAAA;AACpJ,EAEA,MAAM,YAAA,CAAa,EAAkB,EAAA,YAAA,EAAsB,QAAmC,OAAyC,EAAA;AACtI,IAAA,OAAO,KAAK,SAAU,CAAA,MAAA,CAAuB,EAAE,EAAK,EAAA,OAAO,OAAO,QAAW,GAAA,EAAA,GAAI,EAAG,CAAA,EAAA,EAAI,MAAM,KAAK,CAAA,IAAA,EAAM,cAAc,YAAa,EAAA,EAAG,QAAQ,OAAO,CAAA;AAAA;AACvJ,EAGA,MAAM,QAAgC,EAAA;AACrC,IAAA,OAAO,QAAS,CAAA,IAAA,IAAS,QAAS,CAAA,IAAA,KAAS,KAAK,CAAA,IAAA;AAAA;AACjD,EAGA,aAAa,EAAwC,EAAA;AACpD,IAAO,OAAA,KAAA,CAAM,qBAA6B,EAAE,CAAA;AAAA;AAC7C,EAEA,sBAAsB,GAAyB,EAAA;AAC9C,IAAO,OAAA,KAAA,CAAM,qBAA8B,CAAA,GAAG,GAAG,CAAA;AAAA;AAClD,EAGA,IAAgB,GAAA;AACf,IAAA,OAAO,KAAK,CAAA,IAAA;AAAA;AAGd,CAAA;AAGA,IAAM,QAAA,GAAW,IAAI,IAAK,EAAA;AAC1B,IAAO,YAAQ,GAAA","file":"chunk-ZASD6IUL.js","sourcesContent":["import { ApiResource } from '../resource'\nimport type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse, ResourceSort, /* ResourceFilter */ } from '../resource'\nimport type { QueryParamsRetrieve, QueryParamsList } from '../query'\n\nimport type { ShippingCategory, ShippingCategoryType } from './shipping_categories'\nimport type { Price } from './prices'\nimport type { StockItem } from './stock_items'\nimport type { StockReservation } from './stock_reservations'\nimport type { DeliveryLeadTime } from './delivery_lead_times'\nimport type { SkuOption } from './sku_options'\nimport type { SkuListItem } from './sku_list_items'\nimport type { SkuList } from './sku_lists'\nimport type { Attachment } from './attachments'\nimport type { Link } from './links'\nimport type { Event } from './events'\nimport type { Tag, TagType } from './tags'\nimport type { Version } from './versions'\nimport type { Customer } from './customers'\nimport type { Market } from './markets'\nimport type { StockLocation } from './stock_locations'\n\n\ntype SkuType = 'skus'\ntype SkuRel = ResourceRel & { type: SkuType }\ntype ShippingCategoryRel = ResourceRel & { type: ShippingCategoryType }\ntype TagRel = ResourceRel & { type: TagType }\n\n\nexport type SkuSort = Pick<Sku, 'id' | 'code' | 'name' | 'do_not_ship' | 'do_not_track'> & ResourceSort\n// export type SkuFilter = Pick<Sku, 'id' | 'code' | 'name' | 'description' | 'image_url' | 'do_not_ship' | 'do_not_track'> & ResourceFilter\n\n\ninterface Sku extends Resource {\n\t\n\treadonly type: SkuType\n\n\t/** \n\t * The SKU code, that uniquely identifies the SKU within the organization.\n\t * @example ```\"TSHIRTMM000000FFFFFFXLXX\"```\n\t */\n\tcode: string\n\t/** \n\t * The internal name of the SKU.\n\t * @example ```\"Men's Black T-shirt with White Logo (XL)\"```\n\t */\n\tname: string\n\t/** \n\t * An internal description of the SKU.\n\t * @example ```\"Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\"```\n\t */\n\tdescription?: string | null\n\t/** \n\t * The URL of an image that represents the SKU.\n\t * @example ```\"https://img.yourdomain.com/skus/xYZkjABcde.png\"```\n\t */\n\timage_url?: string | null\n\t/** \n\t * The number of pieces that compose the SKU. This is useful to describe sets and bundles.\n\t * @example ```6```\n\t */\n\tpieces_per_pack?: number | null\n\t/** \n\t * The weight of the SKU. If present, it will be used to calculate the shipping rates.\n\t * @example ```300```\n\t */\n\tweight?: number | null\n\t/** \n\t * The unit of weight. One of 'gr', 'oz', or 'lb'.\n\t * @example ```\"gr\"```\n\t */\n\tunit_of_weight?: 'gr' | 'oz' | 'lb' | null\n\t/** \n\t * The Harmonized System Code used by customs to identify the products shipped across international borders.\n\t * @example ```\"4901.91.0020\"```\n\t */\n\ths_tariff_number?: string | null\n\t/** \n\t * Indicates if the SKU doesn't generate shipments.\n\t */\n\tdo_not_ship?: boolean | null\n\t/** \n\t * Indicates if the SKU doesn't track the stock inventory.\n\t */\n\tdo_not_track?: boolean | null\n\t/** \n\t * Aggregated information about the SKU's inventory. Returned only when retrieving a single SKU.\n\t * @example ```{\"available\":true,\"quantity\":10,\"levels\":[{\"quantity\":4,\"delivery_lead_times\":[{\"shipping_method\":{\"name\":\"Standard Shipping\",\"reference\":null,\"price_amount_cents\":700,\"free_over_amount_cents\":9900,\"formatted_price_amount\":\"€7,00\",\"formatted_free_over_amount\":\"€99,00\"},\"min\":{\"hours\":72,\"days\":3},\"max\":{\"hours\":120,\"days\":5}},{\"shipping_method\":{\"name\":\"Express Delivery\",\"reference\":null,\"price_amount_cents\":1200,\"free_over_amount_cents\":null,\"formatted_price_amount\":\"€12,00\",\"formatted_free_over_amount\":null},\"min\":{\"hours\":48,\"days\":2},\"max\":{\"hours\":72,\"days\":3}}]},{\"quantity\":6,\"delivery_lead_times\":[{\"shipping_method\":{\"name\":\"Standard Shipping\",\"reference\":null,\"price_amount_cents\":700,\"free_over_amount_cents\":9900,\"formatted_price_amount\":\"€7,00\",\"formatted_free_over_amount\":\"€99,00\"},\"min\":{\"hours\":96,\"days\":4},\"max\":{\"hours\":144,\"days\":6}},{\"shipping_method\":{\"name\":\"Express Delivery\",\"reference\":null,\"price_amount_cents\":1200,\"free_over_amount_cents\":null,\"formatted_price_amount\":\"€12,00\",\"formatted_free_over_amount\":null},\"min\":{\"hours\":72,\"days\":3},\"max\":{\"hours\":96,\"days\":4}}]}]}```\n\t */\n\tinventory?: Record<string, any> | null\n\t/** \n\t * The custom_claim attached to the current JWT (if any).\n\t * @example ```{}```\n\t */\n\tjwt_custom_claim?: Record<string, any> | null\n\n\tshipping_category?: ShippingCategory | null\n\tprices?: Price[] | null\n\tstock_items?: StockItem[] | null\n\tstock_reservations?: StockReservation[] | null\n\tdelivery_lead_times?: DeliveryLeadTime[] | null\n\tsku_options?: SkuOption[] | null\n\tsku_list_items?: SkuListItem[] | null\n\tsku_lists?: SkuList[] | null\n\tattachments?: Attachment[] | null\n\tlinks?: Link[] | null\n\tevents?: Event[] | null\n\ttags?: Tag[] | null\n\tversions?: Version[] | null\n\tjwt_customer?: Customer | null\n\tjwt_markets?: Market[] | null\n\tjwt_stock_locations?: StockLocation[] | null\n\n}\n\n\ninterface SkuCreate extends ResourceCreate {\n\t\n\t/** \n\t * The SKU code, that uniquely identifies the SKU within the organization.\n\t * @example ```\"TSHIRTMM000000FFFFFFXLXX\"```\n\t */\n\tcode: string\n\t/** \n\t * The internal name of the SKU.\n\t * @example ```\"Men's Black T-shirt with White Logo (XL)\"```\n\t */\n\tname: string\n\t/** \n\t * An internal description of the SKU.\n\t * @example ```\"Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\"```\n\t */\n\tdescription?: string | null\n\t/** \n\t * The URL of an image that represents the SKU.\n\t * @example ```\"https://img.yourdomain.com/skus/xYZkjABcde.png\"```\n\t */\n\timage_url?: string | null\n\t/** \n\t * The number of pieces that compose the SKU. This is useful to describe sets and bundles.\n\t * @example ```6```\n\t */\n\tpieces_per_pack?: number | null\n\t/** \n\t * The weight of the SKU. If present, it will be used to calculate the shipping rates.\n\t * @example ```300```\n\t */\n\tweight?: number | null\n\t/** \n\t * The unit of weight. One of 'gr', 'oz', or 'lb'.\n\t * @example ```\"gr\"```\n\t */\n\tunit_of_weight?: 'gr' | 'oz' | 'lb' | null\n\t/** \n\t * The Harmonized System Code used by customs to identify the products shipped across international borders.\n\t * @example ```\"4901.91.0020\"```\n\t */\n\ths_tariff_number?: string | null\n\t/** \n\t * Indicates if the SKU doesn't generate shipments.\n\t */\n\tdo_not_ship?: boolean | null\n\t/** \n\t * Indicates if the SKU doesn't track the stock inventory.\n\t */\n\tdo_not_track?: boolean | null\n\n\tshipping_category: ShippingCategoryRel\n\ttags?: TagRel[] | null\n\n}\n\n\ninterface SkuUpdate extends ResourceUpdate {\n\t\n\t/** \n\t * The SKU code, that uniquely identifies the SKU within the organization.\n\t * @example ```\"TSHIRTMM000000FFFFFFXLXX\"```\n\t */\n\tcode?: string | null\n\t/** \n\t * The internal name of the SKU.\n\t * @example ```\"Men's Black T-shirt with White Logo (XL)\"```\n\t */\n\tname?: string | null\n\t/** \n\t * An internal description of the SKU.\n\t * @example ```\"Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\"```\n\t */\n\tdescription?: string | null\n\t/** \n\t * The URL of an image that represents the SKU.\n\t * @example ```\"https://img.yourdomain.com/skus/xYZkjABcde.png\"```\n\t */\n\timage_url?: string | null\n\t/** \n\t * The number of pieces that compose the SKU. This is useful to describe sets and bundles.\n\t * @example ```6```\n\t */\n\tpieces_per_pack?: number | null\n\t/** \n\t * The weight of the SKU. If present, it will be used to calculate the shipping rates.\n\t * @example ```300```\n\t */\n\tweight?: number | null\n\t/** \n\t * The unit of weight. One of 'gr', 'oz', or 'lb'.\n\t * @example ```\"gr\"```\n\t */\n\tunit_of_weight?: 'gr' | 'oz' | 'lb' | null\n\t/** \n\t * The Harmonized System Code used by customs to identify the products shipped across international borders.\n\t * @example ```\"4901.91.0020\"```\n\t */\n\ths_tariff_number?: string | null\n\t/** \n\t * Indicates if the SKU doesn't generate shipments.\n\t */\n\tdo_not_ship?: boolean | null\n\t/** \n\t * Indicates if the SKU doesn't track the stock inventory.\n\t */\n\tdo_not_track?: boolean | null\n\t/** \n\t * Comma separated list of tags to be added. Duplicates, invalid and non existing ones are discarded. Cannot be passed by sales channels.\n\t */\n\t_add_tags?: string | null\n\t/** \n\t * Comma separated list of tags to be removed. Duplicates, invalid and non existing ones are discarded. Cannot be passed by sales channels.\n\t */\n\t_remove_tags?: string | null\n\n\tshipping_category?: ShippingCategoryRel | null\n\ttags?: TagRel[] | null\n\n}\n\n\nclass Skus extends ApiResource<Sku> {\n\n\tstatic readonly TYPE: SkuType = 'skus' as const\n\n\tasync create(resource: SkuCreate, params?: QueryParamsRetrieve<Sku>, options?: ResourcesConfig): Promise<Sku> {\n\t\treturn this.resources.create<SkuCreate, Sku>({ ...resource, type: Skus.TYPE }, params, options)\n\t}\n\n\tasync update(resource: SkuUpdate, params?: QueryParamsRetrieve<Sku>, options?: ResourcesConfig): Promise<Sku> {\n\t\treturn this.resources.update<SkuUpdate, Sku>({ ...resource, type: Skus.TYPE }, params, options)\n\t}\n\n\tasync delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void> {\n\t\tawait this.resources.delete((typeof id === 'string')? { id, type: Skus.TYPE } : id, options)\n\t}\n\n\tasync shipping_category(skuId: string | Sku, params?: QueryParamsRetrieve<ShippingCategory>, options?: ResourcesConfig): Promise<ShippingCategory> {\n\t\tconst _skuId = (skuId as Sku).id || skuId as string\n\t\treturn this.resources.fetch<ShippingCategory>({ type: 'shipping_categories' }, `skus/${_skuId}/shipping_category`, params, options) as unknown as ShippingCategory\n\t}\n\n\tasync prices(skuId: string | Sku, params?: QueryParamsList<Price>, options?: ResourcesConfig): Promise<ListResponse<Price>> {\n\t\tconst _skuId = (skuId as Sku).id || skuId as string\n\t\treturn this.resources.fetch<Price>({ type: 'prices' }, `skus/${_skuId}/prices`, params, options) as unknown as ListResponse<Price>\n\t}\n\n\tasync stock_items(skuId: string | Sku, params?: QueryParamsList<StockItem>, options?: ResourcesConfig): Promise<ListResponse<StockItem>> {\n\t\tconst _skuId = (skuId as Sku).id || skuId as string\n\t\treturn this.resources.fetch<StockItem>({ type: 'stock_items' }, `skus/${_skuId}/stock_items`, params, options) as unknown as ListResponse<StockItem>\n\t}\n\n\tasync stock_reservations(skuId: string | Sku, params?: QueryParamsList<StockReservation>, options?: ResourcesConfig): Promise<ListResponse<StockReservation>> {\n\t\tconst _skuId = (skuId as Sku).id || skuId as string\n\t\treturn this.resources.fetch<StockReservation>({ type: 'stock_reservations' }, `skus/${_skuId}/stock_reservations`, params, options) as unknown as ListResponse<StockReservation>\n\t}\n\n\tasync delivery_lead_times(skuId: string | Sku, params?: QueryParamsList<DeliveryLeadTime>, options?: ResourcesConfig): Promise<ListResponse<DeliveryLeadTime>> {\n\t\tconst _skuId = (skuId as Sku).id || skuId as string\n\t\treturn this.resources.fetch<DeliveryLeadTime>({ type: 'delivery_lead_times' }, `skus/${_skuId}/delivery_lead_times`, params, options) as unknown as ListResponse<DeliveryLeadTime>\n\t}\n\n\tasync sku_options(skuId: string | Sku, params?: QueryParamsList<SkuOption>, options?: ResourcesConfig): Promise<ListResponse<SkuOption>> {\n\t\tconst _skuId = (skuId as Sku).id || skuId as string\n\t\treturn this.resources.fetch<SkuOption>({ type: 'sku_options' }, `skus/${_skuId}/sku_options`, params, options) as unknown as ListResponse<SkuOption>\n\t}\n\n\tasync sku_list_items(skuId: string | Sku, params?: QueryParamsList<SkuListItem>, options?: ResourcesConfig): Promise<ListResponse<SkuListItem>> {\n\t\tconst _skuId = (skuId as Sku).id || skuId as string\n\t\treturn this.resources.fetch<SkuListItem>({ type: 'sku_list_items' }, `skus/${_skuId}/sku_list_items`, params, options) as unknown as ListResponse<SkuListItem>\n\t}\n\n\tasync sku_lists(skuId: string | Sku, params?: QueryParamsList<SkuList>, options?: ResourcesConfig): Promise<ListResponse<SkuList>> {\n\t\tconst _skuId = (skuId as Sku).id || skuId as string\n\t\treturn this.resources.fetch<SkuList>({ type: 'sku_lists' }, `skus/${_skuId}/sku_lists`, params, options) as unknown as ListResponse<SkuList>\n\t}\n\n\tasync attachments(skuId: string | Sku, params?: QueryParamsList<Attachment>, options?: ResourcesConfig): Promise<ListResponse<Attachment>> {\n\t\tconst _skuId = (skuId as Sku).id || skuId as string\n\t\treturn this.resources.fetch<Attachment>({ type: 'attachments' }, `skus/${_skuId}/attachments`, params, options) as unknown as ListResponse<Attachment>\n\t}\n\n\tasync links(skuId: string | Sku, params?: QueryParamsList<Link>, options?: ResourcesConfig): Promise<ListResponse<Link>> {\n\t\tconst _skuId = (skuId as Sku).id || skuId as string\n\t\treturn this.resources.fetch<Link>({ type: 'links' }, `skus/${_skuId}/links`, params, options) as unknown as ListResponse<Link>\n\t}\n\n\tasync events(skuId: string | Sku, params?: QueryParamsList<Event>, options?: ResourcesConfig): Promise<ListResponse<Event>> {\n\t\tconst _skuId = (skuId as Sku).id || skuId as string\n\t\treturn this.resources.fetch<Event>({ type: 'events' }, `skus/${_skuId}/events`, params, options) as unknown as ListResponse<Event>\n\t}\n\n\tasync tags(skuId: string | Sku, params?: QueryParamsList<Tag>, options?: ResourcesConfig): Promise<ListResponse<Tag>> {\n\t\tconst _skuId = (skuId as Sku).id || skuId as string\n\t\treturn this.resources.fetch<Tag>({ type: 'tags' }, `skus/${_skuId}/tags`, params, options) as unknown as ListResponse<Tag>\n\t}\n\n\tasync versions(skuId: string | Sku, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>> {\n\t\tconst _skuId = (skuId as Sku).id || skuId as string\n\t\treturn this.resources.fetch<Version>({ type: 'versions' }, `skus/${_skuId}/versions`, params, options) as unknown as ListResponse<Version>\n\t}\n\n\tasync jwt_customer(skuId: string | Sku, params?: QueryParamsRetrieve<Customer>, options?: ResourcesConfig): Promise<Customer> {\n\t\tconst _skuId = (skuId as Sku).id || skuId as string\n\t\treturn this.resources.fetch<Customer>({ type: 'customers' }, `skus/${_skuId}/jwt_customer`, params, options) as unknown as Customer\n\t}\n\n\tasync jwt_markets(skuId: string | Sku, params?: QueryParamsList<Market>, options?: ResourcesConfig): Promise<ListResponse<Market>> {\n\t\tconst _skuId = (skuId as Sku).id || skuId as string\n\t\treturn this.resources.fetch<Market>({ type: 'markets' }, `skus/${_skuId}/jwt_markets`, params, options) as unknown as ListResponse<Market>\n\t}\n\n\tasync jwt_stock_locations(skuId: string | Sku, params?: QueryParamsList<StockLocation>, options?: ResourcesConfig): Promise<ListResponse<StockLocation>> {\n\t\tconst _skuId = (skuId as Sku).id || skuId as string\n\t\treturn this.resources.fetch<StockLocation>({ type: 'stock_locations' }, `skus/${_skuId}/jwt_stock_locations`, params, options) as unknown as ListResponse<StockLocation>\n\t}\n\n\tasync _add_tags(id: string | Sku, triggerValue: string, params?: QueryParamsRetrieve<Sku>, options?: ResourcesConfig): Promise<Sku> {\n\t\treturn this.resources.update<SkuUpdate, Sku>({ id: (typeof id === 'string')? id: id.id, type: Skus.TYPE, _add_tags: triggerValue }, params, options)\n\t}\n\n\tasync _remove_tags(id: string | Sku, triggerValue: string, params?: QueryParamsRetrieve<Sku>, options?: ResourcesConfig): Promise<Sku> {\n\t\treturn this.resources.update<SkuUpdate, Sku>({ id: (typeof id === 'string')? id: id.id, type: Skus.TYPE, _remove_tags: triggerValue }, params, options)\n\t}\n\n\n\tisSku(resource: any): resource is Sku {\n\t\treturn resource.type && (resource.type === Skus.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): SkuRel {\n\t\treturn super.relationshipOneToOne<SkuRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): SkuRel[] {\n\t\treturn super.relationshipOneToMany<SkuRel>(...ids)\n\t}\n\n\n\ttype(): SkuType {\n\t\treturn Skus.TYPE\n\t}\n\n}\n\n\nconst instance = new Skus()\nexport default instance\n\nexport type { Skus, Sku, SkuCreate, SkuUpdate, SkuType }\n"]}
|
1
|
+
{"version":3,"sources":["../src/resources/skus.ts"],"names":[],"mappings":";;;AA6OA,IAAM,IAAA,GAAN,MAAM,KAAA,SAAa,WAAA,CAAiB;AAAA,EAEnC,OAAgB,IAAA,GAAgB,MAAA;AAAA,EAEhC,MAAM,MAAA,CAAO,QAAA,EAAqB,MAAA,EAAmC,OAAA,EAAyC;AAC7G,IAAA,OAAO,IAAA,CAAK,SAAA,CAAU,MAAA,CAAuB,EAAE,GAAG,QAAA,EAAU,IAAA,EAAM,KAAA,CAAK,IAAA,EAAK,EAAG,MAAA,EAAQ,OAAO,CAAA;AAAA;A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OAAO,KAAA,CAAK,IAAA;AAAA;AAGd,CAAA;AAGA,IAAM,QAAA,GAAW,IAAI,IAAA,EAAK;AAC1B,IAAO,YAAA,GAAQ","file":"chunk-ZASD6IUL.js","sourcesContent":["import { ApiResource } from '../resource'\nimport type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse, ResourceSort, /* ResourceFilter */ } from '../resource'\nimport type { QueryParamsRetrieve, QueryParamsList } from '../query'\n\nimport type { ShippingCategory, ShippingCategoryType } from './shipping_categories'\nimport type { Price } from './prices'\nimport type { StockItem } from './stock_items'\nimport type { StockReservation } from './stock_reservations'\nimport type { DeliveryLeadTime } from './delivery_lead_times'\nimport type { SkuOption } from './sku_options'\nimport type { SkuListItem } from './sku_list_items'\nimport type { SkuList } from './sku_lists'\nimport type { Attachment } from './attachments'\nimport type { Link } from './links'\nimport type { Event } from './events'\nimport type { Tag, TagType } from './tags'\nimport type { Version } from './versions'\nimport type { Customer } from './customers'\nimport type { Market } from './markets'\nimport type { StockLocation } from './stock_locations'\n\n\ntype SkuType = 'skus'\ntype SkuRel = ResourceRel & { type: SkuType }\ntype ShippingCategoryRel = ResourceRel & { type: ShippingCategoryType }\ntype TagRel = ResourceRel & { type: TagType }\n\n\nexport type SkuSort = Pick<Sku, 'id' | 'code' | 'name' | 'do_not_ship' | 'do_not_track'> & ResourceSort\n// export type SkuFilter = Pick<Sku, 'id' | 'code' | 'name' | 'description' | 'image_url' | 'do_not_ship' | 'do_not_track'> & ResourceFilter\n\n\ninterface Sku extends Resource {\n\t\n\treadonly type: SkuType\n\n\t/** \n\t * The SKU code, that uniquely identifies the SKU within the organization.\n\t * @example ```\"TSHIRTMM000000FFFFFFXLXX\"```\n\t */\n\tcode: string\n\t/** \n\t * The internal name of the SKU.\n\t * @example ```\"Men's Black T-shirt with White Logo (XL)\"```\n\t */\n\tname: string\n\t/** \n\t * An internal description of the SKU.\n\t * @example ```\"Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\"```\n\t */\n\tdescription?: string | null\n\t/** \n\t * The URL of an image that represents the SKU.\n\t * @example ```\"https://img.yourdomain.com/skus/xYZkjABcde.png\"```\n\t */\n\timage_url?: string | null\n\t/** \n\t * The number of pieces that compose the SKU. This is useful to describe sets and bundles.\n\t * @example ```6```\n\t */\n\tpieces_per_pack?: number | null\n\t/** \n\t * The weight of the SKU. If present, it will be used to calculate the shipping rates.\n\t * @example ```300```\n\t */\n\tweight?: number | null\n\t/** \n\t * The unit of weight. One of 'gr', 'oz', or 'lb'.\n\t * @example ```\"gr\"```\n\t */\n\tunit_of_weight?: 'gr' | 'oz' | 'lb' | null\n\t/** \n\t * The Harmonized System Code used by customs to identify the products shipped across international borders.\n\t * @example ```\"4901.91.0020\"```\n\t */\n\ths_tariff_number?: string | null\n\t/** \n\t * Indicates if the SKU doesn't generate shipments.\n\t */\n\tdo_not_ship?: boolean | null\n\t/** \n\t * Indicates if the SKU doesn't track the stock inventory.\n\t */\n\tdo_not_track?: boolean | null\n\t/** \n\t * Aggregated information about the SKU's inventory. Returned only when retrieving a single SKU.\n\t * @example ```{\"available\":true,\"quantity\":10,\"levels\":[{\"quantity\":4,\"delivery_lead_times\":[{\"shipping_method\":{\"name\":\"Standard Shipping\",\"reference\":null,\"price_amount_cents\":700,\"free_over_amount_cents\":9900,\"formatted_price_amount\":\"€7,00\",\"formatted_free_over_amount\":\"€99,00\"},\"min\":{\"hours\":72,\"days\":3},\"max\":{\"hours\":120,\"days\":5}},{\"shipping_method\":{\"name\":\"Express Delivery\",\"reference\":null,\"price_amount_cents\":1200,\"free_over_amount_cents\":null,\"formatted_price_amount\":\"€12,00\",\"formatted_free_over_amount\":null},\"min\":{\"hours\":48,\"days\":2},\"max\":{\"hours\":72,\"days\":3}}]},{\"quantity\":6,\"delivery_lead_times\":[{\"shipping_method\":{\"name\":\"Standard Shipping\",\"reference\":null,\"price_amount_cents\":700,\"free_over_amount_cents\":9900,\"formatted_price_amount\":\"€7,00\",\"formatted_free_over_amount\":\"€99,00\"},\"min\":{\"hours\":96,\"days\":4},\"max\":{\"hours\":144,\"days\":6}},{\"shipping_method\":{\"name\":\"Express Delivery\",\"reference\":null,\"price_amount_cents\":1200,\"free_over_amount_cents\":null,\"formatted_price_amount\":\"€12,00\",\"formatted_free_over_amount\":null},\"min\":{\"hours\":72,\"days\":3},\"max\":{\"hours\":96,\"days\":4}}]}]}```\n\t */\n\tinventory?: Record<string, any> | null\n\t/** \n\t * The custom_claim attached to the current JWT (if any).\n\t * @example ```{}```\n\t */\n\tjwt_custom_claim?: Record<string, any> | null\n\n\tshipping_category?: ShippingCategory | null\n\tprices?: Price[] | null\n\tstock_items?: StockItem[] | null\n\tstock_reservations?: StockReservation[] | null\n\tdelivery_lead_times?: DeliveryLeadTime[] | null\n\tsku_options?: SkuOption[] | null\n\tsku_list_items?: SkuListItem[] | null\n\tsku_lists?: SkuList[] | null\n\tattachments?: Attachment[] | null\n\tlinks?: Link[] | null\n\tevents?: Event[] | null\n\ttags?: Tag[] | null\n\tversions?: Version[] | null\n\tjwt_customer?: Customer | null\n\tjwt_markets?: Market[] | null\n\tjwt_stock_locations?: StockLocation[] | null\n\n}\n\n\ninterface SkuCreate extends ResourceCreate {\n\t\n\t/** \n\t * The SKU code, that uniquely identifies the SKU within the organization.\n\t * @example ```\"TSHIRTMM000000FFFFFFXLXX\"```\n\t */\n\tcode: string\n\t/** \n\t * The internal name of the SKU.\n\t * @example ```\"Men's Black T-shirt with White Logo (XL)\"```\n\t */\n\tname: string\n\t/** \n\t * An internal description of the SKU.\n\t * @example ```\"Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\"```\n\t */\n\tdescription?: string | null\n\t/** \n\t * The URL of an image that represents the SKU.\n\t * @example ```\"https://img.yourdomain.com/skus/xYZkjABcde.png\"```\n\t */\n\timage_url?: string | null\n\t/** \n\t * The number of pieces that compose the SKU. This is useful to describe sets and bundles.\n\t * @example ```6```\n\t */\n\tpieces_per_pack?: number | null\n\t/** \n\t * The weight of the SKU. If present, it will be used to calculate the shipping rates.\n\t * @example ```300```\n\t */\n\tweight?: number | null\n\t/** \n\t * The unit of weight. One of 'gr', 'oz', or 'lb'.\n\t * @example ```\"gr\"```\n\t */\n\tunit_of_weight?: 'gr' | 'oz' | 'lb' | null\n\t/** \n\t * The Harmonized System Code used by customs to identify the products shipped across international borders.\n\t * @example ```\"4901.91.0020\"```\n\t */\n\ths_tariff_number?: string | null\n\t/** \n\t * Indicates if the SKU doesn't generate shipments.\n\t */\n\tdo_not_ship?: boolean | null\n\t/** \n\t * Indicates if the SKU doesn't track the stock inventory.\n\t */\n\tdo_not_track?: boolean | null\n\n\tshipping_category: ShippingCategoryRel\n\ttags?: TagRel[] | null\n\n}\n\n\ninterface SkuUpdate extends ResourceUpdate {\n\t\n\t/** \n\t * The SKU code, that uniquely identifies the SKU within the organization.\n\t * @example ```\"TSHIRTMM000000FFFFFFXLXX\"```\n\t */\n\tcode?: string | null\n\t/** \n\t * The internal name of the SKU.\n\t * @example ```\"Men's Black T-shirt with White Logo (XL)\"```\n\t */\n\tname?: string | null\n\t/** \n\t * An internal description of the SKU.\n\t * @example ```\"Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\"```\n\t */\n\tdescription?: string | null\n\t/** \n\t * The URL of an image that represents the SKU.\n\t * @example ```\"https://img.yourdomain.com/skus/xYZkjABcde.png\"```\n\t */\n\timage_url?: string | null\n\t/** \n\t * The number of pieces that compose the SKU. This is useful to describe sets and bundles.\n\t * @example ```6```\n\t */\n\tpieces_per_pack?: number | null\n\t/** \n\t * The weight of the SKU. If present, it will be used to calculate the shipping rates.\n\t * @example ```300```\n\t */\n\tweight?: number | null\n\t/** \n\t * The unit of weight. One of 'gr', 'oz', or 'lb'.\n\t * @example ```\"gr\"```\n\t */\n\tunit_of_weight?: 'gr' | 'oz' | 'lb' | null\n\t/** \n\t * The Harmonized System Code used by customs to identify the products shipped across international borders.\n\t * @example ```\"4901.91.0020\"```\n\t */\n\ths_tariff_number?: string | null\n\t/** \n\t * Indicates if the SKU doesn't generate shipments.\n\t */\n\tdo_not_ship?: boolean | null\n\t/** \n\t * Indicates if the SKU doesn't track the stock inventory.\n\t */\n\tdo_not_track?: boolean | null\n\t/** \n\t * Comma separated list of tags to be added. Duplicates, invalid and non existing ones are discarded. Cannot be passed by sales channels.\n\t */\n\t_add_tags?: string | null\n\t/** \n\t * Comma separated list of tags to be removed. Duplicates, invalid and non existing ones are discarded. Cannot be passed by sales channels.\n\t */\n\t_remove_tags?: string | null\n\n\tshipping_category?: ShippingCategoryRel | null\n\ttags?: TagRel[] | null\n\n}\n\n\nclass Skus extends ApiResource<Sku> {\n\n\tstatic readonly TYPE: SkuType = 'skus' as const\n\n\tasync create(resource: SkuCreate, params?: QueryParamsRetrieve<Sku>, options?: ResourcesConfig): Promise<Sku> {\n\t\treturn this.resources.create<SkuCreate, Sku>({ ...resource, type: Skus.TYPE }, params, options)\n\t}\n\n\tasync update(resource: SkuUpdate, params?: QueryParamsRetrieve<Sku>, options?: ResourcesConfig): Promise<Sku> {\n\t\treturn this.resources.update<SkuUpdate, Sku>({ ...resource, type: Skus.TYPE }, params, options)\n\t}\n\n\tasync delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void> {\n\t\tawait this.resources.delete((typeof id === 'string')? { id, type: Skus.TYPE } : id, options)\n\t}\n\n\tasync shipping_category(skuId: string | Sku, params?: QueryParamsRetrieve<ShippingCategory>, options?: ResourcesConfig): Promise<ShippingCategory> {\n\t\tconst _skuId = (skuId as Sku).id || skuId as string\n\t\treturn this.resources.fetch<ShippingCategory>({ type: 'shipping_categories' }, `skus/${_skuId}/shipping_category`, params, options) as unknown as ShippingCategory\n\t}\n\n\tasync prices(skuId: string | Sku, params?: QueryParamsList<Price>, options?: ResourcesConfig): Promise<ListResponse<Price>> {\n\t\tconst _skuId = (skuId as Sku).id || skuId as string\n\t\treturn this.resources.fetch<Price>({ type: 'prices' }, `skus/${_skuId}/prices`, params, options) as unknown as ListResponse<Price>\n\t}\n\n\tasync stock_items(skuId: string | Sku, params?: QueryParamsList<StockItem>, options?: ResourcesConfig): Promise<ListResponse<StockItem>> {\n\t\tconst _skuId = (skuId as Sku).id || skuId as string\n\t\treturn this.resources.fetch<StockItem>({ type: 'stock_items' }, `skus/${_skuId}/stock_items`, params, options) as unknown as ListResponse<StockItem>\n\t}\n\n\tasync stock_reservations(skuId: string | Sku, params?: QueryParamsList<StockReservation>, options?: ResourcesConfig): Promise<ListResponse<StockReservation>> {\n\t\tconst _skuId = (skuId as Sku).id || skuId as string\n\t\treturn this.resources.fetch<StockReservation>({ type: 'stock_reservations' }, `skus/${_skuId}/stock_reservations`, params, options) as unknown as ListResponse<StockReservation>\n\t}\n\n\tasync delivery_lead_times(skuId: string | Sku, params?: QueryParamsList<DeliveryLeadTime>, options?: ResourcesConfig): Promise<ListResponse<DeliveryLeadTime>> {\n\t\tconst _skuId = (skuId as Sku).id || skuId as string\n\t\treturn this.resources.fetch<DeliveryLeadTime>({ type: 'delivery_lead_times' }, `skus/${_skuId}/delivery_lead_times`, params, options) as unknown as ListResponse<DeliveryLeadTime>\n\t}\n\n\tasync sku_options(skuId: string | Sku, params?: QueryParamsList<SkuOption>, options?: ResourcesConfig): Promise<ListResponse<SkuOption>> {\n\t\tconst _skuId = (skuId as Sku).id || skuId as string\n\t\treturn this.resources.fetch<SkuOption>({ type: 'sku_options' }, `skus/${_skuId}/sku_options`, params, options) as unknown as ListResponse<SkuOption>\n\t}\n\n\tasync sku_list_items(skuId: string | Sku, params?: QueryParamsList<SkuListItem>, options?: ResourcesConfig): Promise<ListResponse<SkuListItem>> {\n\t\tconst _skuId = (skuId as Sku).id || skuId as string\n\t\treturn this.resources.fetch<SkuListItem>({ type: 'sku_list_items' }, `skus/${_skuId}/sku_list_items`, params, options) as unknown as ListResponse<SkuListItem>\n\t}\n\n\tasync sku_lists(skuId: string | Sku, params?: QueryParamsList<SkuList>, options?: ResourcesConfig): Promise<ListResponse<SkuList>> {\n\t\tconst _skuId = (skuId as Sku).id || skuId as string\n\t\treturn this.resources.fetch<SkuList>({ type: 'sku_lists' }, `skus/${_skuId}/sku_lists`, params, options) as unknown as ListResponse<SkuList>\n\t}\n\n\tasync attachments(skuId: string | Sku, params?: QueryParamsList<Attachment>, options?: ResourcesConfig): Promise<ListResponse<Attachment>> {\n\t\tconst _skuId = (skuId as Sku).id || skuId as string\n\t\treturn this.resources.fetch<Attachment>({ type: 'attachments' }, `skus/${_skuId}/attachments`, params, options) as unknown as ListResponse<Attachment>\n\t}\n\n\tasync links(skuId: string | Sku, params?: QueryParamsList<Link>, options?: ResourcesConfig): Promise<ListResponse<Link>> {\n\t\tconst _skuId = (skuId as Sku).id || skuId as string\n\t\treturn this.resources.fetch<Link>({ type: 'links' }, `skus/${_skuId}/links`, params, options) as unknown as ListResponse<Link>\n\t}\n\n\tasync events(skuId: string | Sku, params?: QueryParamsList<Event>, options?: ResourcesConfig): Promise<ListResponse<Event>> {\n\t\tconst _skuId = (skuId as Sku).id || skuId as string\n\t\treturn this.resources.fetch<Event>({ type: 'events' }, `skus/${_skuId}/events`, params, options) as unknown as ListResponse<Event>\n\t}\n\n\tasync tags(skuId: string | Sku, params?: QueryParamsList<Tag>, options?: ResourcesConfig): Promise<ListResponse<Tag>> {\n\t\tconst _skuId = (skuId as Sku).id || skuId as string\n\t\treturn this.resources.fetch<Tag>({ type: 'tags' }, `skus/${_skuId}/tags`, params, options) as unknown as ListResponse<Tag>\n\t}\n\n\tasync versions(skuId: string | Sku, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>> {\n\t\tconst _skuId = (skuId as Sku).id || skuId as string\n\t\treturn this.resources.fetch<Version>({ type: 'versions' }, `skus/${_skuId}/versions`, params, options) as unknown as ListResponse<Version>\n\t}\n\n\tasync jwt_customer(skuId: string | Sku, params?: QueryParamsRetrieve<Customer>, options?: ResourcesConfig): Promise<Customer> {\n\t\tconst _skuId = (skuId as Sku).id || skuId as string\n\t\treturn this.resources.fetch<Customer>({ type: 'customers' }, `skus/${_skuId}/jwt_customer`, params, options) as unknown as Customer\n\t}\n\n\tasync jwt_markets(skuId: string | Sku, params?: QueryParamsList<Market>, options?: ResourcesConfig): Promise<ListResponse<Market>> {\n\t\tconst _skuId = (skuId as Sku).id || skuId as string\n\t\treturn this.resources.fetch<Market>({ type: 'markets' }, `skus/${_skuId}/jwt_markets`, params, options) as unknown as ListResponse<Market>\n\t}\n\n\tasync jwt_stock_locations(skuId: string | Sku, params?: QueryParamsList<StockLocation>, options?: ResourcesConfig): Promise<ListResponse<StockLocation>> {\n\t\tconst _skuId = (skuId as Sku).id || skuId as string\n\t\treturn this.resources.fetch<StockLocation>({ type: 'stock_locations' }, `skus/${_skuId}/jwt_stock_locations`, params, options) as unknown as ListResponse<StockLocation>\n\t}\n\n\tasync _add_tags(id: string | Sku, triggerValue: string, params?: QueryParamsRetrieve<Sku>, options?: ResourcesConfig): Promise<Sku> {\n\t\treturn this.resources.update<SkuUpdate, Sku>({ id: (typeof id === 'string')? id: id.id, type: Skus.TYPE, _add_tags: triggerValue }, params, options)\n\t}\n\n\tasync _remove_tags(id: string | Sku, triggerValue: string, params?: QueryParamsRetrieve<Sku>, options?: ResourcesConfig): Promise<Sku> {\n\t\treturn this.resources.update<SkuUpdate, Sku>({ id: (typeof id === 'string')? id: id.id, type: Skus.TYPE, _remove_tags: triggerValue }, params, options)\n\t}\n\n\n\tisSku(resource: any): resource is Sku {\n\t\treturn resource.type && (resource.type === Skus.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): SkuRel {\n\t\treturn super.relationshipOneToOne<SkuRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): SkuRel[] {\n\t\treturn super.relationshipOneToMany<SkuRel>(...ids)\n\t}\n\n\n\ttype(): SkuType {\n\t\treturn Skus.TYPE\n\t}\n\n}\n\n\nconst instance = new Skus()\nexport default instance\n\nexport type { Skus, Sku, SkuCreate, SkuUpdate, SkuType }\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/resources/parcel_line_items.ts"],"names":[],"mappings":";;;AAyEA,IAAM,eAAA,GAAN,MAAM,gBAAA,SAAwB,
|
1
|
+
{"version":3,"sources":["../src/resources/parcel_line_items.ts"],"names":[],"mappings":";;;AAyEA,IAAM,eAAA,GAAN,MAAM,gBAAA,SAAwB,WAAA,CAA4B;AAAA,EAEzD,OAAgB,IAAA,GAA2B,mBAAA;AAAA,EAE3C,MAAM,MAAA,CAAO,QAAA,EAAgC,MAAA,EAA8C,OAAA,EAAoD;AAC9I,IAAA,OAAO,IAAA,CAAK,SAAA,CAAU,MAAA,CAA6C,EAAE,GAAG,QAAA,EAAU,IAAA,EAAM,gBAAA,CAAgB,IAAA,EAAK,EAAG,MAAA,EAAQ,OAAO,CAAA;AAAA;AAChI,EAEA,MAAM,MAAA,CAAO,QAAA,EAAgC,MAAA,EAA8C,OAAA,EAAoD;AAC9I,IAAA,OAAO,IAAA,CAAK,SAAA,CAAU,MAAA,CAA6C,EAAE,GAAG,QAAA,EAAU,IAAA,EAAM,gBAAA,CAAgB,IAAA,EAAK,EAAG,MAAA,EAAQ,OAAO,CAAA;AAAA;AAChI,EAEA,MAAM,MAAA,CAAO,EAAA,EAAyB,OAAA,EAA0C;AAC/E,IAAA,MAAM,IAAA,CAAK,SAAA,CAAU,MAAA,CAAQ,OAAO,EAAA,KAAO,QAAA,GAAW,EAAE,EAAA,EAAI,IAAA,EAAM,gBAAA,CAAgB,IAAA,EAAK,GAAI,IAAI,OAAO,CAAA;AAAA;AACvG,EAEA,MAAM,MAAA,CAAO,gBAAA,EAA2C,MAAA,EAAsC,OAAA,EAA4C;AACzI,IAAA,MAAM,iBAAA,GAAqB,iBAAoC,EAAA,IAAM,gBAAA;AACrE,IAAA,OAAO,IAAA,CAAK,SAAA,CAAU,KAAA,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-ZEEB5YAU.js","sourcesContent":["import { ApiResource } from '../resource'\nimport type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse, ResourceSort, /* ResourceFilter */ } from '../resource'\nimport type { QueryParamsRetrieve, QueryParamsList } from '../query'\n\nimport type { Parcel, ParcelType } from './parcels'\nimport type { StockLineItem, StockLineItemType } from './stock_line_items'\nimport type { Version } from './versions'\n\n\ntype ParcelLineItemType = 'parcel_line_items'\ntype ParcelLineItemRel = ResourceRel & { type: ParcelLineItemType }\ntype ParcelRel = ResourceRel & { type: ParcelType }\ntype StockLineItemRel = ResourceRel & { type: StockLineItemType }\n\n\nexport type ParcelLineItemSort = Pick<ParcelLineItem, 'id' | 'quantity'> & ResourceSort\n// export type ParcelLineItemFilter = Pick<ParcelLineItem, 'id' | 'quantity'> & ResourceFilter\n\n\ninterface ParcelLineItem extends Resource {\n\t\n\treadonly type: ParcelLineItemType\n\n\t/** \n\t * The code of the associated SKU.\n\t * @example ```\"TSHIRTMM000000FFFFFFXLXX\"```\n\t */\n\tsku_code?: string | null\n\t/** \n\t * The code of the associated bundle.\n\t * @example ```\"BUNDLEMM000000FFFFFFXLXX\"```\n\t */\n\tbundle_code?: string | null\n\t/** \n\t * The parcel line item quantity.\n\t * @example ```4```\n\t */\n\tquantity: number\n\t/** \n\t * The internal name of the associated line item.\n\t * @example ```\"Men's Black T-shirt with White Logo (XL)\"```\n\t */\n\tname?: string | null\n\t/** \n\t * The image_url of the associated line item.\n\t * @example ```\"https://img.yourdomain.com/skus/xYZkjABcde.png\"```\n\t */\n\timage_url?: string | null\n\n\tparcel?: Parcel | null\n\tstock_line_item?: StockLineItem | null\n\tversions?: Version[] | null\n\n}\n\n\ninterface ParcelLineItemCreate extends ResourceCreate {\n\t\n\t/** \n\t * The parcel line item quantity.\n\t * @example ```4```\n\t */\n\tquantity: number\n\n\tparcel: ParcelRel\n\tstock_line_item: StockLineItemRel\n\n}\n\n\ntype ParcelLineItemUpdate = ResourceUpdate\n\n\nclass ParcelLineItems extends ApiResource<ParcelLineItem> {\n\n\tstatic readonly TYPE: ParcelLineItemType = 'parcel_line_items' as const\n\n\tasync create(resource: ParcelLineItemCreate, params?: QueryParamsRetrieve<ParcelLineItem>, options?: ResourcesConfig): Promise<ParcelLineItem> {\n\t\treturn this.resources.create<ParcelLineItemCreate, ParcelLineItem>({ ...resource, type: ParcelLineItems.TYPE }, params, options)\n\t}\n\n\tasync update(resource: ParcelLineItemUpdate, params?: QueryParamsRetrieve<ParcelLineItem>, options?: ResourcesConfig): Promise<ParcelLineItem> {\n\t\treturn this.resources.update<ParcelLineItemUpdate, ParcelLineItem>({ ...resource, type: ParcelLineItems.TYPE }, params, options)\n\t}\n\n\tasync delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void> {\n\t\tawait this.resources.delete((typeof id === 'string')? { id, type: ParcelLineItems.TYPE } : id, options)\n\t}\n\n\tasync parcel(parcelLineItemId: string | ParcelLineItem, params?: QueryParamsRetrieve<Parcel>, options?: ResourcesConfig): Promise<Parcel> {\n\t\tconst _parcelLineItemId = (parcelLineItemId as ParcelLineItem).id || parcelLineItemId as string\n\t\treturn this.resources.fetch<Parcel>({ type: 'parcels' }, `parcel_line_items/${_parcelLineItemId}/parcel`, params, options) as unknown as Parcel\n\t}\n\n\tasync stock_line_item(parcelLineItemId: string | ParcelLineItem, params?: QueryParamsRetrieve<StockLineItem>, options?: ResourcesConfig): Promise<StockLineItem> {\n\t\tconst _parcelLineItemId = (parcelLineItemId as ParcelLineItem).id || parcelLineItemId as string\n\t\treturn this.resources.fetch<StockLineItem>({ type: 'stock_line_items' }, `parcel_line_items/${_parcelLineItemId}/stock_line_item`, params, options) as unknown as StockLineItem\n\t}\n\n\tasync versions(parcelLineItemId: string | ParcelLineItem, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>> {\n\t\tconst _parcelLineItemId = (parcelLineItemId as ParcelLineItem).id || parcelLineItemId as string\n\t\treturn this.resources.fetch<Version>({ type: 'versions' }, `parcel_line_items/${_parcelLineItemId}/versions`, params, options) as unknown as ListResponse<Version>\n\t}\n\n\n\tisParcelLineItem(resource: any): resource is ParcelLineItem {\n\t\treturn resource.type && (resource.type === ParcelLineItems.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): ParcelLineItemRel {\n\t\treturn super.relationshipOneToOne<ParcelLineItemRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): ParcelLineItemRel[] {\n\t\treturn super.relationshipOneToMany<ParcelLineItemRel>(...ids)\n\t}\n\n\n\ttype(): ParcelLineItemType {\n\t\treturn ParcelLineItems.TYPE\n\t}\n\n}\n\n\nconst instance = new ParcelLineItems()\nexport default instance\n\nexport type { ParcelLineItems, ParcelLineItem, ParcelLineItemCreate, ParcelLineItemUpdate, ParcelLineItemType }\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/resources/tax_rules.ts"],"names":["ApiResource"],"mappings":";;;;;AAyNA,IAAM,QAAA,GAAN,MAAM,SAAA,SAAiBA,6BAAqB,CAAA;AAAA,EAE3C,OAAgB,IAAoB,GAAA,WAAA;AAAA,EAEpC,MAAM,MAAA,CAAO,QAAyB,EAAA,MAAA,EAAuC,OAA6C,EAAA;AACzH,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,MAAA,CAA+B,EAAE,GAAG,QAAU,EAAA,IAAA,EAAM,SAAS,CAAA,IAAA,EAAQ,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AAC3G,EAEA,MAAM,MAAA,CAAO,QAAyB,EAAA,MAAA,EAAuC,OAA6C,EAAA;AACzH,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,MAAA,CAA+B,EAAE,GAAG,QAAU,EAAA,IAAA,EAAM,SAAS,CAAA,IAAA,EAAQ,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AAC3G,EAEA,MAAM,MAAO,CAAA,EAAA,EAAyB,OAA0C,EAAA;AAC/E,IAAA,M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SCFH5J.cjs","sourcesContent":["import { ApiResource } from '../resource'\nimport type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse, ResourceSort, /* ResourceFilter */ } from '../resource'\nimport type { QueryParamsRetrieve, QueryParamsList } from '../query'\n\nimport type { ManualTaxCalculator, ManualTaxCalculatorType } from './manual_tax_calculators'\nimport type { Version } from './versions'\n\n\ntype TaxRuleType = 'tax_rules'\ntype TaxRuleRel = ResourceRel & { type: TaxRuleType }\ntype ManualTaxCalculatorRel = ResourceRel & { type: ManualTaxCalculatorType }\n\n\nexport type TaxRuleSort = Pick<TaxRule, 'id' | 'name' | 'tax_rate'> & ResourceSort\n// export type TaxRuleFilter = Pick<TaxRule, 'id' | 'name' | 'tax_rate' | 'freight_taxable' | 'payment_method_taxable' | 'gift_card_taxable' | 'adjustment_taxable'> & ResourceFilter\n\n\ninterface TaxRule extends Resource {\n\t\n\treadonly type: TaxRuleType\n\n\t/** \n\t * The tax rule internal name.\n\t * @example ```\"Fixed 22%\"```\n\t */\n\tname: string\n\t/** \n\t * The tax rate for this rule.\n\t * @example ```0.22```\n\t */\n\ttax_rate?: number | null\n\t/** \n\t * Indicates if the freight is taxable.\n\t */\n\tfreight_taxable?: boolean | null\n\t/** \n\t * Indicates if the payment method is taxable.\n\t */\n\tpayment_method_taxable?: boolean | null\n\t/** \n\t * Indicates if gift cards are taxable.\n\t */\n\tgift_card_taxable?: boolean | null\n\t/** \n\t * Indicates if adjustemnts are taxable.\n\t */\n\tadjustment_taxable?: boolean | null\n\t/** \n\t * The breakdown for this tax rule (if calculated).\n\t * @example ```{\"41\":{\"tax_rate\":0.22}}```\n\t */\n\tbreakdown?: Record<string, any> | null\n\t/** \n\t * The regex that will be evaluated to match the shipping address country code, max size is 5000.\n\t * @example ```\"AT|BE|BG|CZ|DK|EE|DE|HU|LV|LT\"```\n\t */\n\tcountry_code_regex?: string | null\n\t/** \n\t * The regex that will be evaluated as negative match for the shipping address country code, max size is 5000.\n\t * @example ```\"AT|BE|BG|CZ|DK|EE|DE\"```\n\t */\n\tnot_country_code_regex?: string | null\n\t/** \n\t * The regex that will be evaluated to match the shipping address state code, max size is 5000.\n\t * @example ```\"A[KLRZ]|C[AOT]|D[CE]|FL\"```\n\t */\n\tstate_code_regex?: string | null\n\t/** \n\t * The regex that will be evaluated as negative match for the shipping address state code, max size is 5000.\n\t * @example ```\"A[KLRZ]|C[AOT]\"```\n\t */\n\tnot_state_code_regex?: string | null\n\t/** \n\t * The regex that will be evaluated to match the shipping address zip code, max size is 5000.\n\t * @example ```\"(?i)(JE1|JE2|JE3|JE4|JE5)\"```\n\t */\n\tzip_code_regex?: string | null\n\t/** \n\t * The regex that will be evaluated as negative match for the shipping zip country code, max size is 5000.\n\t * @example ```\"(?i)(JE1|JE2|JE3)\"```\n\t */\n\tnot_zip_code_regex?: string | null\n\n\tmanual_tax_calculator?: ManualTaxCalculator | null\n\tversions?: Version[] | null\n\n}\n\n\ninterface TaxRuleCreate extends ResourceCreate {\n\t\n\t/** \n\t * The tax rule internal name.\n\t * @example ```\"Fixed 22%\"```\n\t */\n\tname: string\n\t/** \n\t * The tax rate for this rule.\n\t * @example ```0.22```\n\t */\n\ttax_rate?: number | null\n\t/** \n\t * Indicates if the freight is taxable.\n\t */\n\tfreight_taxable?: boolean | null\n\t/** \n\t * Indicates if the payment method is taxable.\n\t */\n\tpayment_method_taxable?: boolean | null\n\t/** \n\t * Indicates if gift cards are taxable.\n\t */\n\tgift_card_taxable?: boolean | null\n\t/** \n\t * Indicates if adjustemnts are taxable.\n\t */\n\tadjustment_taxable?: boolean | null\n\t/** \n\t * The regex that will be evaluated to match the shipping address country code, max size is 5000.\n\t * @example ```\"AT|BE|BG|CZ|DK|EE|DE|HU|LV|LT\"```\n\t */\n\tcountry_code_regex?: string | null\n\t/** \n\t * The regex that will be evaluated as negative match for the shipping address country code, max size is 5000.\n\t * @example ```\"AT|BE|BG|CZ|DK|EE|DE\"```\n\t */\n\tnot_country_code_regex?: string | null\n\t/** \n\t * The regex that will be evaluated to match the shipping address state code, max size is 5000.\n\t * @example ```\"A[KLRZ]|C[AOT]|D[CE]|FL\"```\n\t */\n\tstate_code_regex?: string | null\n\t/** \n\t * The regex that will be evaluated as negative match for the shipping address state code, max size is 5000.\n\t * @example ```\"A[KLRZ]|C[AOT]\"```\n\t */\n\tnot_state_code_regex?: string | null\n\t/** \n\t * The regex that will be evaluated to match the shipping address zip code, max size is 5000.\n\t * @example ```\"(?i)(JE1|JE2|JE3|JE4|JE5)\"```\n\t */\n\tzip_code_regex?: string | null\n\t/** \n\t * The regex that will be evaluated as negative match for the shipping zip country code, max size is 5000.\n\t * @example ```\"(?i)(JE1|JE2|JE3)\"```\n\t */\n\tnot_zip_code_regex?: string | null\n\n\tmanual_tax_calculator: ManualTaxCalculatorRel\n\n}\n\n\ninterface TaxRuleUpdate extends ResourceUpdate {\n\t\n\t/** \n\t * The tax rule internal name.\n\t * @example ```\"Fixed 22%\"```\n\t */\n\tname?: string | null\n\t/** \n\t * The tax rate for this rule.\n\t * @example ```0.22```\n\t */\n\ttax_rate?: number | null\n\t/** \n\t * Indicates if the freight is taxable.\n\t */\n\tfreight_taxable?: boolean | null\n\t/** \n\t * Indicates if the payment method is taxable.\n\t */\n\tpayment_method_taxable?: boolean | null\n\t/** \n\t * Indicates if gift cards are taxable.\n\t */\n\tgift_card_taxable?: boolean | null\n\t/** \n\t * Indicates if adjustemnts are taxable.\n\t */\n\tadjustment_taxable?: boolean | null\n\t/** \n\t * The regex that will be evaluated to match the shipping address country code, max size is 5000.\n\t * @example ```\"AT|BE|BG|CZ|DK|EE|DE|HU|LV|LT\"```\n\t */\n\tcountry_code_regex?: string | null\n\t/** \n\t * The regex that will be evaluated as negative match for the shipping address country code, max size is 5000.\n\t * @example ```\"AT|BE|BG|CZ|DK|EE|DE\"```\n\t */\n\tnot_country_code_regex?: string | null\n\t/** \n\t * The regex that will be evaluated to match the shipping address state code, max size is 5000.\n\t * @example ```\"A[KLRZ]|C[AOT]|D[CE]|FL\"```\n\t */\n\tstate_code_regex?: string | null\n\t/** \n\t * The regex that will be evaluated as negative match for the shipping address state code, max size is 5000.\n\t * @example ```\"A[KLRZ]|C[AOT]\"```\n\t */\n\tnot_state_code_regex?: string | null\n\t/** \n\t * The regex that will be evaluated to match the shipping address zip code, max size is 5000.\n\t * @example ```\"(?i)(JE1|JE2|JE3|JE4|JE5)\"```\n\t */\n\tzip_code_regex?: string | null\n\t/** \n\t * The regex that will be evaluated as negative match for the shipping zip country code, max size is 5000.\n\t * @example ```\"(?i)(JE1|JE2|JE3)\"```\n\t */\n\tnot_zip_code_regex?: string | null\n\n\tmanual_tax_calculator?: ManualTaxCalculatorRel | null\n\n}\n\n\nclass TaxRules extends ApiResource<TaxRule> {\n\n\tstatic readonly TYPE: TaxRuleType = 'tax_rules' as const\n\n\tasync create(resource: TaxRuleCreate, params?: QueryParamsRetrieve<TaxRule>, options?: ResourcesConfig): Promise<TaxRule> {\n\t\treturn this.resources.create<TaxRuleCreate, TaxRule>({ ...resource, type: TaxRules.TYPE }, params, options)\n\t}\n\n\tasync update(resource: TaxRuleUpdate, params?: QueryParamsRetrieve<TaxRule>, options?: ResourcesConfig): Promise<TaxRule> {\n\t\treturn this.resources.update<TaxRuleUpdate, TaxRule>({ ...resource, type: TaxRules.TYPE }, params, options)\n\t}\n\n\tasync delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void> {\n\t\tawait this.resources.delete((typeof id === 'string')? { id, type: TaxRules.TYPE } : id, options)\n\t}\n\n\tasync manual_tax_calculator(taxRuleId: string | TaxRule, params?: QueryParamsRetrieve<ManualTaxCalculator>, options?: ResourcesConfig): Promise<ManualTaxCalculator> {\n\t\tconst _taxRuleId = (taxRuleId as TaxRule).id || taxRuleId as string\n\t\treturn this.resources.fetch<ManualTaxCalculator>({ type: 'manual_tax_calculators' }, `tax_rules/${_taxRuleId}/manual_tax_calculator`, params, options) as unknown as ManualTaxCalculator\n\t}\n\n\tasync versions(taxRuleId: string | TaxRule, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>> {\n\t\tconst _taxRuleId = (taxRuleId as TaxRule).id || taxRuleId as string\n\t\treturn this.resources.fetch<Version>({ type: 'versions' }, `tax_rules/${_taxRuleId}/versions`, params, options) as unknown as ListResponse<Version>\n\t}\n\n\n\tisTaxRule(resource: any): resource is TaxRule {\n\t\treturn resource.type && (resource.type === TaxRules.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): TaxRuleRel {\n\t\treturn super.relationshipOneToOne<TaxRuleRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): TaxRuleRel[] {\n\t\treturn super.relationshipOneToMany<TaxRuleRel>(...ids)\n\t}\n\n\n\ttype(): TaxRuleType {\n\t\treturn TaxRules.TYPE\n\t}\n\n}\n\n\nconst instance = new TaxRules()\nexport default instance\n\nexport type { TaxRules, TaxRule, TaxRuleCreate, TaxRuleUpdate, TaxRuleType }\n"]}
|
1
|
+
{"version":3,"sources":["../src/resources/tax_rules.ts"],"names":["ApiResource"],"mappings":";;;;;AAyNA,IAAM,QAAA,GAAN,MAAM,SAAA,SAAiBA,6BAAA,CAAqB;AAAA,EAE3C,OAAgB,IAAA,GAAoB,WAAA;AAAA,EAEpC,MAAM,MAAA,CAAO,QAAA,EAAyB,MAAA,EAAuC,OAAA,EAA6C;AACzH,IAAA,OAAO,IAAA,CAAK,SAAA,CAAU,MAAA,CAA+B,EAAE,GAAG,QAAA,EAAU,IAAA,EAAM,SAAA,CAAS,IAAA,EAAK,EAAG,MAAA,EAAQ,OAAO,CAAA;AAAA;AAC3G,EAEA,MAAM,MAAA,CAAO,QAAA,EAAyB,MAAA,EAAuC,OAAA,EAA6C;AACzH,IAAA,OAAO,IAAA,CAAK,SAAA,CAAU,MAAA,CAA+B,EAAE,GAAG,QAAA,EAAU,IAAA,EAAM,SAAA,CAAS,IAAA,EAAK,EAAG,MAAA,EAAQ,OAAO,CAAA;AAAA;AAC3G,EA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AAW,IAAI,QAAA,EAAS;AAC9B,IAAO,iBAAA,GAAQ","file":"chunk-ZQSCFH5J.cjs","sourcesContent":["import { ApiResource } from '../resource'\nimport type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse, ResourceSort, /* ResourceFilter */ } from '../resource'\nimport type { QueryParamsRetrieve, QueryParamsList } from '../query'\n\nimport type { ManualTaxCalculator, ManualTaxCalculatorType } from './manual_tax_calculators'\nimport type { Version } from './versions'\n\n\ntype TaxRuleType = 'tax_rules'\ntype TaxRuleRel = ResourceRel & { type: TaxRuleType }\ntype ManualTaxCalculatorRel = ResourceRel & { type: ManualTaxCalculatorType }\n\n\nexport type TaxRuleSort = Pick<TaxRule, 'id' | 'name' | 'tax_rate'> & ResourceSort\n// export type TaxRuleFilter = Pick<TaxRule, 'id' | 'name' | 'tax_rate' | 'freight_taxable' | 'payment_method_taxable' | 'gift_card_taxable' | 'adjustment_taxable'> & ResourceFilter\n\n\ninterface TaxRule extends Resource {\n\t\n\treadonly type: TaxRuleType\n\n\t/** \n\t * The tax rule internal name.\n\t * @example ```\"Fixed 22%\"```\n\t */\n\tname: string\n\t/** \n\t * The tax rate for this rule.\n\t * @example ```0.22```\n\t */\n\ttax_rate?: number | null\n\t/** \n\t * Indicates if the freight is taxable.\n\t */\n\tfreight_taxable?: boolean | null\n\t/** \n\t * Indicates if the payment method is taxable.\n\t */\n\tpayment_method_taxable?: boolean | null\n\t/** \n\t * Indicates if gift cards are taxable.\n\t */\n\tgift_card_taxable?: boolean | null\n\t/** \n\t * Indicates if adjustemnts are taxable.\n\t */\n\tadjustment_taxable?: boolean | null\n\t/** \n\t * The breakdown for this tax rule (if calculated).\n\t * @example ```{\"41\":{\"tax_rate\":0.22}}```\n\t */\n\tbreakdown?: Record<string, any> | null\n\t/** \n\t * The regex that will be evaluated to match the shipping address country code, max size is 5000.\n\t * @example ```\"AT|BE|BG|CZ|DK|EE|DE|HU|LV|LT\"```\n\t */\n\tcountry_code_regex?: string | null\n\t/** \n\t * The regex that will be evaluated as negative match for the shipping address country code, max size is 5000.\n\t * @example ```\"AT|BE|BG|CZ|DK|EE|DE\"```\n\t */\n\tnot_country_code_regex?: string | null\n\t/** \n\t * The regex that will be evaluated to match the shipping address state code, max size is 5000.\n\t * @example ```\"A[KLRZ]|C[AOT]|D[CE]|FL\"```\n\t */\n\tstate_code_regex?: string | null\n\t/** \n\t * The regex that will be evaluated as negative match for the shipping address state code, max size is 5000.\n\t * @example ```\"A[KLRZ]|C[AOT]\"```\n\t */\n\tnot_state_code_regex?: string | null\n\t/** \n\t * The regex that will be evaluated to match the shipping address zip code, max size is 5000.\n\t * @example ```\"(?i)(JE1|JE2|JE3|JE4|JE5)\"```\n\t */\n\tzip_code_regex?: string | null\n\t/** \n\t * The regex that will be evaluated as negative match for the shipping zip country code, max size is 5000.\n\t * @example ```\"(?i)(JE1|JE2|JE3)\"```\n\t */\n\tnot_zip_code_regex?: string | null\n\n\tmanual_tax_calculator?: ManualTaxCalculator | null\n\tversions?: Version[] | null\n\n}\n\n\ninterface TaxRuleCreate extends ResourceCreate {\n\t\n\t/** \n\t * The tax rule internal name.\n\t * @example ```\"Fixed 22%\"```\n\t */\n\tname: string\n\t/** \n\t * The tax rate for this rule.\n\t * @example ```0.22```\n\t */\n\ttax_rate?: number | null\n\t/** \n\t * Indicates if the freight is taxable.\n\t */\n\tfreight_taxable?: boolean | null\n\t/** \n\t * Indicates if the payment method is taxable.\n\t */\n\tpayment_method_taxable?: boolean | null\n\t/** \n\t * Indicates if gift cards are taxable.\n\t */\n\tgift_card_taxable?: boolean | null\n\t/** \n\t * Indicates if adjustemnts are taxable.\n\t */\n\tadjustment_taxable?: boolean | null\n\t/** \n\t * The regex that will be evaluated to match the shipping address country code, max size is 5000.\n\t * @example ```\"AT|BE|BG|CZ|DK|EE|DE|HU|LV|LT\"```\n\t */\n\tcountry_code_regex?: string | null\n\t/** \n\t * The regex that will be evaluated as negative match for the shipping address country code, max size is 5000.\n\t * @example ```\"AT|BE|BG|CZ|DK|EE|DE\"```\n\t */\n\tnot_country_code_regex?: string | null\n\t/** \n\t * The regex that will be evaluated to match the shipping address state code, max size is 5000.\n\t * @example ```\"A[KLRZ]|C[AOT]|D[CE]|FL\"```\n\t */\n\tstate_code_regex?: string | null\n\t/** \n\t * The regex that will be evaluated as negative match for the shipping address state code, max size is 5000.\n\t * @example ```\"A[KLRZ]|C[AOT]\"```\n\t */\n\tnot_state_code_regex?: string | null\n\t/** \n\t * The regex that will be evaluated to match the shipping address zip code, max size is 5000.\n\t * @example ```\"(?i)(JE1|JE2|JE3|JE4|JE5)\"```\n\t */\n\tzip_code_regex?: string | null\n\t/** \n\t * The regex that will be evaluated as negative match for the shipping zip country code, max size is 5000.\n\t * @example ```\"(?i)(JE1|JE2|JE3)\"```\n\t */\n\tnot_zip_code_regex?: string | null\n\n\tmanual_tax_calculator: ManualTaxCalculatorRel\n\n}\n\n\ninterface TaxRuleUpdate extends ResourceUpdate {\n\t\n\t/** \n\t * The tax rule internal name.\n\t * @example ```\"Fixed 22%\"```\n\t */\n\tname?: string | null\n\t/** \n\t * The tax rate for this rule.\n\t * @example ```0.22```\n\t */\n\ttax_rate?: number | null\n\t/** \n\t * Indicates if the freight is taxable.\n\t */\n\tfreight_taxable?: boolean | null\n\t/** \n\t * Indicates if the payment method is taxable.\n\t */\n\tpayment_method_taxable?: boolean | null\n\t/** \n\t * Indicates if gift cards are taxable.\n\t */\n\tgift_card_taxable?: boolean | null\n\t/** \n\t * Indicates if adjustemnts are taxable.\n\t */\n\tadjustment_taxable?: boolean | null\n\t/** \n\t * The regex that will be evaluated to match the shipping address country code, max size is 5000.\n\t * @example ```\"AT|BE|BG|CZ|DK|EE|DE|HU|LV|LT\"```\n\t */\n\tcountry_code_regex?: string | null\n\t/** \n\t * The regex that will be evaluated as negative match for the shipping address country code, max size is 5000.\n\t * @example ```\"AT|BE|BG|CZ|DK|EE|DE\"```\n\t */\n\tnot_country_code_regex?: string | null\n\t/** \n\t * The regex that will be evaluated to match the shipping address state code, max size is 5000.\n\t * @example ```\"A[KLRZ]|C[AOT]|D[CE]|FL\"```\n\t */\n\tstate_code_regex?: string | null\n\t/** \n\t * The regex that will be evaluated as negative match for the shipping address state code, max size is 5000.\n\t * @example ```\"A[KLRZ]|C[AOT]\"```\n\t */\n\tnot_state_code_regex?: string | null\n\t/** \n\t * The regex that will be evaluated to match the shipping address zip code, max size is 5000.\n\t * @example ```\"(?i)(JE1|JE2|JE3|JE4|JE5)\"```\n\t */\n\tzip_code_regex?: string | null\n\t/** \n\t * The regex that will be evaluated as negative match for the shipping zip country code, max size is 5000.\n\t * @example ```\"(?i)(JE1|JE2|JE3)\"```\n\t */\n\tnot_zip_code_regex?: string | null\n\n\tmanual_tax_calculator?: ManualTaxCalculatorRel | null\n\n}\n\n\nclass TaxRules extends ApiResource<TaxRule> {\n\n\tstatic readonly TYPE: TaxRuleType = 'tax_rules' as const\n\n\tasync create(resource: TaxRuleCreate, params?: QueryParamsRetrieve<TaxRule>, options?: ResourcesConfig): Promise<TaxRule> {\n\t\treturn this.resources.create<TaxRuleCreate, TaxRule>({ ...resource, type: TaxRules.TYPE }, params, options)\n\t}\n\n\tasync update(resource: TaxRuleUpdate, params?: QueryParamsRetrieve<TaxRule>, options?: ResourcesConfig): Promise<TaxRule> {\n\t\treturn this.resources.update<TaxRuleUpdate, TaxRule>({ ...resource, type: TaxRules.TYPE }, params, options)\n\t}\n\n\tasync delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void> {\n\t\tawait this.resources.delete((typeof id === 'string')? { id, type: TaxRules.TYPE } : id, options)\n\t}\n\n\tasync manual_tax_calculator(taxRuleId: string | TaxRule, params?: QueryParamsRetrieve<ManualTaxCalculator>, options?: ResourcesConfig): Promise<ManualTaxCalculator> {\n\t\tconst _taxRuleId = (taxRuleId as TaxRule).id || taxRuleId as string\n\t\treturn this.resources.fetch<ManualTaxCalculator>({ type: 'manual_tax_calculators' }, `tax_rules/${_taxRuleId}/manual_tax_calculator`, params, options) as unknown as ManualTaxCalculator\n\t}\n\n\tasync versions(taxRuleId: string | TaxRule, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>> {\n\t\tconst _taxRuleId = (taxRuleId as TaxRule).id || taxRuleId as string\n\t\treturn this.resources.fetch<Version>({ type: 'versions' }, `tax_rules/${_taxRuleId}/versions`, params, options) as unknown as ListResponse<Version>\n\t}\n\n\n\tisTaxRule(resource: any): resource is TaxRule {\n\t\treturn resource.type && (resource.type === TaxRules.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): TaxRuleRel {\n\t\treturn super.relationshipOneToOne<TaxRuleRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): TaxRuleRel[] {\n\t\treturn super.relationshipOneToMany<TaxRuleRel>(...ids)\n\t}\n\n\n\ttype(): TaxRuleType {\n\t\treturn TaxRules.TYPE\n\t}\n\n}\n\n\nconst instance = new TaxRules()\nexport default instance\n\nexport type { TaxRules, TaxRule, TaxRuleCreate, TaxRuleUpdate, TaxRuleType }\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/resources/customer_subscriptions.ts"],"names":["ApiResource"],"mappings":";;;;;AAgDA,IAAM,qBAAA,GAAN,MAAM,sBAAA,SAA8BA,
|
1
|
+
{"version":3,"sources":["../src/resources/customer_subscriptions.ts"],"names":["ApiResource"],"mappings":";;;;;AAgDA,IAAM,qBAAA,GAAN,MAAM,sBAAA,SAA8BA,6BAAA,CAAkC;AAAA,EAErE,OAAgB,IAAA,GAAiC,wBAAA;AAAA,EAEjD,MAAM,MAAA,CAAO,QAAA,EAAsC,MAAA,EAAoD,OAAA,EAA0D;AAChK,IAAA,OAAO,IAAA,CAAK,SAAA,CAAU,MAAA,CAAyD,EAAE,GAAG,QAAA,EAAU,IAAA,EAAM,sBAAA,CAAsB,IAAA,EAAK,EAAG,MAAA,EAAQ,OAAO,CAAA;AAAA;AAClJ,EAEA,MAAM,MAA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AAe,EAAE,IAAA,EAAM,UAAA,EAAW,EAAG,CAAA,uBAAA,EAA0B,uBAAuB,CAAA,SAAA,CAAA,EAAa,MAAA,EAAQ,OAAO,CAAA;AAAA;AACzI,EAGA,uBAAuB,QAAA,EAAiD;AACvE,IAAA,OAAO,QAAA,CAAS,IAAA,IAAS,QAAA,CAAS,IAAA,KAAS,sBAAA,CAAsB,IAAA;AAAA;AAClE,EAGA,aAAa,EAAA,EAAyD;AACrE,IAAA,OAAO,KAAA,CAAM,qBAA8C,EAAE,CAAA;AAAA;AAC9D,EAEA,sBAAsB,GAAA,EAA0C;AAC/D,IAAA,OAAO,KAAA,CAAM,qBAAA,CAA+C,GAAG,GAAG,CAAA;AAAA;AACnE,EAGA,IAAA,GAAiC;AAChC,IAAA,OAAO,sBAAA,CAAsB,IAAA;AAAA;AAG/B,CAAA;AAGA,IAAM,QAAA,GAAW,IAAI,qBAAA,EAAsB;AAC3C,IAAO,8BAAA,GAAQ","file":"chunk-ZTVQSWSD.cjs","sourcesContent":["import { ApiResource } from '../resource'\nimport type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse, ResourceSort, /* ResourceFilter */ } from '../resource'\nimport type { QueryParamsRetrieve, QueryParamsList } from '../query'\n\nimport type { Customer } from './customers'\nimport type { Event } from './events'\nimport type { Version } from './versions'\n\n\ntype CustomerSubscriptionType = 'customer_subscriptions'\ntype CustomerSubscriptionRel = ResourceRel & { type: CustomerSubscriptionType }\n\n\nexport type CustomerSubscriptionSort = Pick<CustomerSubscription, 'id'> & ResourceSort\n// export type CustomerSubscriptionFilter = Pick<CustomerSubscription, 'id'> & ResourceFilter\n\n\ninterface CustomerSubscription extends Resource {\n\t\n\treadonly type: CustomerSubscriptionType\n\n\t/** \n\t * The email of the customer that owns the subscription.\n\t * @example ```\"john@example.com\"```\n\t */\n\tcustomer_email: string\n\n\tcustomer?: Customer | null\n\tevents?: Event[] | null\n\tversions?: Version[] | null\n\n}\n\n\ninterface CustomerSubscriptionCreate extends ResourceCreate {\n\t\n\t/** \n\t * The email of the customer that owns the subscription.\n\t * @example ```\"john@example.com\"```\n\t */\n\tcustomer_email: string\n\t\n}\n\n\ntype CustomerSubscriptionUpdate = ResourceUpdate\n\n\nclass CustomerSubscriptions extends ApiResource<CustomerSubscription> {\n\n\tstatic readonly TYPE: CustomerSubscriptionType = 'customer_subscriptions' as const\n\n\tasync create(resource: CustomerSubscriptionCreate, params?: QueryParamsRetrieve<CustomerSubscription>, options?: ResourcesConfig): Promise<CustomerSubscription> {\n\t\treturn this.resources.create<CustomerSubscriptionCreate, CustomerSubscription>({ ...resource, type: CustomerSubscriptions.TYPE }, params, options)\n\t}\n\n\tasync update(resource: CustomerSubscriptionUpdate, params?: QueryParamsRetrieve<CustomerSubscription>, options?: ResourcesConfig): Promise<CustomerSubscription> {\n\t\treturn this.resources.update<CustomerSubscriptionUpdate, CustomerSubscription>({ ...resource, type: CustomerSubscriptions.TYPE }, params, options)\n\t}\n\n\tasync delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void> {\n\t\tawait this.resources.delete((typeof id === 'string')? { id, type: CustomerSubscriptions.TYPE } : id, options)\n\t}\n\n\tasync customer(customerSubscriptionId: string | CustomerSubscription, params?: QueryParamsRetrieve<Customer>, options?: ResourcesConfig): Promise<Customer> {\n\t\tconst _customerSubscriptionId = (customerSubscriptionId as CustomerSubscription).id || customerSubscriptionId as string\n\t\treturn this.resources.fetch<Customer>({ type: 'customers' }, `customer_subscriptions/${_customerSubscriptionId}/customer`, params, options) as unknown as Customer\n\t}\n\n\tasync events(customerSubscriptionId: string | CustomerSubscription, params?: QueryParamsList<Event>, options?: ResourcesConfig): Promise<ListResponse<Event>> {\n\t\tconst _customerSubscriptionId = (customerSubscriptionId as CustomerSubscription).id || customerSubscriptionId as string\n\t\treturn this.resources.fetch<Event>({ type: 'events' }, `customer_subscriptions/${_customerSubscriptionId}/events`, params, options) as unknown as ListResponse<Event>\n\t}\n\n\tasync versions(customerSubscriptionId: string | CustomerSubscription, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>> {\n\t\tconst _customerSubscriptionId = (customerSubscriptionId as CustomerSubscription).id || customerSubscriptionId as string\n\t\treturn this.resources.fetch<Version>({ type: 'versions' }, `customer_subscriptions/${_customerSubscriptionId}/versions`, params, options) as unknown as ListResponse<Version>\n\t}\n\n\n\tisCustomerSubscription(resource: any): resource is CustomerSubscription {\n\t\treturn resource.type && (resource.type === CustomerSubscriptions.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): CustomerSubscriptionRel {\n\t\treturn super.relationshipOneToOne<CustomerSubscriptionRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): CustomerSubscriptionRel[] {\n\t\treturn super.relationshipOneToMany<CustomerSubscriptionRel>(...ids)\n\t}\n\n\n\ttype(): CustomerSubscriptionType {\n\t\treturn CustomerSubscriptions.TYPE\n\t}\n\n}\n\n\nconst instance = new CustomerSubscriptions()\nexport default instance\n\nexport type { CustomerSubscriptions, CustomerSubscription, CustomerSubscriptionCreate, CustomerSubscriptionUpdate, CustomerSubscriptionType }\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/error.ts","../src/fetch.ts"],"names":["ErrorType"],"mappings":";;;AAGK,IAAA,SAAA,qBAAAA,UAAL,KAAA;AACC,EAAAA,WAAA,QAAS,CAAA,GAAA,QAAA;AACT,EAAAA,WAAA,SAAU,CAAA,GAAA,SAAA;AACV,EAAAA,WAAA,UAAW,CAAA,GAAA,UAAA;AACX,EAAAA,WAAA,QAAS,CAAA,GAAA,QAAA;AACT,EAAAA,WAAA,OAAQ,CAAA,GAAA,OAAA;AACP,EAAAA,WAAA,SAAU,CAAA,GAAA,SAAA;AACX,EAAAA,WAAA,eAAgB,CAAA,GAAA,eAAA;AAPZ,EAAAA,OAAAA,UAAAA;AAAA,CAAA,EAAA,SAAA,IAAA,EAAA;AAWC,IAAA,QAAA,GAAN,MAAM,SA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\t\t\t// Generic Client error\n\tREQUEST = 'request',\t\t\t\t\t\t// Error preparing API request\n\tRESPONSE = 'response',\t\t\t\t\t// Error response from API\n\tCANCEL = 'cancel',\t\t \t\t\t\t// Forced request abort using interceptor\n\tPARSE = 'parse',\t\t \t\t\t\t// Error parsing API resource\n TIMEOUT = 'timeout', \t\t\t\t// Timeout error\n\tTOKEN_REFRESH = 'token-refresh'\t// Error calling refresh token function\n}\n\n\nclass SdkError extends Error {\n\n\tstatic NAME = 'SdkError'\n\n\tstatic isSdkError(error: any): error is SdkError {\n\t\treturn error && [SdkError.NAME, ApiError.NAME].includes(error.name as string) && Object.values(ErrorType).includes(error.type as ErrorType)\n\t}\n\n\ttype: ErrorType\n\tcode?: string\n\tsource?: Error\n\n\tconstructor(error: { message: string, type?: ErrorType }) {\n\t\tsuper(error.message)\n\t\tthis.name = SdkError.NAME\n\t\tthis.type = error.type || ErrorType.CLIENT\n\t}\n\n}\n\n\nclass ApiError extends SdkError {\n\n\tstatic NAME = 'ApiError'\n\n\tstatic isApiError(error: any): error is ApiError {\n\t\treturn SdkError.isSdkError(error) && (error.name === ApiError.NAME) && (error.type === ErrorType.RESPONSE)\n\t}\n\n\terrors: any[] = []\n\tstatus?: number\n\tstatusText?: string\n\n\t// constructor(error: SdkError)\n\tconstructor(error: { message: string }) {\n\t\tsuper({ ...error, type: ErrorType.RESPONSE })\n\t\tthis.name = ApiError.NAME\n\t}\n\n\tfirst(): any {\n\t\treturn (this.errors?.length > 0) ? this.errors[0] : undefined\n\t}\n\n}\n\n\nconst isRequestError = (error: any): error is TypeError => {\n\treturn (error instanceof TypeError) && (error.message !== 'fetch failed')\n}\n\nconst isCancelError = (error: any): boolean => {\n\treturn (error instanceof DOMException) && (error.name === 'AbortError')\n}\n\nconst isTimeoutError = (error: any): boolean => {\n\treturn (error instanceof DOMException) && (error.name === 'TimeoutError')\n}\n\nconst isExpiredTokenError = (error: any): boolean => {\n\tconst invalidTokenCodes = ['INVALID_TOKEN'/*, 'UNAUTHORIZED' */]\n\treturn (ApiError.isApiError(error) && (error.status === 401) && (\n\t\tinvalidTokenCodes.includes(error.code || '') ||\n\t\t(error.errors && (error.errors.length > 0) && invalidTokenCodes.includes(error.errors[0].code as string))\n\t))\n}\n\n\nconst handleError = (error: Error): never => {\n\n\tif (SdkError.isSdkError(error) || ApiError.isApiError(error)) throw error\n\n\tlet sdkError = new SdkError({ message: error.message })\n\n\tif (FetchError.isFetchError(error)) {\n\t\t// console.log('Fetch Error')\n\t\tconst apiError = new ApiError(sdkError)\n\t\tapiError.type = ErrorType.RESPONSE\n\t\tapiError.status = error.status\n\t\tapiError.statusText = error.statusText\n\t\tapiError.code = String(apiError.status)\n\t\tapiError.errors = error.errors || []\n\t\tif (!apiError.message && apiError.statusText) apiError.message = apiError.statusText\n\t\tsdkError = apiError\n\t}\n\telse if (isRequestError(error)) {\n\t\t// console.log('Request Error')\n sdkError.type = ErrorType.REQUEST\n }\n\telse if (isCancelError(error)) {\n\t\t// console.log('Cancel Error')\n sdkError.type = ErrorType.CANCEL\n }\n else if (isTimeoutError(error)) {\n\t\t// console.log('Timeout Error')\n sdkError.type = ErrorType.TIMEOUT\n }\n\telse {\n\t\t// console.log('Generic Error')\n\t\tsdkError.type = ErrorType.CLIENT\n\t\tsdkError.source = error\n\t}\n\n\tthrow sdkError\n\n}\n\n\nexport { SdkError, ApiError, ErrorType, handleError, isExpiredTokenError }\n\n\nexport function isSdkError(error: unknown): error is SdkError {\n\treturn SdkError.isSdkError(error)\n}\n\nexport function isApiError(error: unknown): error is ApiError {\n\treturn ApiError.isApiError(error)\n}\n","\nimport type { InterceptorManager } from './interceptor'\nimport { ErrorType, SdkError } from './error'\n\n\nimport Debug from './debug'\nconst debug = Debug('fetch')\n\n\nexport type Fetch = (input: string | URL | Request, init?: RequestInit) => Promise<Response>\n\nexport type FetchResponse = any\nexport type FetchRequestOptions = RequestInit\nexport type FetchClientOptions = {\n interceptors?: InterceptorManager,\n fetch?: Fetch\n}\n\n\nexport class FetchError extends Error {\n\n static NAME = 'FetchError'\n\n static isFetchError = (error: any): error is FetchError => {\n return error instanceof FetchError\n }\n\n readonly #errors?: any[]\n readonly #status: number\n readonly #statusText: string\n readonly #request?: Partial<FetchRequestOptions>\n\n constructor(status: number, statusText: string, body?: any, request?: FetchRequestOptions) {\n super(statusText)\n this.#status = status\n this.#statusText = statusText\n if (body) this.#errors = body.errors\n if (request) this.#request = request\n this.name = FetchError.NAME\n }\n\n\n get errors(): any[] | undefined { return this.#errors }\n\n get status(): number { return this.#status }\n\n get statusText(): string { return this.#statusText }\n\n get request(): Partial<FetchRequestOptions> | undefined { return this.#request }\n\n}\n\n\n\nexport const fetchURL = async (url: URL, requestOptions: FetchRequestOptions, clientOptions?: FetchClientOptions): Promise<FetchResponse> => {\n\n debug('fetch: %s, %O, native[%s]', url, requestOptions || {}, (clientOptions?.fetch? 'no' : 'yes'))\n\n const interceptors = clientOptions?.interceptors\n\n if (interceptors?.request?.onSuccess) ( { url, options: requestOptions } = await interceptors.request.onSuccess({ url, options: requestOptions }) )\n\n // const request: Request = new Request(url, requestOptions) // not supported by all fetch implementations\n\n const fetchClient = clientOptions?.fetch || fetch\n\n let response = await fetchClient(url, requestOptions)\n\n if (response.ok) {\n if (interceptors?.rawReader?.onSuccess) await interceptors.rawReader.onSuccess(response)\n if (interceptors?.response?.onSuccess) response = await interceptors.response.onSuccess(response)\n } else {\n if (interceptors?.rawReader?.onFailure) await interceptors.rawReader.onFailure(response)\n }\n\n const responseBody = (response.body && (response.status !== 204)) ? await response.json()\n .then(json => { debug('response: %O', json); return json })\n .catch((err: Error) => {\n debug('error: %s', err.message)\n if (response.ok) throw new SdkError({ message: 'Error parsing API response body', type: ErrorType.PARSE })\n })\n : undefined\n \n if (!response.ok) {\n let error = new FetchError(response.status, response.statusText, responseBody, requestOptions)\n if (interceptors?.response?.onFailure) error = await interceptors.response.onFailure(error)\n if (error) throw error\n }\n\n return responseBody\n\n}\n"]}
|
1
|
+
{"version":3,"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AA,OAAA,cAAuB,CAAA;AAAA,GAC1G,CAAA,GACC,MAAA;AAEJ,EAAA,IAAI,CAAC,SAAS,EAAA,EAAI;AAChB,IAAA,IAAI,KAAA,GAAQ,IAAI,UAAA,CAAW,QAAA,CAAS,QAAQ,QAAA,CAAS,UAAA,EAAY,cAAc,cAAc,CAAA;AAC7F,IAAA,IAAI,YAAA,EAAc,UAAU,SAAA,EAAW,KAAA,GAAQ,MAAM,YAAA,CAAa,QAAA,CAAS,UAAU,KAAK,CAAA;AAC1F,IAAA,IAAI,OAAO,MAAM,KAAA;AAAA;AAGnB,EAAA,OAAO,YAAA;AAET","file":"chunk-ZU7GFVQ6.js","sourcesContent":["import { FetchError } from './fetch'\n\n\nenum ErrorType {\n\tCLIENT = 'client',\t\t \t\t\t\t// Generic Client error\n\tREQUEST = 'request',\t\t\t\t\t\t// Error preparing API request\n\tRESPONSE = 'response',\t\t\t\t\t// Error response from API\n\tCANCEL = 'cancel',\t\t \t\t\t\t// Forced request abort using interceptor\n\tPARSE = 'parse',\t\t \t\t\t\t// Error parsing API resource\n TIMEOUT = 'timeout', \t\t\t\t// Timeout error\n\tTOKEN_REFRESH = 'token-refresh'\t// Error calling refresh token function\n}\n\n\nclass SdkError extends Error {\n\n\tstatic NAME = 'SdkError'\n\n\tstatic isSdkError(error: any): error is SdkError {\n\t\treturn error && [SdkError.NAME, ApiError.NAME].includes(error.name as string) && Object.values(ErrorType).includes(error.type as ErrorType)\n\t}\n\n\ttype: ErrorType\n\tcode?: string\n\tsource?: Error\n\n\tconstructor(error: { message: string, type?: ErrorType }) {\n\t\tsuper(error.message)\n\t\tthis.name = SdkError.NAME\n\t\tthis.type = error.type || ErrorType.CLIENT\n\t}\n\n}\n\n\nclass ApiError extends SdkError {\n\n\tstatic NAME = 'ApiError'\n\n\tstatic isApiError(error: any): error is ApiError {\n\t\treturn SdkError.isSdkError(error) && (error.name === ApiError.NAME) && (error.type === ErrorType.RESPONSE)\n\t}\n\n\terrors: any[] = []\n\tstatus?: number\n\tstatusText?: string\n\n\t// constructor(error: SdkError)\n\tconstructor(error: { message: string }) {\n\t\tsuper({ ...error, type: ErrorType.RESPONSE })\n\t\tthis.name = ApiError.NAME\n\t}\n\n\tfirst(): any {\n\t\treturn (this.errors?.length > 0) ? this.errors[0] : undefined\n\t}\n\n}\n\n\nconst isRequestError = (error: any): error is TypeError => {\n\treturn (error instanceof TypeError) && (error.message !== 'fetch failed')\n}\n\nconst isCancelError = (error: any): boolean => {\n\treturn (error instanceof DOMException) && (error.name === 'AbortError')\n}\n\nconst isTimeoutError = (error: any): boolean => {\n\treturn (error instanceof DOMException) && (error.name === 'TimeoutError')\n}\n\nconst isExpiredTokenError = (error: any): boolean => {\n\tconst invalidTokenCodes = ['INVALID_TOKEN'/*, 'UNAUTHORIZED' */]\n\treturn (ApiError.isApiError(error) && (error.status === 401) && (\n\t\tinvalidTokenCodes.includes(error.code || '') ||\n\t\t(error.errors && (error.errors.length > 0) && invalidTokenCodes.includes(error.errors[0].code as string))\n\t))\n}\n\n\nconst handleError = (error: Error): never => {\n\n\tif (SdkError.isSdkError(error) || ApiError.isApiError(error)) throw error\n\n\tlet sdkError = new SdkError({ message: error.message })\n\n\tif (FetchError.isFetchError(error)) {\n\t\t// console.log('Fetch Error')\n\t\tconst apiError = new ApiError(sdkError)\n\t\tapiError.type = ErrorType.RESPONSE\n\t\tapiError.status = error.status\n\t\tapiError.statusText = error.statusText\n\t\tapiError.code = String(apiError.status)\n\t\tapiError.errors = error.errors || []\n\t\tif (!apiError.message && apiError.statusText) apiError.message = apiError.statusText\n\t\tsdkError = apiError\n\t}\n\telse if (isRequestError(error)) {\n\t\t// console.log('Request Error')\n sdkError.type = ErrorType.REQUEST\n }\n\telse if (isCancelError(error)) {\n\t\t// console.log('Cancel Error')\n sdkError.type = ErrorType.CANCEL\n }\n else if (isTimeoutError(error)) {\n\t\t// console.log('Timeout Error')\n sdkError.type = ErrorType.TIMEOUT\n }\n\telse {\n\t\t// console.log('Generic Error')\n\t\tsdkError.type = ErrorType.CLIENT\n\t\tsdkError.source = error\n\t}\n\n\tthrow sdkError\n\n}\n\n\nexport { SdkError, ApiError, ErrorType, handleError, isExpiredTokenError }\n\n\nexport function isSdkError(error: unknown): error is SdkError {\n\treturn SdkError.isSdkError(error)\n}\n\nexport function isApiError(error: unknown): error is ApiError {\n\treturn ApiError.isApiError(error)\n}\n","\nimport type { InterceptorManager } from './interceptor'\nimport { ErrorType, SdkError } from './error'\n\n\nimport Debug from './debug'\nconst debug = Debug('fetch')\n\n\nexport type Fetch = (input: string | URL | Request, init?: RequestInit) => Promise<Response>\n\nexport type FetchResponse = any\nexport type FetchRequestOptions = RequestInit\nexport type FetchClientOptions = {\n interceptors?: InterceptorManager,\n fetch?: Fetch\n}\n\n\nexport class FetchError extends Error {\n\n static NAME = 'FetchError'\n\n static isFetchError = (error: any): error is FetchError => {\n return error instanceof FetchError\n }\n\n readonly #errors?: any[]\n readonly #status: number\n readonly #statusText: string\n readonly #request?: Partial<FetchRequestOptions>\n\n constructor(status: number, statusText: string, body?: any, request?: FetchRequestOptions) {\n super(statusText)\n this.#status = status\n this.#statusText = statusText\n if (body) this.#errors = body.errors\n if (request) this.#request = request\n this.name = FetchError.NAME\n }\n\n\n get errors(): any[] | undefined { return this.#errors }\n\n get status(): number { return this.#status }\n\n get statusText(): string { return this.#statusText }\n\n get request(): Partial<FetchRequestOptions> | undefined { return this.#request }\n\n}\n\n\n\nexport const fetchURL = async (url: URL, requestOptions: FetchRequestOptions, clientOptions?: FetchClientOptions): Promise<FetchResponse> => {\n\n debug('fetch: %s, %O, native[%s]', url, requestOptions || {}, (clientOptions?.fetch? 'no' : 'yes'))\n\n const interceptors = clientOptions?.interceptors\n\n if (interceptors?.request?.onSuccess) ( { url, options: requestOptions } = await interceptors.request.onSuccess({ url, options: requestOptions }) )\n\n // const request: Request = new Request(url, requestOptions) // not supported by all fetch implementations\n\n const fetchClient = clientOptions?.fetch || fetch\n\n let response = await fetchClient(url, requestOptions)\n\n if (response.ok) {\n if (interceptors?.rawReader?.onSuccess) await interceptors.rawReader.onSuccess(response)\n if (interceptors?.response?.onSuccess) response = await interceptors.response.onSuccess(response)\n } else {\n if (interceptors?.rawReader?.onFailure) await interceptors.rawReader.onFailure(response)\n }\n\n const responseBody = (response.body && (response.status !== 204)) ? await response.json()\n .then(json => { debug('response: %O', json); return json })\n .catch((err: Error) => {\n debug('error: %s', err.message)\n if (response.ok) throw new SdkError({ message: 'Error parsing API response body', type: ErrorType.PARSE })\n })\n : undefined\n \n if (!response.ok) {\n let error = new FetchError(response.status, response.statusText, responseBody, requestOptions)\n if (interceptors?.response?.onFailure) error = await interceptors.response.onFailure(error)\n if (error) throw error\n }\n\n return responseBody\n\n}\n"]}
|