@51eat/sdk 0.0.35 → 0.0.36

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 (74) hide show
  1. package/dist/cjs/BaseClient.js +2 -2
  2. package/dist/cjs/api/resources/business/resources/events/resources/checkIn/client/Client.d.ts +43 -9
  3. package/dist/cjs/api/resources/business/resources/events/resources/checkIn/client/Client.js +134 -30
  4. package/dist/cjs/api/resources/business/resources/events/resources/checkIn/client/requests/LookupTicketRequest.d.ts +12 -0
  5. package/dist/cjs/api/resources/business/resources/events/resources/checkIn/client/requests/RecentCheckInRequest.d.ts +1 -0
  6. package/dist/cjs/api/resources/business/resources/events/resources/checkIn/client/requests/ScanTicketRequest.d.ts +13 -0
  7. package/dist/cjs/api/resources/business/resources/events/resources/checkIn/client/requests/StatsCheckInRequest.d.ts +1 -0
  8. package/dist/cjs/api/resources/business/resources/events/resources/checkIn/client/requests/index.d.ts +2 -2
  9. package/dist/cjs/api/resources/business/resources/events/resources/checkIn/index.d.ts +1 -0
  10. package/dist/cjs/api/resources/business/resources/events/resources/checkIn/index.js +1 -0
  11. package/dist/cjs/api/resources/business/resources/events/resources/checkIn/types/LookupCheckInResponse.d.ts +4 -0
  12. package/dist/cjs/api/resources/business/resources/events/resources/checkIn/types/LookupCheckInResponse.js +3 -0
  13. package/dist/cjs/api/resources/business/resources/events/resources/checkIn/types/RecentCheckInResponse.d.ts +4 -0
  14. package/dist/cjs/api/resources/business/resources/events/resources/checkIn/types/RecentCheckInResponse.js +3 -0
  15. package/dist/cjs/api/resources/business/resources/events/resources/checkIn/types/ScanCheckInResponse.d.ts +4 -0
  16. package/dist/cjs/api/resources/business/resources/events/resources/checkIn/types/ScanCheckInResponse.js +3 -0
  17. package/dist/cjs/api/resources/business/resources/events/resources/checkIn/types/StatsCheckInResponse.d.ts +4 -0
  18. package/dist/cjs/api/resources/business/resources/events/resources/checkIn/types/StatsCheckInResponse.js +3 -0
  19. package/dist/cjs/api/resources/business/resources/events/resources/checkIn/types/index.d.ts +4 -0
  20. package/dist/cjs/api/resources/business/resources/events/resources/checkIn/types/index.js +20 -0
  21. package/dist/cjs/api/resources/business/resources/events/resources/index.d.ts +1 -0
  22. package/dist/cjs/api/resources/business/resources/events/resources/index.js +1 -0
  23. package/dist/cjs/api/types/BusinessEventCheckIn.d.ts +18 -0
  24. package/dist/cjs/api/types/BusinessEventCheckIn.js +3 -0
  25. package/dist/cjs/api/types/BusinessEventCheckInStats.d.ts +1 -0
  26. package/dist/cjs/api/types/BusinessEventCheckInStats.js +3 -0
  27. package/dist/cjs/api/types/BusinessEventCheckInTicket.d.ts +20 -0
  28. package/dist/cjs/api/types/BusinessEventCheckInTicket.js +3 -0
  29. package/dist/cjs/api/types/index.d.ts +3 -0
  30. package/dist/cjs/api/types/index.js +3 -0
  31. package/dist/cjs/version.d.ts +1 -1
  32. package/dist/cjs/version.js +1 -1
  33. package/dist/esm/BaseClient.mjs +2 -2
  34. package/dist/esm/api/resources/business/resources/events/resources/checkIn/client/Client.d.mts +43 -9
  35. package/dist/esm/api/resources/business/resources/events/resources/checkIn/client/Client.mjs +134 -30
  36. package/dist/esm/api/resources/business/resources/events/resources/checkIn/client/requests/LookupTicketRequest.d.mts +12 -0
  37. package/dist/esm/api/resources/business/resources/events/resources/checkIn/client/requests/RecentCheckInRequest.d.mts +1 -0
  38. package/dist/esm/api/resources/business/resources/events/resources/checkIn/client/requests/ScanTicketRequest.d.mts +13 -0
  39. package/dist/esm/api/resources/business/resources/events/resources/checkIn/client/requests/StatsCheckInRequest.d.mts +1 -0
  40. package/dist/esm/api/resources/business/resources/events/resources/checkIn/client/requests/index.d.mts +2 -2
  41. package/dist/esm/api/resources/business/resources/events/resources/checkIn/index.d.mts +1 -0
  42. package/dist/esm/api/resources/business/resources/events/resources/checkIn/index.mjs +1 -0
  43. package/dist/esm/api/resources/business/resources/events/resources/checkIn/types/LookupCheckInResponse.d.mts +4 -0
  44. package/dist/esm/api/resources/business/resources/events/resources/checkIn/types/LookupCheckInResponse.mjs +2 -0
  45. package/dist/esm/api/resources/business/resources/events/resources/checkIn/types/RecentCheckInResponse.d.mts +4 -0
  46. package/dist/esm/api/resources/business/resources/events/resources/checkIn/types/RecentCheckInResponse.mjs +2 -0
  47. package/dist/esm/api/resources/business/resources/events/resources/checkIn/types/ScanCheckInResponse.d.mts +4 -0
  48. package/dist/esm/api/resources/business/resources/events/resources/checkIn/types/ScanCheckInResponse.mjs +2 -0
  49. package/dist/esm/api/resources/business/resources/events/resources/checkIn/types/StatsCheckInResponse.d.mts +4 -0
  50. package/dist/esm/api/resources/business/resources/events/resources/checkIn/types/StatsCheckInResponse.mjs +2 -0
  51. package/dist/esm/api/resources/business/resources/events/resources/checkIn/types/index.d.mts +4 -0
  52. package/dist/esm/api/resources/business/resources/events/resources/checkIn/types/index.mjs +4 -0
  53. package/dist/esm/api/resources/business/resources/events/resources/index.d.mts +1 -0
  54. package/dist/esm/api/resources/business/resources/events/resources/index.mjs +1 -0
  55. package/dist/esm/api/types/BusinessEventCheckIn.d.mts +18 -0
  56. package/dist/esm/api/types/BusinessEventCheckIn.mjs +2 -0
  57. package/dist/esm/api/types/BusinessEventCheckInStats.d.mts +1 -0
  58. package/dist/esm/api/types/BusinessEventCheckInStats.mjs +2 -0
  59. package/dist/esm/api/types/BusinessEventCheckInTicket.d.mts +20 -0
  60. package/dist/esm/api/types/BusinessEventCheckInTicket.mjs +2 -0
  61. package/dist/esm/api/types/index.d.mts +3 -0
  62. package/dist/esm/api/types/index.mjs +3 -0
  63. package/dist/esm/version.d.mts +1 -1
  64. package/dist/esm/version.mjs +1 -1
  65. package/package.json +1 -1
  66. package/reference.md +72 -8
  67. package/dist/cjs/api/resources/business/resources/events/resources/checkIn/client/requests/LookupCheckInRequest.d.ts +0 -9
  68. package/dist/cjs/api/resources/business/resources/events/resources/checkIn/client/requests/ScanCheckInRequest.d.ts +0 -9
  69. package/dist/esm/api/resources/business/resources/events/resources/checkIn/client/requests/LookupCheckInRequest.d.mts +0 -9
  70. package/dist/esm/api/resources/business/resources/events/resources/checkIn/client/requests/ScanCheckInRequest.d.mts +0 -9
  71. /package/dist/cjs/api/resources/business/resources/events/resources/checkIn/client/requests/{LookupCheckInRequest.js → LookupTicketRequest.js} +0 -0
  72. /package/dist/cjs/api/resources/business/resources/events/resources/checkIn/client/requests/{ScanCheckInRequest.js → ScanTicketRequest.js} +0 -0
  73. /package/dist/esm/api/resources/business/resources/events/resources/checkIn/client/requests/{LookupCheckInRequest.mjs → LookupTicketRequest.mjs} +0 -0
  74. /package/dist/esm/api/resources/business/resources/events/resources/checkIn/client/requests/{ScanCheckInRequest.mjs → ScanTicketRequest.mjs} +0 -0
