@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
@@ -841,17 +841,27 @@ class Variant extends BaseModel {
841
841
  }
842
842
  }
843
843
 
844
- var OrderStatus;
845
- (function (OrderStatus) {
846
- OrderStatus["AGUARDANDO_PAGAMENTO"] = "Aguardando pagamento";
847
- OrderStatus["EM_PREPARO"] = "Preparando pedido";
848
- OrderStatus["NF_EMITIDA"] = "Nota Fiscal Emitida";
849
- OrderStatus["AGUARDANDO_ENVIO"] = "Aguardando Transaportadora";
850
- OrderStatus["ENVIADO"] = "Enviado";
851
- OrderStatus["ENTREGUE"] = "Entregue";
852
- OrderStatus["CANCELADO"] = "Cancelado";
853
- OrderStatus["CREDIT_CARD"] = "credit_card";
854
- })(OrderStatus || (OrderStatus = {}));
844
+ class Buy2Win extends BaseModel {
845
+ static get identifiersFields() {
846
+ return ['id'];
847
+ }
848
+ }
849
+ __decorate([
850
+ Type(() => Category),
851
+ __metadata("design:type", Array)
852
+ ], Buy2Win.prototype, "categories", void 0);
853
+
854
+ class CampaignDashboard extends BaseModel {
855
+ static get identifiersFields() {
856
+ return ['id'];
857
+ }
858
+ }
859
+
860
+ class CampaignHashtag extends BaseModel {
861
+ static get identifiersFields() {
862
+ return ['id'];
863
+ }
864
+ }
855
865
 
856
866
  class LineItem extends Product {
857
867
  }
@@ -892,6 +902,18 @@ __decorate([
892
902
  __metadata("design:type", Coupon)
893
903
  ], Checkout.prototype, "coupon", void 0);
894
904
 
905
+ var OrderStatus;
906
+ (function (OrderStatus) {
907
+ OrderStatus["AGUARDANDO_PAGAMENTO"] = "Aguardando pagamento";
908
+ OrderStatus["EM_PREPARO"] = "Preparando pedido";
909
+ OrderStatus["NF_EMITIDA"] = "Nota Fiscal Emitida";
910
+ OrderStatus["AGUARDANDO_ENVIO"] = "Aguardando Transaportadora";
911
+ OrderStatus["ENVIADO"] = "Enviado";
912
+ OrderStatus["ENTREGUE"] = "Entregue";
913
+ OrderStatus["CANCELADO"] = "Cancelado";
914
+ OrderStatus["CREDIT_CARD"] = "credit_card";
915
+ })(OrderStatus || (OrderStatus = {}));
916
+
895
917
  class Order extends Checkout {
896
918
  }
