@firebase/database 0.13.1 → 0.13.2-canary.d3336a9cd
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 +12 -0
- package/dist/index.esm2017.js +66 -13
- package/dist/index.esm2017.js.map +1 -1
- package/dist/index.esm5.js +66 -13
- package/dist/index.esm5.js.map +1 -1
- package/dist/index.node.cjs.js +66 -13
- package/dist/index.node.cjs.js.map +1 -1
- package/dist/index.standalone.js +65 -12
- package/dist/index.standalone.js.map +1 -1
- package/dist/node-esm/index.node.esm.js +66 -13
- package/dist/node-esm/index.node.esm.js.map +1 -1
- package/dist/node-esm/src/core/SyncTree.d.ts +28 -1
- package/dist/node-esm/src/core/util/Path.d.ts +1 -1
- package/dist/node-esm/test/helpers/util.d.ts +6 -0
- package/dist/src/core/SyncTree.d.ts +28 -1
- package/dist/src/core/util/Path.d.ts +1 -1
- package/dist/test/helpers/util.d.ts +6 -0
- package/package.json +8 -7
|
@@ -21,7 +21,7 @@ import { ImmutableTree } from './util/ImmutableTree';
|
|
|
21
21
|
import { Path } from './util/Path';
|
|
22
22
|
import { Event } from './view/Event';
|
|
23
23
|
import { EventRegistration, QueryContext } from './view/EventRegistration';
|
|
24
|
-
import { WriteTree } from './WriteTree';
|
|
24
|
+
import { WriteTree, WriteTreeRef } from './WriteTree';
|
|
25
25
|
export declare function syncTreeSetReferenceConstructor(val: ReferenceConstructor): void;
|
|
26
26
|
export interface ListenProvider {
|
|
27
27
|
startListening(query: QueryContext, tag: number | null, hashFn: () => string, onComplete: (a: string, b?: unknown) => Event[]): Event[];
|
|
@@ -124,6 +124,20 @@ export declare function syncTreeApplyTaggedListenComplete(syncTree: SyncTree, pa
|
|
|
124
124
|
* @returns Cancel events, if cancelError was provided.
|
|
125
125
|
*/
|
|
126
126
|
export declare function syncTreeRemoveEventRegistration(syncTree: SyncTree, query: QueryContext, eventRegistration: EventRegistration | null, cancelError?: Error): Event[];
|
|
127
|
+
/**
|
|
128
|
+
* This function was added to support non-listener queries,
|
|
129
|
+
* specifically for use in repoGetValue. It sets up all the same
|
|
130
|
+
* local cache data-structures (SyncPoint + View) that are
|
|
131
|
+
* needed for listeners without installing an event registration.
|
|
132
|
+
* If `query` is not `loadsAllData`, it will also provision a tag for
|
|
133
|
+
* the query so that query results can be merged into the sync
|
|
134
|
+
* tree using existing logic for tagged listener queries.
|
|
135
|
+
*
|
|
136
|
+
* @param syncTree - Synctree to add the query to.
|
|
137
|
+
* @param query - Query to register
|
|
138
|
+
* @returns tag as a string if query is not a default query, null if query is not.
|
|
139
|
+
*/
|
|
140
|
+
export declare function syncTreeRegisterQuery(syncTree: SyncTree, query: QueryContext): number;
|
|
127
141
|
/**
|
|
128
142
|
* Apply new server data for the specified tagged query.
|
|
129
143
|
*
|
|
@@ -138,6 +152,19 @@ export declare function syncTreeApplyTaggedQueryOverwrite(syncTree: SyncTree, pa
|
|
|
138
152
|
export declare function syncTreeApplyTaggedQueryMerge(syncTree: SyncTree, path: Path, changedChildren: {
|
|
139
153
|
[k: string]: Node;
|
|
140
154
|
}, tag: number): Event[];
|
|
155
|
+
/**
|
|
156
|
+
* Creates a new syncpoint for a query and creates a tag if the view doesn't exist.
|
|
157
|
+
* Extracted from addEventRegistration to allow `repoGetValue` to properly set up the SyncTree
|
|
158
|
+
* without actually listening on a query.
|
|
159
|
+
*/
|
|
160
|
+
export declare function syncTreeRegisterSyncPoint(query: QueryContext, syncTree: SyncTree): {
|
|
161
|
+
syncPoint: SyncPoint;
|
|
162
|
+
writesCache: WriteTreeRef;
|
|
163
|
+
serverCache: Node;
|
|
164
|
+
serverCacheComplete: any;
|
|
165
|
+
foundAncestorDefaultView: boolean;
|
|
166
|
+
viewAlreadyExists: boolean;
|
|
167
|
+
};
|
|
141
168
|
/**
|
|
142
169
|
* Add an event callback for the specified query.
|
|
143
170
|
*
|
|
@@ -62,7 +62,7 @@ export declare function pathCompare(left: Path, right: Path): number;
|
|
|
62
62
|
*/
|
|
63
63
|
export declare function pathEquals(path: Path, other: Path): boolean;
|
|
64
64
|
/**
|
|
65
|
-
* @returns True if this path is a parent (or the same as) other
|
|
65
|
+
* @returns True if this path is a parent of (or the same as) other
|
|
66
66
|
*/
|
|
67
67
|
export declare function pathContains(path: Path, other: Path): boolean;
|
|
68
68
|
/**
|
|
@@ -14,9 +14,15 @@
|
|
|
14
14
|
* See the License for the specific language governing permissions and
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
|
+
import { Database } from '../../src';
|
|
17
18
|
export declare const TEST_PROJECT: any;
|
|
18
19
|
export declare const DATABASE_ADDRESS: any;
|
|
19
20
|
export declare const DATABASE_URL: any;
|
|
20
21
|
export declare function testRepoInfo(url: any): import("../../src/core/RepoInfo").RepoInfo;
|
|
21
22
|
export declare function repoInfoForConnectionTest(): import("../../src/core/RepoInfo").RepoInfo;
|
|
22
23
|
export declare function shuffle(arr: any, randFn?: () => number): void;
|
|
24
|
+
export declare function waitFor(waitTimeInMS: number): Promise<unknown>;
|
|
25
|
+
export declare function getUniqueRef(db: Database): {
|
|
26
|
+
ref: import("../../src").DatabaseReference;
|
|
27
|
+
path: string;
|
|
28
|
+
};
|
|
@@ -21,7 +21,7 @@ import { ImmutableTree } from './util/ImmutableTree';
|
|
|
21
21
|
import { Path } from './util/Path';
|
|
22
22
|
import { Event } from './view/Event';
|
|
23
23
|
import { EventRegistration, QueryContext } from './view/EventRegistration';
|
|
24
|
-
import { WriteTree } from './WriteTree';
|
|
24
|
+
import { WriteTree, WriteTreeRef } from './WriteTree';
|
|
25
25
|
export declare function syncTreeSetReferenceConstructor(val: ReferenceConstructor): void;
|
|
26
26
|
export interface ListenProvider {
|
|
27
27
|
startListening(query: QueryContext, tag: number | null, hashFn: () => string, onComplete: (a: string, b?: unknown) => Event[]): Event[];
|
|
@@ -124,6 +124,20 @@ export declare function syncTreeApplyTaggedListenComplete(syncTree: SyncTree, pa
|
|
|
124
124
|
* @returns Cancel events, if cancelError was provided.
|
|
125
125
|
*/
|
|
126
126
|
export declare function syncTreeRemoveEventRegistration(syncTree: SyncTree, query: QueryContext, eventRegistration: EventRegistration | null, cancelError?: Error): Event[];
|
|
127
|
+
/**
|
|
128
|
+
* This function was added to support non-listener queries,
|
|
129
|
+
* specifically for use in repoGetValue. It sets up all the same
|
|
130
|
+
* local cache data-structures (SyncPoint + View) that are
|
|
131
|
+
* needed for listeners without installing an event registration.
|
|
132
|
+
* If `query` is not `loadsAllData`, it will also provision a tag for
|
|
133
|
+
* the query so that query results can be merged into the sync
|
|
134
|
+
* tree using existing logic for tagged listener queries.
|
|
135
|
+
*
|
|
136
|
+
* @param syncTree - Synctree to add the query to.
|
|
137
|
+
* @param query - Query to register
|
|
138
|
+
* @returns tag as a string if query is not a default query, null if query is not.
|
|
139
|
+
*/
|
|
140
|
+
export declare function syncTreeRegisterQuery(syncTree: SyncTree, query: QueryContext): number;
|
|
127
141
|
/**
|
|
128
142
|
* Apply new server data for the specified tagged query.
|
|
129
143
|
*
|
|
@@ -138,6 +152,19 @@ export declare function syncTreeApplyTaggedQueryOverwrite(syncTree: SyncTree, pa
|
|
|
138
152
|
export declare function syncTreeApplyTaggedQueryMerge(syncTree: SyncTree, path: Path, changedChildren: {
|
|
139
153
|
[k: string]: Node;
|
|
140
154
|
}, tag: number): Event[];
|
|
155
|
+
/**
|
|
156
|
+
* Creates a new syncpoint for a query and creates a tag if the view doesn't exist.
|
|
157
|
+
* Extracted from addEventRegistration to allow `repoGetValue` to properly set up the SyncTree
|
|
158
|
+
* without actually listening on a query.
|
|
159
|
+
*/
|
|
160
|
+
export declare function syncTreeRegisterSyncPoint(query: QueryContext, syncTree: SyncTree): {
|
|
161
|
+
syncPoint: SyncPoint;
|
|
162
|
+
writesCache: WriteTreeRef;
|
|
163
|
+
serverCache: Node;
|
|
164
|
+
serverCacheComplete: any;
|
|
165
|
+
foundAncestorDefaultView: boolean;
|
|
166
|
+
viewAlreadyExists: boolean;
|
|
167
|
+
};
|
|
141
168
|
/**
|
|
142
169
|
* Add an event callback for the specified query.
|
|
143
170
|
*
|
|
@@ -62,7 +62,7 @@ export declare function pathCompare(left: Path, right: Path): number;
|
|
|
62
62
|
*/
|
|
63
63
|
export declare function pathEquals(path: Path, other: Path): boolean;
|
|
64
64
|
/**
|
|
65
|
-
* @returns True if this path is a parent (or the same as) other
|
|
65
|
+
* @returns True if this path is a parent of (or the same as) other
|
|
66
66
|
*/
|
|
67
67
|
export declare function pathContains(path: Path, other: Path): boolean;
|
|
68
68
|
/**
|
|
@@ -14,9 +14,15 @@
|
|
|
14
14
|
* See the License for the specific language governing permissions and
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
|
+
import { Database } from '../../src';
|
|
17
18
|
export declare const TEST_PROJECT: any;
|
|
18
19
|
export declare const DATABASE_ADDRESS: any;
|
|
19
20
|
export declare const DATABASE_URL: any;
|
|
20
21
|
export declare function testRepoInfo(url: any): import("../../src/core/RepoInfo").RepoInfo;
|
|
21
22
|
export declare function repoInfoForConnectionTest(): import("../../src/core/RepoInfo").RepoInfo;
|
|
22
23
|
export declare function shuffle(arr: any, randFn?: () => number): void;
|
|
24
|
+
export declare function waitFor(waitTimeInMS: number): Promise<unknown>;
|
|
25
|
+
export declare function getUniqueRef(db: Database): {
|
|
26
|
+
ref: import("../../src").DatabaseReference;
|
|
27
|
+
path: string;
|
|
28
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@firebase/database",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.2-canary.d3336a9cd",
|
|
4
4
|
"description": "",
|
|
5
5
|
"author": "Firebase <firebase-support@google.com> (https://firebase.google.com/)",
|
|
6
6
|
"main": "dist/index.node.cjs.js",
|
|
@@ -45,18 +45,19 @@
|
|
|
45
45
|
"license": "Apache-2.0",
|
|
46
46
|
"peerDependencies": {},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@firebase/logger": "0.3.3",
|
|
49
|
-
"@firebase/util": "1.6.
|
|
50
|
-
"@firebase/component": "0.5.
|
|
51
|
-
"@firebase/auth-interop-types": "0.1.6",
|
|
48
|
+
"@firebase/logger": "0.3.3-canary.d3336a9cd",
|
|
49
|
+
"@firebase/util": "1.6.2-canary.d3336a9cd",
|
|
50
|
+
"@firebase/component": "0.5.16-canary.d3336a9cd",
|
|
51
|
+
"@firebase/auth-interop-types": "0.1.6-canary.d3336a9cd",
|
|
52
52
|
"faye-websocket": "0.11.4",
|
|
53
53
|
"tslib": "^2.1.0"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
|
-
"@firebase/app": "0.7.
|
|
56
|
+
"@firebase/app": "0.7.27-canary.d3336a9cd",
|
|
57
57
|
"rollup": "2.72.1",
|
|
58
58
|
"rollup-plugin-typescript2": "0.31.2",
|
|
59
|
-
"typescript": "4.2.2"
|
|
59
|
+
"typescript": "4.2.2",
|
|
60
|
+
"uuid": "^8.3.2"
|
|
60
61
|
},
|
|
61
62
|
"repository": {
|
|
62
63
|
"directory": "packages/database",
|