@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,19 +1,23 @@
1
- import {
2
- DocumentReference,
3
- Timestamp,
4
- GeoPoint,
5
- Bytes,
6
- doc,
7
- documentId,
8
- serverTimestamp,
9
- increment,
10
- deleteField,
11
- arrayUnion,
12
- arrayRemove,
13
- vector,
14
- VectorValue,
15
- } from '@react-native-firebase/app/dist/module/internal/web/firebaseFirestore';
16
-
1
+ "use strict";
2
+
3
+ /*
4
+ * Copyright (c) 2016-present Invertase Limited & Contributors
5
+ *
6
+ * Licensed under the Apache License, Version 2.0 (the "License");
7
+ * you may not use this library except in compliance with the License.
8
+ * You may obtain a copy of the License at
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing, software
13
+ * distributed under the License is distributed on an "AS IS" BASIS,
14
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ * See the License for the specific language governing permissions and
16
+ * limitations under the License.
17
+ *
18
+ */
19
+
20
+ import { DocumentReference, Timestamp, GeoPoint, Bytes, doc, documentId, serverTimestamp, increment, deleteField, arrayUnion, arrayRemove, vector, VectorValue } from '@react-native-firebase/app/dist/module/internal/web/firebaseFirestore';
17
21
  const INT_NAN = 0;
18
22
  const INT_NEGATIVE_INFINITY = 1;
19
23
  const INT_POSITIVE_INFINITY = 2;
@@ -35,13 +39,10 @@ const INT_INTEGER = 17;
35
39
  const INT_NEGATIVE_ZERO = 18;
36
40
  const INT_VECTOR = 19;
37
41
  const INT_UNKNOWN = -999;
38
-
39
42
  const TYPE = 'type';
40
43
  const KEY_PATH = 'path';
41
44
  const KEY_DATA = 'data';
42
45
  const KEY_OPTIONS = 'options';
