Socket
Socket
Sign inDemoInstall

@firebase/app

Package Overview
Dependencies
Maintainers
3
Versions
3326
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@firebase/app - npm Package Compare versions

Comparing version 0.1.4 to 0.1.5

3

dist/cjs/index.d.ts

@@ -16,5 +16,4 @@ /**

*/
import { FirebaseNamespace } from './src/firebaseApp';
export { FirebaseApp, FirebaseAuthTokenData, FirebaseNamespace, FirebaseService, FirebaseServiceFactory, FirebaseServiceNamespace } from './src/firebaseApp';
import { FirebaseNamespace } from '@firebase/app-types';
export declare const firebase: FirebaseNamespace;
export default firebase;

@@ -16,164 +16,4 @@ /**

*/
import { Observer, Subscribe } from '@firebase/util';
import { FirebaseError } from '@firebase/util';
export interface FirebaseAuthTokenData {
accessToken: string;
}
export interface FirebaseAppInternals {
getToken(refreshToken?: boolean): Promise<FirebaseAuthTokenData | null>;
getUid(): string | null;
addAuthTokenListener(fn: (token: string | null) => void): void;
removeAuthTokenListener(fn: (token: string | null) => void): void;
}
export declare type FirebaseOptions = {
apiKey?: string;
authDomain?: string;
databaseURL?: string;
projectId?: string;
storageBucket?: string;
messagingSenderId?: string;
[name: string]: any;
};
export interface FirebaseApp {
/**
* The (read-only) name (identifier) for this App. '[DEFAULT]' is the default
* App.
*/
name: string;
/**
* The (read-only) configuration options from the app initialization.
*/
options: FirebaseOptions;
/**
* Make the given App unusable and free resources.
*/
delete(): Promise<void>;
INTERNAL: FirebaseAppInternals;
}
export interface FirebaseServiceInternals {
/**
* Delete the service and free it's resources - called from
* app.delete().
*/
delete(): Promise<void>;
}
export interface FirebaseService {
app: FirebaseApp;
INTERNAL?: FirebaseServiceInternals;
}
export declare type AppHook = (event: string, app: FirebaseApp) => void;
import { FirebaseNamespace } from '@firebase/app-types';
/**
* Firebase Services create instances given a Firebase App instance and can
* optionally add properties and methods to each FirebaseApp via the extendApp()
* function.
*/
export interface FirebaseServiceFactory {
(app: FirebaseApp, extendApp?: (props: {
[prop: string]: any;
}) => void, instanceString?: string): FirebaseService;
}
/**
* All ServiceNamespaces extend from FirebaseServiceNamespace
*/
export interface FirebaseServiceNamespace<T extends FirebaseService> {
(app?: FirebaseApp): T;
}
export interface FirebaseErrorFactory<T> {
create(code: T, data?: {
[prop: string]: any;
}): FirebaseError;
}
export interface FirebaseErrorFactoryClass {
new (service: string, serviceName: string, errors: {
[code: string]: string;
}): FirebaseErrorFactory<any>;
}
export interface FirebaseNamespace {
/**
* Create (and intialize) a FirebaseApp.
*
* @param options Options to configure the services use in the App.
* @param name The optional name of the app to initialize ('[DEFAULT]' if
* none)
*/
initializeApp(options: FirebaseOptions, name?: string): FirebaseApp;
app: {
/**
* Retrieve an instance of a FirebaseApp.
*
* Usage: firebase.app()
*
* @param name The optional name of the app to return ('[DEFAULT]' if none)
*/
(name?: string): FirebaseApp;
/**
* For testing FirebaseApp instances:
* app() instanceof firebase.app.App
* DO NOT call this constuctor directly (use firebase.app() instead).
*/
App: Function;
};
/**
* A (read-only) array of all the initialized Apps.
*/
apps: FirebaseApp[];
Promise: typeof Promise;
SDK_VERSION: string;
INTERNAL: {
/**
* Internal API to register a Firebase Service into the firebase namespace.
*
* Each service will create a child namespace (firease.name) which acts as
* both a namespace for service specific properties, and also as a service
* accessor function (firebase.name() or firebase.name(app)).
*
* @param name The Firebase Service being registered.
* @param createService Factory function to create a service instance.
* @param serviceProperties Properties to copy to the service's namespace.
* @param appHook All appHooks called before intializeApp returns to caller.
* @param allowMultipleInstances Whether the registered service supports
* multiple instances per app. If not specified, the default is false.
*/
registerService(name: string, createService: FirebaseServiceFactory, serviceProperties?: {
[prop: string]: any;
}, appHook?: AppHook, allowMultipleInstances?: boolean): FirebaseServiceNamespace<FirebaseService>;
/**
* Just used for testing to start from a fresh namespace.
*/
createFirebaseNamespace(): FirebaseNamespace;
/**
* Internal API to install properties on the top-level firebase namespace.
* @prop props The top level properties of this object are copied to the
* namespace.
*/
extendNamespace(props: {
[prop: string]: any;
}): void;
/**
* Create a Subscribe function. A proxy Observer is created so that
* events can be sent to single Observer to be fanned out automatically.
*/
createSubscribe<T>(executor: (observer: Observer<T>) => void, onNoObservers?: (observer: Observer<T>) => void): Subscribe<T>;
/**
* Utility exposed for internal testing.
*/
deepExtend(target: any, source: any): any;
/**
* Internal API to remove an app from the list of registered apps.
*/
removeApp(name: string): void;
/**
* Service factories for each registered service.
*/
factories: {
[name: string]: FirebaseServiceFactory;
};
useAsService(app: FirebaseApp, serviceName: string): string | null;
/**
* Use to construct all thrown FirebaseError's.
*/
ErrorFactory: FirebaseErrorFactoryClass;
};
}
/**
* Return a firebase namespace object.

@@ -180,0 +20,0 @@ *

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/**

@@ -18,4 +17,4 @@ * Copyright 2017 Google Inc.

*/
Object.defineProperty(exports, "__esModule", { value: true });
var util_1 = require("@firebase/util");
var util_2 = require("@firebase/util");
var contains = function (obj, key) {

@@ -38,3 +37,3 @@ return Object.prototype.hasOwnProperty.call(obj, key);

this.name_ = name;
this.options_ = util_2.deepCopy(options);
this.options_ = util_1.deepCopy(options);
this.INTERNAL = {

@@ -132,3 +131,3 @@ getUid: function () { return null; },

// Copy the object onto the FirebaseAppImpl prototype
util_2.deepExtend(this, props);
util_1.deepExtend(this, props);
/**

@@ -186,3 +185,3 @@ * If the app has overwritten the addAuthTokenListener stub, forward

Promise: Promise,
SDK_VERSION: '4.8.0',
SDK_VERSION: '4.8.1',
INTERNAL: {

@@ -193,3 +192,3 @@ registerService: registerService,

createSubscribe: util_1.createSubscribe,
ErrorFactory: util_2.ErrorFactory,
ErrorFactory: util_1.ErrorFactory,
removeApp: removeApp,

@@ -199,3 +198,3 @@ factories: factories,

Promise: Promise,
deepExtend: util_2.deepExtend
deepExtend: util_1.deepExtend
}

@@ -213,3 +212,3 @@ };

// which becomes: var firebase = require('firebase');
util_2.patchProperty(namespace, 'default', namespace);
util_1.patchProperty(namespace, 'default', namespace);
// firebase.apps is a read-only getter.

@@ -238,3 +237,3 @@ Object.defineProperty(namespace, 'apps', {

}
util_2.patchProperty(app, 'App', FirebaseAppImpl);
util_1.patchProperty(app, 'App', FirebaseAppImpl);
/**

@@ -302,3 +301,3 @@ * Create a new App instance (name must be unique).

if (serviceProperties !== undefined) {
util_2.deepExtend(serviceNamespace, serviceProperties);
util_1.deepExtend(serviceNamespace, serviceProperties);
}

@@ -324,3 +323,3 @@ // Monkey-patch the serviceNamespace onto the firebase namespace

function extendNamespace(props) {
util_2.deepExtend(namespace, props);
util_1.deepExtend(namespace, props);
}

@@ -371,5 +370,5 @@ function callAppHooks(app, eventName) {

};
var appErrors = new util_2.ErrorFactory('app', 'Firebase', errors);
var appErrors = new util_1.ErrorFactory('app', 'Firebase', errors);
//# sourceMappingURL=firebaseApp.js.map

@@ -16,5 +16,4 @@ /**

*/
import { FirebaseNamespace } from './src/firebaseApp';
export { FirebaseApp, FirebaseAuthTokenData, FirebaseNamespace, FirebaseService, FirebaseServiceFactory, FirebaseServiceNamespace } from './src/firebaseApp';
import { FirebaseNamespace } from '@firebase/app-types';
export declare const firebase: FirebaseNamespace;
export default firebase;

@@ -16,164 +16,4 @@ /**

*/
import { Observer, Subscribe } from '@firebase/util';
import { FirebaseError } from '@firebase/util';
export interface FirebaseAuthTokenData {
accessToken: string;
}
export interface FirebaseAppInternals {
getToken(refreshToken?: boolean): Promise<FirebaseAuthTokenData | null>;
getUid(): string | null;
addAuthTokenListener(fn: (token: string | null) => void): void;
removeAuthTokenListener(fn: (token: string | null) => void): void;
}
export declare type FirebaseOptions = {
apiKey?: string;
authDomain?: string;
databaseURL?: string;
projectId?: string;
storageBucket?: string;
messagingSenderId?: string;
[name: string]: any;
};
export interface FirebaseApp {
/**
* The (read-only) name (identifier) for this App. '[DEFAULT]' is the default
* App.
*/
name: string;
/**
* The (read-only) configuration options from the app initialization.
*/
options: FirebaseOptions;
/**
* Make the given App unusable and free resources.
*/
delete(): Promise<void>;
INTERNAL: FirebaseAppInternals;
}
export interface FirebaseServiceInternals {
/**
* Delete the service and free it's resources - called from
* app.delete().
*/
delete(): Promise<void>;
}
export interface FirebaseService {
app: FirebaseApp;
INTERNAL?: FirebaseServiceInternals;
}
export declare type AppHook = (event: string, app: FirebaseApp) => void;
import { FirebaseNamespace } from '@firebase/app-types';
/**
* Firebase Services create instances given a Firebase App instance and can
* optionally add properties and methods to each FirebaseApp via the extendApp()
* function.
*/
export interface FirebaseServiceFactory {
(app: FirebaseApp, extendApp?: (props: {
[prop: string]: any;
}) => void, instanceString?: string): FirebaseService;
}
/**
* All ServiceNamespaces extend from FirebaseServiceNamespace
*/
export interface FirebaseServiceNamespace<T extends FirebaseService> {
(app?: FirebaseApp): T;
}
export interface FirebaseErrorFactory<T> {
create(code: T, data?: {
[prop: string]: any;
}): FirebaseError;
}
export interface FirebaseErrorFactoryClass {
new (service: string, serviceName: string, errors: {
[code: string]: string;
}): FirebaseErrorFactory<any>;
}
export interface FirebaseNamespace {
/**
* Create (and intialize) a FirebaseApp.
*
* @param options Options to configure the services use in the App.
* @param name The optional name of the app to initialize ('[DEFAULT]' if
* none)
*/
initializeApp(options: FirebaseOptions, name?: string): FirebaseApp;
app: {
/**
* Retrieve an instance of a FirebaseApp.
*
* Usage: firebase.app()
*
* @param name The optional name of the app to return ('[DEFAULT]' if none)
*/
(name?: string): FirebaseApp;
/**
* For testing FirebaseApp instances:
* app() instanceof firebase.app.App
* DO NOT call this constuctor directly (use firebase.app() instead).
*/
App: Function;
};
/**
* A (read-only) array of all the initialized Apps.
*/
apps: FirebaseApp[];
Promise: typeof Promise;
SDK_VERSION: string;
INTERNAL: {
/**
* Internal API to register a Firebase Service into the firebase namespace.
*
* Each service will create a child namespace (firease.name) which acts as
* both a namespace for service specific properties, and also as a service
* accessor function (firebase.name() or firebase.name(app)).
*
* @param name The Firebase Service being registered.
* @param createService Factory function to create a service instance.
* @param serviceProperties Properties to copy to the service's namespace.
* @param appHook All appHooks called before intializeApp returns to caller.
* @param allowMultipleInstances Whether the registered service supports
* multiple instances per app. If not specified, the default is false.
*/
registerService(name: string, createService: FirebaseServiceFactory, serviceProperties?: {
[prop: string]: any;
}, appHook?: AppHook, allowMultipleInstances?: boolean): FirebaseServiceNamespace<FirebaseService>;
/**
* Just used for testing to start from a fresh namespace.
*/
createFirebaseNamespace(): FirebaseNamespace;
/**
* Internal API to install properties on the top-level firebase namespace.
* @prop props The top level properties of this object are copied to the
* namespace.
*/
extendNamespace(props: {
[prop: string]: any;
}): void;
/**
* Create a Subscribe function. A proxy Observer is created so that
* events can be sent to single Observer to be fanned out automatically.
*/
createSubscribe<T>(executor: (observer: Observer<T>) => void, onNoObservers?: (observer: Observer<T>) => void): Subscribe<T>;
/**
* Utility exposed for internal testing.
*/
deepExtend(target: any, source: any): any;
/**
* Internal API to remove an app from the list of registered apps.
*/
removeApp(name: string): void;
/**
* Service factories for each registered service.
*/
factories: {
[name: string]: FirebaseServiceFactory;
};
useAsService(app: FirebaseApp, serviceName: string): string | null;
/**
* Use to construct all thrown FirebaseError's.
*/
ErrorFactory: FirebaseErrorFactoryClass;
};
}
/**
* Return a firebase namespace object.

@@ -180,0 +20,0 @@ *

@@ -16,4 +16,3 @@ /**

*/
import { createSubscribe } from '@firebase/util';
import { patchProperty, deepCopy, deepExtend, ErrorFactory } from '@firebase/util';
import { createSubscribe, deepCopy, deepExtend, ErrorFactory, patchProperty } from '@firebase/util';
var contains = function (obj, key) {

@@ -182,3 +181,3 @@ return Object.prototype.hasOwnProperty.call(obj, key);

Promise: Promise,
SDK_VERSION: '4.8.0',
SDK_VERSION: '4.8.1',
INTERNAL: {

@@ -185,0 +184,0 @@ registerService: registerService,

{
"name": "@firebase/app",
"version": "0.1.4",
"version": "0.1.5",
"description": "The primary entrypoint to the Firebase JS SDK",

@@ -17,3 +17,4 @@ "main": "dist/cjs/index.js",

"dependencies": {
"@firebase/util": "0.1.4"
"@firebase/app-types": "0.1.0",
"@firebase/util": "0.1.5"
},

@@ -54,3 +55,3 @@ "devDependencies": {

},
"typings": "dist/index.d.ts",
"typings": "dist/esm/index.d.ts",
"nyc": {

@@ -57,0 +58,0 @@ "extension": [

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc