Skip to content

Commit a14fd20

Browse files
authored
Merge pull request #197 from pipedrive/GRAL-5798-fix-critical-and-high-security-vulnerabilities-in-example-apps
GRAL-5798 update dependencies and add overrides in package.json
2 parents 7f1c77f + a97bde0 commit a14fd20

24 files changed

Lines changed: 26660 additions & 28809 deletions

File tree

apps/caller/package-lock.json

Lines changed: 1407 additions & 3926 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/caller/package.json

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,28 @@
1010
"author": "Hem",
1111
"license": "ISC",
1212
"dependencies": {
13-
"@twilio/voice-sdk": "^2.1.1",
14-
"@vscode/sqlite3": "^5.1.6-vscode",
15-
"body-parser": "^1.19.0",
13+
"@twilio/voice-sdk": "^2.18.1",
14+
"@vscode/sqlite3": "^5.1.12-vscode",
15+
"axios": "^1.7.9",
16+
"body-parser": "^1.20.3",
1617
"dotenv": "^10.0.0",
17-
"express": "^4.19.2",
18+
"express": "^4.22.1",
1819
"form-data": "^4.0.5",
1920
"jquery": "^3.6.0",
2021
"jws": "^4.0.1",
2122
"knex": "^2.4.0",
2223
"passport": "^0.6.0",
2324
"passport-oauth": "^1.0.0",
24-
"request": "^2.88.2",
25-
"request-promise": "^4.2.5",
26-
"sqlite3": "^5.1.6",
27-
"tar": "^7.5.7",
28-
"twilio": "~3.64.0"
25+
"sqlite3": "^6.0.1",
26+
"tar": "^7.5.12",
27+
"twilio": "^4.20.0"
28+
},
29+
"overrides": {
30+
"minimatch": "^3.1.4",
31+
"tar-fs": "^2.1.4",
32+
"ws": "^7.5.10",
33+
"picomatch": "^2.3.2",
34+
"brace-expansion": "^2.0.3",
35+
"path-to-regexp": "0.1.13"
2936
}
3037
}

apps/caller/server/utils/pipedrive_handler.js

Lines changed: 10 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,17 @@
1-
const request = require('request-promise');
2-
/**
3-
* Get details pertaining to an authorized user
4-
*/
5-
async function getUser(accessToken) {
6-
const requestOptions = {
7-
uri: 'https://api.pipedrive.com/v1/users/me',
8-
headers: {
9-
'Authorization': `Bearer ${accessToken}`
10-
},
11-
json: true
12-
};
13-
const userInfo = await request(requestOptions);
1+
const axios = require('axios');
142

15-
return userInfo;
3+
async function getUser(accessToken) {
4+
const response = await axios.get('https://api.pipedrive.com/v1/users/me', {
5+
headers: { 'Authorization': `Bearer ${accessToken}` }
6+
});
7+
return response.data;
168
}
179

18-
/**
19-
* Retrieve contact details associated with the company
20-
* Note that you need to have `Contacts` OAuth scope to access these details
21-
*/
2210
async function getPersons(accessToken) {
23-
const requestOptions = {
24-
uri: 'https://api.pipedrive.com/v1/persons',
25-
headers: {
26-
'Authorization': `Bearer ${accessToken}`
27-
},
28-
json: true
29-
};
30-
const persons = await request(requestOptions);
31-
32-
return persons;
11+
const response = await axios.get('https://api.pipedrive.com/v1/persons', {
12+
headers: { 'Authorization': `Bearer ${accessToken}` }
13+
});
14+
return response.data;
3315
}
3416

3517
module.exports = {

0 commit comments

Comments
 (0)