@infrab4a/connect 4.10.1-beta.0 → 4.10.1-beta.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.
package/index.cjs.js CHANGED
@@ -72,10 +72,26 @@ class CategoryBase extends BaseModel {
72
72
  return ['id'];
73
73
  }
74
74
  get glamImages() {
75
- return this.images[exports.Shops.GLAMSHOP];
75
+ return this.images && this.images[exports.Shops.GLAMSHOP]
76
+ ? this.images[exports.Shops.GLAMSHOP]
77
+ : {
78
+ [exports.Shops.GLAMSHOP]: {
79
+ brandBanner: null,
80
+ brandBannerMobile: null,
81
+ image: null,
82
+ },
83
+ };
76
84
  }
77
85
  get mensImages() {
78
- return this.images[exports.Shops.MENSMARKET];
86
+ return this.images && this.images[exports.Shops.MENSMARKET]
87
+ ? this.images[exports.Shops.MENSMARKET]
88
+ : {
89
+ [exports.Shops.MENSMARKET]: {
90
+ brandBanner: null,
91
+ brandBannerMobile: null,
92
+ image: null,
93
+ },
94
+ };
79
95
  }
80
96
  get glamMetadata() {
81
97
  return this.metadata.find((metadata) => metadata.shop === exports.Shops.GLAMSHOP);
@@ -84,7 +100,7 @@ class CategoryBase extends BaseModel {
84
100
  return this.metadata.find((metadata) => metadata.shop === exports.Shops.MENSMARKET);
85
101
  }
86
102
  getMostRelevantByShop(shop) {
87
- return this.mostRelevant[shop];
103
+ return this.mostRelevant && this.mostRelevant[shop] ? this.mostRelevant[shop] : [];
88
104
  }
89
105
  }
