@infrab4a/connect-angular 4.2.10-beta.4 → 4.2.11-beta.2
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 +265 -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 +6 -6
- 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 +170 -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/{esm2022 → esm2020}/services/catalog/index.mjs +1 -1
- 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/{esm2022 → esm2020}/services/catalog/wishlist.service.mjs +6 -6
- package/{esm2022 → esm2020}/services/checkout-subscription.service.mjs +6 -6
- package/{esm2022 → esm2020}/services/checkout.service.mjs +6 -6
- package/esm2020/services/coupon.service.mjs +218 -0
- 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 +125 -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 +2322 -0
- package/fesm2015/infrab4a-connect-angular.mjs.map +1 -0
- package/{fesm2022 → fesm2020}/infrab4a-connect-angular.mjs +532 -553
- package/fesm2020/infrab4a-connect-angular.mjs.map +1 -0
- package/package.json +12 -6
- package/services/coupon.service.d.ts +0 -1
- package/services/home-shop.service.d.ts +1 -0
- 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 -184
- package/esm2022/services/coupon.service.mjs +0 -235
- package/esm2022/services/home-shop.service.mjs +0 -115
- 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
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, ProductReviewsHasuraGraphQLRepository, VariantHasuraGraphQLRepository, FilterOptionHasuraGraphQLRepository, FilterHasuraGraphQLRepository, CategoryCollectionChildrenHasuraGraphQLRepository, WishlistHasuraGraphQLRepository, Where, Shops, CheckoutTypes, CouponTypes, Exclusivities, isNil, NotFoundError, Checkout, pick, LineItem, RoundProductPricesHelper, set, InvalidArgumentError, Category, Wishlist, 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
210
|
},
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
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,132 @@ 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
680
|
},
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
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: 'ProductReviewsRepository',
|
|
708
|
+
useExisting: ProductReviewsHasuraGraphQLRepository,
|
|
709
|
+
},
|
|
710
|
+
{
|
|
711
|
+
provide: ProductReviewsHasuraGraphQLRepository,
|
|
712
|
+
useFactory: (hasuraConfig) => {
|
|
713
|
+
return new ProductReviewsHasuraGraphQLRepository(hasuraConfig);
|
|
714
|
+
},
|
|
715
|
+
deps: ['HasuraConfig'],
|
|
716
|
+
},
|
|
717
|
+
{
|
|
718
|
+
provide: 'VariantRepository',
|
|
719
|
+
useExisting: VariantHasuraGraphQLRepository,
|
|
720
|
+
},
|
|
721
|
+
{
|
|
722
|
+
provide: VariantHasuraGraphQLRepository,
|
|
723
|
+
useFactory: (hasuraConfig) => {
|
|
724
|
+
return new VariantHasuraGraphQLRepository(hasuraConfig);
|
|
725
|
+
},
|
|
726
|
+
deps: ['HasuraConfig'],
|
|
727
|
+
},
|
|
728
|
+
{
|
|
729
|
+
provide: 'CategoryFilterRepository',
|
|
730
|
+
useExisting: CategoryFilterHasuraGraphQLRepository,
|
|
731
|
+
},
|
|
732
|
+
{
|
|
733
|
+
provide: CategoryFilterHasuraGraphQLRepository,
|
|
734
|
+
useFactory: (options) => {
|
|
735
|
+
return new CategoryFilterHasuraGraphQLRepository(options);
|
|
736
|
+
},
|
|
737
|
+
deps: ['HasuraConfig'],
|
|
738
|
+
},
|
|
739
|
+
{
|
|
740
|
+
provide: 'FilterOptionRepository',
|
|
741
|
+
useExisting: FilterOptionHasuraGraphQLRepository,
|
|
742
|
+
},
|
|
743
|
+
{
|
|
744
|
+
provide: FilterOptionHasuraGraphQLRepository,
|
|
745
|
+
useFactory: (options) => {
|
|
746
|
+
return new FilterOptionHasuraGraphQLRepository(options);
|
|
747
|
+
},
|
|
748
|
+
deps: ['HasuraConfig'],
|
|
749
|
+
},
|
|
750
|
+
{
|
|
751
|
+
provide: 'FilterRepository',
|
|
752
|
+
useExisting: FilterHasuraGraphQLRepository,
|
|
753
|
+
},
|
|
754
|
+
{
|
|
755
|
+
provide: FilterHasuraGraphQLRepository,
|
|
756
|
+
useFactory: (options, filterOptionRepository, categoryFilterRepository) => {
|
|
757
|
+
return new FilterHasuraGraphQLRepository(options, filterOptionRepository, categoryFilterRepository);
|
|
758
|
+
},
|
|
759
|
+
deps: ['HasuraConfig', FilterOptionHasuraGraphQLRepository, CategoryFilterHasuraGraphQLRepository],
|
|
760
|
+
},
|
|
761
|
+
{
|
|
762
|
+
provide: CategoryCollectionChildrenHasuraGraphQLRepository,
|
|
763
|
+
useFactory: (options) => new CategoryCollectionChildrenHasuraGraphQLRepository(options),
|
|
764
|
+
deps: ['HasuraConfig'],
|
|
765
|
+
},
|
|
766
|
+
{
|
|
767
|
+
provide: 'CategoryCollectionChildrenRepository',
|
|
768
|
+
useExisting: CategoryCollectionChildrenHasuraGraphQLRepository,
|
|
769
|
+
},
|
|
770
|
+
{
|
|
771
|
+
provide: WishlistHasuraGraphQLRepository,
|
|
772
|
+
useFactory: (options, categoryFilterRepository) => {
|
|
773
|
+
return new WishlistHasuraGraphQLRepository(options, categoryFilterRepository);
|
|
774
|
+
},
|
|
775
|
+
deps: ['HasuraConfig', CategoryFilterHasuraGraphQLRepository],
|
|
776
|
+
},
|
|
777
|
+
{
|
|
778
|
+
provide: 'WishlistRepository',
|
|
779
|
+
useExisting: WishlistHasuraGraphQLRepository,
|
|
780
|
+
},
|
|
781
|
+
] });
|
|
782
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: AngularHasuraGraphQLModule, decorators: [{
|
|
783
783
|
type: NgModule,
|
|
784
784
|
args: [{
|
|
785
785
|
providers: [
|
|
@@ -928,15 +928,15 @@ class AuthService {
|
|
|
928
928
|
getFireUser() {
|
|
929
929
|
return authState(this.angularFireAuth).pipe(catchError(() => of(null)));
|
|
930
930
|
}
|
|
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
931
|
}
|
|
934
|
-
i0.ɵɵ
|
|
932
|
+
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 });
|
|
933
|
+
AuthService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: AuthService });
|
|
934
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: AuthService, decorators: [{
|
|
935
935
|
type: Injectable
|
|
936
|
-
}], ctorParameters: ()
|
|
936
|
+
}], ctorParameters: function () { return [{ type: i1.Auth }, { type: undefined, decorators: [{
|
|
937
937
|
type: Inject,
|
|
938
938
|
args: ['UserRepository']
|
|
939
|
-
}] }] });
|
|
939
|
+
}] }]; } });
|
|
940
940
|
|
|
941
941
|
class CouponService {
|
|
942
942
|
constructor(couponRepository, defaultShop, orderRepository, categoryRepository) {
|
|
@@ -981,11 +981,6 @@ class CouponService {
|
|
|
981
981
|
if (!validUser)
|
|
982
982
|
throw 'Usuário não elegível.';
|
|
983
983
|
const couponUseLimits = this.getCouponUseLimits(coupon, checkoutType, checkout.user);
|
|
984
|
-
if (couponUseLimits.firstOrder) {
|
|
985
|
-
const ordersUser = await this.getOrdersFromUser(checkout.user.email.toLocaleLowerCase());
|
|
986
|
-
if (couponUseLimits.firstOrder && ordersUser.length >= 1)
|
|
987
|
-
throw 'Limite de uso atingido';
|
|
988
|
-
}
|
|
989
984
|
if (!couponUseLimits.unlimited || couponUseLimits.limitedPerUser) {
|
|
990
985
|
const orders = await this.getOrdersWithCoupon(coupon);
|
|
991
986
|
if (!couponUseLimits.unlimited && couponUseLimits.total && orders.length >= couponUseLimits.total)
|
|
@@ -1059,11 +1054,9 @@ class CouponService {
|
|
|
1059
1054
|
if (!user || coupon.exclusivityType.includes(Exclusivities.ALL_USERS))
|
|
1060
1055
|
return true;
|
|
1061
1056
|
let userTypes = [];
|
|
1062
|
-
if (coupon.exclusivityType.includes(Exclusivities.COLLABORATORS) &&
|
|
1063
|
-
this.emailIsFromCollaborator(user.email.toLocaleLowerCase()))
|
|
1057
|
+
if (coupon.exclusivityType.includes(Exclusivities.COLLABORATORS) && this.emailIsFromCollaborator(user.email))
|
|
1064
1058
|
userTypes.push(Exclusivities.COLLABORATORS);
|
|
1065
|
-
if (coupon.exclusivityType.includes(Exclusivities.SPECIFIC_USER) &&
|
|
1066
|
-
coupon.userExclusiveEmail.includes(user.email.toLocaleLowerCase()))
|
|
1059
|
+
if (coupon.exclusivityType.includes(Exclusivities.SPECIFIC_USER) && coupon.userExclusiveEmail.includes(user.email))
|
|
1067
1060
|
userTypes.push(Exclusivities.SPECIFIC_USER);
|
|
1068
1061
|
if (coupon.exclusivityType.includes(Exclusivities.ACTIVE_SUBSCRIBER) &&
|
|
1069
1062
|
user.isSubscriber &&
|
|
@@ -1121,16 +1114,6 @@ class CouponService {
|
|
|
1121
1114
|
})
|
|
1122
1115
|
.then((result) => result.data);
|
|
1123
1116
|
}
|
|
1124
|
-
async getOrdersFromUser(email) {
|
|
1125
|
-
return await this.orderRepository
|
|
1126
|
-
.find({
|
|
1127
|
-
filters: {
|
|
1128
|
-
user: { email: { operator: Where.EQUALS, value: email } },
|
|
1129
|
-
payment: { status: 'paid' },
|
|
1130
|
-
},
|
|
1131
|
-
})
|
|
1132
|
-
.then((result) => result.data);
|
|
1133
|
-
}
|
|
1134
1117
|
countOrdersWithUser(orders, email) {
|
|
1135
1118
|
return orders.filter((o) => o.user.email == email).length;
|
|
1136
1119
|
}
|
|
@@ -1144,15 +1127,15 @@ class CouponService {
|
|
|
1144
1127
|
}
|
|
1145
1128
|
return couponUseLimits;
|
|
1146
1129
|
}
|
|
1147
|
-
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 }); }
|
|
1148
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: CouponService, providedIn: 'root' }); }
|
|
1149
1130
|
}
|
|
1150
|
-
i0.ɵɵ
|
|
1131
|
+
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 });
|
|
1132
|
+
CouponService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: CouponService, providedIn: 'root' });
|
|
1133
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: CouponService, decorators: [{
|
|
1151
1134
|
type: Injectable,
|
|
1152
1135
|
args: [{
|
|
1153
1136
|
providedIn: 'root',
|
|
1154
1137
|
}]
|
|
1155
|
-
}], ctorParameters: ()
|
|
1138
|
+
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
1156
1139
|
type: Inject,
|
|
1157
1140
|
args: ['CouponRepository']
|
|
1158
1141
|
}] }, { type: i1$2.Shops, decorators: [{
|
|
@@ -1164,7 +1147,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.3", ngImpor
|
|
|
1164
1147
|
}] }, { type: undefined, decorators: [{
|
|
1165
1148
|
type: Inject,
|
|
1166
1149
|
args: ['CategoryRepository']
|
|
1167
|
-
}] }] });
|
|
1150
|
+
}] }]; } });
|
|
1168
1151
|
|
|
1169
1152
|
class CheckoutService {
|
|
1170
1153
|
constructor(couponService, checkoutRepository, orderRepository, userRepository, defaultShop) {
|
|
@@ -1208,12 +1191,12 @@ class CheckoutService {
|
|
|
1208
1191
|
cookie.set('checkoutId', checkout.id);
|
|
1209
1192
|
return checkout;
|
|
1210
1193
|
}
|
|
1211
|
-
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 }); }
|
|
1212
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: CheckoutService }); }
|
|
1213
1194
|
}
|
|
1214
|
-
i0.ɵɵ
|
|
1195
|
+
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 });
|
|
1196
|
+
CheckoutService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: CheckoutService });
|
|
1197
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: CheckoutService, decorators: [{
|
|
1215
1198
|
type: Injectable
|
|
1216
|
-
}], ctorParameters: ()
|
|
1199
|
+
}], ctorParameters: function () { return [{ type: CouponService }, { type: undefined, decorators: [{
|
|
1217
1200
|
type: Inject,
|
|
1218
1201
|
args: ['CheckoutRepository']
|
|
1219
1202
|
}] }, { type: undefined, decorators: [{
|
|
@@ -1225,7 +1208,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.3", ngImpor
|
|
|
1225
1208
|
}] }, { type: i1$2.Shops, decorators: [{
|
|
1226
1209
|
type: Inject,
|
|
1227
1210
|
args: [DEFAULT_SHOP]
|
|
1228
|
-
}] }] });
|
|
1211
|
+
}] }]; } });
|
|
1229
1212
|
|
|
1230
1213
|
class CartService {
|
|
1231
1214
|
constructor(authService, checkoutService, defaultShop, productRepository, categoryRepository, variantRepository, buy2WinRepository) {
|
|
@@ -1475,12 +1458,12 @@ class CartService {
|
|
|
1475
1458
|
});
|
|
1476
1459
|
});
|
|
1477
1460
|
}
|
|
1478
|
-
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 }); }
|
|
1479
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: CartService }); }
|
|
1480
1461
|
}
|
|
1481
|
-
i0.ɵɵ
|
|
1462
|
+
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 });
|
|
1463
|
+
CartService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: CartService });
|
|
1464
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: CartService, decorators: [{
|
|
1482
1465
|
type: Injectable
|
|
1483
|
-
}], ctorParameters: ()
|
|
1466
|
+
}], ctorParameters: function () { return [{ type: AuthService }, { type: CheckoutService }, { type: i1$2.Shops, decorators: [{
|
|
1484
1467
|
type: Inject,
|
|
1485
1468
|
args: [DEFAULT_SHOP]
|
|
1486
1469
|
}] }, { type: undefined, decorators: [{
|
|
@@ -1495,7 +1478,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.3", ngImpor
|
|
|
1495
1478
|
}] }, { type: i1$2.Buy2WinFirestoreRepository, decorators: [{
|
|
1496
1479
|
type: Inject,
|
|
1497
1480
|
args: ['Buy2WinRepository']
|
|
1498
|
-
}] }] });
|
|
1481
|
+
}] }]; } });
|
|
1499
1482
|
|
|
1500
1483
|
class NewCategoryStructureAdapter {
|
|
1501
1484
|
constructor(categoryRepository) {
|
|
@@ -1525,15 +1508,15 @@ class NewCategoryStructureAdapter {
|
|
|
1525
1508
|
? this.categoryRepository.get({ id: category.id })
|
|
1526
1509
|
: category;
|
|
1527
1510
|
}
|
|
1528
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: NewCategoryStructureAdapter, deps: [{ token: 'CategoryRepository' }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1529
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: NewCategoryStructureAdapter }); }
|
|
1530
1511
|
}
|
|
1531
|
-
i0.ɵɵ
|
|
1512
|
+
NewCategoryStructureAdapter.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: NewCategoryStructureAdapter, deps: [{ token: 'CategoryRepository' }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1513
|
+
NewCategoryStructureAdapter.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: NewCategoryStructureAdapter });
|
|
1514
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: NewCategoryStructureAdapter, decorators: [{
|
|
1532
1515
|
type: Injectable
|
|
1533
|
-
}], ctorParameters: ()
|
|
1516
|
+
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
1534
1517
|
type: Inject,
|
|
1535
1518
|
args: ['CategoryRepository']
|
|
1536
|
-
}] }] });
|
|
1519
|
+
}] }]; } });
|
|
1537
1520
|
|
|
1538
1521
|
class OldCategoryStructureAdapter {
|
|
1539
1522
|
constructor(categoryRepository) {
|
|
@@ -1545,15 +1528,15 @@ class OldCategoryStructureAdapter {
|
|
|
1545
1528
|
: await this.categoryRepository.get({ id: category.id }).then((categoryFound) => categoryFound.products);
|
|
1546
1529
|
return { id: { operator: Where.IN, value: productsIds } };
|
|
1547
1530
|
}
|
|
1548
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: OldCategoryStructureAdapter, deps: [{ token: 'CategoryRepository' }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1549
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: OldCategoryStructureAdapter }); }
|
|
1550
1531
|
}
|
|
1551
|
-
i0.ɵɵ
|
|
1532
|
+
OldCategoryStructureAdapter.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: OldCategoryStructureAdapter, deps: [{ token: 'CategoryRepository' }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1533
|
+
OldCategoryStructureAdapter.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: OldCategoryStructureAdapter });
|
|
1534
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: OldCategoryStructureAdapter, decorators: [{
|
|
1552
1535
|
type: Injectable
|
|
1553
|
-
}], ctorParameters: ()
|
|
1536
|
+
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
1554
1537
|
type: Inject,
|
|
1555
1538
|
args: ['CategoryRepository']
|
|
1556
|
-
}] }] });
|
|
1539
|
+
}] }]; } });
|
|
1557
1540
|
|
|
1558
1541
|
class CatalogService {
|
|
1559
1542
|
constructor(productRepository, categoryStructureAdapter, shop, productIndex) {
|
|
@@ -1663,41 +1646,27 @@ class CatalogService {
|
|
|
1663
1646
|
}
|
|
1664
1647
|
async findCatalogByTermAndSortByMostRevelant(options, limits) {
|
|
1665
1648
|
const productIds = await this.findCatalogIdsByElasticSearch(options.term);
|
|
1666
|
-
|
|
1667
|
-
// const totalResult = await this.productRepository.findCatalog(
|
|
1668
|
-
// {
|
|
1669
|
-
// fields: ['id'],
|
|
1670
|
-
// filters: {
|
|
1671
|
-
// id: { operator: Where.IN, value: productIds },
|
|
1672
|
-
// ...this.buildFilterQuery(options?.filters || {}),
|
|
1673
|
-
// },
|
|
1674
|
-
// options: {
|
|
1675
|
-
// minimal: ['price'],
|
|
1676
|
-
// maximum: ['price'],
|
|
1677
|
-
// distinct: ['brand'],
|
|
1678
|
-
// },
|
|
1679
|
-
// },
|
|
1680
|
-
// options?.mainGender || this.shop === Shops.MENSMARKET ? 'male' : 'female',
|
|
1681
|
-
// )
|
|
1682
|
-
const totalResult = await this.productRepository.find({
|
|
1649
|
+
const totalResult = await this.productRepository.findCatalog({
|
|
1683
1650
|
fields: ['id'],
|
|
1684
1651
|
filters: {
|
|
1685
1652
|
id: { operator: Where.IN, value: productIds },
|
|
1686
1653
|
...this.buildFilterQuery(options?.filters || {}),
|
|
1687
1654
|
},
|
|
1688
|
-
|
|
1689
|
-
|
|
1655
|
+
options: {
|
|
1656
|
+
minimal: ['price'],
|
|
1657
|
+
maximum: ['price'],
|
|
1658
|
+
distinct: ['brand'],
|
|
1659
|
+
},
|
|
1660
|
+
}, options?.mainGender || this.shop === Shops.MENSMARKET ? 'male' : 'female');
|
|
1690
1661
|
const limitedProductId = totalResult.data
|
|
1691
1662
|
.slice(limits.offset, limits.offset + limits.limit)
|
|
1692
1663
|
.map((product) => product.id);
|
|
1693
1664
|
const orderedId = productIds.filter((product) => limitedProductId.includes(product));
|
|
1694
|
-
console.log('orderedId', orderedId);
|
|
1695
1665
|
const productResult = await this.productRepository.findCatalog({
|
|
1696
1666
|
filters: {
|
|
1697
1667
|
id: { operator: Where.IN, value: orderedId },
|
|
1698
1668
|
},
|
|
1699
1669
|
});
|
|
1700
|
-
console.log('productResult', productResult);
|
|
1701
1670
|
return {
|
|
1702
1671
|
data: limitedProductId.map((id) => productResult.data.find((product) => product.id === id)).filter(Boolean),
|
|
1703
1672
|
count: totalResult.count,
|
|
@@ -1718,12 +1687,12 @@ class CatalogService {
|
|
|
1718
1687
|
return [...new Set(sorted.map(({ _source }) => _source.id))];
|
|
1719
1688
|
}));
|
|
1720
1689
|
}
|
|
1721
|
-
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 }); }
|
|
1722
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: CatalogService }); }
|
|
1723
1690
|
}
|
|
1724
|
-
i0.ɵɵ
|
|
1691
|
+
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 });
|
|
1692
|
+
CatalogService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: CatalogService });
|
|
1693
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: CatalogService, decorators: [{
|
|
1725
1694
|
type: Injectable
|
|
1726
|
-
}], ctorParameters: ()
|
|
1695
|
+
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
1727
1696
|
type: Inject,
|
|
1728
1697
|
args: ['ProductRepository']
|
|
1729
1698
|
}] }, { type: undefined, decorators: [{
|
|
@@ -1732,7 +1701,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.3", ngImpor
|
|
|
1732
1701
|
}] }, { type: i1$2.Shops, decorators: [{
|
|
1733
1702
|
type: Inject,
|
|
1734
1703
|
args: [DEFAULT_SHOP]
|
|
1735
|
-
}] }, { type: i1$2.ProductsIndex }] });
|
|
1704
|
+
}] }, { type: i1$2.ProductsIndex }]; } });
|
|
1736
1705
|
|
|
1737
1706
|
class CategoryService {
|
|
1738
1707
|
constructor(productRepository, categoryRepository, categoryFilterRepository, categoryStructureAdapter, shop) {
|
|
@@ -1758,12 +1727,12 @@ class CategoryService {
|
|
|
1758
1727
|
.find({ filters: { categoryId: +category.id } })
|
|
1759
1728
|
.then(({ data }) => data.map((categoryFilter) => categoryFilter.filter));
|
|
1760
1729
|
}
|
|
1761
|
-
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 }); }
|
|
1762
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: CategoryService }); }
|
|
1763
1730
|
}
|
|
1764
|
-
i0.ɵɵ
|
|
1731
|
+
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 });
|
|
1732
|
+
CategoryService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: CategoryService });
|
|
1733
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: CategoryService, decorators: [{
|
|
1765
1734
|
type: Injectable
|
|
1766
|
-
}], ctorParameters: ()
|
|
1735
|
+
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
1767
1736
|
type: Inject,
|
|
1768
1737
|
args: ['ProductRepository']
|
|
1769
1738
|
}] }, { type: undefined, decorators: [{
|
|
@@ -1778,7 +1747,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.3", ngImpor
|
|
|
1778
1747
|
}] }, { type: i1$2.Shops, decorators: [{
|
|
1779
1748
|
type: Inject,
|
|
1780
1749
|
args: [DEFAULT_SHOP]
|
|
1781
|
-
}] }] });
|
|
1750
|
+
}] }]; } });
|
|
1782
1751
|
|
|
1783
1752
|
var ProductSorts;
|
|
1784
1753
|
(function (ProductSorts) {
|
|
@@ -1884,12 +1853,12 @@ class WishlistService {
|
|
|
1884
1853
|
}
|
|
1885
1854
|
return wishlist;
|
|
1886
1855
|
}
|
|
1887
|
-
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 }); }
|
|
1888
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: WishlistService }); }
|
|
1889
1856
|
}
|
|
1890
|
-
i0.ɵɵ
|
|
1857
|
+
WishlistService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: WishlistService, deps: [{ token: 'WishlistRepository' }, { token: 'CategoryRepository' }, { token: DEFAULT_SHOP }, { token: 'ProductRepository' }, { token: 'CategoryFilterRepository' }, { token: i1$2.ProductsIndex }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1858
|
+
WishlistService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: WishlistService });
|
|
1859
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: WishlistService, decorators: [{
|
|
1891
1860
|
type: Injectable
|
|
1892
|
-
}], ctorParameters: ()
|
|
1861
|
+
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
1893
1862
|
type: Inject,
|
|
1894
1863
|
args: ['WishlistRepository']
|
|
1895
1864
|
}] }, { type: undefined, decorators: [{
|
|
@@ -1904,7 +1873,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.3", ngImpor
|
|
|
1904
1873
|
}] }, { type: undefined, decorators: [{
|
|
1905
1874
|
type: Inject,
|
|
1906
1875
|
args: ['CategoryFilterRepository']
|
|
1907
|
-
}] }, { type: i1$2.ProductsIndex }] });
|
|
1876
|
+
}] }, { type: i1$2.ProductsIndex }]; } });
|
|
1908
1877
|
|
|
1909
1878
|
class CheckoutSubscriptionService {
|
|
1910
1879
|
constructor(checkoutSubscriptionRepository, subscriptionRepository, couponService) {
|
|
@@ -1938,18 +1907,18 @@ class CheckoutSubscriptionService {
|
|
|
1938
1907
|
calcDiscountSubscription(coupon) {
|
|
1939
1908
|
return this.getCheckoutSubscription().pipe(concatMap((checkout) => this.couponService.calcDiscountSubscription(coupon, checkout).pipe()));
|
|
1940
1909
|
}
|
|
1941
|
-
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 }); }
|
|
1942
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: CheckoutSubscriptionService }); }
|
|
1943
1910
|
}
|
|
1944
|
-
i0.ɵɵ
|
|
1911
|
+
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 });
|
|
1912
|
+
CheckoutSubscriptionService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: CheckoutSubscriptionService });
|
|
1913
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: CheckoutSubscriptionService, decorators: [{
|
|
1945
1914
|
type: Injectable
|
|
1946
|
-
}], ctorParameters: ()
|
|
1915
|
+
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
1947
1916
|
type: Inject,
|
|
1948
1917
|
args: ['CheckoutSubscriptionRepository']
|
|
1949
1918
|
}] }, { type: undefined, decorators: [{
|
|
1950
1919
|
type: Inject,
|
|
1951
1920
|
args: ['SubscriptionRepository']
|
|
1952
|
-
}] }, { type: CouponService }] });
|
|
1921
|
+
}] }, { type: CouponService }]; } });
|
|
1953
1922
|
|
|
1954
1923
|
class UtilHelper {
|
|
1955
1924
|
static createSlug(name) {
|
|
@@ -2006,7 +1975,11 @@ class HomeShopService {
|
|
|
2006
1975
|
getHomeData() {
|
|
2007
1976
|
return this.getHomeConfiguration().pipe(map((home) => (home?.data?.expiresAt > new Date() ? home : null)), concatMap((home) => home
|
|
2008
1977
|
? of(home)
|
|
2009
|
-
: forkJoin([
|
|
1978
|
+
: forkJoin([
|
|
1979
|
+
this.getDiscoverProducts(this.gender),
|
|
1980
|
+
this.getFeaturedProducts(this.gender),
|
|
1981
|
+
this.getVerticalProducts(this.gender),
|
|
1982
|
+
]).pipe(map(([discoverProducts, featuredProducts, verticalProducts]) => ({
|
|
2010
1983
|
discoverProducts,
|
|
2011
1984
|
featuredProducts,
|
|
2012
1985
|
verticalProducts,
|
|
@@ -2028,15 +2001,18 @@ class HomeShopService {
|
|
|
2028
2001
|
getMinValueForFreeShipping() {
|
|
2029
2002
|
return this.getHomeConfiguration().pipe(map((home) => home.minValueForFreeShipping));
|
|
2030
2003
|
}
|
|
2031
|
-
getDiscoverProducts() {
|
|
2032
|
-
return this.getHomeConfiguration().pipe(concatMap((home) => from(this.categoryRepository.getCategoriesForHome(home.discoverCategories)).pipe(map((groups) => groups.map(this.buildCategoryGroupWithRequiredData)))));
|
|
2004
|
+
getDiscoverProducts(gender) {
|
|
2005
|
+
return this.getHomeConfiguration().pipe(concatMap((home) => from(this.categoryRepository.getCategoriesForHome(home.discoverCategories, undefined, gender)).pipe(map((groups) => groups.map(this.buildCategoryGroupWithRequiredData)))));
|
|
2033
2006
|
}
|
|
2034
|
-
getFeaturedProducts() {
|
|
2035
|
-
return this.getHomeConfiguration().pipe(concatMap((home) => from(this.categoryRepository.getCategoriesForHome(home.featuredCategories)).pipe(map((groups) => groups.map(this.buildCategoryGroupWithRequiredData)))));
|
|
2007
|
+
getFeaturedProducts(gender) {
|
|
2008
|
+
return this.getHomeConfiguration().pipe(concatMap((home) => from(this.categoryRepository.getCategoriesForHome(home.featuredCategories, undefined, gender)).pipe(map((groups) => groups.map(this.buildCategoryGroupWithRequiredData)))));
|
|
2036
2009
|
}
|
|
2037
|
-
getVerticalProducts() {
|
|
2010
|
+
getVerticalProducts(gender) {
|
|
2038
2011
|
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({
|
|
2039
|
-
filters: {
|
|
2012
|
+
filters: {
|
|
2013
|
+
categories: { operator: Where.IN, value: [category.id] },
|
|
2014
|
+
...(gender ? { tags: { operator: Where.IN, value: [gender] } } : {}),
|
|
2015
|
+
},
|
|
2040
2016
|
limits: { limit: 12 },
|
|
2041
2017
|
})).pipe(map((products) => ({ category, products })))), map(({ category, products }) => ({ category, products: products.data })), map(this.buildCategoryGroupWithRequiredData))))));
|
|
2042
2018
|
}
|
|
@@ -2058,12 +2034,15 @@ class HomeShopService {
|
|
|
2058
2034
|
data,
|
|
2059
2035
|
})).pipe(tap(() => (this.homeConfiguration.data = data)), map(() => this.homeConfiguration));
|
|
2060
2036
|
}
|
|
2061
|
-
|
|
2062
|
-
|
|
2037
|
+
get gender() {
|
|
2038
|
+
return this.homeId === 'mens_market' ? 'masculino' : undefined;
|
|
2039
|
+
}
|
|
2063
2040
|
}
|
|
2064
|
-
i0.ɵɵ
|
|
2041
|
+
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 });
|
|
2042
|
+
HomeShopService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: HomeShopService });
|
|
2043
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: HomeShopService, decorators: [{
|
|
2065
2044
|
type: Injectable
|
|
2066
|
-
}], ctorParameters: ()
|
|
2045
|
+
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
2067
2046
|
type: Inject,
|
|
2068
2047
|
args: ['CategoryRepository']
|
|
2069
2048
|
}] }, { type: undefined, decorators: [{
|
|
@@ -2075,7 +2054,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.3", ngImpor
|
|
|
2075
2054
|
}] }, { type: i1$2.Shops, decorators: [{
|
|
2076
2055
|
type: Inject,
|
|
2077
2056
|
args: [DEFAULT_SHOP]
|
|
2078
|
-
}] }] });
|
|
2057
|
+
}] }]; } });
|
|
2079
2058
|
|
|
2080
2059
|
class OrderService {
|
|
2081
2060
|
constructor(angularFirestore, orderRepository) {
|
|
@@ -2089,15 +2068,15 @@ class OrderService {
|
|
|
2089
2068
|
.subscribe((doc) => this.orderSubject.next(doc));
|
|
2090
2069
|
return this.orderSubject;
|
|
2091
2070
|
}
|
|
2092
|
-
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 }); }
|
|
2093
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: OrderService }); }
|
|
2094
2071
|
}
|
|
2095
|
-
i0.ɵɵ
|
|
2072
|
+
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 });
|
|
2073
|
+
OrderService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: OrderService });
|
|
2074
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: OrderService, decorators: [{
|
|
2096
2075
|
type: Injectable
|
|
2097
|
-
}], ctorParameters: ()
|
|
2076
|
+
}], ctorParameters: function () { return [{ type: i1$1.Firestore }, { type: i1$2.OrderFirestoreRepository, decorators: [{
|
|
2098
2077
|
type: Inject,
|
|
2099
2078
|
args: ['OrderRepository']
|
|
2100
|
-
}] }] });
|
|
2079
|
+
}] }]; } });
|
|
2101
2080
|
|
|
2102
2081
|
class ShippingService {
|
|
2103
2082
|
constructor(http, apiUrl, homeService) {
|
|
@@ -2175,15 +2154,15 @@ class ShippingService {
|
|
|
2175
2154
|
}
|
|
2176
2155
|
return false;
|
|
2177
2156
|
}
|
|
2178
|
-
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 }); }
|
|
2179
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: ShippingService }); }
|
|
2180
2157
|
}
|
|
2181
|
-
i0.ɵɵ
|
|
2158
|
+
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 });
|
|
2159
|
+
ShippingService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: ShippingService });
|
|
2160
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: ShippingService, decorators: [{
|
|
2182
2161
|
type: Injectable
|
|
2183
|
-
}], ctorParameters: ()
|
|
2162
|
+
}], ctorParameters: function () { return [{ type: i1$3.HttpClient }, { type: undefined, decorators: [{
|
|
2184
2163
|
type: Inject,
|
|
2185
2164
|
args: [BACKEND_URL]
|
|
2186
|
-
}] }, { type: HomeShopService }] });
|
|
2165
|
+
}] }, { type: HomeShopService }]; } });
|
|
2187
2166
|
|
|
2188
2167
|
class AngularConnectModule {
|
|
2189
2168
|
static initializeApp(defaultShop, options, nameOrConfig) {
|
|
@@ -2205,38 +2184,38 @@ class AngularConnectModule {
|
|
|
2205
2184
|
],
|
|
2206
2185
|
};
|
|
2207
2186
|
}
|
|
2208
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: AngularConnectModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
2209
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.0.3", ngImport: i0, type: AngularConnectModule, imports: [i1$4.FirebaseAppModule, AngularElasticSeachModule,
|
|
2210
|
-
AngularFirebaseAuthModule,
|
|
2211
|
-
AngularFirestoreModule,
|
|
2212
|
-
AngularHasuraGraphQLModule] }); }
|
|
2213
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: AngularConnectModule, providers: [
|
|
2214
|
-
AuthService,
|
|
2215
|
-
CartService,
|
|
2216
|
-
CatalogService,
|
|
2217
|
-
CategoryService,
|
|
2218
|
-
CheckoutService,
|
|
2219
|
-
CheckoutSubscriptionService,
|
|
2220
|
-
CouponService,
|
|
2221
|
-
HomeShopService,
|
|
2222
|
-
OrderService,
|
|
2223
|
-
ShippingService,
|
|
2224
|
-
WishlistService,
|
|
2225
|
-
], imports: [provideFirebaseApp((injector) => {
|
|
2226
|
-
const appName = injector.get(FIREBASE_APP_NAME) || '[DEFAULT]';
|
|
2227
|
-
try {
|
|
2228
|
-
return getApp(appName);
|
|
2229
|
-
}
|
|
2230
|
-
catch (error) {
|
|
2231
|
-
return initializeApp(injector.get(FIREBASE_OPTIONS), appName);
|
|
2232
|
-
}
|
|
2233
|
-
}),
|
|
2234
|
-
AngularElasticSeachModule,
|
|
2235
|
-
AngularFirebaseAuthModule,
|
|
2236
|
-
AngularFirestoreModule,
|
|
2237
|
-
AngularHasuraGraphQLModule] }); }
|
|
2238
2187
|
}
|
|
2239
|
-
i0.ɵɵ
|
|
2188
|
+
AngularConnectModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: AngularConnectModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
2189
|
+
AngularConnectModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.1.0", ngImport: i0, type: AngularConnectModule, imports: [i1$4.FirebaseAppModule, AngularElasticSeachModule,
|
|
2190
|
+
AngularFirebaseAuthModule,
|
|
2191
|
+
AngularFirestoreModule,
|
|
2192
|
+
AngularHasuraGraphQLModule] });
|
|
2193
|
+
AngularConnectModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: AngularConnectModule, providers: [
|
|
2194
|
+
AuthService,
|
|
2195
|
+
CartService,
|
|
2196
|
+
CatalogService,
|
|
2197
|
+
CategoryService,
|
|
2198
|
+
CheckoutService,
|
|
2199
|
+
CheckoutSubscriptionService,
|
|
2200
|
+
CouponService,
|
|
2201
|
+
HomeShopService,
|
|
2202
|
+
OrderService,
|
|
2203
|
+
ShippingService,
|
|
2204
|
+
WishlistService,
|
|
2205
|
+
], imports: [provideFirebaseApp((injector) => {
|
|
2206
|
+
const appName = injector.get(FIREBASE_APP_NAME) || '[DEFAULT]';
|
|
2207
|
+
try {
|
|
2208
|
+
return getApp(appName);
|
|
2209
|
+
}
|
|
2210
|
+
catch (error) {
|
|
2211
|
+
return initializeApp(injector.get(FIREBASE_OPTIONS), appName);
|
|
2212
|
+
}
|
|
2213
|
+
}),
|
|
2214
|
+
AngularElasticSeachModule,
|
|
2215
|
+
AngularFirebaseAuthModule,
|
|
2216
|
+
AngularFirestoreModule,
|
|
2217
|
+
AngularHasuraGraphQLModule] });
|
|
2218
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: AngularConnectModule, decorators: [{
|
|
2240
2219
|
type: NgModule,
|
|
2241
2220
|
args: [{
|
|
2242
2221
|
imports: [
|