@51eat/sdk 0.0.6 → 0.0.8

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 (40) hide show
  1. package/dist/cjs/BaseClient.js +2 -2
  2. package/dist/cjs/api/resources/discovery/client/Client.d.ts +26 -0
  3. package/dist/cjs/api/resources/discovery/client/Client.js +102 -0
  4. package/dist/cjs/api/resources/discovery/types/GetDiscoveryCertificationsResponse.d.ts +4 -0
  5. package/dist/cjs/api/resources/discovery/types/GetDiscoveryCertificationsResponse.js +3 -0
  6. package/dist/cjs/api/resources/discovery/types/GetDiscoveryCuisinesResponse.d.ts +4 -0
  7. package/dist/cjs/api/resources/discovery/types/GetDiscoveryCuisinesResponse.js +3 -0
  8. package/dist/cjs/api/resources/discovery/types/index.d.ts +2 -0
  9. package/dist/cjs/api/resources/discovery/types/index.js +2 -0
  10. package/dist/cjs/api/types/CertificationResource.d.ts +7 -0
  11. package/dist/cjs/api/types/CertificationResource.js +3 -0
  12. package/dist/cjs/api/types/CuisineResource.d.ts +6 -0
  13. package/dist/cjs/api/types/CuisineResource.js +3 -0
  14. package/dist/cjs/api/types/DiscoveryCategoryResource.d.ts +2 -1
  15. package/dist/cjs/api/types/DiscoveryFeedResource.d.ts +1 -9
  16. package/dist/cjs/api/types/index.d.ts +2 -0
  17. package/dist/cjs/api/types/index.js +2 -0
  18. package/dist/cjs/version.d.ts +1 -1
  19. package/dist/cjs/version.js +1 -1
  20. package/dist/esm/BaseClient.mjs +2 -2
  21. package/dist/esm/api/resources/discovery/client/Client.d.mts +26 -0
  22. package/dist/esm/api/resources/discovery/client/Client.mjs +102 -0
  23. package/dist/esm/api/resources/discovery/types/GetDiscoveryCertificationsResponse.d.mts +4 -0
  24. package/dist/esm/api/resources/discovery/types/GetDiscoveryCertificationsResponse.mjs +2 -0
  25. package/dist/esm/api/resources/discovery/types/GetDiscoveryCuisinesResponse.d.mts +4 -0
  26. package/dist/esm/api/resources/discovery/types/GetDiscoveryCuisinesResponse.mjs +2 -0
  27. package/dist/esm/api/resources/discovery/types/index.d.mts +2 -0
  28. package/dist/esm/api/resources/discovery/types/index.mjs +2 -0
  29. package/dist/esm/api/types/CertificationResource.d.mts +7 -0
  30. package/dist/esm/api/types/CertificationResource.mjs +2 -0
  31. package/dist/esm/api/types/CuisineResource.d.mts +6 -0
  32. package/dist/esm/api/types/CuisineResource.mjs +2 -0
  33. package/dist/esm/api/types/DiscoveryCategoryResource.d.mts +2 -1
  34. package/dist/esm/api/types/DiscoveryFeedResource.d.mts +1 -9
  35. package/dist/esm/api/types/index.d.mts +2 -0
  36. package/dist/esm/api/types/index.mjs +2 -0
  37. package/dist/esm/version.d.mts +1 -1
  38. package/dist/esm/version.mjs +1 -1
  39. package/package.json +1 -1
  40. package/reference.md +112 -0
