@51eat/sdk 0.0.69 → 0.0.71

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 (56) hide show
  1. package/dist/cjs/BaseClient.js +2 -2
  2. package/dist/cjs/api/resources/customer/resources/cart/types/CreatePaymentIntentCartResponse.d.ts +4 -0
  3. package/dist/cjs/api/resources/customer/resources/shop/types/ListCategoriesShopResponse.d.ts +10 -14
  4. package/dist/cjs/api/resources/customer/resources/stands/client/Client.d.ts +19 -9
  5. package/dist/cjs/api/resources/customer/resources/stands/client/Client.js +63 -28
  6. package/dist/cjs/api/resources/customer/resources/stands/client/requests/CheckoutStandsRequest.d.ts +7 -1
  7. package/dist/cjs/api/resources/customer/resources/stands/client/requests/CreatePaymentIntentStandsRequest.d.ts +1 -0
  8. package/dist/cjs/api/resources/customer/resources/stands/types/CheckoutStandsResponse.d.ts +4 -0
  9. package/dist/cjs/api/resources/customer/resources/stands/types/CreatePaymentIntentStandsResponse.d.ts +16 -0
  10. package/dist/cjs/api/resources/customer/resources/stands/types/CreatePaymentIntentStandsResponse.js +10 -0
  11. package/dist/cjs/api/resources/customer/resources/stands/types/index.d.ts +2 -0
  12. package/dist/cjs/api/resources/customer/resources/stands/types/index.js +2 -0
  13. package/dist/cjs/api/resources/customerStands/client/Client.d.ts +0 -32
  14. package/dist/cjs/api/resources/customerStands/client/Client.js +0 -119
  15. package/dist/cjs/api/resources/customerStands/client/requests/index.d.ts +0 -2
  16. package/dist/cjs/api/resources/customerStands/types/index.d.ts +0 -2
  17. package/dist/cjs/api/resources/customerStands/types/index.js +0 -2
  18. package/dist/cjs/version.d.ts +1 -1
  19. package/dist/cjs/version.js +1 -1
  20. package/dist/esm/BaseClient.mjs +2 -2
  21. package/dist/esm/api/resources/customer/resources/cart/types/CreatePaymentIntentCartResponse.d.mts +4 -0
  22. package/dist/esm/api/resources/customer/resources/shop/types/ListCategoriesShopResponse.d.mts +10 -14
  23. package/dist/esm/api/resources/customer/resources/stands/client/Client.d.mts +19 -9
  24. package/dist/esm/api/resources/customer/resources/stands/client/Client.mjs +63 -28
  25. package/dist/esm/api/resources/customer/resources/stands/client/requests/CheckoutStandsRequest.d.mts +7 -1
  26. package/dist/esm/api/resources/customer/resources/stands/client/requests/CreatePaymentIntentStandsRequest.d.mts +1 -0
  27. package/dist/esm/api/resources/customer/resources/stands/types/CheckoutStandsResponse.d.mts +4 -0
  28. package/dist/esm/api/resources/customer/resources/stands/types/CreatePaymentIntentStandsResponse.d.mts +16 -0
  29. package/dist/esm/api/resources/customer/resources/stands/types/CreatePaymentIntentStandsResponse.mjs +7 -0
  30. package/dist/esm/api/resources/customer/resources/stands/types/index.d.mts +2 -0
  31. package/dist/esm/api/resources/customer/resources/stands/types/index.mjs +2 -0
  32. package/dist/esm/api/resources/customerStands/client/Client.d.mts +0 -32
  33. package/dist/esm/api/resources/customerStands/client/Client.mjs +0 -119
  34. package/dist/esm/api/resources/customerStands/client/requests/index.d.mts +0 -2
  35. package/dist/esm/api/resources/customerStands/types/index.d.mts +0 -2
  36. package/dist/esm/api/resources/customerStands/types/index.mjs +0 -2
  37. package/dist/esm/version.d.mts +1 -1
  38. package/dist/esm/version.mjs +1 -1
  39. package/package.json +1 -1
  40. package/reference.md +10 -112
  41. package/dist/cjs/api/resources/customerStands/client/requests/CustomerStandCheckoutRequest.d.ts +0 -15
  42. package/dist/cjs/api/resources/customerStands/client/requests/CustomerStandPaymentIntentRequest.d.ts +0 -10
  43. package/dist/cjs/api/resources/customerStands/client/requests/CustomerStandPaymentIntentRequest.js +0 -3
  44. package/dist/cjs/api/resources/customerStands/types/CustomerStandCheckoutResponse.d.ts +0 -4
  45. package/dist/cjs/api/resources/customerStands/types/CustomerStandCheckoutResponse.js +0 -3
  46. package/dist/cjs/api/resources/customerStands/types/CustomerStandPaymentIntentResponse.d.ts +0 -12
  47. package/dist/cjs/api/resources/customerStands/types/CustomerStandPaymentIntentResponse.js +0 -10
  48. package/dist/esm/api/resources/customerStands/client/requests/CustomerStandCheckoutRequest.d.mts +0 -15
  49. package/dist/esm/api/resources/customerStands/client/requests/CustomerStandPaymentIntentRequest.d.mts +0 -10
  50. package/dist/esm/api/resources/customerStands/client/requests/CustomerStandPaymentIntentRequest.mjs +0 -2
  51. package/dist/esm/api/resources/customerStands/types/CustomerStandCheckoutResponse.d.mts +0 -4
  52. package/dist/esm/api/resources/customerStands/types/CustomerStandCheckoutResponse.mjs +0 -2
  53. package/dist/esm/api/resources/customerStands/types/CustomerStandPaymentIntentResponse.d.mts +0 -12
  54. package/dist/esm/api/resources/customerStands/types/CustomerStandPaymentIntentResponse.mjs +0 -7
  55. /package/dist/cjs/api/resources/{customerStands/client/requests/CustomerStandCheckoutRequest.js → customer/resources/stands/types/CheckoutStandsResponse.js} +0 -0
  56. /package/dist/esm/api/resources/{customerStands/client/requests/CustomerStandCheckoutRequest.mjs → customer/resources/stands/types/CheckoutStandsResponse.mjs} +0 -0
