@commercelayer/sdk 7.0.0-rc.1 → 7.0.0-rc.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -2
- package/lib/{api-DmIZO_Np.d.cts → api-DNeGwzrs.d.cts} +75 -45
- package/lib/{api-DDgIE2i8.d.ts → api-Hgzs8bs4.d.ts} +75 -45
- package/lib/api.cjs +397 -521
- package/lib/api.cjs.map +1 -1
- package/lib/api.d.cts +2 -2
- package/lib/api.d.ts +2 -2
- package/lib/api.js +141 -131
- package/lib/api.js.map +1 -1
- package/lib/bundle.cjs +568 -0
- package/lib/bundle.cjs.map +1 -0
- package/lib/bundle.d.cts +145 -0
- package/lib/bundle.d.ts +145 -0
- package/lib/bundle.js +566 -0
- package/lib/bundle.js.map +1 -0
- package/lib/chunk-2AFNQJXP.cjs +61 -0
- package/lib/chunk-2AFNQJXP.cjs.map +1 -0
- package/lib/chunk-2AMKJ6V7.cjs +47 -0
- package/lib/chunk-2AMKJ6V7.cjs.map +1 -0
- package/lib/chunk-2HLQW5MF.cjs +59 -0
- package/lib/chunk-2HLQW5MF.cjs.map +1 -0
- package/lib/chunk-2HPO4UZA.cjs +51 -0
- package/lib/chunk-2HPO4UZA.cjs.map +1 -0
- package/lib/chunk-2JOYLKTP.cjs +42 -0
- package/lib/chunk-2JOYLKTP.cjs.map +1 -0
- package/lib/chunk-2KKHO6QF.js +59 -0
- package/lib/chunk-2KKHO6QF.js.map +1 -0
- package/lib/chunk-2L2ZM3VD.js +33 -0
- package/lib/chunk-2L2ZM3VD.js.map +1 -0
- package/lib/chunk-2P6AFRJL.js +44 -0
- package/lib/chunk-2P6AFRJL.js.map +1 -0
- package/lib/chunk-2PYM3QGA.js +45 -0
- package/lib/chunk-2PYM3QGA.js.map +1 -0
- package/lib/chunk-2THU5NEW.cjs +47 -0
- package/lib/chunk-2THU5NEW.cjs.map +1 -0
- package/lib/chunk-2XGMKMF5.cjs +51 -0
- package/lib/chunk-2XGMKMF5.cjs.map +1 -0
- package/lib/chunk-34H2NFDA.js +52 -0
- package/lib/chunk-34H2NFDA.js.map +1 -0
- package/lib/chunk-35OHXDG3.cjs +156 -0
- package/lib/chunk-35OHXDG3.cjs.map +1 -0
- package/lib/chunk-3ADITMLN.cjs +62 -0
- package/lib/chunk-3ADITMLN.cjs.map +1 -0
- package/lib/chunk-3ANXNJ6U.cjs +51 -0
- package/lib/chunk-3ANXNJ6U.cjs.map +1 -0
- package/lib/chunk-3AOPII3W.js +65 -0
- package/lib/chunk-3AOPII3W.js.map +1 -0
- package/lib/chunk-3DFZ5QLR.js +61 -0
- package/lib/chunk-3DFZ5QLR.js.map +1 -0
- package/lib/chunk-3EX76AZW.js +3 -0
- package/lib/chunk-3EX76AZW.js.map +1 -0
- package/lib/chunk-3I5BJF3J.js +45 -0
- package/lib/chunk-3I5BJF3J.js.map +1 -0
- package/lib/chunk-3LTCO2OB.cjs +50 -0
- package/lib/chunk-3LTCO2OB.cjs.map +1 -0
- package/lib/chunk-3N2MNKA3.js +54 -0
- package/lib/chunk-3N2MNKA3.js.map +1 -0
- package/lib/chunk-3NWQH32A.js +36 -0
- package/lib/chunk-3NWQH32A.js.map +1 -0
- package/lib/chunk-3OBFBFUV.js +45 -0
- package/lib/chunk-3OBFBFUV.js.map +1 -0
- package/lib/chunk-3PVKJIA3.js +40 -0
- package/lib/chunk-3PVKJIA3.js.map +1 -0
- package/lib/chunk-3RR27O3T.js +45 -0
- package/lib/chunk-3RR27O3T.js.map +1 -0
- package/lib/chunk-3TGZNMLP.cjs +38 -0
- package/lib/chunk-3TGZNMLP.cjs.map +1 -0
- package/lib/chunk-3URHH3S6.js +43 -0
- package/lib/chunk-3URHH3S6.js.map +1 -0
- package/lib/chunk-3WKN5OCU.cjs +47 -0
- package/lib/chunk-3WKN5OCU.cjs.map +1 -0
- package/lib/chunk-3XWE56FL.cjs +101 -0
- package/lib/chunk-3XWE56FL.cjs.map +1 -0
- package/lib/chunk-42DT6ZET.cjs +47 -0
- package/lib/chunk-42DT6ZET.cjs.map +1 -0
- package/lib/chunk-432EXURP.js +41 -0
- package/lib/chunk-432EXURP.js.map +1 -0
- package/lib/chunk-465K3KVE.js +49 -0
- package/lib/chunk-465K3KVE.js.map +1 -0
- package/lib/chunk-4IH4EHXT.cjs +69 -0
- package/lib/chunk-4IH4EHXT.cjs.map +1 -0
- package/lib/chunk-4KFJUIFD.js +45 -0
- package/lib/chunk-4KFJUIFD.js.map +1 -0
- package/lib/chunk-4KO5LZ7F.js +45 -0
- package/lib/chunk-4KO5LZ7F.js.map +1 -0
- package/lib/chunk-4L4MGCUZ.js +45 -0
- package/lib/chunk-4L4MGCUZ.js.map +1 -0
- package/lib/chunk-4L73LJKG.js +41 -0
- package/lib/chunk-4L73LJKG.js.map +1 -0
- package/lib/chunk-4SCFKFIM.cjs +38 -0
- package/lib/chunk-4SCFKFIM.cjs.map +1 -0
- package/lib/chunk-57XXD3GQ.cjs +50 -0
- package/lib/chunk-57XXD3GQ.cjs.map +1 -0
- package/lib/chunk-5EXCGVF2.cjs +47 -0
- package/lib/chunk-5EXCGVF2.cjs.map +1 -0
- package/lib/chunk-5FZNBGAF.cjs +38 -0
- package/lib/chunk-5FZNBGAF.cjs.map +1 -0
- package/lib/chunk-5OQQBNVB.js +49 -0
- package/lib/chunk-5OQQBNVB.js.map +1 -0
- package/lib/chunk-5P5Z7NXC.js +49 -0
- package/lib/chunk-5P5Z7NXC.js.map +1 -0
- package/lib/chunk-5R76TU4I.cjs +52 -0
- package/lib/chunk-5R76TU4I.cjs.map +1 -0
- package/lib/chunk-5U5QLF2Z.js +48 -0
- package/lib/chunk-5U5QLF2Z.js.map +1 -0
- package/lib/chunk-5YMHXTJG.cjs +4 -0
- package/lib/chunk-5YMHXTJG.cjs.map +1 -0
- package/lib/chunk-627I2FYX.cjs +47 -0
- package/lib/chunk-627I2FYX.cjs.map +1 -0
- package/lib/chunk-66JDSPFD.cjs +51 -0
- package/lib/chunk-66JDSPFD.cjs.map +1 -0
- package/lib/chunk-67QVA2J3.cjs +34 -0
- package/lib/chunk-67QVA2J3.cjs.map +1 -0
- package/lib/chunk-6AJSOS56.cjs +75 -0
- package/lib/chunk-6AJSOS56.cjs.map +1 -0
- package/lib/chunk-6B66AQKB.cjs +45 -0
- package/lib/chunk-6B66AQKB.cjs.map +1 -0
- package/lib/chunk-6OHA2TO3.cjs +61 -0
- package/lib/chunk-6OHA2TO3.cjs.map +1 -0
- package/lib/chunk-6PWK52UZ.cjs +70 -0
- package/lib/chunk-6PWK52UZ.cjs.map +1 -0
- package/lib/chunk-6SCAIB4K.cjs +43 -0
- package/lib/chunk-6SCAIB4K.cjs.map +1 -0
- package/lib/chunk-6SOWFGBP.cjs +63 -0
- package/lib/chunk-6SOWFGBP.cjs.map +1 -0
- package/lib/chunk-7CQTUOR4.cjs +42 -0
- package/lib/chunk-7CQTUOR4.cjs.map +1 -0
- package/lib/chunk-7GVHCOUC.js +73 -0
- package/lib/chunk-7GVHCOUC.js.map +1 -0
- package/lib/chunk-7ISS2FDY.js +93 -0
- package/lib/chunk-7ISS2FDY.js.map +1 -0
- package/lib/chunk-7JLRB7QH.js +24 -0
- package/lib/chunk-7JLRB7QH.js.map +1 -0
- package/lib/chunk-7SG4WU7W.js +45 -0
- package/lib/chunk-7SG4WU7W.js.map +1 -0
- package/lib/chunk-7SZY5BWE.js +45 -0
- package/lib/chunk-7SZY5BWE.js.map +1 -0
- package/lib/chunk-7VSYXEXL.js +59 -0
- package/lib/chunk-7VSYXEXL.js.map +1 -0
- package/lib/chunk-7X36B7N6.js +27 -0
- package/lib/chunk-7X36B7N6.js.map +1 -0
- package/lib/chunk-7Z2U4MHU.cjs +52 -0
- package/lib/chunk-7Z2U4MHU.cjs.map +1 -0
- package/lib/chunk-A6BT5FSV.cjs +43 -0
- package/lib/chunk-A6BT5FSV.cjs.map +1 -0
- package/lib/chunk-A7BEMDVP.cjs +55 -0
- package/lib/chunk-A7BEMDVP.cjs.map +1 -0
- package/lib/chunk-AD73LDFJ.cjs +43 -0
- package/lib/chunk-AD73LDFJ.cjs.map +1 -0
- package/lib/chunk-AIGQRBCY.cjs +47 -0
- package/lib/chunk-AIGQRBCY.cjs.map +1 -0
- package/lib/chunk-ANCLAYJV.cjs +98 -0
- package/lib/chunk-ANCLAYJV.cjs.map +1 -0
- package/lib/chunk-AQFAND5D.cjs +282 -0
- package/lib/chunk-AQFAND5D.cjs.map +1 -0
- package/lib/chunk-ARIBIRKF.cjs +47 -0
- package/lib/chunk-ARIBIRKF.cjs.map +1 -0
- package/lib/chunk-AW3TRBZ7.js +44 -0
- package/lib/chunk-AW3TRBZ7.js.map +1 -0
- package/lib/chunk-AYTBSAHY.js +20 -0
- package/lib/chunk-AYTBSAHY.js.map +1 -0
- package/lib/chunk-B72FREUL.cjs +57 -0
- package/lib/chunk-B72FREUL.cjs.map +1 -0
- package/lib/chunk-BBEMCANC.cjs +95 -0
- package/lib/chunk-BBEMCANC.cjs.map +1 -0
- package/lib/chunk-BF7OPORP.js +69 -0
- package/lib/chunk-BF7OPORP.js.map +1 -0
- package/lib/chunk-BN6XJAZH.cjs +43 -0
- package/lib/chunk-BN6XJAZH.cjs.map +1 -0
- package/lib/chunk-BOPK7T5K.js +51 -0
- package/lib/chunk-BOPK7T5K.js.map +1 -0
- package/lib/chunk-BTAKU6V5.cjs +42 -0
- package/lib/chunk-BTAKU6V5.cjs.map +1 -0
- package/lib/chunk-CG2ACHGS.js +45 -0
- package/lib/chunk-CG2ACHGS.js.map +1 -0
- package/lib/chunk-CHYP5F26.js +59 -0
- package/lib/chunk-CHYP5F26.js.map +1 -0
- package/lib/chunk-CK6RZLVM.cjs +47 -0
- package/lib/chunk-CK6RZLVM.cjs.map +1 -0
- package/lib/chunk-CNCZCBI3.js +99 -0
- package/lib/chunk-CNCZCBI3.js.map +1 -0
- package/lib/chunk-CRRYP7ZN.js +45 -0
- package/lib/chunk-CRRYP7ZN.js.map +1 -0
- package/lib/chunk-CTXBUDGO.cjs +39 -0
- package/lib/chunk-CTXBUDGO.cjs.map +1 -0
- package/lib/chunk-CUNOMS5N.js +40 -0
- package/lib/chunk-CUNOMS5N.js.map +1 -0
- package/lib/chunk-D26KDUDM.cjs +47 -0
- package/lib/chunk-D26KDUDM.cjs.map +1 -0
- package/lib/chunk-D5E4OGXU.js +49 -0
- package/lib/chunk-D5E4OGXU.js.map +1 -0
- package/lib/chunk-D7KNSKNJ.js +55 -0
- package/lib/chunk-D7KNSKNJ.js.map +1 -0
- package/lib/chunk-DAXKXBA3.js +48 -0
- package/lib/chunk-DAXKXBA3.js.map +1 -0
- package/lib/chunk-DGUM43GV.js +10 -0
- package/lib/chunk-DGUM43GV.js.map +1 -0
- package/lib/chunk-DJ572MZB.cjs +50 -0
- package/lib/chunk-DJ572MZB.cjs.map +1 -0
- package/lib/chunk-DOFPDQMJ.cjs +56 -0
- package/lib/chunk-DOFPDQMJ.cjs.map +1 -0
- package/lib/chunk-DOGEZ6XX.cjs +46 -0
- package/lib/chunk-DOGEZ6XX.cjs.map +1 -0
- package/lib/chunk-DSKZRVXS.js +28 -0
- package/lib/chunk-DSKZRVXS.js.map +1 -0
- package/lib/chunk-DTGODPCN.js +93 -0
- package/lib/chunk-DTGODPCN.js.map +1 -0
- package/lib/chunk-DYZGWPZ6.js +33 -0
- package/lib/chunk-DYZGWPZ6.js.map +1 -0
- package/lib/chunk-E3FDHGI7.js +36 -0
- package/lib/chunk-E3FDHGI7.js.map +1 -0
- package/lib/chunk-E4DYW6HB.cjs +42 -0
- package/lib/chunk-E4DYW6HB.cjs.map +1 -0
- package/lib/chunk-E6TBQVLK.cjs +39 -0
- package/lib/chunk-E6TBQVLK.cjs.map +1 -0
- package/lib/chunk-EADFDBOR.cjs +46 -0
- package/lib/chunk-EADFDBOR.cjs.map +1 -0
- package/lib/chunk-ECMCBU3N.js +53 -0
- package/lib/chunk-ECMCBU3N.js.map +1 -0
- package/lib/chunk-EEFOL62K.js +36 -0
- package/lib/chunk-EEFOL62K.js.map +1 -0
- package/lib/chunk-EHWAGYNX.js +68 -0
- package/lib/chunk-EHWAGYNX.js.map +1 -0
- package/lib/chunk-EKGR3EB3.js +82 -0
- package/lib/chunk-EKGR3EB3.js.map +1 -0
- package/lib/chunk-ELBOXOTA.js +28 -0
- package/lib/chunk-ELBOXOTA.js.map +1 -0
- package/lib/chunk-EP22KKHR.js +48 -0
- package/lib/chunk-EP22KKHR.js.map +1 -0
- package/lib/chunk-EP7MAEQH.cjs +47 -0
- package/lib/chunk-EP7MAEQH.cjs.map +1 -0
- package/lib/chunk-EQD223JW.cjs +95 -0
- package/lib/chunk-EQD223JW.cjs.map +1 -0
- package/lib/chunk-F6MSHDB7.cjs +47 -0
- package/lib/chunk-F6MSHDB7.cjs.map +1 -0
- package/lib/chunk-FAU5EILL.js +61 -0
- package/lib/chunk-FAU5EILL.js.map +1 -0
- package/lib/chunk-FKDKRSPO.js +101 -0
- package/lib/chunk-FKDKRSPO.js.map +1 -0
- package/lib/chunk-FSFXOZ35.cjs +47 -0
- package/lib/chunk-FSFXOZ35.cjs.map +1 -0
- package/lib/chunk-FTAZDUH6.js +99 -0
- package/lib/chunk-FTAZDUH6.js.map +1 -0
- package/lib/chunk-FVJDRHG7.js +48 -0
- package/lib/chunk-FVJDRHG7.js.map +1 -0
- package/lib/chunk-FXE62CPP.cjs +46 -0
- package/lib/chunk-FXE62CPP.cjs.map +1 -0
- package/lib/chunk-FYKIHWAM.cjs +77 -0
- package/lib/chunk-FYKIHWAM.cjs.map +1 -0
- package/lib/chunk-G74OZ4M6.js +45 -0
- package/lib/chunk-G74OZ4M6.js.map +1 -0
- package/lib/chunk-GD4WRDF2.js +644 -0
- package/lib/chunk-GD4WRDF2.js.map +1 -0
- package/lib/chunk-GE6OHQR6.cjs +89 -0
- package/lib/chunk-GE6OHQR6.cjs.map +1 -0
- package/lib/chunk-GHLCA7BX.js +53 -0
- package/lib/chunk-GHLCA7BX.js.map +1 -0
- package/lib/chunk-GLSPCG3M.cjs +46 -0
- package/lib/chunk-GLSPCG3M.cjs.map +1 -0
- package/lib/chunk-H2USYPU6.js +49 -0
- package/lib/chunk-H2USYPU6.js.map +1 -0
- package/lib/chunk-H4PUXGNI.cjs +47 -0
- package/lib/chunk-H4PUXGNI.cjs.map +1 -0
- package/lib/chunk-H4SVEI6E.js +151 -0
- package/lib/chunk-H4SVEI6E.js.map +1 -0
- package/lib/chunk-HAAE23MQ.js +93 -0
- package/lib/chunk-HAAE23MQ.js.map +1 -0
- package/lib/chunk-HBUDZOK7.cjs +55 -0
- package/lib/chunk-HBUDZOK7.cjs.map +1 -0
- package/lib/chunk-HCBXRHD7.js +45 -0
- package/lib/chunk-HCBXRHD7.js.map +1 -0
- package/lib/chunk-HDYENVKD.js +45 -0
- package/lib/chunk-HDYENVKD.js.map +1 -0
- package/lib/chunk-HLCGKY7R.js +59 -0
- package/lib/chunk-HLCGKY7R.js.map +1 -0
- package/lib/chunk-HNHF6T2I.cjs +54 -0
- package/lib/chunk-HNHF6T2I.cjs.map +1 -0
- package/lib/chunk-HQ35KQFG.cjs +86 -0
- package/lib/chunk-HQ35KQFG.cjs.map +1 -0
- package/lib/chunk-HQ5STEMD.js +55 -0
- package/lib/chunk-HQ5STEMD.js.map +1 -0
- package/lib/chunk-HQ6TJSB7.cjs +51 -0
- package/lib/chunk-HQ6TJSB7.cjs.map +1 -0
- package/lib/chunk-HSILJQCD.js +93 -0
- package/lib/chunk-HSILJQCD.js.map +1 -0
- package/lib/chunk-I3SKGXTB.cjs +26 -0
- package/lib/chunk-I3SKGXTB.cjs.map +1 -0
- package/lib/chunk-IDAOX5RB.cjs +95 -0
- package/lib/chunk-IDAOX5RB.cjs.map +1 -0
- package/lib/chunk-IITNQS6D.js +49 -0
- package/lib/chunk-IITNQS6D.js.map +1 -0
- package/lib/chunk-IKENWSRH.cjs +126 -0
- package/lib/chunk-IKENWSRH.cjs.map +1 -0
- package/lib/chunk-IKHD5UQP.cjs +163 -0
- package/lib/chunk-IKHD5UQP.cjs.map +1 -0
- package/lib/chunk-INJ7FRDA.cjs +55 -0
- package/lib/chunk-INJ7FRDA.cjs.map +1 -0
- package/lib/chunk-INZD34YD.cjs +91 -0
- package/lib/chunk-INZD34YD.cjs.map +1 -0
- package/lib/chunk-J4CTOHX6.cjs +68 -0
- package/lib/chunk-J4CTOHX6.cjs.map +1 -0
- package/lib/chunk-J6NBJHWL.cjs +101 -0
- package/lib/chunk-J6NBJHWL.cjs.map +1 -0
- package/lib/chunk-J6PTNG3D.js +280 -0
- package/lib/chunk-J6PTNG3D.js.map +1 -0
- package/lib/chunk-J7ZSBB35.js +45 -0
- package/lib/chunk-J7ZSBB35.js.map +1 -0
- package/lib/chunk-JAQECLCE.js +41 -0
- package/lib/chunk-JAQECLCE.js.map +1 -0
- package/lib/chunk-JECYKPCC.cjs +30 -0
- package/lib/chunk-JECYKPCC.cjs.map +1 -0
- package/lib/chunk-JENLN6VJ.js +51 -0
- package/lib/chunk-JENLN6VJ.js.map +1 -0
- package/lib/chunk-JEQ2X3Z6.cjs +12 -0
- package/lib/chunk-JEQ2X3Z6.cjs.map +1 -0
- package/lib/chunk-JN4JL4WT.cjs +75 -0
- package/lib/chunk-JN4JL4WT.cjs.map +1 -0
- package/lib/chunk-JPUF5YXX.js +37 -0
- package/lib/chunk-JPUF5YXX.js.map +1 -0
- package/lib/chunk-JRTJ6LWK.js +53 -0
- package/lib/chunk-JRTJ6LWK.js.map +1 -0
- package/lib/chunk-JRYILJJY.cjs +110 -0
- package/lib/chunk-JRYILJJY.cjs.map +1 -0
- package/lib/chunk-JT7HVLLW.cjs +57 -0
- package/lib/chunk-JT7HVLLW.cjs.map +1 -0
- package/lib/chunk-JVF5KY2J.cjs +22 -0
- package/lib/chunk-JVF5KY2J.cjs.map +1 -0
- package/lib/chunk-JWC2GSYH.cjs +47 -0
- package/lib/chunk-JWC2GSYH.cjs.map +1 -0
- package/lib/chunk-JYOFP6BM.js +87 -0
- package/lib/chunk-JYOFP6BM.js.map +1 -0
- package/lib/chunk-JYXAF775.js +49 -0
- package/lib/chunk-JYXAF775.js.map +1 -0
- package/lib/chunk-K2CU5HIV.js +66 -0
- package/lib/chunk-K2CU5HIV.js.map +1 -0
- package/lib/chunk-K6WSCQKS.cjs +53 -0
- package/lib/chunk-K6WSCQKS.cjs.map +1 -0
- package/lib/chunk-KBN3FFXD.cjs +53 -0
- package/lib/chunk-KBN3FFXD.cjs.map +1 -0
- package/lib/chunk-KH5OQRQL.js +38 -0
- package/lib/chunk-KH5OQRQL.js.map +1 -0
- package/lib/chunk-KJAD45RP.cjs +103 -0
- package/lib/chunk-KJAD45RP.cjs.map +1 -0
- package/lib/chunk-KWRDUU7K.js +45 -0
- package/lib/chunk-KWRDUU7K.js.map +1 -0
- package/lib/chunk-L4LPS3DV.cjs +47 -0
- package/lib/chunk-L4LPS3DV.cjs.map +1 -0
- package/lib/chunk-L4TDKOAC.js +32 -0
- package/lib/chunk-L4TDKOAC.js.map +1 -0
- package/lib/chunk-L5NEDGXK.js +124 -0
- package/lib/chunk-L5NEDGXK.js.map +1 -0
- package/lib/chunk-L6IGO47T.js +59 -0
- package/lib/chunk-L6IGO47T.js.map +1 -0
- package/lib/chunk-LCLXLB2R.cjs +53 -0
- package/lib/chunk-LCLXLB2R.cjs.map +1 -0
- package/lib/chunk-LCNT6GY3.js +45 -0
- package/lib/chunk-LCNT6GY3.js.map +1 -0
- package/lib/chunk-LEWK7QET.cjs +61 -0
- package/lib/chunk-LEWK7QET.cjs.map +1 -0
- package/lib/chunk-LIT4FEIU.cjs +47 -0
- package/lib/chunk-LIT4FEIU.cjs.map +1 -0
- package/lib/chunk-LJ2EP6AL.cjs +42 -0
- package/lib/chunk-LJ2EP6AL.cjs.map +1 -0
- package/lib/chunk-LNMY5BDT.js +33 -0
- package/lib/chunk-LNMY5BDT.js.map +1 -0
- package/lib/chunk-LTLMRGB7.js +45 -0
- package/lib/chunk-LTLMRGB7.js.map +1 -0
- package/lib/chunk-M2ZERG2X.cjs +95 -0
- package/lib/chunk-M2ZERG2X.cjs.map +1 -0
- package/lib/chunk-M55NSZVW.js +105 -0
- package/lib/chunk-M55NSZVW.js.map +1 -0
- package/lib/chunk-MADGMICB.js +45 -0
- package/lib/chunk-MADGMICB.js.map +1 -0
- package/lib/chunk-MJRMRWP3.js +67 -0
- package/lib/chunk-MJRMRWP3.js.map +1 -0
- package/lib/chunk-MPSHBMZS.js +93 -0
- package/lib/chunk-MPSHBMZS.js.map +1 -0
- package/lib/chunk-MQZSDICO.cjs +38 -0
- package/lib/chunk-MQZSDICO.cjs.map +1 -0
- package/lib/chunk-MUPRLXGP.js +48 -0
- package/lib/chunk-MUPRLXGP.js.map +1 -0
- package/lib/chunk-MWYBER5I.cjs +50 -0
- package/lib/chunk-MWYBER5I.cjs.map +1 -0
- package/lib/chunk-MZNHRIXE.js +41 -0
- package/lib/chunk-MZNHRIXE.js.map +1 -0
- package/lib/chunk-N4P7A3RY.js +64 -0
- package/lib/chunk-N4P7A3RY.js.map +1 -0
- package/lib/chunk-N6MHUHGE.cjs +95 -0
- package/lib/chunk-N6MHUHGE.cjs.map +1 -0
- package/lib/chunk-N753UD4K.cjs +22 -0
- package/lib/chunk-N753UD4K.cjs.map +1 -0
- package/lib/chunk-NAWKHFBZ.js +274 -0
- package/lib/chunk-NAWKHFBZ.js.map +1 -0
- package/lib/chunk-NBYV35R4.cjs +47 -0
- package/lib/chunk-NBYV35R4.cjs.map +1 -0
- package/lib/chunk-NDPDO54G.js +45 -0
- package/lib/chunk-NDPDO54G.js.map +1 -0
- package/lib/chunk-NEC22ZSI.cjs +47 -0
- package/lib/chunk-NEC22ZSI.cjs.map +1 -0
- package/lib/chunk-NJQDJCFB.cjs +71 -0
- package/lib/chunk-NJQDJCFB.cjs.map +1 -0
- package/lib/chunk-NJYMO7FP.cjs +51 -0
- package/lib/chunk-NJYMO7FP.cjs.map +1 -0
- package/lib/chunk-NMVACSMG.js +84 -0
- package/lib/chunk-NMVACSMG.js.map +1 -0
- package/lib/chunk-NODKE6P4.js +154 -0
- package/lib/chunk-NODKE6P4.js.map +1 -0
- package/lib/chunk-OGLS27LJ.js +45 -0
- package/lib/chunk-OGLS27LJ.js.map +1 -0
- package/lib/chunk-OPQJPXLM.cjs +43 -0
- package/lib/chunk-OPQJPXLM.cjs.map +1 -0
- package/lib/chunk-OYFNK2SE.cjs +38 -0
- package/lib/chunk-OYFNK2SE.cjs.map +1 -0
- package/lib/chunk-P3NADEGE.cjs +29 -0
- package/lib/chunk-P3NADEGE.cjs.map +1 -0
- package/lib/chunk-PEU5GGGE.js +52 -0
- package/lib/chunk-PEU5GGGE.js.map +1 -0
- package/lib/chunk-PNSVP3KP.cjs +54 -0
- package/lib/chunk-PNSVP3KP.cjs.map +1 -0
- package/lib/chunk-PQS6KXZ2.cjs +35 -0
- package/lib/chunk-PQS6KXZ2.cjs.map +1 -0
- package/lib/chunk-PV7MUP5Z.js +44 -0
- package/lib/chunk-PV7MUP5Z.js.map +1 -0
- package/lib/chunk-PZZLLHJP.js +41 -0
- package/lib/chunk-PZZLLHJP.js.map +1 -0
- package/lib/chunk-Q2ZSQM7I.js +45 -0
- package/lib/chunk-Q2ZSQM7I.js.map +1 -0
- package/lib/chunk-Q66HILUF.js +40 -0
- package/lib/chunk-Q66HILUF.js.map +1 -0
- package/lib/chunk-Q66JEOCJ.cjs +50 -0
- package/lib/chunk-Q66JEOCJ.cjs.map +1 -0
- package/lib/chunk-Q7YHSPJL.js +53 -0
- package/lib/chunk-Q7YHSPJL.js.map +1 -0
- package/lib/chunk-QGE4ELJO.cjs +47 -0
- package/lib/chunk-QGE4ELJO.cjs.map +1 -0
- package/lib/chunk-QHRQCFDB.js +41 -0
- package/lib/chunk-QHRQCFDB.js.map +1 -0
- package/lib/chunk-QK5MFD4L.js +45 -0
- package/lib/chunk-QK5MFD4L.js.map +1 -0
- package/lib/chunk-QK7D6L3W.js +51 -0
- package/lib/chunk-QK7D6L3W.js.map +1 -0
- package/lib/chunk-QYDOENWU.cjs +282 -0
- package/lib/chunk-QYDOENWU.cjs.map +1 -0
- package/lib/chunk-QZTNLPOD.cjs +51 -0
- package/lib/chunk-QZTNLPOD.cjs.map +1 -0
- package/lib/chunk-QZWQNPKC.js +45 -0
- package/lib/chunk-QZWQNPKC.js.map +1 -0
- package/lib/chunk-R2LRLUUY.js +35 -0
- package/lib/chunk-R2LRLUUY.js.map +1 -0
- package/lib/chunk-R755X3AG.cjs +47 -0
- package/lib/chunk-R755X3AG.cjs.map +1 -0
- package/lib/chunk-RHARO4TQ.cjs +47 -0
- package/lib/chunk-RHARO4TQ.cjs.map +1 -0
- package/lib/chunk-ROPOLXIV.js +96 -0
- package/lib/chunk-ROPOLXIV.js.map +1 -0
- package/lib/chunk-RT7XLEV6.js +49 -0
- package/lib/chunk-RT7XLEV6.js.map +1 -0
- package/lib/chunk-RTDD2NRL.cjs +39 -0
- package/lib/chunk-RTDD2NRL.cjs.map +1 -0
- package/lib/chunk-RTGW34KX.cjs +40 -0
- package/lib/chunk-RTGW34KX.cjs.map +1 -0
- package/lib/chunk-RWPFE3LF.cjs +51 -0
- package/lib/chunk-RWPFE3LF.cjs.map +1 -0
- package/lib/chunk-SGOUEVJ3.cjs +67 -0
- package/lib/chunk-SGOUEVJ3.cjs.map +1 -0
- package/lib/chunk-SGWRNEJB.cjs +35 -0
- package/lib/chunk-SGWRNEJB.cjs.map +1 -0
- package/lib/chunk-SKFA2ZIK.js +36 -0
- package/lib/chunk-SKFA2ZIK.js.map +1 -0
- package/lib/chunk-SN6BP777.js +89 -0
- package/lib/chunk-SN6BP777.js.map +1 -0
- package/lib/chunk-SOXJJRL2.js +44 -0
- package/lib/chunk-SOXJJRL2.js.map +1 -0
- package/lib/chunk-SPLHKBWG.cjs +51 -0
- package/lib/chunk-SPLHKBWG.cjs.map +1 -0
- package/lib/chunk-SRW7OWVS.cjs +40 -0
- package/lib/chunk-SRW7OWVS.cjs.map +1 -0
- package/lib/chunk-SUJCEUOZ.cjs +47 -0
- package/lib/chunk-SUJCEUOZ.cjs.map +1 -0
- package/lib/chunk-SWWPX4V4.cjs +34 -0
- package/lib/chunk-SWWPX4V4.cjs.map +1 -0
- package/lib/chunk-THO6KQJZ.js +50 -0
- package/lib/chunk-THO6KQJZ.js.map +1 -0
- package/lib/chunk-THVPSJTK.cjs +47 -0
- package/lib/chunk-THVPSJTK.cjs.map +1 -0
- package/lib/chunk-TIJIXGNJ.cjs +26 -0
- package/lib/chunk-TIJIXGNJ.cjs.map +1 -0
- package/lib/chunk-TM5OCFYV.cjs +61 -0
- package/lib/chunk-TM5OCFYV.cjs.map +1 -0
- package/lib/chunk-TQFODT4D.cjs +35 -0
- package/lib/chunk-TQFODT4D.cjs.map +1 -0
- package/lib/chunk-TSD2PK6H.js +32 -0
- package/lib/chunk-TSD2PK6H.js.map +1 -0
- package/lib/chunk-TSLXKI72.js +60 -0
- package/lib/chunk-TSLXKI72.js.map +1 -0
- package/lib/chunk-U5FTZYJJ.js +45 -0
- package/lib/chunk-U5FTZYJJ.js.map +1 -0
- package/lib/chunk-U6PW4AZV.js +24 -0
- package/lib/chunk-U6PW4AZV.js.map +1 -0
- package/lib/chunk-UB6JC3W7.js +49 -0
- package/lib/chunk-UB6JC3W7.js.map +1 -0
- package/lib/chunk-UBXNH6J3.js +57 -0
- package/lib/chunk-UBXNH6J3.js.map +1 -0
- package/lib/chunk-UP7FR6HD.cjs +66 -0
- package/lib/chunk-UP7FR6HD.cjs.map +1 -0
- package/lib/chunk-VDZUWCIN.cjs +51 -0
- package/lib/chunk-VDZUWCIN.cjs.map +1 -0
- package/lib/chunk-VMJUXZ67.cjs +84 -0
- package/lib/chunk-VMJUXZ67.cjs.map +1 -0
- package/lib/chunk-VNWOCO65.cjs +68 -0
- package/lib/chunk-VNWOCO65.cjs.map +1 -0
- package/lib/chunk-VPXMI42G.cjs +51 -0
- package/lib/chunk-VPXMI42G.cjs.map +1 -0
- package/lib/chunk-VRFSITD3.js +73 -0
- package/lib/chunk-VRFSITD3.js.map +1 -0
- package/lib/chunk-VUCYIRSC.cjs +47 -0
- package/lib/chunk-VUCYIRSC.cjs.map +1 -0
- package/lib/chunk-WAL76UPE.cjs +153 -0
- package/lib/chunk-WAL76UPE.cjs.map +1 -0
- package/lib/chunk-WBPEFNL7.cjs +29 -0
- package/lib/chunk-WBPEFNL7.cjs.map +1 -0
- package/lib/chunk-WKN5RLNR.js +45 -0
- package/lib/chunk-WKN5RLNR.js.map +1 -0
- package/lib/chunk-WP3L72CW.js +55 -0
- package/lib/chunk-WP3L72CW.js.map +1 -0
- package/lib/chunk-WTHX574O.js +66 -0
- package/lib/chunk-WTHX574O.js.map +1 -0
- package/lib/chunk-WXD4O4UY.js +36 -0
- package/lib/chunk-WXD4O4UY.js.map +1 -0
- package/lib/chunk-X2D47UM7.cjs +63 -0
- package/lib/chunk-X2D47UM7.cjs.map +1 -0
- package/lib/chunk-X6PHZA6P.cjs +660 -0
- package/lib/chunk-X6PHZA6P.cjs.map +1 -0
- package/lib/chunk-XD7GS4QW.js +20 -0
- package/lib/chunk-XD7GS4QW.js.map +1 -0
- package/lib/chunk-XMDDYWH5.js +48 -0
- package/lib/chunk-XMDDYWH5.js.map +1 -0
- package/lib/chunk-XPF5Z2WY.js +75 -0
- package/lib/chunk-XPF5Z2WY.js.map +1 -0
- package/lib/chunk-XR3KEV7U.js +49 -0
- package/lib/chunk-XR3KEV7U.js.map +1 -0
- package/lib/chunk-XUC3BYL2.cjs +43 -0
- package/lib/chunk-XUC3BYL2.cjs.map +1 -0
- package/lib/chunk-Y2IGLW5N.js +40 -0
- package/lib/chunk-Y2IGLW5N.js.map +1 -0
- package/lib/chunk-Y3BFYVWA.js +37 -0
- package/lib/chunk-Y3BFYVWA.js.map +1 -0
- package/lib/chunk-YAKNUPNE.cjs +51 -0
- package/lib/chunk-YAKNUPNE.cjs.map +1 -0
- package/lib/chunk-YAVHAWTZ.js +41 -0
- package/lib/chunk-YAVHAWTZ.js.map +1 -0
- package/lib/chunk-YBXRC6MC.js +49 -0
- package/lib/chunk-YBXRC6MC.js.map +1 -0
- package/lib/chunk-YHYBOXVX.cjs +30 -0
- package/lib/chunk-YHYBOXVX.cjs.map +1 -0
- package/lib/chunk-YIDX7HVR.cjs +50 -0
- package/lib/chunk-YIDX7HVR.cjs.map +1 -0
- package/lib/chunk-YN4M5CNJ.js +50 -0
- package/lib/chunk-YN4M5CNJ.js.map +1 -0
- package/lib/chunk-YOHBJHTH.cjs +57 -0
- package/lib/chunk-YOHBJHTH.cjs.map +1 -0
- package/lib/chunk-YUGZUUAU.js +27 -0
- package/lib/chunk-YUGZUUAU.js.map +1 -0
- package/lib/chunk-YY5ENJSH.cjs +63 -0
- package/lib/chunk-YY5ENJSH.cjs.map +1 -0
- package/lib/chunk-Z2QVXW6T.cjs +105 -0
- package/lib/chunk-Z2QVXW6T.cjs.map +1 -0
- package/lib/chunk-Z667GAZJ.js +37 -0
- package/lib/chunk-Z667GAZJ.js.map +1 -0
- package/lib/chunk-Z7DKPFKZ.js +40 -0
- package/lib/chunk-Z7DKPFKZ.js.map +1 -0
- package/lib/chunk-ZAISVVBE.cjs +55 -0
- package/lib/chunk-ZAISVVBE.cjs.map +1 -0
- package/lib/chunk-ZASD6IUL.js +103 -0
- package/lib/chunk-ZASD6IUL.js.map +1 -0
- package/lib/chunk-ZEEB5YAU.js +45 -0
- package/lib/chunk-ZEEB5YAU.js.map +1 -0
- package/lib/chunk-ZFG533LP.js +49 -0
- package/lib/chunk-ZFG533LP.js.map +1 -0
- package/lib/chunk-ZQSCFH5J.cjs +43 -0
- package/lib/chunk-ZQSCFH5J.cjs.map +1 -0
- package/lib/chunk-ZTVQSWSD.cjs +47 -0
- package/lib/chunk-ZTVQSWSD.cjs.map +1 -0
- package/lib/chunk-ZU7GFVQ6.js +153 -0
- package/lib/chunk-ZU7GFVQ6.js.map +1 -0
- package/lib/chunk-ZZF34M2E.cjs +47 -0
- package/lib/chunk-ZZF34M2E.cjs.map +1 -0
- package/lib/client.cjs +7 -151
- package/lib/client.cjs.map +1 -1
- package/lib/client.d.cts +1 -1
- package/lib/client.d.ts +1 -1
- package/lib/client.js +6 -149
- package/lib/client.js.map +1 -1
- package/lib/commercelayer.cjs +26 -105
- package/lib/commercelayer.cjs.map +1 -1
- package/lib/commercelayer.d.cts +6 -7
- package/lib/commercelayer.d.ts +6 -7
- package/lib/commercelayer.js +10 -102
- package/lib/commercelayer.js.map +1 -1
- package/lib/config.cjs +5 -16
- package/lib/config.cjs.map +1 -1
- package/lib/config.d.cts +1 -1
- package/lib/config.d.ts +1 -1
- package/lib/config.js +2 -17
- package/lib/config.js.map +1 -1
- package/lib/debug.cjs +5 -14
- package/lib/debug.cjs.map +1 -1
- package/lib/debug.js +2 -15
- package/lib/debug.js.map +1 -1
- package/lib/enum.cjs +64 -654
- package/lib/enum.cjs.map +1 -1
- package/lib/enum.d.cts +2 -2
- package/lib/enum.d.ts +2 -2
- package/lib/enum.js +2 -641
- package/lib/enum.js.map +1 -1
- package/lib/error.cjs +32 -95
- package/lib/error.cjs.map +1 -1
- package/lib/error.js +3 -91
- package/lib/error.js.map +1 -1
- package/lib/fetch.cjs +11 -62
- package/lib/fetch.cjs.map +1 -1
- package/lib/fetch.d.cts +1 -1
- package/lib/fetch.d.ts +1 -1
- package/lib/fetch.js +3 -60
- package/lib/fetch.js.map +1 -1
- package/lib/index.cjs +672 -18
- package/lib/index.cjs.map +1 -1
- package/lib/index.d.cts +2 -2
- package/lib/index.d.ts +2 -2
- package/lib/index.js +143 -3
- package/lib/index.js.map +1 -1
- package/lib/{interceptor-5MISI1yn.d.cts → interceptor-k15jXzf0.d.cts} +3 -2
- package/lib/{interceptor-5MISI1yn.d.ts → interceptor-k15jXzf0.d.ts} +3 -2
- package/lib/interceptor.d.cts +1 -1
- package/lib/interceptor.d.ts +1 -1
- package/lib/jsonapi.cjs +17 -74
- package/lib/jsonapi.cjs.map +1 -1
- package/lib/jsonapi.d.cts +2 -2
- package/lib/jsonapi.d.ts +2 -2
- package/lib/jsonapi.js +9 -71
- package/lib/jsonapi.js.map +1 -1
- package/lib/model.d.cts +2 -2
- package/lib/model.d.ts +2 -2
- package/lib/query.cjs +16 -59
- package/lib/query.cjs.map +1 -1
- package/lib/query.d.cts +2 -2
- package/lib/query.d.ts +2 -2
- package/lib/query.js +4 -56
- package/lib/query.js.map +1 -1
- package/lib/resource.cjs +29 -211
- package/lib/resource.cjs.map +1 -1
- package/lib/resource.d.cts +2 -2
- package/lib/resource.d.ts +2 -2
- package/lib/resource.js +9 -204
- package/lib/resource.js.map +1 -1
- package/lib/resources/addresses.cjs +12 -50
- package/lib/resources/addresses.cjs.map +1 -1
- package/lib/resources/addresses.d.cts +2 -2
- package/lib/resources/addresses.d.ts +2 -2
- package/lib/resources/addresses.js +10 -52
- package/lib/resources/addresses.js.map +1 -1
- package/lib/resources/adjustments.cjs +12 -32
- package/lib/resources/adjustments.cjs.map +1 -1
- package/lib/resources/adjustments.d.cts +2 -2
- package/lib/resources/adjustments.d.ts +2 -2
- package/lib/resources/adjustments.js +10 -34
- package/lib/resources/adjustments.js.map +1 -1
- package/lib/resources/adyen_gateways.cjs +12 -40
- package/lib/resources/adyen_gateways.cjs.map +1 -1
- package/lib/resources/adyen_gateways.d.cts +2 -2
- package/lib/resources/adyen_gateways.d.ts +2 -2
- package/lib/resources/adyen_gateways.js +10 -42
- package/lib/resources/adyen_gateways.js.map +1 -1
- package/lib/resources/adyen_payments.cjs +12 -46
- package/lib/resources/adyen_payments.cjs.map +1 -1
- package/lib/resources/adyen_payments.d.cts +2 -2
- package/lib/resources/adyen_payments.d.ts +2 -2
- package/lib/resources/adyen_payments.js +10 -48
- package/lib/resources/adyen_payments.js.map +1 -1
- package/lib/resources/applications.cjs +12 -22
- package/lib/resources/applications.cjs.map +1 -1
- package/lib/resources/applications.d.cts +2 -2
- package/lib/resources/applications.d.ts +2 -2
- package/lib/resources/applications.js +10 -24
- package/lib/resources/applications.js.map +1 -1
- package/lib/resources/attachments.cjs +12 -28
- package/lib/resources/attachments.cjs.map +1 -1
- package/lib/resources/attachments.d.cts +2 -2
- package/lib/resources/attachments.d.ts +2 -2
- package/lib/resources/attachments.js +10 -30
- package/lib/resources/attachments.js.map +1 -1
- package/lib/resources/authorizations.cjs +12 -61
- package/lib/resources/authorizations.cjs.map +1 -1
- package/lib/resources/authorizations.d.cts +2 -2
- package/lib/resources/authorizations.d.ts +2 -2
- package/lib/resources/authorizations.js +10 -63
- package/lib/resources/authorizations.js.map +1 -1
- package/lib/resources/avalara_accounts.cjs +12 -48
- package/lib/resources/avalara_accounts.cjs.map +1 -1
- package/lib/resources/avalara_accounts.d.cts +2 -2
- package/lib/resources/avalara_accounts.d.ts +2 -2
- package/lib/resources/avalara_accounts.js +10 -50
- package/lib/resources/avalara_accounts.js.map +1 -1
- package/lib/resources/axerve_gateways.cjs +12 -40
- package/lib/resources/axerve_gateways.cjs.map +1 -1
- package/lib/resources/axerve_gateways.d.cts +2 -2
- package/lib/resources/axerve_gateways.d.ts +2 -2
- package/lib/resources/axerve_gateways.js +10 -42
- package/lib/resources/axerve_gateways.js.map +1 -1
- package/lib/resources/axerve_payments.cjs +12 -43
- package/lib/resources/axerve_payments.cjs.map +1 -1
- package/lib/resources/axerve_payments.d.cts +2 -2
- package/lib/resources/axerve_payments.d.ts +2 -2
- package/lib/resources/axerve_payments.js +10 -45
- package/lib/resources/axerve_payments.js.map +1 -1
- package/lib/resources/bing_geocoders.cjs +12 -40
- package/lib/resources/bing_geocoders.cjs.map +1 -1
- package/lib/resources/bing_geocoders.d.cts +2 -2
- package/lib/resources/bing_geocoders.d.ts +2 -2
- package/lib/resources/bing_geocoders.js +10 -42
- package/lib/resources/bing_geocoders.js.map +1 -1
- package/lib/resources/braintree_gateways.cjs +12 -40
- package/lib/resources/braintree_gateways.cjs.map +1 -1
- package/lib/resources/braintree_gateways.d.cts +2 -2
- package/lib/resources/braintree_gateways.d.ts +2 -2
- package/lib/resources/braintree_gateways.js +10 -42
- package/lib/resources/braintree_gateways.js.map +1 -1
- package/lib/resources/braintree_payments.cjs +12 -40
- package/lib/resources/braintree_payments.cjs.map +1 -1
- package/lib/resources/braintree_payments.d.cts +2 -2
- package/lib/resources/braintree_payments.d.ts +2 -2
- package/lib/resources/braintree_payments.js +10 -42
- package/lib/resources/braintree_payments.js.map +1 -1
- package/lib/resources/bundles.cjs +12 -68
- package/lib/resources/bundles.cjs.map +1 -1
- package/lib/resources/bundles.d.cts +2 -2
- package/lib/resources/bundles.d.ts +2 -2
- package/lib/resources/bundles.js +10 -70
- package/lib/resources/bundles.js.map +1 -1
- package/lib/resources/buy_x_pay_y_promotions.cjs +12 -88
- package/lib/resources/buy_x_pay_y_promotions.cjs.map +1 -1
- package/lib/resources/buy_x_pay_y_promotions.d.cts +2 -2
- package/lib/resources/buy_x_pay_y_promotions.d.ts +2 -2
- package/lib/resources/buy_x_pay_y_promotions.js +10 -90
- package/lib/resources/buy_x_pay_y_promotions.js.map +1 -1
- package/lib/resources/captures.cjs +12 -62
- package/lib/resources/captures.cjs.map +1 -1
- package/lib/resources/captures.d.cts +2 -2
- package/lib/resources/captures.d.ts +2 -2
- package/lib/resources/captures.js +10 -64
- package/lib/resources/captures.js.map +1 -1
- package/lib/resources/carrier_accounts.cjs +12 -40
- package/lib/resources/carrier_accounts.cjs.map +1 -1
- package/lib/resources/carrier_accounts.d.cts +2 -2
- package/lib/resources/carrier_accounts.d.ts +2 -2
- package/lib/resources/carrier_accounts.js +10 -42
- package/lib/resources/carrier_accounts.js.map +1 -1
- package/lib/resources/checkout_com_gateways.cjs +12 -40
- package/lib/resources/checkout_com_gateways.cjs.map +1 -1
- package/lib/resources/checkout_com_gateways.d.cts +2 -2
- package/lib/resources/checkout_com_gateways.d.ts +2 -2
- package/lib/resources/checkout_com_gateways.js +10 -42
- package/lib/resources/checkout_com_gateways.js.map +1 -1
- package/lib/resources/checkout_com_payments.cjs +12 -46
- package/lib/resources/checkout_com_payments.cjs.map +1 -1
- package/lib/resources/checkout_com_payments.d.cts +2 -2
- package/lib/resources/checkout_com_payments.d.ts +2 -2
- package/lib/resources/checkout_com_payments.js +10 -48
- package/lib/resources/checkout_com_payments.js.map +1 -1
- package/lib/resources/cleanups.cjs +12 -39
- package/lib/resources/cleanups.cjs.map +1 -1
- package/lib/resources/cleanups.d.cts +2 -2
- package/lib/resources/cleanups.d.ts +2 -2
- package/lib/resources/cleanups.js +10 -41
- package/lib/resources/cleanups.js.map +1 -1
- package/lib/resources/coupon_codes_promotion_rules.cjs +12 -36
- package/lib/resources/coupon_codes_promotion_rules.cjs.map +1 -1
- package/lib/resources/coupon_codes_promotion_rules.d.cts +2 -2
- package/lib/resources/coupon_codes_promotion_rules.d.ts +2 -2
- package/lib/resources/coupon_codes_promotion_rules.js +10 -38
- package/lib/resources/coupon_codes_promotion_rules.js.map +1 -1
- package/lib/resources/coupon_recipients.cjs +12 -40
- package/lib/resources/coupon_recipients.cjs.map +1 -1
- package/lib/resources/coupon_recipients.d.cts +2 -2
- package/lib/resources/coupon_recipients.d.ts +2 -2
- package/lib/resources/coupon_recipients.js +10 -42
- package/lib/resources/coupon_recipients.js.map +1 -1
- package/lib/resources/coupons.cjs +12 -54
- package/lib/resources/coupons.cjs.map +1 -1
- package/lib/resources/coupons.d.cts +2 -2
- package/lib/resources/coupons.d.ts +2 -2
- package/lib/resources/coupons.js +10 -56
- package/lib/resources/coupons.js.map +1 -1
- package/lib/resources/custom_promotion_rules.cjs +12 -32
- package/lib/resources/custom_promotion_rules.cjs.map +1 -1
- package/lib/resources/custom_promotion_rules.d.cts +2 -2
- package/lib/resources/custom_promotion_rules.d.ts +2 -2
- package/lib/resources/custom_promotion_rules.js +10 -34
- package/lib/resources/custom_promotion_rules.js.map +1 -1
- package/lib/resources/customer_addresses.cjs +12 -44
- package/lib/resources/customer_addresses.cjs.map +1 -1
- package/lib/resources/customer_addresses.d.cts +2 -2
- package/lib/resources/customer_addresses.d.ts +2 -2
- package/lib/resources/customer_addresses.js +10 -46
- package/lib/resources/customer_addresses.js.map +1 -1
- package/lib/resources/customer_groups.cjs +12 -44
- package/lib/resources/customer_groups.cjs.map +1 -1
- package/lib/resources/customer_groups.d.cts +2 -2
- package/lib/resources/customer_groups.d.ts +2 -2
- package/lib/resources/customer_groups.js +10 -46
- package/lib/resources/customer_groups.js.map +1 -1
- package/lib/resources/customer_password_resets.cjs +12 -39
- package/lib/resources/customer_password_resets.cjs.map +1 -1
- package/lib/resources/customer_password_resets.d.cts +2 -2
- package/lib/resources/customer_password_resets.d.ts +2 -2
- package/lib/resources/customer_password_resets.js +10 -41
- package/lib/resources/customer_password_resets.js.map +1 -1
- package/lib/resources/customer_payment_sources.cjs +12 -40
- package/lib/resources/customer_payment_sources.cjs.map +1 -1
- package/lib/resources/customer_payment_sources.d.cts +2 -2
- package/lib/resources/customer_payment_sources.d.ts +2 -2
- package/lib/resources/customer_payment_sources.js +10 -42
- package/lib/resources/customer_payment_sources.js.map +1 -1
- package/lib/resources/customer_subscriptions.cjs +12 -40
- package/lib/resources/customer_subscriptions.cjs.map +1 -1
- package/lib/resources/customer_subscriptions.d.cts +2 -2
- package/lib/resources/customer_subscriptions.d.ts +2 -2
- package/lib/resources/customer_subscriptions.js +10 -42
- package/lib/resources/customer_subscriptions.js.map +1 -1
- package/lib/resources/customers.cjs +12 -78
- package/lib/resources/customers.cjs.map +1 -1
- package/lib/resources/customers.d.cts +2 -2
- package/lib/resources/customers.d.ts +2 -2
- package/lib/resources/customers.js +10 -80
- package/lib/resources/customers.js.map +1 -1
- package/lib/resources/delivery_lead_times.cjs +12 -44
- package/lib/resources/delivery_lead_times.cjs.map +1 -1
- package/lib/resources/delivery_lead_times.d.cts +2 -2
- package/lib/resources/delivery_lead_times.d.ts +2 -2
- package/lib/resources/delivery_lead_times.js +10 -46
- package/lib/resources/delivery_lead_times.js.map +1 -1
- package/lib/resources/discount_engine_items.cjs +12 -27
- package/lib/resources/discount_engine_items.cjs.map +1 -1
- package/lib/resources/discount_engine_items.d.cts +2 -2
- package/lib/resources/discount_engine_items.d.ts +2 -2
- package/lib/resources/discount_engine_items.js +10 -29
- package/lib/resources/discount_engine_items.js.map +1 -1
- package/lib/resources/discount_engines.cjs +12 -35
- package/lib/resources/discount_engines.cjs.map +1 -1
- package/lib/resources/discount_engines.d.cts +2 -2
- package/lib/resources/discount_engines.d.ts +2 -2
- package/lib/resources/discount_engines.js +10 -37
- package/lib/resources/discount_engines.js.map +1 -1
- package/lib/resources/easypost_pickups.cjs +12 -43
- package/lib/resources/easypost_pickups.cjs.map +1 -1
- package/lib/resources/easypost_pickups.d.cts +2 -2
- package/lib/resources/easypost_pickups.d.ts +2 -2
- package/lib/resources/easypost_pickups.js +10 -45
- package/lib/resources/easypost_pickups.js.map +1 -1
- package/lib/resources/event_callbacks.cjs +12 -23
- package/lib/resources/event_callbacks.cjs.map +1 -1
- package/lib/resources/event_callbacks.d.cts +2 -2
- package/lib/resources/event_callbacks.d.ts +2 -2
- package/lib/resources/event_callbacks.js +10 -25
- package/lib/resources/event_callbacks.js.map +1 -1
- package/lib/resources/events.cjs +12 -33
- package/lib/resources/events.cjs.map +1 -1
- package/lib/resources/events.d.cts +2 -2
- package/lib/resources/events.d.ts +2 -2
- package/lib/resources/events.js +10 -35
- package/lib/resources/events.js.map +1 -1
- package/lib/resources/exports.cjs +12 -39
- package/lib/resources/exports.cjs.map +1 -1
- package/lib/resources/exports.d.cts +2 -2
- package/lib/resources/exports.d.ts +2 -2
- package/lib/resources/exports.js +10 -41
- package/lib/resources/exports.js.map +1 -1
- package/lib/resources/external_gateways.cjs +12 -43
- package/lib/resources/external_gateways.cjs.map +1 -1
- package/lib/resources/external_gateways.d.cts +2 -2
- package/lib/resources/external_gateways.d.ts +2 -2
- package/lib/resources/external_gateways.js +10 -45
- package/lib/resources/external_gateways.js.map +1 -1
- package/lib/resources/external_payments.cjs +12 -44
- package/lib/resources/external_payments.cjs.map +1 -1
- package/lib/resources/external_payments.d.cts +2 -2
- package/lib/resources/external_payments.d.ts +2 -2
- package/lib/resources/external_payments.js +10 -46
- package/lib/resources/external_payments.js.map +1 -1
- package/lib/resources/external_promotions.cjs +12 -91
- package/lib/resources/external_promotions.cjs.map +1 -1
- package/lib/resources/external_promotions.d.cts +2 -2
- package/lib/resources/external_promotions.d.ts +2 -2
- package/lib/resources/external_promotions.js +10 -93
- package/lib/resources/external_promotions.js.map +1 -1
- package/lib/resources/external_tax_calculators.cjs +12 -47
- package/lib/resources/external_tax_calculators.cjs.map +1 -1
- package/lib/resources/external_tax_calculators.d.cts +2 -2
- package/lib/resources/external_tax_calculators.d.ts +2 -2
- package/lib/resources/external_tax_calculators.js +10 -49
- package/lib/resources/external_tax_calculators.js.map +1 -1
- package/lib/resources/fixed_amount_promotions.cjs +12 -88
- package/lib/resources/fixed_amount_promotions.cjs.map +1 -1
- package/lib/resources/fixed_amount_promotions.d.cts +2 -2
- package/lib/resources/fixed_amount_promotions.d.ts +2 -2
- package/lib/resources/fixed_amount_promotions.js +10 -90
- package/lib/resources/fixed_amount_promotions.js.map +1 -1
- package/lib/resources/fixed_price_promotions.cjs +12 -88
- package/lib/resources/fixed_price_promotions.cjs.map +1 -1
- package/lib/resources/fixed_price_promotions.d.cts +2 -2
- package/lib/resources/fixed_price_promotions.d.ts +2 -2
- package/lib/resources/fixed_price_promotions.js +10 -90
- package/lib/resources/fixed_price_promotions.js.map +1 -1
- package/lib/resources/flex_promotions.cjs +12 -64
- package/lib/resources/flex_promotions.cjs.map +1 -1
- package/lib/resources/flex_promotions.d.cts +2 -2
- package/lib/resources/flex_promotions.d.ts +2 -2
- package/lib/resources/flex_promotions.js +10 -66
- package/lib/resources/flex_promotions.js.map +1 -1
- package/lib/resources/free_gift_promotions.cjs +12 -88
- package/lib/resources/free_gift_promotions.cjs.map +1 -1
- package/lib/resources/free_gift_promotions.d.cts +2 -2
- package/lib/resources/free_gift_promotions.d.ts +2 -2
- package/lib/resources/free_gift_promotions.js +10 -90
- package/lib/resources/free_gift_promotions.js.map +1 -1
- package/lib/resources/free_shipping_promotions.cjs +12 -84
- package/lib/resources/free_shipping_promotions.cjs.map +1 -1
- package/lib/resources/free_shipping_promotions.d.cts +2 -2
- package/lib/resources/free_shipping_promotions.d.ts +2 -2
- package/lib/resources/free_shipping_promotions.js +10 -86
- package/lib/resources/free_shipping_promotions.js.map +1 -1
- package/lib/resources/geocoders.cjs +12 -31
- package/lib/resources/geocoders.cjs.map +1 -1
- package/lib/resources/geocoders.d.cts +2 -2
- package/lib/resources/geocoders.d.ts +2 -2
- package/lib/resources/geocoders.js +10 -33
- package/lib/resources/geocoders.js.map +1 -1
- package/lib/resources/gift_card_recipients.cjs +12 -40
- package/lib/resources/gift_card_recipients.cjs.map +1 -1
- package/lib/resources/gift_card_recipients.d.cts +2 -2
- package/lib/resources/gift_card_recipients.d.ts +2 -2
- package/lib/resources/gift_card_recipients.js +10 -42
- package/lib/resources/gift_card_recipients.js.map +1 -1
- package/lib/resources/gift_cards.cjs +12 -70
- package/lib/resources/gift_cards.cjs.map +1 -1
- package/lib/resources/gift_cards.d.cts +2 -2
- package/lib/resources/gift_cards.d.ts +2 -2
- package/lib/resources/gift_cards.js +10 -72
- package/lib/resources/gift_cards.js.map +1 -1
- package/lib/resources/google_geocoders.cjs +12 -40
- package/lib/resources/google_geocoders.cjs.map +1 -1
- package/lib/resources/google_geocoders.d.cts +2 -2
- package/lib/resources/google_geocoders.d.ts +2 -2
- package/lib/resources/google_geocoders.js +10 -42
- package/lib/resources/google_geocoders.js.map +1 -1
- package/lib/resources/imports.cjs +12 -35
- package/lib/resources/imports.cjs.map +1 -1
- package/lib/resources/imports.d.cts +2 -2
- package/lib/resources/imports.d.ts +2 -2
- package/lib/resources/imports.js +10 -37
- package/lib/resources/imports.js.map +1 -1
- package/lib/resources/in_stock_subscriptions.cjs +12 -54
- package/lib/resources/in_stock_subscriptions.cjs.map +1 -1
- package/lib/resources/in_stock_subscriptions.d.cts +2 -2
- package/lib/resources/in_stock_subscriptions.d.ts +2 -2
- package/lib/resources/in_stock_subscriptions.js +10 -56
- package/lib/resources/in_stock_subscriptions.js.map +1 -1
- package/lib/resources/inventory_models.cjs +12 -44
- package/lib/resources/inventory_models.cjs.map +1 -1
- package/lib/resources/inventory_models.d.cts +2 -2
- package/lib/resources/inventory_models.d.ts +2 -2
- package/lib/resources/inventory_models.js +10 -46
- package/lib/resources/inventory_models.js.map +1 -1
- package/lib/resources/inventory_return_locations.cjs +12 -40
- package/lib/resources/inventory_return_locations.cjs.map +1 -1
- package/lib/resources/inventory_return_locations.d.cts +2 -2
- package/lib/resources/inventory_return_locations.d.ts +2 -2
- package/lib/resources/inventory_return_locations.js +10 -42
- package/lib/resources/inventory_return_locations.js.map +1 -1
- package/lib/resources/inventory_stock_locations.cjs +12 -40
- package/lib/resources/inventory_stock_locations.cjs.map +1 -1
- package/lib/resources/inventory_stock_locations.d.cts +2 -2
- package/lib/resources/inventory_stock_locations.d.ts +2 -2
- package/lib/resources/inventory_stock_locations.js +10 -42
- package/lib/resources/inventory_stock_locations.js.map +1 -1
- package/lib/resources/klarna_gateways.cjs +12 -40
- package/lib/resources/klarna_gateways.cjs.map +1 -1
- package/lib/resources/klarna_gateways.d.cts +2 -2
- package/lib/resources/klarna_gateways.d.ts +2 -2
- package/lib/resources/klarna_gateways.js +10 -42
- package/lib/resources/klarna_gateways.js.map +1 -1
- package/lib/resources/klarna_payments.cjs +12 -43
- package/lib/resources/klarna_payments.cjs.map +1 -1
- package/lib/resources/klarna_payments.d.cts +2 -2
- package/lib/resources/klarna_payments.d.ts +2 -2
- package/lib/resources/klarna_payments.js +10 -45
- package/lib/resources/klarna_payments.js.map +1 -1
- package/lib/resources/line_item_options.cjs +12 -50
- package/lib/resources/line_item_options.cjs.map +1 -1
- package/lib/resources/line_item_options.d.cts +2 -2
- package/lib/resources/line_item_options.d.ts +2 -2
- package/lib/resources/line_item_options.js +10 -52
- package/lib/resources/line_item_options.js.map +1 -1
- package/lib/resources/line_items.cjs +12 -79
- package/lib/resources/line_items.cjs.map +1 -1
- package/lib/resources/line_items.d.cts +2 -2
- package/lib/resources/line_items.d.ts +2 -2
- package/lib/resources/line_items.js +10 -81
- package/lib/resources/line_items.js.map +1 -1
- package/lib/resources/links.cjs +12 -38
- package/lib/resources/links.cjs.map +1 -1
- package/lib/resources/links.d.cts +2 -2
- package/lib/resources/links.d.ts +2 -2
- package/lib/resources/links.js +10 -40
- package/lib/resources/links.js.map +1 -1
- package/lib/resources/manual_gateways.cjs +12 -36
- package/lib/resources/manual_gateways.cjs.map +1 -1
- package/lib/resources/manual_gateways.d.cts +2 -2
- package/lib/resources/manual_gateways.d.ts +2 -2
- package/lib/resources/manual_gateways.js +10 -38
- package/lib/resources/manual_gateways.js.map +1 -1
- package/lib/resources/manual_tax_calculators.cjs +12 -48
- package/lib/resources/manual_tax_calculators.cjs.map +1 -1
- package/lib/resources/manual_tax_calculators.d.cts +2 -2
- package/lib/resources/manual_tax_calculators.d.ts +2 -2
- package/lib/resources/manual_tax_calculators.js +10 -50
- package/lib/resources/manual_tax_calculators.js.map +1 -1
- package/lib/resources/markets.cjs +12 -90
- package/lib/resources/markets.cjs.map +1 -1
- package/lib/resources/markets.d.cts +2 -2
- package/lib/resources/markets.d.ts +2 -2
- package/lib/resources/markets.js +10 -92
- package/lib/resources/markets.js.map +1 -1
- package/lib/resources/merchants.cjs +12 -40
- package/lib/resources/merchants.cjs.map +1 -1
- package/lib/resources/merchants.d.cts +2 -2
- package/lib/resources/merchants.d.ts +2 -2
- package/lib/resources/merchants.js +10 -42
- package/lib/resources/merchants.js.map +1 -1
- package/lib/resources/notifications.cjs +12 -28
- package/lib/resources/notifications.cjs.map +1 -1
- package/lib/resources/notifications.d.cts +2 -2
- package/lib/resources/notifications.d.ts +2 -2
- package/lib/resources/notifications.js +10 -30
- package/lib/resources/notifications.js.map +1 -1
- package/lib/resources/order_amount_promotion_rules.cjs +12 -32
- package/lib/resources/order_amount_promotion_rules.cjs.map +1 -1
- package/lib/resources/order_amount_promotion_rules.d.cts +2 -2
- package/lib/resources/order_amount_promotion_rules.d.ts +2 -2
- package/lib/resources/order_amount_promotion_rules.js +10 -34
- package/lib/resources/order_amount_promotion_rules.js.map +1 -1
- package/lib/resources/order_copies.cjs +12 -44
- package/lib/resources/order_copies.cjs.map +1 -1
- package/lib/resources/order_copies.d.cts +2 -2
- package/lib/resources/order_copies.d.ts +2 -2
- package/lib/resources/order_copies.js +10 -46
- package/lib/resources/order_copies.js.map +1 -1
- package/lib/resources/order_factories.cjs +12 -31
- package/lib/resources/order_factories.cjs.map +1 -1
- package/lib/resources/order_factories.d.cts +2 -2
- package/lib/resources/order_factories.d.ts +2 -2
- package/lib/resources/order_factories.js +10 -33
- package/lib/resources/order_factories.js.map +1 -1
- package/lib/resources/order_subscription_items.cjs +12 -36
- package/lib/resources/order_subscription_items.cjs.map +1 -1
- package/lib/resources/order_subscription_items.d.cts +2 -2
- package/lib/resources/order_subscription_items.d.ts +2 -2
- package/lib/resources/order_subscription_items.js +10 -38
- package/lib/resources/order_subscription_items.js.map +1 -1
- package/lib/resources/order_subscriptions.cjs +12 -94
- package/lib/resources/order_subscriptions.cjs.map +1 -1
- package/lib/resources/order_subscriptions.d.cts +2 -2
- package/lib/resources/order_subscriptions.d.ts +2 -2
- package/lib/resources/order_subscriptions.js +10 -96
- package/lib/resources/order_subscriptions.js.map +1 -1
- package/lib/resources/orders.cjs +12 -271
- package/lib/resources/orders.cjs.map +1 -1
- package/lib/resources/orders.d.cts +2 -2
- package/lib/resources/orders.d.ts +2 -2
- package/lib/resources/orders.js +10 -273
- package/lib/resources/orders.js.map +1 -1
- package/lib/resources/organizations.cjs +12 -22
- package/lib/resources/organizations.cjs.map +1 -1
- package/lib/resources/organizations.d.cts +2 -2
- package/lib/resources/organizations.d.ts +2 -2
- package/lib/resources/organizations.js +10 -24
- package/lib/resources/organizations.js.map +1 -1
- package/lib/resources/packages.cjs +12 -44
- package/lib/resources/packages.cjs.map +1 -1
- package/lib/resources/packages.d.cts +2 -2
- package/lib/resources/packages.d.ts +2 -2
- package/lib/resources/packages.js +10 -46
- package/lib/resources/packages.js.map +1 -1
- package/lib/resources/parcel_line_items.cjs +12 -40
- package/lib/resources/parcel_line_items.cjs.map +1 -1
- package/lib/resources/parcel_line_items.d.cts +2 -2
- package/lib/resources/parcel_line_items.d.ts +2 -2
- package/lib/resources/parcel_line_items.js +10 -42
- package/lib/resources/parcel_line_items.js.map +1 -1
- package/lib/resources/parcels.cjs +12 -52
- package/lib/resources/parcels.cjs.map +1 -1
- package/lib/resources/parcels.d.cts +2 -2
- package/lib/resources/parcels.d.ts +2 -2
- package/lib/resources/parcels.js +10 -54
- package/lib/resources/parcels.js.map +1 -1
- package/lib/resources/payment_gateways.cjs +12 -27
- package/lib/resources/payment_gateways.cjs.map +1 -1
- package/lib/resources/payment_gateways.d.cts +2 -2
- package/lib/resources/payment_gateways.d.ts +2 -2
- package/lib/resources/payment_gateways.js +10 -29
- package/lib/resources/payment_gateways.js.map +1 -1
- package/lib/resources/payment_methods.cjs +12 -58
- package/lib/resources/payment_methods.cjs.map +1 -1
- package/lib/resources/payment_methods.d.cts +2 -2
- package/lib/resources/payment_methods.d.ts +2 -2
- package/lib/resources/payment_methods.js +10 -60
- package/lib/resources/payment_methods.js.map +1 -1
- package/lib/resources/payment_options.cjs +12 -36
- package/lib/resources/payment_options.cjs.map +1 -1
- package/lib/resources/payment_options.d.cts +2 -2
- package/lib/resources/payment_options.d.ts +2 -2
- package/lib/resources/payment_options.js +10 -38
- package/lib/resources/payment_options.js.map +1 -1
- package/lib/resources/paypal_gateways.cjs +12 -40
- package/lib/resources/paypal_gateways.cjs.map +1 -1
- package/lib/resources/paypal_gateways.d.cts +2 -2
- package/lib/resources/paypal_gateways.d.ts +2 -2
- package/lib/resources/paypal_gateways.js +10 -42
- package/lib/resources/paypal_gateways.js.map +1 -1
- package/lib/resources/paypal_payments.cjs +12 -40
- package/lib/resources/paypal_payments.cjs.map +1 -1
- package/lib/resources/paypal_payments.d.cts +2 -2
- package/lib/resources/paypal_payments.d.ts +2 -2
- package/lib/resources/paypal_payments.js +10 -42
- package/lib/resources/paypal_payments.js.map +1 -1
- package/lib/resources/percentage_discount_promotions.cjs +12 -88
- package/lib/resources/percentage_discount_promotions.cjs.map +1 -1
- package/lib/resources/percentage_discount_promotions.d.cts +2 -2
- package/lib/resources/percentage_discount_promotions.d.ts +2 -2
- package/lib/resources/percentage_discount_promotions.js +10 -90
- package/lib/resources/percentage_discount_promotions.js.map +1 -1
- package/lib/resources/pickups.cjs +12 -31
- package/lib/resources/pickups.cjs.map +1 -1
- package/lib/resources/pickups.d.cts +2 -2
- package/lib/resources/pickups.d.ts +2 -2
- package/lib/resources/pickups.js +10 -33
- package/lib/resources/pickups.js.map +1 -1
- package/lib/resources/price_frequency_tiers.cjs +12 -44
- package/lib/resources/price_frequency_tiers.cjs.map +1 -1
- package/lib/resources/price_frequency_tiers.d.cts +2 -2
- package/lib/resources/price_frequency_tiers.d.ts +2 -2
- package/lib/resources/price_frequency_tiers.js +10 -46
- package/lib/resources/price_frequency_tiers.js.map +1 -1
- package/lib/resources/price_list_schedulers.cjs +12 -50
- package/lib/resources/price_list_schedulers.cjs.map +1 -1
- package/lib/resources/price_list_schedulers.d.cts +2 -2
- package/lib/resources/price_list_schedulers.d.ts +2 -2
- package/lib/resources/price_list_schedulers.js +10 -52
- package/lib/resources/price_list_schedulers.js.map +1 -1
- package/lib/resources/price_lists.cjs +12 -44
- package/lib/resources/price_lists.cjs.map +1 -1
- package/lib/resources/price_lists.d.cts +2 -2
- package/lib/resources/price_lists.d.ts +2 -2
- package/lib/resources/price_lists.js +10 -46
- package/lib/resources/price_lists.js.map +1 -1
- package/lib/resources/price_tiers.cjs +12 -31
- package/lib/resources/price_tiers.cjs.map +1 -1
- package/lib/resources/price_tiers.d.cts +2 -2
- package/lib/resources/price_tiers.d.ts +2 -2
- package/lib/resources/price_tiers.js +10 -33
- package/lib/resources/price_tiers.js.map +1 -1
- package/lib/resources/price_volume_tiers.cjs +12 -44
- package/lib/resources/price_volume_tiers.cjs.map +1 -1
- package/lib/resources/price_volume_tiers.d.cts +2 -2
- package/lib/resources/price_volume_tiers.d.ts +2 -2
- package/lib/resources/price_volume_tiers.js +10 -46
- package/lib/resources/price_volume_tiers.js.map +1 -1
- package/lib/resources/prices.cjs +12 -68
- package/lib/resources/prices.cjs.map +1 -1
- package/lib/resources/prices.d.cts +2 -2
- package/lib/resources/prices.d.ts +2 -2
- package/lib/resources/prices.js +10 -70
- package/lib/resources/prices.js.map +1 -1
- package/lib/resources/promotion_rules.cjs +12 -23
- package/lib/resources/promotion_rules.cjs.map +1 -1
- package/lib/resources/promotion_rules.d.cts +2 -2
- package/lib/resources/promotion_rules.d.ts +2 -2
- package/lib/resources/promotion_rules.js +10 -25
- package/lib/resources/promotion_rules.js.map +1 -1
- package/lib/resources/promotions.cjs +12 -63
- package/lib/resources/promotions.cjs.map +1 -1
- package/lib/resources/promotions.d.cts +2 -2
- package/lib/resources/promotions.d.ts +2 -2
- package/lib/resources/promotions.js +10 -65
- package/lib/resources/promotions.js.map +1 -1
- package/lib/resources/recurring_order_copies.cjs +12 -44
- package/lib/resources/recurring_order_copies.cjs.map +1 -1
- package/lib/resources/recurring_order_copies.d.cts +2 -2
- package/lib/resources/recurring_order_copies.d.ts +2 -2
- package/lib/resources/recurring_order_copies.js +10 -46
- package/lib/resources/recurring_order_copies.js.map +1 -1
- package/lib/resources/refunds.cjs +12 -49
- package/lib/resources/refunds.cjs.map +1 -1
- package/lib/resources/refunds.d.cts +2 -2
- package/lib/resources/refunds.d.ts +2 -2
- package/lib/resources/refunds.js +10 -51
- package/lib/resources/refunds.js.map +1 -1
- package/lib/resources/reserved_stocks.cjs +12 -35
- package/lib/resources/reserved_stocks.cjs.map +1 -1
- package/lib/resources/reserved_stocks.d.cts +2 -2
- package/lib/resources/reserved_stocks.d.ts +2 -2
- package/lib/resources/reserved_stocks.js +10 -37
- package/lib/resources/reserved_stocks.js.map +1 -1
- package/lib/resources/resource_errors.cjs +12 -19
- package/lib/resources/resource_errors.cjs.map +1 -1
- package/lib/resources/resource_errors.d.cts +2 -2
- package/lib/resources/resource_errors.d.ts +2 -2
- package/lib/resources/resource_errors.js +10 -21
- package/lib/resources/resource_errors.js.map +1 -1
- package/lib/resources/return_line_items.cjs +12 -39
- package/lib/resources/return_line_items.cjs.map +1 -1
- package/lib/resources/return_line_items.d.cts +2 -2
- package/lib/resources/return_line_items.d.ts +2 -2
- package/lib/resources/return_line_items.js +10 -41
- package/lib/resources/return_line_items.js.map +1 -1
- package/lib/resources/returns.cjs +12 -119
- package/lib/resources/returns.cjs.map +1 -1
- package/lib/resources/returns.d.cts +2 -2
- package/lib/resources/returns.d.ts +2 -2
- package/lib/resources/returns.js +10 -121
- package/lib/resources/returns.js.map +1 -1
- package/lib/resources/satispay_gateways.cjs +12 -40
- package/lib/resources/satispay_gateways.cjs.map +1 -1
- package/lib/resources/satispay_gateways.d.cts +2 -2
- package/lib/resources/satispay_gateways.d.ts +2 -2
- package/lib/resources/satispay_gateways.js +10 -42
- package/lib/resources/satispay_gateways.js.map +1 -1
- package/lib/resources/satispay_payments.cjs +12 -43
- package/lib/resources/satispay_payments.cjs.map +1 -1
- package/lib/resources/satispay_payments.d.cts +2 -2
- package/lib/resources/satispay_payments.d.ts +2 -2
- package/lib/resources/satispay_payments.js +10 -45
- package/lib/resources/satispay_payments.js.map +1 -1
- package/lib/resources/shipments.cjs +12 -149
- package/lib/resources/shipments.cjs.map +1 -1
- package/lib/resources/shipments.d.cts +2 -2
- package/lib/resources/shipments.d.ts +2 -2
- package/lib/resources/shipments.js +10 -151
- package/lib/resources/shipments.js.map +1 -1
- package/lib/resources/shipping_categories.cjs +12 -40
- package/lib/resources/shipping_categories.cjs.map +1 -1
- package/lib/resources/shipping_categories.d.cts +2 -2
- package/lib/resources/shipping_categories.d.ts +2 -2
- package/lib/resources/shipping_categories.js +10 -42
- package/lib/resources/shipping_categories.js.map +1 -1
- package/lib/resources/shipping_method_tiers.cjs +12 -31
- package/lib/resources/shipping_method_tiers.cjs.map +1 -1
- package/lib/resources/shipping_method_tiers.d.cts +2 -2
- package/lib/resources/shipping_method_tiers.d.ts +2 -2
- package/lib/resources/shipping_method_tiers.js +10 -33
- package/lib/resources/shipping_method_tiers.js.map +1 -1
- package/lib/resources/shipping_methods.cjs +12 -77
- package/lib/resources/shipping_methods.cjs.map +1 -1
- package/lib/resources/shipping_methods.d.cts +2 -2
- package/lib/resources/shipping_methods.d.ts +2 -2
- package/lib/resources/shipping_methods.js +10 -79
- package/lib/resources/shipping_methods.js.map +1 -1
- package/lib/resources/shipping_weight_tiers.cjs +12 -40
- package/lib/resources/shipping_weight_tiers.cjs.map +1 -1
- package/lib/resources/shipping_weight_tiers.d.cts +2 -2
- package/lib/resources/shipping_weight_tiers.d.ts +2 -2
- package/lib/resources/shipping_weight_tiers.js +10 -42
- package/lib/resources/shipping_weight_tiers.js.map +1 -1
- package/lib/resources/shipping_zones.cjs +12 -36
- package/lib/resources/shipping_zones.cjs.map +1 -1
- package/lib/resources/shipping_zones.d.cts +2 -2
- package/lib/resources/shipping_zones.d.ts +2 -2
- package/lib/resources/shipping_zones.js +10 -38
- package/lib/resources/shipping_zones.js.map +1 -1
- package/lib/resources/sku_list_items.cjs +12 -40
- package/lib/resources/sku_list_items.cjs.map +1 -1
- package/lib/resources/sku_list_items.d.cts +2 -2
- package/lib/resources/sku_list_items.d.ts +2 -2
- package/lib/resources/sku_list_items.js +10 -42
- package/lib/resources/sku_list_items.js.map +1 -1
- package/lib/resources/sku_list_promotion_rules.cjs +12 -40
- package/lib/resources/sku_list_promotion_rules.cjs.map +1 -1
- package/lib/resources/sku_list_promotion_rules.d.cts +2 -2
- package/lib/resources/sku_list_promotion_rules.d.ts +2 -2
- package/lib/resources/sku_list_promotion_rules.js +10 -42
- package/lib/resources/sku_list_promotion_rules.js.map +1 -1
- package/lib/resources/sku_lists.cjs +12 -56
- package/lib/resources/sku_lists.cjs.map +1 -1
- package/lib/resources/sku_lists.d.cts +2 -2
- package/lib/resources/sku_lists.d.ts +2 -2
- package/lib/resources/sku_lists.js +10 -58
- package/lib/resources/sku_lists.js.map +1 -1
- package/lib/resources/sku_options.cjs +12 -54
- package/lib/resources/sku_options.cjs.map +1 -1
- package/lib/resources/sku_options.d.cts +2 -2
- package/lib/resources/sku_options.d.ts +2 -2
- package/lib/resources/sku_options.js +10 -56
- package/lib/resources/sku_options.js.map +1 -1
- package/lib/resources/skus.cjs +12 -98
- package/lib/resources/skus.cjs.map +1 -1
- package/lib/resources/skus.d.cts +2 -2
- package/lib/resources/skus.d.ts +2 -2
- package/lib/resources/skus.js +10 -100
- package/lib/resources/skus.js.map +1 -1
- package/lib/resources/stock_items.cjs +12 -55
- package/lib/resources/stock_items.cjs.map +1 -1
- package/lib/resources/stock_items.d.cts +2 -2
- package/lib/resources/stock_items.d.ts +2 -2
- package/lib/resources/stock_items.js +10 -57
- package/lib/resources/stock_items.js.map +1 -1
- package/lib/resources/stock_line_items.cjs +12 -61
- package/lib/resources/stock_line_items.cjs.map +1 -1
- package/lib/resources/stock_line_items.d.cts +2 -2
- package/lib/resources/stock_line_items.d.ts +2 -2
- package/lib/resources/stock_line_items.js +10 -63
- package/lib/resources/stock_line_items.js.map +1 -1
- package/lib/resources/stock_locations.cjs +12 -60
- package/lib/resources/stock_locations.cjs.map +1 -1
- package/lib/resources/stock_locations.d.cts +2 -2
- package/lib/resources/stock_locations.d.ts +2 -2
- package/lib/resources/stock_locations.js +10 -62
- package/lib/resources/stock_locations.js.map +1 -1
- package/lib/resources/stock_reservations.cjs +12 -59
- package/lib/resources/stock_reservations.cjs.map +1 -1
- package/lib/resources/stock_reservations.d.cts +2 -2
- package/lib/resources/stock_reservations.d.ts +2 -2
- package/lib/resources/stock_reservations.js +10 -61
- package/lib/resources/stock_reservations.js.map +1 -1
- package/lib/resources/stock_transfers.cjs +12 -82
- package/lib/resources/stock_transfers.cjs.map +1 -1
- package/lib/resources/stock_transfers.d.cts +2 -2
- package/lib/resources/stock_transfers.d.ts +2 -2
- package/lib/resources/stock_transfers.js +10 -84
- package/lib/resources/stock_transfers.js.map +1 -1
- package/lib/resources/stores.cjs +12 -56
- package/lib/resources/stores.cjs.map +1 -1
- package/lib/resources/stores.d.cts +2 -2
- package/lib/resources/stores.d.ts +2 -2
- package/lib/resources/stores.js +10 -58
- package/lib/resources/stores.js.map +1 -1
- package/lib/resources/stripe_gateways.cjs +12 -40
- package/lib/resources/stripe_gateways.cjs.map +1 -1
- package/lib/resources/stripe_gateways.d.cts +2 -2
- package/lib/resources/stripe_gateways.d.ts +2 -2
- package/lib/resources/stripe_gateways.js +10 -42
- package/lib/resources/stripe_gateways.js.map +1 -1
- package/lib/resources/stripe_payments.cjs +12 -46
- package/lib/resources/stripe_payments.cjs.map +1 -1
- package/lib/resources/stripe_payments.d.cts +2 -2
- package/lib/resources/stripe_payments.d.ts +2 -2
- package/lib/resources/stripe_payments.js +10 -48
- package/lib/resources/stripe_payments.js.map +1 -1
- package/lib/resources/stripe_tax_accounts.cjs +12 -48
- package/lib/resources/stripe_tax_accounts.cjs.map +1 -1
- package/lib/resources/stripe_tax_accounts.d.cts +2 -2
- package/lib/resources/stripe_tax_accounts.d.ts +2 -2
- package/lib/resources/stripe_tax_accounts.js +10 -50
- package/lib/resources/stripe_tax_accounts.js.map +1 -1
- package/lib/resources/subscription_models.cjs +12 -40
- package/lib/resources/subscription_models.cjs.map +1 -1
- package/lib/resources/subscription_models.d.cts +2 -2
- package/lib/resources/subscription_models.d.ts +2 -2
- package/lib/resources/subscription_models.js +10 -42
- package/lib/resources/subscription_models.js.map +1 -1
- package/lib/resources/tags.cjs +12 -28
- package/lib/resources/tags.cjs.map +1 -1
- package/lib/resources/tags.d.cts +2 -2
- package/lib/resources/tags.d.ts +2 -2
- package/lib/resources/tags.js +10 -30
- package/lib/resources/tags.js.map +1 -1
- package/lib/resources/talon_one_accounts.cjs +12 -44
- package/lib/resources/talon_one_accounts.cjs.map +1 -1
- package/lib/resources/talon_one_accounts.d.cts +2 -2
- package/lib/resources/talon_one_accounts.d.ts +2 -2
- package/lib/resources/talon_one_accounts.js +10 -46
- package/lib/resources/talon_one_accounts.js.map +1 -1
- package/lib/resources/tax_calculators.cjs +12 -35
- package/lib/resources/tax_calculators.cjs.map +1 -1
- package/lib/resources/tax_calculators.d.cts +2 -2
- package/lib/resources/tax_calculators.d.ts +2 -2
- package/lib/resources/tax_calculators.js +10 -37
- package/lib/resources/tax_calculators.js.map +1 -1
- package/lib/resources/tax_categories.cjs +12 -40
- package/lib/resources/tax_categories.cjs.map +1 -1
- package/lib/resources/tax_categories.d.cts +2 -2
- package/lib/resources/tax_categories.d.ts +2 -2
- package/lib/resources/tax_categories.js +10 -42
- package/lib/resources/tax_categories.js.map +1 -1
- package/lib/resources/tax_rules.cjs +12 -36
- package/lib/resources/tax_rules.cjs.map +1 -1
- package/lib/resources/tax_rules.d.cts +2 -2
- package/lib/resources/tax_rules.d.ts +2 -2
- package/lib/resources/tax_rules.js +10 -38
- package/lib/resources/tax_rules.js.map +1 -1
- package/lib/resources/taxjar_accounts.cjs +12 -48
- package/lib/resources/taxjar_accounts.cjs.map +1 -1
- package/lib/resources/taxjar_accounts.d.cts +2 -2
- package/lib/resources/taxjar_accounts.d.ts +2 -2
- package/lib/resources/taxjar_accounts.js +10 -50
- package/lib/resources/taxjar_accounts.js.map +1 -1
- package/lib/resources/transactions.cjs +12 -35
- package/lib/resources/transactions.cjs.map +1 -1
- package/lib/resources/transactions.d.cts +2 -2
- package/lib/resources/transactions.d.ts +2 -2
- package/lib/resources/transactions.js +10 -37
- package/lib/resources/transactions.js.map +1 -1
- package/lib/resources/versions.cjs +12 -19
- package/lib/resources/versions.cjs.map +1 -1
- package/lib/resources/versions.d.cts +2 -2
- package/lib/resources/versions.d.ts +2 -2
- package/lib/resources/versions.js +10 -21
- package/lib/resources/versions.js.map +1 -1
- package/lib/resources/vertex_accounts.cjs +12 -47
- package/lib/resources/vertex_accounts.cjs.map +1 -1
- package/lib/resources/vertex_accounts.d.cts +2 -2
- package/lib/resources/vertex_accounts.d.ts +2 -2
- package/lib/resources/vertex_accounts.js +10 -49
- package/lib/resources/vertex_accounts.js.map +1 -1
- package/lib/resources/voids.cjs +12 -45
- package/lib/resources/voids.cjs.map +1 -1
- package/lib/resources/voids.d.cts +2 -2
- package/lib/resources/voids.d.ts +2 -2
- package/lib/resources/voids.js +10 -47
- package/lib/resources/voids.js.map +1 -1
- package/lib/resources/webhooks.cjs +12 -45
- package/lib/resources/webhooks.cjs.map +1 -1
- package/lib/resources/webhooks.d.cts +2 -2
- package/lib/resources/webhooks.d.ts +2 -2
- package/lib/resources/webhooks.js +10 -47
- package/lib/resources/webhooks.js.map +1 -1
- package/lib/resources/wire_transfers.cjs +12 -36
- package/lib/resources/wire_transfers.cjs.map +1 -1
- package/lib/resources/wire_transfers.d.cts +2 -2
- package/lib/resources/wire_transfers.d.ts +2 -2
- package/lib/resources/wire_transfers.js +10 -38
- package/lib/resources/wire_transfers.js.map +1 -1
- package/lib/static.cjs +16 -43
- package/lib/static.cjs.map +1 -1
- package/lib/static.d.cts +2 -2
- package/lib/static.d.ts +2 -2
- package/lib/static.js +11 -45
- package/lib/static.js.map +1 -1
- package/lib/util.cjs +20 -34
- package/lib/util.cjs.map +1 -1
- package/lib/util.js +2 -32
- package/lib/util.js.map +1 -1
- package/package.json +19 -8
@@ -0,0 +1,274 @@
|
|
1
|
+
import { generateQueryStringParams, isParamsList } from './chunk-CHYP5F26.js';
|
2
|
+
import { client_default } from './chunk-H4SVEI6E.js';
|
3
|
+
import { config_default } from './chunk-AYTBSAHY.js';
|
4
|
+
import { resourceList } from './chunk-GD4WRDF2.js';
|
5
|
+
import { SdkError } from './chunk-ZU7GFVQ6.js';
|
6
|
+
import { debug_default } from './chunk-XD7GS4QW.js';
|
7
|
+
|
8
|
+
// src/resource.ts
|
9
|
+
var debug = debug_default("resource");
|
10
|
+
var ListResponse = class extends Array {
|
11
|
+
meta;
|
12
|
+
constructor(meta, data) {
|
13
|
+
super(...data || []);
|
14
|
+
this.meta = meta;
|
15
|
+
}
|
16
|
+
first() {
|
17
|
+
return this.length ? this[0] : void 0;
|
18
|
+
}
|
19
|
+
last() {
|
20
|
+
return this.length ? this[this.length - 1] : void 0;
|
21
|
+
}
|
22
|
+
get(index) {
|
23
|
+
return this.length && index >= 0 ? this[index] : void 0;
|
24
|
+
}
|
25
|
+
hasNextPage() {
|
26
|
+
return this.meta.currentPage < this.meta.pageCount;
|
27
|
+
}
|
28
|
+
hasPrevPage() {
|
29
|
+
return this.meta.currentPage > 1;
|
30
|
+
}
|
31
|
+
getRecordCount() {
|
32
|
+
return this.meta.recordCount;
|
33
|
+
}
|
34
|
+
getPageCount() {
|
35
|
+
return this.meta.pageCount;
|
36
|
+
}
|
37
|
+
get recordCount() {
|
38
|
+
return this.meta.recordCount;
|
39
|
+
}
|
40
|
+
get pageCount() {
|
41
|
+
return this.meta.pageCount;
|
42
|
+
}
|
43
|
+
};
|
44
|
+
var ApiResourceAdapter = class _ApiResourceAdapter {
|
45
|
+
static adapter;
|
46
|
+
constructor() {
|
47
|
+
}
|
48
|
+
static init(config) {
|
49
|
+
_ApiResourceAdapter.adapter = new ResourceAdapter(config);
|
50
|
+
debug("resource adapter initialized");
|
51
|
+
return _ApiResourceAdapter.get();
|
52
|
+
}
|
53
|
+
static get(config) {
|
54
|
+
if (config) return _ApiResourceAdapter.init(config);
|
55
|
+
else {
|
56
|
+
if (_ApiResourceAdapter.adapter) return _ApiResourceAdapter.adapter;
|
57
|
+
else throw new SdkError({ message: "Commerce Layer not initialized" });
|
58
|
+
}
|
59
|
+
}
|
60
|
+
static config(config) {
|
61
|
+
_ApiResourceAdapter.get().config(config);
|
62
|
+
}
|
63
|
+
};
|
64
|
+
var ResourceAdapter = class {
|
65
|
+
#client;
|
66
|
+
#config = {};
|
67
|
+
constructor(config) {
|
68
|
+
this.#client = client_default.create(config);
|
69
|
+
this.localConfig(config);
|
70
|
+
}
|
71
|
+
localConfig(config) {
|
72
|
+
Object.assign(this.#config, config);
|
73
|
+
}
|
74
|
+
config(config) {
|
75
|
+
debug("config %o", config);
|
76
|
+
this.localConfig(config);
|
77
|
+
this.#client.config(config);
|
78
|
+
return this;
|
79
|
+
}
|
80
|
+
get client() {
|
81
|
+
return this.#client;
|
82
|
+
}
|
83
|
+
async singleton(resource, params, options, path) {
|
84
|
+
debug("singleton: %o, %O, %O", resource, params || {}, options || {});
|
85
|
+
const queryParams = generateQueryStringParams(params, resource);
|
86
|
+
if (options?.params) Object.assign(queryParams, options?.params);
|
87
|
+
const res = await this.#client.request("GET", `${path || resource.type}`, void 0, { ...options, params: queryParams });
|
88
|
+
const r = denormalize(res);
|
89
|
+
return r;
|
90
|
+
}
|
91
|
+
async retrieve(resource, params, options) {
|
92
|
+
debug("retrieve: %o, %O, %O", resource, params || {}, options || {});
|
93
|
+
const queryParams = generateQueryStringParams(params, resource);
|
94
|
+
if (options?.params) Object.assign(queryParams, options?.params);
|
95
|
+
const res = await this.#client.request("GET", `${resource.type}/${resource.id}`, void 0, { ...options, params: queryParams });
|
96
|
+
const r = denormalize(res);
|
97
|
+
return r;
|
98
|
+
}
|
99
|
+
async list(resource, params, options) {
|
100
|
+
debug("list: %o, %O, %O", resource, params || {}, options || {});
|
101
|
+
const queryParams = generateQueryStringParams(params, resource);
|
102
|
+
if (options?.params) Object.assign(queryParams, options?.params);
|
103
|
+
if (!queryParams["page[number]"]) queryParams["page[number]"] = "1";
|
104
|
+
const res = await this.#client.request("GET", `${resource.type}`, void 0, { ...options, params: queryParams });
|
105
|
+
const r = denormalize(res);
|
106
|
+
const meta = {
|
107
|
+
pageCount: Number(res.meta?.page_count),
|
108
|
+
recordCount: Number(res.meta?.record_count),
|
109
|
+
currentPage: params?.pageNumber || config_default.default.pageNumber,
|
110
|
+
recordsPerPage: params?.pageSize || config_default.default.pageSize
|
111
|
+
};
|
112
|
+
return new ListResponse(meta, r);
|
113
|
+
}
|
114
|
+
async create(resource, params, options) {
|
115
|
+
debug("create: %o, %O, %O", resource, params || {}, options || {});
|
116
|
+
const queryParams = generateQueryStringParams(params, resource);
|
117
|
+
if (options?.params) Object.assign(queryParams, options?.params);
|
118
|
+
const data = normalize(resource);
|
119
|
+
const res = await this.#client.request("POST", resource.type, data, { ...options, params: queryParams });
|
120
|
+
const r = denormalize(res);
|
121
|
+
return r;
|
122
|
+
}
|
123
|
+
async update(resource, params, options) {
|
124
|
+
debug("update: %o, %O, %O", resource, params || {}, options || {});
|
125
|
+
const queryParams = generateQueryStringParams(params, resource);
|
126
|
+
if (options?.params) Object.assign(queryParams, options?.params);
|
127
|
+
const data = normalize(resource);
|
128
|
+
const res = await this.#client.request("PATCH", `${resource.type}/${resource.id}`, data, { ...options, params: queryParams });
|
129
|
+
const r = denormalize(res);
|
130
|
+
return r;
|
131
|
+
}
|
132
|
+
async delete(resource, options) {
|
133
|
+
debug("delete: %o, %O", resource, options || {});
|
134
|
+
await this.#client.request("DELETE", `${resource.type}/${resource.id}`, void 0, options);
|
135
|
+
}
|
136
|
+
async fetch(resource, path, params, options) {
|
137
|
+
debug("fetch: %o, %O, %O", path, params || {}, options || {});
|
138
|
+
const queryParams = generateQueryStringParams(params, resource);
|
139
|
+
if (options?.params) Object.assign(queryParams, options?.params);
|
140
|
+
const res = await this.#client.request("GET", path, void 0, { ...options, params: queryParams });
|
141
|
+
const r = denormalize(res);
|
142
|
+
if (Array.isArray(r)) {
|
143
|
+
const p = params;
|
144
|
+
const meta = {
|
145
|
+
pageCount: Number(res.meta?.page_count),
|
146
|
+
recordCount: Number(res.meta?.record_count),
|
147
|
+
currentPage: p?.pageNumber || config_default.default.pageNumber,
|
148
|
+
recordsPerPage: p?.pageSize || config_default.default.pageSize
|
149
|
+
};
|
150
|
+
return new ListResponse(meta, r);
|
151
|
+
} else return r;
|
152
|
+
}
|
153
|
+
};
|
154
|
+
var ApiResourceBase = class {
|
155
|
+
static TYPE;
|
156
|
+
#resources;
|
157
|
+
constructor(adapter) {
|
158
|
+
debug("new resource instance: %s", this.type());
|
159
|
+
if (adapter) this.#resources = adapter;
|
160
|
+
}
|
161
|
+
get resources() {
|
162
|
+
return this.#resources || ApiResourceAdapter.get();
|
163
|
+
}
|
164
|
+
relationshipOneToOne(id) {
|
165
|
+
return id === null || typeof id === "string" ? { id, type: this.type() } : { id: id.id, type: this.type() };
|
166
|
+
}
|
167
|
+
relationshipOneToMany(...ids) {
|
168
|
+
return ids === null || ids.length === 0 || ids[0] === null ? [{ id: null, type: this.type() }] : ids.map((id) => {
|
169
|
+
return { id, type: this.type() };
|
170
|
+
});
|
171
|
+
}
|
172
|
+
path() {
|
173
|
+
return this.type();
|
174
|
+
}
|
175
|
+
// reference, reference_origin and metadata attributes are always updatable
|
176
|
+
async update(resource, params, options) {
|
177
|
+
return this.resources.update({ ...resource, type: this.type() }, params, options);
|
178
|
+
}
|
179
|
+
};
|
180
|
+
var ApiResource = class extends ApiResourceBase {
|
181
|
+
async retrieve(id, params, options) {
|
182
|
+
return this.resources.retrieve(typeof id === "string" ? { type: this.type(), id } : id, params, options);
|
183
|
+
}
|
184
|
+
async list(params, options) {
|
185
|
+
return this.resources.list({ type: this.type() }, params, options);
|
186
|
+
}
|
187
|
+
async count(filter, options) {
|
188
|
+
const params = { filters: isParamsList(filter) ? filter.filters : filter, pageNumber: 1, pageSize: 1 };
|
189
|
+
const response = await this.list(params, options);
|
190
|
+
return Promise.resolve(response.meta.recordCount);
|
191
|
+
}
|
192
|
+
};
|
193
|
+
var ApiSingleton = class extends ApiResourceBase {
|
194
|
+
async retrieve(params, options) {
|
195
|
+
return this.resources.singleton({ type: this.type() }, params, options, this.path());
|
196
|
+
}
|
197
|
+
};
|
198
|
+
var isResourceId = (resource) => {
|
199
|
+
return resource?.type && resource.id && resourceList.includes(resource.type);
|
200
|
+
};
|
201
|
+
var isResourceType = (resource) => {
|
202
|
+
return resource && typeof resource.type !== "undefined" && resource.type && resourceList.includes(resource.type);
|
203
|
+
};
|
204
|
+
|
205
|
+
// src/jsonapi.ts
|
206
|
+
var debug2 = debug_default("jsonapi");
|
207
|
+
var denormalize = (response) => {
|
208
|
+
if (!response) return response;
|
209
|
+
let denormalizedResponse;
|
210
|
+
if (response.links) delete response.links;
|
211
|
+
const data = response.data;
|
212
|
+
const included = response.included;
|
213
|
+
if (!data) denormalizedResponse = data;
|
214
|
+
else {
|
215
|
+
if (Array.isArray(data)) denormalizedResponse = data.map((res) => denormalizeResource(res, included));
|
216
|
+
else denormalizedResponse = denormalizeResource(data, included);
|
217
|
+
}
|
218
|
+
return denormalizedResponse;
|
219
|
+
};
|
220
|
+
var findIncluded = (rel, included = []) => {
|
221
|
+
const inc = included.find((inc2) => {
|
222
|
+
return rel.id === inc2.id && rel.type === inc2.type;
|
223
|
+
});
|
224
|
+
return inc || rel;
|
225
|
+
};
|
226
|
+
var denormalizeResource = (res, included, chain = []) => {
|
227
|
+
debug2("denormalize resource: %O, %o", res, included || {});
|
228
|
+
if (!res) return res;
|
229
|
+
const resource = {
|
230
|
+
id: res.id,
|
231
|
+
type: res.type,
|
232
|
+
...res.attributes
|
233
|
+
};
|
234
|
+
if (res.relationships) Object.keys(res.relationships).forEach((key) => {
|
235
|
+
const rel = res.relationships[key].data;
|
236
|
+
if (rel) {
|
237
|
+
if (chain.filter((r) => r.id === rel.id && r.type === rel.type).length >= config_default.jsonapi.maxResourceIncluded) resource[key] = rel;
|
238
|
+
else {
|
239
|
+
if (Array.isArray(rel)) resource[key] = rel.map((r) => denormalizeResource(findIncluded(r, included), included, [...chain, r]));
|
240
|
+
else resource[key] = denormalizeResource(findIncluded(rel, included), included, [...chain, rel]);
|
241
|
+
}
|
242
|
+
} else if (rel === null) resource[key] = null;
|
243
|
+
});
|
244
|
+
debug2("denormalized resource: %O", resource);
|
245
|
+
return resource;
|
246
|
+
};
|
247
|
+
var normalize = (resource) => {
|
248
|
+
debug2("normalize resource: %O", resource);
|
249
|
+
const attributes = {};
|
250
|
+
const relationships = {};
|
251
|
+
for (const field in resource) {
|
252
|
+
if (["type", "id"].includes(field)) continue;
|
253
|
+
const value = resource[field];
|
254
|
+
if (Array.isArray(value) && value.length === 1 && isResourceType(value[0]) && value[0].id === null) {
|
255
|
+
relationships[field] = { data: [] };
|
256
|
+
} else if (value && isResourceType(value) && value.id === null) {
|
257
|
+
relationships[field] = { data: null };
|
258
|
+
} else if (value && (isResourceId(value) || Array.isArray(value) && isResourceId(value[0]))) {
|
259
|
+
relationships[field] = { data: value };
|
260
|
+
} else attributes[field] = value;
|
261
|
+
}
|
262
|
+
const normalized = {
|
263
|
+
type: resource.type,
|
264
|
+
attributes,
|
265
|
+
relationships
|
266
|
+
};
|
267
|
+
if (isResourceId(resource)) normalized.id = resource.id;
|
268
|
+
debug2("normalized resource: %O", normalized);
|
269
|
+
return normalized;
|
270
|
+
};
|
271
|
+
|
272
|
+
export { ApiResource, ApiResourceAdapter, ApiSingleton, denormalize, isResourceId, isResourceType, normalize };
|
273
|
+
//# sourceMappingURL=chunk-NAWKHFBZ.js.map
|
274
|
+
//# sourceMappingURL=chunk-NAWKHFBZ.js.map
|
@@ -0,0 +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,KAAS,CAAA;AAAA,EAEzD,IAAA;AAAA,EAET,WAAA,CAAY,MAAgB,IAAW,EAAA;AACtC,IAAM,KAAA,CAAA,GAAI,IAAQ,IAAA,EAAG,CAAA;AACrB,IAAA,IAAA,CAAK,IAAO,GAAA,IAAA;AAAA;AACb,EAEA,KAAuB,GAAA;AAAE,IAAA,OAAO,IAAK,CAAA,MAAA,GAAS,IAAK,CAAA,CAAC,CAAI,GAAA,MAAA;AAAA;AAAU,EAClE,IAAsB,GAAA;AAAE,IAAA,OAAO,KAAK,MAAS,GAAA,IAAA,CAAK,IAAK,CAAA,MAAA,GAAS,CAAC,CAAI,GAAA,MAAA;AAAA;AAAU,EAC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,MAAM,OAAQ,CAAA,KAAK,CAAM,IAAA,KAAA,CAAM,WAAW,CAAM,IAAA,cAAA,CAAe,KAAM,CAAA,CAAC,CAAC,CAAO,IAAA,KAAA,CAAM,CAAC,CAAA,CAAkB,OAAO,IAAO,EAAA;AACxH,MAAA,aAAA,CAAc,KAAK,CAAA,GAAI,EAAE,IAAA,EAAM,EAAG,EAAA;AAAA,eAG/B,KAAS,IAAA,cAAA,CAAe,KAAK,CAAO,IAAA,KAAA,CAAsB,OAAO,IAAO,EAAA;AAC3E,MAAA,aAAA,CAAc,KAAK,CAAA,GAAI,EAAE,IAAA,EAAM,IAAK,EAAA;AAAA,KAGjC,MAAA,IAAA,KAAA,KAAU,YAAa,CAAA,KAAK,CAAM,IAAA,KAAA,CAAM,OAAQ,CAAA,KAAK,CAAK,IAAA,YAAA,CAAa,KAAM,CAAA,CAAC,CAAC,CAAK,CAAA,EAAA;AACvF,MAAA,aAAA,CAAc,KAAK,CAAA,GAAI,EAAE,IAAA,EAAM,KAAkC,EAAA;AAAA,KAClE,MACgB,UAAA,CAAA,KAAK,CAAI,GAAA,KAAA;AAAA;AAG1B,EAAA,MAAM,UAA4B,GAAA;AAAA,IACjC,MAAM,QAAS,CAAA,IAAA;AAAA,IACf,UAAA;AAAA,IACA;AAAA,GACD;AAEA,EAAA,IAAI,YAAa,CAAA,QAAQ,CAAG,EAAA,UAAA,CAAW,KAAK,QAAS,CAAA,EAAA;AAErD,EAAAA,MAAAA,CAAM,2BAA2B,UAAU,CAAA;AAE3C,EAAO,OAAA,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"]}
|
@@ -0,0 +1,47 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
var chunkQYDOENWU_cjs = require('./chunk-QYDOENWU.cjs');
|
4
|
+
|
5
|
+
// src/resources/satispay_gateways.ts
|
6
|
+
var SatispayGateways = class _SatispayGateways extends chunkQYDOENWU_cjs.ApiResource {
|
7
|
+
static TYPE = "satispay_gateways";
|
8
|
+
async create(resource, params, options) {
|
9
|
+
return this.resources.create({ ...resource, type: _SatispayGateways.TYPE }, params, options);
|
10
|
+
}
|
11
|
+
async update(resource, params, options) {
|
12
|
+
return this.resources.update({ ...resource, type: _SatispayGateways.TYPE }, params, options);
|
13
|
+
}
|
14
|
+
async delete(id, options) {
|
15
|
+
await this.resources.delete(typeof id === "string" ? { id, type: _SatispayGateways.TYPE } : id, options);
|
16
|
+
}
|
17
|
+
async payment_methods(satispayGatewayId, params, options) {
|
18
|
+
const _satispayGatewayId = satispayGatewayId.id || satispayGatewayId;
|
19
|
+
return this.resources.fetch({ type: "payment_methods" }, `satispay_gateways/${_satispayGatewayId}/payment_methods`, params, options);
|
20
|
+
}
|
21
|
+
async versions(satispayGatewayId, params, options) {
|
22
|
+
const _satispayGatewayId = satispayGatewayId.id || satispayGatewayId;
|
23
|
+
return this.resources.fetch({ type: "versions" }, `satispay_gateways/${_satispayGatewayId}/versions`, params, options);
|
24
|
+
}
|
25
|
+
async satispay_payments(satispayGatewayId, params, options) {
|
26
|
+
const _satispayGatewayId = satispayGatewayId.id || satispayGatewayId;
|
27
|
+
return this.resources.fetch({ type: "satispay_payments" }, `satispay_gateways/${_satispayGatewayId}/satispay_payments`, params, options);
|
28
|
+
}
|
29
|
+
isSatispayGateway(resource) {
|
30
|
+
return resource.type && resource.type === _SatispayGateways.TYPE;
|
31
|
+
}
|
32
|
+
relationship(id) {
|
33
|
+
return super.relationshipOneToOne(id);
|
34
|
+
}
|
35
|
+
relationshipToMany(...ids) {
|
36
|
+
return super.relationshipOneToMany(...ids);
|
37
|
+
}
|
38
|
+
type() {
|
39
|
+
return _SatispayGateways.TYPE;
|
40
|
+
}
|
41
|
+
};
|
42
|
+
var instance = new SatispayGateways();
|
43
|
+
var satispay_gateways_default = instance;
|
44
|
+
|
45
|
+
exports.satispay_gateways_default = satispay_gateways_default;
|
46
|
+
//# sourceMappingURL=chunk-NBYV35R4.cjs.map
|
47
|
+
//# sourceMappingURL=chunk-NBYV35R4.cjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../src/resources/satispay_gateways.ts"],"names":["ApiResource"],"mappings":";;;;;AAiFA,IAAM,gBAAA,GAAN,MAAM,iBAAA,SAAyBA,6BAA6B,CAAA;AAAA,EAE3D,OAAgB,IAA4B,GAAA,mBAAA;AAAA,EAE5C,MAAM,MAAA,CAAO,QAAiC,EAAA,MAAA,EAA+C,OAAqD,EAAA;AACjJ,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,MAAA,CAA+C,EAAE,GAAG,QAAU,EAAA,IAAA,EAAM,iBAAiB,CAAA,IAAA,EAAQ,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AACnI,EAEA,MAAM,MAAA,CAAO,QAAiC,EAAA,MAAA,EAA+C,OAAqD,EAAA;AACjJ,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,MAAA,CAA+C,EAAE,GAAG,QAAU,EAAA,IAAA,EAAM,iBAAiB,CAAA,IAAA,EAAQ,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AACnI,EAEA,MAAM,MAAO,CAAA,EAAA,EAAyB,OAA0C,EAAA;AAC/E,IAAA,MAAM,IAAK,CAAA,SAAA,CAAU,MAAQ,CAAA,OAAO,EAAO,KAAA,QAAA,GAAW,EAAE,EAAA,EAAI,IAAM,EAAA,iBAAA,CAAiB,IAAK,EAAA,GAAI,IAAI,OAAO,CAAA;AAAA;AACxG,EAEA,MAAM,eAAA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AA;AAC9D,EAGA,IAA4B,GAAA;AAC3B,IAAA,OAAO,iBAAiB,CAAA,IAAA;AAAA;AAG1B,CAAA;AAGA,IAAM,QAAA,GAAW,IAAI,gBAAiB,EAAA;AACtC,IAAO,yBAAQ,GAAA","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"]}
|
@@ -0,0 +1,45 @@
|
|
1
|
+
import { ApiResource } from './chunk-NAWKHFBZ.js';
|
2
|
+
|
3
|
+
// src/resources/adyen_gateways.ts
|
4
|
+
var AdyenGateways = class _AdyenGateways extends ApiResource {
|
5
|
+
static TYPE = "adyen_gateways";
|
6
|
+
async create(resource, params, options) {
|
7
|
+
return this.resources.create({ ...resource, type: _AdyenGateways.TYPE }, params, options);
|
8
|
+
}
|
9
|
+
async update(resource, params, options) {
|
10
|
+
return this.resources.update({ ...resource, type: _AdyenGateways.TYPE }, params, options);
|
11
|
+
}
|
12
|
+
async delete(id, options) {
|
13
|
+
await this.resources.delete(typeof id === "string" ? { id, type: _AdyenGateways.TYPE } : id, options);
|
14
|
+
}
|
15
|
+
async payment_methods(adyenGatewayId, params, options) {
|
16
|
+
const _adyenGatewayId = adyenGatewayId.id || adyenGatewayId;
|
17
|
+
return this.resources.fetch({ type: "payment_methods" }, `adyen_gateways/${_adyenGatewayId}/payment_methods`, params, options);
|
18
|
+
}
|
19
|
+
async versions(adyenGatewayId, params, options) {
|
20
|
+
const _adyenGatewayId = adyenGatewayId.id || adyenGatewayId;
|
21
|
+
return this.resources.fetch({ type: "versions" }, `adyen_gateways/${_adyenGatewayId}/versions`, params, options);
|
22
|
+
}
|
23
|
+
async adyen_payments(adyenGatewayId, params, options) {
|
24
|
+
const _adyenGatewayId = adyenGatewayId.id || adyenGatewayId;
|
25
|
+
return this.resources.fetch({ type: "adyen_payments" }, `adyen_gateways/${_adyenGatewayId}/adyen_payments`, params, options);
|
26
|
+
}
|
27
|
+
isAdyenGateway(resource) {
|
28
|
+
return resource.type && resource.type === _AdyenGateways.TYPE;
|
29
|
+
}
|
30
|
+
relationship(id) {
|
31
|
+
return super.relationshipOneToOne(id);
|
32
|
+
}
|
33
|
+
relationshipToMany(...ids) {
|
34
|
+
return super.relationshipOneToMany(...ids);
|
35
|
+
}
|
36
|
+
type() {
|
37
|
+
return _AdyenGateways.TYPE;
|
38
|
+
}
|
39
|
+
};
|
40
|
+
var instance = new AdyenGateways();
|
41
|
+
var adyen_gateways_default = instance;
|
42
|
+
|
43
|
+
export { adyen_gateways_default };
|
44
|
+
//# sourceMappingURL=chunk-NDPDO54G.js.map
|
45
|
+
//# sourceMappingURL=chunk-NDPDO54G.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../src/resources/adyen_gateways.ts"],"names":[],"mappings":";;;AAuLA,IAAM,aAAA,GAAN,MAAM,cAAA,SAAsB,WAA0B,CAAA;AAAA,EAErD,OAAgB,IAAyB,GAAA,gBAAA;AAAA,EAEzC,MAAM,MAAA,CAAO,QAA8B,EAAA,MAAA,EA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AACzH,EAEA,MAAM,cAAA,CAAe,cAAuC,EAAA,MAAA,EAAwC,OAAgE,EAAA;AACnK,IAAM,MAAA,eAAA,GAAmB,eAAgC,EAAM,IAAA,cAAA;AAC/D,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,KAAA,CAAoB,EAAE,IAAA,EAAM,gBAAiB,EAAA,EAAG,CAAkB,eAAA,EAAA,eAAe,CAAmB,eAAA,CAAA,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AAC1I,EAGA,eAAe,QAAyC,EAAA;AACvD,IAAA,OAAO,QAAS,CAAA,IAAA,IAAS,QAAS,CAAA,IAAA,KAAS,cAAc,CAAA,IAAA;AAAA;AAC1D,EAGA,aAAa,EAAiD,EAAA;AAC7D,IAAO,OAAA,KAAA,CAAM,qBAAsC,EAAE,CAAA;AAAA;AACtD,EAEA,sBAAsB,GAAkC,EAAA;AACvD,IAAO,OAAA,KAAA,CAAM,qBAAuC,CAAA,GAAG,GAAG,CAAA;AAAA;AAC3D,EAGA,IAAyB,GAAA;AACxB,IAAA,OAAO,cAAc,CAAA,IAAA;AAAA;AAGvB,CAAA;AAGA,IAAM,QAAA,GAAW,IAAI,aAAc,EAAA;AACnC,IAAO,sBAAQ,GAAA","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"]}
|
@@ -0,0 +1,47 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
var chunkQYDOENWU_cjs = require('./chunk-QYDOENWU.cjs');
|
4
|
+
|
5
|
+
// src/resources/paypal_payments.ts
|
6
|
+
var PaypalPayments = class _PaypalPayments extends chunkQYDOENWU_cjs.ApiResource {
|
7
|
+
static TYPE = "paypal_payments";
|
8
|
+
async create(resource, params, options) {
|
9
|
+
return this.resources.create({ ...resource, type: _PaypalPayments.TYPE }, params, options);
|
10
|
+
}
|
11
|
+
async update(resource, params, options) {
|
12
|
+
return this.resources.update({ ...resource, type: _PaypalPayments.TYPE }, params, options);
|
13
|
+
}
|
14
|
+
async delete(id, options) {
|
15
|
+
await this.resources.delete(typeof id === "string" ? { id, type: _PaypalPayments.TYPE } : id, options);
|
16
|
+
}
|
17
|
+
async order(paypalPaymentId, params, options) {
|
18
|
+
const _paypalPaymentId = paypalPaymentId.id || paypalPaymentId;
|
19
|
+
return this.resources.fetch({ type: "orders" }, `paypal_payments/${_paypalPaymentId}/order`, params, options);
|
20
|
+
}
|
21
|
+
async payment_gateway(paypalPaymentId, params, options) {
|
22
|
+
const _paypalPaymentId = paypalPaymentId.id || paypalPaymentId;
|
23
|
+
return this.resources.fetch({ type: "payment_gateways" }, `paypal_payments/${_paypalPaymentId}/payment_gateway`, params, options);
|
24
|
+
}
|
25
|
+
async versions(paypalPaymentId, params, options) {
|
26
|
+
const _paypalPaymentId = paypalPaymentId.id || paypalPaymentId;
|
27
|
+
return this.resources.fetch({ type: "versions" }, `paypal_payments/${_paypalPaymentId}/versions`, params, options);
|
28
|
+
}
|
29
|
+
isPaypalPayment(resource) {
|
30
|
+
return resource.type && resource.type === _PaypalPayments.TYPE;
|
31
|
+
}
|
32
|
+
relationship(id) {
|
33
|
+
return super.relationshipOneToOne(id);
|
34
|
+
}
|
35
|
+
relationshipToMany(...ids) {
|
36
|
+
return super.relationshipOneToMany(...ids);
|
37
|
+
}
|
38
|
+
type() {
|
39
|
+
return _PaypalPayments.TYPE;
|
40
|
+
}
|
41
|
+
};
|
42
|
+
var instance = new PaypalPayments();
|
43
|
+
var paypal_payments_default = instance;
|
44
|
+
|
45
|
+
exports.paypal_payments_default = paypal_payments_default;
|
46
|
+
//# sourceMappingURL=chunk-NEC22ZSI.cjs.map
|
47
|
+
//# sourceMappingURL=chunk-NEC22ZSI.cjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../src/resources/paypal_payments.ts"],"names":["ApiResource"],"mappings":";;;;;AAmHA,IAAM,cAAA,GAAN,MAAM,eAAA,SAAuBA,6BAA2B,CAAA;AAAA,EAEvD,OAAgB,IAA0B,GAAA,iBAAA;AAAA,EAE1C,MAAM,MAAA,CAAO,QAA+B,EAAA,MAAA,EAA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A;AAAA;AACjJ,EAEA,MAAM,QAAA,CAAS,eAAyC,EAAA,MAAA,EAAmC,OAA2D,EAAA;AACrJ,IAAM,MAAA,gBAAA,GAAoB,gBAAkC,EAAM,IAAA,eAAA;AAClE,IAAO,OAAA,IAAA,CAAK,SAAU,CAAA,KAAA,CAAe,EAAE,IAAA,EAAM,UAAW,EAAA,EAAG,CAAmB,gBAAA,EAAA,gBAAgB,CAAa,SAAA,CAAA,EAAA,MAAA,EAAQ,OAAO,CAAA;AAAA;AAC3H,EAGA,gBAAgB,QAA0C,EAAA;AACzD,IAAA,OAAO,QAAS,CAAA,IAAA,IAAS,QAAS,CAAA,IAAA,KAAS,eAAe,CAAA,IAAA;AAAA;AAC3D,EAGA,aAAa,EAAkD,EAAA;AAC9D,IAAO,OAAA,KAAA,CAAM,qBAAuC,EAAE,CAAA;AAAA;AACvD,EAEA,sBAAsB,GAAmC,EAAA;AACxD,IAAO,OAAA,KAAA,CAAM,qBAAwC,CAAA,GAAG,GAAG,CAAA;AAAA;AAC5D,EAGA,IAA0B,GAAA;AACzB,IAAA,OAAO,eAAe,CAAA,IAAA;AAAA;AAGxB,CAAA;AAGA,IAAM,QAAA,GAAW,IAAI,cAAe,EAAA;AACpC,IAAO,uBAAQ,GAAA","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"]}
|
@@ -0,0 +1,71 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
var chunkQYDOENWU_cjs = require('./chunk-QYDOENWU.cjs');
|
4
|
+
|
5
|
+
// src/resources/flex_promotions.ts
|
6
|
+
var FlexPromotions = class _FlexPromotions extends chunkQYDOENWU_cjs.ApiResource {
|
7
|
+
static TYPE = "flex_promotions";
|
8
|
+
async create(resource, params, options) {
|
9
|
+
return this.resources.create({ ...resource, type: _FlexPromotions.TYPE }, params, options);
|
10
|
+
}
|
11
|
+
async update(resource, params, options) {
|
12
|
+
return this.resources.update({ ...resource, type: _FlexPromotions.TYPE }, params, options);
|
13
|
+
}
|
14
|
+
async delete(id, options) {
|
15
|
+
await this.resources.delete(typeof id === "string" ? { id, type: _FlexPromotions.TYPE } : id, options);
|
16
|
+
}
|
17
|
+
async coupon_codes_promotion_rule(flexPromotionId, params, options) {
|
18
|
+
const _flexPromotionId = flexPromotionId.id || flexPromotionId;
|
19
|
+
return this.resources.fetch({ type: "coupon_codes_promotion_rules" }, `flex_promotions/${_flexPromotionId}/coupon_codes_promotion_rule`, params, options);
|
20
|
+
}
|
21
|
+
async coupons(flexPromotionId, params, options) {
|
22
|
+
const _flexPromotionId = flexPromotionId.id || flexPromotionId;
|
23
|
+
return this.resources.fetch({ type: "coupons" }, `flex_promotions/${_flexPromotionId}/coupons`, params, options);
|
24
|
+
}
|
25
|
+
async attachments(flexPromotionId, params, options) {
|
26
|
+
const _flexPromotionId = flexPromotionId.id || flexPromotionId;
|
27
|
+
return this.resources.fetch({ type: "attachments" }, `flex_promotions/${_flexPromotionId}/attachments`, params, options);
|
28
|
+
}
|
29
|
+
async events(flexPromotionId, params, options) {
|
30
|
+
const _flexPromotionId = flexPromotionId.id || flexPromotionId;
|
31
|
+
return this.resources.fetch({ type: "events" }, `flex_promotions/${_flexPromotionId}/events`, params, options);
|
32
|
+
}
|
33
|
+
async tags(flexPromotionId, params, options) {
|
34
|
+
const _flexPromotionId = flexPromotionId.id || flexPromotionId;
|
35
|
+
return this.resources.fetch({ type: "tags" }, `flex_promotions/${_flexPromotionId}/tags`, params, options);
|
36
|
+
}
|
37
|
+
async versions(flexPromotionId, params, options) {
|
38
|
+
const _flexPromotionId = flexPromotionId.id || flexPromotionId;
|
39
|
+
return this.resources.fetch({ type: "versions" }, `flex_promotions/${_flexPromotionId}/versions`, params, options);
|
40
|
+
}
|
41
|
+
async _disable(id, params, options) {
|
42
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: _FlexPromotions.TYPE, _disable: true }, params, options);
|
43
|
+
}
|
44
|
+
async _enable(id, params, options) {
|
45
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: _FlexPromotions.TYPE, _enable: true }, params, options);
|
46
|
+
}
|
47
|
+
async _add_tags(id, triggerValue, params, options) {
|
48
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: _FlexPromotions.TYPE, _add_tags: triggerValue }, params, options);
|
49
|
+
}
|
50
|
+
async _remove_tags(id, triggerValue, params, options) {
|
51
|
+
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: _FlexPromotions.TYPE, _remove_tags: triggerValue }, params, options);
|
52
|
+
}
|
53
|
+
isFlexPromotion(resource) {
|
54
|
+
return resource.type && resource.type === _FlexPromotions.TYPE;
|
55
|
+
}
|
56
|
+
relationship(id) {
|
57
|
+
return super.relationshipOneToOne(id);
|
58
|
+
}
|
59
|
+
relationshipToMany(...ids) {
|
60
|
+
return super.relationshipOneToMany(...ids);
|
61
|
+
}
|
62
|
+
type() {
|
63
|
+
return _FlexPromotions.TYPE;
|
64
|
+
}
|
65
|
+
};
|
66
|
+
var instance = new FlexPromotions();
|
67
|
+
var flex_promotions_default = instance;
|
68
|
+
|
69
|
+
exports.flex_promotions_default = flex_promotions_default;
|
70
|
+
//# sourceMappingURL=chunk-NJQDJCFB.cjs.map
|
71
|
+
//# sourceMappingURL=chunk-NJQDJCFB.cjs.map
|