@infrab4a/connect-angular 4.2.11-beta.9 → 4.3.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/esm2020/angular-connect.module.mjs +97 -0
- package/esm2020/angular-elastic-search.module.mjs +34 -0
- package/esm2020/angular-firebase-auth.module.mjs +115 -0
- package/esm2020/angular-firestore.module.mjs +483 -0
- package/esm2020/angular-hasura-graphql.module.mjs +243 -0
- package/{esm2022 → esm2020}/consts/category-structure.mjs +1 -1
- package/{esm2022 → esm2020}/consts/default-shop.const.mjs +1 -1
- package/{esm2022 → esm2020}/consts/es-config.const.mjs +1 -1
- package/{esm2022 → esm2020}/consts/firebase-const.mjs +1 -1
- package/{esm2022 → esm2020}/consts/hasura-options.const.mjs +1 -1
- package/{esm2022 → esm2020}/consts/index.mjs +1 -1
- package/{esm2022 → esm2020}/helpers/index.mjs +1 -1
- package/{esm2022 → esm2020}/helpers/mobile-operation-system-checker.helper.mjs +1 -1
- package/{esm2022 → esm2020}/index.mjs +1 -1
- package/{esm2022 → esm2020}/services/auth.service.mjs +6 -6
- package/{esm2022 → esm2020}/services/cart.service.mjs +8 -8
- package/{esm2022 → esm2020}/services/catalog/adapters/category-structure.adapter.mjs +1 -1
- package/{esm2022 → esm2020}/services/catalog/adapters/index.mjs +1 -1
- package/{esm2022 → esm2020}/services/catalog/adapters/new-category-structure.adapter.mjs +6 -6
- package/{esm2022 → esm2020}/services/catalog/adapters/old-category-structure.adapter.mjs +6 -6
- package/esm2020/services/catalog/catalog.service.mjs +124 -0
- package/{esm2022 → esm2020}/services/catalog/category.service.mjs +6 -6
- package/{esm2022 → esm2020}/services/catalog/enums/index.mjs +1 -1
- package/{esm2022 → esm2020}/services/catalog/enums/product-sorts.enum.mjs +1 -1
- package/esm2020/services/catalog/index.mjs +7 -0
- package/{esm2022 → esm2020}/services/catalog/models/category-with-tree.model.mjs +1 -1
- package/{esm2022 → esm2020}/services/catalog/models/index.mjs +1 -1
- package/{esm2022 → esm2020}/services/catalog/types/index.mjs +1 -1
- package/{esm2022 → esm2020}/services/catalog/types/product-sort.type.mjs +1 -1
- package/esm2020/services/catalog/wishlist.service.mjs +107 -0
- package/{esm2022 → esm2020}/services/checkout-subscription.service.mjs +6 -6
- package/{esm2022 → esm2020}/services/checkout.service.mjs +6 -6
- package/{esm2022 → esm2020}/services/coupon.service.mjs +6 -6
- package/{esm2022 → esm2020}/services/helpers/index.mjs +1 -1
- package/{esm2022 → esm2020}/services/helpers/util.helper.mjs +1 -1
- package/esm2020/services/home-shop.service.mjs +114 -0
- package/{esm2022 → esm2020}/services/index.mjs +1 -1
- package/{esm2022 → esm2020}/services/order.service.mjs +6 -6
- package/{esm2022 → esm2020}/services/shipping.service.mjs +6 -6
- package/{esm2022 → esm2020}/services/types/index.mjs +1 -1
- package/{esm2022 → esm2020}/services/types/required-checkout-data.type.mjs +1 -1
- package/{esm2022 → esm2020}/services/types/required-checkout-subscription-data.type.mjs +1 -1
- package/esm2020/services/types/shipping-methods.type.mjs +2 -0
- package/{esm2022 → esm2020}/types/firebase-app-config.type.mjs +1 -1
- package/{esm2022 → esm2020}/types/index.mjs +1 -1
- package/fesm2015/infrab4a-connect-angular.mjs +2236 -0
- package/fesm2015/infrab4a-connect-angular.mjs.map +1 -0
- package/{fesm2022 → fesm2020}/infrab4a-connect-angular.mjs +559 -665
- package/fesm2020/infrab4a-connect-angular.mjs.map +1 -0
- package/package.json +12 -6
- package/services/catalog/catalog.service.d.ts +0 -3
- package/services/catalog/index.d.ts +0 -1
- package/services/catalog/wishlist.service.d.ts +4 -21
- package/services/home-shop.service.d.ts +0 -1
- package/esm2022/angular-connect.module.mjs +0 -97
- package/esm2022/angular-elastic-search.module.mjs +0 -34
- package/esm2022/angular-firebase-auth.module.mjs +0 -115
- package/esm2022/angular-firestore.module.mjs +0 -483
- package/esm2022/angular-hasura-graphql.module.mjs +0 -265
- package/esm2022/services/catalog/catalog.service.mjs +0 -188
- package/esm2022/services/catalog/index.mjs +0 -8
- package/esm2022/services/catalog/wishlist.service.mjs +0 -116
- package/esm2022/services/home-shop.service.mjs +0 -125
- package/esm2022/services/types/shipping-methods.type.mjs +0 -2
- package/fesm2022/infrab4a-connect-angular.mjs.map +0 -1
- /package/{esm2022 → esm2020}/consts/backend-url.const.mjs +0 -0
- /package/{esm2022 → esm2020}/infrab4a-connect-angular.mjs +0 -0
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { NgModule, InjectionToken, PLATFORM_ID, Injectable, Inject } from '@angular/core';
|
|
3
3
|
import * as i1$4 from '@angular/fire/app';
|
|
4
|
-
import { FirebaseApp, getApp, initializeApp
|
|
4
|
+
import { FirebaseApp, provideFirebaseApp, getApp, initializeApp } from '@angular/fire/app';
|
|
5
5
|
import * as i1$2 from '@infrab4a/connect';
|
|
6
|
-
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, SubscriptionMaterializationFirestoreRepository, SubscriptionSummaryFirestoreRepository, ProductVariantFirestoreRepository, CategoryHasuraGraphQLRepository, ProductHasuraGraphQLRepository, CategoryFilterHasuraGraphQLRepository,
|
|
6
|
+
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, SubscriptionMaterializationFirestoreRepository, SubscriptionSummaryFirestoreRepository, 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';
|
|
7
7
|
import * as i1 from '@angular/fire/auth';
|
|
8
|
-
import { Auth,
|
|
8
|
+
import { Auth, provideAuth, getAuth, getIdToken, authState } from '@angular/fire/auth';
|
|
9
9
|
import { isPlatformBrowser, isPlatformServer } from '@angular/common';
|
|
10
10
|
import * as i1$1 from '@angular/fire/firestore';
|
|
11
|
-
import { Firestore,
|
|
12
|
-
import { combineLatest,
|
|
13
|
-
import { map,
|
|
11
|
+
import { Firestore, provideFirestore, getFirestore, initializeFirestore, memoryLocalCache, docSnapshots, doc } from '@angular/fire/firestore';
|
|
12
|
+
import { combineLatest, from, of, throwError, Subject, iif, forkJoin } from 'rxjs';
|
|
13
|
+
import { map, mergeMap, catchError, concatMap, tap } from 'rxjs/operators';
|
|
14
14
|
import cookie from 'js-cookie';
|
|
15
|
-
import {
|
|
15
|
+
import { __decorate, __metadata } from 'tslib';
|
|
16
16
|
import { Type } from 'class-transformer';
|
|
17
17
|
import * as i1$3 from '@angular/common/http';
|
|
18
18
|
|
|
@@ -25,17 +25,17 @@ class AngularElasticSeachModule {
|
|
|
25
25
|
providers: [{ provide: ES_CONFIG, useValue: options }],
|
|
26
26
|
};
|
|
27
27
|
}
|
|
28
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: AngularElasticSeachModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
29
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.0.3", ngImport: i0, type: AngularElasticSeachModule }); }
|
|
30
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: AngularElasticSeachModule, providers: [
|
|
31
|
-
{
|
|
32
|
-
provide: ProductsIndex,
|
|
33
|
-
useFactory: (configuration) => new ProductsIndex(new AxiosAdapter(configuration)),
|
|
34
|
-
deps: [ES_CONFIG],
|
|
35
|
-
},
|
|
36
|
-
] }); }
|
|
37
28
|
}
|
|
38
|
-
i0.ɵɵ
|
|
29
|
+
AngularElasticSeachModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: AngularElasticSeachModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
30
|
+
AngularElasticSeachModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.1.0", ngImport: i0, type: AngularElasticSeachModule });
|
|
31
|
+
AngularElasticSeachModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: AngularElasticSeachModule, providers: [
|
|
32
|
+
{
|
|
33
|
+
provide: ProductsIndex,
|
|
34
|
+
useFactory: (configuration) => new ProductsIndex(new AxiosAdapter(configuration)),
|
|
35
|
+
deps: [ES_CONFIG],
|
|
36
|
+
},
|
|
37
|
+
] });
|
|
38
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: AngularElasticSeachModule, decorators: [{
|
|
39
39
|
type: NgModule,
|
|
40
40
|
args: [{
|
|
41
41
|
providers: [
|
|
@@ -69,54 +69,54 @@ class AngularFirebaseAuthModule {
|
|
|
69
69
|
],
|
|
70
70
|
};
|
|
71
71
|
}
|
|
72
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: AngularFirebaseAuthModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
73
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.0.3", ngImport: i0, type: AngularFirebaseAuthModule, imports: [i1.AuthModule] }); }
|
|
74
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: AngularFirebaseAuthModule, providers: [
|
|
75
|
-
{
|
|
76
|
-
provide: 'Authentication',
|
|
77
|
-
useFactory: (authenticationService, userRepository) => {
|
|
78
|
-
return new Authentication(authenticationService, userRepository);
|
|
79
|
-
},
|
|
80
|
-
deps: ['AuthenticationService', 'UserRepository'],
|
|
81
|
-
},
|
|
82
|
-
{
|
|
83
|
-
provide: 'AuthenticationService',
|
|
84
|
-
useFactory: (angularFireAuth) => {
|
|
85
|
-
return new AuthenticationFirebaseAuthService(angularFireAuth);
|
|
86
|
-
},
|
|
87
|
-
deps: [Auth],
|
|
88
|
-
},
|
|
89
|
-
{
|
|
90
|
-
provide: 'Register',
|
|
91
|
-
useFactory: (registerService, userRepository) => {
|
|
92
|
-
return new Register(registerService, userRepository);
|
|
93
|
-
},
|
|
94
|
-
deps: ['RegisterService', 'UserRepository'],
|
|
95
|
-
},
|
|
96
|
-
{
|
|
97
|
-
provide: 'RegisterService',
|
|
98
|
-
useFactory: (angularFireAuth) => {
|
|
99
|
-
return new RegisterFirebaseAuthService(angularFireAuth);
|
|
100
|
-
},
|
|
101
|
-
deps: [Auth],
|
|
102
|
-
},
|
|
103
|
-
{
|
|
104
|
-
provide: 'SignOut',
|
|
105
|
-
useFactory: (authenticationService) => {
|
|
106
|
-
return new SignOut(authenticationService);
|
|
107
|
-
},
|
|
108
|
-
deps: ['AuthenticationService'],
|
|
109
|
-
},
|
|
110
|
-
{
|
|
111
|
-
provide: 'RecoveryPassword',
|
|
112
|
-
useFactory: (authenticationService) => {
|
|
113
|
-
return new RecoveryPassword(authenticationService);
|
|
114
|
-
},
|
|
115
|
-
deps: ['AuthenticationService'],
|
|
116
|
-
},
|
|
117
|
-
], imports: [provideAuth((injector) => getAuth(injector.get(FirebaseApp)))] }); }
|
|
118
72
|
}
|
|
119
|
-
i0.ɵɵ
|
|
73
|
+
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.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: AngularFirebaseAuthModule, providers: [
|
|
76
|
+
{
|
|
77
|
+
provide: 'Authentication',
|
|
78
|
+
useFactory: (authenticationService, userRepository) => {
|
|
79
|
+
return new Authentication(authenticationService, userRepository);
|
|
80
|
+
},
|
|
81
|
+
deps: ['AuthenticationService', 'UserRepository'],
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
provide: 'AuthenticationService',
|
|
85
|
+
useFactory: (angularFireAuth) => {
|
|
86
|
+
return new AuthenticationFirebaseAuthService(angularFireAuth);
|
|
87
|
+
},
|
|
88
|
+
deps: [Auth],
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
provide: 'Register',
|
|
92
|
+
useFactory: (registerService, userRepository) => {
|
|
93
|
+
return new Register(registerService, userRepository);
|
|
94
|
+
},
|
|
95
|
+
deps: ['RegisterService', 'UserRepository'],
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
provide: 'RegisterService',
|
|
99
|
+
useFactory: (angularFireAuth) => {
|
|
100
|
+
return new RegisterFirebaseAuthService(angularFireAuth);
|
|
101
|
+
},
|
|
102
|
+
deps: [Auth],
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
provide: 'SignOut',
|
|
106
|
+
useFactory: (authenticationService) => {
|
|
107
|
+
return new SignOut(authenticationService);
|
|
108
|
+
},
|
|
109
|
+
deps: ['AuthenticationService'],
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
provide: 'RecoveryPassword',
|
|
113
|
+
useFactory: (authenticationService) => {
|
|
114
|
+
return new RecoveryPassword(authenticationService);
|
|
115
|
+
},
|
|
116
|
+
deps: ['AuthenticationService'],
|
|
117
|
+
},
|
|
118
|
+
], imports: [provideAuth((injector) => getAuth(injector.get(FirebaseApp)))] });
|
|
119
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: AngularFirebaseAuthModule, decorators: [{
|
|
120
120
|
type: NgModule,
|
|
121
121
|
args: [{
|
|
122
122
|
imports: [provideAuth((injector) => getAuth(injector.get(FirebaseApp)))],
|
|
@@ -185,235 +185,235 @@ class AngularFirestoreModule {
|
|
|
185
185
|
],
|
|
186
186
|
};
|
|
187
187
|
}
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
const interval = setInterval(() => { }, 100);
|
|
200
|
-
request.interval = interval;
|
|
188
|
+
}
|
|
189
|
+
AngularFirestoreModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: AngularFirestoreModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
190
|
+
AngularFirestoreModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.1.0", ngImport: i0, type: AngularFirestoreModule, imports: [AngularElasticSeachModule, i1$1.FirestoreModule] });
|
|
191
|
+
AngularFirestoreModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: AngularFirestoreModule, providers: [
|
|
192
|
+
{
|
|
193
|
+
provide: 'FirestoreOptions',
|
|
194
|
+
useFactory: (firestore, platformId) => ({
|
|
195
|
+
firestore,
|
|
196
|
+
interceptors: {
|
|
197
|
+
request: (request) => {
|
|
198
|
+
if (isPlatformBrowser(platformId))
|
|
201
199
|
return request;
|
|
202
|
-
},
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
200
|
+
const interval = setInterval(() => { }, 100);
|
|
201
|
+
request.interval = interval;
|
|
202
|
+
return request;
|
|
203
|
+
},
|
|
204
|
+
response: (response, request) => {
|
|
205
|
+
if (isPlatformBrowser(platformId))
|
|
207
206
|
return response;
|
|
208
|
-
|
|
207
|
+
clearInterval(request.interval);
|
|
208
|
+
return response;
|
|
209
209
|
},
|
|
210
|
-
}),
|
|
211
|
-
deps: [Firestore, PLATFORM_ID],
|
|
212
|
-
},
|
|
213
|
-
{
|
|
214
|
-
provide: 'BeautyProfileRepository',
|
|
215
|
-
useFactory: (config, userRepository) => {
|
|
216
|
-
return new UserBeautyProfileFirestoreRepository(config, userRepository);
|
|
217
|
-
},
|
|
218
|
-
deps: ['FirestoreOptions', 'UserRepository'],
|
|
219
|
-
},
|
|
220
|
-
{
|
|
221
|
-
provide: 'Buy2WinRepository',
|
|
222
|
-
useFactory: (options) => {
|
|
223
|
-
return new Buy2WinFirestoreRepository(options);
|
|
224
|
-
},
|
|
225
|
-
deps: ['FirestoreOptions'],
|
|
226
|
-
},
|
|
227
|
-
{
|
|
228
|
-
provide: CategoryFirestoreRepository,
|
|
229
|
-
useFactory: (options) => {
|
|
230
|
-
return new CategoryFirestoreRepository(options);
|
|
231
|
-
},
|
|
232
|
-
deps: ['FirestoreOptions'],
|
|
233
|
-
},
|
|
234
|
-
{
|
|
235
|
-
provide: 'CheckoutRepository',
|
|
236
|
-
useFactory: (options) => {
|
|
237
|
-
return new CheckoutFirestoreRepository(options);
|
|
238
|
-
},
|
|
239
|
-
deps: ['FirestoreOptions'],
|
|
240
|
-
},
|
|
241
|
-
{
|
|
242
|
-
provide: 'CheckoutSubscriptionRepository',
|
|
243
|
-
useFactory: (options) => {
|
|
244
|
-
return new CheckoutSubscriptionFirestoreRepository(options);
|
|
245
|
-
},
|
|
246
|
-
deps: ['FirestoreOptions'],
|
|
247
|
-
},
|
|
248
|
-
{
|
|
249
|
-
provide: 'CouponRepository',
|
|
250
|
-
useFactory: (options) => {
|
|
251
|
-
return new CouponFirestoreRepository(options);
|
|
252
|
-
},
|
|
253
|
-
deps: ['FirestoreOptions'],
|
|
254
|
-
},
|
|
255
|
-
{
|
|
256
|
-
provide: 'CampaignHashtagRepository',
|
|
257
|
-
useFactory: (options) => {
|
|
258
|
-
return new CampaignHashtagFirestoreRepository(options);
|
|
259
|
-
},
|
|
260
|
-
deps: ['FirestoreOptions'],
|
|
261
|
-
},
|
|
262
|
-
{
|
|
263
|
-
provide: 'CampaignDashboardRepository',
|
|
264
|
-
useFactory: (options) => {
|
|
265
|
-
return new CampaignDashboardFirestoreRepository(options);
|
|
266
|
-
},
|
|
267
|
-
deps: ['FirestoreOptions'],
|
|
268
|
-
},
|
|
269
|
-
{
|
|
270
|
-
provide: 'EditionRepository',
|
|
271
|
-
useFactory: (options, subscriptionRepository) => {
|
|
272
|
-
return new SubscriptionEditionFirestoreRepository(options, subscriptionRepository);
|
|
273
|
-
},
|
|
274
|
-
deps: ['FirestoreOptions', 'SubscriptionRepository'],
|
|
275
|
-
},
|
|
276
|
-
{
|
|
277
|
-
provide: 'HomeRepository',
|
|
278
|
-
useFactory: (options) => {
|
|
279
|
-
return new HomeFirestoreRepository(options);
|
|
280
|
-
},
|
|
281
|
-
deps: ['FirestoreOptions'],
|
|
282
|
-
},
|
|
283
|
-
{
|
|
284
|
-
provide: 'LeadRepository',
|
|
285
|
-
useFactory: (options) => {
|
|
286
|
-
return new LeadFirestoreRepository(options);
|
|
287
|
-
},
|
|
288
|
-
deps: ['FirestoreOptions'],
|
|
289
|
-
},
|
|
290
|
-
{
|
|
291
|
-
provide: 'LegacyOrderRepository',
|
|
292
|
-
useFactory: (options) => {
|
|
293
|
-
return new LegacyOrderFirestoreRepository(options);
|
|
294
|
-
},
|
|
295
|
-
deps: ['FirestoreOptions'],
|
|
296
|
-
},
|
|
297
|
-
{
|
|
298
|
-
provide: 'ShopMenuRepository',
|
|
299
|
-
useFactory: (options) => {
|
|
300
|
-
return new ShopMenuFirestoreRepository(options);
|
|
301
|
-
},
|
|
302
|
-
deps: ['FirestoreOptions'],
|
|
303
|
-
},
|
|
304
|
-
{
|
|
305
|
-
provide: 'OrderRepository',
|
|
306
|
-
useFactory: (options) => {
|
|
307
|
-
return new OrderFirestoreRepository(options);
|
|
308
|
-
},
|
|
309
|
-
deps: ['FirestoreOptions'],
|
|
310
|
-
},
|
|
311
|
-
{
|
|
312
|
-
provide: 'PaymentRepository',
|
|
313
|
-
useFactory: (options) => {
|
|
314
|
-
return new PaymentFirestoreRepository(options);
|
|
315
|
-
},
|
|
316
|
-
deps: ['FirestoreOptions'],
|
|
317
|
-
},
|
|
318
|
-
{
|
|
319
|
-
provide: ProductFirestoreRepository,
|
|
320
|
-
useFactory: (options) => {
|
|
321
|
-
return new ProductFirestoreRepository(options);
|
|
322
|
-
},
|
|
323
|
-
deps: ['FirestoreOptions'],
|
|
324
|
-
},
|
|
325
|
-
{
|
|
326
|
-
provide: 'ShopSettingsRepository',
|
|
327
|
-
useFactory: (options) => {
|
|
328
|
-
return new ShopSettingsFirestoreRepository(options);
|
|
329
|
-
},
|
|
330
|
-
deps: ['FirestoreOptions'],
|
|
331
|
-
},
|
|
332
|
-
{
|
|
333
|
-
provide: 'SubscriptionPaymentRepository',
|
|
334
|
-
useFactory: (options, subscriptionRepository) => {
|
|
335
|
-
return new SubscriptionPaymentFirestoreRepository(options, subscriptionRepository);
|
|
336
|
-
},
|
|
337
|
-
deps: ['FirestoreOptions', 'SubscriptionRepository'],
|
|
338
|
-
},
|
|
339
|
-
{
|
|
340
|
-
provide: 'SubscriptionPlanRepository',
|
|
341
|
-
useFactory: (options) => {
|
|
342
|
-
return new SubscriptionPlanFirestoreRepository(options);
|
|
343
|
-
},
|
|
344
|
-
deps: ['FirestoreOptions'],
|
|
345
|
-
},
|
|
346
|
-
{
|
|
347
|
-
provide: 'SubscriptionProductRepository',
|
|
348
|
-
useFactory: (options) => {
|
|
349
|
-
return new SubscriptionProductFirestoreRepository(options);
|
|
350
|
-
},
|
|
351
|
-
deps: ['FirestoreOptions'],
|
|
352
|
-
},
|
|
353
|
-
{
|
|
354
|
-
provide: 'SubscriptionRepository',
|
|
355
|
-
useFactory: (options) => {
|
|
356
|
-
return new SubscriptionFirestoreRepository(options);
|
|
357
|
-
},
|
|
358
|
-
deps: ['FirestoreOptions'],
|
|
359
|
-
},
|
|
360
|
-
{
|
|
361
|
-
provide: 'UserRepository',
|
|
362
|
-
useFactory: (options) => {
|
|
363
|
-
return new UserFirestoreRepository(options);
|
|
364
|
-
},
|
|
365
|
-
deps: ['FirestoreOptions'],
|
|
366
|
-
},
|
|
367
|
-
{
|
|
368
|
-
provide: 'UserAddressRepository',
|
|
369
|
-
useFactory: (options, userRepository) => {
|
|
370
|
-
return new UserAddressFirestoreRepository(options, userRepository);
|
|
371
|
-
},
|
|
372
|
-
deps: ['FirestoreOptions', 'UserRepository'],
|
|
373
|
-
},
|
|
374
|
-
{
|
|
375
|
-
provide: 'UserPaymentMethodRepository',
|
|
376
|
-
useFactory: (options, userRepository) => {
|
|
377
|
-
return new UserPaymentMethodFirestoreRepository(options, userRepository);
|
|
378
|
-
},
|
|
379
|
-
deps: ['FirestoreOptions', 'UserRepository'],
|
|
380
|
-
},
|
|
381
|
-
{
|
|
382
|
-
provide: 'SubscriptionMaterializationRepository',
|
|
383
|
-
useFactory: (options) => {
|
|
384
|
-
return new SubscriptionMaterializationFirestoreRepository(options);
|
|
385
210
|
},
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
return
|
|
414
|
-
}
|
|
415
|
-
|
|
416
|
-
|
|
211
|
+
}),
|
|
212
|
+
deps: [Firestore, PLATFORM_ID],
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
provide: 'BeautyProfileRepository',
|
|
216
|
+
useFactory: (config, userRepository) => {
|
|
217
|
+
return new UserBeautyProfileFirestoreRepository(config, userRepository);
|
|
218
|
+
},
|
|
219
|
+
deps: ['FirestoreOptions', 'UserRepository'],
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
provide: 'Buy2WinRepository',
|
|
223
|
+
useFactory: (options) => {
|
|
224
|
+
return new Buy2WinFirestoreRepository(options);
|
|
225
|
+
},
|
|
226
|
+
deps: ['FirestoreOptions'],
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
provide: CategoryFirestoreRepository,
|
|
230
|
+
useFactory: (options) => {
|
|
231
|
+
return new CategoryFirestoreRepository(options);
|
|
232
|
+
},
|
|
233
|
+
deps: ['FirestoreOptions'],
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
provide: 'CheckoutRepository',
|
|
237
|
+
useFactory: (options) => {
|
|
238
|
+
return new CheckoutFirestoreRepository(options);
|
|
239
|
+
},
|
|
240
|
+
deps: ['FirestoreOptions'],
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
provide: 'CheckoutSubscriptionRepository',
|
|
244
|
+
useFactory: (options) => {
|
|
245
|
+
return new CheckoutSubscriptionFirestoreRepository(options);
|
|
246
|
+
},
|
|
247
|
+
deps: ['FirestoreOptions'],
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
provide: 'CouponRepository',
|
|
251
|
+
useFactory: (options) => {
|
|
252
|
+
return new CouponFirestoreRepository(options);
|
|
253
|
+
},
|
|
254
|
+
deps: ['FirestoreOptions'],
|
|
255
|
+
},
|
|
256
|
+
{
|
|
257
|
+
provide: 'CampaignHashtagRepository',
|
|
258
|
+
useFactory: (options) => {
|
|
259
|
+
return new CampaignHashtagFirestoreRepository(options);
|
|
260
|
+
},
|
|
261
|
+
deps: ['FirestoreOptions'],
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
provide: 'CampaignDashboardRepository',
|
|
265
|
+
useFactory: (options) => {
|
|
266
|
+
return new CampaignDashboardFirestoreRepository(options);
|
|
267
|
+
},
|
|
268
|
+
deps: ['FirestoreOptions'],
|
|
269
|
+
},
|
|
270
|
+
{
|
|
271
|
+
provide: 'EditionRepository',
|
|
272
|
+
useFactory: (options, subscriptionRepository) => {
|
|
273
|
+
return new SubscriptionEditionFirestoreRepository(options, subscriptionRepository);
|
|
274
|
+
},
|
|
275
|
+
deps: ['FirestoreOptions', 'SubscriptionRepository'],
|
|
276
|
+
},
|
|
277
|
+
{
|
|
278
|
+
provide: 'HomeRepository',
|
|
279
|
+
useFactory: (options) => {
|
|
280
|
+
return new HomeFirestoreRepository(options);
|
|
281
|
+
},
|
|
282
|
+
deps: ['FirestoreOptions'],
|
|
283
|
+
},
|
|
284
|
+
{
|
|
285
|
+
provide: 'LeadRepository',
|
|
286
|
+
useFactory: (options) => {
|
|
287
|
+
return new LeadFirestoreRepository(options);
|
|
288
|
+
},
|
|
289
|
+
deps: ['FirestoreOptions'],
|
|
290
|
+
},
|
|
291
|
+
{
|
|
292
|
+
provide: 'LegacyOrderRepository',
|
|
293
|
+
useFactory: (options) => {
|
|
294
|
+
return new LegacyOrderFirestoreRepository(options);
|
|
295
|
+
},
|
|
296
|
+
deps: ['FirestoreOptions'],
|
|
297
|
+
},
|
|
298
|
+
{
|
|
299
|
+
provide: 'ShopMenuRepository',
|
|
300
|
+
useFactory: (options) => {
|
|
301
|
+
return new ShopMenuFirestoreRepository(options);
|
|
302
|
+
},
|
|
303
|
+
deps: ['FirestoreOptions'],
|
|
304
|
+
},
|
|
305
|
+
{
|
|
306
|
+
provide: 'OrderRepository',
|
|
307
|
+
useFactory: (options) => {
|
|
308
|
+
return new OrderFirestoreRepository(options);
|
|
309
|
+
},
|
|
310
|
+
deps: ['FirestoreOptions'],
|
|
311
|
+
},
|
|
312
|
+
{
|
|
313
|
+
provide: 'PaymentRepository',
|
|
314
|
+
useFactory: (options) => {
|
|
315
|
+
return new PaymentFirestoreRepository(options);
|
|
316
|
+
},
|
|
317
|
+
deps: ['FirestoreOptions'],
|
|
318
|
+
},
|
|
319
|
+
{
|
|
320
|
+
provide: ProductFirestoreRepository,
|
|
321
|
+
useFactory: (options) => {
|
|
322
|
+
return new ProductFirestoreRepository(options);
|
|
323
|
+
},
|
|
324
|
+
deps: ['FirestoreOptions'],
|
|
325
|
+
},
|
|
326
|
+
{
|
|
327
|
+
provide: 'ShopSettingsRepository',
|
|
328
|
+
useFactory: (options) => {
|
|
329
|
+
return new ShopSettingsFirestoreRepository(options);
|
|
330
|
+
},
|
|
331
|
+
deps: ['FirestoreOptions'],
|
|
332
|
+
},
|
|
333
|
+
{
|
|
334
|
+
provide: 'SubscriptionPaymentRepository',
|
|
335
|
+
useFactory: (options, subscriptionRepository) => {
|
|
336
|
+
return new SubscriptionPaymentFirestoreRepository(options, subscriptionRepository);
|
|
337
|
+
},
|
|
338
|
+
deps: ['FirestoreOptions', 'SubscriptionRepository'],
|
|
339
|
+
},
|
|
340
|
+
{
|
|
341
|
+
provide: 'SubscriptionPlanRepository',
|
|
342
|
+
useFactory: (options) => {
|
|
343
|
+
return new SubscriptionPlanFirestoreRepository(options);
|
|
344
|
+
},
|
|
345
|
+
deps: ['FirestoreOptions'],
|
|
346
|
+
},
|
|
347
|
+
{
|
|
348
|
+
provide: 'SubscriptionProductRepository',
|
|
349
|
+
useFactory: (options) => {
|
|
350
|
+
return new SubscriptionProductFirestoreRepository(options);
|
|
351
|
+
},
|
|
352
|
+
deps: ['FirestoreOptions'],
|
|
353
|
+
},
|
|
354
|
+
{
|
|
355
|
+
provide: 'SubscriptionRepository',
|
|
356
|
+
useFactory: (options) => {
|
|
357
|
+
return new SubscriptionFirestoreRepository(options);
|
|
358
|
+
},
|
|
359
|
+
deps: ['FirestoreOptions'],
|
|
360
|
+
},
|
|
361
|
+
{
|
|
362
|
+
provide: 'UserRepository',
|
|
363
|
+
useFactory: (options) => {
|
|
364
|
+
return new UserFirestoreRepository(options);
|
|
365
|
+
},
|
|
366
|
+
deps: ['FirestoreOptions'],
|
|
367
|
+
},
|
|
368
|
+
{
|
|
369
|
+
provide: 'UserAddressRepository',
|
|
370
|
+
useFactory: (options, userRepository) => {
|
|
371
|
+
return new UserAddressFirestoreRepository(options, userRepository);
|
|
372
|
+
},
|
|
373
|
+
deps: ['FirestoreOptions', 'UserRepository'],
|
|
374
|
+
},
|
|
375
|
+
{
|
|
376
|
+
provide: 'UserPaymentMethodRepository',
|
|
377
|
+
useFactory: (options, userRepository) => {
|
|
378
|
+
return new UserPaymentMethodFirestoreRepository(options, userRepository);
|
|
379
|
+
},
|
|
380
|
+
deps: ['FirestoreOptions', 'UserRepository'],
|
|
381
|
+
},
|
|
382
|
+
{
|
|
383
|
+
provide: 'SubscriptionMaterializationRepository',
|
|
384
|
+
useFactory: (options) => {
|
|
385
|
+
return new SubscriptionMaterializationFirestoreRepository(options);
|
|
386
|
+
},
|
|
387
|
+
deps: ['FirestoreOptions'],
|
|
388
|
+
},
|
|
389
|
+
{
|
|
390
|
+
provide: 'SubscriptionSummaryRepository',
|
|
391
|
+
useFactory: (options) => {
|
|
392
|
+
return new SubscriptionSummaryFirestoreRepository(options);
|
|
393
|
+
},
|
|
394
|
+
deps: ['FirestoreOptions'],
|
|
395
|
+
},
|
|
396
|
+
{
|
|
397
|
+
provide: ProductVariantFirestoreRepository,
|
|
398
|
+
useFactory: (options, productRepository) => {
|
|
399
|
+
return new ProductVariantFirestoreRepository(options, productRepository);
|
|
400
|
+
},
|
|
401
|
+
deps: ['FirestoreOptions', ProductFirestoreRepository],
|
|
402
|
+
},
|
|
403
|
+
], imports: [AngularElasticSeachModule,
|
|
404
|
+
provideFirestore((injector) => {
|
|
405
|
+
const platformId = injector.get(PLATFORM_ID);
|
|
406
|
+
if (isPlatformServer(platformId))
|
|
407
|
+
return getFirestore(injector.get(FirebaseApp));
|
|
408
|
+
if (!MobileOperationSystemCheckerHelper.isAppleDevice())
|
|
409
|
+
return getFirestore(injector.get(FirebaseApp));
|
|
410
|
+
const firestore = initializeFirestore(injector.get(FirebaseApp), {
|
|
411
|
+
experimentalForceLongPolling: true,
|
|
412
|
+
localCache: memoryLocalCache(),
|
|
413
|
+
});
|
|
414
|
+
return firestore;
|
|
415
|
+
})] });
|
|
416
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: AngularFirestoreModule, decorators: [{
|
|
417
417
|
type: NgModule,
|
|
418
418
|
args: [{
|
|
419
419
|
imports: [
|
|
@@ -654,132 +654,121 @@ class AngularHasuraGraphQLModule {
|
|
|
654
654
|
providers: [{ provide: HASURA_OPTIONS, useValue: options }],
|
|
655
655
|
};
|
|
656
656
|
}
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
const interval = setInterval(() => { }, 100);
|
|
670
|
-
request.interval = interval;
|
|
657
|
+
}
|
|
658
|
+
AngularHasuraGraphQLModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: AngularHasuraGraphQLModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
659
|
+
AngularHasuraGraphQLModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.1.0", ngImport: i0, type: AngularHasuraGraphQLModule });
|
|
660
|
+
AngularHasuraGraphQLModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: AngularHasuraGraphQLModule, providers: [
|
|
661
|
+
{
|
|
662
|
+
provide: 'HasuraConfig',
|
|
663
|
+
useFactory: (options, platformId) => ({
|
|
664
|
+
endpoint: options.endpoint,
|
|
665
|
+
authOptions: options.credentials,
|
|
666
|
+
interceptors: {
|
|
667
|
+
request: (request) => {
|
|
668
|
+
if (isPlatformBrowser(platformId))
|
|
671
669
|
return request;
|
|
672
|
-
},
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
670
|
+
const interval = setInterval(() => { }, 100);
|
|
671
|
+
request.interval = interval;
|
|
672
|
+
return request;
|
|
673
|
+
},
|
|
674
|
+
response: (response, request) => {
|
|
675
|
+
if (isPlatformBrowser(platformId))
|
|
677
676
|
return response;
|
|
678
|
-
|
|
677
|
+
clearInterval(request.interval);
|
|
678
|
+
return response;
|
|
679
679
|
},
|
|
680
|
-
}),
|
|
681
|
-
deps: [HASURA_OPTIONS, PLATFORM_ID],
|
|
682
|
-
},
|
|
683
|
-
{
|
|
684
|
-
provide: 'CategoryRepository',
|
|
685
|
-
useExisting: CategoryHasuraGraphQLRepository,
|
|
686
|
-
},
|
|
687
|
-
{
|
|
688
|
-
provide: CategoryHasuraGraphQLRepository,
|
|
689
|
-
useFactory: (options, productRepository, categoryFilterRepository) => {
|
|
690
|
-
return new CategoryHasuraGraphQLRepository(options, productRepository, categoryFilterRepository);
|
|
691
|
-
},
|
|
692
|
-
deps: ['HasuraConfig', ProductHasuraGraphQLRepository, CategoryFilterHasuraGraphQLRepository],
|
|
693
|
-
},
|
|
694
|
-
{
|
|
695
|
-
provide: 'ProductRepository',
|
|
696
|
-
useExisting: ProductHasuraGraphQLRepository,
|
|
697
|
-
},
|
|
698
|
-
{
|
|
699
|
-
provide: ProductHasuraGraphQLRepository,
|
|
700
|
-
useFactory: (hasuraConfig) => {
|
|
701
|
-
return new ProductHasuraGraphQLRepository(hasuraConfig);
|
|
702
|
-
},
|
|
703
|
-
deps: ['HasuraConfig'],
|
|
704
|
-
},
|
|
705
|
-
{
|
|
706
|
-
provide: 'ProductReviewsRepository',
|
|
707
|
-
useExisting: ProductReviewsHasuraGraphQLRepository,
|
|
708
|
-
},
|
|
709
|
-
{
|
|
710
|
-
provide: ProductReviewsHasuraGraphQLRepository,
|
|
711
|
-
useFactory: (hasuraConfig) => {
|
|
712
|
-
return new ProductReviewsHasuraGraphQLRepository(hasuraConfig);
|
|
713
|
-
},
|
|
714
|
-
deps: ['HasuraConfig'],
|
|
715
|
-
},
|
|
716
|
-
{
|
|
717
|
-
provide: 'VariantRepository',
|
|
718
|
-
useExisting: VariantHasuraGraphQLRepository,
|
|
719
|
-
},
|
|
720
|
-
{
|
|
721
|
-
provide: VariantHasuraGraphQLRepository,
|
|
722
|
-
useFactory: (hasuraConfig) => {
|
|
723
|
-
return new VariantHasuraGraphQLRepository(hasuraConfig);
|
|
724
|
-
},
|
|
725
|
-
deps: ['HasuraConfig'],
|
|
726
|
-
},
|
|
727
|
-
{
|
|
728
|
-
provide: 'CategoryFilterRepository',
|
|
729
|
-
useExisting: CategoryFilterHasuraGraphQLRepository,
|
|
730
|
-
},
|
|
731
|
-
{
|
|
732
|
-
provide: CategoryFilterHasuraGraphQLRepository,
|
|
733
|
-
useFactory: (options) => {
|
|
734
|
-
return new CategoryFilterHasuraGraphQLRepository(options);
|
|
735
|
-
},
|
|
736
|
-
deps: ['HasuraConfig'],
|
|
737
|
-
},
|
|
738
|
-
{
|
|
739
|
-
provide: 'FilterOptionRepository',
|
|
740
|
-
useExisting: FilterOptionHasuraGraphQLRepository,
|
|
741
|
-
},
|
|
742
|
-
{
|
|
743
|
-
provide: FilterOptionHasuraGraphQLRepository,
|
|
744
|
-
useFactory: (options) => {
|
|
745
|
-
return new FilterOptionHasuraGraphQLRepository(options);
|
|
746
|
-
},
|
|
747
|
-
deps: ['HasuraConfig'],
|
|
748
|
-
},
|
|
749
|
-
{
|
|
750
|
-
provide: 'FilterRepository',
|
|
751
|
-
useExisting: FilterHasuraGraphQLRepository,
|
|
752
|
-
},
|
|
753
|
-
{
|
|
754
|
-
provide: FilterHasuraGraphQLRepository,
|
|
755
|
-
useFactory: (options, filterOptionRepository, categoryFilterRepository) => {
|
|
756
|
-
return new FilterHasuraGraphQLRepository(options, filterOptionRepository, categoryFilterRepository);
|
|
757
|
-
},
|
|
758
|
-
deps: ['HasuraConfig', FilterOptionHasuraGraphQLRepository, CategoryFilterHasuraGraphQLRepository],
|
|
759
|
-
},
|
|
760
|
-
{
|
|
761
|
-
provide: CategoryCollectionChildrenHasuraGraphQLRepository,
|
|
762
|
-
useFactory: (options) => new CategoryCollectionChildrenHasuraGraphQLRepository(options),
|
|
763
|
-
deps: ['HasuraConfig'],
|
|
764
|
-
},
|
|
765
|
-
{
|
|
766
|
-
provide: 'CategoryCollectionChildrenRepository',
|
|
767
|
-
useExisting: CategoryCollectionChildrenHasuraGraphQLRepository,
|
|
768
|
-
},
|
|
769
|
-
{
|
|
770
|
-
provide: WishlistHasuraGraphQLRepository,
|
|
771
|
-
useFactory: (options, categoryFilterRepository) => {
|
|
772
|
-
return new WishlistHasuraGraphQLRepository(options, categoryFilterRepository);
|
|
773
680
|
},
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
681
|
+
}),
|
|
682
|
+
deps: [HASURA_OPTIONS, PLATFORM_ID],
|
|
683
|
+
},
|
|
684
|
+
{
|
|
685
|
+
provide: 'CategoryRepository',
|
|
686
|
+
useExisting: CategoryHasuraGraphQLRepository,
|
|
687
|
+
},
|
|
688
|
+
{
|
|
689
|
+
provide: CategoryHasuraGraphQLRepository,
|
|
690
|
+
useFactory: (options, productRepository, categoryFilterRepository) => {
|
|
691
|
+
return new CategoryHasuraGraphQLRepository(options, productRepository, categoryFilterRepository);
|
|
692
|
+
},
|
|
693
|
+
deps: ['HasuraConfig', ProductHasuraGraphQLRepository, CategoryFilterHasuraGraphQLRepository],
|
|
694
|
+
},
|
|
695
|
+
{
|
|
696
|
+
provide: 'ProductRepository',
|
|
697
|
+
useExisting: ProductHasuraGraphQLRepository,
|
|
698
|
+
},
|
|
699
|
+
{
|
|
700
|
+
provide: ProductHasuraGraphQLRepository,
|
|
701
|
+
useFactory: (hasuraConfig) => {
|
|
702
|
+
return new ProductHasuraGraphQLRepository(hasuraConfig);
|
|
703
|
+
},
|
|
704
|
+
deps: ['HasuraConfig'],
|
|
705
|
+
},
|
|
706
|
+
{
|
|
707
|
+
provide: 'VariantRepository',
|
|
708
|
+
useExisting: VariantHasuraGraphQLRepository,
|
|
709
|
+
},
|
|
710
|
+
{
|
|
711
|
+
provide: VariantHasuraGraphQLRepository,
|
|
712
|
+
useFactory: (hasuraConfig) => {
|
|
713
|
+
return new VariantHasuraGraphQLRepository(hasuraConfig);
|
|
714
|
+
},
|
|
715
|
+
deps: ['HasuraConfig'],
|
|
716
|
+
},
|
|
717
|
+
{
|
|
718
|
+
provide: 'CategoryFilterRepository',
|
|
719
|
+
useExisting: CategoryFilterHasuraGraphQLRepository,
|
|
720
|
+
},
|
|
721
|
+
{
|
|
722
|
+
provide: CategoryFilterHasuraGraphQLRepository,
|
|
723
|
+
useFactory: (options) => {
|
|
724
|
+
return new CategoryFilterHasuraGraphQLRepository(options);
|
|
725
|
+
},
|
|
726
|
+
deps: ['HasuraConfig'],
|
|
727
|
+
},
|
|
728
|
+
{
|
|
729
|
+
provide: 'FilterOptionRepository',
|
|
730
|
+
useExisting: FilterOptionHasuraGraphQLRepository,
|
|
731
|
+
},
|
|
732
|
+
{
|
|
733
|
+
provide: FilterOptionHasuraGraphQLRepository,
|
|
734
|
+
useFactory: (options) => {
|
|
735
|
+
return new FilterOptionHasuraGraphQLRepository(options);
|
|
736
|
+
},
|
|
737
|
+
deps: ['HasuraConfig'],
|
|
738
|
+
},
|
|
739
|
+
{
|
|
740
|
+
provide: 'FilterRepository',
|
|
741
|
+
useExisting: FilterHasuraGraphQLRepository,
|
|
742
|
+
},
|
|
743
|
+
{
|
|
744
|
+
provide: FilterHasuraGraphQLRepository,
|
|
745
|
+
useFactory: (options, filterOptionRepository, categoryFilterRepository) => {
|
|
746
|
+
return new FilterHasuraGraphQLRepository(options, filterOptionRepository, categoryFilterRepository);
|
|
747
|
+
},
|
|
748
|
+
deps: ['HasuraConfig', FilterOptionHasuraGraphQLRepository, CategoryFilterHasuraGraphQLRepository],
|
|
749
|
+
},
|
|
750
|
+
{
|
|
751
|
+
provide: CategoryCollectionChildrenHasuraGraphQLRepository,
|
|
752
|
+
useFactory: (options) => new CategoryCollectionChildrenHasuraGraphQLRepository(options),
|
|
753
|
+
deps: ['HasuraConfig'],
|
|
754
|
+
},
|
|
755
|
+
{
|
|
756
|
+
provide: 'CategoryCollectionChildrenRepository',
|
|
757
|
+
useExisting: CategoryCollectionChildrenHasuraGraphQLRepository,
|
|
758
|
+
},
|
|
759
|
+
{
|
|
760
|
+
provide: WishlistHasuraGraphQLRepository,
|
|
761
|
+
useFactory: (options, categoryFilterRepository) => {
|
|
762
|
+
return new WishlistHasuraGraphQLRepository(options, categoryFilterRepository);
|
|
763
|
+
},
|
|
764
|
+
deps: ['HasuraConfig', CategoryFilterHasuraGraphQLRepository],
|
|
765
|
+
},
|
|
766
|
+
{
|
|
767
|
+
provide: 'WishlistRepository',
|
|
768
|
+
useExisting: WishlistHasuraGraphQLRepository,
|
|
769
|
+
},
|
|
770
|
+
] });
|
|
771
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: AngularHasuraGraphQLModule, decorators: [{
|
|
783
772
|
type: NgModule,
|
|
784
773
|
args: [{
|
|
785
774
|
providers: [
|
|
@@ -828,17 +817,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.3", ngImpor
|
|
|
828
817
|
},
|
|
829
818
|
deps: ['HasuraConfig'],
|
|
830
819
|
},
|
|
831
|
-
{
|
|
832
|
-
provide: 'ProductReviewsRepository',
|
|
833
|
-
useExisting: ProductReviewsHasuraGraphQLRepository,
|
|
834
|
-
},
|
|
835
|
-
{
|
|
836
|
-
provide: ProductReviewsHasuraGraphQLRepository,
|
|
837
|
-
useFactory: (hasuraConfig) => {
|
|
838
|
-
return new ProductReviewsHasuraGraphQLRepository(hasuraConfig);
|
|
839
|
-
},
|
|
840
|
-
deps: ['HasuraConfig'],
|
|
841
|
-
},
|
|
842
820
|
{
|
|
843
821
|
provide: 'VariantRepository',
|
|
844
822
|
useExisting: VariantHasuraGraphQLRepository,
|
|
@@ -928,15 +906,15 @@ class AuthService {
|
|
|
928
906
|
getFireUser() {
|
|
929
907
|
return authState(this.angularFireAuth).pipe(catchError(() => of(null)));
|
|
930
908
|
}
|
|
931
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: AuthService, deps: [{ token: i1.Auth }, { token: 'UserRepository' }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
932
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: AuthService }); }
|
|
933
909
|
}
|
|
934
|
-
i0.ɵɵ
|
|
910
|
+
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 });
|
|
911
|
+
AuthService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: AuthService });
|
|
912
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: AuthService, decorators: [{
|
|
935
913
|
type: Injectable
|
|
936
|
-
}], ctorParameters: ()
|
|
914
|
+
}], ctorParameters: function () { return [{ type: i1.Auth }, { type: undefined, decorators: [{
|
|
937
915
|
type: Inject,
|
|
938
916
|
args: ['UserRepository']
|
|
939
|
-
}] }] });
|
|
917
|
+
}] }]; } });
|
|
940
918
|
|
|
941
919
|
class CouponService {
|
|
942
920
|
constructor(couponRepository, defaultShop, orderRepository, categoryRepository) {
|
|
@@ -1127,15 +1105,15 @@ class CouponService {
|
|
|
1127
1105
|
}
|
|
1128
1106
|
return couponUseLimits;
|
|
1129
1107
|
}
|
|
1130
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: CouponService, deps: [{ token: 'CouponRepository' }, { token: DEFAULT_SHOP }, { token: 'OrderRepository' }, { token: 'CategoryRepository' }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1131
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: CouponService, providedIn: 'root' }); }
|
|
1132
1108
|
}
|
|
1133
|
-
i0.ɵɵ
|
|
1109
|
+
CouponService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: CouponService, deps: [{ token: 'CouponRepository' }, { token: DEFAULT_SHOP }, { token: 'OrderRepository' }, { token: 'CategoryRepository' }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1110
|
+
CouponService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: CouponService, providedIn: 'root' });
|
|
1111
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: CouponService, decorators: [{
|
|
1134
1112
|
type: Injectable,
|
|
1135
1113
|
args: [{
|
|
1136
1114
|
providedIn: 'root',
|
|
1137
1115
|
}]
|
|
1138
|
-
}], ctorParameters: ()
|
|
1116
|
+
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
1139
1117
|
type: Inject,
|
|
1140
1118
|
args: ['CouponRepository']
|
|
1141
1119
|
}] }, { type: i1$2.Shops, decorators: [{
|
|
@@ -1147,7 +1125,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.3", ngImpor
|
|
|
1147
1125
|
}] }, { type: undefined, decorators: [{
|
|
1148
1126
|
type: Inject,
|
|
1149
1127
|
args: ['CategoryRepository']
|
|
1150
|
-
}] }] });
|
|
1128
|
+
}] }]; } });
|
|
1151
1129
|
|
|
1152
1130
|
class CheckoutService {
|
|
1153
1131
|
constructor(couponService, checkoutRepository, orderRepository, userRepository, defaultShop) {
|
|
@@ -1191,12 +1169,12 @@ class CheckoutService {
|
|
|
1191
1169
|
cookie.set('checkoutId', checkout.id);
|
|
1192
1170
|
return checkout;
|
|
1193
1171
|
}
|
|
1194
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: CheckoutService, deps: [{ token: CouponService }, { token: 'CheckoutRepository' }, { token: 'OrderRepository' }, { token: 'UserRepository' }, { token: DEFAULT_SHOP }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1195
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: CheckoutService }); }
|
|
1196
1172
|
}
|
|
1197
|
-
i0.ɵɵ
|
|
1173
|
+
CheckoutService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: CheckoutService, deps: [{ token: CouponService }, { token: 'CheckoutRepository' }, { token: 'OrderRepository' }, { token: 'UserRepository' }, { token: DEFAULT_SHOP }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1174
|
+
CheckoutService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: CheckoutService });
|
|
1175
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: CheckoutService, decorators: [{
|
|
1198
1176
|
type: Injectable
|
|
1199
|
-
}], ctorParameters: ()
|
|
1177
|
+
}], ctorParameters: function () { return [{ type: CouponService }, { type: undefined, decorators: [{
|
|
1200
1178
|
type: Inject,
|
|
1201
1179
|
args: ['CheckoutRepository']
|
|
1202
1180
|
}] }, { type: undefined, decorators: [{
|
|
@@ -1208,7 +1186,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.3", ngImpor
|
|
|
1208
1186
|
}] }, { type: i1$2.Shops, decorators: [{
|
|
1209
1187
|
type: Inject,
|
|
1210
1188
|
args: [DEFAULT_SHOP]
|
|
1211
|
-
}] }] });
|
|
1189
|
+
}] }]; } });
|
|
1212
1190
|
|
|
1213
1191
|
class CartService {
|
|
1214
1192
|
constructor(authService, checkoutService, defaultShop, productRepository, categoryRepository, variantRepository, buy2WinRepository) {
|
|
@@ -1385,8 +1363,8 @@ class CartService {
|
|
|
1385
1363
|
return { ...checkout, lineItems: notGiftItems };
|
|
1386
1364
|
const elegibleCampaigns = [];
|
|
1387
1365
|
for (const campaign of campaigns) {
|
|
1388
|
-
const today = new Date().
|
|
1389
|
-
if (!(campaign.startDate.
|
|
1366
|
+
const today = new Date().getDate();
|
|
1367
|
+
if (!(campaign.startDate.getDate() <= today) && !(campaign.endDate.getDate() >= today))
|
|
1390
1368
|
continue;
|
|
1391
1369
|
if (campaign.activeCategory) {
|
|
1392
1370
|
const categoriesCampaing = campaign.categories.map((c) => c.id.toString());
|
|
@@ -1458,12 +1436,12 @@ class CartService {
|
|
|
1458
1436
|
});
|
|
1459
1437
|
});
|
|
1460
1438
|
}
|
|
1461
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: CartService, deps: [{ token: AuthService }, { token: CheckoutService }, { token: DEFAULT_SHOP }, { token: 'ProductRepository' }, { token: 'CategoryRepository' }, { token: 'VariantRepository' }, { token: 'Buy2WinRepository' }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1462
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: CartService }); }
|
|
1463
1439
|
}
|
|
1464
|
-
i0.ɵɵ
|
|
1440
|
+
CartService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: CartService, deps: [{ token: AuthService }, { token: CheckoutService }, { token: DEFAULT_SHOP }, { token: 'ProductRepository' }, { token: 'CategoryRepository' }, { token: 'VariantRepository' }, { token: 'Buy2WinRepository' }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1441
|
+
CartService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: CartService });
|
|
1442
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: CartService, decorators: [{
|
|
1465
1443
|
type: Injectable
|
|
1466
|
-
}], ctorParameters: ()
|
|
1444
|
+
}], ctorParameters: function () { return [{ type: AuthService }, { type: CheckoutService }, { type: i1$2.Shops, decorators: [{
|
|
1467
1445
|
type: Inject,
|
|
1468
1446
|
args: [DEFAULT_SHOP]
|
|
1469
1447
|
}] }, { type: undefined, decorators: [{
|
|
@@ -1478,65 +1456,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.3", ngImpor
|
|
|
1478
1456
|
}] }, { type: i1$2.Buy2WinFirestoreRepository, decorators: [{
|
|
1479
1457
|
type: Inject,
|
|
1480
1458
|
args: ['Buy2WinRepository']
|
|
1481
|
-
}] }] });
|
|
1482
|
-
|
|
1483
|
-
class NewCategoryStructureAdapter {
|
|
1484
|
-
constructor(categoryRepository) {
|
|
1485
|
-
this.categoryRepository = categoryRepository;
|
|
1486
|
-
}
|
|
1487
|
-
async buildProductFilterByCategory(category) {
|
|
1488
|
-
const loadedCategory = await this.getCategory(category);
|
|
1489
|
-
if (loadedCategory.isCollection)
|
|
1490
|
-
return { id: { operator: Where.IN, value: loadedCategory.products } };
|
|
1491
|
-
const categoryIds = [...(await this.getAllCategoriesIdFromCategory(category)), category.id.toString()];
|
|
1492
|
-
return {
|
|
1493
|
-
category: {
|
|
1494
|
-
id: {
|
|
1495
|
-
operator: Where.IN,
|
|
1496
|
-
value: categoryIds,
|
|
1497
|
-
},
|
|
1498
|
-
},
|
|
1499
|
-
};
|
|
1500
|
-
}
|
|
1501
|
-
async getAllCategoriesIdFromCategory(category) {
|
|
1502
|
-
return this.categoryRepository
|
|
1503
|
-
.getChildren(+category.id)
|
|
1504
|
-
.then((categories) => categories.map((category) => category.id.toString()));
|
|
1505
|
-
}
|
|
1506
|
-
async getCategory(category) {
|
|
1507
|
-
return isNil(category.isCollection) || (category.isCollection && !category.products?.length)
|
|
1508
|
-
? this.categoryRepository.get({ id: category.id })
|
|
1509
|
-
: category;
|
|
1510
|
-
}
|
|
1511
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: NewCategoryStructureAdapter, deps: [{ token: 'CategoryRepository' }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1512
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: NewCategoryStructureAdapter }); }
|
|
1513
|
-
}
|
|
1514
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: NewCategoryStructureAdapter, decorators: [{
|
|
1515
|
-
type: Injectable
|
|
1516
|
-
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
1517
|
-
type: Inject,
|
|
1518
|
-
args: ['CategoryRepository']
|
|
1519
|
-
}] }] });
|
|
1520
|
-
|
|
1521
|
-
class OldCategoryStructureAdapter {
|
|
1522
|
-
constructor(categoryRepository) {
|
|
1523
|
-
this.categoryRepository = categoryRepository;
|
|
1524
|
-
}
|
|
1525
|
-
async buildProductFilterByCategory(category) {
|
|
1526
|
-
const productsIds = category.products?.length
|
|
1527
|
-
? category.products
|
|
1528
|
-
: await this.categoryRepository.get({ id: category.id }).then((categoryFound) => categoryFound.products);
|
|
1529
|
-
return { id: { operator: Where.IN, value: productsIds } };
|
|
1530
|
-
}
|
|
1531
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: OldCategoryStructureAdapter, deps: [{ token: 'CategoryRepository' }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1532
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: OldCategoryStructureAdapter }); }
|
|
1533
|
-
}
|
|
1534
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: OldCategoryStructureAdapter, decorators: [{
|
|
1535
|
-
type: Injectable
|
|
1536
|
-
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
1537
|
-
type: Inject,
|
|
1538
|
-
args: ['CategoryRepository']
|
|
1539
|
-
}] }] });
|
|
1459
|
+
}] }]; } });
|
|
1540
1460
|
|
|
1541
1461
|
class CatalogService {
|
|
1542
1462
|
constructor(productRepository, categoryStructureAdapter, shop, productIndex) {
|
|
@@ -1544,7 +1464,6 @@ class CatalogService {
|
|
|
1544
1464
|
this.categoryStructureAdapter = categoryStructureAdapter;
|
|
1545
1465
|
this.shop = shop;
|
|
1546
1466
|
this.productIndex = productIndex;
|
|
1547
|
-
this.productsByTerm = {};
|
|
1548
1467
|
this.buildFilterQuery = ({ clubDiscount, brands, prices, gender, tags, rate, customOptions, }) => {
|
|
1549
1468
|
const filters = {};
|
|
1550
1469
|
if (clubDiscount?.length)
|
|
@@ -1615,8 +1534,6 @@ class CatalogService {
|
|
|
1615
1534
|
}));
|
|
1616
1535
|
}
|
|
1617
1536
|
async findCatalog(options, limits) {
|
|
1618
|
-
if (this.hasTerm(options) && options.sort === 'most-relevant')
|
|
1619
|
-
return this.findCatalogByTermAndSortByMostRevelant(options, limits);
|
|
1620
1537
|
const repoParams = {
|
|
1621
1538
|
filters: {
|
|
1622
1539
|
...(await this.buildMainFilter(options)),
|
|
@@ -1644,73 +1561,12 @@ class CatalogService {
|
|
|
1644
1561
|
.search(term, 999, this.shop)
|
|
1645
1562
|
.then((data) => ({ id: { operator: Where.IN, value: data.hits.map(({ _source }) => _source.id) } }));
|
|
1646
1563
|
}
|
|
1647
|
-
async findCatalogByTermAndSortByMostRevelant(options, limits) {
|
|
1648
|
-
const productIds = await this.findCatalogIdsByElasticSearch(options.term);
|
|
1649
|
-
console.log('productIds', productIds);
|
|
1650
|
-
const totalResult = await this.productRepository.findCatalog({
|
|
1651
|
-
fields: ['id', 'stock'],
|
|
1652
|
-
filters: {
|
|
1653
|
-
id: { operator: Where.IN, value: productIds },
|
|
1654
|
-
...this.buildFilterQuery(options?.filters || {}),
|
|
1655
|
-
},
|
|
1656
|
-
options: {
|
|
1657
|
-
minimal: ['price'],
|
|
1658
|
-
maximum: ['price'],
|
|
1659
|
-
distinct: ['brand'],
|
|
1660
|
-
},
|
|
1661
|
-
}, options?.mainGender || this.shop === Shops.MENSMARKET ? 'male' : 'female');
|
|
1662
|
-
console.log('totalResult', totalResult);
|
|
1663
|
-
const stockData = totalResult.data.filter((product) => product.stock.quantity > 0);
|
|
1664
|
-
const stockOut = totalResult.data.filter((product) => product.stock.quantity <= 0);
|
|
1665
|
-
const productIdsStock = productIds.filter((product) => stockData.some((result) => result.id == product));
|
|
1666
|
-
console.log('productIdsStock', productIdsStock);
|
|
1667
|
-
const productIdsStockOut = productIds.filter((product) => stockOut.some((result) => result.id == product));
|
|
1668
|
-
console.log('productIdsStockOut', productIdsStockOut);
|
|
1669
|
-
const limitedProductId = productIdsStock
|
|
1670
|
-
.concat(productIdsStockOut)
|
|
1671
|
-
.slice(limits.offset, limits.offset + limits.limit);
|
|
1672
|
-
// const limitedProductId = productIds
|
|
1673
|
-
// .filter((product) => totalResult.data.some((result) => result.id == product))
|
|
1674
|
-
// .slice(limits.offset, limits.offset + limits.limit)
|
|
1675
|
-
console.log('limitedProductId', limitedProductId);
|
|
1676
|
-
// const limitedProductId = totalResult.data
|
|
1677
|
-
// .slice(limits.offset, limits.offset + limits.limit)
|
|
1678
|
-
// .map((product) => product.id)
|
|
1679
|
-
const orderedId = productIds.filter((product) => limitedProductId.includes(product));
|
|
1680
|
-
console.log('orderedId', orderedId);
|
|
1681
|
-
const productResult = await this.productRepository.findCatalog({
|
|
1682
|
-
filters: {
|
|
1683
|
-
id: { operator: Where.IN, value: orderedId },
|
|
1684
|
-
},
|
|
1685
|
-
});
|
|
1686
|
-
console.log('productResult', productResult);
|
|
1687
|
-
console.log('data result', limitedProductId.map((id) => productResult.data.find((product) => product.id === id)).filter(Boolean));
|
|
1688
|
-
return {
|
|
1689
|
-
data: limitedProductId.map((id) => productResult.data.find((product) => product.id === id)).filter(Boolean),
|
|
1690
|
-
count: totalResult.count,
|
|
1691
|
-
maximum: totalResult.maximum,
|
|
1692
|
-
minimal: totalResult.minimal,
|
|
1693
|
-
distinct: totalResult.distinct,
|
|
1694
|
-
};
|
|
1695
|
-
}
|
|
1696
|
-
async findCatalogIdsByElasticSearch(term) {
|
|
1697
|
-
if (this.productsByTerm[term])
|
|
1698
|
-
return this.productsByTerm[term];
|
|
1699
|
-
return (this.productsByTerm[term] = await this.productIndex
|
|
1700
|
-
.search(term, 999, this.shop)
|
|
1701
|
-
.then(({ hits: products }) => {
|
|
1702
|
-
const withStock = products.filter(({ _source }) => _source.stock.quantity > 0);
|
|
1703
|
-
const withOutStock = products.filter(({ _source }) => _source.stock.quantity <= 0);
|
|
1704
|
-
const sorted = [...withStock, ...withOutStock];
|
|
1705
|
-
return [...new Set(sorted.map(({ _source }) => _source.id))];
|
|
1706
|
-
}));
|
|
1707
|
-
}
|
|
1708
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: CatalogService, deps: [{ token: 'ProductRepository' }, { token: CATEGORY_STRUCTURE }, { token: DEFAULT_SHOP }, { token: i1$2.ProductsIndex }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1709
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: CatalogService }); }
|
|
1710
1564
|
}
|
|
1711
|
-
i0.ɵɵ
|
|
1565
|
+
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$2.ProductsIndex }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1566
|
+
CatalogService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: CatalogService });
|
|
1567
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: CatalogService, decorators: [{
|
|
1712
1568
|
type: Injectable
|
|
1713
|
-
}], ctorParameters: ()
|
|
1569
|
+
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
1714
1570
|
type: Inject,
|
|
1715
1571
|
args: ['ProductRepository']
|
|
1716
1572
|
}] }, { type: undefined, decorators: [{
|
|
@@ -1719,7 +1575,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.3", ngImpor
|
|
|
1719
1575
|
}] }, { type: i1$2.Shops, decorators: [{
|
|
1720
1576
|
type: Inject,
|
|
1721
1577
|
args: [DEFAULT_SHOP]
|
|
1722
|
-
}] }, { type: i1$2.ProductsIndex }] });
|
|
1578
|
+
}] }, { type: i1$2.ProductsIndex }]; } });
|
|
1723
1579
|
|
|
1724
1580
|
class CategoryService {
|
|
1725
1581
|
constructor(productRepository, categoryRepository, categoryFilterRepository, categoryStructureAdapter, shop) {
|
|
@@ -1745,12 +1601,12 @@ class CategoryService {
|
|
|
1745
1601
|
.find({ filters: { categoryId: +category.id } })
|
|
1746
1602
|
.then(({ data }) => data.map((categoryFilter) => categoryFilter.filter));
|
|
1747
1603
|
}
|
|
1748
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: CategoryService, deps: [{ token: 'ProductRepository' }, { token: 'CategoryRepository' }, { token: 'CategoryFilterRepository' }, { token: CATEGORY_STRUCTURE }, { token: DEFAULT_SHOP }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1749
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: CategoryService }); }
|
|
1750
1604
|
}
|
|
1751
|
-
i0.ɵɵ
|
|
1605
|
+
CategoryService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: CategoryService, deps: [{ token: 'ProductRepository' }, { token: 'CategoryRepository' }, { token: 'CategoryFilterRepository' }, { token: CATEGORY_STRUCTURE }, { token: DEFAULT_SHOP }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1606
|
+
CategoryService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: CategoryService });
|
|
1607
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: CategoryService, decorators: [{
|
|
1752
1608
|
type: Injectable
|
|
1753
|
-
}], ctorParameters: ()
|
|
1609
|
+
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
1754
1610
|
type: Inject,
|
|
1755
1611
|
args: ['ProductRepository']
|
|
1756
1612
|
}] }, { type: undefined, decorators: [{
|
|
@@ -1765,7 +1621,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.3", ngImpor
|
|
|
1765
1621
|
}] }, { type: i1$2.Shops, decorators: [{
|
|
1766
1622
|
type: Inject,
|
|
1767
1623
|
args: [DEFAULT_SHOP]
|
|
1768
|
-
}] }] });
|
|
1624
|
+
}] }]; } });
|
|
1769
1625
|
|
|
1770
1626
|
var ProductSorts;
|
|
1771
1627
|
(function (ProductSorts) {
|
|
@@ -1785,14 +1641,71 @@ __decorate([
|
|
|
1785
1641
|
__metadata("design:type", Array)
|
|
1786
1642
|
], CategoryWithTree.prototype, "children", void 0);
|
|
1787
1643
|
|
|
1644
|
+
class NewCategoryStructureAdapter {
|
|
1645
|
+
constructor(categoryRepository) {
|
|
1646
|
+
this.categoryRepository = categoryRepository;
|
|
1647
|
+
}
|
|
1648
|
+
async buildProductFilterByCategory(category) {
|
|
1649
|
+
const loadedCategory = await this.getCategory(category);
|
|
1650
|
+
if (loadedCategory.isCollection)
|
|
1651
|
+
return { id: { operator: Where.IN, value: loadedCategory.products } };
|
|
1652
|
+
const categoryIds = [...(await this.getAllCategoriesIdFromCategory(category)), category.id.toString()];
|
|
1653
|
+
return {
|
|
1654
|
+
category: {
|
|
1655
|
+
id: {
|
|
1656
|
+
operator: Where.IN,
|
|
1657
|
+
value: categoryIds,
|
|
1658
|
+
},
|
|
1659
|
+
},
|
|
1660
|
+
};
|
|
1661
|
+
}
|
|
1662
|
+
async getAllCategoriesIdFromCategory(category) {
|
|
1663
|
+
return this.categoryRepository
|
|
1664
|
+
.getChildren(+category.id)
|
|
1665
|
+
.then((categories) => categories.map((category) => category.id.toString()));
|
|
1666
|
+
}
|
|
1667
|
+
async getCategory(category) {
|
|
1668
|
+
return isNil(category.isCollection) || (category.isCollection && !category.products?.length)
|
|
1669
|
+
? this.categoryRepository.get({ id: category.id })
|
|
1670
|
+
: category;
|
|
1671
|
+
}
|
|
1672
|
+
}
|
|
1673
|
+
NewCategoryStructureAdapter.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: NewCategoryStructureAdapter, deps: [{ token: 'CategoryRepository' }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1674
|
+
NewCategoryStructureAdapter.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: NewCategoryStructureAdapter });
|
|
1675
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: NewCategoryStructureAdapter, decorators: [{
|
|
1676
|
+
type: Injectable
|
|
1677
|
+
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
1678
|
+
type: Inject,
|
|
1679
|
+
args: ['CategoryRepository']
|
|
1680
|
+
}] }]; } });
|
|
1681
|
+
|
|
1682
|
+
class OldCategoryStructureAdapter {
|
|
1683
|
+
constructor(categoryRepository) {
|
|
1684
|
+
this.categoryRepository = categoryRepository;
|
|
1685
|
+
}
|
|
1686
|
+
async buildProductFilterByCategory(category) {
|
|
1687
|
+
const productsIds = category.products?.length
|
|
1688
|
+
? category.products
|
|
1689
|
+
: await this.categoryRepository.get({ id: category.id }).then((categoryFound) => categoryFound.products);
|
|
1690
|
+
return { id: { operator: Where.IN, value: productsIds } };
|
|
1691
|
+
}
|
|
1692
|
+
}
|
|
1693
|
+
OldCategoryStructureAdapter.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: OldCategoryStructureAdapter, deps: [{ token: 'CategoryRepository' }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1694
|
+
OldCategoryStructureAdapter.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: OldCategoryStructureAdapter });
|
|
1695
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: OldCategoryStructureAdapter, decorators: [{
|
|
1696
|
+
type: Injectable
|
|
1697
|
+
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
1698
|
+
type: Inject,
|
|
1699
|
+
args: ['CategoryRepository']
|
|
1700
|
+
}] }]; } });
|
|
1701
|
+
|
|
1788
1702
|
class WishlistService {
|
|
1789
|
-
constructor(wishlistRepository,
|
|
1703
|
+
constructor(wishlistRepository, shop, productRepository, categoryFilterRepository, productIndex) {
|
|
1790
1704
|
this.wishlistRepository = wishlistRepository;
|
|
1791
|
-
this.categoryRepository = categoryRepository;
|
|
1792
1705
|
this.shop = shop;
|
|
1793
1706
|
const categoryStructureAdapter = new NewCategoryStructureAdapter(wishlistRepository);
|
|
1794
1707
|
this.catalogService = new CatalogService(productRepository, categoryStructureAdapter, shop, productIndex);
|
|
1795
|
-
this.categoryService = new CategoryService(productRepository,
|
|
1708
|
+
this.categoryService = new CategoryService(productRepository, wishlistRepository, categoryFilterRepository, categoryStructureAdapter, shop);
|
|
1796
1709
|
}
|
|
1797
1710
|
getCatalogService() {
|
|
1798
1711
|
return this.catalogService;
|
|
@@ -1800,7 +1713,7 @@ class WishlistService {
|
|
|
1800
1713
|
getCategoryService() {
|
|
1801
1714
|
return this.categoryService;
|
|
1802
1715
|
}
|
|
1803
|
-
async create(
|
|
1716
|
+
async create(personId, title, description, userFullName, userPhoto) {
|
|
1804
1717
|
const data = {
|
|
1805
1718
|
slug: '',
|
|
1806
1719
|
name: title,
|
|
@@ -1816,14 +1729,11 @@ class WishlistService {
|
|
|
1816
1729
|
personPhoto: userPhoto,
|
|
1817
1730
|
brandCategory: false,
|
|
1818
1731
|
published: true,
|
|
1819
|
-
theme,
|
|
1820
|
-
bannerUrl,
|
|
1821
1732
|
};
|
|
1822
1733
|
const newWishlist = await this.wishlistRepository.create(data);
|
|
1823
|
-
|
|
1824
|
-
return Wishlist.toInstance({ ...newWishlist.toPlain(), slug: newWishlist.id });
|
|
1734
|
+
return this.wishlistRepository.update({ id: newWishlist.id, slug: newWishlist.id });
|
|
1825
1735
|
}
|
|
1826
|
-
update(
|
|
1736
|
+
update(id, title, description, userFullName, userPhoto) {
|
|
1827
1737
|
const data = {
|
|
1828
1738
|
id,
|
|
1829
1739
|
name: title,
|
|
@@ -1834,8 +1744,6 @@ class WishlistService {
|
|
|
1834
1744
|
},
|
|
1835
1745
|
personName: userFullName,
|
|
1836
1746
|
personPhoto: userPhoto,
|
|
1837
|
-
theme,
|
|
1838
|
-
bannerUrl,
|
|
1839
1747
|
};
|
|
1840
1748
|
return this.wishlistRepository.update(data);
|
|
1841
1749
|
}
|
|
@@ -1871,17 +1779,14 @@ class WishlistService {
|
|
|
1871
1779
|
}
|
|
1872
1780
|
return wishlist;
|
|
1873
1781
|
}
|
|
1874
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: WishlistService, deps: [{ token: 'WishlistRepository' }, { token: 'CategoryRepository' }, { token: DEFAULT_SHOP }, { token: 'ProductRepository' }, { token: 'CategoryFilterRepository' }, { token: i1$2.ProductsIndex }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1875
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: WishlistService }); }
|
|
1876
1782
|
}
|
|
1877
|
-
i0.ɵɵ
|
|
1783
|
+
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$2.ProductsIndex }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1784
|
+
WishlistService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: WishlistService });
|
|
1785
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: WishlistService, decorators: [{
|
|
1878
1786
|
type: Injectable
|
|
1879
|
-
}], ctorParameters: ()
|
|
1787
|
+
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
1880
1788
|
type: Inject,
|
|
1881
1789
|
args: ['WishlistRepository']
|
|
1882
|
-
}] }, { type: undefined, decorators: [{
|
|
1883
|
-
type: Inject,
|
|
1884
|
-
args: ['CategoryRepository']
|
|
1885
1790
|
}] }, { type: i1$2.Shops, decorators: [{
|
|
1886
1791
|
type: Inject,
|
|
1887
1792
|
args: [DEFAULT_SHOP]
|
|
@@ -1891,7 +1796,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.3", ngImpor
|
|
|
1891
1796
|
}] }, { type: undefined, decorators: [{
|
|
1892
1797
|
type: Inject,
|
|
1893
1798
|
args: ['CategoryFilterRepository']
|
|
1894
|
-
}] }, { type: i1$2.ProductsIndex }] });
|
|
1799
|
+
}] }, { type: i1$2.ProductsIndex }]; } });
|
|
1895
1800
|
|
|
1896
1801
|
class CheckoutSubscriptionService {
|
|
1897
1802
|
constructor(checkoutSubscriptionRepository, subscriptionRepository, couponService) {
|
|
@@ -1925,18 +1830,18 @@ class CheckoutSubscriptionService {
|
|
|
1925
1830
|
calcDiscountSubscription(coupon) {
|
|
1926
1831
|
return this.getCheckoutSubscription().pipe(concatMap((checkout) => this.couponService.calcDiscountSubscription(coupon, checkout).pipe()));
|
|
1927
1832
|
}
|
|
1928
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: CheckoutSubscriptionService, deps: [{ token: 'CheckoutSubscriptionRepository' }, { token: 'SubscriptionRepository' }, { token: CouponService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1929
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: CheckoutSubscriptionService }); }
|
|
1930
1833
|
}
|
|
1931
|
-
i0.ɵɵ
|
|
1834
|
+
CheckoutSubscriptionService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: CheckoutSubscriptionService, deps: [{ token: 'CheckoutSubscriptionRepository' }, { token: 'SubscriptionRepository' }, { token: CouponService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1835
|
+
CheckoutSubscriptionService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: CheckoutSubscriptionService });
|
|
1836
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: CheckoutSubscriptionService, decorators: [{
|
|
1932
1837
|
type: Injectable
|
|
1933
|
-
}], ctorParameters: ()
|
|
1838
|
+
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
1934
1839
|
type: Inject,
|
|
1935
1840
|
args: ['CheckoutSubscriptionRepository']
|
|
1936
1841
|
}] }, { type: undefined, decorators: [{
|
|
1937
1842
|
type: Inject,
|
|
1938
1843
|
args: ['SubscriptionRepository']
|
|
1939
|
-
}] }, { type: CouponService }] });
|
|
1844
|
+
}] }, { type: CouponService }]; } });
|
|
1940
1845
|
|
|
1941
1846
|
class UtilHelper {
|
|
1942
1847
|
static createSlug(name) {
|
|
@@ -1986,18 +1891,13 @@ class HomeShopService {
|
|
|
1986
1891
|
'weight',
|
|
1987
1892
|
'rate',
|
|
1988
1893
|
'type',
|
|
1989
|
-
'brand',
|
|
1990
1894
|
]))) || [],
|
|
1991
1895
|
});
|
|
1992
1896
|
}
|
|
1993
1897
|
getHomeData() {
|
|
1994
1898
|
return this.getHomeConfiguration().pipe(map((home) => (home?.data?.expiresAt > new Date() ? home : null)), concatMap((home) => home
|
|
1995
1899
|
? of(home)
|
|
1996
|
-
: forkJoin([
|
|
1997
|
-
this.getDiscoverProducts(this.gender),
|
|
1998
|
-
this.getFeaturedProducts(this.gender),
|
|
1999
|
-
this.getVerticalProducts(this.gender),
|
|
2000
|
-
]).pipe(map(([discoverProducts, featuredProducts, verticalProducts]) => ({
|
|
1900
|
+
: forkJoin([this.getDiscoverProducts(), this.getFeaturedProducts(), this.getVerticalProducts()]).pipe(map(([discoverProducts, featuredProducts, verticalProducts]) => ({
|
|
2001
1901
|
discoverProducts,
|
|
2002
1902
|
featuredProducts,
|
|
2003
1903
|
verticalProducts,
|
|
@@ -2019,18 +1919,15 @@ class HomeShopService {
|
|
|
2019
1919
|
getMinValueForFreeShipping() {
|
|
2020
1920
|
return this.getHomeConfiguration().pipe(map((home) => home.minValueForFreeShipping));
|
|
2021
1921
|
}
|
|
2022
|
-
getDiscoverProducts(
|
|
2023
|
-
return this.getHomeConfiguration().pipe(concatMap((home) => from(this.categoryRepository.getCategoriesForHome(home.discoverCategories
|
|
1922
|
+
getDiscoverProducts() {
|
|
1923
|
+
return this.getHomeConfiguration().pipe(concatMap((home) => from(this.categoryRepository.getCategoriesForHome(home.discoverCategories)).pipe(map((groups) => groups.map(this.buildCategoryGroupWithRequiredData)))));
|
|
2024
1924
|
}
|
|
2025
|
-
getFeaturedProducts(
|
|
2026
|
-
return this.getHomeConfiguration().pipe(concatMap((home) => from(this.categoryRepository.getCategoriesForHome(home.featuredCategories
|
|
1925
|
+
getFeaturedProducts() {
|
|
1926
|
+
return this.getHomeConfiguration().pipe(concatMap((home) => from(this.categoryRepository.getCategoriesForHome(home.featuredCategories)).pipe(map((groups) => groups.map(this.buildCategoryGroupWithRequiredData)))));
|
|
2027
1927
|
}
|
|
2028
|
-
getVerticalProducts(
|
|
1928
|
+
getVerticalProducts() {
|
|
2029
1929
|
return this.getHomeConfiguration().pipe(concatMap((home) => forkJoin(home.verticalCarousels.filter(Boolean).map((id) => from(this.categoryRepository.get({ id })).pipe(concatMap((category) => from(this.productRepository.find({
|
|
2030
|
-
filters: {
|
|
2031
|
-
categories: { operator: Where.IN, value: [category.id] },
|
|
2032
|
-
...(gender ? { tags: { operator: Where.IN, value: [gender] } } : {}),
|
|
2033
|
-
},
|
|
1930
|
+
filters: { categories: { operator: Where.IN, value: [category.id] } },
|
|
2034
1931
|
limits: { limit: 12 },
|
|
2035
1932
|
})).pipe(map((products) => ({ category, products })))), map(({ category, products }) => ({ category, products: products.data })), map(this.buildCategoryGroupWithRequiredData))))));
|
|
2036
1933
|
}
|
|
@@ -2052,15 +1949,12 @@ class HomeShopService {
|
|
|
2052
1949
|
data,
|
|
2053
1950
|
})).pipe(tap(() => (this.homeConfiguration.data = data)), map(() => this.homeConfiguration));
|
|
2054
1951
|
}
|
|
2055
|
-
get gender() {
|
|
2056
|
-
return this.homeId === 'mens_market' ? 'masculino' : undefined;
|
|
2057
|
-
}
|
|
2058
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: HomeShopService, deps: [{ token: 'CategoryRepository' }, { token: 'HomeRepository' }, { token: 'ProductRepository' }, { token: DEFAULT_SHOP }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2059
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: HomeShopService }); }
|
|
2060
1952
|
}
|
|
2061
|
-
i0.ɵɵ
|
|
1953
|
+
HomeShopService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: HomeShopService, deps: [{ token: 'CategoryRepository' }, { token: 'HomeRepository' }, { token: 'ProductRepository' }, { token: DEFAULT_SHOP }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1954
|
+
HomeShopService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: HomeShopService });
|
|
1955
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: HomeShopService, decorators: [{
|
|
2062
1956
|
type: Injectable
|
|
2063
|
-
}], ctorParameters: ()
|
|
1957
|
+
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
2064
1958
|
type: Inject,
|
|
2065
1959
|
args: ['CategoryRepository']
|
|
2066
1960
|
}] }, { type: undefined, decorators: [{
|
|
@@ -2072,7 +1966,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.3", ngImpor
|
|
|
2072
1966
|
}] }, { type: i1$2.Shops, decorators: [{
|
|
2073
1967
|
type: Inject,
|
|
2074
1968
|
args: [DEFAULT_SHOP]
|
|
2075
|
-
}] }] });
|
|
1969
|
+
}] }]; } });
|
|
2076
1970
|
|
|
2077
1971
|
class OrderService {
|
|
2078
1972
|
constructor(angularFirestore, orderRepository) {
|
|
@@ -2086,15 +1980,15 @@ class OrderService {
|
|
|
2086
1980
|
.subscribe((doc) => this.orderSubject.next(doc));
|
|
2087
1981
|
return this.orderSubject;
|
|
2088
1982
|
}
|
|
2089
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: OrderService, deps: [{ token: i1$1.Firestore }, { token: 'OrderRepository' }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2090
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: OrderService }); }
|
|
2091
1983
|
}
|
|
2092
|
-
i0.ɵɵ
|
|
1984
|
+
OrderService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: OrderService, deps: [{ token: i1$1.Firestore }, { token: 'OrderRepository' }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1985
|
+
OrderService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: OrderService });
|
|
1986
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: OrderService, decorators: [{
|
|
2093
1987
|
type: Injectable
|
|
2094
|
-
}], ctorParameters: ()
|
|
1988
|
+
}], ctorParameters: function () { return [{ type: i1$1.Firestore }, { type: i1$2.OrderFirestoreRepository, decorators: [{
|
|
2095
1989
|
type: Inject,
|
|
2096
1990
|
args: ['OrderRepository']
|
|
2097
|
-
}] }] });
|
|
1991
|
+
}] }]; } });
|
|
2098
1992
|
|
|
2099
1993
|
class ShippingService {
|
|
2100
1994
|
constructor(http, apiUrl, homeService) {
|
|
@@ -2172,15 +2066,15 @@ class ShippingService {
|
|
|
2172
2066
|
}
|
|
2173
2067
|
return false;
|
|
2174
2068
|
}
|
|
2175
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: ShippingService, deps: [{ token: i1$3.HttpClient }, { token: BACKEND_URL }, { token: HomeShopService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2176
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: ShippingService }); }
|
|
2177
2069
|
}
|
|
2178
|
-
i0.ɵɵ
|
|
2070
|
+
ShippingService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: ShippingService, deps: [{ token: i1$3.HttpClient }, { token: BACKEND_URL }, { token: HomeShopService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2071
|
+
ShippingService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: ShippingService });
|
|
2072
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: ShippingService, decorators: [{
|
|
2179
2073
|
type: Injectable
|
|
2180
|
-
}], ctorParameters: ()
|
|
2074
|
+
}], ctorParameters: function () { return [{ type: i1$3.HttpClient }, { type: undefined, decorators: [{
|
|
2181
2075
|
type: Inject,
|
|
2182
2076
|
args: [BACKEND_URL]
|
|
2183
|
-
}] }, { type: HomeShopService }] });
|
|
2077
|
+
}] }, { type: HomeShopService }]; } });
|
|
2184
2078
|
|
|
2185
2079
|
class AngularConnectModule {
|
|
2186
2080
|
static initializeApp(defaultShop, options, nameOrConfig) {
|
|
@@ -2202,38 +2096,38 @@ class AngularConnectModule {
|
|
|
2202
2096
|
],
|
|
2203
2097
|
};
|
|
2204
2098
|
}
|
|
2205
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: AngularConnectModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
2206
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.0.3", ngImport: i0, type: AngularConnectModule, imports: [i1$4.FirebaseAppModule, AngularElasticSeachModule,
|
|
2207
|
-
AngularFirebaseAuthModule,
|
|
2208
|
-
AngularFirestoreModule,
|
|
2209
|
-
AngularHasuraGraphQLModule] }); }
|
|
2210
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: AngularConnectModule, providers: [
|
|
2211
|
-
AuthService,
|
|
2212
|
-
CartService,
|
|
2213
|
-
CatalogService,
|
|
2214
|
-
CategoryService,
|
|
2215
|
-
CheckoutService,
|
|
2216
|
-
CheckoutSubscriptionService,
|
|
2217
|
-
CouponService,
|
|
2218
|
-
HomeShopService,
|
|
2219
|
-
OrderService,
|
|
2220
|
-
ShippingService,
|
|
2221
|
-
WishlistService,
|
|
2222
|
-
], imports: [provideFirebaseApp((injector) => {
|
|
2223
|
-
const appName = injector.get(FIREBASE_APP_NAME) || '[DEFAULT]';
|
|
2224
|
-
try {
|
|
2225
|
-
return getApp(appName);
|
|
2226
|
-
}
|
|
2227
|
-
catch (error) {
|
|
2228
|
-
return initializeApp(injector.get(FIREBASE_OPTIONS), appName);
|
|
2229
|
-
}
|
|
2230
|
-
}),
|
|
2231
|
-
AngularElasticSeachModule,
|
|
2232
|
-
AngularFirebaseAuthModule,
|
|
2233
|
-
AngularFirestoreModule,
|
|
2234
|
-
AngularHasuraGraphQLModule] }); }
|
|
2235
2099
|
}
|
|
2236
|
-
i0.ɵɵ
|
|
2100
|
+
AngularConnectModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: AngularConnectModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
2101
|
+
AngularConnectModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.1.0", ngImport: i0, type: AngularConnectModule, imports: [i1$4.FirebaseAppModule, AngularElasticSeachModule,
|
|
2102
|
+
AngularFirebaseAuthModule,
|
|
2103
|
+
AngularFirestoreModule,
|
|
2104
|
+
AngularHasuraGraphQLModule] });
|
|
2105
|
+
AngularConnectModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: AngularConnectModule, providers: [
|
|
2106
|
+
AuthService,
|
|
2107
|
+
CartService,
|
|
2108
|
+
CatalogService,
|
|
2109
|
+
CategoryService,
|
|
2110
|
+
CheckoutService,
|
|
2111
|
+
CheckoutSubscriptionService,
|
|
2112
|
+
CouponService,
|
|
2113
|
+
HomeShopService,
|
|
2114
|
+
OrderService,
|
|
2115
|
+
ShippingService,
|
|
2116
|
+
WishlistService,
|
|
2117
|
+
], imports: [provideFirebaseApp((injector) => {
|
|
2118
|
+
const appName = injector.get(FIREBASE_APP_NAME) || '[DEFAULT]';
|
|
2119
|
+
try {
|
|
2120
|
+
return getApp(appName);
|
|
2121
|
+
}
|
|
2122
|
+
catch (error) {
|
|
2123
|
+
return initializeApp(injector.get(FIREBASE_OPTIONS), appName);
|
|
2124
|
+
}
|
|
2125
|
+
}),
|
|
2126
|
+
AngularElasticSeachModule,
|
|
2127
|
+
AngularFirebaseAuthModule,
|
|
2128
|
+
AngularFirestoreModule,
|
|
2129
|
+
AngularHasuraGraphQLModule] });
|
|
2130
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: AngularConnectModule, decorators: [{
|
|
2237
2131
|
type: NgModule,
|
|
2238
2132
|
args: [{
|
|
2239
2133
|
imports: [
|
|
@@ -2271,5 +2165,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.3", ngImpor
|
|
|
2271
2165
|
* Generated bundle index. Do not edit.
|
|
2272
2166
|
*/
|
|
2273
2167
|
|
|
2274
|
-
export { AngularConnectModule, AngularFirebaseAuthModule, AngularFirestoreModule, AngularHasuraGraphQLModule, AuthService, CartService, CatalogService, CategoryService, CategoryWithTree, CheckoutService, CheckoutSubscriptionService, CouponService, HomeShopService,
|
|
2168
|
+
export { AngularConnectModule, AngularFirebaseAuthModule, AngularFirestoreModule, AngularHasuraGraphQLModule, AuthService, CartService, CatalogService, CategoryService, CategoryWithTree, CheckoutService, CheckoutSubscriptionService, CouponService, HomeShopService, OrderService, ProductSorts, ShippingService, UtilHelper, WishlistService };
|
|
2275
2169
|
//# sourceMappingURL=infrab4a-connect-angular.mjs.map
|