@@ -43,8 +43,8 @@ function normalizeClientOptions(options) {
43
43
  const headers = (0, headers_js_1.mergeHeaders)({
44
44
  "X-Fern-Language": "JavaScript",
45
45
  "X-Fern-SDK-Name": "@51eat/sdk",
46
- "X-Fern-SDK-Version": "0.0.69",
47
- "User-Agent": "@51eat/sdk/0.0.69",
46
+ "X-Fern-SDK-Version": "0.0.71",
47
+ "User-Agent": "@51eat/sdk/0.0.71",
48
48
  "X-Fern-Runtime": core.RUNTIME.type,
49
49
  "X-Fern-Runtime-Version": core.RUNTIME.version,
50
50
  }, options === null || options === void 0 ? void 0 : options.headers);
@@ -1,6 +1,10 @@
1
1
  export interface CreatePaymentIntentCartResponse {
2
2
  client_secret: string;
3
3
  payment_intent_id: string;
4
+ subtotal: string;
5
+ tax_amount: string;
6
+ platform_fee: string;
7
+ total_amount: string;
4
8
  amount: number;
5
9
  currency: CreatePaymentIntentCartResponse.Currency;
6
10
  }
@@ -1,14 +1,10 @@
1
- export interface ListCategoriesShopResponse {
2
- data: ListCategoriesShopResponse.Data.Item[];
3
- }
4
- export declare namespace ListCategoriesShopResponse {
5
- type Data = Data.Item[];
6
- namespace Data {
7
- interface Item {
8
- id: string;
9
- name: string;
10
- slug: string;
11
- products_count: string;
12
- }
13
- }
14
- }
1
+ export type ListCategoriesShopResponse = {
2
+ data: {
3
+ id: string;
4
+ name: string;
5
+ slug: string;
6
+ products_count: string;
7
+ }[];
8
+ } | {
9
+ data: string[];
10
+ };
@@ -27,25 +27,35 @@ export declare class StandsClient {
27
27
  scan(request: FiveOneEat.customer.ScanStandsRequest, requestOptions?: StandsClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.customer.ScanStandsResponse>;
28
28
  private __scan;
29
29
  /**
30
- * @param {FiveOneEat.customer.CheckoutStandsRequest} request
30
+ * @param {FiveOneEat.customer.CreatePaymentIntentStandsRequest} request
31
31
  * @param {StandsClient.RequestOptions} requestOptions - Request-specific configuration.
32
32
  *
33
+ * @throws {@link FiveOneEat.UnauthorizedError}
34
+ * @throws {@link FiveOneEat.NotFoundError}
35
+ *
33
36
  * @example
34
- * await client.customer.stands.checkout({
37
+ * await client.customer.stands.createPaymentIntent({
35
38
  * stand: "stand"
36
39
  * })
37
40
  */
38
- checkout(request: FiveOneEat.customer.CheckoutStandsRequest, requestOptions?: StandsClient.RequestOptions): core.HttpResponsePromise<void>;
39
- private __checkout;
41
+ createPaymentIntent(request: FiveOneEat.customer.CreatePaymentIntentStandsRequest, requestOptions?: StandsClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.customer.CreatePaymentIntentStandsResponse>;
42
+ private __createPaymentIntent;
40
43
  /**
41
- * @param {FiveOneEat.customer.CreatePaymentIntentStandsRequest} request
44
+ * @param {FiveOneEat.customer.CheckoutStandsRequest} request
42
45
  * @param {StandsClient.RequestOptions} requestOptions - Request-specific configuration.
43
46
  *
47
+ * @throws {@link FiveOneEat.UnauthorizedError}
48
+ * @throws {@link FiveOneEat.NotFoundError}
49
+ * @throws {@link FiveOneEat.UnprocessableEntityError}
50
+ *
44
51
  * @example
45
- * await client.customer.stands.createPaymentIntent({
46
- * stand: "stand"
52
+ * await client.customer.stands.checkout({
53
+ * stand: "stand",
54
+ * body: {
55
+ * payment_intent_id: "payment_intent_id"
56
+ * }
47
57
  * })
48
58
  */
49
- createPaymentIntent(request: FiveOneEat.customer.CreatePaymentIntentStandsRequest, requestOptions?: StandsClient.RequestOptions): core.HttpResponsePromise<void>;
50
- private __createPaymentIntent;
59
+ checkout(request: FiveOneEat.customer.CheckoutStandsRequest, requestOptions?: StandsClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.customer.CheckoutStandsResponse>;
60
+ private __checkout;
51
61
  }
@@ -111,25 +111,28 @@ class StandsClient {
111
111
  });
112
112
  }
113
113
  /**
114
- * @param {FiveOneEat.customer.CheckoutStandsRequest} request
114
+ * @param {FiveOneEat.customer.CreatePaymentIntentStandsRequest} request
115
115
  * @param {StandsClient.RequestOptions} requestOptions - Request-specific configuration.
116
116
  *
117
+ * @throws {@link FiveOneEat.UnauthorizedError}
118
+ * @throws {@link FiveOneEat.NotFoundError}
119
+ *
117
120
  * @example
118
- * await client.customer.stands.checkout({
121
+ * await client.customer.stands.createPaymentIntent({
119
122
  * stand: "stand"
120
123
  * })
121
124
  */
122
- checkout(request, requestOptions) {
123
- return core.HttpResponsePromise.fromPromise(this.__checkout(request, requestOptions));
125
+ createPaymentIntent(request, requestOptions) {
126
+ return core.HttpResponsePromise.fromPromise(this.__createPaymentIntent(request, requestOptions));
124
127
  }
125
- __checkout(request, requestOptions) {
128
+ __createPaymentIntent(request, requestOptions) {
126
129
  return __awaiter(this, void 0, void 0, function* () {
127
130
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
128
131
  const { stand } = request;
129
132
  const _authRequest = yield this._options.authProvider.getAuthRequest();
130
133
  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);
131
134
  const _response = yield core.fetcher({
132
- 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)}/checkout`),
135
+ 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/payment-intent`),
133
136
  method: "POST",
134
137
  headers: _headers,
135
138
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
@@ -140,41 +143,61 @@ class StandsClient {
140
143
  logging: this._options.logging,
141
144
  });
142
145
  if (_response.ok) {
143
- return { data: undefined, rawResponse: _response.rawResponse };
146
+ return {
147
+ data: _response.body,
148
+ rawResponse: _response.rawResponse,
149
+ };
144
150
  }
145
151
  if (_response.error.reason === "status-code") {
146
- throw new errors.FiveOneEatError({
147
- statusCode: _response.error.statusCode,
148
- body: _response.error.body,
149
- rawResponse: _response.rawResponse,
150
- });
152
+ switch (_response.error.statusCode) {
153
+ case 401:
154
+ throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
155
+ case 404:
156
+ throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
157
+ default:
158
+ throw new errors.FiveOneEatError({
159
+ statusCode: _response.error.statusCode,
160
+ body: _response.error.body,
161
+ rawResponse: _response.rawResponse,
162
+ });
163
+ }
151
164
  }
152
- return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/customer/stands/{stand}/checkout");
165
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/customer/stands/{stand}/cart/payment-intent");
153
166
  });
154
167
  }
155
168
  /**
156
- * @param {FiveOneEat.customer.CreatePaymentIntentStandsRequest} request
169
+ * @param {FiveOneEat.customer.CheckoutStandsRequest} request
157
170
  * @param {StandsClient.RequestOptions} requestOptions - Request-specific configuration.
158
171
  *
172
+ * @throws {@link FiveOneEat.UnauthorizedError}
173
+ * @throws {@link FiveOneEat.NotFoundError}
174
+ * @throws {@link FiveOneEat.UnprocessableEntityError}
175
+ *
159
176
  * @example
160
- * await client.customer.stands.createPaymentIntent({
161
- * stand: "stand"
177
+ * await client.customer.stands.checkout({
178
+ * stand: "stand",
179
+ * body: {
180
+ * payment_intent_id: "payment_intent_id"
181
+ * }
162
182
  * })
163
183
  */
164
- createPaymentIntent(request, requestOptions) {
165
- return core.HttpResponsePromise.fromPromise(this.__createPaymentIntent(request, requestOptions));
184
+ checkout(request, requestOptions) {
185
+ return core.HttpResponsePromise.fromPromise(this.__checkout(request, requestOptions));
166
186
  }
167
- __createPaymentIntent(request, requestOptions) {
187
+ __checkout(request, requestOptions) {
168
188
  return __awaiter(this, void 0, void 0, function* () {
169
189
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
170
- const { stand } = request;
190
+ const { stand, body: _body } = request;
171
191
  const _authRequest = yield this._options.authProvider.getAuthRequest();
172
192
  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);
173
193
  const _response = yield core.fetcher({
174
- 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)}/payment-intent`),
194
+ 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/checkout`),
175
195
  method: "POST",
176
196
  headers: _headers,
197
+ contentType: "application/json",
177
198
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
199
+ requestType: "json",
200
+ body: _body,
178
201
  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,
179
202
  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,
180
203
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -182,16 +205,28 @@ class StandsClient {
182
205
  logging: this._options.logging,
183
206
  });
184
207
  if (_response.ok) {
185
- return { data: undefined, rawResponse: _response.rawResponse };
208
+ return {
209
+ data: _response.body,
210
+ rawResponse: _response.rawResponse,
211
+ };
186
212
  }
187
213
  if (_response.error.reason === "status-code") {
188
- throw new errors.FiveOneEatError({
189
- statusCode: _response.error.statusCode,
190
- body: _response.error.body,
191
- rawResponse: _response.rawResponse,
192
- });
214
+ switch (_response.error.statusCode) {
215
+ case 401:
216
+ throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
217
+ case 404:
218
+ throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
219
+ case 422:
220
+ throw new FiveOneEat.UnprocessableEntityError(_response.error.body, _response.rawResponse);
221
+ default:
222
+ throw new errors.FiveOneEatError({
223
+ statusCode: _response.error.statusCode,
224
+ body: _response.error.body,
225
+ rawResponse: _response.rawResponse,
226
+ });
227
+ }
193
228
  }
194
- return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/customer/stands/{stand}/payment-intent");
229
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/customer/stands/{stand}/cart/checkout");
195
230
  });
196
231
  }
