@infrab4a/connect 3.0.0-beta.0 → 3.0.0-beta.1

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.
@@ -1746,12 +1746,10 @@
1746
1746
  };
1747
1747
  ProductsIndex.prototype.findById = function (ids, options) {
1748
1748
  return __awaiter(this, void 0, void 0, function () {
1749
- var publishedField, fields, hits;
1750
- var _a;
1751
- return __generator(this, function (_b) {
1752
- switch (_b.label) {
1749
+ var fields, hits;
1750
+ return __generator(this, function (_a) {
1751
+ switch (_a.label) {
1753
1752
  case 0:
1754
- publishedField = options.shop === exports.Shops.GLAMSHOP ? 'publishedGlam' : 'published';
1755
1753
  fields = [
1756
1754
  'brand',
1757
1755
  'id',
@@ -1779,9 +1777,9 @@
1779
1777
  },
1780
1778
  },
1781
1779
  {
1782
- term: (_a = {},
1783
- _a[publishedField] = true,
1784
- _a),
1780
+ term: {
1781
+ published: true,
1782
+ },
1785
1783
  }
1786
1784
  ], __read((options.hasStock
1787
1785
  ? [
@@ -1797,7 +1795,7 @@
1797
1795
  },
1798
1796
  } }, (options.size ? { size: options.size } : {})))];
1799
1797
  case 1:
1800
- hits = (_b.sent()).hits;
1798
+ hits = (_a.sent()).hits;
1801
1799
  return [2 /*return*/, hits.map(function (hit) { return Product.toInstance(hit._source); })];
1802
1800
  }
1803
1801
  });
@@ -3775,16 +3773,14 @@
3775
3773
  };
3776
3774
  CategoryHasuraGraphQLRepository.prototype.mountCategory = function (category, options) {
3777
3775
  return __awaiter(this, void 0, void 0, function () {
3778
- var products, publishedField, productsData;
3779
- var _b;
3780
- return __generator(this, function (_c) {
3781
- switch (_c.label) {
3776
+ var products, productsData;
3777
+ return __generator(this, function (_b) {
3778
+ switch (_b.label) {
3782
3779
  case 0:
3783
3780
  if (!category.products)
3784
3781
  throw new RequiredArgumentError(['Category products is empty']);
3785
3782
  products = [];
3786
- publishedField = category.shop === exports.Shops.GLAMSHOP ? 'publishedGlam' : 'published';
3787
- return [4 /*yield*/, this.productRepository.find(Object.assign({ filters: Object.assign((_b = { id: { operator: exports.Where.IN, value: category.products } }, _b[publishedField] = true, _b), ((options === null || options === void 0 ? void 0 : options.hasStock) ? { stock: { quantity: { operator: exports.Where.GT, value: 0 } } } : {})), fields: [
3783
+ return [4 /*yield*/, this.productRepository.find(Object.assign({ filters: Object.assign({ id: { operator: exports.Where.IN, value: category.products }, published: true }, ((options === null || options === void 0 ? void 0 : options.hasStock) ? { stock: { quantity: { operator: exports.Where.GT, value: 0 } } } : {})), fields: [
3788
3784
  'id',
3789
3785
  'name',
3790
3786
  'slug',
@@ -3808,7 +3804,7 @@
3808
3804
  'tags',
3809
3805
  ] }, ((options === null || options === void 0 ? void 0 : options.limit) ? { limits: { limit: options === null || options === void 0 ? void 0 : options.limit } } : {})))];
3810
3806
  case 1:
3811
- productsData = (_c.sent()).data;
3807
+ productsData = (_b.sent()).data;
3812
3808
  products.push.apply(products, __spreadArray([], __read(productsData)));
3813
3809
  return [2 /*return*/, products];
3814
3810
  }