New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

hyperswitch

Package Overview
Dependencies
Maintainers
4
Versions
75
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hyperswitch - npm Package Compare versions

Comparing version 0.10.5 to 0.11.0

44

lib/swaggerUI.js

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

// Swagger-ui helpfully exporting the absolute path of its dist directory
const docRoot = `${require('swagger-ui').dist}/`;
const docRoot = `${require('swagger-ui-dist').getAbsoluteFSPath()}/`;
const HTTPError = require('./exports').HTTPError;

@@ -27,14 +27,35 @@

const cfg = hyper.config;
const css = `
/* Removes Swagger's image from the header bar */
.topbar-wrapper .link img {
display: none;
}
/* Adds the application's name in the header bar */
.topbar-wrapper .link::after {
content: "${cfg.ui_name}";
}
/* Removes input field and explore button from header bar */
.swagger-ui .topbar .download-url-wrapper {
display: none;
}
/* Modifies the font in the information area */
.swagger-ui .info li, .swagger-ui .info p, .swagger-ui .info table {
font-size: 16px;
line-height: 1.4em;
}
/* Removes authorize button and section */
.scheme-container {
display: none
}
`;
body = body.toString()
.replace(/((?:src|href)=['"])/g, '$1?path=')
// Some self-promotion
.replace(/<a id="logo".*?<\/a>/,
`<a id="logo" href="${cfg.ui_url}">${cfg.ui_name}</a>`)
.replace(/<\/style>/, `${css}\n </style>`)
.replace(/<title>[^<]*<\/title>/, `<title>${cfg.ui_title}</title>`)
// Replace the default url with ours, switch off validation &
// limit the size of documents to apply syntax highlighting to
.replace(/docExpansion: "none"/, 'docExpansion: "list", ' +
'validatorUrl: null, ' +
'highlightSizeThreshold: 10000')
.replace(/ url: url,/, 'url: "?spec",');
.replace(/dom_id: '#swagger-ui'/, 'dom_id: "#swagger-ui", ' +
'docExpansion: "none", defaultModelsExpandDepth: -1, validatorUrl: null, displayRequestDuration: true')
.replace(/"https:\/\/petstore.swagger.io\/v2\/swagger.json"/, '"?spec"');
}

@@ -46,3 +67,4 @@

body = body.toString()
.replace(/underscore-min\.map/, '?path=lib/underscore-min.map');
.replace(/underscore-min\.map/, '?path=lib/underscore-min.map')
.replace(/sourceMappingURL=/, 'sourceMappingURL=/?path=');
} else if (/\.png$/.test(reqPath)) {

@@ -56,3 +78,5 @@ contentType = 'image/png';

contentType = 'text/css';
body = body.toString().replace(/\.\.\/(images|fonts)\//g, '?path=$1/');
body = body.toString()
.replace(/\.\.\/(images|fonts)\//g, '?path=$1/')
.replace(/sourceMappingURL=/, 'sourceMappingURL=/?path=');
}

@@ -65,3 +89,3 @@ return P.resolve({

"script-src 'self' 'unsafe-inline'; connect-src *; " +
"style-src 'self' 'unsafe-inline'; img-src 'self'; font-src 'self';"
"style-src 'self' 'unsafe-inline'; img-src 'self' data:; font-src 'self';"
},

@@ -68,0 +92,0 @@ body

{
"name": "hyperswitch",
"version": "0.10.5",
"version": "0.11.0",
"description": "REST API creation framework",

@@ -37,3 +37,3 @@ "main": "index.js",

"swagger-router": "^0.7.2",
"swagger-ui": "git+https://github.com/wikimedia/swagger-ui#master"
"swagger-ui-dist": "^3.22.0"
},

@@ -40,0 +40,0 @@ "devDependencies": {

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