197
232
  }
@@ -1,9 +1,15 @@
1
+ import type * as FiveOneEat from "../../../../../../index.js";
1
2
  /**
2
3
  * @example
3
4
  * {
4
- * stand: "stand"
5
+ * stand: "stand",
6
+ * body: {
7
+ * payment_intent_id: "payment_intent_id"
8
+ * }
5
9
  * }
6
10
  */
7
11
  export interface CheckoutStandsRequest {
12
+ /** The stand ID */
8
13
  stand: string;
14
+ body: FiveOneEat.CheckoutRequest;
9
15
  }
@@ -5,5 +5,6 @@
5
5
  * }
6
6
  */
7
7
  export interface CreatePaymentIntentStandsRequest {
8
+ /** The stand ID */
8
9
  stand: string;
9
10
  }
@@ -0,0 +1,4 @@
1
+ import type * as FiveOneEat from "../../../../../index.js";
2
+ export interface CheckoutStandsResponse {
3
+ data: FiveOneEat.OrderResource;
4
+ }
@@ -0,0 +1,16 @@
1
+ export interface CreatePaymentIntentStandsResponse {
2
+ client_secret: string;
3
+ payment_intent_id: string;
4
+ subtotal: string;
5
+ tax_amount: string;
6
+ platform_fee: string;
7
+ total_amount: string;
8
+ amount: number;
9
+ currency: CreatePaymentIntentStandsResponse.Currency;
10
+ }
11
+ export declare namespace CreatePaymentIntentStandsResponse {
12
+ const Currency: {
13
+ readonly Usd: "usd";
14
+ };
15
+ type Currency = (typeof Currency)[keyof typeof Currency];
16
+ }
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.CreatePaymentIntentStandsResponse = void 0;
5
+ var CreatePaymentIntentStandsResponse;
6
+ (function (CreatePaymentIntentStandsResponse) {
7
+ CreatePaymentIntentStandsResponse.Currency = {
8
+ Usd: "usd",
9
+ };
10
+ })(CreatePaymentIntentStandsResponse || (exports.CreatePaymentIntentStandsResponse = CreatePaymentIntentStandsResponse = {}));
@@ -1 +1,3 @@
1
+ export * from "./CheckoutStandsResponse.js";
2
+ export * from "./CreatePaymentIntentStandsResponse.js";
1
3
  export * from "./ScanStandsResponse.js";
