@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,256 +0,0 @@
|
|
|
1
|
-
import { FirebaseFirestoreTypes } from '../index';
|
|
2
|
-
|
|
3
|
-
import DocumentReference = FirebaseFirestoreTypes.DocumentReference;
|
|
4
|
-
import DocumentSnapshot = FirebaseFirestoreTypes.DocumentSnapshot;
|
|
5
|
-
import SnapshotListenOptions = FirebaseFirestoreTypes.SnapshotListenOptions;
|
|
6
|
-
import QuerySnapshot = FirebaseFirestoreTypes.QuerySnapshot;
|
|
7
|
-
import Query = FirebaseFirestoreTypes.Query;
|
|
8
|
-
|
|
9
|
-
export type Unsubscribe = () => void;
|
|
10
|
-
export type FirestoreError = Error;
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Attaches a listener for `DocumentSnapshot` events. You may either pass
|
|
14
|
-
* individual `onNext` and `onError` callbacks or pass a single observer
|
|
15
|
-
* object with `next` and `error` callbacks.
|
|
16
|
-
*
|
|
17
|
-
* NOTE: Although an `onCompletion` callback can be provided, it will
|
|
18
|
-
* never be called because the snapshot stream is never-ending.
|
|
19
|
-
*
|
|
20
|
-
* @param reference - A reference to the document to listen to.
|
|
21
|
-
* @param observer - A single object containing `next` and `error` callbacks.
|
|
22
|
-
* @returns An unsubscribe function that can be called to cancel
|
|
23
|
-
* the snapshot listener.
|
|
24
|
-
*/
|
|
25
|
-
export function onSnapshot<T>(
|
|
26
|
-
reference: DocumentReference<T>,
|
|
27
|
-
observer: {
|
|
28
|
-
next?: (snapshot: DocumentSnapshot<T>) => void;
|
|
29
|
-
error?: (error: FirestoreError) => void;
|
|
30
|
-
complete?: () => void;
|
|
31
|
-
},
|
|
32
|
-
): Unsubscribe;
|
|
33
|
-
/**
|
|
34
|
-
* Attaches a listener for `DocumentSnapshot` events. You may either pass
|
|
35
|
-
* individual `onNext` and `onError` callbacks or pass a single observer
|
|
36
|
-
* object with `next` and `error` callbacks.
|
|
37
|
-
*
|
|
38
|
-
* NOTE: Although an `onCompletion` callback can be provided, it will
|
|
39
|
-
* never be called because the snapshot stream is never-ending.
|
|
40
|
-
*
|
|
41
|
-
* @param reference - A reference to the document to listen to.
|
|
42
|
-
* @param options - Options controlling the listen behavior.
|
|
43
|
-
* @param observer - A single object containing `next` and `error` callbacks.
|
|
44
|
-
* @returns An unsubscribe function that can be called to cancel
|
|
45
|
-
* the snapshot listener.
|
|
46
|
-
*/
|
|
47
|
-
export function onSnapshot<T>(
|
|
48
|
-
reference: DocumentReference<T>,
|
|
49
|
-
options: SnapshotListenOptions,
|
|
50
|
-
observer: {
|
|
51
|
-
next?: (snapshot: DocumentSnapshot<T>) => void;
|
|
52
|
-
error?: (error: FirestoreError) => void;
|
|
53
|
-
complete?: () => void;
|
|
54
|
-
},
|
|
55
|
-
): Unsubscribe;
|
|
56
|
-
/**
|
|
57
|
-
* Attaches a listener for `DocumentSnapshot` events. You may either pass
|
|
58
|
-
* individual `onNext` and `onError` callbacks or pass a single observer
|
|
59
|
-
* object with `next` and `error` callbacks.
|
|
60
|
-
*
|
|
61
|
-
* NOTE: Although an `onCompletion` callback can be provided, it will
|
|
62
|
-
* never be called because the snapshot stream is never-ending.
|
|
63
|
-
*
|
|
64
|
-
* @param reference - A reference to the document to listen to.
|
|
65
|
-
* @param onNext - A callback to be called every time a new `DocumentSnapshot`
|
|
66
|
-
* is available.
|
|
67
|
-
* @param onError - A callback to be called if the listen fails or is
|
|
68
|
-
* cancelled. No further callbacks will occur.
|
|
69
|
-
* @param onCompletion - Can be provided, but will not be called since streams are
|
|
70
|
-
* never ending.
|
|
71
|
-
* @returns An unsubscribe function that can be called to cancel
|
|
72
|
-
* the snapshot listener.
|
|
73
|
-
*/
|
|
74
|
-
export function onSnapshot<T>(
|
|
75
|
-
reference: DocumentReference<T>,
|
|
76
|
-
onNext: (snapshot: DocumentSnapshot<T>) => void,
|
|
77
|
-
onError?: (error: FirestoreError) => void,
|
|
78
|
-
onCompletion?: () => void,
|
|
79
|
-
): Unsubscribe;
|
|
80
|
-
/**
|
|
81
|
-
* Attaches a listener for `DocumentSnapshot` events. You may either pass
|
|
82
|
-
* individual `onNext` and `onError` callbacks or pass a single observer
|
|
83
|
-
* object with `next` and `error` callbacks.
|
|
84
|
-
*
|
|
85
|
-
* NOTE: Although an `onCompletion` callback can be provided, it will
|
|
86
|
-
* never be called because the snapshot stream is never-ending.
|
|
87
|
-
*
|
|
88
|
-
* @param reference - A reference to the document to listen to.
|
|
89
|
-
* @param options - Options controlling the listen behavior.
|
|
90
|
-
* @param onNext - A callback to be called every time a new `DocumentSnapshot`
|
|
91
|
-
* is available.
|
|
92
|
-
* @param onError - A callback to be called if the listen fails or is
|
|
93
|
-
* cancelled. No further callbacks will occur.
|
|
94
|
-
* @param onCompletion - Can be provided, but will not be called since streams are
|
|
95
|
-
* never ending.
|
|
96
|
-
* @returns An unsubscribe function that can be called to cancel
|
|
97
|
-
* the snapshot listener.
|
|
98
|
-
*/
|
|
99
|
-
export function onSnapshot<T>(
|
|
100
|
-
reference: DocumentReference<T>,
|
|
101
|
-
options: SnapshotListenOptions,
|
|
102
|
-
onNext: (snapshot: DocumentSnapshot<T>) => void,
|
|
103
|
-
onError?: (error: FirestoreError) => void,
|
|
104
|
-
onCompletion?: () => void,
|
|
105
|
-
): Unsubscribe;
|
|
106
|
-
/**
|
|
107
|
-
* Attaches a listener for `QuerySnapshot` events. You may either pass
|
|
108
|
-
* individual `onNext` and `onError` callbacks or pass a single observer
|
|
109
|
-
* object with `next` and `error` callbacks. The listener can be cancelled by
|
|
110
|
-
* calling the function that is returned when `onSnapshot` is called.
|
|
111
|
-
*
|
|
112
|
-
* NOTE: Although an `onCompletion` callback can be provided, it will
|
|
113
|
-
* never be called because the snapshot stream is never-ending.
|
|
114
|
-
*
|
|
115
|
-
* @param query - The query to listen to.
|
|
116
|
-
* @param observer - A single object containing `next` and `error` callbacks.
|
|
117
|
-
* @returns An unsubscribe function that can be called to cancel
|
|
118
|
-
* the snapshot listener.
|
|
119
|
-
*/
|
|
120
|
-
export declare function onSnapshot<AppModelType, DbModelType extends DocumentData>(
|
|
121
|
-
query: Query<AppModelType, DbModelType>,
|
|
122
|
-
observer: {
|
|
123
|
-
next?: (snapshot: QuerySnapshot<AppModelType, DbModelType>) => void;
|
|
124
|
-
error?: (error: FirestoreError) => void;
|
|
125
|
-
complete?: () => void;
|
|
126
|
-
},
|
|
127
|
-
): Unsubscribe;
|
|
128
|
-
/**
|
|
129
|
-
* Attaches a listener for `QuerySnapshot` events. You may either pass
|
|
130
|
-
* individual `onNext` and `onError` callbacks or pass a single observer
|
|
131
|
-
* object with `next` and `error` callbacks. The listener can be cancelled by
|
|
132
|
-
* calling the function that is returned when `onSnapshot` is called.
|
|
133
|
-
*
|
|
134
|
-
* NOTE: Although an `onCompletion` callback can be provided, it will
|
|
135
|
-
* never be called because the snapshot stream is never-ending.
|
|
136
|
-
*
|
|
137
|
-
* @param query - The query to listen to.
|
|
138
|
-
* @param options - Options controlling the listen behavior.
|
|
139
|
-
* @param observer - A single object containing `next` and `error` callbacks.
|
|
140
|
-
* @returns An unsubscribe function that can be called to cancel
|
|
141
|
-
* the snapshot listener.
|
|
142
|
-
*/
|
|
143
|
-
export declare function onSnapshot<AppModelType, DbModelType extends DocumentData>(
|
|
144
|
-
query: Query<AppModelType, DbModelType>,
|
|
145
|
-
options: SnapshotListenOptions,
|
|
146
|
-
observer: {
|
|
147
|
-
next?: (snapshot: QuerySnapshot<AppModelType, DbModelType>) => void;
|
|
148
|
-
error?: (error: FirestoreError) => void;
|
|
149
|
-
complete?: () => void;
|
|
150
|
-
},
|
|
151
|
-
): Unsubscribe;
|
|
152
|
-
/**
|
|
153
|
-
* Attaches a listener for `QuerySnapshot` events. You may either pass
|
|
154
|
-
* individual `onNext` and `onError` callbacks or pass a single observer
|
|
155
|
-
* object with `next` and `error` callbacks. The listener can be cancelled by
|
|
156
|
-
* calling the function that is returned when `onSnapshot` is called.
|
|
157
|
-
*
|
|
158
|
-
* NOTE: Although an `onCompletion` callback can be provided, it will
|
|
159
|
-
* never be called because the snapshot stream is never-ending.
|
|
160
|
-
*
|
|
161
|
-
* @param query - The query to listen to.
|
|
162
|
-
* @param onNext - A callback to be called every time a new `QuerySnapshot`
|
|
163
|
-
* is available.
|
|
164
|
-
* @param onCompletion - Can be provided, but will not be called since streams are
|
|
165
|
-
* never ending.
|
|
166
|
-
* @param onError - A callback to be called if the listen fails or is
|
|
167
|
-
* cancelled. No further callbacks will occur.
|
|
168
|
-
* @returns An unsubscribe function that can be called to cancel
|
|
169
|
-
* the snapshot listener.
|
|
170
|
-
*/
|
|
171
|
-
export declare function onSnapshot<AppModelType, DbModelType extends DocumentData>(
|
|
172
|
-
query: Query<AppModelType, DbModelType>,
|
|
173
|
-
onNext: (snapshot: QuerySnapshot<AppModelType, DbModelType>) => void,
|
|
174
|
-
onError?: (error: FirestoreError) => void,
|
|
175
|
-
onCompletion?: () => void,
|
|
176
|
-
): Unsubscribe;
|
|
177
|
-
/**
|
|
178
|
-
* Attaches a listener for `QuerySnapshot` events. You may either pass
|
|
179
|
-
* individual `onNext` and `onError` callbacks or pass a single observer
|
|
180
|
-
* object with `next` and `error` callbacks. The listener can be cancelled by
|
|
181
|
-
* calling the function that is returned when `onSnapshot` is called.
|
|
182
|
-
*
|
|
183
|
-
* NOTE: Although an `onCompletion` callback can be provided, it will
|
|
184
|
-
* never be called because the snapshot stream is never-ending.
|
|
185
|
-
*
|
|
186
|
-
* @param query - The query to listen to.
|
|
187
|
-
* @param options - Options controlling the listen behavior.
|
|
188
|
-
* @param onNext - A callback to be called every time a new `QuerySnapshot`
|
|
189
|
-
* is available.
|
|
190
|
-
* @param onCompletion - Can be provided, but will not be called since streams are
|
|
191
|
-
* never ending.
|
|
192
|
-
* @param onError - A callback to be called if the listen fails or is
|
|
193
|
-
* cancelled. No further callbacks will occur.
|
|
194
|
-
* @returns An unsubscribe function that can be called to cancel
|
|
195
|
-
* the snapshot listener.
|
|
196
|
-
*/
|
|
197
|
-
export declare function onSnapshot<AppModelType, DbModelType extends DocumentData>(
|
|
198
|
-
query: Query<AppModelType, DbModelType>,
|
|
199
|
-
options: SnapshotListenOptions,
|
|
200
|
-
onNext: (snapshot: QuerySnapshot<AppModelType, DbModelType>) => void,
|
|
201
|
-
onError?: (error: FirestoreError) => void,
|
|
202
|
-
onCompletion?: () => void,
|
|
203
|
-
): Unsubscribe;
|
|
204
|
-
|
|
205
|
-
/**
|
|
206
|
-
* Returns true if the provided snapshots are equal.
|
|
207
|
-
*
|
|
208
|
-
* @param left DocumentSnapshot<AppModelType, DbModelType> | QuerySnapshot<AppModelType, DbModelType> A snapshot to compare.
|
|
209
|
-
* @param right DocumentSnapshot<AppModelType, DbModelType> | QuerySnapshot<AppModelType, DbModelType> A snapshot to compare.
|
|
210
|
-
*
|
|
211
|
-
* @returns boolean true if the snapshots are equal.
|
|
212
|
-
*/
|
|
213
|
-
export function snapshotEqual<AppModelType, DbModelType extends DocumentData>(
|
|
214
|
-
left: DocumentSnapshot<AppModelType, DbModelType> | QuerySnapshot<AppModelType, DbModelType>,
|
|
215
|
-
right: DocumentSnapshot<AppModelType, DbModelType> | QuerySnapshot<AppModelType, DbModelType>,
|
|
216
|
-
): boolean;
|
|
217
|
-
|
|
218
|
-
/**
|
|
219
|
-
* Returns true if the provided queries point to the same collection and apply the same constraints.
|
|
220
|
-
*
|
|
221
|
-
* @param left Query<AppModelType, DbModelType> A Query to compare.
|
|
222
|
-
* @param right Query<AppModelType, DbModelType> A Query to compare.
|
|
223
|
-
*
|
|
224
|
-
* @return boolean true if the references point to the same location in the same Firestore database.
|
|
225
|
-
*/
|
|
226
|
-
export declare function queryEqual<AppModelType, DbModelType extends DocumentData>(
|
|
227
|
-
left: Query<AppModelType, DbModelType>,
|
|
228
|
-
right: Query<AppModelType, DbModelType>,
|
|
229
|
-
): boolean;
|
|
230
|
-
|
|
231
|
-
/**
|
|
232
|
-
* Attaches a listener for a snapshots-in-sync event.
|
|
233
|
-
* The snapshots-in-sync event indicates that all listeners affected by a given change have fired, even if
|
|
234
|
-
* a single server-generated change affects multiple listeners.
|
|
235
|
-
*
|
|
236
|
-
* @param firestore
|
|
237
|
-
* @param observer
|
|
238
|
-
*/
|
|
239
|
-
export declare function onSnapshotsInSync(
|
|
240
|
-
firestore: Firestore,
|
|
241
|
-
observer: {
|
|
242
|
-
next?: (value: void) => void;
|
|
243
|
-
error?: (error: FirestoreError) => void;
|
|
244
|
-
complete?: () => void;
|
|
245
|
-
},
|
|
246
|
-
): Unsubscribe;
|
|
247
|
-
|
|
248
|
-
/**
|
|
249
|
-
* Attaches a listener for a snapshots-in-sync event.
|
|
250
|
-
* The snapshots-in-sync event indicates that all listeners affected by a given change have fired, even if
|
|
251
|
-
* a single server-generated change affects multiple listeners.
|
|
252
|
-
*
|
|
253
|
-
* @param firestore
|
|
254
|
-
* @param onSync
|
|
255
|
-
*/
|
|
256
|
-
export declare function onSnapshotsInSync(firestore: Firestore, onSync: () => void): Unsubscribe;
|
package/lib/modular/snapshot.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @typedef {import('../..').FirebaseFirestoreTypes.Query} Query
|
|
3
|
-
* @typedef {import('../..').FirebaseFirestoreTypes.DocumentReference} DocumentReference
|
|
4
|
-
* @typedef {import('snapshot').Unsubscribe} Unsubscribe
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import { MODULAR_DEPRECATION_ARG } from '@react-native-firebase/app/dist/module/common';
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* @param {Query | DocumentReference} reference
|
|
11
|
-
* @param {unknown} args
|
|
12
|
-
* @returns {Promise<unknown>}
|
|
13
|
-
*/
|
|
14
|
-
export function onSnapshot(reference, ...args) {
|
|
15
|
-
return reference.onSnapshot.call(reference, ...args, MODULAR_DEPRECATION_ARG);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export function snapshotEqual(left, right) {
|
|
19
|
-
return left.isEqual.call(left, right, MODULAR_DEPRECATION_ARG);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Attaches a listener for a snapshots-in-sync event.
|
|
24
|
-
* The snapshots-in-sync event indicates that all listeners affected by a given change have fired, even if
|
|
25
|
-
* a single server-generated change affects multiple listeners.
|
|
26
|
-
*
|
|
27
|
-
* @param {*} firestore
|
|
28
|
-
* @param {...any} args
|
|
29
|
-
*/
|
|
30
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
31
|
-
export function onSnapshotsInSync(firestore, ...args) {
|
|
32
|
-
throw new Error('onSnapshotsInSync() is not implemented');
|
|
33
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @param {unknown} obj
|
|
3
|
-
* @returns {boolean}
|
|
4
|
-
*/
|
|
5
|
-
export function isPartialObserver(obj) {
|
|
6
|
-
const observerMethods = ['next', 'error', 'complete'];
|
|
7
|
-
if (typeof obj !== 'object' || obj == null) return false;
|
|
8
|
-
|
|
9
|
-
for (const method of observerMethods) {
|
|
10
|
-
if (method in obj && typeof obj[method] === 'function') {
|
|
11
|
-
return true;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
return false;
|
|
16
|
-
}
|
package/lib/version.js
DELETED
package/lib/web/query.js
DELETED
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
FieldPath,
|
|
3
|
-
query,
|
|
4
|
-
where,
|
|
5
|
-
orderBy,
|
|
6
|
-
limit,
|
|
7
|
-
limitToLast,
|
|
8
|
-
startAt,
|
|
9
|
-
startAfter,
|
|
10
|
-
endAt,
|
|
11
|
-
endBefore,
|
|
12
|
-
and,
|
|
13
|
-
or,
|
|
14
|
-
} from '@react-native-firebase/app/dist/module/internal/web/firebaseFirestore';
|
|
15
|
-
import { parseTypeMap, readableToArray } from './convert';
|
|
16
|
-
|
|
17
|
-
export function buildQuery(queryInstance, filters, orders, options) {
|
|
18
|
-
// Apply filters
|
|
19
|
-
for (const filter of filters) {
|
|
20
|
-
queryInstance = query(queryInstance, getFilterConstraint(filter));
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
// Apply orders
|
|
24
|
-
for (const order of orders) {
|
|
25
|
-
const fieldPath =
|
|
26
|
-
typeof order.fieldPath === 'string' ? order.fieldPath : new FieldPath(...order.fieldPath);
|
|
27
|
-
const direction = order.direction === 'ASCENDING' ? 'asc' : 'desc';
|
|
28
|
-
queryInstance = query(queryInstance, orderBy(fieldPath, direction));
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
// Apply options
|
|
32
|
-
if ('limit' in options) {
|
|
33
|
-
queryInstance = query(queryInstance, limit(options.limit));
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
if ('limitToLast' in options) {
|
|
37
|
-
queryInstance = query(queryInstance, limitToLast(options.limitToLast));
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
if ('startAt' in options) {
|
|
41
|
-
const fieldList = readableToArray(queryInstance.firestore, options.startAt);
|
|
42
|
-
queryInstance = query(queryInstance, startAt(...fieldList));
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
if ('startAfter' in options) {
|
|
46
|
-
const fieldList = readableToArray(queryInstance.firestore, options.startAfter);
|
|
47
|
-
queryInstance = query(queryInstance, startAfter(...fieldList));
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
if ('endAt' in options) {
|
|
51
|
-
const fieldList = readableToArray(queryInstance.firestore, options.endAt);
|
|
52
|
-
queryInstance = query(queryInstance, endAt(...fieldList));
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
if ('endBefore' in options) {
|
|
56
|
-
const fieldList = readableToArray(queryInstance.firestore, options.endBefore);
|
|
57
|
-
queryInstance = query(queryInstance, endBefore(...fieldList));
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
return queryInstance;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
function getFilterConstraint(filter) {
|
|
64
|
-
if ('fieldPath' in filter && filter.fieldPath) {
|
|
65
|
-
const fieldPath = Array.isArray(filter.fieldPath)
|
|
66
|
-
? new FieldPath(...filter.fieldPath)
|
|
67
|
-
: new FieldPath(...filter.fieldPath._segments);
|
|
68
|
-
const operator = filter.operator;
|
|
69
|
-
const value = parseTypeMap(query.firestore, filter.value);
|
|
70
|
-
|
|
71
|
-
switch (operator) {
|
|
72
|
-
case 'EQUAL':
|
|
73
|
-
return where(fieldPath, '==', value);
|
|
74
|
-
case 'NOT_EQUAL':
|
|
75
|
-
return where(fieldPath, '!=', value);
|
|
76
|
-
case 'GREATER_THAN':
|
|
77
|
-
return where(fieldPath, '>', value);
|
|
78
|
-
case 'GREATER_THAN_OR_EQUAL':
|
|
79
|
-
return where(fieldPath, '>=', value);
|
|
80
|
-
case 'LESS_THAN':
|
|
81
|
-
return where(fieldPath, '<', value);
|
|
82
|
-
case 'LESS_THAN_OR_EQUAL':
|
|
83
|
-
return where(fieldPath, '<=', value);
|
|
84
|
-
case 'ARRAY_CONTAINS':
|
|
85
|
-
return where(fieldPath, 'array-contains', value);
|
|
86
|
-
case 'ARRAY_CONTAINS_ANY':
|
|
87
|
-
return where(fieldPath, 'array-contains-any', value);
|
|
88
|
-
case 'IN':
|
|
89
|
-
return where(fieldPath, 'in', value);
|
|
90
|
-
case 'NOT_IN':
|
|
91
|
-
return where(fieldPath, 'not-in', value);
|
|
92
|
-
}
|
|
93
|
-
} else if ('operator' in filter && 'queries' in filter) {
|
|
94
|
-
const constraints = [];
|
|
95
|
-
|
|
96
|
-
for (const constraint of filter.queries) {
|
|
97
|
-
constraints.push(getFilterConstraint(constraint));
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
if (filter.operator === 'AND') {
|
|
101
|
-
return and(...constraints);
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
if (filter.operator === 'OR') {
|
|
105
|
-
return or(...constraints);
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
throw new Error('Invalid filter operator');
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
throw new Error('Invalid filter.');
|
|
112
|
-
}
|
|
File without changes
|
|
File without changes
|