@51eat/sdk 0.0.16 → 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/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/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +12 -1
- package/reference.md +141 -1
package/dist/esm/Client.mjs
CHANGED
|
@@ -18,6 +18,7 @@ import { DiscoveryClient } from "./api/resources/discovery/client/Client.mjs";
|
|
|
18
18
|
import { EditorialsClient } from "./api/resources/editorials/client/Client.mjs";
|
|
19
19
|
import { EventsClient } from "./api/resources/events/client/Client.mjs";
|
|
20
20
|
import { MyAccountClient } from "./api/resources/myAccount/client/Client.mjs";
|
|
21
|
+
import { PushNotificationsClient } from "./api/resources/pushNotifications/client/Client.mjs";
|
|
21
22
|
import { RecordClickClient } from "./api/resources/recordClick/client/Client.mjs";
|
|
22
23
|
import { ServeAdClient } from "./api/resources/serveAd/client/Client.mjs";
|
|
23
24
|
import { TicketingClient } from "./api/resources/ticketing/client/Client.mjs";
|
|
@@ -68,6 +69,10 @@ export class FiveOneEatClient {
|
|
|
68
69
|
var _a;
|
|
69
70
|
return ((_a = this._myAccount) !== null && _a !== void 0 ? _a : (this._myAccount = new MyAccountClient(this._options)));
|
|
70
71
|
}
|
|
72
|
+
get pushNotifications() {
|
|
73
|
+
var _a;
|
|
74
|
+
return ((_a = this._pushNotifications) !== null && _a !== void 0 ? _a : (this._pushNotifications = new PushNotificationsClient(this._options)));
|
|
75
|
+
}
|
|
71
76
|
get ticketing() {
|
|
72
77
|
var _a;
|
|
73
78
|
return ((_a = this._ticketing) !== null && _a !== void 0 ? _a : (this._ticketing = new TicketingClient(this._options)));
|
|
@@ -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.
|
|
@@ -179,6 +179,7 @@ export class AuthenticationClient {
|
|
|
179
179
|
/**
|
|
180
180
|
* Revoke the current API token and log out the user.
|
|
181
181
|
*
|
|
182
|
+
* @param {FiveOneEat.LogoutCurrentRequest} request
|
|
182
183
|
* @param {AuthenticationClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
183
184
|
*
|
|
184
185
|
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
@@ -186,11 +187,11 @@ export class AuthenticationClient {
|
|
|
186
187
|
* @example
|
|
187
188
|
* await client.authentication.logoutCurrent()
|
|
188
189
|
*/
|
|
189
|
-
logoutCurrent(requestOptions) {
|
|
190
|
-
return core.HttpResponsePromise.fromPromise(this.__logoutCurrent(requestOptions));
|
|
190
|
+
logoutCurrent(request = {}, requestOptions) {
|
|
191
|
+
return core.HttpResponsePromise.fromPromise(this.__logoutCurrent(request, requestOptions));
|
|
191
192
|
}
|
|
192
|
-
__logoutCurrent(
|
|
193
|
-
return __awaiter(this,
|
|
193
|
+
__logoutCurrent() {
|
|
194
|
+
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
194
195
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
195
196
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
196
197
|
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);
|
|
@@ -198,7 +199,10 @@ export class AuthenticationClient {
|
|
|
198
199
|
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"),
|
|
199
200
|
method: "POST",
|
|
200
201
|
headers: _headers,
|
|
202
|
+
contentType: "application/json",
|
|
201
203
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
204
|
+
requestType: "json",
|
|
205
|
+
body: request,
|
|
202
206
|
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,
|
|
203
207
|
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,
|
|
204
208
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export type { LoginCustomerRequest } from "./LoginCustomerRequest.mjs";
|
|
2
|
+
export type { LogoutCurrentRequest } from "./LogoutCurrentRequest.mjs";
|
|
2
3
|
export type { RegisterCustomerRequest } from "./RegisterCustomerRequest.mjs";
|
|
3
4
|
export type { RevokeTokenRequest } from "./RevokeTokenRequest.mjs";
|
|
@@ -24,6 +24,9 @@ export * from "./events/types/index.mjs";
|
|
|
24
24
|
export * from "./myAccount/client/requests/index.mjs";
|
|
25
25
|
export * as myAccount from "./myAccount/index.mjs";
|
|
26
26
|
export * from "./myAccount/types/index.mjs";
|
|
27
|
+
export * from "./pushNotifications/client/requests/index.mjs";
|
|
28
|
+
export * as pushNotifications from "./pushNotifications/index.mjs";
|
|
29
|
+
export * from "./pushNotifications/types/index.mjs";
|
|
27
30
|
export * from "./recordClick/client/requests/index.mjs";
|
|
28
31
|
export * as recordClick from "./recordClick/index.mjs";
|
|
29
32
|
export * from "./serveAd/client/requests/index.mjs";
|
|
@@ -24,6 +24,9 @@ export * from "./events/types/index.mjs";
|
|
|
24
24
|
export * from "./myAccount/client/requests/index.mjs";
|
|
25
25
|
export * as myAccount from "./myAccount/index.mjs";
|
|
26
26
|
export * from "./myAccount/types/index.mjs";
|
|
27
|
+
export * from "./pushNotifications/client/requests/index.mjs";
|
|
28
|
+
export * as pushNotifications from "./pushNotifications/index.mjs";
|
|
29
|
+
export * from "./pushNotifications/types/index.mjs";
|
|
27
30
|
export * from "./recordClick/client/requests/index.mjs";
|
|
28
31
|
export * as recordClick from "./recordClick/index.mjs";
|
|
29
32
|
export * from "./serveAd/client/requests/index.mjs";
|
|
@@ -0,0 +1,46 @@
|
|
|
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 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,141 @@
|
|
|
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
|
+
import { normalizeClientOptionsWithAuth } from "../../../../BaseClient.mjs";
|
|
12
|
+
import { mergeHeaders } from "../../../../core/headers.mjs";
|
|
13
|
+
import * as core from "../../../../core/index.mjs";
|
|
14
|
+
import * as environments from "../../../../environments.mjs";
|
|
15
|
+
import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.mjs";
|
|
16
|
+
import * as errors from "../../../../errors/index.mjs";
|
|
17
|
+
import * as FiveOneEat from "../../../index.mjs";
|
|
18
|
+
export class PushNotificationsClient {
|
|
19
|
+
constructor(options = {}) {
|
|
20
|
+
this._options = normalizeClientOptionsWithAuth(options);
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Register (or update) the authenticated user's Expo push token for a device. If
|
|
24
|
+
* a `device_id` is provided, an existing registration for that device is updated.
|
|
25
|
+
*
|
|
26
|
+
* @param {FiveOneEat.StorePushTokenRequest} request
|
|
27
|
+
* @param {PushNotificationsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
28
|
+
*
|
|
29
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
30
|
+
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* await client.pushNotifications.registerPushToken({
|
|
34
|
+
* token: "token"
|
|
35
|
+
* })
|
|
36
|
+
*/
|
|
37
|
+
registerPushToken(request, requestOptions) {
|
|
38
|
+
return core.HttpResponsePromise.fromPromise(this.__registerPushToken(request, requestOptions));
|
|
39
|
+
}
|
|
40
|
+
__registerPushToken(request, requestOptions) {
|
|
41
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
42
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
43
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
44
|
+
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);
|
|
45
|
+
const _response = yield core.fetcher({
|
|
46
|
+
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"),
|
|
47
|
+
method: "POST",
|
|
48
|
+
headers: _headers,
|
|
49
|
+
contentType: "application/json",
|
|
50
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
51
|
+
requestType: "json",
|
|
52
|
+
body: request,
|
|
53
|
+
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,
|
|
54
|
+
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,
|
|
55
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
56
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
57
|
+
logging: this._options.logging,
|
|
58
|
+
});
|
|
59
|
+
if (_response.ok) {
|
|
60
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
61
|
+
}
|
|
62
|
+
if (_response.error.reason === "status-code") {
|
|
63
|
+
switch (_response.error.statusCode) {
|
|
64
|
+
case 401:
|
|
65
|
+
throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
66
|
+
case 422:
|
|
67
|
+
throw new FiveOneEat.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
68
|
+
default:
|
|
69
|
+
throw new errors.FiveOneEatError({
|
|
70
|
+
statusCode: _response.error.statusCode,
|
|
71
|
+
body: _response.error.body,
|
|
72
|
+
rawResponse: _response.rawResponse,
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/customer/push-tokens");
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Delete the authenticated user's Expo push token registration.
|
|
81
|
+
*
|
|
82
|
+
* @param {FiveOneEat.UnregisterPushTokenRequest} request
|
|
83
|
+
* @param {PushNotificationsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
84
|
+
*
|
|
85
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
86
|
+
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
87
|
+
*
|
|
88
|
+
* @example
|
|
89
|
+
* await client.pushNotifications.unregisterPushToken({
|
|
90
|
+
* token: "token"
|
|
91
|
+
* })
|
|
92
|
+
*/
|
|
93
|
+
unregisterPushToken(request, requestOptions) {
|
|
94
|
+
return core.HttpResponsePromise.fromPromise(this.__unregisterPushToken(request, requestOptions));
|
|
95
|
+
}
|
|
96
|
+
__unregisterPushToken(request, requestOptions) {
|
|
97
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
98
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
99
|
+
const { token } = request;
|
|
100
|
+
const _queryParams = {
|
|
101
|
+
token,
|
|
102
|
+
};
|
|
103
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
104
|
+
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);
|
|
105
|
+
const _response = yield core.fetcher({
|
|
106
|
+
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"),
|
|
107
|
+
method: "DELETE",
|
|
108
|
+
headers: _headers,
|
|
109
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
110
|
+
queryString: core.url
|
|
111
|
+
.queryBuilder()
|
|
112
|
+
.addMany(_queryParams)
|
|
113
|
+
.mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
|
|
114
|
+
.build(),
|
|
115
|
+
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,
|
|
116
|
+
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,
|
|
117
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
118
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
119
|
+
logging: this._options.logging,
|
|
120
|
+
});
|
|
121
|
+
if (_response.ok) {
|
|
122
|
+
return { data: undefined, rawResponse: _response.rawResponse };
|
|
123
|
+
}
|
|
124
|
+
if (_response.error.reason === "status-code") {
|
|
125
|
+
switch (_response.error.statusCode) {
|
|
126
|
+
case 401:
|
|
127
|
+
throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
128
|
+
case 422:
|
|
129
|
+
throw new FiveOneEat.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
130
|
+
default:
|
|
131
|
+
throw new errors.FiveOneEatError({
|
|
132
|
+
statusCode: _response.error.statusCode,
|
|
133
|
+
body: _response.error.body,
|
|
134
|
+
rawResponse: _response.rawResponse,
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/customer/push-tokens");
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./requests/index.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./requests/index.mjs";
|
|
@@ -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,8 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
export var StorePushTokenRequest;
|
|
3
|
+
(function (StorePushTokenRequest) {
|
|
4
|
+
StorePushTokenRequest.Platform = {
|
|
5
|
+
Ios: "ios",
|
|
6
|
+
Android: "android",
|
|
7
|
+
};
|
|
8
|
+
})(StorePushTokenRequest || (StorePushTokenRequest = {}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { StorePushTokenRequest } from "./StorePushTokenRequest.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./RegisterPushTokenResponse.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./RegisterPushTokenResponse.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.17";
|
package/dist/esm/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "0.0.
|
|
1
|
+
export const SDK_VERSION = "0.0.17";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@51eat/sdk",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.17",
|
|
4
4
|
"private": false,
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -121,6 +121,17 @@
|
|
|
121
121
|
},
|
|
122
122
|
"default": "./dist/cjs/api/resources/myAccount/exports.js"
|
|
123
123
|
},
|
|
124
|
+
"./pushNotifications": {
|
|
125
|
+
"import": {
|
|
126
|
+
"types": "./dist/esm/api/resources/pushNotifications/exports.d.mts",
|
|
127
|
+
"default": "./dist/esm/api/resources/pushNotifications/exports.mjs"
|
|
128
|
+
},
|
|
129
|
+
"require": {
|
|
130
|
+
"types": "./dist/cjs/api/resources/pushNotifications/exports.d.ts",
|
|
131
|
+
"default": "./dist/cjs/api/resources/pushNotifications/exports.js"
|
|
132
|
+
},
|
|
133
|
+
"default": "./dist/cjs/api/resources/pushNotifications/exports.js"
|
|
134
|
+
},
|
|
124
135
|
"./ticketing": {
|
|
125
136
|
"import": {
|
|
126
137
|
"types": "./dist/esm/api/resources/ticketing/exports.d.mts",
|
package/reference.md
CHANGED
|
@@ -261,7 +261,7 @@ await client.authentication.getCurrentUser();
|
|
|
261
261
|
</dl>
|
|
262
262
|
</details>
|
|
263
263
|
|
|
264
|
-
<details><summary><code>client.authentication.<a href="/src/api/resources/authentication/client/Client.ts">logoutCurrent</a>() -> FiveOneEat.LogoutCurrentResponse</code></summary>
|
|
264
|
+
<details><summary><code>client.authentication.<a href="/src/api/resources/authentication/client/Client.ts">logoutCurrent</a>({ ...params }) -> FiveOneEat.LogoutCurrentResponse</code></summary>
|
|
265
265
|
<dl>
|
|
266
266
|
<dd>
|
|
267
267
|
|
|
@@ -304,6 +304,14 @@ await client.authentication.logoutCurrent();
|
|
|
304
304
|
<dl>
|
|
305
305
|
<dd>
|
|
306
306
|
|
|
307
|
+
**request:** `FiveOneEat.LogoutCurrentRequest`
|
|
308
|
+
|
|
309
|
+
</dd>
|
|
310
|
+
</dl>
|
|
311
|
+
|
|
312
|
+
<dl>
|
|
313
|
+
<dd>
|
|
314
|
+
|
|
307
315
|
**requestOptions:** `AuthenticationClient.RequestOptions`
|
|
308
316
|
|
|
309
317
|
</dd>
|
|
@@ -2873,6 +2881,138 @@ await client.myAccount.getMyTicketOrder({
|
|
|
2873
2881
|
</dl>
|
|
2874
2882
|
|
|
2875
2883
|
|
|
2884
|
+
</dd>
|
|
2885
|
+
</dl>
|
|
2886
|
+
</details>
|
|
2887
|
+
|
|
2888
|
+
## Push Notifications
|
|
2889
|
+
<details><summary><code>client.pushNotifications.<a href="/src/api/resources/pushNotifications/client/Client.ts">registerPushToken</a>({ ...params }) -> FiveOneEat.RegisterPushTokenResponse</code></summary>
|
|
2890
|
+
<dl>
|
|
2891
|
+
<dd>
|
|
2892
|
+
|
|
2893
|
+
#### 📝 Description
|
|
2894
|
+
|
|
2895
|
+
<dl>
|
|
2896
|
+
<dd>
|
|
2897
|
+
|
|
2898
|
+
<dl>
|
|
2899
|
+
<dd>
|
|
2900
|
+
|
|
2901
|
+
Register (or update) the authenticated user's Expo push token for a device. If
|
|
2902
|
+
a `device_id` is provided, an existing registration for that device is updated.
|
|
2903
|
+
</dd>
|
|
2904
|
+
</dl>
|
|
2905
|
+
</dd>
|
|
2906
|
+
</dl>
|
|
2907
|
+
|
|
2908
|
+
#### 🔌 Usage
|
|
2909
|
+
|
|
2910
|
+
<dl>
|
|
2911
|
+
<dd>
|
|
2912
|
+
|
|
2913
|
+
<dl>
|
|
2914
|
+
<dd>
|
|
2915
|
+
|
|
2916
|
+
```typescript
|
|
2917
|
+
await client.pushNotifications.registerPushToken({
|
|
2918
|
+
token: "token"
|
|
2919
|
+
});
|
|
2920
|
+
|
|
2921
|
+
```
|
|
2922
|
+
</dd>
|
|
2923
|
+
</dl>
|
|
2924
|
+
</dd>
|
|
2925
|
+
</dl>
|
|
2926
|
+
|
|
2927
|
+
#### ⚙️ Parameters
|
|
2928
|
+
|
|
2929
|
+
<dl>
|
|
2930
|
+
<dd>
|
|
2931
|
+
|
|
2932
|
+
<dl>
|
|
2933
|
+
<dd>
|
|
2934
|
+
|
|
2935
|
+
**request:** `FiveOneEat.StorePushTokenRequest`
|
|
2936
|
+
|
|
2937
|
+
</dd>
|
|
2938
|
+
</dl>
|
|
2939
|
+
|
|
2940
|
+
<dl>
|
|
2941
|
+
<dd>
|
|
2942
|
+
|
|
2943
|
+
**requestOptions:** `PushNotificationsClient.RequestOptions`
|
|
2944
|
+
|
|
2945
|
+
</dd>
|
|
2946
|
+
</dl>
|
|
2947
|
+
</dd>
|
|
2948
|
+
</dl>
|
|
2949
|
+
|
|
2950
|
+
|
|
2951
|
+
</dd>
|
|
2952
|
+
</dl>
|
|
2953
|
+
</details>
|
|
2954
|
+
|
|
2955
|
+
<details><summary><code>client.pushNotifications.<a href="/src/api/resources/pushNotifications/client/Client.ts">unregisterPushToken</a>({ ...params }) -> void</code></summary>
|
|
2956
|
+
<dl>
|
|
2957
|
+
<dd>
|
|
2958
|
+
|
|
2959
|
+
#### 📝 Description
|
|
2960
|
+
|
|
2961
|
+
<dl>
|
|
2962
|
+
<dd>
|
|
2963
|
+
|
|
2964
|
+
<dl>
|
|
2965
|
+
<dd>
|
|
2966
|
+
|
|
2967
|
+
Delete the authenticated user's Expo push token registration.
|
|
2968
|
+
</dd>
|
|
2969
|
+
</dl>
|
|
2970
|
+
</dd>
|
|
2971
|
+
</dl>
|
|
2972
|
+
|
|
2973
|
+
#### 🔌 Usage
|
|
2974
|
+
|
|
2975
|
+
<dl>
|
|
2976
|
+
<dd>
|
|
2977
|
+
|
|
2978
|
+
<dl>
|
|
2979
|
+
<dd>
|
|
2980
|
+
|
|
2981
|
+
```typescript
|
|
2982
|
+
await client.pushNotifications.unregisterPushToken({
|
|
2983
|
+
token: "token"
|
|
2984
|
+
});
|
|
2985
|
+
|
|
2986
|
+
```
|
|
2987
|
+
</dd>
|
|
2988
|
+
</dl>
|
|
2989
|
+
</dd>
|
|
2990
|
+
</dl>
|
|
2991
|
+
|
|
2992
|
+
#### ⚙️ Parameters
|
|
2993
|
+
|
|
2994
|
+
<dl>
|
|
2995
|
+
<dd>
|
|
2996
|
+
|
|
2997
|
+
<dl>
|
|
2998
|
+
<dd>
|
|
2999
|
+
|
|
3000
|
+
**request:** `FiveOneEat.UnregisterPushTokenRequest`
|
|
3001
|
+
|
|
3002
|
+
</dd>
|
|
3003
|
+
</dl>
|
|
3004
|
+
|
|
3005
|
+
<dl>
|
|
3006
|
+
<dd>
|
|
3007
|
+
|
|
3008
|
+
**requestOptions:** `PushNotificationsClient.RequestOptions`
|
|
3009
|
+
|
|
3010
|
+
</dd>
|
|
3011
|
+
</dl>
|
|
3012
|
+
</dd>
|
|
3013
|
+
</dl>
|
|
3014
|
+
|
|
3015
|
+
|
|
2876
3016
|
</dd>
|
|
2877
3017
|
</dl>
|
|
2878
3018
|
</details>
|