corexxx 1.0.80 → 1.0.83
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/dist/dcrypto.d.ts +1 -4
- package/dist/dcrypto.js +16 -19
- package/dist/dcrypto.js.map +1 -1
- package/dist/dlog.d.ts +1 -0
- package/dist/dlog.js +24 -0
- package/dist/dlog.js.map +1 -1
- package/dist/yahoofin.d.ts +1 -0
- package/dist/yahoofin.js +16 -3
- package/dist/yahoofin.js.map +1 -1
- package/package.json +1 -2
- package/src/dcrypto.ts +4 -3
- package/src/dlog.ts +23 -0
- package/src/yahoofin.ts +17 -3
package/dist/dcrypto.d.ts
CHANGED
package/dist/dcrypto.js
CHANGED
|
@@ -1,24 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
/*
|
|
4
|
+
broken react native
|
|
5
5
|
const Cryptr = require("cryptr");
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
export namespace dcrypto {
|
|
7
|
+
export function encrypt(str: string, key: string): string {
|
|
8
|
+
dassert.verifyNotNullAndEmpty(key, "must pass a valid key");
|
|
9
|
+
return new Cryptr(key).encrypt(str);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export function decrypt(str: string, key: string): string {
|
|
13
|
+
dassert.verifyNotNullAndEmpty(key, "must pass a valid key");
|
|
14
|
+
try {
|
|
15
|
+
return new Cryptr(key).decrypt(str);
|
|
16
|
+
} catch (e) {
|
|
17
|
+
throw new Error("Invalid key - not able to decrypt");
|
|
11
18
|
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
dassert_1.dassert.verifyNotNullAndEmpty(key, "must pass a valid key");
|
|
15
|
-
try {
|
|
16
|
-
return new Cryptr(key).decrypt(str);
|
|
17
|
-
}
|
|
18
|
-
catch (e) {
|
|
19
|
-
throw new Error("Invalid key - not able to decrypt");
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
dcrypto.decrypt = decrypt;
|
|
23
|
-
})(dcrypto = exports.dcrypto || (exports.dcrypto = {}));
|
|
19
|
+
}
|
|
20
|
+
}*/
|
|
24
21
|
//# sourceMappingURL=dcrypto.js.map
|
package/dist/dcrypto.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dcrypto.js","sourceRoot":"","sources":["../src/dcrypto.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"dcrypto.js","sourceRoot":"","sources":["../src/dcrypto.ts"],"names":[],"mappings":";;AACA;;;;;;;;;;;;;;;;;GAiBG"}
|
package/dist/dlog.d.ts
CHANGED
package/dist/dlog.js
CHANGED
|
@@ -10,6 +10,12 @@ const underscore_1 = __importDefault(require("underscore"));
|
|
|
10
10
|
//let _log = colorogs(true, true, __filename);
|
|
11
11
|
var dlog;
|
|
12
12
|
(function (dlog) {
|
|
13
|
+
let ignoreLog = false;
|
|
14
|
+
// call this function to ignore log in prod
|
|
15
|
+
function isDev(isDev) {
|
|
16
|
+
ignoreLog = !isDev;
|
|
17
|
+
}
|
|
18
|
+
dlog.isDev = isDev;
|
|
13
19
|
function convertMsg(str, limit = 5000) {
|
|
14
20
|
if (str == null) {
|
|
15
21
|
return "null";
|
|
@@ -27,6 +33,9 @@ var dlog;
|
|
|
27
33
|
return final.substring(0, limit) + (final.length > limit ? "(trancated)" : "");
|
|
28
34
|
}
|
|
29
35
|
function d(msg, msg2 = null) {
|
|
36
|
+
if (ignoreLog) {
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
30
39
|
console.log(`[${new Date().toLocaleString()}][DEBUG] ${convertMsg(msg)} ${msg2 ? msg2 : ""} `);
|
|
31
40
|
}
|
|
32
41
|
dlog.d = d;
|
|
@@ -35,15 +44,24 @@ var dlog;
|
|
|
35
44
|
}
|
|
36
45
|
dlog.e = e;
|
|
37
46
|
function i(msg, msg2 = null) {
|
|
47
|
+
if (ignoreLog) {
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
38
50
|
console.log(`[${new Date().toLocaleString()}][INFO] ${convertMsg(msg)} ${msg2 ? msg2 : ""} `);
|
|
39
51
|
}
|
|
40
52
|
dlog.i = i;
|
|
41
53
|
function s(msg, msg2 = null) {
|
|
54
|
+
if (ignoreLog) {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
42
57
|
console.log(`[${new Date().toLocaleString()}][SUCCESS] ${convertMsg(msg)} ${msg2 ? msg2 : ""} `);
|
|
43
58
|
}
|
|
44
59
|
dlog.s = s;
|
|
45
60
|
function ex(e, ignore = true) {
|
|
46
61
|
var _a;
|
|
62
|
+
if (ignoreLog) {
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
47
65
|
try {
|
|
48
66
|
if (ignore) {
|
|
49
67
|
console.log(`[${new Date().toLocaleString()}][EXCEPTION] ${e.message}. Please check: ${(_a = e.stack) === null || _a === void 0 ? void 0 : _a.split("\n").slice(0, 2).join("")})`);
|
|
@@ -56,12 +74,18 @@ var dlog;
|
|
|
56
74
|
}
|
|
57
75
|
dlog.ex = ex;
|
|
58
76
|
function obj(obj, msg = "DEBUG OBJECT") {
|
|
77
|
+
if (ignoreLog) {
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
59
80
|
console.log(`[${new Date().toLocaleString()}][DEBUG] =========================== ${msg} START ======================`);
|
|
60
81
|
console.log(convertMsg(obj));
|
|
61
82
|
console.log(`[${new Date().toLocaleString()}][DEBUG] =========================== ${msg} END ======================`);
|
|
62
83
|
}
|
|
63
84
|
dlog.obj = obj;
|
|
64
85
|
function map(map) {
|
|
86
|
+
if (ignoreLog) {
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
65
89
|
console.log("[${new Date().toLocaleString()}]=========================== DEBUG OBJECT START ======================");
|
|
66
90
|
for (let x in map.keys()) {
|
|
67
91
|
console.log(`${JSON.stringify(x)} ==> ${JSON.stringify(map.get(x))}`);
|
package/dist/dlog.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dlog.js","sourceRoot":"","sources":["../src/dlog.ts"],"names":[],"mappings":";AAAA,wDAAwD;AACxD,uCAAuC;;;;;;AAEvC,4DAA2B;AAE3B,8CAA8C;AAC9C,IAAiB,IAAI,
|
|
1
|
+
{"version":3,"file":"dlog.js","sourceRoot":"","sources":["../src/dlog.ts"],"names":[],"mappings":";AAAA,wDAAwD;AACxD,uCAAuC;;;;;;AAEvC,4DAA2B;AAE3B,8CAA8C;AAC9C,IAAiB,IAAI,CA0EpB;AA1ED,WAAiB,IAAI;IACnB,IAAI,SAAS,GAAG,KAAK,CAAC;IACtB,2CAA2C;IAC3C,SAAgB,KAAK,CAAC,KAAc;QAClC,SAAS,GAAG,CAAC,KAAK,CAAC;IACrB,CAAC;IAFe,UAAK,QAEpB,CAAA;IACD,SAAS,UAAU,CAAC,GAAQ,EAAE,KAAK,GAAG,IAAI;QACxC,IAAI,GAAG,IAAI,IAAI,EAAE;YACf,OAAO,MAAM,CAAC;SACf;QACD,IAAI,GAAG,IAAI,SAAS,EAAE;YACpB,OAAO,WAAW,CAAC;SACpB;QACD,IAAI,KAAK,GAAG,EAAE,CAAC;QACf,IAAI,oBAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;YACnB,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;SAC5C;aAAM;YACL,KAAK,GAAG,GAAG,GAAG,EAAE,CAAC;SAClB;QACD,OAAO,KAAK,CAAC,SAAS,CAAC,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,GAAG,KAAK,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IACjF,CAAC;IAED,SAAgB,CAAC,CAAC,GAAW,EAAE,OAAY,IAAI;QAC7C,IAAI,SAAS,EAAE;YACb,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C,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;SACvE;QACD,OAAO,CAAC,GAAG,CAAC,qGAAqG,CAAC,CAAC;IACrH,CAAC;IATe,QAAG,MASlB,CAAA;AACH,CAAC,EA1EgB,IAAI,GAAJ,YAAI,KAAJ,YAAI,QA0EpB"}
|
package/dist/yahoofin.d.ts
CHANGED
|
@@ -35,6 +35,7 @@ export declare namespace yahooFin {
|
|
|
35
35
|
};
|
|
36
36
|
type TExchange = "NSE" | "BSE" | "NASDAQ" | "LSE";
|
|
37
37
|
function getTradingViewUrl(key: string): string;
|
|
38
|
+
function getTradingViewKey(key: string): any;
|
|
38
39
|
function isSymbolSupportedByExchange(symbol: string, exchange: TExchange): boolean;
|
|
39
40
|
function getExchangeFromKey(id: string): TExchange;
|
|
40
41
|
function getBulkStockQuote(symbols: string[], exchange: "NSE" | "BSE" | "LSE" | "NASDAQ"): Promise<TStockInfo[]>;
|
package/dist/yahoofin.js
CHANGED
|
@@ -36,8 +36,21 @@ var yahooFin;
|
|
|
36
36
|
],
|
|
37
37
|
};
|
|
38
38
|
function getTradingViewUrl(key) {
|
|
39
|
+
return `https://www.tradingview.com/chart/?symbol=${getTradingViewKey(key)}`;
|
|
40
|
+
}
|
|
41
|
+
yahooFin.getTradingViewUrl = getTradingViewUrl;
|
|
42
|
+
let hardMapping = {
|
|
43
|
+
"ES=F": "ES1!",
|
|
44
|
+
};
|
|
45
|
+
function getTradingViewKey(key) {
|
|
46
|
+
if (hardMapping[key]) {
|
|
47
|
+
return hardMapping[key];
|
|
48
|
+
}
|
|
39
49
|
let sym = "";
|
|
40
|
-
if (key.
|
|
50
|
+
if (key.startsWith("^")) {
|
|
51
|
+
sym = key.replace("^", "");
|
|
52
|
+
}
|
|
53
|
+
else if (key.endsWith(".NS"))
|
|
41
54
|
sym = "NSE:" + key.replace(".NS", "");
|
|
42
55
|
else if (key.endsWith(".BS"))
|
|
43
56
|
sym = "BSE:" + key.replace(".BS", "");
|
|
@@ -46,9 +59,9 @@ var yahooFin;
|
|
|
46
59
|
else
|
|
47
60
|
sym = "NASDAQ:" + key.replace("", "");
|
|
48
61
|
sym = sym.replace("^", "");
|
|
49
|
-
return
|
|
62
|
+
return sym;
|
|
50
63
|
}
|
|
51
|
-
yahooFin.
|
|
64
|
+
yahooFin.getTradingViewKey = getTradingViewKey;
|
|
52
65
|
function isSymbolSupportedByExchange(symbol, exchange) {
|
|
53
66
|
if (symbol.endsWith(".NS"))
|
|
54
67
|
return exchange == "NSE";
|
package/dist/yahoofin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"yahoofin.js","sourceRoot":"","sources":["../src/yahoofin.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC;AACvC,
|
|
1
|
+
{"version":3,"file":"yahoofin.js","sourceRoot":"","sources":["../src/yahoofin.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC;AACvC,wBAAsC;AACtC,iCAA8B;AAC9B,qDAAkD;AAClD,mCAAgC;AAEhC,IAAiB,QAAQ,CA8TxB;AA9TD,WAAiB,QAAQ;IACV,mBAAU,GAAG;QACxB,WAAW,EAAE;YACX,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,EAAE,OAAO,EAAE;YACjC,EAAE,IAAI,EAAE,WAAW,EAAE,GAAG,EAAE,MAAM,EAAE;YAClC,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,OAAO,EAAE;YAChC,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE;YAC5B,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,EAAE,OAAO,EAAE;YAClC,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE;YAC9B,EAAE,IAAI,EAAE,QAAQ,EAAE,GAA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BAClB,MAAM,CAAC,IAAI,CAAC;oBACV,GAAG,EAAE,CAAC,CAAC,eAAe,CAAC,GAAG,KAAK;oBAC/B,GAAG,EAAE,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC;oBACtB,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC;oBACxB,MAAM,EAAE,CAAC,CAAC,eAAe,CAAC,GAAG,KAAK;oBAClC,IAAI,EAAE,CAAC,CAAC,eAAe,CAAC;oBACxB,QAAQ,EAAE,KAAK;oBACf,MAAM,EAAE,CAAC;oBACT,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC;oBACxB,GAAG,EAAE,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC;oBACtB,MAAM,EAAE,CAAC;oBACT,OAAO,EAAE,CAAC;oBACV,SAAS,EAAE,CAAC;iBACb,CAAC,CAAC;aACJ;YACD,OAAO,MAAM,CAAC;QAChB,CAAC;KAAA;IAjDqB,sBAAa,gBAiDlC,CAAA;IAED,aAAa;AACf,CAAC,EA9TgB,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QA8TxB;AACD,OAAO;AACP,CAAC,GAAS,EAAE;IACV,+DAA+D;IAC/D,iBAAiB;IACjB,0DAA0D;IAC1D,8CAA8C;IAC9C,4HAA4H;IAC5H,oBAAoB;AACtB,CAAC,CAAA,CAAC,EAAE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "corexxx",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.83",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -16,7 +16,6 @@
|
|
|
16
16
|
"@types/underscore": "^1.11.3",
|
|
17
17
|
"axios": "^0.21.1",
|
|
18
18
|
"corexxx": "1.0.71",
|
|
19
|
-
"cryptr": "^6.0.3",
|
|
20
19
|
"csvtojson": "^2.0.10",
|
|
21
20
|
"moment": "^2.29.1",
|
|
22
21
|
"moment-timezone": "^0.5.34",
|
package/src/dcrypto.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
export {};
|
|
2
|
+
/*
|
|
3
|
+
broken react native
|
|
3
4
|
const Cryptr = require("cryptr");
|
|
4
5
|
export namespace dcrypto {
|
|
5
6
|
export function encrypt(str: string, key: string): string {
|
|
@@ -15,4 +16,4 @@ export namespace dcrypto {
|
|
|
15
16
|
throw new Error("Invalid key - not able to decrypt");
|
|
16
17
|
}
|
|
17
18
|
}
|
|
18
|
-
}
|
|
19
|
+
}*/
|
package/src/dlog.ts
CHANGED
|
@@ -5,6 +5,11 @@ import _ from "underscore";
|
|
|
5
5
|
|
|
6
6
|
//let _log = colorogs(true, true, __filename);
|
|
7
7
|
export namespace dlog {
|
|
8
|
+
let ignoreLog = false;
|
|
9
|
+
// call this function to ignore log in prod
|
|
10
|
+
export function isDev(isDev: boolean) {
|
|
11
|
+
ignoreLog = !isDev;
|
|
12
|
+
}
|
|
8
13
|
function convertMsg(str: any, limit = 5000) {
|
|
9
14
|
if (str == null) {
|
|
10
15
|
return "null";
|
|
@@ -22,18 +27,30 @@ export namespace dlog {
|
|
|
22
27
|
}
|
|
23
28
|
|
|
24
29
|
export function d(msg: String, msg2: any = null) {
|
|
30
|
+
if (ignoreLog) {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
25
33
|
console.log(`[${new Date().toLocaleString()}][DEBUG] ${convertMsg(msg)} ${msg2 ? msg2 : ""} `);
|
|
26
34
|
}
|
|
27
35
|
export function e(msg: String, msg2: any = null) {
|
|
28
36
|
console.log(`[${new Date().toLocaleString()}][ERROR] ${convertMsg(msg)} ${msg2 ? msg2 : ""} `);
|
|
29
37
|
}
|
|
30
38
|
export function i(msg: String, msg2: any = null) {
|
|
39
|
+
if (ignoreLog) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
31
42
|
console.log(`[${new Date().toLocaleString()}][INFO] ${convertMsg(msg)} ${msg2 ? msg2 : ""} `);
|
|
32
43
|
}
|
|
33
44
|
export function s(msg: String, msg2: any = null) {
|
|
45
|
+
if (ignoreLog) {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
34
48
|
console.log(`[${new Date().toLocaleString()}][SUCCESS] ${convertMsg(msg)} ${msg2 ? msg2 : ""} `);
|
|
35
49
|
}
|
|
36
50
|
export function ex(e: Error, ignore = true) {
|
|
51
|
+
if (ignoreLog) {
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
37
54
|
try {
|
|
38
55
|
if (ignore) {
|
|
39
56
|
console.log(`[${new Date().toLocaleString()}][EXCEPTION] ${e.message}. Please check: ${e.stack?.split("\n").slice(0, 2).join("")})`);
|
|
@@ -44,11 +61,17 @@ export namespace dlog {
|
|
|
44
61
|
} catch (e) {}
|
|
45
62
|
}
|
|
46
63
|
export function obj(obj?: Object, msg: string = "DEBUG OBJECT") {
|
|
64
|
+
if (ignoreLog) {
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
47
67
|
console.log(`[${new Date().toLocaleString()}][DEBUG] =========================== ${msg} START ======================`);
|
|
48
68
|
console.log(convertMsg(obj));
|
|
49
69
|
console.log(`[${new Date().toLocaleString()}][DEBUG] =========================== ${msg} END ======================`);
|
|
50
70
|
}
|
|
51
71
|
export function map(map: Map<string, any>) {
|
|
72
|
+
if (ignoreLog) {
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
52
75
|
console.log("[${new Date().toLocaleString()}]=========================== DEBUG OBJECT START ======================");
|
|
53
76
|
for (let x in map.keys()) {
|
|
54
77
|
console.log(`${JSON.stringify(x)} ==> ${JSON.stringify(map.get(x))}`);
|
package/src/yahoofin.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const axios = require("axios").default;
|
|
2
|
-
import { dnetwork } from ".";
|
|
2
|
+
import { dnetwork, TObject } from ".";
|
|
3
3
|
import { dlog } from "./dlog";
|
|
4
4
|
import { dserialization } from "./dserialization";
|
|
5
5
|
import { dtime } from "./dtime";
|
|
@@ -57,13 +57,27 @@ export namespace yahooFin {
|
|
|
57
57
|
export type TExchange = "NSE" | "BSE" | "NASDAQ" | "LSE";
|
|
58
58
|
|
|
59
59
|
export function getTradingViewUrl(key: string) {
|
|
60
|
+
return `https://www.tradingview.com/chart/?symbol=${getTradingViewKey(key)}`;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
let hardMapping: TObject = {
|
|
64
|
+
"ES=F": "ES1!",
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
export function getTradingViewKey(key: string) {
|
|
68
|
+
if (hardMapping[key]) {
|
|
69
|
+
return hardMapping[key];
|
|
70
|
+
}
|
|
60
71
|
let sym = "";
|
|
61
|
-
|
|
72
|
+
|
|
73
|
+
if (key.startsWith("^")) {
|
|
74
|
+
sym = key.replace("^", "");
|
|
75
|
+
} else if (key.endsWith(".NS")) sym = "NSE:" + key.replace(".NS", "");
|
|
62
76
|
else if (key.endsWith(".BS")) sym = "BSE:" + key.replace(".BS", "");
|
|
63
77
|
else if (key.endsWith(".L")) sym = "LSE:" + key.replace(".L", "");
|
|
64
78
|
else sym = "NASDAQ:" + key.replace("", "");
|
|
65
79
|
sym = sym.replace("^", "");
|
|
66
|
-
return
|
|
80
|
+
return sym;
|
|
67
81
|
}
|
|
68
82
|
|
|
69
83
|
export function isSymbolSupportedByExchange(symbol: string, exchange: TExchange): boolean {
|