897
919
  __decorate([
@@ -921,16 +943,6 @@ __decorate([
921
943
  __metadata("design:type", Coupon)
922
944
  ], CheckoutSubscription.prototype, "coupon", void 0);
923
945
 
924
- class Buy2Win extends BaseModel {
925
- static get identifiersFields() {
926
- return ['id'];
927
- }
928
- }
929
- __decorate([
930
- Type(() => Category),
931
- __metadata("design:type", Array)
932
- ], Buy2Win.prototype, "categories", void 0);
933
-
934
946
  var FilterType;
935
947
  (function (FilterType) {
936
948
  FilterType["ACCESSORY_IMPORTANCE"] = "accessoryImportance";
@@ -1662,7 +1674,7 @@ class CategoryFirestoreRepository extends withCrudFirestore(withHelpers(withFire
1662
1674
  })
1663
1675
  .catch((error) => error);
1664
1676
  }
1665
- getCategoriesForHome(categoryIds, limit = 4, gender) {
1677
+ getCategoriesForHome(categoryIds, limit = 4) {
1666
1678
  return __awaiter(this, void 0, void 0, function* () {
1667
1679
  const categorySnap = yield this.collection(this.collectionName)
1668
1680
  .where('id', 'in', categoryIds.filter(Boolean))
@@ -1674,7 +1686,7 @@ class CategoryFirestoreRepository extends withCrudFirestore(withHelpers(withFire
1674
1686
  const homeSections = yield Promise.all(categories.map((category) => __awaiter(this, void 0, void 0, function* () {
1675
1687
  return ({
1676
1688
  category,
1677
- products: yield this.mountCategory(category, { limit, hasStock: true, gender }),
1689
+ products: yield this.mountCategory(category, { limit, hasStock: true }),
1678
1690
  });
1679
1691
  })));
1680
1692
  return homeSections;
@@ -1694,8 +1706,6 @@ class CategoryFirestoreRepository extends withCrudFirestore(withHelpers(withFire
1694
1706
  .where('id', 'in', productIds);
1695
1707
  if (options === null || options === void 0 ? void 0 : options.hasStock)
1696
1708
  query = query.where('stock.quantity', '>', 0);
1697
- if (options === null || options === void 0 ? void 0 : options.gender)
1698
- query = query.where('tags', 'array-contains', options === null || options === void 0 ? void 0 : options.gender);
1699
1709
  if (options === null || options === void 0 ? void 0 : options.limit)
1700
1710
  query = query.limit(options === null || options === void 0 ? void 0 : options.limit);
1701
1711
  const productSnap = yield query.get();
@@ -1779,6 +1789,33 @@ class SubscriptionProductFirestoreRepository extends withCrudFirestore(withHelpe
1779
1789
  }
1780
1790
  }
1781
1791
 
1792
+ class Buy2WinFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
1793
+ constructor(firestore) {
1794
+ super();
1795
+ this.firestore = firestore;
1796
+ this.collectionName = 'buy2win';
1797
+ this.model = Buy2Win;
1798
+ }
1799
+ }
1800
+
1801
+ class CampaignDashboardFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
1802
+ constructor(firestore) {
1803
+ super();
1804
+ this.firestore = firestore;
1805
+ this.collectionName = 'dashboardCampaignsAuto';
1806
+ this.model = CampaignDashboard;
1807
+ }
1808
+ }
1809
+
1810
+ class CampaignHashtagFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
1811
+ constructor(firestore) {
1812
+ super();
1813
+ this.firestore = firestore;
1814
+ this.collectionName = 'hashtagCampaignsAuto';
1815
+ this.model = CampaignHashtag;
1816
+ }
1817
+ }
1818
+
1782
1819
  class CheckoutFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
1783
1820
  constructor(firestore) {
1784
1821
  super();
@@ -1788,6 +1825,15 @@ class CheckoutFirestoreRepository extends withCrudFirestore(withHelpers(withFire
1788
1825
  }
1789
1826
  }
1790
1827
 
1828
+ class CheckoutSubscriptionFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
1829
+ constructor(firestore) {
1830
+ super();
1831
+ this.firestore = firestore;
1832
+ this.collectionName = 'checkoutsSubscription';
1833
+ this.model = CheckoutSubscription;
1834
+ }
1835
+ }
1836
+
1791
1837
  class CouponFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
1792
1838
  constructor(firestore) {
1793
1839
  super();
@@ -1850,21 +1896,20 @@ class OrderFirestoreRepository extends withCrudFirestore(withHelpers(withFiresto
1850
1896
  }
1851
1897
  }
1852
1898
 
1853
- class PaymentFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
1899
+ class LegacyOrderFirestoreRepository extends OrderFirestoreRepository {
1854
1900
  constructor(firestore) {
1855
- super();
1901
+ super(firestore);
1856
1902
  this.firestore = firestore;
1857
- this.collectionName = 'payments';
1858
- this.model = Payment;
1903
+ this.collectionName = 'legacyOrders';
1859
1904
  }
1860
1905
  }
1861
1906
 
1862
- class CheckoutSubscriptionFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
1907
+ class PaymentFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
1863
1908
  constructor(firestore) {
1864
1909
  super();
1865
1910
  this.firestore = firestore;
1866
- this.collectionName = 'checkoutsSubscription';
1867
- this.model = CheckoutSubscription;
1911
+ this.collectionName = 'payments';
1912
+ this.model = Payment;
1868
1913
  }
1869
1914
  }
1870
1915
 
@@ -1877,23 +1922,6 @@ class SubscriptionPlanFirestoreRepository extends withCrudFirestore(withHelpers(
1877
1922
  }
1878
1923
  }
1879
1924
 
1880
- class Buy2WinFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
1881
- constructor(firestore) {
1882
- super();
1883
- this.firestore = firestore;
1884
- this.collectionName = 'buy2win';
1885
- this.model = Buy2Win;
1886
- }
1887
- }
1888
-
1889
- class LegacyOrderFirestoreRepository extends OrderFirestoreRepository {
1890
- constructor(firestore) {
1891
- super(firestore);
1892
- this.firestore = firestore;
1893
- this.collectionName = 'legacyOrders';
1894
- }
1895
- }
1896
-
1897
1925
  class HomeFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
1898
1926
  constructor(firestore) {
1899
1927
  super();
@@ -2710,7 +2738,7 @@ class CategoryHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGr
2710
2738
  return data.shift();
2711
2739
  });
2712
2740
  }
2713
- getCategoriesForHome(categoryIds, limit = 4, gender) {
2741
+ getCategoriesForHome(categoryIds, limit = 4) {
2714
2742
  return __awaiter(this, void 0, void 0, function* () {
2715
2743
  if (!(categoryIds === null || categoryIds === void 0 ? void 0 : categoryIds.length))
2716
2744
  return [];
@@ -2730,7 +2758,7 @@ class CategoryHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGr
2730
2758
  const homeSections = yield Promise.all(categories.map((category) => __awaiter(this, void 0, void 0, function* () {
2731
2759
  return ({
2732
2760
  category,
2733
- products: yield this.mountCategory(category, { limit, hasStock: true, gender }),
2761
+ products: yield this.mountCategory(category, { limit, hasStock: true }),
2734
2762
  });
2735
2763
  })));
2736
2764
  return homeSections;
@@ -2742,7 +2770,7 @@ class CategoryHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGr
2742
2770
  if (!((_a = category === null || category === void 0 ? void 0 : category.products) === null || _a === void 0 ? void 0 : _a.length))
2743
2771
  return [];
2744
2772
  const products = [];
2745
- const { data: productsData } = yield this.productRepository.find(Object.assign(Object.assign({ filters: Object.assign(Object.assign({ id: { operator: Where.IN, value: category.products }, published: true }, ((options === null || options === void 0 ? void 0 : options.hasStock) ? { stock: { quantity: { operator: Where.GT, value: 0 } } } : {})), ((options === null || options === void 0 ? void 0 : options.gender) ? { tags: { operator: Where.IN, value: [options === null || options === void 0 ? void 0 : options.gender] } } : {})), fields: [
2773
+ const { data: productsData } = yield this.productRepository.find(Object.assign(Object.assign({ filters: Object.assign({ id: { operator: Where.IN, value: category.products }, published: true }, ((options === null || options === void 0 ? void 0 : options.hasStock) ? { stock: { quantity: { operator: Where.GT, value: 0 } } } : {})), fields: [
2746
2774
  'id',
2747
2775
  'name',
2748
2776
  'slug',
@@ -2766,7 +2794,6 @@ class CategoryHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGr
2766
2794
  'tags',
2767
2795
  'type',
2768
2796
  'shoppingCount',
2769
- 'gender',
2770
2797
  ] }, ((options === null || options === void 0 ? void 0 : options.limit) ? { limits: { limit: options === null || options === void 0 ? void 0 : options.limit } } : {})), { options: { enableCount: false } }));
2771
2798
  products.push(...productsData);
2772
2799
  return products;
@@ -3629,5 +3656,5 @@ class VariantHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGra
3629
3656
  * Generated bundle index. Do not edit.
3630
3657
  */
3631
3658
 
3632
- export { AccessoryImportances, Address, Area, Authentication, AuthenticationFirebaseAuthService, AxiosAdapter, Base, BaseModel, BeardProblems, BeardSizes, BeautyProductImportances, BeautyProfile, BeautyQuestionsHelper, BillingStatus, BodyProblems, BodyShapes, BodyTattoos, Buy2Win, Buy2WinFirestoreRepository, Category, CategoryFilter, CategoryFilterHasuraGraphQLRepository, CategoryFirestoreRepository, CategoryHasuraGraphQL, CategoryHasuraGraphQLRepository, Checkout, CheckoutFirestoreRepository, CheckoutSubscription, CheckoutSubscriptionFirestoreRepository, CheckoutTypes, Coupon, CouponFirestoreRepository, CouponSubtypes, CouponTypes, DuplicatedResultsError, Edition, EditionStatus, Exclusivities, FaceSkinOilinesses, FaceSkinProblems, FaceSkinTones, FamilyIncomes, Filter, FilterHasuraGraphQLRepository, FilterOption, FilterOptionHasuraGraphQLRepository, FilterType, FragranceImportances, GenderDestination, HairColors, HairProblems, HairStrands, HairTypes, Home, HomeFirestoreRepository, InvalidArgumentError, KitProduct, KitProductHasuraGraphQL, Lead, LeadFirestoreRepository, LegacyOrderFirestoreRepository, LineItem, NotFoundError, OfficePosition, Order, OrderFirestoreRepository, OrderStatus, Payment, PaymentFirestoreRepository, PaymentType, Product, ProductFirestoreRepository, ProductHasuraGraphQL, ProductHasuraGraphQLRepository, ProductSpents, ProductVariantFirestoreRepository, ProductsIndex, QuestionsFilters, RecoveryPassword, Register, RegisterFirebaseAuthService, RequiredArgumentError, ShippingMethod, ShopMenu, ShopMenuFirestoreRepository, ShopSettings, ShopSettingsFirestoreRepository, Shops, SignInMethods, SignOut, Status, Subscription, SubscriptionEditionFirestoreRepository, SubscriptionFirestoreRepository, SubscriptionPayment, SubscriptionPaymentFirestoreRepository, SubscriptionPlan, SubscriptionPlanFirestoreRepository, SubscriptionProductFirestoreRepository, UnauthorizedError, UpdateOptionActions, User, UserAddress, UserAddressFirestoreRepository, UserAlreadyRegisteredError, UserBeautyProfileFirestoreRepository, UserFirestoreRepository, UserPaymentMethod, UserPaymentMethodFirestoreRepository, UserType, Variant, VariantHasuraGraphQL, VariantHasuraGraphQLRepository, WeakPasswordError, Where, isUUID, parseDateTime, withCreateFirestore, withCreateHasuraGraphQL, withCrudFirestore, withCrudHasuraGraphQL, withDeleteFirestore, withDeleteHasuraGraphQL, withFindFirestore, withFindHasuraGraphQL, withFirestore, withGetFirestore, withGetHasuraGraphQL, withHasuraGraphQL, withHelpers, withSubCollection, withUpdateFirestore, withUpdateHasuraGraphQL };
3659
+ export { AccessoryImportances, Address, Area, Authentication, AuthenticationFirebaseAuthService, AxiosAdapter, Base, BaseModel, BeardProblems, BeardSizes, BeautyProductImportances, BeautyProfile, BeautyQuestionsHelper, BillingStatus, BodyProblems, BodyShapes, BodyTattoos, Buy2Win, Buy2WinFirestoreRepository, CampaignDashboard, CampaignDashboardFirestoreRepository, CampaignHashtag, CampaignHashtagFirestoreRepository, Category, CategoryFilter, CategoryFilterHasuraGraphQLRepository, CategoryFirestoreRepository, CategoryHasuraGraphQL, CategoryHasuraGraphQLRepository, Checkout, CheckoutFirestoreRepository, CheckoutSubscription, CheckoutSubscriptionFirestoreRepository, CheckoutTypes, Coupon, CouponFirestoreRepository, CouponSubtypes, CouponTypes, DuplicatedResultsError, Edition, EditionStatus, Exclusivities, FaceSkinOilinesses, FaceSkinProblems, FaceSkinTones, FamilyIncomes, Filter, FilterHasuraGraphQLRepository, FilterOption, FilterOptionHasuraGraphQLRepository, FilterType, FragranceImportances, GenderDestination, HairColors, HairProblems, HairStrands, HairTypes, Home, HomeFirestoreRepository, InvalidArgumentError, KitProduct, KitProductHasuraGraphQL, Lead, LeadFirestoreRepository, LegacyOrderFirestoreRepository, LineItem, NotFoundError, OfficePosition, Order, OrderFirestoreRepository, OrderStatus, Payment, PaymentFirestoreRepository, PaymentType, Product, ProductFirestoreRepository, ProductHasuraGraphQL, ProductHasuraGraphQLRepository, ProductSpents, ProductVariantFirestoreRepository, ProductsIndex, QuestionsFilters, RecoveryPassword, Register, RegisterFirebaseAuthService, RequiredArgumentError, ShippingMethod, ShopMenu, ShopMenuFirestoreRepository, ShopSettings, ShopSettingsFirestoreRepository, Shops, SignInMethods, SignOut, Status, Subscription, SubscriptionEditionFirestoreRepository, SubscriptionFirestoreRepository, SubscriptionPayment, SubscriptionPaymentFirestoreRepository, SubscriptionPlan, SubscriptionPlanFirestoreRepository, SubscriptionProductFirestoreRepository, UnauthorizedError, UpdateOptionActions, User, UserAddress, UserAddressFirestoreRepository, UserAlreadyRegisteredError, UserBeautyProfileFirestoreRepository, UserFirestoreRepository, UserPaymentMethod, UserPaymentMethodFirestoreRepository, UserType, Variant, VariantHasuraGraphQL, VariantHasuraGraphQLRepository, WeakPasswordError, Where, isUUID, parseDateTime, withCreateFirestore, withCreateHasuraGraphQL, withCrudFirestore, withCrudHasuraGraphQL, withDeleteFirestore, withDeleteHasuraGraphQL, withFindFirestore, withFindHasuraGraphQL, withFirestore, withGetFirestore, withGetHasuraGraphQL, withHasuraGraphQL, withHelpers, withSubCollection, withUpdateFirestore, withUpdateHasuraGraphQL };
3633
3660
  //# sourceMappingURL=infrab4a-connect.js.map