@51eat/sdk 0.0.32 → 0.0.34
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/README.md +12 -16
- package/dist/cjs/BaseClient.js +2 -2
- package/dist/cjs/Client.d.ts +0 -3
- package/dist/cjs/Client.js +6 -11
- package/dist/cjs/api/resources/customer/resources/auth/client/Client.d.ts +1 -2
- package/dist/cjs/api/resources/customer/resources/auth/client/Client.js +5 -9
- package/dist/cjs/api/resources/customer/resources/auth/client/requests/UploadAvatarRequest.d.ts +2 -3
- package/dist/cjs/api/resources/customer/resources/events/resources/index.d.ts +1 -0
- package/dist/cjs/api/resources/customer/resources/events/resources/index.js +1 -0
- package/dist/cjs/api/resources/customer/resources/events/resources/ticketing/client/Client.d.ts +55 -14
- package/dist/cjs/api/resources/customer/resources/events/resources/ticketing/client/Client.js +171 -53
- package/dist/cjs/api/resources/customer/resources/events/resources/ticketing/client/requests/ReleaseHoldTicketingRequest.d.ts +2 -2
- package/dist/cjs/api/resources/customer/resources/events/resources/ticketing/client/requests/index.d.ts +4 -4
- package/dist/cjs/api/resources/customer/resources/events/resources/ticketing/index.d.ts +1 -0
- package/dist/cjs/api/resources/customer/resources/events/resources/ticketing/index.js +1 -0
- package/dist/cjs/api/resources/customer/resources/events/resources/ticketing/types/CalculatePriceTicketingResponse.d.ts +11 -0
- package/dist/cjs/api/resources/customer/resources/events/resources/ticketing/types/ConfirmOrderTicketingResponse.d.ts +4 -0
- package/dist/cjs/api/resources/{customerEvents/types/CreatePaymentIntentResponse.d.ts → customer/resources/events/resources/ticketing/types/CreatePaymentIntentTicketingResponse.d.ts} +3 -3
- package/dist/{esm/api/resources/customerEvents/types/HoldTicketsResponse.d.mts → cjs/api/resources/customer/resources/events/resources/ticketing/types/HoldTicketsTicketingResponse.d.ts} +3 -3
- package/dist/cjs/api/resources/customer/resources/events/resources/ticketing/types/index.d.ts +4 -0
- package/dist/cjs/api/resources/{customerEvents → customer/resources/events/resources/ticketing}/types/index.js +4 -4
- package/dist/cjs/api/resources/index.d.ts +0 -3
- package/dist/cjs/api/resources/index.js +1 -4
- 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/Client.d.mts +0 -3
- package/dist/esm/Client.mjs +0 -5
- package/dist/esm/api/resources/customer/resources/auth/client/Client.d.mts +1 -2
- package/dist/esm/api/resources/customer/resources/auth/client/Client.mjs +6 -10
- package/dist/esm/api/resources/customer/resources/auth/client/requests/UploadAvatarRequest.d.mts +2 -3
- package/dist/esm/api/resources/customer/resources/events/resources/index.d.mts +1 -0
- package/dist/esm/api/resources/customer/resources/events/resources/index.mjs +1 -0
- package/dist/esm/api/resources/customer/resources/events/resources/ticketing/client/Client.d.mts +55 -14
- package/dist/esm/api/resources/customer/resources/events/resources/ticketing/client/Client.mjs +171 -53
- package/dist/esm/api/resources/customer/resources/events/resources/ticketing/client/requests/ReleaseHoldTicketingRequest.d.mts +2 -2
- package/dist/esm/api/resources/customer/resources/events/resources/ticketing/client/requests/index.d.mts +4 -4
- package/dist/esm/api/resources/customer/resources/events/resources/ticketing/index.d.mts +1 -0
- package/dist/esm/api/resources/customer/resources/events/resources/ticketing/index.mjs +1 -0
- package/dist/esm/api/resources/customer/resources/events/resources/ticketing/types/CalculatePriceTicketingResponse.d.mts +11 -0
- package/dist/esm/api/resources/customer/resources/events/resources/ticketing/types/ConfirmOrderTicketingResponse.d.mts +4 -0
- package/dist/esm/api/resources/{customerEvents/types/CreatePaymentIntentResponse.d.mts → customer/resources/events/resources/ticketing/types/CreatePaymentIntentTicketingResponse.d.mts} +3 -3
- package/dist/{cjs/api/resources/customerEvents/types/HoldTicketsResponse.d.ts → esm/api/resources/customer/resources/events/resources/ticketing/types/HoldTicketsTicketingResponse.d.mts} +3 -3
- package/dist/esm/api/resources/customer/resources/events/resources/ticketing/types/index.d.mts +4 -0
- package/dist/esm/api/resources/customer/resources/events/resources/ticketing/types/index.mjs +4 -0
- package/dist/esm/api/resources/index.d.mts +0 -3
- package/dist/esm/api/resources/index.mjs +0 -3
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -12
- package/reference.md +97 -354
- package/dist/cjs/api/resources/customer/resources/events/resources/ticketing/client/requests/CalculatePriceTicketingRequest.d.ts +0 -9
- package/dist/cjs/api/resources/customer/resources/events/resources/ticketing/client/requests/ConfirmOrderTicketingRequest.d.ts +0 -9
- package/dist/cjs/api/resources/customer/resources/events/resources/ticketing/client/requests/CreatePaymentIntentTicketingRequest.d.ts +0 -9
- package/dist/cjs/api/resources/customer/resources/events/resources/ticketing/client/requests/HoldTicketsTicketingRequest.d.ts +0 -9
- package/dist/cjs/api/resources/customerEvents/client/Client.d.ts +0 -110
- package/dist/cjs/api/resources/customerEvents/client/Client.js +0 -384
- package/dist/cjs/api/resources/customerEvents/client/index.d.ts +0 -1
- package/dist/cjs/api/resources/customerEvents/client/index.js +0 -17
- package/dist/cjs/api/resources/customerEvents/client/requests/ReleaseTicketHoldRequest.d.ts +0 -11
- package/dist/cjs/api/resources/customerEvents/client/requests/ReleaseTicketHoldRequest.js +0 -3
- package/dist/cjs/api/resources/customerEvents/client/requests/index.d.ts +0 -5
- package/dist/cjs/api/resources/customerEvents/client/requests/index.js +0 -2
- package/dist/cjs/api/resources/customerEvents/exports.d.ts +0 -2
- package/dist/cjs/api/resources/customerEvents/exports.js +0 -21
- package/dist/cjs/api/resources/customerEvents/index.d.ts +0 -2
- package/dist/cjs/api/resources/customerEvents/index.js +0 -18
- package/dist/cjs/api/resources/customerEvents/types/CalculateTicketPriceResponse.d.ts +0 -11
- package/dist/cjs/api/resources/customerEvents/types/CalculateTicketPriceResponse.js +0 -3
- package/dist/cjs/api/resources/customerEvents/types/ConfirmTicketOrderResponse.d.ts +0 -4
- package/dist/cjs/api/resources/customerEvents/types/ConfirmTicketOrderResponse.js +0 -3
- package/dist/cjs/api/resources/customerEvents/types/CreatePaymentIntentResponse.js +0 -3
- package/dist/cjs/api/resources/customerEvents/types/HoldTicketsResponse.js +0 -3
- package/dist/cjs/api/resources/customerEvents/types/index.d.ts +0 -4
- package/dist/esm/api/resources/customer/resources/events/resources/ticketing/client/requests/CalculatePriceTicketingRequest.d.mts +0 -9
- package/dist/esm/api/resources/customer/resources/events/resources/ticketing/client/requests/ConfirmOrderTicketingRequest.d.mts +0 -9
- package/dist/esm/api/resources/customer/resources/events/resources/ticketing/client/requests/CreatePaymentIntentTicketingRequest.d.mts +0 -9
- package/dist/esm/api/resources/customer/resources/events/resources/ticketing/client/requests/HoldTicketsTicketingRequest.d.mts +0 -9
- package/dist/esm/api/resources/customerEvents/client/Client.d.mts +0 -110
- package/dist/esm/api/resources/customerEvents/client/Client.mjs +0 -347
- package/dist/esm/api/resources/customerEvents/client/index.d.mts +0 -1
- package/dist/esm/api/resources/customerEvents/client/index.mjs +0 -1
- package/dist/esm/api/resources/customerEvents/client/requests/ReleaseTicketHoldRequest.d.mts +0 -11
- package/dist/esm/api/resources/customerEvents/client/requests/ReleaseTicketHoldRequest.mjs +0 -2
- package/dist/esm/api/resources/customerEvents/client/requests/index.d.mts +0 -5
- package/dist/esm/api/resources/customerEvents/client/requests/index.mjs +0 -1
- package/dist/esm/api/resources/customerEvents/exports.d.mts +0 -2
- package/dist/esm/api/resources/customerEvents/exports.mjs +0 -3
- package/dist/esm/api/resources/customerEvents/index.d.mts +0 -2
- package/dist/esm/api/resources/customerEvents/index.mjs +0 -2
- package/dist/esm/api/resources/customerEvents/types/CalculateTicketPriceResponse.d.mts +0 -11
- package/dist/esm/api/resources/customerEvents/types/CalculateTicketPriceResponse.mjs +0 -2
- package/dist/esm/api/resources/customerEvents/types/ConfirmTicketOrderResponse.d.mts +0 -4
- package/dist/esm/api/resources/customerEvents/types/ConfirmTicketOrderResponse.mjs +0 -2
- package/dist/esm/api/resources/customerEvents/types/CreatePaymentIntentResponse.mjs +0 -2
- package/dist/esm/api/resources/customerEvents/types/HoldTicketsResponse.mjs +0 -2
- package/dist/esm/api/resources/customerEvents/types/index.d.mts +0 -4
- package/dist/esm/api/resources/customerEvents/types/index.mjs +0 -4
- /package/dist/cjs/api/resources/{customerEvents → customer/resources/events/resources/ticketing}/client/requests/CalculatePriceRequest.d.ts +0 -0
- /package/dist/cjs/api/resources/{customerEvents → customer/resources/events/resources/ticketing}/client/requests/CalculatePriceRequest.js +0 -0
- /package/dist/cjs/api/resources/{customerEvents → customer/resources/events/resources/ticketing}/client/requests/CreatePaymentIntentRequest.d.ts +0 -0
- /package/dist/cjs/api/resources/{customerEvents → customer/resources/events/resources/ticketing}/client/requests/CreatePaymentIntentRequest.js +0 -0
- /package/dist/cjs/api/resources/{customerEvents → customer/resources/events/resources/ticketing}/client/requests/StoreTicketHoldRequest.d.ts +0 -0
- /package/dist/cjs/api/resources/{customerEvents → customer/resources/events/resources/ticketing}/client/requests/StoreTicketHoldRequest.js +0 -0
- /package/dist/cjs/api/resources/{customerEvents → customer/resources/events/resources/ticketing}/client/requests/StoreTicketOrderRequest.d.ts +0 -0
- /package/dist/cjs/api/resources/{customerEvents → customer/resources/events/resources/ticketing}/client/requests/StoreTicketOrderRequest.js +0 -0
- /package/dist/cjs/api/resources/customer/resources/events/resources/ticketing/{client/requests/CalculatePriceTicketingRequest.js → types/CalculatePriceTicketingResponse.js} +0 -0
- /package/dist/cjs/api/resources/customer/resources/events/resources/ticketing/{client/requests/ConfirmOrderTicketingRequest.js → types/ConfirmOrderTicketingResponse.js} +0 -0
- /package/dist/cjs/api/resources/customer/resources/events/resources/ticketing/{client/requests/CreatePaymentIntentTicketingRequest.js → types/CreatePaymentIntentTicketingResponse.js} +0 -0
- /package/dist/cjs/api/resources/customer/resources/events/resources/ticketing/{client/requests/HoldTicketsTicketingRequest.js → types/HoldTicketsTicketingResponse.js} +0 -0
- /package/dist/esm/api/resources/{customerEvents → customer/resources/events/resources/ticketing}/client/requests/CalculatePriceRequest.d.mts +0 -0
- /package/dist/esm/api/resources/{customerEvents → customer/resources/events/resources/ticketing}/client/requests/CalculatePriceRequest.mjs +0 -0
- /package/dist/esm/api/resources/{customerEvents → customer/resources/events/resources/ticketing}/client/requests/CreatePaymentIntentRequest.d.mts +0 -0
- /package/dist/esm/api/resources/{customerEvents → customer/resources/events/resources/ticketing}/client/requests/CreatePaymentIntentRequest.mjs +0 -0
- /package/dist/esm/api/resources/{customerEvents → customer/resources/events/resources/ticketing}/client/requests/StoreTicketHoldRequest.d.mts +0 -0
- /package/dist/esm/api/resources/{customerEvents → customer/resources/events/resources/ticketing}/client/requests/StoreTicketHoldRequest.mjs +0 -0
- /package/dist/esm/api/resources/{customerEvents → customer/resources/events/resources/ticketing}/client/requests/StoreTicketOrderRequest.d.mts +0 -0
- /package/dist/esm/api/resources/{customerEvents → customer/resources/events/resources/ticketing}/client/requests/StoreTicketOrderRequest.mjs +0 -0
- /package/dist/esm/api/resources/customer/resources/events/resources/ticketing/{client/requests/CalculatePriceTicketingRequest.mjs → types/CalculatePriceTicketingResponse.mjs} +0 -0
- /package/dist/esm/api/resources/customer/resources/events/resources/ticketing/{client/requests/ConfirmOrderTicketingRequest.mjs → types/ConfirmOrderTicketingResponse.mjs} +0 -0
- /package/dist/esm/api/resources/customer/resources/events/resources/ticketing/{client/requests/CreatePaymentIntentTicketingRequest.mjs → types/CreatePaymentIntentTicketingResponse.mjs} +0 -0
- /package/dist/esm/api/resources/customer/resources/events/resources/ticketing/{client/requests/HoldTicketsTicketingRequest.mjs → types/HoldTicketsTicketingResponse.mjs} +0 -0
|
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
import { normalizeClientOptionsWithAuth } from "../../../../../../BaseClient.mjs";
|
|
12
|
-
import { mergeHeaders
|
|
12
|
+
import { mergeHeaders } from "../../../../../../core/headers.mjs";
|
|
13
13
|
import * as core from "../../../../../../core/index.mjs";
|
|
14
14
|
import * as environments from "../../../../../../environments.mjs";
|
|
15
15
|
import { handleNonStatusCodeError } from "../../../../../../errors/handleNonStatusCodeError.mjs";
|
|
@@ -370,9 +370,8 @@ export class AuthClient {
|
|
|
370
370
|
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
371
371
|
*
|
|
372
372
|
* @example
|
|
373
|
-
* import { createReadStream } from "fs";
|
|
374
373
|
* await client.customer.auth.uploadAvatar({
|
|
375
|
-
* avatar:
|
|
374
|
+
* avatar: "avatar"
|
|
376
375
|
* })
|
|
377
376
|
*/
|
|
378
377
|
uploadAvatar(request, requestOptions) {
|
|
@@ -381,19 +380,16 @@ export class AuthClient {
|
|
|
381
380
|
__uploadAvatar(request, requestOptions) {
|
|
382
381
|
return __awaiter(this, void 0, void 0, function* () {
|
|
383
382
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
384
|
-
const _body = yield core.newFormData();
|
|
385
|
-
yield _body.appendFile("avatar", request.avatar);
|
|
386
|
-
const _maybeEncodedRequest = yield _body.getRequest();
|
|
387
383
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
388
|
-
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers,
|
|
384
|
+
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);
|
|
389
385
|
const _response = yield core.fetcher({
|
|
390
386
|
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/user/avatar"),
|
|
391
387
|
method: "POST",
|
|
392
388
|
headers: _headers,
|
|
389
|
+
contentType: "application/json",
|
|
393
390
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
394
|
-
requestType: "
|
|
395
|
-
|
|
396
|
-
body: _maybeEncodedRequest.body,
|
|
391
|
+
requestType: "json",
|
|
392
|
+
body: request,
|
|
397
393
|
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,
|
|
398
394
|
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,
|
|
399
395
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
package/dist/esm/api/resources/customer/resources/auth/client/requests/UploadAvatarRequest.d.mts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import type * as core from "../../../../../../../core/index.mjs";
|
|
2
1
|
/**
|
|
3
2
|
* @example
|
|
4
3
|
* {
|
|
5
|
-
* avatar:
|
|
4
|
+
* avatar: "avatar"
|
|
6
5
|
* }
|
|
7
6
|
*/
|
|
8
7
|
export interface UploadAvatarRequest {
|
|
9
|
-
avatar:
|
|
8
|
+
avatar: string;
|
|
10
9
|
}
|
package/dist/esm/api/resources/customer/resources/events/resources/ticketing/client/Client.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../../../BaseClient.mjs";
|
|
2
2
|
import { type NormalizedClientOptionsWithAuth } from "../../../../../../../../BaseClient.mjs";
|
|
3
3
|
import * as core from "../../../../../../../../core/index.mjs";
|
|
4
|
-
import
|
|
4
|
+
import * as FiveOneEat from "../../../../../../../index.mjs";
|
|
5
5
|
export declare namespace TicketingClient {
|
|
6
6
|
type Options = BaseClientOptions;
|
|
7
7
|
interface RequestOptions extends BaseRequestOptions {
|
|
@@ -11,59 +11,100 @@ export declare class TicketingClient {
|
|
|
11
11
|
protected readonly _options: NormalizedClientOptionsWithAuth<TicketingClient.Options>;
|
|
12
12
|
constructor(options?: TicketingClient.Options);
|
|
13
13
|
/**
|
|
14
|
-
*
|
|
14
|
+
* Place a temporary hold on tickets for the specified event. Holds expire after 10 minutes.
|
|
15
|
+
*
|
|
16
|
+
* @param {FiveOneEat.customer.events.StoreTicketHoldRequest} request
|
|
15
17
|
* @param {TicketingClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
16
18
|
*
|
|
19
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
20
|
+
* @throws {@link FiveOneEat.NotFoundError}
|
|
21
|
+
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
22
|
+
*
|
|
17
23
|
* @example
|
|
18
24
|
* await client.customer.events.ticketing.holdTickets({
|
|
19
|
-
*
|
|
25
|
+
* eventId: "eventId",
|
|
26
|
+
* tickets: [{
|
|
27
|
+
* ticket_type_id: "ticket_type_id",
|
|
28
|
+
* quantity: 1
|
|
29
|
+
* }]
|
|
20
30
|
* })
|
|
21
31
|
*/
|
|
22
|
-
holdTickets(request: FiveOneEat.customer.events.
|
|
32
|
+
holdTickets(request: FiveOneEat.customer.events.StoreTicketHoldRequest, requestOptions?: TicketingClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.customer.events.HoldTicketsTicketingResponse>;
|
|
23
33
|
private __holdTickets;
|
|
24
34
|
/**
|
|
35
|
+
* Release all active holds for the given session, freeing the tickets for others.
|
|
36
|
+
*
|
|
25
37
|
* @param {FiveOneEat.customer.events.ReleaseHoldTicketingRequest} request
|
|
26
38
|
* @param {TicketingClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
27
39
|
*
|
|
40
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
41
|
+
* @throws {@link FiveOneEat.NotFoundError}
|
|
42
|
+
*
|
|
28
43
|
* @example
|
|
29
44
|
* await client.customer.events.ticketing.releaseHold({
|
|
30
|
-
*
|
|
45
|
+
* eventId: "eventId",
|
|
31
46
|
* sessionId: "sessionId"
|
|
32
47
|
* })
|
|
33
48
|
*/
|
|
34
49
|
releaseHold(request: FiveOneEat.customer.events.ReleaseHoldTicketingRequest, requestOptions?: TicketingClient.RequestOptions): core.HttpResponsePromise<void>;
|
|
35
50
|
private __releaseHold;
|
|
36
51
|
/**
|
|
37
|
-
*
|
|
52
|
+
* Preview the subtotal, platform fee, and total for a given ticket selection.
|
|
53
|
+
*
|
|
54
|
+
* @param {FiveOneEat.customer.events.CalculatePriceRequest} request
|
|
38
55
|
* @param {TicketingClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
39
56
|
*
|
|
57
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
58
|
+
* @throws {@link FiveOneEat.NotFoundError}
|
|
59
|
+
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
60
|
+
*
|
|
40
61
|
* @example
|
|
41
62
|
* await client.customer.events.ticketing.calculatePrice({
|
|
42
|
-
*
|
|
63
|
+
* eventId: "eventId",
|
|
64
|
+
* tickets: [{
|
|
65
|
+
* ticket_type_id: "ticket_type_id",
|
|
66
|
+
* quantity: 1
|
|
67
|
+
* }]
|
|
43
68
|
* })
|
|
44
69
|
*/
|
|
45
|
-
calculatePrice(request: FiveOneEat.customer.events.
|
|
70
|
+
calculatePrice(request: FiveOneEat.customer.events.CalculatePriceRequest, requestOptions?: TicketingClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.customer.events.CalculatePriceTicketingResponse>;
|
|
46
71
|
private __calculatePrice;
|
|
47
72
|
/**
|
|
48
|
-
*
|
|
73
|
+
* Create a Stripe payment intent for the tickets held in the given session.
|
|
74
|
+
* Returns a client_secret for the mobile app to confirm payment with Stripe.
|
|
75
|
+
*
|
|
76
|
+
* @param {FiveOneEat.customer.events.CreatePaymentIntentRequest} request
|
|
49
77
|
* @param {TicketingClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
50
78
|
*
|
|
79
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
80
|
+
* @throws {@link FiveOneEat.NotFoundError}
|
|
81
|
+
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
82
|
+
*
|
|
51
83
|
* @example
|
|
52
84
|
* await client.customer.events.ticketing.createPaymentIntent({
|
|
53
|
-
*
|
|
85
|
+
* eventId: "eventId",
|
|
86
|
+
* session_id: "session_id"
|
|
54
87
|
* })
|
|
55
88
|
*/
|
|
56
|
-
createPaymentIntent(request: FiveOneEat.customer.events.
|
|
89
|
+
createPaymentIntent(request: FiveOneEat.customer.events.CreatePaymentIntentRequest, requestOptions?: TicketingClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.customer.events.CreatePaymentIntentTicketingResponse>;
|
|
57
90
|
private __createPaymentIntent;
|
|
58
91
|
/**
|
|
59
|
-
*
|
|
92
|
+
* Confirm a completed Stripe payment and create the ticket order.
|
|
93
|
+
* The payment must have succeeded before calling this endpoint.
|
|
94
|
+
*
|
|
95
|
+
* @param {FiveOneEat.customer.events.StoreTicketOrderRequest} request
|
|
60
96
|
* @param {TicketingClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
61
97
|
*
|
|
98
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
99
|
+
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
100
|
+
*
|
|
62
101
|
* @example
|
|
63
102
|
* await client.customer.events.ticketing.confirmOrder({
|
|
64
|
-
*
|
|
103
|
+
* eventId: "eventId",
|
|
104
|
+
* payment_intent_id: "payment_intent_id",
|
|
105
|
+
* session_id: "session_id"
|
|
65
106
|
* })
|
|
66
107
|
*/
|
|
67
|
-
confirmOrder(request: FiveOneEat.customer.events.
|
|
108
|
+
confirmOrder(request: FiveOneEat.customer.events.StoreTicketOrderRequest, requestOptions?: TicketingClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.customer.events.ConfirmOrderTicketingResponse>;
|
|
68
109
|
private __confirmOrder;
|
|
69
110
|
}
|
package/dist/esm/api/resources/customer/resources/events/resources/ticketing/client/Client.mjs
CHANGED
|
@@ -8,23 +8,45 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
12
|
+
var t = {};
|
|
13
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
14
|
+
t[p] = s[p];
|
|
15
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
16
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
17
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
18
|
+
t[p[i]] = s[p[i]];
|
|
19
|
+
}
|
|
20
|
+
return t;
|
|
21
|
+
};
|
|
11
22
|
import { normalizeClientOptionsWithAuth, } from "../../../../../../../../BaseClient.mjs";
|
|
12
23
|
import { mergeHeaders } from "../../../../../../../../core/headers.mjs";
|
|
13
24
|
import * as core from "../../../../../../../../core/index.mjs";
|
|
14
25
|
import * as environments from "../../../../../../../../environments.mjs";
|
|
15
26
|
import { handleNonStatusCodeError } from "../../../../../../../../errors/handleNonStatusCodeError.mjs";
|
|
16
27
|
import * as errors from "../../../../../../../../errors/index.mjs";
|
|
28
|
+
import * as FiveOneEat from "../../../../../../../index.mjs";
|
|
17
29
|
export class TicketingClient {
|
|
18
30
|
constructor(options = {}) {
|
|
19
31
|
this._options = normalizeClientOptionsWithAuth(options);
|
|
20
32
|
}
|
|
21
33
|
/**
|
|
22
|
-
*
|
|
34
|
+
* Place a temporary hold on tickets for the specified event. Holds expire after 10 minutes.
|
|
35
|
+
*
|
|
36
|
+
* @param {FiveOneEat.customer.events.StoreTicketHoldRequest} request
|
|
23
37
|
* @param {TicketingClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
24
38
|
*
|
|
39
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
40
|
+
* @throws {@link FiveOneEat.NotFoundError}
|
|
41
|
+
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
42
|
+
*
|
|
25
43
|
* @example
|
|
26
44
|
* await client.customer.events.ticketing.holdTickets({
|
|
27
|
-
*
|
|
45
|
+
* eventId: "eventId",
|
|
46
|
+
* tickets: [{
|
|
47
|
+
* ticket_type_id: "ticket_type_id",
|
|
48
|
+
* quantity: 1
|
|
49
|
+
* }]
|
|
28
50
|
* })
|
|
29
51
|
*/
|
|
30
52
|
holdTickets(request, requestOptions) {
|
|
@@ -33,14 +55,17 @@ export class TicketingClient {
|
|
|
33
55
|
__holdTickets(request, requestOptions) {
|
|
34
56
|
return __awaiter(this, void 0, void 0, function* () {
|
|
35
57
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
36
|
-
const {
|
|
58
|
+
const { eventId } = request, _body = __rest(request, ["eventId"]);
|
|
37
59
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
38
60
|
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);
|
|
39
61
|
const _response = yield core.fetcher({
|
|
40
|
-
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/events/${core.url.encodePathParam(
|
|
62
|
+
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/events/${core.url.encodePathParam(eventId)}/ticket-holds`),
|
|
41
63
|
method: "POST",
|
|
42
64
|
headers: _headers,
|
|
65
|
+
contentType: "application/json",
|
|
43
66
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
67
|
+
requestType: "json",
|
|
68
|
+
body: _body,
|
|
44
69
|
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,
|
|
45
70
|
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,
|
|
46
71
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -48,25 +73,42 @@ export class TicketingClient {
|
|
|
48
73
|
logging: this._options.logging,
|
|
49
74
|
});
|
|
50
75
|
if (_response.ok) {
|
|
51
|
-
return {
|
|
76
|
+
return {
|
|
77
|
+
data: _response.body,
|
|
78
|
+
rawResponse: _response.rawResponse,
|
|
79
|
+
};
|
|
52
80
|
}
|
|
53
81
|
if (_response.error.reason === "status-code") {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
82
|
+
switch (_response.error.statusCode) {
|
|
83
|
+
case 401:
|
|
84
|
+
throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
85
|
+
case 404:
|
|
86
|
+
throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
|
|
87
|
+
case 422:
|
|
88
|
+
throw new FiveOneEat.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
89
|
+
default:
|
|
90
|
+
throw new errors.FiveOneEatError({
|
|
91
|
+
statusCode: _response.error.statusCode,
|
|
92
|
+
body: _response.error.body,
|
|
93
|
+
rawResponse: _response.rawResponse,
|
|
94
|
+
});
|
|
95
|
+
}
|
|
59
96
|
}
|
|
60
|
-
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/customer/events/{
|
|
97
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/customer/events/{eventId}/ticket-holds");
|
|
61
98
|
});
|
|
62
99
|
}
|
|
63
100
|
/**
|
|
101
|
+
* Release all active holds for the given session, freeing the tickets for others.
|
|
102
|
+
*
|
|
64
103
|
* @param {FiveOneEat.customer.events.ReleaseHoldTicketingRequest} request
|
|
65
104
|
* @param {TicketingClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
66
105
|
*
|
|
106
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
107
|
+
* @throws {@link FiveOneEat.NotFoundError}
|
|
108
|
+
*
|
|
67
109
|
* @example
|
|
68
110
|
* await client.customer.events.ticketing.releaseHold({
|
|
69
|
-
*
|
|
111
|
+
* eventId: "eventId",
|
|
70
112
|
* sessionId: "sessionId"
|
|
71
113
|
* })
|
|
72
114
|
*/
|
|
@@ -76,11 +118,11 @@ export class TicketingClient {
|
|
|
76
118
|
__releaseHold(request, requestOptions) {
|
|
77
119
|
return __awaiter(this, void 0, void 0, function* () {
|
|
78
120
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
79
|
-
const {
|
|
121
|
+
const { eventId, sessionId } = request;
|
|
80
122
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
81
123
|
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);
|
|
82
124
|
const _response = yield core.fetcher({
|
|
83
|
-
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/events/${core.url.encodePathParam(
|
|
125
|
+
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/events/${core.url.encodePathParam(eventId)}/ticket-holds/${core.url.encodePathParam(sessionId)}`),
|
|
84
126
|
method: "DELETE",
|
|
85
127
|
headers: _headers,
|
|
86
128
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
@@ -94,22 +136,39 @@ export class TicketingClient {
|
|
|
94
136
|
return { data: undefined, rawResponse: _response.rawResponse };
|
|
95
137
|
}
|
|
96
138
|
if (_response.error.reason === "status-code") {
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
139
|
+
switch (_response.error.statusCode) {
|
|
140
|
+
case 401:
|
|
141
|
+
throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
142
|
+
case 404:
|
|
143
|
+
throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
|
|
144
|
+
default:
|
|
145
|
+
throw new errors.FiveOneEatError({
|
|
146
|
+
statusCode: _response.error.statusCode,
|
|
147
|
+
body: _response.error.body,
|
|
148
|
+
rawResponse: _response.rawResponse,
|
|
149
|
+
});
|
|
150
|
+
}
|
|
102
151
|
}
|
|
103
|
-
return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/customer/events/{
|
|
152
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/customer/events/{eventId}/ticket-holds/{sessionId}");
|
|
104
153
|
});
|
|
105
154
|
}
|
|
106
155
|
/**
|
|
107
|
-
*
|
|
156
|
+
* Preview the subtotal, platform fee, and total for a given ticket selection.
|
|
157
|
+
*
|
|
158
|
+
* @param {FiveOneEat.customer.events.CalculatePriceRequest} request
|
|
108
159
|
* @param {TicketingClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
109
160
|
*
|
|
161
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
162
|
+
* @throws {@link FiveOneEat.NotFoundError}
|
|
163
|
+
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
164
|
+
*
|
|
110
165
|
* @example
|
|
111
166
|
* await client.customer.events.ticketing.calculatePrice({
|
|
112
|
-
*
|
|
167
|
+
* eventId: "eventId",
|
|
168
|
+
* tickets: [{
|
|
169
|
+
* ticket_type_id: "ticket_type_id",
|
|
170
|
+
* quantity: 1
|
|
171
|
+
* }]
|
|
113
172
|
* })
|
|
114
173
|
*/
|
|
115
174
|
calculatePrice(request, requestOptions) {
|
|
@@ -118,14 +177,17 @@ export class TicketingClient {
|
|
|
118
177
|
__calculatePrice(request, requestOptions) {
|
|
119
178
|
return __awaiter(this, void 0, void 0, function* () {
|
|
120
179
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
121
|
-
const {
|
|
180
|
+
const { eventId } = request, _body = __rest(request, ["eventId"]);
|
|
122
181
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
123
182
|
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);
|
|
124
183
|
const _response = yield core.fetcher({
|
|
125
|
-
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/events/${core.url.encodePathParam(
|
|
184
|
+
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/events/${core.url.encodePathParam(eventId)}/calculate-price`),
|
|
126
185
|
method: "POST",
|
|
127
186
|
headers: _headers,
|
|
187
|
+
contentType: "application/json",
|
|
128
188
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
189
|
+
requestType: "json",
|
|
190
|
+
body: _body,
|
|
129
191
|
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,
|
|
130
192
|
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,
|
|
131
193
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -133,25 +195,45 @@ export class TicketingClient {
|
|
|
133
195
|
logging: this._options.logging,
|
|
134
196
|
});
|
|
135
197
|
if (_response.ok) {
|
|
136
|
-
return {
|
|
198
|
+
return {
|
|
199
|
+
data: _response.body,
|
|
200
|
+
rawResponse: _response.rawResponse,
|
|
201
|
+
};
|
|
137
202
|
}
|
|
138
203
|
if (_response.error.reason === "status-code") {
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
204
|
+
switch (_response.error.statusCode) {
|
|
205
|
+
case 401:
|
|
206
|
+
throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
207
|
+
case 404:
|
|
208
|
+
throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
|
|
209
|
+
case 422:
|
|
210
|
+
throw new FiveOneEat.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
211
|
+
default:
|
|
212
|
+
throw new errors.FiveOneEatError({
|
|
213
|
+
statusCode: _response.error.statusCode,
|
|
214
|
+
body: _response.error.body,
|
|
215
|
+
rawResponse: _response.rawResponse,
|
|
216
|
+
});
|
|
217
|
+
}
|
|
144
218
|
}
|
|
145
|
-
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/customer/events/{
|
|
219
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/customer/events/{eventId}/calculate-price");
|
|
146
220
|
});
|
|
147
221
|
}
|
|
148
222
|
/**
|
|
149
|
-
*
|
|
223
|
+
* Create a Stripe payment intent for the tickets held in the given session.
|
|
224
|
+
* Returns a client_secret for the mobile app to confirm payment with Stripe.
|
|
225
|
+
*
|
|
226
|
+
* @param {FiveOneEat.customer.events.CreatePaymentIntentRequest} request
|
|
150
227
|
* @param {TicketingClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
151
228
|
*
|
|
229
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
230
|
+
* @throws {@link FiveOneEat.NotFoundError}
|
|
231
|
+
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
232
|
+
*
|
|
152
233
|
* @example
|
|
153
234
|
* await client.customer.events.ticketing.createPaymentIntent({
|
|
154
|
-
*
|
|
235
|
+
* eventId: "eventId",
|
|
236
|
+
* session_id: "session_id"
|
|
155
237
|
* })
|
|
156
238
|
*/
|
|
157
239
|
createPaymentIntent(request, requestOptions) {
|
|
@@ -160,14 +242,17 @@ export class TicketingClient {
|
|
|
160
242
|
__createPaymentIntent(request, requestOptions) {
|
|
161
243
|
return __awaiter(this, void 0, void 0, function* () {
|
|
162
244
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
163
|
-
const {
|
|
245
|
+
const { eventId } = request, _body = __rest(request, ["eventId"]);
|
|
164
246
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
165
247
|
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);
|
|
166
248
|
const _response = yield core.fetcher({
|
|
167
|
-
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/events/${core.url.encodePathParam(
|
|
249
|
+
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/events/${core.url.encodePathParam(eventId)}/payment-intent`),
|
|
168
250
|
method: "POST",
|
|
169
251
|
headers: _headers,
|
|
252
|
+
contentType: "application/json",
|
|
170
253
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
254
|
+
requestType: "json",
|
|
255
|
+
body: _body,
|
|
171
256
|
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,
|
|
172
257
|
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,
|
|
173
258
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -175,25 +260,45 @@ export class TicketingClient {
|
|
|
175
260
|
logging: this._options.logging,
|
|
176
261
|
});
|
|
177
262
|
if (_response.ok) {
|
|
178
|
-
return {
|
|
263
|
+
return {
|
|
264
|
+
data: _response.body,
|
|
265
|
+
rawResponse: _response.rawResponse,
|
|
266
|
+
};
|
|
179
267
|
}
|
|
180
268
|
if (_response.error.reason === "status-code") {
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
269
|
+
switch (_response.error.statusCode) {
|
|
270
|
+
case 401:
|
|
271
|
+
throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
272
|
+
case 404:
|
|
273
|
+
throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
|
|
274
|
+
case 422:
|
|
275
|
+
throw new FiveOneEat.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
276
|
+
default:
|
|
277
|
+
throw new errors.FiveOneEatError({
|
|
278
|
+
statusCode: _response.error.statusCode,
|
|
279
|
+
body: _response.error.body,
|
|
280
|
+
rawResponse: _response.rawResponse,
|
|
281
|
+
});
|
|
282
|
+
}
|
|
186
283
|
}
|
|
187
|
-
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/customer/events/{
|
|
284
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/customer/events/{eventId}/payment-intent");
|
|
188
285
|
});
|
|
189
286
|
}
|
|
190
287
|
/**
|
|
191
|
-
*
|
|
288
|
+
* Confirm a completed Stripe payment and create the ticket order.
|
|
289
|
+
* The payment must have succeeded before calling this endpoint.
|
|
290
|
+
*
|
|
291
|
+
* @param {FiveOneEat.customer.events.StoreTicketOrderRequest} request
|
|
192
292
|
* @param {TicketingClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
193
293
|
*
|
|
294
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
295
|
+
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
296
|
+
*
|
|
194
297
|
* @example
|
|
195
298
|
* await client.customer.events.ticketing.confirmOrder({
|
|
196
|
-
*
|
|
299
|
+
* eventId: "eventId",
|
|
300
|
+
* payment_intent_id: "payment_intent_id",
|
|
301
|
+
* session_id: "session_id"
|
|
197
302
|
* })
|
|
198
303
|
*/
|
|
199
304
|
confirmOrder(request, requestOptions) {
|
|
@@ -202,14 +307,17 @@ export class TicketingClient {
|
|
|
202
307
|
__confirmOrder(request, requestOptions) {
|
|
203
308
|
return __awaiter(this, void 0, void 0, function* () {
|
|
204
309
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
205
|
-
const {
|
|
310
|
+
const { eventId } = request, _body = __rest(request, ["eventId"]);
|
|
206
311
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
207
312
|
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);
|
|
208
313
|
const _response = yield core.fetcher({
|
|
209
|
-
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/events/${core.url.encodePathParam(
|
|
314
|
+
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/events/${core.url.encodePathParam(eventId)}/ticket-orders`),
|
|
210
315
|
method: "POST",
|
|
211
316
|
headers: _headers,
|
|
317
|
+
contentType: "application/json",
|
|
212
318
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
319
|
+
requestType: "json",
|
|
320
|
+
body: _body,
|
|
213
321
|
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,
|
|
214
322
|
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,
|
|
215
323
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -217,16 +325,26 @@ export class TicketingClient {
|
|
|
217
325
|
logging: this._options.logging,
|
|
218
326
|
});
|
|
219
327
|
if (_response.ok) {
|
|
220
|
-
return {
|
|
328
|
+
return {
|
|
329
|
+
data: _response.body,
|
|
330
|
+
rawResponse: _response.rawResponse,
|
|
331
|
+
};
|
|
221
332
|
}
|
|
222
333
|
if (_response.error.reason === "status-code") {
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
334
|
+
switch (_response.error.statusCode) {
|
|
335
|
+
case 401:
|
|
336
|
+
throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
337
|
+
case 422:
|
|
338
|
+
throw new FiveOneEat.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
339
|
+
default:
|
|
340
|
+
throw new errors.FiveOneEatError({
|
|
341
|
+
statusCode: _response.error.statusCode,
|
|
342
|
+
body: _response.error.body,
|
|
343
|
+
rawResponse: _response.rawResponse,
|
|
344
|
+
});
|
|
345
|
+
}
|
|
228
346
|
}
|
|
229
|
-
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/customer/events/{
|
|
347
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/customer/events/{eventId}/ticket-orders");
|
|
230
348
|
});
|
|
231
349
|
}
|
|
232
350
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export type {
|
|
2
|
-
export type {
|
|
3
|
-
export type { CreatePaymentIntentTicketingRequest } from "./CreatePaymentIntentTicketingRequest.mjs";
|
|
4
|
-
export type { HoldTicketsTicketingRequest } from "./HoldTicketsTicketingRequest.mjs";
|
|
1
|
+
export type { CalculatePriceRequest } from "./CalculatePriceRequest.mjs";
|
|
2
|
+
export type { CreatePaymentIntentRequest } from "./CreatePaymentIntentRequest.mjs";
|
|
5
3
|
export type { ReleaseHoldTicketingRequest } from "./ReleaseHoldTicketingRequest.mjs";
|
|
4
|
+
export type { StoreTicketHoldRequest } from "./StoreTicketHoldRequest.mjs";
|
|
5
|
+
export type { StoreTicketOrderRequest } from "./StoreTicketOrderRequest.mjs";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface CalculatePriceTicketingResponse {
|
|
2
|
+
data: CalculatePriceTicketingResponse.Data;
|
|
3
|
+
}
|
|
4
|
+
export declare namespace CalculatePriceTicketingResponse {
|
|
5
|
+
interface Data {
|
|
6
|
+
subtotal: string;
|
|
7
|
+
platform_fee: string;
|
|
8
|
+
total: string;
|
|
9
|
+
line_items: string;
|
|
10
|
+
}
|
|
11
|
+
}
|