@51eat/sdk 0.0.21 → 0.0.23
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 +17 -2
- package/dist/cjs/api/resources/business/client/Client.js +34 -9
- package/dist/cjs/api/resources/business/resources/businesses/client/Client.d.ts +62 -0
- package/dist/cjs/api/resources/business/resources/businesses/client/Client.js +260 -0
- package/dist/cjs/api/resources/business/resources/businesses/client/requests/DeleteBusinessesRequest.d.ts +9 -0
- package/dist/cjs/api/resources/business/resources/businesses/client/requests/GetBusinessesRequest.d.ts +9 -0
- package/dist/cjs/api/resources/business/resources/businesses/client/requests/UpdateBusinessesRequest.d.ts +9 -0
- package/dist/cjs/api/resources/business/resources/businesses/client/requests/index.d.ts +3 -0
- package/dist/cjs/api/resources/business/resources/businesses/exports.d.ts +2 -0
- package/dist/cjs/api/resources/{businessMessaging → business/resources/businesses}/exports.js +2 -2
- package/dist/cjs/api/resources/business/resources/categories/client/Client.d.ts +20 -0
- package/dist/cjs/api/resources/{businessMessaging → business/resources/categories}/client/Client.js +23 -45
- package/dist/cjs/api/resources/business/resources/categories/client/index.js +2 -0
- package/dist/cjs/api/resources/business/resources/categories/exports.d.ts +2 -0
- package/dist/cjs/api/resources/{businessPushNotifications → business/resources/categories}/exports.js +2 -2
- package/dist/cjs/api/resources/business/resources/categories/index.d.ts +1 -0
- package/dist/cjs/api/resources/business/resources/categories/index.js +17 -0
- package/dist/cjs/api/resources/business/resources/certifications/client/Client.d.ts +20 -0
- package/dist/cjs/api/resources/business/resources/certifications/client/Client.js +96 -0
- package/dist/cjs/api/resources/business/resources/certifications/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/business/resources/certifications/client/index.js +2 -0
- package/dist/cjs/api/resources/business/resources/certifications/exports.d.ts +2 -0
- package/dist/cjs/api/resources/business/resources/certifications/exports.js +21 -0
- package/dist/cjs/api/resources/business/resources/certifications/index.d.ts +1 -0
- package/dist/cjs/api/resources/business/resources/certifications/index.js +17 -0
- package/dist/cjs/api/resources/business/resources/cuisines/client/Client.d.ts +20 -0
- package/dist/cjs/api/resources/business/resources/cuisines/client/Client.js +96 -0
- package/dist/cjs/api/resources/business/resources/cuisines/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/business/resources/cuisines/client/index.js +2 -0
- package/dist/cjs/api/resources/business/resources/cuisines/exports.d.ts +2 -0
- package/dist/cjs/api/resources/business/resources/cuisines/exports.js +21 -0
- package/dist/cjs/api/resources/business/resources/cuisines/index.d.ts +1 -0
- package/dist/cjs/api/resources/business/resources/cuisines/index.js +17 -0
- package/dist/cjs/api/resources/business/resources/index.d.ts +9 -0
- package/dist/cjs/api/resources/business/resources/index.js +10 -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/ChannelAuthMessagingRequest.js +3 -0
- package/dist/cjs/api/resources/business/resources/messaging/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/business/resources/messaging/client/requests/index.js +2 -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/UnregisterPushNotificationsRequest.js +3 -0
- 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/business/resources/pushNotifications/exports.js +21 -0
- 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/RegisterPushNotificationsResponse.js +3 -0
- 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 +17 -2
- package/dist/esm/api/resources/business/client/Client.mjs +27 -2
- package/dist/esm/api/resources/business/resources/businesses/client/Client.d.mts +62 -0
- package/dist/esm/api/resources/business/resources/businesses/client/Client.mjs +223 -0
- package/dist/esm/api/resources/business/resources/businesses/client/requests/DeleteBusinessesRequest.d.mts +9 -0
- package/dist/esm/api/resources/business/resources/businesses/client/requests/GetBusinessesRequest.d.mts +9 -0
- package/dist/esm/api/resources/business/resources/businesses/client/requests/UpdateBusinessesRequest.d.mts +9 -0
- package/dist/esm/api/resources/business/resources/businesses/client/requests/index.d.mts +3 -0
- package/dist/esm/api/resources/business/resources/businesses/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/business/resources/businesses/exports.d.mts +2 -0
- package/dist/esm/api/resources/{businessMessaging → business/resources/businesses}/exports.mjs +1 -1
- package/dist/esm/api/resources/business/resources/categories/client/Client.d.mts +20 -0
- package/dist/esm/api/resources/{businessMessaging → business/resources/categories}/client/Client.mjs +21 -43
- package/dist/esm/api/resources/business/resources/categories/client/index.d.mts +1 -0
- package/dist/esm/api/resources/business/resources/categories/client/index.mjs +1 -0
- package/dist/esm/api/resources/business/resources/categories/exports.d.mts +2 -0
- package/dist/esm/api/resources/{businessPushNotifications → business/resources/categories}/exports.mjs +1 -1
- package/dist/esm/api/resources/business/resources/categories/index.d.mts +1 -0
- package/dist/esm/api/resources/business/resources/categories/index.mjs +1 -0
- package/dist/esm/api/resources/business/resources/certifications/client/Client.d.mts +20 -0
- package/dist/esm/api/resources/business/resources/certifications/client/Client.mjs +59 -0
- package/dist/esm/api/resources/business/resources/certifications/client/index.d.mts +1 -0
- package/dist/esm/api/resources/business/resources/certifications/client/index.mjs +1 -0
- package/dist/esm/api/resources/business/resources/certifications/exports.d.mts +2 -0
- package/dist/esm/api/resources/business/resources/certifications/exports.mjs +3 -0
- package/dist/esm/api/resources/business/resources/certifications/index.d.mts +1 -0
- package/dist/esm/api/resources/business/resources/certifications/index.mjs +1 -0
- package/dist/esm/api/resources/business/resources/cuisines/client/Client.d.mts +20 -0
- package/dist/esm/api/resources/business/resources/cuisines/client/Client.mjs +59 -0
- package/dist/esm/api/resources/business/resources/cuisines/client/index.d.mts +1 -0
- package/dist/esm/api/resources/business/resources/cuisines/client/index.mjs +1 -0
- package/dist/esm/api/resources/business/resources/cuisines/exports.d.mts +2 -0
- package/dist/esm/api/resources/business/resources/cuisines/exports.mjs +3 -0
- package/dist/esm/api/resources/business/resources/cuisines/index.d.mts +1 -0
- package/dist/esm/api/resources/business/resources/cuisines/index.mjs +1 -0
- package/dist/esm/api/resources/business/resources/index.d.mts +9 -0
- package/dist/esm/api/resources/business/resources/index.mjs +9 -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/ChannelAuthMessagingRequest.mjs +2 -0
- package/dist/esm/api/resources/business/resources/messaging/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/business/resources/messaging/client/requests/index.mjs +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/UnregisterPushNotificationsRequest.mjs +2 -0
- 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/business/resources/pushNotifications/exports.mjs +3 -0
- 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/RegisterPushNotificationsResponse.mjs +2 -0
- 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 +67 -34
- package/reference.md +564 -202
- package/dist/cjs/api/resources/businessMessaging/client/Client.d.ts +0 -32
- 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/businessPushNotifications/client/Client.d.ts +0 -47
- 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/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/requests/index.d.mts +0 -1
- package/dist/esm/api/resources/businessMessaging/exports.d.mts +0 -2
- package/dist/esm/api/resources/businessPushNotifications/client/Client.d.mts +0 -47
- 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/types/index.d.mts +0 -1
- package/dist/esm/api/resources/businessPushNotifications/types/index.mjs +0 -1
- /package/dist/cjs/api/resources/{businessMessaging → business/resources/businesses}/client/index.d.ts +0 -0
- /package/dist/cjs/api/resources/{businessMessaging → business/resources/businesses}/client/index.js +0 -0
- /package/dist/cjs/api/resources/{businessMessaging/client/requests/BusinessChannelAuthAuthenticateRequest.js → business/resources/businesses/client/requests/DeleteBusinessesRequest.js} +0 -0
- /package/dist/cjs/api/resources/{businessPushNotifications/client/requests/UnregisterBusinessPushTokenRequest.js → business/resources/businesses/client/requests/GetBusinessesRequest.js} +0 -0
- /package/dist/cjs/api/resources/{businessPushNotifications/types/RegisterBusinessPushTokenResponse.js → business/resources/businesses/client/requests/UpdateBusinessesRequest.js} +0 -0
- /package/dist/cjs/api/resources/{businessMessaging → business/resources/businesses}/client/requests/index.js +0 -0
- /package/dist/cjs/api/resources/{businessMessaging → business/resources/businesses}/index.d.ts +0 -0
- /package/dist/cjs/api/resources/{businessMessaging → business/resources/businesses}/index.js +0 -0
- /package/dist/{esm/api/resources/businessMessaging/client/requests/index.mjs → cjs/api/resources/business/resources/categories/client/index.d.ts} +0 -0
- /package/dist/cjs/api/resources/{businessPushNotifications → business/resources/pushNotifications}/client/index.d.ts +0 -0
- /package/dist/cjs/api/resources/{businessPushNotifications → 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 → 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/esm/api/resources/{businessMessaging → business/resources/businesses}/client/index.d.mts +0 -0
- /package/dist/esm/api/resources/{businessMessaging → business/resources/businesses}/client/index.mjs +0 -0
- /package/dist/esm/api/resources/{businessMessaging/client/requests/BusinessChannelAuthAuthenticateRequest.mjs → business/resources/businesses/client/requests/DeleteBusinessesRequest.mjs} +0 -0
- /package/dist/esm/api/resources/{businessPushNotifications/client/requests/UnregisterBusinessPushTokenRequest.mjs → business/resources/businesses/client/requests/GetBusinessesRequest.mjs} +0 -0
- /package/dist/esm/api/resources/{businessPushNotifications/types/RegisterBusinessPushTokenResponse.mjs → business/resources/businesses/client/requests/UpdateBusinessesRequest.mjs} +0 -0
- /package/dist/esm/api/resources/{businessMessaging → business/resources/businesses}/index.d.mts +0 -0
- /package/dist/esm/api/resources/{businessMessaging → business/resources/businesses}/index.mjs +0 -0
- /package/dist/esm/api/resources/{businessPushNotifications → business/resources/pushNotifications}/client/index.d.mts +0 -0
- /package/dist/esm/api/resources/{businessPushNotifications → 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 → 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
|
@@ -0,0 +1,62 @@
|
|
|
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 type * as FiveOneEat from "../../../../../index.mjs";
|
|
5
|
+
export declare namespace BusinessesClient {
|
|
6
|
+
type Options = BaseClientOptions;
|
|
7
|
+
interface RequestOptions extends BaseRequestOptions {
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
export declare class BusinessesClient {
|
|
11
|
+
protected readonly _options: NormalizedClientOptionsWithAuth<BusinessesClient.Options>;
|
|
12
|
+
constructor(options?: BusinessesClient.Options);
|
|
13
|
+
/**
|
|
14
|
+
* @param {BusinessesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* await client.business.businesses.list()
|
|
18
|
+
*/
|
|
19
|
+
list(requestOptions?: BusinessesClient.RequestOptions): core.HttpResponsePromise<void>;
|
|
20
|
+
private __list;
|
|
21
|
+
/**
|
|
22
|
+
* @param {BusinessesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* await client.business.businesses.create()
|
|
26
|
+
*/
|
|
27
|
+
create(requestOptions?: BusinessesClient.RequestOptions): core.HttpResponsePromise<void>;
|
|
28
|
+
private __create;
|
|
29
|
+
/**
|
|
30
|
+
* @param {FiveOneEat.business.GetBusinessesRequest} request
|
|
31
|
+
* @param {BusinessesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* await client.business.businesses.get({
|
|
35
|
+
* business: "business"
|
|
36
|
+
* })
|
|
37
|
+
*/
|
|
38
|
+
get(request: FiveOneEat.business.GetBusinessesRequest, requestOptions?: BusinessesClient.RequestOptions): core.HttpResponsePromise<void>;
|
|
39
|
+
private __get;
|
|
40
|
+
/**
|
|
41
|
+
* @param {FiveOneEat.business.UpdateBusinessesRequest} request
|
|
42
|
+
* @param {BusinessesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* await client.business.businesses.update({
|
|
46
|
+
* business: "business"
|
|
47
|
+
* })
|
|
48
|
+
*/
|
|
49
|
+
update(request: FiveOneEat.business.UpdateBusinessesRequest, requestOptions?: BusinessesClient.RequestOptions): core.HttpResponsePromise<void>;
|
|
50
|
+
private __update;
|
|
51
|
+
/**
|
|
52
|
+
* @param {FiveOneEat.business.DeleteBusinessesRequest} request
|
|
53
|
+
* @param {BusinessesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* await client.business.businesses.delete({
|
|
57
|
+
* business: "business"
|
|
58
|
+
* })
|
|
59
|
+
*/
|
|
60
|
+
delete(request: FiveOneEat.business.DeleteBusinessesRequest, requestOptions?: BusinessesClient.RequestOptions): core.HttpResponsePromise<void>;
|
|
61
|
+
private __delete;
|
|
62
|
+
}
|
|
@@ -0,0 +1,223 @@
|
|
|
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
|
+
export class BusinessesClient {
|
|
18
|
+
constructor(options = {}) {
|
|
19
|
+
this._options = normalizeClientOptionsWithAuth(options);
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* @param {BusinessesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* await client.business.businesses.list()
|
|
26
|
+
*/
|
|
27
|
+
list(requestOptions) {
|
|
28
|
+
return core.HttpResponsePromise.fromPromise(this.__list(requestOptions));
|
|
29
|
+
}
|
|
30
|
+
__list(requestOptions) {
|
|
31
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
32
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
33
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
34
|
+
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);
|
|
35
|
+
const _response = yield core.fetcher({
|
|
36
|
+
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/businesses"),
|
|
37
|
+
method: "GET",
|
|
38
|
+
headers: _headers,
|
|
39
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
40
|
+
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,
|
|
41
|
+
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,
|
|
42
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
43
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
44
|
+
logging: this._options.logging,
|
|
45
|
+
});
|
|
46
|
+
if (_response.ok) {
|
|
47
|
+
return { data: undefined, rawResponse: _response.rawResponse };
|
|
48
|
+
}
|
|
49
|
+
if (_response.error.reason === "status-code") {
|
|
50
|
+
throw new errors.FiveOneEatError({
|
|
51
|
+
statusCode: _response.error.statusCode,
|
|
52
|
+
body: _response.error.body,
|
|
53
|
+
rawResponse: _response.rawResponse,
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/business/businesses");
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* @param {BusinessesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
61
|
+
*
|
|
62
|
+
* @example
|
|
63
|
+
* await client.business.businesses.create()
|
|
64
|
+
*/
|
|
65
|
+
create(requestOptions) {
|
|
66
|
+
return core.HttpResponsePromise.fromPromise(this.__create(requestOptions));
|
|
67
|
+
}
|
|
68
|
+
__create(requestOptions) {
|
|
69
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
70
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
71
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
72
|
+
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);
|
|
73
|
+
const _response = yield core.fetcher({
|
|
74
|
+
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/businesses"),
|
|
75
|
+
method: "POST",
|
|
76
|
+
headers: _headers,
|
|
77
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
78
|
+
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,
|
|
79
|
+
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,
|
|
80
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
81
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
82
|
+
logging: this._options.logging,
|
|
83
|
+
});
|
|
84
|
+
if (_response.ok) {
|
|
85
|
+
return { data: undefined, rawResponse: _response.rawResponse };
|
|
86
|
+
}
|
|
87
|
+
if (_response.error.reason === "status-code") {
|
|
88
|
+
throw new errors.FiveOneEatError({
|
|
89
|
+
statusCode: _response.error.statusCode,
|
|
90
|
+
body: _response.error.body,
|
|
91
|
+
rawResponse: _response.rawResponse,
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/business/businesses");
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* @param {FiveOneEat.business.GetBusinessesRequest} request
|
|
99
|
+
* @param {BusinessesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
100
|
+
*
|
|
101
|
+
* @example
|
|
102
|
+
* await client.business.businesses.get({
|
|
103
|
+
* business: "business"
|
|
104
|
+
* })
|
|
105
|
+
*/
|
|
106
|
+
get(request, requestOptions) {
|
|
107
|
+
return core.HttpResponsePromise.fromPromise(this.__get(request, requestOptions));
|
|
108
|
+
}
|
|
109
|
+
__get(request, requestOptions) {
|
|
110
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
111
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
112
|
+
const { business } = request;
|
|
113
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
114
|
+
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);
|
|
115
|
+
const _response = yield core.fetcher({
|
|
116
|
+
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/businesses/${core.url.encodePathParam(business)}`),
|
|
117
|
+
method: "GET",
|
|
118
|
+
headers: _headers,
|
|
119
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
120
|
+
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,
|
|
121
|
+
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,
|
|
122
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
123
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
124
|
+
logging: this._options.logging,
|
|
125
|
+
});
|
|
126
|
+
if (_response.ok) {
|
|
127
|
+
return { data: undefined, rawResponse: _response.rawResponse };
|
|
128
|
+
}
|
|
129
|
+
if (_response.error.reason === "status-code") {
|
|
130
|
+
throw new errors.FiveOneEatError({
|
|
131
|
+
statusCode: _response.error.statusCode,
|
|
132
|
+
body: _response.error.body,
|
|
133
|
+
rawResponse: _response.rawResponse,
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/business/businesses/{business}");
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* @param {FiveOneEat.business.UpdateBusinessesRequest} request
|
|
141
|
+
* @param {BusinessesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
142
|
+
*
|
|
143
|
+
* @example
|
|
144
|
+
* await client.business.businesses.update({
|
|
145
|
+
* business: "business"
|
|
146
|
+
* })
|
|
147
|
+
*/
|
|
148
|
+
update(request, requestOptions) {
|
|
149
|
+
return core.HttpResponsePromise.fromPromise(this.__update(request, requestOptions));
|
|
150
|
+
}
|
|
151
|
+
__update(request, requestOptions) {
|
|
152
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
153
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
154
|
+
const { business } = request;
|
|
155
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
156
|
+
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);
|
|
157
|
+
const _response = yield core.fetcher({
|
|
158
|
+
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/businesses/${core.url.encodePathParam(business)}`),
|
|
159
|
+
method: "PUT",
|
|
160
|
+
headers: _headers,
|
|
161
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
162
|
+
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,
|
|
163
|
+
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,
|
|
164
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
165
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
166
|
+
logging: this._options.logging,
|
|
167
|
+
});
|
|
168
|
+
if (_response.ok) {
|
|
169
|
+
return { data: undefined, rawResponse: _response.rawResponse };
|
|
170
|
+
}
|
|
171
|
+
if (_response.error.reason === "status-code") {
|
|
172
|
+
throw new errors.FiveOneEatError({
|
|
173
|
+
statusCode: _response.error.statusCode,
|
|
174
|
+
body: _response.error.body,
|
|
175
|
+
rawResponse: _response.rawResponse,
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "PUT", "/business/businesses/{business}");
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* @param {FiveOneEat.business.DeleteBusinessesRequest} request
|
|
183
|
+
* @param {BusinessesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
184
|
+
*
|
|
185
|
+
* @example
|
|
186
|
+
* await client.business.businesses.delete({
|
|
187
|
+
* business: "business"
|
|
188
|
+
* })
|
|
189
|
+
*/
|
|
190
|
+
delete(request, requestOptions) {
|
|
191
|
+
return core.HttpResponsePromise.fromPromise(this.__delete(request, requestOptions));
|
|
192
|
+
}
|
|
193
|
+
__delete(request, requestOptions) {
|
|
194
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
195
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
196
|
+
const { business } = request;
|
|
197
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
198
|
+
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);
|
|
199
|
+
const _response = yield core.fetcher({
|
|
200
|
+
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/businesses/${core.url.encodePathParam(business)}`),
|
|
201
|
+
method: "DELETE",
|
|
202
|
+
headers: _headers,
|
|
203
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
204
|
+
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,
|
|
205
|
+
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,
|
|
206
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
207
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
208
|
+
logging: this._options.logging,
|
|
209
|
+
});
|
|
210
|
+
if (_response.ok) {
|
|
211
|
+
return { data: undefined, rawResponse: _response.rawResponse };
|
|
212
|
+
}
|
|
213
|
+
if (_response.error.reason === "status-code") {
|
|
214
|
+
throw new errors.FiveOneEatError({
|
|
215
|
+
statusCode: _response.error.statusCode,
|
|
216
|
+
body: _response.error.body,
|
|
217
|
+
rawResponse: _response.rawResponse,
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/business/businesses/{business}");
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.mjs";
|
|
2
|
+
import { type NormalizedClientOptionsWithAuth } from "../../../../../../BaseClient.mjs";
|
|
3
|
+
import * as core from "../../../../../../core/index.mjs";
|
|
4
|
+
export declare namespace CategoriesClient {
|
|
5
|
+
type Options = BaseClientOptions;
|
|
6
|
+
interface RequestOptions extends BaseRequestOptions {
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
export declare class CategoriesClient {
|
|
10
|
+
protected readonly _options: NormalizedClientOptionsWithAuth<CategoriesClient.Options>;
|
|
11
|
+
constructor(options?: CategoriesClient.Options);
|
|
12
|
+
/**
|
|
13
|
+
* @param {CategoriesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* await client.business.categories.list()
|
|
17
|
+
*/
|
|
18
|
+
list(requestOptions?: CategoriesClient.RequestOptions): core.HttpResponsePromise<void>;
|
|
19
|
+
private __list;
|
|
20
|
+
}
|
package/dist/esm/api/resources/{businessMessaging → business/resources/categories}/client/Client.mjs
RENAMED
|
@@ -8,50 +8,35 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
-
import { normalizeClientOptionsWithAuth } from "
|
|
12
|
-
import { mergeHeaders } from "
|
|
13
|
-
import * as core from "
|
|
14
|
-
import * as environments from "
|
|
15
|
-
import { handleNonStatusCodeError } from "
|
|
16
|
-
import * as errors from "
|
|
17
|
-
|
|
18
|
-
export class BusinessMessagingClient {
|
|
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
|
+
export class CategoriesClient {
|
|
19
18
|
constructor(options = {}) {
|
|
20
19
|
this._options = normalizeClientOptionsWithAuth(options);
|
|
21
20
|
}
|
|
22
21
|
/**
|
|
23
|
-
*
|
|
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}
|
|
22
|
+
* @param {CategoriesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
32
23
|
*
|
|
33
24
|
* @example
|
|
34
|
-
* await client.
|
|
35
|
-
* channel_name: "channel_name",
|
|
36
|
-
* socket_id: "socket_id"
|
|
37
|
-
* })
|
|
25
|
+
* await client.business.categories.list()
|
|
38
26
|
*/
|
|
39
|
-
|
|
40
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
27
|
+
list(requestOptions) {
|
|
28
|
+
return core.HttpResponsePromise.fromPromise(this.__list(requestOptions));
|
|
41
29
|
}
|
|
42
|
-
|
|
30
|
+
__list(requestOptions) {
|
|
43
31
|
return __awaiter(this, void 0, void 0, function* () {
|
|
44
32
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
45
33
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
46
34
|
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
35
|
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/
|
|
49
|
-
method: "
|
|
36
|
+
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/categories"),
|
|
37
|
+
method: "GET",
|
|
50
38
|
headers: _headers,
|
|
51
|
-
contentType: "application/json",
|
|
52
39
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
53
|
-
requestType: "json",
|
|
54
|
-
body: request,
|
|
55
40
|
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
41
|
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
42
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -59,23 +44,16 @@ export class BusinessMessagingClient {
|
|
|
59
44
|
logging: this._options.logging,
|
|
60
45
|
});
|
|
61
46
|
if (_response.ok) {
|
|
62
|
-
return { data:
|
|
47
|
+
return { data: undefined, rawResponse: _response.rawResponse };
|
|
63
48
|
}
|
|
64
49
|
if (_response.error.reason === "status-code") {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
default:
|
|
71
|
-
throw new errors.FiveOneEatError({
|
|
72
|
-
statusCode: _response.error.statusCode,
|
|
73
|
-
body: _response.error.body,
|
|
74
|
-
rawResponse: _response.rawResponse,
|
|
75
|
-
});
|
|
76
|
-
}
|
|
50
|
+
throw new errors.FiveOneEatError({
|
|
51
|
+
statusCode: _response.error.statusCode,
|
|
52
|
+
body: _response.error.body,
|
|
53
|
+
rawResponse: _response.rawResponse,
|
|
54
|
+
});
|
|
77
55
|
}
|
|
78
|
-
return handleNonStatusCodeError(_response.error, _response.rawResponse, "
|
|
56
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/business/categories");
|
|
79
57
|
});
|
|
80
58
|
}
|
|
81
59
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./client/index.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./client/index.mjs";
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.mjs";
|
|
2
|
+
import { type NormalizedClientOptionsWithAuth } from "../../../../../../BaseClient.mjs";
|
|
3
|
+
import * as core from "../../../../../../core/index.mjs";
|
|
4
|
+
export declare namespace CertificationsClient {
|
|
5
|
+
type Options = BaseClientOptions;
|
|
6
|
+
interface RequestOptions extends BaseRequestOptions {
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
export declare class CertificationsClient {
|
|
10
|
+
protected readonly _options: NormalizedClientOptionsWithAuth<CertificationsClient.Options>;
|
|
11
|
+
constructor(options?: CertificationsClient.Options);
|
|
12
|
+
/**
|
|
13
|
+
* @param {CertificationsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* await client.business.certifications.list()
|
|
17
|
+
*/
|
|
18
|
+
list(requestOptions?: CertificationsClient.RequestOptions): core.HttpResponsePromise<void>;
|
|
19
|
+
private __list;
|
|
20
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
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
|
+
export class CertificationsClient {
|
|
18
|
+
constructor(options = {}) {
|
|
19
|
+
this._options = normalizeClientOptionsWithAuth(options);
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* @param {CertificationsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* await client.business.certifications.list()
|
|
26
|
+
*/
|
|
27
|
+
list(requestOptions) {
|
|
28
|
+
return core.HttpResponsePromise.fromPromise(this.__list(requestOptions));
|
|
29
|
+
}
|
|
30
|
+
__list(requestOptions) {
|
|
31
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
32
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
33
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
34
|
+
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);
|
|
35
|
+
const _response = yield core.fetcher({
|
|
36
|
+
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/certifications"),
|
|
37
|
+
method: "GET",
|
|
38
|
+
headers: _headers,
|
|
39
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
40
|
+
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,
|
|
41
|
+
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,
|
|
42
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
43
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
44
|
+
logging: this._options.logging,
|
|
45
|
+
});
|
|
46
|
+
if (_response.ok) {
|
|
47
|
+
return { data: undefined, rawResponse: _response.rawResponse };
|
|
48
|
+
}
|
|
49
|
+
if (_response.error.reason === "status-code") {
|
|
50
|
+
throw new errors.FiveOneEatError({
|
|
51
|
+
statusCode: _response.error.statusCode,
|
|
52
|
+
body: _response.error.body,
|
|
53
|
+
rawResponse: _response.rawResponse,
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/business/certifications");
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./client/index.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./client/index.mjs";
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.mjs";
|
|
2
|
+
import { type NormalizedClientOptionsWithAuth } from "../../../../../../BaseClient.mjs";
|
|
3
|
+
import * as core from "../../../../../../core/index.mjs";
|
|
4
|
+
export declare namespace CuisinesClient {
|
|
5
|
+
type Options = BaseClientOptions;
|
|
6
|
+
interface RequestOptions extends BaseRequestOptions {
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
export declare class CuisinesClient {
|
|
10
|
+
protected readonly _options: NormalizedClientOptionsWithAuth<CuisinesClient.Options>;
|
|
11
|
+
constructor(options?: CuisinesClient.Options);
|
|
12
|
+
/**
|
|
13
|
+
* @param {CuisinesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* await client.business.cuisines.list()
|
|
17
|
+
*/
|
|
18
|
+
list(requestOptions?: CuisinesClient.RequestOptions): core.HttpResponsePromise<void>;
|
|
19
|
+
private __list;
|
|
20
|
+
}
|