@vtex/api
Advanced tools
Comparing version 0.32.1 to 0.32.2
"use strict"; | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } | ||
step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
}); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -27,3 +19,3 @@ const archiver = require("archiver"); | ||
constructor(opts) { | ||
this.publishApp = (files, tag) => __awaiter(this, void 0, void 0, function* () { | ||
this.publishApp = (files, tag) => { | ||
if (!(files[0] && files[0].path && files[0].contents)) { | ||
@@ -38,8 +30,9 @@ throw new Error('Argument files must be an array of {path, contents}, where contents can be a String, a Buffer or a ReadableStream.'); | ||
files.forEach(({ contents, path }) => archive.append(contents, { name: path })); | ||
yield archive.finalize(); | ||
return this.http.post(routes.Publish, archive, { | ||
params: tag ? { tag } : {}, | ||
headers: { 'Content-Type': 'application/octet-stream' }, | ||
return archive.finalize().then(() => { | ||
return this.http.post(routes.Publish, archive, { | ||
params: tag ? { tag } : {}, | ||
headers: { 'Content-Type': 'application/octet-stream' }, | ||
}); | ||
}); | ||
}); | ||
}; | ||
this.listApps = () => { | ||
@@ -46,0 +39,0 @@ return this.http.get(routes.Registry); |
{ | ||
"name": "@vtex/api", | ||
"version": "0.32.1", | ||
"version": "0.32.2", | ||
"description": "VTEX I/O API client", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
118955
960