@snabcentr/common-lib 4.0.2 → 4.0.4

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-ubcRFP8DmH2CW0tN46fL/6mrILsRDJGKJ8NHWL0j2MuSAhm6Ond9Oekf+TGqbbzv"
7
+ "integrity": "sha384-U7UJNJqzqPxKXMZ3BuPyrwxj/0NHA87dnQ+LA0LSuDaTWOg4wJ4DTR9yYw7EhgTy"
8
8
  }
9
9
  }
@@ -436,7 +436,7 @@ var nt = /* @__PURE__ */ function(e) {
436
436
  }, Tt = /* @__PURE__ */ function(e) {
437
437
  return e.m2Cost = "m2Cost", e.percent = "percent", e.value = "value", e;
438
438
  }({}), Et = /* @__PURE__ */ function(e) {
439
- return e.Checkbox = "checkbox", e.Range = "range", e.Toggle = "toggle", e;
439
+ return e.Checkbox = "checkbox", e.Range = "range", e.Toggle = "toggle", e.Group = "group", e;
440
440
  }({}), U = class e extends V {
441
441
  categories;
442
442
  products;
@@ -594,8 +594,9 @@ var nt = /* @__PURE__ */ function(e) {
594
594
  isMultiple;
595
595
  type;
596
596
  ord;
597
+ group;
597
598
  constructor(e) {
598
- this.isFake = e?.isFake ?? !1, this.isHidden = e?.isHidden ?? !1, this.isMultiple = e?.isMultiple ?? null, this.type = e?.type ?? null, this.ord = e?.ord ?? 0;
599
+ this.isFake = e?.isFake ?? !1, this.isHidden = e?.isHidden ?? !1, this.isMultiple = e?.isMultiple ?? null, this.type = e?.type ?? null, this.ord = e?.ord ?? 0, this.group = e?.group;
599
600
  }
600
601
  }, Vt = class {
601
602
  category;
@@ -610,7 +611,7 @@ var nt = /* @__PURE__ */ function(e) {
610
611
  constructor(e) {
611
612
  this.id = e?.id ?? "", this.label = e?.label ?? "";
612
613
  }
613
- }, Ut = class {
614
+ }, Ut = class e {
614
615
  id;
615
616
  label;
616
617
  type;
@@ -619,8 +620,9 @@ var nt = /* @__PURE__ */ function(e) {
619
620
  values;
620
621
  min;
621
622
  max;
622
- constructor(e) {
623
- this.id = e?.id ?? "", this.label = e?.label ?? "", this.type = e?.type ?? Et.Checkbox, this.ord = e?.ord ?? 0, this.isMultiple = e?.isMultiple ?? null, this.values = e?.values?.map((e) => new Ht(e)) ?? [], this.min = e?.min ?? null, this.max = e?.max ?? null;
623
+ filters;
624
+ constructor(t) {
625
+ this.id = t?.id ?? "", this.label = t?.label ?? "", this.type = t?.type ?? Et.Checkbox, this.ord = t?.ord ?? 0, this.isMultiple = t?.isMultiple ?? null, this.values = t?.values?.map((e) => new Ht(e)) ?? [], this.min = t?.min ?? null, this.max = t?.max ?? null, this.filters = t?.filters?.map((t) => new e(t)) ?? [];
624
626
  }
625
627
  }, Wt = class extends l {
626
628
  search(e, t = !1) {
@@ -923,6 +925,17 @@ var nt = /* @__PURE__ */ function(e) {
923
925
  getProperties(e, t, n) {
924
926
  return this.getTypedPaginated(K, "/internal/catalog/properties", e, t, n);
925
927
  }
928
+ getFilterGroups(e) {
929
+ return this.getProperties({
930
+ groupOp: "and",
931
+ filters: [{
932
+ field: "is_filter_group",
933
+ op: ct.Equals,
934
+ value: !0
935
+ }],
936
+ groups: []
937
+ }, void 0, e);
938
+ }
926
939
  createProperty(e) {
927
940
  let { typeId: t, ...n } = e;
928
941
  return this.post("/internal/catalog/properties", {
@@ -2706,9 +2719,10 @@ var Gn = class e {
2706
2719
  warehouses;
2707
2720
  isLargeOrder;
2708
2721
  isToProcess;
2722
+ userRegions;
2709
2723
  onlyMyRegions;
2710
2724
  constructor(e) {
2711
- super(), this.attachedUsers = e?.attachedUsers?.map((e) => "isActive" in e ? new te(e) : new re(e)), this.clientSearchTerm = e?.clientSearchTerm, this.client = e?.client ? new W(e.client) : void 0, this.contragent = e?.contragent, this.createdAt = new P(e?.createdAt), this.creator = e?.creator ? new I(e.creator) : void 0, this.deliveryDate = new P(e?.deliveryDate), this.deliveryAddressSearch = e?.deliveryAddressSearch, this.clientCities = e?.clientCities?.map((e) => new t(e)), this.id = e?.id, this.isApproved = e?.isApproved, this.isNotInStock = e?.isNotInStock, this.isOnOrder = e?.isOnOrder, this.isLargeOrder = e?.isLargeOrder, this.attachedAt = new P(e?.attachedAt), this.salesDirections = e?.salesDirections?.map((e) => new m(e)), this.status = e?.status, this.statusDetail = e?.statusDetail, this.deliveryType = e?.deliveryType ? new s(e.deliveryType) : void 0, this.paymentType = e?.paymentType ? new oe(e.paymentType) : void 0, this.warehouses = e?.warehouses?.map((e) => new ge(e)), this.isToProcess = e?.isToProcess;
2725
+ super(), this.attachedUsers = e?.attachedUsers?.map((e) => "isActive" in e ? new te(e) : new re(e)), this.clientSearchTerm = e?.clientSearchTerm, this.client = e?.client ? new W(e.client) : void 0, this.contragent = e?.contragent, this.createdAt = new P(e?.createdAt), this.creator = e?.creator ? new I(e.creator) : void 0, this.deliveryDate = new P(e?.deliveryDate), this.deliveryAddressSearch = e?.deliveryAddressSearch, this.clientCities = e?.clientCities?.map((e) => new t(e)), this.id = e?.id, this.isApproved = e?.isApproved, this.isNotInStock = e?.isNotInStock, this.isOnOrder = e?.isOnOrder, this.isLargeOrder = e?.isLargeOrder, this.attachedAt = new P(e?.attachedAt), this.salesDirections = e?.salesDirections?.map((e) => new m(e)), this.status = e?.status, this.statusDetail = e?.statusDetail, this.deliveryType = e?.deliveryType ? new s(e.deliveryType) : void 0, this.paymentType = e?.paymentType ? new oe(e.paymentType) : void 0, this.warehouses = e?.warehouses?.map((e) => new ge(e)), this.isToProcess = e?.isToProcess, this.userRegions = e?.userRegions?.map((e) => new he(e));
2712
2726
  }
2713
2727
  resetFilterValue(e) {
2714
2728
  switch (e) {
@@ -2741,6 +2755,9 @@ var Gn = class e {
2741
2755
  case "warehouses":
2742
2756
  this.warehouses = [];
2743
2757
  break;
2758
+ case "userRegions":
2759
+ this.userRegions = [];
2760
+ break;
2744
2761
  default: this[e] = void 0;
2745
2762
  }
2746
2763
  return this;