@synonymdev/react-native-pubky 0.10.6 → 0.11.1
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 +17 -17
- 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/Info.plist +4 -4
- package/ios/Frameworks/PubkyCore.xcframework/ios-arm64/Headers/pubkycoreFFI.h +5 -5
- package/ios/Frameworks/PubkyCore.xcframework/ios-arm64/libpubkycore.a +0 -0
- package/ios/Frameworks/PubkyCore.xcframework/ios-arm64-simulator/Headers/pubkycoreFFI.h +5 -5
- package/ios/Frameworks/PubkyCore.xcframework/ios-arm64-simulator/libpubkycore.a +0 -0
- package/ios/Pubky.swift +20 -20
- package/ios/pubkycore.swift +358 -347
- 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
|
}
|
|
@@ -396,7 +396,7 @@ internal interface _UniFFILib : Library {
|
|
|
396
396
|
): RustBuffer.ByValue
|
|
397
397
|
fun uniffi_pubkycore_fn_func_decrypt_recovery_file(`recoveryFile`: RustBuffer.ByValue,`passphrase`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus,
|
|
398
398
|
): RustBuffer.ByValue
|
|
399
|
-
fun uniffi_pubkycore_fn_func_delete_file(`url`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus,
|
|
399
|
+
fun uniffi_pubkycore_fn_func_delete_file(`url`: RustBuffer.ByValue,`secretKey`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus,
|
|
400
400
|
): RustBuffer.ByValue
|
|
401
401
|
fun uniffi_pubkycore_fn_func_generate_mnemonic_phrase(_uniffi_out_err: RustCallStatus,
|
|
402
402
|
): RustBuffer.ByValue
|
|
@@ -422,7 +422,7 @@ internal interface _UniFFILib : Library {
|
|
|
422
422
|
): RustBuffer.ByValue
|
|
423
423
|
fun uniffi_pubkycore_fn_func_publish_https(`recordName`: RustBuffer.ByValue,`target`: RustBuffer.ByValue,`secretKey`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus,
|
|
424
424
|
): RustBuffer.ByValue
|
|
425
|
-
fun uniffi_pubkycore_fn_func_put(`url`: RustBuffer.ByValue,`content`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus,
|
|
425
|
+
fun uniffi_pubkycore_fn_func_put(`url`: RustBuffer.ByValue,`content`: RustBuffer.ByValue,`secretKey`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus,
|
|
426
426
|
): RustBuffer.ByValue
|
|
427
427
|
fun uniffi_pubkycore_fn_func_remove_event_listener(_uniffi_out_err: RustCallStatus,
|
|
428
428
|
): Unit
|
|
@@ -432,13 +432,13 @@ internal interface _UniFFILib : Library {
|
|
|
432
432
|
): RustBuffer.ByValue
|
|
433
433
|
fun uniffi_pubkycore_fn_func_resolve_https(`publicKey`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus,
|
|
434
434
|
): RustBuffer.ByValue
|
|
435
|
-
fun
|
|
435
|
+
fun uniffi_pubkycore_fn_func_revalidate_session(`sessionSecret`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus,
|
|
436
436
|
): RustBuffer.ByValue
|
|
437
437
|
fun uniffi_pubkycore_fn_func_set_event_listener(`listener`: Long,_uniffi_out_err: RustCallStatus,
|
|
438
438
|
): Unit
|
|
439
439
|
fun uniffi_pubkycore_fn_func_sign_in(`secretKey`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus,
|
|
440
440
|
): RustBuffer.ByValue
|
|
441
|
-
fun uniffi_pubkycore_fn_func_sign_out(`
|
|
441
|
+
fun uniffi_pubkycore_fn_func_sign_out(`sessionSecret`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus,
|
|
442
442
|
): RustBuffer.ByValue
|
|
443
443
|
fun uniffi_pubkycore_fn_func_sign_up(`secretKey`: RustBuffer.ByValue,`homeserver`: RustBuffer.ByValue,`signupToken`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus,
|
|
444
444
|
): RustBuffer.ByValue
|
|
@@ -602,7 +602,7 @@ internal interface _UniFFILib : Library {
|
|
|
602
602
|
): Short
|
|
603
603
|
fun uniffi_pubkycore_checksum_func_resolve_https(
|
|
604
604
|
): Short
|
|
605
|
-
fun
|
|
605
|
+
fun uniffi_pubkycore_checksum_func_revalidate_session(
|
|
606
606
|
): Short
|
|
607
607
|
fun uniffi_pubkycore_checksum_func_set_event_listener(
|
|
608
608
|
): Short
|
|
@@ -644,7 +644,7 @@ private fun uniffiCheckApiChecksums(lib: _UniFFILib) {
|
|
|
644
644
|
if (lib.uniffi_pubkycore_checksum_func_decrypt_recovery_file() != 26407.toShort()) {
|
|
645
645
|
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
646
646
|
}
|
|
647
|
-
if (lib.uniffi_pubkycore_checksum_func_delete_file() !=
|
|
647
|
+
if (lib.uniffi_pubkycore_checksum_func_delete_file() != 47931.toShort()) {
|
|
648
648
|
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
649
649
|
}
|
|
650
650
|
if (lib.uniffi_pubkycore_checksum_func_generate_mnemonic_phrase() != 2358.toShort()) {
|
|
@@ -683,7 +683,7 @@ private fun uniffiCheckApiChecksums(lib: _UniFFILib) {
|
|
|
683
683
|
if (lib.uniffi_pubkycore_checksum_func_publish_https() != 5614.toShort()) {
|
|
684
684
|
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
685
685
|
}
|
|
686
|
-
if (lib.uniffi_pubkycore_checksum_func_put() !=
|
|
686
|
+
if (lib.uniffi_pubkycore_checksum_func_put() != 64514.toShort()) {
|
|
687
687
|
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
688
688
|
}
|
|
689
689
|
if (lib.uniffi_pubkycore_checksum_func_remove_event_listener() != 23534.toShort()) {
|
|
@@ -698,7 +698,7 @@ private fun uniffiCheckApiChecksums(lib: _UniFFILib) {
|
|
|
698
698
|
if (lib.uniffi_pubkycore_checksum_func_resolve_https() != 17266.toShort()) {
|
|
699
699
|
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
700
700
|
}
|
|
701
|
-
if (lib.
|
|
701
|
+
if (lib.uniffi_pubkycore_checksum_func_revalidate_session() != 57726.toShort()) {
|
|
702
702
|
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
703
703
|
}
|
|
704
704
|
if (lib.uniffi_pubkycore_checksum_func_set_event_listener() != 60071.toShort()) {
|
|
@@ -707,7 +707,7 @@ private fun uniffiCheckApiChecksums(lib: _UniFFILib) {
|
|
|
707
707
|
if (lib.uniffi_pubkycore_checksum_func_sign_in() != 21584.toShort()) {
|
|
708
708
|
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
709
709
|
}
|
|
710
|
-
if (lib.uniffi_pubkycore_checksum_func_sign_out() !=
|
|
710
|
+
if (lib.uniffi_pubkycore_checksum_func_sign_out() != 27163.toShort()) {
|
|
711
711
|
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
712
712
|
}
|
|
713
713
|
if (lib.uniffi_pubkycore_checksum_func_sign_up() != 48789.toShort()) {
|
|
@@ -1259,10 +1259,10 @@ fun `decryptRecoveryFile`(`recoveryFile`: String, `passphrase`: String): List<St
|
|
|
1259
1259
|
}
|
|
1260
1260
|
|
|
1261
1261
|
|
|
1262
|
-
fun `deleteFile`(`url`: String): List<String> {
|
|
1262
|
+
fun `deleteFile`(`url`: String, `secretKey`: String): List<String> {
|
|
1263
1263
|
return FfiConverterSequenceString.lift(
|
|
1264
1264
|
rustCall() { _status ->
|
|
1265
|
-
_UniFFILib.INSTANCE.uniffi_pubkycore_fn_func_delete_file(FfiConverterString.lower(`url`),_status)
|
|
1265
|
+
_UniFFILib.INSTANCE.uniffi_pubkycore_fn_func_delete_file(FfiConverterString.lower(`url`),FfiConverterString.lower(`secretKey`),_status)
|
|
1266
1266
|
})
|
|
1267
1267
|
}
|
|
1268
1268
|
|
|
@@ -1363,10 +1363,10 @@ fun `publishHttps`(`recordName`: String, `target`: String, `secretKey`: String):
|
|
|
1363
1363
|
}
|
|
1364
1364
|
|
|
1365
1365
|
|
|
1366
|
-
fun `put`(`url`: String, `content`: String): List<String> {
|
|
1366
|
+
fun `put`(`url`: String, `content`: String, `secretKey`: String): List<String> {
|
|
1367
1367
|
return FfiConverterSequenceString.lift(
|
|
1368
1368
|
rustCall() { _status ->
|
|
1369
|
-
_UniFFILib.INSTANCE.uniffi_pubkycore_fn_func_put(FfiConverterString.lower(`url`),FfiConverterString.lower(`content`),_status)
|
|
1369
|
+
_UniFFILib.INSTANCE.uniffi_pubkycore_fn_func_put(FfiConverterString.lower(`url`),FfiConverterString.lower(`content`),FfiConverterString.lower(`secretKey`),_status)
|
|
1370
1370
|
})
|
|
1371
1371
|
}
|
|
1372
1372
|
|
|
@@ -1403,10 +1403,10 @@ fun `resolveHttps`(`publicKey`: String): List<String> {
|
|
|
1403
1403
|
}
|
|
1404
1404
|
|
|
1405
1405
|
|
|
1406
|
-
fun `
|
|
1406
|
+
fun `revalidateSession`(`sessionSecret`: String): List<String> {
|
|
1407
1407
|
return FfiConverterSequenceString.lift(
|
|
1408
1408
|
rustCall() { _status ->
|
|
1409
|
-
_UniFFILib.INSTANCE.
|
|
1409
|
+
_UniFFILib.INSTANCE.uniffi_pubkycore_fn_func_revalidate_session(FfiConverterString.lower(`sessionSecret`),_status)
|
|
1410
1410
|
})
|
|
1411
1411
|
}
|
|
1412
1412
|
|
|
@@ -1427,10 +1427,10 @@ fun `signIn`(`secretKey`: String): List<String> {
|
|
|
1427
1427
|
}
|
|
1428
1428
|
|
|
1429
1429
|
|
|
1430
|
-
fun `signOut`(`
|
|
1430
|
+
fun `signOut`(`sessionSecret`: String): List<String> {
|
|
1431
1431
|
return FfiConverterSequenceString.lift(
|
|
1432
1432
|
rustCall() { _status ->
|
|
1433
|
-
_UniFFILib.INSTANCE.uniffi_pubkycore_fn_func_sign_out(FfiConverterString.lower(`
|
|
1433
|
+
_UniFFILib.INSTANCE.uniffi_pubkycore_fn_func_sign_out(FfiConverterString.lower(`sessionSecret`),_status)
|
|
1434
1434
|
})
|
|
1435
1435
|
}
|
|
1436
1436
|
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
<key>HeadersPath</key>
|
|
11
11
|
<string>Headers</string>
|
|
12
12
|
<key>LibraryIdentifier</key>
|
|
13
|
-
<string>ios-arm64
|
|
13
|
+
<string>ios-arm64</string>
|
|
14
14
|
<key>LibraryPath</key>
|
|
15
15
|
<string>libpubkycore.a</string>
|
|
16
16
|
<key>SupportedArchitectures</key>
|
|
@@ -19,8 +19,6 @@
|
|
|
19
19
|
</array>
|
|
20
20
|
<key>SupportedPlatform</key>
|
|
21
21
|
<string>ios</string>
|
|
22
|
-
<key>SupportedPlatformVariant</key>
|
|
23
|
-
<string>simulator</string>
|
|
24
22
|
</dict>
|
|
25
23
|
<dict>
|
|
26
24
|
<key>BinaryPath</key>
|
|
@@ -28,7 +26,7 @@
|
|
|
28
26
|
<key>HeadersPath</key>
|
|
29
27
|
<string>Headers</string>
|
|
30
28
|
<key>LibraryIdentifier</key>
|
|
31
|
-
<string>ios-arm64</string>
|
|
29
|
+
<string>ios-arm64-simulator</string>
|
|
32
30
|
<key>LibraryPath</key>
|
|
33
31
|
<string>libpubkycore.a</string>
|
|
34
32
|
<key>SupportedArchitectures</key>
|
|
@@ -37,6 +35,8 @@
|
|
|
37
35
|
</array>
|
|
38
36
|
<key>SupportedPlatform</key>
|
|
39
37
|
<string>ios</string>
|
|
38
|
+
<key>SupportedPlatformVariant</key>
|
|
39
|
+
<string>simulator</string>
|
|
40
40
|
</dict>
|
|
41
41
|
</array>
|
|
42
42
|
<key>CFBundlePackageType</key>
|
|
@@ -73,7 +73,7 @@ RustBuffer uniffi_pubkycore_fn_func_create_recovery_file(RustBuffer secret_key,
|
|
|
73
73
|
);
|
|
74
74
|
RustBuffer uniffi_pubkycore_fn_func_decrypt_recovery_file(RustBuffer recovery_file, RustBuffer passphrase, RustCallStatus *_Nonnull out_status
|
|
75
75
|
);
|
|
76
|
-
RustBuffer uniffi_pubkycore_fn_func_delete_file(RustBuffer url, RustCallStatus *_Nonnull out_status
|
|
76
|
+
RustBuffer uniffi_pubkycore_fn_func_delete_file(RustBuffer url, RustBuffer secret_key, RustCallStatus *_Nonnull out_status
|
|
77
77
|
);
|
|
78
78
|
RustBuffer uniffi_pubkycore_fn_func_generate_mnemonic_phrase(RustCallStatus *_Nonnull out_status
|
|
79
79
|
|
|
@@ -102,7 +102,7 @@ RustBuffer uniffi_pubkycore_fn_func_publish(RustBuffer record_name, RustBuffer r
|
|
|
102
102
|
);
|
|
103
103
|
RustBuffer uniffi_pubkycore_fn_func_publish_https(RustBuffer record_name, RustBuffer target, RustBuffer secret_key, RustCallStatus *_Nonnull out_status
|
|
104
104
|
);
|
|
105
|
-
RustBuffer uniffi_pubkycore_fn_func_put(RustBuffer url, RustBuffer content, RustCallStatus *_Nonnull out_status
|
|
105
|
+
RustBuffer uniffi_pubkycore_fn_func_put(RustBuffer url, RustBuffer content, RustBuffer secret_key, RustCallStatus *_Nonnull out_status
|
|
106
106
|
);
|
|
107
107
|
void uniffi_pubkycore_fn_func_remove_event_listener(RustCallStatus *_Nonnull out_status
|
|
108
108
|
|
|
@@ -113,13 +113,13 @@ RustBuffer uniffi_pubkycore_fn_func_resolve(RustBuffer public_key, RustCallStatu
|
|
|
113
113
|
);
|
|
114
114
|
RustBuffer uniffi_pubkycore_fn_func_resolve_https(RustBuffer public_key, RustCallStatus *_Nonnull out_status
|
|
115
115
|
);
|
|
116
|
-
RustBuffer
|
|
116
|
+
RustBuffer uniffi_pubkycore_fn_func_revalidate_session(RustBuffer session_secret, RustCallStatus *_Nonnull out_status
|
|
117
117
|
);
|
|
118
118
|
void uniffi_pubkycore_fn_func_set_event_listener(uint64_t listener, RustCallStatus *_Nonnull out_status
|
|
119
119
|
);
|
|
120
120
|
RustBuffer uniffi_pubkycore_fn_func_sign_in(RustBuffer secret_key, RustCallStatus *_Nonnull out_status
|
|
121
121
|
);
|
|
122
|
-
RustBuffer uniffi_pubkycore_fn_func_sign_out(RustBuffer
|
|
122
|
+
RustBuffer uniffi_pubkycore_fn_func_sign_out(RustBuffer session_secret, RustCallStatus *_Nonnull out_status
|
|
123
123
|
);
|
|
124
124
|
RustBuffer uniffi_pubkycore_fn_func_sign_up(RustBuffer secret_key, RustBuffer homeserver, RustBuffer signup_token, RustCallStatus *_Nonnull out_status
|
|
125
125
|
);
|
|
@@ -304,7 +304,7 @@ uint16_t uniffi_pubkycore_checksum_func_resolve(void
|
|
|
304
304
|
uint16_t uniffi_pubkycore_checksum_func_resolve_https(void
|
|
305
305
|
|
|
306
306
|
);
|
|
307
|
-
uint16_t
|
|
307
|
+
uint16_t uniffi_pubkycore_checksum_func_revalidate_session(void
|
|
308
308
|
|
|
309
309
|
);
|
|
310
310
|
uint16_t uniffi_pubkycore_checksum_func_set_event_listener(void
|
|
Binary file
|
|
@@ -73,7 +73,7 @@ RustBuffer uniffi_pubkycore_fn_func_create_recovery_file(RustBuffer secret_key,
|
|
|
73
73
|
);
|
|
74
74
|
RustBuffer uniffi_pubkycore_fn_func_decrypt_recovery_file(RustBuffer recovery_file, RustBuffer passphrase, RustCallStatus *_Nonnull out_status
|
|
75
75
|
);
|
|
76
|
-
RustBuffer uniffi_pubkycore_fn_func_delete_file(RustBuffer url, RustCallStatus *_Nonnull out_status
|
|
76
|
+
RustBuffer uniffi_pubkycore_fn_func_delete_file(RustBuffer url, RustBuffer secret_key, RustCallStatus *_Nonnull out_status
|
|
77
77
|
);
|
|
78
78
|
RustBuffer uniffi_pubkycore_fn_func_generate_mnemonic_phrase(RustCallStatus *_Nonnull out_status
|
|
79
79
|
|
|
@@ -102,7 +102,7 @@ RustBuffer uniffi_pubkycore_fn_func_publish(RustBuffer record_name, RustBuffer r
|
|
|
102
102
|
);
|
|
103
103
|
RustBuffer uniffi_pubkycore_fn_func_publish_https(RustBuffer record_name, RustBuffer target, RustBuffer secret_key, RustCallStatus *_Nonnull out_status
|
|
104
104
|
);
|
|
105
|
-
RustBuffer uniffi_pubkycore_fn_func_put(RustBuffer url, RustBuffer content, RustCallStatus *_Nonnull out_status
|
|
105
|
+
RustBuffer uniffi_pubkycore_fn_func_put(RustBuffer url, RustBuffer content, RustBuffer secret_key, RustCallStatus *_Nonnull out_status
|
|
106
106
|
);
|
|
107
107
|
void uniffi_pubkycore_fn_func_remove_event_listener(RustCallStatus *_Nonnull out_status
|
|
108
108
|
|
|
@@ -113,13 +113,13 @@ RustBuffer uniffi_pubkycore_fn_func_resolve(RustBuffer public_key, RustCallStatu
|
|
|
113
113
|
);
|
|
114
114
|
RustBuffer uniffi_pubkycore_fn_func_resolve_https(RustBuffer public_key, RustCallStatus *_Nonnull out_status
|
|
115
115
|
);
|
|
116
|
-
RustBuffer
|
|
116
|
+
RustBuffer uniffi_pubkycore_fn_func_revalidate_session(RustBuffer session_secret, RustCallStatus *_Nonnull out_status
|
|
117
117
|
);
|
|
118
118
|
void uniffi_pubkycore_fn_func_set_event_listener(uint64_t listener, RustCallStatus *_Nonnull out_status
|
|
119
119
|
);
|
|
120
120
|
RustBuffer uniffi_pubkycore_fn_func_sign_in(RustBuffer secret_key, RustCallStatus *_Nonnull out_status
|
|
121
121
|
);
|
|
122
|
-
RustBuffer uniffi_pubkycore_fn_func_sign_out(RustBuffer
|
|
122
|
+
RustBuffer uniffi_pubkycore_fn_func_sign_out(RustBuffer session_secret, RustCallStatus *_Nonnull out_status
|
|
123
123
|
);
|
|
124
124
|
RustBuffer uniffi_pubkycore_fn_func_sign_up(RustBuffer secret_key, RustBuffer homeserver, RustBuffer signup_token, RustCallStatus *_Nonnull out_status
|
|
125
125
|
);
|
|
@@ -304,7 +304,7 @@ uint16_t uniffi_pubkycore_checksum_func_resolve(void
|
|
|
304
304
|
uint16_t uniffi_pubkycore_checksum_func_resolve_https(void
|
|
305
305
|
|
|
306
306
|
);
|
|
307
|
-
uint16_t
|
|
307
|
+
uint16_t uniffi_pubkycore_checksum_func_revalidate_session(void
|
|
308
308
|
|
|
309
309
|
);
|
|
310
310
|
uint16_t uniffi_pubkycore_checksum_func_set_event_listener(void
|
|
Binary file
|
package/ios/Pubky.swift
CHANGED
|
@@ -136,10 +136,10 @@ class Pubky: RCTEventEmitter {
|
|
|
136
136
|
}
|
|
137
137
|
|
|
138
138
|
@objc(signOut:withResolver:withRejecter:)
|
|
139
|
-
func signOut(_
|
|
139
|
+
func signOut(_ sessionSecret: String, resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock) {
|
|
140
140
|
Task {
|
|
141
141
|
do {
|
|
142
|
-
let result = try await react_native_pubky.signOut(
|
|
142
|
+
let result = try await react_native_pubky.signOut(sessionSecret: sessionSecret)
|
|
143
143
|
resolve(result)
|
|
144
144
|
} catch {
|
|
145
145
|
reject("signOut Error", "Failed to sign out", error)
|
|
@@ -147,11 +147,23 @@ class Pubky: RCTEventEmitter {
|
|
|
147
147
|
}
|
|
148
148
|
}
|
|
149
149
|
|
|
150
|
-
@objc(
|
|
151
|
-
func
|
|
150
|
+
@objc(revalidateSession:withResolver:withRejecter:)
|
|
151
|
+
func revalidateSession(_ sessionSecret: String, resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock) {
|
|
152
152
|
Task {
|
|
153
153
|
do {
|
|
154
|
-
let result = try await react_native_pubky.
|
|
154
|
+
let result = try await react_native_pubky.revalidateSession(sessionSecret: sessionSecret)
|
|
155
|
+
resolve(result)
|
|
156
|
+
} catch {
|
|
157
|
+
reject("revalidateSession Error", "Failed to revalidate session", error)
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
@objc(put:content:secretKey:withResolver:withRejecter:)
|
|
163
|
+
func put(_ url: String, content: String, secretKey: String, resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock) {
|
|
164
|
+
Task {
|
|
165
|
+
do {
|
|
166
|
+
let result = try await react_native_pubky.put(url: url, content: content, secretKey: secretKey)
|
|
155
167
|
resolve(result)
|
|
156
168
|
} catch {
|
|
157
169
|
reject("put Error", "Failed to put", error)
|
|
@@ -207,11 +219,11 @@ class Pubky: RCTEventEmitter {
|
|
|
207
219
|
}
|
|
208
220
|
}
|
|
209
221
|
|
|
210
|
-
@objc(deleteFile:withResolver:withRejecter:)
|
|
211
|
-
func deleteFile(_ url: String, resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock) {
|
|
222
|
+
@objc(deleteFile:secretKey:withResolver:withRejecter:)
|
|
223
|
+
func deleteFile(_ url: String, secretKey: String, resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock) {
|
|
212
224
|
Task {
|
|
213
225
|
do {
|
|
214
|
-
let result = try await react_native_pubky.deleteFile(url: url)
|
|
226
|
+
let result = try await react_native_pubky.deleteFile(url: url, secretKey: secretKey)
|
|
215
227
|
resolve(result)
|
|
216
228
|
} catch {
|
|
217
229
|
reject("list Error", "Failed to deleteFile", error)
|
|
@@ -219,18 +231,6 @@ class Pubky: RCTEventEmitter {
|
|
|
219
231
|
}
|
|
220
232
|
}
|
|
221
233
|
|
|
222
|
-
@objc(session:withResolver:withRejecter:)
|
|
223
|
-
func session(_ pubky: String, resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock) {
|
|
224
|
-
Task {
|
|
225
|
-
do {
|
|
226
|
-
let result = react_native_pubky.session(pubky: pubky)
|
|
227
|
-
resolve(result)
|
|
228
|
-
} catch {
|
|
229
|
-
reject("session Error", "Failed to get session", error)
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
|
|
234
234
|
@objc(generateSecretKey:withRejecter:)
|
|
235
235
|
func generateSecretKey(_ resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock) {
|
|
236
236
|
Task {
|