@infrab4a/connect 3.7.1-beta.1 → 3.8.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.
Files changed (29) hide show
  1. package/bundles/infrab4a-connect.umd.js +128 -73
  2. package/bundles/infrab4a-connect.umd.js.map +1 -1
  3. package/domain/catalog/repositories/category.repository.d.ts +3 -3
  4. package/domain/shopping/models/campaign-dashboard.d.ts +15 -0
  5. package/domain/shopping/models/campaign-hashtag.d.ts +18 -0
  6. package/domain/shopping/models/index.d.ts +5 -4
  7. package/domain/shopping/repositories/campaign-dashboard.repository.d.ts +4 -0
  8. package/domain/shopping/repositories/campaign-hashtag.repository.d.ts +4 -0
  9. package/domain/shopping/repositories/index.d.ts +4 -2
  10. package/esm2015/domain/catalog/repositories/category.repository.js +1 -1
  11. package/esm2015/domain/shopping/models/campaign-dashboard.js +7 -0
  12. package/esm2015/domain/shopping/models/campaign-hashtag.js +7 -0
  13. package/esm2015/domain/shopping/models/index.js +6 -5
  14. package/esm2015/domain/shopping/repositories/campaign-dashboard.repository.js +2 -0
  15. package/esm2015/domain/shopping/repositories/campaign-hashtag.repository.js +2 -0
  16. package/esm2015/domain/shopping/repositories/index.js +5 -3
  17. package/esm2015/infra/firebase/firestore/repositories/catalog/category-firestore.repository.js +3 -5
  18. package/esm2015/infra/firebase/firestore/repositories/shopping/campaign-dashboard-firestore.repository.js +12 -0
  19. package/esm2015/infra/firebase/firestore/repositories/shopping/campaign-hashtag-firestore.repository.js +12 -0
  20. package/esm2015/infra/firebase/firestore/repositories/shopping/index.js +6 -4
  21. package/esm2015/infra/hasura-graphql/repositories/catalog/category-hasura-graphql.repository.js +4 -5
  22. package/fesm2015/infrab4a-connect.js +81 -54
  23. package/fesm2015/infrab4a-connect.js.map +1 -1
  24. package/infra/firebase/firestore/repositories/catalog/category-firestore.repository.d.ts +1 -2
  25. package/infra/firebase/firestore/repositories/shopping/campaign-dashboard-firestore.repository.d.ts +9 -0
  26. package/infra/firebase/firestore/repositories/shopping/campaign-hashtag-firestore.repository.d.ts +9 -0
  27. package/infra/firebase/firestore/repositories/shopping/index.d.ts +5 -3
  28. package/infra/hasura-graphql/repositories/catalog/category-hasura-graphql.repository.d.ts +1 -2
  29. package/package.json +1 -1
@@ -1405,17 +1405,54 @@
1405
1405
  return Variant;
1406
1406
  }(BaseModel));
1407
1407
 
