@51eat/sdk 0.0.54 → 0.0.56

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 (156) hide show
  1. package/dist/cjs/BaseClient.js +2 -2
  2. package/dist/cjs/Client.d.ts +3 -0
  3. package/dist/cjs/Client.js +15 -10
  4. package/dist/cjs/api/resources/business/resources/discounts/client/requests/StoreDiscountRequest.d.ts +2 -2
  5. package/dist/cjs/api/resources/business/resources/discounts/client/requests/UpdateDiscountRequest.d.ts +2 -2
  6. package/dist/cjs/api/resources/business/resources/productCategories/client/requests/StoreProductCategoryRequest.d.ts +1 -1
  7. package/dist/cjs/api/resources/business/resources/productCategories/client/requests/UpdateProductCategoryRequest.d.ts +1 -1
  8. package/dist/cjs/api/resources/business/resources/productOrders/client/Client.d.ts +1 -1
  9. package/dist/cjs/api/resources/business/resources/productOrders/client/Client.js +4 -1
  10. package/dist/cjs/api/resources/business/resources/productOrders/types/GetLabelRatesProductOrdersResponseItem.d.ts +10 -0
  11. package/dist/cjs/api/resources/business/resources/productOrders/types/index.d.ts +1 -0
  12. package/dist/cjs/api/resources/business/resources/productOrders/types/index.js +1 -0
  13. package/dist/cjs/api/resources/business/resources/products/client/requests/StoreProductRequest.d.ts +1 -1
  14. package/dist/cjs/api/resources/business/resources/products/client/requests/UpdateProductRequest.d.ts +1 -1
  15. package/dist/cjs/api/resources/business/resources/pushNotifications/types/RegisterPushNotificationsResponse.d.ts +3 -3
  16. package/dist/cjs/api/resources/business/resources/stripeConnect/types/CreateAccountSessionStripeConnectResponse.d.ts +1 -1
  17. package/dist/cjs/api/resources/businessProducts/client/requests/AdjustInventoryRequest.d.ts +2 -10
  18. package/dist/cjs/api/resources/businessProducts/client/requests/AdjustInventoryRequest.js +0 -8
  19. package/dist/cjs/api/resources/customer/resources/businesses/client/Client.d.ts +13 -1
  20. package/dist/cjs/api/resources/customer/resources/businesses/client/Client.js +46 -1
  21. package/dist/cjs/api/resources/customer/resources/businesses/client/requests/GetPickupTimeslotsBusinessesRequest.d.ts +9 -0
  22. package/dist/cjs/api/resources/customer/resources/businesses/client/requests/GetPickupTimeslotsBusinessesRequest.js +3 -0
  23. package/dist/cjs/api/resources/customer/resources/businesses/client/requests/index.d.ts +1 -0
  24. package/dist/cjs/api/resources/customer/resources/cart/client/Client.d.ts +2 -2
  25. package/dist/cjs/api/resources/customer/resources/cart/client/Client.js +5 -2
  26. package/dist/cjs/api/resources/customer/resources/cart/client/requests/AddToCartRequest.d.ts +3 -3
  27. package/dist/cjs/api/resources/customer/resources/cart/types/GetShippingOptionsCartResponseItem.d.ts +19 -0
  28. package/dist/cjs/api/resources/customer/resources/cart/types/GetShippingOptionsCartResponseItem.js +3 -0
  29. package/dist/cjs/api/resources/customer/resources/cart/types/SelectShippingOptionCartResponse.d.ts +2 -7
  30. package/dist/cjs/api/resources/customer/resources/cart/types/index.d.ts +1 -0
  31. package/dist/cjs/api/resources/customer/resources/cart/types/index.js +1 -0
  32. package/dist/cjs/api/resources/customer/resources/events/resources/ticketing/types/CalculatePriceTicketingResponse.d.ts +13 -1
  33. package/dist/cjs/api/resources/customer/resources/events/resources/ticketing/types/ConfirmOrderTicketingResponse.d.ts +3 -3
  34. package/dist/cjs/api/resources/customer/resources/events/resources/ticketing/types/HoldTicketsTicketingResponse.d.ts +13 -2
  35. package/dist/cjs/api/resources/customer/resources/pushNotifications/types/RegisterPushNotificationsResponse.d.ts +3 -3
  36. package/dist/cjs/api/resources/customerBusinesses/client/Client.d.ts +30 -0
  37. package/dist/cjs/api/resources/customerBusinesses/client/Client.js +125 -0
  38. package/dist/cjs/api/resources/customerBusinesses/client/index.d.ts +1 -0
  39. package/dist/cjs/api/resources/customerBusinesses/client/index.js +17 -0
  40. package/dist/cjs/api/resources/customerBusinesses/client/requests/GetBusinessPickupTimeslotsRequest.d.ts +12 -0
  41. package/dist/cjs/api/resources/customerBusinesses/client/requests/GetBusinessPickupTimeslotsRequest.js +3 -0
  42. package/dist/cjs/api/resources/customerBusinesses/client/requests/index.d.ts +1 -0
  43. package/dist/cjs/api/resources/customerBusinesses/client/requests/index.js +2 -0
  44. package/dist/cjs/api/resources/customerBusinesses/exports.d.ts +2 -0
  45. package/dist/cjs/api/resources/customerBusinesses/exports.js +21 -0
  46. package/dist/cjs/api/resources/customerBusinesses/index.d.ts +2 -0
  47. package/dist/cjs/api/resources/customerBusinesses/index.js +18 -0
  48. package/dist/cjs/api/resources/customerBusinesses/types/GetBusinessPickupTimeslotsResponse.d.ts +7 -0
  49. package/dist/cjs/api/resources/customerBusinesses/types/GetBusinessPickupTimeslotsResponse.js +3 -0
  50. package/dist/cjs/api/resources/customerBusinesses/types/index.d.ts +1 -0
  51. package/dist/cjs/api/resources/customerBusinesses/types/index.js +17 -0
  52. package/dist/cjs/api/resources/customerMyAccount/client/Client.d.ts +16 -0
  53. package/dist/cjs/api/resources/customerMyAccount/client/Client.js +54 -0
  54. package/dist/cjs/api/resources/customerMyAccount/client/requests/DownloadAppleWalletPassRequest.d.ts +9 -0
  55. package/dist/cjs/api/resources/customerMyAccount/client/requests/DownloadAppleWalletPassRequest.js +3 -0
  56. package/dist/cjs/api/resources/customerMyAccount/client/requests/index.d.ts +1 -0
  57. package/dist/cjs/api/resources/index.d.ts +3 -0
  58. package/dist/cjs/api/resources/index.js +4 -1
  59. package/dist/cjs/api/resources/serveAd/client/Client.d.ts +1 -1
  60. package/dist/cjs/api/resources/serveAd/client/Client.js +4 -1
  61. package/dist/cjs/api/resources/serveAd/types/AdsServeAdResponse.d.ts +2 -2
  62. package/dist/cjs/api/types/Ad.d.ts +1 -4
  63. package/dist/cjs/api/types/BusinessConversation.d.ts +1 -1
  64. package/dist/cjs/api/types/BusinessEventCheckInStats.d.ts +1 -1
  65. package/dist/cjs/api/types/BusinessEventSalesSummary.d.ts +1 -1
  66. package/dist/cjs/api/types/BusinessMenuItem.d.ts +22 -2
  67. package/dist/cjs/api/types/Conversation.d.ts +1 -1
  68. package/dist/cjs/api/types/CustomerProductOrderItem.d.ts +10 -1
  69. package/dist/cjs/api/types/InventoryChangeType.d.ts +9 -0
  70. package/dist/cjs/api/types/InventoryChangeType.js +12 -0
  71. package/dist/cjs/api/types/Ticket.d.ts +1 -0
  72. package/dist/cjs/api/types/index.d.ts +1 -1
  73. package/dist/cjs/api/types/index.js +1 -1
  74. package/dist/cjs/version.d.ts +1 -1
  75. package/dist/cjs/version.js +1 -1
  76. package/dist/esm/BaseClient.mjs +2 -2
  77. package/dist/esm/Client.d.mts +3 -0
  78. package/dist/esm/Client.mjs +5 -0
  79. package/dist/esm/api/resources/business/resources/discounts/client/requests/StoreDiscountRequest.d.mts +2 -2
  80. package/dist/esm/api/resources/business/resources/discounts/client/requests/UpdateDiscountRequest.d.mts +2 -2
  81. package/dist/esm/api/resources/business/resources/productCategories/client/requests/StoreProductCategoryRequest.d.mts +1 -1
  82. package/dist/esm/api/resources/business/resources/productCategories/client/requests/UpdateProductCategoryRequest.d.mts +1 -1
  83. package/dist/esm/api/resources/business/resources/productOrders/client/Client.d.mts +1 -1
  84. package/dist/esm/api/resources/business/resources/productOrders/client/Client.mjs +4 -1
  85. package/dist/esm/api/resources/business/resources/productOrders/types/GetLabelRatesProductOrdersResponseItem.d.mts +10 -0
  86. package/dist/esm/api/resources/business/resources/productOrders/types/index.d.mts +1 -0
  87. package/dist/esm/api/resources/business/resources/productOrders/types/index.mjs +1 -0
  88. package/dist/esm/api/resources/business/resources/products/client/requests/StoreProductRequest.d.mts +1 -1
  89. package/dist/esm/api/resources/business/resources/products/client/requests/UpdateProductRequest.d.mts +1 -1
  90. package/dist/esm/api/resources/business/resources/pushNotifications/types/RegisterPushNotificationsResponse.d.mts +3 -3
  91. package/dist/esm/api/resources/business/resources/stripeConnect/types/CreateAccountSessionStripeConnectResponse.d.mts +1 -1
  92. package/dist/esm/api/resources/businessProducts/client/requests/AdjustInventoryRequest.d.mts +2 -10
  93. package/dist/esm/api/resources/businessProducts/client/requests/AdjustInventoryRequest.mjs +0 -8
  94. package/dist/esm/api/resources/customer/resources/businesses/client/Client.d.mts +13 -1
  95. package/dist/esm/api/resources/customer/resources/businesses/client/Client.mjs +46 -1
  96. package/dist/esm/api/resources/customer/resources/businesses/client/requests/GetPickupTimeslotsBusinessesRequest.d.mts +9 -0
  97. package/dist/esm/api/resources/customer/resources/businesses/client/requests/GetPickupTimeslotsBusinessesRequest.mjs +2 -0
  98. package/dist/esm/api/resources/customer/resources/businesses/client/requests/index.d.mts +1 -0
  99. package/dist/esm/api/resources/customer/resources/cart/client/Client.d.mts +2 -2
  100. package/dist/esm/api/resources/customer/resources/cart/client/Client.mjs +5 -2
  101. package/dist/esm/api/resources/customer/resources/cart/client/requests/AddToCartRequest.d.mts +3 -3
  102. package/dist/esm/api/resources/customer/resources/cart/types/GetShippingOptionsCartResponseItem.d.mts +19 -0
  103. package/dist/esm/api/resources/customer/resources/cart/types/GetShippingOptionsCartResponseItem.mjs +2 -0
  104. package/dist/esm/api/resources/customer/resources/cart/types/SelectShippingOptionCartResponse.d.mts +2 -7
  105. package/dist/esm/api/resources/customer/resources/cart/types/index.d.mts +1 -0
  106. package/dist/esm/api/resources/customer/resources/cart/types/index.mjs +1 -0
  107. package/dist/esm/api/resources/customer/resources/events/resources/ticketing/types/CalculatePriceTicketingResponse.d.mts +13 -1
  108. package/dist/esm/api/resources/customer/resources/events/resources/ticketing/types/ConfirmOrderTicketingResponse.d.mts +3 -3
  109. package/dist/esm/api/resources/customer/resources/events/resources/ticketing/types/HoldTicketsTicketingResponse.d.mts +13 -2
  110. package/dist/esm/api/resources/customer/resources/pushNotifications/types/RegisterPushNotificationsResponse.d.mts +3 -3
  111. package/dist/esm/api/resources/customerBusinesses/client/Client.d.mts +30 -0
  112. package/dist/esm/api/resources/customerBusinesses/client/Client.mjs +88 -0
  113. package/dist/esm/api/resources/customerBusinesses/client/index.d.mts +1 -0
  114. package/dist/esm/api/resources/customerBusinesses/client/index.mjs +1 -0
  115. package/dist/esm/api/resources/customerBusinesses/client/requests/GetBusinessPickupTimeslotsRequest.d.mts +12 -0
  116. package/dist/esm/api/resources/customerBusinesses/client/requests/GetBusinessPickupTimeslotsRequest.mjs +2 -0
  117. package/dist/esm/api/resources/customerBusinesses/client/requests/index.d.mts +1 -0
  118. package/dist/esm/api/resources/customerBusinesses/client/requests/index.mjs +1 -0
  119. package/dist/esm/api/resources/customerBusinesses/exports.d.mts +2 -0
  120. package/dist/esm/api/resources/customerBusinesses/exports.mjs +3 -0
  121. package/dist/esm/api/resources/customerBusinesses/index.d.mts +2 -0
  122. package/dist/esm/api/resources/customerBusinesses/index.mjs +2 -0
  123. package/dist/esm/api/resources/customerBusinesses/types/GetBusinessPickupTimeslotsResponse.d.mts +7 -0
  124. package/dist/esm/api/resources/customerBusinesses/types/GetBusinessPickupTimeslotsResponse.mjs +2 -0
  125. package/dist/esm/api/resources/customerBusinesses/types/index.d.mts +1 -0
  126. package/dist/esm/api/resources/customerBusinesses/types/index.mjs +1 -0
  127. package/dist/esm/api/resources/customerMyAccount/client/Client.d.mts +16 -0
  128. package/dist/esm/api/resources/customerMyAccount/client/Client.mjs +54 -0
  129. package/dist/esm/api/resources/customerMyAccount/client/requests/DownloadAppleWalletPassRequest.d.mts +9 -0
  130. package/dist/esm/api/resources/customerMyAccount/client/requests/DownloadAppleWalletPassRequest.mjs +2 -0
  131. package/dist/esm/api/resources/customerMyAccount/client/requests/index.d.mts +1 -0
  132. package/dist/esm/api/resources/index.d.mts +3 -0
  133. package/dist/esm/api/resources/index.mjs +3 -0
  134. package/dist/esm/api/resources/serveAd/client/Client.d.mts +1 -1
  135. package/dist/esm/api/resources/serveAd/client/Client.mjs +4 -1
  136. package/dist/esm/api/resources/serveAd/types/AdsServeAdResponse.d.mts +2 -2
  137. package/dist/esm/api/types/Ad.d.mts +1 -4
  138. package/dist/esm/api/types/BusinessConversation.d.mts +1 -1
  139. package/dist/esm/api/types/BusinessEventCheckInStats.d.mts +1 -1
  140. package/dist/esm/api/types/BusinessEventSalesSummary.d.mts +1 -1
  141. package/dist/esm/api/types/BusinessMenuItem.d.mts +22 -2
  142. package/dist/esm/api/types/Conversation.d.mts +1 -1
  143. package/dist/esm/api/types/CustomerProductOrderItem.d.mts +10 -1
  144. package/dist/esm/api/types/InventoryChangeType.d.mts +9 -0
  145. package/dist/esm/api/types/InventoryChangeType.mjs +9 -0
  146. package/dist/esm/api/types/Ticket.d.mts +1 -0
  147. package/dist/esm/api/types/index.d.mts +1 -1
  148. package/dist/esm/api/types/index.mjs +1 -1
  149. package/dist/esm/version.d.mts +1 -1
  150. package/dist/esm/version.mjs +1 -1
  151. package/package.json +12 -1
  152. package/reference.md +188 -5
  153. package/dist/cjs/api/types/JsonResource.d.ts +0 -1
  154. package/dist/esm/api/types/JsonResource.d.mts +0 -1
  155. /package/dist/cjs/api/{types/JsonResource.js → resources/business/resources/productOrders/types/GetLabelRatesProductOrdersResponseItem.js} +0 -0
  156. /package/dist/esm/api/{types/JsonResource.mjs → resources/business/resources/productOrders/types/GetLabelRatesProductOrdersResponseItem.mjs} +0 -0
