@infrab4a/connect-angular 5.5.0-beta.8 → 5.5.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.
@@ -7,7 +7,7 @@ import { provideAppCheck, initializeAppCheck } from '@angular/fire/app-check';
7
7
  import * as i3$1 from '@angular/fire/storage';
8
8
  import { Storage, provideStorage, getStorage } from '@angular/fire/storage';
9
9
  import * as i3 from '@infrab4a/connect';
10
- import { ProductsIndex, AxiosAdapter, Authentication, AuthenticationFirebaseAuthService, Register, RegisterFirebaseAuthService, SignOut, RecoveryPassword, ConnectFirestoreService, UserBeautyProfileFirestoreRepository, Buy2WinFirestoreRepository, CategoryFirestoreRepository, CheckoutFirestoreRepository, CheckoutSubscriptionFirestoreRepository, CouponFirestoreRepository, CampaignHashtagFirestoreRepository, CampaignDashboardFirestoreRepository, SubscriptionEditionFirestoreRepository, GroupFirestoreRepository, HomeFirestoreRepository, LeadFirestoreRepository, LegacyOrderFirestoreRepository, ShopMenuFirestoreRepository, OrderFirestoreRepository, PaymentFirestoreRepository, ProductFirestoreRepository, ShopSettingsFirestoreRepository, SubscriptionPaymentFirestoreRepository, SubscriptionPlanFirestoreRepository, SubscriptionProductFirestoreRepository, SubscriptionFirestoreRepository, UserFirestoreRepository, UserAddressFirestoreRepository, UserPaymentMethodFirestoreRepository, SubscriptionMaterializationFirestoreRepository, SubscriptionSummaryFirestoreRepository, ProductVariantFirestoreRepository, OrderBlockedFirestoreRepository, LogFirestoreRepository, SequenceFirestoreRepository, CategoryHasuraGraphQLRepository, ProductHasuraGraphQLRepository, CategoryFilterHasuraGraphQLRepository, ProductReviewHasuraGraphQLRepository, VariantHasuraGraphQLRepository, ProductStockNotificationHasuraGraphQLRepository, FilterOptionHasuraGraphQLRepository, FilterHasuraGraphQLRepository, CategoryCollectionChildrenHasuraGraphQLRepository, CategoryProductHasuraGraphQLRepository, WishlistHasuraGraphQLRepository, ProductErrorsHasuraGraphQLRepository, ProductCatalogHasuraGraphQLRepository, ProductsVertexSearch, VertexAxiosAdapter, isNil, NotFoundError, Checkout, pick, LineItem, Where, isEmpty, Shops, set, InvalidArgumentError, RoundProductPricesHelper, Category, WishlistLogType, PersonTypes, Wishlist, CheckoutTypes, CouponTypes, Exclusivities, OrderStatus, CheckoutSubscription, Product, RequiredArgumentError, add, ProductReview, Order, UpdateUserImage, FirebaseFileUploaderService } from '@infrab4a/connect';
10
+ import { ProductsIndex, AxiosAdapter, Authentication, AuthenticationFirebaseAuthService, Register, RegisterFirebaseAuthService, SignOut, RecoveryPassword, ConnectFirestoreService, UserBeautyProfileFirestoreRepository, Buy2WinFirestoreRepository, CategoryFirestoreRepository, CheckoutFirestoreRepository, CheckoutSubscriptionFirestoreRepository, CouponFirestoreRepository, CampaignHashtagFirestoreRepository, CampaignDashboardFirestoreRepository, SubscriptionEditionFirestoreRepository, GroupFirestoreRepository, HomeFirestoreRepository, LeadFirestoreRepository, LegacyOrderFirestoreRepository, ShopMenuFirestoreRepository, OrderFirestoreRepository, PaymentFirestoreRepository, ProductFirestoreRepository, ShopSettingsFirestoreRepository, SubscriptionPaymentFirestoreRepository, SubscriptionPlanFirestoreRepository, SubscriptionProductFirestoreRepository, SubscriptionFirestoreRepository, UserFirestoreRepository, UserAddressFirestoreRepository, UserPaymentMethodFirestoreRepository, SubscriptionMaterializationFirestoreRepository, SubscriptionSummaryFirestoreRepository, ProductVariantFirestoreRepository, OrderBlockedFirestoreRepository, LogFirestoreRepository, SequenceFirestoreRepository, BrandCategoryFirestoreRepository, CategoryHasuraGraphQLRepository, ProductHasuraGraphQLRepository, CategoryFilterHasuraGraphQLRepository, ProductReviewHasuraGraphQLRepository, VariantHasuraGraphQLRepository, ProductStockNotificationHasuraGraphQLRepository, FilterOptionHasuraGraphQLRepository, FilterHasuraGraphQLRepository, CategoryCollectionChildrenHasuraGraphQLRepository, CategoryProductHasuraGraphQLRepository, WishlistHasuraGraphQLRepository, ProductErrorsHasuraGraphQLRepository, ProductsVertexSearch, VertexAxiosAdapter, isNil, NotFoundError, Checkout, pick, LineItem, Where, isEmpty, Shops, set, InvalidArgumentError, RoundProductPricesHelper, Category, WishlistLogType, PersonTypes, Wishlist, CheckoutTypes, CouponTypes, Exclusivities, OrderStatus, CheckoutSubscription, Product, RequiredArgumentError, add, ProductReview, Order, UpdateUserImage, FirebaseFileUploaderService } from '@infrab4a/connect';
11
11
  import * as i1 from '@angular/fire/auth';
