ce-storefront 0.20.1 → 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/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/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/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/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/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/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,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, {
|
|
@@ -5,25 +5,14 @@
|
|
|
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 FreeGoodsPromotionPromotionType = {
|
|
13
|
-
Discount: "discount",
|
|
14
|
-
VolumeBased: "volume-based",
|
|
15
|
-
FixedPrice: "fixed-price",
|
|
16
|
-
FreeGoods: "free-goods",
|
|
17
|
-
} as const;
|
|
18
|
-
export type FreeGoodsPromotionPromotionType = ClosedEnum<
|
|
19
|
-
typeof FreeGoodsPromotionPromotionType
|
|
20
|
-
>;
|
|
21
|
-
|
|
22
11
|
/**
|
|
23
12
|
* @see {@link https://llm-docs.commercengine.io/storefront/schemas/FreeGoodsPromotion} - API reference for the FreeGoodsPromotion schema
|
|
24
13
|
*/
|
|
25
14
|
export type FreeGoodsPromotion = {
|
|
26
|
-
promotionType
|
|
15
|
+
promotionType: "free-goods";
|
|
27
16
|
/**
|
|
28
17
|
* The quantity of items a customer must buy to receive free goods.
|
|
29
18
|
*/
|
|
@@ -34,18 +23,13 @@ export type FreeGoodsPromotion = {
|
|
|
34
23
|
getQuantity: number;
|
|
35
24
|
};
|
|
36
25
|
|
|
37
|
-
/** @internal */
|
|
38
|
-
export const FreeGoodsPromotionPromotionType$inboundSchema: z.ZodNativeEnum<
|
|
39
|
-
typeof FreeGoodsPromotionPromotionType
|
|
40
|
-
> = z.nativeEnum(FreeGoodsPromotionPromotionType);
|
|
41
|
-
|
|
42
26
|
/** @internal */
|
|
43
27
|
export const FreeGoodsPromotion$inboundSchema: z.ZodType<
|
|
44
28
|
FreeGoodsPromotion,
|
|
45
29
|
z.ZodTypeDef,
|
|
46
30
|
unknown
|
|
47
31
|
> = z.object({
|
|
48
|
-
promotion_type: z.literal("free-goods")
|
|
32
|
+
promotion_type: z.literal("free-goods"),
|
|
49
33
|
buy_quantity: z.number().int(),
|
|
50
34
|
get_quantity: z.number().int(),
|
|
51
35
|
}).transform((v) => {
|
|
@@ -23,11 +23,9 @@ import {
|
|
|
23
23
|
* @see {@link https://llm-docs.commercengine.io/storefront/schemas/FulfillmentPreference} - API reference for the FulfillmentPreference schema
|
|
24
24
|
*/
|
|
25
25
|
export type FulfillmentPreference =
|
|
26
|
-
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
| (CollectInStoreFulfillment & { fulfillmentType: "collect-in-store" })
|
|
30
|
-
| (DeliveryFulfillment & { fulfillmentType: "delivery" });
|
|
26
|
+
| CollectInStoreFulfillment
|
|
27
|
+
| DeliveryFulfillment
|
|
28
|
+
| PartialCollectAndDelivery;
|
|
31
29
|
|
|
32
30
|
/** @internal */
|
|
33
31
|
export const FulfillmentPreference$inboundSchema: z.ZodType<
|
|
@@ -35,20 +33,9 @@ export const FulfillmentPreference$inboundSchema: z.ZodType<
|
|
|
35
33
|
z.ZodTypeDef,
|
|
36
34
|
unknown
|
|
37
35
|
> = z.union([
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
),
|
|
42
|
-
CollectInStoreFulfillment$inboundSchema.and(
|
|
43
|
-
z.object({ fulfillment_type: z.literal("collect-in-store") }).transform((
|
|
44
|
-
v,
|
|
45
|
-
) => ({ fulfillmentType: v.fulfillment_type })),
|
|
46
|
-
),
|
|
47
|
-
DeliveryFulfillment$inboundSchema.and(
|
|
48
|
-
z.object({ fulfillment_type: z.literal("delivery") }).transform((v) => ({
|
|
49
|
-
fulfillmentType: v.fulfillment_type,
|
|
50
|
-
})),
|
|
51
|
-
),
|
|
36
|
+
CollectInStoreFulfillment$inboundSchema,
|
|
37
|
+
DeliveryFulfillment$inboundSchema,
|
|
38
|
+
PartialCollectAndDelivery$inboundSchema,
|
|
52
39
|
]);
|
|
53
40
|
|
|
54
41
|
export function fulfillmentPreferenceFromJSON(
|
|
@@ -23,21 +23,15 @@ import {
|
|
|
23
23
|
* @see {@link https://llm-docs.commercengine.io/storefront/schemas/FulfillmentPreference} - API reference for the FulfillmentPreference schema
|
|
24
24
|
*/
|
|
25
25
|
export type FulfillmentPreferenceInput =
|
|
26
|
-
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
| (CollectInStoreFulfillmentInput & { fulfillmentType: "collect-in-store" })
|
|
30
|
-
| (DeliveryFulfillmentInput & { fulfillmentType: "delivery" });
|
|
26
|
+
| CollectInStoreFulfillmentInput
|
|
27
|
+
| DeliveryFulfillmentInput
|
|
28
|
+
| PartialCollectAndDeliveryInput;
|
|
31
29
|
|
|
32
30
|
/** @internal */
|
|
33
31
|
export type FulfillmentPreferenceInput$Outbound =
|
|
34
|
-
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
| (CollectInStoreFulfillmentInput$Outbound & {
|
|
38
|
-
fulfillment_type: "collect-in-store";
|
|
39
|
-
})
|
|
40
|
-
| (DeliveryFulfillmentInput$Outbound & { fulfillment_type: "delivery" });
|
|
32
|
+
| CollectInStoreFulfillmentInput$Outbound
|
|
33
|
+
| DeliveryFulfillmentInput$Outbound
|
|
34
|
+
| PartialCollectAndDeliveryInput$Outbound;
|
|
41
35
|
|
|
42
36
|
/** @internal */
|
|
43
37
|
export const FulfillmentPreferenceInput$outboundSchema: z.ZodType<
|
|
@@ -45,20 +39,9 @@ export const FulfillmentPreferenceInput$outboundSchema: z.ZodType<
|
|
|
45
39
|
z.ZodTypeDef,
|
|
46
40
|
FulfillmentPreferenceInput
|
|
47
41
|
> = z.union([
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
),
|
|
52
|
-
CollectInStoreFulfillmentInput$outboundSchema.and(
|
|
53
|
-
z.object({ fulfillmentType: z.literal("collect-in-store") }).transform((
|
|
54
|
-
v,
|
|
55
|
-
) => ({ fulfillment_type: v.fulfillmentType })),
|
|
56
|
-
),
|
|
57
|
-
DeliveryFulfillmentInput$outboundSchema.and(
|
|
58
|
-
z.object({ fulfillmentType: z.literal("delivery") }).transform((v) => ({
|
|
59
|
-
fulfillment_type: v.fulfillmentType,
|
|
60
|
-
})),
|
|
61
|
-
),
|
|
42
|
+
CollectInStoreFulfillmentInput$outboundSchema,
|
|
43
|
+
DeliveryFulfillmentInput$outboundSchema,
|
|
44
|
+
PartialCollectAndDeliveryInput$outboundSchema,
|
|
62
45
|
]);
|
|
63
46
|
|
|
64
47
|
export function fulfillmentPreferenceInputToJSON(
|
|
@@ -20,7 +20,7 @@ export type GenerateOtpWithEmailOtpAction = ClosedEnum<
|
|
|
20
20
|
* @see {@link https://llm-docs.commercengine.io/storefront/schemas/GenerateOtpWithEmail} - API reference for the GenerateOtpWithEmail schema
|
|
21
21
|
*/
|
|
22
22
|
export type GenerateOtpWithEmail = {
|
|
23
|
-
channel
|
|
23
|
+
channel: "email";
|
|
24
24
|
email: string;
|
|
25
25
|
otpAction: GenerateOtpWithEmailOtpAction;
|
|
26
26
|
};
|
|
@@ -16,7 +16,7 @@ export type Action = ClosedEnum<typeof Action>;
|
|
|
16
16
|
*/
|
|
17
17
|
export type JusPayHyperCheckout = {
|
|
18
18
|
paymentProviderSlug: string;
|
|
19
|
-
integrationType
|
|
19
|
+
integrationType: "hyper-checkout";
|
|
20
20
|
gatewayReferenceId: string;
|
|
21
21
|
returnUrl: string;
|
|
22
22
|
action: Action;
|
|
@@ -158,12 +158,11 @@ export const Payload$inboundSchema: z.ZodType<Payload, z.ZodTypeDef, unknown> =
|
|
|
158
158
|
customerEmail: z.string().optional(),
|
|
159
159
|
currency: z.string().optional(),
|
|
160
160
|
description: z.string().optional(),
|
|
161
|
-
"options.createMandate": z.literal("REQUIRED").
|
|
162
|
-
.optional(),
|
|
161
|
+
"options.createMandate": z.literal("REQUIRED").optional(),
|
|
163
162
|
"mandate.maxAmount": z.string().optional(),
|
|
164
163
|
"mandate.start_date ": z.string().optional(),
|
|
165
164
|
"mandate.end_date ": z.string().optional(),
|
|
166
|
-
"mandate.frequency": z.literal("MONTHLY").
|
|
165
|
+
"mandate.frequency": z.literal("MONTHLY").optional(),
|
|
167
166
|
"mandate.rule_value ": MandateRuleValue$inboundSchema.optional(),
|
|
168
167
|
}).transform((v) => {
|
|
169
168
|
return remap$(v, {
|