@dereekb/dbx-firebase 13.11.2 → 13.11.4
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/fesm2022/dereekb-dbx-firebase-oidc.mjs +370 -135
- package/fesm2022/dereekb-dbx-firebase-oidc.mjs.map +1 -1
- package/fesm2022/dereekb-dbx-firebase.mjs +65 -1
- package/fesm2022/dereekb-dbx-firebase.mjs.map +1 -1
- package/package.json +11 -11
- package/types/dereekb-dbx-firebase-oidc.d.ts +220 -137
- package/types/dereekb-dbx-firebase.d.ts +63 -1
|
@@ -140,6 +140,7 @@ function firebaseAuthTokenFromUser(user) {
|
|
|
140
140
|
*
|
|
141
141
|
* @param stateForLoggedInUser Optional function that returns an observable for the user's state if they are logged in and not an anonymous user.
|
|
142
142
|
* @returns
|
|
143
|
+
* @__NO_SIDE_EFFECTS__
|
|
143
144
|
*/
|
|
144
145
|
function authUserStateFromFirebaseAuthServiceFunction(stateForLoggedInUser = () => of('user')) {
|
|
145
146
|
return (dbxFirebaseAuthService) => {
|
|
@@ -161,6 +162,7 @@ function authUserStateFromFirebaseAuthServiceFunction(stateForLoggedInUser = ()
|
|
|
161
162
|
* @param stateFromToken - Function that maps an IdTokenResult to an AuthUserState.
|
|
162
163
|
* @param defaultState - The fallback state when no token is available. Defaults to 'user'.
|
|
163
164
|
* @returns An AuthUserStateObsFunction that reads state from the ID token.
|
|
165
|
+
* @__NO_SIDE_EFFECTS__
|
|
164
166
|
*/
|
|
165
167
|
function stateFromTokenForLoggedInUserFunction(stateFromToken, defaultState = 'user') {
|
|
166
168
|
return (dbxFirebaseAuthService) => {
|
|
@@ -558,6 +560,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.11", ngImpo
|
|
|
558
560
|
* Creates a EnvironmentProviders that provides a DbxFirebaseAnalyticsUserEventsListenerService and initialize it when the app is initialized.
|
|
559
561
|
*
|
|
560
562
|
* @returns EnvironmentProviders
|
|
563
|
+
* @__NO_SIDE_EFFECTS__
|
|
561
564
|
*/
|
|
562
565
|
function provideDbxFirebaseAnalyticsUserEventsListenerService() {
|
|
563
566
|
const providers = [
|
|
@@ -1488,6 +1491,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.11", ngImpo
|
|
|
1488
1491
|
* Factory function for creating the default Firebase auth login providers.
|
|
1489
1492
|
*
|
|
1490
1493
|
* @returns Array of DbxFirebaseAuthLoginProvider
|
|
1494
|
+
* @__NO_SIDE_EFFECTS__
|
|
1491
1495
|
*/
|
|
1492
1496
|
function defaultFirebaseAuthLoginProvidersFactory() {
|
|
1493
1497
|
// Brand logos from @firebase-oss/ui-core via jsdelivr CDN.
|
|
@@ -2048,6 +2052,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.11", ngImpo
|
|
|
2048
2052
|
*
|
|
2049
2053
|
* @param config - Configuration specifying the claims service and optional auth user state inclusion.
|
|
2050
2054
|
* @returns A function that, given a DbxFirebaseAuthService, returns an Observable of the decoded AuthRoleSet.
|
|
2055
|
+
* @__NO_SIDE_EFFECTS__
|
|
2051
2056
|
*/
|
|
2052
2057
|
function authRolesObsWithClaimsService(config) {
|
|
2053
2058
|
const { addAuthUserStateToRoles: addAuthUserState, claimsService } = config;
|
|
@@ -2066,6 +2071,7 @@ function authRolesObsWithClaimsService(config) {
|
|
|
2066
2071
|
*
|
|
2067
2072
|
* @param config - Configuration with the claims service and optional auth state customization.
|
|
2068
2073
|
* @returns A DbxFirebaseAuthServiceDelegate configured for claims-based auth.
|
|
2074
|
+
* @__NO_SIDE_EFFECTS__
|
|
2069
2075
|
*/
|
|
2070
2076
|
function defaultDbxFirebaseAuthServiceDelegateWithClaimsService(config) {
|
|
2071
2077
|
if (filterMaybeArrayValues([config.stateForLoggedInUser, config.stateForLoggedInUserToken, config.authUserStateObs]).length > 1) {
|
|
@@ -2788,6 +2794,7 @@ function parseDbxFirebaseEmulatorsConfig(config) {
|
|
|
2788
2794
|
* ```ts
|
|
2789
2795
|
* const appCheck = createDbxFirebaseAppCheck({ app, options });
|
|
2790
2796
|
* ```
|
|
2797
|
+
* @__NO_SIDE_EFFECTS__
|
|
2791
2798
|
*/
|
|
2792
2799
|
function createDbxFirebaseAppCheck(params) {
|
|
2793
2800
|
const { app, options } = params;
|
|
@@ -2819,6 +2826,7 @@ function createDbxFirebaseAppCheck(params) {
|
|
|
2819
2826
|
* ```ts
|
|
2820
2827
|
* const firestore = createDbxFirebaseFirestore({ app, options, emulators });
|
|
2821
2828
|
* ```
|
|
2829
|
+
* @__NO_SIDE_EFFECTS__
|
|
2822
2830
|
*/
|
|
2823
2831
|
function createDbxFirebaseFirestore(params) {
|
|
2824
2832
|
const { app, options, emulators } = params;
|
|
@@ -2847,6 +2855,7 @@ function createDbxFirebaseFirestore(params) {
|
|
|
2847
2855
|
* ```ts
|
|
2848
2856
|
* const auth = createDbxFirebaseAuth({ app, emulators });
|
|
2849
2857
|
* ```
|
|
2858
|
+
* @__NO_SIDE_EFFECTS__
|
|
2850
2859
|
*/
|
|
2851
2860
|
function createDbxFirebaseAuth(params) {
|
|
2852
2861
|
const { app, emulators } = params;
|
|
@@ -2866,6 +2875,7 @@ function createDbxFirebaseAuth(params) {
|
|
|
2866
2875
|
* ```ts
|
|
2867
2876
|
* const storage = createDbxFirebaseStorage({ app, emulators });
|
|
2868
2877
|
* ```
|
|
2878
|
+
* @__NO_SIDE_EFFECTS__
|
|
2869
2879
|
*/
|
|
2870
2880
|
function createDbxFirebaseStorage(params) {
|
|
2871
2881
|
const { app, emulators } = params;
|
|
@@ -2885,6 +2895,7 @@ function createDbxFirebaseStorage(params) {
|
|
|
2885
2895
|
* ```ts
|
|
2886
2896
|
* const functions = createDbxFirebaseFunctions({ app, options, emulators });
|
|
2887
2897
|
* ```
|
|
2898
|
+
* @__NO_SIDE_EFFECTS__
|
|
2888
2899
|
*/
|
|
2889
2900
|
function createDbxFirebaseFunctions(params) {
|
|
2890
2901
|
const { app, options, emulators } = params;
|
|
@@ -3005,6 +3016,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.11", ngImpo
|
|
|
3005
3016
|
*
|
|
3006
3017
|
* @param config Configuration for provideDbxFirebaseFunctions().
|
|
3007
3018
|
* @returns EnvironmentProviders for the LazyFirebaseFunctions type.
|
|
3019
|
+
* @__NO_SIDE_EFFECTS__
|
|
3008
3020
|
*/
|
|
3009
3021
|
function provideDbxFirebaseFunctions(config) {
|
|
3010
3022
|
const providers = [
|
|
@@ -3504,6 +3516,7 @@ function dbxFirebaseDocumentLoaderInstanceWithAccessor(accessor) {
|
|
|
3504
3516
|
*
|
|
3505
3517
|
* @param context$ - Observable of the in-context Firebase models service.
|
|
3506
3518
|
* @returns A factory function for creating model service instances by type and key.
|
|
3519
|
+
* @__NO_SIDE_EFFECTS__
|
|
3507
3520
|
*/
|
|
3508
3521
|
function dbxFirebaseInContextFirebaseModelServiceInstanceFactory(context$) {
|
|
3509
3522
|
return (type, keyObs) => {
|
|
@@ -3589,6 +3602,7 @@ class DbxFirebaseModelContextService {
|
|
|
3589
3602
|
*
|
|
3590
3603
|
* @param config - Configuration providing the model service factory and entity map observable.
|
|
3591
3604
|
* @returns A factory function that creates model info instances from observable model keys.
|
|
3605
|
+
* @__NO_SIDE_EFFECTS__
|
|
3592
3606
|
*/
|
|
3593
3607
|
function dbxFirebaseModelContextServiceInfoInstanceFactory(config) {
|
|
3594
3608
|
const { modelService, entityMap$ } = config;
|
|
@@ -3625,6 +3639,7 @@ function firebaseContextServiceEntityMap() {
|
|
|
3625
3639
|
*
|
|
3626
3640
|
* @param config Configuration
|
|
3627
3641
|
* @returns EnvironmentProviders
|
|
3642
|
+
* @__NO_SIDE_EFFECTS__
|
|
3628
3643
|
*/
|
|
3629
3644
|
function provideDbxFirebaseModelContextService(config) {
|
|
3630
3645
|
const { dbxFirebaseModelContextServiceClass, dbxFirebaseModelContextServiceFactory } = config;
|
|
@@ -3722,6 +3737,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.11", ngImpo
|
|
|
3722
3737
|
*
|
|
3723
3738
|
* @param service - The model types service used to resolve type info and instances.
|
|
3724
3739
|
* @returns A factory that accepts model keys and returns an Observable of instance pairs with display info and segue refs.
|
|
3740
|
+
* @__NO_SIDE_EFFECTS__
|
|
3725
3741
|
*/
|
|
3726
3742
|
function dbxFirebaseModelTypesServiceInstancePairForKeysFactory(service) {
|
|
3727
3743
|
return (keys) => {
|
|
@@ -4102,6 +4118,7 @@ const DBX_FIREBASE_MODEL_ENTITY_WITH_STORE_TOKEN = new InjectionToken('DbxFireba
|
|
|
4102
4118
|
*
|
|
4103
4119
|
* @param injector Optional injector to use for the components.
|
|
4104
4120
|
* @returns
|
|
4121
|
+
* @__NO_SIDE_EFFECTS__
|
|
4105
4122
|
*/
|
|
4106
4123
|
function dbxFirebaseModelEntityWidgetInjectionConfigFactory(injector) {
|
|
4107
4124
|
return (entry, entity) => {
|
|
@@ -4417,6 +4434,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.11", ngImpo
|
|
|
4417
4434
|
*
|
|
4418
4435
|
* @param config Configuration
|
|
4419
4436
|
* @returns EnvironmentProviders
|
|
4437
|
+
* @__NO_SIDE_EFFECTS__
|
|
4420
4438
|
*/
|
|
4421
4439
|
function provideDbxFirebaseModelEntitiesWidgetService(config) {
|
|
4422
4440
|
const { dbxFirebaseModelEntitiesWidgetServiceConfigFactory } = config;
|
|
@@ -4874,7 +4892,42 @@ function provideDbxFirebaseCollectionStoreDirective(sourceType, storeType) {
|
|
|
4874
4892
|
}
|
|
4875
4893
|
|
|
4876
4894
|
/**
|
|
4877
|
-
*
|
|
4895
|
+
* Watches a sibling {@link DbxFirebaseCollectionStoreDirective}'s query inputs
|
|
4896
|
+
* (constraints, collection mode, refs, etc.) and, when set to `'auto'`, calls
|
|
4897
|
+
* `store.restart()` so the collection re-runs and pulls fresh results.
|
|
4898
|
+
*
|
|
4899
|
+
* Use this directive when a `DbxFirebaseCollectionStoreDirective` subclass has
|
|
4900
|
+
* query inputs that change at runtime — by default the store does not react to
|
|
4901
|
+
* those changes, so this directive bridges the gap by composing
|
|
4902
|
+
* {@link dbxFirebaseCollectionChangeWatcher} with
|
|
4903
|
+
* {@link dbxFirebaseCollectionChangeTriggerForWatcher}.
|
|
4904
|
+
*
|
|
4905
|
+
* Modes (`DbxFirebaseCollectionChangeWatcherTriggerMode`):
|
|
4906
|
+
* - `'auto'` — automatically `restart()` the store when the query changes.
|
|
4907
|
+
* - `'off'` (default) — observe only; consumers may read `triggered$` / `event$` themselves.
|
|
4908
|
+
*
|
|
4909
|
+
* @dbxWebComponent
|
|
4910
|
+
* @dbxWebSlug firebase-collection-change
|
|
4911
|
+
* @dbxWebCategory action
|
|
4912
|
+
* @dbxWebKind directive
|
|
4913
|
+
* @dbxWebRelated firebase-collection-store
|
|
4914
|
+
* @dbxWebInputName dbxFirebaseCollectionChange
|
|
4915
|
+
* @dbxWebInputType DbxFirebaseCollectionChangeWatcherTriggerMode
|
|
4916
|
+
* @dbxWebInputRequired false
|
|
4917
|
+
* @dbxWebMinimalExample ```html
|
|
4918
|
+
* <my-items-list dbxFirebaseItemCollection [dbxFirebaseCollectionChange]="'auto'"></my-items-list>
|
|
4919
|
+
* ```
|
|
4920
|
+
*
|
|
4921
|
+
* @example
|
|
4922
|
+
* ```html
|
|
4923
|
+
* <!-- dbxFirebaseItemCollection extends DbxFirebaseCollectionStoreDirective; -->
|
|
4924
|
+
* <!-- when [constraints] changes, the store restarts and reloads. -->
|
|
4925
|
+
* <my-items-list
|
|
4926
|
+
* dbxFirebaseItemCollection
|
|
4927
|
+
* [constraints]="currentConstraints()"
|
|
4928
|
+
* [dbxFirebaseCollectionChange]="'auto'">
|
|
4929
|
+
* </my-items-list>
|
|
4930
|
+
* ```
|
|
4878
4931
|
*/
|
|
4879
4932
|
class DbxFirebaseCollectionChangeDirective {
|
|
4880
4933
|
dbxFirebaseCollectionStoreDirective = inject((DbxFirebaseCollectionStoreDirective));
|
|
@@ -5119,6 +5172,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.11", ngImpo
|
|
|
5119
5172
|
* @param store
|
|
5120
5173
|
* @param fn
|
|
5121
5174
|
* @returns
|
|
5175
|
+
* @__NO_SIDE_EFFECTS__
|
|
5122
5176
|
*/
|
|
5123
5177
|
function firebaseCollectionStoreCreateFunction(store, fn) {
|
|
5124
5178
|
return (params) => loadingStateFromObs(lazyFrom(() => fn(params).then((result) => {
|
|
@@ -5133,6 +5187,7 @@ function firebaseCollectionStoreCreateFunction(store, fn) {
|
|
|
5133
5187
|
*
|
|
5134
5188
|
* @param fn
|
|
5135
5189
|
* @returns
|
|
5190
|
+
* @__NO_SIDE_EFFECTS__
|
|
5136
5191
|
*/
|
|
5137
5192
|
function firebaseCollectionStoreCrudFunction(fn) {
|
|
5138
5193
|
return (params) => loadingStateFromObs(from(fn(params)).pipe(shareReplay(1)));
|
|
@@ -5373,6 +5428,7 @@ AbstractRootSingleItemDbxFirebaseDocument = __decorate([
|
|
|
5373
5428
|
* @param fn - The Firebase create function to wrap.
|
|
5374
5429
|
* @param config - Optional config with an `onResult` callback.
|
|
5375
5430
|
* @returns A function that executes the create and sets the resulting key on the store.
|
|
5431
|
+
* @__NO_SIDE_EFFECTS__
|
|
5376
5432
|
*/
|
|
5377
5433
|
function firebaseDocumentStoreCreateFunction(store, fn, config) {
|
|
5378
5434
|
return (params) => loadingStateFromObs(lazyFrom(() => fn(params).then((result) => {
|
|
@@ -5390,6 +5446,7 @@ function firebaseDocumentStoreCreateFunction(store, fn, config) {
|
|
|
5390
5446
|
*
|
|
5391
5447
|
* @param fn
|
|
5392
5448
|
* @returns
|
|
5449
|
+
* @__NO_SIDE_EFFECTS__
|
|
5393
5450
|
*/
|
|
5394
5451
|
function firebaseDocumentStoreCrudFunction(fn) {
|
|
5395
5452
|
return (params) => loadingStateFromObs(from(fn(params)).pipe(shareReplay(1)));
|
|
@@ -5405,6 +5462,7 @@ function firebaseDocumentStoreCrudFunction(fn) {
|
|
|
5405
5462
|
* @param store
|
|
5406
5463
|
* @param fn
|
|
5407
5464
|
* @returns
|
|
5465
|
+
* @__NO_SIDE_EFFECTS__
|
|
5408
5466
|
*/
|
|
5409
5467
|
function firebaseDocumentStoreReadFunction(store, fn) {
|
|
5410
5468
|
return firebaseDocumentStoreUpdateFunction(store, fn);
|
|
@@ -5419,6 +5477,7 @@ function firebaseDocumentStoreReadFunction(store, fn) {
|
|
|
5419
5477
|
* @param fn - The Firebase update function to wrap.
|
|
5420
5478
|
* @param config - Optional config with an `onResult` callback.
|
|
5421
5479
|
* @returns A function that executes the update with the store's key injected.
|
|
5480
|
+
* @__NO_SIDE_EFFECTS__
|
|
5422
5481
|
*/
|
|
5423
5482
|
function firebaseDocumentStoreUpdateFunction(store, fn, config) {
|
|
5424
5483
|
return (params) => loadingStateFromObs(store.key$.pipe(first(), exhaustMap((key) => fn({
|
|
@@ -5438,6 +5497,7 @@ function firebaseDocumentStoreUpdateFunction(store, fn, config) {
|
|
|
5438
5497
|
* @param store
|
|
5439
5498
|
* @param fn
|
|
5440
5499
|
* @returns
|
|
5500
|
+
* @__NO_SIDE_EFFECTS__
|
|
5441
5501
|
*/
|
|
5442
5502
|
function firebaseDocumentStoreDeleteFunction(store, fn) {
|
|
5443
5503
|
return (params) => loadingStateFromObs(store.key$.pipe(first(), exhaustMap((key) => fn({
|
|
@@ -7695,6 +7755,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.11", ngImpo
|
|
|
7695
7755
|
*
|
|
7696
7756
|
* @param storageAccessorFactory - The factory used to create prefixed storage accessors.
|
|
7697
7757
|
* @returns A StorageAccessor scoped to the storage file download cache.
|
|
7758
|
+
* @__NO_SIDE_EFFECTS__
|
|
7698
7759
|
*/
|
|
7699
7760
|
function defaultDbxFirebaseStorageFileDownloadStorageAccessorFactory(storageAccessorFactory) {
|
|
7700
7761
|
return storageAccessorFactory.createStorageAccessor({
|
|
@@ -7705,6 +7766,7 @@ function defaultDbxFirebaseStorageFileDownloadStorageAccessorFactory(storageAcce
|
|
|
7705
7766
|
* Creates EnvironmentProviders for the storage file download service and its dependencies.
|
|
7706
7767
|
*
|
|
7707
7768
|
* @returns EnvironmentProviders that register the storage file download storage accessor, storage, and service.
|
|
7769
|
+
* @__NO_SIDE_EFFECTS__
|
|
7708
7770
|
*/
|
|
7709
7771
|
function provideDbxFirebaseStorageFileService() {
|
|
7710
7772
|
const providers = [
|
|
@@ -7880,6 +7942,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.11", ngImpo
|
|
|
7880
7942
|
*
|
|
7881
7943
|
* @param base Optional base configuration to use.
|
|
7882
7944
|
* @returns Factory function for the DbxFirebaseStorageContext.
|
|
7945
|
+
* @__NO_SIDE_EFFECTS__
|
|
7883
7946
|
*/
|
|
7884
7947
|
function dbxFirebaseStorageProvidersContextConfigFactory(base) {
|
|
7885
7948
|
return (app) => {
|
|
@@ -7930,6 +7993,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.11", ngImpo
|
|
|
7930
7993
|
*
|
|
7931
7994
|
* @param config Configuration
|
|
7932
7995
|
* @returns EnvironmentProviders
|
|
7996
|
+
* @__NO_SIDE_EFFECTS__
|
|
7933
7997
|
*/
|
|
7934
7998
|
function provideDbxFirebaseModelTypesService(config) {
|
|
7935
7999
|
const { dbxFirebaseModelTypesServiceConfigFactory } = config;
|