Skip to content

Commit 51d0dfa

Browse files
committed
fix public api issues
1 parent c55ae6a commit 51d0dfa

File tree

11 files changed

+42
-41
lines changed

11 files changed

+42
-41
lines changed

firebase-app/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@gitlive/firebase-app",
3-
"version": "1.13.0",
3+
"version": "2.0.0",
44
"description": "Wrapper around firebase for usage in Kotlin Multiplatform projects",
55
"main": "firebase-app.js",
66
"scripts": {
@@ -23,7 +23,7 @@
2323
},
2424
"homepage": "https://github.com/GitLiveApp/firebase-kotlin-sdk",
2525
"dependencies": {
26-
"@gitlive/firebase-common": "1.13.0",
26+
"@gitlive/firebase-common": "2.0.0",
2727
"firebase": "9.19.1",
2828
"kotlin": "1.8.20",
2929
"kotlinx-coroutines-core": "1.6.4"

firebase-auth/src/jsMain/kotlin/dev/gitlive/firebase/auth/credentials.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import dev.gitlive.firebase.auth.externals.OAuthProvider as JsOAuthProvider
1515
public val AuthCredential.js: JsAuthCredential get() = js
1616

1717
public actual open class AuthCredential(internal val js: JsAuthCredential) {
18-
actual val providerId: String
18+
public actual val providerId: String
1919
get() = js.providerId
2020
}
2121

@@ -86,9 +86,9 @@ public val PhoneAuthProvider.js: JsPhoneAuthProvider get() = js
8686

8787
public actual class PhoneAuthProvider(internal val js: JsPhoneAuthProvider) {
8888

89-
public actual constructor(auth: FirebaseAuth) : this(PhoneAuthProvider(auth.js))
89+
public actual constructor(auth: FirebaseAuth) : this(JsPhoneAuthProvider(auth.js))
9090

91-
public actual fun credential(verificationId: String, smsCode: String): PhoneAuthCredential = PhoneAuthCredential(PhoneAuthProvider.credential(verificationId, smsCode))
91+
public actual fun credential(verificationId: String, smsCode: String): PhoneAuthCredential = PhoneAuthCredential(JsPhoneAuthProvider.credential(verificationId, smsCode))
9292
public actual suspend fun verifyPhoneNumber(phoneNumber: String, verificationProvider: PhoneVerificationProvider): AuthCredential = rethrow {
9393
val verificationId = js.verifyPhoneNumber(phoneNumber, verificationProvider.verifier).await()
9494
val verificationCode = verificationProvider.getVerificationCode(verificationId)

firebase-common-internal/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@gitlive/firebase-common-internal",
3-
"version": "1.13.0",
3+
"version": "2.0.0",
44
"description": "Wrapper around firebase for usage in Kotlin Multiplatform projects",
55
"main": "firebase-common-internal.js",
66
"scripts": {
@@ -23,7 +23,7 @@
2323
},
2424
"homepage": "https://github.com/GitLiveApp/firebase-kotlin-multiplatform-sdk",
2525
"dependencies": {
26-
"@gitlive/firebase-common": "1.13.0",
26+
"@gitlive/firebase-common": "2.0.0",
2727
"firebase": "9.19.1",
2828
"kotlin": "1.8.20",
2929
"kotlinx-coroutines-core": "1.6.4",

firebase-common/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@gitlive/firebase-common",
3-
"version": "1.13.0",
3+
"version": "2.0.0",
44
"description": "Wrapper around firebase for usage in Kotlin Multiplatform projects",
55
"main": "firebase-common.js",
66
"scripts": {

firebase-database/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@gitlive/firebase-database",
3-
"version": "1.13.0",
3+
"version": "2.0.0",
44
"description": "Wrapper around firebase for usage in Kotlin Multiplatform projects",
55
"main": "firebase-database.js",
66
"scripts": {
@@ -23,7 +23,7 @@
2323
},
2424
"homepage": "https://github.com/GitLiveApp/firebase-kotlin-sdk",
2525
"dependencies": {
26-
"@gitlive/firebase-app": "1.13.0",
26+
"@gitlive/firebase-app": "2.0.0",
2727
"firebase": "9.19.1",
2828
"kotlin": "1.8.20",
2929
"kotlinx-coroutines-core": "1.6.4"

firebase-database/src/jsMain/kotlin/dev/gitlive/firebase/database/database.kt

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -104,15 +104,15 @@ public actual open class Query internal actual constructor(
104104

105105
public val database: Database = nativeQuery.database
106106

107-
public actual fun orderByKey(): Query = Query(query(js, jsOrderByKey()), database)
108-
public actual fun orderByValue(): Query = Query(query(js, jsOrderByValue()), database)
109-
public actual fun orderByChild(path: String): Query = Query(query(js, jsOrderByChild(path)), database)
107+
public actual fun orderByKey(): Query = Query(query(publicJs, jsOrderByKey()), database)
108+
public actual fun orderByValue(): Query = Query(query(publicJs, jsOrderByValue()), database)
109+
public actual fun orderByChild(path: String): Query = Query(query(publicJs, jsOrderByChild(path)), database)
110110

111111
public actual val valueEvents: Flow<DataSnapshot>
112112
get() = callbackFlow {
113113
val unsubscribe = rethrow {
114114
onValue(
115-
query = js,
115+
query = publicJs,
116116
callback = { trySend(DataSnapshot(it, database)) },
117117
cancelCallback = { close(DatabaseException(it)).run { } },
118118
)
@@ -138,39 +138,39 @@ public actual open class Query internal actual constructor(
138138
}
139139

140140
when (type) {
141-
ChildEvent.Type.ADDED -> onChildAdded(js, callback, cancelCallback)
142-
ChildEvent.Type.CHANGED -> onChildChanged(js, callback, cancelCallback)
143-
ChildEvent.Type.MOVED -> onChildMoved(js, callback, cancelCallback)
144-
ChildEvent.Type.REMOVED -> onChildRemoved(js, callback, cancelCallback)
141+
ChildEvent.Type.ADDED -> onChildAdded(publicJs, callback, cancelCallback)
142+
ChildEvent.Type.CHANGED -> onChildChanged(publicJs, callback, cancelCallback)
143+
ChildEvent.Type.MOVED -> onChildMoved(publicJs, callback, cancelCallback)
144+
ChildEvent.Type.REMOVED -> onChildRemoved(publicJs, callback, cancelCallback)
145145
}
146146
}
147147
}
148148
awaitClose { rethrow { unsubscribes.forEach { it.invoke() } } }
149149
}
150150

151-
public actual fun startAt(value: String, key: String?): Query = Query(query(js, jsStartAt(value, key ?: undefined)), database)
151+
public actual fun startAt(value: String, key: String?): Query = Query(query(publicJs, jsStartAt(value, key ?: undefined)), database)
152152

153-
public actual fun startAt(value: Double, key: String?): Query = Query(query(js, jsStartAt(value, key ?: undefined)), database)
153+
public actual fun startAt(value: Double, key: String?): Query = Query(query(publicJs, jsStartAt(value, key ?: undefined)), database)
154154

155-
public actual fun startAt(value: Boolean, key: String?): Query = Query(query(js, jsStartAt(value, key ?: undefined)), database)
155+
public actual fun startAt(value: Boolean, key: String?): Query = Query(query(publicJs, jsStartAt(value, key ?: undefined)), database)
156156

157-
public actual fun endAt(value: String, key: String?): Query = Query(query(js, jsEndAt(value, key ?: undefined)), database)
157+
public actual fun endAt(value: String, key: String?): Query = Query(query(publicJs, jsEndAt(value, key ?: undefined)), database)
158158

159-
public actual fun endAt(value: Double, key: String?): Query = Query(query(js, jsEndAt(value, key ?: undefined)), database)
159+
public actual fun endAt(value: Double, key: String?): Query = Query(query(publicJs, jsEndAt(value, key ?: undefined)), database)
160160

161-
public actual fun endAt(value: Boolean, key: String?): Query = Query(query(js, jsEndAt(value, key ?: undefined)), database)
161+
public actual fun endAt(value: Boolean, key: String?): Query = Query(query(publicJs, jsEndAt(value, key ?: undefined)), database)
162162

163-
public actual fun limitToFirst(limit: Int): Query = Query(query(js, jsLimitToFirst(limit)), database)
163+
public actual fun limitToFirst(limit: Int): Query = Query(query(publicJs, jsLimitToFirst(limit)), database)
164164

165-
public actual fun limitToLast(limit: Int): Query = Query(query(js, jsLimitToLast(limit)), database)
165+
public actual fun limitToLast(limit: Int): Query = Query(query(publicJs, jsLimitToLast(limit)), database)
166166

167-
public actual fun equalTo(value: String, key: String?): Query = Query(query(js, jsEqualTo(value, key ?: undefined)), database)
167+
public actual fun equalTo(value: String, key: String?): Query = Query(query(publicJs, jsEqualTo(value, key ?: undefined)), database)
168168

169-
public actual fun equalTo(value: Double, key: String?): Query = Query(query(js, jsEqualTo(value, key ?: undefined)), database)
169+
public actual fun equalTo(value: Double, key: String?): Query = Query(query(publicJs, jsEqualTo(value, key ?: undefined)), database)
170170

171-
public actual fun equalTo(value: Boolean, key: String?): Query = Query(query(js, jsEqualTo(value, key ?: undefined)), database)
171+
public actual fun equalTo(value: Boolean, key: String?): Query = Query(query(publicJs, jsEqualTo(value, key ?: undefined)), database)
172172

173-
override fun toString(): String = js.toString()
173+
override fun toString(): String = publicJs.toString()
174174
}
175175

176176
internal actual class NativeDatabaseReference internal constructor(
@@ -205,7 +205,7 @@ public val DataSnapshot.js: JsDataSnapshot get() = js
205205

206206
public actual class DataSnapshot internal constructor(
207207
internal val js: JsDataSnapshot,
208-
val database: Database,
208+
public val database: Database,
209209
) {
210210
public actual val value: Any? get() {
211211
check(!hasChildren) { "DataSnapshot.value can only be used for primitive values (snapshots without children)" }

firebase-firestore/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@gitlive/firebase-firestore",
3-
"version": "1.13.0",
3+
"version": "2.0.0",
44
"description": "Wrapper around firebase for usage in Kotlin Multiplatform projects",
55
"main": "firebase-firestore.js",
66
"scripts": {
@@ -23,7 +23,7 @@
2323
},
2424
"homepage": "https://github.com/GitLiveApp/firebase-kotlin-sdk",
2525
"dependencies": {
26-
"@gitlive/firebase-app": "1.13.0",
26+
"@gitlive/firebase-app": "2.0.0",
2727
"firebase": "9.19.1",
2828
"kotlin": "1.8.20",
2929
"kotlinx-coroutines-core": "1.6.4"

firebase-firestore/src/jsMain/kotlin/dev/gitlive/firebase/firestore/firestore.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import dev.gitlive.firebase.firestore.externals.memoryLruGarbageCollector
1616
import dev.gitlive.firebase.firestore.externals.persistentLocalCache
1717
import dev.gitlive.firebase.firestore.internal.NativeDocumentSnapshotWrapper
1818
import dev.gitlive.firebase.firestore.internal.NativeFirebaseFirestoreWrapper
19+
import dev.gitlive.firebase.js
1920
import kotlin.js.Json
2021
import kotlin.js.json
2122
import dev.gitlive.firebase.firestore.externals.Firestore as JsFirestore
@@ -170,14 +171,14 @@ internal actual data class NativeDocumentSnapshot(val js: JsDocumentSnapshot)
170171
public operator fun DocumentSnapshot.Companion.invoke(js: JsDocumentSnapshot): DocumentSnapshot = DocumentSnapshot(NativeDocumentSnapshot(js))
171172
public val DocumentSnapshot.js: dev.gitlive.firebase.firestore.externals.DocumentSnapshot get() = native.js
172173

173-
public val SnapshotMetadata.js get() = js
174+
public val SnapshotMetadata.js: dev.gitlive.firebase.firestore.externals.SnapshotMetadata get() = js
174175

175176
public actual class SnapshotMetadata(internal val js: JsSnapshotMetadata) {
176177
public actual val hasPendingWrites: Boolean get() = js.hasPendingWrites
177178
public actual val isFromCache: Boolean get() = js.fromCache
178179
}
179180

180-
public val FieldPath.js get() = js
181+
public val FieldPath.js: dev.gitlive.firebase.firestore.externals.FieldPath get() = js
181182

182183
public actual class FieldPath private constructor(internal val js: JsFieldPath) {
183184

firebase-functions/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@gitlive/firebase-functions",
3-
"version": "1.13.0",
3+
"version": "2.0.0",
44
"description": "Wrapper around firebase for usage in Kotlin Multiplatform projects",
55
"main": "firebase-functions.js",
66
"scripts": {
@@ -23,7 +23,7 @@
2323
},
2424
"homepage": "https://github.com/GitLiveApp/firebase-kotlin-sdk",
2525
"dependencies": {
26-
"@gitlive/firebase-app": "1.13.0",
26+
"@gitlive/firebase-app": "2.0.0",
2727
"firebase": "9.19.1",
2828
"kotlin": "1.8.20",
2929
"kotlinx-coroutines-core": "1.6.4"

firebase-installations/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@gitlive/firebase-installations",
3-
"version": "1.13.0",
3+
"version": "2.0.0",
44
"description": "Wrapper around firebase for usage in Kotlin Multiplatform projects",
55
"main": "firebase-installations.js",
66
"scripts": {
@@ -23,7 +23,7 @@
2323
},
2424
"homepage": "https://github.com/GitLiveApp/firebase-kotlin-sdk",
2525
"dependencies": {
26-
"@gitlive/firebase-app": "1.13.0",
26+
"@gitlive/firebase-app": "2.0.0",
2727
"firebase": "9.19.1",
2828
"kotlin": "1.8.20",
2929
"kotlinx-coroutines-core": "1.6.4"

0 commit comments

Comments
 (0)