0.4.2 • Published 9 years ago

sauto-api v0.4.2

Weekly downloads
18
License
-
Repository
github
Last release
9 years ago

node Sauto API Build Status

Node.js promise based wrapper over Sauto XML-RPC API. All methods are implemented with the same name as the original XML-RPC API provides

How to install

npm install sauto-api

Setup

var SautoApi = require('sauto-api')

var login = 'import',
  password = 'test',
  config = {
    "connection" : {
      "host": "import.sauto.cz",
        "port": 80,
        "path": "/RPC2"
    },
    "swKey": "testkey-571769"
  };

var api = new SautoApi(config, login, password);

Example usage

return api
  .login()
  .then(function() {
    return api.listOfCars()
  })
  .then(function(vehicles) {

    var exportedIds = [];

    vehicles.forEach(function(v) {
      exportedIds.push( parseInt(v.car_id) );
    });

    return selectVehiclesForDelete(exportedIds);
  })
  .then(function(ids) {
    return deleteVehicles(api, ids);
  })
  .then(function() {
    return selectVehiclesForExport();
  })
  .then(function(vehicles) {
    return exportVehicles(api, outputFormatter, vehicles);
  })
  .then(function() {
    return api.logout();
  });
0.4.2

9 years ago

0.4.1

9 years ago

0.4.0

9 years ago

0.3.3

10 years ago

0.3.2

10 years ago

0.3.1

10 years ago

0.3.0

10 years ago

0.2.4

10 years ago

0.2.3

10 years ago

0.2.1

10 years ago

0.2.0

10 years ago

0.1.0

10 years ago