intercom-client
Advanced tools
@@ -86,2 +86,21 @@ 'use strict'; | ||
} | ||
}, { | ||
key: 'requestPermanentDeletionByParams', | ||
value: function requestPermanentDeletionByParams(params, f) { | ||
var _this = this; | ||
if (params.id) { | ||
return this.requestPermanentDeletion(params.id, f); | ||
} | ||
return this.find(params).then(function (res) { | ||
return _this.requestPermanentDeletion(res.body.id, f); | ||
}).catch(function (err) { | ||
if (f) { | ||
return f(err); | ||
} | ||
throw err; | ||
}); | ||
} | ||
}]); | ||
@@ -88,0 +107,0 @@ |
{ | ||
"name": "intercom-client", | ||
"version": "2.10.2", | ||
"version": "2.10.3", | ||
"description": "Official Node bindings to the Intercom API", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/intercom/intercom-node", |
@@ -151,3 +151,3 @@ # intercom-node | ||
```node | ||
// Permanently delete a user user by id (https://developers.intercom.com/v2.0/reference#delete-users) | ||
// Permanently delete a user by id (https://developers.intercom.com/v2.0/reference#delete-users) | ||
const intercomUserId = '123' | ||
@@ -157,2 +157,13 @@ client.users.requestPermanentDeletion(intercomUserId, callback); | ||
```node | ||
// Permanently delete a user by id in params | ||
client.users.requestPermanentDeletionByParams({ id: '55b9eaf' }, callback); | ||
// Permanently delete a user by user_id | ||
client.users.requestPermanentDeletionByParams({ user_id: 'foobar' }, callback); | ||
// Permanently delete a user by email | ||
client.users.requestPermanentDeletionByParams({ email: 'jayne@serenity.io' }, callback); | ||
``` | ||
## Leads | ||
@@ -189,3 +200,3 @@ | ||
setTimeout(() => { | ||
console.log(res.body.users.length); | ||
console.log(res.body.contacts.length); | ||
// Your custom logic | ||
@@ -192,0 +203,0 @@ resolve(); |
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
58299
0.87%1056
0.57%598
1.87%1
-50%21
-4.55%