@zenky/storefront-api 0.0.18 → 0.0.20
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/index.d.ts +6 -1
- package/dist/zenky-storefront-api.es.js +175 -171
- package/dist/zenky-storefront-api.umd.js +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -771,7 +771,7 @@ export interface CustomerLoyaltyProfile {
|
|
|
771
771
|
join_url: string;
|
|
772
772
|
invite_url: string;
|
|
773
773
|
};
|
|
774
|
-
balance: number;
|
|
774
|
+
balance: number | null;
|
|
775
775
|
bonuses_level: BonusesLevel | null;
|
|
776
776
|
rates: LoyaltyRates | null;
|
|
777
777
|
}
|
|
@@ -865,6 +865,10 @@ export interface CustomerPaymentMethod {
|
|
|
865
865
|
name: string;
|
|
866
866
|
bank: BankInfo | null;
|
|
867
867
|
}
|
|
868
|
+
export interface ResolverBonusesBalance {
|
|
869
|
+
balance: number | null;
|
|
870
|
+
resolved_by: string;
|
|
871
|
+
}
|
|
868
872
|
declare enum ConfirmationMethod {
|
|
869
873
|
Sms = "sms",
|
|
870
874
|
Call = "call"
|
|
@@ -1258,6 +1262,7 @@ declare class CustomersResource extends AbstractResource {
|
|
|
1258
1262
|
getPaymentMethods(storeId: string, request?: PaginationRequest, apiToken?: string): Promise<PaginatedResponse<CustomerPaymentMethod>>;
|
|
1259
1263
|
deletePaymentMethod(storeId: string, paymentMethodId: string, apiToken?: string): Promise<boolean>;
|
|
1260
1264
|
getBonusesTransactions(storeId: string, request?: ListCustomerBonusesTransactionsRequest, apiToken?: string): Promise<PaginatedResponse<BonusesTransaction>>;
|
|
1265
|
+
getBonusesBalance(storeId: string): Promise<ResolverBonusesBalance>;
|
|
1261
1266
|
}
|
|
1262
1267
|
declare class AuthenticationResource extends AbstractResource {
|
|
1263
1268
|
checkPhone(storeId: string, request: CheckPhoneRequest): Promise<PhoneCheckResult>;
|
|
@@ -1,76 +1,76 @@
|
|
|
1
1
|
var g = Object.defineProperty;
|
|
2
|
-
var d = (
|
|
3
|
-
var n = (
|
|
4
|
-
var p = /* @__PURE__ */ ((
|
|
2
|
+
var d = (t, e, r) => e in t ? g(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
|
|
3
|
+
var n = (t, e, r) => (d(t, typeof e != "symbol" ? e + "" : e, r), r);
|
|
4
|
+
var p = /* @__PURE__ */ ((t) => (t.DADATA = "dadata", t))(p || {});
|
|
5
5
|
class o {
|
|
6
|
-
constructor(
|
|
7
|
-
this.client =
|
|
6
|
+
constructor(e) {
|
|
7
|
+
this.client = e;
|
|
8
8
|
}
|
|
9
|
-
getStoreUrl(
|
|
10
|
-
return this.getUrl(`/store/${
|
|
9
|
+
getStoreUrl(e, r, s = {}) {
|
|
10
|
+
return this.getUrl(`/store/${e}${r}`, s);
|
|
11
11
|
}
|
|
12
|
-
getUrl(
|
|
12
|
+
getUrl(e, r = {}) {
|
|
13
13
|
if (!Object.keys(r).length)
|
|
14
|
-
return
|
|
14
|
+
return e;
|
|
15
15
|
const s = [];
|
|
16
16
|
Object.keys(r).forEach((a) => {
|
|
17
17
|
s.push(`${a}=${r[a]}`);
|
|
18
18
|
});
|
|
19
|
-
const i =
|
|
20
|
-
return `${
|
|
19
|
+
const i = e.includes("?") ? "&" : "?";
|
|
20
|
+
return `${e}${i}${s.join("&")}`;
|
|
21
21
|
}
|
|
22
|
-
getPaginatedResponse(
|
|
23
|
-
if (!
|
|
22
|
+
getPaginatedResponse(e) {
|
|
23
|
+
if (!e || !Array.isArray(e.data) || !e.meta || !e.meta.pagination)
|
|
24
24
|
throw new Error("getPaginatedResponse(): Invalid response.");
|
|
25
|
-
const r =
|
|
25
|
+
const r = e.data, s = e.meta.pagination;
|
|
26
26
|
return {
|
|
27
27
|
items: r,
|
|
28
28
|
pagination: s
|
|
29
29
|
};
|
|
30
30
|
}
|
|
31
|
-
getResponse(
|
|
32
|
-
if (!
|
|
31
|
+
getResponse(e) {
|
|
32
|
+
if (!e || !e.data)
|
|
33
33
|
throw new Error("getResponse(): Invalid response.");
|
|
34
|
-
return
|
|
34
|
+
return e.data;
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
class w extends o {
|
|
38
|
-
async getArticleCategories(
|
|
39
|
-
const r = this.getStoreUrl(
|
|
38
|
+
async getArticleCategories(e) {
|
|
39
|
+
const r = this.getStoreUrl(e, "/articles/categories");
|
|
40
40
|
return this.getPaginatedResponse(await this.client.request("GET", r));
|
|
41
41
|
}
|
|
42
|
-
async getArticleCategory(
|
|
43
|
-
const s = this.getStoreUrl(
|
|
42
|
+
async getArticleCategory(e, r) {
|
|
43
|
+
const s = this.getStoreUrl(e, `/articles/categories/${r}`);
|
|
44
44
|
return this.getResponse(await this.client.request("GET", s));
|
|
45
45
|
}
|
|
46
|
-
async getArticles(
|
|
47
|
-
const s = this.getStoreUrl(
|
|
46
|
+
async getArticles(e, r) {
|
|
47
|
+
const s = this.getStoreUrl(e, "/articles", r);
|
|
48
48
|
return this.getPaginatedResponse(await this.client.request("GET", s));
|
|
49
49
|
}
|
|
50
|
-
async getArticle(
|
|
51
|
-
const i = this.getStoreUrl(
|
|
50
|
+
async getArticle(e, r, s) {
|
|
51
|
+
const i = this.getStoreUrl(e, `/articles/${r}`, s);
|
|
52
52
|
return this.getResponse(await this.client.request("GET", i));
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
class k extends o {
|
|
56
|
-
async getCategories(
|
|
57
|
-
const s = this.getStoreUrl(
|
|
56
|
+
async getCategories(e, r) {
|
|
57
|
+
const s = this.getStoreUrl(e, "/categories", r);
|
|
58
58
|
return this.getPaginatedResponse(await this.client.request("GET", s));
|
|
59
59
|
}
|
|
60
|
-
async getCategoriesTree(
|
|
61
|
-
const s = this.getStoreUrl(
|
|
60
|
+
async getCategoriesTree(e, r) {
|
|
61
|
+
const s = this.getStoreUrl(e, "/categories/tree", r);
|
|
62
62
|
return this.getResponse(await this.client.request("GET", s));
|
|
63
63
|
}
|
|
64
|
-
async getCategory(
|
|
65
|
-
const i = this.getStoreUrl(
|
|
64
|
+
async getCategory(e, r, s) {
|
|
65
|
+
const i = this.getStoreUrl(e, `/categories/${r}`, s);
|
|
66
66
|
return this.getResponse(await this.client.request("GET", i));
|
|
67
67
|
}
|
|
68
|
-
async getFeaturesGroups(
|
|
69
|
-
const s = this.getStoreUrl(
|
|
68
|
+
async getFeaturesGroups(e, r) {
|
|
69
|
+
const s = this.getStoreUrl(e, `/categories/${r}/features/groups`);
|
|
70
70
|
return this.getResponse(await this.client.request("GET", s));
|
|
71
71
|
}
|
|
72
|
-
async getFeatures(
|
|
73
|
-
const s = this.getStoreUrl(
|
|
72
|
+
async getFeatures(e, r) {
|
|
73
|
+
const s = this.getStoreUrl(e, `/categories/${r}/features`);
|
|
74
74
|
return this.getResponse(await this.client.request("GET", s));
|
|
75
75
|
}
|
|
76
76
|
}
|
|
@@ -81,10 +81,10 @@ class h extends Error {
|
|
|
81
81
|
this.err = s;
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
|
-
class
|
|
85
|
-
static async build(
|
|
86
|
-
const r = await
|
|
87
|
-
switch (
|
|
84
|
+
class m {
|
|
85
|
+
static async build(e) {
|
|
86
|
+
const r = await e.json();
|
|
87
|
+
switch (e.status) {
|
|
88
88
|
case 401:
|
|
89
89
|
return new h((r == null ? void 0 : r.message) ?? "Unauthenticated.", null);
|
|
90
90
|
default:
|
|
@@ -93,29 +93,29 @@ class R {
|
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
95
|
class c {
|
|
96
|
-
constructor(
|
|
96
|
+
constructor(e, r, s, i, a, u) {
|
|
97
97
|
n(this, "baseUrl");
|
|
98
98
|
n(this, "token");
|
|
99
99
|
n(this, "client");
|
|
100
100
|
n(this, "timezone");
|
|
101
101
|
n(this, "fetchFunction");
|
|
102
102
|
n(this, "fetchOptions");
|
|
103
|
-
this.baseUrl =
|
|
103
|
+
this.baseUrl = e, this.token = r, this.client = s, this.timezone = i, this.fetchFunction = typeof a == "function" ? a : fetch, this.fetchOptions = typeof u < "u" ? u : {};
|
|
104
104
|
}
|
|
105
|
-
static build(
|
|
105
|
+
static build(e, r) {
|
|
106
106
|
return new c(
|
|
107
|
-
(
|
|
108
|
-
(
|
|
109
|
-
(
|
|
110
|
-
(
|
|
107
|
+
(e == null ? void 0 : e.baseUrl) || "https://storefront.zenky.io/v1",
|
|
108
|
+
(e == null ? void 0 : e.token) || null,
|
|
109
|
+
(e == null ? void 0 : e.client) || "web",
|
|
110
|
+
(e == null ? void 0 : e.timezone) || "UTC",
|
|
111
111
|
r,
|
|
112
|
-
|
|
112
|
+
e == null ? void 0 : e.fetchOptions
|
|
113
113
|
);
|
|
114
114
|
}
|
|
115
|
-
setToken(
|
|
116
|
-
return this.token =
|
|
115
|
+
setToken(e) {
|
|
116
|
+
return this.token = e, this;
|
|
117
117
|
}
|
|
118
|
-
async request(
|
|
118
|
+
async request(e, r, s, i) {
|
|
119
119
|
const a = {
|
|
120
120
|
Accept: "application/json",
|
|
121
121
|
"X-Zenky-Client": this.client,
|
|
@@ -123,7 +123,7 @@ class c {
|
|
|
123
123
|
};
|
|
124
124
|
i ? a.Authorization = `Bearer ${i}` : this.token && (a.Authorization = `Bearer ${this.token}`);
|
|
125
125
|
const u = {
|
|
126
|
-
method:
|
|
126
|
+
method: e,
|
|
127
127
|
mode: "cors",
|
|
128
128
|
...this.fetchOptions
|
|
129
129
|
};
|
|
@@ -131,265 +131,269 @@ class c {
|
|
|
131
131
|
const l = await this.fetchFunction.call(null, `${this.baseUrl}${r}`, u);
|
|
132
132
|
if (l.ok)
|
|
133
133
|
return l.status === 204 ? !0 : l.json();
|
|
134
|
-
throw await
|
|
134
|
+
throw await m.build(l);
|
|
135
135
|
}
|
|
136
136
|
}
|
|
137
|
-
class
|
|
138
|
-
async getStore(
|
|
139
|
-
const r = this.getUrl(`/store/${
|
|
137
|
+
class R extends o {
|
|
138
|
+
async getStore(e) {
|
|
139
|
+
const r = this.getUrl(`/store/${e}`);
|
|
140
140
|
return this.getResponse(await this.client.request("GET", r));
|
|
141
141
|
}
|
|
142
|
-
async getStoreByBundleId(
|
|
143
|
-
const r = this.getUrl(`/store/by-bundle/${
|
|
142
|
+
async getStoreByBundleId(e) {
|
|
143
|
+
const r = this.getUrl(`/store/by-bundle/${e}`);
|
|
144
144
|
return this.getResponse(await this.client.request("GET", r));
|
|
145
145
|
}
|
|
146
146
|
}
|
|
147
147
|
class U extends o {
|
|
148
|
-
async getCollections(
|
|
149
|
-
const s = this.getStoreUrl(
|
|
148
|
+
async getCollections(e, r) {
|
|
149
|
+
const s = this.getStoreUrl(e, "/collections", r);
|
|
150
150
|
return this.getPaginatedResponse(await this.client.request("GET", s));
|
|
151
151
|
}
|
|
152
|
-
async getCollection(
|
|
153
|
-
const s = this.getStoreUrl(
|
|
152
|
+
async getCollection(e, r) {
|
|
153
|
+
const s = this.getStoreUrl(e, `/collections/${r}`);
|
|
154
154
|
return this.getResponse(await this.client.request("GET", s));
|
|
155
155
|
}
|
|
156
156
|
}
|
|
157
157
|
class q extends o {
|
|
158
|
-
async getOffers(
|
|
159
|
-
const s = this.getStoreUrl(
|
|
158
|
+
async getOffers(e, r) {
|
|
159
|
+
const s = this.getStoreUrl(e, "/offers", r);
|
|
160
160
|
return this.getPaginatedResponse(await this.client.request("GET", s));
|
|
161
161
|
}
|
|
162
|
-
async getOffer(
|
|
163
|
-
const i = this.getStoreUrl(
|
|
162
|
+
async getOffer(e, r, s) {
|
|
163
|
+
const i = this.getStoreUrl(e, `/offers/${r}`, s);
|
|
164
164
|
return this.getResponse(await this.client.request("GET", i));
|
|
165
165
|
}
|
|
166
166
|
}
|
|
167
167
|
class O extends o {
|
|
168
|
-
async createFeedback(
|
|
169
|
-
const s = this.getStoreUrl(
|
|
168
|
+
async createFeedback(e, r) {
|
|
169
|
+
const s = this.getStoreUrl(e, "/feedback", r);
|
|
170
170
|
return this.getResponse(await this.client.request("POST", s));
|
|
171
171
|
}
|
|
172
|
-
async createCallback(
|
|
173
|
-
const s = this.getStoreUrl(
|
|
172
|
+
async createCallback(e, r) {
|
|
173
|
+
const s = this.getStoreUrl(e, "/callback", r);
|
|
174
174
|
return await this.client.request("POST", s), !0;
|
|
175
175
|
}
|
|
176
176
|
}
|
|
177
177
|
class f extends o {
|
|
178
|
-
async getProducts(
|
|
179
|
-
const s = this.getStoreUrl(
|
|
178
|
+
async getProducts(e, r) {
|
|
179
|
+
const s = this.getStoreUrl(e, "/products", r);
|
|
180
180
|
return this.getPaginatedResponse(await this.client.request("GET", s));
|
|
181
181
|
}
|
|
182
|
-
async getProduct(
|
|
183
|
-
const i = this.getStoreUrl(
|
|
182
|
+
async getProduct(e, r, s) {
|
|
183
|
+
const i = this.getStoreUrl(e, `/products/${r}`, s);
|
|
184
184
|
return this.getResponse(await this.client.request("GET", i));
|
|
185
185
|
}
|
|
186
|
-
async getProductVariantPrice(
|
|
187
|
-
const a = this.getStoreUrl(
|
|
186
|
+
async getProductVariantPrice(e, r, s, i) {
|
|
187
|
+
const a = this.getStoreUrl(e, `/products/${r}/variants/${s}/price`);
|
|
188
188
|
return this.getResponse(await this.client.request("POST", a, i));
|
|
189
189
|
}
|
|
190
190
|
}
|
|
191
|
-
class
|
|
192
|
-
getOrderUrl(
|
|
191
|
+
class S extends o {
|
|
192
|
+
getOrderUrl(e, r, s, i) {
|
|
193
193
|
const a = typeof r == "string" ? r : r.id, u = typeof r == "string" ? void 0 : r.token;
|
|
194
|
-
return this.getStoreUrl(
|
|
194
|
+
return this.getStoreUrl(e, `/orders/${a}${s}${u ? "?token=" + u : ""}`, i);
|
|
195
195
|
}
|
|
196
|
-
getApiToken(
|
|
197
|
-
if (!(typeof
|
|
198
|
-
return
|
|
196
|
+
getApiToken(e) {
|
|
197
|
+
if (!(typeof e == "string" || typeof e.api_token > "u"))
|
|
198
|
+
return e.api_token;
|
|
199
199
|
}
|
|
200
|
-
async getOrders(
|
|
201
|
-
const i = this.getStoreUrl(
|
|
200
|
+
async getOrders(e, r, s) {
|
|
201
|
+
const i = this.getStoreUrl(e, "/orders", r);
|
|
202
202
|
return this.getPaginatedResponse(await this.client.request("GET", i, void 0, s));
|
|
203
203
|
}
|
|
204
|
-
async createOrder(
|
|
205
|
-
const i = this.getStoreUrl(
|
|
204
|
+
async createOrder(e, r, s) {
|
|
205
|
+
const i = this.getStoreUrl(e, "/orders");
|
|
206
206
|
return this.getResponse(await this.client.request("POST", i, r, s));
|
|
207
207
|
}
|
|
208
|
-
async getOrder(
|
|
209
|
-
const i = this.getOrderUrl(
|
|
208
|
+
async getOrder(e, r, s) {
|
|
209
|
+
const i = this.getOrderUrl(e, r, "", s);
|
|
210
210
|
return this.getResponse(
|
|
211
211
|
await this.client.request("GET", i, void 0, this.getApiToken(r))
|
|
212
212
|
);
|
|
213
213
|
}
|
|
214
|
-
async getOrderSettings(
|
|
215
|
-
const s = this.getOrderUrl(
|
|
214
|
+
async getOrderSettings(e, r) {
|
|
215
|
+
const s = this.getOrderUrl(e, r, "/settings");
|
|
216
216
|
return this.getResponse(
|
|
217
217
|
await this.client.request("GET", s, void 0, this.getApiToken(r))
|
|
218
218
|
);
|
|
219
219
|
}
|
|
220
|
-
async addProductVariantToOrder(
|
|
221
|
-
const i = this.getOrderUrl(
|
|
220
|
+
async addProductVariantToOrder(e, r, s) {
|
|
221
|
+
const i = this.getOrderUrl(e, r, "/products");
|
|
222
222
|
return this.getResponse(
|
|
223
223
|
await this.client.request("POST", i, s, this.getApiToken(r))
|
|
224
224
|
);
|
|
225
225
|
}
|
|
226
|
-
async removeProductVariantFromOrder(
|
|
227
|
-
const i = this.getOrderUrl(
|
|
226
|
+
async removeProductVariantFromOrder(e, r, s) {
|
|
227
|
+
const i = this.getOrderUrl(e, r, "/products");
|
|
228
228
|
return this.getResponse(
|
|
229
229
|
await this.client.request("POST", i, s, this.getApiToken(r))
|
|
230
230
|
);
|
|
231
231
|
}
|
|
232
|
-
async checkProducts(
|
|
233
|
-
const s = this.getOrderUrl(
|
|
232
|
+
async checkProducts(e, r) {
|
|
233
|
+
const s = this.getOrderUrl(e, r, "/products/check");
|
|
234
234
|
return this.getResponse(
|
|
235
235
|
await this.client.request("POST", s, void 0, this.getApiToken(r))
|
|
236
236
|
);
|
|
237
237
|
}
|
|
238
|
-
async setOrderCustomer(
|
|
239
|
-
const i = this.getOrderUrl(
|
|
238
|
+
async setOrderCustomer(e, r, s) {
|
|
239
|
+
const i = this.getOrderUrl(e, r, "/checkout/customer");
|
|
240
240
|
return await this.client.request("POST", i, s, this.getApiToken(r)), !0;
|
|
241
241
|
}
|
|
242
|
-
async setOrderDeliveryMethod(
|
|
243
|
-
const i = this.getOrderUrl(
|
|
242
|
+
async setOrderDeliveryMethod(e, r, s) {
|
|
243
|
+
const i = this.getOrderUrl(e, r, "/checkout/delivery");
|
|
244
244
|
return this.getResponse(
|
|
245
245
|
await this.client.request("POST", i, s, this.getApiToken(r))
|
|
246
246
|
);
|
|
247
247
|
}
|
|
248
|
-
async setOrderPayments(
|
|
249
|
-
const i = this.getOrderUrl(
|
|
248
|
+
async setOrderPayments(e, r, s) {
|
|
249
|
+
const i = this.getOrderUrl(e, r, "/checkout/payments");
|
|
250
250
|
return this.getResponse(
|
|
251
251
|
await this.client.request("POST", i, s, this.getApiToken(r))
|
|
252
252
|
);
|
|
253
253
|
}
|
|
254
|
-
async getOrderBonusesPreview(
|
|
255
|
-
const i = this.getOrderUrl(
|
|
254
|
+
async getOrderBonusesPreview(e, r, s) {
|
|
255
|
+
const i = this.getOrderUrl(e, r, "/checkout/payments/bonuses", { amount: s });
|
|
256
256
|
return this.getResponse(
|
|
257
257
|
await this.client.request("GET", i, void 0, this.getApiToken(r))
|
|
258
258
|
);
|
|
259
259
|
}
|
|
260
|
-
async getOrderTotal(
|
|
261
|
-
const s = this.getOrderUrl(
|
|
260
|
+
async getOrderTotal(e, r) {
|
|
261
|
+
const s = this.getOrderUrl(e, r, "/checkout/total");
|
|
262
262
|
return this.getResponse(
|
|
263
263
|
await this.client.request("GET", s, void 0, this.getApiToken(r))
|
|
264
264
|
);
|
|
265
265
|
}
|
|
266
|
-
async checkoutOrder(
|
|
267
|
-
const i = this.getOrderUrl(
|
|
266
|
+
async checkoutOrder(e, r, s) {
|
|
267
|
+
const i = this.getOrderUrl(e, r, "/checkout");
|
|
268
268
|
return this.getResponse(
|
|
269
269
|
await this.client.request("POST", i, s, this.getApiToken(r))
|
|
270
270
|
);
|
|
271
271
|
}
|
|
272
|
-
async confirmOrder(
|
|
273
|
-
const i = this.getOrderUrl(
|
|
272
|
+
async confirmOrder(e, r, s) {
|
|
273
|
+
const i = this.getOrderUrl(e, r, "/confirm");
|
|
274
274
|
return await this.client.request("POST", i, s, this.getApiToken(r)), !0;
|
|
275
275
|
}
|
|
276
|
-
async resendOrderConfirmationCode(
|
|
277
|
-
const s = this.getOrderUrl(
|
|
276
|
+
async resendOrderConfirmationCode(e, r) {
|
|
277
|
+
const s = this.getOrderUrl(e, r, "/confirm/resend");
|
|
278
278
|
return await this.client.request("POST", s, void 0, this.getApiToken(r)), !0;
|
|
279
279
|
}
|
|
280
|
-
async getOrderBonusesTransactions(
|
|
281
|
-
const i = this.getOrderUrl(
|
|
280
|
+
async getOrderBonusesTransactions(e, r, s) {
|
|
281
|
+
const i = this.getOrderUrl(e, r, "/loyalty/transactions", s);
|
|
282
282
|
return this.getPaginatedResponse(
|
|
283
283
|
await this.client.request("GET", i, void 0, this.getApiToken(r))
|
|
284
284
|
);
|
|
285
285
|
}
|
|
286
|
-
async getOrderCashbackTransaction(
|
|
287
|
-
const s = this.getOrderUrl(
|
|
286
|
+
async getOrderCashbackTransaction(e, r) {
|
|
287
|
+
const s = this.getOrderUrl(e, r, "/loyalty/transactions/cashback");
|
|
288
288
|
return this.getResponse(
|
|
289
289
|
await this.client.request("GET", s, void 0, this.getApiToken(r))
|
|
290
290
|
);
|
|
291
291
|
}
|
|
292
|
-
async dispatchPromotionsChecker(
|
|
293
|
-
const s = this.getOrderUrl(
|
|
292
|
+
async dispatchPromotionsChecker(e, r) {
|
|
293
|
+
const s = this.getOrderUrl(e, r, "/loyalty/promotions/check");
|
|
294
294
|
return this.getResponse(
|
|
295
295
|
await this.client.request("POST", s, void 0, this.getApiToken(r))
|
|
296
296
|
).dispatched;
|
|
297
297
|
}
|
|
298
|
-
async getOrderPromotionRewards(
|
|
299
|
-
const s = this.getOrderUrl(
|
|
298
|
+
async getOrderPromotionRewards(e, r) {
|
|
299
|
+
const s = this.getOrderUrl(e, r, "/loyalty/promotions/rewards");
|
|
300
300
|
return this.getResponse(
|
|
301
301
|
await this.client.request("GET", s, void 0, this.getApiToken(r))
|
|
302
302
|
);
|
|
303
303
|
}
|
|
304
304
|
}
|
|
305
|
-
class
|
|
306
|
-
async getAddressSuggestions(
|
|
307
|
-
const s = this.getStoreUrl(
|
|
305
|
+
class v extends o {
|
|
306
|
+
async getAddressSuggestions(e, r) {
|
|
307
|
+
const s = this.getStoreUrl(e, "/suggestions/address");
|
|
308
308
|
return this.getResponse(await this.client.request("POST", s, r));
|
|
309
309
|
}
|
|
310
310
|
}
|
|
311
|
-
class
|
|
312
|
-
async getProfile(
|
|
313
|
-
const i = this.getStoreUrl(
|
|
311
|
+
class y extends o {
|
|
312
|
+
async getProfile(e, r, s) {
|
|
313
|
+
const i = this.getStoreUrl(e, "/me", r);
|
|
314
314
|
return this.getResponse(await this.client.request("GET", i, null, s));
|
|
315
315
|
}
|
|
316
|
-
async updateProfile(
|
|
317
|
-
const i = this.getStoreUrl(
|
|
316
|
+
async updateProfile(e, r, s) {
|
|
317
|
+
const i = this.getStoreUrl(e, "/me");
|
|
318
318
|
return this.getResponse(await this.client.request("PUT", i, r, s));
|
|
319
319
|
}
|
|
320
|
-
async removeProfile(
|
|
321
|
-
const i = this.getStoreUrl(
|
|
320
|
+
async removeProfile(e, r, s) {
|
|
321
|
+
const i = this.getStoreUrl(e, "/me");
|
|
322
322
|
return await this.client.request("DELETE", i, r, s), !0;
|
|
323
323
|
}
|
|
324
|
-
async getSettings(
|
|
325
|
-
const s = this.getStoreUrl(
|
|
324
|
+
async getSettings(e, r) {
|
|
325
|
+
const s = this.getStoreUrl(e, "/me/settings");
|
|
326
326
|
return this.getResponse(await this.client.request("GET", s, null, r));
|
|
327
327
|
}
|
|
328
|
-
async updateSettings(
|
|
329
|
-
const i = this.getStoreUrl(
|
|
328
|
+
async updateSettings(e, r, s) {
|
|
329
|
+
const i = this.getStoreUrl(e, "/me/settings");
|
|
330
330
|
return this.getResponse(await this.client.request("PUT", i, r, s));
|
|
331
331
|
}
|
|
332
|
-
async getAddresses(
|
|
333
|
-
const i = this.getStoreUrl(
|
|
332
|
+
async getAddresses(e, r, s) {
|
|
333
|
+
const i = this.getStoreUrl(e, "/me/addresses", r);
|
|
334
334
|
return this.getPaginatedResponse(await this.client.request("GET", i, null, s));
|
|
335
335
|
}
|
|
336
|
-
async createAddress(
|
|
337
|
-
const i = this.getStoreUrl(
|
|
336
|
+
async createAddress(e, r, s) {
|
|
337
|
+
const i = this.getStoreUrl(e, "/me/addresses");
|
|
338
338
|
return this.getResponse(await this.client.request("POST", i, r, s));
|
|
339
339
|
}
|
|
340
|
-
async updateAddress(
|
|
341
|
-
const a = this.getStoreUrl(
|
|
340
|
+
async updateAddress(e, r, s, i) {
|
|
341
|
+
const a = this.getStoreUrl(e, `/me/addresses/${r}`);
|
|
342
342
|
return this.getResponse(await this.client.request("PUT", a, s, i));
|
|
343
343
|
}
|
|
344
|
-
async deleteAddress(
|
|
345
|
-
const i = this.getStoreUrl(
|
|
344
|
+
async deleteAddress(e, r, s) {
|
|
345
|
+
const i = this.getStoreUrl(e, `/me/addresses/${r}`);
|
|
346
346
|
return await this.client.request("DELETE", i, null, s), !0;
|
|
347
347
|
}
|
|
348
|
-
async getPaymentMethods(
|
|
349
|
-
const i = this.getStoreUrl(
|
|
348
|
+
async getPaymentMethods(e, r, s) {
|
|
349
|
+
const i = this.getStoreUrl(e, "/me/payment-methods", r);
|
|
350
350
|
return this.getPaginatedResponse(await this.client.request("GET", i, null, s));
|
|
351
351
|
}
|
|
352
|
-
async deletePaymentMethod(
|
|
353
|
-
const i = this.getStoreUrl(
|
|
352
|
+
async deletePaymentMethod(e, r, s) {
|
|
353
|
+
const i = this.getStoreUrl(e, `/me/payment-methods/${r}`);
|
|
354
354
|
return await this.client.request("DELETE", i, null, s), !0;
|
|
355
355
|
}
|
|
356
|
-
async getBonusesTransactions(
|
|
357
|
-
const i = this.getStoreUrl(
|
|
356
|
+
async getBonusesTransactions(e, r, s) {
|
|
357
|
+
const i = this.getStoreUrl(e, "/me/loyalty/transactions", r);
|
|
358
358
|
return this.getPaginatedResponse(await this.client.request("GET", i, null, s));
|
|
359
359
|
}
|
|
360
|
+
async getBonusesBalance(e) {
|
|
361
|
+
const r = this.getStoreUrl(e, "/me/loyalty/balance");
|
|
362
|
+
return this.getResponse(await this.client.request("GET", r, null, null));
|
|
363
|
+
}
|
|
360
364
|
}
|
|
361
|
-
class
|
|
362
|
-
async checkPhone(
|
|
363
|
-
const s = this.getStoreUrl(
|
|
365
|
+
class P extends o {
|
|
366
|
+
async checkPhone(e, r) {
|
|
367
|
+
const s = this.getStoreUrl(e, "/auth/check");
|
|
364
368
|
return this.getResponse(await this.client.request("POST", s, r));
|
|
365
369
|
}
|
|
366
|
-
async register(
|
|
367
|
-
const s = this.getStoreUrl(
|
|
370
|
+
async register(e, r) {
|
|
371
|
+
const s = this.getStoreUrl(e, "/auth/register");
|
|
368
372
|
return this.getResponse(await this.client.request("POST", s, r));
|
|
369
373
|
}
|
|
370
|
-
async confirmRegistration(
|
|
371
|
-
const s = this.getStoreUrl(
|
|
374
|
+
async confirmRegistration(e, r) {
|
|
375
|
+
const s = this.getStoreUrl(e, "/auth/register/confirm");
|
|
372
376
|
return this.getResponse(await this.client.request("POST", s, r));
|
|
373
377
|
}
|
|
374
|
-
async resendRegistrationConfirmation(
|
|
375
|
-
const s = this.getStoreUrl(
|
|
378
|
+
async resendRegistrationConfirmation(e, r) {
|
|
379
|
+
const s = this.getStoreUrl(e, "/auth/register/resend");
|
|
376
380
|
return this.getResponse(await this.client.request("POST", s, r));
|
|
377
381
|
}
|
|
378
|
-
async login(
|
|
379
|
-
const s = this.getStoreUrl(
|
|
382
|
+
async login(e, r) {
|
|
383
|
+
const s = this.getStoreUrl(e, "/auth/login");
|
|
380
384
|
return this.getResponse(await this.client.request("POST", s, r));
|
|
381
385
|
}
|
|
382
|
-
async dispatchPasswordReset(
|
|
383
|
-
const s = this.getStoreUrl(
|
|
386
|
+
async dispatchPasswordReset(e, r) {
|
|
387
|
+
const s = this.getStoreUrl(e, "/auth/password/request");
|
|
384
388
|
return this.getResponse(await this.client.request("POST", s, r));
|
|
385
389
|
}
|
|
386
|
-
async resetPassword(
|
|
387
|
-
const s = this.getStoreUrl(
|
|
390
|
+
async resetPassword(e, r) {
|
|
391
|
+
const s = this.getStoreUrl(e, "/auth/password/reset");
|
|
388
392
|
return this.getResponse(await this.client.request("POST", s, r));
|
|
389
393
|
}
|
|
390
394
|
}
|
|
391
395
|
class te {
|
|
392
|
-
constructor(
|
|
396
|
+
constructor(e, r) {
|
|
393
397
|
n(this, "client");
|
|
394
398
|
n(this, "store");
|
|
395
399
|
n(this, "auth");
|
|
@@ -402,14 +406,14 @@ class te {
|
|
|
402
406
|
n(this, "offers");
|
|
403
407
|
n(this, "articles");
|
|
404
408
|
n(this, "feedback");
|
|
405
|
-
const s = c.build(
|
|
406
|
-
this.store = new
|
|
409
|
+
const s = c.build(e, r);
|
|
410
|
+
this.store = new R(s), this.auth = new P(s), this.customer = new y(s), this.categories = new k(s), this.products = new f(s), this.addresses = new v(s), this.orders = new S(s), this.collections = new U(s), this.offers = new q(s), this.articles = new w(s), this.feedback = new O(s), this.client = s;
|
|
407
411
|
}
|
|
408
|
-
setApiToken(
|
|
409
|
-
return this.client.setToken(
|
|
412
|
+
setApiToken(e) {
|
|
413
|
+
return this.client.setToken(e), this;
|
|
410
414
|
}
|
|
411
415
|
}
|
|
412
|
-
var b = /* @__PURE__ */ ((
|
|
416
|
+
var b = /* @__PURE__ */ ((t) => (t.Female = "female", t.Male = "male", t.Other = "other", t))(b || {}), E = /* @__PURE__ */ ((t) => (t.CloudPayments = "cloudpayments", t))(E || {}), T = /* @__PURE__ */ ((t) => (t.Visa = "visa", t.MasterCard = "master-card", t.MIR = "mir", t.Maestro = "maestro", t.AmericanExpress = "american-express", t.DinersClub = "diners-club", t.Discover = "discover", t.JCB = "jcb", t.UnionPay = "union-pay", t))(T || {}), A = /* @__PURE__ */ ((t) => (t.Select = "select", t.MutipleSelect = "mutiple_select", t.Checkboxes = "checkboxes", t.Radios = "radios", t.Range = "range", t.Text = "text", t))(A || {}), G = /* @__PURE__ */ ((t) => (t.Integer = "integer", t.Float = "float", t))(G || {}), $ = /* @__PURE__ */ ((t) => (t.Increase = "increase", t.Decrease = "decrease", t))($ || {}), C = /* @__PURE__ */ ((t) => (t.Pending = "pending", t.Confirmed = "confirmed", t.Cancelled = "cancelled", t.Rejected = "rejected", t.Refunded = "refunded", t.PartiallyRefunded = "partially_refunded", t))(C || {}), _ = /* @__PURE__ */ ((t) => (t.Manual = "manual", t.Cashback = "cashback", t.ReferralReward = "referral_reward", t.RecruitReward = "recruit_reward", t.Payment = "payment", t.Cancellation = "cancellation", t.Refund = "refund", t.Adjustment = "adjustment", t.WelcomeBonuses = "welcome_bonuses", t.PromotionReward = "promotion_reward", t.External = "external", t))(_ || {}), x = /* @__PURE__ */ ((t) => (t.Delivery = "delivery", t.Pickup = "pickup", t.OnPremise = "on_premise", t))(x || {}), z = /* @__PURE__ */ ((t) => (t.Payment = "payment", t.Refund = "refund", t))(z || {}), I = /* @__PURE__ */ ((t) => (t.Cash = "cash", t.CreditCard = "credit-card", t.CloudPayments = "cloudpayments", t.CardToken = "card_token", t.Bonuses = "bonuses", t))(I || {}), V = /* @__PURE__ */ ((t) => (t.Pending = "pending", t.Confirmed = "confirmed", t.Cancelled = "cancelled", t.PendingRefund = "pending_refund", t.Refunding = "refunding", t.Refunded = "refunded", t))(V || {}), j = /* @__PURE__ */ ((t) => (t.Auth = "auth", t.Charge = "charge", t))(j || {}), D = /* @__PURE__ */ ((t) => (t.PersonsCount = "persons_count", t.DeliveryTime = "delivery_time", t))(D || {}), F = /* @__PURE__ */ ((t) => (t.PriceMismatch = "price_mismatch", t.OutOfStock = "out_of_stock", t.Unavailable = "unavailable", t))(F || {}), L = /* @__PURE__ */ ((t) => (t.None = "none", t.Cleanup = "cleanup", t))(L || {}), M = /* @__PURE__ */ ((t) => (t.Piece = "piece", t.Gram = "gram", t.Kilogram = "kilogram", t.Meter = "meter", t))(M || {}), N = /* @__PURE__ */ ((t) => (t.Weight = "weight", t.Width = "width", t.Height = "height", t.Length = "length", t))(N || {}), W = /* @__PURE__ */ ((t) => (t.Netto = "netto", t.Brutto = "brutto", t))(W || {}), Z = /* @__PURE__ */ ((t) => (t.Color = "color", t))(Z || {}), J = /* @__PURE__ */ ((t) => (t.Category = "category", t.Group = "group", t.VariantOption = "variant_option", t.VariantOptionValue = "variant_option_value", t))(J || {}), X = /* @__PURE__ */ ((t) => (t.Amount = "amount", t.Percentage = "percentage", t))(X || {}), H = /* @__PURE__ */ ((t) => (t.Email = "email", t.Website = "website", t.Vk = "vk", t.Facebook = "facebook", t.Instagram = "instagram", t.Twitter = "twitter", t.Ok = "ok", t.Tiktok = "tiktok", t))(H || {}), Y = /* @__PURE__ */ ((t) => (t.Yes = "yes", t.No = "no", t.Both = "both", t))(Y || {}), K = /* @__PURE__ */ ((t) => (t.Disabled = "disabled", t.Preauth = "preauth", t.Confirmation = "confirmation", t))(K || {}), Q = /* @__PURE__ */ ((t) => (t.Dadata = "dadata", t.Manual = "manual", t))(Q || {}), B = /* @__PURE__ */ ((t) => (t.Registration = "registration", t.ResendRegistrationCode = "resend_registration_code", t.ResetPassword = "reset_password", t.OrderSubmission = "order_submission", t.FeedbackRequest = "feedback_request", t.CallbackRequest = "callback_request", t))(B || {});
|
|
413
417
|
export {
|
|
414
418
|
E as AcquiringType,
|
|
415
419
|
p as AddressSuggestionsProvider,
|
|
@@ -437,17 +441,17 @@ export {
|
|
|
437
441
|
D as OrderOptionKind,
|
|
438
442
|
V as OrderPaymentTransactionStatus,
|
|
439
443
|
z as OrderPaymentTransactionType,
|
|
440
|
-
|
|
444
|
+
S as OrdersResource,
|
|
441
445
|
I as PaymentMethod,
|
|
442
446
|
T as PaymentSystemType,
|
|
443
447
|
J as ProductContextType,
|
|
444
448
|
f as ProductsResource,
|
|
445
449
|
B as RecaptchaAction,
|
|
446
|
-
|
|
450
|
+
R as StoreResource,
|
|
447
451
|
Y as TernaryFilter,
|
|
448
452
|
M as UnitType,
|
|
449
453
|
Z as VariantOptionType,
|
|
450
454
|
h as ZenkyError,
|
|
451
|
-
|
|
455
|
+
m as ZenkyErrorBuilder,
|
|
452
456
|
te as ZenkyStorefront
|
|
453
457
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(n,c){typeof exports=="object"&&typeof module<"u"?c(exports):typeof define=="function"&&define.amd?define(["exports"],c):(n=typeof globalThis<"u"?globalThis:n||self,c(n.zenkyStorefrontApi={}))})(this,function(n){"use strict";var ee=Object.defineProperty;var te=(n,c,o)=>c in n?ee(n,c,{enumerable:!0,configurable:!0,writable:!0,value:o}):n[c]=o;var a=(n,c,o)=>(te(n,typeof c!="symbol"?c+"":c,o),o);var c=(e=>(e.DADATA="dadata",e))(c||{});class o{constructor(t){this.client=t}getStoreUrl(t,r,s={}){return this.getUrl(`/store/${t}${r}`,s)}getUrl(t,r={}){if(!Object.keys(r).length)return t;const s=[];Object.keys(r).forEach(u=>{s.push(`${u}=${r[u]}`)});const i=t.includes("?")?"&":"?";return`${t}${i}${s.join("&")}`}getPaginatedResponse(t){if(!t||!Array.isArray(t.data)||!t.meta||!t.meta.pagination)throw new Error("getPaginatedResponse(): Invalid response.");const r=t.data,s=t.meta.pagination;return{items:r,pagination:s}}getResponse(t){if(!t||!t.data)throw new Error("getResponse(): Invalid response.");return t.data}}class w extends o{async getArticleCategories(t){const r=this.getStoreUrl(t,"/articles/categories");return this.getPaginatedResponse(await this.client.request("GET",r))}async getArticleCategory(t,r){const s=this.getStoreUrl(t,`/articles/categories/${r}`);return this.getResponse(await this.client.request("GET",s))}async getArticles(t,r){const s=this.getStoreUrl(t,"/articles",r);return this.getPaginatedResponse(await this.client.request("GET",s))}async getArticle(t,r,s){const i=this.getStoreUrl(t,`/articles/${r}`,s);return this.getResponse(await this.client.request("GET",i))}}class p extends o{async getCategories(t,r){const s=this.getStoreUrl(t,"/categories",r);return this.getPaginatedResponse(await this.client.request("GET",s))}async getCategoriesTree(t,r){const s=this.getStoreUrl(t,"/categories/tree",r);return this.getResponse(await this.client.request("GET",s))}async getCategory(t,r,s){const i=this.getStoreUrl(t,`/categories/${r}`,s);return this.getResponse(await this.client.request("GET",i))}async getFeaturesGroups(t,r){const s=this.getStoreUrl(t,`/categories/${r}/features/groups`);return this.getResponse(await this.client.request("GET",s))}async getFeatures(t,r){const s=this.getStoreUrl(t,`/categories/${r}/features`);return this.getResponse(await this.client.request("GET",s))}}class d extends Error{constructor(r,s){super(r);a(this,"err");this.err=s}}class k{static async build(t){const r=await t.json();switch(t.status){case 401:return new d((r==null?void 0:r.message)??"Unauthenticated.",null);default:return new d(r==null?void 0:r.message,(r==null?void 0:r.error)||null)}}}class g{constructor(t,r,s,i,u,l){a(this,"baseUrl");a(this,"token");a(this,"client");a(this,"timezone");a(this,"fetchFunction");a(this,"fetchOptions");this.baseUrl=t,this.token=r,this.client=s,this.timezone=i,this.fetchFunction=typeof u=="function"?u:fetch,this.fetchOptions=typeof l<"u"?l:{}}static build(t,r){return new g((t==null?void 0:t.baseUrl)||"https://storefront.zenky.io/v1",(t==null?void 0:t.token)||null,(t==null?void 0:t.client)||"web",(t==null?void 0:t.timezone)||"UTC",r,t==null?void 0:t.fetchOptions)}setToken(t){return this.token=t,this}async request(t,r,s,i){const u={Accept:"application/json","X-Zenky-Client":this.client,"X-Timezone":this.timezone};i?u.Authorization=`Bearer ${i}`:this.token&&(u.Authorization=`Bearer ${this.token}`);const l={method:t,mode:"cors",...this.fetchOptions};s&&(u["Content-Type"]="application/json",l.body=JSON.stringify(s)),l.headers=u;const h=await this.fetchFunction.call(null,`${this.baseUrl}${r}`,l);if(h.ok)return h.status===204?!0:h.json();throw await k.build(h)}}class R extends o{async getStore(t){const r=this.getUrl(`/store/${t}`);return this.getResponse(await this.client.request("GET",r))}async getStoreByBundleId(t){const r=this.getUrl(`/store/by-bundle/${t}`);return this.getResponse(await this.client.request("GET",r))}}class m extends o{async getCollections(t,r){const s=this.getStoreUrl(t,"/collections",r);return this.getPaginatedResponse(await this.client.request("GET",s))}async getCollection(t,r){const s=this.getStoreUrl(t,`/collections/${r}`);return this.getResponse(await this.client.request("GET",s))}}class y extends o{async getOffers(t,r){const s=this.getStoreUrl(t,"/offers",r);return this.getPaginatedResponse(await this.client.request("GET",s))}async getOffer(t,r,s){const i=this.getStoreUrl(t,`/offers/${r}`,s);return this.getResponse(await this.client.request("GET",i))}}class f extends o{async createFeedback(t,r){const s=this.getStoreUrl(t,"/feedback",r);return this.getResponse(await this.client.request("POST",s))}async createCallback(t,r){const s=this.getStoreUrl(t,"/callback",r);return await this.client.request("POST",s),!0}}class O extends o{async getProducts(t,r){const s=this.getStoreUrl(t,"/products",r);return this.getPaginatedResponse(await this.client.request("GET",s))}async getProduct(t,r,s){const i=this.getStoreUrl(t,`/products/${r}`,s);return this.getResponse(await this.client.request("GET",i))}async getProductVariantPrice(t,r,s,i){const u=this.getStoreUrl(t,`/products/${r}/variants/${s}/price`);return this.getResponse(await this.client.request("POST",u,i))}}class U extends o{getOrderUrl(t,r,s,i){const u=typeof r=="string"?r:r.id,l=typeof r=="string"?void 0:r.token;return this.getStoreUrl(t,`/orders/${u}${s}${l?"?token="+l:""}`,i)}getApiToken(t){if(!(typeof t=="string"||typeof t.api_token>"u"))return t.api_token}async getOrders(t,r,s){const i=this.getStoreUrl(t,"/orders",r);return this.getPaginatedResponse(await this.client.request("GET",i,void 0,s))}async createOrder(t,r,s){const i=this.getStoreUrl(t,"/orders");return this.getResponse(await this.client.request("POST",i,r,s))}async getOrder(t,r,s){const i=this.getOrderUrl(t,r,"",s);return this.getResponse(await this.client.request("GET",i,void 0,this.getApiToken(r)))}async getOrderSettings(t,r){const s=this.getOrderUrl(t,r,"/settings");return this.getResponse(await this.client.request("GET",s,void 0,this.getApiToken(r)))}async addProductVariantToOrder(t,r,s){const i=this.getOrderUrl(t,r,"/products");return this.getResponse(await this.client.request("POST",i,s,this.getApiToken(r)))}async removeProductVariantFromOrder(t,r,s){const i=this.getOrderUrl(t,r,"/products");return this.getResponse(await this.client.request("POST",i,s,this.getApiToken(r)))}async checkProducts(t,r){const s=this.getOrderUrl(t,r,"/products/check");return this.getResponse(await this.client.request("POST",s,void 0,this.getApiToken(r)))}async setOrderCustomer(t,r,s){const i=this.getOrderUrl(t,r,"/checkout/customer");return await this.client.request("POST",i,s,this.getApiToken(r)),!0}async setOrderDeliveryMethod(t,r,s){const i=this.getOrderUrl(t,r,"/checkout/delivery");return this.getResponse(await this.client.request("POST",i,s,this.getApiToken(r)))}async setOrderPayments(t,r,s){const i=this.getOrderUrl(t,r,"/checkout/payments");return this.getResponse(await this.client.request("POST",i,s,this.getApiToken(r)))}async getOrderBonusesPreview(t,r,s){const i=this.getOrderUrl(t,r,"/checkout/bonuses/preview",{amount:s});return this.getResponse(await this.client.request("GET",i,void 0,this.getApiToken(r)))}async getOrderTotal(t,r){const s=this.getOrderUrl(t,r,"/checkout/total");return this.getResponse(await this.client.request("GET",s,void 0,this.getApiToken(r)))}async checkoutOrder(t,r,s){const i=this.getOrderUrl(t,r,"/checkout");return this.getResponse(await this.client.request("POST",i,s,this.getApiToken(r)))}async confirmOrder(t,r,s){const i=this.getOrderUrl(t,r,"/confirm");return await this.client.request("POST",i,s,this.getApiToken(r)),!0}async resendOrderConfirmationCode(t,r){const s=this.getOrderUrl(t,r,"/confirm/resend");return await this.client.request("POST",s,void 0,this.getApiToken(r)),!0}async getOrderBonusesTransactions(t,r,s){const i=this.getOrderUrl(t,r,"/loyalty/transactions",s);return this.getPaginatedResponse(await this.client.request("GET",i,void 0,this.getApiToken(r)))}async getOrderCashbackTransaction(t,r){const s=this.getOrderUrl(t,r,"/loyalty/transactions/cashback");return this.getResponse(await this.client.request("GET",s,void 0,this.getApiToken(r)))}async dispatchPromotionsChecker(t,r){const s=this.getOrderUrl(t,r,"/loyalty/promotions/check");return this.getResponse(await this.client.request("POST",s,void 0,this.getApiToken(r))).dispatched}async getOrderPromotionRewards(t,r){const s=this.getOrderUrl(t,r,"/loyalty/promotions/rewards");return this.getResponse(await this.client.request("GET",s,void 0,this.getApiToken(r)))}}class K extends o{async getAddressSuggestions(t,r){const s=this.getStoreUrl(t,"/suggestions/address");return this.getResponse(await this.client.request("POST",s,r))}}class Y extends o{async getProfile(t,r,s){const i=this.getStoreUrl(t,"/me",r);return this.getResponse(await this.client.request("GET",i,null,s))}async updateProfile(t,r,s){const i=this.getStoreUrl(t,"/me");return this.getResponse(await this.client.request("PUT",i,r,s))}async removeProfile(t,r,s){const i=this.getStoreUrl(t,"/me");return await this.client.request("DELETE",i,r,s),!0}async getSettings(t,r){const s=this.getStoreUrl(t,"/me/settings");return this.getResponse(await this.client.request("GET",s,null,r))}async updateSettings(t,r,s){const i=this.getStoreUrl(t,"/me/settings");return this.getResponse(await this.client.request("PUT",i,r,s))}async getAddresses(t,r,s){const i=this.getStoreUrl(t,"/me/addresses",r);return this.getPaginatedResponse(await this.client.request("GET",i,null,s))}async createAddress(t,r,s){const i=this.getStoreUrl(t,"/me/addresses");return this.getResponse(await this.client.request("POST",i,r,s))}async updateAddress(t,r,s,i){const u=this.getStoreUrl(t,`/me/addresses/${r}`);return this.getResponse(await this.client.request("PUT",u,s,i))}async deleteAddress(t,r,s){const i=this.getStoreUrl(t,`/me/addresses/${r}`);return await this.client.request("DELETE",i,null,s),!0}async getPaymentMethods(t,r,s){const i=this.getStoreUrl(t,"/me/payment-methods",r);return this.getPaginatedResponse(await this.client.request("GET",i,null,s))}async deletePaymentMethod(t,r,s){const i=this.getStoreUrl(t,`/me/payment-methods/${r}`);return await this.client.request("DELETE",i,null,s),!0}async getBonusesTransactions(t,r,s){const i=this.getStoreUrl(t,"/me/loyalty/transactions",r);return this.getPaginatedResponse(await this.client.request("GET",i,null,s))}}class Q extends o{async checkPhone(t,r){const s=this.getStoreUrl(t,"/auth/check");return this.getResponse(await this.client.request("POST",s,r))}async register(t,r){const s=this.getStoreUrl(t,"/auth/register");return this.getResponse(await this.client.request("POST",s,r))}async confirmRegistration(t,r){const s=this.getStoreUrl(t,"/auth/register/confirm");return this.getResponse(await this.client.request("POST",s,r))}async resendRegistrationConfirmation(t,r){const s=this.getStoreUrl(t,"/auth/register/resend");return this.getResponse(await this.client.request("POST",s,r))}async login(t,r){const s=this.getStoreUrl(t,"/auth/login");return this.getResponse(await this.client.request("POST",s,r))}async dispatchPasswordReset(t,r){const s=this.getStoreUrl(t,"/auth/password/request");return this.getResponse(await this.client.request("POST",s,r))}async resetPassword(t,r){const s=this.getStoreUrl(t,"/auth/password/reset");return this.getResponse(await this.client.request("POST",s,r))}}class x{constructor(t,r){a(this,"client");a(this,"store");a(this,"auth");a(this,"customer");a(this,"categories");a(this,"products");a(this,"addresses");a(this,"orders");a(this,"collections");a(this,"offers");a(this,"articles");a(this,"feedback");const s=g.build(t,r);this.store=new R(s),this.auth=new Q(s),this.customer=new Y(s),this.categories=new p(s),this.products=new O(s),this.addresses=new K(s),this.orders=new U(s),this.collections=new m(s),this.offers=new y(s),this.articles=new w(s),this.feedback=new f(s),this.client=s}setApiToken(t){return this.client.setToken(t),this}}var S=(e=>(e.Female="female",e.Male="male",e.Other="other",e))(S||{}),v=(e=>(e.CloudPayments="cloudpayments",e))(v||{}),q=(e=>(e.Visa="visa",e.MasterCard="master-card",e.MIR="mir",e.Maestro="maestro",e.AmericanExpress="american-express",e.DinersClub="diners-club",e.Discover="discover",e.JCB="jcb",e.UnionPay="union-pay",e))(q||{}),P=(e=>(e.Select="select",e.MutipleSelect="mutiple_select",e.Checkboxes="checkboxes",e.Radios="radios",e.Range="range",e.Text="text",e))(P||{}),T=(e=>(e.Integer="integer",e.Float="float",e))(T||{}),b=(e=>(e.Increase="increase",e.Decrease="decrease",e))(b||{}),E=(e=>(e.Pending="pending",e.Confirmed="confirmed",e.Cancelled="cancelled",e.Rejected="rejected",e.Refunded="refunded",e.PartiallyRefunded="partially_refunded",e))(E||{}),A=(e=>(e.Manual="manual",e.Cashback="cashback",e.ReferralReward="referral_reward",e.RecruitReward="recruit_reward",e.Payment="payment",e.Cancellation="cancellation",e.Refund="refund",e.Adjustment="adjustment",e.WelcomeBonuses="welcome_bonuses",e.PromotionReward="promotion_reward",e.External="external",e))(A||{}),C=(e=>(e.Delivery="delivery",e.Pickup="pickup",e.OnPremise="on_premise",e))(C||{}),G=(e=>(e.Payment="payment",e.Refund="refund",e))(G||{}),$=(e=>(e.Cash="cash",e.CreditCard="credit-card",e.CloudPayments="cloudpayments",e.CardToken="card_token",e.Bonuses="bonuses",e))($||{}),_=(e=>(e.Pending="pending",e.Confirmed="confirmed",e.Cancelled="cancelled",e.PendingRefund="pending_refund",e.Refunding="refunding",e.Refunded="refunded",e))(_||{}),D=(e=>(e.Auth="auth",e.Charge="charge",e))(D||{}),j=(e=>(e.PersonsCount="persons_count",e.DeliveryTime="delivery_time",e))(j||{}),z=(e=>(e.PriceMismatch="price_mismatch",e.OutOfStock="out_of_stock",e.Unavailable="unavailable",e))(z||{}),V=(e=>(e.None="none",e.Cleanup="cleanup",e))(V||{}),F=(e=>(e.Piece="piece",e.Gram="gram",e.Kilogram="kilogram",e.Meter="meter",e))(F||{}),I=(e=>(e.Weight="weight",e.Width="width",e.Height="height",e.Length="length",e))(I||{}),M=(e=>(e.Netto="netto",e.Brutto="brutto",e))(M||{}),Z=(e=>(e.Color="color",e))(Z||{}),L=(e=>(e.Category="category",e.Group="group",e.VariantOption="variant_option",e.VariantOptionValue="variant_option_value",e))(L||{}),N=(e=>(e.Amount="amount",e.Percentage="percentage",e))(N||{}),W=(e=>(e.Email="email",e.Website="website",e.Vk="vk",e.Facebook="facebook",e.Instagram="instagram",e.Twitter="twitter",e.Ok="ok",e.Tiktok="tiktok",e))(W||{}),J=(e=>(e.Yes="yes",e.No="no",e.Both="both",e))(J||{}),X=(e=>(e.Disabled="disabled",e.Preauth="preauth",e.Confirmation="confirmation",e))(X||{}),B=(e=>(e.Dadata="dadata",e.Manual="manual",e))(B||{}),H=(e=>(e.Registration="registration",e.ResendRegistrationCode="resend_registration_code",e.ResetPassword="reset_password",e.OrderSubmission="order_submission",e.FeedbackRequest="feedback_request",e.CallbackRequest="callback_request",e))(H||{});n.AcquiringType=v,n.AddressSuggestionsProvider=c,n.AddressesProvider=B,n.ArticlesResource=w,n.BonusesTransactionReason=A,n.BonusesTransactionStatus=E,n.BonusesTransactionType=b,n.CategoriesResource=p,n.CloudpaymentsChargeType=D,n.CollectionsResource=m,n.ContactType=W,n.DeliveryMethod=C,n.Dimension=I,n.DimensionType=M,n.DiscountType=N,n.FeatureRange=T,n.FeatureType=P,n.FeedbackResource=f,n.Gender=S,n.OffersResource=y,n.OrderAuthenticationMethod=X,n.OrderCartCheckerResultAction=V,n.OrderCartCheckerResultReason=z,n.OrderOptionKind=j,n.OrderPaymentTransactionStatus=_,n.OrderPaymentTransactionType=G,n.OrdersResource=U,n.PaymentMethod=$,n.PaymentSystemType=q,n.ProductContextType=L,n.ProductsResource=O,n.RecaptchaAction=H,n.StoreResource=R,n.TernaryFilter=J,n.UnitType=F,n.VariantOptionType=Z,n.ZenkyError=d,n.ZenkyErrorBuilder=k,n.ZenkyStorefront=x,Object.defineProperty(n,Symbol.toStringTag,{value:"Module"})});
|
|
1
|
+
(function(n,c){typeof exports=="object"&&typeof module<"u"?c(exports):typeof define=="function"&&define.amd?define(["exports"],c):(n=typeof globalThis<"u"?globalThis:n||self,c(n.zenkyStorefrontApi={}))})(this,function(n){"use strict";var ee=Object.defineProperty;var te=(n,c,o)=>c in n?ee(n,c,{enumerable:!0,configurable:!0,writable:!0,value:o}):n[c]=o;var a=(n,c,o)=>(te(n,typeof c!="symbol"?c+"":c,o),o);var c=(e=>(e.DADATA="dadata",e))(c||{});class o{constructor(t){this.client=t}getStoreUrl(t,r,s={}){return this.getUrl(`/store/${t}${r}`,s)}getUrl(t,r={}){if(!Object.keys(r).length)return t;const s=[];Object.keys(r).forEach(u=>{s.push(`${u}=${r[u]}`)});const i=t.includes("?")?"&":"?";return`${t}${i}${s.join("&")}`}getPaginatedResponse(t){if(!t||!Array.isArray(t.data)||!t.meta||!t.meta.pagination)throw new Error("getPaginatedResponse(): Invalid response.");const r=t.data,s=t.meta.pagination;return{items:r,pagination:s}}getResponse(t){if(!t||!t.data)throw new Error("getResponse(): Invalid response.");return t.data}}class w extends o{async getArticleCategories(t){const r=this.getStoreUrl(t,"/articles/categories");return this.getPaginatedResponse(await this.client.request("GET",r))}async getArticleCategory(t,r){const s=this.getStoreUrl(t,`/articles/categories/${r}`);return this.getResponse(await this.client.request("GET",s))}async getArticles(t,r){const s=this.getStoreUrl(t,"/articles",r);return this.getPaginatedResponse(await this.client.request("GET",s))}async getArticle(t,r,s){const i=this.getStoreUrl(t,`/articles/${r}`,s);return this.getResponse(await this.client.request("GET",i))}}class p extends o{async getCategories(t,r){const s=this.getStoreUrl(t,"/categories",r);return this.getPaginatedResponse(await this.client.request("GET",s))}async getCategoriesTree(t,r){const s=this.getStoreUrl(t,"/categories/tree",r);return this.getResponse(await this.client.request("GET",s))}async getCategory(t,r,s){const i=this.getStoreUrl(t,`/categories/${r}`,s);return this.getResponse(await this.client.request("GET",i))}async getFeaturesGroups(t,r){const s=this.getStoreUrl(t,`/categories/${r}/features/groups`);return this.getResponse(await this.client.request("GET",s))}async getFeatures(t,r){const s=this.getStoreUrl(t,`/categories/${r}/features`);return this.getResponse(await this.client.request("GET",s))}}class g extends Error{constructor(r,s){super(r);a(this,"err");this.err=s}}class k{static async build(t){const r=await t.json();switch(t.status){case 401:return new g((r==null?void 0:r.message)??"Unauthenticated.",null);default:return new g(r==null?void 0:r.message,(r==null?void 0:r.error)||null)}}}class d{constructor(t,r,s,i,u,l){a(this,"baseUrl");a(this,"token");a(this,"client");a(this,"timezone");a(this,"fetchFunction");a(this,"fetchOptions");this.baseUrl=t,this.token=r,this.client=s,this.timezone=i,this.fetchFunction=typeof u=="function"?u:fetch,this.fetchOptions=typeof l<"u"?l:{}}static build(t,r){return new d((t==null?void 0:t.baseUrl)||"https://storefront.zenky.io/v1",(t==null?void 0:t.token)||null,(t==null?void 0:t.client)||"web",(t==null?void 0:t.timezone)||"UTC",r,t==null?void 0:t.fetchOptions)}setToken(t){return this.token=t,this}async request(t,r,s,i){const u={Accept:"application/json","X-Zenky-Client":this.client,"X-Timezone":this.timezone};i?u.Authorization=`Bearer ${i}`:this.token&&(u.Authorization=`Bearer ${this.token}`);const l={method:t,mode:"cors",...this.fetchOptions};s&&(u["Content-Type"]="application/json",l.body=JSON.stringify(s)),l.headers=u;const h=await this.fetchFunction.call(null,`${this.baseUrl}${r}`,l);if(h.ok)return h.status===204?!0:h.json();throw await k.build(h)}}class R extends o{async getStore(t){const r=this.getUrl(`/store/${t}`);return this.getResponse(await this.client.request("GET",r))}async getStoreByBundleId(t){const r=this.getUrl(`/store/by-bundle/${t}`);return this.getResponse(await this.client.request("GET",r))}}class y extends o{async getCollections(t,r){const s=this.getStoreUrl(t,"/collections",r);return this.getPaginatedResponse(await this.client.request("GET",s))}async getCollection(t,r){const s=this.getStoreUrl(t,`/collections/${r}`);return this.getResponse(await this.client.request("GET",s))}}class m extends o{async getOffers(t,r){const s=this.getStoreUrl(t,"/offers",r);return this.getPaginatedResponse(await this.client.request("GET",s))}async getOffer(t,r,s){const i=this.getStoreUrl(t,`/offers/${r}`,s);return this.getResponse(await this.client.request("GET",i))}}class f extends o{async createFeedback(t,r){const s=this.getStoreUrl(t,"/feedback",r);return this.getResponse(await this.client.request("POST",s))}async createCallback(t,r){const s=this.getStoreUrl(t,"/callback",r);return await this.client.request("POST",s),!0}}class O extends o{async getProducts(t,r){const s=this.getStoreUrl(t,"/products",r);return this.getPaginatedResponse(await this.client.request("GET",s))}async getProduct(t,r,s){const i=this.getStoreUrl(t,`/products/${r}`,s);return this.getResponse(await this.client.request("GET",i))}async getProductVariantPrice(t,r,s,i){const u=this.getStoreUrl(t,`/products/${r}/variants/${s}/price`);return this.getResponse(await this.client.request("POST",u,i))}}class U extends o{getOrderUrl(t,r,s,i){const u=typeof r=="string"?r:r.id,l=typeof r=="string"?void 0:r.token;return this.getStoreUrl(t,`/orders/${u}${s}${l?"?token="+l:""}`,i)}getApiToken(t){if(!(typeof t=="string"||typeof t.api_token>"u"))return t.api_token}async getOrders(t,r,s){const i=this.getStoreUrl(t,"/orders",r);return this.getPaginatedResponse(await this.client.request("GET",i,void 0,s))}async createOrder(t,r,s){const i=this.getStoreUrl(t,"/orders");return this.getResponse(await this.client.request("POST",i,r,s))}async getOrder(t,r,s){const i=this.getOrderUrl(t,r,"",s);return this.getResponse(await this.client.request("GET",i,void 0,this.getApiToken(r)))}async getOrderSettings(t,r){const s=this.getOrderUrl(t,r,"/settings");return this.getResponse(await this.client.request("GET",s,void 0,this.getApiToken(r)))}async addProductVariantToOrder(t,r,s){const i=this.getOrderUrl(t,r,"/products");return this.getResponse(await this.client.request("POST",i,s,this.getApiToken(r)))}async removeProductVariantFromOrder(t,r,s){const i=this.getOrderUrl(t,r,"/products");return this.getResponse(await this.client.request("POST",i,s,this.getApiToken(r)))}async checkProducts(t,r){const s=this.getOrderUrl(t,r,"/products/check");return this.getResponse(await this.client.request("POST",s,void 0,this.getApiToken(r)))}async setOrderCustomer(t,r,s){const i=this.getOrderUrl(t,r,"/checkout/customer");return await this.client.request("POST",i,s,this.getApiToken(r)),!0}async setOrderDeliveryMethod(t,r,s){const i=this.getOrderUrl(t,r,"/checkout/delivery");return this.getResponse(await this.client.request("POST",i,s,this.getApiToken(r)))}async setOrderPayments(t,r,s){const i=this.getOrderUrl(t,r,"/checkout/payments");return this.getResponse(await this.client.request("POST",i,s,this.getApiToken(r)))}async getOrderBonusesPreview(t,r,s){const i=this.getOrderUrl(t,r,"/checkout/payments/bonuses",{amount:s});return this.getResponse(await this.client.request("GET",i,void 0,this.getApiToken(r)))}async getOrderTotal(t,r){const s=this.getOrderUrl(t,r,"/checkout/total");return this.getResponse(await this.client.request("GET",s,void 0,this.getApiToken(r)))}async checkoutOrder(t,r,s){const i=this.getOrderUrl(t,r,"/checkout");return this.getResponse(await this.client.request("POST",i,s,this.getApiToken(r)))}async confirmOrder(t,r,s){const i=this.getOrderUrl(t,r,"/confirm");return await this.client.request("POST",i,s,this.getApiToken(r)),!0}async resendOrderConfirmationCode(t,r){const s=this.getOrderUrl(t,r,"/confirm/resend");return await this.client.request("POST",s,void 0,this.getApiToken(r)),!0}async getOrderBonusesTransactions(t,r,s){const i=this.getOrderUrl(t,r,"/loyalty/transactions",s);return this.getPaginatedResponse(await this.client.request("GET",i,void 0,this.getApiToken(r)))}async getOrderCashbackTransaction(t,r){const s=this.getOrderUrl(t,r,"/loyalty/transactions/cashback");return this.getResponse(await this.client.request("GET",s,void 0,this.getApiToken(r)))}async dispatchPromotionsChecker(t,r){const s=this.getOrderUrl(t,r,"/loyalty/promotions/check");return this.getResponse(await this.client.request("POST",s,void 0,this.getApiToken(r))).dispatched}async getOrderPromotionRewards(t,r){const s=this.getOrderUrl(t,r,"/loyalty/promotions/rewards");return this.getResponse(await this.client.request("GET",s,void 0,this.getApiToken(r)))}}class K extends o{async getAddressSuggestions(t,r){const s=this.getStoreUrl(t,"/suggestions/address");return this.getResponse(await this.client.request("POST",s,r))}}class Y extends o{async getProfile(t,r,s){const i=this.getStoreUrl(t,"/me",r);return this.getResponse(await this.client.request("GET",i,null,s))}async updateProfile(t,r,s){const i=this.getStoreUrl(t,"/me");return this.getResponse(await this.client.request("PUT",i,r,s))}async removeProfile(t,r,s){const i=this.getStoreUrl(t,"/me");return await this.client.request("DELETE",i,r,s),!0}async getSettings(t,r){const s=this.getStoreUrl(t,"/me/settings");return this.getResponse(await this.client.request("GET",s,null,r))}async updateSettings(t,r,s){const i=this.getStoreUrl(t,"/me/settings");return this.getResponse(await this.client.request("PUT",i,r,s))}async getAddresses(t,r,s){const i=this.getStoreUrl(t,"/me/addresses",r);return this.getPaginatedResponse(await this.client.request("GET",i,null,s))}async createAddress(t,r,s){const i=this.getStoreUrl(t,"/me/addresses");return this.getResponse(await this.client.request("POST",i,r,s))}async updateAddress(t,r,s,i){const u=this.getStoreUrl(t,`/me/addresses/${r}`);return this.getResponse(await this.client.request("PUT",u,s,i))}async deleteAddress(t,r,s){const i=this.getStoreUrl(t,`/me/addresses/${r}`);return await this.client.request("DELETE",i,null,s),!0}async getPaymentMethods(t,r,s){const i=this.getStoreUrl(t,"/me/payment-methods",r);return this.getPaginatedResponse(await this.client.request("GET",i,null,s))}async deletePaymentMethod(t,r,s){const i=this.getStoreUrl(t,`/me/payment-methods/${r}`);return await this.client.request("DELETE",i,null,s),!0}async getBonusesTransactions(t,r,s){const i=this.getStoreUrl(t,"/me/loyalty/transactions",r);return this.getPaginatedResponse(await this.client.request("GET",i,null,s))}async getBonusesBalance(t){const r=this.getStoreUrl(t,"/me/loyalty/balance");return this.getResponse(await this.client.request("GET",r,null,null))}}class Q extends o{async checkPhone(t,r){const s=this.getStoreUrl(t,"/auth/check");return this.getResponse(await this.client.request("POST",s,r))}async register(t,r){const s=this.getStoreUrl(t,"/auth/register");return this.getResponse(await this.client.request("POST",s,r))}async confirmRegistration(t,r){const s=this.getStoreUrl(t,"/auth/register/confirm");return this.getResponse(await this.client.request("POST",s,r))}async resendRegistrationConfirmation(t,r){const s=this.getStoreUrl(t,"/auth/register/resend");return this.getResponse(await this.client.request("POST",s,r))}async login(t,r){const s=this.getStoreUrl(t,"/auth/login");return this.getResponse(await this.client.request("POST",s,r))}async dispatchPasswordReset(t,r){const s=this.getStoreUrl(t,"/auth/password/request");return this.getResponse(await this.client.request("POST",s,r))}async resetPassword(t,r){const s=this.getStoreUrl(t,"/auth/password/reset");return this.getResponse(await this.client.request("POST",s,r))}}class x{constructor(t,r){a(this,"client");a(this,"store");a(this,"auth");a(this,"customer");a(this,"categories");a(this,"products");a(this,"addresses");a(this,"orders");a(this,"collections");a(this,"offers");a(this,"articles");a(this,"feedback");const s=d.build(t,r);this.store=new R(s),this.auth=new Q(s),this.customer=new Y(s),this.categories=new p(s),this.products=new O(s),this.addresses=new K(s),this.orders=new U(s),this.collections=new y(s),this.offers=new m(s),this.articles=new w(s),this.feedback=new f(s),this.client=s}setApiToken(t){return this.client.setToken(t),this}}var S=(e=>(e.Female="female",e.Male="male",e.Other="other",e))(S||{}),q=(e=>(e.CloudPayments="cloudpayments",e))(q||{}),v=(e=>(e.Visa="visa",e.MasterCard="master-card",e.MIR="mir",e.Maestro="maestro",e.AmericanExpress="american-express",e.DinersClub="diners-club",e.Discover="discover",e.JCB="jcb",e.UnionPay="union-pay",e))(v||{}),P=(e=>(e.Select="select",e.MutipleSelect="mutiple_select",e.Checkboxes="checkboxes",e.Radios="radios",e.Range="range",e.Text="text",e))(P||{}),T=(e=>(e.Integer="integer",e.Float="float",e))(T||{}),b=(e=>(e.Increase="increase",e.Decrease="decrease",e))(b||{}),E=(e=>(e.Pending="pending",e.Confirmed="confirmed",e.Cancelled="cancelled",e.Rejected="rejected",e.Refunded="refunded",e.PartiallyRefunded="partially_refunded",e))(E||{}),A=(e=>(e.Manual="manual",e.Cashback="cashback",e.ReferralReward="referral_reward",e.RecruitReward="recruit_reward",e.Payment="payment",e.Cancellation="cancellation",e.Refund="refund",e.Adjustment="adjustment",e.WelcomeBonuses="welcome_bonuses",e.PromotionReward="promotion_reward",e.External="external",e))(A||{}),C=(e=>(e.Delivery="delivery",e.Pickup="pickup",e.OnPremise="on_premise",e))(C||{}),G=(e=>(e.Payment="payment",e.Refund="refund",e))(G||{}),$=(e=>(e.Cash="cash",e.CreditCard="credit-card",e.CloudPayments="cloudpayments",e.CardToken="card_token",e.Bonuses="bonuses",e))($||{}),_=(e=>(e.Pending="pending",e.Confirmed="confirmed",e.Cancelled="cancelled",e.PendingRefund="pending_refund",e.Refunding="refunding",e.Refunded="refunded",e))(_||{}),D=(e=>(e.Auth="auth",e.Charge="charge",e))(D||{}),j=(e=>(e.PersonsCount="persons_count",e.DeliveryTime="delivery_time",e))(j||{}),z=(e=>(e.PriceMismatch="price_mismatch",e.OutOfStock="out_of_stock",e.Unavailable="unavailable",e))(z||{}),V=(e=>(e.None="none",e.Cleanup="cleanup",e))(V||{}),F=(e=>(e.Piece="piece",e.Gram="gram",e.Kilogram="kilogram",e.Meter="meter",e))(F||{}),I=(e=>(e.Weight="weight",e.Width="width",e.Height="height",e.Length="length",e))(I||{}),M=(e=>(e.Netto="netto",e.Brutto="brutto",e))(M||{}),Z=(e=>(e.Color="color",e))(Z||{}),L=(e=>(e.Category="category",e.Group="group",e.VariantOption="variant_option",e.VariantOptionValue="variant_option_value",e))(L||{}),N=(e=>(e.Amount="amount",e.Percentage="percentage",e))(N||{}),W=(e=>(e.Email="email",e.Website="website",e.Vk="vk",e.Facebook="facebook",e.Instagram="instagram",e.Twitter="twitter",e.Ok="ok",e.Tiktok="tiktok",e))(W||{}),B=(e=>(e.Yes="yes",e.No="no",e.Both="both",e))(B||{}),J=(e=>(e.Disabled="disabled",e.Preauth="preauth",e.Confirmation="confirmation",e))(J||{}),X=(e=>(e.Dadata="dadata",e.Manual="manual",e))(X||{}),H=(e=>(e.Registration="registration",e.ResendRegistrationCode="resend_registration_code",e.ResetPassword="reset_password",e.OrderSubmission="order_submission",e.FeedbackRequest="feedback_request",e.CallbackRequest="callback_request",e))(H||{});n.AcquiringType=q,n.AddressSuggestionsProvider=c,n.AddressesProvider=X,n.ArticlesResource=w,n.BonusesTransactionReason=A,n.BonusesTransactionStatus=E,n.BonusesTransactionType=b,n.CategoriesResource=p,n.CloudpaymentsChargeType=D,n.CollectionsResource=y,n.ContactType=W,n.DeliveryMethod=C,n.Dimension=I,n.DimensionType=M,n.DiscountType=N,n.FeatureRange=T,n.FeatureType=P,n.FeedbackResource=f,n.Gender=S,n.OffersResource=m,n.OrderAuthenticationMethod=J,n.OrderCartCheckerResultAction=V,n.OrderCartCheckerResultReason=z,n.OrderOptionKind=j,n.OrderPaymentTransactionStatus=_,n.OrderPaymentTransactionType=G,n.OrdersResource=U,n.PaymentMethod=$,n.PaymentSystemType=v,n.ProductContextType=L,n.ProductsResource=O,n.RecaptchaAction=H,n.StoreResource=R,n.TernaryFilter=B,n.UnitType=F,n.VariantOptionType=Z,n.ZenkyError=g,n.ZenkyErrorBuilder=k,n.ZenkyStorefront=x,Object.defineProperty(n,Symbol.toStringTag,{value:"Module"})});
|