diff --git a/normalized-cache/api/normalized-cache.api b/normalized-cache/api/normalized-cache.api index 0174c885..587b6fd3 100644 --- a/normalized-cache/api/normalized-cache.api +++ b/normalized-cache/api/normalized-cache.api @@ -1,7 +1,8 @@ public final class com/apollographql/cache/normalized/ApolloStore { public fun (Lcom/apollographql/cache/normalized/CacheManager;Lcom/apollographql/apollo/api/CustomScalarAdapters;)V public final fun accessCache (Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; - public final fun clearAll (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public final fun clearAll (ZLkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static synthetic fun clearAll$default (Lcom/apollographql/cache/normalized/ApolloStore;ZLkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; public final fun dispose ()V public final fun dump (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public final fun getCacheManager ()Lcom/apollographql/cache/normalized/CacheManager; @@ -18,24 +19,27 @@ public final class com/apollographql/cache/normalized/ApolloStore { public static synthetic fun remove$default (Lcom/apollographql/cache/normalized/ApolloStore;Ljava/util/List;ZLkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; public final fun remove-7OwBRqc (Ljava/lang/String;ZLkotlin/coroutines/Continuation;)Ljava/lang/Object; public static synthetic fun remove-7OwBRqc$default (Lcom/apollographql/cache/normalized/ApolloStore;Ljava/lang/String;ZLkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; - public final fun rollbackOptimisticUpdates (Ljava/util/UUID;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public final fun rollbackOptimisticUpdates (Ljava/util/UUID;ZLkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static synthetic fun rollbackOptimisticUpdates$default (Lcom/apollographql/cache/normalized/ApolloStore;Ljava/util/UUID;ZLkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; public final fun trim (JFLkotlin/coroutines/Continuation;)Ljava/lang/Object; public static synthetic fun trim$default (Lcom/apollographql/cache/normalized/ApolloStore;JFLkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; - public final fun writeFragment-1qdIjGk (Lcom/apollographql/apollo/api/Fragment;Ljava/lang/String;Lcom/apollographql/apollo/api/Fragment$Data;Lcom/apollographql/cache/normalized/api/CacheHeaders;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; - public static synthetic fun writeFragment-1qdIjGk$default (Lcom/apollographql/cache/normalized/ApolloStore;Lcom/apollographql/apollo/api/Fragment;Ljava/lang/String;Lcom/apollographql/apollo/api/Fragment$Data;Lcom/apollographql/cache/normalized/api/CacheHeaders;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; - public final fun writeOperation (Lcom/apollographql/apollo/api/Operation;Lcom/apollographql/apollo/api/Operation$Data;Ljava/util/List;Lcom/apollographql/cache/normalized/api/CacheHeaders;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; - public final fun writeOperation (Lcom/apollographql/apollo/api/Operation;Ljava/util/Map;Lcom/apollographql/cache/normalized/api/CacheHeaders;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; - public static synthetic fun writeOperation$default (Lcom/apollographql/cache/normalized/ApolloStore;Lcom/apollographql/apollo/api/Operation;Lcom/apollographql/apollo/api/Operation$Data;Ljava/util/List;Lcom/apollographql/cache/normalized/api/CacheHeaders;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; - public static synthetic fun writeOperation$default (Lcom/apollographql/cache/normalized/ApolloStore;Lcom/apollographql/apollo/api/Operation;Ljava/util/Map;Lcom/apollographql/cache/normalized/api/CacheHeaders;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; - public final fun writeOptimisticUpdates (Lcom/apollographql/apollo/api/Operation;Lcom/apollographql/apollo/api/Operation$Data;Ljava/util/UUID;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; - public final fun writeOptimisticUpdates-1qdIjGk (Lcom/apollographql/apollo/api/Fragment;Ljava/lang/String;Lcom/apollographql/apollo/api/Fragment$Data;Ljava/util/UUID;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public final fun writeFragment-LHfx5Yk (Lcom/apollographql/apollo/api/Fragment;Ljava/lang/String;Lcom/apollographql/apollo/api/Fragment$Data;Lcom/apollographql/cache/normalized/api/CacheHeaders;ZLkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static synthetic fun writeFragment-LHfx5Yk$default (Lcom/apollographql/cache/normalized/ApolloStore;Lcom/apollographql/apollo/api/Fragment;Ljava/lang/String;Lcom/apollographql/apollo/api/Fragment$Data;Lcom/apollographql/cache/normalized/api/CacheHeaders;ZLkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; + public final fun writeOperation (Lcom/apollographql/apollo/api/Operation;Lcom/apollographql/apollo/api/Operation$Data;Ljava/util/List;Lcom/apollographql/cache/normalized/api/CacheHeaders;ZLkotlin/coroutines/Continuation;)Ljava/lang/Object; + public final fun writeOperation (Lcom/apollographql/apollo/api/Operation;Ljava/util/Map;Lcom/apollographql/cache/normalized/api/CacheHeaders;ZLkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static synthetic fun writeOperation$default (Lcom/apollographql/cache/normalized/ApolloStore;Lcom/apollographql/apollo/api/Operation;Lcom/apollographql/apollo/api/Operation$Data;Ljava/util/List;Lcom/apollographql/cache/normalized/api/CacheHeaders;ZLkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; + public static synthetic fun writeOperation$default (Lcom/apollographql/cache/normalized/ApolloStore;Lcom/apollographql/apollo/api/Operation;Ljava/util/Map;Lcom/apollographql/cache/normalized/api/CacheHeaders;ZLkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; + public final fun writeOptimisticUpdates (Lcom/apollographql/apollo/api/Operation;Lcom/apollographql/apollo/api/Operation$Data;Ljava/util/UUID;ZLkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static synthetic fun writeOptimisticUpdates$default (Lcom/apollographql/cache/normalized/ApolloStore;Lcom/apollographql/apollo/api/Operation;Lcom/apollographql/apollo/api/Operation$Data;Ljava/util/UUID;ZLkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; + public final fun writeOptimisticUpdates-LHfx5Yk (Lcom/apollographql/apollo/api/Fragment;Ljava/lang/String;Lcom/apollographql/apollo/api/Fragment$Data;Ljava/util/UUID;ZLkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static synthetic fun writeOptimisticUpdates-LHfx5Yk$default (Lcom/apollographql/cache/normalized/ApolloStore;Lcom/apollographql/apollo/api/Fragment;Ljava/lang/String;Lcom/apollographql/apollo/api/Fragment$Data;Ljava/util/UUID;ZLkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; } public final class com/apollographql/cache/normalized/ApolloStoreKt { - public static final fun removeFragment-BDKj5R4 (Lcom/apollographql/cache/normalized/ApolloStore;Lcom/apollographql/apollo/api/Fragment;Ljava/lang/String;Lcom/apollographql/apollo/api/Fragment$Data;Lcom/apollographql/cache/normalized/api/CacheHeaders;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; - public static synthetic fun removeFragment-BDKj5R4$default (Lcom/apollographql/cache/normalized/ApolloStore;Lcom/apollographql/apollo/api/Fragment;Ljava/lang/String;Lcom/apollographql/apollo/api/Fragment$Data;Lcom/apollographql/cache/normalized/api/CacheHeaders;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; - public static final fun removeOperation (Lcom/apollographql/cache/normalized/ApolloStore;Lcom/apollographql/apollo/api/Operation;Lcom/apollographql/apollo/api/Operation$Data;Lcom/apollographql/cache/normalized/api/CacheHeaders;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; - public static synthetic fun removeOperation$default (Lcom/apollographql/cache/normalized/ApolloStore;Lcom/apollographql/apollo/api/Operation;Lcom/apollographql/apollo/api/Operation$Data;Lcom/apollographql/cache/normalized/api/CacheHeaders;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; + public static final fun removeFragment-9Kxz0Qw (Lcom/apollographql/cache/normalized/ApolloStore;Lcom/apollographql/apollo/api/Fragment;Ljava/lang/String;Lcom/apollographql/apollo/api/Fragment$Data;Lcom/apollographql/cache/normalized/api/CacheHeaders;ZLkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static synthetic fun removeFragment-9Kxz0Qw$default (Lcom/apollographql/cache/normalized/ApolloStore;Lcom/apollographql/apollo/api/Fragment;Ljava/lang/String;Lcom/apollographql/apollo/api/Fragment$Data;Lcom/apollographql/cache/normalized/api/CacheHeaders;ZLkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; + public static final fun removeOperation (Lcom/apollographql/cache/normalized/ApolloStore;Lcom/apollographql/apollo/api/Operation;Lcom/apollographql/apollo/api/Operation$Data;Lcom/apollographql/cache/normalized/api/CacheHeaders;ZLkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static synthetic fun removeOperation$default (Lcom/apollographql/cache/normalized/ApolloStore;Lcom/apollographql/apollo/api/Operation;Lcom/apollographql/apollo/api/Operation$Data;Lcom/apollographql/cache/normalized/api/CacheHeaders;ZLkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; } public final class com/apollographql/cache/normalized/CacheHeadersKt { @@ -87,7 +91,7 @@ public final class com/apollographql/cache/normalized/CacheInfoKt { public abstract interface class com/apollographql/cache/normalized/CacheManager { public static final field Companion Lcom/apollographql/cache/normalized/CacheManager$Companion; public abstract fun accessCache (Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; - public abstract fun clearAll (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public abstract fun clearAll (ZLkotlin/coroutines/Continuation;)Ljava/lang/Object; public abstract fun dispose ()V public abstract fun dump (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public abstract fun getChangedKeys ()Lkotlinx/coroutines/flow/SharedFlow; @@ -97,13 +101,13 @@ public abstract interface class com/apollographql/cache/normalized/CacheManager public abstract fun readOperation (Lcom/apollographql/apollo/api/Operation;Lcom/apollographql/apollo/api/CustomScalarAdapters;Lcom/apollographql/cache/normalized/api/CacheHeaders;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public abstract fun remove (Ljava/util/List;ZLkotlin/coroutines/Continuation;)Ljava/lang/Object; public abstract fun remove-7OwBRqc (Ljava/lang/String;ZLkotlin/coroutines/Continuation;)Ljava/lang/Object; - public abstract fun rollbackOptimisticUpdates (Ljava/util/UUID;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public abstract fun rollbackOptimisticUpdates (Ljava/util/UUID;ZLkotlin/coroutines/Continuation;)Ljava/lang/Object; public abstract fun trim (JFLkotlin/coroutines/Continuation;)Ljava/lang/Object; - public abstract fun writeFragment-LHfx5Yk (Lcom/apollographql/apollo/api/Fragment;Ljava/lang/String;Lcom/apollographql/apollo/api/Fragment$Data;Lcom/apollographql/apollo/api/CustomScalarAdapters;Lcom/apollographql/cache/normalized/api/CacheHeaders;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; - public abstract fun writeOperation (Lcom/apollographql/apollo/api/Operation;Lcom/apollographql/apollo/api/Operation$Data;Ljava/util/List;Lcom/apollographql/apollo/api/CustomScalarAdapters;Lcom/apollographql/cache/normalized/api/CacheHeaders;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; - public abstract fun writeOperation (Lcom/apollographql/apollo/api/Operation;Ljava/util/Map;Lcom/apollographql/apollo/api/CustomScalarAdapters;Lcom/apollographql/cache/normalized/api/CacheHeaders;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; - public abstract fun writeOptimisticUpdates (Lcom/apollographql/apollo/api/Operation;Lcom/apollographql/apollo/api/Operation$Data;Ljava/util/UUID;Lcom/apollographql/apollo/api/CustomScalarAdapters;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; - public abstract fun writeOptimisticUpdates-LHfx5Yk (Lcom/apollographql/apollo/api/Fragment;Ljava/lang/String;Lcom/apollographql/apollo/api/Fragment$Data;Ljava/util/UUID;Lcom/apollographql/apollo/api/CustomScalarAdapters;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public abstract fun writeFragment-EmhL1DQ (Lcom/apollographql/apollo/api/Fragment;Ljava/lang/String;Lcom/apollographql/apollo/api/Fragment$Data;Lcom/apollographql/apollo/api/CustomScalarAdapters;Lcom/apollographql/cache/normalized/api/CacheHeaders;ZLkotlin/coroutines/Continuation;)Ljava/lang/Object; + public abstract fun writeOperation (Lcom/apollographql/apollo/api/Operation;Lcom/apollographql/apollo/api/Operation$Data;Ljava/util/List;Lcom/apollographql/apollo/api/CustomScalarAdapters;Lcom/apollographql/cache/normalized/api/CacheHeaders;ZLkotlin/coroutines/Continuation;)Ljava/lang/Object; + public abstract fun writeOperation (Lcom/apollographql/apollo/api/Operation;Ljava/util/Map;Lcom/apollographql/apollo/api/CustomScalarAdapters;Lcom/apollographql/cache/normalized/api/CacheHeaders;ZLkotlin/coroutines/Continuation;)Ljava/lang/Object; + public abstract fun writeOptimisticUpdates (Lcom/apollographql/apollo/api/Operation;Lcom/apollographql/apollo/api/Operation$Data;Ljava/util/UUID;Lcom/apollographql/apollo/api/CustomScalarAdapters;ZLkotlin/coroutines/Continuation;)Ljava/lang/Object; + public abstract fun writeOptimisticUpdates-EmhL1DQ (Lcom/apollographql/apollo/api/Fragment;Ljava/lang/String;Lcom/apollographql/apollo/api/Fragment$Data;Ljava/util/UUID;Lcom/apollographql/apollo/api/CustomScalarAdapters;ZLkotlin/coroutines/Continuation;)Ljava/lang/Object; } public final class com/apollographql/cache/normalized/CacheManager$Companion { @@ -111,17 +115,19 @@ public final class com/apollographql/cache/normalized/CacheManager$Companion { } public final class com/apollographql/cache/normalized/CacheManager$DefaultImpls { + public static synthetic fun clearAll$default (Lcom/apollographql/cache/normalized/CacheManager;ZLkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; public static synthetic fun normalize-niOPdRo$default (Lcom/apollographql/cache/normalized/CacheManager;Lcom/apollographql/apollo/api/Executable;Ljava/util/Map;Ljava/lang/String;Lcom/apollographql/apollo/api/CustomScalarAdapters;ILjava/lang/Object;)Ljava/util/Map; public static synthetic fun readFragment-1qdIjGk$default (Lcom/apollographql/cache/normalized/CacheManager;Lcom/apollographql/apollo/api/Fragment;Ljava/lang/String;Lcom/apollographql/apollo/api/CustomScalarAdapters;Lcom/apollographql/cache/normalized/api/CacheHeaders;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; public static synthetic fun readOperation$default (Lcom/apollographql/cache/normalized/CacheManager;Lcom/apollographql/apollo/api/Operation;Lcom/apollographql/apollo/api/CustomScalarAdapters;Lcom/apollographql/cache/normalized/api/CacheHeaders;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; public static synthetic fun remove$default (Lcom/apollographql/cache/normalized/CacheManager;Ljava/util/List;ZLkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; public static synthetic fun remove-7OwBRqc$default (Lcom/apollographql/cache/normalized/CacheManager;Ljava/lang/String;ZLkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; + public static synthetic fun rollbackOptimisticUpdates$default (Lcom/apollographql/cache/normalized/CacheManager;Ljava/util/UUID;ZLkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; public static synthetic fun trim$default (Lcom/apollographql/cache/normalized/CacheManager;JFLkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; - public static synthetic fun writeFragment-LHfx5Yk$default (Lcom/apollographql/cache/normalized/CacheManager;Lcom/apollographql/apollo/api/Fragment;Ljava/lang/String;Lcom/apollographql/apollo/api/Fragment$Data;Lcom/apollographql/apollo/api/CustomScalarAdapters;Lcom/apollographql/cache/normalized/api/CacheHeaders;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; - public static synthetic fun writeOperation$default (Lcom/apollographql/cache/normalized/CacheManager;Lcom/apollographql/apollo/api/Operation;Lcom/apollographql/apollo/api/Operation$Data;Ljava/util/List;Lcom/apollographql/apollo/api/CustomScalarAdapters;Lcom/apollographql/cache/normalized/api/CacheHeaders;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; - public static synthetic fun writeOperation$default (Lcom/apollographql/cache/normalized/CacheManager;Lcom/apollographql/apollo/api/Operation;Ljava/util/Map;Lcom/apollographql/apollo/api/CustomScalarAdapters;Lcom/apollographql/cache/normalized/api/CacheHeaders;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; - public static synthetic fun writeOptimisticUpdates$default (Lcom/apollographql/cache/normalized/CacheManager;Lcom/apollographql/apollo/api/Operation;Lcom/apollographql/apollo/api/Operation$Data;Ljava/util/UUID;Lcom/apollographql/apollo/api/CustomScalarAdapters;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; - public static synthetic fun writeOptimisticUpdates-LHfx5Yk$default (Lcom/apollographql/cache/normalized/CacheManager;Lcom/apollographql/apollo/api/Fragment;Ljava/lang/String;Lcom/apollographql/apollo/api/Fragment$Data;Ljava/util/UUID;Lcom/apollographql/apollo/api/CustomScalarAdapters;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; + public static synthetic fun writeFragment-EmhL1DQ$default (Lcom/apollographql/cache/normalized/CacheManager;Lcom/apollographql/apollo/api/Fragment;Ljava/lang/String;Lcom/apollographql/apollo/api/Fragment$Data;Lcom/apollographql/apollo/api/CustomScalarAdapters;Lcom/apollographql/cache/normalized/api/CacheHeaders;ZLkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; + public static synthetic fun writeOperation$default (Lcom/apollographql/cache/normalized/CacheManager;Lcom/apollographql/apollo/api/Operation;Lcom/apollographql/apollo/api/Operation$Data;Ljava/util/List;Lcom/apollographql/apollo/api/CustomScalarAdapters;Lcom/apollographql/cache/normalized/api/CacheHeaders;ZLkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; + public static synthetic fun writeOperation$default (Lcom/apollographql/cache/normalized/CacheManager;Lcom/apollographql/apollo/api/Operation;Ljava/util/Map;Lcom/apollographql/apollo/api/CustomScalarAdapters;Lcom/apollographql/cache/normalized/api/CacheHeaders;ZLkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; + public static synthetic fun writeOptimisticUpdates$default (Lcom/apollographql/cache/normalized/CacheManager;Lcom/apollographql/apollo/api/Operation;Lcom/apollographql/apollo/api/Operation$Data;Ljava/util/UUID;Lcom/apollographql/apollo/api/CustomScalarAdapters;ZLkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; + public static synthetic fun writeOptimisticUpdates-EmhL1DQ$default (Lcom/apollographql/cache/normalized/CacheManager;Lcom/apollographql/apollo/api/Fragment;Ljava/lang/String;Lcom/apollographql/apollo/api/Fragment$Data;Ljava/util/UUID;Lcom/apollographql/apollo/api/CustomScalarAdapters;ZLkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; } public final class com/apollographql/cache/normalized/CacheManager$ReadResult { diff --git a/normalized-cache/api/normalized-cache.klib.api b/normalized-cache/api/normalized-cache.klib.api index 393a8059..070f1658 100644 --- a/normalized-cache/api/normalized-cache.klib.api +++ b/normalized-cache/api/normalized-cache.klib.api @@ -89,19 +89,19 @@ abstract interface com.apollographql.cache.normalized/CacheManager { // com.apol abstract fun <#A1: com.apollographql.apollo.api/Executable.Data> normalize(com.apollographql.apollo.api/Executable<#A1>, kotlin.collections/Map, com.apollographql.cache.normalized.api/CacheKey = ..., com.apollographql.apollo.api/CustomScalarAdapters = ...): kotlin.collections/Map // com.apollographql.cache.normalized/CacheManager.normalize|normalize(com.apollographql.apollo.api.Executable<0:0>;kotlin.collections.Map;com.apollographql.cache.normalized.api.CacheKey;com.apollographql.apollo.api.CustomScalarAdapters){0§}[0] abstract fun dispose() // com.apollographql.cache.normalized/CacheManager.dispose|dispose(){}[0] abstract suspend fun <#A1: com.apollographql.apollo.api/Fragment.Data> readFragment(com.apollographql.apollo.api/Fragment<#A1>, com.apollographql.cache.normalized.api/CacheKey, com.apollographql.apollo.api/CustomScalarAdapters = ..., com.apollographql.cache.normalized.api/CacheHeaders = ...): com.apollographql.cache.normalized/CacheManager.ReadResult<#A1> // com.apollographql.cache.normalized/CacheManager.readFragment|readFragment(com.apollographql.apollo.api.Fragment<0:0>;com.apollographql.cache.normalized.api.CacheKey;com.apollographql.apollo.api.CustomScalarAdapters;com.apollographql.cache.normalized.api.CacheHeaders){0§}[0] - abstract suspend fun <#A1: com.apollographql.apollo.api/Fragment.Data> writeFragment(com.apollographql.apollo.api/Fragment<#A1>, com.apollographql.cache.normalized.api/CacheKey, #A1, com.apollographql.apollo.api/CustomScalarAdapters = ..., com.apollographql.cache.normalized.api/CacheHeaders = ...): kotlin.collections/Set // com.apollographql.cache.normalized/CacheManager.writeFragment|writeFragment(com.apollographql.apollo.api.Fragment<0:0>;com.apollographql.cache.normalized.api.CacheKey;0:0;com.apollographql.apollo.api.CustomScalarAdapters;com.apollographql.cache.normalized.api.CacheHeaders){0§}[0] - abstract suspend fun <#A1: com.apollographql.apollo.api/Fragment.Data> writeOptimisticUpdates(com.apollographql.apollo.api/Fragment<#A1>, com.apollographql.cache.normalized.api/CacheKey, #A1, com.benasher44.uuid/Uuid, com.apollographql.apollo.api/CustomScalarAdapters = ...): kotlin.collections/Set // com.apollographql.cache.normalized/CacheManager.writeOptimisticUpdates|writeOptimisticUpdates(com.apollographql.apollo.api.Fragment<0:0>;com.apollographql.cache.normalized.api.CacheKey;0:0;com.benasher44.uuid.Uuid;com.apollographql.apollo.api.CustomScalarAdapters){0§}[0] + abstract suspend fun <#A1: com.apollographql.apollo.api/Fragment.Data> writeFragment(com.apollographql.apollo.api/Fragment<#A1>, com.apollographql.cache.normalized.api/CacheKey, #A1, com.apollographql.apollo.api/CustomScalarAdapters = ..., com.apollographql.cache.normalized.api/CacheHeaders = ..., kotlin/Boolean = ...): kotlin.collections/Set // com.apollographql.cache.normalized/CacheManager.writeFragment|writeFragment(com.apollographql.apollo.api.Fragment<0:0>;com.apollographql.cache.normalized.api.CacheKey;0:0;com.apollographql.apollo.api.CustomScalarAdapters;com.apollographql.cache.normalized.api.CacheHeaders;kotlin.Boolean){0§}[0] + abstract suspend fun <#A1: com.apollographql.apollo.api/Fragment.Data> writeOptimisticUpdates(com.apollographql.apollo.api/Fragment<#A1>, com.apollographql.cache.normalized.api/CacheKey, #A1, com.benasher44.uuid/Uuid, com.apollographql.apollo.api/CustomScalarAdapters = ..., kotlin/Boolean = ...): kotlin.collections/Set // com.apollographql.cache.normalized/CacheManager.writeOptimisticUpdates|writeOptimisticUpdates(com.apollographql.apollo.api.Fragment<0:0>;com.apollographql.cache.normalized.api.CacheKey;0:0;com.benasher44.uuid.Uuid;com.apollographql.apollo.api.CustomScalarAdapters;kotlin.Boolean){0§}[0] abstract suspend fun <#A1: com.apollographql.apollo.api/Operation.Data> readOperation(com.apollographql.apollo.api/Operation<#A1>, com.apollographql.apollo.api/CustomScalarAdapters = ..., com.apollographql.cache.normalized.api/CacheHeaders = ...): com.apollographql.apollo.api/ApolloResponse<#A1> // com.apollographql.cache.normalized/CacheManager.readOperation|readOperation(com.apollographql.apollo.api.Operation<0:0>;com.apollographql.apollo.api.CustomScalarAdapters;com.apollographql.cache.normalized.api.CacheHeaders){0§}[0] - abstract suspend fun <#A1: com.apollographql.apollo.api/Operation.Data> writeOperation(com.apollographql.apollo.api/Operation<#A1>, #A1, kotlin.collections/List? = ..., com.apollographql.apollo.api/CustomScalarAdapters = ..., com.apollographql.cache.normalized.api/CacheHeaders = ...): kotlin.collections/Set // com.apollographql.cache.normalized/CacheManager.writeOperation|writeOperation(com.apollographql.apollo.api.Operation<0:0>;0:0;kotlin.collections.List?;com.apollographql.apollo.api.CustomScalarAdapters;com.apollographql.cache.normalized.api.CacheHeaders){0§}[0] - abstract suspend fun <#A1: com.apollographql.apollo.api/Operation.Data> writeOperation(com.apollographql.apollo.api/Operation<#A1>, kotlin.collections/Map, com.apollographql.apollo.api/CustomScalarAdapters = ..., com.apollographql.cache.normalized.api/CacheHeaders = ...): kotlin.collections/Set // com.apollographql.cache.normalized/CacheManager.writeOperation|writeOperation(com.apollographql.apollo.api.Operation<0:0>;kotlin.collections.Map;com.apollographql.apollo.api.CustomScalarAdapters;com.apollographql.cache.normalized.api.CacheHeaders){0§}[0] - abstract suspend fun <#A1: com.apollographql.apollo.api/Operation.Data> writeOptimisticUpdates(com.apollographql.apollo.api/Operation<#A1>, #A1, com.benasher44.uuid/Uuid, com.apollographql.apollo.api/CustomScalarAdapters = ...): kotlin.collections/Set // com.apollographql.cache.normalized/CacheManager.writeOptimisticUpdates|writeOptimisticUpdates(com.apollographql.apollo.api.Operation<0:0>;0:0;com.benasher44.uuid.Uuid;com.apollographql.apollo.api.CustomScalarAdapters){0§}[0] + abstract suspend fun <#A1: com.apollographql.apollo.api/Operation.Data> writeOperation(com.apollographql.apollo.api/Operation<#A1>, #A1, kotlin.collections/List? = ..., com.apollographql.apollo.api/CustomScalarAdapters = ..., com.apollographql.cache.normalized.api/CacheHeaders = ..., kotlin/Boolean = ...): kotlin.collections/Set // com.apollographql.cache.normalized/CacheManager.writeOperation|writeOperation(com.apollographql.apollo.api.Operation<0:0>;0:0;kotlin.collections.List?;com.apollographql.apollo.api.CustomScalarAdapters;com.apollographql.cache.normalized.api.CacheHeaders;kotlin.Boolean){0§}[0] + abstract suspend fun <#A1: com.apollographql.apollo.api/Operation.Data> writeOperation(com.apollographql.apollo.api/Operation<#A1>, kotlin.collections/Map, com.apollographql.apollo.api/CustomScalarAdapters = ..., com.apollographql.cache.normalized.api/CacheHeaders = ..., kotlin/Boolean = ...): kotlin.collections/Set // com.apollographql.cache.normalized/CacheManager.writeOperation|writeOperation(com.apollographql.apollo.api.Operation<0:0>;kotlin.collections.Map;com.apollographql.apollo.api.CustomScalarAdapters;com.apollographql.cache.normalized.api.CacheHeaders;kotlin.Boolean){0§}[0] + abstract suspend fun <#A1: com.apollographql.apollo.api/Operation.Data> writeOptimisticUpdates(com.apollographql.apollo.api/Operation<#A1>, #A1, com.benasher44.uuid/Uuid, com.apollographql.apollo.api/CustomScalarAdapters = ..., kotlin/Boolean = ...): kotlin.collections/Set // com.apollographql.cache.normalized/CacheManager.writeOptimisticUpdates|writeOptimisticUpdates(com.apollographql.apollo.api.Operation<0:0>;0:0;com.benasher44.uuid.Uuid;com.apollographql.apollo.api.CustomScalarAdapters;kotlin.Boolean){0§}[0] abstract suspend fun <#A1: kotlin/Any?> accessCache(kotlin.coroutines/SuspendFunction1): #A1 // com.apollographql.cache.normalized/CacheManager.accessCache|accessCache(kotlin.coroutines.SuspendFunction1){0§}[0] - abstract suspend fun clearAll(): kotlin/Boolean // com.apollographql.cache.normalized/CacheManager.clearAll|clearAll(){}[0] + abstract suspend fun clearAll(kotlin/Boolean = ...): kotlin/Boolean // com.apollographql.cache.normalized/CacheManager.clearAll|clearAll(kotlin.Boolean){}[0] abstract suspend fun dump(): kotlin.collections/Map, kotlin.collections/Map> // com.apollographql.cache.normalized/CacheManager.dump|dump(){}[0] abstract suspend fun publish(kotlin.collections/Set) // com.apollographql.cache.normalized/CacheManager.publish|publish(kotlin.collections.Set){}[0] abstract suspend fun remove(com.apollographql.cache.normalized.api/CacheKey, kotlin/Boolean = ...): kotlin/Boolean // com.apollographql.cache.normalized/CacheManager.remove|remove(com.apollographql.cache.normalized.api.CacheKey;kotlin.Boolean){}[0] abstract suspend fun remove(kotlin.collections/List, kotlin/Boolean = ...): kotlin/Int // com.apollographql.cache.normalized/CacheManager.remove|remove(kotlin.collections.List;kotlin.Boolean){}[0] - abstract suspend fun rollbackOptimisticUpdates(com.benasher44.uuid/Uuid): kotlin.collections/Set // com.apollographql.cache.normalized/CacheManager.rollbackOptimisticUpdates|rollbackOptimisticUpdates(com.benasher44.uuid.Uuid){}[0] + abstract suspend fun rollbackOptimisticUpdates(com.benasher44.uuid/Uuid, kotlin/Boolean = ...): kotlin.collections/Set // com.apollographql.cache.normalized/CacheManager.rollbackOptimisticUpdates|rollbackOptimisticUpdates(com.benasher44.uuid.Uuid;kotlin.Boolean){}[0] abstract suspend fun trim(kotlin/Long, kotlin/Float = ...): kotlin/Long // com.apollographql.cache.normalized/CacheManager.trim|trim(kotlin.Long;kotlin.Float){}[0] final class <#A1: com.apollographql.apollo.api/Executable.Data> ReadResult { // com.apollographql.cache.normalized/CacheManager.ReadResult|null[0] @@ -434,19 +434,19 @@ final class com.apollographql.cache.normalized/ApolloStore { // com.apollographq final fun <#A1: com.apollographql.apollo.api/Executable.Data> normalize(com.apollographql.apollo.api/Executable<#A1>, kotlin.collections/Map, com.apollographql.cache.normalized.api/CacheKey = ...): kotlin.collections/Map // com.apollographql.cache.normalized/ApolloStore.normalize|normalize(com.apollographql.apollo.api.Executable<0:0>;kotlin.collections.Map;com.apollographql.cache.normalized.api.CacheKey){0§}[0] final fun dispose() // com.apollographql.cache.normalized/ApolloStore.dispose|dispose(){}[0] final suspend fun <#A1: com.apollographql.apollo.api/Fragment.Data> readFragment(com.apollographql.apollo.api/Fragment<#A1>, com.apollographql.cache.normalized.api/CacheKey, com.apollographql.cache.normalized.api/CacheHeaders = ...): com.apollographql.cache.normalized/CacheManager.ReadResult<#A1> // com.apollographql.cache.normalized/ApolloStore.readFragment|readFragment(com.apollographql.apollo.api.Fragment<0:0>;com.apollographql.cache.normalized.api.CacheKey;com.apollographql.cache.normalized.api.CacheHeaders){0§}[0] - final suspend fun <#A1: com.apollographql.apollo.api/Fragment.Data> writeFragment(com.apollographql.apollo.api/Fragment<#A1>, com.apollographql.cache.normalized.api/CacheKey, #A1, com.apollographql.cache.normalized.api/CacheHeaders = ...): kotlin.collections/Set // com.apollographql.cache.normalized/ApolloStore.writeFragment|writeFragment(com.apollographql.apollo.api.Fragment<0:0>;com.apollographql.cache.normalized.api.CacheKey;0:0;com.apollographql.cache.normalized.api.CacheHeaders){0§}[0] - final suspend fun <#A1: com.apollographql.apollo.api/Fragment.Data> writeOptimisticUpdates(com.apollographql.apollo.api/Fragment<#A1>, com.apollographql.cache.normalized.api/CacheKey, #A1, com.benasher44.uuid/Uuid): kotlin.collections/Set // com.apollographql.cache.normalized/ApolloStore.writeOptimisticUpdates|writeOptimisticUpdates(com.apollographql.apollo.api.Fragment<0:0>;com.apollographql.cache.normalized.api.CacheKey;0:0;com.benasher44.uuid.Uuid){0§}[0] + final suspend fun <#A1: com.apollographql.apollo.api/Fragment.Data> writeFragment(com.apollographql.apollo.api/Fragment<#A1>, com.apollographql.cache.normalized.api/CacheKey, #A1, com.apollographql.cache.normalized.api/CacheHeaders = ..., kotlin/Boolean = ...): kotlin.collections/Set // com.apollographql.cache.normalized/ApolloStore.writeFragment|writeFragment(com.apollographql.apollo.api.Fragment<0:0>;com.apollographql.cache.normalized.api.CacheKey;0:0;com.apollographql.cache.normalized.api.CacheHeaders;kotlin.Boolean){0§}[0] + final suspend fun <#A1: com.apollographql.apollo.api/Fragment.Data> writeOptimisticUpdates(com.apollographql.apollo.api/Fragment<#A1>, com.apollographql.cache.normalized.api/CacheKey, #A1, com.benasher44.uuid/Uuid, kotlin/Boolean = ...): kotlin.collections/Set // com.apollographql.cache.normalized/ApolloStore.writeOptimisticUpdates|writeOptimisticUpdates(com.apollographql.apollo.api.Fragment<0:0>;com.apollographql.cache.normalized.api.CacheKey;0:0;com.benasher44.uuid.Uuid;kotlin.Boolean){0§}[0] final suspend fun <#A1: com.apollographql.apollo.api/Operation.Data> readOperation(com.apollographql.apollo.api/Operation<#A1>, com.apollographql.cache.normalized.api/CacheHeaders = ...): com.apollographql.apollo.api/ApolloResponse<#A1> // com.apollographql.cache.normalized/ApolloStore.readOperation|readOperation(com.apollographql.apollo.api.Operation<0:0>;com.apollographql.cache.normalized.api.CacheHeaders){0§}[0] - final suspend fun <#A1: com.apollographql.apollo.api/Operation.Data> writeOperation(com.apollographql.apollo.api/Operation<#A1>, #A1, kotlin.collections/List? = ..., com.apollographql.cache.normalized.api/CacheHeaders = ...): kotlin.collections/Set // com.apollographql.cache.normalized/ApolloStore.writeOperation|writeOperation(com.apollographql.apollo.api.Operation<0:0>;0:0;kotlin.collections.List?;com.apollographql.cache.normalized.api.CacheHeaders){0§}[0] - final suspend fun <#A1: com.apollographql.apollo.api/Operation.Data> writeOperation(com.apollographql.apollo.api/Operation<#A1>, kotlin.collections/Map, com.apollographql.cache.normalized.api/CacheHeaders = ...): kotlin.collections/Set // com.apollographql.cache.normalized/ApolloStore.writeOperation|writeOperation(com.apollographql.apollo.api.Operation<0:0>;kotlin.collections.Map;com.apollographql.cache.normalized.api.CacheHeaders){0§}[0] - final suspend fun <#A1: com.apollographql.apollo.api/Operation.Data> writeOptimisticUpdates(com.apollographql.apollo.api/Operation<#A1>, #A1, com.benasher44.uuid/Uuid): kotlin.collections/Set // com.apollographql.cache.normalized/ApolloStore.writeOptimisticUpdates|writeOptimisticUpdates(com.apollographql.apollo.api.Operation<0:0>;0:0;com.benasher44.uuid.Uuid){0§}[0] + final suspend fun <#A1: com.apollographql.apollo.api/Operation.Data> writeOperation(com.apollographql.apollo.api/Operation<#A1>, #A1, kotlin.collections/List? = ..., com.apollographql.cache.normalized.api/CacheHeaders = ..., kotlin/Boolean = ...): kotlin.collections/Set // com.apollographql.cache.normalized/ApolloStore.writeOperation|writeOperation(com.apollographql.apollo.api.Operation<0:0>;0:0;kotlin.collections.List?;com.apollographql.cache.normalized.api.CacheHeaders;kotlin.Boolean){0§}[0] + final suspend fun <#A1: com.apollographql.apollo.api/Operation.Data> writeOperation(com.apollographql.apollo.api/Operation<#A1>, kotlin.collections/Map, com.apollographql.cache.normalized.api/CacheHeaders = ..., kotlin/Boolean = ...): kotlin.collections/Set // com.apollographql.cache.normalized/ApolloStore.writeOperation|writeOperation(com.apollographql.apollo.api.Operation<0:0>;kotlin.collections.Map;com.apollographql.cache.normalized.api.CacheHeaders;kotlin.Boolean){0§}[0] + final suspend fun <#A1: com.apollographql.apollo.api/Operation.Data> writeOptimisticUpdates(com.apollographql.apollo.api/Operation<#A1>, #A1, com.benasher44.uuid/Uuid, kotlin/Boolean = ...): kotlin.collections/Set // com.apollographql.cache.normalized/ApolloStore.writeOptimisticUpdates|writeOptimisticUpdates(com.apollographql.apollo.api.Operation<0:0>;0:0;com.benasher44.uuid.Uuid;kotlin.Boolean){0§}[0] final suspend fun <#A1: kotlin/Any?> accessCache(kotlin.coroutines/SuspendFunction1): #A1 // com.apollographql.cache.normalized/ApolloStore.accessCache|accessCache(kotlin.coroutines.SuspendFunction1){0§}[0] - final suspend fun clearAll(): kotlin/Boolean // com.apollographql.cache.normalized/ApolloStore.clearAll|clearAll(){}[0] + final suspend fun clearAll(kotlin/Boolean = ...): kotlin/Boolean // com.apollographql.cache.normalized/ApolloStore.clearAll|clearAll(kotlin.Boolean){}[0] final suspend fun dump(): kotlin.collections/Map, kotlin.collections/Map> // com.apollographql.cache.normalized/ApolloStore.dump|dump(){}[0] final suspend fun publish(kotlin.collections/Set) // com.apollographql.cache.normalized/ApolloStore.publish|publish(kotlin.collections.Set){}[0] final suspend fun remove(com.apollographql.cache.normalized.api/CacheKey, kotlin/Boolean = ...): kotlin/Boolean // com.apollographql.cache.normalized/ApolloStore.remove|remove(com.apollographql.cache.normalized.api.CacheKey;kotlin.Boolean){}[0] final suspend fun remove(kotlin.collections/List, kotlin/Boolean = ...): kotlin/Int // com.apollographql.cache.normalized/ApolloStore.remove|remove(kotlin.collections.List;kotlin.Boolean){}[0] - final suspend fun rollbackOptimisticUpdates(com.benasher44.uuid/Uuid): kotlin.collections/Set // com.apollographql.cache.normalized/ApolloStore.rollbackOptimisticUpdates|rollbackOptimisticUpdates(com.benasher44.uuid.Uuid){}[0] + final suspend fun rollbackOptimisticUpdates(com.benasher44.uuid/Uuid, kotlin/Boolean = ...): kotlin.collections/Set // com.apollographql.cache.normalized/ApolloStore.rollbackOptimisticUpdates|rollbackOptimisticUpdates(com.benasher44.uuid.Uuid;kotlin.Boolean){}[0] final suspend fun trim(kotlin/Long, kotlin/Float = ...): kotlin/Long // com.apollographql.cache.normalized/ApolloStore.trim|trim(kotlin.Long;kotlin.Float){}[0] } @@ -719,5 +719,5 @@ final suspend fun (com.apollographql.cache.normalized/ApolloStore).com.apollogra final suspend fun (com.apollographql.cache.normalized/ApolloStore).com.apollographql.cache.normalized/removeDanglingReferences(): com.apollographql.cache.normalized/RemovedFieldsAndRecords // com.apollographql.cache.normalized/removeDanglingReferences|removeDanglingReferences@com.apollographql.cache.normalized.ApolloStore(){}[0] final suspend fun (com.apollographql.cache.normalized/ApolloStore).com.apollographql.cache.normalized/removeStaleFields(com.apollographql.cache.normalized.api/MaxAgeProvider, kotlin.time/Duration = ...): com.apollographql.cache.normalized/RemovedFieldsAndRecords // com.apollographql.cache.normalized/removeStaleFields|removeStaleFields@com.apollographql.cache.normalized.ApolloStore(com.apollographql.cache.normalized.api.MaxAgeProvider;kotlin.time.Duration){}[0] final suspend fun (com.apollographql.cache.normalized/ApolloStore).com.apollographql.cache.normalized/removeUnreachableRecords(): kotlin.collections/Set // com.apollographql.cache.normalized/removeUnreachableRecords|removeUnreachableRecords@com.apollographql.cache.normalized.ApolloStore(){}[0] -final suspend fun <#A: com.apollographql.apollo.api/Fragment.Data> (com.apollographql.cache.normalized/ApolloStore).com.apollographql.cache.normalized/removeFragment(com.apollographql.apollo.api/Fragment<#A>, com.apollographql.cache.normalized.api/CacheKey, #A, com.apollographql.cache.normalized.api/CacheHeaders = ...): kotlin.collections/Set // com.apollographql.cache.normalized/removeFragment|removeFragment@com.apollographql.cache.normalized.ApolloStore(com.apollographql.apollo.api.Fragment<0:0>;com.apollographql.cache.normalized.api.CacheKey;0:0;com.apollographql.cache.normalized.api.CacheHeaders){0§}[0] -final suspend fun <#A: com.apollographql.apollo.api/Operation.Data> (com.apollographql.cache.normalized/ApolloStore).com.apollographql.cache.normalized/removeOperation(com.apollographql.apollo.api/Operation<#A>, #A, com.apollographql.cache.normalized.api/CacheHeaders = ...): kotlin.collections/Set // com.apollographql.cache.normalized/removeOperation|removeOperation@com.apollographql.cache.normalized.ApolloStore(com.apollographql.apollo.api.Operation<0:0>;0:0;com.apollographql.cache.normalized.api.CacheHeaders){0§}[0] +final suspend fun <#A: com.apollographql.apollo.api/Fragment.Data> (com.apollographql.cache.normalized/ApolloStore).com.apollographql.cache.normalized/removeFragment(com.apollographql.apollo.api/Fragment<#A>, com.apollographql.cache.normalized.api/CacheKey, #A, com.apollographql.cache.normalized.api/CacheHeaders = ..., kotlin/Boolean = ...): kotlin.collections/Set // com.apollographql.cache.normalized/removeFragment|removeFragment@com.apollographql.cache.normalized.ApolloStore(com.apollographql.apollo.api.Fragment<0:0>;com.apollographql.cache.normalized.api.CacheKey;0:0;com.apollographql.cache.normalized.api.CacheHeaders;kotlin.Boolean){0§}[0] +final suspend fun <#A: com.apollographql.apollo.api/Operation.Data> (com.apollographql.cache.normalized/ApolloStore).com.apollographql.cache.normalized/removeOperation(com.apollographql.apollo.api/Operation<#A>, #A, com.apollographql.cache.normalized.api/CacheHeaders = ..., kotlin/Boolean = ...): kotlin.collections/Set // com.apollographql.cache.normalized/removeOperation|removeOperation@com.apollographql.cache.normalized.ApolloStore(com.apollographql.apollo.api.Operation<0:0>;0:0;com.apollographql.cache.normalized.api.CacheHeaders;kotlin.Boolean){0§}[0] diff --git a/normalized-cache/src/commonMain/kotlin/com/apollographql/cache/normalized/ApolloStore.kt b/normalized-cache/src/commonMain/kotlin/com/apollographql/cache/normalized/ApolloStore.kt index f5b7a50d..763ab402 100644 --- a/normalized-cache/src/commonMain/kotlin/com/apollographql/cache/normalized/ApolloStore.kt +++ b/normalized-cache/src/commonMain/kotlin/com/apollographql/cache/normalized/ApolloStore.kt @@ -28,7 +28,7 @@ import kotlin.reflect.KClass * these operations **must not** run on the main thread. You can enclose them in a [kotlinx.coroutines.withContext] block with a * `Dispatchers.IO` context to ensure that they run on a background thread. * - * Note that changes are not automatically published - call [publish] to notify any watchers. + * Note that changes are not automatically published - pass `publish = true` or call [publish] to notify any watchers. */ class ApolloStore( val cacheManager: CacheManager, @@ -94,11 +94,12 @@ class ApolloStore( /** * Writes an operation to the store. * - * Call [publish] with the returned keys to notify any watchers. + * Pass [publish] = true or call [ApolloStore.publish] with the returned keys to notify any watchers. * * @param operation the operation to write * @param data the operation data to write * @param errors the operation errors to write + * @param publish whether to notify watchers of the changes * @return the changed field keys * * @see publish @@ -110,22 +111,24 @@ class ApolloStore( data: D, errors: List? = null, cacheHeaders: CacheHeaders = CacheHeaders.NONE, + publish: Boolean = false, ): Set = cacheManager.writeOperation( operation = operation, data = data, errors = errors, + publish = publish, cacheHeaders = cacheHeaders, customScalarAdapters = customScalarAdapters, ) /** - * Writes a fragment to the store. + * Writes an operation to the store. * - * Call [publish] with the returned keys to notify any watchers. + * Pass [publish] = true or call [ApolloStore.publish] with the returned keys to notify any watchers. * - * @param fragment the fragment to write - * @param cacheKey the root where to write the fragment data to - * @param data the fragment data to write + * @param operation the operation to write + * @param dataWithErrors the operation data to write as a [DataWithErrors] object + * @param publish whether to notify watchers of the changes * @return the changed field keys * * @see publish @@ -136,9 +139,11 @@ class ApolloStore( operation: Operation, dataWithErrors: DataWithErrors, cacheHeaders: CacheHeaders = CacheHeaders.NONE, + publish: Boolean = false, ): Set = cacheManager.writeOperation( operation = operation, dataWithErrors = dataWithErrors, + publish = publish, cacheHeaders = cacheHeaders, customScalarAdapters = customScalarAdapters, ) @@ -146,11 +151,12 @@ class ApolloStore( /** * Writes a fragment to the store. * - * Call [publish] with the returned keys to notify any watchers. + * Pass [publish] = true or call [ApolloStore.publish] with the returned keys to notify any watchers. * * @param fragment the fragment to write * @param cacheKey the root where to write the fragment data to * @param data the fragment data to write + * @param publish whether to notify watchers of the changes * @return the changed field keys * * @see publish @@ -162,10 +168,12 @@ class ApolloStore( cacheKey: CacheKey, data: D, cacheHeaders: CacheHeaders = CacheHeaders.NONE, + publish: Boolean = false, ): Set = cacheManager.writeFragment( fragment = fragment, cacheKey = cacheKey, data = data, + publish = publish, cacheHeaders = cacheHeaders, customScalarAdapters = customScalarAdapters, ) @@ -176,11 +184,12 @@ class ApolloStore( * Optimistic updates must be enabled to use this method. To do so, pass `enableOptimisticUpdates = true` to the `CacheManager` constructor * or [normalizedCache] extension. * - * Call [publish] with the returned keys to notify any watchers. + * Pass [publish] = true or call [ApolloStore.publish] with the returned keys to notify any watchers. * * @param operation the operation to write * @param data the operation data to write * @param mutationId a unique identifier for this optimistic update + * @param publish whether to notify watchers of the changes * @return the changed field keys * * @see publish @@ -191,10 +200,12 @@ class ApolloStore( operation: Operation, data: D, mutationId: Uuid, + publish: Boolean = false, ): Set = cacheManager.writeOptimisticUpdates( operation = operation, data = data, mutationId = mutationId, + publish = publish, customScalarAdapters = customScalarAdapters, ) @@ -204,12 +215,13 @@ class ApolloStore( * Optimistic updates must be enabled to use this method. To do so, pass `enableOptimisticUpdates = true` to the `CacheManager` constructor * or [normalizedCache] extension. * - * Call [publish] with the returned keys to notify any watchers. + * Pass [publish] = true or call [ApolloStore.publish] with the returned keys to notify any watchers. * * @param fragment the fragment to write * @param cacheKey the root where to write the fragment data to * @param data the fragment data to write * @param mutationId a unique identifier for this optimistic update + * @param publish whether to notify watchers of the changes * @return the changed field keys * * @see publish @@ -221,11 +233,13 @@ class ApolloStore( cacheKey: CacheKey, data: D, mutationId: Uuid, + publish: Boolean = false, ): Set = cacheManager.writeOptimisticUpdates( fragment = fragment, cacheKey = cacheKey, data = data, mutationId = mutationId, + publish = publish, customScalarAdapters = customScalarAdapters, ) @@ -235,27 +249,35 @@ class ApolloStore( * Optimistic updates must be enabled to use this method. To do so, pass `enableOptimisticUpdates = true` to the `CacheManager` constructor * or [normalizedCache] extension. * - * Call [publish] with the returned keys to notify any watchers. + * Pass [publish] = true or call [ApolloStore.publish] with the returned keys to notify any watchers. * * @param mutationId the unique identifier of the optimistic update to rollback + * @param publish whether to notify watchers of the changes * @return the changed field keys * * @see publish * * @see CacheManager.rollbackOptimisticUpdates */ - suspend fun rollbackOptimisticUpdates(mutationId: Uuid): Set = cacheManager.rollbackOptimisticUpdates(mutationId) + suspend fun rollbackOptimisticUpdates( + mutationId: Uuid, + publish: Boolean = false, + ): Set = cacheManager.rollbackOptimisticUpdates( + mutationId = mutationId, + publish = publish, + ) /** * Clears all records. * - * Call [publish] with [ALL_KEYS] to notify any watchers. + * Pass [publish] = true or call [ApolloStore.publish] with [ALL_KEYS] to notify any watchers. * + * @param publish whether to notify watchers of the changes * @return `true` if all records were successfully removed, `false` otherwise * * @see CacheManager.clearAll */ - suspend fun clearAll(): Boolean = cacheManager.clearAll() + suspend fun clearAll(publish: Boolean = false): Boolean = cacheManager.clearAll(publish = publish) /** * Removes a record by its key. @@ -357,18 +379,26 @@ class ApolloStore( * * This is a synchronous operation that might block if the underlying cache is doing IO. * - * Call [publish] with the returned keys to notify any watchers. + * Pass [publish] = true or call [ApolloStore.publish] with the returned keys to notify any watchers. * * @param operation the operation of the data to remove. * @param data the data to remove. + * @param publish whether to notify watchers of the changes. * @return the set of field keys that have been removed. */ suspend fun ApolloStore.removeOperation( operation: Operation, data: D, cacheHeaders: CacheHeaders = CacheHeaders.NONE, + publish: Boolean = false, ): Set { - return removeData(operation, operation.rootKey(), data, cacheHeaders) + return removeData( + executable = operation, + cacheKey = operation.rootKey(), + data = data, + cacheHeaders = cacheHeaders, + publish = publish, + ) } /** @@ -376,11 +406,12 @@ suspend fun ApolloStore.removeOperation( * * This is a synchronous operation that might block if the underlying cache is doing IO. * - * Call [publish] with the returned keys to notify any watchers. + * Pass [publish] = true or call [ApolloStore.publish] with the returned keys to notify any watchers. * * @param fragment the fragment of the data to remove. - * @param data the data to remove. * @param cacheKey the root where to remove the fragment data from. + * @param data the data to remove. + * @param publish whether to notify watchers of the changes. * @return the set of field keys that have been removed. */ suspend fun ApolloStore.removeFragment( @@ -388,8 +419,15 @@ suspend fun ApolloStore.removeFragment( cacheKey: CacheKey, data: D, cacheHeaders: CacheHeaders = CacheHeaders.NONE, + publish: Boolean = false, ): Set { - return removeData(fragment, cacheKey, data, cacheHeaders) + return removeData( + executable = fragment, + cacheKey = cacheKey, + data = data, + cacheHeaders = cacheHeaders, + publish = publish, + ) } private suspend fun ApolloStore.removeData( @@ -397,6 +435,7 @@ private suspend fun ApolloStore.removeData( cacheKey: CacheKey, data: D, cacheHeaders: CacheHeaders, + publish: Boolean, ): Set { val dataWithErrors = data.withErrors(executable, null) val normalizationRecords = normalize( @@ -421,5 +460,5 @@ private suspend fun ApolloStore.removeData( recordMerger = DefaultRecordMerger ) } - return normalizationRecords.values.flatMap { it.fieldKeys() }.toSet() + return normalizationRecords.values.flatMap { it.fieldKeys() }.toSet().also { if (publish) publish(it) } } diff --git a/normalized-cache/src/commonMain/kotlin/com/apollographql/cache/normalized/CacheManager.kt b/normalized-cache/src/commonMain/kotlin/com/apollographql/cache/normalized/CacheManager.kt index 91d6e7c0..f7f98471 100644 --- a/normalized-cache/src/commonMain/kotlin/com/apollographql/cache/normalized/CacheManager.kt +++ b/normalized-cache/src/commonMain/kotlin/com/apollographql/cache/normalized/CacheManager.kt @@ -38,7 +38,7 @@ import kotlin.reflect.KClass * these operations **must not** run on the main thread. You can enclose them in a [kotlinx.coroutines.withContext] block with a * `Dispatchers.IO` context to ensure that they run on a background thread. * - * Note that changes are not automatically published - call [publish] to notify any watchers. + * Note that changes are not automatically published - pass `publish = true` or call [publish] to notify any watchers. */ interface CacheManager { /** @@ -99,11 +99,12 @@ interface CacheManager { /** * Writes an operation to the store. * - * Call [publish] with the returned keys to notify any watchers. + * Pass [publish] = true or call [CacheManager.publish] with the returned keys to notify any watchers. * * @param operation the operation to write * @param data the operation data to write * @param errors the operation errors to write + * @param publish whether to notify watchers of the changes * @return the changed field keys * * @see publish @@ -114,15 +115,17 @@ interface CacheManager { errors: List? = null, customScalarAdapters: CustomScalarAdapters = CustomScalarAdapters.Empty, cacheHeaders: CacheHeaders = CacheHeaders.NONE, + publish: Boolean = false, ): Set /** * Writes an operation to the store. * - * Call [publish] with the returned keys to notify any watchers. + * Pass [publish] = true or call [CacheManager.publish] with the returned keys to notify any watchers. * * @param operation the operation to write * @param dataWithErrors the operation data to write as a [DataWithErrors] object + * @param publish whether to notify watchers of the changes * @return the changed field keys * * @see publish @@ -132,16 +135,18 @@ interface CacheManager { dataWithErrors: DataWithErrors, customScalarAdapters: CustomScalarAdapters = CustomScalarAdapters.Empty, cacheHeaders: CacheHeaders = CacheHeaders.NONE, + publish: Boolean = false, ): Set /** * Writes a fragment to the store. * - * Call [publish] with the returned keys to notify any watchers. + * Pass [publish] = true or call [CacheManager.publish] with the returned keys to notify any watchers. * * @param fragment the fragment to write * @param cacheKey the root where to write the fragment data to * @param data the fragment data to write + * @param publish whether to notify watchers of the changes * @return the changed field keys * * @see publish @@ -152,6 +157,7 @@ interface CacheManager { data: D, customScalarAdapters: CustomScalarAdapters = CustomScalarAdapters.Empty, cacheHeaders: CacheHeaders = CacheHeaders.NONE, + publish: Boolean = false, ): Set /** @@ -160,11 +166,12 @@ interface CacheManager { * Optimistic updates must be enabled to use this method. To do so, pass `enableOptimisticUpdates = true` to the `CacheManager` constructor * or [normalizedCache] extension. * - * Call [publish] with the returned keys to notify any watchers. + * Pass [publish] = true or call [CacheManager.publish] with the returned keys to notify any watchers. * * @param operation the operation to write * @param data the operation data to write * @param mutationId a unique identifier for this optimistic update + * @param publish whether to notify watchers of the changes * @return the changed field keys * * @see publish @@ -174,6 +181,7 @@ interface CacheManager { data: D, mutationId: Uuid, customScalarAdapters: CustomScalarAdapters = CustomScalarAdapters.Empty, + publish: Boolean = false, ): Set /** @@ -182,12 +190,13 @@ interface CacheManager { * Optimistic updates must be enabled to use this method. To do so, pass `enableOptimisticUpdates = true` to the `CacheManager` constructor * or [normalizedCache] extension. * - * Call [publish] with the returned keys to notify any watchers. + * Pass [publish] = true or call [CacheManager.publish] with the returned keys to notify any watchers. * * @param fragment the fragment to write * @param cacheKey the root where to write the fragment data to * @param data the fragment data to write * @param mutationId a unique identifier for this optimistic update + * @param publish whether to notify watchers of the changes * @return the changed field keys * * @see publish @@ -198,6 +207,7 @@ interface CacheManager { data: D, mutationId: Uuid, customScalarAdapters: CustomScalarAdapters = CustomScalarAdapters.Empty, + publish: Boolean = false, ): Set /** @@ -206,25 +216,28 @@ interface CacheManager { * Optimistic updates must be enabled to use this method. To do so, pass `enableOptimisticUpdates = true` to the `CacheManager` constructor * or [normalizedCache] extension. * - * Call [publish] with the returned keys to notify any watchers. + * Pass [publish] = true or call [CacheManager.publish] with the returned keys to notify any watchers. * * @param mutationId the unique identifier of the optimistic update to rollback + * @param publish whether to notify watchers of the changes * @return the changed field keys * * @see publish */ suspend fun rollbackOptimisticUpdates( mutationId: Uuid, + publish: Boolean = false, ): Set /** * Clears all records. * - * Call [publish] with [ALL_KEYS] to notify any watchers. + * Pass [publish] = true or call `publish` with [ALL_KEYS] to notify any watchers. * + * @param publish whether to notify watchers of the changes * @return `true` if all records were successfully removed, `false` otherwise */ - suspend fun clearAll(): Boolean + suspend fun clearAll(publish: Boolean = false): Boolean /** * Removes a record by its key. diff --git a/normalized-cache/src/commonMain/kotlin/com/apollographql/cache/normalized/internal/DefaultCacheManager.kt b/normalized-cache/src/commonMain/kotlin/com/apollographql/cache/normalized/internal/DefaultCacheManager.kt index bab06e1c..f2bee941 100644 --- a/normalized-cache/src/commonMain/kotlin/com/apollographql/cache/normalized/internal/DefaultCacheManager.kt +++ b/normalized-cache/src/commonMain/kotlin/com/apollographql/cache/normalized/internal/DefaultCacheManager.kt @@ -93,8 +93,11 @@ internal class DefaultCacheManager( changedKeysEvents.emit(keys) } - override suspend fun clearAll(): Boolean { + override suspend fun clearAll(publish: Boolean): Boolean { cache.clearAll() + if (publish) { + publish(CacheManager.ALL_KEYS) + } return true } @@ -240,9 +243,16 @@ internal class DefaultCacheManager( errors: List?, customScalarAdapters: CustomScalarAdapters, cacheHeaders: CacheHeaders, + publish: Boolean, ): Set { val dataWithErrors = data.withErrors(operation, errors, customScalarAdapters) - return writeOperation(operation, dataWithErrors, customScalarAdapters, cacheHeaders) + return writeOperation( + operation = operation, + dataWithErrors = dataWithErrors, + customScalarAdapters = customScalarAdapters, + cacheHeaders = cacheHeaders, + publish = publish, + ) } override suspend fun writeOperation( @@ -250,6 +260,7 @@ internal class DefaultCacheManager( dataWithErrors: DataWithErrors, customScalarAdapters: CustomScalarAdapters, cacheHeaders: CacheHeaders, + publish: Boolean, ): Set { val records = normalize( executable = operation, @@ -257,7 +268,7 @@ internal class DefaultCacheManager( rootKey = operation.rootKey(), customScalarAdapters = customScalarAdapters, ).values.toSet() - return cache.merge(records, cacheHeaders, recordMerger) + return cache.merge(records, cacheHeaders, recordMerger).also { if (publish) publish(it) } } override suspend fun writeFragment( @@ -266,6 +277,7 @@ internal class DefaultCacheManager( data: D, customScalarAdapters: CustomScalarAdapters, cacheHeaders: CacheHeaders, + publish: Boolean, ): Set { val dataWithErrors = data.withErrors(fragment, null, customScalarAdapters) val records = normalize( @@ -274,7 +286,7 @@ internal class DefaultCacheManager( rootKey = cacheKey, customScalarAdapters = customScalarAdapters, ).values - return cache.merge(records, cacheHeaders, recordMerger) + return cache.merge(records, cacheHeaders, recordMerger).also { if (publish) publish(it) } } override suspend fun writeOptimisticUpdates( @@ -282,6 +294,7 @@ internal class DefaultCacheManager( data: D, mutationId: Uuid, customScalarAdapters: CustomScalarAdapters, + publish: Boolean, ): Set { val cache = cache as? OptimisticNormalizedCache ?: error("Optimistic updates are not enabled. Enable them by passing `enableOptimisticUpdates = true` to the CacheManager constructor or normalizedCache() extension.") @@ -302,7 +315,7 @@ internal class DefaultCacheManager( /** * TODO: should we forward the cache headers to the optimistic store? */ - return cache.addOptimisticUpdates(records) + return cache.addOptimisticUpdates(records).also { if (publish) publish(it) } } override suspend fun writeOptimisticUpdates( @@ -311,6 +324,7 @@ internal class DefaultCacheManager( data: D, mutationId: Uuid, customScalarAdapters: CustomScalarAdapters, + publish: Boolean, ): Set { val cache = cache as? OptimisticNormalizedCache ?: error("Optimistic updates are not enabled. Enable them by passing `enableOptimisticUpdates = true` to the CacheManager constructor or normalizedCache() extension.") @@ -327,15 +341,16 @@ internal class DefaultCacheManager( mutationId = mutationId, ) } - return cache.addOptimisticUpdates(records) + return cache.addOptimisticUpdates(records).also { if (publish) publish(it) } } override suspend fun rollbackOptimisticUpdates( mutationId: Uuid, + publish: Boolean, ): Set { val cache = cache as? OptimisticNormalizedCache ?: error("Optimistic updates are not enabled. Enable them by passing `enableOptimisticUpdates = true` to the CacheManager constructor or normalizedCache() extension.") - return cache.removeOptimisticUpdates(mutationId) + return cache.removeOptimisticUpdates(mutationId).also { if (publish) publish(it) } } override suspend fun trim(maxSizeBytes: Long, trimFactor: Float): Long { diff --git a/tests/normalized-cache/src/commonTest/kotlin/WatcherTest.kt b/tests/normalized-cache/src/commonTest/kotlin/WatcherTest.kt index 7e36284b..9f9b41a8 100644 --- a/tests/normalized-cache/src/commonTest/kotlin/WatcherTest.kt +++ b/tests/normalized-cache/src/commonTest/kotlin/WatcherTest.kt @@ -178,12 +178,10 @@ class WatcherTest { "Droid", "2001", "Artoo" - ) + ), ) - cacheManager.writeOperation(operation, data).also { - cacheManager.publish(it) - } + cacheManager.writeOperation(operation, data, publish = true) assertEquals(channel.awaitElement()?.hero?.name, "Artoo")