@@ -14,4 +14,6 @@ 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("./CheckoutStandsResponse.js"), exports);
18
+ __exportStar(require("./CreatePaymentIntentStandsResponse.js"), exports);
17
19
  __exportStar(require("./ScanStandsResponse.js"), exports);
@@ -55,36 +55,4 @@ export declare class CustomerStandsClient {
55
55
  */
56
56
  customerClearStandCart(request: FiveOneEat.CustomerClearStandCartRequest, requestOptions?: CustomerStandsClient.RequestOptions): core.HttpResponsePromise<void>;
57
57
  private __customerClearStandCart;
58
- /**
59
- * @param {FiveOneEat.CustomerStandPaymentIntentRequest} request
60
- * @param {CustomerStandsClient.RequestOptions} requestOptions - Request-specific configuration.
61
- *
62
- * @throws {@link FiveOneEat.UnauthorizedError}
63
- * @throws {@link FiveOneEat.NotFoundError}
64
- *
65
- * @example
66
- * await client.customerStands.customerStandPaymentIntent({
67
- * stand: "stand"
68
- * })
69
- */
70
- customerStandPaymentIntent(request: FiveOneEat.CustomerStandPaymentIntentRequest, requestOptions?: CustomerStandsClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.CustomerStandPaymentIntentResponse>;
71
- private __customerStandPaymentIntent;
72
- /**
73
- * @param {FiveOneEat.CustomerStandCheckoutRequest} request
74
- * @param {CustomerStandsClient.RequestOptions} requestOptions - Request-specific configuration.
75
- *
76
- * @throws {@link FiveOneEat.UnauthorizedError}
77
- * @throws {@link FiveOneEat.NotFoundError}
78
- * @throws {@link FiveOneEat.UnprocessableEntityError}
79
- *
80
- * @example
81
- * await client.customerStands.customerStandCheckout({
82
- * stand: "stand",
83
- * body: {
84
- * payment_intent_id: "payment_intent_id"
85
- * }
86
- * })
87
- */
88
- customerStandCheckout(request: FiveOneEat.CustomerStandCheckoutRequest, requestOptions?: CustomerStandsClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.CustomerStandCheckoutResponse>;
89
- private __customerStandCheckout;
90
58
  }
@@ -236,124 +236,5 @@ class CustomerStandsClient {
236
236
  return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "DELETE", "/customer/stands/{stand}/cart");
237
237
  });
