Socket
Socket
Sign inDemoInstall

crex

Package Overview
Dependencies
Maintainers
1
Versions
60
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

crex - npm Package Compare versions

Comparing version 0.1.0 to 0.2.0

lib/request.js

53

lib/api.js

@@ -0,55 +1,56 @@

var request = require('./request');
var api = {};
var request = function (arg) {};
api.exportGetAllPackages = function (arg) {
request('/etc/creativeExchange/export/api.packages.json');
api.exportGetAllPackages = function () {
return this.request('GET', '/etc/creativeExchange/export/api.packages.json');
};
api.exportGetPackageStatus = function (arg) {
request('/etc/creativeExchange/export/api.status.json');
api.exportGetPackageStatus = function (args) {
return this.request('GET', '/etc/creativeExchange/export/api.status.json', args);
};
api.exportDownloadPackage = function (arg) {
request('/etc/creativeExchange/export/api.package.zip');
api.exportDownloadPackage = function (args) {
return this.request('GET', '/etc/creativeExchange/export/api.package.zip', args);
};
api.exportCreatePackage = function (arg) {
request('/etc/creativeExchange/export/api.create.json');
api.exportCreatePackage = function (args) {
return this.request('POST', '/etc/creativeExchange/export/api.create.json', args);
};
api.exportRemovePackage = function (arg) {
request('/etc/creativeExchange/export/api.packages.json');
api.exportRemovePackage = function (args) {
return this.request('DELETE', '/etc/creativeExchange/export/api.packages.json', args);
};
api.importGetAllPackages = function (arg) {
request('/etc/creativeExchange/import/api.packages.json');
api.importGetAllPackages = function () {
return this.request('GET', '/etc/creativeExchange/import/api.packages.json');
};
api.importGetPackageStatus = function (arg) {
request('/etc/creativeExchange/import/api.status.json');
api.importGetPackageStatus = function (args) {
return this.request('GET', '/etc/creativeExchange/import/api.status.json', args);
};
api.importUploadPackage = function (arg) {
request('/etc/creativeExchange/import/api.upload.json');
api.importUploadPackage = function (args) {
return this.request('UPLOAD', '/etc/creativeExchange/import/api.upload.json', args);
};
api.importInspectPackage = function (arg) {
request('/etc/creativeExchange/import/api.inspect.json');
api.importInspectPackage = function (args) {
return this.request('POST', '/etc/creativeExchange/import/api.inspect.json', args);
};
api.importDryRunPackage = function (arg) {
request('/etc/creativeExchange/import/api.dry_run.json');
api.importDryRunPackage = function (args) {
return this.request('POST', '/etc/creativeExchange/import/api.dry_run.json', args);
};
api.importInstallPackage = function (arg) {
request('/etc/creativeExchange/import/api.install.json');
api.importInstallPackage = function (args) {
return this.request('POST', '/etc/creativeExchange/import/api.install.json', args);
};
api.importRemovePackage = function (arg) {
request('/etc/creativeExchange/import/api.packages.json');
api.importRemovePackage = function (args) {
return this.request('DELETE', '/etc/creativeExchange/import/api.packages.json', args);
};
api.themeGetAllThemes = function (arg) {
api.themeGetAllThemes = function (args) {
return this.request('GET', '/etc/creativeExchange/themes/api.json', args);
};
module.exports = api;
var api = require('./api');
var DEFAULTS = {
var request = require('./request');
}
var CrEx = function (options) {
options = options || {};
this.admin = options.admin;
this.user = options.user;
this.password = options.password;
this.server = options.server;
this.url = options.url;
this.port = options.port;
};
CrEx.prototype.getUrl = function () {
return this.user + ':' + this.password + '@' + this.url + ':' + this.port;
}
CrEx.prototype.request = function(method, url, args) {
var req = null;
url = this.getUrl() + url;
switch (method) {
case 'GET':
req = request.doGet;
break;
}
return req(url, args);
};
CrEx.prototype = Object.assign(CrEx.prototype, api);
module.exports = CrEx;
{
"name": "crex",
"version": "0.1.0",
"version": "0.2.0",
"description": "Creative Exchange SDK for Javascript",

@@ -8,9 +8,16 @@ "author": "Mateusz Luczak <mateusz.luczak@outlook.com>",

"scripts": {
"build": "rollup -c"
"build": "rollup -c",
"test": "mocha test/**"
},
"devDependencies": {
"chai": "^3.5.0",
"chai-as-promised": "^6.0.0",
"mocha": "^3.3.0",
"rollup": "^0.41.6",
"rollup-plugin-commonjs": "^8.0.2",
"rollup-plugin-node-resolve": "^3.0.0"
},
"dependencies": {
"superagent": "^3.5.2"
}
}

@@ -17,6 +17,6 @@ <img width="200px" src="http://zg.cognifide.com/galaxite/img/zg_logo.svg">

var crex = new CrEx({
user: 'admin',
password: 'admin',
address: 'localhost',
port: 4502
user: 'admin',
password: 'admin',
address: 'localhost',
port: 4502
});

@@ -23,0 +23,0 @@

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