@51eat/sdk 0.0.70 → 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.
- package/dist/cjs/BaseClient.js +2 -2
- package/dist/cjs/api/resources/customer/resources/cart/types/CreatePaymentIntentCartResponse.d.ts +4 -0
- package/dist/cjs/api/resources/customer/resources/stands/client/Client.d.ts +19 -9
- package/dist/cjs/api/resources/customer/resources/stands/client/Client.js +63 -28
- package/dist/cjs/api/resources/customer/resources/stands/client/requests/CheckoutStandsRequest.d.ts +7 -1
- package/dist/cjs/api/resources/customer/resources/stands/client/requests/CreatePaymentIntentStandsRequest.d.ts +1 -0
- package/dist/cjs/api/resources/customer/resources/stands/types/CheckoutStandsResponse.d.ts +4 -0
- package/dist/cjs/api/resources/customer/resources/stands/types/CreatePaymentIntentStandsResponse.d.ts +16 -0
- package/dist/cjs/api/resources/customer/resources/stands/types/CreatePaymentIntentStandsResponse.js +10 -0
- package/dist/cjs/api/resources/customer/resources/stands/types/index.d.ts +2 -0
- package/dist/cjs/api/resources/customer/resources/stands/types/index.js +2 -0
- package/dist/cjs/api/resources/customerStands/client/Client.d.ts +0 -32
- package/dist/cjs/api/resources/customerStands/client/Client.js +0 -119
- package/dist/cjs/api/resources/customerStands/client/requests/index.d.ts +0 -2
- package/dist/cjs/api/resources/customerStands/types/index.d.ts +0 -2
- package/dist/cjs/api/resources/customerStands/types/index.js +0 -2
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/BaseClient.mjs +2 -2
- package/dist/esm/api/resources/customer/resources/cart/types/CreatePaymentIntentCartResponse.d.mts +4 -0
- package/dist/esm/api/resources/customer/resources/stands/client/Client.d.mts +19 -9
- package/dist/esm/api/resources/customer/resources/stands/client/Client.mjs +63 -28
- package/dist/esm/api/resources/customer/resources/stands/client/requests/CheckoutStandsRequest.d.mts +7 -1
- package/dist/esm/api/resources/customer/resources/stands/client/requests/CreatePaymentIntentStandsRequest.d.mts +1 -0
- package/dist/esm/api/resources/customer/resources/stands/types/CheckoutStandsResponse.d.mts +4 -0
- package/dist/esm/api/resources/customer/resources/stands/types/CreatePaymentIntentStandsResponse.d.mts +16 -0
- package/dist/esm/api/resources/customer/resources/stands/types/CreatePaymentIntentStandsResponse.mjs +7 -0
- package/dist/esm/api/resources/customer/resources/stands/types/index.d.mts +2 -0
- package/dist/esm/api/resources/customer/resources/stands/types/index.mjs +2 -0
- package/dist/esm/api/resources/customerStands/client/Client.d.mts +0 -32
- package/dist/esm/api/resources/customerStands/client/Client.mjs +0 -119
- package/dist/esm/api/resources/customerStands/client/requests/index.d.mts +0 -2
- package/dist/esm/api/resources/customerStands/types/index.d.mts +0 -2
- package/dist/esm/api/resources/customerStands/types/index.mjs +0 -2
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +10 -112
- package/dist/cjs/api/resources/customerStands/client/requests/CustomerStandCheckoutRequest.d.ts +0 -15
- package/dist/cjs/api/resources/customerStands/client/requests/CustomerStandPaymentIntentRequest.d.ts +0 -10
- package/dist/cjs/api/resources/customerStands/client/requests/CustomerStandPaymentIntentRequest.js +0 -3
- package/dist/cjs/api/resources/customerStands/types/CustomerStandCheckoutResponse.d.ts +0 -4
- package/dist/cjs/api/resources/customerStands/types/CustomerStandCheckoutResponse.js +0 -3
- package/dist/cjs/api/resources/customerStands/types/CustomerStandPaymentIntentResponse.d.ts +0 -12
- package/dist/cjs/api/resources/customerStands/types/CustomerStandPaymentIntentResponse.js +0 -10
- package/dist/esm/api/resources/customerStands/client/requests/CustomerStandCheckoutRequest.d.mts +0 -15
- package/dist/esm/api/resources/customerStands/client/requests/CustomerStandPaymentIntentRequest.d.mts +0 -10
- package/dist/esm/api/resources/customerStands/client/requests/CustomerStandPaymentIntentRequest.mjs +0 -2
- package/dist/esm/api/resources/customerStands/types/CustomerStandCheckoutResponse.d.mts +0 -4
- package/dist/esm/api/resources/customerStands/types/CustomerStandCheckoutResponse.mjs +0 -2
- package/dist/esm/api/resources/customerStands/types/CustomerStandPaymentIntentResponse.d.mts +0 -12
- package/dist/esm/api/resources/customerStands/types/CustomerStandPaymentIntentResponse.mjs +0 -7
- /package/dist/cjs/api/resources/{customerStands/client/requests/CustomerStandCheckoutRequest.js → customer/resources/stands/types/CheckoutStandsResponse.js} +0 -0
- /package/dist/esm/api/resources/{customerStands/client/requests/CustomerStandCheckoutRequest.mjs → customer/resources/stands/types/CheckoutStandsResponse.mjs} +0 -0
|
@@ -75,25 +75,28 @@ export class StandsClient {
|
|
|
75
75
|
});
|
|
76
76
|
}
|
|
77
77
|
/**
|
|
78
|
-
* @param {FiveOneEat.customer.
|
|
78
|
+
* @param {FiveOneEat.customer.CreatePaymentIntentStandsRequest} request
|
|
79
79
|
* @param {StandsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
80
80
|
*
|
|
81
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
82
|
+
* @throws {@link FiveOneEat.NotFoundError}
|
|
83
|
+
*
|
|
81
84
|
* @example
|
|
82
|
-
* await client.customer.stands.
|
|
85
|
+
* await client.customer.stands.createPaymentIntent({
|
|
83
86
|
* stand: "stand"
|
|
84
87
|
* })
|
|
85
88
|
*/
|
|
86
|
-
|
|
87
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
89
|
+
createPaymentIntent(request, requestOptions) {
|
|
90
|
+
return core.HttpResponsePromise.fromPromise(this.__createPaymentIntent(request, requestOptions));
|
|
88
91
|
}
|
|
89
|
-
|
|
92
|
+
__createPaymentIntent(request, requestOptions) {
|
|
90
93
|
return __awaiter(this, void 0, void 0, function* () {
|
|
91
94
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
92
95
|
const { stand } = request;
|
|
93
96
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
94
97
|
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);
|
|
95
98
|
const _response = yield core.fetcher({
|
|
96
|
-
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)}/
|
|
99
|
+
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`),
|
|
97
100
|
method: "POST",
|
|
98
101
|
headers: _headers,
|
|
99
102
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
@@ -104,41 +107,61 @@ export class StandsClient {
|
|
|
104
107
|
logging: this._options.logging,
|
|
105
108
|
});
|
|
106
109
|
if (_response.ok) {
|
|
107
|
-
return {
|
|
110
|
+
return {
|
|
111
|
+
data: _response.body,
|
|
112
|
+
rawResponse: _response.rawResponse,
|
|
113
|
+
};
|
|
108
114
|
}
|
|
109
115
|
if (_response.error.reason === "status-code") {
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
116
|
+
switch (_response.error.statusCode) {
|
|
117
|
+
case 401:
|
|
118
|
+
throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
119
|
+
case 404:
|
|
120
|
+
throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
|
|
121
|
+
default:
|
|
122
|
+
throw new errors.FiveOneEatError({
|
|
123
|
+
statusCode: _response.error.statusCode,
|
|
124
|
+
body: _response.error.body,
|
|
125
|
+
rawResponse: _response.rawResponse,
|
|
126
|
+
});
|
|
127
|
+
}
|
|
115
128
|
}
|
|
116
|
-
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/customer/stands/{stand}/
|
|
129
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/customer/stands/{stand}/cart/payment-intent");
|
|
117
130
|
});
|
|
118
131
|
}
|
|
119
132
|
/**
|
|
120
|
-
* @param {FiveOneEat.customer.
|
|
133
|
+
* @param {FiveOneEat.customer.CheckoutStandsRequest} request
|
|
121
134
|
* @param {StandsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
122
135
|
*
|
|
136
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
137
|
+
* @throws {@link FiveOneEat.NotFoundError}
|
|
138
|
+
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
139
|
+
*
|
|
123
140
|
* @example
|
|
124
|
-
* await client.customer.stands.
|
|
125
|
-
* stand: "stand"
|
|
141
|
+
* await client.customer.stands.checkout({
|
|
142
|
+
* stand: "stand",
|
|
143
|
+
* body: {
|
|
144
|
+
* payment_intent_id: "payment_intent_id"
|
|
145
|
+
* }
|
|
126
146
|
* })
|
|
127
147
|
*/
|
|
128
|
-
|
|
129
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
148
|
+
checkout(request, requestOptions) {
|
|
149
|
+
return core.HttpResponsePromise.fromPromise(this.__checkout(request, requestOptions));
|
|
130
150
|
}
|
|
131
|
-
|
|
151
|
+
__checkout(request, requestOptions) {
|
|
132
152
|
return __awaiter(this, void 0, void 0, function* () {
|
|
133
153
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
134
|
-
const { stand } = request;
|
|
154
|
+
const { stand, body: _body } = request;
|
|
135
155
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
136
156
|
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);
|
|
137
157
|
const _response = yield core.fetcher({
|
|
138
|
-
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)}/
|
|
158
|
+
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`),
|
|
139
159
|
method: "POST",
|
|
140
160
|
headers: _headers,
|
|
161
|
+
contentType: "application/json",
|
|
141
162
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
163
|
+
requestType: "json",
|
|
164
|
+
body: _body,
|
|
142
165
|
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,
|
|
143
166
|
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,
|
|
144
167
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -146,16 +169,28 @@ export class StandsClient {
|
|
|
146
169
|
logging: this._options.logging,
|
|
147
170
|
});
|
|
148
171
|
if (_response.ok) {
|
|
149
|
-
return {
|
|
172
|
+
return {
|
|
173
|
+
data: _response.body,
|
|
174
|
+
rawResponse: _response.rawResponse,
|
|
175
|
+
};
|
|
150
176
|
}
|
|
151
177
|
if (_response.error.reason === "status-code") {
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
178
|
+
switch (_response.error.statusCode) {
|
|
179
|
+
case 401:
|
|
180
|
+
throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
181
|
+
case 404:
|
|
182
|
+
throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
|
|
183
|
+
case 422:
|
|
184
|
+
throw new FiveOneEat.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
185
|
+
default:
|
|
186
|
+
throw new errors.FiveOneEatError({
|
|
187
|
+
statusCode: _response.error.statusCode,
|
|
188
|
+
body: _response.error.body,
|
|
189
|
+
rawResponse: _response.rawResponse,
|
|
190
|
+
});
|
|
191
|
+
}
|
|
157
192
|
}
|
|
158
|
-
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/customer/stands/{stand}/
|
|
193
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/customer/stands/{stand}/cart/checkout");
|
|
159
194
|
});
|
|
160
195
|
}
|
|
161
196
|
}
|
package/dist/esm/api/resources/customer/resources/stands/client/requests/CheckoutStandsRequest.d.mts
CHANGED
|
@@ -1,9 +1,15 @@
|
|
|
1
|
+
import type * as FiveOneEat from "../../../../../../index.mjs";
|
|
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
|
}
|
|
@@ -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
|
+
}
|
package/dist/esm/api/resources/customer/resources/stands/types/CreatePaymentIntentStandsResponse.mjs
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
export var CreatePaymentIntentStandsResponse;
|
|
3
|
+
(function (CreatePaymentIntentStandsResponse) {
|
|
4
|
+
CreatePaymentIntentStandsResponse.Currency = {
|
|
5
|
+
Usd: "usd",
|
|
6
|
+
};
|
|
7
|
+
})(CreatePaymentIntentStandsResponse || (CreatePaymentIntentStandsResponse = {}));
|
|
@@ -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
|
}
|
|
@@ -200,123 +200,4 @@ export class CustomerStandsClient {
|
|
|
200
200
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/customer/stands/{stand}/cart");
|
|
201
201
|
});
|
|
202
202
|
}
|
|
203
|
-
/**
|
|
204
|
-
* @param {FiveOneEat.CustomerStandPaymentIntentRequest} request
|
|
205
|
-
* @param {CustomerStandsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
206
|
-
*
|
|
207
|
-
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
208
|
-
* @throws {@link FiveOneEat.NotFoundError}
|
|
209
|
-
*
|
|
210
|
-
* @example
|
|
211
|
-
* await client.customerStands.customerStandPaymentIntent({
|
|
212
|
-
* stand: "stand"
|
|
213
|
-
* })
|
|
214
|
-
*/
|
|
215
|
-
customerStandPaymentIntent(request, requestOptions) {
|
|
216
|
-
return core.HttpResponsePromise.fromPromise(this.__customerStandPaymentIntent(request, requestOptions));
|
|
217
|
-
}
|
|
218
|
-
__customerStandPaymentIntent(request, requestOptions) {
|
|
219
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
220
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
221
|
-
const { stand } = request;
|
|
222
|
-
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
223
|
-
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);
|
|
224
|
-
const _response = yield core.fetcher({
|
|
225
|
-
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`),
|
|
226
|
-
method: "POST",
|
|
227
|
-
headers: _headers,
|
|
228
|
-
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
229
|
-
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,
|
|
230
|
-
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,
|
|
231
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
232
|
-
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
233
|
-
logging: this._options.logging,
|
|
234
|
-
});
|
|
235
|
-
if (_response.ok) {
|
|
236
|
-
return {
|
|
237
|
-
data: _response.body,
|
|
238
|
-
rawResponse: _response.rawResponse,
|
|
239
|
-
};
|
|
240
|
-
}
|
|
241
|
-
if (_response.error.reason === "status-code") {
|
|
242
|
-
switch (_response.error.statusCode) {
|
|
243
|
-
case 401:
|
|
244
|
-
throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
245
|
-
case 404:
|
|
246
|
-
throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
|
|
247
|
-
default:
|
|
248
|
-
throw new errors.FiveOneEatError({
|
|
249
|
-
statusCode: _response.error.statusCode,
|
|
250
|
-
body: _response.error.body,
|
|
251
|
-
rawResponse: _response.rawResponse,
|
|
252
|
-
});
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/customer/stands/{stand}/cart/payment-intent");
|
|
256
|
-
});
|
|
257
|
-
}
|
|
258
|
-
/**
|
|
259
|
-
* @param {FiveOneEat.CustomerStandCheckoutRequest} request
|
|
260
|
-
* @param {CustomerStandsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
261
|
-
*
|
|
262
|
-
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
263
|
-
* @throws {@link FiveOneEat.NotFoundError}
|
|
264
|
-
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
265
|
-
*
|
|
266
|
-
* @example
|
|
267
|
-
* await client.customerStands.customerStandCheckout({
|
|
268
|
-
* stand: "stand",
|
|
269
|
-
* body: {
|
|
270
|
-
* payment_intent_id: "payment_intent_id"
|
|
271
|
-
* }
|
|
272
|
-
* })
|
|
273
|
-
*/
|
|
274
|
-
customerStandCheckout(request, requestOptions) {
|
|
275
|
-
return core.HttpResponsePromise.fromPromise(this.__customerStandCheckout(request, requestOptions));
|
|
276
|
-
}
|
|
277
|
-
__customerStandCheckout(request, requestOptions) {
|
|
278
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
279
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
280
|
-
const { stand, body: _body } = request;
|
|
281
|
-
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
282
|
-
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);
|
|
283
|
-
const _response = yield core.fetcher({
|
|
284
|
-
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`),
|
|
285
|
-
method: "POST",
|
|
286
|
-
headers: _headers,
|
|
287
|
-
contentType: "application/json",
|
|
288
|
-
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
289
|
-
requestType: "json",
|
|
290
|
-
body: _body,
|
|
291
|
-
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,
|
|
292
|
-
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,
|
|
293
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
294
|
-
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
295
|
-
logging: this._options.logging,
|
|
296
|
-
});
|
|
297
|
-
if (_response.ok) {
|
|
298
|
-
return {
|
|
299
|
-
data: _response.body,
|
|
300
|
-
rawResponse: _response.rawResponse,
|
|
301
|
-
};
|
|
302
|
-
}
|
|
303
|
-
if (_response.error.reason === "status-code") {
|
|
304
|
-
switch (_response.error.statusCode) {
|
|
305
|
-
case 401:
|
|
306
|
-
throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
307
|
-
case 404:
|
|
308
|
-
throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
|
|
309
|
-
case 422:
|
|
310
|
-
throw new FiveOneEat.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
311
|
-
default:
|
|
312
|
-
throw new errors.FiveOneEatError({
|
|
313
|
-
statusCode: _response.error.statusCode,
|
|
314
|
-
body: _response.error.body,
|
|
315
|
-
rawResponse: _response.rawResponse,
|
|
316
|
-
});
|
|
317
|
-
}
|
|
318
|
-
}
|
|
319
|
-
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/customer/stands/{stand}/cart/checkout");
|
|
320
|
-
});
|
|
321
|
-
}
|
|
322
203
|
}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
1
|
export type { CustomerAddStandCartItemRequest } from "./CustomerAddStandCartItemRequest.mjs";
|
|
2
2
|
export type { CustomerClearStandCartRequest } from "./CustomerClearStandCartRequest.mjs";
|
|
3
3
|
export type { CustomerGetStandCartRequest } from "./CustomerGetStandCartRequest.mjs";
|
|
4
|
-
export type { CustomerStandCheckoutRequest } from "./CustomerStandCheckoutRequest.mjs";
|
|
5
|
-
export type { CustomerStandPaymentIntentRequest } from "./CustomerStandPaymentIntentRequest.mjs";
|
package/dist/esm/version.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.0.
|
|
1
|
+
export declare const SDK_VERSION = "0.0.71";
|
package/dist/esm/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "0.0.
|
|
1
|
+
export const SDK_VERSION = "0.0.71";
|
package/package.json
CHANGED
package/reference.md
CHANGED
|
@@ -222,111 +222,6 @@ await client.customerStands.customerClearStandCart({
|
|
|
222
222
|
</dl>
|
|
223
223
|
|
|
224
224
|
|
|
225
|
-
</dd>
|
|
226
|
-
</dl>
|
|
227
|
-
</details>
|
|
228
|
-
|
|
229
|
-
<details><summary><code>client.customerStands.<a href="/src/api/resources/customerStands/client/Client.ts">customerStandPaymentIntent</a>({ ...params }) -> FiveOneEat.CustomerStandPaymentIntentResponse</code></summary>
|
|
230
|
-
<dl>
|
|
231
|
-
<dd>
|
|
232
|
-
|
|
233
|
-
#### 🔌 Usage
|
|
234
|
-
|
|
235
|
-
<dl>
|
|
236
|
-
<dd>
|
|
237
|
-
|
|
238
|
-
<dl>
|
|
239
|
-
<dd>
|
|
240
|
-
|
|
241
|
-
```typescript
|
|
242
|
-
await client.customerStands.customerStandPaymentIntent({
|
|
243
|
-
stand: "stand"
|
|
244
|
-
});
|
|
245
|
-
|
|
246
|
-
```
|
|
247
|
-
</dd>
|
|
248
|
-
</dl>
|
|
249
|
-
</dd>
|
|
250
|
-
</dl>
|
|
251
|
-
|
|
252
|
-
#### ⚙️ Parameters
|
|
253
|
-
|
|
254
|
-
<dl>
|
|
255
|
-
<dd>
|
|
256
|
-
|
|
257
|
-
<dl>
|
|
258
|
-
<dd>
|
|
259
|
-
|
|
260
|
-
**request:** `FiveOneEat.CustomerStandPaymentIntentRequest`
|
|
261
|
-
|
|
262
|
-
</dd>
|
|
263
|
-
</dl>
|
|
264
|
-
|
|
265
|
-
<dl>
|
|
266
|
-
<dd>
|
|
267
|
-
|
|
268
|
-
**requestOptions:** `CustomerStandsClient.RequestOptions`
|
|
269
|
-
|
|
270
|
-
</dd>
|
|
271
|
-
</dl>
|
|
272
|
-
</dd>
|
|
273
|
-
</dl>
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
</dd>
|
|
277
|
-
</dl>
|
|
278
|
-
</details>
|
|
279
|
-
|
|
280
|
-
<details><summary><code>client.customerStands.<a href="/src/api/resources/customerStands/client/Client.ts">customerStandCheckout</a>({ ...params }) -> FiveOneEat.CustomerStandCheckoutResponse</code></summary>
|
|
281
|
-
<dl>
|
|
282
|
-
<dd>
|
|
283
|
-
|
|
284
|
-
#### 🔌 Usage
|
|
285
|
-
|
|
286
|
-
<dl>
|
|
287
|
-
<dd>
|
|
288
|
-
|
|
289
|
-
<dl>
|
|
290
|
-
<dd>
|
|
291
|
-
|
|
292
|
-
```typescript
|
|
293
|
-
await client.customerStands.customerStandCheckout({
|
|
294
|
-
stand: "stand",
|
|
295
|
-
body: {
|
|
296
|
-
payment_intent_id: "payment_intent_id"
|
|
297
|
-
}
|
|
298
|
-
});
|
|
299
|
-
|
|
300
|
-
```
|
|
301
|
-
</dd>
|
|
302
|
-
</dl>
|
|
303
|
-
</dd>
|
|
304
|
-
</dl>
|
|
305
|
-
|
|
306
|
-
#### ⚙️ Parameters
|
|
307
|
-
|
|
308
|
-
<dl>
|
|
309
|
-
<dd>
|
|
310
|
-
|
|
311
|
-
<dl>
|
|
312
|
-
<dd>
|
|
313
|
-
|
|
314
|
-
**request:** `FiveOneEat.CustomerStandCheckoutRequest`
|
|
315
|
-
|
|
316
|
-
</dd>
|
|
317
|
-
</dl>
|
|
318
|
-
|
|
319
|
-
<dl>
|
|
320
|
-
<dd>
|
|
321
|
-
|
|
322
|
-
**requestOptions:** `CustomerStandsClient.RequestOptions`
|
|
323
|
-
|
|
324
|
-
</dd>
|
|
325
|
-
</dl>
|
|
326
|
-
</dd>
|
|
327
|
-
</dl>
|
|
328
|
-
|
|
329
|
-
|
|
330
225
|
</dd>
|
|
331
226
|
</dl>
|
|
332
227
|
</details>
|
|
@@ -12499,7 +12394,7 @@ await client.customer.stands.scan({
|
|
|
12499
12394
|
</dl>
|
|
12500
12395
|
</details>
|
|
12501
12396
|
|
|
12502
|
-
<details><summary><code>client.customer.stands.<a href="/src/api/resources/customer/resources/stands/client/Client.ts">
|
|
12397
|
+
<details><summary><code>client.customer.stands.<a href="/src/api/resources/customer/resources/stands/client/Client.ts">createPaymentIntent</a>({ ...params }) -> FiveOneEat.CreatePaymentIntentStandsResponse</code></summary>
|
|
12503
12398
|
<dl>
|
|
12504
12399
|
<dd>
|
|
12505
12400
|
|
|
@@ -12512,7 +12407,7 @@ await client.customer.stands.scan({
|
|
|
12512
12407
|
<dd>
|
|
12513
12408
|
|
|
12514
12409
|
```typescript
|
|
12515
|
-
await client.customer.stands.
|
|
12410
|
+
await client.customer.stands.createPaymentIntent({
|
|
12516
12411
|
stand: "stand"
|
|
12517
12412
|
});
|
|
12518
12413
|
|
|
@@ -12530,7 +12425,7 @@ await client.customer.stands.checkout({
|
|
|
12530
12425
|
<dl>
|
|
12531
12426
|
<dd>
|
|
12532
12427
|
|
|
12533
|
-
**request:** `FiveOneEat.customer.
|
|
12428
|
+
**request:** `FiveOneEat.customer.CreatePaymentIntentStandsRequest`
|
|
12534
12429
|
|
|
12535
12430
|
</dd>
|
|
12536
12431
|
</dl>
|
|
@@ -12550,7 +12445,7 @@ await client.customer.stands.checkout({
|
|
|
12550
12445
|
</dl>
|
|
12551
12446
|
</details>
|
|
12552
12447
|
|
|
12553
|
-
<details><summary><code>client.customer.stands.<a href="/src/api/resources/customer/resources/stands/client/Client.ts">
|
|
12448
|
+
<details><summary><code>client.customer.stands.<a href="/src/api/resources/customer/resources/stands/client/Client.ts">checkout</a>({ ...params }) -> FiveOneEat.CheckoutStandsResponse</code></summary>
|
|
12554
12449
|
<dl>
|
|
12555
12450
|
<dd>
|
|
12556
12451
|
|
|
@@ -12563,8 +12458,11 @@ await client.customer.stands.checkout({
|
|
|
12563
12458
|
<dd>
|
|
12564
12459
|
|
|
12565
12460
|
```typescript
|
|
12566
|
-
await client.customer.stands.
|
|
12567
|
-
stand: "stand"
|
|
12461
|
+
await client.customer.stands.checkout({
|
|
12462
|
+
stand: "stand",
|
|
12463
|
+
body: {
|
|
12464
|
+
payment_intent_id: "payment_intent_id"
|
|
12465
|
+
}
|
|
12568
12466
|
});
|
|
12569
12467
|
|
|
12570
12468
|
```
|
|
@@ -12581,7 +12479,7 @@ await client.customer.stands.createPaymentIntent({
|
|
|
12581
12479
|
<dl>
|
|
12582
12480
|
<dd>
|
|
12583
12481
|
|
|
12584
|
-
**request:** `FiveOneEat.customer.
|
|
12482
|
+
**request:** `FiveOneEat.customer.CheckoutStandsRequest`
|
|
12585
12483
|
|
|
12586
12484
|
</dd>
|
|
12587
12485
|
</dl>
|
package/dist/cjs/api/resources/customerStands/client/requests/CustomerStandCheckoutRequest.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type * as FiveOneEat from "../../../../index.js";
|
|
2
|
-
/**
|
|
3
|
-
* @example
|
|
4
|
-
* {
|
|
5
|
-
* stand: "stand",
|
|
6
|
-
* body: {
|
|
7
|
-
* payment_intent_id: "payment_intent_id"
|
|
8
|
-
* }
|
|
9
|
-
* }
|
|
10
|
-
*/
|
|
11
|
-
export interface CustomerStandCheckoutRequest {
|
|
12
|
-
/** The stand ID */
|
|
13
|
-
stand: string;
|
|
14
|
-
body: FiveOneEat.CheckoutRequest;
|
|
15
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export interface CustomerStandPaymentIntentResponse {
|
|
2
|
-
client_secret: string;
|
|
3
|
-
payment_intent_id: string;
|
|
4
|
-
amount: number;
|
|
5
|
-
currency: CustomerStandPaymentIntentResponse.Currency;
|
|
6
|
-
}
|
|
7
|
-
export declare namespace CustomerStandPaymentIntentResponse {
|
|
8
|
-
const Currency: {
|
|
9
|
-
readonly Usd: "usd";
|
|
10
|
-
};
|
|
11
|
-
type Currency = (typeof Currency)[keyof typeof Currency];
|
|
12
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.CustomerStandPaymentIntentResponse = void 0;
|
|
5
|
-
var CustomerStandPaymentIntentResponse;
|
|
6
|
-
(function (CustomerStandPaymentIntentResponse) {
|
|
7
|
-
CustomerStandPaymentIntentResponse.Currency = {
|
|
8
|
-
Usd: "usd",
|
|
9
|
-
};
|
|
10
|
-
})(CustomerStandPaymentIntentResponse || (exports.CustomerStandPaymentIntentResponse = CustomerStandPaymentIntentResponse = {}));
|