Socket
Socket
Sign inDemoInstall

@google-cloud/firestore

Package Overview
Dependencies
Maintainers
1
Versions
145
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@google-cloud/firestore - npm Package Compare versions

Comparing version 6.3.0 to 6.4.0

2

build/src/convert.js

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

if (detectedValues.length !== 1) {
throw new Error(`Unable to infer type value fom '${JSON.stringify(proto)}'.`);
throw new Error(`Unable to infer type value from '${JSON.stringify(proto)}'.`);
}

@@ -139,0 +139,0 @@ return detectedValues[0];

@@ -322,2 +322,9 @@ /*!

/**
* The database ID provided via `.settings()`.
*
* @private
* @internal
*/
private _databaseId;
/**
* Count of listeners that have been registered on the client.

@@ -411,2 +418,9 @@ *

/**
* Returns the Database ID for this Firestore instance.
*
* @private
* @internal
*/
get databaseId(): string;
/**
* Returns the root path of the database. Validates that

@@ -546,3 +560,2 @@ * `initializeIfNeeded()` was called before.

* @private
* @internal
* @param documentOrName The Firestore 'Document' proto or the resource name

@@ -549,0 +562,0 @@ * of a missing document.

@@ -403,2 +403,9 @@ "use strict";

/**
* The database ID provided via `.settings()`.
*
* @private
* @internal
*/
this._databaseId = undefined;
/**
* Count of listeners that have been registered on the client.

@@ -507,2 +514,5 @@ *

(0, validate_1.validateString)('settings.projectId', settings.projectId, { optional: true });
(0, validate_1.validateString)('settings.databaseId', settings.databaseId, {
optional: true,
});
if (this._settingsFrozen) {

@@ -523,2 +533,6 @@ throw new Error('Firestore has already been initialized. You can only call ' +

}
if (settings.databaseId !== undefined) {
(0, validate_1.validateString)('settings.databaseId', settings.databaseId);
this._databaseId = settings.databaseId;
}
let url = null;

@@ -592,2 +606,11 @@ // If the environment variable is set, it should always take precedence

/**
* Returns the Database ID for this Firestore instance.
*
* @private
* @internal
*/
get databaseId() {
return this._databaseId || path_1.DEFAULT_DATABASE_ID;
}
/**
* Returns the root path of the database. Validates that

@@ -600,3 +623,3 @@ * `initializeIfNeeded()` was called before.

get formattedName() {
return `projects/${this.projectId}/databases/${path_1.DEFAULT_DATABASE_ID}`;
return `projects/${this.projectId}/databases/${this.databaseId}`;
}

@@ -603,0 +626,0 @@ /**

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

/// <reference types="node" />
/// <reference types="node" />
import * as firestore from '@google-cloud/firestore';
import { Readable } from 'stream';
import * as protos from '../protos/firestore_v1_proto_api';

@@ -860,2 +862,22 @@ import { DocumentSnapshot, QueryDocumentSnapshot } from './document';

/**
* Returns a query that counts the documents in the result set of this
* query.
*
* The returned query, when executed, counts the documents in the result set
* of this query without actually downloading the documents.
*
* Using the returned query to count the documents is efficient because only
* the final count, not the documents' data, is downloaded. The returned
* query can even count the documents if the result set would be
* prohibitively large to download entirely (e.g. thousands of documents).
*
* @return a query that counts the documents in the result set of this
* query. The count can be retrieved from `snapshot.data().count`, where
* `snapshot` is the `AggregateQuerySnapshot` resulting from running the
* returned query.
*/
count(): AggregateQuery<{
count: firestore.AggregateField<number>;
}>;
/**
* Returns true if this `Query` is equal to the provided value.

@@ -1247,2 +1269,116 @@ *

/**
* A query that calculates aggregations over an underlying query.
*/
export declare class AggregateQuery<T extends firestore.AggregateSpec> implements firestore.AggregateQuery<T> {
private readonly _query;
private readonly _aggregates;
/**
* @private
* @internal
*
* @param _query The query whose aggregations will be calculated by this
* object.
* @param _aggregates The aggregations that will be performed by this query.
*/
constructor(_query: Query<any>, _aggregates: T);
/** The query whose aggregations will be calculated by this object. */
get query(): firestore.Query<unknown>;
/**
* Executes this query.
*
* @return A promise that will be resolved with the results of the query.
*/
get(): Promise<AggregateQuerySnapshot<T>>;
/**
* Internal get() method that accepts an optional transaction id.
*
* @private
* @internal
* @param {bytes=} transactionId A transaction ID.
*/
_get(transactionId?: Uint8Array): Promise<AggregateQuerySnapshot<T>>;
/**
* Internal streaming method that accepts an optional transaction ID.
*
* @private
* @internal
* @param transactionId A transaction ID.
* @returns A stream of document results.
*/
_stream(transactionId?: Uint8Array): Readable;
/**
* Internal method to decode values within result.
* @private
*/
private decodeResult;
/**
* Internal method for serializing a query to its RunAggregationQuery proto
* representation with an optional transaction id.
*
* @private
* @internal
* @returns Serialized JSON for the query.
*/
toProto(transactionId?: Uint8Array): api.IRunAggregationQueryRequest;
/**
* Compares this object with the given object for equality.
*
* This object is considered "equal" to the other object if and only if
* `other` performs the same aggregations as this `AggregateQuery` and
* the underlying Query of `other` compares equal to that of this object
* using `Query.isEqual()`.
*
* @param other The object to compare to this object for equality.
* @return `true` if this object is "equal" to the given object, as
* defined above, or `false` otherwise.
*/
isEqual(other: firestore.AggregateQuery<T>): boolean;
}
/**
* The results of executing an aggregation query.
*/
export declare class AggregateQuerySnapshot<T extends firestore.AggregateSpec> implements firestore.AggregateQuerySnapshot<T> {
private readonly _query;
private readonly _readTime;
private readonly _data;
/**
* @private
* @internal
*
* @param _query The query that was executed to produce this result.
* @param _readTime The time this snapshot was read.
* @param _data The results of the aggregations performed over the underlying
* query.
*/
constructor(_query: AggregateQuery<T>, _readTime: Timestamp, _data: firestore.AggregateSpecData<T>);
/** The query that was executed to produce this result. */
get query(): firestore.AggregateQuery<T>;
/** The time this snapshot was read. */
get readTime(): firestore.Timestamp;
/**
* Returns the results of the aggregations performed over the underlying
* query.
*
* The keys of the returned object will be the same as those of the
* `AggregateSpec` object specified to the aggregation method, and the
* values will be the corresponding aggregation result.
*
* @returns The results of the aggregations performed over the underlying
* query.
*/
data(): firestore.AggregateSpecData<T>;
/**
* Compares this object with the given object for equality.
*
* Two `AggregateQuerySnapshot` instances are considered "equal" if they
* have the same data and their underlying queries compare "equal" using
* `AggregateQuery.isEqual()`.
*
* @param other The object to compare to this object for equality.
* @return `true` if this object is "equal" to the given object, as
* defined above, or `false` otherwise.
*/
isEqual(other: firestore.AggregateQuerySnapshot<T>): boolean;
}
/**
* Validates the input string as a field order direction.

@@ -1249,0 +1385,0 @@ *

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

import { FieldPath } from './path';
import { DocumentReference, Query, QuerySnapshot } from './reference';
import { AggregateQuerySnapshot, DocumentReference, Query, QuerySnapshot } from './reference';
/**

@@ -63,2 +63,10 @@ * A reference to a transaction.

/**
* Retrieves an aggregate query result. Holds a pessimistic lock on all
* documents that were matched by the underlying query.
*
* @param aggregateQuery An aggregate query to execute.
* @return An AggregateQuerySnapshot for the retrieved data.
*/
get<T extends firestore.AggregateSpec>(aggregateQuery: firestore.AggregateQuery<T>): Promise<AggregateQuerySnapshot<T>>;
/**
* Retrieves multiple documents from Firestore. Holds a pessimistic lock on

@@ -65,0 +73,0 @@ * all returned documents.

@@ -89,3 +89,6 @@ "use strict";

}
throw new Error('Value for argument "refOrQuery" must be a DocumentReference or a Query.');
if (refOrQuery instanceof (reference_1.AggregateQuery)) {
return refOrQuery._get(this._transactionId);
}
throw new Error('Value for argument "refOrQuery" must be a DocumentReference, Query, or AggregateQuery.');
}

@@ -92,0 +95,0 @@ /**

@@ -43,2 +43,3 @@ /*!

runQuery(request?: api.IRunQueryRequest, options?: CallOptions): Duplex;
runAggregationQuery(request?: api.IRunAggregationQueryRequest, options?: CallOptions): Duplex;
listDocuments(request: api.IListDocumentsRequest, options?: CallOptions): Promise<[api.IDocument[], unknown, unknown]>;

@@ -53,3 +54,3 @@ listCollectionIds(request: api.IListCollectionIdsRequest, options?: CallOptions): Promise<[string[], unknown, unknown]>;

/** Streaming methods used in the Firestore SDK. */
export declare type FirestoreStreamingMethod = 'listen' | 'partitionQueryStream' | 'runQuery' | 'batchGetDocuments';
export declare type FirestoreStreamingMethod = 'listen' | 'partitionQueryStream' | 'runQuery' | 'runAggregationQuery' | 'batchGetDocuments';
/** Type signature for the unary methods in the GAPIC layer. */

@@ -56,0 +57,0 @@ export declare type UnaryMethod<Req, Resp> = (request: Req, callOptions: CallOptions) => Promise<[Resp, unknown, unknown]>;

{
"name": "@google-cloud/firestore",
"description": "Firestore Client Library for Node.js",
"version": "6.3.0",
"version": "6.4.0",
"license": "Apache-2.0",

@@ -6,0 +6,0 @@ "author": "Google Inc.",

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

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