ce-storefront 0.20.0 → 0.21.0
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 +28 -3
- package/esm/funcs/marketplaceGetProductDetail.d.ts +20 -0
- package/esm/funcs/marketplaceGetProductDetail.d.ts.map +1 -0
- package/esm/funcs/marketplaceGetProductDetail.js +91 -0
- package/esm/funcs/marketplaceGetProductDetail.js.map +1 -0
- package/esm/funcs/marketplaceGetVariantDetail.d.ts +20 -0
- package/esm/funcs/marketplaceGetVariantDetail.d.ts.map +1 -0
- package/esm/funcs/marketplaceGetVariantDetail.js +98 -0
- package/esm/funcs/marketplaceGetVariantDetail.js.map +1 -0
- package/esm/funcs/marketplaceListCategories.d.ts +20 -0
- package/esm/funcs/marketplaceListCategories.d.ts.map +1 -0
- package/esm/funcs/marketplaceListCategories.js +91 -0
- package/esm/funcs/marketplaceListCategories.js.map +1 -0
- package/esm/funcs/marketplaceListCrosssellProducts.d.ts +20 -0
- package/esm/funcs/marketplaceListCrosssellProducts.d.ts.map +1 -0
- package/esm/funcs/marketplaceListCrosssellProducts.js +91 -0
- package/esm/funcs/marketplaceListCrosssellProducts.js.map +1 -0
- package/esm/funcs/marketplaceListProductReviews.d.ts +20 -0
- package/esm/funcs/marketplaceListProductReviews.d.ts.map +1 -0
- package/esm/funcs/marketplaceListProductReviews.js +97 -0
- package/esm/funcs/marketplaceListProductReviews.js.map +1 -0
- package/esm/funcs/marketplaceListProductVariants.d.ts +20 -0
- package/esm/funcs/marketplaceListProductVariants.d.ts.map +1 -0
- package/esm/funcs/marketplaceListProductVariants.js +94 -0
- package/esm/funcs/marketplaceListProductVariants.js.map +1 -0
- package/esm/funcs/marketplaceListProducts.d.ts +20 -0
- package/esm/funcs/marketplaceListProducts.d.ts.map +1 -0
- package/esm/funcs/marketplaceListProducts.js +93 -0
- package/esm/funcs/marketplaceListProducts.js.map +1 -0
- package/esm/funcs/marketplaceListSimilarProducts.d.ts +20 -0
- package/esm/funcs/marketplaceListSimilarProducts.d.ts.map +1 -0
- package/esm/funcs/marketplaceListSimilarProducts.js +91 -0
- package/esm/funcs/marketplaceListSimilarProducts.js.map +1 -0
- package/esm/funcs/marketplaceListSkus.d.ts +20 -0
- package/esm/funcs/marketplaceListSkus.d.ts.map +1 -0
- package/esm/funcs/marketplaceListSkus.js +93 -0
- package/esm/funcs/marketplaceListSkus.js.map +1 -0
- package/esm/funcs/marketplaceListUpsellProducts.d.ts +20 -0
- package/esm/funcs/marketplaceListUpsellProducts.d.ts.map +1 -0
- package/esm/funcs/marketplaceListUpsellProducts.js +91 -0
- package/esm/funcs/marketplaceListUpsellProducts.js.map +1 -0
- package/esm/funcs/marketplaceSearchProducts.d.ts +20 -0
- package/esm/funcs/marketplaceSearchProducts.d.ts.map +1 -0
- package/esm/funcs/marketplaceSearchProducts.js +85 -0
- package/esm/funcs/marketplaceSearchProducts.js.map +1 -0
- package/esm/lib/config.d.ts +3 -3
- package/esm/lib/config.js +3 -3
- package/esm/lib/encodings.d.ts +1 -0
- package/esm/lib/encodings.d.ts.map +1 -1
- package/esm/lib/encodings.js +12 -1
- package/esm/lib/encodings.js.map +1 -1
- package/esm/models/components/booleanattribute.d.ts +1 -1
- package/esm/models/components/booleanattribute.d.ts.map +1 -1
- package/esm/models/components/booleanattribute.js +1 -1
- package/esm/models/components/booleanattribute.js.map +1 -1
- package/esm/models/components/collectinstorefulfillment.d.ts +1 -1
- package/esm/models/components/collectinstorefulfillment.d.ts.map +1 -1
- package/esm/models/components/collectinstorefulfillment.js +1 -2
- package/esm/models/components/collectinstorefulfillment.js.map +1 -1
- package/esm/models/components/collectinstorefulfillmentinput.d.ts +1 -1
- package/esm/models/components/collectinstorefulfillmentinput.d.ts.map +1 -1
- package/esm/models/components/colorattribute.d.ts +1 -1
- package/esm/models/components/colorattribute.d.ts.map +1 -1
- package/esm/models/components/colorattribute.js +1 -1
- package/esm/models/components/colorattribute.js.map +1 -1
- package/esm/models/components/coloroption.d.ts +1 -1
- package/esm/models/components/coloroption.d.ts.map +1 -1
- package/esm/models/components/coloroption.js +1 -1
- package/esm/models/components/coloroption.js.map +1 -1
- package/esm/models/components/customeraddress.d.ts +1 -1
- package/esm/models/components/customeraddress.d.ts.map +1 -1
- package/esm/models/components/customeraddress.js +1 -1
- package/esm/models/components/customeraddress.js.map +1 -1
- package/esm/models/components/customeraddressinput.d.ts +1 -1
- package/esm/models/components/customeraddressinput.d.ts.map +1 -1
- package/esm/models/components/dateattribute.d.ts +1 -1
- package/esm/models/components/dateattribute.js +1 -1
- package/esm/models/components/dateattribute.js.map +1 -1
- package/esm/models/components/deliveryfulfillment.d.ts +1 -1
- package/esm/models/components/deliveryfulfillment.d.ts.map +1 -1
- package/esm/models/components/deliveryfulfillment.js +1 -1
- package/esm/models/components/deliveryfulfillment.js.map +1 -1
- package/esm/models/components/deliveryfulfillmentinput.d.ts +1 -1
- package/esm/models/components/deliveryfulfillmentinput.d.ts.map +1 -1
- package/esm/models/components/discountbasedpromotion.d.ts +1 -10
- package/esm/models/components/discountbasedpromotion.d.ts.map +1 -1
- package/esm/models/components/discountbasedpromotion.js +1 -9
- package/esm/models/components/discountbasedpromotion.js.map +1 -1
- package/esm/models/components/fixedpricepromotion.d.ts +1 -11
- package/esm/models/components/fixedpricepromotion.d.ts.map +1 -1
- package/esm/models/components/fixedpricepromotion.js +1 -9
- package/esm/models/components/fixedpricepromotion.js.map +1 -1
- package/esm/models/components/freegoodspromotion.d.ts +1 -11
- package/esm/models/components/freegoodspromotion.d.ts.map +1 -1
- package/esm/models/components/freegoodspromotion.js +1 -9
- package/esm/models/components/freegoodspromotion.js.map +1 -1
- package/esm/models/components/fulfillmentpreference.d.ts +1 -7
- package/esm/models/components/fulfillmentpreference.d.ts.map +1 -1
- package/esm/models/components/fulfillmentpreference.js +3 -6
- package/esm/models/components/fulfillmentpreference.js.map +1 -1
- package/esm/models/components/fulfillmentpreferenceinput.d.ts +2 -14
- package/esm/models/components/fulfillmentpreferenceinput.d.ts.map +1 -1
- package/esm/models/components/fulfillmentpreferenceinput.js +3 -6
- package/esm/models/components/fulfillmentpreferenceinput.js.map +1 -1
- package/esm/models/components/generateotpwithemail.d.ts +1 -1
- package/esm/models/components/generateotpwithemail.d.ts.map +1 -1
- package/esm/models/components/index.d.ts +1 -0
- package/esm/models/components/index.d.ts.map +1 -1
- package/esm/models/components/index.js +1 -0
- package/esm/models/components/index.js.map +1 -1
- package/esm/models/components/juspayhypercheckout.d.ts +1 -1
- package/esm/models/components/juspayhypercheckout.d.ts.map +1 -1
- package/esm/models/components/juspayhypercheckoutresponse.d.ts.map +1 -1
- package/esm/models/components/juspayhypercheckoutresponse.js +2 -3
- package/esm/models/components/juspayhypercheckoutresponse.js.map +1 -1
- package/esm/models/components/juspaynetbanking.d.ts +2 -2
- package/esm/models/components/juspaynetbanking.d.ts.map +1 -1
- package/esm/models/components/juspaynewcard.d.ts +3 -3
- package/esm/models/components/juspaynewcard.d.ts.map +1 -1
- package/esm/models/components/juspaysavedcardtoken.d.ts +3 -3
- package/esm/models/components/juspaysavedcardtoken.d.ts.map +1 -1
- package/esm/models/components/juspayupicollect.d.ts +3 -3
- package/esm/models/components/juspayupicollect.d.ts.map +1 -1
- package/esm/models/components/juspayupiintent.d.ts +3 -3
- package/esm/models/components/juspayupiintent.d.ts.map +1 -1
- package/esm/models/components/multiselectattribute.d.ts +1 -1
- package/esm/models/components/multiselectattribute.d.ts.map +1 -1
- package/esm/models/components/multiselectattribute.js +1 -1
- package/esm/models/components/multiselectattribute.js.map +1 -1
- package/esm/models/components/numberattribute.d.ts +1 -1
- package/esm/models/components/numberattribute.d.ts.map +1 -1
- package/esm/models/components/numberattribute.js +1 -1
- package/esm/models/components/numberattribute.js.map +1 -1
- package/esm/models/components/ordershipment.d.ts +2 -19
- package/esm/models/components/ordershipment.d.ts.map +1 -1
- package/esm/models/components/ordershipment.js +2 -17
- package/esm/models/components/ordershipment.js.map +1 -1
- package/esm/models/components/partialcollectanddelivery.d.ts +1 -1
- package/esm/models/components/partialcollectanddelivery.d.ts.map +1 -1
- package/esm/models/components/partialcollectanddelivery.js +1 -1
- package/esm/models/components/partialcollectanddelivery.js.map +1 -1
- package/esm/models/components/partialcollectanddeliveryinput.d.ts +1 -1
- package/esm/models/components/partialcollectanddeliveryinput.d.ts.map +1 -1
- package/esm/models/components/payupaymentinfo.js +3 -3
- package/esm/models/components/payupaymentinfo.js.map +1 -1
- package/esm/models/components/productattribute.d.ts +1 -15
- package/esm/models/components/productattribute.d.ts.map +1 -1
- package/esm/models/components/productattribute.js +7 -15
- package/esm/models/components/productattribute.js.map +1 -1
- package/esm/models/components/productpromotion.d.ts +2 -18
- package/esm/models/components/productpromotion.d.ts.map +1 -1
- package/esm/models/components/productpromotion.js +8 -20
- package/esm/models/components/productpromotion.js.map +1 -1
- package/esm/models/components/shipmentstatus.d.ts +27 -0
- package/esm/models/components/shipmentstatus.d.ts.map +1 -0
- package/esm/models/components/shipmentstatus.js +25 -0
- package/esm/models/components/shipmentstatus.js.map +1 -0
- package/esm/models/components/singleselectattribute.d.ts +1 -1
- package/esm/models/components/singleselectattribute.d.ts.map +1 -1
- package/esm/models/components/singleselectattribute.js +1 -1
- package/esm/models/components/singleselectattribute.js.map +1 -1
- package/esm/models/components/singleselectoption.d.ts +1 -1
- package/esm/models/components/singleselectoption.d.ts.map +1 -1
- package/esm/models/components/singleselectoption.js +1 -1
- package/esm/models/components/singleselectoption.js.map +1 -1
- package/esm/models/components/textattribute.d.ts +1 -1
- package/esm/models/components/textattribute.js +1 -1
- package/esm/models/components/textattribute.js.map +1 -1
- package/esm/models/components/volumebasedpromotion.d.ts +1 -11
- package/esm/models/components/volumebasedpromotion.d.ts.map +1 -1
- package/esm/models/components/volumebasedpromotion.js +1 -9
- package/esm/models/components/volumebasedpromotion.js.map +1 -1
- package/esm/models/operations/createaddress.d.ts +1 -1
- package/esm/models/operations/createaddress.d.ts.map +1 -1
- package/esm/models/operations/generateotp.d.ts +20 -4
- package/esm/models/operations/generateotp.d.ts.map +1 -1
- package/esm/models/operations/generateotp.js +4 -2
- package/esm/models/operations/generateotp.js.map +1 -1
- package/esm/models/operations/getaddressdetail.d.ts +1 -1
- package/esm/models/operations/getaddressdetail.d.ts.map +1 -1
- package/esm/models/operations/getaddressdetail.js +1 -1
- package/esm/models/operations/getaddressdetail.js.map +1 -1
- package/esm/models/operations/getmarketplaceproductdetail.d.ts +45 -0
- package/esm/models/operations/getmarketplaceproductdetail.d.ts.map +1 -0
- package/esm/models/operations/getmarketplaceproductdetail.js +38 -0
- package/esm/models/operations/getmarketplaceproductdetail.js.map +1 -0
- package/esm/models/operations/getmarketplacevariantdetail.d.ts +50 -0
- package/esm/models/operations/getmarketplacevariantdetail.d.ts.map +1 -0
- package/esm/models/operations/getmarketplacevariantdetail.js +40 -0
- package/esm/models/operations/getmarketplacevariantdetail.js.map +1 -0
- package/esm/models/operations/index.d.ts +11 -0
- package/esm/models/operations/index.d.ts.map +1 -1
- package/esm/models/operations/index.js +11 -0
- package/esm/models/operations/index.js.map +1 -1
- package/esm/models/operations/listaddresses.d.ts +1 -1
- package/esm/models/operations/listaddresses.d.ts.map +1 -1
- package/esm/models/operations/listaddresses.js +1 -1
- package/esm/models/operations/listaddresses.js.map +1 -1
- package/esm/models/operations/listmarketplacecategories.d.ts +59 -0
- package/esm/models/operations/listmarketplacecategories.d.ts.map +1 -0
- package/esm/models/operations/listmarketplacecategories.js +43 -0
- package/esm/models/operations/listmarketplacecategories.js.map +1 -0
- package/esm/models/operations/listmarketplacecrosssellproducts.d.ts +59 -0
- package/esm/models/operations/listmarketplacecrosssellproducts.d.ts.map +1 -0
- package/esm/models/operations/listmarketplacecrosssellproducts.js +42 -0
- package/esm/models/operations/listmarketplacecrosssellproducts.js.map +1 -0
- package/esm/models/operations/listmarketplaceproductreviews.d.ts +65 -0
- package/esm/models/operations/listmarketplaceproductreviews.d.ts.map +1 -0
- package/esm/models/operations/listmarketplaceproductreviews.js +48 -0
- package/esm/models/operations/listmarketplaceproductreviews.js.map +1 -0
- package/esm/models/operations/listmarketplaceproducts.d.ts +69 -0
- package/esm/models/operations/listmarketplaceproducts.d.ts.map +1 -0
- package/esm/models/operations/listmarketplaceproducts.js +45 -0
- package/esm/models/operations/listmarketplaceproducts.js.map +1 -0
- package/esm/models/operations/listmarketplaceproductvariants.d.ts +45 -0
- package/esm/models/operations/listmarketplaceproductvariants.d.ts.map +1 -0
- package/esm/models/operations/listmarketplaceproductvariants.js +38 -0
- package/esm/models/operations/listmarketplaceproductvariants.js.map +1 -0
- package/esm/models/operations/listmarketplacesimilarproducts.d.ts +59 -0
- package/esm/models/operations/listmarketplacesimilarproducts.d.ts.map +1 -0
- package/esm/models/operations/listmarketplacesimilarproducts.js +42 -0
- package/esm/models/operations/listmarketplacesimilarproducts.js.map +1 -0
- package/esm/models/operations/listmarketplaceskus.d.ts +69 -0
- package/esm/models/operations/listmarketplaceskus.d.ts.map +1 -0
- package/esm/models/operations/listmarketplaceskus.js +44 -0
- package/esm/models/operations/listmarketplaceskus.js.map +1 -0
- package/esm/models/operations/listmarketplaceupsellproducts.d.ts +62 -0
- package/esm/models/operations/listmarketplaceupsellproducts.d.ts.map +1 -0
- package/esm/models/operations/listmarketplaceupsellproducts.js +42 -0
- package/esm/models/operations/listmarketplaceupsellproducts.js.map +1 -0
- package/esm/models/operations/loginwithwhatsapp.d.ts +1 -1
- package/esm/models/operations/loginwithwhatsapp.d.ts.map +1 -1
- package/esm/models/operations/loginwithwhatsapp.js +1 -1
- package/esm/models/operations/loginwithwhatsapp.js.map +1 -1
- package/esm/models/operations/searchmarketplaceproducts.d.ts +56 -0
- package/esm/models/operations/searchmarketplaceproducts.d.ts.map +1 -0
- package/esm/models/operations/searchmarketplaceproducts.js +53 -0
- package/esm/models/operations/searchmarketplaceproducts.js.map +1 -0
- package/esm/models/operations/searchproducts.d.ts +4 -4
- package/esm/models/operations/searchproducts.d.ts.map +1 -1
- package/esm/models/operations/searchproducts.js +4 -4
- package/esm/models/operations/searchproducts.js.map +1 -1
- package/esm/models/operations/updateaddressdetail.d.ts +1 -1
- package/esm/models/operations/updateaddressdetail.d.ts.map +1 -1
- package/esm/sdk/marketplace.d.ts +104 -0
- package/esm/sdk/marketplace.d.ts.map +1 -0
- package/esm/sdk/marketplace.js +140 -0
- package/esm/sdk/marketplace.js.map +1 -0
- package/esm/sdk/sdk.d.ts +3 -0
- package/esm/sdk/sdk.d.ts.map +1 -1
- package/esm/sdk/sdk.js +4 -0
- package/esm/sdk/sdk.js.map +1 -1
- package/esm/types/enums.d.ts +8 -11
- package/esm/types/enums.d.ts.map +1 -1
- package/esm/types/enums.js +22 -2
- package/esm/types/enums.js.map +1 -1
- package/esm/types/index.d.ts +2 -2
- package/esm/types/index.d.ts.map +1 -1
- package/esm/types/index.js +1 -1
- package/esm/types/index.js.map +1 -1
- package/esm/types/unrecognized.d.ts +16 -0
- package/esm/types/unrecognized.d.ts.map +1 -0
- package/esm/types/unrecognized.js +31 -0
- package/esm/types/unrecognized.js.map +1 -0
- package/examples/package-lock.json +1 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/funcs/marketplaceGetProductDetail.ts +198 -0
- package/src/funcs/marketplaceGetVariantDetail.ts +201 -0
- package/src/funcs/marketplaceListCategories.ts +188 -0
- package/src/funcs/marketplaceListCrosssellProducts.ts +193 -0
- package/src/funcs/marketplaceListProductReviews.ts +198 -0
- package/src/funcs/marketplaceListProductVariants.ts +199 -0
- package/src/funcs/marketplaceListProducts.ts +190 -0
- package/src/funcs/marketplaceListSimilarProducts.ts +193 -0
- package/src/funcs/marketplaceListSkus.ts +190 -0
- package/src/funcs/marketplaceListUpsellProducts.ts +193 -0
- package/src/funcs/marketplaceSearchProducts.ts +177 -0
- package/src/lib/config.ts +3 -3
- package/src/lib/encodings.ts +17 -3
- package/src/models/components/booleanattribute.ts +2 -2
- package/src/models/components/collectinstorefulfillment.ts +2 -3
- package/src/models/components/collectinstorefulfillmentinput.ts +1 -1
- package/src/models/components/colorattribute.ts +2 -2
- package/src/models/components/coloroption.ts +2 -2
- package/src/models/components/customeraddress.ts +2 -2
- package/src/models/components/customeraddressinput.ts +1 -1
- package/src/models/components/dateattribute.ts +2 -2
- package/src/models/components/deliveryfulfillment.ts +2 -2
- package/src/models/components/deliveryfulfillmentinput.ts +1 -1
- package/src/models/components/discountbasedpromotion.ts +2 -17
- package/src/models/components/fixedpricepromotion.ts +2 -18
- package/src/models/components/freegoodspromotion.ts +2 -18
- package/src/models/components/fulfillmentpreference.ts +6 -19
- package/src/models/components/fulfillmentpreferenceinput.ts +9 -26
- package/src/models/components/generateotpwithemail.ts +1 -1
- package/src/models/components/index.ts +1 -0
- package/src/models/components/juspayhypercheckout.ts +1 -1
- package/src/models/components/juspayhypercheckoutresponse.ts +2 -3
- package/src/models/components/juspaynetbanking.ts +2 -2
- package/src/models/components/juspaynewcard.ts +3 -3
- package/src/models/components/juspaysavedcardtoken.ts +3 -3
- package/src/models/components/juspayupicollect.ts +3 -3
- package/src/models/components/juspayupiintent.ts +3 -3
- package/src/models/components/multiselectattribute.ts +2 -2
- package/src/models/components/numberattribute.ts +2 -2
- package/src/models/components/ordershipment.ts +6 -24
- package/src/models/components/partialcollectanddelivery.ts +2 -4
- package/src/models/components/partialcollectanddeliveryinput.ts +1 -1
- package/src/models/components/payupaymentinfo.ts +3 -3
- package/src/models/components/productattribute.ts +14 -36
- package/src/models/components/productpromotion.ts +16 -48
- package/src/models/components/shipmentstatus.ts +34 -0
- package/src/models/components/singleselectattribute.ts +2 -2
- package/src/models/components/singleselectoption.ts +2 -2
- package/src/models/components/textattribute.ts +2 -2
- package/src/models/components/volumebasedpromotion.ts +2 -18
- package/src/models/operations/createaddress.ts +1 -1
- package/src/models/operations/generateotp.ts +20 -6
- package/src/models/operations/getaddressdetail.ts +2 -2
- package/src/models/operations/getmarketplaceproductdetail.ts +118 -0
- package/src/models/operations/getmarketplacevariantdetail.ts +125 -0
- package/src/models/operations/index.ts +11 -0
- package/src/models/operations/listaddresses.ts +2 -2
- package/src/models/operations/listmarketplacecategories.ts +131 -0
- package/src/models/operations/listmarketplacecrosssellproducts.ts +145 -0
- package/src/models/operations/listmarketplaceproductreviews.ts +148 -0
- package/src/models/operations/listmarketplaceproducts.ts +143 -0
- package/src/models/operations/listmarketplaceproductvariants.ts +118 -0
- package/src/models/operations/listmarketplacesimilarproducts.ts +136 -0
- package/src/models/operations/listmarketplaceskus.ts +139 -0
- package/src/models/operations/listmarketplaceupsellproducts.ts +139 -0
- package/src/models/operations/loginwithwhatsapp.ts +2 -2
- package/src/models/operations/searchmarketplaceproducts.ts +142 -0
- package/src/models/operations/searchproducts.ts +9 -9
- package/src/models/operations/updateaddressdetail.ts +1 -1
- package/src/sdk/marketplace.ts +229 -0
- package/src/sdk/sdk.ts +6 -0
- package/src/types/enums.ts +38 -9
- package/src/types/index.ts +2 -2
- package/src/types/unrecognized.ts +35 -0
- package/tsconfig.json +1 -2
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { CeStorefrontCore } from "../core.js";
|
|
6
|
+
import { encodeFormQuery, encodeSimple } from "../lib/encodings.js";
|
|
7
|
+
import * as M from "../lib/matchers.js";
|
|
8
|
+
import { compactMap } from "../lib/primitives.js";
|
|
9
|
+
import { safeParse } from "../lib/schemas.js";
|
|
10
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
11
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
12
|
+
import { pathToFunc } from "../lib/url.js";
|
|
13
|
+
import { CeStorefrontError } from "../models/errors/cestorefronterror.js";
|
|
14
|
+
import {
|
|
15
|
+
ConnectionError,
|
|
16
|
+
InvalidRequestError,
|
|
17
|
+
RequestAbortedError,
|
|
18
|
+
RequestTimeoutError,
|
|
19
|
+
UnexpectedClientError,
|
|
20
|
+
} from "../models/errors/httpclienterrors.js";
|
|
21
|
+
import * as errors from "../models/errors/index.js";
|
|
22
|
+
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
23
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
24
|
+
import * as operations from "../models/operations/index.js";
|
|
25
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
26
|
+
import { Result } from "../types/fp.js";
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Retrieve up-sell products
|
|
30
|
+
*
|
|
31
|
+
* @remarks
|
|
32
|
+
* Retrieves a list of products specified for upsell. The upsell products are returned based on product ids specified in request param.
|
|
33
|
+
*
|
|
34
|
+
* @see {@link https://llm-docs.commercengine.io/storefront/operations/list-marketplace-upsell-products} - API reference for the list-marketplace-upsell-products operation
|
|
35
|
+
*/
|
|
36
|
+
export function marketplaceListUpsellProducts(
|
|
37
|
+
client: CeStorefrontCore,
|
|
38
|
+
request: operations.ListMarketplaceUpsellProductsRequest,
|
|
39
|
+
options?: RequestOptions,
|
|
40
|
+
): APIPromise<
|
|
41
|
+
Result<
|
|
42
|
+
operations.ListMarketplaceUpsellProductsResponseBody,
|
|
43
|
+
| errors.Unauthorized
|
|
44
|
+
| errors.NotFound
|
|
45
|
+
| CeStorefrontError
|
|
46
|
+
| ResponseValidationError
|
|
47
|
+
| ConnectionError
|
|
48
|
+
| RequestAbortedError
|
|
49
|
+
| RequestTimeoutError
|
|
50
|
+
| InvalidRequestError
|
|
51
|
+
| UnexpectedClientError
|
|
52
|
+
| SDKValidationError
|
|
53
|
+
>
|
|
54
|
+
> {
|
|
55
|
+
return new APIPromise($do(
|
|
56
|
+
client,
|
|
57
|
+
request,
|
|
58
|
+
options,
|
|
59
|
+
));
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
async function $do(
|
|
63
|
+
client: CeStorefrontCore,
|
|
64
|
+
request: operations.ListMarketplaceUpsellProductsRequest,
|
|
65
|
+
options?: RequestOptions,
|
|
66
|
+
): Promise<
|
|
67
|
+
[
|
|
68
|
+
Result<
|
|
69
|
+
operations.ListMarketplaceUpsellProductsResponseBody,
|
|
70
|
+
| errors.Unauthorized
|
|
71
|
+
| errors.NotFound
|
|
72
|
+
| CeStorefrontError
|
|
73
|
+
| ResponseValidationError
|
|
74
|
+
| ConnectionError
|
|
75
|
+
| RequestAbortedError
|
|
76
|
+
| RequestTimeoutError
|
|
77
|
+
| InvalidRequestError
|
|
78
|
+
| UnexpectedClientError
|
|
79
|
+
| SDKValidationError
|
|
80
|
+
>,
|
|
81
|
+
APICall,
|
|
82
|
+
]
|
|
83
|
+
> {
|
|
84
|
+
const parsed = safeParse(
|
|
85
|
+
request,
|
|
86
|
+
(value) =>
|
|
87
|
+
operations.ListMarketplaceUpsellProductsRequest$outboundSchema.parse(
|
|
88
|
+
value,
|
|
89
|
+
),
|
|
90
|
+
"Input validation failed",
|
|
91
|
+
);
|
|
92
|
+
if (!parsed.ok) {
|
|
93
|
+
return [parsed, { status: "invalid" }];
|
|
94
|
+
}
|
|
95
|
+
const payload = parsed.value;
|
|
96
|
+
const body = null;
|
|
97
|
+
|
|
98
|
+
const path = pathToFunc("/catalog/marketplace/products/up-sell")();
|
|
99
|
+
|
|
100
|
+
const query = encodeFormQuery({
|
|
101
|
+
"limit": payload.limit,
|
|
102
|
+
"page": payload.page,
|
|
103
|
+
"product_id": payload.product_id,
|
|
104
|
+
"sort_by": payload.sort_by,
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
const headers = new Headers(compactMap({
|
|
108
|
+
Accept: "application/json",
|
|
109
|
+
"x-customer-group-id": encodeSimple(
|
|
110
|
+
"x-customer-group-id",
|
|
111
|
+
payload["x-customer-group-id"],
|
|
112
|
+
{ explode: false, charEncoding: "none" },
|
|
113
|
+
),
|
|
114
|
+
}));
|
|
115
|
+
|
|
116
|
+
const secConfig = await extractSecurity(client._options.authorization);
|
|
117
|
+
const securityInput = secConfig == null ? {} : { authorization: secConfig };
|
|
118
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
119
|
+
|
|
120
|
+
const context = {
|
|
121
|
+
options: client._options,
|
|
122
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
123
|
+
operationID: "list-marketplace-upsell-products",
|
|
124
|
+
oAuth2Scopes: null,
|
|
125
|
+
|
|
126
|
+
resolvedSecurity: requestSecurity,
|
|
127
|
+
|
|
128
|
+
securitySource: client._options.authorization,
|
|
129
|
+
retryConfig: options?.retries
|
|
130
|
+
|| client._options.retryConfig
|
|
131
|
+
|| { strategy: "none" },
|
|
132
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
const requestRes = client._createRequest(context, {
|
|
136
|
+
security: requestSecurity,
|
|
137
|
+
method: "GET",
|
|
138
|
+
baseURL: options?.serverURL,
|
|
139
|
+
path: path,
|
|
140
|
+
headers: headers,
|
|
141
|
+
query: query,
|
|
142
|
+
body: body,
|
|
143
|
+
userAgent: client._options.userAgent,
|
|
144
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
145
|
+
}, options);
|
|
146
|
+
if (!requestRes.ok) {
|
|
147
|
+
return [requestRes, { status: "invalid" }];
|
|
148
|
+
}
|
|
149
|
+
const req = requestRes.value;
|
|
150
|
+
|
|
151
|
+
const doResult = await client._do(req, {
|
|
152
|
+
context,
|
|
153
|
+
errorCodes: ["401", "404", "4XX", "5XX"],
|
|
154
|
+
retryConfig: context.retryConfig,
|
|
155
|
+
retryCodes: context.retryCodes,
|
|
156
|
+
});
|
|
157
|
+
if (!doResult.ok) {
|
|
158
|
+
return [doResult, { status: "request-error", request: req }];
|
|
159
|
+
}
|
|
160
|
+
const response = doResult.value;
|
|
161
|
+
|
|
162
|
+
const responseFields = {
|
|
163
|
+
HttpMeta: { Response: response, Request: req },
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
const [result] = await M.match<
|
|
167
|
+
operations.ListMarketplaceUpsellProductsResponseBody,
|
|
168
|
+
| errors.Unauthorized
|
|
169
|
+
| errors.NotFound
|
|
170
|
+
| CeStorefrontError
|
|
171
|
+
| ResponseValidationError
|
|
172
|
+
| ConnectionError
|
|
173
|
+
| RequestAbortedError
|
|
174
|
+
| RequestTimeoutError
|
|
175
|
+
| InvalidRequestError
|
|
176
|
+
| UnexpectedClientError
|
|
177
|
+
| SDKValidationError
|
|
178
|
+
>(
|
|
179
|
+
M.json(
|
|
180
|
+
200,
|
|
181
|
+
operations.ListMarketplaceUpsellProductsResponseBody$inboundSchema,
|
|
182
|
+
),
|
|
183
|
+
M.jsonErr(401, errors.Unauthorized$inboundSchema),
|
|
184
|
+
M.jsonErr(404, errors.NotFound$inboundSchema),
|
|
185
|
+
M.fail("4XX"),
|
|
186
|
+
M.fail("5XX"),
|
|
187
|
+
)(response, req, { extraFields: responseFields });
|
|
188
|
+
if (!result.ok) {
|
|
189
|
+
return [result, { status: "complete", request: req, response }];
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
return [result, { status: "complete", request: req, response }];
|
|
193
|
+
}
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { CeStorefrontCore } from "../core.js";
|
|
6
|
+
import { encodeJSON, encodeSimple } from "../lib/encodings.js";
|
|
7
|
+
import * as M from "../lib/matchers.js";
|
|
8
|
+
import { compactMap } from "../lib/primitives.js";
|
|
9
|
+
import { safeParse } from "../lib/schemas.js";
|
|
10
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
11
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
12
|
+
import { pathToFunc } from "../lib/url.js";
|
|
13
|
+
import { CeStorefrontError } from "../models/errors/cestorefronterror.js";
|
|
14
|
+
import {
|
|
15
|
+
ConnectionError,
|
|
16
|
+
InvalidRequestError,
|
|
17
|
+
RequestAbortedError,
|
|
18
|
+
RequestTimeoutError,
|
|
19
|
+
UnexpectedClientError,
|
|
20
|
+
} from "../models/errors/httpclienterrors.js";
|
|
21
|
+
import * as errors from "../models/errors/index.js";
|
|
22
|
+
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
23
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
24
|
+
import * as operations from "../models/operations/index.js";
|
|
25
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
26
|
+
import { Result } from "../types/fp.js";
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Search products
|
|
30
|
+
*
|
|
31
|
+
* @remarks
|
|
32
|
+
* Search for products matching a specific words or characters given.
|
|
33
|
+
*
|
|
34
|
+
* @see {@link https://llm-docs.commercengine.io/storefront/operations/search-marketplace-products} - API reference for the search-marketplace-products operation
|
|
35
|
+
*/
|
|
36
|
+
export function marketplaceSearchProducts(
|
|
37
|
+
client: CeStorefrontCore,
|
|
38
|
+
request: operations.SearchMarketplaceProductsRequest,
|
|
39
|
+
options?: RequestOptions,
|
|
40
|
+
): APIPromise<
|
|
41
|
+
Result<
|
|
42
|
+
operations.SearchMarketplaceProductsResponseBody,
|
|
43
|
+
| errors.Unauthorized
|
|
44
|
+
| CeStorefrontError
|
|
45
|
+
| ResponseValidationError
|
|
46
|
+
| ConnectionError
|
|
47
|
+
| RequestAbortedError
|
|
48
|
+
| RequestTimeoutError
|
|
49
|
+
| InvalidRequestError
|
|
50
|
+
| UnexpectedClientError
|
|
51
|
+
| SDKValidationError
|
|
52
|
+
>
|
|
53
|
+
> {
|
|
54
|
+
return new APIPromise($do(
|
|
55
|
+
client,
|
|
56
|
+
request,
|
|
57
|
+
options,
|
|
58
|
+
));
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
async function $do(
|
|
62
|
+
client: CeStorefrontCore,
|
|
63
|
+
request: operations.SearchMarketplaceProductsRequest,
|
|
64
|
+
options?: RequestOptions,
|
|
65
|
+
): Promise<
|
|
66
|
+
[
|
|
67
|
+
Result<
|
|
68
|
+
operations.SearchMarketplaceProductsResponseBody,
|
|
69
|
+
| errors.Unauthorized
|
|
70
|
+
| CeStorefrontError
|
|
71
|
+
| ResponseValidationError
|
|
72
|
+
| ConnectionError
|
|
73
|
+
| RequestAbortedError
|
|
74
|
+
| RequestTimeoutError
|
|
75
|
+
| InvalidRequestError
|
|
76
|
+
| UnexpectedClientError
|
|
77
|
+
| SDKValidationError
|
|
78
|
+
>,
|
|
79
|
+
APICall,
|
|
80
|
+
]
|
|
81
|
+
> {
|
|
82
|
+
const parsed = safeParse(
|
|
83
|
+
request,
|
|
84
|
+
(value) =>
|
|
85
|
+
operations.SearchMarketplaceProductsRequest$outboundSchema.parse(value),
|
|
86
|
+
"Input validation failed",
|
|
87
|
+
);
|
|
88
|
+
if (!parsed.ok) {
|
|
89
|
+
return [parsed, { status: "invalid" }];
|
|
90
|
+
}
|
|
91
|
+
const payload = parsed.value;
|
|
92
|
+
const body = encodeJSON("body", payload.SearchProduct, { explode: true });
|
|
93
|
+
|
|
94
|
+
const path = pathToFunc("/catalog/marketplace/products/search")();
|
|
95
|
+
|
|
96
|
+
const headers = new Headers(compactMap({
|
|
97
|
+
"Content-Type": "application/json",
|
|
98
|
+
Accept: "application/json",
|
|
99
|
+
"x-customer-group-id": encodeSimple(
|
|
100
|
+
"x-customer-group-id",
|
|
101
|
+
payload["x-customer-group-id"],
|
|
102
|
+
{ explode: false, charEncoding: "none" },
|
|
103
|
+
),
|
|
104
|
+
}));
|
|
105
|
+
|
|
106
|
+
const secConfig = await extractSecurity(client._options.authorization);
|
|
107
|
+
const securityInput = secConfig == null ? {} : { authorization: secConfig };
|
|
108
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
109
|
+
|
|
110
|
+
const context = {
|
|
111
|
+
options: client._options,
|
|
112
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
113
|
+
operationID: "search-marketplace-products",
|
|
114
|
+
oAuth2Scopes: null,
|
|
115
|
+
|
|
116
|
+
resolvedSecurity: requestSecurity,
|
|
117
|
+
|
|
118
|
+
securitySource: client._options.authorization,
|
|
119
|
+
retryConfig: options?.retries
|
|
120
|
+
|| client._options.retryConfig
|
|
121
|
+
|| { strategy: "none" },
|
|
122
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
const requestRes = client._createRequest(context, {
|
|
126
|
+
security: requestSecurity,
|
|
127
|
+
method: "POST",
|
|
128
|
+
baseURL: options?.serverURL,
|
|
129
|
+
path: path,
|
|
130
|
+
headers: headers,
|
|
131
|
+
body: body,
|
|
132
|
+
userAgent: client._options.userAgent,
|
|
133
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
134
|
+
}, options);
|
|
135
|
+
if (!requestRes.ok) {
|
|
136
|
+
return [requestRes, { status: "invalid" }];
|
|
137
|
+
}
|
|
138
|
+
const req = requestRes.value;
|
|
139
|
+
|
|
140
|
+
const doResult = await client._do(req, {
|
|
141
|
+
context,
|
|
142
|
+
errorCodes: ["401", "4XX", "5XX"],
|
|
143
|
+
retryConfig: context.retryConfig,
|
|
144
|
+
retryCodes: context.retryCodes,
|
|
145
|
+
});
|
|
146
|
+
if (!doResult.ok) {
|
|
147
|
+
return [doResult, { status: "request-error", request: req }];
|
|
148
|
+
}
|
|
149
|
+
const response = doResult.value;
|
|
150
|
+
|
|
151
|
+
const responseFields = {
|
|
152
|
+
HttpMeta: { Response: response, Request: req },
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
const [result] = await M.match<
|
|
156
|
+
operations.SearchMarketplaceProductsResponseBody,
|
|
157
|
+
| errors.Unauthorized
|
|
158
|
+
| CeStorefrontError
|
|
159
|
+
| ResponseValidationError
|
|
160
|
+
| ConnectionError
|
|
161
|
+
| RequestAbortedError
|
|
162
|
+
| RequestTimeoutError
|
|
163
|
+
| InvalidRequestError
|
|
164
|
+
| UnexpectedClientError
|
|
165
|
+
| SDKValidationError
|
|
166
|
+
>(
|
|
167
|
+
M.json(200, operations.SearchMarketplaceProductsResponseBody$inboundSchema),
|
|
168
|
+
M.jsonErr(401, errors.Unauthorized$inboundSchema),
|
|
169
|
+
M.fail("4XX"),
|
|
170
|
+
M.fail("5XX"),
|
|
171
|
+
)(response, req, { extraFields: responseFields });
|
|
172
|
+
if (!result.ok) {
|
|
173
|
+
return [result, { status: "complete", request: req, response }];
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
return [result, { status: "complete", request: req, response }];
|
|
177
|
+
}
|
package/src/lib/config.ts
CHANGED
|
@@ -80,7 +80,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
|
|
|
80
80
|
export const SDK_METADATA = {
|
|
81
81
|
language: "typescript",
|
|
82
82
|
openapiDocVersion: "1.0",
|
|
83
|
-
sdkVersion: "0.
|
|
84
|
-
genVersion: "2.
|
|
85
|
-
userAgent: "speakeasy-sdk/typescript 0.
|
|
83
|
+
sdkVersion: "0.21.0",
|
|
84
|
+
genVersion: "2.768.1",
|
|
85
|
+
userAgent: "speakeasy-sdk/typescript 0.21.0 2.768.1 1.0 ce-storefront",
|
|
86
86
|
} as const;
|
package/src/lib/encodings.ts
CHANGED
|
@@ -102,8 +102,9 @@ export function encodeLabel(
|
|
|
102
102
|
});
|
|
103
103
|
encValue = mapped?.join("").slice(1);
|
|
104
104
|
} else {
|
|
105
|
-
const k =
|
|
106
|
-
|
|
105
|
+
const k = options?.explode && isPlainObject(value)
|
|
106
|
+
? `${encodeString(pk)}=`
|
|
107
|
+
: "";
|
|
107
108
|
encValue = `${k}${encodeValue(pv)}`;
|
|
108
109
|
}
|
|
109
110
|
|
|
@@ -426,6 +427,7 @@ export function queryJoin(...args: (string | undefined)[]): string {
|
|
|
426
427
|
type QueryEncoderOptions = {
|
|
427
428
|
explode?: boolean;
|
|
428
429
|
charEncoding?: "percent" | "none";
|
|
430
|
+
allowEmptyValue?: string[];
|
|
429
431
|
};
|
|
430
432
|
|
|
431
433
|
type QueryEncoder = (
|
|
@@ -440,7 +442,7 @@ type BulkQueryEncoder = (
|
|
|
440
442
|
) => string;
|
|
441
443
|
|
|
442
444
|
export function queryEncoder(f: QueryEncoder): BulkQueryEncoder {
|
|
443
|
-
const bulkEncode = function
|
|
445
|
+
const bulkEncode = function(
|
|
444
446
|
values: Record<string, unknown>,
|
|
445
447
|
options?: QueryEncoderOptions,
|
|
446
448
|
): string {
|
|
@@ -450,7 +452,19 @@ export function queryEncoder(f: QueryEncoder): BulkQueryEncoder {
|
|
|
450
452
|
charEncoding: options?.charEncoding ?? "percent",
|
|
451
453
|
};
|
|
452
454
|
|
|
455
|
+
const allowEmptySet = new Set(options?.allowEmptyValue ?? []);
|
|
456
|
+
|
|
453
457
|
const encoded = Object.entries(values).map(([key, value]) => {
|
|
458
|
+
if (allowEmptySet.has(key)) {
|
|
459
|
+
if (
|
|
460
|
+
value === undefined
|
|
461
|
+
|| value === null
|
|
462
|
+
|| value === ""
|
|
463
|
+
|| (Array.isArray(value) && value.length === 0)
|
|
464
|
+
) {
|
|
465
|
+
return `${encodeURIComponent(key)}=`;
|
|
466
|
+
}
|
|
467
|
+
}
|
|
454
468
|
return f(key, value, opts);
|
|
455
469
|
});
|
|
456
470
|
return queryJoin(...encoded);
|
|
@@ -19,7 +19,7 @@ export type BooleanAttribute = {
|
|
|
19
19
|
* A lookup safe version of the name that is lowercased and spaces are replaced with underscores. For instance, if name is `Product Type`, key will be `product_type`
|
|
20
20
|
*/
|
|
21
21
|
key: string;
|
|
22
|
-
type:
|
|
22
|
+
type: "boolean";
|
|
23
23
|
/**
|
|
24
24
|
* For boolean attributes
|
|
25
25
|
*/
|
|
@@ -35,7 +35,7 @@ export const BooleanAttribute$inboundSchema: z.ZodType<
|
|
|
35
35
|
id: z.string(),
|
|
36
36
|
name: z.string(),
|
|
37
37
|
key: z.string(),
|
|
38
|
-
type: z.
|
|
38
|
+
type: z.literal("boolean"),
|
|
39
39
|
value: z.boolean(),
|
|
40
40
|
});
|
|
41
41
|
|
|
@@ -19,7 +19,7 @@ export type PreferenceType = ClosedEnum<typeof PreferenceType>;
|
|
|
19
19
|
* @see {@link https://llm-docs.commercengine.io/storefront/schemas/CollectInStoreFulfillment} - API reference for the CollectInStoreFulfillment schema
|
|
20
20
|
*/
|
|
21
21
|
export type CollectInStoreFulfillment = {
|
|
22
|
-
fulfillmentType
|
|
22
|
+
fulfillmentType: "collect-in-store";
|
|
23
23
|
preferenceType?: PreferenceType | undefined;
|
|
24
24
|
pickupLocationId: string;
|
|
25
25
|
pickupLocationName?: string | undefined;
|
|
@@ -36,8 +36,7 @@ export const CollectInStoreFulfillment$inboundSchema: z.ZodType<
|
|
|
36
36
|
z.ZodTypeDef,
|
|
37
37
|
unknown
|
|
38
38
|
> = z.object({
|
|
39
|
-
fulfillment_type: z.literal("collect-in-store")
|
|
40
|
-
.optional(),
|
|
39
|
+
fulfillment_type: z.literal("collect-in-store"),
|
|
41
40
|
preference_type: PreferenceType$inboundSchema.optional(),
|
|
42
41
|
pickup_location_id: z.string(),
|
|
43
42
|
pickup_location_name: z.string().optional(),
|
|
@@ -9,7 +9,7 @@ import { remap as remap$ } from "../../lib/primitives.js";
|
|
|
9
9
|
* @see {@link https://llm-docs.commercengine.io/storefront/schemas/CollectInStoreFulfillment} - API reference for the CollectInStoreFulfillment schema
|
|
10
10
|
*/
|
|
11
11
|
export type CollectInStoreFulfillmentInput = {
|
|
12
|
-
fulfillmentType
|
|
12
|
+
fulfillmentType: "collect-in-store";
|
|
13
13
|
pickupLocationId: string;
|
|
14
14
|
};
|
|
15
15
|
|
|
@@ -27,7 +27,7 @@ export type ColorAttribute = {
|
|
|
27
27
|
* A lookup safe version of the name that is lowercased and spaces are replaced with underscores. For instance, if name is `Product Type`, key will be `product_type`
|
|
28
28
|
*/
|
|
29
29
|
key: string;
|
|
30
|
-
type:
|
|
30
|
+
type: "color";
|
|
31
31
|
value: Array<ColorAttributeValue>;
|
|
32
32
|
};
|
|
33
33
|
|
|
@@ -60,7 +60,7 @@ export const ColorAttribute$inboundSchema: z.ZodType<
|
|
|
60
60
|
id: z.string(),
|
|
61
61
|
name: z.string(),
|
|
62
62
|
key: z.string(),
|
|
63
|
-
type: z.
|
|
63
|
+
type: z.literal("color"),
|
|
64
64
|
value: z.array(z.lazy(() => ColorAttributeValue$inboundSchema)),
|
|
65
65
|
});
|
|
66
66
|
|
|
@@ -29,7 +29,7 @@ export type ColorOption = {
|
|
|
29
29
|
/**
|
|
30
30
|
* The type of the associated option.
|
|
31
31
|
*/
|
|
32
|
-
type
|
|
32
|
+
type: "color";
|
|
33
33
|
value: Value;
|
|
34
34
|
};
|
|
35
35
|
|
|
@@ -57,7 +57,7 @@ export const ColorOption$inboundSchema: z.ZodType<
|
|
|
57
57
|
unknown
|
|
58
58
|
> = z.object({
|
|
59
59
|
name: z.string(),
|
|
60
|
-
type: z.literal("color")
|
|
60
|
+
type: z.literal("color"),
|
|
61
61
|
value: z.lazy(() => Value$inboundSchema),
|
|
62
62
|
});
|
|
63
63
|
|
|
@@ -35,7 +35,7 @@ export type CustomerAddress = {
|
|
|
35
35
|
pincode: string;
|
|
36
36
|
city: string;
|
|
37
37
|
state: string;
|
|
38
|
-
country
|
|
38
|
+
country: "India";
|
|
39
39
|
/**
|
|
40
40
|
* Tax Identification Number (TIN/VAT/GSTIN) specific to the country of operation.
|
|
41
41
|
*/
|
|
@@ -66,7 +66,7 @@ export const CustomerAddress$inboundSchema: z.ZodType<
|
|
|
66
66
|
pincode: z.string(),
|
|
67
67
|
city: z.string(),
|
|
68
68
|
state: z.string(),
|
|
69
|
-
country: z.literal("India")
|
|
69
|
+
country: z.literal("India"),
|
|
70
70
|
tax_identification_number: z.nullable(z.string()),
|
|
71
71
|
business_name: z.nullable(z.string()),
|
|
72
72
|
is_phone_verified: z.boolean(),
|
|
@@ -19,7 +19,7 @@ export type DateAttribute = {
|
|
|
19
19
|
* A lookup safe version of the name that is lowercased and spaces are replaced with underscores. For instance, if name is `Product Type`, key will be `product_type`
|
|
20
20
|
*/
|
|
21
21
|
key: string;
|
|
22
|
-
type:
|
|
22
|
+
type: "date";
|
|
23
23
|
/**
|
|
24
24
|
* For date attributes
|
|
25
25
|
*/
|
|
@@ -35,7 +35,7 @@ export const DateAttribute$inboundSchema: z.ZodType<
|
|
|
35
35
|
id: z.string(),
|
|
36
36
|
name: z.string(),
|
|
37
37
|
key: z.string(),
|
|
38
|
-
type: z.
|
|
38
|
+
type: z.literal("date"),
|
|
39
39
|
value: z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
40
40
|
});
|
|
41
41
|
|
|
@@ -21,7 +21,7 @@ export type DeliveryFulfillmentPreferenceType = ClosedEnum<
|
|
|
21
21
|
* @see {@link https://llm-docs.commercengine.io/storefront/schemas/DeliveryFulfillment} - API reference for the DeliveryFulfillment schema
|
|
22
22
|
*/
|
|
23
23
|
export type DeliveryFulfillment = {
|
|
24
|
-
fulfillmentType
|
|
24
|
+
fulfillmentType: "delivery";
|
|
25
25
|
preferenceType?: DeliveryFulfillmentPreferenceType | undefined;
|
|
26
26
|
shippingProviderId: string | null;
|
|
27
27
|
shippingProviderName?: string | null | undefined;
|
|
@@ -40,7 +40,7 @@ export const DeliveryFulfillment$inboundSchema: z.ZodType<
|
|
|
40
40
|
z.ZodTypeDef,
|
|
41
41
|
unknown
|
|
42
42
|
> = z.object({
|
|
43
|
-
fulfillment_type: z.literal("delivery")
|
|
43
|
+
fulfillment_type: z.literal("delivery"),
|
|
44
44
|
preference_type: DeliveryFulfillmentPreferenceType$inboundSchema.optional(),
|
|
45
45
|
shipping_provider_id: z.nullable(z.string()),
|
|
46
46
|
shipping_provider_name: z.nullable(z.string()).optional(),
|
|
@@ -9,7 +9,7 @@ import { remap as remap$ } from "../../lib/primitives.js";
|
|
|
9
9
|
* @see {@link https://llm-docs.commercengine.io/storefront/schemas/DeliveryFulfillment} - API reference for the DeliveryFulfillment schema
|
|
10
10
|
*/
|
|
11
11
|
export type DeliveryFulfillmentInput = {
|
|
12
|
-
fulfillmentType
|
|
12
|
+
fulfillmentType: "delivery";
|
|
13
13
|
shippingProviderId: string | null;
|
|
14
14
|
courierCompanyId?: string | null | undefined;
|
|
15
15
|
};
|
|
@@ -9,16 +9,6 @@ import { ClosedEnum } from "../../types/enums.js";
|
|
|
9
9
|
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
10
10
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
11
11
|
|
|
12
|
-
export const DiscountBasedPromotionPromotionType = {
|
|
13
|
-
Discount: "discount",
|
|
14
|
-
VolumeBased: "volume-based",
|
|
15
|
-
FixedPrice: "fixed-price",
|
|
16
|
-
FreeGoods: "free-goods",
|
|
17
|
-
} as const;
|
|
18
|
-
export type DiscountBasedPromotionPromotionType = ClosedEnum<
|
|
19
|
-
typeof DiscountBasedPromotionPromotionType
|
|
20
|
-
>;
|
|
21
|
-
|
|
22
12
|
export const DiscountType = {
|
|
23
13
|
Percentage: "percentage",
|
|
24
14
|
FixedAmount: "fixed-amount",
|
|
@@ -29,7 +19,7 @@ export type DiscountType = ClosedEnum<typeof DiscountType>;
|
|
|
29
19
|
* @see {@link https://llm-docs.commercengine.io/storefront/schemas/DiscountBasedPromotion} - API reference for the DiscountBasedPromotion schema
|
|
30
20
|
*/
|
|
31
21
|
export type DiscountBasedPromotion = {
|
|
32
|
-
promotionType
|
|
22
|
+
promotionType: "discount";
|
|
33
23
|
discountType: DiscountType;
|
|
34
24
|
/**
|
|
35
25
|
* '> 0' if discount_type = percentage, otherwise set 0.
|
|
@@ -41,11 +31,6 @@ export type DiscountBasedPromotion = {
|
|
|
41
31
|
discountFixedAmount?: number | undefined;
|
|
42
32
|
};
|
|
43
33
|
|
|
44
|
-
/** @internal */
|
|
45
|
-
export const DiscountBasedPromotionPromotionType$inboundSchema: z.ZodNativeEnum<
|
|
46
|
-
typeof DiscountBasedPromotionPromotionType
|
|
47
|
-
> = z.nativeEnum(DiscountBasedPromotionPromotionType);
|
|
48
|
-
|
|
49
34
|
/** @internal */
|
|
50
35
|
export const DiscountType$inboundSchema: z.ZodNativeEnum<typeof DiscountType> =
|
|
51
36
|
z.nativeEnum(DiscountType);
|
|
@@ -56,7 +41,7 @@ export const DiscountBasedPromotion$inboundSchema: z.ZodType<
|
|
|
56
41
|
z.ZodTypeDef,
|
|
57
42
|
unknown
|
|
58
43
|
> = z.object({
|
|
59
|
-
promotion_type: z.literal("discount")
|
|
44
|
+
promotion_type: z.literal("discount"),
|
|
60
45
|
discount_type: DiscountType$inboundSchema,
|
|
61
46
|
discount_percent: z.number().optional(),
|
|
62
47
|
discount_fixed_amount: z.number().int().optional(),
|
|
@@ -5,40 +5,24 @@
|
|
|
5
5
|
import * as z from "zod/v3";
|
|
6
6
|
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
7
|
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
-
import { ClosedEnum } from "../../types/enums.js";
|
|
9
8
|
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
10
9
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
11
10
|
|
|
12
|
-
export const FixedPricePromotionPromotionType = {
|
|
13
|
-
Discount: "discount",
|
|
14
|
-
VolumeBased: "volume-based",
|
|
15
|
-
FixedPrice: "fixed-price",
|
|
16
|
-
FreeGoods: "free-goods",
|
|
17
|
-
} as const;
|
|
18
|
-
export type FixedPricePromotionPromotionType = ClosedEnum<
|
|
19
|
-
typeof FixedPricePromotionPromotionType
|
|
20
|
-
>;
|
|
21
|
-
|
|
22
11
|
/**
|
|
23
12
|
* @see {@link https://llm-docs.commercengine.io/storefront/schemas/FixedPricePromotion} - API reference for the FixedPricePromotion schema
|
|
24
13
|
*/
|
|
25
14
|
export type FixedPricePromotion = {
|
|
26
|
-
promotionType
|
|
15
|
+
promotionType: "fixed-price";
|
|
27
16
|
offerPrice: number;
|
|
28
17
|
};
|
|
29
18
|
|
|
30
|
-
/** @internal */
|
|
31
|
-
export const FixedPricePromotionPromotionType$inboundSchema: z.ZodNativeEnum<
|
|
32
|
-
typeof FixedPricePromotionPromotionType
|
|
33
|
-
> = z.nativeEnum(FixedPricePromotionPromotionType);
|
|
34
|
-
|
|
35
19
|
/** @internal */
|
|
36
20
|
export const FixedPricePromotion$inboundSchema: z.ZodType<
|
|
37
21
|
FixedPricePromotion,
|
|
38
22
|
z.ZodTypeDef,
|
|
39
23
|
unknown
|
|
40
24
|
> = z.object({
|
|
41
|
-
promotion_type: z.literal("fixed-price")
|
|
25
|
+
promotion_type: z.literal("fixed-price"),
|
|
42
26
|
offer_price: z.number(),
|
|
43
27
|
}).transform((v) => {
|
|
44
28
|
return remap$(v, {
|