@51eat/sdk 0.0.76 → 0.0.78

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 (200) hide show
  1. package/dist/cjs/BaseClient.js +2 -2
  2. package/dist/cjs/api/resources/business/client/Client.d.ts +3 -0
  3. package/dist/cjs/api/resources/business/client/Client.js +7 -2
  4. package/dist/cjs/api/resources/business/resources/events/client/requests/StoreEventRequest.d.ts +7 -0
  5. package/dist/cjs/api/resources/business/resources/events/client/requests/UpdateEventRequest.d.ts +7 -0
  6. package/dist/cjs/api/resources/business/resources/events/resources/ticketTypes/client/requests/StoreTicketTypeRequest.d.ts +1 -0
  7. package/dist/cjs/api/resources/business/resources/events/resources/ticketTypes/client/requests/UpdateTicketTypeRequest.d.ts +7 -0
  8. package/dist/cjs/api/resources/business/resources/index.d.ts +2 -0
  9. package/dist/cjs/api/resources/business/resources/index.js +3 -1
  10. package/dist/cjs/api/resources/business/resources/productOrders/client/Client.d.ts +26 -9
  11. package/dist/cjs/api/resources/business/resources/productOrders/client/Client.js +61 -30
  12. package/dist/cjs/api/resources/business/resources/productOrders/client/requests/AddTrackingProductOrdersRequest.d.ts +3 -2
  13. package/dist/cjs/api/resources/business/resources/productOrders/client/requests/FulfillProductOrdersRequest.d.ts +3 -2
  14. package/dist/cjs/api/resources/business/resources/productOrders/client/requests/GetLabelRatesProductOrdersRequest.d.ts +3 -2
  15. package/dist/cjs/api/resources/business/resources/productOrders/client/requests/GetProductOrdersRequest.d.ts +3 -2
  16. package/dist/cjs/api/resources/business/resources/productOrders/client/requests/MarkPickedUpProductOrdersRequest.d.ts +3 -2
  17. package/dist/cjs/api/resources/business/resources/productOrders/client/requests/PurchaseLabelProductOrdersRequest.d.ts +3 -2
  18. package/dist/cjs/api/resources/business/resources/productOrders/client/requests/RefundOrderRequest.d.ts +14 -0
  19. package/dist/cjs/api/resources/business/resources/productOrders/client/requests/index.d.ts +1 -1
  20. package/dist/cjs/api/resources/business/resources/products/client/Client.d.ts +4 -2
  21. package/dist/cjs/api/resources/business/resources/products/client/Client.js +4 -2
  22. package/dist/cjs/api/resources/business/resources/products/client/requests/StoreProductRequest.d.ts +3 -1
  23. package/dist/cjs/api/resources/business/resources/products/client/requests/UpdateProductRequest.d.ts +3 -1
  24. package/dist/cjs/api/resources/business/resources/profile/client/requests/UpdateBusinessProfileRequest.d.ts +9 -0
  25. package/dist/cjs/api/resources/business/resources/taxCodes/client/Client.d.ts +27 -0
  26. package/dist/cjs/api/resources/business/resources/taxCodes/client/Client.js +111 -0
  27. package/dist/cjs/api/resources/business/resources/taxCodes/client/index.d.ts +1 -0
  28. package/dist/cjs/api/resources/business/resources/taxCodes/client/index.js +2 -0
  29. package/dist/cjs/api/resources/business/resources/taxCodes/exports.d.ts +2 -0
  30. package/dist/cjs/api/resources/business/resources/taxCodes/exports.js +21 -0
  31. package/dist/cjs/api/resources/business/resources/taxCodes/index.d.ts +2 -0
  32. package/dist/cjs/api/resources/business/resources/taxCodes/index.js +18 -0
  33. package/dist/cjs/api/resources/business/resources/taxCodes/types/ListTaxCodesResponse.d.ts +4 -0
  34. package/dist/cjs/api/resources/business/resources/taxCodes/types/index.d.ts +1 -0
  35. package/dist/cjs/api/resources/business/resources/taxCodes/types/index.js +17 -0
  36. package/dist/cjs/api/resources/customer/resources/cart/client/Client.d.ts +99 -8
  37. package/dist/cjs/api/resources/customer/resources/cart/client/Client.js +243 -11
  38. package/dist/cjs/api/resources/customer/resources/cart/client/requests/AddItemCartRequest.d.ts +1 -1
  39. package/dist/cjs/api/resources/customer/resources/cart/client/requests/CheckoutCartRequest.d.ts +1 -1
  40. package/dist/cjs/api/resources/customer/resources/cart/client/requests/ChooseFulfillmentMethodRequest.d.ts +13 -0
  41. package/dist/cjs/api/resources/customer/resources/cart/client/requests/ClearCartRequest.d.ts +1 -1
  42. package/dist/cjs/api/resources/customer/resources/cart/client/requests/CreatePaymentIntentCartRequest.d.ts +1 -1
  43. package/dist/cjs/api/resources/customer/resources/cart/client/requests/GetCartRequest.d.ts +1 -1
  44. package/dist/cjs/api/resources/customer/resources/cart/client/requests/ListShippingOptionsCartRequest.d.ts +10 -0
  45. package/dist/cjs/api/resources/customer/resources/cart/client/requests/RefreshCartPaymentRequest.d.ts +12 -0
  46. package/dist/cjs/api/resources/customer/resources/cart/client/requests/RefreshCartPaymentRequest.js +3 -0
  47. package/dist/cjs/api/resources/customer/resources/cart/client/requests/SelectShippingRateRequest.d.ts +12 -0
  48. package/dist/cjs/api/resources/customer/resources/cart/client/requests/SelectShippingRateRequest.js +3 -0
  49. package/dist/{esm/api/resources/customer/resources/cart/client/requests/GetShippingOptionsCartRequest.d.mts → cjs/api/resources/customer/resources/cart/client/requests/ShippingAddressRequest.d.ts} +6 -5
  50. package/dist/cjs/api/resources/customer/resources/cart/client/requests/ShippingAddressRequest.js +3 -0
  51. package/dist/cjs/api/resources/customer/resources/cart/client/requests/index.d.ts +5 -2
  52. package/dist/cjs/api/resources/customer/resources/cart/types/CreatePaymentIntentCartResponse.d.ts +1 -0
  53. package/dist/cjs/api/resources/customer/resources/cart/types/ListShippingOptionsCartResponse.d.ts +18 -0
  54. package/dist/cjs/api/resources/customer/resources/cart/types/ListShippingOptionsCartResponse.js +3 -0
  55. package/dist/cjs/api/resources/customer/resources/cart/types/RefreshPaymentIntentCartResponse.d.ts +18 -0
  56. package/dist/cjs/api/resources/customer/resources/cart/types/RefreshPaymentIntentCartResponse.js +10 -0
  57. package/dist/cjs/api/resources/customer/resources/cart/types/SetFulfillmentCartResponse.d.ts +4 -0
  58. package/dist/cjs/api/resources/customer/resources/cart/types/SetFulfillmentCartResponse.js +3 -0
  59. package/dist/cjs/api/resources/customer/resources/cart/types/SetShippingAddressCartResponse.d.ts +4 -0
  60. package/dist/cjs/api/resources/customer/resources/cart/types/SetShippingAddressCartResponse.js +3 -0
  61. package/dist/cjs/api/resources/customer/resources/cart/types/index.d.ts +4 -1
  62. package/dist/cjs/api/resources/customer/resources/cart/types/index.js +4 -1
  63. package/dist/cjs/api/resources/customer/resources/events/resources/ticketing/client/Client.d.ts +6 -0
  64. package/dist/cjs/api/resources/customer/resources/events/resources/ticketing/client/Client.js +10 -0
  65. package/dist/cjs/api/resources/customer/resources/events/resources/ticketing/client/requests/CreatePaymentIntentRequest.d.ts +1 -0
  66. package/dist/cjs/api/resources/customer/resources/events/resources/ticketing/types/CreatePaymentIntentTicketingResponse.d.ts +12 -0
  67. package/dist/cjs/api/resources/customer/resources/productOrders/client/Client.d.ts +1 -0
  68. package/dist/cjs/api/resources/customer/resources/productOrders/client/Client.js +3 -0
  69. package/dist/cjs/api/resources/customer/resources/productOrders/client/requests/GetProductOrdersRequest.d.ts +1 -0
  70. package/dist/cjs/api/resources/customer/resources/stands/client/Client.d.ts +3 -0
  71. package/dist/cjs/api/resources/customer/resources/stands/client/Client.js +9 -0
  72. package/dist/cjs/api/types/AppHttpResourcesApiV1BusinessCommerceProductResource.d.ts +10 -0
  73. package/dist/cjs/api/types/BusinessEvent.d.ts +7 -0
  74. package/dist/cjs/api/types/BusinessEventTicketType.d.ts +2 -0
  75. package/dist/cjs/api/types/BusinessProfile.d.ts +6 -1
  76. package/dist/cjs/api/types/CartResource.d.ts +24 -0
  77. package/dist/cjs/api/types/ConflictErrorBody.d.ts +2 -7
  78. package/dist/cjs/api/types/ConflictErrorBody.js +0 -7
  79. package/dist/cjs/api/types/CustomerBusinessProfile.d.ts +1 -1
  80. package/dist/cjs/api/types/CustomerEvent.d.ts +6 -0
  81. package/dist/cjs/api/types/CustomerEventDetail.d.ts +6 -0
  82. package/dist/cjs/api/types/EventFeedItem.d.ts +6 -0
  83. package/dist/cjs/api/types/FulfillmentType.d.ts +6 -0
  84. package/dist/cjs/api/types/FulfillmentType.js +9 -0
  85. package/dist/cjs/api/types/ProductResource.d.ts +5 -0
  86. package/dist/cjs/api/types/TaxCode.d.ts +21 -0
  87. package/dist/cjs/api/types/TaxCode.js +15 -0
  88. package/dist/cjs/api/types/TicketOrder.d.ts +7 -1
  89. package/dist/cjs/api/types/index.d.ts +2 -0
  90. package/dist/cjs/api/types/index.js +2 -0
  91. package/dist/cjs/version.d.ts +1 -1
  92. package/dist/cjs/version.js +1 -1
  93. package/dist/esm/BaseClient.mjs +2 -2
  94. package/dist/esm/api/resources/business/client/Client.d.mts +3 -0
  95. package/dist/esm/api/resources/business/client/Client.mjs +5 -0
  96. package/dist/esm/api/resources/business/resources/events/client/requests/StoreEventRequest.d.mts +7 -0
  97. package/dist/esm/api/resources/business/resources/events/client/requests/UpdateEventRequest.d.mts +7 -0
  98. package/dist/esm/api/resources/business/resources/events/resources/ticketTypes/client/requests/StoreTicketTypeRequest.d.mts +1 -0
  99. package/dist/esm/api/resources/business/resources/events/resources/ticketTypes/client/requests/UpdateTicketTypeRequest.d.mts +7 -0
  100. package/dist/esm/api/resources/business/resources/index.d.mts +2 -0
  101. package/dist/esm/api/resources/business/resources/index.mjs +2 -0
  102. package/dist/esm/api/resources/business/resources/productOrders/client/Client.d.mts +26 -9
  103. package/dist/esm/api/resources/business/resources/productOrders/client/Client.mjs +62 -31
  104. package/dist/esm/api/resources/business/resources/productOrders/client/requests/AddTrackingProductOrdersRequest.d.mts +3 -2
  105. package/dist/esm/api/resources/business/resources/productOrders/client/requests/FulfillProductOrdersRequest.d.mts +3 -2
  106. package/dist/esm/api/resources/business/resources/productOrders/client/requests/GetLabelRatesProductOrdersRequest.d.mts +3 -2
  107. package/dist/esm/api/resources/business/resources/productOrders/client/requests/GetProductOrdersRequest.d.mts +3 -2
  108. package/dist/esm/api/resources/business/resources/productOrders/client/requests/MarkPickedUpProductOrdersRequest.d.mts +3 -2
  109. package/dist/esm/api/resources/business/resources/productOrders/client/requests/PurchaseLabelProductOrdersRequest.d.mts +3 -2
  110. package/dist/esm/api/resources/business/resources/productOrders/client/requests/RefundOrderRequest.d.mts +14 -0
  111. package/dist/esm/api/resources/business/resources/productOrders/client/requests/index.d.mts +1 -1
  112. package/dist/esm/api/resources/business/resources/products/client/Client.d.mts +4 -2
  113. package/dist/esm/api/resources/business/resources/products/client/Client.mjs +4 -2
  114. package/dist/esm/api/resources/business/resources/products/client/requests/StoreProductRequest.d.mts +3 -1
  115. package/dist/esm/api/resources/business/resources/products/client/requests/UpdateProductRequest.d.mts +3 -1
  116. package/dist/esm/api/resources/business/resources/profile/client/requests/UpdateBusinessProfileRequest.d.mts +9 -0
  117. package/dist/esm/api/resources/business/resources/taxCodes/client/Client.d.mts +27 -0
  118. package/dist/esm/api/resources/business/resources/taxCodes/client/Client.mjs +74 -0
  119. package/dist/esm/api/resources/business/resources/taxCodes/client/index.d.mts +1 -0
  120. package/dist/esm/api/resources/business/resources/taxCodes/client/index.mjs +1 -0
  121. package/dist/esm/api/resources/business/resources/taxCodes/exports.d.mts +2 -0
  122. package/dist/esm/api/resources/business/resources/taxCodes/exports.mjs +3 -0
  123. package/dist/esm/api/resources/business/resources/taxCodes/index.d.mts +2 -0
  124. package/dist/esm/api/resources/business/resources/taxCodes/index.mjs +2 -0
  125. package/dist/esm/api/resources/business/resources/taxCodes/types/ListTaxCodesResponse.d.mts +4 -0
  126. package/dist/esm/api/resources/business/resources/taxCodes/types/index.d.mts +1 -0
  127. package/dist/esm/api/resources/business/resources/taxCodes/types/index.mjs +1 -0
  128. package/dist/esm/api/resources/customer/resources/cart/client/Client.d.mts +99 -8
  129. package/dist/esm/api/resources/customer/resources/cart/client/Client.mjs +243 -11
  130. package/dist/esm/api/resources/customer/resources/cart/client/requests/AddItemCartRequest.d.mts +1 -1
  131. package/dist/esm/api/resources/customer/resources/cart/client/requests/CheckoutCartRequest.d.mts +1 -1
  132. package/dist/esm/api/resources/customer/resources/cart/client/requests/ChooseFulfillmentMethodRequest.d.mts +13 -0
  133. package/dist/esm/api/resources/customer/resources/cart/client/requests/ClearCartRequest.d.mts +1 -1
  134. package/dist/esm/api/resources/customer/resources/cart/client/requests/CreatePaymentIntentCartRequest.d.mts +1 -1
  135. package/dist/esm/api/resources/customer/resources/cart/client/requests/GetCartRequest.d.mts +1 -1
  136. package/dist/esm/api/resources/customer/resources/cart/client/requests/ListShippingOptionsCartRequest.d.mts +10 -0
  137. package/dist/esm/api/resources/customer/resources/cart/client/requests/RefreshCartPaymentRequest.d.mts +12 -0
  138. package/dist/esm/api/resources/customer/resources/cart/client/requests/RefreshCartPaymentRequest.mjs +2 -0
  139. package/dist/esm/api/resources/customer/resources/cart/client/requests/SelectShippingRateRequest.d.mts +12 -0
  140. package/dist/esm/api/resources/customer/resources/cart/client/requests/SelectShippingRateRequest.mjs +2 -0
  141. package/dist/{cjs/api/resources/customer/resources/cart/client/requests/GetShippingOptionsCartRequest.d.ts → esm/api/resources/customer/resources/cart/client/requests/ShippingAddressRequest.d.mts} +6 -5
  142. package/dist/esm/api/resources/customer/resources/cart/client/requests/ShippingAddressRequest.mjs +2 -0
  143. package/dist/esm/api/resources/customer/resources/cart/client/requests/index.d.mts +5 -2
  144. package/dist/esm/api/resources/customer/resources/cart/types/CreatePaymentIntentCartResponse.d.mts +1 -0
  145. package/dist/esm/api/resources/customer/resources/cart/types/ListShippingOptionsCartResponse.d.mts +18 -0
  146. package/dist/esm/api/resources/customer/resources/cart/types/ListShippingOptionsCartResponse.mjs +2 -0
  147. package/dist/esm/api/resources/customer/resources/cart/types/RefreshPaymentIntentCartResponse.d.mts +18 -0
  148. package/dist/esm/api/resources/customer/resources/cart/types/RefreshPaymentIntentCartResponse.mjs +7 -0
  149. package/dist/esm/api/resources/customer/resources/cart/types/SetFulfillmentCartResponse.d.mts +4 -0
  150. package/dist/esm/api/resources/customer/resources/cart/types/SetFulfillmentCartResponse.mjs +2 -0
  151. package/dist/esm/api/resources/customer/resources/cart/types/SetShippingAddressCartResponse.d.mts +4 -0
  152. package/dist/esm/api/resources/customer/resources/cart/types/SetShippingAddressCartResponse.mjs +2 -0
  153. package/dist/esm/api/resources/customer/resources/cart/types/index.d.mts +4 -1
  154. package/dist/esm/api/resources/customer/resources/cart/types/index.mjs +4 -1
  155. package/dist/esm/api/resources/customer/resources/events/resources/ticketing/client/Client.d.mts +6 -0
  156. package/dist/esm/api/resources/customer/resources/events/resources/ticketing/client/Client.mjs +10 -0
  157. package/dist/esm/api/resources/customer/resources/events/resources/ticketing/client/requests/CreatePaymentIntentRequest.d.mts +1 -0
  158. package/dist/esm/api/resources/customer/resources/events/resources/ticketing/types/CreatePaymentIntentTicketingResponse.d.mts +12 -0
  159. package/dist/esm/api/resources/customer/resources/productOrders/client/Client.d.mts +1 -0
  160. package/dist/esm/api/resources/customer/resources/productOrders/client/Client.mjs +3 -0
  161. package/dist/esm/api/resources/customer/resources/productOrders/client/requests/GetProductOrdersRequest.d.mts +1 -0
  162. package/dist/esm/api/resources/customer/resources/stands/client/Client.d.mts +3 -0
  163. package/dist/esm/api/resources/customer/resources/stands/client/Client.mjs +9 -0
  164. package/dist/esm/api/types/AppHttpResourcesApiV1BusinessCommerceProductResource.d.mts +10 -0
  165. package/dist/esm/api/types/BusinessEvent.d.mts +7 -0
  166. package/dist/esm/api/types/BusinessEventTicketType.d.mts +2 -0
  167. package/dist/esm/api/types/BusinessProfile.d.mts +6 -1
  168. package/dist/esm/api/types/CartResource.d.mts +24 -0
  169. package/dist/esm/api/types/ConflictErrorBody.d.mts +2 -7
  170. package/dist/esm/api/types/ConflictErrorBody.mjs +1 -6
  171. package/dist/esm/api/types/CustomerBusinessProfile.d.mts +1 -1
  172. package/dist/esm/api/types/CustomerEvent.d.mts +6 -0
  173. package/dist/esm/api/types/CustomerEventDetail.d.mts +6 -0
  174. package/dist/esm/api/types/EventFeedItem.d.mts +6 -0
  175. package/dist/esm/api/types/FulfillmentType.d.mts +6 -0
  176. package/dist/esm/api/types/FulfillmentType.mjs +6 -0
  177. package/dist/esm/api/types/ProductResource.d.mts +5 -0
  178. package/dist/esm/api/types/TaxCode.d.mts +21 -0
  179. package/dist/esm/api/types/TaxCode.mjs +12 -0
  180. package/dist/esm/api/types/TicketOrder.d.mts +7 -1
  181. package/dist/esm/api/types/index.d.mts +2 -0
  182. package/dist/esm/api/types/index.mjs +2 -0
  183. package/dist/esm/version.d.mts +1 -1
  184. package/dist/esm/version.mjs +1 -1
  185. package/package.json +12 -1
  186. package/reference.md +382 -16
  187. package/dist/cjs/api/resources/business/resources/productOrders/client/requests/RefundProductOrdersRequest.d.ts +0 -11
  188. package/dist/cjs/api/resources/customer/resources/cart/client/requests/SelectShippingOptionCartRequest.d.ts +0 -14
  189. package/dist/cjs/api/resources/customer/resources/cart/types/GetShippingOptionsCartResponse.d.ts +0 -14
  190. package/dist/esm/api/resources/business/resources/productOrders/client/requests/RefundProductOrdersRequest.d.mts +0 -11
  191. package/dist/esm/api/resources/customer/resources/cart/client/requests/SelectShippingOptionCartRequest.d.mts +0 -14
  192. package/dist/esm/api/resources/customer/resources/cart/types/GetShippingOptionsCartResponse.d.mts +0 -14
  193. /package/dist/cjs/api/resources/business/resources/productOrders/client/requests/{RefundProductOrdersRequest.js → RefundOrderRequest.js} +0 -0
  194. /package/dist/cjs/api/resources/{customer/resources/cart/client/requests/GetShippingOptionsCartRequest.js → business/resources/taxCodes/types/ListTaxCodesResponse.js} +0 -0
  195. /package/dist/cjs/api/resources/customer/resources/cart/client/requests/{SelectShippingOptionCartRequest.js → ChooseFulfillmentMethodRequest.js} +0 -0
  196. /package/dist/cjs/api/resources/customer/resources/cart/{types/GetShippingOptionsCartResponse.js → client/requests/ListShippingOptionsCartRequest.js} +0 -0
  197. /package/dist/esm/api/resources/business/resources/productOrders/client/requests/{RefundProductOrdersRequest.mjs → RefundOrderRequest.mjs} +0 -0
  198. /package/dist/esm/api/resources/{customer/resources/cart/client/requests/GetShippingOptionsCartRequest.mjs → business/resources/taxCodes/types/ListTaxCodesResponse.mjs} +0 -0
  199. /package/dist/esm/api/resources/customer/resources/cart/client/requests/{SelectShippingOptionCartRequest.mjs → ChooseFulfillmentMethodRequest.mjs} +0 -0
  200. /package/dist/esm/api/resources/customer/resources/cart/{types/GetShippingOptionsCartResponse.mjs → client/requests/ListShippingOptionsCartRequest.mjs} +0 -0
