@firebase/app 0.3.17-canary.a7bb0b5 → 0.3.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs.js CHANGED
@@ -267,7 +267,7 @@ function createFirebaseNamespaceCore(firebaseAppImpl) {
267
267
  app: app,
268
268
  apps: null,
269
269
  Promise: Promise,
270
- SDK_VERSION: '5.11.0-canary.a7bb0b5',
270
+ SDK_VERSION: '5.11.0',
271
271
  INTERNAL: {
272
272
  registerService: registerService,
273
273
  removeApp: removeApp,
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs.js","sources":["../src/errors.ts","../src/constants.ts","../src/firebaseApp.ts","../src/firebaseNamespaceCore.ts","../src/firebaseNamespace.ts","../index.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ErrorFactory, ErrorMap } from '@firebase/util';\n\nexport const enum AppError {\n NO_APP = 'no-app',\n BAD_APP_NAME = 'bad-app-name',\n DUPLICATE_APP = 'duplicate-app',\n APP_DELETED = 'app-deleted',\n DUPLICATE_SERVICE = 'duplicate-service',\n INVALID_APP_ARGUMENT = 'invalid-app-argument'\n}\n\nconst ERRORS: ErrorMap<AppError> = {\n [AppError.NO_APP]:\n \"No Firebase App '{$name}' has been created - \" +\n 'call Firebase App.initializeApp()',\n [AppError.BAD_APP_NAME]: \"Illegal App name: '{$name}\",\n [AppError.DUPLICATE_APP]: \"Firebase App named '{$name}' already exists\",\n [AppError.APP_DELETED]: \"Firebase App named '{$name}' already deleted\",\n [AppError.DUPLICATE_SERVICE]:\n \"Firebase service named '{$name}' already registered\",\n [AppError.INVALID_APP_ARGUMENT]:\n 'firebase.{$name}() takes either no argument or a ' +\n 'Firebase App instance.'\n};\n\nconst appErrors = new ErrorFactory<AppError>('app', 'Firebase', ERRORS);\n\nexport function error(code: AppError, args?: { [name: string]: any }) {\n throw appErrors.create(code, args);\n}\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport const DEFAULT_ENTRY_NAME = '[DEFAULT]';\n","/**\n * @license\n * Copyright 2017 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n FirebaseApp,\n FirebaseOptions,\n FirebaseAppConfig\n} from '@firebase/app-types';\nimport {\n _FirebaseApp,\n _FirebaseNamespace,\n FirebaseService,\n FirebaseAppInternals\n} from '@firebase/app-types/private';\nimport { deepCopy, deepExtend } from '@firebase/util';\nimport { error, AppError } from './errors';\nimport { DEFAULT_ENTRY_NAME } from './constants';\n\ninterface ServicesCache {\n [name: string]: {\n [serviceName: string]: FirebaseService;\n };\n}\n\n// An array to capture listeners before the true auth functions\n// exist\nlet tokenListeners: any[] = [];\n\n/**\n * Global context object for a collection of services using\n * a shared authentication state.\n */\nexport class FirebaseAppImpl implements FirebaseApp {\n private readonly options_: FirebaseOptions;\n private readonly name_: string;\n private isDeleted_ = false;\n private services_: ServicesCache = {};\n private automaticDataCollectionEnabled_: boolean;\n\n INTERNAL: FirebaseAppInternals;\n\n constructor(\n options: FirebaseOptions,\n config: FirebaseAppConfig,\n private readonly firebase_: _FirebaseNamespace\n ) {\n this.name_ = config.name!;\n this.automaticDataCollectionEnabled_ =\n config.automaticDataCollectionEnabled || false;\n this.options_ = deepCopy<FirebaseOptions>(options);\n this.INTERNAL = {\n getUid: () => null,\n getToken: () => Promise.resolve(null),\n addAuthTokenListener: (callback: (token: string | null) => void) => {\n tokenListeners.push(callback);\n // Make sure callback is called, asynchronously, in the absence of the auth module\n setTimeout(() => callback(null), 0);\n },\n removeAuthTokenListener: callback => {\n tokenListeners = tokenListeners.filter(\n listener => listener !== callback\n );\n }\n };\n }\n\n get automaticDataCollectionEnabled(): boolean {\n this.checkDestroyed_();\n return this.automaticDataCollectionEnabled_;\n }\n\n set automaticDataCollectionEnabled(val) {\n this.checkDestroyed_();\n this.automaticDataCollectionEnabled_ = val;\n }\n\n get name(): string {\n this.checkDestroyed_();\n return this.name_;\n }\n\n get options(): FirebaseOptions {\n this.checkDestroyed_();\n return this.options_;\n }\n\n delete(): Promise<void> {\n return new Promise(resolve => {\n this.checkDestroyed_();\n resolve();\n })\n .then(() => {\n this.firebase_.INTERNAL.removeApp(this.name_);\n const services: FirebaseService[] = [];\n\n for (const serviceKey of Object.keys(this.services_)) {\n for (const instanceKey of Object.keys(this.services_[serviceKey])) {\n services.push(this.services_[serviceKey][instanceKey]);\n }\n }\n\n return Promise.all(\n services.map(service => {\n return service.INTERNAL.delete();\n })\n );\n })\n .then(\n (): void => {\n this.isDeleted_ = true;\n this.services_ = {};\n }\n );\n }\n\n /**\n * Return a service instance associated with this app (creating it\n * on demand), identified by the passed instanceIdentifier.\n *\n * NOTE: Currently storage is the only one that is leveraging this\n * functionality. They invoke it by calling:\n *\n * ```javascript\n * firebase.app().storage('STORAGE BUCKET ID')\n * ```\n *\n * The service name is passed to this already\n * @internal\n */\n _getService(\n name: string,\n instanceIdentifier: string = DEFAULT_ENTRY_NAME\n ): FirebaseService {\n this.checkDestroyed_();\n\n if (!this.services_[name]) {\n this.services_[name] = {};\n }\n\n if (!this.services_[name][instanceIdentifier]) {\n /**\n * If a custom instance has been defined (i.e. not '[DEFAULT]')\n * then we will pass that instance on, otherwise we pass `null`\n */\n const instanceSpecifier =\n instanceIdentifier !== DEFAULT_ENTRY_NAME\n ? instanceIdentifier\n : undefined;\n const service = this.firebase_.INTERNAL.factories[name](\n this,\n this.extendApp.bind(this),\n instanceSpecifier\n );\n this.services_[name][instanceIdentifier] = service;\n }\n\n return this.services_[name][instanceIdentifier];\n }\n\n /**\n * Callback function used to extend an App instance at the time\n * of service instance creation.\n */\n private extendApp(props: { [name: string]: any }): void {\n // Copy the object onto the FirebaseAppImpl prototype\n deepExtend(this, props);\n\n /**\n * If the app has overwritten the addAuthTokenListener stub, forward\n * the active token listeners on to the true fxn.\n *\n * TODO: This function is required due to our current module\n * structure. Once we are able to rely strictly upon a single module\n * implementation, this code should be refactored and Auth should\n * provide these stubs and the upgrade logic\n */\n if (props.INTERNAL && props.INTERNAL.addAuthTokenListener) {\n tokenListeners.forEach(listener => {\n this.INTERNAL.addAuthTokenListener(listener);\n });\n tokenListeners = [];\n }\n }\n\n /**\n * This function will throw an Error if the App has already been deleted -\n * use before performing API actions on the App.\n */\n private checkDestroyed_(): void {\n if (this.isDeleted_) {\n error(AppError.APP_DELETED, { name: this.name_ });\n }\n }\n}\n\n// Prevent dead-code elimination of these methods w/o invalid property\n// copying.\n(FirebaseAppImpl.prototype.name && FirebaseAppImpl.prototype.options) ||\n FirebaseAppImpl.prototype.delete ||\n console.log('dc');\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n FirebaseApp,\n FirebaseOptions,\n FirebaseNamespace,\n FirebaseAppConfig\n} from '@firebase/app-types';\nimport {\n _FirebaseApp,\n _FirebaseNamespace,\n FirebaseService,\n FirebaseServiceFactory,\n FirebaseServiceNamespace,\n AppHook\n} from '@firebase/app-types/private';\nimport { deepExtend, patchProperty } from '@firebase/util';\nimport { FirebaseAppImpl } from './firebaseApp';\nimport { error, AppError } from './errors';\nimport { FirebaseAppLiteImpl } from './lite/firebaseAppLite';\nimport { DEFAULT_ENTRY_NAME } from './constants';\n\nfunction contains(obj: object, key: string) {\n return Object.prototype.hasOwnProperty.call(obj, key);\n}\n\n/**\n * Because auth can't share code with other components, we attach the utility functions\n * in an internal namespace to share code.\n * This function return a firebase namespace object without\n * any utility functions, so it can be shared between the regular firebaseNamespace and\n * the lite version.\n */\nexport function createFirebaseNamespaceCore(\n firebaseAppImpl: typeof FirebaseAppImpl | typeof FirebaseAppLiteImpl\n): FirebaseNamespace {\n const apps: { [name: string]: FirebaseApp } = {};\n const factories: { [service: string]: FirebaseServiceFactory } = {};\n const appHooks: { [service: string]: AppHook } = {};\n\n // A namespace is a plain JavaScript Object.\n const namespace: FirebaseNamespace = {\n // Hack to prevent Babel from modifying the object returned\n // as the firebase namespace.\n // @ts-ignore\n __esModule: true,\n initializeApp: initializeApp,\n app: app as any,\n apps: null as any,\n Promise: Promise,\n SDK_VERSION: '${JSCORE_VERSION}',\n INTERNAL: {\n registerService,\n removeApp,\n factories,\n useAsService\n }\n };\n\n // Inject a circular default export to allow Babel users who were previously\n // using:\n //\n // import firebase from 'firebase';\n // which becomes: var firebase = require('firebase').default;\n //\n // instead of\n //\n // import * as firebase from 'firebase';\n // which becomes: var firebase = require('firebase');\n patchProperty(namespace, 'default', namespace);\n\n // firebase.apps is a read-only getter.\n Object.defineProperty(namespace, 'apps', {\n get: getApps\n });\n\n /**\n * Called by App.delete() - but before any services associated with the App\n * are deleted.\n */\n function removeApp(name: string): void {\n const app = apps[name];\n callAppHooks(app, 'delete');\n delete apps[name];\n }\n\n /**\n * Get the App object for a given name (or DEFAULT).\n */\n function app(name?: string): FirebaseApp {\n name = name || DEFAULT_ENTRY_NAME;\n if (!contains(apps, name)) {\n error(AppError.NO_APP, { name: name });\n }\n return apps[name];\n }\n\n patchProperty(app, 'App', firebaseAppImpl);\n /**\n * Create a new App instance (name must be unique).\n */\n function initializeApp(\n options: FirebaseOptions,\n config?: FirebaseAppConfig\n ): FirebaseApp;\n function initializeApp(options: FirebaseOptions, name?: string): FirebaseApp;\n function initializeApp(options: FirebaseOptions, rawConfig = {}) {\n if (typeof rawConfig !== 'object' || rawConfig === null) {\n const name = rawConfig;\n rawConfig = { name };\n }\n\n const config = rawConfig as FirebaseAppConfig;\n\n if (config.name === undefined) {\n config.name = DEFAULT_ENTRY_NAME;\n }\n\n const { name } = config;\n\n if (typeof name !== 'string' || !name) {\n error(AppError.BAD_APP_NAME, { name: String(name) });\n }\n\n if (contains(apps, name)) {\n error(AppError.DUPLICATE_APP, { name: name });\n }\n\n const app = new firebaseAppImpl(\n options,\n config,\n namespace as _FirebaseNamespace\n );\n\n apps[name] = app;\n callAppHooks(app, 'create');\n\n return app;\n }\n\n /*\n * Return an array of all the non-deleted FirebaseApps.\n */\n function getApps(): FirebaseApp[] {\n // Make a copy so caller cannot mutate the apps list.\n return Object.keys(apps).map(name => apps[name]);\n }\n\n /*\n * Register a Firebase Service.\n *\n * firebase.INTERNAL.registerService()\n *\n * TODO: Implement serviceProperties.\n */\n function registerService(\n name: string,\n createService: FirebaseServiceFactory,\n serviceProperties?: { [prop: string]: unknown },\n appHook?: AppHook,\n allowMultipleInstances = false\n ): FirebaseServiceNamespace<FirebaseService> {\n // Cannot re-register a service that already exists\n if (factories[name]) {\n error(AppError.DUPLICATE_SERVICE, { name: name });\n }\n\n // Capture the service factory for later service instantiation\n factories[name] = createService;\n\n // Capture the appHook, if passed\n if (appHook) {\n appHooks[name] = appHook;\n\n // Run the **new** app hook on all existing apps\n getApps().forEach(app => {\n appHook('create', app);\n });\n }\n\n // The Service namespace is an accessor function ...\n function serviceNamespace(appArg: FirebaseApp = app()) {\n if (typeof appArg[name] !== 'function') {\n // Invalid argument.\n // This happens in the following case: firebase.storage('gs:/')\n error(AppError.INVALID_APP_ARGUMENT, { name: name });\n }\n\n // Forward service instance lookup to the FirebaseApp.\n return appArg[name]();\n }\n\n // ... and a container for service-level properties.\n if (serviceProperties !== undefined) {\n deepExtend(serviceNamespace, serviceProperties);\n }\n\n // Monkey-patch the serviceNamespace onto the firebase namespace\n namespace[name] = serviceNamespace;\n\n // Patch the FirebaseAppImpl prototype\n firebaseAppImpl.prototype[name] = function(...args) {\n const serviceFxn = this._getService.bind(this, name);\n return serviceFxn.apply(this, allowMultipleInstances ? args : []);\n };\n\n return serviceNamespace;\n }\n\n function callAppHooks(app: FirebaseApp, eventName: string) {\n for (const serviceName of Object.keys(factories)) {\n // Ignore virtual services\n const factoryName = useAsService(app, serviceName);\n if (factoryName === null) {\n return;\n }\n\n if (appHooks[factoryName]) {\n appHooks[factoryName](eventName, app);\n }\n }\n }\n\n // Map the requested service to a registered service name\n // (used to map auth to serverAuth service when needed).\n function useAsService(app: FirebaseApp, name: string): string | null {\n if (name === 'serverAuth') {\n return null;\n }\n\n const useService = name;\n const options = app.options;\n\n return useService;\n }\n\n return namespace;\n}\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { FirebaseNamespace } from '@firebase/app-types';\nimport { _FirebaseApp, _FirebaseNamespace } from '@firebase/app-types/private';\nimport { createSubscribe, deepExtend, ErrorFactory } from '@firebase/util';\nimport { FirebaseAppImpl } from './firebaseApp';\nimport { createFirebaseNamespaceCore } from './firebaseNamespaceCore';\n\n/**\n * Return a firebase namespace object.\n *\n * In production, this will be called exactly once and the result\n * assigned to the 'firebase' global. It may be called multiple times\n * in unit tests.\n */\nexport function createFirebaseNamespace(): FirebaseNamespace {\n const namespace = createFirebaseNamespaceCore(FirebaseAppImpl);\n (namespace as _FirebaseNamespace).INTERNAL = {\n ...(namespace as _FirebaseNamespace).INTERNAL,\n createFirebaseNamespace: createFirebaseNamespace,\n extendNamespace: extendNamespace,\n createSubscribe: createSubscribe,\n ErrorFactory: ErrorFactory,\n deepExtend: deepExtend\n };\n\n /**\n * Patch the top-level firebase namespace with additional properties.\n *\n * firebase.INTERNAL.extendNamespace()\n */\n function extendNamespace(props: { [prop: string]: unknown }): void {\n deepExtend(namespace, props);\n }\n\n return namespace;\n}\n","/**\n * @license\n * Copyright 2017 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { FirebaseNamespace } from '@firebase/app-types';\nimport { createFirebaseNamespace } from './src/firebaseNamespace';\n\n// Node detection logic from: https://github.com/iliakan/detect-node/\nlet isNode = false;\ntry {\n isNode =\n Object.prototype.toString.call(global.process) === '[object process]';\n} catch (e) {}\n\nisNode &&\n console.warn(`\nWarning: This is a browser-targeted Firebase bundle but it appears it is being\nrun in a Node environment. If running in a Node environment, make sure you\nare using the bundle specified by the \"main\" field in package.json.\n\nIf you are using Webpack, you can specify \"main\" as the first item in\n\"resolve.mainFields\":\nhttps://webpack.js.org/configuration/resolve/#resolvemainfields\n\nIf using Rollup, use the rollup-plugin-node-resolve plugin and set \"module\"\nto false and \"main\" to true:\nhttps://github.com/rollup/rollup-plugin-node-resolve\n`);\n\n// Firebase Lite detection\nif (self && 'firebase' in self) {\n console.warn(`\n Warning: Firebase is already defined in the global scope. Please make sure\n Firebase library is only loaded once.\n `);\n\n const sdkVersion = ((self as any).firebase as FirebaseNamespace).SDK_VERSION;\n if (sdkVersion && sdkVersion.indexOf('LITE') >= 0) {\n console.warn(`\n Warning: You are trying to load Firebase while using Firebase Performance standalone script.\n You should load Firebase Performance with this instance of Firebase to avoid loading duplicate code.\n `);\n }\n}\n\nexport const firebase = createFirebaseNamespace();\n\nexport default firebase;\n"],"names":["ErrorFactory","deepCopy","deepExtend","patchProperty","createSubscribe"],"mappings":";;;;;;;AAAA;;;;;;;;;;;;;;;;;AAiBA,AAWA,IAAM,MAAM;IACV,4BACE,+CAA+C;QAC/C,mCAAmC;IACrC,wCAAyB,4BAA4B;IACrD,0CAA0B,6CAA6C;IACvE,sCAAwB,8CAA8C;IACtE,kDACE,qDAAqD;IACvD,wDACE,mDAAmD;QACnD,wBAAwB;OAC3B,CAAC;AAEF,IAAM,SAAS,GAAG,IAAIA,iBAAY,CAAW,KAAK,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC;AAExE,SAAgB,KAAK,CAAC,IAAc,EAAE,IAA8B;IAClE,MAAM,SAAS,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;CACpC;;AC9CD;;;;;;;;;;;;;;;;AAiBA,AAAO,IAAM,kBAAkB,GAAG,WAAW,CAAC;;ACjB9C;;;;;;;;;;;;;;;;AA4BA,AAUA;;AAEA,IAAI,cAAc,GAAU,EAAE,CAAC;;;;;AAM/B;IASE,yBACE,OAAwB,EACx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E;AAEd,MAAM;IACJ,OAAO,CAAC,IAAI,CAAC,ojBAYd,CAAC,CAAC;;AAGH,IAAI,IAAI,IAAI,UAAU,IAAI,IAAI,EAAE;IAC9B,OAAO,CAAC,IAAI,CAAC,iIAGZ,CAAC,CAAC;IAEH,IAAM,UAAU,GAAK,IAAY,CAAC,QAA8B,CAAC,WAAW,CAAC;IAC7E,IAAI,UAAU,IAAI,UAAU,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE;QACjD,OAAO,CAAC,IAAI,CAAC,oNAGZ,CAAC,CAAC;KACJ;CACF;AAED,IAAa,QAAQ,GAAG,uBAAuB,EAAE;;;;;"}
1
+ {"version":3,"file":"index.cjs.js","sources":["../src/errors.ts","../src/constants.ts","../src/firebaseApp.ts","../src/firebaseNamespaceCore.ts","../src/firebaseNamespace.ts","../index.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ErrorFactory, ErrorMap } from '@firebase/util';\n\nexport const enum AppError {\n NO_APP = 'no-app',\n BAD_APP_NAME = 'bad-app-name',\n DUPLICATE_APP = 'duplicate-app',\n APP_DELETED = 'app-deleted',\n DUPLICATE_SERVICE = 'duplicate-service',\n INVALID_APP_ARGUMENT = 'invalid-app-argument'\n}\n\nconst ERRORS: ErrorMap<AppError> = {\n [AppError.NO_APP]:\n \"No Firebase App '{$name}' has been created - \" +\n 'call Firebase App.initializeApp()',\n [AppError.BAD_APP_NAME]: \"Illegal App name: '{$name}\",\n [AppError.DUPLICATE_APP]: \"Firebase App named '{$name}' already exists\",\n [AppError.APP_DELETED]: \"Firebase App named '{$name}' already deleted\",\n [AppError.DUPLICATE_SERVICE]:\n \"Firebase service named '{$name}' already registered\",\n [AppError.INVALID_APP_ARGUMENT]:\n 'firebase.{$name}() takes either no argument or a ' +\n 'Firebase App instance.'\n};\n\nconst appErrors = new ErrorFactory<AppError>('app', 'Firebase', ERRORS);\n\nexport function error(code: AppError, args?: { [name: string]: any }) {\n throw appErrors.create(code, args);\n}\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport const DEFAULT_ENTRY_NAME = '[DEFAULT]';\n","/**\n * @license\n * Copyright 2017 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n FirebaseApp,\n FirebaseOptions,\n FirebaseAppConfig\n} from '@firebase/app-types';\nimport {\n _FirebaseApp,\n _FirebaseNamespace,\n FirebaseService,\n FirebaseAppInternals\n} from '@firebase/app-types/private';\nimport { deepCopy, deepExtend } from '@firebase/util';\nimport { error, AppError } from './errors';\nimport { DEFAULT_ENTRY_NAME } from './constants';\n\ninterface ServicesCache {\n [name: string]: {\n [serviceName: string]: FirebaseService;\n };\n}\n\n// An array to capture listeners before the true auth functions\n// exist\nlet tokenListeners: any[] = [];\n\n/**\n * Global context object for a collection of services using\n * a shared authentication state.\n */\nexport class FirebaseAppImpl implements FirebaseApp {\n private readonly options_: FirebaseOptions;\n private readonly name_: string;\n private isDeleted_ = false;\n private services_: ServicesCache = {};\n private automaticDataCollectionEnabled_: boolean;\n\n INTERNAL: FirebaseAppInternals;\n\n constructor(\n options: FirebaseOptions,\n config: FirebaseAppConfig,\n private readonly firebase_: _FirebaseNamespace\n ) {\n this.name_ = config.name!;\n this.automaticDataCollectionEnabled_ =\n config.automaticDataCollectionEnabled || false;\n this.options_ = deepCopy<FirebaseOptions>(options);\n this.INTERNAL = {\n getUid: () => null,\n getToken: () => Promise.resolve(null),\n addAuthTokenListener: (callback: (token: string | null) => void) => {\n tokenListeners.push(callback);\n // Make sure callback is called, asynchronously, in the absence of the auth module\n setTimeout(() => callback(null), 0);\n },\n removeAuthTokenListener: callback => {\n tokenListeners = tokenListeners.filter(\n listener => listener !== callback\n );\n }\n };\n }\n\n get automaticDataCollectionEnabled(): boolean {\n this.checkDestroyed_();\n return this.automaticDataCollectionEnabled_;\n }\n\n set automaticDataCollectionEnabled(val) {\n this.checkDestroyed_();\n this.automaticDataCollectionEnabled_ = val;\n }\n\n get name(): string {\n this.checkDestroyed_();\n return this.name_;\n }\n\n get options(): FirebaseOptions {\n this.checkDestroyed_();\n return this.options_;\n }\n\n delete(): Promise<void> {\n return new Promise(resolve => {\n this.checkDestroyed_();\n resolve();\n })\n .then(() => {\n this.firebase_.INTERNAL.removeApp(this.name_);\n const services: FirebaseService[] = [];\n\n for (const serviceKey of Object.keys(this.services_)) {\n for (const instanceKey of Object.keys(this.services_[serviceKey])) {\n services.push(this.services_[serviceKey][instanceKey]);\n }\n }\n\n return Promise.all(\n services.map(service => {\n return service.INTERNAL.delete();\n })\n );\n })\n .then(\n (): void => {\n this.isDeleted_ = true;\n this.services_ = {};\n }\n );\n }\n\n /**\n * Return a service instance associated with this app (creating it\n * on demand), identified by the passed instanceIdentifier.\n *\n * NOTE: Currently storage is the only one that is leveraging this\n * functionality. They invoke it by calling:\n *\n * ```javascript\n * firebase.app().storage('STORAGE BUCKET ID')\n * ```\n *\n * The service name is passed to this already\n * @internal\n */\n _getService(\n name: string,\n instanceIdentifier: string = DEFAULT_ENTRY_NAME\n ): FirebaseService {\n this.checkDestroyed_();\n\n if (!this.services_[name]) {\n this.services_[name] = {};\n }\n\n if (!this.services_[name][instanceIdentifier]) {\n /**\n * If a custom instance has been defined (i.e. not '[DEFAULT]')\n * then we will pass that instance on, otherwise we pass `null`\n */\n const instanceSpecifier =\n instanceIdentifier !== DEFAULT_ENTRY_NAME\n ? instanceIdentifier\n : undefined;\n const service = this.firebase_.INTERNAL.factories[name](\n this,\n this.extendApp.bind(this),\n instanceSpecifier\n );\n this.services_[name][instanceIdentifier] = service;\n }\n\n return this.services_[name][instanceIdentifier];\n }\n\n /**\n * Callback function used to extend an App instance at the time\n * of service instance creation.\n */\n private extendApp(props: { [name: string]: any }): void {\n // Copy the object onto the FirebaseAppImpl prototype\n deepExtend(this, props);\n\n /**\n * If the app has overwritten the addAuthTokenListener stub, forward\n * the active token listeners on to the true fxn.\n *\n * TODO: This function is required due to our current module\n * structure. Once we are able to rely strictly upon a single module\n * implementation, this code should be refactored and Auth should\n * provide these stubs and the upgrade logic\n */\n if (props.INTERNAL && props.INTERNAL.addAuthTokenListener) {\n tokenListeners.forEach(listener => {\n this.INTERNAL.addAuthTokenListener(listener);\n });\n tokenListeners = [];\n }\n }\n\n /**\n * This function will throw an Error if the App has already been deleted -\n * use before performing API actions on the App.\n */\n private checkDestroyed_(): void {\n if (this.isDeleted_) {\n error(AppError.APP_DELETED, { name: this.name_ });\n }\n }\n}\n\n// Prevent dead-code elimination of these methods w/o invalid property\n// copying.\n(FirebaseAppImpl.prototype.name && FirebaseAppImpl.prototype.options) ||\n FirebaseAppImpl.prototype.delete ||\n console.log('dc');\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n FirebaseApp,\n FirebaseOptions,\n FirebaseNamespace,\n FirebaseAppConfig\n} from '@firebase/app-types';\nimport {\n _FirebaseApp,\n _FirebaseNamespace,\n FirebaseService,\n FirebaseServiceFactory,\n FirebaseServiceNamespace,\n AppHook\n} from '@firebase/app-types/private';\nimport { deepExtend, patchProperty } from '@firebase/util';\nimport { FirebaseAppImpl } from './firebaseApp';\nimport { error, AppError } from './errors';\nimport { FirebaseAppLiteImpl } from './lite/firebaseAppLite';\nimport { DEFAULT_ENTRY_NAME } from './constants';\n\nfunction contains(obj: object, key: string) {\n return Object.prototype.hasOwnProperty.call(obj, key);\n}\n\n/**\n * Because auth can't share code with other components, we attach the utility functions\n * in an internal namespace to share code.\n * This function return a firebase namespace object without\n * any utility functions, so it can be shared between the regular firebaseNamespace and\n * the lite version.\n */\nexport function createFirebaseNamespaceCore(\n firebaseAppImpl: typeof FirebaseAppImpl | typeof FirebaseAppLiteImpl\n): FirebaseNamespace {\n const apps: { [name: string]: FirebaseApp } = {};\n const factories: { [service: string]: FirebaseServiceFactory } = {};\n const appHooks: { [service: string]: AppHook } = {};\n\n // A namespace is a plain JavaScript Object.\n const namespace: FirebaseNamespace = {\n // Hack to prevent Babel from modifying the object returned\n // as the firebase namespace.\n // @ts-ignore\n __esModule: true,\n initializeApp: initializeApp,\n app: app as any,\n apps: null as any,\n Promise: Promise,\n SDK_VERSION: '${JSCORE_VERSION}',\n INTERNAL: {\n registerService,\n removeApp,\n factories,\n useAsService\n }\n };\n\n // Inject a circular default export to allow Babel users who were previously\n // using:\n //\n // import firebase from 'firebase';\n // which becomes: var firebase = require('firebase').default;\n //\n // instead of\n //\n // import * as firebase from 'firebase';\n // which becomes: var firebase = require('firebase');\n patchProperty(namespace, 'default', namespace);\n\n // firebase.apps is a read-only getter.\n Object.defineProperty(namespace, 'apps', {\n get: getApps\n });\n\n /**\n * Called by App.delete() - but before any services associated with the App\n * are deleted.\n */\n function removeApp(name: string): void {\n const app = apps[name];\n callAppHooks(app, 'delete');\n delete apps[name];\n }\n\n /**\n * Get the App object for a given name (or DEFAULT).\n */\n function app(name?: string): FirebaseApp {\n name = name || DEFAULT_ENTRY_NAME;\n if (!contains(apps, name)) {\n error(AppError.NO_APP, { name: name });\n }\n return apps[name];\n }\n\n patchProperty(app, 'App', firebaseAppImpl);\n /**\n * Create a new App instance (name must be unique).\n */\n function initializeApp(\n options: FirebaseOptions,\n config?: FirebaseAppConfig\n ): FirebaseApp;\n function initializeApp(options: FirebaseOptions, name?: string): FirebaseApp;\n function initializeApp(options: FirebaseOptions, rawConfig = {}) {\n if (typeof rawConfig !== 'object' || rawConfig === null) {\n const name = rawConfig;\n rawConfig = { name };\n }\n\n const config = rawConfig as FirebaseAppConfig;\n\n if (config.name === undefined) {\n config.name = DEFAULT_ENTRY_NAME;\n }\n\n const { name } = config;\n\n if (typeof name !== 'string' || !name) {\n error(AppError.BAD_APP_NAME, { name: String(name) });\n }\n\n if (contains(apps, name)) {\n error(AppError.DUPLICATE_APP, { name: name });\n }\n\n const app = new firebaseAppImpl(\n options,\n config,\n namespace as _FirebaseNamespace\n );\n\n apps[name] = app;\n callAppHooks(app, 'create');\n\n return app;\n }\n\n /*\n * Return an array of all the non-deleted FirebaseApps.\n */\n function getApps(): FirebaseApp[] {\n // Make a copy so caller cannot mutate the apps list.\n return Object.keys(apps).map(name => apps[name]);\n }\n\n /*\n * Register a Firebase Service.\n *\n * firebase.INTERNAL.registerService()\n *\n * TODO: Implement serviceProperties.\n */\n function registerService(\n name: string,\n createService: FirebaseServiceFactory,\n serviceProperties?: { [prop: string]: unknown },\n appHook?: AppHook,\n allowMultipleInstances = false\n ): FirebaseServiceNamespace<FirebaseService> {\n // Cannot re-register a service that already exists\n if (factories[name]) {\n error(AppError.DUPLICATE_SERVICE, { name: name });\n }\n\n // Capture the service factory for later service instantiation\n factories[name] = createService;\n\n // Capture the appHook, if passed\n if (appHook) {\n appHooks[name] = appHook;\n\n // Run the **new** app hook on all existing apps\n getApps().forEach(app => {\n appHook('create', app);\n });\n }\n\n // The Service namespace is an accessor function ...\n function serviceNamespace(appArg: FirebaseApp = app()) {\n if (typeof appArg[name] !== 'function') {\n // Invalid argument.\n // This happens in the following case: firebase.storage('gs:/')\n error(AppError.INVALID_APP_ARGUMENT, { name: name });\n }\n\n // Forward service instance lookup to the FirebaseApp.\n return appArg[name]();\n }\n\n // ... and a container for service-level properties.\n if (serviceProperties !== undefined) {\n deepExtend(serviceNamespace, serviceProperties);\n }\n\n // Monkey-patch the serviceNamespace onto the firebase namespace\n namespace[name] = serviceNamespace;\n\n // Patch the FirebaseAppImpl prototype\n firebaseAppImpl.prototype[name] = function(...args) {\n const serviceFxn = this._getService.bind(this, name);\n return serviceFxn.apply(this, allowMultipleInstances ? args : []);\n };\n\n return serviceNamespace;\n }\n\n function callAppHooks(app: FirebaseApp, eventName: string) {\n for (const serviceName of Object.keys(factories)) {\n // Ignore virtual services\n const factoryName = useAsService(app, serviceName);\n if (factoryName === null) {\n return;\n }\n\n if (appHooks[factoryName]) {\n appHooks[factoryName](eventName, app);\n }\n }\n }\n\n // Map the requested service to a registered service name\n // (used to map auth to serverAuth service when needed).\n function useAsService(app: FirebaseApp, name: string): string | null {\n if (name === 'serverAuth') {\n return null;\n }\n\n const useService = name;\n const options = app.options;\n\n return useService;\n }\n\n return namespace;\n}\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { FirebaseNamespace } from '@firebase/app-types';\nimport { _FirebaseApp, _FirebaseNamespace } from '@firebase/app-types/private';\nimport { createSubscribe, deepExtend, ErrorFactory } from '@firebase/util';\nimport { FirebaseAppImpl } from './firebaseApp';\nimport { createFirebaseNamespaceCore } from './firebaseNamespaceCore';\n\n/**\n * Return a firebase namespace object.\n *\n * In production, this will be called exactly once and the result\n * assigned to the 'firebase' global. It may be called multiple times\n * in unit tests.\n */\nexport function createFirebaseNamespace(): FirebaseNamespace {\n const namespace = createFirebaseNamespaceCore(FirebaseAppImpl);\n (namespace as _FirebaseNamespace).INTERNAL = {\n ...(namespace as _FirebaseNamespace).INTERNAL,\n createFirebaseNamespace: createFirebaseNamespace,\n extendNamespace: extendNamespace,\n createSubscribe: createSubscribe,\n ErrorFactory: ErrorFactory,\n deepExtend: deepExtend\n };\n\n /**\n * Patch the top-level firebase namespace with additional properties.\n *\n * firebase.INTERNAL.extendNamespace()\n */\n function extendNamespace(props: { [prop: string]: unknown }): void {\n deepExtend(namespace, props);\n }\n\n return namespace;\n}\n","/**\n * @license\n * Copyright 2017 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { FirebaseNamespace } from '@firebase/app-types';\nimport { createFirebaseNamespace } from './src/firebaseNamespace';\n\n// Node detection logic from: https://github.com/iliakan/detect-node/\nlet isNode = false;\ntry {\n isNode =\n Object.prototype.toString.call(global.process) === '[object process]';\n} catch (e) {}\n\nisNode &&\n console.warn(`\nWarning: This is a browser-targeted Firebase bundle but it appears it is being\nrun in a Node environment. If running in a Node environment, make sure you\nare using the bundle specified by the \"main\" field in package.json.\n\nIf you are using Webpack, you can specify \"main\" as the first item in\n\"resolve.mainFields\":\nhttps://webpack.js.org/configuration/resolve/#resolvemainfields\n\nIf using Rollup, use the rollup-plugin-node-resolve plugin and set \"module\"\nto false and \"main\" to true:\nhttps://github.com/rollup/rollup-plugin-node-resolve\n`);\n\n// Firebase Lite detection\nif (self && 'firebase' in self) {\n console.warn(`\n Warning: Firebase is already defined in the global scope. Please make sure\n Firebase library is only loaded once.\n `);\n\n const sdkVersion = ((self as any).firebase as FirebaseNamespace).SDK_VERSION;\n if (sdkVersion && sdkVersion.indexOf('LITE') >= 0) {\n console.warn(`\n Warning: You are trying to load Firebase while using Firebase Performance standalone script.\n You should load Firebase Performance with this instance of Firebase to avoid loading duplicate code.\n `);\n }\n}\n\nexport const firebase = createFirebaseNamespace();\n\nexport default firebase;\n"],"names":["ErrorFactory","deepCopy","deepExtend","patchProperty","createSubscribe"],"mappings":";;;;;;;AAAA;;;;;;;;;;;;;;;;;AAiBA,AAWA,IAAM,MAAM;IACV,4BACE,+CAA+C;QAC/C,mCAAmC;IACrC,wCAAyB,4BAA4B;IACrD,0CAA0B,6CAA6C;IACvE,sCAAwB,8CAA8C;IACtE,kDACE,qDAAqD;IACvD,wDACE,mDAAmD;QACnD,wBAAwB;OAC3B,CAAC;AAEF,IAAM,SAAS,GAAG,IAAIA,iBAAY,CAAW,KAAK,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC;AAExE,SAAgB,KAAK,CAAC,IAAc,EAAE,IAA8B;IAClE,MAAM,SAAS,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;CACpC;;AC9CD;;;;;;;;;;;;;;;;AAiBA,AAAO,IAAM,kBAAkB,GAAG,WAAW,CAAC;;ACjB9C;;;;;;;;;;;;;;;;AA4BA,AAUA;;AAEA,IAAI,cAAc,GA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kBAAkB,CAAC;CACzE;AAAC,OAAO,CAAC,EAAE,GAAE;AAEd,MAAM;IACJ,OAAO,CAAC,IAAI,CAAC,ojBAYd,CAAC,CAAC;;AAGH,IAAI,IAAI,IAAI,UAAU,IAAI,IAAI,EAAE;IAC9B,OAAO,CAAC,IAAI,CAAC,iIAGZ,CAAC,CAAC;IAEH,IAAM,UAAU,GAAK,IAAY,CAAC,QAA8B,CAAC,WAAW,CAAC;IAC7E,IAAI,UAAU,IAAI,UAAU,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE;QACjD,OAAO,CAAC,IAAI,CAAC,oNAGZ,CAAC,CAAC;KACJ;CACF;AAED,IAAa,QAAQ,GAAG,uBAAuB,EAAE;;;;;"}
package/dist/index.esm.js CHANGED
@@ -263,7 +263,7 @@ function createFirebaseNamespaceCore(firebaseAppImpl) {
263
263
  app: app,
264
264
  apps: null,
265
265
  Promise: Promise,
266
- SDK_VERSION: '5.11.0-canary.a7bb0b5',
266
+ SDK_VERSION: '5.11.0',
267
267
  INTERNAL: {
268
268
  registerService: registerService,
269
269
  removeApp: removeApp,
@@ -1 +1 @@
1
- {"version":3,"file":"index.esm.js","sources":["../src/errors.ts","../src/constants.ts","../src/firebaseApp.ts","../src/firebaseNamespaceCore.ts","../src/firebaseNamespace.ts","../index.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ErrorFactory, ErrorMap } from '@firebase/util';\n\nexport const enum AppError {\n NO_APP = 'no-app',\n BAD_APP_NAME = 'bad-app-name',\n DUPLICATE_APP = 'duplicate-app',\n APP_DELETED = 'app-deleted',\n DUPLICATE_SERVICE = 'duplicate-service',\n INVALID_APP_ARGUMENT = 'invalid-app-argument'\n}\n\nconst ERRORS: ErrorMap<AppError> = {\n [AppError.NO_APP]:\n \"No Firebase App '{$name}' has been created - \" +\n 'call Firebase App.initializeApp()',\n [AppError.BAD_APP_NAME]: \"Illegal App name: '{$name}\",\n [AppError.DUPLICATE_APP]: \"Firebase App named '{$name}' already exists\",\n [AppError.APP_DELETED]: \"Firebase App named '{$name}' already deleted\",\n [AppError.DUPLICATE_SERVICE]:\n \"Firebase service named '{$name}' already registered\",\n [AppError.INVALID_APP_ARGUMENT]:\n 'firebase.{$name}() takes either no argument or a ' +\n 'Firebase App instance.'\n};\n\nconst appErrors = new ErrorFactory<AppError>('app', 'Firebase', ERRORS);\n\nexport function error(code: AppError, args?: { [name: string]: any }) {\n throw appErrors.create(code, args);\n}\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport const DEFAULT_ENTRY_NAME = '[DEFAULT]';\n","/**\n * @license\n * Copyright 2017 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n FirebaseApp,\n FirebaseOptions,\n FirebaseAppConfig\n} from '@firebase/app-types';\nimport {\n _FirebaseApp,\n _FirebaseNamespace,\n FirebaseService,\n FirebaseAppInternals\n} from '@firebase/app-types/private';\nimport { deepCopy, deepExtend } from '@firebase/util';\nimport { error, AppError } from './errors';\nimport { DEFAULT_ENTRY_NAME } from './constants';\n\ninterface ServicesCache {\n [name: string]: {\n [serviceName: string]: FirebaseService;\n };\n}\n\n// An array to capture listeners before the true auth functions\n// exist\nlet tokenListeners: any[] = [];\n\n/**\n * Global context object for a collection of services using\n * a shared authentication state.\n */\nexport class FirebaseAppImpl implements FirebaseApp {\n private readonly options_: FirebaseOptions;\n private readonly name_: string;\n private isDeleted_ = false;\n private services_: ServicesCache = {};\n private automaticDataCollectionEnabled_: boolean;\n\n INTERNAL: FirebaseAppInternals;\n\n constructor(\n options: FirebaseOptions,\n config: FirebaseAppConfig,\n private readonly firebase_: _FirebaseNamespace\n ) {\n this.name_ = config.name!;\n this.automaticDataCollectionEnabled_ =\n config.automaticDataCollectionEnabled || false;\n this.options_ = deepCopy<FirebaseOptions>(options);\n this.INTERNAL = {\n getUid: () => null,\n getToken: () => Promise.resolve(null),\n addAuthTokenListener: (callback: (token: string | null) => void) => {\n tokenListeners.push(callback);\n // Make sure callback is called, asynchronously, in the absence of the auth module\n setTimeout(() => callback(null), 0);\n },\n removeAuthTokenListener: callback => {\n tokenListeners = tokenListeners.filter(\n listener => listener !== callback\n );\n }\n };\n }\n\n get automaticDataCollectionEnabled(): boolean {\n this.checkDestroyed_();\n return this.automaticDataCollectionEnabled_;\n }\n\n set automaticDataCollectionEnabled(val) {\n this.checkDestroyed_();\n this.automaticDataCollectionEnabled_ = val;\n }\n\n get name(): string {\n this.checkDestroyed_();\n return this.name_;\n }\n\n get options(): FirebaseOptions {\n this.checkDestroyed_();\n return this.options_;\n }\n\n delete(): Promise<void> {\n return new Promise(resolve => {\n this.checkDestroyed_();\n resolve();\n })\n .then(() => {\n this.firebase_.INTERNAL.removeApp(this.name_);\n const services: FirebaseService[] = [];\n\n for (const serviceKey of Object.keys(this.services_)) {\n for (const instanceKey of Object.keys(this.services_[serviceKey])) {\n services.push(this.services_[serviceKey][instanceKey]);\n }\n }\n\n return Promise.all(\n services.map(service => {\n return service.INTERNAL.delete();\n })\n );\n })\n .then(\n (): void => {\n this.isDeleted_ = true;\n this.services_ = {};\n }\n );\n }\n\n /**\n * Return a service instance associated with this app (creating it\n * on demand), identified by the passed instanceIdentifier.\n *\n * NOTE: Currently storage is the only one that is leveraging this\n * functionality. They invoke it by calling:\n *\n * ```javascript\n * firebase.app().storage('STORAGE BUCKET ID')\n * ```\n *\n * The service name is passed to this already\n * @internal\n */\n _getService(\n name: string,\n instanceIdentifier: string = DEFAULT_ENTRY_NAME\n ): FirebaseService {\n this.checkDestroyed_();\n\n if (!this.services_[name]) {\n this.services_[name] = {};\n }\n\n if (!this.services_[name][instanceIdentifier]) {\n /**\n * If a custom instance has been defined (i.e. not '[DEFAULT]')\n * then we will pass that instance on, otherwise we pass `null`\n */\n const instanceSpecifier =\n instanceIdentifier !== DEFAULT_ENTRY_NAME\n ? instanceIdentifier\n : undefined;\n const service = this.firebase_.INTERNAL.factories[name](\n this,\n this.extendApp.bind(this),\n instanceSpecifier\n );\n this.services_[name][instanceIdentifier] = service;\n }\n\n return this.services_[name][instanceIdentifier];\n }\n\n /**\n * Callback function used to extend an App instance at the time\n * of service instance creation.\n */\n private extendApp(props: { [name: string]: any }): void {\n // Copy the object onto the FirebaseAppImpl prototype\n deepExtend(this, props);\n\n /**\n * If the app has overwritten the addAuthTokenListener stub, forward\n * the active token listeners on to the true fxn.\n *\n * TODO: This function is required due to our current module\n * structure. Once we are able to rely strictly upon a single module\n * implementation, this code should be refactored and Auth should\n * provide these stubs and the upgrade logic\n */\n if (props.INTERNAL && props.INTERNAL.addAuthTokenListener) {\n tokenListeners.forEach(listener => {\n this.INTERNAL.addAuthTokenListener(listener);\n });\n tokenListeners = [];\n }\n }\n\n /**\n * This function will throw an Error if the App has already been deleted -\n * use before performing API actions on the App.\n */\n private checkDestroyed_(): void {\n if (this.isDeleted_) {\n error(AppError.APP_DELETED, { name: this.name_ });\n }\n }\n}\n\n// Prevent dead-code elimination of these methods w/o invalid property\n// copying.\n(FirebaseAppImpl.prototype.name && FirebaseAppImpl.prototype.options) ||\n FirebaseAppImpl.prototype.delete ||\n console.log('dc');\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n FirebaseApp,\n FirebaseOptions,\n FirebaseNamespace,\n FirebaseAppConfig\n} from '@firebase/app-types';\nimport {\n _FirebaseApp,\n _FirebaseNamespace,\n FirebaseService,\n FirebaseServiceFactory,\n FirebaseServiceNamespace,\n AppHook\n} from '@firebase/app-types/private';\nimport { deepExtend, patchProperty } from '@firebase/util';\nimport { FirebaseAppImpl } from './firebaseApp';\nimport { error, AppError } from './errors';\nimport { FirebaseAppLiteImpl } from './lite/firebaseAppLite';\nimport { DEFAULT_ENTRY_NAME } from './constants';\n\nfunction contains(obj: object, key: string) {\n return Object.prototype.hasOwnProperty.call(obj, key);\n}\n\n/**\n * Because auth can't share code with other components, we attach the utility functions\n * in an internal namespace to share code.\n * This function return a firebase namespace object without\n * any utility functions, so it can be shared between the regular firebaseNamespace and\n * the lite version.\n */\nexport function createFirebaseNamespaceCore(\n firebaseAppImpl: typeof FirebaseAppImpl | typeof FirebaseAppLiteImpl\n): FirebaseNamespace {\n const apps: { [name: string]: FirebaseApp } = {};\n const factories: { [service: string]: FirebaseServiceFactory } = {};\n const appHooks: { [service: string]: AppHook } = {};\n\n // A namespace is a plain JavaScript Object.\n const namespace: FirebaseNamespace = {\n // Hack to prevent Babel from modifying the object returned\n // as the firebase namespace.\n // @ts-ignore\n __esModule: true,\n initializeApp: initializeApp,\n app: app as any,\n apps: null as any,\n Promise: Promise,\n SDK_VERSION: '${JSCORE_VERSION}',\n INTERNAL: {\n registerService,\n removeApp,\n factories,\n useAsService\n }\n };\n\n // Inject a circular default export to allow Babel users who were previously\n // using:\n //\n // import firebase from 'firebase';\n // which becomes: var firebase = require('firebase').default;\n //\n // instead of\n //\n // import * as firebase from 'firebase';\n // which becomes: var firebase = require('firebase');\n patchProperty(namespace, 'default', namespace);\n\n // firebase.apps is a read-only getter.\n Object.defineProperty(namespace, 'apps', {\n get: getApps\n });\n\n /**\n * Called by App.delete() - but before any services associated with the App\n * are deleted.\n */\n function removeApp(name: string): void {\n const app = apps[name];\n callAppHooks(app, 'delete');\n delete apps[name];\n }\n\n /**\n * Get the App object for a given name (or DEFAULT).\n */\n function app(name?: string): FirebaseApp {\n name = name || DEFAULT_ENTRY_NAME;\n if (!contains(apps, name)) {\n error(AppError.NO_APP, { name: name });\n }\n return apps[name];\n }\n\n patchProperty(app, 'App', firebaseAppImpl);\n /**\n * Create a new App instance (name must be unique).\n */\n function initializeApp(\n options: FirebaseOptions,\n config?: FirebaseAppConfig\n ): FirebaseApp;\n function initializeApp(options: FirebaseOptions, name?: string): FirebaseApp;\n function initializeApp(options: FirebaseOptions, rawConfig = {}) {\n if (typeof rawConfig !== 'object' || rawConfig === null) {\n const name = rawConfig;\n rawConfig = { name };\n }\n\n const config = rawConfig as FirebaseAppConfig;\n\n if (config.name === undefined) {\n config.name = DEFAULT_ENTRY_NAME;\n }\n\n const { name } = config;\n\n if (typeof name !== 'string' || !name) {\n error(AppError.BAD_APP_NAME, { name: String(name) });\n }\n\n if (contains(apps, name)) {\n error(AppError.DUPLICATE_APP, { name: name });\n }\n\n const app = new firebaseAppImpl(\n options,\n config,\n namespace as _FirebaseNamespace\n );\n\n apps[name] = app;\n callAppHooks(app, 'create');\n\n return app;\n }\n\n /*\n * Return an array of all the non-deleted FirebaseApps.\n */\n function getApps(): FirebaseApp[] {\n // Make a copy so caller cannot mutate the apps list.\n return Object.keys(apps).map(name => apps[name]);\n }\n\n /*\n * Register a Firebase Service.\n *\n * firebase.INTERNAL.registerService()\n *\n * TODO: Implement serviceProperties.\n */\n function registerService(\n name: string,\n createService: FirebaseServiceFactory,\n serviceProperties?: { [prop: string]: unknown },\n appHook?: AppHook,\n allowMultipleInstances = false\n ): FirebaseServiceNamespace<FirebaseService> {\n // Cannot re-register a service that already exists\n if (factories[name]) {\n error(AppError.DUPLICATE_SERVICE, { name: name });\n }\n\n // Capture the service factory for later service instantiation\n factories[name] = createService;\n\n // Capture the appHook, if passed\n if (appHook) {\n appHooks[name] = appHook;\n\n // Run the **new** app hook on all existing apps\n getApps().forEach(app => {\n appHook('create', app);\n });\n }\n\n // The Service namespace is an accessor function ...\n function serviceNamespace(appArg: FirebaseApp = app()) {\n if (typeof appArg[name] !== 'function') {\n // Invalid argument.\n // This happens in the following case: firebase.storage('gs:/')\n error(AppError.INVALID_APP_ARGUMENT, { name: name });\n }\n\n // Forward service instance lookup to the FirebaseApp.\n return appArg[name]();\n }\n\n // ... and a container for service-level properties.\n if (serviceProperties !== undefined) {\n deepExtend(serviceNamespace, serviceProperties);\n }\n\n // Monkey-patch the serviceNamespace onto the firebase namespace\n namespace[name] = serviceNamespace;\n\n // Patch the FirebaseAppImpl prototype\n firebaseAppImpl.prototype[name] = function(...args) {\n const serviceFxn = this._getService.bind(this, name);\n return serviceFxn.apply(this, allowMultipleInstances ? args : []);\n };\n\n return serviceNamespace;\n }\n\n function callAppHooks(app: FirebaseApp, eventName: string) {\n for (const serviceName of Object.keys(factories)) {\n // Ignore virtual services\n const factoryName = useAsService(app, serviceName);\n if (factoryName === null) {\n return;\n }\n\n if (appHooks[factoryName]) {\n appHooks[factoryName](eventName, app);\n }\n }\n }\n\n // Map the requested service to a registered service name\n // (used to map auth to serverAuth service when needed).\n function useAsService(app: FirebaseApp, name: string): string | null {\n if (name === 'serverAuth') {\n return null;\n }\n\n const useService = name;\n const options = app.options;\n\n return useService;\n }\n\n return namespace;\n}\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { FirebaseNamespace } from '@firebase/app-types';\nimport { _FirebaseApp, _FirebaseNamespace } from '@firebase/app-types/private';\nimport { createSubscribe, deepExtend, ErrorFactory } from '@firebase/util';\nimport { FirebaseAppImpl } from './firebaseApp';\nimport { createFirebaseNamespaceCore } from './firebaseNamespaceCore';\n\n/**\n * Return a firebase namespace object.\n *\n * In production, this will be called exactly once and the result\n * assigned to the 'firebase' global. It may be called multiple times\n * in unit tests.\n */\nexport function createFirebaseNamespace(): FirebaseNamespace {\n const namespace = createFirebaseNamespaceCore(FirebaseAppImpl);\n (namespace as _FirebaseNamespace).INTERNAL = {\n ...(namespace as _FirebaseNamespace).INTERNAL,\n createFirebaseNamespace: createFirebaseNamespace,\n extendNamespace: extendNamespace,\n createSubscribe: createSubscribe,\n ErrorFactory: ErrorFactory,\n deepExtend: deepExtend\n };\n\n /**\n * Patch the top-level firebase namespace with additional properties.\n *\n * firebase.INTERNAL.extendNamespace()\n */\n function extendNamespace(props: { [prop: string]: unknown }): void {\n deepExtend(namespace, props);\n }\n\n return namespace;\n}\n","/**\n * @license\n * Copyright 2017 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { FirebaseNamespace } from '@firebase/app-types';\nimport { createFirebaseNamespace } from './src/firebaseNamespace';\n\n// Node detection logic from: https://github.com/iliakan/detect-node/\nlet isNode = false;\ntry {\n isNode =\n Object.prototype.toString.call(global.process) === '[object process]';\n} catch (e) {}\n\nisNode &&\n console.warn(`\nWarning: This is a browser-targeted Firebase bundle but it appears it is being\nrun in a Node environment. If running in a Node environment, make sure you\nare using the bundle specified by the \"main\" field in package.json.\n\nIf you are using Webpack, you can specify \"main\" as the first item in\n\"resolve.mainFields\":\nhttps://webpack.js.org/configuration/resolve/#resolvemainfields\n\nIf using Rollup, use the rollup-plugin-node-resolve plugin and set \"module\"\nto false and \"main\" to true:\nhttps://github.com/rollup/rollup-plugin-node-resolve\n`);\n\n// Firebase Lite detection\nif (self && 'firebase' in self) {\n console.warn(`\n Warning: Firebase is already defined in the global scope. Please make sure\n Firebase library is only loaded once.\n `);\n\n const sdkVersion = ((self as any).firebase as FirebaseNamespace).SDK_VERSION;\n if (sdkVersion && sdkVersion.indexOf('LITE') >= 0) {\n console.warn(`\n Warning: You are trying to load Firebase while using Firebase Performance standalone script.\n You should load Firebase Performance with this instance of Firebase to avoid loading duplicate code.\n `);\n }\n}\n\nexport const firebase = createFirebaseNamespace();\n\nexport default firebase;\n"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;AAiBA,AAWA,IAAM,MAAM;IACV,4BACE,+CAA+C;QAC/C,mCAAmC;IACrC,wCAAyB,4BAA4B;IACrD,0CAA0B,6CAA6C;IACvE,sCAAwB,8CAA8C;IACtE,kDACE,qDAAqD;IACvD,wDACE,mDAAmD;QACnD,wBAAwB;OAC3B,CAAC;AAEF,IAAM,SAAS,GAAG,IAAI,YAAY,CAAW,KAAK,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC;AAExE,SA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,CAAC;KAC9B;IAED,OAAO,SAAS,CAAC;CAClB;;ACnDD;;;;;;;;;;;;;;;;AAkBA,AAEA;AACA,IAAI,MAAM,GAAG,KAAK,CAAC;AACnB,IAAI;IACF,MAAM;QACJ,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,kBAAkB,CAAC;CACzE;AAAC,OAAO,CAAC,EAAE,GAAE;AAEd,MAAM;IACJ,OAAO,CAAC,IAAI,CAAC,ojBAYd,CAAC,CAAC;;AAGH,IAAI,IAAI,IAAI,UAAU,IAAI,IAAI,EAAE;IAC9B,OAAO,CAAC,IAAI,CAAC,iIAGZ,CAAC,CAAC;IAEH,IAAM,UAAU,GAAK,IAAY,CAAC,QAA8B,CAAC,WAAW,CAAC;IAC7E,IAAI,UAAU,IAAI,UAAU,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE;QACjD,OAAO,CAAC,IAAI,CAAC,oNAGZ,CAAC,CAAC;KACJ;CACF;AAED,IAAa,QAAQ,GAAG,uBAAuB,EAAE;;;;;"}
1
+ {"version":3,"file":"index.esm.js","sources":["../src/errors.ts","../src/constants.ts","../src/firebaseApp.ts","../src/firebaseNamespaceCore.ts","../src/firebaseNamespace.ts","../index.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ErrorFactory, ErrorMap } from '@firebase/util';\n\nexport const enum AppError {\n NO_APP = 'no-app',\n BAD_APP_NAME = 'bad-app-name',\n DUPLICATE_APP = 'duplicate-app',\n APP_DELETED = 'app-deleted',\n DUPLICATE_SERVICE = 'duplicate-service',\n INVALID_APP_ARGUMENT = 'invalid-app-argument'\n}\n\nconst ERRORS: ErrorMap<AppError> = {\n [AppError.NO_APP]:\n \"No Firebase App '{$name}' has been created - \" +\n 'call Firebase App.initializeApp()',\n [AppError.BAD_APP_NAME]: \"Illegal App name: '{$name}\",\n [AppError.DUPLICATE_APP]: \"Firebase App named '{$name}' already exists\",\n [AppError.APP_DELETED]: \"Firebase App named '{$name}' already deleted\",\n [AppError.DUPLICATE_SERVICE]:\n \"Firebase service named '{$name}' already registered\",\n [AppError.INVALID_APP_ARGUMENT]:\n 'firebase.{$name}() takes either no argument or a ' +\n 'Firebase App instance.'\n};\n\nconst appErrors = new ErrorFactory<AppError>('app', 'Firebase', ERRORS);\n\nexport function error(code: AppError, args?: { [name: string]: any }) {\n throw appErrors.create(code, args);\n}\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport const DEFAULT_ENTRY_NAME = '[DEFAULT]';\n","/**\n * @license\n * Copyright 2017 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n FirebaseApp,\n FirebaseOptions,\n FirebaseAppConfig\n} from '@firebase/app-types';\nimport {\n _FirebaseApp,\n _FirebaseNamespace,\n FirebaseService,\n FirebaseAppInternals\n} from '@firebase/app-types/private';\nimport { deepCopy, deepExtend } from '@firebase/util';\nimport { error, AppError } from './errors';\nimport { DEFAULT_ENTRY_NAME } from './constants';\n\ninterface ServicesCache {\n [name: string]: {\n [serviceName: string]: FirebaseService;\n };\n}\n\n// An array to capture listeners before the true auth functions\n// exist\nlet tokenListeners: any[] = [];\n\n/**\n * Global context object for a collection of services using\n * a shared authentication state.\n */\nexport class FirebaseAppImpl implements FirebaseApp {\n private readonly options_: FirebaseOptions;\n private readonly name_: string;\n private isDeleted_ = false;\n private services_: ServicesCache = {};\n private automaticDataCollectionEnabled_: boolean;\n\n INTERNAL: FirebaseAppInternals;\n\n constructor(\n options: FirebaseOptions,\n config: FirebaseAppConfig,\n private readonly firebase_: _FirebaseNamespace\n ) {\n this.name_ = config.name!;\n this.automaticDataCollectionEnabled_ =\n config.automaticDataCollectionEnabled || false;\n this.options_ = deepCopy<FirebaseOptions>(options);\n this.INTERNAL = {\n getUid: () => null,\n getToken: () => Promise.resolve(null),\n addAuthTokenListener: (callback: (token: string | null) => void) => {\n tokenListeners.push(callback);\n // Make sure callback is called, asynchronously, in the absence of the auth module\n setTimeout(() => callback(null), 0);\n },\n removeAuthTokenListener: callback => {\n tokenListeners = tokenListeners.filter(\n listener => listener !== callback\n );\n }\n };\n }\n\n get automaticDataCollectionEnabled(): boolean {\n this.checkDestroyed_();\n return this.automaticDataCollectionEnabled_;\n }\n\n set automaticDataCollectionEnabled(val) {\n this.checkDestroyed_();\n this.automaticDataCollectionEnabled_ = val;\n }\n\n get name(): string {\n this.checkDestroyed_();\n return this.name_;\n }\n\n get options(): FirebaseOptions {\n this.checkDestroyed_();\n return this.options_;\n }\n\n delete(): Promise<void> {\n return new Promise(resolve => {\n this.checkDestroyed_();\n resolve();\n })\n .then(() => {\n this.firebase_.INTERNAL.removeApp(this.name_);\n const services: FirebaseService[] = [];\n\n for (const serviceKey of Object.keys(this.services_)) {\n for (const instanceKey of Object.keys(this.services_[serviceKey])) {\n services.push(this.services_[serviceKey][instanceKey]);\n }\n }\n\n return Promise.all(\n services.map(service => {\n return service.INTERNAL.delete();\n })\n );\n })\n .then(\n (): void => {\n this.isDeleted_ = true;\n this.services_ = {};\n }\n );\n }\n\n /**\n * Return a service instance associated with this app (creating it\n * on demand), identified by the passed instanceIdentifier.\n *\n * NOTE: Currently storage is the only one that is leveraging this\n * functionality. They invoke it by calling:\n *\n * ```javascript\n * firebase.app().storage('STORAGE BUCKET ID')\n * ```\n *\n * The service name is passed to this already\n * @internal\n */\n _getService(\n name: string,\n instanceIdentifier: string = DEFAULT_ENTRY_NAME\n ): FirebaseService {\n this.checkDestroyed_();\n\n if (!this.services_[name]) {\n this.services_[name] = {};\n }\n\n if (!this.services_[name][instanceIdentifier]) {\n /**\n * If a custom instance has been defined (i.e. not '[DEFAULT]')\n * then we will pass that instance on, otherwise we pass `null`\n */\n const instanceSpecifier =\n instanceIdentifier !== DEFAULT_ENTRY_NAME\n ? instanceIdentifier\n : undefined;\n const service = this.firebase_.INTERNAL.factories[name](\n this,\n this.extendApp.bind(this),\n instanceSpecifier\n );\n this.services_[name][instanceIdentifier] = service;\n }\n\n return this.services_[name][instanceIdentifier];\n }\n\n /**\n * Callback function used to extend an App instance at the time\n * of service instance creation.\n */\n private extendApp(props: { [name: string]: any }): void {\n // Copy the object onto the FirebaseAppImpl prototype\n deepExtend(this, props);\n\n /**\n * If the app has overwritten the addAuthTokenListener stub, forward\n * the active token listeners on to the true fxn.\n *\n * TODO: This function is required due to our current module\n * structure. Once we are able to rely strictly upon a single module\n * implementation, this code should be refactored and Auth should\n * provide these stubs and the upgrade logic\n */\n if (props.INTERNAL && props.INTERNAL.addAuthTokenListener) {\n tokenListeners.forEach(listener => {\n this.INTERNAL.addAuthTokenListener(listener);\n });\n tokenListeners = [];\n }\n }\n\n /**\n * This function will throw an Error if the App has already been deleted -\n * use before performing API actions on the App.\n */\n private checkDestroyed_(): void {\n if (this.isDeleted_) {\n error(AppError.APP_DELETED, { name: this.name_ });\n }\n }\n}\n\n// Prevent dead-code elimination of these methods w/o invalid property\n// copying.\n(FirebaseAppImpl.prototype.name && FirebaseAppImpl.prototype.options) ||\n FirebaseAppImpl.prototype.delete ||\n console.log('dc');\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n FirebaseApp,\n FirebaseOptions,\n FirebaseNamespace,\n FirebaseAppConfig\n} from '@firebase/app-types';\nimport {\n _FirebaseApp,\n _FirebaseNamespace,\n FirebaseService,\n FirebaseServiceFactory,\n FirebaseServiceNamespace,\n AppHook\n} from '@firebase/app-types/private';\nimport { deepExtend, patchProperty } from '@firebase/util';\nimport { FirebaseAppImpl } from './firebaseApp';\nimport { error, AppError } from './errors';\nimport { FirebaseAppLiteImpl } from './lite/firebaseAppLite';\nimport { DEFAULT_ENTRY_NAME } from './constants';\n\nfunction contains(obj: object, key: string) {\n return Object.prototype.hasOwnProperty.call(obj, key);\n}\n\n/**\n * Because auth can't share code with other components, we attach the utility functions\n * in an internal namespace to share code.\n * This function return a firebase namespace object without\n * any utility functions, so it can be shared between the regular firebaseNamespace and\n * the lite version.\n */\nexport function createFirebaseNamespaceCore(\n firebaseAppImpl: typeof FirebaseAppImpl | typeof FirebaseAppLiteImpl\n): FirebaseNamespace {\n const apps: { [name: string]: FirebaseApp } = {};\n const factories: { [service: string]: FirebaseServiceFactory } = {};\n const appHooks: { [service: string]: AppHook } = {};\n\n // A namespace is a plain JavaScript Object.\n const namespace: FirebaseNamespace = {\n // Hack to prevent Babel from modifying the object returned\n // as the firebase namespace.\n // @ts-ignore\n __esModule: true,\n initializeApp: initializeApp,\n app: app as any,\n apps: null as any,\n Promise: Promise,\n SDK_VERSION: '${JSCORE_VERSION}',\n INTERNAL: {\n registerService,\n removeApp,\n factories,\n useAsService\n }\n };\n\n // Inject a circular default export to allow Babel users who were previously\n // using:\n //\n // import firebase from 'firebase';\n // which becomes: var firebase = require('firebase').default;\n //\n // instead of\n //\n // import * as firebase from 'firebase';\n // which becomes: var firebase = require('firebase');\n patchProperty(namespace, 'default', namespace);\n\n // firebase.apps is a read-only getter.\n Object.defineProperty(namespace, 'apps', {\n get: getApps\n });\n\n /**\n * Called by App.delete() - but before any services associated with the App\n * are deleted.\n */\n function removeApp(name: string): void {\n const app = apps[name];\n callAppHooks(app, 'delete');\n delete apps[name];\n }\n\n /**\n * Get the App object for a given name (or DEFAULT).\n */\n function app(name?: string): FirebaseApp {\n name = name || DEFAULT_ENTRY_NAME;\n if (!contains(apps, name)) {\n error(AppError.NO_APP, { name: name });\n }\n return apps[name];\n }\n\n patchProperty(app, 'App', firebaseAppImpl);\n /**\n * Create a new App instance (name must be unique).\n */\n function initializeApp(\n options: FirebaseOptions,\n config?: FirebaseAppConfig\n ): FirebaseApp;\n function initializeApp(options: FirebaseOptions, name?: string): FirebaseApp;\n function initializeApp(options: FirebaseOptions, rawConfig = {}) {\n if (typeof rawConfig !== 'object' || rawConfig === null) {\n const name = rawConfig;\n rawConfig = { name };\n }\n\n const config = rawConfig as FirebaseAppConfig;\n\n if (config.name === undefined) {\n config.name = DEFAULT_ENTRY_NAME;\n }\n\n const { name } = config;\n\n if (typeof name !== 'string' || !name) {\n error(AppError.BAD_APP_NAME, { name: String(name) });\n }\n\n if (contains(apps, name)) {\n error(AppError.DUPLICATE_APP, { name: name });\n }\n\n const app = new firebaseAppImpl(\n options,\n config,\n namespace as _FirebaseNamespace\n );\n\n apps[name] = app;\n callAppHooks(app, 'create');\n\n return app;\n }\n\n /*\n * Return an array of all the non-deleted FirebaseApps.\n */\n function getApps(): FirebaseApp[] {\n // Make a copy so caller cannot mutate the apps list.\n return Object.keys(apps).map(name => apps[name]);\n }\n\n /*\n * Register a Firebase Service.\n *\n * firebase.INTERNAL.registerService()\n *\n * TODO: Implement serviceProperties.\n */\n function registerService(\n name: string,\n createService: FirebaseServiceFactory,\n serviceProperties?: { [prop: string]: unknown },\n appHook?: AppHook,\n allowMultipleInstances = false\n ): FirebaseServiceNamespace<FirebaseService> {\n // Cannot re-register a service that already exists\n if (factories[name]) {\n error(AppError.DUPLICATE_SERVICE, { name: name });\n }\n\n // Capture the service factory for later service instantiation\n factories[name] = createService;\n\n // Capture the appHook, if passed\n if (appHook) {\n appHooks[name] = appHook;\n\n // Run the **new** app hook on all existing apps\n getApps().forEach(app => {\n appHook('create', app);\n });\n }\n\n // The Service namespace is an accessor function ...\n function serviceNamespace(appArg: FirebaseApp = app()) {\n if (typeof appArg[name] !== 'function') {\n // Invalid argument.\n // This happens in the following case: firebase.storage('gs:/')\n error(AppError.INVALID_APP_ARGUMENT, { name: name });\n }\n\n // Forward service instance lookup to the FirebaseApp.\n return appArg[name]();\n }\n\n // ... and a container for service-level properties.\n if (serviceProperties !== undefined) {\n deepExtend(serviceNamespace, serviceProperties);\n }\n\n // Monkey-patch the serviceNamespace onto the firebase namespace\n namespace[name] = serviceNamespace;\n\n // Patch the FirebaseAppImpl prototype\n firebaseAppImpl.prototype[name] = function(...args) {\n const serviceFxn = this._getService.bind(this, name);\n return serviceFxn.apply(this, allowMultipleInstances ? args : []);\n };\n\n return serviceNamespace;\n }\n\n function callAppHooks(app: FirebaseApp, eventName: string) {\n for (const serviceName of Object.keys(factories)) {\n // Ignore virtual services\n const factoryName = useAsService(app, serviceName);\n if (factoryName === null) {\n return;\n }\n\n if (appHooks[factoryName]) {\n appHooks[factoryName](eventName, app);\n }\n }\n }\n\n // Map the requested service to a registered service name\n // (used to map auth to serverAuth service when needed).\n function useAsService(app: FirebaseApp, name: string): string | null {\n if (name === 'serverAuth') {\n return null;\n }\n\n const useService = name;\n const options = app.options;\n\n return useService;\n }\n\n return namespace;\n}\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { FirebaseNamespace } from '@firebase/app-types';\nimport { _FirebaseApp, _FirebaseNamespace } from '@firebase/app-types/private';\nimport { createSubscribe, deepExtend, ErrorFactory } from '@firebase/util';\nimport { FirebaseAppImpl } from './firebaseApp';\nimport { createFirebaseNamespaceCore } from './firebaseNamespaceCore';\n\n/**\n * Return a firebase namespace object.\n *\n * In production, this will be called exactly once and the result\n * assigned to the 'firebase' global. It may be called multiple times\n * in unit tests.\n */\nexport function createFirebaseNamespace(): FirebaseNamespace {\n const namespace = createFirebaseNamespaceCore(FirebaseAppImpl);\n (namespace as _FirebaseNamespace).INTERNAL = {\n ...(namespace as _FirebaseNamespace).INTERNAL,\n createFirebaseNamespace: createFirebaseNamespace,\n extendNamespace: extendNamespace,\n createSubscribe: createSubscribe,\n ErrorFactory: ErrorFactory,\n deepExtend: deepExtend\n };\n\n /**\n * Patch the top-level firebase namespace with additional properties.\n *\n * firebase.INTERNAL.extendNamespace()\n */\n function extendNamespace(props: { [prop: string]: unknown }): void {\n deepExtend(namespace, props);\n }\n\n return namespace;\n}\n","/**\n * @license\n * Copyright 2017 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { FirebaseNamespace } from '@firebase/app-types';\nimport { createFirebaseNamespace } from './src/firebaseNamespace';\n\n// Node detection logic from: https://github.com/iliakan/detect-node/\nlet isNode = false;\ntry {\n isNode =\n Object.prototype.toString.call(global.process) === '[object process]';\n} catch (e) {}\n\nisNode &&\n console.warn(`\nWarning: This is a browser-targeted Firebase bundle but it appears it is being\nrun in a Node environment. If running in a Node environment, make sure you\nare using the bundle specified by the \"main\" field in package.json.\n\nIf you are using Webpack, you can specify \"main\" as the first item in\n\"resolve.mainFields\":\nhttps://webpack.js.org/configuration/resolve/#resolvemainfields\n\nIf using Rollup, use the rollup-plugin-node-resolve plugin and set \"module\"\nto false and \"main\" to true:\nhttps://github.com/rollup/rollup-plugin-node-resolve\n`);\n\n// Firebase Lite detection\nif (self && 'firebase' in self) {\n console.warn(`\n Warning: Firebase is already defined in the global scope. Please make sure\n Firebase library is only loaded once.\n `);\n\n const sdkVersion = ((self as any).firebase as FirebaseNamespace).SDK_VERSION;\n if (sdkVersion && sdkVersion.indexOf('LITE') >= 0) {\n console.warn(`\n Warning: You are trying to load Firebase while using Firebase Performance standalone script.\n You should load Firebase Performance with this instance of Firebase to avoid loading duplicate code.\n `);\n }\n}\n\nexport const firebase = createFirebaseNamespace();\n\nexport default firebase;\n"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;AAiBA,AAWA,IAAM,MAAM;IACV,4BACE,+CAA+C;QAC/C,mCAAmC;IACrC,wCAAyB,4BAA4B;IACrD,0CAA0B,6CAA6C;IACvE,sCAAwB,8CAA8C;IACtE,kDACE,qDAAqD;IACvD,wDACE,mDAAmD;QACnD,wBAAwB;OAC3B,CAAC;AAEF,IAAM,SAAS,GAAG,IAAI,YAAY,CAAW,KAAK,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC;AAExE,SAAgB,KAAK,CAAC,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,OAAO,SAAS,CAAC;CAClB;;ACnDD;;;;;;;;;;;;;;;;AAkBA,AAEA;AACA,IAAI,MAAM,GAAG,KAAK,CAAC;AACnB,IAAI;IACF,MAAM;QACJ,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,kBAAkB,CAAC;CACzE;AAAC,OAAO,CAAC,EAAE,GAAE;AAEd,MAAM;IACJ,OAAO,CAAC,IAAI,CAAC,ojBAYd,CAAC,CAAC;;AAGH,IAAI,IAAI,IAAI,UAAU,IAAI,IAAI,EAAE;IAC9B,OAAO,CAAC,IAAI,CAAC,iIAGZ,CAAC,CAAC;IAEH,IAAM,UAAU,GAAK,IAAY,CAAC,QAA8B,CAAC,WAAW,CAAC;IAC7E,IAAI,UAAU,IAAI,UAAU,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE;QACjD,OAAO,CAAC,IAAI,CAAC,oNAGZ,CAAC,CAAC;KACJ;CACF;AAED,IAAa,QAAQ,GAAG,uBAAuB,EAAE;;;;;"}
@@ -243,7 +243,7 @@ function createFirebaseNamespaceCore(firebaseAppImpl) {
243
243
  app: app,
244
244
  apps: null,
245
245
  Promise: Promise,
246
- SDK_VERSION: '5.11.0-canary.a7bb0b5',
246
+ SDK_VERSION: '5.11.0',
247
247
  INTERNAL: {
248
248
  registerService,
249
249
  removeApp,
@@ -1 +1 @@
1
- {"version":3,"file":"index.esm2017.js","sources":["../src/errors.ts","../src/constants.ts","../src/firebaseApp.ts","../src/firebaseNamespaceCore.ts","../src/firebaseNamespace.ts","../index.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ErrorFactory, ErrorMap } from '@firebase/util';\n\nexport const enum AppError {\n NO_APP = 'no-app',\n BAD_APP_NAME = 'bad-app-name',\n DUPLICATE_APP = 'duplicate-app',\n APP_DELETED = 'app-deleted',\n DUPLICATE_SERVICE = 'duplicate-service',\n INVALID_APP_ARGUMENT = 'invalid-app-argument'\n}\n\nconst ERRORS: ErrorMap<AppError> = {\n [AppError.NO_APP]:\n \"No Firebase App '{$name}' has been created - \" +\n 'call Firebase App.initializeApp()',\n [AppError.BAD_APP_NAME]: \"Illegal App name: '{$name}\",\n [AppError.DUPLICATE_APP]: \"Firebase App named '{$name}' already exists\",\n [AppError.APP_DELETED]: \"Firebase App named '{$name}' already deleted\",\n [AppError.DUPLICATE_SERVICE]:\n \"Firebase service named '{$name}' already registered\",\n [AppError.INVALID_APP_ARGUMENT]:\n 'firebase.{$name}() takes either no argument or a ' +\n 'Firebase App instance.'\n};\n\nconst appErrors = new ErrorFactory<AppError>('app', 'Firebase', ERRORS);\n\nexport function error(code: AppError, args?: { [name: string]: any }) {\n throw appErrors.create(code, args);\n}\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport const DEFAULT_ENTRY_NAME = '[DEFAULT]';\n","/**\n * @license\n * Copyright 2017 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n FirebaseApp,\n FirebaseOptions,\n FirebaseAppConfig\n} from '@firebase/app-types';\nimport {\n _FirebaseApp,\n _FirebaseNamespace,\n FirebaseService,\n FirebaseAppInternals\n} from '@firebase/app-types/private';\nimport { deepCopy, deepExtend } from '@firebase/util';\nimport { error, AppError } from './errors';\nimport { DEFAULT_ENTRY_NAME } from './constants';\n\ninterface ServicesCache {\n [name: string]: {\n [serviceName: string]: FirebaseService;\n };\n}\n\n// An array to capture listeners before the true auth functions\n// exist\nlet tokenListeners: any[] = [];\n\n/**\n * Global context object for a collection of services using\n * a shared authentication state.\n */\nexport class FirebaseAppImpl implements FirebaseApp {\n private readonly options_: FirebaseOptions;\n private readonly name_: string;\n private isDeleted_ = false;\n private services_: ServicesCache = {};\n private automaticDataCollectionEnabled_: boolean;\n\n INTERNAL: FirebaseAppInternals;\n\n constructor(\n options: FirebaseOptions,\n config: FirebaseAppConfig,\n private readonly firebase_: _FirebaseNamespace\n ) {\n this.name_ = config.name!;\n this.automaticDataCollectionEnabled_ =\n config.automaticDataCollectionEnabled || false;\n this.options_ = deepCopy<FirebaseOptions>(options);\n this.INTERNAL = {\n getUid: () => null,\n getToken: () => Promise.resolve(null),\n addAuthTokenListener: (callback: (token: string | null) => void) => {\n tokenListeners.push(callback);\n // Make sure callback is called, asynchronously, in the absence of the auth module\n setTimeout(() => callback(null), 0);\n },\n removeAuthTokenListener: callback => {\n tokenListeners = tokenListeners.filter(\n listener => listener !== callback\n );\n }\n };\n }\n\n get automaticDataCollectionEnabled(): boolean {\n this.checkDestroyed_();\n return this.automaticDataCollectionEnabled_;\n }\n\n set automaticDataCollectionEnabled(val) {\n this.checkDestroyed_();\n this.automaticDataCollectionEnabled_ = val;\n }\n\n get name(): string {\n this.checkDestroyed_();\n return this.name_;\n }\n\n get options(): FirebaseOptions {\n this.checkDestroyed_();\n return this.options_;\n }\n\n delete(): Promise<void> {\n return new Promise(resolve => {\n this.checkDestroyed_();\n resolve();\n })\n .then(() => {\n this.firebase_.INTERNAL.removeApp(this.name_);\n const services: FirebaseService[] = [];\n\n for (const serviceKey of Object.keys(this.services_)) {\n for (const instanceKey of Object.keys(this.services_[serviceKey])) {\n services.push(this.services_[serviceKey][instanceKey]);\n }\n }\n\n return Promise.all(\n services.map(service => {\n return service.INTERNAL.delete();\n })\n );\n })\n .then(\n (): void => {\n this.isDeleted_ = true;\n this.services_ = {};\n }\n );\n }\n\n /**\n * Return a service instance associated with this app (creating it\n * on demand), identified by the passed instanceIdentifier.\n *\n * NOTE: Currently storage is the only one that is leveraging this\n * functionality. They invoke it by calling:\n *\n * ```javascript\n * firebase.app().storage('STORAGE BUCKET ID')\n * ```\n *\n * The service name is passed to this already\n * @internal\n */\n _getService(\n name: string,\n instanceIdentifier: string = DEFAULT_ENTRY_NAME\n ): FirebaseService {\n this.checkDestroyed_();\n\n if (!this.services_[name]) {\n this.services_[name] = {};\n }\n\n if (!this.services_[name][instanceIdentifier]) {\n /**\n * If a custom instance has been defined (i.e. not '[DEFAULT]')\n * then we will pass that instance on, otherwise we pass `null`\n */\n const instanceSpecifier =\n instanceIdentifier !== DEFAULT_ENTRY_NAME\n ? instanceIdentifier\n : undefined;\n const service = this.firebase_.INTERNAL.factories[name](\n this,\n this.extendApp.bind(this),\n instanceSpecifier\n );\n this.services_[name][instanceIdentifier] = service;\n }\n\n return this.services_[name][instanceIdentifier];\n }\n\n /**\n * Callback function used to extend an App instance at the time\n * of service instance creation.\n */\n private extendApp(props: { [name: string]: any }): void {\n // Copy the object onto the FirebaseAppImpl prototype\n deepExtend(this, props);\n\n /**\n * If the app has overwritten the addAuthTokenListener stub, forward\n * the active token listeners on to the true fxn.\n *\n * TODO: This function is required due to our current module\n * structure. Once we are able to rely strictly upon a single module\n * implementation, this code should be refactored and Auth should\n * provide these stubs and the upgrade logic\n */\n if (props.INTERNAL && props.INTERNAL.addAuthTokenListener) {\n tokenListeners.forEach(listener => {\n this.INTERNAL.addAuthTokenListener(listener);\n });\n tokenListeners = [];\n }\n }\n\n /**\n * This function will throw an Error if the App has already been deleted -\n * use before performing API actions on the App.\n */\n private checkDestroyed_(): void {\n if (this.isDeleted_) {\n error(AppError.APP_DELETED, { name: this.name_ });\n }\n }\n}\n\n// Prevent dead-code elimination of these methods w/o invalid property\n// copying.\n(FirebaseAppImpl.prototype.name && FirebaseAppImpl.prototype.options) ||\n FirebaseAppImpl.prototype.delete ||\n console.log('dc');\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n FirebaseApp,\n FirebaseOptions,\n FirebaseNamespace,\n FirebaseAppConfig\n} from '@firebase/app-types';\nimport {\n _FirebaseApp,\n _FirebaseNamespace,\n FirebaseService,\n FirebaseServiceFactory,\n FirebaseServiceNamespace,\n AppHook\n} from '@firebase/app-types/private';\nimport { deepExtend, patchProperty } from '@firebase/util';\nimport { FirebaseAppImpl } from './firebaseApp';\nimport { error, AppError } from './errors';\nimport { FirebaseAppLiteImpl } from './lite/firebaseAppLite';\nimport { DEFAULT_ENTRY_NAME } from './constants';\n\nfunction contains(obj: object, key: string) {\n return Object.prototype.hasOwnProperty.call(obj, key);\n}\n\n/**\n * Because auth can't share code with other components, we attach the utility functions\n * in an internal namespace to share code.\n * This function return a firebase namespace object without\n * any utility functions, so it can be shared between the regular firebaseNamespace and\n * the lite version.\n */\nexport function createFirebaseNamespaceCore(\n firebaseAppImpl: typeof FirebaseAppImpl | typeof FirebaseAppLiteImpl\n): FirebaseNamespace {\n const apps: { [name: string]: FirebaseApp } = {};\n const factories: { [service: string]: FirebaseServiceFactory } = {};\n const appHooks: { [service: string]: AppHook } = {};\n\n // A namespace is a plain JavaScript Object.\n const namespace: FirebaseNamespace = {\n // Hack to prevent Babel from modifying the object returned\n // as the firebase namespace.\n // @ts-ignore\n __esModule: true,\n initializeApp: initializeApp,\n app: app as any,\n apps: null as any,\n Promise: Promise,\n SDK_VERSION: '${JSCORE_VERSION}',\n INTERNAL: {\n registerService,\n removeApp,\n factories,\n useAsService\n }\n };\n\n // Inject a circular default export to allow Babel users who were previously\n // using:\n //\n // import firebase from 'firebase';\n // which becomes: var firebase = require('firebase').default;\n //\n // instead of\n //\n // import * as firebase from 'firebase';\n // which becomes: var firebase = require('firebase');\n patchProperty(namespace, 'default', namespace);\n\n // firebase.apps is a read-only getter.\n Object.defineProperty(namespace, 'apps', {\n get: getApps\n });\n\n /**\n * Called by App.delete() - but before any services associated with the App\n * are deleted.\n */\n function removeApp(name: string): void {\n const app = apps[name];\n callAppHooks(app, 'delete');\n delete apps[name];\n }\n\n /**\n * Get the App object for a given name (or DEFAULT).\n */\n function app(name?: string): FirebaseApp {\n name = name || DEFAULT_ENTRY_NAME;\n if (!contains(apps, name)) {\n error(AppError.NO_APP, { name: name });\n }\n return apps[name];\n }\n\n patchProperty(app, 'App', firebaseAppImpl);\n /**\n * Create a new App instance (name must be unique).\n */\n function initializeApp(\n options: FirebaseOptions,\n config?: FirebaseAppConfig\n ): FirebaseApp;\n function initializeApp(options: FirebaseOptions, name?: string): FirebaseApp;\n function initializeApp(options: FirebaseOptions, rawConfig = {}) {\n if (typeof rawConfig !== 'object' || rawConfig === null) {\n const name = rawConfig;\n rawConfig = { name };\n }\n\n const config = rawConfig as FirebaseAppConfig;\n\n if (config.name === undefined) {\n config.name = DEFAULT_ENTRY_NAME;\n }\n\n const { name } = config;\n\n if (typeof name !== 'string' || !name) {\n error(AppError.BAD_APP_NAME, { name: String(name) });\n }\n\n if (contains(apps, name)) {\n error(AppError.DUPLICATE_APP, { name: name });\n }\n\n const app = new firebaseAppImpl(\n options,\n config,\n namespace as _FirebaseNamespace\n );\n\n apps[name] = app;\n callAppHooks(app, 'create');\n\n return app;\n }\n\n /*\n * Return an array of all the non-deleted FirebaseApps.\n */\n function getApps(): FirebaseApp[] {\n // Make a copy so caller cannot mutate the apps list.\n return Object.keys(apps).map(name => apps[name]);\n }\n\n /*\n * Register a Firebase Service.\n *\n * firebase.INTERNAL.registerService()\n *\n * TODO: Implement serviceProperties.\n */\n function registerService(\n name: string,\n createService: FirebaseServiceFactory,\n serviceProperties?: { [prop: string]: unknown },\n appHook?: AppHook,\n allowMultipleInstances = false\n ): FirebaseServiceNamespace<FirebaseService> {\n // Cannot re-register a service that already exists\n if (factories[name]) {\n error(AppError.DUPLICATE_SERVICE, { name: name });\n }\n\n // Capture the service factory for later service instantiation\n factories[name] = createService;\n\n // Capture the appHook, if passed\n if (appHook) {\n appHooks[name] = appHook;\n\n // Run the **new** app hook on all existing apps\n getApps().forEach(app => {\n appHook('create', app);\n });\n }\n\n // The Service namespace is an accessor function ...\n function serviceNamespace(appArg: FirebaseApp = app()) {\n if (typeof appArg[name] !== 'function') {\n // Invalid argument.\n // This happens in the following case: firebase.storage('gs:/')\n error(AppError.INVALID_APP_ARGUMENT, { name: name });\n }\n\n // Forward service instance lookup to the FirebaseApp.\n return appArg[name]();\n }\n\n // ... and a container for service-level properties.\n if (serviceProperties !== undefined) {\n deepExtend(serviceNamespace, serviceProperties);\n }\n\n // Monkey-patch the serviceNamespace onto the firebase namespace\n namespace[name] = serviceNamespace;\n\n // Patch the FirebaseAppImpl prototype\n firebaseAppImpl.prototype[name] = function(...args) {\n const serviceFxn = this._getService.bind(this, name);\n return serviceFxn.apply(this, allowMultipleInstances ? args : []);\n };\n\n return serviceNamespace;\n }\n\n function callAppHooks(app: FirebaseApp, eventName: string) {\n for (const serviceName of Object.keys(factories)) {\n // Ignore virtual services\n const factoryName = useAsService(app, serviceName);\n if (factoryName === null) {\n return;\n }\n\n if (appHooks[factoryName]) {\n appHooks[factoryName](eventName, app);\n }\n }\n }\n\n // Map the requested service to a registered service name\n // (used to map auth to serverAuth service when needed).\n function useAsService(app: FirebaseApp, name: string): string | null {\n if (name === 'serverAuth') {\n return null;\n }\n\n const useService = name;\n const options = app.options;\n\n return useService;\n }\n\n return namespace;\n}\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { FirebaseNamespace } from '@firebase/app-types';\nimport { _FirebaseApp, _FirebaseNamespace } from '@firebase/app-types/private';\nimport { createSubscribe, deepExtend, ErrorFactory } from '@firebase/util';\nimport { FirebaseAppImpl } from './firebaseApp';\nimport { createFirebaseNamespaceCore } from './firebaseNamespaceCore';\n\n/**\n * Return a firebase namespace object.\n *\n * In production, this will be called exactly once and the result\n * assigned to the 'firebase' global. It may be called multiple times\n * in unit tests.\n */\nexport function createFirebaseNamespace(): FirebaseNamespace {\n const namespace = createFirebaseNamespaceCore(FirebaseAppImpl);\n (namespace as _FirebaseNamespace).INTERNAL = {\n ...(namespace as _FirebaseNamespace).INTERNAL,\n createFirebaseNamespace: createFirebaseNamespace,\n extendNamespace: extendNamespace,\n createSubscribe: createSubscribe,\n ErrorFactory: ErrorFactory,\n deepExtend: deepExtend\n };\n\n /**\n * Patch the top-level firebase namespace with additional properties.\n *\n * firebase.INTERNAL.extendNamespace()\n */\n function extendNamespace(props: { [prop: string]: unknown }): void {\n deepExtend(namespace, props);\n }\n\n return namespace;\n}\n","/**\n * @license\n * Copyright 2017 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { FirebaseNamespace } from '@firebase/app-types';\nimport { createFirebaseNamespace } from './src/firebaseNamespace';\n\n// Node detection logic from: https://github.com/iliakan/detect-node/\nlet isNode = false;\ntry {\n isNode =\n Object.prototype.toString.call(global.process) === '[object process]';\n} catch (e) {}\n\nisNode &&\n console.warn(`\nWarning: This is a browser-targeted Firebase bundle but it appears it is being\nrun in a Node environment. If running in a Node environment, make sure you\nare using the bundle specified by the \"main\" field in package.json.\n\nIf you are using Webpack, you can specify \"main\" as the first item in\n\"resolve.mainFields\":\nhttps://webpack.js.org/configuration/resolve/#resolvemainfields\n\nIf using Rollup, use the rollup-plugin-node-resolve plugin and set \"module\"\nto false and \"main\" to true:\nhttps://github.com/rollup/rollup-plugin-node-resolve\n`);\n\n// Firebase Lite detection\nif (self && 'firebase' in self) {\n console.warn(`\n Warning: Firebase is already defined in the global scope. Please make sure\n Firebase library is only loaded once.\n `);\n\n const sdkVersion = ((self as any).firebase as FirebaseNamespace).SDK_VERSION;\n if (sdkVersion && sdkVersion.indexOf('LITE') >= 0) {\n console.warn(`\n Warning: You are trying to load Firebase while using Firebase Performance standalone script.\n You should load Firebase Performance with this instance of Firebase to avoid loading duplicate code.\n `);\n }\n}\n\nexport const firebase = createFirebaseNamespace();\n\nexport default firebase;\n"],"names":[],"mappings":";;AAAA;;;;;;;;;;;;;;;;AAiBA,AAWA,MAAM,MAAM,GAAuB;IACjC,yBACE,+CAA+C;QAC/C,mCAAmC;IACrC,qCAAyB,4BAA4B;IACrD,uCAA0B,6CAA6C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CAYd,CAAC,CAAC;;AAGH,IAAI,IAAI,IAAI,UAAU,IAAI,IAAI,EAAE;IAC9B,OAAO,CAAC,IAAI,CAAC;;;GAGZ,CAAC,CAAC;IAEH,MAAM,UAAU,GAAK,IAAY,CAAC,QAA8B,CAAC,WAAW,CAAC;IAC7E,IAAI,UAAU,IAAI,UAAU,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE;QACjD,OAAO,CAAC,IAAI,CAAC;;;KAGZ,CAAC,CAAC;KACJ;CACF;AAED,MAAa,QAAQ,GAAG,uBAAuB,EAAE;;;;;"}
1
+ {"version":3,"file":"index.esm2017.js","sources":["../src/errors.ts","../src/constants.ts","../src/firebaseApp.ts","../src/firebaseNamespaceCore.ts","../src/firebaseNamespace.ts","../index.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ErrorFactory, ErrorMap } from '@firebase/util';\n\nexport const enum AppError {\n NO_APP = 'no-app',\n BAD_APP_NAME = 'bad-app-name',\n DUPLICATE_APP = 'duplicate-app',\n APP_DELETED = 'app-deleted',\n DUPLICATE_SERVICE = 'duplicate-service',\n INVALID_APP_ARGUMENT = 'invalid-app-argument'\n}\n\nconst ERRORS: ErrorMap<AppError> = {\n [AppError.NO_APP]:\n \"No Firebase App '{$name}' has been created - \" +\n 'call Firebase App.initializeApp()',\n [AppError.BAD_APP_NAME]: \"Illegal App name: '{$name}\",\n [AppError.DUPLICATE_APP]: \"Firebase App named '{$name}' already exists\",\n [AppError.APP_DELETED]: \"Firebase App named '{$name}' already deleted\",\n [AppError.DUPLICATE_SERVICE]:\n \"Firebase service named '{$name}' already registered\",\n [AppError.INVALID_APP_ARGUMENT]:\n 'firebase.{$name}() takes either no argument or a ' +\n 'Firebase App instance.'\n};\n\nconst appErrors = new ErrorFactory<AppError>('app', 'Firebase', ERRORS);\n\nexport function error(code: AppError, args?: { [name: string]: any }) {\n throw appErrors.create(code, args);\n}\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport const DEFAULT_ENTRY_NAME = '[DEFAULT]';\n","/**\n * @license\n * Copyright 2017 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n FirebaseApp,\n FirebaseOptions,\n FirebaseAppConfig\n} from '@firebase/app-types';\nimport {\n _FirebaseApp,\n _FirebaseNamespace,\n FirebaseService,\n FirebaseAppInternals\n} from '@firebase/app-types/private';\nimport { deepCopy, deepExtend } from '@firebase/util';\nimport { error, AppError } from './errors';\nimport { DEFAULT_ENTRY_NAME } from './constants';\n\ninterface ServicesCache {\n [name: string]: {\n [serviceName: string]: FirebaseService;\n };\n}\n\n// An array to capture listeners before the true auth functions\n// exist\nlet tokenListeners: any[] = [];\n\n/**\n * Global context object for a collection of services using\n * a shared authentication state.\n */\nexport class FirebaseAppImpl implements FirebaseApp {\n private readonly options_: FirebaseOptions;\n private readonly name_: string;\n private isDeleted_ = false;\n private services_: ServicesCache = {};\n private automaticDataCollectionEnabled_: boolean;\n\n INTERNAL: FirebaseAppInternals;\n\n constructor(\n options: FirebaseOptions,\n config: FirebaseAppConfig,\n private readonly firebase_: _FirebaseNamespace\n ) {\n this.name_ = config.name!;\n this.automaticDataCollectionEnabled_ =\n config.automaticDataCollectionEnabled || false;\n this.options_ = deepCopy<FirebaseOptions>(options);\n this.INTERNAL = {\n getUid: () => null,\n getToken: () => Promise.resolve(null),\n addAuthTokenListener: (callback: (token: string | null) => void) => {\n tokenListeners.push(callback);\n // Make sure callback is called, asynchronously, in the absence of the auth module\n setTimeout(() => callback(null), 0);\n },\n removeAuthTokenListener: callback => {\n tokenListeners = tokenListeners.filter(\n listener => listener !== callback\n );\n }\n };\n }\n\n get automaticDataCollectionEnabled(): boolean {\n this.checkDestroyed_();\n return this.automaticDataCollectionEnabled_;\n }\n\n set automaticDataCollectionEnabled(val) {\n this.checkDestroyed_();\n this.automaticDataCollectionEnabled_ = val;\n }\n\n get name(): string {\n this.checkDestroyed_();\n return this.name_;\n }\n\n get options(): FirebaseOptions {\n this.checkDestroyed_();\n return this.options_;\n }\n\n delete(): Promise<void> {\n return new Promise(resolve => {\n this.checkDestroyed_();\n resolve();\n })\n .then(() => {\n this.firebase_.INTERNAL.removeApp(this.name_);\n const services: FirebaseService[] = [];\n\n for (const serviceKey of Object.keys(this.services_)) {\n for (const instanceKey of Object.keys(this.services_[serviceKey])) {\n services.push(this.services_[serviceKey][instanceKey]);\n }\n }\n\n return Promise.all(\n services.map(service => {\n return service.INTERNAL.delete();\n })\n );\n })\n .then(\n (): void => {\n this.isDeleted_ = true;\n this.services_ = {};\n }\n );\n }\n\n /**\n * Return a service instance associated with this app (creating it\n * on demand), identified by the passed instanceIdentifier.\n *\n * NOTE: Currently storage is the only one that is leveraging this\n * functionality. They invoke it by calling:\n *\n * ```javascript\n * firebase.app().storage('STORAGE BUCKET ID')\n * ```\n *\n * The service name is passed to this already\n * @internal\n */\n _getService(\n name: string,\n instanceIdentifier: string = DEFAULT_ENTRY_NAME\n ): FirebaseService {\n this.checkDestroyed_();\n\n if (!this.services_[name]) {\n this.services_[name] = {};\n }\n\n if (!this.services_[name][instanceIdentifier]) {\n /**\n * If a custom instance has been defined (i.e. not '[DEFAULT]')\n * then we will pass that instance on, otherwise we pass `null`\n */\n const instanceSpecifier =\n instanceIdentifier !== DEFAULT_ENTRY_NAME\n ? instanceIdentifier\n : undefined;\n const service = this.firebase_.INTERNAL.factories[name](\n this,\n this.extendApp.bind(this),\n instanceSpecifier\n );\n this.services_[name][instanceIdentifier] = service;\n }\n\n return this.services_[name][instanceIdentifier];\n }\n\n /**\n * Callback function used to extend an App instance at the time\n * of service instance creation.\n */\n private extendApp(props: { [name: string]: any }): void {\n // Copy the object onto the FirebaseAppImpl prototype\n deepExtend(this, props);\n\n /**\n * If the app has overwritten the addAuthTokenListener stub, forward\n * the active token listeners on to the true fxn.\n *\n * TODO: This function is required due to our current module\n * structure. Once we are able to rely strictly upon a single module\n * implementation, this code should be refactored and Auth should\n * provide these stubs and the upgrade logic\n */\n if (props.INTERNAL && props.INTERNAL.addAuthTokenListener) {\n tokenListeners.forEach(listener => {\n this.INTERNAL.addAuthTokenListener(listener);\n });\n tokenListeners = [];\n }\n }\n\n /**\n * This function will throw an Error if the App has already been deleted -\n * use before performing API actions on the App.\n */\n private checkDestroyed_(): void {\n if (this.isDeleted_) {\n error(AppError.APP_DELETED, { name: this.name_ });\n }\n }\n}\n\n// Prevent dead-code elimination of these methods w/o invalid property\n// copying.\n(FirebaseAppImpl.prototype.name && FirebaseAppImpl.prototype.options) ||\n FirebaseAppImpl.prototype.delete ||\n console.log('dc');\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n FirebaseApp,\n FirebaseOptions,\n FirebaseNamespace,\n FirebaseAppConfig\n} from '@firebase/app-types';\nimport {\n _FirebaseApp,\n _FirebaseNamespace,\n FirebaseService,\n FirebaseServiceFactory,\n FirebaseServiceNamespace,\n AppHook\n} from '@firebase/app-types/private';\nimport { deepExtend, patchProperty } from '@firebase/util';\nimport { FirebaseAppImpl } from './firebaseApp';\nimport { error, AppError } from './errors';\nimport { FirebaseAppLiteImpl } from './lite/firebaseAppLite';\nimport { DEFAULT_ENTRY_NAME } from './constants';\n\nfunction contains(obj: object, key: string) {\n return Object.prototype.hasOwnProperty.call(obj, key);\n}\n\n/**\n * Because auth can't share code with other components, we attach the utility functions\n * in an internal namespace to share code.\n * This function return a firebase namespace object without\n * any utility functions, so it can be shared between the regular firebaseNamespace and\n * the lite version.\n */\nexport function createFirebaseNamespaceCore(\n firebaseAppImpl: typeof FirebaseAppImpl | typeof FirebaseAppLiteImpl\n): FirebaseNamespace {\n const apps: { [name: string]: FirebaseApp } = {};\n const factories: { [service: string]: FirebaseServiceFactory } = {};\n const appHooks: { [service: string]: AppHook } = {};\n\n // A namespace is a plain JavaScript Object.\n const namespace: FirebaseNamespace = {\n // Hack to prevent Babel from modifying the object returned\n // as the firebase namespace.\n // @ts-ignore\n __esModule: true,\n initializeApp: initializeApp,\n app: app as any,\n apps: null as any,\n Promise: Promise,\n SDK_VERSION: '${JSCORE_VERSION}',\n INTERNAL: {\n registerService,\n removeApp,\n factories,\n useAsService\n }\n };\n\n // Inject a circular default export to allow Babel users who were previously\n // using:\n //\n // import firebase from 'firebase';\n // which becomes: var firebase = require('firebase').default;\n //\n // instead of\n //\n // import * as firebase from 'firebase';\n // which becomes: var firebase = require('firebase');\n patchProperty(namespace, 'default', namespace);\n\n // firebase.apps is a read-only getter.\n Object.defineProperty(namespace, 'apps', {\n get: getApps\n });\n\n /**\n * Called by App.delete() - but before any services associated with the App\n * are deleted.\n */\n function removeApp(name: string): void {\n const app = apps[name];\n callAppHooks(app, 'delete');\n delete apps[name];\n }\n\n /**\n * Get the App object for a given name (or DEFAULT).\n */\n function app(name?: string): FirebaseApp {\n name = name || DEFAULT_ENTRY_NAME;\n if (!contains(apps, name)) {\n error(AppError.NO_APP, { name: name });\n }\n return apps[name];\n }\n\n patchProperty(app, 'App', firebaseAppImpl);\n /**\n * Create a new App instance (name must be unique).\n */\n function initializeApp(\n options: FirebaseOptions,\n config?: FirebaseAppConfig\n ): FirebaseApp;\n function initializeApp(options: FirebaseOptions, name?: string): FirebaseApp;\n function initializeApp(options: FirebaseOptions, rawConfig = {}) {\n if (typeof rawConfig !== 'object' || rawConfig === null) {\n const name = rawConfig;\n rawConfig = { name };\n }\n\n const config = rawConfig as FirebaseAppConfig;\n\n if (config.name === undefined) {\n config.name = DEFAULT_ENTRY_NAME;\n }\n\n const { name } = config;\n\n if (typeof name !== 'string' || !name) {\n error(AppError.BAD_APP_NAME, { name: String(name) });\n }\n\n if (contains(apps, name)) {\n error(AppError.DUPLICATE_APP, { name: name });\n }\n\n const app = new firebaseAppImpl(\n options,\n config,\n namespace as _FirebaseNamespace\n );\n\n apps[name] = app;\n callAppHooks(app, 'create');\n\n return app;\n }\n\n /*\n * Return an array of all the non-deleted FirebaseApps.\n */\n function getApps(): FirebaseApp[] {\n // Make a copy so caller cannot mutate the apps list.\n return Object.keys(apps).map(name => apps[name]);\n }\n\n /*\n * Register a Firebase Service.\n *\n * firebase.INTERNAL.registerService()\n *\n * TODO: Implement serviceProperties.\n */\n function registerService(\n name: string,\n createService: FirebaseServiceFactory,\n serviceProperties?: { [prop: string]: unknown },\n appHook?: AppHook,\n allowMultipleInstances = false\n ): FirebaseServiceNamespace<FirebaseService> {\n // Cannot re-register a service that already exists\n if (factories[name]) {\n error(AppError.DUPLICATE_SERVICE, { name: name });\n }\n\n // Capture the service factory for later service instantiation\n factories[name] = createService;\n\n // Capture the appHook, if passed\n if (appHook) {\n appHooks[name] = appHook;\n\n // Run the **new** app hook on all existing apps\n getApps().forEach(app => {\n appHook('create', app);\n });\n }\n\n // The Service namespace is an accessor function ...\n function serviceNamespace(appArg: FirebaseApp = app()) {\n if (typeof appArg[name] !== 'function') {\n // Invalid argument.\n // This happens in the following case: firebase.storage('gs:/')\n error(AppError.INVALID_APP_ARGUMENT, { name: name });\n }\n\n // Forward service instance lookup to the FirebaseApp.\n return appArg[name]();\n }\n\n // ... and a container for service-level properties.\n if (serviceProperties !== undefined) {\n deepExtend(serviceNamespace, serviceProperties);\n }\n\n // Monkey-patch the serviceNamespace onto the firebase namespace\n namespace[name] = serviceNamespace;\n\n // Patch the FirebaseAppImpl prototype\n firebaseAppImpl.prototype[name] = function(...args) {\n const serviceFxn = this._getService.bind(this, name);\n return serviceFxn.apply(this, allowMultipleInstances ? args : []);\n };\n\n return serviceNamespace;\n }\n\n function callAppHooks(app: FirebaseApp, eventName: string) {\n for (const serviceName of Object.keys(factories)) {\n // Ignore virtual services\n const factoryName = useAsService(app, serviceName);\n if (factoryName === null) {\n return;\n }\n\n if (appHooks[factoryName]) {\n appHooks[factoryName](eventName, app);\n }\n }\n }\n\n // Map the requested service to a registered service name\n // (used to map auth to serverAuth service when needed).\n function useAsService(app: FirebaseApp, name: string): string | null {\n if (name === 'serverAuth') {\n return null;\n }\n\n const useService = name;\n const options = app.options;\n\n return useService;\n }\n\n return namespace;\n}\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { FirebaseNamespace } from '@firebase/app-types';\nimport { _FirebaseApp, _FirebaseNamespace } from '@firebase/app-types/private';\nimport { createSubscribe, deepExtend, ErrorFactory } from '@firebase/util';\nimport { FirebaseAppImpl } from './firebaseApp';\nimport { createFirebaseNamespaceCore } from './firebaseNamespaceCore';\n\n/**\n * Return a firebase namespace object.\n *\n * In production, this will be called exactly once and the result\n * assigned to the 'firebase' global. It may be called multiple times\n * in unit tests.\n */\nexport function createFirebaseNamespace(): FirebaseNamespace {\n const namespace = createFirebaseNamespaceCore(FirebaseAppImpl);\n (namespace as _FirebaseNamespace).INTERNAL = {\n ...(namespace as _FirebaseNamespace).INTERNAL,\n createFirebaseNamespace: createFirebaseNamespace,\n extendNamespace: extendNamespace,\n createSubscribe: createSubscribe,\n ErrorFactory: ErrorFactory,\n deepExtend: deepExtend\n };\n\n /**\n * Patch the top-level firebase namespace with additional properties.\n *\n * firebase.INTERNAL.extendNamespace()\n */\n function extendNamespace(props: { [prop: string]: unknown }): void {\n deepExtend(namespace, props);\n }\n\n return namespace;\n}\n","/**\n * @license\n * Copyright 2017 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { FirebaseNamespace } from '@firebase/app-types';\nimport { createFirebaseNamespace } from './src/firebaseNamespace';\n\n// Node detection logic from: https://github.com/iliakan/detect-node/\nlet isNode = false;\ntry {\n isNode =\n Object.prototype.toString.call(global.process) === '[object process]';\n} catch (e) {}\n\nisNode &&\n console.warn(`\nWarning: This is a browser-targeted Firebase bundle but it appears it is being\nrun in a Node environment. If running in a Node environment, make sure you\nare using the bundle specified by the \"main\" field in package.json.\n\nIf you are using Webpack, you can specify \"main\" as the first item in\n\"resolve.mainFields\":\nhttps://webpack.js.org/configuration/resolve/#resolvemainfields\n\nIf using Rollup, use the rollup-plugin-node-resolve plugin and set \"module\"\nto false and \"main\" to true:\nhttps://github.com/rollup/rollup-plugin-node-resolve\n`);\n\n// Firebase Lite detection\nif (self && 'firebase' in self) {\n console.warn(`\n Warning: Firebase is already defined in the global scope. Please make sure\n Firebase library is only loaded once.\n `);\n\n const sdkVersion = ((self as any).firebase as FirebaseNamespace).SDK_VERSION;\n if (sdkVersion && sdkVersion.indexOf('LITE') >= 0) {\n console.warn(`\n Warning: You are trying to load Firebase while using Firebase Performance standalone script.\n You should load Firebase Performance with this instance of Firebase to avoid loading duplicate code.\n `);\n }\n}\n\nexport const firebase = createFirebaseNamespace();\n\nexport default firebase;\n"],"names":[],"mappings":";;AAAA;;;;;;;;;;;;;;;;AAiBA,AAWA,MAAM,MAAM,GAAuB;IACjC,yBACE,+CAA+C;QAC/C,mCAAmC;IACrC,qCAAyB,4BAA4B;IACrD,uCAA0B,6CAA6C;IACvE,mCAAwB,8CAA8C;IACtE,+CACE,qDAAqD;IACvD,qDACE,mDAAmD;QACnD,wBAAwB;CAC3B,CAAC;AAEF,MAAM,SAAS,GAAG,IAAI,YAAY,CAAW,KAAK,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC;AAExE,SAAgB,KAAK,CAAC,IAAc,EAAE,IAA8B;IAClE,MAAM,SAAS,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;CACpC;;AC9CD;;;;;;;;;;;;;;;;AAiBA,AAAO,MAAM,kBAAkB,GAAG,WAAW,CAAC;;ACjB9C;;;;;;;;;;;;;;;;AA4BA,AAUA;;AAEA,IAAI,cAAc,GAAU,EAAE,CAAC;;;;;AAM/B,MAAa,eAAe;IAS1B,YACE,OAAwB,EACxB,MAAyB,EACR,SAA6B;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SION: '5.11.0',
214
214
  INTERNAL: {
215
215
  registerService,
216
216
  removeApp,
@@ -369,7 +369,7 @@ function createFirebaseNamespaceCore(firebaseAppImpl) {
369
369
  */
370
370
  function createFirebaseNamespaceLite() {
371
371
  const namespace = createFirebaseNamespaceCore(FirebaseAppLiteImpl);
372
- namespace.SDK_VERSION = '5.11.0-canary.a7bb0b5_LITE';
372
+ namespace.SDK_VERSION = '5.11.0_LITE';
373
373
  const registerService = namespace.INTERNAL
374
374
  .registerService;
375
375
  namespace.INTERNAL.registerService = registerServiceForLite;
@@ -1 +1 @@
1
- {"version":3,"file":"index.lite.esm2017.js","sources":["../src/errors.ts","../src/constants.ts","../src/lite/firebaseAppLite.ts","../src/firebaseNamespaceCore.ts","../src/lite/firebaseNamespaceLite.ts","../index.lite.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ErrorFactory, ErrorMap } from '@firebase/util';\n\nexport const enum AppError {\n NO_APP = 'no-app',\n BAD_APP_NAME = 'bad-app-name',\n DUPLICATE_APP = 'duplicate-app',\n APP_DELETED = 'app-deleted',\n DUPLICATE_SERVICE = 'duplicate-service',\n INVALID_APP_ARGUMENT = 'invalid-app-argument'\n}\n\nconst ERRORS: ErrorMap<AppError> = {\n [AppError.NO_APP]:\n \"No Firebase App '{$name}' has been created - \" +\n 'call Firebase App.initializeApp()',\n [AppError.BAD_APP_NAME]: \"Illegal App name: '{$name}\",\n [AppError.DUPLICATE_APP]: \"Firebase App named '{$name}' already exists\",\n [AppError.APP_DELETED]: \"Firebase App named '{$name}' already deleted\",\n [AppError.DUPLICATE_SERVICE]:\n \"Firebase service named '{$name}' already registered\",\n [AppError.INVALID_APP_ARGUMENT]:\n 'firebase.{$name}() takes either no argument or a ' +\n 'Firebase App instance.'\n};\n\nconst appErrors = new ErrorFactory<AppError>('app', 'Firebase', ERRORS);\n\nexport function error(code: AppError, args?: { [name: string]: any }) {\n throw appErrors.create(code, args);\n}\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport const DEFAULT_ENTRY_NAME = '[DEFAULT]';\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n FirebaseApp,\n FirebaseOptions,\n FirebaseAppConfig\n} from '@firebase/app-types';\nimport {\n _FirebaseApp,\n _FirebaseNamespace,\n FirebaseService\n} from '@firebase/app-types/private';\nimport { deepCopy, deepExtend } from '@firebase/util';\nimport { error, AppError } from '../errors';\nimport { DEFAULT_ENTRY_NAME } from '../constants';\n\ninterface ServicesCache {\n [name: string]: {\n [serviceName: string]: FirebaseService;\n };\n}\n\n/**\n * Global context object for a collection of services using\n * a shared authentication state.\n */\nexport class FirebaseAppLiteImpl implements FirebaseApp {\n private readonly options_: FirebaseOptions;\n private readonly name_: string;\n private isDeleted_ = false;\n private services_: ServicesCache = {};\n private automaticDataCollectionEnabled_: boolean;\n\n // lite version has an empty INTERNAL namespace\n readonly INTERNAL = {};\n\n constructor(\n options: FirebaseOptions,\n config: FirebaseAppConfig,\n private readonly firebase_: _FirebaseNamespace\n ) {\n this.name_ = config.name!;\n this.automaticDataCollectionEnabled_ =\n config.automaticDataCollectionEnabled || false;\n this.options_ = deepCopy<FirebaseOptions>(options);\n }\n\n get automaticDataCollectionEnabled(): boolean {\n this.checkDestroyed_();\n return this.automaticDataCollectionEnabled_;\n }\n\n set automaticDataCollectionEnabled(val) {\n this.checkDestroyed_();\n this.automaticDataCollectionEnabled_ = val;\n }\n\n get name(): string {\n this.checkDestroyed_();\n return this.name_;\n }\n\n get options(): FirebaseOptions {\n this.checkDestroyed_();\n return this.options_;\n }\n\n delete(): Promise<void> {\n return new Promise(resolve => {\n this.checkDestroyed_();\n resolve();\n })\n .then(() => {\n this.firebase_.INTERNAL.removeApp(this.name_);\n const services: FirebaseService[] = [];\n\n for (const serviceKey of Object.keys(this.services_)) {\n for (const instanceKey of Object.keys(this.services_[serviceKey])) {\n services.push(this.services_[serviceKey][instanceKey]);\n }\n }\n\n return Promise.all(\n services.map(service => {\n return service.INTERNAL.delete();\n })\n );\n })\n .then(\n (): void => {\n this.isDeleted_ = true;\n this.services_ = {};\n }\n );\n }\n\n /**\n * Return a service instance associated with this app (creating it\n * on demand), identified by the passed instanceIdentifier.\n *\n * NOTE: Currently storage is the only one that is leveraging this\n * functionality. They invoke it by calling:\n *\n * ```javascript\n * firebase.app().storage('STORAGE BUCKET ID')\n * ```\n *\n * The service name is passed to this already\n * @internal\n */\n _getService(\n name: string,\n instanceIdentifier: string = DEFAULT_ENTRY_NAME\n ): FirebaseService {\n this.checkDestroyed_();\n\n if (!this.services_[name]) {\n this.services_[name] = {};\n }\n\n if (!this.services_[name][instanceIdentifier]) {\n /**\n * If a custom instance has been defined (i.e. not '[DEFAULT]')\n * then we will pass that instance on, otherwise we pass `null`\n */\n const instanceSpecifier =\n instanceIdentifier !== DEFAULT_ENTRY_NAME\n ? instanceIdentifier\n : undefined;\n const service = this.firebase_.INTERNAL.factories[name](\n this,\n this.extendApp.bind(this),\n instanceSpecifier\n );\n this.services_[name][instanceIdentifier] = service;\n }\n\n return this.services_[name][instanceIdentifier];\n }\n\n /**\n * Callback function used to extend an App instance at the time\n * of service instance creation.\n */\n private extendApp(props: { [name: string]: any }): void {\n // Copy the object onto the FirebaseAppImpl prototype\n deepExtend(this, props);\n }\n\n /**\n * This function will throw an Error if the App has already been deleted -\n * use before performing API actions on the App.\n */\n private checkDestroyed_(): void {\n if (this.isDeleted_) {\n error(AppError.APP_DELETED, { name: this.name_ });\n }\n }\n}\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n FirebaseApp,\n FirebaseOptions,\n FirebaseNamespace,\n FirebaseAppConfig\n} from '@firebase/app-types';\nimport {\n _FirebaseApp,\n _FirebaseNamespace,\n FirebaseService,\n FirebaseServiceFactory,\n FirebaseServiceNamespace,\n AppHook\n} from '@firebase/app-types/private';\nimport { deepExtend, patchProperty } from '@firebase/util';\nimport { FirebaseAppImpl } from './firebaseApp';\nimport { error, AppError } from './errors';\nimport { FirebaseAppLiteImpl } from './lite/firebaseAppLite';\nimport { DEFAULT_ENTRY_NAME } from './constants';\n\nfunction contains(obj: object, key: string) {\n return Object.prototype.hasOwnProperty.call(obj, key);\n}\n\n/**\n * Because auth can't share code with other components, we attach the utility functions\n * in an internal namespace to share code.\n * This function return a firebase namespace object without\n * any utility functions, so it can be shared between the regular firebaseNamespace and\n * the lite version.\n */\nexport function createFirebaseNamespaceCore(\n firebaseAppImpl: typeof FirebaseAppImpl | typeof FirebaseAppLiteImpl\n): FirebaseNamespace {\n const apps: { [name: string]: FirebaseApp } = {};\n const factories: { [service: string]: FirebaseServiceFactory } = {};\n const appHooks: { [service: string]: AppHook } = {};\n\n // A namespace is a plain JavaScript Object.\n const namespace: FirebaseNamespace = {\n // Hack to prevent Babel from modifying the object returned\n // as the firebase namespace.\n // @ts-ignore\n __esModule: true,\n initializeApp: initializeApp,\n app: app as any,\n apps: null as any,\n Promise: Promise,\n SDK_VERSION: '${JSCORE_VERSION}',\n INTERNAL: {\n registerService,\n removeApp,\n factories,\n useAsService\n }\n };\n\n // Inject a circular default export to allow Babel users who were previously\n // using:\n //\n // import firebase from 'firebase';\n // which becomes: var firebase = require('firebase').default;\n //\n // instead of\n //\n // import * as firebase from 'firebase';\n // which becomes: var firebase = require('firebase');\n patchProperty(namespace, 'default', namespace);\n\n // firebase.apps is a read-only getter.\n Object.defineProperty(namespace, 'apps', {\n get: getApps\n });\n\n /**\n * Called by App.delete() - but before any services associated with the App\n * are deleted.\n */\n function removeApp(name: string): void {\n const app = apps[name];\n callAppHooks(app, 'delete');\n delete apps[name];\n }\n\n /**\n * Get the App object for a given name (or DEFAULT).\n */\n function app(name?: string): FirebaseApp {\n name = name || DEFAULT_ENTRY_NAME;\n if (!contains(apps, name)) {\n error(AppError.NO_APP, { name: name });\n }\n return apps[name];\n }\n\n patchProperty(app, 'App', firebaseAppImpl);\n /**\n * Create a new App instance (name must be unique).\n */\n function initializeApp(\n options: FirebaseOptions,\n config?: FirebaseAppConfig\n ): FirebaseApp;\n function initializeApp(options: FirebaseOptions, name?: string): FirebaseApp;\n function initializeApp(options: FirebaseOptions, rawConfig = {}) {\n if (typeof rawConfig !== 'object' || rawConfig === null) {\n const name = rawConfig;\n rawConfig = { name };\n }\n\n const config = rawConfig as FirebaseAppConfig;\n\n if (config.name === undefined) {\n config.name = DEFAULT_ENTRY_NAME;\n }\n\n const { name } = config;\n\n if (typeof name !== 'string' || !name) {\n error(AppError.BAD_APP_NAME, { name: String(name) });\n }\n\n if (contains(apps, name)) {\n error(AppError.DUPLICATE_APP, { name: name });\n }\n\n const app = new firebaseAppImpl(\n options,\n config,\n namespace as _FirebaseNamespace\n );\n\n apps[name] = app;\n callAppHooks(app, 'create');\n\n return app;\n }\n\n /*\n * Return an array of all the non-deleted FirebaseApps.\n */\n function getApps(): FirebaseApp[] {\n // Make a copy so caller cannot mutate the apps list.\n return Object.keys(apps).map(name => apps[name]);\n }\n\n /*\n * Register a Firebase Service.\n *\n * firebase.INTERNAL.registerService()\n *\n * TODO: Implement serviceProperties.\n */\n function registerService(\n name: string,\n createService: FirebaseServiceFactory,\n serviceProperties?: { [prop: string]: unknown },\n appHook?: AppHook,\n allowMultipleInstances = false\n ): FirebaseServiceNamespace<FirebaseService> {\n // Cannot re-register a service that already exists\n if (factories[name]) {\n error(AppError.DUPLICATE_SERVICE, { name: name });\n }\n\n // Capture the service factory for later service instantiation\n factories[name] = createService;\n\n // Capture the appHook, if passed\n if (appHook) {\n appHooks[name] = appHook;\n\n // Run the **new** app hook on all existing apps\n getApps().forEach(app => {\n appHook('create', app);\n });\n }\n\n // The Service namespace is an accessor function ...\n function serviceNamespace(appArg: FirebaseApp = app()) {\n if (typeof appArg[name] !== 'function') {\n // Invalid argument.\n // This happens in the following case: firebase.storage('gs:/')\n error(AppError.INVALID_APP_ARGUMENT, { name: name });\n }\n\n // Forward service instance lookup to the FirebaseApp.\n return appArg[name]();\n }\n\n // ... and a container for service-level properties.\n if (serviceProperties !== undefined) {\n deepExtend(serviceNamespace, serviceProperties);\n }\n\n // Monkey-patch the serviceNamespace onto the firebase namespace\n namespace[name] = serviceNamespace;\n\n // Patch the FirebaseAppImpl prototype\n firebaseAppImpl.prototype[name] = function(...args) {\n const serviceFxn = this._getService.bind(this, name);\n return serviceFxn.apply(this, allowMultipleInstances ? args : []);\n };\n\n return serviceNamespace;\n }\n\n function callAppHooks(app: FirebaseApp, eventName: string) {\n for (const serviceName of Object.keys(factories)) {\n // Ignore virtual services\n const factoryName = useAsService(app, serviceName);\n if (factoryName === null) {\n return;\n }\n\n if (appHooks[factoryName]) {\n appHooks[factoryName](eventName, app);\n }\n }\n }\n\n // Map the requested service to a registered service name\n // (used to map auth to serverAuth service when needed).\n function useAsService(app: FirebaseApp, name: string): string | null {\n if (name === 'serverAuth') {\n return null;\n }\n\n const useService = name;\n const options = app.options;\n\n return useService;\n }\n\n return namespace;\n}\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { FirebaseNamespace } from '@firebase/app-types';\nimport {\n _FirebaseApp,\n _FirebaseNamespace,\n FirebaseServiceFactory,\n AppHook\n} from '@firebase/app-types/private';\nimport { FirebaseAppLiteImpl } from './firebaseAppLite';\nimport { createFirebaseNamespaceCore } from '../firebaseNamespaceCore';\n\nexport function createFirebaseNamespaceLite(): FirebaseNamespace {\n const namespace = createFirebaseNamespaceCore(FirebaseAppLiteImpl);\n\n namespace.SDK_VERSION = '${JSCORE_VERSION}_LITE';\n\n const registerService = (namespace as _FirebaseNamespace).INTERNAL\n .registerService;\n (namespace as _FirebaseNamespace).INTERNAL.registerService = registerServiceForLite;\n\n /**\n * This is a special implementation, so it only works with performance.\n * only allow performance SDK to register.\n */\n function registerServiceForLite(\n name: string,\n createService: FirebaseServiceFactory,\n serviceProperties?: { [prop: string]: any },\n appHook?: AppHook,\n allowMultipleInstances?: boolean\n ) {\n // only allow performance to register with firebase lite\n if (name !== 'performance' && name !== 'installations') {\n throw Error(`${name} cannot register with the standalone perf instance`);\n }\n\n return registerService(\n name,\n createService,\n serviceProperties,\n appHook,\n allowMultipleInstances\n );\n }\n\n return namespace;\n}\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createFirebaseNamespaceLite } from './src/lite/firebaseNamespaceLite';\n\nexport const firebase = createFirebaseNamespaceLite();\n\nexport default firebase;\n"],"names":[],"mappings":";;AAAA;;;;;;;;;;;;;;;;AAiBA,AAWA,MAAM,MAAM,GAAuB;IACjC,yBACE,+CAA+C;QAC/C,mCAAmC;IACrC,qCAAyB,4BAA4B;IACrD,uCAA0B,6CAA6C;IACvE,mCAAwB,8CAA8C;IACtE,+CACE,qDAAqD;IACvD,qDACE,mDAAmD;QACnD,wBAAwB;CAC3B,CAAC;AAEF,MAAM,SAAS,GAAG,IAAI,YAAY,CAAW,KAAK,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC;AAExE,SAAgB,KAAK,CAAC,IAAc,EAAE,IAA8B;IAClE,MAAM,SAAS,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;CACpC;;AC9CD;;;;;;;;;;;;;;;;AAiBA,AAAO,MAAM,kBAAkB,GAAG,WAAW,CAAC;;ACjB9C;;;;;;;;;;;;;;;;AA2BA,AAUA;;;;AAIA,MAAa,mBAAmB;IAU9B,YACE,OAAwB,EACxB,MAAyB,EACR,SAA6B;QAA7B,cAAS,GAAT,SAAS,CAAoB;QAVxC,eAAU,GAAG,KAAK,CAAC;QACnB,cAAS,GAAkB,EAAE,CAAC;;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AQ,CAAC,WAAW,CAAC,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC;aACvC;SACF;KACF;;;IAID,SAAS,YAAY,CAAC,GAAgB,EAAE,IAAY;QAClD,IAAI,IAAI,KAAK,YAAY,EAAE;YACzB,OAAO,IAAI,CAAC;SACb;QAED,MAAM,UAAU,GAAG,IAAI,CAAC;QACxB,MAAM,OAAO,GAAG,GAAG,CAAC,OAAO,CAAC;QAE5B,OAAO,UAAU,CAAC;KACnB;IAED,OAAO,SAAS,CAAC;CAClB;;AC5PD;;;;;;;;;;;;;;;;AAwBA,SAGgB,2BAA2B;IACzC,MAAM,SAAS,GAAG,2BAA2B,CAAC,mBAAmB,CAAC,CAAC;IAEnE,SAAS,CAAC,WAAW,GAAG,4BAAwB,CAAC;IAEjD,MAAM,eAAe,GAAI,SAAgC,CAAC,QAAQ;SAC/D,eAAe,CAAC;IAClB,SAAgC,CAAC,QAAQ,CAAC,eAAe,GAAG,sBAAsB,CAAC;;;;;IAMpF,SAAS,sBAAsB,CAC7B,IAAY,EACZ,aAAqC,EACrC,iBAA2C,EAC3C,OAAiB,EACjB,sBAAgC;;QAGhC,IAAI,IAAI,KAAK,aAAa,IAAI,IAAI,KAAK,eAAe,EAAE;YACtD,MAAM,KAAK,CAAC,GAAG,IAAI,oDAAoD,CAAC,CAAC;SAC1E;QAED,OAAO,eAAe,CACpB,IAAI,EACJ,aAAa,EACb,iBAAiB,EACjB,OAAO,EACP,sBAAsB,CACvB,CAAC;KACH;IAED,OAAO,SAAS,CAAC;CAClB;;AC9DD;;;;;;;;;;;;;;;;AAiBA,MAEa,QAAQ,GAAG,2BAA2B,EAAE;;;;;"}
1
+ {"version":3,"file":"index.lite.esm2017.js","sources":["../src/errors.ts","../src/constants.ts","../src/lite/firebaseAppLite.ts","../src/firebaseNamespaceCore.ts","../src/lite/firebaseNamespaceLite.ts","../index.lite.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ErrorFactory, ErrorMap } from '@firebase/util';\n\nexport const enum AppError {\n NO_APP = 'no-app',\n BAD_APP_NAME = 'bad-app-name',\n DUPLICATE_APP = 'duplicate-app',\n APP_DELETED = 'app-deleted',\n DUPLICATE_SERVICE = 'duplicate-service',\n INVALID_APP_ARGUMENT = 'invalid-app-argument'\n}\n\nconst ERRORS: ErrorMap<AppError> = {\n [AppError.NO_APP]:\n \"No Firebase App '{$name}' has been created - \" +\n 'call Firebase App.initializeApp()',\n [AppError.BAD_APP_NAME]: \"Illegal App name: '{$name}\",\n [AppError.DUPLICATE_APP]: \"Firebase App named '{$name}' already exists\",\n [AppError.APP_DELETED]: \"Firebase App named '{$name}' already deleted\",\n [AppError.DUPLICATE_SERVICE]:\n \"Firebase service named '{$name}' already registered\",\n [AppError.INVALID_APP_ARGUMENT]:\n 'firebase.{$name}() takes either no argument or a ' +\n 'Firebase App instance.'\n};\n\nconst appErrors = new ErrorFactory<AppError>('app', 'Firebase', ERRORS);\n\nexport function error(code: AppError, args?: { [name: string]: any }) {\n throw appErrors.create(code, args);\n}\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport const DEFAULT_ENTRY_NAME = '[DEFAULT]';\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n FirebaseApp,\n FirebaseOptions,\n FirebaseAppConfig\n} from '@firebase/app-types';\nimport {\n _FirebaseApp,\n _FirebaseNamespace,\n FirebaseService\n} from '@firebase/app-types/private';\nimport { deepCopy, deepExtend } from '@firebase/util';\nimport { error, AppError } from '../errors';\nimport { DEFAULT_ENTRY_NAME } from '../constants';\n\ninterface ServicesCache {\n [name: string]: {\n [serviceName: string]: FirebaseService;\n };\n}\n\n/**\n * Global context object for a collection of services using\n * a shared authentication state.\n */\nexport class FirebaseAppLiteImpl implements FirebaseApp {\n private readonly options_: FirebaseOptions;\n private readonly name_: string;\n private isDeleted_ = false;\n private services_: ServicesCache = {};\n private automaticDataCollectionEnabled_: boolean;\n\n // lite version has an empty INTERNAL namespace\n readonly INTERNAL = {};\n\n constructor(\n options: FirebaseOptions,\n config: FirebaseAppConfig,\n private readonly firebase_: _FirebaseNamespace\n ) {\n this.name_ = config.name!;\n this.automaticDataCollectionEnabled_ =\n config.automaticDataCollectionEnabled || false;\n this.options_ = deepCopy<FirebaseOptions>(options);\n }\n\n get automaticDataCollectionEnabled(): boolean {\n this.checkDestroyed_();\n return this.automaticDataCollectionEnabled_;\n }\n\n set automaticDataCollectionEnabled(val) {\n this.checkDestroyed_();\n this.automaticDataCollectionEnabled_ = val;\n }\n\n get name(): string {\n this.checkDestroyed_();\n return this.name_;\n }\n\n get options(): FirebaseOptions {\n this.checkDestroyed_();\n return this.options_;\n }\n\n delete(): Promise<void> {\n return new Promise(resolve => {\n this.checkDestroyed_();\n resolve();\n })\n .then(() => {\n this.firebase_.INTERNAL.removeApp(this.name_);\n const services: FirebaseService[] = [];\n\n for (const serviceKey of Object.keys(this.services_)) {\n for (const instanceKey of Object.keys(this.services_[serviceKey])) {\n services.push(this.services_[serviceKey][instanceKey]);\n }\n }\n\n return Promise.all(\n services.map(service => {\n return service.INTERNAL.delete();\n })\n );\n })\n .then(\n (): void => {\n this.isDeleted_ = true;\n this.services_ = {};\n }\n );\n }\n\n /**\n * Return a service instance associated with this app (creating it\n * on demand), identified by the passed instanceIdentifier.\n *\n * NOTE: Currently storage is the only one that is leveraging this\n * functionality. They invoke it by calling:\n *\n * ```javascript\n * firebase.app().storage('STORAGE BUCKET ID')\n * ```\n *\n * The service name is passed to this already\n * @internal\n */\n _getService(\n name: string,\n instanceIdentifier: string = DEFAULT_ENTRY_NAME\n ): FirebaseService {\n this.checkDestroyed_();\n\n if (!this.services_[name]) {\n this.services_[name] = {};\n }\n\n if (!this.services_[name][instanceIdentifier]) {\n /**\n * If a custom instance has been defined (i.e. not '[DEFAULT]')\n * then we will pass that instance on, otherwise we pass `null`\n */\n const instanceSpecifier =\n instanceIdentifier !== DEFAULT_ENTRY_NAME\n ? instanceIdentifier\n : undefined;\n const service = this.firebase_.INTERNAL.factories[name](\n this,\n this.extendApp.bind(this),\n instanceSpecifier\n );\n this.services_[name][instanceIdentifier] = service;\n }\n\n return this.services_[name][instanceIdentifier];\n }\n\n /**\n * Callback function used to extend an App instance at the time\n * of service instance creation.\n */\n private extendApp(props: { [name: string]: any }): void {\n // Copy the object onto the FirebaseAppImpl prototype\n deepExtend(this, props);\n }\n\n /**\n * This function will throw an Error if the App has already been deleted -\n * use before performing API actions on the App.\n */\n private checkDestroyed_(): void {\n if (this.isDeleted_) {\n error(AppError.APP_DELETED, { name: this.name_ });\n }\n }\n}\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n FirebaseApp,\n FirebaseOptions,\n FirebaseNamespace,\n FirebaseAppConfig\n} from '@firebase/app-types';\nimport {\n _FirebaseApp,\n _FirebaseNamespace,\n FirebaseService,\n FirebaseServiceFactory,\n FirebaseServiceNamespace,\n AppHook\n} from '@firebase/app-types/private';\nimport { deepExtend, patchProperty } from '@firebase/util';\nimport { FirebaseAppImpl } from './firebaseApp';\nimport { error, AppError } from './errors';\nimport { FirebaseAppLiteImpl } from './lite/firebaseAppLite';\nimport { DEFAULT_ENTRY_NAME } from './constants';\n\nfunction contains(obj: object, key: string) {\n return Object.prototype.hasOwnProperty.call(obj, key);\n}\n\n/**\n * Because auth can't share code with other components, we attach the utility functions\n * in an internal namespace to share code.\n * This function return a firebase namespace object without\n * any utility functions, so it can be shared between the regular firebaseNamespace and\n * the lite version.\n */\nexport function createFirebaseNamespaceCore(\n firebaseAppImpl: typeof FirebaseAppImpl | typeof FirebaseAppLiteImpl\n): FirebaseNamespace {\n const apps: { [name: string]: FirebaseApp } = {};\n const factories: { [service: string]: FirebaseServiceFactory } = {};\n const appHooks: { [service: string]: AppHook } = {};\n\n // A namespace is a plain JavaScript Object.\n const namespace: FirebaseNamespace = {\n // Hack to prevent Babel from modifying the object returned\n // as the firebase namespace.\n // @ts-ignore\n __esModule: true,\n initializeApp: initializeApp,\n app: app as any,\n apps: null as any,\n Promise: Promise,\n SDK_VERSION: '${JSCORE_VERSION}',\n INTERNAL: {\n registerService,\n removeApp,\n factories,\n useAsService\n }\n };\n\n // Inject a circular default export to allow Babel users who were previously\n // using:\n //\n // import firebase from 'firebase';\n // which becomes: var firebase = require('firebase').default;\n //\n // instead of\n //\n // import * as firebase from 'firebase';\n // which becomes: var firebase = require('firebase');\n patchProperty(namespace, 'default', namespace);\n\n // firebase.apps is a read-only getter.\n Object.defineProperty(namespace, 'apps', {\n get: getApps\n });\n\n /**\n * Called by App.delete() - but before any services associated with the App\n * are deleted.\n */\n function removeApp(name: string): void {\n const app = apps[name];\n callAppHooks(app, 'delete');\n delete apps[name];\n }\n\n /**\n * Get the App object for a given name (or DEFAULT).\n */\n function app(name?: string): FirebaseApp {\n name = name || DEFAULT_ENTRY_NAME;\n if (!contains(apps, name)) {\n error(AppError.NO_APP, { name: name });\n }\n return apps[name];\n }\n\n patchProperty(app, 'App', firebaseAppImpl);\n /**\n * Create a new App instance (name must be unique).\n */\n function initializeApp(\n options: FirebaseOptions,\n config?: FirebaseAppConfig\n ): FirebaseApp;\n function initializeApp(options: FirebaseOptions, name?: string): FirebaseApp;\n function initializeApp(options: FirebaseOptions, rawConfig = {}) {\n if (typeof rawConfig !== 'object' || rawConfig === null) {\n const name = rawConfig;\n rawConfig = { name };\n }\n\n const config = rawConfig as FirebaseAppConfig;\n\n if (config.name === undefined) {\n config.name = DEFAULT_ENTRY_NAME;\n }\n\n const { name } = config;\n\n if (typeof name !== 'string' || !name) {\n error(AppError.BAD_APP_NAME, { name: String(name) });\n }\n\n if (contains(apps, name)) {\n error(AppError.DUPLICATE_APP, { name: name });\n }\n\n const app = new firebaseAppImpl(\n options,\n config,\n namespace as _FirebaseNamespace\n );\n\n apps[name] = app;\n callAppHooks(app, 'create');\n\n return app;\n }\n\n /*\n * Return an array of all the non-deleted FirebaseApps.\n */\n function getApps(): FirebaseApp[] {\n // Make a copy so caller cannot mutate the apps list.\n return Object.keys(apps).map(name => apps[name]);\n }\n\n /*\n * Register a Firebase Service.\n *\n * firebase.INTERNAL.registerService()\n *\n * TODO: Implement serviceProperties.\n */\n function registerService(\n name: string,\n createService: FirebaseServiceFactory,\n serviceProperties?: { [prop: string]: unknown },\n appHook?: AppHook,\n allowMultipleInstances = false\n ): FirebaseServiceNamespace<FirebaseService> {\n // Cannot re-register a service that already exists\n if (factories[name]) {\n error(AppError.DUPLICATE_SERVICE, { name: name });\n }\n\n // Capture the service factory for later service instantiation\n factories[name] = createService;\n\n // Capture the appHook, if passed\n if (appHook) {\n appHooks[name] = appHook;\n\n // Run the **new** app hook on all existing apps\n getApps().forEach(app => {\n appHook('create', app);\n });\n }\n\n // The Service namespace is an accessor function ...\n function serviceNamespace(appArg: FirebaseApp = app()) {\n if (typeof appArg[name] !== 'function') {\n // Invalid argument.\n // This happens in the following case: firebase.storage('gs:/')\n error(AppError.INVALID_APP_ARGUMENT, { name: name });\n }\n\n // Forward service instance lookup to the FirebaseApp.\n return appArg[name]();\n }\n\n // ... and a container for service-level properties.\n if (serviceProperties !== undefined) {\n deepExtend(serviceNamespace, serviceProperties);\n }\n\n // Monkey-patch the serviceNamespace onto the firebase namespace\n namespace[name] = serviceNamespace;\n\n // Patch the FirebaseAppImpl prototype\n firebaseAppImpl.prototype[name] = function(...args) {\n const serviceFxn = this._getService.bind(this, name);\n return serviceFxn.apply(this, allowMultipleInstances ? args : []);\n };\n\n return serviceNamespace;\n }\n\n function callAppHooks(app: FirebaseApp, eventName: string) {\n for (const serviceName of Object.keys(factories)) {\n // Ignore virtual services\n const factoryName = useAsService(app, serviceName);\n if (factoryName === null) {\n return;\n }\n\n if (appHooks[factoryName]) {\n appHooks[factoryName](eventName, app);\n }\n }\n }\n\n // Map the requested service to a registered service name\n // (used to map auth to serverAuth service when needed).\n function useAsService(app: FirebaseApp, name: string): string | null {\n if (name === 'serverAuth') {\n return null;\n }\n\n const useService = name;\n const options = app.options;\n\n return useService;\n }\n\n return namespace;\n}\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { FirebaseNamespace } from '@firebase/app-types';\nimport {\n _FirebaseApp,\n _FirebaseNamespace,\n FirebaseServiceFactory,\n AppHook\n} from '@firebase/app-types/private';\nimport { FirebaseAppLiteImpl } from './firebaseAppLite';\nimport { createFirebaseNamespaceCore } from '../firebaseNamespaceCore';\n\nexport function createFirebaseNamespaceLite(): FirebaseNamespace {\n const namespace = createFirebaseNamespaceCore(FirebaseAppLiteImpl);\n\n namespace.SDK_VERSION = '${JSCORE_VERSION}_LITE';\n\n const registerService = (namespace as _FirebaseNamespace).INTERNAL\n .registerService;\n (namespace as _FirebaseNamespace).INTERNAL.registerService = registerServiceForLite;\n\n /**\n * This is a special implementation, so it only works with performance.\n * only allow performance SDK to register.\n */\n function registerServiceForLite(\n name: string,\n createService: FirebaseServiceFactory,\n serviceProperties?: { [prop: string]: any },\n appHook?: AppHook,\n allowMultipleInstances?: boolean\n ) {\n // only allow performance to register with firebase lite\n if (name !== 'performance' && name !== 'installations') {\n throw Error(`${name} cannot register with the standalone perf instance`);\n }\n\n return registerService(\n name,\n createService,\n serviceProperties,\n appHook,\n allowMultipleInstances\n );\n }\n\n return namespace;\n}\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createFirebaseNamespaceLite } from './src/lite/firebaseNamespaceLite';\n\nexport const firebase = createFirebaseNamespaceLite();\n\nexport default firebase;\n"],"names":[],"mappings":";;AAAA;;;;;;;;;;;;;;;;AAiBA,AAWA,M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,QAAQ,CAAC,eAAe,GAAG,sBAAsB,CAAC;;;;;IAMpF,SAAS,sBAAsB,CAC7B,IAAY,EACZ,aAAqC,EACrC,iBAA2C,EAC3C,OAAiB,EACjB,sBAAgC;;QAGhC,IAAI,IAAI,KAAK,aAAa,IAAI,IAAI,KAAK,eAAe,EAAE;YACtD,MAAM,KAAK,CAAC,GAAG,IAAI,oDAAoD,CAAC,CAAC;SAC1E;QAED,OAAO,eAAe,CACpB,IAAI,EACJ,aAAa,EACb,iBAAiB,EACjB,OAAO,EACP,sBAAsB,CACvB,CAAC;KACH;IAED,OAAO,SAAS,CAAC;CAClB;;AC9DD;;;;;;;;;;;;;;;;AAiBA,MAEa,QAAQ,GAAG,2BAA2B,EAAE;;;;;"}
@@ -228,7 +228,7 @@ function createFirebaseNamespaceCore(firebaseAppImpl) {
228
228
  app: app,
229
229
  apps: null,
230
230
  Promise: Promise,
231
- SDK_VERSION: '5.11.0-canary.a7bb0b5',
231
+ SDK_VERSION: '5.11.0',
232
232
  INTERNAL: {
233
233
  registerService: registerService,
234
234
  removeApp: removeApp,
@@ -395,7 +395,7 @@ function createFirebaseNamespaceCore(firebaseAppImpl) {
395
395
  */
396
396
  function createFirebaseNamespaceLite() {
397
397
  var namespace = createFirebaseNamespaceCore(FirebaseAppLiteImpl);
398
- namespace.SDK_VERSION = '5.11.0-canary.a7bb0b5_LITE';
398
+ namespace.SDK_VERSION = '5.11.0_LITE';
399
399
  var registerService = namespace.INTERNAL
400
400
  .registerService;
401
401
  namespace.INTERNAL.registerService = registerServiceForLite;
@@ -1 +1 @@
1
- {"version":3,"file":"index.lite.js","sources":["../src/errors.ts","../src/constants.ts","../src/lite/firebaseAppLite.ts","../src/firebaseNamespaceCore.ts","../src/lite/firebaseNamespaceLite.ts","../index.lite.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ErrorFactory, ErrorMap } from '@firebase/util';\n\nexport const enum AppError {\n NO_APP = 'no-app',\n BAD_APP_NAME = 'bad-app-name',\n DUPLICATE_APP = 'duplicate-app',\n APP_DELETED = 'app-deleted',\n DUPLICATE_SERVICE = 'duplicate-service',\n INVALID_APP_ARGUMENT = 'invalid-app-argument'\n}\n\nconst ERRORS: ErrorMap<AppError> = {\n [AppError.NO_APP]:\n \"No Firebase App '{$name}' has been created - \" +\n 'call Firebase App.initializeApp()',\n [AppError.BAD_APP_NAME]: \"Illegal App name: '{$name}\",\n [AppError.DUPLICATE_APP]: \"Firebase App named '{$name}' already exists\",\n [AppError.APP_DELETED]: \"Firebase App named '{$name}' already deleted\",\n [AppError.DUPLICATE_SERVICE]:\n \"Firebase service named '{$name}' already registered\",\n [AppError.INVALID_APP_ARGUMENT]:\n 'firebase.{$name}() takes either no argument or a ' +\n 'Firebase App instance.'\n};\n\nconst appErrors = new ErrorFactory<AppError>('app', 'Firebase', ERRORS);\n\nexport function error(code: AppError, args?: { [name: string]: any }) {\n throw appErrors.create(code, args);\n}\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport const DEFAULT_ENTRY_NAME = '[DEFAULT]';\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n FirebaseApp,\n FirebaseOptions,\n FirebaseAppConfig\n} from '@firebase/app-types';\nimport {\n _FirebaseApp,\n _FirebaseNamespace,\n FirebaseService\n} from '@firebase/app-types/private';\nimport { deepCopy, deepExtend } from '@firebase/util';\nimport { error, AppError } from '../errors';\nimport { DEFAULT_ENTRY_NAME } from '../constants';\n\ninterface ServicesCache {\n [name: string]: {\n [serviceName: string]: FirebaseService;\n };\n}\n\n/**\n * Global context object for a collection of services using\n * a shared authentication state.\n */\nexport class FirebaseAppLiteImpl implements FirebaseApp {\n private readonly options_: FirebaseOptions;\n private readonly name_: string;\n private isDeleted_ = false;\n private services_: ServicesCache = {};\n private automaticDataCollectionEnabled_: boolean;\n\n // lite version has an empty INTERNAL namespace\n readonly INTERNAL = {};\n\n constructor(\n options: FirebaseOptions,\n config: FirebaseAppConfig,\n private readonly firebase_: _FirebaseNamespace\n ) {\n this.name_ = config.name!;\n this.automaticDataCollectionEnabled_ =\n config.automaticDataCollectionEnabled || false;\n this.options_ = deepCopy<FirebaseOptions>(options);\n }\n\n get automaticDataCollectionEnabled(): boolean {\n this.checkDestroyed_();\n return this.automaticDataCollectionEnabled_;\n }\n\n set automaticDataCollectionEnabled(val) {\n this.checkDestroyed_();\n this.automaticDataCollectionEnabled_ = val;\n }\n\n get name(): string {\n this.checkDestroyed_();\n return this.name_;\n }\n\n get options(): FirebaseOptions {\n this.checkDestroyed_();\n return this.options_;\n }\n\n delete(): Promise<void> {\n return new Promise(resolve => {\n this.checkDestroyed_();\n resolve();\n })\n .then(() => {\n this.firebase_.INTERNAL.removeApp(this.name_);\n const services: FirebaseService[] = [];\n\n for (const serviceKey of Object.keys(this.services_)) {\n for (const instanceKey of Object.keys(this.services_[serviceKey])) {\n services.push(this.services_[serviceKey][instanceKey]);\n }\n }\n\n return Promise.all(\n services.map(service => {\n return service.INTERNAL.delete();\n })\n );\n })\n .then(\n (): void => {\n this.isDeleted_ = true;\n this.services_ = {};\n }\n );\n }\n\n /**\n * Return a service instance associated with this app (creating it\n * on demand), identified by the passed instanceIdentifier.\n *\n * NOTE: Currently storage is the only one that is leveraging this\n * functionality. They invoke it by calling:\n *\n * ```javascript\n * firebase.app().storage('STORAGE BUCKET ID')\n * ```\n *\n * The service name is passed to this already\n * @internal\n */\n _getService(\n name: string,\n instanceIdentifier: string = DEFAULT_ENTRY_NAME\n ): FirebaseService {\n this.checkDestroyed_();\n\n if (!this.services_[name]) {\n this.services_[name] = {};\n }\n\n if (!this.services_[name][instanceIdentifier]) {\n /**\n * If a custom instance has been defined (i.e. not '[DEFAULT]')\n * then we will pass that instance on, otherwise we pass `null`\n */\n const instanceSpecifier =\n instanceIdentifier !== DEFAULT_ENTRY_NAME\n ? instanceIdentifier\n : undefined;\n const service = this.firebase_.INTERNAL.factories[name](\n this,\n this.extendApp.bind(this),\n instanceSpecifier\n );\n this.services_[name][instanceIdentifier] = service;\n }\n\n return this.services_[name][instanceIdentifier];\n }\n\n /**\n * Callback function used to extend an App instance at the time\n * of service instance creation.\n */\n private extendApp(props: { [name: string]: any }): void {\n // Copy the object onto the FirebaseAppImpl prototype\n deepExtend(this, props);\n }\n\n /**\n * This function will throw an Error if the App has already been deleted -\n * use before performing API actions on the App.\n */\n private checkDestroyed_(): void {\n if (this.isDeleted_) {\n error(AppError.APP_DELETED, { name: this.name_ });\n }\n }\n}\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n FirebaseApp,\n FirebaseOptions,\n FirebaseNamespace,\n FirebaseAppConfig\n} from '@firebase/app-types';\nimport {\n _FirebaseApp,\n _FirebaseNamespace,\n FirebaseService,\n FirebaseServiceFactory,\n FirebaseServiceNamespace,\n AppHook\n} from '@firebase/app-types/private';\nimport { deepExtend, patchProperty } from '@firebase/util';\nimport { FirebaseAppImpl } from './firebaseApp';\nimport { error, AppError } from './errors';\nimport { FirebaseAppLiteImpl } from './lite/firebaseAppLite';\nimport { DEFAULT_ENTRY_NAME } from './constants';\n\nfunction contains(obj: object, key: string) {\n return Object.prototype.hasOwnProperty.call(obj, key);\n}\n\n/**\n * Because auth can't share code with other components, we attach the utility functions\n * in an internal namespace to share code.\n * This function return a firebase namespace object without\n * any utility functions, so it can be shared between the regular firebaseNamespace and\n * the lite version.\n */\nexport function createFirebaseNamespaceCore(\n firebaseAppImpl: typeof FirebaseAppImpl | typeof FirebaseAppLiteImpl\n): FirebaseNamespace {\n const apps: { [name: string]: FirebaseApp } = {};\n const factories: { [service: string]: FirebaseServiceFactory } = {};\n const appHooks: { [service: string]: AppHook } = {};\n\n // A namespace is a plain JavaScript Object.\n const namespace: FirebaseNamespace = {\n // Hack to prevent Babel from modifying the object returned\n // as the firebase namespace.\n // @ts-ignore\n __esModule: true,\n initializeApp: initializeApp,\n app: app as any,\n apps: null as any,\n Promise: Promise,\n SDK_VERSION: '${JSCORE_VERSION}',\n INTERNAL: {\n registerService,\n removeApp,\n factories,\n useAsService\n }\n };\n\n // Inject a circular default export to allow Babel users who were previously\n // using:\n //\n // import firebase from 'firebase';\n // which becomes: var firebase = require('firebase').default;\n //\n // instead of\n //\n // import * as firebase from 'firebase';\n // which becomes: var firebase = require('firebase');\n patchProperty(namespace, 'default', namespace);\n\n // firebase.apps is a read-only getter.\n Object.defineProperty(namespace, 'apps', {\n get: getApps\n });\n\n /**\n * Called by App.delete() - but before any services associated with the App\n * are deleted.\n */\n function removeApp(name: string): void {\n const app = apps[name];\n callAppHooks(app, 'delete');\n delete apps[name];\n }\n\n /**\n * Get the App object for a given name (or DEFAULT).\n */\n function app(name?: string): FirebaseApp {\n name = name || DEFAULT_ENTRY_NAME;\n if (!contains(apps, name)) {\n error(AppError.NO_APP, { name: name });\n }\n return apps[name];\n }\n\n patchProperty(app, 'App', firebaseAppImpl);\n /**\n * Create a new App instance (name must be unique).\n */\n function initializeApp(\n options: FirebaseOptions,\n config?: FirebaseAppConfig\n ): FirebaseApp;\n function initializeApp(options: FirebaseOptions, name?: string): FirebaseApp;\n function initializeApp(options: FirebaseOptions, rawConfig = {}) {\n if (typeof rawConfig !== 'object' || rawConfig === null) {\n const name = rawConfig;\n rawConfig = { name };\n }\n\n const config = rawConfig as FirebaseAppConfig;\n\n if (config.name === undefined) {\n config.name = DEFAULT_ENTRY_NAME;\n }\n\n const { name } = config;\n\n if (typeof name !== 'string' || !name) {\n error(AppError.BAD_APP_NAME, { name: String(name) });\n }\n\n if (contains(apps, name)) {\n error(AppError.DUPLICATE_APP, { name: name });\n }\n\n const app = new firebaseAppImpl(\n options,\n config,\n namespace as _FirebaseNamespace\n );\n\n apps[name] = app;\n callAppHooks(app, 'create');\n\n return app;\n }\n\n /*\n * Return an array of all the non-deleted FirebaseApps.\n */\n function getApps(): FirebaseApp[] {\n // Make a copy so caller cannot mutate the apps list.\n return Object.keys(apps).map(name => apps[name]);\n }\n\n /*\n * Register a Firebase Service.\n *\n * firebase.INTERNAL.registerService()\n *\n * TODO: Implement serviceProperties.\n */\n function registerService(\n name: string,\n createService: FirebaseServiceFactory,\n serviceProperties?: { [prop: string]: unknown },\n appHook?: AppHook,\n allowMultipleInstances = false\n ): FirebaseServiceNamespace<FirebaseService> {\n // Cannot re-register a service that already exists\n if (factories[name]) {\n error(AppError.DUPLICATE_SERVICE, { name: name });\n }\n\n // Capture the service factory for later service instantiation\n factories[name] = createService;\n\n // Capture the appHook, if passed\n if (appHook) {\n appHooks[name] = appHook;\n\n // Run the **new** app hook on all existing apps\n getApps().forEach(app => {\n appHook('create', app);\n });\n }\n\n // The Service namespace is an accessor function ...\n function serviceNamespace(appArg: FirebaseApp = app()) {\n if (typeof appArg[name] !== 'function') {\n // Invalid argument.\n // This happens in the following case: firebase.storage('gs:/')\n error(AppError.INVALID_APP_ARGUMENT, { name: name });\n }\n\n // Forward service instance lookup to the FirebaseApp.\n return appArg[name]();\n }\n\n // ... and a container for service-level properties.\n if (serviceProperties !== undefined) {\n deepExtend(serviceNamespace, serviceProperties);\n }\n\n // Monkey-patch the serviceNamespace onto the firebase namespace\n namespace[name] = serviceNamespace;\n\n // Patch the FirebaseAppImpl prototype\n firebaseAppImpl.prototype[name] = function(...args) {\n const serviceFxn = this._getService.bind(this, name);\n return serviceFxn.apply(this, allowMultipleInstances ? args : []);\n };\n\n return serviceNamespace;\n }\n\n function callAppHooks(app: FirebaseApp, eventName: string) {\n for (const serviceName of Object.keys(factories)) {\n // Ignore virtual services\n const factoryName = useAsService(app, serviceName);\n if (factoryName === null) {\n return;\n }\n\n if (appHooks[factoryName]) {\n appHooks[factoryName](eventName, app);\n }\n }\n }\n\n // Map the requested service to a registered service name\n // (used to map auth to serverAuth service when needed).\n function useAsService(app: FirebaseApp, name: string): string | null {\n if (name === 'serverAuth') {\n return null;\n }\n\n const useService = name;\n const options = app.options;\n\n return useService;\n }\n\n return namespace;\n}\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { FirebaseNamespace } from '@firebase/app-types';\nimport {\n _FirebaseApp,\n _FirebaseNamespace,\n FirebaseServiceFactory,\n AppHook\n} from '@firebase/app-types/private';\nimport { FirebaseAppLiteImpl } from './firebaseAppLite';\nimport { createFirebaseNamespaceCore } from '../firebaseNamespaceCore';\n\nexport function createFirebaseNamespaceLite(): FirebaseNamespace {\n const namespace = createFirebaseNamespaceCore(FirebaseAppLiteImpl);\n\n namespace.SDK_VERSION = '${JSCORE_VERSION}_LITE';\n\n const registerService = (namespace as _FirebaseNamespace).INTERNAL\n .registerService;\n (namespace as _FirebaseNamespace).INTERNAL.registerService = registerServiceForLite;\n\n /**\n * This is a special implementation, so it only works with performance.\n * only allow performance SDK to register.\n */\n function registerServiceForLite(\n name: string,\n createService: FirebaseServiceFactory,\n serviceProperties?: { [prop: string]: any },\n appHook?: AppHook,\n allowMultipleInstances?: boolean\n ) {\n // only allow performance to register with firebase lite\n if (name !== 'performance' && name !== 'installations') {\n throw Error(`${name} cannot register with the standalone perf instance`);\n }\n\n return registerService(\n name,\n createService,\n serviceProperties,\n appHook,\n allowMultipleInstances\n );\n }\n\n return namespace;\n}\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createFirebaseNamespaceLite } from './src/lite/firebaseNamespaceLite';\n\nexport const firebase = createFirebaseNamespaceLite();\n\nexport default firebase;\n"],"names":[],"mappings":";;AAAA;;;;;;;;;;;;;;;;;AAiBA,AAWA,IAAM,MAAM;IACV,4BACE,+CAA+C;QAC/C,mCAAmC;IACrC,wCAA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AM,UAAU,GAAG,IAAI,CAAC;QACxB,IAAM,OAAO,GAAG,GAAG,CAAC,OAAO,CAAC;QAE5B,OAAO,UAAU,CAAC;KACnB;IAED,OAAO,SAAS,CAAC;CAClB;;AC5PD;;;;;;;;;;;;;;;;AAwBA,SAGgB,2BAA2B;IACzC,IAAM,SAAS,GAAG,2BAA2B,CAAC,mBAAmB,CAAC,CAAC;IAEnE,SAAS,CAAC,WAAW,GAAG,4BAAwB,CAAC;IAEjD,IAAM,eAAe,GAAI,SAAgC,CAAC,QAAQ;SAC/D,eAAe,CAAC;IAClB,SAAgC,CAAC,QAAQ,CAAC,eAAe,GAAG,sBAAsB,CAAC;;;;;IAMpF,SAAS,sBAAsB,CAC7B,IAAY,EACZ,aAAqC,EACrC,iBAA2C,EAC3C,OAAiB,EACjB,sBAAgC;;QAGhC,IAAI,IAAI,KAAK,aAAa,IAAI,IAAI,KAAK,eAAe,EAAE;YACtD,MAAM,KAAK,CAAI,IAAI,uDAAoD,CAAC,CAAC;SAC1E;QAED,OAAO,eAAe,CACpB,IAAI,EACJ,aAAa,EACb,iBAAiB,EACjB,OAAO,EACP,sBAAsB,CACvB,CAAC;KACH;IAED,OAAO,SAAS,CAAC;CAClB;;AC9DD;;;;;;;;;;;;;;;;AAiBA,IAEa,QAAQ,GAAG,2BAA2B,EAAE;;;;;"}
1
+ {"version":3,"file":"index.lite.js","sources":["../src/errors.ts","../src/constants.ts","../src/lite/firebaseAppLite.ts","../src/firebaseNamespaceCore.ts","../src/lite/firebaseNamespaceLite.ts","../index.lite.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ErrorFactory, ErrorMap } from '@firebase/util';\n\nexport const enum AppError {\n NO_APP = 'no-app',\n BAD_APP_NAME = 'bad-app-name',\n DUPLICATE_APP = 'duplicate-app',\n APP_DELETED = 'app-deleted',\n DUPLICATE_SERVICE = 'duplicate-service',\n INVALID_APP_ARGUMENT = 'invalid-app-argument'\n}\n\nconst ERRORS: ErrorMap<AppError> = {\n [AppError.NO_APP]:\n \"No Firebase App '{$name}' has been created - \" +\n 'call Firebase App.initializeApp()',\n [AppError.BAD_APP_NAME]: \"Illegal App name: '{$name}\",\n [AppError.DUPLICATE_APP]: \"Firebase App named '{$name}' already exists\",\n [AppError.APP_DELETED]: \"Firebase App named '{$name}' already deleted\",\n [AppError.DUPLICATE_SERVICE]:\n \"Firebase service named '{$name}' already registered\",\n [AppError.INVALID_APP_ARGUMENT]:\n 'firebase.{$name}() takes either no argument or a ' +\n 'Firebase App instance.'\n};\n\nconst appErrors = new ErrorFactory<AppError>('app', 'Firebase', ERRORS);\n\nexport function error(code: AppError, args?: { [name: string]: any }) {\n throw appErrors.create(code, args);\n}\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport const DEFAULT_ENTRY_NAME = '[DEFAULT]';\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n FirebaseApp,\n FirebaseOptions,\n FirebaseAppConfig\n} from '@firebase/app-types';\nimport {\n _FirebaseApp,\n _FirebaseNamespace,\n FirebaseService\n} from '@firebase/app-types/private';\nimport { deepCopy, deepExtend } from '@firebase/util';\nimport { error, AppError } from '../errors';\nimport { DEFAULT_ENTRY_NAME } from '../constants';\n\ninterface ServicesCache {\n [name: string]: {\n [serviceName: string]: FirebaseService;\n };\n}\n\n/**\n * Global context object for a collection of services using\n * a shared authentication state.\n */\nexport class FirebaseAppLiteImpl implements FirebaseApp {\n private readonly options_: FirebaseOptions;\n private readonly name_: string;\n private isDeleted_ = false;\n private services_: ServicesCache = {};\n private automaticDataCollectionEnabled_: boolean;\n\n // lite version has an empty INTERNAL namespace\n readonly INTERNAL = {};\n\n constructor(\n options: FirebaseOptions,\n config: FirebaseAppConfig,\n private readonly firebase_: _FirebaseNamespace\n ) {\n this.name_ = config.name!;\n this.automaticDataCollectionEnabled_ =\n config.automaticDataCollectionEnabled || false;\n this.options_ = deepCopy<FirebaseOptions>(options);\n }\n\n get automaticDataCollectionEnabled(): boolean {\n this.checkDestroyed_();\n return this.automaticDataCollectionEnabled_;\n }\n\n set automaticDataCollectionEnabled(val) {\n this.checkDestroyed_();\n this.automaticDataCollectionEnabled_ = val;\n }\n\n get name(): string {\n this.checkDestroyed_();\n return this.name_;\n }\n\n get options(): FirebaseOptions {\n this.checkDestroyed_();\n return this.options_;\n }\n\n delete(): Promise<void> {\n return new Promise(resolve => {\n this.checkDestroyed_();\n resolve();\n })\n .then(() => {\n this.firebase_.INTERNAL.removeApp(this.name_);\n const services: FirebaseService[] = [];\n\n for (const serviceKey of Object.keys(this.services_)) {\n for (const instanceKey of Object.keys(this.services_[serviceKey])) {\n services.push(this.services_[serviceKey][instanceKey]);\n }\n }\n\n return Promise.all(\n services.map(service => {\n return service.INTERNAL.delete();\n })\n );\n })\n .then(\n (): void => {\n this.isDeleted_ = true;\n this.services_ = {};\n }\n );\n }\n\n /**\n * Return a service instance associated with this app (creating it\n * on demand), identified by the passed instanceIdentifier.\n *\n * NOTE: Currently storage is the only one that is leveraging this\n * functionality. They invoke it by calling:\n *\n * ```javascript\n * firebase.app().storage('STORAGE BUCKET ID')\n * ```\n *\n * The service name is passed to this already\n * @internal\n */\n _getService(\n name: string,\n instanceIdentifier: string = DEFAULT_ENTRY_NAME\n ): FirebaseService {\n this.checkDestroyed_();\n\n if (!this.services_[name]) {\n this.services_[name] = {};\n }\n\n if (!this.services_[name][instanceIdentifier]) {\n /**\n * If a custom instance has been defined (i.e. not '[DEFAULT]')\n * then we will pass that instance on, otherwise we pass `null`\n */\n const instanceSpecifier =\n instanceIdentifier !== DEFAULT_ENTRY_NAME\n ? instanceIdentifier\n : undefined;\n const service = this.firebase_.INTERNAL.factories[name](\n this,\n this.extendApp.bind(this),\n instanceSpecifier\n );\n this.services_[name][instanceIdentifier] = service;\n }\n\n return this.services_[name][instanceIdentifier];\n }\n\n /**\n * Callback function used to extend an App instance at the time\n * of service instance creation.\n */\n private extendApp(props: { [name: string]: any }): void {\n // Copy the object onto the FirebaseAppImpl prototype\n deepExtend(this, props);\n }\n\n /**\n * This function will throw an Error if the App has already been deleted -\n * use before performing API actions on the App.\n */\n private checkDestroyed_(): void {\n if (this.isDeleted_) {\n error(AppError.APP_DELETED, { name: this.name_ });\n }\n }\n}\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n FirebaseApp,\n FirebaseOptions,\n FirebaseNamespace,\n FirebaseAppConfig\n} from '@firebase/app-types';\nimport {\n _FirebaseApp,\n _FirebaseNamespace,\n FirebaseService,\n FirebaseServiceFactory,\n FirebaseServiceNamespace,\n AppHook\n} from '@firebase/app-types/private';\nimport { deepExtend, patchProperty } from '@firebase/util';\nimport { FirebaseAppImpl } from './firebaseApp';\nimport { error, AppError } from './errors';\nimport { FirebaseAppLiteImpl } from './lite/firebaseAppLite';\nimport { DEFAULT_ENTRY_NAME } from './constants';\n\nfunction contains(obj: object, key: string) {\n return Object.prototype.hasOwnProperty.call(obj, key);\n}\n\n/**\n * Because auth can't share code with other components, we attach the utility functions\n * in an internal namespace to share code.\n * This function return a firebase namespace object without\n * any utility functions, so it can be shared between the regular firebaseNamespace and\n * the lite version.\n */\nexport function createFirebaseNamespaceCore(\n firebaseAppImpl: typeof FirebaseAppImpl | typeof FirebaseAppLiteImpl\n): FirebaseNamespace {\n const apps: { [name: string]: FirebaseApp } = {};\n const factories: { [service: string]: FirebaseServiceFactory } = {};\n const appHooks: { [service: string]: AppHook } = {};\n\n // A namespace is a plain JavaScript Object.\n const namespace: FirebaseNamespace = {\n // Hack to prevent Babel from modifying the object returned\n // as the firebase namespace.\n // @ts-ignore\n __esModule: true,\n initializeApp: initializeApp,\n app: app as any,\n apps: null as any,\n Promise: Promise,\n SDK_VERSION: '${JSCORE_VERSION}',\n INTERNAL: {\n registerService,\n removeApp,\n factories,\n useAsService\n }\n };\n\n // Inject a circular default export to allow Babel users who were previously\n // using:\n //\n // import firebase from 'firebase';\n // which becomes: var firebase = require('firebase').default;\n //\n // instead of\n //\n // import * as firebase from 'firebase';\n // which becomes: var firebase = require('firebase');\n patchProperty(namespace, 'default', namespace);\n\n // firebase.apps is a read-only getter.\n Object.defineProperty(namespace, 'apps', {\n get: getApps\n });\n\n /**\n * Called by App.delete() - but before any services associated with the App\n * are deleted.\n */\n function removeApp(name: string): void {\n const app = apps[name];\n callAppHooks(app, 'delete');\n delete apps[name];\n }\n\n /**\n * Get the App object for a given name (or DEFAULT).\n */\n function app(name?: string): FirebaseApp {\n name = name || DEFAULT_ENTRY_NAME;\n if (!contains(apps, name)) {\n error(AppError.NO_APP, { name: name });\n }\n return apps[name];\n }\n\n patchProperty(app, 'App', firebaseAppImpl);\n /**\n * Create a new App instance (name must be unique).\n */\n function initializeApp(\n options: FirebaseOptions,\n config?: FirebaseAppConfig\n ): FirebaseApp;\n function initializeApp(options: FirebaseOptions, name?: string): FirebaseApp;\n function initializeApp(options: FirebaseOptions, rawConfig = {}) {\n if (typeof rawConfig !== 'object' || rawConfig === null) {\n const name = rawConfig;\n rawConfig = { name };\n }\n\n const config = rawConfig as FirebaseAppConfig;\n\n if (config.name === undefined) {\n config.name = DEFAULT_ENTRY_NAME;\n }\n\n const { name } = config;\n\n if (typeof name !== 'string' || !name) {\n error(AppError.BAD_APP_NAME, { name: String(name) });\n }\n\n if (contains(apps, name)) {\n error(AppError.DUPLICATE_APP, { name: name });\n }\n\n const app = new firebaseAppImpl(\n options,\n config,\n namespace as _FirebaseNamespace\n );\n\n apps[name] = app;\n callAppHooks(app, 'create');\n\n return app;\n }\n\n /*\n * Return an array of all the non-deleted FirebaseApps.\n */\n function getApps(): FirebaseApp[] {\n // Make a copy so caller cannot mutate the apps list.\n return Object.keys(apps).map(name => apps[name]);\n }\n\n /*\n * Register a Firebase Service.\n *\n * firebase.INTERNAL.registerService()\n *\n * TODO: Implement serviceProperties.\n */\n function registerService(\n name: string,\n createService: FirebaseServiceFactory,\n serviceProperties?: { [prop: string]: unknown },\n appHook?: AppHook,\n allowMultipleInstances = false\n ): FirebaseServiceNamespace<FirebaseService> {\n // Cannot re-register a service that already exists\n if (factories[name]) {\n error(AppError.DUPLICATE_SERVICE, { name: name });\n }\n\n // Capture the service factory for later service instantiation\n factories[name] = createService;\n\n // Capture the appHook, if passed\n if (appHook) {\n appHooks[name] = appHook;\n\n // Run the **new** app hook on all existing apps\n getApps().forEach(app => {\n appHook('create', app);\n });\n }\n\n // The Service namespace is an accessor function ...\n function serviceNamespace(appArg: FirebaseApp = app()) {\n if (typeof appArg[name] !== 'function') {\n // Invalid argument.\n // This happens in the following case: firebase.storage('gs:/')\n error(AppError.INVALID_APP_ARGUMENT, { name: name });\n }\n\n // Forward service instance lookup to the FirebaseApp.\n return appArg[name]();\n }\n\n // ... and a container for service-level properties.\n if (serviceProperties !== undefined) {\n deepExtend(serviceNamespace, serviceProperties);\n }\n\n // Monkey-patch the serviceNamespace onto the firebase namespace\n namespace[name] = serviceNamespace;\n\n // Patch the FirebaseAppImpl prototype\n firebaseAppImpl.prototype[name] = function(...args) {\n const serviceFxn = this._getService.bind(this, name);\n return serviceFxn.apply(this, allowMultipleInstances ? args : []);\n };\n\n return serviceNamespace;\n }\n\n function callAppHooks(app: FirebaseApp, eventName: string) {\n for (const serviceName of Object.keys(factories)) {\n // Ignore virtual services\n const factoryName = useAsService(app, serviceName);\n if (factoryName === null) {\n return;\n }\n\n if (appHooks[factoryName]) {\n appHooks[factoryName](eventName, app);\n }\n }\n }\n\n // Map the requested service to a registered service name\n // (used to map auth to serverAuth service when needed).\n function useAsService(app: FirebaseApp, name: string): string | null {\n if (name === 'serverAuth') {\n return null;\n }\n\n const useService = name;\n const options = app.options;\n\n return useService;\n }\n\n return namespace;\n}\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { FirebaseNamespace } from '@firebase/app-types';\nimport {\n _FirebaseApp,\n _FirebaseNamespace,\n FirebaseServiceFactory,\n AppHook\n} from '@firebase/app-types/private';\nimport { FirebaseAppLiteImpl } from './firebaseAppLite';\nimport { createFirebaseNamespaceCore } from '../firebaseNamespaceCore';\n\nexport function createFirebaseNamespaceLite(): FirebaseNamespace {\n const namespace = createFirebaseNamespaceCore(FirebaseAppLiteImpl);\n\n namespace.SDK_VERSION = '${JSCORE_VERSION}_LITE';\n\n const registerService = (namespace as _FirebaseNamespace).INTERNAL\n .registerService;\n (namespace as _FirebaseNamespace).INTERNAL.registerService = registerServiceForLite;\n\n /**\n * This is a special implementation, so it only works with performance.\n * only allow performance SDK to register.\n */\n function registerServiceForLite(\n name: string,\n createService: FirebaseServiceFactory,\n serviceProperties?: { [prop: string]: any },\n appHook?: AppHook,\n allowMultipleInstances?: boolean\n ) {\n // only allow performance to register with firebase lite\n if (name !== 'performance' && name !== 'installations') {\n throw Error(`${name} cannot register with the standalone perf instance`);\n }\n\n return registerService(\n name,\n createService,\n serviceProperties,\n appHook,\n allowMultipleInstances\n );\n }\n\n return namespace;\n}\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createFirebaseNamespaceLite } from './src/lite/firebaseNamespaceLite';\n\nexport const firebase = createFirebaseNamespaceLite();\n\nexport default firebase;\n"],"names":[],"mappings":";;AAAA;;;;;;;;;;;;;;;;;AAiBA,AAWA,IAAM,MAAM;IACV,4BACE,+CAA+C;QAC/C,mCAAmC;IACrC,wCAAyB,4BAA4B;IACrD,0CAA0B,6CAA6C;IACvE,sCAAwB,8CAA8C;IACtE,kDACE,qDAAqD;IACvD,wDACE,mDAAmD;QACnD,wBAAwB;OAC3B,CAAC;AAEF,IAAM,SAAS,G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;;;;;;;;;;;;;AAwBA,SAGgB,2BAA2B;IACzC,IAAM,SAAS,GAAG,2BAA2B,CAAC,mBAAmB,CAAC,CAAC;IAEnE,SAAS,CAAC,WAAW,GAAG,aAAwB,CAAC;IAEjD,IAAM,eAAe,GAAI,SAAgC,CAAC,QAAQ;SAC/D,eAAe,CAAC;IAClB,SAAgC,CAAC,QAAQ,CAAC,eAAe,GAAG,sBAAsB,CAAC;;;;;IAMpF,SAAS,sBAAsB,CAC7B,IAAY,EACZ,aAAqC,EACrC,iBAA2C,EAC3C,OAAiB,EACjB,sBAAgC;;QAGhC,IAAI,IAAI,KAAK,aAAa,IAAI,IAAI,KAAK,eAAe,EAAE;YACtD,MAAM,KAAK,CAAI,IAAI,uDAAoD,CAAC,CAAC;SAC1E;QAED,OAAO,eAAe,CACpB,IAAI,EACJ,aAAa,EACb,iBAAiB,EACjB,OAAO,EACP,sBAAsB,CACvB,CAAC;KACH;IAED,OAAO,SAAS,CAAC;CAClB;;AC9DD;;;;;;;;;;;;;;;;AAiBA,IAEa,QAAQ,GAAG,2BAA2B,EAAE;;;;;"}
@@ -271,7 +271,7 @@ function createFirebaseNamespaceCore(firebaseAppImpl) {
271
271
  app: app,
272
272
  apps: null,
273
273
  Promise: Promise,
274
- SDK_VERSION: '5.11.0-canary.a7bb0b5',
274
+ SDK_VERSION: '5.11.0',
275
275
  INTERNAL: {
276
276
  registerService: registerService,
277
277
  removeApp: removeApp,
@@ -1 +1 @@
1
- {"version":3,"file":"index.node.cjs.js","sources":["../src/errors.ts","../src/constants.ts","../src/firebaseApp.ts","../src/firebaseNamespaceCore.ts","../src/firebaseNamespace.ts","../index.node.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ErrorFactory, ErrorMap } from '@firebase/util';\n\nexport const enum AppError {\n NO_APP = 'no-app',\n BAD_APP_NAME = 'bad-app-name',\n DUPLICATE_APP = 'duplicate-app',\n APP_DELETED = 'app-deleted',\n DUPLICATE_SERVICE = 'duplicate-service',\n INVALID_APP_ARGUMENT = 'invalid-app-argument'\n}\n\nconst ERRORS: ErrorMap<AppError> = {\n [AppError.NO_APP]:\n \"No Firebase App '{$name}' has been created - \" +\n 'call Firebase App.initializeApp()',\n [AppError.BAD_APP_NAME]: \"Illegal App name: '{$name}\",\n [AppError.DUPLICATE_APP]: \"Firebase App named '{$name}' already exists\",\n [AppError.APP_DELETED]: \"Firebase App named '{$name}' already deleted\",\n [AppError.DUPLICATE_SERVICE]:\n \"Firebase service named '{$name}' already registered\",\n [AppError.INVALID_APP_ARGUMENT]:\n 'firebase.{$name}() takes either no argument or a ' +\n 'Firebase App instance.'\n};\n\nconst appErrors = new ErrorFactory<AppError>('app', 'Firebase', ERRORS);\n\nexport function error(code: AppError, args?: { [name: string]: any }) {\n throw appErrors.create(code, args);\n}\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport const DEFAULT_ENTRY_NAME = '[DEFAULT]';\n","/**\n * @license\n * Copyright 2017 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n FirebaseApp,\n FirebaseOptions,\n FirebaseAppConfig\n} from '@firebase/app-types';\nimport {\n _FirebaseApp,\n _FirebaseNamespace,\n FirebaseService,\n FirebaseAppInternals\n} from '@firebase/app-types/private';\nimport { deepCopy, deepExtend } from '@firebase/util';\nimport { error, AppError } from './errors';\nimport { DEFAULT_ENTRY_NAME } from './constants';\n\ninterface ServicesCache {\n [name: string]: {\n [serviceName: string]: FirebaseService;\n };\n}\n\n// An array to capture listeners before the true auth functions\n// exist\nlet tokenListeners: any[] = [];\n\n/**\n * Global context object for a collection of services using\n * a shared authentication state.\n */\nexport class FirebaseAppImpl implements FirebaseApp {\n private readonly options_: FirebaseOptions;\n private readonly name_: string;\n private isDeleted_ = false;\n private services_: ServicesCache = {};\n private automaticDataCollectionEnabled_: boolean;\n\n INTERNAL: FirebaseAppInternals;\n\n constructor(\n options: FirebaseOptions,\n config: FirebaseAppConfig,\n private readonly firebase_: _FirebaseNamespace\n ) {\n this.name_ = config.name!;\n this.automaticDataCollectionEnabled_ =\n config.automaticDataCollectionEnabled || false;\n this.options_ = deepCopy<FirebaseOptions>(options);\n this.INTERNAL = {\n getUid: () => null,\n getToken: () => Promise.resolve(null),\n addAuthTokenListener: (callback: (token: string | null) => void) => {\n tokenListeners.push(callback);\n // Make sure callback is called, asynchronously, in the absence of the auth module\n setTimeout(() => callback(null), 0);\n },\n removeAuthTokenListener: callback => {\n tokenListeners = tokenListeners.filter(\n listener => listener !== callback\n );\n }\n };\n }\n\n get automaticDataCollectionEnabled(): boolean {\n this.checkDestroyed_();\n return this.automaticDataCollectionEnabled_;\n }\n\n set automaticDataCollectionEnabled(val) {\n this.checkDestroyed_();\n this.automaticDataCollectionEnabled_ = val;\n }\n\n get name(): string {\n this.checkDestroyed_();\n return this.name_;\n }\n\n get options(): FirebaseOptions {\n this.checkDestroyed_();\n return this.options_;\n }\n\n delete(): Promise<void> {\n return new Promise(resolve => {\n this.checkDestroyed_();\n resolve();\n })\n .then(() => {\n this.firebase_.INTERNAL.removeApp(this.name_);\n const services: FirebaseService[] = [];\n\n for (const serviceKey of Object.keys(this.services_)) {\n for (const instanceKey of Object.keys(this.services_[serviceKey])) {\n services.push(this.services_[serviceKey][instanceKey]);\n }\n }\n\n return Promise.all(\n services.map(service => {\n return service.INTERNAL.delete();\n })\n );\n })\n .then(\n (): void => {\n this.isDeleted_ = true;\n this.services_ = {};\n }\n );\n }\n\n /**\n * Return a service instance associated with this app (creating it\n * on demand), identified by the passed instanceIdentifier.\n *\n * NOTE: Currently storage is the only one that is leveraging this\n * functionality. They invoke it by calling:\n *\n * ```javascript\n * firebase.app().storage('STORAGE BUCKET ID')\n * ```\n *\n * The service name is passed to this already\n * @internal\n */\n _getService(\n name: string,\n instanceIdentifier: string = DEFAULT_ENTRY_NAME\n ): FirebaseService {\n this.checkDestroyed_();\n\n if (!this.services_[name]) {\n this.services_[name] = {};\n }\n\n if (!this.services_[name][instanceIdentifier]) {\n /**\n * If a custom instance has been defined (i.e. not '[DEFAULT]')\n * then we will pass that instance on, otherwise we pass `null`\n */\n const instanceSpecifier =\n instanceIdentifier !== DEFAULT_ENTRY_NAME\n ? instanceIdentifier\n : undefined;\n const service = this.firebase_.INTERNAL.factories[name](\n this,\n this.extendApp.bind(this),\n instanceSpecifier\n );\n this.services_[name][instanceIdentifier] = service;\n }\n\n return this.services_[name][instanceIdentifier];\n }\n\n /**\n * Callback function used to extend an App instance at the time\n * of service instance creation.\n */\n private extendApp(props: { [name: string]: any }): void {\n // Copy the object onto the FirebaseAppImpl prototype\n deepExtend(this, props);\n\n /**\n * If the app has overwritten the addAuthTokenListener stub, forward\n * the active token listeners on to the true fxn.\n *\n * TODO: This function is required due to our current module\n * structure. Once we are able to rely strictly upon a single module\n * implementation, this code should be refactored and Auth should\n * provide these stubs and the upgrade logic\n */\n if (props.INTERNAL && props.INTERNAL.addAuthTokenListener) {\n tokenListeners.forEach(listener => {\n this.INTERNAL.addAuthTokenListener(listener);\n });\n tokenListeners = [];\n }\n }\n\n /**\n * This function will throw an Error if the App has already been deleted -\n * use before performing API actions on the App.\n */\n private checkDestroyed_(): void {\n if (this.isDeleted_) {\n error(AppError.APP_DELETED, { name: this.name_ });\n }\n }\n}\n\n// Prevent dead-code elimination of these methods w/o invalid property\n// copying.\n(FirebaseAppImpl.prototype.name && FirebaseAppImpl.prototype.options) ||\n FirebaseAppImpl.prototype.delete ||\n console.log('dc');\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n FirebaseApp,\n FirebaseOptions,\n FirebaseNamespace,\n FirebaseAppConfig\n} from '@firebase/app-types';\nimport {\n _FirebaseApp,\n _FirebaseNamespace,\n FirebaseService,\n FirebaseServiceFactory,\n FirebaseServiceNamespace,\n AppHook\n} from '@firebase/app-types/private';\nimport { deepExtend, patchProperty } from '@firebase/util';\nimport { FirebaseAppImpl } from './firebaseApp';\nimport { error, AppError } from './errors';\nimport { FirebaseAppLiteImpl } from './lite/firebaseAppLite';\nimport { DEFAULT_ENTRY_NAME } from './constants';\n\nfunction contains(obj: object, key: string) {\n return Object.prototype.hasOwnProperty.call(obj, key);\n}\n\n/**\n * Because auth can't share code with other components, we attach the utility functions\n * in an internal namespace to share code.\n * This function return a firebase namespace object without\n * any utility functions, so it can be shared between the regular firebaseNamespace and\n * the lite version.\n */\nexport function createFirebaseNamespaceCore(\n firebaseAppImpl: typeof FirebaseAppImpl | typeof FirebaseAppLiteImpl\n): FirebaseNamespace {\n const apps: { [name: string]: FirebaseApp } = {};\n const factories: { [service: string]: FirebaseServiceFactory } = {};\n const appHooks: { [service: string]: AppHook } = {};\n\n // A namespace is a plain JavaScript Object.\n const namespace: FirebaseNamespace = {\n // Hack to prevent Babel from modifying the object returned\n // as the firebase namespace.\n // @ts-ignore\n __esModule: true,\n initializeApp: initializeApp,\n app: app as any,\n apps: null as any,\n Promise: Promise,\n SDK_VERSION: '${JSCORE_VERSION}',\n INTERNAL: {\n registerService,\n removeApp,\n factories,\n useAsService\n }\n };\n\n // Inject a circular default export to allow Babel users who were previously\n // using:\n //\n // import firebase from 'firebase';\n // which becomes: var firebase = require('firebase').default;\n //\n // instead of\n //\n // import * as firebase from 'firebase';\n // which becomes: var firebase = require('firebase');\n patchProperty(namespace, 'default', namespace);\n\n // firebase.apps is a read-only getter.\n Object.defineProperty(namespace, 'apps', {\n get: getApps\n });\n\n /**\n * Called by App.delete() - but before any services associated with the App\n * are deleted.\n */\n function removeApp(name: string): void {\n const app = apps[name];\n callAppHooks(app, 'delete');\n delete apps[name];\n }\n\n /**\n * Get the App object for a given name (or DEFAULT).\n */\n function app(name?: string): FirebaseApp {\n name = name || DEFAULT_ENTRY_NAME;\n if (!contains(apps, name)) {\n error(AppError.NO_APP, { name: name });\n }\n return apps[name];\n }\n\n patchProperty(app, 'App', firebaseAppImpl);\n /**\n * Create a new App instance (name must be unique).\n */\n function initializeApp(\n options: FirebaseOptions,\n config?: FirebaseAppConfig\n ): FirebaseApp;\n function initializeApp(options: FirebaseOptions, name?: string): FirebaseApp;\n function initializeApp(options: FirebaseOptions, rawConfig = {}) {\n if (typeof rawConfig !== 'object' || rawConfig === null) {\n const name = rawConfig;\n rawConfig = { name };\n }\n\n const config = rawConfig as FirebaseAppConfig;\n\n if (config.name === undefined) {\n config.name = DEFAULT_ENTRY_NAME;\n }\n\n const { name } = config;\n\n if (typeof name !== 'string' || !name) {\n error(AppError.BAD_APP_NAME, { name: String(name) });\n }\n\n if (contains(apps, name)) {\n error(AppError.DUPLICATE_APP, { name: name });\n }\n\n const app = new firebaseAppImpl(\n options,\n config,\n namespace as _FirebaseNamespace\n );\n\n apps[name] = app;\n callAppHooks(app, 'create');\n\n return app;\n }\n\n /*\n * Return an array of all the non-deleted FirebaseApps.\n */\n function getApps(): FirebaseApp[] {\n // Make a copy so caller cannot mutate the apps list.\n return Object.keys(apps).map(name => apps[name]);\n }\n\n /*\n * Register a Firebase Service.\n *\n * firebase.INTERNAL.registerService()\n *\n * TODO: Implement serviceProperties.\n */\n function registerService(\n name: string,\n createService: FirebaseServiceFactory,\n serviceProperties?: { [prop: string]: unknown },\n appHook?: AppHook,\n allowMultipleInstances = false\n ): FirebaseServiceNamespace<FirebaseService> {\n // Cannot re-register a service that already exists\n if (factories[name]) {\n error(AppError.DUPLICATE_SERVICE, { name: name });\n }\n\n // Capture the service factory for later service instantiation\n factories[name] = createService;\n\n // Capture the appHook, if passed\n if (appHook) {\n appHooks[name] = appHook;\n\n // Run the **new** app hook on all existing apps\n getApps().forEach(app => {\n appHook('create', app);\n });\n }\n\n // The Service namespace is an accessor function ...\n function serviceNamespace(appArg: FirebaseApp = app()) {\n if (typeof appArg[name] !== 'function') {\n // Invalid argument.\n // This happens in the following case: firebase.storage('gs:/')\n error(AppError.INVALID_APP_ARGUMENT, { name: name });\n }\n\n // Forward service instance lookup to the FirebaseApp.\n return appArg[name]();\n }\n\n // ... and a container for service-level properties.\n if (serviceProperties !== undefined) {\n deepExtend(serviceNamespace, serviceProperties);\n }\n\n // Monkey-patch the serviceNamespace onto the firebase namespace\n namespace[name] = serviceNamespace;\n\n // Patch the FirebaseAppImpl prototype\n firebaseAppImpl.prototype[name] = function(...args) {\n const serviceFxn = this._getService.bind(this, name);\n return serviceFxn.apply(this, allowMultipleInstances ? args : []);\n };\n\n return serviceNamespace;\n }\n\n function callAppHooks(app: FirebaseApp, eventName: string) {\n for (const serviceName of Object.keys(factories)) {\n // Ignore virtual services\n const factoryName = useAsService(app, serviceName);\n if (factoryName === null) {\n return;\n }\n\n if (appHooks[factoryName]) {\n appHooks[factoryName](eventName, app);\n }\n }\n }\n\n // Map the requested service to a registered service name\n // (used to map auth to serverAuth service when needed).\n function useAsService(app: FirebaseApp, name: string): string | null {\n if (name === 'serverAuth') {\n return null;\n }\n\n const useService = name;\n const options = app.options;\n\n return useService;\n }\n\n return namespace;\n}\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { FirebaseNamespace } from '@firebase/app-types';\nimport { _FirebaseApp, _FirebaseNamespace } from '@firebase/app-types/private';\nimport { createSubscribe, deepExtend, ErrorFactory } from '@firebase/util';\nimport { FirebaseAppImpl } from './firebaseApp';\nimport { createFirebaseNamespaceCore } from './firebaseNamespaceCore';\n\n/**\n * Return a firebase namespace object.\n *\n * In production, this will be called exactly once and the result\n * assigned to the 'firebase' global. It may be called multiple times\n * in unit tests.\n */\nexport function createFirebaseNamespace(): FirebaseNamespace {\n const namespace = createFirebaseNamespaceCore(FirebaseAppImpl);\n (namespace as _FirebaseNamespace).INTERNAL = {\n ...(namespace as _FirebaseNamespace).INTERNAL,\n createFirebaseNamespace: createFirebaseNamespace,\n extendNamespace: extendNamespace,\n createSubscribe: createSubscribe,\n ErrorFactory: ErrorFactory,\n deepExtend: deepExtend\n };\n\n /**\n * Patch the top-level firebase namespace with additional properties.\n *\n * firebase.INTERNAL.extendNamespace()\n */\n function extendNamespace(props: { [prop: string]: unknown }): void {\n deepExtend(namespace, props);\n }\n\n return namespace;\n}\n","/**\n * @license\n * Copyright 2017 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { FirebaseNamespace } from '@firebase/app-types';\nimport { _FirebaseNamespace } from '@firebase/app-types/private';\nimport { createFirebaseNamespace } from './src/firebaseNamespace';\nimport Storage from 'dom-storage';\nimport { XMLHttpRequest } from 'xmlhttprequest';\n\nconst _firebase = createFirebaseNamespace() as _FirebaseNamespace;\n\n_firebase.INTERNAL.extendNamespace({\n INTERNAL: {\n node: {\n localStorage: new Storage(null, { strict: true }),\n sessionStorage: new Storage(null, { strict: true }),\n XMLHttpRequest\n }\n }\n});\n\nexport const firebase = _firebase as FirebaseNamespace;\n\nexport default firebase;\n"],"names":["ErrorFactory","deepCopy","deepExtend","patchProperty","createSubscribe"],"mappings":";;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;AAiBA,AAWA,IAAM,MAAM;IACV,4BACE,+CAA+C;QAC/C,mCAAmC;IACrC,wCAAyB,4BAA4B;IACrD,0CAA0B,6CAA6C;IACvE,sCAAwB,8CAA8C;IACtE,kDACE,qDAAqD;IACvD,wDACE,mDAAmD;QACnD,wBAAwB;OAC3B,CAAC;AAEF,IAAM,SAAS,GAAG,IAAIA,iBAAY,CAAW,KAAK,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC;AAExE,SAAgB,KAAK,CAAC,IAAc,EAAE,IAA8B;IAClE,MAAM,SAAS,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;CACpC;;AC9CD;;;;;;;;;;;;;;;;AAiBA,AAAO,IAAM,kBAAkB,GAAG,W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C,eAAe,CAAC;IACjC,QAAQ,EAAE;QACR,IAAI,EAAE;YACJ,YAAY,EAAE,IAAI,OAAO,CAAC,IAAI,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;YACjD,cAAc,EAAE,IAAI,OAAO,CAAC,IAAI,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;YACnD,cAAc,+BAAA;SACf;KACF;CACF,CAAC,CAAC;AAEH,IAAa,QAAQ,GAAG,SAA8B;;;;;"}
1
+ {"version":3,"file":"index.node.cjs.js","sources":["../src/errors.ts","../src/constants.ts","../src/firebaseApp.ts","../src/firebaseNamespaceCore.ts","../src/firebaseNamespace.ts","../index.node.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ErrorFactory, ErrorMap } from '@firebase/util';\n\nexport const enum AppError {\n NO_APP = 'no-app',\n BAD_APP_NAME = 'bad-app-name',\n DUPLICATE_APP = 'duplicate-app',\n APP_DELETED = 'app-deleted',\n DUPLICATE_SERVICE = 'duplicate-service',\n INVALID_APP_ARGUMENT = 'invalid-app-argument'\n}\n\nconst ERRORS: ErrorMap<AppError> = {\n [AppError.NO_APP]:\n \"No Firebase App '{$name}' has been created - \" +\n 'call Firebase App.initializeApp()',\n [AppError.BAD_APP_NAME]: \"Illegal App name: '{$name}\",\n [AppError.DUPLICATE_APP]: \"Firebase App named '{$name}' already exists\",\n [AppError.APP_DELETED]: \"Firebase App named '{$name}' already deleted\",\n [AppError.DUPLICATE_SERVICE]:\n \"Firebase service named '{$name}' already registered\",\n [AppError.INVALID_APP_ARGUMENT]:\n 'firebase.{$name}() takes either no argument or a ' +\n 'Firebase App instance.'\n};\n\nconst appErrors = new ErrorFactory<AppError>('app', 'Firebase', ERRORS);\n\nexport function error(code: AppError, args?: { [name: string]: any }) {\n throw appErrors.create(code, args);\n}\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport const DEFAULT_ENTRY_NAME = '[DEFAULT]';\n","/**\n * @license\n * Copyright 2017 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n FirebaseApp,\n FirebaseOptions,\n FirebaseAppConfig\n} from '@firebase/app-types';\nimport {\n _FirebaseApp,\n _FirebaseNamespace,\n FirebaseService,\n FirebaseAppInternals\n} from '@firebase/app-types/private';\nimport { deepCopy, deepExtend } from '@firebase/util';\nimport { error, AppError } from './errors';\nimport { DEFAULT_ENTRY_NAME } from './constants';\n\ninterface ServicesCache {\n [name: string]: {\n [serviceName: string]: FirebaseService;\n };\n}\n\n// An array to capture listeners before the true auth functions\n// exist\nlet tokenListeners: any[] = [];\n\n/**\n * Global context object for a collection of services using\n * a shared authentication state.\n */\nexport class FirebaseAppImpl implements FirebaseApp {\n private readonly options_: FirebaseOptions;\n private readonly name_: string;\n private isDeleted_ = false;\n private services_: ServicesCache = {};\n private automaticDataCollectionEnabled_: boolean;\n\n INTERNAL: FirebaseAppInternals;\n\n constructor(\n options: FirebaseOptions,\n config: FirebaseAppConfig,\n private readonly firebase_: _FirebaseNamespace\n ) {\n this.name_ = config.name!;\n this.automaticDataCollectionEnabled_ =\n config.automaticDataCollectionEnabled || false;\n this.options_ = deepCopy<FirebaseOptions>(options);\n this.INTERNAL = {\n getUid: () => null,\n getToken: () => Promise.resolve(null),\n addAuthTokenListener: (callback: (token: string | null) => void) => {\n tokenListeners.push(callback);\n // Make sure callback is called, asynchronously, in the absence of the auth module\n setTimeout(() => callback(null), 0);\n },\n removeAuthTokenListener: callback => {\n tokenListeners = tokenListeners.filter(\n listener => listener !== callback\n );\n }\n };\n }\n\n get automaticDataCollectionEnabled(): boolean {\n this.checkDestroyed_();\n return this.automaticDataCollectionEnabled_;\n }\n\n set automaticDataCollectionEnabled(val) {\n this.checkDestroyed_();\n this.automaticDataCollectionEnabled_ = val;\n }\n\n get name(): string {\n this.checkDestroyed_();\n return this.name_;\n }\n\n get options(): FirebaseOptions {\n this.checkDestroyed_();\n return this.options_;\n }\n\n delete(): Promise<void> {\n return new Promise(resolve => {\n this.checkDestroyed_();\n resolve();\n })\n .then(() => {\n this.firebase_.INTERNAL.removeApp(this.name_);\n const services: FirebaseService[] = [];\n\n for (const serviceKey of Object.keys(this.services_)) {\n for (const instanceKey of Object.keys(this.services_[serviceKey])) {\n services.push(this.services_[serviceKey][instanceKey]);\n }\n }\n\n return Promise.all(\n services.map(service => {\n return service.INTERNAL.delete();\n })\n );\n })\n .then(\n (): void => {\n this.isDeleted_ = true;\n this.services_ = {};\n }\n );\n }\n\n /**\n * Return a service instance associated with this app (creating it\n * on demand), identified by the passed instanceIdentifier.\n *\n * NOTE: Currently storage is the only one that is leveraging this\n * functionality. They invoke it by calling:\n *\n * ```javascript\n * firebase.app().storage('STORAGE BUCKET ID')\n * ```\n *\n * The service name is passed to this already\n * @internal\n */\n _getService(\n name: string,\n instanceIdentifier: string = DEFAULT_ENTRY_NAME\n ): FirebaseService {\n this.checkDestroyed_();\n\n if (!this.services_[name]) {\n this.services_[name] = {};\n }\n\n if (!this.services_[name][instanceIdentifier]) {\n /**\n * If a custom instance has been defined (i.e. not '[DEFAULT]')\n * then we will pass that instance on, otherwise we pass `null`\n */\n const instanceSpecifier =\n instanceIdentifier !== DEFAULT_ENTRY_NAME\n ? instanceIdentifier\n : undefined;\n const service = this.firebase_.INTERNAL.factories[name](\n this,\n this.extendApp.bind(this),\n instanceSpecifier\n );\n this.services_[name][instanceIdentifier] = service;\n }\n\n return this.services_[name][instanceIdentifier];\n }\n\n /**\n * Callback function used to extend an App instance at the time\n * of service instance creation.\n */\n private extendApp(props: { [name: string]: any }): void {\n // Copy the object onto the FirebaseAppImpl prototype\n deepExtend(this, props);\n\n /**\n * If the app has overwritten the addAuthTokenListener stub, forward\n * the active token listeners on to the true fxn.\n *\n * TODO: This function is required due to our current module\n * structure. Once we are able to rely strictly upon a single module\n * implementation, this code should be refactored and Auth should\n * provide these stubs and the upgrade logic\n */\n if (props.INTERNAL && props.INTERNAL.addAuthTokenListener) {\n tokenListeners.forEach(listener => {\n this.INTERNAL.addAuthTokenListener(listener);\n });\n tokenListeners = [];\n }\n }\n\n /**\n * This function will throw an Error if the App has already been deleted -\n * use before performing API actions on the App.\n */\n private checkDestroyed_(): void {\n if (this.isDeleted_) {\n error(AppError.APP_DELETED, { name: this.name_ });\n }\n }\n}\n\n// Prevent dead-code elimination of these methods w/o invalid property\n// copying.\n(FirebaseAppImpl.prototype.name && FirebaseAppImpl.prototype.options) ||\n FirebaseAppImpl.prototype.delete ||\n console.log('dc');\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n FirebaseApp,\n FirebaseOptions,\n FirebaseNamespace,\n FirebaseAppConfig\n} from '@firebase/app-types';\nimport {\n _FirebaseApp,\n _FirebaseNamespace,\n FirebaseService,\n FirebaseServiceFactory,\n FirebaseServiceNamespace,\n AppHook\n} from '@firebase/app-types/private';\nimport { deepExtend, patchProperty } from '@firebase/util';\nimport { FirebaseAppImpl } from './firebaseApp';\nimport { error, AppError } from './errors';\nimport { FirebaseAppLiteImpl } from './lite/firebaseAppLite';\nimport { DEFAULT_ENTRY_NAME } from './constants';\n\nfunction contains(obj: object, key: string) {\n return Object.prototype.hasOwnProperty.call(obj, key);\n}\n\n/**\n * Because auth can't share code with other components, we attach the utility functions\n * in an internal namespace to share code.\n * This function return a firebase namespace object without\n * any utility functions, so it can be shared between the regular firebaseNamespace and\n * the lite version.\n */\nexport function createFirebaseNamespaceCore(\n firebaseAppImpl: typeof FirebaseAppImpl | typeof FirebaseAppLiteImpl\n): FirebaseNamespace {\n const apps: { [name: string]: FirebaseApp } = {};\n const factories: { [service: string]: FirebaseServiceFactory } = {};\n const appHooks: { [service: string]: AppHook } = {};\n\n // A namespace is a plain JavaScript Object.\n const namespace: FirebaseNamespace = {\n // Hack to prevent Babel from modifying the object returned\n // as the firebase namespace.\n // @ts-ignore\n __esModule: true,\n initializeApp: initializeApp,\n app: app as any,\n apps: null as any,\n Promise: Promise,\n SDK_VERSION: '${JSCORE_VERSION}',\n INTERNAL: {\n registerService,\n removeApp,\n factories,\n useAsService\n }\n };\n\n // Inject a circular default export to allow Babel users who were previously\n // using:\n //\n // import firebase from 'firebase';\n // which becomes: var firebase = require('firebase').default;\n //\n // instead of\n //\n // import * as firebase from 'firebase';\n // which becomes: var firebase = require('firebase');\n patchProperty(namespace, 'default', namespace);\n\n // firebase.apps is a read-only getter.\n Object.defineProperty(namespace, 'apps', {\n get: getApps\n });\n\n /**\n * Called by App.delete() - but before any services associated with the App\n * are deleted.\n */\n function removeApp(name: string): void {\n const app = apps[name];\n callAppHooks(app, 'delete');\n delete apps[name];\n }\n\n /**\n * Get the App object for a given name (or DEFAULT).\n */\n function app(name?: string): FirebaseApp {\n name = name || DEFAULT_ENTRY_NAME;\n if (!contains(apps, name)) {\n error(AppError.NO_APP, { name: name });\n }\n return apps[name];\n }\n\n patchProperty(app, 'App', firebaseAppImpl);\n /**\n * Create a new App instance (name must be unique).\n */\n function initializeApp(\n options: FirebaseOptions,\n config?: FirebaseAppConfig\n ): FirebaseApp;\n function initializeApp(options: FirebaseOptions, name?: string): FirebaseApp;\n function initializeApp(options: FirebaseOptions, rawConfig = {}) {\n if (typeof rawConfig !== 'object' || rawConfig === null) {\n const name = rawConfig;\n rawConfig = { name };\n }\n\n const config = rawConfig as FirebaseAppConfig;\n\n if (config.name === undefined) {\n config.name = DEFAULT_ENTRY_NAME;\n }\n\n const { name } = config;\n\n if (typeof name !== 'string' || !name) {\n error(AppError.BAD_APP_NAME, { name: String(name) });\n }\n\n if (contains(apps, name)) {\n error(AppError.DUPLICATE_APP, { name: name });\n }\n\n const app = new firebaseAppImpl(\n options,\n config,\n namespace as _FirebaseNamespace\n );\n\n apps[name] = app;\n callAppHooks(app, 'create');\n\n return app;\n }\n\n /*\n * Return an array of all the non-deleted FirebaseApps.\n */\n function getApps(): FirebaseApp[] {\n // Make a copy so caller cannot mutate the apps list.\n return Object.keys(apps).map(name => apps[name]);\n }\n\n /*\n * Register a Firebase Service.\n *\n * firebase.INTERNAL.registerService()\n *\n * TODO: Implement serviceProperties.\n */\n function registerService(\n name: string,\n createService: FirebaseServiceFactory,\n serviceProperties?: { [prop: string]: unknown },\n appHook?: AppHook,\n allowMultipleInstances = false\n ): FirebaseServiceNamespace<FirebaseService> {\n // Cannot re-register a service that already exists\n if (factories[name]) {\n error(AppError.DUPLICATE_SERVICE, { name: name });\n }\n\n // Capture the service factory for later service instantiation\n factories[name] = createService;\n\n // Capture the appHook, if passed\n if (appHook) {\n appHooks[name] = appHook;\n\n // Run the **new** app hook on all existing apps\n getApps().forEach(app => {\n appHook('create', app);\n });\n }\n\n // The Service namespace is an accessor function ...\n function serviceNamespace(appArg: FirebaseApp = app()) {\n if (typeof appArg[name] !== 'function') {\n // Invalid argument.\n // This happens in the following case: firebase.storage('gs:/')\n error(AppError.INVALID_APP_ARGUMENT, { name: name });\n }\n\n // Forward service instance lookup to the FirebaseApp.\n return appArg[name]();\n }\n\n // ... and a container for service-level properties.\n if (serviceProperties !== undefined) {\n deepExtend(serviceNamespace, serviceProperties);\n }\n\n // Monkey-patch the serviceNamespace onto the firebase namespace\n namespace[name] = serviceNamespace;\n\n // Patch the FirebaseAppImpl prototype\n firebaseAppImpl.prototype[name] = function(...args) {\n const serviceFxn = this._getService.bind(this, name);\n return serviceFxn.apply(this, allowMultipleInstances ? args : []);\n };\n\n return serviceNamespace;\n }\n\n function callAppHooks(app: FirebaseApp, eventName: string) {\n for (const serviceName of Object.keys(factories)) {\n // Ignore virtual services\n const factoryName = useAsService(app, serviceName);\n if (factoryName === null) {\n return;\n }\n\n if (appHooks[factoryName]) {\n appHooks[factoryName](eventName, app);\n }\n }\n }\n\n // Map the requested service to a registered service name\n // (used to map auth to serverAuth service when needed).\n function useAsService(app: FirebaseApp, name: string): string | null {\n if (name === 'serverAuth') {\n return null;\n }\n\n const useService = name;\n const options = app.options;\n\n return useService;\n }\n\n return namespace;\n}\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { FirebaseNamespace } from '@firebase/app-types';\nimport { _FirebaseApp, _FirebaseNamespace } from '@firebase/app-types/private';\nimport { createSubscribe, deepExtend, ErrorFactory } from '@firebase/util';\nimport { FirebaseAppImpl } from './firebaseApp';\nimport { createFirebaseNamespaceCore } from './firebaseNamespaceCore';\n\n/**\n * Return a firebase namespace object.\n *\n * In production, this will be called exactly once and the result\n * assigned to the 'firebase' global. It may be called multiple times\n * in unit tests.\n */\nexport function createFirebaseNamespace(): FirebaseNamespace {\n const namespace = createFirebaseNamespaceCore(FirebaseAppImpl);\n (namespace as _FirebaseNamespace).INTERNAL = {\n ...(namespace as _FirebaseNamespace).INTERNAL,\n createFirebaseNamespace: createFirebaseNamespace,\n extendNamespace: extendNamespace,\n createSubscribe: createSubscribe,\n ErrorFactory: ErrorFactory,\n deepExtend: deepExtend\n };\n\n /**\n * Patch the top-level firebase namespace with additional properties.\n *\n * firebase.INTERNAL.extendNamespace()\n */\n function extendNamespace(props: { [prop: string]: unknown }): void {\n deepExtend(namespace, props);\n }\n\n return namespace;\n}\n","/**\n * @license\n * Copyright 2017 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { FirebaseNamespace } from '@firebase/app-types';\nimport { _FirebaseNamespace } from '@firebase/app-types/private';\nimport { createFirebaseNamespace } from './src/firebaseNamespace';\nimport Storage from 'dom-storage';\nimport { XMLHttpRequest } from 'xmlhttprequest';\n\nconst _firebase = createFirebaseNamespace() as _FirebaseNamespace;\n\n_firebase.INTERNAL.extendNamespace({\n INTERNAL: {\n node: {\n localStorage: new Storage(null, { strict: true }),\n sessionStorage: new Storage(null, { strict: true }),\n XMLHttpRequest\n }\n }\n});\n\nexport const firebase = _firebase as FirebaseNamespace;\n\nexport default firebase;\n"],"names":["ErrorFactory","deepCopy","deepExtend","patchProperty","createSubscribe"],"mappings":";;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;AAiBA,AAWA,IAAM,MAAM;IACV,4BACE,+CAA+C;QAC/C,mCAAmC;IACrC,wCAAyB,4BAA4B;IACrD,0CAA0B,6CAA6C;IACvE,sCAAwB,8CAA8C;IACtE,kDACE,qDAAqD;IACvD,wDACE,mDAAmD;QACnD,wBAAwB;OAC3B,CAAC;AAEF,IAAM,SAAS,GAAG,IAAIA,iBAAY,CAAW,KAAK,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC;AAExE,SAAgB,KAAK,CAAC,IAAc,EAAE,IAA8B;IAClE,MAAM,SAAS,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;CACpC;;AC9CD;;;;;;;;;;;;;;;;AAiBA,AAAO,IAAM,kBAAkB,GAAG,WAAW,CAAC;;ACjB9C;;;;;;;;;;;;;;;;AA4BA,AAUA;;AAEA,IAAI,cAAc,GAAU,EAAE,CAAC;;;;;AAM/B;IASE,yBACE,OAAwB,EACxB,MAAyB,EACR,SAA6B;QAA7B,cAAS,GAAT,SAAS,CAAoB;QATxC,eAAU,GAAG,KAAK,CAAC;QACnB,cAAS,GAAkB,EAAE,CAAC;QAUpC,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,IAAK,CAAC;QAC1B,IAAI,CAAC,+BAA+B;YAClC,MAAM,CAAC,8BAA8B,IAAI,KAAK,CAAC;QACjD,IAAI,CAAC,QAAQ,GAAGC,aAAQ,CAAkB,OAAO,CAAC,CAAC;QACnD,IAAI,CAAC,QAAQ,GAAG;YACd,MAAM,EAAE,cAAM,OAAA,IAAI,GAAA;YAClB,QAAQ,EAAE,cAAM,OAAA,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,GAAA;YACrC,oBAAoB,EAAE,UAA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CAAC,OAAO,CAAC;QAE5B,OAAO,UAAU,CAAC;KACnB;IAED,OAAO,SAAS,CAAC;CAClB;;AC5PD;;;;;;;;;;;;;;;;AAuBA;;;;;;;AAOA,SAAgB,uBAAuB;IACrC,IAAM,SAAS,GAAG,2BAA2B,CAAC,eAAe,CAAC,CAAC;IAC9D,SAAgC,CAAC,QAAQ,wBACpC,SAAgC,CAAC,QAAQ,IAC7C,uBAAuB,EAAE,uBAAuB,EAChD,eAAe,EAAE,eAAe,EAChC,eAAe,EAAEE,oBAAe,EAChC,YAAY,EAAEJ,iBAAY,EAC1B,UAAU,EAAEE,eAAU,GACvB,CAAC;;;;;;IAOF,SAAS,eAAe,CAAC,KAAkC;QACzDA,eAAU,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;KAC9B;IAED,OAAO,SAAS,CAAC;CAClB;;ACnDD;;;;;;;;;;;;;;;;AAmBA,AAIA,IAAM,SAAS,GAAG,uBAAuB,EAAwB,CAAC;AAElE,SAAS,CAAC,QAAQ,CAAC,eAAe,CAAC;IACjC,QAAQ,EAAE;QACR,IAAI,EAAE;YACJ,YAAY,EAAE,IAAI,OAAO,CAAC,IAAI,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;YACjD,cAAc,EAAE,IAAI,OAAO,CAAC,IAAI,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;YACnD,cAAc,+BAAA;SACf;KACF;CACF,CAAC,CAAC;AAEH,IAAa,QAAQ,GAAG,SAA8B;;;;;"}
@@ -267,7 +267,7 @@ function createFirebaseNamespaceCore(firebaseAppImpl) {
267
267
  app: app,
268
268
  apps: null,
269
269
  Promise: Promise,
270
- SDK_VERSION: '5.11.0-canary.a7bb0b5',
270
+ SDK_VERSION: '5.11.0',
271
271
  INTERNAL: {
272
272
  registerService: registerService,
273
273
  removeApp: removeApp,
@@ -1 +1 @@
1
- {"version":3,"file":"index.rn.cjs.js","sources":["../src/errors.ts","../src/constants.ts","../src/firebaseApp.ts","../src/firebaseNamespaceCore.ts","../src/firebaseNamespace.ts","../index.rn.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ErrorFactory, ErrorMap } from '@firebase/util';\n\nexport const enum AppError {\n NO_APP = 'no-app',\n BAD_APP_NAME = 'bad-app-name',\n DUPLICATE_APP = 'duplicate-app',\n APP_DELETED = 'app-deleted',\n DUPLICATE_SERVICE = 'duplicate-service',\n INVALID_APP_ARGUMENT = 'invalid-app-argument'\n}\n\nconst ERRORS: ErrorMap<AppError> = {\n [AppError.NO_APP]:\n \"No Firebase App '{$name}' has been created - \" +\n 'call Firebase App.initializeApp()',\n [AppError.BAD_APP_NAME]: \"Illegal App name: '{$name}\",\n [AppError.DUPLICATE_APP]: \"Firebase App named '{$name}' already exists\",\n [AppError.APP_DELETED]: \"Firebase App named '{$name}' already deleted\",\n [AppError.DUPLICATE_SERVICE]:\n \"Firebase service named '{$name}' already registered\",\n [AppError.INVALID_APP_ARGUMENT]:\n 'firebase.{$name}() takes either no argument or a ' +\n 'Firebase App instance.'\n};\n\nconst appErrors = new ErrorFactory<AppError>('app', 'Firebase', ERRORS);\n\nexport function error(code: AppError, args?: { [name: string]: any }) {\n throw appErrors.create(code, args);\n}\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport const DEFAULT_ENTRY_NAME = '[DEFAULT]';\n","/**\n * @license\n * Copyright 2017 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n FirebaseApp,\n FirebaseOptions,\n FirebaseAppConfig\n} from '@firebase/app-types';\nimport {\n _FirebaseApp,\n _FirebaseNamespace,\n FirebaseService,\n FirebaseAppInternals\n} from '@firebase/app-types/private';\nimport { deepCopy, deepExtend } from '@firebase/util';\nimport { error, AppError } from './errors';\nimport { DEFAULT_ENTRY_NAME } from './constants';\n\ninterface ServicesCache {\n [name: string]: {\n [serviceName: string]: FirebaseService;\n };\n}\n\n// An array to capture listeners before the true auth functions\n// exist\nlet tokenListeners: any[] = [];\n\n/**\n * Global context object for a collection of services using\n * a shared authentication state.\n */\nexport class FirebaseAppImpl implements FirebaseApp {\n private readonly options_: FirebaseOptions;\n private readonly name_: string;\n private isDeleted_ = false;\n private services_: ServicesCache = {};\n private automaticDataCollectionEnabled_: boolean;\n\n INTERNAL: FirebaseAppInternals;\n\n constructor(\n options: FirebaseOptions,\n config: FirebaseAppConfig,\n private readonly firebase_: _FirebaseNamespace\n ) {\n this.name_ = config.name!;\n this.automaticDataCollectionEnabled_ =\n config.automaticDataCollectionEnabled || false;\n this.options_ = deepCopy<FirebaseOptions>(options);\n this.INTERNAL = {\n getUid: () => null,\n getToken: () => Promise.resolve(null),\n addAuthTokenListener: (callback: (token: string | null) => void) => {\n tokenListeners.push(callback);\n // Make sure callback is called, asynchronously, in the absence of the auth module\n setTimeout(() => callback(null), 0);\n },\n removeAuthTokenListener: callback => {\n tokenListeners = tokenListeners.filter(\n listener => listener !== callback\n );\n }\n };\n }\n\n get automaticDataCollectionEnabled(): boolean {\n this.checkDestroyed_();\n return this.automaticDataCollectionEnabled_;\n }\n\n set automaticDataCollectionEnabled(val) {\n this.checkDestroyed_();\n this.automaticDataCollectionEnabled_ = val;\n }\n\n get name(): string {\n this.checkDestroyed_();\n return this.name_;\n }\n\n get options(): FirebaseOptions {\n this.checkDestroyed_();\n return this.options_;\n }\n\n delete(): Promise<void> {\n return new Promise(resolve => {\n this.checkDestroyed_();\n resolve();\n })\n .then(() => {\n this.firebase_.INTERNAL.removeApp(this.name_);\n const services: FirebaseService[] = [];\n\n for (const serviceKey of Object.keys(this.services_)) {\n for (const instanceKey of Object.keys(this.services_[serviceKey])) {\n services.push(this.services_[serviceKey][instanceKey]);\n }\n }\n\n return Promise.all(\n services.map(service => {\n return service.INTERNAL.delete();\n })\n );\n })\n .then(\n (): void => {\n this.isDeleted_ = true;\n this.services_ = {};\n }\n );\n }\n\n /**\n * Return a service instance associated with this app (creating it\n * on demand), identified by the passed instanceIdentifier.\n *\n * NOTE: Currently storage is the only one that is leveraging this\n * functionality. They invoke it by calling:\n *\n * ```javascript\n * firebase.app().storage('STORAGE BUCKET ID')\n * ```\n *\n * The service name is passed to this already\n * @internal\n */\n _getService(\n name: string,\n instanceIdentifier: string = DEFAULT_ENTRY_NAME\n ): FirebaseService {\n this.checkDestroyed_();\n\n if (!this.services_[name]) {\n this.services_[name] = {};\n }\n\n if (!this.services_[name][instanceIdentifier]) {\n /**\n * If a custom instance has been defined (i.e. not '[DEFAULT]')\n * then we will pass that instance on, otherwise we pass `null`\n */\n const instanceSpecifier =\n instanceIdentifier !== DEFAULT_ENTRY_NAME\n ? instanceIdentifier\n : undefined;\n const service = this.firebase_.INTERNAL.factories[name](\n this,\n this.extendApp.bind(this),\n instanceSpecifier\n );\n this.services_[name][instanceIdentifier] = service;\n }\n\n return this.services_[name][instanceIdentifier];\n }\n\n /**\n * Callback function used to extend an App instance at the time\n * of service instance creation.\n */\n private extendApp(props: { [name: string]: any }): void {\n // Copy the object onto the FirebaseAppImpl prototype\n deepExtend(this, props);\n\n /**\n * If the app has overwritten the addAuthTokenListener stub, forward\n * the active token listeners on to the true fxn.\n *\n * TODO: This function is required due to our current module\n * structure. Once we are able to rely strictly upon a single module\n * implementation, this code should be refactored and Auth should\n * provide these stubs and the upgrade logic\n */\n if (props.INTERNAL && props.INTERNAL.addAuthTokenListener) {\n tokenListeners.forEach(listener => {\n this.INTERNAL.addAuthTokenListener(listener);\n });\n tokenListeners = [];\n }\n }\n\n /**\n * This function will throw an Error if the App has already been deleted -\n * use before performing API actions on the App.\n */\n private checkDestroyed_(): void {\n if (this.isDeleted_) {\n error(AppError.APP_DELETED, { name: this.name_ });\n }\n }\n}\n\n// Prevent dead-code elimination of these methods w/o invalid property\n// copying.\n(FirebaseAppImpl.prototype.name && FirebaseAppImpl.prototype.options) ||\n FirebaseAppImpl.prototype.delete ||\n console.log('dc');\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n FirebaseApp,\n FirebaseOptions,\n FirebaseNamespace,\n FirebaseAppConfig\n} from '@firebase/app-types';\nimport {\n _FirebaseApp,\n _FirebaseNamespace,\n FirebaseService,\n FirebaseServiceFactory,\n FirebaseServiceNamespace,\n AppHook\n} from '@firebase/app-types/private';\nimport { deepExtend, patchProperty } from '@firebase/util';\nimport { FirebaseAppImpl } from './firebaseApp';\nimport { error, AppError } from './errors';\nimport { FirebaseAppLiteImpl } from './lite/firebaseAppLite';\nimport { DEFAULT_ENTRY_NAME } from './constants';\n\nfunction contains(obj: object, key: string) {\n return Object.prototype.hasOwnProperty.call(obj, key);\n}\n\n/**\n * Because auth can't share code with other components, we attach the utility functions\n * in an internal namespace to share code.\n * This function return a firebase namespace object without\n * any utility functions, so it can be shared between the regular firebaseNamespace and\n * the lite version.\n */\nexport function createFirebaseNamespaceCore(\n firebaseAppImpl: typeof FirebaseAppImpl | typeof FirebaseAppLiteImpl\n): FirebaseNamespace {\n const apps: { [name: string]: FirebaseApp } = {};\n const factories: { [service: string]: FirebaseServiceFactory } = {};\n const appHooks: { [service: string]: AppHook } = {};\n\n // A namespace is a plain JavaScript Object.\n const namespace: FirebaseNamespace = {\n // Hack to prevent Babel from modifying the object returned\n // as the firebase namespace.\n // @ts-ignore\n __esModule: true,\n initializeApp: initializeApp,\n app: app as any,\n apps: null as any,\n Promise: Promise,\n SDK_VERSION: '${JSCORE_VERSION}',\n INTERNAL: {\n registerService,\n removeApp,\n factories,\n useAsService\n }\n };\n\n // Inject a circular default export to allow Babel users who were previously\n // using:\n //\n // import firebase from 'firebase';\n // which becomes: var firebase = require('firebase').default;\n //\n // instead of\n //\n // import * as firebase from 'firebase';\n // which becomes: var firebase = require('firebase');\n patchProperty(namespace, 'default', namespace);\n\n // firebase.apps is a read-only getter.\n Object.defineProperty(namespace, 'apps', {\n get: getApps\n });\n\n /**\n * Called by App.delete() - but before any services associated with the App\n * are deleted.\n */\n function removeApp(name: string): void {\n const app = apps[name];\n callAppHooks(app, 'delete');\n delete apps[name];\n }\n\n /**\n * Get the App object for a given name (or DEFAULT).\n */\n function app(name?: string): FirebaseApp {\n name = name || DEFAULT_ENTRY_NAME;\n if (!contains(apps, name)) {\n error(AppError.NO_APP, { name: name });\n }\n return apps[name];\n }\n\n patchProperty(app, 'App', firebaseAppImpl);\n /**\n * Create a new App instance (name must be unique).\n */\n function initializeApp(\n options: FirebaseOptions,\n config?: FirebaseAppConfig\n ): FirebaseApp;\n function initializeApp(options: FirebaseOptions, name?: string): FirebaseApp;\n function initializeApp(options: FirebaseOptions, rawConfig = {}) {\n if (typeof rawConfig !== 'object' || rawConfig === null) {\n const name = rawConfig;\n rawConfig = { name };\n }\n\n const config = rawConfig as FirebaseAppConfig;\n\n if (config.name === undefined) {\n config.name = DEFAULT_ENTRY_NAME;\n }\n\n const { name } = config;\n\n if (typeof name !== 'string' || !name) {\n error(AppError.BAD_APP_NAME, { name: String(name) });\n }\n\n if (contains(apps, name)) {\n error(AppError.DUPLICATE_APP, { name: name });\n }\n\n const app = new firebaseAppImpl(\n options,\n config,\n namespace as _FirebaseNamespace\n );\n\n apps[name] = app;\n callAppHooks(app, 'create');\n\n return app;\n }\n\n /*\n * Return an array of all the non-deleted FirebaseApps.\n */\n function getApps(): FirebaseApp[] {\n // Make a copy so caller cannot mutate the apps list.\n return Object.keys(apps).map(name => apps[name]);\n }\n\n /*\n * Register a Firebase Service.\n *\n * firebase.INTERNAL.registerService()\n *\n * TODO: Implement serviceProperties.\n */\n function registerService(\n name: string,\n createService: FirebaseServiceFactory,\n serviceProperties?: { [prop: string]: unknown },\n appHook?: AppHook,\n allowMultipleInstances = false\n ): FirebaseServiceNamespace<FirebaseService> {\n // Cannot re-register a service that already exists\n if (factories[name]) {\n error(AppError.DUPLICATE_SERVICE, { name: name });\n }\n\n // Capture the service factory for later service instantiation\n factories[name] = createService;\n\n // Capture the appHook, if passed\n if (appHook) {\n appHooks[name] = appHook;\n\n // Run the **new** app hook on all existing apps\n getApps().forEach(app => {\n appHook('create', app);\n });\n }\n\n // The Service namespace is an accessor function ...\n function serviceNamespace(appArg: FirebaseApp = app()) {\n if (typeof appArg[name] !== 'function') {\n // Invalid argument.\n // This happens in the following case: firebase.storage('gs:/')\n error(AppError.INVALID_APP_ARGUMENT, { name: name });\n }\n\n // Forward service instance lookup to the FirebaseApp.\n return appArg[name]();\n }\n\n // ... and a container for service-level properties.\n if (serviceProperties !== undefined) {\n deepExtend(serviceNamespace, serviceProperties);\n }\n\n // Monkey-patch the serviceNamespace onto the firebase namespace\n namespace[name] = serviceNamespace;\n\n // Patch the FirebaseAppImpl prototype\n firebaseAppImpl.prototype[name] = function(...args) {\n const serviceFxn = this._getService.bind(this, name);\n return serviceFxn.apply(this, allowMultipleInstances ? args : []);\n };\n\n return serviceNamespace;\n }\n\n function callAppHooks(app: FirebaseApp, eventName: string) {\n for (const serviceName of Object.keys(factories)) {\n // Ignore virtual services\n const factoryName = useAsService(app, serviceName);\n if (factoryName === null) {\n return;\n }\n\n if (appHooks[factoryName]) {\n appHooks[factoryName](eventName, app);\n }\n }\n }\n\n // Map the requested service to a registered service name\n // (used to map auth to serverAuth service when needed).\n function useAsService(app: FirebaseApp, name: string): string | null {\n if (name === 'serverAuth') {\n return null;\n }\n\n const useService = name;\n const options = app.options;\n\n return useService;\n }\n\n return namespace;\n}\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { FirebaseNamespace } from '@firebase/app-types';\nimport { _FirebaseApp, _FirebaseNamespace } from '@firebase/app-types/private';\nimport { createSubscribe, deepExtend, ErrorFactory } from '@firebase/util';\nimport { FirebaseAppImpl } from './firebaseApp';\nimport { createFirebaseNamespaceCore } from './firebaseNamespaceCore';\n\n/**\n * Return a firebase namespace object.\n *\n * In production, this will be called exactly once and the result\n * assigned to the 'firebase' global. It may be called multiple times\n * in unit tests.\n */\nexport function createFirebaseNamespace(): FirebaseNamespace {\n const namespace = createFirebaseNamespaceCore(FirebaseAppImpl);\n (namespace as _FirebaseNamespace).INTERNAL = {\n ...(namespace as _FirebaseNamespace).INTERNAL,\n createFirebaseNamespace: createFirebaseNamespace,\n extendNamespace: extendNamespace,\n createSubscribe: createSubscribe,\n ErrorFactory: ErrorFactory,\n deepExtend: deepExtend\n };\n\n /**\n * Patch the top-level firebase namespace with additional properties.\n *\n * firebase.INTERNAL.extendNamespace()\n */\n function extendNamespace(props: { [prop: string]: unknown }): void {\n deepExtend(namespace, props);\n }\n\n return namespace;\n}\n","/**\n * @license\n * Copyright 2017 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { FirebaseNamespace } from '@firebase/app-types';\nimport { _FirebaseNamespace } from '@firebase/app-types/private';\nimport { createFirebaseNamespace } from './src/firebaseNamespace';\n\n/**\n * To avoid having to include the @types/react-native package, which breaks\n * some of our tests because of duplicate symbols, we are using require syntax\n * here\n */\nconst { AsyncStorage } = require('react-native');\n\nconst _firebase = createFirebaseNamespace() as _FirebaseNamespace;\n\n_firebase.INTERNAL.extendNamespace({\n INTERNAL: {\n reactNative: {\n AsyncStorage\n }\n }\n});\n\nexport const firebase = _firebase as FirebaseNamespace;\n\nexport default firebase;\n"],"names":["ErrorFactory","deepCopy","deepExtend","patchProperty","createSubscribe"],"mappings":";;;;;;;AAAA;;;;;;;;;;;;;;;;;AAiBA,AAWA,IAAM,MAAM;IACV,4BACE,+CAA+C;QAC/C,mCAAmC;IACrC,wCAAyB,4BAA4B;IACrD,0CAA0B,6CAA6C;IACvE,sCAAwB,8CAA8C;IACtE,kDACE,qDAAqD;IACvD,wDACE,mDAAmD;QACnD,wBAAwB;OAC3B,CAAC;AAEF,IAAM,SAAS,GA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,GACvB,CAAC;;;;;;IAOF,SAAS,eAAe,CAAC,KAAkC;QACzDA,eAAU,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;KAC9B;IAED,OAAO,SAAS,CAAC;CAClB;;ACnDD;;;;;;;;;;;;;;;;AAmBA,AAEA;;;;;AAKQ,IAAA,mDAAY,CAA6B;AAEjD,IAAM,SAAS,GAAG,uBAAuB,EAAwB,CAAC;AAElE,SAAS,CAAC,QAAQ,CAAC,eAAe,CAAC;IACjC,QAAQ,EAAE;QACR,WAAW,EAAE;YACX,YAAY,cAAA;SACb;KACF;CACF,CAAC,CAAC;AAEH,IAAa,QAAQ,GAAG,SAA8B;;;;;"}
1
+ {"version":3,"file":"index.rn.cjs.js","sources":["../src/errors.ts","../src/constants.ts","../src/firebaseApp.ts","../src/firebaseNamespaceCore.ts","../src/firebaseNamespace.ts","../index.rn.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ErrorFactory, ErrorMap } from '@firebase/util';\n\nexport const enum AppError {\n NO_APP = 'no-app',\n BAD_APP_NAME = 'bad-app-name',\n DUPLICATE_APP = 'duplicate-app',\n APP_DELETED = 'app-deleted',\n DUPLICATE_SERVICE = 'duplicate-service',\n INVALID_APP_ARGUMENT = 'invalid-app-argument'\n}\n\nconst ERRORS: ErrorMap<AppError> = {\n [AppError.NO_APP]:\n \"No Firebase App '{$name}' has been created - \" +\n 'call Firebase App.initializeApp()',\n [AppError.BAD_APP_NAME]: \"Illegal App name: '{$name}\",\n [AppError.DUPLICATE_APP]: \"Firebase App named '{$name}' already exists\",\n [AppError.APP_DELETED]: \"Firebase App named '{$name}' already deleted\",\n [AppError.DUPLICATE_SERVICE]:\n \"Firebase service named '{$name}' already registered\",\n [AppError.INVALID_APP_ARGUMENT]:\n 'firebase.{$name}() takes either no argument or a ' +\n 'Firebase App instance.'\n};\n\nconst appErrors = new ErrorFactory<AppError>('app', 'Firebase', ERRORS);\n\nexport function error(code: AppError, args?: { [name: string]: any }) {\n throw appErrors.create(code, args);\n}\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport const DEFAULT_ENTRY_NAME = '[DEFAULT]';\n","/**\n * @license\n * Copyright 2017 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n FirebaseApp,\n FirebaseOptions,\n FirebaseAppConfig\n} from '@firebase/app-types';\nimport {\n _FirebaseApp,\n _FirebaseNamespace,\n FirebaseService,\n FirebaseAppInternals\n} from '@firebase/app-types/private';\nimport { deepCopy, deepExtend } from '@firebase/util';\nimport { error, AppError } from './errors';\nimport { DEFAULT_ENTRY_NAME } from './constants';\n\ninterface ServicesCache {\n [name: string]: {\n [serviceName: string]: FirebaseService;\n };\n}\n\n// An array to capture listeners before the true auth functions\n// exist\nlet tokenListeners: any[] = [];\n\n/**\n * Global context object for a collection of services using\n * a shared authentication state.\n */\nexport class FirebaseAppImpl implements FirebaseApp {\n private readonly options_: FirebaseOptions;\n private readonly name_: string;\n private isDeleted_ = false;\n private services_: ServicesCache = {};\n private automaticDataCollectionEnabled_: boolean;\n\n INTERNAL: FirebaseAppInternals;\n\n constructor(\n options: FirebaseOptions,\n config: FirebaseAppConfig,\n private readonly firebase_: _FirebaseNamespace\n ) {\n this.name_ = config.name!;\n this.automaticDataCollectionEnabled_ =\n config.automaticDataCollectionEnabled || false;\n this.options_ = deepCopy<FirebaseOptions>(options);\n this.INTERNAL = {\n getUid: () => null,\n getToken: () => Promise.resolve(null),\n addAuthTokenListener: (callback: (token: string | null) => void) => {\n tokenListeners.push(callback);\n // Make sure callback is called, asynchronously, in the absence of the auth module\n setTimeout(() => callback(null), 0);\n },\n removeAuthTokenListener: callback => {\n tokenListeners = tokenListeners.filter(\n listener => listener !== callback\n );\n }\n };\n }\n\n get automaticDataCollectionEnabled(): boolean {\n this.checkDestroyed_();\n return this.automaticDataCollectionEnabled_;\n }\n\n set automaticDataCollectionEnabled(val) {\n this.checkDestroyed_();\n this.automaticDataCollectionEnabled_ = val;\n }\n\n get name(): string {\n this.checkDestroyed_();\n return this.name_;\n }\n\n get options(): FirebaseOptions {\n this.checkDestroyed_();\n return this.options_;\n }\n\n delete(): Promise<void> {\n return new Promise(resolve => {\n this.checkDestroyed_();\n resolve();\n })\n .then(() => {\n this.firebase_.INTERNAL.removeApp(this.name_);\n const services: FirebaseService[] = [];\n\n for (const serviceKey of Object.keys(this.services_)) {\n for (const instanceKey of Object.keys(this.services_[serviceKey])) {\n services.push(this.services_[serviceKey][instanceKey]);\n }\n }\n\n return Promise.all(\n services.map(service => {\n return service.INTERNAL.delete();\n })\n );\n })\n .then(\n (): void => {\n this.isDeleted_ = true;\n this.services_ = {};\n }\n );\n }\n\n /**\n * Return a service instance associated with this app (creating it\n * on demand), identified by the passed instanceIdentifier.\n *\n * NOTE: Currently storage is the only one that is leveraging this\n * functionality. They invoke it by calling:\n *\n * ```javascript\n * firebase.app().storage('STORAGE BUCKET ID')\n * ```\n *\n * The service name is passed to this already\n * @internal\n */\n _getService(\n name: string,\n instanceIdentifier: string = DEFAULT_ENTRY_NAME\n ): FirebaseService {\n this.checkDestroyed_();\n\n if (!this.services_[name]) {\n this.services_[name] = {};\n }\n\n if (!this.services_[name][instanceIdentifier]) {\n /**\n * If a custom instance has been defined (i.e. not '[DEFAULT]')\n * then we will pass that instance on, otherwise we pass `null`\n */\n const instanceSpecifier =\n instanceIdentifier !== DEFAULT_ENTRY_NAME\n ? instanceIdentifier\n : undefined;\n const service = this.firebase_.INTERNAL.factories[name](\n this,\n this.extendApp.bind(this),\n instanceSpecifier\n );\n this.services_[name][instanceIdentifier] = service;\n }\n\n return this.services_[name][instanceIdentifier];\n }\n\n /**\n * Callback function used to extend an App instance at the time\n * of service instance creation.\n */\n private extendApp(props: { [name: string]: any }): void {\n // Copy the object onto the FirebaseAppImpl prototype\n deepExtend(this, props);\n\n /**\n * If the app has overwritten the addAuthTokenListener stub, forward\n * the active token listeners on to the true fxn.\n *\n * TODO: This function is required due to our current module\n * structure. Once we are able to rely strictly upon a single module\n * implementation, this code should be refactored and Auth should\n * provide these stubs and the upgrade logic\n */\n if (props.INTERNAL && props.INTERNAL.addAuthTokenListener) {\n tokenListeners.forEach(listener => {\n this.INTERNAL.addAuthTokenListener(listener);\n });\n tokenListeners = [];\n }\n }\n\n /**\n * This function will throw an Error if the App has already been deleted -\n * use before performing API actions on the App.\n */\n private checkDestroyed_(): void {\n if (this.isDeleted_) {\n error(AppError.APP_DELETED, { name: this.name_ });\n }\n }\n}\n\n// Prevent dead-code elimination of these methods w/o invalid property\n// copying.\n(FirebaseAppImpl.prototype.name && FirebaseAppImpl.prototype.options) ||\n FirebaseAppImpl.prototype.delete ||\n console.log('dc');\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n FirebaseApp,\n FirebaseOptions,\n FirebaseNamespace,\n FirebaseAppConfig\n} from '@firebase/app-types';\nimport {\n _FirebaseApp,\n _FirebaseNamespace,\n FirebaseService,\n FirebaseServiceFactory,\n FirebaseServiceNamespace,\n AppHook\n} from '@firebase/app-types/private';\nimport { deepExtend, patchProperty } from '@firebase/util';\nimport { FirebaseAppImpl } from './firebaseApp';\nimport { error, AppError } from './errors';\nimport { FirebaseAppLiteImpl } from './lite/firebaseAppLite';\nimport { DEFAULT_ENTRY_NAME } from './constants';\n\nfunction contains(obj: object, key: string) {\n return Object.prototype.hasOwnProperty.call(obj, key);\n}\n\n/**\n * Because auth can't share code with other components, we attach the utility functions\n * in an internal namespace to share code.\n * This function return a firebase namespace object without\n * any utility functions, so it can be shared between the regular firebaseNamespace and\n * the lite version.\n */\nexport function createFirebaseNamespaceCore(\n firebaseAppImpl: typeof FirebaseAppImpl | typeof FirebaseAppLiteImpl\n): FirebaseNamespace {\n const apps: { [name: string]: FirebaseApp } = {};\n const factories: { [service: string]: FirebaseServiceFactory } = {};\n const appHooks: { [service: string]: AppHook } = {};\n\n // A namespace is a plain JavaScript Object.\n const namespace: FirebaseNamespace = {\n // Hack to prevent Babel from modifying the object returned\n // as the firebase namespace.\n // @ts-ignore\n __esModule: true,\n initializeApp: initializeApp,\n app: app as any,\n apps: null as any,\n Promise: Promise,\n SDK_VERSION: '${JSCORE_VERSION}',\n INTERNAL: {\n registerService,\n removeApp,\n factories,\n useAsService\n }\n };\n\n // Inject a circular default export to allow Babel users who were previously\n // using:\n //\n // import firebase from 'firebase';\n // which becomes: var firebase = require('firebase').default;\n //\n // instead of\n //\n // import * as firebase from 'firebase';\n // which becomes: var firebase = require('firebase');\n patchProperty(namespace, 'default', namespace);\n\n // firebase.apps is a read-only getter.\n Object.defineProperty(namespace, 'apps', {\n get: getApps\n });\n\n /**\n * Called by App.delete() - but before any services associated with the App\n * are deleted.\n */\n function removeApp(name: string): void {\n const app = apps[name];\n callAppHooks(app, 'delete');\n delete apps[name];\n }\n\n /**\n * Get the App object for a given name (or DEFAULT).\n */\n function app(name?: string): FirebaseApp {\n name = name || DEFAULT_ENTRY_NAME;\n if (!contains(apps, name)) {\n error(AppError.NO_APP, { name: name });\n }\n return apps[name];\n }\n\n patchProperty(app, 'App', firebaseAppImpl);\n /**\n * Create a new App instance (name must be unique).\n */\n function initializeApp(\n options: FirebaseOptions,\n config?: FirebaseAppConfig\n ): FirebaseApp;\n function initializeApp(options: FirebaseOptions, name?: string): FirebaseApp;\n function initializeApp(options: FirebaseOptions, rawConfig = {}) {\n if (typeof rawConfig !== 'object' || rawConfig === null) {\n const name = rawConfig;\n rawConfig = { name };\n }\n\n const config = rawConfig as FirebaseAppConfig;\n\n if (config.name === undefined) {\n config.name = DEFAULT_ENTRY_NAME;\n }\n\n const { name } = config;\n\n if (typeof name !== 'string' || !name) {\n error(AppError.BAD_APP_NAME, { name: String(name) });\n }\n\n if (contains(apps, name)) {\n error(AppError.DUPLICATE_APP, { name: name });\n }\n\n const app = new firebaseAppImpl(\n options,\n config,\n namespace as _FirebaseNamespace\n );\n\n apps[name] = app;\n callAppHooks(app, 'create');\n\n return app;\n }\n\n /*\n * Return an array of all the non-deleted FirebaseApps.\n */\n function getApps(): FirebaseApp[] {\n // Make a copy so caller cannot mutate the apps list.\n return Object.keys(apps).map(name => apps[name]);\n }\n\n /*\n * Register a Firebase Service.\n *\n * firebase.INTERNAL.registerService()\n *\n * TODO: Implement serviceProperties.\n */\n function registerService(\n name: string,\n createService: FirebaseServiceFactory,\n serviceProperties?: { [prop: string]: unknown },\n appHook?: AppHook,\n allowMultipleInstances = false\n ): FirebaseServiceNamespace<FirebaseService> {\n // Cannot re-register a service that already exists\n if (factories[name]) {\n error(AppError.DUPLICATE_SERVICE, { name: name });\n }\n\n // Capture the service factory for later service instantiation\n factories[name] = createService;\n\n // Capture the appHook, if passed\n if (appHook) {\n appHooks[name] = appHook;\n\n // Run the **new** app hook on all existing apps\n getApps().forEach(app => {\n appHook('create', app);\n });\n }\n\n // The Service namespace is an accessor function ...\n function serviceNamespace(appArg: FirebaseApp = app()) {\n if (typeof appArg[name] !== 'function') {\n // Invalid argument.\n // This happens in the following case: firebase.storage('gs:/')\n error(AppError.INVALID_APP_ARGUMENT, { name: name });\n }\n\n // Forward service instance lookup to the FirebaseApp.\n return appArg[name]();\n }\n\n // ... and a container for service-level properties.\n if (serviceProperties !== undefined) {\n deepExtend(serviceNamespace, serviceProperties);\n }\n\n // Monkey-patch the serviceNamespace onto the firebase namespace\n namespace[name] = serviceNamespace;\n\n // Patch the FirebaseAppImpl prototype\n firebaseAppImpl.prototype[name] = function(...args) {\n const serviceFxn = this._getService.bind(this, name);\n return serviceFxn.apply(this, allowMultipleInstances ? args : []);\n };\n\n return serviceNamespace;\n }\n\n function callAppHooks(app: FirebaseApp, eventName: string) {\n for (const serviceName of Object.keys(factories)) {\n // Ignore virtual services\n const factoryName = useAsService(app, serviceName);\n if (factoryName === null) {\n return;\n }\n\n if (appHooks[factoryName]) {\n appHooks[factoryName](eventName, app);\n }\n }\n }\n\n // Map the requested service to a registered service name\n // (used to map auth to serverAuth service when needed).\n function useAsService(app: FirebaseApp, name: string): string | null {\n if (name === 'serverAuth') {\n return null;\n }\n\n const useService = name;\n const options = app.options;\n\n return useService;\n }\n\n return namespace;\n}\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { FirebaseNamespace } from '@firebase/app-types';\nimport { _FirebaseApp, _FirebaseNamespace } from '@firebase/app-types/private';\nimport { createSubscribe, deepExtend, ErrorFactory } from '@firebase/util';\nimport { FirebaseAppImpl } from './firebaseApp';\nimport { createFirebaseNamespaceCore } from './firebaseNamespaceCore';\n\n/**\n * Return a firebase namespace object.\n *\n * In production, this will be called exactly once and the result\n * assigned to the 'firebase' global. It may be called multiple times\n * in unit tests.\n */\nexport function createFirebaseNamespace(): FirebaseNamespace {\n const namespace = createFirebaseNamespaceCore(FirebaseAppImpl);\n (namespace as _FirebaseNamespace).INTERNAL = {\n ...(namespace as _FirebaseNamespace).INTERNAL,\n createFirebaseNamespace: createFirebaseNamespace,\n extendNamespace: extendNamespace,\n createSubscribe: createSubscribe,\n ErrorFactory: ErrorFactory,\n deepExtend: deepExtend\n };\n\n /**\n * Patch the top-level firebase namespace with additional properties.\n *\n * firebase.INTERNAL.extendNamespace()\n */\n function extendNamespace(props: { [prop: string]: unknown }): void {\n deepExtend(namespace, props);\n }\n\n return namespace;\n}\n","/**\n * @license\n * Copyright 2017 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { FirebaseNamespace } from '@firebase/app-types';\nimport { _FirebaseNamespace } from '@firebase/app-types/private';\nimport { createFirebaseNamespace } from './src/firebaseNamespace';\n\n/**\n * To avoid having to include the @types/react-native package, which breaks\n * some of our tests because of duplicate symbols, we are using require syntax\n * here\n */\nconst { AsyncStorage } = require('react-native');\n\nconst _firebase = createFirebaseNamespace() as _FirebaseNamespace;\n\n_firebase.INTERNAL.extendNamespace({\n INTERNAL: {\n reactNative: {\n AsyncStorage\n }\n }\n});\n\nexport const firebase = _firebase as FirebaseNamespace;\n\nexport default firebase;\n"],"names":["ErrorFactory","deepCopy","deepExtend","patchProperty","createSubscribe"],"mappings":";;;;;;;AAAA;;;;;;;;;;;;;;;;;AAiBA,AAWA,IAAM,MAAM;IACV,4BACE,+CAA+C;QAC/C,mCAAmC;IACrC,wCAAyB,4BAA4B;IACrD,0CAA0B,6CAA6C;IACvE,sCAAwB,8CAA8C;IACtE,kDACE,qDAAqD;IACvD,wDACE,mDAAmD;QACnD,wBAAwB;OAC3B,CAAC;AAEF,IAAM,SAAS,GAAG,IAAIA,iBAAY,CAAW,KAAK,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC;AAExE,SAAgB,KAAK,CAAC,IAAc,EAAE,IAA8B;IAClE,MAAM,SAAS,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;CACpC;;AC9CD;;;;;;;;;;;;;;;;AAiBA,AAAO,IAAM,kBAAkB,GAAG,WAAW,CAAC;;ACjB9C;;;;;;;;;;;;;;;;AA4BA,AAUA;;AAEA,IAAI,cAAc,GAAU,EAAE,CAAC;;;;;AAM/B;IASE,yBACE,OAAwB,EACxB,MAAyB,EACR,SAA6B;QAA7B,cAAS,GAAT,SAAS,CAAoB;QATxC,eAAU,GAAG,KAAK,CAAC;QACnB,cAAS,GAAkB,EAAE,CAAC;QAUpC,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,IAAK,CAAC;QAC1B,IAAI,CAAC,+BAA+B;YAClC,MAAM,CAAC,8BAA8B,IAAI,KAAK,CAAC;QACjD,IAAI,CAAC,QAAQ,GAAGC,aAAQ,CAAkB,OAAO,CAAC,CAAC;QACnD,IAAI,CAAC,QAAQ,GAAG;YACd,MAAM,EAAE,cAAM,OAAA,IAAI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AAY,EAAE;YACzB,OAAO,IAAI,CAAC;SACb;QAED,IAAM,UAAU,GAAG,IAAI,CAAC;QACxB,IAAM,OAAO,GAAG,GAAG,CAAC,OAAO,CAAC;QAE5B,OAAO,UAAU,CAAC;KACnB;IAED,OAAO,SAAS,CAAC;CAClB;;AC5PD;;;;;;;;;;;;;;;;AAuBA;;;;;;;AAOA,SAAgB,uBAAuB;IACrC,IAAM,SAAS,GAAG,2BAA2B,CAAC,eAAe,CAAC,CAAC;IAC9D,SAAgC,CAAC,QAAQ,wBACpC,SAAgC,CAAC,QAAQ,IAC7C,uBAAuB,EAAE,uBAAuB,EAChD,eAAe,EAAE,eAAe,EAChC,eAAe,EAAEE,oBAAe,EAChC,YAAY,EAAEJ,iBAAY,EAC1B,UAAU,EAAEE,eAAU,GACvB,CAAC;;;;;;IAOF,SAAS,eAAe,CAAC,KAAkC;QACzDA,eAAU,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;KAC9B;IAED,OAAO,SAAS,CAAC;CAClB;;ACnDD;;;;;;;;;;;;;;;;AAmBA,AAEA;;;;;AAKQ,IAAA,mDAAY,CAA6B;AAEjD,IAAM,SAAS,GAAG,uBAAuB,EAAwB,CAAC;AAElE,SAAS,CAAC,QAAQ,CAAC,eAAe,CAAC;IACjC,QAAQ,EAAE;QACR,WAAW,EAAE;YACX,YAAY,cAAA;SACb;KACF;CACF,CAAC,CAAC;AAEH,IAAa,QAAQ,GAAG,SAA8B;;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@firebase/app",
3
- "version": "0.3.17-canary.a7bb0b5",
3
+ "version": "0.3.17",
4
4
  "description": "The primary entrypoint to the Firebase JS SDK",
5
5
  "author": "Firebase <firebase-support@google.com> (https://firebase.google.com/)",
6
6
  "main": "dist/index.node.cjs.js",
@@ -24,8 +24,8 @@
24
24
  },
25
25
  "license": "Apache-2.0",
26
26
  "dependencies": {
27
- "@firebase/app-types": "0.3.10-canary.a7bb0b5",
28
- "@firebase/util": "0.2.14-canary.a7bb0b5",
27
+ "@firebase/app-types": "0.3.10",
28
+ "@firebase/util": "0.2.14",
29
29
  "tslib": "1.9.3",
30
30
  "dom-storage": "2.1.0",
31
31
  "xmlhttprequest": "1.8.0"