43
-
44
- // Converts an object to a writeable object.
45
46
  export function objectToWriteable(object) {
46
47
  const out = {};
47
48
  for (const [key, value] of Object.entries(object)) {
@@ -49,95 +50,68 @@ export function objectToWriteable(object) {
49
50
  }
50
51
  return out;
51
52
  }
52
-
53
- // Converts an array of values to a writeable array.
54
53
  export function arrayToWriteable(array) {
55
54
  return array.map(buildTypeMap);
56
55
  }
57
-
58
- // Converts a readable object into a plain js object.
59
56
  export function readableToObject(firestore, readableMap) {
60
57
  const out = {};
61
-
62
58
  for (const [key, value] of Object.entries(readableMap)) {
63
59
  out[key] = parseTypeMap(firestore, value);
64
60
  }
65
-
66
61
  return out;
67
62
  }
68
-
69
- // Converts a readable array into a plain js array.
70
63
  export function readableToArray(firestore, readableArray) {
71
64
  return readableArray.map(value => parseTypeMap(firestore, value));
72
65
  }
73
-
74
- // Converts a readable array of document batch data into a plain js array.
75
66
  export function parseDocumentBatches(firestore, readableArray) {
76
67
  const out = [];
77
-
78
68
  for (const map of readableArray) {
79
69
  const write = {
80
70
  [TYPE]: map[TYPE],
81
- [KEY_PATH]: map[KEY_PATH],
71
+ [KEY_PATH]: map[KEY_PATH]
82
72
  };
83
-
84
73
  if (KEY_DATA in map) {
85
- write[KEY_DATA] = readableToObject(firestore, map[KEY_DATA]);
74
+ write.data = readableToObject(firestore, map[KEY_DATA]);
86
75
  }
87
-
88
76
  if (KEY_OPTIONS in map) {
89
- write[KEY_OPTIONS] = map[KEY_OPTIONS];
77
+ write.options = map[KEY_OPTIONS];
90
78
  }
91
-
92
79
  out.push(write);
93
80
  }
94
-
95
81
  return out;
96
82
  }
97
-
98
- // Returns a typed array of a value.
99
- export function buildTypeMap(value) {
83
+ function buildTypeMap(value) {
100
84
  const out = [];
101
85
  if (value === null) {
102
86
  out.push(INT_NULL);
103
87
  return out;
104
88
  }
105
-
106
89
  if (typeof value === 'boolean') {
107
- if (value) out.push(INT_BOOLEAN_TRUE);
108
- else out.push(INT_BOOLEAN_FALSE);
90
+ out.push(value ? INT_BOOLEAN_TRUE : INT_BOOLEAN_FALSE);
109
91
  return out;
110
92
  }
111
-
112
- // Double
113
93
  if (typeof value === 'number' && !Number.isInteger(value)) {
114
94
  out.push(INT_DOUBLE);
115
95
  out.push(value);
116
96
  return out;
117
97
  }
118
-
119
- // Integer
120
98
  if (typeof value === 'number' && Number.isInteger(value)) {
121
- if (value == Number.NEGATIVE_INFINITY) {
99
+ if (value === Number.NEGATIVE_INFINITY) {
122
100
  out.push(INT_NEGATIVE_INFINITY);
123
101
  return out;
124
102
  }
125
-
126
- if (value == Number.POSITIVE_INFINITY) {
103
+ if (value === Number.POSITIVE_INFINITY) {
127
104
  out.push(INT_POSITIVE_INFINITY);
128
105
  return out;
129
106
  }
130
-
131
- if (isNaN(value)) {
107
+ if (Number.isNaN(value)) {
132
108
  out.push(INT_NAN);
133
109
  return out;
134
110
  }
135
-
136
111
  out.push(INT_DOUBLE);
137
112
  out.push(value);
138
113
  return out;
139
114
  }
140
-
141
115
  if (typeof value === 'string') {
142
116
  if (value === '') {
143
117
  out.push(INT_STRING_EMPTY);
@@ -147,57 +121,46 @@ export function buildTypeMap(value) {
147
121
  }
148
122
  return out;
149
123
  }
150
-
151
124
  if (Array.isArray(value)) {
152
125
  out.push(INT_ARRAY);
153
126
  out.push(arrayToWriteable(value));
154
127
  return out;
155
128
  }
156
-
157
129
  if (value instanceof DocumentReference) {
158
130
  out.push(INT_REFERENCE);
159
131
  out.push(value.path);
160
132
  return out;
161
133
  }
162
-
163
134
  if (value instanceof Timestamp) {
164
135
  out.push(INT_TIMESTAMP);
165
136
  out.push([value.seconds, value.nanoseconds]);
166
137
  return out;
167
138
  }
168
-
169
139
  if (value instanceof GeoPoint) {
170
140
  out.push(INT_GEOPOINT);
171
141
  out.push([value.latitude, value.longitude]);
172
142
  return out;
173
143
  }
174
-
175
144
  if (value instanceof Bytes) {
176
145
  out.push(INT_BLOB);
177
146
  out.push(value.toBase64());
178
147
  return out;
179
148
  }
180
-
181
149
  if (value instanceof VectorValue) {
182
150
  out.push(INT_VECTOR);
183
151
  out.push(value.toArray());
184
152
  return out;
185
153
  }
186
-
187
154
  if (typeof value === 'object') {
188
155
  out.push(INT_OBJECT);
189
156
  out.push(objectToWriteable(value));
190
157
  return out;
191
158
  }
192
-
193
159
  out.push(INT_UNKNOWN);
194
160
  return out;
195
161
  }
196
-
197
- // Parses a typed array into a value.
198
162
  export function parseTypeMap(firestore, typedArray) {
199
163
  const value = typedArray[0];
200
-
201
164
  switch (value) {
202
165
  case INT_NAN:
203
166
  return NaN;
@@ -224,44 +187,46 @@ export function parseTypeMap(firestore, typedArray) {
224
187
  case INT_STRING_EMPTY:
225
188
  return '';
226
189
  case INT_ARRAY:
227
- return readableToArray(firestore, typedArray[1]);
190
+ return readableToArray(firestore, typedArray[1] ?? []);
228
191
  case INT_REFERENCE:
229
192
  return doc(firestore, typedArray[1]);
230
193
  case INT_GEOPOINT:
231
- const [latitude, longitude] = typedArray[1];
232
- return new GeoPoint(latitude, longitude);
194
+ {
195
+ const v = typedArray[1] ?? [];
196
+ return new GeoPoint(v[0] ?? 0, v[1] ?? 0);
197
+ }
233
198
  case INT_TIMESTAMP:
234
- const [seconds, nanoseconds] = typedArray[1];
235
- return new Timestamp(seconds, nanoseconds);
199
+ {
200
+ const v = typedArray[1] ?? [];
201
+ return new Timestamp(v[0] ?? 0, v[1] ?? 0);
202
+ }
236
203
  case INT_BLOB:
237
204
  return Bytes.fromBase64String(typedArray[1]);
238
205
  case INT_FIELDVALUE:
239
- const fieldValueArray = typedArray[1];
240
- const fieldValueType = fieldValueArray[0];
241
-
242
- if (fieldValueType === 'timestamp') {
243
- return serverTimestamp();
244
- }
245
-
246
- if (fieldValueType === 'increment') {
247
- return increment(fieldValueArray[1]);
248
- }
249
-
250
- if (fieldValueType === 'delete') {
251
- return deleteField();
252
- }
253
-
254
- if (fieldValueType === 'array_union') {
255
- const elements = readableToArray(firestore, fieldValueArray[1]);
256
- return arrayUnion(...elements);
257
- }
258
-
259
- if (fieldValueType === 'array_remove') {
260
- const elements = readableToArray(firestore, fieldValueArray[1]);
261
- return arrayRemove(...elements);
206
+ {
207
+ const fieldValueArray = typedArray[1] ?? [];
208
+ const fieldValueType = fieldValueArray[0];
209
+ if (fieldValueType === 'timestamp') {
210
+ return serverTimestamp();
211
+ }
212
+ if (fieldValueType === 'increment') {
213
+ return increment(fieldValueArray[1]);
214
+ }
215
+ if (fieldValueType === 'delete') {
216
+ return deleteField();
217
+ }
218
+ if (fieldValueType === 'array_union') {
219
+ const elements = readableToArray(firestore, fieldValueArray[1] ?? []);
220
+ return arrayUnion(...elements);
221
+ }
222
+ if (fieldValueType === 'array_remove') {
223
+ const elements = readableToArray(firestore, fieldValueArray[1] ?? []);
224
+ return arrayRemove(...elements);
225
+ }
226
+ return null;
262
227
  }
263
228
  case INT_OBJECT:
264
- return readableToObject(firestore, typedArray[1]);
229
+ return readableToObject(firestore, typedArray[1] ?? {});
265
230
  case INT_VECTOR:
266
231
  return vector(typedArray[1]);
267
232
  case INT_UNKNOWN:
@@ -269,3 +234,4 @@ export function parseTypeMap(firestore, typedArray) {
269
234
  return null;
270
235
  }
271
236
  }
237
+ //# sourceMappingURL=convert.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["DocumentReference","Timestamp","GeoPoint","Bytes","doc","documentId","serverTimestamp","increment","deleteField","arrayUnion","arrayRemove","vector","VectorValue","INT_NAN","INT_NEGATIVE_INFINITY","INT_POSITIVE_INFINITY","INT_NULL","INT_DOCUMENTID","INT_BOOLEAN_TRUE","INT_BOOLEAN_FALSE","INT_DOUBLE","INT_STRING","INT_STRING_EMPTY","INT_ARRAY","INT_REFERENCE","INT_GEOPOINT","INT_TIMESTAMP","INT_BLOB","INT_FIELDVALUE","INT_OBJECT","INT_INTEGER","INT_NEGATIVE_ZERO","INT_VECTOR","INT_UNKNOWN","TYPE","KEY_PATH","KEY_DATA","KEY_OPTIONS","objectToWriteable","object","out","key","value","Object","entries","buildTypeMap","arrayToWriteable","array","map","readableToObject","firestore","readableMap","parseTypeMap","readableToArray","readableArray","parseDocumentBatches","write","data","options","push","Number","isInteger","NEGATIVE_INFINITY","POSITIVE_INFINITY","isNaN","Array","isArray","path","seconds","nanoseconds","latitude","longitude","toBase64","toArray","typedArray","NaN","String","v","fromBase64String","fieldValueArray","fieldValueType","elements"],"sourceRoot":"../../../lib","sources":["web/convert.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SACEA,iBAAiB,EACjBC,SAAS,EACTC,QAAQ,EACRC,KAAK,EACLC,GAAG,EACHC,UAAU,EACVC,eAAe,EACfC,SAAS,EACTC,WAAW,EACXC,UAAU,EACVC,WAAW,EACXC,MAAM,EACNC,WAAW,QACN,uEAAuE;AAG9E,MAAMC,OAAO,GAAG,CAAC;AACjB,MAAMC,qBAAqB,GAAG,CAAC;AAC/B,MAAMC,qBAAqB,GAAG,CAAC;AAC/B,MAAMC,QAAQ,GAAG,CAAC;AAClB,MAAMC,cAAc,GAAG,CAAC;AACxB,MAAMC,gBAAgB,GAAG,CAAC;AAC1B,MAAMC,iBAAiB,GAAG,CAAC;AAC3B,MAAMC,UAAU,GAAG,CAAC;AACpB,MAAMC,UAAU,GAAG,CAAC;AACpB,MAAMC,gBAAgB,GAAG,CAAC;AAC1B,MAAMC,SAAS,GAAG,EAAE;AACpB,MAAMC,aAAa,GAAG,EAAE;AACxB,MAAMC,YAAY,GAAG,EAAE;AACvB,MAAMC,aAAa,GAAG,EAAE;AACxB,MAAMC,QAAQ,GAAG,EAAE;AACnB,MAAMC,cAAc,GAAG,EAAE;AACzB,MAAMC,UAAU,GAAG,EAAE;AACrB,MAAMC,WAAW,GAAG,EAAE;AACtB,MAAMC,iBAAiB,GAAG,EA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C,cAAc,KAAK,WAAW,EAAE;UAClC,OAAO1E,eAAe,CAAC,CAAC;QAC1B;QACA,IAAI0E,cAAc,KAAK,WAAW,EAAE;UAClC,OAAOzE,SAAS,CAACwE,eAAe,CAAC,CAAC,CAAW,CAAC;QAChD;QACA,IAAIC,cAAc,KAAK,QAAQ,EAAE;UAC/B,OAAOxE,WAAW,CAAC,CAAC;QACtB;QACA,IAAIwE,cAAc,KAAK,aAAa,EAAE;UACpC,MAAMC,QAAQ,GAAG5B,eAAe,CAACH,SAAS,EAAG6B,eAAe,CAAC,CAAC,CAAC,IAAI,EAAgB,CAAC;UACpF,OAAOtE,UAAU,CAAC,GAAGwE,QAAQ,CAAC;QAChC;QACA,IAAID,cAAc,KAAK,cAAc,EAAE;UACrC,MAAMC,QAAQ,GAAG5B,eAAe,CAACH,SAAS,EAAG6B,eAAe,CAAC,CAAC,CAAC,IAAI,EAAgB,CAAC;UACpF,OAAOrE,WAAW,CAAC,GAAGuE,QAAQ,CAAC;QACjC;QACA,OAAO,IAAI;MACb;IACA,KAAKpD,UAAU;MACb,OAAOoB,gBAAgB,CAACC,SAAS,EAAGwB,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,CAA6B,CAAC;IACtF,KAAK1C,UAAU;MACb,OAAOrB,MAAM,CAAC+D,UAAU,CAAC,CAAC,CAAa,CAAC;IAC1C,KAAKzC,WAAW;IAChB;MACE,OAAO,IAAI;EACf;AACF","ignoreList":[]}
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+
3
+ /*
4
+ * Copyright (c) 2016-present Invertase Limited & Contributors
5
+ *
6
+ * Licensed under the Apache License, Version 2.0 (the "License");
7
+ * you may not use this library except in compliance with the License.
8
+ * You may obtain a copy of the License at
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing, software
13
+ * distributed under the License is distributed on an "AS IS" BASIS,
14
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ * See the License for the specific language governing permissions and
16
+ * limitations under the License.
17
+ *
18
+ */
19
+
20
+ import { execute } from '@react-native-firebase/app/dist/module/internal/web/firebaseFirestorePipelines';
21
+ import { validatePipelineExecuteRequest } from "../../pipelines/pipeline_validate.js";
22
+ import { buildWebSdkPipeline } from "./pipeline_bridge_factory.js";
23
+ import { serializeWebSdkPipelineSnapshot } from "./pipeline_snapshot_serializer.js";
24
+ async function executeWebSdkPipelineSnapshot(webSdkPipeline, _options) {
25
+ // The current web SDK execute() surface only accepts the pipeline instance.
26
+ return execute(webSdkPipeline);
27
+ }
28
+ export async function executeWebSdkPipeline(firestore, pipeline, options) {
29
+ const request = validatePipelineExecuteRequest(pipeline, options);
30
+ const webSdkPipeline = buildWebSdkPipeline(firestore, request);
31
+ const rawSnapshot = await executeWebSdkPipelineSnapshot(webSdkPipeline, request.options);
32
+ return serializeWebSdkPipelineSnapshot(rawSnapshot, request);
33
+ }
34
+ //# sourceMappingURL=pipeline.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["execute","validatePipelineExecuteRequest","buildWebSdkPipeline","serializeWebSdkPipelineSnapshot","executeWebSdkPipelineSnapshot","webSdkPipeline","_options","executeWebSdkPipeline","firestore","pipeline","options","request","rawSnapshot"],"sourceRoot":"../../../../lib","sources":["web/pipelines/pipeline.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,OAAO,QAAQ,gFAAgF;AAOxG,SAASC,8BAA8B,QAAQ,sCAAmC;AAClF,SAASC,mBAAmB,QAAQ,8BAA2B;AAE/D,SAASC,+BAA+B,QAAQ,mCAAgC;AAEhF,eAAeC,6BAA6BA,CAC1CC,cAAmC,EACnCC,QAAkD,EAChC;EAClB;EACA,OAAON,OAAO,CAACK,cAAc,CAAC;AAChC;AAEA,OAAO,eAAeE,qBAAqBA,CACzCC,SAAoB,EACpBC,QAA6C,EAC7CC,OAAiD,EACL;EAC5C,MAAMC,OAAO,GAAGV,8BAA8B,CAACQ,QAAQ,EAAEC,OAAO,CAAC;EACjE,MAAML,cAAc,GAAGH,mBAAmB,CAACM,SAAS,EAAEG,OAAO,CAAC;EAC9D,MAAMC,WAAW,GAAG,MAAMR,6BAA6B,CAACC,cAAc,EAAEM,OAAO,CAACD,OAAO,CAAC;EACxF,OAAOP,+BAA+B,CAACS,WAAW,EAAED,OAAO,CAAC;AAC9D","ignoreList":[]}
@@ -0,0 +1,217 @@
1
+ "use strict";
2
+
3
+ /*
4
+ * Copyright (c) 2016-present Invertase Limited & Contributors
5
+ *
6
+ * Licensed under the Apache License, Version 2.0 (the "License");
7
+ * you may not use this library except in compliance with the License.
8
+ * You may obtain a copy of the License at
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing, software
13
+ * distributed under the License is distributed on an "AS IS" BASIS,
14
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ * See the License for the specific language governing permissions and
16
+ * limitations under the License.
17
+ *
18
+ */
19
+
20
+ import { collection, collectionGroup } from '@react-native-firebase/app/dist/module/internal/web/firebaseFirestore';
21
+ import { revivePipelineValue } from "./pipeline_node_builder.js";
22
+ import { buildQuery } from "../query.js";
23
+ const PIPELINE_RUNTIME_IMPORT_SUFFIX = ' Import "@react-native-firebase/firestore/pipelines" before using pipelines so the pipeline runtime is installed.';
24
+ function createPipelineRuntimeImportError(message) {
25
+ return new Error(message + PIPELINE_RUNTIME_IMPORT_SUFFIX);
26
+ }
27
+ function isRecord(value) {
28
+ return value !== null && typeof value === 'object' && !Array.isArray(value);
29
+ }
30
+ function buildCollectionSourcePipeline(pipelineSource, source) {
31
+ if (typeof pipelineSource.collection !== 'function') {
32
+ return undefined;
33
+ }
34
+ return pipelineSource.collection({
35
+ collection: source.path,
36
+ ...(isRecord(source.rawOptions) && source.rawOptions ? {
37
+ rawOptions: source.rawOptions
38
+ } : {})
39
+ });
40
+ }
41
+ function buildCollectionGroupSourcePipeline(pipelineSource, source) {
42
+ if (typeof pipelineSource.collectionGroup !== 'function') {
43
+ return undefined;
44
+ }
45
+ return pipelineSource.collectionGroup({
46
+ collectionId: source.collectionId,
47
+ ...(isRecord(source.rawOptions) && source.rawOptions ? {
48
+ rawOptions: source.rawOptions
49
+ } : {})
50
+ });
51
+ }
52
+ function buildDatabaseSourcePipeline(pipelineSource, source) {
53
+ if (typeof pipelineSource.database !== 'function') {
54
+ return undefined;
55
+ }
56
+ return pipelineSource.database(isRecord(source.rawOptions) && source.rawOptions ? {
57
+ rawOptions: source.rawOptions
58
+ } : {});
59
+ }
60
+ function buildDocumentsSourcePipeline(pipelineSource, source) {
61
+ if (typeof pipelineSource.documents !== 'function') {
62
+ return undefined;
63
+ }
64
+ return pipelineSource.documents({
65
+ docs: source.documents,
66
+ ...(isRecord(source.rawOptions) && source.rawOptions ? {
67
+ rawOptions: source.rawOptions
68
+ } : {})
69
+ });
70
+ }
71
+ function buildQuerySourcePipeline(firestore, pipelineSource, source) {
72
+ if (typeof pipelineSource.createFrom !== 'function') {
73
+ throw createPipelineRuntimeImportError('pipelineExecute() expected pipeline source to support createFrom(query).');
74
+ }
75
+ const queryRef = source.queryType === 'collectionGroup' ? collectionGroup(firestore, source.path) : collection(firestore, source.path);
76
+ const query = buildQuery(queryRef, source.filters, source.orders, source.options);
77
+ return pipelineSource.createFrom(query);
78
+ }
79
+ function getPipelineStageMethod(current, stageName) {
80
+ const method = current?.[stageName];
81
+ if (typeof method !== 'function') {
82
+ throw new Error(`Pipeline stage "${stageName}" is not supported by the current web SDK.`);
83
+ }
84
+ return method;
85
+ }
86
+ function applyPipelineStage(current, stage, nestedUnionPipeline) {
87
+ if (stage.stage === 'union') {
88
+ return getPipelineStageMethod(current, stage.stage).call(current, {
89
+ other: nestedUnionPipeline
90
+ });
91
+ }
92
+ const revivedStageOptions = revivePipelineValue(stage.options);
93
+ const stageArgs = isRecord(revivedStageOptions) ? revivedStageOptions : stage.options;
94
+ const method = getPipelineStageMethod(current, stage.stage);
95
+ switch (stage.stage) {
96
+ case 'where':
97
+ if (isRecord(stageArgs.condition) && typeof stageArgs.condition.operator === 'string') {
98
+ const op = stageArgs.condition.operator.toUpperCase();
99
+ const isArrayOperator = op === 'IN' || op === 'NOT_IN' || op === 'ARRAY_CONTAINS_ANY' || op === 'ARRAY_CONTAINS_ALL';
100
+ if (isArrayOperator && !Array.isArray(stageArgs.condition.value)) {
101
+ throw new Error('invalid argument');
102
+ }
103
+ }
104
+ return stageArgs.condition !== undefined ? method.call(current, stageArgs.condition) : method.call(current, stageArgs);
105
+ case 'select':
106
+ return Array.isArray(stageArgs.selections) ? method.call(current, ...stageArgs.selections) : method.call(current, stageArgs);
107
+ case 'addFields':
108
+ return Array.isArray(stageArgs.fields) ? method.call(current, ...stageArgs.fields) : method.call(current, stageArgs);
109
+ case 'removeFields':
110
+ return Array.isArray(stageArgs.fields) ? method.call(current, ...stageArgs.fields) : method.call(current, stageArgs);
111
+ case 'sort':
112
+ return Array.isArray(stageArgs.orderings) ? method.call(current, ...stageArgs.orderings) : method.call(current, stageArgs);
113
+ case 'limit':
114
+ return typeof stageArgs.limit === 'number' ? method.call(current, stageArgs.limit) : method.call(current, stageArgs);
115
+ case 'offset':
116
+ return typeof stageArgs.offset === 'number' ? method.call(current, stageArgs.offset) : method.call(current, stageArgs);
117
+ case 'distinct':
118
+ return Array.isArray(stageArgs.groups) ? method.call(current, ...stageArgs.groups) : method.call(current, stageArgs);
119
+ case 'aggregate':
120
+ return method.call(current, stageArgs);
121
+ case 'replaceWith':
122
+ return stageArgs.map !== undefined ? method.call(current, stageArgs.map) : method.call(current, stageArgs);
123
+ case 'sample':
124
+ return typeof stageArgs.documents === 'number' ? method.call(current, stageArgs.documents) : method.call(current, stageArgs);
125
+ case 'unnest':
126
+ return stageArgs.selectable !== undefined ? method.call(current, stageArgs.selectable, stageArgs.indexField) : method.call(current, stageArgs);
127
+ case 'rawStage':
128
+ return typeof stageArgs.name === 'string' ? method.call(current, stageArgs.name, stageArgs.params, isRecord(stageArgs.options) ? stageArgs.options : undefined) : method.call(current, stageArgs);
129
+ default:
130
+ return method.call(current, stageArgs);
131
+ }
132
+ }
133
+ function buildSourcePipeline(firestore, pipelineFactory, pipeline) {
134
+ const pipelineSource = pipelineFactory.call(firestore);
135
+ const source = pipeline.source;
136
+ let currentPipeline;
137
+ switch (source.source) {
138
+ case 'collection':
139
+ currentPipeline = buildCollectionSourcePipeline(pipelineSource, source);
140
+ break;
141
+ case 'collectionGroup':
142
+ currentPipeline = buildCollectionGroupSourcePipeline(pipelineSource, source);
143
+ break;
144
+ case 'database':
145
+ currentPipeline = buildDatabaseSourcePipeline(pipelineSource, source);
146
+ break;
147
+ case 'documents':
148
+ currentPipeline = buildDocumentsSourcePipeline(pipelineSource, source);
149
+ break;
150
+ case 'query':
151
+ currentPipeline = buildQuerySourcePipeline(firestore, pipelineSource, source);
152
+ break;
153
+ default:
154
+ throw new Error('pipelineExecute() received an unknown source type.');
155
+ }
156
+ if (!currentPipeline) {
157
+ throw new Error(`pipelineExecute() failed to construct source stage "${String(source.source)}" for web SDK.`);
158
+ }
159
+ return currentPipeline;
160
+ }
161
+ export function buildWebSdkPipeline(firestore, request) {
162
+ const pipelineFactory = firestore.pipeline;
163
+ if (typeof pipelineFactory !== 'function') {
164
+ throw createPipelineRuntimeImportError('pipelineExecute() expected a Firestore instance with pipeline() support.');
165
+ }
166
+ const stack = [{
167
+ kind: 'pipeline',
168
+ pipeline: request.pipeline,
169
+ currentPipeline: buildSourcePipeline(firestore, pipelineFactory, request.pipeline),
170
+ stageIndex: 0
171
+ }];
172
+ let lastCompletedPipeline;
173
+ while (stack.length > 0) {
174
+ const frame = stack[stack.length - 1];
175
+ if (frame.kind === 'union') {
176
+ if (!lastCompletedPipeline) {
177
+ throw new Error('pipelineExecute() failed to rebuild nested union pipeline for web SDK.');
178
+ }
179
+ frame.parent.currentPipeline = frame.method.call(frame.parent.currentPipeline, {
180
+ other: lastCompletedPipeline
181
+ });
182
+ frame.parent.stageIndex += 1;
183
+ lastCompletedPipeline = undefined;
184
+ stack.pop();
185
+ continue;
186
+ }
187
+ if (frame.stageIndex >= frame.pipeline.stages.length) {
188
+ lastCompletedPipeline = frame.currentPipeline;
189
+ stack.pop();
190
+ continue;
191
+ }
192
+ const stage = frame.pipeline.stages[frame.stageIndex];
193
+ if (stage.stage !== 'union') {
194
+ frame.currentPipeline = applyPipelineStage(frame.currentPipeline, stage);
195
+ frame.stageIndex += 1;
196
+ continue;
197
+ }
198
+ const unionPipeline = stage.options.other;
199
+ stack.push({
200
+ kind: 'union',
201
+ parent: frame,
202
+ stage,
203
+ method: getPipelineStageMethod(frame.currentPipeline, stage.stage)
204
+ });
205
+ stack.push({
206
+ kind: 'pipeline',
207
+ pipeline: unionPipeline,
208
+ currentPipeline: buildSourcePipeline(firestore, pipelineFactory, unionPipeline),
209
+ stageIndex: 0
210
+ });
211
+ }
212
+ if (!lastCompletedPipeline) {
213
+ throw new Error('pipelineExecute() failed to rebuild a pipeline for web SDK.');
214
+ }
215
+ return lastCompletedPipeline;
216
+ }
217
+ //# sourceMappingURL=pipeline_bridge_factory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["collection","collectionGroup","revivePipelineValue","buildQuery","PIPELINE_RUNTIME_IMPORT_SUFFIX","createPipelineRuntimeImportError","message","Error","isRecord","value","Array","isArray","buildCollectionSourcePipeline","pipelineSource","source","undefined","path","rawOptions","buildCollectionGroupSourcePipeline","collectionId","buildDatabaseSourcePipeline","database","buildDocumentsSourcePipeline","documents","docs","buildQuerySourcePipeline","firestore","createFrom","queryRef","queryType","query","filters","orders","options","getPipelineStageMethod","current","stageName","method","applyPipelineStage","stage","nestedUnionPipeline","call","other","revivedStageOptions","stageArgs","condition","operator","op","toUpperCase","isArrayOperator","selections","fields","orderings","limit","offset","groups","map","selectable","indexField","name","params","buildSourcePipeline","pipelineFactory","pipeline","currentPipeline","String","buildWebSdkPipeline","request","stack","kind","stageIndex","lastCompletedPipeline","length","frame","parent","pop","stages","unionPipeline","push"],"sourceRoot":"../../../../lib","sources":["web/pipelines/pipeline_bridge_factory.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SACEA,UAAU,EACVC,eAAe,QACV,uEAAuE;AAM9E,SACEC,mBAAmB,QAGd,4BAAyB;AAEhC,SAASC,UAAU,QAAQ,aAAU;AAGrC,MAAMC,8BAA8B,GAClC,mHAAmH;AAErH,SAASC,gCAAgCA,CAACC,OAAe,EAAS;EAChE,OAAO,IAAIC,KAAK,CAACD,OAAO,GAAGF,8BAA8B,CAAC;AAC5D;AAEA,SAASI,QAAQA,CAACC,KAAc,EAAoC;EAClE,OAAOA,KAAK,KAAK,IAAI,IAAI,OAAOA,KAAK,KAAK,QAAQ,IAAI,CAACC,KAAK,CAACC,OAAO,CAACF,KAAK,CAAC;AAC7E;AAEA,SAASG,6BAA6BA,CACpCC,cAAiC,EACjCC,MAAwF,EACvD;EACjC,IAAI,OAAOD,cAAc,CAACb,UAAU,KAAK,UAAU,EAAE;IACnD,OAAOe,SAAS;EAClB;EAEA,OAAOF,cAAc,CAACb,UAAU,CAAC;IAC/BA,UAAU,EAAEc,MAAM,CAACE,IAAI;IACvB,IAAIR,QAAQ,CAACM,MAAM,CAACG,UAAU,CAAC,IAAIH,MAAM,CAACG,UAAU,GAAG;MAAEA,UAAU,EAAEH,MAAM,CAACG;IAAW,CAAC,GAAG,CAAC,CAAC;EAC/F,CAAC,CAAC;AACJ;AAEA,SAASC,kCAAkCA,CACzCL,cAAiC,EACjCC,MAA6F,EAC5D;EACjC,IAAI,OAAOD,cAAc,CAACZ,eAAe,KAAK,UAAU,EAAE;IACxD,OAAOc,SAAS;EAClB;EAEA,OAAOF,cAAc,CAACZ,eAAe,CAAC;IACpCkB,YAAY,EAAEL,MAAM,CAACK,YAAY;I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