From bf8680cce35f0b4da9e3d52dc5e61222596f81b6 Mon Sep 17 00:00:00 2001 From: Gijs van Veen Date: Fri, 30 Aug 2024 12:20:04 +0200 Subject: [PATCH] Add support for customizing encoding behaviour when updating Values at paths --- .../api/android/firebase-common.api | 17 --- firebase-common/api/jvm/firebase-common.api | 17 --- .../api/android/firebase-firestore.api | 130 +++++++++++------- .../api/jvm/firebase-firestore.api | 130 +++++++++++------- .../firebase/firestore/EncodableValue.kt | 13 ++ .../dev/gitlive/firebase/firestore/Filter.kt | 80 +++++------ .../gitlive/firebase/firestore/firestore.kt | 72 ++++++++-- .../dev/gitlive/firebase/firestore/helpers.kt | 18 +-- .../gitlive/firebase/firestore/firestore.kt | 5 +- 9 files changed, 288 insertions(+), 194 deletions(-) create mode 100644 firebase-firestore/src/commonMain/kotlin/dev/gitlive/firebase/firestore/EncodableValue.kt diff --git a/firebase-common/api/android/firebase-common.api b/firebase-common/api/android/firebase-common.api index 9724b86d4..14df6bc61 100644 --- a/firebase-common/api/android/firebase-common.api +++ b/firebase-common/api/android/firebase-common.api @@ -51,20 +51,3 @@ public final class dev/gitlive/firebase/FirebaseEncoder$DefaultImpls { public static fun encodeSerializableValue (Ldev/gitlive/firebase/FirebaseEncoder;Lkotlinx/serialization/SerializationStrategy;Ljava/lang/Object;)V } -public final class dev/gitlive/firebase/ValueWithSerializer { - public fun (Ljava/lang/Object;Lkotlinx/serialization/SerializationStrategy;)V - public final fun component1 ()Ljava/lang/Object; - public final fun component2 ()Lkotlinx/serialization/SerializationStrategy; - public final fun copy (Ljava/lang/Object;Lkotlinx/serialization/SerializationStrategy;)Ldev/gitlive/firebase/ValueWithSerializer; - public static synthetic fun copy$default (Ldev/gitlive/firebase/ValueWithSerializer;Ljava/lang/Object;Lkotlinx/serialization/SerializationStrategy;ILjava/lang/Object;)Ldev/gitlive/firebase/ValueWithSerializer; - public fun equals (Ljava/lang/Object;)Z - public final fun getSerializer ()Lkotlinx/serialization/SerializationStrategy; - public final fun getValue ()Ljava/lang/Object; - public fun hashCode ()I - public fun toString ()Ljava/lang/String; -} - -public final class dev/gitlive/firebase/ValueWithSerializerKt { - public static final fun withSerializer (Ljava/lang/Object;Lkotlinx/serialization/SerializationStrategy;)Ljava/lang/Object; -} - diff --git a/firebase-common/api/jvm/firebase-common.api b/firebase-common/api/jvm/firebase-common.api index 9724b86d4..14df6bc61 100644 --- a/firebase-common/api/jvm/firebase-common.api +++ b/firebase-common/api/jvm/firebase-common.api @@ -51,20 +51,3 @@ public final class dev/gitlive/firebase/FirebaseEncoder$DefaultImpls { public static fun encodeSerializableValue (Ldev/gitlive/firebase/FirebaseEncoder;Lkotlinx/serialization/SerializationStrategy;Ljava/lang/Object;)V } -public final class dev/gitlive/firebase/ValueWithSerializer { - public fun (Ljava/lang/Object;Lkotlinx/serialization/SerializationStrategy;)V - public final fun component1 ()Ljava/lang/Object; - public final fun component2 ()Lkotlinx/serialization/SerializationStrategy; - public final fun copy (Ljava/lang/Object;Lkotlinx/serialization/SerializationStrategy;)Ldev/gitlive/firebase/ValueWithSerializer; - public static synthetic fun copy$default (Ldev/gitlive/firebase/ValueWithSerializer;Ljava/lang/Object;Lkotlinx/serialization/SerializationStrategy;ILjava/lang/Object;)Ldev/gitlive/firebase/ValueWithSerializer; - public fun equals (Ljava/lang/Object;)Z - public final fun getSerializer ()Lkotlinx/serialization/SerializationStrategy; - public final fun getValue ()Ljava/lang/Object; - public fun hashCode ()I - public fun toString ()Ljava/lang/String; -} - -public final class dev/gitlive/firebase/ValueWithSerializerKt { - public static final fun withSerializer (Ljava/lang/Object;Lkotlinx/serialization/SerializationStrategy;)Ljava/lang/Object; -} - diff --git a/firebase-firestore/api/android/firebase-firestore.api b/firebase-firestore/api/android/firebase-firestore.api index 8a0aa2e9a..9dea82602 100644 --- a/firebase-firestore/api/android/firebase-firestore.api +++ b/firebase-firestore/api/android/firebase-firestore.api @@ -76,8 +76,12 @@ public final class dev/gitlive/firebase/firestore/DocumentReference { public final fun updateEncodedFieldsAndValues (Ljava/util/List;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public final fun updateFieldPaths ([Lkotlin/Pair;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static synthetic fun updateFieldPaths$default (Ldev/gitlive/firebase/firestore/DocumentReference;[Lkotlin/Pair;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; + public final fun updateFieldPathsWithEncodableValue ([Lkotlin/Pair;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static synthetic fun updateFieldPathsWithEncodableValue$default (Ldev/gitlive/firebase/firestore/DocumentReference;[Lkotlin/Pair;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; public final fun updateFields ([Lkotlin/Pair;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static synthetic fun updateFields$default (Ldev/gitlive/firebase/firestore/DocumentReference;[Lkotlin/Pair;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; + public final fun updateFieldsWithEncodableValues ([Lkotlin/Pair;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static synthetic fun updateFieldsWithEncodableValues$default (Ldev/gitlive/firebase/firestore/DocumentReference;[Lkotlin/Pair;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; } public final class dev/gitlive/firebase/firestore/DocumentReference$Companion { @@ -131,6 +135,21 @@ public final class dev/gitlive/firebase/firestore/DoubleAsTimestampSerializer : public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V } +public final class dev/gitlive/firebase/firestore/EncodableValue { + public fun (Lkotlin/jvm/functions/Function1;)V + public final fun component1 ()Lkotlin/jvm/functions/Function1; + public final fun copy (Lkotlin/jvm/functions/Function1;)Ldev/gitlive/firebase/firestore/EncodableValue; + public static synthetic fun copy$default (Ldev/gitlive/firebase/firestore/EncodableValue;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Ldev/gitlive/firebase/firestore/EncodableValue; + public fun equals (Ljava/lang/Object;)Z + public final fun getEncoded ()Lkotlin/jvm/functions/Function1; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public final class dev/gitlive/firebase/firestore/EncodableValueKt { + public static final fun encodableWithStrategy (Ljava/lang/Object;Lkotlinx/serialization/SerializationStrategy;)Ldev/gitlive/firebase/firestore/EncodableValue; +} + public final class dev/gitlive/firebase/firestore/FieldPath { public static final field Companion Ldev/gitlive/firebase/firestore/FieldPath$Companion; public fun ([Ljava/lang/String;)V @@ -182,6 +201,7 @@ public final class dev/gitlive/firebase/firestore/Filter$And : dev/gitlive/fireb } public final class dev/gitlive/firebase/firestore/Filter$Field : dev/gitlive/firebase/firestore/Filter$WithConstraint { + public fun (Ljava/lang/String;Ldev/gitlive/firebase/firestore/WhereConstraint;)V public final fun component1 ()Ljava/lang/String; public final fun component2 ()Ldev/gitlive/firebase/firestore/WhereConstraint; public fun equals (Ljava/lang/Object;)Z @@ -200,6 +220,7 @@ public final class dev/gitlive/firebase/firestore/Filter$Or : dev/gitlive/fireba } public final class dev/gitlive/firebase/firestore/Filter$Path : dev/gitlive/firebase/firestore/Filter$WithConstraint { + public fun (Ldev/gitlive/firebase/firestore/FieldPath;Ldev/gitlive/firebase/firestore/WhereConstraint;)V public final fun component1 ()Ldev/gitlive/firebase/firestore/FieldPath; public final fun component2 ()Ldev/gitlive/firebase/firestore/WhereConstraint; public fun equals (Ljava/lang/Object;)Z @@ -217,27 +238,33 @@ public final class dev/gitlive/firebase/firestore/FilterBuilder { public final fun all ([Ldev/gitlive/firebase/firestore/Filter;)Ldev/gitlive/firebase/firestore/Filter; public final fun and (Ldev/gitlive/firebase/firestore/Filter;Ldev/gitlive/firebase/firestore/Filter;)Ldev/gitlive/firebase/firestore/Filter$And; public final fun any ([Ldev/gitlive/firebase/firestore/Filter;)Ldev/gitlive/firebase/firestore/Filter; - public final fun contains (Ldev/gitlive/firebase/firestore/FieldPath;Ljava/lang/Object;)Ldev/gitlive/firebase/firestore/Filter$WithConstraint; - public final fun contains (Ljava/lang/String;Ljava/lang/Object;)Ldev/gitlive/firebase/firestore/Filter$WithConstraint; - public final fun containsAny (Ldev/gitlive/firebase/firestore/FieldPath;Ljava/util/List;)Ldev/gitlive/firebase/firestore/Filter$WithConstraint; - public final fun containsAny (Ljava/lang/String;Ljava/util/List;)Ldev/gitlive/firebase/firestore/Filter$WithConstraint; - public final fun equalTo (Ldev/gitlive/firebase/firestore/FieldPath;Ljava/lang/Object;)Ldev/gitlive/firebase/firestore/Filter$WithConstraint; - public final fun equalTo (Ljava/lang/String;Ljava/lang/Object;)Ldev/gitlive/firebase/firestore/Filter$WithConstraint; - public final fun greaterThan (Ldev/gitlive/firebase/firestore/FieldPath;Ljava/lang/Object;)Ldev/gitlive/firebase/firestore/Filter$WithConstraint; - public final fun greaterThan (Ljava/lang/String;Ljava/lang/Object;)Ldev/gitlive/firebase/firestore/Filter$WithConstraint; - public final fun greaterThanOrEqualTo (Ldev/gitlive/firebase/firestore/FieldPath;Ljava/lang/Object;)Ldev/gitlive/firebase/firestore/Filter$WithConstraint; - public final fun greaterThanOrEqualTo (Ljava/lang/String;Ljava/lang/Object;)Ldev/gitlive/firebase/firestore/Filter$WithConstraint; - public final fun inArray (Ldev/gitlive/firebase/firestore/FieldPath;Ljava/util/List;)Ldev/gitlive/firebase/firestore/Filter$WithConstraint; - public final fun inArray (Ljava/lang/String;Ljava/util/List;)Ldev/gitlive/firebase/firestore/Filter$WithConstraint; - public final fun lessThan (Ldev/gitlive/firebase/firestore/FieldPath;Ljava/lang/Object;)Ldev/gitlive/firebase/firestore/Filter$WithConstraint; - public final fun lessThan (Ljava/lang/String;Ljava/lang/Object;)Ldev/gitlive/firebase/firestore/Filter$WithConstraint; - public final fun lessThanOrEqualTo (Ldev/gitlive/firebase/firestore/FieldPath;Ljava/lang/Object;)Ldev/gitlive/firebase/firestore/Filter$WithConstraint; - public final fun lessThanOrEqualTo (Ljava/lang/String;Ljava/lang/Object;)Ldev/gitlive/firebase/firestore/Filter$WithConstraint; - public final fun notEqualTo (Ldev/gitlive/firebase/firestore/FieldPath;Ljava/lang/Object;)Ldev/gitlive/firebase/firestore/Filter$WithConstraint; - public final fun notEqualTo (Ljava/lang/String;Ljava/lang/Object;)Ldev/gitlive/firebase/firestore/Filter$WithConstraint; - public final fun notInArray (Ldev/gitlive/firebase/firestore/FieldPath;Ljava/util/List;)Ldev/gitlive/firebase/firestore/Filter$WithConstraint; - public final fun notInArray (Ljava/lang/String;Ljava/util/List;)Ldev/gitlive/firebase/firestore/Filter$WithConstraint; + public final fun contains (Ldev/gitlive/firebase/firestore/FieldPath;Lkotlinx/serialization/SerializationStrategy;Ljava/lang/Object;)Ldev/gitlive/firebase/firestore/Filter$WithConstraint; + public final fun contains (Ljava/lang/String;Lkotlinx/serialization/SerializationStrategy;Ljava/lang/Object;)Ldev/gitlive/firebase/firestore/Filter$WithConstraint; + public final fun containsAny (Ldev/gitlive/firebase/firestore/FieldPath;Lkotlinx/serialization/SerializationStrategy;Ljava/util/List;)Ldev/gitlive/firebase/firestore/Filter$WithConstraint; + public final fun containsAny (Ljava/lang/String;Lkotlinx/serialization/SerializationStrategy;Ljava/util/List;)Ldev/gitlive/firebase/firestore/Filter$WithConstraint; + public final fun equalTo (Ldev/gitlive/firebase/firestore/FieldPath;Lkotlinx/serialization/SerializationStrategy;Ljava/lang/Object;)Ldev/gitlive/firebase/firestore/Filter$WithConstraint; + public final fun equalTo (Ljava/lang/String;Lkotlinx/serialization/SerializationStrategy;Ljava/lang/Object;)Ldev/gitlive/firebase/firestore/Filter$WithConstraint; + public final fun getBuildSettings ()Lkotlin/jvm/functions/Function1; + public final fun greaterThan (Ldev/gitlive/firebase/firestore/FieldPath;Lkotlinx/serialization/SerializationStrategy;Ljava/lang/Object;)Ldev/gitlive/firebase/firestore/Filter$WithConstraint; + public final fun greaterThan (Ljava/lang/String;Lkotlinx/serialization/SerializationStrategy;Ljava/lang/Object;)Ldev/gitlive/firebase/firestore/Filter$WithConstraint; + public final fun greaterThanOrEqualTo (Ldev/gitlive/firebase/firestore/FieldPath;Lkotlinx/serialization/SerializationStrategy;Ljava/lang/Object;)Ldev/gitlive/firebase/firestore/Filter$WithConstraint; + public final fun greaterThanOrEqualTo (Ljava/lang/String;Lkotlinx/serialization/SerializationStrategy;Ljava/lang/Object;)Ldev/gitlive/firebase/firestore/Filter$WithConstraint; + public final fun inArray (Ldev/gitlive/firebase/firestore/FieldPath;Lkotlinx/serialization/SerializationStrategy;Ljava/util/List;)Ldev/gitlive/firebase/firestore/Filter$WithConstraint; + public final fun inArray (Ljava/lang/String;Lkotlinx/serialization/SerializationStrategy;Ljava/util/List;)Ldev/gitlive/firebase/firestore/Filter$WithConstraint; + public final fun isNotNull (Ldev/gitlive/firebase/firestore/FieldPath;)Ldev/gitlive/firebase/firestore/Filter$WithConstraint; + public final fun isNotNull (Ljava/lang/String;)Ldev/gitlive/firebase/firestore/Filter$WithConstraint; + public final fun isNull (Ldev/gitlive/firebase/firestore/FieldPath;)Ldev/gitlive/firebase/firestore/Filter$WithConstraint; + public final fun isNull (Ljava/lang/String;)Ldev/gitlive/firebase/firestore/Filter$WithConstraint; + public final fun lessThan (Ldev/gitlive/firebase/firestore/FieldPath;Lkotlinx/serialization/SerializationStrategy;Ljava/lang/Object;)Ldev/gitlive/firebase/firestore/Filter$WithConstraint; + public final fun lessThan (Ljava/lang/String;Lkotlinx/serialization/SerializationStrategy;Ljava/lang/Object;)Ldev/gitlive/firebase/firestore/Filter$WithConstraint; + public final fun lessThanOrEqualTo (Ldev/gitlive/firebase/firestore/FieldPath;Lkotlinx/serialization/SerializationStrategy;Ljava/lang/Object;)Ldev/gitlive/firebase/firestore/Filter$WithConstraint; + public final fun lessThanOrEqualTo (Ljava/lang/String;Lkotlinx/serialization/SerializationStrategy;Ljava/lang/Object;)Ldev/gitlive/firebase/firestore/Filter$WithConstraint; + public final fun notEqualTo (Ldev/gitlive/firebase/firestore/FieldPath;Lkotlinx/serialization/SerializationStrategy;Ljava/lang/Object;)Ldev/gitlive/firebase/firestore/Filter$WithConstraint; + public final fun notEqualTo (Ljava/lang/String;Lkotlinx/serialization/SerializationStrategy;Ljava/lang/Object;)Ldev/gitlive/firebase/firestore/Filter$WithConstraint; + public final fun notInArray (Ldev/gitlive/firebase/firestore/FieldPath;Lkotlinx/serialization/SerializationStrategy;Ljava/util/List;)Ldev/gitlive/firebase/firestore/Filter$WithConstraint; + public final fun notInArray (Ljava/lang/String;Lkotlinx/serialization/SerializationStrategy;Ljava/util/List;)Ldev/gitlive/firebase/firestore/Filter$WithConstraint; public final fun or (Ldev/gitlive/firebase/firestore/Filter;Ldev/gitlive/firebase/firestore/Filter;)Ldev/gitlive/firebase/firestore/Filter$Or; + public final fun setBuildSettings (Lkotlin/jvm/functions/Function1;)V } public final class dev/gitlive/firebase/firestore/FirebaseFirestore { @@ -424,9 +451,15 @@ public final class dev/gitlive/firebase/firestore/MemoryGarbageCollectorSettings public class dev/gitlive/firebase/firestore/Query { public static final field Companion Ldev/gitlive/firebase/firestore/Query$Companion; public final fun endAt (Ldev/gitlive/firebase/firestore/DocumentSnapshot;)Ldev/gitlive/firebase/firestore/Query; - public final fun endAt ([Ljava/lang/Object;)Ldev/gitlive/firebase/firestore/Query; + public final fun endAt ([Ljava/lang/Object;Lkotlin/jvm/functions/Function1;)Ldev/gitlive/firebase/firestore/Query; + public static synthetic fun endAt$default (Ldev/gitlive/firebase/firestore/Query;[Ljava/lang/Object;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Ldev/gitlive/firebase/firestore/Query; + public final fun endAtWithEncodableValue ([Ldev/gitlive/firebase/firestore/EncodableValue;Lkotlin/jvm/functions/Function1;)Ldev/gitlive/firebase/firestore/Query; + public static synthetic fun endAtWithEncodableValue$default (Ldev/gitlive/firebase/firestore/Query;[Ldev/gitlive/firebase/firestore/EncodableValue;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Ldev/gitlive/firebase/firestore/Query; public final fun endBefore (Ldev/gitlive/firebase/firestore/DocumentSnapshot;)Ldev/gitlive/firebase/firestore/Query; - public final fun endBefore ([Ljava/lang/Object;)Ldev/gitlive/firebase/firestore/Query; + public final fun endBefore ([Ljava/lang/Object;Lkotlin/jvm/functions/Function1;)Ldev/gitlive/firebase/firestore/Query; + public static synthetic fun endBefore$default (Ldev/gitlive/firebase/firestore/Query;[Ljava/lang/Object;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Ldev/gitlive/firebase/firestore/Query; + public final fun endBeforeWithEncodableValue ([Ldev/gitlive/firebase/firestore/EncodableValue;Lkotlin/jvm/functions/Function1;)Ldev/gitlive/firebase/firestore/Query; + public static synthetic fun endBeforeWithEncodableValue$default (Ldev/gitlive/firebase/firestore/Query;[Ldev/gitlive/firebase/firestore/EncodableValue;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Ldev/gitlive/firebase/firestore/Query; public final fun get (Ldev/gitlive/firebase/firestore/Source;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static synthetic fun get$default (Ldev/gitlive/firebase/firestore/Query;Ldev/gitlive/firebase/firestore/Source;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; public final fun getSnapshots ()Lkotlinx/coroutines/flow/Flow; @@ -438,9 +471,15 @@ public class dev/gitlive/firebase/firestore/Query { public final fun snapshots (Z)Lkotlinx/coroutines/flow/Flow; public static synthetic fun snapshots$default (Ldev/gitlive/firebase/firestore/Query;ZILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow; public final fun startAfter (Ldev/gitlive/firebase/firestore/DocumentSnapshot;)Ldev/gitlive/firebase/firestore/Query; - public final fun startAfter ([Ljava/lang/Object;)Ldev/gitlive/firebase/firestore/Query; + public final fun startAfter ([Ljava/lang/Object;Lkotlin/jvm/functions/Function1;)Ldev/gitlive/firebase/firestore/Query; + public static synthetic fun startAfter$default (Ldev/gitlive/firebase/firestore/Query;[Ljava/lang/Object;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Ldev/gitlive/firebase/firestore/Query; + public final fun startAfterWithEncodableValue ([Ldev/gitlive/firebase/firestore/EncodableValue;Lkotlin/jvm/functions/Function1;)Ldev/gitlive/firebase/firestore/Query; + public static synthetic fun startAfterWithEncodableValue$default (Ldev/gitlive/firebase/firestore/Query;[Ldev/gitlive/firebase/firestore/EncodableValue;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Ldev/gitlive/firebase/firestore/Query; public final fun startAt (Ldev/gitlive/firebase/firestore/DocumentSnapshot;)Ldev/gitlive/firebase/firestore/Query; - public final fun startAt ([Ljava/lang/Object;)Ldev/gitlive/firebase/firestore/Query; + public final fun startAt ([Ljava/lang/Object;Lkotlin/jvm/functions/Function1;)Ldev/gitlive/firebase/firestore/Query; + public static synthetic fun startAt$default (Ldev/gitlive/firebase/firestore/Query;[Ljava/lang/Object;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Ldev/gitlive/firebase/firestore/Query; + public final fun startAtWithEncodableValue ([Ldev/gitlive/firebase/firestore/EncodableValue;Lkotlin/jvm/functions/Function1;)Ldev/gitlive/firebase/firestore/Query; + public static synthetic fun startAtWithEncodableValue$default (Ldev/gitlive/firebase/firestore/Query;[Ldev/gitlive/firebase/firestore/EncodableValue;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Ldev/gitlive/firebase/firestore/Query; public final fun where (Lkotlin/jvm/functions/Function1;)Ldev/gitlive/firebase/firestore/Query; } @@ -565,8 +604,12 @@ public final class dev/gitlive/firebase/firestore/Transaction { public final fun updateEncodedFieldsAndValues (Ldev/gitlive/firebase/firestore/DocumentReference;Ljava/util/List;)Ldev/gitlive/firebase/firestore/Transaction; public final fun updateFieldPaths (Ldev/gitlive/firebase/firestore/DocumentReference;[Lkotlin/Pair;Lkotlin/jvm/functions/Function1;)Ldev/gitlive/firebase/firestore/Transaction; public static synthetic fun updateFieldPaths$default (Ldev/gitlive/firebase/firestore/Transaction;Ldev/gitlive/firebase/firestore/DocumentReference;[Lkotlin/Pair;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Ldev/gitlive/firebase/firestore/Transaction; + public final fun updateFieldPathsWithEncodableValue (Ldev/gitlive/firebase/firestore/DocumentReference;[Lkotlin/Pair;Lkotlin/jvm/functions/Function1;)Ldev/gitlive/firebase/firestore/Transaction; + public static synthetic fun updateFieldPathsWithEncodableValue$default (Ldev/gitlive/firebase/firestore/Transaction;Ldev/gitlive/firebase/firestore/DocumentReference;[Lkotlin/Pair;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Ldev/gitlive/firebase/firestore/Transaction; public final fun updateFields (Ldev/gitlive/firebase/firestore/DocumentReference;[Lkotlin/Pair;Lkotlin/jvm/functions/Function1;)Ldev/gitlive/firebase/firestore/Transaction; public static synthetic fun updateFields$default (Ldev/gitlive/firebase/firestore/Transaction;Ldev/gitlive/firebase/firestore/DocumentReference;[Lkotlin/Pair;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Ldev/gitlive/firebase/firestore/Transaction; + public final fun updateFieldsWithEncodableValue (Ldev/gitlive/firebase/firestore/DocumentReference;[Lkotlin/Pair;Lkotlin/jvm/functions/Function1;)Ldev/gitlive/firebase/firestore/Transaction; + public static synthetic fun updateFieldsWithEncodableValue$default (Ldev/gitlive/firebase/firestore/Transaction;Ldev/gitlive/firebase/firestore/DocumentReference;[Lkotlin/Pair;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Ldev/gitlive/firebase/firestore/Transaction; } public final class dev/gitlive/firebase/firestore/Transaction$Companion { @@ -576,117 +619,102 @@ public abstract interface class dev/gitlive/firebase/firestore/WhereConstraint { } public final class dev/gitlive/firebase/firestore/WhereConstraint$ArrayContains : dev/gitlive/firebase/firestore/WhereConstraint$ForObject { + public fun (Ljava/lang/Object;)V public final fun component1 ()Ljava/lang/Object; public fun equals (Ljava/lang/Object;)Z - public fun getSafeValue ()Ljava/lang/Object; public fun getValue ()Ljava/lang/Object; public fun hashCode ()I public fun toString ()Ljava/lang/String; } public final class dev/gitlive/firebase/firestore/WhereConstraint$ArrayContainsAny : dev/gitlive/firebase/firestore/WhereConstraint$ForArray { + public fun (Ljava/util/List;)V public final fun component1 ()Ljava/util/List; public fun equals (Ljava/lang/Object;)Z - public fun getSafeValues ()Ljava/util/List; public fun getValues ()Ljava/util/List; public fun hashCode ()I public fun toString ()Ljava/lang/String; } public final class dev/gitlive/firebase/firestore/WhereConstraint$EqualTo : dev/gitlive/firebase/firestore/WhereConstraint$ForNullableObject { + public fun (Ljava/lang/Object;)V public final fun component1 ()Ljava/lang/Object; public fun equals (Ljava/lang/Object;)Z - public fun getSafeValue ()Ljava/lang/Object; public fun getValue ()Ljava/lang/Object; public fun hashCode ()I public fun toString ()Ljava/lang/String; } public abstract interface class dev/gitlive/firebase/firestore/WhereConstraint$ForArray : dev/gitlive/firebase/firestore/WhereConstraint { - public abstract fun getSafeValues ()Ljava/util/List; public abstract fun getValues ()Ljava/util/List; } -public final class dev/gitlive/firebase/firestore/WhereConstraint$ForArray$DefaultImpls { - public static fun getSafeValues (Ldev/gitlive/firebase/firestore/WhereConstraint$ForArray;)Ljava/util/List; -} - public abstract interface class dev/gitlive/firebase/firestore/WhereConstraint$ForNullableObject : dev/gitlive/firebase/firestore/WhereConstraint { - public abstract fun getSafeValue ()Ljava/lang/Object; public abstract fun getValue ()Ljava/lang/Object; } -public final class dev/gitlive/firebase/firestore/WhereConstraint$ForNullableObject$DefaultImpls { - public static fun getSafeValue (Ldev/gitlive/firebase/firestore/WhereConstraint$ForNullableObject;)Ljava/lang/Object; -} - public abstract interface class dev/gitlive/firebase/firestore/WhereConstraint$ForObject : dev/gitlive/firebase/firestore/WhereConstraint { - public abstract fun getSafeValue ()Ljava/lang/Object; public abstract fun getValue ()Ljava/lang/Object; } -public final class dev/gitlive/firebase/firestore/WhereConstraint$ForObject$DefaultImpls { - public static fun getSafeValue (Ldev/gitlive/firebase/firestore/WhereConstraint$ForObject;)Ljava/lang/Object; -} - public final class dev/gitlive/firebase/firestore/WhereConstraint$GreaterThan : dev/gitlive/firebase/firestore/WhereConstraint$ForObject { + public fun (Ljava/lang/Object;)V public final fun component1 ()Ljava/lang/Object; public fun equals (Ljava/lang/Object;)Z - public fun getSafeValue ()Ljava/lang/Object; public fun getValue ()Ljava/lang/Object; public fun hashCode ()I public fun toString ()Ljava/lang/String; } public final class dev/gitlive/firebase/firestore/WhereConstraint$GreaterThanOrEqualTo : dev/gitlive/firebase/firestore/WhereConstraint$ForObject { + public fun (Ljava/lang/Object;)V public final fun component1 ()Ljava/lang/Object; public fun equals (Ljava/lang/Object;)Z - public fun getSafeValue ()Ljava/lang/Object; public fun getValue ()Ljava/lang/Object; public fun hashCode ()I public fun toString ()Ljava/lang/String; } public final class dev/gitlive/firebase/firestore/WhereConstraint$InArray : dev/gitlive/firebase/firestore/WhereConstraint$ForArray { + public fun (Ljava/util/List;)V public final fun component1 ()Ljava/util/List; public fun equals (Ljava/lang/Object;)Z - public fun getSafeValues ()Ljava/util/List; public fun getValues ()Ljava/util/List; public fun hashCode ()I public fun toString ()Ljava/lang/String; } public final class dev/gitlive/firebase/firestore/WhereConstraint$LessThan : dev/gitlive/firebase/firestore/WhereConstraint$ForObject { + public fun (Ljava/lang/Object;)V public final fun component1 ()Ljava/lang/Object; public fun equals (Ljava/lang/Object;)Z - public fun getSafeValue ()Ljava/lang/Object; public fun getValue ()Ljava/lang/Object; public fun hashCode ()I public fun toString ()Ljava/lang/String; } public final class dev/gitlive/firebase/firestore/WhereConstraint$LessThanOrEqualTo : dev/gitlive/firebase/firestore/WhereConstraint$ForObject { + public fun (Ljava/lang/Object;)V public final fun component1 ()Ljava/lang/Object; public fun equals (Ljava/lang/Object;)Z - public fun getSafeValue ()Ljava/lang/Object; public fun getValue ()Ljava/lang/Object; public fun hashCode ()I public fun toString ()Ljava/lang/String; } public final class dev/gitlive/firebase/firestore/WhereConstraint$NotEqualTo : dev/gitlive/firebase/firestore/WhereConstraint$ForNullableObject { + public fun (Ljava/lang/Object;)V public final fun component1 ()Ljava/lang/Object; public fun equals (Ljava/lang/Object;)Z - public fun getSafeValue ()Ljava/lang/Object; public fun getValue ()Ljava/lang/Object; public fun hashCode ()I public fun toString ()Ljava/lang/String; } public final class dev/gitlive/firebase/firestore/WhereConstraint$NotInArray : dev/gitlive/firebase/firestore/WhereConstraint$ForArray { + public fun (Ljava/util/List;)V public final fun component1 ()Ljava/util/List; public fun equals (Ljava/lang/Object;)Z - public fun getSafeValues ()Ljava/util/List; public fun getValues ()Ljava/util/List; public fun hashCode ()I public fun toString ()Ljava/lang/String; @@ -720,6 +748,10 @@ public final class dev/gitlive/firebase/firestore/WriteBatch { public static synthetic fun updateField$default (Ldev/gitlive/firebase/firestore/WriteBatch;Ldev/gitlive/firebase/firestore/DocumentReference;[Lkotlin/Pair;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Ldev/gitlive/firebase/firestore/WriteBatch; public final fun updateFieldPath (Ldev/gitlive/firebase/firestore/DocumentReference;[Lkotlin/Pair;Lkotlin/jvm/functions/Function1;)Ldev/gitlive/firebase/firestore/WriteBatch; public static synthetic fun updateFieldPath$default (Ldev/gitlive/firebase/firestore/WriteBatch;Ldev/gitlive/firebase/firestore/DocumentReference;[Lkotlin/Pair;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Ldev/gitlive/firebase/firestore/WriteBatch; + public final fun updateFieldPathWithEncodableValues (Ldev/gitlive/firebase/firestore/DocumentReference;[Lkotlin/Pair;Lkotlin/jvm/functions/Function1;)Ldev/gitlive/firebase/firestore/WriteBatch; + public static synthetic fun updateFieldPathWithEncodableValues$default (Ldev/gitlive/firebase/firestore/WriteBatch;Ldev/gitlive/firebase/firestore/DocumentReference;[Lkotlin/Pair;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Ldev/gitlive/firebase/firestore/WriteBatch; + public final fun updateFieldWithEncodableValues (Ldev/gitlive/firebase/firestore/DocumentReference;[Lkotlin/Pair;Lkotlin/jvm/functions/Function1;)Ldev/gitlive/firebase/firestore/WriteBatch; + public static synthetic fun updateFieldWithEncodableValues$default (Ldev/gitlive/firebase/firestore/WriteBatch;Ldev/gitlive/firebase/firestore/DocumentReference;[Lkotlin/Pair;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Ldev/gitlive/firebase/firestore/WriteBatch; } public final class dev/gitlive/firebase/firestore/WriteBatch$Companion { diff --git a/firebase-firestore/api/jvm/firebase-firestore.api b/firebase-firestore/api/jvm/firebase-firestore.api index 33a64aef7..ccf423cda 100644 --- a/firebase-firestore/api/jvm/firebase-firestore.api +++ b/firebase-firestore/api/jvm/firebase-firestore.api @@ -76,8 +76,12 @@ public final class dev/gitlive/firebase/firestore/DocumentReference { public final fun updateEncodedFieldsAndValues (Ljava/util/List;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public final fun updateFieldPaths ([Lkotlin/Pair;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static synthetic fun updateFieldPaths$default (Ldev/gitlive/firebase/firestore/DocumentReference;[Lkotlin/Pair;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; + public final fun updateFieldPathsWithEncodableValue ([Lkotlin/Pair;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static synthetic fun updateFieldPathsWithEncodableValue$default (Ldev/gitlive/firebase/firestore/DocumentReference;[Lkotlin/Pair;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; public final fun updateFields ([Lkotlin/Pair;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static synthetic fun updateFields$default (Ldev/gitlive/firebase/firestore/DocumentReference;[Lkotlin/Pair;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; + public final fun updateFieldsWithEncodableValues ([Lkotlin/Pair;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static synthetic fun updateFieldsWithEncodableValues$default (Ldev/gitlive/firebase/firestore/DocumentReference;[Lkotlin/Pair;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; } public final class dev/gitlive/firebase/firestore/DocumentReference$Companion { @@ -131,6 +135,21 @@ public final class dev/gitlive/firebase/firestore/DoubleAsTimestampSerializer : public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V } +public final class dev/gitlive/firebase/firestore/EncodableValue { + public fun (Lkotlin/jvm/functions/Function1;)V + public final fun component1 ()Lkotlin/jvm/functions/Function1; + public final fun copy (Lkotlin/jvm/functions/Function1;)Ldev/gitlive/firebase/firestore/EncodableValue; + public static synthetic fun copy$default (Ldev/gitlive/firebase/firestore/EncodableValue;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Ldev/gitlive/firebase/firestore/EncodableValue; + public fun equals (Ljava/lang/Object;)Z + public final fun getEncoded ()Lkotlin/jvm/functions/Function1; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public final class dev/gitlive/firebase/firestore/EncodableValueKt { + public static final fun encodableWithStrategy (Ljava/lang/Object;Lkotlinx/serialization/SerializationStrategy;)Ldev/gitlive/firebase/firestore/EncodableValue; +} + public final class dev/gitlive/firebase/firestore/FieldPath { public static final field Companion Ldev/gitlive/firebase/firestore/FieldPath$Companion; public fun ([Ljava/lang/String;)V @@ -182,6 +201,7 @@ public final class dev/gitlive/firebase/firestore/Filter$And : dev/gitlive/fireb } public final class dev/gitlive/firebase/firestore/Filter$Field : dev/gitlive/firebase/firestore/Filter$WithConstraint { + public fun (Ljava/lang/String;Ldev/gitlive/firebase/firestore/WhereConstraint;)V public final fun component1 ()Ljava/lang/String; public final fun component2 ()Ldev/gitlive/firebase/firestore/WhereConstraint; public fun equals (Ljava/lang/Object;)Z @@ -200,6 +220,7 @@ public final class dev/gitlive/firebase/firestore/Filter$Or : dev/gitlive/fireba } public final class dev/gitlive/firebase/firestore/Filter$Path : dev/gitlive/firebase/firestore/Filter$WithConstraint { + public fun (Ldev/gitlive/firebase/firestore/FieldPath;Ldev/gitlive/firebase/firestore/WhereConstraint;)V public final fun component1 ()Ldev/gitlive/firebase/firestore/FieldPath; public final fun component2 ()Ldev/gitlive/firebase/firestore/WhereConstraint; public fun equals (Ljava/lang/Object;)Z @@ -217,27 +238,33 @@ public final class dev/gitlive/firebase/firestore/FilterBuilder { public final fun all ([Ldev/gitlive/firebase/firestore/Filter;)Ldev/gitlive/firebase/firestore/Filter; public final fun and (Ldev/gitlive/firebase/firestore/Filter;Ldev/gitlive/firebase/firestore/Filter;)Ldev/gitlive/firebase/firestore/Filter$And; public final fun any ([Ldev/gitlive/firebase/firestore/Filter;)Ldev/gitlive/firebase/firestore/Filter; - public final fun contains (Ldev/gitlive/firebase/firestore/FieldPath;Ljava/lang/Object;)Ldev/gitlive/firebase/firestore/Filter$WithConstraint; - public final fun contains (Ljava/lang/String;Ljava/lang/Object;)Ldev/gitlive/firebase/firestore/Filter$WithConstraint; - public final fun containsAny (Ldev/gitlive/firebase/firestore/FieldPath;Ljava/util/List;)Ldev/gitlive/firebase/firestore/Filter$WithConstraint; - public final fun containsAny (Ljava/lang/String;Ljava/util/List;)Ldev/gitlive/firebase/firestore/Filter$WithConstraint; - public final fun equalTo (Ldev/gitlive/firebase/firestore/FieldPath;Ljava/lang/Object;)Ldev/gitlive/firebase/firestore/Filter$WithConstraint; - public final fun equalTo (Ljava/lang/String;Ljava/lang/Object;)Ldev/gitlive/firebase/firestore/Filter$WithConstraint; - public final fun greaterThan (Ldev/gitlive/firebase/firestore/FieldPath;Ljava/lang/Object;)Ldev/gitlive/firebase/firestore/Filter$WithConstraint; - public final fun greaterThan (Ljava/lang/String;Ljava/lang/Object;)Ldev/gitlive/firebase/firestore/Filter$WithConstraint; - public final fun greaterThanOrEqualTo (Ldev/gitlive/firebase/firestore/FieldPath;Ljava/lang/Object;)Ldev/gitlive/firebase/firestore/Filter$WithConstraint; - public final fun greaterThanOrEqualTo (Ljava/lang/String;Ljava/lang/Object;)Ldev/gitlive/firebase/firestore/Filter$WithConstraint; - public final fun inArray (Ldev/gitlive/firebase/firestore/FieldPath;Ljava/util/List;)Ldev/gitlive/firebase/firestore/Filter$WithConstraint; - public final fun inArray (Ljava/lang/String;Ljava/util/List;)Ldev/gitlive/firebase/firestore/Filter$WithConstraint; - public final fun lessThan (Ldev/gitlive/firebase/firestore/FieldPath;Ljava/lang/Object;)Ldev/gitlive/firebase/firestore/Filter$WithConstraint; - public final fun lessThan (Ljava/lang/String;Ljava/lang/Object;)Ldev/gitlive/firebase/firestore/Filter$WithConstraint; - public final fun lessThanOrEqualTo (Ldev/gitlive/firebase/firestore/FieldPath;Ljava/lang/Object;)Ldev/gitlive/firebase/firestore/Filter$WithConstraint; - public final fun lessThanOrEqualTo (Ljava/lang/String;Ljava/lang/Object;)Ldev/gitlive/firebase/firestore/Filter$WithConstraint; - public final fun notEqualTo (Ldev/gitlive/firebase/firestore/FieldPath;Ljava/lang/Object;)Ldev/gitlive/firebase/firestore/Filter$WithConstraint; - public final fun notEqualTo (Ljava/lang/String;Ljava/lang/Object;)Ldev/gitlive/firebase/firestore/Filter$WithConstraint; - public final fun notInArray (Ldev/gitlive/firebase/firestore/FieldPath;Ljava/util/List;)Ldev/gitlive/firebase/firestore/Filter$WithConstraint; - public final fun notInArray (Ljava/lang/String;Ljava/util/List;)Ldev/gitlive/firebase/firestore/Filter$WithConstraint; + public final fun contains (Ldev/gitlive/firebase/firestore/FieldPath;Lkotlinx/serialization/SerializationStrategy;Ljava/lang/Object;)Ldev/gitlive/firebase/firestore/Filter$WithConstraint; + public final fun contains (Ljava/lang/String;Lkotlinx/serialization/SerializationStrategy;Ljava/lang/Object;)Ldev/gitlive/firebase/firestore/Filter$WithConstraint; + public final fun containsAny (Ldev/gitlive/firebase/firestore/FieldPath;Lkotlinx/serialization/SerializationStrategy;Ljava/util/List;)Ldev/gitlive/firebase/firestore/Filter$WithConstraint; + public final fun containsAny (Ljava/lang/String;Lkotlinx/serialization/SerializationStrategy;Ljava/util/List;)Ldev/gitlive/firebase/firestore/Filter$WithConstraint; + public final fun equalTo (Ldev/gitlive/firebase/firestore/FieldPath;Lkotlinx/serialization/SerializationStrategy;Ljava/lang/Object;)Ldev/gitlive/firebase/firestore/Filter$WithConstraint; + public final fun equalTo (Ljava/lang/String;Lkotlinx/serialization/SerializationStrategy;Ljava/lang/Object;)Ldev/gitlive/firebase/firestore/Filter$WithConstraint; + public final fun getBuildSettings ()Lkotlin/jvm/functions/Function1; + public final fun greaterThan (Ldev/gitlive/firebase/firestore/FieldPath;Lkotlinx/serialization/SerializationStrategy;Ljava/lang/Object;)Ldev/gitlive/firebase/firestore/Filter$WithConstraint; + public final fun greaterThan (Ljava/lang/String;Lkotlinx/serialization/SerializationStrategy;Ljava/lang/Object;)Ldev/gitlive/firebase/firestore/Filter$WithConstraint; + public final fun greaterThanOrEqualTo (Ldev/gitlive/firebase/firestore/FieldPath;Lkotlinx/serialization/SerializationStrategy;Ljava/lang/Object;)Ldev/gitlive/firebase/firestore/Filter$WithConstraint; + public final fun greaterThanOrEqualTo (Ljava/lang/String;Lkotlinx/serialization/SerializationStrategy;Ljava/lang/Object;)Ldev/gitlive/firebase/firestore/Filter$WithConstraint; + public final fun inArray (Ldev/gitlive/firebase/firestore/FieldPath;Lkotlinx/serialization/SerializationStrategy;Ljava/util/List;)Ldev/gitlive/firebase/firestore/Filter$WithConstraint; + public final fun inArray (Ljava/lang/String;Lkotlinx/serialization/SerializationStrategy;Ljava/util/List;)Ldev/gitlive/firebase/firestore/Filter$WithConstraint; + public final fun isNotNull (Ldev/gitlive/firebase/firestore/FieldPath;)Ldev/gitlive/firebase/firestore/Filter$WithConstraint; + public final fun isNotNull (Ljava/lang/String;)Ldev/gitlive/firebase/firestore/Filter$WithConstraint; + public final fun isNull (Ldev/gitlive/firebase/firestore/FieldPath;)Ldev/gitlive/firebase/firestore/Filter$WithConstraint; + public final fun isNull (Ljava/lang/String;)Ldev/gitlive/firebase/firestore/Filter$WithConstraint; + public final fun lessThan (Ldev/gitlive/firebase/firestore/FieldPath;Lkotlinx/serialization/SerializationStrategy;Ljava/lang/Object;)Ldev/gitlive/firebase/firestore/Filter$WithConstraint; + public final fun lessThan (Ljava/lang/String;Lkotlinx/serialization/SerializationStrategy;Ljava/lang/Object;)Ldev/gitlive/firebase/firestore/Filter$WithConstraint; + public final fun lessThanOrEqualTo (Ldev/gitlive/firebase/firestore/FieldPath;Lkotlinx/serialization/SerializationStrategy;Ljava/lang/Object;)Ldev/gitlive/firebase/firestore/Filter$WithConstraint; + public final fun lessThanOrEqualTo (Ljava/lang/String;Lkotlinx/serialization/SerializationStrategy;Ljava/lang/Object;)Ldev/gitlive/firebase/firestore/Filter$WithConstraint; + public final fun notEqualTo (Ldev/gitlive/firebase/firestore/FieldPath;Lkotlinx/serialization/SerializationStrategy;Ljava/lang/Object;)Ldev/gitlive/firebase/firestore/Filter$WithConstraint; + public final fun notEqualTo (Ljava/lang/String;Lkotlinx/serialization/SerializationStrategy;Ljava/lang/Object;)Ldev/gitlive/firebase/firestore/Filter$WithConstraint; + public final fun notInArray (Ldev/gitlive/firebase/firestore/FieldPath;Lkotlinx/serialization/SerializationStrategy;Ljava/util/List;)Ldev/gitlive/firebase/firestore/Filter$WithConstraint; + public final fun notInArray (Ljava/lang/String;Lkotlinx/serialization/SerializationStrategy;Ljava/util/List;)Ldev/gitlive/firebase/firestore/Filter$WithConstraint; public final fun or (Ldev/gitlive/firebase/firestore/Filter;Ldev/gitlive/firebase/firestore/Filter;)Ldev/gitlive/firebase/firestore/Filter$Or; + public final fun setBuildSettings (Lkotlin/jvm/functions/Function1;)V } public final class dev/gitlive/firebase/firestore/FirebaseFirestore { @@ -424,9 +451,15 @@ public final class dev/gitlive/firebase/firestore/MemoryGarbageCollectorSettings public class dev/gitlive/firebase/firestore/Query { public static final field Companion Ldev/gitlive/firebase/firestore/Query$Companion; public final fun endAt (Ldev/gitlive/firebase/firestore/DocumentSnapshot;)Ldev/gitlive/firebase/firestore/Query; - public final fun endAt ([Ljava/lang/Object;)Ldev/gitlive/firebase/firestore/Query; + public final fun endAt ([Ljava/lang/Object;Lkotlin/jvm/functions/Function1;)Ldev/gitlive/firebase/firestore/Query; + public static synthetic fun endAt$default (Ldev/gitlive/firebase/firestore/Query;[Ljava/lang/Object;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Ldev/gitlive/firebase/firestore/Query; + public final fun endAtWithEncodableValue ([Ldev/gitlive/firebase/firestore/EncodableValue;Lkotlin/jvm/functions/Function1;)Ldev/gitlive/firebase/firestore/Query; + public static synthetic fun endAtWithEncodableValue$default (Ldev/gitlive/firebase/firestore/Query;[Ldev/gitlive/firebase/firestore/EncodableValue;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Ldev/gitlive/firebase/firestore/Query; public final fun endBefore (Ldev/gitlive/firebase/firestore/DocumentSnapshot;)Ldev/gitlive/firebase/firestore/Query; - public final fun endBefore ([Ljava/lang/Object;)Ldev/gitlive/firebase/firestore/Query; + public final fun endBefore ([Ljava/lang/Object;Lkotlin/jvm/functions/Function1;)Ldev/gitlive/firebase/firestore/Query; + public static synthetic fun endBefore$default (Ldev/gitlive/firebase/firestore/Query;[Ljava/lang/Object;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Ldev/gitlive/firebase/firestore/Query; + public final fun endBeforeWithEncodableValue ([Ldev/gitlive/firebase/firestore/EncodableValue;Lkotlin/jvm/functions/Function1;)Ldev/gitlive/firebase/firestore/Query; + public static synthetic fun endBeforeWithEncodableValue$default (Ldev/gitlive/firebase/firestore/Query;[Ldev/gitlive/firebase/firestore/EncodableValue;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Ldev/gitlive/firebase/firestore/Query; public final fun get (Ldev/gitlive/firebase/firestore/Source;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static synthetic fun get$default (Ldev/gitlive/firebase/firestore/Query;Ldev/gitlive/firebase/firestore/Source;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; public final fun getSnapshots ()Lkotlinx/coroutines/flow/Flow; @@ -438,9 +471,15 @@ public class dev/gitlive/firebase/firestore/Query { public final fun snapshots (Z)Lkotlinx/coroutines/flow/Flow; public static synthetic fun snapshots$default (Ldev/gitlive/firebase/firestore/Query;ZILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow; public final fun startAfter (Ldev/gitlive/firebase/firestore/DocumentSnapshot;)Ldev/gitlive/firebase/firestore/Query; - public final fun startAfter ([Ljava/lang/Object;)Ldev/gitlive/firebase/firestore/Query; + public final fun startAfter ([Ljava/lang/Object;Lkotlin/jvm/functions/Function1;)Ldev/gitlive/firebase/firestore/Query; + public static synthetic fun startAfter$default (Ldev/gitlive/firebase/firestore/Query;[Ljava/lang/Object;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Ldev/gitlive/firebase/firestore/Query; + public final fun startAfterWithEncodableValue ([Ldev/gitlive/firebase/firestore/EncodableValue;Lkotlin/jvm/functions/Function1;)Ldev/gitlive/firebase/firestore/Query; + public static synthetic fun startAfterWithEncodableValue$default (Ldev/gitlive/firebase/firestore/Query;[Ldev/gitlive/firebase/firestore/EncodableValue;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Ldev/gitlive/firebase/firestore/Query; public final fun startAt (Ldev/gitlive/firebase/firestore/DocumentSnapshot;)Ldev/gitlive/firebase/firestore/Query; - public final fun startAt ([Ljava/lang/Object;)Ldev/gitlive/firebase/firestore/Query; + public final fun startAt ([Ljava/lang/Object;Lkotlin/jvm/functions/Function1;)Ldev/gitlive/firebase/firestore/Query; + public static synthetic fun startAt$default (Ldev/gitlive/firebase/firestore/Query;[Ljava/lang/Object;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Ldev/gitlive/firebase/firestore/Query; + public final fun startAtWithEncodableValue ([Ldev/gitlive/firebase/firestore/EncodableValue;Lkotlin/jvm/functions/Function1;)Ldev/gitlive/firebase/firestore/Query; + public static synthetic fun startAtWithEncodableValue$default (Ldev/gitlive/firebase/firestore/Query;[Ldev/gitlive/firebase/firestore/EncodableValue;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Ldev/gitlive/firebase/firestore/Query; public final fun where (Lkotlin/jvm/functions/Function1;)Ldev/gitlive/firebase/firestore/Query; } @@ -565,8 +604,12 @@ public final class dev/gitlive/firebase/firestore/Transaction { public final fun updateEncodedFieldsAndValues (Ldev/gitlive/firebase/firestore/DocumentReference;Ljava/util/List;)Ldev/gitlive/firebase/firestore/Transaction; public final fun updateFieldPaths (Ldev/gitlive/firebase/firestore/DocumentReference;[Lkotlin/Pair;Lkotlin/jvm/functions/Function1;)Ldev/gitlive/firebase/firestore/Transaction; public static synthetic fun updateFieldPaths$default (Ldev/gitlive/firebase/firestore/Transaction;Ldev/gitlive/firebase/firestore/DocumentReference;[Lkotlin/Pair;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Ldev/gitlive/firebase/firestore/Transaction; + public final fun updateFieldPathsWithEncodableValue (Ldev/gitlive/firebase/firestore/DocumentReference;[Lkotlin/Pair;Lkotlin/jvm/functions/Function1;)Ldev/gitlive/firebase/firestore/Transaction; + public static synthetic fun updateFieldPathsWithEncodableValue$default (Ldev/gitlive/firebase/firestore/Transaction;Ldev/gitlive/firebase/firestore/DocumentReference;[Lkotlin/Pair;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Ldev/gitlive/firebase/firestore/Transaction; public final fun updateFields (Ldev/gitlive/firebase/firestore/DocumentReference;[Lkotlin/Pair;Lkotlin/jvm/functions/Function1;)Ldev/gitlive/firebase/firestore/Transaction; public static synthetic fun updateFields$default (Ldev/gitlive/firebase/firestore/Transaction;Ldev/gitlive/firebase/firestore/DocumentReference;[Lkotlin/Pair;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Ldev/gitlive/firebase/firestore/Transaction; + public final fun updateFieldsWithEncodableValue (Ldev/gitlive/firebase/firestore/DocumentReference;[Lkotlin/Pair;Lkotlin/jvm/functions/Function1;)Ldev/gitlive/firebase/firestore/Transaction; + public static synthetic fun updateFieldsWithEncodableValue$default (Ldev/gitlive/firebase/firestore/Transaction;Ldev/gitlive/firebase/firestore/DocumentReference;[Lkotlin/Pair;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Ldev/gitlive/firebase/firestore/Transaction; } public final class dev/gitlive/firebase/firestore/Transaction$Companion { @@ -576,117 +619,102 @@ public abstract interface class dev/gitlive/firebase/firestore/WhereConstraint { } public final class dev/gitlive/firebase/firestore/WhereConstraint$ArrayContains : dev/gitlive/firebase/firestore/WhereConstraint$ForObject { + public fun (Ljava/lang/Object;)V public final fun component1 ()Ljava/lang/Object; public fun equals (Ljava/lang/Object;)Z - public fun getSafeValue ()Ljava/lang/Object; public fun getValue ()Ljava/lang/Object; public fun hashCode ()I public fun toString ()Ljava/lang/String; } public final class dev/gitlive/firebase/firestore/WhereConstraint$ArrayContainsAny : dev/gitlive/firebase/firestore/WhereConstraint$ForArray { + public fun (Ljava/util/List;)V public final fun component1 ()Ljava/util/List; public fun equals (Ljava/lang/Object;)Z - public fun getSafeValues ()Ljava/util/List; public fun getValues ()Ljava/util/List; public fun hashCode ()I public fun toString ()Ljava/lang/String; } public final class dev/gitlive/firebase/firestore/WhereConstraint$EqualTo : dev/gitlive/firebase/firestore/WhereConstraint$ForNullableObject { + public fun (Ljava/lang/Object;)V public final fun component1 ()Ljava/lang/Object; public fun equals (Ljava/lang/Object;)Z - public fun getSafeValue ()Ljava/lang/Object; public fun getValue ()Ljava/lang/Object; public fun hashCode ()I public fun toString ()Ljava/lang/String; } public abstract interface class dev/gitlive/firebase/firestore/WhereConstraint$ForArray : dev/gitlive/firebase/firestore/WhereConstraint { - public abstract fun getSafeValues ()Ljava/util/List; public abstract fun getValues ()Ljava/util/List; } -public final class dev/gitlive/firebase/firestore/WhereConstraint$ForArray$DefaultImpls { - public static fun getSafeValues (Ldev/gitlive/firebase/firestore/WhereConstraint$ForArray;)Ljava/util/List; -} - public abstract interface class dev/gitlive/firebase/firestore/WhereConstraint$ForNullableObject : dev/gitlive/firebase/firestore/WhereConstraint { - public abstract fun getSafeValue ()Ljava/lang/Object; public abstract fun getValue ()Ljava/lang/Object; } -public final class dev/gitlive/firebase/firestore/WhereConstraint$ForNullableObject$DefaultImpls { - public static fun getSafeValue (Ldev/gitlive/firebase/firestore/WhereConstraint$ForNullableObject;)Ljava/lang/Object; -} - public abstract interface class dev/gitlive/firebase/firestore/WhereConstraint$ForObject : dev/gitlive/firebase/firestore/WhereConstraint { - public abstract fun getSafeValue ()Ljava/lang/Object; public abstract fun getValue ()Ljava/lang/Object; } -public final class dev/gitlive/firebase/firestore/WhereConstraint$ForObject$DefaultImpls { - public static fun getSafeValue (Ldev/gitlive/firebase/firestore/WhereConstraint$ForObject;)Ljava/lang/Object; -} - public final class dev/gitlive/firebase/firestore/WhereConstraint$GreaterThan : dev/gitlive/firebase/firestore/WhereConstraint$ForObject { + public fun (Ljava/lang/Object;)V public final fun component1 ()Ljava/lang/Object; public fun equals (Ljava/lang/Object;)Z - public fun getSafeValue ()Ljava/lang/Object; public fun getValue ()Ljava/lang/Object; public fun hashCode ()I public fun toString ()Ljava/lang/String; } public final class dev/gitlive/firebase/firestore/WhereConstraint$GreaterThanOrEqualTo : dev/gitlive/firebase/firestore/WhereConstraint$ForObject { + public fun (Ljava/lang/Object;)V public final fun component1 ()Ljava/lang/Object; public fun equals (Ljava/lang/Object;)Z - public fun getSafeValue ()Ljava/lang/Object; public fun getValue ()Ljava/lang/Object; public fun hashCode ()I public fun toString ()Ljava/lang/String; } public final class dev/gitlive/firebase/firestore/WhereConstraint$InArray : dev/gitlive/firebase/firestore/WhereConstraint$ForArray { + public fun (Ljava/util/List;)V public final fun component1 ()Ljava/util/List; public fun equals (Ljava/lang/Object;)Z - public fun getSafeValues ()Ljava/util/List; public fun getValues ()Ljava/util/List; public fun hashCode ()I public fun toString ()Ljava/lang/String; } public final class dev/gitlive/firebase/firestore/WhereConstraint$LessThan : dev/gitlive/firebase/firestore/WhereConstraint$ForObject { + public fun (Ljava/lang/Object;)V public final fun component1 ()Ljava/lang/Object; public fun equals (Ljava/lang/Object;)Z - public fun getSafeValue ()Ljava/lang/Object; public fun getValue ()Ljava/lang/Object; public fun hashCode ()I public fun toString ()Ljava/lang/String; } public final class dev/gitlive/firebase/firestore/WhereConstraint$LessThanOrEqualTo : dev/gitlive/firebase/firestore/WhereConstraint$ForObject { + public fun (Ljava/lang/Object;)V public final fun component1 ()Ljava/lang/Object; public fun equals (Ljava/lang/Object;)Z - public fun getSafeValue ()Ljava/lang/Object; public fun getValue ()Ljava/lang/Object; public fun hashCode ()I public fun toString ()Ljava/lang/String; } public final class dev/gitlive/firebase/firestore/WhereConstraint$NotEqualTo : dev/gitlive/firebase/firestore/WhereConstraint$ForNullableObject { + public fun (Ljava/lang/Object;)V public final fun component1 ()Ljava/lang/Object; public fun equals (Ljava/lang/Object;)Z - public fun getSafeValue ()Ljava/lang/Object; public fun getValue ()Ljava/lang/Object; public fun hashCode ()I public fun toString ()Ljava/lang/String; } public final class dev/gitlive/firebase/firestore/WhereConstraint$NotInArray : dev/gitlive/firebase/firestore/WhereConstraint$ForArray { + public fun (Ljava/util/List;)V public final fun component1 ()Ljava/util/List; public fun equals (Ljava/lang/Object;)Z - public fun getSafeValues ()Ljava/util/List; public fun getValues ()Ljava/util/List; public fun hashCode ()I public fun toString ()Ljava/lang/String; @@ -720,6 +748,10 @@ public final class dev/gitlive/firebase/firestore/WriteBatch { public static synthetic fun updateField$default (Ldev/gitlive/firebase/firestore/WriteBatch;Ldev/gitlive/firebase/firestore/DocumentReference;[Lkotlin/Pair;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Ldev/gitlive/firebase/firestore/WriteBatch; public final fun updateFieldPath (Ldev/gitlive/firebase/firestore/DocumentReference;[Lkotlin/Pair;Lkotlin/jvm/functions/Function1;)Ldev/gitlive/firebase/firestore/WriteBatch; public static synthetic fun updateFieldPath$default (Ldev/gitlive/firebase/firestore/WriteBatch;Ldev/gitlive/firebase/firestore/DocumentReference;[Lkotlin/Pair;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Ldev/gitlive/firebase/firestore/WriteBatch; + public final fun updateFieldPathWithEncodableValues (Ldev/gitlive/firebase/firestore/DocumentReference;[Lkotlin/Pair;Lkotlin/jvm/functions/Function1;)Ldev/gitlive/firebase/firestore/WriteBatch; + public static synthetic fun updateFieldPathWithEncodableValues$default (Ldev/gitlive/firebase/firestore/WriteBatch;Ldev/gitlive/firebase/firestore/DocumentReference;[Lkotlin/Pair;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Ldev/gitlive/firebase/firestore/WriteBatch; + public final fun updateFieldWithEncodableValues (Ldev/gitlive/firebase/firestore/DocumentReference;[Lkotlin/Pair;Lkotlin/jvm/functions/Function1;)Ldev/gitlive/firebase/firestore/WriteBatch; + public static synthetic fun updateFieldWithEncodableValues$default (Ldev/gitlive/firebase/firestore/WriteBatch;Ldev/gitlive/firebase/firestore/DocumentReference;[Lkotlin/Pair;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Ldev/gitlive/firebase/firestore/WriteBatch; } public final class dev/gitlive/firebase/firestore/WriteBatch$Companion { diff --git a/firebase-firestore/src/commonMain/kotlin/dev/gitlive/firebase/firestore/EncodableValue.kt b/firebase-firestore/src/commonMain/kotlin/dev/gitlive/firebase/firestore/EncodableValue.kt new file mode 100644 index 000000000..ba97efbd7 --- /dev/null +++ b/firebase-firestore/src/commonMain/kotlin/dev/gitlive/firebase/firestore/EncodableValue.kt @@ -0,0 +1,13 @@ +package dev.gitlive.firebase.firestore + +import dev.gitlive.firebase.EncodeSettings +import kotlinx.serialization.SerializationStrategy + +public data class EncodableValue(public val encoded: (EncodeSettings.Builder.() -> Unit) -> Any?) + +public inline fun T.encodable(): EncodableValue = EncodableValue { + encode(this, it) +} +public fun T.encodableWithStrategy(stategy: SerializationStrategy): EncodableValue = EncodableValue { + dev.gitlive.firebase.internal.encode(stategy, this, it) +} diff --git a/firebase-firestore/src/commonMain/kotlin/dev/gitlive/firebase/firestore/Filter.kt b/firebase-firestore/src/commonMain/kotlin/dev/gitlive/firebase/firestore/Filter.kt index 4ad37abea..3b3f33a55 100644 --- a/firebase-firestore/src/commonMain/kotlin/dev/gitlive/firebase/firestore/Filter.kt +++ b/firebase-firestore/src/commonMain/kotlin/dev/gitlive/firebase/firestore/Filter.kt @@ -48,185 +48,185 @@ public class FilterBuilder internal constructor() { public val String.isNull: Filter.WithConstraint get() = Filter.Field(this, WhereConstraint.EqualTo(null)) public inline infix fun String.equalTo(value: T): Filter.WithConstraint = Filter.Field( this, - WhereConstraint.EqualTo(encode(value, buildSettings)) + WhereConstraint.EqualTo(encode(value, buildSettings)), ) public fun String.equalTo(strategy: SerializationStrategy, value: T): Filter.WithConstraint = Filter.Field( this, - WhereConstraint.EqualTo(dev.gitlive.firebase.internal.encode(strategy, value, buildSettings)) + WhereConstraint.EqualTo(dev.gitlive.firebase.internal.encode(strategy, value, buildSettings)), ) public val FieldPath.isNull: Filter.WithConstraint get() = Filter.Path(this, WhereConstraint.EqualTo(null)) public inline infix fun FieldPath.equalTo(value: T): Filter.WithConstraint = Filter.Path( this, - WhereConstraint.EqualTo(encode(value, buildSettings)) + WhereConstraint.EqualTo(encode(value, buildSettings)), ) public fun FieldPath.equalTo(strategy: SerializationStrategy, value: T): Filter.WithConstraint = Filter.Path( this, - WhereConstraint.EqualTo(dev.gitlive.firebase.internal.encode(strategy, value, buildSettings)) + WhereConstraint.EqualTo(dev.gitlive.firebase.internal.encode(strategy, value, buildSettings)), ) public val String.isNotNull: Filter.WithConstraint get() = Filter.Field(this, WhereConstraint.NotEqualTo(null)) public inline infix fun String.notEqualTo(value: T): Filter.WithConstraint = Filter.Field( this, - WhereConstraint.NotEqualTo(encode(value, buildSettings)) + WhereConstraint.NotEqualTo(encode(value, buildSettings)), ) public fun String.notEqualTo(strategy: SerializationStrategy, value: T): Filter.WithConstraint = Filter.Field( this, - WhereConstraint.NotEqualTo(dev.gitlive.firebase.internal.encode(strategy, value, buildSettings)) + WhereConstraint.NotEqualTo(dev.gitlive.firebase.internal.encode(strategy, value, buildSettings)), ) public val FieldPath.isNotNull: Filter.WithConstraint get() = Filter.Path(this, WhereConstraint.NotEqualTo(null)) public inline infix fun FieldPath.notEqualTo(value: T): Filter.WithConstraint = Filter.Path( this, - WhereConstraint.NotEqualTo(encode(value, buildSettings)) + WhereConstraint.NotEqualTo(encode(value, buildSettings)), ) public fun FieldPath.notEqualTo(strategy: SerializationStrategy, value: T): Filter.WithConstraint = Filter.Path( this, - WhereConstraint.NotEqualTo(dev.gitlive.firebase.internal.encode(strategy, value, buildSettings)) + WhereConstraint.NotEqualTo(dev.gitlive.firebase.internal.encode(strategy, value, buildSettings)), ) public inline infix fun String.lessThan(value: T): Filter.WithConstraint = Filter.Field( this, - WhereConstraint.LessThan(encode(value, buildSettings)!!) + WhereConstraint.LessThan(encode(value, buildSettings)!!), ) public fun String.lessThan(strategy: SerializationStrategy, value: T): Filter.WithConstraint = Filter.Field( this, - WhereConstraint.LessThan(dev.gitlive.firebase.internal.encode(strategy, value, buildSettings)!!) + WhereConstraint.LessThan(dev.gitlive.firebase.internal.encode(strategy, value, buildSettings)!!), ) public inline infix fun FieldPath.lessThan(value: T): Filter.WithConstraint = Filter.Path( this, - WhereConstraint.LessThan(encode(value, buildSettings)!!) + WhereConstraint.LessThan(encode(value, buildSettings)!!), ) public fun FieldPath.lessThan(strategy: SerializationStrategy, value: T): Filter.WithConstraint = Filter.Path( this, - WhereConstraint.LessThan(dev.gitlive.firebase.internal.encode(strategy, value, buildSettings)!!) + WhereConstraint.LessThan(dev.gitlive.firebase.internal.encode(strategy, value, buildSettings)!!), ) public inline infix fun String.greaterThan(value: T): Filter.WithConstraint = Filter.Field( this, - WhereConstraint.GreaterThan(encode(value, buildSettings)!!) + WhereConstraint.GreaterThan(encode(value, buildSettings)!!), ) public fun String.greaterThan(strategy: SerializationStrategy, value: T): Filter.WithConstraint = Filter.Field( this, - WhereConstraint.GreaterThan(dev.gitlive.firebase.internal.encode(strategy, value, buildSettings)!!) + WhereConstraint.GreaterThan(dev.gitlive.firebase.internal.encode(strategy, value, buildSettings)!!), ) public inline infix fun FieldPath.greaterThan(value: T): Filter.WithConstraint = Filter.Path( this, - WhereConstraint.GreaterThan(encode(value, buildSettings)!!) + WhereConstraint.GreaterThan(encode(value, buildSettings)!!), ) public fun FieldPath.greaterThan(strategy: SerializationStrategy, value: T): Filter.WithConstraint = Filter.Path( this, - WhereConstraint.GreaterThan(dev.gitlive.firebase.internal.encode(strategy, value, buildSettings)!!) + WhereConstraint.GreaterThan(dev.gitlive.firebase.internal.encode(strategy, value, buildSettings)!!), ) public inline infix fun String.lessThanOrEqualTo(value: T): Filter.WithConstraint = Filter.Field( this, - WhereConstraint.LessThanOrEqualTo(encode(value, buildSettings)!!) + WhereConstraint.LessThanOrEqualTo(encode(value, buildSettings)!!), ) public fun String.lessThanOrEqualTo(strategy: SerializationStrategy, value: T): Filter.WithConstraint = Filter.Field( this, - WhereConstraint.LessThanOrEqualTo(dev.gitlive.firebase.internal.encode(strategy, value, buildSettings)!!) + WhereConstraint.LessThanOrEqualTo(dev.gitlive.firebase.internal.encode(strategy, value, buildSettings)!!), ) public inline infix fun FieldPath.lessThanOrEqualTo(value: T): Filter.WithConstraint = Filter.Path( this, - WhereConstraint.LessThanOrEqualTo(encode(value, buildSettings)!!) + WhereConstraint.LessThanOrEqualTo(encode(value, buildSettings)!!), ) public fun FieldPath.lessThanOrEqualTo(strategy: SerializationStrategy, value: T): Filter.WithConstraint = Filter.Path( this, - WhereConstraint.GreaterThanOrEqualTo(dev.gitlive.firebase.internal.encode(strategy, value, buildSettings)!!) + WhereConstraint.GreaterThanOrEqualTo(dev.gitlive.firebase.internal.encode(strategy, value, buildSettings)!!), ) public inline infix fun String.greaterThanOrEqualTo(value: T): Filter.WithConstraint = Filter.Field( this, - WhereConstraint.GreaterThanOrEqualTo(encode(value, buildSettings)!!) + WhereConstraint.GreaterThanOrEqualTo(encode(value, buildSettings)!!), ) public fun String.greaterThanOrEqualTo(strategy: SerializationStrategy, value: T): Filter.WithConstraint = Filter.Field( this, - WhereConstraint.GreaterThanOrEqualTo(dev.gitlive.firebase.internal.encode(strategy, value, buildSettings)!!) + WhereConstraint.GreaterThanOrEqualTo(dev.gitlive.firebase.internal.encode(strategy, value, buildSettings)!!), ) public inline infix fun FieldPath.greaterThanOrEqualTo(value: T): Filter.WithConstraint = Filter.Path( this, - WhereConstraint.GreaterThanOrEqualTo(encode(value, buildSettings)!!) + WhereConstraint.GreaterThanOrEqualTo(encode(value, buildSettings)!!), ) public fun FieldPath.greaterThanOrEqualTo(strategy: SerializationStrategy, value: T): Filter.WithConstraint = Filter.Path( this, - WhereConstraint.LessThanOrEqualTo(dev.gitlive.firebase.internal.encode(strategy, value, buildSettings)!!) + WhereConstraint.LessThanOrEqualTo(dev.gitlive.firebase.internal.encode(strategy, value, buildSettings)!!), ) public inline infix fun String.contains(value: T): Filter.WithConstraint = Filter.Field( this, - WhereConstraint.ArrayContains(encode(value, buildSettings)!!) + WhereConstraint.ArrayContains(encode(value, buildSettings)!!), ) public fun String.contains(strategy: SerializationStrategy, value: T): Filter.WithConstraint = Filter.Field( this, - WhereConstraint.ArrayContains(dev.gitlive.firebase.internal.encode(strategy, value, buildSettings)!!) + WhereConstraint.ArrayContains(dev.gitlive.firebase.internal.encode(strategy, value, buildSettings)!!), ) public inline infix fun FieldPath.contains(value: T): Filter.WithConstraint = Filter.Path( this, - WhereConstraint.ArrayContains(encode(value, buildSettings)!!) + WhereConstraint.ArrayContains(encode(value, buildSettings)!!), ) public fun FieldPath.contains(strategy: SerializationStrategy, value: T): Filter.WithConstraint = Filter.Path( this, - WhereConstraint.ArrayContains(dev.gitlive.firebase.internal.encode(strategy, value, buildSettings)!!) + WhereConstraint.ArrayContains(dev.gitlive.firebase.internal.encode(strategy, value, buildSettings)!!), ) public inline infix fun String.containsAny(values: List): Filter.WithConstraint = Filter.Field( this, - WhereConstraint.ArrayContainsAny(values.map { encode(it, buildSettings)!! }) + WhereConstraint.ArrayContainsAny(values.map { encode(it, buildSettings)!! }), ) public fun String.containsAny(strategy: SerializationStrategy, values: List): Filter.WithConstraint = Filter.Field( this, - WhereConstraint.ArrayContainsAny(values.map {dev.gitlive.firebase.internal.encode(strategy, it, buildSettings)!! }) + WhereConstraint.ArrayContainsAny(values.map { dev.gitlive.firebase.internal.encode(strategy, it, buildSettings)!! }), ) public inline infix fun FieldPath.containsAny(values: List): Filter.WithConstraint = Filter.Path( this, - WhereConstraint.ArrayContainsAny(values.map { encode(it, buildSettings)!! }) + WhereConstraint.ArrayContainsAny(values.map { encode(it, buildSettings)!! }), ) public fun FieldPath.containsAny(strategy: SerializationStrategy, values: List): Filter.WithConstraint = Filter.Path( this, - WhereConstraint.ArrayContainsAny(values.map {dev.gitlive.firebase.internal.encode(strategy, it, buildSettings)!! }) + WhereConstraint.ArrayContainsAny(values.map { dev.gitlive.firebase.internal.encode(strategy, it, buildSettings)!! }), ) public inline infix fun String.inArray(values: List): Filter.WithConstraint = Filter.Field( this, - WhereConstraint.InArray(values.map { encode(it, buildSettings)!! }) + WhereConstraint.InArray(values.map { encode(it, buildSettings)!! }), ) public fun String.inArray(strategy: SerializationStrategy, values: List): Filter.WithConstraint = Filter.Field( this, - WhereConstraint.InArray(values.map {dev.gitlive.firebase.internal.encode(strategy, it, buildSettings)!! }) + WhereConstraint.InArray(values.map { dev.gitlive.firebase.internal.encode(strategy, it, buildSettings)!! }), ) public inline infix fun FieldPath.inArray(values: List): Filter.WithConstraint = Filter.Path( this, - WhereConstraint.InArray(values.map { encode(it, buildSettings)!! }) + WhereConstraint.InArray(values.map { encode(it, buildSettings)!! }), ) public fun FieldPath.inArray(strategy: SerializationStrategy, values: List): Filter.WithConstraint = Filter.Path( this, - WhereConstraint.InArray(values.map {dev.gitlive.firebase.internal.encode(strategy, it, buildSettings)!! }) + WhereConstraint.InArray(values.map { dev.gitlive.firebase.internal.encode(strategy, it, buildSettings)!! }), ) public inline infix fun String.notInArray(values: List): Filter.WithConstraint = Filter.Field( this, - WhereConstraint.NotInArray(values.map { encode(it, buildSettings)!! }) + WhereConstraint.NotInArray(values.map { encode(it, buildSettings)!! }), ) public fun String.notInArray(strategy: SerializationStrategy, values: List): Filter.WithConstraint = Filter.Field( this, - WhereConstraint.NotInArray(values.map {dev.gitlive.firebase.internal.encode(strategy, it, buildSettings)!! }) + WhereConstraint.NotInArray(values.map { dev.gitlive.firebase.internal.encode(strategy, it, buildSettings)!! }), ) public inline infix fun FieldPath.notInArray(values: List): Filter.WithConstraint = Filter.Path( this, - WhereConstraint.NotInArray(values.map { encode(it, buildSettings)!! }) + WhereConstraint.NotInArray(values.map { encode(it, buildSettings)!! }), ) public fun FieldPath.notInArray(strategy: SerializationStrategy, values: List): Filter.WithConstraint = Filter.Path( this, - WhereConstraint.NotInArray(values.map {dev.gitlive.firebase.internal.encode(strategy, it, buildSettings)!! }) + WhereConstraint.NotInArray(values.map { dev.gitlive.firebase.internal.encode(strategy, it, buildSettings)!! }), ) public infix fun Filter.and(right: Filter): Filter.And { diff --git a/firebase-firestore/src/commonMain/kotlin/dev/gitlive/firebase/firestore/firestore.kt b/firebase-firestore/src/commonMain/kotlin/dev/gitlive/firebase/firestore/firestore.kt index 795c481b1..98f744214 100644 --- a/firebase-firestore/src/commonMain/kotlin/dev/gitlive/firebase/firestore/firestore.kt +++ b/firebase-firestore/src/commonMain/kotlin/dev/gitlive/firebase/firestore/firestore.kt @@ -190,10 +190,24 @@ public data class Transaction internal constructor(internal val nativeWrapper: N public inline fun update(documentRef: DocumentReference, strategy: SerializationStrategy, data: T, buildSettings: EncodeSettings.Builder.() -> Unit = {}): Transaction = updateEncoded(documentRef, encodeAsObject(strategy, data, buildSettings)) @JvmName("updateFields") - public inline fun update(documentRef: DocumentReference, vararg fieldsAndValues: Pair, buildSettings: EncodeSettings.Builder.() -> Unit = {}): Transaction = updateEncodedFieldsAndValues(documentRef, encodeFieldAndValue(fieldsAndValues, buildSettings).orEmpty()) + public fun update(documentRef: DocumentReference, vararg fieldsAndValues: Pair, buildSettings: EncodeSettings.Builder.() -> Unit = {}): Transaction = update( + documentRef, + *fieldsAndValues.map { (key, value) -> key to value.encodable() }.toTypedArray(), + buildSettings = buildSettings, + ) + + @JvmName("updateFieldsWithEncodableValue") + public fun update(documentRef: DocumentReference, vararg fieldsAndValues: Pair, buildSettings: EncodeSettings.Builder.() -> Unit = {}): Transaction = updateEncodedFieldsAndValues(documentRef, encodeFieldAndValue(fieldsAndValues, buildSettings).orEmpty()) @JvmName("updateFieldPaths") - public inline fun update(documentRef: DocumentReference, vararg fieldsAndValues: Pair, buildSettings: EncodeSettings.Builder.() -> Unit = {}): Transaction = updateEncodedFieldPathsAndValues(documentRef, encodeFieldAndValue(fieldsAndValues, buildSettings).orEmpty()) + public fun update(documentRef: DocumentReference, vararg fieldsAndValues: Pair, buildSettings: EncodeSettings.Builder.() -> Unit = {}): Transaction = update( + documentRef, + *fieldsAndValues.map { (key, value) -> key to value.encodable() }.toTypedArray(), + buildSettings = buildSettings, + ) + + @JvmName("updateFieldPathsWithEncodableValue") + public fun update(documentRef: DocumentReference, vararg fieldsAndValues: Pair, buildSettings: EncodeSettings.Builder.() -> Unit = {}): Transaction = updateEncodedFieldPathsAndValues(documentRef, encodeFieldAndValue(fieldsAndValues, buildSettings).orEmpty()) @PublishedApi internal fun updateEncoded(documentRef: DocumentReference, encodedData: EncodedObject): Transaction = Transaction(nativeWrapper.updateEncoded(documentRef, encodedData)) @@ -229,14 +243,26 @@ public open class Query internal constructor(internal val nativeQuery: NativeQue public fun orderBy(field: FieldPath, direction: Direction = Direction.ASCENDING): Query = Query(nativeQuery.orderBy(field.encoded, direction)) public fun startAfter(document: DocumentSnapshot): Query = Query(nativeQuery.startAfter(document.native)) - public fun startAfter(vararg fieldValues: Any, buildSettings: EncodeSettings.Builder.() -> Unit = {}): Query = Query(nativeQuery.startAfter(*(fieldValues.map { encode(it, buildSettings)!! }.toTypedArray()))) + public fun startAfter(vararg fieldValues: Any?, buildSettings: EncodeSettings.Builder.() -> Unit = {}): Query = startAfter(*fieldValues.map { it.encodable() }.toTypedArray(), buildSettings = buildSettings) + + @JvmName("startAfterWithEncodableValue") + public fun startAfter(vararg fieldValues: EncodableValue, buildSettings: EncodeSettings.Builder.() -> Unit = {}): Query = Query(nativeQuery.startAfter(*(fieldValues.map { it.encoded(buildSettings)!! }.toTypedArray()))) public fun startAt(document: DocumentSnapshot): Query = Query(nativeQuery.startAt(document.native)) - public fun startAt(vararg fieldValues: Any, buildSettings: EncodeSettings.Builder.() -> Unit = {}): Query = Query(nativeQuery.startAt(*(fieldValues.map { encode(it, buildSettings)!! }.toTypedArray()))) + public fun startAt(vararg fieldValues: Any?, buildSettings: EncodeSettings.Builder.() -> Unit = {}): Query = startAt(*fieldValues.map { it.encodable() }.toTypedArray(), buildSettings = buildSettings) + + @JvmName("startAtWithEncodableValue") + public fun startAt(vararg fieldValues: EncodableValue, buildSettings: EncodeSettings.Builder.() -> Unit = {}): Query = Query(nativeQuery.startAt(*(fieldValues.map { it.encoded(buildSettings)!! }.toTypedArray()))) public fun endBefore(document: DocumentSnapshot): Query = Query(nativeQuery.endBefore(document.native)) - public fun endBefore(vararg fieldValues: Any, buildSettings: EncodeSettings.Builder.() -> Unit = {}): Query = Query(nativeQuery.endBefore(*(fieldValues.map { encode(it, buildSettings)!! }.toTypedArray()))) + public fun endBefore(vararg fieldValues: Any?, buildSettings: EncodeSettings.Builder.() -> Unit = {}): Query = endBefore(*fieldValues.map { it.encodable() }.toTypedArray(), buildSettings = buildSettings) + + @JvmName("endBeforeWithEncodableValue") + public fun endBefore(vararg fieldValues: EncodableValue, buildSettings: EncodeSettings.Builder.() -> Unit = {}): Query = Query(nativeQuery.endBefore(*(fieldValues.map { it.encoded(buildSettings)!! }.toTypedArray()))) public fun endAt(document: DocumentSnapshot): Query = Query(nativeQuery.endAt(document.native)) - public fun endAt(vararg fieldValues: Any, buildSettings: EncodeSettings.Builder.() -> Unit = {}): Query = Query(nativeQuery.endAt(*(fieldValues.map { encode(it, buildSettings)!! }.toTypedArray()))) + public fun endAt(vararg fieldValues: Any?, buildSettings: EncodeSettings.Builder.() -> Unit = {}): Query = endAt(*fieldValues.map { it.encodable() }.toTypedArray(), buildSettings = buildSettings) + + @JvmName("endAtWithEncodableValue") + public fun endAt(vararg fieldValues: EncodableValue, buildSettings: EncodeSettings.Builder.() -> Unit = {}): Query = Query(nativeQuery.endAt(*(fieldValues.map { it.encoded(buildSettings)!! }.toTypedArray()))) } @Deprecated("Deprecated in favor of using a [FilterBuilder]", replaceWith = ReplaceWith("where { field equalTo equalTo }", "dev.gitlive.firebase.firestore")) @@ -361,10 +387,24 @@ public data class WriteBatch internal constructor(internal val nativeWrapper: Na updateEncoded(documentRef, encodeAsObject(strategy, data, buildSettings)) @JvmName("updateField") - public inline fun update(documentRef: DocumentReference, vararg fieldsAndValues: Pair, buildSettings: EncodeSettings.Builder.() -> Unit = {}): WriteBatch = updateEncodedFieldsAndValues(documentRef, encodeFieldAndValue(fieldsAndValues, buildSettings).orEmpty()) + public fun update(documentRef: DocumentReference, vararg fieldsAndValues: Pair, buildSettings: EncodeSettings.Builder.() -> Unit = {}): WriteBatch = update( + documentRef, + *fieldsAndValues.map { (key, value) -> key to value.encodable() }.toTypedArray(), + buildSettings = buildSettings, + ) + + @JvmName("updateFieldWithEncodableValues") + public fun update(documentRef: DocumentReference, vararg fieldsAndValues: Pair, buildSettings: EncodeSettings.Builder.() -> Unit = {}): WriteBatch = updateEncodedFieldsAndValues(documentRef, encodeFieldAndValue(fieldsAndValues, buildSettings).orEmpty()) @JvmName("updateFieldPath") - public inline fun update(documentRef: DocumentReference, vararg fieldsAndValues: Pair, buildSettings: EncodeSettings.Builder.() -> Unit = {}): WriteBatch = updateEncodedFieldPathsAndValues(documentRef, encodeFieldAndValue(fieldsAndValues, buildSettings).orEmpty()) + public fun update(documentRef: DocumentReference, vararg fieldsAndValues: Pair, buildSettings: EncodeSettings.Builder.() -> Unit = {}): WriteBatch = update( + documentRef, + *fieldsAndValues.map { (key, value) -> key to value.encodable() }.toTypedArray(), + buildSettings = buildSettings, + ) + + @JvmName("updateFieldPathWithEncodableValues") + public fun update(documentRef: DocumentReference, vararg fieldsAndValues: Pair, buildSettings: EncodeSettings.Builder.() -> Unit = {}): WriteBatch = updateEncodedFieldPathsAndValues(documentRef, encodeFieldAndValue(fieldsAndValues, buildSettings).orEmpty()) @PublishedApi internal fun updateEncoded(documentRef: DocumentReference, encodedData: EncodedObject): WriteBatch = WriteBatch(nativeWrapper.updateEncoded(documentRef, encodedData)) @@ -512,7 +552,13 @@ public data class DocumentReference internal constructor(internal val native: Na } @JvmName("updateFields") - public suspend inline fun update(vararg fieldsAndValues: Pair, buildSettings: EncodeSettings.Builder.() -> Unit = {}) { + public suspend fun update(vararg fieldsAndValues: Pair, buildSettings: EncodeSettings.Builder.() -> Unit = {}): Unit = update( + *fieldsAndValues.map { (key, value) -> key to value.encodable() }.toTypedArray(), + buildSettings = buildSettings, + ) + + @JvmName("updateFieldsWithEncodableValues") + public suspend fun update(vararg fieldsAndValues: Pair, buildSettings: EncodeSettings.Builder.() -> Unit = {}) { updateEncodedFieldsAndValues( encodeFieldAndValue( fieldsAndValues, @@ -527,7 +573,13 @@ public data class DocumentReference internal constructor(internal val native: Na } @JvmName("updateFieldPaths") - public suspend inline fun update(vararg fieldsAndValues: Pair, buildSettings: EncodeSettings.Builder.() -> Unit = {}) { + public suspend fun update(vararg fieldsAndValues: Pair, buildSettings: EncodeSettings.Builder.() -> Unit = {}): Unit = update( + *fieldsAndValues.map { (key, value) -> key to value.encodable() }.toTypedArray(), + buildSettings = buildSettings, + ) + + @JvmName("updateFieldPathsWithEncodableValue") + public suspend fun update(vararg fieldsAndValues: Pair, buildSettings: EncodeSettings.Builder.() -> Unit = {}) { updateEncodedFieldPathsAndValues( encodeFieldAndValue( fieldsAndValues, diff --git a/firebase-firestore/src/commonMain/kotlin/dev/gitlive/firebase/firestore/helpers.kt b/firebase-firestore/src/commonMain/kotlin/dev/gitlive/firebase/firestore/helpers.kt index 766836a76..7a225b0f4 100644 --- a/firebase-firestore/src/commonMain/kotlin/dev/gitlive/firebase/firestore/helpers.kt +++ b/firebase-firestore/src/commonMain/kotlin/dev/gitlive/firebase/firestore/helpers.kt @@ -6,28 +6,28 @@ import kotlin.jvm.JvmName // ** Helper method to perform an update operation. */ @JvmName("performUpdateFields") @PublishedApi -internal inline fun encodeFieldAndValue( - fieldsAndValues: Array>, +internal fun encodeFieldAndValue( + fieldsAndValues: Array>, buildSettings: EncodeSettings.Builder.() -> Unit, -): List>? = encodeFieldAndValue(fieldsAndValues, encodeField = { it }, encodeValue = { encode(it, buildSettings) }) +): List>? = encodeFieldAndValue(fieldsAndValues, encodeField = { it }, buildSettings) /** Helper method to perform an update operation. */ @JvmName("performUpdateFieldPaths") @PublishedApi -internal inline fun encodeFieldAndValue( - fieldsAndValues: Array>, +internal fun encodeFieldAndValue( + fieldsAndValues: Array>, buildSettings: EncodeSettings.Builder.() -> Unit, -): List>? = encodeFieldAndValue(fieldsAndValues, { it.encoded }, { encode(it, buildSettings) }) +): List>? = encodeFieldAndValue(fieldsAndValues, { it.encoded }, buildSettings) /** Helper method to perform an update operation in Android and JS. */ @PublishedApi internal inline fun encodeFieldAndValue( - fieldsAndValues: Array>, + fieldsAndValues: Array>, encodeField: (T) -> K, - encodeValue: (Any?) -> Any?, + noinline buildSettings: EncodeSettings.Builder.() -> Unit, ): List>? = fieldsAndValues.takeUnless { fieldsAndValues.isEmpty() } - ?.map { (field, value) -> encodeField(field) to value?.let { encodeValue(it) } } + ?.map { (field, value) -> encodeField(field) to value.encoded(buildSettings) } internal fun List>.performUpdate( update: (K, Any?, Array) -> R, diff --git a/firebase-firestore/src/commonTest/kotlin/dev/gitlive/firebase/firestore/firestore.kt b/firebase-firestore/src/commonTest/kotlin/dev/gitlive/firebase/firestore/firestore.kt index d6625b1b9..54375c9b5 100644 --- a/firebase-firestore/src/commonTest/kotlin/dev/gitlive/firebase/firestore/firestore.kt +++ b/firebase-firestore/src/commonTest/kotlin/dev/gitlive/firebase/firestore/firestore.kt @@ -12,7 +12,6 @@ import dev.gitlive.firebase.internal.decode import dev.gitlive.firebase.initialize import dev.gitlive.firebase.runBlockingTest import dev.gitlive.firebase.runTest -import dev.gitlive.firebase.withSerializer import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.async import kotlinx.coroutines.delay @@ -67,7 +66,7 @@ class FirebaseFirestoreTest { @Serializable data class NestedObject( - val prop2: String + val prop2: String, ) companion object { @@ -730,7 +729,7 @@ class FirebaseFirestoreTest { // update data val updatedData = DataWithDocumentReference(documentRef2) getDocument().update( - FieldPath(DataWithDocumentReference::documentReference.name) to updatedData.documentReference.withSerializer(DocumentReferenceSerializer), + FieldPath(DataWithDocumentReference::documentReference.name) to updatedData.documentReference.encodableWithStrategy(DocumentReferenceSerializer), ) // verify update val updatedSavedData = getDocument().get().data(DataWithDocumentReference.serializer())