@infrab4a/connect-angular 5.5.0-beta.7 → 5.5.0-beta.9

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.
@@ -1,12 +1,12 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { NgModule, InjectionToken, PLATFORM_ID, Injectable, Inject } from '@angular/core';
3
- import * as i1$3 from '@angular/fire/app';
3
+ import * as i1$4 from '@angular/fire/app';
4
4
  import { FirebaseApp, provideFirebaseApp, getApp, initializeApp } from '@angular/fire/app';
5
5
  import * as i2 from '@angular/fire/app-check';
6
6
  import { provideAppCheck, initializeAppCheck } from '@angular/fire/app-check';
7
- import * as i3$1 from '@angular/fire/storage';
7
+ import * as i3 from '@angular/fire/storage';
8
8
  import { Storage, provideStorage, getStorage } from '@angular/fire/storage';
9
- import * as i3 from '@infrab4a/connect';
9
+ import * as i1$3 from '@infrab4a/connect';
10
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';
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';
@@ -1219,7 +1219,7 @@ ConfigurationFacade.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", vers
1219
1219
  ConfigurationFacade.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: ConfigurationFacade });
1220
1220
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: ConfigurationFacade, decorators: [{
1221
1221
  type: Injectable
1222
- }], ctorParameters: function () { return [{ type: i3.Shops, decorators: [{
1222
+ }], ctorParameters: function () { return [{ type: i1$3.Shops, decorators: [{
1223
1223
  type: Inject,
1224
1224
  args: [DEFAULT_SHOP]
1225
1225
  }] }, { type: undefined, decorators: [{
@@ -1813,7 +1813,7 @@ CatalogServiceFacade.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", ver
1813
1813
  CatalogServiceFacade.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: CatalogServiceFacade });
1814
1814
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: CatalogServiceFacade, decorators: [{
1815
1815
  type: Injectable
1816
- }], ctorParameters: function () { return [{ type: CatalogHelpersService }, { type: CatalogStrategiesFacade }, { type: i3.Shops, decorators: [{
1816
+ }], ctorParameters: function () { return [{ type: CatalogHelpersService }, { type: CatalogStrategiesFacade }, { type: i1$3.Shops, decorators: [{
1817
1817
  type: Inject,
1818
1818
  args: [DEFAULT_SHOP]
1819
1819
  }] }]; } });
@@ -1866,7 +1866,7 @@ CategoryService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version:
1866
1866
  CategoryService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: CategoryService });
1867
1867
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: CategoryService, decorators: [{
1868
1868
  type: Injectable
1869
- }], ctorParameters: function () { return [{ type: CategoryRepositoryFacade }, { type: ProductCatalogFacade }, { type: i3.Shops, decorators: [{
1869
+ }], ctorParameters: function () { return [{ type: CategoryRepositoryFacade }, { type: ProductCatalogFacade }, { type: i1$3.Shops, decorators: [{
1870
1870
  type: Inject,
1871
1871
  args: [DEFAULT_SHOP]
1872
1872
  }] }]; } });
@@ -1904,7 +1904,7 @@ CategoryServiceFacade.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", ve
1904
1904
  CategoryServiceFacade.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: CategoryServiceFacade });
1905
1905
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: CategoryServiceFacade, decorators: [{
1906
1906
  type: Injectable
1907
- }], ctorParameters: function () { return [{ type: CategoryRepositoryFacade }, { type: ProductCatalogFacade }, { type: i3.Shops, decorators: [{
1907
+ }], ctorParameters: function () { return [{ type: CategoryRepositoryFacade }, { type: ProductCatalogFacade }, { type: i1$3.Shops, decorators: [{
1908
1908
  type: Inject,
1909
1909
  args: [DEFAULT_SHOP]
1910
1910
  }] }]; } });
@@ -1920,7 +1920,13 @@ class BrandManagerHelper {
1920
1920
  if (isEmpty(brands) && options.filters) {
1921
1921
  delete options.filters.brands;
1922
1922
  }
1923
- this.brandsList[indexKey] = this.brandsList[indexKey] || brands || (await this.fetchBrandsOnly(options));
1923
+ if (!this.brandsList[indexKey] && !brands) {
1924
+ this.brandsList[indexKey] = await this.fetchBrandsOnly(options);
1925
+ }
1926
+ else {
1927
+ this.brandsList[indexKey] = this.brandsList[indexKey] || brands;
1928
+ }
1929
+ // this.brandsList[indexKey] = this.brandsList[indexKey] || brands || (await this.fetchBrandsOnly(options))
1924
1930
  this.brandsList[indexKey] = this.brandsList[indexKey].filter(Boolean);
1925
1931
  if (options.filters) {
1926
1932
  options.filters = {
@@ -2059,6 +2065,7 @@ class ProductFieldsHelper {
2059
2065
  'name',
2060
2066
  'slug',
2061
2067
  'images',
2068
+ 'imagesCard',
2062
2069
  'miniatures',
2063
2070
  'price',
2064
2071
  'stock',
@@ -2081,6 +2088,7 @@ class ProductFieldsHelper {
2081
2088
  'label',
2082
2089
  'outlet',
2083
2090
  'group',
2091
+ 'variantSlug',
2084
2092
  ];
2085
2093
  }
2086
2094
  }
@@ -2278,7 +2286,7 @@ CatalogService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version:
2278
2286
  CatalogService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: CatalogService });
2279
2287
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: CatalogService, decorators: [{
2280
2288
  type: Injectable
2281
- }], ctorParameters: function () { return [{ type: CatalogSearchContext }, { type: CatalogHelpersService }, { type: i3.Shops, decorators: [{
2289
+ }], ctorParameters: function () { return [{ type: CatalogSearchContext }, { type: CatalogHelpersService }, { type: i1$3.Shops, decorators: [{
2282
2290
  type: Inject,
2283
2291
  args: [DEFAULT_SHOP]
2284
2292
  }] }]; } });
@@ -2302,9 +2310,10 @@ __decorate([
2302
2310
  ], CategoryWithTree.prototype, "children", void 0);
2303
2311
 
2304
2312
  class WishlistService {
2305
- constructor(wishlistRepository, productRepository, logRepository, shop) {
2313
+ constructor(wishlistRepository, productRepository, productCatalogRepository, logRepository, shop) {
2306
2314
  this.wishlistRepository = wishlistRepository;
2307
2315
  this.productRepository = productRepository;
2316
+ this.productCatalogRepository = productCatalogRepository;
2308
2317
  this.logRepository = logRepository;
2309
2318
  this.shop = shop;
2310
2319
  }
@@ -2455,7 +2464,7 @@ class WishlistService {
2455
2464
  .then((res) => res.data.at(0));
2456
2465
  }
2457
2466
  async findProductById(id) {
2458
- return this.productRepository
2467
+ return this.productCatalogRepository
2459
2468
  .find({
2460
2469
  fields: ['id', 'sku', 'EAN', 'name', 'brand'],
2461
2470
  filters: {
@@ -2532,7 +2541,7 @@ class WishlistService {
2532
2541
  };
2533
2542
  }
2534
2543
  }
2535
- WishlistService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: WishlistService, deps: [{ token: 'WishlistRepository' }, { token: 'ProductRepository' }, { token: 'LogRepository' }, { token: DEFAULT_SHOP }], target: i0.ɵɵFactoryTarget.Injectable });
2544
+ WishlistService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: WishlistService, deps: [{ token: 'WishlistRepository' }, { token: 'ProductRepository' }, { token: 'ProductCatalogRepository' }, { token: 'LogRepository' }, { token: DEFAULT_SHOP }], target: i0.ɵɵFactoryTarget.Injectable });
2536
2545
  WishlistService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: WishlistService });
2537
2546
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: WishlistService, decorators: [{
2538
2547
  type: Injectable
@@ -2542,10 +2551,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImpor
2542
2551
  }] }, { type: undefined, decorators: [{
2543
2552
  type: Inject,
2544
2553
  args: ['ProductRepository']
2554
+ }] }, { type: undefined, decorators: [{
2555
+ type: Inject,
2556
+ args: ['ProductCatalogRepository']
2545
2557
  }] }, { type: undefined, decorators: [{
2546
2558
  type: Inject,
2547
2559
  args: ['LogRepository']
2548
- }] }, { type: i3.Shops, decorators: [{
2560
+ }] }, { type: i1$3.Shops, decorators: [{
2549
2561
  type: Inject,
2550
2562
  args: [DEFAULT_SHOP]
2551
2563
  }] }]; } });
