Comparing version 1.0.9 to 1.1.0
@@ -8,2 +8,3 @@ // Bluecat client command line tool | ||
var Exec = require('child_process').exec; | ||
var Columnify = require('columnify'); | ||
var argv = require('yargs') | ||
@@ -102,28 +103,22 @@ .usage('Usage: $0 <config|api>') | ||
var apis = []; | ||
var findPath = function(api, path){ | ||
path = path || ''; | ||
// check each of the attribute of the current 'api' object | ||
for(var i in api){ | ||
console.log('----------------'); | ||
if (api[i] !== null && typeof api[i] === 'object') { | ||
//console.log(i); | ||
path = path + '/' + i; | ||
if (api[i] !== null && typeof api[i] === 'object' && i !== 'method') { | ||
var p = path + '/' + i; | ||
if (api[i].hasOwnProperty('method')) { | ||
for(var j in api[i].method) { | ||
console.log('full path: ' + api[i].method[j] + ' ' + path); | ||
} | ||
var keys = Object.keys(api[i]); | ||
//if(keys | ||
findPath(api[i], path); | ||
//return; | ||
apis.push({method: api[i].method.join('|'), uri: p}); | ||
findPath(api[i], p); | ||
} else { | ||
findPath(api[i], path); | ||
findPath(api[i], p); | ||
} | ||
} else { | ||
//return; | ||
} | ||
} | ||
} | ||
}; | ||
findPath(api, ''); | ||
console.log('There are ' + apis.length + ' API routes defined as follows:'); | ||
console.log('-----------------------------------'); | ||
console.log(Columnify(apis)); | ||
} | ||
exports.ServiceSync = require('./service.gen.sync'); | ||
exports.ServiceAsync = require('./service.gen.async'); | ||
exports.Api = require('./service.api'); | ||
exports.version = '1.0.9'; | ||
exports.version = '1.1.0'; |
{ | ||
"name": "bluecat", | ||
"version": "1.0.9", | ||
"version": "1.1.0", | ||
"author": "Chaoyi Chen <ccy.chenchaoyi@gmail.com>", | ||
@@ -25,9 +25,10 @@ "description": "Library for building RESTful API HTTP requests, good for generic RESTful API Test Framework", | ||
"dependencies": { | ||
"fibers": "^1.0.14", | ||
"columnify": "^1.5.4", | ||
"fibers": "^1.0.15", | ||
"hoek": "^2.16.3", | ||
"inquirer": "^1.1.3", | ||
"inquirer": "^1.2.3", | ||
"path": "^0.12.7", | ||
"promise": "^7.1.1", | ||
"request": "2.72.0", | ||
"yargs": "^4.7.1" | ||
"request": "2.79.0", | ||
"yargs": "^6.4.0" | ||
}, | ||
@@ -39,3 +40,3 @@ "scripts": { | ||
"chai": "^3.4.1", | ||
"mocha": "^2.5.3", | ||
"mocha": "^3.1.2", | ||
"grunt-cli": "^1.2.0", | ||
@@ -42,0 +43,0 @@ "grunt": "^1.0.1", |
@@ -13,5 +13,5 @@ ## Bluecat <img src="https://raw.github.com/chenchaoyi/bluecat/master/images/bluecat.png" align="middle" /> | ||
It could be integrated with any Node.js test framework and assertion library to create a clear and straighforward `Web services API testing framework`. | ||
It could be integrated with any Node.js test framework and assertion library to create a clear and straighforward **Web services API testing framework**. | ||
* Define your APIs in a JSON file, `Bluecat` automatically creates all the methods for you | ||
* Define your APIs in a JSON file, **Bluecat** automatically creates all the methods for you | ||
* Callbacks are removed so complex requests flow is more clear | ||
@@ -346,4 +346,6 @@ * Full control over the HTTP request URL query, headers and body | ||
## Command line tool ## | ||
Bluecat comes with `bluecat` command line interface that helps you to create a basic Web services API test framework. | ||
Bluecat comes with `bluecat` command line interface that helps you to create a basic Web services API test framework and check defined APIs. | ||
#### Create basic Web services API test structure: | ||
```bash | ||
@@ -355,3 +357,9 @@ $ npm install bluecat | ||
#### Check currently defined Web services APIs: | ||
```bash | ||
$ ./node_modules/.bin/bluecat api | ||
``` | ||
It will print out all the current defined Web services APIs that could be called from test case. | ||
--- | ||
@@ -358,0 +366,0 @@ |
36374
387
8
686
+ Addedcolumnify@^1.5.4
+ Addedansi-regex@5.0.1(transitive)
+ Addedasynckit@0.4.0(transitive)
+ Addedclone@1.0.4(transitive)
+ Addedcolumnify@1.6.0(transitive)
+ Addeddefaults@1.0.4(transitive)
+ Addedform-data@2.1.4(transitive)
+ Addedpunycode@1.4.1(transitive)
+ Addedqs@6.3.3(transitive)
+ Addedrequest@2.79.0(transitive)
+ Addedstrip-ansi@6.0.1(transitive)
+ Addedtough-cookie@2.3.4(transitive)
+ Addeduuid@3.4.0(transitive)
+ Addedwcwidth@1.0.1(transitive)
+ Addedyargs@6.6.0(transitive)
+ Addedyargs-parser@4.2.1(transitive)
- Removedasync@2.6.4(transitive)
- Removedbl@1.1.2(transitive)
- Removedform-data@1.0.1(transitive)
- Removedlodash.assign@4.2.0(transitive)
- Removednode-uuid@1.4.8(transitive)
- Removedprocess-nextick-args@1.0.7(transitive)
- Removedqs@6.1.2(transitive)
- Removedreadable-stream@2.0.6(transitive)
- Removedrequest@2.72.0(transitive)
- Removedstring_decoder@0.10.31(transitive)
- Removedtough-cookie@2.2.2(transitive)
- Removedwindow-size@0.2.0(transitive)
- Removedyargs@4.8.1(transitive)
- Removedyargs-parser@2.4.1(transitive)
Updatedfibers@^1.0.15
Updatedinquirer@^1.2.3
Updatedrequest@2.79.0
Updatedyargs@^6.4.0