@51eat/sdk 0.0.15 → 0.0.17
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/Client.d.ts +3 -0
- package/dist/cjs/Client.js +11 -6
- package/dist/cjs/api/resources/authentication/client/Client.d.ts +2 -1
- package/dist/cjs/api/resources/authentication/client/Client.js +8 -4
- package/dist/cjs/api/resources/authentication/client/requests/LogoutCurrentRequest.d.ts +7 -0
- package/dist/cjs/api/resources/authentication/client/requests/LogoutCurrentRequest.js +3 -0
- package/dist/cjs/api/resources/authentication/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/index.d.ts +3 -0
- package/dist/cjs/api/resources/index.js +4 -1
- package/dist/cjs/api/resources/pushNotifications/client/Client.d.ts +46 -0
- package/dist/cjs/api/resources/pushNotifications/client/Client.js +178 -0
- package/dist/cjs/api/resources/pushNotifications/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/pushNotifications/client/index.js +17 -0
- package/dist/cjs/api/resources/pushNotifications/client/requests/StorePushTokenRequest.d.ts +19 -0
- package/dist/cjs/api/resources/pushNotifications/client/requests/StorePushTokenRequest.js +11 -0
- package/dist/cjs/api/resources/pushNotifications/client/requests/UnregisterPushTokenRequest.d.ts +9 -0
- package/dist/cjs/api/resources/pushNotifications/client/requests/UnregisterPushTokenRequest.js +3 -0
- package/dist/cjs/api/resources/pushNotifications/client/requests/index.d.ts +2 -0
- package/dist/cjs/api/resources/pushNotifications/client/requests/index.js +5 -0
- package/dist/cjs/api/resources/pushNotifications/exports.d.ts +2 -0
- package/dist/cjs/api/resources/pushNotifications/exports.js +21 -0
- package/dist/cjs/api/resources/pushNotifications/index.d.ts +2 -0
- package/dist/cjs/api/resources/pushNotifications/index.js +18 -0
- package/dist/cjs/api/resources/pushNotifications/types/RegisterPushTokenResponse.d.ts +7 -0
- package/dist/cjs/api/resources/pushNotifications/types/RegisterPushTokenResponse.js +3 -0
- package/dist/cjs/api/resources/pushNotifications/types/index.d.ts +1 -0
- package/dist/cjs/api/resources/pushNotifications/types/index.js +17 -0
- package/dist/cjs/api/types/MessageResource.d.ts +1 -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/Client.d.mts +3 -0
- package/dist/esm/Client.mjs +5 -0
- package/dist/esm/api/resources/authentication/client/Client.d.mts +2 -1
- package/dist/esm/api/resources/authentication/client/Client.mjs +8 -4
- package/dist/esm/api/resources/authentication/client/requests/LogoutCurrentRequest.d.mts +7 -0
- package/dist/esm/api/resources/authentication/client/requests/LogoutCurrentRequest.mjs +2 -0
- package/dist/esm/api/resources/authentication/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/index.d.mts +3 -0
- package/dist/esm/api/resources/index.mjs +3 -0
- package/dist/esm/api/resources/pushNotifications/client/Client.d.mts +46 -0
- package/dist/esm/api/resources/pushNotifications/client/Client.mjs +141 -0
- package/dist/esm/api/resources/pushNotifications/client/index.d.mts +1 -0
- package/dist/esm/api/resources/pushNotifications/client/index.mjs +1 -0
- package/dist/esm/api/resources/pushNotifications/client/requests/StorePushTokenRequest.d.mts +19 -0
- package/dist/esm/api/resources/pushNotifications/client/requests/StorePushTokenRequest.mjs +8 -0
- package/dist/esm/api/resources/pushNotifications/client/requests/UnregisterPushTokenRequest.d.mts +9 -0
- package/dist/esm/api/resources/pushNotifications/client/requests/UnregisterPushTokenRequest.mjs +2 -0
- package/dist/esm/api/resources/pushNotifications/client/requests/index.d.mts +2 -0
- package/dist/esm/api/resources/pushNotifications/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/pushNotifications/exports.d.mts +2 -0
- package/dist/esm/api/resources/pushNotifications/exports.mjs +3 -0
- package/dist/esm/api/resources/pushNotifications/index.d.mts +2 -0
- package/dist/esm/api/resources/pushNotifications/index.mjs +2 -0
- package/dist/esm/api/resources/pushNotifications/types/RegisterPushTokenResponse.d.mts +7 -0
- package/dist/esm/api/resources/pushNotifications/types/RegisterPushTokenResponse.mjs +2 -0
- package/dist/esm/api/resources/pushNotifications/types/index.d.mts +1 -0
- package/dist/esm/api/resources/pushNotifications/types/index.mjs +1 -0
- package/dist/esm/api/types/MessageResource.d.mts +1 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +12 -1
- package/reference.md +141 -1
package/dist/cjs/BaseClient.js
CHANGED
|
@@ -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.
|
|
47
|
-
"User-Agent": "@51eat/sdk/0.0.
|
|
46
|
+
"X-Fern-SDK-Version": "0.0.17",
|
|
47
|
+
"User-Agent": "@51eat/sdk/0.0.17",
|
|
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);
|
package/dist/cjs/Client.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ import { DiscoveryClient } from "./api/resources/discovery/client/Client.js";
|
|
|
8
8
|
import { EditorialsClient } from "./api/resources/editorials/client/Client.js";
|
|
9
9
|
import { EventsClient } from "./api/resources/events/client/Client.js";
|
|
10
10
|
import { MyAccountClient } from "./api/resources/myAccount/client/Client.js";
|
|
11
|
+
import { PushNotificationsClient } from "./api/resources/pushNotifications/client/Client.js";
|
|
11
12
|
import { RecordClickClient } from "./api/resources/recordClick/client/Client.js";
|
|
12
13
|
import { ServeAdClient } from "./api/resources/serveAd/client/Client.js";
|
|
13
14
|
import { TicketingClient } from "./api/resources/ticketing/client/Client.js";
|
|
@@ -30,6 +31,7 @@ export declare class FiveOneEatClient {
|
|
|
30
31
|
protected _editorials: EditorialsClient | undefined;
|
|
31
32
|
protected _events: EventsClient | undefined;
|
|
32
33
|
protected _myAccount: MyAccountClient | undefined;
|
|
34
|
+
protected _pushNotifications: PushNotificationsClient | undefined;
|
|
33
35
|
protected _ticketing: TicketingClient | undefined;
|
|
34
36
|
protected _recordClick: RecordClickClient | undefined;
|
|
35
37
|
protected _serveAd: ServeAdClient | undefined;
|
|
@@ -43,6 +45,7 @@ export declare class FiveOneEatClient {
|
|
|
43
45
|
get editorials(): EditorialsClient;
|
|
44
46
|
get events(): EventsClient;
|
|
45
47
|
get myAccount(): MyAccountClient;
|
|
48
|
+
get pushNotifications(): PushNotificationsClient;
|
|
46
49
|
get ticketing(): TicketingClient;
|
|
47
50
|
get recordClick(): RecordClickClient;
|
|
48
51
|
get serveAd(): ServeAdClient;
|
package/dist/cjs/Client.js
CHANGED
|
@@ -54,9 +54,10 @@ const Client_js_6 = require("./api/resources/discovery/client/Client.js");
|
|
|
54
54
|
const Client_js_7 = require("./api/resources/editorials/client/Client.js");
|
|
55
55
|
const Client_js_8 = require("./api/resources/events/client/Client.js");
|
|
56
56
|
const Client_js_9 = require("./api/resources/myAccount/client/Client.js");
|
|
57
|
-
const Client_js_10 = require("./api/resources/
|
|
58
|
-
const Client_js_11 = require("./api/resources/
|
|
59
|
-
const Client_js_12 = require("./api/resources/
|
|
57
|
+
const Client_js_10 = require("./api/resources/pushNotifications/client/Client.js");
|
|
58
|
+
const Client_js_11 = require("./api/resources/recordClick/client/Client.js");
|
|
59
|
+
const Client_js_12 = require("./api/resources/serveAd/client/Client.js");
|
|
60
|
+
const Client_js_13 = require("./api/resources/ticketing/client/Client.js");
|
|
60
61
|
const BaseClient_js_1 = require("./BaseClient.js");
|
|
61
62
|
const headers_js_1 = require("./core/headers.js");
|
|
62
63
|
const core = __importStar(require("./core/index.js"));
|
|
@@ -104,17 +105,21 @@ class FiveOneEatClient {
|
|
|
104
105
|
var _a;
|
|
105
106
|
return ((_a = this._myAccount) !== null && _a !== void 0 ? _a : (this._myAccount = new Client_js_9.MyAccountClient(this._options)));
|
|
106
107
|
}
|
|
108
|
+
get pushNotifications() {
|
|
109
|
+
var _a;
|
|
110
|
+
return ((_a = this._pushNotifications) !== null && _a !== void 0 ? _a : (this._pushNotifications = new Client_js_10.PushNotificationsClient(this._options)));
|
|
111
|
+
}
|
|
107
112
|
get ticketing() {
|
|
108
113
|
var _a;
|
|
109
|
-
return ((_a = this._ticketing) !== null && _a !== void 0 ? _a : (this._ticketing = new
|
|
114
|
+
return ((_a = this._ticketing) !== null && _a !== void 0 ? _a : (this._ticketing = new Client_js_13.TicketingClient(this._options)));
|
|
110
115
|
}
|
|
111
116
|
get recordClick() {
|
|
112
117
|
var _a;
|
|
113
|
-
return ((_a = this._recordClick) !== null && _a !== void 0 ? _a : (this._recordClick = new
|
|
118
|
+
return ((_a = this._recordClick) !== null && _a !== void 0 ? _a : (this._recordClick = new Client_js_11.RecordClickClient(this._options)));
|
|
114
119
|
}
|
|
115
120
|
get serveAd() {
|
|
116
121
|
var _a;
|
|
117
|
-
return ((_a = this._serveAd) !== null && _a !== void 0 ? _a : (this._serveAd = new
|
|
122
|
+
return ((_a = this._serveAd) !== null && _a !== void 0 ? _a : (this._serveAd = new Client_js_12.ServeAdClient(this._options)));
|
|
118
123
|
}
|
|
119
124
|
/**
|
|
120
125
|
* Returns grouped results for each type. Use per_type to control how many results
|
|
@@ -61,6 +61,7 @@ export declare class AuthenticationClient {
|
|
|
61
61
|
/**
|
|
62
62
|
* Revoke the current API token and log out the user.
|
|
63
63
|
*
|
|
64
|
+
* @param {FiveOneEat.LogoutCurrentRequest} request
|
|
64
65
|
* @param {AuthenticationClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
65
66
|
*
|
|
66
67
|
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
@@ -68,7 +69,7 @@ export declare class AuthenticationClient {
|
|
|
68
69
|
* @example
|
|
69
70
|
* await client.authentication.logoutCurrent()
|
|
70
71
|
*/
|
|
71
|
-
logoutCurrent(requestOptions?: AuthenticationClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.LogoutCurrentResponse>;
|
|
72
|
+
logoutCurrent(request?: FiveOneEat.LogoutCurrentRequest, requestOptions?: AuthenticationClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.LogoutCurrentResponse>;
|
|
72
73
|
private __logoutCurrent;
|
|
73
74
|
/**
|
|
74
75
|
* Revoke all API tokens for the authenticated user.
|
|
@@ -215,6 +215,7 @@ class AuthenticationClient {
|
|
|
215
215
|
/**
|
|
216
216
|
* Revoke the current API token and log out the user.
|
|
217
217
|
*
|
|
218
|
+
* @param {FiveOneEat.LogoutCurrentRequest} request
|
|
218
219
|
* @param {AuthenticationClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
219
220
|
*
|
|
220
221
|
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
@@ -222,11 +223,11 @@ class AuthenticationClient {
|
|
|
222
223
|
* @example
|
|
223
224
|
* await client.authentication.logoutCurrent()
|
|
224
225
|
*/
|
|
225
|
-
logoutCurrent(requestOptions) {
|
|
226
|
-
return core.HttpResponsePromise.fromPromise(this.__logoutCurrent(requestOptions));
|
|
226
|
+
logoutCurrent(request = {}, requestOptions) {
|
|
227
|
+
return core.HttpResponsePromise.fromPromise(this.__logoutCurrent(request, requestOptions));
|
|
227
228
|
}
|
|
228
|
-
__logoutCurrent(
|
|
229
|
-
return __awaiter(this,
|
|
229
|
+
__logoutCurrent() {
|
|
230
|
+
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
230
231
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
231
232
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
232
233
|
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);
|
|
@@ -234,7 +235,10 @@ class AuthenticationClient {
|
|
|
234
235
|
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.FiveOneEatEnvironment.Production, "customer/logout"),
|
|
235
236
|
method: "POST",
|
|
236
237
|
headers: _headers,
|
|
238
|
+
contentType: "application/json",
|
|
237
239
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
240
|
+
requestType: "json",
|
|
241
|
+
body: request,
|
|
238
242
|
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,
|
|
239
243
|
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,
|
|
240
244
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export type { LoginCustomerRequest } from "./LoginCustomerRequest.js";
|
|
2
|
+
export type { LogoutCurrentRequest } from "./LogoutCurrentRequest.js";
|
|
2
3
|
export type { RegisterCustomerRequest } from "./RegisterCustomerRequest.js";
|
|
3
4
|
export type { RevokeTokenRequest } from "./RevokeTokenRequest.js";
|
|
@@ -24,6 +24,9 @@ export * from "./events/types/index.js";
|
|
|
24
24
|
export * from "./myAccount/client/requests/index.js";
|
|
25
25
|
export * as myAccount from "./myAccount/index.js";
|
|
26
26
|
export * from "./myAccount/types/index.js";
|
|
27
|
+
export * from "./pushNotifications/client/requests/index.js";
|
|
28
|
+
export * as pushNotifications from "./pushNotifications/index.js";
|
|
29
|
+
export * from "./pushNotifications/types/index.js";
|
|
27
30
|
export * from "./recordClick/client/requests/index.js";
|
|
28
31
|
export * as recordClick from "./recordClick/index.js";
|
|
29
32
|
export * from "./serveAd/client/requests/index.js";
|
|
@@ -36,7 +36,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
36
36
|
};
|
|
37
37
|
})();
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.ticketing = exports.serveAd = exports.recordClick = exports.myAccount = exports.events = exports.editorials = exports.discovery = exports.customerMessaging = exports.businessProfiles = exports.businessContent = exports.broadcasting = exports.authentication = void 0;
|
|
39
|
+
exports.ticketing = exports.serveAd = exports.recordClick = exports.pushNotifications = exports.myAccount = exports.events = exports.editorials = exports.discovery = exports.customerMessaging = exports.businessProfiles = exports.businessContent = exports.broadcasting = exports.authentication = void 0;
|
|
40
40
|
__exportStar(require("./authentication/client/requests/index.js"), exports);
|
|
41
41
|
exports.authentication = __importStar(require("./authentication/index.js"));
|
|
42
42
|
__exportStar(require("./authentication/types/index.js"), exports);
|
|
@@ -63,6 +63,9 @@ __exportStar(require("./events/types/index.js"), exports);
|
|
|
63
63
|
__exportStar(require("./myAccount/client/requests/index.js"), exports);
|
|
64
64
|
exports.myAccount = __importStar(require("./myAccount/index.js"));
|
|
65
65
|
__exportStar(require("./myAccount/types/index.js"), exports);
|
|
66
|
+
__exportStar(require("./pushNotifications/client/requests/index.js"), exports);
|
|
67
|
+
exports.pushNotifications = __importStar(require("./pushNotifications/index.js"));
|
|
68
|
+
__exportStar(require("./pushNotifications/types/index.js"), exports);
|
|
66
69
|
__exportStar(require("./recordClick/client/requests/index.js"), exports);
|
|
67
70
|
exports.recordClick = __importStar(require("./recordClick/index.js"));
|
|
68
71
|
__exportStar(require("./serveAd/client/requests/index.js"), exports);
|
|
@@ -0,0 +1,46 @@
|
|
|
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 PushNotificationsClient {
|
|
6
|
+
type Options = BaseClientOptions;
|
|
7
|
+
interface RequestOptions extends BaseRequestOptions {
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
export declare class PushNotificationsClient {
|
|
11
|
+
protected readonly _options: NormalizedClientOptionsWithAuth<PushNotificationsClient.Options>;
|
|
12
|
+
constructor(options?: PushNotificationsClient.Options);
|
|
13
|
+
/**
|
|
14
|
+
* Register (or update) the authenticated user's Expo push token for a device. If
|
|
15
|
+
* a `device_id` is provided, an existing registration for that device is updated.
|
|
16
|
+
*
|
|
17
|
+
* @param {FiveOneEat.StorePushTokenRequest} request
|
|
18
|
+
* @param {PushNotificationsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
19
|
+
*
|
|
20
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
21
|
+
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* await client.pushNotifications.registerPushToken({
|
|
25
|
+
* token: "token"
|
|
26
|
+
* })
|
|
27
|
+
*/
|
|
28
|
+
registerPushToken(request: FiveOneEat.StorePushTokenRequest, requestOptions?: PushNotificationsClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.RegisterPushTokenResponse>;
|
|
29
|
+
private __registerPushToken;
|
|
30
|
+
/**
|
|
31
|
+
* Delete the authenticated user's Expo push token registration.
|
|
32
|
+
*
|
|
33
|
+
* @param {FiveOneEat.UnregisterPushTokenRequest} request
|
|
34
|
+
* @param {PushNotificationsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
35
|
+
*
|
|
36
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
37
|
+
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* await client.pushNotifications.unregisterPushToken({
|
|
41
|
+
* token: "token"
|
|
42
|
+
* })
|
|
43
|
+
*/
|
|
44
|
+
unregisterPushToken(request: FiveOneEat.UnregisterPushTokenRequest, requestOptions?: PushNotificationsClient.RequestOptions): core.HttpResponsePromise<void>;
|
|
45
|
+
private __unregisterPushToken;
|
|
46
|
+
}
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
+
var ownKeys = function(o) {
|
|
21
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
+
var ar = [];
|
|
23
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
+
return ar;
|
|
25
|
+
};
|
|
26
|
+
return ownKeys(o);
|
|
27
|
+
};
|
|
28
|
+
return function (mod) {
|
|
29
|
+
if (mod && mod.__esModule) return mod;
|
|
30
|
+
var result = {};
|
|
31
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
+
__setModuleDefault(result, mod);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
36
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
37
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
38
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
39
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
40
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
41
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
42
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
43
|
+
});
|
|
44
|
+
};
|
|
45
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
46
|
+
exports.PushNotificationsClient = void 0;
|
|
47
|
+
const BaseClient_js_1 = require("../../../../BaseClient.js");
|
|
48
|
+
const headers_js_1 = require("../../../../core/headers.js");
|
|
49
|
+
const core = __importStar(require("../../../../core/index.js"));
|
|
50
|
+
const environments = __importStar(require("../../../../environments.js"));
|
|
51
|
+
const handleNonStatusCodeError_js_1 = require("../../../../errors/handleNonStatusCodeError.js");
|
|
52
|
+
const errors = __importStar(require("../../../../errors/index.js"));
|
|
53
|
+
const FiveOneEat = __importStar(require("../../../index.js"));
|
|
54
|
+
class PushNotificationsClient {
|
|
55
|
+
constructor(options = {}) {
|
|
56
|
+
this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Register (or update) the authenticated user's Expo push token for a device. If
|
|
60
|
+
* a `device_id` is provided, an existing registration for that device is updated.
|
|
61
|
+
*
|
|
62
|
+
* @param {FiveOneEat.StorePushTokenRequest} request
|
|
63
|
+
* @param {PushNotificationsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
64
|
+
*
|
|
65
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
66
|
+
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
67
|
+
*
|
|
68
|
+
* @example
|
|
69
|
+
* await client.pushNotifications.registerPushToken({
|
|
70
|
+
* token: "token"
|
|
71
|
+
* })
|
|
72
|
+
*/
|
|
73
|
+
registerPushToken(request, requestOptions) {
|
|
74
|
+
return core.HttpResponsePromise.fromPromise(this.__registerPushToken(request, requestOptions));
|
|
75
|
+
}
|
|
76
|
+
__registerPushToken(request, requestOptions) {
|
|
77
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
78
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
79
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
80
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
81
|
+
const _response = yield core.fetcher({
|
|
82
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.FiveOneEatEnvironment.Production, "customer/push-tokens"),
|
|
83
|
+
method: "POST",
|
|
84
|
+
headers: _headers,
|
|
85
|
+
contentType: "application/json",
|
|
86
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
87
|
+
requestType: "json",
|
|
88
|
+
body: request,
|
|
89
|
+
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,
|
|
90
|
+
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,
|
|
91
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
92
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
93
|
+
logging: this._options.logging,
|
|
94
|
+
});
|
|
95
|
+
if (_response.ok) {
|
|
96
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
97
|
+
}
|
|
98
|
+
if (_response.error.reason === "status-code") {
|
|
99
|
+
switch (_response.error.statusCode) {
|
|
100
|
+
case 401:
|
|
101
|
+
throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
102
|
+
case 422:
|
|
103
|
+
throw new FiveOneEat.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
104
|
+
default:
|
|
105
|
+
throw new errors.FiveOneEatError({
|
|
106
|
+
statusCode: _response.error.statusCode,
|
|
107
|
+
body: _response.error.body,
|
|
108
|
+
rawResponse: _response.rawResponse,
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/customer/push-tokens");
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Delete the authenticated user's Expo push token registration.
|
|
117
|
+
*
|
|
118
|
+
* @param {FiveOneEat.UnregisterPushTokenRequest} request
|
|
119
|
+
* @param {PushNotificationsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
120
|
+
*
|
|
121
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
122
|
+
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
123
|
+
*
|
|
124
|
+
* @example
|
|
125
|
+
* await client.pushNotifications.unregisterPushToken({
|
|
126
|
+
* token: "token"
|
|
127
|
+
* })
|
|
128
|
+
*/
|
|
129
|
+
unregisterPushToken(request, requestOptions) {
|
|
130
|
+
return core.HttpResponsePromise.fromPromise(this.__unregisterPushToken(request, requestOptions));
|
|
131
|
+
}
|
|
132
|
+
__unregisterPushToken(request, requestOptions) {
|
|
133
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
134
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
135
|
+
const { token } = request;
|
|
136
|
+
const _queryParams = {
|
|
137
|
+
token,
|
|
138
|
+
};
|
|
139
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
140
|
+
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);
|
|
141
|
+
const _response = yield core.fetcher({
|
|
142
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.FiveOneEatEnvironment.Production, "customer/push-tokens"),
|
|
143
|
+
method: "DELETE",
|
|
144
|
+
headers: _headers,
|
|
145
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
146
|
+
queryString: core.url
|
|
147
|
+
.queryBuilder()
|
|
148
|
+
.addMany(_queryParams)
|
|
149
|
+
.mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
|
|
150
|
+
.build(),
|
|
151
|
+
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,
|
|
152
|
+
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,
|
|
153
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
154
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
155
|
+
logging: this._options.logging,
|
|
156
|
+
});
|
|
157
|
+
if (_response.ok) {
|
|
158
|
+
return { data: undefined, rawResponse: _response.rawResponse };
|
|
159
|
+
}
|
|
160
|
+
if (_response.error.reason === "status-code") {
|
|
161
|
+
switch (_response.error.statusCode) {
|
|
162
|
+
case 401:
|
|
163
|
+
throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
164
|
+
case 422:
|
|
165
|
+
throw new FiveOneEat.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
166
|
+
default:
|
|
167
|
+
throw new errors.FiveOneEatError({
|
|
168
|
+
statusCode: _response.error.statusCode,
|
|
169
|
+
body: _response.error.body,
|
|
170
|
+
rawResponse: _response.rawResponse,
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "DELETE", "/customer/push-tokens");
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
exports.PushNotificationsClient = PushNotificationsClient;
|
|
@@ -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,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @example
|
|
3
|
+
* {
|
|
4
|
+
* token: "token"
|
|
5
|
+
* }
|
|
6
|
+
*/
|
|
7
|
+
export interface StorePushTokenRequest {
|
|
8
|
+
token: string;
|
|
9
|
+
device_id?: string | null;
|
|
10
|
+
device_name?: string | null;
|
|
11
|
+
platform?: StorePushTokenRequest.Platform | null;
|
|
12
|
+
}
|
|
13
|
+
export declare namespace StorePushTokenRequest {
|
|
14
|
+
const Platform: {
|
|
15
|
+
readonly Ios: "ios";
|
|
16
|
+
readonly Android: "android";
|
|
17
|
+
};
|
|
18
|
+
type Platform = (typeof Platform)[keyof typeof Platform];
|
|
19
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.StorePushTokenRequest = void 0;
|
|
5
|
+
var StorePushTokenRequest;
|
|
6
|
+
(function (StorePushTokenRequest) {
|
|
7
|
+
StorePushTokenRequest.Platform = {
|
|
8
|
+
Ios: "ios",
|
|
9
|
+
Android: "android",
|
|
10
|
+
};
|
|
11
|
+
})(StorePushTokenRequest || (exports.StorePushTokenRequest = StorePushTokenRequest = {}));
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.StorePushTokenRequest = void 0;
|
|
4
|
+
var StorePushTokenRequest_js_1 = require("./StorePushTokenRequest.js");
|
|
5
|
+
Object.defineProperty(exports, "StorePushTokenRequest", { enumerable: true, get: function () { return StorePushTokenRequest_js_1.StorePushTokenRequest; } });
|
|
@@ -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.PushNotificationsClient = void 0;
|
|
19
|
+
var Client_js_1 = require("./client/Client.js");
|
|
20
|
+
Object.defineProperty(exports, "PushNotificationsClient", { enumerable: true, get: function () { return Client_js_1.PushNotificationsClient; } });
|
|
21
|
+
__exportStar(require("./client/index.js"), exports);
|
|
@@ -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 @@
|
|
|
1
|
+
export * from "./RegisterPushTokenResponse.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("./RegisterPushTokenResponse.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.17";
|
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.17",
|
|
10
|
+
"User-Agent": "@51eat/sdk/0.0.17",
|
|
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/Client.d.mts
CHANGED
|
@@ -8,6 +8,7 @@ import { DiscoveryClient } from "./api/resources/discovery/client/Client.mjs";
|
|
|
8
8
|
import { EditorialsClient } from "./api/resources/editorials/client/Client.mjs";
|
|
9
9
|
import { EventsClient } from "./api/resources/events/client/Client.mjs";
|
|
10
10
|
import { MyAccountClient } from "./api/resources/myAccount/client/Client.mjs";
|
|
11
|
+
import { PushNotificationsClient } from "./api/resources/pushNotifications/client/Client.mjs";
|
|
11
12
|
import { RecordClickClient } from "./api/resources/recordClick/client/Client.mjs";
|
|
12
13
|
import { ServeAdClient } from "./api/resources/serveAd/client/Client.mjs";
|
|
13
14
|
import { TicketingClient } from "./api/resources/ticketing/client/Client.mjs";
|
|
@@ -30,6 +31,7 @@ export declare class FiveOneEatClient {
|
|
|
30
31
|
protected _editorials: EditorialsClient | undefined;
|
|
31
32
|
protected _events: EventsClient | undefined;
|
|
32
33
|
protected _myAccount: MyAccountClient | undefined;
|
|
34
|
+
protected _pushNotifications: PushNotificationsClient | undefined;
|
|
33
35
|
protected _ticketing: TicketingClient | undefined;
|
|
34
36
|
protected _recordClick: RecordClickClient | undefined;
|
|
35
37
|
protected _serveAd: ServeAdClient | undefined;
|
|
@@ -43,6 +45,7 @@ export declare class FiveOneEatClient {
|
|
|
43
45
|
get editorials(): EditorialsClient;
|
|
44
46
|
get events(): EventsClient;
|
|
45
47
|
get myAccount(): MyAccountClient;
|
|
48
|
+
get pushNotifications(): PushNotificationsClient;
|
|
46
49
|
get ticketing(): TicketingClient;
|
|
47
50
|
get recordClick(): RecordClickClient;
|
|
48
51
|
get serveAd(): ServeAdClient;
|