novaposhta_3
v0.3.2
Published
JavaScript module to interact with NovaPoshta API
Downloads
5
Readme
novaposhta 0.3.0
Instalation
You can add this package using following commands:
npm i novaposhta
yarn add novaposhta
Usage
Basic example:
import NovaPoshta from 'novaposhta';
const api = new NovaPoshta({ apiKey: '...' });
api.address.getCities({ Ref: "ebc0eda9-93ec-11e3-b441-0050568002cf" }).then((json) => {
// do something
});
Winston Logger:
import NovaPoshta from 'novaposhta';
import Winston from 'winston';
import WinstonFormatter from 'winston-console-formatter';
const winstonLogger = new Winston.Logger({ level: "debug" });
winstonLogger.add(Winston.transports.Console, WinstonFormatter.config());
const api = new NovaPoshta({
apiKey: '...',
logger: winstonLogger,
});
api.address.getCities({ Ref: "ebc0eda9-93ec-11e3-b441-0050568002cf" }).then((json) => {
// do something
});
Supported Methods
Address
const api = new NovaPoshta({ apiKey: '...' });
api.address.getCities({ Ref: "ebc0eda9-93ec-11e3-b441-0050568002cf" }).then((json) => {
// do something
});
- searchSettlements
- searchSettlementStreets
- update
- save
- getAreas
- getCities
- getSettlements
- getWarehouses
- getWarehouseTypes
- getStreet
- delete
Common
const api = new NovaPoshta({ apiKey: '...' });
api.common.getTimeIntervals({ "RecipientCityRef": "8d5a980d-391c-11dd-90d9-001a92567626" }).then((json) => {
// do something
});
- getTimeIntervals
- getCargoTypes
- getBackwardDeliveryCargoTypes
- getPalletsList
- getTypesOfPayers
- getTypesOfPayersForRedelivery
- getPackList
- getTiresWheelsList
- getCargoDescriptionList
- getMessageCodeText
- getServiceTypes
- getTypesOfCounterparties
- getPaymentForms
- getOwnershipFormsList
Counterparty
const api = new NovaPoshta({ apiKey: '...' });
api.counterparty.getCounterpartyContactPerson({ ... }).then((json) => {
// do something
});
- getCounterpartyAddresses
- getCounterpartyOptions
- getCounterpartyContactPerson
- getCounterparties
- saveCounterparty
- updateCounterparty
- deleteCounterparty
- saveContactPerson
- updateContactPerson
- deleteContactPerson
Internet Document
const api = new NovaPoshta({ apiKey: '...' });
api.document.getDocumentList({ ... }).then((json) => {
// do something
});
- getDocumentList
- getDocumentDeliveryDate
- getDocumentPrice
- getStatusDocuments
- saveInternetDocument
- updateInternetDocument
- deleteInternetDocument
- generateReport
Contribute
What to help or have a suggestion? Open a new ticket and we can discuss it or submit pull request. Please, make sure you run npm test
before submitting a pull request.
License
MIT