@51eat/sdk 0.0.23 → 0.0.25

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 (152) hide show
  1. package/dist/cjs/BaseClient.js +2 -2
  2. package/dist/cjs/api/resources/business/client/Client.d.ts +2 -2
  3. package/dist/cjs/api/resources/business/client/Client.js +4 -4
  4. package/dist/cjs/api/resources/business/resources/businesses/client/Client.d.ts +49 -8
  5. package/dist/cjs/api/resources/business/resources/businesses/client/Client.js +164 -41
  6. package/dist/cjs/api/resources/business/resources/businesses/client/requests/DeleteBusinessesRequest.d.ts +1 -0
  7. package/dist/cjs/api/resources/business/resources/businesses/client/requests/GetBusinessesRequest.d.ts +1 -0
  8. package/dist/cjs/api/resources/business/resources/businesses/client/requests/ListBusinessesRequest.d.ts +10 -0
  9. package/dist/cjs/api/resources/business/resources/businesses/client/requests/StoreBusinessRequest.d.ts +59 -0
  10. package/dist/cjs/api/resources/business/resources/businesses/client/requests/StoreBusinessRequest.js +24 -0
  11. package/dist/cjs/api/resources/business/resources/businesses/client/requests/UpdateBusinessRequest.d.ts +71 -0
  12. package/dist/cjs/api/resources/business/resources/businesses/client/requests/UpdateBusinessRequest.js +24 -0
  13. package/dist/cjs/api/resources/business/resources/businesses/client/requests/index.d.ts +3 -1
  14. package/dist/cjs/api/resources/business/resources/businesses/client/requests/index.js +5 -0
  15. package/dist/cjs/api/resources/business/resources/businesses/index.d.ts +1 -0
  16. package/dist/cjs/api/resources/business/resources/businesses/index.js +1 -0
  17. package/dist/cjs/api/resources/business/resources/businesses/types/GetBusinessesResponse.d.ts +4 -0
  18. package/dist/cjs/api/resources/business/resources/businesses/types/GetBusinessesResponse.js +3 -0
  19. package/dist/cjs/api/resources/business/resources/businesses/types/ListBusinessesResponse.d.ts +4 -0
  20. package/dist/cjs/api/resources/business/resources/businesses/types/ListBusinessesResponse.js +3 -0
  21. package/dist/cjs/api/resources/business/resources/businesses/types/UpdateBusinessesResponse.d.ts +4 -0
  22. package/dist/cjs/api/resources/business/resources/businesses/types/UpdateBusinessesResponse.js +3 -0
  23. package/dist/cjs/api/resources/business/resources/businesses/types/index.d.ts +3 -0
  24. package/dist/cjs/api/resources/business/resources/businesses/types/index.js +19 -0
  25. package/dist/cjs/api/resources/business/resources/categories/client/Client.d.ts +7 -1
  26. package/dist/cjs/api/resources/business/resources/categories/client/Client.js +20 -6
  27. package/dist/cjs/api/resources/business/resources/categories/index.d.ts +1 -0
  28. package/dist/cjs/api/resources/business/resources/categories/index.js +1 -0
  29. package/dist/cjs/api/resources/business/resources/categories/types/ListCategoriesResponse.d.ts +4 -0
  30. package/dist/cjs/api/resources/business/resources/categories/types/ListCategoriesResponse.js +3 -0
  31. package/dist/cjs/api/resources/business/resources/categories/types/index.d.ts +1 -0
  32. package/dist/cjs/api/resources/business/resources/categories/types/index.js +17 -0
  33. package/dist/cjs/api/resources/business/resources/certifications/client/Client.d.ts +7 -1
  34. package/dist/cjs/api/resources/business/resources/certifications/client/Client.js +20 -6
  35. package/dist/cjs/api/resources/business/resources/certifications/index.d.ts +1 -0
  36. package/dist/cjs/api/resources/business/resources/certifications/index.js +1 -0
  37. package/dist/cjs/api/resources/business/resources/certifications/types/ListCertificationsResponse.d.ts +4 -0
  38. package/dist/cjs/api/resources/business/resources/certifications/types/ListCertificationsResponse.js +3 -0
  39. package/dist/cjs/api/resources/business/resources/certifications/types/index.d.ts +1 -0
  40. package/dist/cjs/api/resources/business/resources/certifications/types/index.js +17 -0
  41. package/dist/cjs/api/resources/business/resources/cuisines/client/Client.d.ts +7 -1
  42. package/dist/cjs/api/resources/business/resources/cuisines/client/Client.js +20 -6
  43. package/dist/cjs/api/resources/business/resources/cuisines/index.d.ts +1 -0
  44. package/dist/cjs/api/resources/business/resources/cuisines/index.js +1 -0
  45. package/dist/cjs/api/resources/business/resources/cuisines/types/ListCuisinesResponse.d.ts +4 -0
  46. package/dist/cjs/api/resources/business/resources/cuisines/types/ListCuisinesResponse.js +3 -0
  47. package/dist/cjs/api/resources/business/resources/cuisines/types/index.d.ts +1 -0
  48. package/dist/cjs/api/resources/business/resources/cuisines/types/index.js +17 -0
  49. package/dist/cjs/api/resources/business/resources/index.d.ts +4 -0
  50. package/dist/cjs/api/resources/business/resources/index.js +4 -0
  51. package/dist/cjs/api/resources/business/resources/profile/client/requests/UpdateBusinessProfileRequest.d.ts +1 -1
  52. package/dist/cjs/api/resources/customer/client/Client.d.ts +1 -1
  53. package/dist/cjs/api/resources/customer/client/Client.js +3 -3
  54. package/dist/cjs/api/resources/customer/client/requests/SearchCustomerRequest.d.ts +3 -3
  55. package/dist/cjs/api/resources/customer/resources/discovery/client/Client.d.ts +1 -1
  56. package/dist/cjs/api/resources/customer/resources/discovery/client/Client.js +1 -1
  57. package/dist/cjs/api/types/BusinessCategory.d.ts +9 -0
  58. package/dist/cjs/api/types/BusinessCategory.js +3 -0
  59. package/dist/cjs/api/types/BusinessCertification.d.ts +7 -0
  60. package/dist/cjs/api/types/BusinessCertification.js +3 -0
  61. package/dist/cjs/api/types/BusinessCuisine.d.ts +6 -0
  62. package/dist/cjs/api/types/BusinessCuisine.js +3 -0
  63. package/dist/cjs/api/types/BusinessProfile.d.ts +1 -1
  64. package/dist/cjs/api/types/BusinessSearchResult.d.ts +2 -1
  65. package/dist/cjs/api/types/BusinessSummary.d.ts +2 -1
  66. package/dist/cjs/api/types/CustomerBusinessProfile.d.ts +1 -1
  67. package/dist/cjs/api/types/DiscoveryBusiness.d.ts +2 -1
  68. package/dist/cjs/api/types/DiscoveryCategory.d.ts +6 -2
  69. package/dist/cjs/api/types/ExploreBusiness.d.ts +2 -1
  70. package/dist/cjs/api/types/index.d.ts +3 -0
  71. package/dist/cjs/api/types/index.js +3 -0
  72. package/dist/cjs/version.d.ts +1 -1
  73. package/dist/cjs/version.js +1 -1
  74. package/dist/esm/BaseClient.mjs +2 -2
  75. package/dist/esm/api/resources/business/client/Client.d.mts +2 -2
  76. package/dist/esm/api/resources/business/client/Client.mjs +4 -4
  77. package/dist/esm/api/resources/business/resources/businesses/client/Client.d.mts +49 -8
  78. package/dist/esm/api/resources/business/resources/businesses/client/Client.mjs +164 -41
  79. package/dist/esm/api/resources/business/resources/businesses/client/requests/DeleteBusinessesRequest.d.mts +1 -0
  80. package/dist/esm/api/resources/business/resources/businesses/client/requests/GetBusinessesRequest.d.mts +1 -0
  81. package/dist/esm/api/resources/business/resources/businesses/client/requests/ListBusinessesRequest.d.mts +10 -0
  82. package/dist/esm/api/resources/business/resources/businesses/client/requests/StoreBusinessRequest.d.mts +59 -0
  83. package/dist/esm/api/resources/business/resources/businesses/client/requests/StoreBusinessRequest.mjs +21 -0
  84. package/dist/esm/api/resources/business/resources/businesses/client/requests/UpdateBusinessRequest.d.mts +71 -0
  85. package/dist/esm/api/resources/business/resources/businesses/client/requests/UpdateBusinessRequest.mjs +21 -0
  86. package/dist/esm/api/resources/business/resources/businesses/client/requests/index.d.mts +3 -1
  87. package/dist/esm/api/resources/business/resources/businesses/client/requests/index.mjs +2 -1
  88. package/dist/esm/api/resources/business/resources/businesses/index.d.mts +1 -0
  89. package/dist/esm/api/resources/business/resources/businesses/index.mjs +1 -0
  90. package/dist/esm/api/resources/business/resources/businesses/types/GetBusinessesResponse.d.mts +4 -0
  91. package/dist/esm/api/resources/business/resources/businesses/types/GetBusinessesResponse.mjs +2 -0
  92. package/dist/esm/api/resources/business/resources/businesses/types/ListBusinessesResponse.d.mts +4 -0
  93. package/dist/esm/api/resources/business/resources/businesses/types/ListBusinessesResponse.mjs +2 -0
  94. package/dist/esm/api/resources/business/resources/businesses/types/UpdateBusinessesResponse.d.mts +4 -0
  95. package/dist/esm/api/resources/business/resources/businesses/types/UpdateBusinessesResponse.mjs +2 -0
  96. package/dist/esm/api/resources/business/resources/businesses/types/index.d.mts +3 -0
  97. package/dist/esm/api/resources/business/resources/businesses/types/index.mjs +3 -0
  98. package/dist/esm/api/resources/business/resources/categories/client/Client.d.mts +7 -1
  99. package/dist/esm/api/resources/business/resources/categories/client/Client.mjs +20 -6
  100. package/dist/esm/api/resources/business/resources/categories/index.d.mts +1 -0
  101. package/dist/esm/api/resources/business/resources/categories/index.mjs +1 -0
  102. package/dist/esm/api/resources/business/resources/categories/types/ListCategoriesResponse.d.mts +4 -0
  103. package/dist/esm/api/resources/business/resources/categories/types/ListCategoriesResponse.mjs +2 -0
  104. package/dist/esm/api/resources/business/resources/categories/types/index.d.mts +1 -0
  105. package/dist/esm/api/resources/business/resources/categories/types/index.mjs +1 -0
  106. package/dist/esm/api/resources/business/resources/certifications/client/Client.d.mts +7 -1
  107. package/dist/esm/api/resources/business/resources/certifications/client/Client.mjs +20 -6
  108. package/dist/esm/api/resources/business/resources/certifications/index.d.mts +1 -0
  109. package/dist/esm/api/resources/business/resources/certifications/index.mjs +1 -0
  110. package/dist/esm/api/resources/business/resources/certifications/types/ListCertificationsResponse.d.mts +4 -0
  111. package/dist/esm/api/resources/business/resources/certifications/types/ListCertificationsResponse.mjs +2 -0
  112. package/dist/esm/api/resources/business/resources/certifications/types/index.d.mts +1 -0
  113. package/dist/esm/api/resources/business/resources/certifications/types/index.mjs +1 -0
  114. package/dist/esm/api/resources/business/resources/cuisines/client/Client.d.mts +7 -1
  115. package/dist/esm/api/resources/business/resources/cuisines/client/Client.mjs +20 -6
  116. package/dist/esm/api/resources/business/resources/cuisines/index.d.mts +1 -0
  117. package/dist/esm/api/resources/business/resources/cuisines/index.mjs +1 -0
  118. package/dist/esm/api/resources/business/resources/cuisines/types/ListCuisinesResponse.d.mts +4 -0
  119. package/dist/esm/api/resources/business/resources/cuisines/types/ListCuisinesResponse.mjs +2 -0
  120. package/dist/esm/api/resources/business/resources/cuisines/types/index.d.mts +1 -0
  121. package/dist/esm/api/resources/business/resources/cuisines/types/index.mjs +1 -0
  122. package/dist/esm/api/resources/business/resources/index.d.mts +4 -0
  123. package/dist/esm/api/resources/business/resources/index.mjs +4 -0
  124. package/dist/esm/api/resources/business/resources/profile/client/requests/UpdateBusinessProfileRequest.d.mts +1 -1
  125. package/dist/esm/api/resources/customer/client/Client.d.mts +1 -1
  126. package/dist/esm/api/resources/customer/client/Client.mjs +3 -3
  127. package/dist/esm/api/resources/customer/client/requests/SearchCustomerRequest.d.mts +3 -3
  128. package/dist/esm/api/resources/customer/resources/discovery/client/Client.d.mts +1 -1
  129. package/dist/esm/api/resources/customer/resources/discovery/client/Client.mjs +1 -1
  130. package/dist/esm/api/types/BusinessCategory.d.mts +9 -0
  131. package/dist/esm/api/types/BusinessCategory.mjs +2 -0
  132. package/dist/esm/api/types/BusinessCertification.d.mts +7 -0
  133. package/dist/esm/api/types/BusinessCertification.mjs +2 -0
  134. package/dist/esm/api/types/BusinessCuisine.d.mts +6 -0
  135. package/dist/esm/api/types/BusinessCuisine.mjs +2 -0
  136. package/dist/esm/api/types/BusinessProfile.d.mts +1 -1
  137. package/dist/esm/api/types/BusinessSearchResult.d.mts +2 -1
  138. package/dist/esm/api/types/BusinessSummary.d.mts +2 -1
  139. package/dist/esm/api/types/CustomerBusinessProfile.d.mts +1 -1
  140. package/dist/esm/api/types/DiscoveryBusiness.d.mts +2 -1
  141. package/dist/esm/api/types/DiscoveryCategory.d.mts +6 -2
  142. package/dist/esm/api/types/ExploreBusiness.d.mts +2 -1
  143. package/dist/esm/api/types/index.d.mts +3 -0
  144. package/dist/esm/api/types/index.mjs +3 -0
  145. package/dist/esm/version.d.mts +1 -1
  146. package/dist/esm/version.mjs +1 -1
  147. package/package.json +12 -12
  148. package/reference.md +354 -214
  149. package/dist/cjs/api/resources/business/resources/businesses/client/requests/UpdateBusinessesRequest.d.ts +0 -9
  150. package/dist/esm/api/resources/business/resources/businesses/client/requests/UpdateBusinessesRequest.d.mts +0 -9
  151. /package/dist/cjs/api/resources/business/resources/businesses/client/requests/{UpdateBusinessesRequest.js → ListBusinessesRequest.js} +0 -0
  152. /package/dist/esm/api/resources/business/resources/businesses/client/requests/{UpdateBusinessesRequest.mjs → ListBusinessesRequest.mjs} +0 -0
