# ebay-promised

> promise wrapped Ebay requests with sensible response parsers

Latest version **2.3.0** (published 2017-05-27) · ISC license · 0 weekly downloads

## Install

```sh
npm install ebay-promised
pnpm add ebay-promised
yarn add ebay-promised
bun add ebay-promised
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.3.0 |
| Published | 2017-05-27 |
| First published | 2015-02-27 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 8 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 8 |
| Author | Benjamin Clos |
| Maintainers | ondreian |
| Keywords | ebay, api |

## Links

- npm: https://www.npmjs.com/package/ebay-promised
- Repository: https://github.com/ondreian/ebay-promised
- Homepage: https://github.com/ondreian/ebay-promised#readme
- Issues: https://github.com/ondreian/ebay-promised/issues
- npm.io page: https://npm.io/package/ebay-promised

## Dependencies (8)

- [debug](https://npm.io/package/debug.md) ^2.1.1
- [ecjson](https://npm.io/package/ecjson.md) ^0.1.2
- [request](https://npm.io/package/request.md) ^2.74.0
- [bluebird](https://npm.io/package/bluebird.md) ^3.4.0
- [es6-error](https://npm.io/package/es6-error.md) ^3.0.1
- [object-to-xml](https://npm.io/package/object-to-xml.md) 1.0.0
- [request-promise](https://npm.io/package/request-promise.md) ^4.1.0
- [simple-rate-limiter](https://npm.io/package/simple-rate-limiter.md) ^0.2.3

## Recent versions

- 2.3.0 (latest) — 2017-05-27
- 2.2.0 — 2016-08-01
- 2.1.0 — 2016-06-15
- 2.0.0 — 2016-06-09
- 1.5.0 — 2015-04-06
- 1.4.7 — 2015-04-06
- 1.4.6 — 2015-03-31
- 1.4.5 — 2015-03-31
- 1.4.4 — 2015-03-31
- 1.4.3 — 2015-03-30
- 1.4.2 — 2015-03-09
- 1.4.1 — 2015-03-09
- 1.4.0 — 2015-03-08
- 1.3.0 — 2015-03-08
- 1.2.4 — 2015-03-06
- … 6 more at https://npm.io/package/ebay-promised/versions

## README

# A Promise-based module for working with the eBay API

[![Build Status](https://travis-ci.org/ondreian/ebay-promised.svg?branch=master)](https://travis-ci.org/ondreian/ebay-promised)
[![Documentation](https://doc.esdoc.org/github.com/ondreian/ebay-promised/badge.svg)](https://doc.esdoc.org/github.com/ondreian/ebay-promised/)

`npm install ebay-promised --save`

This module provides a succint, verbose way to build requests with the eBay API.

Currently it works in production applications with the eBay XML POST Trading API, and I have not properly fleshed out the other eBay services.

Most of the other services are GET based and query string driven.

## Features

- [X] Bluebird Promises
- [X] Transparent pagination
- [X] Transparent eBay compliant rate-limiting
- [X] Reasonable response parsers
- [X] Functionally tested vs the Sandbox API
- [X] ergonomic chaining API with immutability
- [X] transparently can load instance from ENV vars
- [X] proper Error subclassing to enable verbose use of `Promise.catch`

## How to use this module

Readinging through the [Functional Tests](/test/Ebay.Functional.spec.js) is a great way to familiarize yourself with some common API calls.

```javascript
# Basic Setup

import Ebay   from 'ebay-promised'
import config from './config'

const ebay  = Ebay.create(config)
const {err} = Ebay.errors

ebay
  .GetMyeBaySelling()            // Transforms it to a sealed Request, global config can no longer change
  .ActiveList({ Include: true }) // Pass in a field,value 
  .DetailLevel("ReturnAll")      // Pass in another field, value
  .run()                         // Run the request against the eBay API
  .then(handleSuccess)
  .catch(err.Ebay_Api_Error, err => {
    // this error is a special case 
    // it means your HTTP request was successful but eBay did not like it
  })
  .catch( err = {
    // catch all other errors ala:
    // Network Errors
  })

// Ebay can also load your credentials from `process.env`

const envEbay = Ebay.fromEnv()

```

### Supported Calls

All calls, fields, and globals that are currently defined live in `./es6/definitions`

If you find a call that is missing, feel free to open an issue so it can be addressed, or make a pull request.

### Pagination

Internally ebay-promised will attempt to detect when a request is paginated and go ahead and grab the subsequent pages for you and concatenate the results.

### Utility methods

Pull requests are welcome.

---
_Source: https://npm.io/package/ebay-promised · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
