@google-cloud/firestore
Advanced tools
Comparing version 3.6.0 to 3.7.0
@@ -137,3 +137,3 @@ /*! | ||
backoffAndWait(): Promise<void>; | ||
readonly retryCount: number; | ||
get retryCount(): number; | ||
/** | ||
@@ -140,0 +140,0 @@ * Returns a randomized "jitter" delay based on the current base and jitter |
@@ -61,3 +61,3 @@ /*! | ||
*/ | ||
readonly type: DocumentChangeType; | ||
get type(): DocumentChangeType; | ||
/** | ||
@@ -82,3 +82,3 @@ * The document affected by this change. | ||
*/ | ||
readonly doc: QueryDocumentSnapshot<T>; | ||
get doc(): QueryDocumentSnapshot<T>; | ||
/** | ||
@@ -111,3 +111,3 @@ * The index of the changed document in the result set immediately prior to | ||
*/ | ||
readonly oldIndex: number; | ||
get oldIndex(): number; | ||
/** | ||
@@ -141,3 +141,3 @@ * The index of the changed document in the result set immediately after | ||
*/ | ||
readonly newIndex: number; | ||
get newIndex(): number; | ||
/** | ||
@@ -144,0 +144,0 @@ * Returns true if the data in this `DocumentChange` is equal to the provided |
@@ -122,3 +122,3 @@ /*! | ||
*/ | ||
readonly exists: boolean; | ||
get exists(): boolean; | ||
/** | ||
@@ -141,3 +141,3 @@ * A [DocumentReference]{@link DocumentReference} for the document | ||
*/ | ||
readonly ref: DocumentReference<T>; | ||
get ref(): DocumentReference<T>; | ||
/** | ||
@@ -159,3 +159,3 @@ * The ID of the document for which this DocumentSnapshot contains data. | ||
*/ | ||
readonly id: string; | ||
get id(): string; | ||
/** | ||
@@ -179,3 +179,3 @@ * The time the document was created. Undefined for documents that don't | ||
*/ | ||
readonly createTime: Timestamp | undefined; | ||
get createTime(): Timestamp | undefined; | ||
/** | ||
@@ -199,3 +199,3 @@ * The time the document was last updated (at the time the snapshot was | ||
*/ | ||
readonly updateTime: Timestamp | undefined; | ||
get updateTime(): Timestamp | undefined; | ||
/** | ||
@@ -216,3 +216,3 @@ * The time this snapshot was read. | ||
*/ | ||
readonly readTime: Timestamp; | ||
get readTime(): Timestamp; | ||
/** | ||
@@ -269,3 +269,3 @@ * Retrieves all fields in the document as an object. Returns 'undefined' if | ||
*/ | ||
readonly isEmpty: boolean; | ||
get isEmpty(): boolean; | ||
/** | ||
@@ -330,3 +330,3 @@ * Convert a document snapshot to the Firestore 'Document' Protobuf. | ||
*/ | ||
readonly createTime: Timestamp; | ||
get createTime(): Timestamp; | ||
/** | ||
@@ -348,3 +348,3 @@ * The time the document was last updated (at the time the snapshot was | ||
*/ | ||
readonly updateTime: Timestamp; | ||
get updateTime(): Timestamp; | ||
/** | ||
@@ -411,3 +411,3 @@ * Retrieves all fields in the document as an object. | ||
*/ | ||
readonly isEmpty: boolean; | ||
get isEmpty(): boolean; | ||
/** | ||
@@ -496,3 +496,3 @@ * Removes the specified values from a sorted field path array. | ||
*/ | ||
readonly isEmpty: boolean; | ||
get isEmpty(): boolean; | ||
/** | ||
@@ -503,3 +503,3 @@ * Returns the array of fields in this DocumentTransform. | ||
*/ | ||
readonly fields: FieldPath[]; | ||
get fields(): FieldPath[]; | ||
/** | ||
@@ -556,3 +556,3 @@ * Validates the user provided field values in this document transform. | ||
*/ | ||
readonly isEmpty: boolean; | ||
get isEmpty(): boolean; | ||
} |
@@ -185,3 +185,3 @@ /*! | ||
/** Whether this FieldTransform should be included in the document mask. */ | ||
abstract readonly includeInDocumentMask: boolean; | ||
abstract get includeInDocumentMask(): boolean; | ||
/** | ||
@@ -191,5 +191,5 @@ * Whether this FieldTransform should be included in the list of document | ||
*/ | ||
abstract readonly includeInDocumentTransform: boolean; | ||
abstract get includeInDocumentTransform(): boolean; | ||
/** The method name used to obtain the field transform. */ | ||
abstract readonly methodName: string; | ||
abstract get methodName(): string; | ||
/** Performs input validation on the values of this field transform. */ | ||
@@ -222,3 +222,3 @@ abstract validate(): void; | ||
*/ | ||
readonly includeInDocumentMask: true; | ||
get includeInDocumentMask(): true; | ||
/** | ||
@@ -228,6 +228,6 @@ * Deletes are are omitted from document transforms. | ||
*/ | ||
readonly includeInDocumentTransform: false; | ||
readonly methodName: string; | ||
get includeInDocumentTransform(): false; | ||
get methodName(): string; | ||
validate(): void; | ||
toProto(serializer: Serializer, fieldPath: FieldPath): never; | ||
} |
@@ -52,3 +52,3 @@ /*! | ||
*/ | ||
readonly latitude: number; | ||
get latitude(): number; | ||
/** | ||
@@ -61,3 +61,3 @@ * The longitude as a number between -180 and 180. | ||
*/ | ||
readonly longitude: number; | ||
get longitude(): number; | ||
/** | ||
@@ -64,0 +64,0 @@ * Returns true if this `GeoPoint` is equal to the provided value. |
@@ -234,3 +234,3 @@ /*! | ||
*/ | ||
readonly projectId: string; | ||
get projectId(): string; | ||
/** | ||
@@ -242,3 +242,3 @@ * Returns the root path of the database. Validates that | ||
*/ | ||
readonly formattedName: string; | ||
get formattedName(): string; | ||
/** | ||
@@ -245,0 +245,0 @@ * Gets a [DocumentReference]{@link DocumentReference} instance that |
@@ -46,3 +46,3 @@ /*! | ||
*/ | ||
readonly size: number; | ||
get size(): number; | ||
abstract construct(segments: string[] | string): T; | ||
@@ -120,3 +120,3 @@ abstract split(relativePath: string): string[]; | ||
*/ | ||
readonly isDocument: boolean; | ||
get isDocument(): boolean; | ||
/** | ||
@@ -126,3 +126,3 @@ * Indicates whether this path points to a collection. | ||
*/ | ||
readonly isCollection: boolean; | ||
get isCollection(): boolean; | ||
/** | ||
@@ -132,3 +132,3 @@ * The last component of the path. | ||
*/ | ||
readonly id: string | null; | ||
get id(): string | null; | ||
/** | ||
@@ -139,3 +139,3 @@ * Returns the location of this path relative to the root of the project's | ||
*/ | ||
readonly relativeName: string; | ||
get relativeName(): string; | ||
/** | ||
@@ -196,3 +196,3 @@ * Constructs a new instance of ResourcePath. | ||
*/ | ||
readonly relativeName: string; | ||
get relativeName(): string; | ||
/** | ||
@@ -227,3 +227,3 @@ * Creates a resource path from an absolute Firestore path. | ||
*/ | ||
readonly formattedName: string; | ||
get formattedName(): string; | ||
/** | ||
@@ -325,3 +325,3 @@ * Constructs a new instance of ResourcePath. We need this instead of using | ||
*/ | ||
readonly formattedName: string; | ||
get formattedName(): string; | ||
/** | ||
@@ -328,0 +328,0 @@ * Returns a string representation of this path. |
@@ -82,3 +82,3 @@ /*! | ||
*/ | ||
readonly size: number; | ||
get size(): number; | ||
/** | ||
@@ -90,3 +90,3 @@ * The number of currently active operations. | ||
*/ | ||
readonly opCount: number; | ||
get opCount(): number; | ||
/** | ||
@@ -93,0 +93,0 @@ * Runs the provided operation in this pool. This function may create an |
@@ -72,3 +72,3 @@ /*! | ||
*/ | ||
readonly formattedName: string; | ||
get formattedName(): string; | ||
/** | ||
@@ -90,3 +90,3 @@ * The [Firestore]{@link Firestore} instance for the Firestore | ||
*/ | ||
readonly firestore: Firestore; | ||
get firestore(): Firestore; | ||
/** | ||
@@ -107,3 +107,3 @@ * A string representing the path of the referenced document (relative | ||
*/ | ||
readonly path: string; | ||
get path(): string; | ||
/** | ||
@@ -123,3 +123,3 @@ * The last path element of the referenced document. | ||
*/ | ||
readonly id: string; | ||
get id(): string; | ||
/** | ||
@@ -140,3 +140,3 @@ * A reference to the collection to which this DocumentReference belongs. | ||
*/ | ||
readonly parent: CollectionReference<T>; | ||
get parent(): CollectionReference<T>; | ||
/** | ||
@@ -477,3 +477,3 @@ * Reads the document referred to by this DocumentReference. | ||
*/ | ||
readonly query: Query<T>; | ||
get query(): Query<T>; | ||
/** | ||
@@ -496,3 +496,3 @@ * An array of all the documents in this QuerySnapshot. | ||
*/ | ||
readonly docs: Array<QueryDocumentSnapshot<T>>; | ||
get docs(): Array<QueryDocumentSnapshot<T>>; | ||
/** | ||
@@ -514,3 +514,3 @@ * True if there are no documents in the QuerySnapshot. | ||
*/ | ||
readonly empty: boolean; | ||
get empty(): boolean; | ||
/** | ||
@@ -530,3 +530,3 @@ * The number of documents in the QuerySnapshot. | ||
*/ | ||
readonly size: number; | ||
get size(): number; | ||
/** | ||
@@ -546,3 +546,3 @@ * The time this query snapshot was obtained. | ||
*/ | ||
readonly readTime: Timestamp; | ||
get readTime(): Timestamp; | ||
/** | ||
@@ -598,5 +598,13 @@ * Returns an array of the documents changes since the last snapshot. If | ||
interface QueryCursor { | ||
before?: boolean; | ||
before: boolean; | ||
values: unknown[]; | ||
} | ||
/*! | ||
* Denotes whether a provided limit is applied to the beginning or the end of | ||
* the result set. | ||
*/ | ||
declare enum LimitType { | ||
First = 0, | ||
Last = 1 | ||
} | ||
/** | ||
@@ -618,5 +626,6 @@ * Internal class representing custom Query options. | ||
readonly limit?: number | undefined; | ||
readonly limitType?: LimitType | undefined; | ||
readonly offset?: number | undefined; | ||
readonly projection?: api.StructuredQuery.IProjection | undefined; | ||
constructor(parentPath: ResourcePath, collectionId: string, converter: FirestoreDataConverter<T>, allDescendants: boolean, fieldFilters: FieldFilter[], fieldOrders: FieldOrder[], startAt?: QueryCursor | undefined, endAt?: QueryCursor | undefined, limit?: number | undefined, offset?: number | undefined, projection?: api.StructuredQuery.IProjection | undefined); | ||
constructor(parentPath: ResourcePath, collectionId: string, converter: FirestoreDataConverter<T>, allDescendants: boolean, fieldFilters: FieldFilter[], fieldOrders: FieldOrder[], startAt?: QueryCursor | undefined, endAt?: QueryCursor | undefined, limit?: number | undefined, limitType?: LimitType | undefined, offset?: number | undefined, projection?: api.StructuredQuery.IProjection | undefined); | ||
/** | ||
@@ -638,2 +647,3 @@ * Returns query options for a collection group query. | ||
withConverter<U>(converter: FirestoreDataConverter<U>): QueryOptions<U>; | ||
hasFieldOrders(): boolean; | ||
isEqual(other: QueryOptions<T>): any; | ||
@@ -695,3 +705,3 @@ } | ||
*/ | ||
readonly firestore: Firestore; | ||
get firestore(): Firestore; | ||
/** | ||
@@ -771,4 +781,4 @@ * Creates and returns a new [Query]{@link Query} with the additional filter | ||
/** | ||
* Creates and returns a new [Query]{@link Query} that's additionally limited | ||
* to only return up to the specified number of documents. | ||
* Creates and returns a new [Query]{@link Query} that only returns the | ||
* first matching documents. | ||
* | ||
@@ -792,2 +802,24 @@ * This function returns a new (immutable) instance of the Query (rather than | ||
/** | ||
* Creates and returns a new [Query]{@link Query} that only returns the | ||
* last matching documents. | ||
* | ||
* You must specify at least one orderBy clause for limitToLast queries, | ||
* otherwise an exception will be thrown during execution. | ||
* | ||
* Results for limitToLast queries cannot be streamed via the `stream()` API. | ||
* | ||
* @param limit The maximum number of items to return. | ||
* @return The created Query. | ||
* | ||
* @example | ||
* let query = firestore.collection('col').where('foo', '>', 42); | ||
* | ||
* query.limitToLast(1).get().then(querySnapshot => { | ||
* querySnapshot.forEach(documentSnapshot => { | ||
* console.log(`Last matching document is ${documentSnapshot.ref.path}`); | ||
* }); | ||
* }); | ||
*/ | ||
limitToLast(limit: number): Query<T>; | ||
/** | ||
* Specifies the offset of the returned results. | ||
@@ -981,5 +1013,7 @@ * | ||
* Converts a QueryCursor to its proto representation. | ||
* | ||
* @param cursor The original cursor value | ||
* @private | ||
*/ | ||
private _toCursor; | ||
private toCursor; | ||
/** | ||
@@ -995,9 +1029,9 @@ * Internal method for serializing a query to its RunQuery proto | ||
/** | ||
* Internal streaming method that accepts an optional transaction id. | ||
* Internal streaming method that accepts the request proto. | ||
* | ||
* @param transactionId A transaction ID. | ||
* @param request The request proto. | ||
* @private | ||
* @returns A stream of document results. | ||
*/ | ||
_stream(transactionId?: Uint8Array): NodeJS.ReadableStream; | ||
_stream(request: api.IRunQueryRequest): NodeJS.ReadableStream; | ||
/** | ||
@@ -1099,3 +1133,3 @@ * Attaches a listener for QuerySnapshot events. | ||
*/ | ||
private readonly resourcePath; | ||
private get resourcePath(); | ||
/** | ||
@@ -1112,3 +1146,3 @@ * The last path element of the referenced collection. | ||
*/ | ||
readonly id: string; | ||
get id(): string; | ||
/** | ||
@@ -1127,3 +1161,3 @@ * A reference to the containing Document if this is a subcollection, else | ||
*/ | ||
readonly parent: DocumentReference<DocumentData>; | ||
get parent(): DocumentReference<DocumentData>; | ||
/** | ||
@@ -1141,3 +1175,3 @@ * A string representing the path of the referenced collection (relative | ||
*/ | ||
readonly path: string; | ||
get path(): string; | ||
/** | ||
@@ -1144,0 +1178,0 @@ * Retrieves the list of documents in this collection. |
@@ -108,3 +108,3 @@ /*! | ||
*/ | ||
readonly seconds: number; | ||
get seconds(): number; | ||
/** | ||
@@ -123,3 +123,3 @@ * The non-negative fractions of a second at nanosecond resolution. | ||
*/ | ||
readonly nanoseconds: number; | ||
get nanoseconds(): number; | ||
/** | ||
@@ -126,0 +126,0 @@ * Returns a new `Date` corresponding to this timestamp. This may lose |
@@ -70,3 +70,3 @@ /// <reference types="node" /> | ||
*/ | ||
static readonly servicePath: string; | ||
static get servicePath(): string; | ||
/** | ||
@@ -76,7 +76,7 @@ * The DNS address for this API service - same as servicePath(), | ||
*/ | ||
static readonly apiEndpoint: string; | ||
static get apiEndpoint(): string; | ||
/** | ||
* The port for this API service. | ||
*/ | ||
static readonly port: number; | ||
static get port(): number; | ||
/** | ||
@@ -86,3 +86,3 @@ * The scopes needed to make gRPC calls for every method defined | ||
*/ | ||
static readonly scopes: string[]; | ||
static get scopes(): string[]; | ||
getProjectId(): Promise<string>; | ||
@@ -89,0 +89,0 @@ getProjectId(callback: Callback<string, undefined, undefined>): void; |
@@ -74,3 +74,3 @@ /// <reference types="node" /> | ||
*/ | ||
static readonly servicePath: string; | ||
static get servicePath(): string; | ||
/** | ||
@@ -80,7 +80,7 @@ * The DNS address for this API service - same as servicePath(), | ||
*/ | ||
static readonly apiEndpoint: string; | ||
static get apiEndpoint(): string; | ||
/** | ||
* The port for this API service. | ||
*/ | ||
static readonly port: number; | ||
static get port(): number; | ||
/** | ||
@@ -90,3 +90,3 @@ * The scopes needed to make gRPC calls for every method defined | ||
*/ | ||
static readonly scopes: string[]; | ||
static get scopes(): string[]; | ||
getProjectId(): Promise<string>; | ||
@@ -93,0 +93,0 @@ getProjectId(callback: Callback<string, undefined, undefined>): void; |
@@ -82,3 +82,3 @@ /// <reference types="node" /> | ||
*/ | ||
static readonly servicePath: string; | ||
static get servicePath(): string; | ||
/** | ||
@@ -88,7 +88,7 @@ * The DNS address for this API service - same as servicePath(), | ||
*/ | ||
static readonly apiEndpoint: string; | ||
static get apiEndpoint(): string; | ||
/** | ||
* The port for this API service. | ||
*/ | ||
static readonly port: number; | ||
static get port(): number; | ||
/** | ||
@@ -98,3 +98,3 @@ * The scopes needed to make gRPC calls for every method defined | ||
*/ | ||
static readonly scopes: string[]; | ||
static get scopes(): string[]; | ||
getProjectId(): Promise<string>; | ||
@@ -101,0 +101,0 @@ getProjectId(callback: Callback<string, undefined, undefined>): void; |
@@ -51,3 +51,3 @@ /*! | ||
*/ | ||
readonly writeTime: Timestamp; | ||
get writeTime(): Timestamp; | ||
/** | ||
@@ -88,3 +88,3 @@ * Returns true if this `WriteResult` is equal to the provided value. | ||
*/ | ||
readonly isEmpty: boolean; | ||
get isEmpty(): boolean; | ||
/** | ||
@@ -91,0 +91,0 @@ * Throws an error if this batch has already been committed. |
@@ -7,2 +7,10 @@ # Changelog | ||
## [3.7.0](https://www.github.com/googleapis/nodejs-firestore/compare/v3.6.0...v3.7.0) (2020-03-11) | ||
### Features | ||
* **deps:** update to TypeScript 3.8 ([#962](https://www.github.com/googleapis/nodejs-firestore/issues/962)) ([12982cd](https://www.github.com/googleapis/nodejs-firestore/commit/12982cd9ef6b418b6bc9fa303bb804255b9c906a)) | ||
* add support for Query.limitToLast() ([#954](https://www.github.com/googleapis/nodejs-firestore/issues/954)) ([c89546f](https://www.github.com/googleapis/nodejs-firestore/commit/c89546f5ae83da3845076aeeffcda75f9b208f5c)) | ||
## [3.6.0](https://www.github.com/googleapis/nodejs-firestore/compare/v3.5.1...v3.6.0) (2020-03-09) | ||
@@ -9,0 +17,0 @@ |
{ | ||
"name": "@google-cloud/firestore", | ||
"description": "Firestore Client Library for Node.js", | ||
"version": "3.6.0", | ||
"version": "3.7.0", | ||
"license": "Apache-2.0", | ||
@@ -83,4 +83,4 @@ "author": "Google Inc.", | ||
"ts-node": "^8.5.4", | ||
"typescript": "3.6.4" | ||
"typescript": "3.8.3" | ||
} | ||
} |
@@ -896,4 +896,4 @@ /** | ||
/** | ||
* Creates and returns a new Query that's additionally limited to only | ||
* return up to the specified number of documents. | ||
* Creates and returns a new Query that only returns the first matching | ||
* documents. | ||
* | ||
@@ -907,2 +907,17 @@ * This function returns a new (immutable) instance of the Query (rather | ||
limit(limit: number): Query<T>; | ||
/** | ||
* Creates and returns a new Query that only returns the last matching | ||
* documents. | ||
* | ||
* You must specify at least one orderBy clause for limitToLast queries, | ||
* otherwise an exception will be thrown during execution. | ||
* | ||
* Results for limitToLast queries cannot be streamed via the `stream()` | ||
* API. | ||
* | ||
* @param limit The maximum number of items to return. | ||
* @return The created Query. | ||
*/ | ||
limitToLast(limit: number): Query<T>; | ||
@@ -909,0 +924,0 @@ /** |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2463339
50429