@51eat/sdk 0.0.48 → 0.0.49

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 (72) hide show
  1. package/dist/cjs/BaseClient.js +2 -2
  2. package/dist/cjs/Client.d.ts +3 -0
  3. package/dist/cjs/Client.js +13 -8
  4. package/dist/cjs/api/resources/customer/resources/cart/types/CreatePaymentIntentCartResponse.d.ts +1 -1
  5. package/dist/cjs/api/resources/customer/resources/events/resources/ticketing/client/Client.d.ts +15 -23
  6. package/dist/cjs/api/resources/customer/resources/events/resources/ticketing/client/Client.js +46 -63
  7. package/dist/cjs/api/resources/customer/resources/events/resources/ticketing/client/requests/AppHttpRequestsApiV1CustomerEventsCreatePaymentIntentRequest.d.ts +2 -3
  8. package/dist/cjs/api/resources/customer/resources/events/resources/ticketing/client/requests/StoreTicketOrderRequest.d.ts +1 -3
  9. package/dist/cjs/api/resources/customer/resources/events/resources/ticketing/types/CreatePaymentIntentTicketingResponse.d.ts +14 -8
  10. package/dist/cjs/api/resources/customer/resources/events/resources/ticketing/types/HoldTicketsTicketingResponse.d.ts +1 -1
  11. package/dist/cjs/api/resources/customerEvents/client/Client.d.ts +29 -0
  12. package/dist/cjs/api/resources/customerEvents/client/Client.js +111 -0
  13. package/dist/cjs/api/resources/customerEvents/client/index.d.ts +1 -0
  14. package/dist/cjs/api/resources/customerEvents/client/index.js +17 -0
  15. package/dist/cjs/api/resources/customerEvents/client/requests/ReleaseTicketHoldRequest.d.ts +11 -0
  16. package/dist/cjs/api/resources/customerEvents/client/requests/ReleaseTicketHoldRequest.js +3 -0
  17. package/dist/cjs/api/resources/customerEvents/client/requests/index.d.ts +1 -0
  18. package/dist/cjs/api/resources/customerEvents/client/requests/index.js +2 -0
  19. package/dist/cjs/api/resources/customerEvents/exports.d.ts +2 -0
  20. package/dist/cjs/api/resources/customerEvents/exports.js +21 -0
  21. package/dist/cjs/api/resources/customerEvents/index.d.ts +1 -0
  22. package/dist/cjs/api/resources/customerEvents/index.js +17 -0
  23. package/dist/cjs/api/resources/index.d.ts +2 -0
  24. package/dist/cjs/api/resources/index.js +3 -1
  25. package/dist/cjs/api/types/BusinessEventOrder.d.ts +2 -10
  26. package/dist/cjs/api/types/BusinessEventOrderDetail.d.ts +2 -12
  27. package/dist/cjs/api/types/BusinessProductOrder.d.ts +1 -9
  28. package/dist/cjs/api/types/CustomerProductOrder.d.ts +1 -5
  29. package/dist/cjs/api/types/TicketOrder.d.ts +1 -7
  30. package/dist/cjs/api/types/Transaction.d.ts +16 -0
  31. package/dist/cjs/api/types/Transaction.js +3 -0
  32. package/dist/cjs/api/types/index.d.ts +1 -0
  33. package/dist/cjs/api/types/index.js +1 -0
  34. package/dist/cjs/version.d.ts +1 -1
  35. package/dist/cjs/version.js +1 -1
  36. package/dist/esm/BaseClient.mjs +2 -2
  37. package/dist/esm/Client.d.mts +3 -0
  38. package/dist/esm/Client.mjs +5 -0
  39. package/dist/esm/api/resources/customer/resources/cart/types/CreatePaymentIntentCartResponse.d.mts +1 -1
  40. package/dist/esm/api/resources/customer/resources/events/resources/ticketing/client/Client.d.mts +15 -23
  41. package/dist/esm/api/resources/customer/resources/events/resources/ticketing/client/Client.mjs +46 -63
  42. package/dist/esm/api/resources/customer/resources/events/resources/ticketing/client/requests/AppHttpRequestsApiV1CustomerEventsCreatePaymentIntentRequest.d.mts +2 -3
  43. package/dist/esm/api/resources/customer/resources/events/resources/ticketing/client/requests/StoreTicketOrderRequest.d.mts +1 -3
  44. package/dist/esm/api/resources/customer/resources/events/resources/ticketing/types/CreatePaymentIntentTicketingResponse.d.mts +14 -8
  45. package/dist/esm/api/resources/customer/resources/events/resources/ticketing/types/HoldTicketsTicketingResponse.d.mts +1 -1
  46. package/dist/esm/api/resources/customerEvents/client/Client.d.mts +29 -0
  47. package/dist/esm/api/resources/customerEvents/client/Client.mjs +74 -0
  48. package/dist/esm/api/resources/customerEvents/client/index.d.mts +1 -0
  49. package/dist/esm/api/resources/customerEvents/client/index.mjs +1 -0
  50. package/dist/esm/api/resources/customerEvents/client/requests/ReleaseTicketHoldRequest.d.mts +11 -0
  51. package/dist/esm/api/resources/customerEvents/client/requests/ReleaseTicketHoldRequest.mjs +2 -0
  52. package/dist/esm/api/resources/customerEvents/client/requests/index.d.mts +1 -0
  53. package/dist/esm/api/resources/customerEvents/client/requests/index.mjs +1 -0
  54. package/dist/esm/api/resources/customerEvents/exports.d.mts +2 -0
  55. package/dist/esm/api/resources/customerEvents/exports.mjs +3 -0
  56. package/dist/esm/api/resources/customerEvents/index.d.mts +1 -0
  57. package/dist/esm/api/resources/customerEvents/index.mjs +1 -0
  58. package/dist/esm/api/resources/index.d.mts +2 -0
  59. package/dist/esm/api/resources/index.mjs +2 -0
  60. package/dist/esm/api/types/BusinessEventOrder.d.mts +2 -10
  61. package/dist/esm/api/types/BusinessEventOrderDetail.d.mts +2 -12
  62. package/dist/esm/api/types/BusinessProductOrder.d.mts +1 -9
  63. package/dist/esm/api/types/CustomerProductOrder.d.mts +1 -5
  64. package/dist/esm/api/types/TicketOrder.d.mts +1 -7
  65. package/dist/esm/api/types/Transaction.d.mts +16 -0
  66. package/dist/esm/api/types/Transaction.mjs +2 -0
  67. package/dist/esm/api/types/index.d.mts +1 -0
  68. package/dist/esm/api/types/index.mjs +1 -0
  69. package/dist/esm/version.d.mts +1 -1
  70. package/dist/esm/version.mjs +1 -1
  71. package/package.json +12 -1
  72. package/reference.md +91 -40
