@51eat/sdk 0.0.78 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (133) hide show
  1. package/README.md +15 -13
  2. package/dist/cjs/BaseClient.js +2 -2
  3. package/dist/cjs/Client.d.ts +0 -3
  4. package/dist/cjs/Client.js +2 -7
  5. package/dist/cjs/api/resources/business/resources/productOrders/client/Client.d.ts +9 -0
  6. package/dist/cjs/api/resources/business/resources/productOrders/client/Client.js +13 -0
  7. package/dist/cjs/api/resources/customer/resources/businesses/types/GetPickupTimeslotsBusinessesResponse.d.ts +2 -5
  8. package/dist/cjs/api/resources/customer/resources/cart/client/Client.d.ts +13 -4
  9. package/dist/cjs/api/resources/customer/resources/cart/client/Client.js +13 -4
  10. package/dist/cjs/api/resources/customer/resources/cart/client/requests/AddItemCartRequest.d.ts +6 -4
  11. package/dist/cjs/api/resources/customer/resources/cart/client/requests/{UpdateItemCartRequest.d.ts → UpdateCartItemRequest.d.ts} +1 -1
  12. package/dist/cjs/api/resources/customer/resources/cart/client/requests/index.d.ts +1 -1
  13. package/dist/cjs/api/resources/customer/resources/shop/client/requests/GetProductShopRequest.d.ts +1 -1
  14. package/dist/cjs/api/resources/customer/resources/shop/client/requests/ListCategoriesShopRequest.d.ts +1 -1
  15. package/dist/cjs/api/resources/customer/resources/shop/client/requests/ListProductsShopRequest.d.ts +1 -1
  16. package/dist/cjs/api/resources/customer/resources/stands/client/Client.d.ts +71 -0
  17. package/dist/cjs/api/resources/customer/resources/stands/client/Client.js +243 -0
  18. package/dist/cjs/api/resources/customer/resources/stands/client/requests/AddCartItemStandsRequest.d.ts +16 -0
  19. package/dist/{esm/api/resources/customerStands/client/requests/CustomerGetStandCartRequest.d.mts → cjs/api/resources/customer/resources/stands/client/requests/ClearCartStandsRequest.d.ts} +1 -1
  20. package/dist/cjs/api/resources/{customerStands/client/requests/CustomerGetStandCartRequest.d.ts → customer/resources/stands/client/requests/GetCartStandsRequest.d.ts} +1 -1
  21. package/dist/cjs/api/resources/customer/resources/stands/client/requests/NearbyStandsRequest.d.ts +13 -0
  22. package/dist/cjs/api/resources/customer/resources/stands/client/requests/index.d.ts +4 -0
  23. package/dist/cjs/api/resources/customer/resources/stands/types/AddCartItemStandsResponse.d.ts +4 -0
  24. package/dist/cjs/api/resources/customer/resources/stands/types/GetCartStandsResponse.d.ts +4 -0
  25. package/dist/cjs/api/resources/customer/resources/stands/types/GetCartStandsResponse.js +3 -0
  26. package/dist/cjs/api/resources/customer/resources/stands/types/NearbyStandsResponse.d.ts +10 -0
  27. package/dist/cjs/api/resources/customer/resources/stands/types/NearbyStandsResponse.js +3 -0
  28. package/dist/cjs/api/resources/customer/resources/stands/types/index.d.ts +3 -0
  29. package/dist/cjs/api/resources/customer/resources/stands/types/index.js +3 -0
  30. package/dist/cjs/api/resources/index.d.ts +0 -3
  31. package/dist/cjs/api/resources/index.js +1 -4
  32. package/dist/cjs/api/types/AddCartItemRequest.d.ts +9 -0
  33. package/dist/cjs/api/types/AddCartItemRequest.js +3 -0
  34. package/dist/cjs/api/types/BusinessEvent.d.ts +1 -0
  35. package/dist/cjs/api/types/CartResource.d.ts +5 -0
  36. package/dist/cjs/api/types/ExploreResponse.d.ts +1 -0
  37. package/dist/cjs/api/types/ExploreStand.d.ts +18 -0
  38. package/dist/cjs/api/types/ExploreStand.js +3 -0
  39. package/dist/cjs/api/types/NearbyStand.d.ts +19 -0
  40. package/dist/cjs/api/types/NearbyStand.js +3 -0
  41. package/dist/cjs/api/types/OrderResource.d.ts +9 -0
  42. package/dist/cjs/api/types/index.d.ts +3 -0
  43. package/dist/cjs/api/types/index.js +3 -0
  44. package/dist/cjs/version.d.ts +1 -1
  45. package/dist/cjs/version.js +1 -1
  46. package/dist/esm/BaseClient.mjs +2 -2
  47. package/dist/esm/Client.d.mts +0 -3
  48. package/dist/esm/Client.mjs +0 -5
  49. package/dist/esm/api/resources/business/resources/productOrders/client/Client.d.mts +9 -0
  50. package/dist/esm/api/resources/business/resources/productOrders/client/Client.mjs +13 -0
  51. package/dist/esm/api/resources/customer/resources/businesses/types/GetPickupTimeslotsBusinessesResponse.d.mts +2 -5
  52. package/dist/esm/api/resources/customer/resources/cart/client/Client.d.mts +13 -4
  53. package/dist/esm/api/resources/customer/resources/cart/client/Client.mjs +13 -4
  54. package/dist/esm/api/resources/customer/resources/cart/client/requests/AddItemCartRequest.d.mts +6 -4
  55. package/dist/esm/api/resources/customer/resources/cart/client/requests/{UpdateItemCartRequest.d.mts → UpdateCartItemRequest.d.mts} +1 -1
  56. package/dist/esm/api/resources/customer/resources/cart/client/requests/index.d.mts +1 -1
  57. package/dist/esm/api/resources/customer/resources/shop/client/requests/GetProductShopRequest.d.mts +1 -1
  58. package/dist/esm/api/resources/customer/resources/shop/client/requests/ListCategoriesShopRequest.d.mts +1 -1
  59. package/dist/esm/api/resources/customer/resources/shop/client/requests/ListProductsShopRequest.d.mts +1 -1
  60. package/dist/esm/api/resources/customer/resources/stands/client/Client.d.mts +71 -0
  61. package/dist/esm/api/resources/customer/resources/stands/client/Client.mjs +243 -0
  62. package/dist/esm/api/resources/customer/resources/stands/client/requests/AddCartItemStandsRequest.d.mts +16 -0
  63. package/dist/esm/api/resources/{customerStands/client/requests/CustomerClearStandCartRequest.d.mts → customer/resources/stands/client/requests/ClearCartStandsRequest.d.mts} +1 -1
  64. package/dist/{cjs/api/resources/customerStands/client/requests/CustomerClearStandCartRequest.d.ts → esm/api/resources/customer/resources/stands/client/requests/GetCartStandsRequest.d.mts} +1 -1
  65. package/dist/esm/api/resources/customer/resources/stands/client/requests/NearbyStandsRequest.d.mts +13 -0
  66. package/dist/esm/api/resources/customer/resources/stands/client/requests/index.d.mts +4 -0
  67. package/dist/esm/api/resources/customer/resources/stands/types/AddCartItemStandsResponse.d.mts +4 -0
  68. package/dist/esm/api/resources/customer/resources/stands/types/GetCartStandsResponse.d.mts +4 -0
  69. package/dist/esm/api/resources/customer/resources/stands/types/GetCartStandsResponse.mjs +2 -0
  70. package/dist/esm/api/resources/customer/resources/stands/types/NearbyStandsResponse.d.mts +10 -0
  71. package/dist/esm/api/resources/customer/resources/stands/types/NearbyStandsResponse.mjs +2 -0
  72. package/dist/esm/api/resources/customer/resources/stands/types/index.d.mts +3 -0
  73. package/dist/esm/api/resources/customer/resources/stands/types/index.mjs +3 -0
  74. package/dist/esm/api/resources/index.d.mts +0 -3
  75. package/dist/esm/api/resources/index.mjs +0 -3
  76. package/dist/esm/api/types/AddCartItemRequest.d.mts +9 -0
  77. package/dist/esm/api/types/AddCartItemRequest.mjs +2 -0
  78. package/dist/esm/api/types/BusinessEvent.d.mts +1 -0
  79. package/dist/esm/api/types/CartResource.d.mts +5 -0
  80. package/dist/esm/api/types/ExploreResponse.d.mts +1 -0
  81. package/dist/esm/api/types/ExploreStand.d.mts +18 -0
  82. package/dist/esm/api/types/ExploreStand.mjs +2 -0
  83. package/dist/esm/api/types/NearbyStand.d.mts +19 -0
  84. package/dist/esm/api/types/NearbyStand.mjs +2 -0
  85. package/dist/esm/api/types/OrderResource.d.mts +9 -0
  86. package/dist/esm/api/types/index.d.mts +3 -0
  87. package/dist/esm/api/types/index.mjs +3 -0
  88. package/dist/esm/version.d.mts +1 -1
  89. package/dist/esm/version.mjs +1 -1
  90. package/package.json +2 -13
  91. package/reference.md +310 -159
  92. package/dist/cjs/api/resources/customerStands/client/Client.d.ts +0 -58
  93. package/dist/cjs/api/resources/customerStands/client/Client.js +0 -240
  94. package/dist/cjs/api/resources/customerStands/client/index.d.ts +0 -1
  95. package/dist/cjs/api/resources/customerStands/client/index.js +0 -17
  96. package/dist/cjs/api/resources/customerStands/client/requests/CustomerAddStandCartItemRequest.d.ts +0 -14
  97. package/dist/cjs/api/resources/customerStands/client/requests/index.d.ts +0 -3
  98. package/dist/cjs/api/resources/customerStands/client/requests/index.js +0 -2
  99. package/dist/cjs/api/resources/customerStands/exports.d.ts +0 -2
  100. package/dist/cjs/api/resources/customerStands/exports.js +0 -21
  101. package/dist/cjs/api/resources/customerStands/index.d.ts +0 -2
  102. package/dist/cjs/api/resources/customerStands/index.js +0 -18
  103. package/dist/cjs/api/resources/customerStands/types/CustomerAddStandCartItemResponse.d.ts +0 -4
  104. package/dist/cjs/api/resources/customerStands/types/CustomerGetStandCartResponse.d.ts +0 -4
  105. package/dist/cjs/api/resources/customerStands/types/index.d.ts +0 -2
  106. package/dist/cjs/api/resources/customerStands/types/index.js +0 -18
  107. package/dist/esm/api/resources/customerStands/client/Client.d.mts +0 -58
  108. package/dist/esm/api/resources/customerStands/client/Client.mjs +0 -203
  109. package/dist/esm/api/resources/customerStands/client/index.d.mts +0 -1
  110. package/dist/esm/api/resources/customerStands/client/index.mjs +0 -1
  111. package/dist/esm/api/resources/customerStands/client/requests/CustomerAddStandCartItemRequest.d.mts +0 -14
  112. package/dist/esm/api/resources/customerStands/client/requests/index.d.mts +0 -3
  113. package/dist/esm/api/resources/customerStands/client/requests/index.mjs +0 -1
  114. package/dist/esm/api/resources/customerStands/exports.d.mts +0 -2
  115. package/dist/esm/api/resources/customerStands/exports.mjs +0 -3
  116. package/dist/esm/api/resources/customerStands/index.d.mts +0 -2
  117. package/dist/esm/api/resources/customerStands/index.mjs +0 -2
  118. package/dist/esm/api/resources/customerStands/types/CustomerAddStandCartItemResponse.d.mts +0 -4
  119. package/dist/esm/api/resources/customerStands/types/CustomerGetStandCartResponse.d.mts +0 -4
  120. package/dist/esm/api/resources/customerStands/types/index.d.mts +0 -2
  121. package/dist/esm/api/resources/customerStands/types/index.mjs +0 -2
  122. /package/dist/cjs/api/resources/customer/resources/cart/client/requests/{UpdateItemCartRequest.js → UpdateCartItemRequest.js} +0 -0
  123. /package/dist/cjs/api/resources/{customerStands/client/requests/CustomerAddStandCartItemRequest.js → customer/resources/stands/client/requests/AddCartItemStandsRequest.js} +0 -0
  124. /package/dist/cjs/api/resources/{customerStands/client/requests/CustomerClearStandCartRequest.js → customer/resources/stands/client/requests/ClearCartStandsRequest.js} +0 -0
  125. /package/dist/cjs/api/resources/{customerStands/client/requests/CustomerGetStandCartRequest.js → customer/resources/stands/client/requests/GetCartStandsRequest.js} +0 -0
  126. /package/dist/cjs/api/resources/{customerStands/types/CustomerAddStandCartItemResponse.js → customer/resources/stands/client/requests/NearbyStandsRequest.js} +0 -0
  127. /package/dist/cjs/api/resources/{customerStands/types/CustomerGetStandCartResponse.js → customer/resources/stands/types/AddCartItemStandsResponse.js} +0 -0
  128. /package/dist/esm/api/resources/customer/resources/cart/client/requests/{UpdateItemCartRequest.mjs → UpdateCartItemRequest.mjs} +0 -0
  129. /package/dist/esm/api/resources/{customerStands/client/requests/CustomerAddStandCartItemRequest.mjs → customer/resources/stands/client/requests/AddCartItemStandsRequest.mjs} +0 -0
  130. /package/dist/esm/api/resources/{customerStands/client/requests/CustomerClearStandCartRequest.mjs → customer/resources/stands/client/requests/ClearCartStandsRequest.mjs} +0 -0
  131. /package/dist/esm/api/resources/{customerStands/client/requests/CustomerGetStandCartRequest.mjs → customer/resources/stands/client/requests/GetCartStandsRequest.mjs} +0 -0
  132. /package/dist/esm/api/resources/{customerStands/types/CustomerAddStandCartItemResponse.mjs → customer/resources/stands/client/requests/NearbyStandsRequest.mjs} +0 -0
  133. /package/dist/esm/api/resources/{customerStands/types/CustomerGetStandCartResponse.mjs → customer/resources/stands/types/AddCartItemStandsResponse.mjs} +0 -0
