@51eat/sdk 0.0.71 → 0.0.72
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/stands/client/requests/UpdateStandRequest.d.ts +7 -0
- package/dist/cjs/api/resources/customer/client/Client.d.ts +0 -1
- package/dist/cjs/api/resources/customer/client/Client.js +1 -5
- package/dist/cjs/api/resources/customer/resources/ads/client/Client.d.ts +2 -4
- package/dist/cjs/api/resources/customer/resources/ads/client/Client.js +3 -11
- package/dist/cjs/api/resources/customer/resources/businesses/client/Client.d.ts +27 -34
- package/dist/cjs/api/resources/customer/resources/businesses/client/Client.js +83 -111
- package/dist/cjs/api/resources/customer/resources/businesses/resources/bulletins/client/Client.d.ts +0 -1
- package/dist/cjs/api/resources/customer/resources/businesses/resources/bulletins/client/Client.js +1 -5
- package/dist/cjs/api/resources/customer/resources/businesses/resources/bulletins/resources/comments/client/Client.d.ts +0 -2
- package/dist/cjs/api/resources/customer/resources/businesses/resources/bulletins/resources/comments/client/Client.js +2 -10
- package/dist/cjs/api/resources/customer/resources/businesses/resources/events/client/Client.d.ts +0 -3
- package/dist/cjs/api/resources/customer/resources/businesses/resources/events/client/Client.js +7 -19
- package/dist/cjs/api/resources/customer/resources/cart/types/CreatePaymentIntentCartResponse.d.ts +4 -4
- package/dist/cjs/api/resources/customer/resources/discovery/client/Client.d.ts +2 -14
- package/dist/cjs/api/resources/customer/resources/discovery/client/Client.js +33 -81
- package/dist/cjs/api/resources/customer/resources/editorials/client/Client.d.ts +3 -7
- package/dist/cjs/api/resources/customer/resources/editorials/client/Client.js +13 -30
- package/dist/cjs/api/resources/customer/resources/events/client/Client.d.ts +0 -1
- package/dist/cjs/api/resources/customer/resources/events/client/Client.js +1 -5
- package/dist/cjs/api/resources/customer/resources/explore/client/Client.d.ts +2 -3
- package/dist/cjs/api/resources/customer/resources/explore/client/Client.js +2 -6
- package/dist/cjs/api/resources/customer/resources/shop/client/Client.d.ts +2 -5
- package/dist/cjs/api/resources/customer/resources/shop/client/Client.js +4 -16
- package/dist/cjs/api/resources/customer/resources/stands/client/Client.js +1 -2
- package/dist/cjs/api/resources/customer/resources/stands/types/CreatePaymentIntentStandsResponse.d.ts +4 -4
- package/dist/cjs/api/types/AppHttpResourcesApiV1BusinessCommerceProductResource.d.ts +1 -1
- package/dist/cjs/api/types/CartResource.d.ts +1 -1
- package/dist/cjs/api/types/InventoryLevelResource.d.ts +3 -3
- package/dist/cjs/api/types/OrderItemResource.d.ts +10 -0
- package/dist/cjs/api/types/OrderResource.d.ts +24 -9
- package/dist/cjs/api/types/PaginationResource.d.ts +4 -4
- package/dist/cjs/api/types/PriceListResource.d.ts +1 -1
- package/dist/cjs/api/types/PriceResource.d.ts +3 -3
- package/dist/cjs/api/types/ProductResource.d.ts +5 -6
- package/dist/cjs/api/types/Transaction.d.ts +6 -6
- package/dist/cjs/api/types/VariantResource.d.ts +3 -3
- package/dist/cjs/api/types/index.d.ts +1 -2
- package/dist/cjs/api/types/index.js +1 -2
- 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/stands/client/requests/UpdateStandRequest.d.mts +7 -0
- package/dist/esm/api/resources/customer/client/Client.d.mts +0 -1
- package/dist/esm/api/resources/customer/client/Client.mjs +1 -5
- package/dist/esm/api/resources/customer/resources/ads/client/Client.d.mts +2 -4
- package/dist/esm/api/resources/customer/resources/ads/client/Client.mjs +4 -12
- package/dist/esm/api/resources/customer/resources/businesses/client/Client.d.mts +27 -34
- package/dist/esm/api/resources/customer/resources/businesses/client/Client.mjs +83 -111
- package/dist/esm/api/resources/customer/resources/businesses/resources/bulletins/client/Client.d.mts +0 -1
- package/dist/esm/api/resources/customer/resources/businesses/resources/bulletins/client/Client.mjs +1 -5
- package/dist/esm/api/resources/customer/resources/businesses/resources/bulletins/resources/comments/client/Client.d.mts +0 -2
- package/dist/esm/api/resources/customer/resources/businesses/resources/bulletins/resources/comments/client/Client.mjs +2 -10
- package/dist/esm/api/resources/customer/resources/businesses/resources/events/client/Client.d.mts +0 -3
- package/dist/esm/api/resources/customer/resources/businesses/resources/events/client/Client.mjs +7 -19
- package/dist/esm/api/resources/customer/resources/cart/types/CreatePaymentIntentCartResponse.d.mts +4 -4
- package/dist/esm/api/resources/customer/resources/discovery/client/Client.d.mts +2 -14
- package/dist/esm/api/resources/customer/resources/discovery/client/Client.mjs +34 -82
- package/dist/esm/api/resources/customer/resources/editorials/client/Client.d.mts +3 -7
- package/dist/esm/api/resources/customer/resources/editorials/client/Client.mjs +14 -31
- package/dist/esm/api/resources/customer/resources/events/client/Client.d.mts +0 -1
- package/dist/esm/api/resources/customer/resources/events/client/Client.mjs +1 -5
- package/dist/esm/api/resources/customer/resources/explore/client/Client.d.mts +2 -3
- package/dist/esm/api/resources/customer/resources/explore/client/Client.mjs +3 -7
- package/dist/esm/api/resources/customer/resources/shop/client/Client.d.mts +2 -5
- package/dist/esm/api/resources/customer/resources/shop/client/Client.mjs +5 -17
- package/dist/esm/api/resources/customer/resources/stands/client/Client.mjs +1 -2
- package/dist/esm/api/resources/customer/resources/stands/types/CreatePaymentIntentStandsResponse.d.mts +4 -4
- package/dist/esm/api/types/AppHttpResourcesApiV1BusinessCommerceProductResource.d.mts +1 -1
- package/dist/esm/api/types/CartResource.d.mts +1 -1
- package/dist/esm/api/types/InventoryLevelResource.d.mts +3 -3
- package/dist/esm/api/types/OrderItemResource.d.mts +10 -0
- package/dist/esm/api/types/OrderResource.d.mts +24 -9
- package/dist/esm/api/types/PaginationResource.d.mts +4 -4
- package/dist/esm/api/types/PriceListResource.d.mts +1 -1
- package/dist/esm/api/types/PriceResource.d.mts +3 -3
- package/dist/esm/api/types/ProductResource.d.mts +5 -6
- package/dist/esm/api/types/Transaction.d.mts +6 -6
- package/dist/esm/api/types/VariantResource.d.mts +3 -3
- package/dist/esm/api/types/index.d.mts +1 -2
- package/dist/esm/api/types/index.mjs +1 -2
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +19 -19
- package/dist/cjs/api/types/ImageResource.d.ts +0 -6
- package/dist/cjs/api/types/ProductCategoryResource.d.ts +0 -8
- package/dist/cjs/api/types/ProductCategoryResource.js +0 -3
- package/dist/esm/api/types/ImageResource.d.mts +0 -6
- package/dist/esm/api/types/ProductCategoryResource.d.mts +0 -8
- package/dist/esm/api/types/ProductCategoryResource.mjs +0 -2
- /package/dist/cjs/api/types/{ImageResource.js → OrderItemResource.js} +0 -0
- /package/dist/esm/api/types/{ImageResource.mjs → OrderItemResource.mjs} +0 -0
|
@@ -22,8 +22,6 @@ export declare class BusinessesClient {
|
|
|
22
22
|
* @param {FiveOneEat.customer.ProfileBusinessesRequest} request
|
|
23
23
|
* @param {BusinessesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
24
24
|
*
|
|
25
|
-
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
26
|
-
*
|
|
27
25
|
* @example
|
|
28
26
|
* await client.customer.businesses.profile({
|
|
29
27
|
* business: "katzs-deli"
|
|
@@ -37,7 +35,6 @@ export declare class BusinessesClient {
|
|
|
37
35
|
* @param {FiveOneEat.customer.MenusBusinessesRequest} request
|
|
38
36
|
* @param {BusinessesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
39
37
|
*
|
|
40
|
-
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
41
38
|
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
42
39
|
*
|
|
43
40
|
* @example
|
|
@@ -53,7 +50,6 @@ export declare class BusinessesClient {
|
|
|
53
50
|
* @param {FiveOneEat.customer.PhotosBusinessesRequest} request
|
|
54
51
|
* @param {BusinessesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
55
52
|
*
|
|
56
|
-
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
57
53
|
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
58
54
|
*
|
|
59
55
|
* @example
|
|
@@ -64,68 +60,65 @@ export declare class BusinessesClient {
|
|
|
64
60
|
photos(request: FiveOneEat.customer.PhotosBusinessesRequest, requestOptions?: BusinessesClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.customer.PhotosBusinessesResponse>;
|
|
65
61
|
private __photos;
|
|
66
62
|
/**
|
|
67
|
-
*
|
|
63
|
+
* Retrieve active and upcoming temporary locations for a business.
|
|
68
64
|
*
|
|
69
|
-
* @param {FiveOneEat.customer.
|
|
65
|
+
* @param {FiveOneEat.customer.ListTemporaryLocationsBusinessesRequest} request
|
|
70
66
|
* @param {BusinessesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
71
67
|
*
|
|
72
|
-
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
73
|
-
* @throws {@link FiveOneEat.NotFoundError}
|
|
74
|
-
* @throws {@link FiveOneEat.ConflictError}
|
|
75
|
-
*
|
|
76
68
|
* @example
|
|
77
|
-
* await client.customer.businesses.
|
|
69
|
+
* await client.customer.businesses.listTemporaryLocations({
|
|
78
70
|
* business: "katzs-deli"
|
|
79
71
|
* })
|
|
80
72
|
*/
|
|
81
|
-
|
|
82
|
-
private
|
|
73
|
+
listTemporaryLocations(request: FiveOneEat.customer.ListTemporaryLocationsBusinessesRequest, requestOptions?: BusinessesClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.customer.ListTemporaryLocationsBusinessesResponse>;
|
|
74
|
+
private __listTemporaryLocations;
|
|
83
75
|
/**
|
|
84
|
-
*
|
|
76
|
+
* Returns available pickup timeslots for a business on a given date.
|
|
85
77
|
*
|
|
86
|
-
* @param {FiveOneEat.customer.
|
|
78
|
+
* @param {FiveOneEat.customer.GetPickupTimeslotsBusinessesRequest} request
|
|
87
79
|
* @param {BusinessesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
88
80
|
*
|
|
89
|
-
* @throws {@link FiveOneEat.
|
|
90
|
-
* @throws {@link FiveOneEat.NotFoundError}
|
|
81
|
+
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
91
82
|
*
|
|
92
83
|
* @example
|
|
93
|
-
* await client.customer.businesses.
|
|
94
|
-
*
|
|
84
|
+
* await client.customer.businesses.getPickupTimeslots({
|
|
85
|
+
* handle: "katzs-deli",
|
|
86
|
+
* date: "2023-01-15"
|
|
95
87
|
* })
|
|
96
88
|
*/
|
|
97
|
-
|
|
98
|
-
private
|
|
89
|
+
getPickupTimeslots(request: FiveOneEat.customer.GetPickupTimeslotsBusinessesRequest, requestOptions?: BusinessesClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.customer.GetPickupTimeslotsBusinessesResponse>;
|
|
90
|
+
private __getPickupTimeslots;
|
|
99
91
|
/**
|
|
100
|
-
*
|
|
92
|
+
* Add a business to the authenticated user's favorites.
|
|
101
93
|
*
|
|
102
|
-
* @param {FiveOneEat.customer.
|
|
94
|
+
* @param {FiveOneEat.customer.FavoriteBusinessesRequest} request
|
|
103
95
|
* @param {BusinessesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
104
96
|
*
|
|
105
97
|
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
98
|
+
* @throws {@link FiveOneEat.NotFoundError}
|
|
99
|
+
* @throws {@link FiveOneEat.ConflictError}
|
|
106
100
|
*
|
|
107
101
|
* @example
|
|
108
|
-
* await client.customer.businesses.
|
|
102
|
+
* await client.customer.businesses.favorite({
|
|
109
103
|
* business: "katzs-deli"
|
|
110
104
|
* })
|
|
111
105
|
*/
|
|
112
|
-
|
|
113
|
-
private
|
|
106
|
+
favorite(request: FiveOneEat.customer.FavoriteBusinessesRequest, requestOptions?: BusinessesClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.customer.FavoriteBusinessesResponse>;
|
|
107
|
+
private __favorite;
|
|
114
108
|
/**
|
|
115
|
-
*
|
|
109
|
+
* Remove a business from the authenticated user's favorites.
|
|
116
110
|
*
|
|
117
|
-
* @param {FiveOneEat.customer.
|
|
111
|
+
* @param {FiveOneEat.customer.UnfavoriteBusinessesRequest} request
|
|
118
112
|
* @param {BusinessesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
119
113
|
*
|
|
120
114
|
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
121
|
-
* @throws {@link FiveOneEat.
|
|
115
|
+
* @throws {@link FiveOneEat.NotFoundError}
|
|
122
116
|
*
|
|
123
117
|
* @example
|
|
124
|
-
* await client.customer.businesses.
|
|
125
|
-
*
|
|
126
|
-
* date: "2023-01-15"
|
|
118
|
+
* await client.customer.businesses.unfavorite({
|
|
119
|
+
* business: "katzs-deli"
|
|
127
120
|
* })
|
|
128
121
|
*/
|
|
129
|
-
|
|
130
|
-
private
|
|
122
|
+
unfavorite(request: FiveOneEat.customer.UnfavoriteBusinessesRequest, requestOptions?: BusinessesClient.RequestOptions): core.HttpResponsePromise<void>;
|
|
123
|
+
private __unfavorite;
|
|
131
124
|
}
|
|
@@ -35,8 +35,6 @@ export class BusinessesClient {
|
|
|
35
35
|
* @param {FiveOneEat.customer.ProfileBusinessesRequest} request
|
|
36
36
|
* @param {BusinessesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
37
37
|
*
|
|
38
|
-
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
39
|
-
*
|
|
40
38
|
* @example
|
|
41
39
|
* await client.customer.businesses.profile({
|
|
42
40
|
* business: "katzs-deli"
|
|
@@ -49,8 +47,7 @@ export class BusinessesClient {
|
|
|
49
47
|
return __awaiter(this, void 0, void 0, function* () {
|
|
50
48
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
51
49
|
const { business } = request;
|
|
52
|
-
const
|
|
53
|
-
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);
|
|
50
|
+
const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
54
51
|
const _response = yield core.fetcher({
|
|
55
52
|
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(business)}`),
|
|
56
53
|
method: "GET",
|
|
@@ -69,16 +66,11 @@ export class BusinessesClient {
|
|
|
69
66
|
};
|
|
70
67
|
}
|
|
71
68
|
if (_response.error.reason === "status-code") {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
statusCode: _response.error.statusCode,
|
|
78
|
-
body: _response.error.body,
|
|
79
|
-
rawResponse: _response.rawResponse,
|
|
80
|
-
});
|
|
81
|
-
}
|
|
69
|
+
throw new errors.FiveOneEatError({
|
|
70
|
+
statusCode: _response.error.statusCode,
|
|
71
|
+
body: _response.error.body,
|
|
72
|
+
rawResponse: _response.rawResponse,
|
|
73
|
+
});
|
|
82
74
|
}
|
|
83
75
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/customer/businesses/{business}");
|
|
84
76
|
});
|
|
@@ -89,7 +81,6 @@ export class BusinessesClient {
|
|
|
89
81
|
* @param {FiveOneEat.customer.MenusBusinessesRequest} request
|
|
90
82
|
* @param {BusinessesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
91
83
|
*
|
|
92
|
-
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
93
84
|
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
94
85
|
*
|
|
95
86
|
* @example
|
|
@@ -108,8 +99,7 @@ export class BusinessesClient {
|
|
|
108
99
|
page,
|
|
109
100
|
per_page: perPage,
|
|
110
101
|
};
|
|
111
|
-
const
|
|
112
|
-
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);
|
|
102
|
+
const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
113
103
|
const _response = yield core.fetcher({
|
|
114
104
|
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(business)}/menus`),
|
|
115
105
|
method: "GET",
|
|
@@ -134,8 +124,6 @@ export class BusinessesClient {
|
|
|
134
124
|
}
|
|
135
125
|
if (_response.error.reason === "status-code") {
|
|
136
126
|
switch (_response.error.statusCode) {
|
|
137
|
-
case 401:
|
|
138
|
-
throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
139
127
|
case 422:
|
|
140
128
|
throw new FiveOneEat.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
141
129
|
default:
|
|
@@ -155,7 +143,6 @@ export class BusinessesClient {
|
|
|
155
143
|
* @param {FiveOneEat.customer.PhotosBusinessesRequest} request
|
|
156
144
|
* @param {BusinessesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
157
145
|
*
|
|
158
|
-
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
159
146
|
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
160
147
|
*
|
|
161
148
|
* @example
|
|
@@ -174,8 +161,7 @@ export class BusinessesClient {
|
|
|
174
161
|
page,
|
|
175
162
|
per_page: perPage,
|
|
176
163
|
};
|
|
177
|
-
const
|
|
178
|
-
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);
|
|
164
|
+
const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
179
165
|
const _response = yield core.fetcher({
|
|
180
166
|
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(business)}/photos`),
|
|
181
167
|
method: "GET",
|
|
@@ -200,8 +186,6 @@ export class BusinessesClient {
|
|
|
200
186
|
}
|
|
201
187
|
if (_response.error.reason === "status-code") {
|
|
202
188
|
switch (_response.error.statusCode) {
|
|
203
|
-
case 401:
|
|
204
|
-
throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
205
189
|
case 422:
|
|
206
190
|
throw new FiveOneEat.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
207
191
|
default:
|
|
@@ -216,32 +200,27 @@ export class BusinessesClient {
|
|
|
216
200
|
});
|
|
217
201
|
}
|
|
218
202
|
/**
|
|
219
|
-
*
|
|
203
|
+
* Retrieve active and upcoming temporary locations for a business.
|
|
220
204
|
*
|
|
221
|
-
* @param {FiveOneEat.customer.
|
|
205
|
+
* @param {FiveOneEat.customer.ListTemporaryLocationsBusinessesRequest} request
|
|
222
206
|
* @param {BusinessesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
223
207
|
*
|
|
224
|
-
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
225
|
-
* @throws {@link FiveOneEat.NotFoundError}
|
|
226
|
-
* @throws {@link FiveOneEat.ConflictError}
|
|
227
|
-
*
|
|
228
208
|
* @example
|
|
229
|
-
* await client.customer.businesses.
|
|
209
|
+
* await client.customer.businesses.listTemporaryLocations({
|
|
230
210
|
* business: "katzs-deli"
|
|
231
211
|
* })
|
|
232
212
|
*/
|
|
233
|
-
|
|
234
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
213
|
+
listTemporaryLocations(request, requestOptions) {
|
|
214
|
+
return core.HttpResponsePromise.fromPromise(this.__listTemporaryLocations(request, requestOptions));
|
|
235
215
|
}
|
|
236
|
-
|
|
216
|
+
__listTemporaryLocations(request, requestOptions) {
|
|
237
217
|
return __awaiter(this, void 0, void 0, function* () {
|
|
238
218
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
239
219
|
const { business } = request;
|
|
240
|
-
const
|
|
241
|
-
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);
|
|
220
|
+
const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
242
221
|
const _response = yield core.fetcher({
|
|
243
|
-
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(business)}/
|
|
244
|
-
method: "
|
|
222
|
+
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(business)}/temporary-locations`),
|
|
223
|
+
method: "GET",
|
|
245
224
|
headers: _headers,
|
|
246
225
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
247
226
|
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,
|
|
@@ -257,52 +236,50 @@ export class BusinessesClient {
|
|
|
257
236
|
};
|
|
258
237
|
}
|
|
259
238
|
if (_response.error.reason === "status-code") {
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
case 409:
|
|
266
|
-
throw new FiveOneEat.ConflictError(_response.error.body, _response.rawResponse);
|
|
267
|
-
default:
|
|
268
|
-
throw new errors.FiveOneEatError({
|
|
269
|
-
statusCode: _response.error.statusCode,
|
|
270
|
-
body: _response.error.body,
|
|
271
|
-
rawResponse: _response.rawResponse,
|
|
272
|
-
});
|
|
273
|
-
}
|
|
239
|
+
throw new errors.FiveOneEatError({
|
|
240
|
+
statusCode: _response.error.statusCode,
|
|
241
|
+
body: _response.error.body,
|
|
242
|
+
rawResponse: _response.rawResponse,
|
|
243
|
+
});
|
|
274
244
|
}
|
|
275
|
-
return handleNonStatusCodeError(_response.error, _response.rawResponse, "
|
|
245
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/customer/businesses/{business}/temporary-locations");
|
|
276
246
|
});
|
|
277
247
|
}
|
|
278
248
|
/**
|
|
279
|
-
*
|
|
249
|
+
* Returns available pickup timeslots for a business on a given date.
|
|
280
250
|
*
|
|
281
|
-
* @param {FiveOneEat.customer.
|
|
251
|
+
* @param {FiveOneEat.customer.GetPickupTimeslotsBusinessesRequest} request
|
|
282
252
|
* @param {BusinessesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
283
253
|
*
|
|
284
|
-
* @throws {@link FiveOneEat.
|
|
285
|
-
* @throws {@link FiveOneEat.NotFoundError}
|
|
254
|
+
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
286
255
|
*
|
|
287
256
|
* @example
|
|
288
|
-
* await client.customer.businesses.
|
|
289
|
-
*
|
|
257
|
+
* await client.customer.businesses.getPickupTimeslots({
|
|
258
|
+
* handle: "katzs-deli",
|
|
259
|
+
* date: "2023-01-15"
|
|
290
260
|
* })
|
|
291
261
|
*/
|
|
292
|
-
|
|
293
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
262
|
+
getPickupTimeslots(request, requestOptions) {
|
|
263
|
+
return core.HttpResponsePromise.fromPromise(this.__getPickupTimeslots(request, requestOptions));
|
|
294
264
|
}
|
|
295
|
-
|
|
265
|
+
__getPickupTimeslots(request, requestOptions) {
|
|
296
266
|
return __awaiter(this, void 0, void 0, function* () {
|
|
297
267
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
298
|
-
const {
|
|
299
|
-
const
|
|
300
|
-
|
|
268
|
+
const { handle, date } = request;
|
|
269
|
+
const _queryParams = {
|
|
270
|
+
date,
|
|
271
|
+
};
|
|
272
|
+
const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
301
273
|
const _response = yield core.fetcher({
|
|
302
|
-
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(
|
|
303
|
-
method: "
|
|
274
|
+
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)}/pickup-timeslots`),
|
|
275
|
+
method: "GET",
|
|
304
276
|
headers: _headers,
|
|
305
|
-
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
277
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
278
|
+
queryString: core.url
|
|
279
|
+
.queryBuilder()
|
|
280
|
+
.addMany(_queryParams)
|
|
281
|
+
.mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
|
|
282
|
+
.build(),
|
|
306
283
|
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,
|
|
307
284
|
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,
|
|
308
285
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -310,14 +287,15 @@ export class BusinessesClient {
|
|
|
310
287
|
logging: this._options.logging,
|
|
311
288
|
});
|
|
312
289
|
if (_response.ok) {
|
|
313
|
-
return {
|
|
290
|
+
return {
|
|
291
|
+
data: _response.body,
|
|
292
|
+
rawResponse: _response.rawResponse,
|
|
293
|
+
};
|
|
314
294
|
}
|
|
315
295
|
if (_response.error.reason === "status-code") {
|
|
316
296
|
switch (_response.error.statusCode) {
|
|
317
|
-
case
|
|
318
|
-
throw new FiveOneEat.
|
|
319
|
-
case 404:
|
|
320
|
-
throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
|
|
297
|
+
case 422:
|
|
298
|
+
throw new FiveOneEat.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
321
299
|
default:
|
|
322
300
|
throw new errors.FiveOneEatError({
|
|
323
301
|
statusCode: _response.error.statusCode,
|
|
@@ -326,34 +304,36 @@ export class BusinessesClient {
|
|
|
326
304
|
});
|
|
327
305
|
}
|
|
328
306
|
}
|
|
329
|
-
return handleNonStatusCodeError(_response.error, _response.rawResponse, "
|
|
307
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/customer/businesses/{handle}/pickup-timeslots");
|
|
330
308
|
});
|
|
331
309
|
}
|
|
332
310
|
/**
|
|
333
|
-
*
|
|
311
|
+
* Add a business to the authenticated user's favorites.
|
|
334
312
|
*
|
|
335
|
-
* @param {FiveOneEat.customer.
|
|
313
|
+
* @param {FiveOneEat.customer.FavoriteBusinessesRequest} request
|
|
336
314
|
* @param {BusinessesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
337
315
|
*
|
|
338
316
|
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
317
|
+
* @throws {@link FiveOneEat.NotFoundError}
|
|
318
|
+
* @throws {@link FiveOneEat.ConflictError}
|
|
339
319
|
*
|
|
340
320
|
* @example
|
|
341
|
-
* await client.customer.businesses.
|
|
321
|
+
* await client.customer.businesses.favorite({
|
|
342
322
|
* business: "katzs-deli"
|
|
343
323
|
* })
|
|
344
324
|
*/
|
|
345
|
-
|
|
346
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
325
|
+
favorite(request, requestOptions) {
|
|
326
|
+
return core.HttpResponsePromise.fromPromise(this.__favorite(request, requestOptions));
|
|
347
327
|
}
|
|
348
|
-
|
|
328
|
+
__favorite(request, requestOptions) {
|
|
349
329
|
return __awaiter(this, void 0, void 0, function* () {
|
|
350
330
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
351
331
|
const { business } = request;
|
|
352
332
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
353
333
|
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);
|
|
354
334
|
const _response = yield core.fetcher({
|
|
355
|
-
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(business)}/
|
|
356
|
-
method: "
|
|
335
|
+
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(business)}/favorite`),
|
|
336
|
+
method: "POST",
|
|
357
337
|
headers: _headers,
|
|
358
338
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
359
339
|
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,
|
|
@@ -372,6 +352,10 @@ export class BusinessesClient {
|
|
|
372
352
|
switch (_response.error.statusCode) {
|
|
373
353
|
case 401:
|
|
374
354
|
throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
355
|
+
case 404:
|
|
356
|
+
throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
|
|
357
|
+
case 409:
|
|
358
|
+
throw new FiveOneEat.ConflictError(_response.error.body, _response.rawResponse);
|
|
375
359
|
default:
|
|
376
360
|
throw new errors.FiveOneEatError({
|
|
377
361
|
statusCode: _response.error.statusCode,
|
|
@@ -380,46 +364,37 @@ export class BusinessesClient {
|
|
|
380
364
|
});
|
|
381
365
|
}
|
|
382
366
|
}
|
|
383
|
-
return handleNonStatusCodeError(_response.error, _response.rawResponse, "
|
|
367
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/customer/businesses/{business}/favorite");
|
|
384
368
|
});
|
|
385
369
|
}
|
|
386
370
|
/**
|
|
387
|
-
*
|
|
371
|
+
* Remove a business from the authenticated user's favorites.
|
|
388
372
|
*
|
|
389
|
-
* @param {FiveOneEat.customer.
|
|
373
|
+
* @param {FiveOneEat.customer.UnfavoriteBusinessesRequest} request
|
|
390
374
|
* @param {BusinessesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
391
375
|
*
|
|
392
376
|
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
393
|
-
* @throws {@link FiveOneEat.
|
|
377
|
+
* @throws {@link FiveOneEat.NotFoundError}
|
|
394
378
|
*
|
|
395
379
|
* @example
|
|
396
|
-
* await client.customer.businesses.
|
|
397
|
-
*
|
|
398
|
-
* date: "2023-01-15"
|
|
380
|
+
* await client.customer.businesses.unfavorite({
|
|
381
|
+
* business: "katzs-deli"
|
|
399
382
|
* })
|
|
400
383
|
*/
|
|
401
|
-
|
|
402
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
384
|
+
unfavorite(request, requestOptions) {
|
|
385
|
+
return core.HttpResponsePromise.fromPromise(this.__unfavorite(request, requestOptions));
|
|
403
386
|
}
|
|
404
|
-
|
|
387
|
+
__unfavorite(request, requestOptions) {
|
|
405
388
|
return __awaiter(this, void 0, void 0, function* () {
|
|
406
389
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
407
|
-
const {
|
|
408
|
-
const _queryParams = {
|
|
409
|
-
date,
|
|
410
|
-
};
|
|
390
|
+
const { business } = request;
|
|
411
391
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
412
392
|
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);
|
|
413
393
|
const _response = yield core.fetcher({
|
|
414
|
-
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(
|
|
415
|
-
method: "
|
|
394
|
+
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(business)}/favorite`),
|
|
395
|
+
method: "DELETE",
|
|
416
396
|
headers: _headers,
|
|
417
|
-
queryParameters:
|
|
418
|
-
queryString: core.url
|
|
419
|
-
.queryBuilder()
|
|
420
|
-
.addMany(_queryParams)
|
|
421
|
-
.mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
|
|
422
|
-
.build(),
|
|
397
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
423
398
|
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,
|
|
424
399
|
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,
|
|
425
400
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -427,17 +402,14 @@ export class BusinessesClient {
|
|
|
427
402
|
logging: this._options.logging,
|
|
428
403
|
});
|
|
429
404
|
if (_response.ok) {
|
|
430
|
-
return {
|
|
431
|
-
data: _response.body,
|
|
432
|
-
rawResponse: _response.rawResponse,
|
|
433
|
-
};
|
|
405
|
+
return { data: undefined, rawResponse: _response.rawResponse };
|
|
434
406
|
}
|
|
435
407
|
if (_response.error.reason === "status-code") {
|
|
436
408
|
switch (_response.error.statusCode) {
|
|
437
409
|
case 401:
|
|
438
410
|
throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
439
|
-
case
|
|
440
|
-
throw new FiveOneEat.
|
|
411
|
+
case 404:
|
|
412
|
+
throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
|
|
441
413
|
default:
|
|
442
414
|
throw new errors.FiveOneEatError({
|
|
443
415
|
statusCode: _response.error.statusCode,
|
|
@@ -446,7 +418,7 @@ export class BusinessesClient {
|
|
|
446
418
|
});
|
|
447
419
|
}
|
|
448
420
|
}
|
|
449
|
-
return handleNonStatusCodeError(_response.error, _response.rawResponse, "
|
|
421
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/customer/businesses/{business}/favorite");
|
|
450
422
|
});
|
|
451
423
|
}
|
|
452
424
|
}
|
package/dist/esm/api/resources/customer/resources/businesses/resources/bulletins/client/Client.d.mts
CHANGED
|
@@ -19,7 +19,6 @@ export declare class BulletinsClient {
|
|
|
19
19
|
* @param {FiveOneEat.customer.businesses.ListBulletinsRequest} request
|
|
20
20
|
* @param {BulletinsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
21
21
|
*
|
|
22
|
-
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
23
22
|
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
24
23
|
*
|
|
25
24
|
* @example
|
package/dist/esm/api/resources/customer/resources/businesses/resources/bulletins/client/Client.mjs
CHANGED
|
@@ -30,7 +30,6 @@ export class BulletinsClient {
|
|
|
30
30
|
* @param {FiveOneEat.customer.businesses.ListBulletinsRequest} request
|
|
31
31
|
* @param {BulletinsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
32
32
|
*
|
|
33
|
-
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
34
33
|
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
35
34
|
*
|
|
36
35
|
* @example
|
|
@@ -49,8 +48,7 @@ export class BulletinsClient {
|
|
|
49
48
|
page,
|
|
50
49
|
per_page: perPage,
|
|
51
50
|
};
|
|
52
|
-
const
|
|
53
|
-
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);
|
|
51
|
+
const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
54
52
|
const _response = yield core.fetcher({
|
|
55
53
|
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(business)}/bulletins`),
|
|
56
54
|
method: "GET",
|
|
@@ -75,8 +73,6 @@ export class BulletinsClient {
|
|
|
75
73
|
}
|
|
76
74
|
if (_response.error.reason === "status-code") {
|
|
77
75
|
switch (_response.error.statusCode) {
|
|
78
|
-
case 401:
|
|
79
|
-
throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
80
76
|
case 422:
|
|
81
77
|
throw new FiveOneEat.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
82
78
|
default:
|
|
@@ -16,7 +16,6 @@ export declare class CommentsClient {
|
|
|
16
16
|
* @param {FiveOneEat.customer.businesses.bulletins.ListCommentsRequest} request
|
|
17
17
|
* @param {CommentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
18
18
|
*
|
|
19
|
-
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
20
19
|
* @throws {@link FiveOneEat.NotFoundError}
|
|
21
20
|
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
22
21
|
*
|
|
@@ -53,7 +52,6 @@ export declare class CommentsClient {
|
|
|
53
52
|
* @param {FiveOneEat.customer.businesses.bulletins.ListRepliesCommentsRequest} request
|
|
54
53
|
* @param {CommentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
55
54
|
*
|
|
56
|
-
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
57
55
|
* @throws {@link FiveOneEat.NotFoundError}
|
|
58
56
|
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
59
57
|
*
|
|
@@ -36,7 +36,6 @@ export class CommentsClient {
|
|
|
36
36
|
* @param {FiveOneEat.customer.businesses.bulletins.ListCommentsRequest} request
|
|
37
37
|
* @param {CommentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
38
38
|
*
|
|
39
|
-
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
40
39
|
* @throws {@link FiveOneEat.NotFoundError}
|
|
41
40
|
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
42
41
|
*
|
|
@@ -57,8 +56,7 @@ export class CommentsClient {
|
|
|
57
56
|
page,
|
|
58
57
|
per_page: perPage,
|
|
59
58
|
};
|
|
60
|
-
const
|
|
61
|
-
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);
|
|
59
|
+
const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
62
60
|
const _response = yield core.fetcher({
|
|
63
61
|
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(business)}/bulletins/${core.url.encodePathParam(bulletin)}/comments`),
|
|
64
62
|
method: "GET",
|
|
@@ -83,8 +81,6 @@ export class CommentsClient {
|
|
|
83
81
|
}
|
|
84
82
|
if (_response.error.reason === "status-code") {
|
|
85
83
|
switch (_response.error.statusCode) {
|
|
86
|
-
case 401:
|
|
87
|
-
throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
88
84
|
case 404:
|
|
89
85
|
throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
|
|
90
86
|
case 422:
|
|
@@ -171,7 +167,6 @@ export class CommentsClient {
|
|
|
171
167
|
* @param {FiveOneEat.customer.businesses.bulletins.ListRepliesCommentsRequest} request
|
|
172
168
|
* @param {CommentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
173
169
|
*
|
|
174
|
-
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
175
170
|
* @throws {@link FiveOneEat.NotFoundError}
|
|
176
171
|
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
177
172
|
*
|
|
@@ -193,8 +188,7 @@ export class CommentsClient {
|
|
|
193
188
|
page,
|
|
194
189
|
per_page: perPage,
|
|
195
190
|
};
|
|
196
|
-
const
|
|
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);
|
|
191
|
+
const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
198
192
|
const _response = yield core.fetcher({
|
|
199
193
|
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(business)}/bulletins/${core.url.encodePathParam(bulletin)}/comments/${core.url.encodePathParam(comment)}/replies`),
|
|
200
194
|
method: "GET",
|
|
@@ -219,8 +213,6 @@ export class CommentsClient {
|
|
|
219
213
|
}
|
|
220
214
|
if (_response.error.reason === "status-code") {
|
|
221
215
|
switch (_response.error.statusCode) {
|
|
222
|
-
case 401:
|
|
223
|
-
throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
224
216
|
case 404:
|
|
225
217
|
throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
|
|
226
218
|
case 422:
|
package/dist/esm/api/resources/customer/resources/businesses/resources/events/client/Client.d.mts
CHANGED
|
@@ -16,7 +16,6 @@ export declare class EventsClient {
|
|
|
16
16
|
* @param {FiveOneEat.customer.businesses.ListEventsRequest} request
|
|
17
17
|
* @param {EventsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
18
18
|
*
|
|
19
|
-
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
20
19
|
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
21
20
|
*
|
|
22
21
|
* @example
|
|
@@ -32,8 +31,6 @@ export declare class EventsClient {
|
|
|
32
31
|
* @param {FiveOneEat.customer.businesses.GetEventsRequest} request
|
|
33
32
|
* @param {EventsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
34
33
|
*
|
|
35
|
-
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
36
|
-
*
|
|
37
34
|
* @example
|
|
38
35
|
* await client.customer.businesses.events.get({
|
|
39
36
|
* business: "katzs-deli",
|