@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/variants/client/Client.js
ADDED
|
@@ -0,0 +1,537 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
+
var ownKeys = function(o) {
|
|
21
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
+
var ar = [];
|
|
23
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
+
return ar;
|
|
25
|
+
};
|
|
26
|
+
return ownKeys(o);
|
|
27
|
+
};
|
|
28
|
+
return function (mod) {
|
|
29
|
+
if (mod && mod.__esModule) return mod;
|
|
30
|
+
var result = {};
|
|
31
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
+
__setModuleDefault(result, mod);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
36
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
37
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
38
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
39
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
40
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
41
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
42
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
43
|
+
});
|
|
44
|
+
};
|
|
45
|
+
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
|
+
};
|
|
56
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
57
|
+
exports.VariantsClient = void 0;
|
|
58
|
+
const BaseClient_js_1 = require("../../../../../../../../BaseClient.js");
|
|
59
|
+
const headers_js_1 = require("../../../../../../../../core/headers.js");
|
|
60
|
+
const core = __importStar(require("../../../../../../../../core/index.js"));
|
|
61
|
+
const environments = __importStar(require("../../../../../../../../environments.js"));
|
|
62
|
+
const handleNonStatusCodeError_js_1 = require("../../../../../../../../errors/handleNonStatusCodeError.js");
|
|
63
|
+
const errors = __importStar(require("../../../../../../../../errors/index.js"));
|
|
64
|
+
const FiveOneEat = __importStar(require("../../../../../../../index.js"));
|
|
65
|
+
class VariantsClient {
|
|
66
|
+
constructor(options = {}) {
|
|
67
|
+
this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Its unarchived options in their order, each with its stock at every
|
|
71
|
+
* location, as `GET /products/{product}` shows them.
|
|
72
|
+
*
|
|
73
|
+
* @param {FiveOneEat.business.commerce.ListVariantsRequest} request
|
|
74
|
+
* @param {VariantsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
75
|
+
*
|
|
76
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
77
|
+
* @throws {@link FiveOneEat.ForbiddenError}
|
|
78
|
+
* @throws {@link FiveOneEat.NotFoundError}
|
|
79
|
+
*
|
|
80
|
+
* @example
|
|
81
|
+
* await client.business.commerce.variants.list({
|
|
82
|
+
* product: "product"
|
|
83
|
+
* })
|
|
84
|
+
*/
|
|
85
|
+
list(request, requestOptions) {
|
|
86
|
+
return core.HttpResponsePromise.fromPromise(this.__list(request, requestOptions));
|
|
87
|
+
}
|
|
88
|
+
__list(request, requestOptions) {
|
|
89
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
90
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
91
|
+
const { product } = request;
|
|
92
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
93
|
+
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);
|
|
94
|
+
const _response = yield core.fetcher({
|
|
95
|
+
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/products/${core.url.encodePathParam(product)}/variants`),
|
|
96
|
+
method: "GET",
|
|
97
|
+
headers: _headers,
|
|
98
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
99
|
+
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,
|
|
100
|
+
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,
|
|
101
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
102
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
103
|
+
logging: this._options.logging,
|
|
104
|
+
});
|
|
105
|
+
if (_response.ok) {
|
|
106
|
+
return {
|
|
107
|
+
data: _response.body,
|
|
108
|
+
rawResponse: _response.rawResponse,
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
if (_response.error.reason === "status-code") {
|
|
112
|
+
switch (_response.error.statusCode) {
|
|
113
|
+
case 401:
|
|
114
|
+
throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
115
|
+
case 403:
|
|
116
|
+
throw new FiveOneEat.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
117
|
+
case 404:
|
|
118
|
+
throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
|
|
119
|
+
default:
|
|
120
|
+
throw new errors.FiveOneEatError({
|
|
121
|
+
statusCode: _response.error.statusCode,
|
|
122
|
+
body: _response.error.body,
|
|
123
|
+
rawResponse: _response.rawResponse,
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/business/commerce/products/{product}/variants");
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Answers 201. It counts its stock unless `tracks_inventory` is false,
|
|
132
|
+
* starting from `starting_stock` at the locations that hold stock.
|
|
133
|
+
*
|
|
134
|
+
* @param {FiveOneEat.business.commerce.StoreVariantRequest} request
|
|
135
|
+
* @param {VariantsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
136
|
+
*
|
|
137
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
138
|
+
* @throws {@link FiveOneEat.ForbiddenError}
|
|
139
|
+
* @throws {@link FiveOneEat.NotFoundError}
|
|
140
|
+
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
141
|
+
*
|
|
142
|
+
* @example
|
|
143
|
+
* await client.business.commerce.variants.create({
|
|
144
|
+
* "Idempotency-Key": "Idempotency-Key",
|
|
145
|
+
* product: "product",
|
|
146
|
+
* name: "name",
|
|
147
|
+
* price: 1.1,
|
|
148
|
+
* unit: "each",
|
|
149
|
+
* quantity_step: 1
|
|
150
|
+
* })
|
|
151
|
+
*/
|
|
152
|
+
create(request, requestOptions) {
|
|
153
|
+
return core.HttpResponsePromise.fromPromise(this.__create(request, requestOptions));
|
|
154
|
+
}
|
|
155
|
+
__create(request, requestOptions) {
|
|
156
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
157
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
158
|
+
const { product, "Idempotency-Key": idempotencyKey } = request, _body = __rest(request, ["product", "Idempotency-Key"]);
|
|
159
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
160
|
+
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);
|
|
161
|
+
const _response = yield core.fetcher({
|
|
162
|
+
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/products/${core.url.encodePathParam(product)}/variants`),
|
|
163
|
+
method: "POST",
|
|
164
|
+
headers: _headers,
|
|
165
|
+
contentType: "application/json",
|
|
166
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
167
|
+
requestType: "json",
|
|
168
|
+
body: _body,
|
|
169
|
+
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,
|
|
170
|
+
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,
|
|
171
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
172
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
173
|
+
logging: this._options.logging,
|
|
174
|
+
});
|
|
175
|
+
if (_response.ok) {
|
|
176
|
+
return {
|
|
177
|
+
data: _response.body,
|
|
178
|
+
rawResponse: _response.rawResponse,
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
if (_response.error.reason === "status-code") {
|
|
182
|
+
switch (_response.error.statusCode) {
|
|
183
|
+
case 401:
|
|
184
|
+
throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
185
|
+
case 403:
|
|
186
|
+
throw new FiveOneEat.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
187
|
+
case 404:
|
|
188
|
+
throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
|
|
189
|
+
case 422:
|
|
190
|
+
throw new FiveOneEat.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
191
|
+
default:
|
|
192
|
+
throw new errors.FiveOneEatError({
|
|
193
|
+
statusCode: _response.error.statusCode,
|
|
194
|
+
body: _response.error.body,
|
|
195
|
+
rawResponse: _response.rawResponse,
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/business/commerce/products/{product}/variants");
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* `stock_locations` is each store and stand that counts stock, the main
|
|
204
|
+
* store first, then stores, then stands, with this option's stock there
|
|
205
|
+
* (`level` is null where it has never been counted). `locked` is true
|
|
206
|
+
* once stock or orders count in its unit, so the unit can't change.
|
|
207
|
+
*
|
|
208
|
+
* @param {FiveOneEat.business.commerce.GetVariantsRequest} request
|
|
209
|
+
* @param {VariantsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
210
|
+
*
|
|
211
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
212
|
+
* @throws {@link FiveOneEat.ForbiddenError}
|
|
213
|
+
* @throws {@link FiveOneEat.NotFoundError}
|
|
214
|
+
*
|
|
215
|
+
* @example
|
|
216
|
+
* await client.business.commerce.variants.get({
|
|
217
|
+
* product: "product",
|
|
218
|
+
* variant: "variant"
|
|
219
|
+
* })
|
|
220
|
+
*/
|
|
221
|
+
get(request, requestOptions) {
|
|
222
|
+
return core.HttpResponsePromise.fromPromise(this.__get(request, requestOptions));
|
|
223
|
+
}
|
|
224
|
+
__get(request, requestOptions) {
|
|
225
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
226
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
227
|
+
const { product, variant } = request;
|
|
228
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
229
|
+
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);
|
|
230
|
+
const _response = yield core.fetcher({
|
|
231
|
+
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/products/${core.url.encodePathParam(product)}/variants/${core.url.encodePathParam(variant)}`),
|
|
232
|
+
method: "GET",
|
|
233
|
+
headers: _headers,
|
|
234
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
235
|
+
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,
|
|
236
|
+
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,
|
|
237
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
238
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
239
|
+
logging: this._options.logging,
|
|
240
|
+
});
|
|
241
|
+
if (_response.ok) {
|
|
242
|
+
return {
|
|
243
|
+
data: _response.body,
|
|
244
|
+
rawResponse: _response.rawResponse,
|
|
245
|
+
};
|
|
246
|
+
}
|
|
247
|
+
if (_response.error.reason === "status-code") {
|
|
248
|
+
switch (_response.error.statusCode) {
|
|
249
|
+
case 401:
|
|
250
|
+
throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
251
|
+
case 403:
|
|
252
|
+
throw new FiveOneEat.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
253
|
+
case 404:
|
|
254
|
+
throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
|
|
255
|
+
default:
|
|
256
|
+
throw new errors.FiveOneEatError({
|
|
257
|
+
statusCode: _response.error.statusCode,
|
|
258
|
+
body: _response.error.body,
|
|
259
|
+
rawResponse: _response.rawResponse,
|
|
260
|
+
});
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/business/commerce/products/{product}/variants/{variant}");
|
|
264
|
+
});
|
|
265
|
+
}
|
|
266
|
+
/**
|
|
267
|
+
* Its unit can't change once stock or orders count in it: a form error
|
|
268
|
+
* on `unit`. Left out, `tracks_inventory` and `allow_backorder` stay as
|
|
269
|
+
* they are.
|
|
270
|
+
*
|
|
271
|
+
* @param {FiveOneEat.business.commerce.UpdateVariantRequest} request
|
|
272
|
+
* @param {VariantsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
273
|
+
*
|
|
274
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
275
|
+
* @throws {@link FiveOneEat.ForbiddenError}
|
|
276
|
+
* @throws {@link FiveOneEat.NotFoundError}
|
|
277
|
+
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
278
|
+
*
|
|
279
|
+
* @example
|
|
280
|
+
* await client.business.commerce.variants.update({
|
|
281
|
+
* product: "product",
|
|
282
|
+
* variant: "variant",
|
|
283
|
+
* name: "name",
|
|
284
|
+
* price: 1.1,
|
|
285
|
+
* unit: "each",
|
|
286
|
+
* quantity_step: 1
|
|
287
|
+
* })
|
|
288
|
+
*/
|
|
289
|
+
update(request, requestOptions) {
|
|
290
|
+
return core.HttpResponsePromise.fromPromise(this.__update(request, requestOptions));
|
|
291
|
+
}
|
|
292
|
+
__update(request, requestOptions) {
|
|
293
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
294
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
295
|
+
const { product, variant } = request, _body = __rest(request, ["product", "variant"]);
|
|
296
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
297
|
+
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);
|
|
298
|
+
const _response = yield core.fetcher({
|
|
299
|
+
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/products/${core.url.encodePathParam(product)}/variants/${core.url.encodePathParam(variant)}`),
|
|
300
|
+
method: "PUT",
|
|
301
|
+
headers: _headers,
|
|
302
|
+
contentType: "application/json",
|
|
303
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
304
|
+
requestType: "json",
|
|
305
|
+
body: _body,
|
|
306
|
+
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,
|
|
307
|
+
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,
|
|
308
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
309
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
310
|
+
logging: this._options.logging,
|
|
311
|
+
});
|
|
312
|
+
if (_response.ok) {
|
|
313
|
+
return {
|
|
314
|
+
data: _response.body,
|
|
315
|
+
rawResponse: _response.rawResponse,
|
|
316
|
+
};
|
|
317
|
+
}
|
|
318
|
+
if (_response.error.reason === "status-code") {
|
|
319
|
+
switch (_response.error.statusCode) {
|
|
320
|
+
case 401:
|
|
321
|
+
throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
322
|
+
case 403:
|
|
323
|
+
throw new FiveOneEat.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
324
|
+
case 404:
|
|
325
|
+
throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
|
|
326
|
+
case 422:
|
|
327
|
+
throw new FiveOneEat.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
328
|
+
default:
|
|
329
|
+
throw new errors.FiveOneEatError({
|
|
330
|
+
statusCode: _response.error.statusCode,
|
|
331
|
+
body: _response.error.body,
|
|
332
|
+
rawResponse: _response.rawResponse,
|
|
333
|
+
});
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "PUT", "/business/commerce/products/{product}/variants/{variant}");
|
|
337
|
+
});
|
|
338
|
+
}
|
|
339
|
+
/**
|
|
340
|
+
* Only one that isn't the default and has no stock or orders: otherwise
|
|
341
|
+
* a form error on `variant`, and it can only be archived.
|
|
342
|
+
*
|
|
343
|
+
* @param {FiveOneEat.business.commerce.DeleteVariantsRequest} request
|
|
344
|
+
* @param {VariantsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
345
|
+
*
|
|
346
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
347
|
+
* @throws {@link FiveOneEat.ForbiddenError}
|
|
348
|
+
* @throws {@link FiveOneEat.NotFoundError}
|
|
349
|
+
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
350
|
+
*
|
|
351
|
+
* @example
|
|
352
|
+
* await client.business.commerce.variants.delete({
|
|
353
|
+
* product: "product",
|
|
354
|
+
* variant: "variant"
|
|
355
|
+
* })
|
|
356
|
+
*/
|
|
357
|
+
delete(request, requestOptions) {
|
|
358
|
+
return core.HttpResponsePromise.fromPromise(this.__delete(request, requestOptions));
|
|
359
|
+
}
|
|
360
|
+
__delete(request, requestOptions) {
|
|
361
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
362
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
363
|
+
const { product, variant } = request;
|
|
364
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
365
|
+
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);
|
|
366
|
+
const _response = yield core.fetcher({
|
|
367
|
+
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/products/${core.url.encodePathParam(product)}/variants/${core.url.encodePathParam(variant)}`),
|
|
368
|
+
method: "DELETE",
|
|
369
|
+
headers: _headers,
|
|
370
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
371
|
+
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,
|
|
372
|
+
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,
|
|
373
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
374
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
375
|
+
logging: this._options.logging,
|
|
376
|
+
});
|
|
377
|
+
if (_response.ok) {
|
|
378
|
+
return { data: undefined, rawResponse: _response.rawResponse };
|
|
379
|
+
}
|
|
380
|
+
if (_response.error.reason === "status-code") {
|
|
381
|
+
switch (_response.error.statusCode) {
|
|
382
|
+
case 401:
|
|
383
|
+
throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
384
|
+
case 403:
|
|
385
|
+
throw new FiveOneEat.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
386
|
+
case 404:
|
|
387
|
+
throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
|
|
388
|
+
case 422:
|
|
389
|
+
throw new FiveOneEat.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
390
|
+
default:
|
|
391
|
+
throw new errors.FiveOneEatError({
|
|
392
|
+
statusCode: _response.error.statusCode,
|
|
393
|
+
body: _response.error.body,
|
|
394
|
+
rawResponse: _response.rawResponse,
|
|
395
|
+
});
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "DELETE", "/business/commerce/products/{product}/variants/{variant}");
|
|
399
|
+
});
|
|
400
|
+
}
|
|
401
|
+
/**
|
|
402
|
+
* Just its price and "was" price, in dollars and cents.
|
|
403
|
+
*
|
|
404
|
+
* @param {FiveOneEat.business.commerce.SetVariantPriceRequest} request
|
|
405
|
+
* @param {VariantsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
406
|
+
*
|
|
407
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
408
|
+
* @throws {@link FiveOneEat.ForbiddenError}
|
|
409
|
+
* @throws {@link FiveOneEat.NotFoundError}
|
|
410
|
+
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
411
|
+
*
|
|
412
|
+
* @example
|
|
413
|
+
* await client.business.commerce.variants.setPrice({
|
|
414
|
+
* product: "product",
|
|
415
|
+
* variant: "variant",
|
|
416
|
+
* price: 1.1
|
|
417
|
+
* })
|
|
418
|
+
*/
|
|
419
|
+
setPrice(request, requestOptions) {
|
|
420
|
+
return core.HttpResponsePromise.fromPromise(this.__setPrice(request, requestOptions));
|
|
421
|
+
}
|
|
422
|
+
__setPrice(request, requestOptions) {
|
|
423
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
424
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
425
|
+
const { product, variant } = request, _body = __rest(request, ["product", "variant"]);
|
|
426
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
427
|
+
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);
|
|
428
|
+
const _response = yield core.fetcher({
|
|
429
|
+
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/products/${core.url.encodePathParam(product)}/variants/${core.url.encodePathParam(variant)}/price`),
|
|
430
|
+
method: "PUT",
|
|
431
|
+
headers: _headers,
|
|
432
|
+
contentType: "application/json",
|
|
433
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
434
|
+
requestType: "json",
|
|
435
|
+
body: _body,
|
|
436
|
+
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,
|
|
437
|
+
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,
|
|
438
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
439
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
440
|
+
logging: this._options.logging,
|
|
441
|
+
});
|
|
442
|
+
if (_response.ok) {
|
|
443
|
+
return {
|
|
444
|
+
data: _response.body,
|
|
445
|
+
rawResponse: _response.rawResponse,
|
|
446
|
+
};
|
|
447
|
+
}
|
|
448
|
+
if (_response.error.reason === "status-code") {
|
|
449
|
+
switch (_response.error.statusCode) {
|
|
450
|
+
case 401:
|
|
451
|
+
throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
452
|
+
case 403:
|
|
453
|
+
throw new FiveOneEat.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
454
|
+
case 404:
|
|
455
|
+
throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
|
|
456
|
+
case 422:
|
|
457
|
+
throw new FiveOneEat.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
458
|
+
default:
|
|
459
|
+
throw new errors.FiveOneEatError({
|
|
460
|
+
statusCode: _response.error.statusCode,
|
|
461
|
+
body: _response.error.body,
|
|
462
|
+
rawResponse: _response.rawResponse,
|
|
463
|
+
});
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "PUT", "/business/commerce/products/{product}/variants/{variant}/price");
|
|
467
|
+
});
|
|
468
|
+
}
|
|
469
|
+
/**
|
|
470
|
+
* Takes it off sale, keeping its stock and order history. When it was
|
|
471
|
+
* the default, the next option becomes the default. The product's last
|
|
472
|
+
* option can't be archived: a form error on `variant`; remove the
|
|
473
|
+
* product instead.
|
|
474
|
+
*
|
|
475
|
+
* @param {FiveOneEat.business.commerce.ArchiveVariantsRequest} request
|
|
476
|
+
* @param {VariantsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
477
|
+
*
|
|
478
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
479
|
+
* @throws {@link FiveOneEat.ForbiddenError}
|
|
480
|
+
* @throws {@link FiveOneEat.NotFoundError}
|
|
481
|
+
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
482
|
+
*
|
|
483
|
+
* @example
|
|
484
|
+
* await client.business.commerce.variants.archive({
|
|
485
|
+
* product: "product",
|
|
486
|
+
* variant: "variant"
|
|
487
|
+
* })
|
|
488
|
+
*/
|
|
489
|
+
archive(request, requestOptions) {
|
|
490
|
+
return core.HttpResponsePromise.fromPromise(this.__archive(request, requestOptions));
|
|
491
|
+
}
|
|
492
|
+
__archive(request, requestOptions) {
|
|
493
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
494
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
495
|
+
const { product, variant } = request;
|
|
496
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
497
|
+
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);
|
|
498
|
+
const _response = yield core.fetcher({
|
|
499
|
+
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/products/${core.url.encodePathParam(product)}/variants/${core.url.encodePathParam(variant)}/archive`),
|
|
500
|
+
method: "POST",
|
|
501
|
+
headers: _headers,
|
|
502
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
503
|
+
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,
|
|
504
|
+
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,
|
|
505
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
506
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
507
|
+
logging: this._options.logging,
|
|
508
|
+
});
|
|
509
|
+
if (_response.ok) {
|
|
510
|
+
return {
|
|
511
|
+
data: _response.body,
|
|
512
|
+
rawResponse: _response.rawResponse,
|
|
513
|
+
};
|
|
514
|
+
}
|
|
515
|
+
if (_response.error.reason === "status-code") {
|
|
516
|
+
switch (_response.error.statusCode) {
|
|
517
|
+
case 401:
|
|
518
|
+
throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
519
|
+
case 403:
|
|
520
|
+
throw new FiveOneEat.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
521
|
+
case 404:
|
|
522
|
+
throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
|
|
523
|
+
case 422:
|
|
524
|
+
throw new FiveOneEat.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
525
|
+
default:
|
|
526
|
+
throw new errors.FiveOneEatError({
|
|
527
|
+
statusCode: _response.error.statusCode,
|
|
528
|
+
body: _response.error.body,
|
|
529
|
+
rawResponse: _response.rawResponse,
|
|
530
|
+
});
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/business/commerce/products/{product}/variants/{variant}/archive");
|
|
534
|
+
});
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
exports.VariantsClient = VariantsClient;
|
package/dist/cjs/api/resources/business/resources/commerce/resources/variants/client/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./requests/index.js";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./requests/index.js"), exports);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @example
|
|
3
|
+
* {
|
|
4
|
+
* product: "product",
|
|
5
|
+
* variant: "variant",
|
|
6
|
+
* price: 1.1
|
|
7
|
+
* }
|
|
8
|
+
*/
|
|
9
|
+
export interface SetVariantPriceRequest {
|
|
10
|
+
/** The product ID */
|
|
11
|
+
product: string;
|
|
12
|
+
/** The variant ID */
|
|
13
|
+
variant: string;
|
|
14
|
+
price: number;
|
|
15
|
+
compare_at_price?: number | null;
|
|
16
|
+
}
|