@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.
- package/dist/cjs/BaseClient.js +2 -2
- package/dist/cjs/api/resources/business/resources/events/resources/checkIn/client/Client.d.ts +43 -9
- package/dist/cjs/api/resources/business/resources/events/resources/checkIn/client/Client.js +134 -30
- 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/RecentCheckInRequest.d.ts +1 -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/StatsCheckInRequest.d.ts +1 -0
- package/dist/cjs/api/resources/business/resources/events/resources/checkIn/client/requests/index.d.ts +2 -2
- package/dist/cjs/api/resources/business/resources/events/resources/checkIn/index.d.ts +1 -0
- package/dist/cjs/api/resources/business/resources/events/resources/checkIn/index.js +1 -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 +1 -0
- package/dist/cjs/api/resources/business/resources/events/resources/index.js +1 -0
- 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/resources/checkIn/client/Client.d.mts +43 -9
- package/dist/esm/api/resources/business/resources/events/resources/checkIn/client/Client.mjs +134 -30
- 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/RecentCheckInRequest.d.mts +1 -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/StatsCheckInRequest.d.mts +1 -0
- package/dist/esm/api/resources/business/resources/events/resources/checkIn/client/requests/index.d.mts +2 -2
- package/dist/esm/api/resources/business/resources/events/resources/checkIn/index.d.mts +1 -0
- package/dist/esm/api/resources/business/resources/events/resources/checkIn/index.mjs +1 -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 +1 -0
- package/dist/esm/api/resources/business/resources/events/resources/index.mjs +1 -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 +1 -1
- package/reference.md +72 -8
- package/dist/cjs/api/resources/business/resources/events/resources/checkIn/client/requests/LookupCheckInRequest.d.ts +0 -9
- package/dist/cjs/api/resources/business/resources/events/resources/checkIn/client/requests/ScanCheckInRequest.d.ts +0 -9
- package/dist/esm/api/resources/business/resources/events/resources/checkIn/client/requests/LookupCheckInRequest.d.mts +0 -9
- package/dist/esm/api/resources/business/resources/events/resources/checkIn/client/requests/ScanCheckInRequest.d.mts +0 -9
- /package/dist/cjs/api/resources/business/resources/events/resources/checkIn/client/requests/{LookupCheckInRequest.js → LookupTicketRequest.js} +0 -0
- /package/dist/cjs/api/resources/business/resources/events/resources/checkIn/client/requests/{ScanCheckInRequest.js → ScanTicketRequest.js} +0 -0
- /package/dist/esm/api/resources/business/resources/events/resources/checkIn/client/requests/{LookupCheckInRequest.mjs → LookupTicketRequest.mjs} +0 -0
- /package/dist/esm/api/resources/business/resources/events/resources/checkIn/client/requests/{ScanCheckInRequest.mjs → ScanTicketRequest.mjs} +0 -0
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);
|
package/dist/esm/api/resources/business/resources/events/resources/checkIn/client/Client.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../../../BaseClient.mjs";
|
|
2
2
|
import { type NormalizedClientOptionsWithAuth } from "../../../../../../../../BaseClient.mjs";
|
|
3
3
|
import * as core from "../../../../../../../../core/index.mjs";
|
|
4
|
-
import
|
|
4
|
+
import * as FiveOneEat from "../../../../../../../index.mjs";
|
|
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
|
-
*
|
|
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.
|
|
31
|
+
lookup(request: FiveOneEat.business.events.LookupTicketRequest, requestOptions?: CheckInClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.business.events.LookupCheckInResponse>;
|
|
23
32
|
private __lookup;
|
|
24
33
|
/**
|
|
25
|
-
*
|
|
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.
|
|
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<
|
|
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<
|
|
89
|
+
recent(request: FiveOneEat.business.events.RecentCheckInRequest, requestOptions?: CheckInClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.business.events.RecentCheckInResponse>;
|
|
56
90
|
private __recent;
|
|
57
91
|
}
|
package/dist/esm/api/resources/business/resources/events/resources/checkIn/client/Client.mjs
CHANGED
|
@@ -8,23 +8,44 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
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
|
+
};
|
|
11
22
|
import { normalizeClientOptionsWithAuth, } from "../../../../../../../../BaseClient.mjs";
|
|
12
23
|
import { mergeHeaders } from "../../../../../../../../core/headers.mjs";
|
|
13
24
|
import * as core from "../../../../../../../../core/index.mjs";
|
|
14
25
|
import * as environments from "../../../../../../../../environments.mjs";
|
|
15
26
|
import { handleNonStatusCodeError } from "../../../../../../../../errors/handleNonStatusCodeError.mjs";
|
|
16
27
|
import * as errors from "../../../../../../../../errors/index.mjs";
|
|
28
|
+
import * as FiveOneEat from "../../../../../../../index.mjs";
|
|
17
29
|
export class CheckInClient {
|
|
18
30
|
constructor(options = {}) {
|
|
19
31
|
this._options = normalizeClientOptionsWithAuth(options);
|
|
20
32
|
}
|
|
21
33
|
/**
|
|
22
|
-
*
|
|
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
|
|
23
38
|
* @param {CheckInClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
24
39
|
*
|
|
40
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
41
|
+
* @throws {@link FiveOneEat.ForbiddenError}
|
|
42
|
+
* @throws {@link FiveOneEat.NotFoundError}
|
|
43
|
+
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
44
|
+
*
|
|
25
45
|
* @example
|
|
26
46
|
* await client.business.events.checkIn.lookup({
|
|
27
|
-
* event: "event"
|
|
47
|
+
* event: "event",
|
|
48
|
+
* qr_data: "qr_data"
|
|
28
49
|
* })
|
|
29
50
|
*/
|
|
30
51
|
lookup(request, requestOptions) {
|
|
@@ -33,14 +54,17 @@ export class CheckInClient {
|
|
|
33
54
|
__lookup(request, requestOptions) {
|
|
34
55
|
return __awaiter(this, void 0, void 0, function* () {
|
|
35
56
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
36
|
-
const { event } = request;
|
|
57
|
+
const { event } = request, _body = __rest(request, ["event"]);
|
|
37
58
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
38
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);
|
|
39
60
|
const _response = yield core.fetcher({
|
|
40
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`),
|
|
41
62
|
method: "POST",
|
|
42
63
|
headers: _headers,
|
|
64
|
+
contentType: "application/json",
|
|
43
65
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
66
|
+
requestType: "json",
|
|
67
|
+
body: _body,
|
|
44
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,
|
|
45
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,
|
|
46
70
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -48,25 +72,51 @@ export class CheckInClient {
|
|
|
48
72
|
logging: this._options.logging,
|
|
49
73
|
});
|
|
50
74
|
if (_response.ok) {
|
|
51
|
-
return {
|
|
75
|
+
return {
|
|
76
|
+
data: _response.body,
|
|
77
|
+
rawResponse: _response.rawResponse,
|
|
78
|
+
};
|
|
52
79
|
}
|
|
53
80
|
if (_response.error.reason === "status-code") {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
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
|
+
}
|
|
59
97
|
}
|
|
60
98
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/business/events/{event}/check-in/lookup");
|
|
61
99
|
});
|
|
62
100
|
}
|
|
63
101
|
/**
|
|
64
|
-
*
|
|
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
|
|
65
109
|
* @param {CheckInClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
66
110
|
*
|
|
111
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
112
|
+
* @throws {@link FiveOneEat.ForbiddenError}
|
|
113
|
+
* @throws {@link FiveOneEat.NotFoundError}
|
|
114
|
+
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
115
|
+
*
|
|
67
116
|
* @example
|
|
68
117
|
* await client.business.events.checkIn.scan({
|
|
69
|
-
* event: "event"
|
|
118
|
+
* event: "event",
|
|
119
|
+
* qr_data: "qr_data"
|
|
70
120
|
* })
|
|
71
121
|
*/
|
|
72
122
|
scan(request, requestOptions) {
|
|
@@ -75,14 +125,17 @@ export class CheckInClient {
|
|
|
75
125
|
__scan(request, requestOptions) {
|
|
76
126
|
return __awaiter(this, void 0, void 0, function* () {
|
|
77
127
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
78
|
-
const { event } = request;
|
|
128
|
+
const { event } = request, _body = __rest(request, ["event"]);
|
|
79
129
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
80
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);
|
|
81
131
|
const _response = yield core.fetcher({
|
|
82
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`),
|
|
83
133
|
method: "POST",
|
|
84
134
|
headers: _headers,
|
|
135
|
+
contentType: "application/json",
|
|
85
136
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
137
|
+
requestType: "json",
|
|
138
|
+
body: _body,
|
|
86
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,
|
|
87
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,
|
|
88
141
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -90,22 +143,42 @@ export class CheckInClient {
|
|
|
90
143
|
logging: this._options.logging,
|
|
91
144
|
});
|
|
92
145
|
if (_response.ok) {
|
|
93
|
-
return {
|
|
146
|
+
return {
|
|
147
|
+
data: _response.body,
|
|
148
|
+
rawResponse: _response.rawResponse,
|
|
149
|
+
};
|
|
94
150
|
}
|
|
95
151
|
if (_response.error.reason === "status-code") {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
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
|
+
}
|
|
101
168
|
}
|
|
102
169
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/business/events/{event}/check-in/scan");
|
|
103
170
|
});
|
|
104
171
|
}
|
|
105
172
|
/**
|
|
173
|
+
* Returns ticket counts and check-in rate for the event dashboard.
|
|
174
|
+
*
|
|
106
175
|
* @param {FiveOneEat.business.events.StatsCheckInRequest} request
|
|
107
176
|
* @param {CheckInClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
108
177
|
*
|
|
178
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
179
|
+
* @throws {@link FiveOneEat.ForbiddenError}
|
|
180
|
+
* @throws {@link FiveOneEat.NotFoundError}
|
|
181
|
+
*
|
|
109
182
|
* @example
|
|
110
183
|
* await client.business.events.checkIn.stats({
|
|
111
184
|
* event: "event"
|
|
@@ -132,22 +205,41 @@ export class CheckInClient {
|
|
|
132
205
|
logging: this._options.logging,
|
|
133
206
|
});
|
|
134
207
|
if (_response.ok) {
|
|
135
|
-
return {
|
|
208
|
+
return {
|
|
209
|
+
data: _response.body,
|
|
210
|
+
rawResponse: _response.rawResponse,
|
|
211
|
+
};
|
|
136
212
|
}
|
|
137
213
|
if (_response.error.reason === "status-code") {
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
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
|
+
}
|
|
143
228
|
}
|
|
144
229
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/business/events/{event}/check-in/stats");
|
|
145
230
|
});
|
|
146
231
|
}
|
|
147
232
|
/**
|
|
233
|
+
* Returns checked-in tickets ordered by check-in time descending.
|
|
234
|
+
* Accepts an optional `limit` query param (default `20`, max `100`).
|
|
235
|
+
*
|
|
148
236
|
* @param {FiveOneEat.business.events.RecentCheckInRequest} request
|
|
149
237
|
* @param {CheckInClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
150
238
|
*
|
|
239
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
240
|
+
* @throws {@link FiveOneEat.ForbiddenError}
|
|
241
|
+
* @throws {@link FiveOneEat.NotFoundError}
|
|
242
|
+
*
|
|
151
243
|
* @example
|
|
152
244
|
* await client.business.events.checkIn.recent({
|
|
153
245
|
* event: "event"
|
|
@@ -174,14 +266,26 @@ export class CheckInClient {
|
|
|
174
266
|
logging: this._options.logging,
|
|
175
267
|
});
|
|
176
268
|
if (_response.ok) {
|
|
177
|
-
return {
|
|
269
|
+
return {
|
|
270
|
+
data: _response.body,
|
|
271
|
+
rawResponse: _response.rawResponse,
|
|
272
|
+
};
|
|
178
273
|
}
|
|
179
274
|
if (_response.error.reason === "status-code") {
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
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
|
+
}
|
|
185
289
|
}
|
|
186
290
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/business/events/{event}/check-in/recent");
|
|
187
291
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type {
|
|
1
|
+
export type { LookupTicketRequest } from "./LookupTicketRequest.mjs";
|
|
2
2
|
export type { RecentCheckInRequest } from "./RecentCheckInRequest.mjs";
|
|
3
|
-
export type {
|
|
3
|
+
export type { ScanTicketRequest } from "./ScanTicketRequest.mjs";
|
|
4
4
|
export type { StatsCheckInRequest } from "./StatsCheckInRequest.mjs";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export * from "./checkIn/client/requests/index.mjs";
|
|
2
2
|
export * as checkIn from "./checkIn/index.mjs";
|
|
3
|
+
export * from "./checkIn/types/index.mjs";
|
|
3
4
|
export * from "./orders/client/requests/index.mjs";
|
|
4
5
|
export * as orders from "./orders/index.mjs";
|
|
5
6
|
export * from "./orders/types/index.mjs";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export * from "./checkIn/client/requests/index.mjs";
|
|
2
2
|
export * as checkIn from "./checkIn/index.mjs";
|
|
3
|
+
export * from "./checkIn/types/index.mjs";
|
|
3
4
|
export * from "./orders/client/requests/index.mjs";
|
|
4
5
|
export * as orders from "./orders/index.mjs";
|
|
5
6
|
export * from "./orders/types/index.mjs";
|
|
@@ -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.mjs";
|
|
|
31
31
|
export * from "./BusinessCuisine.mjs";
|
|
32
32
|
export * from "./BusinessEvent.mjs";
|
|
33
33
|
export * from "./BusinessEventAttendee.mjs";
|
|
34
|
+
export * from "./BusinessEventCheckIn.mjs";
|
|
35
|
+
export * from "./BusinessEventCheckInStats.mjs";
|
|
36
|
+
export * from "./BusinessEventCheckInTicket.mjs";
|
|
34
37
|
export * from "./BusinessEventOrder.mjs";
|
|
35
38
|
export * from "./BusinessEventOrderDetail.mjs";
|
|
36
39
|
export * from "./BusinessEventRsvp.mjs";
|
|
@@ -31,6 +31,9 @@ export * from "./BusinessConversation.mjs";
|
|
|
31
31
|
export * from "./BusinessCuisine.mjs";
|
|
32
32
|
export * from "./BusinessEvent.mjs";
|
|
33
33
|
export * from "./BusinessEventAttendee.mjs";
|
|
34
|
+
export * from "./BusinessEventCheckIn.mjs";
|
|
35
|
+
export * from "./BusinessEventCheckInStats.mjs";
|
|
36
|
+
export * from "./BusinessEventCheckInTicket.mjs";
|
|
34
37
|
export * from "./BusinessEventOrder.mjs";
|
|
35
38
|
export * from "./BusinessEventOrderDetail.mjs";
|
|
36
39
|
export * from "./BusinessEventRsvp.mjs";
|
package/dist/esm/version.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.0.
|
|
1
|
+
export declare const SDK_VERSION = "0.0.36";
|
package/dist/esm/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "0.0.
|
|
1
|
+
export const SDK_VERSION = "0.0.36";
|