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.5-M1 to 2.1.5-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.5-M1",
"contributors": [{
"name": "Jeremy Whitlock",
"email": "jcscoobyrs@gmail.com"
}],
"description": "swagger-client is a javascript client for use with swaggering APIs.",
"version": "2.1.5-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,4 +23,4 @@

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() {

@@ -69,3 +64,3 @@ swagger.apis.pet.getPetById({petId:1});

```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"));
```

@@ -76,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"));
```

@@ -82,20 +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() {
// 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;
document.getElementById("mydata").innerHTML = JSON.stringify(data.obj);
});
}
});
</script>
</script>
<body>
<div id="mydata"></div>
</body>
```

@@ -109,3 +106,3 @@

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

@@ -117,3 +114,3 @@

swagger.apis.pet.addPet({body: pet}, {requestContentType:"application/xml"});
swagger.pet.addPet({body: pet}, {requestContentType:"application/xml"});
```

@@ -123,3 +120,3 @@

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

@@ -163,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.

@@ -180,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
```

@@ -196,0 +196,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