@snabcentr/common-lib 1.65.1 → 1.65.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.
@@ -4,6 +4,6 @@
4
4
  "name": "public-api",
5
5
  "src": "src/public-api.ts",
6
6
  "isEntry": true,
7
- "integrity": "sha384-sooKr1SKWo4zQVKBmy99WIAKlSme5q00fhhmaRp9HXXSnDgI0zFcrtLO9pAEkZdr"
7
+ "integrity": "sha384-4+YuSrlnY9ab27jsDyWATGszGQlou2Ht4Ra/FUU2zQbIjyUXYLibnhGFg6wzjeZW"
8
8
  }
9
9
  }
@@ -1,4 +1,6 @@
1
- ## 1.65.1 (2025-08-27)
1
+ ## 1.65.2 (2025-08-28)
2
2
 
3
- No changes.
3
+ ### added (1 change)
4
+
5
+ - [#12144: Добавлено свойство isManagerRequired в фильтры клиентов.](web_soft/libs/ts/snabcentr-common-lib@400e9373320d375f19120b18058a7bd1b0aa3833) ([merge request](web_soft/libs/ts/snabcentr-common-lib!125))
4
6
 
@@ -4,7 +4,7 @@ var t = (n, r, e) => pr(n, typeof r != "symbol" ? r + "" : r, e);
4
4
  import { jwtDecode as je } from "jwt-decode";
5
5
  import { merge as We, isNil as U, toUpper as hr, constant as gr, isUndefined as mr, isString as f, cloneDeep as fr, noop as m, toLower as yr, isFunction as _e, isEmpty as Se, map as le, forEach as wr, isDate as Cr, isArray as Ee, omitBy as vr, isObject as Pr } from "lodash-es";
6
6
  import { objectToCamel as Ie, objectToSnake as Oe } from "ts-case-convert";
7
- import { parseISO as y, format as z, isAfter as Rr, startOfToday as Ve, addSeconds as Ar, addBusinessDays as Dr, endOfTomorrow as $r, startOfTomorrow as ar, endOfYesterday as Tr, startOfYesterday as br, endOfToday as _r, endOfDay as Sr, startOfDay as Ir } from "date-fns";
7
+ import { parseISO as y, format as z, isAfter as Rr, startOfToday as Ve, addSeconds as Ar, addBusinessDays as Dr, endOfTomorrow as ar, startOfTomorrow as $r, endOfYesterday as Tr, startOfYesterday as br, endOfToday as _r, endOfDay as Sr, startOfDay as Ir } from "date-fns";
8
8
  import Lr from "axios";
9
9
  import { defineStore as fe } from "pinia";
10
10
  import { ref as C, computed as v } from "vue";
@@ -178,7 +178,7 @@ class B {
178
178
  return typeof this.id == "number" ? this.id === -1 : typeof this.id == "string" ? this.id === "" : U(this.id);
179
179
  }
180
180
  }
