@51eat/sdk 2.0.0 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/BaseClient.js +2 -2
- package/dist/cjs/api/resources/business/resources/commerce/client/Client.d.ts +9 -0
- package/dist/cjs/api/resources/business/resources/commerce/client/Client.js +17 -2
- package/dist/cjs/api/resources/business/resources/commerce/resources/index.d.ts +10 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/index.js +14 -4
- package/dist/cjs/api/resources/business/resources/commerce/resources/locations/client/Client.d.ts +294 -1
- package/dist/cjs/api/resources/business/resources/commerce/resources/locations/client/Client.js +893 -1
- package/dist/cjs/api/resources/business/resources/commerce/resources/locations/client/index.d.ts +1 -1
- package/dist/cjs/api/resources/business/resources/commerce/resources/locations/client/index.js +15 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/locations/client/requests/ArchiveLocationsRequest.d.ts +10 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/locations/client/requests/ArchiveLocationsRequest.js +3 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/locations/client/requests/DeleteLocationsRequest.d.ts +10 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/locations/client/requests/DeleteLocationsRequest.js +3 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/locations/client/requests/FlyerLocationsRequest.d.ts +10 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/locations/client/requests/FlyerLocationsRequest.js +3 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/locations/client/requests/GetHoursLocationsRequest.d.ts +10 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/locations/client/requests/GetHoursLocationsRequest.js +3 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/locations/client/requests/GetLocationsRequest.d.ts +10 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/locations/client/requests/GetLocationsRequest.js +3 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/locations/client/requests/GetPickupLocationsRequest.d.ts +10 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/locations/client/requests/GetPickupLocationsRequest.js +3 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/locations/client/requests/OfferMainStoreProductsLocationsRequest.d.ts +10 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/locations/client/requests/OfferMainStoreProductsLocationsRequest.js +3 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/locations/client/requests/PreviewPickupScheduleRequest.d.ts +52 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/locations/client/requests/PreviewPickupScheduleRequest.js +3 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/locations/client/requests/SetLocationActiveRequest.d.ts +12 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/locations/client/requests/SetLocationActiveRequest.js +3 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/locations/client/requests/StoreLocationRequest.d.ts +68 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/locations/client/requests/StoreLocationRequest.js +38 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/locations/client/requests/UpdateLocationsRequest.d.ts +30 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/locations/client/requests/UpdateLocationsRequest.js +3 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/locations/client/requests/UpdateOpeningHoursRequest.d.ts +46 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/locations/client/requests/UpdateOpeningHoursRequest.js +3 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/locations/client/requests/UpdatePickupScheduleRequest.d.ts +52 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/locations/client/requests/UpdatePickupScheduleRequest.js +3 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/locations/client/requests/index.d.ts +13 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/locations/client/requests/index.js +5 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/locations/types/ArchiveLocationsResponse.d.ts +4 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/locations/types/ArchiveLocationsResponse.js +3 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/locations/types/CreateLocationsResponse.d.ts +4 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/locations/types/CreateLocationsResponse.js +3 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/locations/types/FlyerLocationsResponse.d.ts +9 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/locations/types/FlyerLocationsResponse.js +3 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/locations/types/GetHoursLocationsResponse.d.ts +4 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/locations/types/GetHoursLocationsResponse.js +3 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/locations/types/GetLocationsResponse.d.ts +4 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/locations/types/GetLocationsResponse.js +3 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/locations/types/GetPickupLocationsResponse.d.ts +4 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/locations/types/GetPickupLocationsResponse.js +3 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/locations/types/ListLocationsResponse.d.ts +1 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/locations/types/OfferMainStoreProductsLocationsResponse.d.ts +8 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/locations/types/OfferMainStoreProductsLocationsResponse.js +3 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/locations/types/PreviewPickupAffectedOrdersLocationsResponse.d.ts +15 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/locations/types/PreviewPickupAffectedOrdersLocationsResponse.js +3 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/locations/types/SetActiveLocationsResponse.d.ts +4 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/locations/types/SetActiveLocationsResponse.js +3 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/locations/types/UpdateHoursLocationsResponse.d.ts +4 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/locations/types/UpdateHoursLocationsResponse.js +3 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/locations/types/UpdateLocationsResponse.d.ts +4 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/locations/types/UpdateLocationsResponse.js +3 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/locations/types/UpdatePickupLocationsResponse.d.ts +4 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/locations/types/UpdatePickupLocationsResponse.js +3 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/locations/types/index.d.ts +12 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/locations/types/index.js +12 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/products/client/Client.d.ts +114 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/products/client/Client.js +401 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/products/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/products/client/index.js +17 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/products/client/requests/DeleteProductsRequest.d.ts +10 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/products/client/requests/DeleteProductsRequest.js +3 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/products/client/requests/GetProductsRequest.d.ts +10 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/products/client/requests/GetProductsRequest.js +3 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/products/client/requests/ListProductsRequest.d.ts +12 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/products/client/requests/ListProductsRequest.js +3 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/products/client/requests/StoreProductRequest.d.ts +49 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/products/client/requests/StoreProductRequest.js +17 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/products/client/requests/UpdateProductRequest.d.ts +36 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/products/client/requests/UpdateProductRequest.js +17 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/products/client/requests/index.d.ts +5 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/products/client/requests/index.js +7 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/products/exports.d.ts +2 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/products/exports.js +21 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/products/index.d.ts +2 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/products/index.js +18 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/products/types/CreateProductsResponse.d.ts +8 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/products/types/CreateProductsResponse.js +3 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/products/types/GetProductsResponse.d.ts +8 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/products/types/GetProductsResponse.js +3 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/products/types/ListProductsResponse.d.ts +44 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/products/types/ListProductsResponse.js +3 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/products/types/UpdateProductsResponse.d.ts +8 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/products/types/UpdateProductsResponse.js +3 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/products/types/index.d.ts +4 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/products/types/index.js +20 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/selling/client/Client.d.ts +104 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/selling/client/Client.js +380 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/selling/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/selling/client/index.js +17 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/selling/client/requests/AcceptSellerTermsRequest.d.ts +12 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/selling/client/requests/AcceptSellerTermsRequest.js +3 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/selling/client/requests/RequestSellingApprovalRequest.d.ts +12 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/selling/client/requests/RequestSellingApprovalRequest.js +3 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/selling/client/requests/UpdateSellingRequest.d.ts +9 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/selling/client/requests/UpdateSellingRequest.js +3 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/selling/client/requests/index.d.ts +3 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/selling/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/selling/exports.d.ts +2 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/selling/exports.js +21 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/selling/index.d.ts +2 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/selling/index.js +18 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/selling/types/AcceptSellerTermsSellingResponse.d.ts +4 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/selling/types/AcceptSellerTermsSellingResponse.js +3 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/selling/types/GetSellerTermsSellingResponse.d.ts +4 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/selling/types/GetSellerTermsSellingResponse.js +3 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/selling/types/GetSellingResponse.d.ts +4 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/selling/types/GetSellingResponse.js +3 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/selling/types/RequestApprovalSellingResponse.d.ts +4 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/selling/types/RequestApprovalSellingResponse.js +3 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/selling/types/UpdateSellingResponse.d.ts +4 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/selling/types/UpdateSellingResponse.js +3 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/selling/types/index.d.ts +5 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/selling/types/index.js +21 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/variants/client/Client.d.ts +163 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/variants/client/Client.js +537 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/variants/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/variants/client/index.js +17 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/variants/client/requests/ArchiveVariantsRequest.d.ts +13 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/variants/client/requests/ArchiveVariantsRequest.js +3 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/variants/client/requests/DeleteVariantsRequest.d.ts +13 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/variants/client/requests/DeleteVariantsRequest.js +3 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/variants/client/requests/GetVariantsRequest.d.ts +13 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/variants/client/requests/GetVariantsRequest.js +3 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/variants/client/requests/ListVariantsRequest.d.ts +10 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/variants/client/requests/ListVariantsRequest.js +3 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/variants/client/requests/SetVariantPriceRequest.d.ts +16 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/variants/client/requests/SetVariantPriceRequest.js +3 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/variants/client/requests/StoreVariantRequest.d.ts +54 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/variants/client/requests/StoreVariantRequest.js +17 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/variants/client/requests/UpdateVariantRequest.d.ts +46 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/variants/client/requests/UpdateVariantRequest.js +17 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/variants/client/requests/index.d.ts +7 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/variants/client/requests/index.js +7 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/variants/exports.d.ts +2 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/variants/exports.js +21 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/variants/index.d.ts +2 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/variants/index.js +18 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/variants/types/ArchiveVariantsResponse.d.ts +4 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/variants/types/ArchiveVariantsResponse.js +3 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/variants/types/CreateVariantsResponse.d.ts +8 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/variants/types/CreateVariantsResponse.js +3 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/variants/types/GetVariantsResponse.d.ts +6 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/variants/types/GetVariantsResponse.js +3 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/variants/types/ListVariantsResponse.d.ts +4 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/variants/types/ListVariantsResponse.js +3 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/variants/types/SetPriceVariantsResponse.d.ts +4 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/variants/types/SetPriceVariantsResponse.js +3 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/variants/types/UpdateVariantsResponse.d.ts +8 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/variants/types/UpdateVariantsResponse.js +3 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/variants/types/index.d.ts +6 -0
- package/dist/cjs/api/resources/business/resources/commerce/resources/variants/types/index.js +22 -0
- package/dist/cjs/api/resources/commerce/resources/carts/resources/lines/client/Client.d.ts +9 -5
- package/dist/cjs/api/resources/commerce/resources/carts/resources/lines/client/Client.js +9 -5
- package/dist/cjs/api/types/BusinessCommerceLocation.d.ts +37 -3
- package/dist/cjs/api/types/BusinessEvent.d.ts +2 -0
- package/dist/cjs/api/types/BusinessLocation.d.ts +29 -0
- package/dist/cjs/api/types/BusinessLocation.js +11 -0
- package/dist/cjs/api/types/BusinessLocationDetails.d.ts +36 -0
- package/dist/cjs/api/types/BusinessLocationDetails.js +11 -0
- package/dist/cjs/api/types/BusinessLocationHourException.d.ts +14 -0
- package/dist/cjs/api/types/BusinessLocationHourException.js +3 -0
- package/dist/cjs/api/types/BusinessLocationOpeningHours.d.ts +17 -0
- package/dist/cjs/api/types/BusinessLocationOpeningHours.js +3 -0
- package/dist/cjs/api/types/BusinessLocationPickup.d.ts +25 -0
- package/dist/cjs/api/types/BusinessLocationPickup.js +14 -0
- package/dist/cjs/api/types/BusinessOpeningHourSlot.d.ts +10 -0
- package/dist/cjs/api/types/BusinessOpeningHourSlot.js +3 -0
- package/dist/cjs/api/types/BusinessPickupSchedule.d.ts +10 -0
- package/dist/cjs/api/types/BusinessPickupSchedule.js +3 -0
- package/dist/cjs/api/types/BusinessPickupWindow.d.ts +11 -0
- package/dist/cjs/api/types/BusinessPickupWindow.js +3 -0
- package/dist/cjs/api/types/BusinessSellerTerms.d.ts +10 -0
- package/dist/cjs/api/types/BusinessSellerTerms.js +3 -0
- package/dist/cjs/api/types/BusinessSelling.d.ts +61 -0
- package/dist/cjs/api/types/BusinessSelling.js +16 -0
- package/dist/cjs/api/types/Cart.d.ts +1 -1
- package/dist/cjs/api/types/CustomerEvent.d.ts +6 -0
- package/dist/cjs/api/types/CustomerEventDetail.d.ts +6 -0
- package/dist/cjs/api/types/CustomerEventTicketType.d.ts +7 -0
- package/dist/cjs/api/types/EventFeedItem.d.ts +6 -0
- package/dist/cjs/api/types/ImageResource.d.ts +7 -0
- package/dist/cjs/api/types/ImageResource.js +3 -0
- package/dist/cjs/api/types/LocationKind.d.ts +12 -0
- package/dist/cjs/api/types/LocationKind.js +15 -0
- package/dist/cjs/api/types/ProductResource.d.ts +41 -0
- package/dist/cjs/api/types/ProductResource.js +18 -0
- package/dist/cjs/api/types/Unit.d.ts +16 -0
- package/dist/cjs/api/types/Unit.js +19 -0
- package/dist/cjs/api/types/UpdateLocationRequest.d.ts +7 -0
- package/dist/cjs/api/types/UpdateLocationRequest.js +3 -0
- package/dist/cjs/api/types/VariantInventoryLevelResource.d.ts +9 -0
- package/dist/cjs/api/types/VariantInventoryLevelResource.js +3 -0
- package/dist/cjs/api/types/VariantResource.d.ts +26 -0
- package/dist/cjs/api/types/VariantResource.js +3 -0
- package/dist/cjs/api/types/VariantStockLocationResource.d.ts +15 -0
- package/dist/cjs/api/types/VariantStockLocationResource.js +11 -0
- package/dist/cjs/api/types/index.d.ts +18 -0
- package/dist/cjs/api/types/index.js +18 -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/commerce/client/Client.d.mts +9 -0
- package/dist/esm/api/resources/business/resources/commerce/client/Client.mjs +15 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/index.d.mts +10 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/index.mjs +10 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/locations/client/Client.d.mts +294 -1
- package/dist/esm/api/resources/business/resources/commerce/resources/locations/client/Client.mjs +894 -2
- package/dist/esm/api/resources/business/resources/commerce/resources/locations/client/index.d.mts +1 -1
- package/dist/esm/api/resources/business/resources/commerce/resources/locations/client/index.mjs +1 -1
- package/dist/esm/api/resources/business/resources/commerce/resources/locations/client/requests/ArchiveLocationsRequest.d.mts +10 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/locations/client/requests/ArchiveLocationsRequest.mjs +2 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/locations/client/requests/DeleteLocationsRequest.d.mts +10 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/locations/client/requests/DeleteLocationsRequest.mjs +2 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/locations/client/requests/FlyerLocationsRequest.d.mts +10 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/locations/client/requests/FlyerLocationsRequest.mjs +2 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/locations/client/requests/GetHoursLocationsRequest.d.mts +10 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/locations/client/requests/GetHoursLocationsRequest.mjs +2 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/locations/client/requests/GetLocationsRequest.d.mts +10 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/locations/client/requests/GetLocationsRequest.mjs +2 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/locations/client/requests/GetPickupLocationsRequest.d.mts +10 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/locations/client/requests/GetPickupLocationsRequest.mjs +2 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/locations/client/requests/OfferMainStoreProductsLocationsRequest.d.mts +10 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/locations/client/requests/OfferMainStoreProductsLocationsRequest.mjs +2 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/locations/client/requests/PreviewPickupScheduleRequest.d.mts +52 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/locations/client/requests/PreviewPickupScheduleRequest.mjs +2 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/locations/client/requests/SetLocationActiveRequest.d.mts +12 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/locations/client/requests/SetLocationActiveRequest.mjs +2 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/locations/client/requests/StoreLocationRequest.d.mts +68 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/locations/client/requests/StoreLocationRequest.mjs +35 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/locations/client/requests/UpdateLocationsRequest.d.mts +30 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/locations/client/requests/UpdateLocationsRequest.mjs +2 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/locations/client/requests/UpdateOpeningHoursRequest.d.mts +46 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/locations/client/requests/UpdateOpeningHoursRequest.mjs +2 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/locations/client/requests/UpdatePickupScheduleRequest.d.mts +52 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/locations/client/requests/UpdatePickupScheduleRequest.mjs +2 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/locations/client/requests/index.d.mts +13 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/locations/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/locations/types/ArchiveLocationsResponse.d.mts +4 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/locations/types/ArchiveLocationsResponse.mjs +2 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/locations/types/CreateLocationsResponse.d.mts +4 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/locations/types/CreateLocationsResponse.mjs +2 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/locations/types/FlyerLocationsResponse.d.mts +9 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/locations/types/FlyerLocationsResponse.mjs +2 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/locations/types/GetHoursLocationsResponse.d.mts +4 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/locations/types/GetHoursLocationsResponse.mjs +2 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/locations/types/GetLocationsResponse.d.mts +4 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/locations/types/GetLocationsResponse.mjs +2 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/locations/types/GetPickupLocationsResponse.d.mts +4 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/locations/types/GetPickupLocationsResponse.mjs +2 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/locations/types/ListLocationsResponse.d.mts +1 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/locations/types/OfferMainStoreProductsLocationsResponse.d.mts +8 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/locations/types/OfferMainStoreProductsLocationsResponse.mjs +2 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/locations/types/PreviewPickupAffectedOrdersLocationsResponse.d.mts +15 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/locations/types/PreviewPickupAffectedOrdersLocationsResponse.mjs +2 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/locations/types/SetActiveLocationsResponse.d.mts +4 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/locations/types/SetActiveLocationsResponse.mjs +2 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/locations/types/UpdateHoursLocationsResponse.d.mts +4 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/locations/types/UpdateHoursLocationsResponse.mjs +2 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/locations/types/UpdateLocationsResponse.d.mts +4 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/locations/types/UpdateLocationsResponse.mjs +2 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/locations/types/UpdatePickupLocationsResponse.d.mts +4 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/locations/types/UpdatePickupLocationsResponse.mjs +2 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/locations/types/index.d.mts +12 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/locations/types/index.mjs +12 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/products/client/Client.d.mts +114 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/products/client/Client.mjs +364 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/products/client/index.d.mts +1 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/products/client/index.mjs +1 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/products/client/requests/DeleteProductsRequest.d.mts +10 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/products/client/requests/DeleteProductsRequest.mjs +2 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/products/client/requests/GetProductsRequest.d.mts +10 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/products/client/requests/GetProductsRequest.mjs +2 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/products/client/requests/ListProductsRequest.d.mts +12 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/products/client/requests/ListProductsRequest.mjs +2 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/products/client/requests/StoreProductRequest.d.mts +49 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/products/client/requests/StoreProductRequest.mjs +14 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/products/client/requests/UpdateProductRequest.d.mts +36 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/products/client/requests/UpdateProductRequest.mjs +14 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/products/client/requests/index.d.mts +5 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/products/client/requests/index.mjs +2 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/products/exports.d.mts +2 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/products/exports.mjs +3 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/products/index.d.mts +2 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/products/index.mjs +2 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/products/types/CreateProductsResponse.d.mts +8 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/products/types/CreateProductsResponse.mjs +2 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/products/types/GetProductsResponse.d.mts +8 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/products/types/GetProductsResponse.mjs +2 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/products/types/ListProductsResponse.d.mts +44 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/products/types/ListProductsResponse.mjs +2 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/products/types/UpdateProductsResponse.d.mts +8 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/products/types/UpdateProductsResponse.mjs +2 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/products/types/index.d.mts +4 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/products/types/index.mjs +4 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/selling/client/Client.d.mts +104 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/selling/client/Client.mjs +343 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/selling/client/index.d.mts +1 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/selling/client/index.mjs +1 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/selling/client/requests/AcceptSellerTermsRequest.d.mts +12 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/selling/client/requests/AcceptSellerTermsRequest.mjs +2 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/selling/client/requests/RequestSellingApprovalRequest.d.mts +12 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/selling/client/requests/RequestSellingApprovalRequest.mjs +2 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/selling/client/requests/UpdateSellingRequest.d.mts +9 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/selling/client/requests/UpdateSellingRequest.mjs +2 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/selling/client/requests/index.d.mts +3 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/selling/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/selling/exports.d.mts +2 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/selling/exports.mjs +3 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/selling/index.d.mts +2 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/selling/index.mjs +2 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/selling/types/AcceptSellerTermsSellingResponse.d.mts +4 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/selling/types/AcceptSellerTermsSellingResponse.mjs +2 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/selling/types/GetSellerTermsSellingResponse.d.mts +4 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/selling/types/GetSellerTermsSellingResponse.mjs +2 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/selling/types/GetSellingResponse.d.mts +4 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/selling/types/GetSellingResponse.mjs +2 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/selling/types/RequestApprovalSellingResponse.d.mts +4 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/selling/types/RequestApprovalSellingResponse.mjs +2 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/selling/types/UpdateSellingResponse.d.mts +4 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/selling/types/UpdateSellingResponse.mjs +2 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/selling/types/index.d.mts +5 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/selling/types/index.mjs +5 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/variants/client/Client.d.mts +163 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/variants/client/Client.mjs +500 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/variants/client/index.d.mts +1 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/variants/client/index.mjs +1 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/variants/client/requests/ArchiveVariantsRequest.d.mts +13 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/variants/client/requests/ArchiveVariantsRequest.mjs +2 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/variants/client/requests/DeleteVariantsRequest.d.mts +13 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/variants/client/requests/DeleteVariantsRequest.mjs +2 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/variants/client/requests/GetVariantsRequest.d.mts +13 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/variants/client/requests/GetVariantsRequest.mjs +2 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/variants/client/requests/ListVariantsRequest.d.mts +10 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/variants/client/requests/ListVariantsRequest.mjs +2 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/variants/client/requests/SetVariantPriceRequest.d.mts +16 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/variants/client/requests/SetVariantPriceRequest.mjs +2 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/variants/client/requests/StoreVariantRequest.d.mts +54 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/variants/client/requests/StoreVariantRequest.mjs +14 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/variants/client/requests/UpdateVariantRequest.d.mts +46 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/variants/client/requests/UpdateVariantRequest.mjs +14 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/variants/client/requests/index.d.mts +7 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/variants/client/requests/index.mjs +2 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/variants/exports.d.mts +2 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/variants/exports.mjs +3 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/variants/index.d.mts +2 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/variants/index.mjs +2 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/variants/types/ArchiveVariantsResponse.d.mts +4 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/variants/types/ArchiveVariantsResponse.mjs +2 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/variants/types/CreateVariantsResponse.d.mts +8 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/variants/types/CreateVariantsResponse.mjs +2 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/variants/types/GetVariantsResponse.d.mts +6 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/variants/types/GetVariantsResponse.mjs +2 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/variants/types/ListVariantsResponse.d.mts +4 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/variants/types/ListVariantsResponse.mjs +2 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/variants/types/SetPriceVariantsResponse.d.mts +4 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/variants/types/SetPriceVariantsResponse.mjs +2 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/variants/types/UpdateVariantsResponse.d.mts +8 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/variants/types/UpdateVariantsResponse.mjs +2 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/variants/types/index.d.mts +6 -0
- package/dist/esm/api/resources/business/resources/commerce/resources/variants/types/index.mjs +6 -0
- package/dist/esm/api/resources/commerce/resources/carts/resources/lines/client/Client.d.mts +9 -5
- package/dist/esm/api/resources/commerce/resources/carts/resources/lines/client/Client.mjs +9 -5
- package/dist/esm/api/types/BusinessCommerceLocation.d.mts +37 -3
- package/dist/esm/api/types/BusinessEvent.d.mts +2 -0
- package/dist/esm/api/types/BusinessLocation.d.mts +29 -0
- package/dist/esm/api/types/BusinessLocation.mjs +8 -0
- package/dist/esm/api/types/BusinessLocationDetails.d.mts +36 -0
- package/dist/esm/api/types/BusinessLocationDetails.mjs +8 -0
- package/dist/esm/api/types/BusinessLocationHourException.d.mts +14 -0
- package/dist/esm/api/types/BusinessLocationHourException.mjs +2 -0
- package/dist/esm/api/types/BusinessLocationOpeningHours.d.mts +17 -0
- package/dist/esm/api/types/BusinessLocationOpeningHours.mjs +2 -0
- package/dist/esm/api/types/BusinessLocationPickup.d.mts +25 -0
- package/dist/esm/api/types/BusinessLocationPickup.mjs +11 -0
- package/dist/esm/api/types/BusinessOpeningHourSlot.d.mts +10 -0
- package/dist/esm/api/types/BusinessOpeningHourSlot.mjs +2 -0
- package/dist/esm/api/types/BusinessPickupSchedule.d.mts +10 -0
- package/dist/esm/api/types/BusinessPickupSchedule.mjs +2 -0
- package/dist/esm/api/types/BusinessPickupWindow.d.mts +11 -0
- package/dist/esm/api/types/BusinessPickupWindow.mjs +2 -0
- package/dist/esm/api/types/BusinessSellerTerms.d.mts +10 -0
- package/dist/esm/api/types/BusinessSellerTerms.mjs +2 -0
- package/dist/esm/api/types/BusinessSelling.d.mts +61 -0
- package/dist/esm/api/types/BusinessSelling.mjs +13 -0
- package/dist/esm/api/types/Cart.d.mts +1 -1
- package/dist/esm/api/types/CustomerEvent.d.mts +6 -0
- package/dist/esm/api/types/CustomerEventDetail.d.mts +6 -0
- package/dist/esm/api/types/CustomerEventTicketType.d.mts +7 -0
- package/dist/esm/api/types/EventFeedItem.d.mts +6 -0
- package/dist/esm/api/types/ImageResource.d.mts +7 -0
- package/dist/esm/api/types/ImageResource.mjs +2 -0
- package/dist/esm/api/types/LocationKind.d.mts +12 -0
- package/dist/esm/api/types/LocationKind.mjs +12 -0
- package/dist/esm/api/types/ProductResource.d.mts +41 -0
- package/dist/esm/api/types/ProductResource.mjs +15 -0
- package/dist/esm/api/types/Unit.d.mts +16 -0
- package/dist/esm/api/types/Unit.mjs +16 -0
- package/dist/esm/api/types/UpdateLocationRequest.d.mts +7 -0
- package/dist/esm/api/types/UpdateLocationRequest.mjs +2 -0
- package/dist/esm/api/types/VariantInventoryLevelResource.d.mts +9 -0
- package/dist/esm/api/types/VariantInventoryLevelResource.mjs +2 -0
- package/dist/esm/api/types/VariantResource.d.mts +26 -0
- package/dist/esm/api/types/VariantResource.mjs +2 -0
- package/dist/esm/api/types/VariantStockLocationResource.d.mts +15 -0
- package/dist/esm/api/types/VariantStockLocationResource.mjs +8 -0
- package/dist/esm/api/types/index.d.mts +18 -0
- package/dist/esm/api/types/index.mjs +18 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +34 -1
- package/reference.md +2115 -83
package/dist/cjs/api/resources/business/resources/commerce/resources/locations/client/Client.js
CHANGED
|
@@ -42,6 +42,17 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
42
42
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
43
43
|
});
|
|
44
44
|
};
|
|
45
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
46
|
+
var t = {};
|
|
47
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
48
|
+
t[p] = s[p];
|
|
49
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
50
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
51
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
52
|
+
t[p[i]] = s[p[i]];
|
|
53
|
+
}
|
|
54
|
+
return t;
|
|
55
|
+
};
|
|
45
56
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
46
57
|
exports.LocationsClient = void 0;
|
|
47
58
|
const BaseClient_js_1 = require("../../../../../../../../BaseClient.js");
|
|
@@ -58,7 +69,9 @@ class LocationsClient {
|
|
|
58
69
|
/**
|
|
59
70
|
* Every store and stand of the business, main store first and then by
|
|
60
71
|
* name, including ones switched off, blocked by the plan or archived.
|
|
61
|
-
*
|
|
72
|
+
* Each carries why it can't sell yet (`blocker`) and its open pickup
|
|
73
|
+
* orders still to come (`affected_orders`), the same as the web's list.
|
|
74
|
+
* `can_add_store` says whether the plan has room for another store.
|
|
62
75
|
*
|
|
63
76
|
* @param {LocationsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
64
77
|
*
|
|
@@ -110,5 +123,884 @@ class LocationsClient {
|
|
|
110
123
|
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/business/commerce/locations");
|
|
111
124
|
});
|
|
112
125
|
}
|
|
126
|
+
/**
|
|
127
|
+
* Answers 201. `kind` is `store` or `stand`. A Free plan has one store,
|
|
128
|
+
* the main one: a second is refused with a form error on `kind`.
|
|
129
|
+
*
|
|
130
|
+
* @param {FiveOneEat.business.commerce.StoreLocationRequest} request
|
|
131
|
+
* @param {LocationsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
132
|
+
*
|
|
133
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
134
|
+
* @throws {@link FiveOneEat.ForbiddenError}
|
|
135
|
+
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
136
|
+
*
|
|
137
|
+
* @example
|
|
138
|
+
* await client.business.commerce.locations.create({
|
|
139
|
+
* "Idempotency-Key": "Idempotency-Key",
|
|
140
|
+
* kind: "store",
|
|
141
|
+
* name: "name",
|
|
142
|
+
* address: "address",
|
|
143
|
+
* city: "city",
|
|
144
|
+
* state: "state",
|
|
145
|
+
* zipcode: "zipcode",
|
|
146
|
+
* country: "country",
|
|
147
|
+
* timezone: "America/Adak"
|
|
148
|
+
* })
|
|
149
|
+
*/
|
|
150
|
+
create(request, requestOptions) {
|
|
151
|
+
return core.HttpResponsePromise.fromPromise(this.__create(request, requestOptions));
|
|
152
|
+
}
|
|
153
|
+
__create(request, requestOptions) {
|
|
154
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
155
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
156
|
+
const { "Idempotency-Key": idempotencyKey } = request, _body = __rest(request, ["Idempotency-Key"]);
|
|
157
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
158
|
+
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)({ "Idempotency-Key": idempotencyKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
159
|
+
const _response = yield core.fetcher({
|
|
160
|
+
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/commerce/locations"),
|
|
161
|
+
method: "POST",
|
|
162
|
+
headers: _headers,
|
|
163
|
+
contentType: "application/json",
|
|
164
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
165
|
+
requestType: "json",
|
|
166
|
+
body: _body,
|
|
167
|
+
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,
|
|
168
|
+
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,
|
|
169
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
170
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
171
|
+
logging: this._options.logging,
|
|
172
|
+
});
|
|
173
|
+
if (_response.ok) {
|
|
174
|
+
return {
|
|
175
|
+
data: _response.body,
|
|
176
|
+
rawResponse: _response.rawResponse,
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
if (_response.error.reason === "status-code") {
|
|
180
|
+
switch (_response.error.statusCode) {
|
|
181
|
+
case 401:
|
|
182
|
+
throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
183
|
+
case 403:
|
|
184
|
+
throw new FiveOneEat.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
185
|
+
case 422:
|
|
186
|
+
throw new FiveOneEat.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
187
|
+
default:
|
|
188
|
+
throw new errors.FiveOneEatError({
|
|
189
|
+
statusCode: _response.error.statusCode,
|
|
190
|
+
body: _response.error.body,
|
|
191
|
+
rawResponse: _response.rawResponse,
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/business/commerce/locations");
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* @param {FiveOneEat.business.commerce.GetLocationsRequest} request
|
|
200
|
+
* @param {LocationsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
201
|
+
*
|
|
202
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
203
|
+
* @throws {@link FiveOneEat.ForbiddenError}
|
|
204
|
+
* @throws {@link FiveOneEat.NotFoundError}
|
|
205
|
+
*
|
|
206
|
+
* @example
|
|
207
|
+
* await client.business.commerce.locations.get({
|
|
208
|
+
* location: "location"
|
|
209
|
+
* })
|
|
210
|
+
*/
|
|
211
|
+
get(request, requestOptions) {
|
|
212
|
+
return core.HttpResponsePromise.fromPromise(this.__get(request, requestOptions));
|
|
213
|
+
}
|
|
214
|
+
__get(request, requestOptions) {
|
|
215
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
216
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
217
|
+
const { location } = request;
|
|
218
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
219
|
+
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);
|
|
220
|
+
const _response = yield core.fetcher({
|
|
221
|
+
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/commerce/locations/${core.url.encodePathParam(location)}`),
|
|
222
|
+
method: "GET",
|
|
223
|
+
headers: _headers,
|
|
224
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
225
|
+
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,
|
|
226
|
+
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,
|
|
227
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
228
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
229
|
+
logging: this._options.logging,
|
|
230
|
+
});
|
|
231
|
+
if (_response.ok) {
|
|
232
|
+
return {
|
|
233
|
+
data: _response.body,
|
|
234
|
+
rawResponse: _response.rawResponse,
|
|
235
|
+
};
|
|
236
|
+
}
|
|
237
|
+
if (_response.error.reason === "status-code") {
|
|
238
|
+
switch (_response.error.statusCode) {
|
|
239
|
+
case 401:
|
|
240
|
+
throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
241
|
+
case 403:
|
|
242
|
+
throw new FiveOneEat.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
243
|
+
case 404:
|
|
244
|
+
throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
|
|
245
|
+
default:
|
|
246
|
+
throw new errors.FiveOneEatError({
|
|
247
|
+
statusCode: _response.error.statusCode,
|
|
248
|
+
body: _response.error.body,
|
|
249
|
+
rawResponse: _response.rawResponse,
|
|
250
|
+
});
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/business/commerce/locations/{location}");
|
|
254
|
+
});
|
|
255
|
+
}
|
|
256
|
+
/**
|
|
257
|
+
* The main store saves only its `name`: its address, timezone and phone
|
|
258
|
+
* are the business's, and any of those sent for it are ignored. An extra
|
|
259
|
+
* store or a stand needs its address, city, state, zipcode and timezone
|
|
260
|
+
* as well (422 on the one missing), and keeps every field it is sent
|
|
261
|
+
* as its new value, so send the whole form.
|
|
262
|
+
* `CommerceRequestBodiesDocumentedTest` keeps the fields below in step
|
|
263
|
+
* with `StoreLocationRequest::detailRules()`.
|
|
264
|
+
*
|
|
265
|
+
* @param {FiveOneEat.business.commerce.UpdateLocationsRequest} request
|
|
266
|
+
* @param {LocationsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
267
|
+
*
|
|
268
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
269
|
+
* @throws {@link FiveOneEat.ForbiddenError}
|
|
270
|
+
* @throws {@link FiveOneEat.NotFoundError}
|
|
271
|
+
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
272
|
+
*
|
|
273
|
+
* @example
|
|
274
|
+
* await client.business.commerce.locations.update({
|
|
275
|
+
* location: "location",
|
|
276
|
+
* name: "name"
|
|
277
|
+
* })
|
|
278
|
+
*/
|
|
279
|
+
update(request, requestOptions) {
|
|
280
|
+
return core.HttpResponsePromise.fromPromise(this.__update(request, requestOptions));
|
|
281
|
+
}
|
|
282
|
+
__update(request, requestOptions) {
|
|
283
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
284
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
285
|
+
const { location } = request, _body = __rest(request, ["location"]);
|
|
286
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
287
|
+
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);
|
|
288
|
+
const _response = yield core.fetcher({
|
|
289
|
+
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/commerce/locations/${core.url.encodePathParam(location)}`),
|
|
290
|
+
method: "PUT",
|
|
291
|
+
headers: _headers,
|
|
292
|
+
contentType: "application/json",
|
|
293
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
294
|
+
requestType: "json",
|
|
295
|
+
body: _body,
|
|
296
|
+
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,
|
|
297
|
+
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,
|
|
298
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
299
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
300
|
+
logging: this._options.logging,
|
|
301
|
+
});
|
|
302
|
+
if (_response.ok) {
|
|
303
|
+
return {
|
|
304
|
+
data: _response.body,
|
|
305
|
+
rawResponse: _response.rawResponse,
|
|
306
|
+
};
|
|
307
|
+
}
|
|
308
|
+
if (_response.error.reason === "status-code") {
|
|
309
|
+
switch (_response.error.statusCode) {
|
|
310
|
+
case 401:
|
|
311
|
+
throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
312
|
+
case 403:
|
|
313
|
+
throw new FiveOneEat.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
314
|
+
case 404:
|
|
315
|
+
throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
|
|
316
|
+
case 422:
|
|
317
|
+
throw new FiveOneEat.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
318
|
+
default:
|
|
319
|
+
throw new errors.FiveOneEatError({
|
|
320
|
+
statusCode: _response.error.statusCode,
|
|
321
|
+
body: _response.error.body,
|
|
322
|
+
rawResponse: _response.rawResponse,
|
|
323
|
+
});
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "PUT", "/business/commerce/locations/{location}");
|
|
327
|
+
});
|
|
328
|
+
}
|
|
329
|
+
/**
|
|
330
|
+
* Only one that never sold anything and holds no stock: otherwise 409,
|
|
331
|
+
* and it is archived instead. The main store can't be deleted.
|
|
332
|
+
*
|
|
333
|
+
* @param {FiveOneEat.business.commerce.DeleteLocationsRequest} request
|
|
334
|
+
* @param {LocationsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
335
|
+
*
|
|
336
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
337
|
+
* @throws {@link FiveOneEat.ForbiddenError}
|
|
338
|
+
* @throws {@link FiveOneEat.NotFoundError}
|
|
339
|
+
*
|
|
340
|
+
* @example
|
|
341
|
+
* await client.business.commerce.locations.delete({
|
|
342
|
+
* location: "location"
|
|
343
|
+
* })
|
|
344
|
+
*/
|
|
345
|
+
delete(request, requestOptions) {
|
|
346
|
+
return core.HttpResponsePromise.fromPromise(this.__delete(request, requestOptions));
|
|
347
|
+
}
|
|
348
|
+
__delete(request, requestOptions) {
|
|
349
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
350
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
351
|
+
const { location } = request;
|
|
352
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
353
|
+
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);
|
|
354
|
+
const _response = yield core.fetcher({
|
|
355
|
+
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/commerce/locations/${core.url.encodePathParam(location)}`),
|
|
356
|
+
method: "DELETE",
|
|
357
|
+
headers: _headers,
|
|
358
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
359
|
+
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,
|
|
360
|
+
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,
|
|
361
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
362
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
363
|
+
logging: this._options.logging,
|
|
364
|
+
});
|
|
365
|
+
if (_response.ok) {
|
|
366
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
367
|
+
}
|
|
368
|
+
if (_response.error.reason === "status-code") {
|
|
369
|
+
switch (_response.error.statusCode) {
|
|
370
|
+
case 401:
|
|
371
|
+
throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
372
|
+
case 403:
|
|
373
|
+
throw new FiveOneEat.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
374
|
+
case 404:
|
|
375
|
+
throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
|
|
376
|
+
default:
|
|
377
|
+
throw new errors.FiveOneEatError({
|
|
378
|
+
statusCode: _response.error.statusCode,
|
|
379
|
+
body: _response.error.body,
|
|
380
|
+
rawResponse: _response.rawResponse,
|
|
381
|
+
});
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "DELETE", "/business/commerce/locations/{location}");
|
|
385
|
+
});
|
|
386
|
+
}
|
|
387
|
+
/**
|
|
388
|
+
* @param {FiveOneEat.business.commerce.SetLocationActiveRequest} request
|
|
389
|
+
* @param {LocationsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
390
|
+
*
|
|
391
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
392
|
+
* @throws {@link FiveOneEat.ForbiddenError}
|
|
393
|
+
* @throws {@link FiveOneEat.NotFoundError}
|
|
394
|
+
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
395
|
+
*
|
|
396
|
+
* @example
|
|
397
|
+
* await client.business.commerce.locations.setActive({
|
|
398
|
+
* location: "location",
|
|
399
|
+
* active: true
|
|
400
|
+
* })
|
|
401
|
+
*/
|
|
402
|
+
setActive(request, requestOptions) {
|
|
403
|
+
return core.HttpResponsePromise.fromPromise(this.__setActive(request, requestOptions));
|
|
404
|
+
}
|
|
405
|
+
__setActive(request, requestOptions) {
|
|
406
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
407
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
408
|
+
const { location } = request, _body = __rest(request, ["location"]);
|
|
409
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
410
|
+
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);
|
|
411
|
+
const _response = yield core.fetcher({
|
|
412
|
+
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/commerce/locations/${core.url.encodePathParam(location)}/active`),
|
|
413
|
+
method: "PATCH",
|
|
414
|
+
headers: _headers,
|
|
415
|
+
contentType: "application/json",
|
|
416
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
417
|
+
requestType: "json",
|
|
418
|
+
body: _body,
|
|
419
|
+
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,
|
|
420
|
+
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,
|
|
421
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
422
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
423
|
+
logging: this._options.logging,
|
|
424
|
+
});
|
|
425
|
+
if (_response.ok) {
|
|
426
|
+
return {
|
|
427
|
+
data: _response.body,
|
|
428
|
+
rawResponse: _response.rawResponse,
|
|
429
|
+
};
|
|
430
|
+
}
|
|
431
|
+
if (_response.error.reason === "status-code") {
|
|
432
|
+
switch (_response.error.statusCode) {
|
|
433
|
+
case 401:
|
|
434
|
+
throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
435
|
+
case 403:
|
|
436
|
+
throw new FiveOneEat.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
437
|
+
case 404:
|
|
438
|
+
throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
|
|
439
|
+
case 422:
|
|
440
|
+
throw new FiveOneEat.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
441
|
+
default:
|
|
442
|
+
throw new errors.FiveOneEatError({
|
|
443
|
+
statusCode: _response.error.statusCode,
|
|
444
|
+
body: _response.error.body,
|
|
445
|
+
rawResponse: _response.rawResponse,
|
|
446
|
+
});
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "PATCH", "/business/commerce/locations/{location}/active");
|
|
450
|
+
});
|
|
451
|
+
}
|
|
452
|
+
/**
|
|
453
|
+
* Hides it and stops it taking orders, keeping its history and freeing
|
|
454
|
+
* its name and, for a store, its place in the plan's limit. The main
|
|
455
|
+
* store can't be archived.
|
|
456
|
+
*
|
|
457
|
+
* @param {FiveOneEat.business.commerce.ArchiveLocationsRequest} request
|
|
458
|
+
* @param {LocationsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
459
|
+
*
|
|
460
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
461
|
+
* @throws {@link FiveOneEat.ForbiddenError}
|
|
462
|
+
* @throws {@link FiveOneEat.NotFoundError}
|
|
463
|
+
*
|
|
464
|
+
* @example
|
|
465
|
+
* await client.business.commerce.locations.archive({
|
|
466
|
+
* location: "location"
|
|
467
|
+
* })
|
|
468
|
+
*/
|
|
469
|
+
archive(request, requestOptions) {
|
|
470
|
+
return core.HttpResponsePromise.fromPromise(this.__archive(request, requestOptions));
|
|
471
|
+
}
|
|
472
|
+
__archive(request, requestOptions) {
|
|
473
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
474
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
475
|
+
const { location } = request;
|
|
476
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
477
|
+
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);
|
|
478
|
+
const _response = yield core.fetcher({
|
|
479
|
+
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/commerce/locations/${core.url.encodePathParam(location)}/archive`),
|
|
480
|
+
method: "POST",
|
|
481
|
+
headers: _headers,
|
|
482
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
483
|
+
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,
|
|
484
|
+
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,
|
|
485
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
486
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
487
|
+
logging: this._options.logging,
|
|
488
|
+
});
|
|
489
|
+
if (_response.ok) {
|
|
490
|
+
return {
|
|
491
|
+
data: _response.body,
|
|
492
|
+
rawResponse: _response.rawResponse,
|
|
493
|
+
};
|
|
494
|
+
}
|
|
495
|
+
if (_response.error.reason === "status-code") {
|
|
496
|
+
switch (_response.error.statusCode) {
|
|
497
|
+
case 401:
|
|
498
|
+
throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
499
|
+
case 403:
|
|
500
|
+
throw new FiveOneEat.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
501
|
+
case 404:
|
|
502
|
+
throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
|
|
503
|
+
default:
|
|
504
|
+
throw new errors.FiveOneEatError({
|
|
505
|
+
statusCode: _response.error.statusCode,
|
|
506
|
+
body: _response.error.body,
|
|
507
|
+
rawResponse: _response.rawResponse,
|
|
508
|
+
});
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/business/commerce/locations/{location}/archive");
|
|
512
|
+
});
|
|
513
|
+
}
|
|
514
|
+
/**
|
|
515
|
+
* A download link that works for a few minutes. `url` is null while the
|
|
516
|
+
* flyer is still being generated. Only a stand has a flyer.
|
|
517
|
+
*
|
|
518
|
+
* @param {FiveOneEat.business.commerce.FlyerLocationsRequest} request
|
|
519
|
+
* @param {LocationsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
520
|
+
*
|
|
521
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
522
|
+
* @throws {@link FiveOneEat.ForbiddenError}
|
|
523
|
+
* @throws {@link FiveOneEat.NotFoundError}
|
|
524
|
+
*
|
|
525
|
+
* @example
|
|
526
|
+
* await client.business.commerce.locations.flyer({
|
|
527
|
+
* location: "location"
|
|
528
|
+
* })
|
|
529
|
+
*/
|
|
530
|
+
flyer(request, requestOptions) {
|
|
531
|
+
return core.HttpResponsePromise.fromPromise(this.__flyer(request, requestOptions));
|
|
532
|
+
}
|
|
533
|
+
__flyer(request, requestOptions) {
|
|
534
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
535
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
536
|
+
const { location } = request;
|
|
537
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
538
|
+
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);
|
|
539
|
+
const _response = yield core.fetcher({
|
|
540
|
+
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/commerce/locations/${core.url.encodePathParam(location)}/flyer`),
|
|
541
|
+
method: "GET",
|
|
542
|
+
headers: _headers,
|
|
543
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
544
|
+
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,
|
|
545
|
+
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,
|
|
546
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
547
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
548
|
+
logging: this._options.logging,
|
|
549
|
+
});
|
|
550
|
+
if (_response.ok) {
|
|
551
|
+
return {
|
|
552
|
+
data: _response.body,
|
|
553
|
+
rawResponse: _response.rawResponse,
|
|
554
|
+
};
|
|
555
|
+
}
|
|
556
|
+
if (_response.error.reason === "status-code") {
|
|
557
|
+
switch (_response.error.statusCode) {
|
|
558
|
+
case 401:
|
|
559
|
+
throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
560
|
+
case 403:
|
|
561
|
+
throw new FiveOneEat.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
562
|
+
case 404:
|
|
563
|
+
throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
|
|
564
|
+
default:
|
|
565
|
+
throw new errors.FiveOneEatError({
|
|
566
|
+
statusCode: _response.error.statusCode,
|
|
567
|
+
body: _response.error.body,
|
|
568
|
+
rawResponse: _response.rawResponse,
|
|
569
|
+
});
|
|
570
|
+
}
|
|
571
|
+
}
|
|
572
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/business/commerce/locations/{location}/flyer");
|
|
573
|
+
});
|
|
574
|
+
}
|
|
575
|
+
/**
|
|
576
|
+
* Offers, for pickup, every product the main store offers; those already
|
|
577
|
+
* offered are left as they are. Only an extra store takes products this
|
|
578
|
+
* way. `added` is how many it added, so a second call adds none.
|
|
579
|
+
*
|
|
580
|
+
* @param {FiveOneEat.business.commerce.OfferMainStoreProductsLocationsRequest} request
|
|
581
|
+
* @param {LocationsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
582
|
+
*
|
|
583
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
584
|
+
* @throws {@link FiveOneEat.ForbiddenError}
|
|
585
|
+
* @throws {@link FiveOneEat.NotFoundError}
|
|
586
|
+
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
587
|
+
*
|
|
588
|
+
* @example
|
|
589
|
+
* await client.business.commerce.locations.offerMainStoreProducts({
|
|
590
|
+
* location: "location"
|
|
591
|
+
* })
|
|
592
|
+
*/
|
|
593
|
+
offerMainStoreProducts(request, requestOptions) {
|
|
594
|
+
return core.HttpResponsePromise.fromPromise(this.__offerMainStoreProducts(request, requestOptions));
|
|
595
|
+
}
|
|
596
|
+
__offerMainStoreProducts(request, requestOptions) {
|
|
597
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
598
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
599
|
+
const { location } = request;
|
|
600
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
601
|
+
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);
|
|
602
|
+
const _response = yield core.fetcher({
|
|
603
|
+
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/commerce/locations/${core.url.encodePathParam(location)}/offer-main-store-products`),
|
|
604
|
+
method: "POST",
|
|
605
|
+
headers: _headers,
|
|
606
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
607
|
+
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,
|
|
608
|
+
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,
|
|
609
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
610
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
611
|
+
logging: this._options.logging,
|
|
612
|
+
});
|
|
613
|
+
if (_response.ok) {
|
|
614
|
+
return {
|
|
615
|
+
data: _response.body,
|
|
616
|
+
rawResponse: _response.rawResponse,
|
|
617
|
+
};
|
|
618
|
+
}
|
|
619
|
+
if (_response.error.reason === "status-code") {
|
|
620
|
+
switch (_response.error.statusCode) {
|
|
621
|
+
case 401:
|
|
622
|
+
throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
623
|
+
case 403:
|
|
624
|
+
throw new FiveOneEat.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
625
|
+
case 404:
|
|
626
|
+
throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
|
|
627
|
+
case 422:
|
|
628
|
+
throw new FiveOneEat.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
629
|
+
default:
|
|
630
|
+
throw new errors.FiveOneEatError({
|
|
631
|
+
statusCode: _response.error.statusCode,
|
|
632
|
+
body: _response.error.body,
|
|
633
|
+
rawResponse: _response.rawResponse,
|
|
634
|
+
});
|
|
635
|
+
}
|
|
636
|
+
}
|
|
637
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/business/commerce/locations/{location}/offer-main-store-products");
|
|
638
|
+
});
|
|
639
|
+
}
|
|
640
|
+
/**
|
|
641
|
+
* Its pickup settings, weekly windows with slot capacity and date
|
|
642
|
+
* exceptions, and whether the plan lets it take pickup orders
|
|
643
|
+
* (`can_offer_pickup`: a stand needs Pro).
|
|
644
|
+
*
|
|
645
|
+
* @param {FiveOneEat.business.commerce.GetPickupLocationsRequest} request
|
|
646
|
+
* @param {LocationsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
647
|
+
*
|
|
648
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
649
|
+
* @throws {@link FiveOneEat.ForbiddenError}
|
|
650
|
+
* @throws {@link FiveOneEat.NotFoundError}
|
|
651
|
+
*
|
|
652
|
+
* @example
|
|
653
|
+
* await client.business.commerce.locations.getPickup({
|
|
654
|
+
* location: "location"
|
|
655
|
+
* })
|
|
656
|
+
*/
|
|
657
|
+
getPickup(request, requestOptions) {
|
|
658
|
+
return core.HttpResponsePromise.fromPromise(this.__getPickup(request, requestOptions));
|
|
659
|
+
}
|
|
660
|
+
__getPickup(request, requestOptions) {
|
|
661
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
662
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
663
|
+
const { location } = request;
|
|
664
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
665
|
+
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);
|
|
666
|
+
const _response = yield core.fetcher({
|
|
667
|
+
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/commerce/locations/${core.url.encodePathParam(location)}/pickup`),
|
|
668
|
+
method: "GET",
|
|
669
|
+
headers: _headers,
|
|
670
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
671
|
+
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,
|
|
672
|
+
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,
|
|
673
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
674
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
675
|
+
logging: this._options.logging,
|
|
676
|
+
});
|
|
677
|
+
if (_response.ok) {
|
|
678
|
+
return {
|
|
679
|
+
data: _response.body,
|
|
680
|
+
rawResponse: _response.rawResponse,
|
|
681
|
+
};
|
|
682
|
+
}
|
|
683
|
+
if (_response.error.reason === "status-code") {
|
|
684
|
+
switch (_response.error.statusCode) {
|
|
685
|
+
case 401:
|
|
686
|
+
throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
687
|
+
case 403:
|
|
688
|
+
throw new FiveOneEat.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
689
|
+
case 404:
|
|
690
|
+
throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
|
|
691
|
+
default:
|
|
692
|
+
throw new errors.FiveOneEatError({
|
|
693
|
+
statusCode: _response.error.statusCode,
|
|
694
|
+
body: _response.error.body,
|
|
695
|
+
rawResponse: _response.rawResponse,
|
|
696
|
+
});
|
|
697
|
+
}
|
|
698
|
+
}
|
|
699
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/business/commerce/locations/{location}/pickup");
|
|
700
|
+
});
|
|
701
|
+
}
|
|
702
|
+
/**
|
|
703
|
+
* Replaces the whole schedule. A window never runs past midnight and
|
|
704
|
+
* two windows on a day can't overlap. Turning pickup on at a stand on a
|
|
705
|
+
* Free plan is refused with a form error on `offers_pickup`.
|
|
706
|
+
*
|
|
707
|
+
* @param {FiveOneEat.business.commerce.UpdatePickupScheduleRequest} request
|
|
708
|
+
* @param {LocationsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
709
|
+
*
|
|
710
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
711
|
+
* @throws {@link FiveOneEat.ForbiddenError}
|
|
712
|
+
* @throws {@link FiveOneEat.NotFoundError}
|
|
713
|
+
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
714
|
+
*
|
|
715
|
+
* @example
|
|
716
|
+
* await client.business.commerce.locations.updatePickup({
|
|
717
|
+
* location: "location",
|
|
718
|
+
* offers_pickup: true,
|
|
719
|
+
* preparation_minutes: 1,
|
|
720
|
+
* pickup_slot_minutes: 1,
|
|
721
|
+
* windows: [{
|
|
722
|
+
* day_of_week: 1,
|
|
723
|
+
* opens_at: "opens_at",
|
|
724
|
+
* closes_at: "closes_at"
|
|
725
|
+
* }],
|
|
726
|
+
* exceptions: [{
|
|
727
|
+
* starts_on: "starts_on",
|
|
728
|
+
* is_closed: true
|
|
729
|
+
* }]
|
|
730
|
+
* })
|
|
731
|
+
*/
|
|
732
|
+
updatePickup(request, requestOptions) {
|
|
733
|
+
return core.HttpResponsePromise.fromPromise(this.__updatePickup(request, requestOptions));
|
|
734
|
+
}
|
|
735
|
+
__updatePickup(request, requestOptions) {
|
|
736
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
737
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
738
|
+
const { location } = request, _body = __rest(request, ["location"]);
|
|
739
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
740
|
+
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);
|
|
741
|
+
const _response = yield core.fetcher({
|
|
742
|
+
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/commerce/locations/${core.url.encodePathParam(location)}/pickup`),
|
|
743
|
+
method: "PUT",
|
|
744
|
+
headers: _headers,
|
|
745
|
+
contentType: "application/json",
|
|
746
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
747
|
+
requestType: "json",
|
|
748
|
+
body: _body,
|
|
749
|
+
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,
|
|
750
|
+
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,
|
|
751
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
752
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
753
|
+
logging: this._options.logging,
|
|
754
|
+
});
|
|
755
|
+
if (_response.ok) {
|
|
756
|
+
return {
|
|
757
|
+
data: _response.body,
|
|
758
|
+
rawResponse: _response.rawResponse,
|
|
759
|
+
};
|
|
760
|
+
}
|
|
761
|
+
if (_response.error.reason === "status-code") {
|
|
762
|
+
switch (_response.error.statusCode) {
|
|
763
|
+
case 401:
|
|
764
|
+
throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
765
|
+
case 403:
|
|
766
|
+
throw new FiveOneEat.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
767
|
+
case 404:
|
|
768
|
+
throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
|
|
769
|
+
case 422:
|
|
770
|
+
throw new FiveOneEat.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
771
|
+
default:
|
|
772
|
+
throw new errors.FiveOneEatError({
|
|
773
|
+
statusCode: _response.error.statusCode,
|
|
774
|
+
body: _response.error.body,
|
|
775
|
+
rawResponse: _response.rawResponse,
|
|
776
|
+
});
|
|
777
|
+
}
|
|
778
|
+
}
|
|
779
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "PUT", "/business/commerce/locations/{location}/pickup");
|
|
780
|
+
});
|
|
781
|
+
}
|
|
782
|
+
/**
|
|
783
|
+
* Send the schedule you are about to save. The answer lists the open
|
|
784
|
+
* pickup orders it would leave outside its windows, so the owner can
|
|
785
|
+
* contact those buyers or cancel the orders first. It changes nothing,
|
|
786
|
+
* and so, unlike the writes, takes no `Idempotency-Key`.
|
|
787
|
+
*
|
|
788
|
+
* @param {FiveOneEat.business.commerce.PreviewPickupScheduleRequest} request
|
|
789
|
+
* @param {LocationsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
790
|
+
*
|
|
791
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
792
|
+
* @throws {@link FiveOneEat.ForbiddenError}
|
|
793
|
+
* @throws {@link FiveOneEat.NotFoundError}
|
|
794
|
+
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
795
|
+
*
|
|
796
|
+
* @example
|
|
797
|
+
* await client.business.commerce.locations.previewPickupAffectedOrders({
|
|
798
|
+
* location: "location",
|
|
799
|
+
* offers_pickup: true,
|
|
800
|
+
* preparation_minutes: 1,
|
|
801
|
+
* pickup_slot_minutes: 1,
|
|
802
|
+
* windows: [{
|
|
803
|
+
* day_of_week: 1,
|
|
804
|
+
* opens_at: "opens_at",
|
|
805
|
+
* closes_at: "closes_at"
|
|
806
|
+
* }],
|
|
807
|
+
* exceptions: [{
|
|
808
|
+
* starts_on: "starts_on",
|
|
809
|
+
* is_closed: true
|
|
810
|
+
* }]
|
|
811
|
+
* })
|
|
812
|
+
*/
|
|
813
|
+
previewPickupAffectedOrders(request, requestOptions) {
|
|
814
|
+
return core.HttpResponsePromise.fromPromise(this.__previewPickupAffectedOrders(request, requestOptions));
|
|
815
|
+
}
|
|
816
|
+
__previewPickupAffectedOrders(request, requestOptions) {
|
|
817
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
818
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
819
|
+
const { location } = request, _body = __rest(request, ["location"]);
|
|
820
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
821
|
+
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);
|
|
822
|
+
const _response = yield core.fetcher({
|
|
823
|
+
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/commerce/locations/${core.url.encodePathParam(location)}/pickup/affected-orders`),
|
|
824
|
+
method: "POST",
|
|
825
|
+
headers: _headers,
|
|
826
|
+
contentType: "application/json",
|
|
827
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
828
|
+
requestType: "json",
|
|
829
|
+
body: _body,
|
|
830
|
+
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,
|
|
831
|
+
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,
|
|
832
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
833
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
834
|
+
logging: this._options.logging,
|
|
835
|
+
});
|
|
836
|
+
if (_response.ok) {
|
|
837
|
+
return {
|
|
838
|
+
data: _response.body,
|
|
839
|
+
rawResponse: _response.rawResponse,
|
|
840
|
+
};
|
|
841
|
+
}
|
|
842
|
+
if (_response.error.reason === "status-code") {
|
|
843
|
+
switch (_response.error.statusCode) {
|
|
844
|
+
case 401:
|
|
845
|
+
throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
846
|
+
case 403:
|
|
847
|
+
throw new FiveOneEat.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
848
|
+
case 404:
|
|
849
|
+
throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
|
|
850
|
+
case 422:
|
|
851
|
+
throw new FiveOneEat.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
852
|
+
default:
|
|
853
|
+
throw new errors.FiveOneEatError({
|
|
854
|
+
statusCode: _response.error.statusCode,
|
|
855
|
+
body: _response.error.body,
|
|
856
|
+
rawResponse: _response.rawResponse,
|
|
857
|
+
});
|
|
858
|
+
}
|
|
859
|
+
}
|
|
860
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/business/commerce/locations/{location}/pickup/affected-orders");
|
|
861
|
+
});
|
|
862
|
+
}
|
|
863
|
+
/**
|
|
864
|
+
* Its weekly slots and exceptions, and whether it is open now. The main
|
|
865
|
+
* store and stands answer 404: the main store's hours are the business
|
|
866
|
+
* hours.
|
|
867
|
+
*
|
|
868
|
+
* @param {FiveOneEat.business.commerce.GetHoursLocationsRequest} request
|
|
869
|
+
* @param {LocationsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
870
|
+
*
|
|
871
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
872
|
+
* @throws {@link FiveOneEat.ForbiddenError}
|
|
873
|
+
* @throws {@link FiveOneEat.NotFoundError}
|
|
874
|
+
*
|
|
875
|
+
* @example
|
|
876
|
+
* await client.business.commerce.locations.getHours({
|
|
877
|
+
* location: "location"
|
|
878
|
+
* })
|
|
879
|
+
*/
|
|
880
|
+
getHours(request, requestOptions) {
|
|
881
|
+
return core.HttpResponsePromise.fromPromise(this.__getHours(request, requestOptions));
|
|
882
|
+
}
|
|
883
|
+
__getHours(request, requestOptions) {
|
|
884
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
885
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
886
|
+
const { location } = request;
|
|
887
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
888
|
+
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);
|
|
889
|
+
const _response = yield core.fetcher({
|
|
890
|
+
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/commerce/locations/${core.url.encodePathParam(location)}/hours`),
|
|
891
|
+
method: "GET",
|
|
892
|
+
headers: _headers,
|
|
893
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
894
|
+
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,
|
|
895
|
+
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,
|
|
896
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
897
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
898
|
+
logging: this._options.logging,
|
|
899
|
+
});
|
|
900
|
+
if (_response.ok) {
|
|
901
|
+
return {
|
|
902
|
+
data: _response.body,
|
|
903
|
+
rawResponse: _response.rawResponse,
|
|
904
|
+
};
|
|
905
|
+
}
|
|
906
|
+
if (_response.error.reason === "status-code") {
|
|
907
|
+
switch (_response.error.statusCode) {
|
|
908
|
+
case 401:
|
|
909
|
+
throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
910
|
+
case 403:
|
|
911
|
+
throw new FiveOneEat.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
912
|
+
case 404:
|
|
913
|
+
throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
|
|
914
|
+
default:
|
|
915
|
+
throw new errors.FiveOneEatError({
|
|
916
|
+
statusCode: _response.error.statusCode,
|
|
917
|
+
body: _response.error.body,
|
|
918
|
+
rawResponse: _response.rawResponse,
|
|
919
|
+
});
|
|
920
|
+
}
|
|
921
|
+
}
|
|
922
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/business/commerce/locations/{location}/hours");
|
|
923
|
+
});
|
|
924
|
+
}
|
|
925
|
+
/**
|
|
926
|
+
* Replaces the whole schedule, with the business hours' rules: a slot
|
|
927
|
+
* may close after midnight, and two slots on a day can't overlap. Send
|
|
928
|
+
* every slot and exception to keep; none to clear them.
|
|
929
|
+
*
|
|
930
|
+
* @param {FiveOneEat.business.commerce.UpdateOpeningHoursRequest} request
|
|
931
|
+
* @param {LocationsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
932
|
+
*
|
|
933
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
934
|
+
* @throws {@link FiveOneEat.ForbiddenError}
|
|
935
|
+
* @throws {@link FiveOneEat.NotFoundError}
|
|
936
|
+
* @throws {@link FiveOneEat.ConflictError}
|
|
937
|
+
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
938
|
+
*
|
|
939
|
+
* @example
|
|
940
|
+
* await client.business.commerce.locations.updateHours({
|
|
941
|
+
* location: "location",
|
|
942
|
+
* slots: [{
|
|
943
|
+
* day_of_week: 1,
|
|
944
|
+
* opens_at: "opens_at",
|
|
945
|
+
* closes_at: "closes_at"
|
|
946
|
+
* }],
|
|
947
|
+
* exceptions: [{
|
|
948
|
+
* starts_on: "starts_on",
|
|
949
|
+
* is_closed: true
|
|
950
|
+
* }]
|
|
951
|
+
* })
|
|
952
|
+
*/
|
|
953
|
+
updateHours(request, requestOptions) {
|
|
954
|
+
return core.HttpResponsePromise.fromPromise(this.__updateHours(request, requestOptions));
|
|
955
|
+
}
|
|
956
|
+
__updateHours(request, requestOptions) {
|
|
957
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
958
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
959
|
+
const { location } = request, _body = __rest(request, ["location"]);
|
|
960
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
961
|
+
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);
|
|
962
|
+
const _response = yield core.fetcher({
|
|
963
|
+
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/commerce/locations/${core.url.encodePathParam(location)}/hours`),
|
|
964
|
+
method: "PUT",
|
|
965
|
+
headers: _headers,
|
|
966
|
+
contentType: "application/json",
|
|
967
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
968
|
+
requestType: "json",
|
|
969
|
+
body: _body,
|
|
970
|
+
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,
|
|
971
|
+
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,
|
|
972
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
973
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
974
|
+
logging: this._options.logging,
|
|
975
|
+
});
|
|
976
|
+
if (_response.ok) {
|
|
977
|
+
return {
|
|
978
|
+
data: _response.body,
|
|
979
|
+
rawResponse: _response.rawResponse,
|
|
980
|
+
};
|
|
981
|
+
}
|
|
982
|
+
if (_response.error.reason === "status-code") {
|
|
983
|
+
switch (_response.error.statusCode) {
|
|
984
|
+
case 401:
|
|
985
|
+
throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
986
|
+
case 403:
|
|
987
|
+
throw new FiveOneEat.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
988
|
+
case 404:
|
|
989
|
+
throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
|
|
990
|
+
case 409:
|
|
991
|
+
throw new FiveOneEat.ConflictError(_response.error.body, _response.rawResponse);
|
|
992
|
+
case 422:
|
|
993
|
+
throw new FiveOneEat.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
994
|
+
default:
|
|
995
|
+
throw new errors.FiveOneEatError({
|
|
996
|
+
statusCode: _response.error.statusCode,
|
|
997
|
+
body: _response.error.body,
|
|
998
|
+
rawResponse: _response.rawResponse,
|
|
999
|
+
});
|
|
1000
|
+
}
|
|
1001
|
+
}
|
|
1002
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "PUT", "/business/commerce/locations/{location}/hours");
|
|
1003
|
+
});
|
|
1004
|
+
}
|
|
113
1005
|
}
|
|
114
1006
|
exports.LocationsClient = LocationsClient;
|