Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F33321628
D11589.1768847252.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
7 KB
Referenced Files
None
Subscribers
None
D11589.1768847252.diff
View Options
diff --git a/native/cpp/CommonCpp/NativeModules/CommRustModule.h b/native/cpp/CommonCpp/NativeModules/CommRustModule.h
--- a/native/cpp/CommonCpp/NativeModules/CommRustModule.h
+++ b/native/cpp/CommonCpp/NativeModules/CommRustModule.h
@@ -64,6 +64,12 @@
jsi::String deviceID,
jsi::String accessToken,
jsi::String password) override;
+ virtual jsi::Value deletePasswordUser(
+ jsi::Runtime &rt,
+ jsi::String userID,
+ jsi::String deviceID,
+ jsi::String accessToken,
+ jsi::String password) override;
virtual jsi::Value deleteWalletUser(
jsi::Runtime &rt,
jsi::String userID,
diff --git a/native/cpp/CommonCpp/NativeModules/CommRustModule.cpp b/native/cpp/CommonCpp/NativeModules/CommRustModule.cpp
--- a/native/cpp/CommonCpp/NativeModules/CommRustModule.cpp
+++ b/native/cpp/CommonCpp/NativeModules/CommRustModule.cpp
@@ -270,6 +270,39 @@
});
}
+jsi::Value CommRustModule::deletePasswordUser(
+ jsi::Runtime &rt,
+ jsi::String userID,
+ jsi::String deviceID,
+ jsi::String accessToken,
+ jsi::String password) {
+ auto userIDRust = jsiStringToRustString(userID, rt);
+ auto deviceIDRust = jsiStringToRustString(deviceID, rt);
+ auto accessTokenRust = jsiStringToRustString(accessToken, rt);
+ auto passwordRust = jsiStringToRustString(password, rt);
+
+ return createPromiseAsJSIValue(
+ rt, [=, this](jsi::Runtime &innerRt, std::shared_ptr<Promise> promise) {
+ std::string error;
+ try {
+ auto currentID = RustPromiseManager::instance.addPromise(
+ {promise, this->jsInvoker_, innerRt});
+ identityDeletePasswordUser(
+ userIDRust,
+ deviceIDRust,
+ accessTokenRust,
+ passwordRust,
+ currentID);
+ } catch (const std::exception &e) {
+ error = e.what();
+ };
+ if (!error.empty()) {
+ this->jsInvoker_->invokeAsync(
+ [error, promise]() { promise->reject(error); });
+ }
+ });
+}
+
jsi::Value CommRustModule::deleteWalletUser(
jsi::Runtime &rt,
jsi::String userID,
diff --git a/native/cpp/CommonCpp/_generated/rustJSI-generated.cpp b/native/cpp/CommonCpp/_generated/rustJSI-generated.cpp
--- a/native/cpp/CommonCpp/_generated/rustJSI-generated.cpp
+++ b/native/cpp/CommonCpp/_generated/rustJSI-generated.cpp
@@ -30,6 +30,9 @@
static jsi::Value __hostFunction_CommRustModuleSchemaCxxSpecJSI_updatePassword(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
return static_cast<CommRustModuleSchemaCxxSpecJSI *>(&turboModule)->updatePassword(rt, args[0].asString(rt), args[1].asString(rt), args[2].asString(rt), args[3].asString(rt));
}
+static jsi::Value __hostFunction_CommRustModuleSchemaCxxSpecJSI_deletePasswordUser(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
+ return static_cast<CommRustModuleSchemaCxxSpecJSI *>(&turboModule)->deletePasswordUser(rt, args[0].asString(rt), args[1].asString(rt), args[2].asString(rt), args[3].asString(rt));
+}
static jsi::Value __hostFunction_CommRustModuleSchemaCxxSpecJSI_deleteWalletUser(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
return static_cast<CommRustModuleSchemaCxxSpecJSI *>(&turboModule)->deleteWalletUser(rt, args[0].asString(rt), args[1].asString(rt), args[2].asString(rt));
}
@@ -87,6 +90,7 @@
methodMap_["registerWalletUser"] = MethodMetadata {11, __hostFunction_CommRustModuleSchemaCxxSpecJSI_registerWalletUser};
methodMap_["logInWalletUser"] = MethodMetadata {8, __hostFunction_CommRustModuleSchemaCxxSpecJSI_logInWalletUser};
methodMap_["updatePassword"] = MethodMetadata {4, __hostFunction_CommRustModuleSchemaCxxSpecJSI_updatePassword};
+ methodMap_["deletePasswordUser"] = MethodMetadata {4, __hostFunction_CommRustModuleSchemaCxxSpecJSI_deletePasswordUser};
methodMap_["deleteWalletUser"] = MethodMetadata {3, __hostFunction_CommRustModuleSchemaCxxSpecJSI_deleteWalletUser};
methodMap_["logOut"] = MethodMetadata {3, __hostFunction_CommRustModuleSchemaCxxSpecJSI_logOut};
methodMap_["getOutboundKeysForUser"] = MethodMetadata {4, __hostFunction_CommRustModuleSchemaCxxSpecJSI_getOutboundKeysForUser};
diff --git a/native/cpp/CommonCpp/_generated/rustJSI.h b/native/cpp/CommonCpp/_generated/rustJSI.h
--- a/native/cpp/CommonCpp/_generated/rustJSI.h
+++ b/native/cpp/CommonCpp/_generated/rustJSI.h
@@ -26,6 +26,7 @@
virtual jsi::Value registerWalletUser(jsi::Runtime &rt, jsi::String siweMessage, jsi::String siweSignature, jsi::String keyPayload, jsi::String keyPayloadSignature, jsi::String contentPrekey, jsi::String contentPrekeySignature, jsi::String notifPrekey, jsi::String notifPrekeySignature, jsi::Array contentOneTimeKeys, jsi::Array notifOneTimeKeys, jsi::String farcasterID) = 0;
virtual jsi::Value logInWalletUser(jsi::Runtime &rt, jsi::String siweMessage, jsi::String siweSignature, jsi::String keyPayload, jsi::String keyPayloadSignature, jsi::String contentPrekey, jsi::String contentPrekeySignature, jsi::String notifPrekey, jsi::String notifPrekeySignature) = 0;
virtual jsi::Value updatePassword(jsi::Runtime &rt, jsi::String userID, jsi::String deviceID, jsi::String accessToken, jsi::String password) = 0;
+ virtual jsi::Value deletePasswordUser(jsi::Runtime &rt, jsi::String userID, jsi::String deviceID, jsi::String accessToken, jsi::String password) = 0;
virtual jsi::Value deleteWalletUser(jsi::Runtime &rt, jsi::String userID, jsi::String deviceID, jsi::String accessToken) = 0;
virtual jsi::Value logOut(jsi::Runtime &rt, jsi::String userID, jsi::String deviceID, jsi::String accessToken) = 0;
virtual jsi::Value getOutboundKeysForUser(jsi::Runtime &rt, jsi::String authUserID, jsi::String authDeviceID, jsi::String authAccessToken, jsi::String userID) = 0;
@@ -111,6 +112,14 @@
return bridging::callFromJs<jsi::Value>(
rt, &T::updatePassword, jsInvoker_, instance_, std::move(userID), std::move(deviceID), std::move(accessToken), std::move(password));
}
+ jsi::Value deletePasswordUser(jsi::Runtime &rt, jsi::String userID, jsi::String deviceID, jsi::String accessToken, jsi::String password) override {
+ static_assert(
+ bridging::getParameterCount(&T::deletePasswordUser) == 5,
+ "Expected deletePasswordUser(...) to have 5 parameters");
+
+ return bridging::callFromJs<jsi::Value>(
+ rt, &T::deletePasswordUser, jsInvoker_, instance_, std::move(userID), std::move(deviceID), std::move(accessToken), std::move(password));
+ }
jsi::Value deleteWalletUser(jsi::Runtime &rt, jsi::String userID, jsi::String deviceID, jsi::String accessToken) override {
static_assert(
bridging::getParameterCount(&T::deleteWalletUser) == 4,
diff --git a/native/schema/CommRustModuleSchema.js b/native/schema/CommRustModuleSchema.js
--- a/native/schema/CommRustModuleSchema.js
+++ b/native/schema/CommRustModuleSchema.js
@@ -59,6 +59,12 @@
accessToken: string,
password: string,
) => Promise<void>;
+ +deletePasswordUser: (
+ userID: string,
+ deviceID: string,
+ accessToken: string,
+ password: string,
+ ) => Promise<void>;
+deleteWalletUser: (
userID: string,
deviceID: string,
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Jan 19, 6:27 PM (13 h, 20 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5957711
Default Alt Text
D11589.1768847252.diff (7 KB)
Attached To
Mode
D11589: [commRustModule] expose deletePasswordUser to JS
Attached
Detach File
Event Timeline
Log In to Comment