1408
- exports.OrderStatus = void 0;
1409
- (function (OrderStatus) {
1410
- OrderStatus["AGUARDANDO_PAGAMENTO"] = "Aguardando pagamento";
1411
- OrderStatus["EM_PREPARO"] = "Preparando pedido";
1412
- OrderStatus["NF_EMITIDA"] = "Nota Fiscal Emitida";
1413
- OrderStatus["AGUARDANDO_ENVIO"] = "Aguardando Transaportadora";
1414
- OrderStatus["ENVIADO"] = "Enviado";
1415
- OrderStatus["ENTREGUE"] = "Entregue";
1416
- OrderStatus["CANCELADO"] = "Cancelado";
1417
- OrderStatus["CREDIT_CARD"] = "credit_card";
1418
- })(exports.OrderStatus || (exports.OrderStatus = {}));
1408
+ var Buy2Win = /** @class */ (function (_super) {
1409
+ __extends(Buy2Win, _super);
1410
+ function Buy2Win() {
1411
+ return _super !== null && _super.apply(this, arguments) || this;
1412
+ }
1413
+ Object.defineProperty(Buy2Win, "identifiersFields", {
1414
+ get: function () {
1415
+ return ['id'];
1416
+ },
1417
+ enumerable: false,
1418
+ configurable: true
1419
+ });
1420
+ return Buy2Win;
1421
+ }(BaseModel));
1422
+ __decorate([
1423
+ classTransformer.Type(function () { return Category; }),
1424
+ __metadata("design:type", Array)
1425
+ ], Buy2Win.prototype, "categories", void 0);
1426
+
1427
+ var CampaignDashboard = /** @class */ (function (_super) {
1428
+ __extends(CampaignDashboard, _super);
1429
+ function CampaignDashboard() {
1430
+ return _super !== null && _super.apply(this, arguments) || this;
1431
+ }
1432
+ Object.defineProperty(CampaignDashboard, "identifiersFields", {
1433
+ get: function () {
1434
+ return ['id'];
1435
+ },
1436
+ enumerable: false,
1437
+ configurable: true
1438
+ });
1439
+ return CampaignDashboard;
1440
+ }(BaseModel));
1441
+
1442
+ var CampaignHashtag = /** @class */ (function (_super) {
1443
+ __extends(CampaignHashtag, _super);
1444
+ function CampaignHashtag() {
1445
+ return _super !== null && _super.apply(this, arguments) || this;
1446
+ }
1447
+ Object.defineProperty(CampaignHashtag, "identifiersFields", {
1448
+ get: function () {
1449
+ return ['id'];
1450
+ },
1451
+ enumerable: false,
1452
+ configurable: true
1453
+ });
1454
+ return CampaignHashtag;
1455
+ }(BaseModel));
1419
1456
 
1420
1457
  var LineItem = /** @class */ (function (_super) {
1421
1458
  __extends(LineItem, _super);
@@ -1479,6 +1516,18 @@
1479
1516
  __metadata("design:type", Coupon)
1480
1517
  ], Checkout.prototype, "coupon", void 0);
1481
1518
 
1519
+ exports.OrderStatus = void 0;
1520
+ (function (OrderStatus) {
1521
+ OrderStatus["AGUARDANDO_PAGAMENTO"] = "Aguardando pagamento";
1522
+ OrderStatus["EM_PREPARO"] = "Preparando pedido";
1523
+ OrderStatus["NF_EMITIDA"] = "Nota Fiscal Emitida";
1524
+ OrderStatus["AGUARDANDO_ENVIO"] = "Aguardando Transaportadora";
1525
+ OrderStatus["ENVIADO"] = "Enviado";
1526
+ OrderStatus["ENTREGUE"] = "Entregue";
1527
+ OrderStatus["CANCELADO"] = "Cancelado";
1528
+ OrderStatus["CREDIT_CARD"] = "credit_card";
1529
+ })(exports.OrderStatus || (exports.OrderStatus = {}));
1530
+
1482
1531
  var Order = /** @class */ (function (_super) {
1483
1532
  __extends(Order, _super);
1484
1533
  function Order() {
@@ -1522,25 +1571,6 @@
1522
1571
  __metadata("design:type", Coupon)
1523
1572
  ], CheckoutSubscription.prototype, "coupon", void 0);
1524
1573
 
1525
- var Buy2Win = /** @class */ (function (_super) {
1526
- __extends(Buy2Win, _super);
1527
- function Buy2Win() {
1528
- return _super !== null && _super.apply(this, arguments) || this;
1529
- }
1530
- Object.defineProperty(Buy2Win, "identifiersFields", {
1531
- get: function () {
1532
- return ['id'];
1533
- },
1534
- enumerable: false,
1535
- configurable: true
1536
- });
1537
- return Buy2Win;
1538
- }(BaseModel));
1539
- __decorate([
1540
- classTransformer.Type(function () { return Category; }),
1541
- __metadata("design:type", Array)
1542
- ], Buy2Win.prototype, "categories", void 0);
1543
-
1544
1574
  exports.FilterType = void 0;
1545
1575
  (function (FilterType) {
1546
1576
  FilterType["ACCESSORY_IMPORTANCE"] = "accessoryImportance";
@@ -2568,7 +2598,7 @@
2568
2598
  })
2569
2599
  .catch(function (error) { return error; });
2570
2600
  };