@@ -43,8 +43,8 @@ function normalizeClientOptions(options) {
43
43
  const headers = (0, headers_js_1.mergeHeaders)({
44
44
  "X-Fern-Language": "JavaScript",
45
45
  "X-Fern-SDK-Name": "@51eat/sdk",
46
- "X-Fern-SDK-Version": "0.0.48",
47
- "User-Agent": "@51eat/sdk/0.0.48",
46
+ "X-Fern-SDK-Version": "0.0.49",
47
+ "User-Agent": "@51eat/sdk/0.0.49",
48
48
  "X-Fern-Runtime": core.RUNTIME.type,
49
49
  "X-Fern-Runtime-Version": core.RUNTIME.version,
50
50
  }, options === null || options === void 0 ? void 0 : options.headers);
@@ -2,6 +2,7 @@ import { BusinessClient } from "./api/resources/business/client/Client.js";
2
2
  import { BusinessMessagingClient } from "./api/resources/businessMessaging/client/Client.js";
3
3
  import { BusinessProductsClient } from "./api/resources/businessProducts/client/Client.js";
4
4
  import { CustomerClient } from "./api/resources/customer/client/Client.js";
5
+ import { CustomerEventsClient } from "./api/resources/customerEvents/client/Client.js";
5
6
  import { CustomerMessagingClient } from "./api/resources/customerMessaging/client/Client.js";
6
7
  import { CustomerMyAccountClient } from "./api/resources/customerMyAccount/client/Client.js";
7
8
  import { RecordClickClient } from "./api/resources/recordClick/client/Client.js";
@@ -18,6 +19,7 @@ export declare class FiveOneEatClient {
18
19
  protected readonly _options: NormalizedClientOptionsWithAuth<FiveOneEatClient.Options>;
19
20
  protected _businessMessaging: BusinessMessagingClient | undefined;
20
21
  protected _businessProducts: BusinessProductsClient | undefined;
22
+ protected _customerEvents: CustomerEventsClient | undefined;
21
23
  protected _customerMessaging: CustomerMessagingClient | undefined;
22
24
  protected _customerMyAccount: CustomerMyAccountClient | undefined;
23
25
  protected _customer: CustomerClient | undefined;
@@ -27,6 +29,7 @@ export declare class FiveOneEatClient {
27
29
  constructor(options?: FiveOneEatClient.Options);
28
30
  get businessMessaging(): BusinessMessagingClient;
29
31
  get businessProducts(): BusinessProductsClient;
32
+ get customerEvents(): CustomerEventsClient;
30
33
  get customerMessaging(): CustomerMessagingClient;
31
34
  get customerMyAccount(): CustomerMyAccountClient;
32
35
  get customer(): CustomerClient;
@@ -48,10 +48,11 @@ const Client_js_1 = require("./api/resources/business/client/Client.js");
48
48
  const Client_js_2 = require("./api/resources/businessMessaging/client/Client.js");
49
49
  const Client_js_3 = require("./api/resources/businessProducts/client/Client.js");
50
50
  const Client_js_4 = require("./api/resources/customer/client/Client.js");
51
- const Client_js_5 = require("./api/resources/customerMessaging/client/Client.js");
52
- const Client_js_6 = require("./api/resources/customerMyAccount/client/Client.js");
53
- const Client_js_7 = require("./api/resources/recordClick/client/Client.js");
54
- const Client_js_8 = require("./api/resources/serveAd/client/Client.js");
51
+ const Client_js_5 = require("./api/resources/customerEvents/client/Client.js");
52
+ const Client_js_6 = require("./api/resources/customerMessaging/client/Client.js");
53
+ const Client_js_7 = require("./api/resources/customerMyAccount/client/Client.js");
54
+ const Client_js_8 = require("./api/resources/recordClick/client/Client.js");
55
+ const Client_js_9 = require("./api/resources/serveAd/client/Client.js");
55
56
  const BaseClient_js_1 = require("./BaseClient.js");
56
57
  const core = __importStar(require("./core/index.js"));
57
58
  class FiveOneEatClient {
@@ -66,13 +67,17 @@ class FiveOneEatClient {
66
67
  var _a;
67
68
  return ((_a = this._businessProducts) !== null && _a !== void 0 ? _a : (this._businessProducts = new Client_js_3.BusinessProductsClient(this._options)));
68
69
  }
70
+ get customerEvents() {
71
+ var _a;
72
+ return ((_a = this._customerEvents) !== null && _a !== void 0 ? _a : (this._customerEvents = new Client_js_5.CustomerEventsClient(this._options)));
73
+ }
69
74
  get customerMessaging() {
70
75
  var _a;
71
- return ((_a = this._customerMessaging) !== null && _a !== void 0 ? _a : (this._customerMessaging = new Client_js_5.CustomerMessagingClient(this._options)));
76
+ return ((_a = this._customerMessaging) !== null && _a !== void 0 ? _a : (this._customerMessaging = new Client_js_6.CustomerMessagingClient(this._options)));
72
77
  }
73
78
  get customerMyAccount() {
74
79
  var _a;
75
- return ((_a = this._customerMyAccount) !== null && _a !== void 0 ? _a : (this._customerMyAccount = new Client_js_6.CustomerMyAccountClient(this._options)));
80
+ return ((_a = this._customerMyAccount) !== null && _a !== void 0 ? _a : (this._customerMyAccount = new Client_js_7.CustomerMyAccountClient(this._options)));
76
81
  }
77
82
  get customer() {
78
83
  var _a;
@@ -80,11 +85,11 @@ class FiveOneEatClient {
80
85
  }
81
86
  get recordClick() {
82
87
  var _a;
83
- return ((_a = this._recordClick) !== null && _a !== void 0 ? _a : (this._recordClick = new Client_js_7.RecordClickClient(this._options)));
88
+ return ((_a = this._recordClick) !== null && _a !== void 0 ? _a : (this._recordClick = new Client_js_8.RecordClickClient(this._options)));
84
89
  }
85
90
  get serveAd() {
86
91
  var _a;
87
- return ((_a = this._serveAd) !== null && _a !== void 0 ? _a : (this._serveAd = new Client_js_8.ServeAdClient(this._options)));
92
+ return ((_a = this._serveAd) !== null && _a !== void 0 ? _a : (this._serveAd = new Client_js_9.ServeAdClient(this._options)));
88
93
  }
89
94
  get business() {
90
95
  var _a;
@@ -6,7 +6,7 @@ export interface CreatePaymentIntentCartResponse {
6
6
  tax_amount: string;
7
7
  tax_calculation: CreatePaymentIntentCartResponse.TaxCalculation | null;
8
8
  shipping_amount: string;
9
- shipping_method: string;
9
+ shipping_method: unknown | null;
10
10
  platform_fee: string;
11
11
  total_amount: string;
12
12
  }
@@ -31,23 +31,6 @@ export declare class TicketingClient {
31
31
  */
32
32
  holdTickets(request: FiveOneEat.customer.events.StoreTicketHoldRequest, requestOptions?: TicketingClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.customer.events.HoldTicketsTicketingResponse>;
33
33
  private __holdTickets;
34
- /**
35
- * Release all active holds for the given session, freeing the tickets for others.
36
- *
37
- * @param {FiveOneEat.customer.events.ReleaseHoldTicketingRequest} request
38
- * @param {TicketingClient.RequestOptions} requestOptions - Request-specific configuration.
39
- *
40
- * @throws {@link FiveOneEat.UnauthorizedError}
41
- * @throws {@link FiveOneEat.NotFoundError}
42
- *
43
- * @example
44
- * await client.customer.events.ticketing.releaseHold({
45
- * eventId: "eventId",
46
- * sessionId: "sessionId"
47
- * })
48
- */
49
- releaseHold(request: FiveOneEat.customer.events.ReleaseHoldTicketingRequest, requestOptions?: TicketingClient.RequestOptions): core.HttpResponsePromise<void>;
50
- private __releaseHold;
51
34
  /**
52
35
  * Preview the subtotal, platform fee, and total for a given ticket selection.
53
36
  *
@@ -70,20 +53,18 @@ export declare class TicketingClient {
70
53
  calculatePrice(request: FiveOneEat.customer.events.CalculatePriceRequest, requestOptions?: TicketingClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.customer.events.CalculatePriceTicketingResponse>;
71
54
  private __calculatePrice;
72
55
  /**
73
- * Create a Stripe payment intent for the tickets held in the given session.
56
+ * Create a Stripe payment intent for the tickets held in the cart for the given event.
74
57
  * Returns a client_secret for the mobile app to confirm payment with Stripe.
75
58
  *
76
59
  * @param {FiveOneEat.customer.events.AppHttpRequestsApiV1CustomerEventsCreatePaymentIntentRequest} request
77
60
  * @param {TicketingClient.RequestOptions} requestOptions - Request-specific configuration.
78
61
  *
79
62
  * @throws {@link FiveOneEat.UnauthorizedError}
80
- * @throws {@link FiveOneEat.NotFoundError}
81
63
  * @throws {@link FiveOneEat.UnprocessableEntityError}
82
64
  *
83
65
  * @example
84
66
  * await client.customer.events.ticketing.createPaymentIntent({
85
- * eventId: "eventId",
86
- * session_id: "session_id"
67
+ * eventId: "eventId"
87
68
  * })
88
69
  */
89
70
  createPaymentIntent(request: FiveOneEat.customer.events.AppHttpRequestsApiV1CustomerEventsCreatePaymentIntentRequest, requestOptions?: TicketingClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.customer.events.CreatePaymentIntentTicketingResponse>;
@@ -101,10 +82,21 @@ export declare class TicketingClient {
101
82
  * @example
102
83
  * await client.customer.events.ticketing.confirmOrder({
103
84
  * eventId: "eventId",
104
- * payment_intent_id: "payment_intent_id",
105
- * session_id: "session_id"
85
+ * payment_intent_id: "payment_intent_id"
106
86
  * })
107
87
  */
108
88
  confirmOrder(request: FiveOneEat.customer.events.StoreTicketOrderRequest, requestOptions?: TicketingClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.customer.events.ConfirmOrderTicketingResponse>;
109
89
  private __confirmOrder;
90
+ /**
91
+ * @param {FiveOneEat.customer.events.ReleaseHoldTicketingRequest} request
92
+ * @param {TicketingClient.RequestOptions} requestOptions - Request-specific configuration.
93
+ *
94
+ * @example
95
+ * await client.customer.events.ticketing.releaseHold({
96
+ * eventId: "eventId",
97
+ * sessionId: "sessionId"
98
+ * })
99
+ */
100
+ releaseHold(request: FiveOneEat.customer.events.ReleaseHoldTicketingRequest, requestOptions?: TicketingClient.RequestOptions): core.HttpResponsePromise<void>;
101
+ private __releaseHold;
110
102
  }
@@ -133,61 +133,6 @@ class TicketingClient {
133
133
  return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/customer/events/{eventId}/ticket-holds");
134
134
  });
135
135
  }
136
- /**
137
- * Release all active holds for the given session, freeing the tickets for others.
138
- *
139
- * @param {FiveOneEat.customer.events.ReleaseHoldTicketingRequest} request
140
- * @param {TicketingClient.RequestOptions} requestOptions - Request-specific configuration.
141
- *
142
- * @throws {@link FiveOneEat.UnauthorizedError}
143
- * @throws {@link FiveOneEat.NotFoundError}
144
- *
145
- * @example
146
- * await client.customer.events.ticketing.releaseHold({
147
- * eventId: "eventId",
148
- * sessionId: "sessionId"
149
- * })
150
- */
151
- releaseHold(request, requestOptions) {
152
- return core.HttpResponsePromise.fromPromise(this.__releaseHold(request, requestOptions));
153
- }
154
- __releaseHold(request, requestOptions) {
155
- return __awaiter(this, void 0, void 0, function* () {
156
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
157
- const { eventId, sessionId } = request;
158
- const _authRequest = yield this._options.authProvider.getAuthRequest();
159
- const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
160
- const _response = yield core.fetcher({
161
- 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)}`),
162
- method: "DELETE",
163
- headers: _headers,
164
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
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,
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,
167
- abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
168
- fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
169
- logging: this._options.logging,
170
- });
171
- if (_response.ok) {
172
- return { data: undefined, rawResponse: _response.rawResponse };
173
- }
174
- if (_response.error.reason === "status-code") {
175
- switch (_response.error.statusCode) {
176
- case 401:
177
- throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
178
- case 404:
179
- throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
180
- default:
181
- throw new errors.FiveOneEatError({
182
- statusCode: _response.error.statusCode,
183
- body: _response.error.body,
184
- rawResponse: _response.rawResponse,
185
- });
186
- }
187
- }
188
- return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "DELETE", "/customer/events/{eventId}/ticket-holds/{sessionId}");
189
- });
190
- }
191
136
  /**
192
137
  * Preview the subtotal, platform fee, and total for a given ticket selection.
193
138
  *
@@ -256,20 +201,18 @@ class TicketingClient {
256
201
  });
257
202
  }
258
203
  /**
259
- * Create a Stripe payment intent for the tickets held in the given session.
204
+ * Create a Stripe payment intent for the tickets held in the cart for the given event.
260
205
  * Returns a client_secret for the mobile app to confirm payment with Stripe.
261
206
  *
262
207
  * @param {FiveOneEat.customer.events.AppHttpRequestsApiV1CustomerEventsCreatePaymentIntentRequest} request
263
208
  * @param {TicketingClient.RequestOptions} requestOptions - Request-specific configuration.
264
209
  *
265
210
  * @throws {@link FiveOneEat.UnauthorizedError}
266
- * @throws {@link FiveOneEat.NotFoundError}
267
211
  * @throws {@link FiveOneEat.UnprocessableEntityError}
268
212
  *
269
213
  * @example
270
214
  * await client.customer.events.ticketing.createPaymentIntent({
271
- * eventId: "eventId",
272
- * session_id: "session_id"
215
+ * eventId: "eventId"
273
216
  * })
274
217
  */
275
218
  createPaymentIntent(request, requestOptions) {
@@ -305,8 +248,6 @@ class TicketingClient {
305
248
  switch (_response.error.statusCode) {
306
249
  case 401:
307
250
  throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
308
- case 404:
309
- throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
310
251
  case 422:
311
252
  throw new FiveOneEat.UnprocessableEntityError(_response.error.body, _response.rawResponse);
312
253
  default:
@@ -333,8 +274,7 @@ class TicketingClient {
333
274
  * @example
334
275
  * await client.customer.events.ticketing.confirmOrder({
335
276
  * eventId: "eventId",
336
- * payment_intent_id: "payment_intent_id",
337
- * session_id: "session_id"
277
+ * payment_intent_id: "payment_intent_id"
338
278
  * })
339
279
  */
340
280
  confirmOrder(request, requestOptions) {
@@ -383,5 +323,48 @@ class TicketingClient {
383
323
  return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/customer/events/{eventId}/ticket-orders");
384
324
  });
385
325
  }
326
+ /**
327
+ * @param {FiveOneEat.customer.events.ReleaseHoldTicketingRequest} request
328
+ * @param {TicketingClient.RequestOptions} requestOptions - Request-specific configuration.
329
+ *
330
+ * @example
331
+ * await client.customer.events.ticketing.releaseHold({
332
+ * eventId: "eventId",
333
+ * sessionId: "sessionId"
334
+ * })
335
+ */
336
+ releaseHold(request, requestOptions) {
337
+ return core.HttpResponsePromise.fromPromise(this.__releaseHold(request, requestOptions));
338
+ }
339
+ __releaseHold(request, requestOptions) {
340
+ return __awaiter(this, void 0, void 0, function* () {
341
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
342
+ const { eventId, sessionId } = request;
343
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
344
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
345
+ const _response = yield core.fetcher({
346
+ 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)}`),
347
+ method: "DELETE",
348
+ headers: _headers,
349
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
350
+ 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,
351
+ 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,
352
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
353
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
354
+ logging: this._options.logging,
355
+ });
356
+ if (_response.ok) {
357
+ return { data: undefined, rawResponse: _response.rawResponse };
358
+ }
359
+ if (_response.error.reason === "status-code") {
360
+ throw new errors.FiveOneEatError({
361
+ statusCode: _response.error.statusCode,
362
+ body: _response.error.body,
363
+ rawResponse: _response.rawResponse,
364
+ });
365
+ }
366
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "DELETE", "/customer/events/{eventId}/ticket-holds/{sessionId}");
367
+ });
368
+ }
386
369
  }
387
370
  exports.TicketingClient = TicketingClient;
@@ -1,11 +1,10 @@
1
1
  /**
2
2
  * @example
3
3
  * {
4
- * eventId: "eventId",
5
- * session_id: "session_id"
4
+ * eventId: "eventId"
6
5
  * }
7
6
  */
8
7
  export interface AppHttpRequestsApiV1CustomerEventsCreatePaymentIntentRequest {
9
8
  eventId: string;
10
- session_id: string;
9
+ payment_method_id?: string | null;
11
10
  }
@@ -2,12 +2,10 @@
2
2
  * @example
3
3
  * {
4
4
  * eventId: "eventId",
5
- * payment_intent_id: "payment_intent_id",
6
- * session_id: "session_id"
5
+ * payment_intent_id: "payment_intent_id"
7
6
  * }
8
7
  */
9
8
  export interface StoreTicketOrderRequest {
10
9
  eventId: string;
11
10
  payment_intent_id: string;
12
- session_id: string;
13
11
  }
@@ -1,13 +1,19 @@
1
1
  export interface CreatePaymentIntentTicketingResponse {
2
- data: CreatePaymentIntentTicketingResponse.Data;
2
+ status: string;
3
+ client_secret: string;
4
+ payment_intent_id: string;
5
+ subtotal: string;
6
+ tax_amount: string;
7
+ tax_calculation: CreatePaymentIntentTicketingResponse.TaxCalculation | null;
8
+ shipping_amount: string;
9
+ shipping_method: unknown | null;
10
+ platform_fee: string;
11
+ total_amount: string;
3
12
  }
4
13
  export declare namespace CreatePaymentIntentTicketingResponse {
5
- interface Data {
6
- payment_intent_id: string;
7
- client_secret: string;
8
- session_id: string;
9
- subtotal: string;
10
- platform_fee: string;
11
- total_amount: string;
14
+ interface TaxCalculation {
15
+ id: string;
16
+ amount_total: string;
17
+ tax_amount_exclusive: string;
12
18
  }
13
19
  }
@@ -3,7 +3,7 @@ export interface HoldTicketsTicketingResponse {
3
3
  }
4
4
  export declare namespace HoldTicketsTicketingResponse {
5
5
  interface Data {
6
- session_id: string | null;
6
+ ticket_cart_id: string;
7
7
  expires_at: string;
8
8
  time_remaining_seconds: string;
9
9
  holds: string;
@@ -0,0 +1,29 @@
1
+ import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js";
2
+ import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.js";
3
+ import * as core from "../../../../core/index.js";
4
+ import * as FiveOneEat from "../../../index.js";
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
+ * Release the TicketCart holds for the authenticated user and event.
15
+ *
16
+ * @param {FiveOneEat.ReleaseTicketHoldRequest} request
17
+ * @param {CustomerEventsClient.RequestOptions} requestOptions - Request-specific configuration.
18
+ *
19
+ * @throws {@link FiveOneEat.UnauthorizedError}
20
+ *
21
+ * @example
22
+ * await client.customerEvents.releaseTicketHold({
23
+ * eventId: "eventId",
24
+ * cartId: "cartId"
25
+ * })
26
+ */
27
+ releaseTicketHold(request: FiveOneEat.ReleaseTicketHoldRequest, requestOptions?: CustomerEventsClient.RequestOptions): core.HttpResponsePromise<void>;
28
+ private __releaseTicketHold;
29
+ }
@@ -0,0 +1,111 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
+ if (k2 === undefined) k2 = k;
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
+ desc = { enumerable: true, get: function() { return m[k]; } };
8
+ }
9
+ Object.defineProperty(o, k2, desc);
10
+ }) : (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ o[k2] = m[k];
13
+ }));
14
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
15
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
16
+ }) : function(o, v) {
17
+ o["default"] = v;
18
+ });
19
+ var __importStar = (this && this.__importStar) || (function () {
20
+ var ownKeys = function(o) {
21
+ ownKeys = Object.getOwnPropertyNames || function (o) {
22
+ var ar = [];
23
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
24
+ return ar;
25
+ };
26
+ return ownKeys(o);
27
+ };
28
+ return function (mod) {
29
+ if (mod && mod.__esModule) return mod;
30
+ var result = {};
31
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
32
+ __setModuleDefault(result, mod);
33
+ return result;
34
+ };
35
+ })();
36
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
37
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
38
+ return new (P || (P = Promise))(function (resolve, reject) {
39
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
40
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
41
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
42
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
43
+ });
44
+ };
45
+ Object.defineProperty(exports, "__esModule", { value: true });
46
+ exports.CustomerEventsClient = void 0;
47
+ const BaseClient_js_1 = require("../../../../BaseClient.js");
48
+ const headers_js_1 = require("../../../../core/headers.js");
49
+ const core = __importStar(require("../../../../core/index.js"));
50
+ const environments = __importStar(require("../../../../environments.js"));
51
+ const handleNonStatusCodeError_js_1 = require("../../../../errors/handleNonStatusCodeError.js");
52
+ const errors = __importStar(require("../../../../errors/index.js"));
53
+ const FiveOneEat = __importStar(require("../../../index.js"));
54
+ class CustomerEventsClient {
55
+ constructor(options = {}) {
56
+ this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
57
+ }
58
+ /**
59
+ * Release the TicketCart holds for the authenticated user and event.
60
+ *
61
+ * @param {FiveOneEat.ReleaseTicketHoldRequest} request
62
+ * @param {CustomerEventsClient.RequestOptions} requestOptions - Request-specific configuration.
63
+ *
64
+ * @throws {@link FiveOneEat.UnauthorizedError}
65
+ *
66
+ * @example
67
+ * await client.customerEvents.releaseTicketHold({
68
+ * eventId: "eventId",
69
+ * cartId: "cartId"
70
+ * })
71
+ */
72
+ releaseTicketHold(request, requestOptions) {
73
+ return core.HttpResponsePromise.fromPromise(this.__releaseTicketHold(request, requestOptions));
74
+ }
75
+ __releaseTicketHold(request, requestOptions) {
76
+ return __awaiter(this, void 0, void 0, function* () {
77
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
78
+ const { eventId, cartId } = request;
79
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
80
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
81
+ const _response = yield core.fetcher({
82
+ 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(cartId)}`),
83
+ method: "DELETE",
84
+ headers: _headers,
85
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
86
+ 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,
87
+ 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,
88
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
89
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
90
+ logging: this._options.logging,
91
+ });
92
+ if (_response.ok) {
93
+ return { data: undefined, rawResponse: _response.rawResponse };
94
+ }
95
+ if (_response.error.reason === "status-code") {
96
+ switch (_response.error.statusCode) {
97
+ case 401:
98
+ throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
99
+ default:
100
+ throw new errors.FiveOneEatError({
101
+ statusCode: _response.error.statusCode,
102
+ body: _response.error.body,
103
+ rawResponse: _response.rawResponse,
104
+ });
105
+ }
106
+ }
107
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "DELETE", "/customer/events/{eventId}/ticket-holds/{cartId}");
108
+ });
109
+ }
110
+ }
111
+ exports.CustomerEventsClient = CustomerEventsClient;
@@ -0,0 +1 @@
1
+ export * from "./requests/index.js";
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./requests/index.js"), exports);
@@ -0,0 +1,11 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * eventId: "eventId",
5
+ * cartId: "cartId"
6
+ * }
7
+ */
8
+ export interface ReleaseTicketHoldRequest {
9
+ eventId: string;
10
+ cartId: string;
11
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1 @@
1
+ export type { ReleaseTicketHoldRequest } from "./ReleaseTicketHoldRequest.js";
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ export { CustomerEventsClient } from "./client/Client.js";
2
+ export * from "./client/index.js";
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
+ if (k2 === undefined) k2 = k;
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
+ desc = { enumerable: true, get: function() { return m[k]; } };
8
+ }
9
+ Object.defineProperty(o, k2, desc);
10
+ }) : (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ o[k2] = m[k];
13
+ }));
14
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
16
+ };
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.CustomerEventsClient = void 0;
19
+ var Client_js_1 = require("./client/Client.js");
20
+ Object.defineProperty(exports, "CustomerEventsClient", { enumerable: true, get: function () { return Client_js_1.CustomerEventsClient; } });
21
+ __exportStar(require("./client/index.js"), exports);
@@ -0,0 +1 @@
1
+ export * from "./client/index.js";
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./client/index.js"), exports);
@@ -8,6 +8,8 @@ export * from "./businessProducts/types/index.js";
8
8
  export * from "./customer/client/requests/index.js";
9
9
  export * as customer from "./customer/index.js";
10
10
  export * from "./customer/types/index.js";
11
+ export * from "./customerEvents/client/requests/index.js";
12
+ export * as customerEvents from "./customerEvents/index.js";
11
13
  export * from "./customerMessaging/client/requests/index.js";
12
14
  export * as customerMessaging from "./customerMessaging/index.js";
13
15
  export * from "./customerMessaging/types/index.js";