Socket
Socket
Sign inDemoInstall

swagger-stats

Package Overview
Dependencies
Maintainers
1
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

swagger-stats - npm Package Compare versions

Comparing version 0.95.18 to 0.95.19

7

CHANGELOG.md
# Changelog
All notable changes to this project will be documented in this file.
## v0.95.19
* [bug] Elasticsearch - Crash when elasticsearch's credentials are given [#121](https://github.com/slanatech/swagger-stats/issues/121)
* [bug] Define prom-client as Peer Dependency instead of Direct Dependency [#126](https://github.com/slanatech/swagger-stats/issues/126)
* [feature] https elasticsearch support [#130](https://github.com/slanatech/swagger-stats/issues/130)
## v0.95.18

@@ -5,0 +12,0 @@

2

examples/authtest/authtest.js

@@ -67,3 +67,3 @@ 'use strict';

name: 'swagger-stats-authtest',
version: '0.95.18',
version: '0.95.19',
hostname: "hostname",

@@ -70,0 +70,0 @@ ip: "127.0.0.1",

@@ -49,3 +49,3 @@ 'use strict';

name: 'swagger-stats-fastify',
version: '0.95.18',
version: '0.95.19',
timelineBucketDuration: 1000,

@@ -52,0 +52,0 @@ swaggerSpec:swaggerSpec,

@@ -70,3 +70,3 @@ 'use strict';

name: 'swagger-stats-hapitest',
version: '0.95.18',
version: '0.95.19',
hostname: "hostname",

@@ -73,0 +73,0 @@ ip: "127.0.0.1",

@@ -18,3 +18,3 @@ const path = require('path');

name: 'restifytest',
version: '0.95.18',
version: '0.95.19',
hostname: "hostname",

@@ -21,0 +21,0 @@ ip: "127.0.0.1",

@@ -82,3 +82,3 @@ 'use strict';

name: 'swagger-stats-spectest',
version: '0.95.18',
version: '0.95.19',
hostname: "hostname",

@@ -85,0 +85,0 @@ ip: "127.0.0.1",

@@ -112,3 +112,3 @@ 'use strict';

name: 'swagger-stats-testapp',
version: '0.95.18',
version: '0.95.19',
timelineBucketDuration: tlBucket,

@@ -115,0 +115,0 @@ uriPath: '/swagger-stats',

@@ -44,2 +44,5 @@ /**

this.elasticsearchCert = null;
this.elasticsearchKey = null
this.indexPrefix = "api-";

@@ -85,2 +88,10 @@

if(swsUtil.supportedOptions.elasticsearchCert in swsOptions) {
this.elasticsearchCert = swsOptions[swsUtil.supportedOptions.elasticsearchCert]
}
if( swsUtil.supportedOptions.elasticsearchKey in swsOptions) {
this.elasticsearchKey = swsOptions[swsUtil.supportedOptions.elasticsearchKey]
}
// Check / Initialize schema

@@ -102,5 +113,5 @@ this.initTemplate();

var templateURL = this.elasticURL+'/_template/template_api';
var getOptionsVersion = {url:this.elasticURL, json:true};
var getOptions = {url:templateURL, json:true};
let putOptions = null; // {url:templateURL, json:indexTemplate7X};
var getOptionsVersion = {url:this.elasticURL, json:true, key: this.elasticsearchKey, cert: this.elasticsearchCert};
var getOptions = {url:templateURL, json:true, key: this.elasticsearchKey, cert: this.elasticsearchCert};
let putOptions = {url:templateURL, json:indexTemplate7X, key: this.elasticsearchKey, cert: this.elasticsearchCert};

@@ -126,6 +137,4 @@ if (this.elasticUsername && this.elasticPassword) {

if( that.es7 ){
putOptions = {url:templateURL, json:indexTemplate7X};
} else {
putOptions = {url:templateURL, json:indexTemplate};
if( !that.es7 ){
putOptions.json = indexTemplate;
}

@@ -239,3 +248,5 @@

},
body: this.indexBuffer
body: this.indexBuffer,
key: this.elasticsearchKey,
cert: this.elasticsearchCert
};

@@ -242,0 +253,0 @@

@@ -116,2 +116,8 @@ /* swagger-stats Settings */

// Elasticsearch key for SSL connection
this.elasticsearchKey = null;
// Elasticsearch certificat for SSL connection
this.elasticsearchCert = null;
// Set to true to track only requests defined in swagger spec. Default false.

@@ -118,0 +124,0 @@ this.swaggerOnly = false;

@@ -103,2 +103,8 @@ /*

// Elasticsearch key for SSL connection
elasticsearchKey : "elasticsearchSSLKey",
// Elasticsearch certificat for SSL connection
elasticsearchCert : "elasticsearchSSLCert",
// Set to true to track only requests defined in swagger spec. Default false.

@@ -105,0 +111,0 @@ swaggerOnly : "swaggerOnly"

{
"name": "swagger-stats",
"version": "0.95.18",
"version": "0.95.19",
"description": "API Telemetry and APM. Trace API calls and Monitor API performance, health and usage statistics in Node.js Microservices, based on express routes and Swagger (Open API) specification",

@@ -96,3 +96,2 @@ "main": "lib/index.js",

"path-to-regexp": "^6.1.0",
"prom-client": "^11.5.3",
"qs": "^6.9.1",

@@ -103,4 +102,8 @@ "request": "^2.88.0",

},
"peerDependencies": {
"prom-client": ">= 10 <= 12"
},
"devDependencies": {
"swagger-stats-ux": "^0.95.22",
"@hapi/hapi": "^18.3.2",
"@hapi/inert": "^5.2.1",
"artillery": "^1.6.0-26",

@@ -113,2 +116,3 @@ "body-parser": "^1.18.2",

"chosen-js": "^1.8.2",
"concurrently": "^4.1.2",
"coveralls": "^3.0.0",

@@ -122,2 +126,3 @@ "cross-env": "^5.1.1",

"express": "^4.16.2",
"fastify": "^2.8.0",
"file-loader": "^0.11.1",

@@ -156,3 +161,5 @@ "font-awesome": "^4.7.0",

"postcss-loader": "^2.0.9",
"prom-client": "^11.5.3",
"q": "^1.5.1",
"restify": "^8.5.1",
"serve-favicon": "^2.4.5",

@@ -165,8 +172,4 @@ "serve-static": "^1.13.1",

"swagger-parser": "^8.0.4",
"@hapi/hapi": "^18.3.2",
"@hapi/inert": "^5.2.1",
"concurrently": "^4.1.2",
"fastify": "^2.8.0",
"restify": "^8.5.1"
"swagger-stats-ux": "^0.95.22"
}
}

@@ -92,2 +92,8 @@ <p align="center">

If you haven't added prom-client already, you should do this now. It's a [peer dependency](https://nodejs.org/en/blog/npm/peer-dependencies) of swagger-stats as of version x.x.x.
```
npm install prom-client@12 --save
```
### Enable swagger-stats middleware in your app

@@ -241,4 +247,6 @@

```
const promClient = swaggerStats.getPromClient();
```javascript
const swaggerStats = require('swagger-stats');
const promClient = require('prom-client');
promClient.collectDefaultMetrics();

@@ -245,0 +253,0 @@ ```

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

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