Skip to content

Commit

Permalink
Adjust types to pubnub-kotlin update
Browse files Browse the repository at this point in the history
  • Loading branch information
wkal-pubnub committed Jul 29, 2024
1 parent b503aa5 commit e25e439
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 10 deletions.
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
kotlin.code.style=official
org.gradle.configuration-cache=false
org.gradle.configuration-cache=true
org.gradle.caching=true
kotlin.mpp.applyDefaultHierarchyTemplate=false
#kotlin.mpp.import.enableKgpDependencyResolution=true

kotlin.native.cacheKind.iosSimulatorArm64=none
kotlin.native.cacheKind.iosArm64=none
#kotlin.native.cacheKind.iosSimulatorArm64=none
#kotlin.native.cacheKind.iosArm64=none

org.gradle.jvmargs=-Xmx8g -XX:MaxMetaspaceSize=1g -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
VERSION_NAME=0.8.0-DEV
2 changes: 1 addition & 1 deletion pubnub-chat-api/api/pubnub-chat-api.api
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public abstract interface class com/pubnub/chat/Chat {
public abstract fun getCurrentUser ()Lcom/pubnub/chat/User;
public abstract fun getCurrentUserMentions (Ljava/lang/Long;Ljava/lang/Long;I)Lcom/pubnub/kmp/PNFuture;
public abstract fun getEventsHistory (Ljava/lang/String;Ljava/lang/Long;Ljava/lang/Long;I)Lcom/pubnub/kmp/PNFuture;
public abstract fun getPubNub ()Lcom/pubnub/kmp/PubNub;
public abstract fun getPubNub ()Lcom/pubnub/api/PubNub;
public abstract fun getPushChannels ()Lcom/pubnub/kmp/PNFuture;
public abstract fun getThreadChannel (Lcom/pubnub/chat/Message;)Lcom/pubnub/kmp/PNFuture;
public abstract fun getUnreadMessagesCounts (Ljava/lang/Integer;Lcom/pubnub/api/models/consumer/objects/PNPage;Ljava/lang/String;Ljava/util/Collection;)Lcom/pubnub/kmp/PNFuture;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.pubnub.chat

import com.pubnub.api.PubNub
import com.pubnub.api.models.consumer.PNPublishResult
import com.pubnub.api.models.consumer.objects.PNKey
import com.pubnub.api.models.consumer.objects.PNMembershipKey
Expand All @@ -22,7 +23,6 @@ import com.pubnub.chat.types.GetEventsHistoryResult
import com.pubnub.chat.user.GetUsersResponse
import com.pubnub.kmp.CustomObject
import com.pubnub.kmp.PNFuture
import com.pubnub.kmp.PubNub
import kotlin.reflect.KClass

interface Chat {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.pubnub.chat.internal

import com.benasher44.uuid.uuid4
import com.pubnub.api.PubNub
import com.pubnub.api.PubNubException
import com.pubnub.api.enums.PNPushType
import com.pubnub.api.models.consumer.PNBoundedPage
Expand Down Expand Up @@ -79,7 +80,6 @@ import com.pubnub.chat.types.UserMentionData
import com.pubnub.chat.user.GetUsersResponse
import com.pubnub.kmp.CustomObject
import com.pubnub.kmp.PNFuture
import com.pubnub.kmp.PubNub
import com.pubnub.kmp.alsoAsync
import com.pubnub.kmp.asFuture
import com.pubnub.kmp.awaitAll
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.pubnub.kmp

import com.pubnub.api.PubNub
import com.pubnub.api.PubNubException
import com.pubnub.api.UserId
import com.pubnub.api.endpoints.FetchMessages
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.pubnub.kmp

import com.benasher44.uuid.uuid4
import com.pubnub.api.PubNub
import com.pubnub.api.PubNubException
import com.pubnub.api.UserId
import com.pubnub.api.endpoints.FetchMessages
Expand Down Expand Up @@ -1068,7 +1069,7 @@ class ChatTest : BaseTest() {
val startTimetoken = 123L
val endTimetoken = 456L
val count = 2
every { pubnub.fetchMessages(any(), any(), any(), any(), any(), any()) } returns fetchMessages
every { pubnub.fetchMessages(any(), any<PNBoundedPage>(), any(), any(), any(), any()) } returns fetchMessages
every { fetchMessages.async(any()) } calls { (callback: Consumer<Result<PNFetchMessagesResult>>) ->
callback.accept(
Result.success(
Expand Down Expand Up @@ -1117,7 +1118,7 @@ class ChatTest : BaseTest() {
val user2 = "myUser2"
val startTimetoken = 123L
val endTimetoken = 456L
every { pubnub.fetchMessages(any(), any(), any(), any(), any(), any()) } returns fetchMessages
every { pubnub.fetchMessages(any(), any<PNBoundedPage>(), any(), any(), any(), any()) } returns fetchMessages
every { fetchMessages.async(any()) } calls { (callback: Consumer<Result<PNFetchMessagesResult>>) ->
callback.accept(
Result.success(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.pubnub.kmp

import com.pubnub.api.PubNub
import com.pubnub.api.endpoints.MessageCounts
import com.pubnub.api.models.consumer.history.PNMessageCountResult
import com.pubnub.api.v2.callbacks.Consumer
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.pubnub.kmp

import com.pubnub.api.PubNub
import com.pubnub.api.PubNubException
import com.pubnub.api.endpoints.objects.membership.GetMemberships
import com.pubnub.api.models.consumer.objects.PNMembershipKey
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.pubnub.kmp.utils

import com.pubnub.api.PubNub
import com.pubnub.api.models.consumer.PNPublishResult
import com.pubnub.api.models.consumer.objects.PNKey
import com.pubnub.api.models.consumer.objects.PNMembershipKey
Expand Down Expand Up @@ -27,7 +28,6 @@ import com.pubnub.chat.types.GetEventsHistoryResult
import com.pubnub.chat.user.GetUsersResponse
import com.pubnub.kmp.CustomObject
import com.pubnub.kmp.PNFuture
import com.pubnub.kmp.PubNub
import kotlin.reflect.KClass

abstract class FakeChat(override val config: ChatConfiguration, override val pubNub: PubNub) : ChatInternal {
Expand Down
2 changes: 1 addition & 1 deletion pubnub-kotlin
Submodule pubnub-kotlin updated 20 files
+20 −2 build-logic/gradle-plugins/src/main/kotlin/com/pubnub/gradle/PubNubKotlinMultiplatformPlugin.kt
+0 −1 pubnub-core/pubnub-core-api/build.gradle.kts
+0 −3 pubnub-core/pubnub-core-api/config/ktlint/baseline.xml
+2 −3 pubnub-core/pubnub-core-api/src/commonTest/kotlin/com/pubnub/kmp/JsonElementTest.kt
+1 −1 pubnub-core/pubnub-core-api/src/iosMain/kotlin/com/pubnub/api/JsonElement.ios.kt
+2 −2 pubnub-kotlin/pubnub-kotlin-api/config/ktlint/baseline.xml
+4 −2 pubnub-kotlin/pubnub-kotlin-api/src/commonMain/kotlin/com/pubnub/api/PubNub.kt
+1 −0 pubnub-kotlin/pubnub-kotlin-api/src/commonMain/kotlin/com/pubnub/kmp/factories.kt
+0 −1 pubnub-kotlin/pubnub-kotlin-api/src/iosMain/kotlin/com/pubnub/api/PubNubImpl.kt
+1 −1 pubnub-kotlin/pubnub-kotlin-api/src/iosMain/kotlin/com/pubnub/api/v2/callbacks/EventListener.ios.kt
+1 −1 pubnub-kotlin/pubnub-kotlin-api/src/iosMain/kotlin/com/pubnub/api/v2/callbacks/StatusListener.ios.kt
+1 −0 pubnub-kotlin/pubnub-kotlin-api/src/iosMain/kotlin/com/pubnub/kmp/factories.ios.kt
+0 −1 pubnub-kotlin/pubnub-kotlin-api/src/jsMain/kotlin/com/pubnub/api/PubNubImpl.kt
+1 −0 pubnub-kotlin/pubnub-kotlin-api/src/jsMain/kotlin/com/pubnub/kmp/factories.js.kt
+59 −53 pubnub-kotlin/pubnub-kotlin-api/src/jvmMain/kotlin/com/pubnub/api/PubNub.kt
+10 −11 pubnub-kotlin/pubnub-kotlin-api/src/jvmMain/kotlin/com/pubnub/kmp/factories.jvm.kt
+444 −0 pubnub-kotlin/pubnub-kotlin-api/src/nonJvm/kotlin/com/pubnub/api/PubNub.nonJvm.kt
+121 −121 pubnub-kotlin/pubnub-kotlin-impl/src/main/kotlin/com/pubnub/internal/v2/PNConfigurationImpl.kt
+1 −1 pubnub-kotlin/pubnub-kotlin-test/src/commonMain/kotlin/com.pubnub.test/BaseIntegrationTest.kt
+1 −1 pubnub-kotlin/pubnub-kotlin-test/src/commonMain/kotlin/com.pubnub.test/FakePubNub.kt

0 comments on commit e25e439

Please sign in to comment.