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

intercom-client

Package Overview
Dependencies
Maintainers
1
Versions
65
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

intercom-client - npm Package Compare versions

Comparing version 2.9.2 to 2.9.3

dist/get_user.js

32

dist/client.js

@@ -131,3 +131,3 @@ 'use strict';

if (err) {
reject(new Error(JSON.stringify(err)));
reject(err);
} else {

@@ -137,9 +137,9 @@ resolve(data);

};
_this.request(args, function (_, r) {
callbackHandler(resolver, r);
_this.request(args, function (err, r) {
callbackHandler(resolver, err, r);
});
});
} else {
this.request(args, function (_, r) {
return _this.callback(f, r);
this.request(args, function (err, r) {
return _this.callback(f, err, r);
});

@@ -218,3 +218,3 @@ }

key: 'callback',
value: function callback(f, data) {
value: function callback(f, err, res) {
if (!f) {

@@ -224,10 +224,20 @@ return;

if (f.length >= 2) {
var hasErrors = data.error || data.body && data.body.type === 'error.list';
if (hasErrors) {
f(data, null);
if (res && res.body && res.body.type === 'error.list') {
var message = null;
if (Array.isArray(res.body.errors) && res.body.errors[0] && 'message' in res.body.errors) {
// Try to use the first errors message
message = res.body.errors[0].message;
}
err = new Error(message || 'Response error');
err.statusCode = res.statusCode;
err.body = res.body;
err.headers = res.headers;
}
if (err) {
f(err, null);
} else {
f(null, data);
f(null, res);
}
} else {
f(data);
f(res || null);
}

@@ -234,0 +244,0 @@ }

{
"name": "intercom-client",
"version": "2.9.2",
"version": "2.9.3",
"description": "Official Node bindings to the Intercom API",

@@ -5,0 +5,0 @@ "homepage": "https://github.com/intercom/intercom-node",

@@ -355,2 +355,7 @@ # intercom-node

```
// Find admin by ID
client.admins.find('123456789', callback);
```
## Tags

@@ -476,2 +481,26 @@

```node
// Assign a conversation to an admin
var assignment = {
id: '13879167940',
type: 'admin',
admin_id: '1309092',
assignee_id: '1723471',
message_type: 'assignment'
};
client.conversations.reply(assignment, callback);
// Assign a conversation to unassigned
var assignment = {
id: '13879167940',
type: 'admin',
admin_id: '1309092',
assignee_id: '0',
message_type: 'assignment'
}
client.conversations.reply(assignment, callback);
```
```node
// Mark a conversation as read

@@ -478,0 +507,0 @@ client.conversations.markAsRead({ id: '1039067180' }, callback);

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