api_connect_nodejs 2.0.1 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +30 -30
- package/conf/settings.ini +19 -19
- package/enums/actionType.js +10 -10
- package/enums/assetType.js +25 -25
- package/enums/chartExchangeType.js +15 -15
- package/enums/chartType.js +13 -13
- package/enums/eodIntervalType.js +11 -11
- package/enums/exchangeType.js +14 -14
- package/enums/intradayIntervalType.js +14 -14
- package/enums/marketCapType.js +12 -12
- package/enums/orderType.js +21 -21
- package/enums/productType.js +24 -24
- package/enums/segementsType.js +13 -13
- package/enums/streamingConstants.js +11 -11
- package/enums/termsType.js +12 -12
- package/enums/validity.js +22 -22
- package/index.js +3 -3
- package/package.json +25 -25
- package/src/apiConnect.js +2430 -2424
- package/src/apiUtils.js +129 -129
- package/src/chart.js +258 -258
- package/src/config.js +326 -326
- package/src/feed/feed.js +139 -139
- package/src/feed/liveNewsFeed.js +112 -112
- package/src/feed/ordersFeed.js +124 -124
- package/src/feed/quotesFeed.js +121 -121
- package/src/http.js +197 -197
- package/src/iniparser.js +42 -42
- package/src/liveNews.js +362 -362
- package/src/logger.js +16 -16
- package/src/order.js +48 -48
- package/src/researchCalls.js +175 -175
- package/src/watchlist.js +378 -378
- package/validations/apiConnectValidator.js +508 -508
- package/validations/chartValidator.js +85 -85
- package/validations/feedStreamerValidator.js +68 -68
- package/validations/liveNewsValidator.js +60 -60
- package/validations/researchCallsValidator.js +86 -86
- package/validations/watchlistValidator.js +60 -60
package/src/apiUtils.js
CHANGED
|
@@ -1,129 +1,129 @@
|
|
|
1
|
-
const fs = require("fs");
|
|
2
|
-
const configData = require("./iniparser.js");
|
|
3
|
-
const log4js = require("./logger.js");
|
|
4
|
-
class __Constants {
|
|
5
|
-
__VendorSession = "";
|
|
6
|
-
__ApiKey = "";
|
|
7
|
-
__eqAccId = "";
|
|
8
|
-
__coAccId = "";
|
|
9
|
-
__profileId = "";
|
|
10
|
-
__JSessionId = "";
|
|
11
|
-
__AppIdKey = "";
|
|
12
|
-
__Data = "";
|
|
13
|
-
|
|
14
|
-
constructor() {
|
|
15
|
-
this.__AppIdKey = configData.ApiIdKey;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
get VendorSession() {
|
|
19
|
-
return this.__VendorSession;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
set VendorSession(val) {
|
|
23
|
-
this.__VendorSession = val;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
get ApiKey() {
|
|
27
|
-
return this.__ApiKey;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
set ApiKey(val) {
|
|
31
|
-
this.__ApiKey = val;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
get profileId() {
|
|
35
|
-
return this.__profileId;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
set profileId(val) {
|
|
39
|
-
this.__profileId = val;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
get eqAccId() {
|
|
43
|
-
return this.__eqAccId;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
set eqAccId(val) {
|
|
47
|
-
this.__eqAccId = val;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
get coAccId() {
|
|
51
|
-
return this.__coAccId;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
set coAccId(val) {
|
|
55
|
-
this.__coAccId = val;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
get JSession() {
|
|
59
|
-
return this.__JSessionId;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
set JSession(val) {
|
|
63
|
-
this.__JSessionId = val;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
get AppIdKey() {
|
|
67
|
-
return this.__AppIdKey;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
set AppIdKey(val) {
|
|
71
|
-
this.__AppIdKey = val;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
get Data() {
|
|
75
|
-
return this.__Data;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
set Data(val) {
|
|
79
|
-
this.__Data = val;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
//Check file exist or not
|
|
83
|
-
fileExistOrNot = (path) => {
|
|
84
|
-
let flag = false;
|
|
85
|
-
try {
|
|
86
|
-
if (fs.existsSync(path)) {
|
|
87
|
-
flag = true;
|
|
88
|
-
}
|
|
89
|
-
} catch (error) {
|
|
90
|
-
log4js.debug("error - " + error);
|
|
91
|
-
}
|
|
92
|
-
return flag;
|
|
93
|
-
};
|
|
94
|
-
|
|
95
|
-
//Read file
|
|
96
|
-
readFile = (path) => {
|
|
97
|
-
let data = {};
|
|
98
|
-
try {
|
|
99
|
-
data = fs.readFileSync(path, "utf8");
|
|
100
|
-
} catch (err) {
|
|
101
|
-
log4js.debug("error - " + error);
|
|
102
|
-
}
|
|
103
|
-
return data;
|
|
104
|
-
};
|
|
105
|
-
|
|
106
|
-
//Write data in file
|
|
107
|
-
writeInFile = (path, data) => {
|
|
108
|
-
try {
|
|
109
|
-
fs.writeFileSync(path, data);
|
|
110
|
-
return true;
|
|
111
|
-
} catch (err) {
|
|
112
|
-
log4js.debug("error - " + error);
|
|
113
|
-
return false;
|
|
114
|
-
}
|
|
115
|
-
};
|
|
116
|
-
|
|
117
|
-
isEmptyNullString = (val) => {
|
|
118
|
-
if (val === null) {
|
|
119
|
-
return true;
|
|
120
|
-
}
|
|
121
|
-
if ((typeof val === "string") && (val.length === 0)) {
|
|
122
|
-
return true;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
return false;
|
|
126
|
-
};
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
module.exports = __Constants;
|
|
1
|
+
const fs = require("fs");
|
|
2
|
+
const configData = require("./iniparser.js");
|
|
3
|
+
const log4js = require("./logger.js");
|
|
4
|
+
class __Constants {
|
|
5
|
+
__VendorSession = "";
|
|
6
|
+
__ApiKey = "";
|
|
7
|
+
__eqAccId = "";
|
|
8
|
+
__coAccId = "";
|
|
9
|
+
__profileId = "";
|
|
10
|
+
__JSessionId = "";
|
|
11
|
+
__AppIdKey = "";
|
|
12
|
+
__Data = "";
|
|
13
|
+
|
|
14
|
+
constructor() {
|
|
15
|
+
this.__AppIdKey = configData.ApiIdKey;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
get VendorSession() {
|
|
19
|
+
return this.__VendorSession;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
set VendorSession(val) {
|
|
23
|
+
this.__VendorSession = val;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
get ApiKey() {
|
|
27
|
+
return this.__ApiKey;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
set ApiKey(val) {
|
|
31
|
+
this.__ApiKey = val;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
get profileId() {
|
|
35
|
+
return this.__profileId;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
set profileId(val) {
|
|
39
|
+
this.__profileId = val;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
get eqAccId() {
|
|
43
|
+
return this.__eqAccId;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
set eqAccId(val) {
|
|
47
|
+
this.__eqAccId = val;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
get coAccId() {
|
|
51
|
+
return this.__coAccId;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
set coAccId(val) {
|
|
55
|
+
this.__coAccId = val;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
get JSession() {
|
|
59
|
+
return this.__JSessionId;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
set JSession(val) {
|
|
63
|
+
this.__JSessionId = val;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
get AppIdKey() {
|
|
67
|
+
return this.__AppIdKey;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
set AppIdKey(val) {
|
|
71
|
+
this.__AppIdKey = val;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
get Data() {
|
|
75
|
+
return this.__Data;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
set Data(val) {
|
|
79
|
+
this.__Data = val;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
//Check file exist or not
|
|
83
|
+
fileExistOrNot = (path) => {
|
|
84
|
+
let flag = false;
|
|
85
|
+
try {
|
|
86
|
+
if (fs.existsSync(path)) {
|
|
87
|
+
flag = true;
|
|
88
|
+
}
|
|
89
|
+
} catch (error) {
|
|
90
|
+
log4js.debug("error - " + error);
|
|
91
|
+
}
|
|
92
|
+
return flag;
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
//Read file
|
|
96
|
+
readFile = (path) => {
|
|
97
|
+
let data = {};
|
|
98
|
+
try {
|
|
99
|
+
data = fs.readFileSync(path, "utf8");
|
|
100
|
+
} catch (err) {
|
|
101
|
+
log4js.debug("error - " + error);
|
|
102
|
+
}
|
|
103
|
+
return data;
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
//Write data in file
|
|
107
|
+
writeInFile = (path, data) => {
|
|
108
|
+
try {
|
|
109
|
+
fs.writeFileSync(path, data);
|
|
110
|
+
return true;
|
|
111
|
+
} catch (err) {
|
|
112
|
+
log4js.debug("error - " + error);
|
|
113
|
+
return false;
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
isEmptyNullString = (val) => {
|
|
118
|
+
if (val === null) {
|
|
119
|
+
return true;
|
|
120
|
+
}
|
|
121
|
+
if ((typeof val === "string") && (val.length === 0)) {
|
|
122
|
+
return true;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
return false;
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
module.exports = __Constants;
|