@react-native-firebase/firestore 23.8.8 → 24.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.
Files changed (359) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/RNFBFirestore.podspec +2 -1
  3. package/android/src/reactnative/java/io/invertase/firebase/firestore/ReactNativeFirebaseFirestoreCollectionModule.java +17 -4
  4. package/android/src/reactnative/java/io/invertase/firebase/firestore/ReactNativeFirebaseFirestoreDocumentModule.java +2 -2
  5. package/android/src/reactnative/java/io/invertase/firebase/firestore/ReactNativeFirebaseFirestorePipelineExecutor.java +1243 -0
  6. package/android/src/reactnative/java/io/invertase/firebase/firestore/ReactNativeFirebaseFirestorePipelineNodeBuilder.java +3919 -0
  7. package/android/src/reactnative/java/io/invertase/firebase/firestore/ReactNativeFirebaseFirestorePipelineParser.java +1735 -0
  8. package/android/src/reactnative/java/io/invertase/firebase/firestore/ReactNativeFirebaseFirestoreSerialize.java +1 -1
  9. package/dist/module/FieldPath.js +59 -0
  10. package/dist/module/FieldPath.js.map +1 -0
  11. package/dist/module/FieldValue.js +82 -0
  12. package/dist/module/FieldValue.js.map +1 -0
  13. package/{lib → dist/module}/FirestoreAggregate.js +31 -43
  14. package/dist/module/FirestoreAggregate.js.map +1 -0
  15. package/dist/module/FirestoreBlob.js +56 -0
  16. package/dist/module/FirestoreBlob.js.map +1 -0
  17. package/dist/module/FirestoreCollectionReference.js +70 -0
  18. package/dist/module/FirestoreCollectionReference.js.map +1 -0
  19. package/{lib → dist/module}/FirestoreDocumentChange.js +12 -15
  20. package/dist/module/FirestoreDocumentChange.js.map +1 -0
  21. package/dist/module/FirestoreDocumentReference.js +170 -0
  22. package/dist/module/FirestoreDocumentReference.js.map +1 -0
  23. package/dist/module/FirestoreDocumentSnapshot.js +88 -0
  24. package/dist/module/FirestoreDocumentSnapshot.js.map +1 -0
  25. package/dist/module/FirestoreFilter.js +146 -0
  26. package/dist/module/FirestoreFilter.js.map +1 -0
  27. package/dist/module/FirestoreGeoPoint.js +80 -0
  28. package/dist/module/FirestoreGeoPoint.js.map +1 -0
  29. package/{lib → dist/module}/FirestorePath.js +5 -12
  30. package/dist/module/FirestorePath.js.map +1 -0
  31. package/{lib → dist/module}/FirestorePersistentCacheIndexManager.js +11 -4
  32. package/dist/module/FirestorePersistentCacheIndexManager.js.map +1 -0
  33. package/dist/module/FirestoreQuery.js +298 -0
  34. package/dist/module/FirestoreQuery.js.map +1 -0
  35. package/{lib → dist/module}/FirestoreQueryModifiers.js +25 -136
  36. package/dist/module/FirestoreQueryModifiers.js.map +1 -0
  37. package/dist/module/FirestoreQuerySnapshot.js +98 -0
  38. package/dist/module/FirestoreQuerySnapshot.js.map +1 -0
  39. package/dist/module/FirestoreSnapshotMetadata.js +38 -0
  40. package/dist/module/FirestoreSnapshotMetadata.js.map +1 -0
  41. package/dist/module/FirestoreStatics.js +50 -0
  42. package/dist/module/FirestoreStatics.js.map +1 -0
  43. package/{lib → dist/module}/FirestoreTimestamp.js +39 -39
  44. package/dist/module/FirestoreTimestamp.js.map +1 -0
  45. package/dist/module/FirestoreTransaction.js +113 -0
  46. package/dist/module/FirestoreTransaction.js.map +1 -0
  47. package/dist/module/FirestoreTransactionHandler.js +137 -0
  48. package/dist/module/FirestoreTransactionHandler.js.map +1 -0
  49. package/dist/module/FirestoreVectorValue.js +75 -0
  50. package/dist/module/FirestoreVectorValue.js.map +1 -0
  51. package/dist/module/FirestoreWriteBatch.js +113 -0
  52. package/dist/module/FirestoreWriteBatch.js.map +1 -0
  53. package/dist/module/LoadBundleTask.js +70 -0
  54. package/dist/module/LoadBundleTask.js.map +1 -0
  55. package/dist/module/index.js +31 -0
  56. package/dist/module/index.js.map +1 -0
  57. package/dist/module/modular/Bytes.js +67 -0
  58. package/dist/module/modular/Bytes.js.map +1 -0
  59. package/dist/module/modular/FieldPath.js +25 -0
  60. package/dist/module/modular/FieldPath.js.map +1 -0
  61. package/dist/module/modular/FieldValue.js +37 -0
  62. package/dist/module/modular/FieldValue.js.map +1 -0
  63. package/dist/module/modular/GeoPoint.js +22 -0
  64. package/dist/module/modular/GeoPoint.js.map +1 -0
  65. package/dist/module/modular/Timestamp.js +22 -0
  66. package/dist/module/modular/Timestamp.js.map +1 -0
  67. package/dist/module/modular/VectorValue.js +25 -0
  68. package/dist/module/modular/VectorValue.js.map +1 -0
  69. package/dist/module/modular/query.js +222 -0
  70. package/dist/module/modular/query.js.map +1 -0
  71. package/dist/module/modular/snapshot.js +32 -0
  72. package/dist/module/modular/snapshot.js.map +1 -0
  73. package/dist/module/modular.js +229 -0
  74. package/dist/module/modular.js.map +1 -0
  75. package/dist/module/namespaced.js +298 -0
  76. package/dist/module/namespaced.js.map +1 -0
  77. package/dist/module/package.json +1 -0
  78. package/dist/module/pipelines/expressions.js +1273 -0
  79. package/dist/module/pipelines/expressions.js.map +1 -0
  80. package/dist/module/pipelines/index.js +32 -0
  81. package/dist/module/pipelines/index.js.map +1 -0
  82. package/dist/module/pipelines/pipeline-result.js +58 -0
  83. package/dist/module/pipelines/pipeline-result.js.map +1 -0
  84. package/dist/module/pipelines/pipeline-source.js +4 -0
  85. package/dist/module/pipelines/pipeline-source.js.map +1 -0
  86. package/dist/module/pipelines/pipeline.js +4 -0
  87. package/dist/module/pipelines/pipeline.js.map +1 -0
  88. package/dist/module/pipelines/pipeline_impl.js +42 -0
  89. package/dist/module/pipelines/pipeline_impl.js.map +1 -0
  90. package/dist/module/pipelines/pipeline_options.js +4 -0
  91. package/dist/module/pipelines/pipeline_options.js.map +1 -0
  92. package/dist/module/pipelines/pipeline_runtime.js +526 -0
  93. package/dist/module/pipelines/pipeline_runtime.js.map +1 -0
  94. package/dist/module/pipelines/pipeline_support.js +71 -0
  95. package/dist/module/pipelines/pipeline_support.js.map +1 -0
  96. package/dist/module/pipelines/pipeline_validate.js +183 -0
  97. package/dist/module/pipelines/pipeline_validate.js.map +1 -0
  98. package/dist/module/pipelines/stage_options.js +4 -0
  99. package/dist/module/pipelines/stage_options.js.map +1 -0
  100. package/dist/module/pipelines/types.js +2 -0
  101. package/dist/module/pipelines/types.js.map +1 -0
  102. package/dist/module/types/firestore.js +4 -0
  103. package/dist/module/types/firestore.js.map +1 -0
  104. package/dist/module/types/internal.js +4 -0
  105. package/dist/module/types/internal.js.map +1 -0
  106. package/dist/module/types/namespaced.js +338 -0
  107. package/dist/module/types/namespaced.js.map +1 -0
  108. package/{lib → dist/module}/utils/index.js +59 -114
  109. package/dist/module/utils/index.js.map +1 -0
  110. package/{lib → dist/module}/utils/serialize.js +58 -116
  111. package/dist/module/utils/serialize.js.map +1 -0
  112. package/{lib → dist/module}/utils/typemap.js +6 -20
  113. package/dist/module/utils/typemap.js.map +1 -0
  114. package/dist/module/version.js +5 -0
  115. package/dist/module/version.js.map +1 -0
  116. package/dist/module/web/RNFBFirestoreModule.android.js +5 -0
  117. package/dist/module/web/RNFBFirestoreModule.android.js.map +1 -0
  118. package/dist/module/web/RNFBFirestoreModule.ios.js +5 -0
  119. package/dist/module/web/RNFBFirestoreModule.ios.js.map +1 -0
  120. package/dist/module/web/RNFBFirestoreModule.js +387 -0
  121. package/dist/module/web/RNFBFirestoreModule.js.map +1 -0
  122. package/{lib → dist/module}/web/convert.js +60 -94
  123. package/dist/module/web/convert.js.map +1 -0
  124. package/dist/module/web/pipelines/pipeline.js +34 -0
  125. package/dist/module/web/pipelines/pipeline.js.map +1 -0
  126. package/dist/module/web/pipelines/pipeline_bridge_factory.js +217 -0
  127. package/dist/module/web/pipelines/pipeline_bridge_factory.js.map +1 -0
  128. package/dist/module/web/pipelines/pipeline_node_builder.js +294 -0
  129. package/dist/module/web/pipelines/pipeline_node_builder.js.map +1 -0
  130. package/dist/module/web/pipelines/pipeline_parser.js +21 -0
  131. package/dist/module/web/pipelines/pipeline_parser.js.map +1 -0
  132. package/dist/module/web/pipelines/pipeline_snapshot_serializer.js +89 -0
  133. package/dist/module/web/pipelines/pipeline_snapshot_serializer.js.map +1 -0
  134. package/dist/module/web/query.js +95 -0
  135. package/dist/module/web/query.js.map +1 -0
  136. package/dist/typescript/lib/FieldPath.d.ts +10 -0
  137. package/dist/typescript/lib/FieldPath.d.ts.map +1 -0
  138. package/dist/typescript/lib/FieldValue.d.ts +17 -0
  139. package/dist/typescript/lib/FieldValue.d.ts.map +1 -0
  140. package/dist/typescript/lib/FirestoreAggregate.d.ts +40 -0
  141. package/dist/typescript/lib/FirestoreAggregate.d.ts.map +1 -0
  142. package/dist/typescript/lib/FirestoreBlob.d.ts +11 -0
  143. package/dist/typescript/lib/FirestoreBlob.d.ts.map +1 -0
  144. package/dist/typescript/lib/FirestoreCollectionReference.d.ts +15 -0
  145. package/dist/typescript/lib/FirestoreCollectionReference.d.ts.map +1 -0
  146. package/dist/typescript/lib/FirestoreDocumentChange.d.ts +27 -0
  147. package/dist/typescript/lib/FirestoreDocumentChange.d.ts.map +1 -0
  148. package/dist/typescript/lib/FirestoreDocumentReference.d.ts +30 -0
  149. package/dist/typescript/lib/FirestoreDocumentReference.d.ts.map +1 -0
  150. package/dist/typescript/lib/FirestoreDocumentSnapshot.d.ts +30 -0
  151. package/dist/typescript/lib/FirestoreDocumentSnapshot.d.ts.map +1 -0
  152. package/dist/typescript/lib/FirestoreFilter.d.ts +52 -0
  153. package/dist/typescript/lib/FirestoreFilter.d.ts.map +1 -0
  154. package/dist/typescript/lib/FirestoreGeoPoint.d.ts +22 -0
  155. package/dist/typescript/lib/FirestoreGeoPoint.d.ts.map +1 -0
  156. package/dist/typescript/lib/FirestorePath.d.ts +12 -0
  157. package/dist/typescript/lib/FirestorePath.d.ts.map +1 -0
  158. package/dist/typescript/lib/FirestorePersistentCacheIndexManager.d.ts +16 -0
  159. package/dist/typescript/lib/FirestorePersistentCacheIndexManager.d.ts.map +1 -0
  160. package/dist/typescript/lib/FirestoreQuery.d.ts +39 -0
  161. package/dist/typescript/lib/FirestoreQuery.d.ts.map +1 -0
  162. package/dist/typescript/lib/FirestoreQueryModifiers.d.ts +59 -0
  163. package/dist/typescript/lib/FirestoreQueryModifiers.d.ts.map +1 -0
  164. package/dist/typescript/lib/FirestoreQuerySnapshot.d.ts +49 -0
  165. package/dist/typescript/lib/FirestoreQuerySnapshot.d.ts.map +1 -0
  166. package/dist/typescript/lib/FirestoreSnapshotMetadata.d.ts +8 -0
  167. package/dist/typescript/lib/FirestoreSnapshotMetadata.d.ts.map +1 -0
  168. package/dist/typescript/lib/FirestoreStatics.d.ts +23 -0
  169. package/dist/typescript/lib/FirestoreStatics.d.ts.map +1 -0
  170. package/dist/typescript/lib/FirestoreTimestamp.d.ts +33 -0
  171. package/dist/typescript/lib/FirestoreTimestamp.d.ts.map +1 -0
  172. package/dist/typescript/lib/FirestoreTransaction.d.ts +42 -0
  173. package/dist/typescript/lib/FirestoreTransaction.d.ts.map +1 -0
  174. package/dist/typescript/lib/FirestoreTransactionHandler.d.ts +26 -0
  175. package/dist/typescript/lib/FirestoreTransactionHandler.d.ts.map +1 -0
  176. package/dist/typescript/lib/FirestoreVectorValue.d.ts +17 -0
  177. package/dist/typescript/lib/FirestoreVectorValue.d.ts.map +1 -0
  178. package/dist/typescript/lib/FirestoreWriteBatch.d.ts +21 -0
  179. package/dist/typescript/lib/FirestoreWriteBatch.d.ts.map +1 -0
  180. package/dist/typescript/lib/LoadBundleTask.d.ts +16 -0
  181. package/dist/typescript/lib/LoadBundleTask.d.ts.map +1 -0
  182. package/dist/typescript/lib/index.d.ts +6 -0
  183. package/dist/typescript/lib/index.d.ts.map +1 -0
  184. package/dist/typescript/lib/modular/Bytes.d.ts +22 -0
  185. package/dist/typescript/lib/modular/Bytes.d.ts.map +1 -0
  186. package/dist/typescript/lib/modular/FieldPath.d.ts +4 -0
  187. package/dist/typescript/lib/modular/FieldPath.d.ts.map +1 -0
  188. package/dist/typescript/lib/modular/FieldValue.d.ts +8 -0
  189. package/dist/typescript/lib/modular/FieldValue.d.ts.map +1 -0
  190. package/dist/typescript/lib/modular/GeoPoint.d.ts +3 -0
  191. package/dist/typescript/lib/modular/GeoPoint.d.ts.map +1 -0
  192. package/dist/typescript/lib/modular/Timestamp.d.ts +3 -0
  193. package/dist/typescript/lib/modular/Timestamp.d.ts.map +1 -0
  194. package/dist/typescript/lib/modular/VectorValue.d.ts +4 -0
  195. package/dist/typescript/lib/modular/VectorValue.d.ts.map +1 -0
  196. package/dist/typescript/lib/modular/query.d.ts +93 -0
  197. package/dist/typescript/lib/modular/query.d.ts.map +1 -0
  198. package/dist/typescript/lib/modular/snapshot.d.ts +30 -0
  199. package/dist/typescript/lib/modular/snapshot.d.ts.map +1 -0
  200. package/dist/typescript/lib/modular.d.ts +69 -0
  201. package/dist/typescript/lib/modular.d.ts.map +1 -0
  202. package/dist/typescript/lib/namespaced.d.ts +13 -0
  203. package/dist/typescript/lib/namespaced.d.ts.map +1 -0
  204. package/dist/typescript/lib/pipelines/expressions.d.ts +723 -0
  205. package/dist/typescript/lib/pipelines/expressions.d.ts.map +1 -0
  206. package/dist/typescript/lib/pipelines/index.d.ts +31 -0
  207. package/dist/typescript/lib/pipelines/index.d.ts.map +1 -0
  208. package/dist/typescript/lib/pipelines/pipeline-result.d.ts +30 -0
  209. package/dist/typescript/lib/pipelines/pipeline-result.d.ts.map +1 -0
  210. package/dist/typescript/lib/pipelines/pipeline-source.d.ts +64 -0
  211. package/dist/typescript/lib/pipelines/pipeline-source.d.ts.map +1 -0
  212. package/dist/typescript/lib/pipelines/pipeline.d.ts +61 -0
  213. package/dist/typescript/lib/pipelines/pipeline.d.ts.map +1 -0
  214. package/dist/typescript/lib/pipelines/pipeline_impl.d.ts +21 -0
  215. package/dist/typescript/lib/pipelines/pipeline_impl.d.ts.map +1 -0
  216. package/dist/typescript/lib/pipelines/pipeline_options.d.ts +17 -0
  217. package/dist/typescript/lib/pipelines/pipeline_options.d.ts.map +1 -0
  218. package/dist/typescript/lib/pipelines/pipeline_runtime.d.ts +10 -0
  219. package/dist/typescript/lib/pipelines/pipeline_runtime.d.ts.map +1 -0
  220. package/dist/typescript/lib/pipelines/pipeline_support.d.ts +7 -0
  221. package/dist/typescript/lib/pipelines/pipeline_support.d.ts.map +1 -0
  222. package/dist/typescript/lib/pipelines/pipeline_validate.d.ts +9 -0
  223. package/dist/typescript/lib/pipelines/pipeline_validate.d.ts.map +1 -0
  224. package/dist/typescript/lib/pipelines/stage_options.d.ts +326 -0
  225. package/dist/typescript/lib/pipelines/stage_options.d.ts.map +1 -0
  226. package/dist/typescript/lib/pipelines/types.d.ts +10 -0
  227. package/dist/typescript/lib/pipelines/types.d.ts.map +1 -0
  228. package/dist/typescript/lib/types/firestore.d.ts +263 -0
  229. package/dist/typescript/lib/types/firestore.d.ts.map +1 -0
  230. package/dist/typescript/lib/types/internal.d.ts +483 -0
  231. package/dist/typescript/lib/types/internal.d.ts.map +1 -0
  232. package/dist/typescript/lib/types/namespaced.d.ts +2285 -0
  233. package/dist/typescript/lib/types/namespaced.d.ts.map +1 -0
  234. package/dist/typescript/lib/utils/index.d.ts +15 -0
  235. package/dist/typescript/lib/utils/index.d.ts.map +1 -0
  236. package/dist/typescript/lib/utils/serialize.d.ts +17 -0
  237. package/dist/typescript/lib/utils/serialize.d.ts.map +1 -0
  238. package/dist/typescript/lib/utils/typemap.d.ts +3 -0
  239. package/dist/typescript/lib/utils/typemap.d.ts.map +1 -0
  240. package/dist/typescript/lib/version.d.ts +2 -0
  241. package/dist/typescript/lib/version.d.ts.map +1 -0
  242. package/dist/typescript/lib/web/RNFBFirestoreModule.android.d.ts +3 -0
  243. package/dist/typescript/lib/web/RNFBFirestoreModule.android.d.ts.map +1 -0
  244. package/dist/typescript/lib/web/RNFBFirestoreModule.d.ts +75 -0
  245. package/dist/typescript/lib/web/RNFBFirestoreModule.d.ts.map +1 -0
  246. package/dist/typescript/lib/web/RNFBFirestoreModule.ios.d.ts +3 -0
  247. package/dist/typescript/lib/web/RNFBFirestoreModule.ios.d.ts.map +1 -0
  248. package/dist/typescript/lib/web/convert.d.ts +14 -0
  249. package/dist/typescript/lib/web/convert.d.ts.map +1 -0
  250. package/dist/typescript/lib/web/pipelines/pipeline.d.ts +4 -0
  251. package/dist/typescript/lib/web/pipelines/pipeline.d.ts.map +1 -0
  252. package/dist/typescript/lib/web/pipelines/pipeline_bridge_factory.d.ts +5 -0
  253. package/dist/typescript/lib/web/pipelines/pipeline_bridge_factory.d.ts.map +1 -0
  254. package/dist/typescript/lib/web/pipelines/pipeline_node_builder.d.ts +5 -0
  255. package/dist/typescript/lib/web/pipelines/pipeline_node_builder.d.ts.map +1 -0
  256. package/dist/typescript/lib/web/pipelines/pipeline_parser.d.ts +3 -0
  257. package/dist/typescript/lib/web/pipelines/pipeline_parser.d.ts.map +1 -0
  258. package/dist/typescript/lib/web/pipelines/pipeline_snapshot_serializer.d.ts +4 -0
  259. package/dist/typescript/lib/web/pipelines/pipeline_snapshot_serializer.d.ts.map +1 -0
  260. package/dist/typescript/lib/web/query.d.ts +23 -0
  261. package/dist/typescript/lib/web/query.d.ts.map +1 -0
  262. package/dist/typescript/package.json +1 -0
  263. package/ios/RNFBFirestore/RNFBFirestoreCollectionModule.m +52 -2
  264. package/ios/RNFBFirestore/RNFBFirestorePipelineBridgeFactory.swift +384 -0
  265. package/ios/RNFBFirestore/RNFBFirestorePipelineCallHandler.swift +86 -0
  266. package/ios/RNFBFirestore/RNFBFirestorePipelineNodeBuilder.swift +1500 -0
  267. package/ios/RNFBFirestore/RNFBFirestorePipelineParser.swift +1352 -0
  268. package/ios/RNFBFirestore/RNFBFirestorePipelineSnapshotSerializer.swift +98 -0
  269. package/lib/{FirestoreFieldPath.js → FieldPath.ts} +10 -12
  270. package/lib/{FirestoreFieldValue.js → FieldValue.ts} +22 -19
  271. package/lib/FirestoreAggregate.ts +124 -0
  272. package/lib/FirestoreBlob.ts +73 -0
  273. package/lib/FirestoreCollectionReference.ts +99 -0
  274. package/lib/FirestoreDocumentChange.ts +71 -0
  275. package/lib/FirestoreDocumentReference.ts +310 -0
  276. package/lib/FirestoreDocumentSnapshot.ts +149 -0
  277. package/lib/FirestoreFilter.ts +232 -0
  278. package/lib/{FirestoreGeoPoint.js → FirestoreGeoPoint.ts} +48 -8
  279. package/lib/FirestorePath.ts +54 -0
  280. package/lib/FirestorePersistentCacheIndexManager.ts +46 -0
  281. package/lib/{FirestoreQuery.js → FirestoreQuery.ts} +208 -100
  282. package/lib/FirestoreQueryModifiers.ts +411 -0
  283. package/lib/{FirestoreQuerySnapshot.js → FirestoreQuerySnapshot.ts} +61 -32
  284. package/lib/{FirestoreSnapshotMetadata.js → FirestoreSnapshotMetadata.ts} +8 -6
  285. package/lib/{FirestoreStatics.js → FirestoreStatics.ts} +18 -11
  286. package/lib/FirestoreTimestamp.ts +161 -0
  287. package/lib/{FirestoreTransaction.js → FirestoreTransaction.ts} +64 -27
  288. package/lib/{FirestoreTransactionHandler.js → FirestoreTransactionHandler.ts} +54 -75
  289. package/lib/{FirestoreVectorValue.js → FirestoreVectorValue.ts} +36 -15
  290. package/lib/{FirestoreWriteBatch.js → FirestoreWriteBatch.ts} +45 -21
  291. package/lib/LoadBundleTask.ts +85 -0
  292. package/lib/index.ts +71 -0
  293. package/lib/modular/Bytes.ts +81 -0
  294. package/lib/modular/FieldPath.ts +24 -0
  295. package/lib/modular/FieldValue.ts +40 -0
  296. package/lib/modular/GeoPoint.ts +20 -0
  297. package/lib/modular/Timestamp.ts +20 -0
  298. package/lib/modular/VectorValue.ts +24 -0
  299. package/lib/modular/query.ts +368 -0
  300. package/lib/modular/snapshot.ts +137 -0
  301. package/lib/modular.ts +552 -0
  302. package/lib/{index.js → namespaced.ts} +170 -80
  303. package/lib/pipelines/expressions.ts +2321 -0
  304. package/lib/pipelines/index.ts +203 -0
  305. package/lib/pipelines/pipeline-result.ts +78 -0
  306. package/lib/pipelines/pipeline-source.ts +83 -0
  307. package/lib/pipelines/pipeline.ts +99 -0
  308. package/lib/pipelines/pipeline_impl.ts +46 -0
  309. package/lib/pipelines/pipeline_options.ts +32 -0
  310. package/lib/pipelines/pipeline_runtime.ts +863 -0
  311. package/lib/pipelines/pipeline_support.ts +134 -0
  312. package/lib/pipelines/pipeline_validate.ts +242 -0
  313. package/lib/pipelines/stage_options.ts +376 -0
  314. package/lib/pipelines/types.ts +26 -0
  315. package/lib/types/firestore.ts +477 -0
  316. package/lib/types/internal.ts +747 -0
  317. package/lib/{index.d.ts → types/namespaced.ts} +280 -79
  318. package/lib/utils/index.ts +244 -0
  319. package/lib/utils/serialize.ts +314 -0
  320. package/lib/utils/typemap.ts +65 -0
  321. package/lib/version.ts +2 -0
  322. package/lib/web/{RNFBFirestoreModule.js → RNFBFirestoreModule.ts} +222 -234
  323. package/lib/web/convert.ts +287 -0
  324. package/lib/web/pipelines/pipeline.ts +47 -0
  325. package/lib/web/pipelines/pipeline_bridge_factory.ts +377 -0
  326. package/lib/web/pipelines/pipeline_node_builder.ts +413 -0
  327. package/lib/web/pipelines/pipeline_parser.ts +23 -0
  328. package/lib/web/pipelines/pipeline_snapshot_serializer.ts +133 -0
  329. package/lib/web/query.ts +150 -0
  330. package/package.json +46 -7
  331. package/tsconfig.json +35 -0
  332. package/lib/FirestoreBlob.js +0 -107
  333. package/lib/FirestoreCollectionReference.js +0 -70
  334. package/lib/FirestoreDocumentReference.js +0 -222
  335. package/lib/FirestoreDocumentSnapshot.js +0 -132
  336. package/lib/FirestoreFilter.js +0 -156
  337. package/lib/modular/Bytes.d.ts +0 -11
  338. package/lib/modular/Bytes.js +0 -62
  339. package/lib/modular/FieldPath.d.ts +0 -20
  340. package/lib/modular/FieldPath.js +0 -7
  341. package/lib/modular/FieldValue.d.ts +0 -67
  342. package/lib/modular/FieldValue.js +0 -41
  343. package/lib/modular/GeoPoint.d.ts +0 -17
  344. package/lib/modular/GeoPoint.js +0 -3
  345. package/lib/modular/Timestamp.d.ts +0 -85
  346. package/lib/modular/Timestamp.js +0 -3
  347. package/lib/modular/VectorValue.d.ts +0 -30
  348. package/lib/modular/VectorValue.js +0 -11
  349. package/lib/modular/index.d.ts +0 -788
  350. package/lib/modular/index.js +0 -410
  351. package/lib/modular/query.d.ts +0 -370
  352. package/lib/modular/query.js +0 -233
  353. package/lib/modular/snapshot.d.ts +0 -256
  354. package/lib/modular/snapshot.js +0 -33
  355. package/lib/modular/utils/observer.js +0 -16
  356. package/lib/version.js +0 -2
  357. package/lib/web/query.js +0 -112
  358. /package/lib/web/{RNFBFirestoreModule.android.js → RNFBFirestoreModule.android.ts} +0 -0
  359. /package/lib/web/{RNFBFirestoreModule.ios.js → RNFBFirestoreModule.ios.ts} +0 -0
