@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
@@ -1,370 +0,0 @@
1
- import { FirebaseFirestoreTypes } from '../..';
2
-
3
- import Query = FirebaseFirestoreTypes.Query;
4
- import QueryCompositeFilterConstraint = FirebaseFirestoreTypes.QueryCompositeFilterConstraint;
5
- import WhereFilterOp = FirebaseFirestoreTypes.WhereFilterOp;
6
- import FieldPath = FirebaseFirestoreTypes.FieldPath;
7
- import QuerySnapshot = FirebaseFirestoreTypes.QuerySnapshot;
8
- import DocumentReference = FirebaseFirestoreTypes.DocumentReference;
9
- import DocumentSnapshot = FirebaseFirestoreTypes.DocumentSnapshot;
10
- import DocumentData = FirebaseFirestoreTypes.DocumentData;
11
-
12
- /** Describes the different query constraints available in this SDK. */
13
- export type QueryConstraintType =
14
- | 'where'
15
- | 'orderBy'
16
- | 'limit'
17
- | 'limitToLast'
18
- | 'startAt'
19
- | 'startAfter'
20
- | 'endAt'
21
- | 'endBefore';
22
-
23
- /**
24
- * An `AppliableConstraint` is an abstraction of a constraint that can be applied
25
- * to a Firestore query.
26
- */
27
- export interface AppliableConstraint {
28
- /**
29
- * Takes the provided {@link Query} and returns a copy of the {@link Query} with this
30
- * {@link AppliableConstraint} applied.
31
- */
32
- _apply<T>(query: Query<T>): Query<T>;
33
- }
34
-
35
- /**
36
- * A `QueryConstraint` is used to narrow the set of documents returned by a
37
- * Firestore query. `QueryConstraint`s are created by invoking {@link where},
38
- * {@link orderBy}, {@link (startAt:1)}, {@link (startAfter:1)}, {@link
39
- * (endBefore:1)}, {@link (endAt:1)}, {@link limit}, {@link limitToLast} and
40
- * can then be passed to {@link (query:1)} to create a new query instance that
41
- * also contains this `QueryConstraint`.
42
- */
43
- export interface QueryConstraint extends AppliableConstraint {
44
- /** The type of this query constraint */
45
- readonly type: QueryConstraintType;
46
-
47
- /**
48
- * Takes the provided {@link Query} and returns a copy of the {@link Query} with this
49
- * {@link AppliableConstraint} applied.
50
- */
51
- _apply<T>(query: Query<T>): Query<T>;
52
- }
53
-
54
- export class QueryOrderByConstraint extends QueryConstraint {
55
- readonly type: QueryConstraintType = 'orderBy';
56
- }
57
-
58
- export class QueryLimitConstraint extends QueryConstraint {
59
- readonly type: QueryConstraintType = 'limit';
60
- }
61
-
62
- export class QueryStartAtConstraint extends QueryConstraint {
63
- readonly type: QueryConstraintType = 'startAt';
64
- }
65
-
66
- export class QueryEndAtConstraint extends QueryConstraint {
67
- readonly type: QueryConstraintType = 'endAt';
68
- }
69
-
70
- export class QueryFieldFilterConstraint extends QueryConstraint {
71
- readonly type: QueryConstraintType = 'where';
72
- }
73
-
74
- /**
75
- * `QueryNonFilterConstraint` is a helper union type that represents
76
- * QueryConstraints which are used to narrow or order the set of documents,
77
- * but that do not explicitly filter on a document field.
78
- * `QueryNonFilterConstraint`s are created by invoking {@link orderBy},
79
- * {@link (startAt:1)}, {@link (startAfter:1)}, {@link (endBefore:1)}, {@link (endAt:1)},
80
- * {@link limit} or {@link limitToLast} and can then be passed to {@link (query:1)}
81
- * to create a new query instance that also contains the `QueryConstraint`.
82
- */
83
- export type QueryNonFilterConstraint =
84
- | QueryOrderByConstraint
85
- | QueryLimitConstraint
86
- | QueryStartAtConstraint
87
- | QueryEndAtConstraint;
88
-
89
- /**
90
- * Creates a new immutable instance of {@link Query} that is extended to also
91
- * include additional query constraints.
92
- *
93
- * @param query - The {@link Query} instance to use as a base for the new
94
- * constraints.
95
- * @param compositeFilter - The {@link QueryCompositeFilterConstraint} to
96
- * apply. Create {@link QueryCompositeFilterConstraint} using {@link and} or
97
- * {@link or}.
98
- * @param queryConstraints - Additional {@link QueryNonFilterConstraint}s to
99
- * apply (e.g. {@link orderBy}, {@link limit}).
100
- * @throws if any of the provided query constraints cannot be combined with the
101
- * existing or new constraints.
102
- */
103
- export declare function query<AppModelType, DbModelType extends DocumentData>(
104
- query: Query<AppModelType, DbModelType>,
105
- compositeFilter: QueryCompositeFilterConstraint,
106
- ...queryConstraints: QueryNonFilterConstraint[]
107
- ): Query<AppModelType, DbModelType>;
108
-
109
- /**
110
- * Creates a new immutable instance of {@link Query} that is extended to also
111
- * include additional query constraints.
112
- *
113
- * @param query - The {@link Query} instance to use as a base for the new
114
- * constraints.
115
- * @param queryConstraints - The list of {@link IQueryConstraint}s to apply.
116
- * @throws if any of the provided query constraints cannot be combined with the
117
- * existing or new constraints.
118
- */
119
- export declare function query<AppModelType, DbModelType extends DocumentData>(
120
- query: Query<AppModelType, DbModelType>,
121
- ...queryConstraints: QueryConstraint[]
122
- ): Query<AppModelType, DbModelType>;
123
-
124
- export function query<T>(
125
- query: Query<T>,
126
- queryConstraint: QueryCompositeFilterConstraint | IQueryConstraint | undefined,
127
- ...additionalQueryConstraints: Array<IQueryConstraint | QueryNonFilterConstraint>
128
- ): Query<T>;
129
-
130
- /**
131
- * Creates a {@link QueryFieldFilterConstraint} that enforces that documents
132
- * must contain the specified field and that the value should satisfy the
133
- * relation constraint provided.
134
- *
135
- * @param fieldPath - The path to compare
136
- * @param opStr - The operation string (e.g "&lt;", "&lt;=", "==", "&lt;",
137
- * "&lt;=", "!=").
138
- * @param value - The value for comparison
139
- * @returns The created {@link QueryFieldFilterConstraint}.
140
- */
141
- export function where(
142
- fieldPath: string | FieldPath,
143
- opStr: WhereFilterOp,
144
- value: unknown,
145
- ): QueryFieldFilterConstraint;
146
-
147
- /**
148
- * The or() function used to generate a logical OR query.
149
- * e.g. or(where('name', '==', 'Ada'), where('name', '==', 'Bob'))
150
- */
151
- export function or(...queries: QueryFilterConstraint[]): QueryCompositeFilterConstraint;
152
-
153
- /**
154
- * The and() function used to generate a logical AND query.
155
- * e.g. and(where('name', '==', 'Ada'), where('name', '==', 'Bob'))
156
- */
157
- export function and(...queries: QueryFilterConstraint[]): QueryCompositeFilterConstraint;
158
-
159
- /**
160
- * The direction of a {@link orderBy} clause is specified as 'desc' or 'asc'
161
- * (descending or ascending).
162
- */
163
- export type OrderByDirection = 'desc' | 'asc';
164
-
165
- /**
166
- * Creates a {@link QueryOrderByConstraint} that sorts the query result by the
167
- * specified field, optionally in descending order instead of ascending.
168
- *
169
- * Note: Documents that do not contain the specified field will not be present
170
- * in the query result.
171
- *
172
- * @param fieldPath - The field to sort by.
173
- * @param directionStr - Optional direction to sort by ('asc' or 'desc'). If
174
- * not specified, order will be ascending.
175
- * @returns The created {@link QueryOrderByConstraint}.
176
- */
177
- export function orderBy(
178
- fieldPath: string | FieldPath,
179
- directionStr?: OrderByDirection = 'asc',
180
- ): QueryOrderByConstraint;
181
-
182
- /**
183
- * Creates a {@link QueryStartAtConstraint} that modifies the result set to
184
- * start at the provided document (inclusive). The starting position is relative
185
- * to the order of the query. The document must contain all of the fields
186
- * provided in the `orderBy` of this query.
187
- *
188
- * @param snapshot - The snapshot of the document to start at.
189
- * @returns A {@link QueryStartAtConstraint} to pass to `query()`.
190
- */
191
- export function startAt(snapshot: DocumentSnapshot<unknown>): QueryStartAtConstraint;
192
- /**
193
- *
194
- * Creates a {@link QueryStartAtConstraint} that modifies the result set to
195
- * start at the provided fields relative to the order of the query. The order of
196
- * the field values must match the order of the order by clauses of the query.
197
- *
198
- * @param fieldValues - The field values to start this query at, in order
199
- * of the query's order by.
200
- * @returns A {@link QueryStartAtConstraint} to pass to `query()`.
201
- */
202
- export function startAt(...fieldValues: unknown[]): QueryStartAtConstraint;
203
-
204
- export function startAt(
205
- ...docOrFields: Array<unknown | DocumentSnapshot<unknown>>
206
- ): QueryStartAtConstraint;
207
-
208
- /**
209
- * Creates a {@link QueryStartAtConstraint} that modifies the result set to
210
- * start after the provided document (exclusive). The starting position is
211
- * relative to the order of the query. The document must contain all of the
212
- * fields provided in the orderBy of the query.
213
- *
214
- * @param snapshot - The snapshot of the document to start after.
215
- * @returns A {@link QueryStartAtConstraint} to pass to `query()`
216
- */
217
- export function startAfter<AppModelType, DbModelType extends DocumentData>(
218
- snapshot: DocumentSnapshot<AppModelType, DbModelType>,
219
- ): QueryStartAtConstraint;
220
-
221
- /**
222
- * Creates a {@link QueryStartAtConstraint} that modifies the result set to
223
- * start after the provided fields relative to the order of the query. The order
224
- * of the field values must match the order of the order by clauses of the query.
225
- *
226
- * @param fieldValues - The field values to start this query after, in order
227
- * of the query's order by.
228
- * @returns A {@link QueryStartAtConstraint} to pass to `query()`
229
- */
230
- export function startAfter(...fieldValues: unknown[]): QueryStartAtConstraint;
231
-
232
- export function startAfter<AppModelType, DbModelType extends DocumentData>(
233
- ...docOrFields: Array<unknown | DocumentSnapshot<AppModelType, DbModelType>>
234
- ): QueryStartAtConstraint;
235
-
236
- /**
237
- * Creates a {@link QueryLimitConstraint} that only returns the first matching
238
- * documents.
239
- *
240
- * @param limit - The maximum number of items to return.
241
- * @returns The created {@link QueryLimitConstraint}.
242
- */
243
- export function limit(limit: number): QueryLimitConstraint;
244
-
245
- /**
246
- * Reads the document referred to by this `DocumentReference`.
247
- *
248
- * Note: `getDoc()` attempts to provide up-to-date data when possible by waiting
249
- * for data from the server, but it may return cached data or fail if you are
250
- * offline and the server cannot be reached. To specify this behavior, invoke
251
- * {@link getDocFromCache} or {@link getDocFromServer}.
252
- *
253
- * @param reference - The reference of the document to fetch.
254
- * @returns A Promise resolved with a `DocumentSnapshot` containing the
255
- * current document contents.
256
- */
257
- export declare function getDoc<T>(reference: DocumentReference<T>): Promise<DocumentSnapshot<T>>;
258
-
259
- /**
260
- * Reads the document referred to by this `DocumentReference` from cache.
261
- * Returns an error if the document is not currently cached.
262
- *
263
- * @returns A `Promise` resolved with a `DocumentSnapshot` containing the
264
- * current document contents.
265
- */
266
- export declare function getDocFromCache<T>(
267
- reference: DocumentReference<T>,
268
- ): Promise<DocumentSnapshot<T>>;
269
-
270
- /**
271
- * Reads the document referred to by this `DocumentReference` from the server.
272
- * Returns an error if the network is not available.
273
- *
274
- * @returns A `Promise` resolved with a `DocumentSnapshot` containing the
275
- * current document contents.
276
- */
277
- export declare function getDocFromServer<T>(
278
- reference: DocumentReference<T>,
279
- ): Promise<DocumentSnapshot<T>>;
280
-
281
- /**
282
- * Executes the query and returns the results as a `QuerySnapshot`.
283
- *
284
- * Note: `getDocs()` attempts to provide up-to-date data when possible by
285
- * waiting for data from the server, but it may return cached data or fail if
286
- * you are offline and the server cannot be reached. To specify this behavior,
287
- * invoke {@link getDocsFromCache} or {@link getDocsFromServer}.
288
- *
289
- * @returns A `Promise` that will be resolved with the results of the query.
290
- */
291
- export declare function getDocs<AppModelType, DbModelType extends DocumentData>(
292
- query: Query<AppModelType, DbModelType>,
293
- ): Promise<QuerySnapshot<AppModelType, DbModelType>>;
294
-
295
- /**
296
- * Executes the query and returns the results as a `QuerySnapshot` from cache.
297
- * Returns an empty result set if no documents matching the query are currently
298
- * cached.
299
- *
300
- * @returns A `Promise` that will be resolved with the results of the query.
301
- */
302
- export declare function getDocsFromCache<AppModelType, DbModelType extends DocumentData>(
303
- query: Query<AppModelType, DbModelType>,
304
- ): Promise<QuerySnapshot<AppModelType, DbModelType>>;
305
-
306
- /**
307
- * Executes the query and returns the results as a `QuerySnapshot` from the
308
- * server. Returns an error if the network is not available.
309
- *
310
- * @returns A `Promise` that will be resolved with the results of the query.
311
- */
312
- export declare function getDocsFromServer<AppModelType, DbModelType extends DocumentData>(
313
- query: Query<AppModelType, DbModelType>,
314
- ): Promise<QuerySnapshot<AppModelType, DbModelType>>;
315
-
316
- /**
317
- * Deletes the document referred to by the specified `DocumentReference`.
318
- *
319
- * @param reference - A reference to the document to delete.
320
- * @returns A Promise resolved once the document has been successfully
321
- * deleted from the backend (note that it won't resolve while you're offline).
322
- */
323
- export declare function deleteDoc<AppModelType, DbModelType extends DocumentData>(
324
- reference: DocumentReference<AppModelType, DbModelType>,
325
- ): Promise<void>;
326
-
327
- /**
328
- * Creates a QueryEndAtConstraint that modifies the result set to end at the provided fields relative to the order of the query.
329
- * The order of the field values must match the order of the order by clauses of the query.
330
- *
331
- * @param fieldValues
332
- */
333
- export declare function endAt(...fieldValues: unknown[]): QueryEndAtConstraint;
334
-
335
- /**
336
- * reates a QueryEndAtConstraint that modifies the result set to end at the provided document (inclusive).
337
- * The end position is relative to the order of the query. The document must contain all of the fields provided in the orderBy of the query.
338
- * @param snapshot
339
- */
340
- export function endAt<AppModelType, DbModelType extends DocumentData>(
341
- snapshot: DocumentSnapshot<AppModelType, DbModelType>,
342
- ): QueryEndAtConstraint;
343
-
344
- /**
345
- * Creates a QueryEndAtConstraint that modifies the result set to end before the provided fields relative to the order of the query.
346
- * The order of the field values must match the order of the order by clauses of the query.
347
- *
348
- * @param fieldValues
349
- */
350
- export declare function endBefore(...fieldValues: unknown[]): QueryEndAtConstraint;
351
-
352
- /**
353
- * Creates a new `QueryConstraint` that is limited to return only the last
354
- * specified number of children.
355
- *
356
- * The `limitToLast()` method is used to set a maximum number of children to be
357
- * synced for a given callback. If we set a limit of 100, we will initially only
358
- * receive up to 100 `child_added` events. If we have fewer than 100 messages
359
- * stored in our Database, a `child_added` event will fire for each message.
360
- * However, if we have over 100 messages, we will only receive a `child_added`
361
- * event for the last 100 ordered messages. As items change, we will receive
362
- * `child_removed` events for each item that drops out of the active list so
363
- * that the total number stays at 100.
364
- *
365
- * You can read more about `limitToLast()` in
366
- * {@link https://firebase.google.com/docs/database/web/lists-of-data#filtering_data | Filtering data}.
367
- *
368
- * @param limit - The maximum number of nodes to include in this query.
369
- */
370
- export function limitToLast(limit: number): QueryConstraint;
@@ -1,233 +0,0 @@
1
- /**
2
- * @typedef {import('..').FirebaseFirestoreTypes.DocumentReference} DocumentReference
3
- * @typedef {import('..').FirebaseFirestoreTypes.DocumentSnapshot} DocumentSnapshot
4
- * @typedef {import('..').FirebaseFirestoreTypes.FieldPath} FieldPath
5
- * @typedef {import('..').FirebaseFirestoreTypes.QueryCompositeFilterConstraint} QueryCompositeFilterConstraint
6
- * @typedef {import('..').FirebaseFirestoreTypes.QuerySnapshot} QuerySnapshot
7
- * @typedef {import('..').FirebaseFirestoreTypes.Query} Query
8
- * @typedef {import('..').FirebaseFirestoreTypes.WhereFilterOp} WhereFilterOp
9
- * @typedef {import('../FirestoreFilter')._Filter} _Filter
10
- * @typedef {import('./query').IQueryConstraint} IQueryConstraint
11
- * @typedef {import('./query').OrderByDirection} OrderByDirection
12
- * @typedef {import('./query').QueryFieldFilterConstraint} QueryFieldFilterConstraint
13
- * @typedef {import('./query').QueryLimitConstraint} QueryLimitConstraint
14
- * @typedef {import('./query').QueryNonFilterConstraint} QueryNonFilterConstraint
15
- * @typedef {import('./query').QueryOrderByConstraint} QueryOrderByConstraint
16
- * @typedef {import('./query').QueryStartAtConstraint} QueryStartAtConstraint
17
- */
18
- import { MODULAR_DEPRECATION_ARG } from '@react-native-firebase/app/dist/module/common';
19
- import { _Filter, Filter } from '../FirestoreFilter';
20
-
21
- /**
22
- * @implements {IQueryConstraint}
23
- */
24
- class QueryConstraint {
25
- constructor(type, ...args) {
26
- this.type = type;
27
- this._args = args;
28
- }
29
-
30
- _apply(query) {
31
- return query[this.type].call(query, ...this._args, MODULAR_DEPRECATION_ARG);
32
- }
33
- }
34
-
35
- /**
36
- * @param {Query} query
37
- * @param {QueryCompositeFilterConstraint | QueryConstraint | undefined} queryConstraint
38
- * @param {(QueryConstraint | QueryNonFilterConstraint)[]} additionalQueryConstraints
39
- * @returns {Query}
40
- */
41
- export function query(query, queryConstraint, ...additionalQueryConstraints) {
42
- const queryConstraints = [queryConstraint, ...additionalQueryConstraints].filter(
43
- constraint => constraint !== undefined,
44
- );
45
- let q = query;
46
- for (const queryConstraint of queryConstraints) {
47
- q = queryConstraint._apply(q);
48
- }
49
- return q;
50
- }
51
-
52
- /**
53
- * @param {string | FieldPath} fieldPath
54
- * @param {WhereFilterOp} opStr
55
- * @param {unknown} value
56
- * @returns {QueryFieldFilterConstraint}
57
- */
58
- export function where(fieldPath, opStr, value) {
59
- return new QueryConstraint('where', fieldPath, opStr, value);
60
- }
61
-
62
- /**
63
- * @param {QueryFieldFilterConstraint[]} queries
64
- * @returns {_Filter[]}
65
- */
66
- function getFilterOps(queries) {
67
- const ops = [];
68
- for (const query of queries) {
69
- if (query.type !== 'where') {
70
- throw 'Not where'; // FIXME: Better error message
71
- }
72
-
73
- const args = query._args;
74
- if (!args.length) {
75
- throw 'No args'; // FIXME: Better error message
76
- }
77
-
78
- if (args[0] instanceof _Filter) {
79
- ops.push(args[0]);
80
- continue;
81
- }
82
-
83
- const [fieldPath, opStr, value] = args;
84
- ops.push(Filter(fieldPath, opStr, value));
85
- }
86
- return ops;
87
- }
88
-
89
- /**
90
- * @param {QueryFieldFilterConstraint[]} queries
91
- * @returns {QueryCompositeFilterConstraint}
92
- */
93
- export function or(...queries) {
94
- const ops = getFilterOps(queries);
95
- return new QueryConstraint('where', Filter.or(...ops));
96
- }
97
-
98
- /**
99
- * @param {QueryFieldFilterConstraint[]} queries
100
- * @returns {QueryCompositeFilterConstraint}
101
- */
102
- export function and(...queries) {
103
- const ops = getFilterOps(queries);
104
- return new QueryConstraint('where', Filter.and(...ops));
105
- }
106
-
107
- /**
108
- * @param {string | FieldPath} fieldPath
109
- * @param {OrderByDirection} directionStr
110
- * @returns {QueryOrderByConstraint}
111
- */
112
- export function orderBy(fieldPath, directionStr) {
113
- return new QueryConstraint('orderBy', fieldPath, directionStr);
114
- }
115
-
116
- /**
117
- * @param {(unknown | DocumentSnapshot)} docOrFields
118
- * @returns {QueryStartAtConstraint}
119
- */
120
- export function startAt(...docOrFields) {
121
- return new QueryConstraint('startAt', ...docOrFields);
122
- }
123
-
124
- /**
125
- * @param {(unknown | DocumentSnapshot)} docOrFields
126
- * @returns {QueryStartAtConstraint}
127
- */
128
- export function startAfter(...docOrFields) {
129
- return new QueryConstraint('startAfter', ...docOrFields);
130
- }
131
-
132
- /**
133
- * Creates a QueryEndAtConstraint that modifies the result set to end at the provided fields relative to the order of the query.
134
- * The order of the field values must match the order of the order by clauses of the query.
135
- *
136
- * @param {*} ...args Can be either a DocumentSnapshot or an array of field values.
137
- */
138
-
139
- export function endAt(...args) {
140
- return new QueryConstraint('endAt', ...args);
141
- }
142
-
143
- /**
144
- * Creates a QueryEndAtConstraint that modifies the result set to end before the provided fields relative to the order of the query.
145
- * The order of the field values must match the order of the order by clauses of the query.
146
- *
147
- * @param {*} fieldValues
148
- */
149
-
150
- export function endBefore(...fieldValues) {
151
- return new QueryConstraint('endBefore', ...fieldValues);
152
- }
153
-
154
- /**
155
- * @param {number} limit
156
- * @returns {QueryLimitConstraint}
157
- */
158
- export function limit(limit) {
159
- return new QueryConstraint('limit', limit);
160
- }
161
-
162
- /**
163
- * @param {number} limit
164
- * @returns {QueryConstraint}
165
- */
166
- export function limitToLast(limit) {
167
- return new QueryConstraint('limitToLast', limit);
168
- }
169
-
170
- /**
171
- * @param {DocumentReference} query
172
- * @returns {Promise<DocumentSnapshot>}
173
- */
174
- export function getDoc(reference) {
175
- return reference.get.call(reference, { source: 'default' }, MODULAR_DEPRECATION_ARG);
176
- }
177
-
178
- /**
179
- * @param {DocumentReference} query
180
- * @returns {Promise<DocumentSnapshot>}
181
- */
182
- export function getDocFromCache(reference) {
183
- return reference.get.call(reference, { source: 'cache' }, MODULAR_DEPRECATION_ARG);
184
- }
185
-
186
- /**
187
- * @param {DocumentReference} query
188
- * @returns {Promise<DocumentSnapshot>}
189
- */
190
- export function getDocFromServer(reference) {
191
- return reference.get.call(reference, { source: 'server' }, MODULAR_DEPRECATION_ARG);
192
- }
193
-
194
- /**
195
- * @param {Query} query
196
- * @returns {Promise<QuerySnapshot>}
197
- */
198
- export function getDocs(query) {
199
- return query.get.call(query, { source: 'default' }, MODULAR_DEPRECATION_ARG);
200
- }
201
-
202
- /**
203
- * @param {Query} query
204
- * @returns {Promise<QuerySnapshot>}
205
- */
206
- export function getDocsFromCache(query) {
207
- return query.get.call(query, { source: 'cache' }, MODULAR_DEPRECATION_ARG);
208
- }
209
-
210
- /**
211
- * @param {Query} query
212
- * @returns {Promise<QuerySnapshot>}
213
- */
214
- export function getDocsFromServer(query) {
215
- return query.get.call(query, { source: 'server' }, MODULAR_DEPRECATION_ARG);
216
- }
217
-
218
- /**
219
- * @param {DocumentReference} reference
220
- * @returns {Promise<void>}
221
- */
222
- export function deleteDoc(reference) {
223
- return reference.delete.call(reference, MODULAR_DEPRECATION_ARG);
224
- }
225
-
226
- /**
227
- * @param {Query} left
228
- * @param {Query} right
229
- * @returns boolean true if left equals right
230
- */
231
- export function queryEqual(left, right) {
232
- return left.isEqual.call(left, right, MODULAR_DEPRECATION_ARG);
233
- }