@infrab4a/connect-angular 5.0.0-beta.74 → 5.0.0-beta.76
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/angular-connect.module.d.ts +11 -8
- package/angular-hasura-graphql.module.d.ts +1 -1
- package/consts/firebase-const.d.ts +1 -0
- package/esm2022/angular-connect.module.mjs +52 -9
- package/esm2022/angular-elastic-search.module.mjs +1 -1
- package/esm2022/angular-firebase-auth.module.mjs +30 -4
- package/esm2022/angular-firestore.module.mjs +16 -2
- package/esm2022/angular-hasura-graphql.module.mjs +24 -2
- package/esm2022/angular-vertex-search.module.mjs +1 -1
- package/esm2022/consts/category-structure.mjs +1 -1
- package/esm2022/consts/default-shop.const.mjs +1 -1
- package/esm2022/consts/es-config.const.mjs +1 -1
- package/esm2022/consts/firebase-const.mjs +2 -1
- package/esm2022/consts/hasura-options.const.mjs +1 -1
- package/esm2022/consts/index.mjs +1 -1
- package/esm2022/consts/persistence.const.mjs +1 -1
- package/esm2022/consts/storage-base-url.const.mjs +1 -1
- package/esm2022/consts/vertex-config.const.mjs +1 -1
- package/esm2022/helpers/index.mjs +1 -1
- package/esm2022/helpers/mobile-operation-system-checker.helper.mjs +1 -1
- package/esm2022/index.mjs +1 -1
- package/esm2022/persistence/cookie-data-persistence.mjs +1 -1
- package/esm2022/persistence/data-persistence.mjs +1 -1
- package/esm2022/persistence/index.mjs +1 -1
- package/esm2022/services/auth.service.mjs +1 -1
- package/esm2022/services/cart.service.mjs +1 -1
- package/esm2022/services/catalog/adapters/category-structure.adapter.mjs +1 -1
- package/esm2022/services/catalog/adapters/index.mjs +1 -1
- package/esm2022/services/catalog/adapters/new-category-structure.adapter.mjs +1 -1
- package/esm2022/services/catalog/adapters/old-category-structure.adapter.mjs +1 -1
- package/esm2022/services/catalog/catalog.service.mjs +1 -1
- package/esm2022/services/catalog/category.service.mjs +1 -1
- package/esm2022/services/catalog/enums/index.mjs +1 -1
- package/esm2022/services/catalog/enums/product-sorts.enum.mjs +1 -1
- package/esm2022/services/catalog/index.mjs +1 -1
- package/esm2022/services/catalog/models/category-with-tree.model.mjs +1 -1
- package/esm2022/services/catalog/models/index.mjs +1 -1
- package/esm2022/services/catalog/types/index.mjs +1 -1
- package/esm2022/services/catalog/types/product-sort.type.mjs +1 -1
- package/esm2022/services/catalog/wishlist.service.mjs +1 -1
- package/esm2022/services/checkout-subscription.service.mjs +1 -1
- package/esm2022/services/checkout.service.mjs +1 -1
- package/esm2022/services/coupon.service.mjs +7 -3
- package/esm2022/services/helpers/index.mjs +1 -1
- package/esm2022/services/helpers/util.helper.mjs +1 -1
- package/esm2022/services/home-shop.service.mjs +1 -1
- package/esm2022/services/index.mjs +1 -1
- package/esm2022/services/order.service.mjs +1 -1
- package/esm2022/services/shipping.service.mjs +1 -1
- package/esm2022/services/types/index.mjs +1 -1
- package/esm2022/services/types/required-checkout-data.type.mjs +1 -1
- package/esm2022/services/types/required-checkout-subscription-data.type.mjs +1 -1
- package/esm2022/services/types/shipping-methods.type.mjs +1 -1
- package/esm2022/types/firebase-app-config.type.mjs +1 -1
- package/esm2022/types/index.mjs +1 -1
- package/fesm2022/infrab4a-connect-angular.mjs +123 -13
- package/fesm2022/infrab4a-connect-angular.mjs.map +1 -1
- package/package.json +2 -2
|
@@ -2,12 +2,14 @@ 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
4
|
import { FirebaseApp, provideFirebaseApp, getApp, initializeApp } from '@angular/fire/app';
|
|
5
|
-
import * as i2 from '@angular/fire/
|
|
5
|
+
import * as i2 from '@angular/fire/app-check';
|
|
6
|
+
import { provideAppCheck, initializeAppCheck } from '@angular/fire/app-check';
|
|
7
|
+
import * as i3 from '@angular/fire/storage';
|
|
6
8
|
import { Storage, provideStorage, getStorage } from '@angular/fire/storage';
|
|
7
9
|
import * as i1$2 from '@infrab4a/connect';
|
|
8
|
-
import { ProductsIndex, AxiosAdapter, Authentication, AuthenticationFirebaseAuthService, Register, RegisterFirebaseAuthService, SignOut, RecoveryPassword, ConnectFirestoreService, 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, OrderBlockedFirestoreRepository, LogFirestoreRepository, CategoryHasuraGraphQLRepository, ProductHasuraGraphQLRepository, CategoryFilterHasuraGraphQLRepository, ProductReviewsHasuraGraphQLRepository, VariantHasuraGraphQLRepository, ProductStockNotificationHasuraGraphQLRepository, FilterOptionHasuraGraphQLRepository, FilterHasuraGraphQLRepository, CategoryCollectionChildrenHasuraGraphQLRepository, CategoryProductHasuraGraphQLRepository, WishlistHasuraGraphQLRepository, ProductsVertexSearch, VertexAxiosAdapter, Where, Shops, CheckoutTypes, CouponTypes, Exclusivities, OrderStatus, isNil, NotFoundError, Checkout, pick, LineItem, RoundProductPricesHelper, set, InvalidArgumentError, isEmpty, Category, PersonTypes, WishlistLogType, Wishlist, CheckoutSubscription, Product, RequiredArgumentError, add, Order, UpdateUserImage, FirebaseFileUploaderService } from '@infrab4a/connect';
|
|
10
|
+
import { ProductsIndex, AxiosAdapter, Authentication, AuthenticationFirebaseAuthService, Register, RegisterFirebaseAuthService, SignOut, RecoveryPassword, ConnectFirestoreService, 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, OrderBlockedFirestoreRepository, LogFirestoreRepository, SequenceFirestoreRepository, CategoryHasuraGraphQLRepository, ProductHasuraGraphQLRepository, CategoryFilterHasuraGraphQLRepository, ProductReviewsHasuraGraphQLRepository, VariantHasuraGraphQLRepository, ProductStockNotificationHasuraGraphQLRepository, FilterOptionHasuraGraphQLRepository, FilterHasuraGraphQLRepository, CategoryCollectionChildrenHasuraGraphQLRepository, CategoryProductHasuraGraphQLRepository, WishlistHasuraGraphQLRepository, ProductErrorsHasuraGraphQLRepository, ProductsVertexSearch, VertexAxiosAdapter, Where, Shops, CheckoutTypes, CouponTypes, Exclusivities, OrderStatus, isNil, NotFoundError, Checkout, pick, LineItem, RoundProductPricesHelper, set, InvalidArgumentError, isEmpty, Category, PersonTypes, WishlistLogType, Wishlist, CheckoutSubscription, Product, RequiredArgumentError, add, Order, UpdateUserImage, FirebaseFileUploaderService } from '@infrab4a/connect';
|
|
9
11
|
import * as i1 from '@angular/fire/auth';
|
|
10
|
-
import { Auth, provideAuth, getAuth, getIdToken, authState } from '@angular/fire/auth';
|
|
12
|
+
import { Auth, provideAuth, initializeAuth, indexedDBLocalPersistence, browserLocalPersistence, getAuth, getIdToken, authState } from '@angular/fire/auth';
|
|
11
13
|
import { isPlatformBrowser, isPlatformServer } from '@angular/common';
|
|
12
14
|
import * as i1$1 from '@angular/fire/firestore';
|
|
13
15
|
import { Firestore, provideFirestore, initializeFirestore, memoryLocalCache, docSnapshots, doc } from '@angular/fire/firestore';
|
|
@@ -58,6 +60,7 @@ const DEFAULT_SHOP = 'DEFAULT_SHOP';
|
|
|
58
60
|
|
|
59
61
|
const FIREBASE_APP_NAME = new InjectionToken('firebaseAppName');
|
|
60
62
|
const FIREBASE_OPTIONS = new InjectionToken('firebaseOptions');
|
|
63
|
+
const APP_CHECK_PROVIDER = new InjectionToken('appCheckProvider');
|
|
61
64
|
|
|
62
65
|
const HASURA_OPTIONS = 'HASURA_OPTIONS';
|
|
63
66
|
|
|
@@ -120,12 +123,38 @@ class AngularFirebaseAuthModule {
|
|
|
120
123
|
},
|
|
121
124
|
deps: ['AuthenticationService'],
|
|
122
125
|
},
|
|
123
|
-
], imports: [provideAuth((injector) =>
|
|
126
|
+
], imports: [provideAuth((injector) => {
|
|
127
|
+
const app = injector.get(FirebaseApp);
|
|
128
|
+
try {
|
|
129
|
+
return initializeAuth(app, {
|
|
130
|
+
persistence: [indexedDBLocalPersistence, browserLocalPersistence],
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
catch (error) {
|
|
134
|
+
if (error instanceof Error)
|
|
135
|
+
console.error('Error initializing auth', error.message);
|
|
136
|
+
return getAuth(app);
|
|
137
|
+
}
|
|
138
|
+
})] }); }
|
|
124
139
|
}
|
|
125
140
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: AngularFirebaseAuthModule, decorators: [{
|
|
126
141
|
type: NgModule,
|
|
127
142
|
args: [{
|
|
128
|
-
imports: [
|
|
143
|
+
imports: [
|
|
144
|
+
provideAuth((injector) => {
|
|
145
|
+
const app = injector.get(FirebaseApp);
|
|
146
|
+
try {
|
|
147
|
+
return initializeAuth(app, {
|
|
148
|
+
persistence: [indexedDBLocalPersistence, browserLocalPersistence],
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
catch (error) {
|
|
152
|
+
if (error instanceof Error)
|
|
153
|
+
console.error('Error initializing auth', error.message);
|
|
154
|
+
return getAuth(app);
|
|
155
|
+
}
|
|
156
|
+
}),
|
|
157
|
+
],
|
|
129
158
|
providers: [
|
|
130
159
|
{
|
|
131
160
|
provide: 'Authentication',
|
|
@@ -419,6 +448,13 @@ class AngularFirestoreModule {
|
|
|
419
448
|
},
|
|
420
449
|
deps: ['FirestoreOptions'],
|
|
421
450
|
},
|
|
451
|
+
{
|
|
452
|
+
provide: 'SequenceRepository',
|
|
453
|
+
useFactory: (options) => {
|
|
454
|
+
return new SequenceFirestoreRepository(options);
|
|
455
|
+
},
|
|
456
|
+
deps: ['FirestoreOptions'],
|
|
457
|
+
},
|
|
422
458
|
], imports: [AngularElasticSeachModule,
|
|
423
459
|
provideFirestore((injector) => {
|
|
424
460
|
const platformId = injector.get(PLATFORM_ID);
|
|
@@ -679,6 +715,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.3", ngImpor
|
|
|
679
715
|
},
|
|
680
716
|
deps: ['FirestoreOptions'],
|
|
681
717
|
},
|
|
718
|
+
{
|
|
719
|
+
provide: 'SequenceRepository',
|
|
720
|
+
useFactory: (options) => {
|
|
721
|
+
return new SequenceFirestoreRepository(options);
|
|
722
|
+
},
|
|
723
|
+
deps: ['FirestoreOptions'],
|
|
724
|
+
},
|
|
682
725
|
],
|
|
683
726
|
}]
|
|
684
727
|
}] });
|
|
@@ -835,6 +878,17 @@ class AngularHasuraGraphQLModule {
|
|
|
835
878
|
provide: 'WishlistRepository',
|
|
836
879
|
useExisting: WishlistHasuraGraphQLRepository,
|
|
837
880
|
},
|
|
881
|
+
{
|
|
882
|
+
provide: ProductErrorsHasuraGraphQLRepository,
|
|
883
|
+
useFactory: (options) => {
|
|
884
|
+
return new ProductErrorsHasuraGraphQLRepository(options);
|
|
885
|
+
},
|
|
886
|
+
deps: ['HasuraConfig'],
|
|
887
|
+
},
|
|
888
|
+
{
|
|
889
|
+
provide: 'ProductErrorsRepository',
|
|
890
|
+
useExisting: ProductErrorsHasuraGraphQLRepository,
|
|
891
|
+
},
|
|
838
892
|
] }); }
|
|
839
893
|
}
|
|
840
894
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: AngularHasuraGraphQLModule, decorators: [{
|
|
@@ -983,6 +1037,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.3", ngImpor
|
|
|
983
1037
|
provide: 'WishlistRepository',
|
|
984
1038
|
useExisting: WishlistHasuraGraphQLRepository,
|
|
985
1039
|
},
|
|
1040
|
+
{
|
|
1041
|
+
provide: ProductErrorsHasuraGraphQLRepository,
|
|
1042
|
+
useFactory: (options) => {
|
|
1043
|
+
return new ProductErrorsHasuraGraphQLRepository(options);
|
|
1044
|
+
},
|
|
1045
|
+
deps: ['HasuraConfig'],
|
|
1046
|
+
},
|
|
1047
|
+
{
|
|
1048
|
+
provide: 'ProductErrorsRepository',
|
|
1049
|
+
useExisting: ProductErrorsHasuraGraphQLRepository,
|
|
1050
|
+
},
|
|
986
1051
|
],
|
|
987
1052
|
}]
|
|
988
1053
|
}] });
|
|
@@ -1162,7 +1227,7 @@ class CouponService {
|
|
|
1162
1227
|
const discount = +(subTotal * ((value > 100 ? 100 : value) / 100)).toFixed(2);
|
|
1163
1228
|
return { discount, lineItems: checkout.lineItems };
|
|
1164
1229
|
}
|
|
1165
|
-
|
|
1230
|
+
const lineItensElegibleForDiscount = await this.getLineItensEligebleForDiscount(categories, checkout);
|
|
1166
1231
|
const subTotal = this.calcCheckoutSubtotal(lineItensElegibleForDiscount, checkout.user);
|
|
1167
1232
|
if (type == CouponTypes.ABSOLUTE) {
|
|
1168
1233
|
discount = value > subTotal ? subTotal : value;
|
|
@@ -1176,7 +1241,7 @@ class CouponService {
|
|
|
1176
1241
|
async hasMinSubTotal(coupon, checkout) {
|
|
1177
1242
|
if (!coupon.minSubTotalValue)
|
|
1178
1243
|
return true;
|
|
1179
|
-
|
|
1244
|
+
const lineItensDiscount = await this.getLineItensEligebleForDiscount(coupon.productsCategories, checkout);
|
|
1180
1245
|
const subTotal = this.calcCheckoutSubtotal(lineItensDiscount, checkout.user);
|
|
1181
1246
|
if (coupon.minSubTotalValue <= subTotal)
|
|
1182
1247
|
return true;
|
|
@@ -1299,6 +1364,8 @@ class CouponService {
|
|
|
1299
1364
|
if (type === CouponTypes.ABSOLUTE) {
|
|
1300
1365
|
const couponDiscountMax = couponDiscount > subTotal ? subTotal : couponDiscount;
|
|
1301
1366
|
lineItemsDiscount = lineItems.map((item) => {
|
|
1367
|
+
if (item.isGift)
|
|
1368
|
+
return item;
|
|
1302
1369
|
const totalItemPercentage = item.pricePaid / subTotal;
|
|
1303
1370
|
const discountItem = couponDiscountMax * totalItemPercentage;
|
|
1304
1371
|
return {
|
|
@@ -1309,6 +1376,8 @@ class CouponService {
|
|
|
1309
1376
|
}
|
|
1310
1377
|
else {
|
|
1311
1378
|
lineItemsDiscount = lineItems.map((item) => {
|
|
1379
|
+
if (item.isGift)
|
|
1380
|
+
return item;
|
|
1312
1381
|
const discountItem = item.pricePaid * (couponDiscount / 100);
|
|
1313
1382
|
return {
|
|
1314
1383
|
...item,
|
|
@@ -2614,6 +2683,8 @@ class AngularConnectModule {
|
|
|
2614
2683
|
return {
|
|
2615
2684
|
ngModule: AngularConnectModule,
|
|
2616
2685
|
providers: [
|
|
2686
|
+
{ provide: FIREBASE_APP_NAME, useValue: nameOrConfig },
|
|
2687
|
+
{ provide: APP_CHECK_PROVIDER, useValue: options.appCheckProvider },
|
|
2617
2688
|
{
|
|
2618
2689
|
provide: CATEGORY_STRUCTURE,
|
|
2619
2690
|
useClass: isNil(options?.oldCategoryStructure) || options?.oldCategoryStructure
|
|
@@ -2623,7 +2694,6 @@ class AngularConnectModule {
|
|
|
2623
2694
|
{ provide: PERSISTENCE_PROVIDER, useClass: options?.persistenceProvider || CookieDataPersistence },
|
|
2624
2695
|
...(isNil(defaultShop) ? [] : [{ provide: DEFAULT_SHOP, useValue: defaultShop }]),
|
|
2625
2696
|
...(isNil(options?.firebase) ? [] : [{ provide: FIREBASE_OPTIONS, useValue: options?.firebase }]),
|
|
2626
|
-
...(isNil(options?.firebase) ? [] : [{ provide: FIREBASE_APP_NAME, useValue: nameOrConfig }]),
|
|
2627
2697
|
...(isNil(options?.elasticSearch) ? [] : [{ provide: ES_CONFIG, useValue: options.elasticSearch }]),
|
|
2628
2698
|
...(isNil(options?.vertexConfig) ? [] : [{ provide: VERTEX_CONFIG, useValue: options.vertexConfig }]),
|
|
2629
2699
|
...(isNil(options?.hasura) ? [] : [{ provide: HASURA_OPTIONS, useValue: options.hasura }]),
|
|
@@ -2633,7 +2703,7 @@ class AngularConnectModule {
|
|
|
2633
2703
|
};
|
|
2634
2704
|
}
|
|
2635
2705
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: AngularConnectModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
2636
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.0.3", ngImport: i0, type: AngularConnectModule, imports: [i1$4.FirebaseAppModule, i2.StorageModule, AngularElasticSeachModule,
|
|
2706
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.0.3", ngImport: i0, type: AngularConnectModule, imports: [i1$4.FirebaseAppModule, i2.AppCheckModule, i3.StorageModule, AngularElasticSeachModule,
|
|
2637
2707
|
AngularVertexSeachModule,
|
|
2638
2708
|
AngularFirebaseAuthModule,
|
|
2639
2709
|
AngularFirestoreModule,
|
|
@@ -2669,14 +2739,34 @@ class AngularConnectModule {
|
|
|
2669
2739
|
useExisting: ProductsVertexSearch,
|
|
2670
2740
|
},
|
|
2671
2741
|
], imports: [provideFirebaseApp((injector) => {
|
|
2672
|
-
const appName = injector.get(FIREBASE_APP_NAME)
|
|
2742
|
+
const appName = injector.get(FIREBASE_APP_NAME);
|
|
2673
2743
|
try {
|
|
2674
|
-
|
|
2744
|
+
const app = appName ? getApp(appName) : getApp();
|
|
2745
|
+
return app;
|
|
2675
2746
|
}
|
|
2676
2747
|
catch (error) {
|
|
2748
|
+
console.warn('Firebase app not found, initializing new app');
|
|
2749
|
+
if (error instanceof Error)
|
|
2750
|
+
console.error(error.message);
|
|
2677
2751
|
return initializeApp(injector.get(FIREBASE_OPTIONS), appName);
|
|
2678
2752
|
}
|
|
2679
2753
|
}),
|
|
2754
|
+
provideAppCheck((injector) => {
|
|
2755
|
+
const app = injector.get(FirebaseApp);
|
|
2756
|
+
try {
|
|
2757
|
+
const provider = injector.get(APP_CHECK_PROVIDER);
|
|
2758
|
+
if (provider)
|
|
2759
|
+
return initializeAppCheck(app, {
|
|
2760
|
+
provider,
|
|
2761
|
+
isTokenAutoRefreshEnabled: true,
|
|
2762
|
+
});
|
|
2763
|
+
}
|
|
2764
|
+
catch (error) {
|
|
2765
|
+
if (error instanceof Error)
|
|
2766
|
+
console.error(error.message);
|
|
2767
|
+
return;
|
|
2768
|
+
}
|
|
2769
|
+
}),
|
|
2680
2770
|
provideStorage((injector) => getStorage(injector.get(FirebaseApp))),
|
|
2681
2771
|
AngularElasticSeachModule,
|
|
2682
2772
|
AngularVertexSeachModule,
|
|
@@ -2689,14 +2779,34 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.3", ngImpor
|
|
|
2689
2779
|
args: [{
|
|
2690
2780
|
imports: [
|
|
2691
2781
|
provideFirebaseApp((injector) => {
|
|
2692
|
-
const appName = injector.get(FIREBASE_APP_NAME)
|
|
2782
|
+
const appName = injector.get(FIREBASE_APP_NAME);
|
|
2693
2783
|
try {
|
|
2694
|
-
|
|
2784
|
+
const app = appName ? getApp(appName) : getApp();
|
|
2785
|
+
return app;
|
|
2695
2786
|
}
|
|
2696
2787
|
catch (error) {
|
|
2788
|
+
console.warn('Firebase app not found, initializing new app');
|
|
2789
|
+
if (error instanceof Error)
|
|
2790
|
+
console.error(error.message);
|
|
2697
2791
|
return initializeApp(injector.get(FIREBASE_OPTIONS), appName);
|
|
2698
2792
|
}
|
|
2699
2793
|
}),
|
|
2794
|
+
provideAppCheck((injector) => {
|
|
2795
|
+
const app = injector.get(FirebaseApp);
|
|
2796
|
+
try {
|
|
2797
|
+
const provider = injector.get(APP_CHECK_PROVIDER);
|
|
2798
|
+
if (provider)
|
|
2799
|
+
return initializeAppCheck(app, {
|
|
2800
|
+
provider,
|
|
2801
|
+
isTokenAutoRefreshEnabled: true,
|
|
2802
|
+
});
|
|
2803
|
+
}
|
|
2804
|
+
catch (error) {
|
|
2805
|
+
if (error instanceof Error)
|
|
2806
|
+
console.error(error.message);
|
|
2807
|
+
return;
|
|
2808
|
+
}
|
|
2809
|
+
}),
|
|
2700
2810
|
provideStorage((injector) => getStorage(injector.get(FirebaseApp))),
|
|
2701
2811
|
AngularElasticSeachModule,
|
|
2702
2812
|
AngularVertexSeachModule,
|