@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/BaseClient.js
CHANGED
|
@@ -43,8 +43,8 @@ function normalizeClientOptions(options) {
|
|
|
43
43
|
const headers = (0, headers_js_1.mergeHeaders)({
|
|
44
44
|
"X-Fern-Language": "JavaScript",
|
|
45
45
|
"X-Fern-SDK-Name": "@51eat/sdk",
|
|
46
|
-
"X-Fern-SDK-Version": "0.0.
|
|
47
|
-
"User-Agent": "@51eat/sdk/0.0.
|
|
46
|
+
"X-Fern-SDK-Version": "0.0.44",
|
|
47
|
+
"User-Agent": "@51eat/sdk/0.0.44",
|
|
48
48
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
49
49
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
50
50
|
}, 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.js";
|
|
3
3
|
import * as core from "../../../../../../core/index.js";
|
|
4
4
|
import * as FiveOneEat from "../../../../../index.js";
|
|
5
|
+
import { ImagesClient } from "../resources/images/client/Client.js";
|
|
5
6
|
import { VariantsClient } from "../resources/variants/client/Client.js";
|
|
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
|
*
|
|
@@ -62,14 +62,19 @@ const environments = __importStar(require("../../../../../../environments.js"));
|
|
|
62
62
|
const handleNonStatusCodeError_js_1 = require("../../../../../../errors/handleNonStatusCodeError.js");
|
|
63
63
|
const errors = __importStar(require("../../../../../../errors/index.js"));
|
|
64
64
|
const FiveOneEat = __importStar(require("../../../../../index.js"));
|
|
65
|
-
const Client_js_1 = require("../resources/
|
|
65
|
+
const Client_js_1 = require("../resources/images/client/Client.js");
|
|
66
|
+
const Client_js_2 = require("../resources/variants/client/Client.js");
|
|
66
67
|
class ProductsClient {
|
|
67
68
|
constructor(options = {}) {
|
|
68
69
|
this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
|
|
69
70
|
}
|
|
70
71
|
get variants() {
|
|
71
72
|
var _a;
|
|
72
|
-
return ((_a = this._variants) !== null && _a !== void 0 ? _a : (this._variants = new
|
|
73
|
+
return ((_a = this._variants) !== null && _a !== void 0 ? _a : (this._variants = new Client_js_2.VariantsClient(this._options)));
|
|
74
|
+
}
|
|
75
|
+
get images() {
|
|
76
|
+
var _a;
|
|
77
|
+
return ((_a = this._images) !== null && _a !== void 0 ? _a : (this._images = new Client_js_1.ImagesClient(this._options)));
|
|
73
78
|
}
|
|
74
79
|
/**
|
|
75
80
|
* @param {ProductsClient.RequestOptions} requestOptions - Request-specific configuration.
|
package/dist/cjs/api/resources/business/resources/products/resources/images/client/Client.d.ts
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../../../BaseClient.js";
|
|
2
|
+
import { type NormalizedClientOptionsWithAuth } from "../../../../../../../../BaseClient.js";
|
|
3
|
+
import * as core from "../../../../../../../../core/index.js";
|
|
4
|
+
import * as FiveOneEat from "../../../../../../../index.js";
|
|
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,259 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
+
var ownKeys = function(o) {
|
|
21
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
+
var ar = [];
|
|
23
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
+
return ar;
|
|
25
|
+
};
|
|
26
|
+
return ownKeys(o);
|
|
27
|
+
};
|
|
28
|
+
return function (mod) {
|
|
29
|
+
if (mod && mod.__esModule) return mod;
|
|
30
|
+
var result = {};
|
|
31
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
+
__setModuleDefault(result, mod);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
36
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
37
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
38
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
39
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
40
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
41
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
42
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
43
|
+
});
|
|
44
|
+
};
|
|
45
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
46
|
+
exports.ImagesClient = void 0;
|
|
47
|
+
const BaseClient_js_1 = require("../../../../../../../../BaseClient.js");
|
|
48
|
+
const headers_js_1 = require("../../../../../../../../core/headers.js");
|
|
49
|
+
const core = __importStar(require("../../../../../../../../core/index.js"));
|
|
50
|
+
const environments = __importStar(require("../../../../../../../../environments.js"));
|
|
51
|
+
const handleNonStatusCodeError_js_1 = require("../../../../../../../../errors/handleNonStatusCodeError.js");
|
|
52
|
+
const errors = __importStar(require("../../../../../../../../errors/index.js"));
|
|
53
|
+
const FiveOneEat = __importStar(require("../../../../../../../index.js"));
|
|
54
|
+
class ImagesClient {
|
|
55
|
+
constructor(options = {}) {
|
|
56
|
+
this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* @param {FiveOneEat.business.products.UploadImagesRequest} request
|
|
60
|
+
* @param {ImagesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
61
|
+
*
|
|
62
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
63
|
+
* @throws {@link FiveOneEat.ForbiddenError}
|
|
64
|
+
* @throws {@link FiveOneEat.NotFoundError}
|
|
65
|
+
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* import { createReadStream } from "fs";
|
|
69
|
+
* await client.business.products.images.upload({
|
|
70
|
+
* image: fs.createReadStream("/path/to/your/file"),
|
|
71
|
+
* product: "product"
|
|
72
|
+
* })
|
|
73
|
+
*/
|
|
74
|
+
upload(request, requestOptions) {
|
|
75
|
+
return core.HttpResponsePromise.fromPromise(this.__upload(request, requestOptions));
|
|
76
|
+
}
|
|
77
|
+
__upload(request, requestOptions) {
|
|
78
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
79
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
80
|
+
const _body = yield core.newFormData();
|
|
81
|
+
yield _body.appendFile("image", request.image);
|
|
82
|
+
if (request.alt_text != null) {
|
|
83
|
+
_body.append("alt_text", request.alt_text);
|
|
84
|
+
}
|
|
85
|
+
const _maybeEncodedRequest = yield _body.getRequest();
|
|
86
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
87
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, _maybeEncodedRequest.headers)), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
88
|
+
const _response = yield core.fetcher({
|
|
89
|
+
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`),
|
|
90
|
+
method: "POST",
|
|
91
|
+
headers: _headers,
|
|
92
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
93
|
+
requestType: "file",
|
|
94
|
+
duplex: _maybeEncodedRequest.duplex,
|
|
95
|
+
body: _maybeEncodedRequest.body,
|
|
96
|
+
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,
|
|
97
|
+
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,
|
|
98
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
99
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
100
|
+
logging: this._options.logging,
|
|
101
|
+
});
|
|
102
|
+
if (_response.ok) {
|
|
103
|
+
return {
|
|
104
|
+
data: _response.body,
|
|
105
|
+
rawResponse: _response.rawResponse,
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
if (_response.error.reason === "status-code") {
|
|
109
|
+
switch (_response.error.statusCode) {
|
|
110
|
+
case 401:
|
|
111
|
+
throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
112
|
+
case 403:
|
|
113
|
+
throw new FiveOneEat.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
114
|
+
case 404:
|
|
115
|
+
throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
|
|
116
|
+
case 422:
|
|
117
|
+
throw new FiveOneEat.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
118
|
+
default:
|
|
119
|
+
throw new errors.FiveOneEatError({
|
|
120
|
+
statusCode: _response.error.statusCode,
|
|
121
|
+
body: _response.error.body,
|
|
122
|
+
rawResponse: _response.rawResponse,
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/business/products/{product}/images");
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* @param {FiveOneEat.business.products.ReorderImagesRequest} request
|
|
131
|
+
* @param {ImagesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
132
|
+
*
|
|
133
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
134
|
+
* @throws {@link FiveOneEat.ForbiddenError}
|
|
135
|
+
* @throws {@link FiveOneEat.NotFoundError}
|
|
136
|
+
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
137
|
+
*
|
|
138
|
+
* @example
|
|
139
|
+
* await client.business.products.images.reorder({
|
|
140
|
+
* product: "product",
|
|
141
|
+
* body: {
|
|
142
|
+
* images: [{
|
|
143
|
+
* id: "id",
|
|
144
|
+
* sort_order: 1
|
|
145
|
+
* }]
|
|
146
|
+
* }
|
|
147
|
+
* })
|
|
148
|
+
*/
|
|
149
|
+
reorder(request, requestOptions) {
|
|
150
|
+
return core.HttpResponsePromise.fromPromise(this.__reorder(request, requestOptions));
|
|
151
|
+
}
|
|
152
|
+
__reorder(request, requestOptions) {
|
|
153
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
154
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
155
|
+
const { product, body: _body } = request;
|
|
156
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
157
|
+
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);
|
|
158
|
+
const _response = yield core.fetcher({
|
|
159
|
+
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`),
|
|
160
|
+
method: "PUT",
|
|
161
|
+
headers: _headers,
|
|
162
|
+
contentType: "application/json",
|
|
163
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
164
|
+
requestType: "json",
|
|
165
|
+
body: _body,
|
|
166
|
+
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,
|
|
167
|
+
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,
|
|
168
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
169
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
170
|
+
logging: this._options.logging,
|
|
171
|
+
});
|
|
172
|
+
if (_response.ok) {
|
|
173
|
+
return {
|
|
174
|
+
data: _response.body,
|
|
175
|
+
rawResponse: _response.rawResponse,
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
if (_response.error.reason === "status-code") {
|
|
179
|
+
switch (_response.error.statusCode) {
|
|
180
|
+
case 401:
|
|
181
|
+
throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
182
|
+
case 403:
|
|
183
|
+
throw new FiveOneEat.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
184
|
+
case 404:
|
|
185
|
+
throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
|
|
186
|
+
case 422:
|
|
187
|
+
throw new FiveOneEat.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
188
|
+
default:
|
|
189
|
+
throw new errors.FiveOneEatError({
|
|
190
|
+
statusCode: _response.error.statusCode,
|
|
191
|
+
body: _response.error.body,
|
|
192
|
+
rawResponse: _response.rawResponse,
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "PUT", "/business/products/{product}/images/reorder");
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* @param {FiveOneEat.business.products.DeleteImagesRequest} request
|
|
201
|
+
* @param {ImagesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
202
|
+
*
|
|
203
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
204
|
+
* @throws {@link FiveOneEat.ForbiddenError}
|
|
205
|
+
* @throws {@link FiveOneEat.NotFoundError}
|
|
206
|
+
*
|
|
207
|
+
* @example
|
|
208
|
+
* await client.business.products.images.delete({
|
|
209
|
+
* product: "product",
|
|
210
|
+
* image: "image"
|
|
211
|
+
* })
|
|
212
|
+
*/
|
|
213
|
+
delete(request, requestOptions) {
|
|
214
|
+
return core.HttpResponsePromise.fromPromise(this.__delete(request, requestOptions));
|
|
215
|
+
}
|
|
216
|
+
__delete(request, requestOptions) {
|
|
217
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
218
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
219
|
+
const { product, image } = request;
|
|
220
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
221
|
+
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);
|
|
222
|
+
const _response = yield core.fetcher({
|
|
223
|
+
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)}`),
|
|
224
|
+
method: "DELETE",
|
|
225
|
+
headers: _headers,
|
|
226
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
227
|
+
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,
|
|
228
|
+
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,
|
|
229
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
230
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
231
|
+
logging: this._options.logging,
|
|
232
|
+
});
|
|
233
|
+
if (_response.ok) {
|
|
234
|
+
return {
|
|
235
|
+
data: _response.body,
|
|
236
|
+
rawResponse: _response.rawResponse,
|
|
237
|
+
};
|
|
238
|
+
}
|
|
239
|
+
if (_response.error.reason === "status-code") {
|
|
240
|
+
switch (_response.error.statusCode) {
|
|
241
|
+
case 401:
|
|
242
|
+
throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
243
|
+
case 403:
|
|
244
|
+
throw new FiveOneEat.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
245
|
+
case 404:
|
|
246
|
+
throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
|
|
247
|
+
default:
|
|
248
|
+
throw new errors.FiveOneEatError({
|
|
249
|
+
statusCode: _response.error.statusCode,
|
|
250
|
+
body: _response.error.body,
|
|
251
|
+
rawResponse: _response.rawResponse,
|
|
252
|
+
});
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "DELETE", "/business/products/{product}/images/{image}");
|
|
256
|
+
});
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
exports.ImagesClient = ImagesClient;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./requests/index.js";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./requests/index.js"), exports);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type * as FiveOneEat from "../../../../../../../../index.js";
|
|
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.js";
|
|
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,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
15
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
16
|
+
};
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.ImagesClient = void 0;
|
|
19
|
+
var Client_js_1 = require("./client/Client.js");
|
|
20
|
+
Object.defineProperty(exports, "ImagesClient", { enumerable: true, get: function () { return Client_js_1.ImagesClient; } });
|
|
21
|
+
__exportStar(require("./client/index.js"), exports);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./client/index.js"), exports);
|
|
18
|
+
__exportStar(require("./types/index.js"), exports);
|
|
@@ -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,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.DeleteImagesResponse = void 0;
|
|
5
|
+
var DeleteImagesResponse;
|
|
6
|
+
(function (DeleteImagesResponse) {
|
|
7
|
+
DeleteImagesResponse.Message = {
|
|
8
|
+
ImageDeletedSuccessfully: "Image deleted successfully.",
|
|
9
|
+
};
|
|
10
|
+
})(DeleteImagesResponse || (exports.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,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.ReorderImagesResponse = void 0;
|
|
5
|
+
var ReorderImagesResponse;
|
|
6
|
+
(function (ReorderImagesResponse) {
|
|
7
|
+
ReorderImagesResponse.Message = {
|
|
8
|
+
ImageOrderUpdatedSuccessfully: "Image order updated successfully.",
|
|
9
|
+
};
|
|
10
|
+
})(ReorderImagesResponse || (exports.ReorderImagesResponse = ReorderImagesResponse = {}));
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./DeleteImagesResponse.js"), exports);
|
|
18
|
+
__exportStar(require("./ReorderImagesResponse.js"), exports);
|
|
19
|
+
__exportStar(require("./UploadImagesResponse.js"), exports);
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
export * from "./images/client/requests/index.js";
|
|
2
|
+
export * as images from "./images/index.js";
|
|
3
|
+
export * from "./images/types/index.js";
|
|
1
4
|
export * from "./variants/client/requests/index.js";
|
|
2
5
|
export * as variants from "./variants/index.js";
|
|
3
6
|
export * from "./variants/types/index.js";
|
|
@@ -36,7 +36,10 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
36
36
|
};
|
|
37
37
|
})();
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.variants = void 0;
|
|
39
|
+
exports.variants = exports.images = void 0;
|
|
40
|
+
__exportStar(require("./images/client/requests/index.js"), exports);
|
|
41
|
+
exports.images = __importStar(require("./images/index.js"));
|
|
42
|
+
__exportStar(require("./images/types/index.js"), exports);
|
|
40
43
|
__exportStar(require("./variants/client/requests/index.js"), exports);
|
|
41
44
|
exports.variants = __importStar(require("./variants/index.js"));
|
|
42
45
|
__exportStar(require("./variants/types/index.js"), exports);
|