ngx-firebase 1.1.12 → 22.0.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/README.md +51 -11
- package/fesm2022/ngx-firebase.mjs +158 -0
- package/fesm2022/ngx-firebase.mjs.map +1 -0
- package/package.json +40 -30
- package/types/ngx-firebase.d.ts +55 -0
- package/bundles/ngx-firebase-capacitor.umd.js +0 -763
- package/bundles/ngx-firebase-capacitor.umd.js.map +0 -1
- package/bundles/ngx-firebase-capacitor.umd.min.js +0 -16
- package/bundles/ngx-firebase-capacitor.umd.min.js.map +0 -1
- package/bundles/ngx-firebase-iap.umd.js +0 -718
- package/bundles/ngx-firebase-iap.umd.js.map +0 -1
- package/bundles/ngx-firebase-iap.umd.min.js +0 -2
- package/bundles/ngx-firebase-iap.umd.min.js.map +0 -1
- package/bundles/ngx-firebase-ionic-auth-ui.umd.js +0 -2116
- package/bundles/ngx-firebase-ionic-auth-ui.umd.js.map +0 -1
- package/bundles/ngx-firebase-ionic-auth-ui.umd.min.js +0 -16
- package/bundles/ngx-firebase-ionic-auth-ui.umd.min.js.map +0 -1
- package/bundles/ngx-firebase-ionic.umd.js +0 -979
- package/bundles/ngx-firebase-ionic.umd.js.map +0 -1
- package/bundles/ngx-firebase-ionic.umd.min.js +0 -16
- package/bundles/ngx-firebase-ionic.umd.min.js.map +0 -1
- package/bundles/ngx-firebase-testing.umd.js +0 -801
- package/bundles/ngx-firebase-testing.umd.js.map +0 -1
- package/bundles/ngx-firebase-testing.umd.min.js +0 -2
- package/bundles/ngx-firebase-testing.umd.min.js.map +0 -1
- package/bundles/ngx-firebase.umd.js +0 -2271
- package/bundles/ngx-firebase.umd.js.map +0 -1
- package/bundles/ngx-firebase.umd.min.js +0 -2
- package/bundles/ngx-firebase.umd.min.js.map +0 -1
- package/capacitor/capacitor.module.d.ts +0 -9
- package/capacitor/interfaces/config.d.ts +0 -12
- package/capacitor/interfaces/index.d.ts +0 -1
- package/capacitor/ngx-firebase-capacitor.d.ts +0 -5
- package/capacitor/ngx-firebase-capacitor.metadata.json +0 -1
- package/capacitor/package.json +0 -25
- package/capacitor/public-api.d.ts +0 -3
- package/capacitor/services/analytics-firebase-capacitor.service.d.ts +0 -9
- package/capacitor/services/crashlytics-firebase-capacitor.service.d.ts +0 -8
- package/capacitor/services/credential-factory-capacitor.service.d.ts +0 -18
- package/capacitor/services/index.d.ts +0 -3
- package/esm2015/capacitor/capacitor.module.js +0 -78
- package/esm2015/capacitor/interfaces/config.js +0 -3
- package/esm2015/capacitor/interfaces/index.js +0 -2
- package/esm2015/capacitor/ngx-firebase-capacitor.js +0 -6
- package/esm2015/capacitor/public-api.js +0 -4
- package/esm2015/capacitor/services/analytics-firebase-capacitor.service.js +0 -43
- package/esm2015/capacitor/services/crashlytics-firebase-capacitor.service.js +0 -40
- package/esm2015/capacitor/services/credential-factory-capacitor.service.js +0 -182
- package/esm2015/capacitor/services/index.js +0 -4
- package/esm2015/iap/iap.module.js +0 -32
- package/esm2015/iap/interfaces/index.js +0 -5
- package/esm2015/iap/ngx-firebase-iap.js +0 -5
- package/esm2015/iap/public-api.js +0 -5
- package/esm2015/iap/services/iap.service.js +0 -317
- package/esm2015/iap/tokens/index.js +0 -4
- package/esm2015/ionic/animations/index.js +0 -30
- package/esm2015/ionic/components/avatar/avatar.component.js +0 -98
- package/esm2015/ionic/components/avatar/index.js +0 -2
- package/esm2015/ionic/components/index.js +0 -3
- package/esm2015/ionic/components/popover-menu/index.js +0 -3
- package/esm2015/ionic/components/popover-menu/interface.js +0 -2
- package/esm2015/ionic/components/popover-menu/popover-menu.component.js +0 -34
- package/esm2015/ionic/ionic.module.js +0 -46
- package/esm2015/ionic/ngx-firebase-ionic.js +0 -5
- package/esm2015/ionic/public-api.js +0 -5
- package/esm2015/ionic/services/alerts-ionic.service.js +0 -107
- package/esm2015/ionic/services/index.js +0 -6
- package/esm2015/ionic/services/legality-dialog-ionic.service.js +0 -85
- package/esm2015/ionic/services/loading-ionic.service.js +0 -46
- package/esm2015/ionic/services/picker-ionic.service.js +0 -44
- package/esm2015/ionic/services/toast-ionic.service.js +0 -49
- package/esm2015/ionic-auth-ui/animations/index.js +0 -30
- package/esm2015/ionic-auth-ui/components/email-confirmation/email-confirmation.component.js +0 -99
- package/esm2015/ionic-auth-ui/components/email-field/email-field.component.js +0 -25
- package/esm2015/ionic-auth-ui/components/form-field/form-field.component.js +0 -82
- package/esm2015/ionic-auth-ui/components/index.js +0 -12
- package/esm2015/ionic-auth-ui/components/name-field/name-field.component.js +0 -30
- package/esm2015/ionic-auth-ui/components/or-divider/or-divider.component.js +0 -11
- package/esm2015/ionic-auth-ui/components/password-field/password-field.component.js +0 -138
- package/esm2015/ionic-auth-ui/components/password-field/passwordValidatorFunctions.js +0 -62
- package/esm2015/ionic-auth-ui/components/providers/providers.component.js +0 -70
- package/esm2015/ionic-auth-ui/components/reauthenticate/reauthenticate.component.js +0 -99
- package/esm2015/ionic-auth-ui/components/register/register.component.js +0 -142
- package/esm2015/ionic-auth-ui/components/register-with-email/register-with-email.component.js +0 -60
- package/esm2015/ionic-auth-ui/components/register-with-email-popover/register-with-email-popover.component.js +0 -26
- package/esm2015/ionic-auth-ui/components/signin/signin.component.js +0 -92
- package/esm2015/ionic-auth-ui/components/terms-field/terms-field.component.js +0 -99
- package/esm2015/ionic-auth-ui/components/user/user.component.js +0 -195
- package/esm2015/ionic-auth-ui/ionic-auth-ui.module.js +0 -92
- package/esm2015/ionic-auth-ui/ngx-firebase-ionic-auth-ui.js +0 -23
- package/esm2015/ionic-auth-ui/pages/index.js +0 -5
- package/esm2015/ionic-auth-ui/pages/register/index.js +0 -2
- package/esm2015/ionic-auth-ui/pages/register/register.page.js +0 -56
- package/esm2015/ionic-auth-ui/pages/signin/index.js +0 -2
- package/esm2015/ionic-auth-ui/pages/signin/signin.page.js +0 -78
- package/esm2015/ionic-auth-ui/pages/user/index.js +0 -2
- package/esm2015/ionic-auth-ui/pages/user/user.page.js +0 -11
- package/esm2015/ionic-auth-ui/pages/verifyemail/index.js +0 -2
- package/esm2015/ionic-auth-ui/pages/verifyemail/verifyemail.page.js +0 -85
- package/esm2015/ionic-auth-ui/public-api.js +0 -5
- package/esm2015/ngx-firebase.js +0 -6
- package/esm2015/public-api.js +0 -6
- package/esm2015/shared/guards/index.js +0 -3
- package/esm2015/shared/guards/logged-in.guard.js +0 -60
- package/esm2015/shared/guards/verify-email.guard.js +0 -41
- package/esm2015/shared/interfaces/accounts.enum.js +0 -9
- package/esm2015/shared/interfaces/authprovider.enum.js +0 -15
- package/esm2015/shared/interfaces/config.interface.js +0 -61
- package/esm2015/shared/interfaces/index.js +0 -8
- package/esm2015/shared/interfaces/main.interface.js +0 -7
- package/esm2015/shared/interfaces/providers.interface.js +0 -2
- package/esm2015/shared/interfaces/tokens.js +0 -19
- package/esm2015/shared/interfaces/ui-providers.interface.js +0 -2
- package/esm2015/shared/services/analytics.service.js +0 -24
- package/esm2015/shared/services/auth-process.service.js +0 -752
- package/esm2015/shared/services/crashlytics.service.js +0 -42
- package/esm2015/shared/services/device-info.service.js +0 -14
- package/esm2015/shared/services/firebase.service.js +0 -37
- package/esm2015/shared/services/firestore-sync.service.js +0 -60
- package/esm2015/shared/services/index.js +0 -10
- package/esm2015/shared/services/performance.service.js +0 -28
- package/esm2015/shared/services/remoteconfig.service.js +0 -49
- package/esm2015/shared/services/ui.service.js +0 -45
- package/esm2015/shared/shared.module.js +0 -175
- package/esm2015/shared/types/DisplayWidth.js +0 -9
- package/esm2015/shared/types/Location.js +0 -2
- package/esm2015/shared/types/ValueAccessorControlComponent.js +0 -85
- package/esm2015/shared/types/ValueAccessorValueComponent.js +0 -40
- package/esm2015/shared/types/index.js +0 -5
- package/esm2015/testing/fakeavatar.module.js +0 -22
- package/esm2015/testing/fakes/FakeAuthProcessService.js +0 -31
- package/esm2015/testing/fakes/FakeAvatarComponent.js +0 -13
- package/esm2015/testing/fakes/FakeFireService.js +0 -21
- package/esm2015/testing/fakes/FakeFirestoreSyncService.js +0 -11
- package/esm2015/testing/fakes/FakeIAPurchaseService.js +0 -11
- package/esm2015/testing/fakes/FakePickerService.js +0 -9
- package/esm2015/testing/fakes/FakeRemoteConfigService.js +0 -44
- package/esm2015/testing/fakes/FakeTranslateService.js +0 -21
- package/esm2015/testing/fakes/FakeUiService.js +0 -26
- package/esm2015/testing/fakes/angular-fire/FakeAngularFireAuth.js +0 -30
- package/esm2015/testing/fakes/angular-fire/FakeAngularFireFunctions.js +0 -17
- package/esm2015/testing/fakes/angular-fire/FakeAngularFirePerformance.js +0 -17
- package/esm2015/testing/fakes/angular-fire/FakeAngularFireStorage.js +0 -8
- package/esm2015/testing/fakes/angular-fire/FakeAngularFirestore.js +0 -8
- package/esm2015/testing/fakes/angular-fire/FakeUserCredential.js +0 -18
- package/esm2015/testing/fakes/index.js +0 -19
- package/esm2015/testing/ngx-firebase-testing.js +0 -6
- package/esm2015/testing/public-api.js +0 -5
- package/esm2015/testing/test.module.js +0 -66
- package/esm2015/testing/utils/index.js +0 -17
- package/esm2015/testing/utils/patchConsole.js +0 -14
- package/fesm2015/ngx-firebase-capacitor.js +0 -328
- package/fesm2015/ngx-firebase-capacitor.js.map +0 -1
- package/fesm2015/ngx-firebase-iap.js +0 -354
- package/fesm2015/ngx-firebase-iap.js.map +0 -1
- package/fesm2015/ngx-firebase-ionic-auth-ui.js +0 -1482
- package/fesm2015/ngx-firebase-ionic-auth-ui.js.map +0 -1
- package/fesm2015/ngx-firebase-ionic.js +0 -495
- package/fesm2015/ngx-firebase-ionic.js.map +0 -1
- package/fesm2015/ngx-firebase-testing.js +0 -388
- package/fesm2015/ngx-firebase-testing.js.map +0 -1
- package/fesm2015/ngx-firebase.js +0 -1482
- package/fesm2015/ngx-firebase.js.map +0 -1
- package/iap/iap.module.d.ts +0 -5
- package/iap/interfaces/index.d.ts +0 -11
- package/iap/ngx-firebase-iap.d.ts +0 -4
- package/iap/ngx-firebase-iap.metadata.json +0 -1
- package/iap/package.json +0 -23
- package/iap/public-api.d.ts +0 -4
- package/iap/services/iap.service.d.ts +0 -47
- package/iap/tokens/index.d.ts +0 -3
- package/ionic/animations/index.d.ts +0 -1
- package/ionic/components/avatar/avatar.component.d.ts +0 -27
- package/ionic/components/avatar/index.d.ts +0 -1
- package/ionic/components/index.d.ts +0 -2
- package/ionic/components/popover-menu/index.d.ts +0 -2
- package/ionic/components/popover-menu/interface.d.ts +0 -6
- package/ionic/components/popover-menu/popover-menu.component.d.ts +0 -10
- package/ionic/ionic.module.d.ts +0 -2
- package/ionic/ngx-firebase-ionic.d.ts +0 -4
- package/ionic/ngx-firebase-ionic.metadata.json +0 -1
- package/ionic/package.json +0 -30
- package/ionic/public-api.d.ts +0 -4
- package/ionic/services/alerts-ionic.service.d.ts +0 -13
- package/ionic/services/index.d.ts +0 -5
- package/ionic/services/legality-dialog-ionic.service.d.ts +0 -10
- package/ionic/services/loading-ionic.service.d.ts +0 -17
- package/ionic/services/picker-ionic.service.d.ts +0 -9
- package/ionic/services/toast-ionic.service.d.ts +0 -11
- package/ionic-auth-ui/animations/index.d.ts +0 -1
- package/ionic-auth-ui/components/email-confirmation/email-confirmation.component.d.ts +0 -31
- package/ionic-auth-ui/components/email-field/email-field.component.d.ts +0 -7
- package/ionic-auth-ui/components/form-field/form-field.component.d.ts +0 -28
- package/ionic-auth-ui/components/index.d.ts +0 -11
- package/ionic-auth-ui/components/name-field/name-field.component.d.ts +0 -8
- package/ionic-auth-ui/components/or-divider/or-divider.component.d.ts +0 -2
- package/ionic-auth-ui/components/password-field/password-field.component.d.ts +0 -34
- package/ionic-auth-ui/components/password-field/passwordValidatorFunctions.d.ts +0 -4
- package/ionic-auth-ui/components/providers/providers.component.d.ts +0 -26
- package/ionic-auth-ui/components/reauthenticate/reauthenticate.component.d.ts +0 -30
- package/ionic-auth-ui/components/register/register.component.d.ts +0 -26
- package/ionic-auth-ui/components/register-with-email/register-with-email.component.d.ts +0 -24
- package/ionic-auth-ui/components/register-with-email-popover/register-with-email-popover.component.d.ts +0 -7
- package/ionic-auth-ui/components/signin/signin.component.d.ts +0 -28
- package/ionic-auth-ui/components/terms-field/terms-field.component.d.ts +0 -27
- package/ionic-auth-ui/components/user/user.component.d.ts +0 -45
- package/ionic-auth-ui/ionic-auth-ui.module.d.ts +0 -32
- package/ionic-auth-ui/ngx-firebase-ionic-auth-ui.d.ts +0 -22
- package/ionic-auth-ui/ngx-firebase-ionic-auth-ui.metadata.json +0 -1
- package/ionic-auth-ui/package.json +0 -30
- package/ionic-auth-ui/pages/index.d.ts +0 -4
- package/ionic-auth-ui/pages/register/index.d.ts +0 -1
- package/ionic-auth-ui/pages/register/register.page.d.ts +0 -16
- package/ionic-auth-ui/pages/signin/index.d.ts +0 -1
- package/ionic-auth-ui/pages/signin/signin.page.d.ts +0 -22
- package/ionic-auth-ui/pages/user/index.d.ts +0 -1
- package/ionic-auth-ui/pages/user/user.page.d.ts +0 -3
- package/ionic-auth-ui/pages/verifyemail/index.d.ts +0 -1
- package/ionic-auth-ui/pages/verifyemail/verifyemail.page.d.ts +0 -19
- package/ionic-auth-ui/public-api.d.ts +0 -4
- package/ngx-firebase.d.ts +0 -5
- package/ngx-firebase.metadata.json +0 -1
- package/public-api.d.ts +0 -5
- package/shared/guards/index.d.ts +0 -2
- package/shared/guards/logged-in.guard.d.ts +0 -13
- package/shared/guards/verify-email.guard.d.ts +0 -11
- package/shared/interfaces/accounts.enum.d.ts +0 -7
- package/shared/interfaces/authprovider.enum.d.ts +0 -13
- package/shared/interfaces/config.interface.d.ts +0 -63
- package/shared/interfaces/index.d.ts +0 -7
- package/shared/interfaces/main.interface.d.ts +0 -13
- package/shared/interfaces/providers.interface.d.ts +0 -63
- package/shared/interfaces/tokens.d.ts +0 -16
- package/shared/interfaces/ui-providers.interface.d.ts +0 -65
- package/shared/services/analytics.service.d.ts +0 -10
- package/shared/services/auth-process.service.d.ts +0 -172
- package/shared/services/crashlytics.service.d.ts +0 -11
- package/shared/services/device-info.service.d.ts +0 -3
- package/shared/services/firebase.service.d.ts +0 -16
- package/shared/services/firestore-sync.service.d.ts +0 -16
- package/shared/services/index.d.ts +0 -9
- package/shared/services/performance.service.d.ts +0 -12
- package/shared/services/remoteconfig.service.d.ts +0 -18
- package/shared/services/ui.service.d.ts +0 -22
- package/shared/shared.module.d.ts +0 -14
- package/shared/types/DisplayWidth.d.ts +0 -7
- package/shared/types/Location.d.ts +0 -8
- package/shared/types/ValueAccessorControlComponent.d.ts +0 -27
- package/shared/types/ValueAccessorValueComponent.d.ts +0 -19
- package/shared/types/index.d.ts +0 -4
- package/testing/fakeavatar.module.d.ts +0 -2
- package/testing/fakes/FakeAuthProcessService.d.ts +0 -28
- package/testing/fakes/FakeAvatarComponent.d.ts +0 -3
- package/testing/fakes/FakeFireService.d.ts +0 -20
- package/testing/fakes/FakeFirestoreSyncService.d.ts +0 -9
- package/testing/fakes/FakeIAPurchaseService.d.ts +0 -9
- package/testing/fakes/FakePickerService.d.ts +0 -6
- package/testing/fakes/FakeRemoteConfigService.d.ts +0 -19
- package/testing/fakes/FakeTranslateService.d.ts +0 -15
- package/testing/fakes/FakeUiService.d.ts +0 -25
- package/testing/fakes/angular-fire/FakeAngularFireAuth.d.ts +0 -52
- package/testing/fakes/angular-fire/FakeAngularFireFunctions.d.ts +0 -11
- package/testing/fakes/angular-fire/FakeAngularFirePerformance.d.ts +0 -10
- package/testing/fakes/angular-fire/FakeAngularFireStorage.d.ts +0 -5
- package/testing/fakes/angular-fire/FakeAngularFirestore.d.ts +0 -5
- package/testing/fakes/angular-fire/FakeUserCredential.d.ts +0 -9
- package/testing/fakes/index.d.ts +0 -16
- package/testing/ngx-firebase-testing.d.ts +0 -5
- package/testing/ngx-firebase-testing.metadata.json +0 -1
- package/testing/package.json +0 -29
- package/testing/public-api.d.ts +0 -4
- package/testing/test.module.d.ts +0 -4
- package/testing/utils/index.d.ts +0 -5
- package/testing/utils/patchConsole.d.ts +0 -4
package/README.md
CHANGED
|
@@ -1,24 +1,64 @@
|
|
|
1
|
-
#
|
|
1
|
+
# NgxFirebase
|
|
2
2
|
|
|
3
|
-
This
|
|
3
|
+
This project was generated using [Angular CLI](https://github.com/angular/angular-cli) version 22.0.0.
|
|
4
4
|
|
|
5
5
|
## Code scaffolding
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
> Note: Don't forget to add `--project mal` or else it will be added to the default project in your `angular.json` file.
|
|
7
|
+
Angular CLI includes powerful code scaffolding tools. To generate a new component, run:
|
|
9
8
|
|
|
10
|
-
|
|
9
|
+
```bash
|
|
10
|
+
ng generate component component-name
|
|
11
|
+
```
|
|
11
12
|
|
|
12
|
-
|
|
13
|
+
For a complete list of available schematics (such as `components`, `directives`, or `pipes`), run:
|
|
13
14
|
|
|
14
|
-
|
|
15
|
+
```bash
|
|
16
|
+
ng generate --help
|
|
17
|
+
```
|
|
15
18
|
|
|
16
|
-
|
|
19
|
+
## Building
|
|
20
|
+
|
|
21
|
+
To build the library, run:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
ng build ngx-firebase
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
This command will compile your project, and the build artifacts will be placed in the `dist/` directory.
|
|
28
|
+
|
|
29
|
+
### Publishing the Library
|
|
30
|
+
|
|
31
|
+
Once the project is built, you can publish your library by following these steps:
|
|
32
|
+
|
|
33
|
+
1. Navigate to the `dist` directory:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
cd dist/ngx-firebase
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
2. Run the `npm publish` command to publish your library to the npm registry:
|
|
40
|
+
```bash
|
|
41
|
+
npm publish
|
|
42
|
+
```
|
|
17
43
|
|
|
18
44
|
## Running unit tests
|
|
19
45
|
|
|
20
|
-
|
|
46
|
+
To execute unit tests with the [Karma](https://karma-runner.github.io) test runner, use the following command:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
ng test
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Running end-to-end tests
|
|
53
|
+
|
|
54
|
+
For end-to-end (e2e) testing, run:
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
ng e2e
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Angular CLI does not come with an end-to-end testing framework by default. You can choose one that suits your needs.
|
|
21
61
|
|
|
22
|
-
##
|
|
62
|
+
## Additional Resources
|
|
23
63
|
|
|
24
|
-
|
|
64
|
+
For more information on using the Angular CLI, including detailed command references, visit the [Angular CLI Overview and Command Reference](https://angular.dev/tools/cli) page.
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { inject, Injectable } from '@angular/core';
|
|
3
|
+
import { Router, NavigationEnd } from '@angular/router';
|
|
4
|
+
import { onSnapshot, Firestore } from 'firebase/firestore';
|
|
5
|
+
import { onAuthStateChanged } from 'firebase/auth';
|
|
6
|
+
import { logEvent } from 'firebase/analytics';
|
|
7
|
+
import { Observable } from 'rxjs';
|
|
8
|
+
import { filter } from 'rxjs/operators';
|
|
9
|
+
|
|
10
|
+
// --- DI TOKENS ---
|
|
11
|
+
// We export abstract classes with matching names to act as DI Tokens in Angular
|
|
12
|
+
class FirebaseApp {
|
|
13
|
+
}
|
|
14
|
+
class Auth {
|
|
15
|
+
}
|
|
16
|
+
class FirebaseStorage {
|
|
17
|
+
}
|
|
18
|
+
class Functions {
|
|
19
|
+
}
|
|
20
|
+
class Analytics {
|
|
21
|
+
}
|
|
22
|
+
// --- FIREBASE SDK MUTABLE WRAPPER FOR TESTING ---
|
|
23
|
+
const firebaseSdk = {
|
|
24
|
+
onSnapshot,
|
|
25
|
+
onAuthStateChanged,
|
|
26
|
+
};
|
|
27
|
+
// --- RXJS WRAPPERS ---
|
|
28
|
+
/**
|
|
29
|
+
* Wraps onSnapshot for a document reference.
|
|
30
|
+
*/
|
|
31
|
+
function docData(ref) {
|
|
32
|
+
return new Observable((subscriber) => {
|
|
33
|
+
const unsubscribe = firebaseSdk.onSnapshot(ref, (snapshot) => {
|
|
34
|
+
subscriber.next(snapshot.data());
|
|
35
|
+
}, (error) => {
|
|
36
|
+
subscriber.error(error);
|
|
37
|
+
});
|
|
38
|
+
return () => unsubscribe();
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Wraps onSnapshot for a query/collection.
|
|
43
|
+
*/
|
|
44
|
+
function collectionSnapshots(q) {
|
|
45
|
+
return new Observable((subscriber) => {
|
|
46
|
+
const unsubscribe = firebaseSdk.onSnapshot(q, (snapshot) => {
|
|
47
|
+
subscriber.next(snapshot.docs);
|
|
48
|
+
}, (error) => {
|
|
49
|
+
subscriber.error(error);
|
|
50
|
+
});
|
|
51
|
+
return () => unsubscribe();
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Wraps onAuthStateChanged to monitor auth state.
|
|
56
|
+
*/
|
|
57
|
+
function user(auth) {
|
|
58
|
+
return new Observable((subscriber) => {
|
|
59
|
+
const unsubscribe = firebaseSdk.onAuthStateChanged(auth, (user) => {
|
|
60
|
+
subscriber.next(user);
|
|
61
|
+
}, (error) => {
|
|
62
|
+
subscriber.error(error);
|
|
63
|
+
});
|
|
64
|
+
return () => unsubscribe();
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
// --- SCREEN TRACKING SERVICE ---
|
|
68
|
+
/**
|
|
69
|
+
* Custom ScreenTrackingService to replace @angular/fire/analytics ScreenTrackingService.
|
|
70
|
+
* Automatically tracks page views on router navigation events.
|
|
71
|
+
*/
|
|
72
|
+
class ScreenTrackingService {
|
|
73
|
+
analytics = inject(Analytics, { optional: true });
|
|
74
|
+
router = inject(Router, { optional: true });
|
|
75
|
+
constructor() {
|
|
76
|
+
if (this.analytics && this.router) {
|
|
77
|
+
this.router.events
|
|
78
|
+
.pipe(filter((event) => event instanceof NavigationEnd))
|
|
79
|
+
.subscribe((event) => {
|
|
80
|
+
logEvent(this.analytics, 'screen_view', {
|
|
81
|
+
firebase_screen: event.urlAfterRedirects || event.url,
|
|
82
|
+
firebase_screen_class: 'AngularRoute',
|
|
83
|
+
});
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ScreenTrackingService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
88
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ScreenTrackingService, providedIn: 'root' });
|
|
89
|
+
}
|
|
90
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ScreenTrackingService, decorators: [{
|
|
91
|
+
type: Injectable,
|
|
92
|
+
args: [{
|
|
93
|
+
providedIn: 'root',
|
|
94
|
+
}]
|
|
95
|
+
}], ctorParameters: () => [] });
|
|
96
|
+
// --- DI PROVIDERS ---
|
|
97
|
+
function provideFirebaseApp(fn) {
|
|
98
|
+
return {
|
|
99
|
+
provide: FirebaseApp,
|
|
100
|
+
useFactory: fn,
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
function provideFirestore(fn) {
|
|
104
|
+
return {
|
|
105
|
+
provide: Firestore,
|
|
106
|
+
useFactory: () => {
|
|
107
|
+
inject(FirebaseApp); // Force app initialization before building Firestore
|
|
108
|
+
return fn();
|
|
109
|
+
},
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
function provideAuth(fn) {
|
|
113
|
+
return {
|
|
114
|
+
provide: Auth,
|
|
115
|
+
useFactory: () => {
|
|
116
|
+
inject(FirebaseApp); // Force app initialization before building Auth
|
|
117
|
+
return fn();
|
|
118
|
+
},
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
function provideStorage(fn) {
|
|
122
|
+
return {
|
|
123
|
+
provide: FirebaseStorage,
|
|
124
|
+
useFactory: () => {
|
|
125
|
+
inject(FirebaseApp); // Force app initialization before building Storage
|
|
126
|
+
return fn();
|
|
127
|
+
},
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
function provideFunctions(fn) {
|
|
131
|
+
return {
|
|
132
|
+
provide: Functions,
|
|
133
|
+
useFactory: () => {
|
|
134
|
+
inject(FirebaseApp); // Force app initialization before building Functions
|
|
135
|
+
return fn();
|
|
136
|
+
},
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
function provideAnalytics(fn) {
|
|
140
|
+
return {
|
|
141
|
+
provide: Analytics,
|
|
142
|
+
useFactory: () => {
|
|
143
|
+
inject(FirebaseApp); // Force app initialization before building Analytics
|
|
144
|
+
return fn();
|
|
145
|
+
},
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/*
|
|
150
|
+
* Public API Surface of ngx-firebase
|
|
151
|
+
*/
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* Generated bundle index. Do not edit.
|
|
155
|
+
*/
|
|
156
|
+
|
|
157
|
+
export { Analytics, Auth, FirebaseApp, FirebaseStorage, Functions, ScreenTrackingService, collectionSnapshots, docData, firebaseSdk, provideAnalytics, provideAuth, provideFirebaseApp, provideFirestore, provideFunctions, provideStorage, user };
|
|
158
|
+
//# sourceMappingURL=ngx-firebase.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ngx-firebase.mjs","sources":["../../../projects/ngx-firebase/src/lib/firebase-providers.ts","../../../projects/ngx-firebase/src/public-api.ts","../../../projects/ngx-firebase/src/ngx-firebase.ts"],"sourcesContent":["import { inject, Injectable, Provider } from '@angular/core';\nimport { Router, NavigationEnd } from '@angular/router';\nimport { FirebaseApp as NativeFirebaseApp } from 'firebase/app';\nimport { Firestore, DocumentReference, Query, QueryDocumentSnapshot, onSnapshot } from 'firebase/firestore';\nimport { Auth as NativeAuth, User, onAuthStateChanged } from 'firebase/auth';\nimport { FirebaseStorage as NativeFirebaseStorage } from 'firebase/storage';\nimport { Functions as NativeFunctions } from 'firebase/functions';\nimport { Analytics as NativeAnalytics, logEvent } from 'firebase/analytics';\nimport { Observable } from 'rxjs';\nimport { filter } from 'rxjs/operators';\n\n// --- DI TOKENS ---\n// We export abstract classes with matching names to act as DI Tokens in Angular\nexport abstract class FirebaseApp {}\nexport abstract class Auth {}\nexport abstract class FirebaseStorage {}\nexport abstract class Functions {}\nexport abstract class Analytics {}\n\n// --- FIREBASE SDK MUTABLE WRAPPER FOR TESTING ---\nexport const firebaseSdk = {\n onSnapshot,\n onAuthStateChanged,\n};\n\n// --- RXJS WRAPPERS ---\n\n/**\n * Wraps onSnapshot for a document reference.\n */\nexport function docData<T = any>(ref: DocumentReference<T>): Observable<T | undefined> {\n return new Observable<T | undefined>((subscriber) => {\n const unsubscribe = firebaseSdk.onSnapshot(\n ref,\n (snapshot) => {\n subscriber.next(snapshot.data());\n },\n (error) => {\n subscriber.error(error);\n }\n );\n return () => unsubscribe();\n });\n}\n\n/**\n * Wraps onSnapshot for a query/collection.\n */\nexport function collectionSnapshots<T = any>(q: Query<T>): Observable<QueryDocumentSnapshot<T>[]> {\n return new Observable<QueryDocumentSnapshot<T>[]>((subscriber) => {\n const unsubscribe = firebaseSdk.onSnapshot(\n q,\n (snapshot) => {\n subscriber.next(snapshot.docs);\n },\n (error) => {\n subscriber.error(error);\n }\n );\n return () => unsubscribe();\n });\n}\n\n/**\n * Wraps onAuthStateChanged to monitor auth state.\n */\nexport function user(auth: Auth): Observable<User | null> {\n return new Observable<User | null>((subscriber) => {\n const unsubscribe = firebaseSdk.onAuthStateChanged(\n auth as unknown as NativeAuth,\n (user) => {\n subscriber.next(user);\n },\n (error) => {\n subscriber.error(error);\n }\n );\n return () => unsubscribe();\n });\n}\n\n// --- SCREEN TRACKING SERVICE ---\n\n/**\n * Custom ScreenTrackingService to replace @angular/fire/analytics ScreenTrackingService.\n * Automatically tracks page views on router navigation events.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class ScreenTrackingService {\n private analytics = inject(Analytics, { optional: true });\n private router = inject(Router, { optional: true });\n\n constructor() {\n if (this.analytics && this.router) {\n this.router.events\n .pipe(filter((event) => event instanceof NavigationEnd))\n .subscribe((event: any) => {\n logEvent(this.analytics as unknown as NativeAnalytics, 'screen_view', {\n firebase_screen: event.urlAfterRedirects || event.url,\n firebase_screen_class: 'AngularRoute',\n });\n });\n }\n }\n}\n\n// --- DI PROVIDERS ---\n\nexport function provideFirebaseApp(fn: () => NativeFirebaseApp): Provider {\n return {\n provide: FirebaseApp,\n useFactory: fn,\n };\n}\n\nexport function provideFirestore(fn: () => Firestore): Provider {\n return {\n provide: Firestore,\n useFactory: () => {\n inject(FirebaseApp); // Force app initialization before building Firestore\n return fn();\n },\n };\n}\n\nexport function provideAuth(fn: () => NativeAuth): Provider {\n return {\n provide: Auth,\n useFactory: () => {\n inject(FirebaseApp); // Force app initialization before building Auth\n return fn();\n },\n };\n}\n\nexport function provideStorage(fn: () => NativeFirebaseStorage): Provider {\n return {\n provide: FirebaseStorage,\n useFactory: () => {\n inject(FirebaseApp); // Force app initialization before building Storage\n return fn();\n },\n };\n}\n\nexport function provideFunctions(fn: () => NativeFunctions): Provider {\n return {\n provide: Functions,\n useFactory: () => {\n inject(FirebaseApp); // Force app initialization before building Functions\n return fn();\n },\n };\n}\n\nexport function provideAnalytics(fn: () => NativeAnalytics): Provider {\n return {\n provide: Analytics,\n useFactory: () => {\n inject(FirebaseApp); // Force app initialization before building Analytics\n return fn();\n },\n };\n}\n","/*\n * Public API Surface of ngx-firebase\n */\n\nexport * from './lib/firebase-providers';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"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"}
|
package/package.json
CHANGED
|
@@ -1,38 +1,48 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ngx-firebase",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "22.0.0",
|
|
4
|
+
"description": "A lightweight, drop-in, and zoneless-friendly wrapper around the native Firebase JS SDK for Angular 22+.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"angular",
|
|
7
|
+
"firebase",
|
|
8
|
+
"rxjs",
|
|
9
|
+
"zoneless",
|
|
10
|
+
"angular-fire",
|
|
11
|
+
"firestore",
|
|
12
|
+
"firebase-auth",
|
|
13
|
+
"providers"
|
|
14
|
+
],
|
|
15
|
+
"homepage": "https://github.com/quedicesebas/ngx-firebase#readme",
|
|
16
|
+
"bugs": {
|
|
17
|
+
"url": "https://github.com/quedicesebas/ngx-firebase/issues"
|
|
18
|
+
},
|
|
19
|
+
"repository": {
|
|
20
|
+
"type": "git",
|
|
21
|
+
"url": "git+https://github.com/quedicesebas/ngx-firebase.git"
|
|
22
|
+
},
|
|
4
23
|
"license": "MIT",
|
|
24
|
+
"author": "Sebas <quedicesebas>",
|
|
25
|
+
"publishConfig": {
|
|
26
|
+
"access": "public"
|
|
27
|
+
},
|
|
5
28
|
"peerDependencies": {
|
|
6
|
-
"@angular/
|
|
7
|
-
"@angular/
|
|
8
|
-
"@angular/common": "^11.2.5",
|
|
9
|
-
"@angular/core": "^11.2.5",
|
|
10
|
-
"@angular/fire": "^6.1.4",
|
|
11
|
-
"@angular/flex-layout": "^11.0.0-beta.33",
|
|
12
|
-
"@angular/forms": "^11.2.5",
|
|
13
|
-
"@angular/platform-browser": "^11.2.5",
|
|
14
|
-
"@angular/platform-browser-dynamic": "^11.2.5",
|
|
15
|
-
"@angular/router": "^11.2.5",
|
|
16
|
-
"@ionic/angular": "^5.5.0",
|
|
17
|
-
"@ngx-translate/core": "^13.0.0",
|
|
18
|
-
"ionic4-tooltips": "^2.0.2",
|
|
19
|
-
"rxjs": "~6.5.4",
|
|
20
|
-
"zone.js": "^0.11.3",
|
|
21
|
-
"firebase": "^8.2.6"
|
|
29
|
+
"@angular/common": "^22.0.0",
|
|
30
|
+
"@angular/core": "^22.0.0"
|
|
22
31
|
},
|
|
23
32
|
"dependencies": {
|
|
24
|
-
"tslib": "^2.0
|
|
33
|
+
"tslib": "^2.3.0"
|
|
25
34
|
},
|
|
26
|
-
"
|
|
27
|
-
|
|
28
|
-
|
|
35
|
+
"sideEffects": false,
|
|
36
|
+
"module": "fesm2022/ngx-firebase.mjs",
|
|
37
|
+
"typings": "types/ngx-firebase.d.ts",
|
|
38
|
+
"exports": {
|
|
39
|
+
"./package.json": {
|
|
40
|
+
"default": "./package.json"
|
|
41
|
+
},
|
|
42
|
+
".": {
|
|
43
|
+
"types": "./types/ngx-firebase.d.ts",
|
|
44
|
+
"default": "./fesm2022/ngx-firebase.mjs"
|
|
45
|
+
}
|
|
29
46
|
},
|
|
30
|
-
"
|
|
31
|
-
|
|
32
|
-
"es2015": "fesm2015/ngx-firebase.js",
|
|
33
|
-
"esm2015": "esm2015/ngx-firebase.js",
|
|
34
|
-
"fesm2015": "fesm2015/ngx-firebase.js",
|
|
35
|
-
"typings": "ngx-firebase.d.ts",
|
|
36
|
-
"metadata": "ngx-firebase.metadata.json",
|
|
37
|
-
"sideEffects": false
|
|
38
|
-
}
|
|
47
|
+
"type": "module"
|
|
48
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Provider } from '@angular/core';
|
|
3
|
+
import { FirebaseApp as FirebaseApp$1 } from 'firebase/app';
|
|
4
|
+
import { Query, QueryDocumentSnapshot, DocumentReference, onSnapshot, Firestore } from 'firebase/firestore';
|
|
5
|
+
import { onAuthStateChanged, Auth as Auth$1, User } from 'firebase/auth';
|
|
6
|
+
import { FirebaseStorage as FirebaseStorage$1 } from 'firebase/storage';
|
|
7
|
+
import { Functions as Functions$1 } from 'firebase/functions';
|
|
8
|
+
import { Analytics as Analytics$1 } from 'firebase/analytics';
|
|
9
|
+
import { Observable } from 'rxjs';
|
|
10
|
+
|
|
11
|
+
declare abstract class FirebaseApp {
|
|
12
|
+
}
|
|
13
|
+
declare abstract class Auth {
|
|
14
|
+
}
|
|
15
|
+
declare abstract class FirebaseStorage {
|
|
16
|
+
}
|
|
17
|
+
declare abstract class Functions {
|
|
18
|
+
}
|
|
19
|
+
declare abstract class Analytics {
|
|
20
|
+
}
|
|
21
|
+
declare const firebaseSdk: {
|
|
22
|
+
onSnapshot: typeof onSnapshot;
|
|
23
|
+
onAuthStateChanged: typeof onAuthStateChanged;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Wraps onSnapshot for a document reference.
|
|
27
|
+
*/
|
|
28
|
+
declare function docData<T = any>(ref: DocumentReference<T>): Observable<T | undefined>;
|
|
29
|
+
/**
|
|
30
|
+
* Wraps onSnapshot for a query/collection.
|
|
31
|
+
*/
|
|
32
|
+
declare function collectionSnapshots<T = any>(q: Query<T>): Observable<QueryDocumentSnapshot<T>[]>;
|
|
33
|
+
/**
|
|
34
|
+
* Wraps onAuthStateChanged to monitor auth state.
|
|
35
|
+
*/
|
|
36
|
+
declare function user(auth: Auth): Observable<User | null>;
|
|
37
|
+
/**
|
|
38
|
+
* Custom ScreenTrackingService to replace @angular/fire/analytics ScreenTrackingService.
|
|
39
|
+
* Automatically tracks page views on router navigation events.
|
|
40
|
+
*/
|
|
41
|
+
declare class ScreenTrackingService {
|
|
42
|
+
private analytics;
|
|
43
|
+
private router;
|
|
44
|
+
constructor();
|
|
45
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ScreenTrackingService, never>;
|
|
46
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<ScreenTrackingService>;
|
|
47
|
+
}
|
|
48
|
+
declare function provideFirebaseApp(fn: () => FirebaseApp$1): Provider;
|
|
49
|
+
declare function provideFirestore(fn: () => Firestore): Provider;
|
|
50
|
+
declare function provideAuth(fn: () => Auth$1): Provider;
|
|
51
|
+
declare function provideStorage(fn: () => FirebaseStorage$1): Provider;
|
|
52
|
+
declare function provideFunctions(fn: () => Functions$1): Provider;
|
|
53
|
+
declare function provideAnalytics(fn: () => Analytics$1): Provider;
|
|
54
|
+
|
|
55
|
+
export { Analytics, Auth, FirebaseApp, FirebaseStorage, Functions, ScreenTrackingService, collectionSnapshots, docData, firebaseSdk, provideAnalytics, provideAuth, provideFirebaseApp, provideFirestore, provideFunctions, provideStorage, user };
|