Skip to content

Latest commit

 

History

History
90 lines (58 loc) · 1.74 KB

README.md

File metadata and controls

90 lines (58 loc) · 1.74 KB

Deal Sources

Any methods return promise object.

Static methods

Retrieve all sources

client.dealSources.find([params][, callback(err, sources)]);
  • params is object with a list of filters, not required
  • callback is a function, not required

Create a source

client.dealSources.create(data[, callback(err, source)]);
  • data is a source object or source name (string)
  • callback is a function, not required

Retrieve a single source

client.dealSources.find(id[, callback(err, source)]);
  • id is unique identifier (number) of the source
  • callback is a function, not required

Update a source

client.dealSources.update(id, data[, callback(err, source)]);
  • id is a source ID (number)
  • data is a updated params of the source (object)
  • callback is a function, not required

Delete a source

client.dealSources.delete(id[, callback(err, state)]);
  • id is unique identifier (number) of the source
  • callback is a function, not required

Model methods

Create a source

var Source = client.dealSources;

new Source(data).save([callback(err, source)]);
  • data is a source object
  • callback is a function, not required

Update a source

source.save([callback(err, source)]);
  • callback is a function, not required

Delete a source

source.delete([callback(err, state)]);
  • callback is a function, not required

Detailed documentation in the official API

License

MIT

Bug Reports

Report here.