238
238
  }
239
- /**
240
- * @param {FiveOneEat.CustomerStandPaymentIntentRequest} request
241
- * @param {CustomerStandsClient.RequestOptions} requestOptions - Request-specific configuration.
242
- *
243
- * @throws {@link FiveOneEat.UnauthorizedError}
244
- * @throws {@link FiveOneEat.NotFoundError}
245
- *
246
- * @example
247
- * await client.customerStands.customerStandPaymentIntent({
248
- * stand: "stand"
249
- * })
250
- */
251
- customerStandPaymentIntent(request, requestOptions) {
252
- return core.HttpResponsePromise.fromPromise(this.__customerStandPaymentIntent(request, requestOptions));
253
- }
254
- __customerStandPaymentIntent(request, requestOptions) {
255
- return __awaiter(this, void 0, void 0, function* () {
256
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
257
- const { stand } = request;
258
- const _authRequest = yield this._options.authProvider.getAuthRequest();
259
- 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);
260
- const _response = yield core.fetcher({
261
- 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/payment-intent`),
262
- method: "POST",
263
- headers: _headers,
264
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
265
- 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,
266
- 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,
267
- abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
268
- fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
269
- logging: this._options.logging,
270
- });
271
- if (_response.ok) {
272
- return {
273
- data: _response.body,
274
- rawResponse: _response.rawResponse,
275
- };
276
- }
277
- if (_response.error.reason === "status-code") {
278
- switch (_response.error.statusCode) {
279
- case 401:
280
- throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
281
- case 404:
282
- throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
283
- default:
284
- throw new errors.FiveOneEatError({
285
- statusCode: _response.error.statusCode,
286
- body: _response.error.body,
287
- rawResponse: _response.rawResponse,
288
- });
289
- }
290
- }
291
- return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/customer/stands/{stand}/cart/payment-intent");
292
- });
293
- }
294
- /**
295
- * @param {FiveOneEat.CustomerStandCheckoutRequest} request
296
- * @param {CustomerStandsClient.RequestOptions} requestOptions - Request-specific configuration.
297
- *
298
- * @throws {@link FiveOneEat.UnauthorizedError}
299
- * @throws {@link FiveOneEat.NotFoundError}
300
- * @throws {@link FiveOneEat.UnprocessableEntityError}
301
- *
302
- * @example
303
- * await client.customerStands.customerStandCheckout({
304
- * stand: "stand",
305
- * body: {
306
- * payment_intent_id: "payment_intent_id"
307
- * }
308
- * })
309
- */
310
- customerStandCheckout(request, requestOptions) {
311
- return core.HttpResponsePromise.fromPromise(this.__customerStandCheckout(request, requestOptions));
312
- }
313
- __customerStandCheckout(request, requestOptions) {
314
- return __awaiter(this, void 0, void 0, function* () {
315
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
316
- const { stand, body: _body } = request;
317
- const _authRequest = yield this._options.authProvider.getAuthRequest();
318
- 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);
319
- const _response = yield core.fetcher({
320
- 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/checkout`),
321
- method: "POST",
322
- headers: _headers,
323
- contentType: "application/json",
324
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
325
- requestType: "json",
326
- body: _body,
327
- 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,
328
- 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,
329
- abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
330
- fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
331
- logging: this._options.logging,
332
- });
333
- if (_response.ok) {
334
- return {
335
- data: _response.body,
336
- rawResponse: _response.rawResponse,
337
- };
338
- }
339
- if (_response.error.reason === "status-code") {
340
- switch (_response.error.statusCode) {
341
- case 401:
342
- throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
343
- case 404:
344
- throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
345
- case 422:
346
- throw new FiveOneEat.UnprocessableEntityError(_response.error.body, _response.rawResponse);
347
- default:
348
- throw new errors.FiveOneEatError({
349
- statusCode: _response.error.statusCode,
350
- body: _response.error.body,
351
- rawResponse: _response.rawResponse,
352
- });
353
- }
354
- }
355
- return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/customer/stands/{stand}/cart/checkout");
356
- });
357
- }
358
239
  }
