@51eat/sdk 0.0.7 → 0.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/BaseClient.js +2 -2
- package/dist/cjs/api/resources/discovery/client/Client.d.ts +26 -0
- package/dist/cjs/api/resources/discovery/client/Client.js +105 -3
- package/dist/cjs/api/resources/discovery/client/requests/GetDiscoveryFeedRequest.d.ts +2 -2
- package/dist/cjs/api/resources/discovery/types/GetDiscoveryCertificationsResponse.d.ts +4 -0
- package/dist/cjs/api/resources/discovery/types/GetDiscoveryCertificationsResponse.js +3 -0
- package/dist/cjs/api/resources/discovery/types/GetDiscoveryCuisinesResponse.d.ts +4 -0
- package/dist/cjs/api/resources/discovery/types/GetDiscoveryCuisinesResponse.js +3 -0
- package/dist/cjs/api/resources/discovery/types/index.d.ts +2 -0
- package/dist/cjs/api/resources/discovery/types/index.js +2 -0
- package/dist/cjs/api/types/CertificationResource.d.ts +7 -0
- package/dist/cjs/api/types/CertificationResource.js +3 -0
- package/dist/cjs/api/types/CuisineResource.d.ts +6 -0
- package/dist/cjs/api/types/CuisineResource.js +3 -0
- package/dist/cjs/api/types/index.d.ts +2 -0
- package/dist/cjs/api/types/index.js +2 -0
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/BaseClient.mjs +2 -2
- package/dist/esm/api/resources/discovery/client/Client.d.mts +26 -0
- package/dist/esm/api/resources/discovery/client/Client.mjs +105 -3
- package/dist/esm/api/resources/discovery/client/requests/GetDiscoveryFeedRequest.d.mts +2 -2
- package/dist/esm/api/resources/discovery/types/GetDiscoveryCertificationsResponse.d.mts +4 -0
- package/dist/esm/api/resources/discovery/types/GetDiscoveryCertificationsResponse.mjs +2 -0
- package/dist/esm/api/resources/discovery/types/GetDiscoveryCuisinesResponse.d.mts +4 -0
- package/dist/esm/api/resources/discovery/types/GetDiscoveryCuisinesResponse.mjs +2 -0
- package/dist/esm/api/resources/discovery/types/index.d.mts +2 -0
- package/dist/esm/api/resources/discovery/types/index.mjs +2 -0
- package/dist/esm/api/types/CertificationResource.d.mts +7 -0
- package/dist/esm/api/types/CertificationResource.mjs +2 -0
- package/dist/esm/api/types/CuisineResource.d.mts +6 -0
- package/dist/esm/api/types/CuisineResource.mjs +2 -0
- package/dist/esm/api/types/index.d.mts +2 -0
- package/dist/esm/api/types/index.mjs +2 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +112 -0
package/dist/cjs/BaseClient.js
CHANGED
|
@@ -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.
|
|
47
|
-
"User-Agent": "@51eat/sdk/0.0.
|
|
46
|
+
"X-Fern-SDK-Version": "0.0.9",
|
|
47
|
+
"User-Agent": "@51eat/sdk/0.0.9",
|
|
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.
|
|
@@ -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[]
|
|
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[]
|
|
150
|
-
"certification_ids[]
|
|
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);
|
|
@@ -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.
|
|
@@ -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[]
|
|
15
|
+
"cuisine_ids[]"?: number | number[];
|
|
16
16
|
/** Filter businesses by certification IDs */
|
|
17
|
-
"certification_ids[]
|
|
17
|
+
"certification_ids[]"?: number | number[];
|
|
18
18
|
}
|
|
@@ -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);
|
|
@@ -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);
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.0.
|
|
1
|
+
export declare const SDK_VERSION = "0.0.9";
|
package/dist/cjs/version.js
CHANGED
package/dist/esm/BaseClient.mjs
CHANGED
|
@@ -6,8 +6,8 @@ export function normalizeClientOptions(options) {
|
|
|
6
6
|
const headers = mergeHeaders({
|
|
7
7
|
"X-Fern-Language": "JavaScript",
|
|
8
8
|
"X-Fern-SDK-Name": "@51eat/sdk",
|
|
9
|
-
"X-Fern-SDK-Version": "0.0.
|
|
10
|
-
"User-Agent": "@51eat/sdk/0.0.
|
|
9
|
+
"X-Fern-SDK-Version": "0.0.9",
|
|
10
|
+
"User-Agent": "@51eat/sdk/0.0.9",
|
|
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.
|
|
@@ -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[]
|
|
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[]
|
|
114
|
-
"certification_ids[]
|
|
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);
|
|
@@ -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.
|
|
@@ -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[]
|
|
15
|
+
"cuisine_ids[]"?: number | number[];
|
|
16
16
|
/** Filter businesses by certification IDs */
|
|
17
|
-
"certification_ids[]
|
|
17
|
+
"certification_ids[]"?: number | number[];
|
|
18
18
|
}
|
|
@@ -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";
|
|
@@ -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";
|
package/dist/esm/version.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.0.
|
|
1
|
+
export declare const SDK_VERSION = "0.0.9";
|
package/dist/esm/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "0.0.
|
|
1
|
+
export const SDK_VERSION = "0.0.9";
|
package/package.json
CHANGED
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>
|