@51eat/sdk 0.0.21 → 0.0.22
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/README.md +16 -13
- package/dist/cjs/BaseClient.js +2 -2
- package/dist/cjs/Client.d.ts +0 -6
- package/dist/cjs/Client.js +10 -20
- package/dist/cjs/api/resources/business/client/Client.d.ts +5 -2
- package/dist/cjs/api/resources/business/client/Client.js +7 -2
- package/dist/cjs/api/resources/business/resources/index.d.ts +4 -0
- package/dist/cjs/api/resources/business/resources/index.js +5 -1
- package/dist/cjs/api/resources/business/resources/messaging/client/Client.d.ts +24 -1
- package/dist/cjs/api/resources/business/resources/messaging/client/Client.js +107 -0
- package/dist/cjs/api/resources/business/resources/messaging/client/index.d.ts +1 -1
- package/dist/cjs/api/resources/business/resources/messaging/client/index.js +15 -0
- package/dist/cjs/api/resources/{businessMessaging/client/requests/BusinessChannelAuthAuthenticateRequest.d.ts → business/resources/messaging/client/requests/ChannelAuthMessagingRequest.d.ts} +1 -1
- package/dist/cjs/api/resources/business/resources/messaging/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/business/resources/pushNotifications/client/Client.d.ts +47 -0
- package/dist/cjs/api/resources/{businessPushNotifications → business/resources/pushNotifications}/client/Client.js +22 -22
- package/dist/cjs/api/resources/{businessPushNotifications/client/requests/UnregisterBusinessPushTokenRequest.d.ts → business/resources/pushNotifications/client/requests/UnregisterPushNotificationsRequest.d.ts} +1 -1
- package/dist/cjs/api/resources/business/resources/pushNotifications/client/requests/index.d.ts +2 -0
- package/dist/cjs/api/resources/business/resources/pushNotifications/exports.d.ts +2 -0
- package/dist/cjs/api/resources/{businessMessaging → business/resources/pushNotifications}/exports.js +2 -2
- package/dist/cjs/api/resources/{businessPushNotifications/types/RegisterBusinessPushTokenResponse.d.ts → business/resources/pushNotifications/types/RegisterPushNotificationsResponse.d.ts} +1 -1
- package/dist/cjs/api/resources/business/resources/pushNotifications/types/index.d.ts +1 -0
- package/dist/cjs/api/resources/{businessPushNotifications → business/resources/pushNotifications}/types/index.js +1 -1
- package/dist/cjs/api/resources/index.d.ts +0 -5
- package/dist/cjs/api/resources/index.js +1 -6
- 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 +0 -6
- package/dist/esm/Client.mjs +0 -10
- package/dist/esm/api/resources/business/client/Client.d.mts +5 -2
- package/dist/esm/api/resources/business/client/Client.mjs +7 -2
- package/dist/esm/api/resources/business/resources/index.d.mts +4 -0
- package/dist/esm/api/resources/business/resources/index.mjs +4 -0
- package/dist/esm/api/resources/business/resources/messaging/client/Client.d.mts +24 -1
- package/dist/esm/api/resources/business/resources/messaging/client/Client.mjs +74 -0
- package/dist/esm/api/resources/business/resources/messaging/client/index.d.mts +1 -1
- package/dist/esm/api/resources/business/resources/messaging/client/index.mjs +1 -1
- package/dist/esm/api/resources/{businessMessaging/client/requests/BusinessChannelAuthAuthenticateRequest.d.mts → business/resources/messaging/client/requests/ChannelAuthMessagingRequest.d.mts} +1 -1
- package/dist/esm/api/resources/business/resources/messaging/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/business/resources/pushNotifications/client/Client.d.mts +47 -0
- package/dist/esm/api/resources/{businessPushNotifications → business/resources/pushNotifications}/client/Client.mjs +20 -20
- package/dist/esm/api/resources/{businessPushNotifications/client/requests/UnregisterBusinessPushTokenRequest.d.mts → business/resources/pushNotifications/client/requests/UnregisterPushNotificationsRequest.d.mts} +1 -1
- package/dist/esm/api/resources/business/resources/pushNotifications/client/requests/index.d.mts +2 -0
- package/dist/esm/api/resources/business/resources/pushNotifications/exports.d.mts +2 -0
- package/dist/esm/api/resources/{businessMessaging → business/resources/pushNotifications}/exports.mjs +1 -1
- package/dist/esm/api/resources/{businessPushNotifications/types/RegisterBusinessPushTokenResponse.d.mts → business/resources/pushNotifications/types/RegisterPushNotificationsResponse.d.mts} +1 -1
- package/dist/esm/api/resources/business/resources/pushNotifications/types/index.d.mts +1 -0
- package/dist/esm/api/resources/business/resources/pushNotifications/types/index.mjs +1 -0
- package/dist/esm/api/resources/index.d.mts +0 -5
- package/dist/esm/api/resources/index.mjs +0 -5
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +23 -34
- package/reference.md +202 -202
- package/dist/cjs/api/resources/businessMessaging/client/Client.d.ts +0 -32
- package/dist/cjs/api/resources/businessMessaging/client/Client.js +0 -118
- package/dist/cjs/api/resources/businessMessaging/client/requests/index.d.ts +0 -1
- package/dist/cjs/api/resources/businessMessaging/exports.d.ts +0 -2
- package/dist/cjs/api/resources/businessMessaging/index.d.ts +0 -1
- package/dist/cjs/api/resources/businessMessaging/index.js +0 -17
- package/dist/cjs/api/resources/businessPushNotifications/client/Client.d.ts +0 -47
- package/dist/cjs/api/resources/businessPushNotifications/client/index.d.ts +0 -1
- package/dist/cjs/api/resources/businessPushNotifications/client/index.js +0 -17
- package/dist/cjs/api/resources/businessPushNotifications/client/requests/index.d.ts +0 -2
- package/dist/cjs/api/resources/businessPushNotifications/exports.d.ts +0 -2
- package/dist/cjs/api/resources/businessPushNotifications/exports.js +0 -21
- package/dist/cjs/api/resources/businessPushNotifications/types/index.d.ts +0 -1
- package/dist/esm/api/resources/businessMessaging/client/Client.d.mts +0 -32
- package/dist/esm/api/resources/businessMessaging/client/Client.mjs +0 -81
- package/dist/esm/api/resources/businessMessaging/client/requests/index.d.mts +0 -1
- package/dist/esm/api/resources/businessMessaging/exports.d.mts +0 -2
- package/dist/esm/api/resources/businessMessaging/index.d.mts +0 -1
- package/dist/esm/api/resources/businessMessaging/index.mjs +0 -1
- package/dist/esm/api/resources/businessPushNotifications/client/Client.d.mts +0 -47
- package/dist/esm/api/resources/businessPushNotifications/client/index.d.mts +0 -1
- package/dist/esm/api/resources/businessPushNotifications/client/index.mjs +0 -1
- package/dist/esm/api/resources/businessPushNotifications/client/requests/index.d.mts +0 -2
- package/dist/esm/api/resources/businessPushNotifications/exports.d.mts +0 -2
- package/dist/esm/api/resources/businessPushNotifications/exports.mjs +0 -3
- package/dist/esm/api/resources/businessPushNotifications/types/index.d.mts +0 -1
- package/dist/esm/api/resources/businessPushNotifications/types/index.mjs +0 -1
- /package/dist/cjs/api/resources/{businessMessaging/client/requests/BusinessChannelAuthAuthenticateRequest.js → business/resources/messaging/client/requests/ChannelAuthMessagingRequest.js} +0 -0
- /package/dist/cjs/api/resources/{businessMessaging → business/resources/messaging}/client/requests/index.js +0 -0
- /package/dist/cjs/api/resources/{businessMessaging → business/resources/pushNotifications}/client/index.d.ts +0 -0
- /package/dist/cjs/api/resources/{businessMessaging → business/resources/pushNotifications}/client/index.js +0 -0
- /package/dist/cjs/api/resources/{businessPushNotifications → business/resources/pushNotifications}/client/requests/StorePushTokenRequest.d.ts +0 -0
- /package/dist/cjs/api/resources/{businessPushNotifications → business/resources/pushNotifications}/client/requests/StorePushTokenRequest.js +0 -0
- /package/dist/cjs/api/resources/{businessPushNotifications/client/requests/UnregisterBusinessPushTokenRequest.js → business/resources/pushNotifications/client/requests/UnregisterPushNotificationsRequest.js} +0 -0
- /package/dist/cjs/api/resources/{businessPushNotifications → business/resources/pushNotifications}/client/requests/index.js +0 -0
- /package/dist/cjs/api/resources/{businessPushNotifications → business/resources/pushNotifications}/index.d.ts +0 -0
- /package/dist/cjs/api/resources/{businessPushNotifications → business/resources/pushNotifications}/index.js +0 -0
- /package/dist/cjs/api/resources/{businessPushNotifications/types/RegisterBusinessPushTokenResponse.js → business/resources/pushNotifications/types/RegisterPushNotificationsResponse.js} +0 -0
- /package/dist/esm/api/resources/{businessMessaging/client/requests/BusinessChannelAuthAuthenticateRequest.mjs → business/resources/messaging/client/requests/ChannelAuthMessagingRequest.mjs} +0 -0
- /package/dist/esm/api/resources/{businessMessaging → business/resources/messaging}/client/requests/index.mjs +0 -0
- /package/dist/esm/api/resources/{businessMessaging → business/resources/pushNotifications}/client/index.d.mts +0 -0
- /package/dist/esm/api/resources/{businessMessaging → business/resources/pushNotifications}/client/index.mjs +0 -0
- /package/dist/esm/api/resources/{businessPushNotifications → business/resources/pushNotifications}/client/requests/StorePushTokenRequest.d.mts +0 -0
- /package/dist/esm/api/resources/{businessPushNotifications → business/resources/pushNotifications}/client/requests/StorePushTokenRequest.mjs +0 -0
- /package/dist/esm/api/resources/{businessPushNotifications/client/requests/UnregisterBusinessPushTokenRequest.mjs → business/resources/pushNotifications/client/requests/UnregisterPushNotificationsRequest.mjs} +0 -0
- /package/dist/esm/api/resources/{businessPushNotifications → business/resources/pushNotifications}/client/requests/index.mjs +0 -0
- /package/dist/esm/api/resources/{businessPushNotifications → business/resources/pushNotifications}/index.d.mts +0 -0
- /package/dist/esm/api/resources/{businessPushNotifications → business/resources/pushNotifications}/index.mjs +0 -0
- /package/dist/esm/api/resources/{businessPushNotifications/types/RegisterBusinessPushTokenResponse.mjs → business/resources/pushNotifications/types/RegisterPushNotificationsResponse.mjs} +0 -0
|
@@ -1,47 +0,0 @@
|
|
|
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 BusinessPushNotificationsClient {
|
|
6
|
-
type Options = BaseClientOptions;
|
|
7
|
-
interface RequestOptions extends BaseRequestOptions {
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
export declare class BusinessPushNotificationsClient {
|
|
11
|
-
protected readonly _options: NormalizedClientOptionsWithAuth<BusinessPushNotificationsClient.Options>;
|
|
12
|
-
constructor(options?: BusinessPushNotificationsClient.Options);
|
|
13
|
-
/**
|
|
14
|
-
* Register (or update) the authenticated business user's Expo push token for a
|
|
15
|
-
* device. If a `device_id` is provided, an existing registration for that device
|
|
16
|
-
* is updated.
|
|
17
|
-
*
|
|
18
|
-
* @param {FiveOneEat.StorePushTokenRequest} request
|
|
19
|
-
* @param {BusinessPushNotificationsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
20
|
-
*
|
|
21
|
-
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
22
|
-
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
23
|
-
*
|
|
24
|
-
* @example
|
|
25
|
-
* await client.businessPushNotifications.registerBusinessPushToken({
|
|
26
|
-
* token: "token"
|
|
27
|
-
* })
|
|
28
|
-
*/
|
|
29
|
-
registerBusinessPushToken(request: FiveOneEat.StorePushTokenRequest, requestOptions?: BusinessPushNotificationsClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.RegisterBusinessPushTokenResponse>;
|
|
30
|
-
private __registerBusinessPushToken;
|
|
31
|
-
/**
|
|
32
|
-
* Delete the authenticated business user's Expo push token registration.
|
|
33
|
-
*
|
|
34
|
-
* @param {FiveOneEat.UnregisterBusinessPushTokenRequest} request
|
|
35
|
-
* @param {BusinessPushNotificationsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
36
|
-
*
|
|
37
|
-
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
38
|
-
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
39
|
-
*
|
|
40
|
-
* @example
|
|
41
|
-
* await client.businessPushNotifications.unregisterBusinessPushToken({
|
|
42
|
-
* token: "token"
|
|
43
|
-
* })
|
|
44
|
-
*/
|
|
45
|
-
unregisterBusinessPushToken(request: FiveOneEat.UnregisterBusinessPushTokenRequest, requestOptions?: BusinessPushNotificationsClient.RequestOptions): core.HttpResponsePromise<void>;
|
|
46
|
-
private __unregisterBusinessPushToken;
|
|
47
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./requests/index.js";
|
|
@@ -1,17 +0,0 @@
|
|
|
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);
|
|
@@ -1,21 +0,0 @@
|
|
|
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.BusinessPushNotificationsClient = void 0;
|
|
19
|
-
var Client_js_1 = require("./client/Client.js");
|
|
20
|
-
Object.defineProperty(exports, "BusinessPushNotificationsClient", { enumerable: true, get: function () { return Client_js_1.BusinessPushNotificationsClient; } });
|
|
21
|
-
__exportStar(require("./client/index.js"), exports);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./RegisterBusinessPushTokenResponse.js";
|
|
@@ -1,32 +0,0 @@
|
|
|
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 BusinessMessagingClient {
|
|
6
|
-
type Options = BaseClientOptions;
|
|
7
|
-
interface RequestOptions extends BaseRequestOptions {
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
export declare class BusinessMessagingClient {
|
|
11
|
-
protected readonly _options: NormalizedClientOptionsWithAuth<BusinessMessagingClient.Options>;
|
|
12
|
-
constructor(options?: BusinessMessagingClient.Options);
|
|
13
|
-
/**
|
|
14
|
-
* This endpoint is used by the business companion mobile app to authenticate with
|
|
15
|
-
* Pusher channels. It validates that the authenticated business user has
|
|
16
|
-
* permission to access the requested channel, scoped to their active business.
|
|
17
|
-
*
|
|
18
|
-
* @param {FiveOneEat.BusinessChannelAuthAuthenticateRequest} request
|
|
19
|
-
* @param {BusinessMessagingClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
20
|
-
*
|
|
21
|
-
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
22
|
-
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
23
|
-
*
|
|
24
|
-
* @example
|
|
25
|
-
* await client.businessMessaging.businessChannelAuthAuthenticate({
|
|
26
|
-
* channel_name: "channel_name",
|
|
27
|
-
* socket_id: "socket_id"
|
|
28
|
-
* })
|
|
29
|
-
*/
|
|
30
|
-
businessChannelAuthAuthenticate(request: FiveOneEat.BusinessChannelAuthAuthenticateRequest, requestOptions?: BusinessMessagingClient.RequestOptions): core.HttpResponsePromise<number>;
|
|
31
|
-
private __businessChannelAuthAuthenticate;
|
|
32
|
-
}
|
|
@@ -1,81 +0,0 @@
|
|
|
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 BusinessMessagingClient {
|
|
19
|
-
constructor(options = {}) {
|
|
20
|
-
this._options = normalizeClientOptionsWithAuth(options);
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* This endpoint is used by the business companion mobile app to authenticate with
|
|
24
|
-
* Pusher channels. It validates that the authenticated business user has
|
|
25
|
-
* permission to access the requested channel, scoped to their active business.
|
|
26
|
-
*
|
|
27
|
-
* @param {FiveOneEat.BusinessChannelAuthAuthenticateRequest} request
|
|
28
|
-
* @param {BusinessMessagingClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
29
|
-
*
|
|
30
|
-
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
31
|
-
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
32
|
-
*
|
|
33
|
-
* @example
|
|
34
|
-
* await client.businessMessaging.businessChannelAuthAuthenticate({
|
|
35
|
-
* channel_name: "channel_name",
|
|
36
|
-
* socket_id: "socket_id"
|
|
37
|
-
* })
|
|
38
|
-
*/
|
|
39
|
-
businessChannelAuthAuthenticate(request, requestOptions) {
|
|
40
|
-
return core.HttpResponsePromise.fromPromise(this.__businessChannelAuthAuthenticate(request, requestOptions));
|
|
41
|
-
}
|
|
42
|
-
__businessChannelAuthAuthenticate(request, requestOptions) {
|
|
43
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
44
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
45
|
-
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
46
|
-
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);
|
|
47
|
-
const _response = yield core.fetcher({
|
|
48
|
-
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/channels/auth"),
|
|
49
|
-
method: "POST",
|
|
50
|
-
headers: _headers,
|
|
51
|
-
contentType: "application/json",
|
|
52
|
-
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
53
|
-
requestType: "json",
|
|
54
|
-
body: request,
|
|
55
|
-
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,
|
|
56
|
-
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,
|
|
57
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
58
|
-
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
59
|
-
logging: this._options.logging,
|
|
60
|
-
});
|
|
61
|
-
if (_response.ok) {
|
|
62
|
-
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
63
|
-
}
|
|
64
|
-
if (_response.error.reason === "status-code") {
|
|
65
|
-
switch (_response.error.statusCode) {
|
|
66
|
-
case 401:
|
|
67
|
-
throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
68
|
-
case 422:
|
|
69
|
-
throw new FiveOneEat.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
70
|
-
default:
|
|
71
|
-
throw new errors.FiveOneEatError({
|
|
72
|
-
statusCode: _response.error.statusCode,
|
|
73
|
-
body: _response.error.body,
|
|
74
|
-
rawResponse: _response.rawResponse,
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/business/channels/auth");
|
|
79
|
-
});
|
|
80
|
-
}
|
|
81
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type { BusinessChannelAuthAuthenticateRequest } from "./BusinessChannelAuthAuthenticateRequest.mjs";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./client/index.mjs";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./client/index.mjs";
|
|
@@ -1,47 +0,0 @@
|
|
|
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 BusinessPushNotificationsClient {
|
|
6
|
-
type Options = BaseClientOptions;
|
|
7
|
-
interface RequestOptions extends BaseRequestOptions {
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
export declare class BusinessPushNotificationsClient {
|
|
11
|
-
protected readonly _options: NormalizedClientOptionsWithAuth<BusinessPushNotificationsClient.Options>;
|
|
12
|
-
constructor(options?: BusinessPushNotificationsClient.Options);
|
|
13
|
-
/**
|
|
14
|
-
* Register (or update) the authenticated business user's Expo push token for a
|
|
15
|
-
* device. If a `device_id` is provided, an existing registration for that device
|
|
16
|
-
* is updated.
|
|
17
|
-
*
|
|
18
|
-
* @param {FiveOneEat.StorePushTokenRequest} request
|
|
19
|
-
* @param {BusinessPushNotificationsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
20
|
-
*
|
|
21
|
-
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
22
|
-
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
23
|
-
*
|
|
24
|
-
* @example
|
|
25
|
-
* await client.businessPushNotifications.registerBusinessPushToken({
|
|
26
|
-
* token: "token"
|
|
27
|
-
* })
|
|
28
|
-
*/
|
|
29
|
-
registerBusinessPushToken(request: FiveOneEat.StorePushTokenRequest, requestOptions?: BusinessPushNotificationsClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.RegisterBusinessPushTokenResponse>;
|
|
30
|
-
private __registerBusinessPushToken;
|
|
31
|
-
/**
|
|
32
|
-
* Delete the authenticated business user's Expo push token registration.
|
|
33
|
-
*
|
|
34
|
-
* @param {FiveOneEat.UnregisterBusinessPushTokenRequest} request
|
|
35
|
-
* @param {BusinessPushNotificationsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
36
|
-
*
|
|
37
|
-
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
38
|
-
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
39
|
-
*
|
|
40
|
-
* @example
|
|
41
|
-
* await client.businessPushNotifications.unregisterBusinessPushToken({
|
|
42
|
-
* token: "token"
|
|
43
|
-
* })
|
|
44
|
-
*/
|
|
45
|
-
unregisterBusinessPushToken(request: FiveOneEat.UnregisterBusinessPushTokenRequest, requestOptions?: BusinessPushNotificationsClient.RequestOptions): core.HttpResponsePromise<void>;
|
|
46
|
-
private __unregisterBusinessPushToken;
|
|
47
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./requests/index.mjs";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./requests/index.mjs";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./RegisterBusinessPushTokenResponse.mjs";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./RegisterBusinessPushTokenResponse.mjs";
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|