@sasjs/server 3.6.0 → 3.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/public/SASjsApi/favicon-16x16.png +0 -0
- package/build/public/SASjsApi/favicon-32x32.png +0 -0
- package/build/public/SASjsApi/index.html +24 -0
- package/build/public/SASjsApi/oauth2-redirect.html +6 -0
- package/build/public/SASjsApi/swagger-ui-LICENSE +202 -0
- package/build/public/SASjsApi/swagger-ui-NOTICE +2 -0
- package/build/public/SASjsApi/swagger-ui-bundle.js +2 -0
- package/build/public/SASjsApi/swagger-ui-init.js +27 -0
- package/build/public/SASjsApi/swagger-ui-standalone-preset.js +2 -0
- package/build/public/SASjsApi/swagger-ui.css +1 -1
- package/build/scripts/copySwaggerUi.js +14 -0
- package/build/src/routes/api/index.js +4 -14
- package/build/src/routes/api/spec/permission.spec.js +2 -2
- package/build/src/routes/api/spec/swaggerAssets.spec.js +69 -47
- package/build/src/server.js +1 -0
- package/build/src/utils/buildInfo.generated.js +3 -3
- package/build/src/utils/swaggerUiAssets.js +53 -0
- package/package.json +1 -2
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// Starts the Swagger UI on the page served from this folder.
|
|
2
|
+
//
|
|
3
|
+
// A file of its own, never an inline script: the default Content-Security-Policy
|
|
4
|
+
// is `script-src 'self'`, which refuses an inline init.
|
|
5
|
+
window.onload = function () {
|
|
6
|
+
window.ui = SwaggerUIBundle({
|
|
7
|
+
url: '/swagger.yaml',
|
|
8
|
+
dom_id: '#swagger-ui',
|
|
9
|
+
deepLinking: true,
|
|
10
|
+
presets: [SwaggerUIBundle.presets.apis, SwaggerUIStandalonePreset],
|
|
11
|
+
plugins: [SwaggerUIBundle.plugins.DownloadUrl],
|
|
12
|
+
layout: 'StandaloneLayout',
|
|
13
|
+
// null, not the default: the online validator posts the spec URL to
|
|
14
|
+
// validator.swagger.io, and nothing on this page talks to a third party.
|
|
15
|
+
validatorUrl: null,
|
|
16
|
+
// the API's own calls carry the session cookie and the CSRF header
|
|
17
|
+
requestInterceptor: function (request) {
|
|
18
|
+
request.credentials = 'include'
|
|
19
|
+
|
|
20
|
+
const cookie = document.cookie
|
|
21
|
+
const startIndex = cookie.indexOf('XSRF-TOKEN')
|
|
22
|
+
const csrf = cookie.slice(startIndex + 11).split('; ')[0]
|
|
23
|
+
request.headers['X-XSRF-TOKEN'] = csrf
|
|
24
|
+
return request
|
|
25
|
+
}
|
|
26
|
+
})
|
|
27
|
+
}
|