@infrab4a/connect 4.23.2 → 4.24.0-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 +82 -118
- package/index.esm.js +81 -117
- package/package.json +1 -1
- package/src/domain/catalog/models/category.d.ts +48 -6
- package/src/domain/catalog/models/filter.d.ts +2 -2
- package/src/domain/catalog/models/index.d.ts +1 -1
- package/src/domain/catalog/models/kit-product.d.ts +5 -4
- package/src/domain/catalog/models/product-base.d.ts +12 -8
- package/src/domain/catalog/models/product-errors.d.ts +2 -1
- package/src/domain/catalog/models/{product-reviews.d.ts → product-review.d.ts} +2 -2
- package/src/domain/catalog/models/product.d.ts +4 -7
- package/src/domain/catalog/models/types/index.d.ts +0 -1
- package/src/domain/catalog/models/types/product-evaluation.type.d.ts +1 -1
- package/src/domain/catalog/models/variant.d.ts +3 -16
- package/src/domain/catalog/repositories/product-reviews.repository.d.ts +5 -5
- package/src/domain/catalog/repositories/product.repository.d.ts +1 -1
- package/src/infra/elasticsearch/indexes/products-index.d.ts +5 -5
- package/src/infra/hasura-graphql/models/product-errors-hasura-graphql.d.ts +1 -4
- package/src/infra/hasura-graphql/models/variant-hasura-graphql.d.ts +0 -2
- package/src/infra/hasura-graphql/repositories/catalog/product-review-hasura-graphql.repository.d.ts +10 -10
- package/src/domain/catalog/models/category-base.d.ts +0 -47
- package/src/domain/catalog/models/category-for-product.d.ts +0 -5
- package/src/domain/catalog/models/product-for-category.d.ts +0 -7
- package/src/domain/catalog/models/product-for-kit.d.ts +0 -7
- package/src/domain/catalog/models/types/product-review.type.d.ts +0 -17
package/index.cjs.js
CHANGED
|
@@ -158,7 +158,7 @@ exports.WishlistLogType = void 0;
|
|
|
158
158
|
WishlistLogType["REMOVE_PRODUCT"] = "remove_product";
|
|
159
159
|
})(exports.WishlistLogType || (exports.WishlistLogType = {}));
|
|
160
160
|
|
|
161
|
-
class
|
|
161
|
+
class Category extends BaseModel {
|
|
162
162
|
static get identifiersFields() {
|
|
163
163
|
return ['id'];
|
|
164
164
|
}
|
|
@@ -191,95 +191,15 @@ class CategoryBase extends BaseModel {
|
|
|
191
191
|
}
|
|
192
192
|
}
|
|
193
193
|
tslib.__decorate([
|
|
194
|
-
classTransformer.Type(() =>
|
|
195
|
-
tslib.__metadata("design:type",
|
|
196
|
-
],
|
|
197
|
-
|
|
198
|
-
class Filter extends BaseModel {
|
|
199
|
-
static get identifiersFields() {
|
|
200
|
-
return ['id'];
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
tslib.__decorate([
|
|
204
|
-
classTransformer.Type(() => CategoryBase),
|
|
205
|
-
tslib.__metadata("design:type", Array)
|
|
206
|
-
], Filter.prototype, "categories", void 0);
|
|
207
|
-
|
|
208
|
-
class CategoryForProduct extends CategoryBase {
|
|
209
|
-
static get identifiersFields() {
|
|
210
|
-
return ['id'];
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
class ProductBase extends BaseModel {
|
|
215
|
-
get evaluation() {
|
|
216
|
-
return {
|
|
217
|
-
reviews: this.reviews,
|
|
218
|
-
count: this.reviewsTotal,
|
|
219
|
-
rating: this.rate,
|
|
220
|
-
};
|
|
221
|
-
}
|
|
222
|
-
set evaluation(evaluation) {
|
|
223
|
-
if (!evaluation) {
|
|
224
|
-
this.reviews = null;
|
|
225
|
-
this.reviewsTotal = null;
|
|
226
|
-
this.rate = null;
|
|
227
|
-
return;
|
|
228
|
-
}
|
|
229
|
-
this.reviews = evaluation.reviews || this.reviews;
|
|
230
|
-
this.reviewsTotal = evaluation.count || this.reviewsTotal;
|
|
231
|
-
this.rate = evaluation.rating || this.rate;
|
|
232
|
-
}
|
|
233
|
-
static get identifiersFields() {
|
|
234
|
-
return ['id'];
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
class ProductForKit extends ProductBase {
|
|
239
|
-
static get identifiersFields() {
|
|
240
|
-
return ['id'];
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
tslib.__decorate([
|
|
244
|
-
classTransformer.Type(() => CategoryForProduct),
|
|
245
|
-
tslib.__metadata("design:type", CategoryForProduct)
|
|
246
|
-
], ProductForKit.prototype, "category", void 0);
|
|
247
|
-
|
|
248
|
-
class KitProduct extends BaseModel {
|
|
249
|
-
static get identifiersFields() {
|
|
250
|
-
return ['productId', 'kitProductId'];
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
tslib.__decorate([
|
|
254
|
-
classTransformer.Type(() => ProductForKit),
|
|
255
|
-
tslib.__metadata("design:type", ProductForKit)
|
|
256
|
-
], KitProduct.prototype, "kit", void 0);
|
|
257
|
-
tslib.__decorate([
|
|
258
|
-
classTransformer.Type(() => ProductForKit),
|
|
259
|
-
tslib.__metadata("design:type", ProductForKit)
|
|
260
|
-
], KitProduct.prototype, "product", void 0);
|
|
261
|
-
|
|
262
|
-
class ProductForCategory extends ProductBase {
|
|
263
|
-
static get identifiersFields() {
|
|
264
|
-
return ['id'];
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
tslib.__decorate([
|
|
268
|
-
classTransformer.Type(() => KitProduct),
|
|
269
|
-
tslib.__metadata("design:type", Array)
|
|
270
|
-
], ProductForCategory.prototype, "kitProducts", void 0);
|
|
271
|
-
|
|
272
|
-
class Category extends CategoryBase {
|
|
273
|
-
static get identifiersFields() {
|
|
274
|
-
return ['id'];
|
|
275
|
-
}
|
|
276
|
-
}
|
|
194
|
+
classTransformer.Type(() => Category),
|
|
195
|
+
tslib.__metadata("design:type", Category)
|
|
196
|
+
], Category.prototype, "parent", void 0);
|
|
277
197
|
tslib.__decorate([
|
|
278
|
-
classTransformer.Type(() =>
|
|
198
|
+
classTransformer.Type(() => require('./product')['Product']),
|
|
279
199
|
tslib.__metadata("design:type", Array)
|
|
280
200
|
], Category.prototype, "childrenProducts", void 0);
|
|
281
201
|
tslib.__decorate([
|
|
282
|
-
classTransformer.Type(() => Filter),
|
|
202
|
+
classTransformer.Type(() => require('./filter')['Filter']),
|
|
283
203
|
tslib.__metadata("design:type", Array)
|
|
284
204
|
], Category.prototype, "filters", void 0);
|
|
285
205
|
|
|
@@ -293,6 +213,16 @@ tslib.__decorate([
|
|
|
293
213
|
tslib.__metadata("design:type", CategoryCollectionChildren)
|
|
294
214
|
], CategoryCollectionChildren.prototype, "parent", void 0);
|
|
295
215
|
|
|
216
|
+
class Filter extends BaseModel {
|
|
217
|
+
static get identifiersFields() {
|
|
218
|
+
return ['id'];
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
tslib.__decorate([
|
|
222
|
+
classTransformer.Type(() => Category),
|
|
223
|
+
tslib.__metadata("design:type", Array)
|
|
224
|
+
], Filter.prototype, "categories", void 0);
|
|
225
|
+
|
|
296
226
|
class CategoryFilter extends BaseModel {
|
|
297
227
|
static get identifiersFields() {
|
|
298
228
|
return ['id'];
|
|
@@ -319,32 +249,81 @@ class FilterOption extends BaseModel {
|
|
|
319
249
|
}
|
|
320
250
|
}
|
|
321
251
|
|
|
322
|
-
class
|
|
252
|
+
class KitProduct extends BaseModel {
|
|
253
|
+
static get identifiersFields() {
|
|
254
|
+
return ['productId', 'kitProductId'];
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
tslib.__decorate([
|
|
258
|
+
classTransformer.Type(() => require('./product')['Product']),
|
|
259
|
+
tslib.__metadata("design:type", Function)
|
|
260
|
+
], KitProduct.prototype, "kit", void 0);
|
|
261
|
+
tslib.__decorate([
|
|
262
|
+
classTransformer.Type(() => require('./product')['Product']),
|
|
263
|
+
tslib.__metadata("design:type", Function)
|
|
264
|
+
], KitProduct.prototype, "product", void 0);
|
|
265
|
+
|
|
266
|
+
class ProductReview extends BaseModel {
|
|
267
|
+
static get identifiersFields() {
|
|
268
|
+
return ['id'];
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
class ProductBase extends BaseModel {
|
|
273
|
+
get evaluation() {
|
|
274
|
+
return {
|
|
275
|
+
reviews: this.reviews,
|
|
276
|
+
count: this.reviewsTotal,
|
|
277
|
+
rating: this.rate,
|
|
278
|
+
};
|
|
279
|
+
}
|
|
280
|
+
set evaluation(evaluation) {
|
|
281
|
+
if (!evaluation) {
|
|
282
|
+
this.reviews = null;
|
|
283
|
+
this.reviewsTotal = null;
|
|
284
|
+
this.rate = null;
|
|
285
|
+
return;
|
|
286
|
+
}
|
|
287
|
+
this.reviews = evaluation.reviews || this.reviews;
|
|
288
|
+
this.reviewsTotal = evaluation.count || this.reviewsTotal;
|
|
289
|
+
this.rate = evaluation.rating || this.rate;
|
|
290
|
+
}
|
|
323
291
|
static get identifiersFields() {
|
|
324
292
|
return ['id'];
|
|
325
293
|
}
|
|
326
294
|
}
|
|
327
295
|
tslib.__decorate([
|
|
328
|
-
classTransformer.Type(() =>
|
|
329
|
-
tslib.__metadata("design:type",
|
|
330
|
-
],
|
|
296
|
+
classTransformer.Type(() => Category),
|
|
297
|
+
tslib.__metadata("design:type", Category)
|
|
298
|
+
], ProductBase.prototype, "category", void 0);
|
|
331
299
|
tslib.__decorate([
|
|
332
300
|
classTransformer.Type(() => KitProduct),
|
|
333
301
|
tslib.__metadata("design:type", Array)
|
|
334
|
-
],
|
|
302
|
+
], ProductBase.prototype, "kitProducts", void 0);
|
|
303
|
+
tslib.__decorate([
|
|
304
|
+
classTransformer.Type(() => ProductReview),
|
|
305
|
+
tslib.__metadata("design:type", Array)
|
|
306
|
+
], ProductBase.prototype, "reviews", void 0);
|
|
335
307
|
|
|
336
|
-
class Variant extends
|
|
308
|
+
class Variant extends ProductBase {
|
|
337
309
|
static get identifiersFields() {
|
|
338
310
|
return ['id', 'productId'];
|
|
339
311
|
}
|
|
340
312
|
}
|
|
341
313
|
|
|
314
|
+
class Product extends ProductBase {
|
|
315
|
+
}
|
|
316
|
+
tslib.__decorate([
|
|
317
|
+
classTransformer.Type(() => Variant),
|
|
318
|
+
tslib.__metadata("design:type", Array)
|
|
319
|
+
], Product.prototype, "variants", void 0);
|
|
320
|
+
|
|
342
321
|
class ProductErrors extends BaseModel {
|
|
343
322
|
static get identifiersFields() {
|
|
344
323
|
return ['productId', 'source', 'error'];
|
|
345
324
|
}
|
|
346
325
|
getProductId() {
|
|
347
|
-
return this.product
|
|
326
|
+
return this.product.productId || this.product.id;
|
|
348
327
|
}
|
|
349
328
|
}
|
|
350
329
|
tslib.__decorate([
|
|
@@ -352,12 +331,6 @@ tslib.__decorate([
|
|
|
352
331
|
tslib.__metadata("design:type", Object)
|
|
353
332
|
], ProductErrors.prototype, "product", void 0);
|
|
354
333
|
|
|
355
|
-
class ProductReviews extends BaseModel {
|
|
356
|
-
static get identifiersFields() {
|
|
357
|
-
return ['id'];
|
|
358
|
-
}
|
|
359
|
-
}
|
|
360
|
-
|
|
361
334
|
class ProductStockNotification extends BaseModel {
|
|
362
335
|
static get identifiersFields() {
|
|
363
336
|
return ['id'];
|
|
@@ -5039,6 +5012,9 @@ tslib.__decorate([
|
|
|
5039
5012
|
tslib.__metadata("design:type", Product)
|
|
5040
5013
|
], KitProductHasuraGraphQL.prototype, "product", void 0);
|
|
5041
5014
|
|
|
5015
|
+
class ProductErrorsHasuraGraphQL extends ProductErrors {
|
|
5016
|
+
}
|
|
5017
|
+
|
|
5042
5018
|
class ProductHasuraGraphQL extends Product {
|
|
5043
5019
|
}
|
|
5044
5020
|
tslib.__decorate([
|
|
@@ -5047,20 +5023,8 @@ tslib.__decorate([
|
|
|
5047
5023
|
], ProductHasuraGraphQL.prototype, "kitProducts", void 0);
|
|
5048
5024
|
|
|
5049
5025
|
class VariantHasuraGraphQL extends Variant {
|
|
5050
|
-
constructor() {
|
|
5051
|
-
super(...arguments);
|
|
5052
|
-
this.name = '';
|
|
5053
|
-
this.hasVariants = false;
|
|
5054
|
-
}
|
|
5055
5026
|
}
|
|
5056
5027
|
|
|
5057
|
-
class ProductErrorsHasuraGraphQL extends ProductErrors {
|
|
5058
|
-
}
|
|
5059
|
-
tslib.__decorate([
|
|
5060
|
-
classTransformer.Type((type) => (+type.object.product.productId ? VariantHasuraGraphQL : ProductHasuraGraphQL)),
|
|
5061
|
-
tslib.__metadata("design:type", Object)
|
|
5062
|
-
], ProductErrorsHasuraGraphQL.prototype, "product", void 0);
|
|
5063
|
-
|
|
5064
5028
|
class CategoryCollectionChildrenHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGraphQL(Base)) {
|
|
5065
5029
|
constructor({ endpoint, authOptions, interceptors, }) {
|
|
5066
5030
|
super({
|
|
@@ -5925,7 +5889,7 @@ class ProductHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGra
|
|
|
5925
5889
|
interceptors,
|
|
5926
5890
|
fields: [],
|
|
5927
5891
|
});
|
|
5928
|
-
this.bindReviewToModel = (plain) => (Object.assign(Object.assign({}, is(lodash.omit(plain, ['product_id', 'created_at', 'updated_at', 'person_id', 'order_id']))), { createdAt: typeof plain.created_at === 'string' ? new Date(plain.created_at) : plain.created_at, updatedAt: typeof plain.updated_at === 'string' ? new Date(plain.updated_at) : plain.updated_at, personId: plain.person_id, orderId: plain.order_id }));
|
|
5892
|
+
this.bindReviewToModel = (plain) => ProductReview.toInstance(Object.assign(Object.assign({}, is(lodash.omit(plain, ['product_id', 'created_at', 'updated_at', 'person_id', 'order_id']))), { createdAt: typeof plain.created_at === 'string' ? new Date(plain.created_at) : plain.created_at, updatedAt: typeof plain.updated_at === 'string' ? new Date(plain.updated_at) : plain.updated_at, personId: plain.person_id, orderId: plain.order_id }));
|
|
5929
5893
|
this.bindReviewToHasura = (review) => (Object.assign(Object.assign({}, is(lodash.omit(review, ['productId', 'createdAt', 'updatedAt', 'personId', 'orderId']))), { person_id: review.personId, order_id: review.orderId }));
|
|
5930
5894
|
const commonFields = [
|
|
5931
5895
|
{ id: { columnName: 'id', to: (value) => +value, from: (value) => value.toString() } },
|
|
@@ -6440,11 +6404,11 @@ tslib.__decorate([
|
|
|
6440
6404
|
tslib.__metadata("design:returntype", Promise)
|
|
6441
6405
|
], ProductHasuraGraphQLRepository.prototype, "cleanShoppingCountFromIds", null);
|
|
6442
6406
|
|
|
6443
|
-
class
|
|
6407
|
+
class ProductReviewHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGraphQL(Base)) {
|
|
6444
6408
|
constructor({ endpoint, authOptions, interceptors, }) {
|
|
6445
6409
|
super({
|
|
6446
6410
|
tableName: 'product_review',
|
|
6447
|
-
model:
|
|
6411
|
+
model: ProductReview,
|
|
6448
6412
|
endpoint,
|
|
6449
6413
|
authOptions,
|
|
6450
6414
|
interceptors,
|
|
@@ -6497,13 +6461,13 @@ tslib.__decorate([
|
|
|
6497
6461
|
tslib.__metadata("design:type", Function),
|
|
6498
6462
|
tslib.__metadata("design:paramtypes", [Number]),
|
|
6499
6463
|
tslib.__metadata("design:returntype", void 0)
|
|
6500
|
-
],
|
|
6464
|
+
], ProductReviewHasuraGraphQLRepository.prototype, "aproveReview", null);
|
|
6501
6465
|
tslib.__decorate([
|
|
6502
6466
|
Log(),
|
|
6503
6467
|
tslib.__metadata("design:type", Function),
|
|
6504
6468
|
tslib.__metadata("design:paramtypes", [Number]),
|
|
6505
6469
|
tslib.__metadata("design:returntype", void 0)
|
|
6506
|
-
],
|
|
6470
|
+
], ProductReviewHasuraGraphQLRepository.prototype, "disaproveReview", null);
|
|
6507
6471
|
|
|
6508
6472
|
class ProductStockNotificationHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGraphQL(Base)) {
|
|
6509
6473
|
constructor({ endpoint, authOptions, interceptors, }) {
|
|
@@ -7639,8 +7603,8 @@ exports.ProductErrorsHasuraGraphQLRepository = ProductErrorsHasuraGraphQLReposit
|
|
|
7639
7603
|
exports.ProductFirestoreRepository = ProductFirestoreRepository;
|
|
7640
7604
|
exports.ProductHasuraGraphQL = ProductHasuraGraphQL;
|
|
7641
7605
|
exports.ProductHasuraGraphQLRepository = ProductHasuraGraphQLRepository;
|
|
7642
|
-
exports.
|
|
7643
|
-
exports.
|
|
7606
|
+
exports.ProductReview = ProductReview;
|
|
7607
|
+
exports.ProductReviewHasuraGraphQLRepository = ProductReviewHasuraGraphQLRepository;
|
|
7644
7608
|
exports.ProductStockNotification = ProductStockNotification;
|
|
7645
7609
|
exports.ProductStockNotificationHasuraGraphQLRepository = ProductStockNotificationHasuraGraphQLRepository;
|
|
7646
7610
|
exports.ProductVariantFirestoreRepository = ProductVariantFirestoreRepository;
|
package/index.esm.js
CHANGED
|
@@ -152,7 +152,7 @@ var WishlistLogType;
|
|
|
152
152
|
WishlistLogType["REMOVE_PRODUCT"] = "remove_product";
|
|
153
153
|
})(WishlistLogType || (WishlistLogType = {}));
|
|
154
154
|
|
|
155
|
-
class
|
|
155
|
+
class Category extends BaseModel {
|
|
156
156
|
static get identifiersFields() {
|
|
157
157
|
return ['id'];
|
|
158
158
|
}
|
|
@@ -185,95 +185,15 @@ class CategoryBase extends BaseModel {
|
|
|
185
185
|
}
|
|
186
186
|
}
|
|
187
187
|
__decorate([
|
|
188
|
-
Type(() =>
|
|
189
|
-
__metadata("design:type",
|
|
190
|
-
],
|
|
191
|
-
|
|
192
|
-
class Filter extends BaseModel {
|
|
193
|
-
static get identifiersFields() {
|
|
194
|
-
return ['id'];
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
__decorate([
|
|
198
|
-
Type(() => CategoryBase),
|
|
199
|
-
__metadata("design:type", Array)
|
|
200
|
-
], Filter.prototype, "categories", void 0);
|
|
201
|
-
|
|
202
|
-
class CategoryForProduct extends CategoryBase {
|
|
203
|
-
static get identifiersFields() {
|
|
204
|
-
return ['id'];
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
class ProductBase extends BaseModel {
|
|
209
|
-
get evaluation() {
|
|
210
|
-
return {
|
|
211
|
-
reviews: this.reviews,
|
|
212
|
-
count: this.reviewsTotal,
|
|
213
|
-
rating: this.rate,
|
|
214
|
-
};
|
|
215
|
-
}
|
|
216
|
-
set evaluation(evaluation) {
|
|
217
|
-
if (!evaluation) {
|
|
218
|
-
this.reviews = null;
|
|
219
|
-
this.reviewsTotal = null;
|
|
220
|
-
this.rate = null;
|
|
221
|
-
return;
|
|
222
|
-
}
|
|
223
|
-
this.reviews = evaluation.reviews || this.reviews;
|
|
224
|
-
this.reviewsTotal = evaluation.count || this.reviewsTotal;
|
|
225
|
-
this.rate = evaluation.rating || this.rate;
|
|
226
|
-
}
|
|
227
|
-
static get identifiersFields() {
|
|
228
|
-
return ['id'];
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
class ProductForKit extends ProductBase {
|
|
233
|
-
static get identifiersFields() {
|
|
234
|
-
return ['id'];
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
__decorate([
|
|
238
|
-
Type(() => CategoryForProduct),
|
|
239
|
-
__metadata("design:type", CategoryForProduct)
|
|
240
|
-
], ProductForKit.prototype, "category", void 0);
|
|
241
|
-
|
|
242
|
-
class KitProduct extends BaseModel {
|
|
243
|
-
static get identifiersFields() {
|
|
244
|
-
return ['productId', 'kitProductId'];
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
__decorate([
|
|
248
|
-
Type(() => ProductForKit),
|
|
249
|
-
__metadata("design:type", ProductForKit)
|
|
250
|
-
], KitProduct.prototype, "kit", void 0);
|
|
251
|
-
__decorate([
|
|
252
|
-
Type(() => ProductForKit),
|
|
253
|
-
__metadata("design:type", ProductForKit)
|
|
254
|
-
], KitProduct.prototype, "product", void 0);
|
|
255
|
-
|
|
256
|
-
class ProductForCategory extends ProductBase {
|
|
257
|
-
static get identifiersFields() {
|
|
258
|
-
return ['id'];
|
|
259
|
-
}
|
|
260
|
-
}
|
|
261
|
-
__decorate([
|
|
262
|
-
Type(() => KitProduct),
|
|
263
|
-
__metadata("design:type", Array)
|
|
264
|
-
], ProductForCategory.prototype, "kitProducts", void 0);
|
|
265
|
-
|
|
266
|
-
class Category extends CategoryBase {
|
|
267
|
-
static get identifiersFields() {
|
|
268
|
-
return ['id'];
|
|
269
|
-
}
|
|
270
|
-
}
|
|
188
|
+
Type(() => Category),
|
|
189
|
+
__metadata("design:type", Category)
|
|
190
|
+
], Category.prototype, "parent", void 0);
|
|
271
191
|
__decorate([
|
|
272
|
-
Type(() =>
|
|
192
|
+
Type(() => require('./product')['Product']),
|
|
273
193
|
__metadata("design:type", Array)
|
|
274
194
|
], Category.prototype, "childrenProducts", void 0);
|
|
275
195
|
__decorate([
|
|
276
|
-
Type(() => Filter),
|
|
196
|
+
Type(() => require('./filter')['Filter']),
|
|
277
197
|
__metadata("design:type", Array)
|
|
278
198
|
], Category.prototype, "filters", void 0);
|
|
279
199
|
|
|
@@ -287,6 +207,16 @@ __decorate([
|
|
|
287
207
|
__metadata("design:type", CategoryCollectionChildren)
|
|
288
208
|
], CategoryCollectionChildren.prototype, "parent", void 0);
|
|
289
209
|
|
|
210
|
+
class Filter extends BaseModel {
|
|
211
|
+
static get identifiersFields() {
|
|
212
|
+
return ['id'];
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
__decorate([
|
|
216
|
+
Type(() => Category),
|
|
217
|
+
__metadata("design:type", Array)
|
|
218
|
+
], Filter.prototype, "categories", void 0);
|
|
219
|
+
|
|
290
220
|
class CategoryFilter extends BaseModel {
|
|
291
221
|
static get identifiersFields() {
|
|
292
222
|
return ['id'];
|
|
@@ -313,32 +243,81 @@ class FilterOption extends BaseModel {
|
|
|
313
243
|
}
|
|
314
244
|
}
|
|
315
245
|
|
|
316
|
-
class
|
|
246
|
+
class KitProduct extends BaseModel {
|
|
247
|
+
static get identifiersFields() {
|
|
248
|
+
return ['productId', 'kitProductId'];
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
__decorate([
|
|
252
|
+
Type(() => require('./product')['Product']),
|
|
253
|
+
__metadata("design:type", Function)
|
|
254
|
+
], KitProduct.prototype, "kit", void 0);
|
|
255
|
+
__decorate([
|
|
256
|
+
Type(() => require('./product')['Product']),
|
|
257
|
+
__metadata("design:type", Function)
|
|
258
|
+
], KitProduct.prototype, "product", void 0);
|
|
259
|
+
|
|
260
|
+
class ProductReview extends BaseModel {
|
|
261
|
+
static get identifiersFields() {
|
|
262
|
+
return ['id'];
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
class ProductBase extends BaseModel {
|
|
267
|
+
get evaluation() {
|
|
268
|
+
return {
|
|
269
|
+
reviews: this.reviews,
|
|
270
|
+
count: this.reviewsTotal,
|
|
271
|
+
rating: this.rate,
|
|
272
|
+
};
|
|
273
|
+
}
|
|
274
|
+
set evaluation(evaluation) {
|
|
275
|
+
if (!evaluation) {
|
|
276
|
+
this.reviews = null;
|
|
277
|
+
this.reviewsTotal = null;
|
|
278
|
+
this.rate = null;
|
|
279
|
+
return;
|
|
280
|
+
}
|
|
281
|
+
this.reviews = evaluation.reviews || this.reviews;
|
|
282
|
+
this.reviewsTotal = evaluation.count || this.reviewsTotal;
|
|
283
|
+
this.rate = evaluation.rating || this.rate;
|
|
284
|
+
}
|
|
317
285
|
static get identifiersFields() {
|
|
318
286
|
return ['id'];
|
|
319
287
|
}
|
|
320
288
|
}
|
|
321
289
|
__decorate([
|
|
322
|
-
Type(() =>
|
|
323
|
-
__metadata("design:type",
|
|
324
|
-
],
|
|
290
|
+
Type(() => Category),
|
|
291
|
+
__metadata("design:type", Category)
|
|
292
|
+
], ProductBase.prototype, "category", void 0);
|
|
325
293
|
__decorate([
|
|
326
294
|
Type(() => KitProduct),
|
|
327
295
|
__metadata("design:type", Array)
|
|
328
|
-
],
|
|
296
|
+
], ProductBase.prototype, "kitProducts", void 0);
|
|
297
|
+
__decorate([
|
|
298
|
+
Type(() => ProductReview),
|
|
299
|
+
__metadata("design:type", Array)
|
|
300
|
+
], ProductBase.prototype, "reviews", void 0);
|
|
329
301
|
|
|
330
|
-
class Variant extends
|
|
302
|
+
class Variant extends ProductBase {
|
|
331
303
|
static get identifiersFields() {
|
|
332
304
|
return ['id', 'productId'];
|
|
333
305
|
}
|
|
334
306
|
}
|
|
335
307
|
|
|
308
|
+
class Product extends ProductBase {
|
|
309
|
+
}
|
|
310
|
+
__decorate([
|
|
311
|
+
Type(() => Variant),
|
|
312
|
+
__metadata("design:type", Array)
|
|
313
|
+
], Product.prototype, "variants", void 0);
|
|
314
|
+
|
|
336
315
|
class ProductErrors extends BaseModel {
|
|
337
316
|
static get identifiersFields() {
|
|
338
317
|
return ['productId', 'source', 'error'];
|
|
339
318
|
}
|
|
340
319
|
getProductId() {
|
|
341
|
-
return this.product
|
|
320
|
+
return this.product.productId || this.product.id;
|
|
342
321
|
}
|
|
343
322
|
}
|
|
344
323
|
__decorate([
|
|
@@ -346,12 +325,6 @@ __decorate([
|
|
|
346
325
|
__metadata("design:type", Object)
|
|
347
326
|
], ProductErrors.prototype, "product", void 0);
|
|
348
327
|
|
|
349
|
-
class ProductReviews extends BaseModel {
|
|
350
|
-
static get identifiersFields() {
|
|
351
|
-
return ['id'];
|
|
352
|
-
}
|
|
353
|
-
}
|
|
354
|
-
|
|
355
328
|
class ProductStockNotification extends BaseModel {
|
|
356
329
|
static get identifiersFields() {
|
|
357
330
|
return ['id'];
|
|
@@ -5033,6 +5006,9 @@ __decorate([
|
|
|
5033
5006
|
__metadata("design:type", Product)
|
|
5034
5007
|
], KitProductHasuraGraphQL.prototype, "product", void 0);
|
|
5035
5008
|
|
|
5009
|
+
class ProductErrorsHasuraGraphQL extends ProductErrors {
|
|
5010
|
+
}
|
|
5011
|
+
|
|
5036
5012
|
class ProductHasuraGraphQL extends Product {
|
|
5037
5013
|
}
|
|
5038
5014
|
__decorate([
|
|
@@ -5041,20 +5017,8 @@ __decorate([
|
|
|
5041
5017
|
], ProductHasuraGraphQL.prototype, "kitProducts", void 0);
|
|
5042
5018
|
|
|
5043
5019
|
class VariantHasuraGraphQL extends Variant {
|
|
5044
|
-
constructor() {
|
|
5045
|
-
super(...arguments);
|
|
5046
|
-
this.name = '';
|
|
5047
|
-
this.hasVariants = false;
|
|
5048
|
-
}
|
|
5049
5020
|
}
|
|
5050
5021
|
|
|
5051
|
-
class ProductErrorsHasuraGraphQL extends ProductErrors {
|
|
5052
|
-
}
|
|
5053
|
-
__decorate([
|
|
5054
|
-
Type((type) => (+type.object.product.productId ? VariantHasuraGraphQL : ProductHasuraGraphQL)),
|
|
5055
|
-
__metadata("design:type", Object)
|
|
5056
|
-
], ProductErrorsHasuraGraphQL.prototype, "product", void 0);
|
|
5057
|
-
|
|
5058
5022
|
class CategoryCollectionChildrenHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGraphQL(Base)) {
|
|
5059
5023
|
constructor({ endpoint, authOptions, interceptors, }) {
|
|
5060
5024
|
super({
|
|
@@ -5919,7 +5883,7 @@ class ProductHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGra
|
|
|
5919
5883
|
interceptors,
|
|
5920
5884
|
fields: [],
|
|
5921
5885
|
});
|
|
5922
|
-
this.bindReviewToModel = (plain) => (Object.assign(Object.assign({}, is(omit(plain, ['product_id', 'created_at', 'updated_at', 'person_id', 'order_id']))), { createdAt: typeof plain.created_at === 'string' ? new Date(plain.created_at) : plain.created_at, updatedAt: typeof plain.updated_at === 'string' ? new Date(plain.updated_at) : plain.updated_at, personId: plain.person_id, orderId: plain.order_id }));
|
|
5886
|
+
this.bindReviewToModel = (plain) => ProductReview.toInstance(Object.assign(Object.assign({}, is(omit(plain, ['product_id', 'created_at', 'updated_at', 'person_id', 'order_id']))), { createdAt: typeof plain.created_at === 'string' ? new Date(plain.created_at) : plain.created_at, updatedAt: typeof plain.updated_at === 'string' ? new Date(plain.updated_at) : plain.updated_at, personId: plain.person_id, orderId: plain.order_id }));
|
|
5923
5887
|
this.bindReviewToHasura = (review) => (Object.assign(Object.assign({}, is(omit(review, ['productId', 'createdAt', 'updatedAt', 'personId', 'orderId']))), { person_id: review.personId, order_id: review.orderId }));
|
|
5924
5888
|
const commonFields = [
|
|
5925
5889
|
{ id: { columnName: 'id', to: (value) => +value, from: (value) => value.toString() } },
|
|
@@ -6434,11 +6398,11 @@ __decorate([
|
|
|
6434
6398
|
__metadata("design:returntype", Promise)
|
|
6435
6399
|
], ProductHasuraGraphQLRepository.prototype, "cleanShoppingCountFromIds", null);
|
|
6436
6400
|
|
|
6437
|
-
class
|
|
6401
|
+
class ProductReviewHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGraphQL(Base)) {
|
|
6438
6402
|
constructor({ endpoint, authOptions, interceptors, }) {
|
|
6439
6403
|
super({
|
|
6440
6404
|
tableName: 'product_review',
|
|
6441
|
-
model:
|
|
6405
|
+
model: ProductReview,
|
|
6442
6406
|
endpoint,
|
|
6443
6407
|
authOptions,
|
|
6444
6408
|
interceptors,
|
|
@@ -6491,13 +6455,13 @@ __decorate([
|
|
|
6491
6455
|
__metadata("design:type", Function),
|
|
6492
6456
|
__metadata("design:paramtypes", [Number]),
|
|
6493
6457
|
__metadata("design:returntype", void 0)
|
|
6494
|
-
],
|
|
6458
|
+
], ProductReviewHasuraGraphQLRepository.prototype, "aproveReview", null);
|
|
6495
6459
|
__decorate([
|
|
6496
6460
|
Log(),
|
|
6497
6461
|
__metadata("design:type", Function),
|
|
6498
6462
|
__metadata("design:paramtypes", [Number]),
|
|
6499
6463
|
__metadata("design:returntype", void 0)
|
|
6500
|
-
],
|
|
6464
|
+
], ProductReviewHasuraGraphQLRepository.prototype, "disaproveReview", null);
|
|
6501
6465
|
|
|
6502
6466
|
class ProductStockNotificationHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGraphQL(Base)) {
|
|
6503
6467
|
constructor({ endpoint, authOptions, interceptors, }) {
|
|
@@ -7421,4 +7385,4 @@ class ProductsVertexSearch {
|
|
|
7421
7385
|
}
|
|
7422
7386
|
}
|
|
7423
7387
|
|
|
7424
|
-
export { AccessoryImportances, Address, AdyenCardAxiosAdapter, AdyenPaymentMethodFactory, AntifraudBankSlipService, AntifraudCardService, AntifraudGlampointsService, AntifraudPixService, AntifraudProviderFactory, AntifraudProviders, Area, Authentication, AuthenticationFirebaseAuthService, AxiosAdapter, Base, BaseModel, BeardProblems, BeardSizes, BeautyProductImportances, BeautyProfile, BeautyQuestionsHelper, BillingStatus, BodyProblems, BodyShapes, BodyTattoos, BusinessError, BusinessUnitEnum, Buy2Win, Buy2WinFirestoreRepository, Campaign, CampaignBanner, CampaignDashboard, CampaignDashboardFirestoreRepository, CampaignHashtag, CampaignHashtagFirestoreRepository, Category, CategoryCollectionChildren, CategoryCollectionChildrenHasuraGraphQLRepository, CategoryFilter, CategoryFilterHasuraGraphQLRepository, CategoryFirestoreRepository, CategoryHasuraGraphQL, CategoryHasuraGraphQLRepository, CategoryProduct, CategoryProductHasuraGraphQLRepository, Checkout, CheckoutFirestoreRepository, CheckoutSubscription, CheckoutSubscriptionFirestoreRepository, CheckoutTypes, ClassNameHelper, ConnectBaseDocumentSnapshot, ConnectCollectionService, ConnectDocumentService, ConnectFirestoreService, Coupon, CouponCategories, CouponCategory, CouponChannels, CouponFirestoreRepository, CouponOldCategories, CouponSubtypes, CouponTypes, Debug, DebugDecoratorHelper, DebugHelper, DebugNamespaces, DuplicatedResultsError, Edition, EditionStatus, Exclusivities, FaceSkinOilinesses, FaceSkinProblems, FaceSkinTones, FamilyIncomes, Filter, FilterHasuraGraphQLRepository, FilterOption, FilterOptionHasuraGraphQLRepository, FilterType, FirebaseFileUploaderService, FragranceImportances, FraudValidationError, GenderDestination, GlampointsPaymentMethodFactory, GlampointsPaymentService, HairColors, HairProblems, HairStrands, HairTypes, Home, HomeFirestoreRepository, InvalidArgumentError, KitProduct, KitProductHasuraGraphQL, Lead, LeadFirestoreRepository, LegacyOrderFirestoreRepository, LineItem, Log, LogDocument, LogFirestoreRepository, Logger, NotFoundError, OfficePosition, Order, OrderBlocked, OrderBlockedFirestoreRepository, OrderBlockedType, OrderFirestoreRepository, OrderStatus, PagarmeBankSlipAxiosAdapter, PagarmeCardAxiosAdapter, PagarmePaymentMethodFactory, PagarmePaymentStatus, PagarmePixAxiosAdapter, Payment, PaymentError, PaymentFirestoreRepository, PaymentMethods, PaymentProviderFactory, PaymentProviders, PaymentTransaction, PaymentType, PersonTypes, Plans, Product, ProductErrors, ProductErrorsHasuraGraphQL, ProductErrorsHasuraGraphQLRepository, ProductFirestoreRepository, ProductHasuraGraphQL, ProductHasuraGraphQLRepository, ProductLabelEnum,
|
|
7388
|
+
export { AccessoryImportances, Address, AdyenCardAxiosAdapter, AdyenPaymentMethodFactory, AntifraudBankSlipService, AntifraudCardService, AntifraudGlampointsService, AntifraudPixService, AntifraudProviderFactory, AntifraudProviders, Area, Authentication, AuthenticationFirebaseAuthService, AxiosAdapter, Base, BaseModel, BeardProblems, BeardSizes, BeautyProductImportances, BeautyProfile, BeautyQuestionsHelper, BillingStatus, BodyProblems, BodyShapes, BodyTattoos, BusinessError, BusinessUnitEnum, Buy2Win, Buy2WinFirestoreRepository, Campaign, CampaignBanner, CampaignDashboard, CampaignDashboardFirestoreRepository, CampaignHashtag, CampaignHashtagFirestoreRepository, Category, CategoryCollectionChildren, CategoryCollectionChildrenHasuraGraphQLRepository, CategoryFilter, CategoryFilterHasuraGraphQLRepository, CategoryFirestoreRepository, CategoryHasuraGraphQL, CategoryHasuraGraphQLRepository, CategoryProduct, CategoryProductHasuraGraphQLRepository, Checkout, CheckoutFirestoreRepository, CheckoutSubscription, CheckoutSubscriptionFirestoreRepository, CheckoutTypes, ClassNameHelper, ConnectBaseDocumentSnapshot, ConnectCollectionService, ConnectDocumentService, ConnectFirestoreService, Coupon, CouponCategories, CouponCategory, CouponChannels, CouponFirestoreRepository, CouponOldCategories, CouponSubtypes, CouponTypes, Debug, DebugDecoratorHelper, DebugHelper, DebugNamespaces, DuplicatedResultsError, Edition, EditionStatus, Exclusivities, FaceSkinOilinesses, FaceSkinProblems, FaceSkinTones, FamilyIncomes, Filter, FilterHasuraGraphQLRepository, FilterOption, FilterOptionHasuraGraphQLRepository, FilterType, FirebaseFileUploaderService, FragranceImportances, FraudValidationError, GenderDestination, GlampointsPaymentMethodFactory, GlampointsPaymentService, HairColors, HairProblems, HairStrands, HairTypes, Home, HomeFirestoreRepository, InvalidArgumentError, KitProduct, KitProductHasuraGraphQL, Lead, LeadFirestoreRepository, LegacyOrderFirestoreRepository, LineItem, Log, LogDocument, LogFirestoreRepository, Logger, NotFoundError, OfficePosition, Order, OrderBlocked, OrderBlockedFirestoreRepository, OrderBlockedType, OrderFirestoreRepository, OrderStatus, PagarmeBankSlipAxiosAdapter, PagarmeCardAxiosAdapter, PagarmePaymentMethodFactory, PagarmePaymentStatus, PagarmePixAxiosAdapter, Payment, PaymentError, PaymentFirestoreRepository, PaymentMethods, PaymentProviderFactory, PaymentProviders, PaymentTransaction, PaymentType, PersonTypes, Plans, Product, ProductErrors, ProductErrorsHasuraGraphQL, ProductErrorsHasuraGraphQLRepository, ProductFirestoreRepository, ProductHasuraGraphQL, ProductHasuraGraphQLRepository, ProductLabelEnum, ProductReview, ProductReviewHasuraGraphQLRepository, ProductSpents, ProductStockNotification, ProductStockNotificationHasuraGraphQLRepository, ProductVariantFirestoreRepository, ProductsIndex, ProductsVertexSearch, QuestionsFilters, RecoveryPassword, ReflectHelper, Register, RegisterFirebaseAuthService, RequiredArgumentError, RoundProductPricesHelper, Sequence, SequenceFirestoreRepository, ShippingMethod, ShopMenu, ShopMenuFirestoreRepository, ShopPageName, ShopSettings, ShopSettingsFirestoreRepository, Shops, SignInMethods, SignOut, Status, StockLimitError, StockOutError, Subscription, SubscriptionEditionFirestoreRepository, SubscriptionFirestoreRepository, SubscriptionMaterialization, SubscriptionMaterializationFirestoreRepository, SubscriptionPayment, SubscriptionPaymentFirestoreRepository, SubscriptionPlan, SubscriptionPlanFirestoreRepository, SubscriptionProductFirestoreRepository, SubscriptionSummary, SubscriptionSummaryFirestoreRepository, Trace, UnauthorizedError, UpdateOptionActions, UpdateUserImage, User, UserAddress, UserAddressFirestoreRepository, UserAlreadyRegisteredError, UserBeautyProfileFirestoreRepository, UserFirestoreRepository, UserPaymentMethod, UserPaymentMethodFirestoreRepository, UserType, Variant, VariantHasuraGraphQL, VariantHasuraGraphQLRepository, VertexAxiosAdapter, WeakPasswordError, Where, Wishlist, WishlistHasuraGraphQLRepository, WishlistLogType, is, isDebuggable, isUUID, parseDateTime, withCreateFirestore, withCreateHasuraGraphQL, withCrudFirestore, withCrudHasuraGraphQL, withDeleteFirestore, withDeleteHasuraGraphQL, withFindFirestore, withFindHasuraGraphQL, withFirestore, withGetFirestore, withGetHasuraGraphQL, withHasuraGraphQL, withHelpers, withSubCollection, withUpdateFirestore, withUpdateHasuraGraphQL };
|
package/package.json
CHANGED
|
@@ -1,9 +1,51 @@
|
|
|
1
|
-
import { GenericIdentifier } from '../../generic/model';
|
|
2
|
-
import {
|
|
3
|
-
import { Filter } from './filter';
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { BaseModel, GenericIdentifier } from '../../generic/model';
|
|
2
|
+
import { Shops } from './enums';
|
|
3
|
+
import type { Filter } from './filter';
|
|
4
|
+
import type { Product } from './product';
|
|
5
|
+
import { CategoryCondition, CategoryImages, CategoryMetadata, CategoryMostRelevant } from './types';
|
|
6
|
+
export declare class Category extends BaseModel<Category> {
|
|
7
|
+
id: string;
|
|
8
|
+
brandCategory: boolean;
|
|
9
|
+
brandLogo?: string;
|
|
10
|
+
name: string;
|
|
11
|
+
slug: string;
|
|
12
|
+
image?: string;
|
|
13
|
+
images?: CategoryImages;
|
|
14
|
+
brandCategoryBanner?: string;
|
|
15
|
+
brandCategoryBannerMobile?: string;
|
|
16
|
+
description: string;
|
|
17
|
+
conditions?: CategoryCondition;
|
|
18
|
+
products?: string[];
|
|
19
|
+
createdAt?: Date;
|
|
20
|
+
updatedAt?: Date;
|
|
21
|
+
shop?: Shops;
|
|
22
|
+
shops?: string[];
|
|
23
|
+
published: boolean;
|
|
24
|
+
metadata: CategoryMetadata;
|
|
25
|
+
metadatas: CategoryMetadata[];
|
|
26
|
+
isCollection?: boolean;
|
|
27
|
+
isWishlist?: boolean;
|
|
28
|
+
reference?: string;
|
|
29
|
+
parentId?: number;
|
|
30
|
+
theme?: string;
|
|
31
|
+
bannerUrl?: string;
|
|
32
|
+
mostRelevant?: string[];
|
|
33
|
+
mostRelevants?: CategoryMostRelevant;
|
|
34
|
+
parent?: Category;
|
|
35
|
+
childrenProducts?: Product[];
|
|
7
36
|
filters?: Filter[];
|
|
8
37
|
static get identifiersFields(): GenericIdentifier[];
|
|
38
|
+
get glamImages(): {
|
|
39
|
+
image: string;
|
|
40
|
+
brandBanner: string;
|
|
41
|
+
brandBannerMobile: string;
|
|
42
|
+
};
|
|
43
|
+
get mensImages(): {
|
|
44
|
+
image: string;
|
|
45
|
+
brandBanner: string;
|
|
46
|
+
brandBannerMobile: string;
|
|
47
|
+
};
|
|
48
|
+
get glamMetadata(): CategoryMetadata;
|
|
49
|
+
get mensMetadata(): CategoryMetadata;
|
|
50
|
+
getMostRelevantByShop(shop: Shops): string[];
|
|
9
51
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BaseModel, GenericIdentifier } from '../../generic/model';
|
|
2
|
-
import {
|
|
2
|
+
import { Category } from './category';
|
|
3
3
|
import { FilterOption } from './filter-option';
|
|
4
4
|
export declare class Filter extends BaseModel<Filter> {
|
|
5
5
|
id: number;
|
|
@@ -10,6 +10,6 @@ export declare class Filter extends BaseModel<Filter> {
|
|
|
10
10
|
options?: FilterOption[];
|
|
11
11
|
createdAt?: Date;
|
|
12
12
|
updatedAt?: Date;
|
|
13
|
-
categories?:
|
|
13
|
+
categories?: Category[];
|
|
14
14
|
static get identifiersFields(): GenericIdentifier[];
|
|
15
15
|
}
|
|
@@ -8,7 +8,7 @@ export * from './filter-option';
|
|
|
8
8
|
export * from './kit-product';
|
|
9
9
|
export * from './product';
|
|
10
10
|
export * from './product-errors';
|
|
11
|
-
export * from './product-
|
|
11
|
+
export * from './product-review';
|
|
12
12
|
export * from './product-stock-notification';
|
|
13
13
|
export * from './types';
|
|
14
14
|
export * from './variant';
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { BaseModel } from '../../generic/model';
|
|
2
|
-
import {
|
|
2
|
+
import type { Product } from './product';
|
|
3
3
|
type KitProductIdentifiers = 'productId' | 'kitProductId';
|
|
4
|
-
export declare class KitProduct extends BaseModel<KitProduct
|
|
4
|
+
export declare class KitProduct extends BaseModel<KitProduct> {
|
|
5
|
+
id: string;
|
|
5
6
|
productId: string;
|
|
6
7
|
kitProductId: string;
|
|
7
8
|
quantity: number;
|
|
8
|
-
kit:
|
|
9
|
-
product:
|
|
9
|
+
kit: Product;
|
|
10
|
+
product: Product;
|
|
10
11
|
static get identifiersFields(): KitProductIdentifiers[];
|
|
11
12
|
}
|
|
12
13
|
export {};
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
import { BaseModel
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
1
|
+
import { BaseModel } from '../../generic/model';
|
|
2
|
+
import { Category } from './category';
|
|
3
|
+
import { KitProduct } from './kit-product';
|
|
4
|
+
import { ProductReview } from './product-review';
|
|
5
|
+
import { ProductEvaluation, ProductGender, ProductLabel, ProductMetadata, ShopDescription, ShopPrice, Stock } from './types';
|
|
6
|
+
type ProductIdentifiers = 'id';
|
|
7
|
+
export declare class ProductBase<T extends ProductBase<T, I>, I = ProductIdentifiers> extends BaseModel<T, I> {
|
|
5
8
|
id: string;
|
|
6
9
|
name: string;
|
|
7
10
|
slug: string;
|
|
8
11
|
description: ShopDescription;
|
|
9
12
|
sku: string;
|
|
10
13
|
price: ShopPrice;
|
|
11
|
-
hasVariants: boolean;
|
|
12
14
|
NCM: string;
|
|
13
15
|
EAN: string;
|
|
14
16
|
CEST: string;
|
|
@@ -25,8 +27,6 @@ export declare class ProductBase<ChildProduct extends ModelBaseStructure<ChildPr
|
|
|
25
27
|
filters?: string[];
|
|
26
28
|
type?: string;
|
|
27
29
|
categories?: string[];
|
|
28
|
-
reviews?: ProductReview[];
|
|
29
|
-
variants?: Variant[];
|
|
30
30
|
video?: string;
|
|
31
31
|
isKit?: boolean;
|
|
32
32
|
rate?: number;
|
|
@@ -37,8 +37,12 @@ export declare class ProductBase<ChildProduct extends ModelBaseStructure<ChildPr
|
|
|
37
37
|
label?: ProductLabel;
|
|
38
38
|
group?: number;
|
|
39
39
|
validity: boolean;
|
|
40
|
+
category: Category;
|
|
41
|
+
kitProducts?: KitProduct[];
|
|
42
|
+
reviews?: ProductReview[];
|
|
40
43
|
private reviewsTotal?;
|
|
41
44
|
get evaluation(): ProductEvaluation;
|
|
42
45
|
set evaluation(evaluation: ProductEvaluation);
|
|
43
|
-
static get identifiersFields():
|
|
46
|
+
static get identifiersFields(): string[];
|
|
44
47
|
}
|
|
48
|
+
export {};
|
|
@@ -2,7 +2,8 @@ import { BaseModel } from '../../generic/model';
|
|
|
2
2
|
import { Product } from './product';
|
|
3
3
|
import { Variant } from './variant';
|
|
4
4
|
type ProductErrorsIdentifiers = 'productId' | 'source' | 'error';
|
|
5
|
-
|
|
5
|
+
type ProductAndVariant = Product & Pick<Variant, 'productId'>;
|
|
6
|
+
export declare class ProductErrors<T extends ProductAndVariant = ProductAndVariant> extends BaseModel<ProductErrors<T>, ProductErrorsIdentifiers> {
|
|
6
7
|
productId: string;
|
|
7
8
|
source: string;
|
|
8
9
|
error: string;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { BaseModel, GenericIdentifier } from '../../generic/model';
|
|
2
2
|
import { Shops } from './enums';
|
|
3
|
-
export declare class
|
|
3
|
+
export declare class ProductReview extends BaseModel<ProductReview> {
|
|
4
4
|
id: number;
|
|
5
|
-
productId:
|
|
5
|
+
productId: string;
|
|
6
6
|
shop: Shops;
|
|
7
7
|
rate: number;
|
|
8
8
|
author?: string;
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import { GenericIdentifier } from '../../generic/model';
|
|
2
|
-
import { CategoryForProduct } from './category-for-product';
|
|
3
|
-
import { KitProduct } from './kit-product';
|
|
4
1
|
import { ProductBase } from './product-base';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
import { Variant } from './variant';
|
|
3
|
+
export declare class Product extends ProductBase<Product> {
|
|
4
|
+
hasVariants: boolean;
|
|
5
|
+
variants?: Variant[];
|
|
9
6
|
}
|
|
@@ -6,7 +6,6 @@ export * from './product-evaluation.type';
|
|
|
6
6
|
export * from './product-gender.type';
|
|
7
7
|
export * from './product-label.type';
|
|
8
8
|
export * from './product-metadata.type';
|
|
9
|
-
export * from './product-review.type';
|
|
10
9
|
export * from './product-variant-report.type';
|
|
11
10
|
export * from './report-stock-notification.type';
|
|
12
11
|
export * from './shop-description.type';
|
|
@@ -1,21 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { ProductBase } from './product-base';
|
|
2
|
+
import { VariantGrade } from './types';
|
|
3
3
|
export type ProductVariantIdentifiers = 'id' | 'productId';
|
|
4
|
-
export declare class Variant extends
|
|
5
|
-
id: string;
|
|
4
|
+
export declare class Variant extends ProductBase<Variant, ProductVariantIdentifiers> {
|
|
6
5
|
productId: string;
|
|
7
|
-
sku: string;
|
|
8
|
-
price: ShopPrice;
|
|
9
|
-
EAN: string;
|
|
10
|
-
stock: Stock;
|
|
11
6
|
grade?: VariantGrade[];
|
|
12
|
-
costPrice: number;
|
|
13
|
-
weight: number;
|
|
14
|
-
createdAt?: Date;
|
|
15
|
-
updatedAt?: Date;
|
|
16
|
-
group?: number;
|
|
17
|
-
validity: boolean;
|
|
18
|
-
tags: string[];
|
|
19
|
-
published: boolean;
|
|
20
7
|
static get identifiersFields(): ProductVariantIdentifiers[];
|
|
21
8
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CrudRepository } from '../../generic/repository/crud.repository';
|
|
2
|
-
import {
|
|
3
|
-
export interface
|
|
4
|
-
aproveReview(id: number): Promise<
|
|
5
|
-
disaproveReview(id: number): Promise<
|
|
6
|
-
updateManyStatus(reviews: Pick<
|
|
2
|
+
import { ProductReview } from '../models';
|
|
3
|
+
export interface ProductReviewRepository extends CrudRepository<ProductReview> {
|
|
4
|
+
aproveReview(id: number): Promise<ProductReview>;
|
|
5
|
+
disaproveReview(id: number): Promise<ProductReview>;
|
|
6
|
+
updateManyStatus(reviews: Pick<ProductReview, 'id' | 'status'>[]): Promise<void>;
|
|
7
7
|
}
|
|
@@ -2,7 +2,7 @@ import { FindRepositoryParams, RepositoryFindResult } from '../../generic';
|
|
|
2
2
|
import { CrudRepository } from '../../generic/repository/crud.repository';
|
|
3
3
|
import { Product, ProductGender, ProductReview, ProductVariantReport } from '../models';
|
|
4
4
|
export type ReviewStatusParams = 'pending' | 'approved' | 'rejected';
|
|
5
|
-
export type ReviewWithProductData = ProductReview & {
|
|
5
|
+
export type ReviewWithProductData = Omit<ProductReview, 'identifier' | 'identifiersFields' | 'toPlain'> & {
|
|
6
6
|
productId: string;
|
|
7
7
|
productName: string;
|
|
8
8
|
productSku: string;
|
|
@@ -8,15 +8,14 @@ export declare class ProductsIndex {
|
|
|
8
8
|
getById(id: string): Promise<Product>;
|
|
9
9
|
search(searchTerm: string, total: number, shop?: string): Promise<{
|
|
10
10
|
stock: number;
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
hasVariants: boolean;
|
|
12
|
+
variants?: import("../../../domain").Variant[];
|
|
13
13
|
id: string;
|
|
14
14
|
name: string;
|
|
15
15
|
slug: string;
|
|
16
16
|
description: import("../../../domain").ShopDescription;
|
|
17
17
|
sku: string;
|
|
18
18
|
price: import("../../../domain").ShopPrice;
|
|
19
|
-
hasVariants: boolean;
|
|
20
19
|
NCM: string;
|
|
21
20
|
EAN: string;
|
|
22
21
|
CEST: string;
|
|
@@ -32,8 +31,6 @@ export declare class ProductsIndex {
|
|
|
32
31
|
filters?: string[];
|
|
33
32
|
type?: string;
|
|
34
33
|
categories?: string[];
|
|
35
|
-
reviews?: import("../../../domain").ProductReview[];
|
|
36
|
-
variants?: import("../../../domain").Variant[];
|
|
37
34
|
video?: string;
|
|
38
35
|
isKit?: boolean;
|
|
39
36
|
rate?: number;
|
|
@@ -44,6 +41,9 @@ export declare class ProductsIndex {
|
|
|
44
41
|
label?: "outlet" | "on-sale" | "last-units" | "glamstar";
|
|
45
42
|
group?: number;
|
|
46
43
|
validity: boolean;
|
|
44
|
+
category: import("../../../domain").Category;
|
|
45
|
+
kitProducts?: import("../../../domain").KitProduct[];
|
|
46
|
+
reviews?: import("../../../domain").ProductReview[];
|
|
47
47
|
}[]>;
|
|
48
48
|
save(product: ProductHasuraGraphQL): Promise<void>;
|
|
49
49
|
update(product: ProductHasuraGraphQL): Promise<void>;
|
|
@@ -1,6 +1,3 @@
|
|
|
1
1
|
import { ProductErrors } from '../../../domain';
|
|
2
|
-
|
|
3
|
-
import { VariantHasuraGraphQL } from './variant-hasura-graphql';
|
|
4
|
-
export declare class ProductErrorsHasuraGraphQL extends ProductErrors<ProductHasuraGraphQL | VariantHasuraGraphQL> {
|
|
5
|
-
product: ProductHasuraGraphQL | VariantHasuraGraphQL;
|
|
2
|
+
export declare class ProductErrorsHasuraGraphQL extends ProductErrors {
|
|
6
3
|
}
|
package/src/infra/hasura-graphql/repositories/catalog/product-review-hasura-graphql.repository.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { ProductReview } from '../../../../domain';
|
|
2
|
+
import { ProductReviewRepository } from '../../../../domain/catalog/repositories';
|
|
3
3
|
import { HasuraConstructorParams } from '../../mixins';
|
|
4
|
-
declare const
|
|
5
|
-
paramsToPlain(params: import("../../../../domain").RepositoryUpdateParams<
|
|
6
|
-
}, [HasuraConstructorParams<
|
|
7
|
-
export declare class
|
|
8
|
-
constructor({ endpoint, authOptions, interceptors, }: Pick<HasuraConstructorParams<
|
|
9
|
-
updateManyStatus(reviews: Pick<
|
|
10
|
-
aproveReview(id: number): Promise<
|
|
11
|
-
disaproveReview(id: number): Promise<
|
|
4
|
+
declare const ProductReviewHasuraGraphQLRepository_base: import("../../../../utils").MixinCtor<import("../..").GraphQLRepository<ProductReview> & import("../../../../domain").CrudRepository<ProductReview, import("../../../../domain").CrudParams<ProductReview>> & import("../../../../domain").UpdateRepository<ProductReview, import("../../../../domain").RepositoryUpdateParams<ProductReview>> & {
|
|
5
|
+
paramsToPlain(params: import("../../../../domain").RepositoryUpdateParams<ProductReview>): Partial<ProductReview>;
|
|
6
|
+
}, [HasuraConstructorParams<ProductReview> & import("../../mixins").CreateConstructorParams & import("../../mixins").DeleteConstructorParams & import("../../mixins").GetConstructorParams & import("../../mixins").UpdateConstructorParams, ...any[]]>;
|
|
7
|
+
export declare class ProductReviewHasuraGraphQLRepository extends ProductReviewHasuraGraphQLRepository_base implements ProductReviewRepository {
|
|
8
|
+
constructor({ endpoint, authOptions, interceptors, }: Pick<HasuraConstructorParams<ProductReview>, 'endpoint' | 'authOptions' | 'interceptors'>);
|
|
9
|
+
updateManyStatus(reviews: Pick<ProductReview, 'id' | 'status'>[]): Promise<void>;
|
|
10
|
+
aproveReview(id: number): Promise<ProductReview>;
|
|
11
|
+
disaproveReview(id: number): Promise<ProductReview>;
|
|
12
12
|
}
|
|
13
13
|
export {};
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { BaseModel, GenericIdentifier, ModelBaseStructure } from '../../generic/model';
|
|
2
|
-
import { Shops } from './enums';
|
|
3
|
-
import { CategoryCondition, CategoryImages, CategoryMetadata, CategoryMostRelevant } from './types';
|
|
4
|
-
export declare class CategoryBase<ChildCategory extends ModelBaseStructure<ChildCategory, Identifiers> = ModelBaseStructure<any, any>, Identifiers = ChildCategory['identifiersFields']> extends BaseModel<ChildCategory, Identifiers> {
|
|
5
|
-
id: string;
|
|
6
|
-
brandCategory: boolean;
|
|
7
|
-
brandLogo?: string;
|
|
8
|
-
name: string;
|
|
9
|
-
slug: string;
|
|
10
|
-
image?: string;
|
|
11
|
-
images?: CategoryImages;
|
|
12
|
-
brandCategoryBanner?: string;
|
|
13
|
-
brandCategoryBannerMobile?: string;
|
|
14
|
-
description: string;
|
|
15
|
-
conditions?: CategoryCondition;
|
|
16
|
-
products?: string[];
|
|
17
|
-
createdAt?: Date;
|
|
18
|
-
updatedAt?: Date;
|
|
19
|
-
shop?: Shops;
|
|
20
|
-
shops?: string[];
|
|
21
|
-
published: boolean;
|
|
22
|
-
metadata: CategoryMetadata;
|
|
23
|
-
metadatas: CategoryMetadata[];
|
|
24
|
-
isCollection?: boolean;
|
|
25
|
-
isWishlist?: boolean;
|
|
26
|
-
reference?: string;
|
|
27
|
-
parentId?: number;
|
|
28
|
-
theme?: string;
|
|
29
|
-
bannerUrl?: string;
|
|
30
|
-
mostRelevant?: string[];
|
|
31
|
-
mostRelevants?: CategoryMostRelevant;
|
|
32
|
-
parent?: CategoryBase;
|
|
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[];
|
|
47
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { GenericIdentifier } from '../../generic/model';
|
|
2
|
-
import { KitProduct } from './kit-product';
|
|
3
|
-
import { ProductBase } from './product-base';
|
|
4
|
-
export declare class ProductForCategory extends ProductBase<ProductForCategory, GenericIdentifier> {
|
|
5
|
-
kitProducts?: KitProduct[];
|
|
6
|
-
static get identifiersFields(): GenericIdentifier[];
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { GenericIdentifier } from '../../generic/model';
|
|
2
|
-
import { CategoryForProduct } from './category-for-product';
|
|
3
|
-
import { ProductBase } from './product-base';
|
|
4
|
-
export declare class ProductForKit extends ProductBase<ProductForKit, GenericIdentifier> {
|
|
5
|
-
category: CategoryForProduct;
|
|
6
|
-
static get identifiersFields(): GenericIdentifier[];
|
|
7
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { Shops } from '../enums/shops.enum';
|
|
2
|
-
export type ProductReview = {
|
|
3
|
-
id?: string;
|
|
4
|
-
shop: Shops;
|
|
5
|
-
rate: number;
|
|
6
|
-
author?: string;
|
|
7
|
-
email?: string;
|
|
8
|
-
location?: string;
|
|
9
|
-
review?: string;
|
|
10
|
-
status?: boolean;
|
|
11
|
-
title?: string;
|
|
12
|
-
personId?: number;
|
|
13
|
-
points?: number;
|
|
14
|
-
orderId?: string;
|
|
15
|
-
createdAt?: Date;
|
|
16
|
-
updatedAt?: Date;
|
|
17
|
-
};
|