@51eat/sdk 0.0.22 → 0.0.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/BaseClient.js +2 -2
- package/dist/cjs/api/resources/business/client/Client.d.ts +12 -0
- package/dist/cjs/api/resources/business/client/Client.js +30 -10
- package/dist/cjs/api/resources/business/resources/businesses/client/Client.d.ts +103 -0
- package/dist/cjs/api/resources/business/resources/businesses/client/Client.js +383 -0
- package/dist/cjs/api/resources/business/resources/businesses/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/business/resources/businesses/client/index.js +17 -0
- package/dist/cjs/api/resources/business/resources/businesses/client/requests/DeleteBusinessesRequest.d.ts +10 -0
- package/dist/cjs/api/resources/business/resources/businesses/client/requests/DeleteBusinessesRequest.js +3 -0
- package/dist/cjs/api/resources/business/resources/businesses/client/requests/GetBusinessesRequest.d.ts +10 -0
- package/dist/cjs/api/resources/business/resources/businesses/client/requests/GetBusinessesRequest.js +3 -0
- package/dist/cjs/api/resources/business/resources/businesses/client/requests/ListBusinessesRequest.d.ts +10 -0
- package/dist/cjs/api/resources/business/resources/businesses/client/requests/ListBusinessesRequest.js +3 -0
- package/dist/cjs/api/resources/business/resources/businesses/client/requests/StoreBusinessRequest.d.ts +50 -0
- package/dist/cjs/api/resources/business/resources/businesses/client/requests/StoreBusinessRequest.js +24 -0
- package/dist/cjs/api/resources/business/resources/businesses/client/requests/UpdateBusinessRequest.d.ts +62 -0
- package/dist/cjs/api/resources/business/resources/businesses/client/requests/UpdateBusinessRequest.js +24 -0
- package/dist/cjs/api/resources/business/resources/businesses/client/requests/index.d.ts +5 -0
- package/dist/cjs/api/resources/business/resources/businesses/client/requests/index.js +7 -0
- package/dist/cjs/api/resources/business/resources/businesses/exports.d.ts +2 -0
- package/dist/cjs/api/resources/business/resources/businesses/exports.js +21 -0
- package/dist/cjs/api/resources/business/resources/businesses/index.d.ts +2 -0
- package/dist/cjs/api/resources/business/resources/businesses/index.js +18 -0
- package/dist/cjs/api/resources/business/resources/businesses/types/GetBusinessesResponse.d.ts +4 -0
- package/dist/cjs/api/resources/business/resources/businesses/types/GetBusinessesResponse.js +3 -0
- package/dist/cjs/api/resources/business/resources/businesses/types/ListBusinessesResponse.d.ts +4 -0
- package/dist/cjs/api/resources/business/resources/businesses/types/ListBusinessesResponse.js +3 -0
- package/dist/cjs/api/resources/business/resources/businesses/types/UpdateBusinessesResponse.d.ts +4 -0
- package/dist/cjs/api/resources/business/resources/businesses/types/UpdateBusinessesResponse.js +3 -0
- package/dist/cjs/api/resources/business/resources/businesses/types/index.d.ts +3 -0
- package/dist/cjs/api/resources/business/resources/businesses/types/index.js +19 -0
- package/dist/cjs/api/resources/business/resources/categories/client/Client.d.ts +26 -0
- package/dist/cjs/api/resources/business/resources/categories/client/Client.js +110 -0
- package/dist/cjs/api/resources/business/resources/categories/client/index.d.ts +1 -0
- 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/business/resources/categories/exports.js +21 -0
- package/dist/cjs/api/resources/business/resources/categories/index.d.ts +2 -0
- package/dist/cjs/api/resources/business/resources/categories/index.js +18 -0
- package/dist/cjs/api/resources/business/resources/categories/types/ListCategoriesResponse.d.ts +4 -0
- package/dist/cjs/api/resources/business/resources/categories/types/ListCategoriesResponse.js +3 -0
- package/dist/cjs/api/resources/business/resources/categories/types/index.d.ts +1 -0
- package/dist/cjs/api/resources/business/resources/categories/types/index.js +17 -0
- package/dist/cjs/api/resources/business/resources/certifications/client/Client.d.ts +26 -0
- package/dist/cjs/api/resources/business/resources/certifications/client/Client.js +110 -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 +2 -0
- package/dist/cjs/api/resources/business/resources/certifications/index.js +18 -0
- package/dist/cjs/api/resources/business/resources/certifications/types/ListCertificationsResponse.d.ts +4 -0
- package/dist/cjs/api/resources/business/resources/certifications/types/ListCertificationsResponse.js +3 -0
- package/dist/cjs/api/resources/business/resources/certifications/types/index.d.ts +1 -0
- package/dist/cjs/api/resources/business/resources/certifications/types/index.js +17 -0
- package/dist/cjs/api/resources/business/resources/cuisines/client/Client.d.ts +26 -0
- package/dist/cjs/api/resources/business/resources/cuisines/client/Client.js +110 -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 +2 -0
- package/dist/cjs/api/resources/business/resources/cuisines/index.js +18 -0
- package/dist/cjs/api/resources/business/resources/cuisines/types/ListCuisinesResponse.d.ts +4 -0
- package/dist/cjs/api/resources/business/resources/cuisines/types/ListCuisinesResponse.js +3 -0
- package/dist/cjs/api/resources/business/resources/cuisines/types/index.d.ts +1 -0
- package/dist/cjs/api/resources/business/resources/cuisines/types/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/profile/client/requests/UpdateBusinessProfileRequest.d.ts +1 -1
- package/dist/cjs/api/resources/customer/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/customer/client/Client.js +3 -3
- package/dist/cjs/api/resources/customer/client/requests/SearchCustomerRequest.d.ts +3 -3
- package/dist/cjs/api/resources/customer/resources/discovery/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/customer/resources/discovery/client/Client.js +1 -1
- package/dist/cjs/api/types/BusinessCategory.d.ts +9 -0
- package/dist/cjs/api/types/BusinessCategory.js +3 -0
- package/dist/cjs/api/types/BusinessCertification.d.ts +7 -0
- package/dist/cjs/api/types/BusinessCertification.js +3 -0
- package/dist/cjs/api/types/BusinessCuisine.d.ts +6 -0
- package/dist/cjs/api/types/BusinessCuisine.js +3 -0
- package/dist/cjs/api/types/BusinessProfile.d.ts +1 -1
- package/dist/cjs/api/types/BusinessSearchResult.d.ts +2 -1
- package/dist/cjs/api/types/BusinessSummary.d.ts +2 -1
- package/dist/cjs/api/types/CustomerBusinessProfile.d.ts +1 -1
- package/dist/cjs/api/types/DiscoveryBusiness.d.ts +2 -1
- package/dist/cjs/api/types/DiscoveryCategory.d.ts +6 -2
- package/dist/cjs/api/types/ExploreBusiness.d.ts +2 -1
- package/dist/cjs/api/types/index.d.ts +3 -0
- package/dist/cjs/api/types/index.js +3 -0
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/BaseClient.mjs +2 -2
- package/dist/esm/api/resources/business/client/Client.d.mts +12 -0
- package/dist/esm/api/resources/business/client/Client.mjs +20 -0
- package/dist/esm/api/resources/business/resources/businesses/client/Client.d.mts +103 -0
- package/dist/esm/api/resources/business/resources/businesses/client/Client.mjs +346 -0
- package/dist/esm/api/resources/business/resources/businesses/client/index.d.mts +1 -0
- package/dist/esm/api/resources/business/resources/businesses/client/index.mjs +1 -0
- package/dist/esm/api/resources/business/resources/businesses/client/requests/DeleteBusinessesRequest.d.mts +10 -0
- package/dist/esm/api/resources/business/resources/businesses/client/requests/DeleteBusinessesRequest.mjs +2 -0
- package/dist/esm/api/resources/business/resources/businesses/client/requests/GetBusinessesRequest.d.mts +10 -0
- package/dist/esm/api/resources/business/resources/businesses/client/requests/GetBusinessesRequest.mjs +2 -0
- package/dist/esm/api/resources/business/resources/businesses/client/requests/ListBusinessesRequest.d.mts +10 -0
- package/dist/esm/api/resources/business/resources/businesses/client/requests/ListBusinessesRequest.mjs +2 -0
- package/dist/esm/api/resources/business/resources/businesses/client/requests/StoreBusinessRequest.d.mts +50 -0
- package/dist/esm/api/resources/business/resources/businesses/client/requests/StoreBusinessRequest.mjs +21 -0
- package/dist/esm/api/resources/business/resources/businesses/client/requests/UpdateBusinessRequest.d.mts +62 -0
- package/dist/esm/api/resources/business/resources/businesses/client/requests/UpdateBusinessRequest.mjs +21 -0
- package/dist/esm/api/resources/business/resources/businesses/client/requests/index.d.mts +5 -0
- package/dist/esm/api/resources/business/resources/businesses/client/requests/index.mjs +2 -0
- package/dist/esm/api/resources/business/resources/businesses/exports.d.mts +2 -0
- package/dist/esm/api/resources/business/resources/businesses/exports.mjs +3 -0
- package/dist/esm/api/resources/business/resources/businesses/index.d.mts +2 -0
- package/dist/esm/api/resources/business/resources/businesses/index.mjs +2 -0
- package/dist/esm/api/resources/business/resources/businesses/types/GetBusinessesResponse.d.mts +4 -0
- package/dist/esm/api/resources/business/resources/businesses/types/GetBusinessesResponse.mjs +2 -0
- package/dist/esm/api/resources/business/resources/businesses/types/ListBusinessesResponse.d.mts +4 -0
- package/dist/esm/api/resources/business/resources/businesses/types/ListBusinessesResponse.mjs +2 -0
- package/dist/esm/api/resources/business/resources/businesses/types/UpdateBusinessesResponse.d.mts +4 -0
- package/dist/esm/api/resources/business/resources/businesses/types/UpdateBusinessesResponse.mjs +2 -0
- package/dist/esm/api/resources/business/resources/businesses/types/index.d.mts +3 -0
- package/dist/esm/api/resources/business/resources/businesses/types/index.mjs +3 -0
- package/dist/esm/api/resources/business/resources/categories/client/Client.d.mts +26 -0
- package/dist/esm/api/resources/business/resources/categories/client/Client.mjs +73 -0
- 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/business/resources/categories/exports.mjs +3 -0
- package/dist/esm/api/resources/business/resources/categories/index.d.mts +2 -0
- package/dist/esm/api/resources/business/resources/categories/index.mjs +2 -0
- package/dist/esm/api/resources/business/resources/categories/types/ListCategoriesResponse.d.mts +4 -0
- package/dist/esm/api/resources/business/resources/categories/types/ListCategoriesResponse.mjs +2 -0
- package/dist/esm/api/resources/business/resources/categories/types/index.d.mts +1 -0
- package/dist/esm/api/resources/business/resources/categories/types/index.mjs +1 -0
- package/dist/esm/api/resources/business/resources/certifications/client/Client.d.mts +26 -0
- package/dist/esm/api/resources/business/resources/certifications/client/Client.mjs +73 -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 +2 -0
- package/dist/esm/api/resources/business/resources/certifications/index.mjs +2 -0
- package/dist/esm/api/resources/business/resources/certifications/types/ListCertificationsResponse.d.mts +4 -0
- package/dist/esm/api/resources/business/resources/certifications/types/ListCertificationsResponse.mjs +2 -0
- package/dist/esm/api/resources/business/resources/certifications/types/index.d.mts +1 -0
- package/dist/esm/api/resources/business/resources/certifications/types/index.mjs +1 -0
- package/dist/esm/api/resources/business/resources/cuisines/client/Client.d.mts +26 -0
- package/dist/esm/api/resources/business/resources/cuisines/client/Client.mjs +73 -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 +2 -0
- package/dist/esm/api/resources/business/resources/cuisines/index.mjs +2 -0
- package/dist/esm/api/resources/business/resources/cuisines/types/ListCuisinesResponse.d.mts +4 -0
- package/dist/esm/api/resources/business/resources/cuisines/types/ListCuisinesResponse.mjs +2 -0
- package/dist/esm/api/resources/business/resources/cuisines/types/index.d.mts +1 -0
- package/dist/esm/api/resources/business/resources/cuisines/types/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/profile/client/requests/UpdateBusinessProfileRequest.d.mts +1 -1
- package/dist/esm/api/resources/customer/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/customer/client/Client.mjs +3 -3
- package/dist/esm/api/resources/customer/client/requests/SearchCustomerRequest.d.mts +3 -3
- package/dist/esm/api/resources/customer/resources/discovery/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/customer/resources/discovery/client/Client.mjs +1 -1
- package/dist/esm/api/types/BusinessCategory.d.mts +9 -0
- package/dist/esm/api/types/BusinessCategory.mjs +2 -0
- package/dist/esm/api/types/BusinessCertification.d.mts +7 -0
- package/dist/esm/api/types/BusinessCertification.mjs +2 -0
- package/dist/esm/api/types/BusinessCuisine.d.mts +6 -0
- package/dist/esm/api/types/BusinessCuisine.mjs +2 -0
- package/dist/esm/api/types/BusinessProfile.d.mts +1 -1
- package/dist/esm/api/types/BusinessSearchResult.d.mts +2 -1
- package/dist/esm/api/types/BusinessSummary.d.mts +2 -1
- package/dist/esm/api/types/CustomerBusinessProfile.d.mts +1 -1
- package/dist/esm/api/types/DiscoveryBusiness.d.mts +2 -1
- package/dist/esm/api/types/DiscoveryCategory.d.mts +6 -2
- package/dist/esm/api/types/ExploreBusiness.d.mts +2 -1
- package/dist/esm/api/types/index.d.mts +3 -0
- package/dist/esm/api/types/index.mjs +3 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +45 -1
- package/reference.md +504 -2
|
@@ -5,7 +5,6 @@ export interface CustomerBusinessProfile {
|
|
|
5
5
|
handle: string;
|
|
6
6
|
description: string | null;
|
|
7
7
|
bio: string | null;
|
|
8
|
-
category: string | null;
|
|
9
8
|
email: string | null;
|
|
10
9
|
phone: string | null;
|
|
11
10
|
website: string | null;
|
|
@@ -35,6 +34,7 @@ export interface CustomerBusinessProfile {
|
|
|
35
34
|
staff_pick: boolean;
|
|
36
35
|
favorites_count: number;
|
|
37
36
|
is_favorited: boolean;
|
|
37
|
+
categories?: FiveOneEat.BusinessCategory[] | undefined;
|
|
38
38
|
cuisines?: CustomerBusinessProfile.Cuisines.Item[] | undefined;
|
|
39
39
|
certifications?: CustomerBusinessProfile.Certifications.Item[] | undefined;
|
|
40
40
|
temporary_locations?: FiveOneEat.CustomerTemporaryLocation[] | undefined;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import type * as FiveOneEat from "../index.js";
|
|
1
2
|
export interface DiscoveryBusiness {
|
|
2
3
|
id: string;
|
|
3
4
|
name: string;
|
|
4
5
|
handle: string;
|
|
5
|
-
|
|
6
|
+
categories?: FiveOneEat.BusinessCategory[] | undefined;
|
|
6
7
|
description: string | null;
|
|
7
8
|
bio: string | null;
|
|
8
9
|
location: DiscoveryBusiness.Location;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import type * as FiveOneEat from "../index.js";
|
|
1
2
|
export interface ExploreBusiness {
|
|
2
3
|
id: string;
|
|
3
4
|
name: string;
|
|
4
5
|
handle: string;
|
|
5
|
-
|
|
6
|
+
categories?: FiveOneEat.BusinessCategory[] | undefined;
|
|
6
7
|
latitude: number | null;
|
|
7
8
|
longitude: number | null;
|
|
8
9
|
logo: string | null;
|
|
@@ -21,7 +21,10 @@ export * from "./BardSetNode.js";
|
|
|
21
21
|
export * from "./BardSetValues.js";
|
|
22
22
|
export * from "./BardTextNode.js";
|
|
23
23
|
export * from "./BusinessBulletin.js";
|
|
24
|
+
export * from "./BusinessCategory.js";
|
|
25
|
+
export * from "./BusinessCertification.js";
|
|
24
26
|
export * from "./BusinessConversation.js";
|
|
27
|
+
export * from "./BusinessCuisine.js";
|
|
25
28
|
export * from "./BusinessLoginResponse.js";
|
|
26
29
|
export * from "./BusinessMe.js";
|
|
27
30
|
export * from "./BusinessMenu.js";
|
|
@@ -37,7 +37,10 @@ __exportStar(require("./BardSetNode.js"), exports);
|
|
|
37
37
|
__exportStar(require("./BardSetValues.js"), exports);
|
|
38
38
|
__exportStar(require("./BardTextNode.js"), exports);
|
|
39
39
|
__exportStar(require("./BusinessBulletin.js"), exports);
|
|
40
|
+
__exportStar(require("./BusinessCategory.js"), exports);
|
|
41
|
+
__exportStar(require("./BusinessCertification.js"), exports);
|
|
40
42
|
__exportStar(require("./BusinessConversation.js"), exports);
|
|
43
|
+
__exportStar(require("./BusinessCuisine.js"), exports);
|
|
41
44
|
__exportStar(require("./BusinessLoginResponse.js"), exports);
|
|
42
45
|
__exportStar(require("./BusinessMe.js"), exports);
|
|
43
46
|
__exportStar(require("./BusinessMenu.js"), exports);
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.0.
|
|
1
|
+
export declare const SDK_VERSION = "0.0.24";
|
package/dist/cjs/version.js
CHANGED
package/dist/esm/BaseClient.mjs
CHANGED
|
@@ -6,8 +6,8 @@ export function normalizeClientOptions(options) {
|
|
|
6
6
|
const headers = mergeHeaders({
|
|
7
7
|
"X-Fern-Language": "JavaScript",
|
|
8
8
|
"X-Fern-SDK-Name": "@51eat/sdk",
|
|
9
|
-
"X-Fern-SDK-Version": "0.0.
|
|
10
|
-
"User-Agent": "@51eat/sdk/0.0.
|
|
9
|
+
"X-Fern-SDK-Version": "0.0.24",
|
|
10
|
+
"User-Agent": "@51eat/sdk/0.0.24",
|
|
11
11
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
12
12
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
13
13
|
}, options === null || options === void 0 ? void 0 : options.headers);
|
|
@@ -2,6 +2,10 @@ import type { BaseClientOptions } from "../../../../BaseClient.mjs";
|
|
|
2
2
|
import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.mjs";
|
|
3
3
|
import { AuthClient } from "../resources/auth/client/Client.mjs";
|
|
4
4
|
import { BulletinsClient } from "../resources/bulletins/client/Client.mjs";
|
|
5
|
+
import { BusinessesClient } from "../resources/businesses/client/Client.mjs";
|
|
6
|
+
import { CategoriesClient } from "../resources/categories/client/Client.mjs";
|
|
7
|
+
import { CertificationsClient } from "../resources/certifications/client/Client.mjs";
|
|
8
|
+
import { CuisinesClient } from "../resources/cuisines/client/Client.mjs";
|
|
5
9
|
import { GalleryClient } from "../resources/gallery/client/Client.mjs";
|
|
6
10
|
import { MenusClient } from "../resources/menus/client/Client.mjs";
|
|
7
11
|
import { MessagingClient } from "../resources/messaging/client/Client.mjs";
|
|
@@ -14,17 +18,25 @@ export declare class BusinessClient {
|
|
|
14
18
|
protected readonly _options: NormalizedClientOptionsWithAuth<BusinessClient.Options>;
|
|
15
19
|
protected _auth: AuthClient | undefined;
|
|
16
20
|
protected _bulletins: BulletinsClient | undefined;
|
|
21
|
+
protected _businesses: BusinessesClient | undefined;
|
|
17
22
|
protected _gallery: GalleryClient | undefined;
|
|
18
23
|
protected _menus: MenusClient | undefined;
|
|
19
24
|
protected _messaging: MessagingClient | undefined;
|
|
20
25
|
protected _profile: ProfileClient | undefined;
|
|
21
26
|
protected _pushNotifications: PushNotificationsClient | undefined;
|
|
27
|
+
protected _cuisines: CuisinesClient | undefined;
|
|
28
|
+
protected _certifications: CertificationsClient | undefined;
|
|
29
|
+
protected _categories: CategoriesClient | undefined;
|
|
22
30
|
constructor(options?: BusinessClient.Options);
|
|
23
31
|
get auth(): AuthClient;
|
|
24
32
|
get bulletins(): BulletinsClient;
|
|
33
|
+
get businesses(): BusinessesClient;
|
|
25
34
|
get gallery(): GalleryClient;
|
|
26
35
|
get menus(): MenusClient;
|
|
27
36
|
get messaging(): MessagingClient;
|
|
28
37
|
get profile(): ProfileClient;
|
|
29
38
|
get pushNotifications(): PushNotificationsClient;
|
|
39
|
+
get cuisines(): CuisinesClient;
|
|
40
|
+
get certifications(): CertificationsClient;
|
|
41
|
+
get categories(): CategoriesClient;
|
|
30
42
|
}
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
import { normalizeClientOptionsWithAuth } from "../../../../BaseClient.mjs";
|
|
3
3
|
import { AuthClient } from "../resources/auth/client/Client.mjs";
|
|
4
4
|
import { BulletinsClient } from "../resources/bulletins/client/Client.mjs";
|
|
5
|
+
import { BusinessesClient } from "../resources/businesses/client/Client.mjs";
|
|
6
|
+
import { CategoriesClient } from "../resources/categories/client/Client.mjs";
|
|
7
|
+
import { CertificationsClient } from "../resources/certifications/client/Client.mjs";
|
|
8
|
+
import { CuisinesClient } from "../resources/cuisines/client/Client.mjs";
|
|
5
9
|
import { GalleryClient } from "../resources/gallery/client/Client.mjs";
|
|
6
10
|
import { MenusClient } from "../resources/menus/client/Client.mjs";
|
|
7
11
|
import { MessagingClient } from "../resources/messaging/client/Client.mjs";
|
|
@@ -19,6 +23,10 @@ export class BusinessClient {
|
|
|
19
23
|
var _a;
|
|
20
24
|
return ((_a = this._bulletins) !== null && _a !== void 0 ? _a : (this._bulletins = new BulletinsClient(this._options)));
|
|
21
25
|
}
|
|
26
|
+
get businesses() {
|
|
27
|
+
var _a;
|
|
28
|
+
return ((_a = this._businesses) !== null && _a !== void 0 ? _a : (this._businesses = new BusinessesClient(this._options)));
|
|
29
|
+
}
|
|
22
30
|
get gallery() {
|
|
23
31
|
var _a;
|
|
24
32
|
return ((_a = this._gallery) !== null && _a !== void 0 ? _a : (this._gallery = new GalleryClient(this._options)));
|
|
@@ -39,4 +47,16 @@ export class BusinessClient {
|
|
|
39
47
|
var _a;
|
|
40
48
|
return ((_a = this._pushNotifications) !== null && _a !== void 0 ? _a : (this._pushNotifications = new PushNotificationsClient(this._options)));
|
|
41
49
|
}
|
|
50
|
+
get cuisines() {
|
|
51
|
+
var _a;
|
|
52
|
+
return ((_a = this._cuisines) !== null && _a !== void 0 ? _a : (this._cuisines = new CuisinesClient(this._options)));
|
|
53
|
+
}
|
|
54
|
+
get certifications() {
|
|
55
|
+
var _a;
|
|
56
|
+
return ((_a = this._certifications) !== null && _a !== void 0 ? _a : (this._certifications = new CertificationsClient(this._options)));
|
|
57
|
+
}
|
|
58
|
+
get categories() {
|
|
59
|
+
var _a;
|
|
60
|
+
return ((_a = this._categories) !== null && _a !== void 0 ? _a : (this._categories = new CategoriesClient(this._options)));
|
|
61
|
+
}
|
|
42
62
|
}
|
|
@@ -0,0 +1,103 @@
|
|
|
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 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
|
+
* Retrieve a paginated list of all businesses owned by the authenticated user.
|
|
15
|
+
* Useful for rendering a business picker in the companion mobile app.
|
|
16
|
+
*
|
|
17
|
+
* @param {FiveOneEat.business.ListBusinessesRequest} request
|
|
18
|
+
* @param {BusinessesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
19
|
+
*
|
|
20
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
21
|
+
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* await client.business.businesses.list()
|
|
25
|
+
*/
|
|
26
|
+
list(request?: FiveOneEat.business.ListBusinessesRequest, requestOptions?: BusinessesClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.business.ListBusinessesResponse>;
|
|
27
|
+
private __list;
|
|
28
|
+
/**
|
|
29
|
+
* Create a new business owned by the authenticated user. The newly created
|
|
30
|
+
* business is automatically set as the user's active business.
|
|
31
|
+
*
|
|
32
|
+
* @param {FiveOneEat.business.StoreBusinessRequest} request
|
|
33
|
+
* @param {BusinessesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
34
|
+
*
|
|
35
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
36
|
+
* @throws {@link FiveOneEat.ForbiddenError}
|
|
37
|
+
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* await client.business.businesses.create({
|
|
41
|
+
* name: "name",
|
|
42
|
+
* handle: "handle",
|
|
43
|
+
* category_ids: [1]
|
|
44
|
+
* })
|
|
45
|
+
*/
|
|
46
|
+
create(request: FiveOneEat.business.StoreBusinessRequest, requestOptions?: BusinessesClient.RequestOptions): core.HttpResponsePromise<number>;
|
|
47
|
+
private __create;
|
|
48
|
+
/**
|
|
49
|
+
* Retrieve a single business owned by the authenticated user.
|
|
50
|
+
*
|
|
51
|
+
* @param {FiveOneEat.business.GetBusinessesRequest} request
|
|
52
|
+
* @param {BusinessesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
53
|
+
*
|
|
54
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
55
|
+
* @throws {@link FiveOneEat.ForbiddenError}
|
|
56
|
+
* @throws {@link FiveOneEat.NotFoundError}
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* await client.business.businesses.get({
|
|
60
|
+
* business: "business"
|
|
61
|
+
* })
|
|
62
|
+
*/
|
|
63
|
+
get(request: FiveOneEat.business.GetBusinessesRequest, requestOptions?: BusinessesClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.business.GetBusinessesResponse>;
|
|
64
|
+
private __get;
|
|
65
|
+
/**
|
|
66
|
+
* Update core fields for a business owned by the authenticated user.
|
|
67
|
+
*
|
|
68
|
+
* @param {FiveOneEat.business.UpdateBusinessRequest} request
|
|
69
|
+
* @param {BusinessesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
70
|
+
*
|
|
71
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
72
|
+
* @throws {@link FiveOneEat.ForbiddenError}
|
|
73
|
+
* @throws {@link FiveOneEat.NotFoundError}
|
|
74
|
+
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
75
|
+
*
|
|
76
|
+
* @example
|
|
77
|
+
* await client.business.businesses.update({
|
|
78
|
+
* business: "business",
|
|
79
|
+
* name: "name",
|
|
80
|
+
* handle: "handle",
|
|
81
|
+
* category_ids: [1]
|
|
82
|
+
* })
|
|
83
|
+
*/
|
|
84
|
+
update(request: FiveOneEat.business.UpdateBusinessRequest, requestOptions?: BusinessesClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.business.UpdateBusinessesResponse>;
|
|
85
|
+
private __update;
|
|
86
|
+
/**
|
|
87
|
+
* Delete a business owned by the authenticated user.
|
|
88
|
+
*
|
|
89
|
+
* @param {FiveOneEat.business.DeleteBusinessesRequest} request
|
|
90
|
+
* @param {BusinessesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
91
|
+
*
|
|
92
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
93
|
+
* @throws {@link FiveOneEat.ForbiddenError}
|
|
94
|
+
* @throws {@link FiveOneEat.NotFoundError}
|
|
95
|
+
*
|
|
96
|
+
* @example
|
|
97
|
+
* await client.business.businesses.delete({
|
|
98
|
+
* business: "business"
|
|
99
|
+
* })
|
|
100
|
+
*/
|
|
101
|
+
delete(request: FiveOneEat.business.DeleteBusinessesRequest, requestOptions?: BusinessesClient.RequestOptions): core.HttpResponsePromise<void>;
|
|
102
|
+
private __delete;
|
|
103
|
+
}
|
|
@@ -0,0 +1,346 @@
|
|
|
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
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
12
|
+
var t = {};
|
|
13
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
14
|
+
t[p] = s[p];
|
|
15
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
16
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
17
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
18
|
+
t[p[i]] = s[p[i]];
|
|
19
|
+
}
|
|
20
|
+
return t;
|
|
21
|
+
};
|
|
22
|
+
import { normalizeClientOptionsWithAuth } from "../../../../../../BaseClient.mjs";
|
|
23
|
+
import { mergeHeaders } from "../../../../../../core/headers.mjs";
|
|
24
|
+
import * as core from "../../../../../../core/index.mjs";
|
|
25
|
+
import * as environments from "../../../../../../environments.mjs";
|
|
26
|
+
import { handleNonStatusCodeError } from "../../../../../../errors/handleNonStatusCodeError.mjs";
|
|
27
|
+
import * as errors from "../../../../../../errors/index.mjs";
|
|
28
|
+
import * as FiveOneEat from "../../../../../index.mjs";
|
|
29
|
+
export class BusinessesClient {
|
|
30
|
+
constructor(options = {}) {
|
|
31
|
+
this._options = normalizeClientOptionsWithAuth(options);
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Retrieve a paginated list of all businesses owned by the authenticated user.
|
|
35
|
+
* Useful for rendering a business picker in the companion mobile app.
|
|
36
|
+
*
|
|
37
|
+
* @param {FiveOneEat.business.ListBusinessesRequest} request
|
|
38
|
+
* @param {BusinessesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
39
|
+
*
|
|
40
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
41
|
+
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* await client.business.businesses.list()
|
|
45
|
+
*/
|
|
46
|
+
list(request = {}, requestOptions) {
|
|
47
|
+
return core.HttpResponsePromise.fromPromise(this.__list(request, requestOptions));
|
|
48
|
+
}
|
|
49
|
+
__list() {
|
|
50
|
+
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
51
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
52
|
+
const { page, per_page: perPage } = request;
|
|
53
|
+
const _queryParams = {
|
|
54
|
+
page,
|
|
55
|
+
per_page: perPage,
|
|
56
|
+
};
|
|
57
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
58
|
+
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);
|
|
59
|
+
const _response = yield core.fetcher({
|
|
60
|
+
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"),
|
|
61
|
+
method: "GET",
|
|
62
|
+
headers: _headers,
|
|
63
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
64
|
+
queryString: core.url
|
|
65
|
+
.queryBuilder()
|
|
66
|
+
.addMany(_queryParams)
|
|
67
|
+
.mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
|
|
68
|
+
.build(),
|
|
69
|
+
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,
|
|
70
|
+
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,
|
|
71
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
72
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
73
|
+
logging: this._options.logging,
|
|
74
|
+
});
|
|
75
|
+
if (_response.ok) {
|
|
76
|
+
return {
|
|
77
|
+
data: _response.body,
|
|
78
|
+
rawResponse: _response.rawResponse,
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
if (_response.error.reason === "status-code") {
|
|
82
|
+
switch (_response.error.statusCode) {
|
|
83
|
+
case 401:
|
|
84
|
+
throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
85
|
+
case 422:
|
|
86
|
+
throw new FiveOneEat.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
87
|
+
default:
|
|
88
|
+
throw new errors.FiveOneEatError({
|
|
89
|
+
statusCode: _response.error.statusCode,
|
|
90
|
+
body: _response.error.body,
|
|
91
|
+
rawResponse: _response.rawResponse,
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/business/businesses");
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Create a new business owned by the authenticated user. The newly created
|
|
100
|
+
* business is automatically set as the user's active business.
|
|
101
|
+
*
|
|
102
|
+
* @param {FiveOneEat.business.StoreBusinessRequest} request
|
|
103
|
+
* @param {BusinessesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
104
|
+
*
|
|
105
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
106
|
+
* @throws {@link FiveOneEat.ForbiddenError}
|
|
107
|
+
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
108
|
+
*
|
|
109
|
+
* @example
|
|
110
|
+
* await client.business.businesses.create({
|
|
111
|
+
* name: "name",
|
|
112
|
+
* handle: "handle",
|
|
113
|
+
* category_ids: [1]
|
|
114
|
+
* })
|
|
115
|
+
*/
|
|
116
|
+
create(request, requestOptions) {
|
|
117
|
+
return core.HttpResponsePromise.fromPromise(this.__create(request, requestOptions));
|
|
118
|
+
}
|
|
119
|
+
__create(request, requestOptions) {
|
|
120
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
121
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
122
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
123
|
+
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);
|
|
124
|
+
const _response = yield core.fetcher({
|
|
125
|
+
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"),
|
|
126
|
+
method: "POST",
|
|
127
|
+
headers: _headers,
|
|
128
|
+
contentType: "application/json",
|
|
129
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
130
|
+
requestType: "json",
|
|
131
|
+
body: request,
|
|
132
|
+
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,
|
|
133
|
+
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,
|
|
134
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
135
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
136
|
+
logging: this._options.logging,
|
|
137
|
+
});
|
|
138
|
+
if (_response.ok) {
|
|
139
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
140
|
+
}
|
|
141
|
+
if (_response.error.reason === "status-code") {
|
|
142
|
+
switch (_response.error.statusCode) {
|
|
143
|
+
case 401:
|
|
144
|
+
throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
145
|
+
case 403:
|
|
146
|
+
throw new FiveOneEat.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
147
|
+
case 422:
|
|
148
|
+
throw new FiveOneEat.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
149
|
+
default:
|
|
150
|
+
throw new errors.FiveOneEatError({
|
|
151
|
+
statusCode: _response.error.statusCode,
|
|
152
|
+
body: _response.error.body,
|
|
153
|
+
rawResponse: _response.rawResponse,
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/business/businesses");
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Retrieve a single business owned by the authenticated user.
|
|
162
|
+
*
|
|
163
|
+
* @param {FiveOneEat.business.GetBusinessesRequest} request
|
|
164
|
+
* @param {BusinessesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
165
|
+
*
|
|
166
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
167
|
+
* @throws {@link FiveOneEat.ForbiddenError}
|
|
168
|
+
* @throws {@link FiveOneEat.NotFoundError}
|
|
169
|
+
*
|
|
170
|
+
* @example
|
|
171
|
+
* await client.business.businesses.get({
|
|
172
|
+
* business: "business"
|
|
173
|
+
* })
|
|
174
|
+
*/
|
|
175
|
+
get(request, requestOptions) {
|
|
176
|
+
return core.HttpResponsePromise.fromPromise(this.__get(request, requestOptions));
|
|
177
|
+
}
|
|
178
|
+
__get(request, requestOptions) {
|
|
179
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
180
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
181
|
+
const { business } = request;
|
|
182
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
183
|
+
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);
|
|
184
|
+
const _response = yield core.fetcher({
|
|
185
|
+
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)}`),
|
|
186
|
+
method: "GET",
|
|
187
|
+
headers: _headers,
|
|
188
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
189
|
+
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,
|
|
190
|
+
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,
|
|
191
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
192
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
193
|
+
logging: this._options.logging,
|
|
194
|
+
});
|
|
195
|
+
if (_response.ok) {
|
|
196
|
+
return {
|
|
197
|
+
data: _response.body,
|
|
198
|
+
rawResponse: _response.rawResponse,
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
if (_response.error.reason === "status-code") {
|
|
202
|
+
switch (_response.error.statusCode) {
|
|
203
|
+
case 401:
|
|
204
|
+
throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
205
|
+
case 403:
|
|
206
|
+
throw new FiveOneEat.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
207
|
+
case 404:
|
|
208
|
+
throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
|
|
209
|
+
default:
|
|
210
|
+
throw new errors.FiveOneEatError({
|
|
211
|
+
statusCode: _response.error.statusCode,
|
|
212
|
+
body: _response.error.body,
|
|
213
|
+
rawResponse: _response.rawResponse,
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/business/businesses/{business}");
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* Update core fields for a business owned by the authenticated user.
|
|
222
|
+
*
|
|
223
|
+
* @param {FiveOneEat.business.UpdateBusinessRequest} request
|
|
224
|
+
* @param {BusinessesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
225
|
+
*
|
|
226
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
227
|
+
* @throws {@link FiveOneEat.ForbiddenError}
|
|
228
|
+
* @throws {@link FiveOneEat.NotFoundError}
|
|
229
|
+
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
230
|
+
*
|
|
231
|
+
* @example
|
|
232
|
+
* await client.business.businesses.update({
|
|
233
|
+
* business: "business",
|
|
234
|
+
* name: "name",
|
|
235
|
+
* handle: "handle",
|
|
236
|
+
* category_ids: [1]
|
|
237
|
+
* })
|
|
238
|
+
*/
|
|
239
|
+
update(request, requestOptions) {
|
|
240
|
+
return core.HttpResponsePromise.fromPromise(this.__update(request, requestOptions));
|
|
241
|
+
}
|
|
242
|
+
__update(request, requestOptions) {
|
|
243
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
244
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
245
|
+
const { business } = request, _body = __rest(request, ["business"]);
|
|
246
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
247
|
+
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);
|
|
248
|
+
const _response = yield core.fetcher({
|
|
249
|
+
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)}`),
|
|
250
|
+
method: "PUT",
|
|
251
|
+
headers: _headers,
|
|
252
|
+
contentType: "application/json",
|
|
253
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
254
|
+
requestType: "json",
|
|
255
|
+
body: _body,
|
|
256
|
+
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,
|
|
257
|
+
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,
|
|
258
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
259
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
260
|
+
logging: this._options.logging,
|
|
261
|
+
});
|
|
262
|
+
if (_response.ok) {
|
|
263
|
+
return {
|
|
264
|
+
data: _response.body,
|
|
265
|
+
rawResponse: _response.rawResponse,
|
|
266
|
+
};
|
|
267
|
+
}
|
|
268
|
+
if (_response.error.reason === "status-code") {
|
|
269
|
+
switch (_response.error.statusCode) {
|
|
270
|
+
case 401:
|
|
271
|
+
throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
272
|
+
case 403:
|
|
273
|
+
throw new FiveOneEat.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
274
|
+
case 404:
|
|
275
|
+
throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
|
|
276
|
+
case 422:
|
|
277
|
+
throw new FiveOneEat.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
278
|
+
default:
|
|
279
|
+
throw new errors.FiveOneEatError({
|
|
280
|
+
statusCode: _response.error.statusCode,
|
|
281
|
+
body: _response.error.body,
|
|
282
|
+
rawResponse: _response.rawResponse,
|
|
283
|
+
});
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "PUT", "/business/businesses/{business}");
|
|
287
|
+
});
|
|
288
|
+
}
|
|
289
|
+
/**
|
|
290
|
+
* Delete a business owned by the authenticated user.
|
|
291
|
+
*
|
|
292
|
+
* @param {FiveOneEat.business.DeleteBusinessesRequest} request
|
|
293
|
+
* @param {BusinessesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
294
|
+
*
|
|
295
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
296
|
+
* @throws {@link FiveOneEat.ForbiddenError}
|
|
297
|
+
* @throws {@link FiveOneEat.NotFoundError}
|
|
298
|
+
*
|
|
299
|
+
* @example
|
|
300
|
+
* await client.business.businesses.delete({
|
|
301
|
+
* business: "business"
|
|
302
|
+
* })
|
|
303
|
+
*/
|
|
304
|
+
delete(request, requestOptions) {
|
|
305
|
+
return core.HttpResponsePromise.fromPromise(this.__delete(request, requestOptions));
|
|
306
|
+
}
|
|
307
|
+
__delete(request, requestOptions) {
|
|
308
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
309
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
310
|
+
const { business } = request;
|
|
311
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
312
|
+
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);
|
|
313
|
+
const _response = yield core.fetcher({
|
|
314
|
+
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)}`),
|
|
315
|
+
method: "DELETE",
|
|
316
|
+
headers: _headers,
|
|
317
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
318
|
+
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,
|
|
319
|
+
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,
|
|
320
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
321
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
322
|
+
logging: this._options.logging,
|
|
323
|
+
});
|
|
324
|
+
if (_response.ok) {
|
|
325
|
+
return { data: undefined, rawResponse: _response.rawResponse };
|
|
326
|
+
}
|
|
327
|
+
if (_response.error.reason === "status-code") {
|
|
328
|
+
switch (_response.error.statusCode) {
|
|
329
|
+
case 401:
|
|
330
|
+
throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
331
|
+
case 403:
|
|
332
|
+
throw new FiveOneEat.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
333
|
+
case 404:
|
|
334
|
+
throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
|
|
335
|
+
default:
|
|
336
|
+
throw new errors.FiveOneEatError({
|
|
337
|
+
statusCode: _response.error.statusCode,
|
|
338
|
+
body: _response.error.body,
|
|
339
|
+
rawResponse: _response.rawResponse,
|
|
340
|
+
});
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/business/businesses/{business}");
|
|
344
|
+
});
|
|
345
|
+
}
|
|
346
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./requests/index.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./requests/index.mjs";
|