@infrab4a/connect-angular 5.5.0-beta.8 → 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 = {
@@ -2280,7 +2286,7 @@ CatalogService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version:
2280
2286
  CatalogService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: CatalogService });
2281
2287
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: CatalogService, decorators: [{
2282
2288
  type: Injectable
2283
- }], ctorParameters: function () { return [{ type: CatalogSearchContext }, { type: CatalogHelpersService }, { type: i3.Shops, decorators: [{
2289
+ }], ctorParameters: function () { return [{ type: CatalogSearchContext }, { type: CatalogHelpersService }, { type: i1$3.Shops, decorators: [{
2284
2290
  type: Inject,
2285
2291
  args: [DEFAULT_SHOP]
2286
2292
  }] }]; } });
@@ -2304,9 +2310,10 @@ __decorate([
2304
2310
  ], CategoryWithTree.prototype, "children", void 0);
2305
2311
 
2306
2312
  class WishlistService {
2307
- constructor(wishlistRepository, productRepository, logRepository, shop) {
2313
+ constructor(wishlistRepository, productRepository, productCatalogRepository, logRepository, shop) {
2308
2314
  this.wishlistRepository = wishlistRepository;
2309
2315
  this.productRepository = productRepository;
2316
+ this.productCatalogRepository = productCatalogRepository;
2310
2317
  this.logRepository = logRepository;
2311
2318
  this.shop = shop;
2312
2319
  }
@@ -2457,7 +2464,7 @@ class WishlistService {
2457
2464
  .then((res) => res.data.at(0));
2458
2465
  }
2459
2466
  async findProductById(id) {
2460
- return this.productRepository
2467
+ return this.productCatalogRepository
2461
2468
  .find({
2462
2469
  fields: ['id', 'sku', 'EAN', 'name', 'brand'],
2463
2470
  filters: {
@@ -2534,7 +2541,7 @@ class WishlistService {
2534
2541
  };
2535
2542
  }
2536
2543
  }
2537
- 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 });
2538
2545
  WishlistService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: WishlistService });
2539
2546
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: WishlistService, decorators: [{
2540
2547
  type: Injectable
@@ -2544,10 +2551,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImpor
2544
2551
  }] }, { type: undefined, decorators: [{
2545
2552
  type: Inject,
2546
2553
  args: ['ProductRepository']
2554
+ }] }, { type: undefined, decorators: [{
2555
+ type: Inject,
2556
+ args: ['ProductCatalogRepository']
2547
2557
  }] }, { type: undefined, decorators: [{
2548
2558
  type: Inject,
2549
2559
  args: ['LogRepository']
2550
- }] }, { type: i3.Shops, decorators: [{
2560
+ }] }, { type: i1$3.Shops, decorators: [{
2551
2561
  type: Inject,
2552
2562
  args: [DEFAULT_SHOP]
2553
2563
  }] }]; } });
@@ -3012,10 +3022,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImpor
3012
3022
  }], ctorParameters: function () { return [{ type: HomeShopRepositoriesFacade }, { type: ConfigurationFacade }]; } });
3013
3023
 
3014
3024
  class OrderProductReviewService {
3015
- constructor(orderRepository, productReviewRepository, variantRepository) {
3025
+ constructor(orderRepository, productReviewRepository, variantRepository, defaultShop) {
3016
3026
  this.orderRepository = orderRepository;
3017
3027
  this.productReviewRepository = productReviewRepository;
3018
3028
  this.variantRepository = variantRepository;
3029
+ this.defaultShop = defaultShop;
3019
3030
  }
3020
3031
  async getPendingReviewsByEmail(email) {
3021
3032
  const products = [];
@@ -3039,6 +3050,7 @@ class OrderProductReviewService {
3039
3050
  user: {
3040
3051
  email: email,
3041
3052
  },
3053
+ shop: this.defaultShop,
3042
3054
  status: OrderStatus.ENTREGUE,
3043
3055
  createdAt: {
3044
3056
  operator: Where.GTE,
@@ -3101,12 +3113,22 @@ class OrderProductReviewService {
3101
3113
  orderId: review.orderId,
3102
3114
  }));
3103
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
+ }
3104
3126
  }
3105
- 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 });
3106
3128
  OrderProductReviewService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: OrderProductReviewService });
3107
3129
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: OrderProductReviewService, decorators: [{
3108
3130
  type: Injectable
3109
- }], ctorParameters: function () { return [{ type: i3.OrderFirestoreRepository, decorators: [{
3131
+ }], ctorParameters: function () { return [{ type: i1$3.OrderFirestoreRepository, decorators: [{
3110
3132
  type: Inject,
3111
3133
  args: ['OrderRepository']
3112
3134
  }] }, { type: undefined, decorators: [{
@@ -3115,6 +3137,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImpor
3115
3137
  }] }, { type: undefined, decorators: [{
3116
3138
  type: Inject,
3117
3139
  args: ['VariantRepository']
3140
+ }] }, { type: i1$3.Shops, decorators: [{
3141
+ type: Inject,
3142
+ args: [DEFAULT_SHOP]
3118
3143
  }] }]; } });
3119
3144
 
3120
3145
  class OrderService {
@@ -3134,7 +3159,7 @@ OrderService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "1
3134
3159
  OrderService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: OrderService });
3135
3160
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: OrderService, decorators: [{
3136
3161
  type: Injectable
3137
- }], ctorParameters: function () { return [{ type: i1$1.Firestore }, { type: i3.OrderFirestoreRepository, decorators: [{
3162
+ }], ctorParameters: function () { return [{ type: i1$1.Firestore }, { type: i1$3.OrderFirestoreRepository, decorators: [{
3138
3163
  type: Inject,
3139
3164
  args: ['OrderRepository']
3140
3165
  }] }]; } });
@@ -3181,7 +3206,7 @@ class AngularConnectModule {
3181
3206
  }
3182
3207
  }
3183
3208
  AngularConnectModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: AngularConnectModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
3184
- 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,
3185
3210
  AngularVertexSeachModule,
3186
3211
  AngularFirebaseAuthModule,
3187
3212
  AngularFirestoreModule,