@firebase/firestore 3.9.0-canary.ce79f7fe2 → 3.9.0-canary.f8a2c5865
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/dist/firestore/src/api.d.ts +1 -0
- package/dist/firestore/src/util/testing_hooks.d.ts +84 -0
- package/dist/firestore/test/integration/util/testing_hooks_util.d.ts +40 -0
- package/dist/index.cjs.js +1797 -1717
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm2017.js +1705 -1626
- package/dist/index.esm2017.js.map +1 -1
- package/dist/index.esm5.js +1532 -1471
- package/dist/index.esm5.js.map +1 -1
- package/dist/index.node.cjs.js +91 -2
- package/dist/index.node.cjs.js.map +1 -1
- package/dist/index.node.mjs +91 -3
- package/dist/index.node.mjs.map +1 -1
- package/dist/index.rn.js +1477 -1398
- package/dist/index.rn.js.map +1 -1
- package/dist/internal.d.ts +87 -0
- package/dist/lite/firestore/src/api.d.ts +1 -0
- package/dist/lite/firestore/src/util/testing_hooks.d.ts +84 -0
- package/dist/lite/firestore/test/integration/util/testing_hooks_util.d.ts +40 -0
- package/dist/lite/index.browser.esm2017.js +2 -2
- package/dist/lite/index.browser.esm2017.js.map +1 -1
- package/dist/lite/index.browser.esm5.js +2 -2
- package/dist/lite/index.cjs.js +2 -2
- package/dist/lite/index.cjs.js.map +1 -1
- package/dist/lite/index.node.cjs.js +2 -2
- package/dist/lite/index.node.mjs +2 -2
- package/dist/lite/index.node.mjs.map +1 -1
- package/dist/lite/index.rn.esm2017.js +2 -2
- package/dist/lite/packages/firestore/src/api.d.ts +1 -0
- package/dist/lite/packages/firestore/src/util/testing_hooks.d.ts +84 -0
- package/dist/lite/packages/firestore/test/integration/util/testing_hooks_util.d.ts +40 -0
- package/dist/packages/firestore/dist/index.esm2017.d.ts +350 -289
- package/dist/packages/firestore/src/api.d.ts +1 -0
- package/dist/packages/firestore/src/util/testing_hooks.d.ts +84 -0
- package/dist/packages/firestore/test/integration/util/testing_hooks_util.d.ts +40 -0
- package/dist/private.d.ts +22 -0
- package/package.json +9 -9
|
@@ -54,3 +54,4 @@ export type { ByteString as _ByteString } from './util/byte_string';
|
|
|
54
54
|
export { logWarn as _logWarn } from './util/log';
|
|
55
55
|
export { EmptyAuthCredentialsProvider as _EmptyAuthCredentialsProvider } from './api/credentials';
|
|
56
56
|
export { EmptyAppCheckTokenProvider as _EmptyAppCheckTokenProvider } from './api/credentials';
|
|
57
|
+
export { TestingHooks as _TestingHooks } from './util/testing_hooks';
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2023 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
|
+
/**
|
|
18
|
+
* Manages "testing hooks", hooks into the internals of the SDK to verify
|
|
19
|
+
* internal state and events during integration tests. Do not use this class
|
|
20
|
+
* except for testing purposes.
|
|
21
|
+
*
|
|
22
|
+
* There are two ways to retrieve the global singleton instance of this class:
|
|
23
|
+
* 1. The `instance` property, which returns null if the global singleton
|
|
24
|
+
* instance has not been created. Use this property if the caller should
|
|
25
|
+
* "do nothing" if there are no testing hooks registered, such as when
|
|
26
|
+
* delivering an event to notify registered callbacks.
|
|
27
|
+
* 2. The `getOrCreateInstance()` method, which creates the global singleton
|
|
28
|
+
* instance if it has not been created. Use this method if the instance is
|
|
29
|
+
* needed to, for example, register a callback.
|
|
30
|
+
*
|
|
31
|
+
* @internal
|
|
32
|
+
*/
|
|
33
|
+
export declare class TestingHooks {
|
|
34
|
+
private readonly onExistenceFilterMismatchCallbacks;
|
|
35
|
+
private constructor();
|
|
36
|
+
/**
|
|
37
|
+
* Returns the singleton instance of this class, or null if it has not been
|
|
38
|
+
* initialized.
|
|
39
|
+
*/
|
|
40
|
+
static get instance(): TestingHooks | null;
|
|
41
|
+
/**
|
|
42
|
+
* Returns the singleton instance of this class, creating it if is has never
|
|
43
|
+
* been created before.
|
|
44
|
+
*/
|
|
45
|
+
static getOrCreateInstance(): TestingHooks;
|
|
46
|
+
/**
|
|
47
|
+
* Registers a callback to be notified when an existence filter mismatch
|
|
48
|
+
* occurs in the Watch listen stream.
|
|
49
|
+
*
|
|
50
|
+
* The relative order in which callbacks are notified is unspecified; do not
|
|
51
|
+
* rely on any particular ordering. If a given callback is registered multiple
|
|
52
|
+
* times then it will be notified multiple times, once per registration.
|
|
53
|
+
*
|
|
54
|
+
* @param callback the callback to invoke upon existence filter mismatch.
|
|
55
|
+
*
|
|
56
|
+
* @return a function that, when called, unregisters the given callback; only
|
|
57
|
+
* the first invocation of the returned function does anything; all subsequent
|
|
58
|
+
* invocations do nothing.
|
|
59
|
+
*/
|
|
60
|
+
onExistenceFilterMismatch(callback: ExistenceFilterMismatchCallback): () => void;
|
|
61
|
+
/**
|
|
62
|
+
* Invokes all currently-registered `onExistenceFilterMismatch` callbacks.
|
|
63
|
+
* @param info Information about the existence filter mismatch.
|
|
64
|
+
*/
|
|
65
|
+
notifyOnExistenceFilterMismatch(info: ExistenceFilterMismatchInfo): void;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Information about an existence filter mismatch, as specified to callbacks
|
|
69
|
+
* registered with `TestingUtils.onExistenceFilterMismatch()`.
|
|
70
|
+
*/
|
|
71
|
+
export interface ExistenceFilterMismatchInfo {
|
|
72
|
+
/** The number of documents that matched the query in the local cache. */
|
|
73
|
+
localCacheCount: number;
|
|
74
|
+
/**
|
|
75
|
+
* The number of documents that matched the query on the server, as specified
|
|
76
|
+
* in the ExistenceFilter message's `count` field.
|
|
77
|
+
*/
|
|
78
|
+
existenceFilterCount: number;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* The signature of callbacks registered with
|
|
82
|
+
* `TestingUtils.onExistenceFilterMismatch()`.
|
|
83
|
+
*/
|
|
84
|
+
export declare type ExistenceFilterMismatchCallback = (info: ExistenceFilterMismatchInfo) => void;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2023 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
|
+
/**
|
|
18
|
+
* Captures all existence filter mismatches in the Watch 'Listen' stream that
|
|
19
|
+
* occur during the execution of the given code block.
|
|
20
|
+
* @param callback The callback to invoke; during the invocation of this
|
|
21
|
+
* callback all existence filter mismatches will be captured.
|
|
22
|
+
* @return the captured existence filter mismatches and the result of awaiting
|
|
23
|
+
* the given callback.
|
|
24
|
+
*/
|
|
25
|
+
export declare function captureExistenceFilterMismatches<T>(callback: () => Promise<T>): Promise<[ExistenceFilterMismatchInfo[], T]>;
|
|
26
|
+
/**
|
|
27
|
+
* Information about an existence filter mismatch, captured during an invocation
|
|
28
|
+
* of `captureExistenceFilterMismatches()`.
|
|
29
|
+
*
|
|
30
|
+
* See the documentation of `TestingHooks.notifyOnExistenceFilterMismatch()`
|
|
31
|
+
* for the meaning of these values.
|
|
32
|
+
*
|
|
33
|
+
* TODO: Delete this "interface" definition and instead use the one from
|
|
34
|
+
* testing_hooks.ts. I tried to do this but couldn't figure out how to get it to
|
|
35
|
+
* work in a way that survived bundling and minification.
|
|
36
|
+
*/
|
|
37
|
+
export interface ExistenceFilterMismatchInfo {
|
|
38
|
+
localCacheCount: number;
|
|
39
|
+
existenceFilterCount: number;
|
|
40
|
+
}
|