New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

bluecat

Package Overview
Dependencies
Maintainers
1
Versions
56
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bluecat - npm Package Compare versions

Comparing version 0.3.3 to 0.3.4

.travis.yml

2

lib/index.js
exports.ServiceSync = require('./service.gen.sync');
exports.ServiceAsync = require('./service.gen.async');
exports.Api = require('./service.api');
exports.version = '0.3.3';
exports.version = '0.3.4';
{
"name": "bluecat",
"version": "0.3.3",
"version": "0.3.4",
"description": "Generic REST API Test Framework",

@@ -20,6 +20,6 @@ "repository": {

"dependencies": {
"fibers": ">=1.0.5",
"hoek": "^2.13.0",
"promise": ">=7.0.1",
"request": "2.55.0"
"fibers": ">=1.0.7",
"hoek": "^2.16.3",
"promise": ">=7.0.4",
"request": "2.67.0"
},

@@ -31,8 +31,8 @@ "scripts": {

"chai": "^2.3.0",
"mocha": "^2.2.5",
"mocha": "^2.3.4",
"grunt-cli": "^0.1.13",
"grunt": "^0.4.5",
"grunt-contrib-jshint": "^0.11.2",
"grunt-jscs": "^1.8.0"
"grunt-contrib-jshint": "^0.11.3",
"grunt-jscs": "^2.4.0"
}
}

@@ -1,4 +0,6 @@

## Bluecat
## Bluecat <img src="https://raw.github.com/chenchaoyi/bluecat/master/images/bluecat.png" align="middle" />
[![NPM version][npm-image]][npm-url]
[![Build Status](https://travis-ci.org/chenchaoyi/bluecat.svg?branch=master)](https://travis-ci.org/chenchaoyi/bluecat)
[![Dependency Status][david-image]][david-url]

@@ -35,2 +37,8 @@ [![Downloads][downloads-image]][downloads-url]

## Example ##
#### Regular RESTful API
```
POST /checkout/contract
GET /checkout/contract
```
* First define your API in config/api.json:

@@ -40,6 +48,6 @@

{
"mobileapi": {
"typeahead": {
"api": {
"checkout": {
"schema": "http",
"method": ["GET"]
"method": ["GET", "POST"]
}

@@ -50,3 +58,3 @@ }

* Then in your test suite (example, using Mocha):
* Then create a Bluecat service object. You are all set to send request and validate response:

@@ -56,29 +64,24 @@ ```javascript

var Bluecat = require('bluecat');
var Api = Bluecat.Api('mobileapi');
var Service = new Bluecat.ServiceSync(Bluecat.Api('api'), 'sample-host.com');
describe('typeahead service test suite', function() {
// All requests need to be put into Api.run(), so they will run synchronously
Service.run(function() {
// send POST http://sample-host.com/checkout/contract
var r = Service.checkout.contract.POST({
body: {
cartid: 'test-cart-id'
}
});
// verify response
expect(r.data.statusCode).to.equal(200);
expect(r.data.body).to.have.ownProperty('id');
before(function() {
t = new Bluecat.ServiceSync(Api, 'api.mobile.walmart.com');
})
// send GET http://sample-host.com/checkout/contract
// cookies are automatically maintained
r = Service.checkout.contract.GET();
// verify response
expect(r.data.statusCode).to.equal(200);
expect(r.data.body.cartId).to.eql('test-cart-id');
})
it('GET typeahead?term=toy&cat=0&num=2', function(done) {
t.run(function() {
// send GET to http://api.mobile.walmart.com/typeahead?term=toy&cat=0&num=2
var r = t.typeahead.GET({
query: {
term: 'toy',
cat: 0,
num: 2
}
});
// verify response
expect(r.err).to.equal(null);
expect(r.data.statusCode).to.equal(200);
expect(r.data.body).to.have.ownProperty('specific');
done();
})
})
})
```

@@ -96,3 +99,3 @@

var Api = Bluecat.Api('mobileapi');
var service = new Bluecat.ServiceSync(Api, 'api.mobile.walmart.com', {
var Service = new Bluecat.ServiceSync(Api, 'api.mobile.walmart.com', {
gzip: true

@@ -108,5 +111,5 @@ });

var Api = Bluecat.Api('mobileapi');
var service = new Bluecat.ServiceSync(Api, 'api.mobile.walmart.com');
var Service = new Bluecat.ServiceSync(Api, 'api.mobile.walmart.com');
var r = lapetus.rawRequest({
var r = Service.rawRequest({
method: 'GET',

@@ -126,5 +129,5 @@ json: true,

var Api = Bluecat.Api('mobileapi');
var service = new Bluecat.ServiceSync(Api, 'api.mobile.walmart.com');
var Service = new Bluecat.ServiceSync(Api, 'api.mobile.walmart.com');
service.setProxy('http://127.0.0.1:8888')
Service.setProxy('http://127.0.0.1:8888')
```

@@ -138,7 +141,7 @@

var Api = Bluecat.Api('mobileapi');
var service = new Bluecat.ServiceSync(Api, 'api.mobile.walmart.com');
var Service = new Bluecat.ServiceSync(Api, 'api.mobile.walmart.com');
service.v1.products.search.GET();
service.resetCookie();
service.v1.cart.POST({
Service.v1.products.search.GET();
Service.resetCookie();
Service.v1.cart.POST({
body: {

@@ -156,5 +159,5 @@ location: '94066'

var Api = Bluecat.Api('mobileapi');
var service = new Bluecat.ServiceSync(Api, 'api.mobile.walmart.com');
var Service = new Bluecat.ServiceSync(Api, 'api.mobile.walmart.com');
service.setHeaders({'User-Agent': 'Automation'});
Service.setHeaders({'User-Agent': 'Automation'});
```

@@ -168,3 +171,3 @@

var Api = Bluecat.Api('mobileapi');
var service = new Bluecat.ServiceSync(Api, 'api.mobile.walmart.com');
var Service = new Bluecat.ServiceSync(Api, 'api.mobile.walmart.com');

@@ -174,3 +177,3 @@ // The following sessions rules start with 'start-auth-token-value' in the request header AUTH_TOKEN,

// and put it in the next request header AUTH_TOKEN
service.setSessionRules({
Service.setSessionRules({
requestHeader: 'AUTH_TOKEN',

@@ -177,0 +180,0 @@ responseHeader: 'REFRESH_AUTH_TOKEN',

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc