@51eat/sdk 0.0.42 → 0.0.44
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/dist/cjs/BaseClient.js +2 -2
- package/dist/cjs/api/resources/business/resources/products/client/Client.d.ts +3 -0
- package/dist/cjs/api/resources/business/resources/products/client/Client.js +7 -2
- package/dist/cjs/api/resources/business/resources/products/resources/images/client/Client.d.ts +69 -0
- package/dist/cjs/api/resources/business/resources/products/resources/images/client/Client.js +259 -0
- package/dist/cjs/api/resources/business/resources/products/resources/images/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/business/resources/products/resources/images/client/index.js +17 -0
- package/dist/cjs/api/resources/business/resources/products/resources/images/client/requests/DeleteImagesRequest.d.ts +13 -0
- package/dist/cjs/api/resources/business/resources/products/resources/images/client/requests/DeleteImagesRequest.js +3 -0
- package/dist/cjs/api/resources/business/resources/products/resources/images/client/requests/ReorderImagesRequest.d.ts +18 -0
- package/dist/cjs/api/resources/business/resources/products/resources/images/client/requests/ReorderImagesRequest.js +3 -0
- package/dist/cjs/api/resources/business/resources/products/resources/images/client/requests/UploadImagesRequest.d.ts +14 -0
- package/dist/cjs/api/resources/business/resources/products/resources/images/client/requests/UploadImagesRequest.js +3 -0
- package/dist/cjs/api/resources/business/resources/products/resources/images/client/requests/index.d.ts +3 -0
- package/dist/cjs/api/resources/business/resources/products/resources/images/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/business/resources/products/resources/images/exports.d.ts +2 -0
- package/dist/cjs/api/resources/business/resources/products/resources/images/exports.js +21 -0
- package/dist/cjs/api/resources/business/resources/products/resources/images/index.d.ts +2 -0
- package/dist/cjs/api/resources/business/resources/products/resources/images/index.js +18 -0
- package/dist/cjs/api/resources/business/resources/products/resources/images/types/DeleteImagesResponse.d.ts +9 -0
- package/dist/cjs/api/resources/business/resources/products/resources/images/types/DeleteImagesResponse.js +10 -0
- package/dist/cjs/api/resources/business/resources/products/resources/images/types/ReorderImagesResponse.d.ts +9 -0
- package/dist/cjs/api/resources/business/resources/products/resources/images/types/ReorderImagesResponse.js +10 -0
- package/dist/cjs/api/resources/business/resources/products/resources/images/types/UploadImagesResponse.d.ts +4 -0
- package/dist/cjs/api/resources/business/resources/products/resources/images/types/UploadImagesResponse.js +3 -0
- package/dist/cjs/api/resources/business/resources/products/resources/images/types/index.d.ts +3 -0
- package/dist/cjs/api/resources/business/resources/products/resources/images/types/index.js +19 -0
- package/dist/cjs/api/resources/business/resources/products/resources/index.d.ts +3 -0
- package/dist/cjs/api/resources/business/resources/products/resources/index.js +4 -1
- package/dist/cjs/api/resources/business/resources/products/resources/variants/client/Client.d.ts +3 -0
- package/dist/cjs/api/resources/business/resources/products/resources/variants/client/Client.js +5 -0
- package/dist/cjs/api/resources/business/resources/products/resources/variants/exports.d.ts +1 -0
- package/dist/cjs/api/resources/business/resources/products/resources/variants/exports.js +1 -0
- package/dist/cjs/api/resources/business/resources/products/resources/variants/index.d.ts +1 -0
- package/dist/cjs/api/resources/business/resources/products/resources/variants/index.js +1 -0
- package/dist/cjs/api/resources/business/resources/products/resources/variants/resources/images/client/Client.d.ts +69 -0
- package/dist/cjs/api/resources/business/resources/products/resources/variants/resources/images/client/Client.js +259 -0
- package/dist/cjs/api/resources/business/resources/products/resources/variants/resources/images/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/business/resources/products/resources/variants/resources/images/client/index.js +17 -0
- package/dist/cjs/api/resources/business/resources/products/resources/variants/resources/images/client/requests/DeleteImagesRequest.d.ts +13 -0
- package/dist/cjs/api/resources/business/resources/products/resources/variants/resources/images/client/requests/DeleteImagesRequest.js +3 -0
- package/dist/cjs/api/resources/business/resources/products/resources/variants/resources/images/client/requests/ReorderImagesRequest.d.ts +18 -0
- package/dist/cjs/api/resources/business/resources/products/resources/variants/resources/images/client/requests/ReorderImagesRequest.js +3 -0
- package/dist/cjs/api/resources/business/resources/products/resources/variants/resources/images/client/requests/UploadImagesRequest.d.ts +14 -0
- package/dist/cjs/api/resources/business/resources/products/resources/variants/resources/images/client/requests/UploadImagesRequest.js +3 -0
- package/dist/cjs/api/resources/business/resources/products/resources/variants/resources/images/client/requests/index.d.ts +3 -0
- package/dist/cjs/api/resources/business/resources/products/resources/variants/resources/images/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/business/resources/products/resources/variants/resources/images/exports.d.ts +2 -0
- package/dist/cjs/api/resources/business/resources/products/resources/variants/resources/images/exports.js +21 -0
- package/dist/cjs/api/resources/business/resources/products/resources/variants/resources/images/index.d.ts +2 -0
- package/dist/cjs/api/resources/business/resources/products/resources/variants/resources/images/index.js +18 -0
- package/dist/cjs/api/resources/business/resources/products/resources/variants/resources/images/types/DeleteImagesResponse.d.ts +9 -0
- package/dist/cjs/api/resources/business/resources/products/resources/variants/resources/images/types/DeleteImagesResponse.js +10 -0
- package/dist/cjs/api/resources/business/resources/products/resources/variants/resources/images/types/ReorderImagesResponse.d.ts +9 -0
- package/dist/cjs/api/resources/business/resources/products/resources/variants/resources/images/types/ReorderImagesResponse.js +10 -0
- package/dist/cjs/api/resources/business/resources/products/resources/variants/resources/images/types/UploadImagesResponse.d.ts +4 -0
- package/dist/cjs/api/resources/business/resources/products/resources/variants/resources/images/types/UploadImagesResponse.js +3 -0
- package/dist/cjs/api/resources/business/resources/products/resources/variants/resources/images/types/index.d.ts +3 -0
- package/dist/cjs/api/resources/business/resources/products/resources/variants/resources/images/types/index.js +19 -0
- package/dist/cjs/api/resources/business/resources/products/resources/variants/resources/index.d.ts +3 -0
- package/dist/cjs/api/resources/business/resources/products/resources/variants/resources/index.js +42 -0
- package/dist/cjs/api/resources/customer/resources/businesses/client/Client.d.ts +6 -6
- package/dist/cjs/api/resources/customer/resources/businesses/client/Client.js +24 -24
- package/dist/cjs/api/resources/customer/resources/businesses/client/requests/FavoriteBusinessesRequest.d.ts +2 -2
- package/dist/cjs/api/resources/customer/resources/businesses/client/requests/ListTemporaryLocationsBusinessesRequest.d.ts +2 -2
- package/dist/cjs/api/resources/customer/resources/businesses/client/requests/MenusBusinessesRequest.d.ts +2 -2
- package/dist/cjs/api/resources/customer/resources/businesses/client/requests/PhotosBusinessesRequest.d.ts +2 -2
- package/dist/cjs/api/resources/customer/resources/businesses/client/requests/ProfileBusinessesRequest.d.ts +2 -2
- package/dist/cjs/api/resources/customer/resources/businesses/client/requests/UnfavoriteBusinessesRequest.d.ts +2 -2
- package/dist/cjs/api/resources/customer/resources/businesses/resources/bulletins/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/customer/resources/businesses/resources/bulletins/client/Client.js +4 -4
- package/dist/cjs/api/resources/customer/resources/businesses/resources/bulletins/client/requests/ListBulletinsRequest.d.ts +2 -2
- package/dist/cjs/api/resources/customer/resources/businesses/resources/bulletins/resources/comments/client/Client.d.ts +4 -4
- package/dist/cjs/api/resources/customer/resources/businesses/resources/bulletins/resources/comments/client/Client.js +16 -16
- package/dist/cjs/api/resources/customer/resources/businesses/resources/bulletins/resources/comments/client/requests/AppHttpRequestsApiV1CustomerBusinessesStoreBulletinCommentRequest.d.ts +2 -2
- package/dist/cjs/api/resources/customer/resources/businesses/resources/bulletins/resources/comments/client/requests/ListCommentsRequest.d.ts +2 -2
- package/dist/cjs/api/resources/customer/resources/businesses/resources/bulletins/resources/comments/client/requests/ListRepliesCommentsRequest.d.ts +2 -2
- package/dist/cjs/api/resources/customer/resources/businesses/resources/bulletins/resources/comments/client/requests/StoreBulletinCommentReplyRequest.d.ts +2 -2
- package/dist/cjs/api/resources/customer/resources/businesses/resources/events/client/Client.d.ts +4 -4
- package/dist/cjs/api/resources/customer/resources/businesses/resources/events/client/Client.js +16 -16
- package/dist/cjs/api/resources/customer/resources/businesses/resources/events/client/requests/CancelRsvpEventsRequest.d.ts +2 -2
- package/dist/cjs/api/resources/customer/resources/businesses/resources/events/client/requests/GetEventsRequest.d.ts +2 -2
- package/dist/cjs/api/resources/customer/resources/businesses/resources/events/client/requests/ListEventsRequest.d.ts +2 -2
- package/dist/cjs/api/resources/customer/resources/businesses/resources/events/client/requests/StoreEventRsvpRequest.d.ts +2 -2
- package/dist/cjs/api/resources/customer/resources/cart/client/Client.d.ts +43 -35
- package/dist/cjs/api/resources/customer/resources/cart/client/Client.js +105 -92
- package/dist/cjs/api/resources/customer/resources/cart/client/requests/AddToCartRequest.d.ts +3 -2
- package/dist/cjs/api/resources/customer/resources/cart/client/requests/CheckoutRequest.d.ts +3 -0
- package/dist/cjs/api/resources/customer/resources/cart/client/requests/ClearCartRequest.d.ts +10 -0
- package/dist/cjs/api/resources/customer/resources/cart/client/requests/ClearCartRequest.js +3 -0
- package/dist/cjs/api/resources/customer/resources/cart/client/requests/CreatePaymentIntentRequest.d.ts +3 -0
- package/dist/cjs/api/resources/customer/resources/cart/client/requests/GetCartRequest.d.ts +10 -0
- package/dist/cjs/api/resources/customer/resources/cart/client/requests/GetCartRequest.js +3 -0
- package/dist/cjs/api/resources/customer/resources/cart/client/requests/index.d.ts +2 -0
- package/dist/cjs/api/resources/customer/resources/shop/client/Client.d.ts +3 -3
- package/dist/cjs/api/resources/customer/resources/shop/client/Client.js +12 -12
- package/dist/cjs/api/resources/customer/resources/shop/client/requests/GetProductShopRequest.d.ts +2 -2
- package/dist/cjs/api/resources/customer/resources/shop/client/requests/ListCategoriesShopRequest.d.ts +2 -2
- package/dist/cjs/api/resources/customer/resources/shop/client/requests/ListProductsShopRequest.d.ts +2 -2
- package/dist/cjs/api/types/BusinessProduct.d.ts +1 -1
- package/dist/cjs/api/types/BusinessProductVariant.d.ts +2 -0
- package/dist/cjs/api/types/ReorderProductImagesRequest.d.ts +12 -0
- package/dist/cjs/api/types/ReorderProductImagesRequest.js +3 -0
- package/dist/cjs/api/types/StoreProductImageRequest.d.ts +4 -0
- package/dist/cjs/api/types/StoreProductImageRequest.js +3 -0
- package/dist/cjs/api/types/index.d.ts +2 -0
- package/dist/cjs/api/types/index.js +2 -0
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/BaseClient.mjs +2 -2
- package/dist/esm/api/resources/business/resources/products/client/Client.d.mts +3 -0
- package/dist/esm/api/resources/business/resources/products/client/Client.mjs +5 -0
- package/dist/esm/api/resources/business/resources/products/resources/images/client/Client.d.mts +69 -0
- package/dist/esm/api/resources/business/resources/products/resources/images/client/Client.mjs +222 -0
- package/dist/esm/api/resources/business/resources/products/resources/images/client/index.d.mts +1 -0
- package/dist/esm/api/resources/business/resources/products/resources/images/client/index.mjs +1 -0
- package/dist/esm/api/resources/business/resources/products/resources/images/client/requests/DeleteImagesRequest.d.mts +13 -0
- package/dist/esm/api/resources/business/resources/products/resources/images/client/requests/DeleteImagesRequest.mjs +2 -0
- package/dist/esm/api/resources/business/resources/products/resources/images/client/requests/ReorderImagesRequest.d.mts +18 -0
- package/dist/esm/api/resources/business/resources/products/resources/images/client/requests/ReorderImagesRequest.mjs +2 -0
- package/dist/esm/api/resources/business/resources/products/resources/images/client/requests/UploadImagesRequest.d.mts +14 -0
- package/dist/esm/api/resources/business/resources/products/resources/images/client/requests/UploadImagesRequest.mjs +2 -0
- package/dist/esm/api/resources/business/resources/products/resources/images/client/requests/index.d.mts +3 -0
- package/dist/esm/api/resources/business/resources/products/resources/images/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/business/resources/products/resources/images/exports.d.mts +2 -0
- package/dist/esm/api/resources/business/resources/products/resources/images/exports.mjs +3 -0
- package/dist/esm/api/resources/business/resources/products/resources/images/index.d.mts +2 -0
- package/dist/esm/api/resources/business/resources/products/resources/images/index.mjs +2 -0
- package/dist/esm/api/resources/business/resources/products/resources/images/types/DeleteImagesResponse.d.mts +9 -0
- package/dist/esm/api/resources/business/resources/products/resources/images/types/DeleteImagesResponse.mjs +7 -0
- package/dist/esm/api/resources/business/resources/products/resources/images/types/ReorderImagesResponse.d.mts +9 -0
- package/dist/esm/api/resources/business/resources/products/resources/images/types/ReorderImagesResponse.mjs +7 -0
- package/dist/esm/api/resources/business/resources/products/resources/images/types/UploadImagesResponse.d.mts +4 -0
- package/dist/esm/api/resources/business/resources/products/resources/images/types/UploadImagesResponse.mjs +2 -0
- package/dist/esm/api/resources/business/resources/products/resources/images/types/index.d.mts +3 -0
- package/dist/esm/api/resources/business/resources/products/resources/images/types/index.mjs +3 -0
- package/dist/esm/api/resources/business/resources/products/resources/index.d.mts +3 -0
- package/dist/esm/api/resources/business/resources/products/resources/index.mjs +3 -0
- package/dist/esm/api/resources/business/resources/products/resources/variants/client/Client.d.mts +3 -0
- package/dist/esm/api/resources/business/resources/products/resources/variants/client/Client.mjs +5 -0
- package/dist/esm/api/resources/business/resources/products/resources/variants/exports.d.mts +1 -0
- package/dist/esm/api/resources/business/resources/products/resources/variants/exports.mjs +1 -0
- package/dist/esm/api/resources/business/resources/products/resources/variants/index.d.mts +1 -0
- package/dist/esm/api/resources/business/resources/products/resources/variants/index.mjs +1 -0
- package/dist/esm/api/resources/business/resources/products/resources/variants/resources/images/client/Client.d.mts +69 -0
- package/dist/esm/api/resources/business/resources/products/resources/variants/resources/images/client/Client.mjs +222 -0
- package/dist/esm/api/resources/business/resources/products/resources/variants/resources/images/client/index.d.mts +1 -0
- package/dist/esm/api/resources/business/resources/products/resources/variants/resources/images/client/index.mjs +1 -0
- package/dist/esm/api/resources/business/resources/products/resources/variants/resources/images/client/requests/DeleteImagesRequest.d.mts +13 -0
- package/dist/esm/api/resources/business/resources/products/resources/variants/resources/images/client/requests/DeleteImagesRequest.mjs +2 -0
- package/dist/esm/api/resources/business/resources/products/resources/variants/resources/images/client/requests/ReorderImagesRequest.d.mts +18 -0
- package/dist/esm/api/resources/business/resources/products/resources/variants/resources/images/client/requests/ReorderImagesRequest.mjs +2 -0
- package/dist/esm/api/resources/business/resources/products/resources/variants/resources/images/client/requests/UploadImagesRequest.d.mts +14 -0
- package/dist/esm/api/resources/business/resources/products/resources/variants/resources/images/client/requests/UploadImagesRequest.mjs +2 -0
- package/dist/esm/api/resources/business/resources/products/resources/variants/resources/images/client/requests/index.d.mts +3 -0
- package/dist/esm/api/resources/business/resources/products/resources/variants/resources/images/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/business/resources/products/resources/variants/resources/images/exports.d.mts +2 -0
- package/dist/esm/api/resources/business/resources/products/resources/variants/resources/images/exports.mjs +3 -0
- package/dist/esm/api/resources/business/resources/products/resources/variants/resources/images/index.d.mts +2 -0
- package/dist/esm/api/resources/business/resources/products/resources/variants/resources/images/index.mjs +2 -0
- package/dist/esm/api/resources/business/resources/products/resources/variants/resources/images/types/DeleteImagesResponse.d.mts +9 -0
- package/dist/esm/api/resources/business/resources/products/resources/variants/resources/images/types/DeleteImagesResponse.mjs +7 -0
- package/dist/esm/api/resources/business/resources/products/resources/variants/resources/images/types/ReorderImagesResponse.d.mts +9 -0
- package/dist/esm/api/resources/business/resources/products/resources/variants/resources/images/types/ReorderImagesResponse.mjs +7 -0
- package/dist/esm/api/resources/business/resources/products/resources/variants/resources/images/types/UploadImagesResponse.d.mts +4 -0
- package/dist/esm/api/resources/business/resources/products/resources/variants/resources/images/types/UploadImagesResponse.mjs +2 -0
- package/dist/esm/api/resources/business/resources/products/resources/variants/resources/images/types/index.d.mts +3 -0
- package/dist/esm/api/resources/business/resources/products/resources/variants/resources/images/types/index.mjs +3 -0
- package/dist/esm/api/resources/business/resources/products/resources/variants/resources/index.d.mts +3 -0
- package/dist/esm/api/resources/business/resources/products/resources/variants/resources/index.mjs +3 -0
- package/dist/esm/api/resources/customer/resources/businesses/client/Client.d.mts +6 -6
- package/dist/esm/api/resources/customer/resources/businesses/client/Client.mjs +24 -24
- package/dist/esm/api/resources/customer/resources/businesses/client/requests/FavoriteBusinessesRequest.d.mts +2 -2
- package/dist/esm/api/resources/customer/resources/businesses/client/requests/ListTemporaryLocationsBusinessesRequest.d.mts +2 -2
- package/dist/esm/api/resources/customer/resources/businesses/client/requests/MenusBusinessesRequest.d.mts +2 -2
- package/dist/esm/api/resources/customer/resources/businesses/client/requests/PhotosBusinessesRequest.d.mts +2 -2
- package/dist/esm/api/resources/customer/resources/businesses/client/requests/ProfileBusinessesRequest.d.mts +2 -2
- package/dist/esm/api/resources/customer/resources/businesses/client/requests/UnfavoriteBusinessesRequest.d.mts +2 -2
- package/dist/esm/api/resources/customer/resources/businesses/resources/bulletins/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/customer/resources/businesses/resources/bulletins/client/Client.mjs +4 -4
- package/dist/esm/api/resources/customer/resources/businesses/resources/bulletins/client/requests/ListBulletinsRequest.d.mts +2 -2
- package/dist/esm/api/resources/customer/resources/businesses/resources/bulletins/resources/comments/client/Client.d.mts +4 -4
- package/dist/esm/api/resources/customer/resources/businesses/resources/bulletins/resources/comments/client/Client.mjs +16 -16
- package/dist/esm/api/resources/customer/resources/businesses/resources/bulletins/resources/comments/client/requests/AppHttpRequestsApiV1CustomerBusinessesStoreBulletinCommentRequest.d.mts +2 -2
- package/dist/esm/api/resources/customer/resources/businesses/resources/bulletins/resources/comments/client/requests/ListCommentsRequest.d.mts +2 -2
- package/dist/esm/api/resources/customer/resources/businesses/resources/bulletins/resources/comments/client/requests/ListRepliesCommentsRequest.d.mts +2 -2
- package/dist/esm/api/resources/customer/resources/businesses/resources/bulletins/resources/comments/client/requests/StoreBulletinCommentReplyRequest.d.mts +2 -2
- package/dist/esm/api/resources/customer/resources/businesses/resources/events/client/Client.d.mts +4 -4
- package/dist/esm/api/resources/customer/resources/businesses/resources/events/client/Client.mjs +16 -16
- package/dist/esm/api/resources/customer/resources/businesses/resources/events/client/requests/CancelRsvpEventsRequest.d.mts +2 -2
- package/dist/esm/api/resources/customer/resources/businesses/resources/events/client/requests/GetEventsRequest.d.mts +2 -2
- package/dist/esm/api/resources/customer/resources/businesses/resources/events/client/requests/ListEventsRequest.d.mts +2 -2
- package/dist/esm/api/resources/customer/resources/businesses/resources/events/client/requests/StoreEventRsvpRequest.d.mts +2 -2
- package/dist/esm/api/resources/customer/resources/cart/client/Client.d.mts +43 -35
- package/dist/esm/api/resources/customer/resources/cart/client/Client.mjs +105 -92
- package/dist/esm/api/resources/customer/resources/cart/client/requests/AddToCartRequest.d.mts +3 -2
- package/dist/esm/api/resources/customer/resources/cart/client/requests/CheckoutRequest.d.mts +3 -0
- package/dist/esm/api/resources/customer/resources/cart/client/requests/ClearCartRequest.d.mts +10 -0
- package/dist/esm/api/resources/customer/resources/cart/client/requests/ClearCartRequest.mjs +2 -0
- package/dist/esm/api/resources/customer/resources/cart/client/requests/CreatePaymentIntentRequest.d.mts +3 -0
- package/dist/esm/api/resources/customer/resources/cart/client/requests/GetCartRequest.d.mts +10 -0
- package/dist/esm/api/resources/customer/resources/cart/client/requests/GetCartRequest.mjs +2 -0
- package/dist/esm/api/resources/customer/resources/cart/client/requests/index.d.mts +2 -0
- package/dist/esm/api/resources/customer/resources/shop/client/Client.d.mts +3 -3
- package/dist/esm/api/resources/customer/resources/shop/client/Client.mjs +12 -12
- package/dist/esm/api/resources/customer/resources/shop/client/requests/GetProductShopRequest.d.mts +2 -2
- package/dist/esm/api/resources/customer/resources/shop/client/requests/ListCategoriesShopRequest.d.mts +2 -2
- package/dist/esm/api/resources/customer/resources/shop/client/requests/ListProductsShopRequest.d.mts +2 -2
- package/dist/esm/api/types/BusinessProduct.d.mts +1 -1
- package/dist/esm/api/types/BusinessProductVariant.d.mts +2 -0
- package/dist/esm/api/types/ReorderProductImagesRequest.d.mts +12 -0
- package/dist/esm/api/types/ReorderProductImagesRequest.mjs +2 -0
- package/dist/esm/api/types/StoreProductImageRequest.d.mts +4 -0
- package/dist/esm/api/types/StoreProductImageRequest.mjs +2 -0
- package/dist/esm/api/types/index.d.mts +2 -0
- package/dist/esm/api/types/index.mjs +2 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +23 -1
- package/reference.md +428 -82
|
@@ -67,23 +67,27 @@ class CartClient {
|
|
|
67
67
|
this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
|
|
68
68
|
}
|
|
69
69
|
/**
|
|
70
|
+
* @param {FiveOneEat.customer.GetCartRequest} request
|
|
70
71
|
* @param {CartClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
71
72
|
*
|
|
72
73
|
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
73
74
|
*
|
|
74
75
|
* @example
|
|
75
|
-
* await client.customer.cart.get(
|
|
76
|
+
* await client.customer.cart.get({
|
|
77
|
+
* business: "katzs-deli"
|
|
78
|
+
* })
|
|
76
79
|
*/
|
|
77
|
-
get(requestOptions) {
|
|
78
|
-
return core.HttpResponsePromise.fromPromise(this.__get(requestOptions));
|
|
80
|
+
get(request, requestOptions) {
|
|
81
|
+
return core.HttpResponsePromise.fromPromise(this.__get(request, requestOptions));
|
|
79
82
|
}
|
|
80
|
-
__get(requestOptions) {
|
|
83
|
+
__get(request, requestOptions) {
|
|
81
84
|
return __awaiter(this, void 0, void 0, function* () {
|
|
82
85
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
86
|
+
const { business } = request;
|
|
83
87
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
84
88
|
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
85
89
|
const _response = yield core.fetcher({
|
|
86
|
-
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.FiveOneEatEnvironment.Production,
|
|
90
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.FiveOneEatEnvironment.Production, `customer/businesses/${core.url.encodePathParam(business)}/cart`),
|
|
87
91
|
method: "GET",
|
|
88
92
|
headers: _headers,
|
|
89
93
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
@@ -108,7 +112,7 @@ class CartClient {
|
|
|
108
112
|
});
|
|
109
113
|
}
|
|
110
114
|
}
|
|
111
|
-
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/customer/cart");
|
|
115
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/customer/businesses/{business}/cart");
|
|
112
116
|
});
|
|
113
117
|
}
|
|
114
118
|
/**
|
|
@@ -120,7 +124,7 @@ class CartClient {
|
|
|
120
124
|
*
|
|
121
125
|
* @example
|
|
122
126
|
* await client.customer.cart.addItem({
|
|
123
|
-
*
|
|
127
|
+
* business: "katzs-deli",
|
|
124
128
|
* product_id: 1,
|
|
125
129
|
* quantity: 1
|
|
126
130
|
* })
|
|
@@ -131,16 +135,17 @@ class CartClient {
|
|
|
131
135
|
__addItem(request, requestOptions) {
|
|
132
136
|
return __awaiter(this, void 0, void 0, function* () {
|
|
133
137
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
138
|
+
const { business } = request, _body = __rest(request, ["business"]);
|
|
134
139
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
135
140
|
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
136
141
|
const _response = yield core.fetcher({
|
|
137
|
-
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.FiveOneEatEnvironment.Production,
|
|
142
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.FiveOneEatEnvironment.Production, `customer/businesses/${core.url.encodePathParam(business)}/cart`),
|
|
138
143
|
method: "POST",
|
|
139
144
|
headers: _headers,
|
|
140
145
|
contentType: "application/json",
|
|
141
146
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
142
147
|
requestType: "json",
|
|
143
|
-
body:
|
|
148
|
+
body: _body,
|
|
144
149
|
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
145
150
|
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
146
151
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -167,27 +172,31 @@ class CartClient {
|
|
|
167
172
|
});
|
|
168
173
|
}
|
|
169
174
|
}
|
|
170
|
-
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/customer/cart");
|
|
175
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/customer/businesses/{business}/cart");
|
|
171
176
|
});
|
|
172
177
|
}
|
|
173
178
|
/**
|
|
179
|
+
* @param {FiveOneEat.customer.ClearCartRequest} request
|
|
174
180
|
* @param {CartClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
175
181
|
*
|
|
176
182
|
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
177
183
|
*
|
|
178
184
|
* @example
|
|
179
|
-
* await client.customer.cart.clear(
|
|
185
|
+
* await client.customer.cart.clear({
|
|
186
|
+
* business: "katzs-deli"
|
|
187
|
+
* })
|
|
180
188
|
*/
|
|
181
|
-
clear(requestOptions) {
|
|
182
|
-
return core.HttpResponsePromise.fromPromise(this.__clear(requestOptions));
|
|
189
|
+
clear(request, requestOptions) {
|
|
190
|
+
return core.HttpResponsePromise.fromPromise(this.__clear(request, requestOptions));
|
|
183
191
|
}
|
|
184
|
-
__clear(requestOptions) {
|
|
192
|
+
__clear(request, requestOptions) {
|
|
185
193
|
return __awaiter(this, void 0, void 0, function* () {
|
|
186
194
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
195
|
+
const { business } = request;
|
|
187
196
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
188
197
|
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
189
198
|
const _response = yield core.fetcher({
|
|
190
|
-
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.FiveOneEatEnvironment.Production,
|
|
199
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.FiveOneEatEnvironment.Production, `customer/businesses/${core.url.encodePathParam(business)}/cart`),
|
|
191
200
|
method: "DELETE",
|
|
192
201
|
headers: _headers,
|
|
193
202
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
@@ -215,35 +224,44 @@ class CartClient {
|
|
|
215
224
|
});
|
|
216
225
|
}
|
|
217
226
|
}
|
|
218
|
-
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "DELETE", "/customer/cart");
|
|
227
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "DELETE", "/customer/businesses/{business}/cart");
|
|
219
228
|
});
|
|
220
229
|
}
|
|
221
230
|
/**
|
|
222
|
-
*
|
|
231
|
+
* Returns client_secret, price breakdown, and tax calculation for use with Stripe SDK.
|
|
232
|
+
*
|
|
233
|
+
* @param {FiveOneEat.customer.CreatePaymentIntentRequest} request
|
|
223
234
|
* @param {CartClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
224
235
|
*
|
|
225
236
|
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
226
|
-
* @throws {@link FiveOneEat.NotFoundError}
|
|
227
237
|
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
238
|
+
* @throws {@link FiveOneEat.InternalServerError}
|
|
239
|
+
* @throws {@link FiveOneEat.ServiceUnavailableError}
|
|
228
240
|
*
|
|
229
241
|
* @example
|
|
230
|
-
* await client.customer.cart.
|
|
231
|
-
*
|
|
232
|
-
*
|
|
242
|
+
* await client.customer.cart.createPaymentIntent({
|
|
243
|
+
* business: "katzs-deli",
|
|
244
|
+
* billing_address: {
|
|
245
|
+
* line1: "line1",
|
|
246
|
+
* city: "city",
|
|
247
|
+
* state: "state",
|
|
248
|
+
* postal_code: "postal_code",
|
|
249
|
+
* country: "country"
|
|
250
|
+
* }
|
|
233
251
|
* })
|
|
234
252
|
*/
|
|
235
|
-
|
|
236
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
253
|
+
createPaymentIntent(request, requestOptions) {
|
|
254
|
+
return core.HttpResponsePromise.fromPromise(this.__createPaymentIntent(request, requestOptions));
|
|
237
255
|
}
|
|
238
|
-
|
|
256
|
+
__createPaymentIntent(request, requestOptions) {
|
|
239
257
|
return __awaiter(this, void 0, void 0, function* () {
|
|
240
258
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
241
|
-
const {
|
|
259
|
+
const { business } = request, _body = __rest(request, ["business"]);
|
|
242
260
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
243
261
|
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
244
262
|
const _response = yield core.fetcher({
|
|
245
|
-
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.FiveOneEatEnvironment.Production, `customer/
|
|
246
|
-
method: "
|
|
263
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.FiveOneEatEnvironment.Production, `customer/businesses/${core.url.encodePathParam(business)}/cart/payment-intent`),
|
|
264
|
+
method: "POST",
|
|
247
265
|
headers: _headers,
|
|
248
266
|
contentType: "application/json",
|
|
249
267
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
@@ -265,10 +283,12 @@ class CartClient {
|
|
|
265
283
|
switch (_response.error.statusCode) {
|
|
266
284
|
case 401:
|
|
267
285
|
throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
268
|
-
case 404:
|
|
269
|
-
throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
|
|
270
286
|
case 422:
|
|
271
287
|
throw new FiveOneEat.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
288
|
+
case 500:
|
|
289
|
+
throw new FiveOneEat.InternalServerError(_response.error.body, _response.rawResponse);
|
|
290
|
+
case 503:
|
|
291
|
+
throw new FiveOneEat.ServiceUnavailableError(_response.error.body, _response.rawResponse);
|
|
272
292
|
default:
|
|
273
293
|
throw new errors.FiveOneEatError({
|
|
274
294
|
statusCode: _response.error.statusCode,
|
|
@@ -277,35 +297,49 @@ class CartClient {
|
|
|
277
297
|
});
|
|
278
298
|
}
|
|
279
299
|
}
|
|
280
|
-
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "
|
|
300
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/customer/businesses/{business}/cart/payment-intent");
|
|
281
301
|
});
|
|
282
302
|
}
|
|
283
303
|
/**
|
|
284
|
-
*
|
|
304
|
+
* Verifies the Stripe payment intent, creates the order, decrements inventory,
|
|
305
|
+
* clears the cart, and dispatches order confirmation notifications.
|
|
306
|
+
*
|
|
307
|
+
* @param {FiveOneEat.customer.CheckoutRequest} request
|
|
285
308
|
* @param {CartClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
286
309
|
*
|
|
287
310
|
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
288
|
-
* @throws {@link FiveOneEat.
|
|
311
|
+
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
289
312
|
*
|
|
290
313
|
* @example
|
|
291
|
-
* await client.customer.cart.
|
|
292
|
-
*
|
|
314
|
+
* await client.customer.cart.checkout({
|
|
315
|
+
* business: "katzs-deli",
|
|
316
|
+
* payment_intent_id: "payment_intent_id",
|
|
317
|
+
* billing_address: {
|
|
318
|
+
* line1: "line1",
|
|
319
|
+
* city: "city",
|
|
320
|
+
* state: "state",
|
|
321
|
+
* postal_code: "postal_code",
|
|
322
|
+
* country: "country"
|
|
323
|
+
* }
|
|
293
324
|
* })
|
|
294
325
|
*/
|
|
295
|
-
|
|
296
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
326
|
+
checkout(request, requestOptions) {
|
|
327
|
+
return core.HttpResponsePromise.fromPromise(this.__checkout(request, requestOptions));
|
|
297
328
|
}
|
|
298
|
-
|
|
329
|
+
__checkout(request, requestOptions) {
|
|
299
330
|
return __awaiter(this, void 0, void 0, function* () {
|
|
300
331
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
301
|
-
const {
|
|
332
|
+
const { business } = request, _body = __rest(request, ["business"]);
|
|
302
333
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
303
334
|
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
304
335
|
const _response = yield core.fetcher({
|
|
305
|
-
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.FiveOneEatEnvironment.Production, `customer/
|
|
306
|
-
method: "
|
|
336
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.FiveOneEatEnvironment.Production, `customer/businesses/${core.url.encodePathParam(business)}/cart/checkout`),
|
|
337
|
+
method: "POST",
|
|
307
338
|
headers: _headers,
|
|
339
|
+
contentType: "application/json",
|
|
308
340
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
341
|
+
requestType: "json",
|
|
342
|
+
body: _body,
|
|
309
343
|
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
310
344
|
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
311
345
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -322,8 +356,8 @@ class CartClient {
|
|
|
322
356
|
switch (_response.error.statusCode) {
|
|
323
357
|
case 401:
|
|
324
358
|
throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
325
|
-
case
|
|
326
|
-
throw new FiveOneEat.
|
|
359
|
+
case 422:
|
|
360
|
+
throw new FiveOneEat.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
327
361
|
default:
|
|
328
362
|
throw new errors.FiveOneEatError({
|
|
329
363
|
statusCode: _response.error.statusCode,
|
|
@@ -332,47 +366,40 @@ class CartClient {
|
|
|
332
366
|
});
|
|
333
367
|
}
|
|
334
368
|
}
|
|
335
|
-
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "
|
|
369
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/customer/businesses/{business}/cart/checkout");
|
|
336
370
|
});
|
|
337
371
|
}
|
|
338
372
|
/**
|
|
339
|
-
*
|
|
340
|
-
*
|
|
341
|
-
* @param {FiveOneEat.customer.CreatePaymentIntentRequest} request
|
|
373
|
+
* @param {FiveOneEat.customer.UpdateCartItemRequest} request
|
|
342
374
|
* @param {CartClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
343
375
|
*
|
|
344
376
|
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
377
|
+
* @throws {@link FiveOneEat.NotFoundError}
|
|
345
378
|
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
346
|
-
* @throws {@link FiveOneEat.InternalServerError}
|
|
347
|
-
* @throws {@link FiveOneEat.ServiceUnavailableError}
|
|
348
379
|
*
|
|
349
380
|
* @example
|
|
350
|
-
* await client.customer.cart.
|
|
351
|
-
*
|
|
352
|
-
*
|
|
353
|
-
* city: "city",
|
|
354
|
-
* state: "state",
|
|
355
|
-
* postal_code: "postal_code",
|
|
356
|
-
* country: "country"
|
|
357
|
-
* }
|
|
381
|
+
* await client.customer.cart.updateItem({
|
|
382
|
+
* cartItem: "cartItem",
|
|
383
|
+
* quantity: 1
|
|
358
384
|
* })
|
|
359
385
|
*/
|
|
360
|
-
|
|
361
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
386
|
+
updateItem(request, requestOptions) {
|
|
387
|
+
return core.HttpResponsePromise.fromPromise(this.__updateItem(request, requestOptions));
|
|
362
388
|
}
|
|
363
|
-
|
|
389
|
+
__updateItem(request, requestOptions) {
|
|
364
390
|
return __awaiter(this, void 0, void 0, function* () {
|
|
365
391
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
392
|
+
const { cartItem } = request, _body = __rest(request, ["cartItem"]);
|
|
366
393
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
367
394
|
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
368
395
|
const _response = yield core.fetcher({
|
|
369
|
-
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.FiveOneEatEnvironment.Production,
|
|
370
|
-
method: "
|
|
396
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.FiveOneEatEnvironment.Production, `customer/cart/items/${core.url.encodePathParam(cartItem)}`),
|
|
397
|
+
method: "PUT",
|
|
371
398
|
headers: _headers,
|
|
372
399
|
contentType: "application/json",
|
|
373
400
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
374
401
|
requestType: "json",
|
|
375
|
-
body:
|
|
402
|
+
body: _body,
|
|
376
403
|
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
377
404
|
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
378
405
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -389,12 +416,10 @@ class CartClient {
|
|
|
389
416
|
switch (_response.error.statusCode) {
|
|
390
417
|
case 401:
|
|
391
418
|
throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
419
|
+
case 404:
|
|
420
|
+
throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
|
|
392
421
|
case 422:
|
|
393
422
|
throw new FiveOneEat.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
394
|
-
case 500:
|
|
395
|
-
throw new FiveOneEat.InternalServerError(_response.error.body, _response.rawResponse);
|
|
396
|
-
case 503:
|
|
397
|
-
throw new FiveOneEat.ServiceUnavailableError(_response.error.body, _response.rawResponse);
|
|
398
423
|
default:
|
|
399
424
|
throw new errors.FiveOneEatError({
|
|
400
425
|
statusCode: _response.error.statusCode,
|
|
@@ -403,47 +428,35 @@ class CartClient {
|
|
|
403
428
|
});
|
|
404
429
|
}
|
|
405
430
|
}
|
|
406
|
-
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "
|
|
431
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "PUT", "/customer/cart/items/{cartItem}");
|
|
407
432
|
});
|
|
408
433
|
}
|
|
409
434
|
/**
|
|
410
|
-
*
|
|
411
|
-
* clears the cart, and dispatches order confirmation notifications.
|
|
412
|
-
*
|
|
413
|
-
* @param {FiveOneEat.customer.CheckoutRequest} request
|
|
435
|
+
* @param {FiveOneEat.customer.RemoveItemCartRequest} request
|
|
414
436
|
* @param {CartClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
415
437
|
*
|
|
416
438
|
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
417
|
-
* @throws {@link FiveOneEat.
|
|
439
|
+
* @throws {@link FiveOneEat.NotFoundError}
|
|
418
440
|
*
|
|
419
441
|
* @example
|
|
420
|
-
* await client.customer.cart.
|
|
421
|
-
*
|
|
422
|
-
* billing_address: {
|
|
423
|
-
* line1: "line1",
|
|
424
|
-
* city: "city",
|
|
425
|
-
* state: "state",
|
|
426
|
-
* postal_code: "postal_code",
|
|
427
|
-
* country: "country"
|
|
428
|
-
* }
|
|
442
|
+
* await client.customer.cart.removeItem({
|
|
443
|
+
* cartItem: "cartItem"
|
|
429
444
|
* })
|
|
430
445
|
*/
|
|
431
|
-
|
|
432
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
446
|
+
removeItem(request, requestOptions) {
|
|
447
|
+
return core.HttpResponsePromise.fromPromise(this.__removeItem(request, requestOptions));
|
|
433
448
|
}
|
|
434
|
-
|
|
449
|
+
__removeItem(request, requestOptions) {
|
|
435
450
|
return __awaiter(this, void 0, void 0, function* () {
|
|
436
451
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
452
|
+
const { cartItem } = request;
|
|
437
453
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
438
454
|
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
439
455
|
const _response = yield core.fetcher({
|
|
440
|
-
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.FiveOneEatEnvironment.Production,
|
|
441
|
-
method: "
|
|
456
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.FiveOneEatEnvironment.Production, `customer/cart/items/${core.url.encodePathParam(cartItem)}`),
|
|
457
|
+
method: "DELETE",
|
|
442
458
|
headers: _headers,
|
|
443
|
-
contentType: "application/json",
|
|
444
459
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
445
|
-
requestType: "json",
|
|
446
|
-
body: request,
|
|
447
460
|
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
448
461
|
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
449
462
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -460,8 +473,8 @@ class CartClient {
|
|
|
460
473
|
switch (_response.error.statusCode) {
|
|
461
474
|
case 401:
|
|
462
475
|
throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
463
|
-
case
|
|
464
|
-
throw new FiveOneEat.
|
|
476
|
+
case 404:
|
|
477
|
+
throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
|
|
465
478
|
default:
|
|
466
479
|
throw new errors.FiveOneEatError({
|
|
467
480
|
statusCode: _response.error.statusCode,
|
|
@@ -470,7 +483,7 @@ class CartClient {
|
|
|
470
483
|
});
|
|
471
484
|
}
|
|
472
485
|
}
|
|
473
|
-
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "
|
|
486
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "DELETE", "/customer/cart/items/{cartItem}");
|
|
474
487
|
});
|
|
475
488
|
}
|
|
476
489
|
}
|
package/dist/cjs/api/resources/customer/resources/cart/client/requests/AddToCartRequest.d.ts
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @example
|
|
3
3
|
* {
|
|
4
|
-
*
|
|
4
|
+
* business: "katzs-deli",
|
|
5
5
|
* product_id: 1,
|
|
6
6
|
* quantity: 1
|
|
7
7
|
* }
|
|
8
8
|
*/
|
|
9
9
|
export interface AddToCartRequest {
|
|
10
|
-
|
|
10
|
+
/** The business handle */
|
|
11
|
+
business: string;
|
|
11
12
|
product_id: number;
|
|
12
13
|
variant_id?: number | null;
|
|
13
14
|
quantity: number;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @example
|
|
3
3
|
* {
|
|
4
|
+
* business: "katzs-deli",
|
|
4
5
|
* payment_intent_id: "payment_intent_id",
|
|
5
6
|
* billing_address: {
|
|
6
7
|
* line1: "line1",
|
|
@@ -12,6 +13,8 @@
|
|
|
12
13
|
* }
|
|
13
14
|
*/
|
|
14
15
|
export interface CheckoutRequest {
|
|
16
|
+
/** The business handle */
|
|
17
|
+
business: string;
|
|
15
18
|
payment_intent_id: string;
|
|
16
19
|
fulfillment_method?: CheckoutRequest.FulfillmentMethod | null;
|
|
17
20
|
pickup_date?: CheckoutRequest.PickupDate | null;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @example
|
|
3
3
|
* {
|
|
4
|
+
* business: "katzs-deli",
|
|
4
5
|
* billing_address: {
|
|
5
6
|
* line1: "line1",
|
|
6
7
|
* city: "city",
|
|
@@ -11,6 +12,8 @@
|
|
|
11
12
|
* }
|
|
12
13
|
*/
|
|
13
14
|
export interface CreatePaymentIntentRequest {
|
|
15
|
+
/** The business handle */
|
|
16
|
+
business: string;
|
|
14
17
|
fulfillment_method?: CreatePaymentIntentRequest.FulfillmentMethod | null;
|
|
15
18
|
pickup_date?: CreatePaymentIntentRequest.PickupDate | null;
|
|
16
19
|
pickup_time?: string | null;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export type { AddToCartRequest } from "./AddToCartRequest.js";
|
|
2
2
|
export { CheckoutRequest } from "./CheckoutRequest.js";
|
|
3
|
+
export type { ClearCartRequest } from "./ClearCartRequest.js";
|
|
3
4
|
export { CreatePaymentIntentRequest } from "./CreatePaymentIntentRequest.js";
|
|
5
|
+
export type { GetCartRequest } from "./GetCartRequest.js";
|
|
4
6
|
export type { RemoveItemCartRequest } from "./RemoveItemCartRequest.js";
|
|
5
7
|
export type { UpdateCartItemRequest } from "./UpdateCartItemRequest.js";
|
|
@@ -18,7 +18,7 @@ export declare class ShopClient {
|
|
|
18
18
|
*
|
|
19
19
|
* @example
|
|
20
20
|
* await client.customer.shop.listProducts({
|
|
21
|
-
*
|
|
21
|
+
* business: "katzs-deli"
|
|
22
22
|
* })
|
|
23
23
|
*/
|
|
24
24
|
listProducts(request: FiveOneEat.customer.ListProductsShopRequest, requestOptions?: ShopClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.customer.ListProductsShopResponse>;
|
|
@@ -31,7 +31,7 @@ export declare class ShopClient {
|
|
|
31
31
|
*
|
|
32
32
|
* @example
|
|
33
33
|
* await client.customer.shop.getProduct({
|
|
34
|
-
*
|
|
34
|
+
* business: "katzs-deli",
|
|
35
35
|
* product: "product"
|
|
36
36
|
* })
|
|
37
37
|
*/
|
|
@@ -45,7 +45,7 @@ export declare class ShopClient {
|
|
|
45
45
|
*
|
|
46
46
|
* @example
|
|
47
47
|
* await client.customer.shop.listCategories({
|
|
48
|
-
*
|
|
48
|
+
* business: "katzs-deli"
|
|
49
49
|
* })
|
|
50
50
|
*/
|
|
51
51
|
listCategories(request: FiveOneEat.customer.ListCategoriesShopRequest, requestOptions?: ShopClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.customer.ListCategoriesShopResponse>;
|
|
@@ -63,7 +63,7 @@ class ShopClient {
|
|
|
63
63
|
*
|
|
64
64
|
* @example
|
|
65
65
|
* await client.customer.shop.listProducts({
|
|
66
|
-
*
|
|
66
|
+
* business: "katzs-deli"
|
|
67
67
|
* })
|
|
68
68
|
*/
|
|
69
69
|
listProducts(request, requestOptions) {
|
|
@@ -72,7 +72,7 @@ class ShopClient {
|
|
|
72
72
|
__listProducts(request, requestOptions) {
|
|
73
73
|
return __awaiter(this, void 0, void 0, function* () {
|
|
74
74
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
75
|
-
const {
|
|
75
|
+
const { business, category_id: categoryId, featured } = request;
|
|
76
76
|
const _queryParams = {
|
|
77
77
|
category_id: categoryId,
|
|
78
78
|
featured,
|
|
@@ -80,7 +80,7 @@ class ShopClient {
|
|
|
80
80
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
81
81
|
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
82
82
|
const _response = yield core.fetcher({
|
|
83
|
-
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.FiveOneEatEnvironment.Production, `customer/businesses/${core.url.encodePathParam(
|
|
83
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.FiveOneEatEnvironment.Production, `customer/businesses/${core.url.encodePathParam(business)}/shop`),
|
|
84
84
|
method: "GET",
|
|
85
85
|
headers: _headers,
|
|
86
86
|
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
@@ -113,7 +113,7 @@ class ShopClient {
|
|
|
113
113
|
});
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
|
-
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/customer/businesses/{
|
|
116
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/customer/businesses/{business}/shop");
|
|
117
117
|
});
|
|
118
118
|
}
|
|
119
119
|
/**
|
|
@@ -124,7 +124,7 @@ class ShopClient {
|
|
|
124
124
|
*
|
|
125
125
|
* @example
|
|
126
126
|
* await client.customer.shop.getProduct({
|
|
127
|
-
*
|
|
127
|
+
* business: "katzs-deli",
|
|
128
128
|
* product: "product"
|
|
129
129
|
* })
|
|
130
130
|
*/
|
|
@@ -134,11 +134,11 @@ class ShopClient {
|
|
|
134
134
|
__getProduct(request, requestOptions) {
|
|
135
135
|
return __awaiter(this, void 0, void 0, function* () {
|
|
136
136
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
137
|
-
const {
|
|
137
|
+
const { business, product } = request;
|
|
138
138
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
139
139
|
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
140
140
|
const _response = yield core.fetcher({
|
|
141
|
-
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.FiveOneEatEnvironment.Production, `customer/businesses/${core.url.encodePathParam(
|
|
141
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.FiveOneEatEnvironment.Production, `customer/businesses/${core.url.encodePathParam(business)}/shop/products/${core.url.encodePathParam(product)}`),
|
|
142
142
|
method: "GET",
|
|
143
143
|
headers: _headers,
|
|
144
144
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
@@ -166,7 +166,7 @@ class ShopClient {
|
|
|
166
166
|
});
|
|
167
167
|
}
|
|
168
168
|
}
|
|
169
|
-
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/customer/businesses/{
|
|
169
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/customer/businesses/{business}/shop/products/{product}");
|
|
170
170
|
});
|
|
171
171
|
}
|
|
172
172
|
/**
|
|
@@ -177,7 +177,7 @@ class ShopClient {
|
|
|
177
177
|
*
|
|
178
178
|
* @example
|
|
179
179
|
* await client.customer.shop.listCategories({
|
|
180
|
-
*
|
|
180
|
+
* business: "katzs-deli"
|
|
181
181
|
* })
|
|
182
182
|
*/
|
|
183
183
|
listCategories(request, requestOptions) {
|
|
@@ -186,11 +186,11 @@ class ShopClient {
|
|
|
186
186
|
__listCategories(request, requestOptions) {
|
|
187
187
|
return __awaiter(this, void 0, void 0, function* () {
|
|
188
188
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
189
|
-
const {
|
|
189
|
+
const { business } = request;
|
|
190
190
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
191
191
|
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
192
192
|
const _response = yield core.fetcher({
|
|
193
|
-
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.FiveOneEatEnvironment.Production, `customer/businesses/${core.url.encodePathParam(
|
|
193
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.FiveOneEatEnvironment.Production, `customer/businesses/${core.url.encodePathParam(business)}/shop/categories`),
|
|
194
194
|
method: "GET",
|
|
195
195
|
headers: _headers,
|
|
196
196
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
@@ -218,7 +218,7 @@ class ShopClient {
|
|
|
218
218
|
});
|
|
219
219
|
}
|
|
220
220
|
}
|
|
221
|
-
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/customer/businesses/{
|
|
221
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/customer/businesses/{business}/shop/categories");
|
|
222
222
|
});
|
|
223
223
|
}
|
|
224
224
|
}
|