@@ -3010,10 +3022,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImpor
3010
3022
  }], ctorParameters: function () { return [{ type: HomeShopRepositoriesFacade }, { type: ConfigurationFacade }]; } });
3011
3023
 
3012
3024
  class OrderProductReviewService {
3013
- constructor(orderRepository, productReviewRepository, variantRepository) {
3025
+ constructor(orderRepository, productReviewRepository, variantRepository, defaultShop) {
3014
3026
  this.orderRepository = orderRepository;
3015
3027
  this.productReviewRepository = productReviewRepository;
3016
3028
  this.variantRepository = variantRepository;
3029
+ this.defaultShop = defaultShop;
3017
3030
  }
3018
3031
  async getPendingReviewsByEmail(email) {
3019
3032
  const products = [];
@@ -3037,6 +3050,7 @@ class OrderProductReviewService {
3037
3050
  user: {
3038
3051
  email: email,
3039
3052
  },
3053
+ shop: this.defaultShop,
3040
3054
  status: OrderStatus.ENTREGUE,
3041
3055
  createdAt: {
3042
3056
  operator: Where.GTE,
@@ -3099,12 +3113,22 @@ class OrderProductReviewService {
3099
3113
  orderId: review.orderId,
3100
3114
  }));
3101
3115
  }
3116
+ async verifyReviewProductAndOrder(orderId, productId) {
3117
+ return this.productReviewRepository
3118
+ .find({
3119
+ filters: {
3120
+ orderId: { operator: Where.IN, value: orderId },
3121
+ productId: productId,
3122
+ },
3123
+ })
3124
+ .then((res) => res.data);
3125
+ }
3102
3126
  }
3103
- OrderProductReviewService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: OrderProductReviewService, deps: [{ token: 'OrderRepository' }, { token: 'ProductReviewRepository' }, { token: 'VariantRepository' }], target: i0.ɵɵFactoryTarget.Injectable });
3127
+ OrderProductReviewService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: OrderProductReviewService, deps: [{ token: 'OrderRepository' }, { token: 'ProductReviewRepository' }, { token: 'VariantRepository' }, { token: DEFAULT_SHOP }], target: i0.ɵɵFactoryTarget.Injectable });
3104
3128
  OrderProductReviewService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: OrderProductReviewService });
