@51eat/sdk 0.0.8 → 0.0.10

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.
@@ -43,8 +43,8 @@ function normalizeClientOptions(options) {
43
43
  const headers = (0, headers_js_1.mergeHeaders)({
44
44
  "X-Fern-Language": "JavaScript",
45
45
  "X-Fern-SDK-Name": "@51eat/sdk",
46
- "X-Fern-SDK-Version": "0.0.8",
47
- "User-Agent": "@51eat/sdk/0.0.8",
46
+ "X-Fern-SDK-Version": "0.0.10",
47
+ "User-Agent": "@51eat/sdk/0.0.10",
48
48
  "X-Fern-Runtime": core.RUNTIME.type,
49
49
  "X-Fern-Runtime-Version": core.RUNTIME.version,
50
50
  }, options === null || options === void 0 ? void 0 : options.headers);
@@ -45,6 +45,20 @@ export declare class DiscoveryClient {
45
45
  */
46
46
  getDiscoveryFeed(request?: FiveOneEat.GetDiscoveryFeedRequest, requestOptions?: DiscoveryClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.DiscoveryFeedResource>;
47
47
  private __getDiscoveryFeed;
48
+ /**
49
+ * Returns curated sections of businesses for the discovery home screen,
50
+ * including staff picks and founding partners. This endpoint is designed
51
+ * to be extended with additional sections (e.g. editorial, trending) over time.
52
+ *
53
+ * @param {DiscoveryClient.RequestOptions} requestOptions - Request-specific configuration.
54
+ *
55
+ * @throws {@link FiveOneEat.UnauthorizedError}
56
+ *
57
+ * @example
58
+ * await client.discovery.getDiscoveryHighlights()
59
+ */
60
+ getDiscoveryHighlights(requestOptions?: DiscoveryClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.DiscoveryHighlightsResource>;
61
+ private __getDiscoveryHighlights;
48
62
  /**
49
63
  * Retrieve a list of all business categories that have businesses.
50
64
  * This endpoint is used to populate category filters and navigation.
@@ -141,13 +141,13 @@ class DiscoveryClient {
141
141
  __getDiscoveryFeed() {
142
142
  return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
143
143
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
144
- const { page, per_page: perPage, search, "cuisine_ids[][]": cuisineIdsArrayArray, "certification_ids[][]": certificationIdsArrayArray, } = request;
144
+ const { page, per_page: perPage, search, "cuisine_ids[]": cuisineIdsArray, "certification_ids[]": certificationIdsArray, } = request;
145
145
  const _queryParams = {
146
146
  page,
147
147
  per_page: perPage,
148
148
  search,
149
- "cuisine_ids[][]": cuisineIdsArrayArray,
150
- "certification_ids[][]": certificationIdsArrayArray,
149
+ "cuisine_ids[]": cuisineIdsArray,
150
+ "certification_ids[]": certificationIdsArray,
151
151
  };
152
152
  const _authRequest = yield this._options.authProvider.getAuthRequest();
153
153
  const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
@@ -187,6 +187,58 @@ class DiscoveryClient {
187
187
  return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/customer/discovery");
188
188
  });
189
189
  }
190
+ /**
191
+ * Returns curated sections of businesses for the discovery home screen,
192
+ * including staff picks and founding partners. This endpoint is designed
193
+ * to be extended with additional sections (e.g. editorial, trending) over time.
194
+ *
195
+ * @param {DiscoveryClient.RequestOptions} requestOptions - Request-specific configuration.
196
+ *
197
+ * @throws {@link FiveOneEat.UnauthorizedError}
198
+ *
199
+ * @example
200
+ * await client.discovery.getDiscoveryHighlights()
201
+ */
202
+ getDiscoveryHighlights(requestOptions) {
203
+ return core.HttpResponsePromise.fromPromise(this.__getDiscoveryHighlights(requestOptions));
204
+ }
205
+ __getDiscoveryHighlights(requestOptions) {
206
+ return __awaiter(this, void 0, void 0, function* () {
207
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
208
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
209
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
210
+ const _response = yield core.fetcher({
211
+ 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, "customer/discovery/highlights"),
212
+ method: "GET",
213
+ headers: _headers,
214
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
215
+ 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,
216
+ 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,
217
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
218
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
219
+ logging: this._options.logging,
220
+ });
221
+ if (_response.ok) {
222
+ return {
223
+ data: _response.body,
224
+ rawResponse: _response.rawResponse,
225
+ };
226
+ }
227
+ if (_response.error.reason === "status-code") {
228
+ switch (_response.error.statusCode) {
229
+ case 401:
230
+ throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
231
+ default:
232
+ throw new errors.FiveOneEatError({
233
+ statusCode: _response.error.statusCode,
234
+ body: _response.error.body,
235
+ rawResponse: _response.rawResponse,
236
+ });
237
+ }
238
+ }
239
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/customer/discovery/highlights");
240
+ });
241
+ }
190
242
  /**
191
243
  * Retrieve a list of all business categories that have businesses.
192
244
  * This endpoint is used to populate category filters and navigation.
@@ -12,7 +12,7 @@ export interface GetDiscoveryFeedRequest {
12
12
  /** Search term to filter businesses within categories */
13
13
  search?: string;
14
14
  /** Filter businesses by cuisine IDs */
15
- "cuisine_ids[][]"?: string | string[];
15
+ "cuisine_ids[]"?: number | number[];
16
16
  /** Filter businesses by certification IDs */
17
- "certification_ids[][]"?: string | string[];
17
+ "certification_ids[]"?: number | number[];
18
18
  }
@@ -0,0 +1,10 @@
1
+ import type * as FiveOneEat from "../index.js";
2
+ export interface DiscoveryHighlightsResource {
3
+ data: DiscoveryHighlightsResource.Data;
4
+ }
5
+ export declare namespace DiscoveryHighlightsResource {
6
+ interface Data {
7
+ staff_picks: FiveOneEat.DiscoveryBusinessResource[];
8
+ founding_partners: FiveOneEat.DiscoveryBusinessResource[];
9
+ }
10
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -14,6 +14,7 @@ export * from "./CuisineResource.js";
14
14
  export * from "./DiscoveryBusinessResource.js";
15
15
  export * from "./DiscoveryCategoryResource.js";
16
16
  export * from "./DiscoveryFeedResource.js";
17
+ export * from "./DiscoveryHighlightsResource.js";
17
18
  export * from "./DiscoveryResponseResource.js";
18
19
  export * from "./EventDetailResource.js";
19
20
  export * from "./EventFeedItemResource.js";
@@ -30,6 +30,7 @@ __exportStar(require("./CuisineResource.js"), exports);
30
30
  __exportStar(require("./DiscoveryBusinessResource.js"), exports);
31
31
  __exportStar(require("./DiscoveryCategoryResource.js"), exports);
32
32
  __exportStar(require("./DiscoveryFeedResource.js"), exports);
33
+ __exportStar(require("./DiscoveryHighlightsResource.js"), exports);
33
34
  __exportStar(require("./DiscoveryResponseResource.js"), exports);
34
35
  __exportStar(require("./EventDetailResource.js"), exports);
35
36
  __exportStar(require("./EventFeedItemResource.js"), exports);
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.0.8";
1
+ export declare const SDK_VERSION = "0.0.10";
@@ -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.8";
4
+ exports.SDK_VERSION = "0.0.10";
@@ -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.8",
10
- "User-Agent": "@51eat/sdk/0.0.8",
9
+ "X-Fern-SDK-Version": "0.0.10",
10
+ "User-Agent": "@51eat/sdk/0.0.10",
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);
@@ -45,6 +45,20 @@ export declare class DiscoveryClient {
45
45
  */
46
46
  getDiscoveryFeed(request?: FiveOneEat.GetDiscoveryFeedRequest, requestOptions?: DiscoveryClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.DiscoveryFeedResource>;
47
47
  private __getDiscoveryFeed;
48
+ /**
49
+ * Returns curated sections of businesses for the discovery home screen,
50
+ * including staff picks and founding partners. This endpoint is designed
51
+ * to be extended with additional sections (e.g. editorial, trending) over time.
52
+ *
53
+ * @param {DiscoveryClient.RequestOptions} requestOptions - Request-specific configuration.
54
+ *
55
+ * @throws {@link FiveOneEat.UnauthorizedError}
56
+ *
57
+ * @example
58
+ * await client.discovery.getDiscoveryHighlights()
59
+ */
60
+ getDiscoveryHighlights(requestOptions?: DiscoveryClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.DiscoveryHighlightsResource>;
61
+ private __getDiscoveryHighlights;
48
62
  /**
49
63
  * Retrieve a list of all business categories that have businesses.
50
64
  * This endpoint is used to populate category filters and navigation.
@@ -105,13 +105,13 @@ export class DiscoveryClient {
105
105
  __getDiscoveryFeed() {
106
106
  return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
107
107
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
108
- const { page, per_page: perPage, search, "cuisine_ids[][]": cuisineIdsArrayArray, "certification_ids[][]": certificationIdsArrayArray, } = request;
108
+ const { page, per_page: perPage, search, "cuisine_ids[]": cuisineIdsArray, "certification_ids[]": certificationIdsArray, } = request;
109
109
  const _queryParams = {
110
110
  page,
111
111
  per_page: perPage,
112
112
  search,
113
- "cuisine_ids[][]": cuisineIdsArrayArray,
114
- "certification_ids[][]": certificationIdsArrayArray,
113
+ "cuisine_ids[]": cuisineIdsArray,
114
+ "certification_ids[]": certificationIdsArray,
115
115
  };
116
116
  const _authRequest = yield this._options.authProvider.getAuthRequest();
117
117
  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);
@@ -151,6 +151,58 @@ export class DiscoveryClient {
151
151
  return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/customer/discovery");
152
152
  });
153
153
  }
154
+ /**
155
+ * Returns curated sections of businesses for the discovery home screen,
156
+ * including staff picks and founding partners. This endpoint is designed
157
+ * to be extended with additional sections (e.g. editorial, trending) over time.
158
+ *
159
+ * @param {DiscoveryClient.RequestOptions} requestOptions - Request-specific configuration.
160
+ *
161
+ * @throws {@link FiveOneEat.UnauthorizedError}
162
+ *
163
+ * @example
164
+ * await client.discovery.getDiscoveryHighlights()
165
+ */
166
+ getDiscoveryHighlights(requestOptions) {
167
+ return core.HttpResponsePromise.fromPromise(this.__getDiscoveryHighlights(requestOptions));
168
+ }
169
+ __getDiscoveryHighlights(requestOptions) {
170
+ return __awaiter(this, void 0, void 0, function* () {
171
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
172
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
173
+ 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);
174
+ const _response = yield core.fetcher({
175
+ 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, "customer/discovery/highlights"),
176
+ method: "GET",
177
+ headers: _headers,
178
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
179
+ 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,
180
+ 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,
181
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
182
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
183
+ logging: this._options.logging,
184
+ });
185
+ if (_response.ok) {
186
+ return {
187
+ data: _response.body,
188
+ rawResponse: _response.rawResponse,
189
+ };
190
+ }
191
+ if (_response.error.reason === "status-code") {
192
+ switch (_response.error.statusCode) {
193
+ case 401:
194
+ throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
195
+ default:
196
+ throw new errors.FiveOneEatError({
197
+ statusCode: _response.error.statusCode,
198
+ body: _response.error.body,
199
+ rawResponse: _response.rawResponse,
200
+ });
201
+ }
202
+ }
203
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/customer/discovery/highlights");
204
+ });
205
+ }
154
206
  /**
155
207
  * Retrieve a list of all business categories that have businesses.
156
208
  * This endpoint is used to populate category filters and navigation.
@@ -12,7 +12,7 @@ export interface GetDiscoveryFeedRequest {
12
12
  /** Search term to filter businesses within categories */
13
13
  search?: string;
14
14
  /** Filter businesses by cuisine IDs */
15
- "cuisine_ids[][]"?: string | string[];
15
+ "cuisine_ids[]"?: number | number[];
16
16
  /** Filter businesses by certification IDs */
17
- "certification_ids[][]"?: string | string[];
17
+ "certification_ids[]"?: number | number[];
18
18
  }
@@ -0,0 +1,10 @@
1
+ import type * as FiveOneEat from "../index.mjs";
2
+ export interface DiscoveryHighlightsResource {
3
+ data: DiscoveryHighlightsResource.Data;
4
+ }
5
+ export declare namespace DiscoveryHighlightsResource {
6
+ interface Data {
7
+ staff_picks: FiveOneEat.DiscoveryBusinessResource[];
8
+ founding_partners: FiveOneEat.DiscoveryBusinessResource[];
9
+ }
10
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -14,6 +14,7 @@ export * from "./CuisineResource.mjs";
14
14
  export * from "./DiscoveryBusinessResource.mjs";
15
15
  export * from "./DiscoveryCategoryResource.mjs";
16
16
  export * from "./DiscoveryFeedResource.mjs";
17
+ export * from "./DiscoveryHighlightsResource.mjs";
17
18
  export * from "./DiscoveryResponseResource.mjs";
18
19
  export * from "./EventDetailResource.mjs";
19
20
  export * from "./EventFeedItemResource.mjs";
@@ -14,6 +14,7 @@ export * from "./CuisineResource.mjs";
14
14
  export * from "./DiscoveryBusinessResource.mjs";
15
15
  export * from "./DiscoveryCategoryResource.mjs";
16
16
  export * from "./DiscoveryFeedResource.mjs";
17
+ export * from "./DiscoveryHighlightsResource.mjs";
17
18
  export * from "./DiscoveryResponseResource.mjs";
18
19
  export * from "./EventDetailResource.mjs";
19
20
  export * from "./EventFeedItemResource.mjs";
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.0.8";
1
+ export declare const SDK_VERSION = "0.0.10";
@@ -1 +1 @@
1
- export const SDK_VERSION = "0.0.8";
1
+ export const SDK_VERSION = "0.0.10";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@51eat/sdk",
3
- "version": "0.0.8",
3
+ "version": "0.0.10",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",
package/reference.md CHANGED
@@ -2005,6 +2005,63 @@ await client.discovery.getDiscoveryFeed({
2005
2005
  </dl>
2006
2006
 
2007
2007
 
2008
+ </dd>
2009
+ </dl>
2010
+ </details>
2011
+
2012
+ <details><summary><code>client.discovery.<a href="/src/api/resources/discovery/client/Client.ts">getDiscoveryHighlights</a>() -> FiveOneEat.DiscoveryHighlightsResource</code></summary>
2013
+ <dl>
2014
+ <dd>
2015
+
2016
+ #### 📝 Description
2017
+
2018
+ <dl>
2019
+ <dd>
2020
+
2021
+ <dl>
2022
+ <dd>
2023
+
2024
+ Returns curated sections of businesses for the discovery home screen,
2025
+ including staff picks and founding partners. This endpoint is designed
2026
+ to be extended with additional sections (e.g. editorial, trending) over time.
2027
+ </dd>
2028
+ </dl>
2029
+ </dd>
2030
+ </dl>
2031
+
2032
+ #### 🔌 Usage
2033
+
2034
+ <dl>
2035
+ <dd>
2036
+
2037
+ <dl>
2038
+ <dd>
2039
+
2040
+ ```typescript
2041
+ await client.discovery.getDiscoveryHighlights();
2042
+
2043
+ ```
2044
+ </dd>
2045
+ </dl>
2046
+ </dd>
2047
+ </dl>
2048
+
2049
+ #### ⚙️ Parameters
2050
+
2051
+ <dl>
2052
+ <dd>
2053
+
2054
+ <dl>
2055
+ <dd>
2056
+
2057
+ **requestOptions:** `DiscoveryClient.RequestOptions`
2058
+
2059
+ </dd>
2060
+ </dl>
2061
+ </dd>
2062
+ </dl>
2063
+
2064
+
2008
2065
  </dd>
2009
2066
  </dl>
2010
2067
  </details>