node-linkedin-v2
Advanced tools
Comparing version 0.0.5 to 0.0.6
@@ -37,8 +37,10 @@ 'use strict'; | ||
* | ||
* @param fields | ||
* @param access_token | ||
* @returns {Promise<Object>} | ||
*/ | ||
async getCurrentMemberProfile(access_token) { | ||
async getCurrentMemberProfile(fields, access_token) { | ||
if (!access_token) throw new Error('Access code cannot be empty'); | ||
const url = `${this.url}/me`; | ||
if (!Array.isArray(fields)) throw new Error('Parameter "fields" must be an array'); | ||
const url = `${this.url}/me?projection=(${fields.join(',')})`; | ||
return this.invoke('GET', url, undefined, undefined, { withAuth: true, access_token }); | ||
@@ -45,0 +47,0 @@ } |
{ | ||
"name": "node-linkedin-v2", | ||
"version": "0.0.5", | ||
"version": "0.0.6", | ||
"description": "Client for LinkedIn API v2", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -15,3 +15,3 @@ 'use strict'; | ||
it('should call getCurrentMemberProfile() correctly', (done) => { | ||
linkedInAPI.getCurrentMemberProfile('access_token') | ||
linkedInAPI.getCurrentMemberProfile(['id', 'firstName', 'lastName'], 'access_token') | ||
.then(response => { | ||
@@ -18,0 +18,0 @@ console.log(response); |
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
14419
287