@snabcentr/common-lib 1.76.0 → 1.76.1
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/sc-common-lib.js +28 -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/orders/classes/order-product.d.ts +5 -0
- package/dist/src/orders/classes/order-product.d.ts.map +1 -1
- package/dist/src/orders/interfaces/i-order-product.d.ts +5 -0
- package/dist/src/orders/interfaces/i-order-product.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/manifest.json
CHANGED
package/dist/sc-common-lib.js
CHANGED
|
@@ -8,7 +8,7 @@ import { isAfter as Je, parseISO as v, startOfToday as de, format as x, addSecon
|
|
|
8
8
|
import { defineStore as ee } from "pinia";
|
|
9
9
|
import { ref as y, markRaw as zr, computed as R } from "vue";
|
|
10
10
|
import Wr from "axios";
|
|
11
|
-
class
|
|
11
|
+
class q {
|
|
12
12
|
/**
|
|
13
13
|
* Инициализирует экземпляр класса {@link JwtPayload}.
|
|
14
14
|
*
|
|
@@ -107,11 +107,11 @@ class O {
|
|
|
107
107
|
* @param jwtToken JWT-ключ доступа.
|
|
108
108
|
*/
|
|
109
109
|
static getJwtPayload(r) {
|
|
110
|
-
const e = nr(r), s = new
|
|
110
|
+
const e = nr(r), s = new q(Ue(e));
|
|
111
111
|
return s.resourceAccess = e.resource_access, s;
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
|
-
class Ut extends
|
|
114
|
+
class Ut extends q {
|
|
115
115
|
/**
|
|
116
116
|
* Инициализирует экземпляр класса {@link DetailedJwtPayload}.
|
|
117
117
|
*
|
|
@@ -151,7 +151,7 @@ class Ut extends O {
|
|
|
151
151
|
* @param jwtToken JWT-ключ доступа.
|
|
152
152
|
*/
|
|
153
153
|
static getJwtPayload(e) {
|
|
154
|
-
return new
|
|
154
|
+
return new q(Ue(nr(e)));
|
|
155
155
|
}
|
|
156
156
|
}
|
|
157
157
|
const W = class W {
|
|
@@ -302,7 +302,7 @@ class me {
|
|
|
302
302
|
}
|
|
303
303
|
function Ve(n) {
|
|
304
304
|
try {
|
|
305
|
-
const r =
|
|
305
|
+
const r = q.getJwtPayload(n);
|
|
306
306
|
return new Date(r.exp * 1e3);
|
|
307
307
|
} catch {
|
|
308
308
|
return;
|
|
@@ -324,7 +324,7 @@ const M = ee("__auth_state_private", () => {
|
|
|
324
324
|
), r = y(void 0), e = y(void 0), s = zr(/* @__PURE__ */ new Map());
|
|
325
325
|
function i() {
|
|
326
326
|
e.value = void 0, A(n.value) || n.value.then((o) => {
|
|
327
|
-
const c =
|
|
327
|
+
const c = q.getJwtPayload(o);
|
|
328
328
|
e.value = c.exp * 1e3 > Date.now() ? or(c.resourceAccess, (u) => (u == null ? void 0 : u.roles) ?? []) : void 0;
|
|
329
329
|
}).catch(w);
|
|
330
330
|
}
|
|
@@ -375,7 +375,7 @@ const M = ee("__auth_state_private", () => {
|
|
|
375
375
|
function i(o) {
|
|
376
376
|
const c = M();
|
|
377
377
|
!A(c.jwtToken) && A(c.userPermissions) && c.jwtToken.then((f) => {
|
|
378
|
-
const g =
|
|
378
|
+
const g = q.getJwtPayload(f);
|
|
379
379
|
c.userPermissions = g.exp * 1e3 > Date.now() ? or(g.resourceAccess, (a) => (a == null ? void 0 : a.roles) ?? []) : void 0;
|
|
380
380
|
}).catch(w);
|
|
381
381
|
const u = V(o) ? o.join(" && ") : o;
|
|
@@ -1330,7 +1330,7 @@ class Zr extends gr {
|
|
|
1330
1330
|
this.deletedAt = C(e == null ? void 0 : e.deletedAt) ? v(e.deletedAt) : e == null ? void 0 : e.deletedAt;
|
|
1331
1331
|
}
|
|
1332
1332
|
}
|
|
1333
|
-
class
|
|
1333
|
+
class _ extends b {
|
|
1334
1334
|
/**
|
|
1335
1335
|
* Инициализирует экземпляр класса {@link UserShortInfo}.
|
|
1336
1336
|
*
|
|
@@ -1381,7 +1381,7 @@ class et extends b {
|
|
|
1381
1381
|
* Дата и время удаления.
|
|
1382
1382
|
*/
|
|
1383
1383
|
t(this, "deletedAt");
|
|
1384
|
-
this.costCoefficient = (e == null ? void 0 : e.costCoefficient) ?? 0, this.isLowPriceAllowed = (e == null ? void 0 : e.isLowPriceAllowed) ?? !1, this.publishedAt = C(e == null ? void 0 : e.publishedAt) ? v(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
|
|
1384
|
+
this.costCoefficient = (e == null ? void 0 : e.costCoefficient) ?? 0, this.isLowPriceAllowed = (e == null ? void 0 : e.isLowPriceAllowed) ?? !1, this.publishedAt = C(e == null ? void 0 : e.publishedAt) ? v(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 = C(e == null ? void 0 : e.deletedAt) ? v(e.deletedAt) : e == null ? void 0 : e.deletedAt;
|
|
1385
1385
|
}
|
|
1386
1386
|
}
|
|
1387
1387
|
class z extends gr {
|
|
@@ -1460,7 +1460,7 @@ class mr {
|
|
|
1460
1460
|
this.phone = /^\d+$/.test(r.phone ?? "") ? `+${r.phone}` : r.phone, this.email = r.email;
|
|
1461
1461
|
}
|
|
1462
1462
|
}
|
|
1463
|
-
class
|
|
1463
|
+
class O extends P {
|
|
1464
1464
|
}
|
|
1465
1465
|
class Me extends b {
|
|
1466
1466
|
/**
|
|
@@ -1490,7 +1490,7 @@ class Me extends b {
|
|
|
1490
1490
|
* @inheritDoc
|
|
1491
1491
|
*/
|
|
1492
1492
|
t(this, "isRegionalDirector");
|
|
1493
|
-
this.salesDirection = e != null && e.salesDirection ? new
|
|
1493
|
+
this.salesDirection = e != null && e.salesDirection ? new O(e.salesDirection) : new O(), this.photo = e == null ? void 0 : e.photo, this.contacts = e != null && e.contacts ? new mr(e.contacts) : void 0, this.isDefault = (e == null ? void 0 : e.isDefault) ?? !1, this.isRegionalDirector = (e == null ? void 0 : e.isRegionalDirector) ?? !1;
|
|
1494
1494
|
}
|
|
1495
1495
|
}
|
|
1496
1496
|
class Be extends P {
|
|
@@ -1733,7 +1733,7 @@ class yr extends b {
|
|
|
1733
1733
|
* Признак активности учетной записи пользователя.
|
|
1734
1734
|
*/
|
|
1735
1735
|
t(this, "isActive");
|
|
1736
|
-
this.phone = /^\d+$/.test((e == null ? void 0 : e.phone) ?? "") ? `+${e == null ? void 0 : e.phone}` : (e == null ? void 0 : e.phone) ?? "", this.email = (e == null ? void 0 : e.email) ?? "", this.getNews = (e == null ? void 0 : e.getNews) ?? !1, this.salesDirection = e != null && e.salesDirection ? new
|
|
1736
|
+
this.phone = /^\d+$/.test((e == null ? void 0 : e.phone) ?? "") ? `+${e == null ? void 0 : e.phone}` : (e == null ? void 0 : e.phone) ?? "", this.email = (e == null ? void 0 : e.email) ?? "", this.getNews = (e == null ? void 0 : e.getNews) ?? !1, this.salesDirection = e != null && e.salesDirection ? new O(e.salesDirection) : void 0, this.createdAt = C(e == null ? void 0 : e.createdAt) ? v(e.createdAt) : e == null ? void 0 : e.createdAt, this.lastLoginAt = C(e == null ? void 0 : e.lastLoginAt) ? v(e.lastLoginAt) : e == null ? void 0 : e.lastLoginAt, this.isActive = (e == null ? void 0 : e.isActive) ?? !1;
|
|
1737
1737
|
}
|
|
1738
1738
|
}
|
|
1739
1739
|
class he extends yr {
|
|
@@ -1782,7 +1782,7 @@ class he extends yr {
|
|
|
1782
1782
|
* @inheritDoc
|
|
1783
1783
|
*/
|
|
1784
1784
|
t(this, "curators");
|
|
1785
|
-
this.salesDirection = new
|
|
1785
|
+
this.salesDirection = new O(e == null ? void 0 : e.salesDirection), this.debt = (e == null ? void 0 : e.debt) ?? 0, this.alternativeName = (e == null ? void 0 : e.alternativeName) ?? "", this.city = new ze(e == null ? void 0 : e.city), this.comment = e == null ? void 0 : e.comment, this.isPhoneApproved = (e == null ? void 0 : e.isPhoneApproved) ?? !1, this.isEmailApproved = (e == null ? void 0 : e.isEmailApproved) ?? !1, this.managers = ((s = e == null ? void 0 : e.managers) == null ? void 0 : s.map((o) => new Me(o))) ?? [], this.curators = ((i = e == null ? void 0 : e.curators) == null ? void 0 : i.map((o) => new He(o))) ?? void 0;
|
|
1786
1786
|
}
|
|
1787
1787
|
}
|
|
1788
1788
|
class se extends j {
|
|
@@ -3731,7 +3731,7 @@ class Rr extends b {
|
|
|
3731
3731
|
*/
|
|
3732
3732
|
t(this, "updater");
|
|
3733
3733
|
if (e) {
|
|
3734
|
-
if (this.opf = new N(e.opf), this.comment = e.comment, this.alternativeName = e.alternativeName, this.createdAt = C(e == null ? void 0 : e.createdAt) ? v(e.createdAt) : e.createdAt, this.creator = e.creator ? new
|
|
3734
|
+
if (this.opf = new N(e.opf), this.comment = e.comment, this.alternativeName = e.alternativeName, this.createdAt = C(e == null ? void 0 : e.createdAt) ? v(e.createdAt) : e.createdAt, this.creator = e.creator ? new _(e.creator) : void 0, this.updatedAt = C(e == null ? void 0 : e.updatedAt) ? v(e.updatedAt) : e.updatedAt, this.updater = e.updater ? new _(e.updater) : void 0, e.partnerGroup && (this.partnerGroup = new Z(e.partnerGroup)), e.contacts) {
|
|
3735
3735
|
const s = [];
|
|
3736
3736
|
e.contacts.forEach((i) => {
|
|
3737
3737
|
s.push(new U(i));
|
|
@@ -4092,7 +4092,7 @@ class Xt {
|
|
|
4092
4092
|
*/
|
|
4093
4093
|
t(this, "lastOrder");
|
|
4094
4094
|
var e, s, i, o, c, u, h, f;
|
|
4095
|
-
this.id = r == null ? void 0 : r.id, this.name = r == null ? void 0 : r.name, this.alternativeName = r == null ? void 0 : r.alternativeName, this.searchTerm = r == null ? void 0 : r.searchTerm, this.cities = (e = r == null ? void 0 : r.cities) == null ? void 0 : e.map((g) => new ze(g)), this.region = new ce(r == null ? void 0 : r.region), this.country = new X(r == null ? void 0 : r.country), this.phone = r == null ? void 0 : r.phone, this.email = r == null ? void 0 : r.email, this.isActive = r && Object.prototype.hasOwnProperty.call(r, "isActive") ? r == null ? void 0 : r.isActive : !0, this.createdAt = new L(r == null ? void 0 : r.createdAt), this.lastLoginDate = new L(r == null ? void 0 : r.lastLoginDate), this.lastLoginDateHasOrder = (r == null ? void 0 : r.lastLoginDateHasOrder) ?? void 0, this.managers = ((s = r == null ? void 0 : r.managers) == null ? void 0 : s.map((g) => new Ae(g))) ?? [], this.curators = ((i = r == null ? void 0 : r.curators) == null ? void 0 : i.map((g) => new He(g))) ?? [], this.salesDirections = (o = r == null ? void 0 : r.salesDirections) == null ? void 0 : o.map((g) => new
|
|
4095
|
+
this.id = r == null ? void 0 : r.id, this.name = r == null ? void 0 : r.name, this.alternativeName = r == null ? void 0 : r.alternativeName, this.searchTerm = r == null ? void 0 : r.searchTerm, this.cities = (e = r == null ? void 0 : r.cities) == null ? void 0 : e.map((g) => new ze(g)), this.region = new ce(r == null ? void 0 : r.region), this.country = new X(r == null ? void 0 : r.country), this.phone = r == null ? void 0 : r.phone, this.email = r == null ? void 0 : r.email, this.isActive = r && Object.prototype.hasOwnProperty.call(r, "isActive") ? r == null ? void 0 : r.isActive : !0, this.createdAt = new L(r == null ? void 0 : r.createdAt), this.lastLoginDate = new L(r == null ? void 0 : r.lastLoginDate), this.lastLoginDateHasOrder = (r == null ? void 0 : r.lastLoginDateHasOrder) ?? void 0, this.managers = ((s = r == null ? void 0 : r.managers) == null ? void 0 : s.map((g) => new Ae(g))) ?? [], this.curators = ((i = r == null ? void 0 : r.curators) == null ? void 0 : i.map((g) => new He(g))) ?? [], this.salesDirections = (o = r == null ? void 0 : r.salesDirections) == null ? void 0 : o.map((g) => new O(g)), this.contragentInn = r == null ? void 0 : r.contragentInn, this.contragentType = new N(r == null ? void 0 : r.contragentType), this.preferredDeliveryType = new Q(r == null ? void 0 : r.preferredDeliveryType), this.partnerGroups = (c = r == null ? void 0 : r.partnerGroups) == null ? void 0 : c.map((g) => new Z(g)), this.contact = new qe(r == null ? void 0 : r.contact), this.lastOrder = {
|
|
4096
4096
|
createdAt: new L((u = r == null ? void 0 : r.lastOrder) == null ? void 0 : u.createdAt),
|
|
4097
4097
|
creator: (h = r == null ? void 0 : r.lastOrder) == null ? void 0 : h.creator,
|
|
4098
4098
|
isApproved: (f = r == null ? void 0 : r.lastOrder) == null ? void 0 : f.isApproved
|
|
@@ -4184,7 +4184,7 @@ class $r extends j {
|
|
|
4184
4184
|
* Признак того, что заказ подтвержден в 1С.
|
|
4185
4185
|
*/
|
|
4186
4186
|
t(this, "isApproved1c");
|
|
4187
|
-
this.createdAt = C(e == null ? void 0 : e.createdAt) ? v(e.createdAt) : (e == null ? void 0 : e.createdAt) ?? /* @__PURE__ */ new Date(), this.creator = new
|
|
4187
|
+
this.createdAt = C(e == null ? void 0 : e.createdAt) ? v(e.createdAt) : (e == null ? void 0 : e.createdAt) ?? /* @__PURE__ */ new Date(), this.creator = new _(e == null ? void 0 : e.creator), this.isApproved1c = (e == null ? void 0 : e.isApproved1c) ?? !1;
|
|
4188
4188
|
}
|
|
4189
4189
|
}
|
|
4190
4190
|
class vt extends b {
|
|
@@ -4224,7 +4224,7 @@ class vt extends b {
|
|
|
4224
4224
|
* @inheritDoc
|
|
4225
4225
|
*/
|
|
4226
4226
|
t(this, "curators");
|
|
4227
|
-
this.contacts = ((s = e.contacts) == null ? void 0 : s.map((u) => new U(u))) ?? void 0, this.lastOrder = e.lastOrder ? new $r(e.lastOrder) : void 0, this.partnerGroups = ((i = e.partnerGroups) == null ? void 0 : i.map((u) => new Z(u))) ?? void 0, this.preferredDeliveryType = e.preferredDeliveryType ? new Q(e.preferredDeliveryType) : void 0, this.salesDirection = e.salesDirection ? new
|
|
4227
|
+
this.contacts = ((s = e.contacts) == null ? void 0 : s.map((u) => new U(u))) ?? void 0, this.lastOrder = e.lastOrder ? new $r(e.lastOrder) : void 0, this.partnerGroups = ((i = e.partnerGroups) == null ? void 0 : i.map((u) => new Z(u))) ?? void 0, this.preferredDeliveryType = e.preferredDeliveryType ? new Q(e.preferredDeliveryType) : void 0, this.salesDirection = e.salesDirection ? new O(e.salesDirection) : void 0, this.managers = ((o = e.managers) == null ? void 0 : o.map((u) => new Me(u))) ?? void 0, this.curators = ((c = e.curators) == null ? void 0 : c.map((u) => new He(u))) ?? void 0;
|
|
4228
4228
|
}
|
|
4229
4229
|
}
|
|
4230
4230
|
class Pt {
|
|
@@ -5252,7 +5252,7 @@ class Tr extends $r {
|
|
|
5252
5252
|
date: C((u = e == null ? void 0 : e.delivery) == null ? void 0 : u.date) ? v(e.delivery.date) : ((h = e == null ? void 0 : e.delivery) == null ? void 0 : h.date) ?? /* @__PURE__ */ new Date(),
|
|
5253
5253
|
address: (f = e == null ? void 0 : e.delivery) != null && f.address ? new ve(e.delivery.address) : void 0,
|
|
5254
5254
|
warehouse: (g = e == null ? void 0 : e.delivery) != null && g.warehouse ? new De(e.delivery.warehouse) : void 0
|
|
5255
|
-
}, this.attachedUser = new
|
|
5255
|
+
}, this.attachedUser = new _(e == null ? void 0 : e.attachedUser), this.status = (e == null ? void 0 : e.status) ?? 0, this.salesDirection = new O(e == null ? void 0 : e.salesDirection), this.pendingAt = C(e == null ? void 0 : e.pendingAt) ? v(e.pendingAt) : e == null ? void 0 : e.pendingAt, this.processedAt = C(e == null ? void 0 : e.processedAt) ? v(e.processedAt) : e == null ? void 0 : e.processedAt, this.isOnOrder = (e == null ? void 0 : e.isOnOrder) ?? !1, this.isNotInStock = (e == null ? void 0 : e.isNotInStock) ?? !1;
|
|
5256
5256
|
}
|
|
5257
5257
|
}
|
|
5258
5258
|
class Dt extends j {
|
|
@@ -5335,7 +5335,11 @@ class Dt extends j {
|
|
|
5335
5335
|
* который соответствует указанной ширине. Количество не ограничено.
|
|
5336
5336
|
*/
|
|
5337
5337
|
t(this, "sawing");
|
|
5338
|
-
|
|
5338
|
+
/**
|
|
5339
|
+
* Данные о пользователе, добавившем продукт в заказ.
|
|
5340
|
+
*/
|
|
5341
|
+
t(this, "creatorUser");
|
|
5342
|
+
this.product = new Y(e.product), this.quantity = e.quantity, this.currency = e.currency, this.costOne = e.costOne, this.costOneRub = e.costOneRub, this.cost = e.cost, this.costRub = e.costRub, this.marker = e.marker, this.height = e.height, this.length = e.length, this.width = e.width, this.logicGroupId = e.logicGroupId, this.salesDirection = e.salesDirection, this.specificationImgUrl = e.specificationImgUrl, this.configurator = e.configurator, this.configuratorParams = e.configuratorParams, this.sawing = e.sawing, this.creatorUser = e.creatorUser && new _(e.creatorUser);
|
|
5339
5343
|
}
|
|
5340
5344
|
}
|
|
5341
5345
|
class rr extends Tr {
|
|
@@ -5600,7 +5604,7 @@ class At {
|
|
|
5600
5604
|
* @inheritDoc
|
|
5601
5605
|
*/
|
|
5602
5606
|
t(this, "currency");
|
|
5603
|
-
this.cost = r.cost ?? 0, this.isLowCost = r.isLowCost ?? !1, this.isRetail = r.isRetail ?? !1, this.costDate = C(r.costDate) ? v(r.costDate) : r.costDate ?? /* @__PURE__ */ new Date(), this.discountName = r.discountName, this.priceTemplateName = r.priceTemplateName, this.product = r.product ? new oe(r.product) : void 0, this.client = r.client ? new
|
|
5607
|
+
this.cost = r.cost ?? 0, this.isLowCost = r.isLowCost ?? !1, this.isRetail = r.isRetail ?? !1, this.costDate = C(r.costDate) ? v(r.costDate) : r.costDate ?? /* @__PURE__ */ new Date(), this.discountName = r.discountName, this.priceTemplateName = r.priceTemplateName, this.product = r.product ? new oe(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 we(r.currency) : void 0;
|
|
5604
5608
|
}
|
|
5605
5609
|
}
|
|
5606
5610
|
class $t extends oe {
|
|
@@ -5783,7 +5787,7 @@ class $ extends ue {
|
|
|
5783
5787
|
* Возвращает {@link Promise} для получения справочника данных направлений продаж.
|
|
5784
5788
|
*/
|
|
5785
5789
|
getSalesDirections() {
|
|
5786
|
-
return this.getTypedDataArrayRequester(
|
|
5790
|
+
return this.getTypedDataArrayRequester(O, "/public/references/sales-direction", !0);
|
|
5787
5791
|
}
|
|
5788
5792
|
/**
|
|
5789
5793
|
* Возвращает {@link Promise} для получения справочника данных об источнике первичного интереса.
|
|
@@ -6383,7 +6387,7 @@ export {
|
|
|
6383
6387
|
p as HttpRequester,
|
|
6384
6388
|
j as Identity,
|
|
6385
6389
|
Vr as Image,
|
|
6386
|
-
|
|
6390
|
+
q as JwtPayload,
|
|
6387
6391
|
Ae as Manager,
|
|
6388
6392
|
Me as ManagerCommon,
|
|
6389
6393
|
is as ManagerDataFactory,
|
|
@@ -6434,7 +6438,7 @@ export {
|
|
|
6434
6438
|
$ as ReferenceDataProvider,
|
|
6435
6439
|
ce as Region,
|
|
6436
6440
|
vr as ResourceType,
|
|
6437
|
-
|
|
6441
|
+
O as SalesDirection,
|
|
6438
6442
|
nt as SentryConfig,
|
|
6439
6443
|
ir as Seo,
|
|
6440
6444
|
ps as SeoDataProvider,
|
|
@@ -6450,7 +6454,7 @@ export {
|
|
|
6450
6454
|
yr as UserCommonInfo,
|
|
6451
6455
|
St as UserDataProvider,
|
|
6452
6456
|
rt as UserPricingRole,
|
|
6453
|
-
|
|
6457
|
+
_ as UserShortInfo,
|
|
6454
6458
|
bt as UserTypeEnum,
|
|
6455
6459
|
ot as VersionConfig,
|
|
6456
6460
|
De as Warehouse,
|