ce-storefront 0.13.2 → 0.14.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 +35 -28
- package/docs/sdks/catalog/README.md +7 -5
- 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 +4 -3
- package/esm/funcs/catalogGetProductDetail.d.ts.map +1 -1
- package/esm/funcs/catalogGetProductDetail.js +4 -7
- 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 +1 -1
- 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 +2 -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 +1 -1
- 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 +1 -1
- 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 -1
- 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 +1 -1
- 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 +1 -1
- 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 +1 -1
- package/esm/funcs/catalogListUpsellProducts.js.map +1 -1
- package/esm/funcs/catalogSearchProducts.d.ts +3 -2
- package/esm/funcs/catalogSearchProducts.d.ts.map +1 -1
- package/esm/funcs/catalogSearchProducts.js +1 -1
- 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/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/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/productreview.d.ts +1 -10
- package/esm/models/components/productreview.d.ts.map +1 -1
- package/esm/models/components/productreview.js +2 -5
- package/esm/models/components/productreview.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/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/listcategories.d.ts +6 -1
- package/esm/models/operations/listcategories.d.ts.map +1 -1
- package/esm/models/operations/listcategories.js +4 -0
- package/esm/models/operations/listcategories.js.map +1 -1
- package/esm/models/operations/listproducts.d.ts +6 -1
- package/esm/models/operations/listproducts.d.ts.map +1 -1
- package/esm/models/operations/listproducts.js +4 -0
- package/esm/models/operations/listproducts.js.map +1 -1
- package/esm/sdk/catalog.d.ts +1 -1
- package/esm/sdk/catalog.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 +28 -23
- package/src/funcs/catalogGetVariantDetail.ts +21 -17
- package/src/funcs/catalogListCategories.ts +22 -17
- package/src/funcs/catalogListCrosssellProducts.ts +21 -17
- package/src/funcs/catalogListProductReviews.ts +21 -17
- package/src/funcs/catalogListProductVariants.ts +21 -17
- package/src/funcs/catalogListProducts.ts +22 -17
- package/src/funcs/catalogListSimilarProducts.ts +21 -17
- package/src/funcs/catalogListSkus.ts +21 -17
- package/src/funcs/catalogListUpsellProducts.ts +21 -17
- package/src/funcs/catalogSearchProducts.ts +21 -17
- 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/matchers.ts +44 -41
- package/src/models/components/product.ts +10 -0
- package/src/models/components/productdetail.ts +10 -0
- package/src/models/components/productreview.ts +3 -6
- 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/getproductdetail.ts +7 -7
- package/src/models/operations/listcategories.ts +10 -1
- package/src/models/operations/listproducts.ts +10 -1
- package/src/sdk/catalog.ts +1 -1
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import * as z from "zod";
|
|
6
|
+
import { CeStorefrontError } from "./cestorefronterror.js";
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* Requested resource not found
|
|
@@ -16,18 +17,20 @@ export type NotFoundData = {
|
|
|
16
17
|
/**
|
|
17
18
|
* Requested resource not found
|
|
18
19
|
*/
|
|
19
|
-
export class NotFound extends
|
|
20
|
+
export class NotFound extends CeStorefrontError {
|
|
20
21
|
success: boolean;
|
|
21
22
|
code: string;
|
|
22
23
|
|
|
23
24
|
/** The original data that was passed to this error instance. */
|
|
24
25
|
data$: NotFoundData;
|
|
25
26
|
|
|
26
|
-
constructor(
|
|
27
|
+
constructor(
|
|
28
|
+
err: NotFoundData,
|
|
29
|
+
httpMeta: { response: Response; request: Request; body: string },
|
|
30
|
+
) {
|
|
27
31
|
const message = err.message || "API error occurred";
|
|
28
|
-
super(message);
|
|
32
|
+
super(message, httpMeta);
|
|
29
33
|
this.data$ = err;
|
|
30
|
-
|
|
31
34
|
this.success = err.success;
|
|
32
35
|
this.code = err.code;
|
|
33
36
|
|
|
@@ -44,9 +47,16 @@ export const NotFound$inboundSchema: z.ZodType<
|
|
|
44
47
|
message: z.string(),
|
|
45
48
|
success: z.boolean(),
|
|
46
49
|
code: z.string(),
|
|
50
|
+
request$: z.instanceof(Request),
|
|
51
|
+
response$: z.instanceof(Response),
|
|
52
|
+
body$: z.string(),
|
|
47
53
|
})
|
|
48
54
|
.transform((v) => {
|
|
49
|
-
return new NotFound(v
|
|
55
|
+
return new NotFound(v, {
|
|
56
|
+
request: v.request$,
|
|
57
|
+
response: v.response$,
|
|
58
|
+
body: v.body$,
|
|
59
|
+
});
|
|
50
60
|
});
|
|
51
61
|
|
|
52
62
|
/** @internal */
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import { CeStorefrontError } from "./cestorefronterror.js";
|
|
7
|
+
import { formatZodError } from "./sdkvalidationerror.js";
|
|
8
|
+
|
|
9
|
+
export class ResponseValidationError extends CeStorefrontError {
|
|
10
|
+
/**
|
|
11
|
+
* The raw value that failed validation.
|
|
12
|
+
*/
|
|
13
|
+
public readonly rawValue: unknown;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* The raw message that failed validation.
|
|
17
|
+
*/
|
|
18
|
+
public readonly rawMessage: unknown;
|
|
19
|
+
|
|
20
|
+
constructor(
|
|
21
|
+
message: string,
|
|
22
|
+
extra: {
|
|
23
|
+
response: Response;
|
|
24
|
+
request: Request;
|
|
25
|
+
body: string;
|
|
26
|
+
cause: unknown;
|
|
27
|
+
rawValue: unknown;
|
|
28
|
+
rawMessage: unknown;
|
|
29
|
+
},
|
|
30
|
+
) {
|
|
31
|
+
super(message, extra);
|
|
32
|
+
this.name = "ResponseValidationError";
|
|
33
|
+
this.cause = extra.cause;
|
|
34
|
+
this.rawValue = extra.rawValue;
|
|
35
|
+
this.rawMessage = extra.rawMessage;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Return a pretty-formatted error message if the underlying validation error
|
|
40
|
+
* is a ZodError or some other recognized error type, otherwise return the
|
|
41
|
+
* default error message.
|
|
42
|
+
*/
|
|
43
|
+
public pretty(): string {
|
|
44
|
+
if (this.cause instanceof z.ZodError) {
|
|
45
|
+
return `${this.rawMessage}\n${formatZodError(this.cause)}`;
|
|
46
|
+
} else {
|
|
47
|
+
return this.toString();
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -15,6 +15,18 @@ export class SDKValidationError extends Error {
|
|
|
15
15
|
*/
|
|
16
16
|
public readonly rawMessage: unknown;
|
|
17
17
|
|
|
18
|
+
// Allows for backwards compatibility for `instanceof` checks of `ResponseValidationError`
|
|
19
|
+
static override [Symbol.hasInstance](
|
|
20
|
+
instance: unknown,
|
|
21
|
+
): instance is SDKValidationError {
|
|
22
|
+
if (!(instance instanceof Error)) return false;
|
|
23
|
+
if (!("rawValue" in instance)) return false;
|
|
24
|
+
if (!("rawMessage" in instance)) return false;
|
|
25
|
+
if (!("pretty" in instance)) return false;
|
|
26
|
+
if (typeof instance.pretty !== "function") return false;
|
|
27
|
+
return true;
|
|
28
|
+
}
|
|
29
|
+
|
|
18
30
|
constructor(message: string, cause: unknown, rawValue: unknown) {
|
|
19
31
|
super(`${message}: ${cause}`);
|
|
20
32
|
this.name = "SDKValidationError";
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import * as z from "zod";
|
|
6
|
+
import { CeStorefrontError } from "./cestorefronterror.js";
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* Not authorized for given operation on the Resource
|
|
@@ -16,18 +17,20 @@ export type UnauthorizedData = {
|
|
|
16
17
|
/**
|
|
17
18
|
* Not authorized for given operation on the Resource
|
|
18
19
|
*/
|
|
19
|
-
export class Unauthorized extends
|
|
20
|
+
export class Unauthorized extends CeStorefrontError {
|
|
20
21
|
success?: boolean;
|
|
21
22
|
code: string;
|
|
22
23
|
|
|
23
24
|
/** The original data that was passed to this error instance. */
|
|
24
25
|
data$: UnauthorizedData;
|
|
25
26
|
|
|
26
|
-
constructor(
|
|
27
|
+
constructor(
|
|
28
|
+
err: UnauthorizedData,
|
|
29
|
+
httpMeta: { response: Response; request: Request; body: string },
|
|
30
|
+
) {
|
|
27
31
|
const message = err.message || "API error occurred";
|
|
28
|
-
super(message);
|
|
32
|
+
super(message, httpMeta);
|
|
29
33
|
this.data$ = err;
|
|
30
|
-
|
|
31
34
|
if (err.success != null) this.success = err.success;
|
|
32
35
|
this.code = err.code;
|
|
33
36
|
|
|
@@ -44,9 +47,16 @@ export const Unauthorized$inboundSchema: z.ZodType<
|
|
|
44
47
|
message: z.string(),
|
|
45
48
|
success: z.boolean().default(false),
|
|
46
49
|
code: z.string(),
|
|
50
|
+
request$: z.instanceof(Request),
|
|
51
|
+
response$: z.instanceof(Response),
|
|
52
|
+
body$: z.string(),
|
|
47
53
|
})
|
|
48
54
|
.transform((v) => {
|
|
49
|
-
return new Unauthorized(v
|
|
55
|
+
return new Unauthorized(v, {
|
|
56
|
+
request: v.request$,
|
|
57
|
+
response: v.response$,
|
|
58
|
+
body: v.body$,
|
|
59
|
+
});
|
|
50
60
|
});
|
|
51
61
|
|
|
52
62
|
/** @internal */
|
|
@@ -11,9 +11,9 @@ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
|
11
11
|
|
|
12
12
|
export type GetProductDetailRequest = {
|
|
13
13
|
/**
|
|
14
|
-
*
|
|
14
|
+
* The unique identifier of the product. Can be either the product ID or the slug.
|
|
15
15
|
*/
|
|
16
|
-
|
|
16
|
+
productIdOrSlug: string;
|
|
17
17
|
/**
|
|
18
18
|
* The customer_group_id is used to determine product pricing, promotions, and subscription rates. If a valid customer_group_id is provided, pricing details will be retrieved accordingly. If no matching data is found for the specified customer_group_id, the system will fall back to the default customer_group_id. If no data is found for the default group either, the highest applicable price will be returned.
|
|
19
19
|
*/
|
|
@@ -39,18 +39,18 @@ export const GetProductDetailRequest$inboundSchema: z.ZodType<
|
|
|
39
39
|
z.ZodTypeDef,
|
|
40
40
|
unknown
|
|
41
41
|
> = z.object({
|
|
42
|
-
|
|
42
|
+
product_id_or_slug: z.string(),
|
|
43
43
|
customer_group_id: z.string().optional(),
|
|
44
44
|
}).transform((v) => {
|
|
45
45
|
return remap$(v, {
|
|
46
|
-
"
|
|
46
|
+
"product_id_or_slug": "productIdOrSlug",
|
|
47
47
|
"customer_group_id": "customerGroupId",
|
|
48
48
|
});
|
|
49
49
|
});
|
|
50
50
|
|
|
51
51
|
/** @internal */
|
|
52
52
|
export type GetProductDetailRequest$Outbound = {
|
|
53
|
-
|
|
53
|
+
product_id_or_slug: string;
|
|
54
54
|
customer_group_id?: string | undefined;
|
|
55
55
|
};
|
|
56
56
|
|
|
@@ -60,11 +60,11 @@ export const GetProductDetailRequest$outboundSchema: z.ZodType<
|
|
|
60
60
|
z.ZodTypeDef,
|
|
61
61
|
GetProductDetailRequest
|
|
62
62
|
> = z.object({
|
|
63
|
-
|
|
63
|
+
productIdOrSlug: z.string(),
|
|
64
64
|
customerGroupId: z.string().optional(),
|
|
65
65
|
}).transform((v) => {
|
|
66
66
|
return remap$(v, {
|
|
67
|
-
|
|
67
|
+
productIdOrSlug: "product_id_or_slug",
|
|
68
68
|
customerGroupId: "customer_group_id",
|
|
69
69
|
});
|
|
70
70
|
});
|
|
@@ -11,7 +11,7 @@ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
|
11
11
|
|
|
12
12
|
export type ListCategoriesRequest = {
|
|
13
13
|
/**
|
|
14
|
-
* To return child categories
|
|
14
|
+
* To return child categories using category id.
|
|
15
15
|
*/
|
|
16
16
|
parentCategoryId?: string | undefined;
|
|
17
17
|
/**
|
|
@@ -26,6 +26,10 @@ export type ListCategoriesRequest = {
|
|
|
26
26
|
* JSON string format: {"field1":"asc", "field2":"desc"}
|
|
27
27
|
*/
|
|
28
28
|
sortBy?: string | undefined;
|
|
29
|
+
/**
|
|
30
|
+
* To return child categories using category slug
|
|
31
|
+
*/
|
|
32
|
+
parentCategorySlug?: string | undefined;
|
|
29
33
|
};
|
|
30
34
|
|
|
31
35
|
export type ListCategoriesContent = {
|
|
@@ -55,11 +59,13 @@ export const ListCategoriesRequest$inboundSchema: z.ZodType<
|
|
|
55
59
|
nested_level: z.number().int().default(0),
|
|
56
60
|
search: z.string().optional(),
|
|
57
61
|
sort_by: z.string().optional(),
|
|
62
|
+
parent_category_slug: z.string().optional(),
|
|
58
63
|
}).transform((v) => {
|
|
59
64
|
return remap$(v, {
|
|
60
65
|
"parent_category_id": "parentCategoryId",
|
|
61
66
|
"nested_level": "nestedLevel",
|
|
62
67
|
"sort_by": "sortBy",
|
|
68
|
+
"parent_category_slug": "parentCategorySlug",
|
|
63
69
|
});
|
|
64
70
|
});
|
|
65
71
|
|
|
@@ -69,6 +75,7 @@ export type ListCategoriesRequest$Outbound = {
|
|
|
69
75
|
nested_level: number;
|
|
70
76
|
search?: string | undefined;
|
|
71
77
|
sort_by?: string | undefined;
|
|
78
|
+
parent_category_slug?: string | undefined;
|
|
72
79
|
};
|
|
73
80
|
|
|
74
81
|
/** @internal */
|
|
@@ -81,11 +88,13 @@ export const ListCategoriesRequest$outboundSchema: z.ZodType<
|
|
|
81
88
|
nestedLevel: z.number().int().default(0),
|
|
82
89
|
search: z.string().optional(),
|
|
83
90
|
sortBy: z.string().optional(),
|
|
91
|
+
parentCategorySlug: z.string().optional(),
|
|
84
92
|
}).transform((v) => {
|
|
85
93
|
return remap$(v, {
|
|
86
94
|
parentCategoryId: "parent_category_id",
|
|
87
95
|
nestedLevel: "nested_level",
|
|
88
96
|
sortBy: "sort_by",
|
|
97
|
+
parentCategorySlug: "parent_category_slug",
|
|
89
98
|
});
|
|
90
99
|
});
|
|
91
100
|
|
|
@@ -23,13 +23,17 @@ export type ListProductsRequest = {
|
|
|
23
23
|
*/
|
|
24
24
|
sortBy?: string | undefined;
|
|
25
25
|
/**
|
|
26
|
-
* filter products by categories
|
|
26
|
+
* filter products by categories ids
|
|
27
27
|
*/
|
|
28
28
|
categoryId?: Array<string> | undefined;
|
|
29
29
|
/**
|
|
30
30
|
* The customer_group_id is used to determine product pricing, promotions, and subscription rates. If a valid customer_group_id is provided, pricing details will be retrieved accordingly. If no matching data is found for the specified customer_group_id, the system will fall back to the default customer_group_id. If no data is found for the default group either, the highest applicable price will be returned.
|
|
31
31
|
*/
|
|
32
32
|
customerGroupId?: string | undefined;
|
|
33
|
+
/**
|
|
34
|
+
* filter products by categories slugs
|
|
35
|
+
*/
|
|
36
|
+
categorySlug?: Array<string> | undefined;
|
|
33
37
|
};
|
|
34
38
|
|
|
35
39
|
export type Content = {
|
|
@@ -60,11 +64,13 @@ export const ListProductsRequest$inboundSchema: z.ZodType<
|
|
|
60
64
|
sort_by: z.string().optional(),
|
|
61
65
|
category_id: z.array(z.string()).optional(),
|
|
62
66
|
customer_group_id: z.string().optional(),
|
|
67
|
+
category_slug: z.array(z.string()).optional(),
|
|
63
68
|
}).transform((v) => {
|
|
64
69
|
return remap$(v, {
|
|
65
70
|
"sort_by": "sortBy",
|
|
66
71
|
"category_id": "categoryId",
|
|
67
72
|
"customer_group_id": "customerGroupId",
|
|
73
|
+
"category_slug": "categorySlug",
|
|
68
74
|
});
|
|
69
75
|
});
|
|
70
76
|
|
|
@@ -75,6 +81,7 @@ export type ListProductsRequest$Outbound = {
|
|
|
75
81
|
sort_by?: string | undefined;
|
|
76
82
|
category_id?: Array<string> | undefined;
|
|
77
83
|
customer_group_id?: string | undefined;
|
|
84
|
+
category_slug?: Array<string> | undefined;
|
|
78
85
|
};
|
|
79
86
|
|
|
80
87
|
/** @internal */
|
|
@@ -88,11 +95,13 @@ export const ListProductsRequest$outboundSchema: z.ZodType<
|
|
|
88
95
|
sortBy: z.string().optional(),
|
|
89
96
|
categoryId: z.array(z.string()).optional(),
|
|
90
97
|
customerGroupId: z.string().optional(),
|
|
98
|
+
categorySlug: z.array(z.string()).optional(),
|
|
91
99
|
}).transform((v) => {
|
|
92
100
|
return remap$(v, {
|
|
93
101
|
sortBy: "sort_by",
|
|
94
102
|
categoryId: "category_id",
|
|
95
103
|
customerGroupId: "customer_group_id",
|
|
104
|
+
categorySlug: "category_slug",
|
|
96
105
|
});
|
|
97
106
|
});
|
|
98
107
|
|
package/src/sdk/catalog.ts
CHANGED
|
@@ -57,7 +57,7 @@ export class Catalog extends ClientSDK {
|
|
|
57
57
|
* Retrieve a product detail
|
|
58
58
|
*
|
|
59
59
|
* @remarks
|
|
60
|
-
* Retrieves the details of an existing product. Supply the unique product ID
|
|
60
|
+
* Retrieves the details of an existing product. Supply either the unique product ID or the unique slug, and Commerce Engine will return the corresponding product information.
|
|
61
61
|
*/
|
|
62
62
|
async getProductDetail(
|
|
63
63
|
request: operations.GetProductDetailRequest,
|