swagger-client
Advanced tools
Comparing version 2.1.4-M1 to 2.1.4-M2
{ | ||
"name": "swagger-client", | ||
"author": "Tony Tam <fehguy@gmail.com>", | ||
"description": "swagger.js is a javascript client for use with swaggering APIs.", | ||
"version": "2.1.4-M1", | ||
"contributors": [{ | ||
"name": "Jeremy Whitlock", | ||
"email": "jcscoobyrs@gmail.com" | ||
}], | ||
"description": "swagger-client is a javascript client for use with swaggering APIs.", | ||
"version": "2.1.4-M2", | ||
"homepage": "http://swagger.io", | ||
"repository": { | ||
"type": "git", | ||
"url": "git://github.com/swagger-api/swagger-js.git" | ||
"url": "https://github.com/swagger-api/swagger-js.git" | ||
}, | ||
"main": "lib/swagger-client.js", | ||
"main": "index.js", | ||
"scripts": { | ||
@@ -17,2 +21,8 @@ "build": "gulp build", | ||
}, | ||
"files": [ | ||
"LICENSE", | ||
"lib", | ||
"browser", | ||
"index.js" | ||
], | ||
"engines": { | ||
@@ -22,22 +32,27 @@ "node": ">= 0.6.6" | ||
"dependencies": { | ||
"shred": "0.8.10", | ||
"btoa": "1.1.1" | ||
"btoa": "^1.1.2", | ||
"cookiejar": "^2.0.1", | ||
"jquery": "^2.1.3", | ||
"lodash-compat": "^3.5.0", | ||
"superagent": "^0.21.0" | ||
}, | ||
"devDependencies": { | ||
"async": "^0.9.0", | ||
"brfs": "^1.4.0", | ||
"browserify": "^9.0.3", | ||
"del": "^1.1.1", | ||
"expect": "1.4.0", | ||
"gulp": "^3.8.10", | ||
"gulp-header": "1.2.2", | ||
"gulp-concat": "^2.4.3", | ||
"gulp-buffer": "0.0.2", | ||
"gulp-header": "^1.2.2", | ||
"gulp-istanbul": "^0.5.0", | ||
"gulp-jshint": "^1.9.0", | ||
"gulp-mocha": "^2.0.0", | ||
"gulp-rename": "^1.2.0", | ||
"gulp-uglify": "^1.0.2", | ||
"gulp-util": "^3.0.1", | ||
"gulp-wrap": "0.10.1", | ||
"jshint-stylish": "^1.0.1", | ||
"mocha": "^1.21.3", | ||
"unit.js": "1.1.2" | ||
"uglifyify": "^3.0.1", | ||
"unit.js": "1.1.2", | ||
"vinyl-source-stream": "^1.1.0" | ||
}, | ||
"license": "apache 2.0" | ||
} |
@@ -8,7 +8,2 @@ # Swagger JS library | ||
## What's Swagger? | ||
The goal of Swagger™ is to define a standard, language-agnostic interface to REST APIs which allows both humans and computers to discover and understand the capabilities of the service without access to source code, documentation, or through network traffic inspection. When properly defined via Swagger, a consumer can understand and interact with the remote service with a minimal amount of implementation logic. Similar to what interfaces have done for lower-level programming, Swager removes the guesswork in calling the service. | ||
Check out [Swagger-Spec](https://github.com/swagger-api/swagger-spec) for additional information about the Swagger project, including additional libraries with support for other languages and more. | ||
@@ -28,8 +23,6 @@ | ||
var swagger = new client.SwaggerClient({ | ||
url: 'http://petstore.swagger.wordnik.com/v2/swagger.json', | ||
var swagger = new client({ | ||
url: 'http://petstore.swagger.io/v2/swagger.json', | ||
success: function() { | ||
if(swagger.ready === true) { | ||
swagger.apis.pet.getPetById({petId:1}); | ||
} | ||
swagger.apis.pet.getPetById({petId:1}); | ||
} | ||
@@ -71,3 +64,3 @@ }); | ||
```js | ||
client.authorizations.add("apiKey", new client.ApiKeyAuthorization("api_key","special-key","query")); | ||
client.clientAuthorizations.add("apiKey", new client.ApiKeyAuthorization("api_key","special-key","query")); | ||
``` | ||
@@ -78,3 +71,3 @@ | ||
```js | ||
client.authorizations.add("apiKey", new client.ApiKeyAuthorization("api_key","special-key","header")); | ||
client.clientAuthorizations.add("apiKey", new client.ApiKeyAuthorization("api_key","special-key","header")); | ||
``` | ||
@@ -84,22 +77,22 @@ | ||
Download `swagger-client.js` and `shred.bundle.js` into your lib folder | ||
Download `browser/swagger-client.js` into your webapp: | ||
```js | ||
<script src='lib/shred.bundle.js' type='text/javascript'></script> | ||
<script src='lib/swagger-client.js' type='text/javascript'></script> | ||
<script src='browser/swagger-client.js' type='text/javascript'></script> | ||
<script type="text/javascript"> | ||
// initialize swagger, point to a resource listing | ||
window.swagger = new SwaggerClient({ | ||
url: "http://petstore.swagger.wordnik.com/api/api-docs", | ||
url: "http://petstore.swagger.io/api/api-docs", | ||
success: function() { | ||
if(swagger.ready === true) { | ||
// upon connect, fetch a pet and set contents to element "mydata" | ||
swagger.apis.pet.getPetById({petId:1}, function(data) { | ||
document.getElementById("mydata").innerHTML = data.content.data; | ||
}); | ||
} | ||
// upon connect, fetch a pet and set contents to element "mydata" | ||
swagger.apis.pet.getPetById({petId:1}, function(data) { | ||
document.getElementById("mydata").innerHTML = JSON.stringify(data.obj); | ||
}); | ||
} | ||
}); | ||
</script> | ||
</script> | ||
<body> | ||
<div id="mydata"></div> | ||
</body> | ||
``` | ||
@@ -113,3 +106,3 @@ | ||
swagger.apis.pet.addPet({body: pet}); | ||
swagger.pet.addPet({body: pet}); | ||
``` | ||
@@ -121,3 +114,3 @@ | ||
swagger.apis.pet.addPet({body: pet}, {requestContentType:"application/xml"}); | ||
swagger.pet.addPet({body: pet}, {requestContentType:"application/xml"}); | ||
``` | ||
@@ -127,3 +120,3 @@ | ||
```js | ||
swagger.apis.pet.getPetById({petId:1}, {responseContentType:"application/xml"}); | ||
swagger.pet.getPetById({petId:1}, {responseContentType:"application/xml"}); | ||
``` | ||
@@ -167,3 +160,3 @@ | ||
Please [fork the code](https://github.com/swagger-api/swagger-js) and help us improve | ||
swagger-client.js. Send us a pull request and **we'll mail you a wordnik T-shirt!** | ||
swagger-client.js. Send us a pull request to the `develop_2.0` branch! Tests make merges get accepted more quickly. | ||
@@ -184,16 +177,19 @@ swagger-js use gulp for Node.js. | ||
# Run the test suite | ||
# Run lint (will not fail if there are errors/warnings), tests (without coverage) and builds the browser binaries | ||
gulp | ||
# Run the test suite (without coverage) | ||
gulp test | ||
# Build the library (minified and unminified) in the dist folder | ||
# Build the browser binaries (One for development with source maps and one that is minified and without source maps) in the browser directory | ||
gulp build | ||
# continuously run the test suite: | ||
# Continuously run the test suite: | ||
gulp watch | ||
# run jshint report | ||
# Run jshint report | ||
gulp lint | ||
# run a coverage report | ||
gulp cover | ||
# Run a coverage report based on running the unit tests | ||
gulp coverage | ||
``` | ||
@@ -200,0 +196,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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
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
Network access
Supply chain riskThis module accesses the network.
Found 3 instances in 1 package
Debug access
Supply chain riskUses debug, reflection and dynamic code execution features.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
1760472
0
23825
5
2
5
16
16
202
+ Addedcookiejar@^2.0.1
+ Addedjquery@^2.1.3
+ Addedlodash-compat@^3.5.0
+ Addedsuperagent@^0.21.0
+ Addedasync@0.9.2(transitive)
+ Addedbtoa@1.2.1(transitive)
+ Addedcombined-stream@0.0.7(transitive)
+ Addedcomponent-emitter@1.1.2(transitive)
+ Addedcookiejar@2.0.12.1.4(transitive)
+ Addedcore-util-is@1.0.3(transitive)
+ Addeddebug@2.6.9(transitive)
+ Addeddelayed-stream@0.0.5(transitive)
+ Addedextend@1.2.1(transitive)
+ Addedform-data@0.1.3(transitive)
+ Addedformidable@1.0.14(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addedisarray@0.0.1(transitive)
+ Addedjquery@2.2.4(transitive)
+ Addedlodash-compat@3.10.2(transitive)
+ Addedmethods@1.0.1(transitive)
+ Addedmime@1.2.11(transitive)
+ Addedms@2.0.0(transitive)
+ Addedqs@1.2.0(transitive)
+ Addedreadable-stream@1.0.27-1(transitive)
+ Addedreduce-component@1.0.1(transitive)
+ Addedstring_decoder@0.10.31(transitive)
+ Addedsuperagent@0.21.0(transitive)
- Removedshred@0.8.10
- Removedax@0.1.8(transitive)
- Removedbtoa@1.1.1(transitive)
- Removedcookiejar@1.3.1(transitive)
- Removediconv-lite@0.6.3(transitive)
- Removedsafer-buffer@2.1.2(transitive)
- Removedshred@0.8.10(transitive)
- Removedsprintf@0.1.1(transitive)
Updatedbtoa@^1.1.2