@@ -13,6 +13,7 @@ import { BusinessMessagingClient } from "./api/resources/businessMessaging/clien
13
13
  import { BusinessProductsClient } from "./api/resources/businessProducts/client/Client.mjs";
14
14
  import { BusinessShippingClient } from "./api/resources/businessShipping/client/Client.mjs";
15
15
  import { CustomerClient } from "./api/resources/customer/client/Client.mjs";
16
+ import { CustomerBusinessesClient } from "./api/resources/customerBusinesses/client/Client.mjs";
16
17
  import { CustomerEventsClient } from "./api/resources/customerEvents/client/Client.mjs";
17
18
  import { CustomerMessagingClient } from "./api/resources/customerMessaging/client/Client.mjs";
18
19
  import { CustomerMyAccountClient } from "./api/resources/customerMyAccount/client/Client.mjs";
@@ -36,6 +37,10 @@ export class FiveOneEatClient {
36
37
  var _a;
37
38
  return ((_a = this._businessShipping) !== null && _a !== void 0 ? _a : (this._businessShipping = new BusinessShippingClient(this._options)));
38
39
  }
40
+ get customerBusinesses() {
41
+ var _a;
42
+ return ((_a = this._customerBusinesses) !== null && _a !== void 0 ? _a : (this._customerBusinesses = new CustomerBusinessesClient(this._options)));
43
+ }
39
44
  get customerEvents() {
40
45
  var _a;
41
46
  return ((_a = this._customerEvents) !== null && _a !== void 0 ? _a : (this._customerEvents = new CustomerEventsClient(this._options)));
@@ -19,8 +19,8 @@ export interface StoreDiscountRequest {
19
19
  starts_at?: string | null;
20
20
  ends_at?: string | null;
21
21
  is_active?: boolean;
22
- product_ids?: number[] | null;
23
- category_ids?: number[] | null;
22
+ product_ids?: string[] | null;
23
+ category_ids?: string[] | null;
24
24
  }
25
25
  export declare namespace StoreDiscountRequest {
26
26
  const Type: {
@@ -18,8 +18,8 @@ export interface UpdateDiscountRequest {
18
18
  starts_at?: string | null;
19
19
  ends_at?: string | null;
20
20
  is_active?: boolean;
21
- product_ids?: number[] | null;
22
- category_ids?: number[] | null;
21
+ product_ids?: string[] | null;
22
+ category_ids?: string[] | null;
23
23
  }
24
24
  export declare namespace UpdateDiscountRequest {
25
25
  const Type: {
@@ -7,6 +7,6 @@
7
7
  export interface StoreProductCategoryRequest {
8
8
  name: string;
9
9
  description?: string | null;
10
- parent_id?: number | null;
10
+ parent_id?: string | null;
11
11
  sort_order?: number;
12
12
  }
@@ -9,6 +9,6 @@ export interface UpdateProductCategoryRequest {
9
9
  productCategory: string;
10
10
  name?: string;
11
11
  description?: string | null;
12
- parent_id?: number | null;
12
+ parent_id?: string | null;
13
13
  sort_order?: number;
14
14
  }
@@ -120,7 +120,7 @@ export declare class ProductOrdersClient {
120
120
  * productOrder: "productOrder"
121
121
  * })
122
122
  */
123
- getLabelRates(request: FiveOneEat.business.GetLabelRatesProductOrdersRequest, requestOptions?: ProductOrdersClient.RequestOptions): core.HttpResponsePromise<string>;
123
+ getLabelRates(request: FiveOneEat.business.GetLabelRatesProductOrdersRequest, requestOptions?: ProductOrdersClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.business.GetLabelRatesProductOrdersResponseItem[]>;
124
124
  private __getLabelRates;
125
125
  /**
126
126
  * @param {FiveOneEat.business.PurchaseLabelRequest} request
@@ -424,7 +424,10 @@ export class ProductOrdersClient {
424
424
  logging: this._options.logging,
425
425
  });
426
426
  if (_response.ok) {
427
- return { data: _response.body, rawResponse: _response.rawResponse };
427
+ return {
428
+ data: _response.body,
429
+ rawResponse: _response.rawResponse,
430
+ };
428
431
  }
429
432
  if (_response.error.reason === "status-code") {
430
433
  switch (_response.error.statusCode) {
@@ -0,0 +1,10 @@
1
+ export interface GetLabelRatesProductOrdersResponseItem {
2
+ provider_rate_id: string;
3
+ carrier: string;
4
+ service: string;
5
+ amount_cents: number;
6
+ amount: string;
7
+ currency: string;
8
+ carrier_delivery_days: number | null;
9
+ estimated_delivery_date: string | null;
10
+ }
@@ -1,5 +1,6 @@
1
1
  export * from "./AddTrackingProductOrdersResponse.mjs";
2
2
  export * from "./FulfillProductOrdersResponse.mjs";
3
+ export * from "./GetLabelRatesProductOrdersResponseItem.mjs";
3
4
  export * from "./GetProductOrdersResponse.mjs";
4
5
  export * from "./ListProductOrdersResponse.mjs";
5
6
  export * from "./MarkPickedUpProductOrdersResponse.mjs";
@@ -1,5 +1,6 @@
1
1
  export * from "./AddTrackingProductOrdersResponse.mjs";
2
2
  export * from "./FulfillProductOrdersResponse.mjs";
3
+ export * from "./GetLabelRatesProductOrdersResponseItem.mjs";
3
4
  export * from "./GetProductOrdersResponse.mjs";
4
5
  export * from "./ListProductOrdersResponse.mjs";
5
6
  export * from "./MarkPickedUpProductOrdersResponse.mjs";
@@ -31,7 +31,7 @@ export interface StoreProductRequest {
31
31
  tax_code?: string | null;
32
32
  is_active?: boolean;
33
33
  is_featured?: boolean;
34
- category_ids?: number[] | null;
34
+ category_ids?: string[] | null;
35
35
  }
36
36
  export declare namespace StoreProductRequest {
37
37
  const ProductType: {
@@ -32,7 +32,7 @@ export interface UpdateProductRequest {
32
32
  is_active?: boolean;
33
33
  published_at?: string | null;
34
34
  is_featured?: boolean;
35
- category_ids?: number[] | null;
35
+ category_ids?: string[] | null;
36
36
  }
37
37
  export declare namespace UpdateProductRequest {
38
38
  const ProductType: {
@@ -1,7 +1,7 @@
1
1
  export interface RegisterPushNotificationsResponse {
2
2
  id: string;
3
3
  token: string;
4
- device_id: string;
5
- device_name: string;
6
- platform: string;
4
+ device_id: string | null;
5
+ device_name: string | null;
6
+ platform: string | null;
7
7
  }
@@ -1,4 +1,4 @@
1
1
  export interface CreateAccountSessionStripeConnectResponse {
2
2
  client_secret: string;
3
- expires_at: string;
3
+ expires_at: string | null;
4
4
  }
@@ -1,3 +1,4 @@
1
+ import type * as FiveOneEat from "../../../../index.mjs";
1
2
  /**
2
3
  * @example
3
4
  * {
@@ -12,7 +13,7 @@ export interface AdjustInventoryRequest {
12
13
  variant: string;
13
14
  type: AdjustInventoryRequest.Type;
14
15
  quantity: number;
15
- reason: AdjustInventoryRequest.Reason;
16
+ reason: FiveOneEat.InventoryChangeType;
16
17
  notes?: string | null;
17
18
  }
18
19
  export declare namespace AdjustInventoryRequest {
@@ -22,13 +23,4 @@ export declare namespace AdjustInventoryRequest {
22
23
  readonly Set: "set";
23
24
  };
24
25
  type Type = (typeof Type)[keyof typeof Type];
25
- const Reason: {
26
- readonly Restock: "restock";
27
- readonly Damaged: "damaged";
28
- readonly Shrinkage: "shrinkage";
29
- readonly Returned: "returned";
30
- readonly Correction: "correction";
31
- readonly Other: "other";
32
- };
33
- type Reason = (typeof Reason)[keyof typeof Reason];
34
26
  }
@@ -6,12 +6,4 @@ export var AdjustInventoryRequest;
6
6
  Subtract: "subtract",
7
7
  Set: "set",
8
8
  };
9
- AdjustInventoryRequest.Reason = {
10
- Restock: "restock",
11
- Damaged: "damaged",
12
- Shrinkage: "shrinkage",
13
- Returned: "returned",
14
- Correction: "correction",
15
- Other: "other",
16
- };
17
9
  })(AdjustInventoryRequest || (AdjustInventoryRequest = {}));
@@ -87,13 +87,14 @@ export declare class BusinessesClient {
87
87
  * @param {BusinessesClient.RequestOptions} requestOptions - Request-specific configuration.
88
88
  *
89
89
  * @throws {@link FiveOneEat.UnauthorizedError}
90
+ * @throws {@link FiveOneEat.NotFoundError}
90
91
  *
91
92
  * @example
92
93
  * await client.customer.businesses.unfavorite({
93
94
  * business: "katzs-deli"
94
95
  * })
95
96
  */
96
- unfavorite(request: FiveOneEat.customer.UnfavoriteBusinessesRequest, requestOptions?: BusinessesClient.RequestOptions): core.HttpResponsePromise<Record<string, unknown>>;
97
+ unfavorite(request: FiveOneEat.customer.UnfavoriteBusinessesRequest, requestOptions?: BusinessesClient.RequestOptions): core.HttpResponsePromise<void>;
97
98
  private __unfavorite;
98
99
  /**
99
100
  * Retrieve active and upcoming temporary locations for a business.
@@ -110,4 +111,15 @@ export declare class BusinessesClient {
110
111
  */
111
112
  listTemporaryLocations(request: FiveOneEat.customer.ListTemporaryLocationsBusinessesRequest, requestOptions?: BusinessesClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.customer.ListTemporaryLocationsBusinessesResponse>;
112
113
  private __listTemporaryLocations;
114
+ /**
115
+ * @param {FiveOneEat.customer.GetPickupTimeslotsBusinessesRequest} request
116
+ * @param {BusinessesClient.RequestOptions} requestOptions - Request-specific configuration.
117
+ *
118
+ * @example
119
+ * await client.customer.businesses.getPickupTimeslots({
120
+ * business: "business"
121
+ * })
122
+ */
123
+ getPickupTimeslots(request: FiveOneEat.customer.GetPickupTimeslotsBusinessesRequest, requestOptions?: BusinessesClient.RequestOptions): core.HttpResponsePromise<void>;
124
+ private __getPickupTimeslots;
113
125
  }
@@ -282,6 +282,7 @@ export class BusinessesClient {
282
282
  * @param {BusinessesClient.RequestOptions} requestOptions - Request-specific configuration.
283
283
  *
284
284
  * @throws {@link FiveOneEat.UnauthorizedError}
285
+ * @throws {@link FiveOneEat.NotFoundError}
285
286
  *
286
287
  * @example
287
288
  * await client.customer.businesses.unfavorite({
@@ -309,12 +310,14 @@ export class BusinessesClient {
309
310
  logging: this._options.logging,
310
311
  });
311
312
  if (_response.ok) {
312
- return { data: _response.body, rawResponse: _response.rawResponse };
313
+ return { data: undefined, rawResponse: _response.rawResponse };
313
314
  }
314
315
  if (_response.error.reason === "status-code") {
315
316
  switch (_response.error.statusCode) {
316
317
  case 401:
317
318
  throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
319
+ case 404:
320
+ throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
318
321
  default:
319
322
  throw new errors.FiveOneEatError({
320
323
  statusCode: _response.error.statusCode,
@@ -380,4 +383,46 @@ export class BusinessesClient {
380
383
  return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/customer/businesses/{business}/temporary-locations");
381
384
  });
382
385
  }
386
+ /**
387
+ * @param {FiveOneEat.customer.GetPickupTimeslotsBusinessesRequest} request
388
+ * @param {BusinessesClient.RequestOptions} requestOptions - Request-specific configuration.
389
+ *
390
+ * @example
391
+ * await client.customer.businesses.getPickupTimeslots({
392
+ * business: "business"
393
+ * })
394
+ */
395
+ getPickupTimeslots(request, requestOptions) {
396
+ return core.HttpResponsePromise.fromPromise(this.__getPickupTimeslots(request, requestOptions));
397
+ }
398
+ __getPickupTimeslots(request, requestOptions) {
399
+ return __awaiter(this, void 0, void 0, function* () {
400
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
401
+ const { business } = request;
402
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
403
+ 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);
404
+ const _response = yield core.fetcher({
405
+ 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)}/pickup-timeslots`),
406
+ method: "GET",
407
+ headers: _headers,
408
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
409
+ 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,
410
+ 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,
411
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
412
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
413
+ logging: this._options.logging,
414
+ });
415
+ if (_response.ok) {
416
+ return { data: undefined, rawResponse: _response.rawResponse };
417
+ }
418
+ if (_response.error.reason === "status-code") {
419
+ throw new errors.FiveOneEatError({
420
+ statusCode: _response.error.statusCode,
421
+ body: _response.error.body,
422
+ rawResponse: _response.rawResponse,
423
+ });
424
+ }
425
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/customer/businesses/{business}/pickup-timeslots");
426
+ });
427
+ }
383
428
  }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * business: "business"
5
+ * }
6
+ */
7
+ export interface GetPickupTimeslotsBusinessesRequest {
8
+ business: string;
9
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -1,4 +1,5 @@
1
1
  export type { FavoriteBusinessesRequest } from "./FavoriteBusinessesRequest.mjs";
2
+ export type { GetPickupTimeslotsBusinessesRequest } from "./GetPickupTimeslotsBusinessesRequest.mjs";
2
3
  export type { ListTemporaryLocationsBusinessesRequest } from "./ListTemporaryLocationsBusinessesRequest.mjs";
3
4
  export type { MenusBusinessesRequest } from "./MenusBusinessesRequest.mjs";
4
5
  export type { PhotosBusinessesRequest } from "./PhotosBusinessesRequest.mjs";
@@ -33,7 +33,7 @@ export declare class CartClient {
33
33
  * @example
34
34
  * await client.customer.cart.addItem({
35
35
  * business: "katzs-deli",
36
- * product_id: 1,
36
+ * product_id: "product_id",
37
37
  * quantity: 1
38
38
  * })
39
39
  */
@@ -155,7 +155,7 @@ export declare class CartClient {
155
155
  * }
156
156
  * })
157
157
  */
158
- getShippingOptions(request: FiveOneEat.customer.GetShippingOptionsRequest, requestOptions?: CartClient.RequestOptions): core.HttpResponsePromise<unknown[]>;
158
+ getShippingOptions(request: FiveOneEat.customer.GetShippingOptionsRequest, requestOptions?: CartClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.customer.GetShippingOptionsCartResponseItem[]>;
159
159
  private __getShippingOptions;
160
160
  /**
161
161
  * Pass either `shipping_rate_id` (for flat/free rates) or `provider_rate_id`
@@ -89,7 +89,7 @@ export class CartClient {
89
89
  * @example
90
90
  * await client.customer.cart.addItem({
91
91
  * business: "katzs-deli",
92
- * product_id: 1,
92
+ * product_id: "product_id",
93
93
  * quantity: 1
94
94
  * })
95
95
  */
@@ -497,7 +497,10 @@ export class CartClient {
497
497
  logging: this._options.logging,
498
498
  });
499
499
  if (_response.ok) {
500
- return { data: _response.body, rawResponse: _response.rawResponse };
500
+ return {
501
+ data: _response.body,
502
+ rawResponse: _response.rawResponse,
503
+ };
501
504
  }
502
505
  if (_response.error.reason === "status-code") {
503
506
  switch (_response.error.statusCode) {
@@ -2,14 +2,14 @@
2
2
  * @example
3
3
  * {
4
4
  * business: "katzs-deli",
5
- * product_id: 1,
5
+ * product_id: "product_id",
6
6
  * quantity: 1
7
7
  * }
8
8
  */
9
9
  export interface AddToCartRequest {
10
10
  /** The business handle */
11
11
  business: string;
12
- product_id: number;
13
- variant_id?: number | null;
12
+ product_id: string;
13
+ variant_id?: string | null;
14
14
  quantity: number;
15
15
  }
@@ -0,0 +1,19 @@
1
+ export type GetShippingOptionsCartResponseItem = {
2
+ shipping_rate_id: string;
3
+ provider_rate_id: unknown | null;
4
+ name: string;
5
+ amount_cents: number;
6
+ amount: string;
7
+ carrier: unknown | null;
8
+ service: unknown | null;
9
+ estimated_days: unknown | null;
10
+ } | {
11
+ shipping_rate_id: unknown | null;
12
+ provider_rate_id: string;
13
+ name: string;
14
+ amount_cents: string;
15
+ amount: string;
16
+ carrier: string;
17
+ service: string;
18
+ estimated_days: string;
19
+ };
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -1,11 +1,6 @@
1
- export type SelectShippingOptionCartResponse = {
1
+ export interface SelectShippingOptionCartResponse {
2
2
  shipping_amount: string;
3
3
  shipping_amount_cents: number;
4
4
  shipping_method: string;
5
5
  total_amount: string;
6
- } | {
7
- shipping_amount: string;
8
- shipping_amount_cents: number;
9
- shipping_method: string;
10
- total_amount: string;
11
- };
6
+ }
@@ -3,6 +3,7 @@ export * from "./CheckoutCartResponse.mjs";
3
3
  export * from "./ClearCartResponse.mjs";
4
4
  export * from "./CreatePaymentIntentCartResponse.mjs";
5
5
  export * from "./GetCartResponse.mjs";
6
+ export * from "./GetShippingOptionsCartResponseItem.mjs";
6
7
  export * from "./RemoveItemCartResponse.mjs";
7
8
  export * from "./SelectShippingOptionCartResponse.mjs";
8
9
  export * from "./UpdateItemCartResponse.mjs";
@@ -3,6 +3,7 @@ export * from "./CheckoutCartResponse.mjs";
3
3
  export * from "./ClearCartResponse.mjs";
4
4
  export * from "./CreatePaymentIntentCartResponse.mjs";
5
5
  export * from "./GetCartResponse.mjs";
6
+ export * from "./GetShippingOptionsCartResponseItem.mjs";
6
7
  export * from "./RemoveItemCartResponse.mjs";
7
8
  export * from "./SelectShippingOptionCartResponse.mjs";
8
9
  export * from "./UpdateItemCartResponse.mjs";
@@ -6,6 +6,18 @@ export declare namespace CalculatePriceTicketingResponse {
6
6
  subtotal: string;
7
7
  platform_fee: string;
8
8
  total: string;
9
- line_items: string;
9
+ line_items: Data.LineItems.Item[];
10
+ }
11
+ namespace Data {
12
+ type LineItems = LineItems.Item[];
13
+ namespace LineItems {
14
+ interface Item {
15
+ ticket_type_id: string;
16
+ ticket_type_name: string;
17
+ unit_price: string;
18
+ quantity: string;
19
+ line_total: string;
20
+ }
21
+ }
10
22
  }
11
23
  }
@@ -1,4 +1,4 @@
1
1
  import type * as FiveOneEat from "../../../../../../../index.mjs";
2
- export type ConfirmOrderTicketingResponse = {
3
- data: FiveOneEat.JsonResource;
4
- } | Record<string, unknown>;
2
+ export interface ConfirmOrderTicketingResponse {
3
+ data: FiveOneEat.TicketOrder;
4
+ }
@@ -5,7 +5,18 @@ export declare namespace HoldTicketsTicketingResponse {
5
5
  interface Data {
6
6
  ticket_cart_id: string;
7
7
  expires_at: string;
8
- time_remaining_seconds: string;
9
- holds: string;
8
+ time_remaining_seconds: number;
9
+ holds: Data.Holds.Item[];
10
+ }
11
+ namespace Data {
12
+ type Holds = Holds.Item[];
13
+ namespace Holds {
14
+ interface Item {
15
+ id: number;
16
+ ticket_type_id: string;
17
+ quantity: number;
18
+ expires_at: string;
19
+ }
20
+ }
10
21
  }
11
22
  }
@@ -1,7 +1,7 @@
1
1
  export interface RegisterPushNotificationsResponse {
2
2
  id: string;
3
3
  token: string;
4
- device_id: string;
5
- device_name: string;
6
- platform: string;
4
+ device_id: string | null;
5
+ device_name: string | null;
6
+ platform: string | null;
7
7
  }
@@ -0,0 +1,30 @@
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 CustomerBusinessesClient {
6
+ type Options = BaseClientOptions;
7
+ interface RequestOptions extends BaseRequestOptions {
8
+ }
9
+ }
10
+ export declare class CustomerBusinessesClient {
11
+ protected readonly _options: NormalizedClientOptionsWithAuth<CustomerBusinessesClient.Options>;
12
+ constructor(options?: CustomerBusinessesClient.Options);
13
+ /**
14
+ * Returns available pickup timeslots for a business on a given date.
15
+ *
16
+ * @param {FiveOneEat.GetBusinessPickupTimeslotsRequest} request
17
+ * @param {CustomerBusinessesClient.RequestOptions} requestOptions - Request-specific configuration.
18
+ *
19
+ * @throws {@link FiveOneEat.UnauthorizedError}
20
+ * @throws {@link FiveOneEat.UnprocessableEntityError}
21
+ *
22
+ * @example
23
+ * await client.customerBusinesses.getBusinessPickupTimeslots({
24
+ * handle: "katzs-deli",
25
+ * date: "2023-01-15"
26
+ * })
27
+ */
28
+ getBusinessPickupTimeslots(request: FiveOneEat.GetBusinessPickupTimeslotsRequest, requestOptions?: CustomerBusinessesClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.GetBusinessPickupTimeslotsResponse>;
29
+ private __getBusinessPickupTimeslots;
30
+ }
@@ -0,0 +1,88 @@
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 CustomerBusinessesClient {
19
+ constructor(options = {}) {
20
+ this._options = normalizeClientOptionsWithAuth(options);
21
+ }
22
+ /**
23
+ * Returns available pickup timeslots for a business on a given date.
24
+ *
25
+ * @param {FiveOneEat.GetBusinessPickupTimeslotsRequest} request
26
+ * @param {CustomerBusinessesClient.RequestOptions} requestOptions - Request-specific configuration.
27
+ *
28
+ * @throws {@link FiveOneEat.UnauthorizedError}
29
+ * @throws {@link FiveOneEat.UnprocessableEntityError}
30
+ *
31
+ * @example
32
+ * await client.customerBusinesses.getBusinessPickupTimeslots({
33
+ * handle: "katzs-deli",
34
+ * date: "2023-01-15"
35
+ * })
36
+ */
37
+ getBusinessPickupTimeslots(request, requestOptions) {
38
+ return core.HttpResponsePromise.fromPromise(this.__getBusinessPickupTimeslots(request, requestOptions));
39
+ }
40
+ __getBusinessPickupTimeslots(request, requestOptions) {
41
+ return __awaiter(this, void 0, void 0, function* () {
42
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
43
+ const { handle, date } = request;
44
+ const _queryParams = {
45
+ date,
46
+ };
47
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
48
+ 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);
49
+ const _response = yield core.fetcher({
50
+ 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(handle)}/pickup-timeslots`),
51
+ method: "GET",
52
+ headers: _headers,
53
+ queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
54
+ queryString: core.url
55
+ .queryBuilder()
56
+ .addMany(_queryParams)
57
+ .mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
58
+ .build(),
59
+ 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,
60
+ 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,
61
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
62
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
63
+ logging: this._options.logging,
64
+ });
65
+ if (_response.ok) {
66
+ return {
67
+ data: _response.body,
68
+ rawResponse: _response.rawResponse,
69
+ };
70
+ }
71
+ if (_response.error.reason === "status-code") {
72
+ switch (_response.error.statusCode) {
73
+ case 401:
74
+ throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
75
+ case 422:
76
+ throw new FiveOneEat.UnprocessableEntityError(_response.error.body, _response.rawResponse);
77
+ default:
78
+ throw new errors.FiveOneEatError({
79
+ statusCode: _response.error.statusCode,
80
+ body: _response.error.body,
81
+ rawResponse: _response.rawResponse,
82
+ });
83
+ }
84
+ }
85
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/customer/businesses/{handle}/pickup-timeslots");
86
+ });
87
+ }
88
+ }
@@ -0,0 +1 @@
1
+ export * from "./requests/index.mjs";
@@ -0,0 +1 @@
1
+ export * from "./requests/index.mjs";