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.
Files changed (201) hide show
  1. package/EmailImapSmtp.podspec +29 -0
  2. package/LICENSE +20 -0
  3. package/README.md +121 -0
  4. package/android/CMakeLists.txt +24 -0
  5. package/android/build.gradle +117 -0
  6. package/android/src/main/AndroidManifest.xml +3 -0
  7. package/android/src/main/cpp/cpp-adapter.cpp +11 -0
  8. package/android/src/main/java/com/margelo/nitro/emailimapsmtp/EmailImapSmtp.kt +1533 -0
  9. package/android/src/main/java/com/margelo/nitro/emailimapsmtp/EmailImapSmtpPackage.kt +22 -0
  10. package/ios/EmailImapSmtp.swift +5 -0
  11. package/lib/module/EmailImapSmtp.nitro.js +4 -0
  12. package/lib/module/EmailImapSmtp.nitro.js.map +1 -0
  13. package/lib/module/NativeEmailImapSmtp.js +14 -0
  14. package/lib/module/NativeEmailImapSmtp.js.map +1 -0
  15. package/lib/module/index.js +64 -0
  16. package/lib/module/index.js.map +1 -0
  17. package/lib/module/native.js +227 -0
  18. package/lib/module/native.js.map +1 -0
  19. package/lib/module/package.json +1 -0
  20. package/lib/module/types.js +2 -0
  21. package/lib/module/types.js.map +1 -0
  22. package/lib/module/web.js +107 -0
  23. package/lib/module/web.js.map +1 -0
  24. package/lib/module/windows.js +156 -0
  25. package/lib/module/windows.js.map +1 -0
  26. package/lib/typescript/package.json +1 -0
  27. package/lib/typescript/src/EmailImapSmtp.nitro.d.ts +268 -0
  28. package/lib/typescript/src/EmailImapSmtp.nitro.d.ts.map +1 -0
  29. package/lib/typescript/src/NativeEmailImapSmtp.d.ts +36 -0
  30. package/lib/typescript/src/NativeEmailImapSmtp.d.ts.map +1 -0
  31. package/lib/typescript/src/index.d.ts +33 -0
  32. package/lib/typescript/src/index.d.ts.map +1 -0
  33. package/lib/typescript/src/native.d.ts +32 -0
  34. package/lib/typescript/src/native.d.ts.map +1 -0
  35. package/lib/typescript/src/types.d.ts +261 -0
  36. package/lib/typescript/src/types.d.ts.map +1 -0
  37. package/lib/typescript/src/web.d.ts +32 -0
  38. package/lib/typescript/src/web.d.ts.map +1 -0
  39. package/lib/typescript/src/windows.d.ts +32 -0
  40. package/lib/typescript/src/windows.d.ts.map +1 -0
  41. package/nitro.json +23 -0
  42. package/nitrogen/generated/android/c++/JAppendResult.hpp +65 -0
  43. package/nitrogen/generated/android/c++/JAttachmentInfo.hpp +96 -0
  44. package/nitrogen/generated/android/c++/JConnectionConfig.hpp +94 -0
  45. package/nitrogen/generated/android/c++/JConnectionResult.hpp +73 -0
  46. package/nitrogen/generated/android/c++/JDeleteResult.hpp +87 -0
  47. package/nitrogen/generated/android/c++/JEmailAddress.hpp +61 -0
  48. package/nitrogen/generated/android/c++/JEmailBody.hpp +84 -0
  49. package/nitrogen/generated/android/c++/JEmailMessage.hpp +273 -0
  50. package/nitrogen/generated/android/c++/JFetchEmailsOptions.hpp +110 -0
  51. package/nitrogen/generated/android/c++/JFolderInfo.hpp +126 -0
  52. package/nitrogen/generated/android/c++/JFunc_void_IdleNotification.hpp +79 -0
  53. package/nitrogen/generated/android/c++/JHybridEmailImapSmtpSpec.cpp +697 -0
  54. package/nitrogen/generated/android/c++/JHybridEmailImapSmtpSpec.hpp +92 -0
  55. package/nitrogen/generated/android/c++/JIdleNotification.hpp +78 -0
  56. package/nitrogen/generated/android/c++/JImapServerInfo.hpp +84 -0
  57. package/nitrogen/generated/android/c++/JMailboxInfo.hpp +134 -0
  58. package/nitrogen/generated/android/c++/JMailboxListItem.hpp +92 -0
  59. package/nitrogen/generated/android/c++/JQuotaInfo.hpp +78 -0
  60. package/nitrogen/generated/android/c++/JSearchCriteria.hpp +187 -0
  61. package/nitrogen/generated/android/c++/JSearchHeader.hpp +61 -0
  62. package/nitrogen/generated/android/c++/JSendMailOptions.hpp +229 -0
  63. package/nitrogen/generated/android/c++/JSendMailResult.hpp +88 -0
  64. package/nitrogen/generated/android/c++/JSmtpAttachment.hpp +80 -0
  65. package/nitrogen/generated/android/c++/JSmtpConnectionConfig.hpp +98 -0
  66. package/nitrogen/generated/android/c++/JSmtpServerInfo.hpp +102 -0
  67. package/nitrogen/generated/android/c++/JVariant_ImapServerInfo_SmtpServerInfo.cpp +26 -0
  68. package/nitrogen/generated/android/c++/JVariant_ImapServerInfo_SmtpServerInfo.hpp +73 -0
  69. package/nitrogen/generated/android/c++/JVariant_NullType_AttachmentInfo.cpp +26 -0
  70. package/nitrogen/generated/android/c++/JVariant_NullType_AttachmentInfo.hpp +75 -0
  71. package/nitrogen/generated/android/c++/JVariant_NullType_EmailMessage.cpp +26 -0
  72. package/nitrogen/generated/android/c++/JVariant_NullType_EmailMessage.hpp +83 -0
  73. package/nitrogen/generated/android/emailimapsmtp+autolinking.cmake +84 -0
  74. package/nitrogen/generated/android/emailimapsmtp+autolinking.gradle +27 -0
  75. package/nitrogen/generated/android/emailimapsmtpOnLoad.cpp +56 -0
  76. package/nitrogen/generated/android/emailimapsmtpOnLoad.hpp +34 -0
  77. package/nitrogen/generated/android/kotlin/com/margelo/nitro/emailimapsmtp/AppendResult.kt +61 -0
  78. package/nitrogen/generated/android/kotlin/com/margelo/nitro/emailimapsmtp/AttachmentInfo.kt +96 -0
  79. package/nitrogen/generated/android/kotlin/com/margelo/nitro/emailimapsmtp/ConnectionConfig.kt +96 -0
  80. package/nitrogen/generated/android/kotlin/com/margelo/nitro/emailimapsmtp/ConnectionResult.kt +61 -0
  81. package/nitrogen/generated/android/kotlin/com/margelo/nitro/emailimapsmtp/DeleteResult.kt +61 -0
  82. package/nitrogen/generated/android/kotlin/com/margelo/nitro/emailimapsmtp/EmailAddress.kt +56 -0
  83. package/nitrogen/generated/android/kotlin/com/margelo/nitro/emailimapsmtp/EmailBody.kt +61 -0
  84. package/nitrogen/generated/android/kotlin/com/margelo/nitro/emailimapsmtp/EmailMessage.kt +156 -0
  85. package/nitrogen/generated/android/kotlin/com/margelo/nitro/emailimapsmtp/FetchEmailsOptions.kt +116 -0
  86. package/nitrogen/generated/android/kotlin/com/margelo/nitro/emailimapsmtp/FolderInfo.kt +91 -0
  87. package/nitrogen/generated/android/kotlin/com/margelo/nitro/emailimapsmtp/Func_void_IdleNotification.kt +80 -0
  88. package/nitrogen/generated/android/kotlin/com/margelo/nitro/emailimapsmtp/HybridEmailImapSmtpSpec.kt +178 -0
  89. package/nitrogen/generated/android/kotlin/com/margelo/nitro/emailimapsmtp/IdleNotification.kt +76 -0
  90. package/nitrogen/generated/android/kotlin/com/margelo/nitro/emailimapsmtp/ImapServerInfo.kt +61 -0
  91. package/nitrogen/generated/android/kotlin/com/margelo/nitro/emailimapsmtp/MailboxInfo.kt +101 -0
  92. package/nitrogen/generated/android/kotlin/com/margelo/nitro/emailimapsmtp/MailboxListItem.kt +71 -0
  93. package/nitrogen/generated/android/kotlin/com/margelo/nitro/emailimapsmtp/QuotaInfo.kt +76 -0
  94. package/nitrogen/generated/android/kotlin/com/margelo/nitro/emailimapsmtp/SearchCriteria.kt +196 -0
  95. package/nitrogen/generated/android/kotlin/com/margelo/nitro/emailimapsmtp/SearchHeader.kt +56 -0
  96. package/nitrogen/generated/android/kotlin/com/margelo/nitro/emailimapsmtp/SendMailOptions.kt +126 -0
  97. package/nitrogen/generated/android/kotlin/com/margelo/nitro/emailimapsmtp/SendMailResult.kt +86 -0
  98. package/nitrogen/generated/android/kotlin/com/margelo/nitro/emailimapsmtp/SmtpAttachment.kt +76 -0
  99. package/nitrogen/generated/android/kotlin/com/margelo/nitro/emailimapsmtp/SmtpConnectionConfig.kt +101 -0
  100. package/nitrogen/generated/android/kotlin/com/margelo/nitro/emailimapsmtp/SmtpServerInfo.kt +61 -0
  101. package/nitrogen/generated/android/kotlin/com/margelo/nitro/emailimapsmtp/Variant_ImapServerInfo_SmtpServerInfo.kt +62 -0
  102. package/nitrogen/generated/android/kotlin/com/margelo/nitro/emailimapsmtp/Variant_NullType_AttachmentInfo.kt +62 -0
  103. package/nitrogen/generated/android/kotlin/com/margelo/nitro/emailimapsmtp/Variant_NullType_EmailMessage.kt +62 -0
  104. package/nitrogen/generated/android/kotlin/com/margelo/nitro/emailimapsmtp/emailimapsmtpOnLoad.kt +35 -0
  105. package/nitrogen/generated/ios/EmailImapSmtp+autolinking.rb +62 -0
  106. package/nitrogen/generated/ios/EmailImapSmtp-Swift-Cxx-Bridge.cpp +161 -0
  107. package/nitrogen/generated/ios/EmailImapSmtp-Swift-Cxx-Bridge.hpp +1132 -0
  108. package/nitrogen/generated/ios/EmailImapSmtp-Swift-Cxx-Umbrella.hpp +118 -0
  109. package/nitrogen/generated/ios/EmailImapSmtpAutolinking.mm +33 -0
  110. package/nitrogen/generated/ios/EmailImapSmtpAutolinking.swift +26 -0
  111. package/nitrogen/generated/ios/c++/HybridEmailImapSmtpSpecSwift.cpp +11 -0
  112. package/nitrogen/generated/ios/c++/HybridEmailImapSmtpSpecSwift.hpp +390 -0
  113. package/nitrogen/generated/ios/swift/AppendResult.swift +39 -0
  114. package/nitrogen/generated/ios/swift/AttachmentInfo.swift +113 -0
  115. package/nitrogen/generated/ios/swift/ConnectionConfig.swift +87 -0
  116. package/nitrogen/generated/ios/swift/ConnectionResult.swift +84 -0
  117. package/nitrogen/generated/ios/swift/DeleteResult.swift +64 -0
  118. package/nitrogen/generated/ios/swift/EmailAddress.swift +34 -0
  119. package/nitrogen/generated/ios/swift/EmailBody.swift +45 -0
  120. package/nitrogen/generated/ios/swift/EmailMessage.swift +184 -0
  121. package/nitrogen/generated/ios/swift/FetchEmailsOptions.swift +198 -0
  122. package/nitrogen/generated/ios/swift/FolderInfo.swift +81 -0
  123. package/nitrogen/generated/ios/swift/Func_void.swift +46 -0
  124. package/nitrogen/generated/ios/swift/Func_void_AppendResult.swift +46 -0
  125. package/nitrogen/generated/ios/swift/Func_void_ConnectionResult.swift +46 -0
  126. package/nitrogen/generated/ios/swift/Func_void_DeleteResult.swift +46 -0
  127. package/nitrogen/generated/ios/swift/Func_void_IdleNotification.swift +46 -0
  128. package/nitrogen/generated/ios/swift/Func_void_MailboxInfo.swift +46 -0
  129. package/nitrogen/generated/ios/swift/Func_void_QuotaInfo.swift +46 -0
  130. package/nitrogen/generated/ios/swift/Func_void_SendMailResult.swift +46 -0
  131. package/nitrogen/generated/ios/swift/Func_void_bool.swift +46 -0
  132. package/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift +46 -0
  133. package/nitrogen/generated/ios/swift/Func_void_std__variant_nitro__NullType__AttachmentInfo_.swift +58 -0
  134. package/nitrogen/generated/ios/swift/Func_void_std__variant_nitro__NullType__EmailMessage_.swift +58 -0
  135. package/nitrogen/generated/ios/swift/Func_void_std__vector_AttachmentInfo_.swift +46 -0
  136. package/nitrogen/generated/ios/swift/Func_void_std__vector_EmailMessage_.swift +46 -0
  137. package/nitrogen/generated/ios/swift/Func_void_std__vector_FolderInfo_.swift +46 -0
  138. package/nitrogen/generated/ios/swift/Func_void_std__vector_MailboxListItem_.swift +46 -0
  139. package/nitrogen/generated/ios/swift/HybridEmailImapSmtpSpec.swift +84 -0
  140. package/nitrogen/generated/ios/swift/HybridEmailImapSmtpSpec_cxx.swift +759 -0
  141. package/nitrogen/generated/ios/swift/IdleNotification.swift +93 -0
  142. package/nitrogen/generated/ios/swift/ImapServerInfo.swift +45 -0
  143. package/nitrogen/generated/ios/swift/MailboxInfo.swift +91 -0
  144. package/nitrogen/generated/ios/swift/MailboxListItem.swift +55 -0
  145. package/nitrogen/generated/ios/swift/QuotaInfo.swift +80 -0
  146. package/nitrogen/generated/ios/swift/SearchCriteria.swift +485 -0
  147. package/nitrogen/generated/ios/swift/SearchHeader.swift +34 -0
  148. package/nitrogen/generated/ios/swift/SendMailOptions.swift +310 -0
  149. package/nitrogen/generated/ios/swift/SendMailResult.swift +155 -0
  150. package/nitrogen/generated/ios/swift/SmtpAttachment.swift +80 -0
  151. package/nitrogen/generated/ios/swift/SmtpConnectionConfig.swift +105 -0
  152. package/nitrogen/generated/ios/swift/SmtpServerInfo.swift +51 -0
  153. package/nitrogen/generated/ios/swift/Variant_ImapServerInfo_SmtpServerInfo.swift +30 -0
  154. package/nitrogen/generated/ios/swift/Variant_NullType_AttachmentInfo.swift +30 -0
  155. package/nitrogen/generated/ios/swift/Variant_NullType_EmailMessage.swift +30 -0
  156. package/nitrogen/generated/shared/c++/AppendResult.hpp +91 -0
  157. package/nitrogen/generated/shared/c++/AttachmentInfo.hpp +121 -0
  158. package/nitrogen/generated/shared/c++/ConnectionConfig.hpp +120 -0
  159. package/nitrogen/generated/shared/c++/ConnectionResult.hpp +98 -0
  160. package/nitrogen/generated/shared/c++/DeleteResult.hpp +93 -0
  161. package/nitrogen/generated/shared/c++/EmailAddress.hpp +87 -0
  162. package/nitrogen/generated/shared/c++/EmailBody.hpp +92 -0
  163. package/nitrogen/generated/shared/c++/EmailMessage.hpp +177 -0
  164. package/nitrogen/generated/shared/c++/FetchEmailsOptions.hpp +136 -0
  165. package/nitrogen/generated/shared/c++/FolderInfo.hpp +116 -0
  166. package/nitrogen/generated/shared/c++/HybridEmailImapSmtpSpec.cpp +50 -0
  167. package/nitrogen/generated/shared/c++/HybridEmailImapSmtpSpec.hpp +145 -0
  168. package/nitrogen/generated/shared/c++/IdleNotification.hpp +104 -0
  169. package/nitrogen/generated/shared/c++/ImapServerInfo.hpp +92 -0
  170. package/nitrogen/generated/shared/c++/MailboxInfo.hpp +124 -0
  171. package/nitrogen/generated/shared/c++/MailboxListItem.hpp +100 -0
  172. package/nitrogen/generated/shared/c++/QuotaInfo.hpp +104 -0
  173. package/nitrogen/generated/shared/c++/SearchCriteria.hpp +203 -0
  174. package/nitrogen/generated/shared/c++/SearchHeader.hpp +87 -0
  175. package/nitrogen/generated/shared/c++/SendMailOptions.hpp +151 -0
  176. package/nitrogen/generated/shared/c++/SendMailResult.hpp +113 -0
  177. package/nitrogen/generated/shared/c++/SmtpAttachment.hpp +105 -0
  178. package/nitrogen/generated/shared/c++/SmtpConnectionConfig.hpp +124 -0
  179. package/nitrogen/generated/shared/c++/SmtpServerInfo.hpp +92 -0
  180. package/package.json +196 -0
  181. package/react-native.config.js +27 -0
  182. package/src/EmailImapSmtp.nitro.ts +333 -0
  183. package/src/NativeEmailImapSmtp.ts +100 -0
  184. package/src/index.tsx +166 -0
  185. package/src/native.ts +305 -0
  186. package/src/types.ts +328 -0
  187. package/src/web.ts +196 -0
  188. package/src/windows.ts +304 -0
  189. package/windows/EmailImapSmtp.cpp +735 -0
  190. package/windows/EmailImapSmtp.h +137 -0
  191. package/windows/EmailImapSmtpModule.cpp +10 -0
  192. package/windows/EmailImapSmtpModule.h +139 -0
  193. package/windows/EmailImapSmtpPackage.cpp +15 -0
  194. package/windows/EmailImapSmtpPackage.h +13 -0
  195. package/windows/ImapProtocol.cpp +1382 -0
  196. package/windows/ImapProtocol.h +97 -0
  197. package/windows/ProtocolDefs.h +300 -0
  198. package/windows/SmtpProtocol.cpp +334 -0
  199. package/windows/SmtpProtocol.h +36 -0
  200. package/windows/TlsSocket.cpp +818 -0
  201. package/windows/TlsSocket.h +87 -0