@@ -43,8 +43,8 @@ function normalizeClientOptions(options) {
43
43
  const headers = (0, headers_js_1.mergeHeaders)({
44
44
  "X-Fern-Language": "JavaScript",
45
45
  "X-Fern-SDK-Name": "@51eat/sdk",
46
- "X-Fern-SDK-Version": "0.0.35",
47
- "User-Agent": "@51eat/sdk/0.0.35",
46
+ "X-Fern-SDK-Version": "0.0.36",
47
+ "User-Agent": "@51eat/sdk/0.0.36",
48
48
  "X-Fern-Runtime": core.RUNTIME.type,
49
49
  "X-Fern-Runtime-Version": core.RUNTIME.version,
50
50
  }, options === null || options === void 0 ? void 0 : options.headers);
@@ -1,7 +1,7 @@
1
1
  import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../../../BaseClient.js";
2
2
  import { type NormalizedClientOptionsWithAuth } from "../../../../../../../../BaseClient.js";
3
3
  import * as core from "../../../../../../../../core/index.js";
4
- import type * as FiveOneEat from "../../../../../../../index.js";
4
+ import * as FiveOneEat from "../../../../../../../index.js";
5
5
  export declare namespace CheckInClient {
6
6
  type Options = BaseClientOptions;
7
7
  interface RequestOptions extends BaseRequestOptions {
@@ -11,47 +11,81 @@ export declare class CheckInClient {
11
11
  protected readonly _options: NormalizedClientOptionsWithAuth<CheckInClient.Options>;
12
12
  constructor(options?: CheckInClient.Options);
13
13
  /**
14
- * @param {FiveOneEat.business.events.LookupCheckInRequest} request
14
+ * Decodes the base64 QR payload and returns ticket details without performing check-in.
15
+ * Accepts either a `ticket_id` or `ticket_number` inside the QR payload.
16
+ *
17
+ * @param {FiveOneEat.business.events.LookupTicketRequest} request
15
18
  * @param {CheckInClient.RequestOptions} requestOptions - Request-specific configuration.
16
19
  *
20
+ * @throws {@link FiveOneEat.UnauthorizedError}
21
+ * @throws {@link FiveOneEat.ForbiddenError}
22
+ * @throws {@link FiveOneEat.NotFoundError}
23
+ * @throws {@link FiveOneEat.UnprocessableEntityError}
24
+ *
17
25
  * @example
18
26
  * await client.business.events.checkIn.lookup({
19
- * event: "event"
27
+ * event: "event",
28
+ * qr_data: "qr_data"
20
29
  * })
21
30
  */
22
- lookup(request: FiveOneEat.business.events.LookupCheckInRequest, requestOptions?: CheckInClient.RequestOptions): core.HttpResponsePromise<void>;
31
+ lookup(request: FiveOneEat.business.events.LookupTicketRequest, requestOptions?: CheckInClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.business.events.LookupCheckInResponse>;
23
32
  private __lookup;
24
33
  /**
25
- * @param {FiveOneEat.business.events.ScanCheckInRequest} request
34
+ * Decodes the base64 QR payload, validates the ticket's current status, marks it as used,
35
+ * and broadcasts the `ticket.checked-in` event via Reverb.
36
+ *
37
+ * Returns `409` if the ticket has already been checked in, `400` for refunded or otherwise
38
+ * invalid tickets.
39
+ *
40
+ * @param {FiveOneEat.business.events.ScanTicketRequest} request
26
41
  * @param {CheckInClient.RequestOptions} requestOptions - Request-specific configuration.
27
42
  *
43
+ * @throws {@link FiveOneEat.UnauthorizedError}
44
+ * @throws {@link FiveOneEat.ForbiddenError}
45
+ * @throws {@link FiveOneEat.NotFoundError}
46
+ * @throws {@link FiveOneEat.UnprocessableEntityError}
47
+ *
28
48
  * @example
29
49
  * await client.business.events.checkIn.scan({
30
- * event: "event"
50
+ * event: "event",
51
+ * qr_data: "qr_data"
31
52
  * })
32
53
  */
33
- scan(request: FiveOneEat.business.events.ScanCheckInRequest, requestOptions?: CheckInClient.RequestOptions): core.HttpResponsePromise<void>;
54
+ scan(request: FiveOneEat.business.events.ScanTicketRequest, requestOptions?: CheckInClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.business.events.ScanCheckInResponse>;
34
55
  private __scan;
35
56
  /**
57
+ * Returns ticket counts and check-in rate for the event dashboard.
58
+ *
36
59
  * @param {FiveOneEat.business.events.StatsCheckInRequest} request
37
60
  * @param {CheckInClient.RequestOptions} requestOptions - Request-specific configuration.
38
61
  *
62
+ * @throws {@link FiveOneEat.UnauthorizedError}
63
+ * @throws {@link FiveOneEat.ForbiddenError}
64
+ * @throws {@link FiveOneEat.NotFoundError}
65
+ *
39
66
  * @example
40
67
  * await client.business.events.checkIn.stats({
41
68
  * event: "event"
42
69
  * })
43
70
  */
44
- stats(request: FiveOneEat.business.events.StatsCheckInRequest, requestOptions?: CheckInClient.RequestOptions): core.HttpResponsePromise<void>;
71
+ stats(request: FiveOneEat.business.events.StatsCheckInRequest, requestOptions?: CheckInClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.business.events.StatsCheckInResponse>;
45
72
  private __stats;
46
73
  /**
74
+ * Returns checked-in tickets ordered by check-in time descending.
75
+ * Accepts an optional `limit` query param (default `20`, max `100`).
76
+ *
47
77
  * @param {FiveOneEat.business.events.RecentCheckInRequest} request
48
78
  * @param {CheckInClient.RequestOptions} requestOptions - Request-specific configuration.
49
79
  *
80
+ * @throws {@link FiveOneEat.UnauthorizedError}
81
+ * @throws {@link FiveOneEat.ForbiddenError}
82
+ * @throws {@link FiveOneEat.NotFoundError}
83
+ *
50
84
  * @example
51
85
  * await client.business.events.checkIn.recent({
52
86
  * event: "event"
53
87
  * })
54
88
  */
55
- recent(request: FiveOneEat.business.events.RecentCheckInRequest, requestOptions?: CheckInClient.RequestOptions): core.HttpResponsePromise<void>;
89
+ recent(request: FiveOneEat.business.events.RecentCheckInRequest, requestOptions?: CheckInClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.business.events.RecentCheckInResponse>;
56
90
  private __recent;
57
91
  }
@@ -42,6 +42,17 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
42
42
  step((generator = generator.apply(thisArg, _arguments || [])).next());
43
43
  });
44
44
  };
45
+ var __rest = (this && this.__rest) || function (s, e) {
46
+ var t = {};
47
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
48
+ t[p] = s[p];
49
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
50
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
51
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
52
+ t[p[i]] = s[p[i]];
53
+ }
54
+ return t;
55
+ };
45
56
  Object.defineProperty(exports, "__esModule", { value: true });
46
57
  exports.CheckInClient = void 0;
47
58
  const BaseClient_js_1 = require("../../../../../../../../BaseClient.js");
@@ -50,17 +61,27 @@ const core = __importStar(require("../../../../../../../../core/index.js"));
50
61
  const environments = __importStar(require("../../../../../../../../environments.js"));
51
62
  const handleNonStatusCodeError_js_1 = require("../../../../../../../../errors/handleNonStatusCodeError.js");
52
63
  const errors = __importStar(require("../../../../../../../../errors/index.js"));
64
+ const FiveOneEat = __importStar(require("../../../../../../../index.js"));
53
65
  class CheckInClient {
54
66
  constructor(options = {}) {
55
67
  this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
56
68
  }
57
69
  /**
58
- * @param {FiveOneEat.business.events.LookupCheckInRequest} request
70
+ * Decodes the base64 QR payload and returns ticket details without performing check-in.
71
+ * Accepts either a `ticket_id` or `ticket_number` inside the QR payload.
72
+ *
73
+ * @param {FiveOneEat.business.events.LookupTicketRequest} request
59
74
  * @param {CheckInClient.RequestOptions} requestOptions - Request-specific configuration.
60
75
  *
76
+ * @throws {@link FiveOneEat.UnauthorizedError}
77
+ * @throws {@link FiveOneEat.ForbiddenError}
78
+ * @throws {@link FiveOneEat.NotFoundError}
79
+ * @throws {@link FiveOneEat.UnprocessableEntityError}
80
+ *
61
81
  * @example
62
82
  * await client.business.events.checkIn.lookup({
63
- * event: "event"
83
+ * event: "event",
84
+ * qr_data: "qr_data"
64
85
  * })
65
86
  */
66
87
  lookup(request, requestOptions) {
@@ -69,14 +90,17 @@ class CheckInClient {
69
90
  __lookup(request, requestOptions) {
70
91
  return __awaiter(this, void 0, void 0, function* () {
71
92
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
72
- const { event } = request;
93
+ const { event } = request, _body = __rest(request, ["event"]);
73
94
  const _authRequest = yield this._options.authProvider.getAuthRequest();
74
95
  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);
75
96
  const _response = yield core.fetcher({
76
97
  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, `business/events/${core.url.encodePathParam(event)}/check-in/lookup`),
77
98
  method: "POST",
78
99
  headers: _headers,
100
+ contentType: "application/json",
79
101
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
102
+ requestType: "json",
103
+ body: _body,
80
104
  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,
81
105
  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,
82
106
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -84,25 +108,51 @@ class CheckInClient {
84
108
  logging: this._options.logging,
85
109
  });
86
110
  if (_response.ok) {
87
- return { data: undefined, rawResponse: _response.rawResponse };
111
+ return {
112
+ data: _response.body,
113
+ rawResponse: _response.rawResponse,
114
+ };
88
115
  }
89
116
  if (_response.error.reason === "status-code") {
90
- throw new errors.FiveOneEatError({
91
- statusCode: _response.error.statusCode,
92
- body: _response.error.body,
93
- rawResponse: _response.rawResponse,
94
- });
117
+ switch (_response.error.statusCode) {
118
+ case 401:
119
+ throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
120
+ case 403:
121
+ throw new FiveOneEat.ForbiddenError(_response.error.body, _response.rawResponse);
122
+ case 404:
123
+ throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
124
+ case 422:
125
+ throw new FiveOneEat.UnprocessableEntityError(_response.error.body, _response.rawResponse);
126
+ default:
127
+ throw new errors.FiveOneEatError({
128
+ statusCode: _response.error.statusCode,
129
+ body: _response.error.body,
130
+ rawResponse: _response.rawResponse,
131
+ });
132
+ }
95
133
  }
96
134
  return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/business/events/{event}/check-in/lookup");
97
135
  });
98
136
  }
99
137
  /**
100
- * @param {FiveOneEat.business.events.ScanCheckInRequest} request
138
+ * Decodes the base64 QR payload, validates the ticket's current status, marks it as used,
139
+ * and broadcasts the `ticket.checked-in` event via Reverb.
140
+ *
141
+ * Returns `409` if the ticket has already been checked in, `400` for refunded or otherwise
142
+ * invalid tickets.
143
+ *
144
+ * @param {FiveOneEat.business.events.ScanTicketRequest} request
101
145
  * @param {CheckInClient.RequestOptions} requestOptions - Request-specific configuration.
102
146
  *
147
+ * @throws {@link FiveOneEat.UnauthorizedError}
148
+ * @throws {@link FiveOneEat.ForbiddenError}
149
+ * @throws {@link FiveOneEat.NotFoundError}
150
+ * @throws {@link FiveOneEat.UnprocessableEntityError}
151
+ *
103
152
  * @example
104
153
  * await client.business.events.checkIn.scan({
105
- * event: "event"
154
+ * event: "event",
155
+ * qr_data: "qr_data"
106
156
  * })
107
157
  */
108
158
  scan(request, requestOptions) {
@@ -111,14 +161,17 @@ class CheckInClient {
111
161
  __scan(request, requestOptions) {
112
162
  return __awaiter(this, void 0, void 0, function* () {
113
163
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
114
- const { event } = request;
164
+ const { event } = request, _body = __rest(request, ["event"]);
115
165
  const _authRequest = yield this._options.authProvider.getAuthRequest();
116
166
  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);
117
167
  const _response = yield core.fetcher({
118
168
  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, `business/events/${core.url.encodePathParam(event)}/check-in/scan`),
119
169
  method: "POST",
120
170
  headers: _headers,
171
+ contentType: "application/json",
121
172
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
173
+ requestType: "json",
174
+ body: _body,
122
175
  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,
123
176
  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,
124
177
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -126,22 +179,42 @@ class CheckInClient {
126
179
  logging: this._options.logging,
127
180
  });
128
181
  if (_response.ok) {
129
- return { data: undefined, rawResponse: _response.rawResponse };
182
+ return {
183
+ data: _response.body,
184
+ rawResponse: _response.rawResponse,
185
+ };
130
186
  }
131
187
  if (_response.error.reason === "status-code") {
132
- throw new errors.FiveOneEatError({
133
- statusCode: _response.error.statusCode,
134
- body: _response.error.body,
135
- rawResponse: _response.rawResponse,
136
- });
188
+ switch (_response.error.statusCode) {
189
+ case 401:
190
+ throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
191
+ case 403:
192
+ throw new FiveOneEat.ForbiddenError(_response.error.body, _response.rawResponse);
193
+ case 404:
194
+ throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
195
+ case 422:
196
+ throw new FiveOneEat.UnprocessableEntityError(_response.error.body, _response.rawResponse);
197
+ default:
198
+ throw new errors.FiveOneEatError({
199
+ statusCode: _response.error.statusCode,
200
+ body: _response.error.body,
201
+ rawResponse: _response.rawResponse,
202
+ });
203
+ }
137
204
  }
138
205
  return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/business/events/{event}/check-in/scan");
139
206
  });
140
207
  }
141
208
  /**
209
+ * Returns ticket counts and check-in rate for the event dashboard.
210
+ *
142
211
  * @param {FiveOneEat.business.events.StatsCheckInRequest} request
143
212
  * @param {CheckInClient.RequestOptions} requestOptions - Request-specific configuration.
144
213
  *
214
+ * @throws {@link FiveOneEat.UnauthorizedError}
215
+ * @throws {@link FiveOneEat.ForbiddenError}
216
+ * @throws {@link FiveOneEat.NotFoundError}
217
+ *
145
218
  * @example
146
219
  * await client.business.events.checkIn.stats({
147
220
  * event: "event"
@@ -168,22 +241,41 @@ class CheckInClient {
168
241
  logging: this._options.logging,
169
242
  });
170
243
  if (_response.ok) {
171
- return { data: undefined, rawResponse: _response.rawResponse };
244
+ return {
245
+ data: _response.body,
246
+ rawResponse: _response.rawResponse,
247
+ };
172
248
  }
173
249
  if (_response.error.reason === "status-code") {
174
- throw new errors.FiveOneEatError({
175
- statusCode: _response.error.statusCode,
176
- body: _response.error.body,
177
- rawResponse: _response.rawResponse,
178
- });
250
+ switch (_response.error.statusCode) {
251
+ case 401:
252
+ throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
253
+ case 403:
254
+ throw new FiveOneEat.ForbiddenError(_response.error.body, _response.rawResponse);
255
+ case 404:
256
+ throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
257
+ default:
258
+ throw new errors.FiveOneEatError({
259
+ statusCode: _response.error.statusCode,
260
+ body: _response.error.body,
261
+ rawResponse: _response.rawResponse,
262
+ });
263
+ }
179
264
  }
180
265
  return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/business/events/{event}/check-in/stats");
181
266
  });
182
267
  }
183
268
  /**
269
+ * Returns checked-in tickets ordered by check-in time descending.
270
+ * Accepts an optional `limit` query param (default `20`, max `100`).
271
+ *
184
272
  * @param {FiveOneEat.business.events.RecentCheckInRequest} request
185
273
  * @param {CheckInClient.RequestOptions} requestOptions - Request-specific configuration.
186
274
  *
275
+ * @throws {@link FiveOneEat.UnauthorizedError}
276
+ * @throws {@link FiveOneEat.ForbiddenError}
277
+ * @throws {@link FiveOneEat.NotFoundError}
278
+ *
187
279
  * @example
188
280
  * await client.business.events.checkIn.recent({
189
281
  * event: "event"
@@ -210,14 +302,26 @@ class CheckInClient {
210
302
  logging: this._options.logging,
211
303
  });
212
304
  if (_response.ok) {
213
- return { data: undefined, rawResponse: _response.rawResponse };
305
+ return {
306
+ data: _response.body,
307
+ rawResponse: _response.rawResponse,
308
+ };
214
309
  }
215
310
  if (_response.error.reason === "status-code") {
216
- throw new errors.FiveOneEatError({
217
- statusCode: _response.error.statusCode,
218
- body: _response.error.body,
219
- rawResponse: _response.rawResponse,
220
- });
311
+ switch (_response.error.statusCode) {
312
+ case 401:
313
+ throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
314
+ case 403:
315
+ throw new FiveOneEat.ForbiddenError(_response.error.body, _response.rawResponse);
316
+ case 404:
317
+ throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
318
+ default:
319
+ throw new errors.FiveOneEatError({
320
+ statusCode: _response.error.statusCode,
321
+ body: _response.error.body,
322
+ rawResponse: _response.rawResponse,
323
+ });
324
+ }
221
325
  }
222
326
  return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/business/events/{event}/check-in/recent");
223
327
  });
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * event: "event",
5
+ * qr_data: "qr_data"
6
+ * }
7
+ */
8
+ export interface LookupTicketRequest {
9
+ /** The event ID */
10
+ event: string;
11
+ qr_data: string;
12
+ }
@@ -5,5 +5,6 @@
5
5
  * }
6
6
  */
7
7
  export interface RecentCheckInRequest {
8
+ /** The event ID */
8
9
  event: string;
9
10
  }
@@ -0,0 +1,13 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * event: "event",
5
+ * qr_data: "qr_data"
6
+ * }
7
+ */
8
+ export interface ScanTicketRequest {
9
+ /** The event ID */
10
+ event: string;
11
+ qr_data: string;
12
+ checked_in_by?: string | null;
13
+ }
@@ -5,5 +5,6 @@
5
5
  * }
6
6
  */
7
7
  export interface StatsCheckInRequest {
8
+ /** The event ID */
8
9
  event: string;
9
10
  }
@@ -1,4 +1,4 @@
1
- export type { LookupCheckInRequest } from "./LookupCheckInRequest.js";
1
+ export type { LookupTicketRequest } from "./LookupTicketRequest.js";
2
2
  export type { RecentCheckInRequest } from "./RecentCheckInRequest.js";
3
- export type { ScanCheckInRequest } from "./ScanCheckInRequest.js";
3
+ export type { ScanTicketRequest } from "./ScanTicketRequest.js";
4
4
  export type { StatsCheckInRequest } from "./StatsCheckInRequest.js";
@@ -1 +1,2 @@
1
1
  export * from "./client/index.js";
2
+ export * from "./types/index.js";
@@ -15,3 +15,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./client/index.js"), exports);
18
+ __exportStar(require("./types/index.js"), exports);
@@ -0,0 +1,4 @@
1
+ import type * as FiveOneEat from "../../../../../../../index.js";
2
+ export interface LookupCheckInResponse {
3
+ data: FiveOneEat.BusinessEventCheckInTicket;
4
+ }
@@ -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,4 @@
1
+ import type * as FiveOneEat from "../../../../../../../index.js";
2
+ export interface RecentCheckInResponse {
3
+ data: FiveOneEat.BusinessEventCheckIn[];
4
+ }
@@ -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,4 @@
1
+ import type * as FiveOneEat from "../../../../../../../index.js";
2
+ export interface ScanCheckInResponse {
3
+ data: FiveOneEat.BusinessEventCheckInTicket;
4
+ }
@@ -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,4 @@
1
+ import type * as FiveOneEat from "../../../../../../../index.js";
2
+ export interface StatsCheckInResponse {
3
+ data: FiveOneEat.BusinessEventCheckInStats;
4
+ }
@@ -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,4 @@
1
+ export * from "./LookupCheckInResponse.js";
2
+ export * from "./RecentCheckInResponse.js";
3
+ export * from "./ScanCheckInResponse.js";
4
+ export * from "./StatsCheckInResponse.js";
@@ -0,0 +1,20 @@
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("./LookupCheckInResponse.js"), exports);
18
+ __exportStar(require("./RecentCheckInResponse.js"), exports);
19
+ __exportStar(require("./ScanCheckInResponse.js"), exports);
20
+ __exportStar(require("./StatsCheckInResponse.js"), exports);
@@ -1,5 +1,6 @@
1
1
  export * from "./checkIn/client/requests/index.js";
2
2
  export * as checkIn from "./checkIn/index.js";
3
+ export * from "./checkIn/types/index.js";
3
4
  export * from "./orders/client/requests/index.js";
4
5
  export * as orders from "./orders/index.js";
5
6
  export * from "./orders/types/index.js";
@@ -39,6 +39,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
39
39
  exports.ticketTypes = exports.orders = exports.checkIn = void 0;
40
40
  __exportStar(require("./checkIn/client/requests/index.js"), exports);
41
41
  exports.checkIn = __importStar(require("./checkIn/index.js"));
42
+ __exportStar(require("./checkIn/types/index.js"), exports);
42
43
  __exportStar(require("./orders/client/requests/index.js"), exports);
43
44
  exports.orders = __importStar(require("./orders/index.js"));
44
45
  __exportStar(require("./orders/types/index.js"), exports);
@@ -0,0 +1,18 @@
1
+ export interface BusinessEventCheckIn {
2
+ id: string;
3
+ ticket_number: string;
4
+ checked_in_at: string;
5
+ checked_in_by: string;
6
+ user?: BusinessEventCheckIn.User | undefined;
7
+ ticket_type?: BusinessEventCheckIn.TicketType | undefined;
8
+ }
9
+ export declare namespace BusinessEventCheckIn {
10
+ interface User {
11
+ id: string;
12
+ name: string;
13
+ }
14
+ interface TicketType {
15
+ id: string;
16
+ name: string;
17
+ }
18
+ }
@@ -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 BusinessEventCheckInStats = unknown[];
@@ -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,20 @@
1
+ export interface BusinessEventCheckInTicket {
2
+ id: string;
3
+ ticket_number: string;
4
+ status: string;
5
+ used_at: string;
6
+ used_by: string;
7
+ user?: BusinessEventCheckInTicket.User | undefined;
8
+ ticket_type?: BusinessEventCheckInTicket.TicketType | undefined;
9
+ }
10
+ export declare namespace BusinessEventCheckInTicket {
11
+ interface User {
12
+ id: string;
13
+ name: string;
14
+ email: string;
15
+ }
16
+ interface TicketType {
17
+ id: string;
18
+ name: string;
19
+ }
20
+ }
@@ -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 });
@@ -31,6 +31,9 @@ export * from "./BusinessConversation.js";
31
31
  export * from "./BusinessCuisine.js";
