@infrab4a/connect-angular 4.17.0-beta.13 → 4.17.0-beta.3
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 +1 -2
- package/consts/firebase-const.d.ts +1 -1
- package/esm2020/angular-connect.module.mjs +24 -44
- package/esm2020/angular-firebase-auth.module.mjs +4 -32
- package/esm2020/consts/firebase-const.mjs +2 -2
- package/fesm2015/infrab4a-connect-angular.mjs +25 -73
- package/fesm2015/infrab4a-connect-angular.mjs.map +1 -1
- package/fesm2020/infrab4a-connect-angular.mjs +25 -73
- package/fesm2020/infrab4a-connect-angular.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -3,13 +3,13 @@ import { NgModule, InjectionToken, PLATFORM_ID, Injectable, Inject } from '@angu
|
|
|
3
3
|
import * as i1$4 from '@angular/fire/app';
|
|
4
4
|
import { FirebaseApp, provideFirebaseApp, getApp, initializeApp } from '@angular/fire/app';
|
|
5
5
|
import * as i2 from '@angular/fire/app-check';
|
|
6
|
-
import { provideAppCheck, initializeAppCheck } from '@angular/fire/app-check';
|
|
6
|
+
import { provideAppCheck, initializeAppCheck, ReCaptchaEnterpriseProvider } from '@angular/fire/app-check';
|
|
7
7
|
import * as i3 from '@angular/fire/storage';
|
|
8
8
|
import { Storage, provideStorage, getStorage } from '@angular/fire/storage';
|
|
9
9
|
import * as i1$2 from '@infrab4a/connect';
|
|
10
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, 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';
|
|
11
11
|
import * as i1 from '@angular/fire/auth';
|
|
12
|
-
import { Auth, provideAuth,
|
|
12
|
+
import { Auth, provideAuth, getAuth, getIdToken, authState } from '@angular/fire/auth';
|
|
13
13
|
import { isPlatformBrowser, isPlatformServer } from '@angular/common';
|
|
14
14
|
import * as i1$1 from '@angular/fire/firestore';
|
|
15
15
|
import { Firestore, provideFirestore, initializeFirestore, memoryLocalCache, docSnapshots, doc } from '@angular/fire/firestore';
|
|
@@ -60,7 +60,7 @@ const DEFAULT_SHOP = 'DEFAULT_SHOP';
|
|
|
60
60
|
|
|
61
61
|
const FIREBASE_APP_NAME = new InjectionToken('firebaseAppName');
|
|
62
62
|
const FIREBASE_OPTIONS = new InjectionToken('firebaseOptions');
|
|
63
|
-
const
|
|
63
|
+
const RECAPTCHA_SITE_KEY = new InjectionToken('recaptchaSiteKey');
|
|
64
64
|
|
|
65
65
|
const HASURA_OPTIONS = 'HASURA_OPTIONS';
|
|
66
66
|
|
|
@@ -124,39 +124,11 @@ AngularFirebaseAuthModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0
|
|
|
124
124
|
},
|
|
125
125
|
deps: ['AuthenticationService'],
|
|
126
126
|
},
|
|
127
|
-
], imports: [provideAuth((injector) =>
|
|
128
|
-
const app = injector.get(FirebaseApp);
|
|
129
|
-
try {
|
|
130
|
-
console.log('Initializing auth', app.name);
|
|
131
|
-
return initializeAuth(app, {
|
|
132
|
-
persistence: [indexedDBLocalPersistence, browserLocalPersistence],
|
|
133
|
-
});
|
|
134
|
-
}
|
|
135
|
-
catch (error) {
|
|
136
|
-
if (error instanceof Error)
|
|
137
|
-
console.error('Error initializing auth', error.message);
|
|
138
|
-
return getAuth(app);
|
|
139
|
-
}
|
|
140
|
-
})] });
|
|
127
|
+
], imports: [provideAuth((injector) => getAuth(injector.get(FirebaseApp)))] });
|
|
141
128
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: AngularFirebaseAuthModule, decorators: [{
|
|
142
129
|
type: NgModule,
|
|
143
130
|
args: [{
|
|
144
|
-
imports: [
|
|
145
|
-
provideAuth((injector) => {
|
|
146
|
-
const app = injector.get(FirebaseApp);
|
|
147
|
-
try {
|
|
148
|
-
console.log('Initializing auth', app.name);
|
|
149
|
-
return initializeAuth(app, {
|
|
150
|
-
persistence: [indexedDBLocalPersistence, browserLocalPersistence],
|
|
151
|
-
});
|
|
152
|
-
}
|
|
153
|
-
catch (error) {
|
|
154
|
-
if (error instanceof Error)
|
|
155
|
-
console.error('Error initializing auth', error.message);
|
|
156
|
-
return getAuth(app);
|
|
157
|
-
}
|
|
158
|
-
}),
|
|
159
|
-
],
|
|
131
|
+
imports: [provideAuth((injector) => getAuth(injector.get(FirebaseApp)))],
|
|
160
132
|
providers: [
|
|
161
133
|
{
|
|
162
134
|
provide: 'Authentication',
|
|
@@ -2645,8 +2617,6 @@ class AngularConnectModule {
|
|
|
2645
2617
|
return {
|
|
2646
2618
|
ngModule: AngularConnectModule,
|
|
2647
2619
|
providers: [
|
|
2648
|
-
{ provide: FIREBASE_APP_NAME, useValue: nameOrConfig },
|
|
2649
|
-
{ provide: APP_CHECK_PROVIDER, useValue: options.appCheckProvider },
|
|
2650
2620
|
{
|
|
2651
2621
|
provide: CATEGORY_STRUCTURE,
|
|
2652
2622
|
useClass: isNil(options?.oldCategoryStructure) || options?.oldCategoryStructure
|
|
@@ -2656,11 +2626,15 @@ class AngularConnectModule {
|
|
|
2656
2626
|
{ provide: PERSISTENCE_PROVIDER, useClass: options?.persistenceProvider || CookieDataPersistence },
|
|
2657
2627
|
...(isNil(defaultShop) ? [] : [{ provide: DEFAULT_SHOP, useValue: defaultShop }]),
|
|
2658
2628
|
...(isNil(options?.firebase) ? [] : [{ provide: FIREBASE_OPTIONS, useValue: options?.firebase }]),
|
|
2629
|
+
...(isNil(options?.firebase) ? [] : [{ provide: FIREBASE_APP_NAME, useValue: nameOrConfig }]),
|
|
2659
2630
|
...(isNil(options?.elasticSearch) ? [] : [{ provide: ES_CONFIG, useValue: options.elasticSearch }]),
|
|
2660
2631
|
...(isNil(options?.vertexConfig) ? [] : [{ provide: VERTEX_CONFIG, useValue: options.vertexConfig }]),
|
|
2661
2632
|
...(isNil(options?.hasura) ? [] : [{ provide: HASURA_OPTIONS, useValue: options.hasura }]),
|
|
2662
2633
|
...(isNil(options?.backendUrl) ? [] : [{ provide: BACKEND_URL, useValue: options.backendUrl }]),
|
|
2663
2634
|
...(isNil(options?.storageBaseUrl) ? [] : [{ provide: STORAGE_BASE_URL, useValue: options.storageBaseUrl }]),
|
|
2635
|
+
...(isNil(options?.recaptchaSiteKey)
|
|
2636
|
+
? []
|
|
2637
|
+
: [{ provide: RECAPTCHA_SITE_KEY, useValue: options.recaptchaSiteKey }]),
|
|
2664
2638
|
],
|
|
2665
2639
|
};
|
|
2666
2640
|
}
|
|
@@ -2704,36 +2678,25 @@ AngularConnectModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", ve
|
|
|
2704
2678
|
], imports: [provideFirebaseApp((injector) => {
|
|
2705
2679
|
const appName = injector.get(FIREBASE_APP_NAME);
|
|
2706
2680
|
try {
|
|
2707
|
-
|
|
2708
|
-
console.log('Connect initializeApp', app.name);
|
|
2709
|
-
return app;
|
|
2681
|
+
return appName ? getApp(appName) : getApp();
|
|
2710
2682
|
}
|
|
2711
2683
|
catch (error) {
|
|
2712
|
-
console.warn('Firebase app not found, initializing new app');
|
|
2713
|
-
if (error instanceof Error) {
|
|
2714
|
-
console.error(error.message);
|
|
2715
|
-
}
|
|
2716
2684
|
return initializeApp(injector.get(FIREBASE_OPTIONS), appName);
|
|
2717
2685
|
}
|
|
2718
2686
|
}),
|
|
2719
2687
|
provideAppCheck((injector) => {
|
|
2720
2688
|
const app = injector.get(FirebaseApp);
|
|
2721
|
-
console.log('Connect APP', app.name);
|
|
2722
|
-
console.log('Connect APP', JSON.stringify(app.options));
|
|
2723
2689
|
try {
|
|
2724
|
-
const
|
|
2725
|
-
|
|
2726
|
-
|
|
2727
|
-
|
|
2728
|
-
|
|
2729
|
-
isTokenAutoRefreshEnabled: true,
|
|
2730
|
-
});
|
|
2690
|
+
const siteKey = injector.get(RECAPTCHA_SITE_KEY);
|
|
2691
|
+
return initializeAppCheck(app, {
|
|
2692
|
+
provider: isEmpty(siteKey) ? undefined : new ReCaptchaEnterpriseProvider(siteKey),
|
|
2693
|
+
isTokenAutoRefreshEnabled: true,
|
|
2694
|
+
});
|
|
2731
2695
|
}
|
|
2732
2696
|
catch (error) {
|
|
2733
|
-
|
|
2734
|
-
console.error(error.message);
|
|
2735
|
-
return;
|
|
2697
|
+
console.warn('ReCAPTCHA site key not provided or invalid, App Check not initialized');
|
|
2736
2698
|
}
|
|
2699
|
+
return;
|
|
2737
2700
|
}),
|
|
2738
2701
|
provideStorage((injector) => getStorage(injector.get(FirebaseApp))),
|
|
2739
2702
|
AngularElasticSeachModule,
|
|
@@ -2748,36 +2711,25 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImpor
|
|
|
2748
2711
|
provideFirebaseApp((injector) => {
|
|
2749
2712
|
const appName = injector.get(FIREBASE_APP_NAME);
|
|
2750
2713
|
try {
|
|
2751
|
-
|
|
2752
|
-
console.log('Connect initializeApp', app.name);
|
|
2753
|
-
return app;
|
|
2714
|
+
return appName ? getApp(appName) : getApp();
|
|
2754
2715
|
}
|
|
2755
2716
|
catch (error) {
|
|
2756
|
-
console.warn('Firebase app not found, initializing new app');
|
|
2757
|
-
if (error instanceof Error) {
|
|
2758
|
-
console.error(error.message);
|
|
2759
|
-
}
|
|
2760
2717
|
return initializeApp(injector.get(FIREBASE_OPTIONS), appName);
|
|
2761
2718
|
}
|
|
2762
2719
|
}),
|
|
2763
2720
|
provideAppCheck((injector) => {
|
|
2764
2721
|
const app = injector.get(FirebaseApp);
|
|
2765
|
-
console.log('Connect APP', app.name);
|
|
2766
|
-
console.log('Connect APP', JSON.stringify(app.options));
|
|
2767
2722
|
try {
|
|
2768
|
-
const
|
|
2769
|
-
|
|
2770
|
-
|
|
2771
|
-
|
|
2772
|
-
|
|
2773
|
-
isTokenAutoRefreshEnabled: true,
|
|
2774
|
-
});
|
|
2723
|
+
const siteKey = injector.get(RECAPTCHA_SITE_KEY);
|
|
2724
|
+
return initializeAppCheck(app, {
|
|
2725
|
+
provider: isEmpty(siteKey) ? undefined : new ReCaptchaEnterpriseProvider(siteKey),
|
|
2726
|
+
isTokenAutoRefreshEnabled: true,
|
|
2727
|
+
});
|
|
2775
2728
|
}
|
|
2776
2729
|
catch (error) {
|
|
2777
|
-
|
|
2778
|
-
console.error(error.message);
|
|
2779
|
-
return;
|
|
2730
|
+
console.warn('ReCAPTCHA site key not provided or invalid, App Check not initialized');
|
|
2780
2731
|
}
|
|
2732
|
+
return;
|
|
2781
2733
|
}),
|
|
2782
2734
|
provideStorage((injector) => getStorage(injector.get(FirebaseApp))),
|
|
2783
2735
|
AngularElasticSeachModule,
|