iobroker.parcel 0.0.21 → 0.0.23
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 +288 -281
- package/main.js +67 -14
- package/package.json +77 -77
package/io-package.json
CHANGED
|
@@ -1,287 +1,294 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
2
|
+
"common": {
|
|
3
|
+
"name": "parcel",
|
|
4
|
+
"version": "0.0.23",
|
|
5
|
+
"news": {
|
|
6
|
+
"0.0.23": {
|
|
7
|
+
"en": "Disable Pictures of Briefankündigung",
|
|
8
|
+
"de": "Bilder der Briefankündigung deaktiviert"
|
|
9
|
+
},
|
|
10
|
+
"0.0.22": {
|
|
11
|
+
"en": "Fix Amazon Login"
|
|
12
|
+
},
|
|
13
|
+
"0.0.21": {
|
|
14
|
+
"en": "Fix Brief images and pushover user"
|
|
15
|
+
},
|
|
16
|
+
"0.0.20": {
|
|
17
|
+
"en": "Fix GLS Parcel"
|
|
18
|
+
},
|
|
19
|
+
"0.0.18": {
|
|
20
|
+
"en": "Fix UPS/GLS login"
|
|
21
|
+
},
|
|
22
|
+
"0.0.15": {
|
|
23
|
+
"en": "Fix DPD states and remove canvas dependency"
|
|
24
|
+
},
|
|
25
|
+
"0.0.13": {
|
|
26
|
+
"en": "Fix Amazon delivery state, add telegram user"
|
|
27
|
+
},
|
|
28
|
+
"0.0.12": {
|
|
29
|
+
"en": "Add delivery status"
|
|
30
|
+
},
|
|
31
|
+
"0.0.11": {
|
|
32
|
+
"en": "Briefankündigung wird gestoppt, falls sie nicht funktioniert"
|
|
33
|
+
},
|
|
34
|
+
"0.0.10": {
|
|
35
|
+
"en": "in Zustellung DP, DPD Bugfix, detailierte DPs für Amazon, Option für keine Benachrichtigung bei Adapterstart"
|
|
36
|
+
},
|
|
37
|
+
"0.0.8": {
|
|
38
|
+
"en": "Hermes hinzugefügt"
|
|
39
|
+
},
|
|
40
|
+
"0.0.7": {
|
|
41
|
+
"en": "Datenpunkt für in Zustellung hinzugefügt, Fix für wiederholende Benachrichtigungen"
|
|
42
|
+
},
|
|
43
|
+
"0.0.6": {
|
|
44
|
+
"en": "initial release",
|
|
45
|
+
"de": "Erstveröffentlichung",
|
|
46
|
+
"ru": "Начальная версия",
|
|
47
|
+
"pt": "lançamento inicial",
|
|
48
|
+
"nl": "Eerste uitgave",
|
|
49
|
+
"fr": "Première version",
|
|
50
|
+
"it": "Versione iniziale",
|
|
51
|
+
"es": "Versión inicial",
|
|
52
|
+
"pl": "Pierwsze wydanie",
|
|
53
|
+
"zh-cn": "首次出版"
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
"title": "Parcel tracking",
|
|
57
|
+
"titleLang": {
|
|
58
|
+
"en": "Parcel tracking",
|
|
59
|
+
"de": "Paket Sendungsverfolgung",
|
|
60
|
+
"ru": "Отслеживание посылок",
|
|
61
|
+
"pt": "Rastreamento de encomendas",
|
|
62
|
+
"nl": "Pakket volgen",
|
|
63
|
+
"fr": "Suivi colis",
|
|
64
|
+
"it": "Tracciamento del pacco",
|
|
65
|
+
"es": "Seguimiento de paquetes",
|
|
66
|
+
"pl": "Śledzenie przesyłek",
|
|
67
|
+
"zh-cn": "包裹追踪"
|
|
68
|
+
},
|
|
69
|
+
"desc": {
|
|
70
|
+
"en": "Parcel tracking",
|
|
71
|
+
"de": "Paket Sendungsverfolgung",
|
|
72
|
+
"ru": "Отслеживание посылок",
|
|
73
|
+
"pt": "Rastreamento de encomendas",
|
|
74
|
+
"nl": "Pakket volgen",
|
|
75
|
+
"fr": "Suivi colis",
|
|
76
|
+
"it": "Tracciamento del pacco",
|
|
77
|
+
"es": "Seguimiento de paquetes",
|
|
78
|
+
"pl": "Śledzenie przesyłek",
|
|
79
|
+
"zh-cn": "包裹追踪"
|
|
80
|
+
},
|
|
81
|
+
"authors": ["TA2k <tombox2020@gmail.com>"],
|
|
82
|
+
"keywords": [
|
|
83
|
+
"parcel",
|
|
84
|
+
"tracking",
|
|
85
|
+
"paketverfolgung",
|
|
86
|
+
"sendungsverfolgung",
|
|
87
|
+
"dhl",
|
|
88
|
+
"gls",
|
|
89
|
+
"ups",
|
|
90
|
+
"hermes",
|
|
91
|
+
"paket",
|
|
92
|
+
"17Track",
|
|
93
|
+
"Amazon",
|
|
94
|
+
"dpd",
|
|
95
|
+
"briefe"
|
|
96
|
+
],
|
|
97
|
+
"license": "MIT",
|
|
98
|
+
"platform": "Javascript/Node.js",
|
|
99
|
+
"main": "main.js",
|
|
100
|
+
"icon": "parcel.png",
|
|
101
|
+
"enabled": true,
|
|
102
|
+
"extIcon": "https://raw.githubusercontent.com/TA2k/ioBroker.parcel/master/admin/parcel.png",
|
|
103
|
+
"readme": "https://github.com/TA2k/ioBroker.parcel/blob/master/README.md",
|
|
104
|
+
"loglevel": "info",
|
|
105
|
+
"mode": "daemon",
|
|
106
|
+
"type": "misc-data",
|
|
107
|
+
"compact": true,
|
|
108
|
+
"connectionType": "cloud",
|
|
109
|
+
"dataSource": "poll",
|
|
110
|
+
"materialize": true,
|
|
111
|
+
"plugins": {
|
|
112
|
+
"sentry": {
|
|
113
|
+
"dsn": "https://6296452769de44959c1809642564a7e3@sentry.iobroker.net/171"
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
"dependencies": [
|
|
117
|
+
{
|
|
118
|
+
"js-controller": ">=3.2.0"
|
|
119
|
+
}
|
|
120
|
+
],
|
|
121
|
+
"globalDependencies": [
|
|
122
|
+
{
|
|
123
|
+
"admin": ">=4.0.9"
|
|
124
|
+
}
|
|
125
|
+
]
|
|
48
126
|
},
|
|
49
|
-
"
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
"pl": "Śledzenie przesyłek",
|
|
60
|
-
"zh-cn": "包裹追踪"
|
|
61
|
-
},
|
|
62
|
-
"desc": {
|
|
63
|
-
"en": "Parcel tracking",
|
|
64
|
-
"de": "Paket Sendungsverfolgung",
|
|
65
|
-
"ru": "Отслеживание посылок",
|
|
66
|
-
"pt": "Rastreamento de encomendas",
|
|
67
|
-
"nl": "Pakket volgen",
|
|
68
|
-
"fr": "Suivi colis",
|
|
69
|
-
"it": "Tracciamento del pacco",
|
|
70
|
-
"es": "Seguimiento de paquetes",
|
|
71
|
-
"pl": "Śledzenie przesyłek",
|
|
72
|
-
"zh-cn": "包裹追踪"
|
|
73
|
-
},
|
|
74
|
-
"authors": ["TA2k <tombox2020@gmail.com>"],
|
|
75
|
-
"keywords": [
|
|
76
|
-
"parcel",
|
|
77
|
-
"tracking",
|
|
78
|
-
"paketverfolgung",
|
|
79
|
-
"sendungsverfolgung",
|
|
80
|
-
"dhl",
|
|
81
|
-
"gls",
|
|
82
|
-
"ups",
|
|
83
|
-
"hermes",
|
|
84
|
-
"paket",
|
|
85
|
-
"17Track",
|
|
86
|
-
"Amazon",
|
|
87
|
-
"dpd",
|
|
88
|
-
"briefe"
|
|
127
|
+
"encryptedNative": [
|
|
128
|
+
"dhlpassword",
|
|
129
|
+
"amzpassword",
|
|
130
|
+
"dpdpassword",
|
|
131
|
+
"t17password",
|
|
132
|
+
"upspassword",
|
|
133
|
+
"hermespassword",
|
|
134
|
+
"postchpassword",
|
|
135
|
+
"postatpassword",
|
|
136
|
+
"glspassword"
|
|
89
137
|
],
|
|
90
|
-
"
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
"compact": true,
|
|
101
|
-
"connectionType": "cloud",
|
|
102
|
-
"dataSource": "poll",
|
|
103
|
-
"materialize": true,
|
|
104
|
-
"plugins": {
|
|
105
|
-
"sentry": {
|
|
106
|
-
"dsn": "https://6296452769de44959c1809642564a7e3@sentry.iobroker.net/171"
|
|
107
|
-
}
|
|
108
|
-
},
|
|
109
|
-
"dependencies": [
|
|
110
|
-
{
|
|
111
|
-
"js-controller": ">=3.2.0"
|
|
112
|
-
}
|
|
138
|
+
"protectedNative": [
|
|
139
|
+
"dhlpassword",
|
|
140
|
+
"amzpassword",
|
|
141
|
+
"dpdpassword",
|
|
142
|
+
"t17password",
|
|
143
|
+
"upspassword",
|
|
144
|
+
"hermespassword",
|
|
145
|
+
"postchpassword",
|
|
146
|
+
"postatpassword",
|
|
147
|
+
"glspassword"
|
|
113
148
|
],
|
|
114
|
-
"
|
|
115
|
-
|
|
116
|
-
"
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
],
|
|
142
|
-
"native": {
|
|
143
|
-
"amzusername": "",
|
|
144
|
-
"amzpassword": "",
|
|
145
|
-
"glsusername": "",
|
|
146
|
-
"glspassword": "",
|
|
147
|
-
"upsusername": "",
|
|
148
|
-
"upspassword": "",
|
|
149
|
-
"hermespassword": "",
|
|
150
|
-
"hermesusername": "",
|
|
151
|
-
"postchusername": "",
|
|
152
|
-
"postchpassword": "",
|
|
153
|
-
"postatusername": "",
|
|
154
|
-
"postatpassword": "",
|
|
155
|
-
"amzotp": "",
|
|
156
|
-
"t17username": "",
|
|
157
|
-
"t17password": "",
|
|
158
|
-
"dpdusername": "",
|
|
159
|
-
"dpdpassword": "",
|
|
160
|
-
"dhlusername": "",
|
|
161
|
-
"dhlpassword": "",
|
|
162
|
-
"dhlMfa": "",
|
|
163
|
-
"17trackKey": "",
|
|
164
|
-
"sendToActive": false,
|
|
165
|
-
"noFirstStartSend": false,
|
|
166
|
-
"sendToInstance": "telegram.0",
|
|
167
|
-
"sendToUser": "",
|
|
168
|
-
"interval": 10
|
|
169
|
-
},
|
|
170
|
-
"objects": [],
|
|
171
|
-
"instanceObjects": [
|
|
172
|
-
{
|
|
173
|
-
"_id": "info",
|
|
174
|
-
"type": "channel",
|
|
175
|
-
"common": {
|
|
176
|
-
"name": "Information"
|
|
177
|
-
},
|
|
178
|
-
"native": {}
|
|
179
|
-
},
|
|
180
|
-
{
|
|
181
|
-
"_id": "allProviderJson",
|
|
182
|
-
"type": "state",
|
|
183
|
-
"common": {
|
|
184
|
-
"role": "json",
|
|
185
|
-
"name": "Tracking List of all Providers",
|
|
186
|
-
"type": "string",
|
|
187
|
-
"read": true,
|
|
188
|
-
"write": false
|
|
189
|
-
},
|
|
190
|
-
"native": {}
|
|
191
|
-
},
|
|
192
|
-
{
|
|
193
|
-
"_id": "allProviderObjects",
|
|
194
|
-
"type": "state",
|
|
195
|
-
"common": {
|
|
196
|
-
"role": "json",
|
|
197
|
-
"name": "Tracking Dictionary of all Providers",
|
|
198
|
-
"type": "string",
|
|
199
|
-
"read": true,
|
|
200
|
-
"write": false
|
|
201
|
-
},
|
|
202
|
-
"native": {}
|
|
203
|
-
},
|
|
204
|
-
{
|
|
205
|
-
"_id": "inDelivery",
|
|
206
|
-
"type": "state",
|
|
207
|
-
"common": {
|
|
208
|
-
"role": "json",
|
|
209
|
-
"name": "Today in delivery/Heute in Zustellung",
|
|
210
|
-
"type": "string",
|
|
211
|
-
"read": true,
|
|
212
|
-
"write": false
|
|
213
|
-
},
|
|
214
|
-
"native": {}
|
|
149
|
+
"native": {
|
|
150
|
+
"amzusername": "",
|
|
151
|
+
"amzpassword": "",
|
|
152
|
+
"glsusername": "",
|
|
153
|
+
"glspassword": "",
|
|
154
|
+
"upsusername": "",
|
|
155
|
+
"upspassword": "",
|
|
156
|
+
"hermespassword": "",
|
|
157
|
+
"hermesusername": "",
|
|
158
|
+
"postchusername": "",
|
|
159
|
+
"postchpassword": "",
|
|
160
|
+
"postatusername": "",
|
|
161
|
+
"postatpassword": "",
|
|
162
|
+
"amzotp": "",
|
|
163
|
+
"t17username": "",
|
|
164
|
+
"t17password": "",
|
|
165
|
+
"dpdusername": "",
|
|
166
|
+
"dpdpassword": "",
|
|
167
|
+
"dhlusername": "",
|
|
168
|
+
"dhlpassword": "",
|
|
169
|
+
"dhlMfa": "",
|
|
170
|
+
"17trackKey": "",
|
|
171
|
+
"sendToActive": false,
|
|
172
|
+
"noFirstStartSend": false,
|
|
173
|
+
"sendToInstance": "telegram.0",
|
|
174
|
+
"sendToUser": "",
|
|
175
|
+
"interval": 10
|
|
215
176
|
},
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
177
|
+
"objects": [],
|
|
178
|
+
"instanceObjects": [
|
|
179
|
+
{
|
|
180
|
+
"_id": "info",
|
|
181
|
+
"type": "channel",
|
|
182
|
+
"common": {
|
|
183
|
+
"name": "Information"
|
|
184
|
+
},
|
|
185
|
+
"native": {}
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
"_id": "allProviderJson",
|
|
189
|
+
"type": "state",
|
|
190
|
+
"common": {
|
|
191
|
+
"role": "json",
|
|
192
|
+
"name": "Tracking List of all Providers",
|
|
193
|
+
"type": "string",
|
|
194
|
+
"read": true,
|
|
195
|
+
"write": false
|
|
196
|
+
},
|
|
197
|
+
"native": {}
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
"_id": "allProviderObjects",
|
|
201
|
+
"type": "state",
|
|
202
|
+
"common": {
|
|
203
|
+
"role": "json",
|
|
204
|
+
"name": "Tracking Dictionary of all Providers",
|
|
205
|
+
"type": "string",
|
|
206
|
+
"read": true,
|
|
207
|
+
"write": false
|
|
208
|
+
},
|
|
209
|
+
"native": {}
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
"_id": "inDelivery",
|
|
213
|
+
"type": "state",
|
|
214
|
+
"common": {
|
|
215
|
+
"role": "json",
|
|
216
|
+
"name": "Today in delivery/Heute in Zustellung",
|
|
217
|
+
"type": "string",
|
|
218
|
+
"read": true,
|
|
219
|
+
"write": false
|
|
220
|
+
},
|
|
221
|
+
"native": {}
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
"_id": "inDeliveryCount",
|
|
225
|
+
"type": "state",
|
|
226
|
+
"common": {
|
|
227
|
+
"role": "value",
|
|
228
|
+
"name": "Number of in delivery/Anzahl in Zustellung",
|
|
229
|
+
"type": "number",
|
|
230
|
+
"read": true,
|
|
231
|
+
"write": false
|
|
232
|
+
},
|
|
233
|
+
"native": {}
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
"_id": "auth",
|
|
237
|
+
"type": "channel",
|
|
238
|
+
"common": {
|
|
239
|
+
"name": "Auth Information"
|
|
240
|
+
},
|
|
241
|
+
"native": {}
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
"_id": "auth.dhlMfaToken",
|
|
245
|
+
"type": "state",
|
|
246
|
+
"common": {
|
|
247
|
+
"role": "state",
|
|
248
|
+
"name": "DHL Mfa Token",
|
|
249
|
+
"type": "string",
|
|
250
|
+
"read": true,
|
|
251
|
+
"write": false
|
|
252
|
+
},
|
|
253
|
+
"native": {}
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
"_id": "auth.cookie",
|
|
257
|
+
"type": "state",
|
|
258
|
+
"common": {
|
|
259
|
+
"role": "state",
|
|
260
|
+
"name": "Cookie state",
|
|
261
|
+
"type": "string",
|
|
262
|
+
"read": true,
|
|
263
|
+
"write": false
|
|
264
|
+
},
|
|
265
|
+
"native": {}
|
|
266
|
+
},
|
|
267
|
+
{
|
|
268
|
+
"_id": "info.connection",
|
|
269
|
+
"type": "state",
|
|
270
|
+
"common": {
|
|
271
|
+
"role": "indicator.connected",
|
|
272
|
+
"name": "Device or service connected",
|
|
273
|
+
"type": "boolean",
|
|
274
|
+
"read": true,
|
|
275
|
+
"write": false,
|
|
276
|
+
"def": false
|
|
277
|
+
},
|
|
278
|
+
"native": {}
|
|
279
|
+
},
|
|
280
|
+
{
|
|
281
|
+
"_id": "refresh",
|
|
282
|
+
"type": "state",
|
|
283
|
+
"common": {
|
|
284
|
+
"role": "boolean",
|
|
285
|
+
"name": "Force data refresh",
|
|
286
|
+
"type": "boolean",
|
|
287
|
+
"read": true,
|
|
288
|
+
"write": true,
|
|
289
|
+
"def": false
|
|
290
|
+
},
|
|
291
|
+
"native": {}
|
|
292
|
+
}
|
|
293
|
+
]
|
|
287
294
|
}
|
package/main.js
CHANGED
|
@@ -52,7 +52,15 @@ class Parcel extends utils.Adapter {
|
|
|
52
52
|
this.alreadySentMessages = {};
|
|
53
53
|
this.ignoredPath = [];
|
|
54
54
|
this.firstStart = true;
|
|
55
|
-
this.delivery_status = {
|
|
55
|
+
this.delivery_status = {
|
|
56
|
+
ERROR: -1,
|
|
57
|
+
UNKNOWN: 5,
|
|
58
|
+
REGISTERED: 10,
|
|
59
|
+
IN_PREPARATION: 20,
|
|
60
|
+
IN_TRANSIT: 30,
|
|
61
|
+
OUT_FOR_DELIVERY: 40,
|
|
62
|
+
DELIVERED: 1,
|
|
63
|
+
};
|
|
56
64
|
this.tmpDir = tmpdir();
|
|
57
65
|
}
|
|
58
66
|
|
|
@@ -462,7 +470,7 @@ class Parcel extends utils.Adapter {
|
|
|
462
470
|
}
|
|
463
471
|
});
|
|
464
472
|
let form = this.extractHidden(body);
|
|
465
|
-
if (form.email
|
|
473
|
+
if (form.email !== this.config.amzusername) {
|
|
466
474
|
form.email = this.config.amzusername;
|
|
467
475
|
body = await this.requestClient({
|
|
468
476
|
method: "post",
|
|
@@ -1302,7 +1310,10 @@ class Parcel extends utils.Adapter {
|
|
|
1302
1310
|
if (data) {
|
|
1303
1311
|
await this.cleanupProvider(id, data);
|
|
1304
1312
|
this.mergeProviderJson(id, data);
|
|
1305
|
-
this.json2iob.parse(element.path, data, {
|
|
1313
|
+
this.json2iob.parse(element.path, data, {
|
|
1314
|
+
forceIndex: forceIndex,
|
|
1315
|
+
preferedArrayName: preferedArrayName,
|
|
1316
|
+
});
|
|
1306
1317
|
data && this.setState(element.path + ".json", JSON.stringify(data), true);
|
|
1307
1318
|
}
|
|
1308
1319
|
})
|
|
@@ -1425,7 +1436,12 @@ class Parcel extends utils.Adapter {
|
|
|
1425
1436
|
}
|
|
1426
1437
|
if (id === "ups" && data.sendungen) {
|
|
1427
1438
|
const sendungsArray = data.sendungen.map((sendung) => {
|
|
1428
|
-
const sendungsObject = {
|
|
1439
|
+
const sendungsObject = {
|
|
1440
|
+
id: sendung.id,
|
|
1441
|
+
name: sendung.shipFromName,
|
|
1442
|
+
status: sendung.locStatus || sendung.status,
|
|
1443
|
+
source: "UPS",
|
|
1444
|
+
};
|
|
1429
1445
|
|
|
1430
1446
|
sendungsObject.delivery_status = this.deliveryStatusCheck(sendung, id, sendungsObject);
|
|
1431
1447
|
if (sendungsObject.delivery_status === this.delivery_status.OUT_FOR_DELIVERY) {
|
|
@@ -1444,7 +1460,12 @@ class Parcel extends utils.Adapter {
|
|
|
1444
1460
|
if (sendung.sender && sendung.sender.lastname) {
|
|
1445
1461
|
name = name + " " + sendung.sender.lastname;
|
|
1446
1462
|
}
|
|
1447
|
-
const sendungsObject = {
|
|
1463
|
+
const sendungsObject = {
|
|
1464
|
+
id: sendung.id,
|
|
1465
|
+
name: name,
|
|
1466
|
+
status: sendung.lastStatusMessage || "",
|
|
1467
|
+
source: "Hermes",
|
|
1468
|
+
};
|
|
1448
1469
|
|
|
1449
1470
|
sendungsObject.delivery_status = this.deliveryStatusCheck(sendung, id, sendungsObject);
|
|
1450
1471
|
if (sendungsObject.delivery_status === this.delivery_status.OUT_FOR_DELIVERY) {
|
|
@@ -1460,7 +1481,12 @@ class Parcel extends utils.Adapter {
|
|
|
1460
1481
|
|
|
1461
1482
|
if (id === "dpd" && data && data.sendungen) {
|
|
1462
1483
|
const sendungsArray = data.sendungen.map((sendung) => {
|
|
1463
|
-
const sendungsObject = {
|
|
1484
|
+
const sendungsObject = {
|
|
1485
|
+
id: sendung.id,
|
|
1486
|
+
name: sendung.name,
|
|
1487
|
+
status: sendung.status || "",
|
|
1488
|
+
source: "DPD",
|
|
1489
|
+
};
|
|
1464
1490
|
|
|
1465
1491
|
sendungsObject.delivery_status = this.deliveryStatusCheck(sendung, id, sendungsObject);
|
|
1466
1492
|
if (sendungsObject.delivery_status === this.delivery_status.OUT_FOR_DELIVERY) {
|
|
@@ -1490,7 +1516,12 @@ class Parcel extends utils.Adapter {
|
|
|
1490
1516
|
}
|
|
1491
1517
|
if (id === "17track" && data.accepted) {
|
|
1492
1518
|
const sendungsArray = data.accepted.map((sendung) => {
|
|
1493
|
-
const sendungsObject = {
|
|
1519
|
+
const sendungsObject = {
|
|
1520
|
+
id: sendung.number,
|
|
1521
|
+
name: sendung.number,
|
|
1522
|
+
status: sendung.track.z0 ? sendung.track.z0.z : "",
|
|
1523
|
+
source: "17track",
|
|
1524
|
+
};
|
|
1494
1525
|
if (!this.mergedJsonObject[sendung.id]) {
|
|
1495
1526
|
sendungsObject.delivery_status = this.deliveryStatusCheck(sendung, id, sendungsObject);
|
|
1496
1527
|
if (sendungsObject.delivery_status === this.delivery_status.OUT_FOR_DELIVERY) {
|
|
@@ -1552,7 +1583,11 @@ class Parcel extends utils.Adapter {
|
|
|
1552
1583
|
if (sendUser.length > 0) {
|
|
1553
1584
|
for (const user of sendUser) {
|
|
1554
1585
|
if (sendInstance.includes("pushover")) {
|
|
1555
|
-
await this.sendToAsync(sendInstance, {
|
|
1586
|
+
await this.sendToAsync(sendInstance, {
|
|
1587
|
+
device: user,
|
|
1588
|
+
message: text,
|
|
1589
|
+
title: "Paketstatus",
|
|
1590
|
+
});
|
|
1556
1591
|
} else if (sendInstance.includes("signal-cmb")) {
|
|
1557
1592
|
await this.sendToAsync(sendInstance, "send", {
|
|
1558
1593
|
text: text,
|
|
@@ -2141,7 +2176,12 @@ class Parcel extends utils.Adapter {
|
|
|
2141
2176
|
url: "https://buyer.17track.net/orderapi/call",
|
|
2142
2177
|
header: { "content-type": "application/x-www-form-urlencoded" },
|
|
2143
2178
|
|
|
2144
|
-
data: JSON.stringify({
|
|
2179
|
+
data: JSON.stringify({
|
|
2180
|
+
version: "1.0",
|
|
2181
|
+
timeZoneOffset: -60,
|
|
2182
|
+
method: "AddTrackNo",
|
|
2183
|
+
param: { TrackNos: [state.val] },
|
|
2184
|
+
}),
|
|
2145
2185
|
})
|
|
2146
2186
|
.then(async (res) => {
|
|
2147
2187
|
this.log.info(JSON.stringify(res.data));
|
|
@@ -2160,7 +2200,7 @@ class Parcel extends utils.Adapter {
|
|
|
2160
2200
|
if (!imageBase64) {
|
|
2161
2201
|
const image = await this.requestClient({
|
|
2162
2202
|
method: "get",
|
|
2163
|
-
url: state.val
|
|
2203
|
+
url: state.val,
|
|
2164
2204
|
responseType: "arraybuffer",
|
|
2165
2205
|
}).catch((error) => {
|
|
2166
2206
|
if (error.response && error.response.status === 401) {
|
|
@@ -2205,20 +2245,33 @@ class Parcel extends utils.Adapter {
|
|
|
2205
2245
|
if (sendUser.length > 0) {
|
|
2206
2246
|
for (const user of sendUser) {
|
|
2207
2247
|
if (sendInstance.includes("pushover")) {
|
|
2208
|
-
await this.sendToAsync(sendInstance, {
|
|
2248
|
+
await this.sendToAsync(sendInstance, {
|
|
2249
|
+
device: user,
|
|
2250
|
+
file: `${this.tmpDir}${sep}${uuid}.jpg`,
|
|
2251
|
+
title: "✉️Briefankündigung",
|
|
2252
|
+
});
|
|
2209
2253
|
} else if (sendInstance.includes("signal-cmb")) {
|
|
2210
2254
|
await this.sendToAsync(sendInstance, "send", {
|
|
2211
2255
|
text: "✉️Briefankündigung",
|
|
2212
2256
|
phone: user,
|
|
2213
2257
|
});
|
|
2214
2258
|
} else {
|
|
2215
|
-
await this.sendToAsync(sendInstance, {
|
|
2216
|
-
|
|
2259
|
+
await this.sendToAsync(sendInstance, {
|
|
2260
|
+
user: user,
|
|
2261
|
+
text: "✉️Briefankündigung",
|
|
2262
|
+
});
|
|
2263
|
+
await this.sendToAsync(sendInstance, {
|
|
2264
|
+
user: user,
|
|
2265
|
+
text: `${this.tmpDir}${sep}${uuid}.jpg`,
|
|
2266
|
+
});
|
|
2217
2267
|
}
|
|
2218
2268
|
}
|
|
2219
2269
|
} else {
|
|
2220
2270
|
if (sendInstance.includes("pushover")) {
|
|
2221
|
-
await this.sendToAsync(sendInstance, {
|
|
2271
|
+
await this.sendToAsync(sendInstance, {
|
|
2272
|
+
file: `${this.tmpDir}${sep}${uuid}.jpg`,
|
|
2273
|
+
title: "✉️Briefankündigung",
|
|
2274
|
+
});
|
|
2222
2275
|
} else if (sendInstance.includes("signal-cmb")) {
|
|
2223
2276
|
await this.sendToAsync(sendInstance, "send", {
|
|
2224
2277
|
text: "✉️Briefankündigung",
|
package/package.json
CHANGED
|
@@ -1,79 +1,79 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
2
|
+
"name": "iobroker.parcel",
|
|
3
|
+
"version": "0.0.23",
|
|
4
|
+
"description": "Parcel tracking",
|
|
5
|
+
"author": {
|
|
6
|
+
"name": "TA2k",
|
|
7
|
+
"email": "tombox2020@gmail.com"
|
|
8
|
+
},
|
|
9
|
+
"homepage": "https://github.com/TA2k/ioBroker.parcel",
|
|
10
|
+
"license": "MIT",
|
|
11
|
+
"keywords": [
|
|
12
|
+
"parcel",
|
|
13
|
+
"tracking",
|
|
14
|
+
"dhl",
|
|
15
|
+
"briefe",
|
|
16
|
+
"dpd",
|
|
17
|
+
"gls",
|
|
18
|
+
"hermes",
|
|
19
|
+
"ups",
|
|
20
|
+
"amazon",
|
|
21
|
+
"paket"
|
|
22
|
+
],
|
|
23
|
+
"repository": {
|
|
24
|
+
"type": "git",
|
|
25
|
+
"url": "https://github.com/TA2k/ioBroker.parcel"
|
|
26
|
+
},
|
|
27
|
+
"dependencies": {
|
|
28
|
+
"@iobroker/adapter-core": "^2.6.7",
|
|
29
|
+
"axios": "^0.27.2",
|
|
30
|
+
"http-cookie-agent": "^4.0.2",
|
|
31
|
+
"jsdom": "^20.0.1",
|
|
32
|
+
"json-bigint": "^1.0.0",
|
|
33
|
+
"qs": "^6.11.0",
|
|
34
|
+
"tough-cookie": "^4.1.2",
|
|
35
|
+
"uuid": "^9.0.0"
|
|
36
|
+
},
|
|
37
|
+
"devDependencies": {
|
|
38
|
+
"@iobroker/testing": "^4.1.0",
|
|
39
|
+
"@types/chai": "^4.3.3",
|
|
40
|
+
"@types/chai-as-promised": "^7.1.5",
|
|
41
|
+
"@types/gulp": "^4.0.9",
|
|
42
|
+
"@types/mocha": "^9.1.1",
|
|
43
|
+
"@types/node": "^18.8.3",
|
|
44
|
+
"@types/proxyquire": "^1.3.28",
|
|
45
|
+
"@types/sinon": "^10.0.13",
|
|
46
|
+
"@types/sinon-chai": "^3.2.8",
|
|
47
|
+
"chai": "^4.3.6",
|
|
48
|
+
"chai-as-promised": "^7.1.1",
|
|
49
|
+
"eslint": "^8.25.0",
|
|
50
|
+
"mocha": "^10.0.0",
|
|
51
|
+
"proxyquire": "^2.1.3",
|
|
52
|
+
"sinon": "^14.0.1",
|
|
53
|
+
"sinon-chai": "^3.7.0",
|
|
54
|
+
"typescript": "~4.8.4"
|
|
55
|
+
},
|
|
56
|
+
"main": "main.js",
|
|
57
|
+
"files": [
|
|
58
|
+
"admin{,/!(src)/**}/!(tsconfig|tsconfig.*).json",
|
|
59
|
+
"admin{,/!(src)/**}/*.{html,css,png,svg,jpg,js}",
|
|
60
|
+
"lib/",
|
|
61
|
+
"www/",
|
|
62
|
+
"io-package.json",
|
|
63
|
+
"LICENSE",
|
|
64
|
+
"main.js"
|
|
65
|
+
],
|
|
66
|
+
"scripts": {
|
|
67
|
+
"test:js": "mocha --config test/mocharc.custom.json \"{!(node_modules|test)/**/*.test.js,*.test.js,test/**/test!(PackageFiles|Startup).js}\"",
|
|
68
|
+
"test:package": "mocha test/package --exit",
|
|
69
|
+
"test:unit": "mocha test/unit --exit",
|
|
70
|
+
"test:integration": "mocha test/integration --exit",
|
|
71
|
+
"test": "npm run test:js && npm run test:package",
|
|
72
|
+
"check": "tsc --noEmit -p tsconfig.check.json",
|
|
73
|
+
"lint": "eslint"
|
|
74
|
+
},
|
|
75
|
+
"bugs": {
|
|
76
|
+
"url": "https://github.com/TA2k/ioBroker.parcel/issues"
|
|
77
|
+
},
|
|
78
|
+
"readmeFilename": "README.md"
|
|
79
79
|
}
|