12
12
  import { Auth, provideAuth, initializeAuth, indexedDBLocalPersistence, browserLocalPersistence, browserSessionPersistence, getAuth, getIdToken, authState } from '@angular/fire/auth';
13
13
  import { isPlatformBrowser, isPlatformServer } from '@angular/common';
@@ -463,6 +463,13 @@ AngularFirestoreModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0",
463
463
  },
464
464
  deps: ['FirestoreOptions'],
465
465
  },
466
+ {
467
+ provide: 'BrandCategoryRepository',
468
+ useFactory: (options) => {
469
+ return new BrandCategoryFirestoreRepository(options);
470
+ },
471
+ deps: ['FirestoreOptions'],
472
+ },
466
473
  ], imports: [AngularElasticSeachModule,
467
474
  provideFirestore((injector) => {
468
475
  const platformId = injector.get(PLATFORM_ID);
@@ -736,6 +743,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImpor
736
743
  },
737
744
  deps: ['FirestoreOptions'],
738
745
  },
746
+ {
747
+ provide: 'BrandCategoryRepository',
748
+ useFactory: (options) => {
749
+ return new BrandCategoryFirestoreRepository(options);
750
+ },
751
+ deps: ['FirestoreOptions'],
752
+ },
739
753
  ],
740
754
  }]
741
755
  }] });
@@ -905,17 +919,6 @@ AngularHasuraGraphQLModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.
905
919
  provide: 'ProductErrorsRepository',
906
920
  useExisting: ProductErrorsHasuraGraphQLRepository,
907
921
  },
908
- {
909
- provide: ProductCatalogHasuraGraphQLRepository,
910
- useFactory: (options) => {
911
- return new ProductCatalogHasuraGraphQLRepository(options);
912
- },
913
- deps: ['HasuraConfig'],
914
- },
915
- {
916
- provide: 'ProductCatalogRepository',
917
- useExisting: ProductCatalogHasuraGraphQLRepository,
918
- },
919
922
  ] });
920
923
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: AngularHasuraGraphQLModule, decorators: [{
921
924
  type: NgModule,
@@ -1075,17 +1078,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImpor
1075
1078
  provide: 'ProductErrorsRepository',
1076
1079
  useExisting: ProductErrorsHasuraGraphQLRepository,
1077
1080
  },
1078
- {
1079
- provide: ProductCatalogHasuraGraphQLRepository,
1080
- useFactory: (options) => {
1081
- return new ProductCatalogHasuraGraphQLRepository(options);
1082
- },
1083
- deps: ['HasuraConfig'],
1084
- },
1085
- {
1086
- provide: 'ProductCatalogRepository',
1087
- useExisting: ProductCatalogHasuraGraphQLRepository,
1088
- },
1089
1081
  ],
