@infrab4a/connect-angular 4.1.7-beta.0 → 4.2.0-beta.1
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.
- package/angular-connect.module.d.ts +5 -6
- package/angular-firebase-auth.module.d.ts +3 -2
- package/angular-firestore.module.d.ts +4 -3
- package/angular-hasura-graphql.module.d.ts +1 -1
- package/esm2020/angular-connect.module.mjs +4 -35
- package/esm2020/angular-firebase-auth.module.mjs +21 -6
- package/esm2020/angular-firestore.module.mjs +26 -22
- package/esm2020/angular-hasura-graphql.module.mjs +2 -24
- package/esm2020/services/catalog/catalog.service.mjs +2 -41
- package/esm2020/services/home-shop.service.mjs +8 -8
- package/fesm2015/infrab4a-connect-angular.mjs +74 -151
- package/fesm2015/infrab4a-connect-angular.mjs.map +1 -1
- package/fesm2020/infrab4a-connect-angular.mjs +74 -147
- package/fesm2020/infrab4a-connect-angular.mjs.map +1 -1
- package/package.json +5 -6
- package/services/cart.service.d.ts +1 -1
- package/services/catalog/catalog.service.d.ts +5 -8
- package/services/catalog/types/product-sort.type.d.ts +1 -1
- package/services/home-shop.service.d.ts +1 -1
- package/services/types/required-checkout-data.type.d.ts +1 -1
- package/services/types/required-checkout-subscription-data.type.d.ts +1 -1
- package/types/firebase-app-config.type.d.ts +1 -1
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { NgModule, InjectionToken, PLATFORM_ID, Injectable, Inject } from '@angular/core';
|
|
3
|
-
import * as i1$
|
|
4
|
-
import {
|
|
5
|
-
import * as i1
|
|
6
|
-
import {
|
|
7
|
-
import * as i1 from '@angular/fire/auth';
|
|
3
|
+
import * as i1$3 from '@infrab4a/connect';
|
|
4
|
+
import { ProductsIndex, AxiosAdapter, Authentication, AuthenticationFirebaseAuthService, Register, RegisterFirebaseAuthService, SignOut, RecoveryPassword, UserBeautyProfileFirestoreRepository, Buy2WinFirestoreRepository, CategoryFirestoreRepository, CheckoutFirestoreRepository, CheckoutSubscriptionFirestoreRepository, CouponFirestoreRepository, CampaignHashtagFirestoreRepository, CampaignDashboardFirestoreRepository, SubscriptionEditionFirestoreRepository, HomeFirestoreRepository, LeadFirestoreRepository, LegacyOrderFirestoreRepository, ShopMenuFirestoreRepository, OrderFirestoreRepository, PaymentFirestoreRepository, ProductFirestoreRepository, ShopSettingsFirestoreRepository, SubscriptionPaymentFirestoreRepository, SubscriptionPlanFirestoreRepository, SubscriptionProductFirestoreRepository, SubscriptionFirestoreRepository, UserFirestoreRepository, UserAddressFirestoreRepository, UserPaymentMethodFirestoreRepository, ProductVariantFirestoreRepository, CategoryHasuraGraphQLRepository, ProductHasuraGraphQLRepository, CategoryFilterHasuraGraphQLRepository, VariantHasuraGraphQLRepository, FilterOptionHasuraGraphQLRepository, FilterHasuraGraphQLRepository, CategoryCollectionChildrenHasuraGraphQLRepository, WishlistHasuraGraphQLRepository, Where, Shops, CheckoutTypes, CouponTypes, Exclusivities, isNil, NotFoundError, Checkout, pick, LineItem, RoundProductPricesHelper, set, InvalidArgumentError, Category, CheckoutSubscription, Product, RequiredArgumentError, add, Order } from '@infrab4a/connect';
|
|
5
|
+
import * as i1 from '@angular/fire/app';
|
|
6
|
+
import { provideFirebaseApp, initializeApp, FirebaseApp } from '@angular/fire/app';
|
|
7
|
+
import * as i1$1 from '@angular/fire/auth';
|
|
8
8
|
import { Auth, provideAuth, getAuth, getIdToken, authState } from '@angular/fire/auth';
|
|
9
|
-
import { isPlatformBrowser
|
|
10
|
-
import * as i1$
|
|
11
|
-
import { Firestore, provideFirestore, getFirestore, initializeFirestore,
|
|
9
|
+
import { isPlatformBrowser } from '@angular/common';
|
|
10
|
+
import * as i1$2 from '@angular/fire/firestore';
|
|
11
|
+
import { Firestore, provideFirestore, getFirestore, initializeFirestore, enableIndexedDbPersistence, docSnapshots, doc } from '@angular/fire/firestore';
|
|
12
|
+
import { initializeApp as initializeApp$1 } from 'firebase/app';
|
|
12
13
|
import { combineLatest, from, of, throwError, Subject, iif, forkJoin } from 'rxjs';
|
|
13
14
|
import { map, mergeMap, catchError, concatMap, tap } from 'rxjs/operators';
|
|
14
15
|
import { __awaiter, __decorate, __metadata } from 'tslib';
|
|
15
16
|
import cookie from 'js-cookie';
|
|
16
17
|
import { Type } from 'class-transformer';
|
|
17
|
-
import * as i1$
|
|
18
|
+
import * as i1$4 from '@angular/common/http';
|
|
18
19
|
|
|
19
20
|
const ES_CONFIG = 'ES_CONFIG';
|
|
20
21
|
|
|
@@ -71,7 +72,7 @@ class AngularFirebaseAuthModule {
|
|
|
71
72
|
}
|
|
72
73
|
}
|
|
73
74
|
AngularFirebaseAuthModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: AngularFirebaseAuthModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
74
|
-
AngularFirebaseAuthModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.1.0", ngImport: i0, type: AngularFirebaseAuthModule, imports: [i1.AuthModule] });
|
|
75
|
+
AngularFirebaseAuthModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.1.0", ngImport: i0, type: AngularFirebaseAuthModule, imports: [i1.FirebaseAppModule, i1$1.AuthModule] });
|
|
75
76
|
AngularFirebaseAuthModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: AngularFirebaseAuthModule, providers: [
|
|
76
77
|
{
|
|
77
78
|
provide: 'Authentication',
|
|
@@ -115,11 +116,25 @@ AngularFirebaseAuthModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0
|
|
|
115
116
|
},
|
|
116
117
|
deps: ['AuthenticationService'],
|
|
117
118
|
},
|
|
118
|
-
], imports: [
|
|
119
|
+
], imports: [provideFirebaseApp((injector) => {
|
|
120
|
+
const appName = injector.get(FIREBASE_APP_NAME);
|
|
121
|
+
return appName
|
|
122
|
+
? initializeApp(injector.get(FIREBASE_OPTIONS), appName)
|
|
123
|
+
: initializeApp(injector.get(FIREBASE_OPTIONS));
|
|
124
|
+
}),
|
|
125
|
+
provideAuth(() => getAuth())] });
|
|
119
126
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: AngularFirebaseAuthModule, decorators: [{
|
|
120
127
|
type: NgModule,
|
|
121
128
|
args: [{
|
|
122
|
-
imports: [
|
|
129
|
+
imports: [
|
|
130
|
+
provideFirebaseApp((injector) => {
|
|
131
|
+
const appName = injector.get(FIREBASE_APP_NAME);
|
|
132
|
+
return appName
|
|
133
|
+
? initializeApp(injector.get(FIREBASE_OPTIONS), appName)
|
|
134
|
+
: initializeApp(injector.get(FIREBASE_OPTIONS));
|
|
135
|
+
}),
|
|
136
|
+
provideAuth(() => getAuth()),
|
|
137
|
+
],
|
|
123
138
|
providers: [
|
|
124
139
|
{
|
|
125
140
|
provide: 'Authentication',
|
|
@@ -188,7 +203,7 @@ class AngularFirestoreModule {
|
|
|
188
203
|
}
|
|
189
204
|
}
|
|
190
205
|
AngularFirestoreModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: AngularFirestoreModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
191
|
-
AngularFirestoreModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.1.0", ngImport: i0, type: AngularFirestoreModule, imports: [AngularElasticSeachModule, i1$
|
|
206
|
+
AngularFirestoreModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.1.0", ngImport: i0, type: AngularFirestoreModule, imports: [AngularElasticSeachModule, i1.FirebaseAppModule, i1$2.FirestoreModule] });
|
|
192
207
|
AngularFirestoreModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: AngularFirestoreModule, providers: [
|
|
193
208
|
{
|
|
194
209
|
provide: 'FirestoreOptions',
|
|
@@ -388,16 +403,17 @@ AngularFirestoreModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0",
|
|
|
388
403
|
deps: ['FirestoreOptions', ProductFirestoreRepository],
|
|
389
404
|
},
|
|
390
405
|
], imports: [AngularElasticSeachModule,
|
|
406
|
+
provideFirebaseApp((injector) => {
|
|
407
|
+
const appName = injector.get(FIREBASE_APP_NAME);
|
|
408
|
+
return appName
|
|
409
|
+
? initializeApp$1(injector.get(FIREBASE_OPTIONS), appName)
|
|
410
|
+
: initializeApp$1(injector.get(FIREBASE_OPTIONS));
|
|
411
|
+
}),
|
|
391
412
|
provideFirestore((injector) => {
|
|
392
|
-
const platformId = injector.get(PLATFORM_ID);
|
|
393
|
-
if (isPlatformServer(platformId))
|
|
394
|
-
return getFirestore(injector.get(FirebaseApp));
|
|
395
413
|
if (!MobileOperationSystemCheckerHelper.isAppleDevice())
|
|
396
|
-
return getFirestore(
|
|
397
|
-
const firestore = initializeFirestore(injector.get(FirebaseApp), {
|
|
398
|
-
|
|
399
|
-
localCache: memoryLocalCache(),
|
|
400
|
-
});
|
|
414
|
+
return getFirestore();
|
|
415
|
+
const firestore = initializeFirestore(injector.get(FirebaseApp), { experimentalForceLongPolling: true });
|
|
416
|
+
enableIndexedDbPersistence(firestore).catch(console.error);
|
|
401
417
|
return firestore;
|
|
402
418
|
})] });
|
|
403
419
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: AngularFirestoreModule, decorators: [{
|
|
@@ -405,16 +421,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImpor
|
|
|
405
421
|
args: [{
|
|
406
422
|
imports: [
|
|
407
423
|
AngularElasticSeachModule,
|
|
424
|
+
provideFirebaseApp((injector) => {
|
|
425
|
+
const appName = injector.get(FIREBASE_APP_NAME);
|
|
426
|
+
return appName
|
|
427
|
+
? initializeApp$1(injector.get(FIREBASE_OPTIONS), appName)
|
|
428
|
+
: initializeApp$1(injector.get(FIREBASE_OPTIONS));
|
|
429
|
+
}),
|
|
408
430
|
provideFirestore((injector) => {
|
|
409
|
-
const platformId = injector.get(PLATFORM_ID);
|
|
410
|
-
if (isPlatformServer(platformId))
|
|
411
|
-
return getFirestore(injector.get(FirebaseApp));
|
|
412
431
|
if (!MobileOperationSystemCheckerHelper.isAppleDevice())
|
|
413
|
-
return getFirestore(
|
|
414
|
-
const firestore = initializeFirestore(injector.get(FirebaseApp), {
|
|
415
|
-
|
|
416
|
-
localCache: memoryLocalCache(),
|
|
417
|
-
});
|
|
432
|
+
return getFirestore();
|
|
433
|
+
const firestore = initializeFirestore(injector.get(FirebaseApp), { experimentalForceLongPolling: true });
|
|
434
|
+
enableIndexedDbPersistence(firestore).catch(console.error);
|
|
418
435
|
return firestore;
|
|
419
436
|
}),
|
|
420
437
|
],
|
|
@@ -676,17 +693,6 @@ AngularHasuraGraphQLModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.
|
|
|
676
693
|
},
|
|
677
694
|
deps: ['HasuraConfig'],
|
|
678
695
|
},
|
|
679
|
-
{
|
|
680
|
-
provide: 'ProductReviewsRepository',
|
|
681
|
-
useExisting: ProductReviewsHasuraGraphQLRepository,
|
|
682
|
-
},
|
|
683
|
-
{
|
|
684
|
-
provide: ProductReviewsHasuraGraphQLRepository,
|
|
685
|
-
useFactory: (hasuraConfig) => {
|
|
686
|
-
return new ProductReviewsHasuraGraphQLRepository(hasuraConfig);
|
|
687
|
-
},
|
|
688
|
-
deps: ['HasuraConfig'],
|
|
689
|
-
},
|
|
690
696
|
{
|
|
691
697
|
provide: 'VariantRepository',
|
|
692
698
|
useExisting: VariantHasuraGraphQLRepository,
|
|
@@ -801,17 +807,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImpor
|
|
|
801
807
|
},
|
|
802
808
|
deps: ['HasuraConfig'],
|
|
803
809
|
},
|
|
804
|
-
{
|
|
805
|
-
provide: 'ProductReviewsRepository',
|
|
806
|
-
useExisting: ProductReviewsHasuraGraphQLRepository,
|
|
807
|
-
},
|
|
808
|
-
{
|
|
809
|
-
provide: ProductReviewsHasuraGraphQLRepository,
|
|
810
|
-
useFactory: (hasuraConfig) => {
|
|
811
|
-
return new ProductReviewsHasuraGraphQLRepository(hasuraConfig);
|
|
812
|
-
},
|
|
813
|
-
deps: ['HasuraConfig'],
|
|
814
|
-
},
|
|
815
810
|
{
|
|
816
811
|
provide: 'VariantRepository',
|
|
817
812
|
useExisting: VariantHasuraGraphQLRepository,
|
|
@@ -902,12 +897,12 @@ class AuthService {
|
|
|
902
897
|
return authState(this.angularFireAuth).pipe(catchError(() => of(null)));
|
|
903
898
|
}
|
|
904
899
|
}
|
|
905
|
-
AuthService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: AuthService, deps: [{ token: i1.Auth }, { token: 'UserRepository' }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
900
|
+
AuthService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: AuthService, deps: [{ token: i1$1.Auth }, { token: 'UserRepository' }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
906
901
|
AuthService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: AuthService });
|
|
907
902
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: AuthService, decorators: [{
|
|
908
903
|
type: Injectable
|
|
909
904
|
}], ctorParameters: function () {
|
|
910
|
-
return [{ type: i1.Auth }, { type: undefined, decorators: [{
|
|
905
|
+
return [{ type: i1$1.Auth }, { type: undefined, decorators: [{
|
|
911
906
|
type: Inject,
|
|
912
907
|
args: ['UserRepository']
|
|
913
908
|
}] }];
|
|
@@ -1139,7 +1134,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImpor
|
|
|
1139
1134
|
return [{ type: undefined, decorators: [{
|
|
1140
1135
|
type: Inject,
|
|
1141
1136
|
args: ['CouponRepository']
|
|
1142
|
-
}] }, { type: i1$
|
|
1137
|
+
}] }, { type: i1$3.Shops, decorators: [{
|
|
1143
1138
|
type: Inject,
|
|
1144
1139
|
args: [DEFAULT_SHOP]
|
|
1145
1140
|
}] }, { type: undefined, decorators: [{
|
|
@@ -1206,7 +1201,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImpor
|
|
|
1206
1201
|
}] }, { type: undefined, decorators: [{
|
|
1207
1202
|
type: Inject,
|
|
1208
1203
|
args: ['UserRepository']
|
|
1209
|
-
}] }, { type: i1$
|
|
1204
|
+
}] }, { type: i1$3.Shops, decorators: [{
|
|
1210
1205
|
type: Inject,
|
|
1211
1206
|
args: [DEFAULT_SHOP]
|
|
1212
1207
|
}] }];
|
|
@@ -1463,7 +1458,7 @@ CartService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version:
|
|
|
1463
1458
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: CartService, decorators: [{
|
|
1464
1459
|
type: Injectable
|
|
1465
1460
|
}], ctorParameters: function () {
|
|
1466
|
-
return [{ type: AuthService }, { type: CheckoutService }, { type: i1$
|
|
1461
|
+
return [{ type: AuthService }, { type: CheckoutService }, { type: i1$3.Shops, decorators: [{
|
|
1467
1462
|
type: Inject,
|
|
1468
1463
|
args: [DEFAULT_SHOP]
|
|
1469
1464
|
}] }, { type: undefined, decorators: [{
|
|
@@ -1475,7 +1470,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImpor
|
|
|
1475
1470
|
}] }, { type: undefined, decorators: [{
|
|
1476
1471
|
type: Inject,
|
|
1477
1472
|
args: ['VariantRepository']
|
|
1478
|
-
}] }, { type: i1$
|
|
1473
|
+
}] }, { type: i1$3.Buy2WinFirestoreRepository, decorators: [{
|
|
1479
1474
|
type: Inject,
|
|
1480
1475
|
args: ['Buy2WinRepository']
|
|
1481
1476
|
}] }];
|
|
@@ -1487,7 +1482,6 @@ class CatalogService {
|
|
|
1487
1482
|
this.categoryStructureAdapter = categoryStructureAdapter;
|
|
1488
1483
|
this.shop = shop;
|
|
1489
1484
|
this.productIndex = productIndex;
|
|
1490
|
-
this.productsByTerm = {};
|
|
1491
1485
|
this.buildFilterQuery = ({ clubDiscount, brands, prices, gender, tags, rate, customOptions, }) => {
|
|
1492
1486
|
const filters = {};
|
|
1493
1487
|
if (clubDiscount === null || clubDiscount === void 0 ? void 0 : clubDiscount.length)
|
|
@@ -1565,8 +1559,6 @@ class CatalogService {
|
|
|
1565
1559
|
}
|
|
1566
1560
|
findCatalog(options, limits) {
|
|
1567
1561
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1568
|
-
if (this.hasTerm(options) && options.sort === 'most-relevant')
|
|
1569
|
-
return this.findCatalogByTermAndSortByMostRevelant(options, limits);
|
|
1570
1562
|
const repoParams = Object.assign(Object.assign({ filters: Object.assign(Object.assign({}, (yield this.buildMainFilter(options))), this.buildFilterQuery((options === null || options === void 0 ? void 0 : options.filters) || {})) }, ((options === null || options === void 0 ? void 0 : options.sort) ? { orderBy: this.buildSortQuery(options === null || options === void 0 ? void 0 : options.sort) } : {})), { limits, options: Object.assign({ minimal: ['price'], maximum: ['price'] }, (!this.hasCategory(options) ? { distinct: ['brand'] } : {})) });
|
|
1571
1563
|
if (['biggest-price', 'lowest-price', 'biggest-discount', 'best-rating'].includes(options.sort))
|
|
1572
1564
|
return this.productRepository.findCatalog(repoParams);
|
|
@@ -1585,48 +1577,8 @@ class CatalogService {
|
|
|
1585
1577
|
.then((data) => ({ id: { operator: Where.IN, value: data.hits.map(({ _source }) => _source.id) } }));
|
|
1586
1578
|
});
|
|
1587
1579
|
}
|
|
1588
|
-
findCatalogByTermAndSortByMostRevelant(options, limits) {
|
|
1589
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
1590
|
-
const productIds = yield this.findCatalogIdsByElasticSearch(options.term);
|
|
1591
|
-
const limitedProductId = productIds.slice(limits.offset, limits.offset + limits.limit);
|
|
1592
|
-
const productResult = yield this.productRepository.findCatalog({
|
|
1593
|
-
filters: { id: { operator: Where.IN, value: limitedProductId } },
|
|
1594
|
-
}, (options === null || options === void 0 ? void 0 : options.mainGender) || this.shop === Shops.MENSMARKET ? 'male' : 'female');
|
|
1595
|
-
const totalResult = yield this.productRepository.findCatalog({
|
|
1596
|
-
fields: ['id'],
|
|
1597
|
-
filters: { id: { operator: Where.IN, value: productIds } },
|
|
1598
|
-
limits: { limit: 1, offset: 0 },
|
|
1599
|
-
options: {
|
|
1600
|
-
minimal: ['price'],
|
|
1601
|
-
maximum: ['price'],
|
|
1602
|
-
distinct: ['brand'],
|
|
1603
|
-
},
|
|
1604
|
-
}, (options === null || options === void 0 ? void 0 : options.mainGender) || this.shop === Shops.MENSMARKET ? 'male' : 'female');
|
|
1605
|
-
return {
|
|
1606
|
-
data: limitedProductId.map((id) => productResult.data.find((product) => product.id === id)).filter(Boolean),
|
|
1607
|
-
count: totalResult.count,
|
|
1608
|
-
maximum: totalResult.maximum,
|
|
1609
|
-
minimal: totalResult.minimal,
|
|
1610
|
-
distinct: totalResult.distinct,
|
|
1611
|
-
};
|
|
1612
|
-
});
|
|
1613
|
-
}
|
|
1614
|
-
findCatalogIdsByElasticSearch(term) {
|
|
1615
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
1616
|
-
if (this.productsByTerm[term])
|
|
1617
|
-
return this.productsByTerm[term];
|
|
1618
|
-
return (this.productsByTerm[term] = yield this.productIndex
|
|
1619
|
-
.search(term, 999, this.shop)
|
|
1620
|
-
.then(({ hits: products }) => {
|
|
1621
|
-
const withStock = products.filter(({ _source }) => _source.stock.quantity > 0);
|
|
1622
|
-
const withOutStock = products.filter(({ _source }) => _source.stock.quantity <= 0);
|
|
1623
|
-
const sorted = [...withStock, ...withOutStock];
|
|
1624
|
-
return [...new Set(sorted.map(({ _source }) => _source.id))];
|
|
1625
|
-
}));
|
|
1626
|
-
});
|
|
1627
|
-
}
|
|
1628
1580
|
}
|
|
1629
|
-
CatalogService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: CatalogService, deps: [{ token: 'ProductRepository' }, { token: CATEGORY_STRUCTURE }, { token: DEFAULT_SHOP }, { token: i1$
|
|
1581
|
+
CatalogService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: CatalogService, deps: [{ token: 'ProductRepository' }, { token: CATEGORY_STRUCTURE }, { token: DEFAULT_SHOP }, { token: i1$3.ProductsIndex }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1630
1582
|
CatalogService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: CatalogService });
|
|
1631
1583
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: CatalogService, decorators: [{
|
|
1632
1584
|
type: Injectable
|
|
@@ -1637,10 +1589,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImpor
|
|
|
1637
1589
|
}] }, { type: undefined, decorators: [{
|
|
1638
1590
|
type: Inject,
|
|
1639
1591
|
args: [CATEGORY_STRUCTURE]
|
|
1640
|
-
}] }, { type: i1$
|
|
1592
|
+
}] }, { type: i1$3.Shops, decorators: [{
|
|
1641
1593
|
type: Inject,
|
|
1642
1594
|
args: [DEFAULT_SHOP]
|
|
1643
|
-
}] }, { type: i1$
|
|
1595
|
+
}] }, { type: i1$3.ProductsIndex }];
|
|
1644
1596
|
} });
|
|
1645
1597
|
|
|
1646
1598
|
class CategoryService {
|
|
@@ -1689,7 +1641,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImpor
|
|
|
1689
1641
|
}] }, { type: undefined, decorators: [{
|
|
1690
1642
|
type: Inject,
|
|
1691
1643
|
args: [CATEGORY_STRUCTURE]
|
|
1692
|
-
}] }, { type: i1$
|
|
1644
|
+
}] }, { type: i1$3.Shops, decorators: [{
|
|
1693
1645
|
type: Inject,
|
|
1694
1646
|
args: [DEFAULT_SHOP]
|
|
1695
1647
|
}] }];
|
|
@@ -1872,7 +1824,7 @@ class WishlistService {
|
|
|
1872
1824
|
});
|
|
1873
1825
|
}
|
|
1874
1826
|
}
|
|
1875
|
-
WishlistService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: WishlistService, deps: [{ token: 'WishlistRepository' }, { token: DEFAULT_SHOP }, { token: 'ProductRepository' }, { token: 'CategoryFilterRepository' }, { token: i1$
|
|
1827
|
+
WishlistService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: WishlistService, deps: [{ token: 'WishlistRepository' }, { token: DEFAULT_SHOP }, { token: 'ProductRepository' }, { token: 'CategoryFilterRepository' }, { token: i1$3.ProductsIndex }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1876
1828
|
WishlistService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: WishlistService });
|
|
1877
1829
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: WishlistService, decorators: [{
|
|
1878
1830
|
type: Injectable
|
|
@@ -1880,7 +1832,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImpor
|
|
|
1880
1832
|
return [{ type: undefined, decorators: [{
|
|
1881
1833
|
type: Inject,
|
|
1882
1834
|
args: ['WishlistRepository']
|
|
1883
|
-
}] }, { type: i1$
|
|
1835
|
+
}] }, { type: i1$3.Shops, decorators: [{
|
|
1884
1836
|
type: Inject,
|
|
1885
1837
|
args: [DEFAULT_SHOP]
|
|
1886
1838
|
}] }, { type: undefined, decorators: [{
|
|
@@ -1889,7 +1841,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImpor
|
|
|
1889
1841
|
}] }, { type: undefined, decorators: [{
|
|
1890
1842
|
type: Inject,
|
|
1891
1843
|
args: ['CategoryFilterRepository']
|
|
1892
|
-
}] }, { type: i1$
|
|
1844
|
+
}] }, { type: i1$3.ProductsIndex }];
|
|
1893
1845
|
} });
|
|
1894
1846
|
|
|
1895
1847
|
class CheckoutSubscriptionService {
|
|
@@ -1957,13 +1909,6 @@ class UtilHelper {
|
|
|
1957
1909
|
}
|
|
1958
1910
|
|
|
1959
1911
|
class HomeShopService {
|
|
1960
|
-
get homeId() {
|
|
1961
|
-
if (this.defaultShop === Shops.GLAMSHOP)
|
|
1962
|
-
return 'glamshop';
|
|
1963
|
-
if (this.defaultShop === Shops.MENSMARKET)
|
|
1964
|
-
return 'mens_market';
|
|
1965
|
-
return null;
|
|
1966
|
-
}
|
|
1967
1912
|
constructor(categoryRepository, homeRepository, productRepository, defaultShop) {
|
|
1968
1913
|
this.categoryRepository = categoryRepository;
|
|
1969
1914
|
this.homeRepository = homeRepository;
|
|
@@ -1992,6 +1937,13 @@ class HomeShopService {
|
|
|
1992
1937
|
});
|
|
1993
1938
|
};
|
|
1994
1939
|
}
|
|
1940
|
+
get homeId() {
|
|
1941
|
+
if (this.defaultShop === Shops.GLAMSHOP)
|
|
1942
|
+
return 'glamshop';
|
|
1943
|
+
if (this.defaultShop === Shops.MENSMARKET)
|
|
1944
|
+
return 'mens_market';
|
|
1945
|
+
return null;
|
|
1946
|
+
}
|
|
1995
1947
|
getHomeData() {
|
|
1996
1948
|
return this.getHomeConfiguration().pipe(map((home) => { var _a; return (((_a = home === null || home === void 0 ? void 0 : home.data) === null || _a === void 0 ? void 0 : _a.expiresAt) > new Date() ? home : null); }), concatMap((home) => home
|
|
1997
1949
|
? of(home)
|
|
@@ -2062,7 +2014,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImpor
|
|
|
2062
2014
|
}] }, { type: undefined, decorators: [{
|
|
2063
2015
|
type: Inject,
|
|
2064
2016
|
args: ['ProductRepository']
|
|
2065
|
-
}] }, { type: i1$
|
|
2017
|
+
}] }, { type: i1$3.Shops, decorators: [{
|
|
2066
2018
|
type: Inject,
|
|
2067
2019
|
args: [DEFAULT_SHOP]
|
|
2068
2020
|
}] }];
|
|
@@ -2081,12 +2033,12 @@ class OrderService {
|
|
|
2081
2033
|
return this.orderSubject;
|
|
2082
2034
|
}
|
|
2083
2035
|
}
|
|
2084
|
-
OrderService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: OrderService, deps: [{ token: i1$
|
|
2036
|
+
OrderService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: OrderService, deps: [{ token: i1$2.Firestore }, { token: 'OrderRepository' }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2085
2037
|
OrderService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: OrderService });
|
|
2086
2038
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: OrderService, decorators: [{
|
|
2087
2039
|
type: Injectable
|
|
2088
2040
|
}], ctorParameters: function () {
|
|
2089
|
-
return [{ type: i1$
|
|
2041
|
+
return [{ type: i1$2.Firestore }, { type: i1$3.OrderFirestoreRepository, decorators: [{
|
|
2090
2042
|
type: Inject,
|
|
2091
2043
|
args: ['OrderRepository']
|
|
2092
2044
|
}] }];
|
|
@@ -2169,12 +2121,12 @@ class ShippingService {
|
|
|
2169
2121
|
return false;
|
|
2170
2122
|
}
|
|
2171
2123
|
}
|
|
2172
|
-
ShippingService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: ShippingService, deps: [{ token: i1$
|
|
2124
|
+
ShippingService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: ShippingService, deps: [{ token: i1$4.HttpClient }, { token: BACKEND_URL }, { token: HomeShopService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2173
2125
|
ShippingService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: ShippingService });
|
|
2174
2126
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: ShippingService, decorators: [{
|
|
2175
2127
|
type: Injectable
|
|
2176
2128
|
}], ctorParameters: function () {
|
|
2177
|
-
return [{ type: i1$
|
|
2129
|
+
return [{ type: i1$4.HttpClient }, { type: undefined, decorators: [{
|
|
2178
2130
|
type: Inject,
|
|
2179
2131
|
args: [BACKEND_URL]
|
|
2180
2132
|
}] }, { type: HomeShopService }];
|
|
@@ -2202,10 +2154,7 @@ class AngularConnectModule {
|
|
|
2202
2154
|
}
|
|
2203
2155
|
}
|
|
2204
2156
|
AngularConnectModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: AngularConnectModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
2205
|
-
AngularConnectModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.1.0", ngImport: i0, type: AngularConnectModule, imports: [
|
|
2206
|
-
AngularFirebaseAuthModule,
|
|
2207
|
-
AngularFirestoreModule,
|
|
2208
|
-
AngularHasuraGraphQLModule] });
|
|
2157
|
+
AngularConnectModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.1.0", ngImport: i0, type: AngularConnectModule, imports: [AngularElasticSeachModule, AngularFirebaseAuthModule, AngularFirestoreModule, AngularHasuraGraphQLModule] });
|
|
2209
2158
|
AngularConnectModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: AngularConnectModule, providers: [
|
|
2210
2159
|
AuthService,
|
|
2211
2160
|
CartService,
|
|
@@ -2218,37 +2167,11 @@ AngularConnectModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", ve
|
|
|
2218
2167
|
OrderService,
|
|
2219
2168
|
ShippingService,
|
|
2220
2169
|
WishlistService,
|
|
2221
|
-
], imports: [
|
|
2222
|
-
const appName = injector.get(FIREBASE_APP_NAME) || '[DEFAULT]';
|
|
2223
|
-
try {
|
|
2224
|
-
return getApp(appName);
|
|
2225
|
-
}
|
|
2226
|
-
catch (error) {
|
|
2227
|
-
return initializeApp(injector.get(FIREBASE_OPTIONS), appName);
|
|
2228
|
-
}
|
|
2229
|
-
}),
|
|
2230
|
-
AngularElasticSeachModule,
|
|
2231
|
-
AngularFirebaseAuthModule,
|
|
2232
|
-
AngularFirestoreModule,
|
|
2233
|
-
AngularHasuraGraphQLModule] });
|
|
2170
|
+
], imports: [AngularElasticSeachModule, AngularFirebaseAuthModule, AngularFirestoreModule, AngularHasuraGraphQLModule] });
|
|
2234
2171
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: AngularConnectModule, decorators: [{
|
|
2235
2172
|
type: NgModule,
|
|
2236
2173
|
args: [{
|
|
2237
|
-
imports: [
|
|
2238
|
-
provideFirebaseApp((injector) => {
|
|
2239
|
-
const appName = injector.get(FIREBASE_APP_NAME) || '[DEFAULT]';
|
|
2240
|
-
try {
|
|
2241
|
-
return getApp(appName);
|
|
2242
|
-
}
|
|
2243
|
-
catch (error) {
|
|
2244
|
-
return initializeApp(injector.get(FIREBASE_OPTIONS), appName);
|
|
2245
|
-
}
|
|
2246
|
-
}),
|
|
2247
|
-
AngularElasticSeachModule,
|
|
2248
|
-
AngularFirebaseAuthModule,
|
|
2249
|
-
AngularFirestoreModule,
|
|
2250
|
-
AngularHasuraGraphQLModule,
|
|
2251
|
-
],
|
|
2174
|
+
imports: [AngularElasticSeachModule, AngularFirebaseAuthModule, AngularFirestoreModule, AngularHasuraGraphQLModule],
|
|
2252
2175
|
providers: [
|
|
2253
2176
|
AuthService,
|
|
2254
2177
|
CartService,
|