@react-native-firebase/database 20.3.0 → 20.4.0
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 +6 -0
- package/__tests__/database.test.ts +219 -1
- package/lib/index.d.ts +2 -0
- package/lib/modular/index.d.ts +7 -0
- package/lib/modular/query.d.ts +4 -9
- package/lib/modular/transaction.d.ts +2 -4
- package/lib/version.js +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
@@ -3,6 +3,12 @@
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
5
5
|
|
6
|
+
## [20.4.0](https://github.com/invertase/react-native-firebase/compare/v20.3.0...v20.4.0) (2024-08-13)
|
7
|
+
|
8
|
+
### Bug Fixes
|
9
|
+
|
10
|
+
- **database:** fixes modular imports exports ([#7916](https://github.com/invertase/react-native-firebase/issues/7916)) ([7022204](https://github.com/invertase/react-native-firebase/commit/7022204616f6149e3327cbf2ab8a469f537a7b61))
|
11
|
+
|
6
12
|
## [20.3.0](https://github.com/invertase/react-native-firebase/compare/v20.2.1...v20.3.0) (2024-07-19)
|
7
13
|
|
8
14
|
**Note:** Version bump only for package @react-native-firebase/database
|
@@ -1,6 +1,50 @@
|
|
1
1
|
import { describe, expect, it } from '@jest/globals';
|
2
2
|
|
3
|
-
import database, {
|
3
|
+
import database, {
|
4
|
+
firebase,
|
5
|
+
runTransaction,
|
6
|
+
getDatabase,
|
7
|
+
connectDatabaseEmulator,
|
8
|
+
goOffline,
|
9
|
+
goOnline,
|
10
|
+
ref,
|
11
|
+
refFromURL,
|
12
|
+
setPersistenceEnabled,
|
13
|
+
setLoggingEnabled,
|
14
|
+
setPersistenceCacheSizeBytes,
|
15
|
+
forceLongPolling,
|
16
|
+
forceWebSockets,
|
17
|
+
getServerTime,
|
18
|
+
serverTimestamp,
|
19
|
+
increment,
|
20
|
+
endAt,
|
21
|
+
endBefore,
|
22
|
+
startAt,
|
23
|
+
startAfter,
|
24
|
+
limitToFirst,
|
25
|
+
limitToLast,
|
26
|
+
orderByChild,
|
27
|
+
orderByKey,
|
28
|
+
orderByPriority,
|
29
|
+
orderByValue,
|
30
|
+
equalTo,
|
31
|
+
query,
|
32
|
+
onValue,
|
33
|
+
onChildAdded,
|
34
|
+
onChildChanged,
|
35
|
+
onChildMoved,
|
36
|
+
onChildRemoved,
|
37
|
+
set,
|
38
|
+
setPriority,
|
39
|
+
setWithPriority,
|
40
|
+
get,
|
41
|
+
child,
|
42
|
+
onDisconnect,
|
43
|
+
keepSynced,
|
44
|
+
push,
|
45
|
+
remove,
|
46
|
+
update,
|
47
|
+
} from '../lib';
|
4
48
|
|
5
49
|
describe('Database', function () {
|
6
50
|
describe('namespace', function () {
|
@@ -45,4 +89,178 @@ describe('Database', function () {
|
|
45
89
|
expect(bar).toEqual(['10.0.2.2', 9000]);
|
46
90
|
});
|
47
91
|
});
|
92
|
+
|
93
|
+
describe('modular', function () {
|
94
|
+
it('`onValue` query method is properly exposed to end user', function () {
|
95
|
+
expect(onValue).toBeDefined();
|
96
|
+
});
|
97
|
+
|
98
|
+
it('`runTransaction` transaction method is properly exposed to end user', function () {
|
99
|
+
expect(runTransaction).toBeDefined();
|
100
|
+
});
|
101
|
+
|
102
|
+
it('`getDatabase` function is properly exposed to end user', function () {
|
103
|
+
expect(getDatabase).toBeDefined();
|
104
|
+
});
|
105
|
+
|
106
|
+
it('`connectDatabaseEmulator` function is properly exposed to end user', function () {
|
107
|
+
expect(connectDatabaseEmulator).toBeDefined();
|
108
|
+
});
|
109
|
+
|
110
|
+
it('`goOffline` function is properly exposed to end user', function () {
|
111
|
+
expect(goOffline).toBeDefined();
|
112
|
+
});
|
113
|
+
|
114
|
+
it('`goOnline` function is properly exposed to end user', function () {
|
115
|
+
expect(goOnline).toBeDefined();
|
116
|
+
});
|
117
|
+
|
118
|
+
it('`ref` function is properly exposed to end user', function () {
|
119
|
+
expect(ref).toBeDefined();
|
120
|
+
});
|
121
|
+
|
122
|
+
it('`refFromURL` function is properly exposed to end user', function () {
|
123
|
+
expect(refFromURL).toBeDefined();
|
124
|
+
});
|
125
|
+
|
126
|
+
it('`setPersistenceEnabled` function is properly exposed to end user', function () {
|
127
|
+
expect(setPersistenceEnabled).toBeDefined();
|
128
|
+
});
|
129
|
+
|
130
|
+
it('`setLoggingEnabled` function is properly exposed to end user', function () {
|
131
|
+
expect(setLoggingEnabled).toBeDefined();
|
132
|
+
});
|
133
|
+
|
134
|
+
it('`setPersistenceCacheSizeBytes` function is properly exposed to end user', function () {
|
135
|
+
expect(setPersistenceCacheSizeBytes).toBeDefined();
|
136
|
+
});
|
137
|
+
|
138
|
+
it('`forceLongPolling` function is properly exposed to end user', function () {
|
139
|
+
expect(forceLongPolling).toBeDefined();
|
140
|
+
});
|
141
|
+
|
142
|
+
it('`forceWebSockets` function is properly exposed to end user', function () {
|
143
|
+
expect(forceWebSockets).toBeDefined();
|
144
|
+
});
|
145
|
+
|
146
|
+
it('`getServerTime` function is properly exposed to end user', function () {
|
147
|
+
expect(getServerTime).toBeDefined();
|
148
|
+
});
|
149
|
+
|
150
|
+
it('`serverTimestamp` function is properly exposed to end user', function () {
|
151
|
+
expect(serverTimestamp).toBeDefined();
|
152
|
+
});
|
153
|
+
|
154
|
+
it('`increment` function is properly exposed to end user', function () {
|
155
|
+
expect(increment).toBeDefined();
|
156
|
+
});
|
157
|
+
|
158
|
+
it('`endAt` function is properly exposed to end user', function () {
|
159
|
+
expect(endAt).toBeDefined();
|
160
|
+
});
|
161
|
+
|
162
|
+
it('`endBefore` function is properly exposed to end user', function () {
|
163
|
+
expect(endBefore).toBeDefined();
|
164
|
+
});
|
165
|
+
|
166
|
+
it('`startAt` function is properly exposed to end user', function () {
|
167
|
+
expect(startAt).toBeDefined();
|
168
|
+
});
|
169
|
+
|
170
|
+
it('`startAfter` function is properly exposed to end user', function () {
|
171
|
+
expect(startAfter).toBeDefined();
|
172
|
+
});
|
173
|
+
|
174
|
+
it('`limitToFirst` function is properly exposed to end user', function () {
|
175
|
+
expect(limitToFirst).toBeDefined();
|
176
|
+
});
|
177
|
+
|
178
|
+
it('`limitToLast` function is properly exposed to end user', function () {
|
179
|
+
expect(limitToLast).toBeDefined();
|
180
|
+
});
|
181
|
+
|
182
|
+
it('`orderByChild` function is properly exposed to end user', function () {
|
183
|
+
expect(orderByChild).toBeDefined();
|
184
|
+
});
|
185
|
+
|
186
|
+
it('`orderByKey` function is properly exposed to end user', function () {
|
187
|
+
expect(orderByKey).toBeDefined();
|
188
|
+
});
|
189
|
+
|
190
|
+
it('`orderByPriority` function is properly exposed to end user', function () {
|
191
|
+
expect(orderByPriority).toBeDefined();
|
192
|
+
});
|
193
|
+
|
194
|
+
it('`orderByValue` function is properly exposed to end user', function () {
|
195
|
+
expect(orderByValue).toBeDefined();
|
196
|
+
});
|
197
|
+
|
198
|
+
it('`equalTo` function is properly exposed to end user', function () {
|
199
|
+
expect(equalTo).toBeDefined();
|
200
|
+
});
|
201
|
+
|
202
|
+
it('`query` function is properly exposed to end user', function () {
|
203
|
+
expect(query).toBeDefined();
|
204
|
+
});
|
205
|
+
|
206
|
+
it('`onValue` function is properly exposed to end user', function () {
|
207
|
+
expect(onValue).toBeDefined();
|
208
|
+
});
|
209
|
+
|
210
|
+
it('`onChildAdded` function is properly exposed to end user', function () {
|
211
|
+
expect(onChildAdded).toBeDefined();
|
212
|
+
});
|
213
|
+
|
214
|
+
it('`onChildChanged` function is properly exposed to end user', function () {
|
215
|
+
expect(onChildChanged).toBeDefined();
|
216
|
+
});
|
217
|
+
|
218
|
+
it('`onChildMoved` function is properly exposed to end user', function () {
|
219
|
+
expect(onChildMoved).toBeDefined();
|
220
|
+
});
|
221
|
+
|
222
|
+
it('`onChildRemoved` function is properly exposed to end user', function () {
|
223
|
+
expect(onChildRemoved).toBeDefined();
|
224
|
+
});
|
225
|
+
|
226
|
+
it('`set` function is properly exposed to end user', function () {
|
227
|
+
expect(set).toBeDefined();
|
228
|
+
});
|
229
|
+
|
230
|
+
it('`setPriority` function is properly exposed to end user', function () {
|
231
|
+
expect(setPriority).toBeDefined();
|
232
|
+
});
|
233
|
+
|
234
|
+
it('`setWithPriority` function is properly exposed to end user', function () {
|
235
|
+
expect(setWithPriority).toBeDefined();
|
236
|
+
});
|
237
|
+
|
238
|
+
it('`get` function is properly exposed to end user', function () {
|
239
|
+
expect(get).toBeDefined();
|
240
|
+
});
|
241
|
+
|
242
|
+
it('`child` function is properly exposed to end user', function () {
|
243
|
+
expect(child).toBeDefined();
|
244
|
+
});
|
245
|
+
|
246
|
+
it('`onDisconnect` function is properly exposed to end user', function () {
|
247
|
+
expect(onDisconnect).toBeDefined();
|
248
|
+
});
|
249
|
+
|
250
|
+
it('`keepSynced` function is properly exposed to end user', function () {
|
251
|
+
expect(keepSynced).toBeDefined();
|
252
|
+
});
|
253
|
+
|
254
|
+
it('`push` function is properly exposed to end user', function () {
|
255
|
+
expect(push).toBeDefined();
|
256
|
+
});
|
257
|
+
|
258
|
+
it('`remove` function is properly exposed to end user', function () {
|
259
|
+
expect(remove).toBeDefined();
|
260
|
+
});
|
261
|
+
|
262
|
+
it('`update` function is properly exposed to end user', function () {
|
263
|
+
expect(update).toBeDefined();
|
264
|
+
});
|
265
|
+
});
|
48
266
|
});
|
package/lib/index.d.ts
CHANGED
package/lib/modular/index.d.ts
CHANGED
@@ -207,6 +207,10 @@ export declare function forceWebSockets(): void;
|
|
207
207
|
*/
|
208
208
|
export function serverTimestamp(): object;
|
209
209
|
|
210
|
+
/**
|
211
|
+
* Returns the current Firebase Database server time as a JavaScript Date object.
|
212
|
+
*/
|
213
|
+
export function getServerTime(db: Database): Promise<number>;
|
210
214
|
/**
|
211
215
|
* Returns a placeholder value that can be used to atomically increment the
|
212
216
|
* current database value by the provided delta.
|
@@ -215,3 +219,6 @@ export function serverTimestamp(): object;
|
|
215
219
|
* @returns A placeholder value for modifying data atomically server-side.
|
216
220
|
*/
|
217
221
|
export function increment(delta: number): object;
|
222
|
+
|
223
|
+
export * from './query';
|
224
|
+
export * from './transaction';
|
package/lib/modular/query.d.ts
CHANGED
@@ -1,14 +1,9 @@
|
|
1
1
|
import { FirebaseDatabaseTypes } from '../..';
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
export type Query = Query;
|
9
|
-
export type DataSnapshot = DataSnapshot;
|
10
|
-
export type DatabaseReference = DatabaseReference;
|
11
|
-
export type OnDisconnect = OnDisconnect;
|
3
|
+
export type Query = FirebaseDatabaseTypes.Query;
|
4
|
+
export type DataSnapshot = FirebaseDatabaseTypes.DataSnapshot;
|
5
|
+
export type DatabaseReference = FirebaseDatabaseTypes.Reference;
|
6
|
+
export type OnDisconnect = FirebaseDatabaseTypes.OnDisconnect;
|
12
7
|
|
13
8
|
/**
|
14
9
|
* A `Promise` that can also act as a `DatabaseReference` when returned by
|
@@ -1,10 +1,8 @@
|
|
1
|
-
import { FirebaseDatabaseTypes } from '
|
1
|
+
import { FirebaseDatabaseTypes } from '../..';
|
2
2
|
|
3
|
-
|
3
|
+
export type TransactionResult = FirebaseDatabaseTypes.TransactionResult;
|
4
4
|
import DatabaseReference = FirebaseDatabaseTypes.Reference;
|
5
5
|
|
6
|
-
export { TransactionResult };
|
7
|
-
|
8
6
|
/**
|
9
7
|
* An options object to configure transactions.
|
10
8
|
*/
|
package/lib/version.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
// Generated by genversion.
|
2
|
-
module.exports = '20.
|
2
|
+
module.exports = '20.4.0';
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@react-native-firebase/database",
|
3
|
-
"version": "20.
|
3
|
+
"version": "20.4.0",
|
4
4
|
"author": "Invertase <oss@invertase.io> (http://invertase.io)",
|
5
5
|
"description": "React Native Firebase - The Firebase Realtime Database is a cloud-hosted database. Data is stored as JSON and synchronized in realtime to every connected client. React Native Firebase provides native integration with the Android & iOS Firebase SDKs, supporting both realtime data sync and offline capabilities.",
|
6
6
|
"main": "lib/index.js",
|
@@ -25,10 +25,10 @@
|
|
25
25
|
"realtome database"
|
26
26
|
],
|
27
27
|
"peerDependencies": {
|
28
|
-
"@react-native-firebase/app": "20.
|
28
|
+
"@react-native-firebase/app": "20.4.0"
|
29
29
|
},
|
30
30
|
"publishConfig": {
|
31
31
|
"access": "public"
|
32
32
|
},
|
33
|
-
"gitHead": "
|
33
|
+
"gitHead": "3ac3e9623674a8db52c111b4aa0a85a883260116"
|
34
34
|
}
|