32
32
  export * from "./BusinessEvent.js";
33
33
  export * from "./BusinessEventAttendee.js";
34
+ export * from "./BusinessEventCheckIn.js";
35
+ export * from "./BusinessEventCheckInStats.js";
36
+ export * from "./BusinessEventCheckInTicket.js";
34
37
  export * from "./BusinessEventOrder.js";
35
38
  export * from "./BusinessEventOrderDetail.js";
36
39
  export * from "./BusinessEventRsvp.js";
@@ -47,6 +47,9 @@ __exportStar(require("./BusinessConversation.js"), exports);
47
47
  __exportStar(require("./BusinessCuisine.js"), exports);
48
48
  __exportStar(require("./BusinessEvent.js"), exports);
49
49
  __exportStar(require("./BusinessEventAttendee.js"), exports);
50
+ __exportStar(require("./BusinessEventCheckIn.js"), exports);
51
+ __exportStar(require("./BusinessEventCheckInStats.js"), exports);
52
+ __exportStar(require("./BusinessEventCheckInTicket.js"), exports);
50
53
  __exportStar(require("./BusinessEventOrder.js"), exports);
51
54
  __exportStar(require("./BusinessEventOrderDetail.js"), exports);
52
55
  __exportStar(require("./BusinessEventRsvp.js"), exports);
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.0.35";
1
+ export declare const SDK_VERSION = "0.0.36";
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_VERSION = void 0;
4
- exports.SDK_VERSION = "0.0.35";
4
+ exports.SDK_VERSION = "0.0.36";