@51eat/sdk 0.0.34 → 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 (88) hide show
  1. package/dist/cjs/BaseClient.js +2 -2
  2. package/dist/cjs/api/resources/business/resources/events/client/Client.d.ts +3 -0
  3. package/dist/cjs/api/resources/business/resources/events/client/Client.js +9 -4
  4. package/dist/cjs/api/resources/business/resources/events/resources/checkIn/client/Client.d.ts +91 -0
  5. package/dist/cjs/api/resources/business/resources/events/resources/checkIn/client/Client.js +330 -0
  6. package/dist/cjs/api/resources/business/resources/events/resources/checkIn/client/index.d.ts +1 -0
  7. package/dist/cjs/api/resources/business/resources/events/resources/checkIn/client/index.js +17 -0
  8. package/dist/cjs/api/resources/business/resources/events/resources/checkIn/client/requests/LookupTicketRequest.d.ts +12 -0
  9. package/dist/cjs/api/resources/business/resources/events/resources/checkIn/client/requests/LookupTicketRequest.js +3 -0
  10. package/dist/cjs/api/resources/business/resources/events/resources/checkIn/client/requests/RecentCheckInRequest.d.ts +10 -0
  11. package/dist/cjs/api/resources/business/resources/events/resources/checkIn/client/requests/RecentCheckInRequest.js +3 -0
  12. package/dist/cjs/api/resources/business/resources/events/resources/checkIn/client/requests/ScanTicketRequest.d.ts +13 -0
  13. package/dist/cjs/api/resources/business/resources/events/resources/checkIn/client/requests/ScanTicketRequest.js +3 -0
  14. package/dist/cjs/api/resources/business/resources/events/resources/checkIn/client/requests/StatsCheckInRequest.d.ts +10 -0
  15. package/dist/cjs/api/resources/business/resources/events/resources/checkIn/client/requests/StatsCheckInRequest.js +3 -0
  16. package/dist/cjs/api/resources/business/resources/events/resources/checkIn/client/requests/index.d.ts +4 -0
  17. package/dist/cjs/api/resources/business/resources/events/resources/checkIn/client/requests/index.js +2 -0
  18. package/dist/cjs/api/resources/business/resources/events/resources/checkIn/exports.d.ts +2 -0
  19. package/dist/cjs/api/resources/business/resources/events/resources/checkIn/exports.js +21 -0
  20. package/dist/cjs/api/resources/business/resources/events/resources/checkIn/index.d.ts +2 -0
  21. package/dist/cjs/api/resources/business/resources/events/resources/checkIn/index.js +18 -0
  22. package/dist/cjs/api/resources/business/resources/events/resources/checkIn/types/LookupCheckInResponse.d.ts +4 -0
  23. package/dist/cjs/api/resources/business/resources/events/resources/checkIn/types/LookupCheckInResponse.js +3 -0
  24. package/dist/cjs/api/resources/business/resources/events/resources/checkIn/types/RecentCheckInResponse.d.ts +4 -0
  25. package/dist/cjs/api/resources/business/resources/events/resources/checkIn/types/RecentCheckInResponse.js +3 -0
  26. package/dist/cjs/api/resources/business/resources/events/resources/checkIn/types/ScanCheckInResponse.d.ts +4 -0
  27. package/dist/cjs/api/resources/business/resources/events/resources/checkIn/types/ScanCheckInResponse.js +3 -0
  28. package/dist/cjs/api/resources/business/resources/events/resources/checkIn/types/StatsCheckInResponse.d.ts +4 -0
  29. package/dist/cjs/api/resources/business/resources/events/resources/checkIn/types/StatsCheckInResponse.js +3 -0
  30. package/dist/cjs/api/resources/business/resources/events/resources/checkIn/types/index.d.ts +4 -0
  31. package/dist/cjs/api/resources/business/resources/events/resources/checkIn/types/index.js +20 -0
  32. package/dist/cjs/api/resources/business/resources/events/resources/index.d.ts +3 -0
  33. package/dist/cjs/api/resources/business/resources/events/resources/index.js +4 -1
  34. package/dist/cjs/api/types/BusinessEventCheckIn.d.ts +18 -0
  35. package/dist/cjs/api/types/BusinessEventCheckIn.js +3 -0
  36. package/dist/cjs/api/types/BusinessEventCheckInStats.d.ts +1 -0
  37. package/dist/cjs/api/types/BusinessEventCheckInStats.js +3 -0
  38. package/dist/cjs/api/types/BusinessEventCheckInTicket.d.ts +20 -0
  39. package/dist/cjs/api/types/BusinessEventCheckInTicket.js +3 -0
  40. package/dist/cjs/api/types/index.d.ts +3 -0
  41. package/dist/cjs/api/types/index.js +3 -0
  42. package/dist/cjs/version.d.ts +1 -1
  43. package/dist/cjs/version.js +1 -1
  44. package/dist/esm/BaseClient.mjs +2 -2
  45. package/dist/esm/api/resources/business/resources/events/client/Client.d.mts +3 -0
  46. package/dist/esm/api/resources/business/resources/events/client/Client.mjs +5 -0
  47. package/dist/esm/api/resources/business/resources/events/resources/checkIn/client/Client.d.mts +91 -0
  48. package/dist/esm/api/resources/business/resources/events/resources/checkIn/client/Client.mjs +293 -0
  49. package/dist/esm/api/resources/business/resources/events/resources/checkIn/client/index.d.mts +1 -0
  50. package/dist/esm/api/resources/business/resources/events/resources/checkIn/client/index.mjs +1 -0
  51. package/dist/esm/api/resources/business/resources/events/resources/checkIn/client/requests/LookupTicketRequest.d.mts +12 -0
  52. package/dist/esm/api/resources/business/resources/events/resources/checkIn/client/requests/LookupTicketRequest.mjs +2 -0
  53. package/dist/esm/api/resources/business/resources/events/resources/checkIn/client/requests/RecentCheckInRequest.d.mts +10 -0
  54. package/dist/esm/api/resources/business/resources/events/resources/checkIn/client/requests/RecentCheckInRequest.mjs +2 -0
  55. package/dist/esm/api/resources/business/resources/events/resources/checkIn/client/requests/ScanTicketRequest.d.mts +13 -0
  56. package/dist/esm/api/resources/business/resources/events/resources/checkIn/client/requests/ScanTicketRequest.mjs +2 -0
  57. package/dist/esm/api/resources/business/resources/events/resources/checkIn/client/requests/StatsCheckInRequest.d.mts +10 -0
  58. package/dist/esm/api/resources/business/resources/events/resources/checkIn/client/requests/StatsCheckInRequest.mjs +2 -0
  59. package/dist/esm/api/resources/business/resources/events/resources/checkIn/client/requests/index.d.mts +4 -0
  60. package/dist/esm/api/resources/business/resources/events/resources/checkIn/client/requests/index.mjs +1 -0
  61. package/dist/esm/api/resources/business/resources/events/resources/checkIn/exports.d.mts +2 -0
  62. package/dist/esm/api/resources/business/resources/events/resources/checkIn/exports.mjs +3 -0
  63. package/dist/esm/api/resources/business/resources/events/resources/checkIn/index.d.mts +2 -0
  64. package/dist/esm/api/resources/business/resources/events/resources/checkIn/index.mjs +2 -0
  65. package/dist/esm/api/resources/business/resources/events/resources/checkIn/types/LookupCheckInResponse.d.mts +4 -0
  66. package/dist/esm/api/resources/business/resources/events/resources/checkIn/types/LookupCheckInResponse.mjs +2 -0
  67. package/dist/esm/api/resources/business/resources/events/resources/checkIn/types/RecentCheckInResponse.d.mts +4 -0
  68. package/dist/esm/api/resources/business/resources/events/resources/checkIn/types/RecentCheckInResponse.mjs +2 -0
  69. package/dist/esm/api/resources/business/resources/events/resources/checkIn/types/ScanCheckInResponse.d.mts +4 -0
  70. package/dist/esm/api/resources/business/resources/events/resources/checkIn/types/ScanCheckInResponse.mjs +2 -0
  71. package/dist/esm/api/resources/business/resources/events/resources/checkIn/types/StatsCheckInResponse.d.mts +4 -0
  72. package/dist/esm/api/resources/business/resources/events/resources/checkIn/types/StatsCheckInResponse.mjs +2 -0
  73. package/dist/esm/api/resources/business/resources/events/resources/checkIn/types/index.d.mts +4 -0
  74. package/dist/esm/api/resources/business/resources/events/resources/checkIn/types/index.mjs +4 -0
  75. package/dist/esm/api/resources/business/resources/events/resources/index.d.mts +3 -0
  76. package/dist/esm/api/resources/business/resources/events/resources/index.mjs +3 -0
  77. package/dist/esm/api/types/BusinessEventCheckIn.d.mts +18 -0
  78. package/dist/esm/api/types/BusinessEventCheckIn.mjs +2 -0
  79. package/dist/esm/api/types/BusinessEventCheckInStats.d.mts +1 -0
  80. package/dist/esm/api/types/BusinessEventCheckInStats.mjs +2 -0
  81. package/dist/esm/api/types/BusinessEventCheckInTicket.d.mts +20 -0
  82. package/dist/esm/api/types/BusinessEventCheckInTicket.mjs +2 -0
  83. package/dist/esm/api/types/index.d.mts +3 -0
  84. package/dist/esm/api/types/index.mjs +3 -0
  85. package/dist/esm/version.d.mts +1 -1
  86. package/dist/esm/version.mjs +1 -1
  87. package/package.json +12 -1
  88. package/reference.md +269 -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.34",
