New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

degiro-api

Package Overview
Dependencies
Maintainers
1
Versions
54
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

degiro-api - npm Package Compare versions

Comparing version 0.6.5 to 1.0.0

7

dist/api/login.js

@@ -17,2 +17,3 @@ "use strict";

username: params.username.toLowerCase().trim(),
oneTimePassword: params.oneTimePassword,
queryParams: {

@@ -35,2 +36,8 @@ reason: 'session_expired',

fetch(BASE_API_URL + LOGIN_URL_PATH, requestOptions)
.then(function (res) {
if (!payload.oneTimePassword)
return res;
utils_1.debug('Sending OTP');
return fetch(BASE_API_URL + LOGIN_URL_PATH + "/totp", requestOptions);
})
.then(function (res) { return res.json(); })

@@ -37,0 +44,0 @@ .then(function (res) {

1

dist/DeGiro.d.ts

@@ -10,2 +10,3 @@ import { DeGiroClassInterface } from './interfaces';

private readonly pwd;
private readonly oneTimePassword;
private jsessionId;

@@ -12,0 +13,0 @@ private accountConfig;

10

dist/DeGiro.js

@@ -38,5 +38,6 @@ "use strict";

this.getJSESSIONID = function () { return _this.hasSessionId() ? _this.accountConfig.data.sessionId : undefined; };
var username = params.username, pwd = params.pwd, jsessionId = params.jsessionId;
var username = params.username, pwd = params.pwd, oneTimePassword = params.oneTimePassword, jsessionId = params.jsessionId;
username = username || process.env['DEGIRO_USER'];
pwd = pwd || process.env['DEGIRO_PWD'];
oneTimePassword = oneTimePassword || process.env['DEGIRO_OTP'];
jsessionId = jsessionId || process.env['DEGIRO_JSESSIONID'];

@@ -49,2 +50,3 @@ if (!username)

this.pwd = pwd;
this.oneTimePassword = oneTimePassword;
this.jsessionId = jsessionId;

@@ -61,3 +63,7 @@ }

return new Promise(function (resolve, reject) {
api_1.loginRequest({ username: _this.username, pwd: _this.pwd })
api_1.loginRequest({
username: _this.username,
pwd: _this.pwd,
oneTimePassword: _this.oneTimePassword
})
.then(function (loginResponse) {

@@ -64,0 +70,0 @@ if (!loginResponse.sessionId)

export declare type DeGiroSettupType = {
username?: string;
pwd?: string;
oneTimePassword?: string;
jsessionId?: string;
};
//# sourceMappingURL=DeGiroSettupType.d.ts.map

@@ -6,2 +6,3 @@ export declare type LoginRequestBodyType = {

username: string;
oneTimePassword: string | undefined;
queryParams: {

@@ -8,0 +9,0 @@ reason: string;

export declare type LoginRequestParamsType = {
username: string;
pwd: string;
oneTimePassword: string | undefined;
};
//# sourceMappingURL=LoginRequestParamsType.d.ts.map
{
"name": "degiro-api",
"version": "0.6.5",
"version": "1.0.0",
"public": true,

@@ -5,0 +5,0 @@ "description": "Unofficial DeGiro API for Javascript. Buy and sell in the stock market. See your portfolio and much more",

# DeGiro Trading Broker API
This is an unofficial TypeScript API client (Backend & Frontend) for DeGiro's trading platform. Using this module you can easily automate your orders (buy and sell) and get information about orders, funds or products.
This is an unofficial TypeScript API client (Backend & Frontend) for DeGiro's trading platform. Using this module you can easily automate your orders (buy and sell) and get information about orders, funds or products. From now on we have one time password (OTP) support.

@@ -168,5 +168,6 @@ All responses and objects are typed to develop faster and secure.

const degiro = new DeGiro({
username: '<your_username_here>',
pwd: '*******',
jsessionId: previousJSESSIONID
username: '<your_username_here>', // process.env['DEGIRO_USER]
pwd: '<your_password_here>', // process.env['DEGIRO_PWD]
oneTimePassword: '<your_one_time_password_here>', // process.env['DEGIRO_OTP]
jsessionId: '<your_jsessionId_here>', // process.env['DEGIRO_JSESSIONID]
})

@@ -173,0 +174,0 @@

@@ -20,2 +20,3 @@ // Import types

username: params.username.toLowerCase().trim(),
oneTimePassword: params.oneTimePassword,
queryParams: {

@@ -48,2 +49,7 @@ reason: 'session_expired',

fetch(BASE_API_URL + LOGIN_URL_PATH, requestOptions)
.then((res) => {
if (!payload.oneTimePassword) return res
debug('Sending OTP')
return fetch(BASE_API_URL + LOGIN_URL_PATH + "/totp", requestOptions);
})
.then(res => res.json())

@@ -55,4 +61,4 @@ .then((res) => {

})
.catch(reject)
.catch(reject);
})
}
}

@@ -73,2 +73,3 @@ // Import modules

private readonly pwd: string
private readonly oneTimePassword: string | undefined
private jsessionId: string | undefined

@@ -81,6 +82,7 @@ private accountConfig: AccountConfigType | undefined

constructor(params: DeGiroSettupType = {}) {
let { username, pwd, jsessionId } = params
let { username, pwd, oneTimePassword, jsessionId } = params
username = username || process.env['DEGIRO_USER']
pwd = pwd || process.env['DEGIRO_PWD']
oneTimePassword = oneTimePassword || process.env['DEGIRO_OTP']
jsessionId = jsessionId || process.env['DEGIRO_JSESSIONID']

@@ -93,2 +95,3 @@

this.pwd = pwd
this.oneTimePassword = oneTimePassword

@@ -107,3 +110,7 @@ this.jsessionId = jsessionId

return new Promise((resolve, reject) => {
loginRequest({ username: this.username, pwd: this.pwd })
loginRequest({
username: this.username,
pwd: this.pwd,
oneTimePassword: this.oneTimePassword
})
.then((loginResponse: LoginResponseType) => {

@@ -256,3 +263,3 @@ if (!loginResponse.sessionId) reject('Login response have not a sessionId field')

if (error) return reject(error)
resolve(portfolio)
resolve(<any[]>portfolio)
})

@@ -357,2 +364,2 @@ })

}
}
export type DeGiroSettupType = {
username?: string,
pwd?: string,
oneTimePassword?: string,
jsessionId?: string,
}

@@ -6,5 +6,6 @@ export type LoginRequestBodyType = {

username: string,
oneTimePassword: string | undefined,
queryParams: {
reason: string,
},
}
}
export type LoginRequestParamsType = {
username: string,
pwd: string,
}
oneTimePassword: string | undefined
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc