forked from vladimir2492/react-cloud-vision-api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
31 lines (24 loc) · 712 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
'use strict'
const __ = require('underscore');
const Endpoint = require('./lib/clients/v1')
module.exports = {
Request: require('./lib/models/Request'),
Feature: require('./lib/models/Feature'),
Image: require('./lib/models/Image'),
init(options) {
if(options){
options = Object.assign({version: 'v1'}, options)
}else
options = options ? options : {};
var ep = new Endpoint(options)
ep.google = this
this._client = ep
},
annotate(requests) {
return new Promise((resolve, reject) => {
if (!requests) { return reject() }
if (!__.isArray(requests)) { requests = [requests] }
this._client.annotate(requests).then(resolve, reject)
})
}
}