2571
- CategoryFirestoreRepository.prototype.getCategoriesForHome = function (categoryIds, limit, gender) {
2601
+ CategoryFirestoreRepository.prototype.getCategoriesForHome = function (categoryIds, limit) {
2572
2602
  if (limit === void 0) { limit = 4; }
2573
2603
  return __awaiter(this, void 0, void 0, function () {
2574
2604
  var categorySnap, categories, homeSections;
@@ -2592,7 +2622,7 @@
2592
2622
  _a = {
2593
2623
  category: category
2594
2624
  };
2595
- return [4 /*yield*/, this.mountCategory(category, { limit: limit, hasStock: true, gender: gender })];
2625
+ return [4 /*yield*/, this.mountCategory(category, { limit: limit, hasStock: true })];
2596
2626
  case 1: return [2 /*return*/, (_a.products = _b.sent(),
2597
2627
  _a)];
2598
2628
  }
@@ -2633,8 +2663,6 @@
2633
2663
  query = _b.sent();
2634
2664
  if (options === null || options === void 0 ? void 0 : options.hasStock)
2635
2665
  query = query.where('stock.quantity', '>', 0);
2636
- if (options === null || options === void 0 ? void 0 : options.gender)
2637
- query = query.where('tags', 'array-contains', options === null || options === void 0 ? void 0 : options.gender);
2638
2666
  if (options === null || options === void 0 ? void 0 : options.limit)
2639
2667
  query = query.limit(options === null || options === void 0 ? void 0 : options.limit);
2640
2668
  return [4 /*yield*/, query.get()];
@@ -2761,6 +2789,42 @@
2761
2789
  return SubscriptionProductFirestoreRepository;
2762
2790
  }(withCrudFirestore(withHelpers(withFirestore(Base)))));
2763
2791
 
2792
+ var Buy2WinFirestoreRepository = /** @class */ (function (_super) {
2793
+ __extends(Buy2WinFirestoreRepository, _super);
2794
+ function Buy2WinFirestoreRepository(firestore) {
2795
+ var _this = _super.call(this) || this;
2796
+ _this.firestore = firestore;
2797
+ _this.collectionName = 'buy2win';
2798
+ _this.model = Buy2Win;
2799
+ return _this;
2800
+ }
2801
+ return Buy2WinFirestoreRepository;
2802
+ }(withCrudFirestore(withHelpers(withFirestore(Base)))));
2803
+
2804
+ var CampaignDashboardFirestoreRepository = /** @class */ (function (_super) {
2805
+ __extends(CampaignDashboardFirestoreRepository, _super);
2806
+ function CampaignDashboardFirestoreRepository(firestore) {
2807
+ var _this = _super.call(this) || this;
2808
+ _this.firestore = firestore;
2809
+ _this.collectionName = 'dashboardCampaignsAuto';
2810
+ _this.model = CampaignDashboard;
2811
+ return _this;
2812
+ }
2813
+ return CampaignDashboardFirestoreRepository;
2814
+ }(withCrudFirestore(withHelpers(withFirestore(Base)))));
2815
+
2816
+ var CampaignHashtagFirestoreRepository = /** @class */ (function (_super) {
2817
+ __extends(CampaignHashtagFirestoreRepository, _super);
2818
+ function CampaignHashtagFirestoreRepository(firestore) {
2819
+ var _this = _super.call(this) || this;
2820
+ _this.firestore = firestore;
2821
+ _this.collectionName = 'hashtagCampaignsAuto';
2822
+ _this.model = CampaignHashtag;
2823
+ return _this;
2824
+ }
2825
+ return CampaignHashtagFirestoreRepository;
2826
+ }(withCrudFirestore(withHelpers(withFirestore(Base)))));
2827
+
2764
2828
  var CheckoutFirestoreRepository = /** @class */ (function (_super) {
2765
2829
  __extends(CheckoutFirestoreRepository, _super);
2766
2830
  function CheckoutFirestoreRepository(firestore) {
@@ -2773,6 +2837,18 @@
2773
2837
  return CheckoutFirestoreRepository;
2774
2838
  }(withCrudFirestore(withHelpers(withFirestore(Base)))));
2775
2839
 
2840
+ var CheckoutSubscriptionFirestoreRepository = /** @class */ (function (_super) {
2841
+ __extends(CheckoutSubscriptionFirestoreRepository, _super);
2842
+ function CheckoutSubscriptionFirestoreRepository(firestore) {
2843
+ var _this = _super.call(this) || this;
2844
+ _this.firestore = firestore;
2845
+ _this.collectionName = 'checkoutsSubscription';
2846
+ _this.model = CheckoutSubscription;
2847
+ return _this;
2848
+ }
2849
+ return CheckoutSubscriptionFirestoreRepository;
2850
+ }(withCrudFirestore(withHelpers(withFirestore(Base)))));
2851
+
2776
2852
  var CouponFirestoreRepository = /** @class */ (function (_super) {
2777
2853
  __extends(CouponFirestoreRepository, _super);
2778
2854
  function CouponFirestoreRepository(firestore) {
@@ -2842,6 +2918,17 @@
2842
2918
  return OrderFirestoreRepository;
2843
2919
  }(withCrudFirestore(withHelpers(withFirestore(Base)))));
2844
2920
 
2921
+ var LegacyOrderFirestoreRepository = /** @class */ (function (_super) {
2922
+ __extends(LegacyOrderFirestoreRepository, _super);
2923
+ function LegacyOrderFirestoreRepository(firestore) {
2924
+ var _this = _super.call(this, firestore) || this;
2925
+ _this.firestore = firestore;
2926
+ _this.collectionName = 'legacyOrders';
2927
+ return _this;
2928
+ }
2929
+ return LegacyOrderFirestoreRepository;
2930
+ }(OrderFirestoreRepository));
2931
+
2845
2932
  var PaymentFirestoreRepository = /** @class */ (function (_super) {
2846
2933
  __extends(PaymentFirestoreRepository, _super);
2847
2934
  function PaymentFirestoreRepository(firestore) {
@@ -2854,18 +2941,6 @@
2854
2941
  return PaymentFirestoreRepository;
2855
2942
  }(withCrudFirestore(withHelpers(withFirestore(Base)))));
2856
2943
 
2857
- var CheckoutSubscriptionFirestoreRepository = /** @class */ (function (_super) {
2858
- __extends(CheckoutSubscriptionFirestoreRepository, _super);
2859
- function CheckoutSubscriptionFirestoreRepository(firestore) {
2860
- var _this = _super.call(this) || this;
2861
- _this.firestore = firestore;
2862
- _this.collectionName = 'checkoutsSubscription';
2863
- _this.model = CheckoutSubscription;
2864
- return _this;
2865
- }
2866
- return CheckoutSubscriptionFirestoreRepository;
2867
- }(withCrudFirestore(withHelpers(withFirestore(Base)))));
2868
-
2869
2944
  var SubscriptionPlanFirestoreRepository = /** @class */ (function (_super) {
2870
2945
  __extends(SubscriptionPlanFirestoreRepository, _super);
2871
2946
  function SubscriptionPlanFirestoreRepository(firestore) {
@@ -2878,29 +2953,6 @@
2878
2953
  return SubscriptionPlanFirestoreRepository;
2879
2954
  }(withCrudFirestore(withHelpers(withFirestore(Base)))));
2880
2955
 
2881
- var Buy2WinFirestoreRepository = /** @class */ (function (_super) {
2882
- __extends(Buy2WinFirestoreRepository, _super);
2883
- function Buy2WinFirestoreRepository(firestore) {
2884
- var _this = _super.call(this) || this;
2885
- _this.firestore = firestore;
2886
- _this.collectionName = 'buy2win';
2887
- _this.model = Buy2Win;
2888
- return _this;
2889
- }
2890
- return Buy2WinFirestoreRepository;
2891
- }(withCrudFirestore(withHelpers(withFirestore(Base)))));
2892
-
2893
- var LegacyOrderFirestoreRepository = /** @class */ (function (_super) {
2894
- __extends(LegacyOrderFirestoreRepository, _super);
2895
- function LegacyOrderFirestoreRepository(firestore) {
2896
- var _this = _super.call(this, firestore) || this;
2897
- _this.firestore = firestore;
2898
- _this.collectionName = 'legacyOrders';
2899
- return _this;
2900
- }
2901
- return LegacyOrderFirestoreRepository;
2902
- }(OrderFirestoreRepository));
2903
-
2904
2956
  var HomeFirestoreRepository = /** @class */ (function (_super) {
2905
2957
  __extends(HomeFirestoreRepository, _super);
2906
2958
  function HomeFirestoreRepository(firestore) {
@@ -3997,7 +4049,7 @@
3997
4049
  });
3998
4050
  });
3999
4051
  };
4000
- CategoryHasuraGraphQLRepository.prototype.getCategoriesForHome = function (categoryIds, limit, gender) {
4052
+ CategoryHasuraGraphQLRepository.prototype.getCategoriesForHome = function (categoryIds, limit) {
4001
4053
  if (limit === void 0) { limit = 4; }
4002
4054
  return __awaiter(this, void 0, void 0, function () {
4003
4055
  var categoriesFirestore, categoriesHasura, categories, _c, _d, _e, _f, _g, _h, _j, _k, homeSections;
@@ -4048,7 +4100,7 @@
4048
4100
  _c = {
4049
4101
  category: category
4050
4102
  };
4051
- return [4 /*yield*/, this.mountCategory(category, { limit: limit, hasStock: true, gender: gender })];
4103
+ return [4 /*yield*/, this.mountCategory(category, { limit: limit, hasStock: true })];
4052
4104
  case 1: return [2 /*return*/, (_c.products = _d.sent(),
4053
4105
  _c)];
4054
4106
  }
@@ -4071,7 +4123,7 @@
4071
4123
  if (!((_a = category === null || category === void 0 ? void 0 : category.products) === null || _a === void 0 ? void 0 : _a.length))
4072
4124
  return [2 /*return*/, []];
4073
4125
  products = [];
4074
- return [4 /*yield*/, this.productRepository.find(Object.assign(Object.assign({ filters: Object.assign(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 } } } : {})), ((options === null || options === void 0 ? void 0 : options.gender) ? { tags: { operator: exports.Where.IN, value: [options === null || options === void 0 ? void 0 : options.gender] } } : {})), fields: [
4126
+ return [4 /*yield*/, this.productRepository.find(Object.assign(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: [
4075
4127
  'id',
4076
4128
  'name',
4077
4129
  'slug',
@@ -4095,7 +4147,6 @@
4095
4147
  'tags',
4096
4148
  'type',
4097
4149
  'shoppingCount',
4098
- 'gender',
4099
4150
  ] }, ((options === null || options === void 0 ? void 0 : options.limit) ? { limits: { limit: options === null || options === void 0 ? void 0 : options.limit } } : {})), { options: { enableCount: false } }))];
4100
4151
  case 1:
4101
4152
  productsData = (_c.sent()).data;
@@ -5477,6 +5528,10 @@
5477
5528
  exports.BeautyQuestionsHelper = BeautyQuestionsHelper;
5478
5529
  exports.Buy2Win = Buy2Win;
5479
5530
  exports.Buy2WinFirestoreRepository = Buy2WinFirestoreRepository;
5531
+ exports.CampaignDashboard = CampaignDashboard;
5532
+ exports.CampaignDashboardFirestoreRepository = CampaignDashboardFirestoreRepository;
5533
+ exports.CampaignHashtag = CampaignHashtag;
5534
+ exports.CampaignHashtagFirestoreRepository = CampaignHashtagFirestoreRepository;
5480
5535
  exports.Category = Category;
5481
5536
  exports.CategoryFilter = CategoryFilter;
5482
5537
  exports.CategoryFilterHasuraGraphQLRepository = CategoryFilterHasuraGraphQLRepository;