Comparing version 0.1.0 to 0.2.0
@@ -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 @@ |
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
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
8009
12
179
1
6
+ Addedsuperagent@^3.5.2
+ Addedasynckit@0.4.0(transitive)
+ Addedcall-bind@1.0.7(transitive)
+ Addedcombined-stream@1.0.8(transitive)
+ Addedcomponent-emitter@1.3.1(transitive)
+ Addedcookiejar@2.1.4(transitive)
+ Addedcore-util-is@1.0.3(transitive)
+ Addeddebug@3.2.7(transitive)
+ Addeddefine-data-property@1.1.4(transitive)
+ Addeddelayed-stream@1.0.0(transitive)
+ Addedes-define-property@1.0.0(transitive)
+ Addedes-errors@1.3.0(transitive)
+ Addedextend@3.0.2(transitive)
+ Addedform-data@2.5.1(transitive)
+ Addedformidable@1.2.6(transitive)
+ Addedfunction-bind@1.1.2(transitive)
+ Addedget-intrinsic@1.2.4(transitive)
+ Addedgopd@1.0.1(transitive)
+ Addedhas-property-descriptors@1.0.2(transitive)
+ Addedhas-proto@1.0.3(transitive)
+ Addedhas-symbols@1.0.3(transitive)
+ Addedhasown@2.0.2(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addedisarray@1.0.0(transitive)
+ Addedmethods@1.1.2(transitive)
+ Addedmime@1.6.0(transitive)
+ Addedmime-db@1.52.0(transitive)
+ Addedmime-types@2.1.35(transitive)
+ Addedms@2.1.3(transitive)
+ Addedobject-inspect@1.13.2(transitive)
+ Addedprocess-nextick-args@2.0.1(transitive)
+ Addedqs@6.13.0(transitive)
+ Addedreadable-stream@2.3.8(transitive)
+ Addedsafe-buffer@5.1.2(transitive)
+ Addedset-function-length@1.2.2(transitive)
+ Addedside-channel@1.0.6(transitive)
+ Addedstring_decoder@1.1.1(transitive)
+ Addedsuperagent@3.8.3(transitive)
+ Addedutil-deprecate@1.0.2(transitive)