Socket
Socket
Sign inDemoInstall

dispatch-node-sdk

Package Overview
Dependencies
Maintainers
1
Versions
148
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dispatch-node-sdk - npm Package Compare versions

Comparing version 0.0.8 to 0.0.9

10

dist/lib/entities/job.js

@@ -47,2 +47,12 @@ 'use strict';

});
},
addNote: function addNote(text) {
return client.getAuthClient().post(endpoints.ATTACHMENTS, {
entity_type: 'Job',
entity_id: id,
description: text
}).then(function (response) {
return response.attachment;
});
}

@@ -49,0 +59,0 @@ };

2

lib/dispatch.tests.js

@@ -110,3 +110,3 @@ import nock from 'nock';

client.getCollection('/v1/jobs', null, {raw: true}).then(response => {
client.getCollection('/v1/jobs', null, { raw: true }).then(response => {
expect(response.jobs.length).toEqual(2);

@@ -113,0 +113,0 @@ done();

@@ -44,2 +44,12 @@ import * as endpoints from '../endpoints';

},
addNote: (text) => {
return client.getAuthClient().post(endpoints.ATTACHMENTS, {
entity_type: 'Job',
entity_id: id,
description: text,
}).then(response => {
return response.attachment;
});
},
};

@@ -46,0 +56,0 @@ };

@@ -98,2 +98,18 @@ import expect from 'expect';

});
describe('addNote', () => {
it('should call endpoint with correct body', () => {
const client = new Dispatch(testClientID, testClientSecret);
client.setBearerToken(testBearerToken, testRefreshToken);
const scope = nock('https://api.dispatch.me')
.post(`${endpoints.ATTACHMENTS}`, {
entity_type: 'Job',
entity_id: 123,
description: 'Test note',
})
.reply(201);
client.entities.job(123).addNote('Test note');
expect(scope.isDone()).toEqual(true);
});
});
});

@@ -17,3 +17,2 @@ function getNodesList(obj) {

}
} else {

@@ -20,0 +19,0 @@ nodes.push([prop, val]);

@@ -17,3 +17,3 @@ import expect from 'expect';

it.only('should work with a nested object with arrays', () => {
it('should work with a nested object with arrays', () => {
expect(stringify({

@@ -24,3 +24,3 @@ foo: 'bar',

boop: {
foop: ['1', '2','3','4'],
foop: ['1', '2', '3', '4'],
},

@@ -27,0 +27,0 @@ })).toEqual('foo=bar&baz=true&bing=10&boop[foop][]=1&boop[foop][]=2&boop[foop][]=3&boop[foop][]=4');

{
"name": "dispatch-node-sdk",
"version": "0.0.8",
"version": "0.0.9",
"description": "High- and low-level libraries for interacting with the Dispatch API",

@@ -5,0 +5,0 @@ "main": "dist/lib/index.js",

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