@zenky/storefront-api 0.0.23 → 0.0.25
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
CHANGED
|
@@ -1113,12 +1113,30 @@ export interface OrderDeliveryMethod {
|
|
|
1113
1113
|
}
|
|
1114
1114
|
export declare enum OrderOptionKind {
|
|
1115
1115
|
PersonsCount = "persons_count",
|
|
1116
|
-
DeliveryTime = "delivery_time"
|
|
1116
|
+
DeliveryTime = "delivery_time",
|
|
1117
|
+
DeliveryIntervals = "delivery_intervals"
|
|
1118
|
+
}
|
|
1119
|
+
export interface DeliveryInterval {
|
|
1120
|
+
id: string;
|
|
1121
|
+
name: string;
|
|
1122
|
+
description: string | null;
|
|
1123
|
+
price: number | null;
|
|
1124
|
+
}
|
|
1125
|
+
export interface DeliveryIntervalsGroup {
|
|
1126
|
+
day_id: "monday" | "tuesday" | "wednesday" | "thursday" | "friday" | "saturday" | "sunday";
|
|
1127
|
+
date: string;
|
|
1128
|
+
name: string;
|
|
1129
|
+
intervals: DeliveryInterval[];
|
|
1130
|
+
}
|
|
1131
|
+
export interface DeliveryIntervalsMeta {
|
|
1132
|
+
is_required: boolean;
|
|
1133
|
+
delivery_methods: DeliveryMethod[];
|
|
1134
|
+
intervals: DeliveryIntervalsGroup[];
|
|
1117
1135
|
}
|
|
1118
1136
|
export interface OrderOption {
|
|
1119
1137
|
id: string;
|
|
1120
1138
|
kind: OrderOptionKind;
|
|
1121
|
-
meta:
|
|
1139
|
+
meta: DeliveryIntervalsMeta | null;
|
|
1122
1140
|
}
|
|
1123
1141
|
export interface OrderSettings {
|
|
1124
1142
|
payment_methods: OrderPaymentMethod[];
|
|
@@ -1255,6 +1273,7 @@ export declare class OrdersResource extends AbstractResource {
|
|
|
1255
1273
|
addProductVariantToOrder(storeId: string, credentials: OrderCredentials, request: OrderProductVariantRequest): Promise<Order>;
|
|
1256
1274
|
removeProductVariantFromOrder(storeId: string, credentials: OrderCredentials, request: OrderProductVariantRequest): Promise<Order>;
|
|
1257
1275
|
checkProducts(storeId: string, credentials: OrderCredentials): Promise<OrderCartCheckerResult>;
|
|
1276
|
+
getOrderCheckoutUrl(storeId: string, credentials: OrderCredentials, redirectUrl?: string): Promise<string>;
|
|
1258
1277
|
setOrderCustomer(storeId: string, credentials: OrderCredentials, request: SetOrderCustomerRequest): Promise<boolean>;
|
|
1259
1278
|
setOrderDeliveryMethod(storeId: string, credentials: OrderCredentials, request: SetOrderDeliveryRequest): Promise<Order>;
|
|
1260
1279
|
setOrderPayments(storeId: string, credentials: OrderCredentials, request: SetOrderPaymentsRequest): Promise<Order>;
|
|
@@ -81,7 +81,7 @@ class h extends Error {
|
|
|
81
81
|
this.err = s;
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
|
-
class
|
|
84
|
+
class R {
|
|
85
85
|
static async build(e) {
|
|
86
86
|
const r = await e.json();
|
|
87
87
|
switch (e.status) {
|
|
@@ -131,10 +131,10 @@ 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 R.build(l);
|
|
135
135
|
}
|
|
136
136
|
}
|
|
137
|
-
class
|
|
137
|
+
class m extends o {
|
|
138
138
|
async getStore(e) {
|
|
139
139
|
const r = this.getUrl(`/store/${e}`);
|
|
140
140
|
return this.getResponse(await this.client.request("GET", r));
|
|
@@ -164,7 +164,7 @@ class q extends o {
|
|
|
164
164
|
return this.getResponse(await this.client.request("GET", i));
|
|
165
165
|
}
|
|
166
166
|
}
|
|
167
|
-
class
|
|
167
|
+
class v extends o {
|
|
168
168
|
async createFeedback(e, r) {
|
|
169
169
|
const s = this.getStoreUrl(e, "/feedback", r);
|
|
170
170
|
return this.getResponse(await this.client.request("POST", s));
|
|
@@ -174,7 +174,7 @@ class O extends o {
|
|
|
174
174
|
return await this.client.request("POST", s), !0;
|
|
175
175
|
}
|
|
176
176
|
}
|
|
177
|
-
class
|
|
177
|
+
class O extends o {
|
|
178
178
|
async getProducts(e, r) {
|
|
179
179
|
const s = this.getStoreUrl(e, "/products", r);
|
|
180
180
|
return this.getPaginatedResponse(await this.client.request("GET", s));
|
|
@@ -188,7 +188,7 @@ class f extends o {
|
|
|
188
188
|
return this.getResponse(await this.client.request("POST", a, i));
|
|
189
189
|
}
|
|
190
190
|
}
|
|
191
|
-
class
|
|
191
|
+
class y extends o {
|
|
192
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
194
|
return this.getStoreUrl(e, `/orders/${a}${s}${u ? "?token=" + u : ""}`, i);
|
|
@@ -235,6 +235,12 @@ class v extends o {
|
|
|
235
235
|
await this.client.request("POST", s, void 0, this.getApiToken(r))
|
|
236
236
|
);
|
|
237
237
|
}
|
|
238
|
+
async getOrderCheckoutUrl(e, r, s) {
|
|
239
|
+
const i = this.getOrderUrl(e, r, "/checkout/url");
|
|
240
|
+
return this.getResponse(
|
|
241
|
+
await this.client.request("POST", i, { redirect_url: s }, this.getApiToken(r))
|
|
242
|
+
).url;
|
|
243
|
+
}
|
|
238
244
|
async setOrderCustomer(e, r, s) {
|
|
239
245
|
const i = this.getOrderUrl(e, r, "/checkout/customer");
|
|
240
246
|
return await this.client.request("POST", i, s, this.getApiToken(r)), !0;
|
|
@@ -308,13 +314,13 @@ class v extends o {
|
|
|
308
314
|
);
|
|
309
315
|
}
|
|
310
316
|
}
|
|
311
|
-
class
|
|
317
|
+
class S extends o {
|
|
312
318
|
async getAddressSuggestions(e, r) {
|
|
313
319
|
const s = this.getStoreUrl(e, "/suggestions/address");
|
|
314
320
|
return this.getResponse(await this.client.request("POST", s, r));
|
|
315
321
|
}
|
|
316
322
|
}
|
|
317
|
-
class
|
|
323
|
+
class f extends o {
|
|
318
324
|
async getProfile(e, r, s) {
|
|
319
325
|
const i = this.getStoreUrl(e, "/me", r);
|
|
320
326
|
return this.getResponse(await this.client.request("GET", i, null, s));
|
|
@@ -413,17 +419,17 @@ class te {
|
|
|
413
419
|
n(this, "articles");
|
|
414
420
|
n(this, "feedback");
|
|
415
421
|
const s = c.build(e, r);
|
|
416
|
-
this.store = new
|
|
422
|
+
this.store = new m(s), this.auth = new P(s), this.customer = new f(s), this.categories = new k(s), this.products = new O(s), this.addresses = new S(s), this.orders = new y(s), this.collections = new U(s), this.offers = new q(s), this.articles = new w(s), this.feedback = new v(s), this.client = s;
|
|
417
423
|
}
|
|
418
424
|
setApiToken(e) {
|
|
419
425
|
return this.client.setToken(e), this;
|
|
420
426
|
}
|
|
421
427
|
}
|
|
422
|
-
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 || {}),
|
|
428
|
+
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 || {}), I = /* @__PURE__ */ ((t) => (t.Payment = "payment", t.Refund = "refund", t))(I || {}), z = /* @__PURE__ */ ((t) => (t.Cash = "cash", t.CreditCard = "credit-card", t.CloudPayments = "cloudpayments", t.CardToken = "card_token", t.Bonuses = "bonuses", t))(z || {}), 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.DeliveryIntervals = "delivery_intervals", 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 || {}), Q = /* @__PURE__ */ ((t) => (t.Disabled = "disabled", t.Preauth = "preauth", t.Confirmation = "confirmation", t))(Q || {}), B = /* @__PURE__ */ ((t) => (t.Dadata = "dadata", t.Manual = "manual", t))(B || {}), K = /* @__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))(K || {});
|
|
423
429
|
export {
|
|
424
430
|
E as AcquiringType,
|
|
425
431
|
p as AddressSuggestionsProvider,
|
|
426
|
-
|
|
432
|
+
B as AddressesProvider,
|
|
427
433
|
w as ArticlesResource,
|
|
428
434
|
_ as BonusesTransactionReason,
|
|
429
435
|
C as BonusesTransactionStatus,
|
|
@@ -438,26 +444,26 @@ export {
|
|
|
438
444
|
X as DiscountType,
|
|
439
445
|
G as FeatureRange,
|
|
440
446
|
A as FeatureType,
|
|
441
|
-
|
|
447
|
+
v as FeedbackResource,
|
|
442
448
|
b as Gender,
|
|
443
449
|
q as OffersResource,
|
|
444
|
-
|
|
450
|
+
Q as OrderAuthenticationMethod,
|
|
445
451
|
L as OrderCartCheckerResultAction,
|
|
446
452
|
F as OrderCartCheckerResultReason,
|
|
447
453
|
D as OrderOptionKind,
|
|
448
454
|
V as OrderPaymentTransactionStatus,
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
455
|
+
I as OrderPaymentTransactionType,
|
|
456
|
+
y as OrdersResource,
|
|
457
|
+
z as PaymentMethod,
|
|
452
458
|
T as PaymentSystemType,
|
|
453
459
|
J as ProductContextType,
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
460
|
+
O as ProductsResource,
|
|
461
|
+
K as RecaptchaAction,
|
|
462
|
+
m as StoreResource,
|
|
457
463
|
Y as TernaryFilter,
|
|
458
464
|
M as UnitType,
|
|
459
465
|
Z as VariantOptionType,
|
|
460
466
|
h as ZenkyError,
|
|
461
|
-
|
|
467
|
+
R as ZenkyErrorBuilder,
|
|
462
468
|
te as ZenkyStorefront
|
|
463
469
|
};
|
|
@@ -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=(t=>(t.DADATA="dadata",t))(c||{});class o{constructor(e){this.client=e}getStoreUrl(e,r,s={}){return this.getUrl(`/store/${e}${r}`,s)}getUrl(e,r={}){if(!Object.keys(r).length)return e;const s=[];Object.keys(r).forEach(u=>{s.push(`${u}=${r[u]}`)});const i=e.includes("?")?"&":"?";return`${e}${i}${s.join("&")}`}getPaginatedResponse(e){if(!e||!Array.isArray(e.data)||!e.meta||!e.meta.pagination)throw new Error("getPaginatedResponse(): Invalid response.");const r=e.data,s=e.meta.pagination;return{items:r,pagination:s}}getResponse(e){if(!e||!e.data)throw new Error("getResponse(): Invalid response.");return e.data}}class w extends o{async getArticleCategories(e){const r=this.getStoreUrl(e,"/articles/categories");return this.getPaginatedResponse(await this.client.request("GET",r))}async getArticleCategory(e,r){const s=this.getStoreUrl(e,`/articles/categories/${r}`);return this.getResponse(await this.client.request("GET",s))}async getArticles(e,r){const s=this.getStoreUrl(e,"/articles",r);return this.getPaginatedResponse(await this.client.request("GET",s))}async getArticle(e,r,s){const i=this.getStoreUrl(e,`/articles/${r}`,s);return this.getResponse(await this.client.request("GET",i))}}class p extends o{async getCategories(e,r){const s=this.getStoreUrl(e,"/categories",r);return this.getPaginatedResponse(await this.client.request("GET",s))}async getCategoriesTree(e,r){const s=this.getStoreUrl(e,"/categories/tree",r);return this.getResponse(await this.client.request("GET",s))}async getCategory(e,r,s){const i=this.getStoreUrl(e,`/categories/${r}`,s);return this.getResponse(await this.client.request("GET",i))}async getFeaturesGroups(e,r){const s=this.getStoreUrl(e,`/categories/${r}/features/groups`);return this.getResponse(await this.client.request("GET",s))}async getFeatures(e,r){const s=this.getStoreUrl(e,`/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(e){const r=await e.json();switch(e.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(e,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=e,this.token=r,this.client=s,this.timezone=i,this.fetchFunction=typeof u=="function"?u:fetch,this.fetchOptions=typeof l<"u"?l:{}}static build(e,r){return new d((e==null?void 0:e.baseUrl)||"https://storefront.zenky.io/v1",(e==null?void 0:e.token)||null,(e==null?void 0:e.client)||"web",(e==null?void 0:e.timezone)||"UTC",r,e==null?void 0:e.fetchOptions)}setToken(e){return this.token=e,this}async request(e,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:e,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(e){const r=this.getUrl(`/store/${e}`);return this.getResponse(await this.client.request("GET",r))}async getStoreByBundleId(e){const r=this.getUrl(`/store/by-bundle/${e}`);return this.getResponse(await this.client.request("GET",r))}}class y extends o{async getCollections(e,r){const s=this.getStoreUrl(e,"/collections",r);return this.getPaginatedResponse(await this.client.request("GET",s))}async getCollection(e,r){const s=this.getStoreUrl(e,`/collections/${r}`);return this.getResponse(await this.client.request("GET",s))}}class m extends o{async getOffers(e,r){const s=this.getStoreUrl(e,"/offers",r);return this.getPaginatedResponse(await this.client.request("GET",s))}async getOffer(e,r,s){const i=this.getStoreUrl(e,`/offers/${r}`,s);return this.getResponse(await this.client.request("GET",i))}}class f extends o{async createFeedback(e,r){const s=this.getStoreUrl(e,"/feedback",r);return this.getResponse(await this.client.request("POST",s))}async createCallback(e,r){const s=this.getStoreUrl(e,"/callback",r);return await this.client.request("POST",s),!0}}class O extends o{async getProducts(e,r){const s=this.getStoreUrl(e,"/products",r);return this.getPaginatedResponse(await this.client.request("GET",s))}async getProduct(e,r,s){const i=this.getStoreUrl(e,`/products/${r}`,s);return this.getResponse(await this.client.request("GET",i))}async getProductVariantPrice(e,r,s,i){const u=this.getStoreUrl(e,`/products/${r}/variants/${s}/price`);return this.getResponse(await this.client.request("POST",u,i))}}class U extends o{getOrderUrl(e,r,s,i){const u=typeof r=="string"?r:r.id,l=typeof r=="string"?void 0:r.token;return this.getStoreUrl(e,`/orders/${u}${s}${l?"?token="+l:""}`,i)}getApiToken(e){if(!(typeof e=="string"||typeof e.api_token>"u"))return e.api_token}async getOrders(e,r,s){const i=this.getStoreUrl(e,"/orders",r);return this.getPaginatedResponse(await this.client.request("GET",i,void 0,s))}async createOrder(e,r,s){const i=this.getStoreUrl(e,"/orders");return this.getResponse(await this.client.request("POST",i,r,s))}async getOrder(e,r,s){const i=this.getOrderUrl(e,r,"",s);return this.getResponse(await this.client.request("GET",i,void 0,this.getApiToken(r)))}async getOrderSettings(e,r){const s=this.getOrderUrl(e,r,"/settings");return this.getResponse(await this.client.request("GET",s,void 0,this.getApiToken(r)))}async addProductVariantToOrder(e,r,s){const i=this.getOrderUrl(e,r,"/products");return this.getResponse(await this.client.request("POST",i,s,this.getApiToken(r)))}async removeProductVariantFromOrder(e,r,s){const i=this.getOrderUrl(e,r,"/products");return this.getResponse(await this.client.request("POST",i,s,this.getApiToken(r)))}async checkProducts(e,r){const s=this.getOrderUrl(e,r,"/products/check");return this.getResponse(await this.client.request("POST",s,void 0,this.getApiToken(r)))}async setOrderCustomer(e,r,s){const i=this.getOrderUrl(e,r,"/checkout/customer");return await this.client.request("POST",i,s,this.getApiToken(r)),!0}async setOrderDeliveryMethod(e,r,s){const i=this.getOrderUrl(e,r,"/checkout/delivery");return this.getResponse(await this.client.request("POST",i,s,this.getApiToken(r)))}async setOrderPayments(e,r,s){const i=this.getOrderUrl(e,r,"/checkout/payments");return this.getResponse(await this.client.request("POST",i,s,this.getApiToken(r)))}async getOrderBonusesPreview(e,r,s){const i=this.getOrderUrl(e,r,"/checkout/payments/bonuses",{amount:s});return this.getResponse(await this.client.request("GET",i,void 0,this.getApiToken(r)))}async getOrderTotal(e,r){const s=this.getOrderUrl(e,r,"/checkout/total");return this.getResponse(await this.client.request("GET",s,void 0,this.getApiToken(r)))}async checkoutOrder(e,r,s){const i=this.getOrderUrl(e,r,"/checkout");return this.getResponse(await this.client.request("POST",i,s,this.getApiToken(r)))}async confirmOrder(e,r,s){const i=this.getOrderUrl(e,r,"/confirm");return await this.client.request("POST",i,s,this.getApiToken(r)),!0}async resendOrderConfirmationCode(e,r){const s=this.getOrderUrl(e,r,"/confirm/resend");return await this.client.request("POST",s,void 0,this.getApiToken(r)),!0}async getOrderBonusesTransactions(e,r,s){const i=this.getOrderUrl(e,r,"/loyalty/transactions",s);return this.getPaginatedResponse(await this.client.request("GET",i,void 0,this.getApiToken(r)))}async getOrderCashbackTransaction(e,r){const s=this.getOrderUrl(e,r,"/loyalty/transactions/cashback");return this.getResponse(await this.client.request("GET",s,void 0,this.getApiToken(r)))}async dispatchPromotionsChecker(e,r){const s=this.getOrderUrl(e,r,"/loyalty/promotions/check");return this.getResponse(await this.client.request("POST",s,void 0,this.getApiToken(r))).dispatched}async getOrderPromotionRewards(e,r){const s=this.getOrderUrl(e,r,"/loyalty/promotions/rewards");return this.getResponse(await this.client.request("GET",s,void 0,this.getApiToken(r)))}async getCloudpaymentsReceipt(e,r,s){const i=this.getOrderUrl(e,r,`/payments/${s}/receipt`);return this.getResponse(await this.client.request("GET",i,void 0,this.getApiToken(r)))}}class K extends o{async getAddressSuggestions(e,r){const s=this.getStoreUrl(e,"/suggestions/address");return this.getResponse(await this.client.request("POST",s,r))}}class Y extends o{async getProfile(e,r,s){const i=this.getStoreUrl(e,"/me",r);return this.getResponse(await this.client.request("GET",i,null,s))}async updateProfile(e,r,s){const i=this.getStoreUrl(e,"/me");return this.getResponse(await this.client.request("PUT",i,r,s))}async removeProfile(e,r,s){const i=this.getStoreUrl(e,"/me");return await this.client.request("DELETE",i,r,s),!0}async getSettings(e,r){const s=this.getStoreUrl(e,"/me/settings");return this.getResponse(await this.client.request("GET",s,null,r))}async updateSettings(e,r,s){const i=this.getStoreUrl(e,"/me/settings");return this.getResponse(await this.client.request("PUT",i,r,s))}async getAddresses(e,r,s){const i=this.getStoreUrl(e,"/me/addresses",r);return this.getPaginatedResponse(await this.client.request("GET",i,null,s))}async createAddress(e,r,s){const i=this.getStoreUrl(e,"/me/addresses");return this.getResponse(await this.client.request("POST",i,r,s))}async updateAddress(e,r,s,i){const u=this.getStoreUrl(e,`/me/addresses/${r}`);return this.getResponse(await this.client.request("PUT",u,s,i))}async deleteAddress(e,r,s){const i=this.getStoreUrl(e,`/me/addresses/${r}`);return await this.client.request("DELETE",i,null,s),!0}async getPaymentMethods(e,r,s){const i=this.getStoreUrl(e,"/me/payment-methods",r);return this.getPaginatedResponse(await this.client.request("GET",i,null,s))}async deletePaymentMethod(e,r,s){const i=this.getStoreUrl(e,`/me/payment-methods/${r}`);return await this.client.request("DELETE",i,null,s),!0}async getBonusesTransactions(e,r,s){const i=this.getStoreUrl(e,"/me/loyalty/transactions",r);return this.getPaginatedResponse(await this.client.request("GET",i,null,s))}async getBonusesBalance(e){const r=this.getStoreUrl(e,"/me/loyalty/balance");return this.getResponse(await this.client.request("GET",r,null,null))}}class Q extends o{async checkPhone(e,r){const s=this.getStoreUrl(e,"/auth/check");return this.getResponse(await this.client.request("POST",s,r))}async register(e,r){const s=this.getStoreUrl(e,"/auth/register");return this.getResponse(await this.client.request("POST",s,r))}async confirmRegistration(e,r){const s=this.getStoreUrl(e,"/auth/register/confirm");return this.getResponse(await this.client.request("POST",s,r))}async resendRegistrationConfirmation(e,r){const s=this.getStoreUrl(e,"/auth/register/resend");return this.getResponse(await this.client.request("POST",s,r))}async login(e,r){const s=this.getStoreUrl(e,"/auth/login");return this.getResponse(await this.client.request("POST",s,r))}async dispatchPasswordReset(e,r){const s=this.getStoreUrl(e,"/auth/password/request");return this.getResponse(await this.client.request("POST",s,r))}async resetPassword(e,r){const s=this.getStoreUrl(e,"/auth/password/reset");return this.getResponse(await this.client.request("POST",s,r))}}class x{constructor(e,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(e,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(e){return this.client.setToken(e),this}}var S=(t=>(t.Female="female",t.Male="male",t.Other="other",t))(S||{}),q=(t=>(t.CloudPayments="cloudpayments",t))(q||{}),v=(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))(v||{}),P=(t=>(t.Select="select",t.MutipleSelect="mutiple_select",t.Checkboxes="checkboxes",t.Radios="radios",t.Range="range",t.Text="text",t))(P||{}),T=(t=>(t.Integer="integer",t.Float="float",t))(T||{}),b=(t=>(t.Increase="increase",t.Decrease="decrease",t))(b||{}),E=(t=>(t.Pending="pending",t.Confirmed="confirmed",t.Cancelled="cancelled",t.Rejected="rejected",t.Refunded="refunded",t.PartiallyRefunded="partially_refunded",t))(E||{}),A=(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))(A||{}),C=(t=>(t.Delivery="delivery",t.Pickup="pickup",t.OnPremise="on_premise",t))(C||{}),G=(t=>(t.Payment="payment",t.Refund="refund",t))(G||{}),$=(t=>(t.Cash="cash",t.CreditCard="credit-card",t.CloudPayments="cloudpayments",t.CardToken="card_token",t.Bonuses="bonuses",t))($||{}),_=(t=>(t.Pending="pending",t.Confirmed="confirmed",t.Cancelled="cancelled",t.PendingRefund="pending_refund",t.Refunding="refunding",t.Refunded="refunded",t))(_||{}),D=(t=>(t.Auth="auth",t.Charge="charge",t))(D||{}),j=(t=>(t.PersonsCount="persons_count",t.DeliveryTime="delivery_time",t))(j||{}),z=(t=>(t.PriceMismatch="price_mismatch",t.OutOfStock="out_of_stock",t.Unavailable="unavailable",t))(z||{}),V=(t=>(t.None="none",t.Cleanup="cleanup",t))(V||{}),F=(t=>(t.Piece="piece",t.Gram="gram",t.Kilogram="kilogram",t.Meter="meter",t))(F||{}),I=(t=>(t.Weight="weight",t.Width="width",t.Height="height",t.Length="length",t))(I||{}),M=(t=>(t.Netto="netto",t.Brutto="brutto",t))(M||{}),Z=(t=>(t.Color="color",t))(Z||{}),L=(t=>(t.Category="category",t.Group="group",t.VariantOption="variant_option",t.VariantOptionValue="variant_option_value",t))(L||{}),N=(t=>(t.Amount="amount",t.Percentage="percentage",t))(N||{}),W=(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))(W||{}),B=(t=>(t.Yes="yes",t.No="no",t.Both="both",t))(B||{}),J=(t=>(t.Disabled="disabled",t.Preauth="preauth",t.Confirmation="confirmation",t))(J||{}),X=(t=>(t.Dadata="dadata",t.Manual="manual",t))(X||{}),H=(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))(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"})});
|
|
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=(t=>(t.DADATA="dadata",t))(c||{});class o{constructor(e){this.client=e}getStoreUrl(e,r,s={}){return this.getUrl(`/store/${e}${r}`,s)}getUrl(e,r={}){if(!Object.keys(r).length)return e;const s=[];Object.keys(r).forEach(u=>{s.push(`${u}=${r[u]}`)});const i=e.includes("?")?"&":"?";return`${e}${i}${s.join("&")}`}getPaginatedResponse(e){if(!e||!Array.isArray(e.data)||!e.meta||!e.meta.pagination)throw new Error("getPaginatedResponse(): Invalid response.");const r=e.data,s=e.meta.pagination;return{items:r,pagination:s}}getResponse(e){if(!e||!e.data)throw new Error("getResponse(): Invalid response.");return e.data}}class p extends o{async getArticleCategories(e){const r=this.getStoreUrl(e,"/articles/categories");return this.getPaginatedResponse(await this.client.request("GET",r))}async getArticleCategory(e,r){const s=this.getStoreUrl(e,`/articles/categories/${r}`);return this.getResponse(await this.client.request("GET",s))}async getArticles(e,r){const s=this.getStoreUrl(e,"/articles",r);return this.getPaginatedResponse(await this.client.request("GET",s))}async getArticle(e,r,s){const i=this.getStoreUrl(e,`/articles/${r}`,s);return this.getResponse(await this.client.request("GET",i))}}class w extends o{async getCategories(e,r){const s=this.getStoreUrl(e,"/categories",r);return this.getPaginatedResponse(await this.client.request("GET",s))}async getCategoriesTree(e,r){const s=this.getStoreUrl(e,"/categories/tree",r);return this.getResponse(await this.client.request("GET",s))}async getCategory(e,r,s){const i=this.getStoreUrl(e,`/categories/${r}`,s);return this.getResponse(await this.client.request("GET",i))}async getFeaturesGroups(e,r){const s=this.getStoreUrl(e,`/categories/${r}/features/groups`);return this.getResponse(await this.client.request("GET",s))}async getFeatures(e,r){const s=this.getStoreUrl(e,`/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(e){const r=await e.json();switch(e.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(e,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=e,this.token=r,this.client=s,this.timezone=i,this.fetchFunction=typeof u=="function"?u:fetch,this.fetchOptions=typeof l<"u"?l:{}}static build(e,r){return new d((e==null?void 0:e.baseUrl)||"https://storefront.zenky.io/v1",(e==null?void 0:e.token)||null,(e==null?void 0:e.client)||"web",(e==null?void 0:e.timezone)||"UTC",r,e==null?void 0:e.fetchOptions)}setToken(e){return this.token=e,this}async request(e,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:e,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 y extends o{async getStore(e){const r=this.getUrl(`/store/${e}`);return this.getResponse(await this.client.request("GET",r))}async getStoreByBundleId(e){const r=this.getUrl(`/store/by-bundle/${e}`);return this.getResponse(await this.client.request("GET",r))}}class R extends o{async getCollections(e,r){const s=this.getStoreUrl(e,"/collections",r);return this.getPaginatedResponse(await this.client.request("GET",s))}async getCollection(e,r){const s=this.getStoreUrl(e,`/collections/${r}`);return this.getResponse(await this.client.request("GET",s))}}class m extends o{async getOffers(e,r){const s=this.getStoreUrl(e,"/offers",r);return this.getPaginatedResponse(await this.client.request("GET",s))}async getOffer(e,r,s){const i=this.getStoreUrl(e,`/offers/${r}`,s);return this.getResponse(await this.client.request("GET",i))}}class f extends o{async createFeedback(e,r){const s=this.getStoreUrl(e,"/feedback",r);return this.getResponse(await this.client.request("POST",s))}async createCallback(e,r){const s=this.getStoreUrl(e,"/callback",r);return await this.client.request("POST",s),!0}}class U extends o{async getProducts(e,r){const s=this.getStoreUrl(e,"/products",r);return this.getPaginatedResponse(await this.client.request("GET",s))}async getProduct(e,r,s){const i=this.getStoreUrl(e,`/products/${r}`,s);return this.getResponse(await this.client.request("GET",i))}async getProductVariantPrice(e,r,s,i){const u=this.getStoreUrl(e,`/products/${r}/variants/${s}/price`);return this.getResponse(await this.client.request("POST",u,i))}}class O extends o{getOrderUrl(e,r,s,i){const u=typeof r=="string"?r:r.id,l=typeof r=="string"?void 0:r.token;return this.getStoreUrl(e,`/orders/${u}${s}${l?"?token="+l:""}`,i)}getApiToken(e){if(!(typeof e=="string"||typeof e.api_token>"u"))return e.api_token}async getOrders(e,r,s){const i=this.getStoreUrl(e,"/orders",r);return this.getPaginatedResponse(await this.client.request("GET",i,void 0,s))}async createOrder(e,r,s){const i=this.getStoreUrl(e,"/orders");return this.getResponse(await this.client.request("POST",i,r,s))}async getOrder(e,r,s){const i=this.getOrderUrl(e,r,"",s);return this.getResponse(await this.client.request("GET",i,void 0,this.getApiToken(r)))}async getOrderSettings(e,r){const s=this.getOrderUrl(e,r,"/settings");return this.getResponse(await this.client.request("GET",s,void 0,this.getApiToken(r)))}async addProductVariantToOrder(e,r,s){const i=this.getOrderUrl(e,r,"/products");return this.getResponse(await this.client.request("POST",i,s,this.getApiToken(r)))}async removeProductVariantFromOrder(e,r,s){const i=this.getOrderUrl(e,r,"/products");return this.getResponse(await this.client.request("POST",i,s,this.getApiToken(r)))}async checkProducts(e,r){const s=this.getOrderUrl(e,r,"/products/check");return this.getResponse(await this.client.request("POST",s,void 0,this.getApiToken(r)))}async getOrderCheckoutUrl(e,r,s){const i=this.getOrderUrl(e,r,"/checkout/url");return this.getResponse(await this.client.request("POST",i,{redirect_url:s},this.getApiToken(r))).url}async setOrderCustomer(e,r,s){const i=this.getOrderUrl(e,r,"/checkout/customer");return await this.client.request("POST",i,s,this.getApiToken(r)),!0}async setOrderDeliveryMethod(e,r,s){const i=this.getOrderUrl(e,r,"/checkout/delivery");return this.getResponse(await this.client.request("POST",i,s,this.getApiToken(r)))}async setOrderPayments(e,r,s){const i=this.getOrderUrl(e,r,"/checkout/payments");return this.getResponse(await this.client.request("POST",i,s,this.getApiToken(r)))}async getOrderBonusesPreview(e,r,s){const i=this.getOrderUrl(e,r,"/checkout/payments/bonuses",{amount:s});return this.getResponse(await this.client.request("GET",i,void 0,this.getApiToken(r)))}async getOrderTotal(e,r){const s=this.getOrderUrl(e,r,"/checkout/total");return this.getResponse(await this.client.request("GET",s,void 0,this.getApiToken(r)))}async checkoutOrder(e,r,s){const i=this.getOrderUrl(e,r,"/checkout");return this.getResponse(await this.client.request("POST",i,s,this.getApiToken(r)))}async confirmOrder(e,r,s){const i=this.getOrderUrl(e,r,"/confirm");return await this.client.request("POST",i,s,this.getApiToken(r)),!0}async resendOrderConfirmationCode(e,r){const s=this.getOrderUrl(e,r,"/confirm/resend");return await this.client.request("POST",s,void 0,this.getApiToken(r)),!0}async getOrderBonusesTransactions(e,r,s){const i=this.getOrderUrl(e,r,"/loyalty/transactions",s);return this.getPaginatedResponse(await this.client.request("GET",i,void 0,this.getApiToken(r)))}async getOrderCashbackTransaction(e,r){const s=this.getOrderUrl(e,r,"/loyalty/transactions/cashback");return this.getResponse(await this.client.request("GET",s,void 0,this.getApiToken(r)))}async dispatchPromotionsChecker(e,r){const s=this.getOrderUrl(e,r,"/loyalty/promotions/check");return this.getResponse(await this.client.request("POST",s,void 0,this.getApiToken(r))).dispatched}async getOrderPromotionRewards(e,r){const s=this.getOrderUrl(e,r,"/loyalty/promotions/rewards");return this.getResponse(await this.client.request("GET",s,void 0,this.getApiToken(r)))}async getCloudpaymentsReceipt(e,r,s){const i=this.getOrderUrl(e,r,`/payments/${s}/receipt`);return this.getResponse(await this.client.request("GET",i,void 0,this.getApiToken(r)))}}class Y extends o{async getAddressSuggestions(e,r){const s=this.getStoreUrl(e,"/suggestions/address");return this.getResponse(await this.client.request("POST",s,r))}}class K extends o{async getProfile(e,r,s){const i=this.getStoreUrl(e,"/me",r);return this.getResponse(await this.client.request("GET",i,null,s))}async updateProfile(e,r,s){const i=this.getStoreUrl(e,"/me");return this.getResponse(await this.client.request("PUT",i,r,s))}async removeProfile(e,r,s){const i=this.getStoreUrl(e,"/me");return await this.client.request("DELETE",i,r,s),!0}async getSettings(e,r){const s=this.getStoreUrl(e,"/me/settings");return this.getResponse(await this.client.request("GET",s,null,r))}async updateSettings(e,r,s){const i=this.getStoreUrl(e,"/me/settings");return this.getResponse(await this.client.request("PUT",i,r,s))}async getAddresses(e,r,s){const i=this.getStoreUrl(e,"/me/addresses",r);return this.getPaginatedResponse(await this.client.request("GET",i,null,s))}async createAddress(e,r,s){const i=this.getStoreUrl(e,"/me/addresses");return this.getResponse(await this.client.request("POST",i,r,s))}async updateAddress(e,r,s,i){const u=this.getStoreUrl(e,`/me/addresses/${r}`);return this.getResponse(await this.client.request("PUT",u,s,i))}async deleteAddress(e,r,s){const i=this.getStoreUrl(e,`/me/addresses/${r}`);return await this.client.request("DELETE",i,null,s),!0}async getPaymentMethods(e,r,s){const i=this.getStoreUrl(e,"/me/payment-methods",r);return this.getPaginatedResponse(await this.client.request("GET",i,null,s))}async deletePaymentMethod(e,r,s){const i=this.getStoreUrl(e,`/me/payment-methods/${r}`);return await this.client.request("DELETE",i,null,s),!0}async getBonusesTransactions(e,r,s){const i=this.getStoreUrl(e,"/me/loyalty/transactions",r);return this.getPaginatedResponse(await this.client.request("GET",i,null,s))}async getBonusesBalance(e){const r=this.getStoreUrl(e,"/me/loyalty/balance");return this.getResponse(await this.client.request("GET",r,null,null))}}class Q extends o{async checkPhone(e,r){const s=this.getStoreUrl(e,"/auth/check");return this.getResponse(await this.client.request("POST",s,r))}async register(e,r){const s=this.getStoreUrl(e,"/auth/register");return this.getResponse(await this.client.request("POST",s,r))}async confirmRegistration(e,r){const s=this.getStoreUrl(e,"/auth/register/confirm");return this.getResponse(await this.client.request("POST",s,r))}async resendRegistrationConfirmation(e,r){const s=this.getStoreUrl(e,"/auth/register/resend");return this.getResponse(await this.client.request("POST",s,r))}async login(e,r){const s=this.getStoreUrl(e,"/auth/login");return this.getResponse(await this.client.request("POST",s,r))}async dispatchPasswordReset(e,r){const s=this.getStoreUrl(e,"/auth/password/request");return this.getResponse(await this.client.request("POST",s,r))}async resetPassword(e,r){const s=this.getStoreUrl(e,"/auth/password/reset");return this.getResponse(await this.client.request("POST",s,r))}}class x{constructor(e,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(e,r);this.store=new y(s),this.auth=new Q(s),this.customer=new K(s),this.categories=new w(s),this.products=new U(s),this.addresses=new Y(s),this.orders=new O(s),this.collections=new R(s),this.offers=new m(s),this.articles=new p(s),this.feedback=new f(s),this.client=s}setApiToken(e){return this.client.setToken(e),this}}var S=(t=>(t.Female="female",t.Male="male",t.Other="other",t))(S||{}),v=(t=>(t.CloudPayments="cloudpayments",t))(v||{}),q=(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))(q||{}),T=(t=>(t.Select="select",t.MutipleSelect="mutiple_select",t.Checkboxes="checkboxes",t.Radios="radios",t.Range="range",t.Text="text",t))(T||{}),P=(t=>(t.Integer="integer",t.Float="float",t))(P||{}),b=(t=>(t.Increase="increase",t.Decrease="decrease",t))(b||{}),E=(t=>(t.Pending="pending",t.Confirmed="confirmed",t.Cancelled="cancelled",t.Rejected="rejected",t.Refunded="refunded",t.PartiallyRefunded="partially_refunded",t))(E||{}),A=(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))(A||{}),C=(t=>(t.Delivery="delivery",t.Pickup="pickup",t.OnPremise="on_premise",t))(C||{}),G=(t=>(t.Payment="payment",t.Refund="refund",t))(G||{}),$=(t=>(t.Cash="cash",t.CreditCard="credit-card",t.CloudPayments="cloudpayments",t.CardToken="card_token",t.Bonuses="bonuses",t))($||{}),_=(t=>(t.Pending="pending",t.Confirmed="confirmed",t.Cancelled="cancelled",t.PendingRefund="pending_refund",t.Refunding="refunding",t.Refunded="refunded",t))(_||{}),D=(t=>(t.Auth="auth",t.Charge="charge",t))(D||{}),j=(t=>(t.PersonsCount="persons_count",t.DeliveryTime="delivery_time",t.DeliveryIntervals="delivery_intervals",t))(j||{}),z=(t=>(t.PriceMismatch="price_mismatch",t.OutOfStock="out_of_stock",t.Unavailable="unavailable",t))(z||{}),I=(t=>(t.None="none",t.Cleanup="cleanup",t))(I||{}),V=(t=>(t.Piece="piece",t.Gram="gram",t.Kilogram="kilogram",t.Meter="meter",t))(V||{}),F=(t=>(t.Weight="weight",t.Width="width",t.Height="height",t.Length="length",t))(F||{}),M=(t=>(t.Netto="netto",t.Brutto="brutto",t))(M||{}),Z=(t=>(t.Color="color",t))(Z||{}),L=(t=>(t.Category="category",t.Group="group",t.VariantOption="variant_option",t.VariantOptionValue="variant_option_value",t))(L||{}),N=(t=>(t.Amount="amount",t.Percentage="percentage",t))(N||{}),W=(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))(W||{}),B=(t=>(t.Yes="yes",t.No="no",t.Both="both",t))(B||{}),J=(t=>(t.Disabled="disabled",t.Preauth="preauth",t.Confirmation="confirmation",t))(J||{}),X=(t=>(t.Dadata="dadata",t.Manual="manual",t))(X||{}),H=(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))(H||{});n.AcquiringType=v,n.AddressSuggestionsProvider=c,n.AddressesProvider=X,n.ArticlesResource=p,n.BonusesTransactionReason=A,n.BonusesTransactionStatus=E,n.BonusesTransactionType=b,n.CategoriesResource=w,n.CloudpaymentsChargeType=D,n.CollectionsResource=R,n.ContactType=W,n.DeliveryMethod=C,n.Dimension=F,n.DimensionType=M,n.DiscountType=N,n.FeatureRange=P,n.FeatureType=T,n.FeedbackResource=f,n.Gender=S,n.OffersResource=m,n.OrderAuthenticationMethod=J,n.OrderCartCheckerResultAction=I,n.OrderCartCheckerResultReason=z,n.OrderOptionKind=j,n.OrderPaymentTransactionStatus=_,n.OrderPaymentTransactionType=G,n.OrdersResource=O,n.PaymentMethod=$,n.PaymentSystemType=q,n.ProductContextType=L,n.ProductsResource=U,n.RecaptchaAction=H,n.StoreResource=y,n.TernaryFilter=B,n.UnitType=V,n.VariantOptionType=Z,n.ZenkyError=g,n.ZenkyErrorBuilder=k,n.ZenkyStorefront=x,Object.defineProperty(n,Symbol.toStringTag,{value:"Module"})});
|