@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
|
@@ -53,13 +53,12 @@ const errors = __importStar(require("../../../../../../errors/index.js"));
|
|
|
53
53
|
const FiveOneEat = __importStar(require("../../../../../index.js"));
|
|
54
54
|
class ShopClient {
|
|
55
55
|
constructor(options = {}) {
|
|
56
|
-
this._options = (0, BaseClient_js_1.
|
|
56
|
+
this._options = (0, BaseClient_js_1.normalizeClientOptions)(options);
|
|
57
57
|
}
|
|
58
58
|
/**
|
|
59
59
|
* @param {FiveOneEat.customer.ListProductsShopRequest} request
|
|
60
60
|
* @param {ShopClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
61
61
|
*
|
|
62
|
-
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
63
62
|
* @throws {@link FiveOneEat.NotFoundError}
|
|
64
63
|
*
|
|
65
64
|
* @example
|
|
@@ -77,8 +76,7 @@ class ShopClient {
|
|
|
77
76
|
const _queryParams = {
|
|
78
77
|
category,
|
|
79
78
|
};
|
|
80
|
-
const
|
|
81
|
-
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);
|
|
79
|
+
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
82
80
|
const _response = yield core.fetcher({
|
|
83
81
|
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)}/shop`),
|
|
84
82
|
method: "GET",
|
|
@@ -103,8 +101,6 @@ class ShopClient {
|
|
|
103
101
|
}
|
|
104
102
|
if (_response.error.reason === "status-code") {
|
|
105
103
|
switch (_response.error.statusCode) {
|
|
106
|
-
case 401:
|
|
107
|
-
throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
108
104
|
case 404:
|
|
109
105
|
throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
|
|
110
106
|
default:
|
|
@@ -122,7 +118,6 @@ class ShopClient {
|
|
|
122
118
|
* @param {FiveOneEat.customer.GetProductShopRequest} request
|
|
123
119
|
* @param {ShopClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
124
120
|
*
|
|
125
|
-
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
126
121
|
* @throws {@link FiveOneEat.NotFoundError}
|
|
127
122
|
*
|
|
128
123
|
* @example
|
|
@@ -138,8 +133,7 @@ class ShopClient {
|
|
|
138
133
|
return __awaiter(this, void 0, void 0, function* () {
|
|
139
134
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
140
135
|
const { business, product } = request;
|
|
141
|
-
const
|
|
142
|
-
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);
|
|
136
|
+
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
143
137
|
const _response = yield core.fetcher({
|
|
144
138
|
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)}/shop/products/${core.url.encodePathParam(product)}`),
|
|
145
139
|
method: "GET",
|
|
@@ -159,8 +153,6 @@ class ShopClient {
|
|
|
159
153
|
}
|
|
160
154
|
if (_response.error.reason === "status-code") {
|
|
161
155
|
switch (_response.error.statusCode) {
|
|
162
|
-
case 401:
|
|
163
|
-
throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
164
156
|
case 404:
|
|
165
157
|
throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
|
|
166
158
|
default:
|
|
@@ -178,7 +170,6 @@ class ShopClient {
|
|
|
178
170
|
* @param {FiveOneEat.customer.ListCategoriesShopRequest} request
|
|
179
171
|
* @param {ShopClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
180
172
|
*
|
|
181
|
-
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
182
173
|
* @throws {@link FiveOneEat.NotFoundError}
|
|
183
174
|
*
|
|
184
175
|
* @example
|
|
@@ -193,8 +184,7 @@ class ShopClient {
|
|
|
193
184
|
return __awaiter(this, void 0, void 0, function* () {
|
|
194
185
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
195
186
|
const { business } = request;
|
|
196
|
-
const
|
|
197
|
-
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);
|
|
187
|
+
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
198
188
|
const _response = yield core.fetcher({
|
|
199
189
|
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)}/shop/categories`),
|
|
200
190
|
method: "GET",
|
|
@@ -214,8 +204,6 @@ class ShopClient {
|
|
|
214
204
|
}
|
|
215
205
|
if (_response.error.reason === "status-code") {
|
|
216
206
|
switch (_response.error.statusCode) {
|
|
217
|
-
case 401:
|
|
218
|
-
throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
219
207
|
case 404:
|
|
220
208
|
throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
|
|
221
209
|
default:
|
|
@@ -76,8 +76,7 @@ class StandsClient {
|
|
|
76
76
|
return __awaiter(this, void 0, void 0, function* () {
|
|
77
77
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
78
78
|
const { stand } = request;
|
|
79
|
-
const
|
|
80
|
-
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);
|
|
79
|
+
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
81
80
|
const _response = yield core.fetcher({
|
|
82
81
|
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, `stand/${core.url.encodePathParam(stand)}`),
|
|
83
82
|
method: "GET",
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export interface CreatePaymentIntentStandsResponse {
|
|
2
2
|
client_secret: string;
|
|
3
3
|
payment_intent_id: string;
|
|
4
|
-
subtotal:
|
|
5
|
-
tax_amount:
|
|
6
|
-
platform_fee:
|
|
7
|
-
total_amount:
|
|
4
|
+
subtotal: number;
|
|
5
|
+
tax_amount: number;
|
|
6
|
+
platform_fee: number;
|
|
7
|
+
total_amount: number;
|
|
8
8
|
amount: number;
|
|
9
9
|
currency: CreatePaymentIntentStandsResponse.Currency;
|
|
10
10
|
}
|
|
@@ -4,7 +4,7 @@ export interface AppHttpResourcesApiV1BusinessCommerceProductResource {
|
|
|
4
4
|
name: string;
|
|
5
5
|
slug: string;
|
|
6
6
|
description: string;
|
|
7
|
-
is_active:
|
|
7
|
+
is_active: boolean;
|
|
8
8
|
published_at: string;
|
|
9
9
|
variants?: FiveOneEat.VariantResource[] | undefined;
|
|
10
10
|
default_variant?: FiveOneEat.VariantResource | undefined;
|
|
@@ -1,27 +1,42 @@
|
|
|
1
|
+
import type * as FiveOneEat from "../index.js";
|
|
1
2
|
export interface OrderResource {
|
|
2
3
|
id: string;
|
|
3
4
|
order_number: string;
|
|
4
5
|
status: string;
|
|
5
6
|
fulfillment_status: string;
|
|
6
7
|
fulfillment_method: string;
|
|
7
|
-
subtotal_cents:
|
|
8
|
-
discount_cents:
|
|
9
|
-
shipping_cents:
|
|
10
|
-
tax_cents:
|
|
11
|
-
platform_fee_cents:
|
|
12
|
-
total_cents:
|
|
8
|
+
subtotal_cents: number;
|
|
9
|
+
discount_cents: number;
|
|
10
|
+
shipping_cents: number;
|
|
11
|
+
tax_cents: number;
|
|
12
|
+
platform_fee_cents: number;
|
|
13
|
+
total_cents: number;
|
|
13
14
|
currency: string;
|
|
14
|
-
shipping_address: string;
|
|
15
|
+
shipping_address: Record<string, unknown> | null;
|
|
15
16
|
notes: string;
|
|
16
17
|
fulfilled_at: string;
|
|
17
18
|
refunded_at: string;
|
|
19
|
+
business?: OrderResource.Business | undefined;
|
|
20
|
+
transaction?: (OrderResource.Transaction | null) | undefined;
|
|
18
21
|
tracking_number?: (string | null) | undefined;
|
|
22
|
+
tracking_url?: (string | null) | undefined;
|
|
19
23
|
shipments: OrderResource.Shipments;
|
|
20
|
-
items
|
|
24
|
+
items?: FiveOneEat.OrderItemResource[] | undefined;
|
|
21
25
|
created_at: string;
|
|
22
26
|
updated_at: string;
|
|
23
27
|
}
|
|
24
28
|
export declare namespace OrderResource {
|
|
25
|
-
|
|
29
|
+
interface Business {
|
|
30
|
+
id: string;
|
|
31
|
+
handle: string;
|
|
32
|
+
name: string;
|
|
33
|
+
}
|
|
34
|
+
interface Transaction {
|
|
35
|
+
ulid: string;
|
|
36
|
+
status: string;
|
|
37
|
+
refunded_amount_cents: number;
|
|
38
|
+
payment_completed_at: string;
|
|
39
|
+
refunded_at: string;
|
|
40
|
+
}
|
|
26
41
|
type Shipments = string | string[];
|
|
27
42
|
}
|
|
@@ -3,8 +3,8 @@ export interface PriceResource {
|
|
|
3
3
|
id: string;
|
|
4
4
|
price_list_id: string;
|
|
5
5
|
price_list?: FiveOneEat.PriceListResource | undefined;
|
|
6
|
-
amount_cents:
|
|
7
|
-
compare_at_cents:
|
|
6
|
+
amount_cents: number;
|
|
7
|
+
compare_at_cents: number | null;
|
|
8
8
|
currency: string;
|
|
9
|
-
min_quantity:
|
|
9
|
+
min_quantity: number;
|
|
10
10
|
}
|
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
import type * as FiveOneEat from "../index.js";
|
|
2
1
|
export interface ProductResource {
|
|
3
2
|
id: string;
|
|
4
3
|
name: string;
|
|
5
4
|
slug: string;
|
|
6
5
|
description: string;
|
|
7
|
-
is_active:
|
|
6
|
+
is_active: boolean;
|
|
8
7
|
published_at: string;
|
|
9
|
-
metadata: string;
|
|
8
|
+
metadata: Record<string, unknown> | null;
|
|
10
9
|
product_category_id: string;
|
|
11
|
-
category?:
|
|
12
|
-
images?:
|
|
10
|
+
category?: unknown[] | undefined;
|
|
11
|
+
images?: unknown[] | undefined;
|
|
13
12
|
variants?: unknown[] | undefined;
|
|
14
|
-
default_variant?:
|
|
13
|
+
default_variant?: unknown[] | undefined;
|
|
15
14
|
created_at: string;
|
|
16
15
|
updated_at: string;
|
|
17
16
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
export interface Transaction {
|
|
2
2
|
ulid: string;
|
|
3
3
|
status: string;
|
|
4
|
-
subtotal:
|
|
5
|
-
tax_amount:
|
|
6
|
-
shipping_amount:
|
|
7
|
-
platform_fee:
|
|
8
|
-
total_amount:
|
|
9
|
-
refunded_amount:
|
|
4
|
+
subtotal: number;
|
|
5
|
+
tax_amount: number;
|
|
6
|
+
shipping_amount: number;
|
|
7
|
+
platform_fee: number;
|
|
8
|
+
total_amount: number;
|
|
9
|
+
refunded_amount: number;
|
|
10
10
|
customer_name: string | null;
|
|
11
11
|
customer_email: string;
|
|
12
12
|
stripe_payment_intent_id: string | null;
|
|
@@ -3,10 +3,10 @@ export interface VariantResource {
|
|
|
3
3
|
id: string;
|
|
4
4
|
name: string;
|
|
5
5
|
sku: string;
|
|
6
|
-
is_default:
|
|
7
|
-
weight:
|
|
6
|
+
is_default: boolean;
|
|
7
|
+
weight: number | null;
|
|
8
8
|
weight_unit: string;
|
|
9
|
-
sort_order:
|
|
9
|
+
sort_order: number;
|
|
10
10
|
prices?: FiveOneEat.PriceResource[] | undefined;
|
|
11
11
|
inventory_levels?: FiveOneEat.InventoryLevelResource[] | undefined;
|
|
12
12
|
created_at: string;
|
|
@@ -118,18 +118,17 @@ export * from "./ExploreTemporaryLocation.js";
|
|
|
118
118
|
export * from "./FavoriteResponse.js";
|
|
119
119
|
export * from "./ForbiddenErrorBody.js";
|
|
120
120
|
export * from "./Image.js";
|
|
121
|
-
export * from "./ImageResource.js";
|
|
122
121
|
export * from "./InternalServerErrorBody.js";
|
|
123
122
|
export * from "./InventoryLevelResource.js";
|
|
124
123
|
export * from "./MenuItemSearchResult.js";
|
|
125
124
|
export * from "./Message.js";
|
|
126
125
|
export * from "./NotFoundErrorBody.js";
|
|
126
|
+
export * from "./OrderItemResource.js";
|
|
127
127
|
export * from "./OrderResource.js";
|
|
128
128
|
export * from "./PaginationResource.js";
|
|
129
129
|
export * from "./PaymentMethod.js";
|
|
130
130
|
export * from "./PriceListResource.js";
|
|
131
131
|
export * from "./PriceResource.js";
|
|
132
|
-
export * from "./ProductCategoryResource.js";
|
|
133
132
|
export * from "./ProductResource.js";
|
|
134
133
|
export * from "./ProductSearchResult.js";
|
|
135
134
|
export * from "./RsvpEvent.js";
|
|
@@ -134,18 +134,17 @@ __exportStar(require("./ExploreTemporaryLocation.js"), exports);
|
|
|
134
134
|
__exportStar(require("./FavoriteResponse.js"), exports);
|
|
135
135
|
__exportStar(require("./ForbiddenErrorBody.js"), exports);
|
|
136
136
|
__exportStar(require("./Image.js"), exports);
|
|
137
|
-
__exportStar(require("./ImageResource.js"), exports);
|
|
138
137
|
__exportStar(require("./InternalServerErrorBody.js"), exports);
|
|
139
138
|
__exportStar(require("./InventoryLevelResource.js"), exports);
|
|
140
139
|
__exportStar(require("./MenuItemSearchResult.js"), exports);
|
|
141
140
|
__exportStar(require("./Message.js"), exports);
|
|
142
141
|
__exportStar(require("./NotFoundErrorBody.js"), exports);
|
|
142
|
+
__exportStar(require("./OrderItemResource.js"), exports);
|
|
143
143
|
__exportStar(require("./OrderResource.js"), exports);
|
|
144
144
|
__exportStar(require("./PaginationResource.js"), exports);
|
|
145
145
|
__exportStar(require("./PaymentMethod.js"), exports);
|
|
146
146
|
__exportStar(require("./PriceListResource.js"), exports);
|
|
147
147
|
__exportStar(require("./PriceResource.js"), exports);
|
|
148
|
-
__exportStar(require("./ProductCategoryResource.js"), exports);
|
|
149
148
|
__exportStar(require("./ProductResource.js"), exports);
|
|
150
149
|
__exportStar(require("./ProductSearchResult.js"), exports);
|
|
151
150
|
__exportStar(require("./RsvpEvent.js"), exports);
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.0.
|
|
1
|
+
export declare const SDK_VERSION = "0.0.72";
|
package/dist/cjs/version.js
CHANGED
package/dist/esm/BaseClient.mjs
CHANGED
|
@@ -6,8 +6,8 @@ export function normalizeClientOptions(options) {
|
|
|
6
6
|
const headers = mergeHeaders({
|
|
7
7
|
"X-Fern-Language": "JavaScript",
|
|
8
8
|
"X-Fern-SDK-Name": "@51eat/sdk",
|
|
9
|
-
"X-Fern-SDK-Version": "0.0.
|
|
10
|
-
"User-Agent": "@51eat/sdk/0.0.
|
|
9
|
+
"X-Fern-SDK-Version": "0.0.72",
|
|
10
|
+
"User-Agent": "@51eat/sdk/0.0.72",
|
|
11
11
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
12
12
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
13
13
|
}, options === null || options === void 0 ? void 0 : options.headers);
|
package/dist/esm/api/resources/business/resources/stands/client/requests/UpdateStandRequest.d.mts
CHANGED
|
@@ -17,4 +17,11 @@ export interface UpdateStandRequest {
|
|
|
17
17
|
latitude?: number | null;
|
|
18
18
|
longitude?: number | null;
|
|
19
19
|
is_active?: boolean | null;
|
|
20
|
+
/**
|
|
21
|
+
* `UpdateStand` passes these straight to `$stand->products()->sync()`.
|
|
22
|
+
* Unvalidated, any id at all was accepted — including one from another
|
|
23
|
+
* business's catalogue, which then appeared on this stand's public
|
|
24
|
+
* self-checkout. Scoped to the caller's own products.
|
|
25
|
+
*/
|
|
26
|
+
product_ids?: string[];
|
|
20
27
|
}
|
|
@@ -62,7 +62,6 @@ export declare class CustomerClient {
|
|
|
62
62
|
* @param {FiveOneEat.SearchCustomerRequest} request
|
|
63
63
|
* @param {CustomerClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
64
64
|
*
|
|
65
|
-
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
66
65
|
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
67
66
|
*
|
|
68
67
|
* @example
|
|
@@ -102,7 +102,6 @@ export class CustomerClient {
|
|
|
102
102
|
* @param {FiveOneEat.SearchCustomerRequest} request
|
|
103
103
|
* @param {CustomerClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
104
104
|
*
|
|
105
|
-
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
106
105
|
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
107
106
|
*
|
|
108
107
|
* @example
|
|
@@ -132,8 +131,7 @@ export class CustomerClient {
|
|
|
132
131
|
lat: lat != null ? toJson(lat) : undefined,
|
|
133
132
|
lng: lng != null ? toJson(lng) : undefined,
|
|
134
133
|
};
|
|
135
|
-
const
|
|
136
|
-
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);
|
|
134
|
+
const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
137
135
|
const _response = yield core.fetcher({
|
|
138
136
|
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/search"),
|
|
139
137
|
method: "GET",
|
|
@@ -155,8 +153,6 @@ export class CustomerClient {
|
|
|
155
153
|
}
|
|
156
154
|
if (_response.error.reason === "status-code") {
|
|
157
155
|
switch (_response.error.statusCode) {
|
|
158
|
-
case 401:
|
|
159
|
-
throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
160
156
|
case 422:
|
|
161
157
|
throw new FiveOneEat.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
162
158
|
default:
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.mjs";
|
|
2
|
-
import { type
|
|
2
|
+
import { type NormalizedClientOptions } from "../../../../../../BaseClient.mjs";
|
|
3
3
|
import * as core from "../../../../../../core/index.mjs";
|
|
4
4
|
import * as FiveOneEat from "../../../../../index.mjs";
|
|
5
5
|
export declare namespace AdsClient {
|
|
@@ -8,7 +8,7 @@ export declare namespace AdsClient {
|
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
10
|
export declare class AdsClient {
|
|
11
|
-
protected readonly _options:
|
|
11
|
+
protected readonly _options: NormalizedClientOptions<AdsClient.Options>;
|
|
12
12
|
constructor(options?: AdsClient.Options);
|
|
13
13
|
/**
|
|
14
14
|
* Returns an active advertisement for the given placement, or no content if none is available.
|
|
@@ -16,7 +16,6 @@ export declare class AdsClient {
|
|
|
16
16
|
* @param {FiveOneEat.customer.ServeAdsRequest} request
|
|
17
17
|
* @param {AdsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
18
18
|
*
|
|
19
|
-
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
20
19
|
* @throws {@link FiveOneEat.NotFoundError}
|
|
21
20
|
*
|
|
22
21
|
* @example
|
|
@@ -32,7 +31,6 @@ export declare class AdsClient {
|
|
|
32
31
|
* @param {FiveOneEat.customer.RecordClickAdsRequest} request
|
|
33
32
|
* @param {AdsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
34
33
|
*
|
|
35
|
-
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
36
34
|
* @throws {@link FiveOneEat.NotFoundError}
|
|
37
35
|
*
|
|
38
36
|
* @example
|
|
@@ -8,7 +8,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
-
import {
|
|
11
|
+
import { normalizeClientOptions } from "../../../../../../BaseClient.mjs";
|
|
12
12
|
import { mergeHeaders } from "../../../../../../core/headers.mjs";
|
|
13
13
|
import * as core from "../../../../../../core/index.mjs";
|
|
14
14
|
import * as environments from "../../../../../../environments.mjs";
|
|
@@ -17,7 +17,7 @@ import * as errors from "../../../../../../errors/index.mjs";
|
|
|
17
17
|
import * as FiveOneEat from "../../../../../index.mjs";
|
|
18
18
|
export class AdsClient {
|
|
19
19
|
constructor(options = {}) {
|
|
20
|
-
this._options =
|
|
20
|
+
this._options = normalizeClientOptions(options);
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
23
23
|
* Returns an active advertisement for the given placement, or no content if none is available.
|
|
@@ -25,7 +25,6 @@ export class AdsClient {
|
|
|
25
25
|
* @param {FiveOneEat.customer.ServeAdsRequest} request
|
|
26
26
|
* @param {AdsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
27
27
|
*
|
|
28
|
-
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
29
28
|
* @throws {@link FiveOneEat.NotFoundError}
|
|
30
29
|
*
|
|
31
30
|
* @example
|
|
@@ -40,8 +39,7 @@ export class AdsClient {
|
|
|
40
39
|
return __awaiter(this, void 0, void 0, function* () {
|
|
41
40
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
42
41
|
const { placement } = request;
|
|
43
|
-
const
|
|
44
|
-
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);
|
|
42
|
+
const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
45
43
|
const _response = yield core.fetcher({
|
|
46
44
|
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/ads/${core.url.encodePathParam(placement)}`),
|
|
47
45
|
method: "GET",
|
|
@@ -58,8 +56,6 @@ export class AdsClient {
|
|
|
58
56
|
}
|
|
59
57
|
if (_response.error.reason === "status-code") {
|
|
60
58
|
switch (_response.error.statusCode) {
|
|
61
|
-
case 401:
|
|
62
|
-
throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
63
59
|
case 404:
|
|
64
60
|
throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
|
|
65
61
|
default:
|
|
@@ -79,7 +75,6 @@ export class AdsClient {
|
|
|
79
75
|
* @param {FiveOneEat.customer.RecordClickAdsRequest} request
|
|
80
76
|
* @param {AdsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
81
77
|
*
|
|
82
|
-
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
83
78
|
* @throws {@link FiveOneEat.NotFoundError}
|
|
84
79
|
*
|
|
85
80
|
* @example
|
|
@@ -94,8 +89,7 @@ export class AdsClient {
|
|
|
94
89
|
return __awaiter(this, void 0, void 0, function* () {
|
|
95
90
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
96
91
|
const { advertisement } = request;
|
|
97
|
-
const
|
|
98
|
-
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);
|
|
92
|
+
const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
99
93
|
const _response = yield core.fetcher({
|
|
100
94
|
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/ads/${core.url.encodePathParam(advertisement)}/click`),
|
|
101
95
|
method: "POST",
|
|
@@ -112,8 +106,6 @@ export class AdsClient {
|
|
|
112
106
|
}
|
|
113
107
|
if (_response.error.reason === "status-code") {
|
|
114
108
|
switch (_response.error.statusCode) {
|
|
115
|
-
case 401:
|
|
116
|
-
throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
117
109
|
case 404:
|
|
118
110
|
throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
|
|
119
111
|
default:
|