@snabcentr/common-lib 1.44.0 → 1.45.0

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.
@@ -4,6 +4,6 @@
4
4
  "name": "public-api",
5
5
  "src": "src/public-api.ts",
6
6
  "isEntry": true,
7
- "integrity": "sha384-ukPb6cgmkEnU6lnD7zMDjbUiqWKTRI9Lt9EHhX2/JIZ6FRv2kIRwc3fFBJsSeCGY"
7
+ "integrity": "sha384-scnb0KZ6dvGAmeciO+yrbUlm0SOpDTPUs9fNclFjUgs6xGGF5A2f1lkJmbTOR83A"
8
8
  }
9
9
  }
@@ -1,6 +1,6 @@
1
- ## 1.44.0 (2025-04-25)
1
+ ## 1.45.0 (2025-04-28)
2
2
 
3
- ### added (1 change)
3
+ ### changed (1 change)
4
4
 
5
- - [#11455: Добавлена HTTP конфигурация для media-сервера](web_soft/libs/ts/snabcentr-common-lib@fd8f7411bc6090e3d19e8bf50afc89fe8677b6c0) ([merge request](web_soft/libs/ts/snabcentr-common-lib!70))
5
+ - [#11455: Доработана конфигурация URL-адресов](web_soft/libs/ts/snabcentr-common-lib@159cfc307c0b9871dd41c438453a60222f8f8595) ([merge request](web_soft/libs/ts/snabcentr-common-lib!71))
6
6
 
@@ -6,7 +6,7 @@ import { format as rr, addSeconds as sr, parseISO as N, isAfter as tr, startOfTo
6
6
  import gr from "axios";
7
7
  import { objectToSnake as be, objectToCamel as mr } from "ts-case-convert";
8
8
  import { defineStore as oe } from "pinia";
9
- import { ref as w, computed as C } from "vue";
9
+ import { ref as y, computed as w } from "vue";
10
10
  class K {
11
11
  /**
12
12
  * Инициализирует экземпляр класса {@link Identity}.
@@ -378,10 +378,7 @@ class x extends yr {
378
378
  s(this, "priceCoefficients");
379
379
  this.supplierSku = e == null ? void 0 : e.supplierSku, this.unit = (e == null ? void 0 : e.unit) ?? "", this.pack = e == null ? void 0 : e.pack, this.minCount = e == null ? void 0 : e.minCount, this.quantityUnit = e == null ? void 0 : e.quantityUnit, this.currency = (e == null ? void 0 : e.currency) ?? "", this.cost = (e == null ? void 0 : e.cost) ?? 0, this.costRub = (e == null ? void 0 : e.costRub) ?? 0, this.costDate = e == null ? void 0 : e.costDate, this.onOrder = (e == null ? void 0 : e.onOrder) ?? !1, this.stockCount = ((n = e == null ? void 0 : e.stockCount) == null ? void 0 : n.map((g) => new fr(g))) ?? [], this.type = "product";
380
380
  const t = (e == null ? void 0 : e.category) ?? ((o = e == null ? void 0 : e.categories) == null ? void 0 : o.find((g) => g.isPrimary));
381
- t && (this.category = new fe({ ...t, isPrimary: !0 }), this.categories = [this.category]), e != null && e.categories && (this.categories = e.categories.map((g) => new fe(g))), this.images = ((l = e == null ? void 0 : e.images) == null ? void 0 : l.map((g) => {
382
- var y;
383
- return new wr(g, (y = O.getConfig().urls) == null ? void 0 : y.mediaServer);
384
- })) ?? [], this.properties = (e == null ? void 0 : e.properties) ?? {}, this.priceCoefficients = ((u = e == null ? void 0 : e.priceCoefficients) == null ? void 0 : u.map((g) => new De(g))) ?? [], e && "codeNumber" in e && !e.code && (this.code = e == null ? void 0 : e.codeNumber);
381
+ t && (this.category = new fe({ ...t, isPrimary: !0 }), this.categories = [this.category]), e != null && e.categories && (this.categories = e.categories.map((g) => new fe(g))), this.images = ((l = e == null ? void 0 : e.images) == null ? void 0 : l.map((g) => new wr(g, O.getConfig().http.mediaUrl))) ?? [], this.properties = (e == null ? void 0 : e.properties) ?? {}, this.priceCoefficients = ((u = e == null ? void 0 : e.priceCoefficients) == null ? void 0 : u.map((g) => new De(g))) ?? [], e && "codeNumber" in e && !e.code && (this.code = e == null ? void 0 : e.codeNumber);
385
382
  }
386
383
  /**
387
384
  * Возвращает признак, что это измеряемый товар.
@@ -2169,8 +2166,8 @@ class Ae extends p {
2169
2166
  page: (n == null ? void 0 : n.page) ?? 1,
2170
2167
  per_page: (n == null ? void 0 : n.pageSize) ?? (n == null ? void 0 : n.perPage) ?? 10
2171
2168
  };
2172
- return e && (u.filters = JSON.stringify(e)), Xe(t) || (Ze(t) ? t : [t]).forEach((g, y) => {
2173
- u[`sort[${y}][field]`] = g.field, u[`sort[${y}][direction]`] = g.direction;
2169
+ return e && (u.filters = JSON.stringify(e)), Xe(t) || (Ze(t) ? t : [t]).forEach((g, C) => {
2170
+ u[`sort[${C}][field]`] = g.field, u[`sort[${C}][direction]`] = g.direction;
2174
2171
  }), this.get(r, u, o, l);
2175
2172
  }
2176
2173
  }
@@ -3145,7 +3142,7 @@ class ws {
3145
3142
  }, this.lastLoginDate = {
3146
3143
  from: ((n = r == null ? void 0 : r.lastLoginDate) == null ? void 0 : n.from) ?? null,
3147
3144
  to: ((o = r == null ? void 0 : r.lastLoginDate) == null ? void 0 : o.to) ?? null
3148
- }, this.lastLoginDateHasOrder = (r == null ? void 0 : r.lastLoginDateHasOrder) ?? void 0, this.managers = r != null && r.managers && r.managers.length > 0 ? r.managers.map((y) => new pe(y)) : [], this.salesDirection = new T(r == null ? void 0 : r.salesDirection), this.contragentInn = (r == null ? void 0 : r.contragentInn) ?? "", this.contragentType = new G(r == null ? void 0 : r.contragentType), this.preferredDeliveryType = new V(r == null ? void 0 : r.preferredDeliveryType), this.hasCostLessThenStop = r != null && r.hasCostLessThenStop ? !0 : void 0, this.partnerGroup = new M(r == null ? void 0 : r.partnerGroup), this.contact = new ve(r == null ? void 0 : r.contact), this.lastOrder = {
3145
+ }, this.lastLoginDateHasOrder = (r == null ? void 0 : r.lastLoginDateHasOrder) ?? void 0, this.managers = r != null && r.managers && r.managers.length > 0 ? r.managers.map((C) => new pe(C)) : [], this.salesDirection = new T(r == null ? void 0 : r.salesDirection), this.contragentInn = (r == null ? void 0 : r.contragentInn) ?? "", this.contragentType = new G(r == null ? void 0 : r.contragentType), this.preferredDeliveryType = new V(r == null ? void 0 : r.preferredDeliveryType), this.hasCostLessThenStop = r != null && r.hasCostLessThenStop ? !0 : void 0, this.partnerGroup = new M(r == null ? void 0 : r.partnerGroup), this.contact = new ve(r == null ? void 0 : r.contact), this.lastOrder = {
3149
3146
  createdAt: (l = r == null ? void 0 : r.lastOrder) == null ? void 0 : l.createdAt,
3150
3147
  creator: (u = r == null ? void 0 : r.lastOrder) == null ? void 0 : u.creator,
3151
3148
  isApproved: (g = r == null ? void 0 : r.lastOrder) == null ? void 0 : g.isApproved
@@ -3255,7 +3252,7 @@ class ze extends We {
3255
3252
  * @param data Данные для первоначальной инициализации.
3256
3253
  */
3257
3254
  constructor(e) {
3258
- var t, n, o, l, u, g, y, A;
3255
+ var t, n, o, l, u, g, C, A;
3259
3256
  super(e);
3260
3257
  /**
3261
3258
  * Краткие данные о клиенте.
@@ -3304,7 +3301,7 @@ class ze extends We {
3304
3301
  }, this.delivery = {
3305
3302
  type: ((l = e == null ? void 0 : e.delivery) == null ? void 0 : l.type) ?? -1,
3306
3303
  date: D((u = e == null ? void 0 : e.delivery) == null ? void 0 : u.date) ? j(e == null ? void 0 : e.delivery.date, "dd.MM.yyyy", /* @__PURE__ */ new Date()) : ((g = e == null ? void 0 : e.delivery) == null ? void 0 : g.date) ?? /* @__PURE__ */ new Date(),
3307
- address: (y = e == null ? void 0 : e.delivery) != null && y.address ? new ie(e.delivery.address) : void 0,
3304
+ address: (C = e == null ? void 0 : e.delivery) != null && C.address ? new ie(e.delivery.address) : void 0,
3308
3305
  warehouse: (A = e == null ? void 0 : e.delivery) != null && A.warehouse ? new le(e.delivery.warehouse) : void 0
3309
3306
  }, this.attachedUser = new q(e == null ? void 0 : e.attachedUser), this.status = (e == null ? void 0 : e.status) ?? 0, this.salesDirection = new T(e == null ? void 0 : e.salesDirection), this.pendingAt = D(e == null ? void 0 : e.pendingAt) ? j(e == null ? void 0 : e.pendingAt, "dd.MM.yyyy HH:mm", /* @__PURE__ */ new Date()) : (e == null ? void 0 : e.pendingAt) ?? /* @__PURE__ */ new Date(), this.processedAt = D(e == null ? void 0 : e.processedAt) ? j(e == null ? void 0 : e.processedAt, "dd.MM.yyyy HH:mm", /* @__PURE__ */ new Date()) : (e == null ? void 0 : e.processedAt) ?? /* @__PURE__ */ new Date(), this.isOnOrder = (e == null ? void 0 : e.isOnOrder) ?? !1, this.isNotInStock = (e == null ? void 0 : e.isNotInStock) ?? !1;
3310
3307
  }
@@ -3769,7 +3766,7 @@ class Ds extends Ae {
3769
3766
  * @see /doc/api/internal#/Контрагенты/api_internal_client_contragent_create
3770
3767
  */
3771
3768
  createContragentClientData(r, e, t = {}) {
3772
- var g, y, A, S, _, L, a, I;
3769
+ var g, C, A, S, _, L, a, I;
3773
3770
  let n;
3774
3771
  const o = e, l = e, u = e;
3775
3772
  switch (e.opf.slug) {
@@ -3779,7 +3776,7 @@ class Ds extends Ae {
3779
3776
  name: o.name,
3780
3777
  alternative_name: o.alternativeName,
3781
3778
  partner_group_id: (g = o.partnerGroup) == null ? void 0 : g.id,
3782
- manager_id: (y = o.manager) == null ? void 0 : y.id,
3779
+ manager_id: (C = o.manager) == null ? void 0 : C.id,
3783
3780
  comment: o.comment,
3784
3781
  inn: o.inn,
3785
3782
  okpo: o.okpo,
@@ -3861,7 +3858,7 @@ class Ds extends Ae {
3861
3858
  * @see /doc/api/internal#/Контрагенты/api_internal_client_contragent_update
3862
3859
  */
3863
3860
  updateContragentClientData(r, e, t = {}) {
3864
- var g, y, A, S, _, L, a, I;
3861
+ var g, C, A, S, _, L, a, I;
3865
3862
  let n;
3866
3863
  const o = e, l = e, u = e;
3867
3864
  switch (e.opf.slug) {
@@ -3871,7 +3868,7 @@ class Ds extends Ae {
3871
3868
  name: o.name,
3872
3869
  alternative_name: o.alternativeName,
3873
3870
  partner_group_id: (g = o.partnerGroup) == null ? void 0 : g.id,
3874
- manager_id: (y = o.manager) == null ? void 0 : y.id,
3871
+ manager_id: (C = o.manager) == null ? void 0 : C.id,
3875
3872
  comment: o.comment,
3876
3873
  inn: o.inn,
3877
3874
  okpo: o.okpo,
@@ -4563,7 +4560,7 @@ class Ts extends p {
4563
4560
  }
4564
4561
  }
4565
4562
  const v = oe("__references_private", () => {
4566
- const i = w({}), r = w(void 0), e = w(void 0), t = w(void 0), n = w(void 0), o = w(void 0), l = w(void 0), u = w(void 0), g = w(void 0), y = w(void 0), A = w(void 0), S = w(void 0), _ = w(void 0), L = w(void 0), a = w(void 0), I = w(void 0), d = w(void 0), c = w(void 0);
4563
+ const i = y({}), r = y(void 0), e = y(void 0), t = y(void 0), n = y(void 0), o = y(void 0), l = y(void 0), u = y(void 0), g = y(void 0), C = y(void 0), A = y(void 0), S = y(void 0), _ = y(void 0), L = y(void 0), a = y(void 0), I = y(void 0), d = y(void 0), c = y(void 0);
4567
4564
  return {
4568
4565
  /**
4569
4566
  * Список загружаемых/загруженных на данный момент значений.
@@ -4604,7 +4601,7 @@ const v = oe("__references_private", () => {
4604
4601
  /**
4605
4602
  * Справочник типов оплаты заказов.
4606
4603
  */
4607
- paymentTypeReference: y,
4604
+ paymentTypeReference: C,
4608
4605
  /**
4609
4606
  * Справочник групп партнеров.
4610
4607
  */
@@ -4639,87 +4636,87 @@ const v = oe("__references_private", () => {
4639
4636
  priceCoefficientsReference: c
4640
4637
  };
4641
4638
  }), Ss = oe("references", () => {
4642
- const i = C(() => {
4639
+ const i = w(() => {
4643
4640
  const c = v();
4644
4641
  return !c.channelPrimaryInterestReference && !c.dataLoaderList.channelPrimaryInterestReference && (c.dataLoaderList.channelPrimaryInterestReference = !0, p.getInstance(R).getChannelPrimaryInterest().then((h) => {
4645
4642
  c.channelPrimaryInterestReference = h;
4646
4643
  }).catch(m)), c.channelPrimaryInterestReference;
4647
- }), r = C(() => {
4644
+ }), r = w(() => {
4648
4645
  const c = v();
4649
4646
  return !c.contactPositionsReference && !c.dataLoaderList.contactPositionsReference && (c.dataLoaderList.contactPositionsReference = !0, p.getInstance(R).getContactPositions().then((h) => {
4650
4647
  c.contactPositionsReference = h;
4651
4648
  }).catch(m)), c.contactPositionsReference;
4652
- }), e = C(() => {
4649
+ }), e = w(() => {
4653
4650
  const c = v();
4654
4651
  return !c.currencyReference && !c.dataLoaderList.currencyReference && (c.dataLoaderList.currencyReference = !0, p.getInstance(R).getCurrency().then((h) => {
4655
4652
  c.currencyReference = h;
4656
4653
  }).catch(m)), c.currencyReference;
4657
- }), t = C(() => {
4654
+ }), t = w(() => {
4658
4655
  const c = v();
4659
4656
  return !c.opfReference && !c.dataLoaderList.opfReference && (c.dataLoaderList.opfReference = !0, p.getInstance(R).getOpf().then((h) => {
4660
4657
  c.opfReference = h;
4661
4658
  }).catch(m)), c.opfReference;
4662
- }), n = C(() => {
4659
+ }), n = w(() => {
4663
4660
  const c = v();
4664
4661
  return !c.orderPaymentStatusReference && !c.dataLoaderList.orderPaymentStatusReference && (c.dataLoaderList.orderPaymentStatusReference = !0, p.getInstance(R).getOrderPaymentStatuses().then((h) => {
4665
4662
  c.orderPaymentStatusReference = h;
4666
4663
  }).catch(m)), c.orderPaymentStatusReference;
4667
- }), o = C(() => {
4664
+ }), o = w(() => {
4668
4665
  const c = v();
4669
4666
  return !c.orderStatusReference && !c.dataLoaderList.orderStatusReference && (c.dataLoaderList.orderStatusReference = !0, p.getInstance(R).getOrderStatuses().then((h) => {
4670
4667
  c.orderStatusReference = h;
4671
4668
  }).catch(m)), c.orderStatusReference;
4672
- }), l = C(() => {
4669
+ }), l = w(() => {
4673
4670
  const c = v();
4674
4671
  return !c.paymentTypeReference && !c.dataLoaderList.paymentTypeReference && (c.dataLoaderList.paymentTypeReference = !0, p.getInstance(R).getPaymentTypes().then((h) => {
4675
4672
  c.paymentTypeReference = h;
4676
4673
  }).catch(m)), c.paymentTypeReference;
4677
- }), u = C(() => {
4674
+ }), u = w(() => {
4678
4675
  const c = v();
4679
4676
  return !c.partnerGroupReference && !c.dataLoaderList.partnerGroupReference && (c.dataLoaderList.partnerGroupReference = !0, p.getInstance(R).getPartnerGroup().then((h) => {
4680
4677
  c.partnerGroupReference = h;
4681
4678
  }).catch(m)), c.partnerGroupReference;
4682
- }), g = C(() => {
4679
+ }), g = w(() => {
4683
4680
  const c = v();
4684
4681
  return !c.productFileTypeReference && !c.dataLoaderList.productFileTypeReference && (c.dataLoaderList.productFileTypeReference = !0, p.getInstance(R).getProductFileType().then((h) => {
4685
4682
  c.productFileTypeReference = h;
4686
4683
  }).catch(m)), c.productFileTypeReference;
4687
- }), y = C(() => {
4684
+ }), C = w(() => {
4688
4685
  const c = v();
4689
4686
  return !c.resourceTypesReference && !c.dataLoaderList.resourceTypesReference && (c.dataLoaderList.resourceTypesReference = !0, p.getInstance(R).getResourceTypes().then((h) => {
4690
4687
  c.resourceTypesReference = h;
4691
4688
  }).catch(m)), c.resourceTypesReference;
4692
- }), A = C(() => {
4689
+ }), A = w(() => {
4693
4690
  const c = v();
4694
4691
  return !c.salesDirectionsReference && !c.dataLoaderList.salesDirectionsReference && (c.dataLoaderList.salesDirectionsReference = !0, p.getInstance(R).getSalesDirections().then((h) => {
4695
4692
  c.salesDirectionsReference = h;
4696
4693
  }).catch(m)), c.salesDirectionsReference;
4697
- }), S = C(() => {
4694
+ }), S = w(() => {
4698
4695
  const c = v();
4699
4696
  return !c.sourcePrimaryInterestReference && !c.dataLoaderList.sourcePrimaryInterestReference && (c.dataLoaderList.sourcePrimaryInterestReference = !0, p.getInstance(R).getSourcePrimaryInterest().then((h) => {
4700
4697
  c.sourcePrimaryInterestReference = h;
4701
4698
  }).catch(m)), c.sourcePrimaryInterestReference;
4702
- }), _ = C(() => {
4699
+ }), _ = w(() => {
4703
4700
  const c = v();
4704
4701
  return !c.deliveryTypeReference && !c.dataLoaderList.deliveryTypeReference && (c.dataLoaderList.deliveryTypeReference = !0, p.getInstance(R).getDeliveryTypes().then((h) => {
4705
4702
  c.deliveryTypeReference = h;
4706
4703
  }).catch(m)), c.deliveryTypeReference;
4707
- }), L = C(() => {
4704
+ }), L = w(() => {
4708
4705
  const c = v();
4709
4706
  return !c.managersList && !c.dataLoaderList.managersList && (c.dataLoaderList.managersList = !0, p.getInstance(Kr).getManagers().then((h) => {
4710
4707
  c.managersList = h;
4711
4708
  }).catch(m)), c.managersList;
4712
- }), a = C(() => {
4709
+ }), a = w(() => {
4713
4710
  const c = v();
4714
4711
  return !c.warehousesReference && !c.dataLoaderList.warehousesReference && (c.dataLoaderList.warehousesReference = !0, p.getInstance(R).getWarehouses().then((h) => {
4715
4712
  c.warehousesReference = h;
4716
4713
  }).catch(m)), c.warehousesReference;
4717
- }), I = C(() => {
4714
+ }), I = w(() => {
4718
4715
  const c = v();
4719
4716
  return !c.propertyTypesReference && !c.dataLoaderList.propertyTypesReference && (c.dataLoaderList.propertyTypesReference = !0, p.getInstance(R).getPropertyTypes().then((h) => {
4720
4717
  c.propertyTypesReference = h;
4721
4718
  }).catch(m)), c.propertyTypesReference;
4722
- }), d = C(() => {
4719
+ }), d = w(() => {
4723
4720
  const c = v();
4724
4721
  return !c.priceCoefficientsReference && !c.dataLoaderList.priceCoefficientsReference && (c.dataLoaderList.priceCoefficientsReference = !0, p.getInstance(R).getPriceCoefficients().then((h) => {
4725
4722
  c.priceCoefficientsReference = h;
@@ -4765,7 +4762,7 @@ const v = oe("__references_private", () => {
4765
4762
  /**
4766
4763
  * Справочник типов ресурсов.
4767
4764
  */
4768
- resourceTypesReference: y,
4765
+ resourceTypesReference: C,
4769
4766
  /**
4770
4767
  * Справочник направлений продаж.
4771
4768
  */
@@ -4796,7 +4793,7 @@ const v = oe("__references_private", () => {
4796
4793
  priceCoefficientsReference: d
4797
4794
  };
4798
4795
  }), Qr = oe("__user_state_private", () => {
4799
- const i = w({}), r = w(void 0);
4796
+ const i = y({}), r = y(void 0);
4800
4797
  return {
4801
4798
  /**
4802
4799
  * Список загружаемых/загруженных на данный момент значений.
@@ -4811,7 +4808,7 @@ const v = oe("__references_private", () => {
4811
4808
  /**
4812
4809
  * Данные о текущем пользователе.
4813
4810
  */
4814
- currentUser: C(() => {
4811
+ currentUser: w(() => {
4815
4812
  const r = Qr();
4816
4813
  return !r.currentUser && !r.dataLoaderList.currentUser && (r.dataLoaderList.currentUser = !0, p.getInstance(Gr).getCurrentUser().then((e) => {
4817
4814
  r.currentUser = e;