181
- class a extends B {
181
+ class $ extends B {
182
182
  /**
183
183
  * Инициализирует экземпляр класса {@link NamedIdentity}.
184
184
  *
@@ -193,7 +193,7 @@ class a extends B {
193
193
  this.name = (e == null ? void 0 : e.name) ?? "";
194
194
  }
195
195
  }
196
- class Je extends a {
196
+ class Je extends $ {
197
197
  /**
198
198
  * Инициализирует экземпляр класса {@link CatalogableItem}.
199
199
  *
@@ -216,7 +216,7 @@ class Je extends a {
216
216
  this.slug = (e == null ? void 0 : e.slug) ?? "", this.code = (e == null ? void 0 : e.code) ?? "";
217
217
  }
218
218
  }
219
- class ae extends Je {
219
+ class $e extends Je {
220
220
  /**
221
221
  * Инициализирует экземпляр класса {@link PrimaryCatalogableItem}.
222
222
  *
@@ -231,7 +231,7 @@ class ae extends Je {
231
231
  this.isPrimary = (e == null ? void 0 : e.isPrimary) ?? !1;
232
232
  }
233
233
  }
234
- class ne extends ae {
234
+ class ne extends $e {
235
235
  /**
236
236
  * Инициализирует экземпляр класса {@link BaseCategory}.
237
237
  *
@@ -259,7 +259,7 @@ class ne extends ae {
259
259
  }
260
260
  }
261
261
  var Ke = /* @__PURE__ */ ((n) => (n.K0 = "k0", n.K1 = "k1", n.K2 = "k2", n.K3 = "k3", n.K4 = "k4", n.Retail = "retail", n))(Ke || {});
262
- class w extends a {
262
+ class w extends $ {
263
263
  /**
264
264
  * Инициализирует экземпляр класса {@link Reference}.
265
265
  *
@@ -422,7 +422,7 @@ const W = class W {
422
422
  * Конфигурация приложения.
423
423
  */
424
424
  t(W, "config");
425
- let $ = W;
425
+ let a = W;
426
426
  class kr extends Je {
427
427
  /**
428
428
  * Инициализирует экземпляр класса {@link HiddenCatalogableItem}.
@@ -548,14 +548,14 @@ class b extends kr {
548
548
  t(this, "priceCoefficients");
549
549
  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 = f(e == null ? void 0 : e.costDate) ? y(e.costDate) : e == null ? void 0 : e.costDate, this.onOrder = (e == null ? void 0 : e.onOrder) ?? !1, this.stockCount = ((i = e == null ? void 0 : e.stockCount) == null ? void 0 : i.map((p) => new xr(p))) ?? [], this.currencySignature = (e == null ? void 0 : e.currencySignature) ?? "", this.type = "product";
550
550
  const s = (e == null ? void 0 : e.category) ?? ((o = e == null ? void 0 : e.categories) == null ? void 0 : o.find((p) => p.isPrimary));
551
- s && (this.category = new ae({ ...s, isPrimary: !0 }), this.categories = [this.category]), e != null && e.categories && (this.categories = e.categories.map((p) => new ae(p))), this.images = ((c = e == null ? void 0 : e.images) == null ? void 0 : c.map((p) => new dr(p, $.getConfig().http.mediaUrl))) ?? [], this.properties = (e == null ? void 0 : e.properties) ?? {}, this.retailCost = e == null ? void 0 : e.retailCost, this.retailCostRub = e == null ? void 0 : e.retailCostRub, this.priceCoefficients = ((u = e == null ? void 0 : e.priceCoefficients) == null ? void 0 : u.map((p) => new Le(p))) ?? [], e && "codeNumber" in e && !e.code && (this.code = e == null ? void 0 : e.codeNumber);
551
+ s && (this.category = new $e({ ...s, isPrimary: !0 }), this.categories = [this.category]), e != null && e.categories && (this.categories = e.categories.map((p) => new $e(p))), this.images = ((c = e == null ? void 0 : e.images) == null ? void 0 : c.map((p) => new dr(p, a.getConfig().http.mediaUrl))) ?? [], this.properties = (e == null ? void 0 : e.properties) ?? {}, this.retailCost = e == null ? void 0 : e.retailCost, this.retailCostRub = e == null ? void 0 : e.retailCostRub, this.priceCoefficients = ((u = e == null ? void 0 : e.priceCoefficients) == null ? void 0 : u.map((p) => new Le(p))) ?? [], e && "codeNumber" in e && !e.code && (this.code = e == null ? void 0 : e.codeNumber);
552
552
  }
553
553
  /**
554
554
  * Возвращает признак, что это измеряемый товар.
555
555
  */
556
556
  getIsMeasurable() {
557
557
  var s;
558
- const e = (s = $.getConfig().catalog) == null ? void 0 : s.products.units;
558
+ const e = (s = a.getConfig().catalog) == null ? void 0 : s.products.units;
559
559
  return [...(e == null ? void 0 : e.linear) ?? ["пог.м.", "м."], ...(e == null ? void 0 : e.square) ?? ["м2"]].includes(this.unit);
560
560
  }
561
561
  /**
@@ -899,7 +899,7 @@ const _ = class _ {
899
899
  * Возвращает базовый URL путь для выполнения запросов.
900
900
  */
901
901
  // eslint-disable-next-line class-methods-use-this
902
- t(this, "getBaseUrl", () => `${$.getConfig().http.portalApiUrl}/api`);
902
+ t(this, "getBaseUrl", () => `${a.getConfig().http.portalApiUrl}/api`);
903
903
  /**
904
904
  * Возвращает токен доступа к системе.
905
905
  */
@@ -907,7 +907,7 @@ const _ = class _ {
907
907
  t(this, "getAccessToken", () => {
908
908
  var s, i;
909
909
  let r;
910
- const e = $.getConfig();
910
+ const e = a.getConfig();
911
911
  return (s = e.devMode) != null && s.authBearerToken && (r = (i = e.devMode) == null ? void 0 : i.authBearerToken), Promise.resolve(r);
912
912
  });
913
913
  /**
@@ -959,10 +959,10 @@ const _ = class _ {
959
959
  */
960
960
  // eslint-disable-next-line class-methods-use-this
961
961
  t(this, "dataConverterResponseInterceptor", (r) => (r.data && (r.data = Ie(r.data)), r));
962
- const r = $.getConfig().version;
962
+ const r = a.getConfig().version;
963
963
  this.defaultInstanceNotificationErrorResponseHandler = _.baseDefaultNotificationErrorResponseHandler, this.httpClient = Lr.create({
964
964
  headers: {
965
- "APP-VERSION": `${r.name} (${r.version}, ${z(r.date, $.getConfig().dateFormats.uiDate)})`,
965
+ "APP-VERSION": `${r.name} (${r.version}, ${z(r.date, a.getConfig().dateFormats.uiDate)})`,
966
966
  Accept: "application/json",
967
967
  "Content-Type": "application/json"
968
968
  }
@@ -1090,7 +1090,7 @@ t(_, "instances", {}), /**
1090
1090
  */
1091
1091
  t(_, "baseDefaultNotificationErrorResponseHandler", m);
1092
1092
  let h = _;
1093
- class $t extends h {
1093
+ class at extends h {
1094
1094
  /**
1095
1095
  * Возвращает содержимое корзины указанного клиента.
1096
1096
  *
@@ -1214,7 +1214,7 @@ class q extends ne {
1214
1214
  this.categories = (s = e == null ? void 0 : e.categories) == null ? void 0 : s.map((o) => new q(o)), this.products = (i = e == null ? void 0 : e.products) == null ? void 0 : i.map((o) => new b(o));
1215
1215
  }
1216
1216
  }
1217
- class Ye extends a {
1217
+ class Ye extends $ {
1218
1218
  /**
1219
1219
  * Инициализирует экземпляр класса {@link UpdatableNamedIdentity}.
1220
1220
  *
@@ -1244,7 +1244,7 @@ class Hr extends Ye {
1244
1244
  this.deletedAt = f(e == null ? void 0 : e.deletedAt) ? y(e.deletedAt) : e == null ? void 0 : e.deletedAt;
1245
1245
  }
1246
1246
  }
1247
- class at {
1247
+ class $t {
1248
1248
  /**
1249
1249
  * Возвращает актуальные и не просроченные данные из хранилища.
1250
1250
  *
@@ -1278,7 +1278,7 @@ class at {
1278
1278
  );
1279
1279
  }
1280
1280
  }
1281
- class G extends a {
1281
+ class G extends $ {
1282
1282
  /**
1283
1283
  * Инициализирует экземпляр класса {@link UserShortInfo}.
1284
1284
  *
@@ -1293,7 +1293,7 @@ class G extends a {
1293
1293
  this.type = e == null ? void 0 : e.type;
1294
1294
  }
1295
1295
  }
1296
- class zr extends a {
1296
+ class zr extends $ {
1297
1297
  /**
1298
1298
  * Инициализирует экземпляр класса {@link DiscountShortInfo}.
1299
1299
  *
@@ -1410,7 +1410,7 @@ class jr {
1410
1410
  }
1411
1411
  class S extends w {
1412
1412
  }
1413
- class re extends a {
1413
+ class re extends $ {
1414
1414
  /**
1415
1415
  * Инициализирует экземпляр класса {@link ManagerCommon}.
1416
1416
  *
@@ -1584,7 +1584,7 @@ class de extends w {
1584
1584
  e && (this.region = new te(e.region));
1585
1585
  }
1586
1586
  }
1587
- class Ze extends a {
1587
+ class Ze extends $ {
1588
1588
  /**
1589
1589
  * Инициализирует экземпляр класса {@link UserCommonInfo}.
1590
1590
  *
@@ -1712,7 +1712,7 @@ class Re extends Xe {
1712
1712
  }
1713
1713
  class er extends w {
1714
1714
  }
1715
- class Z extends a {
1715
+ class Z extends $ {
1716
1716
  /**
1717
1717
  * Инициализирует экземпляр класса {@link Property}.
1718
1718
  *
@@ -1844,7 +1844,7 @@ class bt extends w {
1844
1844
  }
1845
1845
  class Vr extends w {
1846
1846
  }
1847
- class he extends a {
1847
+ class he extends $ {
1848
1848
  /**
1849
1849
  * Инициализирует экземпляр класса {@link Currency}.
1850
1850
  *
@@ -1901,7 +1901,7 @@ const E = class E extends h {
1901
1901
  * Время кэширования данных ответов на запросы (секунд).
1902
1902
  */
1903
1903
  t(this, "responseDataCacheTimeout");
1904
- this.responseDataCacheTimeout = $.getConfig().http.responseDataCacheTimeout;
1904
+ this.responseDataCacheTimeout = a.getConfig().http.responseDataCacheTimeout;
1905
1905
  }
1906
1906
  /**
1907
1907
  * Возвращает кэшированные данные.
@@ -2181,7 +2181,7 @@ class qe {
2181
2181
  r != null && r.products && (this.products = r.products.map((e) => new b(e))), r != null && r.productCategories && (this.productCategories = r.productCategories.map((e) => new q(e)));
2182
2182
  }
2183
2183
  }
2184
- class ee extends a {
2184
+ class ee extends $ {
2185
2185
  /**
2186
2186
  * Инициализирует экземпляр класса {@link PricingRole}.
2187
2187
  *
@@ -2265,7 +2265,7 @@ class _t extends h {
2265
2265
  */
2266
2266
  // eslint-disable-next-line class-methods-use-this
2267
2267
  getPriceExportLink(r = "csv", e = !1, s = void 0, i = void 0) {
2268
- let c = `${$.getConfig().http.portalApiUrl}/api/internal/price/export?format=${r}&show_hidden=${e}`;
2268
+ let c = `${a.getConfig().http.portalApiUrl}/api/internal/price/export?format=${r}&show_hidden=${e}`;
2269
2269
  return s && (c += `&category_id=${s}`), i && (c += `&client_id=${i}`), c;
2270
2270
  }
2271
2271
  }
@@ -2503,7 +2503,7 @@ class It extends h {
2503
2503
  * @see /doc/api/internal#/operations/api_internal_client_price_template_attach
2504
2504
  */
2505
2505
  attachTemplate(r, e, s) {
2506
- const i = $.getConfig().dateFormats.api;
2506
+ const i = a.getConfig().dateFormats.api;
2507
2507
  return this.post(
2508
2508
  `/internal/clients/${r}/price/templates/${e}`,
2509
2509
  s && {
@@ -2537,7 +2537,7 @@ class It extends h {
2537
2537
  * @see /doc/api/internal#/operations/api_internal_client_price_template_change
2538
2538
  */
2539
2539
  changeTemplate(r, e, s, i) {
2540
- const o = $.getConfig().dateFormats.api;
2540
+ const o = a.getConfig().dateFormats.api;
2541
2541
  return this.patch(
2542
2542
  `/internal/clients/${r}/price/templates/${e}/${s}`,
2543
2543
  i && {
@@ -2829,7 +2829,7 @@ class Ge {
2829
2829
  field: this.field,
2830
2830
  op: this.op
2831
2831
  };
2832
- return r.value = Cr(this.value) ? z(this.value, $.getConfig().dateFormats.api) : this.value, r;
2832
+ return r.value = Cr(this.value) ? z(this.value, a.getConfig().dateFormats.api) : this.value, r;
2833
2833
  }
2834
2834
  }
2835
2835
  class ie {
@@ -3638,7 +3638,7 @@ class Te extends B {
3638
3638
  e && (this.bankName = e.bankName ?? "", this.bic = e.bic ?? "", this.accountNumber = e.accountNumber ?? "", this.correspondentAccount = e.correspondentAccount ?? "", this.currency = new he(e.currency));
3639
3639
  }
3640
3640
  }
3641
- class be extends a {
3641
+ class be extends $ {
3642
3642
  /**
3643
3643
  * Инициализирует экземпляр класса {@link Contact}.
3644
3644
  *
@@ -3692,7 +3692,7 @@ class F extends be {
3692
3692
  this.isPrimary = (e == null ? void 0 : e.isPrimary) ?? !1, this.position = e == null ? void 0 : e.position, this.notDisturb = (e == null ? void 0 : e.notDisturb) ?? !1, this.comment = e == null ? void 0 : e.comment, this.updatedAt = e == null ? void 0 : e.updatedAt, this.deletedAt = f(e == null ? void 0 : e.deletedAt) ? y(e.deletedAt) : e == null ? void 0 : e.deletedAt;
3693
3693
  }
3694
3694
  }
3695
- class ir extends a {
3695
+ class ir extends $ {
3696
3696
  /**
3697
3697
  * Инициализирует экземпляр класса {@link ContragentBase}.
3698
3698
  *
@@ -4078,6 +4078,10 @@ class Gt {
4078
4078
  * Данные о менеджерах клиентов.
4079
4079
  */
4080
4080
  t(this, "managers");
4081
+ /**
4082
+ * Признак того, что наличие менеджера у клиента является обязательным.
4083
+ */
4084
+ t(this, "isManagerRequired");
4081
4085
  /**
4082
4086
  * Направления продаж.
4083
4087
  */
@@ -4208,7 +4212,7 @@ class cr extends B {
4208
4212
  this.createdAt = f(e == null ? void 0 : e.createdAt) ? y(e.createdAt) : (e == null ? void 0 : e.createdAt) ?? /* @__PURE__ */ new Date(), this.creator = new G(e == null ? void 0 : e.creator), this.isApproved1c = (e == null ? void 0 : e.isApproved1c) ?? !1;
4209
4213
  }
4210
4214
  }
4211
- class ot extends a {
4215
+ class ot extends $ {
4212
4216
  /**
4213
4217
  * Инициализирует экземпляр класса {@link ClientAdditionalData}.
4214
4218
  *
@@ -5134,7 +5138,7 @@ class jt {
5134
5138
  nextWorkingDay: { label: "Следующий рабочий день", from: Ir(r), to: Sr(r) },
5135
5139
  today: { label: "Сегодня", from: Ve(), to: _r() },
5136
5140
  yesterday: { label: "Вчера", from: br(), to: Tr() },
5137
- tomorrow: { label: "Завтра", from: ar(), to: $r() }
5141
+ tomorrow: { label: "Завтра", from: $r(), to: ar() }
5138
5142
  };
5139
5143
  }
5140
5144
  }
@@ -5458,7 +5462,7 @@ class De {
5458
5462
  this.client = new oe(r == null ? void 0 : r.client), this.product = new b(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) ?? ke.Product;
5459
5463
  }
5460
5464
  }
5461
- const $e = (n) => {
5465
+ const ae = (n) => {
5462
5466
  var r, e, s, i, o;
5463
5467
  return n ? vr(
5464
5468
  {
@@ -5490,7 +5494,7 @@ class Vt extends h {
5490
5494
  `/internal/price/products/${r}/analyze`,
5491
5495
  {
5492
5496
  ...He(e),
5493
- filters: $e(s)
5497
+ filters: ae(s)
5494
5498
  },
5495
5499
  (i) => i.data.map((o) => new De(o))
5496
5500
  );
@@ -5509,7 +5513,7 @@ class Vt extends h {
5509
5513
  `/internal/price/categories/${r}/analyze`,
5510
5514
  {
5511
5515
  ...He(e),
5512
- filters: $e(s)
5516
+ filters: ae(s)
5513
5517
  },
5514
5518
  (i) => i.data.map((o) => new De(o))
5515
5519
  );
@@ -5530,7 +5534,7 @@ class Vt extends h {
5530
5534
  `/internal/price/categories/${r}/analyze/square`,
5531
5535
  {
5532
5536
  ...e,
5533
- filters: $e(s)
5537
+ filters: ae(s)
5534
5538
  },
5535
5539
  (i) => i.data.map((o) => new De(o))
5536
5540
  );
@@ -5953,14 +5957,14 @@ class Xt {
5953
5957
  export {
5954
5958
  Er as AnyReference,
5955
5959
  Dt as AppBaseConfig,
5956
- $ as AppConfigProvider,
5960
+ a as AppConfigProvider,
5957
5961
  Te as BankAccount,
5958
5962
  ve as BasePaginationProvider,
5959
5963
  Fr as CalculationTypeEnum,
5960
5964
  ce as Cart,
5961
5965
  Or as CartItem,
5962
5966
  Nr as CartItemBase,
5963
- $t as CartProvider,
5967
+ at as CartProvider,
5964
5968
  _t as CatalogProvider,
5965
5969
  Je as CatalogableItem,
5966
5970
  q as Category,
@@ -6024,7 +6028,7 @@ export {
6024
6028
  Wt as ManagerDataFactory,
6025
6029
  lt as ManagerDataProvider,
6026
6030
  ht as MetaTagItem,
6027
- a as NamedIdentity,
6031
+ $ as NamedIdentity,
6028
6032
  M as Opf,
6029
6033
  T as OpfEnum,
6030
6034
  pt as Order,
@@ -6036,7 +6040,7 @@ export {
6036
6040
  Et as OrdersDataProvider,
6037
6041
  Y as PartnerGroup,
6038
6042
  Qr as PaymentType,
6039
- at as PreferencesStorageProvider,
6043
+ $t as PreferencesStorageProvider,
6040
6044
  De as PriceAnalyze,
6041
6045
  Vt as PriceAnalyzeProvider,
6042
6046
  ye as PriceCoefficient,
@@ -6049,7 +6053,7 @@ export {
6049
6053
  Nt as PriceTemplateProvider,
6050
6054
  ee as PricingRole,
6051
6055
  Ot as PricingRoleProvider,
6052
- ae as PrimaryCatalogableItem,
6056
+ $e as PrimaryCatalogableItem,
6053
6057
  b as Product,
6054
6058
  Lt as ProductCategoryDataProvider,
6055
6059
  xt as ProductDataProvider,