New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@firebase/firestore

Package Overview
Dependencies
Maintainers
3
Versions
3646
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@firebase/firestore - npm Package Compare versions

Comparing version 0.2.1 to 0.2.2

7

CHANGELOG.md
# Unreleased
- [changed] A "Could not reach Firestore backend." message will be
logged when the initial connection to the Firestore backend fails.
- [changed] A "Using maximum backoff delay to prevent overloading the
backend." message will be logged when we get a resource-exhausted
error from the backend.
# v0.2.1
- [feature] Added Node.js support for Cloud Firestore (with the exception of

@@ -3,0 +10,0 @@ the offline persistence feature).

import './src/platform_browser/browser_init';
import * as types from '@firebase/firestore-types';
export declare function registerFirestore(instance: any): void;
declare module '@firebase/app-types' {
interface FirebaseNamespace {
firestore?: {
(app?: FirebaseApp): types.FirebaseFirestore;
Blob: typeof types.Blob;
CollectionReference: typeof types.CollectionReference;
DocumentReference: typeof types.DocumentReference;
DocumentSnapshot: typeof types.DocumentSnapshot;
FieldPath: typeof types.FieldPath;
FieldValue: typeof types.FieldValue;
Firestore: typeof types.FirebaseFirestore;
GeoPoint: typeof types.GeoPoint;
Query: typeof types.Query;
QuerySnapshot: typeof types.QuerySnapshot;
Transaction: typeof types.Transaction;
WriteBatch: typeof types.WriteBatch;
setLogLevel: typeof types.setLogLevel;
};
}
interface FirebaseApp {
firestore?(): types.FirebaseFirestore;
}
}
import './src/platform_node/node_init';
import * as types from '@firebase/firestore-types';
export declare function registerFirestore(instance: any): void;
declare module '@firebase/app-types' {
interface FirebaseNamespace {
firestore?: {
(app?: FirebaseApp): types.FirebaseFirestore;
Blob: typeof types.Blob;
CollectionReference: typeof types.CollectionReference;
DocumentReference: typeof types.DocumentReference;
DocumentSnapshot: typeof types.DocumentSnapshot;
FieldPath: typeof types.FieldPath;
FieldValue: typeof types.FieldValue;
Firestore: typeof types.FirebaseFirestore;
GeoPoint: typeof types.GeoPoint;
Query: typeof types.Query;
QuerySnapshot: typeof types.QuerySnapshot;
Transaction: typeof types.Transaction;
WriteBatch: typeof types.WriteBatch;
setLogLevel: typeof types.setLogLevel;
};
}
interface FirebaseApp {
firestore?(): types.FirebaseFirestore;
}
}

2

dist/cjs/src/api/credentials.d.ts

@@ -17,3 +17,3 @@ /**

import { User } from '../auth/user';
import { FirebaseApp } from '@firebase/app';
import { FirebaseApp } from '@firebase/app-types';
export interface FirstPartyCredentialsSettings {

@@ -20,0 +20,0 @@ type: 'gapi';

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

*/
import * as firestore from 'firestore';
import { FirebaseApp, FirebaseService } from '@firebase/app';
import * as firestore from '@firebase/firestore-types';
import { FirebaseApp } from '@firebase/app-types';
import { FirebaseService } from '@firebase/app-types/private';
import { FieldPath as ExternalFieldPath } from './field_path';

@@ -42,3 +43,3 @@ import { DatabaseId } from '../core/database_info';

