@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.
Files changed (186) hide show
  1. package/dist/cjs/BaseClient.js +2 -2
  2. package/dist/cjs/api/resources/business/client/Client.d.ts +12 -0
  3. package/dist/cjs/api/resources/business/client/Client.js +30 -10
  4. package/dist/cjs/api/resources/business/resources/businesses/client/Client.d.ts +103 -0
  5. package/dist/cjs/api/resources/business/resources/businesses/client/Client.js +383 -0
  6. package/dist/cjs/api/resources/business/resources/businesses/client/index.d.ts +1 -0
  7. package/dist/cjs/api/resources/business/resources/businesses/client/index.js +17 -0
  8. package/dist/cjs/api/resources/business/resources/businesses/client/requests/DeleteBusinessesRequest.d.ts +10 -0
  9. package/dist/cjs/api/resources/business/resources/businesses/client/requests/DeleteBusinessesRequest.js +3 -0
  10. package/dist/cjs/api/resources/business/resources/businesses/client/requests/GetBusinessesRequest.d.ts +10 -0
  11. package/dist/cjs/api/resources/business/resources/businesses/client/requests/GetBusinessesRequest.js +3 -0
  12. package/dist/cjs/api/resources/business/resources/businesses/client/requests/ListBusinessesRequest.d.ts +10 -0
  13. package/dist/cjs/api/resources/business/resources/businesses/client/requests/ListBusinessesRequest.js +3 -0
  14. package/dist/cjs/api/resources/business/resources/businesses/client/requests/StoreBusinessRequest.d.ts +50 -0
  15. package/dist/cjs/api/resources/business/resources/businesses/client/requests/StoreBusinessRequest.js +24 -0
  16. package/dist/cjs/api/resources/business/resources/businesses/client/requests/UpdateBusinessRequest.d.ts +62 -0
  17. package/dist/cjs/api/resources/business/resources/businesses/client/requests/UpdateBusinessRequest.js +24 -0
  18. package/dist/cjs/api/resources/business/resources/businesses/client/requests/index.d.ts +5 -0
  19. package/dist/cjs/api/resources/business/resources/businesses/client/requests/index.js +7 -0
  20. package/dist/cjs/api/resources/business/resources/businesses/exports.d.ts +2 -0
  21. package/dist/cjs/api/resources/business/resources/businesses/exports.js +21 -0
  22. package/dist/cjs/api/resources/business/resources/businesses/index.d.ts +2 -0
  23. package/dist/cjs/api/resources/business/resources/businesses/index.js +18 -0
  24. package/dist/cjs/api/resources/business/resources/businesses/types/GetBusinessesResponse.d.ts +4 -0
  25. package/dist/cjs/api/resources/business/resources/businesses/types/GetBusinessesResponse.js +3 -0
  26. package/dist/cjs/api/resources/business/resources/businesses/types/ListBusinessesResponse.d.ts +4 -0
  27. package/dist/cjs/api/resources/business/resources/businesses/types/ListBusinessesResponse.js +3 -0
  28. package/dist/cjs/api/resources/business/resources/businesses/types/UpdateBusinessesResponse.d.ts +4 -0
  29. package/dist/cjs/api/resources/business/resources/businesses/types/UpdateBusinessesResponse.js +3 -0
  30. package/dist/cjs/api/resources/business/resources/businesses/types/index.d.ts +3 -0
  31. package/dist/cjs/api/resources/business/resources/businesses/types/index.js +19 -0
  32. package/dist/cjs/api/resources/business/resources/categories/client/Client.d.ts +26 -0
  33. package/dist/cjs/api/resources/business/resources/categories/client/Client.js +110 -0
  34. package/dist/cjs/api/resources/business/resources/categories/client/index.d.ts +1 -0
  35. package/dist/cjs/api/resources/business/resources/categories/client/index.js +2 -0
  36. package/dist/cjs/api/resources/business/resources/categories/exports.d.ts +2 -0
  37. package/dist/cjs/api/resources/business/resources/categories/exports.js +21 -0
  38. package/dist/cjs/api/resources/business/resources/categories/index.d.ts +2 -0
  39. package/dist/cjs/api/resources/business/resources/categories/index.js +18 -0
  40. package/dist/cjs/api/resources/business/resources/categories/types/ListCategoriesResponse.d.ts +4 -0
  41. package/dist/cjs/api/resources/business/resources/categories/types/ListCategoriesResponse.js +3 -0
  42. package/dist/cjs/api/resources/business/resources/categories/types/index.d.ts +1 -0
  43. package/dist/cjs/api/resources/business/resources/categories/types/index.js +17 -0
  44. package/dist/cjs/api/resources/business/resources/certifications/client/Client.d.ts +26 -0
  45. package/dist/cjs/api/resources/business/resources/certifications/client/Client.js +110 -0
  46. package/dist/cjs/api/resources/business/resources/certifications/client/index.d.ts +1 -0
  47. package/dist/cjs/api/resources/business/resources/certifications/client/index.js +2 -0
  48. package/dist/cjs/api/resources/business/resources/certifications/exports.d.ts +2 -0
  49. package/dist/cjs/api/resources/business/resources/certifications/exports.js +21 -0
  50. package/dist/cjs/api/resources/business/resources/certifications/index.d.ts +2 -0
  51. package/dist/cjs/api/resources/business/resources/certifications/index.js +18 -0
  52. package/dist/cjs/api/resources/business/resources/certifications/types/ListCertificationsResponse.d.ts +4 -0
  53. package/dist/cjs/api/resources/business/resources/certifications/types/ListCertificationsResponse.js +3 -0
  54. package/dist/cjs/api/resources/business/resources/certifications/types/index.d.ts +1 -0
  55. package/dist/cjs/api/resources/business/resources/certifications/types/index.js +17 -0
  56. package/dist/cjs/api/resources/business/resources/cuisines/client/Client.d.ts +26 -0
  57. package/dist/cjs/api/resources/business/resources/cuisines/client/Client.js +110 -0
  58. package/dist/cjs/api/resources/business/resources/cuisines/client/index.d.ts +1 -0
  59. package/dist/cjs/api/resources/business/resources/cuisines/client/index.js +2 -0
  60. package/dist/cjs/api/resources/business/resources/cuisines/exports.d.ts +2 -0
  61. package/dist/cjs/api/resources/business/resources/cuisines/exports.js +21 -0
  62. package/dist/cjs/api/resources/business/resources/cuisines/index.d.ts +2 -0
  63. package/dist/cjs/api/resources/business/resources/cuisines/index.js +18 -0
  64. package/dist/cjs/api/resources/business/resources/cuisines/types/ListCuisinesResponse.d.ts +4 -0
  65. package/dist/cjs/api/resources/business/resources/cuisines/types/ListCuisinesResponse.js +3 -0
  66. package/dist/cjs/api/resources/business/resources/cuisines/types/index.d.ts +1 -0
  67. package/dist/cjs/api/resources/business/resources/cuisines/types/index.js +17 -0
  68. package/dist/cjs/api/resources/business/resources/index.d.ts +9 -0
  69. package/dist/cjs/api/resources/business/resources/index.js +10 -1
  70. package/dist/cjs/api/resources/business/resources/profile/client/requests/UpdateBusinessProfileRequest.d.ts +1 -1
  71. package/dist/cjs/api/resources/customer/client/Client.d.ts +1 -1
  72. package/dist/cjs/api/resources/customer/client/Client.js +3 -3
  73. package/dist/cjs/api/resources/customer/client/requests/SearchCustomerRequest.d.ts +3 -3
  74. package/dist/cjs/api/resources/customer/resources/discovery/client/Client.d.ts +1 -1
  75. package/dist/cjs/api/resources/customer/resources/discovery/client/Client.js +1 -1
  76. package/dist/cjs/api/types/BusinessCategory.d.ts +9 -0
  77. package/dist/cjs/api/types/BusinessCategory.js +3 -0
  78. package/dist/cjs/api/types/BusinessCertification.d.ts +7 -0
  79. package/dist/cjs/api/types/BusinessCertification.js +3 -0
  80. package/dist/cjs/api/types/BusinessCuisine.d.ts +6 -0
  81. package/dist/cjs/api/types/BusinessCuisine.js +3 -0
  82. package/dist/cjs/api/types/BusinessProfile.d.ts +1 -1
  83. package/dist/cjs/api/types/BusinessSearchResult.d.ts +2 -1
  84. package/dist/cjs/api/types/BusinessSummary.d.ts +2 -1
  85. package/dist/cjs/api/types/CustomerBusinessProfile.d.ts +1 -1
  86. package/dist/cjs/api/types/DiscoveryBusiness.d.ts +2 -1
  87. package/dist/cjs/api/types/DiscoveryCategory.d.ts +6 -2
  88. package/dist/cjs/api/types/ExploreBusiness.d.ts +2 -1
  89. package/dist/cjs/api/types/index.d.ts +3 -0
  90. package/dist/cjs/api/types/index.js +3 -0
  91. package/dist/cjs/version.d.ts +1 -1
  92. package/dist/cjs/version.js +1 -1
  93. package/dist/esm/BaseClient.mjs +2 -2
  94. package/dist/esm/api/resources/business/client/Client.d.mts +12 -0
  95. package/dist/esm/api/resources/business/client/Client.mjs +20 -0
  96. package/dist/esm/api/resources/business/resources/businesses/client/Client.d.mts +103 -0
  97. package/dist/esm/api/resources/business/resources/businesses/client/Client.mjs +346 -0
  98. package/dist/esm/api/resources/business/resources/businesses/client/index.d.mts +1 -0
  99. package/dist/esm/api/resources/business/resources/businesses/client/index.mjs +1 -0
  100. package/dist/esm/api/resources/business/resources/businesses/client/requests/DeleteBusinessesRequest.d.mts +10 -0
  101. package/dist/esm/api/resources/business/resources/businesses/client/requests/DeleteBusinessesRequest.mjs +2 -0
  102. package/dist/esm/api/resources/business/resources/businesses/client/requests/GetBusinessesRequest.d.mts +10 -0
  103. package/dist/esm/api/resources/business/resources/businesses/client/requests/GetBusinessesRequest.mjs +2 -0
  104. package/dist/esm/api/resources/business/resources/businesses/client/requests/ListBusinessesRequest.d.mts +10 -0
  105. package/dist/esm/api/resources/business/resources/businesses/client/requests/ListBusinessesRequest.mjs +2 -0
  106. package/dist/esm/api/resources/business/resources/businesses/client/requests/StoreBusinessRequest.d.mts +50 -0
  107. package/dist/esm/api/resources/business/resources/businesses/client/requests/StoreBusinessRequest.mjs +21 -0
  108. package/dist/esm/api/resources/business/resources/businesses/client/requests/UpdateBusinessRequest.d.mts +62 -0
  109. package/dist/esm/api/resources/business/resources/businesses/client/requests/UpdateBusinessRequest.mjs +21 -0
  110. package/dist/esm/api/resources/business/resources/businesses/client/requests/index.d.mts +5 -0
  111. package/dist/esm/api/resources/business/resources/businesses/client/requests/index.mjs +2 -0
  112. package/dist/esm/api/resources/business/resources/businesses/exports.d.mts +2 -0
  113. package/dist/esm/api/resources/business/resources/businesses/exports.mjs +3 -0
  114. package/dist/esm/api/resources/business/resources/businesses/index.d.mts +2 -0
  115. package/dist/esm/api/resources/business/resources/businesses/index.mjs +2 -0
  116. package/dist/esm/api/resources/business/resources/businesses/types/GetBusinessesResponse.d.mts +4 -0
  117. package/dist/esm/api/resources/business/resources/businesses/types/GetBusinessesResponse.mjs +2 -0
  118. package/dist/esm/api/resources/business/resources/businesses/types/ListBusinessesResponse.d.mts +4 -0
  119. package/dist/esm/api/resources/business/resources/businesses/types/ListBusinessesResponse.mjs +2 -0
  120. package/dist/esm/api/resources/business/resources/businesses/types/UpdateBusinessesResponse.d.mts +4 -0
  121. package/dist/esm/api/resources/business/resources/businesses/types/UpdateBusinessesResponse.mjs +2 -0
  122. package/dist/esm/api/resources/business/resources/businesses/types/index.d.mts +3 -0
  123. package/dist/esm/api/resources/business/resources/businesses/types/index.mjs +3 -0
  124. package/dist/esm/api/resources/business/resources/categories/client/Client.d.mts +26 -0
  125. package/dist/esm/api/resources/business/resources/categories/client/Client.mjs +73 -0
  126. package/dist/esm/api/resources/business/resources/categories/client/index.d.mts +1 -0
  127. package/dist/esm/api/resources/business/resources/categories/client/index.mjs +1 -0
  128. package/dist/esm/api/resources/business/resources/categories/exports.d.mts +2 -0
  129. package/dist/esm/api/resources/business/resources/categories/exports.mjs +3 -0
  130. package/dist/esm/api/resources/business/resources/categories/index.d.mts +2 -0
  131. package/dist/esm/api/resources/business/resources/categories/index.mjs +2 -0
  132. package/dist/esm/api/resources/business/resources/categories/types/ListCategoriesResponse.d.mts +4 -0
  133. package/dist/esm/api/resources/business/resources/categories/types/ListCategoriesResponse.mjs +2 -0
  134. package/dist/esm/api/resources/business/resources/categories/types/index.d.mts +1 -0
  135. package/dist/esm/api/resources/business/resources/categories/types/index.mjs +1 -0
  136. package/dist/esm/api/resources/business/resources/certifications/client/Client.d.mts +26 -0
  137. package/dist/esm/api/resources/business/resources/certifications/client/Client.mjs +73 -0
  138. package/dist/esm/api/resources/business/resources/certifications/client/index.d.mts +1 -0
  139. package/dist/esm/api/resources/business/resources/certifications/client/index.mjs +1 -0
  140. package/dist/esm/api/resources/business/resources/certifications/exports.d.mts +2 -0
  141. package/dist/esm/api/resources/business/resources/certifications/exports.mjs +3 -0
  142. package/dist/esm/api/resources/business/resources/certifications/index.d.mts +2 -0
  143. package/dist/esm/api/resources/business/resources/certifications/index.mjs +2 -0
  144. package/dist/esm/api/resources/business/resources/certifications/types/ListCertificationsResponse.d.mts +4 -0
  145. package/dist/esm/api/resources/business/resources/certifications/types/ListCertificationsResponse.mjs +2 -0
  146. package/dist/esm/api/resources/business/resources/certifications/types/index.d.mts +1 -0
  147. package/dist/esm/api/resources/business/resources/certifications/types/index.mjs +1 -0
  148. package/dist/esm/api/resources/business/resources/cuisines/client/Client.d.mts +26 -0
  149. package/dist/esm/api/resources/business/resources/cuisines/client/Client.mjs +73 -0
  150. package/dist/esm/api/resources/business/resources/cuisines/client/index.d.mts +1 -0
  151. package/dist/esm/api/resources/business/resources/cuisines/client/index.mjs +1 -0
  152. package/dist/esm/api/resources/business/resources/cuisines/exports.d.mts +2 -0
  153. package/dist/esm/api/resources/business/resources/cuisines/exports.mjs +3 -0
  154. package/dist/esm/api/resources/business/resources/cuisines/index.d.mts +2 -0
  155. package/dist/esm/api/resources/business/resources/cuisines/index.mjs +2 -0
  156. package/dist/esm/api/resources/business/resources/cuisines/types/ListCuisinesResponse.d.mts +4 -0
  157. package/dist/esm/api/resources/business/resources/cuisines/types/ListCuisinesResponse.mjs +2 -0
  158. package/dist/esm/api/resources/business/resources/cuisines/types/index.d.mts +1 -0
  159. package/dist/esm/api/resources/business/resources/cuisines/types/index.mjs +1 -0
  160. package/dist/esm/api/resources/business/resources/index.d.mts +9 -0
  161. package/dist/esm/api/resources/business/resources/index.mjs +9 -0
  162. package/dist/esm/api/resources/business/resources/profile/client/requests/UpdateBusinessProfileRequest.d.mts +1 -1
  163. package/dist/esm/api/resources/customer/client/Client.d.mts +1 -1
  164. package/dist/esm/api/resources/customer/client/Client.mjs +3 -3
  165. package/dist/esm/api/resources/customer/client/requests/SearchCustomerRequest.d.mts +3 -3
  166. package/dist/esm/api/resources/customer/resources/discovery/client/Client.d.mts +1 -1
  167. package/dist/esm/api/resources/customer/resources/discovery/client/Client.mjs +1 -1
  168. package/dist/esm/api/types/BusinessCategory.d.mts +9 -0
  169. package/dist/esm/api/types/BusinessCategory.mjs +2 -0
  170. package/dist/esm/api/types/BusinessCertification.d.mts +7 -0
  171. package/dist/esm/api/types/BusinessCertification.mjs +2 -0
  172. package/dist/esm/api/types/BusinessCuisine.d.mts +6 -0
  173. package/dist/esm/api/types/BusinessCuisine.mjs +2 -0
  174. package/dist/esm/api/types/BusinessProfile.d.mts +1 -1
  175. package/dist/esm/api/types/BusinessSearchResult.d.mts +2 -1
  176. package/dist/esm/api/types/BusinessSummary.d.mts +2 -1
  177. package/dist/esm/api/types/CustomerBusinessProfile.d.mts +1 -1
  178. package/dist/esm/api/types/DiscoveryBusiness.d.mts +2 -1
  179. package/dist/esm/api/types/DiscoveryCategory.d.mts +6 -2
  180. package/dist/esm/api/types/ExploreBusiness.d.mts +2 -1
  181. package/dist/esm/api/types/index.d.mts +3 -0
  182. package/dist/esm/api/types/index.mjs +3 -0
  183. package/dist/esm/version.d.mts +1 -1
  184. package/dist/esm/version.mjs +1 -1
  185. package/package.json +45 -1
  186. package/reference.md +504 -2
