We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see ourdocumentation.
There was an error while loading.Please reload this page.
1 parent53e55b1 commit41ade19Copy full SHA for 41ade19
README.md
@@ -19,9 +19,8 @@ const {Client, APIError} = require('labstack')
19
constclient=newClient('<API_KEY>')
20
constgeocode=client.geocode()
21
22
-geocode.address({
23
- location:'eiffel tower'
24
-}).then(response=> {
+geocode.address('eiffel tower')
+.then(response=> {
25
console.info(response)
26
})
27
.catch(error=> {
lib/client.js
@@ -56,7 +56,7 @@ class Client {
56
returnnewWatermark(this)
57
}
58
59
-Webpage(){
+webpage(){
60
returnnewWebpage(this)
61
62
lib/currency.js
@@ -3,12 +3,16 @@ class Currency {
3
this.client=client
4
5
6
-convert(request){
7
-returnthis.client._request('GET','/currency/convert',request,null,true)
+convert(from,to,value){
+returnthis.client._request('GET','/currency/convert',{
8
+ from,
9
+ to,
10
+ value
11
+},null,true)
12
13
-rates(request){
-returnthis.client._request('GET','/currency/rates',request,null,true)
14
+rates(base){
15
+returnthis.client._request('GET','/currency/rates',{base},null,true)
16
17
18
lib/geocode.js
@@ -3,16 +3,21 @@ class Geocode {
-address(request){
-returnthis.client._request('GET','/geocode/address',request,null,true)
+address(location,options){
+returnthis.client._request('GET','/geocode/address',Object.assign({
+ location
+},options),null,true)
-ip(request){
-returnthis.client._request('GET','/geocode/ip',request,null,true)
+ip(ip){
+returnthis.client._request('GET','/geocode/ip',{ip},null,true)
-reverse(request){
-returnthis.client._request('GET','/geocode/reverse',request,null,true)
+reverse(longitude,latitude,options){
+returnthis.client._request('GET','/geocode/reverse',Object.assign({
+ longitude,
+ latitude
lib/post.js
@@ -3,8 +3,8 @@ class Post {
-verify(request){
-returnthis.client._request('GET','/post/verify',request,null,true)
+verify(email){
+returnthis.client._request('GET','/post/verify',{email},null,true)
lib/watermark.js
@@ -3,16 +3,16 @@ class Watermark {
-image(request){
+image(file,text,options){
constbody=newFormData()
-body.append('file',fs.createReadStream(request.file))
-body.append('text',request.text)
-body.append('font',request.font)
-body.append('size',request.size)
-body.append('color',request.color)
-body.append('opacity',request.opacity)
-body.append('position',request.position)
-body.append('margin',request.margin)
+body.append('file',fs.createReadStream(file))
+body.append('text',text)
+body.append('font',options.font)
+body.append('size',options.size)
+body.append('color',options.color)
+body.append('opacity',options.opacity)
+body.append('position',options.position)
+body.append('margin',options.margin)
returnthis.client._request('POST','/watermark/image',null,body,false)
lib/webpage.js
@@ -3,8 +3,10 @@ class Webpage {
-pdf(request){
-returnthis.client._request('GET','/webpage/pdf',request,null,true)
+pdf(url,options){
+returnthis.client._request('GET','/webpage/pdf',Object.assign({
+ url
package.json
@@ -1,6 +1,6 @@
1
{
2
"name":"labstack",
-"version":"0.31.0",
+"version":"0.31.1",
"description":"Official Node.js client library for the LabStack platform",
"main":"index.js",
"scripts": {