ce-storefront 0.13.3 → 0.14.1
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 +35 -28
- package/docs/sdks/catalog/README.md +7 -3
- package/esm/funcs/authGenerateOtp.d.ts +3 -2
- package/esm/funcs/authGenerateOtp.d.ts.map +1 -1
- package/esm/funcs/authGenerateOtp.js +1 -1
- package/esm/funcs/authGenerateOtp.js.map +1 -1
- package/esm/funcs/authGetAnonymousToken.d.ts +3 -2
- package/esm/funcs/authGetAnonymousToken.d.ts.map +1 -1
- package/esm/funcs/authGetAnonymousToken.js +1 -1
- package/esm/funcs/authGetAnonymousToken.js.map +1 -1
- package/esm/funcs/authGetUserDetail.d.ts +3 -2
- package/esm/funcs/authGetUserDetail.d.ts.map +1 -1
- package/esm/funcs/authGetUserDetail.js +1 -1
- package/esm/funcs/authGetUserDetail.js.map +1 -1
- package/esm/funcs/authLoginWithEmail.d.ts +3 -2
- package/esm/funcs/authLoginWithEmail.d.ts.map +1 -1
- package/esm/funcs/authLoginWithEmail.js +1 -1
- package/esm/funcs/authLoginWithEmail.js.map +1 -1
- package/esm/funcs/authLoginWithPhone.d.ts +3 -2
- package/esm/funcs/authLoginWithPhone.d.ts.map +1 -1
- package/esm/funcs/authLoginWithPhone.js +1 -1
- package/esm/funcs/authLoginWithPhone.js.map +1 -1
- package/esm/funcs/authLoginWithWhatsapp.d.ts +3 -2
- package/esm/funcs/authLoginWithWhatsapp.d.ts.map +1 -1
- package/esm/funcs/authLoginWithWhatsapp.js +1 -1
- package/esm/funcs/authLoginWithWhatsapp.js.map +1 -1
- package/esm/funcs/authLogout.d.ts +3 -2
- package/esm/funcs/authLogout.d.ts.map +1 -1
- package/esm/funcs/authLogout.js +1 -1
- package/esm/funcs/authLogout.js.map +1 -1
- package/esm/funcs/authRefreshToken.d.ts +3 -2
- package/esm/funcs/authRefreshToken.d.ts.map +1 -1
- package/esm/funcs/authRefreshToken.js +1 -1
- package/esm/funcs/authRefreshToken.js.map +1 -1
- package/esm/funcs/authUpdateUser.d.ts +3 -2
- package/esm/funcs/authUpdateUser.d.ts.map +1 -1
- package/esm/funcs/authUpdateUser.js +1 -1
- package/esm/funcs/authUpdateUser.js.map +1 -1
- package/esm/funcs/authVerifyOtp.d.ts +3 -2
- package/esm/funcs/authVerifyOtp.d.ts.map +1 -1
- package/esm/funcs/authVerifyOtp.js +1 -1
- package/esm/funcs/authVerifyOtp.js.map +1 -1
- package/esm/funcs/cartsAddShippingMethod.d.ts +3 -2
- package/esm/funcs/cartsAddShippingMethod.d.ts.map +1 -1
- package/esm/funcs/cartsAddShippingMethod.js +1 -1
- package/esm/funcs/cartsAddShippingMethod.js.map +1 -1
- package/esm/funcs/cartsApplyCoupon.d.ts +3 -2
- package/esm/funcs/cartsApplyCoupon.d.ts.map +1 -1
- package/esm/funcs/cartsApplyCoupon.js +1 -1
- package/esm/funcs/cartsApplyCoupon.js.map +1 -1
- package/esm/funcs/cartsCreateCart.d.ts +3 -2
- package/esm/funcs/cartsCreateCart.d.ts.map +1 -1
- package/esm/funcs/cartsCreateCart.js +1 -1
- package/esm/funcs/cartsCreateCart.js.map +1 -1
- package/esm/funcs/cartsCreateCartAddress.d.ts +3 -2
- package/esm/funcs/cartsCreateCartAddress.d.ts.map +1 -1
- package/esm/funcs/cartsCreateCartAddress.js +1 -1
- package/esm/funcs/cartsCreateCartAddress.js.map +1 -1
- package/esm/funcs/cartsDeleteCart.d.ts +3 -2
- package/esm/funcs/cartsDeleteCart.d.ts.map +1 -1
- package/esm/funcs/cartsDeleteCart.js +1 -1
- package/esm/funcs/cartsDeleteCart.js.map +1 -1
- package/esm/funcs/cartsGetCart.d.ts +3 -2
- package/esm/funcs/cartsGetCart.d.ts.map +1 -1
- package/esm/funcs/cartsGetCart.js +1 -1
- package/esm/funcs/cartsGetCart.js.map +1 -1
- package/esm/funcs/cartsGetUserCart.d.ts +3 -2
- package/esm/funcs/cartsGetUserCart.d.ts.map +1 -1
- package/esm/funcs/cartsGetUserCart.js +1 -1
- package/esm/funcs/cartsGetUserCart.js.map +1 -1
- package/esm/funcs/cartsRedeemLoyaltyPoints.d.ts +3 -2
- package/esm/funcs/cartsRedeemLoyaltyPoints.d.ts.map +1 -1
- package/esm/funcs/cartsRedeemLoyaltyPoints.js +1 -1
- package/esm/funcs/cartsRedeemLoyaltyPoints.js.map +1 -1
- package/esm/funcs/cartsRemoveCoupon.d.ts +3 -2
- package/esm/funcs/cartsRemoveCoupon.d.ts.map +1 -1
- package/esm/funcs/cartsRemoveCoupon.js +1 -1
- package/esm/funcs/cartsRemoveCoupon.js.map +1 -1
- package/esm/funcs/cartsRemoveLoyaltyPoints.d.ts +3 -2
- package/esm/funcs/cartsRemoveLoyaltyPoints.d.ts.map +1 -1
- package/esm/funcs/cartsRemoveLoyaltyPoints.js +1 -1
- package/esm/funcs/cartsRemoveLoyaltyPoints.js.map +1 -1
- package/esm/funcs/cartsRemoveUserCart.d.ts +3 -2
- package/esm/funcs/cartsRemoveUserCart.d.ts.map +1 -1
- package/esm/funcs/cartsRemoveUserCart.js +1 -1
- package/esm/funcs/cartsRemoveUserCart.js.map +1 -1
- package/esm/funcs/cartsUpdateCart.d.ts +3 -2
- package/esm/funcs/cartsUpdateCart.d.ts.map +1 -1
- package/esm/funcs/cartsUpdateCart.js +1 -1
- package/esm/funcs/cartsUpdateCart.js.map +1 -1
- package/esm/funcs/catalogGetProductDetail.d.ts +3 -2
- package/esm/funcs/catalogGetProductDetail.d.ts.map +1 -1
- package/esm/funcs/catalogGetProductDetail.js +2 -2
- package/esm/funcs/catalogGetProductDetail.js.map +1 -1
- package/esm/funcs/catalogGetVariantDetail.d.ts +3 -2
- package/esm/funcs/catalogGetVariantDetail.d.ts.map +1 -1
- package/esm/funcs/catalogGetVariantDetail.js +2 -2
- package/esm/funcs/catalogGetVariantDetail.js.map +1 -1
- package/esm/funcs/catalogListCategories.d.ts +3 -2
- package/esm/funcs/catalogListCategories.d.ts.map +1 -1
- package/esm/funcs/catalogListCategories.js +1 -1
- package/esm/funcs/catalogListCategories.js.map +1 -1
- package/esm/funcs/catalogListCrosssellProducts.d.ts +3 -2
- package/esm/funcs/catalogListCrosssellProducts.d.ts.map +1 -1
- package/esm/funcs/catalogListCrosssellProducts.js +2 -2
- package/esm/funcs/catalogListCrosssellProducts.js.map +1 -1
- package/esm/funcs/catalogListProductReviews.d.ts +3 -2
- package/esm/funcs/catalogListProductReviews.d.ts.map +1 -1
- package/esm/funcs/catalogListProductReviews.js +1 -1
- package/esm/funcs/catalogListProductReviews.js.map +1 -1
- package/esm/funcs/catalogListProductVariants.d.ts +3 -2
- package/esm/funcs/catalogListProductVariants.d.ts.map +1 -1
- package/esm/funcs/catalogListProductVariants.js +2 -2
- package/esm/funcs/catalogListProductVariants.js.map +1 -1
- package/esm/funcs/catalogListProducts.d.ts +3 -2
- package/esm/funcs/catalogListProducts.d.ts.map +1 -1
- package/esm/funcs/catalogListProducts.js +2 -2
- package/esm/funcs/catalogListProducts.js.map +1 -1
- package/esm/funcs/catalogListSimilarProducts.d.ts +3 -2
- package/esm/funcs/catalogListSimilarProducts.d.ts.map +1 -1
- package/esm/funcs/catalogListSimilarProducts.js +2 -2
- package/esm/funcs/catalogListSimilarProducts.js.map +1 -1
- package/esm/funcs/catalogListSkus.d.ts +3 -2
- package/esm/funcs/catalogListSkus.d.ts.map +1 -1
- package/esm/funcs/catalogListSkus.js +2 -2
- package/esm/funcs/catalogListSkus.js.map +1 -1
- package/esm/funcs/catalogListUpsellProducts.d.ts +3 -2
- package/esm/funcs/catalogListUpsellProducts.d.ts.map +1 -1
- package/esm/funcs/catalogListUpsellProducts.js +2 -2
- package/esm/funcs/catalogListUpsellProducts.js.map +1 -1
- package/esm/funcs/catalogSearchProducts.d.ts +3 -3
- package/esm/funcs/catalogSearchProducts.d.ts.map +1 -1
- package/esm/funcs/catalogSearchProducts.js +5 -5
- package/esm/funcs/catalogSearchProducts.js.map +1 -1
- package/esm/funcs/commonListCountryPincodes.d.ts +3 -2
- package/esm/funcs/commonListCountryPincodes.d.ts.map +1 -1
- package/esm/funcs/commonListCountryPincodes.js +1 -1
- package/esm/funcs/commonListCountryPincodes.js.map +1 -1
- package/esm/funcs/customersCreateAddress.d.ts +3 -2
- package/esm/funcs/customersCreateAddress.d.ts.map +1 -1
- package/esm/funcs/customersCreateAddress.js +1 -1
- package/esm/funcs/customersCreateAddress.js.map +1 -1
- package/esm/funcs/customersDeleteAddress.d.ts +3 -2
- package/esm/funcs/customersDeleteAddress.d.ts.map +1 -1
- package/esm/funcs/customersDeleteAddress.js +1 -1
- package/esm/funcs/customersDeleteAddress.js.map +1 -1
- package/esm/funcs/customersGetAddressDetail.d.ts +3 -2
- package/esm/funcs/customersGetAddressDetail.d.ts.map +1 -1
- package/esm/funcs/customersGetAddressDetail.js +1 -1
- package/esm/funcs/customersGetAddressDetail.js.map +1 -1
- package/esm/funcs/customersGetLoyaltyDetails.d.ts +3 -2
- package/esm/funcs/customersGetLoyaltyDetails.d.ts.map +1 -1
- package/esm/funcs/customersGetLoyaltyDetails.js +1 -1
- package/esm/funcs/customersGetLoyaltyDetails.js.map +1 -1
- package/esm/funcs/customersListAddresses.d.ts +3 -2
- package/esm/funcs/customersListAddresses.d.ts.map +1 -1
- package/esm/funcs/customersListAddresses.js +1 -1
- package/esm/funcs/customersListAddresses.js.map +1 -1
- package/esm/funcs/customersListUserReviews.d.ts +3 -2
- package/esm/funcs/customersListUserReviews.d.ts.map +1 -1
- package/esm/funcs/customersListUserReviews.js +1 -1
- package/esm/funcs/customersListUserReviews.js.map +1 -1
- package/esm/funcs/customersUpdateAddressDetail.d.ts +3 -2
- package/esm/funcs/customersUpdateAddressDetail.d.ts.map +1 -1
- package/esm/funcs/customersUpdateAddressDetail.js +1 -1
- package/esm/funcs/customersUpdateAddressDetail.js.map +1 -1
- package/esm/funcs/ordersCancelOrder.d.ts +3 -2
- package/esm/funcs/ordersCancelOrder.d.ts.map +1 -1
- package/esm/funcs/ordersCancelOrder.js +1 -1
- package/esm/funcs/ordersCancelOrder.js.map +1 -1
- package/esm/funcs/ordersCreateOrder.d.ts +3 -2
- package/esm/funcs/ordersCreateOrder.d.ts.map +1 -1
- package/esm/funcs/ordersCreateOrder.js +1 -1
- package/esm/funcs/ordersCreateOrder.js.map +1 -1
- package/esm/funcs/ordersGetOrderDetail.d.ts +3 -2
- package/esm/funcs/ordersGetOrderDetail.d.ts.map +1 -1
- package/esm/funcs/ordersGetOrderDetail.js +1 -1
- package/esm/funcs/ordersGetOrderDetail.js.map +1 -1
- package/esm/funcs/ordersGetPaymentStatus.d.ts +3 -2
- package/esm/funcs/ordersGetPaymentStatus.d.ts.map +1 -1
- package/esm/funcs/ordersGetPaymentStatus.js +1 -1
- package/esm/funcs/ordersGetPaymentStatus.js.map +1 -1
- package/esm/funcs/ordersListOrderShipments.d.ts +3 -2
- package/esm/funcs/ordersListOrderShipments.d.ts.map +1 -1
- package/esm/funcs/ordersListOrderShipments.js +1 -1
- package/esm/funcs/ordersListOrderShipments.js.map +1 -1
- package/esm/funcs/ordersListOrders.d.ts +3 -2
- package/esm/funcs/ordersListOrders.d.ts.map +1 -1
- package/esm/funcs/ordersListOrders.js +1 -1
- package/esm/funcs/ordersListOrders.js.map +1 -1
- package/esm/funcs/ordersRetryOrderPayment.d.ts +3 -2
- package/esm/funcs/ordersRetryOrderPayment.d.ts.map +1 -1
- package/esm/funcs/ordersRetryOrderPayment.js +1 -1
- package/esm/funcs/ordersRetryOrderPayment.js.map +1 -1
- package/esm/funcs/shippingShippingMethods.d.ts +3 -2
- package/esm/funcs/shippingShippingMethods.d.ts.map +1 -1
- package/esm/funcs/shippingShippingMethods.js +1 -1
- package/esm/funcs/shippingShippingMethods.js.map +1 -1
- package/esm/lib/config.d.ts +3 -3
- package/esm/lib/config.js +3 -3
- package/esm/lib/files.d.ts +5 -0
- package/esm/lib/files.d.ts.map +1 -1
- package/esm/lib/files.js +40 -0
- package/esm/lib/files.js.map +1 -1
- package/esm/lib/matchers.d.ts +3 -10
- package/esm/lib/matchers.d.ts.map +1 -1
- package/esm/lib/matchers.js +33 -30
- package/esm/lib/matchers.js.map +1 -1
- package/esm/lib/security.d.ts +2 -2
- package/esm/lib/security.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.js +1 -1
- package/esm/models/components/customeraddress.js.map +1 -1
- package/esm/models/components/customeraddressinput.js +1 -1
- package/esm/models/components/customeraddressinput.js.map +1 -1
- package/esm/models/components/discountbasedpromotion.js +1 -1
- package/esm/models/components/discountbasedpromotion.js.map +1 -1
- package/esm/models/components/fixedpricepromotion.js +1 -1
- package/esm/models/components/fixedpricepromotion.js.map +1 -1
- package/esm/models/components/freegoodspromotion.js +1 -1
- package/esm/models/components/freegoodspromotion.js.map +1 -1
- package/esm/models/components/generateotpwithemail.js +1 -1
- package/esm/models/components/generateotpwithemail.js.map +1 -1
- package/esm/models/components/juspaypaymentinfo.d.ts.map +1 -1
- package/esm/models/components/juspaypaymentinfo.js +3 -2
- package/esm/models/components/juspaypaymentinfo.js.map +1 -1
- package/esm/models/components/orderpayment.d.ts +2 -2
- package/esm/models/components/orderpayment.d.ts.map +1 -1
- package/esm/models/components/orderpayment.js +2 -2
- package/esm/models/components/orderpayment.js.map +1 -1
- package/esm/models/components/payupaymentinfo.js +3 -3
- package/esm/models/components/payupaymentinfo.js.map +1 -1
- package/esm/models/components/product.d.ts +3 -0
- package/esm/models/components/product.d.ts.map +1 -1
- package/esm/models/components/product.js +3 -0
- package/esm/models/components/product.js.map +1 -1
- package/esm/models/components/productdetail.d.ts +3 -0
- package/esm/models/components/productdetail.d.ts.map +1 -1
- package/esm/models/components/productdetail.js +3 -0
- package/esm/models/components/productdetail.js.map +1 -1
- package/esm/models/components/productpromotion.d.ts +20 -20
- package/esm/models/components/productpromotion.d.ts.map +1 -1
- package/esm/models/components/productpromotion.js +16 -16
- package/esm/models/components/productpromotion.js.map +1 -1
- package/esm/models/components/searchproduct.d.ts +0 -5
- package/esm/models/components/searchproduct.d.ts.map +1 -1
- package/esm/models/components/searchproduct.js +0 -11
- package/esm/models/components/searchproduct.js.map +1 -1
- package/esm/models/components/singleselectoption.js +1 -1
- package/esm/models/components/singleselectoption.js.map +1 -1
- package/esm/models/components/volumebasedpromotion.js +1 -1
- package/esm/models/components/volumebasedpromotion.js.map +1 -1
- package/esm/models/errors/badrequest.d.ts +7 -2
- package/esm/models/errors/badrequest.d.ts.map +1 -1
- package/esm/models/errors/badrequest.js +12 -4
- package/esm/models/errors/badrequest.js.map +1 -1
- package/esm/models/errors/ceerror.d.ts +8 -18
- package/esm/models/errors/ceerror.d.ts.map +1 -1
- package/esm/models/errors/ceerror.js +17 -10
- package/esm/models/errors/ceerror.js.map +1 -1
- package/esm/models/errors/cestorefronterror.d.ts +19 -0
- package/esm/models/errors/cestorefronterror.d.ts.map +1 -0
- package/esm/models/errors/cestorefronterror.js +16 -0
- package/esm/models/errors/cestorefronterror.js.map +1 -0
- package/esm/models/errors/index.d.ts +1 -0
- package/esm/models/errors/index.d.ts.map +1 -1
- package/esm/models/errors/index.js +1 -0
- package/esm/models/errors/index.js.map +1 -1
- package/esm/models/errors/notfound.d.ts +7 -2
- package/esm/models/errors/notfound.d.ts.map +1 -1
- package/esm/models/errors/notfound.js +12 -4
- package/esm/models/errors/notfound.js.map +1 -1
- package/esm/models/errors/responsevalidationerror.d.ts +26 -0
- package/esm/models/errors/responsevalidationerror.d.ts.map +1 -0
- package/esm/models/errors/responsevalidationerror.js +29 -0
- package/esm/models/errors/responsevalidationerror.js.map +1 -0
- package/esm/models/errors/sdkvalidationerror.d.ts +1 -0
- package/esm/models/errors/sdkvalidationerror.d.ts.map +1 -1
- package/esm/models/errors/sdkvalidationerror.js +14 -0
- package/esm/models/errors/sdkvalidationerror.js.map +1 -1
- package/esm/models/errors/unauthorized.d.ts +7 -2
- package/esm/models/errors/unauthorized.d.ts.map +1 -1
- package/esm/models/errors/unauthorized.js +12 -4
- package/esm/models/errors/unauthorized.js.map +1 -1
- package/esm/models/operations/createaddress.js +1 -1
- package/esm/models/operations/createaddress.js.map +1 -1
- package/esm/models/operations/createorder.d.ts +16 -16
- package/esm/models/operations/createorder.d.ts.map +1 -1
- package/esm/models/operations/createorder.js +12 -12
- package/esm/models/operations/createorder.js.map +1 -1
- package/esm/models/operations/generateotp.d.ts +2 -2
- package/esm/models/operations/generateotp.js +2 -2
- package/esm/models/operations/getaddressdetail.js +1 -1
- package/esm/models/operations/getaddressdetail.js.map +1 -1
- package/esm/models/operations/getproductdetail.d.ts +3 -3
- package/esm/models/operations/getproductdetail.d.ts.map +1 -1
- package/esm/models/operations/getproductdetail.js +4 -4
- package/esm/models/operations/getproductdetail.js.map +1 -1
- package/esm/models/operations/getvariantdetail.d.ts +3 -3
- package/esm/models/operations/getvariantdetail.d.ts.map +1 -1
- package/esm/models/operations/getvariantdetail.js +4 -4
- package/esm/models/operations/getvariantdetail.js.map +1 -1
- package/esm/models/operations/listaddresses.js +1 -1
- package/esm/models/operations/listaddresses.js.map +1 -1
- package/esm/models/operations/listcrosssellproducts.d.ts +3 -3
- package/esm/models/operations/listcrosssellproducts.d.ts.map +1 -1
- package/esm/models/operations/listcrosssellproducts.js +4 -4
- package/esm/models/operations/listcrosssellproducts.js.map +1 -1
- package/esm/models/operations/listproducts.d.ts +3 -3
- package/esm/models/operations/listproducts.d.ts.map +1 -1
- package/esm/models/operations/listproducts.js +4 -4
- package/esm/models/operations/listproducts.js.map +1 -1
- package/esm/models/operations/listproductvariants.d.ts +3 -3
- package/esm/models/operations/listproductvariants.d.ts.map +1 -1
- package/esm/models/operations/listproductvariants.js +4 -4
- package/esm/models/operations/listproductvariants.js.map +1 -1
- package/esm/models/operations/listsimilarproducts.d.ts +3 -3
- package/esm/models/operations/listsimilarproducts.d.ts.map +1 -1
- package/esm/models/operations/listsimilarproducts.js +4 -4
- package/esm/models/operations/listsimilarproducts.js.map +1 -1
- package/esm/models/operations/listskus.d.ts +3 -3
- package/esm/models/operations/listskus.d.ts.map +1 -1
- package/esm/models/operations/listskus.js +4 -4
- package/esm/models/operations/listskus.js.map +1 -1
- package/esm/models/operations/listupsellproducts.d.ts +3 -3
- package/esm/models/operations/listupsellproducts.d.ts.map +1 -1
- package/esm/models/operations/listupsellproducts.js +4 -4
- package/esm/models/operations/listupsellproducts.js.map +1 -1
- package/esm/models/operations/loginwithwhatsapp.js +1 -1
- package/esm/models/operations/loginwithwhatsapp.js.map +1 -1
- package/esm/models/operations/retryorderpayment.d.ts +16 -16
- package/esm/models/operations/retryorderpayment.d.ts.map +1 -1
- package/esm/models/operations/retryorderpayment.js +12 -12
- package/esm/models/operations/retryorderpayment.js.map +1 -1
- package/esm/models/operations/searchproducts.d.ts +30 -0
- package/esm/models/operations/searchproducts.d.ts.map +1 -1
- package/esm/models/operations/searchproducts.js +37 -0
- package/esm/models/operations/searchproducts.js.map +1 -1
- package/esm/models/operations/updateaddressdetail.js +1 -1
- package/esm/models/operations/updateaddressdetail.js.map +1 -1
- package/esm/sdk/catalog.d.ts +1 -2
- package/esm/sdk/catalog.d.ts.map +1 -1
- package/esm/sdk/catalog.js.map +1 -1
- package/esm/types/constdatetime.js +1 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/funcs/authGenerateOtp.ts +21 -17
- package/src/funcs/authGetAnonymousToken.ts +21 -17
- package/src/funcs/authGetUserDetail.ts +21 -17
- package/src/funcs/authLoginWithEmail.ts +21 -17
- package/src/funcs/authLoginWithPhone.ts +21 -17
- package/src/funcs/authLoginWithWhatsapp.ts +21 -17
- package/src/funcs/authLogout.ts +21 -17
- package/src/funcs/authRefreshToken.ts +21 -17
- package/src/funcs/authUpdateUser.ts +21 -17
- package/src/funcs/authVerifyOtp.ts +21 -17
- package/src/funcs/cartsAddShippingMethod.ts +21 -17
- package/src/funcs/cartsApplyCoupon.ts +21 -17
- package/src/funcs/cartsCreateCart.ts +21 -17
- package/src/funcs/cartsCreateCartAddress.ts +21 -17
- package/src/funcs/cartsDeleteCart.ts +21 -17
- package/src/funcs/cartsGetCart.ts +21 -17
- package/src/funcs/cartsGetUserCart.ts +21 -17
- package/src/funcs/cartsRedeemLoyaltyPoints.ts +21 -17
- package/src/funcs/cartsRemoveCoupon.ts +21 -17
- package/src/funcs/cartsRemoveLoyaltyPoints.ts +21 -17
- package/src/funcs/cartsRemoveUserCart.ts +21 -17
- package/src/funcs/cartsUpdateCart.ts +21 -17
- package/src/funcs/catalogGetProductDetail.ts +24 -20
- package/src/funcs/catalogGetVariantDetail.ts +24 -20
- package/src/funcs/catalogListCategories.ts +21 -17
- package/src/funcs/catalogListCrosssellProducts.ts +24 -20
- package/src/funcs/catalogListProductReviews.ts +21 -17
- package/src/funcs/catalogListProductVariants.ts +24 -20
- package/src/funcs/catalogListProducts.ts +24 -20
- package/src/funcs/catalogListSimilarProducts.ts +24 -20
- package/src/funcs/catalogListSkus.ts +24 -20
- package/src/funcs/catalogListUpsellProducts.ts +24 -20
- package/src/funcs/catalogSearchProducts.ts +31 -23
- package/src/funcs/commonListCountryPincodes.ts +21 -17
- package/src/funcs/customersCreateAddress.ts +21 -17
- package/src/funcs/customersDeleteAddress.ts +21 -17
- package/src/funcs/customersGetAddressDetail.ts +21 -17
- package/src/funcs/customersGetLoyaltyDetails.ts +21 -17
- package/src/funcs/customersListAddresses.ts +21 -17
- package/src/funcs/customersListUserReviews.ts +21 -17
- package/src/funcs/customersUpdateAddressDetail.ts +21 -17
- package/src/funcs/ordersCancelOrder.ts +21 -17
- package/src/funcs/ordersCreateOrder.ts +21 -17
- package/src/funcs/ordersGetOrderDetail.ts +21 -17
- package/src/funcs/ordersGetPaymentStatus.ts +21 -17
- package/src/funcs/ordersListOrderShipments.ts +21 -17
- package/src/funcs/ordersListOrders.ts +21 -17
- package/src/funcs/ordersRetryOrderPayment.ts +21 -17
- package/src/funcs/shippingShippingMethods.ts +21 -17
- package/src/lib/config.ts +3 -3
- package/src/lib/files.ts +42 -0
- package/src/lib/matchers.ts +44 -41
- package/src/lib/security.ts +2 -2
- package/src/models/components/coloroption.ts +1 -1
- package/src/models/components/customeraddress.ts +1 -1
- package/src/models/components/customeraddressinput.ts +1 -1
- package/src/models/components/discountbasedpromotion.ts +1 -1
- package/src/models/components/fixedpricepromotion.ts +1 -1
- package/src/models/components/freegoodspromotion.ts +1 -1
- package/src/models/components/generateotpwithemail.ts +1 -1
- package/src/models/components/juspaypaymentinfo.ts +3 -2
- package/src/models/components/orderpayment.ts +4 -4
- package/src/models/components/payupaymentinfo.ts +3 -3
- package/src/models/components/product.ts +10 -0
- package/src/models/components/productdetail.ts +10 -0
- package/src/models/components/productpromotion.ts +48 -48
- package/src/models/components/searchproduct.ts +0 -16
- package/src/models/components/singleselectoption.ts +1 -1
- package/src/models/components/volumebasedpromotion.ts +1 -1
- package/src/models/errors/badrequest.ts +15 -5
- package/src/models/errors/ceerror.ts +23 -31
- package/src/models/errors/cestorefronterror.ts +35 -0
- package/src/models/errors/index.ts +1 -0
- package/src/models/errors/notfound.ts +15 -5
- package/src/models/errors/responsevalidationerror.ts +50 -0
- package/src/models/errors/sdkvalidationerror.ts +12 -0
- package/src/models/errors/unauthorized.ts +15 -5
- package/src/models/operations/createaddress.ts +1 -1
- package/src/models/operations/createorder.ts +37 -35
- package/src/models/operations/generateotp.ts +6 -6
- package/src/models/operations/getaddressdetail.ts +1 -1
- package/src/models/operations/getproductdetail.ts +7 -7
- package/src/models/operations/getvariantdetail.ts +7 -7
- package/src/models/operations/listaddresses.ts +1 -1
- package/src/models/operations/listcrosssellproducts.ts +7 -7
- package/src/models/operations/listproducts.ts +7 -7
- package/src/models/operations/listproductvariants.ts +7 -7
- package/src/models/operations/listsimilarproducts.ts +7 -7
- package/src/models/operations/listskus.ts +7 -7
- package/src/models/operations/listupsellproducts.ts +7 -7
- package/src/models/operations/loginwithwhatsapp.ts +1 -1
- package/src/models/operations/retryorderpayment.ts +37 -35
- package/src/models/operations/searchproducts.ts +75 -0
- package/src/models/operations/updateaddressdetail.ts +1 -1
- package/src/sdk/catalog.ts +1 -2
- package/src/types/constdatetime.ts +1 -1
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.14.1",
|
|
84
|
+
genVersion: "2.632.2",
|
|
85
|
+
userAgent: "speakeasy-sdk/typescript 0.14.1 2.632.2 1.0 ce-storefront",
|
|
86
86
|
} as const;
|
package/src/lib/files.ts
CHANGED
|
@@ -38,3 +38,45 @@ export async function readableStreamToArrayBuffer(
|
|
|
38
38
|
|
|
39
39
|
return concatenatedChunks.buffer as ArrayBuffer;
|
|
40
40
|
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Determines the MIME content type based on a file's extension.
|
|
44
|
+
* Returns null if the extension is not recognized.
|
|
45
|
+
*/
|
|
46
|
+
export function getContentTypeFromFileName(fileName: string): string | null {
|
|
47
|
+
if (!fileName) return null;
|
|
48
|
+
|
|
49
|
+
const ext = fileName.toLowerCase().split(".").pop();
|
|
50
|
+
if (!ext) return null;
|
|
51
|
+
|
|
52
|
+
const mimeTypes: Record<string, string> = {
|
|
53
|
+
json: "application/json",
|
|
54
|
+
xml: "application/xml",
|
|
55
|
+
html: "text/html",
|
|
56
|
+
htm: "text/html",
|
|
57
|
+
txt: "text/plain",
|
|
58
|
+
csv: "text/csv",
|
|
59
|
+
pdf: "application/pdf",
|
|
60
|
+
png: "image/png",
|
|
61
|
+
jpg: "image/jpeg",
|
|
62
|
+
jpeg: "image/jpeg",
|
|
63
|
+
gif: "image/gif",
|
|
64
|
+
svg: "image/svg+xml",
|
|
65
|
+
js: "application/javascript",
|
|
66
|
+
css: "text/css",
|
|
67
|
+
zip: "application/zip",
|
|
68
|
+
tar: "application/x-tar",
|
|
69
|
+
gz: "application/gzip",
|
|
70
|
+
mp4: "video/mp4",
|
|
71
|
+
mp3: "audio/mpeg",
|
|
72
|
+
wav: "audio/wav",
|
|
73
|
+
webp: "image/webp",
|
|
74
|
+
ico: "image/x-icon",
|
|
75
|
+
woff: "font/woff",
|
|
76
|
+
woff2: "font/woff2",
|
|
77
|
+
ttf: "font/ttf",
|
|
78
|
+
otf: "font/otf",
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
return mimeTypes[ext] || null;
|
|
82
|
+
}
|
package/src/lib/matchers.ts
CHANGED
|
@@ -3,11 +3,10 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import { CeError } from "../models/errors/ceerror.js";
|
|
6
|
-
import {
|
|
7
|
-
import { Result } from "../types/fp.js";
|
|
6
|
+
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
7
|
+
import { ERR, OK, Result } from "../types/fp.js";
|
|
8
8
|
import { matchResponse, matchStatusCode, StatusCodePredicate } from "./http.js";
|
|
9
9
|
import { isPlainObject } from "./is-plain-object.js";
|
|
10
|
-
import { safeParse } from "./schemas.js";
|
|
11
10
|
|
|
12
11
|
export type Encoding =
|
|
13
12
|
| "jsonl"
|
|
@@ -176,17 +175,19 @@ export type MatchedError<Matchers> = Matchers extends Matcher<any, infer E>[]
|
|
|
176
175
|
: never;
|
|
177
176
|
export type MatchFunc<T, E> = (
|
|
178
177
|
response: Response,
|
|
178
|
+
request: Request,
|
|
179
179
|
options?: { resultKey?: string; extraFields?: Record<string, unknown> },
|
|
180
180
|
) => Promise<[result: Result<T, E>, raw: unknown]>;
|
|
181
181
|
|
|
182
182
|
export function match<T, E>(
|
|
183
183
|
...matchers: Array<Matcher<T, E>>
|
|
184
|
-
): MatchFunc<T, E | CeError |
|
|
184
|
+
): MatchFunc<T, E | CeError | ResponseValidationError> {
|
|
185
185
|
return async function matchFunc(
|
|
186
186
|
response: Response,
|
|
187
|
+
request: Request,
|
|
187
188
|
options?: { resultKey?: string; extraFields?: Record<string, unknown> },
|
|
188
189
|
): Promise<
|
|
189
|
-
[result: Result<T, E | CeError |
|
|
190
|
+
[result: Result<T, E | CeError | ResponseValidationError>, raw: unknown]
|
|
190
191
|
> {
|
|
191
192
|
let raw: unknown;
|
|
192
193
|
let matcher: Matcher<T, E> | undefined;
|
|
@@ -205,21 +206,22 @@ export function match<T, E>(
|
|
|
205
206
|
}
|
|
206
207
|
|
|
207
208
|
if (!matcher) {
|
|
208
|
-
const responseBody = await response.text();
|
|
209
209
|
return [{
|
|
210
210
|
ok: false,
|
|
211
|
-
error: new CeError(
|
|
212
|
-
"Unexpected API response status or content-type",
|
|
211
|
+
error: new CeError("Unexpected Status or Content-Type", {
|
|
213
212
|
response,
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
213
|
+
request,
|
|
214
|
+
body: await response.text().catch(() => ""),
|
|
215
|
+
}),
|
|
216
|
+
}, raw];
|
|
217
217
|
}
|
|
218
218
|
|
|
219
219
|
const encoding = matcher.enc;
|
|
220
|
+
let body = "";
|
|
220
221
|
switch (encoding) {
|
|
221
222
|
case "json":
|
|
222
|
-
|
|
223
|
+
body = await response.text();
|
|
224
|
+
raw = JSON.parse(body);
|
|
223
225
|
break;
|
|
224
226
|
case "jsonl":
|
|
225
227
|
raw = response.body;
|
|
@@ -231,16 +233,19 @@ export function match<T, E>(
|
|
|
231
233
|
raw = response.body;
|
|
232
234
|
break;
|
|
233
235
|
case "text":
|
|
234
|
-
|
|
236
|
+
body = await response.text();
|
|
237
|
+
raw = body;
|
|
235
238
|
break;
|
|
236
239
|
case "sse":
|
|
237
240
|
raw = response.body;
|
|
238
241
|
break;
|
|
239
242
|
case "nil":
|
|
240
|
-
|
|
243
|
+
body = await response.text();
|
|
244
|
+
raw = undefined;
|
|
241
245
|
break;
|
|
242
246
|
case "fail":
|
|
243
|
-
|
|
247
|
+
body = await response.text();
|
|
248
|
+
raw = body;
|
|
244
249
|
break;
|
|
245
250
|
default:
|
|
246
251
|
encoding satisfies never;
|
|
@@ -250,11 +255,7 @@ export function match<T, E>(
|
|
|
250
255
|
if (matcher.enc === "fail") {
|
|
251
256
|
return [{
|
|
252
257
|
ok: false,
|
|
253
|
-
error: new CeError(
|
|
254
|
-
"API error occurred",
|
|
255
|
-
response,
|
|
256
|
-
typeof raw === "string" ? raw : "",
|
|
257
|
-
),
|
|
258
|
+
error: new CeError("API error occurred", { request, response, body }),
|
|
258
259
|
}, raw];
|
|
259
260
|
}
|
|
260
261
|
|
|
@@ -266,6 +267,9 @@ export function match<T, E>(
|
|
|
266
267
|
...options?.extraFields,
|
|
267
268
|
...(matcher.hdrs ? { Headers: unpackHeaders(response.headers) } : null),
|
|
268
269
|
...(isPlainObject(raw) ? raw : null),
|
|
270
|
+
request$: request,
|
|
271
|
+
response$: response,
|
|
272
|
+
body$: body,
|
|
269
273
|
};
|
|
270
274
|
} else if (resultKey) {
|
|
271
275
|
data = {
|
|
@@ -284,18 +288,20 @@ export function match<T, E>(
|
|
|
284
288
|
}
|
|
285
289
|
|
|
286
290
|
if ("err" in matcher) {
|
|
287
|
-
const result =
|
|
291
|
+
const result = safeParseResponse(
|
|
288
292
|
data,
|
|
289
293
|
(v: unknown) => matcher.schema.parse(v),
|
|
290
294
|
"Response validation failed",
|
|
295
|
+
{ request, response, body },
|
|
291
296
|
);
|
|
292
297
|
return [result.ok ? { ok: false, error: result.value } : result, raw];
|
|
293
298
|
} else {
|
|
294
299
|
return [
|
|
295
|
-
|
|
300
|
+
safeParseResponse(
|
|
296
301
|
data,
|
|
297
302
|
(v: unknown) => matcher.schema.parse(v),
|
|
298
303
|
"Response validation failed",
|
|
304
|
+
{ request, response, body },
|
|
299
305
|
),
|
|
300
306
|
raw,
|
|
301
307
|
];
|
|
@@ -318,25 +324,22 @@ export function unpackHeaders(headers: Headers): Record<string, string[]> {
|
|
|
318
324
|
return out;
|
|
319
325
|
}
|
|
320
326
|
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
export async function discardResponseBody(res: Response) {
|
|
328
|
-
const reader = res.body?.getReader();
|
|
329
|
-
if (reader == null) {
|
|
330
|
-
return;
|
|
331
|
-
}
|
|
332
|
-
|
|
327
|
+
function safeParseResponse<Inp, Out>(
|
|
328
|
+
rawValue: Inp,
|
|
329
|
+
fn: (value: Inp) => Out,
|
|
330
|
+
errorMessage: string,
|
|
331
|
+
httpMeta: { response: Response; request: Request; body: string },
|
|
332
|
+
): Result<Out, ResponseValidationError> {
|
|
333
333
|
try {
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
334
|
+
return OK(fn(rawValue));
|
|
335
|
+
} catch (err) {
|
|
336
|
+
return ERR(
|
|
337
|
+
new ResponseValidationError(errorMessage, {
|
|
338
|
+
cause: err,
|
|
339
|
+
rawValue,
|
|
340
|
+
rawMessage: errorMessage,
|
|
341
|
+
...httpMeta,
|
|
342
|
+
}),
|
|
343
|
+
);
|
|
341
344
|
}
|
|
342
345
|
}
|
package/src/lib/security.ts
CHANGED
|
@@ -6,8 +6,8 @@ import * as components from "../models/components/index.js";
|
|
|
6
6
|
|
|
7
7
|
type OAuth2PasswordFlow = {
|
|
8
8
|
username: string;
|
|
9
|
-
password
|
|
10
|
-
clientID
|
|
9
|
+
password: string;
|
|
10
|
+
clientID?: string | undefined;
|
|
11
11
|
clientSecret?: string | undefined;
|
|
12
12
|
tokenURL: string;
|
|
13
13
|
};
|
|
@@ -94,7 +94,7 @@ export const ColorOption$inboundSchema: z.ZodType<
|
|
|
94
94
|
unknown
|
|
95
95
|
> = z.object({
|
|
96
96
|
name: z.string(),
|
|
97
|
-
type: z.literal("color").optional(),
|
|
97
|
+
type: z.literal("color").default("color").optional(),
|
|
98
98
|
value: z.lazy(() => ColorOptionValue$inboundSchema),
|
|
99
99
|
});
|
|
100
100
|
|
|
@@ -63,7 +63,7 @@ export const CustomerAddress$inboundSchema: z.ZodType<
|
|
|
63
63
|
pincode: z.string(),
|
|
64
64
|
city: z.string(),
|
|
65
65
|
state: z.string(),
|
|
66
|
-
country: z.literal("India").optional(),
|
|
66
|
+
country: z.literal("India").default("India").optional(),
|
|
67
67
|
tax_identification_number: z.nullable(z.string()),
|
|
68
68
|
business_name: z.nullable(z.string()),
|
|
69
69
|
is_phone_verified: z.boolean(),
|
|
@@ -61,7 +61,7 @@ export const CustomerAddressInput$inboundSchema: z.ZodType<
|
|
|
61
61
|
pincode: z.string(),
|
|
62
62
|
city: z.string(),
|
|
63
63
|
state: z.string(),
|
|
64
|
-
country: z.literal("India").optional(),
|
|
64
|
+
country: z.literal("India").default("India").optional(),
|
|
65
65
|
tax_identification_number: z.nullable(z.string()),
|
|
66
66
|
business_name: z.nullable(z.string()),
|
|
67
67
|
}).transform((v) => {
|
|
@@ -82,7 +82,7 @@ export const DiscountBasedPromotion$inboundSchema: z.ZodType<
|
|
|
82
82
|
z.ZodTypeDef,
|
|
83
83
|
unknown
|
|
84
84
|
> = z.object({
|
|
85
|
-
promotion_type: z.literal("discount").optional(),
|
|
85
|
+
promotion_type: z.literal("discount").default("discount").optional(),
|
|
86
86
|
discount_type: DiscountType$inboundSchema,
|
|
87
87
|
discount_percent: z.number().optional(),
|
|
88
88
|
discount_fixed_amount: z.number().int().optional(),
|
|
@@ -51,7 +51,7 @@ export const FixedPricePromotion$inboundSchema: z.ZodType<
|
|
|
51
51
|
z.ZodTypeDef,
|
|
52
52
|
unknown
|
|
53
53
|
> = z.object({
|
|
54
|
-
promotion_type: z.literal("fixed-price").optional(),
|
|
54
|
+
promotion_type: z.literal("fixed-price").default("fixed-price").optional(),
|
|
55
55
|
offer_price: z.number(),
|
|
56
56
|
}).transform((v) => {
|
|
57
57
|
return remap$(v, {
|
|
@@ -58,7 +58,7 @@ export const FreeGoodsPromotion$inboundSchema: z.ZodType<
|
|
|
58
58
|
z.ZodTypeDef,
|
|
59
59
|
unknown
|
|
60
60
|
> = z.object({
|
|
61
|
-
promotion_type: z.literal("free-goods").optional(),
|
|
61
|
+
promotion_type: z.literal("free-goods").default("free-goods").optional(),
|
|
62
62
|
buy_quantity: z.number().int(),
|
|
63
63
|
get_quantity: z.number().int(),
|
|
64
64
|
}).transform((v) => {
|
|
@@ -52,7 +52,7 @@ export const GenerateOtpWithEmail$inboundSchema: z.ZodType<
|
|
|
52
52
|
z.ZodTypeDef,
|
|
53
53
|
unknown
|
|
54
54
|
> = z.object({
|
|
55
|
-
channel: z.literal("email").optional(),
|
|
55
|
+
channel: z.literal("email").default("email").optional(),
|
|
56
56
|
email: z.string(),
|
|
57
57
|
otp_action: GenerateOtpWithEmailOtpAction$inboundSchema,
|
|
58
58
|
}).transform((v) => {
|
|
@@ -203,11 +203,12 @@ export const Payload$inboundSchema: z.ZodType<Payload, z.ZodTypeDef, unknown> =
|
|
|
203
203
|
customerEmail: z.string().optional(),
|
|
204
204
|
currency: z.string().optional(),
|
|
205
205
|
description: z.string().optional(),
|
|
206
|
-
"options.createMandate": z.literal("REQUIRED").
|
|
206
|
+
"options.createMandate": z.literal("REQUIRED").default("REQUIRED")
|
|
207
|
+
.optional(),
|
|
207
208
|
"mandate.maxAmount": z.string().optional(),
|
|
208
209
|
"mandate.start_date ": z.string().optional(),
|
|
209
210
|
"mandate.end_date ": z.string().optional(),
|
|
210
|
-
"mandate.frequency": z.literal("MONTHLY").optional(),
|
|
211
|
+
"mandate.frequency": z.literal("MONTHLY").default("MONTHLY").optional(),
|
|
211
212
|
"mandate.rule_value ": MandateRuleValue$inboundSchema.optional(),
|
|
212
213
|
}).transform((v) => {
|
|
213
214
|
return remap$(v, {
|
|
@@ -41,10 +41,10 @@ import {
|
|
|
41
41
|
* Order Payment
|
|
42
42
|
*/
|
|
43
43
|
export type OrderPayment =
|
|
44
|
+
| CardPayment
|
|
44
45
|
| NetbankingPayment
|
|
45
46
|
| UpiPayment
|
|
46
47
|
| WalletPayment
|
|
47
|
-
| CardPayment
|
|
48
48
|
| BankTransfer;
|
|
49
49
|
|
|
50
50
|
/** @internal */
|
|
@@ -53,19 +53,19 @@ export const OrderPayment$inboundSchema: z.ZodType<
|
|
|
53
53
|
z.ZodTypeDef,
|
|
54
54
|
unknown
|
|
55
55
|
> = z.union([
|
|
56
|
+
CardPayment$inboundSchema,
|
|
56
57
|
NetbankingPayment$inboundSchema,
|
|
57
58
|
UpiPayment$inboundSchema,
|
|
58
59
|
WalletPayment$inboundSchema,
|
|
59
|
-
CardPayment$inboundSchema,
|
|
60
60
|
BankTransfer$inboundSchema,
|
|
61
61
|
]);
|
|
62
62
|
|
|
63
63
|
/** @internal */
|
|
64
64
|
export type OrderPayment$Outbound =
|
|
65
|
+
| CardPayment$Outbound
|
|
65
66
|
| NetbankingPayment$Outbound
|
|
66
67
|
| UpiPayment$Outbound
|
|
67
68
|
| WalletPayment$Outbound
|
|
68
|
-
| CardPayment$Outbound
|
|
69
69
|
| BankTransfer$Outbound;
|
|
70
70
|
|
|
71
71
|
/** @internal */
|
|
@@ -74,10 +74,10 @@ export const OrderPayment$outboundSchema: z.ZodType<
|
|
|
74
74
|
z.ZodTypeDef,
|
|
75
75
|
OrderPayment
|
|
76
76
|
> = z.union([
|
|
77
|
+
CardPayment$outboundSchema,
|
|
77
78
|
NetbankingPayment$outboundSchema,
|
|
78
79
|
UpiPayment$outboundSchema,
|
|
79
80
|
WalletPayment$outboundSchema,
|
|
80
|
-
CardPayment$outboundSchema,
|
|
81
81
|
BankTransfer$outboundSchema,
|
|
82
82
|
]);
|
|
83
83
|
|
|
@@ -81,8 +81,8 @@ export const SiDetails$inboundSchema: z.ZodType<
|
|
|
81
81
|
unknown
|
|
82
82
|
> = z.object({
|
|
83
83
|
billingAmount: z.number().optional(),
|
|
84
|
-
billingCurrency: z.literal("INR").optional(),
|
|
85
|
-
billingCycle: z.literal("MONTHLY").optional(),
|
|
84
|
+
billingCurrency: z.literal("INR").default("INR").optional(),
|
|
85
|
+
billingCycle: z.literal("MONTHLY").default("MONTHLY").optional(),
|
|
86
86
|
billingInterval: z.number().int().optional(),
|
|
87
87
|
paymentStartDate: z.string().transform(v => new RFCDate(v)).optional(),
|
|
88
88
|
paymentEndDate: z.string().transform(v => new RFCDate(v)).optional(),
|
|
@@ -154,7 +154,7 @@ export const PayuPaymentInfo$inboundSchema: z.ZodType<
|
|
|
154
154
|
lastname: z.string().optional(),
|
|
155
155
|
email: z.string().optional(),
|
|
156
156
|
phone: z.string().optional(),
|
|
157
|
-
si: z.literal(1).optional(),
|
|
157
|
+
si: z.literal(1).default(1).optional(),
|
|
158
158
|
si_details: z.lazy(() => SiDetails$inboundSchema).optional(),
|
|
159
159
|
furl: z.string().optional(),
|
|
160
160
|
surl: z.string().optional(),
|
|
@@ -8,6 +8,12 @@ import { safeParse } from "../../lib/schemas.js";
|
|
|
8
8
|
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
|
+
import {
|
|
12
|
+
Category,
|
|
13
|
+
Category$inboundSchema,
|
|
14
|
+
Category$Outbound,
|
|
15
|
+
Category$outboundSchema,
|
|
16
|
+
} from "./category.js";
|
|
11
17
|
import {
|
|
12
18
|
ProductAttribute,
|
|
13
19
|
ProductAttribute$inboundSchema,
|
|
@@ -101,6 +107,7 @@ export type Product = {
|
|
|
101
107
|
hasVariant: boolean;
|
|
102
108
|
tags: Array<string> | null;
|
|
103
109
|
categoryIds: Array<string>;
|
|
110
|
+
categories: Array<Category>;
|
|
104
111
|
reviewsRatingSum: number;
|
|
105
112
|
reviewsCount: number;
|
|
106
113
|
attributes: Array<ProductAttribute>;
|
|
@@ -153,6 +160,7 @@ export const Product$inboundSchema: z.ZodType<Product, z.ZodTypeDef, unknown> =
|
|
|
153
160
|
has_variant: z.boolean(),
|
|
154
161
|
tags: z.nullable(z.array(z.string())),
|
|
155
162
|
category_ids: z.array(z.string()),
|
|
163
|
+
categories: z.array(Category$inboundSchema),
|
|
156
164
|
reviews_rating_sum: z.number(),
|
|
157
165
|
reviews_count: z.number().int(),
|
|
158
166
|
attributes: z.array(ProductAttribute$inboundSchema),
|
|
@@ -197,6 +205,7 @@ export type Product$Outbound = {
|
|
|
197
205
|
has_variant: boolean;
|
|
198
206
|
tags: Array<string> | null;
|
|
199
207
|
category_ids: Array<string>;
|
|
208
|
+
categories: Array<Category$Outbound>;
|
|
200
209
|
reviews_rating_sum: number;
|
|
201
210
|
reviews_count: number;
|
|
202
211
|
attributes: Array<ProductAttribute$Outbound>;
|
|
@@ -230,6 +239,7 @@ export const Product$outboundSchema: z.ZodType<
|
|
|
230
239
|
hasVariant: z.boolean(),
|
|
231
240
|
tags: z.nullable(z.array(z.string())),
|
|
232
241
|
categoryIds: z.array(z.string()),
|
|
242
|
+
categories: z.array(Category$outboundSchema),
|
|
233
243
|
reviewsRatingSum: z.number(),
|
|
234
244
|
reviewsCount: z.number().int(),
|
|
235
245
|
attributes: z.array(ProductAttribute$outboundSchema),
|
|
@@ -8,6 +8,12 @@ import { safeParse } from "../../lib/schemas.js";
|
|
|
8
8
|
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
|
+
import {
|
|
12
|
+
Category,
|
|
13
|
+
Category$inboundSchema,
|
|
14
|
+
Category$Outbound,
|
|
15
|
+
Category$outboundSchema,
|
|
16
|
+
} from "./category.js";
|
|
11
17
|
import {
|
|
12
18
|
ProductAttribute,
|
|
13
19
|
ProductAttribute$inboundSchema,
|
|
@@ -121,6 +127,7 @@ export type ProductDetail = {
|
|
|
121
127
|
hasVariant: boolean;
|
|
122
128
|
tags: Array<string> | null;
|
|
123
129
|
categoryIds: Array<string>;
|
|
130
|
+
categories: Array<Category>;
|
|
124
131
|
reviewsRatingSum: number;
|
|
125
132
|
reviewsCount: number;
|
|
126
133
|
attributes: Array<ProductAttribute>;
|
|
@@ -192,6 +199,7 @@ export const ProductDetail$inboundSchema: z.ZodType<
|
|
|
192
199
|
has_variant: z.boolean(),
|
|
193
200
|
tags: z.nullable(z.array(z.string())),
|
|
194
201
|
category_ids: z.array(z.string()),
|
|
202
|
+
categories: z.array(Category$inboundSchema),
|
|
195
203
|
reviews_rating_sum: z.number(),
|
|
196
204
|
reviews_count: z.number().int(),
|
|
197
205
|
attributes: z.array(ProductAttribute$inboundSchema),
|
|
@@ -247,6 +255,7 @@ export type ProductDetail$Outbound = {
|
|
|
247
255
|
has_variant: boolean;
|
|
248
256
|
tags: Array<string> | null;
|
|
249
257
|
category_ids: Array<string>;
|
|
258
|
+
categories: Array<Category$Outbound>;
|
|
250
259
|
reviews_rating_sum: number;
|
|
251
260
|
reviews_count: number;
|
|
252
261
|
attributes: Array<ProductAttribute$Outbound>;
|
|
@@ -288,6 +297,7 @@ export const ProductDetail$outboundSchema: z.ZodType<
|
|
|
288
297
|
hasVariant: z.boolean(),
|
|
289
298
|
tags: z.nullable(z.array(z.string())),
|
|
290
299
|
categoryIds: z.array(z.string()),
|
|
300
|
+
categories: z.array(Category$outboundSchema),
|
|
291
301
|
reviewsRatingSum: z.number(),
|
|
292
302
|
reviewsCount: z.number().int(),
|
|
293
303
|
attributes: z.array(ProductAttribute$outboundSchema),
|
|
@@ -33,35 +33,25 @@ import {
|
|
|
33
33
|
} from "./volumebasedpromotion.js";
|
|
34
34
|
|
|
35
35
|
export type Details =
|
|
36
|
-
| (FixedPricePromotion & { promotionType: "fixed-price" })
|
|
37
|
-
| (VolumeBasedPromotion & { promotionType: "volume-based" })
|
|
38
36
|
| (FreeGoodsPromotion & { promotionType: "free-goods" })
|
|
39
|
-
| (DiscountBasedPromotion & { promotionType: "discount" })
|
|
37
|
+
| (DiscountBasedPromotion & { promotionType: "discount" })
|
|
38
|
+
| (FixedPricePromotion & { promotionType: "fixed-price" })
|
|
39
|
+
| (VolumeBasedPromotion & { promotionType: "volume-based" });
|
|
40
40
|
|
|
41
41
|
export type ProductPromotion = {
|
|
42
42
|
id: string;
|
|
43
43
|
startsAt: Date;
|
|
44
44
|
expiresAt: Date | null;
|
|
45
45
|
details:
|
|
46
|
-
| (FixedPricePromotion & { promotionType: "fixed-price" })
|
|
47
|
-
| (VolumeBasedPromotion & { promotionType: "volume-based" })
|
|
48
46
|
| (FreeGoodsPromotion & { promotionType: "free-goods" })
|
|
49
|
-
| (DiscountBasedPromotion & { promotionType: "discount" })
|
|
47
|
+
| (DiscountBasedPromotion & { promotionType: "discount" })
|
|
48
|
+
| (FixedPricePromotion & { promotionType: "fixed-price" })
|
|
49
|
+
| (VolumeBasedPromotion & { promotionType: "volume-based" });
|
|
50
50
|
};
|
|
51
51
|
|
|
52
52
|
/** @internal */
|
|
53
53
|
export const Details$inboundSchema: z.ZodType<Details, z.ZodTypeDef, unknown> =
|
|
54
54
|
z.union([
|
|
55
|
-
FixedPricePromotion$inboundSchema.and(
|
|
56
|
-
z.object({ promotion_type: z.literal("fixed-price") }).transform((v) => ({
|
|
57
|
-
promotionType: v.promotion_type,
|
|
58
|
-
})),
|
|
59
|
-
),
|
|
60
|
-
VolumeBasedPromotion$inboundSchema.and(
|
|
61
|
-
z.object({ promotion_type: z.literal("volume-based") }).transform((
|
|
62
|
-
v,
|
|
63
|
-
) => ({ promotionType: v.promotion_type })),
|
|
64
|
-
),
|
|
65
55
|
FreeGoodsPromotion$inboundSchema.and(
|
|
66
56
|
z.object({ promotion_type: z.literal("free-goods") }).transform((v) => ({
|
|
67
57
|
promotionType: v.promotion_type,
|
|
@@ -72,14 +62,24 @@ export const Details$inboundSchema: z.ZodType<Details, z.ZodTypeDef, unknown> =
|
|
|
72
62
|
promotionType: v.promotion_type,
|
|
73
63
|
})),
|
|
74
64
|
),
|
|
65
|
+
FixedPricePromotion$inboundSchema.and(
|
|
66
|
+
z.object({ promotion_type: z.literal("fixed-price") }).transform((v) => ({
|
|
67
|
+
promotionType: v.promotion_type,
|
|
68
|
+
})),
|
|
69
|
+
),
|
|
70
|
+
VolumeBasedPromotion$inboundSchema.and(
|
|
71
|
+
z.object({ promotion_type: z.literal("volume-based") }).transform((
|
|
72
|
+
v,
|
|
73
|
+
) => ({ promotionType: v.promotion_type })),
|
|
74
|
+
),
|
|
75
75
|
]);
|
|
76
76
|
|
|
77
77
|
/** @internal */
|
|
78
78
|
export type Details$Outbound =
|
|
79
|
-
| (FixedPricePromotion$Outbound & { promotion_type: "fixed-price" })
|
|
80
|
-
| (VolumeBasedPromotion$Outbound & { promotion_type: "volume-based" })
|
|
81
79
|
| (FreeGoodsPromotion$Outbound & { promotion_type: "free-goods" })
|
|
82
|
-
| (DiscountBasedPromotion$Outbound & { promotion_type: "discount" })
|
|
80
|
+
| (DiscountBasedPromotion$Outbound & { promotion_type: "discount" })
|
|
81
|
+
| (FixedPricePromotion$Outbound & { promotion_type: "fixed-price" })
|
|
82
|
+
| (VolumeBasedPromotion$Outbound & { promotion_type: "volume-based" });
|
|
83
83
|
|
|
84
84
|
/** @internal */
|
|
85
85
|
export const Details$outboundSchema: z.ZodType<
|
|
@@ -87,23 +87,23 @@ export const Details$outboundSchema: z.ZodType<
|
|
|
87
87
|
z.ZodTypeDef,
|
|
88
88
|
Details
|
|
89
89
|
> = z.union([
|
|
90
|
-
|
|
91
|
-
z.object({ promotionType: z.literal("
|
|
90
|
+
FreeGoodsPromotion$outboundSchema.and(
|
|
91
|
+
z.object({ promotionType: z.literal("free-goods") }).transform((v) => ({
|
|
92
92
|
promotion_type: v.promotionType,
|
|
93
93
|
})),
|
|
94
94
|
),
|
|
95
|
-
|
|
96
|
-
z.object({ promotionType: z.literal("
|
|
95
|
+
DiscountBasedPromotion$outboundSchema.and(
|
|
96
|
+
z.object({ promotionType: z.literal("discount") }).transform((v) => ({
|
|
97
97
|
promotion_type: v.promotionType,
|
|
98
98
|
})),
|
|
99
99
|
),
|
|
100
|
-
|
|
101
|
-
z.object({ promotionType: z.literal("
|
|
100
|
+
FixedPricePromotion$outboundSchema.and(
|
|
101
|
+
z.object({ promotionType: z.literal("fixed-price") }).transform((v) => ({
|
|
102
102
|
promotion_type: v.promotionType,
|
|
103
103
|
})),
|
|
104
104
|
),
|
|
105
|
-
|
|
106
|
-
z.object({ promotionType: z.literal("
|
|
105
|
+
VolumeBasedPromotion$outboundSchema.and(
|
|
106
|
+
z.object({ promotionType: z.literal("volume-based") }).transform((v) => ({
|
|
107
107
|
promotion_type: v.promotionType,
|
|
108
108
|
})),
|
|
109
109
|
),
|
|
@@ -148,16 +148,6 @@ export const ProductPromotion$inboundSchema: z.ZodType<
|
|
|
148
148
|
z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
149
149
|
),
|
|
150
150
|
details: z.union([
|
|
151
|
-
FixedPricePromotion$inboundSchema.and(
|
|
152
|
-
z.object({ promotion_type: z.literal("fixed-price") }).transform((v) => ({
|
|
153
|
-
promotionType: v.promotion_type,
|
|
154
|
-
})),
|
|
155
|
-
),
|
|
156
|
-
VolumeBasedPromotion$inboundSchema.and(
|
|
157
|
-
z.object({ promotion_type: z.literal("volume-based") }).transform((
|
|
158
|
-
v,
|
|
159
|
-
) => ({ promotionType: v.promotion_type })),
|
|
160
|
-
),
|
|
161
151
|
FreeGoodsPromotion$inboundSchema.and(
|
|
162
152
|
z.object({ promotion_type: z.literal("free-goods") }).transform((v) => ({
|
|
163
153
|
promotionType: v.promotion_type,
|
|
@@ -168,6 +158,16 @@ export const ProductPromotion$inboundSchema: z.ZodType<
|
|
|
168
158
|
promotionType: v.promotion_type,
|
|
169
159
|
})),
|
|
170
160
|
),
|
|
161
|
+
FixedPricePromotion$inboundSchema.and(
|
|
162
|
+
z.object({ promotion_type: z.literal("fixed-price") }).transform((v) => ({
|
|
163
|
+
promotionType: v.promotion_type,
|
|
164
|
+
})),
|
|
165
|
+
),
|
|
166
|
+
VolumeBasedPromotion$inboundSchema.and(
|
|
167
|
+
z.object({ promotion_type: z.literal("volume-based") }).transform((
|
|
168
|
+
v,
|
|
169
|
+
) => ({ promotionType: v.promotion_type })),
|
|
170
|
+
),
|
|
171
171
|
]),
|
|
172
172
|
}).transform((v) => {
|
|
173
173
|
return remap$(v, {
|
|
@@ -182,10 +182,10 @@ export type ProductPromotion$Outbound = {
|
|
|
182
182
|
starts_at: string;
|
|
183
183
|
expires_at: string | null;
|
|
184
184
|
details:
|
|
185
|
-
| (FixedPricePromotion$Outbound & { promotion_type: "fixed-price" })
|
|
186
|
-
| (VolumeBasedPromotion$Outbound & { promotion_type: "volume-based" })
|
|
187
185
|
| (FreeGoodsPromotion$Outbound & { promotion_type: "free-goods" })
|
|
188
|
-
| (DiscountBasedPromotion$Outbound & { promotion_type: "discount" })
|
|
186
|
+
| (DiscountBasedPromotion$Outbound & { promotion_type: "discount" })
|
|
187
|
+
| (FixedPricePromotion$Outbound & { promotion_type: "fixed-price" })
|
|
188
|
+
| (VolumeBasedPromotion$Outbound & { promotion_type: "volume-based" });
|
|
189
189
|
};
|
|
190
190
|
|
|
191
191
|
/** @internal */
|
|
@@ -198,23 +198,23 @@ export const ProductPromotion$outboundSchema: z.ZodType<
|
|
|
198
198
|
startsAt: z.date().transform(v => v.toISOString()),
|
|
199
199
|
expiresAt: z.nullable(z.date().transform(v => v.toISOString())),
|
|
200
200
|
details: z.union([
|
|
201
|
-
|
|
202
|
-
z.object({ promotionType: z.literal("
|
|
201
|
+
FreeGoodsPromotion$outboundSchema.and(
|
|
202
|
+
z.object({ promotionType: z.literal("free-goods") }).transform((v) => ({
|
|
203
203
|
promotion_type: v.promotionType,
|
|
204
204
|
})),
|
|
205
205
|
),
|
|
206
|
-
|
|
207
|
-
z.object({ promotionType: z.literal("
|
|
206
|
+
DiscountBasedPromotion$outboundSchema.and(
|
|
207
|
+
z.object({ promotionType: z.literal("discount") }).transform((v) => ({
|
|
208
208
|
promotion_type: v.promotionType,
|
|
209
209
|
})),
|
|
210
210
|
),
|
|
211
|
-
|
|
212
|
-
z.object({ promotionType: z.literal("
|
|
211
|
+
FixedPricePromotion$outboundSchema.and(
|
|
212
|
+
z.object({ promotionType: z.literal("fixed-price") }).transform((v) => ({
|
|
213
213
|
promotion_type: v.promotionType,
|
|
214
214
|
})),
|
|
215
215
|
),
|
|
216
|
-
|
|
217
|
-
z.object({ promotionType: z.literal("
|
|
216
|
+
VolumeBasedPromotion$outboundSchema.and(
|
|
217
|
+
z.object({ promotionType: z.literal("volume-based") }).transform((v) => ({
|
|
218
218
|
promotion_type: v.promotionType,
|
|
219
219
|
})),
|
|
220
220
|
),
|