iobroker.parcel 0.2.10 → 0.3.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/README.md CHANGED
@@ -62,6 +62,11 @@ Den Datenpunkt parcel.0.dhl.briefe....image ein "String img src" element als Obj
62
62
  <https://forum.iobroker.net/topic/51795/test-adapter-parcel-paketverfolgung-dhl-v0-0-1>
63
63
 
64
64
  ## Changelog
65
+ ### 0.3.0 (2026-04-05)
66
+
67
+ - DHL: Neuer Login über Browser-Code (dhllogin://)
68
+ - Amazon: Login Fix und Captcha-Erkennung mit Hinweis
69
+
65
70
  ### 0.2.10 (2025-01-15)
66
71
 
67
72
  - add alternative way for dhl login
@@ -99,38 +99,24 @@
99
99
 
100
100
  <div class="row">
101
101
  <div class="col"><h5>DHL</h5></div>
102
- </div>
103
- <div class="row">
104
- <div class="col s6 input-field">
105
- <input type="text" class="value" id="dhlusername" />
106
- <label for="dhlusername" class="translate">App Email</label>
107
- </div>
108
- </div>
109
- <div class="row">
110
- <div class="col s6 input-field">
111
- <input type="password" class="value" id="dhlpassword" />
112
- <label for="dhlpassword" class="translate">App Password</label>
113
- </div>
114
- </div>
115
- <div class="row">
116
- <div class="col s6 input-field">
117
- <input type="text" class="value" id="dhlMfa" />
118
- <label for="dhlMfa" class="translate">SMS/Mail Pin nach erstem Start</label>
102
+ <div class="col">
103
+ <input type="checkbox" class="value" id="dhlActive" />
104
+ <label for="dhlActive" class="translate">Aktiviert</label>
119
105
  </div>
120
106
  </div>
121
107
  <div class="row">
122
108
  <div class="col s6 input-field" id="captchaResponse">
123
- If normal login is not working alternate DHL login method is available
109
+ Login über Browser-Code:
124
110
  <p></p>
125
- 1. Open the Url below in Chrome and login with your account
111
+ 1. Unten auf den Link klicken und im CHROME Browser einloggen
126
112
  <p></p>
127
- 2. Open Developer Console F12 or Option + Command + I
113
+ 2. Developer Console öffnen: F12 oder Option + Command + I
128
114
  <p></p>
129
- 3. You see a failed redirect in the Console copy the dhllogin:// url
115
+ 3. Im Console-Tab die fehlgeschlagene Weiterleitung sehen und die dhllogin:// URL kopieren
130
116
  <p></p>
131
117
  <img src="copyurl.png" style="width: 30rem" />
132
118
  <p></p>
133
- 4. Paste the url in the input field below
119
+ 4. Die URL unten einfügen und speichern
134
120
 
135
121
  <p></p>
136
122
  <p></p>
@@ -138,7 +124,7 @@
138
124
  href="https://login.dhl.de/af5f9bb6-27ad-4af4-9445-008e7a5cddb8/login/authorize?redirect_uri=dhllogin://de.deutschepost.dhl/login&state=eyJycyI6dHJ1ZSwicnYiOmZhbHNlLCJmaWQiOiJhcHAtbG9naW4tbWVoci1mb290ZXIiLCJoaWQiOiJhcHAtbG9naW4tbWVoci1oZWFkZXIiLCJycCI6ZmFsc2V9&client_id=83471082-5c13-4fce-8dcb-19d2a3fca413&response_type=code&scope=openid%20offline_access&claims=%7B%22id_token%22:%7B%22email%22:null,%22post_number%22:null,%22twofa%22:null,%22service_mask%22:null,%22deactivate_account%22:null,%22last_login%22:null,%22customer_type%22:null,%22display_name%22:null,%22data_confirmation_required%22:null%7D%7D&nonce=&login_hint=&prompt=login&ui_locales=de-DE&code_challenge=MAhrhXXZP-Owy-R7ruyB7Fn-Z8ODW6qxCoHg4uXELCw&code_challenge_method=S256"
139
125
  target="_blank"
140
126
  style="color: red !important"
141
- >DHL Login Url CLICK HERE</a
127
+ >DHL Login URL HIER KLICKEN</a
142
128
  >
143
129
  <p></p>
144
130
  <input type="text" class="value" id="dhlCode" placeholder="dhllogin://de.deutschepost.dhl/login?code=Jqbzy3wbJ..." />
@@ -147,6 +133,10 @@
147
133
  </div>
148
134
  <div class="row">
149
135
  <div class="col"><h5>Amazon</h5></div>
136
+ <div class="col">
137
+ <input type="checkbox" class="value" id="amzActive" />
138
+ <label for="amzActive" class="translate">Aktiviert</label>
139
+ </div>
150
140
  </div>
151
141
  <div class="row">
152
142
  <div class="col s6 input-field">
@@ -167,8 +157,32 @@
167
157
  <label for="amzotp" class="translate">Amazon OTP Token vor dem Login eingeben. 2FA Aktivierung ist Empfohlen.</label>
168
158
  </div>
169
159
  </div>
160
+ <div class="row">
161
+ <div class="col s6">
162
+ <div>
163
+ <input type="checkbox" class="value" id="amzResetCookies" />
164
+ <label for="amzResetCookies" class="translate">Amazon Cookies beim nächsten Start löschen (bei Login-Problemen)</label>
165
+ </div>
166
+ </div>
167
+ </div>
168
+ <div class="row">
169
+ <div class="col s6 input-field">
170
+ Um den Login zu erleichtern oder Captchas zu verhindern, einmal im Browser abmelden und mit Passwort einloggen:
171
+ <p></p>
172
+ <a
173
+ href="https://www.amazon.de/ap/signin?_encoding=UTF8&openid.assoc_handle=deflex&openid.claimed_id=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0%2Fidentifier_select&openid.identity=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0%2Fidentifier_select&openid.mode=checkid_setup&openid.ns=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0&openid.return_to=https%3A%2F%2Fwww.amazon.de&switch_account=signin&ignoreAuthState=1&disableLoginPrepopulate=1"
174
+ target="_blank"
175
+ style="color: red !important"
176
+ >Amazon Login CLICK HERE</a
177
+ >
178
+ </div>
179
+ </div>
170
180
  <div class="row">
171
181
  <div class="col"><h5>DPD</h5></div>
182
+ <div class="col">
183
+ <input type="checkbox" class="value" id="dpdActive" />
184
+ <label for="dpdActive" class="translate">Aktiviert</label>
185
+ </div>
172
186
  </div>
173
187
  <div class="row">
174
188
  <div class="col s6 input-field">
@@ -184,6 +198,10 @@
184
198
  </div>
185
199
  <div class="row">
186
200
  <div class="col"><h5>GLS</h5></div>
201
+ <div class="col">
202
+ <input type="checkbox" class="value" id="glsActive" />
203
+ <label for="glsActive" class="translate">Aktiviert</label>
204
+ </div>
187
205
  </div>
188
206
  <div class="row">
189
207
  <div class="col s6 input-field">
@@ -199,6 +217,10 @@
199
217
  </div>
200
218
  <div class="row">
201
219
  <div class="col"><h5>Hermes</h5></div>
220
+ <div class="col">
221
+ <input type="checkbox" class="value" id="hermesActive" />
222
+ <label for="hermesActive" class="translate">Aktiviert</label>
223
+ </div>
202
224
  </div>
203
225
  <div class="row">
204
226
  <div class="col s6 input-field">
@@ -214,6 +236,10 @@
214
236
  </div>
215
237
  <div class="row">
216
238
  <div class="col"><h5>UPS</h5></div>
239
+ <div class="col">
240
+ <input type="checkbox" class="value" id="upsActive" />
241
+ <label for="upsActive" class="translate">Aktiviert</label>
242
+ </div>
217
243
  </div>
218
244
  <div class="row">
219
245
  <div class="col s6 input-field">
@@ -229,6 +255,10 @@
229
255
  </div>
230
256
  <div class="row">
231
257
  <div class="col"><h5>17Track Normal User</h5></div>
258
+ <div class="col">
259
+ <input type="checkbox" class="value" id="t17Active" />
260
+ <label for="t17Active" class="translate">Aktiviert</label>
261
+ </div>
232
262
  </div>
233
263
  <div class="row">
234
264
  <div class="col s6 input-field">
@@ -245,6 +275,9 @@
245
275
  <div class="row">
246
276
  <div class="col">
247
277
  <div><h5>17Track</h5></div>
278
+ <input type="checkbox" class="value" id="t17ApiActive" />
279
+ <label for="t17ApiActive" class="translate">Aktiviert</label>
280
+ <p></p>
248
281
  <a href="https://api.17track.net/en/admin/settings" target="_blank">Register HERE to receive a API Key</a>
249
282
  </div>
250
283
  </div>
package/io-package.json CHANGED
@@ -1,8 +1,21 @@
1
1
  {
2
2
  "common": {
3
3
  "name": "parcel",
4
- "version": "0.2.10",
4
+ "version": "0.3.0",
5
5
  "news": {
6
+ "0.3.0": {
7
+ "en": "DHL: Neuer Login über Browser-Code (dhllogin://)\nAmazon: Login Fix und Captcha-Erkennung mit Hinweis",
8
+ "de": "DHL: Neuer Login über Browser-Code (dhllogin://)\nAmazon: Login Fix und Captcha-Erkennung mit Hinweis",
9
+ "ru": "DHL: Neuer Login über Browser-Code (dhllogin://)\nAmazon: Login Fix und Captcha-Erkennung mit Hinweis",
10
+ "pt": "DHL: Neuer Login über Browser-Code (dhllogin://)\nAmazon: Login Fix und Captcha-Erkennung mit Hinweis",
11
+ "nl": "DHL: Neuer Login über Browser-Code (dhllogin://)\nAmazon: Login Fix und Captcha-Erkennung mit Hinweis",
12
+ "fr": "DHL: Neuer Login über Browser-Code (dhllogin://)\nAmazon: Connexion Fix und Captcha-Erkennung mit Hinweis",
13
+ "it": "DHL: Neuer Login über Browser-Code (dhllogin://)\nAmazon: Login Fix und Captcha-Erkennung mit Hinweis",
14
+ "es": "DHL: Neuer Login über Browser-Code (dhllogin://)\nAmazon: Acceder Fijar und Captcha-Erkennung mit Hinweis",
15
+ "pl": "DHL: Neuer Login über Browser- Code (dhllogin: / /)\nAmazon: Login Fix und Captcha- Erkennung mit Hinweis",
16
+ "uk": "DHL: Нейєр Логін über Browser-Code (dhllogin://)\nУкраїнська Русский English",
17
+ "zh-cn": "DHL: Neuer Login über 浏览器-代码 (dhllogin://)\n亚马逊:登录 修复 und Captcha- Erkennung mit Hinweis 系统"
18
+ },
6
19
  "0.2.10": {
7
20
  "en": "add alternative way for dhl login\nmove dhl connections error to info level",
8
21
  "de": "alternative möglichkeit für dhl anmelden\ndhl-verbindungen fehler auf info-ebene verschieben",
@@ -62,10 +75,6 @@
62
75
  "0.2.6": {
63
76
  "en": "Improve DHL Status and add link to shipment in the telegram notification",
64
77
  "de": "Verbesserung des DHL Status und Link zur Sendung in der Telegram Benachrichtigung hinzugefügt"
65
- },
66
- "0.2.2": {
67
- "en": "Improvment for Amazon Login and fix for Briefaanündigung Image",
68
- "de": "Verbesserung für Amazon Login und Fix für Briefankündigung Image State"
69
78
  }
70
79
  },
71
80
  "title": "Parcel tracking",
@@ -142,7 +151,6 @@
142
151
  ]
143
152
  },
144
153
  "encryptedNative": [
145
- "dhlpassword",
146
154
  "amzpassword",
147
155
  "dpdpassword",
148
156
  "t17password",
@@ -153,7 +161,6 @@
153
161
  "glspassword"
154
162
  ],
155
163
  "protectedNative": [
156
- "dhlpassword",
157
164
  "amzpassword",
158
165
  "dpdpassword",
159
166
  "t17password",
@@ -164,6 +171,14 @@
164
171
  "glspassword"
165
172
  ],
166
173
  "native": {
174
+ "dhlActive": true,
175
+ "amzActive": true,
176
+ "dpdActive": true,
177
+ "glsActive": true,
178
+ "upsActive": true,
179
+ "hermesActive": true,
180
+ "t17Active": true,
181
+ "t17ApiActive": true,
167
182
  "amzusername": "",
168
183
  "amzpassword": "",
169
184
  "aliUsername": "",
@@ -180,14 +195,12 @@
180
195
  "postatusername": "",
181
196
  "postatpassword": "",
182
197
  "amzotp": "",
198
+ "amzResetCookies": false,
183
199
  "t17username": "",
184
200
  "t17password": "",
185
201
  "dpdusername": "",
186
202
  "dpdpassword": "",
187
- "dhlusername": "",
188
- "dhlpassword": "",
189
203
  "dhlCode": "",
190
- "dhlMfa": "",
191
204
  "17trackKey": "",
192
205
  "sendToActive": false,
193
206
  "noFirstStartSend": false,
@@ -300,18 +313,6 @@
300
313
  },
301
314
  "native": {}
302
315
  },
303
- {
304
- "_id": "auth.dhlMfaToken",
305
- "type": "state",
306
- "common": {
307
- "role": "state",
308
- "name": "DHL Mfa Token",
309
- "type": "string",
310
- "read": true,
311
- "write": false
312
- },
313
- "native": {}
314
- },
315
316
  {
316
317
  "_id": "auth.cookie",
317
318
  "type": "state",
@@ -0,0 +1,70 @@
1
+ 'use strict';
2
+
3
+ const qs = require('qs');
4
+
5
+ // Fixed PKCE pair matching the login URL in admin settings
6
+ const CODE_VERIFIER = 'zmVs5AKfGvv45a9aUvuOid9a_erOirp7XL1sn9kWT_o';
7
+
8
+ /**
9
+ * DHL Login via dhllogin:// code (manual browser flow).
10
+ * User opens the DHL login URL in browser, logs in, copies the dhllogin:// redirect URL.
11
+ *
12
+ * @param {object} options
13
+ * @param {function} options.requestClient - axios-like request function
14
+ * @param {string} options.dhlCode - dhllogin://de.deutschepost.dhl/login?code=...
15
+ * @param {object} [options.log] - logger with .info/.debug/.error/.warn
16
+ * @returns {Promise<object|null>} session data (with id_token, refresh_token, etc.) or null on failure
17
+ */
18
+ async function loginDhlNew({ requestClient, dhlCode, log }) {
19
+ if (!log) {
20
+ log = { info: console.log, debug: console.log, error: console.error, warn: console.warn };
21
+ }
22
+
23
+ if (!dhlCode || !dhlCode.startsWith('dhllogin://')) {
24
+ log.error('No valid dhllogin:// code provided. Please use the login button in adapter settings.');
25
+ return null;
26
+ }
27
+
28
+ const codeUrl = qs.parse(dhlCode.split('?')[1]);
29
+ if (!codeUrl.code) {
30
+ log.error('No code found in dhllogin:// URL');
31
+ return null;
32
+ }
33
+
34
+ const sessionData = await requestClient({
35
+ method: 'post',
36
+ url: 'https://login.dhl.de/af5f9bb6-27ad-4af4-9445-008e7a5cddb8/login/token',
37
+ headers: {
38
+ Host: 'login.dhl.de',
39
+ 'Content-Type': 'application/x-www-form-urlencoded',
40
+ Accept: 'application/json, text/plain, */*',
41
+ Origin: 'https://login.dhl.de',
42
+ Connection: 'keep-alive',
43
+ Authorization: 'Basic ODM0NzEwODItNWMxMy00ZmNlLThkY2ItMTlkMmEzZmNhNDEzOg==',
44
+ 'User-Agent': 'DHLPaket_PROD/1367 CFNetwork/1240.0.4 Darwin/20.6.0',
45
+ 'Accept-Language': 'de-de',
46
+ },
47
+ data: {
48
+ redirect_uri: 'dhllogin://de.deutschepost.dhl/login',
49
+ grant_type: 'authorization_code',
50
+ code_verifier: CODE_VERIFIER,
51
+ code: codeUrl.code,
52
+ },
53
+ })
54
+ .then(async (res) => {
55
+ log.debug(JSON.stringify(res.data));
56
+ log.info('Login to DHL successful');
57
+ return res.data;
58
+ })
59
+ .catch((error) => {
60
+ log.error(error);
61
+ if (error.response) {
62
+ log.error(JSON.stringify(error.response.data));
63
+ }
64
+ return null;
65
+ });
66
+
67
+ return sessionData;
68
+ }
69
+
70
+ module.exports = { loginDhlNew };
package/lib/tools.js CHANGED
@@ -65,7 +65,7 @@ async function translateYandex(text, targetLang, apiKey) {
65
65
  }
66
66
  throw new Error('Invalid response for translate request');
67
67
  } catch (e) {
68
- throw new Error(`Could not translate to "${targetLang}": ${e}`);
68
+ throw new Error(`Could not translate to "${targetLang}": ${e}`, { cause: e });
69
69
  }
70
70
  }
71
71
 
@@ -88,9 +88,9 @@ async function translateGoogle(text, targetLang) {
88
88
  throw new Error('Invalid response for translate request');
89
89
  } catch (e) {
90
90
  if (e.response && e.response.status === 429) {
91
- throw new Error(`Could not translate to "${targetLang}": Rate-limited by Google Translate`);
91
+ throw new Error(`Could not translate to "${targetLang}": Rate-limited by Google Translate`, { cause: e });
92
92
  } else {
93
- throw new Error(`Could not translate to "${targetLang}": ${e}`);
93
+ throw new Error(`Could not translate to "${targetLang}": ${e}`, { cause: e });
94
94
  }
95
95
  }
96
96
  }