90
106
  tslib.__decorate([
@@ -4795,8 +4811,22 @@ class CategoryHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGr
4795
4811
  this.categoryFilterRepository = categoryFilterRepository;
4796
4812
  }
4797
4813
  async create(params) {
4798
- const { metadata } = params, data = tslib.__rest(params, ["metadata"]);
4799
- return super.create(Object.assign(Object.assign({}, data), { isWishlist: false, metadata: metadata || [{ shop: null, description: null, title: null }] }));
4814
+ const { images, mostRelevant, metadata } = params, data = tslib.__rest(params, ["images", "mostRelevant", "metadata"]);
4815
+ return super.create(Object.assign(Object.assign({}, data), { isWishlist: false, metadata: metadata || [{ shop: null, description: null, title: null }], mostRelevant: mostRelevant || {
4816
+ [exports.Shops.GLAMSHOP]: null,
4817
+ [exports.Shops.MENSMARKET]: null,
4818
+ }, images: images || {
4819
+ [exports.Shops.GLAMSHOP]: {
4820
+ brandBanner: null,
4821
+ brandBannerMobile: null,
4822
+ image: null,
4823
+ },
4824
+ [exports.Shops.MENSMARKET]: {
4825
+ brandBanner: null,
4826
+ brandBannerMobile: null,
4827
+ image: null,
4828
+ },
4829
+ } }));
4800
4830
  }
4801
4831
  async get(identifiers) {
4802
4832
  var _a;
@@ -6056,8 +6086,22 @@ class WishlistHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGr
6056
6086
  }
6057
6087
  async create(params) {
6058
6088
  var _a;
6059
- const { metadata } = params, data = tslib.__rest(params, ["metadata"]);
6060
- return super.create(Object.assign(Object.assign({}, data), { isWishlist: true, isCollection: true, brandCategory: false, metadata: metadata || [{ shop: (_a = data.shop) !== null && _a !== void 0 ? _a : null, description: data.description, title: data.name }] }));
6089
+ const { images, mostRelevant, metadata } = params, data = tslib.__rest(params, ["images", "mostRelevant", "metadata"]);
6090
+ return super.create(Object.assign(Object.assign({}, data), { isWishlist: true, isCollection: true, brandCategory: false, metadata: metadata || [{ shop: (_a = data.shop) !== null && _a !== void 0 ? _a : null, description: data.description, title: data.name }], mostRelevant: mostRelevant || {
6091
+ [exports.Shops.GLAMSHOP]: null,
6092
+ [exports.Shops.MENSMARKET]: null,
6093
+ }, images: images || {
6094
+ [exports.Shops.GLAMSHOP]: {
6095
+ brandBanner: null,
6096
+ brandBannerMobile: null,
6097
+ image: null,
6098
+ },
6099
+ [exports.Shops.MENSMARKET]: {
6100
+ brandBanner: null,
6101
+ brandBannerMobile: null,
6102
+ image: null,
6103
+ },
6104
+ } }));
6061
6105
  }
6062
6106
  async get(identifiers) {
6063
6107
  const data = await super.get(identifiers);
package/index.esm.js CHANGED
@@ -66,10 +66,26 @@ class CategoryBase extends BaseModel {
66
66
  return ['id'];
67
67
  }
68
68
  get glamImages() {
69
- return this.images[Shops.GLAMSHOP];
69
+ return this.images && this.images[Shops.GLAMSHOP]
70
+ ? this.images[Shops.GLAMSHOP]
71
+ : {
72
+ [Shops.GLAMSHOP]: {
73
+ brandBanner: null,
74
+ brandBannerMobile: null,
75
+ image: null,
76
+ },
77
+ };
70
78
  }
71
79
  get mensImages() {
72
- return this.images[Shops.MENSMARKET];
80
+ return this.images && this.images[Shops.MENSMARKET]
81
+ ? this.images[Shops.MENSMARKET]
82
+ : {
83
+ [Shops.MENSMARKET]: {
84
+ brandBanner: null,
85
+ brandBannerMobile: null,
86
+ image: null,
87
+ },
88
+ };
73
89
  }
74
90
  get glamMetadata() {
75
91
  return this.metadata.find((metadata) => metadata.shop === Shops.GLAMSHOP);
@@ -78,7 +94,7 @@ class CategoryBase extends BaseModel {
78
94
  return this.metadata.find((metadata) => metadata.shop === Shops.MENSMARKET);
79
95
  }
80
96
  getMostRelevantByShop(shop) {
81
- return this.mostRelevant[shop];
97
+ return this.mostRelevant && this.mostRelevant[shop] ? this.mostRelevant[shop] : [];
82
98
  }
83
99
  }
84
100
  __decorate([
@@ -4789,8 +4805,22 @@ class CategoryHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGr
4789
4805
  this.categoryFilterRepository = categoryFilterRepository;
4790
4806
  }
4791
4807
  async create(params) {
4792
- const { metadata } = params, data = __rest(params, ["metadata"]);
4793
- return super.create(Object.assign(Object.assign({}, data), { isWishlist: false, metadata: metadata || [{ shop: null, description: null, title: null }] }));
4808
+ const { images, mostRelevant, metadata } = params, data = __rest(params, ["images", "mostRelevant", "metadata"]);
4809
+ return super.create(Object.assign(Object.assign({}, data), { isWishlist: false, metadata: metadata || [{ shop: null, description: null, title: null }], mostRelevant: mostRelevant || {
4810
+ [Shops.GLAMSHOP]: null,
4811
+ [Shops.MENSMARKET]: null,
4812
+ }, images: images || {
4813
+ [Shops.GLAMSHOP]: {
4814
+ brandBanner: null,
4815
+ brandBannerMobile: null,
4816
+ image: null,
4817
+ },
4818
+ [Shops.MENSMARKET]: {
4819
+ brandBanner: null,
4820
+ brandBannerMobile: null,
4821
+ image: null,
4822
+ },
4823
+ } }));
4794
4824
  }
4795
4825
  async get(identifiers) {
4796
4826
  var _a;
@@ -6050,8 +6080,22 @@ class WishlistHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGr
6050
6080
  }
6051
6081
  async create(params) {
6052
6082
  var _a;
6053
- const { metadata } = params, data = __rest(params, ["metadata"]);
6054
- return super.create(Object.assign(Object.assign({}, data), { isWishlist: true, isCollection: true, brandCategory: false, metadata: metadata || [{ shop: (_a = data.shop) !== null && _a !== void 0 ? _a : null, description: data.description, title: data.name }] }));
6083
+ const { images, mostRelevant, metadata } = params, data = __rest(params, ["images", "mostRelevant", "metadata"]);
6084
+ return super.create(Object.assign(Object.assign({}, data), { isWishlist: true, isCollection: true, brandCategory: false, metadata: metadata || [{ shop: (_a = data.shop) !== null && _a !== void 0 ? _a : null, description: data.description, title: data.name }], mostRelevant: mostRelevant || {
6085
+ [Shops.GLAMSHOP]: null,
6086
+ [Shops.MENSMARKET]: null,
6087
+ }, images: images || {
6088
+ [Shops.GLAMSHOP]: {
6089
+ brandBanner: null,
6090
+ brandBannerMobile: null,
6091
+ image: null,
6092
+ },
6093
+ [Shops.MENSMARKET]: {
6094
+ brandBanner: null,
6095
+ brandBannerMobile: null,
6096
+ image: null,
6097
+ },
6098
+ } }));
6055
6099
  }
6056
6100
  async get(identifiers) {
6057
6101
  const data = await super.get(identifiers);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@infrab4a/connect",
3
- "version": "4.10.1-beta.0",
3
+ "version": "4.10.1-beta.2",
4
4
  "publishConfig": {
5
5
  "registry": "https://registry.npmjs.org"
6
6
  },
@@ -31,12 +31,12 @@ export declare class CategoryBase<ChildCategory extends ModelBaseStructure<Child
31
31
  parent?: CategoryBase;
32
32
  filters?: Filter[];
33
33
  static get identifiersFields(): GenericIdentifier[];
34
- get glamImages(): {
34
+ get glamImages(): CategoryImages | {
35
35
  image: string;
36
36
  brandBanner: string;
37
37
  brandBannerMobile: string;
38
38
  };
39
- get mensImages(): {
39
+ get mensImages(): CategoryImages | {
40
40
  image: string;
41
41
  brandBanner: string;
42
42
  brandBannerMobile: string;