@51eat/sdk 0.0.78 → 0.0.79

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 +13 -11
  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 +1 -12
  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
@@ -109,6 +109,249 @@ class StandsClient {
109
109
  return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/stand/{stand}");
110
110
  });
111
111
  }
112
+ /**
113
+ * The nearest stands that can take a payment right now, closest first:
114
+ * up to 20 within 50 km. `is_here` marks a stand within the arrival
115
+ * radius (`meta.arrival_radius_meters`), where the app offers its
116
+ * self-checkout without a QR scan. The coordinates are used for this
117
+ * lookup only and are never stored.
118
+ *
119
+ * @param {FiveOneEat.customer.NearbyStandsRequest} request
120
+ * @param {StandsClient.RequestOptions} requestOptions - Request-specific configuration.
121
+ *
122
+ * @throws {@link FiveOneEat.UnprocessableEntityError}
123
+ *
124
+ * @example
125
+ * await client.customer.stands.nearby({
126
+ * latitude: 1.1,
127
+ * longitude: 1.1
128
+ * })
129
+ */
130
+ nearby(request, requestOptions) {
131
+ return core.HttpResponsePromise.fromPromise(this.__nearby(request, requestOptions));
132
+ }
133
+ __nearby(request, requestOptions) {
134
+ return __awaiter(this, void 0, void 0, function* () {
135
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
136
+ const { latitude, longitude } = request;
137
+ const _queryParams = {
138
+ latitude,
139
+ longitude,
140
+ };
141
+ const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
142
+ const _response = yield core.fetcher({
143
+ 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"),
144
+ method: "GET",
145
+ headers: _headers,
146
+ queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
147
+ queryString: core.url
148
+ .queryBuilder()
149
+ .addMany(_queryParams)
150
+ .mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
151
+ .build(),
152
+ 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,
153
+ 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,
154
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
155
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
156
+ logging: this._options.logging,
157
+ });
158
+ if (_response.ok) {
159
+ return {
160
+ data: _response.body,
161
+ rawResponse: _response.rawResponse,
162
+ };
163
+ }
164
+ if (_response.error.reason === "status-code") {
165
+ switch (_response.error.statusCode) {
166
+ case 422:
167
+ throw new FiveOneEat.UnprocessableEntityError(_response.error.body, _response.rawResponse);
168
+ default:
169
+ throw new errors.FiveOneEatError({
170
+ statusCode: _response.error.statusCode,
171
+ body: _response.error.body,
172
+ rawResponse: _response.rawResponse,
173
+ });
174
+ }
175
+ }
176
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/customer/stands/nearby");
177
+ });
178
+ }
179
+ /**
180
+ * @param {FiveOneEat.customer.GetCartStandsRequest} request
181
+ * @param {StandsClient.RequestOptions} requestOptions - Request-specific configuration.
182
+ *
183
+ * @throws {@link FiveOneEat.UnauthorizedError}
184
+ * @throws {@link FiveOneEat.NotFoundError}
185
+ *
186
+ * @example
187
+ * await client.customer.stands.getCart({
188
+ * stand: "stand"
189
+ * })
190
+ */
191
+ getCart(request, requestOptions) {
192
+ return core.HttpResponsePromise.fromPromise(this.__getCart(request, requestOptions));
193
+ }
194
+ __getCart(request, requestOptions) {
195
+ return __awaiter(this, void 0, void 0, function* () {
196
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
197
+ const { stand } = request;
198
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
199
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
200
+ const _response = yield core.fetcher({
201
+ 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`),
202
+ method: "GET",
203
+ headers: _headers,
204
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
205
+ 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,
206
+ 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,
207
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
208
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
209
+ logging: this._options.logging,
210
+ });
211
+ if (_response.ok) {
212
+ return {
213
+ data: _response.body,
214
+ rawResponse: _response.rawResponse,
215
+ };
216
+ }
217
+ if (_response.error.reason === "status-code") {
218
+ switch (_response.error.statusCode) {
219
+ case 401:
220
+ throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
221
+ case 404:
222
+ throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
223
+ default:
224
+ throw new errors.FiveOneEatError({
225
+ statusCode: _response.error.statusCode,
226
+ body: _response.error.body,
227
+ rawResponse: _response.rawResponse,
228
+ });
229
+ }
230
+ }
231
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/customer/stands/{stand}/cart");
232
+ });
233
+ }
234
+ /**
235
+ * Only a variant this stand sells is accepted: its product is active,
236
+ * published and on the stand, and the variant has a stand price. Anything
237
+ * else is a 422 on `variant_id` ("That item isn't available here.").
238
+ *
239
+ * @param {FiveOneEat.customer.AddCartItemStandsRequest} request
240
+ * @param {StandsClient.RequestOptions} requestOptions - Request-specific configuration.
241
+ *
242
+ * @throws {@link FiveOneEat.UnauthorizedError}
243
+ * @throws {@link FiveOneEat.NotFoundError}
244
+ * @throws {@link FiveOneEat.UnprocessableEntityError}
245
+ *
246
+ * @example
247
+ * await client.customer.stands.addCartItem({
248
+ * stand: "stand",
249
+ * body: {
250
+ * variant_id: "variant_id",
251
+ * quantity: 1
252
+ * }
253
+ * })
254
+ */
255
+ addCartItem(request, requestOptions) {
256
+ return core.HttpResponsePromise.fromPromise(this.__addCartItem(request, requestOptions));
257
+ }
258
+ __addCartItem(request, requestOptions) {
259
+ return __awaiter(this, void 0, void 0, function* () {
260
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
261
+ const { stand, body: _body } = request;
262
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
263
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
264
+ const _response = yield core.fetcher({
265
+ 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`),
266
+ method: "POST",
267
+ headers: _headers,
268
+ contentType: "application/json",
269
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
270
+ requestType: "json",
271
+ body: _body,
272
+ 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,
273
+ 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,
274
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
275
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
276
+ logging: this._options.logging,
277
+ });
278
+ if (_response.ok) {
279
+ return {
280
+ data: _response.body,
281
+ rawResponse: _response.rawResponse,
282
+ };
283
+ }
284
+ if (_response.error.reason === "status-code") {
285
+ switch (_response.error.statusCode) {
286
+ case 401:
287
+ throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
288
+ case 404:
289
+ throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
290
+ case 422:
291
+ throw new FiveOneEat.UnprocessableEntityError(_response.error.body, _response.rawResponse);
292
+ default:
293
+ throw new errors.FiveOneEatError({
294
+ statusCode: _response.error.statusCode,
295
+ body: _response.error.body,
296
+ rawResponse: _response.rawResponse,
297
+ });
298
+ }
299
+ }
300
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/customer/stands/{stand}/cart");
301
+ });
302
+ }
303
+ /**
304
+ * @param {FiveOneEat.customer.ClearCartStandsRequest} request
305
+ * @param {StandsClient.RequestOptions} requestOptions - Request-specific configuration.
306
+ *
307
+ * @throws {@link FiveOneEat.UnauthorizedError}
308
+ * @throws {@link FiveOneEat.NotFoundError}
309
+ *
310
+ * @example
311
+ * await client.customer.stands.clearCart({
312
+ * stand: "stand"
313
+ * })
314
+ */
315
+ clearCart(request, requestOptions) {
316
+ return core.HttpResponsePromise.fromPromise(this.__clearCart(request, requestOptions));
317
+ }
318
+ __clearCart(request, requestOptions) {
319
+ return __awaiter(this, void 0, void 0, function* () {
320
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
321
+ const { stand } = request;
322
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
323
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
324
+ const _response = yield core.fetcher({
325
+ 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`),
326
+ method: "DELETE",
327
+ headers: _headers,
328
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
329
+ 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,
330
+ 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,
331
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
332
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
333
+ logging: this._options.logging,
334
+ });
335
+ if (_response.ok) {
336
+ return { data: undefined, rawResponse: _response.rawResponse };
337
+ }
338
+ if (_response.error.reason === "status-code") {
339
+ switch (_response.error.statusCode) {
340
+ case 401:
341
+ throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
342
+ case 404:
343
+ throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
344
+ default:
345
+ throw new errors.FiveOneEatError({
346
+ statusCode: _response.error.statusCode,
347
+ body: _response.error.body,
348
+ rawResponse: _response.rawResponse,
349
+ });
350
+ }
351
+ }
352
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "DELETE", "/customer/stands/{stand}/cart");
353
+ });
354
+ }
112
355
  /**
113
356
  * @param {FiveOneEat.customer.CreatePaymentIntentStandsRequest} request
114
357
  * @param {StandsClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -0,0 +1,16 @@
1
+ import type * as FiveOneEat from "../../../../../../index.js";
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 CustomerGetStandCartRequest {
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 CustomerGetStandCartRequest {
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.js";
1
2
  export type { CheckoutStandsRequest } from "./CheckoutStandsRequest.js";
3
+ export type { ClearCartStandsRequest } from "./ClearCartStandsRequest.js";
2
4
  export type { CreatePaymentIntentStandsRequest } from "./CreatePaymentIntentStandsRequest.js";
5
+ export type { GetCartStandsRequest } from "./GetCartStandsRequest.js";
6
+ export type { NearbyStandsRequest } from "./NearbyStandsRequest.js";
3
7
  export type { ScanStandsRequest } from "./ScanStandsRequest.js";
@@ -0,0 +1,4 @@
1
+ import type * as FiveOneEat from "../../../../../index.js";
2
+ export interface AddCartItemStandsResponse {
3
+ data: FiveOneEat.CartResource;
4
+ }
@@ -0,0 +1,4 @@
1
+ import type * as FiveOneEat from "../../../../../index.js";
2
+ export interface GetCartStandsResponse {
3
+ data: FiveOneEat.CartResource;
4
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,10 @@
1
+ import type * as FiveOneEat from "../../../../../index.js";
2
+ export interface NearbyStandsResponse {
3
+ data: FiveOneEat.NearbyStand[];
4
+ meta: NearbyStandsResponse.Meta;
5
+ }
6
+ export declare namespace NearbyStandsResponse {
7
+ interface Meta {
8
+ arrival_radius_meters: number;
9
+ }
10
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,3 +1,6 @@
1
+ export * from "./AddCartItemStandsResponse.js";
1
2
  export * from "./CheckoutStandsResponse.js";
2
3
  export * from "./CreatePaymentIntentStandsResponse.js";
4
+ export * from "./GetCartStandsResponse.js";
5
+ export * from "./NearbyStandsResponse.js";
3
6
  export * from "./ScanStandsResponse.js";
@@ -14,6 +14,9 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./AddCartItemStandsResponse.js"), exports);
17
18
  __exportStar(require("./CheckoutStandsResponse.js"), exports);
18
19
  __exportStar(require("./CreatePaymentIntentStandsResponse.js"), exports);
20
+ __exportStar(require("./GetCartStandsResponse.js"), exports);
21
+ __exportStar(require("./NearbyStandsResponse.js"), exports);
19
22
  __exportStar(require("./ScanStandsResponse.js"), exports);
@@ -2,9 +2,6 @@ export * as business from "./business/index.js";
2
2
  export * from "./customer/client/requests/index.js";
3
3
  export * as customer from "./customer/index.js";
4
4
  export * from "./customer/types/index.js";
5
- export * from "./customerStands/client/requests/index.js";
6
- export * as customerStands from "./customerStands/index.js";
7
- export * from "./customerStands/types/index.js";
8
5
  export * from "./publicLists/client/requests/index.js";
9
6
  export * as publicLists from "./publicLists/index.js";
10
7
  export * from "./publicLists/types/index.js";
@@ -36,14 +36,11 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
36
36
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
37
37
  };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.publicLists = exports.customerStands = exports.customer = exports.business = void 0;
39
+ exports.publicLists = exports.customer = exports.business = void 0;
40
40
  exports.business = __importStar(require("./business/index.js"));
41
41
  __exportStar(require("./customer/client/requests/index.js"), exports);
42
42
  exports.customer = __importStar(require("./customer/index.js"));
43
43
  __exportStar(require("./customer/types/index.js"), exports);
44
- __exportStar(require("./customerStands/client/requests/index.js"), exports);
45
- exports.customerStands = __importStar(require("./customerStands/index.js"));
46
- __exportStar(require("./customerStands/types/index.js"), exports);
47
44
  __exportStar(require("./publicLists/client/requests/index.js"), exports);
48
45
  exports.publicLists = __importStar(require("./publicLists/index.js"));
49
46
  __exportStar(require("./publicLists/types/index.js"), exports);
@@ -0,0 +1,9 @@
1
+ /**
2
+ * A variant to add to a storefront or stand cart. It must be one the shop or
3
+ * stand sells: its product active, published and on sale there, with a price
4
+ * there. Anything else is refused on `variant_id`.
5
+ */
6
+ export interface AddCartItemRequest {
7
+ variant_id: string;
8
+ quantity: number;
9
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -21,6 +21,7 @@ export interface BusinessEvent {
21
21
  published_at: string;
22
22
  sort_order: string;
23
23
  image?: (string | null) | undefined;
24
+ /** The event's ticket tiers. */
24
25
  ticket_types?: FiveOneEat.BusinessEventTicketType[] | undefined;
25
26
  rsvps_count?: number | undefined;
26
27
  attendees_count?: number | undefined;
@@ -18,6 +18,11 @@ export declare namespace CartResource {
18
18
  quantity: number;
19
19
  unit_price_cents: number;
20
20
  total_cents: number;
21
+ /**
22
+ * False once the shop or stand stopped selling this item (unpriced,
23
+ * taken off sale, or deactivated). Checkout is blocked until it is removed.
24
+ */
25
+ available: boolean;
21
26
  }
22
27
  }
23
28
  /**
@@ -3,6 +3,7 @@ export interface ExploreResponse {
3
3
  businesses: FiveOneEat.ExploreBusiness[];
4
4
  temporary_locations: FiveOneEat.ExploreTemporaryLocation[];
5
5
  events: FiveOneEat.ExploreEvent[];
6
+ stands: FiveOneEat.ExploreStand[];
6
7
  bounds: ExploreResponse.Bounds;
7
8
  }
8
9
  export declare namespace ExploreResponse {
@@ -0,0 +1,18 @@
1
+ export interface ExploreStand {
2
+ id: string;
3
+ name: string;
4
+ address: string | null;
5
+ city: string | null;
6
+ state: string | null;
7
+ latitude: number;
8
+ longitude: number;
9
+ business?: ExploreStand.Business | undefined;
10
+ }
11
+ export declare namespace ExploreStand {
12
+ interface Business {
13
+ id: string;
14
+ name: string;
15
+ handle: string;
16
+ logo: string | null;
17
+ }
18
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,19 @@
1
+ export interface NearbyStand {
2
+ id: string;
3
+ name: string;
4
+ city: string | null;
5
+ latitude: number;
6
+ longitude: number;
7
+ /** Straight-line distance from the coordinates sent, in meters. */
8
+ distance_meters: number;
9
+ /** Within the arrival radius: the customer is at this stand. */
10
+ is_here: boolean;
11
+ business: NearbyStand.Business;
12
+ }
13
+ export declare namespace NearbyStand {
14
+ interface Business {
15
+ id: string;
16
+ name: string;
17
+ handle: string;
18
+ }
19
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -5,6 +5,10 @@ export interface OrderResource {
5
5
  status: string;
6
6
  fulfillment_status: string;
7
7
  fulfillment_method: string;
8
+ /** The buyer's pickup day (Y-m-d) for a pickup order, when they chose one. */
9
+ pickup_date: string | null;
10
+ /** The buyer's pickup time (H:i) for a pickup order, when they chose one. */
11
+ pickup_time: string | null;
8
12
  subtotal_cents: number;
9
13
  discount_cents: number;
10
14
  shipping_cents: number;
@@ -35,6 +39,11 @@ export declare namespace OrderResource {
35
39
  ulid: string;
36
40
  status: string;
37
41
  refunded_amount_cents: number;
42
+ /**
43
+ * What a refund can still return: the total less what's refunded and
44
+ * the customer-paid service fee and its tax, which are never refunded.
45
+ */
46
+ refundable_amount_cents: number;
38
47
  payment_completed_at: string;
39
48
  refunded_at: string;
40
49
  }
@@ -1,4 +1,5 @@
1
1
  export * from "./Ad.js";
2
+ export * from "./AddCartItemRequest.js";
2
3
  export * from "./Address.js";
3
4
  export * from "./AddressCollection.js";
4
5
  export * from "./AppHttpResourcesApiV1BusinessCommerceProductResource.js";
@@ -118,6 +119,7 @@ export * from "./EventSearchResult.js";
118
119
  export * from "./ExploreBusiness.js";
119
120
  export * from "./ExploreEvent.js";
120
121
  export * from "./ExploreResponse.js";
122
+ export * from "./ExploreStand.js";
121
123
  export * from "./ExploreTemporaryLocation.js";
122
124
  export * from "./FavoriteFacets.js";
123
125
  export * from "./FavoriteResponse.js";
@@ -127,6 +129,7 @@ export * from "./InternalServerErrorBody.js";
127
129
  export * from "./InventoryLevelResource.js";
128
130
  export * from "./MenuItemSearchResult.js";
129
131
  export * from "./Message.js";
132
+ export * from "./NearbyStand.js";
130
133
  export * from "./NotFoundErrorBody.js";
131
134
  export * from "./OrderItemResource.js";
132
135
  export * from "./OrderResource.js";
@@ -15,6 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./Ad.js"), exports);
18
+ __exportStar(require("./AddCartItemRequest.js"), exports);
18
19
  __exportStar(require("./Address.js"), exports);
19
20
  __exportStar(require("./AddressCollection.js"), exports);
20
21
  __exportStar(require("./AppHttpResourcesApiV1BusinessCommerceProductResource.js"), exports);
@@ -134,6 +135,7 @@ __exportStar(require("./EventSearchResult.js"), exports);
134
135
  __exportStar(require("./ExploreBusiness.js"), exports);
135
136
  __exportStar(require("./ExploreEvent.js"), exports);
136
137
  __exportStar(require("./ExploreResponse.js"), exports);
138
+ __exportStar(require("./ExploreStand.js"), exports);
137
139
  __exportStar(require("./ExploreTemporaryLocation.js"), exports);
138
140
  __exportStar(require("./FavoriteFacets.js"), exports);
139
141
  __exportStar(require("./FavoriteResponse.js"), exports);
@@ -143,6 +145,7 @@ __exportStar(require("./InternalServerErrorBody.js"), exports);
143
145
  __exportStar(require("./InventoryLevelResource.js"), exports);
144
146
  __exportStar(require("./MenuItemSearchResult.js"), exports);
145
147
  __exportStar(require("./Message.js"), exports);
148
+ __exportStar(require("./NearbyStand.js"), exports);
146
149
  __exportStar(require("./NotFoundErrorBody.js"), exports);
147
150
  __exportStar(require("./OrderItemResource.js"), exports);
148
151
  __exportStar(require("./OrderResource.js"), exports);
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.0.78";
1
+ export declare const SDK_VERSION = "0.0.79";
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_VERSION = void 0;
4
- exports.SDK_VERSION = "0.0.78";
4
+ exports.SDK_VERSION = "0.0.79";
@@ -6,8 +6,8 @@ export function normalizeClientOptions(options) {
6
6
  const headers = mergeHeaders({
7
7
  "X-Fern-Language": "JavaScript",
8
8
  "X-Fern-SDK-Name": "@51eat/sdk",
9
- "X-Fern-SDK-Version": "0.0.78",
10
- "User-Agent": "@51eat/sdk/0.0.78",
9
+ "X-Fern-SDK-Version": "0.0.79",
10
+ "User-Agent": "@51eat/sdk/0.0.79",
11
11
  "X-Fern-Runtime": core.RUNTIME.type,
12
12
  "X-Fern-Runtime-Version": core.RUNTIME.version,
13
13
  }, options === null || options === void 0 ? void 0 : options.headers);
@@ -1,6 +1,5 @@
1
1
  import { BusinessClient } from "./api/resources/business/client/Client.mjs";
2
2
  import { CustomerClient } from "./api/resources/customer/client/Client.mjs";
3
- import { CustomerStandsClient } from "./api/resources/customerStands/client/Client.mjs";
4
3
  import { PublicListsClient } from "./api/resources/publicLists/client/Client.mjs";
5
4
  import type { BaseClientOptions, BaseRequestOptions } from "./BaseClient.mjs";
6
5
  import { type NormalizedClientOptionsWithAuth } from "./BaseClient.mjs";
@@ -13,12 +12,10 @@ export declare namespace FiveOneEatClient {
13
12
  export declare class FiveOneEatClient {
14
13
  protected readonly _options: NormalizedClientOptionsWithAuth<FiveOneEatClient.Options>;
15
14
  protected _customer: CustomerClient | undefined;
16
- protected _customerStands: CustomerStandsClient | undefined;
17
15
  protected _publicLists: PublicListsClient | undefined;
18
16
  protected _business: BusinessClient | undefined;
19
17
  constructor(options?: FiveOneEatClient.Options);
20
18
  get customer(): CustomerClient;
21
- get customerStands(): CustomerStandsClient;
22
19
  get publicLists(): PublicListsClient;
23
20
  get business(): BusinessClient;
24
21
  /**
@@ -10,7 +10,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
10
10
  };
11
11
  import { BusinessClient } from "./api/resources/business/client/Client.mjs";
12
12
  import { CustomerClient } from "./api/resources/customer/client/Client.mjs";
13
- import { CustomerStandsClient } from "./api/resources/customerStands/client/Client.mjs";
14
13
  import { PublicListsClient } from "./api/resources/publicLists/client/Client.mjs";
15
14
  import { normalizeClientOptionsWithAuth } from "./BaseClient.mjs";
16
15
  import * as core from "./core/index.mjs";
@@ -22,10 +21,6 @@ export class FiveOneEatClient {
22
21
  var _a;
23
22
  return ((_a = this._customer) !== null && _a !== void 0 ? _a : (this._customer = new CustomerClient(this._options)));
24
23
  }
25
- get customerStands() {
26
- var _a;
27
- return ((_a = this._customerStands) !== null && _a !== void 0 ? _a : (this._customerStands = new CustomerStandsClient(this._options)));
28
- }
29
24
  get publicLists() {
30
25
  var _a;
31
26
  return ((_a = this._publicLists) !== null && _a !== void 0 ? _a : (this._publicLists = new PublicListsClient(this._options)));