@plugin-light/shared 1.0.14 → 1.0.15

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.
@@ -16,7 +16,7 @@
16
16
  export interface ImapConfig {
17
17
  /** IMAP 服务器地址,例如 'imap.exmail.qq.com' */
18
18
  host: string;
19
- /** IMAP 端口,默认 143(STARTTLS)或 993(隐式 TLS) */
19
+ /** IMAP 端口,默认 993(STARTTLS)或 993(隐式 TLS) */
20
20
  port?: number;
21
21
  /** 是否使用隐式 TLS(端口 993),默认 false(使用 STARTTLS) */
22
22
  secure?: boolean;
package/lib/index.js CHANGED
@@ -359,7 +359,7 @@ const turndown = new TurndownService__default["default"]({
359
359
  * ```
360
360
  */
361
361
  async function watchEmails(options) {
362
- const { host, port = 143, user, password, mailbox = 'INBOX', onNewEmail, onError, onConnected, onDisconnected, autoReconnect = true, reconnectInterval = 5000, maxReconnectAttempts = Infinity, debug = false, } = options;
362
+ const { host, port = 993, user, password, mailbox = 'INBOX', onNewEmail, onError, onConnected, onDisconnected, autoReconnect = true, reconnectInterval = 5000, maxReconnectAttempts = Infinity, debug = false, secure = true, } = options;
363
363
  let client = null;
364
364
  let connected = false;
365
365
  let stopped = false;
@@ -371,11 +371,11 @@ async function watchEmails(options) {
371
371
  async function connect() {
372
372
  if (stopped)
373
373
  return;
374
- const secure = options.secure ?? (port === 993);
374
+ const tSecure = secure ?? (port === 993);
375
375
  client = new imapflow.ImapFlow({
376
376
  host,
377
377
  port,
378
- secure,
378
+ secure: tSecure,
379
379
  auth: { user, pass: password },
380
380
  logger: debug ? console : false,
381
381
  tls: {
package/lib/index.mjs CHANGED
@@ -328,7 +328,7 @@ const turndown = new TurndownService({
328
328
  * ```
329
329
  */
330
330
  async function watchEmails(options) {
331
- const { host, port = 143, user, password, mailbox = 'INBOX', onNewEmail, onError, onConnected, onDisconnected, autoReconnect = true, reconnectInterval = 5000, maxReconnectAttempts = Infinity, debug = false, } = options;
331
+ const { host, port = 993, user, password, mailbox = 'INBOX', onNewEmail, onError, onConnected, onDisconnected, autoReconnect = true, reconnectInterval = 5000, maxReconnectAttempts = Infinity, debug = false, secure = true, } = options;
332
332
  let client = null;
333
333
  let connected = false;
334
334
  let stopped = false;
@@ -340,11 +340,11 @@ async function watchEmails(options) {
340
340
  async function connect() {
341
341
  if (stopped)
342
342
  return;
343
- const secure = options.secure ?? (port === 993);
343
+ const tSecure = secure ?? (port === 993);
344
344
  client = new ImapFlow({
345
345
  host,
346
346
  port,
347
- secure,
347
+ secure: tSecure,
348
348
  auth: { user, pass: password },
349
349
  logger: debug ? console : false,
350
350
  tls: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plugin-light/shared",
3
- "version": "1.0.14",
3
+ "version": "1.0.15",
4
4
  "homepage": "https://novlan1.github.io/docs/plugin-light/zh/plugin-light-shared.html",
5
5
  "bugs": {
6
6
  "url": "https://github.com/novlan1/plugin-light/issues"