beejjacobs / nissan-connect Goto Github PK
View Code? Open in Web Editor NEWNode js Nissan Connect api wrapper
Node js Nissan Connect api wrapper
Currently, if I do a "npm install --save nissan-connect", it will install the version 1.1.0. I then have to go into the package.json and manually force a specific version.
I guess that the easiest would simply be to remove the old 1.1.0 release since the new ones offer a lot more functionality.
e.g.
async login(username, password) {
const key = await this.connect();
NissanConnectApi.log('logging in');
return this.request(Config.endPoints.login, {
UserId: username,
Password: NissanConnectApi.encryptPassword(password, key)
})
.then(res => new LoginResponse(res));
}
could be
async login(username, password) {
const key = await this.connect();
NissanConnectApi.log('logging in');
const res = await this.request(Config.endPoints.login, {
UserId: username,
Password: NissanConnectApi.encryptPassword(password, key)
});
return new LoginResponse(res);
}
just a heads up that the api endpoint has changed.
the login response may contain a vehicleinfolist instead of a single vehicleinfo:
"VehicleInfoList": {
"VehicleInfo": [
{
"charger20066":"false",
"nickname":"LEAF",
"telematicsEnabled":"true",
"vin":"1ABCDEFG2HIJKLM3N"
}
],
"vehicleInfo": [
{
"charger20066":"false",
"nickname":"LEAF",
"telematicsEnabled":"true",
"vin":"1ABCDEFG2HIJKLM3N"
}
]
},
(yes, one with a lower case v and another with upper case V)
currently, in that case, login-response.js throws an exception at line 57
A quick fix to get it going was to add before line 57:
if (this.res.hasOwnProperty('VehicleInfoList')) {
this.res.vehicleInfo = this.res.VehicleInfoList.vehicleInfo;
}
nissan-connect-api unable to resolve crypto
npm repo has a 1.1.0 which seams to be older that the latest 1.0.14 in github. In particular, the bug " add support for a login response with a VehicleInfoList, fixes #2 " is not fix in the official npm repo
Hi,
I am trying to use this module, without success. I get a 404 error, so I think the endpoint has changed.
Can anyone help ?
Thank you
looks like the password encoding is not correct. don't know enough about the process to know why exactly, but hopefully the following helps:
i'm comparing with the encoded password from pycarwings2 and the value seems to be different (first 10 characters are the same). if i take the result from the python library and hardcode it into the output of the encryptPassword function, then everything works.
using the docs, I am unable to login anymore.
{ status: '-2010', message: 'INVALID PARAMS' }
debugging a little deeper
request:
uri: 'https://gdcportalgw.its-mo.com/api_v180117_NE/gdc/UserLoginRequest.php',
method: 'POST'
response:
{"status":404,"message":"INVALID PARAMS"}
In AcRecord - need to handle the case where data is undefined
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.