Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vtex.colossus

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vtex.colossus - npm Package Compare versions

Comparing version 1.0.5 to 1.0.6

72

gallery.js

@@ -107,35 +107,51 @@ // Generated by CoffeeScript 1.7.1

Gallery.prototype.saveFile = function(appPath, appName, version, key, content, sandbox) {
return Q.Promise(function(resolve, reject, notify) {
var dir;
dir = path.dirname(appPath + key);
return mkdirp(dir, function(err) {
return fs.writeFile(appPath + key, content, function(err) {
return resolve(appPath);
});
});
});
};
Gallery.prototype.fileExists = function(path) {
return Q.Promise(function(resolve, reject, notify) {
return fs.exists(path, function(exists) {
return resolve(exists);
});
});
};
Gallery.prototype.downloadFilesFromCustomApp = function(appName, version, sandbox) {
var name, promise, saveFile, vendor;
var appPath, name, promise, sandBoxName, vendor;
vendor = appName.split('.')[0];
name = appName.split('.')[1];
saveFile = function(appName, version, key, content, sandbox) {
return Q.Promise(function(resolve, reject, notify) {
var appPath, dir, sandBoxName;
if (!sandbox) {
appPath = './apps/' + appName + '/' + version + '/';
if (!sandbox) {
appPath = './apps/' + appName + '/' + version + '/';
} else {
sandBoxName = sandbox.replace(':', '/').split('/')[1];
appPath = './apps/sandbox/' + sandBoxName + '/' + appName + '/';
}
promise = this.fileExists(appPath);
promise = promise.then((function(_this) {
return function(exists) {
if (!exists || (sandbox != null)) {
return vtexCredentials.getToken().then(function(token) {
return _this.getFiles(vendor, name, token, version, sandbox).then(function(data) {
var appContent, key, promisses, value;
appContent = JSON.parse(data);
promisses = [];
for (key in appContent) {
value = appContent[key];
promisses.push(_this.saveFile(appPath, appName, version, key, value.content, sandbox));
}
return Q.all(promisses);
});
});
} else {
sandBoxName = sandbox.replace(':', '/').split('/')[1];
appPath = './apps/sandbox/' + sandBoxName + '/' + appName + '/';
return [appPath];
}
dir = path.dirname(appPath + key);
return mkdirp(dir, function(err) {
return fs.writeFile(appPath + key, content, function(err) {
return resolve(appPath);
});
});
});
};
promise = vtexCredentials.getToken().then((function(_this) {
return function(token) {
return _this.getFiles(vendor, name, token, version, sandbox).then(function(data) {
var appContent, key, promisses, value;
appContent = JSON.parse(data);
promisses = [];
for (key in appContent) {
value = appContent[key];
promisses.push(saveFile(appName, version, key, value.content, sandbox));
}
return Q.all(promisses);
});
};

@@ -142,0 +158,0 @@ })(this));

{
"name": "vtex.colossus",
"version": "1.0.5",
"version": "1.0.6",
"main": "index.js",

@@ -5,0 +5,0 @@ "scripts": {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc