Skip to content

Commit

Permalink
Packaging now
Browse files Browse the repository at this point in the history
  • Loading branch information
Arul committed Feb 28, 2018
1 parent 466a4df commit cfcf2eb
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 7 deletions.
5 changes: 3 additions & 2 deletions cli.json
Original file line number Diff line number Diff line change
Expand Up @@ -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}}"
}
]
}
13 changes: 10 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand All @@ -39,4 +47,3 @@
]
}
}

8 changes: 6 additions & 2 deletions src/crb.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit cfcf2eb

Please sign in to comment.