359
240
  exports.CustomerStandsClient = CustomerStandsClient;
@@ -1,5 +1,3 @@
1
1
  export type { CustomerAddStandCartItemRequest } from "./CustomerAddStandCartItemRequest.js";
2
2
  export type { CustomerClearStandCartRequest } from "./CustomerClearStandCartRequest.js";
3
3
  export type { CustomerGetStandCartRequest } from "./CustomerGetStandCartRequest.js";
4
- export type { CustomerStandCheckoutRequest } from "./CustomerStandCheckoutRequest.js";
5
- export type { CustomerStandPaymentIntentRequest } from "./CustomerStandPaymentIntentRequest.js";
@@ -1,4 +1,2 @@
1
1
  export * from "./CustomerAddStandCartItemResponse.js";
2
2
  export * from "./CustomerGetStandCartResponse.js";
3
- export * from "./CustomerStandCheckoutResponse.js";
4
- export * from "./CustomerStandPaymentIntentResponse.js";
@@ -16,5 +16,3 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./CustomerAddStandCartItemResponse.js"), exports);
18
18
  __exportStar(require("./CustomerGetStandCartResponse.js"), exports);
19
- __exportStar(require("./CustomerStandCheckoutResponse.js"), exports);
20
- __exportStar(require("./CustomerStandPaymentIntentResponse.js"), exports);
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.0.69";
1
+ export declare const SDK_VERSION = "0.0.71";
@@ -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.69";
4
+ exports.SDK_VERSION = "0.0.71";
@@ -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.69",
10
- "User-Agent": "@51eat/sdk/0.0.69",
9
+ "X-Fern-SDK-Version": "0.0.71",
10
+ "User-Agent": "@51eat/sdk/0.0.71",
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,10 @@
1
1
  export interface CreatePaymentIntentCartResponse {
2
2
  client_secret: string;
3
3
  payment_intent_id: string;
4
+ subtotal: string;
5
+ tax_amount: string;
6
+ platform_fee: string;
7
+ total_amount: string;
4
8
  amount: number;
5
9
  currency: CreatePaymentIntentCartResponse.Currency;
6
10
  }
