Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

swagger-client

Package Overview
Dependencies
Maintainers
1
Versions
295
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

swagger-client - npm Package Compare versions

Comparing version 2.1.1-M1 to 2.1.1-M2

browser/index.html

41

package.json
{
"name": "swagger-client",
"author": "Tony Tam <fehguy@gmail.com>",
"description": "swagger.js is a javascript client for use with swaggering APIs.",
"version": "2.1.1-M1",
"contributors": [{
"name": "Jeremy Whitlock",
"email": "jcscoobyrs@gmail.com"
}],
"description": "swagger-client is a javascript client for use with swaggering APIs.",
"version": "2.1.1-M2",
"homepage": "http://swagger.io",
"repository": {
"type": "git",
"url": "git://github.com/swagger-api/swagger-js.git"
"url": "git://github.com/swagger-api/swagger-client.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"
}

@@ -27,8 +27,6 @@ # Swagger JS library

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});
}

@@ -70,3 +68,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"));
```

@@ -77,3 +75,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"));
```

@@ -83,18 +81,15 @@

Download `swagger-client.js` and `shred.bundle.js` into your lib folder
Download `browser/swagger-client.js` into your lib folder
```js
<script src='lib/shred.bundle.js' type='text/javascript'></script>
<script src='lib/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",
window.swagger = new client.SwaggerClient({
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);
});
}

@@ -112,3 +107,3 @@ });

swagger.apis.pet.addPet({body: pet});
swagger.pet.addPet({body: pet});
```

@@ -118,5 +113,5 @@

```js
var body = "<Pet><id>2</id><name>monster</name></Pet>";
var pet = "<Pet><id>2</id><name>monster</name></Pet>";
swagger.apis.pet.addPet({body: pet}, {requestContentType:"application/xml"});
swagger.pet.addPet({body: pet}, {requestContentType:"application/xml"});
```

@@ -126,3 +121,3 @@

```js
swagger.apis.pet.getPetById({petId:1}, {responseContentType:"application/xml"});
swagger.pet.getPetById({petId:1}, {responseContentType:"application/xml"});
```

@@ -166,3 +161,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.

@@ -183,16 +178,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
```

@@ -199,0 +197,0 @@

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