@firebase/app-compat 0.2.43 → 0.2.44
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/dist/esm/index.esm2017.js +1 -1
- package/dist/index.cjs.js +76 -91
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.lite.js +1 -1
- package/package.json +8 -9
- package/dist/esm/index.esm5.js +0 -453
- package/dist/esm/index.esm5.js.map +0 -1
- package/dist/index.lite.esm5.js +0 -360
- package/dist/index.lite.esm5.js.map +0 -1
package/dist/index.cjs.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var util = require('@firebase/util');
|
|
4
|
-
var tslib = require('tslib');
|
|
5
4
|
var component = require('@firebase/component');
|
|
6
5
|
var modularAPIs = require('@firebase/app');
|
|
7
6
|
var logger$1 = require('@firebase/logger');
|
|
@@ -49,49 +48,35 @@ var modularAPIs__namespace = /*#__PURE__*/_interopNamespace(modularAPIs);
|
|
|
49
48
|
* marked as internal because it references internal types exported from @firebase/app
|
|
50
49
|
* @internal
|
|
51
50
|
*/
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
var _this = this;
|
|
51
|
+
class FirebaseAppImpl {
|
|
52
|
+
constructor(_delegate, firebase) {
|
|
55
53
|
this._delegate = _delegate;
|
|
56
54
|
this.firebase = firebase;
|
|
57
55
|
// add itself to container
|
|
58
|
-
modularAPIs._addComponent(_delegate, new component.Component('app-compat',
|
|
56
|
+
modularAPIs._addComponent(_delegate, new component.Component('app-compat', () => this, "PUBLIC" /* ComponentType.PUBLIC */));
|
|
59
57
|
this.container = _delegate.container;
|
|
60
58
|
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
configurable: true
|
|
77
|
-
});
|
|
78
|
-
Object.defineProperty(FirebaseAppImpl.prototype, "options", {
|
|
79
|
-
get: function () {
|
|
80
|
-
return this._delegate.options;
|
|
81
|
-
},
|
|
82
|
-
enumerable: false,
|
|
83
|
-
configurable: true
|
|
84
|
-
});
|
|
85
|
-
FirebaseAppImpl.prototype.delete = function () {
|
|
86
|
-
var _this = this;
|
|
87
|
-
return new Promise(function (resolve) {
|
|
88
|
-
_this._delegate.checkDestroyed();
|
|
59
|
+
get automaticDataCollectionEnabled() {
|
|
60
|
+
return this._delegate.automaticDataCollectionEnabled;
|
|
61
|
+
}
|
|
62
|
+
set automaticDataCollectionEnabled(val) {
|
|
63
|
+
this._delegate.automaticDataCollectionEnabled = val;
|
|
64
|
+
}
|
|
65
|
+
get name() {
|
|
66
|
+
return this._delegate.name;
|
|
67
|
+
}
|
|
68
|
+
get options() {
|
|
69
|
+
return this._delegate.options;
|
|
70
|
+
}
|
|
71
|
+
delete() {
|
|
72
|
+
return new Promise(resolve => {
|
|
73
|
+
this._delegate.checkDestroyed();
|
|
89
74
|
resolve();
|
|
90
|
-
}).then(
|
|
91
|
-
|
|
92
|
-
return modularAPIs.deleteApp(
|
|
75
|
+
}).then(() => {
|
|
76
|
+
this.firebase.INTERNAL.removeApp(this.name);
|
|
77
|
+
return modularAPIs.deleteApp(this._delegate);
|
|
93
78
|
});
|
|
94
|
-
}
|
|
79
|
+
}
|
|
95
80
|
/**
|
|
96
81
|
* Return a service instance associated with this app (creating it
|
|
97
82
|
* on demand), identified by the passed instanceIdentifier.
|
|
@@ -106,12 +91,11 @@ var FirebaseAppImpl = /** @class */ (function () {
|
|
|
106
91
|
* The service name is passed to this already
|
|
107
92
|
* @internal
|
|
108
93
|
*/
|
|
109
|
-
|
|
94
|
+
_getService(name, instanceIdentifier = modularAPIs._DEFAULT_ENTRY_NAME) {
|
|
110
95
|
var _a;
|
|
111
|
-
if (instanceIdentifier === void 0) { instanceIdentifier = modularAPIs._DEFAULT_ENTRY_NAME; }
|
|
112
96
|
this._delegate.checkDestroyed();
|
|
113
97
|
// Initialize instance if InstantiationMode is `EXPLICIT`.
|
|
114
|
-
|
|
98
|
+
const provider = this._delegate.container.getProvider(name);
|
|
115
99
|
if (!provider.isInitialized() &&
|
|
116
100
|
((_a = provider.getComponent()) === null || _a === void 0 ? void 0 : _a.instantiationMode) === "EXPLICIT" /* InstantiationMode.EXPLICIT */) {
|
|
117
101
|
provider.initialize();
|
|
@@ -120,7 +104,7 @@ var FirebaseAppImpl = /** @class */ (function () {
|
|
|
120
104
|
return provider.getImmediate({
|
|
121
105
|
identifier: instanceIdentifier
|
|
122
106
|
});
|
|
123
|
-
}
|
|
107
|
+
}
|
|
124
108
|
/**
|
|
125
109
|
* Remove a service instance from the cache, so we will create a new instance for this service
|
|
126
110
|
* when people try to get it again.
|
|
@@ -131,32 +115,30 @@ var FirebaseAppImpl = /** @class */ (function () {
|
|
|
131
115
|
* @param instanceIdentifier instance identifier in case multiple instances are allowed
|
|
132
116
|
* @internal
|
|
133
117
|
*/
|
|
134
|
-
|
|
135
|
-
if (instanceIdentifier === void 0) { instanceIdentifier = modularAPIs._DEFAULT_ENTRY_NAME; }
|
|
118
|
+
_removeServiceInstance(name, instanceIdentifier = modularAPIs._DEFAULT_ENTRY_NAME) {
|
|
136
119
|
this._delegate.container
|
|
137
120
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
138
121
|
.getProvider(name)
|
|
139
122
|
.clearInstance(instanceIdentifier);
|
|
140
|
-
}
|
|
123
|
+
}
|
|
141
124
|
/**
|
|
142
125
|
* @param component the component being added to this app's container
|
|
143
126
|
* @internal
|
|
144
127
|
*/
|
|
145
|
-
|
|
128
|
+
_addComponent(component) {
|
|
146
129
|
modularAPIs._addComponent(this._delegate, component);
|
|
147
|
-
}
|
|
148
|
-
|
|
130
|
+
}
|
|
131
|
+
_addOrOverwriteComponent(component) {
|
|
149
132
|
modularAPIs._addOrOverwriteComponent(this._delegate, component);
|
|
150
|
-
}
|
|
151
|
-
|
|
133
|
+
}
|
|
134
|
+
toJSON() {
|
|
152
135
|
return {
|
|
153
136
|
name: this.name,
|
|
154
137
|
automaticDataCollectionEnabled: this.automaticDataCollectionEnabled,
|
|
155
138
|
options: this.options
|
|
156
139
|
};
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
}());
|
|
140
|
+
}
|
|
141
|
+
}
|
|
160
142
|
// TODO: investigate why the following needs to be commented out
|
|
161
143
|
// Prevent dead-code elimination of these methods w/o invalid property
|
|
162
144
|
// copying.
|
|
@@ -180,14 +162,13 @@ var FirebaseAppImpl = /** @class */ (function () {
|
|
|
180
162
|
* See the License for the specific language governing permissions and
|
|
181
163
|
* limitations under the License.
|
|
182
164
|
*/
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
_a["no-app" /* AppError.NO_APP */] = "No Firebase App '{$appName}' has been created - " +
|
|
165
|
+
const ERRORS = {
|
|
166
|
+
["no-app" /* AppError.NO_APP */]: "No Firebase App '{$appName}' has been created - " +
|
|
186
167
|
'call Firebase App.initializeApp()',
|
|
187
|
-
|
|
188
|
-
'Firebase App instance.'
|
|
189
|
-
|
|
190
|
-
|
|
168
|
+
["invalid-app-argument" /* AppError.INVALID_APP_ARGUMENT */]: 'firebase.{$appName}() takes either no argument or a ' +
|
|
169
|
+
'Firebase App instance.'
|
|
170
|
+
};
|
|
171
|
+
const ERROR_FACTORY = new util.ErrorFactory('app-compat', 'Firebase', ERRORS);
|
|
191
172
|
|
|
192
173
|
/**
|
|
193
174
|
* @license
|
|
@@ -213,18 +194,18 @@ var ERROR_FACTORY = new util.ErrorFactory('app-compat', 'Firebase', ERRORS);
|
|
|
213
194
|
* the lite version.
|
|
214
195
|
*/
|
|
215
196
|
function createFirebaseNamespaceCore(firebaseAppImpl) {
|
|
216
|
-
|
|
197
|
+
const apps = {};
|
|
217
198
|
// // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
218
199
|
// const components = new Map<string, Component<any>>();
|
|
219
200
|
// A namespace is a plain JavaScript Object.
|
|
220
|
-
|
|
201
|
+
const namespace = {
|
|
221
202
|
// Hack to prevent Babel from modifying the object returned
|
|
222
203
|
// as the firebase namespace.
|
|
223
204
|
// @ts-ignore
|
|
224
205
|
__esModule: true,
|
|
225
206
|
initializeApp: initializeAppCompat,
|
|
226
207
|
// @ts-ignore
|
|
227
|
-
app
|
|
208
|
+
app,
|
|
228
209
|
registerVersion: modularAPIs__namespace.registerVersion,
|
|
229
210
|
setLogLevel: modularAPIs__namespace.setLogLevel,
|
|
230
211
|
onLog: modularAPIs__namespace.onLog,
|
|
@@ -233,8 +214,8 @@ function createFirebaseNamespaceCore(firebaseAppImpl) {
|
|
|
233
214
|
SDK_VERSION: modularAPIs__namespace.SDK_VERSION,
|
|
234
215
|
INTERNAL: {
|
|
235
216
|
registerComponent: registerComponentCompat,
|
|
236
|
-
removeApp
|
|
237
|
-
useAsService
|
|
217
|
+
removeApp,
|
|
218
|
+
useAsService,
|
|
238
219
|
modularAPIs: modularAPIs__namespace
|
|
239
220
|
}
|
|
240
221
|
};
|
|
@@ -278,13 +259,12 @@ function createFirebaseNamespaceCore(firebaseAppImpl) {
|
|
|
278
259
|
*
|
|
279
260
|
* This function is idempotent. It can be called more than once and return the same instance using the same options and config.
|
|
280
261
|
*/
|
|
281
|
-
function initializeAppCompat(options, rawConfig) {
|
|
282
|
-
|
|
283
|
-
var app = modularAPIs__namespace.initializeApp(options, rawConfig);
|
|
262
|
+
function initializeAppCompat(options, rawConfig = {}) {
|
|
263
|
+
const app = modularAPIs__namespace.initializeApp(options, rawConfig);
|
|
284
264
|
if (util.contains(apps, app.name)) {
|
|
285
265
|
return apps[app.name];
|
|
286
266
|
}
|
|
287
|
-
|
|
267
|
+
const appCompat = new firebaseAppImpl(app, namespace);
|
|
288
268
|
apps[app.name] = appCompat;
|
|
289
269
|
return appCompat;
|
|
290
270
|
}
|
|
@@ -293,17 +273,16 @@ function createFirebaseNamespaceCore(firebaseAppImpl) {
|
|
|
293
273
|
*/
|
|
294
274
|
function getApps() {
|
|
295
275
|
// Make a copy so caller cannot mutate the apps list.
|
|
296
|
-
return Object.keys(apps).map(
|
|
276
|
+
return Object.keys(apps).map(name => apps[name]);
|
|
297
277
|
}
|
|
298
278
|
function registerComponentCompat(component) {
|
|
299
|
-
|
|
300
|
-
|
|
279
|
+
const componentName = component.name;
|
|
280
|
+
const componentNameWithoutCompat = componentName.replace('-compat', '');
|
|
301
281
|
if (modularAPIs__namespace._registerComponent(component) &&
|
|
302
282
|
component.type === "PUBLIC" /* ComponentType.PUBLIC */) {
|
|
303
283
|
// create service namespace for public components
|
|
304
284
|
// The Service namespace is an accessor function ...
|
|
305
|
-
|
|
306
|
-
if (appArg === void 0) { appArg = app(); }
|
|
285
|
+
const serviceNamespace = (appArg = app()) => {
|
|
307
286
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
308
287
|
if (typeof appArg[componentNameWithoutCompat] !== 'function') {
|
|
309
288
|
// Invalid argument.
|
|
@@ -328,12 +307,8 @@ function createFirebaseNamespaceCore(firebaseAppImpl) {
|
|
|
328
307
|
// TODO: The eslint disable can be removed and the 'ignoreRestArgs'
|
|
329
308
|
// option added to the no-explicit-any rule when ESlint releases it.
|
|
330
309
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
331
|
-
function () {
|
|
332
|
-
|
|
333
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
334
|
-
args[_i] = arguments[_i];
|
|
335
|
-
}
|
|
336
|
-
var serviceFxn = this._getService.bind(this, componentName);
|
|
310
|
+
function (...args) {
|
|
311
|
+
const serviceFxn = this._getService.bind(this, componentName);
|
|
337
312
|
return serviceFxn.apply(this, component.multipleInstances ? args : []);
|
|
338
313
|
};
|
|
339
314
|
}
|
|
@@ -348,7 +323,7 @@ function createFirebaseNamespaceCore(firebaseAppImpl) {
|
|
|
348
323
|
if (name === 'serverAuth') {
|
|
349
324
|
return null;
|
|
350
325
|
}
|
|
351
|
-
|
|
326
|
+
const useService = name;
|
|
352
327
|
return useService;
|
|
353
328
|
}
|
|
354
329
|
return namespace;
|
|
@@ -378,8 +353,12 @@ function createFirebaseNamespaceCore(firebaseAppImpl) {
|
|
|
378
353
|
* in unit tests.
|
|
379
354
|
*/
|
|
380
355
|
function createFirebaseNamespace() {
|
|
381
|
-
|
|
382
|
-
namespace.INTERNAL =
|
|
356
|
+
const namespace = createFirebaseNamespaceCore(FirebaseAppImpl);
|
|
357
|
+
namespace.INTERNAL = Object.assign(Object.assign({}, namespace.INTERNAL), { createFirebaseNamespace,
|
|
358
|
+
extendNamespace,
|
|
359
|
+
createSubscribe: util.createSubscribe,
|
|
360
|
+
ErrorFactory: util.ErrorFactory,
|
|
361
|
+
deepExtend: util.deepExtend });
|
|
383
362
|
/**
|
|
384
363
|
* Patch the top-level firebase namespace with additional properties.
|
|
385
364
|
*
|
|
@@ -390,7 +369,7 @@ function createFirebaseNamespace() {
|
|
|
390
369
|
}
|
|
391
370
|
return namespace;
|
|
392
371
|
}
|
|
393
|
-
|
|
372
|
+
const firebase$1 = createFirebaseNamespace();
|
|
394
373
|
|
|
395
374
|
/**
|
|
396
375
|
* @license
|
|
@@ -408,10 +387,10 @@ var firebase$1 = createFirebaseNamespace();
|
|
|
408
387
|
* See the License for the specific language governing permissions and
|
|
409
388
|
* limitations under the License.
|
|
410
389
|
*/
|
|
411
|
-
|
|
390
|
+
const logger = new logger$1.Logger('@firebase/app-compat');
|
|
412
391
|
|
|
413
|
-
|
|
414
|
-
|
|
392
|
+
const name = "@firebase/app-compat";
|
|
393
|
+
const version = "0.2.44";
|
|
415
394
|
|
|
416
395
|
/**
|
|
417
396
|
* @license
|
|
@@ -451,23 +430,29 @@ function registerCoreComponents(variant) {
|
|
|
451
430
|
* limitations under the License.
|
|
452
431
|
*/
|
|
453
432
|
try {
|
|
454
|
-
|
|
433
|
+
const globals = util.getGlobal();
|
|
455
434
|
// Firebase Lite detection
|
|
456
435
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
457
436
|
if (globals.firebase !== undefined) {
|
|
458
|
-
logger.warn(
|
|
437
|
+
logger.warn(`
|
|
438
|
+
Warning: Firebase is already defined in the global scope. Please make sure
|
|
439
|
+
Firebase library is only loaded once.
|
|
440
|
+
`);
|
|
459
441
|
// eslint-disable-next-line
|
|
460
|
-
|
|
442
|
+
const sdkVersion = globals.firebase
|
|
461
443
|
.SDK_VERSION;
|
|
462
444
|
if (sdkVersion && sdkVersion.indexOf('LITE') >= 0) {
|
|
463
|
-
logger.warn(
|
|
445
|
+
logger.warn(`
|
|
446
|
+
Warning: You are trying to load Firebase while using Firebase Performance standalone script.
|
|
447
|
+
You should load Firebase Performance with this instance of Firebase to avoid loading duplicate code.
|
|
448
|
+
`);
|
|
464
449
|
}
|
|
465
450
|
}
|
|
466
451
|
}
|
|
467
452
|
catch (_a) {
|
|
468
453
|
// ignore errors thrown by getGlobal
|
|
469
454
|
}
|
|
470
|
-
|
|
455
|
+
const firebase = firebase$1;
|
|
471
456
|
registerCoreComponents();
|
|
472
457
|
|
|
473
458
|
module.exports = firebase;
|
package/dist/index.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs.js","sources":["../src/firebaseApp.ts","../src/errors.ts","../src/firebaseNamespaceCore.ts","../src/firebaseNamespace.ts","../src/logger.ts","../src/registerCoreComponents.ts","../src/index.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { FirebaseOptions } from './public-types';\nimport {\n Component,\n ComponentContainer,\n ComponentType,\n InstantiationMode,\n Name\n} from '@firebase/component';\nimport {\n deleteApp,\n _addComponent,\n _addOrOverwriteComponent,\n _DEFAULT_ENTRY_NAME,\n _FirebaseAppInternal as _FirebaseAppExp\n} from '@firebase/app';\nimport { _FirebaseService, _FirebaseNamespace } from './types';\nimport { Compat } from '@firebase/util';\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport interface _FirebaseApp {\n /**\n * The (read-only) name (identifier) for this App. '[DEFAULT]' is the default\n * App.\n */\n name: string;\n\n /**\n * The (read-only) configuration options from the app initialization.\n */\n options: FirebaseOptions;\n\n /**\n * The settable config flag for GDPR opt-in/opt-out\n */\n automaticDataCollectionEnabled: boolean;\n\n /**\n * Make the given App unusable and free resources.\n */\n delete(): Promise<void>;\n}\n/**\n * Global context object for a collection of services using\n * a shared authentication state.\n *\n * marked as internal because it references internal types exported from @firebase/app\n * @internal\n */\nexport class FirebaseAppImpl implements Compat<_FirebaseAppExp>, _FirebaseApp {\n private container: ComponentContainer;\n\n constructor(\n readonly _delegate: _FirebaseAppExp,\n private readonly firebase: _FirebaseNamespace\n ) {\n // add itself to container\n _addComponent(\n _delegate,\n new Component('app-compat', () => this, ComponentType.PUBLIC)\n );\n\n this.container = _delegate.container;\n }\n\n get automaticDataCollectionEnabled(): boolean {\n return this._delegate.automaticDataCollectionEnabled;\n }\n\n set automaticDataCollectionEnabled(val) {\n this._delegate.automaticDataCollectionEnabled = val;\n }\n\n get name(): string {\n return this._delegate.name;\n }\n\n get options(): FirebaseOptions {\n return this._delegate.options;\n }\n\n delete(): Promise<void> {\n return new Promise<void>(resolve => {\n this._delegate.checkDestroyed();\n resolve();\n }).then(() => {\n this.firebase.INTERNAL.removeApp(this.name);\n return deleteApp(this._delegate);\n });\n }\n\n /**\n * Return a service instance associated with this app (creating it\n * on demand), identified by the passed instanceIdentifier.\n *\n * NOTE: Currently storage and functions are the only ones that are leveraging this\n * functionality. They invoke it by calling:\n *\n * ```javascript\n * firebase.app().storage('STORAGE BUCKET ID')\n * ```\n *\n * The service name is passed to this already\n * @internal\n */\n _getService(\n name: string,\n instanceIdentifier: string = _DEFAULT_ENTRY_NAME\n ): _FirebaseService {\n this._delegate.checkDestroyed();\n\n // Initialize instance if InstantiationMode is `EXPLICIT`.\n const provider = this._delegate.container.getProvider(name as Name);\n if (\n !provider.isInitialized() &&\n provider.getComponent()?.instantiationMode === InstantiationMode.EXPLICIT\n ) {\n provider.initialize();\n }\n\n // getImmediate will always succeed because _getService is only called for registered components.\n return provider.getImmediate({\n identifier: instanceIdentifier\n }) as unknown as _FirebaseService;\n }\n\n /**\n * Remove a service instance from the cache, so we will create a new instance for this service\n * when people try to get it again.\n *\n * NOTE: currently only firestore uses this functionality to support firestore shutdown.\n *\n * @param name The service name\n * @param instanceIdentifier instance identifier in case multiple instances are allowed\n * @internal\n */\n _removeServiceInstance(\n name: string,\n instanceIdentifier: string = _DEFAULT_ENTRY_NAME\n ): void {\n this._delegate.container\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n .getProvider(name as any)\n .clearInstance(instanceIdentifier);\n }\n\n /**\n * @param component the component being added to this app's container\n * @internal\n */\n _addComponent(component: Component): void {\n _addComponent(this._delegate, component);\n }\n\n _addOrOverwriteComponent(component: Component): void {\n _addOrOverwriteComponent(this._delegate, component);\n }\n\n toJSON(): object {\n return {\n name: this.name,\n automaticDataCollectionEnabled: this.automaticDataCollectionEnabled,\n options: this.options\n };\n }\n}\n\n// TODO: investigate why the following needs to be commented out\n// Prevent dead-code elimination of these methods w/o invalid property\n// copying.\n// (FirebaseAppImpl.prototype.name && FirebaseAppImpl.prototype.options) ||\n// FirebaseAppImpl.prototype.delete ||\n// console.log('dc');\n","/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ErrorFactory, ErrorMap } from '@firebase/util';\n\nexport const enum AppError {\n NO_APP = 'no-app',\n INVALID_APP_ARGUMENT = 'invalid-app-argument'\n}\n\nconst ERRORS: ErrorMap<AppError> = {\n [AppError.NO_APP]:\n \"No Firebase App '{$appName}' has been created - \" +\n 'call Firebase App.initializeApp()',\n [AppError.INVALID_APP_ARGUMENT]:\n 'firebase.{$appName}() takes either no argument or a ' +\n 'Firebase App instance.'\n};\n\ntype ErrorParams = { [key in AppError]: { appName: string } };\n\nexport const ERROR_FACTORY = new ErrorFactory<AppError, ErrorParams>(\n 'app-compat',\n 'Firebase',\n ERRORS\n);\n","/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { FirebaseApp, FirebaseOptions } from './public-types';\nimport {\n _FirebaseNamespace,\n _FirebaseService,\n FirebaseServiceNamespace\n} from './types';\nimport * as modularAPIs from '@firebase/app';\nimport { _FirebaseAppInternal as _FirebaseAppExp } from '@firebase/app';\nimport { Component, ComponentType, Name } from '@firebase/component';\n\nimport { deepExtend, contains } from '@firebase/util';\nimport { FirebaseAppImpl } from './firebaseApp';\nimport { ERROR_FACTORY, AppError } from './errors';\nimport { FirebaseAppLiteImpl } from './lite/firebaseAppLite';\n\n/**\n * Because auth can't share code with other components, we attach the utility functions\n * in an internal namespace to share code.\n * This function return a firebase namespace object without\n * any utility functions, so it can be shared between the regular firebaseNamespace and\n * the lite version.\n */\nexport function createFirebaseNamespaceCore(\n firebaseAppImpl: typeof FirebaseAppImpl | typeof FirebaseAppLiteImpl\n): _FirebaseNamespace {\n const apps: { [name: string]: FirebaseApp } = {};\n // // eslint-disable-next-line @typescript-eslint/no-explicit-any\n // const components = new Map<string, Component<any>>();\n\n // A namespace is a plain JavaScript Object.\n const namespace: _FirebaseNamespace = {\n // Hack to prevent Babel from modifying the object returned\n // as the firebase namespace.\n // @ts-ignore\n __esModule: true,\n initializeApp: initializeAppCompat,\n // @ts-ignore\n app,\n registerVersion: modularAPIs.registerVersion,\n setLogLevel: modularAPIs.setLogLevel,\n onLog: modularAPIs.onLog,\n // @ts-ignore\n apps: null,\n SDK_VERSION: modularAPIs.SDK_VERSION,\n INTERNAL: {\n registerComponent: registerComponentCompat,\n removeApp,\n useAsService,\n modularAPIs\n }\n };\n\n // Inject a circular default export to allow Babel users who were previously\n // using:\n //\n // import firebase from 'firebase';\n // which becomes: var firebase = require('firebase').default;\n //\n // instead of\n //\n // import * as firebase from 'firebase';\n // which becomes: var firebase = require('firebase');\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (namespace as any)['default'] = namespace;\n\n // firebase.apps is a read-only getter.\n Object.defineProperty(namespace, 'apps', {\n get: getApps\n });\n\n /**\n * Called by App.delete() - but before any services associated with the App\n * are deleted.\n */\n function removeApp(name: string): void {\n delete apps[name];\n }\n\n /**\n * Get the App object for a given name (or DEFAULT).\n */\n function app(name?: string): FirebaseApp {\n name = name || modularAPIs._DEFAULT_ENTRY_NAME;\n if (!contains(apps, name)) {\n throw ERROR_FACTORY.create(AppError.NO_APP, { appName: name });\n }\n return apps[name];\n }\n\n // @ts-ignore\n app['App'] = firebaseAppImpl;\n\n /**\n * Create a new App instance (name must be unique).\n *\n * This function is idempotent. It can be called more than once and return the same instance using the same options and config.\n */\n function initializeAppCompat(\n options: FirebaseOptions,\n rawConfig = {}\n ): FirebaseApp {\n const app = modularAPIs.initializeApp(\n options,\n rawConfig\n ) as _FirebaseAppExp;\n\n if (contains(apps, app.name)) {\n return apps[app.name];\n }\n\n const appCompat = new firebaseAppImpl(app, namespace);\n apps[app.name] = appCompat;\n return appCompat;\n }\n\n /*\n * Return an array of all the non-deleted FirebaseApps.\n */\n function getApps(): FirebaseApp[] {\n // Make a copy so caller cannot mutate the apps list.\n return Object.keys(apps).map(name => apps[name]);\n }\n\n function registerComponentCompat<T extends Name>(\n component: Component<T>\n ): FirebaseServiceNamespace<_FirebaseService> | null {\n const componentName = component.name;\n const componentNameWithoutCompat = componentName.replace('-compat', '');\n if (\n modularAPIs._registerComponent(component) &&\n component.type === ComponentType.PUBLIC\n ) {\n // create service namespace for public components\n // The Service namespace is an accessor function ...\n const serviceNamespace = (\n appArg: FirebaseApp = app()\n ): _FirebaseService => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n if (typeof (appArg as any)[componentNameWithoutCompat] !== 'function') {\n // Invalid argument.\n // This happens in the following case: firebase.storage('gs:/')\n throw ERROR_FACTORY.create(AppError.INVALID_APP_ARGUMENT, {\n appName: componentName\n });\n }\n\n // Forward service instance lookup to the FirebaseApp.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return (appArg as any)[componentNameWithoutCompat]();\n };\n\n // ... and a container for service-level properties.\n if (component.serviceProps !== undefined) {\n deepExtend(serviceNamespace, component.serviceProps);\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (namespace as any)[componentNameWithoutCompat] = serviceNamespace;\n\n // Patch the FirebaseAppImpl prototype\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (firebaseAppImpl.prototype as any)[componentNameWithoutCompat] =\n // TODO: The eslint disable can be removed and the 'ignoreRestArgs'\n // option added to the no-explicit-any rule when ESlint releases it.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n function (...args: any) {\n const serviceFxn = this._getService.bind(this, componentName);\n return serviceFxn.apply(\n this,\n component.multipleInstances ? args : []\n );\n };\n }\n\n return component.type === ComponentType.PUBLIC\n ? // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (namespace as any)[componentNameWithoutCompat]\n : null;\n }\n\n // Map the requested service to a registered service name\n // (used to map auth to serverAuth service when needed).\n function useAsService(app: FirebaseApp, name: string): string | null {\n if (name === 'serverAuth') {\n return null;\n }\n\n const useService = name;\n\n return useService;\n }\n\n return namespace;\n}\n","/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { FirebaseNamespace } from './public-types';\nimport { createSubscribe, deepExtend, ErrorFactory } from '@firebase/util';\nimport { FirebaseAppImpl } from './firebaseApp';\nimport { createFirebaseNamespaceCore } from './firebaseNamespaceCore';\n\n/**\n * Return a firebase namespace object.\n *\n * In production, this will be called exactly once and the result\n * assigned to the 'firebase' global. It may be called multiple times\n * in unit tests.\n */\nexport function createFirebaseNamespace(): FirebaseNamespace {\n const namespace = createFirebaseNamespaceCore(FirebaseAppImpl);\n namespace.INTERNAL = {\n ...namespace.INTERNAL,\n createFirebaseNamespace,\n extendNamespace,\n createSubscribe,\n ErrorFactory,\n deepExtend\n };\n\n /**\n * Patch the top-level firebase namespace with additional properties.\n *\n * firebase.INTERNAL.extendNamespace()\n */\n function extendNamespace(props: { [prop: string]: unknown }): void {\n deepExtend(namespace, props);\n }\n\n return namespace;\n}\n\nexport const firebase = createFirebaseNamespace();\n","/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Logger } from '@firebase/logger';\n\nexport const logger = new Logger('@firebase/app-compat');\n","/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { registerVersion } from '@firebase/app';\n\nimport { name, version } from '../package.json';\n\nexport function registerCoreComponents(variant?: string): void {\n // Register `app` package.\n registerVersion(name, version, variant);\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { FirebaseNamespace } from './public-types';\nimport { getGlobal } from '@firebase/util';\nimport { firebase as firebaseNamespace } from './firebaseNamespace';\nimport { logger } from './logger';\nimport { registerCoreComponents } from './registerCoreComponents';\n\ndeclare global {\n interface Window {\n firebase: FirebaseNamespace;\n }\n}\n\ntry {\n const globals = getGlobal();\n // Firebase Lite detection\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n if ((globals as any).firebase !== undefined) {\n logger.warn(`\n Warning: Firebase is already defined in the global scope. Please make sure\n Firebase library is only loaded once.\n `);\n\n // eslint-disable-next-line\n const sdkVersion = ((globals as any).firebase as FirebaseNamespace)\n .SDK_VERSION;\n if (sdkVersion && sdkVersion.indexOf('LITE') >= 0) {\n logger.warn(`\n Warning: You are trying to load Firebase while using Firebase Performance standalone script.\n You should load Firebase Performance with this instance of Firebase to avoid loading duplicate code.\n `);\n }\n }\n} catch {\n // ignore errors thrown by getGlobal\n}\n\nconst firebase = firebaseNamespace;\n\nregisterCoreComponents();\n\n// eslint-disable-next-line import/no-default-export\nexport default firebase;\n\nexport { _FirebaseNamespace, _FirebaseService } from './types';\nexport { FirebaseApp, FirebaseNamespace } from './public-types';\n"],"names":["_addComponent","Component","deleteApp","_DEFAULT_ENTRY_NAME","_addOrOverwriteComponent","ErrorFactory","modularAPIs","contains","deepExtend","__assign","firebase","Logger","registerVersion","getGlobal","firebaseNamespace"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;AAeG;AA2CH;;;;;;AAMG;AACH,IAAA,eAAA,kBAAA,YAAA;IAGE,SACW,eAAA,CAAA,SAA0B,EAClB,QAA4B,EAAA;QAF/C,IAWC,KAAA,GAAA,IAAA,CAAA;QAVU,IAAS,CAAA,SAAA,GAAT,SAAS,CAAiB;QAClB,IAAQ,CAAA,QAAA,GAAR,QAAQ,CAAoB;;AAG7C,QAAAA,yBAAa,CACX,SAAS,EACT,IAAIC,mBAAS,CAAC,YAAY,EAAE,YAAA,EAAM,OAAA,KAAI,CAAA,EAAA,EAAA,QAAA,4BAAuB,CAC9D,CAAC;AAEF,QAAA,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC,SAAS,CAAC;KACtC;AAED,IAAA,MAAA,CAAA,cAAA,CAAI,eAA8B,CAAA,SAAA,EAAA,gCAAA,EAAA;AAAlC,QAAA,GAAA,EAAA,YAAA;AACE,YAAA,OAAO,IAAI,CAAC,SAAS,CAAC,8BAA8B,CAAC;SACtD;AAED,QAAA,GAAA,EAAA,UAAmC,GAAG,EAAA;AACpC,YAAA,IAAI,CAAC,SAAS,CAAC,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;;;;;;;;;;;;AAeG;AAcH,IAAI;AACF,IAAA,IAAM,OAAO,GAAGC,cAAS,EAAE,CAAC;;;AAG5B,IAAA,IAAK,OAAe,CAAC,QAAQ,KAAK,SAAS,EAAE;AAC3C,QAAA,MAAM,CAAC,IAAI,CAAC,uIAGX,CAAC,CAAC;;AAGH,QAAA,IAAM,UAAU,GAAK,OAAe,CAAC,QAA8B;AAChE,aAAA,WAAW,CAAC;QACf,IAAI,UAAU,IAAI,UAAU,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE;AACjD,YAAA,MAAM,CAAC,IAAI,CAAC,gOAGT,CAAC,CAAC;AACN,SAAA;AACF,KAAA;AACF,CAAA;AAAC,OAAM,EAAA,EAAA;;AAEP,CAAA;AAEK,IAAA,QAAQ,GAAGC,WAAkB;AAEnC,sBAAsB,EAAE;;;;"}
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":["../src/firebaseApp.ts","../src/errors.ts","../src/firebaseNamespaceCore.ts","../src/firebaseNamespace.ts","../src/logger.ts","../src/registerCoreComponents.ts","../src/index.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { FirebaseOptions } from './public-types';\nimport {\n Component,\n ComponentContainer,\n ComponentType,\n InstantiationMode,\n Name\n} from '@firebase/component';\nimport {\n deleteApp,\n _addComponent,\n _addOrOverwriteComponent,\n _DEFAULT_ENTRY_NAME,\n _FirebaseAppInternal as _FirebaseAppExp\n} from '@firebase/app';\nimport { _FirebaseService, _FirebaseNamespace } from './types';\nimport { Compat } from '@firebase/util';\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport interface _FirebaseApp {\n /**\n * The (read-only) name (identifier) for this App. '[DEFAULT]' is the default\n * App.\n */\n name: string;\n\n /**\n * The (read-only) configuration options from the app initialization.\n */\n options: FirebaseOptions;\n\n /**\n * The settable config flag for GDPR opt-in/opt-out\n */\n automaticDataCollectionEnabled: boolean;\n\n /**\n * Make the given App unusable and free resources.\n */\n delete(): Promise<void>;\n}\n/**\n * Global context object for a collection of services using\n * a shared authentication state.\n *\n * marked as internal because it references internal types exported from @firebase/app\n * @internal\n */\nexport class FirebaseAppImpl implements Compat<_FirebaseAppExp>, _FirebaseApp {\n private container: ComponentContainer;\n\n constructor(\n readonly _delegate: _FirebaseAppExp,\n private readonly firebase: _FirebaseNamespace\n ) {\n // add itself to container\n _addComponent(\n _delegate,\n new Component('app-compat', () => this, ComponentType.PUBLIC)\n );\n\n this.container = _delegate.container;\n }\n\n get automaticDataCollectionEnabled(): boolean {\n return this._delegate.automaticDataCollectionEnabled;\n }\n\n set automaticDataCollectionEnabled(val) {\n this._delegate.automaticDataCollectionEnabled = val;\n }\n\n get name(): string {\n return this._delegate.name;\n }\n\n get options(): FirebaseOptions {\n return this._delegate.options;\n }\n\n delete(): Promise<void> {\n return new Promise<void>(resolve => {\n this._delegate.checkDestroyed();\n resolve();\n }).then(() => {\n this.firebase.INTERNAL.removeApp(this.name);\n return deleteApp(this._delegate);\n });\n }\n\n /**\n * Return a service instance associated with this app (creating it\n * on demand), identified by the passed instanceIdentifier.\n *\n * NOTE: Currently storage and functions are the only ones that are leveraging this\n * functionality. They invoke it by calling:\n *\n * ```javascript\n * firebase.app().storage('STORAGE BUCKET ID')\n * ```\n *\n * The service name is passed to this already\n * @internal\n */\n _getService(\n name: string,\n instanceIdentifier: string = _DEFAULT_ENTRY_NAME\n ): _FirebaseService {\n this._delegate.checkDestroyed();\n\n // Initialize instance if InstantiationMode is `EXPLICIT`.\n const provider = this._delegate.container.getProvider(name as Name);\n if (\n !provider.isInitialized() &&\n provider.getComponent()?.instantiationMode === InstantiationMode.EXPLICIT\n ) {\n provider.initialize();\n }\n\n // getImmediate will always succeed because _getService is only called for registered components.\n return provider.getImmediate({\n identifier: instanceIdentifier\n }) as unknown as _FirebaseService;\n }\n\n /**\n * Remove a service instance from the cache, so we will create a new instance for this service\n * when people try to get it again.\n *\n * NOTE: currently only firestore uses this functionality to support firestore shutdown.\n *\n * @param name The service name\n * @param instanceIdentifier instance identifier in case multiple instances are allowed\n * @internal\n */\n _removeServiceInstance(\n name: string,\n instanceIdentifier: string = _DEFAULT_ENTRY_NAME\n ): void {\n this._delegate.container\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n .getProvider(name as any)\n .clearInstance(instanceIdentifier);\n }\n\n /**\n * @param component the component being added to this app's container\n * @internal\n */\n _addComponent(component: Component): void {\n _addComponent(this._delegate, component);\n }\n\n _addOrOverwriteComponent(component: Component): void {\n _addOrOverwriteComponent(this._delegate, component);\n }\n\n toJSON(): object {\n return {\n name: this.name,\n automaticDataCollectionEnabled: this.automaticDataCollectionEnabled,\n options: this.options\n };\n }\n}\n\n// TODO: investigate why the following needs to be commented out\n// Prevent dead-code elimination of these methods w/o invalid property\n// copying.\n// (FirebaseAppImpl.prototype.name && FirebaseAppImpl.prototype.options) ||\n// FirebaseAppImpl.prototype.delete ||\n// console.log('dc');\n","/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ErrorFactory, ErrorMap } from '@firebase/util';\n\nexport const enum AppError {\n NO_APP = 'no-app',\n INVALID_APP_ARGUMENT = 'invalid-app-argument'\n}\n\nconst ERRORS: ErrorMap<AppError> = {\n [AppError.NO_APP]:\n \"No Firebase App '{$appName}' has been created - \" +\n 'call Firebase App.initializeApp()',\n [AppError.INVALID_APP_ARGUMENT]:\n 'firebase.{$appName}() takes either no argument or a ' +\n 'Firebase App instance.'\n};\n\ntype ErrorParams = { [key in AppError]: { appName: string } };\n\nexport const ERROR_FACTORY = new ErrorFactory<AppError, ErrorParams>(\n 'app-compat',\n 'Firebase',\n ERRORS\n);\n","/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { FirebaseApp, FirebaseOptions } from './public-types';\nimport {\n _FirebaseNamespace,\n _FirebaseService,\n FirebaseServiceNamespace\n} from './types';\nimport * as modularAPIs from '@firebase/app';\nimport { _FirebaseAppInternal as _FirebaseAppExp } from '@firebase/app';\nimport { Component, ComponentType, Name } from '@firebase/component';\n\nimport { deepExtend, contains } from '@firebase/util';\nimport { FirebaseAppImpl } from './firebaseApp';\nimport { ERROR_FACTORY, AppError } from './errors';\nimport { FirebaseAppLiteImpl } from './lite/firebaseAppLite';\n\n/**\n * Because auth can't share code with other components, we attach the utility functions\n * in an internal namespace to share code.\n * This function return a firebase namespace object without\n * any utility functions, so it can be shared between the regular firebaseNamespace and\n * the lite version.\n */\nexport function createFirebaseNamespaceCore(\n firebaseAppImpl: typeof FirebaseAppImpl | typeof FirebaseAppLiteImpl\n): _FirebaseNamespace {\n const apps: { [name: string]: FirebaseApp } = {};\n // // eslint-disable-next-line @typescript-eslint/no-explicit-any\n // const components = new Map<string, Component<any>>();\n\n // A namespace is a plain JavaScript Object.\n const namespace: _FirebaseNamespace = {\n // Hack to prevent Babel from modifying the object returned\n // as the firebase namespace.\n // @ts-ignore\n __esModule: true,\n initializeApp: initializeAppCompat,\n // @ts-ignore\n app,\n registerVersion: modularAPIs.registerVersion,\n setLogLevel: modularAPIs.setLogLevel,\n onLog: modularAPIs.onLog,\n // @ts-ignore\n apps: null,\n SDK_VERSION: modularAPIs.SDK_VERSION,\n INTERNAL: {\n registerComponent: registerComponentCompat,\n removeApp,\n useAsService,\n modularAPIs\n }\n };\n\n // Inject a circular default export to allow Babel users who were previously\n // using:\n //\n // import firebase from 'firebase';\n // which becomes: var firebase = require('firebase').default;\n //\n // instead of\n //\n // import * as firebase from 'firebase';\n // which becomes: var firebase = require('firebase');\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (namespace as any)['default'] = namespace;\n\n // firebase.apps is a read-only getter.\n Object.defineProperty(namespace, 'apps', {\n get: getApps\n });\n\n /**\n * Called by App.delete() - but before any services associated with the App\n * are deleted.\n */\n function removeApp(name: string): void {\n delete apps[name];\n }\n\n /**\n * Get the App object for a given name (or DEFAULT).\n */\n function app(name?: string): FirebaseApp {\n name = name || modularAPIs._DEFAULT_ENTRY_NAME;\n if (!contains(apps, name)) {\n throw ERROR_FACTORY.create(AppError.NO_APP, { appName: name });\n }\n return apps[name];\n }\n\n // @ts-ignore\n app['App'] = firebaseAppImpl;\n\n /**\n * Create a new App instance (name must be unique).\n *\n * This function is idempotent. It can be called more than once and return the same instance using the same options and config.\n */\n function initializeAppCompat(\n options: FirebaseOptions,\n rawConfig = {}\n ): FirebaseApp {\n const app = modularAPIs.initializeApp(\n options,\n rawConfig\n ) as _FirebaseAppExp;\n\n if (contains(apps, app.name)) {\n return apps[app.name];\n }\n\n const appCompat = new firebaseAppImpl(app, namespace);\n apps[app.name] = appCompat;\n return appCompat;\n }\n\n /*\n * Return an array of all the non-deleted FirebaseApps.\n */\n function getApps(): FirebaseApp[] {\n // Make a copy so caller cannot mutate the apps list.\n return Object.keys(apps).map(name => apps[name]);\n }\n\n function registerComponentCompat<T extends Name>(\n component: Component<T>\n ): FirebaseServiceNamespace<_FirebaseService> | null {\n const componentName = component.name;\n const componentNameWithoutCompat = componentName.replace('-compat', '');\n if (\n modularAPIs._registerComponent(component) &&\n component.type === ComponentType.PUBLIC\n ) {\n // create service namespace for public components\n // The Service namespace is an accessor function ...\n const serviceNamespace = (\n appArg: FirebaseApp = app()\n ): _FirebaseService => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n if (typeof (appArg as any)[componentNameWithoutCompat] !== 'function') {\n // Invalid argument.\n // This happens in the following case: firebase.storage('gs:/')\n throw ERROR_FACTORY.create(AppError.INVALID_APP_ARGUMENT, {\n appName: componentName\n });\n }\n\n // Forward service instance lookup to the FirebaseApp.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return (appArg as any)[componentNameWithoutCompat]();\n };\n\n // ... and a container for service-level properties.\n if (component.serviceProps !== undefined) {\n deepExtend(serviceNamespace, component.serviceProps);\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (namespace as any)[componentNameWithoutCompat] = serviceNamespace;\n\n // Patch the FirebaseAppImpl prototype\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (firebaseAppImpl.prototype as any)[componentNameWithoutCompat] =\n // TODO: The eslint disable can be removed and the 'ignoreRestArgs'\n // option added to the no-explicit-any rule when ESlint releases it.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n function (...args: any) {\n const serviceFxn = this._getService.bind(this, componentName);\n return serviceFxn.apply(\n this,\n component.multipleInstances ? args : []\n );\n };\n }\n\n return component.type === ComponentType.PUBLIC\n ? // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (namespace as any)[componentNameWithoutCompat]\n : null;\n }\n\n // Map the requested service to a registered service name\n // (used to map auth to serverAuth service when needed).\n function useAsService(app: FirebaseApp, name: string): string | null {\n if (name === 'serverAuth') {\n return null;\n }\n\n const useService = name;\n\n return useService;\n }\n\n return namespace;\n}\n","/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { FirebaseNamespace } from './public-types';\nimport { createSubscribe, deepExtend, ErrorFactory } from '@firebase/util';\nimport { FirebaseAppImpl } from './firebaseApp';\nimport { createFirebaseNamespaceCore } from './firebaseNamespaceCore';\n\n/**\n * Return a firebase namespace object.\n *\n * In production, this will be called exactly once and the result\n * assigned to the 'firebase' global. It may be called multiple times\n * in unit tests.\n */\nexport function createFirebaseNamespace(): FirebaseNamespace {\n const namespace = createFirebaseNamespaceCore(FirebaseAppImpl);\n namespace.INTERNAL = {\n ...namespace.INTERNAL,\n createFirebaseNamespace,\n extendNamespace,\n createSubscribe,\n ErrorFactory,\n deepExtend\n };\n\n /**\n * Patch the top-level firebase namespace with additional properties.\n *\n * firebase.INTERNAL.extendNamespace()\n */\n function extendNamespace(props: { [prop: string]: unknown }): void {\n deepExtend(namespace, props);\n }\n\n return namespace;\n}\n\nexport const firebase = createFirebaseNamespace();\n","/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Logger } from '@firebase/logger';\n\nexport const logger = new Logger('@firebase/app-compat');\n","/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { registerVersion } from '@firebase/app';\n\nimport { name, version } from '../package.json';\n\nexport function registerCoreComponents(variant?: string): void {\n // Register `app` package.\n registerVersion(name, version, variant);\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { FirebaseNamespace } from './public-types';\nimport { getGlobal } from '@firebase/util';\nimport { firebase as firebaseNamespace } from './firebaseNamespace';\nimport { logger } from './logger';\nimport { registerCoreComponents } from './registerCoreComponents';\n\ndeclare global {\n interface Window {\n firebase: FirebaseNamespace;\n }\n}\n\ntry {\n const globals = getGlobal();\n // Firebase Lite detection\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n if ((globals as any).firebase !== undefined) {\n logger.warn(`\n Warning: Firebase is already defined in the global scope. Please make sure\n Firebase library is only loaded once.\n `);\n\n // eslint-disable-next-line\n const sdkVersion = ((globals as any).firebase as FirebaseNamespace)\n .SDK_VERSION;\n if (sdkVersion && sdkVersion.indexOf('LITE') >= 0) {\n logger.warn(`\n Warning: You are trying to load Firebase while using Firebase Performance standalone script.\n You should load Firebase Performance with this instance of Firebase to avoid loading duplicate code.\n `);\n }\n }\n} catch {\n // ignore errors thrown by getGlobal\n}\n\nconst firebase = firebaseNamespace;\n\nregisterCoreComponents();\n\n// eslint-disable-next-line import/no-default-export\nexport default firebase;\n\nexport { _FirebaseNamespace, _FirebaseService } from './types';\nexport { FirebaseApp, FirebaseNamespace } from './public-types';\n"],"names":["_addComponent","Component","deleteApp","_DEFAULT_ENTRY_NAME","_addOrOverwriteComponent","ErrorFactory","modularAPIs","contains","deepExtend","createSubscribe","firebase","Logger","registerVersion","getGlobal","firebaseNamespace"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;AAeG;AA2CH;;;;;;AAMG;MACU,eAAe,CAAA;IAG1B,WACW,CAAA,SAA0B,EAClB,QAA4B,EAAA;QADpC,IAAS,CAAA,SAAA,GAAT,SAAS,CAAiB;QAClB,IAAQ,CAAA,QAAA,GAAR,QAAQ,CAAoB;;AAG7C,QAAAA,yBAAa,CACX,SAAS,EACT,IAAIC,mBAAS,CAAC,YAAY,EAAE,MAAM,IAAI,EAAA,QAAA,4BAAuB,CAC9D,CAAC;AAEF,QAAA,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC,SAAS,CAAC;KACtC;AAED,IAAA,IAAI,8BAA8B,GAAA;AAChC,QAAA,OAAO,IAAI,CAAC,SAAS,CAAC,8BAA8B,CAAC;KACtD;IAED,IAAI,8BAA8B,CAAC,GAAG,EAAA;AACpC,QAAA,IAAI,CAAC,SAAS,CAAC,8BAA8B,GAAG,GAAG,CAAC;KACrD;AAED,IAAA,IAAI,IAAI,GAAA;AACN,QAAA,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;KAC5B;AAED,IAAA,IAAI,OAAO,GAAA;AACT,QAAA,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC;KAC/B;IAED,MAAM,GAAA;AACJ,QAAA,OAAO,IAAI,OAAO,CAAO,OAAO,IAAG;AACjC,YAAA,IAAI,CAAC,SAAS,CAAC,cAAc,EAAE,CAAC;AAChC,YAAA,OAAO,EAAE,CAA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QACf,IAAI,UAAU,IAAI,UAAU,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE;YACjD,MAAM,CAAC,IAAI,CAAC,CAAA;;;AAGT,QAAA,CAAA,CAAC,CAAC;AACN,SAAA;AACF,KAAA;AACF,CAAA;AAAC,OAAM,EAAA,EAAA;;AAEP,CAAA;AAEK,MAAA,QAAQ,GAAGC,WAAkB;AAEnC,sBAAsB,EAAE;;;;"}
|
package/dist/index.lite.js
CHANGED
package/package.json
CHANGED
|
@@ -1,21 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@firebase/app-compat",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.44",
|
|
4
4
|
"description": "The primary entrypoint to the Firebase JS SDK",
|
|
5
5
|
"author": "Firebase <firebase-support@google.com> (https://firebase.google.com/)",
|
|
6
6
|
"main": "dist/index.cjs.js",
|
|
7
7
|
"browser": "dist/esm/index.esm2017.js",
|
|
8
8
|
"module": "dist/esm/index.esm2017.js",
|
|
9
|
-
"esm5": "dist/esm/index.esm5.js",
|
|
10
9
|
"lite": "dist/index.lite.js",
|
|
11
|
-
"liteesm5": "dist/index.lite.esm5.js",
|
|
12
10
|
"exports": {
|
|
13
11
|
".": {
|
|
14
12
|
"types": "./dist/app-compat-public.d.ts",
|
|
15
13
|
"require": "./dist/index.cjs.js",
|
|
16
|
-
"esm5": "./dist/esm/index.esm5.js",
|
|
17
14
|
"lite": "./dist/index.lite.js",
|
|
18
|
-
"liteesm5": "./dist/index.lite.esm5.js",
|
|
19
15
|
"default": "./dist/esm/index.esm2017.js"
|
|
20
16
|
},
|
|
21
17
|
"./package.json": "./package.json"
|
|
@@ -41,10 +37,10 @@
|
|
|
41
37
|
},
|
|
42
38
|
"license": "Apache-2.0",
|
|
43
39
|
"dependencies": {
|
|
44
|
-
"@firebase/app": "0.10.
|
|
45
|
-
"@firebase/util": "1.10.
|
|
46
|
-
"@firebase/logger": "0.4.
|
|
47
|
-
"@firebase/component": "0.6.
|
|
40
|
+
"@firebase/app": "0.10.14",
|
|
41
|
+
"@firebase/util": "1.10.1",
|
|
42
|
+
"@firebase/logger": "0.4.3",
|
|
43
|
+
"@firebase/component": "0.6.10",
|
|
48
44
|
"tslib": "^2.1.0"
|
|
49
45
|
},
|
|
50
46
|
"devDependencies": {
|
|
@@ -68,5 +64,8 @@
|
|
|
68
64
|
".ts"
|
|
69
65
|
],
|
|
70
66
|
"reportDir": "./coverage/node"
|
|
67
|
+
},
|
|
68
|
+
"engines": {
|
|
69
|
+
"node": ">=18.0.0"
|
|
71
70
|
}
|
|
72
71
|
}
|