@vtex/api
Advanced tools
Comparing version 0.13.1 to 0.13.2
@@ -11,6 +11,2 @@ 'use strict'; | ||
var _stream = require('stream'); | ||
var _stream2 = _interopRequireDefault(_stream); | ||
var _archiver = require('archiver'); | ||
@@ -20,4 +16,2 @@ | ||
var _zlib = require('zlib'); | ||
var _baseClient = require('./baseClient'); | ||
@@ -32,7 +26,5 @@ | ||
Vendor: vendor => `${ routes.Registry }/${ vendor }/apps`, | ||
App: app => `${ routes.Registry }/${ app }`, | ||
App: (vendor, name) => `${ routes.Vendor(vendor) }/${ name }`, | ||
AppVersion: (vendor, name, version) => `${ routes.App(vendor, name) }/${ version }` | ||
AppVersion: (app, version) => `${ routes.App(app) }/${ version }` | ||
}; | ||
@@ -80,38 +72,14 @@ | ||
publishAppPatch: (vendor, name, version, changes) => { | ||
const gz = (0, _zlib.createGzip)(); | ||
const stream = new _stream2.default.Readable(); | ||
stream.push(JSON.stringify(changes)); | ||
stream.push(null); | ||
return client({ | ||
method: 'PATCH', | ||
data: stream.pipe(gz), | ||
url: routes.AppVersion(vendor, name, version), | ||
headers: { | ||
'Content-Encoding': 'gzip', | ||
'Content-Type': 'application/json' | ||
} | ||
}); | ||
}, | ||
listVendors: () => { | ||
listApps: () => { | ||
return client(routes.Registry); | ||
}, | ||
listAppsByVendor: vendor => { | ||
return client(routes.Vendor(vendor)); | ||
listVersionsByApp: app => { | ||
return client(routes.App(app)); | ||
}, | ||
listVersionsByApp: (vendor, name) => { | ||
return client(routes.App(vendor, name)); | ||
}, | ||
getAppManifest: (vendor, name, version) => { | ||
return client(routes.AppVersion(vendor, name, version)); | ||
}, | ||
unpublishApp: (vendor, name, version) => { | ||
return client.delete(routes.AppVersion(vendor, name, version)); | ||
getAppManifest: (app, version) => { | ||
return client(routes.AppVersion(app, version)); | ||
} | ||
}; | ||
} |
{ | ||
"name": "@vtex/api", | ||
"version": "0.13.1", | ||
"version": "0.13.2", | ||
"description": "VTEX I/O API client", | ||
@@ -5,0 +5,0 @@ "main": "./lib/index.js", |
Sorry, the diff of this file is not supported yet
171288
30
459