@51eat/sdk 0.0.31 → 0.0.33
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/resources/auth/client/Client.d.ts +35 -0
- package/dist/cjs/api/resources/business/resources/auth/client/Client.js +115 -0
- package/dist/cjs/api/resources/business/resources/auth/client/requests/ForgotPasswordRequest.d.ts +9 -0
- package/dist/cjs/api/resources/business/resources/auth/client/requests/ForgotPasswordRequest.js +3 -0
- package/dist/cjs/api/resources/business/resources/auth/client/requests/ResetPasswordRequest.d.ts +15 -0
- package/dist/cjs/api/resources/business/resources/auth/client/requests/ResetPasswordRequest.js +3 -0
- package/dist/cjs/api/resources/business/resources/auth/client/requests/index.d.ts +2 -0
- package/dist/cjs/api/resources/business/resources/auth/types/ForgotPasswordAuthResponse.d.ts +9 -0
- package/dist/cjs/api/resources/business/resources/auth/types/ForgotPasswordAuthResponse.js +10 -0
- package/dist/cjs/api/resources/business/resources/auth/types/ResetPasswordAuthResponse.d.ts +9 -0
- package/dist/cjs/api/resources/business/resources/auth/types/ResetPasswordAuthResponse.js +10 -0
- package/dist/cjs/api/resources/business/resources/auth/types/index.d.ts +2 -0
- package/dist/cjs/api/resources/business/resources/auth/types/index.js +2 -0
- package/dist/cjs/api/resources/customer/resources/auth/client/Client.d.ts +78 -0
- package/dist/cjs/api/resources/customer/resources/auth/client/Client.js +282 -0
- package/dist/cjs/api/resources/customer/resources/auth/client/requests/AppHttpRequestsApiV1CustomerAuthForgotPasswordRequest.d.ts +9 -0
- package/dist/cjs/api/resources/customer/resources/auth/client/requests/AppHttpRequestsApiV1CustomerAuthForgotPasswordRequest.js +3 -0
- package/dist/cjs/api/resources/customer/resources/auth/client/requests/AppHttpRequestsApiV1CustomerAuthResetPasswordRequest.d.ts +15 -0
- package/dist/cjs/api/resources/customer/resources/auth/client/requests/AppHttpRequestsApiV1CustomerAuthResetPasswordRequest.js +3 -0
- package/dist/cjs/api/resources/customer/resources/auth/client/requests/UpdateUserRequest.d.ts +11 -0
- package/dist/cjs/api/resources/customer/resources/auth/client/requests/UpdateUserRequest.js +3 -0
- package/dist/cjs/api/resources/customer/resources/auth/client/requests/UploadAvatarRequest.d.ts +9 -0
- package/dist/cjs/api/resources/customer/resources/auth/client/requests/UploadAvatarRequest.js +3 -0
- package/dist/cjs/api/resources/customer/resources/auth/client/requests/index.d.ts +4 -0
- package/dist/cjs/api/resources/customer/resources/auth/types/DeleteAvatarAuthResponse.d.ts +4 -0
- package/dist/cjs/api/resources/customer/resources/auth/types/DeleteAvatarAuthResponse.js +3 -0
- package/dist/cjs/api/resources/customer/resources/auth/types/ForgotPasswordAuthResponse.d.ts +9 -0
- package/dist/cjs/api/resources/customer/resources/auth/types/ForgotPasswordAuthResponse.js +10 -0
- package/dist/cjs/api/resources/customer/resources/auth/types/ResetPasswordAuthResponse.d.ts +9 -0
- package/dist/cjs/api/resources/customer/resources/auth/types/ResetPasswordAuthResponse.js +10 -0
- package/dist/cjs/api/resources/customer/resources/auth/types/UpdateProfileAuthResponse.d.ts +4 -0
- package/dist/cjs/api/resources/customer/resources/auth/types/UpdateProfileAuthResponse.js +3 -0
- package/dist/cjs/api/resources/customer/resources/auth/types/UploadAvatarAuthResponse.d.ts +4 -0
- package/dist/cjs/api/resources/customer/resources/auth/types/UploadAvatarAuthResponse.js +3 -0
- package/dist/cjs/api/resources/customer/resources/auth/types/index.d.ts +5 -0
- package/dist/cjs/api/resources/customer/resources/auth/types/index.js +5 -0
- package/dist/cjs/api/resources/customer/resources/businesses/resources/bulletins/resources/comments/client/Client.d.ts +39 -0
- package/dist/cjs/api/resources/customer/resources/businesses/resources/bulletins/resources/comments/client/Client.js +137 -0
- package/dist/cjs/api/resources/customer/resources/businesses/resources/bulletins/resources/comments/client/requests/ListRepliesCommentsRequest.d.ts +20 -0
- package/dist/cjs/api/resources/customer/resources/businesses/resources/bulletins/resources/comments/client/requests/ListRepliesCommentsRequest.js +3 -0
- package/dist/cjs/api/resources/customer/resources/businesses/resources/bulletins/resources/comments/client/requests/StoreBulletinCommentReplyRequest.d.ts +18 -0
- package/dist/cjs/api/resources/customer/resources/businesses/resources/bulletins/resources/comments/client/requests/StoreBulletinCommentReplyRequest.js +3 -0
- package/dist/cjs/api/resources/customer/resources/businesses/resources/bulletins/resources/comments/client/requests/index.d.ts +2 -0
- package/dist/cjs/api/resources/customer/resources/businesses/resources/bulletins/resources/comments/types/ListRepliesCommentsResponse.d.ts +4 -0
- package/dist/cjs/api/resources/customer/resources/businesses/resources/bulletins/resources/comments/types/ListRepliesCommentsResponse.js +3 -0
- package/dist/cjs/api/resources/customer/resources/businesses/resources/bulletins/resources/comments/types/ReplyCommentsResponse.d.ts +4 -0
- package/dist/cjs/api/resources/customer/resources/businesses/resources/bulletins/resources/comments/types/ReplyCommentsResponse.js +3 -0
- package/dist/cjs/api/resources/customer/resources/businesses/resources/bulletins/resources/comments/types/index.d.ts +2 -0
- package/dist/cjs/api/resources/customer/resources/businesses/resources/bulletins/resources/comments/types/index.js +2 -0
- package/dist/cjs/api/resources/customer/resources/discovery/client/Client.d.ts +2 -1
- package/dist/cjs/api/resources/customer/resources/discovery/client/Client.js +15 -5
- package/dist/cjs/api/resources/customer/resources/discovery/client/requests/CategoriesDiscoveryRequest.d.ts +8 -0
- package/dist/cjs/api/resources/customer/resources/discovery/client/requests/CategoriesDiscoveryRequest.js +3 -0
- package/dist/cjs/api/resources/customer/resources/discovery/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/types/CustomerReplyResponse.d.ts +5 -0
- package/dist/cjs/api/types/CustomerReplyResponse.js +3 -0
- package/dist/cjs/api/types/CustomerUser.d.ts +1 -0
- package/dist/cjs/api/types/index.d.ts +1 -0
- package/dist/cjs/api/types/index.js +1 -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/resources/auth/client/Client.d.mts +35 -0
- package/dist/esm/api/resources/business/resources/auth/client/Client.mjs +115 -0
- package/dist/esm/api/resources/business/resources/auth/client/requests/ForgotPasswordRequest.d.mts +9 -0
- package/dist/esm/api/resources/business/resources/auth/client/requests/ForgotPasswordRequest.mjs +2 -0
- package/dist/esm/api/resources/business/resources/auth/client/requests/ResetPasswordRequest.d.mts +15 -0
- package/dist/esm/api/resources/business/resources/auth/client/requests/ResetPasswordRequest.mjs +2 -0
- package/dist/esm/api/resources/business/resources/auth/client/requests/index.d.mts +2 -0
- package/dist/esm/api/resources/business/resources/auth/types/ForgotPasswordAuthResponse.d.mts +9 -0
- package/dist/esm/api/resources/business/resources/auth/types/ForgotPasswordAuthResponse.mjs +7 -0
- package/dist/esm/api/resources/business/resources/auth/types/ResetPasswordAuthResponse.d.mts +9 -0
- package/dist/esm/api/resources/business/resources/auth/types/ResetPasswordAuthResponse.mjs +7 -0
- package/dist/esm/api/resources/business/resources/auth/types/index.d.mts +2 -0
- package/dist/esm/api/resources/business/resources/auth/types/index.mjs +2 -0
- package/dist/esm/api/resources/customer/resources/auth/client/Client.d.mts +78 -0
- package/dist/esm/api/resources/customer/resources/auth/client/Client.mjs +282 -0
- package/dist/esm/api/resources/customer/resources/auth/client/requests/AppHttpRequestsApiV1CustomerAuthForgotPasswordRequest.d.mts +9 -0
- package/dist/esm/api/resources/customer/resources/auth/client/requests/AppHttpRequestsApiV1CustomerAuthForgotPasswordRequest.mjs +2 -0
- package/dist/esm/api/resources/customer/resources/auth/client/requests/AppHttpRequestsApiV1CustomerAuthResetPasswordRequest.d.mts +15 -0
- package/dist/esm/api/resources/customer/resources/auth/client/requests/AppHttpRequestsApiV1CustomerAuthResetPasswordRequest.mjs +2 -0
- package/dist/esm/api/resources/customer/resources/auth/client/requests/UpdateUserRequest.d.mts +11 -0
- package/dist/esm/api/resources/customer/resources/auth/client/requests/UpdateUserRequest.mjs +2 -0
- package/dist/esm/api/resources/customer/resources/auth/client/requests/UploadAvatarRequest.d.mts +9 -0
- package/dist/esm/api/resources/customer/resources/auth/client/requests/UploadAvatarRequest.mjs +2 -0
- package/dist/esm/api/resources/customer/resources/auth/client/requests/index.d.mts +4 -0
- package/dist/esm/api/resources/customer/resources/auth/types/DeleteAvatarAuthResponse.d.mts +4 -0
- package/dist/esm/api/resources/customer/resources/auth/types/DeleteAvatarAuthResponse.mjs +2 -0
- package/dist/esm/api/resources/customer/resources/auth/types/ForgotPasswordAuthResponse.d.mts +9 -0
- package/dist/esm/api/resources/customer/resources/auth/types/ForgotPasswordAuthResponse.mjs +7 -0
- package/dist/esm/api/resources/customer/resources/auth/types/ResetPasswordAuthResponse.d.mts +9 -0
- package/dist/esm/api/resources/customer/resources/auth/types/ResetPasswordAuthResponse.mjs +7 -0
- package/dist/esm/api/resources/customer/resources/auth/types/UpdateProfileAuthResponse.d.mts +4 -0
- package/dist/esm/api/resources/customer/resources/auth/types/UpdateProfileAuthResponse.mjs +2 -0
- package/dist/esm/api/resources/customer/resources/auth/types/UploadAvatarAuthResponse.d.mts +4 -0
- package/dist/esm/api/resources/customer/resources/auth/types/UploadAvatarAuthResponse.mjs +2 -0
- package/dist/esm/api/resources/customer/resources/auth/types/index.d.mts +5 -0
- package/dist/esm/api/resources/customer/resources/auth/types/index.mjs +5 -0
- package/dist/esm/api/resources/customer/resources/businesses/resources/bulletins/resources/comments/client/Client.d.mts +39 -0
- package/dist/esm/api/resources/customer/resources/businesses/resources/bulletins/resources/comments/client/Client.mjs +137 -0
- package/dist/esm/api/resources/customer/resources/businesses/resources/bulletins/resources/comments/client/requests/ListRepliesCommentsRequest.d.mts +20 -0
- package/dist/esm/api/resources/customer/resources/businesses/resources/bulletins/resources/comments/client/requests/ListRepliesCommentsRequest.mjs +2 -0
- package/dist/esm/api/resources/customer/resources/businesses/resources/bulletins/resources/comments/client/requests/StoreBulletinCommentReplyRequest.d.mts +18 -0
- package/dist/esm/api/resources/customer/resources/businesses/resources/bulletins/resources/comments/client/requests/StoreBulletinCommentReplyRequest.mjs +2 -0
- package/dist/esm/api/resources/customer/resources/businesses/resources/bulletins/resources/comments/client/requests/index.d.mts +2 -0
- package/dist/esm/api/resources/customer/resources/businesses/resources/bulletins/resources/comments/types/ListRepliesCommentsResponse.d.mts +4 -0
- package/dist/esm/api/resources/customer/resources/businesses/resources/bulletins/resources/comments/types/ListRepliesCommentsResponse.mjs +2 -0
- package/dist/esm/api/resources/customer/resources/businesses/resources/bulletins/resources/comments/types/ReplyCommentsResponse.d.mts +4 -0
- package/dist/esm/api/resources/customer/resources/businesses/resources/bulletins/resources/comments/types/ReplyCommentsResponse.mjs +2 -0
- package/dist/esm/api/resources/customer/resources/businesses/resources/bulletins/resources/comments/types/index.d.mts +2 -0
- package/dist/esm/api/resources/customer/resources/businesses/resources/bulletins/resources/comments/types/index.mjs +2 -0
- package/dist/esm/api/resources/customer/resources/discovery/client/Client.d.mts +2 -1
- package/dist/esm/api/resources/customer/resources/discovery/client/Client.mjs +15 -5
- package/dist/esm/api/resources/customer/resources/discovery/client/requests/CategoriesDiscoveryRequest.d.mts +8 -0
- package/dist/esm/api/resources/customer/resources/discovery/client/requests/CategoriesDiscoveryRequest.mjs +2 -0
- package/dist/esm/api/resources/customer/resources/discovery/client/requests/index.d.mts +1 -0
- package/dist/esm/api/types/CustomerReplyResponse.d.mts +5 -0
- package/dist/esm/api/types/CustomerReplyResponse.mjs +2 -0
- package/dist/esm/api/types/CustomerUser.d.mts +1 -0
- package/dist/esm/api/types/index.d.mts +1 -0
- package/dist/esm/api/types/index.mjs +1 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +683 -86
|
@@ -165,4 +165,141 @@ export class CommentsClient {
|
|
|
165
165
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/customer/businesses/{handle}/bulletins/{bulletin}/comments");
|
|
166
166
|
});
|
|
167
167
|
}
|
|
168
|
+
/**
|
|
169
|
+
* Retrieve paginated replies for a top-level comment on a published bulletin.
|
|
170
|
+
*
|
|
171
|
+
* @param {FiveOneEat.customer.businesses.bulletins.ListRepliesCommentsRequest} request
|
|
172
|
+
* @param {CommentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
173
|
+
*
|
|
174
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
175
|
+
* @throws {@link FiveOneEat.NotFoundError}
|
|
176
|
+
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
177
|
+
*
|
|
178
|
+
* @example
|
|
179
|
+
* await client.customer.businesses.bulletins.comments.listReplies({
|
|
180
|
+
* handle: "katzs-deli",
|
|
181
|
+
* bulletin: "01950e7d-1234-7000-abcd-ef0123456789",
|
|
182
|
+
* comment: "01950e7d-5678-7000-abcd-ef0123456789"
|
|
183
|
+
* })
|
|
184
|
+
*/
|
|
185
|
+
listReplies(request, requestOptions) {
|
|
186
|
+
return core.HttpResponsePromise.fromPromise(this.__listReplies(request, requestOptions));
|
|
187
|
+
}
|
|
188
|
+
__listReplies(request, requestOptions) {
|
|
189
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
190
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
191
|
+
const { handle, bulletin, comment, page, per_page: perPage } = request;
|
|
192
|
+
const _queryParams = {
|
|
193
|
+
page,
|
|
194
|
+
per_page: perPage,
|
|
195
|
+
};
|
|
196
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
197
|
+
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);
|
|
198
|
+
const _response = yield core.fetcher({
|
|
199
|
+
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/businesses/${core.url.encodePathParam(handle)}/bulletins/${core.url.encodePathParam(bulletin)}/comments/${core.url.encodePathParam(comment)}/replies`),
|
|
200
|
+
method: "GET",
|
|
201
|
+
headers: _headers,
|
|
202
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
203
|
+
queryString: core.url
|
|
204
|
+
.queryBuilder()
|
|
205
|
+
.addMany(_queryParams)
|
|
206
|
+
.mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
|
|
207
|
+
.build(),
|
|
208
|
+
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,
|
|
209
|
+
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,
|
|
210
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
211
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
212
|
+
logging: this._options.logging,
|
|
213
|
+
});
|
|
214
|
+
if (_response.ok) {
|
|
215
|
+
return {
|
|
216
|
+
data: _response.body,
|
|
217
|
+
rawResponse: _response.rawResponse,
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
if (_response.error.reason === "status-code") {
|
|
221
|
+
switch (_response.error.statusCode) {
|
|
222
|
+
case 401:
|
|
223
|
+
throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
224
|
+
case 404:
|
|
225
|
+
throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
|
|
226
|
+
case 422:
|
|
227
|
+
throw new FiveOneEat.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
228
|
+
default:
|
|
229
|
+
throw new errors.FiveOneEatError({
|
|
230
|
+
statusCode: _response.error.statusCode,
|
|
231
|
+
body: _response.error.body,
|
|
232
|
+
rawResponse: _response.rawResponse,
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/customer/businesses/{handle}/bulletins/{bulletin}/comments/{comment}/replies");
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
/**
|
|
240
|
+
* Post a reply to a top-level comment on a published bulletin. Requires authentication.
|
|
241
|
+
*
|
|
242
|
+
* @param {FiveOneEat.customer.businesses.bulletins.StoreBulletinCommentReplyRequest} request
|
|
243
|
+
* @param {CommentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
244
|
+
*
|
|
245
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
246
|
+
* @throws {@link FiveOneEat.NotFoundError}
|
|
247
|
+
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
248
|
+
*
|
|
249
|
+
* @example
|
|
250
|
+
* await client.customer.businesses.bulletins.comments.reply({
|
|
251
|
+
* handle: "katzs-deli",
|
|
252
|
+
* bulletin: "01950e7d-1234-7000-abcd-ef0123456789",
|
|
253
|
+
* comment: "01950e7d-5678-7000-abcd-ef0123456789",
|
|
254
|
+
* body: "body"
|
|
255
|
+
* })
|
|
256
|
+
*/
|
|
257
|
+
reply(request, requestOptions) {
|
|
258
|
+
return core.HttpResponsePromise.fromPromise(this.__reply(request, requestOptions));
|
|
259
|
+
}
|
|
260
|
+
__reply(request, requestOptions) {
|
|
261
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
262
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
263
|
+
const { handle, bulletin, comment } = request, _body = __rest(request, ["handle", "bulletin", "comment"]);
|
|
264
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
265
|
+
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);
|
|
266
|
+
const _response = yield core.fetcher({
|
|
267
|
+
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/businesses/${core.url.encodePathParam(handle)}/bulletins/${core.url.encodePathParam(bulletin)}/comments/${core.url.encodePathParam(comment)}/replies`),
|
|
268
|
+
method: "POST",
|
|
269
|
+
headers: _headers,
|
|
270
|
+
contentType: "application/json",
|
|
271
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
272
|
+
requestType: "json",
|
|
273
|
+
body: _body,
|
|
274
|
+
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,
|
|
275
|
+
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,
|
|
276
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
277
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
278
|
+
logging: this._options.logging,
|
|
279
|
+
});
|
|
280
|
+
if (_response.ok) {
|
|
281
|
+
return {
|
|
282
|
+
data: _response.body,
|
|
283
|
+
rawResponse: _response.rawResponse,
|
|
284
|
+
};
|
|
285
|
+
}
|
|
286
|
+
if (_response.error.reason === "status-code") {
|
|
287
|
+
switch (_response.error.statusCode) {
|
|
288
|
+
case 401:
|
|
289
|
+
throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
290
|
+
case 404:
|
|
291
|
+
throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
|
|
292
|
+
case 422:
|
|
293
|
+
throw new FiveOneEat.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
294
|
+
default:
|
|
295
|
+
throw new errors.FiveOneEatError({
|
|
296
|
+
statusCode: _response.error.statusCode,
|
|
297
|
+
body: _response.error.body,
|
|
298
|
+
rawResponse: _response.rawResponse,
|
|
299
|
+
});
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/customer/businesses/{handle}/bulletins/{bulletin}/comments/{comment}/replies");
|
|
303
|
+
});
|
|
304
|
+
}
|
|
168
305
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @example
|
|
3
|
+
* {
|
|
4
|
+
* handle: "katzs-deli",
|
|
5
|
+
* bulletin: "01950e7d-1234-7000-abcd-ef0123456789",
|
|
6
|
+
* comment: "01950e7d-5678-7000-abcd-ef0123456789"
|
|
7
|
+
* }
|
|
8
|
+
*/
|
|
9
|
+
export interface ListRepliesCommentsRequest {
|
|
10
|
+
/** The business handle */
|
|
11
|
+
handle: string;
|
|
12
|
+
/** The bulletin ID */
|
|
13
|
+
bulletin: string;
|
|
14
|
+
/** The comment ID */
|
|
15
|
+
comment: string;
|
|
16
|
+
/** Page number for pagination */
|
|
17
|
+
page?: number;
|
|
18
|
+
/** Number of replies per page */
|
|
19
|
+
per_page?: number;
|
|
20
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @example
|
|
3
|
+
* {
|
|
4
|
+
* handle: "katzs-deli",
|
|
5
|
+
* bulletin: "01950e7d-1234-7000-abcd-ef0123456789",
|
|
6
|
+
* comment: "01950e7d-5678-7000-abcd-ef0123456789",
|
|
7
|
+
* body: "body"
|
|
8
|
+
* }
|
|
9
|
+
*/
|
|
10
|
+
export interface StoreBulletinCommentReplyRequest {
|
|
11
|
+
/** The business handle */
|
|
12
|
+
handle: string;
|
|
13
|
+
/** The bulletin ID */
|
|
14
|
+
bulletin: string;
|
|
15
|
+
/** The comment ID */
|
|
16
|
+
comment: string;
|
|
17
|
+
body: string;
|
|
18
|
+
}
|
|
@@ -1,2 +1,4 @@
|
|
|
1
1
|
export type { AppHttpRequestsApiV1CustomerBusinessesStoreBulletinCommentRequest } from "./AppHttpRequestsApiV1CustomerBusinessesStoreBulletinCommentRequest.mjs";
|
|
2
2
|
export type { ListCommentsRequest } from "./ListCommentsRequest.mjs";
|
|
3
|
+
export type { ListRepliesCommentsRequest } from "./ListRepliesCommentsRequest.mjs";
|
|
4
|
+
export type { StoreBulletinCommentReplyRequest } from "./StoreBulletinCommentReplyRequest.mjs";
|
|
@@ -46,6 +46,7 @@ export declare class DiscoveryClient {
|
|
|
46
46
|
* Retrieve a list of all business categories with their business counts.
|
|
47
47
|
* This endpoint is used to populate category filters and navigation.
|
|
48
48
|
*
|
|
49
|
+
* @param {FiveOneEat.customer.CategoriesDiscoveryRequest} request
|
|
49
50
|
* @param {DiscoveryClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
50
51
|
*
|
|
51
52
|
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
@@ -53,7 +54,7 @@ export declare class DiscoveryClient {
|
|
|
53
54
|
* @example
|
|
54
55
|
* await client.customer.discovery.categories()
|
|
55
56
|
*/
|
|
56
|
-
categories(requestOptions?: DiscoveryClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.customer.CategoriesDiscoveryResponse>;
|
|
57
|
+
categories(request?: FiveOneEat.customer.CategoriesDiscoveryRequest, requestOptions?: DiscoveryClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.customer.CategoriesDiscoveryResponse>;
|
|
57
58
|
private __categories;
|
|
58
59
|
/**
|
|
59
60
|
* Retrieve a list of all cuisines, ordered alphabetically.
|
|
@@ -140,6 +140,7 @@ export class DiscoveryClient {
|
|
|
140
140
|
* Retrieve a list of all business categories with their business counts.
|
|
141
141
|
* This endpoint is used to populate category filters and navigation.
|
|
142
142
|
*
|
|
143
|
+
* @param {FiveOneEat.customer.CategoriesDiscoveryRequest} request
|
|
143
144
|
* @param {DiscoveryClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
144
145
|
*
|
|
145
146
|
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
@@ -147,19 +148,28 @@ export class DiscoveryClient {
|
|
|
147
148
|
* @example
|
|
148
149
|
* await client.customer.discovery.categories()
|
|
149
150
|
*/
|
|
150
|
-
categories(requestOptions) {
|
|
151
|
-
return core.HttpResponsePromise.fromPromise(this.__categories(requestOptions));
|
|
151
|
+
categories(request = {}, requestOptions) {
|
|
152
|
+
return core.HttpResponsePromise.fromPromise(this.__categories(request, requestOptions));
|
|
152
153
|
}
|
|
153
|
-
__categories(
|
|
154
|
-
return __awaiter(this,
|
|
154
|
+
__categories() {
|
|
155
|
+
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
155
156
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
157
|
+
const { with_businesses: withBusinesses } = request;
|
|
158
|
+
const _queryParams = {
|
|
159
|
+
with_businesses: withBusinesses,
|
|
160
|
+
};
|
|
156
161
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
157
162
|
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);
|
|
158
163
|
const _response = yield core.fetcher({
|
|
159
164
|
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/categories"),
|
|
160
165
|
method: "GET",
|
|
161
166
|
headers: _headers,
|
|
162
|
-
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
167
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
168
|
+
queryString: core.url
|
|
169
|
+
.queryBuilder()
|
|
170
|
+
.addMany(_queryParams)
|
|
171
|
+
.mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
|
|
172
|
+
.build(),
|
|
163
173
|
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,
|
|
164
174
|
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,
|
|
165
175
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -72,6 +72,7 @@ export * from "./CustomerMenuItem.mjs";
|
|
|
72
72
|
export * from "./CustomerMenuResponse.mjs";
|
|
73
73
|
export * from "./CustomerPhoto.mjs";
|
|
74
74
|
export * from "./CustomerPhotoResponse.mjs";
|
|
75
|
+
export * from "./CustomerReplyResponse.mjs";
|
|
75
76
|
export * from "./CustomerTemporaryLocation.mjs";
|
|
76
77
|
export * from "./CustomerToken.mjs";
|
|
77
78
|
export * from "./CustomerUser.mjs";
|
|
@@ -72,6 +72,7 @@ export * from "./CustomerMenuItem.mjs";
|
|
|
72
72
|
export * from "./CustomerMenuResponse.mjs";
|
|
73
73
|
export * from "./CustomerPhoto.mjs";
|
|
74
74
|
export * from "./CustomerPhotoResponse.mjs";
|
|
75
|
+
export * from "./CustomerReplyResponse.mjs";
|
|
75
76
|
export * from "./CustomerTemporaryLocation.mjs";
|
|
76
77
|
export * from "./CustomerToken.mjs";
|
|
77
78
|
export * from "./CustomerUser.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.33";
|
package/dist/esm/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "0.0.
|
|
1
|
+
export const SDK_VERSION = "0.0.33";
|