@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.
- package/dist/cjs/BaseClient.js +2 -2
- package/dist/cjs/api/resources/business/resources/events/client/Client.d.ts +3 -0
- package/dist/cjs/api/resources/business/resources/events/client/Client.js +9 -4
- package/dist/cjs/api/resources/business/resources/events/resources/checkIn/client/Client.d.ts +91 -0
- package/dist/cjs/api/resources/business/resources/events/resources/checkIn/client/Client.js +330 -0
- package/dist/cjs/api/resources/business/resources/events/resources/checkIn/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/business/resources/events/resources/checkIn/client/index.js +17 -0
- package/dist/cjs/api/resources/business/resources/events/resources/checkIn/client/requests/LookupTicketRequest.d.ts +12 -0
- package/dist/cjs/api/resources/business/resources/events/resources/checkIn/client/requests/LookupTicketRequest.js +3 -0
- package/dist/cjs/api/resources/business/resources/events/resources/checkIn/client/requests/RecentCheckInRequest.d.ts +10 -0
- package/dist/cjs/api/resources/business/resources/events/resources/checkIn/client/requests/RecentCheckInRequest.js +3 -0
- package/dist/cjs/api/resources/business/resources/events/resources/checkIn/client/requests/ScanTicketRequest.d.ts +13 -0
- package/dist/cjs/api/resources/business/resources/events/resources/checkIn/client/requests/ScanTicketRequest.js +3 -0
- package/dist/cjs/api/resources/business/resources/events/resources/checkIn/client/requests/StatsCheckInRequest.d.ts +10 -0
- package/dist/cjs/api/resources/business/resources/events/resources/checkIn/client/requests/StatsCheckInRequest.js +3 -0
- package/dist/cjs/api/resources/business/resources/events/resources/checkIn/client/requests/index.d.ts +4 -0
- package/dist/cjs/api/resources/business/resources/events/resources/checkIn/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/business/resources/events/resources/checkIn/exports.d.ts +2 -0
- package/dist/cjs/api/resources/business/resources/events/resources/checkIn/exports.js +21 -0
- package/dist/cjs/api/resources/business/resources/events/resources/checkIn/index.d.ts +2 -0
- package/dist/cjs/api/resources/business/resources/events/resources/checkIn/index.js +18 -0
- package/dist/cjs/api/resources/business/resources/events/resources/checkIn/types/LookupCheckInResponse.d.ts +4 -0
- package/dist/cjs/api/resources/business/resources/events/resources/checkIn/types/LookupCheckInResponse.js +3 -0
- package/dist/cjs/api/resources/business/resources/events/resources/checkIn/types/RecentCheckInResponse.d.ts +4 -0
- package/dist/cjs/api/resources/business/resources/events/resources/checkIn/types/RecentCheckInResponse.js +3 -0
- package/dist/cjs/api/resources/business/resources/events/resources/checkIn/types/ScanCheckInResponse.d.ts +4 -0
- package/dist/cjs/api/resources/business/resources/events/resources/checkIn/types/ScanCheckInResponse.js +3 -0
- package/dist/cjs/api/resources/business/resources/events/resources/checkIn/types/StatsCheckInResponse.d.ts +4 -0
- package/dist/cjs/api/resources/business/resources/events/resources/checkIn/types/StatsCheckInResponse.js +3 -0
- package/dist/cjs/api/resources/business/resources/events/resources/checkIn/types/index.d.ts +4 -0
- package/dist/cjs/api/resources/business/resources/events/resources/checkIn/types/index.js +20 -0
- package/dist/cjs/api/resources/business/resources/events/resources/index.d.ts +3 -0
- package/dist/cjs/api/resources/business/resources/events/resources/index.js +4 -1
- package/dist/cjs/api/types/BusinessEventCheckIn.d.ts +18 -0
- package/dist/cjs/api/types/BusinessEventCheckIn.js +3 -0
- package/dist/cjs/api/types/BusinessEventCheckInStats.d.ts +1 -0
- package/dist/cjs/api/types/BusinessEventCheckInStats.js +3 -0
- package/dist/cjs/api/types/BusinessEventCheckInTicket.d.ts +20 -0
- package/dist/cjs/api/types/BusinessEventCheckInTicket.js +3 -0
- package/dist/cjs/api/types/index.d.ts +3 -0
- package/dist/cjs/api/types/index.js +3 -0
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/BaseClient.mjs +2 -2
- package/dist/esm/api/resources/business/resources/events/client/Client.d.mts +3 -0
- package/dist/esm/api/resources/business/resources/events/client/Client.mjs +5 -0
- package/dist/esm/api/resources/business/resources/events/resources/checkIn/client/Client.d.mts +91 -0
- package/dist/esm/api/resources/business/resources/events/resources/checkIn/client/Client.mjs +293 -0
- package/dist/esm/api/resources/business/resources/events/resources/checkIn/client/index.d.mts +1 -0
- package/dist/esm/api/resources/business/resources/events/resources/checkIn/client/index.mjs +1 -0
- package/dist/esm/api/resources/business/resources/events/resources/checkIn/client/requests/LookupTicketRequest.d.mts +12 -0
- package/dist/esm/api/resources/business/resources/events/resources/checkIn/client/requests/LookupTicketRequest.mjs +2 -0
- package/dist/esm/api/resources/business/resources/events/resources/checkIn/client/requests/RecentCheckInRequest.d.mts +10 -0
- package/dist/esm/api/resources/business/resources/events/resources/checkIn/client/requests/RecentCheckInRequest.mjs +2 -0
- package/dist/esm/api/resources/business/resources/events/resources/checkIn/client/requests/ScanTicketRequest.d.mts +13 -0
- package/dist/esm/api/resources/business/resources/events/resources/checkIn/client/requests/ScanTicketRequest.mjs +2 -0
- package/dist/esm/api/resources/business/resources/events/resources/checkIn/client/requests/StatsCheckInRequest.d.mts +10 -0
- package/dist/esm/api/resources/business/resources/events/resources/checkIn/client/requests/StatsCheckInRequest.mjs +2 -0
- package/dist/esm/api/resources/business/resources/events/resources/checkIn/client/requests/index.d.mts +4 -0
- package/dist/esm/api/resources/business/resources/events/resources/checkIn/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/business/resources/events/resources/checkIn/exports.d.mts +2 -0
- package/dist/esm/api/resources/business/resources/events/resources/checkIn/exports.mjs +3 -0
- package/dist/esm/api/resources/business/resources/events/resources/checkIn/index.d.mts +2 -0
- package/dist/esm/api/resources/business/resources/events/resources/checkIn/index.mjs +2 -0
- package/dist/esm/api/resources/business/resources/events/resources/checkIn/types/LookupCheckInResponse.d.mts +4 -0
- package/dist/esm/api/resources/business/resources/events/resources/checkIn/types/LookupCheckInResponse.mjs +2 -0
- package/dist/esm/api/resources/business/resources/events/resources/checkIn/types/RecentCheckInResponse.d.mts +4 -0
- package/dist/esm/api/resources/business/resources/events/resources/checkIn/types/RecentCheckInResponse.mjs +2 -0
- package/dist/esm/api/resources/business/resources/events/resources/checkIn/types/ScanCheckInResponse.d.mts +4 -0
- package/dist/esm/api/resources/business/resources/events/resources/checkIn/types/ScanCheckInResponse.mjs +2 -0
- package/dist/esm/api/resources/business/resources/events/resources/checkIn/types/StatsCheckInResponse.d.mts +4 -0
- package/dist/esm/api/resources/business/resources/events/resources/checkIn/types/StatsCheckInResponse.mjs +2 -0
- package/dist/esm/api/resources/business/resources/events/resources/checkIn/types/index.d.mts +4 -0
- package/dist/esm/api/resources/business/resources/events/resources/checkIn/types/index.mjs +4 -0
- package/dist/esm/api/resources/business/resources/events/resources/index.d.mts +3 -0
- package/dist/esm/api/resources/business/resources/events/resources/index.mjs +3 -0
- package/dist/esm/api/types/BusinessEventCheckIn.d.mts +18 -0
- package/dist/esm/api/types/BusinessEventCheckIn.mjs +2 -0
- package/dist/esm/api/types/BusinessEventCheckInStats.d.mts +1 -0
- package/dist/esm/api/types/BusinessEventCheckInStats.mjs +2 -0
- package/dist/esm/api/types/BusinessEventCheckInTicket.d.mts +20 -0
- package/dist/esm/api/types/BusinessEventCheckInTicket.mjs +2 -0
- package/dist/esm/api/types/index.d.mts +3 -0
- package/dist/esm/api/types/index.mjs +3 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +12 -1
- package/reference.md +269 -0
|
@@ -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,3 +1,6 @@
|
|
|
1
|
+
export * from "./checkIn/client/requests/index.js";
|
|
2
|
+
export * as checkIn from "./checkIn/index.js";
|
|
3
|
+
export * from "./checkIn/types/index.js";
|
|
1
4
|
export * from "./orders/client/requests/index.js";
|
|
2
5
|
export * as orders from "./orders/index.js";
|
|
3
6
|
export * from "./orders/types/index.js";
|
|
@@ -36,7 +36,10 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
36
36
|
};
|
|
37
37
|
})();
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.ticketTypes = exports.orders = void 0;
|
|
39
|
+
exports.ticketTypes = exports.orders = exports.checkIn = void 0;
|
|
40
|
+
__exportStar(require("./checkIn/client/requests/index.js"), exports);
|
|
41
|
+
exports.checkIn = __importStar(require("./checkIn/index.js"));
|
|
42
|
+
__exportStar(require("./checkIn/types/index.js"), exports);
|
|
40
43
|
__exportStar(require("./orders/client/requests/index.js"), exports);
|
|
41
44
|
exports.orders = __importStar(require("./orders/index.js"));
|
|
42
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 @@
|
|
|
1
|
+
export type BusinessEventCheckInStats = unknown[];
|
|
@@ -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
|
+
}
|
|
@@ -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);
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.0.
|
|
1
|
+
export declare const SDK_VERSION = "0.0.36";
|
package/dist/cjs/version.js
CHANGED
package/dist/esm/BaseClient.mjs
CHANGED
|
@@ -6,8 +6,8 @@ export function normalizeClientOptions(options) {
|
|
|
6
6
|
const headers = mergeHeaders({
|
|
7
7
|
"X-Fern-Language": "JavaScript",
|
|
8
8
|
"X-Fern-SDK-Name": "@51eat/sdk",
|
|
9
|
-
"X-Fern-SDK-Version": "0.0.
|
|
10
|
-
"User-Agent": "@51eat/sdk/0.0.
|
|
9
|
+
"X-Fern-SDK-Version": "0.0.36",
|
|
10
|
+
"User-Agent": "@51eat/sdk/0.0.36",
|
|
11
11
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
12
12
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
13
13
|
}, 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.mjs";
|
|
3
3
|
import * as core from "../../../../../../core/index.mjs";
|
|
4
4
|
import * as FiveOneEat from "../../../../../index.mjs";
|
|
5
|
+
import { CheckInClient } from "../resources/checkIn/client/Client.mjs";
|
|
5
6
|
import { OrdersClient } from "../resources/orders/client/Client.mjs";
|
|
6
7
|
import { TicketTypesClient } from "../resources/ticketTypes/client/Client.mjs";
|
|
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
|
*
|
|
@@ -26,6 +26,7 @@ import * as environments from "../../../../../../environments.mjs";
|
|
|
26
26
|
import { handleNonStatusCodeError } from "../../../../../../errors/handleNonStatusCodeError.mjs";
|
|
27
27
|
import * as errors from "../../../../../../errors/index.mjs";
|
|
28
28
|
import * as FiveOneEat from "../../../../../index.mjs";
|
|
29
|
+
import { CheckInClient } from "../resources/checkIn/client/Client.mjs";
|
|
29
30
|
import { OrdersClient } from "../resources/orders/client/Client.mjs";
|
|
30
31
|
import { TicketTypesClient } from "../resources/ticketTypes/client/Client.mjs";
|
|
31
32
|
export class EventsClient {
|
|
@@ -40,6 +41,10 @@ export class EventsClient {
|
|
|
40
41
|
var _a;
|
|
41
42
|
return ((_a = this._orders) !== null && _a !== void 0 ? _a : (this._orders = new OrdersClient(this._options)));
|
|
42
43
|
}
|
|
44
|
+
get checkIn() {
|
|
45
|
+
var _a;
|
|
46
|
+
return ((_a = this._checkIn) !== null && _a !== void 0 ? _a : (this._checkIn = new CheckInClient(this._options)));
|
|
47
|
+
}
|
|
43
48
|
/**
|
|
44
49
|
* Accepts an optional `filter` query param: `upcoming`, `past`, or `all` (default `all`).
|
|
45
50
|
*
|
package/dist/esm/api/resources/business/resources/events/resources/checkIn/client/Client.d.mts
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../../../BaseClient.mjs";
|
|
2
|
+
import { type NormalizedClientOptionsWithAuth } from "../../../../../../../../BaseClient.mjs";
|
|
3
|
+
import * as core from "../../../../../../../../core/index.mjs";
|
|
4
|
+
import * as FiveOneEat from "../../../../../../../index.mjs";
|
|
5
|
+
export declare namespace 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,293 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
12
|
+
var t = {};
|
|
13
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
14
|
+
t[p] = s[p];
|
|
15
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
16
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
17
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
18
|
+
t[p[i]] = s[p[i]];
|
|
19
|
+
}
|
|
20
|
+
return t;
|
|
21
|
+
};
|
|
22
|
+
import { normalizeClientOptionsWithAuth, } from "../../../../../../../../BaseClient.mjs";
|
|
23
|
+
import { mergeHeaders } from "../../../../../../../../core/headers.mjs";
|
|
24
|
+
import * as core from "../../../../../../../../core/index.mjs";
|
|
25
|
+
import * as environments from "../../../../../../../../environments.mjs";
|
|
26
|
+
import { handleNonStatusCodeError } from "../../../../../../../../errors/handleNonStatusCodeError.mjs";
|
|
27
|
+
import * as errors from "../../../../../../../../errors/index.mjs";
|
|
28
|
+
import * as FiveOneEat from "../../../../../../../index.mjs";
|
|
29
|
+
export class CheckInClient {
|
|
30
|
+
constructor(options = {}) {
|
|
31
|
+
this._options = normalizeClientOptionsWithAuth(options);
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Decodes the base64 QR payload and returns ticket details without performing check-in.
|
|
35
|
+
* Accepts either a `ticket_id` or `ticket_number` inside the QR payload.
|
|
36
|
+
*
|
|
37
|
+
* @param {FiveOneEat.business.events.LookupTicketRequest} request
|
|
38
|
+
* @param {CheckInClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
39
|
+
*
|
|
40
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
41
|
+
* @throws {@link FiveOneEat.ForbiddenError}
|
|
42
|
+
* @throws {@link FiveOneEat.NotFoundError}
|
|
43
|
+
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* await client.business.events.checkIn.lookup({
|
|
47
|
+
* event: "event",
|
|
48
|
+
* qr_data: "qr_data"
|
|
49
|
+
* })
|
|
50
|
+
*/
|
|
51
|
+
lookup(request, requestOptions) {
|
|
52
|
+
return core.HttpResponsePromise.fromPromise(this.__lookup(request, requestOptions));
|
|
53
|
+
}
|
|
54
|
+
__lookup(request, requestOptions) {
|
|
55
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
56
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
57
|
+
const { event } = request, _body = __rest(request, ["event"]);
|
|
58
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
59
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
60
|
+
const _response = yield core.fetcher({
|
|
61
|
+
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`),
|
|
62
|
+
method: "POST",
|
|
63
|
+
headers: _headers,
|
|
64
|
+
contentType: "application/json",
|
|
65
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
66
|
+
requestType: "json",
|
|
67
|
+
body: _body,
|
|
68
|
+
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,
|
|
69
|
+
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,
|
|
70
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
71
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
72
|
+
logging: this._options.logging,
|
|
73
|
+
});
|
|
74
|
+
if (_response.ok) {
|
|
75
|
+
return {
|
|
76
|
+
data: _response.body,
|
|
77
|
+
rawResponse: _response.rawResponse,
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
if (_response.error.reason === "status-code") {
|
|
81
|
+
switch (_response.error.statusCode) {
|
|
82
|
+
case 401:
|
|
83
|
+
throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
84
|
+
case 403:
|
|
85
|
+
throw new FiveOneEat.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
86
|
+
case 404:
|
|
87
|
+
throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
|
|
88
|
+
case 422:
|
|
89
|
+
throw new FiveOneEat.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
90
|
+
default:
|
|
91
|
+
throw new errors.FiveOneEatError({
|
|
92
|
+
statusCode: _response.error.statusCode,
|
|
93
|
+
body: _response.error.body,
|
|
94
|
+
rawResponse: _response.rawResponse,
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/business/events/{event}/check-in/lookup");
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Decodes the base64 QR payload, validates the ticket's current status, marks it as used,
|
|
103
|
+
* and broadcasts the `ticket.checked-in` event via Reverb.
|
|
104
|
+
*
|
|
105
|
+
* Returns `409` if the ticket has already been checked in, `400` for refunded or otherwise
|
|
106
|
+
* invalid tickets.
|
|
107
|
+
*
|
|
108
|
+
* @param {FiveOneEat.business.events.ScanTicketRequest} request
|
|
109
|
+
* @param {CheckInClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
110
|
+
*
|
|
111
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
112
|
+
* @throws {@link FiveOneEat.ForbiddenError}
|
|
113
|
+
* @throws {@link FiveOneEat.NotFoundError}
|
|
114
|
+
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
115
|
+
*
|
|
116
|
+
* @example
|
|
117
|
+
* await client.business.events.checkIn.scan({
|
|
118
|
+
* event: "event",
|
|
119
|
+
* qr_data: "qr_data"
|
|
120
|
+
* })
|
|
121
|
+
*/
|
|
122
|
+
scan(request, requestOptions) {
|
|
123
|
+
return core.HttpResponsePromise.fromPromise(this.__scan(request, requestOptions));
|
|
124
|
+
}
|
|
125
|
+
__scan(request, requestOptions) {
|
|
126
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
127
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
128
|
+
const { event } = request, _body = __rest(request, ["event"]);
|
|
129
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
130
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
131
|
+
const _response = yield core.fetcher({
|
|
132
|
+
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`),
|
|
133
|
+
method: "POST",
|
|
134
|
+
headers: _headers,
|
|
135
|
+
contentType: "application/json",
|
|
136
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
137
|
+
requestType: "json",
|
|
138
|
+
body: _body,
|
|
139
|
+
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,
|
|
140
|
+
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,
|
|
141
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
142
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
143
|
+
logging: this._options.logging,
|
|
144
|
+
});
|
|
145
|
+
if (_response.ok) {
|
|
146
|
+
return {
|
|
147
|
+
data: _response.body,
|
|
148
|
+
rawResponse: _response.rawResponse,
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
if (_response.error.reason === "status-code") {
|
|
152
|
+
switch (_response.error.statusCode) {
|
|
153
|
+
case 401:
|
|
154
|
+
throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
155
|
+
case 403:
|
|
156
|
+
throw new FiveOneEat.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
157
|
+
case 404:
|
|
158
|
+
throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
|
|
159
|
+
case 422:
|
|
160
|
+
throw new FiveOneEat.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
161
|
+
default:
|
|
162
|
+
throw new errors.FiveOneEatError({
|
|
163
|
+
statusCode: _response.error.statusCode,
|
|
164
|
+
body: _response.error.body,
|
|
165
|
+
rawResponse: _response.rawResponse,
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/business/events/{event}/check-in/scan");
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Returns ticket counts and check-in rate for the event dashboard.
|
|
174
|
+
*
|
|
175
|
+
* @param {FiveOneEat.business.events.StatsCheckInRequest} request
|
|
176
|
+
* @param {CheckInClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
177
|
+
*
|
|
178
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
179
|
+
* @throws {@link FiveOneEat.ForbiddenError}
|
|
180
|
+
* @throws {@link FiveOneEat.NotFoundError}
|
|
181
|
+
*
|
|
182
|
+
* @example
|
|
183
|
+
* await client.business.events.checkIn.stats({
|
|
184
|
+
* event: "event"
|
|
185
|
+
* })
|
|
186
|
+
*/
|
|
187
|
+
stats(request, requestOptions) {
|
|
188
|
+
return core.HttpResponsePromise.fromPromise(this.__stats(request, requestOptions));
|
|
189
|
+
}
|
|
190
|
+
__stats(request, requestOptions) {
|
|
191
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
192
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
193
|
+
const { event } = request;
|
|
194
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
195
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
196
|
+
const _response = yield core.fetcher({
|
|
197
|
+
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`),
|
|
198
|
+
method: "GET",
|
|
199
|
+
headers: _headers,
|
|
200
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
201
|
+
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,
|
|
202
|
+
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,
|
|
203
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
204
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
205
|
+
logging: this._options.logging,
|
|
206
|
+
});
|
|
207
|
+
if (_response.ok) {
|
|
208
|
+
return {
|
|
209
|
+
data: _response.body,
|
|
210
|
+
rawResponse: _response.rawResponse,
|
|
211
|
+
};
|
|
212
|
+
}
|
|
213
|
+
if (_response.error.reason === "status-code") {
|
|
214
|
+
switch (_response.error.statusCode) {
|
|
215
|
+
case 401:
|
|
216
|
+
throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
217
|
+
case 403:
|
|
218
|
+
throw new FiveOneEat.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
219
|
+
case 404:
|
|
220
|
+
throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
|
|
221
|
+
default:
|
|
222
|
+
throw new errors.FiveOneEatError({
|
|
223
|
+
statusCode: _response.error.statusCode,
|
|
224
|
+
body: _response.error.body,
|
|
225
|
+
rawResponse: _response.rawResponse,
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/business/events/{event}/check-in/stats");
|
|
230
|
+
});
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* Returns checked-in tickets ordered by check-in time descending.
|
|
234
|
+
* Accepts an optional `limit` query param (default `20`, max `100`).
|
|
235
|
+
*
|
|
236
|
+
* @param {FiveOneEat.business.events.RecentCheckInRequest} request
|
|
237
|
+
* @param {CheckInClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
238
|
+
*
|
|
239
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
240
|
+
* @throws {@link FiveOneEat.ForbiddenError}
|
|
241
|
+
* @throws {@link FiveOneEat.NotFoundError}
|
|
242
|
+
*
|
|
243
|
+
* @example
|
|
244
|
+
* await client.business.events.checkIn.recent({
|
|
245
|
+
* event: "event"
|
|
246
|
+
* })
|
|
247
|
+
*/
|
|
248
|
+
recent(request, requestOptions) {
|
|
249
|
+
return core.HttpResponsePromise.fromPromise(this.__recent(request, requestOptions));
|
|
250
|
+
}
|
|
251
|
+
__recent(request, requestOptions) {
|
|
252
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
253
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
254
|
+
const { event } = request;
|
|
255
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
256
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
257
|
+
const _response = yield core.fetcher({
|
|
258
|
+
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`),
|
|
259
|
+
method: "GET",
|
|
260
|
+
headers: _headers,
|
|
261
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
262
|
+
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,
|
|
263
|
+
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,
|
|
264
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
265
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
266
|
+
logging: this._options.logging,
|
|
267
|
+
});
|
|
268
|
+
if (_response.ok) {
|
|
269
|
+
return {
|
|
270
|
+
data: _response.body,
|
|
271
|
+
rawResponse: _response.rawResponse,
|
|
272
|
+
};
|
|
273
|
+
}
|
|
274
|
+
if (_response.error.reason === "status-code") {
|
|
275
|
+
switch (_response.error.statusCode) {
|
|
276
|
+
case 401:
|
|
277
|
+
throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
278
|
+
case 403:
|
|
279
|
+
throw new FiveOneEat.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
280
|
+
case 404:
|
|
281
|
+
throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
|
|
282
|
+
default:
|
|
283
|
+
throw new errors.FiveOneEatError({
|
|
284
|
+
statusCode: _response.error.statusCode,
|
|
285
|
+
body: _response.error.body,
|
|
286
|
+
rawResponse: _response.rawResponse,
|
|
287
|
+
});
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/business/events/{event}/check-in/recent");
|
|
291
|
+
});
|
|
292
|
+
}
|
|
293
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./requests/index.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./requests/index.mjs";
|