@react-native-firebase/database 26.3.3 → 27.0.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 +27 -0
- package/RNFBDatabase.podspec +10 -2
- package/android/build.gradle +7 -0
- package/android/src/main/java/io/invertase/firebase/database/DatabaseAbortable.java +22 -0
- package/android/src/main/java/io/invertase/firebase/database/DatabaseQueryHandle.java +24 -0
- package/android/src/main/java/io/invertase/firebase/database/RNFBDatabaseKeepSyncedRegistry.java +106 -0
- package/android/src/main/java/io/invertase/firebase/database/RNFBDatabaseListenerRegistry.kt +133 -0
- package/android/src/main/java/io/invertase/firebase/database/RNFBDatabaseQueryRegistry.kt +76 -0
- package/android/src/main/java/io/invertase/firebase/database/RNFBDatabaseTransactionRegistry.kt +67 -0
- package/android/src/main/java/io/invertase/firebase/database/UniversalFirebaseDatabaseOnDisconnectModule.java +102 -9
- package/android/src/reactnative/java/io/invertase/firebase/database/NativeRNFBTurboDatabaseOnDisconnect.java +6 -11
- package/android/src/reactnative/java/io/invertase/firebase/database/NativeRNFBTurboDatabaseQuery.java +111 -24
- package/android/src/reactnative/java/io/invertase/firebase/database/NativeRNFBTurboDatabaseTransaction.java +12 -25
- package/android/src/reactnative/java/io/invertase/firebase/database/ReactNativeFirebaseDatabaseQuery.java +30 -33
- package/android/src/reactnative/java/io/invertase/firebase/database/ReactNativeFirebaseDatabaseTransactionHandler.java +3 -3
- package/android/src/reactnative/java/io/invertase/firebase/database/generated/java/com/facebook/fbreact/specs/NativeRNFBTurboDatabaseQuerySpec.java +4 -0
- package/android/src/reactnative/java/io/invertase/firebase/database/generated/jni/RNFBDatabaseTurboModules-generated.cpp +6 -0
- package/android/src/reactnative/java/io/invertase/firebase/database/generated/jni/react/renderer/components/RNFBDatabaseTurboModules/RNFBDatabaseTurboModulesJSI.h +12 -0
- package/android/src/test/java/io/invertase/firebase/database/RNFBDatabaseKeepSyncedRegistryTest.java +174 -0
- package/android/src/test/java/io/invertase/firebase/database/RNFBDatabaseListenerRegistryTest.java +191 -0
- package/android/src/test/java/io/invertase/firebase/database/RNFBDatabaseQueryRegistryTest.java +489 -0
- package/android/src/test/java/io/invertase/firebase/database/RNFBDatabaseTransactionRegistryTest.java +199 -0
- package/android/src/test/java/io/invertase/firebase/database/UniversalFirebaseDatabaseOnDisconnectCancelErrorTest.java +137 -0
- package/dist/module/DatabaseQuery.js +52 -1
- package/dist/module/DatabaseQuery.js.map +1 -1
- package/dist/module/DatabaseSyncTree.js +1 -1
- package/dist/module/DatabaseSyncTree.js.map +1 -1
- package/dist/module/index.js +1 -2
- package/dist/module/index.js.map +1 -1
- package/dist/module/modular/query.js +1 -1
- package/dist/module/modular/query.js.map +1 -1
- package/dist/module/version.js +1 -1
- package/dist/module/web/RNFBDatabaseModule.js +7 -0
- package/dist/module/web/RNFBDatabaseModule.js.map +1 -1
- package/dist/typescript/lib/DatabaseQuery.d.ts +25 -0
- package/dist/typescript/lib/DatabaseQuery.d.ts.map +1 -1
- package/dist/typescript/lib/index.d.ts +1 -1
- package/dist/typescript/lib/types/internal.d.ts +2 -0
- package/dist/typescript/lib/types/internal.d.ts.map +1 -1
- package/dist/typescript/lib/version.d.ts +1 -1
- package/dist/typescript/lib/web/RNFBDatabaseModule.d.ts.map +1 -1
- package/ios/RNFBDatabase/RNFBDatabaseListenerRegistry.h +37 -0
- package/ios/RNFBDatabase/RNFBDatabaseListenerRegistry.m +91 -0
- package/ios/RNFBDatabase/RNFBDatabaseListenerRegistryStorage.swift +81 -0
- package/ios/RNFBDatabase/RNFBDatabaseNullSentinelDecoder.h +36 -0
- package/ios/RNFBDatabase/RNFBDatabaseNullSentinelDecoder.m +48 -0
- package/ios/RNFBDatabase/RNFBDatabaseOnDisconnectHelper.m +29 -26
- package/ios/RNFBDatabase/RNFBDatabaseQuery.h +3 -2
- package/ios/RNFBDatabase/RNFBDatabaseQuery.m +14 -13
- package/ios/RNFBDatabase/RNFBDatabaseQueryHelper.h +7 -0
- package/ios/RNFBDatabase/RNFBDatabaseQueryHelper.m +44 -21
- package/ios/RNFBDatabase/RNFBDatabaseQueryModule.mm +14 -0
- package/ios/RNFBDatabase/RNFBDatabaseQueryRegistry.h +37 -0
- package/ios/RNFBDatabase/RNFBDatabaseQueryRegistry.m +79 -0
- package/ios/RNFBDatabase/RNFBDatabaseQueryRegistryStorage.swift +104 -0
- package/ios/RNFBDatabase/RNFBDatabaseReferenceHelper.m +14 -12
- package/ios/RNFBDatabase/RNFBDatabaseTransactionHelper.m +3 -1
- package/ios/RNFBDatabase.xcodeproj/project.pbxproj +12 -0
- package/ios/RNFBDatabaseUnitTests/RNFBDatabaseListenerRegistryStorageTests.swift +86 -0
- package/ios/RNFBDatabaseUnitTests/RNFBDatabaseListenerRegistryTests.m +90 -0
- package/ios/RNFBDatabaseUnitTests/RNFBDatabaseNullSentinelDecodeTests.m +118 -0
- package/ios/RNFBDatabaseUnitTests/RNFBDatabaseQueryRegistryStorageTests.swift +181 -0
- package/ios/RNFBDatabaseUnitTests/RNFBDatabaseQueryRegistryTests.m +390 -0
- package/ios/RNFBDatabaseUnitTests/RNFBDatabaseUnitTests.xcodeproj/project.pbxproj +303 -0
- package/ios/RNFBDatabaseUnitTests/RNFBDatabaseUnitTests.xcodeproj/xcshareddata/xcschemes/RNFBDatabaseUnitTests.xcscheme +69 -0
- package/ios/generated/RNFBDatabaseTurboModules/RNFBDatabaseTurboModules-generated.mm +7 -0
- package/ios/generated/RNFBDatabaseTurboModules/RNFBDatabaseTurboModules.h +6 -0
- package/ios/generated/RNFBDatabaseTurboModulesJSI.h +12 -0
- package/lib/DatabaseQuery.ts +56 -0
- package/lib/DatabaseSyncTree.ts +1 -1
- package/lib/index.ts +1 -1
- package/lib/modular/query.ts +1 -1
- package/lib/types/internal.ts +2 -0
- package/lib/version.ts +1 -1
- package/lib/web/RNFBDatabaseModule.ts +13 -0
- package/package.json +5 -4
- package/specs/NativeRNFBTurboDatabaseQuery.ts +1 -0
|
@@ -0,0 +1,303 @@
|
|
|
1
|
+
// !$*UTF8*$!
|
|
2
|
+
{
|
|
3
|
+
archiveVersion = 1;
|
|
4
|
+
classes = {
|
|
5
|
+
};
|
|
6
|
+
objectVersion = 56;
|
|
7
|
+
objects = {
|
|
8
|
+
|
|
9
|
+
/* Begin PBXBuildFile section */
|
|
10
|
+
D8000000000000000000000A /* RNFBHandleMap.m in Sources */ = {isa = PBXBuildFile; fileRef = D80000000000000000000008 /* RNFBHandleMap.m */; };
|
|
11
|
+
D8000000000000000000000B /* RNFBDatabaseListenerRegistry.m in Sources */ = {isa = PBXBuildFile; fileRef = D80000000000000000000018 /* RNFBDatabaseListenerRegistry.m */; };
|
|
12
|
+
D8000000000000000000000C /* RNFBDatabaseListenerRegistryTests.m in Sources */ = {isa = PBXBuildFile; fileRef = D80000000000000000000009 /* RNFBDatabaseListenerRegistryTests.m */; };
|
|
13
|
+
D80000000000000000000020 /* RNFBDatabaseQueryRegistry.m in Sources */ = {isa = PBXBuildFile; fileRef = D80000000000000000000021 /* RNFBDatabaseQueryRegistry.m */; };
|
|
14
|
+
D80000000000000000000022 /* RNFBDatabaseQueryRegistryTests.m in Sources */ = {isa = PBXBuildFile; fileRef = D80000000000000000000023 /* RNFBDatabaseQueryRegistryTests.m */; };
|
|
15
|
+
D80000000000000000000030 /* RNFBNullSentinelDecoding.swift in Sources */ = {isa = PBXBuildFile; fileRef = D80000000000000000000031 /* RNFBNullSentinelDecoding.swift */; };
|
|
16
|
+
D80000000000000000000032 /* RNFBDatabaseNullSentinelDecoder.m in Sources */ = {isa = PBXBuildFile; fileRef = D80000000000000000000033 /* RNFBDatabaseNullSentinelDecoder.m */; };
|
|
17
|
+
D80000000000000000000038 /* RNFBDatabaseNullSentinelDecodeTests.m in Sources */ = {isa = PBXBuildFile; fileRef = D80000000000000000000039 /* RNFBDatabaseNullSentinelDecodeTests.m */; };
|
|
18
|
+
D80000000000000000000015 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D80000000000000000000014 /* XCTest.framework */; };
|
|
19
|
+
D80000000000000000000025 /* RNFBHandleMapStorage.swift in Sources */ = {isa = PBXBuildFile; fileRef = D80000000000000000000026 /* RNFBHandleMapStorage.swift */; };
|
|
20
|
+
D80000000000000000000028 /* RNFBDatabaseListenerRegistryStorage.swift in Sources */ = {isa = PBXBuildFile; fileRef = D80000000000000000000027 /* RNFBDatabaseListenerRegistryStorage.swift */; };
|
|
21
|
+
D8000000000000000000002A /* RNFBDatabaseListenerRegistryStorageTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D80000000000000000000029 /* RNFBDatabaseListenerRegistryStorageTests.swift */; };
|
|
22
|
+
D8000000000000000000002C /* RNFBDatabaseQueryRegistryStorage.swift in Sources */ = {isa = PBXBuildFile; fileRef = D8000000000000000000002B /* RNFBDatabaseQueryRegistryStorage.swift */; };
|
|
23
|
+
D8000000000000000000002E /* RNFBDatabaseQueryRegistryStorageTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D8000000000000000000002D /* RNFBDatabaseQueryRegistryStorageTests.swift */; };
|
|
24
|
+
/* End PBXBuildFile section */
|
|
25
|
+
|
|
26
|
+
/* Begin PBXFileReference section */
|
|
27
|
+
D80000000000000000000003 /* RNFBDatabaseUnitTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RNFBDatabaseUnitTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
|
|
28
|
+
D80000000000000000000007 /* RNFBHandleMap.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = RNFBHandleMap.h; path = ../../../app/ios/RNFBApp/RNFBHandleMap.h; sourceTree = SOURCE_ROOT; };
|
|
29
|
+
D80000000000000000000008 /* RNFBHandleMap.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = RNFBHandleMap.m; path = ../../../app/ios/RNFBApp/RNFBHandleMap.m; sourceTree = SOURCE_ROOT; };
|
|
30
|
+
D80000000000000000000009 /* RNFBDatabaseListenerRegistryTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNFBDatabaseListenerRegistryTests.m; sourceTree = "<group>"; };
|
|
31
|
+
D80000000000000000000016 /* RNFBDatabaseListenerRegistry.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = RNFBDatabaseListenerRegistry.h; path = ../RNFBDatabase/RNFBDatabaseListenerRegistry.h; sourceTree = SOURCE_ROOT; };
|
|
32
|
+
D80000000000000000000018 /* RNFBDatabaseListenerRegistry.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = RNFBDatabaseListenerRegistry.m; path = ../RNFBDatabase/RNFBDatabaseListenerRegistry.m; sourceTree = SOURCE_ROOT; };
|
|
33
|
+
D80000000000000000000024 /* RNFBDatabaseQueryRegistry.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = RNFBDatabaseQueryRegistry.h; path = ../RNFBDatabase/RNFBDatabaseQueryRegistry.h; sourceTree = SOURCE_ROOT; };
|
|
34
|
+
D80000000000000000000021 /* RNFBDatabaseQueryRegistry.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = RNFBDatabaseQueryRegistry.m; path = ../RNFBDatabase/RNFBDatabaseQueryRegistry.m; sourceTree = SOURCE_ROOT; };
|
|
35
|
+
D80000000000000000000023 /* RNFBDatabaseQueryRegistryTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNFBDatabaseQueryRegistryTests.m; sourceTree = "<group>"; };
|
|
36
|
+
D80000000000000000000031 /* RNFBNullSentinelDecoding.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = RNFBNullSentinelDecoding.swift; path = ../../../app/ios/RNFBApp/RNFBNullSentinelDecoding.swift; sourceTree = SOURCE_ROOT; };
|
|
37
|
+
D80000000000000000000033 /* RNFBDatabaseNullSentinelDecoder.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = RNFBDatabaseNullSentinelDecoder.m; path = ../RNFBDatabase/RNFBDatabaseNullSentinelDecoder.m; sourceTree = SOURCE_ROOT; };
|
|
38
|
+
D8000000000000000000003B /* RNFBDatabaseNullSentinelDecoder.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = RNFBDatabaseNullSentinelDecoder.h; path = ../RNFBDatabase/RNFBDatabaseNullSentinelDecoder.h; sourceTree = SOURCE_ROOT; };
|
|
39
|
+
D80000000000000000000039 /* RNFBDatabaseNullSentinelDecodeTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNFBDatabaseNullSentinelDecodeTests.m; sourceTree = "<group>"; };
|
|
40
|
+
D80000000000000000000014 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Platforms/MacOSX.platform/Developer/Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; };
|
|
41
|
+
D80000000000000000000026 /* RNFBHandleMapStorage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = RNFBHandleMapStorage.swift; path = ../../../app/ios/RNFBApp/RNFBHandleMapStorage.swift; sourceTree = SOURCE_ROOT; };
|
|
42
|
+
D80000000000000000000027 /* RNFBDatabaseListenerRegistryStorage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = RNFBDatabaseListenerRegistryStorage.swift; path = ../RNFBDatabase/RNFBDatabaseListenerRegistryStorage.swift; sourceTree = SOURCE_ROOT; };
|
|
43
|
+
D80000000000000000000029 /* RNFBDatabaseListenerRegistryStorageTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RNFBDatabaseListenerRegistryStorageTests.swift; sourceTree = "<group>"; };
|
|
44
|
+
D8000000000000000000002B /* RNFBDatabaseQueryRegistryStorage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = RNFBDatabaseQueryRegistryStorage.swift; path = ../RNFBDatabase/RNFBDatabaseQueryRegistryStorage.swift; sourceTree = SOURCE_ROOT; };
|
|
45
|
+
D8000000000000000000002D /* RNFBDatabaseQueryRegistryStorageTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RNFBDatabaseQueryRegistryStorageTests.swift; sourceTree = "<group>"; };
|
|
46
|
+
/* End PBXFileReference section */
|
|
47
|
+
|
|
48
|
+
/* Begin PBXFrameworksBuildPhase section */
|
|
49
|
+
D8000000000000000000000D /* Frameworks */ = {
|
|
50
|
+
isa = PBXFrameworksBuildPhase;
|
|
51
|
+
buildActionMask = 2147483647;
|
|
52
|
+
files = (
|
|
53
|
+
D80000000000000000000015 /* XCTest.framework in Frameworks */,
|
|
54
|
+
);
|
|
55
|
+
runOnlyForDeploymentPostprocessing = 0;
|
|
56
|
+
};
|
|
57
|
+
/* End PBXFrameworksBuildPhase section */
|
|
58
|
+
|
|
59
|
+
/* Begin PBXGroup section */
|
|
60
|
+
D80000000000000000000004 = {
|
|
61
|
+
isa = PBXGroup;
|
|
62
|
+
children = (
|
|
63
|
+
D80000000000000000000006 /* Sources */,
|
|
64
|
+
D80000000000000000000005 /* Products */,
|
|
65
|
+
);
|
|
66
|
+
sourceTree = "<group>";
|
|
67
|
+
};
|
|
68
|
+
D80000000000000000000005 /* Products */ = {
|
|
69
|
+
isa = PBXGroup;
|
|
70
|
+
children = (
|
|
71
|
+
D80000000000000000000003 /* RNFBDatabaseUnitTests.xctest */,
|
|
72
|
+
);
|
|
73
|
+
name = Products;
|
|
74
|
+
sourceTree = "<group>";
|
|
75
|
+
};
|
|
76
|
+
D80000000000000000000006 /* Sources */ = {
|
|
77
|
+
isa = PBXGroup;
|
|
78
|
+
children = (
|
|
79
|
+
D80000000000000000000007 /* RNFBHandleMap.h */,
|
|
80
|
+
D80000000000000000000008 /* RNFBHandleMap.m */,
|
|
81
|
+
D80000000000000000000026 /* RNFBHandleMapStorage.swift */,
|
|
82
|
+
D80000000000000000000016 /* RNFBDatabaseListenerRegistry.h */,
|
|
83
|
+
D80000000000000000000018 /* RNFBDatabaseListenerRegistry.m */,
|
|
84
|
+
D80000000000000000000027 /* RNFBDatabaseListenerRegistryStorage.swift */,
|
|
85
|
+
D80000000000000000000024 /* RNFBDatabaseQueryRegistry.h */,
|
|
86
|
+
D80000000000000000000021 /* RNFBDatabaseQueryRegistry.m */,
|
|
87
|
+
D80000000000000000000031 /* RNFBNullSentinelDecoding.swift */,
|
|
88
|
+
D8000000000000000000003B /* RNFBDatabaseNullSentinelDecoder.h */,
|
|
89
|
+
D80000000000000000000033 /* RNFBDatabaseNullSentinelDecoder.m */,
|
|
90
|
+
D8000000000000000000002B /* RNFBDatabaseQueryRegistryStorage.swift */,
|
|
91
|
+
D80000000000000000000009 /* RNFBDatabaseListenerRegistryTests.m */,
|
|
92
|
+
D80000000000000000000029 /* RNFBDatabaseListenerRegistryStorageTests.swift */,
|
|
93
|
+
D80000000000000000000023 /* RNFBDatabaseQueryRegistryTests.m */,
|
|
94
|
+
D80000000000000000000039 /* RNFBDatabaseNullSentinelDecodeTests.m */,
|
|
95
|
+
D8000000000000000000002D /* RNFBDatabaseQueryRegistryStorageTests.swift */,
|
|
96
|
+
);
|
|
97
|
+
name = Sources;
|
|
98
|
+
sourceTree = "<group>";
|
|
99
|
+
};
|
|
100
|
+
/* End PBXGroup section */
|
|
101
|
+
|
|
102
|
+
/* Begin PBXNativeTarget section */
|
|
103
|
+
D80000000000000000000002 /* RNFBDatabaseUnitTests */ = {
|
|
104
|
+
isa = PBXNativeTarget;
|
|
105
|
+
buildConfigurationList = D80000000000000000000013 /* Build configuration list for PBXNativeTarget "RNFBDatabaseUnitTests" */;
|
|
106
|
+
buildPhases = (
|
|
107
|
+
D8000000000000000000000E /* Sources */,
|
|
108
|
+
D8000000000000000000000D /* Frameworks */,
|
|
109
|
+
);
|
|
110
|
+
buildRules = (
|
|
111
|
+
);
|
|
112
|
+
dependencies = (
|
|
113
|
+
);
|
|
114
|
+
name = RNFBDatabaseUnitTests;
|
|
115
|
+
productName = RNFBDatabaseUnitTests;
|
|
116
|
+
productReference = D80000000000000000000003 /* RNFBDatabaseUnitTests.xctest */;
|
|
117
|
+
productType = "com.apple.product-type.bundle.unit-test";
|
|
118
|
+
};
|
|
119
|
+
/* End PBXNativeTarget section */
|
|
120
|
+
|
|
121
|
+
/* Begin PBXProject section */
|
|
122
|
+
D80000000000000000000001 /* Project object */ = {
|
|
123
|
+
isa = PBXProject;
|
|
124
|
+
attributes = {
|
|
125
|
+
BuildIndependentTargetsInParallel = 1;
|
|
126
|
+
LastUpgradeCheck = 2600;
|
|
127
|
+
ORGANIZATIONNAME = Invertase;
|
|
128
|
+
TargetAttributes = {
|
|
129
|
+
D80000000000000000000002 = {
|
|
130
|
+
CreatedOnToolsVersion = 26.0;
|
|
131
|
+
};
|
|
132
|
+
};
|
|
133
|
+
};
|
|
134
|
+
buildConfigurationList = D80000000000000000000012 /* Build configuration list for PBXProject "RNFBDatabaseUnitTests" */;
|
|
135
|
+
compatibilityVersion = "Xcode 14.0";
|
|
136
|
+
developmentRegion = en;
|
|
137
|
+
hasScannedForEncodings = 0;
|
|
138
|
+
knownRegions = (
|
|
139
|
+
en,
|
|
140
|
+
Base,
|
|
141
|
+
);
|
|
142
|
+
mainGroup = D80000000000000000000004;
|
|
143
|
+
productRefGroup = D80000000000000000000005 /* Products */;
|
|
144
|
+
projectDirPath = "";
|
|
145
|
+
projectRoot = "";
|
|
146
|
+
targets = (
|
|
147
|
+
D80000000000000000000002 /* RNFBDatabaseUnitTests */,
|
|
148
|
+
);
|
|
149
|
+
};
|
|
150
|
+
/* End PBXProject section */
|
|
151
|
+
|
|
152
|
+
/* Begin PBXSourcesBuildPhase section */
|
|
153
|
+
D8000000000000000000000E /* Sources */ = {
|
|
154
|
+
isa = PBXSourcesBuildPhase;
|
|
155
|
+
buildActionMask = 2147483647;
|
|
156
|
+
files = (
|
|
157
|
+
D8000000000000000000000A /* RNFBHandleMap.m in Sources */,
|
|
158
|
+
D80000000000000000000025 /* RNFBHandleMapStorage.swift in Sources */,
|
|
159
|
+
D80000000000000000000028 /* RNFBDatabaseListenerRegistryStorage.swift in Sources */,
|
|
160
|
+
D8000000000000000000000B /* RNFBDatabaseListenerRegistry.m in Sources */,
|
|
161
|
+
D8000000000000000000002C /* RNFBDatabaseQueryRegistryStorage.swift in Sources */,
|
|
162
|
+
D80000000000000000000020 /* RNFBDatabaseQueryRegistry.m in Sources */,
|
|
163
|
+
D80000000000000000000030 /* RNFBNullSentinelDecoding.swift in Sources */,
|
|
164
|
+
D80000000000000000000032 /* RNFBDatabaseNullSentinelDecoder.m in Sources */,
|
|
165
|
+
D8000000000000000000000C /* RNFBDatabaseListenerRegistryTests.m in Sources */,
|
|
166
|
+
D8000000000000000000002A /* RNFBDatabaseListenerRegistryStorageTests.swift in Sources */,
|
|
167
|
+
D80000000000000000000022 /* RNFBDatabaseQueryRegistryTests.m in Sources */,
|
|
168
|
+
D80000000000000000000038 /* RNFBDatabaseNullSentinelDecodeTests.m in Sources */,
|
|
169
|
+
D8000000000000000000002E /* RNFBDatabaseQueryRegistryStorageTests.swift in Sources */,
|
|
170
|
+
);
|
|
171
|
+
runOnlyForDeploymentPostprocessing = 0;
|
|
172
|
+
};
|
|
173
|
+
/* End PBXSourcesBuildPhase section */
|
|
174
|
+
|
|
175
|
+
/* Begin XCBuildConfiguration section */
|
|
176
|
+
D8000000000000000000001A /* Debug */ = {
|
|
177
|
+
isa = XCBuildConfiguration;
|
|
178
|
+
buildSettings = {
|
|
179
|
+
ALWAYS_SEARCH_USER_PATHS = NO;
|
|
180
|
+
CLANG_ENABLE_MODULES = YES;
|
|
181
|
+
CLANG_ENABLE_OBJC_ARC = YES;
|
|
182
|
+
COPY_PHASE_STRIP = NO;
|
|
183
|
+
DEBUG_INFORMATION_FORMAT = dwarf;
|
|
184
|
+
ENABLE_TESTABILITY = YES;
|
|
185
|
+
GCC_C_LANGUAGE_STANDARD = gnu17;
|
|
186
|
+
GCC_DYNAMIC_NO_PIC = NO;
|
|
187
|
+
GCC_OPTIMIZATION_LEVEL = 0;
|
|
188
|
+
MACOSX_DEPLOYMENT_TARGET = 14.0;
|
|
189
|
+
ONLY_ACTIVE_ARCH = YES;
|
|
190
|
+
SDKROOT = macosx;
|
|
191
|
+
SUPPORTED_PLATFORMS = macosx;
|
|
192
|
+
};
|
|
193
|
+
name = Debug;
|
|
194
|
+
};
|
|
195
|
+
D8000000000000000000001B /* Release */ = {
|
|
196
|
+
isa = XCBuildConfiguration;
|
|
197
|
+
buildSettings = {
|
|
198
|
+
ALWAYS_SEARCH_USER_PATHS = NO;
|
|
199
|
+
CLANG_ENABLE_MODULES = YES;
|
|
200
|
+
CLANG_ENABLE_OBJC_ARC = YES;
|
|
201
|
+
COPY_PHASE_STRIP = YES;
|
|
202
|
+
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
|
203
|
+
GCC_C_LANGUAGE_STANDARD = gnu17;
|
|
204
|
+
MACOSX_DEPLOYMENT_TARGET = 14.0;
|
|
205
|
+
SDKROOT = macosx;
|
|
206
|
+
SUPPORTED_PLATFORMS = macosx;
|
|
207
|
+
};
|
|
208
|
+
name = Release;
|
|
209
|
+
};
|
|
210
|
+
D80000000000000000000010 /* Debug */ = {
|
|
211
|
+
isa = XCBuildConfiguration;
|
|
212
|
+
buildSettings = {
|
|
213
|
+
CLANG_ENABLE_CODE_COVERAGE = YES;
|
|
214
|
+
CODE_SIGNING_ALLOWED = NO;
|
|
215
|
+
CODE_SIGNING_REQUIRED = NO;
|
|
216
|
+
CODE_SIGN_IDENTITY = "-";
|
|
217
|
+
COMBINE_HIDPI_IMAGES = YES;
|
|
218
|
+
DEFINES_MODULE = YES;
|
|
219
|
+
GENERATE_INFOPLIST_FILE = YES;
|
|
220
|
+
HEADER_SEARCH_PATHS = (
|
|
221
|
+
"$(SRCROOT)",
|
|
222
|
+
"$(SRCROOT)/../../../app/ios",
|
|
223
|
+
"$(SRCROOT)/../../../app/ios/RNFBApp",
|
|
224
|
+
"$(SRCROOT)/../RNFBDatabase",
|
|
225
|
+
);
|
|
226
|
+
LD_RUNPATH_SEARCH_PATHS = (
|
|
227
|
+
"$(inherited)",
|
|
228
|
+
"@executable_path/../Frameworks",
|
|
229
|
+
"@loader_path/../Frameworks",
|
|
230
|
+
);
|
|
231
|
+
MACOSX_DEPLOYMENT_TARGET = 14.0;
|
|
232
|
+
OTHER_CFLAGS = (
|
|
233
|
+
"-fprofile-instr-generate",
|
|
234
|
+
"-fcoverage-mapping",
|
|
235
|
+
);
|
|
236
|
+
OTHER_LDFLAGS = (
|
|
237
|
+
"-fprofile-instr-generate",
|
|
238
|
+
);
|
|
239
|
+
PRODUCT_BUNDLE_IDENTIFIER = io.invertase.firebase.RNFBDatabaseUnitTests;
|
|
240
|
+
PRODUCT_NAME = "$(TARGET_NAME)";
|
|
241
|
+
SDKROOT = macosx;
|
|
242
|
+
SUPPORTED_PLATFORMS = macosx;
|
|
243
|
+
SWIFT_OBJC_INTERFACE_HEADER_NAME = "RNFBHandleMapStorage-Swift.inc";
|
|
244
|
+
SWIFT_VERSION = 5.10;
|
|
245
|
+
};
|
|
246
|
+
name = Debug;
|
|
247
|
+
};
|
|
248
|
+
D80000000000000000000011 /* Release */ = {
|
|
249
|
+
isa = XCBuildConfiguration;
|
|
250
|
+
buildSettings = {
|
|
251
|
+
CLANG_ENABLE_CODE_COVERAGE = YES;
|
|
252
|
+
CODE_SIGNING_ALLOWED = NO;
|
|
253
|
+
CODE_SIGNING_REQUIRED = NO;
|
|
254
|
+
CODE_SIGN_IDENTITY = "-";
|
|
255
|
+
COMBINE_HIDPI_IMAGES = YES;
|
|
256
|
+
DEFINES_MODULE = YES;
|
|
257
|
+
GENERATE_INFOPLIST_FILE = YES;
|
|
258
|
+
HEADER_SEARCH_PATHS = (
|
|
259
|
+
"$(SRCROOT)",
|
|
260
|
+
"$(SRCROOT)/../../../app/ios",
|
|
261
|
+
"$(SRCROOT)/../../../app/ios/RNFBApp",
|
|
262
|
+
"$(SRCROOT)/../RNFBDatabase",
|
|
263
|
+
);
|
|
264
|
+
LD_RUNPATH_SEARCH_PATHS = (
|
|
265
|
+
"$(inherited)",
|
|
266
|
+
"@executable_path/../Frameworks",
|
|
267
|
+
"@loader_path/../Frameworks",
|
|
268
|
+
);
|
|
269
|
+
MACOSX_DEPLOYMENT_TARGET = 14.0;
|
|
270
|
+
PRODUCT_BUNDLE_IDENTIFIER = io.invertase.firebase.RNFBDatabaseUnitTests;
|
|
271
|
+
PRODUCT_NAME = "$(TARGET_NAME)";
|
|
272
|
+
SDKROOT = macosx;
|
|
273
|
+
SUPPORTED_PLATFORMS = macosx;
|
|
274
|
+
SWIFT_OBJC_INTERFACE_HEADER_NAME = "RNFBHandleMapStorage-Swift.inc";
|
|
275
|
+
SWIFT_VERSION = 5.10;
|
|
276
|
+
};
|
|
277
|
+
name = Release;
|
|
278
|
+
};
|
|
279
|
+
/* End XCBuildConfiguration section */
|
|
280
|
+
|
|
281
|
+
/* Begin XCConfigurationList section */
|
|
282
|
+
D80000000000000000000012 /* Build configuration list for PBXProject "RNFBDatabaseUnitTests" */ = {
|
|
283
|
+
isa = XCConfigurationList;
|
|
284
|
+
buildConfigurations = (
|
|
285
|
+
D8000000000000000000001A /* Debug */,
|
|
286
|
+
D8000000000000000000001B /* Release */,
|
|
287
|
+
);
|
|
288
|
+
defaultConfigurationIsVisible = 0;
|
|
289
|
+
defaultConfigurationName = Debug;
|
|
290
|
+
};
|
|
291
|
+
D80000000000000000000013 /* Build configuration list for PBXNativeTarget "RNFBDatabaseUnitTests" */ = {
|
|
292
|
+
isa = XCConfigurationList;
|
|
293
|
+
buildConfigurations = (
|
|
294
|
+
D80000000000000000000010 /* Debug */,
|
|
295
|
+
D80000000000000000000011 /* Release */,
|
|
296
|
+
);
|
|
297
|
+
defaultConfigurationIsVisible = 0;
|
|
298
|
+
defaultConfigurationName = Debug;
|
|
299
|
+
};
|
|
300
|
+
/* End XCConfigurationList section */
|
|
301
|
+
};
|
|
302
|
+
rootObject = D80000000000000000000001 /* Project object */;
|
|
303
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<Scheme
|
|
3
|
+
LastUpgradeVersion = "2600"
|
|
4
|
+
version = "1.7">
|
|
5
|
+
<BuildAction
|
|
6
|
+
parallelizeBuildables = "YES"
|
|
7
|
+
buildImplicitDependencies = "YES">
|
|
8
|
+
<BuildActionEntries>
|
|
9
|
+
<BuildActionEntry
|
|
10
|
+
buildForTesting = "YES"
|
|
11
|
+
buildForRunning = "YES"
|
|
12
|
+
buildForProfiling = "NO"
|
|
13
|
+
buildForArchiving = "NO"
|
|
14
|
+
buildForAnalyzing = "YES">
|
|
15
|
+
<BuildableReference
|
|
16
|
+
BuildableIdentifier = "primary"
|
|
17
|
+
BlueprintIdentifier = "D80000000000000000000002"
|
|
18
|
+
BuildableName = "RNFBDatabaseUnitTests.xctest"
|
|
19
|
+
BlueprintName = "RNFBDatabaseUnitTests"
|
|
20
|
+
ReferencedContainer = "container:RNFBDatabaseUnitTests.xcodeproj">
|
|
21
|
+
</BuildableReference>
|
|
22
|
+
</BuildActionEntry>
|
|
23
|
+
</BuildActionEntries>
|
|
24
|
+
</BuildAction>
|
|
25
|
+
<TestAction
|
|
26
|
+
buildConfiguration = "Debug"
|
|
27
|
+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
|
28
|
+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
|
29
|
+
shouldUseLaunchSchemeArgsEnv = "YES"
|
|
30
|
+
codeCoverageEnabled = "YES">
|
|
31
|
+
<Testables>
|
|
32
|
+
<TestableReference
|
|
33
|
+
skipped = "NO">
|
|
34
|
+
<BuildableReference
|
|
35
|
+
BuildableIdentifier = "primary"
|
|
36
|
+
BlueprintIdentifier = "D80000000000000000000002"
|
|
37
|
+
BuildableName = "RNFBDatabaseUnitTests.xctest"
|
|
38
|
+
BlueprintName = "RNFBDatabaseUnitTests"
|
|
39
|
+
ReferencedContainer = "container:RNFBDatabaseUnitTests.xcodeproj">
|
|
40
|
+
</BuildableReference>
|
|
41
|
+
</TestableReference>
|
|
42
|
+
</Testables>
|
|
43
|
+
</TestAction>
|
|
44
|
+
<LaunchAction
|
|
45
|
+
buildConfiguration = "Debug"
|
|
46
|
+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
|
47
|
+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
|
48
|
+
launchStyle = "0"
|
|
49
|
+
useCustomWorkingDirectory = "NO"
|
|
50
|
+
ignoresPersistentStateOnLaunch = "NO"
|
|
51
|
+
debugDocumentVersioning = "YES"
|
|
52
|
+
debugServiceExtension = "internal"
|
|
53
|
+
allowLocationSimulation = "YES">
|
|
54
|
+
</LaunchAction>
|
|
55
|
+
<ProfileAction
|
|
56
|
+
buildConfiguration = "Release"
|
|
57
|
+
shouldUseLaunchSchemeArgsEnv = "YES"
|
|
58
|
+
savedToolIdentifier = ""
|
|
59
|
+
useCustomWorkingDirectory = "NO"
|
|
60
|
+
debugDocumentVersioning = "YES">
|
|
61
|
+
</ProfileAction>
|
|
62
|
+
<AnalyzeAction
|
|
63
|
+
buildConfiguration = "Debug">
|
|
64
|
+
</AnalyzeAction>
|
|
65
|
+
<ArchiveAction
|
|
66
|
+
buildConfiguration = "Release"
|
|
67
|
+
revealArchiveInOrganizer = "YES">
|
|
68
|
+
</ArchiveAction>
|
|
69
|
+
</Scheme>
|
|
@@ -141,6 +141,10 @@ namespace facebook::react {
|
|
|
141
141
|
return static_cast<ObjCTurboModule&>(turboModule).invokeObjCMethod(rt, PromiseKind, "once", @selector(once:dbURL:path:modifiers:eventType:resolve:reject:), args, count);
|
|
142
142
|
}
|
|
143
143
|
|
|
144
|
+
static facebook::jsi::Value __hostFunction_NativeRNFBTurboDatabaseQuerySpecJSI_get(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
|
|
145
|
+
return static_cast<ObjCTurboModule&>(turboModule).invokeObjCMethod(rt, PromiseKind, "get", @selector(get:dbURL:path:modifiers:resolve:reject:), args, count);
|
|
146
|
+
}
|
|
147
|
+
|
|
144
148
|
static facebook::jsi::Value __hostFunction_NativeRNFBTurboDatabaseQuerySpecJSI_on(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
|
|
145
149
|
return static_cast<ObjCTurboModule&>(turboModule).invokeObjCMethod(rt, VoidKind, "on", @selector(on:dbURL:props:), args, count);
|
|
146
150
|
}
|
|
@@ -159,6 +163,9 @@ namespace facebook::react {
|
|
|
159
163
|
methodMap_["once"] = MethodMetadata {5, __hostFunction_NativeRNFBTurboDatabaseQuerySpecJSI_once};
|
|
160
164
|
|
|
161
165
|
|
|
166
|
+
methodMap_["get"] = MethodMetadata {4, __hostFunction_NativeRNFBTurboDatabaseQuerySpecJSI_get};
|
|
167
|
+
|
|
168
|
+
|
|
162
169
|
methodMap_["on"] = MethodMetadata {3, __hostFunction_NativeRNFBTurboDatabaseQuerySpecJSI_on};
|
|
163
170
|
|
|
164
171
|
|
|
@@ -135,6 +135,12 @@ namespace facebook::react {
|
|
|
135
135
|
eventType:(NSString *)eventType
|
|
136
136
|
resolve:(RCTPromiseResolveBlock)resolve
|
|
137
137
|
reject:(RCTPromiseRejectBlock)reject;
|
|
138
|
+
- (void)get:(NSString *)app
|
|
139
|
+
dbURL:(NSString *)dbURL
|
|
140
|
+
path:(NSString *)path
|
|
141
|
+
modifiers:(NSArray *)modifiers
|
|
142
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
143
|
+
reject:(RCTPromiseRejectBlock)reject;
|
|
138
144
|
- (void)on:(NSString *)app
|
|
139
145
|
dbURL:(NSString *)dbURL
|
|
140
146
|
props:(NSDictionary *)props;
|
|
@@ -170,6 +170,7 @@ public:
|
|
|
170
170
|
protected:
|
|
171
171
|
NativeRNFBTurboDatabaseQueryCxxSpec(std::shared_ptr<CallInvoker> jsInvoker) : TurboModule(std::string{NativeRNFBTurboDatabaseQueryCxxSpec::kModuleName}, jsInvoker) {
|
|
172
172
|
methodMap_["once"] = MethodMetadata {.argCount = 5, .invoker = __once};
|
|
173
|
+
methodMap_["get"] = MethodMetadata {.argCount = 4, .invoker = __get};
|
|
173
174
|
methodMap_["on"] = MethodMetadata {.argCount = 3, .invoker = __on};
|
|
174
175
|
methodMap_["off"] = MethodMetadata {.argCount = 2, .invoker = __off};
|
|
175
176
|
methodMap_["keepSynced"] = MethodMetadata {.argCount = 6, .invoker = __keepSynced};
|
|
@@ -188,6 +189,17 @@ private:
|
|
|
188
189
|
count <= 4 ? throw jsi::JSError(rt, "Expected argument in position 4 to be passed") : args[4].asString(rt));
|
|
189
190
|
}
|
|
190
191
|
|
|
192
|
+
static jsi::Value __get(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
193
|
+
static_assert(
|
|
194
|
+
bridging::getParameterCount(&T::get) == 5,
|
|
195
|
+
"Expected get(...) to have 5 parameters");
|
|
196
|
+
return bridging::callFromJs<jsi::Value>(rt, &T::get, static_cast<NativeRNFBTurboDatabaseQueryCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule),
|
|
197
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
|
|
198
|
+
count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt),
|
|
199
|
+
count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asString(rt),
|
|
200
|
+
count <= 3 ? throw jsi::JSError(rt, "Expected argument in position 3 to be passed") : args[3].asObject(rt).asArray(rt));
|
|
201
|
+
}
|
|
202
|
+
|
|
191
203
|
static jsi::Value __on(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
192
204
|
static_assert(
|
|
193
205
|
bridging::getParameterCount(&T::on) == 4,
|
package/lib/DatabaseQuery.ts
CHANGED
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
import {
|
|
19
19
|
isBoolean,
|
|
20
20
|
isFunction,
|
|
21
|
+
isIOS,
|
|
21
22
|
isNull,
|
|
22
23
|
isNumber,
|
|
23
24
|
isObject,
|
|
@@ -45,6 +46,20 @@ const eventTypes = [
|
|
|
45
46
|
'child_removed',
|
|
46
47
|
] as const;
|
|
47
48
|
|
|
49
|
+
/** `.info/*` is client-local metadata that only the listener path serves. */
|
|
50
|
+
const INFO_PATH = /^\/?\.info(\/|$)/;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* True when native/web get already produced an observer-shaped `database/*` code.
|
|
54
|
+
* Android Query.get() non-denial failures use SharedUtils.getExceptionMap → `database/unknown`;
|
|
55
|
+
* those still fall through to `once('value')`. Specific codes mean once already ran (or a
|
|
56
|
+
* denial was mapped to once's code) — do not ask the server again.
|
|
57
|
+
*/
|
|
58
|
+
function isObserverShapedDatabaseError(error: unknown): boolean {
|
|
59
|
+
const code = (error as { code?: string } | null | undefined)?.code;
|
|
60
|
+
return typeof code === 'string' && code.startsWith('database/') && code !== 'database/unknown';
|
|
61
|
+
}
|
|
62
|
+
|
|
48
63
|
type DatabaseReferenceConstructor = new (
|
|
49
64
|
database: DatabaseInternal,
|
|
50
65
|
path: string,
|
|
@@ -316,6 +331,47 @@ export default class DatabaseQuery extends ReferenceBase implements Query {
|
|
|
316
331
|
return callback as (a: DataSnapshot | null, b?: string | null) => void;
|
|
317
332
|
}
|
|
318
333
|
|
|
334
|
+
/**
|
|
335
|
+
* One-shot read backing modular `get()`: on Android and web, the SDKs' single request/response
|
|
336
|
+
* read (`Query.get()`, web `get()`) instead of the listen -> data -> unlisten exchange
|
|
337
|
+
* `once('value')` performs. On iOS the native `get` is still the single-event observer; see
|
|
338
|
+
* `RNFBDatabaseQueryHelper get:`.
|
|
339
|
+
*
|
|
340
|
+
* Callers keep `once('value')` semantics, with one exception noted below:
|
|
341
|
+
* - iOS failures pass straight through (native get already is `once`).
|
|
342
|
+
* - On Android / web, an error whose code is already a specific `database/*` value (anything
|
|
343
|
+
* other than `database/unknown`) passes through: Android maps Query.get() permission denials
|
|
344
|
+
* to the same code `once` gives, and when native get already used `addOnceValueEventListener`
|
|
345
|
+
* (persistence, logging, keepSynced) its cancellations are those codes too — do not call
|
|
346
|
+
* `once('value')` again. Only a plain Query.get() failure is rejected as `database/unknown`
|
|
347
|
+
* (SharedUtils.getExceptionMap); that path still retries as `once('value')`.
|
|
348
|
+
* - Queries (any orderBy / limit / range modifier) use `once('value')`: `get()` parity for
|
|
349
|
+
* unindexed queries is unverified.
|
|
350
|
+
* - `.info/*` paths use `once('value')`: the one-shot reads go to the server tree, not the
|
|
351
|
+
* client-local `.info` tree.
|
|
352
|
+
*
|
|
353
|
+
* The exception: the one-shot read resolves with the server's reply as it was when the read was
|
|
354
|
+
* sent, where `once('value')` layered this client's pending writes over it. A local write made to
|
|
355
|
+
* an overlapping path while a `get()` is in flight is therefore not in its result, as with the
|
|
356
|
+
* web SDK's `get()`.
|
|
357
|
+
*/
|
|
358
|
+
_get(): Promise<DataSnapshot> {
|
|
359
|
+
const modifiers = this._modifiers._copy().toArray();
|
|
360
|
+
if (modifiers.length > 0 || INFO_PATH.test(this.path)) {
|
|
361
|
+
return this.once('value');
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
return this._database.native.get(this.path, modifiers).then(
|
|
365
|
+
result => new DatabaseDataSnapshot(this.ref, result),
|
|
366
|
+
error => {
|
|
367
|
+
if (isIOS || isObserverShapedDatabaseError(error)) {
|
|
368
|
+
return Promise.reject(error);
|
|
369
|
+
}
|
|
370
|
+
return this.once('value');
|
|
371
|
+
},
|
|
372
|
+
);
|
|
373
|
+
}
|
|
374
|
+
|
|
319
375
|
once(
|
|
320
376
|
eventType: EventType,
|
|
321
377
|
successCallBack?: (a: DataSnapshot, b?: string | null) => any,
|
package/lib/DatabaseSyncTree.ts
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
import { isString } from '@react-native-firebase/app/dist/module/common';
|
|
19
19
|
import NativeError from '@react-native-firebase/app/dist/module/internal/NativeFirebaseError';
|
|
20
20
|
import SharedEventEmitter from '@react-native-firebase/app/dist/module/internal/SharedEventEmitter';
|
|
21
|
-
import { getReactNativeModule } from '@react-native-firebase/app/dist/module/internal
|
|
21
|
+
import { getReactNativeModule } from '@react-native-firebase/app/dist/module/internal';
|
|
22
22
|
import DatabaseDataSnapshot from './DatabaseDataSnapshot';
|
|
23
23
|
import type {
|
|
24
24
|
DatabaseChildSnapshotResultInternal,
|
package/lib/index.ts
CHANGED
|
@@ -25,9 +25,9 @@ import type { FirebaseApp } from '@react-native-firebase/app';
|
|
|
25
25
|
import {
|
|
26
26
|
FirebaseModule,
|
|
27
27
|
getOrCreateModularInstance,
|
|
28
|
+
setReactNativeModule,
|
|
28
29
|
} from '@react-native-firebase/app/dist/module/internal';
|
|
29
30
|
import type { ModuleConfig } from '@react-native-firebase/app/dist/module/internal';
|
|
30
|
-
import { setReactNativeModule } from '@react-native-firebase/app/dist/module/internal/nativeModule';
|
|
31
31
|
import type { ReactNativeFirebase } from '@react-native-firebase/app';
|
|
32
32
|
import type {
|
|
33
33
|
DatabaseInternal,
|
package/lib/modular/query.ts
CHANGED
|
@@ -318,7 +318,7 @@ export function setWithPriority(
|
|
|
318
318
|
}
|
|
319
319
|
|
|
320
320
|
export function get(queryRef: Query): Promise<DataSnapshot> {
|
|
321
|
-
return (queryRef as QueryWithSubscriptionMethodsInternal).
|
|
321
|
+
return (queryRef as QueryWithSubscriptionMethodsInternal)._get();
|
|
322
322
|
}
|
|
323
323
|
|
|
324
324
|
export function off(
|
package/lib/types/internal.ts
CHANGED
|
@@ -151,6 +151,7 @@ export interface RNFBDatabaseModule {
|
|
|
151
151
|
modifiers: DatabaseQueryModifier[],
|
|
152
152
|
eventType: EventType,
|
|
153
153
|
): Promise<DatabaseSnapshotInternal | DatabaseChildSnapshotResultInternal>;
|
|
154
|
+
get(path: string, modifiers: DatabaseQueryModifier[]): Promise<DatabaseSnapshotInternal>;
|
|
154
155
|
on(props: DatabaseListenPropsInternal): void;
|
|
155
156
|
off(queryKey: string, eventRegistrationKey: string): void | Promise<void>;
|
|
156
157
|
keepSynced(
|
|
@@ -223,6 +224,7 @@ export interface QueryWithSubscriptionMethodsInternal extends Query {
|
|
|
223
224
|
failureCallbackContext?: ((error: Error) => void) | null,
|
|
224
225
|
context?: ListenOptions,
|
|
225
226
|
): Promise<DataSnapshot>;
|
|
227
|
+
_get(): Promise<DataSnapshot>;
|
|
226
228
|
}
|
|
227
229
|
|
|
228
230
|
/** Query constraint instance that can apply itself to a query. */
|
package/lib/version.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Generated by genversion.
|
|
2
|
-
export const version = '
|
|
2
|
+
export const version = '27.0.0';
|
|
@@ -225,6 +225,19 @@ const databaseFallbackModule: Record<string, unknown> = {
|
|
|
225
225
|
});
|
|
226
226
|
},
|
|
227
227
|
|
|
228
|
+
get(
|
|
229
|
+
appName: string,
|
|
230
|
+
dbURL: string,
|
|
231
|
+
path: string,
|
|
232
|
+
modifiers: DatabaseQueryModifier[],
|
|
233
|
+
): Promise<unknown> {
|
|
234
|
+
return guard(async () => {
|
|
235
|
+
const db = getCachedDatabaseInstance(appName, dbURL);
|
|
236
|
+
const queryRef = getQueryInstance(ref(db, path), modifiers);
|
|
237
|
+
return snapshotToObject(await get(queryRef));
|
|
238
|
+
});
|
|
239
|
+
},
|
|
240
|
+
|
|
228
241
|
once(
|
|
229
242
|
appName: string,
|
|
230
243
|
dbURL: string,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-native-firebase/database",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "27.0.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": "./dist/module/index.js",
|
|
@@ -32,6 +32,7 @@
|
|
|
32
32
|
"android:codegen": "node ../../scripts/codegen-package.mjs database android",
|
|
33
33
|
"ios:codegen": "node ../../scripts/codegen-package.mjs database ios"
|
|
34
34
|
},
|
|
35
|
+
"homepage": "https://rnfirebase.io",
|
|
35
36
|
"repository": {
|
|
36
37
|
"type": "git",
|
|
37
38
|
"url": "https://github.com/invertase/react-native-firebase",
|
|
@@ -48,10 +49,10 @@
|
|
|
48
49
|
"realtome database"
|
|
49
50
|
],
|
|
50
51
|
"peerDependencies": {
|
|
51
|
-
"@react-native-firebase/app": "
|
|
52
|
+
"@react-native-firebase/app": "27.0.0"
|
|
52
53
|
},
|
|
53
54
|
"devDependencies": {
|
|
54
|
-
"@react-native-firebase/app": "
|
|
55
|
+
"@react-native-firebase/app": "27.0.0",
|
|
55
56
|
"react-native-builder-bob": "^0.41.0"
|
|
56
57
|
},
|
|
57
58
|
"publishConfig": {
|
|
@@ -89,5 +90,5 @@
|
|
|
89
90
|
"node_modules/",
|
|
90
91
|
"dist/"
|
|
91
92
|
],
|
|
92
|
-
"gitHead": "
|
|
93
|
+
"gitHead": "0c7e942bca361f1765abaf233bf447d795718eff"
|
|
93
94
|
}
|
|
@@ -10,6 +10,7 @@ export interface Spec extends TurboModule {
|
|
|
10
10
|
modifiers: ReadonlyArray<Object>,
|
|
11
11
|
eventType: string,
|
|
12
12
|
): Promise<Object>;
|
|
13
|
+
get(app: string, dbURL: string, path: string, modifiers: ReadonlyArray<Object>): Promise<Object>;
|
|
13
14
|
on(app: string, dbURL: string, props: Object): void;
|
|
14
15
|
off(queryKey: string, eventRegistrationKey: string): void;
|
|
15
16
|
keepSynced(
|