@angular/fire 17.1.0 → 18.0.0-canary.c866d08
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 +10 -0
- package/compat/proxy.d.ts +2 -2
- package/compat/storage/pipes/storageUrl.pipe.d.ts +1 -2
- package/docs/analytics.md +14 -20
- package/docs/app-check.md +12 -9
- package/docs/auth.md +44 -9
- package/docs/database.md +12 -12
- package/docs/firestore.md +15 -23
- package/docs/functions.md +11 -9
- package/docs/messaging.md +30 -8
- package/docs/performance.md +11 -9
- package/docs/remote-config.md +11 -9
- package/docs/storage.md +11 -10
- package/docs/vertexai.md +53 -0
- package/esm2022/analytics/analytics.module.mjs +5 -5
- package/esm2022/analytics/is-analytics-supported-factory.mjs +1 -1
- package/esm2022/analytics/screen-tracking.service.mjs +4 -4
- package/esm2022/analytics/user-tracking.service.mjs +4 -4
- package/esm2022/app/app.module.mjs +5 -5
- package/esm2022/app-check/app-check.module.mjs +5 -5
- package/esm2022/auth/auth.module.mjs +5 -5
- package/esm2022/auth-guard/auth-guard.mjs +4 -4
- package/esm2022/auth-guard/auth-guard.module.mjs +5 -5
- package/esm2022/compat/analytics/analytics.mjs +4 -4
- package/esm2022/compat/analytics/analytics.module.mjs +5 -5
- package/esm2022/compat/analytics/screen-tracking.service.mjs +4 -4
- package/esm2022/compat/analytics/user-tracking.service.mjs +4 -4
- package/esm2022/compat/auth/auth.mjs +4 -4
- package/esm2022/compat/auth/auth.module.mjs +5 -5
- package/esm2022/compat/auth-guard/auth-guard.mjs +4 -4
- package/esm2022/compat/auth-guard/auth-guard.module.mjs +5 -5
- package/esm2022/compat/cache.mjs +1 -1
- package/esm2022/compat/database/database.mjs +4 -4
- package/esm2022/compat/database/database.module.mjs +5 -5
- package/esm2022/compat/database/list/changes.mjs +1 -1
- package/esm2022/compat/database/list/create-reference.mjs +1 -1
- package/esm2022/compat/database/list/remove.mjs +1 -1
- package/esm2022/compat/database/list/utils.mjs +1 -1
- package/esm2022/compat/database/observable/fromRef.mjs +1 -1
- package/esm2022/compat/database/utils.mjs +1 -1
- package/esm2022/compat/firebase.app.module.mjs +5 -5
- package/esm2022/compat/firestore/collection/changes.mjs +1 -1
- package/esm2022/compat/firestore/collection/collection.mjs +1 -1
- package/esm2022/compat/firestore/collection-group/collection-group.mjs +1 -1
- package/esm2022/compat/firestore/firestore.mjs +4 -4
- package/esm2022/compat/firestore/firestore.module.mjs +5 -5
- package/esm2022/compat/firestore/observable/fromRef.mjs +1 -1
- package/esm2022/compat/functions/functions.mjs +4 -4
- package/esm2022/compat/functions/functions.module.mjs +5 -5
- package/esm2022/compat/messaging/messaging.mjs +4 -4
- package/esm2022/compat/messaging/messaging.module.mjs +5 -5
- package/esm2022/compat/performance/performance.mjs +4 -4
- package/esm2022/compat/performance/performance.module.mjs +5 -5
- package/esm2022/compat/performance/performance.service.mjs +4 -4
- package/esm2022/compat/proxy.mjs +1 -1
- package/esm2022/compat/remote-config/remote-config.mjs +4 -4
- package/esm2022/compat/remote-config/remote-config.module.mjs +5 -5
- package/esm2022/compat/storage/pipes/storageUrl.pipe.mjs +10 -12
- package/esm2022/compat/storage/storage.mjs +4 -4
- package/esm2022/compat/storage/storage.module.mjs +5 -5
- package/esm2022/core.mjs +1 -1
- package/esm2022/database/database.module.mjs +5 -5
- package/esm2022/firestore/firestore.module.mjs +5 -5
- package/esm2022/firestore/lite/lite.module.mjs +5 -5
- package/esm2022/functions/functions.module.mjs +5 -5
- package/esm2022/messaging/is-messaging-supported-factory.mjs +1 -1
- package/esm2022/messaging/messaging.module.mjs +5 -5
- package/esm2022/performance/performance.module.mjs +5 -5
- package/esm2022/remote-config/is-remote-config-supported-factory.mjs +1 -1
- package/esm2022/remote-config/remote-config.module.mjs +5 -5
- package/esm2022/storage/storage.module.mjs +5 -5
- package/esm2022/vertexai-preview/vertexai.module.mjs +5 -5
- package/esm2022/zones.mjs +4 -4
- package/fesm2022/angular-fire-analytics.mjs +410 -297
- package/fesm2022/angular-fire-analytics.mjs.map +7 -1
- package/fesm2022/angular-fire-app-check.mjs +162 -91
- package/fesm2022/angular-fire-app-check.mjs.map +7 -1
- package/fesm2022/angular-fire-app.mjs +181 -108
- package/fesm2022/angular-fire-app.mjs.map +7 -1
- package/fesm2022/angular-fire-auth-guard.mjs +83 -73
- package/fesm2022/angular-fire-auth-guard.mjs.map +7 -1
- package/fesm2022/angular-fire-auth.mjs +421 -142
- package/fesm2022/angular-fire-auth.mjs.map +7 -1
- package/fesm2022/angular-fire-compat-analytics.mjs +261 -270
- package/fesm2022/angular-fire-compat-analytics.mjs.map +7 -1
- package/fesm2022/angular-fire-compat-auth-guard.mjs +83 -72
- package/fesm2022/angular-fire-compat-auth-guard.mjs.map +7 -1
- package/fesm2022/angular-fire-compat-auth.mjs +214 -213
- package/fesm2022/angular-fire-compat-auth.mjs.map +7 -1
- package/fesm2022/angular-fire-compat-database.mjs +375 -378
- package/fesm2022/angular-fire-compat-database.mjs.map +7 -1
- package/fesm2022/angular-fire-compat-firestore.mjs +537 -677
- package/fesm2022/angular-fire-compat-firestore.mjs.map +7 -1
- package/fesm2022/angular-fire-compat-functions.mjs +97 -93
- package/fesm2022/angular-fire-compat-functions.mjs.map +7 -1
- package/fesm2022/angular-fire-compat-messaging.mjs +106 -106
- package/fesm2022/angular-fire-compat-messaging.mjs.map +7 -1
- package/fesm2022/angular-fire-compat-performance.mjs +157 -151
- package/fesm2022/angular-fire-compat-performance.mjs.map +7 -1
- package/fesm2022/angular-fire-compat-remote-config.mjs +215 -231
- package/fesm2022/angular-fire-compat-remote-config.mjs.map +7 -1
- package/fesm2022/angular-fire-compat-storage.mjs +226 -233
- package/fesm2022/angular-fire-compat-storage.mjs.map +7 -1
- package/fesm2022/angular-fire-compat.mjs +140 -153
- package/fesm2022/angular-fire-compat.mjs.map +7 -1
- package/fesm2022/angular-fire-database.mjs +376 -136
- package/fesm2022/angular-fire-database.mjs.map +7 -1
- package/fesm2022/angular-fire-firestore-lite.mjs +388 -139
- package/fesm2022/angular-fire-firestore-lite.mjs.map +7 -1
- package/fesm2022/angular-fire-firestore.mjs +526 -167
- package/fesm2022/angular-fire-firestore.mjs.map +7 -1
- package/fesm2022/angular-fire-functions.mjs +166 -93
- package/fesm2022/angular-fire-functions.mjs.map +7 -1
- package/fesm2022/angular-fire-messaging.mjs +196 -118
- package/fesm2022/angular-fire-messaging.mjs.map +7 -1
- package/fesm2022/angular-fire-performance.mjs +178 -104
- package/fesm2022/angular-fire-performance.mjs.map +7 -1
- package/fesm2022/angular-fire-remote-config.mjs +254 -132
- package/fesm2022/angular-fire-remote-config.mjs.map +7 -1
- package/fesm2022/angular-fire-storage.mjs +225 -105
- package/fesm2022/angular-fire-storage.mjs.map +7 -1
- package/fesm2022/angular-fire-vertexai-preview.mjs +146 -85
- package/fesm2022/angular-fire-vertexai-preview.mjs.map +7 -1
- package/fesm2022/angular-fire.mjs +183 -213
- package/fesm2022/angular-fire.mjs.map +7 -1
- package/package.json +7 -7
- package/schematics/deploy/actions.js +2 -2
- package/schematics/setup/prompts.js +1 -1
|
@@ -1,285 +1,276 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
import { EMPTY, of } from 'rxjs';
|
|
10
|
-
import { observeOn, switchMap, map, shareReplay } from 'rxjs/operators';
|
|
11
|
-
import firebase from 'firebase/compat/app';
|
|
12
|
-
import { ɵscreenViewEvent } from '@angular/fire/analytics';
|
|
13
|
-
import * as i3 from '@angular/platform-browser';
|
|
14
|
-
import * as i2$2 from '@angular/router';
|
|
15
|
-
import * as i2$1 from '@angular/fire/compat/auth';
|
|
16
|
-
|
|
17
|
-
// DO NOT MODIFY, this file is autogenerated by tools/build.ts
|
|
18
|
-
// Export a null object with the same keys as firebase/compat/analytics, so Proxy can work with proxy-polyfill in Internet Explorer
|
|
19
|
-
const proxyPolyfillCompat = {
|
|
20
|
-
app: null,
|
|
21
|
-
logEvent: null,
|
|
22
|
-
setCurrentScreen: null,
|
|
23
|
-
setUserId: null,
|
|
24
|
-
setUserProperties: null,
|
|
25
|
-
setAnalyticsCollectionEnabled: null,
|
|
1
|
+
// base.mjs
|
|
2
|
+
var proxyPolyfillCompat = {
|
|
3
|
+
app: null,
|
|
4
|
+
logEvent: null,
|
|
5
|
+
setCurrentScreen: null,
|
|
6
|
+
setUserId: null,
|
|
7
|
+
setUserProperties: null,
|
|
8
|
+
setAnalyticsCollectionEnabled: null
|
|
26
9
|
};
|
|
27
10
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
}
|
|
79
|
-
if (providedAppVersion) {
|
|
80
|
-
args[2][APP_VERSION_KEY] = providedAppVersion;
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
if (debugModeEnabled && typeof console !== 'undefined') {
|
|
84
|
-
// eslint-disable-next-line no-console
|
|
85
|
-
console.info(...args);
|
|
86
|
-
}
|
|
87
|
-
/**
|
|
88
|
-
* According to the gtag documentation, this function that defines a custom data layer cannot be
|
|
89
|
-
* an arrow function because 'arguments' is not an array. It is actually an object that behaves
|
|
90
|
-
* like an array and contains more information then just indexes. Transforming this into arrow function
|
|
91
|
-
* caused issue #2505 where analytics no longer sent any data.
|
|
92
|
-
*/
|
|
93
|
-
(function (..._args) {
|
|
94
|
-
window[DATA_LAYER_NAME].push(arguments);
|
|
95
|
-
})(...args);
|
|
96
|
-
};
|
|
97
|
-
};
|
|
98
|
-
// Unclear if we still need to but I was running into config/events I passed
|
|
99
|
-
// to gtag before ['js' timestamp] weren't getting parsed, so let's make a promise
|
|
100
|
-
// that resolves when firebase/analytics has configured gtag.js that we wait on
|
|
101
|
-
// before sending anything
|
|
102
|
-
const firebaseAnalyticsAlreadyInitialized = window[DATA_LAYER_NAME].some(parseMeasurementId);
|
|
103
|
-
if (firebaseAnalyticsAlreadyInitialized) {
|
|
104
|
-
this.analyticsInitialized = Promise.resolve();
|
|
105
|
-
patchGtag();
|
|
106
|
-
}
|
|
107
|
-
else {
|
|
108
|
-
this.analyticsInitialized = new Promise(resolve => {
|
|
109
|
-
patchGtag((...args) => {
|
|
110
|
-
if (parseMeasurementId(...args)) {
|
|
111
|
-
resolve();
|
|
112
|
-
}
|
|
113
|
-
});
|
|
114
|
-
});
|
|
11
|
+
// analytics.mjs
|
|
12
|
+
import { isPlatformBrowser } from "@angular/common";
|
|
13
|
+
import { Inject, Injectable, InjectionToken, NgZone, Optional, PLATFORM_ID } from "@angular/core";
|
|
14
|
+
import { ɵAngularFireSchedulers } from "@angular/fire";
|
|
15
|
+
import { ɵapplyMixins, ɵcacheInstance, ɵlazySDKProxy } from "@angular/fire/compat";
|
|
16
|
+
import { FirebaseApp } from "@angular/fire/compat";
|
|
17
|
+
import { isSupported } from "firebase/analytics";
|
|
18
|
+
import { EMPTY, of } from "rxjs";
|
|
19
|
+
import { map, observeOn, shareReplay, switchMap } from "rxjs/operators";
|
|
20
|
+
import * as i0 from "@angular/core";
|
|
21
|
+
import * as i1 from "@angular/fire/compat";
|
|
22
|
+
import * as i2 from "@angular/fire";
|
|
23
|
+
var COLLECTION_ENABLED = new InjectionToken("angularfire2.analytics.analyticsCollectionEnabled");
|
|
24
|
+
var APP_VERSION = new InjectionToken("angularfire2.analytics.appVersion");
|
|
25
|
+
var APP_NAME = new InjectionToken("angularfire2.analytics.appName");
|
|
26
|
+
var DEBUG_MODE = new InjectionToken("angularfire2.analytics.debugMode");
|
|
27
|
+
var CONFIG = new InjectionToken("angularfire2.analytics.config");
|
|
28
|
+
var APP_NAME_KEY = "app_name";
|
|
29
|
+
var APP_VERSION_KEY = "app_version";
|
|
30
|
+
var DEBUG_MODE_KEY = "debug_mode";
|
|
31
|
+
var GTAG_CONFIG_COMMAND = "config";
|
|
32
|
+
var GTAG_FUNCTION_NAME = "gtag";
|
|
33
|
+
var DATA_LAYER_NAME = "dataLayer";
|
|
34
|
+
var SEND_TO_KEY = "send_to";
|
|
35
|
+
var AngularFireAnalytics = class _AngularFireAnalytics {
|
|
36
|
+
measurementId;
|
|
37
|
+
analyticsInitialized = new Promise(() => void 0);
|
|
38
|
+
async updateConfig(config) {
|
|
39
|
+
await this.analyticsInitialized;
|
|
40
|
+
window[GTAG_FUNCTION_NAME](GTAG_CONFIG_COMMAND, this.measurementId, { ...config, update: true });
|
|
41
|
+
}
|
|
42
|
+
constructor(app, analyticsCollectionEnabled, providedAppVersion, providedAppName, debugModeEnabled, providedConfig, platformId, zone, schedulers) {
|
|
43
|
+
if (isPlatformBrowser(platformId)) {
|
|
44
|
+
window[DATA_LAYER_NAME] = window[DATA_LAYER_NAME] || [];
|
|
45
|
+
const parseMeasurementId = (...args) => {
|
|
46
|
+
if (args[0] === "config" && args[2].origin === "firebase") {
|
|
47
|
+
this.measurementId = args[1];
|
|
48
|
+
return true;
|
|
49
|
+
} else {
|
|
50
|
+
return false;
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
const patchGtag = (fn) => {
|
|
54
|
+
window[GTAG_FUNCTION_NAME] = (...args) => {
|
|
55
|
+
if (fn) {
|
|
56
|
+
fn(...args);
|
|
57
|
+
}
|
|
58
|
+
if (args[0] === "event" && args[2][SEND_TO_KEY] === this.measurementId) {
|
|
59
|
+
if (providedAppName) {
|
|
60
|
+
args[2][APP_NAME_KEY] = providedAppName;
|
|
115
61
|
}
|
|
116
|
-
if (
|
|
117
|
-
|
|
62
|
+
if (providedAppVersion) {
|
|
63
|
+
args[2][APP_VERSION_KEY] = providedAppVersion;
|
|
118
64
|
}
|
|
119
|
-
|
|
120
|
-
|
|
65
|
+
}
|
|
66
|
+
if (debugModeEnabled && typeof console !== "undefined") {
|
|
67
|
+
console.info(...args);
|
|
68
|
+
}
|
|
69
|
+
(function(..._args) {
|
|
70
|
+
window[DATA_LAYER_NAME].push(arguments);
|
|
71
|
+
})(...args);
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
const firebaseAnalyticsAlreadyInitialized = window[DATA_LAYER_NAME].some(parseMeasurementId);
|
|
75
|
+
if (firebaseAnalyticsAlreadyInitialized) {
|
|
76
|
+
this.analyticsInitialized = Promise.resolve();
|
|
77
|
+
patchGtag();
|
|
78
|
+
} else {
|
|
79
|
+
this.analyticsInitialized = new Promise((resolve) => {
|
|
80
|
+
patchGtag((...args) => {
|
|
81
|
+
if (parseMeasurementId(...args)) {
|
|
82
|
+
resolve();
|
|
121
83
|
}
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
}, [app, analyticsCollectionEnabled, providedConfig, debugModeEnabled]);
|
|
134
|
-
}), shareReplay({ bufferSize: 1, refCount: false }));
|
|
135
|
-
return ɵlazySDKProxy(this, analytics, zone);
|
|
84
|
+
});
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
if (providedConfig) {
|
|
88
|
+
this.updateConfig(providedConfig);
|
|
89
|
+
}
|
|
90
|
+
if (debugModeEnabled) {
|
|
91
|
+
this.updateConfig({ [DEBUG_MODE_KEY]: 1 });
|
|
92
|
+
}
|
|
93
|
+
} else {
|
|
94
|
+
this.analyticsInitialized = Promise.resolve();
|
|
136
95
|
}
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
96
|
+
const analytics = of(void 0).pipe(observeOn(schedulers.outsideAngular), switchMap(isSupported), switchMap((supported) => supported ? zone.runOutsideAngular(() => import("firebase/compat/analytics")) : EMPTY), map(() => {
|
|
97
|
+
return ɵcacheInstance(`analytics`, "AngularFireAnalytics", app.name, () => {
|
|
98
|
+
const analytics2 = app.analytics();
|
|
99
|
+
if (analyticsCollectionEnabled === false) {
|
|
100
|
+
analytics2.setAnalyticsCollectionEnabled(false);
|
|
101
|
+
}
|
|
102
|
+
return analytics2;
|
|
103
|
+
}, [app, analyticsCollectionEnabled, providedConfig, debugModeEnabled]);
|
|
104
|
+
}), shareReplay({ bufferSize: 1, refCount: false }));
|
|
105
|
+
return ɵlazySDKProxy(this, analytics, zone);
|
|
106
|
+
}
|
|
107
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-rc.3", ngImport: i0, type: _AngularFireAnalytics, deps: [{ token: i1.FirebaseApp }, { token: COLLECTION_ENABLED, optional: true }, { token: APP_VERSION, optional: true }, { token: APP_NAME, optional: true }, { token: DEBUG_MODE, optional: true }, { token: CONFIG, optional: true }, { token: PLATFORM_ID }, { token: i0.NgZone }, { token: i2.ɵAngularFireSchedulers }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
108
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-rc.3", ngImport: i0, type: _AngularFireAnalytics, providedIn: "any" });
|
|
109
|
+
};
|
|
110
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-rc.3", ngImport: i0, type: AngularFireAnalytics, decorators: [{
|
|
111
|
+
type: Injectable,
|
|
112
|
+
args: [{
|
|
113
|
+
providedIn: "any"
|
|
114
|
+
}]
|
|
115
|
+
}], ctorParameters: () => [{ type: i1.FirebaseApp }, { type: void 0, decorators: [{
|
|
116
|
+
type: Optional
|
|
117
|
+
}, {
|
|
118
|
+
type: Inject,
|
|
119
|
+
args: [COLLECTION_ENABLED]
|
|
120
|
+
}] }, { type: void 0, decorators: [{
|
|
121
|
+
type: Optional
|
|
122
|
+
}, {
|
|
123
|
+
type: Inject,
|
|
124
|
+
args: [APP_VERSION]
|
|
125
|
+
}] }, { type: void 0, decorators: [{
|
|
126
|
+
type: Optional
|
|
127
|
+
}, {
|
|
128
|
+
type: Inject,
|
|
129
|
+
args: [APP_NAME]
|
|
130
|
+
}] }, { type: void 0, decorators: [{
|
|
131
|
+
type: Optional
|
|
132
|
+
}, {
|
|
133
|
+
type: Inject,
|
|
134
|
+
args: [DEBUG_MODE]
|
|
135
|
+
}] }, { type: void 0, decorators: [{
|
|
136
|
+
type: Optional
|
|
137
|
+
}, {
|
|
138
|
+
type: Inject,
|
|
139
|
+
args: [CONFIG]
|
|
140
|
+
}] }, { type: Object, decorators: [{
|
|
141
|
+
type: Inject,
|
|
142
|
+
args: [PLATFORM_ID]
|
|
143
|
+
}] }, { type: i0.NgZone }, { type: i2.ɵAngularFireSchedulers }] });
|
|
174
144
|
ɵapplyMixins(AngularFireAnalytics, [proxyPolyfillCompat]);
|
|
175
145
|
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
146
|
+
// user-tracking.service.mjs
|
|
147
|
+
import { isPlatformServer } from "@angular/common";
|
|
148
|
+
import { Inject as Inject2, Injectable as Injectable2, NgZone as NgZone3, PLATFORM_ID as PLATFORM_ID2 } from "@angular/core";
|
|
149
|
+
import { VERSION } from "@angular/fire";
|
|
150
|
+
import { AngularFireAuth } from "@angular/fire/compat/auth";
|
|
151
|
+
import firebase from "firebase/compat/app";
|
|
152
|
+
import * as i02 from "@angular/core";
|
|
153
|
+
import * as i22 from "@angular/fire/compat/auth";
|
|
154
|
+
var UserTrackingService = class _UserTrackingService {
|
|
155
|
+
initialized;
|
|
156
|
+
disposables = [];
|
|
157
|
+
// TODO a user properties injector
|
|
158
|
+
constructor(analytics, platformId, auth, zone) {
|
|
159
|
+
firebase.registerVersion("angularfire", VERSION.full, "compat-user-tracking");
|
|
160
|
+
if (!isPlatformServer(platformId)) {
|
|
161
|
+
let resolveInitialized;
|
|
162
|
+
this.initialized = zone.runOutsideAngular(() => new Promise((resolve) => resolveInitialized = resolve));
|
|
163
|
+
this.disposables = [
|
|
164
|
+
auth.authState.subscribe((user) => {
|
|
165
|
+
analytics.setUserId(user?.uid);
|
|
166
|
+
resolveInitialized();
|
|
167
|
+
}),
|
|
168
|
+
auth.credential.subscribe((credential) => {
|
|
169
|
+
if (credential) {
|
|
170
|
+
const method = credential.user.isAnonymous ? "anonymous" : credential.additionalUserInfo.providerId;
|
|
171
|
+
if (credential.additionalUserInfo.isNewUser) {
|
|
172
|
+
analytics.logEvent("sign_up", { method });
|
|
173
|
+
}
|
|
174
|
+
analytics.logEvent("login", { method });
|
|
175
|
+
}
|
|
176
|
+
})
|
|
177
|
+
];
|
|
178
|
+
} else {
|
|
179
|
+
this.initialized = Promise.resolve();
|
|
209
180
|
}
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
181
|
+
}
|
|
182
|
+
ngOnDestroy() {
|
|
183
|
+
this.disposables.forEach((it) => it.unsubscribe());
|
|
184
|
+
}
|
|
185
|
+
static ɵfac = i02.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-rc.3", ngImport: i02, type: _UserTrackingService, deps: [{ token: AngularFireAnalytics }, { token: PLATFORM_ID2 }, { token: i22.AngularFireAuth }, { token: i02.NgZone }], target: i02.ɵɵFactoryTarget.Injectable });
|
|
186
|
+
static ɵprov = i02.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-rc.3", ngImport: i02, type: _UserTrackingService });
|
|
187
|
+
};
|
|
188
|
+
i02.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-rc.3", ngImport: i02, type: UserTrackingService, decorators: [{
|
|
189
|
+
type: Injectable2
|
|
190
|
+
}], ctorParameters: () => [{ type: AngularFireAnalytics }, { type: Object, decorators: [{
|
|
191
|
+
type: Inject2,
|
|
192
|
+
args: [PLATFORM_ID2]
|
|
193
|
+
}] }, { type: i22.AngularFireAuth }, { type: i02.NgZone }] });
|
|
219
194
|
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
195
|
+
// screen-tracking.service.mjs
|
|
196
|
+
import { ComponentFactoryResolver, Injectable as Injectable3, NgZone as NgZone5, Optional as Optional2 } from "@angular/core";
|
|
197
|
+
import { VERSION as VERSION2 } from "@angular/fire";
|
|
198
|
+
import { ɵscreenViewEvent } from "@angular/fire/analytics";
|
|
199
|
+
import { Title } from "@angular/platform-browser";
|
|
200
|
+
import { Router } from "@angular/router";
|
|
201
|
+
import firebase2 from "firebase/compat/app";
|
|
202
|
+
import { switchMap as switchMap2 } from "rxjs/operators";
|
|
203
|
+
import * as i03 from "@angular/core";
|
|
204
|
+
import * as i23 from "@angular/router";
|
|
205
|
+
import * as i3 from "@angular/platform-browser";
|
|
206
|
+
var SCREEN_VIEW_EVENT = "screen_view";
|
|
207
|
+
var ScreenTrackingService = class _ScreenTrackingService {
|
|
208
|
+
disposable;
|
|
209
|
+
constructor(analytics, router, title, componentFactoryResolver, zone, userTrackingService) {
|
|
210
|
+
firebase2.registerVersion("angularfire", VERSION2.full, "compat-screen-tracking");
|
|
211
|
+
if (!router || !analytics) {
|
|
212
|
+
return this;
|
|
236
213
|
}
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
214
|
+
zone.runOutsideAngular(() => {
|
|
215
|
+
this.disposable = ɵscreenViewEvent(router, title, componentFactoryResolver).pipe(switchMap2(async (params) => {
|
|
216
|
+
if (userTrackingService) {
|
|
217
|
+
await userTrackingService.initialized;
|
|
240
218
|
}
|
|
219
|
+
return await analytics.logEvent(SCREEN_VIEW_EVENT, params);
|
|
220
|
+
})).subscribe();
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
ngOnDestroy() {
|
|
224
|
+
if (this.disposable) {
|
|
225
|
+
this.disposable.unsubscribe();
|
|
241
226
|
}
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
class AngularFireAnalyticsModule {
|
|
256
|
-
constructor(analytics,
|
|
257
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
258
|
-
screenTracking,
|
|
259
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
260
|
-
userTracking) {
|
|
261
|
-
firebase.registerVersion('angularfire', VERSION.full, 'analytics-compat');
|
|
262
|
-
// calling anything on analytics will eagerly load the SDK
|
|
263
|
-
analytics.app.then(() => undefined);
|
|
264
|
-
}
|
|
265
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.6", ngImport: i0, type: AngularFireAnalyticsModule, deps: [{ token: AngularFireAnalytics }, { token: ScreenTrackingService, optional: true }, { token: UserTrackingService, optional: true }], target: i0.ɵɵFactoryTarget.NgModule });
|
|
266
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.0.6", ngImport: i0, type: AngularFireAnalyticsModule });
|
|
267
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.0.6", ngImport: i0, type: AngularFireAnalyticsModule, providers: [AngularFireAnalytics] });
|
|
268
|
-
}
|
|
269
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.6", ngImport: i0, type: AngularFireAnalyticsModule, decorators: [{
|
|
270
|
-
type: NgModule,
|
|
271
|
-
args: [{
|
|
272
|
-
providers: [AngularFireAnalytics]
|
|
273
|
-
}]
|
|
274
|
-
}], ctorParameters: () => [{ type: AngularFireAnalytics }, { type: ScreenTrackingService, decorators: [{
|
|
275
|
-
type: Optional
|
|
276
|
-
}] }, { type: UserTrackingService, decorators: [{
|
|
277
|
-
type: Optional
|
|
278
|
-
}] }] });
|
|
279
|
-
|
|
280
|
-
/**
|
|
281
|
-
* Generated bundle index. Do not edit.
|
|
282
|
-
*/
|
|
227
|
+
}
|
|
228
|
+
static ɵfac = i03.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-rc.3", ngImport: i03, type: _ScreenTrackingService, deps: [{ token: AngularFireAnalytics }, { token: i23.Router, optional: true }, { token: i3.Title, optional: true }, { token: i03.ComponentFactoryResolver }, { token: i03.NgZone }, { token: UserTrackingService, optional: true }], target: i03.ɵɵFactoryTarget.Injectable });
|
|
229
|
+
static ɵprov = i03.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-rc.3", ngImport: i03, type: _ScreenTrackingService });
|
|
230
|
+
};
|
|
231
|
+
i03.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-rc.3", ngImport: i03, type: ScreenTrackingService, decorators: [{
|
|
232
|
+
type: Injectable3
|
|
233
|
+
}], ctorParameters: () => [{ type: AngularFireAnalytics }, { type: i23.Router, decorators: [{
|
|
234
|
+
type: Optional2
|
|
235
|
+
}] }, { type: i3.Title, decorators: [{
|
|
236
|
+
type: Optional2
|
|
237
|
+
}] }, { type: i03.ComponentFactoryResolver }, { type: i03.NgZone }, { type: UserTrackingService, decorators: [{
|
|
238
|
+
type: Optional2
|
|
239
|
+
}] }] });
|
|
283
240
|
|
|
284
|
-
|
|
241
|
+
// analytics.module.mjs
|
|
242
|
+
import { NgModule, Optional as Optional3 } from "@angular/core";
|
|
243
|
+
import { VERSION as VERSION3 } from "@angular/fire";
|
|
244
|
+
import firebase3 from "firebase/compat/app";
|
|
245
|
+
import * as i04 from "@angular/core";
|
|
246
|
+
var AngularFireAnalyticsModule = class _AngularFireAnalyticsModule {
|
|
247
|
+
constructor(analytics, screenTracking, userTracking) {
|
|
248
|
+
firebase3.registerVersion("angularfire", VERSION3.full, "analytics-compat");
|
|
249
|
+
analytics.app.then(() => void 0);
|
|
250
|
+
}
|
|
251
|
+
static ɵfac = i04.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-rc.3", ngImport: i04, type: _AngularFireAnalyticsModule, deps: [{ token: AngularFireAnalytics }, { token: ScreenTrackingService, optional: true }, { token: UserTrackingService, optional: true }], target: i04.ɵɵFactoryTarget.NgModule });
|
|
252
|
+
static ɵmod = i04.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.0.0-rc.3", ngImport: i04, type: _AngularFireAnalyticsModule });
|
|
253
|
+
static ɵinj = i04.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.0.0-rc.3", ngImport: i04, type: _AngularFireAnalyticsModule, providers: [AngularFireAnalytics] });
|
|
254
|
+
};
|
|
255
|
+
i04.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-rc.3", ngImport: i04, type: AngularFireAnalyticsModule, decorators: [{
|
|
256
|
+
type: NgModule,
|
|
257
|
+
args: [{
|
|
258
|
+
providers: [AngularFireAnalytics]
|
|
259
|
+
}]
|
|
260
|
+
}], ctorParameters: () => [{ type: AngularFireAnalytics }, { type: ScreenTrackingService, decorators: [{
|
|
261
|
+
type: Optional3
|
|
262
|
+
}] }, { type: UserTrackingService, decorators: [{
|
|
263
|
+
type: Optional3
|
|
264
|
+
}] }] });
|
|
265
|
+
export {
|
|
266
|
+
APP_NAME,
|
|
267
|
+
APP_VERSION,
|
|
268
|
+
AngularFireAnalytics,
|
|
269
|
+
AngularFireAnalyticsModule,
|
|
270
|
+
COLLECTION_ENABLED,
|
|
271
|
+
CONFIG,
|
|
272
|
+
DEBUG_MODE,
|
|
273
|
+
ScreenTrackingService,
|
|
274
|
+
UserTrackingService
|
|
275
|
+
};
|
|
285
276
|
//# sourceMappingURL=angular-fire-compat-analytics.mjs.map
|