@snabcentr/common-lib 1.67.1 → 1.67.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 +21 -17
- 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/user/states/user-state-store.d.ts +3 -3
- package/dist/src/user/states/user-state-store.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
|
@@ -2,7 +2,7 @@ var hr = Object.defineProperty;
|
|
|
2
2
|
var gr = (n, r, e) => r in n ? hr(n, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[r] = e;
|
|
3
3
|
var t = (n, r, e) => gr(n, typeof r != "symbol" ? r + "" : r, e);
|
|
4
4
|
import { jwtDecode as Ve } from "jwt-decode";
|
|
5
|
-
import { merge as Ee, isUndefined as mr, isNil as T, noop as C, toUpper as fr, constant as yr, isString as m, cloneDeep as
|
|
5
|
+
import { merge as Ee, isUndefined as mr, isNil as T, noop as C, toUpper as fr, constant as yr, isString as m, cloneDeep as Cr, toLower as wr, isFunction as Ie, isEmpty as Le, map as pe, forEach as vr, isDate as Pr, isArray as Je, omitBy as Rr, isObject as Ar } from "lodash-es";
|
|
6
6
|
import { objectToCamel as ke, objectToSnake as Ue } from "ts-case-convert";
|
|
7
7
|
import { defineStore as X } from "pinia";
|
|
8
8
|
import { ref as f, computed as v } from "vue";
|
|
@@ -420,7 +420,7 @@ class Xe {
|
|
|
420
420
|
}
|
|
421
421
|
class J extends w {
|
|
422
422
|
}
|
|
423
|
-
class
|
|
423
|
+
class Ce extends w {
|
|
424
424
|
/**
|
|
425
425
|
* Инициализирует экземпляр класса {@link Warehouse}.
|
|
426
426
|
*
|
|
@@ -467,7 +467,7 @@ class xr {
|
|
|
467
467
|
* Количество остатков товара на складе.
|
|
468
468
|
*/
|
|
469
469
|
t(this, "count");
|
|
470
|
-
this.warehouse = new
|
|
470
|
+
this.warehouse = new Ce(r == null ? void 0 : r.warehouse), this.count = (r == null ? void 0 : r.count) ?? 0;
|
|
471
471
|
}
|
|
472
472
|
}
|
|
473
473
|
class Nr extends Qe {
|
|
@@ -670,7 +670,7 @@ class qr extends B {
|
|
|
670
670
|
* Признак того, что позиция является дополнительной продажей.
|
|
671
671
|
*/
|
|
672
672
|
t(this, "isAdditionalSale");
|
|
673
|
-
this.product = new _(e == null ? void 0 : e.product), this.quantity = e.quantity ?? 0, this.marker = e.marker, this.category = e.category ?? new oe(), this.height = e.height, this.length = e.length, this.width = e.width, this.configurator = e.configurator, this.configuratorParams = e.configuratorParams &&
|
|
673
|
+
this.product = new _(e == null ? void 0 : e.product), this.quantity = e.quantity ?? 0, this.marker = e.marker, this.category = e.category ?? new oe(), this.height = e.height, this.length = e.length, this.width = e.width, this.configurator = e.configurator, this.configuratorParams = e.configuratorParams && Cr(e.configuratorParams), this.isAdditionalSale = e.isAdditionalSale;
|
|
674
674
|
}
|
|
675
675
|
}
|
|
676
676
|
class Ur extends qr {
|
|
@@ -811,7 +811,7 @@ const S = class S {
|
|
|
811
811
|
* @param request Данные запроса.
|
|
812
812
|
*/
|
|
813
813
|
// eslint-disable-next-line class-methods-use-this
|
|
814
|
-
t(this, "dataConverterRequestInterceptor", (r) => (r.method && (r.method === "get" && r.params && (r.params = Ue(r.params)), ["put", "patch", "post"].includes(
|
|
814
|
+
t(this, "dataConverterRequestInterceptor", (r) => (r.method && (r.method === "get" && r.params && (r.params = Ue(r.params)), ["put", "patch", "post"].includes(wr(r.method)) && r.data && (r.data = Ue(r.data))), r));
|
|
815
815
|
/**
|
|
816
816
|
* Перехватчик ошибок ответов на запрос.
|
|
817
817
|
*
|
|
@@ -1315,7 +1315,7 @@ class te extends $ {
|
|
|
1315
1315
|
e && (this.salesDirection = new I(e.salesDirection), this.photo = e.photo, e.contacts && (this.contacts = new Hr(e.contacts)), e.isDefault !== void 0 && (this.isDefault = e.isDefault));
|
|
1316
1316
|
}
|
|
1317
1317
|
}
|
|
1318
|
-
class
|
|
1318
|
+
class we extends te {
|
|
1319
1319
|
/**
|
|
1320
1320
|
* Инициализирует экземпляр класса {@link Manager}.
|
|
1321
1321
|
*
|
|
@@ -1374,7 +1374,7 @@ class zr extends oe {
|
|
|
1374
1374
|
* Данные о менеджере за которым закреплена категория.
|
|
1375
1375
|
*/
|
|
1376
1376
|
t(this, "manager");
|
|
1377
|
-
this.isDisabled = (e == null ? void 0 : e.isDisabled) ?? !1, this.isRequired = (e == null ? void 0 : e.isRequired) ?? !1, this.isFavorite = (e == null ? void 0 : e.isFavorite) ?? !1, this.hidingComment = e == null ? void 0 : e.hidingComment, this.manager = e != null && e.manager ? new
|
|
1377
|
+
this.isDisabled = (e == null ? void 0 : e.isDisabled) ?? !1, this.isRequired = (e == null ? void 0 : e.isRequired) ?? !1, this.isFavorite = (e == null ? void 0 : e.isFavorite) ?? !1, this.hidingComment = e == null ? void 0 : e.hidingComment, this.manager = e != null && e.manager ? new we(e.manager) : void 0;
|
|
1378
1378
|
}
|
|
1379
1379
|
}
|
|
1380
1380
|
class he extends zr {
|
|
@@ -1941,7 +1941,7 @@ class A extends ie {
|
|
|
1941
1941
|
* Возвращает {@link Promise} для получения справочника складов.
|
|
1942
1942
|
*/
|
|
1943
1943
|
getWarehouses() {
|
|
1944
|
-
return this.getTypedDataArrayRequester(
|
|
1944
|
+
return this.getTypedDataArrayRequester(Ce, "/public/references/warehouse", !0);
|
|
1945
1945
|
}
|
|
1946
1946
|
/**
|
|
1947
1947
|
* Возвращает {@link Promise} для получения справочника типов свойств.
|
|
@@ -1970,7 +1970,7 @@ class Qr extends ie {
|
|
|
1970
1970
|
const r = "/internal/managers", e = ie.getCachedResponse(r);
|
|
1971
1971
|
if (e)
|
|
1972
1972
|
return e;
|
|
1973
|
-
const i = (await this.get(r)).data.map((o) => xe.instanceInitializer(
|
|
1973
|
+
const i = (await this.get(r)).data.map((o) => xe.instanceInitializer(we, o));
|
|
1974
1974
|
return this.cacheResponse(r, i), i;
|
|
1975
1975
|
}
|
|
1976
1976
|
}
|
|
@@ -2273,9 +2273,13 @@ const et = X("__user_state_private", () => {
|
|
|
2273
2273
|
/**
|
|
2274
2274
|
* Данные о текущем пользователе.
|
|
2275
2275
|
*/
|
|
2276
|
-
currentUser: v(
|
|
2276
|
+
currentUser: v(() => {
|
|
2277
2277
|
const r = et();
|
|
2278
|
-
return !r.currentUser && !r.dataLoaderList.currentUser && (r.dataLoaderList.currentUser = !0,
|
|
2278
|
+
return !r.currentUser && !r.dataLoaderList.currentUser && (r.dataLoaderList.currentUser = !0, h.getInstance(Zr).getCurrentUser().then((e) => {
|
|
2279
|
+
r.currentUser = e;
|
|
2280
|
+
}).catch(C).finally(() => {
|
|
2281
|
+
r.dataLoaderList.currentUser = !1;
|
|
2282
|
+
})), r.currentUser;
|
|
2279
2283
|
})
|
|
2280
2284
|
}));
|
|
2281
2285
|
class rt {
|
|
@@ -4334,7 +4338,7 @@ class He extends ce {
|
|
|
4334
4338
|
* Дополнительные данные о клиенте.
|
|
4335
4339
|
*/
|
|
4336
4340
|
t(this, "extraData");
|
|
4337
|
-
this.contragents = ((s = e == null ? void 0 : e.contragents) == null ? void 0 : s.map((p) => me.createInstance(p))) ?? [], this.partnerGroups = ((i = e == null ? void 0 : e.partnerGroups) == null ? void 0 : i.map((p) => new Y(p))) ?? [], this.contacts = ((o = e == null ? void 0 : e.contacts) == null ? void 0 : o.map((p) => new F(p))) ?? [], this.deliveryAddresses = ((c = e == null ? void 0 : e.deliveryAddresses) == null ? void 0 : c.map((p) => new fe(p))) ?? [], this.channelPrimaryInterest = new sr(e == null ? void 0 : e.channelPrimaryInterest), this.sourcePrimaryInterest = new nr(e == null ? void 0 : e.sourcePrimaryInterest), this.preferredDeliveryType = new J(e == null ? void 0 : e.preferredDeliveryType), this.primaryDemand = e == null ? void 0 : e.primaryDemand, this.isExcludedFromMsCallsToClients = (e == null ? void 0 : e.isExcludedFromMsCallsToClients) ?? !1, this.preferredWarehouse = e != null && e.preferredWarehouse ? new
|
|
4341
|
+
this.contragents = ((s = e == null ? void 0 : e.contragents) == null ? void 0 : s.map((p) => me.createInstance(p))) ?? [], this.partnerGroups = ((i = e == null ? void 0 : e.partnerGroups) == null ? void 0 : i.map((p) => new Y(p))) ?? [], this.contacts = ((o = e == null ? void 0 : e.contacts) == null ? void 0 : o.map((p) => new F(p))) ?? [], this.deliveryAddresses = ((c = e == null ? void 0 : e.deliveryAddresses) == null ? void 0 : c.map((p) => new fe(p))) ?? [], this.channelPrimaryInterest = new sr(e == null ? void 0 : e.channelPrimaryInterest), this.sourcePrimaryInterest = new nr(e == null ? void 0 : e.sourcePrimaryInterest), this.preferredDeliveryType = new J(e == null ? void 0 : e.preferredDeliveryType), this.primaryDemand = e == null ? void 0 : e.primaryDemand, this.isExcludedFromMsCallsToClients = (e == null ? void 0 : e.isExcludedFromMsCallsToClients) ?? !1, this.preferredWarehouse = e != null && e.preferredWarehouse ? new Ce(e.preferredWarehouse) : void 0, this.extraData = (e == null ? void 0 : e.extraData) ?? {};
|
|
4338
4342
|
}
|
|
4339
4343
|
}
|
|
4340
4344
|
class zt {
|
|
@@ -4433,7 +4437,7 @@ class zt {
|
|
|
4433
4437
|
*/
|
|
4434
4438
|
t(this, "lastOrder");
|
|
4435
4439
|
var e, s, i, o, c, p;
|
|
4436
|
-
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((u) => new Oe(u)), this.region = new se(r == null ? void 0 : r.region), this.country = new Q(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 O(r == null ? void 0 : r.createdAt), this.lastLoginDate = new O(r == null ? void 0 : r.lastLoginDate), this.lastLoginDateHasOrder = (r == null ? void 0 : r.lastLoginDateHasOrder) ?? void 0, this.managers = r != null && r.managers && r.managers.length > 0 ? r.managers.map((u) => new
|
|
4440
|
+
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((u) => new Oe(u)), this.region = new se(r == null ? void 0 : r.region), this.country = new Q(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 O(r == null ? void 0 : r.createdAt), this.lastLoginDate = new O(r == null ? void 0 : r.lastLoginDate), this.lastLoginDateHasOrder = (r == null ? void 0 : r.lastLoginDateHasOrder) ?? void 0, this.managers = r != null && r.managers && r.managers.length > 0 ? r.managers.map((u) => new we(u)) : [], this.salesDirections = (s = r == null ? void 0 : r.salesDirections) == null ? void 0 : s.map((u) => new I(u)), this.contragentInn = r == null ? void 0 : r.contragentInn, this.contragentType = new M(r == null ? void 0 : r.contragentType), this.preferredDeliveryType = new J(r == null ? void 0 : r.preferredDeliveryType), this.partnerGroups = (i = r == null ? void 0 : r.partnerGroups) == null ? void 0 : i.map((u) => new Y(u)), this.contact = new Se(r == null ? void 0 : r.contact), this.lastOrder = {
|
|
4437
4441
|
createdAt: new O((o = r == null ? void 0 : r.lastOrder) == null ? void 0 : o.createdAt),
|
|
4438
4442
|
creator: (c = r == null ? void 0 : r.lastOrder) == null ? void 0 : c.creator,
|
|
4439
4443
|
isApproved: (p = r == null ? void 0 : r.lastOrder) == null ? void 0 : p.isApproved
|
|
@@ -5510,7 +5514,7 @@ class Qt {
|
|
|
5510
5514
|
* Генерирует и возвращает данные-заглушку неопределённого менеджера.
|
|
5511
5515
|
*/
|
|
5512
5516
|
static generateUndefinedManagerInstance() {
|
|
5513
|
-
return new
|
|
5517
|
+
return new we({ id: 0, name: "- Не назначен -", isActive: !0, guid: "-undefined-" });
|
|
5514
5518
|
}
|
|
5515
5519
|
/**
|
|
5516
5520
|
* Выполняет проверку, является ли указанная запись записью-заглушкой с данными о неопределённом менеджере.
|
|
@@ -5578,7 +5582,7 @@ class ur extends pr {
|
|
|
5578
5582
|
type: ((c = e == null ? void 0 : e.delivery) == null ? void 0 : c.type) ?? -1,
|
|
5579
5583
|
date: m((p = e == null ? void 0 : e.delivery) == null ? void 0 : p.date) ? y(e.delivery.date) : ((u = e == null ? void 0 : e.delivery) == null ? void 0 : u.date) ?? /* @__PURE__ */ new Date(),
|
|
5580
5584
|
address: (R = e == null ? void 0 : e.delivery) != null && R.address ? new fe(e.delivery.address) : void 0,
|
|
5581
|
-
warehouse: (a = e == null ? void 0 : e.delivery) != null && a.warehouse ? new
|
|
5585
|
+
warehouse: (a = e == null ? void 0 : e.delivery) != null && a.warehouse ? new Ce(e.delivery.warehouse) : void 0
|
|
5582
5586
|
}, this.attachedUser = new G(e == null ? void 0 : e.attachedUser), this.status = (e == null ? void 0 : e.status) ?? 0, this.salesDirection = new I(e == null ? void 0 : e.salesDirection), this.pendingAt = m(e == null ? void 0 : e.pendingAt) ? y(e.pendingAt) : e == null ? void 0 : e.pendingAt, this.processedAt = m(e == null ? void 0 : e.processedAt) ? y(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;
|
|
5583
5587
|
}
|
|
5584
5588
|
}
|
|
@@ -6077,7 +6081,7 @@ export {
|
|
|
6077
6081
|
B as Identity,
|
|
6078
6082
|
Or as Image,
|
|
6079
6083
|
ue as JwtPayload,
|
|
6080
|
-
|
|
6084
|
+
we as Manager,
|
|
6081
6085
|
te as ManagerCommon,
|
|
6082
6086
|
Qt as ManagerDataFactory,
|
|
6083
6087
|
Qr as ManagerDataProvider,
|
|
@@ -6143,7 +6147,7 @@ export {
|
|
|
6143
6147
|
G as UserShortInfo,
|
|
6144
6148
|
Yr as UserTypeEnum,
|
|
6145
6149
|
nt as VersionConfig,
|
|
6146
|
-
|
|
6150
|
+
Ce as Warehouse,
|
|
6147
6151
|
Be as findCatalogItemByIdRecursive,
|
|
6148
6152
|
Re as useAuthStateStore,
|
|
6149
6153
|
St as useReferencesStore,
|