@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
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2016-present Invertase Limited & Contributors
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this library except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
import type {
|
|
19
|
+
FirestorePipelineSerializedInternal,
|
|
20
|
+
FirestorePipelineSerializedValueInternal,
|
|
21
|
+
} from '../types/internal';
|
|
22
|
+
|
|
23
|
+
export const PIPELINE_SOURCE_TYPES = [
|
|
24
|
+
'collection',
|
|
25
|
+
'collectionGroup',
|
|
26
|
+
'database',
|
|
27
|
+
'documents',
|
|
28
|
+
'query',
|
|
29
|
+
] as const;
|
|
30
|
+
|
|
31
|
+
export const PIPELINE_STAGE_TYPES = [
|
|
32
|
+
'where',
|
|
33
|
+
'select',
|
|
34
|
+
'addFields',
|
|
35
|
+
'removeFields',
|
|
36
|
+
'sort',
|
|
37
|
+
'limit',
|
|
38
|
+
'offset',
|
|
39
|
+
'aggregate',
|
|
40
|
+
'distinct',
|
|
41
|
+
'findNearest',
|
|
42
|
+
'replaceWith',
|
|
43
|
+
'sample',
|
|
44
|
+
'union',
|
|
45
|
+
'unnest',
|
|
46
|
+
'rawStage',
|
|
47
|
+
] as const;
|
|
48
|
+
|
|
49
|
+
export const PIPELINE_UNSUPPORTED_BASE_MESSAGE =
|
|
50
|
+
'Some Firestore pipeline features are not supported by this native implementation yet.';
|
|
51
|
+
|
|
52
|
+
// Keep this in sync with iOS native support in
|
|
53
|
+
// `RNFBFirestorePipelineNodeBuilder.swift`.
|
|
54
|
+
// Remove entries once the iOS node builder/runtime path supports them.
|
|
55
|
+
const IOS_UNSUPPORTED_FUNCTION_NAMES = new Set<string>([
|
|
56
|
+
'arrayGet',
|
|
57
|
+
'conditional',
|
|
58
|
+
'round',
|
|
59
|
+
'stringRepeat',
|
|
60
|
+
'substring',
|
|
61
|
+
'timestampAdd',
|
|
62
|
+
'timestampSubtract',
|
|
63
|
+
'trunc',
|
|
64
|
+
]);
|
|
65
|
+
|
|
66
|
+
export function createPipelineUnsupportedMessage(
|
|
67
|
+
pipeline?: FirestorePipelineSerializedInternal | null,
|
|
68
|
+
): string {
|
|
69
|
+
const firstStage = pipeline?.stages?.[0];
|
|
70
|
+
if (firstStage?.stage && typeof firstStage.stage === 'string') {
|
|
71
|
+
return `${PIPELINE_UNSUPPORTED_BASE_MESSAGE} Unsupported stage: ${firstStage.stage}.`;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
const source = pipeline?.source?.source;
|
|
75
|
+
if (source && typeof source === 'string') {
|
|
76
|
+
return `${PIPELINE_UNSUPPORTED_BASE_MESSAGE} Unsupported source: ${source}.`;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
return PIPELINE_UNSUPPORTED_BASE_MESSAGE;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export function getIOSUnsupportedPipelineFunctions(
|
|
83
|
+
pipeline?: FirestorePipelineSerializedInternal | null,
|
|
84
|
+
): string[] {
|
|
85
|
+
if (!pipeline) {
|
|
86
|
+
return [];
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
const unsupported = new Set<string>();
|
|
90
|
+
collectIOSUnsupportedFunctions(
|
|
91
|
+
pipeline as unknown as FirestorePipelineSerializedValueInternal,
|
|
92
|
+
unsupported,
|
|
93
|
+
);
|
|
94
|
+
return Array.from(unsupported).sort();
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
function collectIOSUnsupportedFunctions(
|
|
98
|
+
value: FirestorePipelineSerializedValueInternal,
|
|
99
|
+
unsupported: Set<string>,
|
|
100
|
+
): void {
|
|
101
|
+
if (Array.isArray(value)) {
|
|
102
|
+
value.forEach(entry => collectIOSUnsupportedFunctions(entry, unsupported));
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
if (!value || typeof value !== 'object') {
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
const objectValue = value as Record<string, unknown>;
|
|
111
|
+
|
|
112
|
+
if (isSerializedFunctionExpression(objectValue)) {
|
|
113
|
+
if (IOS_UNSUPPORTED_FUNCTION_NAMES.has(objectValue.name)) {
|
|
114
|
+
unsupported.add(objectValue.name);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
if (Array.isArray(objectValue.args)) {
|
|
118
|
+
objectValue.args.forEach(entry => collectIOSUnsupportedFunctions(entry, unsupported));
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
Object.values(objectValue).forEach(entry => {
|
|
123
|
+
collectIOSUnsupportedFunctions(entry as FirestorePipelineSerializedValueInternal, unsupported);
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
function isSerializedFunctionExpression(
|
|
128
|
+
value: Record<string, unknown>,
|
|
129
|
+
): value is { name: string; args?: FirestorePipelineSerializedValueInternal[] } {
|
|
130
|
+
return (
|
|
131
|
+
typeof value.name === 'string' &&
|
|
132
|
+
(value.exprType === 'Function' || value.__kind === 'expression')
|
|
133
|
+
);
|
|
134
|
+
}
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2016-present Invertase Limited & Contributors
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
import type {
|
|
19
|
+
FirestorePipelineExecuteOptionsInternal,
|
|
20
|
+
FirestorePipelineSerializedInternal,
|
|
21
|
+
FirestorePipelineSourceInternal,
|
|
22
|
+
} from '../types/internal';
|
|
23
|
+
|
|
24
|
+
export interface ValidatedPipelineExecuteRequest {
|
|
25
|
+
pipeline: FirestorePipelineSerializedInternal;
|
|
26
|
+
options?: FirestorePipelineExecuteOptionsInternal;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function isRecord(value: unknown): value is Record<string, unknown> {
|
|
30
|
+
return value !== null && typeof value === 'object' && !Array.isArray(value);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function isNonEmptyString(value: unknown): value is string {
|
|
34
|
+
return typeof value === 'string' && value.length > 0;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function validateNonEmptyStringArray(value: unknown, fieldName: string): void {
|
|
38
|
+
if (!Array.isArray(value) || value.length === 0) {
|
|
39
|
+
throw new Error(`pipelineExecute() expected ${fieldName} to contain at least one value.`);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
if (!value.every(isNonEmptyString)) {
|
|
43
|
+
throw new Error(`pipelineExecute() expected ${fieldName} to contain only non-empty strings.`);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function validateSource(
|
|
48
|
+
source: unknown,
|
|
49
|
+
fieldName: string = 'pipeline.source',
|
|
50
|
+
): asserts source is FirestorePipelineSourceInternal {
|
|
51
|
+
if (!isRecord(source)) {
|
|
52
|
+
throw new Error(`pipelineExecute() expected ${fieldName} to be an object.`);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
switch (source.source) {
|
|
56
|
+
case 'collection':
|
|
57
|
+
if (!isNonEmptyString(source.path)) {
|
|
58
|
+
throw new Error(`pipelineExecute() expected ${fieldName}.path to be a non-empty string.`);
|
|
59
|
+
}
|
|
60
|
+
return;
|
|
61
|
+
case 'collectionGroup':
|
|
62
|
+
if (!isNonEmptyString(source.collectionId)) {
|
|
63
|
+
throw new Error(
|
|
64
|
+
`pipelineExecute() expected ${fieldName}.collectionId to be a non-empty string.`,
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
return;
|
|
68
|
+
case 'database':
|
|
69
|
+
return;
|
|
70
|
+
case 'documents':
|
|
71
|
+
validateNonEmptyStringArray(source.documents, `${fieldName}.documents`);
|
|
72
|
+
return;
|
|
73
|
+
case 'query':
|
|
74
|
+
if (!isNonEmptyString(source.path)) {
|
|
75
|
+
throw new Error(`pipelineExecute() expected ${fieldName}.path to be a non-empty string.`);
|
|
76
|
+
}
|
|
77
|
+
if (!isNonEmptyString(source.queryType)) {
|
|
78
|
+
throw new Error(
|
|
79
|
+
`pipelineExecute() expected ${fieldName}.queryType to be a non-empty string.`,
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
if (!Array.isArray(source.filters)) {
|
|
83
|
+
throw new Error(`pipelineExecute() expected ${fieldName}.filters to be an array.`);
|
|
84
|
+
}
|
|
85
|
+
if (!Array.isArray(source.orders)) {
|
|
86
|
+
throw new Error(`pipelineExecute() expected ${fieldName}.orders to be an array.`);
|
|
87
|
+
}
|
|
88
|
+
if (!isRecord(source.options)) {
|
|
89
|
+
throw new Error(`pipelineExecute() expected ${fieldName}.options to be an object.`);
|
|
90
|
+
}
|
|
91
|
+
return;
|
|
92
|
+
default:
|
|
93
|
+
throw new Error('pipelineExecute() received an unknown source type.');
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
function validateNonEmptyStageArray(value: unknown, fieldName: string): void {
|
|
98
|
+
if (!Array.isArray(value) || value.length === 0) {
|
|
99
|
+
throw new Error(`pipelineExecute() expected ${fieldName} to contain at least one value.`);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
function validateStage(stage: unknown, stagePath: string, optionsPath: string): unknown {
|
|
104
|
+
if (!isRecord(stage) || typeof stage.stage !== 'string' || !isRecord(stage.options)) {
|
|
105
|
+
throw new Error(`pipelineExecute() expected ${stagePath} to include stage and options.`);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
switch (stage.stage) {
|
|
109
|
+
case 'select':
|
|
110
|
+
validateNonEmptyStageArray(stage.options.selections, `${optionsPath}.selections`);
|
|
111
|
+
return undefined;
|
|
112
|
+
case 'addFields':
|
|
113
|
+
validateNonEmptyStageArray(stage.options.fields, `${optionsPath}.fields`);
|
|
114
|
+
return undefined;
|
|
115
|
+
case 'removeFields':
|
|
116
|
+
validateNonEmptyStageArray(stage.options.fields, `${optionsPath}.fields`);
|
|
117
|
+
return undefined;
|
|
118
|
+
case 'sort':
|
|
119
|
+
validateNonEmptyStageArray(stage.options.orderings, `${optionsPath}.orderings`);
|
|
120
|
+
return undefined;
|
|
121
|
+
case 'aggregate':
|
|
122
|
+
validateNonEmptyStageArray(stage.options.accumulators, `${optionsPath}.accumulators`);
|
|
123
|
+
return undefined;
|
|
124
|
+
case 'distinct':
|
|
125
|
+
validateNonEmptyStageArray(stage.options.groups, `${optionsPath}.groups`);
|
|
126
|
+
return undefined;
|
|
127
|
+
case 'sample': {
|
|
128
|
+
const hasDocuments = typeof stage.options.documents === 'number';
|
|
129
|
+
const hasPercentage = typeof stage.options.percentage === 'number';
|
|
130
|
+
if (!hasDocuments && !hasPercentage) {
|
|
131
|
+
throw new Error(
|
|
132
|
+
'pipelineExecute() expected sample stage to include documents or percentage.',
|
|
133
|
+
);
|
|
134
|
+
}
|
|
135
|
+
return undefined;
|
|
136
|
+
}
|
|
137
|
+
case 'union':
|
|
138
|
+
if (
|
|
139
|
+
!isRecord(stage.options.other) ||
|
|
140
|
+
!isRecord(stage.options.other.source) ||
|
|
141
|
+
!Array.isArray(stage.options.other.stages)
|
|
142
|
+
) {
|
|
143
|
+
throw new Error(
|
|
144
|
+
'pipelineExecute() expected stage.options.other to be a serialized pipeline object.',
|
|
145
|
+
);
|
|
146
|
+
}
|
|
147
|
+
return stage.options.other;
|
|
148
|
+
case 'where':
|
|
149
|
+
case 'limit':
|
|
150
|
+
case 'offset':
|
|
151
|
+
case 'findNearest':
|
|
152
|
+
case 'replaceWith':
|
|
153
|
+
case 'unnest':
|
|
154
|
+
case 'rawStage':
|
|
155
|
+
return undefined;
|
|
156
|
+
default:
|
|
157
|
+
throw new Error(`pipelineExecute() received an unknown stage: ${stage.stage}.`);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
export function validateSerializedPipeline(
|
|
162
|
+
pipeline: unknown,
|
|
163
|
+
fieldName: string = 'pipeline',
|
|
164
|
+
): asserts pipeline is FirestorePipelineSerializedInternal {
|
|
165
|
+
const pending: Array<{ pipeline: unknown; fieldName: string }> = [{ pipeline, fieldName }];
|
|
166
|
+
|
|
167
|
+
for (let index = 0; index < pending.length; index++) {
|
|
168
|
+
const current = pending[index]!;
|
|
169
|
+
if (!isRecord(current.pipeline)) {
|
|
170
|
+
throw new Error(`pipelineExecute() expected ${current.fieldName} to be an object.`);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
validateSource(current.pipeline.source, `${current.fieldName}.source`);
|
|
174
|
+
|
|
175
|
+
if (!Array.isArray(current.pipeline.stages)) {
|
|
176
|
+
throw new Error(`pipelineExecute() expected ${current.fieldName}.stages to be an array.`);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
for (let i = 0; i < current.pipeline.stages.length; i++) {
|
|
180
|
+
const optionsPath =
|
|
181
|
+
current.fieldName === 'pipeline'
|
|
182
|
+
? 'stage.options'
|
|
183
|
+
: `${current.fieldName}.stages[${i}].options`;
|
|
184
|
+
const nestedPipeline = validateStage(
|
|
185
|
+
current.pipeline.stages[i],
|
|
186
|
+
`${current.fieldName}.stages[${i}]`,
|
|
187
|
+
optionsPath,
|
|
188
|
+
);
|
|
189
|
+
if (nestedPipeline) {
|
|
190
|
+
pending.push({
|
|
191
|
+
pipeline: nestedPipeline,
|
|
192
|
+
fieldName: `${optionsPath}.other`,
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
export function validateExecuteOptions(
|
|
200
|
+
options: unknown,
|
|
201
|
+
): FirestorePipelineExecuteOptionsInternal | undefined {
|
|
202
|
+
if (options === undefined) {
|
|
203
|
+
return undefined;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
if (!isRecord(options)) {
|
|
207
|
+
throw new Error('pipelineExecute() expected options to be an object.');
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
if (options.indexMode !== undefined && options.indexMode !== 'recommended') {
|
|
211
|
+
throw new Error('pipelineExecute() expected options.indexMode to equal "recommended".');
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
if (options.indexMode !== undefined) {
|
|
215
|
+
throw new Error(
|
|
216
|
+
'pipelineExecute() does not support options.indexMode because Firestore pipeline execute options are currently unstable or unavailable.',
|
|
217
|
+
);
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
if (options.rawOptions !== undefined && !isRecord(options.rawOptions)) {
|
|
221
|
+
throw new Error('pipelineExecute() expected options.rawOptions to be an object.');
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
if (options.rawOptions !== undefined) {
|
|
225
|
+
throw new Error(
|
|
226
|
+
'pipelineExecute() does not support options.rawOptions because Firestore pipeline execute options are currently unstable or unavailable.',
|
|
227
|
+
);
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
return options as FirestorePipelineExecuteOptionsInternal;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
export function validatePipelineExecuteRequest(
|
|
234
|
+
pipeline: unknown,
|
|
235
|
+
options: unknown,
|
|
236
|
+
): ValidatedPipelineExecuteRequest {
|
|
237
|
+
validateSerializedPipeline(pipeline);
|
|
238
|
+
return {
|
|
239
|
+
pipeline,
|
|
240
|
+
options: validateExecuteOptions(options),
|
|
241
|
+
};
|
|
242
|
+
}
|