1090
1082
  }]
1091
1083
  }] });
@@ -1300,7 +1292,7 @@ class CheckoutService {
1300
1292
  })), concatMap(() => this.getCheckout()));
1301
1293
  }
1302
1294
  createOrder(checkoutPayload, paymentProvider, applicationVersion) {
1303
- return this.dependenciesFacade.httpClient.post(`${this.checkoutUrl}/checkoutV5`, {
1295
+ return this.dependenciesFacade.httpClient.post(`${this.checkoutUrl}/checkout`, {
1304
1296
  data: {
1305
1297
  ...checkoutPayload,
1306
1298
  applicationVersion,
@@ -1568,12 +1560,12 @@ class CategorySearchStrategy {
1568
1560
  distinct: ['brand'],
1569
1561
  },
1570
1562
  };
1571
- return productCatalog.productCatalogRepository.findCatalog(repoParams, null, optionsCache);
1563
+ return productCatalog.productRepository.findCatalog(repoParams, null, optionsCache);
1572
1564
  }
1573
1565
  async getProductIds(category, filters, optionsCache) {
1574
1566
  const productCatalog = this.repositoryService.getProductCatalog();
1575
1567
  const filterHelper = this.helpersService.getFilterHelper();
1576
- return productCatalog.productCatalogRepository
1568
+ return productCatalog.productRepository
1577
1569
  .findCatalog({
1578
1570
  fields: ['id'],
1579
1571
  filters: {
@@ -1589,7 +1581,7 @@ class CategorySearchStrategy {
1589
1581
  const filterHelper = this.helpersService.getFilterHelper();
1590
1582
  const sortHelper = this.helpersService.getSortHelper();
1591
1583
  const mostRelevantProductsIds = [...new Set(mostRelevants.concat(productIds))];
1592
- const totalResult = await productCatalog.productCatalogRepository.findCatalog({
1584
+ const totalResult = await productCatalog.productRepository.findCatalog({
1593
1585
  fields,
1594
1586
  filters: {
1595
1587
  id: { operator: Where.IN, value: mostRelevantProductsIds },
@@ -1657,7 +1649,7 @@ class ProfileSearchStrategy {
1657
1649
  distinct: ['brand'],
1658
1650
  },
1659
1651
  };
1660
- return productCatalog.productCatalogRepository.findCatalog(repoParams, mainGender || (shop === Shops.MENSMARKET ? 'male' : 'female'), optionsCache);
1652
+ return productCatalog.productRepository.findCatalog(repoParams, mainGender || (shop === Shops.MENSMARKET ? 'male' : 'female'), optionsCache);
1661
1653
  }
1662
1654
  }
1663
1655
  ProfileSearchStrategy.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: ProfileSearchStrategy, deps: [{ token: CatalogRepositoryService }, { token: CatalogHelpersService }], target: i0.ɵɵFactoryTarget.Injectable });
@@ -1700,7 +1692,7 @@ class TermSearchStrategy {
1700
1692
  const { productIds, filters, shop, mainGender } = params;
1701
1693
  const productCatalog = this.repositoryService.getProductCatalog();
1702
1694
  const filterHelper = this.helpersService.getFilterHelper();
1703
- const totalResult = await productCatalog.productCatalogRepository.findCatalog({
1695
+ const totalResult = await productCatalog.productRepository.findCatalog({
1704
1696
  fields: ['id', 'stock', 'gender'],
1705
1697
  filters: {
1706
1698
  id: { operator: Where.IN, value: productIds },
@@ -1725,7 +1717,7 @@ class TermSearchStrategy {
1725
1717
  const { productIds, filters, limits, shop, mainGender, fields } = params;
1726
1718
  const productCatalog = this.repositoryService.getProductCatalog();
1727
1719
  const filterHelper = this.helpersService.getFilterHelper();
1728
- return productCatalog.productCatalogRepository.findCatalog({
1720
+ return productCatalog.productRepository.findCatalog({
1729
1721
  fields,
1730
1722
  filters: {
1731
1723
  id: { operator: Where.IN, value: productIds },
@@ -1755,7 +1747,7 @@ class TermSearchStrategy {
1755
1747
  async getDetailedProducts(orderedId, totalResult, fieldsHelper) {
1756
1748
  const productCatalog = this.repositoryService.getProductCatalog();
1757
1749
  const fields = fieldsHelper.getStandardFields();
1758
- const productResult = await productCatalog.productCatalogRepository.findCatalog({
1750
+ const productResult = await productCatalog.productRepository.findCatalog({
1759
1751
  filters: {
1760
1752
  id: { operator: Where.IN, value: orderedId },
1761
1753
  },
@@ -1843,7 +1835,7 @@ class CategoryService {
1843
1835
  this.shop = shop;
1844
1836
  }
1845
1837
  async fetchBrands(category, options, optionsCache) {
1846
- const brands = await this.productCatalog.productCatalogRepository
1838
+ const brands = await this.productCatalog.productRepository
1847
1839
  .findCatalog({
1848
1840
  filters: await this.productCatalog.categoryStructureAdapter.buildProductFilterByCategory(category),
1849
1841
  fields: ['brand'],
@@ -1872,18 +1864,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImpor
1872
1864
  }] }]; } });
1873
1865
 
1874
1866
  class ProductCatalogFacade {
1875
- constructor(productCatalogRepository, categoryStructureAdapter) {
1876
- this.productCatalogRepository = productCatalogRepository;
1867
+ constructor(productRepository, categoryStructureAdapter) {
1868
+ this.productRepository = productRepository;
1877
1869
  this.categoryStructureAdapter = categoryStructureAdapter;
1878
1870
  }
1879
1871
  }
1880
- ProductCatalogFacade.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: ProductCatalogFacade, deps: [{ token: 'ProductCatalogRepository' }, { token: CATEGORY_STRUCTURE }], target: i0.ɵɵFactoryTarget.Injectable });
1872
+ ProductCatalogFacade.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: ProductCatalogFacade, deps: [{ token: 'ProductRepository' }, { token: CATEGORY_STRUCTURE }], target: i0.ɵɵFactoryTarget.Injectable });
1881
1873
  ProductCatalogFacade.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: ProductCatalogFacade });
1882
1874
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: ProductCatalogFacade, decorators: [{
1883
1875
  type: Injectable
1884
1876
  }], ctorParameters: function () { return [{ type: undefined, decorators: [{
1885
1877
  type: Inject,
1886
- args: ['ProductCatalogRepository']
1878
+ args: ['ProductRepository']
1887
1879
  }] }, { type: undefined, decorators: [{
1888
1880
  type: Inject,
1889
1881
  args: [CATEGORY_STRUCTURE]
@@ -1942,10 +1934,15 @@ class BrandManagerHelper {
1942
1934
  return '';
1943
1935
  }
1944
1936
  async fetchBrandsOnly(options) {
1945
- return this.productCatalog.productCatalogRepository
1937
+ let filters = {};
1938
+ if (options.category) {
1939
+ filters = await this.productCatalog.categoryStructureAdapter.buildProductFilterByCategory(options.category);
1940
+ }
1941
+ return this.productCatalog.productRepository
1946
1942
  .findCatalog({
1947
1943
  fields: ['id'],
1948
1944
  filters: {
1945
+ ...filters,
1949
1946
  published: { operator: Where.EQUALS, value: true },
1950
1947
  },
1951
1948
  options: {
@@ -2059,7 +2056,6 @@ class ProductFieldsHelper {
2059
2056
  'name',
2060
2057
  'slug',
2061
2058
  'images',
2062
- 'imagesCard',
2063
2059
  'miniatures',
2064
2060
  'price',
2065
2061
  'stock',
@@ -2082,7 +2078,6 @@ class ProductFieldsHelper {
2082
2078
  'label',
2083
2079
  'outlet',
2084
2080
  'group',
2085
- 'variantSlug',
2086
2081
  ];
2087
2082
  }
2088
2083
  }