*/
export declare class Firestore implements firestore.Firestore, FirebaseService {
export declare class Firestore implements firestore.FirebaseFirestore, FirebaseService {
private readonly _config;

@@ -45,0 +46,0 @@ readonly _databaseId: DatabaseId;

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

*/
import * as firestore from 'firestore';
import * as firestore from '@firebase/firestore-types';
import { FieldPath as InternalFieldPath } from '../model/path';

@@ -19,0 +19,0 @@ /**

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

*/
import * as firestore from 'firestore';
import * as firestore from '@firebase/firestore-types';
/**

@@ -19,0 +19,0 @@ * An opaque base class for FieldValue sentinel objects in our public API,

@@ -226,3 +226,3 @@ "use strict";

};
_this.remoteStore = new remote_store_1.RemoteStore(_this.databaseInfo, _this.asyncQueue, _this.localStore, datastore, onlineStateChangedHandler);
_this.remoteStore = new remote_store_1.RemoteStore(_this.localStore, datastore, onlineStateChangedHandler);
_this.syncEngine = new sync_engine_1.SyncEngine(_this.localStore, _this.remoteStore, user);

@@ -229,0 +229,0 @@ // Setup wiring between sync engine and remote store

@@ -308,3 +308,3 @@ "use strict";

// Gracefully handle if LocalStorage isn't available / working.
log.error(LOG_TAG, 'Failed to get zombie owner id.', e);
log.error('Failed to get zombie owner id.', e);
return null;

@@ -328,3 +328,3 @@ }

// Gracefully handle if LocalStorage isn't available / working.
log.error(LOG_TAG, 'Failed to set zombie owner id.', e);
log.error('Failed to set zombie owner id.', e);
}

@@ -331,0 +331,0 @@ };

@@ -147,4 +147,4 @@ "use strict";

// log the message we sent.
log.error(LOG_TAG, 'Failure sending:', msg);
log.error(LOG_TAG, 'Error:', e);
log.error('Failure sending:', msg);
log.error('Error:', e);
throw e;

@@ -151,0 +151,0 @@ }

@@ -1,2 +0,2 @@

import { FirebaseNamespace } from '@firebase/app';
import { FirebaseNamespace } from '@firebase/app-types';
/**

@@ -3,0 +3,0 @@ * Configures Firestore as part of the Firebase SDK by calling registerService.

@@ -243,3 +243,5 @@ "use strict";

else if (error && error.code === error_1.Code.RESOURCE_EXHAUSTED) {
log.debug(LOG_TAG, 'Using maximum backoff delay to prevent overloading the backend.');
// Log the error. (Probably either 'quota exceeded' or 'max queue length reached'.)
log.error(error.toString());
log.error('Using maximum backoff delay to prevent overloading the backend.');
this.backoff.resetToMax();

@@ -246,0 +248,0 @@ }

@@ -17,3 +17,2 @@ /**

import { User } from '../auth/user';
import { DatabaseInfo } from '../core/database_info';
import { Transaction } from '../core/transaction';

@@ -23,3 +22,2 @@ import { OnlineState, TargetId } from '../core/types';

import { QueryData } from '../local/query_data';
import { AsyncQueue } from '../util/async_queue';
import { Datastore } from './datastore';

@@ -47,4 +45,2 @@ import { RemoteSyncer } from './remote_syncer';

export declare class RemoteStore {
private databaseInfo;
private asyncQueue;
/**

@@ -97,3 +93,3 @@ * The local store, used to fill the write pipeline with outbound

private shouldWarnOffline;
constructor(databaseInfo: DatabaseInfo, asyncQueue: AsyncQueue,
constructor(
/**

@@ -100,0 +96,0 @@ * The local store, used to fill the write pipeline with outbound

@@ -62,3 +62,3 @@ "use strict";

var RemoteStore = /** @class */ (function () {
function RemoteStore(databaseInfo, asyncQueue,
function RemoteStore(
/**

@@ -71,4 +71,2 @@ * The local store, used to fill the write pipeline with outbound

datastore, onlineStateHandler) {
this.databaseInfo = databaseInfo;
this.asyncQueue = asyncQueue;
this.localStore = localStore;

@@ -149,3 +147,3 @@ this.datastore = datastore;

if (this.shouldWarnOffline) {
log.debug(LOG_TAG, 'Could not reach Firestore backend.');
log.error('Could not reach Firestore backend.');
this.shouldWarnOffline = false;

@@ -152,0 +150,0 @@ }

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

*/
import * as firestore from 'firestore';
import * as firestore from '@firebase/firestore-types';
/**

@@ -19,0 +19,0 @@ * Error Codes describing the different ways Firestore can fail. These come

import './src/platform_browser/browser_init';
import * as types from '@firebase/firestore-types';
export declare function registerFirestore(instance: any): void;
declare module '@firebase/app-types' {
interface FirebaseNamespace {
firestore?: {
(app?: FirebaseApp): types.FirebaseFirestore;
Blob: typeof types.Blob;
CollectionReference: typeof types.CollectionReference;
DocumentReference: typeof types.DocumentReference;
DocumentSnapshot: typeof types.DocumentSnapshot;
FieldPath: typeof types.FieldPath;
FieldValue: typeof types.FieldValue;
Firestore: typeof types.FirebaseFirestore;
GeoPoint: typeof types.GeoPoint;
Query: typeof types.Query;
QuerySnapshot: typeof types.QuerySnapshot;
Transaction: typeof types.Transaction;
WriteBatch: typeof types.WriteBatch;
setLogLevel: typeof types.setLogLevel;
};
}
interface FirebaseApp {
firestore?(): types.FirebaseFirestore;
}
}
import './src/platform_node/node_init';
import * as types from '@firebase/firestore-types';
export declare function registerFirestore(instance: any): void;
declare module '@firebase/app-types' {
interface FirebaseNamespace {
firestore?: {
(app?: FirebaseApp): types.FirebaseFirestore;
Blob: typeof types.Blob;
CollectionReference: typeof types.CollectionReference;
DocumentReference: typeof types.DocumentReference;
DocumentSnapshot: typeof types.DocumentSnapshot;
FieldPath: typeof types.FieldPath;
FieldValue: typeof types.FieldValue;
Firestore: typeof types.FirebaseFirestore;
GeoPoint: typeof types.GeoPoint;
Query: typeof types.Query;
QuerySnapshot: typeof types.QuerySnapshot;
Transaction: typeof types.Transaction;
WriteBatch: typeof types.WriteBatch;
setLogLevel: typeof types.setLogLevel;
};
}
interface FirebaseApp {
firestore?(): types.FirebaseFirestore;
}
}

@@ -17,3 +17,3 @@ /**

import { User } from '../auth/user';
import { FirebaseApp } from '@firebase/app';
import { FirebaseApp } from '@firebase/app-types';
export interface FirstPartyCredentialsSettings {

@@ -20,0 +20,0 @@ type: 'gapi';

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

*/
import * as firestore from 'firestore';
import { FirebaseApp, FirebaseService } from '@firebase/app';
import * as firestore from '@firebase/firestore-types';
import { FirebaseApp } from '@firebase/app-types';
import { FirebaseService } from '@firebase/app-types/private';
import { FieldPath as ExternalFieldPath } from './field_path';

@@ -42,3 +43,3 @@ import { DatabaseId } from '../core/database_info';

*/
export declare class Firestore implements firestore.Firestore, FirebaseService {
export declare class Firestore implements firestore.FirebaseFirestore, FirebaseService {
private readonly _config;

@@ -45,0 +46,0 @@ readonly _databaseId: DatabaseId;

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

*/
import * as firestore from 'firestore';
import * as firestore from '@firebase/firestore-types';
import { FieldPath as InternalFieldPath } from '../model/path';

@@ -19,0 +19,0 @@ /**

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

*/
import * as firestore from 'firestore';
import * as firestore from '@firebase/firestore-types';
/**

@@ -19,0 +19,0 @@ * An opaque base class for FieldValue sentinel objects in our public API,

@@ -224,3 +224,3 @@ /**

};
_this.remoteStore = new RemoteStore(_this.databaseInfo, _this.asyncQueue, _this.localStore, datastore, onlineStateChangedHandler);
_this.remoteStore = new RemoteStore(_this.localStore, datastore, onlineStateChangedHandler);
_this.syncEngine = new SyncEngine(_this.localStore, _this.remoteStore, user);

@@ -227,0 +227,0 @@ // Setup wiring between sync engine and remote store

@@ -306,3 +306,3 @@ /**

// Gracefully handle if LocalStorage isn't available / working.
log.error(LOG_TAG, 'Failed to get zombie owner id.', e);
log.error('Failed to get zombie owner id.', e);
return null;

@@ -326,3 +326,3 @@ }

// Gracefully handle if LocalStorage isn't available / working.
log.error(LOG_TAG, 'Failed to set zombie owner id.', e);
log.error('Failed to set zombie owner id.', e);
}

@@ -329,0 +329,0 @@ };

@@ -145,4 +145,4 @@ /**

// log the message we sent.
log.error(LOG_TAG, 'Failure sending:', msg);
log.error(LOG_TAG, 'Error:', e);
log.error('Failure sending:', msg);
log.error('Error:', e);
throw e;

@@ -149,0 +149,0 @@ }

@@ -1,2 +0,2 @@

import { FirebaseNamespace } from '@firebase/app';
import { FirebaseNamespace } from '@firebase/app-types';
/**

@@ -3,0 +3,0 @@ * Configures Firestore as part of the Firebase SDK by calling registerService.

@@ -241,3 +241,5 @@ /**

else if (error && error.code === Code.RESOURCE_EXHAUSTED) {
log.debug(LOG_TAG, 'Using maximum backoff delay to prevent overloading the backend.');
// Log the error. (Probably either 'quota exceeded' or 'max queue length reached'.)
log.error(error.toString());
log.error('Using maximum backoff delay to prevent overloading the backend.');
this.backoff.resetToMax();

@@ -244,0 +246,0 @@ }

@@ -17,3 +17,2 @@ /**

import { User } from '../auth/user';
import { DatabaseInfo } from '../core/database_info';
import { Transaction } from '../core/transaction';

@@ -23,3 +22,2 @@ import { OnlineState, TargetId } from '../core/types';

import { QueryData } from '../local/query_data';
import { AsyncQueue } from '../util/async_queue';
import { Datastore } from './datastore';

@@ -47,4 +45,2 @@ import { RemoteSyncer } from './remote_syncer';

export declare class RemoteStore {
private databaseInfo;
private asyncQueue;
/**

@@ -97,3 +93,3 @@ * The local store, used to fill the write pipeline with outbound

private shouldWarnOffline;
constructor(databaseInfo: DatabaseInfo, asyncQueue: AsyncQueue,
constructor(
/**

@@ -100,0 +96,0 @@ * The local store, used to fill the write pipeline with outbound

@@ -60,3 +60,3 @@ /**

var RemoteStore = /** @class */ (function () {
function RemoteStore(databaseInfo, asyncQueue,
function RemoteStore(
/**

@@ -69,4 +69,2 @@ * The local store, used to fill the write pipeline with outbound

datastore, onlineStateHandler) {
this.databaseInfo = databaseInfo;
this.asyncQueue = asyncQueue;
this.localStore = localStore;

@@ -147,3 +145,3 @@ this.datastore = datastore;

if (this.shouldWarnOffline) {
log.debug(LOG_TAG, 'Could not reach Firestore backend.');
log.error('Could not reach Firestore backend.');
this.shouldWarnOffline = false;

@@ -150,0 +148,0 @@ }

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

*/
import * as firestore from 'firestore';
import * as firestore from '@firebase/firestore-types';
/**

@@ -19,0 +19,0 @@ * Error Codes describing the different ways Firestore can fail. These come

@@ -21,2 +21,3 @@ /**

import { configureForFirebase } from './src/platform/config';
import * as types from '@firebase/firestore-types';

@@ -28,1 +29,25 @@ export function registerFirestore(instance) {

registerFirestore(firebase);
declare module '@firebase/app-types' {
interface FirebaseNamespace {
firestore?: {
(app?: FirebaseApp): types.FirebaseFirestore;
Blob: typeof types.Blob;
CollectionReference: typeof types.CollectionReference;
DocumentReference: typeof types.DocumentReference;
DocumentSnapshot: typeof types.DocumentSnapshot;
FieldPath: typeof types.FieldPath;
FieldValue: typeof types.FieldValue;
Firestore: typeof types.FirebaseFirestore;
GeoPoint: typeof types.GeoPoint;
Query: typeof types.Query;
QuerySnapshot: typeof types.QuerySnapshot;
Transaction: typeof types.Transaction;
WriteBatch: typeof types.WriteBatch;
setLogLevel: typeof types.setLogLevel;
};
}
interface FirebaseApp {
firestore?(): types.FirebaseFirestore;
}
}
{
"name": "@firebase/firestore",
"version": "0.2.1",
"version": "0.2.2",
"description": "",

@@ -21,2 +21,3 @@ "scripts": {

"dependencies": {
"@firebase/firestore-types": "0.1.0",
"@firebase/webchannel-wrapper": "0.2.5",

@@ -26,3 +27,4 @@ "grpc": "^1.7.1"

"peerDependencies": {
"@firebase/app": "^0.1.0"
"@firebase/app": "^0.1.0",
"@firebase/app-types": "^0.1.0"
},

@@ -62,2 +64,3 @@ "devDependencies": {

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

@@ -64,0 +67,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

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

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

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

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

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

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