@@ -14,13 +14,19 @@ import * as core from "../../../../../../core/index.mjs";
14
14
  import * as environments from "../../../../../../environments.mjs";
15
15
  import { handleNonStatusCodeError } from "../../../../../../errors/handleNonStatusCodeError.mjs";
16
16
  import * as errors from "../../../../../../errors/index.mjs";
17
+ import * as FiveOneEat from "../../../../../index.mjs";
17
18
  export class CategoriesClient {
18
19
  constructor(options = {}) {
19
20
  this._options = normalizeClientOptionsWithAuth(options);
20
21
  }
21
22
  /**
23
+ * Retrieve a list of all business categories, ordered by sort order and name.
24
+ * Use these IDs to populate the `category_ids` field when creating or updating a business.
25
+ *
22
26
  * @param {CategoriesClient.RequestOptions} requestOptions - Request-specific configuration.
23
27
  *
28
+ * @throws {@link FiveOneEat.UnauthorizedError}
29
+ *
24
30
  * @example
25
31
  * await client.business.categories.list()
26
32
  */
@@ -44,14 +50,22 @@ export class CategoriesClient {
44
50
  logging: this._options.logging,
45
51
  });
46
52
  if (_response.ok) {
47
- return { data: undefined, rawResponse: _response.rawResponse };
53
+ return {
54
+ data: _response.body,
55
+ rawResponse: _response.rawResponse,
56
+ };
48
57
  }
49
58
  if (_response.error.reason === "status-code") {
50
- throw new errors.FiveOneEatError({
51
- statusCode: _response.error.statusCode,
52
- body: _response.error.body,
53
- rawResponse: _response.rawResponse,
54
- });
59
+ switch (_response.error.statusCode) {
60
+ case 401:
61
+ throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
62
+ default:
63
+ throw new errors.FiveOneEatError({
64
+ statusCode: _response.error.statusCode,
65
+ body: _response.error.body,
66
+ rawResponse: _response.rawResponse,
67
+ });
68
+ }
55
69
  }
56
70
  return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/business/categories");
57
71
  });
@@ -1 +1,2 @@
1
1
  export * from "./client/index.mjs";
2
+ export * from "./types/index.mjs";
@@ -1 +1,2 @@
1
1
  export * from "./client/index.mjs";
2
+ export * from "./types/index.mjs";
@@ -0,0 +1,4 @@
1
+ import type * as FiveOneEat from "../../../../../index.mjs";
2
+ export interface ListCategoriesResponse {
3
+ data: FiveOneEat.BusinessCategory[];
4
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1 @@
1
+ export * from "./ListCategoriesResponse.mjs";
@@ -0,0 +1 @@
1
+ export * from "./ListCategoriesResponse.mjs";
@@ -1,6 +1,7 @@
1
1
  import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.mjs";
2
2
  import { type NormalizedClientOptionsWithAuth } from "../../../../../../BaseClient.mjs";
3
3
  import * as core from "../../../../../../core/index.mjs";
4
+ import * as FiveOneEat from "../../../../../index.mjs";
4
5
  export declare namespace CertificationsClient {
5
6
  type Options = BaseClientOptions;
6
7
  interface RequestOptions extends BaseRequestOptions {
@@ -10,11 +11,16 @@ export declare class CertificationsClient {
10
11
  protected readonly _options: NormalizedClientOptionsWithAuth<CertificationsClient.Options>;
11
12
  constructor(options?: CertificationsClient.Options);
12
13
  /**
14
+ * Retrieve a list of all certifications, ordered alphabetically. Use these IDs
15
+ * to populate the `certification_ids` field when updating a business profile.
16
+ *
13
17
  * @param {CertificationsClient.RequestOptions} requestOptions - Request-specific configuration.
14
18
  *
19
+ * @throws {@link FiveOneEat.UnauthorizedError}
20
+ *
15
21
  * @example
16
22
  * await client.business.certifications.list()
17
23
  */
18
- list(requestOptions?: CertificationsClient.RequestOptions): core.HttpResponsePromise<void>;
24
+ list(requestOptions?: CertificationsClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.business.ListCertificationsResponse>;
19
25
  private __list;
20
26
  }
@@ -14,13 +14,19 @@ import * as core from "../../../../../../core/index.mjs";
14
14
  import * as environments from "../../../../../../environments.mjs";
15
15
  import { handleNonStatusCodeError } from "../../../../../../errors/handleNonStatusCodeError.mjs";
16
16
  import * as errors from "../../../../../../errors/index.mjs";
17
+ import * as FiveOneEat from "../../../../../index.mjs";
17
18
  export class CertificationsClient {
18
19
  constructor(options = {}) {
19
20
  this._options = normalizeClientOptionsWithAuth(options);
20
21
  }
21
22
  /**
23
+ * Retrieve a list of all certifications, ordered alphabetically. Use these IDs
24
+ * to populate the `certification_ids` field when updating a business profile.
25
+ *
22
26
  * @param {CertificationsClient.RequestOptions} requestOptions - Request-specific configuration.
23
27
  *
28
+ * @throws {@link FiveOneEat.UnauthorizedError}
29
+ *
24
30
  * @example
25
31
  * await client.business.certifications.list()
26
32
  */
@@ -44,14 +50,22 @@ export class CertificationsClient {
44
50
  logging: this._options.logging,
45
51
  });
46
52
  if (_response.ok) {
47
- return { data: undefined, rawResponse: _response.rawResponse };
53
+ return {
54
+ data: _response.body,
55
+ rawResponse: _response.rawResponse,
56
+ };
48
57
  }
49
58
  if (_response.error.reason === "status-code") {
50
- throw new errors.FiveOneEatError({
51
- statusCode: _response.error.statusCode,
52
- body: _response.error.body,
53
- rawResponse: _response.rawResponse,
54
- });
59
+ switch (_response.error.statusCode) {
60
+ case 401:
61
+ throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
62
+ default:
63
+ throw new errors.FiveOneEatError({
64
+ statusCode: _response.error.statusCode,
65
+ body: _response.error.body,
66
+ rawResponse: _response.rawResponse,
67
+ });
68
+ }
55
69
  }
56
70
  return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/business/certifications");
57
71
  });
@@ -1 +1,2 @@
1
1
  export * from "./client/index.mjs";
2
+ export * from "./types/index.mjs";
@@ -1 +1,2 @@
1
1
  export * from "./client/index.mjs";
2
+ export * from "./types/index.mjs";
@@ -0,0 +1,4 @@
1
+ import type * as FiveOneEat from "../../../../../index.mjs";
2
+ export interface ListCertificationsResponse {
3
+ data: FiveOneEat.BusinessCertification[];
4
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1 @@
1
+ export * from "./ListCertificationsResponse.mjs";
@@ -0,0 +1 @@
1
+ export * from "./ListCertificationsResponse.mjs";
@@ -1,6 +1,7 @@
1
1
  import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.mjs";
2
2
  import { type NormalizedClientOptionsWithAuth } from "../../../../../../BaseClient.mjs";
3
3
  import * as core from "../../../../../../core/index.mjs";
4
+ import * as FiveOneEat from "../../../../../index.mjs";
4
5
  export declare namespace CuisinesClient {
5
6
  type Options = BaseClientOptions;
6
7
  interface RequestOptions extends BaseRequestOptions {
@@ -10,11 +11,16 @@ export declare class CuisinesClient {
10
11
  protected readonly _options: NormalizedClientOptionsWithAuth<CuisinesClient.Options>;
11
12
  constructor(options?: CuisinesClient.Options);
12
13
  /**
14
+ * Retrieve a list of all cuisines, ordered alphabetically. Use these IDs to
15
+ * populate the `cuisine_ids` field when updating a business profile.
16
+ *
13
17
  * @param {CuisinesClient.RequestOptions} requestOptions - Request-specific configuration.
14
18
  *
19
+ * @throws {@link FiveOneEat.UnauthorizedError}
20
+ *
15
21
  * @example
16
22
  * await client.business.cuisines.list()
17
23
  */
18
- list(requestOptions?: CuisinesClient.RequestOptions): core.HttpResponsePromise<void>;
24
+ list(requestOptions?: CuisinesClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.business.ListCuisinesResponse>;
19
25
  private __list;
20
26
  }
@@ -14,13 +14,19 @@ import * as core from "../../../../../../core/index.mjs";
14
14
  import * as environments from "../../../../../../environments.mjs";
15
15
  import { handleNonStatusCodeError } from "../../../../../../errors/handleNonStatusCodeError.mjs";
16
16
  import * as errors from "../../../../../../errors/index.mjs";
17
+ import * as FiveOneEat from "../../../../../index.mjs";
17
18
  export class CuisinesClient {
18
19
  constructor(options = {}) {
19
20
  this._options = normalizeClientOptionsWithAuth(options);
20
21
  }
21
22
  /**
23
+ * Retrieve a list of all cuisines, ordered alphabetically. Use these IDs to
24
+ * populate the `cuisine_ids` field when updating a business profile.
25
+ *
22
26
  * @param {CuisinesClient.RequestOptions} requestOptions - Request-specific configuration.
23
27
  *
28
+ * @throws {@link FiveOneEat.UnauthorizedError}
29
+ *
24
30
  * @example
25
31
  * await client.business.cuisines.list()
26
32
  */
@@ -44,14 +50,22 @@ export class CuisinesClient {
44
50
  logging: this._options.logging,
45
51
  });
46
52
  if (_response.ok) {
47
- return { data: undefined, rawResponse: _response.rawResponse };
53
+ return {
54
+ data: _response.body,
55
+ rawResponse: _response.rawResponse,
56
+ };
48
57
  }
49
58
  if (_response.error.reason === "status-code") {
50
- throw new errors.FiveOneEatError({
51
- statusCode: _response.error.statusCode,
52
- body: _response.error.body,
53
- rawResponse: _response.rawResponse,
54
- });
59
+ switch (_response.error.statusCode) {
60
+ case 401:
61
+ throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
62
+ default:
63
+ throw new errors.FiveOneEatError({
64
+ statusCode: _response.error.statusCode,
65
+ body: _response.error.body,
66
+ rawResponse: _response.rawResponse,
67
+ });
68
+ }
55
69
  }
56
70
  return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/business/cuisines");
57
71
  });
@@ -1 +1,2 @@
1
1
  export * from "./client/index.mjs";
2
+ export * from "./types/index.mjs";
@@ -1 +1,2 @@
1
1
  export * from "./client/index.mjs";
2
+ export * from "./types/index.mjs";
@@ -0,0 +1,4 @@
1
+ import type * as FiveOneEat from "../../../../../index.mjs";
2
+ export interface ListCuisinesResponse {
3
+ data: FiveOneEat.BusinessCuisine[];
4
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1 @@
1
+ export * from "./ListCuisinesResponse.mjs";
@@ -0,0 +1 @@
1
+ export * from "./ListCuisinesResponse.mjs";
@@ -6,9 +6,13 @@ export * as bulletins from "./bulletins/index.mjs";
6
6
  export * from "./bulletins/types/index.mjs";
7
7
  export * from "./businesses/client/requests/index.mjs";
8
8
  export * as businesses from "./businesses/index.mjs";
9
+ export * from "./businesses/types/index.mjs";
9
10
  export * as categories from "./categories/index.mjs";
11
+ export * from "./categories/types/index.mjs";
10
12
  export * as certifications from "./certifications/index.mjs";
13
+ export * from "./certifications/types/index.mjs";
11
14
  export * as cuisines from "./cuisines/index.mjs";
15
+ export * from "./cuisines/types/index.mjs";
12
16
  export * from "./gallery/client/requests/index.mjs";
13
17
  export * as gallery from "./gallery/index.mjs";
14
18
  export * from "./gallery/types/index.mjs";
@@ -6,9 +6,13 @@ export * as bulletins from "./bulletins/index.mjs";
6
6
  export * from "./bulletins/types/index.mjs";
7
7
  export * from "./businesses/client/requests/index.mjs";
8
8
  export * as businesses from "./businesses/index.mjs";
9
+ export * from "./businesses/types/index.mjs";
9
10
  export * as categories from "./categories/index.mjs";
11
+ export * from "./categories/types/index.mjs";
10
12
  export * as certifications from "./certifications/index.mjs";
13
+ export * from "./certifications/types/index.mjs";
11
14
  export * as cuisines from "./cuisines/index.mjs";
15
+ export * from "./cuisines/types/index.mjs";
12
16
  export * from "./gallery/client/requests/index.mjs";
13
17
  export * as gallery from "./gallery/index.mjs";
14
18
  export * from "./gallery/types/index.mjs";
@@ -5,7 +5,6 @@
5
5
  export interface UpdateBusinessProfileRequest {
6
6
  name?: string;
7
7
  handle?: string;
8
- category?: string | null;
9
8
  phone?: string | null;
10
9
  email?: string | null;
11
10
  website?: string | null;
@@ -32,6 +31,7 @@ export interface UpdateBusinessProfileRequest {
32
31
  pickup_instructions?: string | null;
33
32
  ownership?: string[] | null;
34
33
  badges?: string[] | null;
34
+ category_ids?: number[];
35
35
  hours?: UpdateBusinessProfileRequest.Hours.Item[] | null;
36
36
  operating_months?: number[] | null;
37
37
  }
@@ -50,7 +50,7 @@ export declare class CustomerClient {
50
50
  * @example
51
51
  * await client.customer.search({
52
52
  * q: "wings",
53
- * category: "restaurant",
53
+ * categories: "restaurant,bakery",
54
54
  * city: "Buffalo",
55
55
  * cuisines: "italian,mexican",
56
56
  * certifications: "kosher,halal"
@@ -78,7 +78,7 @@ export class CustomerClient {
78
78
  * @example
79
79
  * await client.customer.search({
80
80
  * q: "wings",
81
- * category: "restaurant",
81
+ * categories: "restaurant,bakery",
82
82
  * city: "Buffalo",
83
83
  * cuisines: "italian,mexican",
84
84
  * certifications: "kosher,halal"
@@ -90,10 +90,10 @@ export class CustomerClient {
90
90
  __search(request, requestOptions) {
91
91
  return __awaiter(this, void 0, void 0, function* () {
92
92
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
93
- const { q, category, city, cuisines, certifications, radius_km: radiusKm, per_type: perType, lat, lng, } = request;
93
+ const { q, categories, city, cuisines, certifications, radius_km: radiusKm, per_type: perType, lat, lng, } = request;
94
94
  const _queryParams = {
95
95
  q,
96
- category,
96
+ categories,
97
97
  city,
98
98
  cuisines,
99
99
  certifications,
@@ -2,7 +2,7 @@
2
2
  * @example
3
3
  * {
4
4
  * q: "wings",
5
- * category: "restaurant",
5
+ * categories: "restaurant,bakery",
6
6
  * city: "Buffalo",
7
7
  * cuisines: "italian,mexican",
8
8
  * certifications: "kosher,halal"
@@ -11,8 +11,8 @@
11
11
  export interface SearchCustomerRequest {
12
12
  /** Search query */
13
13
  q: string;
14
- /** Filter by business category */
15
- category?: string;
14
+ /** Comma-separated category slugs to filter businesses by */
15
+ categories?: string;
16
16
  /** Filter by city */
17
17
  city?: string;
18
18
  /** Comma-separated cuisine slugs to filter businesses by */
@@ -43,7 +43,7 @@ export declare class DiscoveryClient {
43
43
  highlights(requestOptions?: DiscoveryClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.DiscoveryHighlights>;
44
44
  private __highlights;
45
45
  /**
46
- * Retrieve a list of all business categories that have businesses.
46
+ * Retrieve a list of all business categories with their business counts.
47
47
  * This endpoint is used to populate category filters and navigation.
48
48
  *
49
49
  * @param {DiscoveryClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -137,7 +137,7 @@ export class DiscoveryClient {
137
137
  });
138
138
  }
139
139
  /**
140
- * Retrieve a list of all business categories that have businesses.
140
+ * Retrieve a list of all business categories with their business counts.
141
141
  * This endpoint is used to populate category filters and navigation.
142
142
  *
143
143
  * @param {DiscoveryClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -0,0 +1,9 @@
1
+ export interface BusinessCategory {
2
+ id: number;
3
+ name: string;
4
+ slug: string;
5
+ description: string | null;
6
+ icon: string | null;
7
+ group: string;
8
+ sort_order: number;
9
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,7 @@
1
+ export interface BusinessCertification {
2
+ id: number;
3
+ name: string;
4
+ slug: string;
5
+ description: string | null;
6
+ icon: string | null;
7
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,6 @@
1
+ export interface BusinessCuisine {
2
+ id: number;
3
+ name: string;
4
+ slug: string;
5
+ description: string | null;
6
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -3,7 +3,6 @@ export interface BusinessProfile {
3
3
  id: string;
4
4
  name: string;
5
5
  handle: string;
6
- category: string | null;
7
6
  description: string | null;
8
7
  bio: string | null;
9
8
  email: string | null;
@@ -37,6 +36,7 @@ export interface BusinessProfile {
37
36
  founding_partner: boolean;
38
37
  staff_pick: boolean;
39
38
  favorites_count: number;
39
+ categories?: FiveOneEat.BusinessCategory[] | undefined;
40
40
  cuisines?: BusinessProfile.Cuisines.Item[] | undefined;
41
41
  certifications?: BusinessProfile.Certifications.Item[] | undefined;
42
42
  active_temporary_locations?: FiveOneEat.CustomerTemporaryLocation[] | undefined;
@@ -1,8 +1,9 @@
1
+ import type * as FiveOneEat from "../index.mjs";
1
2
  export interface BusinessSearchResult {
2
3
  id: string;
3
4
  name: string;
4
5
  handle: string;
5
- category: string | null;
6
+ categories?: FiveOneEat.BusinessCategory[] | undefined;
6
7
  city: string | null;
7
8
  state: string | null;
8
9
  logo: string | null;
@@ -1,7 +1,8 @@
1
+ import type * as FiveOneEat from "../index.mjs";
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.mjs";
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.mjs";
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.mjs";
21
21
  export * from "./BardSetValues.mjs";
22
22
  export * from "./BardTextNode.mjs";
23
23
  export * from "./BusinessBulletin.mjs";
24
+ export * from "./BusinessCategory.mjs";
25
+ export * from "./BusinessCertification.mjs";
24
26
  export * from "./BusinessConversation.mjs";
27
+ export * from "./BusinessCuisine.mjs";
25
28
  export * from "./BusinessLoginResponse.mjs";
26
29
  export * from "./BusinessMe.mjs";
27
30
  export * from "./BusinessMenu.mjs";
@@ -21,7 +21,10 @@ export * from "./BardSetNode.mjs";
21
21
  export * from "./BardSetValues.mjs";
22
22
  export * from "./BardTextNode.mjs";
23
23
  export * from "./BusinessBulletin.mjs";
24
+ export * from "./BusinessCategory.mjs";
25
+ export * from "./BusinessCertification.mjs";
24
26
  export * from "./BusinessConversation.mjs";
27
+ export * from "./BusinessCuisine.mjs";
25
28
  export * from "./BusinessLoginResponse.mjs";
26
29
  export * from "./BusinessMe.mjs";
27
30
  export * from "./BusinessMenu.mjs";
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.0.23";
1
+ export declare const SDK_VERSION = "0.0.25";
@@ -1 +1 @@
1
- export const SDK_VERSION = "0.0.23";
1
+ export const SDK_VERSION = "0.0.25";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@51eat/sdk",
3
- "version": "0.0.23",
3
+ "version": "0.0.25",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",
@@ -110,6 +110,17 @@
110
110
  },
111
111
  "default": "./dist/cjs/api/resources/business/resources/bulletins/exports.js"
112
112
  },
113
+ "./business/businesses": {
114
+ "import": {
115
+ "types": "./dist/esm/api/resources/business/resources/businesses/exports.d.mts",
116
+ "default": "./dist/esm/api/resources/business/resources/businesses/exports.mjs"
117
+ },
118
+ "require": {
119
+ "types": "./dist/cjs/api/resources/business/resources/businesses/exports.d.ts",
120
+ "default": "./dist/cjs/api/resources/business/resources/businesses/exports.js"
121
+ },
122
+ "default": "./dist/cjs/api/resources/business/resources/businesses/exports.js"
123
+ },
113
124
  "./business/gallery": {
114
125
  "import": {
115
126
  "types": "./dist/esm/api/resources/business/resources/gallery/exports.d.mts",
@@ -165,17 +176,6 @@
165
176
  },
166
177
  "default": "./dist/cjs/api/resources/business/resources/pushNotifications/exports.js"
167
178
  },
168
- "./business/businesses": {
169
- "import": {
170
- "types": "./dist/esm/api/resources/business/resources/businesses/exports.d.mts",
171
- "default": "./dist/esm/api/resources/business/resources/businesses/exports.mjs"
172
- },
173
- "require": {
174
- "types": "./dist/cjs/api/resources/business/resources/businesses/exports.d.ts",
175
- "default": "./dist/cjs/api/resources/business/resources/businesses/exports.js"
176
- },
177
- "default": "./dist/cjs/api/resources/business/resources/businesses/exports.js"
178
- },
179
179
  "./business/cuisines": {
180
180
  "import": {
181
181
  "types": "./dist/esm/api/resources/business/resources/cuisines/exports.d.mts",