@snabcentr/common-lib 2.13.1 → 2.13.2
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/manifest.json +1 -1
- package/dist/release_notes.tmp +1 -1
- package/dist/sc-common-lib.js +33 -24
- package/dist/sc-common-lib.js.map +1 -1
- package/dist/sc-common-lib.umd.cjs +1 -1
- package/dist/sc-common-lib.umd.cjs.map +1 -1
- package/dist/src/catalog/classes/price-template.d.ts +5 -0
- package/dist/src/catalog/classes/price-template.d.ts.map +1 -1
- package/dist/src/catalog/classes/templates-list-filters.d.ts +4 -0
- package/dist/src/catalog/classes/templates-list-filters.d.ts.map +1 -1
- package/dist/src/catalog/interfaces/i-price-template.d.ts +5 -0
- package/dist/src/catalog/interfaces/i-price-template.d.ts.map +1 -1
- package/dist/src/catalog/interfaces/i-templates-list-filters.d.ts +4 -0
- package/dist/src/catalog/interfaces/i-templates-list-filters.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/manifest.json
CHANGED
package/dist/release_notes.tmp
CHANGED
package/dist/sc-common-lib.js
CHANGED
|
@@ -631,7 +631,7 @@ class S extends J {
|
|
|
631
631
|
this.name = (e == null ? void 0 : e.name) ?? "";
|
|
632
632
|
}
|
|
633
633
|
}
|
|
634
|
-
class
|
|
634
|
+
class _ extends S {
|
|
635
635
|
/**
|
|
636
636
|
* Инициализирует экземпляр класса {@link UserShortInfo}.
|
|
637
637
|
*
|
|
@@ -682,7 +682,7 @@ class lt extends S {
|
|
|
682
682
|
* Дата и время удаления.
|
|
683
683
|
*/
|
|
684
684
|
s(this, "deletedAt");
|
|
685
|
-
this.costCoefficient = (e == null ? void 0 : e.costCoefficient) ?? 0, this.isLowPriceAllowed = (e == null ? void 0 : e.isLowPriceAllowed) ?? !1, this.publishedAt = a(e == null ? void 0 : e.publishedAt) ? C(e.publishedAt) : e == null ? void 0 : e.publishedAt, this.description = (e == null ? void 0 : e.description) ?? void 0, this.percent = (e == null ? void 0 : e.percent) ?? 0, this.owner = new
|
|
685
|
+
this.costCoefficient = (e == null ? void 0 : e.costCoefficient) ?? 0, this.isLowPriceAllowed = (e == null ? void 0 : e.isLowPriceAllowed) ?? !1, this.publishedAt = a(e == null ? void 0 : e.publishedAt) ? C(e.publishedAt) : e == null ? void 0 : e.publishedAt, this.description = (e == null ? void 0 : e.description) ?? void 0, this.percent = (e == null ? void 0 : e.percent) ?? 0, this.owner = new _(e == null ? void 0 : e.owner), this.deletedAt = a(e == null ? void 0 : e.deletedAt) ? C(e.deletedAt) : e == null ? void 0 : e.deletedAt;
|
|
686
686
|
}
|
|
687
687
|
}
|
|
688
688
|
class gr extends S {
|
|
@@ -716,7 +716,11 @@ class Z extends gr {
|
|
|
716
716
|
* Дата и время создания шаблона.
|
|
717
717
|
*/
|
|
718
718
|
s(this, "createdAt");
|
|
719
|
-
|
|
719
|
+
/**
|
|
720
|
+
* Данные о пользователе, создавшем шаблон прайс-листа.
|
|
721
|
+
*/
|
|
722
|
+
s(this, "owner");
|
|
723
|
+
this.description = (e == null ? void 0 : e.description) ?? "", this.createdAt = a(e == null ? void 0 : e.createdAt) ? C(e.createdAt) : (e == null ? void 0 : e.createdAt) ?? /* @__PURE__ */ new Date(), this.owner = e != null && e.owner ? new _(e.owner) : void 0;
|
|
720
724
|
}
|
|
721
725
|
}
|
|
722
726
|
var mr = /* @__PURE__ */ ((n) => (n.K0 = "k0", n.K1 = "k1", n.K2 = "k2", n.K3 = "k3", n.K4 = "k4", n.Retail = "retail", n))(mr || {});
|
|
@@ -988,7 +992,7 @@ class Ue extends yr {
|
|
|
988
992
|
this.isPrimary = (e == null ? void 0 : e.isPrimary) ?? !1;
|
|
989
993
|
}
|
|
990
994
|
}
|
|
991
|
-
class
|
|
995
|
+
class I extends pt {
|
|
992
996
|
/**
|
|
993
997
|
* Инициализирует экземпляр класса {@link Product}.
|
|
994
998
|
*
|
|
@@ -1089,7 +1093,7 @@ class _ extends pt {
|
|
|
1089
1093
|
}
|
|
1090
1094
|
}
|
|
1091
1095
|
var ze = /* @__PURE__ */ ((n) => (n.Discount = "discount", n.PriceTemplate = "price_template", n.ClientPrice = "client_price", n.Product = "product", n))(ze || {});
|
|
1092
|
-
class M extends
|
|
1096
|
+
class M extends I {
|
|
1093
1097
|
/**
|
|
1094
1098
|
* Инициализирует экземпляр класса {@link ClientProduct}.
|
|
1095
1099
|
*
|
|
@@ -1231,7 +1235,7 @@ class wr extends J {
|
|
|
1231
1235
|
* @inheritDoc
|
|
1232
1236
|
*/
|
|
1233
1237
|
s(this, "replacementId");
|
|
1234
|
-
this.product = new M(e.product), this.quantity = e.quantity ?? 0, this.marker = e.marker, this.category = e.category ?? new ve(), this.currency = e.currency ? new x(e.currency) : void 0, this.height = e.height, this.length = e.length, this.width = e.width, this.configurator = e.configurator, this.configuratorParams = e.configuratorParams && jr(e.configuratorParams), this.isAdditionalSale = e.isAdditionalSale, this.creator = e.creator && new
|
|
1238
|
+
this.product = new M(e.product), this.quantity = e.quantity ?? 0, this.marker = e.marker, this.category = e.category ?? new ve(), this.currency = e.currency ? new x(e.currency) : void 0, this.height = e.height, this.length = e.length, this.width = e.width, this.configurator = e.configurator, this.configuratorParams = e.configuratorParams && jr(e.configuratorParams), this.isAdditionalSale = e.isAdditionalSale, this.creator = e.creator && new _(e.creator), this.isRemoved = e.isRemoved, this.ord = e.ord, this.onOrder = e.onOrder, this.originalId = e.originalId, this.replacementId = e.replacementId;
|
|
1235
1239
|
}
|
|
1236
1240
|
}
|
|
1237
1241
|
let vr = class extends wr {
|
|
@@ -1723,7 +1727,7 @@ class N extends ve {
|
|
|
1723
1727
|
* Список продуктов категории.
|
|
1724
1728
|
*/
|
|
1725
1729
|
s(this, "products");
|
|
1726
|
-
this.categories = (t = e == null ? void 0 : e.categories) == null ? void 0 : t.map((o) => new N(o)), this.products = (i = e == null ? void 0 : e.products) == null ? void 0 : i.map((o) => new
|
|
1730
|
+
this.categories = (t = e == null ? void 0 : e.categories) == null ? void 0 : t.map((o) => new N(o)), this.products = (i = e == null ? void 0 : e.products) == null ? void 0 : i.map((o) => new I(o));
|
|
1727
1731
|
}
|
|
1728
1732
|
}
|
|
1729
1733
|
class ar {
|
|
@@ -2108,7 +2112,7 @@ class _e extends Pr {
|
|
|
2108
2112
|
* Базовые данные о продукте.
|
|
2109
2113
|
*/
|
|
2110
2114
|
s(this, "product");
|
|
2111
|
-
this.product = new
|
|
2115
|
+
this.product = new I(e == null ? void 0 : e.product);
|
|
2112
2116
|
}
|
|
2113
2117
|
}
|
|
2114
2118
|
class Dr extends w {
|
|
@@ -2192,6 +2196,10 @@ class Yt {
|
|
|
2192
2196
|
* Описание шаблона прайс-листа.
|
|
2193
2197
|
*/
|
|
2194
2198
|
s(this, "description");
|
|
2199
|
+
/**
|
|
2200
|
+
* ФИО автора шаблона прайс-листа.
|
|
2201
|
+
*/
|
|
2202
|
+
s(this, "ownerName");
|
|
2195
2203
|
/**
|
|
2196
2204
|
* Период создания.
|
|
2197
2205
|
*/
|
|
@@ -2200,7 +2208,7 @@ class Yt {
|
|
|
2200
2208
|
* Период изменения.
|
|
2201
2209
|
*/
|
|
2202
2210
|
s(this, "updatedAt", new A());
|
|
2203
|
-
this.id = r == null ? void 0 : r.id, this.name = r == null ? void 0 : r.name, this.description = r == null ? void 0 : r.description, this.createdAt = new A(r == null ? void 0 : r.createdAt), this.updatedAt = new A(r == null ? void 0 : r.updatedAt);
|
|
2211
|
+
this.id = r == null ? void 0 : r.id, this.name = r == null ? void 0 : r.name, this.description = r == null ? void 0 : r.description, this.ownerName = r == null ? void 0 : r.ownerName, this.createdAt = new A(r == null ? void 0 : r.createdAt), this.updatedAt = new A(r == null ? void 0 : r.updatedAt);
|
|
2204
2212
|
}
|
|
2205
2213
|
/**
|
|
2206
2214
|
* Выполняет сброс указанного фильтра в значение по умолчанию.
|
|
@@ -2212,6 +2220,7 @@ class Yt {
|
|
|
2212
2220
|
case "id":
|
|
2213
2221
|
case "name":
|
|
2214
2222
|
case "description":
|
|
2223
|
+
case "ownerName":
|
|
2215
2224
|
this[r] = void 0;
|
|
2216
2225
|
break;
|
|
2217
2226
|
case "createdAt":
|
|
@@ -2676,7 +2685,7 @@ class rs extends h {
|
|
|
2676
2685
|
showHidden: t,
|
|
2677
2686
|
withPriceCoefficients: e
|
|
2678
2687
|
},
|
|
2679
|
-
(i) => ye(i.data, (o) => new
|
|
2688
|
+
(i) => ye(i.data, (o) => new I(o))
|
|
2680
2689
|
);
|
|
2681
2690
|
}
|
|
2682
2691
|
/**
|
|
@@ -2718,7 +2727,7 @@ class ts extends h {
|
|
|
2718
2727
|
* @see /doc/api/internal#/Каталог/api_internal_catalog_products_get
|
|
2719
2728
|
*/
|
|
2720
2729
|
getProductData(r, e = !1) {
|
|
2721
|
-
return this.get(`/internal/catalog/products/${r}`, { withPriceCoefficients: e }, (t) => new
|
|
2730
|
+
return this.get(`/internal/catalog/products/${r}`, { withPriceCoefficients: e }, (t) => new I(t.data));
|
|
2722
2731
|
}
|
|
2723
2732
|
/**
|
|
2724
2733
|
* Возвращает публичные данные об указанном продукте.
|
|
@@ -2726,7 +2735,7 @@ class ts extends h {
|
|
|
2726
2735
|
* @param productId Идентификатор продукта.
|
|
2727
2736
|
*/
|
|
2728
2737
|
getPublicProductData(r) {
|
|
2729
|
-
return this.get(`/public/catalog/products/${r}`, {}, (e) => new
|
|
2738
|
+
return this.get(`/public/catalog/products/${r}`, {}, (e) => new I(e.data));
|
|
2730
2739
|
}
|
|
2731
2740
|
/**
|
|
2732
2741
|
* Возвращает данные о коэффициентах цен для указанного продукта.
|
|
@@ -2751,7 +2760,7 @@ class ts extends h {
|
|
|
2751
2760
|
publicSimpleSearch(r, e = 10) {
|
|
2752
2761
|
return new Promise((t, i) => {
|
|
2753
2762
|
this.get(`/public/catalog/search/simple?limit=${e}&term=${r}`).then((o) => {
|
|
2754
|
-
t(o.products.map((c) => new
|
|
2763
|
+
t(o.products.map((c) => new I(c)));
|
|
2755
2764
|
}).catch((o) => {
|
|
2756
2765
|
i(o);
|
|
2757
2766
|
});
|
|
@@ -3649,7 +3658,7 @@ class ls extends h {
|
|
|
3649
3658
|
showHidden: i,
|
|
3650
3659
|
withPriceCoefficients: t
|
|
3651
3660
|
},
|
|
3652
|
-
(o) => ye(o.data, (c) => new
|
|
3661
|
+
(o) => ye(o.data, (c) => new I(c))
|
|
3653
3662
|
);
|
|
3654
3663
|
}
|
|
3655
3664
|
}
|
|
@@ -3845,7 +3854,7 @@ class Ar extends dr {
|
|
|
3845
3854
|
*/
|
|
3846
3855
|
s(this, "updater");
|
|
3847
3856
|
if (e) {
|
|
3848
|
-
if (this.opf = new z(e.opf), this.comment = e.comment, this.alternativeName = e.alternativeName, this.createdAt = a(e == null ? void 0 : e.createdAt) ? C(e.createdAt) : e.createdAt, this.creator = e.creator ? new
|
|
3857
|
+
if (this.opf = new z(e.opf), this.comment = e.comment, this.alternativeName = e.alternativeName, this.createdAt = a(e == null ? void 0 : e.createdAt) ? C(e.createdAt) : e.createdAt, this.creator = e.creator ? new _(e.creator) : void 0, this.updater = e.updater ? new _(e.updater) : void 0, e.partnerGroup && (this.partnerGroup = new se(e.partnerGroup)), e.contacts) {
|
|
3849
3858
|
const t = [];
|
|
3850
3859
|
e.contacts.forEach((i) => {
|
|
3851
3860
|
t.push(new G(i));
|
|
@@ -4274,7 +4283,7 @@ class kr extends J {
|
|
|
4274
4283
|
* @inheritDoc
|
|
4275
4284
|
*/
|
|
4276
4285
|
s(this, "creator");
|
|
4277
|
-
this.createdAt = a(e == null ? void 0 : e.createdAt) ? C(e.createdAt) : (e == null ? void 0 : e.createdAt) ?? /* @__PURE__ */ new Date(), this.creator = new
|
|
4286
|
+
this.createdAt = a(e == null ? void 0 : e.createdAt) ? C(e.createdAt) : (e == null ? void 0 : e.createdAt) ?? /* @__PURE__ */ new Date(), this.creator = new _(e == null ? void 0 : e.creator);
|
|
4278
4287
|
}
|
|
4279
4288
|
}
|
|
4280
4289
|
class at extends S {
|
|
@@ -5128,7 +5137,7 @@ class gs extends h {
|
|
|
5128
5137
|
const o = this.get(
|
|
5129
5138
|
`internal/catalog/categories/${r.id}/configurators/${(c = r.properties) == null ? void 0 : c.configurator}/product`,
|
|
5130
5139
|
{ params: t, client_id: e },
|
|
5131
|
-
(u) => new
|
|
5140
|
+
(u) => new I(u.data)
|
|
5132
5141
|
);
|
|
5133
5142
|
return o.catch((u) => {
|
|
5134
5143
|
this.errorResponseHandler(u, i);
|
|
@@ -5545,7 +5554,7 @@ class Ir extends kr {
|
|
|
5545
5554
|
date: a((u = e == null ? void 0 : e.delivery) == null ? void 0 : u.date) ? C(e.delivery.date) : ((p = e == null ? void 0 : e.delivery) == null ? void 0 : p.date) ?? /* @__PURE__ */ new Date(),
|
|
5546
5555
|
address: (m = e == null ? void 0 : e.delivery) != null && m.address ? new pe(e.delivery.address) : void 0,
|
|
5547
5556
|
warehouse: (f = e == null ? void 0 : e.delivery) != null && f.warehouse ? new we(e.delivery.warehouse) : void 0
|
|
5548
|
-
}, this.attachedUser = e != null && e.attachedUser ? new
|
|
5557
|
+
}, this.attachedUser = e != null && e.attachedUser ? new _(e == null ? void 0 : e.attachedUser) : void 0, this.status = new $e(e == null ? void 0 : e.status), this.statusDetail = e != null && e.statusDetail ? new w(e.statusDetail) : void 0, this.salesDirection = new q(e == null ? void 0 : e.salesDirection), this.attachedAt = a(e == null ? void 0 : e.attachedAt) ? C(e.attachedAt) : e == null ? void 0 : e.attachedAt, this.isOnOrder = (e == null ? void 0 : e.isOnOrder) ?? !1, this.isNotInStock = (e == null ? void 0 : e.isNotInStock) ?? !1, this.sum = (e == null ? void 0 : e.sum) ?? 0, this.isLargeOrder = (e == null ? void 0 : e.isLargeOrder) ?? !1;
|
|
5549
5558
|
}
|
|
5550
5559
|
}
|
|
5551
5560
|
class dt extends wr {
|
|
@@ -6059,7 +6068,7 @@ class Rs extends Qe {
|
|
|
6059
6068
|
* @inheritDoc
|
|
6060
6069
|
*/
|
|
6061
6070
|
s(this, "onlyMyRegions");
|
|
6062
|
-
this.attachedUsers = (t = e == null ? void 0 : e.attachedUsers) == null ? void 0 : t.map((u) => "isActive" in u ? new ae(u) : new Or(u)), this.clientSearchTerm = e == null ? void 0 : e.clientSearchTerm, this.client = e != null && e.client ? new V(e.client) : void 0, this.contragent = e == null ? void 0 : e.contragent, this.createdAt = new A(e == null ? void 0 : e.createdAt), this.creator = e != null && e.creator ? new
|
|
6071
|
+
this.attachedUsers = (t = e == null ? void 0 : e.attachedUsers) == null ? void 0 : t.map((u) => "isActive" in u ? new ae(u) : new Or(u)), this.clientSearchTerm = e == null ? void 0 : e.clientSearchTerm, this.client = e != null && e.client ? new V(e.client) : void 0, this.contragent = e == null ? void 0 : e.contragent, this.createdAt = new A(e == null ? void 0 : e.createdAt), this.creator = e != null && e.creator ? new _(e.creator) : void 0, this.deliveryDate = new A(e == null ? void 0 : e.deliveryDate), this.deliveryAddressSearch = e == null ? void 0 : e.deliveryAddressSearch, this.clientCities = (i = e == null ? void 0 : e.clientCities) == null ? void 0 : i.map((u) => new Ae(u)), this.id = e == null ? void 0 : e.id, this.isApproved = e == null ? void 0 : e.isApproved, this.isNotInStock = e == null ? void 0 : e.isNotInStock, this.isOnOrder = e == null ? void 0 : e.isOnOrder, this.isLargeOrder = e == null ? void 0 : e.isLargeOrder, this.attachedAt = new A(e == null ? void 0 : e.attachedAt), this.salesDirections = (o = e == null ? void 0 : e.salesDirections) == null ? void 0 : o.map((u) => new q(u)), this.status = e == null ? void 0 : e.status, this.statusDetail = e == null ? void 0 : e.statusDetail, this.deliveryType = e != null && e.deliveryType ? new F(e.deliveryType) : void 0, this.paymentType = e != null && e.paymentType ? new xr(e.paymentType) : void 0, this.warehouses = (c = e == null ? void 0 : e.warehouses) == null ? void 0 : c.map((u) => new we(u)), this.isToProcess = e == null ? void 0 : e.isToProcess;
|
|
6063
6072
|
}
|
|
6064
6073
|
/**
|
|
6065
6074
|
* @inheritDoc
|
|
@@ -6131,7 +6140,7 @@ class $t {
|
|
|
6131
6140
|
* @inheritDoc
|
|
6132
6141
|
*/
|
|
6133
6142
|
s(this, "createdAt");
|
|
6134
|
-
this.user = new
|
|
6143
|
+
this.user = new _(r == null ? void 0 : r.user), this.status = new $e(r == null ? void 0 : r.status), this.statusDetail = r != null && r.statusDetail ? new w(r.statusDetail) : void 0, this.createdAt = a(r == null ? void 0 : r.createdAt) ? C(r.createdAt) : (r == null ? void 0 : r.createdAt) ?? /* @__PURE__ */ new Date();
|
|
6135
6144
|
}
|
|
6136
6145
|
}
|
|
6137
6146
|
class Ds extends Ce {
|
|
@@ -6543,7 +6552,7 @@ class Oe {
|
|
|
6543
6552
|
* Источник клиентской цены.
|
|
6544
6553
|
*/
|
|
6545
6554
|
s(this, "source");
|
|
6546
|
-
this.client = new V(r == null ? void 0 : r.client), this.product = new
|
|
6555
|
+
this.client = new V(r == null ? void 0 : r.client), this.product = new I(r == null ? void 0 : r.product), this.cost = (r == null ? void 0 : r.cost) ?? 0, this.costCoefficient = (r == null ? void 0 : r.costCoefficient) ?? 0, this.source = (r == null ? void 0 : r.source) ?? ze.Product;
|
|
6547
6556
|
}
|
|
6548
6557
|
}
|
|
6549
6558
|
const xe = (n) => {
|
|
@@ -6671,7 +6680,7 @@ class Tt {
|
|
|
6671
6680
|
* @inheritDoc
|
|
6672
6681
|
*/
|
|
6673
6682
|
s(this, "currency");
|
|
6674
|
-
this.cost = r.cost ?? 0, this.isLowCost = r.isLowCost ?? !1, this.isRetail = r.isRetail ?? !1, this.costDate = a(r.costDate) ? C(r.costDate) : r.costDate ?? /* @__PURE__ */ new Date(), this.discountName = r.discountName, this.priceTemplateName = r.priceTemplateName, this.product = r.product ? new ge(r.product) : void 0, this.client = r.client ? new
|
|
6683
|
+
this.cost = r.cost ?? 0, this.isLowCost = r.isLowCost ?? !1, this.isRetail = r.isRetail ?? !1, this.costDate = a(r.costDate) ? C(r.costDate) : r.costDate ?? /* @__PURE__ */ new Date(), this.discountName = r.discountName, this.priceTemplateName = r.priceTemplateName, this.product = r.product ? new ge(r.product) : void 0, this.client = r.client ? new _(r.client) : void 0, this.executor = r.executor ? new _(r.executor) : void 0, this.currency = r.currency ? new x(r.currency) : void 0;
|
|
6675
6684
|
}
|
|
6676
6685
|
}
|
|
6677
6686
|
class bt extends ge {
|
|
@@ -7577,7 +7586,7 @@ export {
|
|
|
7577
7586
|
ue as PricingRole,
|
|
7578
7587
|
os as PricingRoleProvider,
|
|
7579
7588
|
Ue as PrimaryCatalogableItem,
|
|
7580
|
-
|
|
7589
|
+
I as Product,
|
|
7581
7590
|
rs as ProductCategoryDataProvider,
|
|
7582
7591
|
ts as ProductDataProvider,
|
|
7583
7592
|
xt as ProductFileType,
|
|
@@ -7616,7 +7625,7 @@ export {
|
|
|
7616
7625
|
Rr as UserCommonInfo,
|
|
7617
7626
|
Ft as UserDataProvider,
|
|
7618
7627
|
Cr as UserPricingRole,
|
|
7619
|
-
|
|
7628
|
+
_ as UserShortInfo,
|
|
7620
7629
|
Nt as UserTypeEnum,
|
|
7621
7630
|
hs as VersionConfig,
|
|
7622
7631
|
we as Warehouse,
|