@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
package/dist/cjs/api/resources/customer/resources/shop/client/requests/GetProductShopRequest.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @example
|
|
3
3
|
* {
|
|
4
|
-
*
|
|
4
|
+
* business: "katzs-deli",
|
|
5
5
|
* product: "product"
|
|
6
6
|
* }
|
|
7
7
|
*/
|
|
8
8
|
export interface GetProductShopRequest {
|
|
9
9
|
/** The business handle */
|
|
10
|
-
|
|
10
|
+
business: string;
|
|
11
11
|
/** The product ID */
|
|
12
12
|
product: string;
|
|
13
13
|
}
|
package/dist/cjs/api/resources/customer/resources/shop/client/requests/ListProductsShopRequest.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @example
|
|
3
3
|
* {
|
|
4
|
-
*
|
|
4
|
+
* business: "katzs-deli"
|
|
5
5
|
* }
|
|
6
6
|
*/
|
|
7
7
|
export interface ListProductsShopRequest {
|
|
8
8
|
/** The business handle */
|
|
9
|
-
|
|
9
|
+
business: string;
|
|
10
10
|
/** Filter by product category ID */
|
|
11
11
|
category_id?: string;
|
|
12
12
|
/** Return only featured products */
|
|
@@ -25,7 +25,7 @@ export interface BusinessProduct {
|
|
|
25
25
|
is_featured: boolean;
|
|
26
26
|
sort_order: number;
|
|
27
27
|
variants?: FiveOneEat.BusinessProductVariant[] | undefined;
|
|
28
|
-
images?:
|
|
28
|
+
images?: FiveOneEat.BusinessPhoto[] | undefined;
|
|
29
29
|
categories?: FiveOneEat.BusinessProductCategory[] | undefined;
|
|
30
30
|
created_at: string | null;
|
|
31
31
|
updated_at: string | null;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type * as FiveOneEat from "../index.js";
|
|
1
2
|
export interface BusinessProductVariant {
|
|
2
3
|
id: string;
|
|
3
4
|
product_id: string;
|
|
@@ -14,6 +15,7 @@ export interface BusinessProductVariant {
|
|
|
14
15
|
weight_unit: string | null;
|
|
15
16
|
requires_shipping: boolean;
|
|
16
17
|
is_default: boolean;
|
|
18
|
+
images?: FiveOneEat.BusinessPhoto[] | undefined;
|
|
17
19
|
sort_order: number;
|
|
18
20
|
created_at: string | null;
|
|
19
21
|
updated_at: string | null;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface ReorderProductImagesRequest {
|
|
2
|
+
images: ReorderProductImagesRequest.Images.Item[];
|
|
3
|
+
}
|
|
4
|
+
export declare namespace ReorderProductImagesRequest {
|
|
5
|
+
type Images = Images.Item[];
|
|
6
|
+
namespace Images {
|
|
7
|
+
interface Item {
|
|
8
|
+
id: string;
|
|
9
|
+
sort_order: number;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -121,11 +121,13 @@ export * from "./Message.js";
|
|
|
121
121
|
export * from "./NotFoundErrorBody.js";
|
|
122
122
|
export * from "./PaginationResource.js";
|
|
123
123
|
export * from "./ProductSearchResult.js";
|
|
124
|
+
export * from "./ReorderProductImagesRequest.js";
|
|
124
125
|
export * from "./RsvpEvent.js";
|
|
125
126
|
export * from "./RsvpItem.js";
|
|
126
127
|
export * from "./RsvpResponse.js";
|
|
127
128
|
export * from "./SearchResults.js";
|
|
128
129
|
export * from "./ServiceUnavailableErrorBody.js";
|
|
130
|
+
export * from "./StoreProductImageRequest.js";
|
|
129
131
|
export * from "./Ticket.js";
|
|
130
132
|
export * from "./TicketOrder.js";
|
|
131
133
|
export * from "./TicketOrderResponse.js";
|
|
@@ -137,11 +137,13 @@ __exportStar(require("./Message.js"), exports);
|
|
|
137
137
|
__exportStar(require("./NotFoundErrorBody.js"), exports);
|
|
138
138
|
__exportStar(require("./PaginationResource.js"), exports);
|
|
139
139
|
__exportStar(require("./ProductSearchResult.js"), exports);
|
|
140
|
+
__exportStar(require("./ReorderProductImagesRequest.js"), exports);
|
|
140
141
|
__exportStar(require("./RsvpEvent.js"), exports);
|
|
141
142
|
__exportStar(require("./RsvpItem.js"), exports);
|
|
142
143
|
__exportStar(require("./RsvpResponse.js"), exports);
|
|
143
144
|
__exportStar(require("./SearchResults.js"), exports);
|
|
144
145
|
__exportStar(require("./ServiceUnavailableErrorBody.js"), exports);
|
|
146
|
+
__exportStar(require("./StoreProductImageRequest.js"), exports);
|
|
145
147
|
__exportStar(require("./Ticket.js"), exports);
|
|
146
148
|
__exportStar(require("./TicketOrder.js"), exports);
|
|
147
149
|
__exportStar(require("./TicketOrderResponse.js"), exports);
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.0.
|
|
1
|
+
export declare const SDK_VERSION = "0.0.44";
|
package/dist/cjs/version.js
CHANGED
package/dist/esm/BaseClient.mjs
CHANGED
|
@@ -6,8 +6,8 @@ export function normalizeClientOptions(options) {
|
|
|
6
6
|
const headers = mergeHeaders({
|
|
7
7
|
"X-Fern-Language": "JavaScript",
|
|
8
8
|
"X-Fern-SDK-Name": "@51eat/sdk",
|
|
9
|
-
"X-Fern-SDK-Version": "0.0.
|
|
10
|
-
"User-Agent": "@51eat/sdk/0.0.
|
|
9
|
+
"X-Fern-SDK-Version": "0.0.44",
|
|
10
|
+
"User-Agent": "@51eat/sdk/0.0.44",
|
|
11
11
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
12
12
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
13
13
|
}, options === null || options === void 0 ? void 0 : options.headers);
|
|
@@ -2,6 +2,7 @@ import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../Ba
|
|
|
2
2
|
import { type NormalizedClientOptionsWithAuth } from "../../../../../../BaseClient.mjs";
|
|
3
3
|
import * as core from "../../../../../../core/index.mjs";
|
|
4
4
|
import * as FiveOneEat from "../../../../../index.mjs";
|
|
5
|
+
import { ImagesClient } from "../resources/images/client/Client.mjs";
|
|
5
6
|
import { VariantsClient } from "../resources/variants/client/Client.mjs";
|
|
6
7
|
export declare namespace ProductsClient {
|
|
7
8
|
type Options = BaseClientOptions;
|
|
@@ -11,8 +12,10 @@ export declare namespace ProductsClient {
|
|
|
11
12
|
export declare class ProductsClient {
|
|
12
13
|
protected readonly _options: NormalizedClientOptionsWithAuth<ProductsClient.Options>;
|
|
13
14
|
protected _variants: VariantsClient | undefined;
|
|
15
|
+
protected _images: ImagesClient | undefined;
|
|
14
16
|
constructor(options?: ProductsClient.Options);
|
|
15
17
|
get variants(): VariantsClient;
|
|
18
|
+
get images(): ImagesClient;
|
|
16
19
|
/**
|
|
17
20
|
* @param {ProductsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
18
21
|
*
|
|
@@ -26,6 +26,7 @@ import * as environments from "../../../../../../environments.mjs";
|
|
|
26
26
|
import { handleNonStatusCodeError } from "../../../../../../errors/handleNonStatusCodeError.mjs";
|
|
27
27
|
import * as errors from "../../../../../../errors/index.mjs";
|
|
28
28
|
import * as FiveOneEat from "../../../../../index.mjs";
|
|
29
|
+
import { ImagesClient } from "../resources/images/client/Client.mjs";
|
|
29
30
|
import { VariantsClient } from "../resources/variants/client/Client.mjs";
|
|
30
31
|
export class ProductsClient {
|
|
31
32
|
constructor(options = {}) {
|
|
@@ -35,6 +36,10 @@ export class ProductsClient {
|
|
|
35
36
|
var _a;
|
|
36
37
|
return ((_a = this._variants) !== null && _a !== void 0 ? _a : (this._variants = new VariantsClient(this._options)));
|
|
37
38
|
}
|
|
39
|
+
get images() {
|
|
40
|
+
var _a;
|
|
41
|
+
return ((_a = this._images) !== null && _a !== void 0 ? _a : (this._images = new ImagesClient(this._options)));
|
|
42
|
+
}
|
|
38
43
|
/**
|
|
39
44
|
* @param {ProductsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
40
45
|
*
|
package/dist/esm/api/resources/business/resources/products/resources/images/client/Client.d.mts
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../../../BaseClient.mjs";
|
|
2
|
+
import { type NormalizedClientOptionsWithAuth } from "../../../../../../../../BaseClient.mjs";
|
|
3
|
+
import * as core from "../../../../../../../../core/index.mjs";
|
|
4
|
+
import * as FiveOneEat from "../../../../../../../index.mjs";
|
|
5
|
+
export declare namespace ImagesClient {
|
|
6
|
+
type Options = BaseClientOptions;
|
|
7
|
+
interface RequestOptions extends BaseRequestOptions {
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
export declare class ImagesClient {
|
|
11
|
+
protected readonly _options: NormalizedClientOptionsWithAuth<ImagesClient.Options>;
|
|
12
|
+
constructor(options?: ImagesClient.Options);
|
|
13
|
+
/**
|
|
14
|
+
* @param {FiveOneEat.business.products.UploadImagesRequest} request
|
|
15
|
+
* @param {ImagesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
16
|
+
*
|
|
17
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
18
|
+
* @throws {@link FiveOneEat.ForbiddenError}
|
|
19
|
+
* @throws {@link FiveOneEat.NotFoundError}
|
|
20
|
+
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* import { createReadStream } from "fs";
|
|
24
|
+
* await client.business.products.images.upload({
|
|
25
|
+
* image: fs.createReadStream("/path/to/your/file"),
|
|
26
|
+
* product: "product"
|
|
27
|
+
* })
|
|
28
|
+
*/
|
|
29
|
+
upload(request: FiveOneEat.business.products.UploadImagesRequest, requestOptions?: ImagesClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.business.products.UploadImagesResponse>;
|
|
30
|
+
private __upload;
|
|
31
|
+
/**
|
|
32
|
+
* @param {FiveOneEat.business.products.ReorderImagesRequest} request
|
|
33
|
+
* @param {ImagesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
34
|
+
*
|
|
35
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
36
|
+
* @throws {@link FiveOneEat.ForbiddenError}
|
|
37
|
+
* @throws {@link FiveOneEat.NotFoundError}
|
|
38
|
+
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* await client.business.products.images.reorder({
|
|
42
|
+
* product: "product",
|
|
43
|
+
* body: {
|
|
44
|
+
* images: [{
|
|
45
|
+
* id: "id",
|
|
46
|
+
* sort_order: 1
|
|
47
|
+
* }]
|
|
48
|
+
* }
|
|
49
|
+
* })
|
|
50
|
+
*/
|
|
51
|
+
reorder(request: FiveOneEat.business.products.ReorderImagesRequest, requestOptions?: ImagesClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.business.products.ReorderImagesResponse>;
|
|
52
|
+
private __reorder;
|
|
53
|
+
/**
|
|
54
|
+
* @param {FiveOneEat.business.products.DeleteImagesRequest} request
|
|
55
|
+
* @param {ImagesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
56
|
+
*
|
|
57
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
58
|
+
* @throws {@link FiveOneEat.ForbiddenError}
|
|
59
|
+
* @throws {@link FiveOneEat.NotFoundError}
|
|
60
|
+
*
|
|
61
|
+
* @example
|
|
62
|
+
* await client.business.products.images.delete({
|
|
63
|
+
* product: "product",
|
|
64
|
+
* image: "image"
|
|
65
|
+
* })
|
|
66
|
+
*/
|
|
67
|
+
delete(request: FiveOneEat.business.products.DeleteImagesRequest, requestOptions?: ImagesClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.business.products.DeleteImagesResponse>;
|
|
68
|
+
private __delete;
|
|
69
|
+
}
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
import { normalizeClientOptionsWithAuth, } from "../../../../../../../../BaseClient.mjs";
|
|
12
|
+
import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../../../core/headers.mjs";
|
|
13
|
+
import * as core from "../../../../../../../../core/index.mjs";
|
|
14
|
+
import * as environments from "../../../../../../../../environments.mjs";
|
|
15
|
+
import { handleNonStatusCodeError } from "../../../../../../../../errors/handleNonStatusCodeError.mjs";
|
|
16
|
+
import * as errors from "../../../../../../../../errors/index.mjs";
|
|
17
|
+
import * as FiveOneEat from "../../../../../../../index.mjs";
|
|
18
|
+
export class ImagesClient {
|
|
19
|
+
constructor(options = {}) {
|
|
20
|
+
this._options = normalizeClientOptionsWithAuth(options);
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* @param {FiveOneEat.business.products.UploadImagesRequest} request
|
|
24
|
+
* @param {ImagesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
25
|
+
*
|
|
26
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
27
|
+
* @throws {@link FiveOneEat.ForbiddenError}
|
|
28
|
+
* @throws {@link FiveOneEat.NotFoundError}
|
|
29
|
+
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* import { createReadStream } from "fs";
|
|
33
|
+
* await client.business.products.images.upload({
|
|
34
|
+
* image: fs.createReadStream("/path/to/your/file"),
|
|
35
|
+
* product: "product"
|
|
36
|
+
* })
|
|
37
|
+
*/
|
|
38
|
+
upload(request, requestOptions) {
|
|
39
|
+
return core.HttpResponsePromise.fromPromise(this.__upload(request, requestOptions));
|
|
40
|
+
}
|
|
41
|
+
__upload(request, requestOptions) {
|
|
42
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
43
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
44
|
+
const _body = yield core.newFormData();
|
|
45
|
+
yield _body.appendFile("image", request.image);
|
|
46
|
+
if (request.alt_text != null) {
|
|
47
|
+
_body.append("alt_text", request.alt_text);
|
|
48
|
+
}
|
|
49
|
+
const _maybeEncodedRequest = yield _body.getRequest();
|
|
50
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
51
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders(Object.assign({}, _maybeEncodedRequest.headers)), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
52
|
+
const _response = yield core.fetcher({
|
|
53
|
+
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, `business/products/${core.url.encodePathParam(request.product)}/images`),
|
|
54
|
+
method: "POST",
|
|
55
|
+
headers: _headers,
|
|
56
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
57
|
+
requestType: "file",
|
|
58
|
+
duplex: _maybeEncodedRequest.duplex,
|
|
59
|
+
body: _maybeEncodedRequest.body,
|
|
60
|
+
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,
|
|
61
|
+
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,
|
|
62
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
63
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
64
|
+
logging: this._options.logging,
|
|
65
|
+
});
|
|
66
|
+
if (_response.ok) {
|
|
67
|
+
return {
|
|
68
|
+
data: _response.body,
|
|
69
|
+
rawResponse: _response.rawResponse,
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
if (_response.error.reason === "status-code") {
|
|
73
|
+
switch (_response.error.statusCode) {
|
|
74
|
+
case 401:
|
|
75
|
+
throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
76
|
+
case 403:
|
|
77
|
+
throw new FiveOneEat.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
78
|
+
case 404:
|
|
79
|
+
throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
|
|
80
|
+
case 422:
|
|
81
|
+
throw new FiveOneEat.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
82
|
+
default:
|
|
83
|
+
throw new errors.FiveOneEatError({
|
|
84
|
+
statusCode: _response.error.statusCode,
|
|
85
|
+
body: _response.error.body,
|
|
86
|
+
rawResponse: _response.rawResponse,
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/business/products/{product}/images");
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* @param {FiveOneEat.business.products.ReorderImagesRequest} request
|
|
95
|
+
* @param {ImagesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
96
|
+
*
|
|
97
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
98
|
+
* @throws {@link FiveOneEat.ForbiddenError}
|
|
99
|
+
* @throws {@link FiveOneEat.NotFoundError}
|
|
100
|
+
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
101
|
+
*
|
|
102
|
+
* @example
|
|
103
|
+
* await client.business.products.images.reorder({
|
|
104
|
+
* product: "product",
|
|
105
|
+
* body: {
|
|
106
|
+
* images: [{
|
|
107
|
+
* id: "id",
|
|
108
|
+
* sort_order: 1
|
|
109
|
+
* }]
|
|
110
|
+
* }
|
|
111
|
+
* })
|
|
112
|
+
*/
|
|
113
|
+
reorder(request, requestOptions) {
|
|
114
|
+
return core.HttpResponsePromise.fromPromise(this.__reorder(request, requestOptions));
|
|
115
|
+
}
|
|
116
|
+
__reorder(request, requestOptions) {
|
|
117
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
118
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
119
|
+
const { product, body: _body } = request;
|
|
120
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
121
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
122
|
+
const _response = yield core.fetcher({
|
|
123
|
+
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, `business/products/${core.url.encodePathParam(product)}/images/reorder`),
|
|
124
|
+
method: "PUT",
|
|
125
|
+
headers: _headers,
|
|
126
|
+
contentType: "application/json",
|
|
127
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
128
|
+
requestType: "json",
|
|
129
|
+
body: _body,
|
|
130
|
+
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,
|
|
131
|
+
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,
|
|
132
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
133
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
134
|
+
logging: this._options.logging,
|
|
135
|
+
});
|
|
136
|
+
if (_response.ok) {
|
|
137
|
+
return {
|
|
138
|
+
data: _response.body,
|
|
139
|
+
rawResponse: _response.rawResponse,
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
if (_response.error.reason === "status-code") {
|
|
143
|
+
switch (_response.error.statusCode) {
|
|
144
|
+
case 401:
|
|
145
|
+
throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
146
|
+
case 403:
|
|
147
|
+
throw new FiveOneEat.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
148
|
+
case 404:
|
|
149
|
+
throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
|
|
150
|
+
case 422:
|
|
151
|
+
throw new FiveOneEat.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
152
|
+
default:
|
|
153
|
+
throw new errors.FiveOneEatError({
|
|
154
|
+
statusCode: _response.error.statusCode,
|
|
155
|
+
body: _response.error.body,
|
|
156
|
+
rawResponse: _response.rawResponse,
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "PUT", "/business/products/{product}/images/reorder");
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* @param {FiveOneEat.business.products.DeleteImagesRequest} request
|
|
165
|
+
* @param {ImagesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
166
|
+
*
|
|
167
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
168
|
+
* @throws {@link FiveOneEat.ForbiddenError}
|
|
169
|
+
* @throws {@link FiveOneEat.NotFoundError}
|
|
170
|
+
*
|
|
171
|
+
* @example
|
|
172
|
+
* await client.business.products.images.delete({
|
|
173
|
+
* product: "product",
|
|
174
|
+
* image: "image"
|
|
175
|
+
* })
|
|
176
|
+
*/
|
|
177
|
+
delete(request, requestOptions) {
|
|
178
|
+
return core.HttpResponsePromise.fromPromise(this.__delete(request, requestOptions));
|
|
179
|
+
}
|
|
180
|
+
__delete(request, requestOptions) {
|
|
181
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
182
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
183
|
+
const { product, image } = request;
|
|
184
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
185
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
186
|
+
const _response = yield core.fetcher({
|
|
187
|
+
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, `business/products/${core.url.encodePathParam(product)}/images/${core.url.encodePathParam(image)}`),
|
|
188
|
+
method: "DELETE",
|
|
189
|
+
headers: _headers,
|
|
190
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
191
|
+
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,
|
|
192
|
+
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,
|
|
193
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
194
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
195
|
+
logging: this._options.logging,
|
|
196
|
+
});
|
|
197
|
+
if (_response.ok) {
|
|
198
|
+
return {
|
|
199
|
+
data: _response.body,
|
|
200
|
+
rawResponse: _response.rawResponse,
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
if (_response.error.reason === "status-code") {
|
|
204
|
+
switch (_response.error.statusCode) {
|
|
205
|
+
case 401:
|
|
206
|
+
throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
207
|
+
case 403:
|
|
208
|
+
throw new FiveOneEat.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
209
|
+
case 404:
|
|
210
|
+
throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
|
|
211
|
+
default:
|
|
212
|
+
throw new errors.FiveOneEatError({
|
|
213
|
+
statusCode: _response.error.statusCode,
|
|
214
|
+
body: _response.error.body,
|
|
215
|
+
rawResponse: _response.rawResponse,
|
|
216
|
+
});
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/business/products/{product}/images/{image}");
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
}
|
package/dist/esm/api/resources/business/resources/products/resources/images/client/index.d.mts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./requests/index.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./requests/index.mjs";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type * as FiveOneEat from "../../../../../../../../index.mjs";
|
|
2
|
+
/**
|
|
3
|
+
* @example
|
|
4
|
+
* {
|
|
5
|
+
* product: "product",
|
|
6
|
+
* body: {
|
|
7
|
+
* images: [{
|
|
8
|
+
* id: "id",
|
|
9
|
+
* sort_order: 1
|
|
10
|
+
* }]
|
|
11
|
+
* }
|
|
12
|
+
* }
|
|
13
|
+
*/
|
|
14
|
+
export interface ReorderImagesRequest {
|
|
15
|
+
/** The product ID */
|
|
16
|
+
product: string;
|
|
17
|
+
body: FiveOneEat.ReorderProductImagesRequest;
|
|
18
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type * as core from "../../../../../../../../../core/index.mjs";
|
|
2
|
+
/**
|
|
3
|
+
* @example
|
|
4
|
+
* {
|
|
5
|
+
* image: fs.createReadStream("/path/to/your/file"),
|
|
6
|
+
* product: "product"
|
|
7
|
+
* }
|
|
8
|
+
*/
|
|
9
|
+
export interface UploadImagesRequest {
|
|
10
|
+
/** The product ID */
|
|
11
|
+
product: string;
|
|
12
|
+
image: core.file.Uploadable;
|
|
13
|
+
alt_text?: string | null;
|
|
14
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface DeleteImagesResponse {
|
|
2
|
+
message: DeleteImagesResponse.Message;
|
|
3
|
+
}
|
|
4
|
+
export declare namespace DeleteImagesResponse {
|
|
5
|
+
const Message: {
|
|
6
|
+
readonly ImageDeletedSuccessfully: "Image deleted successfully.";
|
|
7
|
+
};
|
|
8
|
+
type Message = (typeof Message)[keyof typeof Message];
|
|
9
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
export var DeleteImagesResponse;
|
|
3
|
+
(function (DeleteImagesResponse) {
|
|
4
|
+
DeleteImagesResponse.Message = {
|
|
5
|
+
ImageDeletedSuccessfully: "Image deleted successfully.",
|
|
6
|
+
};
|
|
7
|
+
})(DeleteImagesResponse || (DeleteImagesResponse = {}));
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface ReorderImagesResponse {
|
|
2
|
+
message: ReorderImagesResponse.Message;
|
|
3
|
+
}
|
|
4
|
+
export declare namespace ReorderImagesResponse {
|
|
5
|
+
const Message: {
|
|
6
|
+
readonly ImageOrderUpdatedSuccessfully: "Image order updated successfully.";
|
|
7
|
+
};
|
|
8
|
+
type Message = (typeof Message)[keyof typeof Message];
|
|
9
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
export var ReorderImagesResponse;
|
|
3
|
+
(function (ReorderImagesResponse) {
|
|
4
|
+
ReorderImagesResponse.Message = {
|
|
5
|
+
ImageOrderUpdatedSuccessfully: "Image order updated successfully.",
|
|
6
|
+
};
|
|
7
|
+
})(ReorderImagesResponse || (ReorderImagesResponse = {}));
|