-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
'use strict'; | ||
|
||
/* | ||
* getAbsoluteFSPath | ||
* @return {string} When run in NodeJS env, returns the absolute path to the current directory | ||
* When run outside of NodeJS, will return an error message | ||
*/ | ||
const getAbsoluteFSPath = function () { | ||
// detect whether we are running in a browser or nodejs | ||
if (typeof module !== "undefined" && module.exports) { | ||
return require("path").resolve(__dirname) | ||
Check failure on line 11 in lib/swagger-ui-dist/absolute-path.js GitHub Actions / test (20.x, ubuntu-20.04)
|
||
} | ||
throw new Error('getAbsoluteFSPath can only be called within a Nodejs environment'); | ||
}; | ||
|
||
module.exports = getAbsoluteFSPath; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
html { | ||
box-sizing: border-box; | ||
overflow: -moz-scrollbars-vertical; | ||
overflow-y: scroll; | ||
} | ||
|
||
*, | ||
*:before, | ||
*:after { | ||
box-sizing: inherit; | ||
} | ||
|
||
body { | ||
margin: 0; | ||
background: #fafafa; | ||
} | ||
|
||
.swagger-ui .topbar .download-url-wrapper { display: none !important } | ||
.swagger-ui .info .main a.link { display: none !important } | ||
|
||
code { padding: 0 !important } |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<!-- HTML for static distribution bundle build --> | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>Swagger UI</title> | ||
<link rel="stylesheet" type="text/css" href="./swagger-ui.css" /> | ||
<link rel="stylesheet" type="text/css" href="index.css" /> | ||
<link rel="icon" type="image/png" href="./favicon-32x32.png" sizes="32x32" /> | ||
<link rel="icon" type="image/png" href="./favicon-16x16.png" sizes="16x16" /> | ||
</head> | ||
|
||
<body> | ||
<div id="swagger-ui"></div> | ||
<script src="./swagger-ui-bundle.js" charset="UTF-8"> </script> | ||
<script src="./swagger-ui-standalone-preset.js" charset="UTF-8"> </script> | ||
<script src="./swagger-initializer.js" charset="UTF-8"> </script> | ||
</body> | ||
</html> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
'use strict'; | ||
|
||
try { | ||
module.exports.SwaggerUIBundle = require("./swagger-ui-bundle.js"); | ||
Check failure on line 4 in lib/swagger-ui-dist/index.js GitHub Actions / test (20.x, ubuntu-20.04)
|
||
module.exports.SwaggerUIStandalonePreset = require("./swagger-ui-standalone-preset.js"); | ||
Check failure on line 5 in lib/swagger-ui-dist/index.js GitHub Actions / test (20.x, ubuntu-20.04)
|
||
} catch(e) { | ||
Check failure on line 6 in lib/swagger-ui-dist/index.js GitHub Actions / test (20.x, ubuntu-20.04)
|
||
} | ||
|
||
// `absolutePath` and `getAbsoluteFSPath` are both here because at one point, | ||
// we documented having one and actually implemented the other. | ||
// They were both retained so we don't break anyone's code. | ||
module.exports.absolutePath = require("./absolute-path.js"); | ||
module.exports.getAbsoluteFSPath = require("./absolute-path.js"); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
<!doctype html> | ||
<html lang="en-US"> | ||
<head> | ||
<title>Swagger UI: OAuth2 Redirect</title> | ||
</head> | ||
<body> | ||
<script> | ||
'use strict'; | ||
function run () { | ||
var oauth2 = window.opener.swaggerUIRedirectOauth2; | ||
var sentState = oauth2.state; | ||
var redirectUrl = oauth2.redirectUrl; | ||
var isValid, qp, arr; | ||
|
||
if (/code|token|error/.test(window.location.hash)) { | ||
qp = window.location.hash.substring(1).replace('?', '&'); | ||
} else { | ||
qp = location.search.substring(1); | ||
} | ||
|
||
arr = qp.split("&"); | ||
arr.forEach(function (v,i,_arr) { _arr[i] = '"' + v.replace('=', '":"') + '"';}); | ||
qp = qp ? JSON.parse('{' + arr.join() + '}', | ||
function (key, value) { | ||
return key === "" ? value : decodeURIComponent(value); | ||
} | ||
) : {}; | ||
|
||
isValid = qp.state === sentState; | ||
|
||
if (( | ||
oauth2.auth.schema.get("flow") === "accessCode" || | ||
oauth2.auth.schema.get("flow") === "authorizationCode" || | ||
oauth2.auth.schema.get("flow") === "authorization_code" | ||
) && !oauth2.auth.code) { | ||
if (!isValid) { | ||
oauth2.errCb({ | ||
authId: oauth2.auth.name, | ||
source: "auth", | ||
level: "warning", | ||
message: "Authorization may be unsafe, passed state was changed in server. The passed state wasn't returned from auth server." | ||
}); | ||
} | ||
|
||
if (qp.code) { | ||
delete oauth2.state; | ||
oauth2.auth.code = qp.code; | ||
oauth2.callback({auth: oauth2.auth, redirectUrl: redirectUrl}); | ||
} else { | ||
let oauthErrorMsg; | ||
if (qp.error) { | ||
oauthErrorMsg = "["+qp.error+"]: " + | ||
(qp.error_description ? qp.error_description+ ". " : "no accessCode received from the server. ") + | ||
(qp.error_uri ? "More info: "+qp.error_uri : ""); | ||
} | ||
|
||
oauth2.errCb({ | ||
authId: oauth2.auth.name, | ||
source: "auth", | ||
level: "error", | ||
message: oauthErrorMsg || "[Authorization failed]: no accessCode received from the server." | ||
}); | ||
} | ||
} else { | ||
oauth2.callback({auth: oauth2.auth, token: qp, isValid: isValid, redirectUrl: redirectUrl}); | ||
} | ||
window.close(); | ||
} | ||
|
||
if (document.readyState !== 'loading') { | ||
run(); | ||
} else { | ||
document.addEventListener('DOMContentLoaded', function () { | ||
run(); | ||
}); | ||
} | ||
</script> | ||
</body> | ||
</html> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
'use strict'; | ||
|
||
window.onload = function() { | ||
Check failure on line 3 in lib/swagger-ui-dist/swagger-initializer.js GitHub Actions / test (20.x, ubuntu-20.04)
|
||
//<editor-fold desc="Changeable Configuration Block"> | ||
window.ui = SwaggerUIBundle({ | ||
Check failure on line 5 in lib/swagger-ui-dist/swagger-initializer.js GitHub Actions / test (20.x, ubuntu-20.04)
Check failure on line 5 in lib/swagger-ui-dist/swagger-initializer.js GitHub Actions / test (20.x, ubuntu-20.04)
Check failure on line 5 in lib/swagger-ui-dist/swagger-initializer.js GitHub Actions / test (20.x, ubuntu-20.04)
Check failure on line 5 in lib/swagger-ui-dist/swagger-initializer.js GitHub Actions / test (22.x, ubuntu-20.04)
Check failure on line 5 in lib/swagger-ui-dist/swagger-initializer.js GitHub Actions / test (22.x, ubuntu-20.04)
|
||
url: "/swagger.json", | ||
dom_id: '#swagger-ui', | ||
deepLinking: true, | ||
presets: [ | ||
SwaggerUIBundle.presets.apis, | ||
Check failure on line 10 in lib/swagger-ui-dist/swagger-initializer.js GitHub Actions / test (20.x, ubuntu-20.04)
|
||
SwaggerUIStandalonePreset | ||
], | ||
layout: "StandaloneLayout" | ||
}); | ||
//</editor-fold> | ||
}; |
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.