3105
3129
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: OrderProductReviewService, decorators: [{
3106
3130
  type: Injectable
3107
- }], ctorParameters: function () { return [{ type: i3.OrderFirestoreRepository, decorators: [{
3131
+ }], ctorParameters: function () { return [{ type: i1$3.OrderFirestoreRepository, decorators: [{
3108
3132
  type: Inject,
3109
3133
  args: ['OrderRepository']
3110
3134
  }] }, { type: undefined, decorators: [{
@@ -3113,6 +3137,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImpor
3113
3137
  }] }, { type: undefined, decorators: [{
3114
3138
  type: Inject,
3115
3139
  args: ['VariantRepository']
3140
+ }] }, { type: i1$3.Shops, decorators: [{
3141
+ type: Inject,
3142
+ args: [DEFAULT_SHOP]
3116
3143
  }] }]; } });
3117
3144
 
3118
3145
  class OrderService {
@@ -3132,7 +3159,7 @@ OrderService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "1
3132
3159
  OrderService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: OrderService });
3133
3160
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: OrderService, decorators: [{
3134
3161
  type: Injectable
3135
- }], ctorParameters: function () { return [{ type: i1$1.Firestore }, { type: i3.OrderFirestoreRepository, decorators: [{
3162
+ }], ctorParameters: function () { return [{ type: i1$1.Firestore }, { type: i1$3.OrderFirestoreRepository, decorators: [{
3136
3163
  type: Inject,
3137
3164
  args: ['OrderRepository']
3138
3165
  }] }]; } });
@@ -3179,7 +3206,7 @@ class AngularConnectModule {
3179
3206
  }
3180
3207
  }
3181
3208
  AngularConnectModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: AngularConnectModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
3182
- AngularConnectModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.1.0", ngImport: i0, type: AngularConnectModule, imports: [i1$3.FirebaseAppModule, i2.AppCheckModule, i3$1.StorageModule, AngularElasticSeachModule,
3209
+ AngularConnectModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.1.0", ngImport: i0, type: AngularConnectModule, imports: [i1$4.FirebaseAppModule, i2.AppCheckModule, i3.StorageModule, AngularElasticSeachModule,
3183
3210
  AngularVertexSeachModule,
3184
3211
  AngularFirebaseAuthModule,
3185
3212
  AngularFirestoreModule,