@angular/fire 17.1.0 → 18.0.0-canary.bfc27e2
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 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/vertexai-preview/angular-fire-vertexai-preview.ts", "../../../src/vertexai-preview/public_api.ts", "../../../src/vertexai-preview/vertexai.ts", "../../../src/vertexai-preview/vertexai.module.ts", "../../../src/vertexai-preview/firebase.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n", "export { VertexAI, VertexAIInstances, vertexAIInstance$ } from './vertexai';\nexport { provideVertexAI, VertexAIModule } from './vertexai.module';\nexport * from './firebase';\n", "import { ɵgetAllInstancesOf } from '@angular/fire';\nimport { VertexAI as FirebaseVertexAI } from 'firebase/vertexai-preview';\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// eslint-disable-next-line @typescript-eslint/no-empty-interface\nexport interface VertexAI extends FirebaseVertexAI {}\n\nexport class VertexAI {\n constructor(vertexai: FirebaseVertexAI) {\n return vertexai;\n }\n}\n\nexport const VERTEX_AI_PROVIDER_NAME = 'vertexai';\n\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\nexport interface VertexAIInstances extends Array<FirebaseVertexAI> {}\n\nexport class VertexAIInstances {\n constructor() {\n return ɵgetAllInstancesOf<FirebaseVertexAI>(VERTEX_AI_PROVIDER_NAME);\n }\n}\n\nexport const vertexAIInstance$ = timer(0, 300).pipe(\n concatMap(() => from(ɵgetAllInstancesOf<FirebaseVertexAI>(VERTEX_AI_PROVIDER_NAME))),\n distinct(),\n);\n", "import {\n EnvironmentProviders,\n InjectionToken,\n Injector,\n NgModule,\n NgZone,\n Optional,\n makeEnvironmentProviders,\n} from '@angular/core';\nimport { VERSION, ɵAngularFireSchedulers, ɵgetDefaultInstanceOf } from '@angular/fire';\nimport { ɵAppCheckInstances } from '@angular/fire';\nimport { FirebaseApp, FirebaseApps } from '@angular/fire/app';\nimport { registerVersion } from 'firebase/app';\nimport { VertexAI as FirebaseVertexAI } from 'firebase/vertexai-preview';\nimport { VERTEX_AI_PROVIDER_NAME, VertexAI, VertexAIInstances } from './vertexai';\n\nexport const PROVIDED_VERTEX_AI_INSTANCES = new InjectionToken<VertexAI[]>('angularfire2.vertexai-instances');\n\nexport function defaultVertexAIInstanceFactory(provided: FirebaseVertexAI[]|undefined, defaultApp: FirebaseApp) {\n const defaultVertexAI = ɵgetDefaultInstanceOf<FirebaseVertexAI>(VERTEX_AI_PROVIDER_NAME, provided, defaultApp);\n return defaultVertexAI && new VertexAI(defaultVertexAI);\n}\n\nexport function vertexAIInstanceFactory(fn: (injector: Injector) => FirebaseVertexAI) {\n return (zone: NgZone, injector: Injector) => {\n const vertexAI = zone.runOutsideAngular(() => fn(injector));\n return new VertexAI(vertexAI);\n };\n}\n\nconst VERTEX_AI_INSTANCES_PROVIDER = {\n provide: VertexAIInstances,\n deps: [\n [new Optional(), PROVIDED_VERTEX_AI_INSTANCES ],\n ]\n};\n\nconst DEFAULT_VERTEX_AI_INSTANCE_PROVIDER = {\n provide: VertexAI,\n useFactory: defaultVertexAIInstanceFactory,\n deps: [\n [new Optional(), PROVIDED_VERTEX_AI_INSTANCES ],\n FirebaseApp,\n ]\n};\n\n@NgModule({\n providers: [\n DEFAULT_VERTEX_AI_INSTANCE_PROVIDER,\n VERTEX_AI_INSTANCES_PROVIDER,\n ]\n})\nexport class VertexAIModule {\n constructor() {\n registerVersion('angularfire', VERSION.full, 'vertexai');\n }\n}\n\nexport function provideVertexAI(fn: (injector: Injector) => FirebaseVertexAI, ...deps: any[]): EnvironmentProviders {\n registerVersion('angularfire', VERSION.full, 'vertexai');\n\n return makeEnvironmentProviders([\n DEFAULT_VERTEX_AI_INSTANCE_PROVIDER,\n VERTEX_AI_INSTANCES_PROVIDER,\n {\n provide: PROVIDED_VERTEX_AI_INSTANCES,\n useFactory: vertexAIInstanceFactory(fn),\n multi: true,\n deps: [\n NgZone,\n Injector,\n ɵAngularFireSchedulers,\n FirebaseApps,\n [new Optional(), ɵAppCheckInstances ],\n ...deps,\n ]\n }\n ]);\n}\n", "// DO NOT MODIFY, this file is autogenerated by tools/build.ts\nexport * from 'firebase/vertexai-preview';\nimport { ɵzoneWrap } from '@angular/fire';\nimport {\n getVertexAI as _getVertexAI,\n getGenerativeModel as _getGenerativeModel\n} from 'firebase/vertexai-preview';\n\nexport const getVertexAI = ɵzoneWrap(_getVertexAI, true);\nexport const getGenerativeModel = ɵzoneWrap(_getGenerativeModel, true);\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;ACAA;;;;;;;;;;;;ACAA,SAAS,0BAA0B;AAEnC,SAAS,MAAM,aAAa;AAC5B,SAAS,WAAW,gBAAgB;AAM9B,IAAO,WAAP,MAAe;EACnB,YAAY,UAA0B;AACpC,WAAO;EACT;;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Q,MAAM,UAAU;AAEvD,SAAO,yBAAyB;IAC9B;IACA;IACA;MACE,SAAS;MACT,YAAY,wBAAwB,EAAE;MACtC,OAAO;MACP,MAAM;QACJ;QACA;QACA;QACA;QACA,CAAC,IAAI,SAAQ,GAAI,kBAAkB;QACnC,GAAG;;;GAGR;AACH;;;AC9EA;;;;;AACA;uCAAc;AACd,SAAS,iBAAiB;AAC1B,SACE,eAAe,cACf,sBAAsB,2BACjB;AAEA,IAAM,cAAc,UAAU,cAAc,IAAI;AAChD,IAAM,qBAAqB,UAAU,qBAAqB,IAAI;;;AHPrE,+BAAc;;;ADEd,kDAAc;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,243 +1,213 @@
|
|
|
1
|
-
|
|
2
|
-
import { Version
|
|
3
|
-
import { getApps } from
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const VERSION = new Version('ANGULARFIRE2_VERSION');
|
|
8
|
-
const ɵisSupportedError = (module) => `The APP_INITIALIZER that is "making" isSupported() sync for the sake of convenient DI has not resolved in this
|
|
1
|
+
// core.mjs
|
|
2
|
+
import { Version } from "@angular/core";
|
|
3
|
+
import { getApps } from "firebase/app";
|
|
4
|
+
var VERSION = new Version("ANGULARFIRE2_VERSION");
|
|
5
|
+
var ɵisSupportedError = (module) => `The APP_INITIALIZER that is "making" isSupported() sync for the sake of convenient DI has not resolved in this
|
|
9
6
|
context. Rather than injecting ${module} in the constructor, first ensure that ${module} is supported by calling
|
|
10
7
|
\`await isSupported()\`, then retrieve the instance from the injector manually \`injector.get(${module})\`.`;
|
|
11
8
|
function ɵgetDefaultInstanceOf(identifier, provided, defaultApp) {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
return provided[0];
|
|
16
|
-
}
|
|
17
|
-
const providedUsingDefaultApp = provided.filter((it) => it.app === defaultApp);
|
|
18
|
-
// Was provide* only called once, using the default app? If so use that
|
|
19
|
-
if (providedUsingDefaultApp.length === 1) {
|
|
20
|
-
return providedUsingDefaultApp[0];
|
|
21
|
-
}
|
|
9
|
+
if (provided) {
|
|
10
|
+
if (provided.length === 1) {
|
|
11
|
+
return provided[0];
|
|
22
12
|
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
13
|
+
const providedUsingDefaultApp = provided.filter((it) => it.app === defaultApp);
|
|
14
|
+
if (providedUsingDefaultApp.length === 1) {
|
|
15
|
+
return providedUsingDefaultApp[0];
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
const defaultAppWithContainer = defaultApp;
|
|
19
|
+
const provider = defaultAppWithContainer.container.getProvider(identifier);
|
|
20
|
+
return provider.getImmediate({ optional: true });
|
|
27
21
|
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
});
|
|
22
|
+
var ɵgetAllInstancesOf = (identifier, app) => {
|
|
23
|
+
const apps = app ? [app] : getApps();
|
|
24
|
+
const instances = [];
|
|
25
|
+
apps.forEach((app2) => {
|
|
26
|
+
const provider = app2.container.getProvider(identifier);
|
|
27
|
+
provider.instances.forEach((instance) => {
|
|
28
|
+
if (!instances.includes(instance)) {
|
|
29
|
+
instances.push(instance);
|
|
30
|
+
}
|
|
38
31
|
});
|
|
39
|
-
|
|
32
|
+
});
|
|
33
|
+
return instances;
|
|
40
34
|
};
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}
|
|
46
|
-
|
|
35
|
+
var ɵAppCheckInstances = class {
|
|
36
|
+
constructor() {
|
|
37
|
+
return ɵgetAllInstancesOf(ɵAPP_CHECK_PROVIDER_NAME);
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
var ɵAPP_CHECK_PROVIDER_NAME = "app-check";
|
|
47
41
|
|
|
48
|
-
|
|
49
|
-
|
|
42
|
+
// zones.mjs
|
|
43
|
+
import { Injectable, NgZone } from "@angular/core";
|
|
44
|
+
import { Observable, asyncScheduler, queueScheduler } from "rxjs";
|
|
45
|
+
import { observeOn, subscribeOn, tap } from "rxjs/operators";
|
|
46
|
+
import * as i0 from "@angular/core";
|
|
50
47
|
function noop() {
|
|
51
48
|
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
zone;
|
|
57
|
-
delegate;
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
zone;
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
// @ts-ignore
|
|
113
|
-
this.insideAngular = ngZone.run(() => new ɵZoneScheduler(Zone.current, asyncScheduler));
|
|
114
|
-
globalThis.ɵAngularFireScheduler ||= this;
|
|
115
|
-
}
|
|
116
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.6", ngImport: i0, type: ɵAngularFireSchedulers, deps: [{ token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
117
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.6", ngImport: i0, type: ɵAngularFireSchedulers, providedIn: 'root' });
|
|
118
|
-
}
|
|
119
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.6", ngImport: i0, type: ɵAngularFireSchedulers, decorators: [{
|
|
120
|
-
type: Injectable,
|
|
121
|
-
args: [{
|
|
122
|
-
providedIn: 'root',
|
|
123
|
-
}]
|
|
124
|
-
}], ctorParameters: () => [{ type: i0.NgZone }] });
|
|
49
|
+
var ɵZoneScheduler = class {
|
|
50
|
+
zone;
|
|
51
|
+
delegate;
|
|
52
|
+
constructor(zone, delegate = queueScheduler) {
|
|
53
|
+
this.zone = zone;
|
|
54
|
+
this.delegate = delegate;
|
|
55
|
+
}
|
|
56
|
+
now() {
|
|
57
|
+
return this.delegate.now();
|
|
58
|
+
}
|
|
59
|
+
schedule(work, delay, state) {
|
|
60
|
+
const targetZone = this.zone;
|
|
61
|
+
const workInZone = function(state2) {
|
|
62
|
+
targetZone.runGuarded(() => {
|
|
63
|
+
work.apply(this, [state2]);
|
|
64
|
+
});
|
|
65
|
+
};
|
|
66
|
+
return this.delegate.schedule(workInZone, delay, state);
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
var BlockUntilFirstOperator = class {
|
|
70
|
+
zone;
|
|
71
|
+
// @ts-ignore
|
|
72
|
+
task = null;
|
|
73
|
+
constructor(zone) {
|
|
74
|
+
this.zone = zone;
|
|
75
|
+
}
|
|
76
|
+
call(subscriber, source) {
|
|
77
|
+
const unscheduleTask = this.unscheduleTask.bind(this);
|
|
78
|
+
this.task = this.zone.run(() => Zone.current.scheduleMacroTask("firebaseZoneBlock", noop, {}, noop, noop));
|
|
79
|
+
return source.pipe(tap({ next: unscheduleTask, complete: unscheduleTask, error: unscheduleTask })).subscribe(subscriber).add(unscheduleTask);
|
|
80
|
+
}
|
|
81
|
+
unscheduleTask() {
|
|
82
|
+
setTimeout(() => {
|
|
83
|
+
if (this.task != null && this.task.state === "scheduled") {
|
|
84
|
+
this.task.invoke();
|
|
85
|
+
this.task = null;
|
|
86
|
+
}
|
|
87
|
+
}, 10);
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
var ɵAngularFireSchedulers = class _ɵAngularFireSchedulers {
|
|
91
|
+
ngZone;
|
|
92
|
+
outsideAngular;
|
|
93
|
+
insideAngular;
|
|
94
|
+
constructor(ngZone) {
|
|
95
|
+
this.ngZone = ngZone;
|
|
96
|
+
this.outsideAngular = ngZone.runOutsideAngular(() => new ɵZoneScheduler(Zone.current));
|
|
97
|
+
this.insideAngular = ngZone.run(() => new ɵZoneScheduler(Zone.current, asyncScheduler));
|
|
98
|
+
globalThis.ɵAngularFireScheduler ||= this;
|
|
99
|
+
}
|
|
100
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-rc.3", ngImport: i0, type: _ɵAngularFireSchedulers, deps: [{ token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
101
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-rc.3", ngImport: i0, type: _ɵAngularFireSchedulers, providedIn: "root" });
|
|
102
|
+
};
|
|
103
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-rc.3", ngImport: i0, type: ɵAngularFireSchedulers, decorators: [{
|
|
104
|
+
type: Injectable,
|
|
105
|
+
args: [{
|
|
106
|
+
providedIn: "root"
|
|
107
|
+
}]
|
|
108
|
+
}], ctorParameters: () => [{ type: i0.NgZone }] });
|
|
125
109
|
function getSchedulers() {
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
110
|
+
const schedulers = globalThis.ɵAngularFireScheduler;
|
|
111
|
+
if (!schedulers) {
|
|
112
|
+
throw new Error(`Either AngularFireModule has not been provided in your AppModule (this can be done manually or implictly using
|
|
129
113
|
provideFirebaseApp) or you're calling an AngularFire method outside of an NgModule (which is not supported).`);
|
|
130
|
-
|
|
131
|
-
|
|
114
|
+
}
|
|
115
|
+
return schedulers;
|
|
132
116
|
}
|
|
133
117
|
function runOutsideAngular(fn) {
|
|
134
|
-
|
|
118
|
+
return getSchedulers().ngZone.runOutsideAngular(() => fn());
|
|
135
119
|
}
|
|
136
120
|
function run(fn) {
|
|
137
|
-
|
|
121
|
+
return getSchedulers().ngZone.run(() => fn());
|
|
138
122
|
}
|
|
139
123
|
function observeOutsideAngular(obs$) {
|
|
140
|
-
|
|
124
|
+
return obs$.pipe(observeOn(getSchedulers().outsideAngular));
|
|
141
125
|
}
|
|
142
126
|
function observeInsideAngular(obs$) {
|
|
143
|
-
|
|
127
|
+
return obs$.pipe(observeOn(getSchedulers().insideAngular));
|
|
144
128
|
}
|
|
145
129
|
function keepUnstableUntilFirst(obs$) {
|
|
146
|
-
|
|
130
|
+
return ɵkeepUnstableUntilFirstFactory(getSchedulers())(obs$);
|
|
147
131
|
}
|
|
148
|
-
/**
|
|
149
|
-
* Operator to block the zone until the first value has been emitted or the observable
|
|
150
|
-
* has completed/errored. This is used to make sure that universal waits until the first
|
|
151
|
-
* value from firebase but doesn't block the zone forever since the firebase subscription
|
|
152
|
-
* is still alive.
|
|
153
|
-
*/
|
|
154
132
|
function ɵkeepUnstableUntilFirstFactory(schedulers) {
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
133
|
+
return function keepUnstableUntilFirst2(obs$) {
|
|
134
|
+
obs$ = obs$.lift(new BlockUntilFirstOperator(schedulers.ngZone));
|
|
135
|
+
return obs$.pipe(
|
|
136
|
+
// Run the subscribe body outside of Angular (e.g. calling Firebase SDK to add a listener to a change event)
|
|
137
|
+
subscribeOn(schedulers.outsideAngular),
|
|
138
|
+
// Run operators inside the angular zone (e.g. side effects via tap())
|
|
139
|
+
observeOn(schedulers.insideAngular)
|
|
140
|
+
// INVESTIGATE https://github.com/angular/angularfire/pull/2315
|
|
141
|
+
// share()
|
|
142
|
+
);
|
|
143
|
+
};
|
|
166
144
|
}
|
|
167
|
-
|
|
168
|
-
const
|
|
169
|
-
|
|
170
|
-
const
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
setTimeout(() => {
|
|
176
|
-
if (macrotask.state === 'scheduled') {
|
|
177
|
-
macrotask.invoke();
|
|
178
|
-
}
|
|
179
|
-
}, 10);
|
|
145
|
+
var zoneWrapFn = (it, macrotask) => {
|
|
146
|
+
const _this = void 0;
|
|
147
|
+
return function() {
|
|
148
|
+
const _arguments = arguments;
|
|
149
|
+
if (macrotask) {
|
|
150
|
+
setTimeout(() => {
|
|
151
|
+
if (macrotask.state === "scheduled") {
|
|
152
|
+
macrotask.invoke();
|
|
180
153
|
}
|
|
181
|
-
|
|
182
|
-
}
|
|
154
|
+
}, 10);
|
|
155
|
+
}
|
|
156
|
+
return run(() => it.apply(_this, _arguments));
|
|
157
|
+
};
|
|
183
158
|
};
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
for (let i = 0; i < arguments.length; i++) {
|
|
193
|
-
if (typeof _arguments[i] === 'function') {
|
|
194
|
-
if (blockUntilFirst) {
|
|
195
|
-
// @ts-ignore
|
|
196
|
-
macrotask ||= run(() => Zone.current.scheduleMacroTask('firebaseZoneBlock', noop, {}, noop, noop));
|
|
197
|
-
}
|
|
198
|
-
// TODO create a microtask to track callback functions
|
|
199
|
-
_arguments[i] = zoneWrapFn(_arguments[i], macrotask);
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
const ret = runOutsideAngular(() => it.apply(this, _arguments));
|
|
203
|
-
if (!blockUntilFirst) {
|
|
204
|
-
if (ret instanceof Observable) {
|
|
205
|
-
const schedulers = getSchedulers();
|
|
206
|
-
return ret.pipe(subscribeOn(schedulers.outsideAngular), observeOn(schedulers.insideAngular));
|
|
207
|
-
}
|
|
208
|
-
else {
|
|
209
|
-
return run(() => ret);
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
if (ret instanceof Observable) {
|
|
213
|
-
return ret.pipe(keepUnstableUntilFirst);
|
|
214
|
-
}
|
|
215
|
-
else if (ret instanceof Promise) {
|
|
216
|
-
// eslint-disable-next-line @typescript-eslint/no-misused-promises
|
|
217
|
-
return run(() => new Promise((resolve, reject) => ret.then(it => run(() => resolve(it)), reason => run(() => reject(reason)))));
|
|
218
|
-
}
|
|
219
|
-
else if (typeof ret === 'function' && macrotask) {
|
|
220
|
-
// Handle unsubscribe
|
|
221
|
-
// function() is needed for the arguments object
|
|
222
|
-
return function () {
|
|
223
|
-
setTimeout(() => {
|
|
224
|
-
if (macrotask && macrotask.state === 'scheduled') {
|
|
225
|
-
macrotask.invoke();
|
|
226
|
-
}
|
|
227
|
-
}, 10);
|
|
228
|
-
return ret.apply(this, arguments);
|
|
229
|
-
};
|
|
159
|
+
var ɵzoneWrap = (it, blockUntilFirst) => {
|
|
160
|
+
return function() {
|
|
161
|
+
let macrotask;
|
|
162
|
+
const _arguments = arguments;
|
|
163
|
+
for (let i = 0; i < arguments.length; i++) {
|
|
164
|
+
if (typeof _arguments[i] === "function") {
|
|
165
|
+
if (blockUntilFirst) {
|
|
166
|
+
macrotask ||= run(() => Zone.current.scheduleMacroTask("firebaseZoneBlock", noop, {}, noop, noop));
|
|
230
167
|
}
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
168
|
+
_arguments[i] = zoneWrapFn(_arguments[i], macrotask);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
const ret = runOutsideAngular(() => it.apply(this, _arguments));
|
|
172
|
+
if (!blockUntilFirst) {
|
|
173
|
+
if (ret instanceof Observable) {
|
|
174
|
+
const schedulers = getSchedulers();
|
|
175
|
+
return ret.pipe(subscribeOn(schedulers.outsideAngular), observeOn(schedulers.insideAngular));
|
|
176
|
+
} else {
|
|
177
|
+
return run(() => ret);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
if (ret instanceof Observable) {
|
|
181
|
+
return ret.pipe(keepUnstableUntilFirst);
|
|
182
|
+
} else if (ret instanceof Promise) {
|
|
183
|
+
return run(() => new Promise((resolve, reject) => ret.then((it2) => run(() => resolve(it2)), (reason) => run(() => reject(reason)))));
|
|
184
|
+
} else if (typeof ret === "function" && macrotask) {
|
|
185
|
+
return function() {
|
|
186
|
+
setTimeout(() => {
|
|
187
|
+
if (macrotask && macrotask.state === "scheduled") {
|
|
188
|
+
macrotask.invoke();
|
|
189
|
+
}
|
|
190
|
+
}, 10);
|
|
191
|
+
return ret.apply(this, arguments);
|
|
192
|
+
};
|
|
193
|
+
} else {
|
|
194
|
+
return run(() => ret);
|
|
195
|
+
}
|
|
196
|
+
};
|
|
197
|
+
};
|
|
198
|
+
export {
|
|
199
|
+
VERSION,
|
|
200
|
+
keepUnstableUntilFirst,
|
|
201
|
+
observeInsideAngular,
|
|
202
|
+
observeOutsideAngular,
|
|
203
|
+
ɵAPP_CHECK_PROVIDER_NAME,
|
|
204
|
+
ɵAngularFireSchedulers,
|
|
205
|
+
ɵAppCheckInstances,
|
|
206
|
+
ɵZoneScheduler,
|
|
207
|
+
ɵgetAllInstancesOf,
|
|
208
|
+
ɵgetDefaultInstanceOf,
|
|
209
|
+
ɵisSupportedError,
|
|
210
|
+
ɵkeepUnstableUntilFirstFactory,
|
|
211
|
+
ɵzoneWrap
|
|
236
212
|
};
|
|
237
|
-
|
|
238
|
-
/**
|
|
239
|
-
* Generated bundle index. Do not edit.
|
|
240
|
-
*/
|
|
241
|
-
|
|
242
|
-
export { VERSION, keepUnstableUntilFirst, observeInsideAngular, observeOutsideAngular, ɵAPP_CHECK_PROVIDER_NAME, ɵAngularFireSchedulers, ɵAppCheckInstances, ɵZoneScheduler, ɵgetAllInstancesOf, ɵgetDefaultInstanceOf, ɵisSupportedError, ɵkeepUnstableUntilFirstFactory, ɵzoneWrap };
|
|
243
213
|
//# sourceMappingURL=angular-fire.mjs.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{"version":3,"file":"angular-fire.mjs","sources":["../../../src/core.ts","../../../src/zones.ts","../../../src/angular-fire.ts"],"sourcesContent":["import { Version } from '@angular/core';\nimport { ComponentContainer } from '@firebase/component';\nimport { FirebaseApp, getApps } from 'firebase/app';\nimport type { AppCheck } from 'firebase/app-check';\n\nexport const VERSION = new Version('ANGULARFIRE2_VERSION');\n\nexport const ɵ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\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): T[] => {\n const apps = app ? [app] : getApps();\n const instances: 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\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\nexport interface ɵAppCheckInstances extends Array<AppCheck> {}\n\nexport class ɵAppCheckInstances {\n constructor() {\n return ɵgetAllInstancesOf<AppCheck>(ɵAPP_CHECK_PROVIDER_NAME);\n }\n}\n\nexport const ɵAPP_CHECK_PROVIDER_NAME = 'app-check';\n","/* eslint-disable @typescript-eslint/ban-ts-comment */\nimport { Injectable, NgZone } from '@angular/core';\nimport {\n Observable,\n Operator,\n SchedulerAction,\n SchedulerLike,\n Subscriber,\n Subscription,\n TeardownLogic,\n asyncScheduler,\n queueScheduler\n} from 'rxjs';\nimport { observeOn, subscribeOn, tap } from 'rxjs/operators';\n\n// eslint-disable-next-line @typescript-eslint/no-empty-function\nfunction noop() {\n}\n\n/**\n * Schedules tasks so that they are invoked inside the Zone that is passed in the constructor.\n */\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 // @ts-ignore\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 // @ts-ignore\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})\nexport class ɵAngularFireSchedulers {\n public readonly outsideAngular: ɵZoneScheduler;\n public readonly insideAngular: ɵZoneScheduler;\n\n constructor(public ngZone: NgZone) {\n // @ts-ignore\n this.outsideAngular = ngZone.runOutsideAngular(() => new ɵZoneScheduler(Zone.current));\n // @ts-ignore\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 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\n// @ts-ignore\nconst zoneWrapFn = (it: (...args: any[]) => any, macrotask: MacroTask|undefined) => {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const _this = this;\n // function() is needed for the arguments object\n return function() {\n const _arguments = arguments;\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 return function() {\n // @ts-ignore\n let macrotask: MacroTask | undefined;\n const _arguments = arguments;\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 // @ts-ignore\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 // eslint-disable-next-line @typescript-eslint/no-misused-promises\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 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":";;;;;;MAKa,OAAO,GAAG,IAAI,OAAO,CAAC,sBAAsB,EAAE;MAE9C,iBAAiB,GAAG,CAAC,MAAc,KAC9C,CAAA;AAC+B,+BAAA,EAAA,MAAM,0CAA0C,MAAM,CAAA;AACS,8FAAA,EAAA,MAAM,OAAO;SAO7F,qBAAqB,CAAa,UAAkB,EAAE,QAAuB,EAAE,UAAuB,EAAA;AACpH,IAAA,IAAI,QAAQ,EAAE;;AAEZ,QAAA,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;AAAE,YAAA,OAAO,QAAQ,CAAC,CAAC,CAAC,CAAC;AAAE,SAAA;AAClD,QAAA,MAAM,uBAAuB,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,EAAO,KAAK,EAAE,CAAC,GAAG,KAAK,UAAU,CAAC,CAAC;;AAEpF,QAAA,IAAI,uBAAuB,CAAC,MAAM,KAAK,CAAC,EAAE;AAAE,YAAA,OAAO,uBAAuB,CAAC,CAAC,CAAC,CAAC;AAAE,SAAA;AACjF,KAAA;;IAED,MAAM,uBAAuB,GAA6B,UAAiB,CAAC;IAC5E,MAAM,QAAQ,GAAG,uBAAuB,CAAC,SAAS,CAAC,WAAW,CAAC,UAAmB,CAAC,CAAC;IACpF,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EG;;;;"}
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/core.ts", "../../../src/zones.ts"],
|
|
4
|
+
"sourcesContent": ["import { Version } from '@angular/core';\nimport { ComponentContainer } from '@firebase/component';\nimport { FirebaseApp, getApps } from 'firebase/app';\nimport type { AppCheck } from 'firebase/app-check';\n\nexport const VERSION = new Version('ANGULARFIRE2_VERSION');\n\nexport const ɵ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\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): T[] => {\n const apps = app ? [app] : getApps();\n const instances: 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\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\nexport interface ɵAppCheckInstances extends Array<AppCheck> {}\n\nexport class ɵAppCheckInstances {\n constructor() {\n return ɵgetAllInstancesOf<AppCheck>(ɵAPP_CHECK_PROVIDER_NAME);\n }\n}\n\nexport const ɵAPP_CHECK_PROVIDER_NAME = 'app-check';\n", "/* eslint-disable @typescript-eslint/ban-ts-comment */\nimport { Injectable, NgZone } from '@angular/core';\nimport {\n Observable,\n Operator,\n SchedulerAction,\n SchedulerLike,\n Subscriber,\n Subscription,\n TeardownLogic,\n asyncScheduler,\n queueScheduler\n} from 'rxjs';\nimport { observeOn, subscribeOn, tap } from 'rxjs/operators';\n\n// eslint-disable-next-line @typescript-eslint/no-empty-function\nfunction noop() {\n}\n\n/**\n * Schedules tasks so that they are invoked inside the Zone that is passed in the constructor.\n */\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 // @ts-ignore\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 // @ts-ignore\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})\nexport class ɵAngularFireSchedulers {\n public readonly outsideAngular: ɵZoneScheduler;\n public readonly insideAngular: ɵZoneScheduler;\n\n constructor(public ngZone: NgZone) {\n // @ts-ignore\n this.outsideAngular = ngZone.runOutsideAngular(() => new ɵZoneScheduler(Zone.current));\n // @ts-ignore\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 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\n// @ts-ignore\nconst zoneWrapFn = (it: (...args: any[]) => any, macrotask: MacroTask|undefined) => {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const _this = this;\n // function() is needed for the arguments object\n return function() {\n const _arguments = arguments;\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 return function() {\n // @ts-ignore\n let macrotask: MacroTask | undefined;\n const _arguments = arguments;\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 // @ts-ignore\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 // eslint-disable-next-line @typescript-eslint/no-misused-promises\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 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"],
|
|
5
|
+
"mappings": ";AAAA,SAAS,eAAe;AAExB,SAAsB,eAAe;AAG9B,IAAM,UAAU,IAAI,QAAQ,sBAAsB;AAElD,IAAM,oBAAoB,CAAC,WAChC;iCAC+B,MAAM,0CAA0C,MAAM;gGACS,MAAM;AAOhG,SAAU,sBAAkC,YAAoB,UAAyB,YAAuB;AACpH,MAAI,UAAU;AAEZ,QAAI,SAAS,WAAW,GAAG;AAAE,aAAO,SAAS,CAAC;IAAG;AACjD,UAAM,0BAA0B,SAAS,OAAO,CAAC,OAAY,GAAG,QAAQ,UAAU;AAElF,QAAI,wBAAwB,WAAW,GAAG;AAAE,aAAO,wBAAwB,CAAC;IAAG;EACjF;AAEA,QAAM,0BAAoD;AAC1D,QAAM,WAAW,wBAAwB,UAAU,YAAY,UAAmB;AAClF,SAAO,SAAS,aAAa,EAAE,UAAU,KAAI,CAAE;AACjD;AAEO,IAAM,qBAAqB,CAAa,YAAoB,QAA0B;AAC3F,QAAM,OAAO,MAAM,CAAC,GAAG,IAAI,QAAO;AAClC,QAAM,YAAmB,CAAA;AACzB,OAAK,QAAQ,CAACA,SAAiC;AAC7C,UAAM,WAAgBA,KAAI,UAAU,YAAY,UAAmB;AACnE,aAAS,UAAU,QAAQ,CAAC,aAAiB;AAC3C,UAAI,CAAC,UAAU,SAAS,QAAQ,GAAG;AACjC,kBAAU,KAAK,QAAQ;MACzB;IACF,CAAC;EACH,CAAC;AACD,SAAO;AACT;AAKM,IAAO,qBAAP,MAAyB;EAC7B,cAAA;AACE,WAAO,mBAA6B,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GAAG;IACtB;EACF;AACF;",
|
|
6
|
+
"names": ["app", "state", "keepUnstableUntilFirst", "it"]
|
|
7
|
+
}
|
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": "
|
|
4
|
+
"version": "18.0.0-canary.bfc27e2",
|
|
5
5
|
"description": "Angular + Firebase = ❤️",
|
|
6
6
|
"schematics": "./schematics/collection.json",
|
|
7
7
|
"builders": "./schematics/builders.json",
|
|
@@ -23,10 +23,10 @@
|
|
|
23
23
|
"author": "angular,firebase",
|
|
24
24
|
"license": "MIT",
|
|
25
25
|
"peerDependencies": {
|
|
26
|
-
"@angular/common": "^
|
|
27
|
-
"@angular/core": "^
|
|
28
|
-
"@angular/platform-browser": "^
|
|
29
|
-
"@angular/platform-browser-dynamic": "^
|
|
26
|
+
"@angular/common": "^18.0.0",
|
|
27
|
+
"@angular/core": "^18.0.0",
|
|
28
|
+
"@angular/platform-browser": "^18.0.0",
|
|
29
|
+
"@angular/platform-browser-dynamic": "^18.0.0",
|
|
30
30
|
"rxjs": "~7.8.0",
|
|
31
31
|
"firebase-tools": "^13.0.0"
|
|
32
32
|
},
|
|
@@ -38,8 +38,8 @@
|
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"firebase": "^10.12.0",
|
|
40
40
|
"rxfire": "^6.0.5",
|
|
41
|
-
"@angular-devkit/schematics": "^
|
|
42
|
-
"@schematics/angular": "^
|
|
41
|
+
"@angular-devkit/schematics": "^18.0.0",
|
|
42
|
+
"@schematics/angular": "^18.0.0",
|
|
43
43
|
"tslib": "^2.3.0",
|
|
44
44
|
"fuzzy": "^0.1.3",
|
|
45
45
|
"inquirer-autocomplete-prompt": "^1.0.1",
|
|
@@ -166,7 +166,7 @@ const getPackageJson = (context, workspaceRoot, options, main) => {
|
|
|
166
166
|
}
|
|
167
167
|
return (0, functions_templates_1.defaultPackage)(dependencies, devDependencies, options, main);
|
|
168
168
|
};
|
|
169
|
-
const deployToFunction = (
|
|
169
|
+
const deployToFunction = (firebaseTools_1, context_1, workspaceRoot_1, staticBuildTarget_1, serverBuildTarget_1, options_1, firebaseToken_1, ...args_1) => __awaiter(void 0, [firebaseTools_1, context_1, workspaceRoot_1, staticBuildTarget_1, serverBuildTarget_1, options_1, firebaseToken_1, ...args_1], void 0, function* (firebaseTools, context, workspaceRoot, staticBuildTarget, serverBuildTarget, options, firebaseToken, fsHost = defaultFsHost) {
|
|
170
170
|
var _b;
|
|
171
171
|
const staticBuildOptions = yield context.getTargetOptions((0, architect_1.targetFromTargetString)(staticBuildTarget.name));
|
|
172
172
|
if (!staticBuildOptions.outputPath || typeof staticBuildOptions.outputPath !== 'string') {
|
|
@@ -243,7 +243,7 @@ const deployToFunction = (firebaseTools, context, workspaceRoot, staticBuildTarg
|
|
|
243
243
|
});
|
|
244
244
|
});
|
|
245
245
|
exports.deployToFunction = deployToFunction;
|
|
246
|
-
const deployToCloudRun = (
|
|
246
|
+
const deployToCloudRun = (firebaseTools_2, context_2, workspaceRoot_2, staticBuildTarget_2, serverBuildTarget_2, options_2, firebaseToken_2, ...args_2) => __awaiter(void 0, [firebaseTools_2, context_2, workspaceRoot_2, staticBuildTarget_2, serverBuildTarget_2, options_2, firebaseToken_2, ...args_2], void 0, function* (firebaseTools, context, workspaceRoot, staticBuildTarget, serverBuildTarget, options, firebaseToken, fsHost = defaultFsHost) {
|
|
247
247
|
var _c;
|
|
248
248
|
const staticBuildOptions = yield context.getTargetOptions((0, architect_1.targetFromTargetString)(staticBuildTarget.name));
|
|
249
249
|
if (!staticBuildOptions.outputPath || typeof staticBuildOptions.outputPath !== 'string') {
|
|
@@ -172,7 +172,7 @@ const projectPrompt = (defaultProject, options) => __awaiter(void 0, void 0, voi
|
|
|
172
172
|
return (projects).find(it => it.projectId === projectId);
|
|
173
173
|
});
|
|
174
174
|
exports.projectPrompt = projectPrompt;
|
|
175
|
-
const appPrompt = (
|
|
175
|
+
const appPrompt = (_b, defaultAppId_1, options_1) => __awaiter(void 0, [_b, defaultAppId_1, options_1], void 0, function* ({ projectId: project }, defaultAppId, options) {
|
|
176
176
|
const firebaseTools = yield (0, firebaseTools_1.getFirebaseTools)();
|
|
177
177
|
const apps = yield firebaseTools.apps.list('web', Object.assign(Object.assign({}, options), { project }));
|
|
178
178
|
const { appId } = yield autocomplete({
|