@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.
- package/CHANGELOG.md +27 -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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["isObject","isString","isUndefined","isNull","createDeprecationProxy","filterModularArgument","NativeError","parseSetOptions","parseSnapshotArgs","parseUpdateArgs","validateWithConverter","applyFirestoreDataConverter","buildNativeMap","provideDocumentReferenceClass","FirestoreCollectionReference","provideCollectionReferenceClass","collectionReference","FirestoreDocumentSnapshotClass","provideDocumentSnapshotClass","documentSnapshot","_id","DocumentReference","constructor","firestore","documentPath","converter","_firestore","_documentPath","_converter","undefined","id","parent","parentPath","path","relativeName","collection","collectionPath","Error","child","isCollection","delete","native","documentDelete","get","options","source","documentGet","then","data","isEqual","other","app","name","projectId","onSnapshot","args","snapshotListenOptions","callback","onNext","onError","e","message","handleSuccess","handleError","error","listenerId","onSnapshotSubscription","emitter","addListener","eventNameForApp","event","body","fromEvent","snapshot","unsubscribe","remove","documentOffSnapshot","documentOnSnapshot","set","setOptions","converted","documentSet","_settings","ignoreUndefinedProperties","update","updatedArgs","length","documentUpdate","withConverter"],"sourceRoot":"../../lib","sources":["FirestoreDocumentReference.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SACEA,QAAQ,EACRC,QAAQ,EACRC,WAAW,EACXC,MAAM,EACNC,sBAAsB,EACtBC,qBAAqB,QAChB,+CAA+C;AACtD,OAAOC,WAAW,MAAM,qEAAqE;AAC7F,SACEC,eAAe,EACfC,iBAAiB,EACjBC,eAAe,EACfC,qBAAqB,EACrBC,2BAA2B,QACtB,kBAAS;AAChB,SAASC,cAAc,EAAEC,6BAA6B,QAAQ,sBAAmB;AASjF,IAAIC,4BAMI,GAAG,IAAI;AAEf,OAAO,SAASC,+BAA+BA,CAC7CC,mBAIsC,EAChC;EACNF,4BAA4B,GAAGE,mBAAmB;AACpD;AAEA,IAAIC,8BAMI,GAAG,IAAI;AAEf,OAAO,SAASC,4BAA4BA,CAC1CC,gBAIqB,EACf;EACNF,8BAA8B,GAAGE,gBAAgB;AACnD;AAEA,IAAIC,GAAG,GAAG,CAAC;AAEX,eAAe,MAAMC,iBAAiB,CAAC;EAKrCC,WAAWA,CAACC,SAA4B,EAAEC,YAA2B,EAAEC,SAAmB,EAAE;IAC1F,IAAI,CAACC,UAAU,GAAGH,SAAS;IAC3B,IAAI,CAACI,aAAa,GAAGH,YAAY;IACjC,IAAI,CAACI,UAAU,GAAIH,SAAS,KAAKI,SAAS,GAAG,IAAI,GAAGJ,SAG5C;EACV;EAEA,IAAIF,SAASA,CAAA,EAAsB;IACjC,OAAO,IAAI,CAACG,UAAU;EACxB;EAEA,IAAID,SAASA,CAAA,EAAY;IACvB,OAAO,IAAI,CAACG,UAAU;EACxB;EAEA,IAAIE,EAAEA,CAAA,EAAW;IACf,OAAO,IAAI,CAACH,aAAa,CAACG,EAAE;EAC9B;EAEA,IAAIC,MAAMA,C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,CAAC8C,cAAc,CAC1C,IAAI,CAACtD,IAAI,EACTrB,cAAc,CAACoC,IAAI,EAAE,IAAI,CAACtB,UAAU,CAACwD,SAAS,CAACC,yBAAyB,CAC1E,CAAC;EACH;EAEAK,aAAaA,CACX/D,SAAoE,EACjD;IACnB,IAAIvB,WAAW,CAACuB,SAAS,CAAC,IAAItB,MAAM,CAACsB,SAAS,CAAC,EAAE;MAC/C,OAAO,IAAIJ,iBAAiB,CAAC,IAAI,CAACK,UAAU,EAAE,IAAI,CAACC,aAAa,EAAE,IAAI,CAAC;IACzE;IAEA,IAAI;MACFjB,qBAAqB,CAACe,SAAS,CAAC;IAClC,CAAC,CAAC,OAAOmC,CAAC,EAAE;MACV,MAAM,IAAIvB,KAAK,CAAC,8CAA+CuB,CAAC,CAAWC,OAAO,EAAE,CAAC;IACvF;IAEA,OAAO,IAAIxC,iBAAiB,CAAC,IAAI,CAACK,UAAU,EAAE,IAAI,CAACC,aAAa,EAAEF,SAAS,CAAC;EAC9E;AACF;AAEAZ,6BAA6B,CAACQ,iBAAiB,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,88 @@
|
|
|
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 { isString } from '@react-native-firebase/app/dist/module/common';
|
|
21
|
+
import DocumentReference, { provideDocumentSnapshotClass } from "./FirestoreDocumentReference.js";
|
|
22
|
+
import FieldPath, { fromDotSeparatedString } from "./FieldPath.js";
|
|
23
|
+
import FirestorePath from "./FirestorePath.js";
|
|
24
|
+
import SnapshotMetadata from "./FirestoreSnapshotMetadata.js";
|
|
25
|
+
import { extractFieldPathData } from "./utils/index.js";
|
|
26
|
+
import { parseNativeMap } from "./utils/serialize.js";
|
|
27
|
+
export default class DocumentSnapshot {
|
|
28
|
+
constructor(firestore, nativeData, converter) {
|
|
29
|
+
this._firestore = firestore;
|
|
30
|
+
this._nativeData = nativeData;
|
|
31
|
+
this._data = parseNativeMap(firestore, nativeData.data);
|
|
32
|
+
this._metadata = new SnapshotMetadata(nativeData.metadata ?? [false, false]);
|
|
33
|
+
this._ref = new DocumentReference(firestore, FirestorePath.fromName(nativeData.path));
|
|
34
|
+
this._exists = nativeData.exists ?? false;
|
|
35
|
+
this._converter = converter;
|
|
36
|
+
}
|
|
37
|
+
get id() {
|
|
38
|
+
return this._ref.id;
|
|
39
|
+
}
|
|
40
|
+
get metadata() {
|
|
41
|
+
return this._metadata;
|
|
42
|
+
}
|
|
43
|
+
get ref() {
|
|
44
|
+
return this._ref;
|
|
45
|
+
}
|
|
46
|
+
exists() {
|
|
47
|
+
return this._exists;
|
|
48
|
+
}
|
|
49
|
+
data(options) {
|
|
50
|
+
if (this._converter) {
|
|
51
|
+
try {
|
|
52
|
+
return this._converter.fromFirestore(new DocumentSnapshot(this._firestore, this._nativeData, null), options);
|
|
53
|
+
} catch (e) {
|
|
54
|
+
throw new Error(`firebase.firestore() DocumentSnapshot.data(*) 'withConverter.fromFirestore' threw an error: ${e.message}.`);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return this._data;
|
|
58
|
+
}
|
|
59
|
+
get(fieldPath, _options) {
|
|
60
|
+
if (!isString(fieldPath) && !(fieldPath instanceof FieldPath)) {
|
|
61
|
+
throw new Error("firebase.firestore() DocumentSnapshot.get(*) 'fieldPath' expected type string or FieldPath.");
|
|
62
|
+
}
|
|
63
|
+
let path;
|
|
64
|
+
if (isString(fieldPath)) {
|
|
65
|
+
try {
|
|
66
|
+
path = fromDotSeparatedString(fieldPath);
|
|
67
|
+
} catch (e) {
|
|
68
|
+
throw new Error(`firebase.firestore() DocumentSnapshot.get(*) 'fieldPath' ${e.message}.`);
|
|
69
|
+
}
|
|
70
|
+
} else {
|
|
71
|
+
path = fieldPath;
|
|
72
|
+
}
|
|
73
|
+
return extractFieldPathData(this._data, path._segments);
|
|
74
|
+
}
|
|
75
|
+
isEqual(other) {
|
|
76
|
+
if (!(other instanceof DocumentSnapshot)) {
|
|
77
|
+
throw new Error("firebase.firestore() DocumentSnapshot.isEqual(*) 'other' expected a DocumentSnapshot instance.");
|
|
78
|
+
}
|
|
79
|
+
if (this.exists() !== other.exists() || !this.metadata.isEqual(other.metadata) || !this.ref.isEqual(other.ref)) {
|
|
80
|
+
return false;
|
|
81
|
+
}
|
|
82
|
+
const thisData = JSON.stringify(this.data());
|
|
83
|
+
const otherData = JSON.stringify(other.data());
|
|
84
|
+
return thisData === otherData;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
provideDocumentSnapshotClass(DocumentSnapshot);
|
|
88
|
+
//# sourceMappingURL=FirestoreDocumentSnapshot.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["isString","DocumentReference","provideDocumentSnapshotClass","FieldPath","fromDotSeparatedString","FirestorePath","SnapshotMetadata","extractFieldPathData","parseNativeMap","DocumentSnapshot","constructor","firestore","nativeData","converter","_firestore","_nativeData","_data","data","_metadata","metadata","_ref","fromName","path","_exists","exists","_converter","id","ref","options","fromFirestore","e","Error","message","get","fieldPath","_options","_segments","isEqual","other","thisData","JSON","stringify","otherData"],"sourceRoot":"../../lib","sources":["FirestoreDocumentSnapshot.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;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,CAAC,IAAI,CAACQ,GAAG,CAACU,OAAO,CAACC,KAAK,CAACX,GAAG,CAAC,EAC5B;MACA,OAAO,KAAK;IACd;IAEA,MAAMY,QAAQ,GAAGC,IAAI,CAACC,SAAS,CAAC,IAAI,CAACxB,IAAI,CAAC,CAAC,CAAC;IAC5C,MAAMyB,SAAS,GAAGF,IAAI,CAACC,SAAS,CAACH,KAAK,CAACrB,IAAI,CAAC,CAAC,CAAC;IAE9C,OAAOsB,QAAQ,KAAKG,SAAS;EAC/B;AACF;AAEAxC,4BAA4B,CAACO,gBAAgB,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,146 @@
|
|
|
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 { isArray, isNull, isString, isUndefined } from '@react-native-firebase/app/dist/module/common';
|
|
21
|
+
import { fromDotSeparatedString } from "./FieldPath.js";
|
|
22
|
+
import { OPERATORS } from "./FirestoreQueryModifiers.js";
|
|
23
|
+
import { generateNativeData } from "./utils/serialize.js";
|
|
24
|
+
const AND_QUERY = 'AND';
|
|
25
|
+
const OR_QUERY = 'OR';
|
|
26
|
+
|
|
27
|
+
/** Value allowed in a filter (primitive, object, or array for in/array-contains-any). */
|
|
28
|
+
|
|
29
|
+
export function Filter(fieldPath, operator, value) {
|
|
30
|
+
return new _Filter(fieldPath, operator, value);
|
|
31
|
+
}
|
|
32
|
+
export class _Filter {
|
|
33
|
+
constructor(fieldPath, operator, value, filterOperator, queries) {
|
|
34
|
+
if (filterOperator !== undefined && [AND_QUERY, OR_QUERY].includes(filterOperator)) {
|
|
35
|
+
this.operator = filterOperator;
|
|
36
|
+
this.queries = queries;
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
this.fieldPath = fieldPath ?? undefined;
|
|
40
|
+
this.operator = operator;
|
|
41
|
+
// Preserve null for == / != (required for mapFieldQuery; do not coerce to undefined)
|
|
42
|
+
this.value = value;
|
|
43
|
+
}
|
|
44
|
+
_toMap() {
|
|
45
|
+
if ([AND_QUERY, OR_QUERY].includes(this.operator)) {
|
|
46
|
+
return {
|
|
47
|
+
operator: this.operator,
|
|
48
|
+
queries: this.queries.map(query => query._toMap())
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
return {
|
|
52
|
+
fieldPath: this.fieldPath,
|
|
53
|
+
operator: this.operator,
|
|
54
|
+
value: this.value
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
Filter.and = function and(...queries) {
|
|
59
|
+
if (queries.length > 10 || queries.length < 1) {
|
|
60
|
+
throw new Error(`Expected 1-10 instances of Filter, but got ${queries.length} Filters`);
|
|
61
|
+
}
|
|
62
|
+
const validateFilters = queries.every(filter => filter instanceof _Filter);
|
|
63
|
+
if (!validateFilters) {
|
|
64
|
+
throw new Error('Expected every argument to be an instance of Filter');
|
|
65
|
+
}
|
|
66
|
+
return new _Filter(null, null, null, AND_QUERY, queries);
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
/** Serialized field filter or composite (AND/OR) for generateFilters output. */
|
|
70
|
+
|
|
71
|
+
function hasOrOperator(obj) {
|
|
72
|
+
return obj.operator === OR_QUERY || Array.isArray(obj.queries) && obj.queries.some(query => hasOrOperator(query));
|
|
73
|
+
}
|
|
74
|
+
Filter.or = function or(...queries) {
|
|
75
|
+
if (queries.length > 10 || queries.length < 1) {
|
|
76
|
+
throw new Error(`Expected 1-10 instances of Filter, but got ${queries.length} Filters`);
|
|
77
|
+
}
|
|
78
|
+
const validateFilters = queries.every(filter => filter instanceof _Filter);
|
|
79
|
+
if (!validateFilters) {
|
|
80
|
+
throw new Error('Expected every argument to be an instance of Filter');
|
|
81
|
+
}
|
|
82
|
+
if (queries.some(hasOrOperator)) {
|
|
83
|
+
throw new Error('OR Filters with nested OR Filters are not supported');
|
|
84
|
+
}
|
|
85
|
+
return new _Filter(null, null, null, OR_QUERY, queries);
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
/** Modifiers object passed to generateFilters (e.g. QueryModifiers). */
|
|
89
|
+
|
|
90
|
+
function mapFieldQuery(filterMap, modifiers) {
|
|
91
|
+
const {
|
|
92
|
+
fieldPath,
|
|
93
|
+
operator,
|
|
94
|
+
value,
|
|
95
|
+
queries
|
|
96
|
+
} = filterMap;
|
|
97
|
+
if (operator === AND_QUERY || operator === OR_QUERY) {
|
|
98
|
+
return {
|
|
99
|
+
operator,
|
|
100
|
+
queries: (queries ?? []).map(q => mapFieldQuery(q, modifiers))
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
let path;
|
|
104
|
+
if (isString(fieldPath)) {
|
|
105
|
+
try {
|
|
106
|
+
path = fromDotSeparatedString(fieldPath);
|
|
107
|
+
} catch (e) {
|
|
108
|
+
throw new Error(`first argument of Filter(*,_ , _) 'fieldPath' ${e.message}.`);
|
|
109
|
+
}
|
|
110
|
+
} else if (fieldPath !== undefined) {
|
|
111
|
+
path = fieldPath;
|
|
112
|
+
} else {
|
|
113
|
+
throw new Error("first argument of Filter(*,_ , _) 'fieldPath' is required.");
|
|
114
|
+
}
|
|
115
|
+
if (!modifiers.isValidOperator(operator)) {
|
|
116
|
+
throw new Error("second argument of Filter(*,_ , _) 'opStr' is invalid. Expected one of '==', '>', '>=', '<', '<=', '!=', 'array-contains', 'not-in', 'array-contains-any' or 'in'.");
|
|
117
|
+
}
|
|
118
|
+
if (isUndefined(value)) {
|
|
119
|
+
throw new Error("third argument of Filter(*,_ , _) 'value' argument expected.");
|
|
120
|
+
}
|
|
121
|
+
if (isNull(value) && !modifiers.isEqualOperator(operator) && !modifiers.isNotEqualOperator(operator)) {
|
|
122
|
+
throw new Error("third argument of Filter(*,_ , _) 'value' is invalid. You can only perform equals comparisons on null");
|
|
123
|
+
}
|
|
124
|
+
if (modifiers.isInOperator(operator)) {
|
|
125
|
+
if (!isArray(value) || !value.length) {
|
|
126
|
+
throw new Error(`third argument of Filter(*,_ , _) 'value' is invalid. A non-empty array is required for '${String(operator)}' filters.`);
|
|
127
|
+
}
|
|
128
|
+
if (value.length > 10) {
|
|
129
|
+
throw new Error(`third argument of Filter(*,_ , _) 'value' is invalid. '${String(operator)}' filters support a maximum of 10 elements in the value array.`);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
return {
|
|
133
|
+
fieldPath: path,
|
|
134
|
+
operator: OPERATORS[operator],
|
|
135
|
+
value: generateNativeData(value, true)
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
export function generateFilters(filter, modifiers) {
|
|
139
|
+
const filterMap = filter._toMap();
|
|
140
|
+
const queries = (filterMap.queries ?? []).map(q => mapFieldQuery(q, modifiers));
|
|
141
|
+
return {
|
|
142
|
+
operator: filterMap.operator ?? '',
|
|
143
|
+
queries
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
//# sourceMappingURL=FirestoreFilter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["isArray","isNull","isString","isUndefined","fromDotSeparatedString","OPERATORS","generateNativeData","AND_QUERY","OR_QUERY","Filter","fieldPath","operator","value","_Filter","constructor","filterOperator","queries","undefined","includes","_toMap","map","query","and","length","Error","validateFilters","every","filter","hasOrOperator","obj","Array","some","or","mapFieldQuery","filterMap","modifiers","q","path","e","message","isValidOperator","isEqualOperator","isNotEqualOperator","isInOperator","String","generateFilters"],"sourceRoot":"../../lib","sources":["FirestoreFilter.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SACEA,OAAO,EACPC,MAAM,EACNC,QAAQ,EACRC,WAAW,QACN,+CAA+C;AACtD,SAASC,sBAAsB,QAAQ,gBAAa;AACpD,SAASC,SAAS,QAAQ,8BAA2B;AACrD,SAASC,kBAAkB,QAAQ,sBAAmB;AAItD,MAAMC,SAAS,GAAG,KAAK;AACvB,MAAMC,QAAQ,GAAG,IAAI;;AAKrB;;AAGA,OAAO,SAASC,MAAMA,CACpBC,SAA6B,EAC7BC,QAA6B,EAC7BC,KAA4B,EACnB;EACT,OAAO,IAAIC,OAAO,CAACH,SAAS,EAAEC,QAAQ,EAAEC,KAAoB,CAAC;AAC/D;AAEA,OAAO,MAAMC,OAAO,CAAC;EAMnBC,WAAWA,CACTJ,SAAoC,EACpCC,QAAqD,EACrDC,KAAyB,EACzBG,cAA+B,EAC/BC,OAAmB,EACnB;IACA,IAAID,cAAc,KAAKE,SAAS,IAAI,CAACV,SAAS,EAAEC,QAAQ,CAAC,CAACU,QAAQ,CAACH,cAAc,CAAC,EAAE;MAClF,IAAI,CAACJ,QAAQ,GAAGI,cAAc;MAC9B,IAAI,CAACC,OAAO,GAAGA,OAAO;MACtB;IACF;IAEA,IAAI,CAACN,SAAS,GAAGA,SAAS,IAAIO,SAAS;IACvC,IAAI,CAACN,QAAQ,GAAGA,QAAgD;IAChE;IACA,IAAI,CAACC,KAAK,GAAGA,KAAgC;EAC/C;EAEAO,MAAMA,CAAA,EAAc;IAClB,IAAI,CAACZ,SAAS,EAAEC,QAAQ,CAAC,CAACU,QAAQ,CAAC,IAAI,CAACP,QAA0B,CAAC,EAAE;MACnE,OAAO;QACLA,QAAQ,EAAE,IAAI,CAACA,QAAQ;QACvBK,OAA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1,80 @@
|
|
|
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 { isFinite, isNumber, isUndefined, isObject } from '@react-native-firebase/app/dist/module/common';
|
|
21
|
+
export default class GeoPoint {
|
|
22
|
+
constructor(latitude, longitude) {
|
|
23
|
+
if (isUndefined(latitude) || isUndefined(longitude)) {
|
|
24
|
+
throw new Error('firebase.firestore.GeoPoint constructor expected latitude and longitude values.');
|
|
25
|
+
}
|
|
26
|
+
if (!isNumber(latitude)) {
|
|
27
|
+
throw new Error("firebase.firestore.GeoPoint 'latitude' must be a number value.");
|
|
28
|
+
}
|
|
29
|
+
if (!isNumber(longitude)) {
|
|
30
|
+
throw new Error("firebase.firestore.GeoPoint 'longitude' must be a number value.");
|
|
31
|
+
}
|
|
32
|
+
if (!isFinite(latitude) || latitude < -90 || latitude > 90) {
|
|
33
|
+
throw new Error(`firebase.firestore.GeoPoint 'latitude' must be a number between -90 and 90, but was: ${latitude}.`);
|
|
34
|
+
}
|
|
35
|
+
if (!isFinite(longitude) || longitude < -180 || longitude > 180) {
|
|
36
|
+
throw new Error(`firebase.firestore.GeoPoint 'longitude' must be a number between -180 and 180, but was: ${longitude}.`);
|
|
37
|
+
}
|
|
38
|
+
this._latitude = latitude;
|
|
39
|
+
this._longitude = longitude;
|
|
40
|
+
}
|
|
41
|
+
get latitude() {
|
|
42
|
+
return this._latitude;
|
|
43
|
+
}
|
|
44
|
+
get longitude() {
|
|
45
|
+
return this._longitude;
|
|
46
|
+
}
|
|
47
|
+
isEqual(other) {
|
|
48
|
+
if (!(other instanceof GeoPoint)) {
|
|
49
|
+
throw new Error("firebase.firestore.GeoPoint.isEqual(*) 'other' expected an instance of GeoPoint.");
|
|
50
|
+
}
|
|
51
|
+
return this._latitude === other._latitude && this._longitude === other._longitude;
|
|
52
|
+
}
|
|
53
|
+
_compareTo(other) {
|
|
54
|
+
if (this._latitude < other._latitude) return -1;
|
|
55
|
+
if (this._latitude > other._latitude) return 1;
|
|
56
|
+
if (this._longitude < other._longitude) return -1;
|
|
57
|
+
if (this._longitude > other._longitude) return 1;
|
|
58
|
+
return 0;
|
|
59
|
+
}
|
|
60
|
+
static _jsonSchemaVersion = 'firestore/geoPoint/1.0';
|
|
61
|
+
static _jsonSchema = {
|
|
62
|
+
type: GeoPoint._jsonSchemaVersion,
|
|
63
|
+
latitude: 'number',
|
|
64
|
+
longitude: 'number'
|
|
65
|
+
};
|
|
66
|
+
toJSON() {
|
|
67
|
+
return {
|
|
68
|
+
latitude: this._latitude,
|
|
69
|
+
longitude: this._longitude,
|
|
70
|
+
type: GeoPoint._jsonSchemaVersion
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
static fromJSON(json) {
|
|
74
|
+
if (isObject(json) && json.type === GeoPoint._jsonSchemaVersion && typeof json.latitude === 'number' && typeof json.longitude === 'number') {
|
|
75
|
+
return new GeoPoint(json.latitude, json.longitude);
|
|
76
|
+
}
|
|
77
|
+
throw new Error('Unexpected error creating GeoPoint from JSON.');
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=FirestoreGeoPoint.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["isFinite","isNumber","isUndefined","isObject","GeoPoint","constructor","latitude","longitude","Error","_latitude","_longitude","isEqual","other","_compareTo","_jsonSchemaVersion","_jsonSchema","type","toJSON","fromJSON","json"],"sourceRoot":"../../lib","sources":["FirestoreGeoPoint.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SACEA,QAAQ,EACRC,QAAQ,EACRC,WAAW,EACXC,QAAQ,QACH,+CAA+C;AAEtD,eAAe,MAAMC,QAAQ,CAAC;EAI5BC,WAAWA,CAACC,QAAgB,EAAEC,SAAiB,EAAE;IAC/C,IAAIL,WAAW,CAACI,QAAQ,CAAC,IAAIJ,WAAW,CAACK,SAAS,CAAC,EAAE;MACnD,MAAM,IAAIC,KAAK,CACb,iFACF,CAAC;IACH;IAEA,IAAI,CAACP,QAAQ,CAACK,QAAQ,CAAC,EAAE;MACvB,MAAM,IAAIE,KAAK,CAAC,gEAAgE,CAAC;IACnF;IAEA,IAAI,CAACP,QAAQ,CAACM,SAAS,CAAC,EAAE;MACxB,MAAM,IAAIC,KAAK,CAAC,iEAAiE,CAAC;IACpF;IAEA,IAAI,CAACR,QAAQ,CAACM,QAAQ,CAAC,IAAIA,QAAQ,GAAG,CAAC,EAAE,IAAIA,QAAQ,GAAG,EAAE,EAAE;MAC1D,MAAM,IAAIE,KAAK,CACb,wFAAwFF,QAAQ,GAClG,CAAC;IACH;IAEA,IAAI,CAACN,QAAQ,CAACO,SAAS,CAAC,IAAIA,SAAS,GAAG,CAAC,GAAG,IAAIA,SAAS,GAAG,GAAG,EAAE;MAC/D,MAAM,IAAIC,KAAK,CACb,2FAA2FD,SAAS,GACtG,CAAC;IACH;IAEA,IAAI,CAACE,SAAS,GAAGH,QAAQ;IACzB,IAAI,CAACI,UAAU,GAAGH,SAAS;EAC7B;EAEA,IAAID,QAAQA,CAAA,EAAW;IACrB,OAAO,IAAI,CAACG,SAAS;EACvB;EAEA,IAAIF,SAASA,CA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,IAAIH,QAAQ,CAChBe,IAAI,CAA0Bb,QAAQ,EACtCa,IAAI,CAA2BZ,SAClC,CAAC;IACH;IAEA,MAAM,IAAIC,KAAK,CAAC,+CAA+C,CAAC;EAClE;AACF","ignoreList":[]}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
1
3
|
/*
|
|
2
4
|
* Copyright (c) 2016-present Invertase Limited & Contributors
|
|
3
5
|
*
|
|
@@ -17,37 +19,28 @@
|
|
|
17
19
|
|
|
18
20
|
export default class FirestorePath {
|
|
19
21
|
static fromName(name) {
|
|
20
|
-
|
|
21
|
-
return new FirestorePath(parts);
|
|
22
|
+
return new FirestorePath(name.split('/'));
|
|
22
23
|
}
|
|
23
|
-
|
|
24
24
|
constructor(pathComponents = []) {
|
|
25
25
|
this._parts = pathComponents;
|
|
26
26
|
}
|
|
27
|
-
|
|
28
27
|
get id() {
|
|
29
28
|
return this._parts.length ? this._parts[this._parts.length - 1] : '';
|
|
30
29
|
}
|
|
31
|
-
|
|
32
30
|
get isDocument() {
|
|
33
31
|
return this._parts.length % 2 === 0;
|
|
34
32
|
}
|
|
35
|
-
|
|
36
33
|
get isCollection() {
|
|
37
34
|
return this._parts.length % 2 === 1;
|
|
38
35
|
}
|
|
39
|
-
|
|
40
36
|
get relativeName() {
|
|
41
37
|
return this._parts.join('/');
|
|
42
38
|
}
|
|
43
|
-
|
|
44
39
|
child(relativePath) {
|
|
45
40
|
return new FirestorePath(this._parts.concat(relativePath.split('/')));
|
|
46
41
|
}
|
|
47
|
-
|
|
48
42
|
parent() {
|
|
49
|
-
return this._parts.length > 1
|
|
50
|
-
? new FirestorePath(this._parts.slice(0, this._parts.length - 1))
|
|
51
|
-
: null;
|
|
43
|
+
return this._parts.length > 1 ? new FirestorePath(this._parts.slice(0, this._parts.length - 1)) : null;
|
|
52
44
|
}
|
|
53
45
|
}
|
|
46
|
+
//# sourceMappingURL=FirestorePath.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["FirestorePath","fromName","name","split","constructor","pathComponents","_parts","id","length","isDocument","isCollection","relativeName","join","child","relativePath","concat","parent","slice"],"sourceRoot":"../../lib","sources":["FirestorePath.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,eAAe,MAAMA,aAAa,CAAC;EACjC,OAAOC,QAAQA,CAACC,IAAY,EAAiB;IAC3C,OAAO,IAAIF,aAAa,CAACE,IAAI,CAACC,KAAK,CAAC,GAAG,CAAC,CAAC;EAC3C;EAIAC,WAAWA,CAACC,cAAwB,GAAG,EAAE,EAAE;IACzC,IAAI,CAACC,MAAM,GAAGD,cAAc;EAC9B;EAEA,IAAIE,EAAEA,CAAA,EAAW;IACf,OAAO,IAAI,CAACD,MAAM,CAACE,MAAM,GAAG,IAAI,CAACF,MAAM,CAAC,IAAI,CAACA,MAAM,CAACE,MAAM,GAAG,CAAC,CAAC,GAAI,EAAE;EACvE;EAEA,IAAIC,UAAUA,CAAA,EAAY;IACxB,OAAO,IAAI,CAACH,MAAM,CAACE,MAAM,GAAG,CAAC,KAAK,CAAC;EACrC;EAEA,IAAIE,YAAYA,CAAA,EAAY;IAC1B,OAAO,IAAI,CAACJ,MAAM,CAACE,MAAM,GAAG,CAAC,KAAK,CAAC;EACrC;EAEA,IAAIG,YAAYA,CAAA,EAAW;IACzB,OAAO,IAAI,CAACL,MAAM,CAACM,IAAI,CAAC,GAAG,CAAC;EAC9B;EAEAC,KAAKA,CAACC,YAAoB,EAAiB;IACzC,OAAO,IAAId,aAAa,CAAC,IAAI,CAACM,MAAM,CAACS,MAAM,CAACD,YAAY,CAACX,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;EACvE;EAEAa,MAAMA,CAAA,EAAyB;IAC7B,OAAO,IAAI,CAACV,MAAM,CAACE,MAAM,GAAG,CAAC,GACzB,IAAIR,aAAa,CAAC,IAAI,CAACM,MAAM,CAACW,KAAK,CAAC,CAAC,EAAE,IAAI,CAACX,MAAM,CAACE,MAAM,GAAG,CAAC,CAAC,CAAC,GAC/D,IAAI;EACV;AACF","ignoreList":[]}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
1
3
|
/*
|
|
2
4
|
* Copyright (c) 2016-present Invertase Limited & Contributors
|
|
3
5
|
*
|
|
@@ -15,20 +17,25 @@
|
|
|
15
17
|
*
|
|
16
18
|
*/
|
|
17
19
|
|
|
18
|
-
|
|
20
|
+
/**
|
|
21
|
+
* A `PersistentCacheIndexManager` for configuring persistent cache indexes used
|
|
22
|
+
* for local query execution.
|
|
23
|
+
*
|
|
24
|
+
* To use, call `getPersistentCacheIndexManager()` to get an instance.
|
|
25
|
+
*/
|
|
26
|
+
export class PersistentCacheIndexManager {
|
|
19
27
|
constructor(firestore) {
|
|
20
28
|
this._firestore = firestore;
|
|
21
29
|
}
|
|
22
|
-
|
|
23
30
|
async enableIndexAutoCreation() {
|
|
24
31
|
await this._firestore.native.persistenceCacheIndexManager(0);
|
|
25
32
|
}
|
|
26
|
-
|
|
27
33
|
async disableIndexAutoCreation() {
|
|
28
34
|
await this._firestore.native.persistenceCacheIndexManager(1);
|
|
29
35
|
}
|
|
30
|
-
|
|
31
36
|
async deleteAllIndexes() {
|
|
32
37
|
await this._firestore.native.persistenceCacheIndexManager(2);
|
|
33
38
|
}
|
|
34
39
|
}
|
|
40
|
+
export default PersistentCacheIndexManager;
|
|
41
|
+
//# sourceMappingURL=FirestorePersistentCacheIndexManager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["PersistentCacheIndexManager","constructor","firestore","_firestore","enableIndexAutoCreation","native","persistenceCacheIndexManager","disableIndexAutoCreation","deleteAllIndexes"],"sourceRoot":"../../lib","sources":["FirestorePersistentCacheIndexManager.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMA,2BAA2B,CAAC;EAGvCC,WAAWA,CAACC,SAA4B,EAAE;IACxC,IAAI,CAACC,UAAU,GAAGD,SAAS;EAC7B;EAEA,MAAME,uBAAuBA,CAAA,EAAkB;IAC7C,MAAM,IAAI,CAACD,UAAU,CAACE,MAAM,CAACC,4BAA4B,CAAC,CAAC,CAAC;EAC9D;EAEA,MAAMC,wBAAwBA,CAAA,EAAkB;IAC9C,MAAM,IAAI,CAACJ,UAAU,CAACE,MAAM,CAACC,4BAA4B,CAAC,CAAC,CAAC;EAC9D;EAEA,MAAME,gBAAgBA,CAAA,EAAkB;IACtC,MAAM,IAAI,CAACL,UAAU,CAACE,MAAM,CAACC,4BAA4B,CAAC,CAAC,CAAC;EAC9D;AACF;AAEA,eAAeN,2BAA2B","ignoreList":[]}
|