@@ -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.6",
47
- "User-Agent": "@51eat/sdk/0.0.6",
46
+ "X-Fern-SDK-Version": "0.0.8",
47
+ "User-Agent": "@51eat/sdk/0.0.8",
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);
@@ -58,6 +58,32 @@ export declare class DiscoveryClient {
58
58
  */
59
59
  getDiscoveryCategories(requestOptions?: DiscoveryClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.GetDiscoveryCategoriesResponse>;
60
60
  private __getDiscoveryCategories;
61
+ /**
62
+ * Retrieve a list of all cuisines, ordered alphabetically.
63
+ * This endpoint is used to populate cuisine filters.
64
+ *
65
+ * @param {DiscoveryClient.RequestOptions} requestOptions - Request-specific configuration.
66
+ *
67
+ * @throws {@link FiveOneEat.UnauthorizedError}
68
+ *
69
+ * @example
70
+ * await client.discovery.getDiscoveryCuisines()
71
+ */
72
+ getDiscoveryCuisines(requestOptions?: DiscoveryClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.GetDiscoveryCuisinesResponse>;
73
+ private __getDiscoveryCuisines;
74
+ /**
75
+ * Retrieve a list of all certifications, ordered alphabetically.
76
+ * This endpoint is used to populate certification filters.
77
+ *
78
+ * @param {DiscoveryClient.RequestOptions} requestOptions - Request-specific configuration.
79
+ *
80
+ * @throws {@link FiveOneEat.UnauthorizedError}
81
+ *
82
+ * @example
83
+ * await client.discovery.getDiscoveryCertifications()
84
+ */
85
+ getDiscoveryCertifications(requestOptions?: DiscoveryClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.GetDiscoveryCertificationsResponse>;
86
+ private __getDiscoveryCertifications;
61
87
  /**
62
88
  * Retrieve businesses for a specific category with pagination support.
63
89
  * Results are optimized for list display.
@@ -238,6 +238,108 @@ class DiscoveryClient {
238
238
  return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/customer/discovery/categories");
239
239
  });
240
240
  }
241
+ /**
242
+ * Retrieve a list of all cuisines, ordered alphabetically.
243
+ * This endpoint is used to populate cuisine filters.
244
+ *
245
+ * @param {DiscoveryClient.RequestOptions} requestOptions - Request-specific configuration.
246
+ *
247
+ * @throws {@link FiveOneEat.UnauthorizedError}
248
+ *
249
+ * @example
250
+ * await client.discovery.getDiscoveryCuisines()
251
+ */
252
+ getDiscoveryCuisines(requestOptions) {
253
+ return core.HttpResponsePromise.fromPromise(this.__getDiscoveryCuisines(requestOptions));
254
+ }
255
+ __getDiscoveryCuisines(requestOptions) {
256
+ return __awaiter(this, void 0, void 0, function* () {
257
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
258
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
259
+ 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);
260
+ const _response = yield core.fetcher({
261
+ 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/cuisines"),
262
+ method: "GET",
263
+ headers: _headers,
264
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
265
+ 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,
266
+ 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,
267
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
268
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
269
+ logging: this._options.logging,
270
+ });
271
+ if (_response.ok) {
272
+ return {
273
+ data: _response.body,
274
+ rawResponse: _response.rawResponse,
275
+ };
276
+ }
277
+ if (_response.error.reason === "status-code") {
278
+ switch (_response.error.statusCode) {
279
+ case 401:
280
+ throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
281
+ default:
282
+ throw new errors.FiveOneEatError({
283
+ statusCode: _response.error.statusCode,
284
+ body: _response.error.body,
285
+ rawResponse: _response.rawResponse,
286
+ });
287
+ }
288
+ }
289
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/customer/discovery/cuisines");
290
+ });
291
+ }
292
+ /**
293
+ * Retrieve a list of all certifications, ordered alphabetically.
294
+ * This endpoint is used to populate certification filters.
295
+ *
296
+ * @param {DiscoveryClient.RequestOptions} requestOptions - Request-specific configuration.
297
+ *
298
+ * @throws {@link FiveOneEat.UnauthorizedError}
299
+ *
300
+ * @example
301
+ * await client.discovery.getDiscoveryCertifications()
302
+ */
303
+ getDiscoveryCertifications(requestOptions) {
304
+ return core.HttpResponsePromise.fromPromise(this.__getDiscoveryCertifications(requestOptions));
305
+ }
306
+ __getDiscoveryCertifications(requestOptions) {
307
+ return __awaiter(this, void 0, void 0, function* () {
308
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
309
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
310
+ 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);
311
+ const _response = yield core.fetcher({
312
+ 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/certifications"),
313
+ method: "GET",
314
+ headers: _headers,
315
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
316
+ 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,
317
+ 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,
318
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
319
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
320
+ logging: this._options.logging,
321
+ });
322
+ if (_response.ok) {
323
+ return {
324
+ data: _response.body,
325
+ rawResponse: _response.rawResponse,
326
+ };
327
+ }
328
+ if (_response.error.reason === "status-code") {
329
+ switch (_response.error.statusCode) {
330
+ case 401:
331
+ throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
332
+ default:
333
+ throw new errors.FiveOneEatError({
334
+ statusCode: _response.error.statusCode,
335
+ body: _response.error.body,
336
+ rawResponse: _response.rawResponse,
337
+ });
338
+ }
339
+ }
340
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/customer/discovery/certifications");
341
+ });
342
+ }
241
343
  /**
242
344
  * Retrieve businesses for a specific category with pagination support.
243
345
  * Results are optimized for list display.
@@ -0,0 +1,4 @@
1
+ import type * as FiveOneEat from "../../../index.js";
2
+ export interface GetDiscoveryCertificationsResponse {
3
+ data: FiveOneEat.CertificationResource[];
4
+ }
@@ -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 });
@@ -0,0 +1,4 @@
1
+ import type * as FiveOneEat from "../../../index.js";
2
+ export interface GetDiscoveryCuisinesResponse {
3
+ data: FiveOneEat.CuisineResource[];
4
+ }
@@ -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 });
@@ -1,3 +1,5 @@
1
1
  export * from "./ExploreBusinessesResponse.js";
2
2
  export * from "./GetCategoryBusinessesResponse.js";
3
3
  export * from "./GetDiscoveryCategoriesResponse.js";
4
+ export * from "./GetDiscoveryCertificationsResponse.js";
5
+ export * from "./GetDiscoveryCuisinesResponse.js";
@@ -17,3 +17,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./ExploreBusinessesResponse.js"), exports);
18
18
  __exportStar(require("./GetCategoryBusinessesResponse.js"), exports);
19
19
  __exportStar(require("./GetDiscoveryCategoriesResponse.js"), exports);
20
+ __exportStar(require("./GetDiscoveryCertificationsResponse.js"), exports);
21
+ __exportStar(require("./GetDiscoveryCuisinesResponse.js"), exports);
@@ -0,0 +1,7 @@
1
+ export interface CertificationResource {
2
+ id: number;
3
+ name: string;
4
+ slug: string;
5
+ description: string | null;
6
+ icon: string | null;
7
+ }
@@ -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 });
@@ -0,0 +1,6 @@
1
+ export interface CuisineResource {
2
+ id: number;
3
+ name: string;
4
+ slug: string;
5
+ description: string | null;
6
+ }
@@ -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 });
@@ -1,6 +1,7 @@
1
+ import type * as FiveOneEat from "../index.js";
1
2
  export interface DiscoveryCategoryResource {
2
3
  value: string;
3
4
  label: string;
4
5
  total_businesses: number;
5
- businesses: unknown[];
6
+ businesses: FiveOneEat.DiscoveryBusinessResource[];
6
7
  }
@@ -1,13 +1,5 @@
1
1
  import type * as FiveOneEat from "../index.js";
2
2
  export interface DiscoveryFeedResource {
3
3
  data: FiveOneEat.DiscoveryCategoryResource[];
4
- meta: DiscoveryFeedResource.Meta;
5
- }
6
- export declare namespace DiscoveryFeedResource {
7
- interface Meta {
8
- current_page: number;
9
- per_page: number;
10
- total_categories: number;
11
- has_more: boolean;
12
- }
4
+ meta: FiveOneEat.PaginationResource;
13
5
  }
@@ -5,10 +5,12 @@ export * from "./BusinessProfileResource.js";
5
5
  export * from "./BusinessResource.js";
6
6
  export * from "./BusinessSearchResource.js";
7
7
  export * from "./CategoryResource.js";
8
+ export * from "./CertificationResource.js";
8
9
  export * from "./CommentResource.js";
9
10
  export * from "./CommentResponseResource.js";
10
11
  export * from "./ConflictErrorBody.js";
11
12
  export * from "./ConversationResource.js";
13
+ export * from "./CuisineResource.js";
12
14
  export * from "./DiscoveryBusinessResource.js";
13
15
  export * from "./DiscoveryCategoryResource.js";
14
16
  export * from "./DiscoveryFeedResource.js";
@@ -21,10 +21,12 @@ __exportStar(require("./BusinessProfileResource.js"), exports);
21
21
  __exportStar(require("./BusinessResource.js"), exports);
22
22
  __exportStar(require("./BusinessSearchResource.js"), exports);
23
23
  __exportStar(require("./CategoryResource.js"), exports);
24
+ __exportStar(require("./CertificationResource.js"), exports);
24
25
  __exportStar(require("./CommentResource.js"), exports);
25
26
  __exportStar(require("./CommentResponseResource.js"), exports);
26
27
  __exportStar(require("./ConflictErrorBody.js"), exports);
27
28
  __exportStar(require("./ConversationResource.js"), exports);
29
+ __exportStar(require("./CuisineResource.js"), exports);
28
30
  __exportStar(require("./DiscoveryBusinessResource.js"), exports);
29
31
  __exportStar(require("./DiscoveryCategoryResource.js"), exports);
30
32
  __exportStar(require("./DiscoveryFeedResource.js"), exports);
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.0.6";
1
+ export declare const SDK_VERSION = "0.0.8";
@@ -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.6";
4
+ exports.SDK_VERSION = "0.0.8";
@@ -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.6",
10
- "User-Agent": "@51eat/sdk/0.0.6",
9
+ "X-Fern-SDK-Version": "0.0.8",
10
+ "User-Agent": "@51eat/sdk/0.0.8",
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);
@@ -58,6 +58,32 @@ export declare class DiscoveryClient {
58
58
  */
59
59
  getDiscoveryCategories(requestOptions?: DiscoveryClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.GetDiscoveryCategoriesResponse>;
60
60
  private __getDiscoveryCategories;
61
+ /**
62
+ * Retrieve a list of all cuisines, ordered alphabetically.
63
+ * This endpoint is used to populate cuisine filters.
64
+ *
65
+ * @param {DiscoveryClient.RequestOptions} requestOptions - Request-specific configuration.
66
+ *
67
+ * @throws {@link FiveOneEat.UnauthorizedError}
68
+ *
69
+ * @example
70
+ * await client.discovery.getDiscoveryCuisines()
71
+ */
72
+ getDiscoveryCuisines(requestOptions?: DiscoveryClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.GetDiscoveryCuisinesResponse>;
73
+ private __getDiscoveryCuisines;
74
+ /**
75
+ * Retrieve a list of all certifications, ordered alphabetically.
76
+ * This endpoint is used to populate certification filters.
77
+ *
78
+ * @param {DiscoveryClient.RequestOptions} requestOptions - Request-specific configuration.
79
+ *
80
+ * @throws {@link FiveOneEat.UnauthorizedError}
81
+ *
82
+ * @example
83
+ * await client.discovery.getDiscoveryCertifications()
84
+ */
85
+ getDiscoveryCertifications(requestOptions?: DiscoveryClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.GetDiscoveryCertificationsResponse>;
86
+ private __getDiscoveryCertifications;
61
87
  /**
62
88
  * Retrieve businesses for a specific category with pagination support.
63
89
  * Results are optimized for list display.
@@ -202,6 +202,108 @@ export class DiscoveryClient {
202
202
  return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/customer/discovery/categories");
203
203
  });
204
204
  }
205
+ /**
206
+ * Retrieve a list of all cuisines, ordered alphabetically.
207
+ * This endpoint is used to populate cuisine filters.
208
+ *
209
+ * @param {DiscoveryClient.RequestOptions} requestOptions - Request-specific configuration.
210
+ *
211
+ * @throws {@link FiveOneEat.UnauthorizedError}
212
+ *
213
+ * @example
214
+ * await client.discovery.getDiscoveryCuisines()
215
+ */
216
+ getDiscoveryCuisines(requestOptions) {
217
+ return core.HttpResponsePromise.fromPromise(this.__getDiscoveryCuisines(requestOptions));
218
+ }
219
+ __getDiscoveryCuisines(requestOptions) {
220
+ return __awaiter(this, void 0, void 0, function* () {
221
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
222
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
223
+ 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);
224
+ const _response = yield core.fetcher({
225
+ 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/cuisines"),
226
+ method: "GET",
227
+ headers: _headers,
228
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
229
+ 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,
230
+ 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,
231
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
232
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
233
+ logging: this._options.logging,
234
+ });
235
+ if (_response.ok) {
236
+ return {
237
+ data: _response.body,
238
+ rawResponse: _response.rawResponse,
239
+ };
240
+ }
241
+ if (_response.error.reason === "status-code") {
242
+ switch (_response.error.statusCode) {
243
+ case 401:
244
+ throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
245
+ default:
246
+ throw new errors.FiveOneEatError({
247
+ statusCode: _response.error.statusCode,
248
+ body: _response.error.body,
249
+ rawResponse: _response.rawResponse,
250
+ });
251
+ }
252
+ }
253
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/customer/discovery/cuisines");
254
+ });
255
+ }
256
+ /**
257
+ * Retrieve a list of all certifications, ordered alphabetically.
258
+ * This endpoint is used to populate certification filters.
259
+ *
260
+ * @param {DiscoveryClient.RequestOptions} requestOptions - Request-specific configuration.
261
+ *
262
+ * @throws {@link FiveOneEat.UnauthorizedError}
263
+ *
264
+ * @example
265
+ * await client.discovery.getDiscoveryCertifications()
266
+ */
267
+ getDiscoveryCertifications(requestOptions) {
268
+ return core.HttpResponsePromise.fromPromise(this.__getDiscoveryCertifications(requestOptions));
269
+ }
270
+ __getDiscoveryCertifications(requestOptions) {
271
+ return __awaiter(this, void 0, void 0, function* () {
272
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
273
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
274
+ 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);
275
+ const _response = yield core.fetcher({
276
+ 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/certifications"),
277
+ method: "GET",
278
+ headers: _headers,
279
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
280
+ 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,
281
+ 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,
282
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
283
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
284
+ logging: this._options.logging,
285
+ });
286
+ if (_response.ok) {
287
+ return {
288
+ data: _response.body,
289
+ rawResponse: _response.rawResponse,
290
+ };
291
+ }
292
+ if (_response.error.reason === "status-code") {
293
+ switch (_response.error.statusCode) {
294
+ case 401:
295
+ throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
296
+ default:
297
+ throw new errors.FiveOneEatError({
298
+ statusCode: _response.error.statusCode,
299
+ body: _response.error.body,
300
+ rawResponse: _response.rawResponse,
301
+ });
302
+ }
303
+ }
304
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/customer/discovery/certifications");
305
+ });
306
+ }
205
307
  /**
206
308
  * Retrieve businesses for a specific category with pagination support.
207
309
  * Results are optimized for list display.
@@ -0,0 +1,4 @@
1
+ import type * as FiveOneEat from "../../../index.mjs";
2
+ export interface GetDiscoveryCertificationsResponse {
3
+ data: FiveOneEat.CertificationResource[];
4
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,4 @@
1
+ import type * as FiveOneEat from "../../../index.mjs";
2
+ export interface GetDiscoveryCuisinesResponse {
3
+ data: FiveOneEat.CuisineResource[];
4
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -1,3 +1,5 @@
1
1
  export * from "./ExploreBusinessesResponse.mjs";
2
2
  export * from "./GetCategoryBusinessesResponse.mjs";
3
3
  export * from "./GetDiscoveryCategoriesResponse.mjs";
4
+ export * from "./GetDiscoveryCertificationsResponse.mjs";
5
+ export * from "./GetDiscoveryCuisinesResponse.mjs";
@@ -1,3 +1,5 @@
1
1
  export * from "./ExploreBusinessesResponse.mjs";
2
2
  export * from "./GetCategoryBusinessesResponse.mjs";
3
3
  export * from "./GetDiscoveryCategoriesResponse.mjs";
4
+ export * from "./GetDiscoveryCertificationsResponse.mjs";
5
+ export * from "./GetDiscoveryCuisinesResponse.mjs";
@@ -0,0 +1,7 @@
1
+ export interface CertificationResource {
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 CuisineResource {
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 {};
@@ -1,6 +1,7 @@
1
+ import type * as FiveOneEat from "../index.mjs";
1
2
  export interface DiscoveryCategoryResource {
2
3
  value: string;
3
4
  label: string;
4
5
  total_businesses: number;
5
- businesses: unknown[];
6
+ businesses: FiveOneEat.DiscoveryBusinessResource[];
6
7
  }
@@ -1,13 +1,5 @@
1
1
  import type * as FiveOneEat from "../index.mjs";
2
2
  export interface DiscoveryFeedResource {
3
3
  data: FiveOneEat.DiscoveryCategoryResource[];
4
- meta: DiscoveryFeedResource.Meta;
5
- }
6
- export declare namespace DiscoveryFeedResource {
7
- interface Meta {
8
- current_page: number;
9
- per_page: number;
10
- total_categories: number;
11
- has_more: boolean;
12
- }
4
+ meta: FiveOneEat.PaginationResource;
13
5
  }
@@ -5,10 +5,12 @@ export * from "./BusinessProfileResource.mjs";
5
5
  export * from "./BusinessResource.mjs";
6
6
  export * from "./BusinessSearchResource.mjs";
7
7
  export * from "./CategoryResource.mjs";
8
+ export * from "./CertificationResource.mjs";
8
9
  export * from "./CommentResource.mjs";
9
10
  export * from "./CommentResponseResource.mjs";
10
11
  export * from "./ConflictErrorBody.mjs";
11
12
  export * from "./ConversationResource.mjs";
13
+ export * from "./CuisineResource.mjs";
12
14
  export * from "./DiscoveryBusinessResource.mjs";
13
15
  export * from "./DiscoveryCategoryResource.mjs";
14
16
  export * from "./DiscoveryFeedResource.mjs";
@@ -5,10 +5,12 @@ export * from "./BusinessProfileResource.mjs";
5
5
  export * from "./BusinessResource.mjs";
6
6
  export * from "./BusinessSearchResource.mjs";
7
7
  export * from "./CategoryResource.mjs";
8
+ export * from "./CertificationResource.mjs";
8
9
  export * from "./CommentResource.mjs";
9
10
  export * from "./CommentResponseResource.mjs";
10
11
  export * from "./ConflictErrorBody.mjs";
11
12
  export * from "./ConversationResource.mjs";
13
+ export * from "./CuisineResource.mjs";
12
14
  export * from "./DiscoveryBusinessResource.mjs";
13
15
  export * from "./DiscoveryCategoryResource.mjs";
14
16
  export * from "./DiscoveryFeedResource.mjs";
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.0.6";
1
+ export declare const SDK_VERSION = "0.0.8";
@@ -1 +1 @@
1
- export const SDK_VERSION = "0.0.6";
1
+ export const SDK_VERSION = "0.0.8";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@51eat/sdk",
3
- "version": "0.0.6",
3
+ "version": "0.0.8",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",
package/reference.md CHANGED
@@ -2061,6 +2061,118 @@ await client.discovery.getDiscoveryCategories();
2061
2061
  </dl>
2062
2062
 
2063
2063
 
2064
+ </dd>
2065
+ </dl>
2066
+ </details>
2067
+
2068
+ <details><summary><code>client.discovery.<a href="/src/api/resources/discovery/client/Client.ts">getDiscoveryCuisines</a>() -> FiveOneEat.GetDiscoveryCuisinesResponse</code></summary>
2069
+ <dl>
2070
+ <dd>
2071
+
2072
+ #### 📝 Description
2073
+
2074
+ <dl>
2075
+ <dd>
2076
+
2077
+ <dl>
2078
+ <dd>
2079
+
2080
+ Retrieve a list of all cuisines, ordered alphabetically.
2081
+ This endpoint is used to populate cuisine filters.
2082
+ </dd>
2083
+ </dl>
2084
+ </dd>
2085
+ </dl>
2086
+
2087
+ #### 🔌 Usage
2088
+
2089
+ <dl>
2090
+ <dd>
2091
+
2092
+ <dl>
2093
+ <dd>
2094
+
2095
+ ```typescript
2096
+ await client.discovery.getDiscoveryCuisines();
2097
+
2098
+ ```
2099
+ </dd>
2100
+ </dl>
2101
+ </dd>
2102
+ </dl>
2103
+
2104
+ #### ⚙️ Parameters
2105
+
2106
+ <dl>
2107
+ <dd>
2108
+
2109
+ <dl>
2110
+ <dd>
2111
+
2112
+ **requestOptions:** `DiscoveryClient.RequestOptions`
2113
+
2114
+ </dd>
2115
+ </dl>
2116
+ </dd>
2117
+ </dl>
2118
+
2119
+
2120
+ </dd>
2121
+ </dl>
2122
+ </details>
2123
+
2124
+ <details><summary><code>client.discovery.<a href="/src/api/resources/discovery/client/Client.ts">getDiscoveryCertifications</a>() -> FiveOneEat.GetDiscoveryCertificationsResponse</code></summary>
2125
+ <dl>
2126
+ <dd>
2127
+
2128
+ #### 📝 Description
2129
+
2130
+ <dl>
2131
+ <dd>
2132
+
2133
+ <dl>
2134
+ <dd>
2135
+
2136
+ Retrieve a list of all certifications, ordered alphabetically.
2137
+ This endpoint is used to populate certification filters.
2138
+ </dd>
2139
+ </dl>
2140
+ </dd>
2141
+ </dl>
2142
+
2143
+ #### 🔌 Usage
2144
+
2145
+ <dl>
2146
+ <dd>
2147
+
2148
+ <dl>
2149
+ <dd>
2150
+
2151
+ ```typescript
2152
+ await client.discovery.getDiscoveryCertifications();
2153
+
2154
+ ```
2155
+ </dd>
2156
+ </dl>
2157
+ </dd>
2158
+ </dl>
2159
+
2160
+ #### ⚙️ Parameters
2161
+
2162
+ <dl>
2163
+ <dd>
2164
+
2165
+ <dl>
2166
+ <dd>
2167
+
2168
+ **requestOptions:** `DiscoveryClient.RequestOptions`
2169
+
2170
+ </dd>
2171
+ </dl>
2172
+ </dd>
2173
+ </dl>
2174
+
2175
+
2064
2176
  </dd>
2065
2177
  </dl>
2066
2178
  </details>