@@ -1,7 +1,8 @@
1
+ import type * as FiveOneEat from "../index.js";
1
2
  export interface BusinessSummary {
2
3
  id: string;
3
4
  name: string;
4
5
  handle: string;
5
6
  logo: string;
6
- category: string;
7
+ categories?: FiveOneEat.BusinessCategory[] | undefined;
7
8
  }
@@ -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
- category: string | null;
6
+ categories?: FiveOneEat.BusinessCategory[] | undefined;
6
7
  description: string | null;
7
8
  bio: string | null;
8
9
  location: DiscoveryBusiness.Location;
@@ -1,5 +1,9 @@
1
1
  export interface DiscoveryCategory {
2
- value: string;
3
- label: string;
2
+ id: number;
3
+ name: string;
4
+ slug: string;
5
+ description: string | null;
6
+ icon: string | null;
7
+ group: string;
4
8
  business_count: number;
5
9
  }
@@ -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
- category: string | null;
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);
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.0.22";
1
+ export declare const SDK_VERSION = "0.0.24";
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_VERSION = void 0;
4
- exports.SDK_VERSION = "0.0.22";
4
+ exports.SDK_VERSION = "0.0.24";
@@ -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.22",
10
- "User-Agent": "@51eat/sdk/0.0.22",
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";
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * business: "business"
5
+ * }
6
+ */
7
+ export interface DeleteBusinessesRequest {
8
+ /** The business ID */
9
+ business: string;
10
+ }