47
- "User-Agent": "@51eat/sdk/0.0.34",
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);
@@ -2,6 +2,7 @@ import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../Ba
2
2
  import { type NormalizedClientOptionsWithAuth } from "../../../../../../BaseClient.js";
3
3
  import * as core from "../../../../../../core/index.js";
4
4
  import * as FiveOneEat from "../../../../../index.js";
5
+ import { CheckInClient } from "../resources/checkIn/client/Client.js";
5
6
  import { OrdersClient } from "../resources/orders/client/Client.js";
6
7
  import { TicketTypesClient } from "../resources/ticketTypes/client/Client.js";
7
8
  export declare namespace EventsClient {
@@ -13,9 +14,11 @@ export declare class EventsClient {
13
14
  protected readonly _options: NormalizedClientOptionsWithAuth<EventsClient.Options>;
14
15
  protected _ticketTypes: TicketTypesClient | undefined;
15
16
  protected _orders: OrdersClient | undefined;
17
+ protected _checkIn: CheckInClient | undefined;
16
18
  constructor(options?: EventsClient.Options);
17
19
  get ticketTypes(): TicketTypesClient;
18
20
  get orders(): OrdersClient;
21
+ get checkIn(): CheckInClient;
19
22
  /**
20
23
  * Accepts an optional `filter` query param: `upcoming`, `past`, or `all` (default `all`).
21
24
  *
@@ -62,19 +62,24 @@ const environments = __importStar(require("../../../../../../environments.js"));
62
62
  const handleNonStatusCodeError_js_1 = require("../../../../../../errors/handleNonStatusCodeError.js");
63
63
  const errors = __importStar(require("../../../../../../errors/index.js"));
64
64
  const FiveOneEat = __importStar(require("../../../../../index.js"));
65
- const Client_js_1 = require("../resources/orders/client/Client.js");
66
- const Client_js_2 = require("../resources/ticketTypes/client/Client.js");
65
+ const Client_js_1 = require("../resources/checkIn/client/Client.js");
66
+ const Client_js_2 = require("../resources/orders/client/Client.js");
67
+ const Client_js_3 = require("../resources/ticketTypes/client/Client.js");
67
68
  class EventsClient {
68
69
  constructor(options = {}) {
69
70
  this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
70
71
  }
71
72
  get ticketTypes() {
72
73
  var _a;
73
- return ((_a = this._ticketTypes) !== null && _a !== void 0 ? _a : (this._ticketTypes = new Client_js_2.TicketTypesClient(this._options)));
74
+ return ((_a = this._ticketTypes) !== null && _a !== void 0 ? _a : (this._ticketTypes = new Client_js_3.TicketTypesClient(this._options)));
74
75
  }
75
76
  get orders() {
76
77
  var _a;
77
- return ((_a = this._orders) !== null && _a !== void 0 ? _a : (this._orders = new Client_js_1.OrdersClient(this._options)));
78
+ return ((_a = this._orders) !== null && _a !== void 0 ? _a : (this._orders = new Client_js_2.OrdersClient(this._options)));
79
+ }
80
+ get checkIn() {
81
+ var _a;
82
+ return ((_a = this._checkIn) !== null && _a !== void 0 ? _a : (this._checkIn = new Client_js_1.CheckInClient(this._options)));
78
83
  }
79
84
  /**
80
85
  * Accepts an optional `filter` query param: `upcoming`, `past`, or `all` (default `all`).
@@ -0,0 +1,91 @@
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 CheckInClient {
6
+ type Options = BaseClientOptions;
7
+ interface RequestOptions extends BaseRequestOptions {
8
+ }
9
+ }
10
+ export declare class CheckInClient {
11
+ protected readonly _options: NormalizedClientOptionsWithAuth<CheckInClient.Options>;
12
+ constructor(options?: CheckInClient.Options);
13
+ /**
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
18
+ * @param {CheckInClient.RequestOptions} requestOptions - Request-specific configuration.
19
+ *
20
+ * @throws {@link FiveOneEat.UnauthorizedError}
21
+ * @throws {@link FiveOneEat.ForbiddenError}
22
+ * @throws {@link FiveOneEat.NotFoundError}
23
+ * @throws {@link FiveOneEat.UnprocessableEntityError}
24
+ *
25
+ * @example
26
+ * await client.business.events.checkIn.lookup({
27
+ * event: "event",
28
+ * qr_data: "qr_data"
29
+ * })
30
+ */
31
+ lookup(request: FiveOneEat.business.events.LookupTicketRequest, requestOptions?: CheckInClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.business.events.LookupCheckInResponse>;
32
+ private __lookup;
33
+ /**
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
41
+ * @param {CheckInClient.RequestOptions} requestOptions - Request-specific configuration.
42
+ *
43
+ * @throws {@link FiveOneEat.UnauthorizedError}
44
+ * @throws {@link FiveOneEat.ForbiddenError}
45
+ * @throws {@link FiveOneEat.NotFoundError}
46
+ * @throws {@link FiveOneEat.UnprocessableEntityError}
47
+ *
48
+ * @example
49
+ * await client.business.events.checkIn.scan({
50
+ * event: "event",
51
+ * qr_data: "qr_data"
52
+ * })
53
+ */
54
+ scan(request: FiveOneEat.business.events.ScanTicketRequest, requestOptions?: CheckInClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.business.events.ScanCheckInResponse>;
55
+ private __scan;
56
+ /**
57
+ * Returns ticket counts and check-in rate for the event dashboard.
58
+ *
59
+ * @param {FiveOneEat.business.events.StatsCheckInRequest} request
60
+ * @param {CheckInClient.RequestOptions} requestOptions - Request-specific configuration.
61
+ *
62
+ * @throws {@link FiveOneEat.UnauthorizedError}
63
+ * @throws {@link FiveOneEat.ForbiddenError}
64
+ * @throws {@link FiveOneEat.NotFoundError}
65
+ *
66
+ * @example
67
+ * await client.business.events.checkIn.stats({
68
+ * event: "event"
69
+ * })
70
+ */
71
+ stats(request: FiveOneEat.business.events.StatsCheckInRequest, requestOptions?: CheckInClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.business.events.StatsCheckInResponse>;
72
+ private __stats;
73
+ /**
74
+ * Returns checked-in tickets ordered by check-in time descending.
75
+ * Accepts an optional `limit` query param (default `20`, max `100`).
76
+ *
77
+ * @param {FiveOneEat.business.events.RecentCheckInRequest} request
78
+ * @param {CheckInClient.RequestOptions} requestOptions - Request-specific configuration.
79
+ *
80
+ * @throws {@link FiveOneEat.UnauthorizedError}
81
+ * @throws {@link FiveOneEat.ForbiddenError}
82
+ * @throws {@link FiveOneEat.NotFoundError}
83
+ *
84
+ * @example
85
+ * await client.business.events.checkIn.recent({
86
+ * event: "event"
87
+ * })
88
+ */
89
+ recent(request: FiveOneEat.business.events.RecentCheckInRequest, requestOptions?: CheckInClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.business.events.RecentCheckInResponse>;
90
+ private __recent;
91
+ }
@@ -0,0 +1,330 @@
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
+ 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
+ };
56
+ Object.defineProperty(exports, "__esModule", { value: true });
57
+ exports.CheckInClient = void 0;
58
+ const BaseClient_js_1 = require("../../../../../../../../BaseClient.js");
59
+ const headers_js_1 = require("../../../../../../../../core/headers.js");
60
+ const core = __importStar(require("../../../../../../../../core/index.js"));
61
+ const environments = __importStar(require("../../../../../../../../environments.js"));
62
+ const handleNonStatusCodeError_js_1 = require("../../../../../../../../errors/handleNonStatusCodeError.js");
63
+ const errors = __importStar(require("../../../../../../../../errors/index.js"));
64
+ const FiveOneEat = __importStar(require("../../../../../../../index.js"));
65
+ class CheckInClient {
66
+ constructor(options = {}) {
67
+ this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
68
+ }
69
+ /**
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
74
+ * @param {CheckInClient.RequestOptions} requestOptions - Request-specific configuration.
75
+ *
76
+ * @throws {@link FiveOneEat.UnauthorizedError}
77
+ * @throws {@link FiveOneEat.ForbiddenError}
78
+ * @throws {@link FiveOneEat.NotFoundError}
79
+ * @throws {@link FiveOneEat.UnprocessableEntityError}
80
+ *
81
+ * @example
82
+ * await client.business.events.checkIn.lookup({
83
+ * event: "event",
84
+ * qr_data: "qr_data"
85
+ * })
86
+ */
87
+ lookup(request, requestOptions) {
88
+ return core.HttpResponsePromise.fromPromise(this.__lookup(request, requestOptions));
89
+ }
90
+ __lookup(request, requestOptions) {
91
+ return __awaiter(this, void 0, void 0, function* () {
92
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
93
+ const { event } = request, _body = __rest(request, ["event"]);
94
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
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);
96
+ const _response = yield core.fetcher({
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`),
98
+ method: "POST",
99
+ headers: _headers,
100
+ contentType: "application/json",
101
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
102
+ requestType: "json",
103
+ body: _body,
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,
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,
106
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
107
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
108
+ logging: this._options.logging,
109
+ });
110
+ if (_response.ok) {
111
+ return {
112
+ data: _response.body,
113
+ rawResponse: _response.rawResponse,
114
+ };
115
+ }
116
+ if (_response.error.reason === "status-code") {
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
+ }
133
+ }
134
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/business/events/{event}/check-in/lookup");
135
+ });
136
+ }
137
+ /**
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
145
+ * @param {CheckInClient.RequestOptions} requestOptions - Request-specific configuration.
146
+ *
147
+ * @throws {@link FiveOneEat.UnauthorizedError}
148
+ * @throws {@link FiveOneEat.ForbiddenError}
149
+ * @throws {@link FiveOneEat.NotFoundError}
150
+ * @throws {@link FiveOneEat.UnprocessableEntityError}
151
+ *
152
+ * @example
153
+ * await client.business.events.checkIn.scan({
154
+ * event: "event",
155
+ * qr_data: "qr_data"
156
+ * })
157
+ */
158
+ scan(request, requestOptions) {
159
+ return core.HttpResponsePromise.fromPromise(this.__scan(request, requestOptions));
160
+ }
161
+ __scan(request, requestOptions) {
162
+ return __awaiter(this, void 0, void 0, function* () {
163
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
164
+ const { event } = request, _body = __rest(request, ["event"]);
165
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
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);
167
+ const _response = yield core.fetcher({
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`),
169
+ method: "POST",
170
+ headers: _headers,
171
+ contentType: "application/json",
172
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
173
+ requestType: "json",
174
+ body: _body,
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,
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,
177
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
178
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
179
+ logging: this._options.logging,
180
+ });
181
+ if (_response.ok) {
182
+ return {
183
+ data: _response.body,
184
+ rawResponse: _response.rawResponse,
185
+ };
186
+ }
187
+ if (_response.error.reason === "status-code") {
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
+ }
204
+ }
205
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/business/events/{event}/check-in/scan");
206
+ });
207
+ }
208
+ /**
209
+ * Returns ticket counts and check-in rate for the event dashboard.
210
+ *
211
+ * @param {FiveOneEat.business.events.StatsCheckInRequest} request
212
+ * @param {CheckInClient.RequestOptions} requestOptions - Request-specific configuration.
213
+ *
214
+ * @throws {@link FiveOneEat.UnauthorizedError}
215
+ * @throws {@link FiveOneEat.ForbiddenError}
216
+ * @throws {@link FiveOneEat.NotFoundError}
217
+ *
218
+ * @example
219
+ * await client.business.events.checkIn.stats({
220
+ * event: "event"
221
+ * })
222
+ */
223
+ stats(request, requestOptions) {
224
+ return core.HttpResponsePromise.fromPromise(this.__stats(request, requestOptions));
225
+ }
226
+ __stats(request, requestOptions) {
227
+ return __awaiter(this, void 0, void 0, function* () {
228
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
229
+ const { event } = request;
230
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
231
+ 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);
232
+ const _response = yield core.fetcher({
233
+ 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/stats`),
234
+ method: "GET",
235
+ headers: _headers,
236
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
237
+ 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,
238
+ 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,
239
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
240
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
241
+ logging: this._options.logging,
242
+ });
243
+ if (_response.ok) {
244
+ return {
245
+ data: _response.body,
246
+ rawResponse: _response.rawResponse,
247
+ };
248
+ }
249
+ if (_response.error.reason === "status-code") {
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
+ }
264
+ }
265
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/business/events/{event}/check-in/stats");
266
+ });
267
+ }
268
+ /**
269
+ * Returns checked-in tickets ordered by check-in time descending.
270
+ * Accepts an optional `limit` query param (default `20`, max `100`).
271
+ *
272
+ * @param {FiveOneEat.business.events.RecentCheckInRequest} request
273
+ * @param {CheckInClient.RequestOptions} requestOptions - Request-specific configuration.
274
+ *
275
+ * @throws {@link FiveOneEat.UnauthorizedError}
276
+ * @throws {@link FiveOneEat.ForbiddenError}
277
+ * @throws {@link FiveOneEat.NotFoundError}
278
+ *
279
+ * @example
280
+ * await client.business.events.checkIn.recent({
281
+ * event: "event"
282
+ * })
283
+ */
284
+ recent(request, requestOptions) {
285
+ return core.HttpResponsePromise.fromPromise(this.__recent(request, requestOptions));
286
+ }
287
+ __recent(request, requestOptions) {
288
+ return __awaiter(this, void 0, void 0, function* () {
289
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
290
+ const { event } = request;
291
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
292
+ 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);
293
+ const _response = yield core.fetcher({
294
+ 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/recent`),
295
+ method: "GET",
296
+ headers: _headers,
297
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
298
+ 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,
299
+ 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,
300
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
301
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
302
+ logging: this._options.logging,
303
+ });
304
+ if (_response.ok) {
305
+ return {
306
+ data: _response.body,
307
+ rawResponse: _response.rawResponse,
308
+ };
309
+ }
310
+ if (_response.error.reason === "status-code") {
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
+ }
325
+ }
326
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/business/events/{event}/check-in/recent");
327
+ });
328
+ }
329
+ }
330
+ exports.CheckInClient = CheckInClient;
@@ -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,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
+ }
@@ -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,10 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * event: "event"
5
+ * }
6
+ */
7
+ export interface RecentCheckInRequest {
8
+ /** The event ID */
9
+ event: string;
10
+ }
@@ -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,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
+ }
@@ -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,10 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * event: "event"
5
+ * }
6
+ */
7
+ export interface StatsCheckInRequest {
8
+ /** The event ID */
9
+ event: string;
10
+ }
@@ -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 type { LookupTicketRequest } from "./LookupTicketRequest.js";
2
+ export type { RecentCheckInRequest } from "./RecentCheckInRequest.js";
3
+ export type { ScanTicketRequest } from "./ScanTicketRequest.js";
4
+ export type { StatsCheckInRequest } from "./StatsCheckInRequest.js";
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ export { CheckInClient } 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.CheckInClient = void 0;
19
+ var Client_js_1 = require("./client/Client.js");
20
+ Object.defineProperty(exports, "CheckInClient", { enumerable: true, get: function () { return Client_js_1.CheckInClient; } });
21
+ __exportStar(require("./client/index.js"), exports);
@@ -0,0 +1,2 @@
1
+ export * from "./client/index.js";
2
+ export * from "./types/index.js";
@@ -0,0 +1,18 @@
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);
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
+ }