@angular/fire 7.1.0-rc.5 → 7.2.0-canary.390691b
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/analytics/analytics.module.d.ts +3 -5
- package/analytics/firebase.d.ts +2 -2
- package/analytics/overrides.d.ts +1 -0
- package/analytics/screen-tracking.service.d.ts +2 -4
- package/analytics/user-tracking.service.d.ts +2 -4
- package/auth-guard/angular-fire-auth-guard.d.ts +5 -0
- package/auth-guard/auth-guard.d.ts +29 -0
- package/auth-guard/auth-guard.module.d.ts +7 -0
- package/auth-guard/package.json +11 -0
- package/auth-guard/public_api.d.ts +2 -0
- package/bundles/angular-fire-analytics.umd.js +63 -84
- package/bundles/angular-fire-analytics.umd.js.map +1 -1
- package/bundles/angular-fire-auth-guard.umd.js +109 -0
- package/bundles/angular-fire-auth-guard.umd.js.map +1 -0
- package/bundles/angular-fire-firestore-lite.umd.js +323 -6
- package/bundles/angular-fire-firestore-lite.umd.js.map +1 -1
- package/bundles/angular-fire-firestore.umd.js.map +1 -1
- package/bundles/angular-fire-messaging.umd.js +12 -18
- package/bundles/angular-fire-messaging.umd.js.map +1 -1
- package/bundles/angular-fire-remote-config.umd.js +12 -18
- package/bundles/angular-fire-remote-config.umd.js.map +1 -1
- package/bundles/angular-fire.umd.js +49 -6
- package/bundles/angular-fire.umd.js.map +1 -1
- package/core.d.ts +12 -0
- package/docs/version-7-upgrade.md +2 -2
- package/esm2015/analytics/analytics.module.js +9 -24
- package/esm2015/analytics/firebase.js +3 -3
- package/esm2015/analytics/overrides.js +3 -0
- package/esm2015/analytics/screen-tracking.service.js +22 -30
- package/esm2015/analytics/user-tracking.service.js +24 -23
- package/esm2015/auth-guard/angular-fire-auth-guard.js +5 -0
- package/esm2015/auth-guard/auth-guard.js +49 -0
- package/esm2015/auth-guard/auth-guard.module.js +20 -0
- package/esm2015/auth-guard/public_api.js +3 -0
- package/esm2015/core.js +47 -2
- package/esm2015/firestore/firestore.module.js +1 -1
- package/esm2015/firestore/lite/lite.module.js +5 -2
- package/esm2015/messaging/firebase.js +3 -3
- package/esm2015/messaging/messaging.module.js +9 -17
- package/esm2015/messaging/overrides.js +3 -0
- package/esm2015/remote-config/firebase.js +3 -3
- package/esm2015/remote-config/overrides.js +3 -0
- package/esm2015/remote-config/remote-config.module.js +8 -16
- package/esm2015/zones.js +3 -2
- package/fesm2015/angular-fire-analytics.js +53 -70
- package/fesm2015/angular-fire-analytics.js.map +1 -1
- package/fesm2015/angular-fire-auth-guard.js +72 -0
- package/fesm2015/angular-fire-auth-guard.js.map +1 -0
- package/fesm2015/angular-fire-firestore-lite.js +4 -1
- package/fesm2015/angular-fire-firestore-lite.js.map +1 -1
- package/fesm2015/angular-fire-firestore.js.map +1 -1
- package/fesm2015/angular-fire-messaging.js +11 -17
- package/fesm2015/angular-fire-messaging.js.map +1 -1
- package/fesm2015/angular-fire-remote-config.js +11 -17
- package/fesm2015/angular-fire-remote-config.js.map +1 -1
- package/fesm2015/angular-fire.js +49 -3
- package/fesm2015/angular-fire.js.map +1 -1
- package/firestore/firestore.module.d.ts +1 -1
- package/firestore/lite/lite.module.d.ts +1 -1
- package/messaging/firebase.d.ts +2 -2
- package/messaging/messaging.module.d.ts +2 -2
- package/messaging/overrides.d.ts +1 -0
- package/package.json +9 -10
- package/remote-config/firebase.d.ts +2 -2
- package/remote-config/overrides.d.ts +1 -0
- package/remote-config/remote-config.module.d.ts +2 -2
- package/schematics/deploy/actions.js +21 -13
- package/schematics/firebaseTools.js +22 -2
- package/schematics/setup/index.js +11 -3
- package/schematics/setup/prompts.js +1 -1
- package/schematics/utils.js +1 -1
- package/schematics/versions.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"angular-fire-remote-config.js","sources":["../../../src/remote-config/remote-config.ts","../../../src/remote-config/remote-config.module.ts","../../../src/remote-config/rxfire.ts","../../../src/remote-config/firebase.ts","../../../src/remote-config/angular-fire-remote-config.ts"],"sourcesContent":["import { RemoteConfig as FirebaseRemoteConfig } from 'firebase/remote-config';\nimport { ɵgetAllInstancesOf } from '@angular/fire';\nimport { from, timer } from 'rxjs';\nimport { concatMap, distinct } from 'rxjs/operators';\n\n// see notes in core/firebase.app.module.ts for why we're building the class like this\n// tslint:disable-next-line:no-empty-interface\nexport interface RemoteConfig extends FirebaseRemoteConfig {}\n\nexport class RemoteConfig {\n constructor(remoteConfig: FirebaseRemoteConfig) {\n return remoteConfig;\n }\n}\n\nexport const REMOTE_CONFIG_PROVIDER_NAME = 'remote-config';\n\n// tslint:disable-next-line:no-empty-interface\nexport interface RemoteConfigInstances extends Array<FirebaseRemoteConfig> {}\n\nexport class RemoteConfigInstances {\n constructor() {\n return ɵgetAllInstancesOf<FirebaseRemoteConfig>(REMOTE_CONFIG_PROVIDER_NAME);\n }\n}\n\nexport const remoteConfigInstance$ = timer(0, 300).pipe(\n concatMap(() => from(ɵgetAllInstancesOf<FirebaseRemoteConfig>(REMOTE_CONFIG_PROVIDER_NAME))),\n distinct(),\n);\n","import { NgModule, Optional, NgZone, InjectionToken, ModuleWithProviders, Injector, APP_INITIALIZER } from '@angular/core';\nimport { RemoteConfig as FirebaseRemoteConfig
|
|
1
|
+
{"version":3,"file":"angular-fire-remote-config.js","sources":["../../../src/remote-config/remote-config.ts","../../../src/remote-config/remote-config.module.ts","../../../src/remote-config/rxfire.ts","../../../src/remote-config/overrides.ts","../../../src/remote-config/firebase.ts","../../../src/remote-config/angular-fire-remote-config.ts"],"sourcesContent":["import { RemoteConfig as FirebaseRemoteConfig } from 'firebase/remote-config';\nimport { ɵgetAllInstancesOf } from '@angular/fire';\nimport { from, timer } from 'rxjs';\nimport { concatMap, distinct } from 'rxjs/operators';\n\n// see notes in core/firebase.app.module.ts for why we're building the class like this\n// tslint:disable-next-line:no-empty-interface\nexport interface RemoteConfig extends FirebaseRemoteConfig {}\n\nexport class RemoteConfig {\n constructor(remoteConfig: FirebaseRemoteConfig) {\n return remoteConfig;\n }\n}\n\nexport const REMOTE_CONFIG_PROVIDER_NAME = 'remote-config';\n\n// tslint:disable-next-line:no-empty-interface\nexport interface RemoteConfigInstances extends Array<FirebaseRemoteConfig> {}\n\nexport class RemoteConfigInstances {\n constructor() {\n return ɵgetAllInstancesOf<FirebaseRemoteConfig>(REMOTE_CONFIG_PROVIDER_NAME);\n }\n}\n\nexport const remoteConfigInstance$ = timer(0, 300).pipe(\n concatMap(() => from(ɵgetAllInstancesOf<FirebaseRemoteConfig>(REMOTE_CONFIG_PROVIDER_NAME))),\n distinct(),\n);\n","import { NgModule, Optional, NgZone, InjectionToken, ModuleWithProviders, Injector, APP_INITIALIZER } from '@angular/core';\nimport { RemoteConfig as FirebaseRemoteConfig } from 'firebase/remote-config';\nimport { ɵgetDefaultInstanceOf, ɵAngularFireSchedulers, VERSION, ɵisRemoteConfigSupportedFactory } from '@angular/fire';\nimport { RemoteConfig, RemoteConfigInstances, REMOTE_CONFIG_PROVIDER_NAME } from './remote-config';\nimport { FirebaseApps, FirebaseApp } from '@angular/fire/app';\nimport { registerVersion } from 'firebase/app';\n\nexport const PROVIDED_REMOTE_CONFIG_INSTANCES = new InjectionToken<RemoteConfig[]>('angularfire2.remote-config-instances');\n\nexport function defaultRemoteConfigInstanceFactory(\n provided: FirebaseRemoteConfig[]|undefined,\n defaultApp: FirebaseApp,\n) {\n if (!ɵisRemoteConfigSupportedFactory.sync()) { return null; }\n const defaultRemoteConfig = ɵgetDefaultInstanceOf<FirebaseRemoteConfig>(REMOTE_CONFIG_PROVIDER_NAME, provided, defaultApp);\n return defaultRemoteConfig && new RemoteConfig(defaultRemoteConfig);\n}\n\nexport function remoteConfigInstanceFactory(fn: (injector: Injector) => FirebaseRemoteConfig) {\n return (zone: NgZone, injector: Injector) => {\n if (!ɵisRemoteConfigSupportedFactory.sync()) { return null; }\n const remoteConfig = zone.runOutsideAngular(() => fn(injector));\n return new RemoteConfig(remoteConfig);\n };\n}\n\nconst REMOTE_CONFIG_INSTANCES_PROVIDER = {\n provide: RemoteConfigInstances,\n deps: [\n [new Optional(), PROVIDED_REMOTE_CONFIG_INSTANCES ],\n ]\n};\n\nconst DEFAULT_REMOTE_CONFIG_INSTANCE_PROVIDER = {\n provide: RemoteConfig,\n useFactory: defaultRemoteConfigInstanceFactory,\n deps: [\n [new Optional(), PROVIDED_REMOTE_CONFIG_INSTANCES ],\n FirebaseApp,\n ]\n};\n\n@NgModule({\n providers: [\n DEFAULT_REMOTE_CONFIG_INSTANCE_PROVIDER,\n REMOTE_CONFIG_INSTANCES_PROVIDER,\n {\n provide: APP_INITIALIZER,\n useValue: ɵisRemoteConfigSupportedFactory.async,\n multi: true,\n },\n ]\n})\nexport class RemoteConfigModule {\n constructor() {\n registerVersion('angularfire', VERSION.full, 'rc');\n }\n}\n\nexport function provideRemoteConfig(fn: () => FirebaseRemoteConfig, ...deps: any[]): ModuleWithProviders<RemoteConfigModule> {\n return {\n ngModule: RemoteConfigModule,\n providers: [{\n provide: PROVIDED_REMOTE_CONFIG_INSTANCES,\n useFactory: remoteConfigInstanceFactory(fn),\n multi: true,\n deps: [\n NgZone,\n Injector,\n ɵAngularFireSchedulers,\n FirebaseApps,\n ...deps,\n ]\n }]\n };\n}\n","// DO NOT MODIFY, this file is autogenerated by tools/build.ts\nimport { ɵzoneWrap } from '@angular/fire';\nimport {\n getValue as _getValue,\n getString as _getString,\n getNumber as _getNumber,\n getBoolean as _getBoolean,\n getAll as _getAll\n} from 'rxfire/remote-config';\n\nexport const getValueChanges = ɵzoneWrap(_getValue, true);\nexport const getStringChanges = ɵzoneWrap(_getString, true);\nexport const getNumberChanges = ɵzoneWrap(_getNumber, true);\nexport const getBooleanChanges = ɵzoneWrap(_getBoolean, true);\nexport const getAllChanges = ɵzoneWrap(_getAll, true);\n","import { ɵisRemoteConfigSupportedFactory } from '@angular/fire';\n\nexport const isSupported = ɵisRemoteConfigSupportedFactory.async;\n","// DO NOT MODIFY, this file is autogenerated by tools/build.ts\nexport * from 'firebase/remote-config';\nimport { ɵzoneWrap } from '@angular/fire';\nimport {\n activate as _activate,\n ensureInitialized as _ensureInitialized,\n fetchAndActivate as _fetchAndActivate,\n fetchConfig as _fetchConfig,\n getAll as _getAll,\n getBoolean as _getBoolean,\n getNumber as _getNumber,\n getRemoteConfig as _getRemoteConfig,\n getString as _getString,\n getValue as _getValue,\n setLogLevel as _setLogLevel\n} from 'firebase/remote-config';\n\nexport {\n isSupported\n} from './overrides';\n\nexport const activate = ɵzoneWrap(_activate, true);\nexport const ensureInitialized = ɵzoneWrap(_ensureInitialized, true);\nexport const fetchAndActivate = ɵzoneWrap(_fetchAndActivate, true);\nexport const fetchConfig = ɵzoneWrap(_fetchConfig, true);\nexport const getAll = ɵzoneWrap(_getAll, true);\nexport const getBoolean = ɵzoneWrap(_getBoolean, true);\nexport const getNumber = ɵzoneWrap(_getNumber, true);\nexport const getRemoteConfig = ɵzoneWrap(_getRemoteConfig, true);\nexport const getString = ɵzoneWrap(_getString, true);\nexport const getValue = ɵzoneWrap(_getValue, true);\nexport const setLogLevel = ɵzoneWrap(_setLogLevel, true);\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["_getValue","_getString","_getNumber","_getBoolean","_getAll","_activate","_ensureInitialized","_fetchAndActivate","_fetchConfig","_getRemoteConfig","_setLogLevel"],"mappings":";;;;;;;;;;;MASa,YAAY;IACvB,YAAY,YAAkC;QAC5C,OAAO,YAAY,CAAC;KACrB;CACF;AAEM,MAAM,2BAA2B,GAAG,eAAe,CAAC;MAK9C,qBAAqB;IAChC;QACE,OAAO,kBAAkB,CAAuB,2BAA2B,CAAC,CAAC;KAC9E;CACF;MAEY,qBAAqB,GAAG,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,IAAI,CACrD,SAAS,CAAC,MAAM,IAAI,CAAC,kBAAkB,CAAuB,2BAA2B,CAAC,CAAC,CAAC,EAC5F,QAAQ,EAAE;;ACrBL,MAAM,gCAAgC,GAAG,IAAI,cAAc,CAAiB,sCAA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,WAAU,EAAE,IAAI,EAAE;MACxC,eAAe,GAAG,SAAS,CAACO,iBAAgB,EAAE,IAAI,EAAE;MACpD,SAAS,GAAG,SAAS,CAACR,WAAU,EAAE,IAAI,EAAE;MACxC,QAAQ,GAAG,SAAS,CAACD,UAAS,EAAE,IAAI,EAAE;MACtC,WAAW,GAAG,SAAS,CAACU,aAAY,EAAE,IAAI;;AC/BvD;;;;;;"}
|
package/fesm2015/angular-fire.js
CHANGED
|
@@ -1,10 +1,55 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { Version, Injectable } from '@angular/core';
|
|
3
3
|
import { getApps } from 'firebase/app';
|
|
4
|
+
import { isSupported as isSupported$2 } from 'firebase/remote-config';
|
|
5
|
+
import { isSupported as isSupported$1 } from 'firebase/messaging';
|
|
6
|
+
import { isSupported } from 'firebase/analytics';
|
|
4
7
|
import { queueScheduler, asyncScheduler, Observable } from 'rxjs';
|
|
5
8
|
import { tap, observeOn, subscribeOn } from 'rxjs/operators';
|
|
6
9
|
|
|
7
|
-
const VERSION = new Version('7.
|
|
10
|
+
const VERSION = new Version('7.2.0-canary.390691b');
|
|
11
|
+
const isAnalyticsSupportedValueSymbol = '__angularfire_symbol__analyticsIsSupportedValue';
|
|
12
|
+
const isAnalyticsSupportedPromiseSymbol = '__angularfire_symbol__analyticsIsSupported';
|
|
13
|
+
const isRemoteConfigSupportedValueSymbol = '__angularfire_symbol__remoteConfigIsSupportedValue';
|
|
14
|
+
const isRemoteConfigSupportedPromiseSymbol = '__angularfire_symbol__remoteConfigIsSupported';
|
|
15
|
+
const isMessagingSupportedValueSymbol = '__angularfire_symbol__messagingIsSupportedValue';
|
|
16
|
+
const isMessagingSupportedPromiseSymbol = '__angularfire_symbol__messagingIsSupported';
|
|
17
|
+
globalThis[isAnalyticsSupportedPromiseSymbol] || (globalThis[isAnalyticsSupportedPromiseSymbol] = isSupported().then(it => globalThis[isAnalyticsSupportedValueSymbol] = it));
|
|
18
|
+
globalThis[isMessagingSupportedPromiseSymbol] || (globalThis[isMessagingSupportedPromiseSymbol] = isSupported$1().then(it => globalThis[isMessagingSupportedValueSymbol] = it));
|
|
19
|
+
globalThis[isRemoteConfigSupportedPromiseSymbol] || (globalThis[isRemoteConfigSupportedPromiseSymbol] = isSupported$2().then(it => globalThis[isRemoteConfigSupportedValueSymbol] = it));
|
|
20
|
+
const isSupportedError = (module) => `The APP_INITIALIZER that is "making" isSupported() sync for the sake of convenient DI has not resolved in this
|
|
21
|
+
context. Rather than injecting ${module} in the constructor, first ensure that ${module} is supported by calling
|
|
22
|
+
\`await isSupported()\`, then retrieve the instance from the injector manually \`injector.get(${module})\`.`;
|
|
23
|
+
const ɵisMessagingSupportedFactory = {
|
|
24
|
+
async: () => globalThis[isMessagingSupportedPromiseSymbol],
|
|
25
|
+
sync: () => {
|
|
26
|
+
const ret = globalThis[isMessagingSupportedValueSymbol];
|
|
27
|
+
if (ret === undefined) {
|
|
28
|
+
throw new Error(isSupportedError('Messaging'));
|
|
29
|
+
}
|
|
30
|
+
return ret;
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
const ɵisRemoteConfigSupportedFactory = {
|
|
34
|
+
async: () => globalThis[isRemoteConfigSupportedPromiseSymbol],
|
|
35
|
+
sync: () => {
|
|
36
|
+
const ret = globalThis[isRemoteConfigSupportedValueSymbol];
|
|
37
|
+
if (ret === undefined) {
|
|
38
|
+
throw new Error(isSupportedError('RemoteConfig'));
|
|
39
|
+
}
|
|
40
|
+
return ret;
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
const ɵisAnalyticsSupportedFactory = {
|
|
44
|
+
async: () => globalThis[isAnalyticsSupportedPromiseSymbol],
|
|
45
|
+
sync: () => {
|
|
46
|
+
const ret = globalThis[isAnalyticsSupportedValueSymbol];
|
|
47
|
+
if (ret === undefined) {
|
|
48
|
+
throw new Error(isSupportedError('Analytics'));
|
|
49
|
+
}
|
|
50
|
+
return ret;
|
|
51
|
+
}
|
|
52
|
+
};
|
|
8
53
|
function ɵgetDefaultInstanceOf(identifier, provided, defaultApp) {
|
|
9
54
|
if (provided) {
|
|
10
55
|
// Was provide* only called once? If so grab that
|
|
@@ -106,7 +151,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.3", ngImpor
|
|
|
106
151
|
function getSchedulers() {
|
|
107
152
|
const schedulers = globalThis.ɵAngularFireScheduler;
|
|
108
153
|
if (!schedulers) {
|
|
109
|
-
throw new Error(
|
|
154
|
+
throw new Error(`Either AngularFireModule has not been provided in your AppModule (this can be done manually or implictly using
|
|
155
|
+
provideFirebaseApp) or you're calling an AngularFire method outside of an NgModule (which is not supported).`);
|
|
110
156
|
}
|
|
111
157
|
return schedulers;
|
|
112
158
|
}
|
|
@@ -216,5 +262,5 @@ const ɵzoneWrap = (it, blockUntilFirst) => {
|
|
|
216
262
|
* Generated bundle index. Do not edit.
|
|
217
263
|
*/
|
|
218
264
|
|
|
219
|
-
export { VERSION, keepUnstableUntilFirst, observeInsideAngular, observeOutsideAngular, ɵAngularFireSchedulers, ɵZoneScheduler, ɵgetAllInstancesOf, ɵgetDefaultInstanceOf, ɵkeepUnstableUntilFirstFactory, ɵzoneWrap };
|
|
265
|
+
export { VERSION, keepUnstableUntilFirst, observeInsideAngular, observeOutsideAngular, ɵAngularFireSchedulers, ɵZoneScheduler, ɵgetAllInstancesOf, ɵgetDefaultInstanceOf, ɵisAnalyticsSupportedFactory, ɵisMessagingSupportedFactory, ɵisRemoteConfigSupportedFactory, ɵkeepUnstableUntilFirstFactory, ɵzoneWrap };
|
|
220
266
|
//# sourceMappingURL=angular-fire.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"angular-fire.js","sources":["../../../src/core.ts","../../../src/zones.ts","../../../src/angular-fire.ts"],"sourcesContent":["import { isDevMode, NgZone, Version } from '@angular/core';\nimport { FirebaseApp, getApps } from 'firebase/app';\nimport { ComponentContainer } from '@firebase/component';\n\nexport const VERSION = new Version('7.1.0-rc.5');\n\n// TODO is there a better way to get at the internal types?\ninterface FirebaseAppWithContainer extends FirebaseApp {\n container: ComponentContainer;\n}\n\nexport function ɵgetDefaultInstanceOf<T= unknown>(identifier: string, provided: T[]|undefined, defaultApp: FirebaseApp): T|undefined {\n if (provided) {\n // Was provide* only called once? If so grab that\n if (provided.length === 1) { return provided[0]; }\n const providedUsingDefaultApp = provided.filter((it: any) => it.app === defaultApp);\n // Was provide* only called once, using the default app? If so use that\n if (providedUsingDefaultApp.length === 1) { return providedUsingDefaultApp[0]; }\n }\n // Grab the default instance from the defaultApp\n const defaultAppWithContainer: FirebaseAppWithContainer = defaultApp as any;\n const provider = defaultAppWithContainer.container.getProvider(identifier as never);\n return provider.getImmediate({ optional: true });\n}\n\nexport const ɵgetAllInstancesOf = <T= unknown>(identifier: string, app?: FirebaseApp): Array<T> => {\n const apps = app ? [app] : getApps();\n const instances: Array<any> = [];\n apps.forEach((app: FirebaseAppWithContainer) => {\n const provider: any = app.container.getProvider(identifier as never);\n provider.instances.forEach((instance: any) => {\n if (!instances.includes(instance)) {\n instances.push(instance);\n }\n });\n });\n return instances;\n};\n","import { Injectable, NgZone } from '@angular/core';\nimport {\n asyncScheduler,\n Observable,\n Operator,\n queueScheduler,\n SchedulerAction,\n SchedulerLike,\n Subscriber,\n Subscription,\n TeardownLogic\n} from 'rxjs';\nimport { observeOn, subscribeOn, tap } from 'rxjs/operators';\n\nfunction noop() {\n}\n\n/**\n * Schedules tasks so that they are invoked inside the Zone that is passed in the constructor.\n */\n// tslint:disable-next-line:class-name\nexport class ɵZoneScheduler implements SchedulerLike {\n constructor(private zone: any, private delegate: any = queueScheduler) {\n }\n\n now() {\n return this.delegate.now();\n }\n\n schedule(work: (this: SchedulerAction<any>, state?: any) => void, delay?: number, state?: any): Subscription {\n const targetZone = this.zone;\n // Wrap the specified work function to make sure that if nested scheduling takes place the\n // work is executed in the correct zone\n const workInZone = function(this: SchedulerAction<any>, state: any) {\n targetZone.runGuarded(() => {\n work.apply(this, [state]);\n });\n };\n\n // Scheduling itself needs to be run in zone to ensure setInterval calls for async scheduling are done\n // inside the correct zone. This scheduler needs to schedule asynchronously always to ensure that\n // firebase emissions are never synchronous. Specifying a delay causes issues with the queueScheduler delegate.\n return this.delegate.schedule(workInZone, delay, state);\n }\n}\n\nclass BlockUntilFirstOperator<T> implements Operator<T, T> {\n private task: MacroTask | null = null;\n\n constructor(private zone: any) {\n }\n\n call(subscriber: Subscriber<T>, source: Observable<T>): TeardownLogic {\n const unscheduleTask = this.unscheduleTask.bind(this);\n this.task = this.zone.run(() => Zone.current.scheduleMacroTask('firebaseZoneBlock', noop, {}, noop, noop));\n\n return source.pipe(\n tap({ next: unscheduleTask, complete: unscheduleTask, error: unscheduleTask })\n ).subscribe(subscriber).add(unscheduleTask);\n }\n\n private unscheduleTask() {\n // maybe this is a race condition, invoke in a timeout\n // hold for 10ms while I try to figure out what is going on\n setTimeout(() => {\n if (this.task != null && this.task.state === 'scheduled') {\n this.task.invoke();\n this.task = null;\n }\n }, 10);\n }\n}\n\n@Injectable({\n providedIn: 'root',\n})\n// tslint:disable-next-line:class-name\nexport class ɵAngularFireSchedulers {\n public readonly outsideAngular: ɵZoneScheduler;\n public readonly insideAngular: ɵZoneScheduler;\n\n constructor(public ngZone: NgZone) {\n this.outsideAngular = ngZone.runOutsideAngular(() => new ɵZoneScheduler(Zone.current));\n this.insideAngular = ngZone.run(() => new ɵZoneScheduler(Zone.current, asyncScheduler));\n globalThis.ɵAngularFireScheduler ||= this;\n }\n}\n\nfunction getSchedulers() {\n const schedulers = globalThis.ɵAngularFireScheduler as ɵAngularFireSchedulers|undefined;\n if (!schedulers) { throw new Error('AngularFireModule has not been provided'); }\n return schedulers;\n}\n\nfunction runOutsideAngular<T>(fn: (...args: any[]) => T): T {\n return getSchedulers().ngZone.runOutsideAngular(() => fn());\n}\n\nfunction run<T>(fn: (...args: any[]) => T): T {\n return getSchedulers().ngZone.run(() => fn());\n}\n\nexport function observeOutsideAngular<T>(obs$: Observable<T>): Observable<T> {\n return obs$.pipe(observeOn(getSchedulers().outsideAngular));\n}\n\nexport function observeInsideAngular<T>(obs$: Observable<T>): Observable<T> {\n return obs$.pipe(observeOn(getSchedulers().insideAngular));\n}\n\nexport function keepUnstableUntilFirst<T>(obs$: Observable<T>): Observable<T> {\n const scheduler = getSchedulers();\n return ɵkeepUnstableUntilFirstFactory(getSchedulers())(obs$);\n}\n\n/**\n * Operator to block the zone until the first value has been emitted or the observable\n * has completed/errored. This is used to make sure that universal waits until the first\n * value from firebase but doesn't block the zone forever since the firebase subscription\n * is still alive.\n */\nexport function ɵkeepUnstableUntilFirstFactory(schedulers: ɵAngularFireSchedulers) {\n return function keepUnstableUntilFirst<T>(obs$: Observable<T>): Observable<T> {\n obs$ = obs$.lift(\n new BlockUntilFirstOperator(schedulers.ngZone)\n );\n\n return obs$.pipe(\n // Run the subscribe body outside of Angular (e.g. calling Firebase SDK to add a listener to a change event)\n subscribeOn(schedulers.outsideAngular),\n // Run operators inside the angular zone (e.g. side effects via tap())\n observeOn(schedulers.insideAngular)\n // INVESTIGATE https://github.com/angular/angularfire/pull/2315\n // share()\n );\n };\n}\n\nconst zoneWrapFn = (it: (...args: any[]) => any, macrotask: MacroTask|undefined) => {\n const _this = this;\n // function() is needed for the arguments object\n // tslint:disable-next-line:only-arrow-functions\n return function() {\n if (macrotask) {\n setTimeout(() => {\n if (macrotask.state === 'scheduled') {\n macrotask.invoke();\n }\n }, 10);\n }\n return run(() => it.apply(_this, arguments));\n };\n};\n\nexport const ɵzoneWrap = <T= unknown>(it: T, blockUntilFirst: boolean): T => {\n // function() is needed for the arguments object\n // tslint:disable-next-line:only-arrow-functions\n return function() {\n let macrotask: MacroTask | undefined;\n // if this is a callback function, e.g, onSnapshot, we should create a microtask and invoke it\n // only once one of the callback functions is tripped.\n for (let i = 0; i < arguments.length; i++) {\n if (typeof arguments[i] === 'function') {\n if (blockUntilFirst) {\n macrotask ||= run(() => Zone.current.scheduleMacroTask('firebaseZoneBlock', noop, {}, noop, noop));\n }\n // TODO create a microtask to track callback functions\n arguments[i] = zoneWrapFn(arguments[i], macrotask);\n }\n }\n const ret = runOutsideAngular(() => (it as any).apply(this, arguments));\n if (!blockUntilFirst) {\n if (ret instanceof Observable) {\n const schedulers = getSchedulers();\n return ret.pipe(\n subscribeOn(schedulers.outsideAngular),\n observeOn(schedulers.insideAngular),\n );\n } else {\n return run(() => ret);\n }\n }\n if (ret instanceof Observable) {\n return ret.pipe(keepUnstableUntilFirst) as any;\n } else if (ret instanceof Promise) {\n return run(() => new Promise((resolve, reject) => ret.then(it => run(() => resolve(it)), reason => run(() => reject(reason)))));\n } else if (typeof ret === 'function' && macrotask) {\n // Handle unsubscribe\n // function() is needed for the arguments object\n // tslint:disable-next-line:only-arrow-functions\n return function() {\n setTimeout(() => {\n if (macrotask && macrotask.state === 'scheduled') {\n macrotask.invoke();\n }\n }, 10);\n return ret.apply(this, arguments);\n };\n } else {\n // TODO how do we handle storage uploads in Zone? and other stuff with cancel() etc?\n return run(() => ret);\n }\n } as any;\n};\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["this"],"mappings":";;;;;;MAIa,OAAO,GAAG,IAAI,OAAO,CAAC,sBAAsB,EAAE;SAO3C,qBAAqB,CAAa,UAAkB,EAAE,QAAuB,EAAE,UAAuB;IACpH,IAAI,QAAQ,EAAE;;QAEZ,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;YAAE,OAAO,QAAQ,CAAC,CAAC,CAAC,CAAC;SAAE;QAClD,MAAM,uBAAuB,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,EAAO,KAAK,EAAE,CAAC,GAAG,KAAK,UAAU,CAAC,CAAC;;QAEpF,IAAI,uBAAuB,CAAC,MAAM,KAAK,CAAC,EAAE;YAAE,OAAO,uBAAuB,CAAC,CAAC,CAAC,CAAC;SAAE;KACjF;;IAED,MAAM,uBAAuB,GAA6B,UAAiB,CAA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cesContent":["import { Version } from '@angular/core';\nimport { FirebaseApp, getApps } from 'firebase/app';\nimport { ComponentContainer } from '@firebase/component';\nimport { isSupported as isRemoteConfigSupported } from 'firebase/remote-config';\nimport { isSupported as isMessagingSupported } from 'firebase/messaging';\nimport { isSupported as isAnalyticsSupported } from 'firebase/analytics';\n\nexport const VERSION = new Version('7.2.0-canary.390691b');\n\nconst isAnalyticsSupportedValueSymbol = '__angularfire_symbol__analyticsIsSupportedValue';\nconst isAnalyticsSupportedPromiseSymbol = '__angularfire_symbol__analyticsIsSupported';\nconst isRemoteConfigSupportedValueSymbol = '__angularfire_symbol__remoteConfigIsSupportedValue';\nconst isRemoteConfigSupportedPromiseSymbol = '__angularfire_symbol__remoteConfigIsSupported';\nconst isMessagingSupportedValueSymbol = '__angularfire_symbol__messagingIsSupportedValue';\nconst isMessagingSupportedPromiseSymbol = '__angularfire_symbol__messagingIsSupported';\n\nglobalThis[isAnalyticsSupportedPromiseSymbol] ||= isAnalyticsSupported().then(it =>\n globalThis[isAnalyticsSupportedValueSymbol] = it\n);\n\nglobalThis[isMessagingSupportedPromiseSymbol] ||= isMessagingSupported().then(it =>\n globalThis[isMessagingSupportedValueSymbol] = it\n);\n\nglobalThis[isRemoteConfigSupportedPromiseSymbol] ||= isRemoteConfigSupported().then(it =>\n globalThis[isRemoteConfigSupportedValueSymbol] = it\n);\n\nconst isSupportedError = (module: string) =>\n `The APP_INITIALIZER that is \"making\" isSupported() sync for the sake of convenient DI has not resolved in this\ncontext. Rather than injecting ${module} in the constructor, first ensure that ${module} is supported by calling\n\\`await isSupported()\\`, then retrieve the instance from the injector manually \\`injector.get(${module})\\`.`;\n\nexport const ɵisMessagingSupportedFactory = {\n async: () => globalThis[isMessagingSupportedPromiseSymbol],\n sync: () => {\n const ret = globalThis[isMessagingSupportedValueSymbol];\n if (ret === undefined) { throw new Error(isSupportedError('Messaging')); }\n return ret;\n }\n};\n\nexport const ɵisRemoteConfigSupportedFactory = {\n async: () => globalThis[isRemoteConfigSupportedPromiseSymbol],\n sync: () => {\n const ret = globalThis[isRemoteConfigSupportedValueSymbol];\n if (ret === undefined) { throw new Error(isSupportedError('RemoteConfig')); }\n return ret;\n }\n};\n\nexport const ɵisAnalyticsSupportedFactory = {\n async: () => globalThis[isAnalyticsSupportedPromiseSymbol],\n sync: () => {\n const ret = globalThis[isAnalyticsSupportedValueSymbol];\n if (ret === undefined) { throw new Error(isSupportedError('Analytics')); }\n return ret;\n }\n};\n\n// TODO is there a better way to get at the internal types?\ninterface FirebaseAppWithContainer extends FirebaseApp {\n container: ComponentContainer;\n}\n\nexport function ɵgetDefaultInstanceOf<T= unknown>(identifier: string, provided: T[]|undefined, defaultApp: FirebaseApp): T|undefined {\n if (provided) {\n // Was provide* only called once? If so grab that\n if (provided.length === 1) { return provided[0]; }\n const providedUsingDefaultApp = provided.filter((it: any) => it.app === defaultApp);\n // Was provide* only called once, using the default app? If so use that\n if (providedUsingDefaultApp.length === 1) { return providedUsingDefaultApp[0]; }\n }\n // Grab the default instance from the defaultApp\n const defaultAppWithContainer: FirebaseAppWithContainer = defaultApp as any;\n const provider = defaultAppWithContainer.container.getProvider(identifier as never);\n return provider.getImmediate({ optional: true });\n}\n\nexport const ɵgetAllInstancesOf = <T= unknown>(identifier: string, app?: FirebaseApp): Array<T> => {\n const apps = app ? [app] : getApps();\n const instances: Array<any> = [];\n apps.forEach((app: FirebaseAppWithContainer) => {\n const provider: any = app.container.getProvider(identifier as never);\n provider.instances.forEach((instance: any) => {\n if (!instances.includes(instance)) {\n instances.push(instance);\n }\n });\n });\n return instances;\n};\n","import { Injectable, NgZone } from '@angular/core';\nimport {\n asyncScheduler,\n Observable,\n Operator,\n queueScheduler,\n SchedulerAction,\n SchedulerLike,\n Subscriber,\n Subscription,\n TeardownLogic\n} from 'rxjs';\nimport { observeOn, subscribeOn, tap } from 'rxjs/operators';\n\nfunction noop() {\n}\n\n/**\n * Schedules tasks so that they are invoked inside the Zone that is passed in the constructor.\n */\n// tslint:disable-next-line:class-name\nexport class ɵZoneScheduler implements SchedulerLike {\n constructor(private zone: any, private delegate: any = queueScheduler) {\n }\n\n now() {\n return this.delegate.now();\n }\n\n schedule(work: (this: SchedulerAction<any>, state?: any) => void, delay?: number, state?: any): Subscription {\n const targetZone = this.zone;\n // Wrap the specified work function to make sure that if nested scheduling takes place the\n // work is executed in the correct zone\n const workInZone = function(this: SchedulerAction<any>, state: any) {\n targetZone.runGuarded(() => {\n work.apply(this, [state]);\n });\n };\n\n // Scheduling itself needs to be run in zone to ensure setInterval calls for async scheduling are done\n // inside the correct zone. This scheduler needs to schedule asynchronously always to ensure that\n // firebase emissions are never synchronous. Specifying a delay causes issues with the queueScheduler delegate.\n return this.delegate.schedule(workInZone, delay, state);\n }\n}\n\nclass BlockUntilFirstOperator<T> implements Operator<T, T> {\n private task: MacroTask | null = null;\n\n constructor(private zone: any) {\n }\n\n call(subscriber: Subscriber<T>, source: Observable<T>): TeardownLogic {\n const unscheduleTask = this.unscheduleTask.bind(this);\n this.task = this.zone.run(() => Zone.current.scheduleMacroTask('firebaseZoneBlock', noop, {}, noop, noop));\n\n return source.pipe(\n tap({ next: unscheduleTask, complete: unscheduleTask, error: unscheduleTask })\n ).subscribe(subscriber).add(unscheduleTask);\n }\n\n private unscheduleTask() {\n // maybe this is a race condition, invoke in a timeout\n // hold for 10ms while I try to figure out what is going on\n setTimeout(() => {\n if (this.task != null && this.task.state === 'scheduled') {\n this.task.invoke();\n this.task = null;\n }\n }, 10);\n }\n}\n\n@Injectable({\n providedIn: 'root',\n})\n// tslint:disable-next-line:class-name\nexport class ɵAngularFireSchedulers {\n public readonly outsideAngular: ɵZoneScheduler;\n public readonly insideAngular: ɵZoneScheduler;\n\n constructor(public ngZone: NgZone) {\n this.outsideAngular = ngZone.runOutsideAngular(() => new ɵZoneScheduler(Zone.current));\n this.insideAngular = ngZone.run(() => new ɵZoneScheduler(Zone.current, asyncScheduler));\n globalThis.ɵAngularFireScheduler ||= this;\n }\n}\n\nfunction getSchedulers() {\n const schedulers = globalThis.ɵAngularFireScheduler as ɵAngularFireSchedulers|undefined;\n if (!schedulers) {\n throw new Error(\n`Either AngularFireModule has not been provided in your AppModule (this can be done manually or implictly using\nprovideFirebaseApp) or you're calling an AngularFire method outside of an NgModule (which is not supported).`);\n }\n return schedulers;\n}\n\nfunction runOutsideAngular<T>(fn: (...args: any[]) => T): T {\n return getSchedulers().ngZone.runOutsideAngular(() => fn());\n}\n\nfunction run<T>(fn: (...args: any[]) => T): T {\n return getSchedulers().ngZone.run(() => fn());\n}\n\nexport function observeOutsideAngular<T>(obs$: Observable<T>): Observable<T> {\n return obs$.pipe(observeOn(getSchedulers().outsideAngular));\n}\n\nexport function observeInsideAngular<T>(obs$: Observable<T>): Observable<T> {\n return obs$.pipe(observeOn(getSchedulers().insideAngular));\n}\n\nexport function keepUnstableUntilFirst<T>(obs$: Observable<T>): Observable<T> {\n const scheduler = getSchedulers();\n return ɵkeepUnstableUntilFirstFactory(getSchedulers())(obs$);\n}\n\n/**\n * Operator to block the zone until the first value has been emitted or the observable\n * has completed/errored. This is used to make sure that universal waits until the first\n * value from firebase but doesn't block the zone forever since the firebase subscription\n * is still alive.\n */\nexport function ɵkeepUnstableUntilFirstFactory(schedulers: ɵAngularFireSchedulers) {\n return function keepUnstableUntilFirst<T>(obs$: Observable<T>): Observable<T> {\n obs$ = obs$.lift(\n new BlockUntilFirstOperator(schedulers.ngZone)\n );\n\n return obs$.pipe(\n // Run the subscribe body outside of Angular (e.g. calling Firebase SDK to add a listener to a change event)\n subscribeOn(schedulers.outsideAngular),\n // Run operators inside the angular zone (e.g. side effects via tap())\n observeOn(schedulers.insideAngular)\n // INVESTIGATE https://github.com/angular/angularfire/pull/2315\n // share()\n );\n };\n}\n\nconst zoneWrapFn = (it: (...args: any[]) => any, macrotask: MacroTask|undefined) => {\n const _this = this;\n // function() is needed for the arguments object\n // tslint:disable-next-line:only-arrow-functions\n return function() {\n if (macrotask) {\n setTimeout(() => {\n if (macrotask.state === 'scheduled') {\n macrotask.invoke();\n }\n }, 10);\n }\n return run(() => it.apply(_this, arguments));\n };\n};\n\nexport const ɵzoneWrap = <T= unknown>(it: T, blockUntilFirst: boolean): T => {\n // function() is needed for the arguments object\n // tslint:disable-next-line:only-arrow-functions\n return function() {\n let macrotask: MacroTask | undefined;\n // if this is a callback function, e.g, onSnapshot, we should create a microtask and invoke it\n // only once one of the callback functions is tripped.\n for (let i = 0; i < arguments.length; i++) {\n if (typeof arguments[i] === 'function') {\n if (blockUntilFirst) {\n macrotask ||= run(() => Zone.current.scheduleMacroTask('firebaseZoneBlock', noop, {}, noop, noop));\n }\n // TODO create a microtask to track callback functions\n arguments[i] = zoneWrapFn(arguments[i], macrotask);\n }\n }\n const ret = runOutsideAngular(() => (it as any).apply(this, arguments));\n if (!blockUntilFirst) {\n if (ret instanceof Observable) {\n const schedulers = getSchedulers();\n return ret.pipe(\n subscribeOn(schedulers.outsideAngular),\n observeOn(schedulers.insideAngular),\n );\n } else {\n return run(() => ret);\n }\n }\n if (ret instanceof Observable) {\n return ret.pipe(keepUnstableUntilFirst) as any;\n } else if (ret instanceof Promise) {\n return run(() => new Promise((resolve, reject) => ret.then(it => run(() => resolve(it)), reason => run(() => reject(reason)))));\n } else if (typeof ret === 'function' && macrotask) {\n // Handle unsubscribe\n // function() is needed for the arguments object\n // tslint:disable-next-line:only-arrow-functions\n return function() {\n setTimeout(() => {\n if (macrotask && macrotask.state === 'scheduled') {\n macrotask.invoke();\n }\n }, 10);\n return ret.apply(this, arguments);\n };\n } else {\n // TODO how do we handle storage uploads in Zone? and other stuff with cancel() etc?\n return run(() => ret);\n }\n } as any;\n};\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["isAnalyticsSupported","isMessagingSupported","isRemoteConfigSupported","this"],"mappings":";;;;;;;;;MAOa,OAAO,GAAG,IAAI,OAAO,CAAC,sBAAsB,EAAE;AAE3D,MAAM,+BAA+B,GAAG,iDAAiD,CAAC;AAC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YAAY,UAAU,EAAE;YAC7B,OAAO,GAAG,CAAC,IAAI,CAAC,sBAAsB,CAAQ,CAAC;SAChD;aAAM,IAAI,GAAG,YAAY,OAAO,EAAE;YACjC,OAAO,GAAG,CAAC,MAAM,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,KAAK,GAAG,CAAC,IAAI,CAAC,EAAE,IAAI,GAAG,CAAC,MAAM,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,IAAI,GAAG,CAAC,MAAM,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;SACjI;aAAM,IAAI,OAAO,GAAG,KAAK,UAAU,IAAI,SAAS,EAAE;;;;YAIjD,OAAO;gBACL,UAAU,CAAC;oBACT,IAAI,SAAS,IAAI,SAAS,CAAC,KAAK,KAAK,WAAW,EAAE;wBAChD,SAAS,CAAC,MAAM,EAAE,CAAC;qBACpB;iBACF,EAAE,EAAE,CAAC,CAAC;gBACP,OAAO,GAAG,CAAC,KAAK,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;aACnC,CAAC;SACH;aAAM;;YAEL,OAAO,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC;SACvB;KACK,CAAC;AACX;;AC/MA;;;;;;"}
|
|
@@ -12,4 +12,4 @@ export declare class FirestoreModule {
|
|
|
12
12
|
static ɵmod: i0.ɵɵNgModuleDeclaration<FirestoreModule, never, never, never>;
|
|
13
13
|
static ɵinj: i0.ɵɵInjectorDeclaration<FirestoreModule>;
|
|
14
14
|
}
|
|
15
|
-
export declare function provideFirestore(fn: () => FirebaseFirestore, ...deps: any[]): ModuleWithProviders<FirestoreModule>;
|
|
15
|
+
export declare function provideFirestore(fn: (injector: Injector) => FirebaseFirestore, ...deps: any[]): ModuleWithProviders<FirestoreModule>;
|
|
@@ -12,4 +12,4 @@ export declare class FirestoreModule {
|
|
|
12
12
|
static ɵmod: i0.ɵɵNgModuleDeclaration<FirestoreModule, never, never, never>;
|
|
13
13
|
static ɵinj: i0.ɵɵInjectorDeclaration<FirestoreModule>;
|
|
14
14
|
}
|
|
15
|
-
export declare function provideFirestore(fn: () => FirebaseFirestore): ModuleWithProviders<FirestoreModule>;
|
|
15
|
+
export declare function provideFirestore(fn: (injector: Injector) => FirebaseFirestore, ...deps: any[]): ModuleWithProviders<FirestoreModule>;
|
package/messaging/firebase.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export * from 'firebase/messaging';
|
|
2
|
-
import { deleteToken as _deleteToken, getMessaging as _getMessaging, getToken as _getToken,
|
|
2
|
+
import { deleteToken as _deleteToken, getMessaging as _getMessaging, getToken as _getToken, onMessage as _onMessage } from 'firebase/messaging';
|
|
3
|
+
export { isSupported } from './overrides';
|
|
3
4
|
export declare const deleteToken: typeof _deleteToken;
|
|
4
5
|
export declare const getMessaging: typeof _getMessaging;
|
|
5
6
|
export declare const getToken: typeof _getToken;
|
|
6
|
-
export declare const isSupported: typeof _isSupported;
|
|
7
7
|
export declare const onMessage: typeof _onMessage;
|
|
@@ -3,8 +3,8 @@ import { Messaging as FirebaseMessaging } from 'firebase/messaging';
|
|
|
3
3
|
import { Messaging } from './messaging';
|
|
4
4
|
import { FirebaseApp } from '@angular/fire/app';
|
|
5
5
|
import * as i0 from "@angular/core";
|
|
6
|
-
export declare function defaultMessagingInstanceFactory(
|
|
7
|
-
export declare function messagingInstanceFactory(fn: (injector: Injector) => FirebaseMessaging): (zone: NgZone,
|
|
6
|
+
export declare function defaultMessagingInstanceFactory(provided: FirebaseMessaging[] | undefined, defaultApp: FirebaseApp): Messaging;
|
|
7
|
+
export declare function messagingInstanceFactory(fn: (injector: Injector) => FirebaseMessaging): (zone: NgZone, injector: Injector) => Messaging;
|
|
8
8
|
export declare class MessagingModule {
|
|
9
9
|
constructor();
|
|
10
10
|
static ɵfac: i0.ɵɵFactoryDeclaration<MessagingModule, never>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const isSupported: () => any;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "../node_modules/ng-packagr/package.schema.json",
|
|
3
3
|
"name": "@angular/fire",
|
|
4
|
-
"version": "7.
|
|
4
|
+
"version": "7.2.0-canary.390691b",
|
|
5
5
|
"description": "The official Angular library for Firebase.",
|
|
6
6
|
"schematics": "./schematics/collection.json",
|
|
7
7
|
"builders": "./schematics/builders.json",
|
|
@@ -23,16 +23,13 @@
|
|
|
23
23
|
"author": "angular,firebase",
|
|
24
24
|
"license": "MIT",
|
|
25
25
|
"peerDependencies": {
|
|
26
|
-
"@angular/common": "^12.0.0",
|
|
27
|
-
"@angular/core": "^12.0.0",
|
|
28
|
-
"@angular/platform-browser": "^12.0.0",
|
|
29
|
-
"@angular/platform-browser-dynamic": "^12.0.0",
|
|
30
|
-
"
|
|
31
|
-
"@angular-devkit/architect": "> 0.1200.0 < 0.1300.0",
|
|
32
|
-
"@schematics/angular": "^12.0.0",
|
|
33
|
-
"firebase": "^9.0.0",
|
|
26
|
+
"@angular/common": "^12.0.0 || ^13.0.0",
|
|
27
|
+
"@angular/core": "^12.0.0 || ^13.0.0",
|
|
28
|
+
"@angular/platform-browser": "^12.0.0 || ^13.0.0",
|
|
29
|
+
"@angular/platform-browser-dynamic": "^12.0.0 || ^13.0.0",
|
|
30
|
+
"firebase": "^9.4.0",
|
|
34
31
|
"rxfire": "^6.0.0",
|
|
35
|
-
"rxjs": "~6.6.0",
|
|
32
|
+
"rxjs": "~6.6.0 || ^7.0.0",
|
|
36
33
|
"firebase-tools": "^9.9.0"
|
|
37
34
|
},
|
|
38
35
|
"peerDependenciesMeta": {
|
|
@@ -41,6 +38,8 @@
|
|
|
41
38
|
}
|
|
42
39
|
},
|
|
43
40
|
"dependencies": {
|
|
41
|
+
"@angular-devkit/schematics": "^12.0.0 || ^13.0.0",
|
|
42
|
+
"@schematics/angular": "^12.0.0 || ^13.0.0",
|
|
44
43
|
"tslib": "^2.0.0",
|
|
45
44
|
"fuzzy": "^0.1.3",
|
|
46
45
|
"inquirer-autocomplete-prompt": "^1.0.1",
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export * from 'firebase/remote-config';
|
|
2
|
-
import { activate as _activate, ensureInitialized as _ensureInitialized, fetchAndActivate as _fetchAndActivate, fetchConfig as _fetchConfig, getAll as _getAll, getBoolean as _getBoolean, getNumber as _getNumber, getRemoteConfig as _getRemoteConfig, getString as _getString, getValue as _getValue,
|
|
2
|
+
import { activate as _activate, ensureInitialized as _ensureInitialized, fetchAndActivate as _fetchAndActivate, fetchConfig as _fetchConfig, getAll as _getAll, getBoolean as _getBoolean, getNumber as _getNumber, getRemoteConfig as _getRemoteConfig, getString as _getString, getValue as _getValue, setLogLevel as _setLogLevel } from 'firebase/remote-config';
|
|
3
|
+
export { isSupported } from './overrides';
|
|
3
4
|
export declare const activate: typeof _activate;
|
|
4
5
|
export declare const ensureInitialized: typeof _ensureInitialized;
|
|
5
6
|
export declare const fetchAndActivate: typeof _fetchAndActivate;
|
|
@@ -10,5 +11,4 @@ export declare const getNumber: typeof _getNumber;
|
|
|
10
11
|
export declare const getRemoteConfig: typeof _getRemoteConfig;
|
|
11
12
|
export declare const getString: typeof _getString;
|
|
12
13
|
export declare const getValue: typeof _getValue;
|
|
13
|
-
export declare const isSupported: typeof _isSupported;
|
|
14
14
|
export declare const setLogLevel: typeof _setLogLevel;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const isSupported: () => any;
|
|
@@ -4,8 +4,8 @@ import { RemoteConfig } from './remote-config';
|
|
|
4
4
|
import { FirebaseApp } from '@angular/fire/app';
|
|
5
5
|
import * as i0 from "@angular/core";
|
|
6
6
|
export declare const PROVIDED_REMOTE_CONFIG_INSTANCES: InjectionToken<RemoteConfig[]>;
|
|
7
|
-
export declare function defaultRemoteConfigInstanceFactory(
|
|
8
|
-
export declare function remoteConfigInstanceFactory(fn: (injector: Injector) => FirebaseRemoteConfig): (zone: NgZone,
|
|
7
|
+
export declare function defaultRemoteConfigInstanceFactory(provided: FirebaseRemoteConfig[] | undefined, defaultApp: FirebaseApp): RemoteConfig;
|
|
8
|
+
export declare function remoteConfigInstanceFactory(fn: (injector: Injector) => FirebaseRemoteConfig): (zone: NgZone, injector: Injector) => RemoteConfig;
|
|
9
9
|
export declare class RemoteConfigModule {
|
|
10
10
|
constructor();
|
|
11
11
|
static ɵfac: i0.ɵɵFactoryDeclaration<RemoteConfigModule, never>;
|
|
@@ -120,6 +120,7 @@ const defaultFsHost = {
|
|
|
120
120
|
renameSync: fs_1.renameSync,
|
|
121
121
|
copySync: fs_extra_1.copySync,
|
|
122
122
|
removeSync: fs_extra_1.removeSync,
|
|
123
|
+
existsSync: fs_1.existsSync,
|
|
123
124
|
};
|
|
124
125
|
const findPackageVersion = (packageManager, name) => {
|
|
125
126
|
const match = child_process_1.execSync(`${packageManager} list ${name}`).toString().match(`[^|\s]${escapeRegExp(name)}[@| ][^\s]+(\s.+)?$`);
|
|
@@ -170,12 +171,12 @@ const deployToFunction = (firebaseTools, context, workspaceRoot, staticBuildTarg
|
|
|
170
171
|
if (!serverBuildOptions.outputPath || typeof serverBuildOptions.outputPath !== 'string') {
|
|
171
172
|
throw new Error(`Cannot read the output path option of the Angular project '${serverBuildTarget.name}' in angular.json`);
|
|
172
173
|
}
|
|
173
|
-
const staticOut = staticBuildOptions.outputPath;
|
|
174
|
-
const serverOut = serverBuildOptions.outputPath;
|
|
175
|
-
const functionsOut = options.outputPath
|
|
174
|
+
const staticOut = path_1.join(workspaceRoot, staticBuildOptions.outputPath);
|
|
175
|
+
const serverOut = path_1.join(workspaceRoot, serverBuildOptions.outputPath);
|
|
176
|
+
const functionsOut = options.outputPath ? path_1.join(workspaceRoot, options.outputPath) : path_1.dirname(serverOut);
|
|
176
177
|
const functionName = options.functionName || functions_templates_1.DEFAULT_FUNCTION_NAME;
|
|
177
|
-
const newStaticOut = path_1.join(functionsOut,
|
|
178
|
-
const newServerOut = path_1.join(functionsOut,
|
|
178
|
+
const newStaticOut = path_1.join(functionsOut, staticBuildOptions.outputPath);
|
|
179
|
+
const newServerOut = path_1.join(functionsOut, serverBuildOptions.outputPath);
|
|
179
180
|
if (options.outputPath) {
|
|
180
181
|
fsHost.removeSync(functionsOut);
|
|
181
182
|
fsHost.copySync(staticOut, newStaticOut);
|
|
@@ -190,8 +191,9 @@ const deployToFunction = (firebaseTools, context, workspaceRoot, staticBuildTarg
|
|
|
190
191
|
if (!semver_1.satisfies(process.versions.node, nodeVersion.toString())) {
|
|
191
192
|
context.logger.warn(`⚠️ Your Node.js version (${process.versions.node}) does not match the Firebase Functions runtime (${nodeVersion}).`);
|
|
192
193
|
}
|
|
193
|
-
|
|
194
|
-
fsHost.writeFileSync(
|
|
194
|
+
const functionsPackageJsonPath = path_1.join(functionsOut, 'package.json');
|
|
195
|
+
fsHost.writeFileSync(functionsPackageJsonPath, JSON.stringify(packageJson, null, 2));
|
|
196
|
+
fsHost.writeFileSync(path_1.join(functionsOut, 'index.js'), functions_templates_1.defaultFunction(serverBuildOptions.outputPath, options, functionName));
|
|
195
197
|
if (!options.prerender) {
|
|
196
198
|
try {
|
|
197
199
|
fsHost.renameSync(path_1.join(newStaticOut, 'index.html'), path_1.join(newStaticOut, 'index.original.html'));
|
|
@@ -199,6 +201,12 @@ const deployToFunction = (firebaseTools, context, workspaceRoot, staticBuildTarg
|
|
|
199
201
|
catch (e) { }
|
|
200
202
|
}
|
|
201
203
|
const siteTarget = (_b = options.target) !== null && _b !== void 0 ? _b : context.target.project;
|
|
204
|
+
if (fsHost.existsSync(functionsPackageJsonPath)) {
|
|
205
|
+
child_process_1.execSync(`npm --prefix ${functionsOut} install`);
|
|
206
|
+
}
|
|
207
|
+
else {
|
|
208
|
+
console.error(`No package.json exists at ${functionsOut}`);
|
|
209
|
+
}
|
|
202
210
|
if (options.preview) {
|
|
203
211
|
yield firebaseTools.serve({
|
|
204
212
|
port: DEFAULT_EMULATOR_PORT,
|
|
@@ -235,16 +243,16 @@ const deployToCloudRun = (firebaseTools, context, workspaceRoot, staticBuildTarg
|
|
|
235
243
|
if (!serverBuildOptions.outputPath || typeof serverBuildOptions.outputPath !== 'string') {
|
|
236
244
|
throw new Error(`Cannot read the output path option of the Angular project '${serverBuildTarget.name}' in angular.json`);
|
|
237
245
|
}
|
|
238
|
-
const staticOut = staticBuildOptions.outputPath;
|
|
239
|
-
const serverOut = serverBuildOptions.outputPath;
|
|
240
|
-
const cloudRunOut = options.outputPath
|
|
246
|
+
const staticOut = path_1.join(workspaceRoot, staticBuildOptions.outputPath);
|
|
247
|
+
const serverOut = path_1.join(workspaceRoot, serverBuildOptions.outputPath);
|
|
248
|
+
const cloudRunOut = options.outputPath ? path_1.join(workspaceRoot, options.outputPath) : path_1.join(path_1.dirname(serverOut), 'run');
|
|
241
249
|
const serviceId = options.functionName || functions_templates_1.DEFAULT_FUNCTION_NAME;
|
|
242
|
-
const newStaticOut = path_1.join(cloudRunOut,
|
|
243
|
-
const newServerOut = path_1.join(cloudRunOut,
|
|
250
|
+
const newStaticOut = path_1.join(cloudRunOut, staticBuildOptions.outputPath);
|
|
251
|
+
const newServerOut = path_1.join(cloudRunOut, serverBuildOptions.outputPath);
|
|
244
252
|
fsHost.removeSync(cloudRunOut);
|
|
245
253
|
fsHost.copySync(staticOut, newStaticOut);
|
|
246
254
|
fsHost.copySync(serverOut, newServerOut);
|
|
247
|
-
const packageJson = getPackageJson(context, workspaceRoot, options, path_1.join(
|
|
255
|
+
const packageJson = getPackageJson(context, workspaceRoot, options, path_1.join(serverBuildOptions.outputPath, 'main.js'));
|
|
248
256
|
const nodeVersion = packageJson.engines.node;
|
|
249
257
|
if (!semver_1.satisfies(process.versions.node, nodeVersion.toString())) {
|
|
250
258
|
context.logger.warn(`⚠️ Your Node.js version (${process.versions.node}) does not match the Cloud Run runtime (${nodeVersion}).`);
|
|
@@ -1,4 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
+
if (mod && mod.__esModule) return mod;
|
|
16
|
+
var result = {};
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
+
__setModuleDefault(result, mod);
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
2
21
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
22
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
23
|
};
|
|
@@ -6,6 +25,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
25
|
exports.getFirebaseTools = void 0;
|
|
7
26
|
const child_process_1 = require("child_process");
|
|
8
27
|
const ora_1 = __importDefault(require("ora"));
|
|
28
|
+
const semver = __importStar(require("semver"));
|
|
9
29
|
const getFirebaseTools = () => globalThis.firebaseTools ?
|
|
10
30
|
Promise.resolve(globalThis.firebaseTools) :
|
|
11
31
|
new Promise((resolve, reject) => {
|
|
@@ -43,8 +63,8 @@ const getFirebaseTools = () => globalThis.firebaseTools ?
|
|
|
43
63
|
globalThis.firebaseTools = firebaseTools;
|
|
44
64
|
const version = firebaseTools.cli.version();
|
|
45
65
|
console.log(`Using firebase-tools version ${version}`);
|
|
46
|
-
if (
|
|
47
|
-
console.error('firebase-tools version 9.9+ is required, please upgrade');
|
|
66
|
+
if (semver.compare(version, '9.9.0') === -1) {
|
|
67
|
+
console.error('firebase-tools version 9.9+ is required, please upgrade and run again');
|
|
48
68
|
return Promise.reject();
|
|
49
69
|
}
|
|
50
70
|
return firebaseTools;
|
|
@@ -10,6 +10,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.ngAddSetupProject = exports.setupProject = void 0;
|
|
13
|
+
const core_1 = require("@angular-devkit/core");
|
|
13
14
|
const schematics_1 = require("@angular-devkit/schematics");
|
|
14
15
|
const utils_1 = require("../utils");
|
|
15
16
|
const prompts_1 = require("./prompts");
|
|
@@ -19,9 +20,10 @@ const firebaseTools_1 = require("../firebaseTools");
|
|
|
19
20
|
const fs_1 = require("fs");
|
|
20
21
|
const path_1 = require("path");
|
|
21
22
|
const setupProject = (tree, context, features, config) => __awaiter(void 0, void 0, void 0, function* () {
|
|
23
|
+
var _a;
|
|
22
24
|
const { path: workspacePath, workspace } = utils_1.getWorkspace(tree);
|
|
23
25
|
const { project, projectName } = utils_1.getProject(config, tree);
|
|
24
|
-
const sourcePath =
|
|
26
|
+
const sourcePath = (_a = project.sourceRoot) !== null && _a !== void 0 ? _a : project.root;
|
|
25
27
|
utils_1.addIgnoreFiles(tree);
|
|
26
28
|
const featuresToImport = features.filter(it => it !== 0);
|
|
27
29
|
if (featuresToImport.length > 0) {
|
|
@@ -82,10 +84,16 @@ ${Object.entries(config.sdkConfig).reduce((c, [k, v]) => c.concat(` ${k}: '${
|
|
|
82
84
|
default: throw (new schematics_1.SchematicsException(`Unimplemented PROJECT_TYPE ${config.projectType}`));
|
|
83
85
|
}
|
|
84
86
|
}
|
|
87
|
+
else {
|
|
88
|
+
return Promise.resolve();
|
|
89
|
+
}
|
|
85
90
|
});
|
|
86
91
|
exports.setupProject = setupProject;
|
|
87
92
|
const ngAddSetupProject = (options) => (host, context) => __awaiter(void 0, void 0, void 0, function* () {
|
|
88
|
-
|
|
93
|
+
let projectRoot = host._backend._root;
|
|
94
|
+
if (process.platform.startsWith('win32')) {
|
|
95
|
+
projectRoot = core_1.asWindowsPath(core_1.normalize(projectRoot));
|
|
96
|
+
}
|
|
89
97
|
const features = yield prompts_1.featuresPrompt();
|
|
90
98
|
if (features.length > 0) {
|
|
91
99
|
const firebaseTools = yield firebaseTools_1.getFirebaseTools();
|
|
@@ -96,7 +104,7 @@ const ngAddSetupProject = (options) => (host, context) => __awaiter(void 0, void
|
|
|
96
104
|
yield firebaseTools.login.use(user.email, { projectRoot });
|
|
97
105
|
const { project: ngProject, projectName: ngProjectName } = utils_1.getProject(options, host);
|
|
98
106
|
const [defaultProjectName] = utils_1.getFirebaseProjectNameFromHost(host, ngProjectName);
|
|
99
|
-
const firebaseProject = yield prompts_1.projectPrompt(defaultProjectName, { projectRoot });
|
|
107
|
+
const firebaseProject = yield prompts_1.projectPrompt(defaultProjectName, { projectRoot, account: user.email });
|
|
100
108
|
let hosting = { projectType: 0, prerender: false };
|
|
101
109
|
let firebaseHostingSite;
|
|
102
110
|
if (features.includes(0)) {
|
|
@@ -184,7 +184,7 @@ const projectPrompt = (defaultProject, options) => __awaiter(void 0, void 0, voi
|
|
|
184
184
|
message: 'What would you like to call your project?',
|
|
185
185
|
default: projectId,
|
|
186
186
|
});
|
|
187
|
-
return yield firebaseTools.projects.create(projectId,
|
|
187
|
+
return yield firebaseTools.projects.create(projectId, { account: options.account, displayName, nonInteractive: true });
|
|
188
188
|
}
|
|
189
189
|
return (yield projects).find(it => it.projectId === projectId);
|
|
190
190
|
});
|
package/schematics/utils.js
CHANGED
|
@@ -155,7 +155,7 @@ function addToNgModule(host, options) {
|
|
|
155
155
|
}
|
|
156
156
|
if (options.features.includes(2) &&
|
|
157
157
|
!ast_utils_1.findNode(source, typescript_1.default.SyntaxKind.Identifier, 'provideAnalytics')) {
|
|
158
|
-
changes.push(ast_utils_1.insertImport(source, modulePath, ['provideAnalytics', 'getAnalytics', 'ScreenTrackingService', 'UserTrackingService'], '@angular/fire/analytics'), ...ast_utils_1.addImportToModule(source, modulePath, `provideAnalytics(() => getAnalytics())`, null), ...ast_utils_1.addProviderToModule(source, modulePath,
|
|
158
|
+
changes.push(ast_utils_1.insertImport(source, modulePath, ['provideAnalytics', 'getAnalytics', 'ScreenTrackingService', 'UserTrackingService'], '@angular/fire/analytics'), ...ast_utils_1.addImportToModule(source, modulePath, `provideAnalytics(() => getAnalytics())`, null), ...ast_utils_1.addProviderToModule(source, modulePath, ['ScreenTrackingService', 'UserTrackingService'], null));
|
|
159
159
|
}
|
|
160
160
|
if (options.features.includes(1) &&
|
|
161
161
|
!ast_utils_1.findNode(source, typescript_1.default.SyntaxKind.Identifier, 'provideAuth')) {
|