iobroker.parcel 0.0.9 → 0.0.12
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/io-package.json +22 -4
- package/lib/rsaKey.js +605 -0
- package/main.js +370 -43
- package/package.json +5 -6
package/io-package.json
CHANGED
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"common": {
|
|
3
3
|
"name": "parcel",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.12",
|
|
5
5
|
"news": {
|
|
6
|
-
"0.0.
|
|
6
|
+
"0.0.12": {
|
|
7
|
+
"en": "Add delivery status"
|
|
8
|
+
},
|
|
9
|
+
"0.0.11": {
|
|
10
|
+
"en": "Briefankündigung wird gestoppt, falls sie nicht funktioniert"
|
|
11
|
+
},
|
|
12
|
+
"0.0.10": {
|
|
7
13
|
"en": "in Zustellung DP, DPD Bugfix, detailierte DPs für Amazon, Option für keine Benachrichtigung bei Adapterstart"
|
|
8
14
|
},
|
|
9
15
|
"0.0.8": {
|
|
@@ -84,7 +90,7 @@
|
|
|
84
90
|
"materialize": true,
|
|
85
91
|
"plugins": {
|
|
86
92
|
"sentry": {
|
|
87
|
-
"dsn": ""
|
|
93
|
+
"dsn": "https://6296452769de44959c1809642564a7e3@sentry.iobroker.net/171"
|
|
88
94
|
}
|
|
89
95
|
},
|
|
90
96
|
"dependencies": [
|
|
@@ -186,13 +192,25 @@
|
|
|
186
192
|
"type": "state",
|
|
187
193
|
"common": {
|
|
188
194
|
"role": "json",
|
|
189
|
-
"name": "
|
|
195
|
+
"name": "Today in delivery/Heute in Zustellung",
|
|
190
196
|
"type": "string",
|
|
191
197
|
"read": true,
|
|
192
198
|
"write": false
|
|
193
199
|
},
|
|
194
200
|
"native": {}
|
|
195
201
|
},
|
|
202
|
+
{
|
|
203
|
+
"_id": "inDeliveryCount",
|
|
204
|
+
"type": "state",
|
|
205
|
+
"common": {
|
|
206
|
+
"role": "value",
|
|
207
|
+
"name": "Number of in delivery/Anzahl in Zustellung",
|
|
208
|
+
"type": "number",
|
|
209
|
+
"read": true,
|
|
210
|
+
"write": false
|
|
211
|
+
},
|
|
212
|
+
"native": {}
|
|
213
|
+
},
|
|
196
214
|
{
|
|
197
215
|
"_id": "auth",
|
|
198
216
|
"type": "channel",
|
package/lib/rsaKey.js
ADDED
|
@@ -0,0 +1,605 @@
|
|
|
1
|
+
const crypto = require('crypto');
|
|
2
|
+
const RSAKey = function() {
|
|
3
|
+
function a(a, b, c) {
|
|
4
|
+
null != a && ("number" == typeof a ? this.fromNumber(a, b, c) : null == b && "string" != typeof a ? this.fromString(a, 256) : this.fromString(a, b))
|
|
5
|
+
}
|
|
6
|
+
function b() {
|
|
7
|
+
return new a(null)
|
|
8
|
+
}
|
|
9
|
+
function c(a, b, c, d, e, f) {
|
|
10
|
+
for (; --f >= 0; ) {
|
|
11
|
+
var g = b * this[a++] + c[d] + e;
|
|
12
|
+
e = Math.floor(g / 67108864),
|
|
13
|
+
c[d++] = 67108863 & g
|
|
14
|
+
}
|
|
15
|
+
return e
|
|
16
|
+
}
|
|
17
|
+
function d(a, b, c, d, e, f) {
|
|
18
|
+
for (var g = 32767 & b, h = b >> 15; --f >= 0; ) {
|
|
19
|
+
var i = 32767 & this[a]
|
|
20
|
+
, j = this[a++] >> 15
|
|
21
|
+
, k = h * i + j * g;
|
|
22
|
+
i = g * i + ((32767 & k) << 15) + c[d] + (1073741823 & e),
|
|
23
|
+
e = (i >>> 30) + (k >>> 15) + h * j + (e >>> 30),
|
|
24
|
+
c[d++] = 1073741823 & i
|
|
25
|
+
}
|
|
26
|
+
return e
|
|
27
|
+
}
|
|
28
|
+
function e(a, b, c, d, e, f) {
|
|
29
|
+
for (var g = 16383 & b, h = b >> 14; --f >= 0; ) {
|
|
30
|
+
var i = 16383 & this[a]
|
|
31
|
+
, j = this[a++] >> 14
|
|
32
|
+
, k = h * i + j * g;
|
|
33
|
+
i = g * i + ((16383 & k) << 14) + c[d] + e,
|
|
34
|
+
e = (i >> 28) + (k >> 14) + h * j,
|
|
35
|
+
c[d++] = 268435455 & i
|
|
36
|
+
}
|
|
37
|
+
return e
|
|
38
|
+
}
|
|
39
|
+
function f(a) {
|
|
40
|
+
return ka.charAt(a)
|
|
41
|
+
}
|
|
42
|
+
function g(a, b) {
|
|
43
|
+
var c = la[a.charCodeAt(b)];
|
|
44
|
+
return null == c ? -1 : c
|
|
45
|
+
}
|
|
46
|
+
function h(a) {
|
|
47
|
+
for (var b = this.t - 1; b >= 0; --b)
|
|
48
|
+
a[b] = this[b];
|
|
49
|
+
a.t = this.t,
|
|
50
|
+
a.s = this.s
|
|
51
|
+
}
|
|
52
|
+
function i(a) {
|
|
53
|
+
this.t = 1,
|
|
54
|
+
this.s = 0 > a ? -1 : 0,
|
|
55
|
+
a > 0 ? this[0] = a : -1 > a ? this[0] = a + this.DV : this.t = 0
|
|
56
|
+
}
|
|
57
|
+
function j(a) {
|
|
58
|
+
var c = b();
|
|
59
|
+
return c.fromInt(a),
|
|
60
|
+
c
|
|
61
|
+
}
|
|
62
|
+
function k(b, c) {
|
|
63
|
+
var d;
|
|
64
|
+
if (16 == c)
|
|
65
|
+
d = 4;
|
|
66
|
+
else if (8 == c)
|
|
67
|
+
d = 3;
|
|
68
|
+
else if (256 == c)
|
|
69
|
+
d = 8;
|
|
70
|
+
else if (2 == c)
|
|
71
|
+
d = 1;
|
|
72
|
+
else if (32 == c)
|
|
73
|
+
d = 5;
|
|
74
|
+
else {
|
|
75
|
+
if (4 != c)
|
|
76
|
+
return void this.fromRadix(b, c);
|
|
77
|
+
d = 2
|
|
78
|
+
}
|
|
79
|
+
this.t = 0,
|
|
80
|
+
this.s = 0;
|
|
81
|
+
for (var e = b.length, f = !1, h = 0; --e >= 0; ) {
|
|
82
|
+
var i = 8 == d ? 255 & b[e] : g(b, e);
|
|
83
|
+
0 > i ? "-" == b.charAt(e) && (f = !0) : (f = !1,
|
|
84
|
+
0 == h ? this[this.t++] = i : h + d > this.DB ? (this[this.t - 1] |= (i & (1 << this.DB - h) - 1) << h,
|
|
85
|
+
this[this.t++] = i >> this.DB - h) : this[this.t - 1] |= i << h,
|
|
86
|
+
h += d,
|
|
87
|
+
h >= this.DB && (h -= this.DB))
|
|
88
|
+
}
|
|
89
|
+
8 == d && 0 != (128 & b[0]) && (this.s = -1,
|
|
90
|
+
h > 0 && (this[this.t - 1] |= (1 << this.DB - h) - 1 << h)),
|
|
91
|
+
this.clamp(),
|
|
92
|
+
f && a.ZERO.subTo(this, this)
|
|
93
|
+
}
|
|
94
|
+
function l() {
|
|
95
|
+
for (var a = this.s & this.DM; this.t > 0 && this[this.t - 1] == a; )
|
|
96
|
+
--this.t
|
|
97
|
+
}
|
|
98
|
+
function m(a) {
|
|
99
|
+
if (this.s < 0)
|
|
100
|
+
return "-" + this.negate().toString(a);
|
|
101
|
+
var b;
|
|
102
|
+
if (16 == a)
|
|
103
|
+
b = 4;
|
|
104
|
+
else if (8 == a)
|
|
105
|
+
b = 3;
|
|
106
|
+
else if (2 == a)
|
|
107
|
+
b = 1;
|
|
108
|
+
else if (32 == a)
|
|
109
|
+
b = 5;
|
|
110
|
+
else {
|
|
111
|
+
if (4 != a)
|
|
112
|
+
return this.toRadix(a);
|
|
113
|
+
b = 2
|
|
114
|
+
}
|
|
115
|
+
var c, d = (1 << b) - 1, e = !1, g = "", h = this.t, i = this.DB - h * this.DB % b;
|
|
116
|
+
if (h-- > 0)
|
|
117
|
+
for (i < this.DB && (c = this[h] >> i) > 0 && (e = !0,
|
|
118
|
+
g = f(c)); h >= 0; )
|
|
119
|
+
b > i ? (c = (this[h] & (1 << i) - 1) << b - i,
|
|
120
|
+
c |= this[--h] >> (i += this.DB - b)) : (c = this[h] >> (i -= b) & d,
|
|
121
|
+
0 >= i && (i += this.DB,
|
|
122
|
+
--h)),
|
|
123
|
+
c > 0 && (e = !0),
|
|
124
|
+
e && (g += f(c));
|
|
125
|
+
return e ? g : "0"
|
|
126
|
+
}
|
|
127
|
+
function n() {
|
|
128
|
+
var c = b();
|
|
129
|
+
return a.ZERO.subTo(this, c),
|
|
130
|
+
c
|
|
131
|
+
}
|
|
132
|
+
function o() {
|
|
133
|
+
return this.s < 0 ? this.negate() : this
|
|
134
|
+
}
|
|
135
|
+
function p(a) {
|
|
136
|
+
var b = this.s - a.s;
|
|
137
|
+
if (0 != b)
|
|
138
|
+
return b;
|
|
139
|
+
var c = this.t;
|
|
140
|
+
if (b = c - a.t,
|
|
141
|
+
0 != b)
|
|
142
|
+
return this.s < 0 ? -b : b;
|
|
143
|
+
for (; --c >= 0; )
|
|
144
|
+
if (0 != (b = this[c] - a[c]))
|
|
145
|
+
return b;
|
|
146
|
+
return 0
|
|
147
|
+
}
|
|
148
|
+
function q(a) {
|
|
149
|
+
var b, c = 1;
|
|
150
|
+
return 0 != (b = a >>> 16) && (a = b,
|
|
151
|
+
c += 16),
|
|
152
|
+
0 != (b = a >> 8) && (a = b,
|
|
153
|
+
c += 8),
|
|
154
|
+
0 != (b = a >> 4) && (a = b,
|
|
155
|
+
c += 4),
|
|
156
|
+
0 != (b = a >> 2) && (a = b,
|
|
157
|
+
c += 2),
|
|
158
|
+
0 != (b = a >> 1) && (a = b,
|
|
159
|
+
c += 1),
|
|
160
|
+
c
|
|
161
|
+
}
|
|
162
|
+
function r() {
|
|
163
|
+
return this.t <= 0 ? 0 : this.DB * (this.t - 1) + q(this[this.t - 1] ^ this.s & this.DM)
|
|
164
|
+
}
|
|
165
|
+
function s(a, b) {
|
|
166
|
+
var c;
|
|
167
|
+
for (c = this.t - 1; c >= 0; --c)
|
|
168
|
+
b[c + a] = this[c];
|
|
169
|
+
for (c = a - 1; c >= 0; --c)
|
|
170
|
+
b[c] = 0;
|
|
171
|
+
b.t = this.t + a,
|
|
172
|
+
b.s = this.s
|
|
173
|
+
}
|
|
174
|
+
function t(a, b) {
|
|
175
|
+
for (var c = a; c < this.t; ++c)
|
|
176
|
+
b[c - a] = this[c];
|
|
177
|
+
b.t = Math.max(this.t - a, 0),
|
|
178
|
+
b.s = this.s
|
|
179
|
+
}
|
|
180
|
+
function u(a, b) {
|
|
181
|
+
var c, d = a % this.DB, e = this.DB - d, f = (1 << e) - 1, g = Math.floor(a / this.DB), h = this.s << d & this.DM;
|
|
182
|
+
for (c = this.t - 1; c >= 0; --c)
|
|
183
|
+
b[c + g + 1] = this[c] >> e | h,
|
|
184
|
+
h = (this[c] & f) << d;
|
|
185
|
+
for (c = g - 1; c >= 0; --c)
|
|
186
|
+
b[c] = 0;
|
|
187
|
+
b[g] = h,
|
|
188
|
+
b.t = this.t + g + 1,
|
|
189
|
+
b.s = this.s,
|
|
190
|
+
b.clamp()
|
|
191
|
+
}
|
|
192
|
+
function v(a, b) {
|
|
193
|
+
b.s = this.s;
|
|
194
|
+
var c = Math.floor(a / this.DB);
|
|
195
|
+
if (c >= this.t)
|
|
196
|
+
return void (b.t = 0);
|
|
197
|
+
var d = a % this.DB
|
|
198
|
+
, e = this.DB - d
|
|
199
|
+
, f = (1 << d) - 1;
|
|
200
|
+
b[0] = this[c] >> d;
|
|
201
|
+
for (var g = c + 1; g < this.t; ++g)
|
|
202
|
+
b[g - c - 1] |= (this[g] & f) << e,
|
|
203
|
+
b[g - c] = this[g] >> d;
|
|
204
|
+
d > 0 && (b[this.t - c - 1] |= (this.s & f) << e),
|
|
205
|
+
b.t = this.t - c,
|
|
206
|
+
b.clamp()
|
|
207
|
+
}
|
|
208
|
+
function w(a, b) {
|
|
209
|
+
for (var c = 0, d = 0, e = Math.min(a.t, this.t); e > c; )
|
|
210
|
+
d += this[c] - a[c],
|
|
211
|
+
b[c++] = d & this.DM,
|
|
212
|
+
d >>= this.DB;
|
|
213
|
+
if (a.t < this.t) {
|
|
214
|
+
for (d -= a.s; c < this.t; )
|
|
215
|
+
d += this[c],
|
|
216
|
+
b[c++] = d & this.DM,
|
|
217
|
+
d >>= this.DB;
|
|
218
|
+
d += this.s
|
|
219
|
+
} else {
|
|
220
|
+
for (d += this.s; c < a.t; )
|
|
221
|
+
d -= a[c],
|
|
222
|
+
b[c++] = d & this.DM,
|
|
223
|
+
d >>= this.DB;
|
|
224
|
+
d -= a.s
|
|
225
|
+
}
|
|
226
|
+
b.s = 0 > d ? -1 : 0,
|
|
227
|
+
-1 > d ? b[c++] = this.DV + d : d > 0 && (b[c++] = d),
|
|
228
|
+
b.t = c,
|
|
229
|
+
b.clamp()
|
|
230
|
+
}
|
|
231
|
+
function x(b, c) {
|
|
232
|
+
var d = this.abs()
|
|
233
|
+
, e = b.abs()
|
|
234
|
+
, f = d.t;
|
|
235
|
+
for (c.t = f + e.t; --f >= 0; )
|
|
236
|
+
c[f] = 0;
|
|
237
|
+
for (f = 0; f < e.t; ++f)
|
|
238
|
+
c[f + d.t] = d.am(0, e[f], c, f, 0, d.t);
|
|
239
|
+
c.s = 0,
|
|
240
|
+
c.clamp(),
|
|
241
|
+
this.s != b.s && a.ZERO.subTo(c, c)
|
|
242
|
+
}
|
|
243
|
+
function y(a) {
|
|
244
|
+
for (var b = this.abs(), c = a.t = 2 * b.t; --c >= 0; )
|
|
245
|
+
a[c] = 0;
|
|
246
|
+
for (c = 0; c < b.t - 1; ++c) {
|
|
247
|
+
var d = b.am(c, b[c], a, 2 * c, 0, 1);
|
|
248
|
+
(a[c + b.t] += b.am(c + 1, 2 * b[c], a, 2 * c + 1, d, b.t - c - 1)) >= b.DV && (a[c + b.t] -= b.DV,
|
|
249
|
+
a[c + b.t + 1] = 1)
|
|
250
|
+
}
|
|
251
|
+
a.t > 0 && (a[a.t - 1] += b.am(c, b[c], a, 2 * c, 0, 1)),
|
|
252
|
+
a.s = 0,
|
|
253
|
+
a.clamp()
|
|
254
|
+
}
|
|
255
|
+
function z(c, d, e) {
|
|
256
|
+
var f = c.abs();
|
|
257
|
+
if (!(f.t <= 0)) {
|
|
258
|
+
var g = this.abs();
|
|
259
|
+
if (g.t < f.t)
|
|
260
|
+
return null != d && d.fromInt(0),
|
|
261
|
+
void (null != e && this.copyTo(e));
|
|
262
|
+
null == e && (e = b());
|
|
263
|
+
var h = b()
|
|
264
|
+
, i = this.s
|
|
265
|
+
, j = c.s
|
|
266
|
+
, k = this.DB - q(f[f.t - 1]);
|
|
267
|
+
k > 0 ? (f.lShiftTo(k, h),
|
|
268
|
+
g.lShiftTo(k, e)) : (f.copyTo(h),
|
|
269
|
+
g.copyTo(e));
|
|
270
|
+
var l = h.t
|
|
271
|
+
, m = h[l - 1];
|
|
272
|
+
if (0 != m) {
|
|
273
|
+
var n = m * (1 << this.F1) + (l > 1 ? h[l - 2] >> this.F2 : 0)
|
|
274
|
+
, o = this.FV / n
|
|
275
|
+
, p = (1 << this.F1) / n
|
|
276
|
+
, r = 1 << this.F2
|
|
277
|
+
, s = e.t
|
|
278
|
+
, t = s - l
|
|
279
|
+
, u = null == d ? b() : d;
|
|
280
|
+
for (h.dlShiftTo(t, u),
|
|
281
|
+
e.compareTo(u) >= 0 && (e[e.t++] = 1,
|
|
282
|
+
e.subTo(u, e)),
|
|
283
|
+
a.ONE.dlShiftTo(l, u),
|
|
284
|
+
u.subTo(h, h); h.t < l; )
|
|
285
|
+
h[h.t++] = 0;
|
|
286
|
+
for (; --t >= 0; ) {
|
|
287
|
+
var v = e[--s] == m ? this.DM : Math.floor(e[s] * o + (e[s - 1] + r) * p);
|
|
288
|
+
if ((e[s] += h.am(0, v, e, t, 0, l)) < v)
|
|
289
|
+
for (h.dlShiftTo(t, u),
|
|
290
|
+
e.subTo(u, e); e[s] < --v; )
|
|
291
|
+
e.subTo(u, e)
|
|
292
|
+
}
|
|
293
|
+
null != d && (e.drShiftTo(l, d),
|
|
294
|
+
i != j && a.ZERO.subTo(d, d)),
|
|
295
|
+
e.t = l,
|
|
296
|
+
e.clamp(),
|
|
297
|
+
k > 0 && e.rShiftTo(k, e),
|
|
298
|
+
0 > i && a.ZERO.subTo(e, e)
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
function A(c) {
|
|
303
|
+
var d = b();
|
|
304
|
+
return this.abs().divRemTo(c, null, d),
|
|
305
|
+
this.s < 0 && d.compareTo(a.ZERO) > 0 && c.subTo(d, d),
|
|
306
|
+
d
|
|
307
|
+
}
|
|
308
|
+
function B(a) {
|
|
309
|
+
this.m = a
|
|
310
|
+
}
|
|
311
|
+
function C(a) {
|
|
312
|
+
return a.s < 0 || a.compareTo(this.m) >= 0 ? a.mod(this.m) : a
|
|
313
|
+
}
|
|
314
|
+
function D(a) {
|
|
315
|
+
return a
|
|
316
|
+
}
|
|
317
|
+
function E(a) {
|
|
318
|
+
a.divRemTo(this.m, null, a)
|
|
319
|
+
}
|
|
320
|
+
function F(a, b, c) {
|
|
321
|
+
a.multiplyTo(b, c),
|
|
322
|
+
this.reduce(c)
|
|
323
|
+
}
|
|
324
|
+
function G(a, b) {
|
|
325
|
+
a.squareTo(b),
|
|
326
|
+
this.reduce(b)
|
|
327
|
+
}
|
|
328
|
+
function H() {
|
|
329
|
+
if (this.t < 1)
|
|
330
|
+
return 0;
|
|
331
|
+
var a = this[0];
|
|
332
|
+
if (0 == (1 & a))
|
|
333
|
+
return 0;
|
|
334
|
+
var b = 3 & a;
|
|
335
|
+
return b = b * (2 - (15 & a) * b) & 15,
|
|
336
|
+
b = b * (2 - (255 & a) * b) & 255,
|
|
337
|
+
b = b * (2 - ((65535 & a) * b & 65535)) & 65535,
|
|
338
|
+
b = b * (2 - a * b % this.DV) % this.DV,
|
|
339
|
+
b > 0 ? this.DV - b : -b
|
|
340
|
+
}
|
|
341
|
+
function I(a) {
|
|
342
|
+
this.m = a,
|
|
343
|
+
this.mp = a.invDigit(),
|
|
344
|
+
this.mpl = 32767 & this.mp,
|
|
345
|
+
this.mph = this.mp >> 15,
|
|
346
|
+
this.um = (1 << a.DB - 15) - 1,
|
|
347
|
+
this.mt2 = 2 * a.t
|
|
348
|
+
}
|
|
349
|
+
function J(c) {
|
|
350
|
+
var d = b();
|
|
351
|
+
return c.abs().dlShiftTo(this.m.t, d),
|
|
352
|
+
d.divRemTo(this.m, null, d),
|
|
353
|
+
c.s < 0 && d.compareTo(a.ZERO) > 0 && this.m.subTo(d, d),
|
|
354
|
+
d
|
|
355
|
+
}
|
|
356
|
+
function K(a) {
|
|
357
|
+
var c = b();
|
|
358
|
+
return a.copyTo(c),
|
|
359
|
+
this.reduce(c),
|
|
360
|
+
c
|
|
361
|
+
}
|
|
362
|
+
function L(a) {
|
|
363
|
+
for (; a.t <= this.mt2; )
|
|
364
|
+
a[a.t++] = 0;
|
|
365
|
+
for (var b = 0; b < this.m.t; ++b) {
|
|
366
|
+
var c = 32767 & a[b]
|
|
367
|
+
, d = c * this.mpl + ((c * this.mph + (a[b] >> 15) * this.mpl & this.um) << 15) & a.DM;
|
|
368
|
+
for (c = b + this.m.t,
|
|
369
|
+
a[c] += this.m.am(0, d, a, b, 0, this.m.t); a[c] >= a.DV; )
|
|
370
|
+
a[c] -= a.DV,
|
|
371
|
+
a[++c]++
|
|
372
|
+
}
|
|
373
|
+
a.clamp(),
|
|
374
|
+
a.drShiftTo(this.m.t, a),
|
|
375
|
+
a.compareTo(this.m) >= 0 && a.subTo(this.m, a)
|
|
376
|
+
}
|
|
377
|
+
function M(a, b) {
|
|
378
|
+
a.squareTo(b),
|
|
379
|
+
this.reduce(b)
|
|
380
|
+
}
|
|
381
|
+
function N(a, b, c) {
|
|
382
|
+
a.multiplyTo(b, c),
|
|
383
|
+
this.reduce(c)
|
|
384
|
+
}
|
|
385
|
+
function O() {
|
|
386
|
+
return 0 == (this.t > 0 ? 1 & this[0] : this.s)
|
|
387
|
+
}
|
|
388
|
+
function P(c, d) {
|
|
389
|
+
if (c > 4294967295 || 1 > c)
|
|
390
|
+
return a.ONE;
|
|
391
|
+
var e = b()
|
|
392
|
+
, f = b()
|
|
393
|
+
, g = d.convert(this)
|
|
394
|
+
, h = q(c) - 1;
|
|
395
|
+
for (g.copyTo(e); --h >= 0; )
|
|
396
|
+
if (d.sqrTo(e, f),
|
|
397
|
+
(c & 1 << h) > 0)
|
|
398
|
+
d.mulTo(f, g, e);
|
|
399
|
+
else {
|
|
400
|
+
var i = e;
|
|
401
|
+
e = f,
|
|
402
|
+
f = i
|
|
403
|
+
}
|
|
404
|
+
return d.revert(e)
|
|
405
|
+
}
|
|
406
|
+
function Q(a, b) {
|
|
407
|
+
var c;
|
|
408
|
+
return c = 256 > a || b.isEven() ? new B(b) : new I(b),
|
|
409
|
+
this.exp(a, c)
|
|
410
|
+
}
|
|
411
|
+
function R() {
|
|
412
|
+
this.i = 0,
|
|
413
|
+
this.j = 0,
|
|
414
|
+
this.S = new Array
|
|
415
|
+
}
|
|
416
|
+
function S(a) {
|
|
417
|
+
var b, c, d;
|
|
418
|
+
for (b = 0; 256 > b; ++b)
|
|
419
|
+
this.S[b] = b;
|
|
420
|
+
for (c = 0,
|
|
421
|
+
b = 0; 256 > b; ++b)
|
|
422
|
+
c = c + this.S[b] + a[b % a.length] & 255,
|
|
423
|
+
d = this.S[b],
|
|
424
|
+
this.S[b] = this.S[c],
|
|
425
|
+
this.S[c] = d;
|
|
426
|
+
this.i = 0,
|
|
427
|
+
this.j = 0
|
|
428
|
+
}
|
|
429
|
+
function T() {
|
|
430
|
+
var a;
|
|
431
|
+
return this.i = this.i + 1 & 255,
|
|
432
|
+
this.j = this.j + this.S[this.i] & 255,
|
|
433
|
+
a = this.S[this.i],
|
|
434
|
+
this.S[this.i] = this.S[this.j],
|
|
435
|
+
this.S[this.j] = a,
|
|
436
|
+
this.S[a + this.S[this.i] & 255]
|
|
437
|
+
}
|
|
438
|
+
function U() {
|
|
439
|
+
return new R
|
|
440
|
+
}
|
|
441
|
+
function V(a) {
|
|
442
|
+
na[oa++] ^= 255 & a,
|
|
443
|
+
na[oa++] ^= a >> 8 & 255,
|
|
444
|
+
na[oa++] ^= a >> 16 & 255,
|
|
445
|
+
na[oa++] ^= a >> 24 & 255,
|
|
446
|
+
oa >= pa && (oa -= pa)
|
|
447
|
+
}
|
|
448
|
+
function W() {
|
|
449
|
+
V((new Date).getTime())
|
|
450
|
+
}
|
|
451
|
+
function X() {
|
|
452
|
+
if (null == ma) {
|
|
453
|
+
for (W(),
|
|
454
|
+
ma = U(),
|
|
455
|
+
ma.init(na),
|
|
456
|
+
oa = 0; oa < na.length; ++oa)
|
|
457
|
+
na[oa] = 0;
|
|
458
|
+
oa = 0
|
|
459
|
+
}
|
|
460
|
+
return ma.next()
|
|
461
|
+
}
|
|
462
|
+
function Y(a) {
|
|
463
|
+
var b;
|
|
464
|
+
for (b = 0; b < a.length; ++b)
|
|
465
|
+
a[b] = X()
|
|
466
|
+
}
|
|
467
|
+
function Z() {}
|
|
468
|
+
function $(b, c) {
|
|
469
|
+
return new a(b,c)
|
|
470
|
+
}
|
|
471
|
+
function _(b, c) {
|
|
472
|
+
if (c < b.length + 11)
|
|
473
|
+
return alert("Message too long for RSA"),
|
|
474
|
+
null;
|
|
475
|
+
for (var d = new Array, e = b.length - 1; e >= 0 && c > 0; ) {
|
|
476
|
+
var f = b.charCodeAt(e--);
|
|
477
|
+
128 > f ? d[--c] = f : f > 127 && 2048 > f ? (d[--c] = 63 & f | 128,
|
|
478
|
+
d[--c] = f >> 6 | 192) : (d[--c] = 63 & f | 128,
|
|
479
|
+
d[--c] = f >> 6 & 63 | 128,
|
|
480
|
+
d[--c] = f >> 12 | 224)
|
|
481
|
+
}
|
|
482
|
+
d[--c] = 0;
|
|
483
|
+
for (var g = new Z, h = new Array; c > 2; ) {
|
|
484
|
+
for (h[0] = 0; 0 == h[0]; )
|
|
485
|
+
g.nextBytes(h);
|
|
486
|
+
d[--c] = h[0]
|
|
487
|
+
}
|
|
488
|
+
return d[--c] = 2,
|
|
489
|
+
d[--c] = 0,
|
|
490
|
+
new a(d)
|
|
491
|
+
}
|
|
492
|
+
function aa() {
|
|
493
|
+
this.n = null,
|
|
494
|
+
this.e = 0,
|
|
495
|
+
this.d = null,
|
|
496
|
+
this.p = null,
|
|
497
|
+
this.q = null,
|
|
498
|
+
this.dmp1 = null,
|
|
499
|
+
this.dmq1 = null,
|
|
500
|
+
this.coeff = null
|
|
501
|
+
}
|
|
502
|
+
function ba(a, b) {
|
|
503
|
+
null != a && null != b && a.length > 0 && b.length > 0 ? (this.n = $(a, 16),
|
|
504
|
+
this.e = parseInt(b, 16)) : alert("Invalid RSA public key")
|
|
505
|
+
}
|
|
506
|
+
function ca(a) {
|
|
507
|
+
return a.modPowInt(this.e, this.n)
|
|
508
|
+
}
|
|
509
|
+
function da(a) {
|
|
510
|
+
var b = _(a, this.n.bitLength() + 7 >> 3);
|
|
511
|
+
if (null == b)
|
|
512
|
+
return null;
|
|
513
|
+
var c = this.doPublic(b);
|
|
514
|
+
if (null == c)
|
|
515
|
+
return null;
|
|
516
|
+
var d = c.toString(16);
|
|
517
|
+
return 0 == (1 & d.length) ? d : "0" + d
|
|
518
|
+
}
|
|
519
|
+
var ea, fa = 0xdeadbeefcafe, ga = 15715070 == (16777215 & fa);
|
|
520
|
+
a.prototype.am = e,
|
|
521
|
+
ea = 28,
|
|
522
|
+
a.prototype.DB = ea,
|
|
523
|
+
a.prototype.DM = (1 << ea) - 1,
|
|
524
|
+
a.prototype.DV = 1 << ea;
|
|
525
|
+
var ha = 52;
|
|
526
|
+
a.prototype.FV = Math.pow(2, ha),
|
|
527
|
+
a.prototype.F1 = ha - ea,
|
|
528
|
+
a.prototype.F2 = 2 * ea - ha;
|
|
529
|
+
var ia, ja, ka = "0123456789abcdefghijklmnopqrstuvwxyz", la = new Array;
|
|
530
|
+
for (ia = "0".charCodeAt(0),
|
|
531
|
+
ja = 0; 9 >= ja; ++ja)
|
|
532
|
+
la[ia++] = ja;
|
|
533
|
+
for (ia = "a".charCodeAt(0),
|
|
534
|
+
ja = 10; 36 > ja; ++ja)
|
|
535
|
+
la[ia++] = ja;
|
|
536
|
+
for (ia = "A".charCodeAt(0),
|
|
537
|
+
ja = 10; 36 > ja; ++ja)
|
|
538
|
+
la[ia++] = ja;
|
|
539
|
+
B.prototype.convert = C,
|
|
540
|
+
B.prototype.revert = D,
|
|
541
|
+
B.prototype.reduce = E,
|
|
542
|
+
B.prototype.mulTo = F,
|
|
543
|
+
B.prototype.sqrTo = G,
|
|
544
|
+
I.prototype.convert = J,
|
|
545
|
+
I.prototype.revert = K,
|
|
546
|
+
I.prototype.reduce = L,
|
|
547
|
+
I.prototype.mulTo = N,
|
|
548
|
+
I.prototype.sqrTo = M,
|
|
549
|
+
a.prototype.copyTo = h,
|
|
550
|
+
a.prototype.fromInt = i,
|
|
551
|
+
a.prototype.fromString = k,
|
|
552
|
+
a.prototype.clamp = l,
|
|
553
|
+
a.prototype.dlShiftTo = s,
|
|
554
|
+
a.prototype.drShiftTo = t,
|
|
555
|
+
a.prototype.lShiftTo = u,
|
|
556
|
+
a.prototype.rShiftTo = v,
|
|
557
|
+
a.prototype.subTo = w,
|
|
558
|
+
a.prototype.multiplyTo = x,
|
|
559
|
+
a.prototype.squareTo = y,
|
|
560
|
+
a.prototype.divRemTo = z,
|
|
561
|
+
a.prototype.invDigit = H,
|
|
562
|
+
a.prototype.isEven = O,
|
|
563
|
+
a.prototype.exp = P,
|
|
564
|
+
a.prototype.toString = m,
|
|
565
|
+
a.prototype.negate = n,
|
|
566
|
+
a.prototype.abs = o,
|
|
567
|
+
a.prototype.compareTo = p,
|
|
568
|
+
a.prototype.bitLength = r,
|
|
569
|
+
a.prototype.mod = A,
|
|
570
|
+
a.prototype.modPowInt = Q,
|
|
571
|
+
a.ZERO = j(0),
|
|
572
|
+
a.ONE = j(1),
|
|
573
|
+
R.prototype.init = S,
|
|
574
|
+
R.prototype.next = T;
|
|
575
|
+
var ma, na, oa, pa = 256;
|
|
576
|
+
if (null == na) {
|
|
577
|
+
na = new Array,
|
|
578
|
+
oa = 0;
|
|
579
|
+
var qa;
|
|
580
|
+
if (crypto && crypto.getRandomValues) {
|
|
581
|
+
var ra = new Uint8Array(32);
|
|
582
|
+
for (crypto.getRandomValues(ra),
|
|
583
|
+
qa = 0; 32 > qa; ++qa)
|
|
584
|
+
na[oa++] = ra[qa]
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
for (; pa > oa; )
|
|
588
|
+
qa = Math.floor(65536 * Math.random()),
|
|
589
|
+
na[oa++] = qa >>> 8,
|
|
590
|
+
na[oa++] = 255 & qa;
|
|
591
|
+
oa = 0,
|
|
592
|
+
W()
|
|
593
|
+
}
|
|
594
|
+
Z.prototype.nextBytes = Y,
|
|
595
|
+
aa.prototype.doPublic = ca,
|
|
596
|
+
aa.prototype.setPublic = ba,
|
|
597
|
+
aa.prototype.encrypt = da;
|
|
598
|
+
return aa
|
|
599
|
+
}();
|
|
600
|
+
|
|
601
|
+
module.exports = function getPwd(b){
|
|
602
|
+
g = new RSAKey;
|
|
603
|
+
g.setPublic("d3bcef1f00424f3261c89323fa8cdfa12bbac400d9fe8bb627e8d27a44bd5d59dce559135d678a8143beb5b8d7056c4e1f89c4e1f152470625b7b41944a97f02da6f605a49a93ec6eb9cbaf2e7ac2b26a354ce69eb265953d2c29e395d6d8c1cdb688978551aa0f7521f290035fad381178da0bea8f9e6adce39020f513133fb","10001");
|
|
604
|
+
return g.encrypt(b)
|
|
605
|
+
}
|
package/main.js
CHANGED
|
@@ -10,9 +10,10 @@ const utils = require("@iobroker/adapter-core");
|
|
|
10
10
|
const axios = require("axios");
|
|
11
11
|
const qs = require("qs");
|
|
12
12
|
const Json2iob = require("./lib/json2iob");
|
|
13
|
+
const getPwd = require("./lib/rsaKey");
|
|
13
14
|
const tough = require("tough-cookie");
|
|
14
15
|
const { HttpsCookieAgent } = require("http-cookie-agent");
|
|
15
|
-
const { JSDOM } = require("jsdom");
|
|
16
|
+
const { JSDOM } = require("@applitools/jsdom");
|
|
16
17
|
const fs = require("fs");
|
|
17
18
|
const { v4: uuidv4 } = require("uuid");
|
|
18
19
|
|
|
@@ -36,7 +37,9 @@ class Parcel extends utils.Adapter {
|
|
|
36
37
|
this.mergedJsonObject = {};
|
|
37
38
|
this.images = {};
|
|
38
39
|
this.alreadySentMessages = {};
|
|
40
|
+
this.ignoredPath = [];
|
|
39
41
|
this.firstStart = true;
|
|
42
|
+
this.delivery_status = { ERROR: -1, UNKNOWN: 5, REGISTERED: 10, IN_PREPARATION: 20, IN_TRANSIT: 30, OUT_FOR_DELIVERY: 40, DELIVERED: 1 };
|
|
40
43
|
}
|
|
41
44
|
|
|
42
45
|
/**
|
|
@@ -75,6 +78,10 @@ class Parcel extends utils.Adapter {
|
|
|
75
78
|
this.log.info("Login to T17 User");
|
|
76
79
|
await this.login17T();
|
|
77
80
|
}
|
|
81
|
+
if (this.config.aliUsername && this.config.aliPassword) {
|
|
82
|
+
this.log.info("Login to AliExpres");
|
|
83
|
+
await this.loginAli();
|
|
84
|
+
}
|
|
78
85
|
|
|
79
86
|
if (this.config["17trackKey"]) {
|
|
80
87
|
this.sessions["17track"] = this.config["17trackKey"];
|
|
@@ -278,6 +285,151 @@ class Parcel extends utils.Adapter {
|
|
|
278
285
|
});
|
|
279
286
|
}
|
|
280
287
|
}
|
|
288
|
+
async loginAli() {
|
|
289
|
+
const loginData = await this.requestClient({
|
|
290
|
+
method: "get",
|
|
291
|
+
url: "https://passport.aliexpress.com/mini_login.htm?lang=de_de&appName=aebuyer&appEntrance=default&styleType=auto&bizParams=¬LoadSsoView=false¬KeepLogin=false&isMobile=false&cssLink=https://i.alicdn.com/noah-static/4.0.2/common/css/reset-havana.css&cssUrl=https://i.alicdn.com/noah-static/4.0.2/common/css/reset-havana-new-page.css&showMobilePwdLogin=false&defaultCountryCode=DE&ut=&rnd=0.9085151696364684",
|
|
292
|
+
headers: {
|
|
293
|
+
"sec-ch-ua": '" Not A;Brand";v="99", "Chromium";v="100", "Google Chrome";v="100"',
|
|
294
|
+
"sec-ch-ua-mobile": "?0",
|
|
295
|
+
"sec-ch-ua-platform": '"macOS"',
|
|
296
|
+
"upgrade-insecure-requests": "1",
|
|
297
|
+
"user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.20 Safari/537.36",
|
|
298
|
+
accept: "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9",
|
|
299
|
+
"sec-fetch-site": "same-site",
|
|
300
|
+
"sec-fetch-mode": "navigate",
|
|
301
|
+
"sec-fetch-dest": "iframe",
|
|
302
|
+
referer: "https://login.aliexpress.com/",
|
|
303
|
+
"accept-language": "de",
|
|
304
|
+
},
|
|
305
|
+
jar: this.cookieJar,
|
|
306
|
+
withCredentials: true,
|
|
307
|
+
})
|
|
308
|
+
.then(async (res) => {
|
|
309
|
+
this.log.debug(JSON.stringify(res.data));
|
|
310
|
+
if (res.data.indexOf("window.viewData = ") !== -1) {
|
|
311
|
+
try {
|
|
312
|
+
const loginData = res.data.split("window.viewData = ")[1].split(";")[0].replace(/\\/g, "");
|
|
313
|
+
return JSON.parse(loginData).loginFormData;
|
|
314
|
+
} catch (error) {
|
|
315
|
+
this.log.error(error);
|
|
316
|
+
}
|
|
317
|
+
} else {
|
|
318
|
+
this.log.error("Failed Step 1 Aliexpress");
|
|
319
|
+
}
|
|
320
|
+
})
|
|
321
|
+
.catch((error) => {
|
|
322
|
+
this.log.error(error);
|
|
323
|
+
if (error.response) {
|
|
324
|
+
this.log.error(JSON.stringify(error.response.data));
|
|
325
|
+
}
|
|
326
|
+
});
|
|
327
|
+
|
|
328
|
+
if (!loginData) {
|
|
329
|
+
return;
|
|
330
|
+
}
|
|
331
|
+
if (!this.config.aliMfa) {
|
|
332
|
+
loginData.loginId = this.config.aliUsername;
|
|
333
|
+
loginData.password2 = getPwd(this.config.aliPassword);
|
|
334
|
+
await this.requestClient({
|
|
335
|
+
method: "post",
|
|
336
|
+
url: "https://passport.aliexpress.com/newlogin/login.do?appName=aebuyer&fromSite=13&_bx-v=2.0.39",
|
|
337
|
+
headers: {
|
|
338
|
+
"sec-ch-ua": '" Not A;Brand";v="99", "Chromium";v="100", "Google Chrome";v="100"',
|
|
339
|
+
accept: "application/json, text/plain, */*",
|
|
340
|
+
"content-type": "application/x-www-form-urlencoded",
|
|
341
|
+
"sec-ch-ua-mobile": "?0",
|
|
342
|
+
"user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.20 Safari/537.36",
|
|
343
|
+
"sec-ch-ua-platform": '"macOS"',
|
|
344
|
+
origin: "https://login.aliexpress.com",
|
|
345
|
+
"sec-fetch-site": "same-site",
|
|
346
|
+
"sec-fetch-mode": "cors",
|
|
347
|
+
"sec-fetch-dest": "empty",
|
|
348
|
+
referer: "https://login.aliexpress.com/",
|
|
349
|
+
"accept-language": "de",
|
|
350
|
+
},
|
|
351
|
+
jar: this.cookieJar,
|
|
352
|
+
withCredentials: true,
|
|
353
|
+
data: qs.stringify(loginData),
|
|
354
|
+
})
|
|
355
|
+
.then(async (res) => {
|
|
356
|
+
if (res.data.url && res.data.url.indexOf("punish") !== -1) {
|
|
357
|
+
this.log.error("Failed because of captcha");
|
|
358
|
+
}
|
|
359
|
+
// this.log.debug(JSON.stringify(res.data));
|
|
360
|
+
})
|
|
361
|
+
.catch((error) => {
|
|
362
|
+
this.log.error(error);
|
|
363
|
+
if (error.response) {
|
|
364
|
+
this.log.error(JSON.stringify(error.response.data));
|
|
365
|
+
}
|
|
366
|
+
});
|
|
367
|
+
await this.requestClient({
|
|
368
|
+
method: "get",
|
|
369
|
+
url: "https://www.aliexpress.com/p/order/index.html",
|
|
370
|
+
jar: this.cookieJar,
|
|
371
|
+
withCredentials: true,
|
|
372
|
+
})
|
|
373
|
+
.then(async (res) => {
|
|
374
|
+
// this.log.debug(JSON.stringify(res.data));
|
|
375
|
+
res.data.indexOf("Session has expired") !== -1 ? this.log.error("Session has expired") : this.log.info("Login to Aliexpress successful");
|
|
376
|
+
})
|
|
377
|
+
.catch(async (error) => {
|
|
378
|
+
error.response && this.log.error(JSON.stringify(error.response.data));
|
|
379
|
+
this.log.error(error);
|
|
380
|
+
});
|
|
381
|
+
} else {
|
|
382
|
+
this.log.info("Login to AliExpress with MFA token");
|
|
383
|
+
this.log.debug("MFA: " + this.config.dhlMfa);
|
|
384
|
+
await this.requestClient({
|
|
385
|
+
method: "post",
|
|
386
|
+
url: "https://www.dhl.de/int-erkennen/2fa",
|
|
387
|
+
headers: {
|
|
388
|
+
Host: "www.dhl.de",
|
|
389
|
+
"content-type": "application/json",
|
|
390
|
+
accept: "*/*",
|
|
391
|
+
"x-requested-with": "XMLHttpRequest",
|
|
392
|
+
"accept-language": "de-de",
|
|
393
|
+
origin: "https://www.dhl.de",
|
|
394
|
+
"user-agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 14_8 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148",
|
|
395
|
+
},
|
|
396
|
+
jar: this.cookieJar,
|
|
397
|
+
withCredentials: true,
|
|
398
|
+
data: JSON.stringify({
|
|
399
|
+
value: this.config.dhlMfa,
|
|
400
|
+
remember2fa: true,
|
|
401
|
+
language: "de",
|
|
402
|
+
context: "app",
|
|
403
|
+
meta: "",
|
|
404
|
+
intermediateMfaToken: mfaToken,
|
|
405
|
+
}),
|
|
406
|
+
})
|
|
407
|
+
.then(async (res) => {
|
|
408
|
+
this.log.debug(JSON.stringify(res.data));
|
|
409
|
+
this.log.info("Login to DHL successful");
|
|
410
|
+
this.sessions["dhl"] = res.data;
|
|
411
|
+
this.setState("info.connection", true, true);
|
|
412
|
+
this.setState("auth.cookie", JSON.stringify(this.cookieJar.toJSON()), true);
|
|
413
|
+
await this.createDHLStates();
|
|
414
|
+
})
|
|
415
|
+
.catch(async (error) => {
|
|
416
|
+
this.log.error(error);
|
|
417
|
+
if (error.response) {
|
|
418
|
+
this.setState("info.connection", false, true);
|
|
419
|
+
this.log.error(JSON.stringify(error.response.data));
|
|
420
|
+
const adapterConfig = "system.adapter." + this.name + "." + this.instance;
|
|
421
|
+
this.log.error("MFA incorrect");
|
|
422
|
+
this.getForeignObject(adapterConfig, (error, obj) => {
|
|
423
|
+
if (obj && obj.native && obj.native.dhlMfa) {
|
|
424
|
+
obj.native.dhlMfa = "";
|
|
425
|
+
this.setForeignObject(adapterConfig, obj);
|
|
426
|
+
}
|
|
427
|
+
});
|
|
428
|
+
return;
|
|
429
|
+
}
|
|
430
|
+
});
|
|
431
|
+
}
|
|
432
|
+
}
|
|
281
433
|
|
|
282
434
|
async loginAmz() {
|
|
283
435
|
let body = await this.requestClient({
|
|
@@ -359,6 +511,17 @@ class Parcel extends utils.Adapter {
|
|
|
359
511
|
},
|
|
360
512
|
native: {},
|
|
361
513
|
});
|
|
514
|
+
await this.setObjectNotExistsAsync("amazon.json", {
|
|
515
|
+
type: "state",
|
|
516
|
+
common: {
|
|
517
|
+
name: "Json Sendungen",
|
|
518
|
+
write: false,
|
|
519
|
+
read: true,
|
|
520
|
+
type: "string",
|
|
521
|
+
role: "json",
|
|
522
|
+
},
|
|
523
|
+
native: {},
|
|
524
|
+
});
|
|
362
525
|
return;
|
|
363
526
|
}
|
|
364
527
|
if (res.data.indexOf("auth-mfa-otpcode") !== -1) {
|
|
@@ -499,6 +662,15 @@ class Parcel extends utils.Adapter {
|
|
|
499
662
|
this.log.error(JSON.stringify(error.response.data));
|
|
500
663
|
}
|
|
501
664
|
});
|
|
665
|
+
await this.requestClient({
|
|
666
|
+
method: "get",
|
|
667
|
+
url: "https://my.dpd.de/myParcel.aspx?dpd_token=" + this.dpdToken,
|
|
668
|
+
jar: this.cookieJar,
|
|
669
|
+
withCredentials: true,
|
|
670
|
+
}).catch(async (error) => {
|
|
671
|
+
error.response && this.log.error(JSON.stringify(error.response.data));
|
|
672
|
+
this.log.error(error);
|
|
673
|
+
});
|
|
502
674
|
}
|
|
503
675
|
async loginGLS(silent) {
|
|
504
676
|
await this.requestClient({
|
|
@@ -980,7 +1152,7 @@ class Parcel extends utils.Adapter {
|
|
|
980
1152
|
dpd: [
|
|
981
1153
|
{
|
|
982
1154
|
path: "dpd",
|
|
983
|
-
url: "https://my.dpd.de/myParcel.aspx
|
|
1155
|
+
url: "https://my.dpd.de/myParcel.aspx", //?dpd_token=" + this.dpdToken,
|
|
984
1156
|
header: {
|
|
985
1157
|
accept: "*/*",
|
|
986
1158
|
"user-agent": "Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.45 Safari/537.36",
|
|
@@ -1038,6 +1210,10 @@ class Parcel extends utils.Adapter {
|
|
|
1038
1210
|
for (const id of Object.keys(this.sessions)) {
|
|
1039
1211
|
for (const element of statusArrays[id]) {
|
|
1040
1212
|
this.log.debug(element.url);
|
|
1213
|
+
if (this.ignoredPath.includes(element.path)) {
|
|
1214
|
+
this.log.debug("Ignore: " + element.path);
|
|
1215
|
+
continue;
|
|
1216
|
+
}
|
|
1041
1217
|
await this.requestClient({
|
|
1042
1218
|
method: element.method ? element.method : "get",
|
|
1043
1219
|
url: element.url,
|
|
@@ -1073,13 +1249,18 @@ class Parcel extends utils.Adapter {
|
|
|
1073
1249
|
}
|
|
1074
1250
|
if (id === "hermes") {
|
|
1075
1251
|
try {
|
|
1076
|
-
|
|
1077
|
-
|
|
1252
|
+
if (res.data) {
|
|
1253
|
+
if (typeof res.data === "string") {
|
|
1254
|
+
res.data = JSON.parse(res.data);
|
|
1255
|
+
}
|
|
1256
|
+
for (const parcel of res.data) {
|
|
1257
|
+
parcel.id = parcel.shipmentId;
|
|
1258
|
+
}
|
|
1259
|
+
data = { sendungen: res.data };
|
|
1078
1260
|
}
|
|
1079
|
-
data = { sendungen: res.data };
|
|
1080
1261
|
} catch (error) {
|
|
1081
|
-
this.log.
|
|
1082
|
-
this.log.
|
|
1262
|
+
this.log.warn("Hermes response incomplete cannot parse result");
|
|
1263
|
+
this.log.debug(res.data);
|
|
1083
1264
|
data = { sendungen: [] };
|
|
1084
1265
|
}
|
|
1085
1266
|
}
|
|
@@ -1101,11 +1282,12 @@ class Parcel extends utils.Adapter {
|
|
|
1101
1282
|
await this.activateToken(res.data.grantToken, res.data.accessTokenUrl);
|
|
1102
1283
|
await this.sleep(1000);
|
|
1103
1284
|
}
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1285
|
+
if (data) {
|
|
1286
|
+
await this.cleanupProvider(id, data);
|
|
1287
|
+
this.mergeProviderJson(id, data);
|
|
1288
|
+
this.json2iob.parse(element.path, data, { forceIndex: forceIndex, preferedArrayName: preferedArrayName });
|
|
1289
|
+
data && this.setState(element.path + ".json", JSON.stringify(data), true);
|
|
1290
|
+
}
|
|
1109
1291
|
})
|
|
1110
1292
|
.catch((error) => {
|
|
1111
1293
|
if (error.response) {
|
|
@@ -1114,6 +1296,7 @@ class Parcel extends utils.Adapter {
|
|
|
1114
1296
|
this.log.debug(error);
|
|
1115
1297
|
return;
|
|
1116
1298
|
}
|
|
1299
|
+
|
|
1117
1300
|
error.response && this.log.debug(JSON.stringify(error.response.data));
|
|
1118
1301
|
|
|
1119
1302
|
this.log.info(element.path + " receive 401 error. Refresh Token in 60 seconds");
|
|
@@ -1125,6 +1308,10 @@ class Parcel extends utils.Adapter {
|
|
|
1125
1308
|
}
|
|
1126
1309
|
return;
|
|
1127
1310
|
}
|
|
1311
|
+
if (element.path === "dhl.briefe") {
|
|
1312
|
+
this.log.info("Briefankündigung is not working. Stopped until restart");
|
|
1313
|
+
this.ignoredPath.push(element.path);
|
|
1314
|
+
}
|
|
1128
1315
|
}
|
|
1129
1316
|
this.log.error(element.url);
|
|
1130
1317
|
this.log.error(error);
|
|
@@ -1155,12 +1342,14 @@ class Parcel extends utils.Adapter {
|
|
|
1155
1342
|
});
|
|
1156
1343
|
for (const sendungsIdKey in states) {
|
|
1157
1344
|
const index = Object.keys(states).indexOf(sendungsIdKey);
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1345
|
+
if (states[sendungsIdKey]) {
|
|
1346
|
+
const sendungsId = states[sendungsIdKey].val;
|
|
1347
|
+
if (sendungsArray[index] !== sendungsId) {
|
|
1348
|
+
const idArray = sendungsIdKey.split(".");
|
|
1349
|
+
idArray.pop();
|
|
1350
|
+
this.log.debug("deleting " + sendungsIdKey);
|
|
1351
|
+
await this.delObjectAsync(idArray.join("."), { recursive: true });
|
|
1352
|
+
}
|
|
1164
1353
|
}
|
|
1165
1354
|
}
|
|
1166
1355
|
}
|
|
@@ -1174,8 +1363,14 @@ class Parcel extends utils.Adapter {
|
|
|
1174
1363
|
if (sendung.sendungsdetails && sendung.sendungsdetails.sendungsverlauf && sendung.sendungsdetails.sendungsverlauf.kurzStatus) {
|
|
1175
1364
|
status = sendung.sendungsdetails.sendungsverlauf.kurzStatus;
|
|
1176
1365
|
}
|
|
1177
|
-
const sendungsObject = { id: sendung.id, name: sendung.sendungsinfo.sendungsname, status: status, source: "DHL"
|
|
1178
|
-
|
|
1366
|
+
const sendungsObject = { id: sendung.id, name: sendung.sendungsinfo.sendungsname, status: status, source: "DHL" };
|
|
1367
|
+
|
|
1368
|
+
sendungsObject.delivery_status = this.deliveryStatusCheck(sendung, id, sendungsObject);
|
|
1369
|
+
if (sendungsObject.delivery_status === this.delivery_status.OUT_FOR_DELIVERY) {
|
|
1370
|
+
sendungsObject.inDelivery = true;
|
|
1371
|
+
this.inDelivery.push(sendungsObject);
|
|
1372
|
+
}
|
|
1373
|
+
sendungsObject.direction = sendung.sendungsinfo.sendungsrichtung;
|
|
1179
1374
|
this.mergedJsonObject[sendung.id] = sendungsObject;
|
|
1180
1375
|
return sendungsObject;
|
|
1181
1376
|
});
|
|
@@ -1184,7 +1379,12 @@ class Parcel extends utils.Adapter {
|
|
|
1184
1379
|
if (id === "gls" && data.sendungen) {
|
|
1185
1380
|
const sendungsArray = data.sendungen.map((sendung) => {
|
|
1186
1381
|
const sendungsObject = { id: sendung.id, name: sendung.label || sendung.parcelNumber, status: sendung.status, source: "GLS", direction: sendung.type };
|
|
1187
|
-
|
|
1382
|
+
|
|
1383
|
+
sendungsObject.delivery_status = this.deliveryStatusCheck(sendung, id, sendungsObject);
|
|
1384
|
+
if (sendungsObject.delivery_status === this.delivery_status.OUT_FOR_DELIVERY) {
|
|
1385
|
+
sendungsObject.inDelivery = true;
|
|
1386
|
+
this.inDelivery.push(sendungsObject);
|
|
1387
|
+
}
|
|
1188
1388
|
this.mergedJsonObject[sendung.id] = sendungsObject;
|
|
1189
1389
|
return sendungsObject;
|
|
1190
1390
|
});
|
|
@@ -1194,7 +1394,11 @@ class Parcel extends utils.Adapter {
|
|
|
1194
1394
|
const sendungsArray = data.sendungen.map((sendung) => {
|
|
1195
1395
|
const sendungsObject = { id: sendung.id, name: sendung.shipFromName, status: sendung.locStatus || sendung.status, source: "UPS" };
|
|
1196
1396
|
|
|
1197
|
-
sendungsObject.
|
|
1397
|
+
sendungsObject.delivery_status = this.deliveryStatusCheck(sendung, id, sendungsObject);
|
|
1398
|
+
if (sendungsObject.delivery_status === this.delivery_status.OUT_FOR_DELIVERY) {
|
|
1399
|
+
sendungsObject.inDelivery = true;
|
|
1400
|
+
this.inDelivery.push(sendungsObject);
|
|
1401
|
+
}
|
|
1198
1402
|
this.mergedJsonObject[sendung.id] = sendungsObject;
|
|
1199
1403
|
|
|
1200
1404
|
return sendungsObject;
|
|
@@ -1203,8 +1407,17 @@ class Parcel extends utils.Adapter {
|
|
|
1203
1407
|
}
|
|
1204
1408
|
if (id === "hermes" && data.sendungen) {
|
|
1205
1409
|
const sendungsArray = data.sendungen.map((sendung) => {
|
|
1206
|
-
|
|
1207
|
-
|
|
1410
|
+
let name = sendung.description;
|
|
1411
|
+
if (sendung.sender && sendung.sender.lastname) {
|
|
1412
|
+
name = name + " " + sendung.sender.lastname;
|
|
1413
|
+
}
|
|
1414
|
+
const sendungsObject = { id: sendung.id, name: name, status: sendung.lastStatusMessage || "", source: "Hermes" };
|
|
1415
|
+
|
|
1416
|
+
sendungsObject.delivery_status = this.deliveryStatusCheck(sendung, id, sendungsObject);
|
|
1417
|
+
if (sendungsObject.delivery_status === this.delivery_status.OUT_FOR_DELIVERY) {
|
|
1418
|
+
sendungsObject.inDelivery = true;
|
|
1419
|
+
this.inDelivery.push(sendungsObject);
|
|
1420
|
+
}
|
|
1208
1421
|
this.mergedJsonObject[sendung.id] = sendungsObject;
|
|
1209
1422
|
|
|
1210
1423
|
return sendungsObject;
|
|
@@ -1215,25 +1428,43 @@ class Parcel extends utils.Adapter {
|
|
|
1215
1428
|
if (id === "dpd" && data && data.sendungen) {
|
|
1216
1429
|
for (const sendung of data.sendungen) {
|
|
1217
1430
|
sendung.source = "DPD";
|
|
1218
|
-
sendung.
|
|
1219
|
-
|
|
1431
|
+
sendung.delivery_status = this.deliveryStatusCheck(sendung, id, sendung);
|
|
1432
|
+
if (sendung.delivery_status === this.delivery_status.OUT_FOR_DELIVERY) {
|
|
1433
|
+
sendung.inDelivery = true;
|
|
1434
|
+
this.inDelivery.push(sendung);
|
|
1435
|
+
}
|
|
1436
|
+
if (!sendung.delivery_status) {
|
|
1437
|
+
this.log.warn("Missing status for " + JSON.stringify(sendung));
|
|
1438
|
+
}
|
|
1220
1439
|
this.mergedJsonObject[sendung.id] = sendung;
|
|
1221
1440
|
}
|
|
1222
1441
|
this.mergedJson = this.mergedJson.concat(data.sendungen);
|
|
1223
1442
|
}
|
|
1224
1443
|
if (id === "amz" && data && data.sendungen) {
|
|
1225
|
-
|
|
1226
|
-
sendung.source
|
|
1227
|
-
|
|
1228
|
-
this.
|
|
1229
|
-
|
|
1230
|
-
|
|
1444
|
+
const sendungsArray = data.sendungen.map((sendung) => {
|
|
1445
|
+
const sendungsObject = { id: sendung.id, name: sendung.name, status: sendung.status, source: "AMZ" };
|
|
1446
|
+
|
|
1447
|
+
sendungsObject.delivery_status = this.deliveryStatusCheck(sendung, id, sendungsObject);
|
|
1448
|
+
if (sendungsObject.delivery_status === this.delivery_status.OUT_FOR_DELIVERY) {
|
|
1449
|
+
sendungsObject.inDelivery = true;
|
|
1450
|
+
this.inDelivery.push(sendungsObject);
|
|
1451
|
+
}
|
|
1452
|
+
this.mergedJsonObject[sendung.id] = sendungsObject;
|
|
1453
|
+
|
|
1454
|
+
return sendungsObject;
|
|
1455
|
+
});
|
|
1456
|
+
this.mergedJson = this.mergedJson.concat(sendungsArray);
|
|
1231
1457
|
}
|
|
1232
1458
|
if (id === "17track" && data.accepted) {
|
|
1233
1459
|
const sendungsArray = data.accepted.map((sendung) => {
|
|
1234
1460
|
const sendungsObject = { id: sendung.number, name: sendung.number, status: sendung.track.z0 ? sendung.track.z0.z : "", source: "17track" };
|
|
1235
1461
|
if (!this.mergedJsonObject[sendung.id]) {
|
|
1236
|
-
sendungsObject.
|
|
1462
|
+
sendungsObject.delivery_status = this.deliveryStatusCheck(sendung, id, sendungsObject);
|
|
1463
|
+
if (sendungsObject.delivery_status === this.delivery_status.OUT_FOR_DELIVERY) {
|
|
1464
|
+
sendungsObject.inDelivery = true;
|
|
1465
|
+
this.inDelivery.push(sendungsObject);
|
|
1466
|
+
}
|
|
1467
|
+
|
|
1237
1468
|
this.mergedJsonObject[sendung.id] = sendungsObject;
|
|
1238
1469
|
}
|
|
1239
1470
|
return sendungsObject;
|
|
@@ -1248,7 +1479,12 @@ class Parcel extends utils.Adapter {
|
|
|
1248
1479
|
}
|
|
1249
1480
|
const sendungsObject = { id: sendung.FTrackNo, name: sendung.FTrackInfoId, status: sendung.FLastEvent ? sendung.FLastEvent.z : "", source: "17tuser" };
|
|
1250
1481
|
if (!this.mergedJsonObject[sendung.id]) {
|
|
1251
|
-
sendungsObject.
|
|
1482
|
+
sendungsObject.delivery_status = this.deliveryStatusCheck(sendung, id, sendungsObject);
|
|
1483
|
+
if (sendungsObject.delivery_status === this.delivery_status.OUT_FOR_DELIVERY) {
|
|
1484
|
+
sendungsObject.inDelivery = true;
|
|
1485
|
+
this.inDelivery.push(sendungsObject);
|
|
1486
|
+
}
|
|
1487
|
+
|
|
1252
1488
|
this.mergedJsonObject[sendung.id] = sendungsObject;
|
|
1253
1489
|
}
|
|
1254
1490
|
return sendungsObject;
|
|
@@ -1262,6 +1498,7 @@ class Parcel extends utils.Adapter {
|
|
|
1262
1498
|
this.setState("allProviderJson", JSON.stringify(this.mergedJson), true);
|
|
1263
1499
|
this.setState("allProviderObjects", JSON.stringify(this.mergedJsonObject), true);
|
|
1264
1500
|
this.setState("inDelivery", JSON.stringify(this.inDelivery), true);
|
|
1501
|
+
this.setState("inDeliveryCount", this.inDelivery.length, true);
|
|
1265
1502
|
|
|
1266
1503
|
if (this.config.sendToActive) {
|
|
1267
1504
|
const sendungen = this.mergedJsonObject;
|
|
@@ -1283,25 +1520,109 @@ class Parcel extends utils.Adapter {
|
|
|
1283
1520
|
}
|
|
1284
1521
|
}
|
|
1285
1522
|
inDeliveryCheck(sendungsObject) {
|
|
1523
|
+
if (!sendungsObject.status) {
|
|
1524
|
+
return false;
|
|
1525
|
+
}
|
|
1286
1526
|
if (
|
|
1287
1527
|
sendungsObject.status.toLocaleLowerCase().includes("in zustellung") ||
|
|
1288
1528
|
sendungsObject.status.toLocaleLowerCase().includes("zustellung heute") ||
|
|
1289
|
-
sendungsObject.status.toLocaleLowerCase().includes("heute zugestell") ||
|
|
1529
|
+
//sendungsObject.status.toLocaleLowerCase().includes("heute zugestell") ||
|
|
1290
1530
|
sendungsObject.status.toLocaleLowerCase().includes("wird zugestellt") ||
|
|
1291
1531
|
sendungsObject.status.toLocaleLowerCase().includes("zustellfahrzeug")
|
|
1292
1532
|
) {
|
|
1293
|
-
if (
|
|
1294
|
-
sendungsObject.status.toLocaleLowerCase().includes("geliefert heute") ||
|
|
1295
|
-
sendungsObject.status.toLocaleLowerCase().includes("unterschrieben von") ||
|
|
1296
|
-
sendungsObject.status.toLocaleLowerCase().includes("hausbewohner übergeben")
|
|
1297
|
-
) {
|
|
1533
|
+
if (this.deliveredCheck(sendungsObject)) {
|
|
1298
1534
|
return false;
|
|
1299
1535
|
}
|
|
1300
|
-
this.inDelivery.push(sendungsObject);
|
|
1301
1536
|
return true;
|
|
1302
1537
|
}
|
|
1303
1538
|
return false;
|
|
1304
1539
|
}
|
|
1540
|
+
deliveredCheck(sendungsObject) {
|
|
1541
|
+
if (!sendungsObject.status) {
|
|
1542
|
+
return false;
|
|
1543
|
+
}
|
|
1544
|
+
if (
|
|
1545
|
+
sendungsObject.status.toLocaleLowerCase().includes("geliefert heute") ||
|
|
1546
|
+
sendungsObject.status.toLocaleLowerCase().includes("geliefert. heute zugestellt") ||
|
|
1547
|
+
sendungsObject.status.toLocaleLowerCase().includes("unterschrieben von") ||
|
|
1548
|
+
sendungsObject.status.toLocaleLowerCase().includes("hausbewohner übergeben") ||
|
|
1549
|
+
sendungsObject.status.toLocaleLowerCase().includes("zustellung erfolgreich") ||
|
|
1550
|
+
sendungsObject.status.toLocaleLowerCase().includes("paket zugestellt")
|
|
1551
|
+
) {
|
|
1552
|
+
return true;
|
|
1553
|
+
}
|
|
1554
|
+
return false;
|
|
1555
|
+
}
|
|
1556
|
+
deliveryStatusCheck(sendung, id, sendungsObject) {
|
|
1557
|
+
try {
|
|
1558
|
+
if (sendung) {
|
|
1559
|
+
if (id === "dhl" && sendung.sendungsdetails && sendung.sendungsdetails.sendungsverlauf && sendung.sendungsdetails.sendungsverlauf.fortschritt) {
|
|
1560
|
+
const dhl_status = {
|
|
1561
|
+
0: this.delivery_status.REGISTERED,
|
|
1562
|
+
1: this.delivery_status.REGISTERED,
|
|
1563
|
+
2: this.delivery_status.IN_PREPARATION,
|
|
1564
|
+
3: this.delivery_status.IN_TRANSIT,
|
|
1565
|
+
4: this.delivery_status.OUT_FOR_DELIVERY,
|
|
1566
|
+
5: this.delivery_status.DELIVERED,
|
|
1567
|
+
};
|
|
1568
|
+
if (dhl_status[sendung.sendungsdetails.sendungsverlauf.fortschritt] !== undefined) {
|
|
1569
|
+
return dhl_status[sendung.sendungsdetails.sendungsverlauf.fortschritt];
|
|
1570
|
+
}
|
|
1571
|
+
}
|
|
1572
|
+
if (id === "hermes" && sendung.lastStatusId) {
|
|
1573
|
+
const hermes_status = {
|
|
1574
|
+
0: this.delivery_status.REGISTERED,
|
|
1575
|
+
1: this.delivery_status.REGISTERED,
|
|
1576
|
+
2: this.delivery_status.IN_PREPARATION,
|
|
1577
|
+
3: this.delivery_status.IN_TRANSIT,
|
|
1578
|
+
4: this.delivery_status.OUT_FOR_DELIVERY,
|
|
1579
|
+
5: this.delivery_status.DELIVERED,
|
|
1580
|
+
};
|
|
1581
|
+
if (hermes_status[sendung.lastStatusId] !== undefined) {
|
|
1582
|
+
return hermes_status[sendung.lastStatusId];
|
|
1583
|
+
}
|
|
1584
|
+
}
|
|
1585
|
+
if (id === "gls" && sendung.status) {
|
|
1586
|
+
const gls_status = {
|
|
1587
|
+
0: this.delivery_status.REGISTERED,
|
|
1588
|
+
1: this.delivery_status.REGISTERED,
|
|
1589
|
+
2: this.delivery_status.IN_PREPARATION,
|
|
1590
|
+
3: this.delivery_status.IN_TRANSIT,
|
|
1591
|
+
4: this.delivery_status.OUT_FOR_DELIVERY,
|
|
1592
|
+
DELIVERED: this.delivery_status.DELIVERED,
|
|
1593
|
+
};
|
|
1594
|
+
if (gls_status[sendung.lastStatusId] !== undefined) {
|
|
1595
|
+
return gls_status[sendung.lastStatusId];
|
|
1596
|
+
}
|
|
1597
|
+
}
|
|
1598
|
+
if (id === "amz" && sendung.detailedState && sendung.detailedState.progressTracker && sendung.detailedState.progressTracker.numberOfReachedMilestones) {
|
|
1599
|
+
const amz_status = {
|
|
1600
|
+
0: this.delivery_status.REGISTERED,
|
|
1601
|
+
1: this.delivery_status.REGISTERED,
|
|
1602
|
+
2: this.delivery_status.IN_TRANSIT,
|
|
1603
|
+
3: this.delivery_status.OUT_FOR_DELIVERY,
|
|
1604
|
+
4: this.delivery_status.DELIVERED,
|
|
1605
|
+
};
|
|
1606
|
+
if (amz_status[sendung.detailedState.progressTracker.numberOfReachedMilestones] !== undefined) {
|
|
1607
|
+
return amz_status[sendung.detailedState.progressTracker.numberOfReachedMilestones];
|
|
1608
|
+
}
|
|
1609
|
+
}
|
|
1610
|
+
}
|
|
1611
|
+
if (sendungsObject) {
|
|
1612
|
+
if (this.inDeliveryCheck(sendungsObject)) {
|
|
1613
|
+
return this.delivery_status.OUT_FOR_DELIVERY;
|
|
1614
|
+
}
|
|
1615
|
+
if (this.deliveredCheck(sendungsObject)) {
|
|
1616
|
+
return this.delivery_status.DELIVERED;
|
|
1617
|
+
}
|
|
1618
|
+
}
|
|
1619
|
+
|
|
1620
|
+
return this.delivery_status["UNKOWN"];
|
|
1621
|
+
} catch (error) {
|
|
1622
|
+
this.log.error(error);
|
|
1623
|
+
return this.delivery_status["ERROR"];
|
|
1624
|
+
}
|
|
1625
|
+
}
|
|
1305
1626
|
|
|
1306
1627
|
async activateToken(grant_token, url) {
|
|
1307
1628
|
await this.requestClient({
|
|
@@ -1385,6 +1706,10 @@ class Parcel extends utils.Adapter {
|
|
|
1385
1706
|
this.log.error(JSON.stringify(error.response.data));
|
|
1386
1707
|
}
|
|
1387
1708
|
});
|
|
1709
|
+
if (!orders) {
|
|
1710
|
+
this.log.warn("No Amazon orders found");
|
|
1711
|
+
return;
|
|
1712
|
+
}
|
|
1388
1713
|
this.log.debug("Found " + orders.length + " Amazon Orders");
|
|
1389
1714
|
for (const order of orders) {
|
|
1390
1715
|
if (order.url.indexOf("http") === -1) {
|
|
@@ -1470,8 +1795,10 @@ class Parcel extends utils.Adapter {
|
|
|
1470
1795
|
}
|
|
1471
1796
|
|
|
1472
1797
|
this.json2iob.parse("amazon", amzResult, { forceIndex: true });
|
|
1798
|
+
|
|
1473
1799
|
this.mergeProviderJson("amz", amzResult);
|
|
1474
1800
|
await this.setStateAsync("auth.cookie", JSON.stringify(this.cookieJar.toJSON()), true);
|
|
1801
|
+
await this.setStateAsync("amazon.json", JSON.stringify(amzResult), true);
|
|
1475
1802
|
}
|
|
1476
1803
|
async refreshToken() {
|
|
1477
1804
|
if (Object.keys(this.sessions).length === 0) {
|
|
@@ -1519,7 +1846,7 @@ class Parcel extends utils.Adapter {
|
|
|
1519
1846
|
});
|
|
1520
1847
|
}
|
|
1521
1848
|
if (id === "dpd") {
|
|
1522
|
-
|
|
1849
|
+
this.loginDPD(true);
|
|
1523
1850
|
}
|
|
1524
1851
|
if (id === "17tuser") {
|
|
1525
1852
|
this.login17T(true);
|
|
@@ -1741,7 +2068,7 @@ class Parcel extends utils.Adapter {
|
|
|
1741
2068
|
});
|
|
1742
2069
|
}
|
|
1743
2070
|
} else {
|
|
1744
|
-
if (id.indexOf("dhl.briefe") !== -1 && id.indexOf("image_url") !== -1) {
|
|
2071
|
+
if (id.indexOf("dhl.briefe") !== -1 && id.indexOf("image_url") !== -1 && id.indexOf("oldAdvices") === -1) {
|
|
1745
2072
|
let imageBase64 = this.images[state.val];
|
|
1746
2073
|
if (!imageBase64) {
|
|
1747
2074
|
const image = await this.requestClient({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "iobroker.parcel",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.12",
|
|
4
4
|
"description": "Parcel tracking",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "TA2k",
|
|
@@ -25,18 +25,17 @@
|
|
|
25
25
|
"url": "https://github.com/TA2k/ioBroker.parcel"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
+
"@applitools/jsdom": "^1.0.4",
|
|
28
29
|
"@iobroker/adapter-core": "^2.6.0",
|
|
29
30
|
"axios": "^0.25.0",
|
|
30
|
-
"
|
|
31
|
-
"http-cookie-agent": "^1.0.3",
|
|
32
|
-
"jsdom": "^19.0.0",
|
|
31
|
+
"http-cookie-agent": "^1.0.5",
|
|
33
32
|
"json-bigint": "^1.0.0",
|
|
34
33
|
"qs": "^6.10.3",
|
|
35
34
|
"tough-cookie": "^4.0.0",
|
|
36
35
|
"uuid": "^8.3.2"
|
|
37
36
|
},
|
|
38
37
|
"devDependencies": {
|
|
39
|
-
"@iobroker/testing": "^2.5.
|
|
38
|
+
"@iobroker/testing": "^2.5.6",
|
|
40
39
|
"@types/chai": "^4.3.0",
|
|
41
40
|
"@types/chai-as-promised": "^7.1.5",
|
|
42
41
|
"@types/gulp": "^4.0.9",
|
|
@@ -48,7 +47,7 @@
|
|
|
48
47
|
"chai": "^4.3.6",
|
|
49
48
|
"chai-as-promised": "^7.1.1",
|
|
50
49
|
"eslint": "^7.32.0",
|
|
51
|
-
"mocha": "^9.2.
|
|
50
|
+
"mocha": "^9.2.2",
|
|
52
51
|
"proxyquire": "^2.1.3",
|
|
53
52
|
"sinon": "^12.0.1",
|
|
54
53
|
"sinon-chai": "^3.7.0",
|