@@ -31,6 +31,15 @@ export interface UpdateBusinessProfileRequest {
31
31
  pickup_hours?: string[] | null;
32
32
  same_day_cutoff?: string | null;
33
33
  pickup_instructions?: string | null;
34
+ /**
35
+ * Where Pro is billed, when different from the business address.
36
+ * Send all five together, or all null to clear.
37
+ */
38
+ billing_address?: string | null;
39
+ billing_city?: string | null;
40
+ billing_state?: string | null;
41
+ billing_zipcode?: string | null;
42
+ billing_country?: string | null;
34
43
  }
35
44
  export declare namespace UpdateBusinessProfileRequest {
36
45
  type OperatingMonths = OperatingMonths.Item[];
@@ -0,0 +1,27 @@
1
+ import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.mjs";
2
+ import { type NormalizedClientOptionsWithAuth } from "../../../../../../BaseClient.mjs";
3
+ import * as core from "../../../../../../core/index.mjs";
4
+ import * as FiveOneEat from "../../../../../index.mjs";
5
+ export declare namespace TaxCodesClient {
6
+ type Options = BaseClientOptions;
7
+ interface RequestOptions extends BaseRequestOptions {
8
+ }
9
+ }
10
+ export declare class TaxCodesClient {
11
+ protected readonly _options: NormalizedClientOptionsWithAuth<TaxCodesClient.Options>;
12
+ constructor(options?: TaxCodesClient.Options);
13
+ /**
14
+ * Stripe's full product tax code catalog. A product's `tax_code` must be
15
+ * one where `allowed_on_products` is true; a paid ticket type's must be
16
+ * one where `allowed_on_ticket_types` is true.
17
+ *
18
+ * @param {TaxCodesClient.RequestOptions} requestOptions - Request-specific configuration.
19
+ *
20
+ * @throws {@link FiveOneEat.UnauthorizedError}
21
+ *
22
+ * @example
23
+ * await client.business.taxCodes.list()
24
+ */
25
+ list(requestOptions?: TaxCodesClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.business.ListTaxCodesResponse>;
26
+ private __list;
27
+ }
@@ -0,0 +1,74 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ import { normalizeClientOptionsWithAuth } from "../../../../../../BaseClient.mjs";
12
+ import { mergeHeaders } from "../../../../../../core/headers.mjs";
13
+ import * as core from "../../../../../../core/index.mjs";
14
+ import * as environments from "../../../../../../environments.mjs";
15
+ import { handleNonStatusCodeError } from "../../../../../../errors/handleNonStatusCodeError.mjs";
16
+ import * as errors from "../../../../../../errors/index.mjs";
17
+ import * as FiveOneEat from "../../../../../index.mjs";
18
+ export class TaxCodesClient {
19
+ constructor(options = {}) {
20
+ this._options = normalizeClientOptionsWithAuth(options);
21
+ }
22
+ /**
23
+ * Stripe's full product tax code catalog. A product's `tax_code` must be
24
+ * one where `allowed_on_products` is true; a paid ticket type's must be
25
+ * one where `allowed_on_ticket_types` is true.
26
+ *
27
+ * @param {TaxCodesClient.RequestOptions} requestOptions - Request-specific configuration.
28
+ *
29
+ * @throws {@link FiveOneEat.UnauthorizedError}
30
+ *
31
+ * @example
32
+ * await client.business.taxCodes.list()
33
+ */
34
+ list(requestOptions) {
35
+ return core.HttpResponsePromise.fromPromise(this.__list(requestOptions));
36
+ }
37
+ __list(requestOptions) {
38
+ return __awaiter(this, void 0, void 0, function* () {
39
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
40
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
41
+ 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);
42
+ const _response = yield core.fetcher({
43
+ 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/tax-codes"),
44
+ method: "GET",
45
+ headers: _headers,
46
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
47
+ 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,
48
+ 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,
49
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
50
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
51
+ logging: this._options.logging,
52
+ });
53
+ if (_response.ok) {
54
+ return {
55
+ data: _response.body,
56
+ rawResponse: _response.rawResponse,
57
+ };
58
+ }
59
+ if (_response.error.reason === "status-code") {
60
+ switch (_response.error.statusCode) {
61
+ case 401:
62
+ throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
63
+ default:
64
+ throw new errors.FiveOneEatError({
65
+ statusCode: _response.error.statusCode,
66
+ body: _response.error.body,
67
+ rawResponse: _response.rawResponse,
68
+ });
69
+ }
70
+ }
71
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/business/tax-codes");
72
+ });
73
+ }
74
+ }
@@ -0,0 +1,2 @@
1
+ export { TaxCodesClient } from "./client/Client.mjs";
2
+ export * from "./client/index.mjs";
@@ -0,0 +1,3 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export { TaxCodesClient } from "./client/Client.mjs";
3
+ export * from "./client/index.mjs";
@@ -0,0 +1,2 @@
1
+ export * from "./client/index.mjs";
2
+ export * from "./types/index.mjs";
@@ -0,0 +1,2 @@
1
+ export * from "./client/index.mjs";
2
+ export * from "./types/index.mjs";
@@ -0,0 +1,4 @@
1
+ import type * as FiveOneEat from "../../../../../index.mjs";
2
+ export interface ListTaxCodesResponse {
3
+ data: FiveOneEat.TaxCode[];
4
+ }
@@ -0,0 +1 @@
1
+ export * from "./ListTaxCodesResponse.mjs";
@@ -0,0 +1 @@
1
+ export * from "./ListTaxCodesResponse.mjs";
@@ -88,11 +88,22 @@ export declare class CartClient {
88
88
  removeItem(request: FiveOneEat.customer.RemoveItemCartRequest, requestOptions?: CartClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.customer.RemoveItemCartResponse>;
89
89
  private __removeItem;
90
90
  /**
91
+ * Refused with a 422 and a message while the order can't be priced yet: no
92
+ * fulfillment method chosen (when the shop offers several), a shipped order
93
+ * with no shipping address, or calculated shipping with no option chosen.
94
+ * The message is also in the cart's `fulfillment.checkout_blocker`.
95
+ *
96
+ * A 409 `{status: "paid", message, payment_intent_id}` means the cart's
97
+ * payment already went through (never a second payment): finish checkout
98
+ * with that id. A 409 `{status: "processing", message}` means the payment
99
+ * is still in flight: don't pay again, check back later.
100
+ *
91
101
  * @param {FiveOneEat.customer.CreatePaymentIntentCartRequest} request
92
102
  * @param {CartClient.RequestOptions} requestOptions - Request-specific configuration.
93
103
  *
94
104
  * @throws {@link FiveOneEat.UnauthorizedError}
95
105
  * @throws {@link FiveOneEat.NotFoundError}
106
+ * @throws {@link FiveOneEat.ConflictError}
96
107
  * @throws {@link FiveOneEat.UnprocessableEntityError}
97
108
  *
98
109
  * @example
@@ -103,11 +114,51 @@ export declare class CartClient {
103
114
  createPaymentIntent(request: FiveOneEat.customer.CreatePaymentIntentCartRequest, requestOptions?: CartClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.customer.CreatePaymentIntentCartResponse>;
104
115
  private __createPaymentIntent;
105
116
  /**
117
+ * Call immediately before presenting or confirming the payment sheet. The
118
+ * cart may have changed since its payment intent was created (another
119
+ * device, a changed address or shipping option), so it is re-priced and
120
+ * the intent brought up to date. Send `amount`, the total in cents the
121
+ * buyer is looking at.
122
+ *
123
+ * - `total_changed: false` — pay with the returned `client_secret`.
124
+ * - `total_changed: true` — show "Your total changed to $X", re-initialise
125
+ * the payment sheet with the returned `client_secret` (it carries the new
126
+ * amount), and let the buyer confirm again.
127
+ * - 422 with a message — the order can't be priced yet (the same message
128
+ * as `fulfillment.checkout_blocker`); the old intent is cancelled.
129
+ * - 409 `status: paid` with `payment_intent_id` — the payment already went
130
+ * through; call checkout with that id instead.
131
+ * - 409 `status: processing` — the payment is still processing; don't pay
132
+ * again, check back later.
133
+ *
134
+ * @param {FiveOneEat.customer.RefreshCartPaymentRequest} request
135
+ * @param {CartClient.RequestOptions} requestOptions - Request-specific configuration.
136
+ *
137
+ * @throws {@link FiveOneEat.UnauthorizedError}
138
+ * @throws {@link FiveOneEat.NotFoundError}
139
+ * @throws {@link FiveOneEat.ConflictError}
140
+ * @throws {@link FiveOneEat.UnprocessableEntityError}
141
+ *
142
+ * @example
143
+ * await client.customer.cart.refreshPaymentIntent({
144
+ * business: "business",
145
+ * amount: 1
146
+ * })
147
+ */
148
+ refreshPaymentIntent(request: FiveOneEat.customer.RefreshCartPaymentRequest, requestOptions?: CartClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.customer.RefreshPaymentIntentCartResponse>;
149
+ private __refreshPaymentIntent;
150
+ /**
151
+ * Not gated on commerce readiness: the customer has already paid, so a
152
+ * lapsed readiness check must not stop the order from being recorded.
153
+ * A 409 means the cart changed after the payment was priced: the payment
154
+ * was refunded in full and no order was placed — re-check and pay again.
155
+ *
106
156
  * @param {FiveOneEat.customer.CheckoutCartRequest} request
107
157
  * @param {CartClient.RequestOptions} requestOptions - Request-specific configuration.
108
158
  *
109
159
  * @throws {@link FiveOneEat.UnauthorizedError}
110
160
  * @throws {@link FiveOneEat.NotFoundError}
161
+ * @throws {@link FiveOneEat.ConflictError}
111
162
  * @throws {@link FiveOneEat.UnprocessableEntityError}
112
163
  *
113
164
  * @example
@@ -121,7 +172,28 @@ export declare class CartClient {
121
172
  checkout(request: FiveOneEat.customer.CheckoutCartRequest, requestOptions?: CartClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.customer.CheckoutCartResponse>;
122
173
  private __checkout;
123
174
  /**
124
- * @param {FiveOneEat.customer.GetShippingOptionsCartRequest} request
175
+ * Switching away from shipping clears the saved shipping address and option.
176
+ *
177
+ * @param {FiveOneEat.customer.ChooseFulfillmentMethodRequest} request
178
+ * @param {CartClient.RequestOptions} requestOptions - Request-specific configuration.
179
+ *
180
+ * @throws {@link FiveOneEat.UnauthorizedError}
181
+ * @throws {@link FiveOneEat.NotFoundError}
182
+ * @throws {@link FiveOneEat.UnprocessableEntityError}
183
+ *
184
+ * @example
185
+ * await client.customer.cart.setFulfillment({
186
+ * business: "business",
187
+ * fulfillment_method: "ship"
188
+ * })
189
+ */
190
+ setFulfillment(request: FiveOneEat.customer.ChooseFulfillmentMethodRequest, requestOptions?: CartClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.customer.SetFulfillmentCartResponse>;
191
+ private __setFulfillment;
192
+ /**
193
+ * Sales tax on a shipped order is worked out from this address. Saving a
194
+ * different address clears the chosen shipping option.
195
+ *
196
+ * @param {FiveOneEat.customer.ShippingAddressRequest} request
125
197
  * @param {CartClient.RequestOptions} requestOptions - Request-specific configuration.
126
198
  *
127
199
  * @throws {@link FiveOneEat.UnauthorizedError}
@@ -129,7 +201,7 @@ export declare class CartClient {
129
201
  * @throws {@link FiveOneEat.UnprocessableEntityError}
130
202
  *
131
203
  * @example
132
- * await client.customer.cart.getShippingOptions({
204
+ * await client.customer.cart.setShippingAddress({
133
205
  * business: "business",
134
206
  * address: {
135
207
  * line1: "line1",
@@ -139,10 +211,30 @@ export declare class CartClient {
139
211
  * }
140
212
  * })
141
213
  */
142
- getShippingOptions(request: FiveOneEat.customer.GetShippingOptionsCartRequest, requestOptions?: CartClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.customer.GetShippingOptionsCartResponse>;
143
- private __getShippingOptions;
214
+ setShippingAddress(request: FiveOneEat.customer.ShippingAddressRequest, requestOptions?: CartClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.customer.SetShippingAddressCartResponse>;
215
+ private __setShippingAddress;
216
+ /**
217
+ * Options are held for 30 minutes; choose one by its `provider_rate_id`.
218
+ *
219
+ * @param {FiveOneEat.customer.ListShippingOptionsCartRequest} request
220
+ * @param {CartClient.RequestOptions} requestOptions - Request-specific configuration.
221
+ *
222
+ * @throws {@link FiveOneEat.UnauthorizedError}
223
+ * @throws {@link FiveOneEat.NotFoundError}
224
+ * @throws {@link FiveOneEat.UnprocessableEntityError}
225
+ *
226
+ * @example
227
+ * await client.customer.cart.listShippingOptions({
228
+ * business: "business"
229
+ * })
230
+ */
231
+ listShippingOptions(request: FiveOneEat.customer.ListShippingOptionsCartRequest, requestOptions?: CartClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.customer.ListShippingOptionsCartResponse>;
232
+ private __listShippingOptions;
144
233
  /**
145
- * @param {FiveOneEat.customer.SelectShippingOptionCartRequest} request
234
+ * Send only the `provider_rate_id` from the shipping options. The price is
235
+ * the one quoted; an option older than 30 minutes is refused with a 422.
236
+ *
237
+ * @param {FiveOneEat.customer.SelectShippingRateRequest} request
146
238
  * @param {CartClient.RequestOptions} requestOptions - Request-specific configuration.
147
239
  *
148
240
  * @throws {@link FiveOneEat.UnauthorizedError}
@@ -152,10 +244,9 @@ export declare class CartClient {
152
244
  * @example
153
245
  * await client.customer.cart.selectShippingOption({
154
246
  * business: "business",
155
- * provider_rate_id: "provider_rate_id",
156
- * amount_cents: 1
247
+ * provider_rate_id: "provider_rate_id"
157
248
  * })
158
249
  */
159
- selectShippingOption(request: FiveOneEat.customer.SelectShippingOptionCartRequest, requestOptions?: CartClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.customer.SelectShippingOptionCartResponse>;
250
+ selectShippingOption(request: FiveOneEat.customer.SelectShippingRateRequest, requestOptions?: CartClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.customer.SelectShippingOptionCartResponse>;
160
251
  private __selectShippingOption;
161
252
  }
@@ -321,11 +321,22 @@ export class CartClient {
321
321
  });
322
322
  }
323
323
  /**
324
+ * Refused with a 422 and a message while the order can't be priced yet: no
325
+ * fulfillment method chosen (when the shop offers several), a shipped order
326
+ * with no shipping address, or calculated shipping with no option chosen.
327
+ * The message is also in the cart's `fulfillment.checkout_blocker`.
328
+ *
329
+ * A 409 `{status: "paid", message, payment_intent_id}` means the cart's
330
+ * payment already went through (never a second payment): finish checkout
331
+ * with that id. A 409 `{status: "processing", message}` means the payment
332
+ * is still in flight: don't pay again, check back later.
333
+ *
324
334
  * @param {FiveOneEat.customer.CreatePaymentIntentCartRequest} request
325
335
  * @param {CartClient.RequestOptions} requestOptions - Request-specific configuration.
326
336
  *
327
337
  * @throws {@link FiveOneEat.UnauthorizedError}
328
338
  * @throws {@link FiveOneEat.NotFoundError}
339
+ * @throws {@link FiveOneEat.ConflictError}
329
340
  * @throws {@link FiveOneEat.UnprocessableEntityError}
330
341
  *
331
342
  * @example
@@ -365,6 +376,8 @@ export class CartClient {
365
376
  throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
366
377
  case 404:
367
378
  throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
379
+ case 409:
380
+ throw new FiveOneEat.ConflictError(_response.error.body, _response.rawResponse);
368
381
  case 422:
369
382
  throw new FiveOneEat.UnprocessableEntityError(_response.error.body, _response.rawResponse);
370
383
  default:
@@ -379,11 +392,99 @@ export class CartClient {
379
392
  });
380
393
  }
381
394
  /**
395
+ * Call immediately before presenting or confirming the payment sheet. The
396
+ * cart may have changed since its payment intent was created (another
397
+ * device, a changed address or shipping option), so it is re-priced and
398
+ * the intent brought up to date. Send `amount`, the total in cents the
399
+ * buyer is looking at.
400
+ *
401
+ * - `total_changed: false` — pay with the returned `client_secret`.
402
+ * - `total_changed: true` — show "Your total changed to $X", re-initialise
403
+ * the payment sheet with the returned `client_secret` (it carries the new
404
+ * amount), and let the buyer confirm again.
405
+ * - 422 with a message — the order can't be priced yet (the same message
406
+ * as `fulfillment.checkout_blocker`); the old intent is cancelled.
407
+ * - 409 `status: paid` with `payment_intent_id` — the payment already went
408
+ * through; call checkout with that id instead.
409
+ * - 409 `status: processing` — the payment is still processing; don't pay
410
+ * again, check back later.
411
+ *
412
+ * @param {FiveOneEat.customer.RefreshCartPaymentRequest} request
413
+ * @param {CartClient.RequestOptions} requestOptions - Request-specific configuration.
414
+ *
415
+ * @throws {@link FiveOneEat.UnauthorizedError}
416
+ * @throws {@link FiveOneEat.NotFoundError}
417
+ * @throws {@link FiveOneEat.ConflictError}
418
+ * @throws {@link FiveOneEat.UnprocessableEntityError}
419
+ *
420
+ * @example
421
+ * await client.customer.cart.refreshPaymentIntent({
422
+ * business: "business",
423
+ * amount: 1
424
+ * })
425
+ */
426
+ refreshPaymentIntent(request, requestOptions) {
427
+ return core.HttpResponsePromise.fromPromise(this.__refreshPaymentIntent(request, requestOptions));
428
+ }
429
+ __refreshPaymentIntent(request, requestOptions) {
430
+ return __awaiter(this, void 0, void 0, function* () {
431
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
432
+ const { business } = request, _body = __rest(request, ["business"]);
433
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
434
+ 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);
435
+ const _response = yield core.fetcher({
436
+ 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, `customer/businesses/${core.url.encodePathParam(business)}/cart/payment-intent/refresh`),
437
+ method: "POST",
438
+ headers: _headers,
439
+ contentType: "application/json",
440
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
441
+ requestType: "json",
442
+ body: _body,
443
+ 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,
444
+ 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,
445
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
446
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
447
+ logging: this._options.logging,
448
+ });
449
+ if (_response.ok) {
450
+ return {
451
+ data: _response.body,
452
+ rawResponse: _response.rawResponse,
453
+ };
454
+ }
455
+ if (_response.error.reason === "status-code") {
456
+ switch (_response.error.statusCode) {
457
+ case 401:
458
+ throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
459
+ case 404:
460
+ throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
461
+ case 409:
462
+ throw new FiveOneEat.ConflictError(_response.error.body, _response.rawResponse);
463
+ case 422:
464
+ throw new FiveOneEat.UnprocessableEntityError(_response.error.body, _response.rawResponse);
465
+ default:
466
+ throw new errors.FiveOneEatError({
467
+ statusCode: _response.error.statusCode,
468
+ body: _response.error.body,
469
+ rawResponse: _response.rawResponse,
470
+ });
471
+ }
472
+ }
473
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/customer/businesses/{business}/cart/payment-intent/refresh");
474
+ });
475
+ }
476
+ /**
477
+ * Not gated on commerce readiness: the customer has already paid, so a
478
+ * lapsed readiness check must not stop the order from being recorded.
479
+ * A 409 means the cart changed after the payment was priced: the payment
480
+ * was refunded in full and no order was placed — re-check and pay again.
481
+ *
382
482
  * @param {FiveOneEat.customer.CheckoutCartRequest} request
383
483
  * @param {CartClient.RequestOptions} requestOptions - Request-specific configuration.
384
484
  *
385
485
  * @throws {@link FiveOneEat.UnauthorizedError}
386
486
  * @throws {@link FiveOneEat.NotFoundError}
487
+ * @throws {@link FiveOneEat.ConflictError}
387
488
  * @throws {@link FiveOneEat.UnprocessableEntityError}
388
489
  *
389
490
  * @example
@@ -429,6 +530,8 @@ export class CartClient {
429
530
  throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
430
531
  case 404:
431
532
  throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
533
+ case 409:
534
+ throw new FiveOneEat.ConflictError(_response.error.body, _response.rawResponse);
432
535
  case 422:
433
536
  throw new FiveOneEat.UnprocessableEntityError(_response.error.body, _response.rawResponse);
434
537
  default:
@@ -443,7 +546,74 @@ export class CartClient {
443
546
  });
444
547
  }
445
548
  /**
446
- * @param {FiveOneEat.customer.GetShippingOptionsCartRequest} request
549
+ * Switching away from shipping clears the saved shipping address and option.
550
+ *
551
+ * @param {FiveOneEat.customer.ChooseFulfillmentMethodRequest} request
552
+ * @param {CartClient.RequestOptions} requestOptions - Request-specific configuration.
553
+ *
554
+ * @throws {@link FiveOneEat.UnauthorizedError}
555
+ * @throws {@link FiveOneEat.NotFoundError}
556
+ * @throws {@link FiveOneEat.UnprocessableEntityError}
557
+ *
558
+ * @example
559
+ * await client.customer.cart.setFulfillment({
560
+ * business: "business",
561
+ * fulfillment_method: "ship"
562
+ * })
563
+ */
564
+ setFulfillment(request, requestOptions) {
565
+ return core.HttpResponsePromise.fromPromise(this.__setFulfillment(request, requestOptions));
566
+ }
567
+ __setFulfillment(request, requestOptions) {
568
+ return __awaiter(this, void 0, void 0, function* () {
569
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
570
+ const { business } = request, _body = __rest(request, ["business"]);
571
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
572
+ 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);
573
+ const _response = yield core.fetcher({
574
+ 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, `customer/businesses/${core.url.encodePathParam(business)}/cart/fulfillment`),
575
+ method: "PUT",
576
+ headers: _headers,
577
+ contentType: "application/json",
578
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
579
+ requestType: "json",
580
+ body: _body,
581
+ 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,
582
+ 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,
583
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
584
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
585
+ logging: this._options.logging,
586
+ });
587
+ if (_response.ok) {
588
+ return {
589
+ data: _response.body,
590
+ rawResponse: _response.rawResponse,
591
+ };
592
+ }
593
+ if (_response.error.reason === "status-code") {
594
+ switch (_response.error.statusCode) {
595
+ case 401:
596
+ throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
597
+ case 404:
598
+ throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
599
+ case 422:
600
+ throw new FiveOneEat.UnprocessableEntityError(_response.error.body, _response.rawResponse);
601
+ default:
602
+ throw new errors.FiveOneEatError({
603
+ statusCode: _response.error.statusCode,
604
+ body: _response.error.body,
605
+ rawResponse: _response.rawResponse,
606
+ });
607
+ }
608
+ }
609
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "PUT", "/customer/businesses/{business}/cart/fulfillment");
610
+ });
611
+ }
612
+ /**
613
+ * Sales tax on a shipped order is worked out from this address. Saving a
614
+ * different address clears the chosen shipping option.
615
+ *
616
+ * @param {FiveOneEat.customer.ShippingAddressRequest} request
447
617
  * @param {CartClient.RequestOptions} requestOptions - Request-specific configuration.
448
618
  *
449
619
  * @throws {@link FiveOneEat.UnauthorizedError}
@@ -451,7 +621,7 @@ export class CartClient {
451
621
  * @throws {@link FiveOneEat.UnprocessableEntityError}
452
622
  *
453
623
  * @example
454
- * await client.customer.cart.getShippingOptions({
624
+ * await client.customer.cart.setShippingAddress({
455
625
  * business: "business",
456
626
  * address: {
457
627
  * line1: "line1",
@@ -461,18 +631,18 @@ export class CartClient {
461
631
  * }
462
632
  * })
463
633
  */
464
- getShippingOptions(request, requestOptions) {
465
- return core.HttpResponsePromise.fromPromise(this.__getShippingOptions(request, requestOptions));
634
+ setShippingAddress(request, requestOptions) {
635
+ return core.HttpResponsePromise.fromPromise(this.__setShippingAddress(request, requestOptions));
466
636
  }
467
- __getShippingOptions(request, requestOptions) {
637
+ __setShippingAddress(request, requestOptions) {
468
638
  return __awaiter(this, void 0, void 0, function* () {
469
639
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
470
640
  const { business } = request, _body = __rest(request, ["business"]);
471
641
  const _authRequest = yield this._options.authProvider.getAuthRequest();
472
642
  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);
473
643
  const _response = yield core.fetcher({
474
- 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, `customer/businesses/${core.url.encodePathParam(business)}/cart/shipping-options`),
475
- method: "POST",
644
+ 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, `customer/businesses/${core.url.encodePathParam(business)}/cart/shipping-address`),
645
+ method: "PUT",
476
646
  headers: _headers,
477
647
  contentType: "application/json",
478
648
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
@@ -506,11 +676,74 @@ export class CartClient {
506
676
  });
507
677
  }
508
678
  }
509
- return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/customer/businesses/{business}/cart/shipping-options");
679
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "PUT", "/customer/businesses/{business}/cart/shipping-address");
680
+ });
681
+ }
682
+ /**
683
+ * Options are held for 30 minutes; choose one by its `provider_rate_id`.
684
+ *
685
+ * @param {FiveOneEat.customer.ListShippingOptionsCartRequest} request
686
+ * @param {CartClient.RequestOptions} requestOptions - Request-specific configuration.
687
+ *
688
+ * @throws {@link FiveOneEat.UnauthorizedError}
689
+ * @throws {@link FiveOneEat.NotFoundError}
690
+ * @throws {@link FiveOneEat.UnprocessableEntityError}
691
+ *
692
+ * @example
693
+ * await client.customer.cart.listShippingOptions({
694
+ * business: "business"
695
+ * })
696
+ */
697
+ listShippingOptions(request, requestOptions) {
698
+ return core.HttpResponsePromise.fromPromise(this.__listShippingOptions(request, requestOptions));
699
+ }
700
+ __listShippingOptions(request, requestOptions) {
701
+ return __awaiter(this, void 0, void 0, function* () {
702
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
703
+ const { business } = request;
704
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
705
+ 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);
706
+ const _response = yield core.fetcher({
707
+ 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, `customer/businesses/${core.url.encodePathParam(business)}/cart/shipping-options`),
708
+ method: "GET",
709
+ headers: _headers,
710
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
711
+ 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,
712
+ 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,
713
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
714
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
715
+ logging: this._options.logging,
716
+ });
717
+ if (_response.ok) {
718
+ return {
719
+ data: _response.body,
720
+ rawResponse: _response.rawResponse,
721
+ };
722
+ }
723
+ if (_response.error.reason === "status-code") {
724
+ switch (_response.error.statusCode) {
725
+ case 401:
726
+ throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
727
+ case 404:
728
+ throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
729
+ case 422:
730
+ throw new FiveOneEat.UnprocessableEntityError(_response.error.body, _response.rawResponse);
731
+ default:
732
+ throw new errors.FiveOneEatError({
733
+ statusCode: _response.error.statusCode,
734
+ body: _response.error.body,
735
+ rawResponse: _response.rawResponse,
736
+ });
737
+ }
738
+ }
739
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/customer/businesses/{business}/cart/shipping-options");
510
740
  });
511
741
  }
512
742
  /**
513
- * @param {FiveOneEat.customer.SelectShippingOptionCartRequest} request
743
+ * Send only the `provider_rate_id` from the shipping options. The price is
744
+ * the one quoted; an option older than 30 minutes is refused with a 422.
745
+ *
746
+ * @param {FiveOneEat.customer.SelectShippingRateRequest} request
514
747
  * @param {CartClient.RequestOptions} requestOptions - Request-specific configuration.
515
748
  *
516
749
  * @throws {@link FiveOneEat.UnauthorizedError}
@@ -520,8 +753,7 @@ export class CartClient {
520
753
  * @example
521
754
  * await client.customer.cart.selectShippingOption({
522
755
  * business: "business",
523
- * provider_rate_id: "provider_rate_id",
524
- * amount_cents: 1
756
+ * provider_rate_id: "provider_rate_id"
525
757
  * })
526
758
  */
527
759
  selectShippingOption(request, requestOptions) {