@@ -0,0 +1,156 @@
1
+ ///
2
+ /// EmailMessage.kt
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
+ package com.margelo.nitro.emailimapsmtp
9
+
10
+ import androidx.annotation.Keep
11
+ import com.facebook.proguard.annotations.DoNotStrip
12
+ import java.util.Objects
13
+
14
+
15
+ /**
16
+ * Represents the JavaScript object/struct "EmailMessage".
17
+ */
18
+ @DoNotStrip
19
+ @Keep
20
+ data class EmailMessage(
21
+ @DoNotStrip
22
+ @Keep
23
+ val uid: Double,
24
+ @DoNotStrip
25
+ @Keep
26
+ val sequenceNumber: Double,
27
+ @DoNotStrip
28
+ @Keep
29
+ val subject: String,
30
+ @DoNotStrip
31
+ @Keep
32
+ val from: EmailAddress,
33
+ @DoNotStrip
34
+ @Keep
35
+ val to: Array<EmailAddress>,
36
+ @DoNotStrip
37
+ @Keep
38
+ val cc: Array<EmailAddress>,
39
+ @DoNotStrip
40
+ @Keep
41
+ val bcc: Array<EmailAddress>,
42
+ @DoNotStrip
43
+ @Keep
44
+ val replyTo: Array<EmailAddress>,
45
+ @DoNotStrip
46
+ @Keep
47
+ val date: String,
48
+ @DoNotStrip
49
+ @Keep
50
+ val receivedDate: String,
51
+ @DoNotStrip
52
+ @Keep
53
+ val body: EmailBody,
54
+ @DoNotStrip
55
+ @Keep
56
+ val attachments: Array<AttachmentInfo>,
57
+ @DoNotStrip
58
+ @Keep
59
+ val flags: Array<String>,
60
+ @DoNotStrip
61
+ @Keep
62
+ val headers: Map<String, String>,
63
+ @DoNotStrip
64
+ @Keep
65
+ val size: Double,
66
+ @DoNotStrip
67
+ @Keep
68
+ val messageId: String,
69
+ @DoNotStrip
70
+ @Keep
71
+ val inReplyTo: String,
72
+ @DoNotStrip
73
+ @Keep
74
+ val references: String,
75
+ @DoNotStrip
76
+ @Keep
77
+ val priority: String,
78
+ @DoNotStrip
79
+ @Keep
80
+ val isEncrypted: Boolean,
81
+ @DoNotStrip
82
+ @Keep
83
+ val mimeType: String,
84
+ @DoNotStrip
85
+ @Keep
86
+ val charset: String
87
+ ) {
88
+ /* primary constructor */
89
+
90
+ override fun equals(other: Any?): Boolean {
91
+ if (this === other) return true
92
+ if (other !is EmailMessage) return false
93
+ return Objects.deepEquals(this.uid, other.uid)
94
+ && Objects.deepEquals(this.sequenceNumber, other.sequenceNumber)
95
+ && Objects.deepEquals(this.subject, other.subject)
96
+ && Objects.deepEquals(this.from, other.from)
97
+ && Objects.deepEquals(this.to, other.to)
98
+ && Objects.deepEquals(this.cc, other.cc)
99
+ && Objects.deepEquals(this.bcc, other.bcc)
100
+ && Objects.deepEquals(this.replyTo, other.replyTo)
101
+ && Objects.deepEquals(this.date, other.date)
102
+ && Objects.deepEquals(this.receivedDate, other.receivedDate)
103
+ && Objects.deepEquals(this.body, other.body)
104
+ && Objects.deepEquals(this.attachments, other.attachments)
105
+ && Objects.deepEquals(this.flags, other.flags)
106
+ && Objects.deepEquals(this.headers, other.headers)
107
+ && Objects.deepEquals(this.size, other.size)
108
+ && Objects.deepEquals(this.messageId, other.messageId)
109
+ && Objects.deepEquals(this.inReplyTo, other.inReplyTo)
110
+ && Objects.deepEquals(this.references, other.references)
111
+ && Objects.deepEquals(this.priority, other.priority)
112
+ && Objects.deepEquals(this.isEncrypted, other.isEncrypted)
113
+ && Objects.deepEquals(this.mimeType, other.mimeType)
114
+ && Objects.deepEquals(this.charset, other.charset)
115
+ }
116
+
117
+ override fun hashCode(): Int {
118
+ return arrayOf<Any?>(
119
+ uid,
120
+ sequenceNumber,
121
+ subject,
122
+ from,
123
+ to,
124
+ cc,
125
+ bcc,
126
+ replyTo,
127
+ date,
128
+ receivedDate,
129
+ body,
130
+ attachments,
131
+ flags,
132
+ headers,
133
+ size,
134
+ messageId,
135
+ inReplyTo,
136
+ references,
137
+ priority,
138
+ isEncrypted,
139
+ mimeType,
140
+ charset
141
+ ).contentDeepHashCode()
142
+ }
143
+
144
+ companion object {
145
+ /**
146
+ * Constructor called from C++
147
+ */
148
+ @DoNotStrip
149
+ @Keep
150
+ @Suppress("unused")
151
+ @JvmStatic
152
+ private fun fromCpp(uid: Double, sequenceNumber: Double, subject: String, from: EmailAddress, to: Array<EmailAddress>, cc: Array<EmailAddress>, bcc: Array<EmailAddress>, replyTo: Array<EmailAddress>, date: String, receivedDate: String, body: EmailBody, attachments: Array<AttachmentInfo>, flags: Array<String>, headers: Map<String, String>, size: Double, messageId: String, inReplyTo: String, references: String, priority: String, isEncrypted: Boolean, mimeType: String, charset: String): EmailMessage {
153
+ return EmailMessage(uid, sequenceNumber, subject, from, to, cc, bcc, replyTo, date, receivedDate, body, attachments, flags, headers, size, messageId, inReplyTo, references, priority, isEncrypted, mimeType, charset)
154
+ }
155
+ }
156
+ }
@@ -0,0 +1,116 @@
1
+ ///
2
+ /// FetchEmailsOptions.kt
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
+ package com.margelo.nitro.emailimapsmtp
9
+
10
+ import androidx.annotation.Keep
11
+ import com.facebook.proguard.annotations.DoNotStrip
12
+ import java.util.Objects
13
+
14
+
15
+ /**
16
+ * Represents the JavaScript object/struct "FetchEmailsOptions".
17
+ */
18
+ @DoNotStrip
19
+ @Keep
20
+ data class FetchEmailsOptions(
21
+ @DoNotStrip
22
+ @Keep
23
+ val from: Double?,
24
+ @DoNotStrip
25
+ @Keep
26
+ val to: Double?,
27
+ @DoNotStrip
28
+ @Keep
29
+ val rangeType: String?,
30
+ @DoNotStrip
31
+ @Keep
32
+ val page: Double?,
33
+ @DoNotStrip
34
+ @Keep
35
+ val pageSize: Double?,
36
+ @DoNotStrip
37
+ @Keep
38
+ val since: String?,
39
+ @DoNotStrip
40
+ @Keep
41
+ val before: String?,
42
+ @DoNotStrip
43
+ @Keep
44
+ val mailbox: String?,
45
+ @DoNotStrip
46
+ @Keep
47
+ val fetchBody: Boolean,
48
+ @DoNotStrip
49
+ @Keep
50
+ val fetchAttachments: Boolean,
51
+ @DoNotStrip
52
+ @Keep
53
+ val fetchFlags: Boolean,
54
+ @DoNotStrip
55
+ @Keep
56
+ val fetchHeaders: Boolean,
57
+ @DoNotStrip
58
+ @Keep
59
+ val fetchFullContent: Boolean,
60
+ @DoNotStrip
61
+ @Keep
62
+ val maxBodySize: Double
63
+ ) {
64
+ /* primary constructor */
65
+
66
+ override fun equals(other: Any?): Boolean {
67
+ if (this === other) return true
68
+ if (other !is FetchEmailsOptions) return false
69
+ return Objects.deepEquals(this.from, other.from)
70
+ && Objects.deepEquals(this.to, other.to)
71
+ && Objects.deepEquals(this.rangeType, other.rangeType)
72
+ && Objects.deepEquals(this.page, other.page)
73
+ && Objects.deepEquals(this.pageSize, other.pageSize)
74
+ && Objects.deepEquals(this.since, other.since)
75
+ && Objects.deepEquals(this.before, other.before)
76
+ && Objects.deepEquals(this.mailbox, other.mailbox)
77
+ && Objects.deepEquals(this.fetchBody, other.fetchBody)
78
+ && Objects.deepEquals(this.fetchAttachments, other.fetchAttachments)
79
+ && Objects.deepEquals(this.fetchFlags, other.fetchFlags)
80
+ && Objects.deepEquals(this.fetchHeaders, other.fetchHeaders)
81
+ && Objects.deepEquals(this.fetchFullContent, other.fetchFullContent)
82
+ && Objects.deepEquals(this.maxBodySize, other.maxBodySize)
83
+ }
84
+
85
+ override fun hashCode(): Int {
86
+ return arrayOf<Any?>(
87
+ from,
88
+ to,
89
+ rangeType,
90
+ page,
91
+ pageSize,
92
+ since,
93
+ before,
94
+ mailbox,
95
+ fetchBody,
96
+ fetchAttachments,
97
+ fetchFlags,
98
+ fetchHeaders,
99
+ fetchFullContent,
100
+ maxBodySize
101
+ ).contentDeepHashCode()
102
+ }
103
+
104
+ companion object {
105
+ /**
106
+ * Constructor called from C++
107
+ */
108
+ @DoNotStrip
109
+ @Keep
110
+ @Suppress("unused")
111
+ @JvmStatic
112
+ private fun fromCpp(from: Double?, to: Double?, rangeType: String?, page: Double?, pageSize: Double?, since: String?, before: String?, mailbox: String?, fetchBody: Boolean, fetchAttachments: Boolean, fetchFlags: Boolean, fetchHeaders: Boolean, fetchFullContent: Boolean, maxBodySize: Double): FetchEmailsOptions {
113
+ return FetchEmailsOptions(from, to, rangeType, page, pageSize, since, before, mailbox, fetchBody, fetchAttachments, fetchFlags, fetchHeaders, fetchFullContent, maxBodySize)
114
+ }
115
+ }
116
+ }
@@ -0,0 +1,91 @@
1
+ ///
2
+ /// FolderInfo.kt
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
+ package com.margelo.nitro.emailimapsmtp
9
+
10
+ import androidx.annotation.Keep
11
+ import com.facebook.proguard.annotations.DoNotStrip
12
+ import java.util.Objects
13
+
14
+
15
+ /**
16
+ * Represents the JavaScript object/struct "FolderInfo".
17
+ */
18
+ @DoNotStrip
19
+ @Keep
20
+ data class FolderInfo(
21
+ @DoNotStrip
22
+ @Keep
23
+ val name: String,
24
+ @DoNotStrip
25
+ @Keep
26
+ val path: String,
27
+ @DoNotStrip
28
+ @Keep
29
+ val delimiter: String,
30
+ @DoNotStrip
31
+ @Keep
32
+ val parent: String,
33
+ @DoNotStrip
34
+ @Keep
35
+ val children: Array<String>,
36
+ @DoNotStrip
37
+ @Keep
38
+ val flags: Array<String>,
39
+ @DoNotStrip
40
+ @Keep
41
+ val subscribed: Boolean,
42
+ @DoNotStrip
43
+ @Keep
44
+ val messageCount: Double,
45
+ @DoNotStrip
46
+ @Keep
47
+ val unseenCount: Double
48
+ ) {
49
+ /* primary constructor */
50
+
51
+ override fun equals(other: Any?): Boolean {
52
+ if (this === other) return true
53
+ if (other !is FolderInfo) return false
54
+ return Objects.deepEquals(this.name, other.name)
55
+ && Objects.deepEquals(this.path, other.path)
56
+ && Objects.deepEquals(this.delimiter, other.delimiter)
57
+ && Objects.deepEquals(this.parent, other.parent)
58
+ && Objects.deepEquals(this.children, other.children)
59
+ && Objects.deepEquals(this.flags, other.flags)
60
+ && Objects.deepEquals(this.subscribed, other.subscribed)
61
+ && Objects.deepEquals(this.messageCount, other.messageCount)
62
+ && Objects.deepEquals(this.unseenCount, other.unseenCount)
63
+ }
64
+
65
+ override fun hashCode(): Int {
66
+ return arrayOf<Any?>(
67
+ name,
68
+ path,
69
+ delimiter,
70
+ parent,
71
+ children,
72
+ flags,
73
+ subscribed,
74
+ messageCount,
75
+ unseenCount
76
+ ).contentDeepHashCode()
77
+ }
78
+
79
+ companion object {
80
+ /**
81
+ * Constructor called from C++
82
+ */
83
+ @DoNotStrip
84
+ @Keep
85
+ @Suppress("unused")
86
+ @JvmStatic
87
+ private fun fromCpp(name: String, path: String, delimiter: String, parent: String, children: Array<String>, flags: Array<String>, subscribed: Boolean, messageCount: Double, unseenCount: Double): FolderInfo {
88
+ return FolderInfo(name, path, delimiter, parent, children, flags, subscribed, messageCount, unseenCount)
89
+ }
90
+ }
91
+ }
@@ -0,0 +1,80 @@
1
+ ///
2
+ /// Func_void_IdleNotification.kt
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
+ package com.margelo.nitro.emailimapsmtp
9
+
10
+ import androidx.annotation.Keep
11
+ import com.facebook.jni.HybridData
12
+ import com.facebook.proguard.annotations.DoNotStrip
13
+ import dalvik.annotation.optimization.FastNative
14
+
15
+
16
+ /**
17
+ * Represents the JavaScript callback `(notification: struct) => void`.
18
+ * This can be either implemented in C++ (in which case it might be a callback coming from JS),
19
+ * or in Kotlin/Java (in which case it is a native callback).
20
+ */
21
+ @DoNotStrip
22
+ @Keep
23
+ @Suppress("ClassName", "RedundantUnitReturnType")
24
+ fun interface Func_void_IdleNotification: (IdleNotification) -> Unit {
25
+ /**
26
+ * Call the given JS callback.
27
+ * @throws Throwable if the JS function itself throws an error, or if the JS function/runtime has already been deleted.
28
+ */
29
+ @DoNotStrip
30
+ @Keep
31
+ override fun invoke(notification: IdleNotification): Unit
32
+ }
33
+
34
+ /**
35
+ * Represents the JavaScript callback `(notification: struct) => void`.
36
+ * This is implemented in C++, via a `std::function<...>`.
37
+ * The callback might be coming from JS.
38
+ */
39
+ @DoNotStrip
40
+ @Keep
41
+ @Suppress(
42
+ "KotlinJniMissingFunction", "unused",
43
+ "RedundantSuppression", "RedundantUnitReturnType", "FunctionName",
44
+ "ConvertSecondaryConstructorToPrimary", "ClassName", "LocalVariableName",
45
+ )
46
+ class Func_void_IdleNotification_cxx: Func_void_IdleNotification {
47
+ @DoNotStrip
48
+ @Keep
49
+ private val mHybridData: HybridData
50
+
51
+ @DoNotStrip
52
+ @Keep
53
+ private constructor(hybridData: HybridData) {
54
+ mHybridData = hybridData
55
+ }
56
+
57
+ @DoNotStrip
58
+ @Keep
59
+ override fun invoke(notification: IdleNotification): Unit
60
+ = invoke_cxx(notification)
61
+
62
+ @FastNative
63
+ private external fun invoke_cxx(notification: IdleNotification): Unit
64
+ }
65
+
66
+ /**
67
+ * Represents the JavaScript callback `(notification: struct) => void`.
68
+ * This is implemented in Java/Kotlin, via a `(IdleNotification) -> Unit`.
69
+ * The callback is always coming from native.
70
+ */
71
+ @DoNotStrip
72
+ @Keep
73
+ @Suppress("ClassName", "RedundantUnitReturnType", "unused")
74
+ class Func_void_IdleNotification_java(private val function: (IdleNotification) -> Unit): Func_void_IdleNotification {
75
+ @DoNotStrip
76
+ @Keep
77
+ override fun invoke(notification: IdleNotification): Unit {
78
+ return this.function(notification)
79
+ }
80
+ }
@@ -0,0 +1,178 @@
1
+ ///
2
+ /// HybridEmailImapSmtpSpec.kt
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
+ package com.margelo.nitro.emailimapsmtp
9
+
10
+ import androidx.annotation.Keep
11
+ import com.facebook.jni.HybridData
12
+ import com.facebook.proguard.annotations.DoNotStrip
13
+ import com.margelo.nitro.core.Promise
14
+ import com.margelo.nitro.core.NullType
15
+ import com.margelo.nitro.core.ArrayBuffer
16
+ import com.margelo.nitro.core.HybridObject
17
+
18
+ /**
19
+ * A Kotlin class representing the EmailImapSmtp HybridObject.
20
+ * Implement this abstract class to create Kotlin-based instances of EmailImapSmtp.
21
+ */
22
+ @DoNotStrip
23
+ @Keep
24
+ @Suppress(
25
+ "KotlinJniMissingFunction", "unused",
26
+ "RedundantSuppression", "RedundantUnitReturnType", "SimpleRedundantLet",
27
+ "LocalVariableName", "PropertyName", "PrivatePropertyName", "FunctionName"
28
+ )
29
+ abstract class HybridEmailImapSmtpSpec: HybridObject() {
30
+ // Properties
31
+
32
+
33
+ // Methods
34
+ @DoNotStrip
35
+ @Keep
36
+ abstract fun imapConnect(config: ConnectionConfig): Promise<ConnectionResult>
37
+
38
+ @DoNotStrip
39
+ @Keep
40
+ abstract fun imapDisconnect(): Promise<Unit>
41
+
42
+ @DoNotStrip
43
+ @Keep
44
+ abstract fun imapListMailboxes(): Promise<Array<MailboxListItem>>
45
+
46
+ @DoNotStrip
47
+ @Keep
48
+ abstract fun imapSelectMailbox(mailbox: String, readOnly: Boolean): Promise<MailboxInfo>
49
+
50
+ @DoNotStrip
51
+ @Keep
52
+ abstract fun imapRefreshMailbox(): Promise<MailboxInfo>
53
+
54
+ @DoNotStrip
55
+ @Keep
56
+ abstract fun imapFetchFolders(): Promise<Array<FolderInfo>>
57
+
58
+ @DoNotStrip
59
+ @Keep
60
+ abstract fun imapCreateFolder(folderName: String): Promise<Unit>
61
+
62
+ @DoNotStrip
63
+ @Keep
64
+ abstract fun imapDeleteFolder(folderName: String): Promise<Unit>
65
+
66
+ @DoNotStrip
67
+ @Keep
68
+ abstract fun imapRenameFolder(oldName: String, newName: String): Promise<Unit>
69
+
70
+ @DoNotStrip
71
+ @Keep
72
+ abstract fun imapSubscribeFolder(folderName: String): Promise<Unit>
73
+
74
+ @DoNotStrip
75
+ @Keep
76
+ abstract fun imapUnsubscribeFolder(folderName: String): Promise<Unit>
77
+
78
+ @DoNotStrip
79
+ @Keep
80
+ abstract fun imapFetchEmails(options: FetchEmailsOptions): Promise<Array<EmailMessage>>
81
+
82
+ @DoNotStrip
83
+ @Keep
84
+ abstract fun imapFetchEmailByUID(uid: Double): Promise<Variant_NullType_EmailMessage>
85
+
86
+ @DoNotStrip
87
+ @Keep
88
+ abstract fun imapSearchEmails(criteria: SearchCriteria): Promise<Array<EmailMessage>>
89
+
90
+ @DoNotStrip
91
+ @Keep
92
+ abstract fun imapMarkAsRead(uids: DoubleArray, silent: Boolean): Promise<Unit>
93
+
94
+ @DoNotStrip
95
+ @Keep
96
+ abstract fun imapMarkAsFlagged(uids: DoubleArray, flagged: Boolean): Promise<Unit>
97
+
98
+ @DoNotStrip
99
+ @Keep
100
+ abstract fun imapMoveEmails(uids: DoubleArray, destinationMailbox: String): Promise<Unit>
101
+
102
+ @DoNotStrip
103
+ @Keep
104
+ abstract fun imapCopyEmails(uids: DoubleArray, destinationMailbox: String): Promise<Unit>
105
+
106
+ @DoNotStrip
107
+ @Keep
108
+ abstract fun imapDeleteEmails(uids: DoubleArray): Promise<DeleteResult>
109
+
110
+ @DoNotStrip
111
+ @Keep
112
+ abstract fun imapExpunge(): Promise<Unit>
113
+
114
+ @DoNotStrip
115
+ @Keep
116
+ abstract fun imapFetchAttachments(uid: Double, partId: String): Promise<Variant_NullType_AttachmentInfo>
117
+
118
+ @DoNotStrip
119
+ @Keep
120
+ abstract fun imapFetchAllAttachments(uid: Double): Promise<Array<AttachmentInfo>>
121
+
122
+ abstract fun imapIdle(callback: (notification: IdleNotification) -> Unit): Promise<Unit>
123
+
124
+ @DoNotStrip
125
+ @Keep
126
+ private fun imapIdle_cxx(callback: Func_void_IdleNotification): Promise<Unit> {
127
+ val __result = imapIdle(callback)
128
+ return __result
129
+ }
130
+
131
+ @DoNotStrip
132
+ @Keep
133
+ abstract fun imapStopIdle(): Promise<Unit>
134
+
135
+ @DoNotStrip
136
+ @Keep
137
+ abstract fun imapGetQuota(root: String?): Promise<QuotaInfo>
138
+
139
+ @DoNotStrip
140
+ @Keep
141
+ abstract fun imapAppendMessage(mailbox: String, rawMimeData: ArrayBuffer, flags: Array<String>?): Promise<AppendResult>
142
+
143
+ @DoNotStrip
144
+ @Keep
145
+ abstract fun smtpConnect(config: SmtpConnectionConfig): Promise<ConnectionResult>
146
+
147
+ @DoNotStrip
148
+ @Keep
149
+ abstract fun smtpDisconnect(): Promise<Unit>
150
+
151
+ @DoNotStrip
152
+ @Keep
153
+ abstract fun smtpSendMail(options: SendMailOptions): Promise<SendMailResult>
154
+
155
+ @DoNotStrip
156
+ @Keep
157
+ abstract fun smtpVerifyConnection(): Promise<Boolean>
158
+
159
+ // Default implementation of `HybridObject.toString()`
160
+ override fun toString(): String {
161
+ return "[HybridObject EmailImapSmtp]"
162
+ }
163
+
164
+ // C++ backing class
165
+ @DoNotStrip
166
+ @Keep
167
+ protected open class CxxPart(javaPart: HybridEmailImapSmtpSpec): HybridObject.CxxPart(javaPart) {
168
+ // C++ JHybridEmailImapSmtpSpec::CxxPart::initHybrid(...)
169
+ external override fun initHybrid(): HybridData
170
+ }
171
+ override fun createCxxPart(): CxxPart {
172
+ return CxxPart(this)
173
+ }
174
+
175
+ companion object {
176
+ protected const val TAG = "HybridEmailImapSmtpSpec"
177
+ }
178
+ }
@@ -0,0 +1,76 @@
1
+ ///
2
+ /// IdleNotification.kt
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
+ package com.margelo.nitro.emailimapsmtp
9
+
10
+ import androidx.annotation.Keep
11
+ import com.facebook.proguard.annotations.DoNotStrip
12
+ import java.util.Objects
13
+
14
+
15
+ /**
16
+ * Represents the JavaScript object/struct "IdleNotification".
17
+ */
18
+ @DoNotStrip
19
+ @Keep
20
+ data class IdleNotification(
21
+ @DoNotStrip
22
+ @Keep
23
+ val type: String,
24
+ @DoNotStrip
25
+ @Keep
26
+ val mailbox: String,
27
+ @DoNotStrip
28
+ @Keep
29
+ val uid: Double?,
30
+ @DoNotStrip
31
+ @Keep
32
+ val flag: String?,
33
+ @DoNotStrip
34
+ @Keep
35
+ val messageCount: Double?,
36
+ @DoNotStrip
37
+ @Keep
38
+ val timestamp: Double
39
+ ) {
40
+ /* primary constructor */
41
+
42
+ override fun equals(other: Any?): Boolean {
43
+ if (this === other) return true
44
+ if (other !is IdleNotification) return false
45
+ return Objects.deepEquals(this.type, other.type)
46
+ && Objects.deepEquals(this.mailbox, other.mailbox)
47
+ && Objects.deepEquals(this.uid, other.uid)
48
+ && Objects.deepEquals(this.flag, other.flag)
49
+ && Objects.deepEquals(this.messageCount, other.messageCount)
50
+ && Objects.deepEquals(this.timestamp, other.timestamp)
51
+ }
52
+
53
+ override fun hashCode(): Int {
54
+ return arrayOf<Any?>(
55
+ type,
56
+ mailbox,
57
+ uid,
58
+ flag,
59
+ messageCount,
60
+ timestamp
61
+ ).contentDeepHashCode()
62
+ }
63
+
64
+ companion object {
65
+ /**
66
+ * Constructor called from C++
67
+ */
68
+ @DoNotStrip
69
+ @Keep
70
+ @Suppress("unused")
71
+ @JvmStatic
72
+ private fun fromCpp(type: String, mailbox: String, uid: Double?, flag: String?, messageCount: Double?, timestamp: Double): IdleNotification {
73
+ return IdleNotification(type, mailbox, uid, flag, messageCount, timestamp)
74
+ }
75
+ }
76
+ }