@icgio/clients-config 1.0.193 → 1.0.195
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/.gitsecret/paths/mapping.cfg +1 -1
- package/config-archive.json +0 -22
- package/config.json +44 -0
- package/data-source.js.secret +0 -0
- package/package.json +27 -27
- package/secretread.js.secret +0 -0
- package/update-config-json.js +278 -278
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
secretread.js:
|
|
1
|
+
secretread.js:b12e7a8c5b38382afba7cab3b1e5f807fafb47629297f5c51f13fee5a3b226d2
|
|
2
2
|
data-source.js:7914c8a583a6dc1ed54909da44dbaf3b76c39adb98a63706ad277cc23de7b81b
|
package/config-archive.json
CHANGED
|
@@ -226,9 +226,6 @@
|
|
|
226
226
|
"TIPS": {
|
|
227
227
|
"Bitmart": ["TIPSUSDT"]
|
|
228
228
|
},
|
|
229
|
-
"TITAN": {
|
|
230
|
-
"Gate": ["TITANUSDT"]
|
|
231
|
-
},
|
|
232
229
|
"TLAND": {
|
|
233
230
|
"Fastex": ["TLANDUSDT"]
|
|
234
231
|
},
|
|
@@ -325,7 +322,6 @@
|
|
|
325
322
|
"TGMT": [],
|
|
326
323
|
"TIN": [],
|
|
327
324
|
"TIPS": [],
|
|
328
|
-
"TITAN": [],
|
|
329
325
|
"TLAND": [],
|
|
330
326
|
"TOROG": [],
|
|
331
327
|
"TROLLMP": [],
|
|
@@ -522,9 +518,6 @@
|
|
|
522
518
|
"TIPS": {
|
|
523
519
|
"TIPSUSDT": ["Bitmart"]
|
|
524
520
|
},
|
|
525
|
-
"TITAN": {
|
|
526
|
-
"TITANUSDT": ["Gate"]
|
|
527
|
-
},
|
|
528
521
|
"TLAND": {
|
|
529
522
|
"TLANDUSDT": ["Fastex"]
|
|
530
523
|
},
|
|
@@ -839,11 +832,6 @@
|
|
|
839
832
|
"trades": 1,
|
|
840
833
|
"orderbook": 1
|
|
841
834
|
},
|
|
842
|
-
"TITAN": {
|
|
843
|
-
"balance": 1,
|
|
844
|
-
"trades": 1,
|
|
845
|
-
"orderbook": 1
|
|
846
|
-
},
|
|
847
835
|
"TLAND": {
|
|
848
836
|
"balance": 1,
|
|
849
837
|
"trades": 1,
|
|
@@ -941,7 +929,6 @@
|
|
|
941
929
|
"TAZZ": true,
|
|
942
930
|
"TES": true,
|
|
943
931
|
"TIPS": true,
|
|
944
|
-
"TITAN": true,
|
|
945
932
|
"TLAND": true,
|
|
946
933
|
"TOROG": true,
|
|
947
934
|
"TRRUE": true,
|
|
@@ -1016,7 +1003,6 @@
|
|
|
1016
1003
|
"TES": true,
|
|
1017
1004
|
"TIN": true,
|
|
1018
1005
|
"TIPS": true,
|
|
1019
|
-
"TITAN": true,
|
|
1020
1006
|
"TLAND": true,
|
|
1021
1007
|
"TOROG": true,
|
|
1022
1008
|
"TROLLMP": true,
|
|
@@ -1097,7 +1083,6 @@
|
|
|
1097
1083
|
"TGMT": [2, 5, 10],
|
|
1098
1084
|
"TIN": [10, 50, 100],
|
|
1099
1085
|
"TIPS": [2, 5, 10],
|
|
1100
|
-
"TITAN": [1, 2, 5, 10, 20, 50, 100],
|
|
1101
1086
|
"TLAND": [10, 50, 100],
|
|
1102
1087
|
"TOROG": [10, 50, 100],
|
|
1103
1088
|
"TROLLMP": [2, 5, 10],
|
|
@@ -1169,7 +1154,6 @@
|
|
|
1169
1154
|
"TGMT": ["BTC", "ETH"],
|
|
1170
1155
|
"TIN": ["BTC", "ETH"],
|
|
1171
1156
|
"TIPS": ["BTC", "ETH"],
|
|
1172
|
-
"TITAN": ["BTC", "ETH"],
|
|
1173
1157
|
"TLAND": ["BTC", "ETH"],
|
|
1174
1158
|
"TOROG": ["BTC", "ETH"],
|
|
1175
1159
|
"TROLLMP": ["BTC", "ETH"],
|
|
@@ -1242,7 +1226,6 @@
|
|
|
1242
1226
|
"TGMT": "-1002053322082",
|
|
1243
1227
|
"TIN": "-1002085447080",
|
|
1244
1228
|
"TIPS": "-4151715633",
|
|
1245
|
-
"TITAN": "-4710863832",
|
|
1246
1229
|
"TLAND": "-4594805572",
|
|
1247
1230
|
"TOROG": "-4646841347",
|
|
1248
1231
|
"TROLLMP": "-4278849346",
|
|
@@ -1294,7 +1277,6 @@
|
|
|
1294
1277
|
"SHROOMY": "icg",
|
|
1295
1278
|
"SPONSTAR": "icg",
|
|
1296
1279
|
"TAZZ": "icg",
|
|
1297
|
-
"TITAN": "icg",
|
|
1298
1280
|
"TLAND": "icg",
|
|
1299
1281
|
"TOROG": "icg",
|
|
1300
1282
|
"TRRUE": "icg",
|
|
@@ -1377,10 +1359,6 @@
|
|
|
1377
1359
|
"username": "sponstar@icg.io",
|
|
1378
1360
|
"password": "pqVJQPuuPThfjZp"
|
|
1379
1361
|
},
|
|
1380
|
-
"TITAN": {
|
|
1381
|
-
"username": "titan@icg.io",
|
|
1382
|
-
"password": "PWW8Te4dPDoDS76"
|
|
1383
|
-
},
|
|
1384
1362
|
"TLAND": {
|
|
1385
1363
|
"username": "tland@icg.io",
|
|
1386
1364
|
"password": "0txFptjPFCExIyS"
|
package/config.json
CHANGED
|
@@ -31,6 +31,9 @@
|
|
|
31
31
|
"Mexc": ["JYAIUSDT"],
|
|
32
32
|
"Xt": ["JYAIUSDT"]
|
|
33
33
|
},
|
|
34
|
+
"LST": {
|
|
35
|
+
"Bitmart": ["LSTUSDT"]
|
|
36
|
+
},
|
|
34
37
|
"LUCIC": {
|
|
35
38
|
"Xt": ["LUCICUSDT"]
|
|
36
39
|
},
|
|
@@ -60,6 +63,9 @@
|
|
|
60
63
|
"TACC": {
|
|
61
64
|
"Weex": ["TACCUSDT"]
|
|
62
65
|
},
|
|
66
|
+
"TITAN": {
|
|
67
|
+
"Gate": ["TITANUSDT"]
|
|
68
|
+
},
|
|
63
69
|
"TKT": {
|
|
64
70
|
"Mexc": ["TKTUSDT"]
|
|
65
71
|
}
|
|
@@ -73,6 +79,7 @@
|
|
|
73
79
|
"ILMT": [],
|
|
74
80
|
"IONX": [],
|
|
75
81
|
"JYAI": [],
|
|
82
|
+
"LST": [],
|
|
76
83
|
"LUCIC": [],
|
|
77
84
|
"MAK": [],
|
|
78
85
|
"MIX": [],
|
|
@@ -81,6 +88,7 @@
|
|
|
81
88
|
"SHRAP": [],
|
|
82
89
|
"SWFTC": ["Lbank"],
|
|
83
90
|
"TACC": [],
|
|
91
|
+
"TITAN": [],
|
|
84
92
|
"TKT": []
|
|
85
93
|
},
|
|
86
94
|
"client_pair_main_exchanges": {
|
|
@@ -108,6 +116,9 @@
|
|
|
108
116
|
"JYAI": {
|
|
109
117
|
"JYAIUSDT": ["Bingx", "Bitmart", "Lbank", "Mexc", "Xt"]
|
|
110
118
|
},
|
|
119
|
+
"LST": {
|
|
120
|
+
"LSTUSDT": ["Bitmart"]
|
|
121
|
+
},
|
|
111
122
|
"LUCIC": {
|
|
112
123
|
"LUCICUSDT": ["Xt"]
|
|
113
124
|
},
|
|
@@ -133,6 +144,9 @@
|
|
|
133
144
|
"TACC": {
|
|
134
145
|
"TACCUSDT": ["Weex"]
|
|
135
146
|
},
|
|
147
|
+
"TITAN": {
|
|
148
|
+
"TITANUSDT": ["Gate"]
|
|
149
|
+
},
|
|
136
150
|
"TKT": {
|
|
137
151
|
"TKTUSDT": ["Mexc"]
|
|
138
152
|
}
|
|
@@ -178,6 +192,11 @@
|
|
|
178
192
|
"trades": 1,
|
|
179
193
|
"orderbook": 1
|
|
180
194
|
},
|
|
195
|
+
"LST": {
|
|
196
|
+
"balance": 1,
|
|
197
|
+
"trades": 1,
|
|
198
|
+
"orderbook": 1
|
|
199
|
+
},
|
|
181
200
|
"LUCIC": {
|
|
182
201
|
"balance": 1,
|
|
183
202
|
"trades": 1,
|
|
@@ -218,6 +237,11 @@
|
|
|
218
237
|
"trades": 1,
|
|
219
238
|
"orderbook": 1
|
|
220
239
|
},
|
|
240
|
+
"TITAN": {
|
|
241
|
+
"balance": 1,
|
|
242
|
+
"trades": 1,
|
|
243
|
+
"orderbook": 1
|
|
244
|
+
},
|
|
221
245
|
"TKT": {
|
|
222
246
|
"balance": 1,
|
|
223
247
|
"trades": 1,
|
|
@@ -233,6 +257,7 @@
|
|
|
233
257
|
"GO": true,
|
|
234
258
|
"ILMT": true,
|
|
235
259
|
"JYAI": true,
|
|
260
|
+
"LST": true,
|
|
236
261
|
"LUCIC": true,
|
|
237
262
|
"MAK": true,
|
|
238
263
|
"MIX": true,
|
|
@@ -241,6 +266,7 @@
|
|
|
241
266
|
"SHRAP": true,
|
|
242
267
|
"SWFTC": true,
|
|
243
268
|
"TACC": true,
|
|
269
|
+
"TITAN": true,
|
|
244
270
|
"TKT": true
|
|
245
271
|
},
|
|
246
272
|
"balance_cur": {
|
|
@@ -259,6 +285,7 @@
|
|
|
259
285
|
"ILMT": true,
|
|
260
286
|
"IONX": true,
|
|
261
287
|
"JYAI": true,
|
|
288
|
+
"LST": true,
|
|
262
289
|
"LUCIC": true,
|
|
263
290
|
"MAK": true,
|
|
264
291
|
"MIX": true,
|
|
@@ -267,6 +294,7 @@
|
|
|
267
294
|
"SHRAP": true,
|
|
268
295
|
"SWFTC": true,
|
|
269
296
|
"TACC": true,
|
|
297
|
+
"TITAN": true,
|
|
270
298
|
"TKT": true
|
|
271
299
|
},
|
|
272
300
|
"orderbook": {
|
|
@@ -283,6 +311,7 @@
|
|
|
283
311
|
"ILMT": [1, 2, 5, 10, 20, 50, 100],
|
|
284
312
|
"IONX": [1, 2, 5, 10, 20, 50, 100],
|
|
285
313
|
"JYAI": [1, 2, 5, 10, 20, 50, 100],
|
|
314
|
+
"LST": [1, 2, 5, 10, 20, 50, 100],
|
|
286
315
|
"LUCIC": [1, 2, 5, 10, 20, 50, 100],
|
|
287
316
|
"MAK": [2, 5, 10],
|
|
288
317
|
"MIX": [2, 5, 10],
|
|
@@ -291,6 +320,7 @@
|
|
|
291
320
|
"SHRAP": [1, 2, 5, 10, 20, 50, 100],
|
|
292
321
|
"SWFTC": [1, 2, 5, 10, 20, 50, 100],
|
|
293
322
|
"TACC": [1, 2, 5, 10, 20, 50, 100],
|
|
323
|
+
"TITAN": [1, 2, 5, 10, 20, 50, 100],
|
|
294
324
|
"TKT": [1, 2, 5, 10, 20, 50, 100]
|
|
295
325
|
},
|
|
296
326
|
"client_price_index_curs": {
|
|
@@ -302,6 +332,7 @@
|
|
|
302
332
|
"ILMT": ["BTC", "ETH"],
|
|
303
333
|
"IONX": ["BTC", "ETH"],
|
|
304
334
|
"JYAI": ["BTC", "ETH"],
|
|
335
|
+
"LST": ["BTC", "ETH"],
|
|
305
336
|
"LUCIC": ["BTC", "ETH"],
|
|
306
337
|
"MAK": ["BTC", "ETH"],
|
|
307
338
|
"MIX": ["BTC", "ETH"],
|
|
@@ -310,6 +341,7 @@
|
|
|
310
341
|
"SHRAP": ["BTC", "ETH"],
|
|
311
342
|
"SWFTC": ["BTC", "ETH"],
|
|
312
343
|
"TACC": ["BTC", "ETH"],
|
|
344
|
+
"TITAN": ["BTC", "ETH"],
|
|
313
345
|
"TKT": ["BTC", "ETH"]
|
|
314
346
|
},
|
|
315
347
|
"client_telegram_ids": {
|
|
@@ -321,6 +353,7 @@
|
|
|
321
353
|
"ILMT": "-4802252746",
|
|
322
354
|
"IONX": "-1002085059560",
|
|
323
355
|
"JYAI": "-4787448589",
|
|
356
|
+
"LST": "-4626789465",
|
|
324
357
|
"LUCIC": "-4701729001",
|
|
325
358
|
"MAK": "-4801299465",
|
|
326
359
|
"MIX": "-4941930380",
|
|
@@ -329,6 +362,7 @@
|
|
|
329
362
|
"SHRAP": "-1001996867582",
|
|
330
363
|
"SWFTC": "-1002067948127",
|
|
331
364
|
"TACC": "-4874959768",
|
|
365
|
+
"TITAN": "-4710863832",
|
|
332
366
|
"TKT": "-4946654975"
|
|
333
367
|
},
|
|
334
368
|
"balance_premium": {
|
|
@@ -359,6 +393,7 @@
|
|
|
359
393
|
"ILMT": "icg",
|
|
360
394
|
"IONX": "icg",
|
|
361
395
|
"JYAI": "icg",
|
|
396
|
+
"LST": "icg",
|
|
362
397
|
"LUCIC": "icg",
|
|
363
398
|
"MAK": "icg",
|
|
364
399
|
"MIX": "icg",
|
|
@@ -367,6 +402,7 @@
|
|
|
367
402
|
"SHRAP": "icg",
|
|
368
403
|
"SWFTC": "icg",
|
|
369
404
|
"TACC": "icg",
|
|
405
|
+
"TITAN": "icg",
|
|
370
406
|
"TKT": "icg"
|
|
371
407
|
},
|
|
372
408
|
"client_dashboard_credentials": {
|
|
@@ -406,6 +442,10 @@
|
|
|
406
442
|
"username": "jyai@icg.io",
|
|
407
443
|
"password": "XWAxbFN5I5hitiO"
|
|
408
444
|
},
|
|
445
|
+
"LST": {
|
|
446
|
+
"username": "lst@icg.io",
|
|
447
|
+
"password": "WhmuXl5KMlE5ace"
|
|
448
|
+
},
|
|
409
449
|
"LUCIC": {
|
|
410
450
|
"username": "lucic@icg.io",
|
|
411
451
|
"password": "v06b3nRPbRCPSPt"
|
|
@@ -442,6 +482,10 @@
|
|
|
442
482
|
"username": "tacc@icg.io",
|
|
443
483
|
"password": "NqDhRLCE68zsKA4"
|
|
444
484
|
},
|
|
485
|
+
"TITAN": {
|
|
486
|
+
"username": "titan@icg.io",
|
|
487
|
+
"password": "PWW8Te4dPDoDS76"
|
|
488
|
+
},
|
|
445
489
|
"TKT": {
|
|
446
490
|
"username": "tkt@icg.io",
|
|
447
491
|
"password": "oEwbg6MmKnTym1O"
|
package/data-source.js.secret
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@icgio/clients-config",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "",
|
|
5
|
-
"main": "index.js",
|
|
6
|
-
"scripts": {
|
|
7
|
-
"test": "echo \"Error: no test specified\" && exit 1"
|
|
8
|
-
},
|
|
9
|
-
"repository": {
|
|
10
|
-
"type": "git",
|
|
11
|
-
"url": "git+https://github.com/icgio/clients-config.git"
|
|
12
|
-
},
|
|
13
|
-
"author": "",
|
|
14
|
-
"license": "ISC",
|
|
15
|
-
"bugs": {
|
|
16
|
-
"url": "https://github.com/icgio/clients-config/issues"
|
|
17
|
-
},
|
|
18
|
-
"homepage": "https://github.com/icgio/clients-config#readme",
|
|
19
|
-
"dependencies": {
|
|
20
|
-
"lodash": "^4.17.20"
|
|
21
|
-
},
|
|
22
|
-
"devDependencies": {
|
|
23
|
-
"fs-extra": "^11.2.0",
|
|
24
|
-
"node-cmd": "^5.0.0",
|
|
25
|
-
"prompt": "^1.3.0"
|
|
26
|
-
}
|
|
27
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@icgio/clients-config",
|
|
3
|
+
"version": "1.0.195",
|
|
4
|
+
"description": "",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
8
|
+
},
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "git+https://github.com/icgio/clients-config.git"
|
|
12
|
+
},
|
|
13
|
+
"author": "",
|
|
14
|
+
"license": "ISC",
|
|
15
|
+
"bugs": {
|
|
16
|
+
"url": "https://github.com/icgio/clients-config/issues"
|
|
17
|
+
},
|
|
18
|
+
"homepage": "https://github.com/icgio/clients-config#readme",
|
|
19
|
+
"dependencies": {
|
|
20
|
+
"lodash": "^4.17.20"
|
|
21
|
+
},
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"fs-extra": "^11.2.0",
|
|
24
|
+
"node-cmd": "^5.0.0",
|
|
25
|
+
"prompt": "^1.3.0"
|
|
26
|
+
}
|
|
27
|
+
}
|
package/secretread.js.secret
CHANGED
|
Binary file
|
package/update-config-json.js
CHANGED
|
@@ -1,278 +1,278 @@
|
|
|
1
|
-
const fs = require('fs')
|
|
2
|
-
const prompt = require('prompt')
|
|
3
|
-
|
|
4
|
-
const config_file_path = './config.json'
|
|
5
|
-
const config_archive_file_path = './config-archive.json'
|
|
6
|
-
|
|
7
|
-
prompt.start()
|
|
8
|
-
|
|
9
|
-
function read_config_file(path) {
|
|
10
|
-
return new Promise((resolve, reject) => {
|
|
11
|
-
fs.readFile(path, 'utf8', (err, data) => {
|
|
12
|
-
if (err) reject(err)
|
|
13
|
-
else resolve(data)
|
|
14
|
-
})
|
|
15
|
-
})
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
function write_config_file(data, path) {
|
|
19
|
-
return new Promise((resolve, reject) => {
|
|
20
|
-
fs.writeFile(path, JSON.stringify(data, null, 2), 'utf8', (err) => {
|
|
21
|
-
if (err) return reject(err)
|
|
22
|
-
else resolve()
|
|
23
|
-
})
|
|
24
|
-
})
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
function process_config() {
|
|
28
|
-
try {
|
|
29
|
-
const schema = {
|
|
30
|
-
properties: {
|
|
31
|
-
action: {
|
|
32
|
-
description: 'Enter the action ( add, delete )',
|
|
33
|
-
pattern: /^(add|delete)$/,
|
|
34
|
-
message: 'Action must be one of "add", "delete"',
|
|
35
|
-
required: true,
|
|
36
|
-
},
|
|
37
|
-
client_name: {
|
|
38
|
-
description: 'Enter the client name you want to perform the action on',
|
|
39
|
-
required: true,
|
|
40
|
-
},
|
|
41
|
-
},
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
prompt.get(schema, (err, result) => {
|
|
45
|
-
if (err) {
|
|
46
|
-
console.error(err)
|
|
47
|
-
return
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
switch (result.action) {
|
|
51
|
-
case 'add':
|
|
52
|
-
add_client(result.client_name)
|
|
53
|
-
break
|
|
54
|
-
case 'delete':
|
|
55
|
-
delete_client(result.client_name)
|
|
56
|
-
break
|
|
57
|
-
default:
|
|
58
|
-
console.log('Invalid action')
|
|
59
|
-
break
|
|
60
|
-
}
|
|
61
|
-
})
|
|
62
|
-
} catch (error) {
|
|
63
|
-
console.error(`Error processing the config file: ${error}`)
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
function delete_client(client_name) {
|
|
68
|
-
read_config_file(config_file_path)
|
|
69
|
-
.then((config_file_data) => {
|
|
70
|
-
config_file_data = JSON.parse(config_file_data)
|
|
71
|
-
|
|
72
|
-
update_config_archive(config_file_data, client_name)
|
|
73
|
-
.then(() => {
|
|
74
|
-
delete config_file_data.client_exchange_pairs[client_name]
|
|
75
|
-
delete config_file_data.client_pair_main_exchanges[client_name]
|
|
76
|
-
delete config_file_data.client_not_include_exchanges[client_name]
|
|
77
|
-
delete config_file_data.client_levels[client_name]
|
|
78
|
-
delete config_file_data.client_price_index_curs[client_name]
|
|
79
|
-
delete config_file_data.client_telegram_ids[client_name]
|
|
80
|
-
delete config_file_data.clients_reporter_interval[client_name]
|
|
81
|
-
|
|
82
|
-
for (let key in config_file_data.client_enabled) {
|
|
83
|
-
if (config_file_data.client_enabled.hasOwnProperty(key)) {
|
|
84
|
-
delete config_file_data.client_enabled[key][client_name]
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
write_config_file(config_file_data, config_file_path)
|
|
89
|
-
.then(() => {
|
|
90
|
-
console.log(`Client '${client_name}' has been deleted successfully.`)
|
|
91
|
-
})
|
|
92
|
-
.catch((err) => {
|
|
93
|
-
console.error(`Error writing to config file: ${err}`)
|
|
94
|
-
})
|
|
95
|
-
})
|
|
96
|
-
.catch((err) => {
|
|
97
|
-
console.error(`Error updating config archive: ${err}`)
|
|
98
|
-
})
|
|
99
|
-
})
|
|
100
|
-
.catch((err) => {
|
|
101
|
-
console.error(`Error reading config file: ${err}`)
|
|
102
|
-
})
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
function add_client(client_name) {
|
|
106
|
-
const schema = {
|
|
107
|
-
properties: {
|
|
108
|
-
client_exchange_pairs: {
|
|
109
|
-
description: 'Enter client exchange pairs (JSON format i.e { "Mexc": ["RWXUSDT"], "Bitget": ["RWXUSDT"] } )',
|
|
110
|
-
required: true,
|
|
111
|
-
pattern: /^\{.*\}$/,
|
|
112
|
-
message: 'Please enter a valid JSON object.',
|
|
113
|
-
},
|
|
114
|
-
client_not_include_exchanges: {
|
|
115
|
-
description: 'Enter client not include exchanges (Comma-separated values, e.g., Jubi, Lbank)',
|
|
116
|
-
required: false,
|
|
117
|
-
},
|
|
118
|
-
client_pair_main_exchanges: {
|
|
119
|
-
description: 'Enter client pair main exchanges (JSON format i.e {"ETHUSDT": ["Bitget", "Gate"]} )',
|
|
120
|
-
required: true,
|
|
121
|
-
pattern: /^\{.*\}$/,
|
|
122
|
-
message: 'Please enter a valid JSON object.',
|
|
123
|
-
},
|
|
124
|
-
clients_reporter_interval: {
|
|
125
|
-
description: 'Enter clients reporter interval (JSON format i.e { "balance": 1, "trades": 1, "orderbook": 1} )',
|
|
126
|
-
required: true,
|
|
127
|
-
pattern: /^\{.*\}$/,
|
|
128
|
-
message: 'Please enter a valid JSON object.',
|
|
129
|
-
},
|
|
130
|
-
client_levels: {
|
|
131
|
-
description: 'Enter client levels (Comma-separated values, e.g. 2, 5, 10 ) ',
|
|
132
|
-
required: true,
|
|
133
|
-
},
|
|
134
|
-
client_price_index_curs: {
|
|
135
|
-
description: 'Enter client benchmarks (Comma-separated values, e.g., BTC,ETH)',
|
|
136
|
-
required: false,
|
|
137
|
-
},
|
|
138
|
-
client_telegram_ids: {
|
|
139
|
-
description: 'Enter client telegram ids i.e 1233457 ',
|
|
140
|
-
required: true,
|
|
141
|
-
},
|
|
142
|
-
},
|
|
143
|
-
}
|
|
144
|
-
read_config_file(config_file_path)
|
|
145
|
-
.then((config_file_data) => {
|
|
146
|
-
prompt.get(schema, (err, result) => {
|
|
147
|
-
if (err) {
|
|
148
|
-
console.error(err)
|
|
149
|
-
return
|
|
150
|
-
}
|
|
151
|
-
config_file_data = JSON.parse(config_file_data)
|
|
152
|
-
|
|
153
|
-
let exchange_pairs = result.client_exchange_pairs.trim()
|
|
154
|
-
exchange_pairs = JSON.parse(exchange_pairs)
|
|
155
|
-
|
|
156
|
-
let pair_exchanges = result.client_pair_main_exchanges.trim()
|
|
157
|
-
pair_exchanges = JSON.parse(pair_exchanges)
|
|
158
|
-
|
|
159
|
-
let reporter_interval = result.clients_reporter_interval.trim()
|
|
160
|
-
reporter_interval = JSON.parse(reporter_interval)
|
|
161
|
-
|
|
162
|
-
let not_include_exchanges = []
|
|
163
|
-
if (result.client_not_include_exchanges) {
|
|
164
|
-
not_include_exchanges = result.client_not_include_exchanges.split(',').map((value) => value.trim())
|
|
165
|
-
not_include_exchanges.sort()
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
let benchmarks = []
|
|
169
|
-
if (result.client_price_index_curs) {
|
|
170
|
-
benchmarks = result.client_price_index_curs.split(',').map((value) => value.trim())
|
|
171
|
-
benchmarks.sort()
|
|
172
|
-
}
|
|
173
|
-
let levels = result.client_levels.split(',').map((value) => Number(value.trim()))
|
|
174
|
-
|
|
175
|
-
config_file_data.client_exchange_pairs[client_name] = exchange_pairs
|
|
176
|
-
config_file_data.client_pair_main_exchanges[client_name] = pair_exchanges
|
|
177
|
-
|
|
178
|
-
config_file_data.clients_reporter_interval[client_name] = reporter_interval
|
|
179
|
-
|
|
180
|
-
config_file_data.client_not_include_exchanges[client_name] = not_include_exchanges
|
|
181
|
-
config_file_data.client_levels[client_name] = levels
|
|
182
|
-
config_file_data.client_price_index_curs[client_name] = benchmarks
|
|
183
|
-
|
|
184
|
-
config_file_data.client_telegram_ids[client_name] = result.client_telegram_ids
|
|
185
|
-
|
|
186
|
-
config_file_data.client_exchange_pairs = sort(config_file_data.client_exchange_pairs)
|
|
187
|
-
config_file_data.client_pair_main_exchanges = sort(config_file_data.client_pair_main_exchanges)
|
|
188
|
-
config_file_data.clients_reporter_interval = sort(config_file_data.clients_reporter_interval)
|
|
189
|
-
config_file_data.client_not_include_exchanges = sort(config_file_data.client_not_include_exchanges)
|
|
190
|
-
config_file_data.client_levels = sort(config_file_data.client_levels)
|
|
191
|
-
config_file_data.client_price_index_curs = sort(config_file_data.client_price_index_curs)
|
|
192
|
-
config_file_data.client_telegram_ids = sort(config_file_data.client_telegram_ids)
|
|
193
|
-
|
|
194
|
-
write_config_file(config_file_data, config_file_path)
|
|
195
|
-
.then(() => {
|
|
196
|
-
console.log(`Client '${client_name}' has been added successfully.`)
|
|
197
|
-
})
|
|
198
|
-
.catch((err) => {
|
|
199
|
-
console.error(`Error writing to config file: ${err}`)
|
|
200
|
-
})
|
|
201
|
-
})
|
|
202
|
-
})
|
|
203
|
-
.catch((err) => {
|
|
204
|
-
console.error(`Error reading config file: ${err}`)
|
|
205
|
-
})
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
function update_config_archive(config_file_data, client_name) {
|
|
209
|
-
return new Promise((resolve, reject) => {
|
|
210
|
-
read_config_file(config_archive_file_path)
|
|
211
|
-
.then((config_archive_data) => {
|
|
212
|
-
try {
|
|
213
|
-
config_archive_data = JSON.parse(config_archive_data)
|
|
214
|
-
} catch (error) {
|
|
215
|
-
console.error(`Error parsing config archive data: ${error}`)
|
|
216
|
-
reject(error)
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
config_archive_data.client_exchange_pairs[client_name] = config_file_data.client_exchange_pairs[client_name]
|
|
220
|
-
config_archive_data.client_pair_main_exchanges[client_name] = config_file_data.client_pair_main_exchanges[client_name]
|
|
221
|
-
config_archive_data.clients_reporter_interval[client_name] = config_file_data.clients_reporter_interval[client_name]
|
|
222
|
-
config_archive_data.client_not_include_exchanges[client_name] = config_file_data.client_not_include_exchanges[client_name]
|
|
223
|
-
config_archive_data.client_levels[client_name] = config_file_data.client_levels[client_name]
|
|
224
|
-
config_archive_data.client_price_index_curs[client_name] = config_file_data.client_price_index_curs[client_name]
|
|
225
|
-
config_archive_data.client_telegram_ids[client_name] = config_file_data.client_telegram_ids[client_name]
|
|
226
|
-
|
|
227
|
-
if (!config_archive_data.client_enabled) {
|
|
228
|
-
config_archive_data.client_enabled = {}
|
|
229
|
-
}
|
|
230
|
-
for (let key in config_file_data.client_enabled) {
|
|
231
|
-
if (config_file_data.client_enabled.hasOwnProperty(key)) {
|
|
232
|
-
if (!config_archive_data.client_enabled[key]) {
|
|
233
|
-
config_archive_data.client_enabled[key] = {}
|
|
234
|
-
}
|
|
235
|
-
config_archive_data.client_enabled[key][client_name] = config_file_data.client_enabled[key][client_name]
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
config_archive_data.client_exchange_pairs = sort(config_archive_data.client_exchange_pairs)
|
|
240
|
-
config_archive_data.client_pair_main_exchanges = sort(config_archive_data.client_pair_main_exchanges)
|
|
241
|
-
config_archive_data.clients_reporter_interval = sort(config_archive_data.clients_reporter_interval)
|
|
242
|
-
config_archive_data.client_not_include_exchanges = sort(config_archive_data.client_not_include_exchanges)
|
|
243
|
-
config_archive_data.client_levels = sort(config_archive_data.client_levels)
|
|
244
|
-
config_archive_data.client_price_index_curs = sort(config_archive_data.client_price_index_curs)
|
|
245
|
-
config_archive_data.client_telegram_ids = sort(config_archive_data.client_telegram_ids)
|
|
246
|
-
|
|
247
|
-
for (let key in config_archive_data.client_enabled) {
|
|
248
|
-
if (config_archive_data.client_enabled.hasOwnProperty(key)) {
|
|
249
|
-
config_archive_data.client_enabled[key] = sort(config_archive_data.client_enabled[key])
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
write_config_file(config_archive_data, config_archive_file_path)
|
|
254
|
-
.then(() => {
|
|
255
|
-
resolve()
|
|
256
|
-
})
|
|
257
|
-
.catch((err) => {
|
|
258
|
-
console.error(`Error writing to config file: ${err}`)
|
|
259
|
-
reject(err)
|
|
260
|
-
})
|
|
261
|
-
})
|
|
262
|
-
.catch((err) => {
|
|
263
|
-
console.error(`Error reading config archive file: ${err}`)
|
|
264
|
-
reject(err)
|
|
265
|
-
})
|
|
266
|
-
})
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
function sort(obj) {
|
|
270
|
-
return Object.keys(obj)
|
|
271
|
-
.sort()
|
|
272
|
-
.reduce((result, key) => {
|
|
273
|
-
result[key] = obj[key]
|
|
274
|
-
return result
|
|
275
|
-
}, {})
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
process_config()
|
|
1
|
+
const fs = require('fs')
|
|
2
|
+
const prompt = require('prompt')
|
|
3
|
+
|
|
4
|
+
const config_file_path = './config.json'
|
|
5
|
+
const config_archive_file_path = './config-archive.json'
|
|
6
|
+
|
|
7
|
+
prompt.start()
|
|
8
|
+
|
|
9
|
+
function read_config_file(path) {
|
|
10
|
+
return new Promise((resolve, reject) => {
|
|
11
|
+
fs.readFile(path, 'utf8', (err, data) => {
|
|
12
|
+
if (err) reject(err)
|
|
13
|
+
else resolve(data)
|
|
14
|
+
})
|
|
15
|
+
})
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function write_config_file(data, path) {
|
|
19
|
+
return new Promise((resolve, reject) => {
|
|
20
|
+
fs.writeFile(path, JSON.stringify(data, null, 2), 'utf8', (err) => {
|
|
21
|
+
if (err) return reject(err)
|
|
22
|
+
else resolve()
|
|
23
|
+
})
|
|
24
|
+
})
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function process_config() {
|
|
28
|
+
try {
|
|
29
|
+
const schema = {
|
|
30
|
+
properties: {
|
|
31
|
+
action: {
|
|
32
|
+
description: 'Enter the action ( add, delete )',
|
|
33
|
+
pattern: /^(add|delete)$/,
|
|
34
|
+
message: 'Action must be one of "add", "delete"',
|
|
35
|
+
required: true,
|
|
36
|
+
},
|
|
37
|
+
client_name: {
|
|
38
|
+
description: 'Enter the client name you want to perform the action on',
|
|
39
|
+
required: true,
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
prompt.get(schema, (err, result) => {
|
|
45
|
+
if (err) {
|
|
46
|
+
console.error(err)
|
|
47
|
+
return
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
switch (result.action) {
|
|
51
|
+
case 'add':
|
|
52
|
+
add_client(result.client_name)
|
|
53
|
+
break
|
|
54
|
+
case 'delete':
|
|
55
|
+
delete_client(result.client_name)
|
|
56
|
+
break
|
|
57
|
+
default:
|
|
58
|
+
console.log('Invalid action')
|
|
59
|
+
break
|
|
60
|
+
}
|
|
61
|
+
})
|
|
62
|
+
} catch (error) {
|
|
63
|
+
console.error(`Error processing the config file: ${error}`)
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
function delete_client(client_name) {
|
|
68
|
+
read_config_file(config_file_path)
|
|
69
|
+
.then((config_file_data) => {
|
|
70
|
+
config_file_data = JSON.parse(config_file_data)
|
|
71
|
+
|
|
72
|
+
update_config_archive(config_file_data, client_name)
|
|
73
|
+
.then(() => {
|
|
74
|
+
delete config_file_data.client_exchange_pairs[client_name]
|
|
75
|
+
delete config_file_data.client_pair_main_exchanges[client_name]
|
|
76
|
+
delete config_file_data.client_not_include_exchanges[client_name]
|
|
77
|
+
delete config_file_data.client_levels[client_name]
|
|
78
|
+
delete config_file_data.client_price_index_curs[client_name]
|
|
79
|
+
delete config_file_data.client_telegram_ids[client_name]
|
|
80
|
+
delete config_file_data.clients_reporter_interval[client_name]
|
|
81
|
+
|
|
82
|
+
for (let key in config_file_data.client_enabled) {
|
|
83
|
+
if (config_file_data.client_enabled.hasOwnProperty(key)) {
|
|
84
|
+
delete config_file_data.client_enabled[key][client_name]
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
write_config_file(config_file_data, config_file_path)
|
|
89
|
+
.then(() => {
|
|
90
|
+
console.log(`Client '${client_name}' has been deleted successfully.`)
|
|
91
|
+
})
|
|
92
|
+
.catch((err) => {
|
|
93
|
+
console.error(`Error writing to config file: ${err}`)
|
|
94
|
+
})
|
|
95
|
+
})
|
|
96
|
+
.catch((err) => {
|
|
97
|
+
console.error(`Error updating config archive: ${err}`)
|
|
98
|
+
})
|
|
99
|
+
})
|
|
100
|
+
.catch((err) => {
|
|
101
|
+
console.error(`Error reading config file: ${err}`)
|
|
102
|
+
})
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
function add_client(client_name) {
|
|
106
|
+
const schema = {
|
|
107
|
+
properties: {
|
|
108
|
+
client_exchange_pairs: {
|
|
109
|
+
description: 'Enter client exchange pairs (JSON format i.e { "Mexc": ["RWXUSDT"], "Bitget": ["RWXUSDT"] } )',
|
|
110
|
+
required: true,
|
|
111
|
+
pattern: /^\{.*\}$/,
|
|
112
|
+
message: 'Please enter a valid JSON object.',
|
|
113
|
+
},
|
|
114
|
+
client_not_include_exchanges: {
|
|
115
|
+
description: 'Enter client not include exchanges (Comma-separated values, e.g., Jubi, Lbank)',
|
|
116
|
+
required: false,
|
|
117
|
+
},
|
|
118
|
+
client_pair_main_exchanges: {
|
|
119
|
+
description: 'Enter client pair main exchanges (JSON format i.e {"ETHUSDT": ["Bitget", "Gate"]} )',
|
|
120
|
+
required: true,
|
|
121
|
+
pattern: /^\{.*\}$/,
|
|
122
|
+
message: 'Please enter a valid JSON object.',
|
|
123
|
+
},
|
|
124
|
+
clients_reporter_interval: {
|
|
125
|
+
description: 'Enter clients reporter interval (JSON format i.e { "balance": 1, "trades": 1, "orderbook": 1} )',
|
|
126
|
+
required: true,
|
|
127
|
+
pattern: /^\{.*\}$/,
|
|
128
|
+
message: 'Please enter a valid JSON object.',
|
|
129
|
+
},
|
|
130
|
+
client_levels: {
|
|
131
|
+
description: 'Enter client levels (Comma-separated values, e.g. 2, 5, 10 ) ',
|
|
132
|
+
required: true,
|
|
133
|
+
},
|
|
134
|
+
client_price_index_curs: {
|
|
135
|
+
description: 'Enter client benchmarks (Comma-separated values, e.g., BTC,ETH)',
|
|
136
|
+
required: false,
|
|
137
|
+
},
|
|
138
|
+
client_telegram_ids: {
|
|
139
|
+
description: 'Enter client telegram ids i.e 1233457 ',
|
|
140
|
+
required: true,
|
|
141
|
+
},
|
|
142
|
+
},
|
|
143
|
+
}
|
|
144
|
+
read_config_file(config_file_path)
|
|
145
|
+
.then((config_file_data) => {
|
|
146
|
+
prompt.get(schema, (err, result) => {
|
|
147
|
+
if (err) {
|
|
148
|
+
console.error(err)
|
|
149
|
+
return
|
|
150
|
+
}
|
|
151
|
+
config_file_data = JSON.parse(config_file_data)
|
|
152
|
+
|
|
153
|
+
let exchange_pairs = result.client_exchange_pairs.trim()
|
|
154
|
+
exchange_pairs = JSON.parse(exchange_pairs)
|
|
155
|
+
|
|
156
|
+
let pair_exchanges = result.client_pair_main_exchanges.trim()
|
|
157
|
+
pair_exchanges = JSON.parse(pair_exchanges)
|
|
158
|
+
|
|
159
|
+
let reporter_interval = result.clients_reporter_interval.trim()
|
|
160
|
+
reporter_interval = JSON.parse(reporter_interval)
|
|
161
|
+
|
|
162
|
+
let not_include_exchanges = []
|
|
163
|
+
if (result.client_not_include_exchanges) {
|
|
164
|
+
not_include_exchanges = result.client_not_include_exchanges.split(',').map((value) => value.trim())
|
|
165
|
+
not_include_exchanges.sort()
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
let benchmarks = []
|
|
169
|
+
if (result.client_price_index_curs) {
|
|
170
|
+
benchmarks = result.client_price_index_curs.split(',').map((value) => value.trim())
|
|
171
|
+
benchmarks.sort()
|
|
172
|
+
}
|
|
173
|
+
let levels = result.client_levels.split(',').map((value) => Number(value.trim()))
|
|
174
|
+
|
|
175
|
+
config_file_data.client_exchange_pairs[client_name] = exchange_pairs
|
|
176
|
+
config_file_data.client_pair_main_exchanges[client_name] = pair_exchanges
|
|
177
|
+
|
|
178
|
+
config_file_data.clients_reporter_interval[client_name] = reporter_interval
|
|
179
|
+
|
|
180
|
+
config_file_data.client_not_include_exchanges[client_name] = not_include_exchanges
|
|
181
|
+
config_file_data.client_levels[client_name] = levels
|
|
182
|
+
config_file_data.client_price_index_curs[client_name] = benchmarks
|
|
183
|
+
|
|
184
|
+
config_file_data.client_telegram_ids[client_name] = result.client_telegram_ids
|
|
185
|
+
|
|
186
|
+
config_file_data.client_exchange_pairs = sort(config_file_data.client_exchange_pairs)
|
|
187
|
+
config_file_data.client_pair_main_exchanges = sort(config_file_data.client_pair_main_exchanges)
|
|
188
|
+
config_file_data.clients_reporter_interval = sort(config_file_data.clients_reporter_interval)
|
|
189
|
+
config_file_data.client_not_include_exchanges = sort(config_file_data.client_not_include_exchanges)
|
|
190
|
+
config_file_data.client_levels = sort(config_file_data.client_levels)
|
|
191
|
+
config_file_data.client_price_index_curs = sort(config_file_data.client_price_index_curs)
|
|
192
|
+
config_file_data.client_telegram_ids = sort(config_file_data.client_telegram_ids)
|
|
193
|
+
|
|
194
|
+
write_config_file(config_file_data, config_file_path)
|
|
195
|
+
.then(() => {
|
|
196
|
+
console.log(`Client '${client_name}' has been added successfully.`)
|
|
197
|
+
})
|
|
198
|
+
.catch((err) => {
|
|
199
|
+
console.error(`Error writing to config file: ${err}`)
|
|
200
|
+
})
|
|
201
|
+
})
|
|
202
|
+
})
|
|
203
|
+
.catch((err) => {
|
|
204
|
+
console.error(`Error reading config file: ${err}`)
|
|
205
|
+
})
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
function update_config_archive(config_file_data, client_name) {
|
|
209
|
+
return new Promise((resolve, reject) => {
|
|
210
|
+
read_config_file(config_archive_file_path)
|
|
211
|
+
.then((config_archive_data) => {
|
|
212
|
+
try {
|
|
213
|
+
config_archive_data = JSON.parse(config_archive_data)
|
|
214
|
+
} catch (error) {
|
|
215
|
+
console.error(`Error parsing config archive data: ${error}`)
|
|
216
|
+
reject(error)
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
config_archive_data.client_exchange_pairs[client_name] = config_file_data.client_exchange_pairs[client_name]
|
|
220
|
+
config_archive_data.client_pair_main_exchanges[client_name] = config_file_data.client_pair_main_exchanges[client_name]
|
|
221
|
+
config_archive_data.clients_reporter_interval[client_name] = config_file_data.clients_reporter_interval[client_name]
|
|
222
|
+
config_archive_data.client_not_include_exchanges[client_name] = config_file_data.client_not_include_exchanges[client_name]
|
|
223
|
+
config_archive_data.client_levels[client_name] = config_file_data.client_levels[client_name]
|
|
224
|
+
config_archive_data.client_price_index_curs[client_name] = config_file_data.client_price_index_curs[client_name]
|
|
225
|
+
config_archive_data.client_telegram_ids[client_name] = config_file_data.client_telegram_ids[client_name]
|
|
226
|
+
|
|
227
|
+
if (!config_archive_data.client_enabled) {
|
|
228
|
+
config_archive_data.client_enabled = {}
|
|
229
|
+
}
|
|
230
|
+
for (let key in config_file_data.client_enabled) {
|
|
231
|
+
if (config_file_data.client_enabled.hasOwnProperty(key)) {
|
|
232
|
+
if (!config_archive_data.client_enabled[key]) {
|
|
233
|
+
config_archive_data.client_enabled[key] = {}
|
|
234
|
+
}
|
|
235
|
+
config_archive_data.client_enabled[key][client_name] = config_file_data.client_enabled[key][client_name]
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
config_archive_data.client_exchange_pairs = sort(config_archive_data.client_exchange_pairs)
|
|
240
|
+
config_archive_data.client_pair_main_exchanges = sort(config_archive_data.client_pair_main_exchanges)
|
|
241
|
+
config_archive_data.clients_reporter_interval = sort(config_archive_data.clients_reporter_interval)
|
|
242
|
+
config_archive_data.client_not_include_exchanges = sort(config_archive_data.client_not_include_exchanges)
|
|
243
|
+
config_archive_data.client_levels = sort(config_archive_data.client_levels)
|
|
244
|
+
config_archive_data.client_price_index_curs = sort(config_archive_data.client_price_index_curs)
|
|
245
|
+
config_archive_data.client_telegram_ids = sort(config_archive_data.client_telegram_ids)
|
|
246
|
+
|
|
247
|
+
for (let key in config_archive_data.client_enabled) {
|
|
248
|
+
if (config_archive_data.client_enabled.hasOwnProperty(key)) {
|
|
249
|
+
config_archive_data.client_enabled[key] = sort(config_archive_data.client_enabled[key])
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
write_config_file(config_archive_data, config_archive_file_path)
|
|
254
|
+
.then(() => {
|
|
255
|
+
resolve()
|
|
256
|
+
})
|
|
257
|
+
.catch((err) => {
|
|
258
|
+
console.error(`Error writing to config file: ${err}`)
|
|
259
|
+
reject(err)
|
|
260
|
+
})
|
|
261
|
+
})
|
|
262
|
+
.catch((err) => {
|
|
263
|
+
console.error(`Error reading config archive file: ${err}`)
|
|
264
|
+
reject(err)
|
|
265
|
+
})
|
|
266
|
+
})
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
function sort(obj) {
|
|
270
|
+
return Object.keys(obj)
|
|
271
|
+
.sort()
|
|
272
|
+
.reduce((result, key) => {
|
|
273
|
+
result[key] = obj[key]
|
|
274
|
+
return result
|
|
275
|
+
}, {})
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
process_config()
|