@snabcentr/common-lib 1.74.2 → 1.74.3

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-Wtc8Gsaei4afN0jp5Nlts/ahn+1lTQI8G3F2DzvNu5JpJQAgjHYOTUgU6xd8w9GB"
7
+ "integrity": "sha384-IhvGEE4AAcFcNRcqXZGp9AC1owdCesbDODGOpu+3ayNGRzmXKMGCL3dtR+dkr+LB"
8
8
  }
9
9
  }
@@ -6,8 +6,8 @@ import { merge as ye, isUndefined as br, isNil as A, isEmpty as Y, noop as w, ma
6
6
  import { objectToCamel as Fe, objectToSnake as We } from "ts-case-convert";
7
7
  import { isAfter as Je, parseISO as v, startOfToday as de, format as O, addSeconds as Or, addBusinessDays as qr, endOfTomorrow as Nr, startOfTomorrow as Ur, endOfYesterday as Fr, startOfYesterday as Mr, endOfToday as jr, endOfDay as Gr, startOfDay as Br } from "date-fns";
8
8
  import { defineStore as te } from "pinia";
9
- import { ref as y, markRaw as Er, computed as R } from "vue";
10
- import Hr from "axios";
9
+ import { ref as y, markRaw as Hr, computed as R } from "vue";
10
+ import Er from "axios";
11
11
  class N {
12
12
  /**
13
13
  * Инициализирует экземпляр класса {@link JwtPayload}.
@@ -308,7 +308,7 @@ function Ve(n) {
308
308
  return;
309
309
  }
310
310
  }
311
- const E = te("__auth_state_private", () => {
311
+ const H = te("__auth_state_private", () => {
312
312
  const n = y(
313
313
  (() => {
314
314
  var u;
@@ -321,7 +321,7 @@ const E = te("__auth_state_private", () => {
321
321
  const c = (u = $.getConfig().devMode) == null ? void 0 : u.initAuthBearerToken;
322
322
  return c ? Promise.resolve(c) : void 0;
323
323
  })()
324
- ), r = y(void 0), e = y(void 0), s = Er(/* @__PURE__ */ new Map());
324
+ ), r = y(void 0), e = y(void 0), s = Hr(/* @__PURE__ */ new Map());
325
325
  function i() {
326
326
  e.value = void 0, A(n.value) || n.value.then((o) => {
327
327
  const c = N.getJwtPayload(o);
@@ -352,7 +352,7 @@ const E = te("__auth_state_private", () => {
352
352
  };
353
353
  }), be = te("__auth_state", () => {
354
354
  const n = R(() => {
355
- const o = E();
355
+ const o = H();
356
356
  if (A(o.jwtToken) && !A(o.jwtTokenUpdater)) {
357
357
  const c = o.jwtTokenUpdater();
358
358
  o.jwtToken = c, c.then((u) => {
@@ -362,18 +362,18 @@ const E = te("__auth_state_private", () => {
362
362
  return o.jwtToken;
363
363
  });
364
364
  function r(o) {
365
- E().jwtTokenUpdater = o;
365
+ H().jwtTokenUpdater = o;
366
366
  }
367
367
  function e(o) {
368
- const c = E();
368
+ const c = H();
369
369
  c.jwtToken = Promise.resolve(o), fe.saveActualDataToStorage("sc.token", o, Ve(o)), c.recalculateUserPermissions();
370
370
  }
371
371
  function s() {
372
- const o = E();
372
+ const o = H();
373
373
  o.jwtToken = void 0, o.userPermissions = void 0, fe.saveActualDataToStorage("sc.token", void 0);
374
374
  }
375
375
  function i(o) {
376
- const c = E();
376
+ const c = H();
377
377
  !A(c.jwtToken) && A(c.userPermissions) && c.jwtToken.then((f) => {
378
378
  const g = N.getJwtPayload(f);
379
379
  c.userPermissions = g.exp * 1e3 > Date.now() ? nr(g.resourceAccess, (b) => (b == null ? void 0 : b.roles) ?? []) : void 0;
@@ -387,7 +387,7 @@ const E = te("__auth_state_private", () => {
387
387
  const b = Ir(g, ".");
388
388
  if (b.length < 2)
389
389
  return !1;
390
- const [_, d] = b, G = (B = E().userPermissions) == null ? void 0 : B[_];
390
+ const [_, d] = b, G = (B = H().userPermissions) == null ? void 0 : B[_];
391
391
  return Q(G) && G.includes(d);
392
392
  };
393
393
  return Q(o) ? Sr(o, (g) => f(g)) : f(o);
@@ -1027,7 +1027,7 @@ const S = class S {
1027
1027
  // eslint-disable-next-line class-methods-use-this
1028
1028
  t(this, "dataConverterResponseInterceptor", (r) => (r.data && (r.data = Fe(r.data)), r));
1029
1029
  const r = $.getConfig().version;
1030
- this.errorResponseHandler = S.defaultErrorsResponseHandler, this.httpClient = Hr.create({
1030
+ this.errorResponseHandler = S.defaultErrorsResponseHandler, this.httpClient = Er.create({
1031
1031
  headers: {
1032
1032
  "APP-VERSION": `${r.name} (${r.version}, ${O(r.date, $.getConfig().dateFormats.uiDate)})`,
1033
1033
  Accept: "application/json",
@@ -1642,7 +1642,7 @@ class Se extends mr {
1642
1642
  this.productCategory = new he(e == null ? void 0 : e.productCategory);
1643
1643
  }
1644
1644
  }
1645
- class Ee extends a {
1645
+ class He extends a {
1646
1646
  /**
1647
1647
  * Инициализирует экземпляр класса {@link Curator}.
1648
1648
  *
@@ -1682,7 +1682,7 @@ class le extends P {
1682
1682
  e && (this.country = new ee(e.country));
1683
1683
  }
1684
1684
  }
1685
- class He extends P {
1685
+ class Ee extends P {
1686
1686
  /**
1687
1687
  * Инициализирует экземпляр класса {@link CityWithRegionAndCountry}.
1688
1688
  *
@@ -1782,7 +1782,7 @@ class ge extends fr {
1782
1782
  * @inheritDoc
1783
1783
  */
1784
1784
  t(this, "curators");
1785
- this.salesDirection = new x(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 He(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 ce(o))) ?? [], this.curators = ((i = e == null ? void 0 : e.curators) == null ? void 0 : i.map((o) => new Ee(o))) ?? void 0;
1785
+ this.salesDirection = new x(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 Ee(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 ce(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 {
@@ -1852,7 +1852,7 @@ class ie extends a {
1852
1852
  this.type = new yr(e == null ? void 0 : e.type), this.description = (e == null ? void 0 : e.description) ?? "", this.metadata = e == null ? void 0 : e.metadata;
1853
1853
  }
1854
1854
  }
1855
- class H {
1855
+ class E {
1856
1856
  /**
1857
1857
  * Инициализирует экземпляр класса {@link PropertyValue}.
1858
1858
  *
@@ -2448,7 +2448,7 @@ class Bt extends p {
2448
2448
  return this.post(`/internal/clients/${r}/price/commercial-offer/send`, e);
2449
2449
  }
2450
2450
  }
2451
- class Et extends p {
2451
+ class Ht extends p {
2452
2452
  /**
2453
2453
  * Возвращает список шаблонов прайс-листа привязанных к клиенту.
2454
2454
  *
@@ -2540,7 +2540,7 @@ class Et extends p {
2540
2540
  return this.delete(`/internal/clients/${r}/price/templates/${e}/${s}`);
2541
2541
  }
2542
2542
  }
2543
- class Ht extends p {
2543
+ class Et extends p {
2544
2544
  /**
2545
2545
  * Возвращает список данных о корневых категориях.
2546
2546
  *
@@ -3215,7 +3215,7 @@ class Qt extends $e {
3215
3215
  * @see /doc/api/internal#/operations/api_internal_catalog_product_properties_get_list
3216
3216
  */
3217
3217
  getProductProperties(r) {
3218
- return this.get(`/internal/catalog/products/${r}/properties`, {}, (e) => e.data.map((s) => new H(s)));
3218
+ return this.get(`/internal/catalog/products/${r}/properties`, {}, (e) => e.data.map((s) => new E(s)));
3219
3219
  }
3220
3220
  /**
3221
3221
  * Возвращает значение свойства продукта.
@@ -3225,7 +3225,7 @@ class Qt extends $e {
3225
3225
  * @see /doc/api/internal#/operations/api_internal_catalog_product_properties_get
3226
3226
  */
3227
3227
  getProductProperty(r, e) {
3228
- return this.get(`/internal/catalog/products/${r}/properties/${e}`, {}, (s) => new H(s.data));
3228
+ return this.get(`/internal/catalog/products/${r}/properties/${e}`, {}, (s) => new E(s.data));
3229
3229
  }
3230
3230
  /**
3231
3231
  * Обновляет значение свойства продукта.
@@ -3236,7 +3236,7 @@ class Qt extends $e {
3236
3236
  * @see /doc/api/internal#/operations/api_internal_catalog_product_properties_update
3237
3237
  */
3238
3238
  updateProductProperty(r, e, s) {
3239
- return this.patch(`/internal/catalog/products/${r}/properties/${e}`, { value: s }, (i) => new H(i.data));
3239
+ return this.patch(`/internal/catalog/products/${r}/properties/${e}`, { value: s }, (i) => new E(i.data));
3240
3240
  }
3241
3241
  /**
3242
3242
  * Удаляет значение свойства продукта.
@@ -3361,7 +3361,7 @@ class Qt extends $e {
3361
3361
  * @see /doc/api/internal#/operations/api_internal_catalog_category_properties_get_list
3362
3362
  */
3363
3363
  getCategoryProperties(r) {
3364
- return this.get(`/internal/catalog/categories/${r}/properties`, {}, (e) => e.data.map((s) => new H(s)));
3364
+ return this.get(`/internal/catalog/categories/${r}/properties`, {}, (e) => e.data.map((s) => new E(s)));
3365
3365
  }
3366
3366
  /**
3367
3367
  * Возвращает значение свойства категории.
@@ -3371,7 +3371,7 @@ class Qt extends $e {
3371
3371
  * @see /doc/api/internal#/operations/api_internal_catalog_category_properties_get
3372
3372
  */
3373
3373
  getCategoryProperty(r, e) {
3374
- return this.get(`/internal/catalog/categories/${r}/properties/${e}`, {}, (s) => new H(s.data));
3374
+ return this.get(`/internal/catalog/categories/${r}/properties/${e}`, {}, (s) => new E(s.data));
3375
3375
  }
3376
3376
  /**
3377
3377
  * Обновляет значение свойства категории.
@@ -3382,7 +3382,7 @@ class Qt extends $e {
3382
3382
  * @see /doc/api/internal#/operations/api_internal_catalog_category_properties_update
3383
3383
  */
3384
3384
  updateCategoryProperty(r, e, s) {
3385
- return this.patch(`/internal/catalog/categories/${r}/properties/${e}`, { value: s }, (i) => new H(i.data));
3385
+ return this.patch(`/internal/catalog/categories/${r}/properties/${e}`, { value: s }, (i) => new E(i.data));
3386
3386
  }
3387
3387
  /**
3388
3388
  * Удаляет значение свойства категории.
@@ -3541,7 +3541,7 @@ function Xe(n) {
3541
3541
  }
3542
3542
  }), r;
3543
3543
  }
3544
- var ct = /* @__PURE__ */ ((n) => (n.LastOrder = "last_order", n.Contacts = "contacts", n.PartnerGroups = "partner_groups", n.PreferredDeliveryType = "preferred_delivery_type", n.SalesDirection = "sales_direction", n.Managers = "managers", n))(ct || {}), q = /* @__PURE__ */ ((n) => (n.Person = "individual", n.Ic = "entrepreneur", n.UlR = "legal", n.UlNr = "non_resident_legal", n))(q || {});
3544
+ var ct = /* @__PURE__ */ ((n) => (n.LastOrder = "last_order", n.Contacts = "contacts", n.PartnerGroups = "partner_groups", n.PreferredDeliveryType = "preferred_delivery_type", n.SalesDirection = "sales_direction", n.Managers = "managers", n.Curators = "curators", n))(ct || {}), q = /* @__PURE__ */ ((n) => (n.Person = "individual", n.Ic = "entrepreneur", n.UlR = "legal", n.UlNr = "non_resident_legal", n))(q || {});
3545
3545
  class lt extends P {
3546
3546
  }
3547
3547
  class wr extends P {
@@ -4112,7 +4112,7 @@ class Xt {
4112
4112
  */
4113
4113
  t(this, "isExcludedFromMsCallsToClients");
4114
4114
  var e, s, i, o, c, u, h, f;
4115
- 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 He(g)), this.region = new le(r == null ? void 0 : r.region), this.country = new ee(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 k(r == null ? void 0 : r.createdAt), this.lastLoginDate = new k(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 Te(g))) ?? [], this.curators = ((i = r == null ? void 0 : r.curators) == null ? void 0 : i.map((g) => new Ee(g))) ?? [], this.salesDirections = (o = r == null ? void 0 : r.salesDirections) == null ? void 0 : o.map((g) => new x(g)), this.contragentInn = r == null ? void 0 : r.contragentInn, this.contragentType = new F(r == null ? void 0 : r.contragentType), this.preferredDeliveryType = new X(r == null ? void 0 : r.preferredDeliveryType), this.partnerGroups = (c = r == null ? void 0 : r.partnerGroups) == null ? void 0 : c.map((g) => new re(g)), this.contact = new Ne(r == null ? void 0 : r.contact), this.lastOrder = {
4115
+ 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 Ee(g)), this.region = new le(r == null ? void 0 : r.region), this.country = new ee(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 k(r == null ? void 0 : r.createdAt), this.lastLoginDate = new k(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 Te(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 x(g)), this.contragentInn = r == null ? void 0 : r.contragentInn, this.contragentType = new F(r == null ? void 0 : r.contragentType), this.preferredDeliveryType = new X(r == null ? void 0 : r.preferredDeliveryType), this.partnerGroups = (c = r == null ? void 0 : r.partnerGroups) == null ? void 0 : c.map((g) => new re(g)), this.contact = new Ne(r == null ? void 0 : r.contact), this.lastOrder = {
4116
4116
  createdAt: new k((u = r == null ? void 0 : r.lastOrder) == null ? void 0 : u.createdAt),
4117
4117
  creator: (h = r == null ? void 0 : r.lastOrder) == null ? void 0 : h.creator,
4118
4118
  isApproved: (f = r == null ? void 0 : r.lastOrder) == null ? void 0 : f.isApproved
@@ -4244,7 +4244,7 @@ class Ct extends a {
4244
4244
  * @inheritDoc
4245
4245
  */
4246
4246
  t(this, "curators");
4247
- this.contacts = ((s = e.contacts) == null ? void 0 : s.map((u) => new M(u))) ?? void 0, this.lastOrder = e.lastOrder ? new Ar(e.lastOrder) : void 0, this.partnerGroups = ((i = e.partnerGroups) == null ? void 0 : i.map((u) => new re(u))) ?? void 0, this.preferredDeliveryType = e.preferredDeliveryType ? new X(e.preferredDeliveryType) : void 0, this.salesDirection = e.salesDirection ? new x(e.salesDirection) : void 0, this.managers = ((o = e.managers) == null ? void 0 : o.map((u) => new ce(u))) ?? void 0, this.curators = ((c = e.curators) == null ? void 0 : c.map((u) => new Ee(u))) ?? void 0;
4247
+ this.contacts = ((s = e.contacts) == null ? void 0 : s.map((u) => new M(u))) ?? void 0, this.lastOrder = e.lastOrder ? new Ar(e.lastOrder) : void 0, this.partnerGroups = ((i = e.partnerGroups) == null ? void 0 : i.map((u) => new re(u))) ?? void 0, this.preferredDeliveryType = e.preferredDeliveryType ? new X(e.preferredDeliveryType) : void 0, this.salesDirection = e.salesDirection ? new x(e.salesDirection) : void 0, this.managers = ((o = e.managers) == null ? void 0 : o.map((u) => new ce(u))) ?? void 0, this.curators = ((c = e.curators) == null ? void 0 : c.map((u) => new He(u))) ?? void 0;
4248
4248
  }
4249
4249
  }
4250
4250
  class vt {
@@ -5790,7 +5790,7 @@ class T extends pe {
5790
5790
  * @param term Терм поиска.
5791
5791
  */
5792
5792
  searchCity(r) {
5793
- return this.getTypedDataArrayRequester(He, `/internal/references/city-with-region-and-country/search?term=${r}`);
5793
+ return this.getTypedDataArrayRequester(Ee, `/internal/references/city-with-region-and-country/search?term=${r}`);
5794
5794
  }
5795
5795
  /**
5796
5796
  * Выполняет поиск данных о регионах по терму в названии.
@@ -6322,13 +6322,13 @@ export {
6322
6322
  Ke as CategoryPricingRule,
6323
6323
  wr as ChannelPrimaryInterest,
6324
6324
  Yt as City,
6325
- He as CityWithRegionAndCountry,
6325
+ Ee as CityWithRegionAndCountry,
6326
6326
  Ze as Client,
6327
6327
  Ct as ClientAdditionalData,
6328
6328
  we as ClientCategory,
6329
6329
  L as ClientDataProvider,
6330
6330
  Bt as ClientPriceProvider,
6331
- Et as ClientPriceTemplateProvider,
6331
+ Ht as ClientPriceTemplateProvider,
6332
6332
  Z as ClientProduct,
6333
6333
  Wt as ClientProductCategoryDataProvider,
6334
6334
  Jt as ClientProductDataProvider,
@@ -6352,7 +6352,7 @@ export {
6352
6352
  Ge as CostSourceEnum,
6353
6353
  ee as Country,
6354
6354
  Be as CuratedDirection,
6355
- Ee as Curator,
6355
+ He as Curator,
6356
6356
  Ce as Currency,
6357
6357
  hs as DataSuggestionProvider,
6358
6358
  Zt as DataTablePagination,
@@ -6411,7 +6411,7 @@ export {
6411
6411
  Kt as PricingRoleProvider,
6412
6412
  Oe as PrimaryCatalogableItem,
6413
6413
  I as Product,
6414
- Ht as ProductCategoryDataProvider,
6414
+ Et as ProductCategoryDataProvider,
6415
6415
  zt as ProductDataProvider,
6416
6416
  mt as ProductFileType,
6417
6417
  Me as ProductPriceCoefficient,
@@ -6420,7 +6420,7 @@ export {
6420
6420
  ie as Property,
6421
6421
  yr as PropertyType,
6422
6422
  Yr as PropertyTypeEnum,
6423
- H as PropertyValue,
6423
+ E as PropertyValue,
6424
6424
  ls as RecommendationsDataProvider,
6425
6425
  tr as RecommendationsList,
6426
6426
  P as Reference,