@react-native-firebase/firestore 23.8.6 → 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.
- package/CHANGELOG.md +35 -0
- package/RNFBFirestore.podspec +2 -1
- package/android/src/reactnative/java/io/invertase/firebase/firestore/ReactNativeFirebaseFirestoreCollectionModule.java +17 -4
- package/android/src/reactnative/java/io/invertase/firebase/firestore/ReactNativeFirebaseFirestoreDocumentModule.java +2 -2
- package/android/src/reactnative/java/io/invertase/firebase/firestore/ReactNativeFirebaseFirestorePipelineExecutor.java +1243 -0
- package/android/src/reactnative/java/io/invertase/firebase/firestore/ReactNativeFirebaseFirestorePipelineNodeBuilder.java +3919 -0
- package/android/src/reactnative/java/io/invertase/firebase/firestore/ReactNativeFirebaseFirestorePipelineParser.java +1735 -0
- package/android/src/reactnative/java/io/invertase/firebase/firestore/ReactNativeFirebaseFirestoreSerialize.java +1 -1
- package/dist/module/FieldPath.js +59 -0
- package/dist/module/FieldPath.js.map +1 -0
- package/dist/module/FieldValue.js +82 -0
- package/dist/module/FieldValue.js.map +1 -0
- package/{lib → dist/module}/FirestoreAggregate.js +31 -43
- package/dist/module/FirestoreAggregate.js.map +1 -0
- package/dist/module/FirestoreBlob.js +56 -0
- package/dist/module/FirestoreBlob.js.map +1 -0
- package/dist/module/FirestoreCollectionReference.js +70 -0
- package/dist/module/FirestoreCollectionReference.js.map +1 -0
- package/{lib → dist/module}/FirestoreDocumentChange.js +12 -15
- package/dist/module/FirestoreDocumentChange.js.map +1 -0
- package/dist/module/FirestoreDocumentReference.js +170 -0
- package/dist/module/FirestoreDocumentReference.js.map +1 -0
- package/dist/module/FirestoreDocumentSnapshot.js +88 -0
- package/dist/module/FirestoreDocumentSnapshot.js.map +1 -0
- package/dist/module/FirestoreFilter.js +146 -0
- package/dist/module/FirestoreFilter.js.map +1 -0
- package/dist/module/FirestoreGeoPoint.js +80 -0
- package/dist/module/FirestoreGeoPoint.js.map +1 -0
- package/{lib → dist/module}/FirestorePath.js +5 -12
- package/dist/module/FirestorePath.js.map +1 -0
- package/{lib → dist/module}/FirestorePersistentCacheIndexManager.js +11 -4
- package/dist/module/FirestorePersistentCacheIndexManager.js.map +1 -0
- package/dist/module/FirestoreQuery.js +298 -0
- package/dist/module/FirestoreQuery.js.map +1 -0
- package/{lib → dist/module}/FirestoreQueryModifiers.js +25 -136
- package/dist/module/FirestoreQueryModifiers.js.map +1 -0
- package/dist/module/FirestoreQuerySnapshot.js +98 -0
- package/dist/module/FirestoreQuerySnapshot.js.map +1 -0
- package/dist/module/FirestoreSnapshotMetadata.js +38 -0
- package/dist/module/FirestoreSnapshotMetadata.js.map +1 -0
- package/dist/module/FirestoreStatics.js +50 -0
- package/dist/module/FirestoreStatics.js.map +1 -0
- package/{lib → dist/module}/FirestoreTimestamp.js +39 -39
- package/dist/module/FirestoreTimestamp.js.map +1 -0
- package/dist/module/FirestoreTransaction.js +113 -0
- package/dist/module/FirestoreTransaction.js.map +1 -0
- package/dist/module/FirestoreTransactionHandler.js +137 -0
- package/dist/module/FirestoreTransactionHandler.js.map +1 -0
- package/dist/module/FirestoreVectorValue.js +75 -0
- package/dist/module/FirestoreVectorValue.js.map +1 -0
- package/dist/module/FirestoreWriteBatch.js +113 -0
- package/dist/module/FirestoreWriteBatch.js.map +1 -0
- package/dist/module/LoadBundleTask.js +70 -0
- package/dist/module/LoadBundleTask.js.map +1 -0
- package/dist/module/index.js +31 -0
- package/dist/module/index.js.map +1 -0
- package/dist/module/modular/Bytes.js +67 -0
- package/dist/module/modular/Bytes.js.map +1 -0
- package/dist/module/modular/FieldPath.js +25 -0
- package/dist/module/modular/FieldPath.js.map +1 -0
- package/dist/module/modular/FieldValue.js +37 -0
- package/dist/module/modular/FieldValue.js.map +1 -0
- package/dist/module/modular/GeoPoint.js +22 -0
- package/dist/module/modular/GeoPoint.js.map +1 -0
- package/dist/module/modular/Timestamp.js +22 -0
- package/dist/module/modular/Timestamp.js.map +1 -0
- package/dist/module/modular/VectorValue.js +25 -0
- package/dist/module/modular/VectorValue.js.map +1 -0
- package/dist/module/modular/query.js +222 -0
- package/dist/module/modular/query.js.map +1 -0
- package/dist/module/modular/snapshot.js +32 -0
- package/dist/module/modular/snapshot.js.map +1 -0
- package/dist/module/modular.js +229 -0
- package/dist/module/modular.js.map +1 -0
- package/dist/module/namespaced.js +298 -0
- package/dist/module/namespaced.js.map +1 -0
- package/dist/module/package.json +1 -0
- package/dist/module/pipelines/expressions.js +1273 -0
- package/dist/module/pipelines/expressions.js.map +1 -0
- package/dist/module/pipelines/index.js +32 -0
- package/dist/module/pipelines/index.js.map +1 -0
- package/dist/module/pipelines/pipeline-result.js +58 -0
- package/dist/module/pipelines/pipeline-result.js.map +1 -0
- package/dist/module/pipelines/pipeline-source.js +4 -0
- package/dist/module/pipelines/pipeline-source.js.map +1 -0
- package/dist/module/pipelines/pipeline.js +4 -0
- package/dist/module/pipelines/pipeline.js.map +1 -0
- package/dist/module/pipelines/pipeline_impl.js +42 -0
- package/dist/module/pipelines/pipeline_impl.js.map +1 -0
- package/dist/module/pipelines/pipeline_options.js +4 -0
- package/dist/module/pipelines/pipeline_options.js.map +1 -0
- package/dist/module/pipelines/pipeline_runtime.js +526 -0
- package/dist/module/pipelines/pipeline_runtime.js.map +1 -0
- package/dist/module/pipelines/pipeline_support.js +71 -0
- package/dist/module/pipelines/pipeline_support.js.map +1 -0
- package/dist/module/pipelines/pipeline_validate.js +183 -0
- package/dist/module/pipelines/pipeline_validate.js.map +1 -0
- package/dist/module/pipelines/stage_options.js +4 -0
- package/dist/module/pipelines/stage_options.js.map +1 -0
- package/dist/module/pipelines/types.js +2 -0
- package/dist/module/pipelines/types.js.map +1 -0
- package/dist/module/types/firestore.js +4 -0
- package/dist/module/types/firestore.js.map +1 -0
- package/dist/module/types/internal.js +4 -0
- package/dist/module/types/internal.js.map +1 -0
- package/dist/module/types/namespaced.js +338 -0
- package/dist/module/types/namespaced.js.map +1 -0
- package/{lib → dist/module}/utils/index.js +59 -114
- package/dist/module/utils/index.js.map +1 -0
- package/{lib → dist/module}/utils/serialize.js +58 -116
- package/dist/module/utils/serialize.js.map +1 -0
- package/{lib → dist/module}/utils/typemap.js +6 -20
- package/dist/module/utils/typemap.js.map +1 -0
- package/dist/module/version.js +5 -0
- package/dist/module/version.js.map +1 -0
- package/dist/module/web/RNFBFirestoreModule.android.js +5 -0
- package/dist/module/web/RNFBFirestoreModule.android.js.map +1 -0
- package/dist/module/web/RNFBFirestoreModule.ios.js +5 -0
- package/dist/module/web/RNFBFirestoreModule.ios.js.map +1 -0
- package/dist/module/web/RNFBFirestoreModule.js +387 -0
- package/dist/module/web/RNFBFirestoreModule.js.map +1 -0
- package/{lib → dist/module}/web/convert.js +60 -94
- package/dist/module/web/convert.js.map +1 -0
- package/dist/module/web/pipelines/pipeline.js +34 -0
- package/dist/module/web/pipelines/pipeline.js.map +1 -0
- package/dist/module/web/pipelines/pipeline_bridge_factory.js +217 -0
- package/dist/module/web/pipelines/pipeline_bridge_factory.js.map +1 -0
- package/dist/module/web/pipelines/pipeline_node_builder.js +294 -0
- package/dist/module/web/pipelines/pipeline_node_builder.js.map +1 -0
- package/dist/module/web/pipelines/pipeline_parser.js +21 -0
- package/dist/module/web/pipelines/pipeline_parser.js.map +1 -0
- package/dist/module/web/pipelines/pipeline_snapshot_serializer.js +89 -0
- package/dist/module/web/pipelines/pipeline_snapshot_serializer.js.map +1 -0
- package/dist/module/web/query.js +95 -0
- package/dist/module/web/query.js.map +1 -0
- package/dist/typescript/lib/FieldPath.d.ts +10 -0
- package/dist/typescript/lib/FieldPath.d.ts.map +1 -0
- package/dist/typescript/lib/FieldValue.d.ts +17 -0
- package/dist/typescript/lib/FieldValue.d.ts.map +1 -0
- package/dist/typescript/lib/FirestoreAggregate.d.ts +40 -0
- package/dist/typescript/lib/FirestoreAggregate.d.ts.map +1 -0
- package/dist/typescript/lib/FirestoreBlob.d.ts +11 -0
- package/dist/typescript/lib/FirestoreBlob.d.ts.map +1 -0
- package/dist/typescript/lib/FirestoreCollectionReference.d.ts +15 -0
- package/dist/typescript/lib/FirestoreCollectionReference.d.ts.map +1 -0
- package/dist/typescript/lib/FirestoreDocumentChange.d.ts +27 -0
- package/dist/typescript/lib/FirestoreDocumentChange.d.ts.map +1 -0
- package/dist/typescript/lib/FirestoreDocumentReference.d.ts +30 -0
- package/dist/typescript/lib/FirestoreDocumentReference.d.ts.map +1 -0
- package/dist/typescript/lib/FirestoreDocumentSnapshot.d.ts +30 -0
- package/dist/typescript/lib/FirestoreDocumentSnapshot.d.ts.map +1 -0
- package/dist/typescript/lib/FirestoreFilter.d.ts +52 -0
- package/dist/typescript/lib/FirestoreFilter.d.ts.map +1 -0
- package/dist/typescript/lib/FirestoreGeoPoint.d.ts +22 -0
- package/dist/typescript/lib/FirestoreGeoPoint.d.ts.map +1 -0
- package/dist/typescript/lib/FirestorePath.d.ts +12 -0
- package/dist/typescript/lib/FirestorePath.d.ts.map +1 -0
- package/dist/typescript/lib/FirestorePersistentCacheIndexManager.d.ts +16 -0
- package/dist/typescript/lib/FirestorePersistentCacheIndexManager.d.ts.map +1 -0
- package/dist/typescript/lib/FirestoreQuery.d.ts +39 -0
- package/dist/typescript/lib/FirestoreQuery.d.ts.map +1 -0
- package/dist/typescript/lib/FirestoreQueryModifiers.d.ts +59 -0
- package/dist/typescript/lib/FirestoreQueryModifiers.d.ts.map +1 -0
- package/dist/typescript/lib/FirestoreQuerySnapshot.d.ts +49 -0
- package/dist/typescript/lib/FirestoreQuerySnapshot.d.ts.map +1 -0
- package/dist/typescript/lib/FirestoreSnapshotMetadata.d.ts +8 -0
- package/dist/typescript/lib/FirestoreSnapshotMetadata.d.ts.map +1 -0
- package/dist/typescript/lib/FirestoreStatics.d.ts +23 -0
- package/dist/typescript/lib/FirestoreStatics.d.ts.map +1 -0
- package/dist/typescript/lib/FirestoreTimestamp.d.ts +33 -0
- package/dist/typescript/lib/FirestoreTimestamp.d.ts.map +1 -0
- package/dist/typescript/lib/FirestoreTransaction.d.ts +42 -0
- package/dist/typescript/lib/FirestoreTransaction.d.ts.map +1 -0
- package/dist/typescript/lib/FirestoreTransactionHandler.d.ts +26 -0
- package/dist/typescript/lib/FirestoreTransactionHandler.d.ts.map +1 -0
- package/dist/typescript/lib/FirestoreVectorValue.d.ts +17 -0
- package/dist/typescript/lib/FirestoreVectorValue.d.ts.map +1 -0
- package/dist/typescript/lib/FirestoreWriteBatch.d.ts +21 -0
- package/dist/typescript/lib/FirestoreWriteBatch.d.ts.map +1 -0
- package/dist/typescript/lib/LoadBundleTask.d.ts +16 -0
- package/dist/typescript/lib/LoadBundleTask.d.ts.map +1 -0
- package/dist/typescript/lib/index.d.ts +6 -0
- package/dist/typescript/lib/index.d.ts.map +1 -0
- package/dist/typescript/lib/modular/Bytes.d.ts +22 -0
- package/dist/typescript/lib/modular/Bytes.d.ts.map +1 -0
- package/dist/typescript/lib/modular/FieldPath.d.ts +4 -0
- package/dist/typescript/lib/modular/FieldPath.d.ts.map +1 -0
- package/dist/typescript/lib/modular/FieldValue.d.ts +8 -0
- package/dist/typescript/lib/modular/FieldValue.d.ts.map +1 -0
- package/dist/typescript/lib/modular/GeoPoint.d.ts +3 -0
- package/dist/typescript/lib/modular/GeoPoint.d.ts.map +1 -0
- package/dist/typescript/lib/modular/Timestamp.d.ts +3 -0
- package/dist/typescript/lib/modular/Timestamp.d.ts.map +1 -0
- package/dist/typescript/lib/modular/VectorValue.d.ts +4 -0
- package/dist/typescript/lib/modular/VectorValue.d.ts.map +1 -0
- package/dist/typescript/lib/modular/query.d.ts +93 -0
- package/dist/typescript/lib/modular/query.d.ts.map +1 -0
- package/dist/typescript/lib/modular/snapshot.d.ts +30 -0
- package/dist/typescript/lib/modular/snapshot.d.ts.map +1 -0
- package/dist/typescript/lib/modular.d.ts +69 -0
- package/dist/typescript/lib/modular.d.ts.map +1 -0
- package/dist/typescript/lib/namespaced.d.ts +13 -0
- package/dist/typescript/lib/namespaced.d.ts.map +1 -0
- package/dist/typescript/lib/pipelines/expressions.d.ts +723 -0
- package/dist/typescript/lib/pipelines/expressions.d.ts.map +1 -0
- package/dist/typescript/lib/pipelines/index.d.ts +31 -0
- package/dist/typescript/lib/pipelines/index.d.ts.map +1 -0
- package/dist/typescript/lib/pipelines/pipeline-result.d.ts +30 -0
- package/dist/typescript/lib/pipelines/pipeline-result.d.ts.map +1 -0
- package/dist/typescript/lib/pipelines/pipeline-source.d.ts +64 -0
- package/dist/typescript/lib/pipelines/pipeline-source.d.ts.map +1 -0
- package/dist/typescript/lib/pipelines/pipeline.d.ts +61 -0
- package/dist/typescript/lib/pipelines/pipeline.d.ts.map +1 -0
- package/dist/typescript/lib/pipelines/pipeline_impl.d.ts +21 -0
- package/dist/typescript/lib/pipelines/pipeline_impl.d.ts.map +1 -0
- package/dist/typescript/lib/pipelines/pipeline_options.d.ts +17 -0
- package/dist/typescript/lib/pipelines/pipeline_options.d.ts.map +1 -0
- package/dist/typescript/lib/pipelines/pipeline_runtime.d.ts +10 -0
- package/dist/typescript/lib/pipelines/pipeline_runtime.d.ts.map +1 -0
- package/dist/typescript/lib/pipelines/pipeline_support.d.ts +7 -0
- package/dist/typescript/lib/pipelines/pipeline_support.d.ts.map +1 -0
- package/dist/typescript/lib/pipelines/pipeline_validate.d.ts +9 -0
- package/dist/typescript/lib/pipelines/pipeline_validate.d.ts.map +1 -0
- package/dist/typescript/lib/pipelines/stage_options.d.ts +326 -0
- package/dist/typescript/lib/pipelines/stage_options.d.ts.map +1 -0
- package/dist/typescript/lib/pipelines/types.d.ts +10 -0
- package/dist/typescript/lib/pipelines/types.d.ts.map +1 -0
- package/dist/typescript/lib/types/firestore.d.ts +263 -0
- package/dist/typescript/lib/types/firestore.d.ts.map +1 -0
- package/dist/typescript/lib/types/internal.d.ts +483 -0
- package/dist/typescript/lib/types/internal.d.ts.map +1 -0
- package/dist/typescript/lib/types/namespaced.d.ts +2285 -0
- package/dist/typescript/lib/types/namespaced.d.ts.map +1 -0
- package/dist/typescript/lib/utils/index.d.ts +15 -0
- package/dist/typescript/lib/utils/index.d.ts.map +1 -0
- package/dist/typescript/lib/utils/serialize.d.ts +17 -0
- package/dist/typescript/lib/utils/serialize.d.ts.map +1 -0
- package/dist/typescript/lib/utils/typemap.d.ts +3 -0
- package/dist/typescript/lib/utils/typemap.d.ts.map +1 -0
- package/dist/typescript/lib/version.d.ts +2 -0
- package/dist/typescript/lib/version.d.ts.map +1 -0
- package/dist/typescript/lib/web/RNFBFirestoreModule.android.d.ts +3 -0
- package/dist/typescript/lib/web/RNFBFirestoreModule.android.d.ts.map +1 -0
- package/dist/typescript/lib/web/RNFBFirestoreModule.d.ts +75 -0
- package/dist/typescript/lib/web/RNFBFirestoreModule.d.ts.map +1 -0
- package/dist/typescript/lib/web/RNFBFirestoreModule.ios.d.ts +3 -0
- package/dist/typescript/lib/web/RNFBFirestoreModule.ios.d.ts.map +1 -0
- package/dist/typescript/lib/web/convert.d.ts +14 -0
- package/dist/typescript/lib/web/convert.d.ts.map +1 -0
- package/dist/typescript/lib/web/pipelines/pipeline.d.ts +4 -0
- package/dist/typescript/lib/web/pipelines/pipeline.d.ts.map +1 -0
- package/dist/typescript/lib/web/pipelines/pipeline_bridge_factory.d.ts +5 -0
- package/dist/typescript/lib/web/pipelines/pipeline_bridge_factory.d.ts.map +1 -0
- package/dist/typescript/lib/web/pipelines/pipeline_node_builder.d.ts +5 -0
- package/dist/typescript/lib/web/pipelines/pipeline_node_builder.d.ts.map +1 -0
- package/dist/typescript/lib/web/pipelines/pipeline_parser.d.ts +3 -0
- package/dist/typescript/lib/web/pipelines/pipeline_parser.d.ts.map +1 -0
- package/dist/typescript/lib/web/pipelines/pipeline_snapshot_serializer.d.ts +4 -0
- package/dist/typescript/lib/web/pipelines/pipeline_snapshot_serializer.d.ts.map +1 -0
- package/dist/typescript/lib/web/query.d.ts +23 -0
- package/dist/typescript/lib/web/query.d.ts.map +1 -0
- package/dist/typescript/package.json +1 -0
- package/ios/RNFBFirestore/RNFBFirestoreCollectionModule.m +52 -2
- package/ios/RNFBFirestore/RNFBFirestorePipelineBridgeFactory.swift +384 -0
- package/ios/RNFBFirestore/RNFBFirestorePipelineCallHandler.swift +86 -0
- package/ios/RNFBFirestore/RNFBFirestorePipelineNodeBuilder.swift +1500 -0
- package/ios/RNFBFirestore/RNFBFirestorePipelineParser.swift +1352 -0
- package/ios/RNFBFirestore/RNFBFirestorePipelineSnapshotSerializer.swift +98 -0
- package/lib/{FirestoreFieldPath.js → FieldPath.ts} +10 -12
- package/lib/{FirestoreFieldValue.js → FieldValue.ts} +22 -19
- package/lib/FirestoreAggregate.ts +124 -0
- package/lib/FirestoreBlob.ts +73 -0
- package/lib/FirestoreCollectionReference.ts +99 -0
- package/lib/FirestoreDocumentChange.ts +71 -0
- package/lib/FirestoreDocumentReference.ts +310 -0
- package/lib/FirestoreDocumentSnapshot.ts +149 -0
- package/lib/FirestoreFilter.ts +232 -0
- package/lib/{FirestoreGeoPoint.js → FirestoreGeoPoint.ts} +48 -8
- package/lib/FirestorePath.ts +54 -0
- package/lib/FirestorePersistentCacheIndexManager.ts +46 -0
- package/lib/{FirestoreQuery.js → FirestoreQuery.ts} +208 -100
- package/lib/FirestoreQueryModifiers.ts +411 -0
- package/lib/{FirestoreQuerySnapshot.js → FirestoreQuerySnapshot.ts} +61 -32
- package/lib/{FirestoreSnapshotMetadata.js → FirestoreSnapshotMetadata.ts} +8 -6
- package/lib/{FirestoreStatics.js → FirestoreStatics.ts} +18 -11
- package/lib/FirestoreTimestamp.ts +161 -0
- package/lib/{FirestoreTransaction.js → FirestoreTransaction.ts} +64 -27
- package/lib/{FirestoreTransactionHandler.js → FirestoreTransactionHandler.ts} +54 -75
- package/lib/{FirestoreVectorValue.js → FirestoreVectorValue.ts} +36 -15
- package/lib/{FirestoreWriteBatch.js → FirestoreWriteBatch.ts} +45 -21
- package/lib/LoadBundleTask.ts +85 -0
- package/lib/index.ts +71 -0
- package/lib/modular/Bytes.ts +81 -0
- package/lib/modular/FieldPath.ts +24 -0
- package/lib/modular/FieldValue.ts +40 -0
- package/lib/modular/GeoPoint.ts +20 -0
- package/lib/modular/Timestamp.ts +20 -0
- package/lib/modular/VectorValue.ts +24 -0
- package/lib/modular/query.ts +368 -0
- package/lib/modular/snapshot.ts +137 -0
- package/lib/modular.ts +552 -0
- package/lib/{index.js → namespaced.ts} +170 -80
- package/lib/pipelines/expressions.ts +2321 -0
- package/lib/pipelines/index.ts +203 -0
- package/lib/pipelines/pipeline-result.ts +78 -0
- package/lib/pipelines/pipeline-source.ts +83 -0
- package/lib/pipelines/pipeline.ts +99 -0
- package/lib/pipelines/pipeline_impl.ts +46 -0
- package/lib/pipelines/pipeline_options.ts +32 -0
- package/lib/pipelines/pipeline_runtime.ts +863 -0
- package/lib/pipelines/pipeline_support.ts +134 -0
- package/lib/pipelines/pipeline_validate.ts +242 -0
- package/lib/pipelines/stage_options.ts +376 -0
- package/lib/pipelines/types.ts +26 -0
- package/lib/types/firestore.ts +477 -0
- package/lib/types/internal.ts +747 -0
- package/lib/{index.d.ts → types/namespaced.ts} +280 -79
- package/lib/utils/index.ts +244 -0
- package/lib/utils/serialize.ts +314 -0
- package/lib/utils/typemap.ts +65 -0
- package/lib/version.ts +2 -0
- package/lib/web/{RNFBFirestoreModule.js → RNFBFirestoreModule.ts} +222 -234
- package/lib/web/convert.ts +287 -0
- package/lib/web/pipelines/pipeline.ts +47 -0
- package/lib/web/pipelines/pipeline_bridge_factory.ts +377 -0
- package/lib/web/pipelines/pipeline_node_builder.ts +413 -0
- package/lib/web/pipelines/pipeline_parser.ts +23 -0
- package/lib/web/pipelines/pipeline_snapshot_serializer.ts +133 -0
- package/lib/web/query.ts +150 -0
- package/package.json +46 -7
- package/tsconfig.json +35 -0
- package/lib/FirestoreBlob.js +0 -107
- package/lib/FirestoreCollectionReference.js +0 -70
- package/lib/FirestoreDocumentReference.js +0 -222
- package/lib/FirestoreDocumentSnapshot.js +0 -132
- package/lib/FirestoreFilter.js +0 -156
- package/lib/modular/Bytes.d.ts +0 -11
- package/lib/modular/Bytes.js +0 -62
- package/lib/modular/FieldPath.d.ts +0 -20
- package/lib/modular/FieldPath.js +0 -7
- package/lib/modular/FieldValue.d.ts +0 -67
- package/lib/modular/FieldValue.js +0 -41
- package/lib/modular/GeoPoint.d.ts +0 -17
- package/lib/modular/GeoPoint.js +0 -3
- package/lib/modular/Timestamp.d.ts +0 -85
- package/lib/modular/Timestamp.js +0 -3
- package/lib/modular/VectorValue.d.ts +0 -30
- package/lib/modular/VectorValue.js +0 -11
- package/lib/modular/index.d.ts +0 -788
- package/lib/modular/index.js +0 -410
- package/lib/modular/query.d.ts +0 -370
- package/lib/modular/query.js +0 -233
- package/lib/modular/snapshot.d.ts +0 -256
- package/lib/modular/snapshot.js +0 -33
- package/lib/modular/utils/observer.js +0 -16
- package/lib/version.js +0 -2
- package/lib/web/query.js +0 -112
- /package/lib/web/{RNFBFirestoreModule.android.js → RNFBFirestoreModule.android.ts} +0 -0
- /package/lib/web/{RNFBFirestoreModule.ios.js → RNFBFirestoreModule.ios.ts} +0 -0
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
1
3
|
/*
|
|
2
4
|
* Copyright (c) 2016-present Invertase Limited & Contributors
|
|
3
5
|
*
|
|
@@ -16,9 +18,8 @@
|
|
|
16
18
|
*/
|
|
17
19
|
|
|
18
20
|
import { isNumber } from '@react-native-firebase/app/dist/module/common';
|
|
19
|
-
import
|
|
20
|
-
import { buildNativeArray, generateNativeData } from
|
|
21
|
-
|
|
21
|
+
import FieldPath, { DOCUMENT_ID } from "./FieldPath.js";
|
|
22
|
+
import { buildNativeArray, generateNativeData } from "./utils/serialize.js";
|
|
22
23
|
export const OPERATORS = {
|
|
23
24
|
'==': 'EQUAL',
|
|
24
25
|
'>': 'GREATER_THAN',
|
|
@@ -29,36 +30,30 @@ export const OPERATORS = {
|
|
|
29
30
|
'array-contains': 'ARRAY_CONTAINS',
|
|
30
31
|
'array-contains-any': 'ARRAY_CONTAINS_ANY',
|
|
31
32
|
'not-in': 'NOT_IN',
|
|
32
|
-
in: 'IN'
|
|
33
|
+
in: 'IN'
|
|
33
34
|
};
|
|
34
|
-
|
|
35
35
|
const INEQUALITY = {
|
|
36
36
|
LESS_THAN: true,
|
|
37
37
|
LESS_THAN_OR_EQUAL: true,
|
|
38
38
|
GREATER_THAN: true,
|
|
39
39
|
GREATER_THAN_OR_EQUAL: true,
|
|
40
|
-
NOT_EQUAL: true
|
|
40
|
+
NOT_EQUAL: true
|
|
41
41
|
};
|
|
42
|
-
|
|
43
42
|
const DIRECTIONS = {
|
|
44
43
|
asc: 'ASCENDING',
|
|
45
|
-
desc: 'DESCENDING'
|
|
44
|
+
desc: 'DESCENDING'
|
|
46
45
|
};
|
|
47
|
-
|
|
48
|
-
export default class FirestoreQueryModifiers {
|
|
46
|
+
export default class QueryModifiers {
|
|
49
47
|
constructor() {
|
|
50
48
|
this._limit = undefined;
|
|
51
49
|
this._limitToLast = undefined;
|
|
52
50
|
this._filters = [];
|
|
53
51
|
this._orders = [];
|
|
54
52
|
this._type = 'collection';
|
|
55
|
-
// Cursors
|
|
56
53
|
this._startAt = undefined;
|
|
57
54
|
this._startAfter = undefined;
|
|
58
55
|
this._endAt = undefined;
|
|
59
56
|
this._endBefore = undefined;
|
|
60
|
-
|
|
61
|
-
// Pulled out of function to preserve their state
|
|
62
57
|
this.hasInequality = false;
|
|
63
58
|
this.hasNotEqual = false;
|
|
64
59
|
this.hasArrayContains = false;
|
|
@@ -66,9 +61,8 @@ export default class FirestoreQueryModifiers {
|
|
|
66
61
|
this.hasIn = false;
|
|
67
62
|
this.hasNotIn = false;
|
|
68
63
|
}
|
|
69
|
-
|
|
70
64
|
_copy() {
|
|
71
|
-
const newInstance = new
|
|
65
|
+
const newInstance = new QueryModifiers();
|
|
72
66
|
newInstance._limit = this._limit;
|
|
73
67
|
newInstance._limitToLast = this._limitToLast;
|
|
74
68
|
newInstance._filters = [...this._filters];
|
|
@@ -80,32 +74,26 @@ export default class FirestoreQueryModifiers {
|
|
|
80
74
|
newInstance._endBefore = this._endBefore;
|
|
81
75
|
return newInstance;
|
|
82
76
|
}
|
|
83
|
-
|
|
84
77
|
get filters() {
|
|
85
78
|
return this._filters.map(f => ({
|
|
86
79
|
...f,
|
|
87
|
-
fieldPath: f.fieldPath instanceof
|
|
80
|
+
fieldPath: f.fieldPath instanceof FieldPath ? f.fieldPath._toArray() : f.fieldPath
|
|
88
81
|
}));
|
|
89
82
|
}
|
|
90
|
-
|
|
91
83
|
get orders() {
|
|
92
84
|
return this._orders.map(f => ({
|
|
93
85
|
...f,
|
|
94
|
-
fieldPath: f.fieldPath instanceof
|
|
86
|
+
fieldPath: f.fieldPath instanceof FieldPath ? f.fieldPath._toArray() : f.fieldPath
|
|
95
87
|
}));
|
|
96
88
|
}
|
|
97
|
-
|
|
98
89
|
get options() {
|
|
99
90
|
const options = {};
|
|
100
|
-
|
|
101
91
|
if (this._limit) {
|
|
102
92
|
options.limit = this._limit;
|
|
103
93
|
}
|
|
104
|
-
|
|
105
94
|
if (this._limitToLast) {
|
|
106
95
|
options.limitToLast = this._limitToLast;
|
|
107
96
|
}
|
|
108
|
-
|
|
109
97
|
if (this._startAt) {
|
|
110
98
|
options.startAt = this._startAt;
|
|
111
99
|
}
|
|
@@ -118,287 +106,188 @@ export default class FirestoreQueryModifiers {
|
|
|
118
106
|
if (this._endBefore) {
|
|
119
107
|
options.endBefore = this._endBefore;
|
|
120
108
|
}
|
|
121
|
-
|
|
122
109
|
return options;
|
|
123
110
|
}
|
|
124
|
-
|
|
125
111
|
get type() {
|
|
126
112
|
return this._type;
|
|
127
113
|
}
|
|
128
|
-
|
|
129
114
|
setFieldsCursor(cursor, fields) {
|
|
130
115
|
this[`_${cursor}`] = buildNativeArray(fields);
|
|
131
116
|
return this;
|
|
132
117
|
}
|
|
133
|
-
|
|
134
|
-
/**
|
|
135
|
-
* Options
|
|
136
|
-
*/
|
|
137
|
-
|
|
138
118
|
hasStart() {
|
|
139
119
|
return !!(this._startAt || this._startAfter);
|
|
140
120
|
}
|
|
141
|
-
|
|
142
121
|
hasEnd() {
|
|
143
122
|
return !!(this._endAt || this._endBefore);
|
|
144
123
|
}
|
|
145
|
-
|
|
146
|
-
/**
|
|
147
|
-
* Collection Group Query
|
|
148
|
-
*/
|
|
149
|
-
|
|
150
124
|
asCollectionGroupQuery() {
|
|
151
125
|
this._type = 'collectionGroup';
|
|
152
126
|
return this;
|
|
153
127
|
}
|
|
154
|
-
|
|
155
128
|
isCollectionGroupQuery() {
|
|
156
129
|
return this._type === 'collectionGroup';
|
|
157
130
|
}
|
|
158
|
-
|
|
159
|
-
/**
|
|
160
|
-
* Limit
|
|
161
|
-
*/
|
|
162
|
-
|
|
163
131
|
isValidLimit(limit) {
|
|
164
132
|
return !isNumber(limit) || Math.floor(limit) !== limit || limit <= 0;
|
|
165
133
|
}
|
|
166
|
-
|
|
167
134
|
limit(limit) {
|
|
168
135
|
this._limitToLast = undefined;
|
|
169
136
|
this._limit = limit;
|
|
170
137
|
return this;
|
|
171
138
|
}
|
|
172
|
-
|
|
173
|
-
/**
|
|
174
|
-
* limitToLast
|
|
175
|
-
*/
|
|
176
|
-
|
|
177
139
|
isValidLimitToLast(limit) {
|
|
178
140
|
return !isNumber(limit) || Math.floor(limit) !== limit || limit <= 0;
|
|
179
141
|
}
|
|
180
|
-
|
|
181
142
|
validatelimitToLast() {
|
|
182
143
|
if (this._limitToLast) {
|
|
183
144
|
if (!this._orders.length) {
|
|
184
|
-
throw new Error(
|
|
185
|
-
'firebase.firestore().collection().limitToLast() queries require specifying at least one firebase.firestore().collection().orderBy() clause',
|
|
186
|
-
);
|
|
145
|
+
throw new Error('firebase.firestore().collection().limitToLast() queries require specifying at least one firebase.firestore().collection().orderBy() clause');
|
|
187
146
|
}
|
|
188
147
|
}
|
|
189
148
|
}
|
|
190
|
-
|
|
191
149
|
limitToLast(limitToLast) {
|
|
192
150
|
this._limit = undefined;
|
|
193
151
|
this._limitToLast = limitToLast;
|
|
194
152
|
return this;
|
|
195
153
|
}
|
|
196
|
-
|
|
197
|
-
/**
|
|
198
|
-
* Filters
|
|
199
|
-
*/
|
|
200
|
-
|
|
201
154
|
isValidOperator(operator) {
|
|
202
155
|
return !!OPERATORS[operator];
|
|
203
156
|
}
|
|
204
|
-
|
|
205
157
|
isEqualOperator(operator) {
|
|
206
158
|
return OPERATORS[operator] === 'EQUAL';
|
|
207
159
|
}
|
|
208
|
-
|
|
209
160
|
isNotEqualOperator(operator) {
|
|
210
161
|
return OPERATORS[operator] === 'NOT_EQUAL';
|
|
211
162
|
}
|
|
212
|
-
|
|
213
163
|
isInOperator(operator) {
|
|
214
|
-
return
|
|
215
|
-
OPERATORS[operator] === 'IN' ||
|
|
216
|
-
OPERATORS[operator] === 'ARRAY_CONTAINS_ANY' ||
|
|
217
|
-
OPERATORS[operator] === 'NOT_IN'
|
|
218
|
-
);
|
|
164
|
+
return OPERATORS[operator] === 'IN' || OPERATORS[operator] === 'ARRAY_CONTAINS_ANY' || OPERATORS[operator] === 'NOT_IN';
|
|
219
165
|
}
|
|
220
|
-
|
|
221
166
|
where(fieldPath, opStr, value) {
|
|
222
167
|
const filter = {
|
|
223
168
|
fieldPath,
|
|
224
|
-
operator: OPERATORS[opStr],
|
|
225
|
-
value: generateNativeData(value, true)
|
|
169
|
+
operator: OPERATORS[opStr] ?? opStr,
|
|
170
|
+
value: generateNativeData(value, true)
|
|
226
171
|
};
|
|
227
|
-
|
|
228
172
|
this._filters = this._filters.concat(filter);
|
|
229
173
|
return this;
|
|
230
174
|
}
|
|
231
|
-
|
|
232
175
|
filterWhere(filter) {
|
|
233
176
|
this._filters = this._filters.concat(filter);
|
|
234
177
|
return this;
|
|
235
178
|
}
|
|
236
|
-
|
|
237
179
|
validateWhere() {
|
|
238
180
|
if (this._filters.length > 0) {
|
|
239
181
|
this._filterCheck(this._filters);
|
|
240
182
|
}
|
|
241
183
|
}
|
|
242
|
-
|
|
243
184
|
_filterCheck(filters) {
|
|
244
185
|
for (let i = 0; i < filters.length; i++) {
|
|
245
186
|
const filter = filters[i];
|
|
246
|
-
|
|
247
187
|
if (filter.queries) {
|
|
248
|
-
// Recursively check sub-queries for Filters
|
|
249
188
|
this._filterCheck(filter.queries);
|
|
250
|
-
// If it is a Filter query, skip the rest of the loop
|
|
251
189
|
continue;
|
|
252
190
|
}
|
|
253
|
-
|
|
254
|
-
// Skip if no inequality
|
|
255
191
|
if (!INEQUALITY[filter.operator]) {
|
|
256
192
|
continue;
|
|
257
193
|
}
|
|
258
|
-
|
|
259
194
|
if (filter.operator === OPERATORS['!=']) {
|
|
260
195
|
if (this.hasNotEqual) {
|
|
261
196
|
throw new Error("Invalid query. You cannot use more than one '!=' inequality filter.");
|
|
262
197
|
}
|
|
263
|
-
//needs to set hasNotEqual = true before setting first hasInequality = filter. It is used in a condition check later
|
|
264
198
|
this.hasNotEqual = true;
|
|
265
199
|
}
|
|
266
|
-
|
|
267
|
-
// Set the first inequality
|
|
268
200
|
if (!this.hasInequality) {
|
|
269
201
|
this.hasInequality = filter;
|
|
270
202
|
continue;
|
|
271
203
|
}
|
|
272
204
|
}
|
|
273
|
-
|
|
274
205
|
for (let i = 0; i < filters.length; i++) {
|
|
275
206
|
const filter = filters[i];
|
|
276
|
-
|
|
277
207
|
if (filter.operator === OPERATORS['array-contains']) {
|
|
278
208
|
if (this.hasArrayContains) {
|
|
279
209
|
throw new Error('Invalid query. Queries only support a single array-contains filter.');
|
|
280
210
|
}
|
|
281
211
|
this.hasArrayContains = true;
|
|
282
212
|
}
|
|
283
|
-
|
|
284
213
|
if (filter.operator === OPERATORS['array-contains-any']) {
|
|
285
214
|
if (this.hasArrayContainsAny) {
|
|
286
|
-
throw new Error(
|
|
287
|
-
"Invalid query. You cannot use more than one 'array-contains-any' filter.",
|
|
288
|
-
);
|
|
215
|
+
throw new Error("Invalid query. You cannot use more than one 'array-contains-any' filter.");
|
|
289
216
|
}
|
|
290
|
-
|
|
291
217
|
if (this.hasNotIn) {
|
|
292
|
-
throw new Error(
|
|
293
|
-
"Invalid query. You cannot use 'array-contains-any' filters with 'not-in' filters.",
|
|
294
|
-
);
|
|
218
|
+
throw new Error("Invalid query. You cannot use 'array-contains-any' filters with 'not-in' filters.");
|
|
295
219
|
}
|
|
296
|
-
|
|
297
220
|
this.hasArrayContainsAny = true;
|
|
298
221
|
}
|
|
299
|
-
|
|
300
222
|
if (filter.operator === OPERATORS.in) {
|
|
301
223
|
if (this.hasNotIn) {
|
|
302
224
|
throw new Error("Invalid query. You cannot use 'in' filters with 'not-in' filters.");
|
|
303
225
|
}
|
|
304
|
-
|
|
305
226
|
this.hasIn = true;
|
|
306
227
|
}
|
|
307
|
-
|
|
308
228
|
if (filter.operator === OPERATORS['not-in']) {
|
|
309
229
|
if (this.hasNotIn) {
|
|
310
230
|
throw new Error("Invalid query. You cannot use more than one 'not-in' filter.");
|
|
311
231
|
}
|
|
312
|
-
|
|
313
232
|
if (this.hasNotEqual) {
|
|
314
|
-
throw new Error(
|
|
315
|
-
"Invalid query. You cannot use 'not-in' filters with '!=' inequality filters",
|
|
316
|
-
);
|
|
233
|
+
throw new Error("Invalid query. You cannot use 'not-in' filters with '!=' inequality filters");
|
|
317
234
|
}
|
|
318
|
-
|
|
319
235
|
if (this.hasIn) {
|
|
320
236
|
throw new Error("Invalid query. You cannot use 'not-in' filters with 'in' filters.");
|
|
321
237
|
}
|
|
322
|
-
|
|
323
238
|
if (this.hasArrayContainsAny) {
|
|
324
|
-
throw new Error(
|
|
325
|
-
"Invalid query. You cannot use 'not-in' filters with 'array-contains-any' filters.",
|
|
326
|
-
);
|
|
239
|
+
throw new Error("Invalid query. You cannot use 'not-in' filters with 'array-contains-any' filters.");
|
|
327
240
|
}
|
|
328
|
-
|
|
329
241
|
this.hasNotIn = true;
|
|
330
242
|
}
|
|
331
243
|
}
|
|
332
244
|
}
|
|
333
|
-
|
|
334
|
-
/**
|
|
335
|
-
* Orders
|
|
336
|
-
*/
|
|
337
|
-
|
|
338
245
|
isValidDirection(directionStr) {
|
|
339
246
|
return !!DIRECTIONS[directionStr.toLowerCase()];
|
|
340
247
|
}
|
|
341
|
-
|
|
342
248
|
orderBy(fieldPath, directionStr) {
|
|
249
|
+
const dir = directionStr ? DIRECTIONS[directionStr.toLowerCase()] : DIRECTIONS.asc;
|
|
343
250
|
const order = {
|
|
344
251
|
fieldPath: fieldPath,
|
|
345
|
-
direction:
|
|
252
|
+
direction: dir ?? 'ASCENDING'
|
|
346
253
|
};
|
|
347
|
-
|
|
348
254
|
this._orders = this._orders.concat(order);
|
|
349
255
|
return this;
|
|
350
256
|
}
|
|
351
|
-
|
|
352
257
|
validateOrderBy() {
|
|
353
258
|
this._validateOrderByCheck(this._filters);
|
|
354
259
|
}
|
|
355
|
-
|
|
356
260
|
_validateOrderByCheck(filters) {
|
|
357
|
-
// Ensure order hasn't been called on the same field
|
|
358
261
|
if (this._orders.length > 1) {
|
|
359
262
|
const orders = this._orders.map($ => $.fieldPath._toPath());
|
|
360
263
|
const set = new Set(orders);
|
|
361
|
-
|
|
362
264
|
if (set.size !== orders.length) {
|
|
363
265
|
throw new Error('Invalid query. Order by clause cannot contain duplicate fields.');
|
|
364
266
|
}
|
|
365
267
|
}
|
|
366
|
-
|
|
367
|
-
// Skip if no where filters
|
|
368
268
|
if (filters.length === 0) {
|
|
369
269
|
return;
|
|
370
270
|
}
|
|
371
|
-
|
|
372
|
-
// Ensure the first order field path is equal to the inequality filter field path
|
|
373
271
|
for (let i = 0; i < filters.length; i++) {
|
|
374
272
|
const filter = filters[i];
|
|
375
|
-
|
|
376
273
|
if (filter.queries) {
|
|
377
|
-
// Recursively check sub-queries for Filters
|
|
378
274
|
this._validateOrderByCheck(filter.queries);
|
|
379
|
-
// If it is a Filter query, skip the rest of the loop
|
|
380
275
|
continue;
|
|
381
276
|
}
|
|
382
277
|
const filterFieldPath = filter.fieldPath._toPath();
|
|
383
|
-
|
|
384
278
|
for (let k = 0; k < this._orders.length; k++) {
|
|
385
279
|
const order = this._orders[k];
|
|
386
280
|
const orderFieldPath = order.fieldPath;
|
|
387
281
|
if (filter.operator === OPERATORS['==']) {
|
|
388
|
-
// Any where() fieldPath parameter cannot match any orderBy() parameter when '==' operand is invoked
|
|
389
282
|
if (filterFieldPath === orderFieldPath._toPath()) {
|
|
390
|
-
throw new Error(
|
|
391
|
-
`Invalid query. Query.orderBy() parameter: ${orderFieldPath} cannot be the same as your Query.where() fieldPath parameter: ${filterFieldPath}`,
|
|
392
|
-
);
|
|
283
|
+
throw new Error(`Invalid query. Query.orderBy() parameter: ${orderFieldPath} cannot be the same as your Query.where() fieldPath parameter: ${filterFieldPath}`);
|
|
393
284
|
}
|
|
394
285
|
}
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
throw new Error(
|
|
398
|
-
"Invalid query. Query.where() fieldPath parameter: 'FirestoreFieldPath' cannot be used in conjunction with a different Query.orderBy() parameter",
|
|
399
|
-
);
|
|
286
|
+
if (filterFieldPath === DOCUMENT_ID._toPath() && orderFieldPath._toPath() !== DOCUMENT_ID._toPath()) {
|
|
287
|
+
throw new Error("Invalid query. Query.where() fieldPath parameter: 'FirestoreFieldPath' cannot be used in conjunction with a different Query.orderBy() parameter");
|
|
400
288
|
}
|
|
401
289
|
}
|
|
402
290
|
}
|
|
403
291
|
}
|
|
404
292
|
}
|
|
293
|
+
//# sourceMappingURL=FirestoreQueryModifiers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["isNumber","FieldPath","DOCUMENT_ID","buildNativeArray","generateNativeData","OPERATORS","in","INEQUALITY","LESS_THAN","LESS_THAN_OR_EQUAL","GREATER_THAN","GREATER_THAN_OR_EQUAL","NOT_EQUAL","DIRECTIONS","asc","desc","QueryModifiers","constructor","_limit","undefined","_limitToLast","_filters","_orders","_type","_startAt","_startAfter","_endAt","_endBefore","hasInequality","hasNotEqual","hasArrayContains","hasArrayContainsAny","hasIn","hasNotIn","_copy","newInstance","filters","map","f","fieldPath","_toArray","orders","options","limit","limitToLast","startAt","startAfter","endAt","endBefore","type","setFieldsCursor","cursor","fields","hasStart","hasEnd","asCollectionGroupQuery","isCollectionGroupQuery","isValidLimit","Math","floor","isValidLimitToLast","validatelimitToLast","length","Error","isValidOperator","operator","isEqualOperator","isNotEqualOperator","isInOperator","where","opStr","value","filter","concat","filterWhere","validateWhere","_filterCheck","i","queries","isValidDirection","directionStr","toLowerCase","orderBy","dir","order","direction","validateOrderBy","_validateOrderByCheck","$","_toPath","set","Set","size","filterFieldPath","k","orderFieldPath"],"sourceRoot":"../../lib","sources":["FirestoreQueryModifiers.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,QAAQ,QAAQ,+CAA+C;AACxE,OAAOC,SAAS,IAAIC,WAAW,QAAQ,gBAAa;AAQpD,SAASC,gBAAgB,EAAEC,kBAAkB,QAAQ,sBAAmB;AAExE,OAAO,MAAMC,SAAiC,GAAG;EAC/C,IAAI,EAAE,OAAO;EACb,GAAG,EAAE,cAAc;EACnB,IAAI,EAAE,uBAAuB;EAC7B,GAAG,EAAE,WAAW;EAChB,IAAI,EAAE,oBAAoB;EAC1B,IAAI,EAAE,WAAW;EACjB,gBAAgB,EAAE,gBAAgB;EAClC,oBAAoB,EAAE,oBAAoB;EAC1C,QAAQ,EAAE,QAAQ;EAClBC,EAAE,EAAE;AACN,CAAC;AAED,MAAMC,UAAmC,GAAG;EAC1CC,SAAS,EAAE,IAAI;EACfC,kBAAkB,EAAE,IAAI;EACxBC,YAAY,EAAE,IAAI;EAClBC,qBAAqB,EAAE,IAAI;EAC3BC,SAAS,EAAE;AACb,CAAC;AAED,MAAMC,UAAkC,GAAG;EACzCC,GAAG,EAAE,WAAW;EAChBC,IAAI,EAAE;AACR,CAAC;AAcD,eAAe,MAAMC,cAAc,CAAC;EAkBlCC,WAAWA,CAAA,EAAG;IACZ,IAA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C,IAAI,CAAC,EAAE;UACvC,IAAIwF,eAAe,KAAKE,cAAc,CAACN,OAAO,CAAC,CAAC,EAAE;YAChD,MAAM,IAAI1B,KAAK,CACb,6CAA6CgC,cAAc,kEAAkEF,eAAe,EAC9I,CAAC;UACH;QACF;QAEA,IACEA,eAAe,KAAK3F,WAAW,CAACuF,OAAO,CAAC,CAAC,IACzCM,cAAc,CAACN,OAAO,CAAC,CAAC,KAAKvF,WAAW,CAACuF,OAAO,CAAC,CAAC,EAClD;UACA,MAAM,IAAI1B,KAAK,CACb,iJACF,CAAC;QACH;MACF;IACF;EACF;AACF","ignoreList":[]}
|
|
@@ -0,0 +1,98 @@
|
|
|
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 { createDeprecationProxy, isBoolean, isFunction, isObject, isUndefined } from '@react-native-firebase/app/dist/module/common';
|
|
21
|
+
import DocumentChange from "./FirestoreDocumentChange.js";
|
|
22
|
+
import DocumentSnapshot from "./FirestoreDocumentSnapshot.js";
|
|
23
|
+
import SnapshotMetadata from "./FirestoreSnapshotMetadata.js";
|
|
24
|
+
export default class QuerySnapshot {
|
|
25
|
+
constructor(firestore, query, nativeData, converter) {
|
|
26
|
+
this._query = query;
|
|
27
|
+
this._source = nativeData.source;
|
|
28
|
+
this._excludesMetadataChanges = nativeData.excludesMetadataChanges;
|
|
29
|
+
this._changes = nativeData.changes.map(c => new DocumentChange(firestore, c, converter));
|
|
30
|
+
this._docs = nativeData.documents.map(doc => createDeprecationProxy(new DocumentSnapshot(firestore, doc, converter)));
|
|
31
|
+
this._metadata = new SnapshotMetadata(nativeData.metadata ?? [false, false]);
|
|
32
|
+
}
|
|
33
|
+
get docs() {
|
|
34
|
+
return this._docs;
|
|
35
|
+
}
|
|
36
|
+
get empty() {
|
|
37
|
+
return this._docs.length === 0;
|
|
38
|
+
}
|
|
39
|
+
get metadata() {
|
|
40
|
+
return this._metadata;
|
|
41
|
+
}
|
|
42
|
+
get query() {
|
|
43
|
+
return this._query;
|
|
44
|
+
}
|
|
45
|
+
get size() {
|
|
46
|
+
return this._docs.length;
|
|
47
|
+
}
|
|
48
|
+
docChanges(options) {
|
|
49
|
+
if (!isUndefined(options) && !isObject(options)) {
|
|
50
|
+
throw new Error("firebase.firestore() QuerySnapshot.docChanges(*) 'options' expected an object.");
|
|
51
|
+
}
|
|
52
|
+
let includeMetaDataChanges = false;
|
|
53
|
+
if (options) {
|
|
54
|
+
if (!isBoolean(options.includeMetadataChanges)) {
|
|
55
|
+
throw new Error("firebase.firestore() QuerySnapshot.docChanges(*) 'options.includeMetadataChanges' expected a boolean.");
|
|
56
|
+
}
|
|
57
|
+
includeMetaDataChanges = options.includeMetadataChanges ?? false;
|
|
58
|
+
}
|
|
59
|
+
if (this._source === 'get') {
|
|
60
|
+
return this._changes;
|
|
61
|
+
}
|
|
62
|
+
if (includeMetaDataChanges && this._excludesMetadataChanges) {
|
|
63
|
+
throw new Error('firebase.firestore() QuerySnapshot.docChanges() To include metadata changes with your document changes, you must also pass { includeMetadataChanges:true } to onSnapshot().');
|
|
64
|
+
}
|
|
65
|
+
return this._changes.filter($ => {
|
|
66
|
+
if (!includeMetaDataChanges) {
|
|
67
|
+
return $._isMetadataChange === false;
|
|
68
|
+
}
|
|
69
|
+
return true;
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
forEach(callback, thisArg) {
|
|
73
|
+
if (!isFunction(callback)) {
|
|
74
|
+
throw new Error("firebase.firestore() QuerySnapshot.forEach(*) 'callback' expected a function.");
|
|
75
|
+
}
|
|
76
|
+
const cb = thisArg ? callback.bind(thisArg) : callback;
|
|
77
|
+
for (let i = 0; i < this._docs.length; i++) {
|
|
78
|
+
cb(this._docs[i], i);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
isEqual(other, ...args) {
|
|
82
|
+
if (!(other instanceof QuerySnapshot)) {
|
|
83
|
+
throw new Error("firebase.firestore() QuerySnapshot.isEqual(*) 'other' expected a QuerySnapshot instance.");
|
|
84
|
+
}
|
|
85
|
+
if (this.empty !== other.empty || this.size !== other.size || !this.metadata.isEqual(other.metadata)) {
|
|
86
|
+
return false;
|
|
87
|
+
}
|
|
88
|
+
for (let i = 0; i < this.docs.length; i++) {
|
|
89
|
+
const thisDoc = this.docs[i];
|
|
90
|
+
const otherDoc = other.docs[i];
|
|
91
|
+
if (!thisDoc.isEqual(otherDoc, ...args)) {
|
|
92
|
+
return false;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
return true;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
//# sourceMappingURL=FirestoreQuerySnapshot.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createDeprecationProxy","isBoolean","isFunction","isObject","isUndefined","DocumentChange","DocumentSnapshot","SnapshotMetadata","QuerySnapshot","constructor","firestore","query","nativeData","converter","_query","_source","source","_excludesMetadataChanges","excludesMetadataChanges","_changes","changes","map","c","_docs","documents","doc","_metadata","metadata","docs","empty","length","size","docChanges","options","Error","includeMetaDataChanges","includeMetadataChanges","filter","$","_isMetadataChange","forEach","callback","thisArg","cb","bind","i","isEqual","other","args","thisDoc","otherDoc"],"sourceRoot":"../../lib","sources":["FirestoreQuerySn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AACtB,KAAK,CAACO,MAAM,EAAEe,CAAC,EAAE,EAAE;MAC1CF,EAAE,CAAC,IAAI,CAACpB,KAAK,CAACsB,CAAC,CAAC,EAAGA,CAAC,CAAC;IACvB;EACF;EAEAC,OAAOA,CAACC,KAAoB,EAAE,GAAGC,IAAe,EAAW;IACzD,IAAI,EAAED,KAAK,YAAYvC,aAAa,CAAC,EAAE;MACrC,MAAM,IAAI0B,KAAK,CACb,0FACF,CAAC;IACH;IAEA,IACE,IAAI,CAACL,KAAK,KAAKkB,KAAK,CAAClB,KAAK,IAC1B,IAAI,CAACE,IAAI,KAAKgB,KAAK,CAAChB,IAAI,IACxB,CAAC,IAAI,CAACJ,QAAQ,CAACmB,OAAO,CAACC,KAAK,CAACpB,QAAQ,CAAC,EACtC;MACA,OAAO,KAAK;IACd;IAEA,KAAK,IAAIkB,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAG,IAAI,CAACjB,IAAI,CAACE,MAAM,EAAEe,CAAC,EAAE,EAAE;MACzC,MAAMI,OAAO,GAAG,IAAI,CAACrB,IAAI,CAACiB,CAAC,CAAE;MAC7B,MAAMK,QAAQ,GAAGH,KAAK,CAACnB,IAAI,CAACiB,CAAC,CAAE;MAE/B,IAAI,CAAEI,OAAO,CAACH,OAAO,CAAkCI,QAAQ,EAAE,GAAGF,IAAI,CAAC,EAAE;QACzE,OAAO,KAAK;MACd;IACF;IAEA,OAAO,IAAI;EACb;AACF","ignoreList":[]}
|
|
@@ -0,0 +1,38 @@
|
|
|
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 { isUndefined } from '@react-native-firebase/app/dist/module/common';
|
|
21
|
+
export default class SnapshotMetadata {
|
|
22
|
+
constructor(metadata) {
|
|
23
|
+
this._metadata = metadata;
|
|
24
|
+
}
|
|
25
|
+
get fromCache() {
|
|
26
|
+
return this._metadata[0];
|
|
27
|
+
}
|
|
28
|
+
get hasPendingWrites() {
|
|
29
|
+
return this._metadata[1];
|
|
30
|
+
}
|
|
31
|
+
isEqual(other) {
|
|
32
|
+
if (isUndefined(other) || !(other instanceof SnapshotMetadata)) {
|
|
33
|
+
throw new Error("firebase.firestore() SnapshotMetadata.isEqual(*) 'other' expected instance of SnapshotMetadata");
|
|
34
|
+
}
|
|
35
|
+
return this.fromCache === other.fromCache && this.hasPendingWrites === other.hasPendingWrites;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=FirestoreSnapshotMetadata.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["isUndefined","SnapshotMetadata","constructor","metadata","_metadata","fromCache","hasPendingWrites","isEqual","other","Error"],"sourceRoot":"../../lib","sources":["FirestoreSnapshotMetadata.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,WAAW,QAAQ,+CAA+C;AAE3E,eAAe,MAAMC,gBAAgB,CAAC;EAGpCC,WAAWA,CAACC,QAA4B,EAAE;IACxC,IAAI,CAACC,SAAS,GAAGD,QAAQ;EAC3B;EAEA,IAAIE,SAASA,CAAA,EAAY;IACvB,OAAO,IAAI,CAACD,SAAS,CAAC,CAAC,CAAC;EAC1B;EAEA,IAAIE,gBAAgBA,CAAA,EAAY;IAC9B,OAAO,IAAI,CAACF,SAAS,CAAC,CAAC,CAAC;EAC1B;EAEAG,OAAOA,CAACC,KAAuB,EAAW;IACxC,IAAIR,WAAW,CAACQ,KAAK,CAAC,IAAI,EAAEA,KAAK,YAAYP,gBAAgB,CAAC,EAAE;MAC9D,MAAM,IAAIQ,KAAK,CACb,gGACF,CAAC;IACH;IAEA,OAAO,IAAI,CAACJ,SAAS,KAAKG,KAAK,CAACH,SAAS,IAAI,IAAI,CAACC,gBAAgB,KAAKE,KAAK,CAACF,gBAAgB;EAC/F;AACF","ignoreList":[]}
|
|
@@ -0,0 +1,50 @@
|
|
|
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 { createDeprecationProxy } from '@react-native-firebase/app/dist/module/common';
|
|
21
|
+
import { getReactNativeModule } from '@react-native-firebase/app/dist/module/internal/nativeModule';
|
|
22
|
+
import Blob from "./FirestoreBlob.js";
|
|
23
|
+
import FieldPath from "./FieldPath.js";
|
|
24
|
+
import FieldValue from "./FieldValue.js";
|
|
25
|
+
import { Filter } from "./FirestoreFilter.js";
|
|
26
|
+
import FirestoreGeoPoint from "./FirestoreGeoPoint.js";
|
|
27
|
+
import FirestoreTimestamp from "./FirestoreTimestamp.js";
|
|
28
|
+
import FirestoreVectorValue from "./FirestoreVectorValue.js";
|
|
29
|
+
const FirestoreStatics = {
|
|
30
|
+
Blob: Blob,
|
|
31
|
+
FieldPath: FieldPath,
|
|
32
|
+
FieldValue: createDeprecationProxy(FieldValue),
|
|
33
|
+
GeoPoint: FirestoreGeoPoint,
|
|
34
|
+
Timestamp: createDeprecationProxy(FirestoreTimestamp),
|
|
35
|
+
Filter: createDeprecationProxy(Filter),
|
|
36
|
+
VectorValue: FirestoreVectorValue,
|
|
37
|
+
vector(values) {
|
|
38
|
+
return new FirestoreVectorValue(values);
|
|
39
|
+
},
|
|
40
|
+
CACHE_SIZE_UNLIMITED: -1,
|
|
41
|
+
setLogLevel(logLevel) {
|
|
42
|
+
if (logLevel !== 'debug' && logLevel !== 'error' && logLevel !== 'silent') {
|
|
43
|
+
throw new Error("firebase.firestore.setLogLevel(*) 'logLevel' expected one of 'debug', 'error' or 'silent'");
|
|
44
|
+
}
|
|
45
|
+
const native = getReactNativeModule('RNFBFirestoreModule');
|
|
46
|
+
native.setLogLevel(logLevel);
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
export default FirestoreStatics;
|
|
50
|
+
//# sourceMappingURL=FirestoreStatics.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createDeprecationProxy","getReactNativeModule","Blob","FieldPath","FieldValue","Filter","FirestoreGeoPoint","FirestoreTimestamp","FirestoreVectorValue","FirestoreStatics","GeoPoint","Timestamp","VectorValue","vector","values","CACHE_SIZE_UNLIMITED","setLogLevel","logLevel","Error","native"],"sourceRoot":"../../lib","sources":["FirestoreStatics.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,sBAAsB,QAAQ,+CAA+C;AACtF,SAASC,oBAAoB,QAAQ,8DAA8D;AACnG,OAAOC,IAAI,MAAM,oBAAiB;AAClC,OAAOC,SAAS,MAAM,gBAAa;AACnC,OAAOC,UAAU,MAAM,iBAAc;AACrC,SAASC,MAAM,QAAQ,sBAAmB;AAC1C,OAAOC,iBAAiB,MAAM,wBAAqB;AACnD,OAAOC,kBAAkB,MAAM,yBAAsB;AACrD,OAAOC,oBAAoB,MAAM,2BAAwB;AAMzD,MAAMC,gBAAgB,GAAG;EACvBP,IAAI,EAAEA,IAAI;EACVC,SAAS,EAAEA,SAAS;EACpBC,UAAU,EAAEJ,sBAAsB,CAACI,UAAU,CAAC;EAC9CM,QAAQ,EAAEJ,iBAAiB;EAC3BK,SAAS,EAAEX,sBAAsB,CAACO,kBAAkB,CAAC;EACrDF,MAAM,EAAEL,sBAAsB,CAACK,MAAM,CAAC;EACtCO,WAAW,EAAEJ,oBAAoB;EACjCK,MAAMA,CAACC,MAAiB,EAAwB;IAC9C,OAAO,IAAIN,oBAAoB,CAACM,MAAM,CAAC;EACzC,CAAC;EAEDC,oBAAoB,EAAE,CAAC,CAAC;EAExBC,WAAWA,CAACC,QAA2B,EAAQ;IAC7C,IAAIA,QAAQ,KAAK,OAAO,IAAIA,QAAQ,KAAK,OAAO,IAAIA,QAAQ,KAAK,QAAQ,EAAE;MACzE,MAAM,IAAIC,KAAK,CACb,2FACF,CAAC;IACH;IAEA,MAAMC,MAAM,GAAGlB,oBAAoB,CAAC,qBAAqB,CAAmC;IAC5FkB,MAAM,CAACH,WAAW,CAACC,QAAQ,CAAC;EAC9B;AACF,CAAC;AAED,eAAeR,gBAAgB","ignoreList":[]}
|