react-native-email-imap-smtp 0.1.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/EmailImapSmtp.podspec +29 -0
- package/LICENSE +20 -0
- package/README.md +121 -0
- package/android/CMakeLists.txt +24 -0
- package/android/build.gradle +117 -0
- package/android/src/main/AndroidManifest.xml +3 -0
- package/android/src/main/cpp/cpp-adapter.cpp +11 -0
- package/android/src/main/java/com/margelo/nitro/emailimapsmtp/EmailImapSmtp.kt +1533 -0
- package/android/src/main/java/com/margelo/nitro/emailimapsmtp/EmailImapSmtpPackage.kt +22 -0
- package/ios/EmailImapSmtp.swift +5 -0
- package/lib/module/EmailImapSmtp.nitro.js +4 -0
- package/lib/module/EmailImapSmtp.nitro.js.map +1 -0
- package/lib/module/NativeEmailImapSmtp.js +14 -0
- package/lib/module/NativeEmailImapSmtp.js.map +1 -0
- package/lib/module/index.js +64 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/native.js +227 -0
- package/lib/module/native.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/module/types.js +2 -0
- package/lib/module/types.js.map +1 -0
- package/lib/module/web.js +107 -0
- package/lib/module/web.js.map +1 -0
- package/lib/module/windows.js +156 -0
- package/lib/module/windows.js.map +1 -0
- package/lib/typescript/package.json +1 -0
- package/lib/typescript/src/EmailImapSmtp.nitro.d.ts +268 -0
- package/lib/typescript/src/EmailImapSmtp.nitro.d.ts.map +1 -0
- package/lib/typescript/src/NativeEmailImapSmtp.d.ts +36 -0
- package/lib/typescript/src/NativeEmailImapSmtp.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +33 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/lib/typescript/src/native.d.ts +32 -0
- package/lib/typescript/src/native.d.ts.map +1 -0
- package/lib/typescript/src/types.d.ts +261 -0
- package/lib/typescript/src/types.d.ts.map +1 -0
- package/lib/typescript/src/web.d.ts +32 -0
- package/lib/typescript/src/web.d.ts.map +1 -0
- package/lib/typescript/src/windows.d.ts +32 -0
- package/lib/typescript/src/windows.d.ts.map +1 -0
- package/nitro.json +23 -0
- package/nitrogen/generated/android/c++/JAppendResult.hpp +65 -0
- package/nitrogen/generated/android/c++/JAttachmentInfo.hpp +96 -0
- package/nitrogen/generated/android/c++/JConnectionConfig.hpp +94 -0
- package/nitrogen/generated/android/c++/JConnectionResult.hpp +73 -0
- package/nitrogen/generated/android/c++/JDeleteResult.hpp +87 -0
- package/nitrogen/generated/android/c++/JEmailAddress.hpp +61 -0
- package/nitrogen/generated/android/c++/JEmailBody.hpp +84 -0
- package/nitrogen/generated/android/c++/JEmailMessage.hpp +273 -0
- package/nitrogen/generated/android/c++/JFetchEmailsOptions.hpp +110 -0
- package/nitrogen/generated/android/c++/JFolderInfo.hpp +126 -0
- package/nitrogen/generated/android/c++/JFunc_void_IdleNotification.hpp +79 -0
- package/nitrogen/generated/android/c++/JHybridEmailImapSmtpSpec.cpp +697 -0
- package/nitrogen/generated/android/c++/JHybridEmailImapSmtpSpec.hpp +92 -0
- package/nitrogen/generated/android/c++/JIdleNotification.hpp +78 -0
- package/nitrogen/generated/android/c++/JImapServerInfo.hpp +84 -0
- package/nitrogen/generated/android/c++/JMailboxInfo.hpp +134 -0
- package/nitrogen/generated/android/c++/JMailboxListItem.hpp +92 -0
- package/nitrogen/generated/android/c++/JQuotaInfo.hpp +78 -0
- package/nitrogen/generated/android/c++/JSearchCriteria.hpp +187 -0
- package/nitrogen/generated/android/c++/JSearchHeader.hpp +61 -0
- package/nitrogen/generated/android/c++/JSendMailOptions.hpp +229 -0
- package/nitrogen/generated/android/c++/JSendMailResult.hpp +88 -0
- package/nitrogen/generated/android/c++/JSmtpAttachment.hpp +80 -0
- package/nitrogen/generated/android/c++/JSmtpConnectionConfig.hpp +98 -0
- package/nitrogen/generated/android/c++/JSmtpServerInfo.hpp +102 -0
- package/nitrogen/generated/android/c++/JVariant_ImapServerInfo_SmtpServerInfo.cpp +26 -0
- package/nitrogen/generated/android/c++/JVariant_ImapServerInfo_SmtpServerInfo.hpp +73 -0
- package/nitrogen/generated/android/c++/JVariant_NullType_AttachmentInfo.cpp +26 -0
- package/nitrogen/generated/android/c++/JVariant_NullType_AttachmentInfo.hpp +75 -0
- package/nitrogen/generated/android/c++/JVariant_NullType_EmailMessage.cpp +26 -0
- package/nitrogen/generated/android/c++/JVariant_NullType_EmailMessage.hpp +83 -0
- package/nitrogen/generated/android/emailimapsmtp+autolinking.cmake +84 -0
- package/nitrogen/generated/android/emailimapsmtp+autolinking.gradle +27 -0
- package/nitrogen/generated/android/emailimapsmtpOnLoad.cpp +56 -0
- package/nitrogen/generated/android/emailimapsmtpOnLoad.hpp +34 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/emailimapsmtp/AppendResult.kt +61 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/emailimapsmtp/AttachmentInfo.kt +96 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/emailimapsmtp/ConnectionConfig.kt +96 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/emailimapsmtp/ConnectionResult.kt +61 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/emailimapsmtp/DeleteResult.kt +61 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/emailimapsmtp/EmailAddress.kt +56 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/emailimapsmtp/EmailBody.kt +61 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/emailimapsmtp/EmailMessage.kt +156 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/emailimapsmtp/FetchEmailsOptions.kt +116 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/emailimapsmtp/FolderInfo.kt +91 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/emailimapsmtp/Func_void_IdleNotification.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/emailimapsmtp/HybridEmailImapSmtpSpec.kt +178 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/emailimapsmtp/IdleNotification.kt +76 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/emailimapsmtp/ImapServerInfo.kt +61 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/emailimapsmtp/MailboxInfo.kt +101 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/emailimapsmtp/MailboxListItem.kt +71 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/emailimapsmtp/QuotaInfo.kt +76 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/emailimapsmtp/SearchCriteria.kt +196 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/emailimapsmtp/SearchHeader.kt +56 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/emailimapsmtp/SendMailOptions.kt +126 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/emailimapsmtp/SendMailResult.kt +86 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/emailimapsmtp/SmtpAttachment.kt +76 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/emailimapsmtp/SmtpConnectionConfig.kt +101 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/emailimapsmtp/SmtpServerInfo.kt +61 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/emailimapsmtp/Variant_ImapServerInfo_SmtpServerInfo.kt +62 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/emailimapsmtp/Variant_NullType_AttachmentInfo.kt +62 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/emailimapsmtp/Variant_NullType_EmailMessage.kt +62 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/emailimapsmtp/emailimapsmtpOnLoad.kt +35 -0
- package/nitrogen/generated/ios/EmailImapSmtp+autolinking.rb +62 -0
- package/nitrogen/generated/ios/EmailImapSmtp-Swift-Cxx-Bridge.cpp +161 -0
- package/nitrogen/generated/ios/EmailImapSmtp-Swift-Cxx-Bridge.hpp +1132 -0
- package/nitrogen/generated/ios/EmailImapSmtp-Swift-Cxx-Umbrella.hpp +118 -0
- package/nitrogen/generated/ios/EmailImapSmtpAutolinking.mm +33 -0
- package/nitrogen/generated/ios/EmailImapSmtpAutolinking.swift +26 -0
- package/nitrogen/generated/ios/c++/HybridEmailImapSmtpSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridEmailImapSmtpSpecSwift.hpp +390 -0
- package/nitrogen/generated/ios/swift/AppendResult.swift +39 -0
- package/nitrogen/generated/ios/swift/AttachmentInfo.swift +113 -0
- package/nitrogen/generated/ios/swift/ConnectionConfig.swift +87 -0
- package/nitrogen/generated/ios/swift/ConnectionResult.swift +84 -0
- package/nitrogen/generated/ios/swift/DeleteResult.swift +64 -0
- package/nitrogen/generated/ios/swift/EmailAddress.swift +34 -0
- package/nitrogen/generated/ios/swift/EmailBody.swift +45 -0
- package/nitrogen/generated/ios/swift/EmailMessage.swift +184 -0
- package/nitrogen/generated/ios/swift/FetchEmailsOptions.swift +198 -0
- package/nitrogen/generated/ios/swift/FolderInfo.swift +81 -0
- package/nitrogen/generated/ios/swift/Func_void.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_AppendResult.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_ConnectionResult.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_DeleteResult.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_IdleNotification.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_MailboxInfo.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_QuotaInfo.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_SendMailResult.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_bool.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_std__variant_nitro__NullType__AttachmentInfo_.swift +58 -0
- package/nitrogen/generated/ios/swift/Func_void_std__variant_nitro__NullType__EmailMessage_.swift +58 -0
- package/nitrogen/generated/ios/swift/Func_void_std__vector_AttachmentInfo_.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_std__vector_EmailMessage_.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_std__vector_FolderInfo_.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_std__vector_MailboxListItem_.swift +46 -0
- package/nitrogen/generated/ios/swift/HybridEmailImapSmtpSpec.swift +84 -0
- package/nitrogen/generated/ios/swift/HybridEmailImapSmtpSpec_cxx.swift +759 -0
- package/nitrogen/generated/ios/swift/IdleNotification.swift +93 -0
- package/nitrogen/generated/ios/swift/ImapServerInfo.swift +45 -0
- package/nitrogen/generated/ios/swift/MailboxInfo.swift +91 -0
- package/nitrogen/generated/ios/swift/MailboxListItem.swift +55 -0
- package/nitrogen/generated/ios/swift/QuotaInfo.swift +80 -0
- package/nitrogen/generated/ios/swift/SearchCriteria.swift +485 -0
- package/nitrogen/generated/ios/swift/SearchHeader.swift +34 -0
- package/nitrogen/generated/ios/swift/SendMailOptions.swift +310 -0
- package/nitrogen/generated/ios/swift/SendMailResult.swift +155 -0
- package/nitrogen/generated/ios/swift/SmtpAttachment.swift +80 -0
- package/nitrogen/generated/ios/swift/SmtpConnectionConfig.swift +105 -0
- package/nitrogen/generated/ios/swift/SmtpServerInfo.swift +51 -0
- package/nitrogen/generated/ios/swift/Variant_ImapServerInfo_SmtpServerInfo.swift +30 -0
- package/nitrogen/generated/ios/swift/Variant_NullType_AttachmentInfo.swift +30 -0
- package/nitrogen/generated/ios/swift/Variant_NullType_EmailMessage.swift +30 -0
- package/nitrogen/generated/shared/c++/AppendResult.hpp +91 -0
- package/nitrogen/generated/shared/c++/AttachmentInfo.hpp +121 -0
- package/nitrogen/generated/shared/c++/ConnectionConfig.hpp +120 -0
- package/nitrogen/generated/shared/c++/ConnectionResult.hpp +98 -0
- package/nitrogen/generated/shared/c++/DeleteResult.hpp +93 -0
- package/nitrogen/generated/shared/c++/EmailAddress.hpp +87 -0
- package/nitrogen/generated/shared/c++/EmailBody.hpp +92 -0
- package/nitrogen/generated/shared/c++/EmailMessage.hpp +177 -0
- package/nitrogen/generated/shared/c++/FetchEmailsOptions.hpp +136 -0
- package/nitrogen/generated/shared/c++/FolderInfo.hpp +116 -0
- package/nitrogen/generated/shared/c++/HybridEmailImapSmtpSpec.cpp +50 -0
- package/nitrogen/generated/shared/c++/HybridEmailImapSmtpSpec.hpp +145 -0
- package/nitrogen/generated/shared/c++/IdleNotification.hpp +104 -0
- package/nitrogen/generated/shared/c++/ImapServerInfo.hpp +92 -0
- package/nitrogen/generated/shared/c++/MailboxInfo.hpp +124 -0
- package/nitrogen/generated/shared/c++/MailboxListItem.hpp +100 -0
- package/nitrogen/generated/shared/c++/QuotaInfo.hpp +104 -0
- package/nitrogen/generated/shared/c++/SearchCriteria.hpp +203 -0
- package/nitrogen/generated/shared/c++/SearchHeader.hpp +87 -0
- package/nitrogen/generated/shared/c++/SendMailOptions.hpp +151 -0
- package/nitrogen/generated/shared/c++/SendMailResult.hpp +113 -0
- package/nitrogen/generated/shared/c++/SmtpAttachment.hpp +105 -0
- package/nitrogen/generated/shared/c++/SmtpConnectionConfig.hpp +124 -0
- package/nitrogen/generated/shared/c++/SmtpServerInfo.hpp +92 -0
- package/package.json +196 -0
- package/react-native.config.js +27 -0
- package/src/EmailImapSmtp.nitro.ts +333 -0
- package/src/NativeEmailImapSmtp.ts +100 -0
- package/src/index.tsx +166 -0
- package/src/native.ts +305 -0
- package/src/types.ts +328 -0
- package/src/web.ts +196 -0
- package/src/windows.ts +304 -0
- package/windows/EmailImapSmtp.cpp +735 -0
- package/windows/EmailImapSmtp.h +137 -0
- package/windows/EmailImapSmtpModule.cpp +10 -0
- package/windows/EmailImapSmtpModule.h +139 -0
- package/windows/EmailImapSmtpPackage.cpp +15 -0
- package/windows/EmailImapSmtpPackage.h +13 -0
- package/windows/ImapProtocol.cpp +1382 -0
- package/windows/ImapProtocol.h +97 -0
- package/windows/ProtocolDefs.h +300 -0
- package/windows/SmtpProtocol.cpp +334 -0
- package/windows/SmtpProtocol.h +36 -0
- package/windows/TlsSocket.cpp +818 -0
- package/windows/TlsSocket.h +87 -0
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// SendMailResult.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#if __has_include(<NitroModules/JSIConverter.hpp>)
|
|
11
|
+
#include <NitroModules/JSIConverter.hpp>
|
|
12
|
+
#else
|
|
13
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
+
#endif
|
|
15
|
+
#if __has_include(<NitroModules/NitroDefines.hpp>)
|
|
16
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
17
|
+
#else
|
|
18
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
|
+
#endif
|
|
20
|
+
#if __has_include(<NitroModules/JSIHelpers.hpp>)
|
|
21
|
+
#include <NitroModules/JSIHelpers.hpp>
|
|
22
|
+
#else
|
|
23
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
24
|
+
#endif
|
|
25
|
+
#if __has_include(<NitroModules/PropNameIDCache.hpp>)
|
|
26
|
+
#include <NitroModules/PropNameIDCache.hpp>
|
|
27
|
+
#else
|
|
28
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
29
|
+
#endif
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
#include <string>
|
|
34
|
+
#include <optional>
|
|
35
|
+
#include <NitroModules/ArrayBuffer.hpp>
|
|
36
|
+
|
|
37
|
+
namespace margelo::nitro::emailimapsmtp {
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* A struct which can be represented as a JavaScript object (SendMailResult).
|
|
41
|
+
*/
|
|
42
|
+
struct SendMailResult final {
|
|
43
|
+
public:
|
|
44
|
+
bool success SWIFT_PRIVATE;
|
|
45
|
+
std::optional<std::string> messageId SWIFT_PRIVATE;
|
|
46
|
+
std::optional<std::string> date SWIFT_PRIVATE;
|
|
47
|
+
std::optional<double> serverResponseCode SWIFT_PRIVATE;
|
|
48
|
+
std::optional<std::shared_ptr<ArrayBuffer>> rawMimeData SWIFT_PRIVATE;
|
|
49
|
+
std::optional<std::string> queueId SWIFT_PRIVATE;
|
|
50
|
+
std::optional<std::string> error SWIFT_PRIVATE;
|
|
51
|
+
std::optional<bool> retryable SWIFT_PRIVATE;
|
|
52
|
+
|
|
53
|
+
public:
|
|
54
|
+
SendMailResult() = default;
|
|
55
|
+
explicit SendMailResult(bool success, std::optional<std::string> messageId, std::optional<std::string> date, std::optional<double> serverResponseCode, std::optional<std::shared_ptr<ArrayBuffer>> rawMimeData, std::optional<std::string> queueId, std::optional<std::string> error, std::optional<bool> retryable): success(success), messageId(messageId), date(date), serverResponseCode(serverResponseCode), rawMimeData(rawMimeData), queueId(queueId), error(error), retryable(retryable) {}
|
|
56
|
+
|
|
57
|
+
public:
|
|
58
|
+
friend bool operator==(const SendMailResult& lhs, const SendMailResult& rhs) = default;
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
} // namespace margelo::nitro::emailimapsmtp
|
|
62
|
+
|
|
63
|
+
namespace margelo::nitro {
|
|
64
|
+
|
|
65
|
+
// C++ SendMailResult <> JS SendMailResult (object)
|
|
66
|
+
template <>
|
|
67
|
+
struct JSIConverter<margelo::nitro::emailimapsmtp::SendMailResult> final {
|
|
68
|
+
static inline margelo::nitro::emailimapsmtp::SendMailResult fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
69
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
70
|
+
return margelo::nitro::emailimapsmtp::SendMailResult(
|
|
71
|
+
JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "success"))),
|
|
72
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "messageId"))),
|
|
73
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "date"))),
|
|
74
|
+
JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "serverResponseCode"))),
|
|
75
|
+
JSIConverter<std::optional<std::shared_ptr<ArrayBuffer>>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "rawMimeData"))),
|
|
76
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "queueId"))),
|
|
77
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "error"))),
|
|
78
|
+
JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "retryable")))
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::emailimapsmtp::SendMailResult& arg) {
|
|
82
|
+
jsi::Object obj(runtime);
|
|
83
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "success"), JSIConverter<bool>::toJSI(runtime, arg.success));
|
|
84
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "messageId"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.messageId));
|
|
85
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "date"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.date));
|
|
86
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "serverResponseCode"), JSIConverter<std::optional<double>>::toJSI(runtime, arg.serverResponseCode));
|
|
87
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "rawMimeData"), JSIConverter<std::optional<std::shared_ptr<ArrayBuffer>>>::toJSI(runtime, arg.rawMimeData));
|
|
88
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "queueId"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.queueId));
|
|
89
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "error"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.error));
|
|
90
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "retryable"), JSIConverter<std::optional<bool>>::toJSI(runtime, arg.retryable));
|
|
91
|
+
return obj;
|
|
92
|
+
}
|
|
93
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
94
|
+
if (!value.isObject()) {
|
|
95
|
+
return false;
|
|
96
|
+
}
|
|
97
|
+
jsi::Object obj = value.getObject(runtime);
|
|
98
|
+
if (!nitro::isPlainObject(runtime, obj)) {
|
|
99
|
+
return false;
|
|
100
|
+
}
|
|
101
|
+
if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "success")))) return false;
|
|
102
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "messageId")))) return false;
|
|
103
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "date")))) return false;
|
|
104
|
+
if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "serverResponseCode")))) return false;
|
|
105
|
+
if (!JSIConverter<std::optional<std::shared_ptr<ArrayBuffer>>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "rawMimeData")))) return false;
|
|
106
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "queueId")))) return false;
|
|
107
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "error")))) return false;
|
|
108
|
+
if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "retryable")))) return false;
|
|
109
|
+
return true;
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
} // namespace margelo::nitro
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// SmtpAttachment.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#if __has_include(<NitroModules/JSIConverter.hpp>)
|
|
11
|
+
#include <NitroModules/JSIConverter.hpp>
|
|
12
|
+
#else
|
|
13
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
+
#endif
|
|
15
|
+
#if __has_include(<NitroModules/NitroDefines.hpp>)
|
|
16
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
17
|
+
#else
|
|
18
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
|
+
#endif
|
|
20
|
+
#if __has_include(<NitroModules/JSIHelpers.hpp>)
|
|
21
|
+
#include <NitroModules/JSIHelpers.hpp>
|
|
22
|
+
#else
|
|
23
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
24
|
+
#endif
|
|
25
|
+
#if __has_include(<NitroModules/PropNameIDCache.hpp>)
|
|
26
|
+
#include <NitroModules/PropNameIDCache.hpp>
|
|
27
|
+
#else
|
|
28
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
29
|
+
#endif
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
#include <string>
|
|
34
|
+
#include <NitroModules/ArrayBuffer.hpp>
|
|
35
|
+
#include <optional>
|
|
36
|
+
|
|
37
|
+
namespace margelo::nitro::emailimapsmtp {
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* A struct which can be represented as a JavaScript object (SmtpAttachment).
|
|
41
|
+
*/
|
|
42
|
+
struct SmtpAttachment final {
|
|
43
|
+
public:
|
|
44
|
+
std::string filename SWIFT_PRIVATE;
|
|
45
|
+
std::string mimeType SWIFT_PRIVATE;
|
|
46
|
+
std::shared_ptr<ArrayBuffer> data SWIFT_PRIVATE;
|
|
47
|
+
bool inline SWIFT_PRIVATE;
|
|
48
|
+
std::optional<std::string> contentId SWIFT_PRIVATE;
|
|
49
|
+
std::optional<std::string> disposition SWIFT_PRIVATE;
|
|
50
|
+
|
|
51
|
+
public:
|
|
52
|
+
SmtpAttachment() = default;
|
|
53
|
+
explicit SmtpAttachment(std::string filename, std::string mimeType, std::shared_ptr<ArrayBuffer> data, bool inline, std::optional<std::string> contentId, std::optional<std::string> disposition): filename(filename), mimeType(mimeType), data(data), inline(inline), contentId(contentId), disposition(disposition) {}
|
|
54
|
+
|
|
55
|
+
public:
|
|
56
|
+
friend bool operator==(const SmtpAttachment& lhs, const SmtpAttachment& rhs) = default;
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
} // namespace margelo::nitro::emailimapsmtp
|
|
60
|
+
|
|
61
|
+
namespace margelo::nitro {
|
|
62
|
+
|
|
63
|
+
// C++ SmtpAttachment <> JS SmtpAttachment (object)
|
|
64
|
+
template <>
|
|
65
|
+
struct JSIConverter<margelo::nitro::emailimapsmtp::SmtpAttachment> final {
|
|
66
|
+
static inline margelo::nitro::emailimapsmtp::SmtpAttachment fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
67
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
68
|
+
return margelo::nitro::emailimapsmtp::SmtpAttachment(
|
|
69
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "filename"))),
|
|
70
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "mimeType"))),
|
|
71
|
+
JSIConverter<std::shared_ptr<ArrayBuffer>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "data"))),
|
|
72
|
+
JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "inline"))),
|
|
73
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "contentId"))),
|
|
74
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "disposition")))
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::emailimapsmtp::SmtpAttachment& arg) {
|
|
78
|
+
jsi::Object obj(runtime);
|
|
79
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "filename"), JSIConverter<std::string>::toJSI(runtime, arg.filename));
|
|
80
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "mimeType"), JSIConverter<std::string>::toJSI(runtime, arg.mimeType));
|
|
81
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "data"), JSIConverter<std::shared_ptr<ArrayBuffer>>::toJSI(runtime, arg.data));
|
|
82
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "inline"), JSIConverter<bool>::toJSI(runtime, arg.inline));
|
|
83
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "contentId"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.contentId));
|
|
84
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "disposition"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.disposition));
|
|
85
|
+
return obj;
|
|
86
|
+
}
|
|
87
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
88
|
+
if (!value.isObject()) {
|
|
89
|
+
return false;
|
|
90
|
+
}
|
|
91
|
+
jsi::Object obj = value.getObject(runtime);
|
|
92
|
+
if (!nitro::isPlainObject(runtime, obj)) {
|
|
93
|
+
return false;
|
|
94
|
+
}
|
|
95
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "filename")))) return false;
|
|
96
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "mimeType")))) return false;
|
|
97
|
+
if (!JSIConverter<std::shared_ptr<ArrayBuffer>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "data")))) return false;
|
|
98
|
+
if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "inline")))) return false;
|
|
99
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "contentId")))) return false;
|
|
100
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "disposition")))) return false;
|
|
101
|
+
return true;
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
} // namespace margelo::nitro
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// SmtpConnectionConfig.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#if __has_include(<NitroModules/JSIConverter.hpp>)
|
|
11
|
+
#include <NitroModules/JSIConverter.hpp>
|
|
12
|
+
#else
|
|
13
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
+
#endif
|
|
15
|
+
#if __has_include(<NitroModules/NitroDefines.hpp>)
|
|
16
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
17
|
+
#else
|
|
18
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
|
+
#endif
|
|
20
|
+
#if __has_include(<NitroModules/JSIHelpers.hpp>)
|
|
21
|
+
#include <NitroModules/JSIHelpers.hpp>
|
|
22
|
+
#else
|
|
23
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
24
|
+
#endif
|
|
25
|
+
#if __has_include(<NitroModules/PropNameIDCache.hpp>)
|
|
26
|
+
#include <NitroModules/PropNameIDCache.hpp>
|
|
27
|
+
#else
|
|
28
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
29
|
+
#endif
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
#include <string>
|
|
34
|
+
#include <optional>
|
|
35
|
+
|
|
36
|
+
namespace margelo::nitro::emailimapsmtp {
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* A struct which can be represented as a JavaScript object (SmtpConnectionConfig).
|
|
40
|
+
*/
|
|
41
|
+
struct SmtpConnectionConfig final {
|
|
42
|
+
public:
|
|
43
|
+
std::string host SWIFT_PRIVATE;
|
|
44
|
+
double port SWIFT_PRIVATE;
|
|
45
|
+
std::string username SWIFT_PRIVATE;
|
|
46
|
+
std::string password SWIFT_PRIVATE;
|
|
47
|
+
bool tls SWIFT_PRIVATE;
|
|
48
|
+
std::string authType SWIFT_PRIVATE;
|
|
49
|
+
std::optional<std::string> accessToken SWIFT_PRIVATE;
|
|
50
|
+
double timeout SWIFT_PRIVATE;
|
|
51
|
+
bool checkCertificate SWIFT_PRIVATE;
|
|
52
|
+
std::optional<std::string> helloName SWIFT_PRIVATE;
|
|
53
|
+
bool debug SWIFT_PRIVATE;
|
|
54
|
+
|
|
55
|
+
public:
|
|
56
|
+
SmtpConnectionConfig() = default;
|
|
57
|
+
explicit SmtpConnectionConfig(std::string host, double port, std::string username, std::string password, bool tls, std::string authType, std::optional<std::string> accessToken, double timeout, bool checkCertificate, std::optional<std::string> helloName, bool debug): host(host), port(port), username(username), password(password), tls(tls), authType(authType), accessToken(accessToken), timeout(timeout), checkCertificate(checkCertificate), helloName(helloName), debug(debug) {}
|
|
58
|
+
|
|
59
|
+
public:
|
|
60
|
+
friend bool operator==(const SmtpConnectionConfig& lhs, const SmtpConnectionConfig& rhs) = default;
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
} // namespace margelo::nitro::emailimapsmtp
|
|
64
|
+
|
|
65
|
+
namespace margelo::nitro {
|
|
66
|
+
|
|
67
|
+
// C++ SmtpConnectionConfig <> JS SmtpConnectionConfig (object)
|
|
68
|
+
template <>
|
|
69
|
+
struct JSIConverter<margelo::nitro::emailimapsmtp::SmtpConnectionConfig> final {
|
|
70
|
+
static inline margelo::nitro::emailimapsmtp::SmtpConnectionConfig fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
71
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
72
|
+
return margelo::nitro::emailimapsmtp::SmtpConnectionConfig(
|
|
73
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "host"))),
|
|
74
|
+
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "port"))),
|
|
75
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "username"))),
|
|
76
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "password"))),
|
|
77
|
+
JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "tls"))),
|
|
78
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "authType"))),
|
|
79
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "accessToken"))),
|
|
80
|
+
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "timeout"))),
|
|
81
|
+
JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "checkCertificate"))),
|
|
82
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "helloName"))),
|
|
83
|
+
JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "debug")))
|
|
84
|
+
);
|
|
85
|
+
}
|
|
86
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::emailimapsmtp::SmtpConnectionConfig& arg) {
|
|
87
|
+
jsi::Object obj(runtime);
|
|
88
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "host"), JSIConverter<std::string>::toJSI(runtime, arg.host));
|
|
89
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "port"), JSIConverter<double>::toJSI(runtime, arg.port));
|
|
90
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "username"), JSIConverter<std::string>::toJSI(runtime, arg.username));
|
|
91
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "password"), JSIConverter<std::string>::toJSI(runtime, arg.password));
|
|
92
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "tls"), JSIConverter<bool>::toJSI(runtime, arg.tls));
|
|
93
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "authType"), JSIConverter<std::string>::toJSI(runtime, arg.authType));
|
|
94
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "accessToken"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.accessToken));
|
|
95
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "timeout"), JSIConverter<double>::toJSI(runtime, arg.timeout));
|
|
96
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "checkCertificate"), JSIConverter<bool>::toJSI(runtime, arg.checkCertificate));
|
|
97
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "helloName"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.helloName));
|
|
98
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "debug"), JSIConverter<bool>::toJSI(runtime, arg.debug));
|
|
99
|
+
return obj;
|
|
100
|
+
}
|
|
101
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
102
|
+
if (!value.isObject()) {
|
|
103
|
+
return false;
|
|
104
|
+
}
|
|
105
|
+
jsi::Object obj = value.getObject(runtime);
|
|
106
|
+
if (!nitro::isPlainObject(runtime, obj)) {
|
|
107
|
+
return false;
|
|
108
|
+
}
|
|
109
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "host")))) return false;
|
|
110
|
+
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "port")))) return false;
|
|
111
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "username")))) return false;
|
|
112
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "password")))) return false;
|
|
113
|
+
if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "tls")))) return false;
|
|
114
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "authType")))) return false;
|
|
115
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "accessToken")))) return false;
|
|
116
|
+
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "timeout")))) return false;
|
|
117
|
+
if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "checkCertificate")))) return false;
|
|
118
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "helloName")))) return false;
|
|
119
|
+
if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "debug")))) return false;
|
|
120
|
+
return true;
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
} // namespace margelo::nitro
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// SmtpServerInfo.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#if __has_include(<NitroModules/JSIConverter.hpp>)
|
|
11
|
+
#include <NitroModules/JSIConverter.hpp>
|
|
12
|
+
#else
|
|
13
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
+
#endif
|
|
15
|
+
#if __has_include(<NitroModules/NitroDefines.hpp>)
|
|
16
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
17
|
+
#else
|
|
18
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
|
+
#endif
|
|
20
|
+
#if __has_include(<NitroModules/JSIHelpers.hpp>)
|
|
21
|
+
#include <NitroModules/JSIHelpers.hpp>
|
|
22
|
+
#else
|
|
23
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
24
|
+
#endif
|
|
25
|
+
#if __has_include(<NitroModules/PropNameIDCache.hpp>)
|
|
26
|
+
#include <NitroModules/PropNameIDCache.hpp>
|
|
27
|
+
#else
|
|
28
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
29
|
+
#endif
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
#include <string>
|
|
34
|
+
#include <vector>
|
|
35
|
+
|
|
36
|
+
namespace margelo::nitro::emailimapsmtp {
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* A struct which can be represented as a JavaScript object (SmtpServerInfo).
|
|
40
|
+
*/
|
|
41
|
+
struct SmtpServerInfo final {
|
|
42
|
+
public:
|
|
43
|
+
std::string serverName SWIFT_PRIVATE;
|
|
44
|
+
std::vector<std::string> capabilities SWIFT_PRIVATE;
|
|
45
|
+
std::vector<std::string> supportedAuthMethods SWIFT_PRIVATE;
|
|
46
|
+
|
|
47
|
+
public:
|
|
48
|
+
SmtpServerInfo() = default;
|
|
49
|
+
explicit SmtpServerInfo(std::string serverName, std::vector<std::string> capabilities, std::vector<std::string> supportedAuthMethods): serverName(serverName), capabilities(capabilities), supportedAuthMethods(supportedAuthMethods) {}
|
|
50
|
+
|
|
51
|
+
public:
|
|
52
|
+
friend bool operator==(const SmtpServerInfo& lhs, const SmtpServerInfo& rhs) = default;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
} // namespace margelo::nitro::emailimapsmtp
|
|
56
|
+
|
|
57
|
+
namespace margelo::nitro {
|
|
58
|
+
|
|
59
|
+
// C++ SmtpServerInfo <> JS SmtpServerInfo (object)
|
|
60
|
+
template <>
|
|
61
|
+
struct JSIConverter<margelo::nitro::emailimapsmtp::SmtpServerInfo> final {
|
|
62
|
+
static inline margelo::nitro::emailimapsmtp::SmtpServerInfo fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
63
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
64
|
+
return margelo::nitro::emailimapsmtp::SmtpServerInfo(
|
|
65
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "serverName"))),
|
|
66
|
+
JSIConverter<std::vector<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "capabilities"))),
|
|
67
|
+
JSIConverter<std::vector<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "supportedAuthMethods")))
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::emailimapsmtp::SmtpServerInfo& arg) {
|
|
71
|
+
jsi::Object obj(runtime);
|
|
72
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "serverName"), JSIConverter<std::string>::toJSI(runtime, arg.serverName));
|
|
73
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "capabilities"), JSIConverter<std::vector<std::string>>::toJSI(runtime, arg.capabilities));
|
|
74
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "supportedAuthMethods"), JSIConverter<std::vector<std::string>>::toJSI(runtime, arg.supportedAuthMethods));
|
|
75
|
+
return obj;
|
|
76
|
+
}
|
|
77
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
78
|
+
if (!value.isObject()) {
|
|
79
|
+
return false;
|
|
80
|
+
}
|
|
81
|
+
jsi::Object obj = value.getObject(runtime);
|
|
82
|
+
if (!nitro::isPlainObject(runtime, obj)) {
|
|
83
|
+
return false;
|
|
84
|
+
}
|
|
85
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "serverName")))) return false;
|
|
86
|
+
if (!JSIConverter<std::vector<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "capabilities")))) return false;
|
|
87
|
+
if (!JSIConverter<std::vector<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "supportedAuthMethods")))) return false;
|
|
88
|
+
return true;
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
} // namespace margelo::nitro
|
package/package.json
ADDED
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "react-native-email-imap-smtp",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "The best of imap and smtp client of react native",
|
|
5
|
+
"main": "./lib/module/index.js",
|
|
6
|
+
"types": "./lib/typescript/src/index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"react-native-email-imap-smtp-source": "./src/index.tsx",
|
|
10
|
+
"types": "./lib/typescript/src/index.d.ts",
|
|
11
|
+
"default": "./lib/module/index.js"
|
|
12
|
+
},
|
|
13
|
+
"./package.json": "./package.json"
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"src",
|
|
17
|
+
"lib",
|
|
18
|
+
"android",
|
|
19
|
+
"ios",
|
|
20
|
+
"windows",
|
|
21
|
+
"cpp",
|
|
22
|
+
"nitrogen",
|
|
23
|
+
"nitro.json",
|
|
24
|
+
"*.podspec",
|
|
25
|
+
"react-native.config.js",
|
|
26
|
+
"!ios/build",
|
|
27
|
+
"!android/build",
|
|
28
|
+
"!android/gradle",
|
|
29
|
+
"!android/gradlew",
|
|
30
|
+
"!android/gradlew.bat",
|
|
31
|
+
"!android/local.properties",
|
|
32
|
+
"!**/__tests__",
|
|
33
|
+
"!**/__fixtures__",
|
|
34
|
+
"!**/__mocks__",
|
|
35
|
+
"!**/.*",
|
|
36
|
+
"!windows-standalone-test"
|
|
37
|
+
],
|
|
38
|
+
"scripts": {
|
|
39
|
+
"example": "yarn workspace react-native-email-imap-smtp-example",
|
|
40
|
+
"clean": "del-cli android/build example/android/build example/android/app/build example/ios/build lib windows-standalone-test/build",
|
|
41
|
+
"prepare": "bob build",
|
|
42
|
+
"nitrogen": "nitrogen",
|
|
43
|
+
"build:windows": "cd windows-standalone-test && cmake -B build && cmake --build build --config Debug",
|
|
44
|
+
"build:windows:release": "cd windows-standalone-test && cmake -B build && cmake --build build --config Release",
|
|
45
|
+
"test:windows": "cd windows-standalone-test && cmake -B build && cmake --build build --config Debug && .\\build\\Debug\\EmailTest.exe",
|
|
46
|
+
"typecheck": "tsc",
|
|
47
|
+
"lint": "eslint \"**/*.{js,ts,tsx}\"",
|
|
48
|
+
"fix": "eslint --fix \"**/*.{js,ts,tsx}\"",
|
|
49
|
+
"test": "jest",
|
|
50
|
+
"release": "release-it --only-version",
|
|
51
|
+
"web": "vite",
|
|
52
|
+
"build:web": "vite build",
|
|
53
|
+
"mumu": "node scripts/start-mumu.js",
|
|
54
|
+
"mumu:1": "node scripts/start-mumu.js --instance 1",
|
|
55
|
+
"mumu:no-start": "node scripts/start-mumu.js --no-start"
|
|
56
|
+
},
|
|
57
|
+
"keywords": [
|
|
58
|
+
"react-native",
|
|
59
|
+
"ios",
|
|
60
|
+
"android"
|
|
61
|
+
],
|
|
62
|
+
"repository": {
|
|
63
|
+
"type": "git",
|
|
64
|
+
"url": "git+https://gitee.com/dongfangshuo001/react-native-email-imap-smtp.git"
|
|
65
|
+
},
|
|
66
|
+
"author": "东方朔 <dengyangyong999@163.com> (https://gitee.com/dongfangshuo001)",
|
|
67
|
+
"license": "MIT",
|
|
68
|
+
"bugs": {
|
|
69
|
+
"url": "https://gitee.com/dongfangshuo001/react-native-email-imap-smtp.git/issues"
|
|
70
|
+
},
|
|
71
|
+
"homepage": "https://gitee.com/dongfangshuo001/react-native-email-imap-smtp.git#readme",
|
|
72
|
+
"publishConfig": {
|
|
73
|
+
"registry": "https://registry.npmjs.org/"
|
|
74
|
+
},
|
|
75
|
+
"devDependencies": {
|
|
76
|
+
"@commitlint/config-conventional": "^21.0.2",
|
|
77
|
+
"@eslint/compat": "^2.1.0",
|
|
78
|
+
"@eslint/eslintrc": "^3.3.5",
|
|
79
|
+
"@eslint/js": "^10.0.1",
|
|
80
|
+
"@jest/globals": "^29.7.0",
|
|
81
|
+
"@react-native/babel-preset": "0.85.0",
|
|
82
|
+
"@react-native/eslint-config": "0.85.0",
|
|
83
|
+
"@react-native/jest-preset": "0.85.0",
|
|
84
|
+
"@release-it/conventional-changelog": "^11.0.1",
|
|
85
|
+
"@types/react": "^19.2.0",
|
|
86
|
+
"commitlint": "^21.0.2",
|
|
87
|
+
"del-cli": "^7.0.0",
|
|
88
|
+
"eslint": "^9.39.4",
|
|
89
|
+
"eslint-config-prettier": "^10.1.8",
|
|
90
|
+
"eslint-plugin-ft-flow": "^3.0.11",
|
|
91
|
+
"eslint-plugin-prettier": "^5.5.6",
|
|
92
|
+
"jest": "^29.7.0",
|
|
93
|
+
"lefthook": "^2.1.9",
|
|
94
|
+
"nitrogen": "^0.36.1",
|
|
95
|
+
"prettier": "^3.8.3",
|
|
96
|
+
"react": "19.2.3",
|
|
97
|
+
"react-native": "0.85.0",
|
|
98
|
+
"react-native-builder-bob": "^0.43.0",
|
|
99
|
+
"react-native-nitro-modules": "^0.36.1",
|
|
100
|
+
"react-native-web": "~0.21.2",
|
|
101
|
+
"release-it": "^20.2.0",
|
|
102
|
+
"turbo": "^2.9.16",
|
|
103
|
+
"typescript": "^6.0.3"
|
|
104
|
+
},
|
|
105
|
+
"peerDependencies": {
|
|
106
|
+
"react": "*",
|
|
107
|
+
"react-native": "*",
|
|
108
|
+
"react-native-nitro-modules": "^0.36.1"
|
|
109
|
+
},
|
|
110
|
+
"workspaces": [
|
|
111
|
+
"example"
|
|
112
|
+
],
|
|
113
|
+
"packageManager": "yarn@4.11.0",
|
|
114
|
+
"react-native-builder-bob": {
|
|
115
|
+
"source": "src",
|
|
116
|
+
"output": "lib",
|
|
117
|
+
"targets": [
|
|
118
|
+
[
|
|
119
|
+
"custom",
|
|
120
|
+
{
|
|
121
|
+
"script": "nitrogen",
|
|
122
|
+
"clean": "nitrogen/"
|
|
123
|
+
}
|
|
124
|
+
],
|
|
125
|
+
[
|
|
126
|
+
"module",
|
|
127
|
+
{
|
|
128
|
+
"esm": true
|
|
129
|
+
}
|
|
130
|
+
],
|
|
131
|
+
[
|
|
132
|
+
"typescript",
|
|
133
|
+
{
|
|
134
|
+
"project": "tsconfig.build.json"
|
|
135
|
+
}
|
|
136
|
+
]
|
|
137
|
+
]
|
|
138
|
+
},
|
|
139
|
+
"prettier": {
|
|
140
|
+
"quoteProps": "consistent",
|
|
141
|
+
"singleQuote": true,
|
|
142
|
+
"tabWidth": 2,
|
|
143
|
+
"trailingComma": "es5",
|
|
144
|
+
"useTabs": false
|
|
145
|
+
},
|
|
146
|
+
"jest": {
|
|
147
|
+
"preset": "@react-native/jest-preset",
|
|
148
|
+
"testEnvironmentOptions": {
|
|
149
|
+
"customExportConditions": [
|
|
150
|
+
"require",
|
|
151
|
+
"react-native",
|
|
152
|
+
"<%- project.sourceCondition -%>"
|
|
153
|
+
]
|
|
154
|
+
},
|
|
155
|
+
"modulePathIgnorePatterns": [
|
|
156
|
+
"<rootDir>/example/node_modules",
|
|
157
|
+
"<rootDir>/lib/"
|
|
158
|
+
]
|
|
159
|
+
},
|
|
160
|
+
"commitlint": {
|
|
161
|
+
"extends": [
|
|
162
|
+
"@commitlint/config-conventional"
|
|
163
|
+
]
|
|
164
|
+
},
|
|
165
|
+
"release-it": {
|
|
166
|
+
"git": {
|
|
167
|
+
"commitMessage": "chore: release ${version}",
|
|
168
|
+
"tagName": "v${version}"
|
|
169
|
+
},
|
|
170
|
+
"npm": {
|
|
171
|
+
"publish": true
|
|
172
|
+
},
|
|
173
|
+
"github": {
|
|
174
|
+
"release": true
|
|
175
|
+
},
|
|
176
|
+
"plugins": {
|
|
177
|
+
"@release-it/conventional-changelog": {
|
|
178
|
+
"preset": {
|
|
179
|
+
"name": "angular"
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
},
|
|
184
|
+
"create-react-native-library": {
|
|
185
|
+
"type": "nitro-module",
|
|
186
|
+
"languages": "kotlin-swift",
|
|
187
|
+
"tools": [
|
|
188
|
+
"eslint",
|
|
189
|
+
"jest",
|
|
190
|
+
"lefthook",
|
|
191
|
+
"release-it",
|
|
192
|
+
"vite"
|
|
193
|
+
],
|
|
194
|
+
"version": "0.63.0"
|
|
195
|
+
}
|
|
196
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// ============================================================
|
|
2
|
+
// react-native.config.js — React Native 自动链接配置
|
|
3
|
+
// Windows: TurboModule 降级方案
|
|
4
|
+
// Android: 继续通过 NitroModules 链接
|
|
5
|
+
// ============================================================
|
|
6
|
+
|
|
7
|
+
module.exports = {
|
|
8
|
+
dependency: {
|
|
9
|
+
platforms: {
|
|
10
|
+
android: {
|
|
11
|
+
// Android 使用 NitroModules 自动链接
|
|
12
|
+
cmakeListsPath: 'android/build.gradle',
|
|
13
|
+
},
|
|
14
|
+
windows: {
|
|
15
|
+
sourceDir: './windows',
|
|
16
|
+
// VS 解决方案文件(需要手动创建)
|
|
17
|
+
solutionFile: 'EmailImapSmtp.sln',
|
|
18
|
+
projects: [
|
|
19
|
+
{
|
|
20
|
+
projectFile: 'EmailImapSmtp/EmailImapSmtp.vcxproj',
|
|
21
|
+
directDependency: true,
|
|
22
|
+
},
|
|
23
|
+
],
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
};
|