package/lib/modular.ts ADDED
@@ -0,0 +1,552 @@
1
+ /*
2
+ * Copyright (c) 2016-present Invertase Limited & Contributors
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this library except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ *
16
+ */
17
+
18
+ import { getApp, setLogLevel as appSetLogLevel } from '@react-native-firebase/app';
19
+ import { isObject, MODULAR_DEPRECATION_ARG } from '@react-native-firebase/app/dist/module/common';
20
+ import {
21
+ AggregateField,
22
+ fieldPathFromArgument,
23
+ AggregateQuerySnapshot,
24
+ } from './FirestoreAggregate';
25
+ import QueryImpl from './FirestoreQuery';
26
+ import { LoadBundleTask } from './LoadBundleTask';
27
+ import type {
28
+ CollectionReference,
29
+ DocumentData,
30
+ DocumentReference,
31
+ Firestore,
32
+ FirestoreSettings,
33
+ FirebaseApp,
34
+ EmulatorMockTokenOptions,
35
+ Query,
36
+ SetOptions,
37
+ Transaction,
38
+ UpdateData,
39
+ WithFieldValue,
40
+ PartialWithFieldValue,
41
+ WriteBatch,
42
+ AggregateSpec,
43
+ LoadBundleTaskProgress,
44
+ LogLevel,
45
+ } from './types/firestore';
46
+ import type {
47
+ CollectionReferenceInternal,
48
+ DocumentReferenceInternal,
49
+ FirestoreInternal,
50
+ ParentReferenceInternal,
51
+ PersistentCacheIndexManagerInternal,
52
+ QueryInternal,
53
+ QueryWithAggregateInternals,
54
+ ReferenceInternal,
55
+ AppWithFirestoreInternal,
56
+ FirestoreAggregateQuerySpecInternal,
57
+ FirestoreAggregateQueryResultInternal,
58
+ } from './types/internal';
59
+ import { PersistentCacheIndexManager } from './FirestorePersistentCacheIndexManager';
60
+ import type { FieldPath } from './modular/FieldPath';
61
+ import type { Unsubscribe } from './types/firestore';
62
+
63
+ export { AggregateField, AggregateQuerySnapshot } from './FirestoreAggregate';
64
+
65
+ export const CACHE_SIZE_UNLIMITED = -1;
66
+ const PIPELINE_RUNTIME_INSTALLER_SYMBOL = Symbol.for('RNFBFirestorePipelineRuntimeInstaller');
67
+
68
+ type GlobalWithPipelineInstaller = typeof globalThis & {
69
+ [PIPELINE_RUNTIME_INSTALLER_SYMBOL]?: (firestore?: FirestoreInternal) => void;
70
+ };
71
+
72
+ export function getFirestore(): Firestore;
73
+ export function getFirestore(app: FirebaseApp): Firestore;
74
+ export function getFirestore(app: FirebaseApp, databaseId: string): Firestore;
75
+ export function getFirestore(
76
+ appOrDatabaseId?: FirebaseApp | string,
77
+ databaseId?: string,
78
+ ): Firestore {
79
+ const app = (name?: string) => getApp(name) as unknown as AppWithFirestoreInternal;
80
+ let firestore: Firestore;
81
+ if (typeof appOrDatabaseId === 'string') {
82
+ firestore = app().firestore(appOrDatabaseId);
83
+ } else if (appOrDatabaseId) {
84
+ if (databaseId) {
85
+ firestore = app(appOrDatabaseId.name).firestore(databaseId);
86
+ } else {
87
+ firestore = app(appOrDatabaseId.name).firestore();
88
+ }
89
+ } else if (databaseId) {
90
+ firestore = app().firestore(databaseId);
91
+ } else {
92
+ firestore = app().firestore();
93
+ }
94
+
95
+ const runtimeGlobal = globalThis as GlobalWithPipelineInstaller;
96
+ const installPipelineRuntime = runtimeGlobal[PIPELINE_RUNTIME_INSTALLER_SYMBOL];
97
+ if (typeof installPipelineRuntime === 'function') {
98
+ try {
99
+ installPipelineRuntime(firestore as FirestoreInternal);
100
+ } catch {
101
+ // Avoid changing getFirestore behavior if optional pipeline runtime install fails.
102
+ }
103
+ }
104
+
105
+ return firestore;
106
+ }
107
+
108
+ export function doc(
109
+ parent: Firestore,
110
+ path: string,
111
+ ...pathSegments: string[]
112
+ ): DocumentReference<DocumentData, DocumentData>;
113
+ export function doc<AppModelType, DbModelType extends DocumentData>(
114
+ parent: CollectionReference<AppModelType, DbModelType>,
115
+ path?: string,
116
+ ...pathSegments: string[]
117
+ ): DocumentReference<AppModelType, DbModelType>;
118
+ export function doc<AppModelType, DbModelType extends DocumentData>(
119
+ parent: DocumentReference<AppModelType, DbModelType>,
120
+ path: string,
121
+ ...pathSegments: string[]
122
+ ): DocumentReference<DocumentData, DocumentData>;
123
+ export function doc<AppModelType = DocumentData, DbModelType extends DocumentData = DocumentData>(
124
+ parent:
125
+ | Firestore
126
+ | CollectionReference<AppModelType, DbModelType>
127
+ | DocumentReference<AppModelType, DbModelType>,
128
+ path?: string,
129
+ ...pathSegments: string[]
130
+ ): DocumentReference<AppModelType, DbModelType> {
131
+ let resolvedPath = path;
132
+ if (pathSegments.length) {
133
+ resolvedPath =
134
+ (resolvedPath ?? '') +
135
+ '/' +
136
+ pathSegments.map(segment => segment.replace(/^\/|\/$/g, '')).join('/');
137
+ }
138
+
139
+ return (parent as unknown as ParentReferenceInternal).doc.call(
140
+ parent,
141
+ resolvedPath,
142
+ MODULAR_DEPRECATION_ARG,
143
+ ) as DocumentReference<AppModelType, DbModelType>;
144
+ }
145
+
146
+ export function collection(
147
+ parent: Firestore,
148
+ path: string,
149
+ ...pathSegments: string[]
150
+ ): CollectionReference<DocumentData, DocumentData>;
151
+ export function collection<AppModelType, DbModelType extends DocumentData>(
152
+ parent: CollectionReference<AppModelType, DbModelType>,
153
+ path: string,
154
+ ...pathSegments: string[]
155
+ ): CollectionReference<DocumentData, DocumentData>;
156
+ export function collection<AppModelType, DbModelType extends DocumentData>(
157
+ parent: DocumentReference<AppModelType, DbModelType>,
158
+ path: string,
159
+ ...pathSegments: string[]
160
+ ): CollectionReference<DocumentData, DocumentData>;
161
+ export function collection<
162
+ AppModelType = DocumentData,
163
+ DbModelType extends DocumentData = DocumentData,
164
+ >(
165
+ parent:
166
+ | Firestore
167
+ | DocumentReference<AppModelType, DbModelType>
168
+ | CollectionReference<AppModelType, DbModelType>,
169
+ path: string,
170
+ ...pathSegments: string[]
171
+ ): CollectionReference<DocumentData, DocumentData> {
172
+ let resolvedPath = path;
173
+ if (pathSegments.length) {
174
+ resolvedPath = `${resolvedPath}/${pathSegments.map(segment => segment.replace(/^\/|\/$/g, '')).join('/')}`;
175
+ }
176
+
177
+ return (parent as unknown as ParentReferenceInternal).collection.call(
178
+ parent,
179
+ resolvedPath,
180
+ MODULAR_DEPRECATION_ARG,
181
+ ) as CollectionReference<DocumentData, DocumentData>;
182
+ }
183
+
184
+ export function refEqual<AppModelType, DbModelType extends DocumentData>(
185
+ left:
186
+ | DocumentReference<AppModelType, DbModelType>
187
+ | CollectionReference<AppModelType, DbModelType>,
188
+ right:
189
+ | DocumentReference<AppModelType, DbModelType>
190
+ | CollectionReference<AppModelType, DbModelType>,
191
+ ): boolean {
192
+ return (left as unknown as ReferenceInternal<AppModelType, DbModelType>).isEqual.call(
193
+ left,
194
+ right,
195
+ MODULAR_DEPRECATION_ARG,
196
+ );
197
+ }
198
+
199
+ export function collectionGroup(
200
+ firestore: Firestore,
201
+ collectionId: string,
202
+ ): Query<DocumentData, DocumentData> {
203
+ return (firestore as FirestoreInternal).collectionGroup.call(
204
+ firestore,
205
+ collectionId,
206
+ MODULAR_DEPRECATION_ARG,
207
+ ) as Query<DocumentData, DocumentData>;
208
+ }
209
+
210
+ let snapshotInSyncListenerId = 0;
211
+
212
+ export function onSnapshotsInSync(
213
+ firestore: Firestore,
214
+ observer: { next?: () => void; error?: (error: Error) => void; complete?: () => void },
215
+ ): Unsubscribe;
216
+ export function onSnapshotsInSync(firestore: Firestore, onSync: () => void): Unsubscribe;
217
+ export function onSnapshotsInSync(
218
+ firestore: Firestore,
219
+ callback:
220
+ | (() => void)
221
+ | { next?: () => void; error?: (error: Error) => void; complete?: () => void },
222
+ ): Unsubscribe {
223
+ const listenerId = snapshotInSyncListenerId++;
224
+ const syncFirestore = firestore as FirestoreInternal;
225
+ syncFirestore.native.addSnapshotsInSync(listenerId);
226
+ const subscription = syncFirestore.emitter.addListener(
227
+ syncFirestore.eventNameForApp(`firestore_snapshots_in_sync_event:${listenerId}`),
228
+ () => {
229
+ if (typeof callback === 'function') {
230
+ callback();
231
+ } else {
232
+ callback.next?.();
233
+ }
234
+ },
235
+ );
236
+
237
+ return () => {
238
+ subscription.remove();
239
+ syncFirestore.native.removeSnapshotsInSync(listenerId);
240
+ };
241
+ }
242
+
243
+ export function setDoc<AppModelType, DbModelType extends DocumentData>(
244
+ reference: DocumentReference<AppModelType, DbModelType>,
245
+ data: WithFieldValue<AppModelType>,
246
+ ): Promise<void>;
247
+ export function setDoc<AppModelType, DbModelType extends DocumentData>(
248
+ reference: DocumentReference<AppModelType, DbModelType>,
249
+ data: PartialWithFieldValue<AppModelType>,
250
+ options: SetOptions,
251
+ ): Promise<void>;
252
+ export function setDoc<AppModelType, DbModelType extends DocumentData>(
253
+ reference: DocumentReference<AppModelType, DbModelType>,
254
+ data: WithFieldValue<AppModelType> | PartialWithFieldValue<AppModelType>,
255
+ options?: SetOptions,
256
+ ): Promise<void> {
257
+ return (reference as unknown as DocumentReferenceInternal<AppModelType, DbModelType>).set.call(
258
+ reference,
259
+ data,
260
+ options,
261
+ MODULAR_DEPRECATION_ARG,
262
+ );
263
+ }
264
+
265
+ export function updateDoc<AppModelType, DbModelType extends DocumentData>(
266
+ reference: DocumentReference<AppModelType, DbModelType>,
267
+ data: UpdateData<DbModelType>,
268
+ ): Promise<void>;
269
+ export function updateDoc<AppModelType, DbModelType extends DocumentData>(
270
+ reference: DocumentReference<AppModelType, DbModelType>,
271
+ field: string | FieldPath,
272
+ value: unknown,
273
+ ...moreFieldsAndValues: unknown[]
274
+ ): Promise<void>;
275
+ export function updateDoc<AppModelType, DbModelType extends DocumentData>(
276
+ reference: DocumentReference<AppModelType, DbModelType>,
277
+ fieldOrUpdateData: string | FieldPath | UpdateData<DbModelType>,
278
+ value?: unknown,
279
+ ...moreFieldsAndValues: unknown[]
280
+ ): Promise<void> {
281
+ const ref = reference as unknown as DocumentReferenceInternal<AppModelType, DbModelType>;
282
+
283
+ if (!fieldOrUpdateData) {
284
+ return ref.update.call(reference, MODULAR_DEPRECATION_ARG);
285
+ }
286
+
287
+ if (!value) {
288
+ return ref.update.call(reference, fieldOrUpdateData, MODULAR_DEPRECATION_ARG);
289
+ }
290
+
291
+ if (!Array.isArray(moreFieldsAndValues)) {
292
+ return ref.update.call(reference, fieldOrUpdateData, value, MODULAR_DEPRECATION_ARG);
293
+ }
294
+
295
+ return ref.update.call(
296
+ reference,
297
+ fieldOrUpdateData,
298
+ value,
299
+ ...moreFieldsAndValues,
300
+ MODULAR_DEPRECATION_ARG,
301
+ );
302
+ }
303
+
304
+ export function addDoc<AppModelType, DbModelType extends DocumentData>(
305
+ reference: CollectionReference<AppModelType, DbModelType>,
306
+ data: WithFieldValue<AppModelType>,
307
+ ): Promise<DocumentReference<AppModelType, DbModelType>> {
308
+ return (reference as unknown as CollectionReferenceInternal<AppModelType, DbModelType>).add.call(
309
+ reference,
310
+ data,
311
+ MODULAR_DEPRECATION_ARG,
312
+ ) as Promise<DocumentReference<AppModelType, DbModelType>>;
313
+ }
314
+
315
+ export function enableNetwork(firestore: Firestore): Promise<void> {
316
+ return (firestore as FirestoreInternal).enableNetwork.call(firestore, MODULAR_DEPRECATION_ARG);
317
+ }
318
+
319
+ export function disableNetwork(firestore: Firestore): Promise<void> {
320
+ return (firestore as FirestoreInternal).disableNetwork.call(firestore, MODULAR_DEPRECATION_ARG);
321
+ }
322
+
323
+ export function clearPersistence(firestore: Firestore): Promise<void> {
324
+ // this will call deprecation warning as it isn't part of firebase-js-sdk API
325
+ return (firestore as FirestoreInternal).clearPersistence();
326
+ }
327
+
328
+ export function clearIndexedDbPersistence(firestore: Firestore): Promise<void> {
329
+ return (firestore as FirestoreInternal).clearPersistence.call(firestore, MODULAR_DEPRECATION_ARG);
330
+ }
331
+
332
+ export function terminate(firestore: Firestore): Promise<void> {
333
+ return (firestore as FirestoreInternal).terminate.call(firestore, MODULAR_DEPRECATION_ARG);
334
+ }
335
+
336
+ export function waitForPendingWrites(firestore: Firestore): Promise<void> {
337
+ return (firestore as FirestoreInternal).waitForPendingWrites.call(
338
+ firestore,
339
+ MODULAR_DEPRECATION_ARG,
340
+ );
341
+ }
342
+
343
+ export async function initializeFirestore(
344
+ app: FirebaseApp,
345
+ settings: FirestoreSettings,
346
+ databaseId?: string,
347
+ ): Promise<Firestore> {
348
+ const firebase = getApp(app.name) as unknown as { firestore(databaseId?: string): Firestore };
349
+ const firestore = firebase.firestore(databaseId) as unknown as FirestoreInternal;
350
+ await firestore.settings.call(firestore, settings, MODULAR_DEPRECATION_ARG);
351
+ return firestore;
352
+ }
353
+
354
+ export function connectFirestoreEmulator(
355
+ firestore: Firestore,
356
+ host: string,
357
+ port: number,
358
+ options?: { mockUserToken?: EmulatorMockTokenOptions | string },
359
+ ): void {
360
+ return (firestore as FirestoreInternal).useEmulator.call(
361
+ firestore,
362
+ host,
363
+ port,
364
+ options,
365
+ MODULAR_DEPRECATION_ARG,
366
+ );
367
+ }
368
+
369
+ export function setLogLevel(logLevel: LogLevel): void {
370
+ return appSetLogLevel(logLevel);
371
+ }
372
+
373
+ export function runTransaction<T>(
374
+ firestore: Firestore,
375
+ updateFunction: (transaction: Transaction) => Promise<T>,
376
+ ): Promise<T> {
377
+ return (firestore as FirestoreInternal).runTransaction.call(
378
+ firestore,
379
+ updateFunction,
380
+ MODULAR_DEPRECATION_ARG,
381
+ ) as Promise<T>;
382
+ }
383
+
384
+ export function getCountFromServer<AppModelType, DbModelType extends DocumentData>(
385
+ query: Query<AppModelType, DbModelType>,
386
+ ): Promise<AggregateQuerySnapshot<{ count: AggregateField<number> }, AppModelType, DbModelType>> {
387
+ return (query as unknown as QueryInternal<AppModelType, DbModelType>).count
388
+ .call(query, MODULAR_DEPRECATION_ARG)
389
+ .get() as Promise<
390
+ AggregateQuerySnapshot<{ count: AggregateField<number> }, AppModelType, DbModelType>
391
+ >;
392
+ }
393
+
394
+ export function getAggregateFromServer<
395
+ AggregateSpecType extends AggregateSpec,
396
+ AppModelType,
397
+ DbModelType extends DocumentData,
398
+ >(
399
+ query: Query<AppModelType, DbModelType>,
400
+ aggregateSpec: AggregateSpecType,
401
+ ): Promise<AggregateQuerySnapshot<AggregateSpecType, AppModelType, DbModelType>> {
402
+ if (!(query instanceof QueryImpl)) {
403
+ throw new Error(
404
+ '`getAggregateFromServer(*, aggregateSpec)` `query` must be an instance of `FirestoreQuery`',
405
+ );
406
+ }
407
+
408
+ if (!isObject(aggregateSpec)) {
409
+ throw new Error('`getAggregateFromServer(query, *)` `aggregateSpec` must be an object');
410
+ }
411
+
412
+ const containsOneAggregateField = Object.values(aggregateSpec).find(
413
+ value => value instanceof AggregateField,
414
+ );
415
+ if (!containsOneAggregateField) {
416
+ throw new Error(
417
+ '`getAggregateFromServer(query, *)` `aggregateSpec` must contain at least one `AggregateField`',
418
+ );
419
+ }
420
+
421
+ const aggregateQueries: FirestoreAggregateQuerySpecInternal[] = [];
422
+
423
+ for (const key in aggregateSpec) {
424
+ if (!Object.prototype.hasOwnProperty.call(aggregateSpec, key)) {
425
+ continue;
426
+ }
427
+ const aggregateField = aggregateSpec[key];
428
+ if (!(aggregateField instanceof AggregateField)) {
429
+ continue;
430
+ }
431
+ switch (aggregateField.aggregateType) {
432
+ case 'avg':
433
+ case 'sum':
434
+ case 'count':
435
+ aggregateQueries.push({
436
+ aggregateType: aggregateField.aggregateType,
437
+ field:
438
+ aggregateField._internalFieldPath === undefined
439
+ ? null
440
+ : aggregateField._internalFieldPath._toPath(),
441
+ key,
442
+ });
443
+ break;
444
+ default:
445
+ throw new Error(
446
+ `'AggregateField' has an an unknown 'AggregateType' : ${aggregateField.aggregateType}`,
447
+ );
448
+ }
449
+ }
450
+
451
+ const queryWithInternals = query as QueryWithAggregateInternals;
452
+ return queryWithInternals._firestore.native
453
+ .aggregateQuery(
454
+ queryWithInternals._collectionPath.relativeName,
455
+ queryWithInternals._modifiers.type,
456
+ queryWithInternals._modifiers.filters,
457
+ queryWithInternals._modifiers.orders,
458
+ queryWithInternals._modifiers.options,
459
+ aggregateQueries,
460
+ )
461
+ .then(
462
+ (data: FirestoreAggregateQueryResultInternal) =>
463
+ new AggregateQuerySnapshot(
464
+ query as Query<AppModelType, DbModelType>,
465
+ data,
466
+ false,
467
+ ) as AggregateQuerySnapshot<AggregateSpecType, AppModelType, DbModelType>,
468
+ );
469
+ }
470
+
471
+ export function sum(field: string | FieldPath): AggregateField<number> {
472
+ return new AggregateField('sum', fieldPathFromArgument(field));
473
+ }
474
+
475
+ export function average(field: string | FieldPath): AggregateField<number | null> {
476
+ return new AggregateField('avg', fieldPathFromArgument(field));
477
+ }
478
+
479
+ export function count(): AggregateField<number> {
480
+ return new AggregateField('count');
481
+ }
482
+
483
+ export function loadBundle(
484
+ firestore: Firestore,
485
+ bundleData: ReadableStream<Uint8Array> | ArrayBuffer | string,
486
+ ): LoadBundleTask {
487
+ const task = new LoadBundleTask();
488
+ (firestore as FirestoreInternal).loadBundle
489
+ .call(firestore, bundleData, MODULAR_DEPRECATION_ARG)
490
+ .then(progress => task._completeWith(progress as LoadBundleTaskProgress))
491
+ .catch(error => task._failWith(error));
492
+ return task;
493
+ }
494
+
495
+ export function namedQuery(firestore: Firestore, name: string): Promise<Query | null> {
496
+ return Promise.resolve(
497
+ (firestore as FirestoreInternal).namedQuery.call(firestore, name, MODULAR_DEPRECATION_ARG),
498
+ );
499
+ }
500
+
501
+ export function writeBatch(firestore: Firestore): WriteBatch {
502
+ return (firestore as FirestoreInternal).batch.call(firestore, MODULAR_DEPRECATION_ARG);
503
+ }
504
+
505
+ export function getPersistentCacheIndexManager(
506
+ firestore: Firestore,
507
+ ): PersistentCacheIndexManager | null {
508
+ return (firestore as FirestoreInternal).persistentCacheIndexManager.call(
509
+ firestore,
510
+ MODULAR_DEPRECATION_ARG,
511
+ );
512
+ }
513
+
514
+ export function enablePersistentCacheIndexAutoCreation(
515
+ indexManager: PersistentCacheIndexManager,
516
+ ): Promise<void> {
517
+ return (indexManager as PersistentCacheIndexManagerInternal).enableIndexAutoCreation.call(
518
+ indexManager,
519
+ MODULAR_DEPRECATION_ARG,
520
+ );
521
+ }
522
+
523
+ export function disablePersistentCacheIndexAutoCreation(
524
+ indexManager: PersistentCacheIndexManager,
525
+ ): Promise<void> {
526
+ return (indexManager as PersistentCacheIndexManagerInternal).disableIndexAutoCreation.call(
527
+ indexManager,
528
+ MODULAR_DEPRECATION_ARG,
529
+ );
530
+ }
531
+
532
+ export function deleteAllPersistentCacheIndexes(
533
+ indexManager: PersistentCacheIndexManager,
534
+ ): Promise<void> {
535
+ return (indexManager as PersistentCacheIndexManagerInternal).deleteAllIndexes.call(
536
+ indexManager,
537
+ MODULAR_DEPRECATION_ARG,
538
+ );
539
+ }
540
+
541
+ export * from './modular/query';
542
+ export * from './modular/snapshot';
543
+ export * from './modular/Bytes';
544
+ export * from './modular/FieldPath';
545
+ export * from './modular/FieldValue';
546
+ export * from './modular/GeoPoint';
547
+ export * from './modular/Timestamp';
548
+ export * from './modular/VectorValue';
549
+ export { LoadBundleTask } from './LoadBundleTask';
550
+ export { default as Transaction } from './FirestoreTransaction';
551
+ export { default as WriteBatch } from './FirestoreWriteBatch';
552
+ export { Filter } from './FirestoreFilter';