wadl-client
Advanced tools
Comparing version 0.2.2 to 1.0.0
{ | ||
"name": "wadl-client", | ||
"main": "wadl-client.js", | ||
"version": "0.2.2", | ||
"version": "1.0.0", | ||
"homepage": "https://github.com/rbelouin/wadl-client", | ||
@@ -6,0 +6,0 @@ "authors": [ |
@@ -29,3 +29,3 @@ module.exports = function(grunt) { | ||
default: { | ||
src: ["spec/browser-dependencies.js", "spec/resources.js", "wadl-client.js"], | ||
src: ["spec/browser-dependencies.js", "spec/swagger.js", "wadl-client.js"], | ||
options: { | ||
@@ -32,0 +32,0 @@ host: "http://localhost:3000/", |
{ | ||
"name": "wadl-client", | ||
"version": "0.2.2", | ||
"version": "1.0.0", | ||
"description": "Generate a Javascript client for a web API providing a WADL description", | ||
@@ -5,0 +5,0 @@ "main": "wadl-client.js", |
@@ -8,6 +8,14 @@ wadl-client | ||
See [rbelouin/wadl2json](https://github.com/rbelouin/wadl2json) for generating a swagger json from a WADL file. | ||
How to use | ||
---------- | ||
There is no documentation at the moment. | ||
Please refer to the tests for learning how to use the wadl-client. | ||
How to build | ||
------------ | ||
Please install [node](http://nodejs.org/), [npm](https://www.npmjs.org/) and [grunt](http://gruntjs.com/) on your system. | ||
Please install [node](http://nodejs.org/) and [npm](https://www.npmjs.org/) on your system. | ||
Then: | ||
@@ -14,0 +22,0 @@ |
@@ -1,6 +0,6 @@ | ||
var resources = resources || require("./resources.js"); | ||
var swagger = swagger || require("./swagger.js"); | ||
var WadlClient = WadlClient || require("../wadl-client.js"); | ||
var Bacon = Bacon || require("baconjs"); | ||
var client = WadlClient.buildClient(resources, { | ||
var client = WadlClient.buildClient(swagger, { | ||
host: "http://localhost:3000" | ||
@@ -38,3 +38,3 @@ }); | ||
it("should be able to download resources by giving specific header at building time", function(done) { | ||
var client = WadlClient.buildClient(resources, { | ||
var client = WadlClient.buildClient(swagger, { | ||
host: "http://localhost:3000", | ||
@@ -215,3 +215,3 @@ headers: { | ||
it("must call the beforeSend hook, if it's defined", function(done) { | ||
var client = WadlClient.buildClient(resources, { | ||
var client = WadlClient.buildClient(swagger, { | ||
host: "http://localhost:3000", | ||
@@ -218,0 +218,0 @@ hooks: { |
@@ -266,4 +266,5 @@ var WadlClient = (function() { | ||
WadlClient.buildClient = function(endpoints, settings) { | ||
WadlClient.buildClient = function(swagger, settings) { | ||
var client = {}; | ||
var endpoints = swagger.paths; | ||
@@ -280,5 +281,5 @@ for(var path in endpoints) { | ||
var methods = endpoints[path]; | ||
for(var i = 0; i < methods.length; i++) { | ||
var method = methods[i]; | ||
node[method.verb.toLowerCase()] = prepareRequest(method.verb, path, settings || {}); | ||
for(var verb in methods) { | ||
var method = methods[verb]; | ||
node[verb.toLowerCase()] = prepareRequest(verb.toUpperCase(), path, settings || {}); | ||
} | ||
@@ -285,0 +286,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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
28305
879
1
26