@commercelayer/sdk 7.0.0-rc.12 → 7.0.0-rc.13
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-BIiVfx1G.d.ts → api-C7ddKOtt.d.ts} +59 -1
- package/lib/{api-xIgvzFhW.d.cts → api-DuTbl3z_.d.cts} +59 -1
- package/lib/api.cjs +20 -20
- package/lib/api.d.cts +1 -1
- package/lib/api.d.ts +1 -1
- package/lib/api.js +10 -10
- package/lib/bundle.cjs +22 -22
- 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 +11 -11
- 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-WXE5KXJC.cjs → chunk-2VPJZZIF.cjs} +3 -3
- package/lib/chunk-2VPJZZIF.cjs.map +1 -0
- 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-4NI5SICY.cjs.map +1 -1
- 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-5NMDIVXH.js.map +1 -1
- 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-AVJX4OEZ.js → chunk-67KNILG6.js} +3 -3
- package/lib/chunk-67KNILG6.js.map +1 -0
- 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-6SCAIB4K.cjs.map +1 -1
- package/lib/chunk-6SOWFGBP.cjs.map +1 -1
- package/lib/{chunk-EQD223JW.cjs → chunk-73PUROZG.cjs} +2 -2
- package/lib/chunk-73PUROZG.cjs.map +1 -0
- package/lib/chunk-7CQTUOR4.cjs.map +1 -1
- package/lib/chunk-7JLRB7QH.js.map +1 -1
- package/lib/{chunk-ANCLAYJV.cjs → chunk-7KY7C5RC.cjs} +2 -2
- package/lib/chunk-7KY7C5RC.cjs.map +1 -0
- 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-AGNIOGQC.cjs.map +1 -1
- package/lib/chunk-AIGQRBCY.cjs.map +1 -1
- package/lib/chunk-AQFAND5D.cjs.map +1 -1
- package/lib/chunk-ARIBIRKF.cjs.map +1 -1
- package/lib/chunk-AW3TRBZ7.js.map +1 -1
- package/lib/{chunk-2UUZHL2R.js → chunk-AWP3PHRS.js} +2 -2
- package/lib/chunk-AWP3PHRS.js.map +1 -0
- package/lib/chunk-B72FREUL.cjs.map +1 -1
- package/lib/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-DGW3ZSW6.js.map +1 -1
- 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-DYZGWPZ6.js.map +1 -1
- package/lib/{chunk-7ISS2FDY.js → chunk-DZLNYX4L.js} +2 -2
- package/lib/chunk-DZLNYX4L.js.map +1 -0
- package/lib/chunk-E3FDHGI7.js.map +1 -1
- package/lib/chunk-E4DYW6HB.cjs.map +1 -1
- package/lib/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-ELBOXOTA.js.map +1 -1
- package/lib/chunk-EP22KKHR.js.map +1 -1
- package/lib/chunk-EP7MAEQH.cjs.map +1 -1
- package/lib/chunk-ESMKOP42.cjs.map +1 -1
- package/lib/chunk-F6MSHDB7.cjs.map +1 -1
- package/lib/chunk-FAU5EILL.js.map +1 -1
- package/lib/chunk-FO7WBEPF.js.map +1 -1
- package/lib/{chunk-HAAE23MQ.js → chunk-FRZBCW3D.js} +2 -2
- package/lib/chunk-FRZBCW3D.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-HSILJQCD.js → chunk-FWFGGAKV.js} +2 -2
- package/lib/chunk-FWFGGAKV.js.map +1 -0
- 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-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-HBUDZOK7.cjs.map +1 -1
- package/lib/chunk-HCBXRHD7.js.map +1 -1
- package/lib/chunk-HDYENVKD.js.map +1 -1
- package/lib/chunk-HERQULAV.cjs.map +1 -1
- package/lib/chunk-HNHF6T2I.cjs.map +1 -1
- package/lib/chunk-HNONYIDO.cjs.map +1 -1
- package/lib/chunk-HQ5STEMD.js.map +1 -1
- package/lib/chunk-HQ6TJSB7.cjs.map +1 -1
- package/lib/chunk-I3SKGXTB.cjs.map +1 -1
- package/lib/{chunk-BBEMCANC.cjs → chunk-I5KTGLTE.cjs} +2 -2
- package/lib/chunk-I5KTGLTE.cjs.map +1 -0
- 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-J4CTOHX6.cjs.map +1 -1
- package/lib/chunk-J6NBJHWL.cjs.map +1 -1
- package/lib/chunk-J6PTNG3D.js.map +1 -1
- package/lib/{chunk-ROPOLXIV.js → chunk-J6Z6ZR33.js} +2 -2
- package/lib/chunk-J6Z6ZR33.js.map +1 -0
- 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-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-KITKWF6F.js.map +1 -1
- package/lib/chunk-KPRWSW6P.cjs.map +1 -1
- package/lib/chunk-KU5U6DTU.js.map +1 -1
- package/lib/chunk-KWRDUU7K.js.map +1 -1
- package/lib/{chunk-DTGODPCN.js → chunk-KYZ4CKIR.js} +2 -2
- package/lib/chunk-KYZ4CKIR.js.map +1 -0
- package/lib/{chunk-EHWAGYNX.js → chunk-KZ75CT2Q.js} +2 -2
- package/lib/chunk-KZ75CT2Q.js.map +1 -0
- package/lib/chunk-L4LPS3DV.cjs.map +1 -1
- package/lib/chunk-L4TDKOAC.js.map +1 -1
- package/lib/{chunk-INZD34YD.cjs → chunk-L5FMOT44.cjs} +2 -2
- package/lib/chunk-L5FMOT44.cjs.map +1 -0
- 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-WBPEFNL7.cjs → chunk-LJFBPFPR.cjs} +2 -2
- package/lib/chunk-LJFBPFPR.cjs.map +1 -0
- package/lib/chunk-LNMY5BDT.js.map +1 -1
- package/lib/chunk-LTLMRGB7.js.map +1 -1
- package/lib/chunk-MADGMICB.js.map +1 -1
- package/lib/chunk-MCGX2ZDC.cjs.map +1 -1
- package/lib/chunk-MJRMRWP3.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-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-NIHOABAW.cjs.map +1 -1
- package/lib/chunk-NJYMO7FP.cjs.map +1 -1
- package/lib/chunk-NODKE6P4.js.map +1 -1
- package/lib/{chunk-6PWK52UZ.cjs → chunk-NYS7N44P.cjs} +2 -2
- package/lib/chunk-NYS7N44P.cjs.map +1 -0
- 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-M2ZERG2X.cjs → chunk-PGZTQAOR.cjs} +2 -2
- package/lib/chunk-PGZTQAOR.cjs.map +1 -0
- 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-RL7Y22OT.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-WVAW33XQ.js → chunk-S4GBVQLI.js} +3 -3
- package/lib/chunk-S4GBVQLI.js.map +1 -0
- package/lib/{chunk-MPSHBMZS.js → chunk-SDRMBCHM.js} +2 -2
- package/lib/chunk-SDRMBCHM.js.map +1 -0
- 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-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-TOV6ECTA.js.map +1 -1
- 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-W6AL2GJ4.cjs → chunk-UROMLQDG.cjs} +2 -2
- package/lib/chunk-UROMLQDG.cjs.map +1 -0
- 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-W6YJDUYD.js.map +1 -1
- package/lib/chunk-WAL76UPE.cjs.map +1 -1
- package/lib/chunk-WC4Z7ENS.cjs.map +1 -1
- package/lib/chunk-WI5IVLYL.js.map +1 -1
- 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-WVKEXOIY.js.map +1 -1
- package/lib/chunk-WXD4O4UY.js.map +1 -1
- package/lib/chunk-X2D47UM7.cjs.map +1 -1
- package/lib/chunk-XMDDYWH5.js.map +1 -1
- package/lib/{chunk-S3MCPCGR.cjs → chunk-XOYVZN2R.cjs} +4 -4
- package/lib/chunk-XOYVZN2R.cjs.map +1 -0
- 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-YUGZUUAU.js → chunk-XXKXNBD5.js} +2 -2
- package/lib/chunk-XXKXNBD5.js.map +1 -0
- package/lib/{chunk-N6MHUHGE.cjs → chunk-Y27X5PYA.cjs} +2 -2
- package/lib/chunk-Y27X5PYA.cjs.map +1 -0
- package/lib/chunk-Y2IGLW5N.js.map +1 -1
- package/lib/chunk-Y3BFYVWA.js.map +1 -1
- package/lib/chunk-Y5BP4C42.cjs.map +1 -1
- 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-YY5ENJSH.cjs.map +1 -1
- package/lib/{chunk-SN6BP777.js → chunk-YZ57ATOP.js} +2 -2
- package/lib/chunk-YZ57ATOP.js.map +1 -0
- 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-IDAOX5RB.cjs → chunk-ZLDJ7WAY.cjs} +2 -2
- package/lib/chunk-ZLDJ7WAY.cjs.map +1 -0
- 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/commercelayer.cjs +5 -5
- package/lib/commercelayer.d.cts +3 -3
- 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 +25 -25
- package/lib/index.d.cts +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +12 -12
- 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 +2 -2
- package/lib/resources/addresses.d.ts +1 -1
- package/lib/resources/adjustments.d.cts +2 -2
- package/lib/resources/adjustments.d.ts +1 -1
- package/lib/resources/adyen_gateways.d.cts +2 -2
- package/lib/resources/adyen_gateways.d.ts +1 -1
- package/lib/resources/adyen_payments.d.cts +2 -2
- package/lib/resources/adyen_payments.d.ts +1 -1
- package/lib/resources/applications.d.cts +2 -2
- package/lib/resources/applications.d.ts +1 -1
- package/lib/resources/attachments.d.cts +2 -2
- package/lib/resources/attachments.d.ts +1 -1
- package/lib/resources/authorizations.d.cts +2 -2
- package/lib/resources/authorizations.d.ts +1 -1
- package/lib/resources/avalara_accounts.d.cts +2 -2
- package/lib/resources/avalara_accounts.d.ts +1 -1
- package/lib/resources/axerve_gateways.d.cts +2 -2
- package/lib/resources/axerve_gateways.d.ts +1 -1
- package/lib/resources/axerve_payments.d.cts +2 -2
- package/lib/resources/axerve_payments.d.ts +1 -1
- package/lib/resources/bing_geocoders.d.cts +2 -2
- package/lib/resources/bing_geocoders.d.ts +1 -1
- package/lib/resources/braintree_gateways.d.cts +2 -2
- package/lib/resources/braintree_gateways.d.ts +1 -1
- package/lib/resources/braintree_payments.d.cts +2 -2
- package/lib/resources/braintree_payments.d.ts +1 -1
- package/lib/resources/bundles.d.cts +2 -2
- package/lib/resources/bundles.d.ts +1 -1
- package/lib/resources/buy_x_pay_y_promotions.cjs +2 -2
- package/lib/resources/buy_x_pay_y_promotions.d.cts +2 -2
- package/lib/resources/buy_x_pay_y_promotions.d.ts +1 -1
- package/lib/resources/buy_x_pay_y_promotions.js +1 -1
- package/lib/resources/captures.d.cts +2 -2
- package/lib/resources/captures.d.ts +1 -1
- package/lib/resources/carrier_accounts.d.cts +2 -2
- package/lib/resources/carrier_accounts.d.ts +1 -1
- package/lib/resources/checkout_com_gateways.d.cts +2 -2
- package/lib/resources/checkout_com_gateways.d.ts +1 -1
- package/lib/resources/checkout_com_payments.d.cts +2 -2
- package/lib/resources/checkout_com_payments.d.ts +1 -1
- package/lib/resources/cleanups.d.cts +2 -2
- package/lib/resources/cleanups.d.ts +1 -1
- package/lib/resources/coupon_codes_promotion_rules.d.cts +2 -2
- package/lib/resources/coupon_codes_promotion_rules.d.ts +1 -1
- package/lib/resources/coupon_recipients.d.cts +2 -2
- package/lib/resources/coupon_recipients.d.ts +1 -1
- package/lib/resources/coupons.d.cts +2 -2
- package/lib/resources/coupons.d.ts +1 -1
- package/lib/resources/custom_promotion_rules.d.cts +2 -2
- package/lib/resources/custom_promotion_rules.d.ts +1 -1
- package/lib/resources/customer_addresses.d.cts +2 -2
- package/lib/resources/customer_addresses.d.ts +1 -1
- package/lib/resources/customer_groups.d.cts +2 -2
- package/lib/resources/customer_groups.d.ts +1 -1
- package/lib/resources/customer_password_resets.d.cts +2 -2
- package/lib/resources/customer_password_resets.d.ts +1 -1
- package/lib/resources/customer_payment_sources.d.cts +2 -2
- package/lib/resources/customer_payment_sources.d.ts +1 -1
- package/lib/resources/customer_subscriptions.d.cts +2 -2
- package/lib/resources/customer_subscriptions.d.ts +1 -1
- package/lib/resources/customers.d.cts +2 -2
- package/lib/resources/customers.d.ts +1 -1
- package/lib/resources/delivery_lead_times.d.cts +2 -2
- package/lib/resources/delivery_lead_times.d.ts +1 -1
- package/lib/resources/discount_engine_items.d.cts +2 -2
- package/lib/resources/discount_engine_items.d.ts +1 -1
- package/lib/resources/discount_engines.d.cts +2 -2
- package/lib/resources/discount_engines.d.ts +1 -1
- package/lib/resources/easypost_pickups.d.cts +2 -2
- package/lib/resources/easypost_pickups.d.ts +1 -1
- package/lib/resources/event_callbacks.d.cts +2 -2
- package/lib/resources/event_callbacks.d.ts +1 -1
- package/lib/resources/events.d.cts +2 -2
- package/lib/resources/events.d.ts +1 -1
- package/lib/resources/exports.d.cts +2 -2
- package/lib/resources/exports.d.ts +1 -1
- package/lib/resources/external_gateways.d.cts +2 -2
- package/lib/resources/external_gateways.d.ts +1 -1
- package/lib/resources/external_payments.d.cts +2 -2
- package/lib/resources/external_payments.d.ts +1 -1
- package/lib/resources/external_promotions.cjs +2 -2
- package/lib/resources/external_promotions.d.cts +2 -2
- package/lib/resources/external_promotions.d.ts +1 -1
- package/lib/resources/external_promotions.js +1 -1
- package/lib/resources/external_tax_calculators.d.cts +2 -2
- package/lib/resources/external_tax_calculators.d.ts +1 -1
- package/lib/resources/fixed_amount_promotions.cjs +2 -2
- package/lib/resources/fixed_amount_promotions.d.cts +2 -2
- package/lib/resources/fixed_amount_promotions.d.ts +1 -1
- package/lib/resources/fixed_amount_promotions.js +1 -1
- package/lib/resources/fixed_price_promotions.cjs +2 -2
- package/lib/resources/fixed_price_promotions.d.cts +2 -2
- package/lib/resources/fixed_price_promotions.d.ts +1 -1
- package/lib/resources/fixed_price_promotions.js +1 -1
- package/lib/resources/flex_promotions.cjs +2 -2
- package/lib/resources/flex_promotions.d.cts +2 -2
- package/lib/resources/flex_promotions.d.ts +1 -1
- package/lib/resources/flex_promotions.js +1 -1
- package/lib/resources/free_gift_promotions.cjs +2 -2
- package/lib/resources/free_gift_promotions.d.cts +2 -2
- package/lib/resources/free_gift_promotions.d.ts +1 -1
- package/lib/resources/free_gift_promotions.js +1 -1
- package/lib/resources/free_shipping_promotions.cjs +2 -2
- package/lib/resources/free_shipping_promotions.d.cts +2 -2
- package/lib/resources/free_shipping_promotions.d.ts +1 -1
- package/lib/resources/free_shipping_promotions.js +1 -1
- package/lib/resources/geocoders.d.cts +2 -2
- package/lib/resources/geocoders.d.ts +1 -1
- package/lib/resources/gift_card_recipients.d.cts +2 -2
- package/lib/resources/gift_card_recipients.d.ts +1 -1
- package/lib/resources/gift_cards.d.cts +2 -2
- package/lib/resources/gift_cards.d.ts +1 -1
- package/lib/resources/google_geocoders.d.cts +2 -2
- package/lib/resources/google_geocoders.d.ts +1 -1
- package/lib/resources/imports.d.cts +2 -2
- package/lib/resources/imports.d.ts +1 -1
- package/lib/resources/in_stock_subscriptions.d.cts +2 -2
- package/lib/resources/in_stock_subscriptions.d.ts +1 -1
- package/lib/resources/inventory_models.d.cts +2 -2
- package/lib/resources/inventory_models.d.ts +1 -1
- package/lib/resources/inventory_return_locations.d.cts +2 -2
- package/lib/resources/inventory_return_locations.d.ts +1 -1
- package/lib/resources/inventory_stock_locations.d.cts +2 -2
- package/lib/resources/inventory_stock_locations.d.ts +1 -1
- package/lib/resources/klarna_gateways.d.cts +2 -2
- package/lib/resources/klarna_gateways.d.ts +1 -1
- package/lib/resources/klarna_payments.d.cts +2 -2
- package/lib/resources/klarna_payments.d.ts +1 -1
- package/lib/resources/line_item_options.d.cts +2 -2
- package/lib/resources/line_item_options.d.ts +1 -1
- package/lib/resources/line_items.d.cts +2 -2
- package/lib/resources/line_items.d.ts +1 -1
- package/lib/resources/links.d.cts +2 -2
- package/lib/resources/links.d.ts +1 -1
- package/lib/resources/manual_gateways.d.cts +2 -2
- package/lib/resources/manual_gateways.d.ts +1 -1
- package/lib/resources/manual_tax_calculators.d.cts +2 -2
- package/lib/resources/manual_tax_calculators.d.ts +1 -1
- package/lib/resources/markets.d.cts +2 -2
- package/lib/resources/markets.d.ts +1 -1
- package/lib/resources/merchants.d.cts +2 -2
- package/lib/resources/merchants.d.ts +1 -1
- package/lib/resources/notifications.d.cts +2 -2
- package/lib/resources/notifications.d.ts +1 -1
- package/lib/resources/order_amount_promotion_rules.d.cts +2 -2
- package/lib/resources/order_amount_promotion_rules.d.ts +1 -1
- package/lib/resources/order_copies.d.cts +2 -2
- package/lib/resources/order_copies.d.ts +1 -1
- package/lib/resources/order_factories.d.cts +2 -2
- package/lib/resources/order_factories.d.ts +1 -1
- package/lib/resources/order_subscription_items.d.cts +2 -2
- package/lib/resources/order_subscription_items.d.ts +1 -1
- package/lib/resources/order_subscriptions.d.cts +2 -2
- package/lib/resources/order_subscriptions.d.ts +1 -1
- package/lib/resources/orders.d.cts +2 -2
- package/lib/resources/orders.d.ts +1 -1
- package/lib/resources/organizations.cjs +2 -2
- package/lib/resources/organizations.d.cts +2 -2
- package/lib/resources/organizations.d.ts +1 -1
- package/lib/resources/organizations.js +1 -1
- package/lib/resources/packages.d.cts +2 -2
- package/lib/resources/packages.d.ts +1 -1
- package/lib/resources/parcel_line_items.d.cts +2 -2
- package/lib/resources/parcel_line_items.d.ts +1 -1
- package/lib/resources/parcels.d.cts +2 -2
- package/lib/resources/parcels.d.ts +1 -1
- package/lib/resources/payment_gateways.d.cts +2 -2
- package/lib/resources/payment_gateways.d.ts +1 -1
- package/lib/resources/payment_methods.d.cts +2 -2
- package/lib/resources/payment_methods.d.ts +1 -1
- package/lib/resources/payment_options.d.cts +2 -2
- package/lib/resources/payment_options.d.ts +1 -1
- package/lib/resources/paypal_gateways.d.cts +2 -2
- package/lib/resources/paypal_gateways.d.ts +1 -1
- package/lib/resources/paypal_payments.d.cts +2 -2
- package/lib/resources/paypal_payments.d.ts +1 -1
- package/lib/resources/percentage_discount_promotions.cjs +2 -2
- package/lib/resources/percentage_discount_promotions.d.cts +2 -2
- package/lib/resources/percentage_discount_promotions.d.ts +1 -1
- package/lib/resources/percentage_discount_promotions.js +1 -1
- package/lib/resources/pickups.d.cts +2 -2
- package/lib/resources/pickups.d.ts +1 -1
- package/lib/resources/price_frequency_tiers.d.cts +2 -2
- package/lib/resources/price_frequency_tiers.d.ts +1 -1
- package/lib/resources/price_list_schedulers.d.cts +2 -2
- package/lib/resources/price_list_schedulers.d.ts +1 -1
- package/lib/resources/price_lists.d.cts +2 -2
- package/lib/resources/price_lists.d.ts +1 -1
- package/lib/resources/price_tiers.d.cts +2 -2
- package/lib/resources/price_tiers.d.ts +1 -1
- package/lib/resources/price_volume_tiers.d.cts +2 -2
- package/lib/resources/price_volume_tiers.d.ts +1 -1
- package/lib/resources/prices.d.cts +2 -2
- package/lib/resources/prices.d.ts +1 -1
- package/lib/resources/promotion_rules.d.cts +2 -2
- package/lib/resources/promotion_rules.d.ts +1 -1
- package/lib/resources/promotions.cjs +2 -2
- package/lib/resources/promotions.d.cts +2 -2
- package/lib/resources/promotions.d.ts +1 -1
- package/lib/resources/promotions.js +1 -1
- package/lib/resources/recurring_order_copies.d.cts +2 -2
- package/lib/resources/recurring_order_copies.d.ts +1 -1
- package/lib/resources/refunds.d.cts +2 -2
- package/lib/resources/refunds.d.ts +1 -1
- package/lib/resources/reserved_stocks.d.cts +2 -2
- package/lib/resources/reserved_stocks.d.ts +1 -1
- package/lib/resources/resource_errors.d.cts +2 -2
- package/lib/resources/resource_errors.d.ts +1 -1
- package/lib/resources/return_line_items.d.cts +2 -2
- package/lib/resources/return_line_items.d.ts +1 -1
- package/lib/resources/returns.d.cts +2 -2
- package/lib/resources/returns.d.ts +1 -1
- package/lib/resources/satispay_gateways.d.cts +2 -2
- package/lib/resources/satispay_gateways.d.ts +1 -1
- package/lib/resources/satispay_payments.d.cts +2 -2
- package/lib/resources/satispay_payments.d.ts +1 -1
- package/lib/resources/shipments.d.cts +2 -2
- package/lib/resources/shipments.d.ts +1 -1
- package/lib/resources/shipping_categories.d.cts +2 -2
- package/lib/resources/shipping_categories.d.ts +1 -1
- package/lib/resources/shipping_method_tiers.d.cts +2 -2
- package/lib/resources/shipping_method_tiers.d.ts +1 -1
- package/lib/resources/shipping_methods.d.cts +2 -2
- package/lib/resources/shipping_methods.d.ts +1 -1
- package/lib/resources/shipping_weight_tiers.d.cts +2 -2
- package/lib/resources/shipping_weight_tiers.d.ts +1 -1
- package/lib/resources/shipping_zones.d.cts +2 -2
- package/lib/resources/shipping_zones.d.ts +1 -1
- package/lib/resources/sku_list_items.d.cts +2 -2
- package/lib/resources/sku_list_items.d.ts +1 -1
- package/lib/resources/sku_list_promotion_rules.d.cts +2 -2
- package/lib/resources/sku_list_promotion_rules.d.ts +1 -1
- package/lib/resources/sku_lists.d.cts +2 -2
- package/lib/resources/sku_lists.d.ts +1 -1
- package/lib/resources/sku_options.d.cts +2 -2
- package/lib/resources/sku_options.d.ts +1 -1
- package/lib/resources/skus.d.cts +2 -2
- package/lib/resources/skus.d.ts +1 -1
- package/lib/resources/stock_items.d.cts +2 -2
- package/lib/resources/stock_items.d.ts +1 -1
- package/lib/resources/stock_line_items.d.cts +2 -2
- package/lib/resources/stock_line_items.d.ts +1 -1
- package/lib/resources/stock_locations.d.cts +2 -2
- package/lib/resources/stock_locations.d.ts +1 -1
- package/lib/resources/stock_reservations.d.cts +2 -2
- package/lib/resources/stock_reservations.d.ts +1 -1
- package/lib/resources/stock_transfers.d.cts +2 -2
- package/lib/resources/stock_transfers.d.ts +1 -1
- package/lib/resources/stores.d.cts +2 -2
- package/lib/resources/stores.d.ts +1 -1
- package/lib/resources/stripe_gateways.d.cts +2 -2
- package/lib/resources/stripe_gateways.d.ts +1 -1
- package/lib/resources/stripe_payments.d.cts +2 -2
- package/lib/resources/stripe_payments.d.ts +1 -1
- package/lib/resources/stripe_tax_accounts.d.cts +2 -2
- package/lib/resources/stripe_tax_accounts.d.ts +1 -1
- package/lib/resources/subscription_models.d.cts +2 -2
- package/lib/resources/subscription_models.d.ts +1 -1
- package/lib/resources/tags.d.cts +2 -2
- package/lib/resources/tags.d.ts +1 -1
- package/lib/resources/talon_one_accounts.d.cts +2 -2
- package/lib/resources/talon_one_accounts.d.ts +1 -1
- package/lib/resources/tax_calculators.d.cts +2 -2
- package/lib/resources/tax_calculators.d.ts +1 -1
- package/lib/resources/tax_categories.d.cts +2 -2
- package/lib/resources/tax_categories.d.ts +1 -1
- package/lib/resources/tax_rules.d.cts +2 -2
- package/lib/resources/tax_rules.d.ts +1 -1
- package/lib/resources/taxjar_accounts.d.cts +2 -2
- package/lib/resources/taxjar_accounts.d.ts +1 -1
- package/lib/resources/transactions.d.cts +2 -2
- package/lib/resources/transactions.d.ts +1 -1
- package/lib/resources/versions.d.cts +2 -2
- package/lib/resources/versions.d.ts +1 -1
- package/lib/resources/vertex_accounts.d.cts +2 -2
- package/lib/resources/vertex_accounts.d.ts +1 -1
- package/lib/resources/voids.d.cts +2 -2
- package/lib/resources/voids.d.ts +1 -1
- package/lib/resources/webhooks.d.cts +2 -2
- package/lib/resources/webhooks.d.ts +1 -1
- package/lib/resources/wire_transfers.d.cts +2 -2
- 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 +5 -5
- package/lib/chunk-2UUZHL2R.js.map +0 -1
- package/lib/chunk-6PWK52UZ.cjs.map +0 -1
- package/lib/chunk-7ISS2FDY.js.map +0 -1
- package/lib/chunk-ANCLAYJV.cjs.map +0 -1
- package/lib/chunk-AVJX4OEZ.js.map +0 -1
- package/lib/chunk-BBEMCANC.cjs.map +0 -1
- package/lib/chunk-DTGODPCN.js.map +0 -1
- package/lib/chunk-EHWAGYNX.js.map +0 -1
- package/lib/chunk-EQD223JW.cjs.map +0 -1
- package/lib/chunk-HAAE23MQ.js.map +0 -1
- package/lib/chunk-HSILJQCD.js.map +0 -1
- package/lib/chunk-IDAOX5RB.cjs.map +0 -1
- package/lib/chunk-INZD34YD.cjs.map +0 -1
- package/lib/chunk-M2ZERG2X.cjs.map +0 -1
- package/lib/chunk-MPSHBMZS.js.map +0 -1
- package/lib/chunk-N6MHUHGE.cjs.map +0 -1
- package/lib/chunk-ROPOLXIV.js.map +0 -1
- package/lib/chunk-S3MCPCGR.cjs.map +0 -1
- package/lib/chunk-SN6BP777.js.map +0 -1
- package/lib/chunk-W6AL2GJ4.cjs.map +0 -1
- package/lib/chunk-WBPEFNL7.cjs.map +0 -1
- package/lib/chunk-WVAW33XQ.js.map +0 -1
- package/lib/chunk-WXE5KXJC.cjs.map +0 -1
- package/lib/chunk-YUGZUUAU.js.map +0 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/resources/external_gateways.ts"],"names":["ApiResource"],"mappings":";;;;;AAuJA,IAAM,gBAAA,GAAN,MAAM,iBAAA,SAAyBA,6BAAA,CAA6B;AAAA,EAE3D,OAAgB,IAAA,GAA4B,mBAAA;AAAA,EAE5C,MAAM,MAAA,CAAO,QAAA,EAAiC,MAAA,EAA+C,OAAA,EAAqD;AACjJ,IAAA,OAAO,IAAA,CAAK,SAAA,CAAU,MAAA,CAA+C,EAAE,GAAG,QAAA,EAAU,IAAA,EAAM,iBAAA,CAAiB,IAAA,EAAK,EAAG,MAAA,EAAQ,OAAO,CAAA;AAAA;AACnI,EAEA,MAAM,MAAA,CAAO,QAAA,EAAiC,MAAA,EAA+C,OAAA,EAAqD;AACjJ,IAAA,OAAO,IAAA,CAAK,SAAA,CAAU,MAAA,CAA+C,EAAE,GAAG,QAAA,EAAU,IAAA,EAAM,iBAAA,CAAiB,IAAA,EAAK,EAAG,MAAA,EAAQ,OAAO,CAAA;AAAA;AACnI,EAEA,MAAM,MAAA,CAAO,EAAA,EAAyB,OAAA,EAA0C;AAC/E,IAAA,MAAM,IAAA,CAAK,SAAA,CAAU,MAAA,CAAQ,OAAO,EAAA,KAAO,QAAA,GAA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iBAAA,CAAiB,IAAA,EAAM,gBAAgB,IAAA,EAAK,EAAG,QAAQ,OAAO,CAAA;AAAA;AACrL,EAGA,kBAAkB,QAAA,EAA4C;AAC7D,IAAA,OAAO,QAAA,CAAS,IAAA,IAAS,QAAA,CAAS,IAAA,KAAS,iBAAA,CAAiB,IAAA;AAAA;AAC7D,EAGA,aAAa,EAAA,EAAoD;AAChE,IAAA,OAAO,KAAA,CAAM,qBAAyC,EAAE,CAAA;AAAA;AACzD,EAEA,sBAAsB,GAAA,EAAqC;AAC1D,IAAA,OAAO,KAAA,CAAM,qBAAA,CAA0C,GAAG,GAAG,CAAA;AAAA;AAC9D,EAGA,IAAA,GAA4B;AAC3B,IAAA,OAAO,iBAAA,CAAiB,IAAA;AAAA;AAG1B,CAAA;AAGA,IAAM,QAAA,GAAW,IAAI,gBAAA,EAAiB;AACtC,IAAO,yBAAA,GAAQ","file":"chunk-MWYBER5I.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 { PaymentMethod } from './payment_methods'\nimport type { Version } from './versions'\nimport type { ExternalPayment } from './external_payments'\n\n\ntype ExternalGatewayType = 'external_gateways'\ntype ExternalGatewayRel = ResourceRel & { type: ExternalGatewayType }\n\n\nexport type ExternalGatewaySort = Pick<ExternalGateway, 'id' | 'name' | 'circuit_state' | 'circuit_failure_count'> & ResourceSort\n// export type ExternalGatewayFilter = Pick<ExternalGateway, 'id' | 'name' | 'circuit_state' | 'circuit_failure_count'> & ResourceFilter\n\n\ninterface ExternalGateway extends Resource {\n\t\n\treadonly type: ExternalGatewayType\n\n\t/** \n\t * The payment gateway's internal name.\n\t * @example ```\"US payment gateway\"```\n\t */\n\tname: string\n\t/** \n\t * The endpoint used by the external gateway to authorize payments.\n\t * @example ```\"https://external_gateway.com/authorize\"```\n\t */\n\tauthorize_url?: string | null\n\t/** \n\t * The endpoint used by the external gateway to capture payments.\n\t * @example ```\"https://external_gateway.com/capture\"```\n\t */\n\tcapture_url?: string | null\n\t/** \n\t * The endpoint used by the external gateway to void payments.\n\t * @example ```\"https://external_gateway.com/void\"```\n\t */\n\tvoid_url?: string | null\n\t/** \n\t * The endpoint used by the external gateway to refund payments.\n\t * @example ```\"https://external_gateway.com/refund\"```\n\t */\n\trefund_url?: string | null\n\t/** \n\t * The endpoint used by the external gateway to create a customer payment token.\n\t * @example ```\"https://external_gateway.com/token\"```\n\t */\n\ttoken_url?: string | null\n\t/** \n\t * The circuit breaker state, by default it is 'closed'. It can become 'open' once the number of consecutive failures overlaps the specified threshold, in such case no further calls to the failing callback are made.\n\t * @example ```\"closed\"```\n\t */\n\tcircuit_state?: string | null\n\t/** \n\t * The number of consecutive failures recorded by the circuit breaker associated to this resource, will be reset on first successful call to callback.\n\t * @example ```5```\n\t */\n\tcircuit_failure_count?: number | null\n\t/** \n\t * The shared secret used to sign the external request payload.\n\t * @example ```\"1c0994cc4e996e8c6ee56a2198f66f3c\"```\n\t */\n\tshared_secret: string\n\n\tpayment_methods?: PaymentMethod[] | null\n\tversions?: Version[] | null\n\texternal_payments?: ExternalPayment[] | null\n\n}\n\n\ninterface ExternalGatewayCreate extends ResourceCreate {\n\t\n\t/** \n\t * The payment gateway's internal name.\n\t * @example ```\"US payment gateway\"```\n\t */\n\tname: string\n\t/** \n\t * The endpoint used by the external gateway to authorize payments.\n\t * @example ```\"https://external_gateway.com/authorize\"```\n\t */\n\tauthorize_url?: string | null\n\t/** \n\t * The endpoint used by the external gateway to capture payments.\n\t * @example ```\"https://external_gateway.com/capture\"```\n\t */\n\tcapture_url?: string | null\n\t/** \n\t * The endpoint used by the external gateway to void payments.\n\t * @example ```\"https://external_gateway.com/void\"```\n\t */\n\tvoid_url?: string | null\n\t/** \n\t * The endpoint used by the external gateway to refund payments.\n\t * @example ```\"https://external_gateway.com/refund\"```\n\t */\n\trefund_url?: string | null\n\t/** \n\t * The endpoint used by the external gateway to create a customer payment token.\n\t * @example ```\"https://external_gateway.com/token\"```\n\t */\n\ttoken_url?: string | null\n\t\n}\n\n\ninterface ExternalGatewayUpdate extends ResourceUpdate {\n\t\n\t/** \n\t * The payment gateway's internal name.\n\t * @example ```\"US payment gateway\"```\n\t */\n\tname?: string | null\n\t/** \n\t * The endpoint used by the external gateway to authorize payments.\n\t * @example ```\"https://external_gateway.com/authorize\"```\n\t */\n\tauthorize_url?: string | null\n\t/** \n\t * The endpoint used by the external gateway to capture payments.\n\t * @example ```\"https://external_gateway.com/capture\"```\n\t */\n\tcapture_url?: string | null\n\t/** \n\t * The endpoint used by the external gateway to void payments.\n\t * @example ```\"https://external_gateway.com/void\"```\n\t */\n\tvoid_url?: string | null\n\t/** \n\t * The endpoint used by the external gateway to refund payments.\n\t * @example ```\"https://external_gateway.com/refund\"```\n\t */\n\trefund_url?: string | null\n\t/** \n\t * The endpoint used by the external gateway to create a customer payment token.\n\t * @example ```\"https://external_gateway.com/token\"```\n\t */\n\ttoken_url?: string | null\n\t/** \n\t * Send this attribute if you want to reset the circuit breaker associated to this resource to 'closed' state and zero failures count. Cannot be passed by sales channels.\n\t * @example ```true```\n\t */\n\t_reset_circuit?: boolean | null\n\t\n}\n\n\nclass ExternalGateways extends ApiResource<ExternalGateway> {\n\n\tstatic readonly TYPE: ExternalGatewayType = 'external_gateways' as const\n\n\tasync create(resource: ExternalGatewayCreate, params?: QueryParamsRetrieve<ExternalGateway>, options?: ResourcesConfig): Promise<ExternalGateway> {\n\t\treturn this.resources.create<ExternalGatewayCreate, ExternalGateway>({ ...resource, type: ExternalGateways.TYPE }, params, options)\n\t}\n\n\tasync update(resource: ExternalGatewayUpdate, params?: QueryParamsRetrieve<ExternalGateway>, options?: ResourcesConfig): Promise<ExternalGateway> {\n\t\treturn this.resources.update<ExternalGatewayUpdate, ExternalGateway>({ ...resource, type: ExternalGateways.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: ExternalGateways.TYPE } : id, options)\n\t}\n\n\tasync payment_methods(externalGatewayId: string | ExternalGateway, params?: QueryParamsList<PaymentMethod>, options?: ResourcesConfig): Promise<ListResponse<PaymentMethod>> {\n\t\tconst _externalGatewayId = (externalGatewayId as ExternalGateway).id || externalGatewayId as string\n\t\treturn this.resources.fetch<PaymentMethod>({ type: 'payment_methods' }, `external_gateways/${_externalGatewayId}/payment_methods`, params, options) as unknown as ListResponse<PaymentMethod>\n\t}\n\n\tasync versions(externalGatewayId: string | ExternalGateway, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>> {\n\t\tconst _externalGatewayId = (externalGatewayId as ExternalGateway).id || externalGatewayId as string\n\t\treturn this.resources.fetch<Version>({ type: 'versions' }, `external_gateways/${_externalGatewayId}/versions`, params, options) as unknown as ListResponse<Version>\n\t}\n\n\tasync external_payments(externalGatewayId: string | ExternalGateway, params?: QueryParamsList<ExternalPayment>, options?: ResourcesConfig): Promise<ListResponse<ExternalPayment>> {\n\t\tconst _externalGatewayId = (externalGatewayId as ExternalGateway).id || externalGatewayId as string\n\t\treturn this.resources.fetch<ExternalPayment>({ type: 'external_payments' }, `external_gateways/${_externalGatewayId}/external_payments`, params, options) as unknown as ListResponse<ExternalPayment>\n\t}\n\n\tasync _reset_circuit(id: string | ExternalGateway, params?: QueryParamsRetrieve<ExternalGateway>, options?: ResourcesConfig): Promise<ExternalGateway> {\n\t\treturn this.resources.update<ExternalGatewayUpdate, ExternalGateway>({ id: (typeof id === 'string')? id: id.id, type: ExternalGateways.TYPE, _reset_circuit: true }, params, options)\n\t}\n\n\n\tisExternalGateway(resource: any): resource is ExternalGateway {\n\t\treturn resource.type && (resource.type === ExternalGateways.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): ExternalGatewayRel {\n\t\treturn super.relationshipOneToOne<ExternalGatewayRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): ExternalGatewayRel[] {\n\t\treturn super.relationshipOneToMany<ExternalGatewayRel>(...ids)\n\t}\n\n\n\ttype(): ExternalGatewayType {\n\t\treturn ExternalGateways.TYPE\n\t}\n\n}\n\n\nconst instance = new ExternalGateways()\nexport default instance\n\nexport type { ExternalGateways, ExternalGateway, ExternalGatewayCreate, ExternalGatewayUpdate, ExternalGatewayType }\n"]}
|
1
|
+
{"version":3,"sources":["../src/resources/external_gateways.ts"],"names":["ApiResource"],"mappings":";;;;;AAuJA,IAAM,gBAAA,GAAN,MAAM,iBAAA,SAAyBA,6BAAA,CAA6B;AAAA,EAE3D,OAAgB,IAAA,GAA4B,mBAAA;AAAA,EAE5C,MAAM,MAAA,CAAO,QAAA,EAAiC,MAAA,EAA+C,OAAA,EAAqD;AACjJ,IAAA,OAAO,IAAA,CAAK,SAAA,CAAU,MAAA,CAA+C,EAAE,GAAG,QAAA,EAAU,IAAA,EAAM,iBAAA,CAAiB,IAAA,EAAK,EAAG,MAAA,EAAQ,OAAO,CAAA;AAAA,EACnI;AAAA,EAEA,MAAM,MAAA,CAAO,QAAA,EAAiC,MAAA,EAA+C,OAAA,EAAqD;AACjJ,IAAA,OAAO,IAAA,CAAK,SAAA,CAAU,MAAA,CAA+C,EAAE,GAAG,QAAA,EAAU,IAAA,EAAM,iBAAA,CAAiB,IAAA,EAAK,EAAG,MAAA,EAAQ,OAAO,CAAA;AAAA,EACnI;AAAA,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,iBAAA,CAAiB,IAAA,EAAK,GAAI,IAAI,OAAO,CAAA;AAAA,EACxG;AAAA,EAEA,MAAM,eAAA,CAAgB,iBAAA,EAA6C,MAAA,EAAyC,OAAA,EAAiE;AAC5K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IAAA,IAAS,QAAA,CAAS,IAAA,KAAS,iBAAA,CAAiB,IAAA;AAAA,EAC7D;AAAA,EAGA,aAAa,EAAA,EAAoD;AAChE,IAAA,OAAO,KAAA,CAAM,qBAAyC,EAAE,CAAA;AAAA,EACzD;AAAA,EAEA,sBAAsB,GAAA,EAAqC;AAC1D,IAAA,OAAO,KAAA,CAAM,qBAAA,CAA0C,GAAG,GAAG,CAAA;AAAA,EAC9D;AAAA,EAGA,IAAA,GAA4B;AAC3B,IAAA,OAAO,iBAAA,CAAiB,IAAA;AAAA,EACzB;AAED,CAAA;AAGA,IAAM,QAAA,GAAW,IAAI,gBAAA,EAAiB;AACtC,IAAO,yBAAA,GAAQ","file":"chunk-MWYBER5I.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 { PaymentMethod } from './payment_methods'\nimport type { Version } from './versions'\nimport type { ExternalPayment } from './external_payments'\n\n\ntype ExternalGatewayType = 'external_gateways'\ntype ExternalGatewayRel = ResourceRel & { type: ExternalGatewayType }\n\n\nexport type ExternalGatewaySort = Pick<ExternalGateway, 'id' | 'name' | 'circuit_state' | 'circuit_failure_count'> & ResourceSort\n// export type ExternalGatewayFilter = Pick<ExternalGateway, 'id' | 'name' | 'circuit_state' | 'circuit_failure_count'> & ResourceFilter\n\n\ninterface ExternalGateway extends Resource {\n\t\n\treadonly type: ExternalGatewayType\n\n\t/** \n\t * The payment gateway's internal name.\n\t * @example ```\"US payment gateway\"```\n\t */\n\tname: string\n\t/** \n\t * The endpoint used by the external gateway to authorize payments.\n\t * @example ```\"https://external_gateway.com/authorize\"```\n\t */\n\tauthorize_url?: string | null\n\t/** \n\t * The endpoint used by the external gateway to capture payments.\n\t * @example ```\"https://external_gateway.com/capture\"```\n\t */\n\tcapture_url?: string | null\n\t/** \n\t * The endpoint used by the external gateway to void payments.\n\t * @example ```\"https://external_gateway.com/void\"```\n\t */\n\tvoid_url?: string | null\n\t/** \n\t * The endpoint used by the external gateway to refund payments.\n\t * @example ```\"https://external_gateway.com/refund\"```\n\t */\n\trefund_url?: string | null\n\t/** \n\t * The endpoint used by the external gateway to create a customer payment token.\n\t * @example ```\"https://external_gateway.com/token\"```\n\t */\n\ttoken_url?: string | null\n\t/** \n\t * The circuit breaker state, by default it is 'closed'. It can become 'open' once the number of consecutive failures overlaps the specified threshold, in such case no further calls to the failing callback are made.\n\t * @example ```\"closed\"```\n\t */\n\tcircuit_state?: string | null\n\t/** \n\t * The number of consecutive failures recorded by the circuit breaker associated to this resource, will be reset on first successful call to callback.\n\t * @example ```5```\n\t */\n\tcircuit_failure_count?: number | null\n\t/** \n\t * The shared secret used to sign the external request payload.\n\t * @example ```\"1c0994cc4e996e8c6ee56a2198f66f3c\"```\n\t */\n\tshared_secret: string\n\n\tpayment_methods?: PaymentMethod[] | null\n\tversions?: Version[] | null\n\texternal_payments?: ExternalPayment[] | null\n\n}\n\n\ninterface ExternalGatewayCreate extends ResourceCreate {\n\t\n\t/** \n\t * The payment gateway's internal name.\n\t * @example ```\"US payment gateway\"```\n\t */\n\tname: string\n\t/** \n\t * The endpoint used by the external gateway to authorize payments.\n\t * @example ```\"https://external_gateway.com/authorize\"```\n\t */\n\tauthorize_url?: string | null\n\t/** \n\t * The endpoint used by the external gateway to capture payments.\n\t * @example ```\"https://external_gateway.com/capture\"```\n\t */\n\tcapture_url?: string | null\n\t/** \n\t * The endpoint used by the external gateway to void payments.\n\t * @example ```\"https://external_gateway.com/void\"```\n\t */\n\tvoid_url?: string | null\n\t/** \n\t * The endpoint used by the external gateway to refund payments.\n\t * @example ```\"https://external_gateway.com/refund\"```\n\t */\n\trefund_url?: string | null\n\t/** \n\t * The endpoint used by the external gateway to create a customer payment token.\n\t * @example ```\"https://external_gateway.com/token\"```\n\t */\n\ttoken_url?: string | null\n\t\n}\n\n\ninterface ExternalGatewayUpdate extends ResourceUpdate {\n\t\n\t/** \n\t * The payment gateway's internal name.\n\t * @example ```\"US payment gateway\"```\n\t */\n\tname?: string | null\n\t/** \n\t * The endpoint used by the external gateway to authorize payments.\n\t * @example ```\"https://external_gateway.com/authorize\"```\n\t */\n\tauthorize_url?: string | null\n\t/** \n\t * The endpoint used by the external gateway to capture payments.\n\t * @example ```\"https://external_gateway.com/capture\"```\n\t */\n\tcapture_url?: string | null\n\t/** \n\t * The endpoint used by the external gateway to void payments.\n\t * @example ```\"https://external_gateway.com/void\"```\n\t */\n\tvoid_url?: string | null\n\t/** \n\t * The endpoint used by the external gateway to refund payments.\n\t * @example ```\"https://external_gateway.com/refund\"```\n\t */\n\trefund_url?: string | null\n\t/** \n\t * The endpoint used by the external gateway to create a customer payment token.\n\t * @example ```\"https://external_gateway.com/token\"```\n\t */\n\ttoken_url?: string | null\n\t/** \n\t * Send this attribute if you want to reset the circuit breaker associated to this resource to 'closed' state and zero failures count. Cannot be passed by sales channels.\n\t * @example ```true```\n\t */\n\t_reset_circuit?: boolean | null\n\t\n}\n\n\nclass ExternalGateways extends ApiResource<ExternalGateway> {\n\n\tstatic readonly TYPE: ExternalGatewayType = 'external_gateways' as const\n\n\tasync create(resource: ExternalGatewayCreate, params?: QueryParamsRetrieve<ExternalGateway>, options?: ResourcesConfig): Promise<ExternalGateway> {\n\t\treturn this.resources.create<ExternalGatewayCreate, ExternalGateway>({ ...resource, type: ExternalGateways.TYPE }, params, options)\n\t}\n\n\tasync update(resource: ExternalGatewayUpdate, params?: QueryParamsRetrieve<ExternalGateway>, options?: ResourcesConfig): Promise<ExternalGateway> {\n\t\treturn this.resources.update<ExternalGatewayUpdate, ExternalGateway>({ ...resource, type: ExternalGateways.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: ExternalGateways.TYPE } : id, options)\n\t}\n\n\tasync payment_methods(externalGatewayId: string | ExternalGateway, params?: QueryParamsList<PaymentMethod>, options?: ResourcesConfig): Promise<ListResponse<PaymentMethod>> {\n\t\tconst _externalGatewayId = (externalGatewayId as ExternalGateway).id || externalGatewayId as string\n\t\treturn this.resources.fetch<PaymentMethod>({ type: 'payment_methods' }, `external_gateways/${_externalGatewayId}/payment_methods`, params, options) as unknown as ListResponse<PaymentMethod>\n\t}\n\n\tasync versions(externalGatewayId: string | ExternalGateway, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>> {\n\t\tconst _externalGatewayId = (externalGatewayId as ExternalGateway).id || externalGatewayId as string\n\t\treturn this.resources.fetch<Version>({ type: 'versions' }, `external_gateways/${_externalGatewayId}/versions`, params, options) as unknown as ListResponse<Version>\n\t}\n\n\tasync external_payments(externalGatewayId: string | ExternalGateway, params?: QueryParamsList<ExternalPayment>, options?: ResourcesConfig): Promise<ListResponse<ExternalPayment>> {\n\t\tconst _externalGatewayId = (externalGatewayId as ExternalGateway).id || externalGatewayId as string\n\t\treturn this.resources.fetch<ExternalPayment>({ type: 'external_payments' }, `external_gateways/${_externalGatewayId}/external_payments`, params, options) as unknown as ListResponse<ExternalPayment>\n\t}\n\n\tasync _reset_circuit(id: string | ExternalGateway, params?: QueryParamsRetrieve<ExternalGateway>, options?: ResourcesConfig): Promise<ExternalGateway> {\n\t\treturn this.resources.update<ExternalGatewayUpdate, ExternalGateway>({ id: (typeof id === 'string')? id: id.id, type: ExternalGateways.TYPE, _reset_circuit: true }, params, options)\n\t}\n\n\n\tisExternalGateway(resource: any): resource is ExternalGateway {\n\t\treturn resource.type && (resource.type === ExternalGateways.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): ExternalGatewayRel {\n\t\treturn super.relationshipOneToOne<ExternalGatewayRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): ExternalGatewayRel[] {\n\t\treturn super.relationshipOneToMany<ExternalGatewayRel>(...ids)\n\t}\n\n\n\ttype(): ExternalGatewayType {\n\t\treturn ExternalGateways.TYPE\n\t}\n\n}\n\n\nconst instance = new ExternalGateways()\nexport default instance\n\nexport type { ExternalGateways, ExternalGateway, ExternalGatewayCreate, ExternalGatewayUpdate, ExternalGatewayType }\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/resources/manual_gateways.ts"],"names":[],"mappings":";;;AAsDA,IAAM,cAAA,GAAN,MAAM,eAAA,SAAuB,WAAA,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;
|
1
|
+
{"version":3,"sources":["../src/resources/manual_gateways.ts"],"names":[],"mappings":";;;AAsDA,IAAM,cAAA,GAAN,MAAM,eAAA,SAAuB,WAAA,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,EAC7H;AAAA,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,EAC7H;AAAA,EAEA,MAAM,MAAA,CAAO,EAAA,EAAyB,OAAA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A;AAGA,IAAM,QAAA,GAAW,IAAI,cAAA,EAAe;AACpC,IAAO,uBAAA,GAAQ","file":"chunk-MZNHRIXE.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 { PaymentMethod } from './payment_methods'\nimport type { Version } from './versions'\n\n\ntype ManualGatewayType = 'manual_gateways'\ntype ManualGatewayRel = ResourceRel & { type: ManualGatewayType }\n\n\nexport type ManualGatewaySort = Pick<ManualGateway, 'id' | 'name'> & ResourceSort\n// export type ManualGatewayFilter = Pick<ManualGateway, 'id' | 'name'> & ResourceFilter\n\n\ninterface ManualGateway extends Resource {\n\t\n\treadonly type: ManualGatewayType\n\n\t/** \n\t * The payment gateway's internal name.\n\t * @example ```\"US payment gateway\"```\n\t */\n\tname: string\n\n\tpayment_methods?: PaymentMethod[] | null\n\tversions?: Version[] | null\n\n}\n\n\ninterface ManualGatewayCreate extends ResourceCreate {\n\t\n\t/** \n\t * The payment gateway's internal name.\n\t * @example ```\"US payment gateway\"```\n\t */\n\tname: string\n\t\n}\n\n\ninterface ManualGatewayUpdate extends ResourceUpdate {\n\t\n\t/** \n\t * The payment gateway's internal name.\n\t * @example ```\"US payment gateway\"```\n\t */\n\tname?: string | null\n\t\n}\n\n\nclass ManualGateways extends ApiResource<ManualGateway> {\n\n\tstatic readonly TYPE: ManualGatewayType = 'manual_gateways' as const\n\n\tasync create(resource: ManualGatewayCreate, params?: QueryParamsRetrieve<ManualGateway>, options?: ResourcesConfig): Promise<ManualGateway> {\n\t\treturn this.resources.create<ManualGatewayCreate, ManualGateway>({ ...resource, type: ManualGateways.TYPE }, params, options)\n\t}\n\n\tasync update(resource: ManualGatewayUpdate, params?: QueryParamsRetrieve<ManualGateway>, options?: ResourcesConfig): Promise<ManualGateway> {\n\t\treturn this.resources.update<ManualGatewayUpdate, ManualGateway>({ ...resource, type: ManualGateways.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: ManualGateways.TYPE } : id, options)\n\t}\n\n\tasync payment_methods(manualGatewayId: string | ManualGateway, params?: QueryParamsList<PaymentMethod>, options?: ResourcesConfig): Promise<ListResponse<PaymentMethod>> {\n\t\tconst _manualGatewayId = (manualGatewayId as ManualGateway).id || manualGatewayId as string\n\t\treturn this.resources.fetch<PaymentMethod>({ type: 'payment_methods' }, `manual_gateways/${_manualGatewayId}/payment_methods`, params, options) as unknown as ListResponse<PaymentMethod>\n\t}\n\n\tasync versions(manualGatewayId: string | ManualGateway, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>> {\n\t\tconst _manualGatewayId = (manualGatewayId as ManualGateway).id || manualGatewayId as string\n\t\treturn this.resources.fetch<Version>({ type: 'versions' }, `manual_gateways/${_manualGatewayId}/versions`, params, options) as unknown as ListResponse<Version>\n\t}\n\n\n\tisManualGateway(resource: any): resource is ManualGateway {\n\t\treturn resource.type && (resource.type === ManualGateways.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): ManualGatewayRel {\n\t\treturn super.relationshipOneToOne<ManualGatewayRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): ManualGatewayRel[] {\n\t\treturn super.relationshipOneToMany<ManualGatewayRel>(...ids)\n\t}\n\n\n\ttype(): ManualGatewayType {\n\t\treturn ManualGateways.TYPE\n\t}\n\n}\n\n\nconst instance = new ManualGateways()\nexport default instance\n\nexport type { ManualGateways, ManualGateway, ManualGatewayCreate, ManualGatewayUpdate, ManualGatewayType }\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/resources/stock_reservations.ts"],"names":[],"mappings":";;;AAkFA,IAAM,iBAAA,GAAN,MAAM,kBAAA,SAA0B,WAAA,CAA8B;AAAA,EAE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'\nimport type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ResourceSort, /* ResourceFilter */ } from '../resource'\nimport type { QueryParamsRetrieve } from '../query'\n\nimport type { LineItem } from './line_items'\nimport type { Order } from './orders'\nimport type { StockLineItem } from './stock_line_items'\nimport type { StockTransfer } from './stock_transfers'\nimport type { StockItem, StockItemType } from './stock_items'\nimport type { ReservedStock } from './reserved_stocks'\nimport type { Sku } from './skus'\n\n\ntype StockReservationType = 'stock_reservations'\ntype StockReservationRel = ResourceRel & { type: StockReservationType }\ntype StockItemRel = ResourceRel & { type: StockItemType }\n\n\nexport type StockReservationSort = Pick<StockReservation, 'id' | 'status' | 'quantity' | 'expires_at'> & ResourceSort\n// export type StockReservationFilter = Pick<StockReservation, 'id' | 'status' | 'quantity' | 'expires_at'> & ResourceFilter\n\n\ninterface StockReservation extends Resource {\n\t\n\treadonly type: StockReservationType\n\n\t/** \n\t * The stock reservation status. One of 'draft' (default), or 'pending'.\n\t * @example ```\"draft\"```\n\t */\n\tstatus: 'draft' | 'pending'\n\t/** \n\t * The stock reservation quantity.\n\t * @example ```4```\n\t */\n\tquantity: number\n\t/** \n\t * The expiration date/time of this stock reservation.\n\t * @example ```\"2018-01-02T12:00:00.000Z\"```\n\t */\n\texpires_at: string\n\n\tline_item?: LineItem | null\n\torder?: Order | null\n\tstock_line_item?: StockLineItem | null\n\tstock_transfer?: StockTransfer | null\n\tstock_item?: StockItem | null\n\treserved_stock?: ReservedStock | null\n\tsku?: Sku | null\n\n}\n\n\ninterface StockReservationCreate extends ResourceCreate {\n\t\n\t/** \n\t * The stock reservation quantity.\n\t * @example ```4```\n\t */\n\tquantity: number\n\n\tstock_item: StockItemRel\n\n}\n\n\ninterface StockReservationUpdate extends ResourceUpdate {\n\t\n\t/** \n\t * The stock reservation quantity.\n\t * @example ```4```\n\t */\n\tquantity?: number | null\n\t/** \n\t * Send this attribute if you want to mark this stock reservation as pending.\n\t * @example ```true```\n\t */\n\t_pending?: boolean | null\n\t\n}\n\n\nclass StockReservations extends ApiResource<StockReservation> {\n\n\tstatic readonly TYPE: StockReservationType = 'stock_reservations' as const\n\n\tasync create(resource: StockReservationCreate, params?: QueryParamsRetrieve<StockReservation>, options?: ResourcesConfig): Promise<StockReservation> {\n\t\treturn this.resources.create<StockReservationCreate, StockReservation>({ ...resource, type: StockReservations.TYPE }, params, options)\n\t}\n\n\tasync update(resource: StockReservationUpdate, params?: QueryParamsRetrieve<StockReservation>, options?: ResourcesConfig): Promise<StockReservation> {\n\t\treturn this.resources.update<StockReservationUpdate, StockReservation>({ ...resource, type: StockReservations.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: StockReservations.TYPE } : id, options)\n\t}\n\n\tasync line_item(stockReservationId: string | StockReservation, params?: QueryParamsRetrieve<LineItem>, options?: ResourcesConfig): Promise<LineItem> {\n\t\tconst _stockReservationId = (stockReservationId as StockReservation).id || stockReservationId as string\n\t\treturn this.resources.fetch<LineItem>({ type: 'line_items' }, `stock_reservations/${_stockReservationId}/line_item`, params, options) as unknown as LineItem\n\t}\n\n\tasync order(stockReservationId: string | StockReservation, params?: QueryParamsRetrieve<Order>, options?: ResourcesConfig): Promise<Order> {\n\t\tconst _stockReservationId = (stockReservationId as StockReservation).id || stockReservationId as string\n\t\treturn this.resources.fetch<Order>({ type: 'orders' }, `stock_reservations/${_stockReservationId}/order`, params, options) as unknown as Order\n\t}\n\n\tasync stock_line_item(stockReservationId: string | StockReservation, params?: QueryParamsRetrieve<StockLineItem>, options?: ResourcesConfig): Promise<StockLineItem> {\n\t\tconst _stockReservationId = (stockReservationId as StockReservation).id || stockReservationId as string\n\t\treturn this.resources.fetch<StockLineItem>({ type: 'stock_line_items' }, `stock_reservations/${_stockReservationId}/stock_line_item`, params, options) as unknown as StockLineItem\n\t}\n\n\tasync stock_transfer(stockReservationId: string | StockReservation, params?: QueryParamsRetrieve<StockTransfer>, options?: ResourcesConfig): Promise<StockTransfer> {\n\t\tconst _stockReservationId = (stockReservationId as StockReservation).id || stockReservationId as string\n\t\treturn this.resources.fetch<StockTransfer>({ type: 'stock_transfers' }, `stock_reservations/${_stockReservationId}/stock_transfer`, params, options) as unknown as StockTransfer\n\t}\n\n\tasync stock_item(stockReservationId: string | StockReservation, params?: QueryParamsRetrieve<StockItem>, options?: ResourcesConfig): Promise<StockItem> {\n\t\tconst _stockReservationId = (stockReservationId as StockReservation).id || stockReservationId as string\n\t\treturn this.resources.fetch<StockItem>({ type: 'stock_items' }, `stock_reservations/${_stockReservationId}/stock_item`, params, options) as unknown as StockItem\n\t}\n\n\tasync reserved_stock(stockReservationId: string | StockReservation, params?: QueryParamsRetrieve<ReservedStock>, options?: ResourcesConfig): Promise<ReservedStock> {\n\t\tconst _stockReservationId = (stockReservationId as StockReservation).id || stockReservationId as string\n\t\treturn this.resources.fetch<ReservedStock>({ type: 'reserved_stocks' }, `stock_reservations/${_stockReservationId}/reserved_stock`, params, options) as unknown as ReservedStock\n\t}\n\n\tasync sku(stockReservationId: string | StockReservation, params?: QueryParamsRetrieve<Sku>, options?: ResourcesConfig): Promise<Sku> {\n\t\tconst _stockReservationId = (stockReservationId as StockReservation).id || stockReservationId as string\n\t\treturn this.resources.fetch<Sku>({ type: 'skus' }, `stock_reservations/${_stockReservationId}/sku`, params, options) as unknown as Sku\n\t}\n\n\tasync _pending(id: string | StockReservation, params?: QueryParamsRetrieve<StockReservation>, options?: ResourcesConfig): Promise<StockReservation> {\n\t\treturn this.resources.update<StockReservationUpdate, StockReservation>({ id: (typeof id === 'string')? id: id.id, type: StockReservations.TYPE, _pending: true }, params, options)\n\t}\n\n\n\tisStockReservation(resource: any): resource is StockReservation {\n\t\treturn resource.type && (resource.type === StockReservations.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): StockReservationRel {\n\t\treturn super.relationshipOneToOne<StockReservationRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): StockReservationRel[] {\n\t\treturn super.relationshipOneToMany<StockReservationRel>(...ids)\n\t}\n\n\n\ttype(): StockReservationType {\n\t\treturn StockReservations.TYPE\n\t}\n\n}\n\n\nconst instance = new StockReservations()\nexport default instance\n\nexport type { StockReservations, StockReservation, StockReservationCreate, StockReservationUpdate, StockReservationType }\n"]}
|
1
|
+
{"version":3,"sources":["../src/resources/stock_reservations.ts"],"names":[],"mappings":";;;AAkFA,IAAM,iBAAA,GAAN,MAAM,kBAAA,SAA0B,WAAA,CAA8B;AAAA,EAE7D,OAAgB,IAAA,GAA6B,oBAAA;AAAA,EAE7C,MAAM,MAAA,CAAO,QAAA,EAAkC,MAAA,EAAgD,OAAA,EAAsD;AACpJ,IAAA,OAAO,IAAA,CAAK,SAAA,CAAU,MAAA,CAAiD,EAAE,GAAG,QAAA,EAAU,IAAA,EAAM,kBAAA,CAAkB,IAAA,EAAK,EAAG,MAAA,EAAQ,OAAO,CAAA;AAAA,EACtI;AAAA,EAEA,MAAM,MAAA,CAAO,QAAA,EAAkC,MAAA,EAAgD,OAAA,EAAsD;AACpJ,IAAA,OAAO,IAAA,CAAK,SAAA,CAAU,MAAA,CAAiD,EAAE,GAAG,QAAA,EAAU,IAAA,EAAM,kBAAA,CAAkB,IAAA,EAAK,EAAG,MAAA,EAAQ,OAAO,CAAA;AAAA,EACtI;AAAA,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,kBAAA,CAAkB,IAAA,EAAK,GAAI,IAAI,OAAO,CAAA;AAAA,EACzG;AAAA,EAEA,MAAM,SAAA,CAAU,kBAAA,EAA+C,MAAA,EAAwC,OAAA,EAA8C;AACpJ,IAAA,MAAM,mBAAA,GAAuB,mBAAwC,EAAA,IAAM,kBAAA;AAC3E,IAAA,OAAO,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AkB,IAAA;AAAA,EAC9D;AAAA,EAGA,aAAa,EAAA,EAAqD;AACjE,IAAA,OAAO,KAAA,CAAM,qBAA0C,EAAE,CAAA;AAAA,EAC1D;AAAA,EAEA,sBAAsB,GAAA,EAAsC;AAC3D,IAAA,OAAO,KAAA,CAAM,qBAAA,CAA2C,GAAG,GAAG,CAAA;AAAA,EAC/D;AAAA,EAGA,IAAA,GAA6B;AAC5B,IAAA,OAAO,kBAAA,CAAkB,IAAA;AAAA,EAC1B;AAED,CAAA;AAGA,IAAM,QAAA,GAAW,IAAI,iBAAA,EAAkB;AACvC,IAAO,0BAAA,GAAQ","file":"chunk-N4P7A3RY.js","sourcesContent":["import { ApiResource } from '../resource'\nimport type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ResourceSort, /* ResourceFilter */ } from '../resource'\nimport type { QueryParamsRetrieve } from '../query'\n\nimport type { LineItem } from './line_items'\nimport type { Order } from './orders'\nimport type { StockLineItem } from './stock_line_items'\nimport type { StockTransfer } from './stock_transfers'\nimport type { StockItem, StockItemType } from './stock_items'\nimport type { ReservedStock } from './reserved_stocks'\nimport type { Sku } from './skus'\n\n\ntype StockReservationType = 'stock_reservations'\ntype StockReservationRel = ResourceRel & { type: StockReservationType }\ntype StockItemRel = ResourceRel & { type: StockItemType }\n\n\nexport type StockReservationSort = Pick<StockReservation, 'id' | 'status' | 'quantity' | 'expires_at'> & ResourceSort\n// export type StockReservationFilter = Pick<StockReservation, 'id' | 'status' | 'quantity' | 'expires_at'> & ResourceFilter\n\n\ninterface StockReservation extends Resource {\n\t\n\treadonly type: StockReservationType\n\n\t/** \n\t * The stock reservation status. One of 'draft' (default), or 'pending'.\n\t * @example ```\"draft\"```\n\t */\n\tstatus: 'draft' | 'pending'\n\t/** \n\t * The stock reservation quantity.\n\t * @example ```4```\n\t */\n\tquantity: number\n\t/** \n\t * The expiration date/time of this stock reservation.\n\t * @example ```\"2018-01-02T12:00:00.000Z\"```\n\t */\n\texpires_at: string\n\n\tline_item?: LineItem | null\n\torder?: Order | null\n\tstock_line_item?: StockLineItem | null\n\tstock_transfer?: StockTransfer | null\n\tstock_item?: StockItem | null\n\treserved_stock?: ReservedStock | null\n\tsku?: Sku | null\n\n}\n\n\ninterface StockReservationCreate extends ResourceCreate {\n\t\n\t/** \n\t * The stock reservation quantity.\n\t * @example ```4```\n\t */\n\tquantity: number\n\n\tstock_item: StockItemRel\n\n}\n\n\ninterface StockReservationUpdate extends ResourceUpdate {\n\t\n\t/** \n\t * The stock reservation quantity.\n\t * @example ```4```\n\t */\n\tquantity?: number | null\n\t/** \n\t * Send this attribute if you want to mark this stock reservation as pending.\n\t * @example ```true```\n\t */\n\t_pending?: boolean | null\n\t\n}\n\n\nclass StockReservations extends ApiResource<StockReservation> {\n\n\tstatic readonly TYPE: StockReservationType = 'stock_reservations' as const\n\n\tasync create(resource: StockReservationCreate, params?: QueryParamsRetrieve<StockReservation>, options?: ResourcesConfig): Promise<StockReservation> {\n\t\treturn this.resources.create<StockReservationCreate, StockReservation>({ ...resource, type: StockReservations.TYPE }, params, options)\n\t}\n\n\tasync update(resource: StockReservationUpdate, params?: QueryParamsRetrieve<StockReservation>, options?: ResourcesConfig): Promise<StockReservation> {\n\t\treturn this.resources.update<StockReservationUpdate, StockReservation>({ ...resource, type: StockReservations.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: StockReservations.TYPE } : id, options)\n\t}\n\n\tasync line_item(stockReservationId: string | StockReservation, params?: QueryParamsRetrieve<LineItem>, options?: ResourcesConfig): Promise<LineItem> {\n\t\tconst _stockReservationId = (stockReservationId as StockReservation).id || stockReservationId as string\n\t\treturn this.resources.fetch<LineItem>({ type: 'line_items' }, `stock_reservations/${_stockReservationId}/line_item`, params, options) as unknown as LineItem\n\t}\n\n\tasync order(stockReservationId: string | StockReservation, params?: QueryParamsRetrieve<Order>, options?: ResourcesConfig): Promise<Order> {\n\t\tconst _stockReservationId = (stockReservationId as StockReservation).id || stockReservationId as string\n\t\treturn this.resources.fetch<Order>({ type: 'orders' }, `stock_reservations/${_stockReservationId}/order`, params, options) as unknown as Order\n\t}\n\n\tasync stock_line_item(stockReservationId: string | StockReservation, params?: QueryParamsRetrieve<StockLineItem>, options?: ResourcesConfig): Promise<StockLineItem> {\n\t\tconst _stockReservationId = (stockReservationId as StockReservation).id || stockReservationId as string\n\t\treturn this.resources.fetch<StockLineItem>({ type: 'stock_line_items' }, `stock_reservations/${_stockReservationId}/stock_line_item`, params, options) as unknown as StockLineItem\n\t}\n\n\tasync stock_transfer(stockReservationId: string | StockReservation, params?: QueryParamsRetrieve<StockTransfer>, options?: ResourcesConfig): Promise<StockTransfer> {\n\t\tconst _stockReservationId = (stockReservationId as StockReservation).id || stockReservationId as string\n\t\treturn this.resources.fetch<StockTransfer>({ type: 'stock_transfers' }, `stock_reservations/${_stockReservationId}/stock_transfer`, params, options) as unknown as StockTransfer\n\t}\n\n\tasync stock_item(stockReservationId: string | StockReservation, params?: QueryParamsRetrieve<StockItem>, options?: ResourcesConfig): Promise<StockItem> {\n\t\tconst _stockReservationId = (stockReservationId as StockReservation).id || stockReservationId as string\n\t\treturn this.resources.fetch<StockItem>({ type: 'stock_items' }, `stock_reservations/${_stockReservationId}/stock_item`, params, options) as unknown as StockItem\n\t}\n\n\tasync reserved_stock(stockReservationId: string | StockReservation, params?: QueryParamsRetrieve<ReservedStock>, options?: ResourcesConfig): Promise<ReservedStock> {\n\t\tconst _stockReservationId = (stockReservationId as StockReservation).id || stockReservationId as string\n\t\treturn this.resources.fetch<ReservedStock>({ type: 'reserved_stocks' }, `stock_reservations/${_stockReservationId}/reserved_stock`, params, options) as unknown as ReservedStock\n\t}\n\n\tasync sku(stockReservationId: string | StockReservation, params?: QueryParamsRetrieve<Sku>, options?: ResourcesConfig): Promise<Sku> {\n\t\tconst _stockReservationId = (stockReservationId as StockReservation).id || stockReservationId as string\n\t\treturn this.resources.fetch<Sku>({ type: 'skus' }, `stock_reservations/${_stockReservationId}/sku`, params, options) as unknown as Sku\n\t}\n\n\tasync _pending(id: string | StockReservation, params?: QueryParamsRetrieve<StockReservation>, options?: ResourcesConfig): Promise<StockReservation> {\n\t\treturn this.resources.update<StockReservationUpdate, StockReservation>({ id: (typeof id === 'string')? id: id.id, type: StockReservations.TYPE, _pending: true }, params, options)\n\t}\n\n\n\tisStockReservation(resource: any): resource is StockReservation {\n\t\treturn resource.type && (resource.type === StockReservations.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): StockReservationRel {\n\t\treturn super.relationshipOneToOne<StockReservationRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): StockReservationRel[] {\n\t\treturn super.relationshipOneToMany<StockReservationRel>(...ids)\n\t}\n\n\n\ttype(): StockReservationType {\n\t\treturn StockReservations.TYPE\n\t}\n\n}\n\n\nconst instance = new StockReservations()\nexport default instance\n\nexport type { StockReservations, StockReservation, StockReservationCreate, StockReservationUpdate, StockReservationType }\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/resource.ts","../src/jsonapi.ts"],"names":["debug","inc"],"mappings":";;;;;;;;AAYA,IAAM,KAAA,GAAQ,cAAM,UAAU,CAAA;AAoD9B,IAAM,YAAA,GAAN,cAA0D,KAAA,CAAS;AAAA,EAEzD,IAAA;AAAA,EAET,WAAA,CAAY,MAAgB,IAAA,EAAW;AACtC,IAAA,KAAA,CAAM,GAAI,IAAA,IAAQ,EAAG,CAAA;AACrB,IAAA,IAAA,CAAK,IAAA,GAAO,IAAA;AAAA;AACb,EAEA,KAAA,GAAuB;AAAE,IAAA,OAAO,IAAA,CAAK,MAAA,GAAS,IAAA,CAAK,CAAC,CAAA,GAAI,MAAA;AAAA;AAAU,EAClE,IAAA,GAAsB;AAAE,IAAA,OAAO,KAAK,MAAA,GAAS,IAAA,CAAK,IAAA,CAAK,MAAA,GAAS,CAAC,CAAA,GAAI,M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A;AACvE,IAAA,IAAI,MAAM,OAAA,CAAQ,KAAK,CAAA,IAAM,KAAA,CAAM,WAAW,CAAA,IAAM,cAAA,CAAe,KAAA,CAAM,CAAC,CAAC,CAAA,IAAO,KAAA,CAAM,CAAC,CAAA,CAAkB,OAAO,IAAA,EAAO;AACxH,MAAA,aAAA,CAAc,KAAK,CAAA,GAAI,EAAE,IAAA,EAAM,EAAC,EAAE;AAAA,eAG/B,KAAA,IAAS,cAAA,CAAe,KAAK,CAAA,IAAO,KAAA,CAAsB,OAAO,IAAA,EAAO;AAC3E,MAAA,aAAA,CAAc,KAAK,CAAA,GAAI,EAAE,IAAA,EAAM,IAAA,EAAK;AAAA,KACrC,MAAA,IAEI,KAAA,KAAU,YAAA,CAAa,KAAK,CAAA,IAAM,KAAA,CAAM,OAAA,CAAQ,KAAK,CAAA,IAAK,YAAA,CAAa,KAAA,CAAM,CAAC,CAAC,CAAA,CAAA,EAAK;AACvF,MAAA,aAAA,CAAc,KAAK,CAAA,GAAI,EAAE,IAAA,EAAM,KAAA,EAAkC;AAAA,KAClE,MACK,UAAA,CAAW,KAAK,CAAA,GAAI,KAAA;AAAA;AAG1B,EAAA,MAAM,UAAA,GAA4B;AAAA,IACjC,MAAM,QAAA,CAAS,IAAA;AAAA,IACf,UAAA;AAAA,IACA;AAAA,GACD;AAEA,EAAA,IAAI,YAAA,CAAa,QAAQ,CAAA,EAAG,UAAA,CAAW,KAAK,QAAA,CAAS,EAAA;AAErD,EAAAA,MAAAA,CAAM,2BAA2B,UAAU,CAAA;AAE3C,EAAA,OAAO,UAAA;AAER","file":"chunk-NAWKHFBZ.js","sourcesContent":["\nimport ApiClient, { type ApiClientInitConfig } from './client'\nimport { denormalize, normalize, type DocWithData } from './jsonapi'\nimport type { QueryParamsRetrieve, QueryParamsList, QueryFilter, QueryParams } from './query'\nimport { generateQueryStringParams, isParamsList } from './query'\nimport { type ResourceTypeLock, resourceList } from './enum'\nimport config from './config'\nimport { SdkError } from './error'\nimport type { ObjectType } from './types'\n\n\nimport Debug from './debug'\nconst debug = Debug('resource')\n\n\n\ntype ResourceNull = { id: null } & ResourceType\ntype ResourceRel = ResourceId | ResourceNull\n\n\ntype Metadata = ObjectType\n\n\ninterface ResourceType {\n\treadonly type: ResourceTypeLock\n}\n\n\ninterface ResourceId extends ResourceType {\n\treadonly id: string\n}\n\n\ninterface ResourceBase {\n\treference?: string | null\n\treference_origin?: string | null\n\tmetadata?: Metadata\n}\n\n\ninterface Resource extends ResourceBase, ResourceId {\n\treadonly created_at: string\n\treadonly updated_at: string\n}\n\n\ninterface ResourceCreate extends ResourceBase {\n\n}\n\n\ninterface ResourceUpdate extends ResourceBase {\n\treadonly id: string\n}\n\n\ntype ListMeta = {\n\treadonly pageCount: number\n\treadonly recordCount: number\n\treadonly currentPage: number\n\treadonly recordsPerPage: number\n}\n\n\nclass ListResponse<R extends Resource = Resource> extends Array<R> {\n\n\treadonly meta: ListMeta\n\n\tconstructor(meta: ListMeta, data: R[]) {\n\t\tsuper(...(data || []))\n\t\tthis.meta = meta\n\t}\n\n\tfirst(): R | undefined { return this.length ? this[0] : undefined }\n\tlast(): R | undefined { return this.length ? this[this.length - 1] : undefined }\n\tget(index: number): R | undefined { return (this.length && (index >= 0)) ? this[index] : undefined }\n\n\thasNextPage(): boolean { return (this.meta.currentPage < this.meta.pageCount) }\n\thasPrevPage(): boolean { return (this.meta.currentPage > 1) }\n\n\tgetRecordCount(): number { return this.meta.recordCount }\n\tgetPageCount(): number { return this.meta.pageCount }\n\tget recordCount(): number { return this.meta.recordCount }\n\tget pageCount(): number { return this.meta.pageCount }\n\n}\n\n\nexport type { Metadata, ResourceType, ResourceId, Resource, ResourceCreate, ResourceUpdate, ListResponse, ListMeta, ResourceRel }\n\nexport type ResourceSort = Pick<Resource, 'id' | 'reference' | 'reference_origin' | 'created_at' | 'updated_at'>\nexport type ResourceFilter = Pick<Resource, 'id' | 'reference' | 'reference_origin' | 'metadata' | 'created_at' | 'updated_at'>\n\n\n\n// Resource adapters local configuration\ntype ResourceAdapterConfig = {\n\t// xyz?: boolean\n}\n\nexport type ResourcesInitConfig = ResourceAdapterConfig & ApiClientInitConfig\nexport type ResourcesConfig = Partial<ResourcesInitConfig>\n\n\n\nclass ApiResourceAdapter {\n\n\tprivate static adapter: ResourceAdapter\n\n\n\tprivate constructor() { }\n\n\n\tstatic init(config: ResourcesInitConfig): ResourceAdapter {\n\t\tApiResourceAdapter.adapter = new ResourceAdapter(config)\n\t\tdebug('resource adapter initialized')\n\t\treturn ApiResourceAdapter.get()\n\t}\n\n\tstatic get(config?: ResourcesInitConfig): ResourceAdapter {\n\t\tif (config) return ApiResourceAdapter.init(config)\n\t\telse {\n\t\t\tif (ApiResourceAdapter.adapter) return ApiResourceAdapter.adapter\n\t\t\telse throw new SdkError({ message: 'Commerce Layer not initialized' })\n\t\t}\n\t}\n\n\tstatic config(config: ResourcesConfig): void {\n\t\tApiResourceAdapter.get().config(config)\n\t}\n\n}\n\n\n\nclass ResourceAdapter {\n\n\treadonly #client: ApiClient\n\n\treadonly #config: ResourceAdapterConfig = {}\n\n\tconstructor(config: ResourcesInitConfig) {\n\t\tthis.#client = ApiClient.create(config)\n\t\tthis.localConfig(config)\n\t}\n\n\n\tprivate localConfig(config: ResourceAdapterConfig): void {\n\t\tObject.assign(this.#config, config)\n\t}\n\n\n\tconfig(config: ResourcesConfig): this {\n\n\t\tdebug('config %o', config)\n\n\t\t// ResourceAdapter config\n\t\tthis.localConfig(config)\n\t\t// Client config\n\t\tthis.#client.config(config)\n\n\t\treturn this\n\n\t}\n\n\n\n\tget client(): Readonly<ApiClient> {\n\t\treturn this.#client\n\t}\n\n\n\n\tasync singleton<R extends Resource>(resource: ResourceType, params?: QueryParamsRetrieve<R>, options?: ResourcesConfig, path?: string): Promise<R> {\n\n\t\tdebug('singleton: %o, %O, %O', resource, params || {}, options || {})\n\n\t\tconst queryParams = generateQueryStringParams(params, resource)\n\t\tif (options?.params) Object.assign(queryParams, options?.params)\n\n\t\tconst res = await this.#client.request('GET', `${path || resource.type}`, undefined, { ...options, params: queryParams })\n\t\tconst r = denormalize<R>(res as DocWithData) as R\n\n\t\treturn r\n\n\t}\n\n\n\tasync retrieve<R extends Resource>(resource: ResourceId, params?: QueryParamsRetrieve<R>, options?: ResourcesConfig): Promise<R> {\n\n\t\tdebug('retrieve: %o, %O, %O', resource, params || {}, options || {})\n\n\t\tconst queryParams = generateQueryStringParams(params, resource)\n\t\tif (options?.params) Object.assign(queryParams, options?.params)\n\n\t\tconst res = await this.#client.request('GET', `${resource.type}/${resource.id}`, undefined, { ...options, params: queryParams })\n\t\tconst r = denormalize<R>(res as DocWithData) as R\n\n\t\treturn r\n\n\t}\n\n\n\tasync list<R extends Resource>(resource: ResourceType, params?: QueryParamsList<R>, options?: ResourcesConfig): Promise<ListResponse<R>> {\n\n\t\tdebug('list: %o, %O, %O', resource, params || {}, options || {})\n\n\t\tconst queryParams = generateQueryStringParams(params, resource)\n\t\tif (options?.params) Object.assign(queryParams, options?.params)\n\n\t\t// Load balancer performance optimization\n\t\tif (!queryParams['page[number]']) queryParams['page[number]'] = '1'\n\n\t\tconst res = await this.#client.request('GET', `${resource.type}`, undefined, { ...options, params: queryParams })\n\t\tconst r = denormalize<R>(res as DocWithData) as R[]\n\n\t\tconst meta: ListMeta = {\n\t\t\tpageCount: Number(res.meta?.page_count),\n\t\t\trecordCount: Number(res.meta?.record_count),\n\t\t\tcurrentPage: params?.pageNumber || config.default.pageNumber,\n\t\t\trecordsPerPage: params?.pageSize || config.default.pageSize\n\t\t}\n\n\t\treturn new ListResponse(meta, r)\n\n\t}\n\n\n\tasync create<C extends ResourceCreate, R extends Resource>(resource: C & ResourceType, params?: QueryParamsRetrieve<R>, options?: ResourcesConfig): Promise<R> {\n\n\t\tdebug('create: %o, %O, %O', resource, params || {}, options || {})\n\n\t\tconst queryParams = generateQueryStringParams<R>(params, resource)\n\t\tif (options?.params) Object.assign(queryParams, options?.params)\n\n\t\tconst data = normalize(resource)\n\t\tconst res = await this.#client.request('POST', resource.type, data, { ...options, params: queryParams })\n\t\tconst r = denormalize<R>(res as DocWithData) as R\n\n\t\treturn r\n\n\t}\n\n\n\tasync update<U extends ResourceUpdate, R extends Resource>(resource: U & ResourceId, params?: QueryParamsRetrieve<R>, options?: ResourcesConfig): Promise<R> {\n\n\t\tdebug('update: %o, %O, %O', resource, params || {}, options || {})\n\n\t\tconst queryParams = generateQueryStringParams<R>(params, resource)\n\t\tif (options?.params) Object.assign(queryParams, options?.params)\n\n\t\tconst data = normalize(resource)\n\t\tconst res = await this.#client.request('PATCH', `${resource.type}/${resource.id}`, data, { ...options, params: queryParams })\n\t\tconst r = denormalize<R>(res as DocWithData) as R\n\n\t\treturn r\n\n\t}\n\n\n\tasync delete(resource: ResourceId, options?: ResourcesConfig): Promise<void> {\n\t\tdebug('delete: %o, %O', resource, options || {})\n\t\tawait this.#client.request('DELETE', `${resource.type}/${resource.id}`, undefined, options)\n\t}\n\n\n\tasync fetch<R extends Resource>(resource: string | ResourceType, path: string, params?: QueryParams<R>, options?: ResourcesConfig): Promise<R | ListResponse<R>> {\n\n\t\tdebug('fetch: %o, %O, %O', path, params || {}, options || {})\n\n\t\tconst queryParams = generateQueryStringParams<R>(params, resource)\n\t\tif (options?.params) Object.assign(queryParams, options?.params)\n\n\t\tconst res = await this.#client.request('GET', path, undefined, { ...options, params: queryParams })\n\t\tconst r = denormalize<R>(res as DocWithData)\n\n\t\tif (Array.isArray(r)) {\n\t\t\tconst p = params as QueryParamsList<R>\n\t\t\tconst meta: ListMeta = {\n\t\t\t\tpageCount: Number(res.meta?.page_count),\n\t\t\t\trecordCount: Number(res.meta?.record_count),\n\t\t\t\tcurrentPage: p?.pageNumber || config.default.pageNumber,\n\t\t\t\trecordsPerPage: p?.pageSize || config.default.pageSize\n\t\t\t}\n\t\t\treturn new ListResponse(meta, r)\n\t\t}\n\t\telse return r\n\n\t}\n\n}\n\n\n\nabstract class ApiResourceBase<R extends Resource> {\n\n\tstatic readonly TYPE: ResourceTypeLock\n\t#resources?: ResourceAdapter\n\n\n\tconstructor(adapter?: ResourceAdapter) {\n\t\tdebug('new resource instance: %s', this.type())\n\t\tif (adapter) this.#resources = adapter\n\t}\n\n\n\tprotected get resources(): ResourceAdapter {\n\t\treturn this.#resources || ApiResourceAdapter.get()\n\t}\n\n\n\tabstract relationship(id: string | ResourceId | null): ResourceRel\n\n\n\tprotected relationshipOneToOne<RR extends ResourceRel>(id: string | ResourceId | null): RR {\n\t\treturn (((id === null) || (typeof id === 'string')) ? { id, type: this.type() } : { id: id.id, type: this.type() }) as RR\n\t}\n\n\tprotected relationshipOneToMany<RR extends ResourceRel>(...ids: string[]): RR[] {\n\t\treturn (((ids === null) || (ids.length === 0) || (ids[0] === null)) ? [{ id: null, type: this.type() }] : ids.map(id => { return { id, type: this.type() } })) as RR[]\n\t}\n\n\tabstract type(): ResourceTypeLock\n\n\tprotected path(): string {\n\t\treturn this.type()\n\t}\n\n\n\t// reference, reference_origin and metadata attributes are always updatable\n\tasync update(resource: ResourceUpdate, params?: QueryParamsRetrieve<R>, options?: ResourcesConfig): Promise<R> {\n\t\treturn this.resources.update<ResourceUpdate, R>({ ...resource, type: this.type() }, params, options)\n\t}\n\n}\n\n\nabstract class ApiResource<R extends Resource> extends ApiResourceBase<R> {\n\n\tasync retrieve(id: string | ResourceId, params?: QueryParamsRetrieve<R>, options?: ResourcesConfig): Promise<R> {\n\t\treturn this.resources.retrieve<R>((typeof id === 'string') ? { type: this.type(), id } : id, params, options)\n\t}\n\n\tasync list(params?: QueryParamsList<R>, options?: ResourcesConfig): Promise<ListResponse<R>> {\n\t\treturn this.resources.list<R>({ type: this.type() }, params, options)\n\t}\n\n\tasync count(filter?: QueryFilter | QueryParamsList<R>, options?: ResourcesConfig): Promise<number> {\n\t\tconst params: QueryParamsList<R> = { filters: isParamsList<R>(filter) ? filter.filters : filter, pageNumber: 1, pageSize: 1 }\n\t\tconst response = await this.list(params, options)\n\t\treturn Promise.resolve(response.meta.recordCount)\n\t}\n\n}\n\n\nabstract class ApiSingleton<R extends Resource> extends ApiResourceBase<R> {\n\n\tasync retrieve(params?: QueryParamsRetrieve<R>, options?: ResourcesConfig): Promise<R> {\n\t\treturn this.resources.singleton<R>({ type: this.type() }, params, options, this.path())\n\t}\n\n}\n\n\n\nexport { ApiResourceAdapter, ApiResource, ApiSingleton, type ResourceAdapter }\n\n\n\nexport const isResourceId = (resource: any): resource is ResourceId => {\n\treturn (resource?.type && resource.id) && resourceList.includes(resource.type as ResourceTypeLock)\n}\n\nexport const isResourceType = (resource: any): resource is ResourceType => {\n\treturn resource && (typeof resource.type !== 'undefined') && resource.type && resourceList.includes(resource.type as ResourceTypeLock)\n}\n","\nimport type { Value as JSONValue } from 'json-typescript'\nimport type { DocWithData, Included, ResourceIdentifierObject, ResourceObject as JSONAPIObject, AttributesObject, RelationshipsObject } from 'jsonapi-typescript'\nimport type { ResourceCreate, ResourceUpdate, ResourceId, ResourceType, Resource, ResourceRel } from './resource'\nimport { isResourceId, isResourceType } from './resource'\nimport config from './config'\n\nimport Debug from './debug'\nconst debug = Debug('jsonapi')\n\nexport type { DocWithData }\n\n\n\n// DENORMALIZATION\n\nconst denormalize = <R extends Resource>(response: DocWithData): R | R[] => {\n\n\tif (!response) return response\n\t\n\tlet denormalizedResponse\n\n\tif (response.links) delete response.links\n\n\tconst data = response.data\n\tconst included = response.included\n\n\tif (!data) denormalizedResponse = data\n\telse {\n\t\tif (Array.isArray(data)) denormalizedResponse = data.map(res => denormalizeResource<R>(res, included))\n\t\telse denormalizedResponse = denormalizeResource<R>(data, included)\n\t}\n\n\treturn denormalizedResponse\n\n}\n\n\nconst findIncluded = (rel: ResourceIdentifierObject, included: Included = []): JSONAPIObject | undefined => {\n\tconst inc = included.find(inc => {\n\t\treturn (rel.id === inc.id) && (rel.type === inc.type)\n\t})\n\treturn inc || rel\n}\n\n\nconst denormalizeResource = <T extends ResourceType>(res: any, included?: Included, chain: ResourceIdentifierObject[] = []): T => {\n\n\tdebug('denormalize resource: %O, %o', res, included || {})\n\n\tif (!res) return res\n\n\tconst resource = {\n\t\tid: res.id,\n\t\ttype: res.type,\n\t\t...res.attributes,\n\t}\n\n\tif (res.relationships) Object.keys(res.relationships as object).forEach(key => {\n\t\tconst rel: ResourceIdentifierObject = res.relationships[key].data\n\t\tif (rel) {\n\t\t\tif (chain.filter(r => (r.id === rel.id) && (r.type === rel.type)).length >= config.jsonapi.maxResourceIncluded) resource[key] = rel\n\t\t\telse {\n\t\t\t\tif (Array.isArray(rel)) resource[key] = rel.map((r: ResourceIdentifierObject) => denormalizeResource<ResourceType>(findIncluded(r, included), included, [...chain, r]))\n\t\t\t\telse resource[key] = denormalizeResource<ResourceType>(findIncluded(rel, included), included, [...chain, rel])\n\t\t\t}\n\t\t} else if (rel === null) resource[key] = null\n\t})\n\n\tdebug('denormalized resource: %O', resource)\n\n\treturn resource\n\n}\n\n\n// NORMALIZATION\n\nconst normalize = (resource: (ResourceCreate & ResourceType) | (ResourceUpdate & ResourceId)): JSONAPIObject => {\n\n\tdebug('normalize resource: %O', resource)\n\n\tconst attributes: AttributesObject = {}\n\tconst relationships: RelationshipsObject = {}\n\n\tfor (const field in resource) {\n\t\tif (['type', 'id'].includes(field)) continue\n\t\tconst value = resource[field as keyof (ResourceCreate | ResourceUpdate)]\n\t\tif (Array.isArray(value) && (value.length === 1) && isResourceType(value[0]) && ((value[0] as ResourceRel).id === null)) {\n\t\t\trelationships[field] = { data: [] }\n\t\t}\n\t\telse\n\t\tif (value && isResourceType(value) && ((value as ResourceRel).id === null)) {\n\t\t\trelationships[field] = { data: null }\n\t\t}\n\t\telse\n\t\tif (value && (isResourceId(value) || (Array.isArray(value) && isResourceId(value[0])))) {\n\t\t\trelationships[field] = { data: value as ResourceIdentifierObject }\n\t\t}\n\t\telse attributes[field] = value as JSONValue\n\t}\n\n\tconst normalized: JSONAPIObject = {\n\t\ttype: resource.type,\n\t\tattributes,\n\t\trelationships\n\t}\n\n\tif (isResourceId(resource)) normalized.id = resource.id\n\n\tdebug('normalized resource: %O', normalized)\n\n\treturn normalized\n\n}\n\n\n\nexport { denormalize, normalize }\n"]}
|
1
|
+
{"version":3,"sources":["../src/resource.ts","../src/jsonapi.ts"],"names":["debug","inc"],"mappings":";;;;;;;;AAYA,IAAM,KAAA,GAAQ,cAAM,UAAU,CAAA;AAoD9B,IAAM,YAAA,GAAN,cAA0D,KAAA,CAAS;AAAA,EAEzD,IAAA;AAAA,EAET,WAAA,CAAY,MAAgB,IAAA,EAAW;AACtC,IAAA,KAAA,CAAM,GAAI,IAAA,IAAQ,EAAG,CAAA;AACrB,IAAA,IAAA,CAAK,IAAA,GAAO,IAAA;AAAA,EACb;AAAA,EAEA,KAAA,GAAuB;AAAE,IAAA,OAAO,IAAA,CAAK,MAAA,GAAS,IAAA,CAAK,CAAC,CAAA,GAAI,MAAA;AAAA,EAAU;AAAA,EAClE,IAAA,GAAsB;AAAE,IAAA,OAAO,KAAK,MAAA,GAAS,IAAA,CAAK,IAAA,CAAK,MAAA,GAAS,CAAC,CAAA,GAAI,MAAA;AAAA,EAAU;AAAA,EAC/E,IAAI,KAAA,EAA8B;AAAE,IAAA,OAAQ,KAAK,MAAA,IAAW,KAAA,IAAS,CAAA,GAAM,IAAA,CAAK,KAAK,CAAA,GAAI,MAAA;AAAA,EAAU;AAAA,EAEnG,WAAA,GAAuB;AAAE,IAAA,OAAQ,IAAA,CAAK,IAAA,CAAK,WAAA,GAAc,IAAA,CAAK,IAAA,CAAK,SAAA;AAAA,EAAW;AAAA,EAC9E,WAAA,GAAuB;AAAE,IAAA,OAAQ,IAAA,CAAK,KAAK,WAAA,GAAc,CAAA;AAAA,EAAG;AAAA,EAE5D,cAAA,GAAyB;AAAE,IAAA,OAAO,KAAK,IAAA,CAAK,WAAA;AAAA,EAAY;AAAA,EACxD,YAAA,GAAuB;AAAE,IAAA,OAAO,KAAK,IAAA,CAAK,SAAA;AAAA,EAAU;AAAA,EACpD,IAAI,WAAA,GAAsB;A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O,IAAA,EAAO;AAC3E,MAAA,aAAA,CAAc,KAAK,CAAA,GAAI,EAAE,IAAA,EAAM,IAAA,EAAK;AAAA,IACrC,CAAA,MAAA,IAEI,KAAA,KAAU,YAAA,CAAa,KAAK,CAAA,IAAM,KAAA,CAAM,OAAA,CAAQ,KAAK,CAAA,IAAK,YAAA,CAAa,KAAA,CAAM,CAAC,CAAC,CAAA,CAAA,EAAK;AACvF,MAAA,aAAA,CAAc,KAAK,CAAA,GAAI,EAAE,IAAA,EAAM,KAAA,EAAkC;AAAA,IAClE,CAAA,MACK,UAAA,CAAW,KAAK,CAAA,GAAI,KAAA;AAAA,EAC1B;AAEA,EAAA,MAAM,UAAA,GAA4B;AAAA,IACjC,MAAM,QAAA,CAAS,IAAA;AAAA,IACf,UAAA;AAAA,IACA;AAAA,GACD;AAEA,EAAA,IAAI,YAAA,CAAa,QAAQ,CAAA,EAAG,UAAA,CAAW,KAAK,QAAA,CAAS,EAAA;AAErD,EAAAA,MAAAA,CAAM,2BAA2B,UAAU,CAAA;AAE3C,EAAA,OAAO,UAAA;AAER","file":"chunk-NAWKHFBZ.js","sourcesContent":["\nimport ApiClient, { type ApiClientInitConfig } from './client'\nimport { denormalize, normalize, type DocWithData } from './jsonapi'\nimport type { QueryParamsRetrieve, QueryParamsList, QueryFilter, QueryParams } from './query'\nimport { generateQueryStringParams, isParamsList } from './query'\nimport { type ResourceTypeLock, resourceList } from './enum'\nimport config from './config'\nimport { SdkError } from './error'\nimport type { ObjectType } from './types'\n\n\nimport Debug from './debug'\nconst debug = Debug('resource')\n\n\n\ntype ResourceNull = { id: null } & ResourceType\ntype ResourceRel = ResourceId | ResourceNull\n\n\ntype Metadata = ObjectType\n\n\ninterface ResourceType {\n\treadonly type: ResourceTypeLock\n}\n\n\ninterface ResourceId extends ResourceType {\n\treadonly id: string\n}\n\n\ninterface ResourceBase {\n\treference?: string | null\n\treference_origin?: string | null\n\tmetadata?: Metadata\n}\n\n\ninterface Resource extends ResourceBase, ResourceId {\n\treadonly created_at: string\n\treadonly updated_at: string\n}\n\n\ninterface ResourceCreate extends ResourceBase {\n\n}\n\n\ninterface ResourceUpdate extends ResourceBase {\n\treadonly id: string\n}\n\n\ntype ListMeta = {\n\treadonly pageCount: number\n\treadonly recordCount: number\n\treadonly currentPage: number\n\treadonly recordsPerPage: number\n}\n\n\nclass ListResponse<R extends Resource = Resource> extends Array<R> {\n\n\treadonly meta: ListMeta\n\n\tconstructor(meta: ListMeta, data: R[]) {\n\t\tsuper(...(data || []))\n\t\tthis.meta = meta\n\t}\n\n\tfirst(): R | undefined { return this.length ? this[0] : undefined }\n\tlast(): R | undefined { return this.length ? this[this.length - 1] : undefined }\n\tget(index: number): R | undefined { return (this.length && (index >= 0)) ? this[index] : undefined }\n\n\thasNextPage(): boolean { return (this.meta.currentPage < this.meta.pageCount) }\n\thasPrevPage(): boolean { return (this.meta.currentPage > 1) }\n\n\tgetRecordCount(): number { return this.meta.recordCount }\n\tgetPageCount(): number { return this.meta.pageCount }\n\tget recordCount(): number { return this.meta.recordCount }\n\tget pageCount(): number { return this.meta.pageCount }\n\n}\n\n\nexport type { Metadata, ResourceType, ResourceId, Resource, ResourceCreate, ResourceUpdate, ListResponse, ListMeta, ResourceRel }\n\nexport type ResourceSort = Pick<Resource, 'id' | 'reference' | 'reference_origin' | 'created_at' | 'updated_at'>\nexport type ResourceFilter = Pick<Resource, 'id' | 'reference' | 'reference_origin' | 'metadata' | 'created_at' | 'updated_at'>\n\n\n\n// Resource adapters local configuration\ntype ResourceAdapterConfig = {\n\t// xyz?: boolean\n}\n\nexport type ResourcesInitConfig = ResourceAdapterConfig & ApiClientInitConfig\nexport type ResourcesConfig = Partial<ResourcesInitConfig>\n\n\n\nclass ApiResourceAdapter {\n\n\tprivate static adapter: ResourceAdapter\n\n\n\tprivate constructor() { }\n\n\n\tstatic init(config: ResourcesInitConfig): ResourceAdapter {\n\t\tApiResourceAdapter.adapter = new ResourceAdapter(config)\n\t\tdebug('resource adapter initialized')\n\t\treturn ApiResourceAdapter.get()\n\t}\n\n\tstatic get(config?: ResourcesInitConfig): ResourceAdapter {\n\t\tif (config) return ApiResourceAdapter.init(config)\n\t\telse {\n\t\t\tif (ApiResourceAdapter.adapter) return ApiResourceAdapter.adapter\n\t\t\telse throw new SdkError({ message: 'Commerce Layer not initialized' })\n\t\t}\n\t}\n\n\tstatic config(config: ResourcesConfig): void {\n\t\tApiResourceAdapter.get().config(config)\n\t}\n\n}\n\n\n\nclass ResourceAdapter {\n\n\treadonly #client: ApiClient\n\n\treadonly #config: ResourceAdapterConfig = {}\n\n\tconstructor(config: ResourcesInitConfig) {\n\t\tthis.#client = ApiClient.create(config)\n\t\tthis.localConfig(config)\n\t}\n\n\n\tprivate localConfig(config: ResourceAdapterConfig): void {\n\t\tObject.assign(this.#config, config)\n\t}\n\n\n\tconfig(config: ResourcesConfig): this {\n\n\t\tdebug('config %o', config)\n\n\t\t// ResourceAdapter config\n\t\tthis.localConfig(config)\n\t\t// Client config\n\t\tthis.#client.config(config)\n\n\t\treturn this\n\n\t}\n\n\n\n\tget client(): Readonly<ApiClient> {\n\t\treturn this.#client\n\t}\n\n\n\n\tasync singleton<R extends Resource>(resource: ResourceType, params?: QueryParamsRetrieve<R>, options?: ResourcesConfig, path?: string): Promise<R> {\n\n\t\tdebug('singleton: %o, %O, %O', resource, params || {}, options || {})\n\n\t\tconst queryParams = generateQueryStringParams(params, resource)\n\t\tif (options?.params) Object.assign(queryParams, options?.params)\n\n\t\tconst res = await this.#client.request('GET', `${path || resource.type}`, undefined, { ...options, params: queryParams })\n\t\tconst r = denormalize<R>(res as DocWithData) as R\n\n\t\treturn r\n\n\t}\n\n\n\tasync retrieve<R extends Resource>(resource: ResourceId, params?: QueryParamsRetrieve<R>, options?: ResourcesConfig): Promise<R> {\n\n\t\tdebug('retrieve: %o, %O, %O', resource, params || {}, options || {})\n\n\t\tconst queryParams = generateQueryStringParams(params, resource)\n\t\tif (options?.params) Object.assign(queryParams, options?.params)\n\n\t\tconst res = await this.#client.request('GET', `${resource.type}/${resource.id}`, undefined, { ...options, params: queryParams })\n\t\tconst r = denormalize<R>(res as DocWithData) as R\n\n\t\treturn r\n\n\t}\n\n\n\tasync list<R extends Resource>(resource: ResourceType, params?: QueryParamsList<R>, options?: ResourcesConfig): Promise<ListResponse<R>> {\n\n\t\tdebug('list: %o, %O, %O', resource, params || {}, options || {})\n\n\t\tconst queryParams = generateQueryStringParams(params, resource)\n\t\tif (options?.params) Object.assign(queryParams, options?.params)\n\n\t\t// Load balancer performance optimization\n\t\tif (!queryParams['page[number]']) queryParams['page[number]'] = '1'\n\n\t\tconst res = await this.#client.request('GET', `${resource.type}`, undefined, { ...options, params: queryParams })\n\t\tconst r = denormalize<R>(res as DocWithData) as R[]\n\n\t\tconst meta: ListMeta = {\n\t\t\tpageCount: Number(res.meta?.page_count),\n\t\t\trecordCount: Number(res.meta?.record_count),\n\t\t\tcurrentPage: params?.pageNumber || config.default.pageNumber,\n\t\t\trecordsPerPage: params?.pageSize || config.default.pageSize\n\t\t}\n\n\t\treturn new ListResponse(meta, r)\n\n\t}\n\n\n\tasync create<C extends ResourceCreate, R extends Resource>(resource: C & ResourceType, params?: QueryParamsRetrieve<R>, options?: ResourcesConfig): Promise<R> {\n\n\t\tdebug('create: %o, %O, %O', resource, params || {}, options || {})\n\n\t\tconst queryParams = generateQueryStringParams<R>(params, resource)\n\t\tif (options?.params) Object.assign(queryParams, options?.params)\n\n\t\tconst data = normalize(resource)\n\t\tconst res = await this.#client.request('POST', resource.type, data, { ...options, params: queryParams })\n\t\tconst r = denormalize<R>(res as DocWithData) as R\n\n\t\treturn r\n\n\t}\n\n\n\tasync update<U extends ResourceUpdate, R extends Resource>(resource: U & ResourceId, params?: QueryParamsRetrieve<R>, options?: ResourcesConfig): Promise<R> {\n\n\t\tdebug('update: %o, %O, %O', resource, params || {}, options || {})\n\n\t\tconst queryParams = generateQueryStringParams<R>(params, resource)\n\t\tif (options?.params) Object.assign(queryParams, options?.params)\n\n\t\tconst data = normalize(resource)\n\t\tconst res = await this.#client.request('PATCH', `${resource.type}/${resource.id}`, data, { ...options, params: queryParams })\n\t\tconst r = denormalize<R>(res as DocWithData) as R\n\n\t\treturn r\n\n\t}\n\n\n\tasync delete(resource: ResourceId, options?: ResourcesConfig): Promise<void> {\n\t\tdebug('delete: %o, %O', resource, options || {})\n\t\tawait this.#client.request('DELETE', `${resource.type}/${resource.id}`, undefined, options)\n\t}\n\n\n\tasync fetch<R extends Resource>(resource: string | ResourceType, path: string, params?: QueryParams<R>, options?: ResourcesConfig): Promise<R | ListResponse<R>> {\n\n\t\tdebug('fetch: %o, %O, %O', path, params || {}, options || {})\n\n\t\tconst queryParams = generateQueryStringParams<R>(params, resource)\n\t\tif (options?.params) Object.assign(queryParams, options?.params)\n\n\t\tconst res = await this.#client.request('GET', path, undefined, { ...options, params: queryParams })\n\t\tconst r = denormalize<R>(res as DocWithData)\n\n\t\tif (Array.isArray(r)) {\n\t\t\tconst p = params as QueryParamsList<R>\n\t\t\tconst meta: ListMeta = {\n\t\t\t\tpageCount: Number(res.meta?.page_count),\n\t\t\t\trecordCount: Number(res.meta?.record_count),\n\t\t\t\tcurrentPage: p?.pageNumber || config.default.pageNumber,\n\t\t\t\trecordsPerPage: p?.pageSize || config.default.pageSize\n\t\t\t}\n\t\t\treturn new ListResponse(meta, r)\n\t\t}\n\t\telse return r\n\n\t}\n\n}\n\n\n\nabstract class ApiResourceBase<R extends Resource> {\n\n\tstatic readonly TYPE: ResourceTypeLock\n\t#resources?: ResourceAdapter\n\n\n\tconstructor(adapter?: ResourceAdapter) {\n\t\tdebug('new resource instance: %s', this.type())\n\t\tif (adapter) this.#resources = adapter\n\t}\n\n\n\tprotected get resources(): ResourceAdapter {\n\t\treturn this.#resources || ApiResourceAdapter.get()\n\t}\n\n\n\tabstract relationship(id: string | ResourceId | null): ResourceRel\n\n\n\tprotected relationshipOneToOne<RR extends ResourceRel>(id: string | ResourceId | null): RR {\n\t\treturn (((id === null) || (typeof id === 'string')) ? { id, type: this.type() } : { id: id.id, type: this.type() }) as RR\n\t}\n\n\tprotected relationshipOneToMany<RR extends ResourceRel>(...ids: string[]): RR[] {\n\t\treturn (((ids === null) || (ids.length === 0) || (ids[0] === null)) ? [{ id: null, type: this.type() }] : ids.map(id => { return { id, type: this.type() } })) as RR[]\n\t}\n\n\tabstract type(): ResourceTypeLock\n\n\tprotected path(): string {\n\t\treturn this.type()\n\t}\n\n\n\t// reference, reference_origin and metadata attributes are always updatable\n\tasync update(resource: ResourceUpdate, params?: QueryParamsRetrieve<R>, options?: ResourcesConfig): Promise<R> {\n\t\treturn this.resources.update<ResourceUpdate, R>({ ...resource, type: this.type() }, params, options)\n\t}\n\n}\n\n\nabstract class ApiResource<R extends Resource> extends ApiResourceBase<R> {\n\n\tasync retrieve(id: string | ResourceId, params?: QueryParamsRetrieve<R>, options?: ResourcesConfig): Promise<R> {\n\t\treturn this.resources.retrieve<R>((typeof id === 'string') ? { type: this.type(), id } : id, params, options)\n\t}\n\n\tasync list(params?: QueryParamsList<R>, options?: ResourcesConfig): Promise<ListResponse<R>> {\n\t\treturn this.resources.list<R>({ type: this.type() }, params, options)\n\t}\n\n\tasync count(filter?: QueryFilter | QueryParamsList<R>, options?: ResourcesConfig): Promise<number> {\n\t\tconst params: QueryParamsList<R> = { filters: isParamsList<R>(filter) ? filter.filters : filter, pageNumber: 1, pageSize: 1 }\n\t\tconst response = await this.list(params, options)\n\t\treturn Promise.resolve(response.meta.recordCount)\n\t}\n\n}\n\n\nabstract class ApiSingleton<R extends Resource> extends ApiResourceBase<R> {\n\n\tasync retrieve(params?: QueryParamsRetrieve<R>, options?: ResourcesConfig): Promise<R> {\n\t\treturn this.resources.singleton<R>({ type: this.type() }, params, options, this.path())\n\t}\n\n}\n\n\n\nexport { ApiResourceAdapter, ApiResource, ApiSingleton, type ResourceAdapter }\n\n\n\nexport const isResourceId = (resource: any): resource is ResourceId => {\n\treturn (resource?.type && resource.id) && resourceList.includes(resource.type as ResourceTypeLock)\n}\n\nexport const isResourceType = (resource: any): resource is ResourceType => {\n\treturn resource && (typeof resource.type !== 'undefined') && resource.type && resourceList.includes(resource.type as ResourceTypeLock)\n}\n","\nimport type { Value as JSONValue } from 'json-typescript'\nimport type { DocWithData, Included, ResourceIdentifierObject, ResourceObject as JSONAPIObject, AttributesObject, RelationshipsObject } from 'jsonapi-typescript'\nimport type { ResourceCreate, ResourceUpdate, ResourceId, ResourceType, Resource, ResourceRel } from './resource'\nimport { isResourceId, isResourceType } from './resource'\nimport config from './config'\n\nimport Debug from './debug'\nconst debug = Debug('jsonapi')\n\nexport type { DocWithData }\n\n\n\n// DENORMALIZATION\n\nconst denormalize = <R extends Resource>(response: DocWithData): R | R[] => {\n\n\tif (!response) return response\n\t\n\tlet denormalizedResponse\n\n\tif (response.links) delete response.links\n\n\tconst data = response.data\n\tconst included = response.included\n\n\tif (!data) denormalizedResponse = data\n\telse {\n\t\tif (Array.isArray(data)) denormalizedResponse = data.map(res => denormalizeResource<R>(res, included))\n\t\telse denormalizedResponse = denormalizeResource<R>(data, included)\n\t}\n\n\treturn denormalizedResponse\n\n}\n\n\nconst findIncluded = (rel: ResourceIdentifierObject, included: Included = []): JSONAPIObject | undefined => {\n\tconst inc = included.find(inc => {\n\t\treturn (rel.id === inc.id) && (rel.type === inc.type)\n\t})\n\treturn inc || rel\n}\n\n\nconst denormalizeResource = <T extends ResourceType>(res: any, included?: Included, chain: ResourceIdentifierObject[] = []): T => {\n\n\tdebug('denormalize resource: %O, %o', res, included || {})\n\n\tif (!res) return res\n\n\tconst resource = {\n\t\tid: res.id,\n\t\ttype: res.type,\n\t\t...res.attributes,\n\t}\n\n\tif (res.relationships) Object.keys(res.relationships as object).forEach(key => {\n\t\tconst rel: ResourceIdentifierObject = res.relationships[key].data\n\t\tif (rel) {\n\t\t\tif (chain.filter(r => (r.id === rel.id) && (r.type === rel.type)).length >= config.jsonapi.maxResourceIncluded) resource[key] = rel\n\t\t\telse {\n\t\t\t\tif (Array.isArray(rel)) resource[key] = rel.map((r: ResourceIdentifierObject) => denormalizeResource<ResourceType>(findIncluded(r, included), included, [...chain, r]))\n\t\t\t\telse resource[key] = denormalizeResource<ResourceType>(findIncluded(rel, included), included, [...chain, rel])\n\t\t\t}\n\t\t} else if (rel === null) resource[key] = null\n\t})\n\n\tdebug('denormalized resource: %O', resource)\n\n\treturn resource\n\n}\n\n\n// NORMALIZATION\n\nconst normalize = (resource: (ResourceCreate & ResourceType) | (ResourceUpdate & ResourceId)): JSONAPIObject => {\n\n\tdebug('normalize resource: %O', resource)\n\n\tconst attributes: AttributesObject = {}\n\tconst relationships: RelationshipsObject = {}\n\n\tfor (const field in resource) {\n\t\tif (['type', 'id'].includes(field)) continue\n\t\tconst value = resource[field as keyof (ResourceCreate | ResourceUpdate)]\n\t\tif (Array.isArray(value) && (value.length === 1) && isResourceType(value[0]) && ((value[0] as ResourceRel).id === null)) {\n\t\t\trelationships[field] = { data: [] }\n\t\t}\n\t\telse\n\t\tif (value && isResourceType(value) && ((value as ResourceRel).id === null)) {\n\t\t\trelationships[field] = { data: null }\n\t\t}\n\t\telse\n\t\tif (value && (isResourceId(value) || (Array.isArray(value) && isResourceId(value[0])))) {\n\t\t\trelationships[field] = { data: value as ResourceIdentifierObject }\n\t\t}\n\t\telse attributes[field] = value as JSONValue\n\t}\n\n\tconst normalized: JSONAPIObject = {\n\t\ttype: resource.type,\n\t\tattributes,\n\t\trelationships\n\t}\n\n\tif (isResourceId(resource)) normalized.id = resource.id\n\n\tdebug('normalized resource: %O', normalized)\n\n\treturn normalized\n\n}\n\n\n\nexport { denormalize, normalize }\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/resources/satispay_gateways.ts"],"names":["ApiResource"],"mappings":";;;;;AAiFA,IAAM,gBAAA,GAAN,MAAM,iBAAA,SAAyBA,6BAAA,CAA6B;AAAA,EAE3D,OAAgB,IAAA,GAA4B,mBAAA;AAAA,EAE5C,MAAM,MAAA,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GA,IAAM,QAAA,GAAW,IAAI,gBAAA,EAAiB;AACtC,IAAO,yBAAA,GAAQ","file":"chunk-NBYV35R4.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 { PaymentMethod } from './payment_methods'\nimport type { Version } from './versions'\nimport type { SatispayPayment, SatispayPaymentType } from './satispay_payments'\n\n\ntype SatispayGatewayType = 'satispay_gateways'\ntype SatispayGatewayRel = ResourceRel & { type: SatispayGatewayType }\ntype SatispayPaymentRel = ResourceRel & { type: SatispayPaymentType }\n\n\nexport type SatispayGatewaySort = Pick<SatispayGateway, 'id' | 'name'> & ResourceSort\n// export type SatispayGatewayFilter = Pick<SatispayGateway, 'id' | 'name'> & ResourceFilter\n\n\ninterface SatispayGateway extends Resource {\n\t\n\treadonly type: SatispayGatewayType\n\n\t/** \n\t * The payment gateway's internal name.\n\t * @example ```\"US payment gateway\"```\n\t */\n\tname: string\n\t/** \n\t * Activation code generated from the Satispay Dashboard.\n\t * @example ```\"623ECX\"```\n\t */\n\ttoken: string\n\t/** \n\t * The Satispay API key auto generated basing on activation code.\n\t * @example ```\"xxxx-yyyy-zzzz\"```\n\t */\n\tkey_id: string\n\t/** \n\t * The gateway webhook URL, generated automatically.\n\t * @example ```\"https://core.commercelayer.co/webhook_callbacks/satispay_gateways/xxxxx\"```\n\t */\n\twebhook_endpoint_url?: string | null\n\n\tpayment_methods?: PaymentMethod[] | null\n\tversions?: Version[] | null\n\tsatispay_payments?: SatispayPayment[] | null\n\n}\n\n\ninterface SatispayGatewayCreate extends ResourceCreate {\n\t\n\t/** \n\t * The payment gateway's internal name.\n\t * @example ```\"US payment gateway\"```\n\t */\n\tname: string\n\t/** \n\t * Activation code generated from the Satispay Dashboard.\n\t * @example ```\"623ECX\"```\n\t */\n\ttoken: string\n\n\tsatispay_payments?: SatispayPaymentRel[] | null\n\n}\n\n\ninterface SatispayGatewayUpdate extends ResourceUpdate {\n\t\n\t/** \n\t * The payment gateway's internal name.\n\t * @example ```\"US payment gateway\"```\n\t */\n\tname?: string | null\n\n\tsatispay_payments?: SatispayPaymentRel[] | null\n\n}\n\n\nclass SatispayGateways extends ApiResource<SatispayGateway> {\n\n\tstatic readonly TYPE: SatispayGatewayType = 'satispay_gateways' as const\n\n\tasync create(resource: SatispayGatewayCreate, params?: QueryParamsRetrieve<SatispayGateway>, options?: ResourcesConfig): Promise<SatispayGateway> {\n\t\treturn this.resources.create<SatispayGatewayCreate, SatispayGateway>({ ...resource, type: SatispayGateways.TYPE }, params, options)\n\t}\n\n\tasync update(resource: SatispayGatewayUpdate, params?: QueryParamsRetrieve<SatispayGateway>, options?: ResourcesConfig): Promise<SatispayGateway> {\n\t\treturn this.resources.update<SatispayGatewayUpdate, SatispayGateway>({ ...resource, type: SatispayGateways.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: SatispayGateways.TYPE } : id, options)\n\t}\n\n\tasync payment_methods(satispayGatewayId: string | SatispayGateway, params?: QueryParamsList<PaymentMethod>, options?: ResourcesConfig): Promise<ListResponse<PaymentMethod>> {\n\t\tconst _satispayGatewayId = (satispayGatewayId as SatispayGateway).id || satispayGatewayId as string\n\t\treturn this.resources.fetch<PaymentMethod>({ type: 'payment_methods' }, `satispay_gateways/${_satispayGatewayId}/payment_methods`, params, options) as unknown as ListResponse<PaymentMethod>\n\t}\n\n\tasync versions(satispayGatewayId: string | SatispayGateway, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>> {\n\t\tconst _satispayGatewayId = (satispayGatewayId as SatispayGateway).id || satispayGatewayId as string\n\t\treturn this.resources.fetch<Version>({ type: 'versions' }, `satispay_gateways/${_satispayGatewayId}/versions`, params, options) as unknown as ListResponse<Version>\n\t}\n\n\tasync satispay_payments(satispayGatewayId: string | SatispayGateway, params?: QueryParamsList<SatispayPayment>, options?: ResourcesConfig): Promise<ListResponse<SatispayPayment>> {\n\t\tconst _satispayGatewayId = (satispayGatewayId as SatispayGateway).id || satispayGatewayId as string\n\t\treturn this.resources.fetch<SatispayPayment>({ type: 'satispay_payments' }, `satispay_gateways/${_satispayGatewayId}/satispay_payments`, params, options) as unknown as ListResponse<SatispayPayment>\n\t}\n\n\n\tisSatispayGateway(resource: any): resource is SatispayGateway {\n\t\treturn resource.type && (resource.type === SatispayGateways.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): SatispayGatewayRel {\n\t\treturn super.relationshipOneToOne<SatispayGatewayRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): SatispayGatewayRel[] {\n\t\treturn super.relationshipOneToMany<SatispayGatewayRel>(...ids)\n\t}\n\n\n\ttype(): SatispayGatewayType {\n\t\treturn SatispayGateways.TYPE\n\t}\n\n}\n\n\nconst instance = new SatispayGateways()\nexport default instance\n\nexport type { SatispayGateways, SatispayGateway, SatispayGatewayCreate, SatispayGatewayUpdate, SatispayGatewayType }\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/resources/adyen_gateways.ts"],"names":[],"mappings":";;;AAuLA,IAAM,aAAA,GAAN,MAAM,cAAA,SAAsB,WAAA,CAA0B;AAAA,EAErD,OAAgB,IAAA,GAAyB,gBAAA;AAAA,EAEzC,MAAM,MAAA,CAAO,QAAA,EAA8B,MAAA,EAA4C,OAAA,EAAkD;AACxI,IAAA,OAAO,IAAA,CAAK,SAAA,CAAU,MAAA,CAAyC,EAAE,GAAG,QAAA,EAAU,IAAA,EAAM,cAAA,CAAc,IAAA,EAAK,EAAG,MAAA,EAAQ,OAAO,CAAA;AAAA;AAC1H,EAEA,MAAM,MAAA,CAAO,QAAA,EAA8B,MAAA,EAA4C,OAAA,EAAkD;AACxI,IAAA,OAAO,IAAA,CAAK,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AA,EAAQ,OAAO,CAAA;AAAA;AAC1I,EAGA,eAAe,QAAA,EAAyC;AACvD,IAAA,OAAO,QAAA,CAAS,IAAA,IAAS,QAAA,CAAS,IAAA,KAAS,cAAA,CAAc,IAAA;AAAA;AAC1D,EAGA,aAAa,EAAA,EAAiD;AAC7D,IAAA,OAAO,KAAA,CAAM,qBAAsC,EAAE,CAAA;AAAA;AACtD,EAEA,sBAAsB,GAAA,EAAkC;AACvD,IAAA,OAAO,KAAA,CAAM,qBAAA,CAAuC,GAAG,GAAG,CAAA;AAAA;AAC3D,EAGA,IAAA,GAAyB;AACxB,IAAA,OAAO,cAAA,CAAc,IAAA;AAAA;AAGvB,CAAA;AAGA,IAAM,QAAA,GAAW,IAAI,aAAA,EAAc;AACnC,IAAO,sBAAA,GAAQ","file":"chunk-NDPDO54G.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 { PaymentMethod } from './payment_methods'\nimport type { Version } from './versions'\nimport type { AdyenPayment, AdyenPaymentType } from './adyen_payments'\n\n\ntype AdyenGatewayType = 'adyen_gateways'\ntype AdyenGatewayRel = ResourceRel & { type: AdyenGatewayType }\ntype AdyenPaymentRel = ResourceRel & { type: AdyenPaymentType }\n\n\nexport type AdyenGatewaySort = Pick<AdyenGateway, 'id' | 'name'> & ResourceSort\n// export type AdyenGatewayFilter = Pick<AdyenGateway, 'id' | 'name'> & ResourceFilter\n\n\ninterface AdyenGateway extends Resource {\n\t\n\treadonly type: AdyenGatewayType\n\n\t/** \n\t * The payment gateway's internal name.\n\t * @example ```\"US payment gateway\"```\n\t */\n\tname: string\n\t/** \n\t * The prefix of the endpoint used for live transactions.\n\t * @example ```\"1797a841fbb37ca7-AdyenDemo\"```\n\t */\n\tlive_url_prefix: string\n\t/** \n\t * The checkout API version, supported range is from 66 to 71, default is 71.\n\t * @example ```71```\n\t */\n\tapi_version?: number | null\n\t/** \n\t * Indicates if the gateway will leverage on the Adyen notification webhooks, using latest API version.\n\t * @example ```true```\n\t */\n\tasync_api?: boolean | null\n\t/** \n\t * Send this attribute if you want to enable partial payments for the order.\n\t */\n\tpartial_payments?: boolean | null\n\t/** \n\t * Indicates if the gateway will use the native customer payment sources.\n\t * @example ```true```\n\t */\n\tnative_customer_payment_sources?: boolean | null\n\t/** \n\t * The gateway webhook endpoint secret, generated by Adyen customer area.\n\t * @example ```\"xxxx-yyyy-zzzz\"```\n\t */\n\twebhook_endpoint_secret?: string | null\n\t/** \n\t * The gateway webhook URL, generated automatically.\n\t * @example ```\"https://core.commercelayer.co/webhook_callbacks/adyen_gateways/xxxxx\"```\n\t */\n\twebhook_endpoint_url?: string | null\n\n\tpayment_methods?: PaymentMethod[] | null\n\tversions?: Version[] | null\n\tadyen_payments?: AdyenPayment[] | null\n\n}\n\n\ninterface AdyenGatewayCreate extends ResourceCreate {\n\t\n\t/** \n\t * The payment gateway's internal name.\n\t * @example ```\"US payment gateway\"```\n\t */\n\tname: string\n\t/** \n\t * The gateway merchant account.\n\t * @example ```\"xxxx-yyyy-zzzz\"```\n\t */\n\tmerchant_account: string\n\t/** \n\t * The gateway API key.\n\t * @example ```\"xxxx-yyyy-zzzz\"```\n\t */\n\tapi_key: string\n\t/** \n\t * The public key linked to your API credential.\n\t * @example ```\"xxxx-yyyy-zzzz\"```\n\t */\n\tpublic_key?: string | null\n\t/** \n\t * The prefix of the endpoint used for live transactions.\n\t * @example ```\"1797a841fbb37ca7-AdyenDemo\"```\n\t */\n\tlive_url_prefix: string\n\t/** \n\t * The checkout API version, supported range is from 66 to 71, default is 71.\n\t * @example ```71```\n\t */\n\tapi_version?: number | null\n\t/** \n\t * Indicates if the gateway will leverage on the Adyen notification webhooks, using latest API version.\n\t * @example ```true```\n\t */\n\tasync_api?: boolean | null\n\t/** \n\t * Send this attribute if you want to enable partial payments for the order.\n\t */\n\tpartial_payments?: boolean | null\n\t/** \n\t * Indicates if the gateway will use the native customer payment sources.\n\t * @example ```true```\n\t */\n\tnative_customer_payment_sources?: boolean | null\n\t/** \n\t * The gateway webhook endpoint secret, generated by Adyen customer area.\n\t * @example ```\"xxxx-yyyy-zzzz\"```\n\t */\n\twebhook_endpoint_secret?: string | null\n\n\tadyen_payments?: AdyenPaymentRel[] | null\n\n}\n\n\ninterface AdyenGatewayUpdate extends ResourceUpdate {\n\t\n\t/** \n\t * The payment gateway's internal name.\n\t * @example ```\"US payment gateway\"```\n\t */\n\tname?: string | null\n\t/** \n\t * The gateway merchant account.\n\t * @example ```\"xxxx-yyyy-zzzz\"```\n\t */\n\tmerchant_account?: string | null\n\t/** \n\t * The gateway API key.\n\t * @example ```\"xxxx-yyyy-zzzz\"```\n\t */\n\tapi_key?: string | null\n\t/** \n\t * The public key linked to your API credential.\n\t * @example ```\"xxxx-yyyy-zzzz\"```\n\t */\n\tpublic_key?: string | null\n\t/** \n\t * The prefix of the endpoint used for live transactions.\n\t * @example ```\"1797a841fbb37ca7-AdyenDemo\"```\n\t */\n\tlive_url_prefix?: string | null\n\t/** \n\t * The checkout API version, supported range is from 66 to 71, default is 71.\n\t * @example ```71```\n\t */\n\tapi_version?: number | null\n\t/** \n\t * Indicates if the gateway will leverage on the Adyen notification webhooks, using latest API version.\n\t * @example ```true```\n\t */\n\tasync_api?: boolean | null\n\t/** \n\t * Send this attribute if you want to enable partial payments for the order.\n\t */\n\tpartial_payments?: boolean | null\n\t/** \n\t * Indicates if the gateway will use the native customer payment sources.\n\t * @example ```true```\n\t */\n\tnative_customer_payment_sources?: boolean | null\n\t/** \n\t * The gateway webhook endpoint secret, generated by Adyen customer area.\n\t * @example ```\"xxxx-yyyy-zzzz\"```\n\t */\n\twebhook_endpoint_secret?: string | null\n\n\tadyen_payments?: AdyenPaymentRel[] | null\n\n}\n\n\nclass AdyenGateways extends ApiResource<AdyenGateway> {\n\n\tstatic readonly TYPE: AdyenGatewayType = 'adyen_gateways' as const\n\n\tasync create(resource: AdyenGatewayCreate, params?: QueryParamsRetrieve<AdyenGateway>, options?: ResourcesConfig): Promise<AdyenGateway> {\n\t\treturn this.resources.create<AdyenGatewayCreate, AdyenGateway>({ ...resource, type: AdyenGateways.TYPE }, params, options)\n\t}\n\n\tasync update(resource: AdyenGatewayUpdate, params?: QueryParamsRetrieve<AdyenGateway>, options?: ResourcesConfig): Promise<AdyenGateway> {\n\t\treturn this.resources.update<AdyenGatewayUpdate, AdyenGateway>({ ...resource, type: AdyenGateways.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: AdyenGateways.TYPE } : id, options)\n\t}\n\n\tasync payment_methods(adyenGatewayId: string | AdyenGateway, params?: QueryParamsList<PaymentMethod>, options?: ResourcesConfig): Promise<ListResponse<PaymentMethod>> {\n\t\tconst _adyenGatewayId = (adyenGatewayId as AdyenGateway).id || adyenGatewayId as string\n\t\treturn this.resources.fetch<PaymentMethod>({ type: 'payment_methods' }, `adyen_gateways/${_adyenGatewayId}/payment_methods`, params, options) as unknown as ListResponse<PaymentMethod>\n\t}\n\n\tasync versions(adyenGatewayId: string | AdyenGateway, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>> {\n\t\tconst _adyenGatewayId = (adyenGatewayId as AdyenGateway).id || adyenGatewayId as string\n\t\treturn this.resources.fetch<Version>({ type: 'versions' }, `adyen_gateways/${_adyenGatewayId}/versions`, params, options) as unknown as ListResponse<Version>\n\t}\n\n\tasync adyen_payments(adyenGatewayId: string | AdyenGateway, params?: QueryParamsList<AdyenPayment>, options?: ResourcesConfig): Promise<ListResponse<AdyenPayment>> {\n\t\tconst _adyenGatewayId = (adyenGatewayId as AdyenGateway).id || adyenGatewayId as string\n\t\treturn this.resources.fetch<AdyenPayment>({ type: 'adyen_payments' }, `adyen_gateways/${_adyenGatewayId}/adyen_payments`, params, options) as unknown as ListResponse<AdyenPayment>\n\t}\n\n\n\tisAdyenGateway(resource: any): resource is AdyenGateway {\n\t\treturn resource.type && (resource.type === AdyenGateways.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): AdyenGatewayRel {\n\t\treturn super.relationshipOneToOne<AdyenGatewayRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): AdyenGatewayRel[] {\n\t\treturn super.relationshipOneToMany<AdyenGatewayRel>(...ids)\n\t}\n\n\n\ttype(): AdyenGatewayType {\n\t\treturn AdyenGateways.TYPE\n\t}\n\n}\n\n\nconst instance = new AdyenGateways()\nexport default instance\n\nexport type { AdyenGateways, AdyenGateway, AdyenGatewayCreate, AdyenGatewayUpdate, AdyenGatewayType }\n"]}
|
1
|
+
{"version":3,"sources":["../src/resources/adyen_gateways.ts"],"names":[],"mappings":";;;AAuLA,IAAM,aAAA,GAAN,MAAM,cAAA,SAAsB,WAAA,CAA0B;AAAA,EAErD,OAAgB,IAAA,GAAyB,gBAAA;AAAA,EAEzC,MAAM,MAAA,CAAO,QAAA,EAA8B,MAAA,EAA4C,OAAA,EAAkD;AACxI,IAAA,OAAO,IAAA,CAAK,SAAA,CAAU,MAAA,CAAyC,EAAE,GAAG,QAAA,EAAU,IAAA,EAAM,cAAA,CAAc,IAAA,EAAK,EAAG,MAAA,EAAQ,OAAO,CAAA;AAAA,EAC1H;AAAA,EAEA,MAAM,MAAA,CAAO,QAAA,EAA8B,MAAA,EAA4C,OAAA,EAAkD;AACxI,IAAA,OAAO,IAAA,CAAK,SAAA,CAAU,MAAA,CAAyC,EAAE,GAAG,QAAA,EAAU,IAAA,EAAM,cAAA,CAAc,IAAA,EAAK,EAAG,MAAA,EAAQ,OAAO,CAAA;AAAA,EAC1H;AAAA,EAEA,MAAM,MAAA,CAAO,EAAA,EAAyB,OAAA,EAA0C;AAC/E,IAAA,MAAM,IAAA,CAAK,SAAA,CAAU,MAAA,CAAQ,OAAO,EAAA,KAAO,Q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AE,CAAA;AAAA,EACtD;AAAA,EAEA,sBAAsB,GAAA,EAAkC;AACvD,IAAA,OAAO,KAAA,CAAM,qBAAA,CAAuC,GAAG,GAAG,CAAA;AAAA,EAC3D;AAAA,EAGA,IAAA,GAAyB;AACxB,IAAA,OAAO,cAAA,CAAc,IAAA;AAAA,EACtB;AAED,CAAA;AAGA,IAAM,QAAA,GAAW,IAAI,aAAA,EAAc;AACnC,IAAO,sBAAA,GAAQ","file":"chunk-NDPDO54G.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 { PaymentMethod } from './payment_methods'\nimport type { Version } from './versions'\nimport type { AdyenPayment, AdyenPaymentType } from './adyen_payments'\n\n\ntype AdyenGatewayType = 'adyen_gateways'\ntype AdyenGatewayRel = ResourceRel & { type: AdyenGatewayType }\ntype AdyenPaymentRel = ResourceRel & { type: AdyenPaymentType }\n\n\nexport type AdyenGatewaySort = Pick<AdyenGateway, 'id' | 'name'> & ResourceSort\n// export type AdyenGatewayFilter = Pick<AdyenGateway, 'id' | 'name'> & ResourceFilter\n\n\ninterface AdyenGateway extends Resource {\n\t\n\treadonly type: AdyenGatewayType\n\n\t/** \n\t * The payment gateway's internal name.\n\t * @example ```\"US payment gateway\"```\n\t */\n\tname: string\n\t/** \n\t * The prefix of the endpoint used for live transactions.\n\t * @example ```\"1797a841fbb37ca7-AdyenDemo\"```\n\t */\n\tlive_url_prefix: string\n\t/** \n\t * The checkout API version, supported range is from 66 to 71, default is 71.\n\t * @example ```71```\n\t */\n\tapi_version?: number | null\n\t/** \n\t * Indicates if the gateway will leverage on the Adyen notification webhooks, using latest API version.\n\t * @example ```true```\n\t */\n\tasync_api?: boolean | null\n\t/** \n\t * Send this attribute if you want to enable partial payments for the order.\n\t */\n\tpartial_payments?: boolean | null\n\t/** \n\t * Indicates if the gateway will use the native customer payment sources.\n\t * @example ```true```\n\t */\n\tnative_customer_payment_sources?: boolean | null\n\t/** \n\t * The gateway webhook endpoint secret, generated by Adyen customer area.\n\t * @example ```\"xxxx-yyyy-zzzz\"```\n\t */\n\twebhook_endpoint_secret?: string | null\n\t/** \n\t * The gateway webhook URL, generated automatically.\n\t * @example ```\"https://core.commercelayer.co/webhook_callbacks/adyen_gateways/xxxxx\"```\n\t */\n\twebhook_endpoint_url?: string | null\n\n\tpayment_methods?: PaymentMethod[] | null\n\tversions?: Version[] | null\n\tadyen_payments?: AdyenPayment[] | null\n\n}\n\n\ninterface AdyenGatewayCreate extends ResourceCreate {\n\t\n\t/** \n\t * The payment gateway's internal name.\n\t * @example ```\"US payment gateway\"```\n\t */\n\tname: string\n\t/** \n\t * The gateway merchant account.\n\t * @example ```\"xxxx-yyyy-zzzz\"```\n\t */\n\tmerchant_account: string\n\t/** \n\t * The gateway API key.\n\t * @example ```\"xxxx-yyyy-zzzz\"```\n\t */\n\tapi_key: string\n\t/** \n\t * The public key linked to your API credential.\n\t * @example ```\"xxxx-yyyy-zzzz\"```\n\t */\n\tpublic_key?: string | null\n\t/** \n\t * The prefix of the endpoint used for live transactions.\n\t * @example ```\"1797a841fbb37ca7-AdyenDemo\"```\n\t */\n\tlive_url_prefix: string\n\t/** \n\t * The checkout API version, supported range is from 66 to 71, default is 71.\n\t * @example ```71```\n\t */\n\tapi_version?: number | null\n\t/** \n\t * Indicates if the gateway will leverage on the Adyen notification webhooks, using latest API version.\n\t * @example ```true```\n\t */\n\tasync_api?: boolean | null\n\t/** \n\t * Send this attribute if you want to enable partial payments for the order.\n\t */\n\tpartial_payments?: boolean | null\n\t/** \n\t * Indicates if the gateway will use the native customer payment sources.\n\t * @example ```true```\n\t */\n\tnative_customer_payment_sources?: boolean | null\n\t/** \n\t * The gateway webhook endpoint secret, generated by Adyen customer area.\n\t * @example ```\"xxxx-yyyy-zzzz\"```\n\t */\n\twebhook_endpoint_secret?: string | null\n\n\tadyen_payments?: AdyenPaymentRel[] | null\n\n}\n\n\ninterface AdyenGatewayUpdate extends ResourceUpdate {\n\t\n\t/** \n\t * The payment gateway's internal name.\n\t * @example ```\"US payment gateway\"```\n\t */\n\tname?: string | null\n\t/** \n\t * The gateway merchant account.\n\t * @example ```\"xxxx-yyyy-zzzz\"```\n\t */\n\tmerchant_account?: string | null\n\t/** \n\t * The gateway API key.\n\t * @example ```\"xxxx-yyyy-zzzz\"```\n\t */\n\tapi_key?: string | null\n\t/** \n\t * The public key linked to your API credential.\n\t * @example ```\"xxxx-yyyy-zzzz\"```\n\t */\n\tpublic_key?: string | null\n\t/** \n\t * The prefix of the endpoint used for live transactions.\n\t * @example ```\"1797a841fbb37ca7-AdyenDemo\"```\n\t */\n\tlive_url_prefix?: string | null\n\t/** \n\t * The checkout API version, supported range is from 66 to 71, default is 71.\n\t * @example ```71```\n\t */\n\tapi_version?: number | null\n\t/** \n\t * Indicates if the gateway will leverage on the Adyen notification webhooks, using latest API version.\n\t * @example ```true```\n\t */\n\tasync_api?: boolean | null\n\t/** \n\t * Send this attribute if you want to enable partial payments for the order.\n\t */\n\tpartial_payments?: boolean | null\n\t/** \n\t * Indicates if the gateway will use the native customer payment sources.\n\t * @example ```true```\n\t */\n\tnative_customer_payment_sources?: boolean | null\n\t/** \n\t * The gateway webhook endpoint secret, generated by Adyen customer area.\n\t * @example ```\"xxxx-yyyy-zzzz\"```\n\t */\n\twebhook_endpoint_secret?: string | null\n\n\tadyen_payments?: AdyenPaymentRel[] | null\n\n}\n\n\nclass AdyenGateways extends ApiResource<AdyenGateway> {\n\n\tstatic readonly TYPE: AdyenGatewayType = 'adyen_gateways' as const\n\n\tasync create(resource: AdyenGatewayCreate, params?: QueryParamsRetrieve<AdyenGateway>, options?: ResourcesConfig): Promise<AdyenGateway> {\n\t\treturn this.resources.create<AdyenGatewayCreate, AdyenGateway>({ ...resource, type: AdyenGateways.TYPE }, params, options)\n\t}\n\n\tasync update(resource: AdyenGatewayUpdate, params?: QueryParamsRetrieve<AdyenGateway>, options?: ResourcesConfig): Promise<AdyenGateway> {\n\t\treturn this.resources.update<AdyenGatewayUpdate, AdyenGateway>({ ...resource, type: AdyenGateways.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: AdyenGateways.TYPE } : id, options)\n\t}\n\n\tasync payment_methods(adyenGatewayId: string | AdyenGateway, params?: QueryParamsList<PaymentMethod>, options?: ResourcesConfig): Promise<ListResponse<PaymentMethod>> {\n\t\tconst _adyenGatewayId = (adyenGatewayId as AdyenGateway).id || adyenGatewayId as string\n\t\treturn this.resources.fetch<PaymentMethod>({ type: 'payment_methods' }, `adyen_gateways/${_adyenGatewayId}/payment_methods`, params, options) as unknown as ListResponse<PaymentMethod>\n\t}\n\n\tasync versions(adyenGatewayId: string | AdyenGateway, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>> {\n\t\tconst _adyenGatewayId = (adyenGatewayId as AdyenGateway).id || adyenGatewayId as string\n\t\treturn this.resources.fetch<Version>({ type: 'versions' }, `adyen_gateways/${_adyenGatewayId}/versions`, params, options) as unknown as ListResponse<Version>\n\t}\n\n\tasync adyen_payments(adyenGatewayId: string | AdyenGateway, params?: QueryParamsList<AdyenPayment>, options?: ResourcesConfig): Promise<ListResponse<AdyenPayment>> {\n\t\tconst _adyenGatewayId = (adyenGatewayId as AdyenGateway).id || adyenGatewayId as string\n\t\treturn this.resources.fetch<AdyenPayment>({ type: 'adyen_payments' }, `adyen_gateways/${_adyenGatewayId}/adyen_payments`, params, options) as unknown as ListResponse<AdyenPayment>\n\t}\n\n\n\tisAdyenGateway(resource: any): resource is AdyenGateway {\n\t\treturn resource.type && (resource.type === AdyenGateways.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): AdyenGatewayRel {\n\t\treturn super.relationshipOneToOne<AdyenGatewayRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): AdyenGatewayRel[] {\n\t\treturn super.relationshipOneToMany<AdyenGatewayRel>(...ids)\n\t}\n\n\n\ttype(): AdyenGatewayType {\n\t\treturn AdyenGateways.TYPE\n\t}\n\n}\n\n\nconst instance = new AdyenGateways()\nexport default instance\n\nexport type { AdyenGateways, AdyenGateway, AdyenGatewayCreate, AdyenGatewayUpdate, AdyenGatewayType }\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/resources/paypal_payments.ts"],"names":["ApiResource"],"mappings":";;;;;AAmHA,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;
|
1
|
+
{"version":3,"sources":["../src/resources/paypal_payments.ts"],"names":["ApiResource"],"mappings":";;;;;AAmHA,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,EAC7H;AAAA,EAEA,MAAM,MAAA,CAAO,QAAA,EAA+B,MAAA,EAA6C,OAAA,EAAmD;AAC3I,IAAA,OAAO,IAAA,CAAK,SAAA,CAAU,MAAA,CAA2C,EAAE,GAAG,QAAA,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,OAAO,CAAA;AAAA,EAC3H;AAAA,EAGA,gBAAgB,QAAA,EAA0C;AACzD,IAAA,OAAO,QAAA,CAAS,IAAA,IAAS,QAAA,CAAS,IAAA,KAAS,eAAA,CAAe,IAAA;AAAA,EAC3D;AAAA,EAGA,aAAa,EAAA,EAAkD;AAC9D,IAAA,OAAO,KAAA,CAAM,qBAAuC,EAAE,CAAA;AAAA,EACvD;AAAA,EAEA,sBAAsB,GAAA,EAAmC;AACxD,IAAA,OAAO,KAAA,CAAM,qBAAA,CAAwC,GAAG,GAAG,CAAA;AAAA,EAC5D;AAAA,EAGA,IAAA,GAA0B;AACzB,IAAA,OAAO,eAAA,CAAe,IAAA;AAAA,EACvB;AAED,CAAA;AAGA,IAAM,QAAA,GAAW,IAAI,cAAA,EAAe;AACpC,IAAO,uBAAA,GAAQ","file":"chunk-NEC22ZSI.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 { Order, OrderType } from './orders'\nimport type { PaymentGateway } from './payment_gateways'\nimport type { Version } from './versions'\n\n\ntype PaypalPaymentType = 'paypal_payments'\ntype PaypalPaymentRel = ResourceRel & { type: PaypalPaymentType }\ntype OrderRel = ResourceRel & { type: OrderType }\n\n\nexport type PaypalPaymentSort = Pick<PaypalPayment, 'id'> & ResourceSort\n// export type PaypalPaymentFilter = Pick<PaypalPayment, 'id'> & ResourceFilter\n\n\ninterface PaypalPayment extends Resource {\n\t\n\treadonly type: PaypalPaymentType\n\n\t/** \n\t * The URL where the payer is redirected after they approve the payment.\n\t * @example ```\"https://yourdomain.com/thankyou\"```\n\t */\n\treturn_url: string\n\t/** \n\t * The URL where the payer is redirected after they cancel the payment.\n\t * @example ```\"https://yourdomain.com/checkout/payment\"```\n\t */\n\tcancel_url: string\n\t/** \n\t * A free-form field that you can use to send a note to the payer on PayPal.\n\t * @example ```\"Thank you for shopping with us!\"```\n\t */\n\tnote_to_payer?: string | null\n\t/** \n\t * The id of the payer that PayPal passes in the return_url.\n\t * @example ```\"ABCDEFGHG123456\"```\n\t */\n\tpaypal_payer_id?: string | null\n\t/** \n\t * The PayPal payer id (if present).\n\t * @example ```\"ABCDEFGHG123456\"```\n\t */\n\tname?: string | null\n\t/** \n\t * The id of the PayPal payment object.\n\t * @example ```\"1234567890\"```\n\t */\n\tpaypal_id?: string | null\n\t/** \n\t * The PayPal payment status. One of 'created', or 'approved'.\n\t * @example ```\"created\"```\n\t */\n\tstatus?: 'created' | 'approved' | null\n\t/** \n\t * The URL the customer should be redirected to approve the payment.\n\t * @example ```\"https://www.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=EC-1234567890ABCDEFGHG\"```\n\t */\n\tapproval_url?: string | null\n\t/** \n\t * Indicates if the order current amount differs form the one of the created payment intent.\n\t */\n\tmismatched_amounts?: boolean | null\n\t/** \n\t * Information about the payment instrument used in the transaction.\n\t * @example ```{\"issuer\":\"cl bank\",\"card_type\":\"visa\"}```\n\t */\n\tpayment_instrument?: Record<string, any> | null\n\n\torder?: Order | null\n\tpayment_gateway?: PaymentGateway | null\n\tversions?: Version[] | null\n\n}\n\n\ninterface PaypalPaymentCreate extends ResourceCreate {\n\t\n\t/** \n\t * The URL where the payer is redirected after they approve the payment.\n\t * @example ```\"https://yourdomain.com/thankyou\"```\n\t */\n\treturn_url: string\n\t/** \n\t * The URL where the payer is redirected after they cancel the payment.\n\t * @example ```\"https://yourdomain.com/checkout/payment\"```\n\t */\n\tcancel_url: string\n\t/** \n\t * A free-form field that you can use to send a note to the payer on PayPal.\n\t * @example ```\"Thank you for shopping with us!\"```\n\t */\n\tnote_to_payer?: string | null\n\n\torder: OrderRel\n\n}\n\n\ninterface PaypalPaymentUpdate extends ResourceUpdate {\n\t\n\t/** \n\t * The id of the payer that PayPal passes in the return_url.\n\t * @example ```\"ABCDEFGHG123456\"```\n\t */\n\tpaypal_payer_id?: string | null\n\n\torder?: OrderRel | null\n\n}\n\n\nclass PaypalPayments extends ApiResource<PaypalPayment> {\n\n\tstatic readonly TYPE: PaypalPaymentType = 'paypal_payments' as const\n\n\tasync create(resource: PaypalPaymentCreate, params?: QueryParamsRetrieve<PaypalPayment>, options?: ResourcesConfig): Promise<PaypalPayment> {\n\t\treturn this.resources.create<PaypalPaymentCreate, PaypalPayment>({ ...resource, type: PaypalPayments.TYPE }, params, options)\n\t}\n\n\tasync update(resource: PaypalPaymentUpdate, params?: QueryParamsRetrieve<PaypalPayment>, options?: ResourcesConfig): Promise<PaypalPayment> {\n\t\treturn this.resources.update<PaypalPaymentUpdate, PaypalPayment>({ ...resource, type: PaypalPayments.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: PaypalPayments.TYPE } : id, options)\n\t}\n\n\tasync order(paypalPaymentId: string | PaypalPayment, params?: QueryParamsRetrieve<Order>, options?: ResourcesConfig): Promise<Order> {\n\t\tconst _paypalPaymentId = (paypalPaymentId as PaypalPayment).id || paypalPaymentId as string\n\t\treturn this.resources.fetch<Order>({ type: 'orders' }, `paypal_payments/${_paypalPaymentId}/order`, params, options) as unknown as Order\n\t}\n\n\tasync payment_gateway(paypalPaymentId: string | PaypalPayment, params?: QueryParamsRetrieve<PaymentGateway>, options?: ResourcesConfig): Promise<PaymentGateway> {\n\t\tconst _paypalPaymentId = (paypalPaymentId as PaypalPayment).id || paypalPaymentId as string\n\t\treturn this.resources.fetch<PaymentGateway>({ type: 'payment_gateways' }, `paypal_payments/${_paypalPaymentId}/payment_gateway`, params, options) as unknown as PaymentGateway\n\t}\n\n\tasync versions(paypalPaymentId: string | PaypalPayment, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>> {\n\t\tconst _paypalPaymentId = (paypalPaymentId as PaypalPayment).id || paypalPaymentId as string\n\t\treturn this.resources.fetch<Version>({ type: 'versions' }, `paypal_payments/${_paypalPaymentId}/versions`, params, options) as unknown as ListResponse<Version>\n\t}\n\n\n\tisPaypalPayment(resource: any): resource is PaypalPayment {\n\t\treturn resource.type && (resource.type === PaypalPayments.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): PaypalPaymentRel {\n\t\treturn super.relationshipOneToOne<PaypalPaymentRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): PaypalPaymentRel[] {\n\t\treturn super.relationshipOneToMany<PaypalPaymentRel>(...ids)\n\t}\n\n\n\ttype(): PaypalPaymentType {\n\t\treturn PaypalPayments.TYPE\n\t}\n\n}\n\n\nconst instance = new PaypalPayments()\nexport default instance\n\nexport type { PaypalPayments, PaypalPayment, PaypalPaymentCreate, PaypalPaymentUpdate, PaypalPaymentType }\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/resources/payment_options.ts"],"names":["ApiResource"],"mappings":";;;;;AAoFA,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;
|
1
|
+
{"version":3,"sources":["../src/resources/payment_options.ts"],"names":["ApiResource"],"mappings":";;;;;AAoFA,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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;AACzD,IAAA,OAAO,QAAA,CAAS,IAAA,IAAS,QAAA,CAAS,IAAA,KAAS,eAAA,CAAe,IAAA;AAAA,EAC3D;AAAA,EAGA,aAAa,EAAA,EAAkD;AAC9D,IAAA,OAAO,KAAA,CAAM,qBAAuC,EAAE,CAAA;AAAA,EACvD;AAAA,EAEA,sBAAsB,GAAA,EAAmC;AACxD,IAAA,OAAO,KAAA,CAAM,qBAAA,CAAwC,GAAG,GAAG,CAAA;AAAA,EAC5D;AAAA,EAGA,IAAA,GAA0B;AACzB,IAAA,OAAO,eAAA,CAAe,IAAA;AAAA,EACvB;AAED,CAAA;AAGA,IAAM,QAAA,GAAW,IAAI,cAAA,EAAe;AACpC,IAAO,uBAAA,GAAQ","file":"chunk-NIHOABAW.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 { Order, OrderType } from './orders'\nimport type { Attachment } from './attachments'\n\n\ntype PaymentOptionType = 'payment_options'\ntype PaymentOptionRel = ResourceRel & { type: PaymentOptionType }\ntype OrderRel = ResourceRel & { type: OrderType }\n\n\nexport type PaymentOptionSort = Pick<PaymentOption, 'id' | 'name' | 'payment_source_type'> & ResourceSort\n// export type PaymentOptionFilter = Pick<PaymentOption, 'id' | 'name' | 'payment_source_type' | 'data'> & ResourceFilter\n\n\ninterface PaymentOption extends Resource {\n\t\n\treadonly type: PaymentOptionType\n\n\t/** \n\t * The payment option's name. Wehn blank is inherited by payment source type.\n\t * @example ```\"Stripe Payment Option\"```\n\t */\n\tname?: string | null\n\t/** \n\t * The payment source type. One of 'adyen_payments', 'axerve_payments', 'braintree_payments', 'checkout_com_payments', 'external_payments', 'klarna_payments', 'paypal_payments', 'satispay_payments', 'stripe_payments', or 'wire_transfers'.\n\t * @example ```\"stripe_payments\"```\n\t */\n\tpayment_source_type: 'adyen_payments' | 'axerve_payments' | 'braintree_payments' | 'checkout_com_payments' | 'external_payments' | 'klarna_payments' | 'paypal_payments' | 'satispay_payments' | 'stripe_payments' | 'wire_transfers'\n\t/** \n\t * The payment options data to be added to the payment source payload. Check payment specific API for more details.\n\t * @example ```{\"application_fee_amount\":1000,\"on_behalf_of\":\"pm_xxx\"}```\n\t */\n\tdata: Record<string, any>\n\n\torder?: Order | null\n\tattachments?: Attachment[] | null\n\n}\n\n\ninterface PaymentOptionCreate extends ResourceCreate {\n\t\n\t/** \n\t * The payment option's name. Wehn blank is inherited by payment source type.\n\t * @example ```\"Stripe Payment Option\"```\n\t */\n\tname?: string | null\n\t/** \n\t * The payment source type. One of 'adyen_payments', 'axerve_payments', 'braintree_payments', 'checkout_com_payments', 'external_payments', 'klarna_payments', 'paypal_payments', 'satispay_payments', 'stripe_payments', or 'wire_transfers'.\n\t * @example ```\"stripe_payments\"```\n\t */\n\tpayment_source_type: 'adyen_payments' | 'axerve_payments' | 'braintree_payments' | 'checkout_com_payments' | 'external_payments' | 'klarna_payments' | 'paypal_payments' | 'satispay_payments' | 'stripe_payments' | 'wire_transfers'\n\t/** \n\t * The payment options data to be added to the payment source payload. Check payment specific API for more details.\n\t * @example ```{\"application_fee_amount\":1000,\"on_behalf_of\":\"pm_xxx\"}```\n\t */\n\tdata: Record<string, any>\n\n\torder: OrderRel\n\n}\n\n\ninterface PaymentOptionUpdate extends ResourceUpdate {\n\t\n\t/** \n\t * The payment option's name. Wehn blank is inherited by payment source type.\n\t * @example ```\"Stripe Payment Option\"```\n\t */\n\tname?: string | null\n\t/** \n\t * The payment options data to be added to the payment source payload. Check payment specific API for more details.\n\t * @example ```{\"application_fee_amount\":1000,\"on_behalf_of\":\"pm_xxx\"}```\n\t */\n\tdata?: Record<string, any> | null\n\n\torder?: OrderRel | null\n\n}\n\n\nclass PaymentOptions extends ApiResource<PaymentOption> {\n\n\tstatic readonly TYPE: PaymentOptionType = 'payment_options' as const\n\n\tasync create(resource: PaymentOptionCreate, params?: QueryParamsRetrieve<PaymentOption>, options?: ResourcesConfig): Promise<PaymentOption> {\n\t\treturn this.resources.create<PaymentOptionCreate, PaymentOption>({ ...resource, type: PaymentOptions.TYPE }, params, options)\n\t}\n\n\tasync update(resource: PaymentOptionUpdate, params?: QueryParamsRetrieve<PaymentOption>, options?: ResourcesConfig): Promise<PaymentOption> {\n\t\treturn this.resources.update<PaymentOptionUpdate, PaymentOption>({ ...resource, type: PaymentOptions.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: PaymentOptions.TYPE } : id, options)\n\t}\n\n\tasync order(paymentOptionId: string | PaymentOption, params?: QueryParamsRetrieve<Order>, options?: ResourcesConfig): Promise<Order> {\n\t\tconst _paymentOptionId = (paymentOptionId as PaymentOption).id || paymentOptionId as string\n\t\treturn this.resources.fetch<Order>({ type: 'orders' }, `payment_options/${_paymentOptionId}/order`, params, options) as unknown as Order\n\t}\n\n\tasync attachments(paymentOptionId: string | PaymentOption, params?: QueryParamsList<Attachment>, options?: ResourcesConfig): Promise<ListResponse<Attachment>> {\n\t\tconst _paymentOptionId = (paymentOptionId as PaymentOption).id || paymentOptionId as string\n\t\treturn this.resources.fetch<Attachment>({ type: 'attachments' }, `payment_options/${_paymentOptionId}/attachments`, params, options) as unknown as ListResponse<Attachment>\n\t}\n\n\n\tisPaymentOption(resource: any): resource is PaymentOption {\n\t\treturn resource.type && (resource.type === PaymentOptions.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): PaymentOptionRel {\n\t\treturn super.relationshipOneToOne<PaymentOptionRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): PaymentOptionRel[] {\n\t\treturn super.relationshipOneToMany<PaymentOptionRel>(...ids)\n\t}\n\n\n\ttype(): PaymentOptionType {\n\t\treturn PaymentOptions.TYPE\n\t}\n\n}\n\n\nconst instance = new PaymentOptions()\nexport default instance\n\nexport type { PaymentOptions, PaymentOption, PaymentOptionCreate, PaymentOptionUpdate, PaymentOptionType }\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/resources/delivery_lead_times.ts"],"names":["ApiResource"],"mappings":";;;;;AA2FA,IAAM,iBAAA,GAAN,MAAM,kBAAA,SAA0BA,6BAAA,CAA8B;AAAA,EAE7D,OAAgB,IAAA,GAA6B,qBAAA;AAAA,EAE7C,MAAM,MAAA,CAAO,QAAA,EAAkC,MAAA,EAAgD,OAAA,EAAsD;AACpJ,IAAA,OAAO,IAAA,CAAK,SAAA,CAAU,MAAA,CAAiD,EAAE,GAAG,QAAA,EAAU,IAAA,EAAM,kBAAA,CAAkB,IAAA,EAAK,EAAG,MAAA,EAAQ,OAAO,CAAA;AAAA;
|
1
|
+
{"version":3,"sources":["../src/resources/delivery_lead_times.ts"],"names":["ApiResource"],"mappings":";;;;;AA2FA,IAAM,iBAAA,GAAN,MAAM,kBAAA,SAA0BA,6BAAA,CAA8B;AAAA,EAE7D,OAAgB,IAAA,GAA6B,qBAAA;AAAA,EAE7C,MAAM,MAAA,CAAO,QAAA,EAAkC,MAAA,EAAgD,OAAA,EAAsD;AACpJ,IAAA,OAAO,IAAA,CAAK,SAAA,CAAU,MAAA,CAAiD,EAAE,GAAG,QAAA,EAAU,IAAA,EAAM,kBAAA,CAAkB,IAAA,EAAK,EAAG,MAAA,EAAQ,OAAO,CAAA;AAAA,EACtI;AAAA,EAEA,MAAM,MAAA,CAAO,QAAA,EAAkC,MAAA,EAAgD,OAAA,EAAsD;AACpJ,IAAA,OAAO,IAAA,CAAK,SAAA,CAAU,MAAA,CAAiD,EAAE,GAAG,QAAA,EAAU,IAAA,EAAM,kBAAA,CAAkB,IAAA,EAAK,EAAG,MAAA,EAAQ,OAAO,CAAA;AAAA,EACtI;AAAA,EAEA,MAAM,MAAA,CAAO,EAAA,EAAyB,OAAA,EAA0C;AAC/E,IAAA,MAAM,IAAA,CA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,kBAAA;AAC3E,IAAA,OAAO,IAAA,CAAK,SAAA,CAAU,KAAA,CAAe,EAAE,IAAA,EAAM,UAAA,EAAW,EAAG,CAAA,oBAAA,EAAuB,mBAAmB,CAAA,SAAA,CAAA,EAAa,MAAA,EAAQ,OAAO,CAAA;AAAA,EAClI;AAAA,EAGA,mBAAmB,QAAA,EAA6C;AAC/D,IAAA,OAAO,QAAA,CAAS,IAAA,IAAS,QAAA,CAAS,IAAA,KAAS,kBAAA,CAAkB,IAAA;AAAA,EAC9D;AAAA,EAGA,aAAa,EAAA,EAAqD;AACjE,IAAA,OAAO,KAAA,CAAM,qBAA0C,EAAE,CAAA;AAAA,EAC1D;AAAA,EAEA,sBAAsB,GAAA,EAAsC;AAC3D,IAAA,OAAO,KAAA,CAAM,qBAAA,CAA2C,GAAG,GAAG,CAAA;AAAA,EAC/D;AAAA,EAGA,IAAA,GAA6B;AAC5B,IAAA,OAAO,kBAAA,CAAkB,IAAA;AAAA,EAC1B;AAED,CAAA;AAGA,IAAM,QAAA,GAAW,IAAI,iBAAA,EAAkB;AACvC,IAAO,2BAAA,GAAQ","file":"chunk-NJYMO7FP.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 { StockLocation, StockLocationType } from './stock_locations'\nimport type { ShippingMethod, ShippingMethodType } from './shipping_methods'\nimport type { Attachment } from './attachments'\nimport type { Version } from './versions'\n\n\ntype DeliveryLeadTimeType = 'delivery_lead_times'\ntype DeliveryLeadTimeRel = ResourceRel & { type: DeliveryLeadTimeType }\ntype StockLocationRel = ResourceRel & { type: StockLocationType }\ntype ShippingMethodRel = ResourceRel & { type: ShippingMethodType }\n\n\nexport type DeliveryLeadTimeSort = Pick<DeliveryLeadTime, 'id' | 'min_hours' | 'max_hours' | 'min_days'> & ResourceSort\n// export type DeliveryLeadTimeFilter = Pick<DeliveryLeadTime, 'id' | 'min_hours' | 'max_hours' | 'min_days' | 'max_days'> & ResourceFilter\n\n\ninterface DeliveryLeadTime extends Resource {\n\t\n\treadonly type: DeliveryLeadTimeType\n\n\t/** \n\t * The delivery lead minimum time (in hours) when shipping from the associated stock location with the associated shipping method.\n\t * @example ```48```\n\t */\n\tmin_hours: number\n\t/** \n\t * The delivery lead maximun time (in hours) when shipping from the associated stock location with the associated shipping method.\n\t * @example ```72```\n\t */\n\tmax_hours: number\n\t/** \n\t * The delivery lead minimum time, in days (rounded).\n\t * @example ```2```\n\t */\n\tmin_days?: number | null\n\t/** \n\t * The delivery lead maximun time, in days (rounded).\n\t * @example ```3```\n\t */\n\tmax_days?: number | null\n\n\tstock_location?: StockLocation | null\n\tshipping_method?: ShippingMethod | null\n\tattachments?: Attachment[] | null\n\tversions?: Version[] | null\n\n}\n\n\ninterface DeliveryLeadTimeCreate extends ResourceCreate {\n\t\n\t/** \n\t * The delivery lead minimum time (in hours) when shipping from the associated stock location with the associated shipping method.\n\t * @example ```48```\n\t */\n\tmin_hours: number\n\t/** \n\t * The delivery lead maximun time (in hours) when shipping from the associated stock location with the associated shipping method.\n\t * @example ```72```\n\t */\n\tmax_hours: number\n\n\tstock_location: StockLocationRel\n\tshipping_method: ShippingMethodRel\n\n}\n\n\ninterface DeliveryLeadTimeUpdate extends ResourceUpdate {\n\t\n\t/** \n\t * The delivery lead minimum time (in hours) when shipping from the associated stock location with the associated shipping method.\n\t * @example ```48```\n\t */\n\tmin_hours?: number | null\n\t/** \n\t * The delivery lead maximun time (in hours) when shipping from the associated stock location with the associated shipping method.\n\t * @example ```72```\n\t */\n\tmax_hours?: number | null\n\n\tstock_location?: StockLocationRel | null\n\tshipping_method?: ShippingMethodRel | null\n\n}\n\n\nclass DeliveryLeadTimes extends ApiResource<DeliveryLeadTime> {\n\n\tstatic readonly TYPE: DeliveryLeadTimeType = 'delivery_lead_times' as const\n\n\tasync create(resource: DeliveryLeadTimeCreate, params?: QueryParamsRetrieve<DeliveryLeadTime>, options?: ResourcesConfig): Promise<DeliveryLeadTime> {\n\t\treturn this.resources.create<DeliveryLeadTimeCreate, DeliveryLeadTime>({ ...resource, type: DeliveryLeadTimes.TYPE }, params, options)\n\t}\n\n\tasync update(resource: DeliveryLeadTimeUpdate, params?: QueryParamsRetrieve<DeliveryLeadTime>, options?: ResourcesConfig): Promise<DeliveryLeadTime> {\n\t\treturn this.resources.update<DeliveryLeadTimeUpdate, DeliveryLeadTime>({ ...resource, type: DeliveryLeadTimes.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: DeliveryLeadTimes.TYPE } : id, options)\n\t}\n\n\tasync stock_location(deliveryLeadTimeId: string | DeliveryLeadTime, params?: QueryParamsRetrieve<StockLocation>, options?: ResourcesConfig): Promise<StockLocation> {\n\t\tconst _deliveryLeadTimeId = (deliveryLeadTimeId as DeliveryLeadTime).id || deliveryLeadTimeId as string\n\t\treturn this.resources.fetch<StockLocation>({ type: 'stock_locations' }, `delivery_lead_times/${_deliveryLeadTimeId}/stock_location`, params, options) as unknown as StockLocation\n\t}\n\n\tasync shipping_method(deliveryLeadTimeId: string | DeliveryLeadTime, params?: QueryParamsRetrieve<ShippingMethod>, options?: ResourcesConfig): Promise<ShippingMethod> {\n\t\tconst _deliveryLeadTimeId = (deliveryLeadTimeId as DeliveryLeadTime).id || deliveryLeadTimeId as string\n\t\treturn this.resources.fetch<ShippingMethod>({ type: 'shipping_methods' }, `delivery_lead_times/${_deliveryLeadTimeId}/shipping_method`, params, options) as unknown as ShippingMethod\n\t}\n\n\tasync attachments(deliveryLeadTimeId: string | DeliveryLeadTime, params?: QueryParamsList<Attachment>, options?: ResourcesConfig): Promise<ListResponse<Attachment>> {\n\t\tconst _deliveryLeadTimeId = (deliveryLeadTimeId as DeliveryLeadTime).id || deliveryLeadTimeId as string\n\t\treturn this.resources.fetch<Attachment>({ type: 'attachments' }, `delivery_lead_times/${_deliveryLeadTimeId}/attachments`, params, options) as unknown as ListResponse<Attachment>\n\t}\n\n\tasync versions(deliveryLeadTimeId: string | DeliveryLeadTime, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>> {\n\t\tconst _deliveryLeadTimeId = (deliveryLeadTimeId as DeliveryLeadTime).id || deliveryLeadTimeId as string\n\t\treturn this.resources.fetch<Version>({ type: 'versions' }, `delivery_lead_times/${_deliveryLeadTimeId}/versions`, params, options) as unknown as ListResponse<Version>\n\t}\n\n\n\tisDeliveryLeadTime(resource: any): resource is DeliveryLeadTime {\n\t\treturn resource.type && (resource.type === DeliveryLeadTimes.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): DeliveryLeadTimeRel {\n\t\treturn super.relationshipOneToOne<DeliveryLeadTimeRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): DeliveryLeadTimeRel[] {\n\t\treturn super.relationshipOneToMany<DeliveryLeadTimeRel>(...ids)\n\t}\n\n\n\ttype(): DeliveryLeadTimeType {\n\t\treturn DeliveryLeadTimes.TYPE\n\t}\n\n}\n\n\nconst instance = new DeliveryLeadTimes()\nexport default instance\n\nexport type { DeliveryLeadTimes, DeliveryLeadTime, DeliveryLeadTimeCreate, DeliveryLeadTimeUpdate, DeliveryLeadTimeType }\n"]}
|