webull-api-ts
Advanced tools
Comparing version 0.0.4 to 0.1.0
@@ -67,2 +67,3 @@ "use strict"; | ||
login(args) { | ||
var _a, _b, _c; | ||
return __awaiter(this, void 0, void 0, function* () { | ||
@@ -137,3 +138,2 @@ args = Object.assign({ reset: false, retries: 0, username: '', password: '', tradePin: '', deviceId: '', mfaCode: null }, args); | ||
deviceId: args.mfaCode != null ? deviceId : null, | ||
noHeaders: args.mfaCode != null ? false : true | ||
}); | ||
@@ -149,3 +149,3 @@ } | ||
const isValidAuth = this.validResponse(authResponse); | ||
if (isValidAuth) { | ||
if (isValidAuth && authResponse.accessToken) { | ||
this.uuid = authResponse.uuid || store.data.uuid; | ||
@@ -198,3 +198,3 @@ this.username = username; | ||
} | ||
else if (!isValidAuth && authResponse.data.msg.includes('deviceId')) { | ||
else if (String((_b = (_a = authResponse) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.msg).includes('deviceId') || ((_c = authResponse) === null || _c === void 0 ? void 0 : _c.extInfo)) { | ||
print.warn(`Multi-Factor Authentification (MFA) required. Please check your email: ${username}`); | ||
@@ -201,0 +201,0 @@ const mfaResponse = yield this.get(endpoints.mfa(username, 2, deviceId, 5, 1)); |
{ | ||
"name": "webull-api-ts", | ||
"version": "0.0.4", | ||
"version": "0.1.0", | ||
"description": "Webull trading API for node-js", | ||
@@ -13,2 +13,17 @@ "main": "./dist/index.js", | ||
"scripts": { | ||
"compile": "tsc", | ||
"check": "tsc --noEmit", | ||
"watch": "tsc --watch", | ||
"lint": "npx eslint .", | ||
"lint-fix": "npx eslint --fix .", | ||
"format": "npx prettier --write .", | ||
"dev-checkout": "git checkout dev", | ||
"commit": "npm run dev-checkout && tsc && npm run test && git add . && git commit -m", | ||
"bump-patch": "npm run dev-checkout && npm version patch", | ||
"bump-minor": "npm run dev-checkout && npm version minor", | ||
"bump-major": "npm run dev-checkout && npm version major", | ||
"release": "npm run dev-checkout && git push origin dev && git checkout master && git merge dev && git push origin master && git push --tags && git checkout dev", | ||
"release-patch": "npm run bump-patch && npm run doc && npm run release", | ||
"release-minor": "npm run bump-minor && npm run doc && npm run release", | ||
"release-major": "npm run bump-major && npm run doc && npm run release", | ||
"test": "npx mocha dist/tests", | ||
@@ -15,0 +30,0 @@ "doc": "npx typedoc", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
35250