# EPO_OPS_WRAPPER

> EPO OPS WRAPPER with 1) SYNC requesting, 2) token expiry handler & 3) proxy based request randomization

Latest version **1.2.0** (published 2017-10-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install EPO_OPS_WRAPPER
pnpm add EPO_OPS_WRAPPER
yarn add EPO_OPS_WRAPPER
bun add EPO_OPS_WRAPPER
```

## 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 | 1.2.0 |
| Published | 2017-10-25 |
| First published | 2016-12-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | ClayIP |
| Maintainers | aruntk, linto.cet, sujith3g |

## Links

- npm: https://www.npmjs.com/package/EPO_OPS_WRAPPER
- Repository: https://github.com/clayip/EPO_OPS_WRAPPER
- Homepage: https://github.com/clayip/EPO_OPS_WRAPPER#readme
- Issues: https://github.com/clayip/EPO_OPS_WRAPPER/issues
- npm.io page: https://npm.io/package/EPO_OPS_WRAPPER

## Dependencies (4)

- [fibers](https://npm.io/package/fibers.md) ^1.0.15
- [moment](https://npm.io/package/moment.md) ^2.19.1
- [request](https://npm.io/package/request.md) ^2.83.0
- [underscore](https://npm.io/package/underscore.md) ^1.8.3

## Recent versions

- 1.2.0 (latest) — 2017-10-25
- 1.1.15 — 2016-12-08
- 1.1.13 — 2016-12-08
- 1.1.11 — 2016-12-04
- 1.1.9 — 2016-12-04
- 1.1.7 — 2016-12-04
- 1.1.5 — 2016-12-03
- 1.1.3 — 2016-12-02
- 1.1.1 — 2016-12-02
- 1.1.0 — 2016-12-02
- 1.0.5 — 2016-12-02
- 1.0.3 — 2016-12-02
- 1.0.1 — 2016-12-02
- 1.0.0 — 2016-12-02

## README

# EPO OPS WRAPPER
wrapper for EPO [OPS version 3.2](https://developers.epo.org) request

### FEATURE
* http SYNC requesting using fibers/future
* proxy based request randomization
* automatic token expiry handler

# install
with [npm](https://www.npmjs.com/package/EPO_OPS_WRAPPER) do:

```
npm install EPO_OPS_WRAPPER
```

# usage
for checking ```IPC=A[q=IC%3DA]``` details

```js
var ops = require('EPO_OPS_WRAPPER')();
console.log(ops.request('rest-services/published-data/search?q=IC%3DA'));
```

### require('EPO_OPS_WRAPPER')(opt)
@return APP[Object]

| opt | type | description |
| --- | --- | --- |
| proxy_list | <code>Array of String</code> | [optional] format http://ip:port OR http://usename:password@ip:port |
| timeout | <code>Number</code> | [optional] timeout for http request [default => 1000 * 60] |

```js
var ops = require('EPO_OPS_WRAPPER')({
  proxy_list: ['http://ip:port', 'http://usename:password@ip:port'],
  timeout: 1000 * 30,
});
```

### .signIn(opt)
for consumer_key & consumer_secret based signIn, all ```.request()``` call after this use access_token if it success

| opt | type | description |
| --- | --- | --- |
| consumer_key | <code>String</code> | for registered user |
| consumer_secret | <code>String</code> | for registered user |

@return true if it success, otherwise null with console.log(error)

```js
{
,,,
  access_token: [String],
  application_name: [String],
  client_id: [String],
  'developer.email': 'linto.cet@gmail.com',
  expires_in: '1200',
  issued_at: moment().format('x'),
  status: 'approved',
  token_type: 'BearerToken',
,,,
}
```

this package automatically handle access_token expiry

```js
var ops = require('EPO_OPS_WRAPPER')({
  proxy_list: ['http://ip:port', 'http://usename:password@ip:port'],
});

console.log(ops.signIn({
  consumer_key: '12345',
  consumer_secret: '123',
}));
console.log(ops.request('rest-services/published-data/search?q=IC%3DA'));
```

### .request(relative_url, method, form)
EPO OPS service SYNC http request, @return [Object]

| opt | type | description |
| --- | --- | --- |
| relative_url | <code>String</code> | https://ops.epo.org/3.2/[relative_url] |
| method | <code>String</code> | default => GET |
| form | <code>Object</code> | for POST data |

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