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