@synonymdev/react-native-pubky 0.10.6 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/build.gradle +5 -3
- package/android/src/main/java/com/pubky/PubkyModule.kt +25 -25
- package/android/src/main/java/uniffi/pubkycore/pubkycore.kt +1402 -826
- package/android/src/main/jniLibs/arm64-v8a/libpubkycore.so +0 -0
- package/android/src/main/jniLibs/armeabi-v7a/libpubkycore.so +0 -0
- package/android/src/main/jniLibs/x86/libpubkycore.so +0 -0
- package/android/src/main/jniLibs/x86_64/libpubkycore.so +0 -0
- package/ios/Frameworks/PubkyCore.xcframework/ios-arm64/Headers/module.modulemap +3 -2
- package/ios/Frameworks/PubkyCore.xcframework/ios-arm64/Headers/pubkycoreFFI.h +688 -134
- package/ios/Frameworks/PubkyCore.xcframework/ios-arm64/libpubkycore.a +0 -0
- package/ios/Frameworks/PubkyCore.xcframework/ios-arm64-simulator/Headers/module.modulemap +3 -2
- package/ios/Frameworks/PubkyCore.xcframework/ios-arm64-simulator/Headers/pubkycoreFFI.h +688 -134
- package/ios/Frameworks/PubkyCore.xcframework/ios-arm64-simulator/libpubkycore.a +0 -0
- package/ios/Pubky.swift +20 -20
- package/ios/pubkycore.swift +438 -369
- package/lib/commonjs/index.js +18 -18
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/index.js +17 -17
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/commonjs/src/index.d.ts +5 -4
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
- package/lib/typescript/module/src/index.d.ts +5 -4
- package/lib/typescript/module/src/index.d.ts.map +1 -1
- package/package.json +12 -12
- package/src/index.tsx +25 -18
package/android/build.gradle
CHANGED
|
@@ -26,9 +26,11 @@ def isNewArchitectureEnabled() {
|
|
|
26
26
|
apply plugin: "com.android.library"
|
|
27
27
|
apply plugin: "kotlin-android"
|
|
28
28
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
// Disable New Architecture plugin for this library to prevent codegen from
|
|
30
|
+
// generating duplicate React Native core classes
|
|
31
|
+
// if (isNewArchitectureEnabled()) {
|
|
32
|
+
// apply plugin: "com.facebook.react"
|
|
33
|
+
// }
|
|
32
34
|
|
|
33
35
|
def getExtOrDefault(name) {
|
|
34
36
|
return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties["Pubky_" + name]
|
|
@@ -60,29 +60,10 @@ class PubkyModule(reactContext: ReactApplicationContext) :
|
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
@ReactMethod
|
|
63
|
-
fun deleteFile(url: String, promise: Promise) {
|
|
63
|
+
fun deleteFile(url: String, secretKey: String, promise: Promise) {
|
|
64
64
|
CoroutineScope(Dispatchers.IO).launch {
|
|
65
65
|
try {
|
|
66
|
-
val result = deleteFile(url)
|
|
67
|
-
val array = Arguments.createArray().apply {
|
|
68
|
-
result.forEach { pushString(it) }
|
|
69
|
-
}
|
|
70
|
-
withContext(Dispatchers.Main) {
|
|
71
|
-
promise.resolve(array)
|
|
72
|
-
}
|
|
73
|
-
} catch (e: Exception) {
|
|
74
|
-
withContext(Dispatchers.Main) {
|
|
75
|
-
promise.reject("Error", e.message)
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
@ReactMethod
|
|
82
|
-
fun session(pubky: String, promise: Promise) {
|
|
83
|
-
CoroutineScope(Dispatchers.IO).launch {
|
|
84
|
-
try {
|
|
85
|
-
val result = session(pubky)
|
|
66
|
+
val result = deleteFile(url, secretKey)
|
|
86
67
|
val array = Arguments.createArray().apply {
|
|
87
68
|
result.forEach { pushString(it) }
|
|
88
69
|
}
|
|
@@ -244,10 +225,29 @@ class PubkyModule(reactContext: ReactApplicationContext) :
|
|
|
244
225
|
}
|
|
245
226
|
|
|
246
227
|
@ReactMethod
|
|
247
|
-
fun signOut(
|
|
228
|
+
fun signOut(sessionSecret: String, promise: Promise) {
|
|
229
|
+
CoroutineScope(Dispatchers.IO).launch {
|
|
230
|
+
try {
|
|
231
|
+
val result = signOut(sessionSecret)
|
|
232
|
+
val array = Arguments.createArray().apply {
|
|
233
|
+
result.forEach { pushString(it) }
|
|
234
|
+
}
|
|
235
|
+
withContext(Dispatchers.Main) {
|
|
236
|
+
promise.resolve(array)
|
|
237
|
+
}
|
|
238
|
+
} catch (e: Exception) {
|
|
239
|
+
withContext(Dispatchers.Main) {
|
|
240
|
+
promise.reject("Error", e.message)
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
@ReactMethod
|
|
247
|
+
fun revalidateSession(sessionSecret: String, promise: Promise) {
|
|
248
248
|
CoroutineScope(Dispatchers.IO).launch {
|
|
249
249
|
try {
|
|
250
|
-
val result =
|
|
250
|
+
val result = revalidateSession(sessionSecret)
|
|
251
251
|
val array = Arguments.createArray().apply {
|
|
252
252
|
result.forEach { pushString(it) }
|
|
253
253
|
}
|
|
@@ -263,10 +263,10 @@ class PubkyModule(reactContext: ReactApplicationContext) :
|
|
|
263
263
|
}
|
|
264
264
|
|
|
265
265
|
@ReactMethod
|
|
266
|
-
fun put(url: String, content: String, promise: Promise) {
|
|
266
|
+
fun put(url: String, content: String, secretKey: String, promise: Promise) {
|
|
267
267
|
CoroutineScope(Dispatchers.IO).launch {
|
|
268
268
|
try {
|
|
269
|
-
val result = put(url, content)
|
|
269
|
+
val result = put(url, content, secretKey)
|
|
270
270
|
val array = Arguments.createArray().apply {
|
|
271
271
|
result.forEach { pushString(it) }
|
|
272
272
|
}
|