@firebase/firestore 3.5.0 → 3.6.0-canary.0a112bd2a
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/CHANGELOG.md +18 -0
- package/dist/firestore/lite/index.d.ts +2 -0
- package/dist/firestore/src/api/aggregate.d.ts +43 -0
- package/dist/firestore/src/api/database.d.ts +15 -15
- package/dist/firestore/src/api.d.ts +2 -0
- package/dist/firestore/src/core/count_query_runner.d.ts +32 -0
- package/dist/firestore/src/core/firestore_client.d.ts +5 -0
- package/dist/firestore/src/core/view.d.ts +1 -0
- package/dist/firestore/src/core/view_snapshot.d.ts +3 -2
- package/dist/firestore/src/lite-api/aggregate.d.ts +48 -0
- package/dist/firestore/src/lite-api/aggregate_types.d.ts +69 -0
- package/dist/firestore/src/lite-api/database.d.ts +7 -7
- package/dist/firestore/src/platform/node/grpc_connection.d.ts +1 -0
- package/dist/firestore/src/protos/firestore_proto_api.d.ts +28 -0
- package/dist/firestore/src/remote/connection.d.ts +7 -0
- package/dist/firestore/src/remote/datastore.d.ts +2 -0
- package/dist/firestore/src/remote/remote_event.d.ts +2 -2
- package/dist/firestore/src/remote/rest_connection.d.ts +1 -0
- package/dist/firestore/src/remote/serializer.d.ts +2 -1
- package/dist/firestore/test/integration/api/aggregation.test.d.ts +17 -0
- package/dist/firestore/test/integration/api_internal/aggregation.test.d.ts +17 -0
- package/dist/firestore/test/integration/util/helpers.d.ts +1 -0
- package/dist/firestore/test/unit/specs/spec_test_components.d.ts +1 -0
- package/dist/firestore/test/util/api_helpers.d.ts +1 -1
- package/dist/index.d.ts +196 -14
- package/dist/index.esm2017.js +4633 -4428
- package/dist/index.esm2017.js.map +1 -1
- package/dist/index.esm5.js +4706 -4498
- package/dist/index.esm5.js.map +1 -1
- package/dist/index.node.cjs.js +1021 -632
- package/dist/index.node.cjs.js.map +1 -1
- package/dist/index.node.mjs +1019 -634
- package/dist/index.node.mjs.map +1 -1
- package/dist/index.rn.js +4637 -4432
- package/dist/index.rn.js.map +1 -1
- package/dist/internal.d.ts +144 -21
- package/dist/lite/firestore/lite/index.d.ts +2 -0
- package/dist/lite/firestore/src/api/aggregate.d.ts +43 -0
- package/dist/lite/firestore/src/api/database.d.ts +15 -15
- package/dist/lite/firestore/src/api.d.ts +2 -0
- package/dist/lite/firestore/src/core/count_query_runner.d.ts +32 -0
- package/dist/lite/firestore/src/core/firestore_client.d.ts +5 -0
- package/dist/lite/firestore/src/core/view.d.ts +1 -0
- package/dist/lite/firestore/src/core/view_snapshot.d.ts +3 -2
- package/dist/lite/firestore/src/lite-api/aggregate.d.ts +48 -0
- package/dist/lite/firestore/src/lite-api/aggregate_types.d.ts +69 -0
- package/dist/lite/firestore/src/lite-api/database.d.ts +7 -7
- package/dist/lite/firestore/src/platform/node/grpc_connection.d.ts +1 -0
- package/dist/lite/firestore/src/protos/firestore_proto_api.d.ts +28 -0
- package/dist/lite/firestore/src/remote/connection.d.ts +7 -0
- package/dist/lite/firestore/src/remote/datastore.d.ts +2 -0
- package/dist/lite/firestore/src/remote/remote_event.d.ts +2 -2
- package/dist/lite/firestore/src/remote/rest_connection.d.ts +1 -0
- package/dist/lite/firestore/src/remote/serializer.d.ts +2 -1
- package/dist/lite/firestore/test/integration/api/aggregation.test.d.ts +17 -0
- package/dist/lite/firestore/test/integration/api_internal/aggregation.test.d.ts +17 -0
- package/dist/lite/firestore/test/integration/util/helpers.d.ts +1 -0
- package/dist/lite/firestore/test/unit/specs/spec_test_components.d.ts +1 -0
- package/dist/lite/firestore/test/util/api_helpers.d.ts +1 -1
- package/dist/lite/index.browser.esm2017.js +1250 -1086
- package/dist/lite/index.browser.esm2017.js.map +1 -1
- package/dist/lite/index.browser.esm5.js +1394 -1232
- package/dist/lite/index.browser.esm5.js.map +1 -1
- package/dist/lite/index.d.ts +84 -4
- package/dist/lite/index.node.cjs.js +255 -63
- package/dist/lite/index.node.cjs.js.map +1 -1
- package/dist/lite/index.node.mjs +253 -65
- package/dist/lite/index.node.mjs.map +1 -1
- package/dist/lite/index.rn.esm2017.js +1257 -1093
- package/dist/lite/index.rn.esm2017.js.map +1 -1
- package/dist/lite/internal.d.ts +121 -6
- package/dist/lite/packages/firestore/dist/lite/index.browser.esm2017.d.ts +227 -142
- package/dist/lite/packages/firestore/lite/index.d.ts +2 -0
- package/dist/lite/packages/firestore/src/api/aggregate.d.ts +43 -0
- package/dist/lite/packages/firestore/src/api/database.d.ts +15 -15
- package/dist/lite/packages/firestore/src/api.d.ts +2 -0
- package/dist/lite/packages/firestore/src/core/count_query_runner.d.ts +32 -0
- package/dist/lite/packages/firestore/src/core/firestore_client.d.ts +5 -0
- package/dist/lite/packages/firestore/src/core/view.d.ts +1 -0
- package/dist/lite/packages/firestore/src/core/view_snapshot.d.ts +3 -2
- package/dist/lite/packages/firestore/src/lite-api/aggregate.d.ts +48 -0
- package/dist/lite/packages/firestore/src/lite-api/aggregate_types.d.ts +69 -0
- package/dist/lite/packages/firestore/src/lite-api/database.d.ts +7 -7
- package/dist/lite/packages/firestore/src/platform/node/grpc_connection.d.ts +1 -0
- package/dist/lite/packages/firestore/src/protos/firestore_proto_api.d.ts +28 -0
- package/dist/lite/packages/firestore/src/remote/connection.d.ts +7 -0
- package/dist/lite/packages/firestore/src/remote/datastore.d.ts +2 -0
- package/dist/lite/packages/firestore/src/remote/remote_event.d.ts +2 -2
- package/dist/lite/packages/firestore/src/remote/rest_connection.d.ts +1 -0
- package/dist/lite/packages/firestore/src/remote/serializer.d.ts +2 -1
- package/dist/lite/packages/firestore/test/integration/api/aggregation.test.d.ts +17 -0
- package/dist/lite/packages/firestore/test/integration/api_internal/aggregation.test.d.ts +17 -0
- package/dist/lite/packages/firestore/test/integration/util/helpers.d.ts +1 -0
- package/dist/lite/packages/firestore/test/unit/specs/spec_test_components.d.ts +1 -0
- package/dist/lite/packages/firestore/test/util/api_helpers.d.ts +1 -1
- package/dist/lite/private.d.ts +119 -4
- package/dist/packages/firestore/dist/index.esm2017.d.ts +336 -254
- package/dist/packages/firestore/lite/index.d.ts +2 -0
- package/dist/packages/firestore/src/api/aggregate.d.ts +43 -0
- package/dist/packages/firestore/src/api/database.d.ts +15 -15
- package/dist/packages/firestore/src/api.d.ts +2 -0
- package/dist/packages/firestore/src/core/count_query_runner.d.ts +32 -0
- package/dist/packages/firestore/src/core/firestore_client.d.ts +5 -0
- package/dist/packages/firestore/src/core/view.d.ts +1 -0
- package/dist/packages/firestore/src/core/view_snapshot.d.ts +3 -2
- package/dist/packages/firestore/src/lite-api/aggregate.d.ts +48 -0
- package/dist/packages/firestore/src/lite-api/aggregate_types.d.ts +69 -0
- package/dist/packages/firestore/src/lite-api/database.d.ts +7 -7
- package/dist/packages/firestore/src/platform/node/grpc_connection.d.ts +1 -0
- package/dist/packages/firestore/src/protos/firestore_proto_api.d.ts +28 -0
- package/dist/packages/firestore/src/remote/connection.d.ts +7 -0
- package/dist/packages/firestore/src/remote/datastore.d.ts +2 -0
- package/dist/packages/firestore/src/remote/remote_event.d.ts +2 -2
- package/dist/packages/firestore/src/remote/rest_connection.d.ts +1 -0
- package/dist/packages/firestore/src/remote/serializer.d.ts +2 -1
- package/dist/packages/firestore/test/integration/api/aggregation.test.d.ts +17 -0
- package/dist/packages/firestore/test/integration/api_internal/aggregation.test.d.ts +17 -0
- package/dist/packages/firestore/test/integration/util/helpers.d.ts +1 -0
- package/dist/packages/firestore/test/unit/specs/spec_test_components.d.ts +1 -0
- package/dist/packages/firestore/test/util/api_helpers.d.ts +1 -1
- package/dist/private.d.ts +239 -23
- package/package.json +9 -9
|
@@ -295,6 +295,32 @@ export declare namespace firestoreV1ApiClientInterfaces {
|
|
|
295
295
|
readTime?: string;
|
|
296
296
|
skippedResults?: number;
|
|
297
297
|
}
|
|
298
|
+
interface RunAggregationQueryRequest {
|
|
299
|
+
parent?: string;
|
|
300
|
+
structuredAggregationQuery?: StructuredAggregationQuery;
|
|
301
|
+
transaction?: string;
|
|
302
|
+
newTransaction?: TransactionOptions;
|
|
303
|
+
readTime?: string;
|
|
304
|
+
}
|
|
305
|
+
interface RunAggregationQueryResponse {
|
|
306
|
+
result?: AggregationResult;
|
|
307
|
+
transaction?: string;
|
|
308
|
+
readTime?: string;
|
|
309
|
+
}
|
|
310
|
+
interface AggregationResult {
|
|
311
|
+
aggregateFields?: ApiClientObjectMap<Value>;
|
|
312
|
+
}
|
|
313
|
+
interface StructuredAggregationQuery {
|
|
314
|
+
structuredQuery?: StructuredQuery;
|
|
315
|
+
aggregations?: Aggregation[];
|
|
316
|
+
}
|
|
317
|
+
interface Aggregation {
|
|
318
|
+
count?: Count;
|
|
319
|
+
alias?: string;
|
|
320
|
+
}
|
|
321
|
+
interface Count {
|
|
322
|
+
upTo?: number;
|
|
323
|
+
}
|
|
298
324
|
interface Status {
|
|
299
325
|
code?: number;
|
|
300
326
|
message?: string;
|
|
@@ -417,6 +443,8 @@ export declare type ReadWrite = firestoreV1ApiClientInterfaces.ReadWrite;
|
|
|
417
443
|
export declare type RollbackRequest = firestoreV1ApiClientInterfaces.RollbackRequest;
|
|
418
444
|
export declare type RunQueryRequest = firestoreV1ApiClientInterfaces.RunQueryRequest;
|
|
419
445
|
export declare type RunQueryResponse = firestoreV1ApiClientInterfaces.RunQueryResponse;
|
|
446
|
+
export declare type RunAggregationQueryRequest = firestoreV1ApiClientInterfaces.RunAggregationQueryRequest;
|
|
447
|
+
export declare type RunAggregationQueryResponse = firestoreV1ApiClientInterfaces.RunAggregationQueryResponse;
|
|
420
448
|
export declare type Status = firestoreV1ApiClientInterfaces.Status;
|
|
421
449
|
export declare type StructuredQuery = firestoreV1ApiClientInterfaces.StructuredQuery;
|
|
422
450
|
export declare type Target = firestoreV1ApiClientInterfaces.Target;
|
|
@@ -62,6 +62,13 @@ export interface Connection {
|
|
|
62
62
|
* @param token - the Token to use for the RPC.
|
|
63
63
|
*/
|
|
64
64
|
openStream<Req, Resp>(rpcName: string, authToken: Token | null, appCheckToken: Token | null): Stream<Req, Resp>;
|
|
65
|
+
/**
|
|
66
|
+
* Returns whether or not the implementation requires that the "path" of the resource
|
|
67
|
+
* (a document or a collection) be present in the request message. If true, then the
|
|
68
|
+
* request message must include the path. If false, then the request message must NOT
|
|
69
|
+
* include the path.
|
|
70
|
+
*/
|
|
71
|
+
readonly shouldResourcePathBeIncludedInRequest: boolean;
|
|
65
72
|
}
|
|
66
73
|
/**
|
|
67
74
|
* A bidirectional stream that can be used to send an receive messages.
|
|
@@ -20,6 +20,7 @@ import { Query } from '../core/query';
|
|
|
20
20
|
import { Document } from '../model/document';
|
|
21
21
|
import { DocumentKey } from '../model/document_key';
|
|
22
22
|
import { Mutation } from '../model/mutation';
|
|
23
|
+
import { Value as ProtoValue } from '../protos/firestore_proto_api';
|
|
23
24
|
import { AsyncQueue } from '../util/async_queue';
|
|
24
25
|
import { Connection } from './connection';
|
|
25
26
|
import { PersistentListenStream, PersistentWriteStream, WatchStreamListener, WriteStreamListener } from './persistent_stream';
|
|
@@ -36,5 +37,6 @@ export declare function newDatastore(authCredentials: CredentialsProvider<User>,
|
|
|
36
37
|
export declare function invokeCommitRpc(datastore: Datastore, mutations: Mutation[]): Promise<void>;
|
|
37
38
|
export declare function invokeBatchGetDocumentsRpc(datastore: Datastore, keys: DocumentKey[]): Promise<Document[]>;
|
|
38
39
|
export declare function invokeRunQueryRpc(datastore: Datastore, query: Query): Promise<Document[]>;
|
|
40
|
+
export declare function invokeRunAggregationQueryRpc(datastore: Datastore, query: Query): Promise<ProtoValue[]>;
|
|
39
41
|
export declare function newPersistentWriteStream(datastore: Datastore, queue: AsyncQueue, listener: WriteStreamListener): PersistentWriteStream;
|
|
40
42
|
export declare function newPersistentWatchStream(datastore: Datastore, queue: AsyncQueue, listener: WatchStreamListener): PersistentListenStream;
|
|
@@ -76,7 +76,7 @@ export declare class RemoteEvent {
|
|
|
76
76
|
* used to create a synthesized RemoteEvent that can be used to apply a
|
|
77
77
|
* CURRENT status change to a View, for queries executed in a different tab.
|
|
78
78
|
*/
|
|
79
|
-
static createSynthesizedRemoteEventForCurrentChange(targetId: TargetId, current: boolean): RemoteEvent;
|
|
79
|
+
static createSynthesizedRemoteEventForCurrentChange(targetId: TargetId, current: boolean, resumeToken: ByteString): RemoteEvent;
|
|
80
80
|
}
|
|
81
81
|
/**
|
|
82
82
|
* A TargetChange specifies the set of changes for a specific target as part of
|
|
@@ -149,5 +149,5 @@ export declare class TargetChange {
|
|
|
149
149
|
* apply a CURRENT status change to a View (for queries executed in a different
|
|
150
150
|
* tab) or for new queries (to raise snapshots with correct CURRENT status).
|
|
151
151
|
*/
|
|
152
|
-
static createSynthesizedTargetChangeForCurrentChange(targetId: TargetId, current: boolean): TargetChange;
|
|
152
|
+
static createSynthesizedTargetChangeForCurrentChange(targetId: TargetId, current: boolean, resumeToken: ByteString): TargetChange;
|
|
153
153
|
}
|
|
@@ -27,6 +27,7 @@ export declare abstract class RestConnection implements Connection {
|
|
|
27
27
|
protected readonly databaseId: DatabaseId;
|
|
28
28
|
protected readonly baseUrl: string;
|
|
29
29
|
private readonly databaseRoot;
|
|
30
|
+
get shouldResourcePathBeIncludedInRequest(): boolean;
|
|
30
31
|
constructor(databaseInfo: DatabaseInfo);
|
|
31
32
|
invokeRPC<Req, Resp>(rpcName: string, path: string, req: Req, authToken: Token | null, appCheckToken: Token | null): Promise<Resp>;
|
|
32
33
|
invokeStreamingRPC<Req, Resp>(rpcName: string, path: string, request: Req, authToken: Token | null, appCheckToken: Token | null, expectedResponseCount?: number): Promise<Resp[]>;
|
|
@@ -26,7 +26,7 @@ import { FieldMask } from '../model/field_mask';
|
|
|
26
26
|
import { Mutation, MutationResult } from '../model/mutation';
|
|
27
27
|
import { ObjectValue } from '../model/object_value';
|
|
28
28
|
import { FieldPath, ResourcePath } from '../model/path';
|
|
29
|
-
import { ApiClientObjectMap as ProtoApiClientObjectMap, BatchGetDocumentsResponse as ProtoBatchGetDocumentsResponse, Document as ProtoDocument, DocumentMask as ProtoDocumentMask, DocumentsTarget as ProtoDocumentsTarget, FieldFilterOp as ProtoFieldFilterOp, FieldReference as ProtoFieldReference, Filter as ProtoFilter, ListenResponse as ProtoListenResponse, Order as ProtoOrder, OrderDirection as ProtoOrderDirection, QueryTarget as ProtoQueryTarget, Target as ProtoTarget, Timestamp as ProtoTimestamp, Write as ProtoWrite, WriteResult as ProtoWriteResult } from '../protos/firestore_proto_api';
|
|
29
|
+
import { ApiClientObjectMap as ProtoApiClientObjectMap, BatchGetDocumentsResponse as ProtoBatchGetDocumentsResponse, Document as ProtoDocument, DocumentMask as ProtoDocumentMask, DocumentsTarget as ProtoDocumentsTarget, FieldFilterOp as ProtoFieldFilterOp, FieldReference as ProtoFieldReference, Filter as ProtoFilter, ListenResponse as ProtoListenResponse, Order as ProtoOrder, OrderDirection as ProtoOrderDirection, QueryTarget as ProtoQueryTarget, RunAggregationQueryRequest as ProtoRunAggregationQueryRequest, Target as ProtoTarget, Timestamp as ProtoTimestamp, Write as ProtoWrite, WriteResult as ProtoWriteResult } from '../protos/firestore_proto_api';
|
|
30
30
|
import { ByteString } from '../util/byte_string';
|
|
31
31
|
import { Serializer } from './number_serializer';
|
|
32
32
|
import { WatchChange } from './watch_change';
|
|
@@ -82,6 +82,7 @@ export declare function fromWriteResults(protos: ProtoWriteResult[] | undefined,
|
|
|
82
82
|
export declare function toDocumentsTarget(serializer: JsonProtoSerializer, target: Target): ProtoDocumentsTarget;
|
|
83
83
|
export declare function fromDocumentsTarget(documentsTarget: ProtoDocumentsTarget): Target;
|
|
84
84
|
export declare function toQueryTarget(serializer: JsonProtoSerializer, target: Target): ProtoQueryTarget;
|
|
85
|
+
export declare function toRunAggregationQueryRequest(serializer: JsonProtoSerializer, target: Target): ProtoRunAggregationQueryRequest;
|
|
85
86
|
export declare function convertQueryTargetToQuery(target: ProtoQueryTarget): Query;
|
|
86
87
|
export declare function fromQueryTarget(target: ProtoQueryTarget): Target;
|
|
87
88
|
export declare function toListenRequestLabels(serializer: JsonProtoSerializer, targetData: TargetData): ProtoApiClientObjectMap<string> | null;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2022 Google LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2022 Google LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
export {};
|
|
@@ -44,6 +44,7 @@ export declare function withTestDocAndInitialData(persistence: boolean, initialD
|
|
|
44
44
|
export declare function withTestCollection(persistence: boolean, docs: {
|
|
45
45
|
[key: string]: DocumentData;
|
|
46
46
|
}, fn: (collection: CollectionReference, db: Firestore) => Promise<void>): Promise<void>;
|
|
47
|
+
export declare function withEmptyTestCollection(persistence: boolean, fn: (collection: CollectionReference, db: Firestore) => Promise<void>): Promise<void>;
|
|
47
48
|
export declare function withTestCollectionSettings(persistence: boolean, settings: PrivateSettings, docs: {
|
|
48
49
|
[key: string]: DocumentData;
|
|
49
50
|
}, fn: (collection: CollectionReference, db: Firestore) => Promise<void>): Promise<void>;
|
|
@@ -96,6 +96,7 @@ export declare class MockConnection implements Connection {
|
|
|
96
96
|
writeStreamRequestCount: number;
|
|
97
97
|
nextWriteStreamToken: number;
|
|
98
98
|
constructor(queue: AsyncQueue);
|
|
99
|
+
shouldResourcePathBeIncludedInRequest: boolean;
|
|
99
100
|
/**
|
|
100
101
|
* Tracks the currently active watch targets as detected by the mock watch
|
|
101
102
|
* stream, as a mapping from target ID to query Target.
|
|
@@ -46,4 +46,4 @@ export declare function querySnapshot(path: string, oldDocs: {
|
|
|
46
46
|
[key: string]: JsonObject<unknown>;
|
|
47
47
|
}, docsToAdd: {
|
|
48
48
|
[key: string]: JsonObject<unknown>;
|
|
49
|
-
}, mutatedKeys: DocumentKeySet, fromCache: boolean, syncStateChanged: boolean): QuerySnapshot;
|
|
49
|
+
}, mutatedKeys: DocumentKeySet, fromCache: boolean, syncStateChanged: boolean, hasCachedResults?: boolean): QuerySnapshot;
|