mirror of
https://github.com/musix-org/musix-oss
synced 2025-06-17 10:46:01 +00:00
Modules
This commit is contained in:
664
node_modules/@firebase/app/dist/index.cjs.js
generated
vendored
Normal file
664
node_modules/@firebase/app/dist/index.cjs.js
generated
vendored
Normal file
@ -0,0 +1,664 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', { value: true });
|
||||
|
||||
var tslib = require('tslib');
|
||||
var util = require('@firebase/util');
|
||||
var component = require('@firebase/component');
|
||||
var logger$1 = require('@firebase/logger');
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
var _a;
|
||||
var ERRORS = (_a = {},
|
||||
_a["no-app" /* NO_APP */] = "No Firebase App '{$appName}' has been created - " +
|
||||
'call Firebase App.initializeApp()',
|
||||
_a["bad-app-name" /* BAD_APP_NAME */] = "Illegal App name: '{$appName}",
|
||||
_a["duplicate-app" /* DUPLICATE_APP */] = "Firebase App named '{$appName}' already exists",
|
||||
_a["app-deleted" /* APP_DELETED */] = "Firebase App named '{$appName}' already deleted",
|
||||
_a["invalid-app-argument" /* INVALID_APP_ARGUMENT */] = 'firebase.{$appName}() takes either no argument or a ' +
|
||||
'Firebase App instance.',
|
||||
_a);
|
||||
var ERROR_FACTORY = new util.ErrorFactory('app', 'Firebase', ERRORS);
|
||||
|
||||
var name = "@firebase/app";
|
||||
var version = "0.5.3";
|
||||
|
||||
var name$1 = "@firebase/analytics";
|
||||
|
||||
var name$2 = "@firebase/auth";
|
||||
|
||||
var name$3 = "@firebase/database";
|
||||
|
||||
var name$4 = "@firebase/functions";
|
||||
|
||||
var name$5 = "@firebase/installations";
|
||||
|
||||
var name$6 = "@firebase/messaging";
|
||||
|
||||
var name$7 = "@firebase/performance";
|
||||
|
||||
var name$8 = "@firebase/remote-config";
|
||||
|
||||
var name$9 = "@firebase/storage";
|
||||
|
||||
var name$a = "@firebase/firestore";
|
||||
|
||||
var name$b = "firebase-wrapper";
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
var _a$1;
|
||||
var DEFAULT_ENTRY_NAME = '[DEFAULT]';
|
||||
var PLATFORM_LOG_STRING = (_a$1 = {},
|
||||
_a$1[name] = 'fire-core',
|
||||
_a$1[name$1] = 'fire-analytics',
|
||||
_a$1[name$2] = 'fire-auth',
|
||||
_a$1[name$3] = 'fire-rtdb',
|
||||
_a$1[name$4] = 'fire-fn',
|
||||
_a$1[name$5] = 'fire-iid',
|
||||
_a$1[name$6] = 'fire-fcm',
|
||||
_a$1[name$7] = 'fire-perf',
|
||||
_a$1[name$8] = 'fire-rc',
|
||||
_a$1[name$9] = 'fire-gcs',
|
||||
_a$1[name$a] = 'fire-fst',
|
||||
_a$1['fire-js'] = 'fire-js',
|
||||
_a$1[name$b] = 'fire-js-all',
|
||||
_a$1);
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
var logger = new logger$1.Logger('@firebase/app');
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2017 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
/**
|
||||
* Global context object for a collection of services using
|
||||
* a shared authentication state.
|
||||
*/
|
||||
var FirebaseAppImpl = /** @class */ (function () {
|
||||
function FirebaseAppImpl(options, config, firebase_) {
|
||||
var e_1, _a;
|
||||
var _this = this;
|
||||
this.firebase_ = firebase_;
|
||||
this.isDeleted_ = false;
|
||||
this.name_ = config.name;
|
||||
this.automaticDataCollectionEnabled_ =
|
||||
config.automaticDataCollectionEnabled || false;
|
||||
this.options_ = util.deepCopy(options);
|
||||
this.container = new component.ComponentContainer(config.name);
|
||||
// add itself to container
|
||||
this._addComponent(new component.Component('app', function () { return _this; }, "PUBLIC" /* PUBLIC */));
|
||||
try {
|
||||
// populate ComponentContainer with existing components
|
||||
for (var _b = tslib.__values(this.firebase_.INTERNAL.components.values()), _c = _b.next(); !_c.done; _c = _b.next()) {
|
||||
var component$1 = _c.value;
|
||||
this._addComponent(component$1);
|
||||
}
|
||||
}
|
||||
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
||||
finally {
|
||||
try {
|
||||
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
||||
}
|
||||
finally { if (e_1) throw e_1.error; }
|
||||
}
|
||||
}
|
||||
Object.defineProperty(FirebaseAppImpl.prototype, "automaticDataCollectionEnabled", {
|
||||
get: function () {
|
||||
this.checkDestroyed_();
|
||||
return this.automaticDataCollectionEnabled_;
|
||||
},
|
||||
set: function (val) {
|
||||
this.checkDestroyed_();
|
||||
this.automaticDataCollectionEnabled_ = val;
|
||||
},
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
Object.defineProperty(FirebaseAppImpl.prototype, "name", {
|
||||
get: function () {
|
||||
this.checkDestroyed_();
|
||||
return this.name_;
|
||||
},
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
Object.defineProperty(FirebaseAppImpl.prototype, "options", {
|
||||
get: function () {
|
||||
this.checkDestroyed_();
|
||||
return this.options_;
|
||||
},
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
FirebaseAppImpl.prototype.delete = function () {
|
||||
var _this = this;
|
||||
return new Promise(function (resolve) {
|
||||
_this.checkDestroyed_();
|
||||
resolve();
|
||||
})
|
||||
.then(function () {
|
||||
_this.firebase_.INTERNAL.removeApp(_this.name_);
|
||||
return Promise.all(_this.container.getProviders().map(function (provider) { return provider.delete(); }));
|
||||
})
|
||||
.then(function () {
|
||||
_this.isDeleted_ = true;
|
||||
});
|
||||
};
|
||||
/**
|
||||
* Return a service instance associated with this app (creating it
|
||||
* on demand), identified by the passed instanceIdentifier.
|
||||
*
|
||||
* NOTE: Currently storage and functions are the only ones that are leveraging this
|
||||
* functionality. They invoke it by calling:
|
||||
*
|
||||
* ```javascript
|
||||
* firebase.app().storage('STORAGE BUCKET ID')
|
||||
* ```
|
||||
*
|
||||
* The service name is passed to this already
|
||||
* @internal
|
||||
*/
|
||||
FirebaseAppImpl.prototype._getService = function (name, instanceIdentifier) {
|
||||
if (instanceIdentifier === void 0) { instanceIdentifier = DEFAULT_ENTRY_NAME; }
|
||||
this.checkDestroyed_();
|
||||
// getImmediate will always succeed because _getService is only called for registered components.
|
||||
return this.container.getProvider(name).getImmediate({
|
||||
identifier: instanceIdentifier
|
||||
});
|
||||
};
|
||||
/**
|
||||
* Remove a service instance from the cache, so we will create a new instance for this service
|
||||
* when people try to get this service again.
|
||||
*
|
||||
* NOTE: currently only firestore is using this functionality to support firestore shutdown.
|
||||
*
|
||||
* @param name The service name
|
||||
* @param instanceIdentifier instance identifier in case multiple instances are allowed
|
||||
* @internal
|
||||
*/
|
||||
FirebaseAppImpl.prototype._removeServiceInstance = function (name, instanceIdentifier) {
|
||||
if (instanceIdentifier === void 0) { instanceIdentifier = DEFAULT_ENTRY_NAME; }
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
this.container.getProvider(name).clearInstance(instanceIdentifier);
|
||||
};
|
||||
/**
|
||||
* @param component the component being added to this app's container
|
||||
*/
|
||||
FirebaseAppImpl.prototype._addComponent = function (component) {
|
||||
try {
|
||||
this.container.addComponent(component);
|
||||
}
|
||||
catch (e) {
|
||||
logger.debug("Component " + component.name + " failed to register with FirebaseApp " + this.name, e);
|
||||
}
|
||||
};
|
||||
FirebaseAppImpl.prototype._addOrOverwriteComponent = function (component) {
|
||||
this.container.addOrOverwriteComponent(component);
|
||||
};
|
||||
/**
|
||||
* This function will throw an Error if the App has already been deleted -
|
||||
* use before performing API actions on the App.
|
||||
*/
|
||||
FirebaseAppImpl.prototype.checkDestroyed_ = function () {
|
||||
if (this.isDeleted_) {
|
||||
throw ERROR_FACTORY.create("app-deleted" /* APP_DELETED */, { appName: this.name_ });
|
||||
}
|
||||
};
|
||||
return FirebaseAppImpl;
|
||||
}());
|
||||
// Prevent dead-code elimination of these methods w/o invalid property
|
||||
// copying.
|
||||
(FirebaseAppImpl.prototype.name && FirebaseAppImpl.prototype.options) ||
|
||||
FirebaseAppImpl.prototype.delete ||
|
||||
console.log('dc');
|
||||
|
||||
var version$1 = "7.8.0";
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
/**
|
||||
* Because auth can't share code with other components, we attach the utility functions
|
||||
* in an internal namespace to share code.
|
||||
* This function return a firebase namespace object without
|
||||
* any utility functions, so it can be shared between the regular firebaseNamespace and
|
||||
* the lite version.
|
||||
*/
|
||||
function createFirebaseNamespaceCore(firebaseAppImpl) {
|
||||
var apps = {};
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
var components = new Map();
|
||||
// A namespace is a plain JavaScript Object.
|
||||
var namespace = {
|
||||
// Hack to prevent Babel from modifying the object returned
|
||||
// as the firebase namespace.
|
||||
// @ts-ignore
|
||||
__esModule: true,
|
||||
initializeApp: initializeApp,
|
||||
// @ts-ignore
|
||||
app: app,
|
||||
registerVersion: registerVersion,
|
||||
// @ts-ignore
|
||||
apps: null,
|
||||
SDK_VERSION: version$1,
|
||||
INTERNAL: {
|
||||
registerComponent: registerComponent,
|
||||
removeApp: removeApp,
|
||||
components: components,
|
||||
useAsService: useAsService
|
||||
}
|
||||
};
|
||||
// Inject a circular default export to allow Babel users who were previously
|
||||
// using:
|
||||
//
|
||||
// import firebase from 'firebase';
|
||||
// which becomes: var firebase = require('firebase').default;
|
||||
//
|
||||
// instead of
|
||||
//
|
||||
// import * as firebase from 'firebase';
|
||||
// which becomes: var firebase = require('firebase');
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
namespace['default'] = namespace;
|
||||
// firebase.apps is a read-only getter.
|
||||
Object.defineProperty(namespace, 'apps', {
|
||||
get: getApps
|
||||
});
|
||||
/**
|
||||
* Called by App.delete() - but before any services associated with the App
|
||||
* are deleted.
|
||||
*/
|
||||
function removeApp(name) {
|
||||
delete apps[name];
|
||||
}
|
||||
/**
|
||||
* Get the App object for a given name (or DEFAULT).
|
||||
*/
|
||||
function app(name) {
|
||||
name = name || DEFAULT_ENTRY_NAME;
|
||||
if (!util.contains(apps, name)) {
|
||||
throw ERROR_FACTORY.create("no-app" /* NO_APP */, { appName: name });
|
||||
}
|
||||
return apps[name];
|
||||
}
|
||||
// @ts-ignore
|
||||
app['App'] = firebaseAppImpl;
|
||||
function initializeApp(options, rawConfig) {
|
||||
if (rawConfig === void 0) { rawConfig = {}; }
|
||||
if (typeof rawConfig !== 'object' || rawConfig === null) {
|
||||
var name_1 = rawConfig;
|
||||
rawConfig = { name: name_1 };
|
||||
}
|
||||
var config = rawConfig;
|
||||
if (config.name === undefined) {
|
||||
config.name = DEFAULT_ENTRY_NAME;
|
||||
}
|
||||
var name = config.name;
|
||||
if (typeof name !== 'string' || !name) {
|
||||
throw ERROR_FACTORY.create("bad-app-name" /* BAD_APP_NAME */, {
|
||||
appName: String(name)
|
||||
});
|
||||
}
|
||||
if (util.contains(apps, name)) {
|
||||
throw ERROR_FACTORY.create("duplicate-app" /* DUPLICATE_APP */, { appName: name });
|
||||
}
|
||||
var app = new firebaseAppImpl(options, config, namespace);
|
||||
apps[name] = app;
|
||||
return app;
|
||||
}
|
||||
/*
|
||||
* Return an array of all the non-deleted FirebaseApps.
|
||||
*/
|
||||
function getApps() {
|
||||
// Make a copy so caller cannot mutate the apps list.
|
||||
return Object.keys(apps).map(function (name) { return apps[name]; });
|
||||
}
|
||||
function registerComponent(component) {
|
||||
var e_1, _a;
|
||||
var componentName = component.name;
|
||||
if (components.has(componentName)) {
|
||||
logger.debug("There were multiple attempts to register component " + componentName + ".");
|
||||
return component.type === "PUBLIC" /* PUBLIC */
|
||||
? // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
namespace[componentName]
|
||||
: null;
|
||||
}
|
||||
components.set(componentName, component);
|
||||
// create service namespace for public components
|
||||
if (component.type === "PUBLIC" /* PUBLIC */) {
|
||||
// The Service namespace is an accessor function ...
|
||||
var serviceNamespace = function (appArg) {
|
||||
if (appArg === void 0) { appArg = app(); }
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
if (typeof appArg[componentName] !== 'function') {
|
||||
// Invalid argument.
|
||||
// This happens in the following case: firebase.storage('gs:/')
|
||||
throw ERROR_FACTORY.create("invalid-app-argument" /* INVALID_APP_ARGUMENT */, {
|
||||
appName: componentName
|
||||
});
|
||||
}
|
||||
// Forward service instance lookup to the FirebaseApp.
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
return appArg[componentName]();
|
||||
};
|
||||
// ... and a container for service-level properties.
|
||||
if (component.serviceProps !== undefined) {
|
||||
util.deepExtend(serviceNamespace, component.serviceProps);
|
||||
}
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
namespace[componentName] = serviceNamespace;
|
||||
// Patch the FirebaseAppImpl prototype
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
firebaseAppImpl.prototype[componentName] =
|
||||
// TODO: The eslint disable can be removed and the 'ignoreRestArgs'
|
||||
// option added to the no-explicit-any rule when ESlint releases it.
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
function () {
|
||||
var args = [];
|
||||
for (var _i = 0; _i < arguments.length; _i++) {
|
||||
args[_i] = arguments[_i];
|
||||
}
|
||||
var serviceFxn = this._getService.bind(this, componentName);
|
||||
return serviceFxn.apply(this, component.multipleInstances ? args : []);
|
||||
};
|
||||
}
|
||||
try {
|
||||
// add the component to existing app instances
|
||||
for (var _b = tslib.__values(Object.keys(apps)), _c = _b.next(); !_c.done; _c = _b.next()) {
|
||||
var appName = _c.value;
|
||||
apps[appName]._addComponent(component);
|
||||
}
|
||||
}
|
||||
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
||||
finally {
|
||||
try {
|
||||
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
||||
}
|
||||
finally { if (e_1) throw e_1.error; }
|
||||
}
|
||||
return component.type === "PUBLIC" /* PUBLIC */
|
||||
? // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
namespace[componentName]
|
||||
: null;
|
||||
}
|
||||
function registerVersion(libraryKeyOrName, version, variant) {
|
||||
var _a;
|
||||
// TODO: We can use this check to whitelist strings when/if we set up
|
||||
// a good whitelist system.
|
||||
var library = (_a = PLATFORM_LOG_STRING[libraryKeyOrName], (_a !== null && _a !== void 0 ? _a : libraryKeyOrName));
|
||||
if (variant) {
|
||||
library += "-" + variant;
|
||||
}
|
||||
var libraryMismatch = library.match(/\s|\//);
|
||||
var versionMismatch = version.match(/\s|\//);
|
||||
if (libraryMismatch || versionMismatch) {
|
||||
var warning = [
|
||||
"Unable to register library \"" + library + "\" with version \"" + version + "\":"
|
||||
];
|
||||
if (libraryMismatch) {
|
||||
warning.push("library name \"" + library + "\" contains illegal characters (whitespace or \"/\")");
|
||||
}
|
||||
if (libraryMismatch && versionMismatch) {
|
||||
warning.push('and');
|
||||
}
|
||||
if (versionMismatch) {
|
||||
warning.push("version name \"" + version + "\" contains illegal characters (whitespace or \"/\")");
|
||||
}
|
||||
logger.warn(warning.join(' '));
|
||||
return;
|
||||
}
|
||||
registerComponent(new component.Component(library + "-version", function () { return ({ library: library, version: version }); }, "VERSION" /* VERSION */));
|
||||
}
|
||||
// Map the requested service to a registered service name
|
||||
// (used to map auth to serverAuth service when needed).
|
||||
function useAsService(app, name) {
|
||||
if (name === 'serverAuth') {
|
||||
return null;
|
||||
}
|
||||
var useService = name;
|
||||
return useService;
|
||||
}
|
||||
return namespace;
|
||||
}
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
/**
|
||||
* Return a firebase namespace object.
|
||||
*
|
||||
* In production, this will be called exactly once and the result
|
||||
* assigned to the 'firebase' global. It may be called multiple times
|
||||
* in unit tests.
|
||||
*/
|
||||
function createFirebaseNamespace() {
|
||||
var namespace = createFirebaseNamespaceCore(FirebaseAppImpl);
|
||||
namespace.INTERNAL = tslib.__assign(tslib.__assign({}, namespace.INTERNAL), { createFirebaseNamespace: createFirebaseNamespace,
|
||||
extendNamespace: extendNamespace,
|
||||
createSubscribe: util.createSubscribe,
|
||||
ErrorFactory: util.ErrorFactory,
|
||||
deepExtend: util.deepExtend });
|
||||
/**
|
||||
* Patch the top-level firebase namespace with additional properties.
|
||||
*
|
||||
* firebase.INTERNAL.extendNamespace()
|
||||
*/
|
||||
function extendNamespace(props) {
|
||||
util.deepExtend(namespace, props);
|
||||
}
|
||||
return namespace;
|
||||
}
|
||||
var firebase = createFirebaseNamespace();
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
var PlatformLoggerService = /** @class */ (function () {
|
||||
function PlatformLoggerService(container) {
|
||||
this.container = container;
|
||||
}
|
||||
// In initial implementation, this will be called by installations on
|
||||
// auth token refresh, and installations will send this string.
|
||||
PlatformLoggerService.prototype.getPlatformInfoString = function () {
|
||||
var providers = this.container.getProviders();
|
||||
// Loop through providers and get library/version pairs from any that are
|
||||
// version components.
|
||||
return providers
|
||||
.map(function (provider) {
|
||||
if (isVersionServiceProvider(provider)) {
|
||||
var service = provider.getImmediate();
|
||||
return service.library + "/" + service.version;
|
||||
}
|
||||
else {
|
||||
return null;
|
||||
}
|
||||
})
|
||||
.filter(function (logString) { return logString; })
|
||||
.join(' ');
|
||||
};
|
||||
return PlatformLoggerService;
|
||||
}());
|
||||
/**
|
||||
*
|
||||
* @param provider check if this provider provides a VersionService
|
||||
*
|
||||
* NOTE: Using Provider<'app-version'> is a hack to indicate that the provider
|
||||
* provides VersionService. The provider is not necessarily a 'app-version'
|
||||
* provider.
|
||||
*/
|
||||
function isVersionServiceProvider(provider) {
|
||||
var _a;
|
||||
var component = provider.getComponent();
|
||||
return ((_a = component) === null || _a === void 0 ? void 0 : _a.type) === "VERSION" /* VERSION */;
|
||||
}
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
function registerCoreComponents(firebase, variant) {
|
||||
firebase.INTERNAL.registerComponent(new component.Component('platform-logger', function (container) { return new PlatformLoggerService(container); }, "PRIVATE" /* PRIVATE */));
|
||||
// Register `app` package.
|
||||
firebase.registerVersion(name, version, variant);
|
||||
// Register platform SDK identifier (no version).
|
||||
firebase.registerVersion('fire-js', '');
|
||||
}
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2017 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
// Firebase Lite detection
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
if (util.isBrowser() && self.firebase !== undefined) {
|
||||
logger.warn("\n Warning: Firebase is already defined in the global scope. Please make sure\n Firebase library is only loaded once.\n ");
|
||||
// eslint-disable-next-line
|
||||
var sdkVersion = self.firebase.SDK_VERSION;
|
||||
if (sdkVersion && sdkVersion.indexOf('LITE') >= 0) {
|
||||
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 ");
|
||||
}
|
||||
}
|
||||
var initializeApp = firebase.initializeApp;
|
||||
// TODO: This disable can be removed and the 'ignoreRestArgs' option added to
|
||||
// the no-explicit-any rule when ESlint releases it.
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
firebase.initializeApp = function () {
|
||||
var args = [];
|
||||
for (var _i = 0; _i < arguments.length; _i++) {
|
||||
args[_i] = arguments[_i];
|
||||
}
|
||||
// Environment check before initializing app
|
||||
// Do the check in initializeApp, so people have a chance to disable it by setting logLevel
|
||||
// in @firebase/logger
|
||||
if (util.isNode()) {
|
||||
logger.warn("\n Warning: This is a browser-targeted Firebase bundle but it appears it is being\n run in a Node environment. If running in a Node environment, make sure you\n are using the bundle specified by the \"main\" field in package.json.\n \n If you are using Webpack, you can specify \"main\" as the first item in\n \"resolve.mainFields\":\n https://webpack.js.org/configuration/resolve/#resolvemainfields\n \n If using Rollup, use the rollup-plugin-node-resolve plugin and specify \"main\"\n as the first item in \"mainFields\", e.g. ['main', 'module'].\n https://github.com/rollup/rollup-plugin-node-resolve\n ");
|
||||
}
|
||||
return initializeApp.apply(undefined, args);
|
||||
};
|
||||
var firebase$1 = firebase;
|
||||
registerCoreComponents(firebase$1);
|
||||
|
||||
exports.default = firebase$1;
|
||||
exports.firebase = firebase$1;
|
||||
//# sourceMappingURL=index.cjs.js.map
|
1
node_modules/@firebase/app/dist/index.cjs.js.map
generated
vendored
Normal file
1
node_modules/@firebase/app/dist/index.cjs.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
660
node_modules/@firebase/app/dist/index.esm.js
generated
vendored
Normal file
660
node_modules/@firebase/app/dist/index.esm.js
generated
vendored
Normal file
@ -0,0 +1,660 @@
|
||||
import { __values, __assign } from 'tslib';
|
||||
import { ErrorFactory, deepCopy, contains, deepExtend, createSubscribe, isBrowser, isNode } from '@firebase/util';
|
||||
import { ComponentContainer, Component } from '@firebase/component';
|
||||
import { Logger } from '@firebase/logger';
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
var _a;
|
||||
var ERRORS = (_a = {},
|
||||
_a["no-app" /* NO_APP */] = "No Firebase App '{$appName}' has been created - " +
|
||||
'call Firebase App.initializeApp()',
|
||||
_a["bad-app-name" /* BAD_APP_NAME */] = "Illegal App name: '{$appName}",
|
||||
_a["duplicate-app" /* DUPLICATE_APP */] = "Firebase App named '{$appName}' already exists",
|
||||
_a["app-deleted" /* APP_DELETED */] = "Firebase App named '{$appName}' already deleted",
|
||||
_a["invalid-app-argument" /* INVALID_APP_ARGUMENT */] = 'firebase.{$appName}() takes either no argument or a ' +
|
||||
'Firebase App instance.',
|
||||
_a);
|
||||
var ERROR_FACTORY = new ErrorFactory('app', 'Firebase', ERRORS);
|
||||
|
||||
var name = "@firebase/app";
|
||||
var version = "0.5.3";
|
||||
|
||||
var name$1 = "@firebase/analytics";
|
||||
|
||||
var name$2 = "@firebase/auth";
|
||||
|
||||
var name$3 = "@firebase/database";
|
||||
|
||||
var name$4 = "@firebase/functions";
|
||||
|
||||
var name$5 = "@firebase/installations";
|
||||
|
||||
var name$6 = "@firebase/messaging";
|
||||
|
||||
var name$7 = "@firebase/performance";
|
||||
|
||||
var name$8 = "@firebase/remote-config";
|
||||
|
||||
var name$9 = "@firebase/storage";
|
||||
|
||||
var name$a = "@firebase/firestore";
|
||||
|
||||
var name$b = "firebase-wrapper";
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
var _a$1;
|
||||
var DEFAULT_ENTRY_NAME = '[DEFAULT]';
|
||||
var PLATFORM_LOG_STRING = (_a$1 = {},
|
||||
_a$1[name] = 'fire-core',
|
||||
_a$1[name$1] = 'fire-analytics',
|
||||
_a$1[name$2] = 'fire-auth',
|
||||
_a$1[name$3] = 'fire-rtdb',
|
||||
_a$1[name$4] = 'fire-fn',
|
||||
_a$1[name$5] = 'fire-iid',
|
||||
_a$1[name$6] = 'fire-fcm',
|
||||
_a$1[name$7] = 'fire-perf',
|
||||
_a$1[name$8] = 'fire-rc',
|
||||
_a$1[name$9] = 'fire-gcs',
|
||||
_a$1[name$a] = 'fire-fst',
|
||||
_a$1['fire-js'] = 'fire-js',
|
||||
_a$1[name$b] = 'fire-js-all',
|
||||
_a$1);
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
var logger = new Logger('@firebase/app');
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2017 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
/**
|
||||
* Global context object for a collection of services using
|
||||
* a shared authentication state.
|
||||
*/
|
||||
var FirebaseAppImpl = /** @class */ (function () {
|
||||
function FirebaseAppImpl(options, config, firebase_) {
|
||||
var e_1, _a;
|
||||
var _this = this;
|
||||
this.firebase_ = firebase_;
|
||||
this.isDeleted_ = false;
|
||||
this.name_ = config.name;
|
||||
this.automaticDataCollectionEnabled_ =
|
||||
config.automaticDataCollectionEnabled || false;
|
||||
this.options_ = deepCopy(options);
|
||||
this.container = new ComponentContainer(config.name);
|
||||
// add itself to container
|
||||
this._addComponent(new Component('app', function () { return _this; }, "PUBLIC" /* PUBLIC */));
|
||||
try {
|
||||
// populate ComponentContainer with existing components
|
||||
for (var _b = __values(this.firebase_.INTERNAL.components.values()), _c = _b.next(); !_c.done; _c = _b.next()) {
|
||||
var component = _c.value;
|
||||
this._addComponent(component);
|
||||
}
|
||||
}
|
||||
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
||||
finally {
|
||||
try {
|
||||
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
||||
}
|
||||
finally { if (e_1) throw e_1.error; }
|
||||
}
|
||||
}
|
||||
Object.defineProperty(FirebaseAppImpl.prototype, "automaticDataCollectionEnabled", {
|
||||
get: function () {
|
||||
this.checkDestroyed_();
|
||||
return this.automaticDataCollectionEnabled_;
|
||||
},
|
||||
set: function (val) {
|
||||
this.checkDestroyed_();
|
||||
this.automaticDataCollectionEnabled_ = val;
|
||||
},
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
Object.defineProperty(FirebaseAppImpl.prototype, "name", {
|
||||
get: function () {
|
||||
this.checkDestroyed_();
|
||||
return this.name_;
|
||||
},
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
Object.defineProperty(FirebaseAppImpl.prototype, "options", {
|
||||
get: function () {
|
||||
this.checkDestroyed_();
|
||||
return this.options_;
|
||||
},
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
FirebaseAppImpl.prototype.delete = function () {
|
||||
var _this = this;
|
||||
return new Promise(function (resolve) {
|
||||
_this.checkDestroyed_();
|
||||
resolve();
|
||||
})
|
||||
.then(function () {
|
||||
_this.firebase_.INTERNAL.removeApp(_this.name_);
|
||||
return Promise.all(_this.container.getProviders().map(function (provider) { return provider.delete(); }));
|
||||
})
|
||||
.then(function () {
|
||||
_this.isDeleted_ = true;
|
||||
});
|
||||
};
|
||||
/**
|
||||
* Return a service instance associated with this app (creating it
|
||||
* on demand), identified by the passed instanceIdentifier.
|
||||
*
|
||||
* NOTE: Currently storage and functions are the only ones that are leveraging this
|
||||
* functionality. They invoke it by calling:
|
||||
*
|
||||
* ```javascript
|
||||
* firebase.app().storage('STORAGE BUCKET ID')
|
||||
* ```
|
||||
*
|
||||
* The service name is passed to this already
|
||||
* @internal
|
||||
*/
|
||||
FirebaseAppImpl.prototype._getService = function (name, instanceIdentifier) {
|
||||
if (instanceIdentifier === void 0) { instanceIdentifier = DEFAULT_ENTRY_NAME; }
|
||||
this.checkDestroyed_();
|
||||
// getImmediate will always succeed because _getService is only called for registered components.
|
||||
return this.container.getProvider(name).getImmediate({
|
||||
identifier: instanceIdentifier
|
||||
});
|
||||
};
|
||||
/**
|
||||
* Remove a service instance from the cache, so we will create a new instance for this service
|
||||
* when people try to get this service again.
|
||||
*
|
||||
* NOTE: currently only firestore is using this functionality to support firestore shutdown.
|
||||
*
|
||||
* @param name The service name
|
||||
* @param instanceIdentifier instance identifier in case multiple instances are allowed
|
||||
* @internal
|
||||
*/
|
||||
FirebaseAppImpl.prototype._removeServiceInstance = function (name, instanceIdentifier) {
|
||||
if (instanceIdentifier === void 0) { instanceIdentifier = DEFAULT_ENTRY_NAME; }
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
this.container.getProvider(name).clearInstance(instanceIdentifier);
|
||||
};
|
||||
/**
|
||||
* @param component the component being added to this app's container
|
||||
*/
|
||||
FirebaseAppImpl.prototype._addComponent = function (component) {
|
||||
try {
|
||||
this.container.addComponent(component);
|
||||
}
|
||||
catch (e) {
|
||||
logger.debug("Component " + component.name + " failed to register with FirebaseApp " + this.name, e);
|
||||
}
|
||||
};
|
||||
FirebaseAppImpl.prototype._addOrOverwriteComponent = function (component) {
|
||||
this.container.addOrOverwriteComponent(component);
|
||||
};
|
||||
/**
|
||||
* This function will throw an Error if the App has already been deleted -
|
||||
* use before performing API actions on the App.
|
||||
*/
|
||||
FirebaseAppImpl.prototype.checkDestroyed_ = function () {
|
||||
if (this.isDeleted_) {
|
||||
throw ERROR_FACTORY.create("app-deleted" /* APP_DELETED */, { appName: this.name_ });
|
||||
}
|
||||
};
|
||||
return FirebaseAppImpl;
|
||||
}());
|
||||
// Prevent dead-code elimination of these methods w/o invalid property
|
||||
// copying.
|
||||
(FirebaseAppImpl.prototype.name && FirebaseAppImpl.prototype.options) ||
|
||||
FirebaseAppImpl.prototype.delete ||
|
||||
console.log('dc');
|
||||
|
||||
var version$1 = "7.8.0";
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
/**
|
||||
* Because auth can't share code with other components, we attach the utility functions
|
||||
* in an internal namespace to share code.
|
||||
* This function return a firebase namespace object without
|
||||
* any utility functions, so it can be shared between the regular firebaseNamespace and
|
||||
* the lite version.
|
||||
*/
|
||||
function createFirebaseNamespaceCore(firebaseAppImpl) {
|
||||
var apps = {};
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
var components = new Map();
|
||||
// A namespace is a plain JavaScript Object.
|
||||
var namespace = {
|
||||
// Hack to prevent Babel from modifying the object returned
|
||||
// as the firebase namespace.
|
||||
// @ts-ignore
|
||||
__esModule: true,
|
||||
initializeApp: initializeApp,
|
||||
// @ts-ignore
|
||||
app: app,
|
||||
registerVersion: registerVersion,
|
||||
// @ts-ignore
|
||||
apps: null,
|
||||
SDK_VERSION: version$1,
|
||||
INTERNAL: {
|
||||
registerComponent: registerComponent,
|
||||
removeApp: removeApp,
|
||||
components: components,
|
||||
useAsService: useAsService
|
||||
}
|
||||
};
|
||||
// Inject a circular default export to allow Babel users who were previously
|
||||
// using:
|
||||
//
|
||||
// import firebase from 'firebase';
|
||||
// which becomes: var firebase = require('firebase').default;
|
||||
//
|
||||
// instead of
|
||||
//
|
||||
// import * as firebase from 'firebase';
|
||||
// which becomes: var firebase = require('firebase');
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
namespace['default'] = namespace;
|
||||
// firebase.apps is a read-only getter.
|
||||
Object.defineProperty(namespace, 'apps', {
|
||||
get: getApps
|
||||
});
|
||||
/**
|
||||
* Called by App.delete() - but before any services associated with the App
|
||||
* are deleted.
|
||||
*/
|
||||
function removeApp(name) {
|
||||
delete apps[name];
|
||||
}
|
||||
/**
|
||||
* Get the App object for a given name (or DEFAULT).
|
||||
*/
|
||||
function app(name) {
|
||||
name = name || DEFAULT_ENTRY_NAME;
|
||||
if (!contains(apps, name)) {
|
||||
throw ERROR_FACTORY.create("no-app" /* NO_APP */, { appName: name });
|
||||
}
|
||||
return apps[name];
|
||||
}
|
||||
// @ts-ignore
|
||||
app['App'] = firebaseAppImpl;
|
||||
function initializeApp(options, rawConfig) {
|
||||
if (rawConfig === void 0) { rawConfig = {}; }
|
||||
if (typeof rawConfig !== 'object' || rawConfig === null) {
|
||||
var name_1 = rawConfig;
|
||||
rawConfig = { name: name_1 };
|
||||
}
|
||||
var config = rawConfig;
|
||||
if (config.name === undefined) {
|
||||
config.name = DEFAULT_ENTRY_NAME;
|
||||
}
|
||||
var name = config.name;
|
||||
if (typeof name !== 'string' || !name) {
|
||||
throw ERROR_FACTORY.create("bad-app-name" /* BAD_APP_NAME */, {
|
||||
appName: String(name)
|
||||
});
|
||||
}
|
||||
if (contains(apps, name)) {
|
||||
throw ERROR_FACTORY.create("duplicate-app" /* DUPLICATE_APP */, { appName: name });
|
||||
}
|
||||
var app = new firebaseAppImpl(options, config, namespace);
|
||||
apps[name] = app;
|
||||
return app;
|
||||
}
|
||||
/*
|
||||
* Return an array of all the non-deleted FirebaseApps.
|
||||
*/
|
||||
function getApps() {
|
||||
// Make a copy so caller cannot mutate the apps list.
|
||||
return Object.keys(apps).map(function (name) { return apps[name]; });
|
||||
}
|
||||
function registerComponent(component) {
|
||||
var e_1, _a;
|
||||
var componentName = component.name;
|
||||
if (components.has(componentName)) {
|
||||
logger.debug("There were multiple attempts to register component " + componentName + ".");
|
||||
return component.type === "PUBLIC" /* PUBLIC */
|
||||
? // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
namespace[componentName]
|
||||
: null;
|
||||
}
|
||||
components.set(componentName, component);
|
||||
// create service namespace for public components
|
||||
if (component.type === "PUBLIC" /* PUBLIC */) {
|
||||
// The Service namespace is an accessor function ...
|
||||
var serviceNamespace = function (appArg) {
|
||||
if (appArg === void 0) { appArg = app(); }
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
if (typeof appArg[componentName] !== 'function') {
|
||||
// Invalid argument.
|
||||
// This happens in the following case: firebase.storage('gs:/')
|
||||
throw ERROR_FACTORY.create("invalid-app-argument" /* INVALID_APP_ARGUMENT */, {
|
||||
appName: componentName
|
||||
});
|
||||
}
|
||||
// Forward service instance lookup to the FirebaseApp.
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
return appArg[componentName]();
|
||||
};
|
||||
// ... and a container for service-level properties.
|
||||
if (component.serviceProps !== undefined) {
|
||||
deepExtend(serviceNamespace, component.serviceProps);
|
||||
}
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
namespace[componentName] = serviceNamespace;
|
||||
// Patch the FirebaseAppImpl prototype
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
firebaseAppImpl.prototype[componentName] =
|
||||
// TODO: The eslint disable can be removed and the 'ignoreRestArgs'
|
||||
// option added to the no-explicit-any rule when ESlint releases it.
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
function () {
|
||||
var args = [];
|
||||
for (var _i = 0; _i < arguments.length; _i++) {
|
||||
args[_i] = arguments[_i];
|
||||
}
|
||||
var serviceFxn = this._getService.bind(this, componentName);
|
||||
return serviceFxn.apply(this, component.multipleInstances ? args : []);
|
||||
};
|
||||
}
|
||||
try {
|
||||
// add the component to existing app instances
|
||||
for (var _b = __values(Object.keys(apps)), _c = _b.next(); !_c.done; _c = _b.next()) {
|
||||
var appName = _c.value;
|
||||
apps[appName]._addComponent(component);
|
||||
}
|
||||
}
|
||||
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
||||
finally {
|
||||
try {
|
||||
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
||||
}
|
||||
finally { if (e_1) throw e_1.error; }
|
||||
}
|
||||
return component.type === "PUBLIC" /* PUBLIC */
|
||||
? // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
namespace[componentName]
|
||||
: null;
|
||||
}
|
||||
function registerVersion(libraryKeyOrName, version, variant) {
|
||||
var _a;
|
||||
// TODO: We can use this check to whitelist strings when/if we set up
|
||||
// a good whitelist system.
|
||||
var library = (_a = PLATFORM_LOG_STRING[libraryKeyOrName], (_a !== null && _a !== void 0 ? _a : libraryKeyOrName));
|
||||
if (variant) {
|
||||
library += "-" + variant;
|
||||
}
|
||||
var libraryMismatch = library.match(/\s|\//);
|
||||
var versionMismatch = version.match(/\s|\//);
|
||||
if (libraryMismatch || versionMismatch) {
|
||||
var warning = [
|
||||
"Unable to register library \"" + library + "\" with version \"" + version + "\":"
|
||||
];
|
||||
if (libraryMismatch) {
|
||||
warning.push("library name \"" + library + "\" contains illegal characters (whitespace or \"/\")");
|
||||
}
|
||||
if (libraryMismatch && versionMismatch) {
|
||||
warning.push('and');
|
||||
}
|
||||
if (versionMismatch) {
|
||||
warning.push("version name \"" + version + "\" contains illegal characters (whitespace or \"/\")");
|
||||
}
|
||||
logger.warn(warning.join(' '));
|
||||
return;
|
||||
}
|
||||
registerComponent(new Component(library + "-version", function () { return ({ library: library, version: version }); }, "VERSION" /* VERSION */));
|
||||
}
|
||||
// Map the requested service to a registered service name
|
||||
// (used to map auth to serverAuth service when needed).
|
||||
function useAsService(app, name) {
|
||||
if (name === 'serverAuth') {
|
||||
return null;
|
||||
}
|
||||
var useService = name;
|
||||
return useService;
|
||||
}
|
||||
return namespace;
|
||||
}
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
/**
|
||||
* Return a firebase namespace object.
|
||||
*
|
||||
* In production, this will be called exactly once and the result
|
||||
* assigned to the 'firebase' global. It may be called multiple times
|
||||
* in unit tests.
|
||||
*/
|
||||
function createFirebaseNamespace() {
|
||||
var namespace = createFirebaseNamespaceCore(FirebaseAppImpl);
|
||||
namespace.INTERNAL = __assign(__assign({}, namespace.INTERNAL), { createFirebaseNamespace: createFirebaseNamespace,
|
||||
extendNamespace: extendNamespace,
|
||||
createSubscribe: createSubscribe,
|
||||
ErrorFactory: ErrorFactory,
|
||||
deepExtend: deepExtend });
|
||||
/**
|
||||
* Patch the top-level firebase namespace with additional properties.
|
||||
*
|
||||
* firebase.INTERNAL.extendNamespace()
|
||||
*/
|
||||
function extendNamespace(props) {
|
||||
deepExtend(namespace, props);
|
||||
}
|
||||
return namespace;
|
||||
}
|
||||
var firebase = createFirebaseNamespace();
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
var PlatformLoggerService = /** @class */ (function () {
|
||||
function PlatformLoggerService(container) {
|
||||
this.container = container;
|
||||
}
|
||||
// In initial implementation, this will be called by installations on
|
||||
// auth token refresh, and installations will send this string.
|
||||
PlatformLoggerService.prototype.getPlatformInfoString = function () {
|
||||
var providers = this.container.getProviders();
|
||||
// Loop through providers and get library/version pairs from any that are
|
||||
// version components.
|
||||
return providers
|
||||
.map(function (provider) {
|
||||
if (isVersionServiceProvider(provider)) {
|
||||
var service = provider.getImmediate();
|
||||
return service.library + "/" + service.version;
|
||||
}
|
||||
else {
|
||||
return null;
|
||||
}
|
||||
})
|
||||
.filter(function (logString) { return logString; })
|
||||
.join(' ');
|
||||
};
|
||||
return PlatformLoggerService;
|
||||
}());
|
||||
/**
|
||||
*
|
||||
* @param provider check if this provider provides a VersionService
|
||||
*
|
||||
* NOTE: Using Provider<'app-version'> is a hack to indicate that the provider
|
||||
* provides VersionService. The provider is not necessarily a 'app-version'
|
||||
* provider.
|
||||
*/
|
||||
function isVersionServiceProvider(provider) {
|
||||
var _a;
|
||||
var component = provider.getComponent();
|
||||
return ((_a = component) === null || _a === void 0 ? void 0 : _a.type) === "VERSION" /* VERSION */;
|
||||
}
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
function registerCoreComponents(firebase, variant) {
|
||||
firebase.INTERNAL.registerComponent(new Component('platform-logger', function (container) { return new PlatformLoggerService(container); }, "PRIVATE" /* PRIVATE */));
|
||||
// Register `app` package.
|
||||
firebase.registerVersion(name, version, variant);
|
||||
// Register platform SDK identifier (no version).
|
||||
firebase.registerVersion('fire-js', '');
|
||||
}
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2017 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
// Firebase Lite detection
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
if (isBrowser() && self.firebase !== undefined) {
|
||||
logger.warn("\n Warning: Firebase is already defined in the global scope. Please make sure\n Firebase library is only loaded once.\n ");
|
||||
// eslint-disable-next-line
|
||||
var sdkVersion = self.firebase.SDK_VERSION;
|
||||
if (sdkVersion && sdkVersion.indexOf('LITE') >= 0) {
|
||||
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 ");
|
||||
}
|
||||
}
|
||||
var initializeApp = firebase.initializeApp;
|
||||
// TODO: This disable can be removed and the 'ignoreRestArgs' option added to
|
||||
// the no-explicit-any rule when ESlint releases it.
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
firebase.initializeApp = function () {
|
||||
var args = [];
|
||||
for (var _i = 0; _i < arguments.length; _i++) {
|
||||
args[_i] = arguments[_i];
|
||||
}
|
||||
// Environment check before initializing app
|
||||
// Do the check in initializeApp, so people have a chance to disable it by setting logLevel
|
||||
// in @firebase/logger
|
||||
if (isNode()) {
|
||||
logger.warn("\n Warning: This is a browser-targeted Firebase bundle but it appears it is being\n run in a Node environment. If running in a Node environment, make sure you\n are using the bundle specified by the \"main\" field in package.json.\n \n If you are using Webpack, you can specify \"main\" as the first item in\n \"resolve.mainFields\":\n https://webpack.js.org/configuration/resolve/#resolvemainfields\n \n If using Rollup, use the rollup-plugin-node-resolve plugin and specify \"main\"\n as the first item in \"mainFields\", e.g. ['main', 'module'].\n https://github.com/rollup/rollup-plugin-node-resolve\n ");
|
||||
}
|
||||
return initializeApp.apply(undefined, args);
|
||||
};
|
||||
var firebase$1 = firebase;
|
||||
registerCoreComponents(firebase$1);
|
||||
|
||||
export default firebase$1;
|
||||
export { firebase$1 as firebase };
|
||||
//# sourceMappingURL=index.esm.js.map
|
1
node_modules/@firebase/app/dist/index.esm.js.map
generated
vendored
Normal file
1
node_modules/@firebase/app/dist/index.esm.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
625
node_modules/@firebase/app/dist/index.esm2017.js
generated
vendored
Normal file
625
node_modules/@firebase/app/dist/index.esm2017.js
generated
vendored
Normal file
@ -0,0 +1,625 @@
|
||||
import { ErrorFactory, deepCopy, contains, deepExtend, createSubscribe, isBrowser, isNode } from '@firebase/util';
|
||||
import { ComponentContainer, Component } from '@firebase/component';
|
||||
import { Logger } from '@firebase/logger';
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
const ERRORS = {
|
||||
["no-app" /* NO_APP */]: "No Firebase App '{$appName}' has been created - " +
|
||||
'call Firebase App.initializeApp()',
|
||||
["bad-app-name" /* BAD_APP_NAME */]: "Illegal App name: '{$appName}",
|
||||
["duplicate-app" /* DUPLICATE_APP */]: "Firebase App named '{$appName}' already exists",
|
||||
["app-deleted" /* APP_DELETED */]: "Firebase App named '{$appName}' already deleted",
|
||||
["invalid-app-argument" /* INVALID_APP_ARGUMENT */]: 'firebase.{$appName}() takes either no argument or a ' +
|
||||
'Firebase App instance.'
|
||||
};
|
||||
const ERROR_FACTORY = new ErrorFactory('app', 'Firebase', ERRORS);
|
||||
|
||||
const name = "@firebase/app";
|
||||
const version = "0.5.3";
|
||||
|
||||
const name$1 = "@firebase/analytics";
|
||||
|
||||
const name$2 = "@firebase/auth";
|
||||
|
||||
const name$3 = "@firebase/database";
|
||||
|
||||
const name$4 = "@firebase/functions";
|
||||
|
||||
const name$5 = "@firebase/installations";
|
||||
|
||||
const name$6 = "@firebase/messaging";
|
||||
|
||||
const name$7 = "@firebase/performance";
|
||||
|
||||
const name$8 = "@firebase/remote-config";
|
||||
|
||||
const name$9 = "@firebase/storage";
|
||||
|
||||
const name$a = "@firebase/firestore";
|
||||
|
||||
const name$b = "firebase-wrapper";
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
const DEFAULT_ENTRY_NAME = '[DEFAULT]';
|
||||
const PLATFORM_LOG_STRING = {
|
||||
[name]: 'fire-core',
|
||||
[name$1]: 'fire-analytics',
|
||||
[name$2]: 'fire-auth',
|
||||
[name$3]: 'fire-rtdb',
|
||||
[name$4]: 'fire-fn',
|
||||
[name$5]: 'fire-iid',
|
||||
[name$6]: 'fire-fcm',
|
||||
[name$7]: 'fire-perf',
|
||||
[name$8]: 'fire-rc',
|
||||
[name$9]: 'fire-gcs',
|
||||
[name$a]: 'fire-fst',
|
||||
'fire-js': 'fire-js',
|
||||
[name$b]: 'fire-js-all'
|
||||
};
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
const logger = new Logger('@firebase/app');
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2017 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
/**
|
||||
* Global context object for a collection of services using
|
||||
* a shared authentication state.
|
||||
*/
|
||||
class FirebaseAppImpl {
|
||||
constructor(options, config, firebase_) {
|
||||
this.firebase_ = firebase_;
|
||||
this.isDeleted_ = false;
|
||||
this.name_ = config.name;
|
||||
this.automaticDataCollectionEnabled_ =
|
||||
config.automaticDataCollectionEnabled || false;
|
||||
this.options_ = deepCopy(options);
|
||||
this.container = new ComponentContainer(config.name);
|
||||
// add itself to container
|
||||
this._addComponent(new Component('app', () => this, "PUBLIC" /* PUBLIC */));
|
||||
// populate ComponentContainer with existing components
|
||||
for (const component of this.firebase_.INTERNAL.components.values()) {
|
||||
this._addComponent(component);
|
||||
}
|
||||
}
|
||||
get automaticDataCollectionEnabled() {
|
||||
this.checkDestroyed_();
|
||||
return this.automaticDataCollectionEnabled_;
|
||||
}
|
||||
set automaticDataCollectionEnabled(val) {
|
||||
this.checkDestroyed_();
|
||||
this.automaticDataCollectionEnabled_ = val;
|
||||
}
|
||||
get name() {
|
||||
this.checkDestroyed_();
|
||||
return this.name_;
|
||||
}
|
||||
get options() {
|
||||
this.checkDestroyed_();
|
||||
return this.options_;
|
||||
}
|
||||
delete() {
|
||||
return new Promise(resolve => {
|
||||
this.checkDestroyed_();
|
||||
resolve();
|
||||
})
|
||||
.then(() => {
|
||||
this.firebase_.INTERNAL.removeApp(this.name_);
|
||||
return Promise.all(this.container.getProviders().map(provider => provider.delete()));
|
||||
})
|
||||
.then(() => {
|
||||
this.isDeleted_ = true;
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Return a service instance associated with this app (creating it
|
||||
* on demand), identified by the passed instanceIdentifier.
|
||||
*
|
||||
* NOTE: Currently storage and functions are the only ones that are leveraging this
|
||||
* functionality. They invoke it by calling:
|
||||
*
|
||||
* ```javascript
|
||||
* firebase.app().storage('STORAGE BUCKET ID')
|
||||
* ```
|
||||
*
|
||||
* The service name is passed to this already
|
||||
* @internal
|
||||
*/
|
||||
_getService(name, instanceIdentifier = DEFAULT_ENTRY_NAME) {
|
||||
this.checkDestroyed_();
|
||||
// getImmediate will always succeed because _getService is only called for registered components.
|
||||
return this.container.getProvider(name).getImmediate({
|
||||
identifier: instanceIdentifier
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Remove a service instance from the cache, so we will create a new instance for this service
|
||||
* when people try to get this service again.
|
||||
*
|
||||
* NOTE: currently only firestore is using this functionality to support firestore shutdown.
|
||||
*
|
||||
* @param name The service name
|
||||
* @param instanceIdentifier instance identifier in case multiple instances are allowed
|
||||
* @internal
|
||||
*/
|
||||
_removeServiceInstance(name, instanceIdentifier = DEFAULT_ENTRY_NAME) {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
this.container.getProvider(name).clearInstance(instanceIdentifier);
|
||||
}
|
||||
/**
|
||||
* @param component the component being added to this app's container
|
||||
*/
|
||||
_addComponent(component) {
|
||||
try {
|
||||
this.container.addComponent(component);
|
||||
}
|
||||
catch (e) {
|
||||
logger.debug(`Component ${component.name} failed to register with FirebaseApp ${this.name}`, e);
|
||||
}
|
||||
}
|
||||
_addOrOverwriteComponent(component) {
|
||||
this.container.addOrOverwriteComponent(component);
|
||||
}
|
||||
/**
|
||||
* This function will throw an Error if the App has already been deleted -
|
||||
* use before performing API actions on the App.
|
||||
*/
|
||||
checkDestroyed_() {
|
||||
if (this.isDeleted_) {
|
||||
throw ERROR_FACTORY.create("app-deleted" /* APP_DELETED */, { appName: this.name_ });
|
||||
}
|
||||
}
|
||||
}
|
||||
// Prevent dead-code elimination of these methods w/o invalid property
|
||||
// copying.
|
||||
(FirebaseAppImpl.prototype.name && FirebaseAppImpl.prototype.options) ||
|
||||
FirebaseAppImpl.prototype.delete ||
|
||||
console.log('dc');
|
||||
|
||||
const version$1 = "7.8.0";
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
/**
|
||||
* Because auth can't share code with other components, we attach the utility functions
|
||||
* in an internal namespace to share code.
|
||||
* This function return a firebase namespace object without
|
||||
* any utility functions, so it can be shared between the regular firebaseNamespace and
|
||||
* the lite version.
|
||||
*/
|
||||
function createFirebaseNamespaceCore(firebaseAppImpl) {
|
||||
const apps = {};
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const components = new Map();
|
||||
// A namespace is a plain JavaScript Object.
|
||||
const namespace = {
|
||||
// Hack to prevent Babel from modifying the object returned
|
||||
// as the firebase namespace.
|
||||
// @ts-ignore
|
||||
__esModule: true,
|
||||
initializeApp,
|
||||
// @ts-ignore
|
||||
app,
|
||||
registerVersion,
|
||||
// @ts-ignore
|
||||
apps: null,
|
||||
SDK_VERSION: version$1,
|
||||
INTERNAL: {
|
||||
registerComponent,
|
||||
removeApp,
|
||||
components,
|
||||
useAsService
|
||||
}
|
||||
};
|
||||
// Inject a circular default export to allow Babel users who were previously
|
||||
// using:
|
||||
//
|
||||
// import firebase from 'firebase';
|
||||
// which becomes: var firebase = require('firebase').default;
|
||||
//
|
||||
// instead of
|
||||
//
|
||||
// import * as firebase from 'firebase';
|
||||
// which becomes: var firebase = require('firebase');
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
namespace['default'] = namespace;
|
||||
// firebase.apps is a read-only getter.
|
||||
Object.defineProperty(namespace, 'apps', {
|
||||
get: getApps
|
||||
});
|
||||
/**
|
||||
* Called by App.delete() - but before any services associated with the App
|
||||
* are deleted.
|
||||
*/
|
||||
function removeApp(name) {
|
||||
delete apps[name];
|
||||
}
|
||||
/**
|
||||
* Get the App object for a given name (or DEFAULT).
|
||||
*/
|
||||
function app(name) {
|
||||
name = name || DEFAULT_ENTRY_NAME;
|
||||
if (!contains(apps, name)) {
|
||||
throw ERROR_FACTORY.create("no-app" /* NO_APP */, { appName: name });
|
||||
}
|
||||
return apps[name];
|
||||
}
|
||||
// @ts-ignore
|
||||
app['App'] = firebaseAppImpl;
|
||||
function initializeApp(options, rawConfig = {}) {
|
||||
if (typeof rawConfig !== 'object' || rawConfig === null) {
|
||||
const name = rawConfig;
|
||||
rawConfig = { name };
|
||||
}
|
||||
const config = rawConfig;
|
||||
if (config.name === undefined) {
|
||||
config.name = DEFAULT_ENTRY_NAME;
|
||||
}
|
||||
const { name } = config;
|
||||
if (typeof name !== 'string' || !name) {
|
||||
throw ERROR_FACTORY.create("bad-app-name" /* BAD_APP_NAME */, {
|
||||
appName: String(name)
|
||||
});
|
||||
}
|
||||
if (contains(apps, name)) {
|
||||
throw ERROR_FACTORY.create("duplicate-app" /* DUPLICATE_APP */, { appName: name });
|
||||
}
|
||||
const app = new firebaseAppImpl(options, config, namespace);
|
||||
apps[name] = app;
|
||||
return app;
|
||||
}
|
||||
/*
|
||||
* Return an array of all the non-deleted FirebaseApps.
|
||||
*/
|
||||
function getApps() {
|
||||
// Make a copy so caller cannot mutate the apps list.
|
||||
return Object.keys(apps).map(name => apps[name]);
|
||||
}
|
||||
function registerComponent(component) {
|
||||
const componentName = component.name;
|
||||
if (components.has(componentName)) {
|
||||
logger.debug(`There were multiple attempts to register component ${componentName}.`);
|
||||
return component.type === "PUBLIC" /* PUBLIC */
|
||||
? // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
namespace[componentName]
|
||||
: null;
|
||||
}
|
||||
components.set(componentName, component);
|
||||
// create service namespace for public components
|
||||
if (component.type === "PUBLIC" /* PUBLIC */) {
|
||||
// The Service namespace is an accessor function ...
|
||||
const serviceNamespace = (appArg = app()) => {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
if (typeof appArg[componentName] !== 'function') {
|
||||
// Invalid argument.
|
||||
// This happens in the following case: firebase.storage('gs:/')
|
||||
throw ERROR_FACTORY.create("invalid-app-argument" /* INVALID_APP_ARGUMENT */, {
|
||||
appName: componentName
|
||||
});
|
||||
}
|
||||
// Forward service instance lookup to the FirebaseApp.
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
return appArg[componentName]();
|
||||
};
|
||||
// ... and a container for service-level properties.
|
||||
if (component.serviceProps !== undefined) {
|
||||
deepExtend(serviceNamespace, component.serviceProps);
|
||||
}
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
namespace[componentName] = serviceNamespace;
|
||||
// Patch the FirebaseAppImpl prototype
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
firebaseAppImpl.prototype[componentName] =
|
||||
// TODO: The eslint disable can be removed and the 'ignoreRestArgs'
|
||||
// option added to the no-explicit-any rule when ESlint releases it.
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
function (...args) {
|
||||
const serviceFxn = this._getService.bind(this, componentName);
|
||||
return serviceFxn.apply(this, component.multipleInstances ? args : []);
|
||||
};
|
||||
}
|
||||
// add the component to existing app instances
|
||||
for (const appName of Object.keys(apps)) {
|
||||
apps[appName]._addComponent(component);
|
||||
}
|
||||
return component.type === "PUBLIC" /* PUBLIC */
|
||||
? // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
namespace[componentName]
|
||||
: null;
|
||||
}
|
||||
function registerVersion(libraryKeyOrName, version, variant) {
|
||||
var _a;
|
||||
// TODO: We can use this check to whitelist strings when/if we set up
|
||||
// a good whitelist system.
|
||||
let library = (_a = PLATFORM_LOG_STRING[libraryKeyOrName], (_a !== null && _a !== void 0 ? _a : libraryKeyOrName));
|
||||
if (variant) {
|
||||
library += `-${variant}`;
|
||||
}
|
||||
const libraryMismatch = library.match(/\s|\//);
|
||||
const versionMismatch = version.match(/\s|\//);
|
||||
if (libraryMismatch || versionMismatch) {
|
||||
const warning = [
|
||||
`Unable to register library "${library}" with version "${version}":`
|
||||
];
|
||||
if (libraryMismatch) {
|
||||
warning.push(`library name "${library}" contains illegal characters (whitespace or "/")`);
|
||||
}
|
||||
if (libraryMismatch && versionMismatch) {
|
||||
warning.push('and');
|
||||
}
|
||||
if (versionMismatch) {
|
||||
warning.push(`version name "${version}" contains illegal characters (whitespace or "/")`);
|
||||
}
|
||||
logger.warn(warning.join(' '));
|
||||
return;
|
||||
}
|
||||
registerComponent(new Component(`${library}-version`, () => ({ library, version }), "VERSION" /* VERSION */));
|
||||
}
|
||||
// Map the requested service to a registered service name
|
||||
// (used to map auth to serverAuth service when needed).
|
||||
function useAsService(app, name) {
|
||||
if (name === 'serverAuth') {
|
||||
return null;
|
||||
}
|
||||
const useService = name;
|
||||
return useService;
|
||||
}
|
||||
return namespace;
|
||||
}
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
/**
|
||||
* Return a firebase namespace object.
|
||||
*
|
||||
* In production, this will be called exactly once and the result
|
||||
* assigned to the 'firebase' global. It may be called multiple times
|
||||
* in unit tests.
|
||||
*/
|
||||
function createFirebaseNamespace() {
|
||||
const namespace = createFirebaseNamespaceCore(FirebaseAppImpl);
|
||||
namespace.INTERNAL = Object.assign(Object.assign({}, namespace.INTERNAL), { createFirebaseNamespace,
|
||||
extendNamespace,
|
||||
createSubscribe,
|
||||
ErrorFactory,
|
||||
deepExtend });
|
||||
/**
|
||||
* Patch the top-level firebase namespace with additional properties.
|
||||
*
|
||||
* firebase.INTERNAL.extendNamespace()
|
||||
*/
|
||||
function extendNamespace(props) {
|
||||
deepExtend(namespace, props);
|
||||
}
|
||||
return namespace;
|
||||
}
|
||||
const firebase = createFirebaseNamespace();
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
class PlatformLoggerService {
|
||||
constructor(container) {
|
||||
this.container = container;
|
||||
}
|
||||
// In initial implementation, this will be called by installations on
|
||||
// auth token refresh, and installations will send this string.
|
||||
getPlatformInfoString() {
|
||||
const providers = this.container.getProviders();
|
||||
// Loop through providers and get library/version pairs from any that are
|
||||
// version components.
|
||||
return providers
|
||||
.map(provider => {
|
||||
if (isVersionServiceProvider(provider)) {
|
||||
const service = provider.getImmediate();
|
||||
return `${service.library}/${service.version}`;
|
||||
}
|
||||
else {
|
||||
return null;
|
||||
}
|
||||
})
|
||||
.filter(logString => logString)
|
||||
.join(' ');
|
||||
}
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param provider check if this provider provides a VersionService
|
||||
*
|
||||
* NOTE: Using Provider<'app-version'> is a hack to indicate that the provider
|
||||
* provides VersionService. The provider is not necessarily a 'app-version'
|
||||
* provider.
|
||||
*/
|
||||
function isVersionServiceProvider(provider) {
|
||||
var _a;
|
||||
const component = provider.getComponent();
|
||||
return ((_a = component) === null || _a === void 0 ? void 0 : _a.type) === "VERSION" /* VERSION */;
|
||||
}
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
function registerCoreComponents(firebase, variant) {
|
||||
firebase.INTERNAL.registerComponent(new Component('platform-logger', container => new PlatformLoggerService(container), "PRIVATE" /* PRIVATE */));
|
||||
// Register `app` package.
|
||||
firebase.registerVersion(name, version, variant);
|
||||
// Register platform SDK identifier (no version).
|
||||
firebase.registerVersion('fire-js', '');
|
||||
}
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2017 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
// Firebase Lite detection
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
if (isBrowser() && self.firebase !== undefined) {
|
||||
logger.warn(`
|
||||
Warning: Firebase is already defined in the global scope. Please make sure
|
||||
Firebase library is only loaded once.
|
||||
`);
|
||||
// eslint-disable-next-line
|
||||
const sdkVersion = self.firebase.SDK_VERSION;
|
||||
if (sdkVersion && sdkVersion.indexOf('LITE') >= 0) {
|
||||
logger.warn(`
|
||||
Warning: You are trying to load Firebase while using Firebase Performance standalone script.
|
||||
You should load Firebase Performance with this instance of Firebase to avoid loading duplicate code.
|
||||
`);
|
||||
}
|
||||
}
|
||||
const initializeApp = firebase.initializeApp;
|
||||
// TODO: This disable can be removed and the 'ignoreRestArgs' option added to
|
||||
// the no-explicit-any rule when ESlint releases it.
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
firebase.initializeApp = function (...args) {
|
||||
// Environment check before initializing app
|
||||
// Do the check in initializeApp, so people have a chance to disable it by setting logLevel
|
||||
// in @firebase/logger
|
||||
if (isNode()) {
|
||||
logger.warn(`
|
||||
Warning: This is a browser-targeted Firebase bundle but it appears it is being
|
||||
run in a Node environment. If running in a Node environment, make sure you
|
||||
are using the bundle specified by the "main" field in package.json.
|
||||
|
||||
If you are using Webpack, you can specify "main" as the first item in
|
||||
"resolve.mainFields":
|
||||
https://webpack.js.org/configuration/resolve/#resolvemainfields
|
||||
|
||||
If using Rollup, use the rollup-plugin-node-resolve plugin and specify "main"
|
||||
as the first item in "mainFields", e.g. ['main', 'module'].
|
||||
https://github.com/rollup/rollup-plugin-node-resolve
|
||||
`);
|
||||
}
|
||||
return initializeApp.apply(undefined, args);
|
||||
};
|
||||
const firebase$1 = firebase;
|
||||
registerCoreComponents(firebase$1);
|
||||
|
||||
export default firebase$1;
|
||||
export { firebase$1 as firebase };
|
||||
//# sourceMappingURL=index.esm2017.js.map
|
1
node_modules/@firebase/app/dist/index.esm2017.js.map
generated
vendored
Normal file
1
node_modules/@firebase/app/dist/index.esm2017.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
551
node_modules/@firebase/app/dist/index.lite.esm2017.js
generated
vendored
Normal file
551
node_modules/@firebase/app/dist/index.lite.esm2017.js
generated
vendored
Normal file
@ -0,0 +1,551 @@
|
||||
import { ErrorFactory, deepCopy, contains, deepExtend } from '@firebase/util';
|
||||
import { ComponentContainer, Component } from '@firebase/component';
|
||||
import { Logger } from '@firebase/logger';
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
const ERRORS = {
|
||||
["no-app" /* NO_APP */]: "No Firebase App '{$appName}' has been created - " +
|
||||
'call Firebase App.initializeApp()',
|
||||
["bad-app-name" /* BAD_APP_NAME */]: "Illegal App name: '{$appName}",
|
||||
["duplicate-app" /* DUPLICATE_APP */]: "Firebase App named '{$appName}' already exists",
|
||||
["app-deleted" /* APP_DELETED */]: "Firebase App named '{$appName}' already deleted",
|
||||
["invalid-app-argument" /* INVALID_APP_ARGUMENT */]: 'firebase.{$appName}() takes either no argument or a ' +
|
||||
'Firebase App instance.'
|
||||
};
|
||||
const ERROR_FACTORY = new ErrorFactory('app', 'Firebase', ERRORS);
|
||||
|
||||
const name$1 = "@firebase/app";
|
||||
const version = "0.5.3";
|
||||
|
||||
const name$2 = "@firebase/analytics";
|
||||
|
||||
const name$3 = "@firebase/auth";
|
||||
|
||||
const name$4 = "@firebase/database";
|
||||
|
||||
const name$5 = "@firebase/functions";
|
||||
|
||||
const name$6 = "@firebase/installations";
|
||||
|
||||
const name$7 = "@firebase/messaging";
|
||||
|
||||
const name$8 = "@firebase/performance";
|
||||
|
||||
const name$9 = "@firebase/remote-config";
|
||||
|
||||
const name$a = "@firebase/storage";
|
||||
|
||||
const name$b = "@firebase/firestore";
|
||||
|
||||
const name$c = "firebase-wrapper";
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
const DEFAULT_ENTRY_NAME = '[DEFAULT]';
|
||||
const PLATFORM_LOG_STRING = {
|
||||
[name$1]: 'fire-core',
|
||||
[name$2]: 'fire-analytics',
|
||||
[name$3]: 'fire-auth',
|
||||
[name$4]: 'fire-rtdb',
|
||||
[name$5]: 'fire-fn',
|
||||
[name$6]: 'fire-iid',
|
||||
[name$7]: 'fire-fcm',
|
||||
[name$8]: 'fire-perf',
|
||||
[name$9]: 'fire-rc',
|
||||
[name$a]: 'fire-gcs',
|
||||
[name$b]: 'fire-fst',
|
||||
'fire-js': 'fire-js',
|
||||
[name$c]: 'fire-js-all'
|
||||
};
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
/**
|
||||
* Global context object for a collection of services using
|
||||
* a shared authentication state.
|
||||
*/
|
||||
class FirebaseAppLiteImpl {
|
||||
constructor(options, config, firebase_) {
|
||||
this.firebase_ = firebase_;
|
||||
this.isDeleted_ = false;
|
||||
// lite version has an empty INTERNAL namespace
|
||||
this.INTERNAL = {};
|
||||
this.name_ = config.name;
|
||||
this.automaticDataCollectionEnabled_ =
|
||||
config.automaticDataCollectionEnabled || false;
|
||||
this.options_ = deepCopy(options);
|
||||
this.container = new ComponentContainer(config.name);
|
||||
// add itself to container
|
||||
this.container.addComponent(new Component('app', () => this, "PUBLIC" /* PUBLIC */));
|
||||
// populate ComponentContainer with existing components
|
||||
for (const component of this.firebase_.INTERNAL.components.values()) {
|
||||
this.container.addComponent(component);
|
||||
}
|
||||
}
|
||||
get automaticDataCollectionEnabled() {
|
||||
this.checkDestroyed_();
|
||||
return this.automaticDataCollectionEnabled_;
|
||||
}
|
||||
set automaticDataCollectionEnabled(val) {
|
||||
this.checkDestroyed_();
|
||||
this.automaticDataCollectionEnabled_ = val;
|
||||
}
|
||||
get name() {
|
||||
this.checkDestroyed_();
|
||||
return this.name_;
|
||||
}
|
||||
get options() {
|
||||
this.checkDestroyed_();
|
||||
return this.options_;
|
||||
}
|
||||
delete() {
|
||||
return new Promise(resolve => {
|
||||
this.checkDestroyed_();
|
||||
resolve();
|
||||
})
|
||||
.then(() => {
|
||||
this.firebase_.INTERNAL.removeApp(this.name_);
|
||||
return Promise.all(this.container.getProviders().map(provider => provider.delete()));
|
||||
})
|
||||
.then(() => {
|
||||
this.isDeleted_ = true;
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Return a service instance associated with this app (creating it
|
||||
* on demand), identified by the passed instanceIdentifier.
|
||||
*
|
||||
* NOTE: Currently storage is the only one that is leveraging this
|
||||
* functionality. They invoke it by calling:
|
||||
*
|
||||
* ```javascript
|
||||
* firebase.app().storage('STORAGE BUCKET ID')
|
||||
* ```
|
||||
*
|
||||
* The service name is passed to this already
|
||||
* @internal
|
||||
*/
|
||||
_getService(name, instanceIdentifier = DEFAULT_ENTRY_NAME) {
|
||||
this.checkDestroyed_();
|
||||
// getImmediate will always succeed because _getService is only called for registered components.
|
||||
return this.container.getProvider(name).getImmediate({
|
||||
identifier: instanceIdentifier
|
||||
});
|
||||
}
|
||||
/**
|
||||
* This function will throw an Error if the App has already been deleted -
|
||||
* use before performing API actions on the App.
|
||||
*/
|
||||
checkDestroyed_() {
|
||||
if (this.isDeleted_) {
|
||||
throw ERROR_FACTORY.create("app-deleted" /* APP_DELETED */, { appName: this.name_ });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const version$1 = "7.8.0";
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
const logger = new Logger('@firebase/app');
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
/**
|
||||
* Because auth can't share code with other components, we attach the utility functions
|
||||
* in an internal namespace to share code.
|
||||
* This function return a firebase namespace object without
|
||||
* any utility functions, so it can be shared between the regular firebaseNamespace and
|
||||
* the lite version.
|
||||
*/
|
||||
function createFirebaseNamespaceCore(firebaseAppImpl) {
|
||||
const apps = {};
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const components = new Map();
|
||||
// A namespace is a plain JavaScript Object.
|
||||
const namespace = {
|
||||
// Hack to prevent Babel from modifying the object returned
|
||||
// as the firebase namespace.
|
||||
// @ts-ignore
|
||||
__esModule: true,
|
||||
initializeApp,
|
||||
// @ts-ignore
|
||||
app,
|
||||
registerVersion,
|
||||
// @ts-ignore
|
||||
apps: null,
|
||||
SDK_VERSION: version$1,
|
||||
INTERNAL: {
|
||||
registerComponent,
|
||||
removeApp,
|
||||
components,
|
||||
useAsService
|
||||
}
|
||||
};
|
||||
// Inject a circular default export to allow Babel users who were previously
|
||||
// using:
|
||||
//
|
||||
// import firebase from 'firebase';
|
||||
// which becomes: var firebase = require('firebase').default;
|
||||
//
|
||||
// instead of
|
||||
//
|
||||
// import * as firebase from 'firebase';
|
||||
// which becomes: var firebase = require('firebase');
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
namespace['default'] = namespace;
|
||||
// firebase.apps is a read-only getter.
|
||||
Object.defineProperty(namespace, 'apps', {
|
||||
get: getApps
|
||||
});
|
||||
/**
|
||||
* Called by App.delete() - but before any services associated with the App
|
||||
* are deleted.
|
||||
*/
|
||||
function removeApp(name) {
|
||||
delete apps[name];
|
||||
}
|
||||
/**
|
||||
* Get the App object for a given name (or DEFAULT).
|
||||
*/
|
||||
function app(name) {
|
||||
name = name || DEFAULT_ENTRY_NAME;
|
||||
if (!contains(apps, name)) {
|
||||
throw ERROR_FACTORY.create("no-app" /* NO_APP */, { appName: name });
|
||||
}
|
||||
return apps[name];
|
||||
}
|
||||
// @ts-ignore
|
||||
app['App'] = firebaseAppImpl;
|
||||
function initializeApp(options, rawConfig = {}) {
|
||||
if (typeof rawConfig !== 'object' || rawConfig === null) {
|
||||
const name = rawConfig;
|
||||
rawConfig = { name };
|
||||
}
|
||||
const config = rawConfig;
|
||||
if (config.name === undefined) {
|
||||
config.name = DEFAULT_ENTRY_NAME;
|
||||
}
|
||||
const { name } = config;
|
||||
if (typeof name !== 'string' || !name) {
|
||||
throw ERROR_FACTORY.create("bad-app-name" /* BAD_APP_NAME */, {
|
||||
appName: String(name)
|
||||
});
|
||||
}
|
||||
if (contains(apps, name)) {
|
||||
throw ERROR_FACTORY.create("duplicate-app" /* DUPLICATE_APP */, { appName: name });
|
||||
}
|
||||
const app = new firebaseAppImpl(options, config, namespace);
|
||||
apps[name] = app;
|
||||
return app;
|
||||
}
|
||||
/*
|
||||
* Return an array of all the non-deleted FirebaseApps.
|
||||
*/
|
||||
function getApps() {
|
||||
// Make a copy so caller cannot mutate the apps list.
|
||||
return Object.keys(apps).map(name => apps[name]);
|
||||
}
|
||||
function registerComponent(component) {
|
||||
const componentName = component.name;
|
||||
if (components.has(componentName)) {
|
||||
logger.debug(`There were multiple attempts to register component ${componentName}.`);
|
||||
return component.type === "PUBLIC" /* PUBLIC */
|
||||
? // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
namespace[componentName]
|
||||
: null;
|
||||
}
|
||||
components.set(componentName, component);
|
||||
// create service namespace for public components
|
||||
if (component.type === "PUBLIC" /* PUBLIC */) {
|
||||
// The Service namespace is an accessor function ...
|
||||
const serviceNamespace = (appArg = app()) => {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
if (typeof appArg[componentName] !== 'function') {
|
||||
// Invalid argument.
|
||||
// This happens in the following case: firebase.storage('gs:/')
|
||||
throw ERROR_FACTORY.create("invalid-app-argument" /* INVALID_APP_ARGUMENT */, {
|
||||
appName: componentName
|
||||
});
|
||||
}
|
||||
// Forward service instance lookup to the FirebaseApp.
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
return appArg[componentName]();
|
||||
};
|
||||
// ... and a container for service-level properties.
|
||||
if (component.serviceProps !== undefined) {
|
||||
deepExtend(serviceNamespace, component.serviceProps);
|
||||
}
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
namespace[componentName] = serviceNamespace;
|
||||
// Patch the FirebaseAppImpl prototype
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
firebaseAppImpl.prototype[componentName] =
|
||||
// TODO: The eslint disable can be removed and the 'ignoreRestArgs'
|
||||
// option added to the no-explicit-any rule when ESlint releases it.
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
function (...args) {
|
||||
const serviceFxn = this._getService.bind(this, componentName);
|
||||
return serviceFxn.apply(this, component.multipleInstances ? args : []);
|
||||
};
|
||||
}
|
||||
// add the component to existing app instances
|
||||
for (const appName of Object.keys(apps)) {
|
||||
apps[appName]._addComponent(component);
|
||||
}
|
||||
return component.type === "PUBLIC" /* PUBLIC */
|
||||
? // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
namespace[componentName]
|
||||
: null;
|
||||
}
|
||||
function registerVersion(libraryKeyOrName, version, variant) {
|
||||
var _a;
|
||||
// TODO: We can use this check to whitelist strings when/if we set up
|
||||
// a good whitelist system.
|
||||
let library = (_a = PLATFORM_LOG_STRING[libraryKeyOrName], (_a !== null && _a !== void 0 ? _a : libraryKeyOrName));
|
||||
if (variant) {
|
||||
library += `-${variant}`;
|
||||
}
|
||||
const libraryMismatch = library.match(/\s|\//);
|
||||
const versionMismatch = version.match(/\s|\//);
|
||||
if (libraryMismatch || versionMismatch) {
|
||||
const warning = [
|
||||
`Unable to register library "${library}" with version "${version}":`
|
||||
];
|
||||
if (libraryMismatch) {
|
||||
warning.push(`library name "${library}" contains illegal characters (whitespace or "/")`);
|
||||
}
|
||||
if (libraryMismatch && versionMismatch) {
|
||||
warning.push('and');
|
||||
}
|
||||
if (versionMismatch) {
|
||||
warning.push(`version name "${version}" contains illegal characters (whitespace or "/")`);
|
||||
}
|
||||
logger.warn(warning.join(' '));
|
||||
return;
|
||||
}
|
||||
registerComponent(new Component(`${library}-version`, () => ({ library, version }), "VERSION" /* VERSION */));
|
||||
}
|
||||
// Map the requested service to a registered service name
|
||||
// (used to map auth to serverAuth service when needed).
|
||||
function useAsService(app, name) {
|
||||
if (name === 'serverAuth') {
|
||||
return null;
|
||||
}
|
||||
const useService = name;
|
||||
return useService;
|
||||
}
|
||||
return namespace;
|
||||
}
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
function createFirebaseNamespaceLite() {
|
||||
const namespace = createFirebaseNamespaceCore(FirebaseAppLiteImpl);
|
||||
namespace.SDK_VERSION = `${namespace.SDK_VERSION}_LITE`;
|
||||
const registerComponent = namespace.INTERNAL
|
||||
.registerComponent;
|
||||
namespace.INTERNAL.registerComponent = registerComponentForLite;
|
||||
/**
|
||||
* This is a special implementation, so it only works with performance.
|
||||
* only allow performance SDK to register.
|
||||
*/
|
||||
function registerComponentForLite(
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
component) {
|
||||
// only allow performance to register with firebase lite
|
||||
if (component.type === "PUBLIC" /* PUBLIC */ &&
|
||||
component.name !== 'performance' &&
|
||||
component.name !== 'installations') {
|
||||
throw Error(`${name} cannot register with the standalone perf instance`);
|
||||
}
|
||||
return registerComponent(component);
|
||||
}
|
||||
return namespace;
|
||||
}
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
class PlatformLoggerService {
|
||||
constructor(container) {
|
||||
this.container = container;
|
||||
}
|
||||
// In initial implementation, this will be called by installations on
|
||||
// auth token refresh, and installations will send this string.
|
||||
getPlatformInfoString() {
|
||||
const providers = this.container.getProviders();
|
||||
// Loop through providers and get library/version pairs from any that are
|
||||
// version components.
|
||||
return providers
|
||||
.map(provider => {
|
||||
if (isVersionServiceProvider(provider)) {
|
||||
const service = provider.getImmediate();
|
||||
return `${service.library}/${service.version}`;
|
||||
}
|
||||
else {
|
||||
return null;
|
||||
}
|
||||
})
|
||||
.filter(logString => logString)
|
||||
.join(' ');
|
||||
}
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param provider check if this provider provides a VersionService
|
||||
*
|
||||
* NOTE: Using Provider<'app-version'> is a hack to indicate that the provider
|
||||
* provides VersionService. The provider is not necessarily a 'app-version'
|
||||
* provider.
|
||||
*/
|
||||
function isVersionServiceProvider(provider) {
|
||||
var _a;
|
||||
const component = provider.getComponent();
|
||||
return ((_a = component) === null || _a === void 0 ? void 0 : _a.type) === "VERSION" /* VERSION */;
|
||||
}
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
function registerCoreComponents(firebase, variant) {
|
||||
firebase.INTERNAL.registerComponent(new Component('platform-logger', container => new PlatformLoggerService(container), "PRIVATE" /* PRIVATE */));
|
||||
// Register `app` package.
|
||||
firebase.registerVersion(name$1, version, variant);
|
||||
// Register platform SDK identifier (no version).
|
||||
firebase.registerVersion('fire-js', '');
|
||||
}
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
const firebase = createFirebaseNamespaceLite();
|
||||
registerCoreComponents(firebase, 'lite');
|
||||
|
||||
export default firebase;
|
||||
export { firebase };
|
||||
//# sourceMappingURL=index.lite.esm2017.js.map
|
1
node_modules/@firebase/app/dist/index.lite.esm2017.js.map
generated
vendored
Normal file
1
node_modules/@firebase/app/dist/index.lite.esm2017.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
599
node_modules/@firebase/app/dist/index.lite.js
generated
vendored
Normal file
599
node_modules/@firebase/app/dist/index.lite.js
generated
vendored
Normal file
@ -0,0 +1,599 @@
|
||||
import { __values } from 'tslib';
|
||||
import { ErrorFactory, deepCopy, contains, deepExtend } from '@firebase/util';
|
||||
import { ComponentContainer, Component } from '@firebase/component';
|
||||
import { Logger } from '@firebase/logger';
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
var _a;
|
||||
var ERRORS = (_a = {},
|
||||
_a["no-app" /* NO_APP */] = "No Firebase App '{$appName}' has been created - " +
|
||||
'call Firebase App.initializeApp()',
|
||||
_a["bad-app-name" /* BAD_APP_NAME */] = "Illegal App name: '{$appName}",
|
||||
_a["duplicate-app" /* DUPLICATE_APP */] = "Firebase App named '{$appName}' already exists",
|
||||
_a["app-deleted" /* APP_DELETED */] = "Firebase App named '{$appName}' already deleted",
|
||||
_a["invalid-app-argument" /* INVALID_APP_ARGUMENT */] = 'firebase.{$appName}() takes either no argument or a ' +
|
||||
'Firebase App instance.',
|
||||
_a);
|
||||
var ERROR_FACTORY = new ErrorFactory('app', 'Firebase', ERRORS);
|
||||
|
||||
var name$1 = "@firebase/app";
|
||||
var version = "0.5.3";
|
||||
|
||||
var name$2 = "@firebase/analytics";
|
||||
|
||||
var name$3 = "@firebase/auth";
|
||||
|
||||
var name$4 = "@firebase/database";
|
||||
|
||||
var name$5 = "@firebase/functions";
|
||||
|
||||
var name$6 = "@firebase/installations";
|
||||
|
||||
var name$7 = "@firebase/messaging";
|
||||
|
||||
var name$8 = "@firebase/performance";
|
||||
|
||||
var name$9 = "@firebase/remote-config";
|
||||
|
||||
var name$a = "@firebase/storage";
|
||||
|
||||
var name$b = "@firebase/firestore";
|
||||
|
||||
var name$c = "firebase-wrapper";
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
var _a$1;
|
||||
var DEFAULT_ENTRY_NAME = '[DEFAULT]';
|
||||
var PLATFORM_LOG_STRING = (_a$1 = {},
|
||||
_a$1[name$1] = 'fire-core',
|
||||
_a$1[name$2] = 'fire-analytics',
|
||||
_a$1[name$3] = 'fire-auth',
|
||||
_a$1[name$4] = 'fire-rtdb',
|
||||
_a$1[name$5] = 'fire-fn',
|
||||
_a$1[name$6] = 'fire-iid',
|
||||
_a$1[name$7] = 'fire-fcm',
|
||||
_a$1[name$8] = 'fire-perf',
|
||||
_a$1[name$9] = 'fire-rc',
|
||||
_a$1[name$a] = 'fire-gcs',
|
||||
_a$1[name$b] = 'fire-fst',
|
||||
_a$1['fire-js'] = 'fire-js',
|
||||
_a$1[name$c] = 'fire-js-all',
|
||||
_a$1);
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
/**
|
||||
* Global context object for a collection of services using
|
||||
* a shared authentication state.
|
||||
*/
|
||||
var FirebaseAppLiteImpl = /** @class */ (function () {
|
||||
function FirebaseAppLiteImpl(options, config, firebase_) {
|
||||
var e_1, _a;
|
||||
var _this = this;
|
||||
this.firebase_ = firebase_;
|
||||
this.isDeleted_ = false;
|
||||
// lite version has an empty INTERNAL namespace
|
||||
this.INTERNAL = {};
|
||||
this.name_ = config.name;
|
||||
this.automaticDataCollectionEnabled_ =
|
||||
config.automaticDataCollectionEnabled || false;
|
||||
this.options_ = deepCopy(options);
|
||||
this.container = new ComponentContainer(config.name);
|
||||
// add itself to container
|
||||
this.container.addComponent(new Component('app', function () { return _this; }, "PUBLIC" /* PUBLIC */));
|
||||
try {
|
||||
// populate ComponentContainer with existing components
|
||||
for (var _b = __values(this.firebase_.INTERNAL.components.values()), _c = _b.next(); !_c.done; _c = _b.next()) {
|
||||
var component = _c.value;
|
||||
this.container.addComponent(component);
|
||||
}
|
||||
}
|
||||
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
||||
finally {
|
||||
try {
|
||||
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
||||
}
|
||||
finally { if (e_1) throw e_1.error; }
|
||||
}
|
||||
}
|
||||
Object.defineProperty(FirebaseAppLiteImpl.prototype, "automaticDataCollectionEnabled", {
|
||||
get: function () {
|
||||
this.checkDestroyed_();
|
||||
return this.automaticDataCollectionEnabled_;
|
||||
},
|
||||
set: function (val) {
|
||||
this.checkDestroyed_();
|
||||
this.automaticDataCollectionEnabled_ = val;
|
||||
},
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
Object.defineProperty(FirebaseAppLiteImpl.prototype, "name", {
|
||||
get: function () {
|
||||
this.checkDestroyed_();
|
||||
return this.name_;
|
||||
},
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
Object.defineProperty(FirebaseAppLiteImpl.prototype, "options", {
|
||||
get: function () {
|
||||
this.checkDestroyed_();
|
||||
return this.options_;
|
||||
},
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
FirebaseAppLiteImpl.prototype.delete = function () {
|
||||
var _this = this;
|
||||
return new Promise(function (resolve) {
|
||||
_this.checkDestroyed_();
|
||||
resolve();
|
||||
})
|
||||
.then(function () {
|
||||
_this.firebase_.INTERNAL.removeApp(_this.name_);
|
||||
return Promise.all(_this.container.getProviders().map(function (provider) { return provider.delete(); }));
|
||||
})
|
||||
.then(function () {
|
||||
_this.isDeleted_ = true;
|
||||
});
|
||||
};
|
||||
/**
|
||||
* Return a service instance associated with this app (creating it
|
||||
* on demand), identified by the passed instanceIdentifier.
|
||||
*
|
||||
* NOTE: Currently storage is the only one that is leveraging this
|
||||
* functionality. They invoke it by calling:
|
||||
*
|
||||
* ```javascript
|
||||
* firebase.app().storage('STORAGE BUCKET ID')
|
||||
* ```
|
||||
*
|
||||
* The service name is passed to this already
|
||||
* @internal
|
||||
*/
|
||||
FirebaseAppLiteImpl.prototype._getService = function (name, instanceIdentifier) {
|
||||
if (instanceIdentifier === void 0) { instanceIdentifier = DEFAULT_ENTRY_NAME; }
|
||||
this.checkDestroyed_();
|
||||
// getImmediate will always succeed because _getService is only called for registered components.
|
||||
return this.container.getProvider(name).getImmediate({
|
||||
identifier: instanceIdentifier
|
||||
});
|
||||
};
|
||||
/**
|
||||
* This function will throw an Error if the App has already been deleted -
|
||||
* use before performing API actions on the App.
|
||||
*/
|
||||
FirebaseAppLiteImpl.prototype.checkDestroyed_ = function () {
|
||||
if (this.isDeleted_) {
|
||||
throw ERROR_FACTORY.create("app-deleted" /* APP_DELETED */, { appName: this.name_ });
|
||||
}
|
||||
};
|
||||
return FirebaseAppLiteImpl;
|
||||
}());
|
||||
|
||||
var version$1 = "7.8.0";
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
var logger = new Logger('@firebase/app');
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
/**
|
||||
* Because auth can't share code with other components, we attach the utility functions
|
||||
* in an internal namespace to share code.
|
||||
* This function return a firebase namespace object without
|
||||
* any utility functions, so it can be shared between the regular firebaseNamespace and
|
||||
* the lite version.
|
||||
*/
|
||||
function createFirebaseNamespaceCore(firebaseAppImpl) {
|
||||
var apps = {};
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
var components = new Map();
|
||||
// A namespace is a plain JavaScript Object.
|
||||
var namespace = {
|
||||
// Hack to prevent Babel from modifying the object returned
|
||||
// as the firebase namespace.
|
||||
// @ts-ignore
|
||||
__esModule: true,
|
||||
initializeApp: initializeApp,
|
||||
// @ts-ignore
|
||||
app: app,
|
||||
registerVersion: registerVersion,
|
||||
// @ts-ignore
|
||||
apps: null,
|
||||
SDK_VERSION: version$1,
|
||||
INTERNAL: {
|
||||
registerComponent: registerComponent,
|
||||
removeApp: removeApp,
|
||||
components: components,
|
||||
useAsService: useAsService
|
||||
}
|
||||
};
|
||||
// Inject a circular default export to allow Babel users who were previously
|
||||
// using:
|
||||
//
|
||||
// import firebase from 'firebase';
|
||||
// which becomes: var firebase = require('firebase').default;
|
||||
//
|
||||
// instead of
|
||||
//
|
||||
// import * as firebase from 'firebase';
|
||||
// which becomes: var firebase = require('firebase');
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
namespace['default'] = namespace;
|
||||
// firebase.apps is a read-only getter.
|
||||
Object.defineProperty(namespace, 'apps', {
|
||||
get: getApps
|
||||
});
|
||||
/**
|
||||
* Called by App.delete() - but before any services associated with the App
|
||||
* are deleted.
|
||||
*/
|
||||
function removeApp(name) {
|
||||
delete apps[name];
|
||||
}
|
||||
/**
|
||||
* Get the App object for a given name (or DEFAULT).
|
||||
*/
|
||||
function app(name) {
|
||||
name = name || DEFAULT_ENTRY_NAME;
|
||||
if (!contains(apps, name)) {
|
||||
throw ERROR_FACTORY.create("no-app" /* NO_APP */, { appName: name });
|
||||
}
|
||||
return apps[name];
|
||||
}
|
||||
// @ts-ignore
|
||||
app['App'] = firebaseAppImpl;
|
||||
function initializeApp(options, rawConfig) {
|
||||
if (rawConfig === void 0) { rawConfig = {}; }
|
||||
if (typeof rawConfig !== 'object' || rawConfig === null) {
|
||||
var name_1 = rawConfig;
|
||||
rawConfig = { name: name_1 };
|
||||
}
|
||||
var config = rawConfig;
|
||||
if (config.name === undefined) {
|
||||
config.name = DEFAULT_ENTRY_NAME;
|
||||
}
|
||||
var name = config.name;
|
||||
if (typeof name !== 'string' || !name) {
|
||||
throw ERROR_FACTORY.create("bad-app-name" /* BAD_APP_NAME */, {
|
||||
appName: String(name)
|
||||
});
|
||||
}
|
||||
if (contains(apps, name)) {
|
||||
throw ERROR_FACTORY.create("duplicate-app" /* DUPLICATE_APP */, { appName: name });
|
||||
}
|
||||
var app = new firebaseAppImpl(options, config, namespace);
|
||||
apps[name] = app;
|
||||
return app;
|
||||
}
|
||||
/*
|
||||
* Return an array of all the non-deleted FirebaseApps.
|
||||
*/
|
||||
function getApps() {
|
||||
// Make a copy so caller cannot mutate the apps list.
|
||||
return Object.keys(apps).map(function (name) { return apps[name]; });
|
||||
}
|
||||
function registerComponent(component) {
|
||||
var e_1, _a;
|
||||
var componentName = component.name;
|
||||
if (components.has(componentName)) {
|
||||
logger.debug("There were multiple attempts to register component " + componentName + ".");
|
||||
return component.type === "PUBLIC" /* PUBLIC */
|
||||
? // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
namespace[componentName]
|
||||
: null;
|
||||
}
|
||||
components.set(componentName, component);
|
||||
// create service namespace for public components
|
||||
if (component.type === "PUBLIC" /* PUBLIC */) {
|
||||
// The Service namespace is an accessor function ...
|
||||
var serviceNamespace = function (appArg) {
|
||||
if (appArg === void 0) { appArg = app(); }
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
if (typeof appArg[componentName] !== 'function') {
|
||||
// Invalid argument.
|
||||
// This happens in the following case: firebase.storage('gs:/')
|
||||
throw ERROR_FACTORY.create("invalid-app-argument" /* INVALID_APP_ARGUMENT */, {
|
||||
appName: componentName
|
||||
});
|
||||
}
|
||||
// Forward service instance lookup to the FirebaseApp.
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
return appArg[componentName]();
|
||||
};
|
||||
// ... and a container for service-level properties.
|
||||
if (component.serviceProps !== undefined) {
|
||||
deepExtend(serviceNamespace, component.serviceProps);
|
||||
}
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
namespace[componentName] = serviceNamespace;
|
||||
// Patch the FirebaseAppImpl prototype
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
firebaseAppImpl.prototype[componentName] =
|
||||
// TODO: The eslint disable can be removed and the 'ignoreRestArgs'
|
||||
// option added to the no-explicit-any rule when ESlint releases it.
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
function () {
|
||||
var args = [];
|
||||
for (var _i = 0; _i < arguments.length; _i++) {
|
||||
args[_i] = arguments[_i];
|
||||
}
|
||||
var serviceFxn = this._getService.bind(this, componentName);
|
||||
return serviceFxn.apply(this, component.multipleInstances ? args : []);
|
||||
};
|
||||
}
|
||||
try {
|
||||
// add the component to existing app instances
|
||||
for (var _b = __values(Object.keys(apps)), _c = _b.next(); !_c.done; _c = _b.next()) {
|
||||
var appName = _c.value;
|
||||
apps[appName]._addComponent(component);
|
||||
}
|
||||
}
|
||||
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
||||
finally {
|
||||
try {
|
||||
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
||||
}
|
||||
finally { if (e_1) throw e_1.error; }
|
||||
}
|
||||
return component.type === "PUBLIC" /* PUBLIC */
|
||||
? // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
namespace[componentName]
|
||||
: null;
|
||||
}
|
||||
function registerVersion(libraryKeyOrName, version, variant) {
|
||||
var _a;
|
||||
// TODO: We can use this check to whitelist strings when/if we set up
|
||||
// a good whitelist system.
|
||||
var library = (_a = PLATFORM_LOG_STRING[libraryKeyOrName], (_a !== null && _a !== void 0 ? _a : libraryKeyOrName));
|
||||
if (variant) {
|
||||
library += "-" + variant;
|
||||
}
|
||||
var libraryMismatch = library.match(/\s|\//);
|
||||
var versionMismatch = version.match(/\s|\//);
|
||||
if (libraryMismatch || versionMismatch) {
|
||||
var warning = [
|
||||
"Unable to register library \"" + library + "\" with version \"" + version + "\":"
|
||||
];
|
||||
if (libraryMismatch) {
|
||||
warning.push("library name \"" + library + "\" contains illegal characters (whitespace or \"/\")");
|
||||
}
|
||||
if (libraryMismatch && versionMismatch) {
|
||||
warning.push('and');
|
||||
}
|
||||
if (versionMismatch) {
|
||||
warning.push("version name \"" + version + "\" contains illegal characters (whitespace or \"/\")");
|
||||
}
|
||||
logger.warn(warning.join(' '));
|
||||
return;
|
||||
}
|
||||
registerComponent(new Component(library + "-version", function () { return ({ library: library, version: version }); }, "VERSION" /* VERSION */));
|
||||
}
|
||||
// Map the requested service to a registered service name
|
||||
// (used to map auth to serverAuth service when needed).
|
||||
function useAsService(app, name) {
|
||||
if (name === 'serverAuth') {
|
||||
return null;
|
||||
}
|
||||
var useService = name;
|
||||
return useService;
|
||||
}
|
||||
return namespace;
|
||||
}
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
function createFirebaseNamespaceLite() {
|
||||
var namespace = createFirebaseNamespaceCore(FirebaseAppLiteImpl);
|
||||
namespace.SDK_VERSION = namespace.SDK_VERSION + "_LITE";
|
||||
var registerComponent = namespace.INTERNAL
|
||||
.registerComponent;
|
||||
namespace.INTERNAL.registerComponent = registerComponentForLite;
|
||||
/**
|
||||
* This is a special implementation, so it only works with performance.
|
||||
* only allow performance SDK to register.
|
||||
*/
|
||||
function registerComponentForLite(
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
component) {
|
||||
// only allow performance to register with firebase lite
|
||||
if (component.type === "PUBLIC" /* PUBLIC */ &&
|
||||
component.name !== 'performance' &&
|
||||
component.name !== 'installations') {
|
||||
throw Error(name + " cannot register with the standalone perf instance");
|
||||
}
|
||||
return registerComponent(component);
|
||||
}
|
||||
return namespace;
|
||||
}
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
var PlatformLoggerService = /** @class */ (function () {
|
||||
function PlatformLoggerService(container) {
|
||||
this.container = container;
|
||||
}
|
||||
// In initial implementation, this will be called by installations on
|
||||
// auth token refresh, and installations will send this string.
|
||||
PlatformLoggerService.prototype.getPlatformInfoString = function () {
|
||||
var providers = this.container.getProviders();
|
||||
// Loop through providers and get library/version pairs from any that are
|
||||
// version components.
|
||||
return providers
|
||||
.map(function (provider) {
|
||||
if (isVersionServiceProvider(provider)) {
|
||||
var service = provider.getImmediate();
|
||||
return service.library + "/" + service.version;
|
||||
}
|
||||
else {
|
||||
return null;
|
||||
}
|
||||
})
|
||||
.filter(function (logString) { return logString; })
|
||||
.join(' ');
|
||||
};
|
||||
return PlatformLoggerService;
|
||||
}());
|
||||
/**
|
||||
*
|
||||
* @param provider check if this provider provides a VersionService
|
||||
*
|
||||
* NOTE: Using Provider<'app-version'> is a hack to indicate that the provider
|
||||
* provides VersionService. The provider is not necessarily a 'app-version'
|
||||
* provider.
|
||||
*/
|
||||
function isVersionServiceProvider(provider) {
|
||||
var _a;
|
||||
var component = provider.getComponent();
|
||||
return ((_a = component) === null || _a === void 0 ? void 0 : _a.type) === "VERSION" /* VERSION */;
|
||||
}
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
function registerCoreComponents(firebase, variant) {
|
||||
firebase.INTERNAL.registerComponent(new Component('platform-logger', function (container) { return new PlatformLoggerService(container); }, "PRIVATE" /* PRIVATE */));
|
||||
// Register `app` package.
|
||||
firebase.registerVersion(name$1, version, variant);
|
||||
// Register platform SDK identifier (no version).
|
||||
firebase.registerVersion('fire-js', '');
|
||||
}
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
var firebase = createFirebaseNamespaceLite();
|
||||
registerCoreComponents(firebase, 'lite');
|
||||
|
||||
export default firebase;
|
||||
export { firebase };
|
||||
//# sourceMappingURL=index.lite.js.map
|
1
node_modules/@firebase/app/dist/index.lite.js.map
generated
vendored
Normal file
1
node_modules/@firebase/app/dist/index.lite.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
650
node_modules/@firebase/app/dist/index.node.cjs.js
generated
vendored
Normal file
650
node_modules/@firebase/app/dist/index.node.cjs.js
generated
vendored
Normal file
@ -0,0 +1,650 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', { value: true });
|
||||
|
||||
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
|
||||
|
||||
var tslib = require('tslib');
|
||||
var util = require('@firebase/util');
|
||||
var component = require('@firebase/component');
|
||||
var logger$1 = require('@firebase/logger');
|
||||
var Storage = _interopDefault(require('dom-storage'));
|
||||
var xmlhttprequest = require('xmlhttprequest');
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
var _a;
|
||||
var ERRORS = (_a = {},
|
||||
_a["no-app" /* NO_APP */] = "No Firebase App '{$appName}' has been created - " +
|
||||
'call Firebase App.initializeApp()',
|
||||
_a["bad-app-name" /* BAD_APP_NAME */] = "Illegal App name: '{$appName}",
|
||||
_a["duplicate-app" /* DUPLICATE_APP */] = "Firebase App named '{$appName}' already exists",
|
||||
_a["app-deleted" /* APP_DELETED */] = "Firebase App named '{$appName}' already deleted",
|
||||
_a["invalid-app-argument" /* INVALID_APP_ARGUMENT */] = 'firebase.{$appName}() takes either no argument or a ' +
|
||||
'Firebase App instance.',
|
||||
_a);
|
||||
var ERROR_FACTORY = new util.ErrorFactory('app', 'Firebase', ERRORS);
|
||||
|
||||
var name = "@firebase/app";
|
||||
var version = "0.5.3";
|
||||
|
||||
var name$1 = "@firebase/analytics";
|
||||
|
||||
var name$2 = "@firebase/auth";
|
||||
|
||||
var name$3 = "@firebase/database";
|
||||
|
||||
var name$4 = "@firebase/functions";
|
||||
|
||||
var name$5 = "@firebase/installations";
|
||||
|
||||
var name$6 = "@firebase/messaging";
|
||||
|
||||
var name$7 = "@firebase/performance";
|
||||
|
||||
var name$8 = "@firebase/remote-config";
|
||||
|
||||
var name$9 = "@firebase/storage";
|
||||
|
||||
var name$a = "@firebase/firestore";
|
||||
|
||||
var name$b = "firebase-wrapper";
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
var _a$1;
|
||||
var DEFAULT_ENTRY_NAME = '[DEFAULT]';
|
||||
var PLATFORM_LOG_STRING = (_a$1 = {},
|
||||
_a$1[name] = 'fire-core',
|
||||
_a$1[name$1] = 'fire-analytics',
|
||||
_a$1[name$2] = 'fire-auth',
|
||||
_a$1[name$3] = 'fire-rtdb',
|
||||
_a$1[name$4] = 'fire-fn',
|
||||
_a$1[name$5] = 'fire-iid',
|
||||
_a$1[name$6] = 'fire-fcm',
|
||||
_a$1[name$7] = 'fire-perf',
|
||||
_a$1[name$8] = 'fire-rc',
|
||||
_a$1[name$9] = 'fire-gcs',
|
||||
_a$1[name$a] = 'fire-fst',
|
||||
_a$1['fire-js'] = 'fire-js',
|
||||
_a$1[name$b] = 'fire-js-all',
|
||||
_a$1);
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
var logger = new logger$1.Logger('@firebase/app');
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2017 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
/**
|
||||
* Global context object for a collection of services using
|
||||
* a shared authentication state.
|
||||
*/
|
||||
var FirebaseAppImpl = /** @class */ (function () {
|
||||
function FirebaseAppImpl(options, config, firebase_) {
|
||||
var e_1, _a;
|
||||
var _this = this;
|
||||
this.firebase_ = firebase_;
|
||||
this.isDeleted_ = false;
|
||||
this.name_ = config.name;
|
||||
this.automaticDataCollectionEnabled_ =
|
||||
config.automaticDataCollectionEnabled || false;
|
||||
this.options_ = util.deepCopy(options);
|
||||
this.container = new component.ComponentContainer(config.name);
|
||||
// add itself to container
|
||||
this._addComponent(new component.Component('app', function () { return _this; }, "PUBLIC" /* PUBLIC */));
|
||||
try {
|
||||
// populate ComponentContainer with existing components
|
||||
for (var _b = tslib.__values(this.firebase_.INTERNAL.components.values()), _c = _b.next(); !_c.done; _c = _b.next()) {
|
||||
var component$1 = _c.value;
|
||||
this._addComponent(component$1);
|
||||
}
|
||||
}
|
||||
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
||||
finally {
|
||||
try {
|
||||
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
||||
}
|
||||
finally { if (e_1) throw e_1.error; }
|
||||
}
|
||||
}
|
||||
Object.defineProperty(FirebaseAppImpl.prototype, "automaticDataCollectionEnabled", {
|
||||
get: function () {
|
||||
this.checkDestroyed_();
|
||||
return this.automaticDataCollectionEnabled_;
|
||||
},
|
||||
set: function (val) {
|
||||
this.checkDestroyed_();
|
||||
this.automaticDataCollectionEnabled_ = val;
|
||||
},
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
Object.defineProperty(FirebaseAppImpl.prototype, "name", {
|
||||
get: function () {
|
||||
this.checkDestroyed_();
|
||||
return this.name_;
|
||||
},
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
Object.defineProperty(FirebaseAppImpl.prototype, "options", {
|
||||
get: function () {
|
||||
this.checkDestroyed_();
|
||||
return this.options_;
|
||||
},
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
FirebaseAppImpl.prototype.delete = function () {
|
||||
var _this = this;
|
||||
return new Promise(function (resolve) {
|
||||
_this.checkDestroyed_();
|
||||
resolve();
|
||||
})
|
||||
.then(function () {
|
||||
_this.firebase_.INTERNAL.removeApp(_this.name_);
|
||||
return Promise.all(_this.container.getProviders().map(function (provider) { return provider.delete(); }));
|
||||
})
|
||||
.then(function () {
|
||||
_this.isDeleted_ = true;
|
||||
});
|
||||
};
|
||||
/**
|
||||
* Return a service instance associated with this app (creating it
|
||||
* on demand), identified by the passed instanceIdentifier.
|
||||
*
|
||||
* NOTE: Currently storage and functions are the only ones that are leveraging this
|
||||
* functionality. They invoke it by calling:
|
||||
*
|
||||
* ```javascript
|
||||
* firebase.app().storage('STORAGE BUCKET ID')
|
||||
* ```
|
||||
*
|
||||
* The service name is passed to this already
|
||||
* @internal
|
||||
*/
|
||||
FirebaseAppImpl.prototype._getService = function (name, instanceIdentifier) {
|
||||
if (instanceIdentifier === void 0) { instanceIdentifier = DEFAULT_ENTRY_NAME; }
|
||||
this.checkDestroyed_();
|
||||
// getImmediate will always succeed because _getService is only called for registered components.
|
||||
return this.container.getProvider(name).getImmediate({
|
||||
identifier: instanceIdentifier
|
||||
});
|
||||
};
|
||||
/**
|
||||
* Remove a service instance from the cache, so we will create a new instance for this service
|
||||
* when people try to get this service again.
|
||||
*
|
||||
* NOTE: currently only firestore is using this functionality to support firestore shutdown.
|
||||
*
|
||||
* @param name The service name
|
||||
* @param instanceIdentifier instance identifier in case multiple instances are allowed
|
||||
* @internal
|
||||
*/
|
||||
FirebaseAppImpl.prototype._removeServiceInstance = function (name, instanceIdentifier) {
|
||||
if (instanceIdentifier === void 0) { instanceIdentifier = DEFAULT_ENTRY_NAME; }
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
this.container.getProvider(name).clearInstance(instanceIdentifier);
|
||||
};
|
||||
/**
|
||||
* @param component the component being added to this app's container
|
||||
*/
|
||||
FirebaseAppImpl.prototype._addComponent = function (component) {
|
||||
try {
|
||||
this.container.addComponent(component);
|
||||
}
|
||||
catch (e) {
|
||||
logger.debug("Component " + component.name + " failed to register with FirebaseApp " + this.name, e);
|
||||
}
|
||||
};
|
||||
FirebaseAppImpl.prototype._addOrOverwriteComponent = function (component) {
|
||||
this.container.addOrOverwriteComponent(component);
|
||||
};
|
||||
/**
|
||||
* This function will throw an Error if the App has already been deleted -
|
||||
* use before performing API actions on the App.
|
||||
*/
|
||||
FirebaseAppImpl.prototype.checkDestroyed_ = function () {
|
||||
if (this.isDeleted_) {
|
||||
throw ERROR_FACTORY.create("app-deleted" /* APP_DELETED */, { appName: this.name_ });
|
||||
}
|
||||
};
|
||||
return FirebaseAppImpl;
|
||||
}());
|
||||
// Prevent dead-code elimination of these methods w/o invalid property
|
||||
// copying.
|
||||
(FirebaseAppImpl.prototype.name && FirebaseAppImpl.prototype.options) ||
|
||||
FirebaseAppImpl.prototype.delete ||
|
||||
console.log('dc');
|
||||
|
||||
var version$1 = "7.8.0";
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
/**
|
||||
* Because auth can't share code with other components, we attach the utility functions
|
||||
* in an internal namespace to share code.
|
||||
* This function return a firebase namespace object without
|
||||
* any utility functions, so it can be shared between the regular firebaseNamespace and
|
||||
* the lite version.
|
||||
*/
|
||||
function createFirebaseNamespaceCore(firebaseAppImpl) {
|
||||
var apps = {};
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
var components = new Map();
|
||||
// A namespace is a plain JavaScript Object.
|
||||
var namespace = {
|
||||
// Hack to prevent Babel from modifying the object returned
|
||||
// as the firebase namespace.
|
||||
// @ts-ignore
|
||||
__esModule: true,
|
||||
initializeApp: initializeApp,
|
||||
// @ts-ignore
|
||||
app: app,
|
||||
registerVersion: registerVersion,
|
||||
// @ts-ignore
|
||||
apps: null,
|
||||
SDK_VERSION: version$1,
|
||||
INTERNAL: {
|
||||
registerComponent: registerComponent,
|
||||
removeApp: removeApp,
|
||||
components: components,
|
||||
useAsService: useAsService
|
||||
}
|
||||
};
|
||||
// Inject a circular default export to allow Babel users who were previously
|
||||
// using:
|
||||
//
|
||||
// import firebase from 'firebase';
|
||||
// which becomes: var firebase = require('firebase').default;
|
||||
//
|
||||
// instead of
|
||||
//
|
||||
// import * as firebase from 'firebase';
|
||||
// which becomes: var firebase = require('firebase');
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
namespace['default'] = namespace;
|
||||
// firebase.apps is a read-only getter.
|
||||
Object.defineProperty(namespace, 'apps', {
|
||||
get: getApps
|
||||
});
|
||||
/**
|
||||
* Called by App.delete() - but before any services associated with the App
|
||||
* are deleted.
|
||||
*/
|
||||
function removeApp(name) {
|
||||
delete apps[name];
|
||||
}
|
||||
/**
|
||||
* Get the App object for a given name (or DEFAULT).
|
||||
*/
|
||||
function app(name) {
|
||||
name = name || DEFAULT_ENTRY_NAME;
|
||||
if (!util.contains(apps, name)) {
|
||||
throw ERROR_FACTORY.create("no-app" /* NO_APP */, { appName: name });
|
||||
}
|
||||
return apps[name];
|
||||
}
|
||||
// @ts-ignore
|
||||
app['App'] = firebaseAppImpl;
|
||||
function initializeApp(options, rawConfig) {
|
||||
if (rawConfig === void 0) { rawConfig = {}; }
|
||||
if (typeof rawConfig !== 'object' || rawConfig === null) {
|
||||
var name_1 = rawConfig;
|
||||
rawConfig = { name: name_1 };
|
||||
}
|
||||
var config = rawConfig;
|
||||
if (config.name === undefined) {
|
||||
config.name = DEFAULT_ENTRY_NAME;
|
||||
}
|
||||
var name = config.name;
|
||||
if (typeof name !== 'string' || !name) {
|
||||
throw ERROR_FACTORY.create("bad-app-name" /* BAD_APP_NAME */, {
|
||||
appName: String(name)
|
||||
});
|
||||
}
|
||||
if (util.contains(apps, name)) {
|
||||
throw ERROR_FACTORY.create("duplicate-app" /* DUPLICATE_APP */, { appName: name });
|
||||
}
|
||||
var app = new firebaseAppImpl(options, config, namespace);
|
||||
apps[name] = app;
|
||||
return app;
|
||||
}
|
||||
/*
|
||||
* Return an array of all the non-deleted FirebaseApps.
|
||||
*/
|
||||
function getApps() {
|
||||
// Make a copy so caller cannot mutate the apps list.
|
||||
return Object.keys(apps).map(function (name) { return apps[name]; });
|
||||
}
|
||||
function registerComponent(component) {
|
||||
var e_1, _a;
|
||||
var componentName = component.name;
|
||||
if (components.has(componentName)) {
|
||||
logger.debug("There were multiple attempts to register component " + componentName + ".");
|
||||
return component.type === "PUBLIC" /* PUBLIC */
|
||||
? // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
namespace[componentName]
|
||||
: null;
|
||||
}
|
||||
components.set(componentName, component);
|
||||
// create service namespace for public components
|
||||
if (component.type === "PUBLIC" /* PUBLIC */) {
|
||||
// The Service namespace is an accessor function ...
|
||||
var serviceNamespace = function (appArg) {
|
||||
if (appArg === void 0) { appArg = app(); }
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
if (typeof appArg[componentName] !== 'function') {
|
||||
// Invalid argument.
|
||||
// This happens in the following case: firebase.storage('gs:/')
|
||||
throw ERROR_FACTORY.create("invalid-app-argument" /* INVALID_APP_ARGUMENT */, {
|
||||
appName: componentName
|
||||
});
|
||||
}
|
||||
// Forward service instance lookup to the FirebaseApp.
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
return appArg[componentName]();
|
||||
};
|
||||
// ... and a container for service-level properties.
|
||||
if (component.serviceProps !== undefined) {
|
||||
util.deepExtend(serviceNamespace, component.serviceProps);
|
||||
}
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
namespace[componentName] = serviceNamespace;
|
||||
// Patch the FirebaseAppImpl prototype
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
firebaseAppImpl.prototype[componentName] =
|
||||
// TODO: The eslint disable can be removed and the 'ignoreRestArgs'
|
||||
// option added to the no-explicit-any rule when ESlint releases it.
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
function () {
|
||||
var args = [];
|
||||
for (var _i = 0; _i < arguments.length; _i++) {
|
||||
args[_i] = arguments[_i];
|
||||
}
|
||||
var serviceFxn = this._getService.bind(this, componentName);
|
||||
return serviceFxn.apply(this, component.multipleInstances ? args : []);
|
||||
};
|
||||
}
|
||||
try {
|
||||
// add the component to existing app instances
|
||||
for (var _b = tslib.__values(Object.keys(apps)), _c = _b.next(); !_c.done; _c = _b.next()) {
|
||||
var appName = _c.value;
|
||||
apps[appName]._addComponent(component);
|
||||
}
|
||||
}
|
||||
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
||||
finally {
|
||||
try {
|
||||
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
||||
}
|
||||
finally { if (e_1) throw e_1.error; }
|
||||
}
|
||||
return component.type === "PUBLIC" /* PUBLIC */
|
||||
? // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
namespace[componentName]
|
||||
: null;
|
||||
}
|
||||
function registerVersion(libraryKeyOrName, version, variant) {
|
||||
var _a;
|
||||
// TODO: We can use this check to whitelist strings when/if we set up
|
||||
// a good whitelist system.
|
||||
var library = (_a = PLATFORM_LOG_STRING[libraryKeyOrName], (_a !== null && _a !== void 0 ? _a : libraryKeyOrName));
|
||||
if (variant) {
|
||||
library += "-" + variant;
|
||||
}
|
||||
var libraryMismatch = library.match(/\s|\//);
|
||||
var versionMismatch = version.match(/\s|\//);
|
||||
if (libraryMismatch || versionMismatch) {
|
||||
var warning = [
|
||||
"Unable to register library \"" + library + "\" with version \"" + version + "\":"
|
||||
];
|
||||
if (libraryMismatch) {
|
||||
warning.push("library name \"" + library + "\" contains illegal characters (whitespace or \"/\")");
|
||||
}
|
||||
if (libraryMismatch && versionMismatch) {
|
||||
warning.push('and');
|
||||
}
|
||||
if (versionMismatch) {
|
||||
warning.push("version name \"" + version + "\" contains illegal characters (whitespace or \"/\")");
|
||||
}
|
||||
logger.warn(warning.join(' '));
|
||||
return;
|
||||
}
|
||||
registerComponent(new component.Component(library + "-version", function () { return ({ library: library, version: version }); }, "VERSION" /* VERSION */));
|
||||
}
|
||||
// Map the requested service to a registered service name
|
||||
// (used to map auth to serverAuth service when needed).
|
||||
function useAsService(app, name) {
|
||||
if (name === 'serverAuth') {
|
||||
return null;
|
||||
}
|
||||
var useService = name;
|
||||
return useService;
|
||||
}
|
||||
return namespace;
|
||||
}
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
/**
|
||||
* Return a firebase namespace object.
|
||||
*
|
||||
* In production, this will be called exactly once and the result
|
||||
* assigned to the 'firebase' global. It may be called multiple times
|
||||
* in unit tests.
|
||||
*/
|
||||
function createFirebaseNamespace() {
|
||||
var namespace = createFirebaseNamespaceCore(FirebaseAppImpl);
|
||||
namespace.INTERNAL = tslib.__assign(tslib.__assign({}, namespace.INTERNAL), { createFirebaseNamespace: createFirebaseNamespace,
|
||||
extendNamespace: extendNamespace,
|
||||
createSubscribe: util.createSubscribe,
|
||||
ErrorFactory: util.ErrorFactory,
|
||||
deepExtend: util.deepExtend });
|
||||
/**
|
||||
* Patch the top-level firebase namespace with additional properties.
|
||||
*
|
||||
* firebase.INTERNAL.extendNamespace()
|
||||
*/
|
||||
function extendNamespace(props) {
|
||||
util.deepExtend(namespace, props);
|
||||
}
|
||||
return namespace;
|
||||
}
|
||||
var firebase = createFirebaseNamespace();
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
var PlatformLoggerService = /** @class */ (function () {
|
||||
function PlatformLoggerService(container) {
|
||||
this.container = container;
|
||||
}
|
||||
// In initial implementation, this will be called by installations on
|
||||
// auth token refresh, and installations will send this string.
|
||||
PlatformLoggerService.prototype.getPlatformInfoString = function () {
|
||||
var providers = this.container.getProviders();
|
||||
// Loop through providers and get library/version pairs from any that are
|
||||
// version components.
|
||||
return providers
|
||||
.map(function (provider) {
|
||||
if (isVersionServiceProvider(provider)) {
|
||||
var service = provider.getImmediate();
|
||||
return service.library + "/" + service.version;
|
||||
}
|
||||
else {
|
||||
return null;
|
||||
}
|
||||
})
|
||||
.filter(function (logString) { return logString; })
|
||||
.join(' ');
|
||||
};
|
||||
return PlatformLoggerService;
|
||||
}());
|
||||
/**
|
||||
*
|
||||
* @param provider check if this provider provides a VersionService
|
||||
*
|
||||
* NOTE: Using Provider<'app-version'> is a hack to indicate that the provider
|
||||
* provides VersionService. The provider is not necessarily a 'app-version'
|
||||
* provider.
|
||||
*/
|
||||
function isVersionServiceProvider(provider) {
|
||||
var _a;
|
||||
var component = provider.getComponent();
|
||||
return ((_a = component) === null || _a === void 0 ? void 0 : _a.type) === "VERSION" /* VERSION */;
|
||||
}
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
function registerCoreComponents(firebase, variant) {
|
||||
firebase.INTERNAL.registerComponent(new component.Component('platform-logger', function (container) { return new PlatformLoggerService(container); }, "PRIVATE" /* PRIVATE */));
|
||||
// Register `app` package.
|
||||
firebase.registerVersion(name, version, variant);
|
||||
// Register platform SDK identifier (no version).
|
||||
firebase.registerVersion('fire-js', '');
|
||||
}
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2017 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
firebase.INTERNAL.extendNamespace({
|
||||
INTERNAL: {
|
||||
node: {
|
||||
localStorage: new Storage(null, { strict: true }),
|
||||
sessionStorage: new Storage(null, { strict: true }),
|
||||
XMLHttpRequest: xmlhttprequest.XMLHttpRequest
|
||||
}
|
||||
}
|
||||
});
|
||||
var firebase$1 = firebase;
|
||||
registerCoreComponents(firebase$1, 'node');
|
||||
|
||||
exports.default = firebase$1;
|
||||
exports.firebase = firebase$1;
|
||||
//# sourceMappingURL=index.node.cjs.js.map
|
1
node_modules/@firebase/app/dist/index.node.cjs.js.map
generated
vendored
Normal file
1
node_modules/@firebase/app/dist/index.node.cjs.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
651
node_modules/@firebase/app/dist/index.rn.cjs.js
generated
vendored
Normal file
651
node_modules/@firebase/app/dist/index.rn.cjs.js
generated
vendored
Normal file
@ -0,0 +1,651 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', { value: true });
|
||||
|
||||
var tslib = require('tslib');
|
||||
var util = require('@firebase/util');
|
||||
var component = require('@firebase/component');
|
||||
var logger$1 = require('@firebase/logger');
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
var _a;
|
||||
var ERRORS = (_a = {},
|
||||
_a["no-app" /* NO_APP */] = "No Firebase App '{$appName}' has been created - " +
|
||||
'call Firebase App.initializeApp()',
|
||||
_a["bad-app-name" /* BAD_APP_NAME */] = "Illegal App name: '{$appName}",
|
||||
_a["duplicate-app" /* DUPLICATE_APP */] = "Firebase App named '{$appName}' already exists",
|
||||
_a["app-deleted" /* APP_DELETED */] = "Firebase App named '{$appName}' already deleted",
|
||||
_a["invalid-app-argument" /* INVALID_APP_ARGUMENT */] = 'firebase.{$appName}() takes either no argument or a ' +
|
||||
'Firebase App instance.',
|
||||
_a);
|
||||
var ERROR_FACTORY = new util.ErrorFactory('app', 'Firebase', ERRORS);
|
||||
|
||||
var name = "@firebase/app";
|
||||
var version = "0.5.3";
|
||||
|
||||
var name$1 = "@firebase/analytics";
|
||||
|
||||
var name$2 = "@firebase/auth";
|
||||
|
||||
var name$3 = "@firebase/database";
|
||||
|
||||
var name$4 = "@firebase/functions";
|
||||
|
||||
var name$5 = "@firebase/installations";
|
||||
|
||||
var name$6 = "@firebase/messaging";
|
||||
|
||||
var name$7 = "@firebase/performance";
|
||||
|
||||
var name$8 = "@firebase/remote-config";
|
||||
|
||||
var name$9 = "@firebase/storage";
|
||||
|
||||
var name$a = "@firebase/firestore";
|
||||
|
||||
var name$b = "firebase-wrapper";
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
var _a$1;
|
||||
var DEFAULT_ENTRY_NAME = '[DEFAULT]';
|
||||
var PLATFORM_LOG_STRING = (_a$1 = {},
|
||||
_a$1[name] = 'fire-core',
|
||||
_a$1[name$1] = 'fire-analytics',
|
||||
_a$1[name$2] = 'fire-auth',
|
||||
_a$1[name$3] = 'fire-rtdb',
|
||||
_a$1[name$4] = 'fire-fn',
|
||||
_a$1[name$5] = 'fire-iid',
|
||||
_a$1[name$6] = 'fire-fcm',
|
||||
_a$1[name$7] = 'fire-perf',
|
||||
_a$1[name$8] = 'fire-rc',
|
||||
_a$1[name$9] = 'fire-gcs',
|
||||
_a$1[name$a] = 'fire-fst',
|
||||
_a$1['fire-js'] = 'fire-js',
|
||||
_a$1[name$b] = 'fire-js-all',
|
||||
_a$1);
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
var logger = new logger$1.Logger('@firebase/app');
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2017 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
/**
|
||||
* Global context object for a collection of services using
|
||||
* a shared authentication state.
|
||||
*/
|
||||
var FirebaseAppImpl = /** @class */ (function () {
|
||||
function FirebaseAppImpl(options, config, firebase_) {
|
||||
var e_1, _a;
|
||||
var _this = this;
|
||||
this.firebase_ = firebase_;
|
||||
this.isDeleted_ = false;
|
||||
this.name_ = config.name;
|
||||
this.automaticDataCollectionEnabled_ =
|
||||
config.automaticDataCollectionEnabled || false;
|
||||
this.options_ = util.deepCopy(options);
|
||||
this.container = new component.ComponentContainer(config.name);
|
||||
// add itself to container
|
||||
this._addComponent(new component.Component('app', function () { return _this; }, "PUBLIC" /* PUBLIC */));
|
||||
try {
|
||||
// populate ComponentContainer with existing components
|
||||
for (var _b = tslib.__values(this.firebase_.INTERNAL.components.values()), _c = _b.next(); !_c.done; _c = _b.next()) {
|
||||
var component$1 = _c.value;
|
||||
this._addComponent(component$1);
|
||||
}
|
||||
}
|
||||
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
||||
finally {
|
||||
try {
|
||||
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
||||
}
|
||||
finally { if (e_1) throw e_1.error; }
|
||||
}
|
||||
}
|
||||
Object.defineProperty(FirebaseAppImpl.prototype, "automaticDataCollectionEnabled", {
|
||||
get: function () {
|
||||
this.checkDestroyed_();
|
||||
return this.automaticDataCollectionEnabled_;
|
||||
},
|
||||
set: function (val) {
|
||||
this.checkDestroyed_();
|
||||
this.automaticDataCollectionEnabled_ = val;
|
||||
},
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
Object.defineProperty(FirebaseAppImpl.prototype, "name", {
|
||||
get: function () {
|
||||
this.checkDestroyed_();
|
||||
return this.name_;
|
||||
},
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
Object.defineProperty(FirebaseAppImpl.prototype, "options", {
|
||||
get: function () {
|
||||
this.checkDestroyed_();
|
||||
return this.options_;
|
||||
},
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
FirebaseAppImpl.prototype.delete = function () {
|
||||
var _this = this;
|
||||
return new Promise(function (resolve) {
|
||||
_this.checkDestroyed_();
|
||||
resolve();
|
||||
})
|
||||
.then(function () {
|
||||
_this.firebase_.INTERNAL.removeApp(_this.name_);
|
||||
return Promise.all(_this.container.getProviders().map(function (provider) { return provider.delete(); }));
|
||||
})
|
||||
.then(function () {
|
||||
_this.isDeleted_ = true;
|
||||
});
|
||||
};
|
||||
/**
|
||||
* Return a service instance associated with this app (creating it
|
||||
* on demand), identified by the passed instanceIdentifier.
|
||||
*
|
||||
* NOTE: Currently storage and functions are the only ones that are leveraging this
|
||||
* functionality. They invoke it by calling:
|
||||
*
|
||||
* ```javascript
|
||||
* firebase.app().storage('STORAGE BUCKET ID')
|
||||
* ```
|
||||
*
|
||||
* The service name is passed to this already
|
||||
* @internal
|
||||
*/
|
||||
FirebaseAppImpl.prototype._getService = function (name, instanceIdentifier) {
|
||||
if (instanceIdentifier === void 0) { instanceIdentifier = DEFAULT_ENTRY_NAME; }
|
||||
this.checkDestroyed_();
|
||||
// getImmediate will always succeed because _getService is only called for registered components.
|
||||
return this.container.getProvider(name).getImmediate({
|
||||
identifier: instanceIdentifier
|
||||
});
|
||||
};
|
||||
/**
|
||||
* Remove a service instance from the cache, so we will create a new instance for this service
|
||||
* when people try to get this service again.
|
||||
*
|
||||
* NOTE: currently only firestore is using this functionality to support firestore shutdown.
|
||||
*
|
||||
* @param name The service name
|
||||
* @param instanceIdentifier instance identifier in case multiple instances are allowed
|
||||
* @internal
|
||||
*/
|
||||
FirebaseAppImpl.prototype._removeServiceInstance = function (name, instanceIdentifier) {
|
||||
if (instanceIdentifier === void 0) { instanceIdentifier = DEFAULT_ENTRY_NAME; }
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
this.container.getProvider(name).clearInstance(instanceIdentifier);
|
||||
};
|
||||
/**
|
||||
* @param component the component being added to this app's container
|
||||
*/
|
||||
FirebaseAppImpl.prototype._addComponent = function (component) {
|
||||
try {
|
||||
this.container.addComponent(component);
|
||||
}
|
||||
catch (e) {
|
||||
logger.debug("Component " + component.name + " failed to register with FirebaseApp " + this.name, e);
|
||||
}
|
||||
};
|
||||
FirebaseAppImpl.prototype._addOrOverwriteComponent = function (component) {
|
||||
this.container.addOrOverwriteComponent(component);
|
||||
};
|
||||
/**
|
||||
* This function will throw an Error if the App has already been deleted -
|
||||
* use before performing API actions on the App.
|
||||
*/
|
||||
FirebaseAppImpl.prototype.checkDestroyed_ = function () {
|
||||
if (this.isDeleted_) {
|
||||
throw ERROR_FACTORY.create("app-deleted" /* APP_DELETED */, { appName: this.name_ });
|
||||
}
|
||||
};
|
||||
return FirebaseAppImpl;
|
||||
}());
|
||||
// Prevent dead-code elimination of these methods w/o invalid property
|
||||
// copying.
|
||||
(FirebaseAppImpl.prototype.name && FirebaseAppImpl.prototype.options) ||
|
||||
FirebaseAppImpl.prototype.delete ||
|
||||
console.log('dc');
|
||||
|
||||
var version$1 = "7.8.0";
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
/**
|
||||
* Because auth can't share code with other components, we attach the utility functions
|
||||
* in an internal namespace to share code.
|
||||
* This function return a firebase namespace object without
|
||||
* any utility functions, so it can be shared between the regular firebaseNamespace and
|
||||
* the lite version.
|
||||
*/
|
||||
function createFirebaseNamespaceCore(firebaseAppImpl) {
|
||||
var apps = {};
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
var components = new Map();
|
||||
// A namespace is a plain JavaScript Object.
|
||||
var namespace = {
|
||||
// Hack to prevent Babel from modifying the object returned
|
||||
// as the firebase namespace.
|
||||
// @ts-ignore
|
||||
__esModule: true,
|
||||
initializeApp: initializeApp,
|
||||
// @ts-ignore
|
||||
app: app,
|
||||
registerVersion: registerVersion,
|
||||
// @ts-ignore
|
||||
apps: null,
|
||||
SDK_VERSION: version$1,
|
||||
INTERNAL: {
|
||||
registerComponent: registerComponent,
|
||||
removeApp: removeApp,
|
||||
components: components,
|
||||
useAsService: useAsService
|
||||
}
|
||||
};
|
||||
// Inject a circular default export to allow Babel users who were previously
|
||||
// using:
|
||||
//
|
||||
// import firebase from 'firebase';
|
||||
// which becomes: var firebase = require('firebase').default;
|
||||
//
|
||||
// instead of
|
||||
//
|
||||
// import * as firebase from 'firebase';
|
||||
// which becomes: var firebase = require('firebase');
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
namespace['default'] = namespace;
|
||||
// firebase.apps is a read-only getter.
|
||||
Object.defineProperty(namespace, 'apps', {
|
||||
get: getApps
|
||||
});
|
||||
/**
|
||||
* Called by App.delete() - but before any services associated with the App
|
||||
* are deleted.
|
||||
*/
|
||||
function removeApp(name) {
|
||||
delete apps[name];
|
||||
}
|
||||
/**
|
||||
* Get the App object for a given name (or DEFAULT).
|
||||
*/
|
||||
function app(name) {
|
||||
name = name || DEFAULT_ENTRY_NAME;
|
||||
if (!util.contains(apps, name)) {
|
||||
throw ERROR_FACTORY.create("no-app" /* NO_APP */, { appName: name });
|
||||
}
|
||||
return apps[name];
|
||||
}
|
||||
// @ts-ignore
|
||||
app['App'] = firebaseAppImpl;
|
||||
function initializeApp(options, rawConfig) {
|
||||
if (rawConfig === void 0) { rawConfig = {}; }
|
||||
if (typeof rawConfig !== 'object' || rawConfig === null) {
|
||||
var name_1 = rawConfig;
|
||||
rawConfig = { name: name_1 };
|
||||
}
|
||||
var config = rawConfig;
|
||||
if (config.name === undefined) {
|
||||
config.name = DEFAULT_ENTRY_NAME;
|
||||
}
|
||||
var name = config.name;
|
||||
if (typeof name !== 'string' || !name) {
|
||||
throw ERROR_FACTORY.create("bad-app-name" /* BAD_APP_NAME */, {
|
||||
appName: String(name)
|
||||
});
|
||||
}
|
||||
if (util.contains(apps, name)) {
|
||||
throw ERROR_FACTORY.create("duplicate-app" /* DUPLICATE_APP */, { appName: name });
|
||||
}
|
||||
var app = new firebaseAppImpl(options, config, namespace);
|
||||
apps[name] = app;
|
||||
return app;
|
||||
}
|
||||
/*
|
||||
* Return an array of all the non-deleted FirebaseApps.
|
||||
*/
|
||||
function getApps() {
|
||||
// Make a copy so caller cannot mutate the apps list.
|
||||
return Object.keys(apps).map(function (name) { return apps[name]; });
|
||||
}
|
||||
function registerComponent(component) {
|
||||
var e_1, _a;
|
||||
var componentName = component.name;
|
||||
if (components.has(componentName)) {
|
||||
logger.debug("There were multiple attempts to register component " + componentName + ".");
|
||||
return component.type === "PUBLIC" /* PUBLIC */
|
||||
? // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
namespace[componentName]
|
||||
: null;
|
||||
}
|
||||
components.set(componentName, component);
|
||||
// create service namespace for public components
|
||||
if (component.type === "PUBLIC" /* PUBLIC */) {
|
||||
// The Service namespace is an accessor function ...
|
||||
var serviceNamespace = function (appArg) {
|
||||
if (appArg === void 0) { appArg = app(); }
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
if (typeof appArg[componentName] !== 'function') {
|
||||
// Invalid argument.
|
||||
// This happens in the following case: firebase.storage('gs:/')
|
||||
throw ERROR_FACTORY.create("invalid-app-argument" /* INVALID_APP_ARGUMENT */, {
|
||||
appName: componentName
|
||||
});
|
||||
}
|
||||
// Forward service instance lookup to the FirebaseApp.
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
return appArg[componentName]();
|
||||
};
|
||||
// ... and a container for service-level properties.
|
||||
if (component.serviceProps !== undefined) {
|
||||
util.deepExtend(serviceNamespace, component.serviceProps);
|
||||
}
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
namespace[componentName] = serviceNamespace;
|
||||
// Patch the FirebaseAppImpl prototype
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
firebaseAppImpl.prototype[componentName] =
|
||||
// TODO: The eslint disable can be removed and the 'ignoreRestArgs'
|
||||
// option added to the no-explicit-any rule when ESlint releases it.
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
function () {
|
||||
var args = [];
|
||||
for (var _i = 0; _i < arguments.length; _i++) {
|
||||
args[_i] = arguments[_i];
|
||||
}
|
||||
var serviceFxn = this._getService.bind(this, componentName);
|
||||
return serviceFxn.apply(this, component.multipleInstances ? args : []);
|
||||
};
|
||||
}
|
||||
try {
|
||||
// add the component to existing app instances
|
||||
for (var _b = tslib.__values(Object.keys(apps)), _c = _b.next(); !_c.done; _c = _b.next()) {
|
||||
var appName = _c.value;
|
||||
apps[appName]._addComponent(component);
|
||||
}
|
||||
}
|
||||
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
||||
finally {
|
||||
try {
|
||||
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
||||
}
|
||||
finally { if (e_1) throw e_1.error; }
|
||||
}
|
||||
return component.type === "PUBLIC" /* PUBLIC */
|
||||
? // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
namespace[componentName]
|
||||
: null;
|
||||
}
|
||||
function registerVersion(libraryKeyOrName, version, variant) {
|
||||
var _a;
|
||||
// TODO: We can use this check to whitelist strings when/if we set up
|
||||
// a good whitelist system.
|
||||
var library = (_a = PLATFORM_LOG_STRING[libraryKeyOrName], (_a !== null && _a !== void 0 ? _a : libraryKeyOrName));
|
||||
if (variant) {
|
||||
library += "-" + variant;
|
||||
}
|
||||
var libraryMismatch = library.match(/\s|\//);
|
||||
var versionMismatch = version.match(/\s|\//);
|
||||
if (libraryMismatch || versionMismatch) {
|
||||
var warning = [
|
||||
"Unable to register library \"" + library + "\" with version \"" + version + "\":"
|
||||
];
|
||||
if (libraryMismatch) {
|
||||
warning.push("library name \"" + library + "\" contains illegal characters (whitespace or \"/\")");
|
||||
}
|
||||
if (libraryMismatch && versionMismatch) {
|
||||
warning.push('and');
|
||||
}
|
||||
if (versionMismatch) {
|
||||
warning.push("version name \"" + version + "\" contains illegal characters (whitespace or \"/\")");
|
||||
}
|
||||
logger.warn(warning.join(' '));
|
||||
return;
|
||||
}
|
||||
registerComponent(new component.Component(library + "-version", function () { return ({ library: library, version: version }); }, "VERSION" /* VERSION */));
|
||||
}
|
||||
// Map the requested service to a registered service name
|
||||
// (used to map auth to serverAuth service when needed).
|
||||
function useAsService(app, name) {
|
||||
if (name === 'serverAuth') {
|
||||
return null;
|
||||
}
|
||||
var useService = name;
|
||||
return useService;
|
||||
}
|
||||
return namespace;
|
||||
}
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
/**
|
||||
* Return a firebase namespace object.
|
||||
*
|
||||
* In production, this will be called exactly once and the result
|
||||
* assigned to the 'firebase' global. It may be called multiple times
|
||||
* in unit tests.
|
||||
*/
|
||||
function createFirebaseNamespace() {
|
||||
var namespace = createFirebaseNamespaceCore(FirebaseAppImpl);
|
||||
namespace.INTERNAL = tslib.__assign(tslib.__assign({}, namespace.INTERNAL), { createFirebaseNamespace: createFirebaseNamespace,
|
||||
extendNamespace: extendNamespace,
|
||||
createSubscribe: util.createSubscribe,
|
||||
ErrorFactory: util.ErrorFactory,
|
||||
deepExtend: util.deepExtend });
|
||||
/**
|
||||
* Patch the top-level firebase namespace with additional properties.
|
||||
*
|
||||
* firebase.INTERNAL.extendNamespace()
|
||||
*/
|
||||
function extendNamespace(props) {
|
||||
util.deepExtend(namespace, props);
|
||||
}
|
||||
return namespace;
|
||||
}
|
||||
var firebase = createFirebaseNamespace();
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
var PlatformLoggerService = /** @class */ (function () {
|
||||
function PlatformLoggerService(container) {
|
||||
this.container = container;
|
||||
}
|
||||
// In initial implementation, this will be called by installations on
|
||||
// auth token refresh, and installations will send this string.
|
||||
PlatformLoggerService.prototype.getPlatformInfoString = function () {
|
||||
var providers = this.container.getProviders();
|
||||
// Loop through providers and get library/version pairs from any that are
|
||||
// version components.
|
||||
return providers
|
||||
.map(function (provider) {
|
||||
if (isVersionServiceProvider(provider)) {
|
||||
var service = provider.getImmediate();
|
||||
return service.library + "/" + service.version;
|
||||
}
|
||||
else {
|
||||
return null;
|
||||
}
|
||||
})
|
||||
.filter(function (logString) { return logString; })
|
||||
.join(' ');
|
||||
};
|
||||
return PlatformLoggerService;
|
||||
}());
|
||||
/**
|
||||
*
|
||||
* @param provider check if this provider provides a VersionService
|
||||
*
|
||||
* NOTE: Using Provider<'app-version'> is a hack to indicate that the provider
|
||||
* provides VersionService. The provider is not necessarily a 'app-version'
|
||||
* provider.
|
||||
*/
|
||||
function isVersionServiceProvider(provider) {
|
||||
var _a;
|
||||
var component = provider.getComponent();
|
||||
return ((_a = component) === null || _a === void 0 ? void 0 : _a.type) === "VERSION" /* VERSION */;
|
||||
}
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
function registerCoreComponents(firebase, variant) {
|
||||
firebase.INTERNAL.registerComponent(new component.Component('platform-logger', function (container) { return new PlatformLoggerService(container); }, "PRIVATE" /* PRIVATE */));
|
||||
// Register `app` package.
|
||||
firebase.registerVersion(name, version, variant);
|
||||
// Register platform SDK identifier (no version).
|
||||
firebase.registerVersion('fire-js', '');
|
||||
}
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2017 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
/**
|
||||
* To avoid having to include the @types/react-native package, which breaks
|
||||
* some of our tests because of duplicate symbols, we are using require syntax
|
||||
* here
|
||||
*/
|
||||
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
||||
var AsyncStorage = require('react-native').AsyncStorage;
|
||||
firebase.INTERNAL.extendNamespace({
|
||||
INTERNAL: {
|
||||
reactNative: {
|
||||
AsyncStorage: AsyncStorage
|
||||
}
|
||||
}
|
||||
});
|
||||
var firebase$1 = firebase;
|
||||
registerCoreComponents(firebase$1, 'rn');
|
||||
|
||||
exports.default = firebase$1;
|
||||
exports.firebase = firebase$1;
|
||||
//# sourceMappingURL=index.rn.cjs.js.map
|
1
node_modules/@firebase/app/dist/index.rn.cjs.js.map
generated
vendored
Normal file
1
node_modules/@firebase/app/dist/index.rn.cjs.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
19
node_modules/@firebase/app/dist/packages/app/index.d.ts
generated
vendored
Normal file
19
node_modules/@firebase/app/dist/packages/app/index.d.ts
generated
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2017 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import { FirebaseNamespace } from '@firebase/app-types';
|
||||
export declare const firebase: FirebaseNamespace;
|
||||
export default firebase;
|
18
node_modules/@firebase/app/dist/packages/app/index.lite.d.ts
generated
vendored
Normal file
18
node_modules/@firebase/app/dist/packages/app/index.lite.d.ts
generated
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
export declare const firebase: import("@firebase/app-types").FirebaseNamespace;
|
||||
export default firebase;
|
19
node_modules/@firebase/app/dist/packages/app/index.node.d.ts
generated
vendored
Normal file
19
node_modules/@firebase/app/dist/packages/app/index.node.d.ts
generated
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2017 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import { FirebaseNamespace } from '@firebase/app-types';
|
||||
export declare const firebase: FirebaseNamespace;
|
||||
export default firebase;
|
19
node_modules/@firebase/app/dist/packages/app/index.rn.d.ts
generated
vendored
Normal file
19
node_modules/@firebase/app/dist/packages/app/index.rn.d.ts
generated
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2017 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import { FirebaseNamespace } from '@firebase/app-types';
|
||||
export declare const firebase: FirebaseNamespace;
|
||||
export default firebase;
|
21
node_modules/@firebase/app/dist/packages/app/src/constants.d.ts
generated
vendored
Normal file
21
node_modules/@firebase/app/dist/packages/app/src/constants.d.ts
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
export declare const DEFAULT_ENTRY_NAME = "[DEFAULT]";
|
||||
export declare const PLATFORM_LOG_STRING: {
|
||||
readonly [x: string]: "fire-core" | "fire-analytics" | "fire-auth" | "fire-rtdb" | "fire-fn" | "fire-iid" | "fire-fcm" | "fire-perf" | "fire-rc" | "fire-gcs" | "fire-fst" | "fire-js" | "fire-js-all";
|
||||
readonly 'fire-js': "fire-js";
|
||||
};
|
31
node_modules/@firebase/app/dist/packages/app/src/errors.d.ts
generated
vendored
Normal file
31
node_modules/@firebase/app/dist/packages/app/src/errors.d.ts
generated
vendored
Normal file
@ -0,0 +1,31 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import { ErrorFactory } from '@firebase/util';
|
||||
export declare const enum AppError {
|
||||
NO_APP = "no-app",
|
||||
BAD_APP_NAME = "bad-app-name",
|
||||
DUPLICATE_APP = "duplicate-app",
|
||||
APP_DELETED = "app-deleted",
|
||||
INVALID_APP_ARGUMENT = "invalid-app-argument"
|
||||
}
|
||||
declare type ErrorParams = {
|
||||
[key in AppError]: {
|
||||
appName: string;
|
||||
};
|
||||
};
|
||||
export declare const ERROR_FACTORY: ErrorFactory<AppError, ErrorParams>;
|
||||
export {};
|
73
node_modules/@firebase/app/dist/packages/app/src/firebaseApp.d.ts
generated
vendored
Normal file
73
node_modules/@firebase/app/dist/packages/app/src/firebaseApp.d.ts
generated
vendored
Normal file
@ -0,0 +1,73 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2017 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import { FirebaseApp, FirebaseOptions, FirebaseAppConfig } from '@firebase/app-types';
|
||||
import { _FirebaseNamespace, FirebaseService } from '@firebase/app-types/private';
|
||||
import { Component } from '@firebase/component';
|
||||
/**
|
||||
* Global context object for a collection of services using
|
||||
* a shared authentication state.
|
||||
*/
|
||||
export declare class FirebaseAppImpl implements FirebaseApp {
|
||||
private readonly firebase_;
|
||||
private readonly options_;
|
||||
private readonly name_;
|
||||
private isDeleted_;
|
||||
private automaticDataCollectionEnabled_;
|
||||
private container;
|
||||
constructor(options: FirebaseOptions, config: FirebaseAppConfig, firebase_: _FirebaseNamespace);
|
||||
get automaticDataCollectionEnabled(): boolean;
|
||||
set automaticDataCollectionEnabled(val: boolean);
|
||||
get name(): string;
|
||||
get options(): FirebaseOptions;
|
||||
delete(): Promise<void>;
|
||||
/**
|
||||
* Return a service instance associated with this app (creating it
|
||||
* on demand), identified by the passed instanceIdentifier.
|
||||
*
|
||||
* NOTE: Currently storage and functions are the only ones that are leveraging this
|
||||
* functionality. They invoke it by calling:
|
||||
*
|
||||
* ```javascript
|
||||
* firebase.app().storage('STORAGE BUCKET ID')
|
||||
* ```
|
||||
*
|
||||
* The service name is passed to this already
|
||||
* @internal
|
||||
*/
|
||||
_getService(name: string, instanceIdentifier?: string): FirebaseService;
|
||||
/**
|
||||
* Remove a service instance from the cache, so we will create a new instance for this service
|
||||
* when people try to get this service again.
|
||||
*
|
||||
* NOTE: currently only firestore is using this functionality to support firestore shutdown.
|
||||
*
|
||||
* @param name The service name
|
||||
* @param instanceIdentifier instance identifier in case multiple instances are allowed
|
||||
* @internal
|
||||
*/
|
||||
_removeServiceInstance(name: string, instanceIdentifier?: string): void;
|
||||
/**
|
||||
* @param component the component being added to this app's container
|
||||
*/
|
||||
_addComponent(component: Component): void;
|
||||
_addOrOverwriteComponent(component: Component): void;
|
||||
/**
|
||||
* This function will throw an Error if the App has already been deleted -
|
||||
* use before performing API actions on the App.
|
||||
*/
|
||||
private checkDestroyed_;
|
||||
}
|
26
node_modules/@firebase/app/dist/packages/app/src/firebaseNamespace.d.ts
generated
vendored
Normal file
26
node_modules/@firebase/app/dist/packages/app/src/firebaseNamespace.d.ts
generated
vendored
Normal file
@ -0,0 +1,26 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import { FirebaseNamespace } from '@firebase/app-types';
|
||||
/**
|
||||
* Return a firebase namespace object.
|
||||
*
|
||||
* In production, this will be called exactly once and the result
|
||||
* assigned to the 'firebase' global. It may be called multiple times
|
||||
* in unit tests.
|
||||
*/
|
||||
export declare function createFirebaseNamespace(): FirebaseNamespace;
|
||||
export declare const firebase: FirebaseNamespace;
|
27
node_modules/@firebase/app/dist/packages/app/src/firebaseNamespaceCore.d.ts
generated
vendored
Normal file
27
node_modules/@firebase/app/dist/packages/app/src/firebaseNamespaceCore.d.ts
generated
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import { FirebaseNamespace } from '@firebase/app-types';
|
||||
import { FirebaseAppImpl } from './firebaseApp';
|
||||
import { FirebaseAppLiteImpl } from './lite/firebaseAppLite';
|
||||
/**
|
||||
* Because auth can't share code with other components, we attach the utility functions
|
||||
* in an internal namespace to share code.
|
||||
* This function return a firebase namespace object without
|
||||
* any utility functions, so it can be shared between the regular firebaseNamespace and
|
||||
* the lite version.
|
||||
*/
|
||||
export declare function createFirebaseNamespaceCore(firebaseAppImpl: typeof FirebaseAppImpl | typeof FirebaseAppLiteImpl): FirebaseNamespace;
|
57
node_modules/@firebase/app/dist/packages/app/src/lite/firebaseAppLite.d.ts
generated
vendored
Normal file
57
node_modules/@firebase/app/dist/packages/app/src/lite/firebaseAppLite.d.ts
generated
vendored
Normal file
@ -0,0 +1,57 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import { FirebaseApp, FirebaseOptions, FirebaseAppConfig } from '@firebase/app-types';
|
||||
import { _FirebaseNamespace, FirebaseService } from '@firebase/app-types/private';
|
||||
/**
|
||||
* Global context object for a collection of services using
|
||||
* a shared authentication state.
|
||||
*/
|
||||
export declare class FirebaseAppLiteImpl implements FirebaseApp {
|
||||
private readonly firebase_;
|
||||
private readonly options_;
|
||||
private readonly name_;
|
||||
private isDeleted_;
|
||||
private automaticDataCollectionEnabled_;
|
||||
private container;
|
||||
readonly INTERNAL: {};
|
||||
constructor(options: FirebaseOptions, config: FirebaseAppConfig, firebase_: _FirebaseNamespace);
|
||||
get automaticDataCollectionEnabled(): boolean;
|
||||
set automaticDataCollectionEnabled(val: boolean);
|
||||
get name(): string;
|
||||
get options(): FirebaseOptions;
|
||||
delete(): Promise<void>;
|
||||
/**
|
||||
* Return a service instance associated with this app (creating it
|
||||
* on demand), identified by the passed instanceIdentifier.
|
||||
*
|
||||
* NOTE: Currently storage is the only one that is leveraging this
|
||||
* functionality. They invoke it by calling:
|
||||
*
|
||||
* ```javascript
|
||||
* firebase.app().storage('STORAGE BUCKET ID')
|
||||
* ```
|
||||
*
|
||||
* The service name is passed to this already
|
||||
* @internal
|
||||
*/
|
||||
_getService(name: string, instanceIdentifier?: string): FirebaseService;
|
||||
/**
|
||||
* This function will throw an Error if the App has already been deleted -
|
||||
* use before performing API actions on the App.
|
||||
*/
|
||||
private checkDestroyed_;
|
||||
}
|
18
node_modules/@firebase/app/dist/packages/app/src/lite/firebaseNamespaceLite.d.ts
generated
vendored
Normal file
18
node_modules/@firebase/app/dist/packages/app/src/lite/firebaseNamespaceLite.d.ts
generated
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import { FirebaseNamespace } from '@firebase/app-types';
|
||||
export declare function createFirebaseNamespaceLite(): FirebaseNamespace;
|
18
node_modules/@firebase/app/dist/packages/app/src/logger.d.ts
generated
vendored
Normal file
18
node_modules/@firebase/app/dist/packages/app/src/logger.d.ts
generated
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import { Logger } from '@firebase/logger';
|
||||
export declare const logger: Logger;
|
22
node_modules/@firebase/app/dist/packages/app/src/platformLoggerService.d.ts
generated
vendored
Normal file
22
node_modules/@firebase/app/dist/packages/app/src/platformLoggerService.d.ts
generated
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import { ComponentContainer } from '@firebase/component';
|
||||
export declare class PlatformLoggerService {
|
||||
private readonly container;
|
||||
constructor(container: ComponentContainer);
|
||||
getPlatformInfoString(): string;
|
||||
}
|
18
node_modules/@firebase/app/dist/packages/app/src/registerCoreComponents.d.ts
generated
vendored
Normal file
18
node_modules/@firebase/app/dist/packages/app/src/registerCoreComponents.d.ts
generated
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import { FirebaseNamespace } from '@firebase/app-types';
|
||||
export declare function registerCoreComponents(firebase: FirebaseNamespace, variant?: string): void;
|
17
node_modules/@firebase/app/dist/packages/app/test/firebaseApp.test.d.ts
generated
vendored
Normal file
17
node_modules/@firebase/app/dist/packages/app/test/firebaseApp.test.d.ts
generated
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2017 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import './setup';
|
25
node_modules/@firebase/app/dist/packages/app/test/platformLogger.test.d.ts
generated
vendored
Normal file
25
node_modules/@firebase/app/dist/packages/app/test/platformLogger.test.d.ts
generated
vendored
Normal file
@ -0,0 +1,25 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2017 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import { VersionService } from '@firebase/app-types';
|
||||
import './setup';
|
||||
declare module '@firebase/component' {
|
||||
interface NameServiceMapping {
|
||||
'vs1': VersionService;
|
||||
'vs2': VersionService;
|
||||
'test-shell': Promise<void>;
|
||||
}
|
||||
}
|
17
node_modules/@firebase/app/dist/packages/app/test/setup.d.ts
generated
vendored
Normal file
17
node_modules/@firebase/app/dist/packages/app/test/setup.d.ts
generated
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
export {};
|
Reference in New Issue
Block a user