@vtex/api
Advanced tools
Comparing version 0.18.0 to 0.19.0
@@ -35,3 +35,3 @@ 'use strict'; | ||
const headers = { | ||
'Authorization': `token ${ authToken }`, | ||
'Authorization': `bearer ${ authToken }`, | ||
'User-Agent': userAgent | ||
@@ -38,0 +38,0 @@ }; |
@@ -17,2 +17,4 @@ 'use strict'; | ||
AvailableServices: '/_services', | ||
AvailableIoVersions: '/_io', | ||
InstalledIoVersion: (account, workspace) => `/${ account }/${ workspace }/io`, | ||
@@ -35,2 +37,21 @@ AvailableVersions: name => `${ routes.AvailableServices }/${ name }`, | ||
return { | ||
listAvailableIoVersions: () => { | ||
return client.get(routes.AvailableIoVersions); | ||
}, | ||
getInstalledIoVersion: () => { | ||
if (!account || !workspace) { | ||
throw new Error('Missing client parameters: {account, workspace}'); | ||
} | ||
return client.get(routes.InstalledIoVersion(account, workspace)); | ||
}, | ||
installIo: version => { | ||
if (!account || !workspace) { | ||
throw new Error('Missing client parameters: {account, workspace}'); | ||
} | ||
return client.put(routes.InstalledIoVersion(account, workspace), { version: version }); | ||
}, | ||
listAvailableServices: () => { | ||
@@ -37,0 +58,0 @@ return client.get(routes.AvailableServices); |
{ | ||
"name": "@vtex/api", | ||
"version": "0.18.0", | ||
"version": "0.19.0", | ||
"description": "VTEX I/O API client", | ||
@@ -5,0 +5,0 @@ "main": "./lib/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
177289
519
32