Comparing version 0.4.0 to 0.4.1
257
dist/crex.js
@@ -1,10 +0,253 @@ | ||
/* | ||
CrEx.js v0.3.0 | ||
https://github.com/mateuszluczak/crex | ||
Released under the MIT License. | ||
*/ | ||
'use strict'; | ||
/******/ (function(modules) { // webpackBootstrap | ||
/******/ // The module cache | ||
/******/ var installedModules = {}; | ||
/******/ | ||
/******/ // The require function | ||
/******/ function __webpack_require__(moduleId) { | ||
/******/ | ||
/******/ // Check if module is in cache | ||
/******/ if(installedModules[moduleId]) { | ||
/******/ return installedModules[moduleId].exports; | ||
/******/ } | ||
/******/ // Create a new module (and put it into the cache) | ||
/******/ var module = installedModules[moduleId] = { | ||
/******/ i: moduleId, | ||
/******/ l: false, | ||
/******/ exports: {} | ||
/******/ }; | ||
/******/ | ||
/******/ // Execute the module function | ||
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); | ||
/******/ | ||
/******/ // Flag the module as loaded | ||
/******/ module.l = true; | ||
/******/ | ||
/******/ // Return the exports of the module | ||
/******/ return module.exports; | ||
/******/ } | ||
/******/ | ||
/******/ | ||
/******/ // expose the modules object (__webpack_modules__) | ||
/******/ __webpack_require__.m = modules; | ||
/******/ | ||
/******/ // expose the module cache | ||
/******/ __webpack_require__.c = installedModules; | ||
/******/ | ||
/******/ // identity function for calling harmony imports with the correct context | ||
/******/ __webpack_require__.i = function(value) { return value; }; | ||
/******/ | ||
/******/ // define getter function for harmony exports | ||
/******/ __webpack_require__.d = function(exports, name, getter) { | ||
/******/ if(!__webpack_require__.o(exports, name)) { | ||
/******/ Object.defineProperty(exports, name, { | ||
/******/ configurable: false, | ||
/******/ enumerable: true, | ||
/******/ get: getter | ||
/******/ }); | ||
/******/ } | ||
/******/ }; | ||
/******/ | ||
/******/ // getDefaultExport function for compatibility with non-harmony modules | ||
/******/ __webpack_require__.n = function(module) { | ||
/******/ var getter = module && module.__esModule ? | ||
/******/ function getDefault() { return module['default']; } : | ||
/******/ function getModuleExports() { return module; }; | ||
/******/ __webpack_require__.d(getter, 'a', getter); | ||
/******/ return getter; | ||
/******/ }; | ||
/******/ | ||
/******/ // Object.prototype.hasOwnProperty.call | ||
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; | ||
/******/ | ||
/******/ // __webpack_public_path__ | ||
/******/ __webpack_require__.p = ""; | ||
/******/ | ||
/******/ // Load entry module and return exports | ||
/******/ return __webpack_require__(__webpack_require__.s = 3); | ||
/******/ }) | ||
/************************************************************************/ | ||
/******/ ([ | ||
/* 0 */ | ||
/***/ (function(module, exports) { | ||
var CrEx = require('./crex'); | ||
var doGet = function (url, args) { | ||
return new Promise(function (resolve, reject) { | ||
request | ||
.get(url) | ||
.query(args) | ||
.buffer(true) | ||
.end(function (err, res) { | ||
if (err) reject(err); | ||
resolve(res.body); | ||
}); | ||
}); | ||
}; | ||
var doPost = function(url, args) { | ||
return new Promise(function (resolve, reject) { | ||
request | ||
.post(url) | ||
.type('form') | ||
.send(args) | ||
.end(function (err, res) { | ||
if (err) reject(err); | ||
resolve(res.body); | ||
}); | ||
}); | ||
}; | ||
var doDelete = function(url, args) { | ||
return new Promise(function (resolve, reject) { | ||
request | ||
.delete(url) | ||
.query(args) | ||
.end(function (err, res) { | ||
if (err) reject(err); | ||
resolve(res.body); | ||
}); | ||
}); | ||
}; | ||
var doUpload = function(url, args) { | ||
return new Promise(function (resolve, reject) { | ||
request | ||
.post(url) | ||
.attach('file', args['file']) | ||
.end(function (err, res) { | ||
if (err) reject(err); | ||
resolve(res.body); | ||
}); | ||
}); | ||
} | ||
module.exports = { | ||
doGet: doGet, | ||
doPost: doPost, | ||
doDelete: doDelete, | ||
doUpload: doUpload | ||
}; | ||
/***/ }), | ||
/* 1 */ | ||
/***/ (function(module, exports, __webpack_require__) { | ||
var api = __webpack_require__(2); | ||
var request = __webpack_require__(0); | ||
var CrEx = function (options) { | ||
options = options || {}; | ||
this.user = options.user; | ||
this.password = options.password; | ||
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; | ||
case 'POST': | ||
req = request.doPost; | ||
break; | ||
case 'DELETE': | ||
req = request.doDelete; | ||
break; | ||
case 'UPLOAD': | ||
req = request.doUpload; | ||
break; | ||
} | ||
return req(url, args); | ||
}; | ||
CrEx.prototype = Object.assign(CrEx.prototype, api); | ||
module.exports = CrEx; | ||
/***/ }), | ||
/* 2 */ | ||
/***/ (function(module, exports, __webpack_require__) { | ||
var request = __webpack_require__(0); | ||
var api = {}; | ||
api.exportGetAllPackages = function () { | ||
return this.request('GET', '/etc/creativeExchange/export/api.packages.json'); | ||
}; | ||
api.exportGetPackageStatus = function (args) { | ||
return this.request('GET', '/etc/creativeExchange/export/api.status.json', args); | ||
}; | ||
api.exportDownloadPackage = function (args) { | ||
return this.request('GET', '/etc/creativeExchange/export/api.package.zip', args); | ||
}; | ||
api.exportCreatePackage = function (args) { | ||
return this.request('POST', '/etc/creativeExchange/export/api.create.json', args); | ||
}; | ||
api.exportRemovePackage = function (args) { | ||
return this.request('DELETE', '/etc/creativeExchange/export/api.packages.json', args); | ||
}; | ||
api.importGetAllPackages = function () { | ||
return this.request('GET', '/etc/creativeExchange/import/api.packages.json'); | ||
}; | ||
api.importGetPackageStatus = function (args) { | ||
return this.request('GET', '/etc/creativeExchange/import/api.status.json', args); | ||
}; | ||
api.importUploadPackage = function (args) { | ||
return this.request('UPLOAD', '/etc/creativeExchange/import/api.upload.json', args); | ||
}; | ||
api.importDownloadPackage = function (args) { | ||
return this.request('GET', '/etc/creativeExchange/import/api.package.zip', args); | ||
}; | ||
api.importInspectPackage = function (args) { | ||
return this.request('POST', '/etc/creativeExchange/import/api.inspect.json', args); | ||
}; | ||
api.importDryRunPackage = function (args) { | ||
return this.request('POST', '/etc/creativeExchange/import/api.dry_run.json', args); | ||
}; | ||
api.importInstallPackage = function (args) { | ||
return this.request('POST', '/etc/creativeExchange/import/api.install.json', args); | ||
}; | ||
api.importRemovePackage = function (args) { | ||
return this.request('DELETE', '/etc/creativeExchange/import/api.packages.json', args); | ||
}; | ||
gi | ||
api.themesGetAllThemes = function (args) { | ||
return this.request('GET', '/etc/creativeExchange/themes/api.json', args); | ||
}; | ||
api.themesCheckProgress = function (args) { | ||
return this.request('GET', '/etc/creativeExchange/themes/api.json', args); | ||
}; | ||
module.exports = api; | ||
/***/ }), | ||
/* 3 */ | ||
/***/ (function(module, exports, __webpack_require__) { | ||
var CrEx = __webpack_require__(1); | ||
module.exports = CrEx; | ||
/***/ }) | ||
/******/ ]); |
{ | ||
"name": "crex", | ||
"version": "0.4.0", | ||
"version": "0.4.1", | ||
"description": "Creative Exchange SDK for Javascript", | ||
@@ -8,10 +8,12 @@ "author": "Mateusz Luczak <mateusz.luczak@outlook.com>", | ||
"main": "dist/crex.js", | ||
"module": "dist/crex.es.js", | ||
"jsnext:main": "dist/crex.es.js", | ||
"scripts": { | ||
"build": "npm run build:module && npm run build:browser", | ||
"build:module": "rollup -c", | ||
"build:browser": "rollup -c rollup.config.browser.js", | ||
"build:module": "webpack", | ||
"build:browser": "webpack -p --config webpack.config.umd.js", | ||
"test": "mocha test/**/*.js" | ||
}, | ||
"files": [ | ||
"dist", | ||
"README.md" | ||
], | ||
"devDependencies": { | ||
@@ -21,10 +23,8 @@ "chai": "^3.5.0", | ||
"mocha": "^3.3.0", | ||
"rollup": "^0.41.6", | ||
"rollup-plugin-commonjs": "^8.0.2", | ||
"rollup-plugin-node-resolve": "^3.0.0", | ||
"rollup-plugin-uglify": "^1.0.2" | ||
"webpack": "^2.4.1" | ||
}, | ||
"dependencies": { | ||
"banner-webpack-plugin": "^0.2.3", | ||
"superagent": "^3.5.2" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
4
1
12722
2
5
222
1
+ Addedbanner-webpack-plugin@^0.2.3
+ Addedbanner-webpack-plugin@0.2.3(transitive)