iobroker.imap 0.2.1 → 0.2.2

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/README.md CHANGED
@@ -58,6 +58,11 @@
58
58
  -->
59
59
 
60
60
  ## Changelog
61
+ ### 0.2.2 (2024-11-07)
62
+
63
+ - (Lucky-ESA) New design for settings page added
64
+ - (Lucky-ESA) Crash if uid is empty for new emails
65
+
61
66
  ### 0.2.1 (2024-09-16)
62
67
 
63
68
  - (Lucky-ESA) Update dependencies
@@ -1,6 +1,9 @@
1
1
  {
2
2
  "i18n": true,
3
3
  "type": "tabs",
4
+ "tabsStyle": {
5
+ "width": "calc(100% - 100px)"
6
+ },
4
7
  "items": {
5
8
  "tab1": {
6
9
  "type": "panel",
@@ -13,9 +16,13 @@
13
16
  },
14
17
  "hosts": {
15
18
  "newLine": true,
16
- "sm": 12,
17
19
  "noDelete": false,
18
20
  "type": "table",
21
+ "xs": 12,
22
+ "sm": 12,
23
+ "md": 12,
24
+ "lg": 12,
25
+ "xl": 12,
19
26
  "items": [
20
27
  {
21
28
  "type": "checkbox",
@@ -258,7 +265,11 @@
258
265
  "max_mb": {
259
266
  "type": "number",
260
267
  "newLine": true,
261
- "sm": 3,
268
+ "xs": 12,
269
+ "sm": 12,
270
+ "md": 6,
271
+ "lg": 4,
272
+ "xl": 4,
262
273
  "label": "MAX_MB",
263
274
  "default": 400,
264
275
  "min": 100,
@@ -268,9 +279,11 @@
268
279
  "max_mb_selection": {
269
280
  "type": "select",
270
281
  "newLine": true,
282
+ "xs": 12,
271
283
  "sm": 12,
272
284
  "md": 6,
273
- "lg": 3,
285
+ "lg": 4,
286
+ "xl": 4,
274
287
  "label": "selection",
275
288
  "default": 2,
276
289
  "options": [
@@ -287,9 +300,11 @@
287
300
  "disabled": "data.max_mb_selection !== 1",
288
301
  "hidden": "data.max_mb_selection !== 1",
289
302
  "hideOnlyControl": false,
303
+ "xs": 12,
290
304
  "sm": 12,
291
305
  "md": 6,
292
- "lg": 3,
306
+ "lg": 4,
307
+ "xl": 4,
293
308
  "default": ""
294
309
  },
295
310
  "max_mb_telegram_user": {
@@ -300,9 +315,11 @@
300
315
  "disabled": "data.max_mb_selection !== 1",
301
316
  "hidden": "data.max_mb_selection !== 1",
302
317
  "hideOnlyControl": false,
318
+ "xs": 12,
303
319
  "sm": 12,
304
320
  "md": 6,
305
- "lg": 3,
321
+ "lg": 4,
322
+ "xl": 4,
306
323
  "default": ""
307
324
  },
308
325
  "max_mb_object": {
@@ -312,9 +329,11 @@
312
329
  "disabled": "data.max_mb_selection !== 3",
313
330
  "hidden": "data.max_mb_selection !== 3",
314
331
  "hideOnlyControl": false,
332
+ "xs": 12,
315
333
  "sm": 12,
316
334
  "md": 6,
317
- "lg": 3,
335
+ "lg": 4,
336
+ "xl": 4,
318
337
  "default": ""
319
338
  }
320
339
  }
@@ -329,9 +348,11 @@
329
348
  "size": 2
330
349
  },
331
350
  "icons": {
351
+ "xs": 12,
332
352
  "sm": 12,
333
353
  "md": 12,
334
354
  "lg": 12,
355
+ "xl": 12,
335
356
  "noDelete": false,
336
357
  "type": "table",
337
358
  "style": {
@@ -351,8 +372,6 @@
351
372
  {
352
373
  "type": "image",
353
374
  "attr": "picture",
354
- "width": "50%",
355
- "title": "upload",
356
375
  "tooltip": "UPLOAD",
357
376
  "accept": "image/*",
358
377
  "base64": true,
@@ -373,9 +392,11 @@
373
392
  "size": 2
374
393
  },
375
394
  "oauth_token": {
395
+ "xs": 12,
376
396
  "sm": 12,
377
397
  "md": 12,
378
398
  "lg": 12,
399
+ "xl": 12,
379
400
  "noDelete": false,
380
401
  "type": "table",
381
402
  "style": {
@@ -456,9 +477,11 @@
456
477
  "size": 2
457
478
  },
458
479
  "nodemailer_options": {
480
+ "xs": 12,
459
481
  "sm": 12,
460
482
  "md": 12,
461
483
  "lg": 12,
484
+ "xl": 12,
462
485
  "noDelete": false,
463
486
  "type": "table",
464
487
  "style": {
package/io-package.json CHANGED
@@ -1,8 +1,21 @@
1
1
  {
2
2
  "common": {
3
3
  "name": "imap",
4
- "version": "0.2.1",
4
+ "version": "0.2.2",
5
5
  "news": {
6
+ "0.2.2": {
7
+ "en": "New design for settings page added\nCrash if uid is empty for new emails",
8
+ "de": "Neues Design für Einstellungen Seite hinzugefügt\nCrash wenn uid für neue E-Mails leer ist",
9
+ "ru": "Новый дизайн добавлена страница настроек\nCrash, если uid пуст для новых электронных писем",
10
+ "pt": "Novo design para configurações página adicionada\nCrash se uid está vazio para novos e-mails",
11
+ "nl": "Nieuw ontwerp voor instellingen pagina toegevoegd\nCrashen als uid leeg is voor nieuwe e-mails",
12
+ "fr": "Nouvelle conception pour les paramètres page ajoutée\nCrash si uid est vide pour les nouveaux emails",
13
+ "it": "Nuovo design per le impostazioni pagina aggiunto\nCrash se uid è vuoto per nuove email",
14
+ "es": "Nuevo diseño para la página de configuración añadido\nCrash si uid está vacío para nuevos correos electrónicos",
15
+ "pl": "Dodano nowy projekt strony ustawień\nCrash jeśli uid jest pusty dla nowych e-maili",
16
+ "uk": "Новий дизайн для сторінки налаштувань\nЯкщо у вас є порожній для нових електронних листів",
17
+ "zh-cn": "添加了设置页面的新设计\n如果 uid 为新邮件空则崩溃"
18
+ },
6
19
  "0.2.1": {
7
20
  "en": "Update dependencies\nChanged Log info to debug\nFixed blockly setFlag crash",
8
21
  "de": "Abhängigkeiten aktualisieren\nGeändert Log info to debug\nFester Blocksatz Flaggenabsturz",
@@ -80,19 +93,6 @@
80
93
  "pl": "Zużycie pamięci RAM - Instance Settings (ang.)\nDokumentacja germanna\nAdded Mailparser option\nAdded counter history\nBug",
81
94
  "uk": "Додано споживання оперативної пам'яті - Налаштування\nДодана німецька документація\nДодано параметри парсера електронної пошти\nІсторія лічильника\nВиправлення помилок",
82
95
  "zh-cn": "增加分期消费-包装\n增 录\n增加无期选择\n增加反历史\nBug fix"
83
- },
84
- "0.0.9": {
85
- "en": "Fixed RAM consumption of new emails\nAdded counter attachments in JSON",
86
- "de": "Fester RAM-Verbrauch neuer E-Mails\nHinzufügen von Zähleraufsätzen in JSON",
87
- "ru": "Фиксированное потребление RAM новых писем\nДобавлены вложения счетчиков в JSON",
88
- "pt": "Consumo de RAM fixo de novos e-mails\nAdicionado contra anexos em JSON",
89
- "nl": "Vertaling:\nVertaling:",
90
- "fr": "Consommation de RAM fixe de nouveaux emails\nAjout de pièces jointes dans JSON",
91
- "it": "Risolto consumo di RAM di nuove email\nAggiunto accessori contatore in JSON",
92
- "es": "Consumo de RAM fijo de nuevos correos electrónicos\nAgregados contadores en JSON",
93
- "pl": "Zużycie pamięci RAM nowej e-maili\nAdded counter przywiązania w JSON",
94
- "uk": "Виправлено споживання оперативної пам'яті нових електронних листів\nДодано лічильник вкладення в JSON",
95
- "zh-cn": "新电子邮件的分期消费\n增加联索行动内的反附属"
96
96
  }
97
97
  },
98
98
  "titleLang": {
package/lib/imap_event.js CHANGED
@@ -501,9 +501,10 @@ module.exports = {
501
501
  this.setUpdate(client, { flags: [], new_mail: count }, "new mail");
502
502
  const inbox = this.clientsRaw[client].inbox_activ;
503
503
  const new_mail = await this.loadAllSeqno(client, inbox, true);
504
- let nextuid = this.diffArray(this.clientsRaw[client][inbox], new_mail, 2, client);
504
+ const uidNext = this.clientsRaw[client][inbox] != null ? this.clientsRaw[client][inbox] : [box.uidnext];
505
+ let nextuid = this.diffArray(uidNext, new_mail, 2, client);
505
506
  this.clientsRaw[client][inbox] = new_mail;
506
- if (nextuid.length === 0) {
507
+ if (nextuid === 0 || nextuid.length === 0) {
507
508
  nextuid = [box.uidnext];
508
509
  }
509
510
  if (this.clients[client].serverSupports("SORT")) {
@@ -537,6 +538,7 @@ module.exports = {
537
538
  */
538
539
  newMails(client, uid, what, sort) {
539
540
  this.log.debug(sort);
541
+ this.log.debug("newMail: " + JSON.stringify(uid));
540
542
  for (const uids of uid) {
541
543
  let attrs;
542
544
  let header_mail;
package/main.js CHANGED
@@ -1808,7 +1808,7 @@ class Imap extends utils.Adapter {
1808
1808
  </tbody>
1809
1809
  `;
1810
1810
  const htmlEnd = `</table></div></body></html>`;
1811
- await this.setStateAsync(`${ident}.html`, {
1811
+ await this.setState(`${ident}.html`, {
1812
1812
  val: htmlStart + htmlEnd,
1813
1813
  ack: true,
1814
1814
  });
@@ -2050,7 +2050,7 @@ class Imap extends utils.Adapter {
2050
2050
  }
2051
2051
  } else if (this.config.max_mb_selection === 3) {
2052
2052
  if (this.config.max_mb_object != "") {
2053
- await this.setStateAsync(this.config.max_mb_object, true, false);
2053
+ await this.setState(this.config.max_mb_object, true, false);
2054
2054
  this.log_translator("info", "Restart Adapter Text", memrss_value);
2055
2055
  } else {
2056
2056
  this.log_translator("info", "Restart Adapter Text NO DP", memrss_value);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iobroker.imap",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "imap to receive your emails",
5
5
  "author": {
6
6
  "name": "Lucky-ESA",
@@ -23,7 +23,7 @@
23
23
  "node": ">= 18"
24
24
  },
25
25
  "dependencies": {
26
- "@iobroker/adapter-core": "^3.1.6",
26
+ "@iobroker/adapter-core": "^3.2.2",
27
27
  "mailparser": "^3.7.1",
28
28
  "node-imap": "^0.9.6"
29
29
  },
@@ -33,27 +33,27 @@
33
33
  "@alcalzone/release-script-plugin-license": "^3.7.0",
34
34
  "@alcalzone/release-script-plugin-manual-review": "^3.7.0",
35
35
  "@iobroker/adapter-dev": "^1.3.0",
36
- "@iobroker/testing": "^4.1.3",
36
+ "@iobroker/testing": "^5.0.0",
37
37
  "@tsconfig/node18": "^18.2.4",
38
- "@types/chai": "^4.3.19",
39
- "@types/chai-as-promised": "^8.0.0",
40
- "@types/imap": "^0.8.40",
41
- "@types/mocha": "^10.0.8",
42
- "@types/node": "^22.5.5",
38
+ "@types/chai": "^4.3.20",
39
+ "@types/chai-as-promised": "^8.0.1",
40
+ "@types/imap": "^0.8.42",
41
+ "@types/mocha": "^10.0.9",
42
+ "@types/node": "^22.9.0",
43
43
  "@types/proxyquire": "^1.3.31",
44
44
  "@types/sinon": "^17.0.3",
45
45
  "@types/sinon-chai": "^3.2.12",
46
46
  "chai": "^4.5.0",
47
47
  "chai-as-promised": "^8.0.0",
48
- "eslint": "^8.57.0",
48
+ "eslint": "^8.57.1",
49
49
  "eslint-config-prettier": "^9.1.0",
50
50
  "eslint-plugin-prettier": "^5.2.1",
51
- "mocha": "^10.7.3",
51
+ "mocha": "^10.8.2",
52
52
  "prettier": "^3.3.3",
53
53
  "proxyquire": "^2.1.3",
54
- "sinon": "^18.0.1",
54
+ "sinon": "^19.0.2",
55
55
  "sinon-chai": "^3.7.0",
56
- "typescript": "~5.4.5"
56
+ "typescript": "~5.6.2"
57
57
  },
58
58
  "main": "main.js",
59
59
  "files": [