@dereekb/dbx-firebase 5.0.0 → 5.2.0
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/_index.scss +4 -4
- package/esm2020/lib/auth/appcheck/appcheck.interceptor.mjs +80 -0
- package/esm2020/lib/auth/appcheck/appcheck.mjs +11 -0
- package/esm2020/lib/auth/appcheck/index.mjs +3 -0
- package/esm2020/lib/auth/auth.mjs +1 -1
- package/esm2020/lib/auth/error.mjs +1 -1
- package/esm2020/lib/auth/firebase.auth.module.mjs +1 -1
- package/esm2020/lib/auth/index.mjs +2 -1
- package/esm2020/lib/auth/login/firebase.login.module.mjs +49 -57
- package/esm2020/lib/auth/login/login.anonymous.component.mjs +3 -3
- package/esm2020/lib/auth/login/login.apple.component.mjs +3 -3
- package/esm2020/lib/auth/login/login.button.component.mjs +34 -36
- package/esm2020/lib/auth/login/login.component.mjs +3 -3
- package/esm2020/lib/auth/login/login.context.back.component.mjs +4 -4
- package/esm2020/lib/auth/login/login.context.directive.mjs +13 -9
- package/esm2020/lib/auth/login/login.context.mjs +2 -2
- package/esm2020/lib/auth/login/login.email.component.mjs +4 -4
- package/esm2020/lib/auth/login/login.email.content.component.mjs +4 -4
- package/esm2020/lib/auth/login/login.email.form.component.mjs +11 -7
- package/esm2020/lib/auth/login/login.email.recovery.form.component.mjs +9 -5
- package/esm2020/lib/auth/login/login.facebook.component.mjs +3 -3
- package/esm2020/lib/auth/login/login.github.component.mjs +3 -3
- package/esm2020/lib/auth/login/login.google.component.mjs +3 -3
- package/esm2020/lib/auth/login/login.list.component.mjs +11 -13
- package/esm2020/lib/auth/login/login.microsoft.component.mjs +3 -3
- package/esm2020/lib/auth/login/login.mjs +1 -1
- package/esm2020/lib/auth/login/login.password.mjs +1 -1
- package/esm2020/lib/auth/login/login.service.mjs +8 -8
- package/esm2020/lib/auth/login/login.terms.component.mjs +10 -6
- package/esm2020/lib/auth/login/login.terms.mjs +1 -1
- package/esm2020/lib/auth/login/login.terms.simple.component.mjs +12 -12
- package/esm2020/lib/auth/login/login.twitter.component.mjs +3 -3
- package/esm2020/lib/auth/login/register.component.mjs +8 -4
- package/esm2020/lib/auth/login/register.email.component.mjs +4 -4
- package/esm2020/lib/auth/service/firebase.auth.rxjs.mjs +3 -3
- package/esm2020/lib/auth/service/firebase.auth.service.mjs +12 -12
- package/esm2020/lib/firebase/appcheck.mjs +2 -0
- package/esm2020/lib/firebase/emulators.mjs +1 -1
- package/esm2020/lib/firebase/firebase.emulator.module.mjs +6 -4
- package/esm2020/lib/firebase/firebase.module.mjs +106 -13
- package/esm2020/lib/firebase/index.mjs +2 -1
- package/esm2020/lib/firebase/options.mjs +3 -2
- package/esm2020/lib/firestore/firebase.firestore.context.service.mjs +1 -1
- package/esm2020/lib/firestore/firebase.firestore.module.mjs +11 -8
- package/esm2020/lib/function/firebase.function.module.mjs +8 -6
- package/esm2020/lib/model/error.mjs +2 -2
- package/esm2020/lib/model/loader/collection.loader.instance.mjs +9 -10
- package/esm2020/lib/model/loader/collection.loader.mjs +1 -1
- package/esm2020/lib/model/model.module.mjs +4 -6
- package/esm2020/lib/model/store/index.mjs +2 -1
- package/esm2020/lib/model/store/model.store.module.mjs +10 -30
- package/esm2020/lib/model/store/store.collection.change.directive.mjs +6 -4
- package/esm2020/lib/model/store/store.collection.change.if.directive.mjs +1 -1
- package/esm2020/lib/model/store/store.collection.directive.mjs +5 -3
- package/esm2020/lib/model/store/store.collection.list.directive.mjs +2 -2
- package/esm2020/lib/model/store/store.collection.mjs +8 -8
- package/esm2020/lib/model/store/store.document.auth.directive.mjs +4 -4
- package/esm2020/lib/model/store/store.document.directive.mjs +5 -3
- package/esm2020/lib/model/store/store.document.mjs +12 -12
- package/esm2020/lib/model/store/store.document.router.directive.mjs +1 -1
- package/esm2020/lib/model/store/store.subcollection.directive.mjs +30 -0
- package/esm2020/lib/model/store/store.subcollection.document.mjs +23 -6
- package/esm2020/lib/model/store/store.subcollection.mjs +53 -11
- package/esm2020/lib/model/store/store.subcollection.rxjs.mjs +4 -23
- package/esm2020/lib/module.mjs +4 -6
- package/fesm2015/dereekb-dbx-firebase.mjs +509 -263
- package/fesm2015/dereekb-dbx-firebase.mjs.map +1 -1
- package/fesm2020/dereekb-dbx-firebase.mjs +501 -263
- package/fesm2020/dereekb-dbx-firebase.mjs.map +1 -1
- package/lib/auth/appcheck/appcheck.d.ts +8 -0
- package/lib/auth/appcheck/appcheck.interceptor.d.ts +19 -0
- package/lib/auth/appcheck/index.d.ts +2 -0
- package/lib/auth/auth.d.ts +1 -1
- package/lib/auth/error.d.ts +1 -1
- package/lib/auth/index.d.ts +1 -0
- package/lib/auth/login/_login.scss +5 -5
- package/lib/auth/login/login.anonymous.component.d.ts +1 -1
- package/lib/auth/login/login.apple.component.d.ts +1 -1
- package/lib/auth/login/login.button.component.d.ts +5 -5
- package/lib/auth/login/login.context.back.component.d.ts +1 -1
- package/lib/auth/login/login.context.d.ts +1 -1
- package/lib/auth/login/login.context.directive.d.ts +2 -2
- package/lib/auth/login/login.email.component.d.ts +1 -1
- package/lib/auth/login/login.email.content.component.d.ts +2 -2
- package/lib/auth/login/login.email.form.component.d.ts +6 -6
- package/lib/auth/login/login.email.recovery.form.component.d.ts +2 -2
- package/lib/auth/login/login.facebook.component.d.ts +1 -1
- package/lib/auth/login/login.github.component.d.ts +1 -1
- package/lib/auth/login/login.google.component.d.ts +1 -1
- package/lib/auth/login/login.list.component.d.ts +1 -1
- package/lib/auth/login/login.microsoft.component.d.ts +1 -1
- package/lib/auth/login/login.password.d.ts +1 -1
- package/lib/auth/login/login.service.d.ts +4 -4
- package/lib/auth/login/login.terms.component.d.ts +1 -1
- package/lib/auth/login/login.twitter.component.d.ts +1 -1
- package/lib/auth/login/register.email.component.d.ts +1 -1
- package/lib/auth/service/firebase.auth.rxjs.d.ts +1 -1
- package/lib/auth/service/firebase.auth.service.d.ts +3 -3
- package/lib/firebase/appcheck.d.ts +21 -0
- package/lib/firebase/firebase.module.d.ts +20 -10
- package/lib/firebase/index.d.ts +1 -0
- package/lib/firebase/options.d.ts +10 -3
- package/lib/firestore/firebase.firestore.module.d.ts +3 -3
- package/lib/function/firebase.function.module.d.ts +4 -4
- package/lib/model/loader/collection.loader.d.ts +4 -4
- package/lib/model/loader/collection.loader.instance.d.ts +8 -8
- package/lib/model/store/index.d.ts +1 -0
- package/lib/model/store/store.collection.change.directive.d.ts +2 -2
- package/lib/model/store/store.collection.d.ts +7 -7
- package/lib/model/store/store.collection.directive.d.ts +3 -3
- package/lib/model/store/store.document.auth.directive.d.ts +4 -4
- package/lib/model/store/store.document.directive.d.ts +2 -2
- package/lib/model/store/store.subcollection.d.ts +29 -9
- package/lib/model/store/store.subcollection.directive.d.ts +23 -0
- package/lib/model/store/store.subcollection.document.d.ts +9 -8
- package/lib/model/store/store.subcollection.rxjs.d.ts +12 -11
- package/lib/style/_config.scss +8 -6
- package/lib/style/_core.scss +1 -1
- package/lib/style/_mixin.scss +1 -1
- package/lib/style/_theming.scss +2 -12
- package/lib/style/_variables.scss +1 -1
- package/package.json +8 -7
|
@@ -1,34 +1,123 @@
|
|
|
1
|
+
import { urlWithoutParameters, addToSet, removeFromSet, filterMaybeValues, mapIterable, asArray, excludeValuesFromArray, containsStringAnyCase, forEachKeyValue, readableError, isMaybeSo } from '@dereekb/util';
|
|
2
|
+
import * as i0 from '@angular/core';
|
|
3
|
+
import { InjectionToken, Injectable, Inject, Optional, Component, Input, Directive, EventEmitter, Output, NgModule, Injector, forwardRef, Host } from '@angular/core';
|
|
4
|
+
import { getToken, initializeAppCheck, ReCaptchaV3Provider } from 'firebase/app-check';
|
|
5
|
+
import { switchMap, from, first, map, of, shareReplay, timeout, startWith, distinctUntilChanged, BehaviorSubject, combineLatest, tap, firstValueFrom, Subject, throttleTime, NEVER, filter, take, exhaustMap } from 'rxjs';
|
|
6
|
+
import * as i1 from '@angular/fire/app-check';
|
|
7
|
+
import { provideAppCheck } from '@angular/fire/app-check';
|
|
1
8
|
import * as i4 from '@angular/material/button';
|
|
2
9
|
import { MatButtonModule } from '@angular/material/button';
|
|
3
10
|
import * as i2 from '@angular/material/icon';
|
|
4
11
|
import { MatIconModule } from '@angular/material/icon';
|
|
5
12
|
import * as i6 from '@angular/common';
|
|
6
13
|
import { CommonModule } from '@angular/common';
|
|
7
|
-
import * as i0 from '@angular/core';
|
|
8
|
-
import { Injectable, Optional, Component, InjectionToken, Inject, Input, Directive, EventEmitter, Output, NgModule, Injector, forwardRef, Host } from '@angular/core';
|
|
9
|
-
import { of, switchMap, shareReplay, map, timeout, startWith, distinctUntilChanged, from, BehaviorSubject, combineLatest, tap, firstValueFrom, Subject, throttleTime, NEVER, filter, take, exhaustMap, first } from 'rxjs';
|
|
10
14
|
import { filterMaybe, isNot, SubscriptionObject, cleanupDestroyable, accumulatorFlattenPageListLoadingState, useFirst, successResult, beginLoading, loadingStateFromObs, errorResult, cleanup } from '@dereekb/rxjs';
|
|
11
15
|
import * as i3$1 from '@dereekb/dbx-core';
|
|
12
16
|
import { loggedInObsFromIsLoggedIn, loggedOutObsFromIsLoggedIn, authUserIdentifier, DbxInjectionContext, AbstractForwardDbxInjectionContextDirective, DBX_INJECTION_COMPONENT_DATA, DbxInjectionComponentModule, DbxAuthService, AbstractSubscriptionDirective, AbstractIfDirective, LockSetComponentStore } from '@dereekb/dbx-core';
|
|
13
|
-
import * as i1 from '@angular/fire/auth';
|
|
17
|
+
import * as i1$1 from '@angular/fire/auth';
|
|
14
18
|
import { authState, GoogleAuthProvider, FacebookAuthProvider, TwitterAuthProvider, GithubAuthProvider, signInWithPopup, createUserWithEmailAndPassword, signInWithEmailAndPassword, signInAnonymously, provideAuth, getAuth, connectAuthEmulator } from '@angular/fire/auth';
|
|
15
19
|
import { sendPasswordResetEmail } from 'firebase/auth';
|
|
16
|
-
import { addToSet, removeFromSet, filterMaybeValues, mapIterable, asArray, excludeValuesFromArray, containsStringAnyCase, forEachKeyValue, readableError, isMaybeSo } from '@dereekb/util';
|
|
17
20
|
import * as i3 from '@dereekb/dbx-web';
|
|
18
21
|
import { DbxRouterAnchorModule, DbxReadableErrorModule, DbxActionModule, DbxButtonModule } from '@dereekb/dbx-web';
|
|
19
|
-
import * as i1$
|
|
22
|
+
import * as i1$2 from '@dereekb/dbx-form';
|
|
20
23
|
import { AbstractAsyncFormlyFormDirective, usernamePasswordLoginFields, provideFormlyContext, AbstractSyncFormlyFormDirective, emailField, DbxFormIoModule, DbxFormModule, DbxFormlyModule, DbxFormActionModule, DbxFormFormlyTextFieldModule } from '@dereekb/dbx-form';
|
|
21
24
|
import { initializeApp } from 'firebase/app';
|
|
22
|
-
import * as
|
|
25
|
+
import * as i6$1 from '@angular/fire/app';
|
|
23
26
|
import { FirebaseApp, provideFirebaseApp } from '@angular/fire/app';
|
|
24
|
-
import * as
|
|
27
|
+
import * as i4$1 from '@angular/fire/storage';
|
|
25
28
|
import { provideStorage, getStorage, connectStorageEmulator } from '@angular/fire/storage';
|
|
26
|
-
import * as
|
|
29
|
+
import * as i5 from '@angular/fire/functions';
|
|
27
30
|
import { provideFunctions, getFunctions, connectFunctionsEmulator, Functions } from '@angular/fire/functions';
|
|
28
|
-
import * as i1$
|
|
31
|
+
import * as i1$3 from '@angular/fire/firestore';
|
|
29
32
|
import { provideFirestore, getFirestore, connectFirestoreEmulator, enableIndexedDbPersistence, Firestore } from '@angular/fire/firestore';
|
|
33
|
+
import { HTTP_INTERCEPTORS } from '@angular/common/http';
|
|
30
34
|
import { firebaseFirestoreContextFactory, iterationQueryDocChangeWatcher, firebaseQueryItemAccumulator, documentDataWithId } from '@dereekb/firebase';
|
|
31
35
|
|
|
36
|
+
/**
|
|
37
|
+
* Enables debug token generation for AppCheck by setting FIREBASE_APPCHECK_DEBUG_TOKEN in the browser's self/window.
|
|
38
|
+
*
|
|
39
|
+
* https://firebase.google.com/docs/app-check/web/debug-provider
|
|
40
|
+
*
|
|
41
|
+
* @param enable
|
|
42
|
+
*/
|
|
43
|
+
function enableAppCheckDebugTokenGeneration(enable = true) {
|
|
44
|
+
self.FIREBASE_APPCHECK_DEBUG_TOKEN = enable;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
const DBX_FIREBASE_OPTIONS_TOKEN = new InjectionToken('DbxFirebaseOptions');
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* HTTP Interceptor that sets the X-Firebase-AppCheck for any requests to the routes configured in DbxFirebaseOptions.
|
|
51
|
+
*/
|
|
52
|
+
class DbxFirebaseAppCheckHttpInterceptor {
|
|
53
|
+
constructor(dbxFirebaseOptions, appCheck) {
|
|
54
|
+
this.dbxFirebaseOptions = dbxFirebaseOptions;
|
|
55
|
+
this.appCheck = appCheck;
|
|
56
|
+
let routes = [];
|
|
57
|
+
if (appCheck != null) {
|
|
58
|
+
routes = (this.dbxFirebaseOptions.appCheck?.appCheckRoutes ?? ['/api/*']).map((route) => {
|
|
59
|
+
const wildcardIndex = route.indexOf('*');
|
|
60
|
+
const isWildcard = wildcardIndex === route.length - 1;
|
|
61
|
+
const match = isWildcard ? route.substring(0, wildcardIndex) : route;
|
|
62
|
+
return {
|
|
63
|
+
isWildcard,
|
|
64
|
+
match
|
|
65
|
+
};
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
this._appCheckRoutes = routes;
|
|
69
|
+
this._isEnabled = routes.length > 0;
|
|
70
|
+
}
|
|
71
|
+
intercept(req, next) {
|
|
72
|
+
let obs;
|
|
73
|
+
if (this._isEnabled) {
|
|
74
|
+
obs = this.matchesAnyRoute(req.url).pipe(switchMap((isMatch) => {
|
|
75
|
+
let nextEvent;
|
|
76
|
+
if (isMatch) {
|
|
77
|
+
nextEvent = from(getToken(this.appCheck).then((appCheckTokenResponse) => {
|
|
78
|
+
const token = appCheckTokenResponse.token;
|
|
79
|
+
let nextRequest = req;
|
|
80
|
+
if (token) {
|
|
81
|
+
nextRequest = req.clone({
|
|
82
|
+
headers: req.headers.set('X-Firebase-AppCheck', token)
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
return nextRequest;
|
|
86
|
+
})).pipe(switchMap((nextRequest) => next.handle(nextRequest)));
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
nextEvent = next.handle(req);
|
|
90
|
+
}
|
|
91
|
+
return nextEvent;
|
|
92
|
+
}));
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
obs = next.handle(req);
|
|
96
|
+
}
|
|
97
|
+
return obs;
|
|
98
|
+
}
|
|
99
|
+
matchesAnyRoute(inputUrl) {
|
|
100
|
+
const url = urlWithoutParameters(inputUrl);
|
|
101
|
+
function isEnabledRouteMatch(enabledRoute) {
|
|
102
|
+
if (enabledRoute.isWildcard) {
|
|
103
|
+
return url.startsWith(enabledRoute.match);
|
|
104
|
+
}
|
|
105
|
+
else {
|
|
106
|
+
return url === enabledRoute.match;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
return from(this._appCheckRoutes).pipe(first((route) => isEnabledRouteMatch(route), false), map((x) => Boolean(x)));
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
DbxFirebaseAppCheckHttpInterceptor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseAppCheckHttpInterceptor, deps: [{ token: DBX_FIREBASE_OPTIONS_TOKEN }, { token: i1.AppCheck }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
113
|
+
DbxFirebaseAppCheckHttpInterceptor.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseAppCheckHttpInterceptor });
|
|
114
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseAppCheckHttpInterceptor, decorators: [{
|
|
115
|
+
type: Injectable
|
|
116
|
+
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
117
|
+
type: Inject,
|
|
118
|
+
args: [DBX_FIREBASE_OPTIONS_TOKEN]
|
|
119
|
+
}] }, { type: i1.AppCheck }]; } });
|
|
120
|
+
|
|
32
121
|
/**
|
|
33
122
|
* Derives a user state from the input firebase auth service.
|
|
34
123
|
*
|
|
@@ -40,7 +129,7 @@ function authUserStateFromFirebaseAuthService(dbxFirebaseAuthService, stateForLo
|
|
|
40
129
|
return dbxFirebaseAuthService.hasAuthUser$.pipe(switchMap((hasUser) => {
|
|
41
130
|
let obs;
|
|
42
131
|
if (hasUser) {
|
|
43
|
-
obs = dbxFirebaseAuthService.isAnonymousUser$.pipe(switchMap((isAnon) => isAnon ? of('anon') : stateForLoggedInUser(dbxFirebaseAuthService)));
|
|
132
|
+
obs = dbxFirebaseAuthService.isAnonymousUser$.pipe(switchMap((isAnon) => (isAnon ? of('anon') : stateForLoggedInUser(dbxFirebaseAuthService))));
|
|
44
133
|
}
|
|
45
134
|
else {
|
|
46
135
|
obs = of('none');
|
|
@@ -59,7 +148,7 @@ function authUserStateFromFirebaseAuthService(dbxFirebaseAuthService, stateForLo
|
|
|
59
148
|
function readValueFromIdToken(dbxFirebaseAuthService, readBooleanFromIdToken, defaultValue) {
|
|
60
149
|
return dbxFirebaseAuthService.currentAuthUserInfo$.pipe(switchMap((x) => {
|
|
61
150
|
if (x) {
|
|
62
|
-
return dbxFirebaseAuthService.idTokenResult$.pipe(switchMap(x => readBooleanFromIdToken(x)));
|
|
151
|
+
return dbxFirebaseAuthService.idTokenResult$.pipe(switchMap((x) => readBooleanFromIdToken(x)));
|
|
63
152
|
}
|
|
64
153
|
else {
|
|
65
154
|
return of(defaultValue);
|
|
@@ -84,10 +173,10 @@ const DEFAULT_DBX_FIREBASE_AUTH_SERVICE_DELEGATE = {
|
|
|
84
173
|
return authUserStateFromFirebaseAuthService(dbxFirebaseAuthService);
|
|
85
174
|
},
|
|
86
175
|
authRolesObs(dbxFirebaseAuthService) {
|
|
87
|
-
return dbxFirebaseAuthService.authUserState$.pipe(map(x => x === 'user' ? new Set(['user']) : new Set()));
|
|
176
|
+
return dbxFirebaseAuthService.authUserState$.pipe(map((x) => (x === 'user' ? new Set(['user']) : new Set())));
|
|
88
177
|
},
|
|
89
178
|
isOnboarded(dbxFirebaseAuthService) {
|
|
90
|
-
return dbxFirebaseAuthService.authUserState$.pipe(map(x => x === 'user'));
|
|
179
|
+
return dbxFirebaseAuthService.authUserState$.pipe(map((x) => x === 'user'));
|
|
91
180
|
}
|
|
92
181
|
};
|
|
93
182
|
class DbxFirebaseAuthService {
|
|
@@ -98,19 +187,19 @@ class DbxFirebaseAuthService {
|
|
|
98
187
|
first: 1000,
|
|
99
188
|
with: () => this._authState$.pipe(startWith(null))
|
|
100
189
|
}), distinctUntilChanged(), shareReplay(1));
|
|
101
|
-
this.currentAuthUserInfo$ = this.currentAuthUser$.pipe(map((x) => (x
|
|
190
|
+
this.currentAuthUserInfo$ = this.currentAuthUser$.pipe(map((x) => (x ? authUserInfoFromAuthUser(x) : undefined)));
|
|
102
191
|
this.authUser$ = this.currentAuthUser$.pipe(filterMaybe());
|
|
103
192
|
this.authUserInfo$ = this.authUser$.pipe(map(authUserInfoFromAuthUser));
|
|
104
|
-
this.hasAuthUser$ = this.currentAuthUser$.pipe(map(x => Boolean(x)), distinctUntilChanged(), shareReplay(1));
|
|
105
|
-
this.isAnonymousUser$ = this.authUser$.pipe(map(x => x.isAnonymous), distinctUntilChanged(), shareReplay(1));
|
|
193
|
+
this.hasAuthUser$ = this.currentAuthUser$.pipe(map((x) => Boolean(x)), distinctUntilChanged(), shareReplay(1));
|
|
194
|
+
this.isAnonymousUser$ = this.authUser$.pipe(map((x) => x.isAnonymous), distinctUntilChanged(), shareReplay(1));
|
|
106
195
|
this.isNotAnonymousUser$ = this.isAnonymousUser$.pipe(isNot());
|
|
107
196
|
this.isLoggedIn$ = this.hasAuthUser$;
|
|
108
197
|
this.isNotLoggedIn$ = this.isLoggedIn$.pipe(isNot());
|
|
109
198
|
this.onLogIn$ = loggedInObsFromIsLoggedIn(this.isLoggedIn$);
|
|
110
199
|
this.onLogOut$ = loggedOutObsFromIsLoggedIn(this.isLoggedIn$);
|
|
111
|
-
this.userIdentifier$ = this.currentAuthUser$.pipe(map(x => authUserIdentifier(x?.uid)));
|
|
112
|
-
this.idTokenResult$ = this.authUser$.pipe(switchMap(x => x.getIdTokenResult()));
|
|
113
|
-
this.claims$ = this.idTokenResult$.pipe(map(x => x.claims));
|
|
200
|
+
this.userIdentifier$ = this.currentAuthUser$.pipe(map((x) => authUserIdentifier(x?.uid)));
|
|
201
|
+
this.idTokenResult$ = this.authUser$.pipe(switchMap((x) => x.getIdTokenResult()));
|
|
202
|
+
this.claims$ = this.idTokenResult$.pipe(map((x) => x.claims));
|
|
114
203
|
delegate = delegate ?? DEFAULT_DBX_FIREBASE_AUTH_SERVICE_DELEGATE;
|
|
115
204
|
this.authUserState$ = delegate.authUserStateObs(this).pipe(distinctUntilChanged(), shareReplay(1));
|
|
116
205
|
this.authRoles$ = delegate.authRolesObs(this);
|
|
@@ -158,11 +247,11 @@ class DbxFirebaseAuthService {
|
|
|
158
247
|
return this.firebaseAuth.signOut();
|
|
159
248
|
}
|
|
160
249
|
}
|
|
161
|
-
DbxFirebaseAuthService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseAuthService, deps: [{ token: i1.Auth }, { token: DbxFirebaseAuthServiceDelegate, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
250
|
+
DbxFirebaseAuthService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseAuthService, deps: [{ token: i1$1.Auth }, { token: DbxFirebaseAuthServiceDelegate, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
162
251
|
DbxFirebaseAuthService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseAuthService });
|
|
163
252
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseAuthService, decorators: [{
|
|
164
253
|
type: Injectable
|
|
165
|
-
}], ctorParameters: function () { return [{ type: i1.Auth }, { type: DbxFirebaseAuthServiceDelegate, decorators: [{
|
|
254
|
+
}], ctorParameters: function () { return [{ type: i1$1.Auth }, { type: DbxFirebaseAuthServiceDelegate, decorators: [{
|
|
166
255
|
type: Optional
|
|
167
256
|
}] }]; } });
|
|
168
257
|
|
|
@@ -184,21 +273,21 @@ class DbxFirebaseLoginTermsSimpleComponent {
|
|
|
184
273
|
}
|
|
185
274
|
DbxFirebaseLoginTermsSimpleComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseLoginTermsSimpleComponent, deps: [{ token: DbxFirebaseLoginTermsConfig }], target: i0.ɵɵFactoryTarget.Component });
|
|
186
275
|
DbxFirebaseLoginTermsSimpleComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", type: DbxFirebaseLoginTermsSimpleComponent, selector: "ng-component", ngImport: i0, template: `
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
276
|
+
<div class="dbx-firebase-login-terms-view">
|
|
277
|
+
<dbx-link [anchor]="tosAnchor">Terms</dbx-link>
|
|
278
|
+
<span class="dbx-link-spacer"></span>
|
|
279
|
+
<dbx-link [anchor]="privacyAnchor">Privacy</dbx-link>
|
|
280
|
+
</div>
|
|
192
281
|
`, isInline: true, components: [{ type: i3.DbxAnchorLinkComponent, selector: "dbx-link", inputs: ["anchor", "ref", "href"] }] });
|
|
193
282
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseLoginTermsSimpleComponent, decorators: [{
|
|
194
283
|
type: Component,
|
|
195
284
|
args: [{
|
|
196
285
|
template: `
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
286
|
+
<div class="dbx-firebase-login-terms-view">
|
|
287
|
+
<dbx-link [anchor]="tosAnchor">Terms</dbx-link>
|
|
288
|
+
<span class="dbx-link-spacer"></span>
|
|
289
|
+
<dbx-link [anchor]="privacyAnchor">Privacy</dbx-link>
|
|
290
|
+
</div>
|
|
202
291
|
`
|
|
203
292
|
}]
|
|
204
293
|
}], ctorParameters: function () { return [{ type: DbxFirebaseLoginTermsConfig }]; } });
|
|
@@ -288,7 +377,7 @@ class DbxFirebaseAuthLoginService {
|
|
|
288
377
|
return Array.from(this._providers.keys());
|
|
289
378
|
}
|
|
290
379
|
getEnabledTypes() {
|
|
291
|
-
return
|
|
380
|
+
return this._enableAll ? this.getRegisteredTypes() : Array.from(this._enabled);
|
|
292
381
|
}
|
|
293
382
|
getLoginProvider(type) {
|
|
294
383
|
return this._providers.get(type);
|
|
@@ -300,7 +389,7 @@ class DbxFirebaseAuthLoginService {
|
|
|
300
389
|
return this._providers.get(type);
|
|
301
390
|
}
|
|
302
391
|
getRegisterProviders(types) {
|
|
303
|
-
return filterMaybeValues(mapIterable(types ?? [], (x) => this._providers.get(x))).filter(x => x.registrationComponentClass !== false);
|
|
392
|
+
return filterMaybeValues(mapIterable(types ?? [], (x) => this._providers.get(x))).filter((x) => x.registrationComponentClass !== false);
|
|
304
393
|
}
|
|
305
394
|
getProviderAssets(type) {
|
|
306
395
|
return this._assets.get(type);
|
|
@@ -317,7 +406,7 @@ DbxFirebaseAuthLoginService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "1
|
|
|
317
406
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseAuthLoginService, decorators: [{
|
|
318
407
|
type: Injectable,
|
|
319
408
|
args: [{
|
|
320
|
-
providedIn: 'root'
|
|
409
|
+
providedIn: 'root'
|
|
321
410
|
}]
|
|
322
411
|
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
323
412
|
type: Optional
|
|
@@ -373,39 +462,37 @@ class DbxFirebaseLoginButtonComponent {
|
|
|
373
462
|
}
|
|
374
463
|
DbxFirebaseLoginButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseLoginButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
375
464
|
DbxFirebaseLoginButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", type: DbxFirebaseLoginButtonComponent, selector: "dbx-firebase-login-button", inputs: { config: "config" }, host: { classAttribute: "dbx-firebase-login-button" }, ngImport: i0, template: `
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
</
|
|
386
|
-
</
|
|
387
|
-
</ng-container>
|
|
465
|
+
<ng-container dbxAction [dbxActionHandler]="handleAction" dbxActionValue [dbxActionSuccessHandler]="onActionSuccess">
|
|
466
|
+
<dbx-button dbxActionButton [customTextColor]="buttonTextColor" [customButtonColor]="buttonColor" [raised]="true">
|
|
467
|
+
<div class="dbx-firebase-login-button-content">
|
|
468
|
+
<span class="dbx-firebase-login-button-icon dbx-icon-spacer">
|
|
469
|
+
<img *ngIf="iconUrl" [src]="iconUrl" />
|
|
470
|
+
<mat-icon *ngIf="icon">{{ icon }}</mat-icon>
|
|
471
|
+
</span>
|
|
472
|
+
<span class="dbx-firebase-login-button-text">{{ text }}</span>
|
|
473
|
+
</div>
|
|
474
|
+
</dbx-button>
|
|
475
|
+
</ng-container>
|
|
388
476
|
`, isInline: true, components: [{ type: i3.DbxButtonComponent, selector: "dbx-button", inputs: ["type", "raised", "stroked", "flat", "color", "customButtonColor", "customTextColor", "customSpinnerColor"] }, { type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], directives: [{ type: i3$1.DbxActionDirective, selector: "dbx-action,[dbxAction],dbx-action-context,[dbxActionContext]", exportAs: ["action", "dbxAction"] }, { type: i3$1.DbxActionValueDirective, selector: "[dbxActionValue]", inputs: ["dbxActionValue"] }, { type: i3$1.DbxActionHandlerDirective, selector: "[dbxActionHandler]", inputs: ["dbxActionHandler"] }, { type: i3$1.DbxActionSuccessHandlerDirective, selector: "[dbxActionSuccessHandler]", inputs: ["dbxActionSuccessHandler"] }, { type: i3$1.DbxActionButtonDirective, selector: "[dbxActionButton]" }, { type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
389
477
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseLoginButtonComponent, decorators: [{
|
|
390
478
|
type: Component,
|
|
391
479
|
args: [{
|
|
392
480
|
selector: 'dbx-firebase-login-button',
|
|
393
481
|
template: `
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
</
|
|
404
|
-
</
|
|
405
|
-
</ng-container>
|
|
482
|
+
<ng-container dbxAction [dbxActionHandler]="handleAction" dbxActionValue [dbxActionSuccessHandler]="onActionSuccess">
|
|
483
|
+
<dbx-button dbxActionButton [customTextColor]="buttonTextColor" [customButtonColor]="buttonColor" [raised]="true">
|
|
484
|
+
<div class="dbx-firebase-login-button-content">
|
|
485
|
+
<span class="dbx-firebase-login-button-icon dbx-icon-spacer">
|
|
486
|
+
<img *ngIf="iconUrl" [src]="iconUrl" />
|
|
487
|
+
<mat-icon *ngIf="icon">{{ icon }}</mat-icon>
|
|
488
|
+
</span>
|
|
489
|
+
<span class="dbx-firebase-login-button-text">{{ text }}</span>
|
|
490
|
+
</div>
|
|
491
|
+
</dbx-button>
|
|
492
|
+
</ng-container>
|
|
406
493
|
`,
|
|
407
494
|
host: {
|
|
408
|
-
|
|
495
|
+
class: 'dbx-firebase-login-button'
|
|
409
496
|
}
|
|
410
497
|
}]
|
|
411
498
|
}], propDecorators: { config: [{
|
|
@@ -415,18 +502,18 @@ class DbxFirebaseLoginButtonContainerComponent {
|
|
|
415
502
|
}
|
|
416
503
|
DbxFirebaseLoginButtonContainerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseLoginButtonContainerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
417
504
|
DbxFirebaseLoginButtonContainerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", type: DbxFirebaseLoginButtonContainerComponent, selector: "dbx-firebase-login-button-container", ngImport: i0, template: `
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
505
|
+
<div class="dbx-firebase-login-button-container">
|
|
506
|
+
<ng-content></ng-content>
|
|
507
|
+
</div>
|
|
421
508
|
`, isInline: true });
|
|
422
509
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseLoginButtonContainerComponent, decorators: [{
|
|
423
510
|
type: Component,
|
|
424
511
|
args: [{
|
|
425
512
|
selector: 'dbx-firebase-login-button-container',
|
|
426
513
|
template: `
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
514
|
+
<div class="dbx-firebase-login-button-container">
|
|
515
|
+
<ng-content></ng-content>
|
|
516
|
+
</div>
|
|
430
517
|
`
|
|
431
518
|
}]
|
|
432
519
|
}] });
|
|
@@ -518,8 +605,8 @@ class DbxFirebaseLoginListComponent {
|
|
|
518
605
|
this._omitProviderTypes = new BehaviorSubject(undefined);
|
|
519
606
|
this._inputProviderTypes = new BehaviorSubject(undefined);
|
|
520
607
|
this.providerTypes$ = combineLatest([this._inputProviderTypes, this._omitProviderTypes]).pipe(map(([providerTypes, omitProviderTypes]) => {
|
|
521
|
-
const baseTypes =
|
|
522
|
-
const types =
|
|
608
|
+
const baseTypes = providerTypes ? asArray(providerTypes) : this.dbxFirebaseAuthLoginService.getEnabledTypes();
|
|
609
|
+
const types = omitProviderTypes ? excludeValuesFromArray(baseTypes, asArray(omitProviderTypes)) : baseTypes;
|
|
523
610
|
return types;
|
|
524
611
|
}), shareReplay(1));
|
|
525
612
|
this.providers$ = combineLatest([this.providerTypes$, this._inputProviderCategories]).pipe(map(([x, inputProviderCategories]) => {
|
|
@@ -527,14 +614,12 @@ class DbxFirebaseLoginListComponent {
|
|
|
527
614
|
let providers = this.dbxFirebaseAuthLoginService.getLoginProviders(x);
|
|
528
615
|
if (providerCategories.length) {
|
|
529
616
|
const categories = new Set(providerCategories);
|
|
530
|
-
providers = providers.filter(x => containsStringAnyCase(categories, x.category ?? ''));
|
|
617
|
+
providers = providers.filter((x) => containsStringAnyCase(categories, x.category ?? ''));
|
|
531
618
|
}
|
|
532
619
|
return providers;
|
|
533
620
|
}));
|
|
534
621
|
this.providerInjectionConfigs$ = combineLatest([this._loginMode, this.providers$]).pipe(map(([mode, providers]) => {
|
|
535
|
-
const mapFn =
|
|
536
|
-
((x) => ({ componentClass: x.registrationComponentClass ?? x.componentClass })) :
|
|
537
|
-
((x) => ({ componentClass: x.componentClass }));
|
|
622
|
+
const mapFn = mode === 'register' ? (x) => ({ componentClass: x.registrationComponentClass ?? x.componentClass }) : (x) => ({ componentClass: x.componentClass });
|
|
538
623
|
return providers.map(mapFn);
|
|
539
624
|
}));
|
|
540
625
|
}
|
|
@@ -559,21 +644,21 @@ class DbxFirebaseLoginListComponent {
|
|
|
559
644
|
}
|
|
560
645
|
DbxFirebaseLoginListComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseLoginListComponent, deps: [{ token: DbxFirebaseAuthLoginService }], target: i0.ɵɵFactoryTarget.Component });
|
|
561
646
|
DbxFirebaseLoginListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", type: DbxFirebaseLoginListComponent, selector: "dbx-firebase-login-list", inputs: { loginMode: "loginMode", providerTypes: "providerTypes", omitProviderTypes: "omitProviderTypes", providerCategories: "providerCategories" }, host: { classAttribute: "dbx-firebase-login-list" }, ngImport: i0, template: `
|
|
562
|
-
<div class="dbx-firebase-login-item" *ngFor="let config of
|
|
647
|
+
<div class="dbx-firebase-login-item" *ngFor="let config of providerInjectionConfigs$ | async">
|
|
563
648
|
<dbx-injection [config]="config"></dbx-injection>
|
|
564
649
|
</div>
|
|
565
|
-
`, isInline: true, components: [{ type: i3$1.DbxInjectionComponent, selector: "dbx-injection, [dbxInjection], [dbx-injection]", inputs: ["config", "template"] }], directives: [{ type: i6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "async": i6.AsyncPipe } });
|
|
650
|
+
`, isInline: true, components: [{ type: i3$1.DbxInjectionComponent, selector: "dbx-injection, [dbxInjection], [dbx-injection]", inputs: ["config", "template"] }], directives: [{ type: i6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "async": i6.AsyncPipe } });
|
|
566
651
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseLoginListComponent, decorators: [{
|
|
567
652
|
type: Component,
|
|
568
653
|
args: [{
|
|
569
654
|
selector: 'dbx-firebase-login-list',
|
|
570
655
|
template: `
|
|
571
|
-
<div class="dbx-firebase-login-item" *ngFor="let config of
|
|
656
|
+
<div class="dbx-firebase-login-item" *ngFor="let config of providerInjectionConfigs$ | async">
|
|
572
657
|
<dbx-injection [config]="config"></dbx-injection>
|
|
573
658
|
</div>
|
|
574
|
-
`,
|
|
659
|
+
`,
|
|
575
660
|
host: {
|
|
576
|
-
|
|
661
|
+
class: 'dbx-firebase-login-list'
|
|
577
662
|
}
|
|
578
663
|
}]
|
|
579
664
|
}], ctorParameters: function () { return [{ type: DbxFirebaseAuthLoginService }]; }, propDecorators: { loginMode: [{
|
|
@@ -592,18 +677,22 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
|
|
|
592
677
|
class DbxFirebaseLoginContextDirective extends AbstractForwardDbxInjectionContextDirective {
|
|
593
678
|
}
|
|
594
679
|
DbxFirebaseLoginContextDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseLoginContextDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
595
|
-
DbxFirebaseLoginContextDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: DbxFirebaseLoginContextDirective, selector: "[dbxFirebaseLoginContext]", providers: [
|
|
680
|
+
DbxFirebaseLoginContextDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: DbxFirebaseLoginContextDirective, selector: "[dbxFirebaseLoginContext]", providers: [
|
|
681
|
+
{
|
|
596
682
|
provide: DbxFirebaseLoginContext,
|
|
597
683
|
useExisting: DbxFirebaseLoginContextDirective
|
|
598
|
-
}
|
|
684
|
+
}
|
|
685
|
+
], usesInheritance: true, ngImport: i0 });
|
|
599
686
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseLoginContextDirective, decorators: [{
|
|
600
687
|
type: Directive,
|
|
601
688
|
args: [{
|
|
602
|
-
|
|
603
|
-
providers: [
|
|
689
|
+
selector: '[dbxFirebaseLoginContext]',
|
|
690
|
+
providers: [
|
|
691
|
+
{
|
|
604
692
|
provide: DbxFirebaseLoginContext,
|
|
605
693
|
useExisting: DbxFirebaseLoginContextDirective
|
|
606
|
-
}
|
|
694
|
+
}
|
|
695
|
+
]
|
|
607
696
|
}]
|
|
608
697
|
}] });
|
|
609
698
|
|
|
@@ -631,7 +720,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
|
|
|
631
720
|
</ng-container>
|
|
632
721
|
`,
|
|
633
722
|
host: {
|
|
634
|
-
|
|
723
|
+
class: 'd-block dbx-firebase-login',
|
|
635
724
|
'[class]': '{ "dbx-firebase-register": loginMode === "register" }'
|
|
636
725
|
}
|
|
637
726
|
}]
|
|
@@ -678,7 +767,7 @@ class DbxFirebaseEmailFormComponent extends AbstractAsyncFormlyFormDirective {
|
|
|
678
767
|
super(...arguments);
|
|
679
768
|
this._config = new BehaviorSubject({ loginMode: 'login' });
|
|
680
769
|
this.fields$ = this._config.pipe(map(({ loginMode = 'login', passwordConfig }) => {
|
|
681
|
-
const fields = usernamePasswordLoginFields({ username: 'email', password: passwordConfig, verifyPassword:
|
|
770
|
+
const fields = usernamePasswordLoginFields({ username: 'email', password: passwordConfig, verifyPassword: loginMode === 'register' });
|
|
682
771
|
return fields;
|
|
683
772
|
}));
|
|
684
773
|
}
|
|
@@ -691,11 +780,15 @@ class DbxFirebaseEmailFormComponent extends AbstractAsyncFormlyFormDirective {
|
|
|
691
780
|
}
|
|
692
781
|
}
|
|
693
782
|
DbxFirebaseEmailFormComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseEmailFormComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
694
|
-
DbxFirebaseEmailFormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", type: DbxFirebaseEmailFormComponent, selector: "dbx-firebase-email-form", inputs: { config: "config" }, providers: [provideFormlyContext()], usesInheritance: true, ngImport: i0, template:
|
|
783
|
+
DbxFirebaseEmailFormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", type: DbxFirebaseEmailFormComponent, selector: "dbx-firebase-email-form", inputs: { config: "config" }, providers: [provideFormlyContext()], usesInheritance: true, ngImport: i0, template: `
|
|
784
|
+
<dbx-formly></dbx-formly>
|
|
785
|
+
`, isInline: true, components: [{ type: i1$2.DbxFormlyFormComponent, selector: "dbx-formly", exportAs: ["formly"] }] });
|
|
695
786
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseEmailFormComponent, decorators: [{
|
|
696
787
|
type: Component,
|
|
697
788
|
args: [{
|
|
698
|
-
template:
|
|
789
|
+
template: `
|
|
790
|
+
<dbx-formly></dbx-formly>
|
|
791
|
+
`,
|
|
699
792
|
selector: 'dbx-firebase-email-form',
|
|
700
793
|
providers: [provideFormlyContext()]
|
|
701
794
|
}]
|
|
@@ -710,11 +803,15 @@ class DbxFirebaseEmailRecoveryFormComponent extends AbstractSyncFormlyFormDirect
|
|
|
710
803
|
}
|
|
711
804
|
}
|
|
712
805
|
DbxFirebaseEmailRecoveryFormComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseEmailRecoveryFormComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
713
|
-
DbxFirebaseEmailRecoveryFormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", type: DbxFirebaseEmailRecoveryFormComponent, selector: "dbx-firebase-email-recovery-form", providers: [provideFormlyContext()], usesInheritance: true, ngImport: i0, template:
|
|
806
|
+
DbxFirebaseEmailRecoveryFormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", type: DbxFirebaseEmailRecoveryFormComponent, selector: "dbx-firebase-email-recovery-form", providers: [provideFormlyContext()], usesInheritance: true, ngImport: i0, template: `
|
|
807
|
+
<dbx-formly></dbx-formly>
|
|
808
|
+
`, isInline: true, components: [{ type: i1$2.DbxFormlyFormComponent, selector: "dbx-formly", exportAs: ["formly"] }] });
|
|
714
809
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseEmailRecoveryFormComponent, decorators: [{
|
|
715
810
|
type: Component,
|
|
716
811
|
args: [{
|
|
717
|
-
template:
|
|
812
|
+
template: `
|
|
813
|
+
<dbx-formly></dbx-formly>
|
|
814
|
+
`,
|
|
718
815
|
selector: 'dbx-firebase-email-recovery-form',
|
|
719
816
|
providers: [provideFormlyContext()]
|
|
720
817
|
}]
|
|
@@ -802,10 +899,10 @@ class DbxFirebaseLoginEmailContentComponent {
|
|
|
802
899
|
}
|
|
803
900
|
}
|
|
804
901
|
DbxFirebaseLoginEmailContentComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseLoginEmailContentComponent, deps: [{ token: DbxFirebaseAuthService }, { token: DBX_INJECTION_COMPONENT_DATA }], target: i0.ɵɵFactoryTarget.Component });
|
|
805
|
-
DbxFirebaseLoginEmailContentComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", type: DbxFirebaseLoginEmailContentComponent, selector: "ng-component", ngImport: i0, template: "<div class=\"dbx-firebase-login-email-content\">\n <ng-container [ngSwitch]=\"emailMode$ | async\">\n <ng-container *ngSwitchCase=\"'login'\">\n <ng-container *ngTemplateOutlet=\"loginView\"></ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"'recover'\">\n <ng-container *ngTemplateOutlet=\"resetPassword\"></ng-container>\n </ng-container>\n </ng-container>\n</div>\n\n<!-- Login View -->\n<ng-template #loginView>\n <ng-container dbxAction [dbxActionHandler]=\"handleLoginAction\">\n <dbx-firebase-email-form [config]=\"formConfig\" dbxActionForm [dbxFormSource]=\"emailFormValue\"
|
|
902
|
+
DbxFirebaseLoginEmailContentComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", type: DbxFirebaseLoginEmailContentComponent, selector: "ng-component", ngImport: i0, template: "<div class=\"dbx-firebase-login-email-content\">\n <ng-container [ngSwitch]=\"emailMode$ | async\">\n <ng-container *ngSwitchCase=\"'login'\">\n <ng-container *ngTemplateOutlet=\"loginView\"></ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"'recover'\">\n <ng-container *ngTemplateOutlet=\"resetPassword\"></ng-container>\n </ng-container>\n </ng-container>\n</div>\n\n<!-- Login View -->\n<ng-template #loginView>\n <ng-container dbxAction [dbxActionHandler]=\"handleLoginAction\">\n <dbx-firebase-email-form [config]=\"formConfig\" dbxActionForm [dbxFormSource]=\"emailFormValue\"></dbx-firebase-email-form>\n <div class=\"dbx-firebase-login-email-forgot-prompt\" *ngIf=\"isLoginMode\">\n <dbx-link [anchor]=\"forgotAnchor\">Forgot Password?</dbx-link>\n </div>\n <div class=\"dbx-flex\">\n <dbx-button class=\"dbx-wide-button\" [text]=\"buttonText\" [raised]=\"true\" color=\"primary\" dbxActionButton></dbx-button>\n <dbx-button-spacer></dbx-button-spacer>\n <span class=\"dbx-spacer\"></span>\n <button mat-flat-button (click)=\"onCancel()\">Cancel</button>\n </div>\n <dbx-error dbxActionError></dbx-error>\n </ng-container>\n</ng-template>\n\n<!-- Reset Password View -->\n<ng-template #resetPassword>\n <ng-container dbxAction [dbxActionHandler]=\"handleRecoveryAction\">\n <dbx-firebase-email-recovery-form dbxActionForm [dbxFormSource]=\"recoveryFormValue\"></dbx-firebase-email-recovery-form>\n <p class=\"dbx-hint\">An email will be sent to the above address to help you reset your password.</p>\n <div class=\"dbx-flex\">\n <dbx-button class=\"dbx-wide-button\" text=\"Send Recovery Email\" [raised]=\"true\" color=\"primary\" dbxActionButton></dbx-button>\n <span class=\"dbx-spacer\"></span>\n <button mat-flat-button (click)=\"onCancelReset()\">Cancel Recovery</button>\n </div>\n <dbx-error dbxActionError></dbx-error>\n </ng-container>\n</ng-template>\n", components: [{ type: DbxFirebaseEmailFormComponent, selector: "dbx-firebase-email-form", inputs: ["config"] }, { type: i3.DbxAnchorLinkComponent, selector: "dbx-link", inputs: ["anchor", "ref", "href"] }, { type: i3.DbxButtonComponent, selector: "dbx-button", inputs: ["type", "raised", "stroked", "flat", "color", "customButtonColor", "customTextColor", "customSpinnerColor"] }, { type: i4.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: i3.DbxReadableErrorComponent, selector: "dbx-error", inputs: ["error"] }, { type: DbxFirebaseEmailRecoveryFormComponent, selector: "dbx-firebase-email-recovery-form" }], directives: [{ type: i6.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i6.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i6.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i3$1.DbxActionDirective, selector: "dbx-action,[dbxAction],dbx-action-context,[dbxActionContext]", exportAs: ["action", "dbxAction"] }, { type: i3$1.DbxActionHandlerDirective, selector: "[dbxActionHandler]", inputs: ["dbxActionHandler"] }, { type: i1$2.DbxActionFormDirective, selector: "[dbxActionForm]", inputs: ["dbxActionFormValidator", "dbxActionFormModified", "formDisabledOnWorking"] }, { type: i1$2.DbxFormSourceDirective, selector: "[dbxFormSource]", inputs: ["dbxFormSourceMode", "dbxFormSource"] }, { type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3$1.DbxActionButtonDirective, selector: "[dbxActionButton]" }, { type: i3.DbxButtonSpacerDirective, selector: "dbx-button-spacer,[dbxButtonSpacer]" }, { type: i3.DbxActionErrorDirective, selector: "[dbxActionError]" }], pipes: { "async": i6.AsyncPipe } });
|
|
806
903
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseLoginEmailContentComponent, decorators: [{
|
|
807
904
|
type: Component,
|
|
808
|
-
args: [{ template: "<div class=\"dbx-firebase-login-email-content\">\n <ng-container [ngSwitch]=\"emailMode$ | async\">\n <ng-container *ngSwitchCase=\"'login'\">\n <ng-container *ngTemplateOutlet=\"loginView\"></ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"'recover'\">\n <ng-container *ngTemplateOutlet=\"resetPassword\"></ng-container>\n </ng-container>\n </ng-container>\n</div>\n\n<!-- Login View -->\n<ng-template #loginView>\n <ng-container dbxAction [dbxActionHandler]=\"handleLoginAction\">\n <dbx-firebase-email-form [config]=\"formConfig\" dbxActionForm [dbxFormSource]=\"emailFormValue\"
|
|
905
|
+
args: [{ template: "<div class=\"dbx-firebase-login-email-content\">\n <ng-container [ngSwitch]=\"emailMode$ | async\">\n <ng-container *ngSwitchCase=\"'login'\">\n <ng-container *ngTemplateOutlet=\"loginView\"></ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"'recover'\">\n <ng-container *ngTemplateOutlet=\"resetPassword\"></ng-container>\n </ng-container>\n </ng-container>\n</div>\n\n<!-- Login View -->\n<ng-template #loginView>\n <ng-container dbxAction [dbxActionHandler]=\"handleLoginAction\">\n <dbx-firebase-email-form [config]=\"formConfig\" dbxActionForm [dbxFormSource]=\"emailFormValue\"></dbx-firebase-email-form>\n <div class=\"dbx-firebase-login-email-forgot-prompt\" *ngIf=\"isLoginMode\">\n <dbx-link [anchor]=\"forgotAnchor\">Forgot Password?</dbx-link>\n </div>\n <div class=\"dbx-flex\">\n <dbx-button class=\"dbx-wide-button\" [text]=\"buttonText\" [raised]=\"true\" color=\"primary\" dbxActionButton></dbx-button>\n <dbx-button-spacer></dbx-button-spacer>\n <span class=\"dbx-spacer\"></span>\n <button mat-flat-button (click)=\"onCancel()\">Cancel</button>\n </div>\n <dbx-error dbxActionError></dbx-error>\n </ng-container>\n</ng-template>\n\n<!-- Reset Password View -->\n<ng-template #resetPassword>\n <ng-container dbxAction [dbxActionHandler]=\"handleRecoveryAction\">\n <dbx-firebase-email-recovery-form dbxActionForm [dbxFormSource]=\"recoveryFormValue\"></dbx-firebase-email-recovery-form>\n <p class=\"dbx-hint\">An email will be sent to the above address to help you reset your password.</p>\n <div class=\"dbx-flex\">\n <dbx-button class=\"dbx-wide-button\" text=\"Send Recovery Email\" [raised]=\"true\" color=\"primary\" dbxActionButton></dbx-button>\n <span class=\"dbx-spacer\"></span>\n <button mat-flat-button (click)=\"onCancelReset()\">Cancel Recovery</button>\n </div>\n <dbx-error dbxActionError></dbx-error>\n </ng-container>\n</ng-template>\n" }]
|
|
809
906
|
}], ctorParameters: function () { return [{ type: DbxFirebaseAuthService }, { type: undefined, decorators: [{
|
|
810
907
|
type: Inject,
|
|
811
908
|
args: [DBX_INJECTION_COMPONENT_DATA]
|
|
@@ -871,12 +968,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
|
|
|
871
968
|
class DbxFirebaseRegisterComponent {
|
|
872
969
|
}
|
|
873
970
|
DbxFirebaseRegisterComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseRegisterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
874
|
-
DbxFirebaseRegisterComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", type: DbxFirebaseRegisterComponent, selector: "dbx-firebase-register", inputs: { providerTypes: "providerTypes", omitProviderTypes: "omitProviderTypes", providerCategories: "providerCategories" }, ngImport: i0, template:
|
|
971
|
+
DbxFirebaseRegisterComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", type: DbxFirebaseRegisterComponent, selector: "dbx-firebase-register", inputs: { providerTypes: "providerTypes", omitProviderTypes: "omitProviderTypes", providerCategories: "providerCategories" }, ngImport: i0, template: `
|
|
972
|
+
<dbx-firebase-login loginMode="register" [providerTypes]="providerTypes" [omitProviderTypes]="omitProviderTypes" [providerCategories]="providerCategories"></dbx-firebase-login>
|
|
973
|
+
`, isInline: true, components: [{ type: DbxFirebaseLoginComponent, selector: "dbx-firebase-login", inputs: ["loginMode", "providerTypes", "omitProviderTypes", "providerCategories"] }] });
|
|
875
974
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseRegisterComponent, decorators: [{
|
|
876
975
|
type: Component,
|
|
877
976
|
args: [{
|
|
878
977
|
selector: 'dbx-firebase-register',
|
|
879
|
-
template:
|
|
978
|
+
template: `
|
|
979
|
+
<dbx-firebase-login loginMode="register" [providerTypes]="providerTypes" [omitProviderTypes]="omitProviderTypes" [providerCategories]="providerCategories"></dbx-firebase-login>
|
|
980
|
+
`
|
|
880
981
|
}]
|
|
881
982
|
}], propDecorators: { providerTypes: [{
|
|
882
983
|
type: Input
|
|
@@ -965,14 +1066,18 @@ class DbxFirebaseLoginTermsComponent {
|
|
|
965
1066
|
}
|
|
966
1067
|
}
|
|
967
1068
|
DbxFirebaseLoginTermsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseLoginTermsComponent, deps: [{ token: DbxFirebaseAuthLoginService }], target: i0.ɵɵFactoryTarget.Component });
|
|
968
|
-
DbxFirebaseLoginTermsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", type: DbxFirebaseLoginTermsComponent, selector: "dbx-firebase-login-terms", host: { classAttribute: "dbx-firebase-login-terms d-block" }, ngImport: i0, template:
|
|
1069
|
+
DbxFirebaseLoginTermsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", type: DbxFirebaseLoginTermsComponent, selector: "dbx-firebase-login-terms", host: { classAttribute: "dbx-firebase-login-terms d-block" }, ngImport: i0, template: `
|
|
1070
|
+
<dbx-injection [config]="config"></dbx-injection>
|
|
1071
|
+
`, isInline: true, components: [{ type: i3$1.DbxInjectionComponent, selector: "dbx-injection, [dbxInjection], [dbx-injection]", inputs: ["config", "template"] }] });
|
|
969
1072
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseLoginTermsComponent, decorators: [{
|
|
970
1073
|
type: Component,
|
|
971
1074
|
args: [{
|
|
972
1075
|
selector: 'dbx-firebase-login-terms',
|
|
973
|
-
template:
|
|
1076
|
+
template: `
|
|
1077
|
+
<dbx-injection [config]="config"></dbx-injection>
|
|
1078
|
+
`,
|
|
974
1079
|
host: {
|
|
975
|
-
|
|
1080
|
+
class: 'dbx-firebase-login-terms d-block'
|
|
976
1081
|
}
|
|
977
1082
|
}]
|
|
978
1083
|
}], ctorParameters: function () { return [{ type: DbxFirebaseAuthLoginService }]; } });
|
|
@@ -992,8 +1097,8 @@ DbxFirebaseLoginContextBackButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ m
|
|
|
992
1097
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseLoginContextBackButtonComponent, decorators: [{
|
|
993
1098
|
type: Component,
|
|
994
1099
|
args: [{
|
|
995
|
-
|
|
996
|
-
|
|
1100
|
+
selector: 'dbx-firebase-login-context-back-button',
|
|
1101
|
+
template: `
|
|
997
1102
|
<dbx-link [anchor]="anchor">Choose other login method.</dbx-link>
|
|
998
1103
|
`
|
|
999
1104
|
}]
|
|
@@ -1008,7 +1113,8 @@ function defaultFirebaseAuthLoginProvidersFactory() {
|
|
|
1008
1113
|
// https://firebase.google.com/docs/auth/web/firebaseui
|
|
1009
1114
|
const baseFirebaseJSUrl = `https://www.gstatic.com/firebasejs/ui/2.0.0/images/auth`;
|
|
1010
1115
|
// NOTE: Colors are from https://brandcolors.net/
|
|
1011
|
-
return [
|
|
1116
|
+
return [
|
|
1117
|
+
{
|
|
1012
1118
|
category: DEFAULT_FIREBASE_LOGIN_METHOD_CATEGORY,
|
|
1013
1119
|
loginMethodType: 'email',
|
|
1014
1120
|
componentClass: DbxFirebaseLoginEmailComponent,
|
|
@@ -1019,7 +1125,8 @@ function defaultFirebaseAuthLoginProvidersFactory() {
|
|
|
1019
1125
|
backgroundColor: '#ea4335',
|
|
1020
1126
|
textColor: '#FFF'
|
|
1021
1127
|
}
|
|
1022
|
-
},
|
|
1128
|
+
},
|
|
1129
|
+
{
|
|
1023
1130
|
category: OAUTH_FIREBASE_LOGIN_METHOD_CATEGORY,
|
|
1024
1131
|
loginMethodType: 'google',
|
|
1025
1132
|
componentClass: DbxFirebaseLoginGoogleComponent,
|
|
@@ -1029,7 +1136,8 @@ function defaultFirebaseAuthLoginProvidersFactory() {
|
|
|
1029
1136
|
backgroundColor: '#FFF',
|
|
1030
1137
|
textColor: '#757575'
|
|
1031
1138
|
}
|
|
1032
|
-
},
|
|
1139
|
+
},
|
|
1140
|
+
{
|
|
1033
1141
|
category: OAUTH_FIREBASE_LOGIN_METHOD_CATEGORY,
|
|
1034
1142
|
loginMethodType: 'facebook',
|
|
1035
1143
|
componentClass: DbxFirebaseLoginFacebookComponent,
|
|
@@ -1039,7 +1147,8 @@ function defaultFirebaseAuthLoginProvidersFactory() {
|
|
|
1039
1147
|
backgroundColor: '#4267B2',
|
|
1040
1148
|
textColor: '#FFF'
|
|
1041
1149
|
}
|
|
1042
|
-
},
|
|
1150
|
+
},
|
|
1151
|
+
{
|
|
1043
1152
|
category: OAUTH_FIREBASE_LOGIN_METHOD_CATEGORY,
|
|
1044
1153
|
loginMethodType: 'twitter',
|
|
1045
1154
|
componentClass: DbxFirebaseLoginTwitterComponent,
|
|
@@ -1049,7 +1158,8 @@ function defaultFirebaseAuthLoginProvidersFactory() {
|
|
|
1049
1158
|
backgroundColor: '#1da1f2',
|
|
1050
1159
|
textColor: '#FFF'
|
|
1051
1160
|
}
|
|
1052
|
-
},
|
|
1161
|
+
},
|
|
1162
|
+
{
|
|
1053
1163
|
category: OAUTH_FIREBASE_LOGIN_METHOD_CATEGORY,
|
|
1054
1164
|
loginMethodType: 'github',
|
|
1055
1165
|
componentClass: DbxFirebaseLoginGitHubComponent,
|
|
@@ -1060,7 +1170,27 @@ function defaultFirebaseAuthLoginProvidersFactory() {
|
|
|
1060
1170
|
textColor: '#FFF'
|
|
1061
1171
|
}
|
|
1062
1172
|
},
|
|
1063
|
-
{
|
|
1173
|
+
/*{
|
|
1174
|
+
category: OAUTH_FIREBASE_LOGIN_METHOD_CATEGORY,
|
|
1175
|
+
loginMethodType: 'apple' as KnownFirebaseLoginMethodType,
|
|
1176
|
+
componentClass: DbxFirebaseLoginGitHubComponent,
|
|
1177
|
+
assets: {
|
|
1178
|
+
logoUrl: `${baseFirebaseJSUrl}/apple.svg`,
|
|
1179
|
+
loginText: 'Continue with Apple',
|
|
1180
|
+
backgroundColor: '#333',
|
|
1181
|
+
textColor: '#FFF'
|
|
1182
|
+
}
|
|
1183
|
+
}, {
|
|
1184
|
+
category: OAUTH_FIREBASE_LOGIN_METHOD_CATEGORY,
|
|
1185
|
+
loginMethodType: 'microsoft' as KnownFirebaseLoginMethodType,
|
|
1186
|
+
componentClass: DbxFirebaseLoginGitHubComponent,
|
|
1187
|
+
assets: {
|
|
1188
|
+
logoUrl: `${baseFirebaseJSUrl}/microsoft.svg`,
|
|
1189
|
+
loginText: 'Continue with Microsoft',
|
|
1190
|
+
backgroundColor: '#ea3e23',
|
|
1191
|
+
textColor: '#FFF'
|
|
1192
|
+
}
|
|
1193
|
+
},*/ {
|
|
1064
1194
|
category: DEFAULT_FIREBASE_LOGIN_METHOD_CATEGORY,
|
|
1065
1195
|
loginMethodType: 'anonymous',
|
|
1066
1196
|
componentClass: DbxFirebaseLoginAnonymousComponent,
|
|
@@ -1070,7 +1200,8 @@ function defaultFirebaseAuthLoginProvidersFactory() {
|
|
|
1070
1200
|
backgroundColor: '#000',
|
|
1071
1201
|
textColor: '#FFF'
|
|
1072
1202
|
}
|
|
1073
|
-
}
|
|
1203
|
+
}
|
|
1204
|
+
];
|
|
1074
1205
|
}
|
|
1075
1206
|
/**
|
|
1076
1207
|
* Contains components related to logging in.
|
|
@@ -1087,22 +1218,28 @@ class DbxFirebaseLoginModule {
|
|
|
1087
1218
|
static forRoot(config) {
|
|
1088
1219
|
return {
|
|
1089
1220
|
ngModule: DbxFirebaseLoginModule,
|
|
1090
|
-
providers: [
|
|
1221
|
+
providers: [
|
|
1222
|
+
{
|
|
1091
1223
|
provide: DEFAULT_FIREBASE_AUTH_LOGIN_PROVIDERS_TOKEN,
|
|
1092
1224
|
useFactory: defaultFirebaseAuthLoginProvidersFactory
|
|
1093
|
-
},
|
|
1225
|
+
},
|
|
1226
|
+
{
|
|
1094
1227
|
provide: DEFAULT_FIREBASE_AUTH_LOGIN_TERMS_COMPONENT_CLASS_TOKEN,
|
|
1095
1228
|
useValue: config.termsComponentClass
|
|
1096
|
-
},
|
|
1229
|
+
},
|
|
1230
|
+
{
|
|
1097
1231
|
provide: DEFAULT_FIREBASE_AUTH_LOGIN_PASSWORD_CONFIG_TOKEN,
|
|
1098
1232
|
useValue: config.passwordConfig
|
|
1099
|
-
},
|
|
1233
|
+
},
|
|
1234
|
+
{
|
|
1100
1235
|
provide: DbxFirebaseLoginModuleRootConfig,
|
|
1101
1236
|
useValue: config
|
|
1102
|
-
},
|
|
1237
|
+
},
|
|
1238
|
+
{
|
|
1103
1239
|
provide: DbxFirebaseLoginTermsConfig,
|
|
1104
1240
|
useValue: config
|
|
1105
|
-
}
|
|
1241
|
+
}
|
|
1242
|
+
]
|
|
1106
1243
|
};
|
|
1107
1244
|
}
|
|
1108
1245
|
}
|
|
@@ -1127,19 +1264,7 @@ DbxFirebaseLoginModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0",
|
|
|
1127
1264
|
DbxFirebaseLoginFacebookComponent,
|
|
1128
1265
|
DbxFirebaseLoginAnonymousComponent,
|
|
1129
1266
|
DbxFirebaseLoginTermsComponent,
|
|
1130
|
-
DbxFirebaseLoginTermsSimpleComponent], imports: [CommonModule,
|
|
1131
|
-
MatIconModule,
|
|
1132
|
-
MatButtonModule,
|
|
1133
|
-
DbxRouterAnchorModule,
|
|
1134
|
-
DbxFormIoModule,
|
|
1135
|
-
DbxFormModule,
|
|
1136
|
-
DbxFormlyModule,
|
|
1137
|
-
DbxFormActionModule,
|
|
1138
|
-
DbxFormFormlyTextFieldModule,
|
|
1139
|
-
DbxReadableErrorModule,
|
|
1140
|
-
DbxActionModule,
|
|
1141
|
-
DbxButtonModule,
|
|
1142
|
-
DbxInjectionComponentModule], exports: [DbxFirebaseLoginComponent,
|
|
1267
|
+
DbxFirebaseLoginTermsSimpleComponent], imports: [CommonModule, MatIconModule, MatButtonModule, DbxRouterAnchorModule, DbxFormIoModule, DbxFormModule, DbxFormlyModule, DbxFormActionModule, DbxFormFormlyTextFieldModule, DbxReadableErrorModule, DbxActionModule, DbxButtonModule, DbxInjectionComponentModule], exports: [DbxFirebaseLoginComponent,
|
|
1143
1268
|
DbxFirebaseLoginContextDirective,
|
|
1144
1269
|
DbxFirebaseLoginContextBackButtonComponent,
|
|
1145
1270
|
DbxFirebaseRegisterComponent,
|
|
@@ -1160,39 +1285,11 @@ DbxFirebaseLoginModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0",
|
|
|
1160
1285
|
DbxFirebaseLoginAnonymousComponent,
|
|
1161
1286
|
DbxFirebaseLoginTermsComponent,
|
|
1162
1287
|
DbxFirebaseLoginTermsSimpleComponent] });
|
|
1163
|
-
DbxFirebaseLoginModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseLoginModule, providers: [], imports: [[
|
|
1164
|
-
CommonModule,
|
|
1165
|
-
MatIconModule,
|
|
1166
|
-
MatButtonModule,
|
|
1167
|
-
DbxRouterAnchorModule,
|
|
1168
|
-
DbxFormIoModule,
|
|
1169
|
-
DbxFormModule,
|
|
1170
|
-
DbxFormlyModule,
|
|
1171
|
-
DbxFormActionModule,
|
|
1172
|
-
DbxFormFormlyTextFieldModule,
|
|
1173
|
-
DbxReadableErrorModule,
|
|
1174
|
-
DbxActionModule,
|
|
1175
|
-
DbxButtonModule,
|
|
1176
|
-
DbxInjectionComponentModule
|
|
1177
|
-
]] });
|
|
1288
|
+
DbxFirebaseLoginModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseLoginModule, providers: [], imports: [[CommonModule, MatIconModule, MatButtonModule, DbxRouterAnchorModule, DbxFormIoModule, DbxFormModule, DbxFormlyModule, DbxFormActionModule, DbxFormFormlyTextFieldModule, DbxReadableErrorModule, DbxActionModule, DbxButtonModule, DbxInjectionComponentModule]] });
|
|
1178
1289
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseLoginModule, decorators: [{
|
|
1179
1290
|
type: NgModule,
|
|
1180
1291
|
args: [{
|
|
1181
|
-
imports: [
|
|
1182
|
-
CommonModule,
|
|
1183
|
-
MatIconModule,
|
|
1184
|
-
MatButtonModule,
|
|
1185
|
-
DbxRouterAnchorModule,
|
|
1186
|
-
DbxFormIoModule,
|
|
1187
|
-
DbxFormModule,
|
|
1188
|
-
DbxFormlyModule,
|
|
1189
|
-
DbxFormActionModule,
|
|
1190
|
-
DbxFormFormlyTextFieldModule,
|
|
1191
|
-
DbxReadableErrorModule,
|
|
1192
|
-
DbxActionModule,
|
|
1193
|
-
DbxButtonModule,
|
|
1194
|
-
DbxInjectionComponentModule
|
|
1195
|
-
],
|
|
1292
|
+
imports: [CommonModule, MatIconModule, MatButtonModule, DbxRouterAnchorModule, DbxFormIoModule, DbxFormModule, DbxFormlyModule, DbxFormActionModule, DbxFormFormlyTextFieldModule, DbxReadableErrorModule, DbxActionModule, DbxButtonModule, DbxInjectionComponentModule],
|
|
1196
1293
|
declarations: [
|
|
1197
1294
|
DbxFirebaseLoginComponent,
|
|
1198
1295
|
DbxFirebaseLoginContextDirective,
|
|
@@ -1283,7 +1380,7 @@ class DbxFirebaseParsedEmulatorsConfig {
|
|
|
1283
1380
|
class DbxFirebaseDefaultFirestoreProviderModule {
|
|
1284
1381
|
}
|
|
1285
1382
|
DbxFirebaseDefaultFirestoreProviderModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseDefaultFirestoreProviderModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1286
|
-
DbxFirebaseDefaultFirestoreProviderModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseDefaultFirestoreProviderModule, imports: [i1$
|
|
1383
|
+
DbxFirebaseDefaultFirestoreProviderModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseDefaultFirestoreProviderModule, imports: [i1$3.FirestoreModule] });
|
|
1287
1384
|
DbxFirebaseDefaultFirestoreProviderModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseDefaultFirestoreProviderModule, imports: [[
|
|
1288
1385
|
provideFirestore(((injector) => {
|
|
1289
1386
|
const firebaseApp = injector.get(FirebaseApp);
|
|
@@ -1313,13 +1410,96 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
|
|
|
1313
1410
|
]
|
|
1314
1411
|
}]
|
|
1315
1412
|
}] });
|
|
1413
|
+
/**
|
|
1414
|
+
* Default firebase app check provider module.
|
|
1415
|
+
*
|
|
1416
|
+
* Also configures the DbxFirebaseAppCheckHttpInterceptor with HTTP_INTERCEPTORS in order for appCheck to be appended to requests to the api.
|
|
1417
|
+
*/
|
|
1418
|
+
class DbxFirebaseDefaultAppCheckProviderModule {
|
|
1419
|
+
}
|
|
1420
|
+
DbxFirebaseDefaultAppCheckProviderModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseDefaultAppCheckProviderModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1421
|
+
DbxFirebaseDefaultAppCheckProviderModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseDefaultAppCheckProviderModule, imports: [i1.AppCheckModule] });
|
|
1422
|
+
DbxFirebaseDefaultAppCheckProviderModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseDefaultAppCheckProviderModule, providers: [
|
|
1423
|
+
{
|
|
1424
|
+
provide: HTTP_INTERCEPTORS,
|
|
1425
|
+
useClass: DbxFirebaseAppCheckHttpInterceptor,
|
|
1426
|
+
multi: true
|
|
1427
|
+
}
|
|
1428
|
+
], imports: [[
|
|
1429
|
+
provideAppCheck(((injector) => {
|
|
1430
|
+
const firebaseApp = injector.get(FirebaseApp);
|
|
1431
|
+
const firebaseOptions = injector.get(DBX_FIREBASE_OPTIONS_TOKEN);
|
|
1432
|
+
const appCheckOptions = firebaseOptions.appCheck;
|
|
1433
|
+
const appCheckKnowinglyDisabled = appCheckOptions?.disabled === true || firebaseOptions.emulators?.useEmulators === true;
|
|
1434
|
+
let appCheck;
|
|
1435
|
+
if (appCheckOptions && !appCheckKnowinglyDisabled) {
|
|
1436
|
+
// enable the debug tokens if not using emulators and allowDebugTokens is set true
|
|
1437
|
+
if (firebaseOptions.emulators?.useEmulators !== true && appCheckOptions.allowDebugTokens) {
|
|
1438
|
+
enableAppCheckDebugTokenGeneration(true);
|
|
1439
|
+
}
|
|
1440
|
+
// Only enabled outside of app-check environments. The emulators will not use appcheck.
|
|
1441
|
+
appCheck = initializeAppCheck(firebaseApp, {
|
|
1442
|
+
provider: new ReCaptchaV3Provider(appCheckOptions.reCaptchaV3),
|
|
1443
|
+
isTokenAutoRefreshEnabled: appCheckOptions.isTokenAutoRefreshEnabled ?? true
|
|
1444
|
+
});
|
|
1445
|
+
console.debug('Enabled AppCheck.');
|
|
1446
|
+
}
|
|
1447
|
+
else {
|
|
1448
|
+
appCheck = undefined;
|
|
1449
|
+
if (!appCheckKnowinglyDisabled) {
|
|
1450
|
+
console.error('dbx-firebase: No appcheck configuration for the app, and not specifically disabled in config either.');
|
|
1451
|
+
}
|
|
1452
|
+
}
|
|
1453
|
+
return appCheck;
|
|
1454
|
+
}))
|
|
1455
|
+
]] });
|
|
1456
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseDefaultAppCheckProviderModule, decorators: [{
|
|
1457
|
+
type: NgModule,
|
|
1458
|
+
args: [{
|
|
1459
|
+
imports: [
|
|
1460
|
+
provideAppCheck(((injector) => {
|
|
1461
|
+
const firebaseApp = injector.get(FirebaseApp);
|
|
1462
|
+
const firebaseOptions = injector.get(DBX_FIREBASE_OPTIONS_TOKEN);
|
|
1463
|
+
const appCheckOptions = firebaseOptions.appCheck;
|
|
1464
|
+
const appCheckKnowinglyDisabled = appCheckOptions?.disabled === true || firebaseOptions.emulators?.useEmulators === true;
|
|
1465
|
+
let appCheck;
|
|
1466
|
+
if (appCheckOptions && !appCheckKnowinglyDisabled) {
|
|
1467
|
+
// enable the debug tokens if not using emulators and allowDebugTokens is set true
|
|
1468
|
+
if (firebaseOptions.emulators?.useEmulators !== true && appCheckOptions.allowDebugTokens) {
|
|
1469
|
+
enableAppCheckDebugTokenGeneration(true);
|
|
1470
|
+
}
|
|
1471
|
+
// Only enabled outside of app-check environments. The emulators will not use appcheck.
|
|
1472
|
+
appCheck = initializeAppCheck(firebaseApp, {
|
|
1473
|
+
provider: new ReCaptchaV3Provider(appCheckOptions.reCaptchaV3),
|
|
1474
|
+
isTokenAutoRefreshEnabled: appCheckOptions.isTokenAutoRefreshEnabled ?? true
|
|
1475
|
+
});
|
|
1476
|
+
console.debug('Enabled AppCheck.');
|
|
1477
|
+
}
|
|
1478
|
+
else {
|
|
1479
|
+
appCheck = undefined;
|
|
1480
|
+
if (!appCheckKnowinglyDisabled) {
|
|
1481
|
+
console.error('dbx-firebase: No appcheck configuration for the app, and not specifically disabled in config either.');
|
|
1482
|
+
}
|
|
1483
|
+
}
|
|
1484
|
+
return appCheck;
|
|
1485
|
+
}))
|
|
1486
|
+
],
|
|
1487
|
+
providers: [
|
|
1488
|
+
{
|
|
1489
|
+
provide: HTTP_INTERCEPTORS,
|
|
1490
|
+
useClass: DbxFirebaseAppCheckHttpInterceptor,
|
|
1491
|
+
multi: true
|
|
1492
|
+
}
|
|
1493
|
+
]
|
|
1494
|
+
}]
|
|
1495
|
+
}] });
|
|
1316
1496
|
/**
|
|
1317
1497
|
* Default firebase auth provider module.
|
|
1318
1498
|
*/
|
|
1319
1499
|
class DbxFirebaseDefaultAuthProviderModule {
|
|
1320
1500
|
}
|
|
1321
1501
|
DbxFirebaseDefaultAuthProviderModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseDefaultAuthProviderModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1322
|
-
DbxFirebaseDefaultAuthProviderModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseDefaultAuthProviderModule, imports: [i1.AuthModule] });
|
|
1502
|
+
DbxFirebaseDefaultAuthProviderModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseDefaultAuthProviderModule, imports: [i1$1.AuthModule] });
|
|
1323
1503
|
DbxFirebaseDefaultAuthProviderModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseDefaultAuthProviderModule, imports: [[
|
|
1324
1504
|
provideAuth(((injector) => {
|
|
1325
1505
|
const firebaseApp = injector.get(FirebaseApp);
|
|
@@ -1353,7 +1533,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
|
|
|
1353
1533
|
class DbxFirebaseDefaultStorageProviderModule {
|
|
1354
1534
|
}
|
|
1355
1535
|
DbxFirebaseDefaultStorageProviderModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseDefaultStorageProviderModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1356
|
-
DbxFirebaseDefaultStorageProviderModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseDefaultStorageProviderModule, imports: [
|
|
1536
|
+
DbxFirebaseDefaultStorageProviderModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseDefaultStorageProviderModule, imports: [i4$1.StorageModule] });
|
|
1357
1537
|
DbxFirebaseDefaultStorageProviderModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseDefaultStorageProviderModule, imports: [[
|
|
1358
1538
|
provideStorage(((injector) => {
|
|
1359
1539
|
const firebaseApp = injector.get(FirebaseApp);
|
|
@@ -1387,7 +1567,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
|
|
|
1387
1567
|
class DbxFirebaseDefaultFunctionsProviderModule {
|
|
1388
1568
|
}
|
|
1389
1569
|
DbxFirebaseDefaultFunctionsProviderModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseDefaultFunctionsProviderModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1390
|
-
DbxFirebaseDefaultFunctionsProviderModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseDefaultFunctionsProviderModule, imports: [
|
|
1570
|
+
DbxFirebaseDefaultFunctionsProviderModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseDefaultFunctionsProviderModule, imports: [i5.FunctionsModule] });
|
|
1391
1571
|
DbxFirebaseDefaultFunctionsProviderModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseDefaultFunctionsProviderModule, imports: [[
|
|
1392
1572
|
provideFunctions(((injector) => {
|
|
1393
1573
|
const firebaseApp = injector.get(FirebaseApp);
|
|
@@ -1419,7 +1599,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
|
|
|
1419
1599
|
]
|
|
1420
1600
|
}]
|
|
1421
1601
|
}] });
|
|
1422
|
-
const DBX_FIREBASE_OPTIONS_TOKEN = new InjectionToken('DbxFirebaseOptions');
|
|
1423
1602
|
/**
|
|
1424
1603
|
* Default provider module.
|
|
1425
1604
|
*/
|
|
@@ -1427,20 +1606,23 @@ class DbxFirebaseDefaultFirebaseProvidersModule {
|
|
|
1427
1606
|
static forRoot(firebaseOptions) {
|
|
1428
1607
|
return {
|
|
1429
1608
|
ngModule: DbxFirebaseDefaultFirebaseProvidersModule,
|
|
1430
|
-
providers: [
|
|
1609
|
+
providers: [
|
|
1610
|
+
{
|
|
1431
1611
|
provide: DBX_FIREBASE_OPTIONS_TOKEN,
|
|
1432
1612
|
useValue: firebaseOptions
|
|
1433
|
-
}
|
|
1613
|
+
}
|
|
1614
|
+
]
|
|
1434
1615
|
};
|
|
1435
1616
|
}
|
|
1436
1617
|
}
|
|
1437
1618
|
DbxFirebaseDefaultFirebaseProvidersModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseDefaultFirebaseProvidersModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1438
|
-
DbxFirebaseDefaultFirebaseProvidersModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseDefaultFirebaseProvidersModule, imports: [
|
|
1619
|
+
DbxFirebaseDefaultFirebaseProvidersModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseDefaultFirebaseProvidersModule, imports: [i6$1.FirebaseAppModule, DbxFirebaseDefaultAppCheckProviderModule, DbxFirebaseDefaultFirestoreProviderModule, DbxFirebaseDefaultAuthProviderModule, DbxFirebaseDefaultStorageProviderModule, DbxFirebaseDefaultFunctionsProviderModule] });
|
|
1439
1620
|
DbxFirebaseDefaultFirebaseProvidersModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseDefaultFirebaseProvidersModule, imports: [[
|
|
1440
1621
|
provideFirebaseApp(((injector) => {
|
|
1441
1622
|
const firebaseOptions = injector.get(DBX_FIREBASE_OPTIONS_TOKEN);
|
|
1442
1623
|
return initializeApp(firebaseOptions);
|
|
1443
1624
|
})),
|
|
1625
|
+
DbxFirebaseDefaultAppCheckProviderModule,
|
|
1444
1626
|
DbxFirebaseDefaultFirestoreProviderModule,
|
|
1445
1627
|
DbxFirebaseDefaultAuthProviderModule,
|
|
1446
1628
|
DbxFirebaseDefaultStorageProviderModule,
|
|
@@ -1454,6 +1636,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
|
|
|
1454
1636
|
const firebaseOptions = injector.get(DBX_FIREBASE_OPTIONS_TOKEN);
|
|
1455
1637
|
return initializeApp(firebaseOptions);
|
|
1456
1638
|
})),
|
|
1639
|
+
DbxFirebaseDefaultAppCheckProviderModule,
|
|
1457
1640
|
DbxFirebaseDefaultFirestoreProviderModule,
|
|
1458
1641
|
DbxFirebaseDefaultAuthProviderModule,
|
|
1459
1642
|
DbxFirebaseDefaultStorageProviderModule,
|
|
@@ -1469,7 +1652,7 @@ class DbxFirebaseEmulatorModule {
|
|
|
1469
1652
|
static forRoot(config) {
|
|
1470
1653
|
const defaultHost = config.host ?? 'localhost';
|
|
1471
1654
|
function emulatorConfig(emulator) {
|
|
1472
|
-
return
|
|
1655
|
+
return emulator ? { host: emulator.host ?? defaultHost, port: emulator.port } : undefined;
|
|
1473
1656
|
}
|
|
1474
1657
|
const finalConfig = {
|
|
1475
1658
|
useEmulators: config.useEmulators !== false,
|
|
@@ -1481,10 +1664,12 @@ class DbxFirebaseEmulatorModule {
|
|
|
1481
1664
|
};
|
|
1482
1665
|
return {
|
|
1483
1666
|
ngModule: DbxFirebaseEmulatorModule,
|
|
1484
|
-
providers: [
|
|
1667
|
+
providers: [
|
|
1668
|
+
{
|
|
1485
1669
|
provide: DbxFirebaseParsedEmulatorsConfig,
|
|
1486
1670
|
useValue: finalConfig
|
|
1487
|
-
}
|
|
1671
|
+
}
|
|
1672
|
+
]
|
|
1488
1673
|
};
|
|
1489
1674
|
}
|
|
1490
1675
|
}
|
|
@@ -1507,15 +1692,18 @@ class DbxFirebaseFirestoreCollectionModule {
|
|
|
1507
1692
|
static forRoot(config) {
|
|
1508
1693
|
return {
|
|
1509
1694
|
ngModule: DbxFirebaseFirestoreCollectionModule,
|
|
1510
|
-
providers: [
|
|
1695
|
+
providers: [
|
|
1696
|
+
{
|
|
1511
1697
|
provide: DBX_FIRESTORE_CONTEXT_TOKEN,
|
|
1512
1698
|
useFactory: firebaseFirestoreContextFactory,
|
|
1513
1699
|
deps: [Firestore]
|
|
1514
|
-
},
|
|
1700
|
+
},
|
|
1701
|
+
{
|
|
1515
1702
|
provide: config.appCollectionClass,
|
|
1516
1703
|
useFactory: config.collectionFactory,
|
|
1517
1704
|
deps: [DBX_FIRESTORE_CONTEXT_TOKEN]
|
|
1518
|
-
}
|
|
1705
|
+
}
|
|
1706
|
+
]
|
|
1519
1707
|
};
|
|
1520
1708
|
}
|
|
1521
1709
|
}
|
|
@@ -1551,11 +1739,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
|
|
|
1551
1739
|
*/
|
|
1552
1740
|
class DbxFirebaseFunctionsModule {
|
|
1553
1741
|
static forRoot(config) {
|
|
1554
|
-
const providers = [
|
|
1742
|
+
const providers = [
|
|
1743
|
+
{
|
|
1555
1744
|
provide: config.functionsGetterToken,
|
|
1556
1745
|
useFactory: config.functionsGetterFactory,
|
|
1557
1746
|
deps: [Functions]
|
|
1558
|
-
}
|
|
1747
|
+
}
|
|
1748
|
+
];
|
|
1559
1749
|
if (config.functionsConfigMap) {
|
|
1560
1750
|
forEachKeyValue(config.functionsConfigMap, {
|
|
1561
1751
|
forEach: ([key, entry]) => {
|
|
@@ -1603,10 +1793,7 @@ class DbxFirebaseCollectionLoaderInstance {
|
|
|
1603
1793
|
this._maxPagesSub = new SubscriptionObject();
|
|
1604
1794
|
this.collection$ = this._collection.pipe(distinctUntilChanged());
|
|
1605
1795
|
this.constraints$ = this._constraints.pipe(distinctUntilChanged());
|
|
1606
|
-
this.iteratorFilter$ = combineLatest([
|
|
1607
|
-
this._itemsPerPage.pipe(distinctUntilChanged()),
|
|
1608
|
-
this.constraints$
|
|
1609
|
-
]).pipe(map(([limit, constraints]) => ({ limit, constraints, maxPageLoadLimit: this.maxPages })), shareReplay(1));
|
|
1796
|
+
this.iteratorFilter$ = combineLatest([this._itemsPerPage.pipe(distinctUntilChanged()), this.constraints$]).pipe(map(([limit, constraints]) => ({ limit, constraints, maxPageLoadLimit: this.maxPages })), shareReplay(1));
|
|
1610
1797
|
this.firestoreIteration$ = this.collection$.pipe(switchMap((collection) => {
|
|
1611
1798
|
if (collection) {
|
|
1612
1799
|
return combineLatest([this.iteratorFilter$, this._restart.pipe(startWith(undefined))]).pipe(throttleTime(100, undefined, { trailing: true }), // prevent rapid changes and executing filters too quickly.
|
|
@@ -1618,16 +1805,18 @@ class DbxFirebaseCollectionLoaderInstance {
|
|
|
1618
1805
|
}
|
|
1619
1806
|
}), cleanupDestroyable(), // cleanup the iteration
|
|
1620
1807
|
shareReplay(1));
|
|
1621
|
-
this.queryChangeWatcher$ = this.firestoreIteration$.pipe(map(instance => iterationQueryDocChangeWatcher({ instance })), shareReplay(1));
|
|
1622
|
-
this.accumulator$ = this.firestoreIteration$.pipe(map(x => firebaseQueryItemAccumulator(x)), cleanupDestroyable(), shareReplay(1));
|
|
1623
|
-
this.pageLoadingState$ = this.accumulator$.pipe(switchMap(x => accumulatorFlattenPageListLoadingState(x)), shareReplay(1));
|
|
1808
|
+
this.queryChangeWatcher$ = this.firestoreIteration$.pipe(map((instance) => iterationQueryDocChangeWatcher({ instance })), shareReplay(1));
|
|
1809
|
+
this.accumulator$ = this.firestoreIteration$.pipe(map((x) => firebaseQueryItemAccumulator(x)), cleanupDestroyable(), shareReplay(1));
|
|
1810
|
+
this.pageLoadingState$ = this.accumulator$.pipe(switchMap((x) => accumulatorFlattenPageListLoadingState(x)), shareReplay(1));
|
|
1624
1811
|
}
|
|
1625
1812
|
init() {
|
|
1626
1813
|
// When max pages changes, update the iteration's max page limit.
|
|
1627
|
-
this._maxPagesSub.subscription = this._maxPages
|
|
1814
|
+
this._maxPagesSub.subscription = this._maxPages
|
|
1815
|
+
.pipe(distinctUntilChanged(), filterMaybe(), // do not pass null/undefined values
|
|
1628
1816
|
switchMap((maxPageLoadLimit) => this.firestoreIteration$.pipe(tap((iteration) => {
|
|
1629
1817
|
iteration.maxPageLoadLimit = maxPageLoadLimit;
|
|
1630
|
-
}))))
|
|
1818
|
+
}))))
|
|
1819
|
+
.subscribe();
|
|
1631
1820
|
}
|
|
1632
1821
|
destroy() {
|
|
1633
1822
|
this._maxPages.complete();
|
|
@@ -1727,10 +1916,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
|
|
|
1727
1916
|
type: Input
|
|
1728
1917
|
}] } });
|
|
1729
1918
|
function provideDbxFirebaseCollectionStoreDirective(sourceType, storeType) {
|
|
1730
|
-
const providers = [
|
|
1919
|
+
const providers = [
|
|
1920
|
+
{
|
|
1731
1921
|
provide: DbxFirebaseCollectionStoreDirective,
|
|
1732
1922
|
useExisting: forwardRef(() => sourceType)
|
|
1733
|
-
}
|
|
1923
|
+
}
|
|
1924
|
+
];
|
|
1734
1925
|
if (storeType) {
|
|
1735
1926
|
providers.push(storeType);
|
|
1736
1927
|
}
|
|
@@ -1746,16 +1937,18 @@ class DbxFirebaseCollectionChangeDirective extends AbstractSubscriptionDirective
|
|
|
1746
1937
|
this.dbxFirebaseCollectionStoreDirective = dbxFirebaseCollectionStoreDirective;
|
|
1747
1938
|
this._mode = new BehaviorSubject('manual');
|
|
1748
1939
|
this.mode$ = this._mode.pipe(distinctUntilChanged());
|
|
1749
|
-
this.event$ = this.dbxFirebaseCollectionStoreDirective.store.queryChangeWatcher$.pipe(switchMap((x) => x.event$.pipe(filter(x => x.type !== 'none'), // do not share 'none' events.
|
|
1940
|
+
this.event$ = this.dbxFirebaseCollectionStoreDirective.store.queryChangeWatcher$.pipe(switchMap((x) => x.event$.pipe(filter((x) => x.type !== 'none'), // do not share 'none' events.
|
|
1750
1941
|
take(1), // only need one event to mark as change is available.
|
|
1751
1942
|
startWith({
|
|
1752
1943
|
time: new Date(),
|
|
1753
1944
|
type: 'none'
|
|
1754
1945
|
}))), shareReplay(1));
|
|
1755
|
-
this.hasChangeAvailable$ = this.event$.pipe(map(x => x.type !== 'none'), shareReplay(1));
|
|
1946
|
+
this.hasChangeAvailable$ = this.event$.pipe(map((x) => x.type !== 'none'), shareReplay(1));
|
|
1756
1947
|
}
|
|
1757
1948
|
ngOnInit() {
|
|
1758
|
-
this.sub = combineLatest([this.mode$, this.hasChangeAvailable$])
|
|
1949
|
+
this.sub = combineLatest([this.mode$, this.hasChangeAvailable$])
|
|
1950
|
+
.pipe(filter(([mode, hasChange]) => mode === 'auto' && hasChange))
|
|
1951
|
+
.subscribe(() => {
|
|
1759
1952
|
this.restart();
|
|
1760
1953
|
});
|
|
1761
1954
|
}
|
|
@@ -1891,10 +2084,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
|
|
|
1891
2084
|
type: Input
|
|
1892
2085
|
}] } });
|
|
1893
2086
|
function provideDbxFirebaseDocumentStoreDirective(sourceType, storeType) {
|
|
1894
|
-
const providers = [
|
|
2087
|
+
const providers = [
|
|
2088
|
+
{
|
|
1895
2089
|
provide: DbxFirebaseDocumentStoreDirective,
|
|
1896
2090
|
useExisting: forwardRef(() => sourceType)
|
|
1897
|
-
}
|
|
2091
|
+
}
|
|
2092
|
+
];
|
|
1898
2093
|
if (storeType) {
|
|
1899
2094
|
providers.push(storeType);
|
|
1900
2095
|
}
|
|
@@ -1974,34 +2169,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
|
|
|
1974
2169
|
class DbxFirebaseModelStoreModule {
|
|
1975
2170
|
}
|
|
1976
2171
|
DbxFirebaseModelStoreModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseModelStoreModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1977
|
-
DbxFirebaseModelStoreModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseModelStoreModule, declarations: [DbxFirebaseCollectionListDirective,
|
|
1978
|
-
DbxFirebaseCollectionChangeDirective,
|
|
1979
|
-
DbxFirebaseCollectionHasChangeDirective,
|
|
1980
|
-
DbxFirebaseDocumentStoreRouteIdDirective,
|
|
1981
|
-
DbxFirebaseDocumentAuthIdDirective], exports: [DbxFirebaseCollectionListDirective,
|
|
1982
|
-
DbxFirebaseCollectionChangeDirective,
|
|
1983
|
-
DbxFirebaseCollectionHasChangeDirective,
|
|
1984
|
-
DbxFirebaseDocumentStoreRouteIdDirective,
|
|
1985
|
-
DbxFirebaseDocumentAuthIdDirective] });
|
|
2172
|
+
DbxFirebaseModelStoreModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseModelStoreModule, declarations: [DbxFirebaseCollectionListDirective, DbxFirebaseCollectionChangeDirective, DbxFirebaseCollectionHasChangeDirective, DbxFirebaseDocumentStoreRouteIdDirective, DbxFirebaseDocumentAuthIdDirective], exports: [DbxFirebaseCollectionListDirective, DbxFirebaseCollectionChangeDirective, DbxFirebaseCollectionHasChangeDirective, DbxFirebaseDocumentStoreRouteIdDirective, DbxFirebaseDocumentAuthIdDirective] });
|
|
1986
2173
|
DbxFirebaseModelStoreModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseModelStoreModule, imports: [[]] });
|
|
1987
2174
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseModelStoreModule, decorators: [{
|
|
1988
2175
|
type: NgModule,
|
|
1989
2176
|
args: [{
|
|
1990
2177
|
imports: [],
|
|
1991
|
-
declarations: [
|
|
1992
|
-
|
|
1993
|
-
DbxFirebaseCollectionChangeDirective,
|
|
1994
|
-
DbxFirebaseCollectionHasChangeDirective,
|
|
1995
|
-
DbxFirebaseDocumentStoreRouteIdDirective,
|
|
1996
|
-
DbxFirebaseDocumentAuthIdDirective
|
|
1997
|
-
],
|
|
1998
|
-
exports: [
|
|
1999
|
-
DbxFirebaseCollectionListDirective,
|
|
2000
|
-
DbxFirebaseCollectionChangeDirective,
|
|
2001
|
-
DbxFirebaseCollectionHasChangeDirective,
|
|
2002
|
-
DbxFirebaseDocumentStoreRouteIdDirective,
|
|
2003
|
-
DbxFirebaseDocumentAuthIdDirective
|
|
2004
|
-
]
|
|
2178
|
+
declarations: [DbxFirebaseCollectionListDirective, DbxFirebaseCollectionChangeDirective, DbxFirebaseCollectionHasChangeDirective, DbxFirebaseDocumentStoreRouteIdDirective, DbxFirebaseDocumentAuthIdDirective],
|
|
2179
|
+
exports: [DbxFirebaseCollectionListDirective, DbxFirebaseCollectionChangeDirective, DbxFirebaseCollectionHasChangeDirective, DbxFirebaseDocumentStoreRouteIdDirective, DbxFirebaseDocumentAuthIdDirective]
|
|
2005
2180
|
}]
|
|
2006
2181
|
}] });
|
|
2007
2182
|
|
|
@@ -2013,10 +2188,10 @@ class AbstractDbxFirebaseCollectionStore extends LockSetComponentStore {
|
|
|
2013
2188
|
super(...arguments);
|
|
2014
2189
|
// MARK: Effects
|
|
2015
2190
|
this.setMaxPages = this.effect((input) => {
|
|
2016
|
-
return input.pipe(switchMap((maxPages) => this.loader$.pipe(tap((x) => x.maxPages = maxPages))));
|
|
2191
|
+
return input.pipe(switchMap((maxPages) => this.loader$.pipe(tap((x) => (x.maxPages = maxPages)))));
|
|
2017
2192
|
});
|
|
2018
2193
|
this.setItemsPerPage = this.effect((input) => {
|
|
2019
|
-
return input.pipe(switchMap((itemsPerPage) => this.loader$.pipe(tap((x) => x.itemsPerPage = itemsPerPage))));
|
|
2194
|
+
return input.pipe(switchMap((itemsPerPage) => this.loader$.pipe(tap((x) => (x.itemsPerPage = itemsPerPage)))));
|
|
2020
2195
|
});
|
|
2021
2196
|
this.setConstraints = this.effect((input) => {
|
|
2022
2197
|
return input.pipe(switchMap((constraints) => this.loader$.pipe(tap((x) => x.setConstraints(constraints)))));
|
|
@@ -2030,16 +2205,16 @@ class AbstractDbxFirebaseCollectionStore extends LockSetComponentStore {
|
|
|
2030
2205
|
// MARK: Accessors
|
|
2031
2206
|
this.currentFirestoreCollection$ = this.state$.pipe(map((x) => x.firestoreCollection), distinctUntilChanged(), shareReplay(1));
|
|
2032
2207
|
this.firestoreCollection$ = this.currentFirestoreCollection$.pipe(filterMaybe());
|
|
2033
|
-
this.loader$ = this.currentFirestoreCollection$.pipe(switchMap((collection) => this.state$.pipe(first(), map(x => dbxFirebaseCollectionLoaderInstance({
|
|
2208
|
+
this.loader$ = this.currentFirestoreCollection$.pipe(switchMap((collection) => this.state$.pipe(first(), map((x) => dbxFirebaseCollectionLoaderInstance({
|
|
2034
2209
|
collection,
|
|
2035
2210
|
maxPages: x.maxPages,
|
|
2036
2211
|
itemsPerPage: x.itemsPerPage,
|
|
2037
2212
|
constraints: x.constraints
|
|
2038
2213
|
})))), cleanupDestroyable(), distinctUntilChanged(), shareReplay(1));
|
|
2039
|
-
this.firestoreIteration$ = this.loader$.pipe(switchMap(x => x.firestoreIteration$));
|
|
2040
|
-
this.queryChangeWatcher$ = this.loader$.pipe(switchMap(x => x.queryChangeWatcher$));
|
|
2041
|
-
this.accumulator$ = this.loader$.pipe(switchMap(x => x.accumulator$));
|
|
2042
|
-
this.pageLoadingState$ = this.loader$.pipe(switchMap(x => x.pageLoadingState$));
|
|
2214
|
+
this.firestoreIteration$ = this.loader$.pipe(switchMap((x) => x.firestoreIteration$));
|
|
2215
|
+
this.queryChangeWatcher$ = this.loader$.pipe(switchMap((x) => x.queryChangeWatcher$));
|
|
2216
|
+
this.accumulator$ = this.loader$.pipe(switchMap((x) => x.accumulator$));
|
|
2217
|
+
this.pageLoadingState$ = this.loader$.pipe(switchMap((x) => x.pageLoadingState$));
|
|
2043
2218
|
this.setFirestoreCollection = this.updater((state, firestoreCollection) => ({ ...state, firestoreCollection }));
|
|
2044
2219
|
}
|
|
2045
2220
|
}
|
|
@@ -2064,9 +2239,9 @@ class AbstractDbxFirebaseDocumentStore extends LockSetComponentStore {
|
|
|
2064
2239
|
// MARK: Accessors
|
|
2065
2240
|
this.currentFirestoreCollection$ = this.state$.pipe(map((x) => x.firestoreCollection), distinctUntilChanged(), shareReplay(1));
|
|
2066
2241
|
this.firestoreCollection$ = this.currentFirestoreCollection$.pipe(filterMaybe());
|
|
2067
|
-
this.currentInputId$ = this.state$.pipe(map(x => x.id), distinctUntilChanged(), shareReplay(1));
|
|
2242
|
+
this.currentInputId$ = this.state$.pipe(map((x) => x.id), distinctUntilChanged(), shareReplay(1));
|
|
2068
2243
|
this.inputId$ = this.currentInputId$.pipe(filterMaybe(), distinctUntilChanged(), shareReplay(1));
|
|
2069
|
-
this.currentInputRef$ = this.state$.pipe(map(x => x.ref), distinctUntilChanged(), shareReplay(1));
|
|
2244
|
+
this.currentInputRef$ = this.state$.pipe(map((x) => x.ref), distinctUntilChanged(), shareReplay(1));
|
|
2070
2245
|
this.inputRef$ = this.currentInputRef$.pipe(filterMaybe(), distinctUntilChanged(), shareReplay(1));
|
|
2071
2246
|
this.currentDocument$ = combineLatest([this.currentFirestoreCollection$, this.currentInputId$, this.currentInputRef$]).pipe(map(([collection, id, ref]) => {
|
|
2072
2247
|
let document;
|
|
@@ -2081,12 +2256,12 @@ class AbstractDbxFirebaseDocumentStore extends LockSetComponentStore {
|
|
|
2081
2256
|
return document;
|
|
2082
2257
|
}), distinctUntilChanged(), shareReplay(1));
|
|
2083
2258
|
this.document$ = this.currentDocument$.pipe(filterMaybe(), distinctUntilChanged(), shareReplay(1));
|
|
2084
|
-
this.documentLoadingState$ = this.currentDocument$.pipe(map(x => (x
|
|
2085
|
-
this.id$ = this.document$.pipe(map(x => x.id), shareReplay());
|
|
2086
|
-
this.ref$ = this.document$.pipe(map(x => x.documentRef), shareReplay());
|
|
2087
|
-
this.snapshot$ = this.document$.pipe(switchMap(x => x.accessor.stream()), shareReplay(1));
|
|
2259
|
+
this.documentLoadingState$ = this.currentDocument$.pipe(map((x) => (x ? successResult(x) : beginLoading())), shareReplay(1));
|
|
2260
|
+
this.id$ = this.document$.pipe(map((x) => x.id), shareReplay());
|
|
2261
|
+
this.ref$ = this.document$.pipe(map((x) => x.documentRef), shareReplay());
|
|
2262
|
+
this.snapshot$ = this.document$.pipe(switchMap((x) => x.accessor.stream()), shareReplay(1));
|
|
2088
2263
|
this.snapshotLoadingState$ = this.currentDocument$.pipe(switchMap(() => loadingStateFromObs(this.snapshot$)), shareReplay(1));
|
|
2089
|
-
this.currentData$ = this.document$.pipe(switchMap(x => x.accessor.stream().pipe(map(y => documentDataWithId(y)))), shareReplay(1));
|
|
2264
|
+
this.currentData$ = this.document$.pipe(switchMap((x) => x.accessor.stream().pipe(map((y) => documentDataWithId(y)))), shareReplay(1));
|
|
2090
2265
|
this.data$ = this.currentDocument$.pipe(switchMap(() => this.currentData$.pipe(filterMaybe())), shareReplay(1));
|
|
2091
2266
|
this.dataLoadingState$ = this.snapshotLoadingState$.pipe(map((x) => {
|
|
2092
2267
|
let result;
|
|
@@ -2107,17 +2282,17 @@ class AbstractDbxFirebaseDocumentStore extends LockSetComponentStore {
|
|
|
2107
2282
|
}
|
|
2108
2283
|
return result;
|
|
2109
2284
|
}), shareReplay(1));
|
|
2110
|
-
this.exists$ = this.currentData$.pipe(map(x => isMaybeSo(x)), shareReplay(1));
|
|
2111
|
-
this.doesNotExist$ = this.exists$.pipe(map(x => !x), shareReplay(1));
|
|
2285
|
+
this.exists$ = this.currentData$.pipe(map((x) => isMaybeSo(x)), shareReplay(1));
|
|
2286
|
+
this.doesNotExist$ = this.exists$.pipe(map((x) => !x), shareReplay(1));
|
|
2112
2287
|
// MARK: State Changes
|
|
2113
2288
|
/**
|
|
2114
2289
|
* Sets the id of the document to load.
|
|
2115
2290
|
*/
|
|
2116
|
-
this.setId = this.updater((state, id) => (id
|
|
2291
|
+
this.setId = this.updater((state, id) => (id ? { ...state, id, ref: undefined } : { ...state, id }));
|
|
2117
2292
|
/**
|
|
2118
2293
|
* Sets the ref of the document to load.
|
|
2119
2294
|
*/
|
|
2120
|
-
this.setRef = this.updater((state, ref) => (ref
|
|
2295
|
+
this.setRef = this.updater((state, ref) => (ref ? { ...state, id: undefined, ref } : { ...state, ref }));
|
|
2121
2296
|
this.setFirestoreCollection = this.updater((state, firestoreCollection) => ({ ...state, firestoreCollection }));
|
|
2122
2297
|
}
|
|
2123
2298
|
}
|
|
@@ -2132,7 +2307,7 @@ function setParentStoreEffect(store) {
|
|
|
2132
2307
|
return input.pipe(map((parentStore) => {
|
|
2133
2308
|
let result;
|
|
2134
2309
|
if (parentStore) {
|
|
2135
|
-
result = store.
|
|
2310
|
+
result = store._setParent(parentStore.currentDocument$);
|
|
2136
2311
|
}
|
|
2137
2312
|
else {
|
|
2138
2313
|
result = undefined;
|
|
@@ -2147,56 +2322,79 @@ function setParentStoreEffect(store) {
|
|
|
2147
2322
|
}));
|
|
2148
2323
|
});
|
|
2149
2324
|
}
|
|
2150
|
-
function setParentEffect(store) {
|
|
2151
|
-
return store.effect((input) => {
|
|
2152
|
-
return input.pipe(switchMap((parent) => {
|
|
2153
|
-
store._setParentDocument(parent);
|
|
2154
|
-
if (parent) {
|
|
2155
|
-
return store.collectionFactory$.pipe(tap((collectionFactory) => {
|
|
2156
|
-
const collection = collectionFactory(parent);
|
|
2157
|
-
store.setFirestoreCollection(collection);
|
|
2158
|
-
}));
|
|
2159
|
-
}
|
|
2160
|
-
else {
|
|
2161
|
-
// clear the current collection
|
|
2162
|
-
store.setFirestoreCollection(undefined);
|
|
2163
|
-
// do nothing until a parent is returned.
|
|
2164
|
-
return NEVER;
|
|
2165
|
-
}
|
|
2166
|
-
}));
|
|
2167
|
-
});
|
|
2168
|
-
}
|
|
2169
2325
|
|
|
2170
2326
|
/**
|
|
2171
2327
|
* Abstract DbxFirebaseCollectionStore that has a parent document from which is derives it's FiresbaseCollection from.
|
|
2172
2328
|
*/
|
|
2173
2329
|
class AbstractDbxFirebaseCollectionWithParentStore extends AbstractDbxFirebaseCollectionStore {
|
|
2174
|
-
constructor() {
|
|
2175
|
-
super(
|
|
2330
|
+
constructor(state, defaultSourceMode) {
|
|
2331
|
+
super(state);
|
|
2176
2332
|
// MARK: Effects
|
|
2177
|
-
this.setParent = setParentEffect(this);
|
|
2178
2333
|
this.setParentStore = setParentStoreEffect(this);
|
|
2334
|
+
this.setSourceMode = this.effect((input) => {
|
|
2335
|
+
return input.pipe(distinctUntilChanged(), switchMap((inputMode) => {
|
|
2336
|
+
const mode = inputMode?.toLowerCase() ?? 'parent'; // default to parent mode
|
|
2337
|
+
if (mode === 'group') {
|
|
2338
|
+
return this.currentCollectionGroup$.pipe(tap((collectionGroup) => {
|
|
2339
|
+
this.setFirestoreCollection(collectionGroup);
|
|
2340
|
+
}));
|
|
2341
|
+
}
|
|
2342
|
+
else {
|
|
2343
|
+
// parent document collection
|
|
2344
|
+
return this.currentParent$.pipe(switchMap((parent) => {
|
|
2345
|
+
if (parent) {
|
|
2346
|
+
return this.collectionFactory$.pipe(tap((collectionFactory) => {
|
|
2347
|
+
const collection = collectionFactory(parent);
|
|
2348
|
+
this.setFirestoreCollection(collection);
|
|
2349
|
+
}));
|
|
2350
|
+
}
|
|
2351
|
+
else {
|
|
2352
|
+
this.setFirestoreCollection(undefined);
|
|
2353
|
+
return NEVER;
|
|
2354
|
+
}
|
|
2355
|
+
}));
|
|
2356
|
+
}
|
|
2357
|
+
}));
|
|
2358
|
+
});
|
|
2179
2359
|
// MARK: Accessors
|
|
2180
|
-
this.currentParent$ = this.state$.pipe(map(x => x.parent), distinctUntilChanged(), shareReplay(1));
|
|
2360
|
+
this.currentParent$ = this.state$.pipe(map((x) => x.parent), distinctUntilChanged(), shareReplay(1));
|
|
2181
2361
|
this.parent$ = this.currentParent$.pipe(filterMaybe());
|
|
2182
|
-
this.currentCollectionFactory$ = this.state$.pipe(map(x => x.collectionFactory), distinctUntilChanged(), shareReplay(1));
|
|
2362
|
+
this.currentCollectionFactory$ = this.state$.pipe(map((x) => x.collectionFactory), distinctUntilChanged(), shareReplay(1));
|
|
2183
2363
|
this.collectionFactory$ = this.currentCollectionFactory$.pipe(filterMaybe());
|
|
2364
|
+
this.currentCollectionGroup$ = this.state$.pipe(map((x) => x.collectionGroup), distinctUntilChanged(), shareReplay(1));
|
|
2365
|
+
this.collectionGroup$ = this.currentCollectionGroup$.pipe(filterMaybe());
|
|
2184
2366
|
// MARK: State Changes
|
|
2185
2367
|
/**
|
|
2186
2368
|
* Sets the collection factory function to use.
|
|
2187
2369
|
*/
|
|
2188
2370
|
this.setCollectionFactory = this.updater((state, collectionFactory) => ({ ...state, collectionFactory }));
|
|
2371
|
+
/**
|
|
2372
|
+
* Sets the collection group to use.
|
|
2373
|
+
*/
|
|
2374
|
+
this.setCollectionGroup = this.updater((state, collectionGroup) => ({ ...state, collectionGroup }));
|
|
2189
2375
|
/**
|
|
2190
2376
|
* Sets the parent on the current state.
|
|
2191
2377
|
*/
|
|
2192
2378
|
this._setParentDocument = this.updater((state, parent) => ({ ...state, parent }));
|
|
2379
|
+
this._setParent = this._setParentDocument;
|
|
2380
|
+
this.setSourceMode(defaultSourceMode || 'parent');
|
|
2193
2381
|
}
|
|
2194
2382
|
}
|
|
2195
|
-
AbstractDbxFirebaseCollectionWithParentStore.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: AbstractDbxFirebaseCollectionWithParentStore, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|
|
2383
|
+
AbstractDbxFirebaseCollectionWithParentStore.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: AbstractDbxFirebaseCollectionWithParentStore, deps: [{ token: null, optional: true }, { token: null, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2196
2384
|
AbstractDbxFirebaseCollectionWithParentStore.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: AbstractDbxFirebaseCollectionWithParentStore });
|
|
2197
2385
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: AbstractDbxFirebaseCollectionWithParentStore, decorators: [{
|
|
2198
2386
|
type: Injectable
|
|
2199
|
-
}]
|
|
2387
|
+
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
2388
|
+
type: Inject,
|
|
2389
|
+
args: [null]
|
|
2390
|
+
}, {
|
|
2391
|
+
type: Optional
|
|
2392
|
+
}] }, { type: undefined, decorators: [{
|
|
2393
|
+
type: Inject,
|
|
2394
|
+
args: [null]
|
|
2395
|
+
}, {
|
|
2396
|
+
type: Optional
|
|
2397
|
+
}] }]; } });
|
|
2200
2398
|
|
|
2201
2399
|
/**
|
|
2202
2400
|
* Abstract DbxFirebaseDocumentStore that has a parent document from which is derives it's FiresbaseCollection from.
|
|
@@ -2205,12 +2403,29 @@ class AbstractDbxFirebaseDocumentWithParentStore extends AbstractDbxFirebaseDocu
|
|
|
2205
2403
|
constructor() {
|
|
2206
2404
|
super(...arguments);
|
|
2207
2405
|
// MARK: Effects
|
|
2208
|
-
this.setParent = setParentEffect(this);
|
|
2209
2406
|
this.setParentStore = setParentStoreEffect(this);
|
|
2407
|
+
this.setParent = this.effect((input) => {
|
|
2408
|
+
return input.pipe(switchMap((parent) => {
|
|
2409
|
+
this._setParentDocument(parent);
|
|
2410
|
+
if (parent) {
|
|
2411
|
+
return this.collectionFactory$.pipe(tap((collectionFactory) => {
|
|
2412
|
+
const collection = collectionFactory(parent);
|
|
2413
|
+
this.setFirestoreCollection(collection);
|
|
2414
|
+
}));
|
|
2415
|
+
}
|
|
2416
|
+
else {
|
|
2417
|
+
// clear the current collection
|
|
2418
|
+
this.setFirestoreCollection(undefined);
|
|
2419
|
+
// do nothing until a parent is returned.
|
|
2420
|
+
return NEVER;
|
|
2421
|
+
}
|
|
2422
|
+
}));
|
|
2423
|
+
});
|
|
2424
|
+
this._setParent = this.setParent;
|
|
2210
2425
|
// MARK: Accessors
|
|
2211
|
-
this.currentParent$ = this.state$.pipe(map(x => x.parent), distinctUntilChanged(), shareReplay(1));
|
|
2426
|
+
this.currentParent$ = this.state$.pipe(map((x) => x.parent), distinctUntilChanged(), shareReplay(1));
|
|
2212
2427
|
this.parent$ = this.currentParent$.pipe(filterMaybe());
|
|
2213
|
-
this.currentCollectionFactory$ = this.state$.pipe(map(x => x.collectionFactory), distinctUntilChanged(), shareReplay(1));
|
|
2428
|
+
this.currentCollectionFactory$ = this.state$.pipe(map((x) => x.collectionFactory), distinctUntilChanged(), shareReplay(1));
|
|
2214
2429
|
this.collectionFactory$ = this.currentCollectionFactory$.pipe(filterMaybe());
|
|
2215
2430
|
// MARK: State Changes
|
|
2216
2431
|
/**
|
|
@@ -2229,6 +2444,33 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
|
|
|
2229
2444
|
type: Injectable
|
|
2230
2445
|
}] });
|
|
2231
2446
|
|
|
2447
|
+
/**
|
|
2448
|
+
* Abstract directive that contains a DbxFirebaseCollectionWithParentStore and provides an interface for communicating with other directives.
|
|
2449
|
+
*/
|
|
2450
|
+
class DbxFirebaseCollectionWithParentStoreDirective extends DbxFirebaseCollectionStoreDirective {
|
|
2451
|
+
// MARK: Inputs
|
|
2452
|
+
set sourceMode(sourceMode) {
|
|
2453
|
+
this.store.setSourceMode(sourceMode);
|
|
2454
|
+
}
|
|
2455
|
+
}
|
|
2456
|
+
DbxFirebaseCollectionWithParentStoreDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseCollectionWithParentStoreDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
2457
|
+
DbxFirebaseCollectionWithParentStoreDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: DbxFirebaseCollectionWithParentStoreDirective, inputs: { sourceMode: "sourceMode" }, usesInheritance: true, ngImport: i0 });
|
|
2458
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseCollectionWithParentStoreDirective, decorators: [{
|
|
2459
|
+
type: Directive
|
|
2460
|
+
}], propDecorators: { sourceMode: [{
|
|
2461
|
+
type: Input
|
|
2462
|
+
}] } });
|
|
2463
|
+
function provideDbxFirebaseCollectionWithParentStoreDirective(sourceType, storeType) {
|
|
2464
|
+
const providers = [
|
|
2465
|
+
...provideDbxFirebaseCollectionStoreDirective(sourceType, storeType),
|
|
2466
|
+
{
|
|
2467
|
+
provide: DbxFirebaseCollectionWithParentStoreDirective,
|
|
2468
|
+
useExisting: forwardRef(() => sourceType)
|
|
2469
|
+
}
|
|
2470
|
+
];
|
|
2471
|
+
return providers;
|
|
2472
|
+
}
|
|
2473
|
+
|
|
2232
2474
|
class DbxFirebaseModelModule {
|
|
2233
2475
|
}
|
|
2234
2476
|
DbxFirebaseModelModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseModelModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
@@ -2237,9 +2479,7 @@ DbxFirebaseModelModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0",
|
|
|
2237
2479
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseModelModule, decorators: [{
|
|
2238
2480
|
type: NgModule,
|
|
2239
2481
|
args: [{
|
|
2240
|
-
exports: [
|
|
2241
|
-
DbxFirebaseModelStoreModule
|
|
2242
|
-
]
|
|
2482
|
+
exports: [DbxFirebaseModelStoreModule]
|
|
2243
2483
|
}]
|
|
2244
2484
|
}] });
|
|
2245
2485
|
|
|
@@ -2251,9 +2491,7 @@ DbxFirebaseModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", versi
|
|
|
2251
2491
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseModule, decorators: [{
|
|
2252
2492
|
type: NgModule,
|
|
2253
2493
|
args: [{
|
|
2254
|
-
exports: [
|
|
2255
|
-
DbxFirebaseModelModule
|
|
2256
|
-
]
|
|
2494
|
+
exports: [DbxFirebaseModelModule]
|
|
2257
2495
|
}]
|
|
2258
2496
|
}] });
|
|
2259
2497
|
|
|
@@ -2261,5 +2499,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
|
|
|
2261
2499
|
* Generated bundle index. Do not edit.
|
|
2262
2500
|
*/
|
|
2263
2501
|
|
|
2264
|
-
export { AbstractConfiguredDbxFirebaseLoginButtonDirective, AbstractDbxFirebaseCollectionStore, AbstractDbxFirebaseCollectionWithParentStore, AbstractDbxFirebaseDocumentStore, AbstractDbxFirebaseDocumentWithParentStore, DBX_FIREBASE_MODEL_DOES_NOT_EXIST_ERROR, DBX_FIREBASE_OPTIONS_TOKEN, DBX_FIREBASE_ROUTER_SYNC_DEFAULT_ID_PARAM_KEY, DBX_FIRESTORE_CONTEXT_TOKEN, DEFAULT_CONFIGURED_DBX_FIREBASE_LOGIN_BUTTON_TEMPLATE, DEFAULT_DBX_FIREBASE_AUTH_SERVICE_DELEGATE, DEFAULT_FIREBASE_AUTH_LOGIN_PASSWORD_CONFIG, DEFAULT_FIREBASE_AUTH_LOGIN_PASSWORD_CONFIG_TOKEN, DEFAULT_FIREBASE_AUTH_LOGIN_PROVIDERS_TOKEN, DEFAULT_FIREBASE_AUTH_LOGIN_TERMS_COMPONENT_CLASS_TOKEN, DEFAULT_FIREBASE_LOGIN_METHOD_CATEGORY, DbxFirebaseAuthLoginService, DbxFirebaseAuthModule, DbxFirebaseAuthService, DbxFirebaseAuthServiceDelegate, DbxFirebaseCollectionChangeDirective, DbxFirebaseCollectionHasChangeDirective, DbxFirebaseCollectionListDirective, DbxFirebaseCollectionLoaderInstance, DbxFirebaseCollectionStoreDirective, DbxFirebaseDefaultAuthProviderModule, DbxFirebaseDefaultFirebaseProvidersModule, DbxFirebaseDefaultFirestoreProviderModule, DbxFirebaseDefaultFunctionsProviderModule, DbxFirebaseDefaultStorageProviderModule, DbxFirebaseDocumentAuthIdDirective, DbxFirebaseDocumentStoreDirective, DbxFirebaseDocumentStoreRouteIdDirective, DbxFirebaseEmailFormComponent, DbxFirebaseEmailRecoveryFormComponent, DbxFirebaseEmulatorModule, DbxFirebaseFirestoreCollectionModule, DbxFirebaseFunctionsModule, DbxFirebaseLoginAnonymousComponent, DbxFirebaseLoginAppleComponent, DbxFirebaseLoginButtonComponent, DbxFirebaseLoginButtonContainerComponent, DbxFirebaseLoginComponent, DbxFirebaseLoginContext, DbxFirebaseLoginContextBackButtonComponent, DbxFirebaseLoginContextDirective, DbxFirebaseLoginEmailComponent, DbxFirebaseLoginEmailContentComponent, DbxFirebaseLoginFacebookComponent, DbxFirebaseLoginGitHubComponent, DbxFirebaseLoginGoogleComponent, DbxFirebaseLoginListComponent, DbxFirebaseLoginMicrosoftComponent, DbxFirebaseLoginModule, DbxFirebaseLoginModuleRootConfig, DbxFirebaseLoginTermsComponent, DbxFirebaseLoginTermsSimpleComponent, DbxFirebaseLoginTwitterComponent, DbxFirebaseModelModule, DbxFirebaseModelStoreModule, DbxFirebaseModule, DbxFirebaseParsedEmulatorsConfig, DbxFirebaseRegisterComponent, DbxFirebaseRegisterEmailComponent, DbxFirestoreContextService, FIREBASE_AUTH_NETWORK_REQUEST_ERROR, FIREBASE_AUTH_USER_NOT_FOUND_ERROR, OAUTH_FIREBASE_LOGIN_METHOD_CATEGORY, authUserInfoFromAuthUser, authUserStateFromFirebaseAuthService, dbxFirebaseCollectionLoaderInstance, dbxFirebaseCollectionLoaderInstanceWithCollection, defaultFirebaseAuthLoginProvidersFactory, firebaseAuthErrorToReadableError, modelDoesNotExistError, provideDbxFirebaseCollectionStoreDirective, provideDbxFirebaseDocumentStoreDirective, readValueFromIdToken,
|
|
2502
|
+
export { AbstractConfiguredDbxFirebaseLoginButtonDirective, AbstractDbxFirebaseCollectionStore, AbstractDbxFirebaseCollectionWithParentStore, AbstractDbxFirebaseDocumentStore, AbstractDbxFirebaseDocumentWithParentStore, DBX_FIREBASE_MODEL_DOES_NOT_EXIST_ERROR, DBX_FIREBASE_OPTIONS_TOKEN, DBX_FIREBASE_ROUTER_SYNC_DEFAULT_ID_PARAM_KEY, DBX_FIRESTORE_CONTEXT_TOKEN, DEFAULT_CONFIGURED_DBX_FIREBASE_LOGIN_BUTTON_TEMPLATE, DEFAULT_DBX_FIREBASE_AUTH_SERVICE_DELEGATE, DEFAULT_FIREBASE_AUTH_LOGIN_PASSWORD_CONFIG, DEFAULT_FIREBASE_AUTH_LOGIN_PASSWORD_CONFIG_TOKEN, DEFAULT_FIREBASE_AUTH_LOGIN_PROVIDERS_TOKEN, DEFAULT_FIREBASE_AUTH_LOGIN_TERMS_COMPONENT_CLASS_TOKEN, DEFAULT_FIREBASE_LOGIN_METHOD_CATEGORY, DbxFirebaseAppCheckHttpInterceptor, DbxFirebaseAuthLoginService, DbxFirebaseAuthModule, DbxFirebaseAuthService, DbxFirebaseAuthServiceDelegate, DbxFirebaseCollectionChangeDirective, DbxFirebaseCollectionHasChangeDirective, DbxFirebaseCollectionListDirective, DbxFirebaseCollectionLoaderInstance, DbxFirebaseCollectionStoreDirective, DbxFirebaseCollectionWithParentStoreDirective, DbxFirebaseDefaultAppCheckProviderModule, DbxFirebaseDefaultAuthProviderModule, DbxFirebaseDefaultFirebaseProvidersModule, DbxFirebaseDefaultFirestoreProviderModule, DbxFirebaseDefaultFunctionsProviderModule, DbxFirebaseDefaultStorageProviderModule, DbxFirebaseDocumentAuthIdDirective, DbxFirebaseDocumentStoreDirective, DbxFirebaseDocumentStoreRouteIdDirective, DbxFirebaseEmailFormComponent, DbxFirebaseEmailRecoveryFormComponent, DbxFirebaseEmulatorModule, DbxFirebaseFirestoreCollectionModule, DbxFirebaseFunctionsModule, DbxFirebaseLoginAnonymousComponent, DbxFirebaseLoginAppleComponent, DbxFirebaseLoginButtonComponent, DbxFirebaseLoginButtonContainerComponent, DbxFirebaseLoginComponent, DbxFirebaseLoginContext, DbxFirebaseLoginContextBackButtonComponent, DbxFirebaseLoginContextDirective, DbxFirebaseLoginEmailComponent, DbxFirebaseLoginEmailContentComponent, DbxFirebaseLoginFacebookComponent, DbxFirebaseLoginGitHubComponent, DbxFirebaseLoginGoogleComponent, DbxFirebaseLoginListComponent, DbxFirebaseLoginMicrosoftComponent, DbxFirebaseLoginModule, DbxFirebaseLoginModuleRootConfig, DbxFirebaseLoginTermsComponent, DbxFirebaseLoginTermsSimpleComponent, DbxFirebaseLoginTwitterComponent, DbxFirebaseModelModule, DbxFirebaseModelStoreModule, DbxFirebaseModule, DbxFirebaseParsedEmulatorsConfig, DbxFirebaseRegisterComponent, DbxFirebaseRegisterEmailComponent, DbxFirestoreContextService, FIREBASE_AUTH_NETWORK_REQUEST_ERROR, FIREBASE_AUTH_USER_NOT_FOUND_ERROR, OAUTH_FIREBASE_LOGIN_METHOD_CATEGORY, authUserInfoFromAuthUser, authUserStateFromFirebaseAuthService, dbxFirebaseCollectionLoaderInstance, dbxFirebaseCollectionLoaderInstanceWithCollection, defaultFirebaseAuthLoginProvidersFactory, enableAppCheckDebugTokenGeneration, firebaseAuthErrorToReadableError, modelDoesNotExistError, provideDbxFirebaseCollectionStoreDirective, provideDbxFirebaseCollectionWithParentStoreDirective, provideDbxFirebaseDocumentStoreDirective, readValueFromIdToken, setParentStoreEffect };
|
|
2265
2503
|
//# sourceMappingURL=dereekb-dbx-firebase.mjs.map
|