clearspending
v0.0.3
Published
Client for ClearSpending using their API
Downloads
3
Maintainers
Readme
clearspending
Easily get, search and select for contracts, customers and suppliers on ClearSpending using their API.
Installing
Using npm:
$ npm install --save clearspending
Examples
Import module
const clearspending = require('clearspending')
const Clearspending = new clearspending()
Grants
Receive full information about the grant by the ID (get)
Clearspending
.getGrants({
id: '42'
})
.then((result) => {console.log(result)}).catch((err) => {console.log(err)})
Full-text search for grants
Clearspending
.searchGrants({productsearch: 'бетон'})
.then((result) => {console.log(result)}).catch((err) => {console.log(err)})
Clearspending
.searchGrants({ogrn:'1036167000066'})
.then((result) => {console.log(result)}).catch((err) => {console.log(err)})
Grants selection
Clearspending
.selectGrants({daterange:'01.01.2014-31.12.2014'})
.then((result) => {console.log(result)}).catch((err) => {console.log(err)})
Customers
Getting customer information by identifier
Clearspending
.getCustomer({spzregnum: '01731000070'})
.then((result) => {console.log(result)}).catch((err) => {console.log(err)})
Full-text search by customer's contracts
Clearspending
.searchCustomers({orgtype:'3', sort:'-contractsSum'})
.then((result) => {console.log(result)}).catch((err) => {console.log(err)})
Full-text search by customers (select)
Clearspending
.selectCustomers({orgtype:'3', sort:'-contractsSum'})
.then((result) => {console.log(result)}).catch((err) => {console.log(err)})
Contracts
Getting contract's information by identifier
Clearspending
.getContracts({regnum:'0173100000414000011'})
.then((result) => {console.log(result)}).catch((err) => {console.log(err)})
Full-text search by contracts
Clearspending
.searchContracts({
pricerange: '10000-50000',
customerregion: '05',
sort:'-price'
})
.then((result) => {console.log(result)}).catch((err) => {console.log(err)})
Select by contracts
Clearspending
.selectContracts({
industrial: 'A',
fz: '94'
})
.then((result) => {console.log(result)}).catch((err) => {console.log(err)})
Suppliers
Getting supplier information by identifier
Clearspending
.getSuppliers({
inn: '6450614330',
kpp: '645001001'
})
.then((result) => {console.log(result)}).catch((err) => {console.log(err)})
Full-text search by suppliers
Clearspending
.then((result) => {console.log(result)}).catch((err) => {console.log(err)})
Select by suppliers
Clearspending
Clearspending
.searchSuppliers({
regioncode: '35',
orgform: 'i94',
sort: '-contractsSum'
})
.then((result) => {console.log(result)}).catch((err) => {console.log(err)})
Recive information (statistics) about the database (number of records, update date, etc.).
Clearspending
.dbInfo({
info: 'all'
})
.then((result) => {console.log(result)}).catch((err) => {console.log(err)})