@infrab4a/connect 4.10.0 → 4.10.1-beta.0
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 +98 -51
- package/index.esm.js +98 -51
- package/package.json +1 -1
- package/src/domain/catalog/models/category-base.d.ts +17 -3
- package/src/domain/catalog/models/types/category-images.type.d.ts +8 -0
- package/src/domain/catalog/models/types/category-metadata.type.d.ts +2 -0
- package/src/domain/catalog/models/types/category-most-relevant.type.d.ts +4 -0
- package/src/domain/catalog/models/types/index.d.ts +2 -0
package/index.cjs.js
CHANGED
|
@@ -42,6 +42,21 @@ class BaseModel {
|
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
+
exports.GenderDestination = void 0;
|
|
46
|
+
(function (GenderDestination) {
|
|
47
|
+
GenderDestination["FEMALE"] = "female";
|
|
48
|
+
GenderDestination["MALE"] = "male";
|
|
49
|
+
GenderDestination["UNISEX"] = "unisex";
|
|
50
|
+
})(exports.GenderDestination || (exports.GenderDestination = {}));
|
|
51
|
+
|
|
52
|
+
exports.Shops = void 0;
|
|
53
|
+
(function (Shops) {
|
|
54
|
+
Shops["MENSMARKET"] = "mensmarket";
|
|
55
|
+
Shops["GLAMSHOP"] = "Glamshop";
|
|
56
|
+
Shops["GLAMPOINTS"] = "Glampoints";
|
|
57
|
+
Shops["ALL"] = "ALL";
|
|
58
|
+
})(exports.Shops || (exports.Shops = {}));
|
|
59
|
+
|
|
45
60
|
class Filter extends BaseModel {
|
|
46
61
|
static get identifiersFields() {
|
|
47
62
|
return ['id'];
|
|
@@ -56,6 +71,21 @@ class CategoryBase extends BaseModel {
|
|
|
56
71
|
static get identifiersFields() {
|
|
57
72
|
return ['id'];
|
|
58
73
|
}
|
|
74
|
+
get glamImages() {
|
|
75
|
+
return this.images[exports.Shops.GLAMSHOP];
|
|
76
|
+
}
|
|
77
|
+
get mensImages() {
|
|
78
|
+
return this.images[exports.Shops.MENSMARKET];
|
|
79
|
+
}
|
|
80
|
+
get glamMetadata() {
|
|
81
|
+
return this.metadata.find((metadata) => metadata.shop === exports.Shops.GLAMSHOP);
|
|
82
|
+
}
|
|
83
|
+
get mensMetadata() {
|
|
84
|
+
return this.metadata.find((metadata) => metadata.shop === exports.Shops.MENSMARKET);
|
|
85
|
+
}
|
|
86
|
+
getMostRelevantByShop(shop) {
|
|
87
|
+
return this.mostRelevant[shop];
|
|
88
|
+
}
|
|
59
89
|
}
|
|
60
90
|
tslib.__decorate([
|
|
61
91
|
classTransformer.Type(() => CategoryBase),
|
|
@@ -164,21 +194,6 @@ tslib.__decorate([
|
|
|
164
194
|
tslib.__metadata("design:type", Category)
|
|
165
195
|
], CategoryFilter.prototype, "category", void 0);
|
|
166
196
|
|
|
167
|
-
exports.GenderDestination = void 0;
|
|
168
|
-
(function (GenderDestination) {
|
|
169
|
-
GenderDestination["FEMALE"] = "female";
|
|
170
|
-
GenderDestination["MALE"] = "male";
|
|
171
|
-
GenderDestination["UNISEX"] = "unisex";
|
|
172
|
-
})(exports.GenderDestination || (exports.GenderDestination = {}));
|
|
173
|
-
|
|
174
|
-
exports.Shops = void 0;
|
|
175
|
-
(function (Shops) {
|
|
176
|
-
Shops["MENSMARKET"] = "mensmarket";
|
|
177
|
-
Shops["GLAMSHOP"] = "Glamshop";
|
|
178
|
-
Shops["GLAMPOINTS"] = "Glampoints";
|
|
179
|
-
Shops["ALL"] = "ALL";
|
|
180
|
-
})(exports.Shops || (exports.Shops = {}));
|
|
181
|
-
|
|
182
197
|
class FilterOption extends BaseModel {
|
|
183
198
|
static get identifiersFields() {
|
|
184
199
|
return ['id'];
|
|
@@ -4698,6 +4713,7 @@ class CategoryHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGr
|
|
|
4698
4713
|
'name',
|
|
4699
4714
|
'description',
|
|
4700
4715
|
'image',
|
|
4716
|
+
{ images: { columnName: 'images', type: HasuraGraphQLColumnType.Jsonb } },
|
|
4701
4717
|
'published',
|
|
4702
4718
|
'shop',
|
|
4703
4719
|
{ shops: { columnName: 'shops', type: HasuraGraphQLColumnType.Jsonb } },
|
|
@@ -4753,7 +4769,7 @@ class CategoryHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGr
|
|
|
4753
4769
|
{
|
|
4754
4770
|
metadata: {
|
|
4755
4771
|
columnName: 'metadata',
|
|
4756
|
-
fields: ['title', 'description'],
|
|
4772
|
+
fields: ['shop', 'title', 'description'],
|
|
4757
4773
|
bindPersistData: (value) => ({
|
|
4758
4774
|
metadata: { data: value },
|
|
4759
4775
|
}),
|
|
@@ -4780,7 +4796,7 @@ class CategoryHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGr
|
|
|
4780
4796
|
}
|
|
4781
4797
|
async create(params) {
|
|
4782
4798
|
const { metadata } = params, data = tslib.__rest(params, ["metadata"]);
|
|
4783
|
-
return super.create(Object.assign(Object.assign({}, data), { isWishlist: false, metadata: metadata || { description: null, title: null } }));
|
|
4799
|
+
return super.create(Object.assign(Object.assign({}, data), { isWishlist: false, metadata: metadata || [{ shop: null, description: null, title: null }] }));
|
|
4784
4800
|
}
|
|
4785
4801
|
async get(identifiers) {
|
|
4786
4802
|
var _a;
|
|
@@ -4971,22 +4987,35 @@ class CategoryHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGr
|
|
|
4971
4987
|
return plainData.products;
|
|
4972
4988
|
}
|
|
4973
4989
|
async updateMetadata(categoryId, { metadata }) {
|
|
4974
|
-
|
|
4975
|
-
|
|
4976
|
-
|
|
4977
|
-
|
|
4978
|
-
|
|
4979
|
-
|
|
4980
|
-
|
|
4981
|
-
|
|
4982
|
-
|
|
4983
|
-
|
|
4984
|
-
|
|
4985
|
-
|
|
4986
|
-
|
|
4987
|
-
|
|
4988
|
-
|
|
4989
|
-
|
|
4990
|
+
if (Array.isArray(metadata) && !metadata.length)
|
|
4991
|
+
return [];
|
|
4992
|
+
if (Array.isArray(metadata) && metadata.length) {
|
|
4993
|
+
await this.mutation('delete_category_metadata', ['affected_rows'], {
|
|
4994
|
+
where: {
|
|
4995
|
+
type: 'category_metadata_bool_exp',
|
|
4996
|
+
required: true,
|
|
4997
|
+
value: { category_id: { _eq: categoryId } },
|
|
4998
|
+
},
|
|
4999
|
+
});
|
|
5000
|
+
await this.mutation('insert_category_metadata', ['affected_rows'], {
|
|
5001
|
+
objects: {
|
|
5002
|
+
type: '[category_metadata_insert_input!]',
|
|
5003
|
+
required: true,
|
|
5004
|
+
value: metadata.map((m) => (Object.assign({ category_id: categoryId }, m))),
|
|
5005
|
+
},
|
|
5006
|
+
});
|
|
5007
|
+
return metadata;
|
|
5008
|
+
}
|
|
5009
|
+
if ('action' in metadata && metadata.action === 'remove' && metadata.value.length) {
|
|
5010
|
+
await this.mutation('delete_category_metadata', ['affected_rows'], {
|
|
5011
|
+
where: {
|
|
5012
|
+
type: 'category_metadata_bool_exp',
|
|
5013
|
+
required: true,
|
|
5014
|
+
value: { category_id: { _eq: categoryId } },
|
|
5015
|
+
},
|
|
5016
|
+
});
|
|
5017
|
+
return [];
|
|
5018
|
+
}
|
|
4990
5019
|
}
|
|
4991
5020
|
async updateFilters(categoryId, { filters }) {
|
|
4992
5021
|
if ('action' in filters && filters.action === 'remove' && filters.value.length) {
|
|
@@ -5996,7 +6025,7 @@ class WishlistHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGr
|
|
|
5996
6025
|
{
|
|
5997
6026
|
metadata: {
|
|
5998
6027
|
columnName: 'metadata',
|
|
5999
|
-
fields: ['title', 'description'],
|
|
6028
|
+
fields: ['shop', 'title', 'description'],
|
|
6000
6029
|
bindPersistData: (value) => ({
|
|
6001
6030
|
metadata: { data: value },
|
|
6002
6031
|
}),
|
|
@@ -6026,8 +6055,9 @@ class WishlistHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGr
|
|
|
6026
6055
|
this.categoryFilterRepository = categoryFilterRepository;
|
|
6027
6056
|
}
|
|
6028
6057
|
async create(params) {
|
|
6058
|
+
var _a;
|
|
6029
6059
|
const { metadata } = params, data = tslib.__rest(params, ["metadata"]);
|
|
6030
|
-
return super.create(Object.assign(Object.assign({}, data), { isWishlist: true, isCollection: true, brandCategory: false, metadata: metadata || { description: data.description, title: data.name } }));
|
|
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 }] }));
|
|
6031
6061
|
}
|
|
6032
6062
|
async get(identifiers) {
|
|
6033
6063
|
const data = await super.get(identifiers);
|
|
@@ -6158,22 +6188,39 @@ class WishlistHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGr
|
|
|
6158
6188
|
return plainData.products;
|
|
6159
6189
|
}
|
|
6160
6190
|
async updateMetadata(categoryId, { metadata }) {
|
|
6161
|
-
|
|
6162
|
-
|
|
6163
|
-
|
|
6164
|
-
|
|
6165
|
-
|
|
6166
|
-
|
|
6167
|
-
|
|
6168
|
-
|
|
6169
|
-
|
|
6170
|
-
|
|
6171
|
-
|
|
6172
|
-
|
|
6173
|
-
|
|
6174
|
-
|
|
6175
|
-
|
|
6176
|
-
|
|
6191
|
+
if (Array.isArray(metadata) && !metadata.length)
|
|
6192
|
+
return [];
|
|
6193
|
+
if (Array.isArray(metadata) && metadata.length) {
|
|
6194
|
+
const metadataUpdated = [];
|
|
6195
|
+
for (const data of metadata) {
|
|
6196
|
+
const update = await this.mutation('update_category_metadata_by_pk', ['category_id', 'shop'], {
|
|
6197
|
+
pk_columns: {
|
|
6198
|
+
value: { category_id: categoryId, shop: data.shop },
|
|
6199
|
+
type: 'category_metadata_pk_columns_input',
|
|
6200
|
+
required: true,
|
|
6201
|
+
},
|
|
6202
|
+
_set: {
|
|
6203
|
+
value: lodash.omit(data, ['category_id', 'shop']),
|
|
6204
|
+
type: 'category_metadata_set_input',
|
|
6205
|
+
required: true,
|
|
6206
|
+
},
|
|
6207
|
+
});
|
|
6208
|
+
metadataUpdated.push(update);
|
|
6209
|
+
}
|
|
6210
|
+
return metadataUpdated;
|
|
6211
|
+
}
|
|
6212
|
+
if ('action' in metadata && metadata.action === 'remove' && metadata.value.length) {
|
|
6213
|
+
for (let i = 0; i < metadata.value.length; i++) {
|
|
6214
|
+
await this.mutation('delete_category_metadata', ['affected_rows'], {
|
|
6215
|
+
where: {
|
|
6216
|
+
type: 'category_metadata_bool_exp',
|
|
6217
|
+
required: true,
|
|
6218
|
+
value: { category_id: { _eq: categoryId }, shop: metadata.value[i].shop },
|
|
6219
|
+
},
|
|
6220
|
+
});
|
|
6221
|
+
}
|
|
6222
|
+
return [];
|
|
6223
|
+
}
|
|
6177
6224
|
}
|
|
6178
6225
|
}
|
|
6179
6226
|
tslib.__decorate([
|
package/index.esm.js
CHANGED
|
@@ -36,6 +36,21 @@ class BaseModel {
|
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
+
var GenderDestination;
|
|
40
|
+
(function (GenderDestination) {
|
|
41
|
+
GenderDestination["FEMALE"] = "female";
|
|
42
|
+
GenderDestination["MALE"] = "male";
|
|
43
|
+
GenderDestination["UNISEX"] = "unisex";
|
|
44
|
+
})(GenderDestination || (GenderDestination = {}));
|
|
45
|
+
|
|
46
|
+
var Shops;
|
|
47
|
+
(function (Shops) {
|
|
48
|
+
Shops["MENSMARKET"] = "mensmarket";
|
|
49
|
+
Shops["GLAMSHOP"] = "Glamshop";
|
|
50
|
+
Shops["GLAMPOINTS"] = "Glampoints";
|
|
51
|
+
Shops["ALL"] = "ALL";
|
|
52
|
+
})(Shops || (Shops = {}));
|
|
53
|
+
|
|
39
54
|
class Filter extends BaseModel {
|
|
40
55
|
static get identifiersFields() {
|
|
41
56
|
return ['id'];
|
|
@@ -50,6 +65,21 @@ class CategoryBase extends BaseModel {
|
|
|
50
65
|
static get identifiersFields() {
|
|
51
66
|
return ['id'];
|
|
52
67
|
}
|
|
68
|
+
get glamImages() {
|
|
69
|
+
return this.images[Shops.GLAMSHOP];
|
|
70
|
+
}
|
|
71
|
+
get mensImages() {
|
|
72
|
+
return this.images[Shops.MENSMARKET];
|
|
73
|
+
}
|
|
74
|
+
get glamMetadata() {
|
|
75
|
+
return this.metadata.find((metadata) => metadata.shop === Shops.GLAMSHOP);
|
|
76
|
+
}
|
|
77
|
+
get mensMetadata() {
|
|
78
|
+
return this.metadata.find((metadata) => metadata.shop === Shops.MENSMARKET);
|
|
79
|
+
}
|
|
80
|
+
getMostRelevantByShop(shop) {
|
|
81
|
+
return this.mostRelevant[shop];
|
|
82
|
+
}
|
|
53
83
|
}
|
|
54
84
|
__decorate([
|
|
55
85
|
Type(() => CategoryBase),
|
|
@@ -158,21 +188,6 @@ __decorate([
|
|
|
158
188
|
__metadata("design:type", Category)
|
|
159
189
|
], CategoryFilter.prototype, "category", void 0);
|
|
160
190
|
|
|
161
|
-
var GenderDestination;
|
|
162
|
-
(function (GenderDestination) {
|
|
163
|
-
GenderDestination["FEMALE"] = "female";
|
|
164
|
-
GenderDestination["MALE"] = "male";
|
|
165
|
-
GenderDestination["UNISEX"] = "unisex";
|
|
166
|
-
})(GenderDestination || (GenderDestination = {}));
|
|
167
|
-
|
|
168
|
-
var Shops;
|
|
169
|
-
(function (Shops) {
|
|
170
|
-
Shops["MENSMARKET"] = "mensmarket";
|
|
171
|
-
Shops["GLAMSHOP"] = "Glamshop";
|
|
172
|
-
Shops["GLAMPOINTS"] = "Glampoints";
|
|
173
|
-
Shops["ALL"] = "ALL";
|
|
174
|
-
})(Shops || (Shops = {}));
|
|
175
|
-
|
|
176
191
|
class FilterOption extends BaseModel {
|
|
177
192
|
static get identifiersFields() {
|
|
178
193
|
return ['id'];
|
|
@@ -4692,6 +4707,7 @@ class CategoryHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGr
|
|
|
4692
4707
|
'name',
|
|
4693
4708
|
'description',
|
|
4694
4709
|
'image',
|
|
4710
|
+
{ images: { columnName: 'images', type: HasuraGraphQLColumnType.Jsonb } },
|
|
4695
4711
|
'published',
|
|
4696
4712
|
'shop',
|
|
4697
4713
|
{ shops: { columnName: 'shops', type: HasuraGraphQLColumnType.Jsonb } },
|
|
@@ -4747,7 +4763,7 @@ class CategoryHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGr
|
|
|
4747
4763
|
{
|
|
4748
4764
|
metadata: {
|
|
4749
4765
|
columnName: 'metadata',
|
|
4750
|
-
fields: ['title', 'description'],
|
|
4766
|
+
fields: ['shop', 'title', 'description'],
|
|
4751
4767
|
bindPersistData: (value) => ({
|
|
4752
4768
|
metadata: { data: value },
|
|
4753
4769
|
}),
|
|
@@ -4774,7 +4790,7 @@ class CategoryHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGr
|
|
|
4774
4790
|
}
|
|
4775
4791
|
async create(params) {
|
|
4776
4792
|
const { metadata } = params, data = __rest(params, ["metadata"]);
|
|
4777
|
-
return super.create(Object.assign(Object.assign({}, data), { isWishlist: false, metadata: metadata || { description: null, title: null } }));
|
|
4793
|
+
return super.create(Object.assign(Object.assign({}, data), { isWishlist: false, metadata: metadata || [{ shop: null, description: null, title: null }] }));
|
|
4778
4794
|
}
|
|
4779
4795
|
async get(identifiers) {
|
|
4780
4796
|
var _a;
|
|
@@ -4965,22 +4981,35 @@ class CategoryHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGr
|
|
|
4965
4981
|
return plainData.products;
|
|
4966
4982
|
}
|
|
4967
4983
|
async updateMetadata(categoryId, { metadata }) {
|
|
4968
|
-
|
|
4969
|
-
|
|
4970
|
-
|
|
4971
|
-
|
|
4972
|
-
|
|
4973
|
-
|
|
4974
|
-
|
|
4975
|
-
|
|
4976
|
-
|
|
4977
|
-
|
|
4978
|
-
|
|
4979
|
-
|
|
4980
|
-
|
|
4981
|
-
|
|
4982
|
-
|
|
4983
|
-
|
|
4984
|
+
if (Array.isArray(metadata) && !metadata.length)
|
|
4985
|
+
return [];
|
|
4986
|
+
if (Array.isArray(metadata) && metadata.length) {
|
|
4987
|
+
await this.mutation('delete_category_metadata', ['affected_rows'], {
|
|
4988
|
+
where: {
|
|
4989
|
+
type: 'category_metadata_bool_exp',
|
|
4990
|
+
required: true,
|
|
4991
|
+
value: { category_id: { _eq: categoryId } },
|
|
4992
|
+
},
|
|
4993
|
+
});
|
|
4994
|
+
await this.mutation('insert_category_metadata', ['affected_rows'], {
|
|
4995
|
+
objects: {
|
|
4996
|
+
type: '[category_metadata_insert_input!]',
|
|
4997
|
+
required: true,
|
|
4998
|
+
value: metadata.map((m) => (Object.assign({ category_id: categoryId }, m))),
|
|
4999
|
+
},
|
|
5000
|
+
});
|
|
5001
|
+
return metadata;
|
|
5002
|
+
}
|
|
5003
|
+
if ('action' in metadata && metadata.action === 'remove' && metadata.value.length) {
|
|
5004
|
+
await this.mutation('delete_category_metadata', ['affected_rows'], {
|
|
5005
|
+
where: {
|
|
5006
|
+
type: 'category_metadata_bool_exp',
|
|
5007
|
+
required: true,
|
|
5008
|
+
value: { category_id: { _eq: categoryId } },
|
|
5009
|
+
},
|
|
5010
|
+
});
|
|
5011
|
+
return [];
|
|
5012
|
+
}
|
|
4984
5013
|
}
|
|
4985
5014
|
async updateFilters(categoryId, { filters }) {
|
|
4986
5015
|
if ('action' in filters && filters.action === 'remove' && filters.value.length) {
|
|
@@ -5990,7 +6019,7 @@ class WishlistHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGr
|
|
|
5990
6019
|
{
|
|
5991
6020
|
metadata: {
|
|
5992
6021
|
columnName: 'metadata',
|
|
5993
|
-
fields: ['title', 'description'],
|
|
6022
|
+
fields: ['shop', 'title', 'description'],
|
|
5994
6023
|
bindPersistData: (value) => ({
|
|
5995
6024
|
metadata: { data: value },
|
|
5996
6025
|
}),
|
|
@@ -6020,8 +6049,9 @@ class WishlistHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGr
|
|
|
6020
6049
|
this.categoryFilterRepository = categoryFilterRepository;
|
|
6021
6050
|
}
|
|
6022
6051
|
async create(params) {
|
|
6052
|
+
var _a;
|
|
6023
6053
|
const { metadata } = params, data = __rest(params, ["metadata"]);
|
|
6024
|
-
return super.create(Object.assign(Object.assign({}, data), { isWishlist: true, isCollection: true, brandCategory: false, metadata: metadata || { description: data.description, title: data.name } }));
|
|
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 }] }));
|
|
6025
6055
|
}
|
|
6026
6056
|
async get(identifiers) {
|
|
6027
6057
|
const data = await super.get(identifiers);
|
|
@@ -6152,22 +6182,39 @@ class WishlistHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGr
|
|
|
6152
6182
|
return plainData.products;
|
|
6153
6183
|
}
|
|
6154
6184
|
async updateMetadata(categoryId, { metadata }) {
|
|
6155
|
-
|
|
6156
|
-
|
|
6157
|
-
|
|
6158
|
-
|
|
6159
|
-
|
|
6160
|
-
|
|
6161
|
-
|
|
6162
|
-
|
|
6163
|
-
|
|
6164
|
-
|
|
6165
|
-
|
|
6166
|
-
|
|
6167
|
-
|
|
6168
|
-
|
|
6169
|
-
|
|
6170
|
-
|
|
6185
|
+
if (Array.isArray(metadata) && !metadata.length)
|
|
6186
|
+
return [];
|
|
6187
|
+
if (Array.isArray(metadata) && metadata.length) {
|
|
6188
|
+
const metadataUpdated = [];
|
|
6189
|
+
for (const data of metadata) {
|
|
6190
|
+
const update = await this.mutation('update_category_metadata_by_pk', ['category_id', 'shop'], {
|
|
6191
|
+
pk_columns: {
|
|
6192
|
+
value: { category_id: categoryId, shop: data.shop },
|
|
6193
|
+
type: 'category_metadata_pk_columns_input',
|
|
6194
|
+
required: true,
|
|
6195
|
+
},
|
|
6196
|
+
_set: {
|
|
6197
|
+
value: omit(data, ['category_id', 'shop']),
|
|
6198
|
+
type: 'category_metadata_set_input',
|
|
6199
|
+
required: true,
|
|
6200
|
+
},
|
|
6201
|
+
});
|
|
6202
|
+
metadataUpdated.push(update);
|
|
6203
|
+
}
|
|
6204
|
+
return metadataUpdated;
|
|
6205
|
+
}
|
|
6206
|
+
if ('action' in metadata && metadata.action === 'remove' && metadata.value.length) {
|
|
6207
|
+
for (let i = 0; i < metadata.value.length; i++) {
|
|
6208
|
+
await this.mutation('delete_category_metadata', ['affected_rows'], {
|
|
6209
|
+
where: {
|
|
6210
|
+
type: 'category_metadata_bool_exp',
|
|
6211
|
+
required: true,
|
|
6212
|
+
value: { category_id: { _eq: categoryId }, shop: metadata.value[i].shop },
|
|
6213
|
+
},
|
|
6214
|
+
});
|
|
6215
|
+
}
|
|
6216
|
+
return [];
|
|
6217
|
+
}
|
|
6171
6218
|
}
|
|
6172
6219
|
}
|
|
6173
6220
|
__decorate([
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { BaseModel, GenericIdentifier, ModelBaseStructure } from '../../generic/model';
|
|
2
2
|
import { Shops } from './enums';
|
|
3
3
|
import { Filter } from './filter';
|
|
4
|
-
import { CategoryCondition, CategoryMetadata } from './types';
|
|
4
|
+
import { CategoryCondition, CategoryImages, CategoryMetadata, CategoryMostRelevant } from './types';
|
|
5
5
|
export declare class CategoryBase<ChildCategory extends ModelBaseStructure<ChildCategory, Identifiers> = ModelBaseStructure<any, any>, Identifiers = ChildCategory['identifiersFields']> extends BaseModel<ChildCategory, Identifiers> {
|
|
6
6
|
id: string;
|
|
7
7
|
brandCategory: boolean;
|
|
@@ -9,6 +9,7 @@ export declare class CategoryBase<ChildCategory extends ModelBaseStructure<Child
|
|
|
9
9
|
name: string;
|
|
10
10
|
slug: string;
|
|
11
11
|
image?: string;
|
|
12
|
+
images?: CategoryImages;
|
|
12
13
|
brandCategoryBanner?: string;
|
|
13
14
|
brandCategoryBannerMobile?: string;
|
|
14
15
|
description: string;
|
|
@@ -19,15 +20,28 @@ export declare class CategoryBase<ChildCategory extends ModelBaseStructure<Child
|
|
|
19
20
|
shop?: Shops;
|
|
20
21
|
shops?: string[];
|
|
21
22
|
published: boolean;
|
|
22
|
-
metadata: CategoryMetadata;
|
|
23
|
+
metadata: CategoryMetadata[];
|
|
23
24
|
isCollection?: boolean;
|
|
24
25
|
isWishlist?: boolean;
|
|
25
26
|
reference?: string;
|
|
26
27
|
parentId?: number;
|
|
27
28
|
theme?: string;
|
|
28
29
|
bannerUrl?: string;
|
|
29
|
-
mostRelevant?:
|
|
30
|
+
mostRelevant?: CategoryMostRelevant;
|
|
30
31
|
parent?: CategoryBase;
|
|
31
32
|
filters?: Filter[];
|
|
32
33
|
static get identifiersFields(): GenericIdentifier[];
|
|
34
|
+
get glamImages(): {
|
|
35
|
+
image: string;
|
|
36
|
+
brandBanner: string;
|
|
37
|
+
brandBannerMobile: string;
|
|
38
|
+
};
|
|
39
|
+
get mensImages(): {
|
|
40
|
+
image: string;
|
|
41
|
+
brandBanner: string;
|
|
42
|
+
brandBannerMobile: string;
|
|
43
|
+
};
|
|
44
|
+
get glamMetadata(): CategoryMetadata;
|
|
45
|
+
get mensMetadata(): CategoryMetadata;
|
|
46
|
+
getMostRelevantByShop(shop: Shops): string[];
|
|
33
47
|
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export * from './category-condition.type';
|
|
2
|
+
export * from './category-images.type';
|
|
2
3
|
export * from './category-metadata.type';
|
|
4
|
+
export * from './category-most-relevant.type';
|
|
3
5
|
export * from './category-product';
|
|
4
6
|
export * from './product-evaluation.type';
|
|
5
7
|
export * from './product-gender.type';
|