@@ -37,12 +37,18 @@ export declare class ProductOrdersClient {
37
37
  get(request: FiveOneEat.business.GetProductOrdersRequest, requestOptions?: ProductOrdersClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.business.GetProductOrdersResponse>;
38
38
  private __get;
39
39
  /**
40
+ * The business's part is done, and the customer is told. A shipped order
41
+ * becomes `fulfilled` (on its way); a pickup order becomes
42
+ * `ready_for_pickup`, and `mark-picked-up` completes it once collected.
43
+ * A farm-stand order is fulfilled at checkout and is refused here.
44
+ *
40
45
  * @param {FiveOneEat.business.FulfillProductOrdersRequest} request
41
46
  * @param {ProductOrdersClient.RequestOptions} requestOptions - Request-specific configuration.
42
47
  *
43
48
  * @throws {@link FiveOneEat.UnauthorizedError}
44
49
  * @throws {@link FiveOneEat.ForbiddenError}
45
50
  * @throws {@link FiveOneEat.NotFoundError}
51
+ * @throws {@link FiveOneEat.UnprocessableEntityError}
46
52
  *
47
53
  * @example
48
54
  * await client.business.productOrders.fulfill({
@@ -52,12 +58,15 @@ export declare class ProductOrdersClient {
52
58
  fulfill(request: FiveOneEat.business.FulfillProductOrdersRequest, requestOptions?: ProductOrdersClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.business.FulfillProductOrdersResponse>;
53
59
  private __fulfill;
54
60
  /**
61
+ * Only a pickup order, `unfulfilled` or `ready_for_pickup`; it becomes `fulfilled`.
62
+ *
55
63
  * @param {FiveOneEat.business.MarkPickedUpProductOrdersRequest} request
56
64
  * @param {ProductOrdersClient.RequestOptions} requestOptions - Request-specific configuration.
57
65
  *
58
66
  * @throws {@link FiveOneEat.UnauthorizedError}
59
67
  * @throws {@link FiveOneEat.ForbiddenError}
60
68
  * @throws {@link FiveOneEat.NotFoundError}
69
+ * @throws {@link FiveOneEat.UnprocessableEntityError}
61
70
  *
62
71
  * @example
63
72
  * await client.business.productOrders.markPickedUp({
@@ -148,12 +148,18 @@ export class ProductOrdersClient {
148
148
  });
149
149
  }
150
150
  /**
151
+ * The business's part is done, and the customer is told. A shipped order
152
+ * becomes `fulfilled` (on its way); a pickup order becomes
153
+ * `ready_for_pickup`, and `mark-picked-up` completes it once collected.
154
+ * A farm-stand order is fulfilled at checkout and is refused here.
155
+ *
151
156
  * @param {FiveOneEat.business.FulfillProductOrdersRequest} request
152
157
  * @param {ProductOrdersClient.RequestOptions} requestOptions - Request-specific configuration.
153
158
  *
154
159
  * @throws {@link FiveOneEat.UnauthorizedError}
155
160
  * @throws {@link FiveOneEat.ForbiddenError}
156
161
  * @throws {@link FiveOneEat.NotFoundError}
162
+ * @throws {@link FiveOneEat.UnprocessableEntityError}
157
163
  *
158
164
  * @example
159
165
  * await client.business.productOrders.fulfill({
@@ -194,6 +200,8 @@ export class ProductOrdersClient {
194
200
  throw new FiveOneEat.ForbiddenError(_response.error.body, _response.rawResponse);
195
201
  case 404:
196
202
  throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
203
+ case 422:
204
+ throw new FiveOneEat.UnprocessableEntityError(_response.error.body, _response.rawResponse);
197
205
  default:
198
206
  throw new errors.FiveOneEatError({
199
207
  statusCode: _response.error.statusCode,
@@ -206,12 +214,15 @@ export class ProductOrdersClient {
206
214
  });
207
215
  }
208
216
  /**
217
+ * Only a pickup order, `unfulfilled` or `ready_for_pickup`; it becomes `fulfilled`.
218
+ *
209
219
  * @param {FiveOneEat.business.MarkPickedUpProductOrdersRequest} request
210
220
  * @param {ProductOrdersClient.RequestOptions} requestOptions - Request-specific configuration.
211
221
  *
212
222
  * @throws {@link FiveOneEat.UnauthorizedError}
213
223
  * @throws {@link FiveOneEat.ForbiddenError}
214
224
  * @throws {@link FiveOneEat.NotFoundError}
225
+ * @throws {@link FiveOneEat.UnprocessableEntityError}
215
226
  *
216
227
  * @example
217
228
  * await client.business.productOrders.markPickedUp({
@@ -252,6 +263,8 @@ export class ProductOrdersClient {
252
263
  throw new FiveOneEat.ForbiddenError(_response.error.body, _response.rawResponse);
253
264
  case 404:
254
265
  throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
266
+ case 422:
267
+ throw new FiveOneEat.UnprocessableEntityError(_response.error.body, _response.rawResponse);
255
268
  default:
256
269
  throw new errors.FiveOneEatError({
257
270
  statusCode: _response.error.statusCode,
@@ -1,7 +1,4 @@
1
- export type GetPickupTimeslotsBusinessesResponse = {
1
+ export interface GetPickupTimeslotsBusinessesResponse {
2
2
  date?: unknown | undefined;
3
3
  timeslots: string[];
4
- } | {
5
- date?: unknown | undefined;
6
- timeslots: string[];
7
- };
4
+ }
@@ -25,6 +25,10 @@ export declare class CartClient {
25
25
  get(request: FiveOneEat.customer.GetCartRequest, requestOptions?: CartClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.customer.GetCartResponse>;
26
26
  private __get;
27
27
  /**
28
+ * Only a variant this shop sells is accepted: its product is active,
29
+ * published and on the storefront, and the variant has a storefront price.
30
+ * Anything else is a 422 on `variant_id` ("That item isn't available here.").
31
+ *
28
32
  * @param {FiveOneEat.customer.AddItemCartRequest} request
29
33
  * @param {CartClient.RequestOptions} requestOptions - Request-specific configuration.
30
34
  *
@@ -35,8 +39,10 @@ export declare class CartClient {
35
39
  * @example
36
40
  * await client.customer.cart.addItem({
37
41
  * business: "business",
38
- * variant_id: "variant_id",
39
- * quantity: 1
42
+ * body: {
43
+ * variant_id: "variant_id",
44
+ * quantity: 1
45
+ * }
40
46
  * })
41
47
  */
42
48
  addItem(request: FiveOneEat.customer.AddItemCartRequest, requestOptions?: CartClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.customer.AddItemCartResponse>;
@@ -56,7 +62,10 @@ export declare class CartClient {
56
62
  clear(request: FiveOneEat.customer.ClearCartRequest, requestOptions?: CartClient.RequestOptions): core.HttpResponsePromise<void>;
57
63
  private __clear;
58
64
  /**
59
- * @param {FiveOneEat.customer.UpdateItemCartRequest} request
65
+ * An item this shop no longer sells can't be changed, only removed: 422 on
66
+ * `variant_id` ("That item isn't available here.").
67
+ *
68
+ * @param {FiveOneEat.customer.UpdateCartItemRequest} request
60
69
  * @param {CartClient.RequestOptions} requestOptions - Request-specific configuration.
61
70
  *
62
71
  * @throws {@link FiveOneEat.UnauthorizedError}
@@ -70,7 +79,7 @@ export declare class CartClient {
70
79
  * quantity: 1
71
80
  * })
72
81
  */
73
- updateItem(request: FiveOneEat.customer.UpdateItemCartRequest, requestOptions?: CartClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.customer.UpdateItemCartResponse>;
82
+ updateItem(request: FiveOneEat.customer.UpdateCartItemRequest, requestOptions?: CartClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.customer.UpdateItemCartResponse>;
74
83
  private __updateItem;
75
84
  /**
76
85
  * @param {FiveOneEat.customer.RemoveItemCartRequest} request
@@ -83,6 +83,10 @@ export class CartClient {
83
83
  });
84
84
  }
85
85
  /**
86
+ * Only a variant this shop sells is accepted: its product is active,
87
+ * published and on the storefront, and the variant has a storefront price.
88
+ * Anything else is a 422 on `variant_id` ("That item isn't available here.").
89
+ *
86
90
  * @param {FiveOneEat.customer.AddItemCartRequest} request
87
91
  * @param {CartClient.RequestOptions} requestOptions - Request-specific configuration.
88
92
  *
@@ -93,8 +97,10 @@ export class CartClient {
93
97
  * @example
94
98
  * await client.customer.cart.addItem({
95
99
  * business: "business",
96
- * variant_id: "variant_id",
97
- * quantity: 1
100
+ * body: {
101
+ * variant_id: "variant_id",
102
+ * quantity: 1
103
+ * }
98
104
  * })
99
105
  */
100
106
  addItem(request, requestOptions) {
@@ -103,7 +109,7 @@ export class CartClient {
103
109
  __addItem(request, requestOptions) {
104
110
  return __awaiter(this, void 0, void 0, function* () {
105
111
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
106
- const { business } = request, _body = __rest(request, ["business"]);
112
+ const { business, body: _body } = request;
107
113
  const _authRequest = yield this._options.authProvider.getAuthRequest();
108
114
  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);
109
115
  const _response = yield core.fetcher({
@@ -198,7 +204,10 @@ export class CartClient {
198
204
  });
199
205
  }
200
206
  /**
201
- * @param {FiveOneEat.customer.UpdateItemCartRequest} request
207
+ * An item this shop no longer sells can't be changed, only removed: 422 on
208
+ * `variant_id` ("That item isn't available here.").
209
+ *
210
+ * @param {FiveOneEat.customer.UpdateCartItemRequest} request
202
211
  * @param {CartClient.RequestOptions} requestOptions - Request-specific configuration.
203
212
  *
204
213
  * @throws {@link FiveOneEat.UnauthorizedError}
@@ -1,14 +1,16 @@
1
+ import type * as FiveOneEat from "../../../../../../index.mjs";
1
2
  /**
2
3
  * @example
3
4
  * {
4
5
  * business: "business",
5
- * variant_id: "variant_id",
6
- * quantity: 1
6
+ * body: {
7
+ * variant_id: "variant_id",
8
+ * quantity: 1
9
+ * }
7
10
  * }
8
11
  */
9
12
  export interface AddItemCartRequest {
10
13
  /** The business handle */
11
14
  business: string;
12
- variant_id: string;
13
- quantity: number;
15
+ body: FiveOneEat.AddCartItemRequest;
14
16
  }
@@ -5,7 +5,7 @@
5
5
  * quantity: 1
6
6
  * }
7
7
  */
8
- export interface UpdateItemCartRequest {
8
+ export interface UpdateCartItemRequest {
9
9
  /** The cart item ID */
10
10
  cartItem: string;
11
11
  quantity: number;
@@ -9,4 +9,4 @@ export type { RefreshCartPaymentRequest } from "./RefreshCartPaymentRequest.mjs"
9
9
  export type { RemoveItemCartRequest } from "./RemoveItemCartRequest.mjs";
10
10
  export type { SelectShippingRateRequest } from "./SelectShippingRateRequest.mjs";
11
11
  export type { ShippingAddressRequest } from "./ShippingAddressRequest.mjs";
12
- export type { UpdateItemCartRequest } from "./UpdateItemCartRequest.mjs";
12
+ export type { UpdateCartItemRequest } from "./UpdateCartItemRequest.mjs";
@@ -6,7 +6,7 @@
6
6
  * }
7
7
  */
8
8
  export interface GetProductShopRequest {
9
- /** The business ID */
9
+ /** The business handle */
10
10
  business: string;
11
11
  /** The product ID */
12
12
  product: string;
@@ -5,6 +5,6 @@
5
5
  * }
6
6
  */
7
7
  export interface ListCategoriesShopRequest {
8
- /** The business ID */
8
+ /** The business handle */
9
9
  business: string;
10
10
  }
@@ -5,7 +5,7 @@
5
5
  * }
6
6
  */
7
7
  export interface ListProductsShopRequest {
8
- /** The business ID */
8
+ /** The business handle */
9
9
  business: string;
10
10
  category?: string;
11
11
  }
@@ -26,6 +26,77 @@ export declare class StandsClient {
26
26
  */
27
27
  scan(request: FiveOneEat.customer.ScanStandsRequest, requestOptions?: StandsClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.customer.ScanStandsResponse>;
28
28
  private __scan;
29
+ /**
30
+ * The nearest stands that can take a payment right now, closest first:
31
+ * up to 20 within 50 km. `is_here` marks a stand within the arrival
32
+ * radius (`meta.arrival_radius_meters`), where the app offers its
33
+ * self-checkout without a QR scan. The coordinates are used for this
34
+ * lookup only and are never stored.
35
+ *
36
+ * @param {FiveOneEat.customer.NearbyStandsRequest} request
37
+ * @param {StandsClient.RequestOptions} requestOptions - Request-specific configuration.
38
+ *
39
+ * @throws {@link FiveOneEat.UnprocessableEntityError}
40
+ *
41
+ * @example
42
+ * await client.customer.stands.nearby({
43
+ * latitude: 1.1,
44
+ * longitude: 1.1
45
+ * })
46
+ */
47
+ nearby(request: FiveOneEat.customer.NearbyStandsRequest, requestOptions?: StandsClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.customer.NearbyStandsResponse>;
48
+ private __nearby;
49
+ /**
50
+ * @param {FiveOneEat.customer.GetCartStandsRequest} request
51
+ * @param {StandsClient.RequestOptions} requestOptions - Request-specific configuration.
52
+ *
53
+ * @throws {@link FiveOneEat.UnauthorizedError}
54
+ * @throws {@link FiveOneEat.NotFoundError}
55
+ *
56
+ * @example
57
+ * await client.customer.stands.getCart({
58
+ * stand: "stand"
59
+ * })
60
+ */
61
+ getCart(request: FiveOneEat.customer.GetCartStandsRequest, requestOptions?: StandsClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.customer.GetCartStandsResponse>;
62
+ private __getCart;
63
+ /**
64
+ * Only a variant this stand sells is accepted: its product is active,
65
+ * published and on the stand, and the variant has a stand price. Anything
66
+ * else is a 422 on `variant_id` ("That item isn't available here.").
67
+ *
68
+ * @param {FiveOneEat.customer.AddCartItemStandsRequest} request
69
+ * @param {StandsClient.RequestOptions} requestOptions - Request-specific configuration.
70
+ *
71
+ * @throws {@link FiveOneEat.UnauthorizedError}
72
+ * @throws {@link FiveOneEat.NotFoundError}
73
+ * @throws {@link FiveOneEat.UnprocessableEntityError}
74
+ *
75
+ * @example
76
+ * await client.customer.stands.addCartItem({
77
+ * stand: "stand",
78
+ * body: {
79
+ * variant_id: "variant_id",
80
+ * quantity: 1
81
+ * }
82
+ * })
83
+ */
84
+ addCartItem(request: FiveOneEat.customer.AddCartItemStandsRequest, requestOptions?: StandsClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.customer.AddCartItemStandsResponse>;
85
+ private __addCartItem;
86
+ /**
87
+ * @param {FiveOneEat.customer.ClearCartStandsRequest} request
88
+ * @param {StandsClient.RequestOptions} requestOptions - Request-specific configuration.
89
+ *
90
+ * @throws {@link FiveOneEat.UnauthorizedError}
91
+ * @throws {@link FiveOneEat.NotFoundError}
92
+ *
93
+ * @example
94
+ * await client.customer.stands.clearCart({
95
+ * stand: "stand"
96
+ * })
97
+ */
98
+ clearCart(request: FiveOneEat.customer.ClearCartStandsRequest, requestOptions?: StandsClient.RequestOptions): core.HttpResponsePromise<void>;
99
+ private __clearCart;
29
100
  /**
30
101
  * @param {FiveOneEat.customer.CreatePaymentIntentStandsRequest} request
31
102
  * @param {StandsClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -73,6 +73,249 @@ export class StandsClient {
73
73
  return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/stand/{stand}");
74
74
  });
75
75
  }
76
+ /**
77
+ * The nearest stands that can take a payment right now, closest first:
78
+ * up to 20 within 50 km. `is_here` marks a stand within the arrival
79
+ * radius (`meta.arrival_radius_meters`), where the app offers its
80
+ * self-checkout without a QR scan. The coordinates are used for this
81
+ * lookup only and are never stored.
82
+ *
83
+ * @param {FiveOneEat.customer.NearbyStandsRequest} request
84
+ * @param {StandsClient.RequestOptions} requestOptions - Request-specific configuration.
85
+ *
86
+ * @throws {@link FiveOneEat.UnprocessableEntityError}
87
+ *
88
+ * @example
89
+ * await client.customer.stands.nearby({
90
+ * latitude: 1.1,
91
+ * longitude: 1.1
92
+ * })
93
+ */
94
+ nearby(request, requestOptions) {
95
+ return core.HttpResponsePromise.fromPromise(this.__nearby(request, requestOptions));
96
+ }
97
+ __nearby(request, requestOptions) {
98
+ return __awaiter(this, void 0, void 0, function* () {
99
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
100
+ const { latitude, longitude } = request;
101
+ const _queryParams = {
102
+ latitude,
103
+ longitude,
104
+ };
105
+ const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
106
+ const _response = yield core.fetcher({
107
+ 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/stands/nearby"),
108
+ method: "GET",
109
+ headers: _headers,
110
+ queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
111
+ queryString: core.url
112
+ .queryBuilder()
113
+ .addMany(_queryParams)
114
+ .mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
115
+ .build(),
116
+ 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,
117
+ 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,
118
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
119
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
120
+ logging: this._options.logging,
121
+ });
122
+ if (_response.ok) {
123
+ return {
124
+ data: _response.body,
125
+ rawResponse: _response.rawResponse,
126
+ };
127
+ }
128
+ if (_response.error.reason === "status-code") {
129
+ switch (_response.error.statusCode) {
130
+ case 422:
131
+ throw new FiveOneEat.UnprocessableEntityError(_response.error.body, _response.rawResponse);
132
+ default:
133
+ throw new errors.FiveOneEatError({
134
+ statusCode: _response.error.statusCode,
135
+ body: _response.error.body,
136
+ rawResponse: _response.rawResponse,
137
+ });
138
+ }
139
+ }
140
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/customer/stands/nearby");
141
+ });
142
+ }
143
+ /**
144
+ * @param {FiveOneEat.customer.GetCartStandsRequest} request
145
+ * @param {StandsClient.RequestOptions} requestOptions - Request-specific configuration.
146
+ *
147
+ * @throws {@link FiveOneEat.UnauthorizedError}
148
+ * @throws {@link FiveOneEat.NotFoundError}
149
+ *
150
+ * @example
151
+ * await client.customer.stands.getCart({
152
+ * stand: "stand"
153
+ * })
154
+ */
155
+ getCart(request, requestOptions) {
156
+ return core.HttpResponsePromise.fromPromise(this.__getCart(request, requestOptions));
157
+ }
158
+ __getCart(request, requestOptions) {
159
+ return __awaiter(this, void 0, void 0, function* () {
160
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
161
+ const { stand } = request;
162
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
163
+ 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);
164
+ const _response = yield core.fetcher({
165
+ 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/stands/${core.url.encodePathParam(stand)}/cart`),
166
+ method: "GET",
167
+ headers: _headers,
168
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
169
+ timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
170
+ maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
171
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
172
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
173
+ logging: this._options.logging,
174
+ });
175
+ if (_response.ok) {
176
+ return {
177
+ data: _response.body,
178
+ rawResponse: _response.rawResponse,
179
+ };
180
+ }
181
+ if (_response.error.reason === "status-code") {
182
+ switch (_response.error.statusCode) {
183
+ case 401:
184
+ throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
185
+ case 404:
186
+ throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
187
+ default:
188
+ throw new errors.FiveOneEatError({
189
+ statusCode: _response.error.statusCode,
190
+ body: _response.error.body,
191
+ rawResponse: _response.rawResponse,
192
+ });
193
+ }
194
+ }
195
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/customer/stands/{stand}/cart");
196
+ });
197
+ }
198
+ /**
199
+ * Only a variant this stand sells is accepted: its product is active,
200
+ * published and on the stand, and the variant has a stand price. Anything
201
+ * else is a 422 on `variant_id` ("That item isn't available here.").
202
+ *
203
+ * @param {FiveOneEat.customer.AddCartItemStandsRequest} request
204
+ * @param {StandsClient.RequestOptions} requestOptions - Request-specific configuration.
205
+ *
206
+ * @throws {@link FiveOneEat.UnauthorizedError}
207
+ * @throws {@link FiveOneEat.NotFoundError}
208
+ * @throws {@link FiveOneEat.UnprocessableEntityError}
209
+ *
210
+ * @example
211
+ * await client.customer.stands.addCartItem({
212
+ * stand: "stand",
213
+ * body: {
214
+ * variant_id: "variant_id",
215
+ * quantity: 1
216
+ * }
217
+ * })
218
+ */
219
+ addCartItem(request, requestOptions) {
220
+ return core.HttpResponsePromise.fromPromise(this.__addCartItem(request, requestOptions));
221
+ }
222
+ __addCartItem(request, requestOptions) {
223
+ return __awaiter(this, void 0, void 0, function* () {
224
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
225
+ const { stand, body: _body } = request;
226
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
227
+ 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);
228
+ const _response = yield core.fetcher({
229
+ 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/stands/${core.url.encodePathParam(stand)}/cart`),
230
+ method: "POST",
231
+ headers: _headers,
232
+ contentType: "application/json",
233
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
234
+ requestType: "json",
235
+ body: _body,
236
+ 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,
237
+ 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,
238
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
239
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
240
+ logging: this._options.logging,
241
+ });
242
+ if (_response.ok) {
243
+ return {
244
+ data: _response.body,
245
+ rawResponse: _response.rawResponse,
246
+ };
247
+ }
248
+ if (_response.error.reason === "status-code") {
249
+ switch (_response.error.statusCode) {
250
+ case 401:
251
+ throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
252
+ case 404:
253
+ throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
254
+ case 422:
255
+ throw new FiveOneEat.UnprocessableEntityError(_response.error.body, _response.rawResponse);
256
+ default:
257
+ throw new errors.FiveOneEatError({
258
+ statusCode: _response.error.statusCode,
259
+ body: _response.error.body,
260
+ rawResponse: _response.rawResponse,
261
+ });
262
+ }
263
+ }
264
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/customer/stands/{stand}/cart");
265
+ });
266
+ }
267
+ /**
268
+ * @param {FiveOneEat.customer.ClearCartStandsRequest} request
269
+ * @param {StandsClient.RequestOptions} requestOptions - Request-specific configuration.
270
+ *
271
+ * @throws {@link FiveOneEat.UnauthorizedError}
272
+ * @throws {@link FiveOneEat.NotFoundError}
273
+ *
274
+ * @example
275
+ * await client.customer.stands.clearCart({
276
+ * stand: "stand"
277
+ * })
278
+ */
279
+ clearCart(request, requestOptions) {
280
+ return core.HttpResponsePromise.fromPromise(this.__clearCart(request, requestOptions));
281
+ }
282
+ __clearCart(request, requestOptions) {
283
+ return __awaiter(this, void 0, void 0, function* () {
284
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
285
+ const { stand } = request;
286
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
287
+ 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);
288
+ const _response = yield core.fetcher({
289
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.FiveOneEatEnvironment.Production, `customer/stands/${core.url.encodePathParam(stand)}/cart`),
290
+ method: "DELETE",
291
+ headers: _headers,
292
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
293
+ 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,
294
+ 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,
295
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
296
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
297
+ logging: this._options.logging,
298
+ });
299
+ if (_response.ok) {
300
+ return { data: undefined, rawResponse: _response.rawResponse };
301
+ }
302
+ if (_response.error.reason === "status-code") {
303
+ switch (_response.error.statusCode) {
304
+ case 401:
305
+ throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
306
+ case 404:
307
+ throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
308
+ default:
309
+ throw new errors.FiveOneEatError({
310
+ statusCode: _response.error.statusCode,
311
+ body: _response.error.body,
312
+ rawResponse: _response.rawResponse,
313
+ });
314
+ }
315
+ }
316
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/customer/stands/{stand}/cart");
317
+ });
318
+ }
76
319
  /**
77
320
  * @param {FiveOneEat.customer.CreatePaymentIntentStandsRequest} request
78
321
  * @param {StandsClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -0,0 +1,16 @@
1
+ import type * as FiveOneEat from "../../../../../../index.mjs";
2
+ /**
3
+ * @example
4
+ * {
5
+ * stand: "stand",
6
+ * body: {
7
+ * variant_id: "variant_id",
8
+ * quantity: 1
9
+ * }
10
+ * }
11
+ */
12
+ export interface AddCartItemStandsRequest {
13
+ /** The stand ID */
14
+ stand: string;
15
+ body: FiveOneEat.AddCartItemRequest;
16
+ }
@@ -4,7 +4,7 @@
4
4
  * stand: "stand"
5
5
  * }
6
6
  */
7
- export interface CustomerClearStandCartRequest {
7
+ export interface ClearCartStandsRequest {
8
8
  /** The stand ID */
9
9
  stand: string;
10
10
  }
@@ -4,7 +4,7 @@
4
4
  * stand: "stand"
5
5
  * }
6
6
  */
7
- export interface CustomerClearStandCartRequest {
7
+ export interface GetCartStandsRequest {
8
8
  /** The stand ID */
9
9
  stand: string;
10
10
  }
@@ -0,0 +1,13 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * latitude: 1.1,
5
+ * longitude: 1.1
6
+ * }
7
+ */
8
+ export interface NearbyStandsRequest {
9
+ /** The device's latitude. @example 42.6526 */
10
+ latitude: number;
11
+ /** The device's longitude. @example -73.7562 */
12
+ longitude: number;
13
+ }
@@ -1,3 +1,7 @@
1
+ export type { AddCartItemStandsRequest } from "./AddCartItemStandsRequest.mjs";
1
2
  export type { CheckoutStandsRequest } from "./CheckoutStandsRequest.mjs";
3
+ export type { ClearCartStandsRequest } from "./ClearCartStandsRequest.mjs";
2
4
  export type { CreatePaymentIntentStandsRequest } from "./CreatePaymentIntentStandsRequest.mjs";
5
+ export type { GetCartStandsRequest } from "./GetCartStandsRequest.mjs";
6
+ export type { NearbyStandsRequest } from "./NearbyStandsRequest.mjs";
3
7
  export type { ScanStandsRequest } from "./ScanStandsRequest.mjs";
@@ -0,0 +1,4 @@
1
+ import type * as FiveOneEat from "../../../../../index.mjs";
2
+ export interface AddCartItemStandsResponse {
3
+ data: FiveOneEat.CartResource;
4
+ }