@51eat/sdk 0.0.28 → 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/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/bulletins/client/Client.d.ts +3 -0
- package/dist/cjs/api/resources/business/resources/bulletins/client/Client.js +5 -0
- package/dist/cjs/api/resources/business/resources/bulletins/exports.d.ts +1 -0
- package/dist/cjs/api/resources/business/resources/bulletins/exports.js +1 -0
- package/dist/cjs/api/resources/business/resources/bulletins/index.d.ts +1 -0
- package/dist/cjs/api/resources/business/resources/bulletins/index.js +1 -0
- package/dist/cjs/api/resources/business/resources/bulletins/resources/comments/client/Client.d.ts +49 -0
- package/dist/cjs/api/resources/business/resources/bulletins/resources/comments/client/Client.js +208 -0
- package/dist/cjs/api/resources/business/resources/bulletins/resources/comments/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/business/resources/bulletins/resources/comments/client/index.js +17 -0
- package/dist/cjs/api/resources/business/resources/bulletins/resources/comments/client/requests/ListCommentsRequest.d.ts +12 -0
- package/dist/cjs/api/resources/business/resources/bulletins/resources/comments/client/requests/ListCommentsRequest.js +3 -0
- package/dist/cjs/api/resources/business/resources/bulletins/resources/comments/client/requests/StoreBulletinCommentRequest.d.ts +13 -0
- package/dist/cjs/api/resources/business/resources/bulletins/resources/comments/client/requests/StoreBulletinCommentRequest.js +3 -0
- package/dist/cjs/api/resources/business/resources/bulletins/resources/comments/client/requests/index.d.ts +2 -0
- package/dist/cjs/api/resources/business/resources/bulletins/resources/comments/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/business/resources/bulletins/resources/comments/exports.d.ts +2 -0
- package/dist/cjs/api/resources/business/resources/bulletins/resources/comments/exports.js +21 -0
- package/dist/cjs/api/resources/business/resources/bulletins/resources/comments/index.d.ts +2 -0
- package/dist/cjs/api/resources/business/resources/bulletins/resources/comments/index.js +18 -0
- package/dist/cjs/api/resources/business/resources/bulletins/resources/comments/types/CreateCommentsResponse.d.ts +4 -0
- package/dist/cjs/api/resources/business/resources/bulletins/resources/comments/types/CreateCommentsResponse.js +3 -0
- package/dist/cjs/api/resources/business/resources/bulletins/resources/comments/types/ListCommentsResponse.d.ts +4 -0
- package/dist/cjs/api/resources/business/resources/bulletins/resources/comments/types/ListCommentsResponse.js +3 -0
- package/dist/cjs/api/resources/business/resources/bulletins/resources/comments/types/index.d.ts +2 -0
- package/dist/cjs/api/resources/business/resources/bulletins/resources/comments/types/index.js +18 -0
- package/dist/cjs/api/resources/business/resources/bulletins/resources/index.d.ts +3 -0
- package/dist/cjs/api/resources/business/resources/bulletins/resources/index.js +42 -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/businesses/resources/bulletins/resources/comments/client/Client.d.ts +2 -2
- package/dist/cjs/api/resources/customer/resources/businesses/resources/bulletins/resources/comments/client/Client.js +1 -1
- package/dist/cjs/api/resources/customer/resources/businesses/resources/bulletins/resources/comments/client/requests/{StoreBulletinCommentRequest.d.ts → AppHttpRequestsApiV1CustomerBusinessesStoreBulletinCommentRequest.d.ts} +2 -1
- package/dist/cjs/api/resources/customer/resources/businesses/resources/bulletins/resources/comments/client/requests/AppHttpRequestsApiV1CustomerBusinessesStoreBulletinCommentRequest.js +3 -0
- package/dist/cjs/api/resources/customer/resources/businesses/resources/bulletins/resources/comments/client/requests/index.d.ts +1 -1
- 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/BusinessBulletinComment.d.ts +15 -0
- package/dist/cjs/api/types/BusinessBulletinComment.js +3 -0
- package/dist/cjs/api/types/BusinessBulletinCommentReply.d.ts +13 -0
- package/dist/cjs/api/types/BusinessBulletinCommentReply.js +3 -0
- package/dist/cjs/api/types/BusinessBulletinCommentResponse.d.ts +5 -0
- package/dist/cjs/api/types/BusinessBulletinCommentResponse.js +3 -0
- package/dist/cjs/api/types/CustomerBulletinCommentReply.d.ts +13 -0
- package/dist/cjs/api/types/CustomerBulletinCommentReply.js +3 -0
- package/dist/cjs/api/types/CustomerComment.d.ts +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 +6 -0
- package/dist/cjs/api/types/index.js +6 -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/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/bulletins/client/Client.d.mts +3 -0
- package/dist/esm/api/resources/business/resources/bulletins/client/Client.mjs +5 -0
- package/dist/esm/api/resources/business/resources/bulletins/exports.d.mts +1 -0
- package/dist/esm/api/resources/business/resources/bulletins/exports.mjs +1 -0
- package/dist/esm/api/resources/business/resources/bulletins/index.d.mts +1 -0
- package/dist/esm/api/resources/business/resources/bulletins/index.mjs +1 -0
- package/dist/esm/api/resources/business/resources/bulletins/resources/comments/client/Client.d.mts +49 -0
- package/dist/esm/api/resources/business/resources/bulletins/resources/comments/client/Client.mjs +171 -0
- package/dist/esm/api/resources/business/resources/bulletins/resources/comments/client/index.d.mts +1 -0
- package/dist/esm/api/resources/business/resources/bulletins/resources/comments/client/index.mjs +1 -0
- package/dist/esm/api/resources/business/resources/bulletins/resources/comments/client/requests/ListCommentsRequest.d.mts +12 -0
- package/dist/esm/api/resources/business/resources/bulletins/resources/comments/client/requests/ListCommentsRequest.mjs +2 -0
- package/dist/esm/api/resources/business/resources/bulletins/resources/comments/client/requests/StoreBulletinCommentRequest.d.mts +13 -0
- package/dist/esm/api/resources/business/resources/bulletins/resources/comments/client/requests/StoreBulletinCommentRequest.mjs +2 -0
- package/dist/esm/api/resources/business/resources/bulletins/resources/comments/client/requests/index.d.mts +2 -0
- package/dist/esm/api/resources/business/resources/bulletins/resources/comments/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/business/resources/bulletins/resources/comments/exports.d.mts +2 -0
- package/dist/esm/api/resources/business/resources/bulletins/resources/comments/exports.mjs +3 -0
- package/dist/esm/api/resources/business/resources/bulletins/resources/comments/index.d.mts +2 -0
- package/dist/esm/api/resources/business/resources/bulletins/resources/comments/index.mjs +2 -0
- package/dist/esm/api/resources/business/resources/bulletins/resources/comments/types/CreateCommentsResponse.d.mts +4 -0
- package/dist/esm/api/resources/business/resources/bulletins/resources/comments/types/CreateCommentsResponse.mjs +2 -0
- package/dist/esm/api/resources/business/resources/bulletins/resources/comments/types/ListCommentsResponse.d.mts +4 -0
- package/dist/esm/api/resources/business/resources/bulletins/resources/comments/types/ListCommentsResponse.mjs +2 -0
- package/dist/esm/api/resources/business/resources/bulletins/resources/comments/types/index.d.mts +2 -0
- package/dist/esm/api/resources/business/resources/bulletins/resources/comments/types/index.mjs +2 -0
- package/dist/esm/api/resources/business/resources/bulletins/resources/index.d.mts +3 -0
- package/dist/esm/api/resources/business/resources/bulletins/resources/index.mjs +3 -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/businesses/resources/bulletins/resources/comments/client/Client.d.mts +2 -2
- package/dist/esm/api/resources/customer/resources/businesses/resources/bulletins/resources/comments/client/Client.mjs +1 -1
- package/dist/esm/api/resources/customer/resources/businesses/resources/bulletins/resources/comments/client/requests/{StoreBulletinCommentRequest.d.mts → AppHttpRequestsApiV1CustomerBusinessesStoreBulletinCommentRequest.d.mts} +2 -1
- package/dist/esm/api/resources/customer/resources/businesses/resources/bulletins/resources/comments/client/requests/AppHttpRequestsApiV1CustomerBusinessesStoreBulletinCommentRequest.mjs +2 -0
- package/dist/esm/api/resources/customer/resources/businesses/resources/bulletins/resources/comments/client/requests/index.d.mts +1 -1
- 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/BusinessBulletinComment.d.mts +15 -0
- package/dist/esm/api/types/BusinessBulletinComment.mjs +2 -0
- package/dist/esm/api/types/BusinessBulletinCommentReply.d.mts +13 -0
- package/dist/esm/api/types/BusinessBulletinCommentReply.mjs +2 -0
- package/dist/esm/api/types/BusinessBulletinCommentResponse.d.mts +5 -0
- package/dist/esm/api/types/BusinessBulletinCommentResponse.mjs +2 -0
- package/dist/esm/api/types/CustomerBulletinCommentReply.d.mts +13 -0
- package/dist/esm/api/types/CustomerBulletinCommentReply.mjs +2 -0
- package/dist/esm/api/types/CustomerComment.d.mts +3 -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 +6 -0
- package/dist/esm/api/types/index.mjs +6 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +23 -1
- package/reference.md +233 -1
- /package/dist/cjs/api/resources/{customer/resources/businesses/resources/bulletins/resources/comments/client/requests/StoreBulletinCommentRequest.js → business/resources/allergens/types/ListAllergensResponse.js} +0 -0
- /package/dist/esm/api/resources/{customer/resources/businesses/resources/bulletins/resources/comments/client/requests/StoreBulletinCommentRequest.mjs → business/resources/allergens/types/ListAllergensResponse.mjs} +0 -0
package/dist/cjs/api/resources/business/resources/bulletins/resources/comments/client/Client.js
ADDED
|
@@ -0,0 +1,208 @@
|
|
|
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
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
46
|
+
var t = {};
|
|
47
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
48
|
+
t[p] = s[p];
|
|
49
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
50
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
51
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
52
|
+
t[p[i]] = s[p[i]];
|
|
53
|
+
}
|
|
54
|
+
return t;
|
|
55
|
+
};
|
|
56
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
57
|
+
exports.CommentsClient = void 0;
|
|
58
|
+
const BaseClient_js_1 = require("../../../../../../../../BaseClient.js");
|
|
59
|
+
const headers_js_1 = require("../../../../../../../../core/headers.js");
|
|
60
|
+
const core = __importStar(require("../../../../../../../../core/index.js"));
|
|
61
|
+
const environments = __importStar(require("../../../../../../../../environments.js"));
|
|
62
|
+
const handleNonStatusCodeError_js_1 = require("../../../../../../../../errors/handleNonStatusCodeError.js");
|
|
63
|
+
const errors = __importStar(require("../../../../../../../../errors/index.js"));
|
|
64
|
+
const FiveOneEat = __importStar(require("../../../../../../../index.js"));
|
|
65
|
+
class CommentsClient {
|
|
66
|
+
constructor(options = {}) {
|
|
67
|
+
this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* @param {FiveOneEat.business.bulletins.ListCommentsRequest} request
|
|
71
|
+
* @param {CommentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
72
|
+
*
|
|
73
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
74
|
+
* @throws {@link FiveOneEat.ForbiddenError}
|
|
75
|
+
* @throws {@link FiveOneEat.NotFoundError}
|
|
76
|
+
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
77
|
+
*
|
|
78
|
+
* @example
|
|
79
|
+
* await client.business.bulletins.comments.list({
|
|
80
|
+
* bulletin: "bulletin"
|
|
81
|
+
* })
|
|
82
|
+
*/
|
|
83
|
+
list(request, requestOptions) {
|
|
84
|
+
return core.HttpResponsePromise.fromPromise(this.__list(request, requestOptions));
|
|
85
|
+
}
|
|
86
|
+
__list(request, requestOptions) {
|
|
87
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
88
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
89
|
+
const { bulletin, page, per_page: perPage } = request;
|
|
90
|
+
const _queryParams = {
|
|
91
|
+
page,
|
|
92
|
+
per_page: perPage,
|
|
93
|
+
};
|
|
94
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
95
|
+
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);
|
|
96
|
+
const _response = yield core.fetcher({
|
|
97
|
+
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/bulletins/${core.url.encodePathParam(bulletin)}/comments`),
|
|
98
|
+
method: "GET",
|
|
99
|
+
headers: _headers,
|
|
100
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
101
|
+
queryString: core.url
|
|
102
|
+
.queryBuilder()
|
|
103
|
+
.addMany(_queryParams)
|
|
104
|
+
.mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
|
|
105
|
+
.build(),
|
|
106
|
+
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,
|
|
107
|
+
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,
|
|
108
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
109
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
110
|
+
logging: this._options.logging,
|
|
111
|
+
});
|
|
112
|
+
if (_response.ok) {
|
|
113
|
+
return {
|
|
114
|
+
data: _response.body,
|
|
115
|
+
rawResponse: _response.rawResponse,
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
if (_response.error.reason === "status-code") {
|
|
119
|
+
switch (_response.error.statusCode) {
|
|
120
|
+
case 401:
|
|
121
|
+
throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
122
|
+
case 403:
|
|
123
|
+
throw new FiveOneEat.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
124
|
+
case 404:
|
|
125
|
+
throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
|
|
126
|
+
case 422:
|
|
127
|
+
throw new FiveOneEat.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
128
|
+
default:
|
|
129
|
+
throw new errors.FiveOneEatError({
|
|
130
|
+
statusCode: _response.error.statusCode,
|
|
131
|
+
body: _response.error.body,
|
|
132
|
+
rawResponse: _response.rawResponse,
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/business/bulletins/{bulletin}/comments");
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Omit `parent_id` for a top-level comment. Set `parent_id` to a top-level
|
|
141
|
+
* comment's id to post a one-level reply (replies to replies are not allowed).
|
|
142
|
+
*
|
|
143
|
+
* @param {FiveOneEat.business.bulletins.StoreBulletinCommentRequest} request
|
|
144
|
+
* @param {CommentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
145
|
+
*
|
|
146
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
147
|
+
* @throws {@link FiveOneEat.ForbiddenError}
|
|
148
|
+
* @throws {@link FiveOneEat.NotFoundError}
|
|
149
|
+
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
150
|
+
*
|
|
151
|
+
* @example
|
|
152
|
+
* await client.business.bulletins.comments.create({
|
|
153
|
+
* bulletin: "bulletin",
|
|
154
|
+
* body: "body"
|
|
155
|
+
* })
|
|
156
|
+
*/
|
|
157
|
+
create(request, requestOptions) {
|
|
158
|
+
return core.HttpResponsePromise.fromPromise(this.__create(request, requestOptions));
|
|
159
|
+
}
|
|
160
|
+
__create(request, requestOptions) {
|
|
161
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
162
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
163
|
+
const { bulletin } = request, _body = __rest(request, ["bulletin"]);
|
|
164
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
165
|
+
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);
|
|
166
|
+
const _response = yield core.fetcher({
|
|
167
|
+
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/bulletins/${core.url.encodePathParam(bulletin)}/comments`),
|
|
168
|
+
method: "POST",
|
|
169
|
+
headers: _headers,
|
|
170
|
+
contentType: "application/json",
|
|
171
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
172
|
+
requestType: "json",
|
|
173
|
+
body: _body,
|
|
174
|
+
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,
|
|
175
|
+
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,
|
|
176
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
177
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
178
|
+
logging: this._options.logging,
|
|
179
|
+
});
|
|
180
|
+
if (_response.ok) {
|
|
181
|
+
return {
|
|
182
|
+
data: _response.body,
|
|
183
|
+
rawResponse: _response.rawResponse,
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
if (_response.error.reason === "status-code") {
|
|
187
|
+
switch (_response.error.statusCode) {
|
|
188
|
+
case 401:
|
|
189
|
+
throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
190
|
+
case 403:
|
|
191
|
+
throw new FiveOneEat.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
192
|
+
case 404:
|
|
193
|
+
throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
|
|
194
|
+
case 422:
|
|
195
|
+
throw new FiveOneEat.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
196
|
+
default:
|
|
197
|
+
throw new errors.FiveOneEatError({
|
|
198
|
+
statusCode: _response.error.statusCode,
|
|
199
|
+
body: _response.error.body,
|
|
200
|
+
rawResponse: _response.rawResponse,
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/business/bulletins/{bulletin}/comments");
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
exports.CommentsClient = CommentsClient;
|
package/dist/cjs/api/resources/business/resources/bulletins/resources/comments/client/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./requests/index.js";
|
package/dist/cjs/api/resources/business/resources/bulletins/resources/comments/client/index.js
ADDED
|
@@ -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("./requests/index.js"), exports);
|
|
@@ -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.CommentsClient = void 0;
|
|
19
|
+
var Client_js_1 = require("./client/Client.js");
|
|
20
|
+
Object.defineProperty(exports, "CommentsClient", { enumerable: true, get: function () { return Client_js_1.CommentsClient; } });
|
|
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,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("./CreateCommentsResponse.js"), exports);
|
|
18
|
+
__exportStar(require("./ListCommentsResponse.js"), exports);
|
|
@@ -0,0 +1,42 @@
|
|
|
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
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
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
22
|
+
var ownKeys = function(o) {
|
|
23
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
24
|
+
var ar = [];
|
|
25
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
26
|
+
return ar;
|
|
27
|
+
};
|
|
28
|
+
return ownKeys(o);
|
|
29
|
+
};
|
|
30
|
+
return function (mod) {
|
|
31
|
+
if (mod && mod.__esModule) return mod;
|
|
32
|
+
var result = {};
|
|
33
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
34
|
+
__setModuleDefault(result, mod);
|
|
35
|
+
return result;
|
|
36
|
+
};
|
|
37
|
+
})();
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.comments = void 0;
|
|
40
|
+
__exportStar(require("./comments/client/requests/index.js"), exports);
|
|
41
|
+
exports.comments = __importStar(require("./comments/index.js"));
|
|
42
|
+
__exportStar(require("./comments/types/index.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);
|
|
@@ -31,7 +31,7 @@ export declare class CommentsClient {
|
|
|
31
31
|
/**
|
|
32
32
|
* Post a comment on a business bulletin. Requires authentication.
|
|
33
33
|
*
|
|
34
|
-
* @param {FiveOneEat.customer.businesses.bulletins.
|
|
34
|
+
* @param {FiveOneEat.customer.businesses.bulletins.AppHttpRequestsApiV1CustomerBusinessesStoreBulletinCommentRequest} request
|
|
35
35
|
* @param {CommentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
36
36
|
*
|
|
37
37
|
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
@@ -45,6 +45,6 @@ export declare class CommentsClient {
|
|
|
45
45
|
* body: "body"
|
|
46
46
|
* })
|
|
47
47
|
*/
|
|
48
|
-
create(request: FiveOneEat.customer.businesses.bulletins.
|
|
48
|
+
create(request: FiveOneEat.customer.businesses.bulletins.AppHttpRequestsApiV1CustomerBusinessesStoreBulletinCommentRequest, requestOptions?: CommentsClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.customer.businesses.bulletins.CreateCommentsResponse>;
|
|
49
49
|
private __create;
|
|
50
50
|
}
|
|
@@ -139,7 +139,7 @@ class CommentsClient {
|
|
|
139
139
|
/**
|
|
140
140
|
* Post a comment on a business bulletin. Requires authentication.
|
|
141
141
|
*
|
|
142
|
-
* @param {FiveOneEat.customer.businesses.bulletins.
|
|
142
|
+
* @param {FiveOneEat.customer.businesses.bulletins.AppHttpRequestsApiV1CustomerBusinessesStoreBulletinCommentRequest} request
|
|
143
143
|
* @param {CommentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
144
144
|
*
|
|
145
145
|
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
@@ -6,10 +6,11 @@
|
|
|
6
6
|
* body: "body"
|
|
7
7
|
* }
|
|
8
8
|
*/
|
|
9
|
-
export interface
|
|
9
|
+
export interface AppHttpRequestsApiV1CustomerBusinessesStoreBulletinCommentRequest {
|
|
10
10
|
/** The business handle */
|
|
11
11
|
handle: string;
|
|
12
12
|
/** The bulletin ID */
|
|
13
13
|
bulletin: string;
|
|
14
14
|
body: string;
|
|
15
|
+
parent_id?: string | null;
|
|
15
16
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
+
export type { AppHttpRequestsApiV1CustomerBusinessesStoreBulletinCommentRequest } from "./AppHttpRequestsApiV1CustomerBusinessesStoreBulletinCommentRequest.js";
|
|
1
2
|
export type { ListCommentsRequest } from "./ListCommentsRequest.js";
|
|
2
|
-
export type { StoreBulletinCommentRequest } from "./StoreBulletinCommentRequest.js";
|
|
@@ -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);
|