@@ -1,14 +1,10 @@
1
- export interface ListCategoriesShopResponse {
2
- data: ListCategoriesShopResponse.Data.Item[];
3
- }
4
- export declare namespace ListCategoriesShopResponse {
5
- type Data = Data.Item[];
6
- namespace Data {
7
- interface Item {
8
- id: string;
9
- name: string;
10
- slug: string;
11
- products_count: string;
12
- }
13
- }
14
- }
1
+ export type ListCategoriesShopResponse = {
2
+ data: {
3
+ id: string;
4
+ name: string;
5
+ slug: string;
6
+ products_count: string;
7
+ }[];
8
+ } | {
9
+ data: string[];
10
+ };
@@ -27,25 +27,35 @@ export declare class StandsClient {
27
27
  scan(request: FiveOneEat.customer.ScanStandsRequest, requestOptions?: StandsClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.customer.ScanStandsResponse>;
28
28
  private __scan;
29
29
  /**
30
- * @param {FiveOneEat.customer.CheckoutStandsRequest} request
30
+ * @param {FiveOneEat.customer.CreatePaymentIntentStandsRequest} request
31
31
  * @param {StandsClient.RequestOptions} requestOptions - Request-specific configuration.
32
32
  *
33
+ * @throws {@link FiveOneEat.UnauthorizedError}
34
+ * @throws {@link FiveOneEat.NotFoundError}
35
+ *
33
36
  * @example
34
- * await client.customer.stands.checkout({
37
+ * await client.customer.stands.createPaymentIntent({
35
38
  * stand: "stand"
36
39
  * })
37
40
  */
38
- checkout(request: FiveOneEat.customer.CheckoutStandsRequest, requestOptions?: StandsClient.RequestOptions): core.HttpResponsePromise<void>;
39
- private __checkout;
41
+ createPaymentIntent(request: FiveOneEat.customer.CreatePaymentIntentStandsRequest, requestOptions?: StandsClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.customer.CreatePaymentIntentStandsResponse>;
42
+ private __createPaymentIntent;
40
43
  /**
41
- * @param {FiveOneEat.customer.CreatePaymentIntentStandsRequest} request
44
+ * @param {FiveOneEat.customer.CheckoutStandsRequest} request
42
45
  * @param {StandsClient.RequestOptions} requestOptions - Request-specific configuration.
43
46
  *
47
+ * @throws {@link FiveOneEat.UnauthorizedError}
48
+ * @throws {@link FiveOneEat.NotFoundError}
49
+ * @throws {@link FiveOneEat.UnprocessableEntityError}
50
+ *
44
51
  * @example
45
- * await client.customer.stands.createPaymentIntent({
46
- * stand: "stand"
52
+ * await client.customer.stands.checkout({
53
+ * stand: "stand",
54
+ * body: {
55
+ * payment_intent_id: "payment_intent_id"
56
+ * }
47
57
  * })
48
58
  */
49
- createPaymentIntent(request: FiveOneEat.customer.CreatePaymentIntentStandsRequest, requestOptions?: StandsClient.RequestOptions): core.HttpResponsePromise<void>;
50
- private __createPaymentIntent;
59
+ checkout(request: FiveOneEat.customer.CheckoutStandsRequest, requestOptions?: StandsClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.customer.CheckoutStandsResponse>;
60
+ private __checkout;
51
61
  }