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