@vtex/api
Advanced tools
Comparing version 0.32.0 to 0.32.1
"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 }); | ||
@@ -19,3 +27,3 @@ const archiver = require("archiver"); | ||
constructor(opts) { | ||
this.publishApp = (files, tag) => { | ||
this.publishApp = (files, tag) => __awaiter(this, void 0, void 0, function* () { | ||
if (!(files[0] && files[0].path && files[0].contents)) { | ||
@@ -30,3 +38,3 @@ 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 })); | ||
archive.finalize(); | ||
yield archive.finalize(); | ||
return this.http.post(routes.Publish, archive, { | ||
@@ -36,3 +44,3 @@ params: tag ? { tag } : {}, | ||
}); | ||
}; | ||
}); | ||
this.listApps = () => { | ||
@@ -39,0 +47,0 @@ return this.http.get(routes.Registry); |
{ | ||
"name": "@vtex/api", | ||
"version": "0.32.0", | ||
"version": "0.32.1", | ||
"description": "VTEX I/O API client", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
119557
45
967