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,104 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// QuotaInfo.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 (QuotaInfo).
|
|
40
|
+
*/
|
|
41
|
+
struct QuotaInfo final {
|
|
42
|
+
public:
|
|
43
|
+
double storageUsed SWIFT_PRIVATE;
|
|
44
|
+
double storageLimit SWIFT_PRIVATE;
|
|
45
|
+
std::string storageUnit SWIFT_PRIVATE;
|
|
46
|
+
std::optional<double> messagesUsed SWIFT_PRIVATE;
|
|
47
|
+
std::optional<double> messagesLimit SWIFT_PRIVATE;
|
|
48
|
+
std::string root SWIFT_PRIVATE;
|
|
49
|
+
|
|
50
|
+
public:
|
|
51
|
+
QuotaInfo() = default;
|
|
52
|
+
explicit QuotaInfo(double storageUsed, double storageLimit, std::string storageUnit, std::optional<double> messagesUsed, std::optional<double> messagesLimit, std::string root): storageUsed(storageUsed), storageLimit(storageLimit), storageUnit(storageUnit), messagesUsed(messagesUsed), messagesLimit(messagesLimit), root(root) {}
|
|
53
|
+
|
|
54
|
+
public:
|
|
55
|
+
friend bool operator==(const QuotaInfo& lhs, const QuotaInfo& rhs) = default;
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
} // namespace margelo::nitro::emailimapsmtp
|
|
59
|
+
|
|
60
|
+
namespace margelo::nitro {
|
|
61
|
+
|
|
62
|
+
// C++ QuotaInfo <> JS QuotaInfo (object)
|
|
63
|
+
template <>
|
|
64
|
+
struct JSIConverter<margelo::nitro::emailimapsmtp::QuotaInfo> final {
|
|
65
|
+
static inline margelo::nitro::emailimapsmtp::QuotaInfo fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
66
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
67
|
+
return margelo::nitro::emailimapsmtp::QuotaInfo(
|
|
68
|
+
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "storageUsed"))),
|
|
69
|
+
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "storageLimit"))),
|
|
70
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "storageUnit"))),
|
|
71
|
+
JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "messagesUsed"))),
|
|
72
|
+
JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "messagesLimit"))),
|
|
73
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "root")))
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::emailimapsmtp::QuotaInfo& arg) {
|
|
77
|
+
jsi::Object obj(runtime);
|
|
78
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "storageUsed"), JSIConverter<double>::toJSI(runtime, arg.storageUsed));
|
|
79
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "storageLimit"), JSIConverter<double>::toJSI(runtime, arg.storageLimit));
|
|
80
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "storageUnit"), JSIConverter<std::string>::toJSI(runtime, arg.storageUnit));
|
|
81
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "messagesUsed"), JSIConverter<std::optional<double>>::toJSI(runtime, arg.messagesUsed));
|
|
82
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "messagesLimit"), JSIConverter<std::optional<double>>::toJSI(runtime, arg.messagesLimit));
|
|
83
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "root"), JSIConverter<std::string>::toJSI(runtime, arg.root));
|
|
84
|
+
return obj;
|
|
85
|
+
}
|
|
86
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
87
|
+
if (!value.isObject()) {
|
|
88
|
+
return false;
|
|
89
|
+
}
|
|
90
|
+
jsi::Object obj = value.getObject(runtime);
|
|
91
|
+
if (!nitro::isPlainObject(runtime, obj)) {
|
|
92
|
+
return false;
|
|
93
|
+
}
|
|
94
|
+
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "storageUsed")))) return false;
|
|
95
|
+
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "storageLimit")))) return false;
|
|
96
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "storageUnit")))) return false;
|
|
97
|
+
if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "messagesUsed")))) return false;
|
|
98
|
+
if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "messagesLimit")))) return false;
|
|
99
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "root")))) return false;
|
|
100
|
+
return true;
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
} // namespace margelo::nitro
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// SearchCriteria.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
|
+
// Forward declaration of `SearchHeader` to properly resolve imports.
|
|
32
|
+
namespace margelo::nitro::emailimapsmtp { struct SearchHeader; }
|
|
33
|
+
|
|
34
|
+
#include <string>
|
|
35
|
+
#include <optional>
|
|
36
|
+
#include <vector>
|
|
37
|
+
#include "SearchHeader.hpp"
|
|
38
|
+
|
|
39
|
+
namespace margelo::nitro::emailimapsmtp {
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* A struct which can be represented as a JavaScript object (SearchCriteria).
|
|
43
|
+
*/
|
|
44
|
+
struct SearchCriteria final {
|
|
45
|
+
public:
|
|
46
|
+
std::optional<std::string> text SWIFT_PRIVATE;
|
|
47
|
+
std::optional<std::string> subject SWIFT_PRIVATE;
|
|
48
|
+
std::optional<std::string> from SWIFT_PRIVATE;
|
|
49
|
+
std::optional<std::string> to SWIFT_PRIVATE;
|
|
50
|
+
std::optional<std::string> body SWIFT_PRIVATE;
|
|
51
|
+
std::optional<std::string> since SWIFT_PRIVATE;
|
|
52
|
+
std::optional<std::string> before SWIFT_PRIVATE;
|
|
53
|
+
std::optional<std::string> on SWIFT_PRIVATE;
|
|
54
|
+
std::optional<std::string> sentSince SWIFT_PRIVATE;
|
|
55
|
+
std::optional<std::string> sentBefore SWIFT_PRIVATE;
|
|
56
|
+
std::optional<bool> flagged SWIFT_PRIVATE;
|
|
57
|
+
std::optional<bool> seen SWIFT_PRIVATE;
|
|
58
|
+
std::optional<bool> answered SWIFT_PRIVATE;
|
|
59
|
+
std::optional<bool> draft SWIFT_PRIVATE;
|
|
60
|
+
std::optional<bool> deleted SWIFT_PRIVATE;
|
|
61
|
+
std::optional<bool> junk SWIFT_PRIVATE;
|
|
62
|
+
std::optional<bool> hasAttachment SWIFT_PRIVATE;
|
|
63
|
+
std::optional<std::vector<double>> uids SWIFT_PRIVATE;
|
|
64
|
+
std::optional<SearchHeader> header SWIFT_PRIVATE;
|
|
65
|
+
std::optional<double> larger SWIFT_PRIVATE;
|
|
66
|
+
std::optional<double> smaller SWIFT_PRIVATE;
|
|
67
|
+
std::optional<std::string> mailbox SWIFT_PRIVATE;
|
|
68
|
+
std::optional<std::string> sortOrder SWIFT_PRIVATE;
|
|
69
|
+
std::optional<double> limit SWIFT_PRIVATE;
|
|
70
|
+
bool fetchBody SWIFT_PRIVATE;
|
|
71
|
+
bool fetchAttachments SWIFT_PRIVATE;
|
|
72
|
+
bool fetchFlags SWIFT_PRIVATE;
|
|
73
|
+
bool fetchHeaders SWIFT_PRIVATE;
|
|
74
|
+
bool fetchFullContent SWIFT_PRIVATE;
|
|
75
|
+
double maxBodySize SWIFT_PRIVATE;
|
|
76
|
+
|
|
77
|
+
public:
|
|
78
|
+
SearchCriteria() = default;
|
|
79
|
+
explicit SearchCriteria(std::optional<std::string> text, std::optional<std::string> subject, std::optional<std::string> from, std::optional<std::string> to, std::optional<std::string> body, std::optional<std::string> since, std::optional<std::string> before, std::optional<std::string> on, std::optional<std::string> sentSince, std::optional<std::string> sentBefore, std::optional<bool> flagged, std::optional<bool> seen, std::optional<bool> answered, std::optional<bool> draft, std::optional<bool> deleted, std::optional<bool> junk, std::optional<bool> hasAttachment, std::optional<std::vector<double>> uids, std::optional<SearchHeader> header, std::optional<double> larger, std::optional<double> smaller, std::optional<std::string> mailbox, std::optional<std::string> sortOrder, std::optional<double> limit, bool fetchBody, bool fetchAttachments, bool fetchFlags, bool fetchHeaders, bool fetchFullContent, double maxBodySize): text(text), subject(subject), from(from), to(to), body(body), since(since), before(before), on(on), sentSince(sentSince), sentBefore(sentBefore), flagged(flagged), seen(seen), answered(answered), draft(draft), deleted(deleted), junk(junk), hasAttachment(hasAttachment), uids(uids), header(header), larger(larger), smaller(smaller), mailbox(mailbox), sortOrder(sortOrder), limit(limit), fetchBody(fetchBody), fetchAttachments(fetchAttachments), fetchFlags(fetchFlags), fetchHeaders(fetchHeaders), fetchFullContent(fetchFullContent), maxBodySize(maxBodySize) {}
|
|
80
|
+
|
|
81
|
+
public:
|
|
82
|
+
friend bool operator==(const SearchCriteria& lhs, const SearchCriteria& rhs) = default;
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
} // namespace margelo::nitro::emailimapsmtp
|
|
86
|
+
|
|
87
|
+
namespace margelo::nitro {
|
|
88
|
+
|
|
89
|
+
// C++ SearchCriteria <> JS SearchCriteria (object)
|
|
90
|
+
template <>
|
|
91
|
+
struct JSIConverter<margelo::nitro::emailimapsmtp::SearchCriteria> final {
|
|
92
|
+
static inline margelo::nitro::emailimapsmtp::SearchCriteria fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
93
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
94
|
+
return margelo::nitro::emailimapsmtp::SearchCriteria(
|
|
95
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "text"))),
|
|
96
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "subject"))),
|
|
97
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "from"))),
|
|
98
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "to"))),
|
|
99
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "body"))),
|
|
100
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "since"))),
|
|
101
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "before"))),
|
|
102
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "on"))),
|
|
103
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "sentSince"))),
|
|
104
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "sentBefore"))),
|
|
105
|
+
JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "flagged"))),
|
|
106
|
+
JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "seen"))),
|
|
107
|
+
JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "answered"))),
|
|
108
|
+
JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "draft"))),
|
|
109
|
+
JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "deleted"))),
|
|
110
|
+
JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "junk"))),
|
|
111
|
+
JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "hasAttachment"))),
|
|
112
|
+
JSIConverter<std::optional<std::vector<double>>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "uids"))),
|
|
113
|
+
JSIConverter<std::optional<margelo::nitro::emailimapsmtp::SearchHeader>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "header"))),
|
|
114
|
+
JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "larger"))),
|
|
115
|
+
JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "smaller"))),
|
|
116
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "mailbox"))),
|
|
117
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "sortOrder"))),
|
|
118
|
+
JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "limit"))),
|
|
119
|
+
JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "fetchBody"))),
|
|
120
|
+
JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "fetchAttachments"))),
|
|
121
|
+
JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "fetchFlags"))),
|
|
122
|
+
JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "fetchHeaders"))),
|
|
123
|
+
JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "fetchFullContent"))),
|
|
124
|
+
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "maxBodySize")))
|
|
125
|
+
);
|
|
126
|
+
}
|
|
127
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::emailimapsmtp::SearchCriteria& arg) {
|
|
128
|
+
jsi::Object obj(runtime);
|
|
129
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "text"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.text));
|
|
130
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "subject"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.subject));
|
|
131
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "from"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.from));
|
|
132
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "to"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.to));
|
|
133
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "body"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.body));
|
|
134
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "since"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.since));
|
|
135
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "before"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.before));
|
|
136
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "on"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.on));
|
|
137
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "sentSince"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.sentSince));
|
|
138
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "sentBefore"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.sentBefore));
|
|
139
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "flagged"), JSIConverter<std::optional<bool>>::toJSI(runtime, arg.flagged));
|
|
140
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "seen"), JSIConverter<std::optional<bool>>::toJSI(runtime, arg.seen));
|
|
141
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "answered"), JSIConverter<std::optional<bool>>::toJSI(runtime, arg.answered));
|
|
142
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "draft"), JSIConverter<std::optional<bool>>::toJSI(runtime, arg.draft));
|
|
143
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "deleted"), JSIConverter<std::optional<bool>>::toJSI(runtime, arg.deleted));
|
|
144
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "junk"), JSIConverter<std::optional<bool>>::toJSI(runtime, arg.junk));
|
|
145
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "hasAttachment"), JSIConverter<std::optional<bool>>::toJSI(runtime, arg.hasAttachment));
|
|
146
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "uids"), JSIConverter<std::optional<std::vector<double>>>::toJSI(runtime, arg.uids));
|
|
147
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "header"), JSIConverter<std::optional<margelo::nitro::emailimapsmtp::SearchHeader>>::toJSI(runtime, arg.header));
|
|
148
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "larger"), JSIConverter<std::optional<double>>::toJSI(runtime, arg.larger));
|
|
149
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "smaller"), JSIConverter<std::optional<double>>::toJSI(runtime, arg.smaller));
|
|
150
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "mailbox"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.mailbox));
|
|
151
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "sortOrder"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.sortOrder));
|
|
152
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "limit"), JSIConverter<std::optional<double>>::toJSI(runtime, arg.limit));
|
|
153
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "fetchBody"), JSIConverter<bool>::toJSI(runtime, arg.fetchBody));
|
|
154
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "fetchAttachments"), JSIConverter<bool>::toJSI(runtime, arg.fetchAttachments));
|
|
155
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "fetchFlags"), JSIConverter<bool>::toJSI(runtime, arg.fetchFlags));
|
|
156
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "fetchHeaders"), JSIConverter<bool>::toJSI(runtime, arg.fetchHeaders));
|
|
157
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "fetchFullContent"), JSIConverter<bool>::toJSI(runtime, arg.fetchFullContent));
|
|
158
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "maxBodySize"), JSIConverter<double>::toJSI(runtime, arg.maxBodySize));
|
|
159
|
+
return obj;
|
|
160
|
+
}
|
|
161
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
162
|
+
if (!value.isObject()) {
|
|
163
|
+
return false;
|
|
164
|
+
}
|
|
165
|
+
jsi::Object obj = value.getObject(runtime);
|
|
166
|
+
if (!nitro::isPlainObject(runtime, obj)) {
|
|
167
|
+
return false;
|
|
168
|
+
}
|
|
169
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "text")))) return false;
|
|
170
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "subject")))) return false;
|
|
171
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "from")))) return false;
|
|
172
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "to")))) return false;
|
|
173
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "body")))) return false;
|
|
174
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "since")))) return false;
|
|
175
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "before")))) return false;
|
|
176
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "on")))) return false;
|
|
177
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "sentSince")))) return false;
|
|
178
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "sentBefore")))) return false;
|
|
179
|
+
if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "flagged")))) return false;
|
|
180
|
+
if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "seen")))) return false;
|
|
181
|
+
if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "answered")))) return false;
|
|
182
|
+
if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "draft")))) return false;
|
|
183
|
+
if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "deleted")))) return false;
|
|
184
|
+
if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "junk")))) return false;
|
|
185
|
+
if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "hasAttachment")))) return false;
|
|
186
|
+
if (!JSIConverter<std::optional<std::vector<double>>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "uids")))) return false;
|
|
187
|
+
if (!JSIConverter<std::optional<margelo::nitro::emailimapsmtp::SearchHeader>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "header")))) return false;
|
|
188
|
+
if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "larger")))) return false;
|
|
189
|
+
if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "smaller")))) return false;
|
|
190
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "mailbox")))) return false;
|
|
191
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "sortOrder")))) return false;
|
|
192
|
+
if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "limit")))) return false;
|
|
193
|
+
if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "fetchBody")))) return false;
|
|
194
|
+
if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "fetchAttachments")))) return false;
|
|
195
|
+
if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "fetchFlags")))) return false;
|
|
196
|
+
if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "fetchHeaders")))) return false;
|
|
197
|
+
if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "fetchFullContent")))) return false;
|
|
198
|
+
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "maxBodySize")))) return false;
|
|
199
|
+
return true;
|
|
200
|
+
}
|
|
201
|
+
};
|
|
202
|
+
|
|
203
|
+
} // namespace margelo::nitro
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// SearchHeader.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
|
+
|
|
35
|
+
namespace margelo::nitro::emailimapsmtp {
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* A struct which can be represented as a JavaScript object (SearchHeader).
|
|
39
|
+
*/
|
|
40
|
+
struct SearchHeader final {
|
|
41
|
+
public:
|
|
42
|
+
std::string key SWIFT_PRIVATE;
|
|
43
|
+
std::string value SWIFT_PRIVATE;
|
|
44
|
+
|
|
45
|
+
public:
|
|
46
|
+
SearchHeader() = default;
|
|
47
|
+
explicit SearchHeader(std::string key, std::string value): key(key), value(value) {}
|
|
48
|
+
|
|
49
|
+
public:
|
|
50
|
+
friend bool operator==(const SearchHeader& lhs, const SearchHeader& rhs) = default;
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
} // namespace margelo::nitro::emailimapsmtp
|
|
54
|
+
|
|
55
|
+
namespace margelo::nitro {
|
|
56
|
+
|
|
57
|
+
// C++ SearchHeader <> JS SearchHeader (object)
|
|
58
|
+
template <>
|
|
59
|
+
struct JSIConverter<margelo::nitro::emailimapsmtp::SearchHeader> final {
|
|
60
|
+
static inline margelo::nitro::emailimapsmtp::SearchHeader fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
61
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
62
|
+
return margelo::nitro::emailimapsmtp::SearchHeader(
|
|
63
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "key"))),
|
|
64
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "value")))
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::emailimapsmtp::SearchHeader& arg) {
|
|
68
|
+
jsi::Object obj(runtime);
|
|
69
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "key"), JSIConverter<std::string>::toJSI(runtime, arg.key));
|
|
70
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "value"), JSIConverter<std::string>::toJSI(runtime, arg.value));
|
|
71
|
+
return obj;
|
|
72
|
+
}
|
|
73
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
74
|
+
if (!value.isObject()) {
|
|
75
|
+
return false;
|
|
76
|
+
}
|
|
77
|
+
jsi::Object obj = value.getObject(runtime);
|
|
78
|
+
if (!nitro::isPlainObject(runtime, obj)) {
|
|
79
|
+
return false;
|
|
80
|
+
}
|
|
81
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "key")))) return false;
|
|
82
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "value")))) return false;
|
|
83
|
+
return true;
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
} // namespace margelo::nitro
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// SendMailOptions.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
|
+
// Forward declaration of `EmailAddress` to properly resolve imports.
|
|
32
|
+
namespace margelo::nitro::emailimapsmtp { struct EmailAddress; }
|
|
33
|
+
// Forward declaration of `SmtpAttachment` to properly resolve imports.
|
|
34
|
+
namespace margelo::nitro::emailimapsmtp { struct SmtpAttachment; }
|
|
35
|
+
|
|
36
|
+
#include "EmailAddress.hpp"
|
|
37
|
+
#include <vector>
|
|
38
|
+
#include <optional>
|
|
39
|
+
#include <string>
|
|
40
|
+
#include "SmtpAttachment.hpp"
|
|
41
|
+
#include <unordered_map>
|
|
42
|
+
|
|
43
|
+
namespace margelo::nitro::emailimapsmtp {
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* A struct which can be represented as a JavaScript object (SendMailOptions).
|
|
47
|
+
*/
|
|
48
|
+
struct SendMailOptions final {
|
|
49
|
+
public:
|
|
50
|
+
EmailAddress from SWIFT_PRIVATE;
|
|
51
|
+
std::vector<EmailAddress> to SWIFT_PRIVATE;
|
|
52
|
+
std::optional<std::vector<EmailAddress>> cc SWIFT_PRIVATE;
|
|
53
|
+
std::optional<std::vector<EmailAddress>> bcc SWIFT_PRIVATE;
|
|
54
|
+
std::optional<std::vector<EmailAddress>> replyTo SWIFT_PRIVATE;
|
|
55
|
+
std::string subject SWIFT_PRIVATE;
|
|
56
|
+
std::optional<std::string> textBody SWIFT_PRIVATE;
|
|
57
|
+
std::optional<std::string> htmlBody SWIFT_PRIVATE;
|
|
58
|
+
std::optional<std::vector<SmtpAttachment>> attachments SWIFT_PRIVATE;
|
|
59
|
+
std::optional<std::string> priority SWIFT_PRIVATE;
|
|
60
|
+
std::optional<std::unordered_map<std::string, std::string>> headers SWIFT_PRIVATE;
|
|
61
|
+
std::optional<std::string> inReplyTo SWIFT_PRIVATE;
|
|
62
|
+
std::optional<std::string> references SWIFT_PRIVATE;
|
|
63
|
+
std::optional<EmailAddress> readReceiptTo SWIFT_PRIVATE;
|
|
64
|
+
std::optional<std::string> charset SWIFT_PRIVATE;
|
|
65
|
+
std::optional<std::string> encoding SWIFT_PRIVATE;
|
|
66
|
+
|
|
67
|
+
public:
|
|
68
|
+
SendMailOptions() = default;
|
|
69
|
+
explicit SendMailOptions(EmailAddress from, std::vector<EmailAddress> to, std::optional<std::vector<EmailAddress>> cc, std::optional<std::vector<EmailAddress>> bcc, std::optional<std::vector<EmailAddress>> replyTo, std::string subject, std::optional<std::string> textBody, std::optional<std::string> htmlBody, std::optional<std::vector<SmtpAttachment>> attachments, std::optional<std::string> priority, std::optional<std::unordered_map<std::string, std::string>> headers, std::optional<std::string> inReplyTo, std::optional<std::string> references, std::optional<EmailAddress> readReceiptTo, std::optional<std::string> charset, std::optional<std::string> encoding): from(from), to(to), cc(cc), bcc(bcc), replyTo(replyTo), subject(subject), textBody(textBody), htmlBody(htmlBody), attachments(attachments), priority(priority), headers(headers), inReplyTo(inReplyTo), references(references), readReceiptTo(readReceiptTo), charset(charset), encoding(encoding) {}
|
|
70
|
+
|
|
71
|
+
public:
|
|
72
|
+
friend bool operator==(const SendMailOptions& lhs, const SendMailOptions& rhs) = default;
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
} // namespace margelo::nitro::emailimapsmtp
|
|
76
|
+
|
|
77
|
+
namespace margelo::nitro {
|
|
78
|
+
|
|
79
|
+
// C++ SendMailOptions <> JS SendMailOptions (object)
|
|
80
|
+
template <>
|
|
81
|
+
struct JSIConverter<margelo::nitro::emailimapsmtp::SendMailOptions> final {
|
|
82
|
+
static inline margelo::nitro::emailimapsmtp::SendMailOptions fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
83
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
84
|
+
return margelo::nitro::emailimapsmtp::SendMailOptions(
|
|
85
|
+
JSIConverter<margelo::nitro::emailimapsmtp::EmailAddress>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "from"))),
|
|
86
|
+
JSIConverter<std::vector<margelo::nitro::emailimapsmtp::EmailAddress>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "to"))),
|
|
87
|
+
JSIConverter<std::optional<std::vector<margelo::nitro::emailimapsmtp::EmailAddress>>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "cc"))),
|
|
88
|
+
JSIConverter<std::optional<std::vector<margelo::nitro::emailimapsmtp::EmailAddress>>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "bcc"))),
|
|
89
|
+
JSIConverter<std::optional<std::vector<margelo::nitro::emailimapsmtp::EmailAddress>>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "replyTo"))),
|
|
90
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "subject"))),
|
|
91
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "textBody"))),
|
|
92
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "htmlBody"))),
|
|
93
|
+
JSIConverter<std::optional<std::vector<margelo::nitro::emailimapsmtp::SmtpAttachment>>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "attachments"))),
|
|
94
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "priority"))),
|
|
95
|
+
JSIConverter<std::optional<std::unordered_map<std::string, std::string>>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "headers"))),
|
|
96
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "inReplyTo"))),
|
|
97
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "references"))),
|
|
98
|
+
JSIConverter<std::optional<margelo::nitro::emailimapsmtp::EmailAddress>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "readReceiptTo"))),
|
|
99
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "charset"))),
|
|
100
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "encoding")))
|
|
101
|
+
);
|
|
102
|
+
}
|
|
103
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::emailimapsmtp::SendMailOptions& arg) {
|
|
104
|
+
jsi::Object obj(runtime);
|
|
105
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "from"), JSIConverter<margelo::nitro::emailimapsmtp::EmailAddress>::toJSI(runtime, arg.from));
|
|
106
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "to"), JSIConverter<std::vector<margelo::nitro::emailimapsmtp::EmailAddress>>::toJSI(runtime, arg.to));
|
|
107
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "cc"), JSIConverter<std::optional<std::vector<margelo::nitro::emailimapsmtp::EmailAddress>>>::toJSI(runtime, arg.cc));
|
|
108
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "bcc"), JSIConverter<std::optional<std::vector<margelo::nitro::emailimapsmtp::EmailAddress>>>::toJSI(runtime, arg.bcc));
|
|
109
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "replyTo"), JSIConverter<std::optional<std::vector<margelo::nitro::emailimapsmtp::EmailAddress>>>::toJSI(runtime, arg.replyTo));
|
|
110
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "subject"), JSIConverter<std::string>::toJSI(runtime, arg.subject));
|
|
111
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "textBody"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.textBody));
|
|
112
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "htmlBody"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.htmlBody));
|
|
113
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "attachments"), JSIConverter<std::optional<std::vector<margelo::nitro::emailimapsmtp::SmtpAttachment>>>::toJSI(runtime, arg.attachments));
|
|
114
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "priority"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.priority));
|
|
115
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "headers"), JSIConverter<std::optional<std::unordered_map<std::string, std::string>>>::toJSI(runtime, arg.headers));
|
|
116
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "inReplyTo"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.inReplyTo));
|
|
117
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "references"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.references));
|
|
118
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "readReceiptTo"), JSIConverter<std::optional<margelo::nitro::emailimapsmtp::EmailAddress>>::toJSI(runtime, arg.readReceiptTo));
|
|
119
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "charset"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.charset));
|
|
120
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "encoding"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.encoding));
|
|
121
|
+
return obj;
|
|
122
|
+
}
|
|
123
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
124
|
+
if (!value.isObject()) {
|
|
125
|
+
return false;
|
|
126
|
+
}
|
|
127
|
+
jsi::Object obj = value.getObject(runtime);
|
|
128
|
+
if (!nitro::isPlainObject(runtime, obj)) {
|
|
129
|
+
return false;
|
|
130
|
+
}
|
|
131
|
+
if (!JSIConverter<margelo::nitro::emailimapsmtp::EmailAddress>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "from")))) return false;
|
|
132
|
+
if (!JSIConverter<std::vector<margelo::nitro::emailimapsmtp::EmailAddress>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "to")))) return false;
|
|
133
|
+
if (!JSIConverter<std::optional<std::vector<margelo::nitro::emailimapsmtp::EmailAddress>>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "cc")))) return false;
|
|
134
|
+
if (!JSIConverter<std::optional<std::vector<margelo::nitro::emailimapsmtp::EmailAddress>>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "bcc")))) return false;
|
|
135
|
+
if (!JSIConverter<std::optional<std::vector<margelo::nitro::emailimapsmtp::EmailAddress>>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "replyTo")))) return false;
|
|
136
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "subject")))) return false;
|
|
137
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "textBody")))) return false;
|
|
138
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "htmlBody")))) return false;
|
|
139
|
+
if (!JSIConverter<std::optional<std::vector<margelo::nitro::emailimapsmtp::SmtpAttachment>>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "attachments")))) return false;
|
|
140
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "priority")))) return false;
|
|
141
|
+
if (!JSIConverter<std::optional<std::unordered_map<std::string, std::string>>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "headers")))) return false;
|
|
142
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "inReplyTo")))) return false;
|
|
143
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "references")))) return false;
|
|
144
|
+
if (!JSIConverter<std::optional<margelo::nitro::emailimapsmtp::EmailAddress>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "readReceiptTo")))) return false;
|
|
145
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "charset")))) return false;
|
|
146
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "encoding")))) return false;
|
|
147
|
+
return true;
|
|
148
|
+
}
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
} // namespace margelo::nitro
|