-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathindex.js
More file actions
29 lines (22 loc) · 689 Bytes
/
index.js
File metadata and controls
29 lines (22 loc) · 689 Bytes
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
'use strict'
const __ = require('underscore')
module.exports = {
Request: require('./lib/models/Request'),
Feature: require('./lib/models/Feature'),
Image: require('./lib/models/Image'),
_client: null,
init(options) {
this._options = __.defaults(options, {version: 'v1'})
const Endpoint = require('./lib/clients/' + options.version)
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)
})
}
}