diff --git a/cli.json b/cli.json index 4ed6541..93965bc 100644 --- a/cli.json +++ b/cli.json @@ -5,8 +5,9 @@ "commands": [ { "name": "appsec", - "version": "1.0.0", - "description": "Akamai Security tools for protecting websites." + "version": "0.1.0", + "description": "Akamai Security tools for protecting websites.", + "bin": "https://github.com/akamai/cli-appsec/releases/download/{{.Version}}/akamai-{{.Name}}-{{.Version}}-{{.OS}}-{{.Arch}}{{.BinSuffix}}" } ] } diff --git a/package.json b/package.json index 03e3b30..acab16c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "akamaicliappsec", - "version": "1.0.0", + "version": "0.1.0", "description": "A wrapping development kit to interface common tasks with akamai's Security {OPEN} API.", "repository": "https://github.com/akamai/cli-appsec", "license": "Apache-2.0", @@ -11,8 +11,15 @@ "lint": "eslint src", "test": "mocha", "precommit": "lint-staged", - "build": "pkg bin/akamai-appsec --target node8-linux-x86,node8-linux-x64,node8-win-x86,node8-win-x64,node8-macos-x64 --output akamai-appsec-1.0.0" + "build": "pkg . --target node8-linux-x86,node8-linux-x64,node8-win-x86,node8-win-x64,node8-macos-x64 --output akamai-appsec-1.0.0" }, + "bin": { + "appsec" : "bin/akamai-appsec" + } , + "files": [ + "bin/commands", + "src" + ], "dependencies": { "edgegrid": "*", "pino": "^4.10.4", @@ -22,6 +29,7 @@ "yarn": "^1.3.2" }, "devDependencies": { + "pkg": "^4.3.0-beta.5", "chai": "^4.1.2", "eslint": "^4.17.0", "fs": "0.0.1-security", @@ -39,4 +47,3 @@ ] } } - diff --git a/src/crb.js b/src/crb.js index 21c5fcd..8867784 100644 --- a/src/crb.js +++ b/src/crb.js @@ -29,12 +29,16 @@ class CRBHandler { createRule() { let payload = fs.readFileSync(untildify(this._options['file']), 'utf8'); - return this._config.createResource(URIs.GET_CRB_ALL, [], payload); + return this._config.createResource(URIs.GET_CRB_ALL, [], JSON.parse(payload)); } updateRule() { let payload = fs.readFileSync(untildify(this._options['file']), 'utf8'); - return this._config.updateResource(URIs.GET_CRB, [this._options['custom-rule']], payload); + return this._config.updateResource( + URIs.GET_CRB, + [this._options['custom-rule']], + JSON.parse(payload) + ); } assign() {