@51eat/sdk 0.0.29 → 0.0.30
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/business/client/Client.d.ts +3 -0
- package/dist/cjs/api/resources/business/client/Client.js +31 -26
- package/dist/cjs/api/resources/business/resources/allergens/client/Client.d.ts +26 -0
- package/dist/cjs/api/resources/business/resources/allergens/client/Client.js +110 -0
- package/dist/cjs/api/resources/business/resources/allergens/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/business/resources/allergens/client/index.js +2 -0
- package/dist/cjs/api/resources/business/resources/allergens/exports.d.ts +2 -0
- package/dist/cjs/api/resources/business/resources/allergens/exports.js +21 -0
- package/dist/cjs/api/resources/business/resources/allergens/index.d.ts +2 -0
- package/dist/cjs/api/resources/business/resources/allergens/index.js +18 -0
- package/dist/cjs/api/resources/business/resources/allergens/types/ListAllergensResponse.d.ts +4 -0
- package/dist/cjs/api/resources/business/resources/allergens/types/ListAllergensResponse.js +3 -0
- package/dist/cjs/api/resources/business/resources/allergens/types/index.d.ts +1 -0
- package/dist/cjs/api/resources/business/resources/allergens/types/index.js +17 -0
- package/dist/cjs/api/resources/business/resources/index.d.ts +2 -0
- package/dist/cjs/api/resources/business/resources/index.js +6 -4
- package/dist/cjs/api/resources/customer/resources/discovery/client/Client.d.ts +13 -0
- package/dist/cjs/api/resources/customer/resources/discovery/client/Client.js +51 -0
- package/dist/cjs/api/resources/customer/resources/discovery/types/AllergensDiscoveryResponse.d.ts +4 -0
- package/dist/cjs/api/resources/customer/resources/discovery/types/AllergensDiscoveryResponse.js +3 -0
- package/dist/cjs/api/resources/customer/resources/discovery/types/index.d.ts +1 -0
- package/dist/cjs/api/resources/customer/resources/discovery/types/index.js +1 -0
- package/dist/cjs/api/types/BusinessAllergen.d.ts +8 -0
- package/dist/cjs/api/types/BusinessAllergen.js +3 -0
- package/dist/cjs/api/types/CustomerDiscoveryAllergen.d.ts +8 -0
- package/dist/cjs/api/types/CustomerDiscoveryAllergen.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/business/client/Client.d.mts +3 -0
- package/dist/esm/api/resources/business/client/Client.mjs +5 -0
- package/dist/esm/api/resources/business/resources/allergens/client/Client.d.mts +26 -0
- package/dist/esm/api/resources/business/resources/allergens/client/Client.mjs +73 -0
- package/dist/esm/api/resources/business/resources/allergens/client/index.d.mts +1 -0
- package/dist/esm/api/resources/business/resources/allergens/client/index.mjs +1 -0
- package/dist/esm/api/resources/business/resources/allergens/exports.d.mts +2 -0
- package/dist/esm/api/resources/business/resources/allergens/exports.mjs +3 -0
- package/dist/esm/api/resources/business/resources/allergens/index.d.mts +2 -0
- package/dist/esm/api/resources/business/resources/allergens/index.mjs +2 -0
- package/dist/esm/api/resources/business/resources/allergens/types/ListAllergensResponse.d.mts +4 -0
- package/dist/esm/api/resources/business/resources/allergens/types/ListAllergensResponse.mjs +2 -0
- package/dist/esm/api/resources/business/resources/allergens/types/index.d.mts +1 -0
- package/dist/esm/api/resources/business/resources/allergens/types/index.mjs +1 -0
- package/dist/esm/api/resources/business/resources/index.d.mts +2 -0
- package/dist/esm/api/resources/business/resources/index.mjs +2 -0
- package/dist/esm/api/resources/customer/resources/discovery/client/Client.d.mts +13 -0
- package/dist/esm/api/resources/customer/resources/discovery/client/Client.mjs +51 -0
- package/dist/esm/api/resources/customer/resources/discovery/types/AllergensDiscoveryResponse.d.mts +4 -0
- package/dist/esm/api/resources/customer/resources/discovery/types/AllergensDiscoveryResponse.mjs +2 -0
- package/dist/esm/api/resources/customer/resources/discovery/types/index.d.mts +1 -0
- package/dist/esm/api/resources/customer/resources/discovery/types/index.mjs +1 -0
- package/dist/esm/api/types/BusinessAllergen.d.mts +8 -0
- package/dist/esm/api/types/BusinessAllergen.mjs +2 -0
- package/dist/esm/api/types/CustomerDiscoveryAllergen.d.mts +8 -0
- package/dist/esm/api/types/CustomerDiscoveryAllergen.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 +12 -1
- package/reference.md +113 -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.30",
|
|
47
|
+
"User-Agent": "@51eat/sdk/0.0.30",
|
|
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);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { BaseClientOptions } from "../../../../BaseClient.js";
|
|
2
2
|
import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.js";
|
|
3
|
+
import { AllergensClient } from "../resources/allergens/client/Client.js";
|
|
3
4
|
import { AuthClient } from "../resources/auth/client/Client.js";
|
|
4
5
|
import { BulletinsClient } from "../resources/bulletins/client/Client.js";
|
|
5
6
|
import { BusinessesClient } from "../resources/businesses/client/Client.js";
|
|
@@ -31,6 +32,7 @@ export declare class BusinessClient {
|
|
|
31
32
|
protected _cuisines: CuisinesClient | undefined;
|
|
32
33
|
protected _certifications: CertificationsClient | undefined;
|
|
33
34
|
protected _categories: CategoriesClient | undefined;
|
|
35
|
+
protected _allergens: AllergensClient | undefined;
|
|
34
36
|
constructor(options?: BusinessClient.Options);
|
|
35
37
|
get auth(): AuthClient;
|
|
36
38
|
get bulletins(): BulletinsClient;
|
|
@@ -45,4 +47,5 @@ export declare class BusinessClient {
|
|
|
45
47
|
get cuisines(): CuisinesClient;
|
|
46
48
|
get certifications(): CertificationsClient;
|
|
47
49
|
get categories(): CategoriesClient;
|
|
50
|
+
get allergens(): AllergensClient;
|
|
48
51
|
}
|
|
@@ -3,74 +3,79 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.BusinessClient = void 0;
|
|
5
5
|
const BaseClient_js_1 = require("../../../../BaseClient.js");
|
|
6
|
-
const Client_js_1 = require("../resources/
|
|
7
|
-
const Client_js_2 = require("../resources/
|
|
8
|
-
const Client_js_3 = require("../resources/
|
|
9
|
-
const Client_js_4 = require("../resources/
|
|
10
|
-
const Client_js_5 = require("../resources/
|
|
11
|
-
const Client_js_6 = require("../resources/
|
|
12
|
-
const Client_js_7 = require("../resources/
|
|
13
|
-
const Client_js_8 = require("../resources/
|
|
14
|
-
const Client_js_9 = require("../resources/
|
|
15
|
-
const Client_js_10 = require("../resources/
|
|
16
|
-
const Client_js_11 = require("../resources/
|
|
17
|
-
const Client_js_12 = require("../resources/
|
|
18
|
-
const Client_js_13 = require("../resources/
|
|
6
|
+
const Client_js_1 = require("../resources/allergens/client/Client.js");
|
|
7
|
+
const Client_js_2 = require("../resources/auth/client/Client.js");
|
|
8
|
+
const Client_js_3 = require("../resources/bulletins/client/Client.js");
|
|
9
|
+
const Client_js_4 = require("../resources/businesses/client/Client.js");
|
|
10
|
+
const Client_js_5 = require("../resources/categories/client/Client.js");
|
|
11
|
+
const Client_js_6 = require("../resources/certifications/client/Client.js");
|
|
12
|
+
const Client_js_7 = require("../resources/cuisines/client/Client.js");
|
|
13
|
+
const Client_js_8 = require("../resources/events/client/Client.js");
|
|
14
|
+
const Client_js_9 = require("../resources/gallery/client/Client.js");
|
|
15
|
+
const Client_js_10 = require("../resources/menus/client/Client.js");
|
|
16
|
+
const Client_js_11 = require("../resources/messaging/client/Client.js");
|
|
17
|
+
const Client_js_12 = require("../resources/profile/client/Client.js");
|
|
18
|
+
const Client_js_13 = require("../resources/pushNotifications/client/Client.js");
|
|
19
|
+
const Client_js_14 = require("../resources/stripeConnect/client/Client.js");
|
|
19
20
|
class BusinessClient {
|
|
20
21
|
constructor(options = {}) {
|
|
21
22
|
this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
|
|
22
23
|
}
|
|
23
24
|
get auth() {
|
|
24
25
|
var _a;
|
|
25
|
-
return ((_a = this._auth) !== null && _a !== void 0 ? _a : (this._auth = new
|
|
26
|
+
return ((_a = this._auth) !== null && _a !== void 0 ? _a : (this._auth = new Client_js_2.AuthClient(this._options)));
|
|
26
27
|
}
|
|
27
28
|
get bulletins() {
|
|
28
29
|
var _a;
|
|
29
|
-
return ((_a = this._bulletins) !== null && _a !== void 0 ? _a : (this._bulletins = new
|
|
30
|
+
return ((_a = this._bulletins) !== null && _a !== void 0 ? _a : (this._bulletins = new Client_js_3.BulletinsClient(this._options)));
|
|
30
31
|
}
|
|
31
32
|
get businesses() {
|
|
32
33
|
var _a;
|
|
33
|
-
return ((_a = this._businesses) !== null && _a !== void 0 ? _a : (this._businesses = new
|
|
34
|
+
return ((_a = this._businesses) !== null && _a !== void 0 ? _a : (this._businesses = new Client_js_4.BusinessesClient(this._options)));
|
|
34
35
|
}
|
|
35
36
|
get events() {
|
|
36
37
|
var _a;
|
|
37
|
-
return ((_a = this._events) !== null && _a !== void 0 ? _a : (this._events = new
|
|
38
|
+
return ((_a = this._events) !== null && _a !== void 0 ? _a : (this._events = new Client_js_8.EventsClient(this._options)));
|
|
38
39
|
}
|
|
39
40
|
get gallery() {
|
|
40
41
|
var _a;
|
|
41
|
-
return ((_a = this._gallery) !== null && _a !== void 0 ? _a : (this._gallery = new
|
|
42
|
+
return ((_a = this._gallery) !== null && _a !== void 0 ? _a : (this._gallery = new Client_js_9.GalleryClient(this._options)));
|
|
42
43
|
}
|
|
43
44
|
get menus() {
|
|
44
45
|
var _a;
|
|
45
|
-
return ((_a = this._menus) !== null && _a !== void 0 ? _a : (this._menus = new
|
|
46
|
+
return ((_a = this._menus) !== null && _a !== void 0 ? _a : (this._menus = new Client_js_10.MenusClient(this._options)));
|
|
46
47
|
}
|
|
47
48
|
get messaging() {
|
|
48
49
|
var _a;
|
|
49
|
-
return ((_a = this._messaging) !== null && _a !== void 0 ? _a : (this._messaging = new
|
|
50
|
+
return ((_a = this._messaging) !== null && _a !== void 0 ? _a : (this._messaging = new Client_js_11.MessagingClient(this._options)));
|
|
50
51
|
}
|
|
51
52
|
get profile() {
|
|
52
53
|
var _a;
|
|
53
|
-
return ((_a = this._profile) !== null && _a !== void 0 ? _a : (this._profile = new
|
|
54
|
+
return ((_a = this._profile) !== null && _a !== void 0 ? _a : (this._profile = new Client_js_12.ProfileClient(this._options)));
|
|
54
55
|
}
|
|
55
56
|
get pushNotifications() {
|
|
56
57
|
var _a;
|
|
57
|
-
return ((_a = this._pushNotifications) !== null && _a !== void 0 ? _a : (this._pushNotifications = new
|
|
58
|
+
return ((_a = this._pushNotifications) !== null && _a !== void 0 ? _a : (this._pushNotifications = new Client_js_13.PushNotificationsClient(this._options)));
|
|
58
59
|
}
|
|
59
60
|
get stripeConnect() {
|
|
60
61
|
var _a;
|
|
61
|
-
return ((_a = this._stripeConnect) !== null && _a !== void 0 ? _a : (this._stripeConnect = new
|
|
62
|
+
return ((_a = this._stripeConnect) !== null && _a !== void 0 ? _a : (this._stripeConnect = new Client_js_14.StripeConnectClient(this._options)));
|
|
62
63
|
}
|
|
63
64
|
get cuisines() {
|
|
64
65
|
var _a;
|
|
65
|
-
return ((_a = this._cuisines) !== null && _a !== void 0 ? _a : (this._cuisines = new
|
|
66
|
+
return ((_a = this._cuisines) !== null && _a !== void 0 ? _a : (this._cuisines = new Client_js_7.CuisinesClient(this._options)));
|
|
66
67
|
}
|
|
67
68
|
get certifications() {
|
|
68
69
|
var _a;
|
|
69
|
-
return ((_a = this._certifications) !== null && _a !== void 0 ? _a : (this._certifications = new
|
|
70
|
+
return ((_a = this._certifications) !== null && _a !== void 0 ? _a : (this._certifications = new Client_js_6.CertificationsClient(this._options)));
|
|
70
71
|
}
|
|
71
72
|
get categories() {
|
|
72
73
|
var _a;
|
|
73
|
-
return ((_a = this._categories) !== null && _a !== void 0 ? _a : (this._categories = new
|
|
74
|
+
return ((_a = this._categories) !== null && _a !== void 0 ? _a : (this._categories = new Client_js_5.CategoriesClient(this._options)));
|
|
75
|
+
}
|
|
76
|
+
get allergens() {
|
|
77
|
+
var _a;
|
|
78
|
+
return ((_a = this._allergens) !== null && _a !== void 0 ? _a : (this._allergens = new Client_js_1.AllergensClient(this._options)));
|
|
74
79
|
}
|
|
75
80
|
}
|
|
76
81
|
exports.BusinessClient = BusinessClient;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.js";
|
|
2
|
+
import { type NormalizedClientOptionsWithAuth } from "../../../../../../BaseClient.js";
|
|
3
|
+
import * as core from "../../../../../../core/index.js";
|
|
4
|
+
import * as FiveOneEat from "../../../../../index.js";
|
|
5
|
+
export declare namespace AllergensClient {
|
|
6
|
+
type Options = BaseClientOptions;
|
|
7
|
+
interface RequestOptions extends BaseRequestOptions {
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
export declare class AllergensClient {
|
|
11
|
+
protected readonly _options: NormalizedClientOptionsWithAuth<AllergensClient.Options>;
|
|
12
|
+
constructor(options?: AllergensClient.Options);
|
|
13
|
+
/**
|
|
14
|
+
* Retrieve a list of all allergens, ordered alphabetically. Use these UUIDs
|
|
15
|
+
* in the `allergens` array when creating or updating a menu item.
|
|
16
|
+
*
|
|
17
|
+
* @param {AllergensClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
18
|
+
*
|
|
19
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* await client.business.allergens.list()
|
|
23
|
+
*/
|
|
24
|
+
list(requestOptions?: AllergensClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.business.ListAllergensResponse>;
|
|
25
|
+
private __list;
|
|
26
|
+
}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
+
var ownKeys = function(o) {
|
|
21
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
+
var ar = [];
|
|
23
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
+
return ar;
|
|
25
|
+
};
|
|
26
|
+
return ownKeys(o);
|
|
27
|
+
};
|
|
28
|
+
return function (mod) {
|
|
29
|
+
if (mod && mod.__esModule) return mod;
|
|
30
|
+
var result = {};
|
|
31
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
+
__setModuleDefault(result, mod);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
36
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
37
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
38
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
39
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
40
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
41
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
42
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
43
|
+
});
|
|
44
|
+
};
|
|
45
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
46
|
+
exports.AllergensClient = void 0;
|
|
47
|
+
const BaseClient_js_1 = require("../../../../../../BaseClient.js");
|
|
48
|
+
const headers_js_1 = require("../../../../../../core/headers.js");
|
|
49
|
+
const core = __importStar(require("../../../../../../core/index.js"));
|
|
50
|
+
const environments = __importStar(require("../../../../../../environments.js"));
|
|
51
|
+
const handleNonStatusCodeError_js_1 = require("../../../../../../errors/handleNonStatusCodeError.js");
|
|
52
|
+
const errors = __importStar(require("../../../../../../errors/index.js"));
|
|
53
|
+
const FiveOneEat = __importStar(require("../../../../../index.js"));
|
|
54
|
+
class AllergensClient {
|
|
55
|
+
constructor(options = {}) {
|
|
56
|
+
this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Retrieve a list of all allergens, ordered alphabetically. Use these UUIDs
|
|
60
|
+
* in the `allergens` array when creating or updating a menu item.
|
|
61
|
+
*
|
|
62
|
+
* @param {AllergensClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
63
|
+
*
|
|
64
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* await client.business.allergens.list()
|
|
68
|
+
*/
|
|
69
|
+
list(requestOptions) {
|
|
70
|
+
return core.HttpResponsePromise.fromPromise(this.__list(requestOptions));
|
|
71
|
+
}
|
|
72
|
+
__list(requestOptions) {
|
|
73
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
74
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
75
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
76
|
+
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);
|
|
77
|
+
const _response = yield core.fetcher({
|
|
78
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.FiveOneEatEnvironment.Production, "business/allergens"),
|
|
79
|
+
method: "GET",
|
|
80
|
+
headers: _headers,
|
|
81
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
82
|
+
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,
|
|
83
|
+
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,
|
|
84
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
85
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
86
|
+
logging: this._options.logging,
|
|
87
|
+
});
|
|
88
|
+
if (_response.ok) {
|
|
89
|
+
return {
|
|
90
|
+
data: _response.body,
|
|
91
|
+
rawResponse: _response.rawResponse,
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
if (_response.error.reason === "status-code") {
|
|
95
|
+
switch (_response.error.statusCode) {
|
|
96
|
+
case 401:
|
|
97
|
+
throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
98
|
+
default:
|
|
99
|
+
throw new errors.FiveOneEatError({
|
|
100
|
+
statusCode: _response.error.statusCode,
|
|
101
|
+
body: _response.error.body,
|
|
102
|
+
rawResponse: _response.rawResponse,
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/business/allergens");
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
exports.AllergensClient = AllergensClient;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
15
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
16
|
+
};
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.AllergensClient = void 0;
|
|
19
|
+
var Client_js_1 = require("./client/Client.js");
|
|
20
|
+
Object.defineProperty(exports, "AllergensClient", { enumerable: true, get: function () { return Client_js_1.AllergensClient; } });
|
|
21
|
+
__exportStar(require("./client/index.js"), exports);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./client/index.js"), exports);
|
|
18
|
+
__exportStar(require("./types/index.js"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./ListAllergensResponse.js";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./ListAllergensResponse.js"), exports);
|
|
@@ -15,9 +15,6 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
19
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
20
|
-
};
|
|
21
18
|
var __importStar = (this && this.__importStar) || (function () {
|
|
22
19
|
var ownKeys = function(o) {
|
|
23
20
|
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
@@ -35,8 +32,13 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
35
32
|
return result;
|
|
36
33
|
};
|
|
37
34
|
})();
|
|
35
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
36
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
37
|
+
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.stripeConnect = exports.pushNotifications = exports.profile = exports.messaging = exports.menus = exports.gallery = exports.events = exports.cuisines = exports.certifications = exports.categories = exports.businesses = exports.bulletins = exports.auth = void 0;
|
|
39
|
+
exports.stripeConnect = exports.pushNotifications = exports.profile = exports.messaging = exports.menus = exports.gallery = exports.events = exports.cuisines = exports.certifications = exports.categories = exports.businesses = exports.bulletins = exports.auth = exports.allergens = void 0;
|
|
40
|
+
exports.allergens = __importStar(require("./allergens/index.js"));
|
|
41
|
+
__exportStar(require("./allergens/types/index.js"), exports);
|
|
40
42
|
__exportStar(require("./auth/client/requests/index.js"), exports);
|
|
41
43
|
exports.auth = __importStar(require("./auth/index.js"));
|
|
42
44
|
__exportStar(require("./auth/types/index.js"), exports);
|
|
@@ -81,6 +81,19 @@ export declare class DiscoveryClient {
|
|
|
81
81
|
*/
|
|
82
82
|
certifications(requestOptions?: DiscoveryClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.customer.CertificationsDiscoveryResponse>;
|
|
83
83
|
private __certifications;
|
|
84
|
+
/**
|
|
85
|
+
* Retrieve a list of all allergens, ordered alphabetically, for use in
|
|
86
|
+
* filters, labels, and other customer-facing display.
|
|
87
|
+
*
|
|
88
|
+
* @param {DiscoveryClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
89
|
+
*
|
|
90
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
91
|
+
*
|
|
92
|
+
* @example
|
|
93
|
+
* await client.customer.discovery.allergens()
|
|
94
|
+
*/
|
|
95
|
+
allergens(requestOptions?: DiscoveryClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.customer.AllergensDiscoveryResponse>;
|
|
96
|
+
private __allergens;
|
|
84
97
|
/**
|
|
85
98
|
* Retrieve businesses for a specific category with pagination support.
|
|
86
99
|
* Results are optimized for list display.
|
|
@@ -325,6 +325,57 @@ class DiscoveryClient {
|
|
|
325
325
|
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/customer/discovery/certifications");
|
|
326
326
|
});
|
|
327
327
|
}
|
|
328
|
+
/**
|
|
329
|
+
* Retrieve a list of all allergens, ordered alphabetically, for use in
|
|
330
|
+
* filters, labels, and other customer-facing display.
|
|
331
|
+
*
|
|
332
|
+
* @param {DiscoveryClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
333
|
+
*
|
|
334
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
335
|
+
*
|
|
336
|
+
* @example
|
|
337
|
+
* await client.customer.discovery.allergens()
|
|
338
|
+
*/
|
|
339
|
+
allergens(requestOptions) {
|
|
340
|
+
return core.HttpResponsePromise.fromPromise(this.__allergens(requestOptions));
|
|
341
|
+
}
|
|
342
|
+
__allergens(requestOptions) {
|
|
343
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
344
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
345
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
346
|
+
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);
|
|
347
|
+
const _response = yield core.fetcher({
|
|
348
|
+
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/allergens"),
|
|
349
|
+
method: "GET",
|
|
350
|
+
headers: _headers,
|
|
351
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
352
|
+
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,
|
|
353
|
+
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,
|
|
354
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
355
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
356
|
+
logging: this._options.logging,
|
|
357
|
+
});
|
|
358
|
+
if (_response.ok) {
|
|
359
|
+
return {
|
|
360
|
+
data: _response.body,
|
|
361
|
+
rawResponse: _response.rawResponse,
|
|
362
|
+
};
|
|
363
|
+
}
|
|
364
|
+
if (_response.error.reason === "status-code") {
|
|
365
|
+
switch (_response.error.statusCode) {
|
|
366
|
+
case 401:
|
|
367
|
+
throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
368
|
+
default:
|
|
369
|
+
throw new errors.FiveOneEatError({
|
|
370
|
+
statusCode: _response.error.statusCode,
|
|
371
|
+
body: _response.error.body,
|
|
372
|
+
rawResponse: _response.rawResponse,
|
|
373
|
+
});
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/customer/discovery/allergens");
|
|
377
|
+
});
|
|
378
|
+
}
|
|
328
379
|
/**
|
|
329
380
|
* Retrieve businesses for a specific category with pagination support.
|
|
330
381
|
* Results are optimized for list display.
|
|
@@ -14,6 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./AllergensDiscoveryResponse.js"), exports);
|
|
17
18
|
__exportStar(require("./CategoriesDiscoveryResponse.js"), exports);
|
|
18
19
|
__exportStar(require("./CategoryBusinessesDiscoveryResponse.js"), exports);
|
|
19
20
|
__exportStar(require("./CertificationsDiscoveryResponse.js"), exports);
|
|
@@ -20,6 +20,7 @@ export * from "./BardProductSetValues.js";
|
|
|
20
20
|
export * from "./BardSetNode.js";
|
|
21
21
|
export * from "./BardSetValues.js";
|
|
22
22
|
export * from "./BardTextNode.js";
|
|
23
|
+
export * from "./BusinessAllergen.js";
|
|
23
24
|
export * from "./BusinessBulletin.js";
|
|
24
25
|
export * from "./BusinessBulletinComment.js";
|
|
25
26
|
export * from "./BusinessBulletinCommentReply.js";
|
|
@@ -58,6 +59,7 @@ export * from "./CustomerBulletinResponse.js";
|
|
|
58
59
|
export * from "./CustomerBusinessProfile.js";
|
|
59
60
|
export * from "./CustomerComment.js";
|
|
60
61
|
export * from "./CustomerCommentResponse.js";
|
|
62
|
+
export * from "./CustomerDiscoveryAllergen.js";
|
|
61
63
|
export * from "./CustomerEvent.js";
|
|
62
64
|
export * from "./CustomerEventDetail.js";
|
|
63
65
|
export * from "./CustomerEventResponse.js";
|
|
@@ -36,6 +36,7 @@ __exportStar(require("./BardProductSetValues.js"), exports);
|
|
|
36
36
|
__exportStar(require("./BardSetNode.js"), exports);
|
|
37
37
|
__exportStar(require("./BardSetValues.js"), exports);
|
|
38
38
|
__exportStar(require("./BardTextNode.js"), exports);
|
|
39
|
+
__exportStar(require("./BusinessAllergen.js"), exports);
|
|
39
40
|
__exportStar(require("./BusinessBulletin.js"), exports);
|
|
40
41
|
__exportStar(require("./BusinessBulletinComment.js"), exports);
|
|
41
42
|
__exportStar(require("./BusinessBulletinCommentReply.js"), exports);
|
|
@@ -74,6 +75,7 @@ __exportStar(require("./CustomerBulletinResponse.js"), exports);
|
|
|
74
75
|
__exportStar(require("./CustomerBusinessProfile.js"), exports);
|
|
75
76
|
__exportStar(require("./CustomerComment.js"), exports);
|
|
76
77
|
__exportStar(require("./CustomerCommentResponse.js"), exports);
|
|
78
|
+
__exportStar(require("./CustomerDiscoveryAllergen.js"), exports);
|
|
77
79
|
__exportStar(require("./CustomerEvent.js"), exports);
|
|
78
80
|
__exportStar(require("./CustomerEventDetail.js"), exports);
|
|
79
81
|
__exportStar(require("./CustomerEventResponse.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.30";
|
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.30",
|
|
10
|
+
"User-Agent": "@51eat/sdk/0.0.30",
|
|
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);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { BaseClientOptions } from "../../../../BaseClient.mjs";
|
|
2
2
|
import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.mjs";
|
|
3
|
+
import { AllergensClient } from "../resources/allergens/client/Client.mjs";
|
|
3
4
|
import { AuthClient } from "../resources/auth/client/Client.mjs";
|
|
4
5
|
import { BulletinsClient } from "../resources/bulletins/client/Client.mjs";
|
|
5
6
|
import { BusinessesClient } from "../resources/businesses/client/Client.mjs";
|
|
@@ -31,6 +32,7 @@ export declare class BusinessClient {
|
|
|
31
32
|
protected _cuisines: CuisinesClient | undefined;
|
|
32
33
|
protected _certifications: CertificationsClient | undefined;
|
|
33
34
|
protected _categories: CategoriesClient | undefined;
|
|
35
|
+
protected _allergens: AllergensClient | undefined;
|
|
34
36
|
constructor(options?: BusinessClient.Options);
|
|
35
37
|
get auth(): AuthClient;
|
|
36
38
|
get bulletins(): BulletinsClient;
|
|
@@ -45,4 +47,5 @@ export declare class BusinessClient {
|
|
|
45
47
|
get cuisines(): CuisinesClient;
|
|
46
48
|
get certifications(): CertificationsClient;
|
|
47
49
|
get categories(): CategoriesClient;
|
|
50
|
+
get allergens(): AllergensClient;
|
|
48
51
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// This file was auto-generated by Fern from our API Definition.
|
|
2
2
|
import { normalizeClientOptionsWithAuth } from "../../../../BaseClient.mjs";
|
|
3
|
+
import { AllergensClient } from "../resources/allergens/client/Client.mjs";
|
|
3
4
|
import { AuthClient } from "../resources/auth/client/Client.mjs";
|
|
4
5
|
import { BulletinsClient } from "../resources/bulletins/client/Client.mjs";
|
|
5
6
|
import { BusinessesClient } from "../resources/businesses/client/Client.mjs";
|
|
@@ -69,4 +70,8 @@ export class BusinessClient {
|
|
|
69
70
|
var _a;
|
|
70
71
|
return ((_a = this._categories) !== null && _a !== void 0 ? _a : (this._categories = new CategoriesClient(this._options)));
|
|
71
72
|
}
|
|
73
|
+
get allergens() {
|
|
74
|
+
var _a;
|
|
75
|
+
return ((_a = this._allergens) !== null && _a !== void 0 ? _a : (this._allergens = new AllergensClient(this._options)));
|
|
76
|
+
}
|
|
72
77
|
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.mjs";
|
|
2
|
+
import { type NormalizedClientOptionsWithAuth } from "../../../../../../BaseClient.mjs";
|
|
3
|
+
import * as core from "../../../../../../core/index.mjs";
|
|
4
|
+
import * as FiveOneEat from "../../../../../index.mjs";
|
|
5
|
+
export declare namespace AllergensClient {
|
|
6
|
+
type Options = BaseClientOptions;
|
|
7
|
+
interface RequestOptions extends BaseRequestOptions {
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
export declare class AllergensClient {
|
|
11
|
+
protected readonly _options: NormalizedClientOptionsWithAuth<AllergensClient.Options>;
|
|
12
|
+
constructor(options?: AllergensClient.Options);
|
|
13
|
+
/**
|
|
14
|
+
* Retrieve a list of all allergens, ordered alphabetically. Use these UUIDs
|
|
15
|
+
* in the `allergens` array when creating or updating a menu item.
|
|
16
|
+
*
|
|
17
|
+
* @param {AllergensClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
18
|
+
*
|
|
19
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* await client.business.allergens.list()
|
|
23
|
+
*/
|
|
24
|
+
list(requestOptions?: AllergensClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.business.ListAllergensResponse>;
|
|
25
|
+
private __list;
|
|
26
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
import { normalizeClientOptionsWithAuth } from "../../../../../../BaseClient.mjs";
|
|
12
|
+
import { mergeHeaders } from "../../../../../../core/headers.mjs";
|
|
13
|
+
import * as core from "../../../../../../core/index.mjs";
|
|
14
|
+
import * as environments from "../../../../../../environments.mjs";
|
|
15
|
+
import { handleNonStatusCodeError } from "../../../../../../errors/handleNonStatusCodeError.mjs";
|
|
16
|
+
import * as errors from "../../../../../../errors/index.mjs";
|
|
17
|
+
import * as FiveOneEat from "../../../../../index.mjs";
|
|
18
|
+
export class AllergensClient {
|
|
19
|
+
constructor(options = {}) {
|
|
20
|
+
this._options = normalizeClientOptionsWithAuth(options);
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Retrieve a list of all allergens, ordered alphabetically. Use these UUIDs
|
|
24
|
+
* in the `allergens` array when creating or updating a menu item.
|
|
25
|
+
*
|
|
26
|
+
* @param {AllergensClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
27
|
+
*
|
|
28
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* await client.business.allergens.list()
|
|
32
|
+
*/
|
|
33
|
+
list(requestOptions) {
|
|
34
|
+
return core.HttpResponsePromise.fromPromise(this.__list(requestOptions));
|
|
35
|
+
}
|
|
36
|
+
__list(requestOptions) {
|
|
37
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
38
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
39
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
40
|
+
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);
|
|
41
|
+
const _response = yield core.fetcher({
|
|
42
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.FiveOneEatEnvironment.Production, "business/allergens"),
|
|
43
|
+
method: "GET",
|
|
44
|
+
headers: _headers,
|
|
45
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
46
|
+
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,
|
|
47
|
+
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,
|
|
48
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
49
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
50
|
+
logging: this._options.logging,
|
|
51
|
+
});
|
|
52
|
+
if (_response.ok) {
|
|
53
|
+
return {
|
|
54
|
+
data: _response.body,
|
|
55
|
+
rawResponse: _response.rawResponse,
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
if (_response.error.reason === "status-code") {
|
|
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
|
+
}
|
|
69
|
+
}
|
|
70
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/business/allergens");
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./ListAllergensResponse.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./ListAllergensResponse.mjs";
|
|
@@ -81,6 +81,19 @@ export declare class DiscoveryClient {
|
|
|
81
81
|
*/
|
|
82
82
|
certifications(requestOptions?: DiscoveryClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.customer.CertificationsDiscoveryResponse>;
|
|
83
83
|
private __certifications;
|
|
84
|
+
/**
|
|
85
|
+
* Retrieve a list of all allergens, ordered alphabetically, for use in
|
|
86
|
+
* filters, labels, and other customer-facing display.
|
|
87
|
+
*
|
|
88
|
+
* @param {DiscoveryClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
89
|
+
*
|
|
90
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
91
|
+
*
|
|
92
|
+
* @example
|
|
93
|
+
* await client.customer.discovery.allergens()
|
|
94
|
+
*/
|
|
95
|
+
allergens(requestOptions?: DiscoveryClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.customer.AllergensDiscoveryResponse>;
|
|
96
|
+
private __allergens;
|
|
84
97
|
/**
|
|
85
98
|
* Retrieve businesses for a specific category with pagination support.
|
|
86
99
|
* Results are optimized for list display.
|
|
@@ -289,6 +289,57 @@ export class DiscoveryClient {
|
|
|
289
289
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/customer/discovery/certifications");
|
|
290
290
|
});
|
|
291
291
|
}
|
|
292
|
+
/**
|
|
293
|
+
* Retrieve a list of all allergens, ordered alphabetically, for use in
|
|
294
|
+
* filters, labels, and other customer-facing display.
|
|
295
|
+
*
|
|
296
|
+
* @param {DiscoveryClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
297
|
+
*
|
|
298
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
299
|
+
*
|
|
300
|
+
* @example
|
|
301
|
+
* await client.customer.discovery.allergens()
|
|
302
|
+
*/
|
|
303
|
+
allergens(requestOptions) {
|
|
304
|
+
return core.HttpResponsePromise.fromPromise(this.__allergens(requestOptions));
|
|
305
|
+
}
|
|
306
|
+
__allergens(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 = 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/allergens"),
|
|
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 handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/customer/discovery/allergens");
|
|
341
|
+
});
|
|
342
|
+
}
|
|
292
343
|
/**
|
|
293
344
|
* Retrieve businesses for a specific category with pagination support.
|
|
294
345
|
* Results are optimized for list display.
|
|
@@ -20,6 +20,7 @@ export * from "./BardProductSetValues.mjs";
|
|
|
20
20
|
export * from "./BardSetNode.mjs";
|
|
21
21
|
export * from "./BardSetValues.mjs";
|
|
22
22
|
export * from "./BardTextNode.mjs";
|
|
23
|
+
export * from "./BusinessAllergen.mjs";
|
|
23
24
|
export * from "./BusinessBulletin.mjs";
|
|
24
25
|
export * from "./BusinessBulletinComment.mjs";
|
|
25
26
|
export * from "./BusinessBulletinCommentReply.mjs";
|
|
@@ -58,6 +59,7 @@ export * from "./CustomerBulletinResponse.mjs";
|
|
|
58
59
|
export * from "./CustomerBusinessProfile.mjs";
|
|
59
60
|
export * from "./CustomerComment.mjs";
|
|
60
61
|
export * from "./CustomerCommentResponse.mjs";
|
|
62
|
+
export * from "./CustomerDiscoveryAllergen.mjs";
|
|
61
63
|
export * from "./CustomerEvent.mjs";
|
|
62
64
|
export * from "./CustomerEventDetail.mjs";
|
|
63
65
|
export * from "./CustomerEventResponse.mjs";
|
|
@@ -20,6 +20,7 @@ export * from "./BardProductSetValues.mjs";
|
|
|
20
20
|
export * from "./BardSetNode.mjs";
|
|
21
21
|
export * from "./BardSetValues.mjs";
|
|
22
22
|
export * from "./BardTextNode.mjs";
|
|
23
|
+
export * from "./BusinessAllergen.mjs";
|
|
23
24
|
export * from "./BusinessBulletin.mjs";
|
|
24
25
|
export * from "./BusinessBulletinComment.mjs";
|
|
25
26
|
export * from "./BusinessBulletinCommentReply.mjs";
|
|
@@ -58,6 +59,7 @@ export * from "./CustomerBulletinResponse.mjs";
|
|
|
58
59
|
export * from "./CustomerBusinessProfile.mjs";
|
|
59
60
|
export * from "./CustomerComment.mjs";
|
|
60
61
|
export * from "./CustomerCommentResponse.mjs";
|
|
62
|
+
export * from "./CustomerDiscoveryAllergen.mjs";
|
|
61
63
|
export * from "./CustomerEvent.mjs";
|
|
62
64
|
export * from "./CustomerEventDetail.mjs";
|
|
63
65
|
export * from "./CustomerEventResponse.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.30";
|
package/dist/esm/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "0.0.
|
|
1
|
+
export const SDK_VERSION = "0.0.30";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@51eat/sdk",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.30",
|
|
4
4
|
"private": false,
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -231,6 +231,17 @@
|
|
|
231
231
|
},
|
|
232
232
|
"default": "./dist/cjs/api/resources/business/resources/categories/exports.js"
|
|
233
233
|
},
|
|
234
|
+
"./business/allergens": {
|
|
235
|
+
"import": {
|
|
236
|
+
"types": "./dist/esm/api/resources/business/resources/allergens/exports.d.mts",
|
|
237
|
+
"default": "./dist/esm/api/resources/business/resources/allergens/exports.mjs"
|
|
238
|
+
},
|
|
239
|
+
"require": {
|
|
240
|
+
"types": "./dist/cjs/api/resources/business/resources/allergens/exports.d.ts",
|
|
241
|
+
"default": "./dist/cjs/api/resources/business/resources/allergens/exports.js"
|
|
242
|
+
},
|
|
243
|
+
"default": "./dist/cjs/api/resources/business/resources/allergens/exports.js"
|
|
244
|
+
},
|
|
234
245
|
"./business/auth/tokens": {
|
|
235
246
|
"import": {
|
|
236
247
|
"types": "./dist/esm/api/resources/business/resources/auth/resources/tokens/exports.d.mts",
|
package/reference.md
CHANGED
|
@@ -3705,6 +3705,63 @@ await client.business.categories.list();
|
|
|
3705
3705
|
</dl>
|
|
3706
3706
|
|
|
3707
3707
|
|
|
3708
|
+
</dd>
|
|
3709
|
+
</dl>
|
|
3710
|
+
</details>
|
|
3711
|
+
|
|
3712
|
+
## Business Allergens
|
|
3713
|
+
<details><summary><code>client.business.allergens.<a href="/src/api/resources/business/resources/allergens/client/Client.ts">list</a>() -> FiveOneEat.ListAllergensResponse</code></summary>
|
|
3714
|
+
<dl>
|
|
3715
|
+
<dd>
|
|
3716
|
+
|
|
3717
|
+
#### 📝 Description
|
|
3718
|
+
|
|
3719
|
+
<dl>
|
|
3720
|
+
<dd>
|
|
3721
|
+
|
|
3722
|
+
<dl>
|
|
3723
|
+
<dd>
|
|
3724
|
+
|
|
3725
|
+
Retrieve a list of all allergens, ordered alphabetically. Use these UUIDs
|
|
3726
|
+
in the `allergens` array when creating or updating a menu item.
|
|
3727
|
+
</dd>
|
|
3728
|
+
</dl>
|
|
3729
|
+
</dd>
|
|
3730
|
+
</dl>
|
|
3731
|
+
|
|
3732
|
+
#### 🔌 Usage
|
|
3733
|
+
|
|
3734
|
+
<dl>
|
|
3735
|
+
<dd>
|
|
3736
|
+
|
|
3737
|
+
<dl>
|
|
3738
|
+
<dd>
|
|
3739
|
+
|
|
3740
|
+
```typescript
|
|
3741
|
+
await client.business.allergens.list();
|
|
3742
|
+
|
|
3743
|
+
```
|
|
3744
|
+
</dd>
|
|
3745
|
+
</dl>
|
|
3746
|
+
</dd>
|
|
3747
|
+
</dl>
|
|
3748
|
+
|
|
3749
|
+
#### ⚙️ Parameters
|
|
3750
|
+
|
|
3751
|
+
<dl>
|
|
3752
|
+
<dd>
|
|
3753
|
+
|
|
3754
|
+
<dl>
|
|
3755
|
+
<dd>
|
|
3756
|
+
|
|
3757
|
+
**requestOptions:** `AllergensClient.RequestOptions`
|
|
3758
|
+
|
|
3759
|
+
</dd>
|
|
3760
|
+
</dl>
|
|
3761
|
+
</dd>
|
|
3762
|
+
</dl>
|
|
3763
|
+
|
|
3764
|
+
|
|
3708
3765
|
</dd>
|
|
3709
3766
|
</dl>
|
|
3710
3767
|
</details>
|
|
@@ -6957,6 +7014,62 @@ await client.customer.discovery.certifications();
|
|
|
6957
7014
|
</dl>
|
|
6958
7015
|
|
|
6959
7016
|
|
|
7017
|
+
</dd>
|
|
7018
|
+
</dl>
|
|
7019
|
+
</details>
|
|
7020
|
+
|
|
7021
|
+
<details><summary><code>client.customer.discovery.<a href="/src/api/resources/customer/resources/discovery/client/Client.ts">allergens</a>() -> FiveOneEat.AllergensDiscoveryResponse</code></summary>
|
|
7022
|
+
<dl>
|
|
7023
|
+
<dd>
|
|
7024
|
+
|
|
7025
|
+
#### 📝 Description
|
|
7026
|
+
|
|
7027
|
+
<dl>
|
|
7028
|
+
<dd>
|
|
7029
|
+
|
|
7030
|
+
<dl>
|
|
7031
|
+
<dd>
|
|
7032
|
+
|
|
7033
|
+
Retrieve a list of all allergens, ordered alphabetically, for use in
|
|
7034
|
+
filters, labels, and other customer-facing display.
|
|
7035
|
+
</dd>
|
|
7036
|
+
</dl>
|
|
7037
|
+
</dd>
|
|
7038
|
+
</dl>
|
|
7039
|
+
|
|
7040
|
+
#### 🔌 Usage
|
|
7041
|
+
|
|
7042
|
+
<dl>
|
|
7043
|
+
<dd>
|
|
7044
|
+
|
|
7045
|
+
<dl>
|
|
7046
|
+
<dd>
|
|
7047
|
+
|
|
7048
|
+
```typescript
|
|
7049
|
+
await client.customer.discovery.allergens();
|
|
7050
|
+
|
|
7051
|
+
```
|
|
7052
|
+
</dd>
|
|
7053
|
+
</dl>
|
|
7054
|
+
</dd>
|
|
7055
|
+
</dl>
|
|
7056
|
+
|
|
7057
|
+
#### ⚙️ Parameters
|
|
7058
|
+
|
|
7059
|
+
<dl>
|
|
7060
|
+
<dd>
|
|
7061
|
+
|
|
7062
|
+
<dl>
|
|
7063
|
+
<dd>
|
|
7064
|
+
|
|
7065
|
+
**requestOptions:** `DiscoveryClient.RequestOptions`
|
|
7066
|
+
|
|
7067
|
+
</dd>
|
|
7068
|
+
</dl>
|
|
7069
|
+
</dd>
|
|
7070
|
+
</dl>
|
|
7071
|
+
|
|
7072
|
+
|
|
6960
7073
|
</dd>
|
|
6961
7074
|
</dl>
|
|
6962
7075
|
</details>
|