Skip to content

Commit bccb9b2

Browse files
committed
Add swagger files
1 parent d9c58d1 commit bccb9b2

27 files changed

+283
-14
lines changed

b0x.yaml

+122
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
# all folders and files are relative to the path
2+
# where fileb0x was run at!
3+
4+
# default: main
5+
pkg: static
6+
7+
# destination
8+
dest: "./static"
9+
10+
# gofmt
11+
# type: bool
12+
# default: false
13+
fmt: true
14+
15+
# build tags for the main b0x.go file
16+
tags: ""
17+
18+
# updater allows you to update a b0x in a running server
19+
# without having to restart it
20+
updater:
21+
# disabled by default
22+
enabled: false
23+
24+
# empty mode creates a empty b0x file with just the
25+
# server and the filesystem, then you'll have to upload
26+
# the files later using the cmd:
27+
# fileb0x -update=http://server.com:port b0x.yaml
28+
#
29+
# it avoids long compile time
30+
empty: false
31+
32+
# amount of uploads at the same time
33+
workers: 3
34+
35+
# to get a username and password from a env variable
36+
# leave username and password blank (username: "")
37+
# then set your username and password in the env vars
38+
# (no caps) -> fileb0x_username and fileb0x_password
39+
username: "user"
40+
password: "pass"
41+
port: 8041
42+
43+
# compress files
44+
# at the moment, only supports gzip
45+
#
46+
# type: object
47+
compression:
48+
# activates the compression
49+
#
50+
# type: bool
51+
# default: false
52+
compress: false
53+
54+
# valid values are:
55+
# -> "NoCompression"
56+
# -> "BestSpeed"
57+
# -> "BestCompression"
58+
# -> "DefaultCompression" or ""
59+
#
60+
# type: string
61+
# default: "DefaultCompression" # when: Compress == true && Method == ""
62+
method: ""
63+
64+
# true = do it yourself (the file is written as gzip compressed file into the memory file system)
65+
# false = decompress files at run time (while writing file into memory file system)
66+
#
67+
# type: bool
68+
# default: false
69+
keep: false
70+
71+
# ---------------
72+
# -- DANGEROUS --
73+
# ---------------
74+
#
75+
# cleans the destination folder (only b0xfiles)
76+
# you should use this when using the spread function
77+
# type: bool
78+
# default: false
79+
clean: false
80+
81+
# default: ab0x.go
82+
output: "ab0x.go"
83+
84+
# [noprefix] disables adding "a" prefix to output
85+
# type: bool
86+
# default: false
87+
noprefix: false
88+
89+
# [unexporTed] builds non-exporTed functions, variables and types...
90+
# type: bool
91+
# default: false
92+
unexporTed: false
93+
94+
# [spread] means it will make a file to hold all fileb0x data
95+
# and each file into a separaTed .go file
96+
#
97+
# example:
98+
# theres 2 files in the folder assets, they're: hello.json and world.txt
99+
# when spread is activaTed, fileb0x will make a file:
100+
# b0x.go or [output]'s data, assets_hello.json.go and assets_world.txt.go
101+
#
102+
#
103+
# type: bool
104+
# default: false
105+
spread: true
106+
107+
# [lcf] log changed files when spread is active
108+
lcf: true
109+
110+
# [debug] is a debug mode where the files are read directly from the file
111+
# sytem. Useful for web dev when files change when the server is running.
112+
# type: bool
113+
# default: false
114+
debug: false
115+
116+
# type: array of objects
117+
custom:
118+
- files:
119+
- "./swagger-ui/"
120+
121+
base: ""
122+
prefix: ""

ab0x.go static/ab0x.go

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

b0xfile_swagger-ui_favicon-16x16.png.go static/b0xfile_swagger-ui_favicon-16x16.png.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Code generaTed by fileb0x at "2022-09-01 14:22:46.842727 +0300 +03 m=+0.119989669" from config file "b0x.yaml" DO NOT EDIT.
1+
// Code generaTed by fileb0x at "2022-09-01 14:58:09.778032 +0300 +03 m=+0.096686741" from config file "b0x.yaml" DO NOT EDIT.
22
// modified(2022-09-01 13:54:08.505951782 +0300 +03)
33
// original path: swagger-ui/favicon-16x16.png
44

b0xfile_swagger-ui_favicon-32x32.png.go static/b0xfile_swagger-ui_favicon-32x32.png.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Code generaTed by fileb0x at "2022-09-01 14:22:46.751308 +0300 +03 m=+0.028572708" from config file "b0x.yaml" DO NOT EDIT.
1+
// Code generaTed by fileb0x at "2022-09-01 14:58:09.777443 +0300 +03 m=+0.096097214" from config file "b0x.yaml" DO NOT EDIT.
22
// modified(2022-09-01 13:54:08.540047447 +0300 +03)
33
// original path: swagger-ui/favicon-32x32.png
44

b0xfile_swagger-ui_index.css.go static/b0xfile_swagger-ui_index.css.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Code generaTed by fileb0x at "2022-09-01 14:22:46.84184 +0300 +03 m=+0.119103106" from config file "b0x.yaml" DO NOT EDIT.
1+
// Code generaTed by fileb0x at "2022-09-01 14:58:09.779112 +0300 +03 m=+0.097766000" from config file "b0x.yaml" DO NOT EDIT.
22
// modified(2022-09-01 13:54:08.571317329 +0300 +03)
33
// original path: swagger-ui/index.css
44

b0xfile_swagger-ui_index.html.go static/b0xfile_swagger-ui_index.html.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Code generaTed by fileb0x at "2022-09-01 14:22:46.751713 +0300 +03 m=+0.028977434" from config file "b0x.yaml" DO NOT EDIT.
1+
// Code generaTed by fileb0x at "2022-09-01 14:58:09.778658 +0300 +03 m=+0.097312151" from config file "b0x.yaml" DO NOT EDIT.
22
// modified(2022-09-01 13:54:08.609818059 +0300 +03)
33
// original path: swagger-ui/index.html
44

b0xfile_swagger-ui_oauth2-redirect.html.go static/b0xfile_swagger-ui_oauth2-redirect.html.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Code generaTed by fileb0x at "2022-09-01 14:22:46.75077 +0300 +03 m=+0.028034482" from config file "b0x.yaml" DO NOT EDIT.
1+
// Code generaTed by fileb0x at "2022-09-01 14:58:09.776921 +0300 +03 m=+0.095575692" from config file "b0x.yaml" DO NOT EDIT.
22
// modified(2022-09-01 13:54:08.642606241 +0300 +03)
33
// original path: swagger-ui/oauth2-redirect.html
44

b0xfile_swagger-ui_swagger-initializer.js.go static/b0xfile_swagger-ui_swagger-initializer.js.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Code generaTed by fileb0x at "2022-09-01 14:22:46.84237 +0300 +03 m=+0.119632847" from config file "b0x.yaml" DO NOT EDIT.
1+
// Code generaTed by fileb0x at "2022-09-01 14:58:09.779485 +0300 +03 m=+0.098139100" from config file "b0x.yaml" DO NOT EDIT.
22
// modified(2022-09-01 13:54:08.671292838 +0300 +03)
33
// original path: swagger-ui/swagger-initializer.js
44

b0xfile_swagger-ui_swagger-ui-bundle.js.go static/b0xfile_swagger-ui_swagger-ui-bundle.js.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Code generaTed by fileb0x at "2022-09-01 14:22:46.874034 +0300 +03 m=+0.151296284" from config file "b0x.yaml" DO NOT EDIT.
1+
// Code generaTed by fileb0x at "2022-09-01 14:58:09.708361 +0300 +03 m=+0.027017375" from config file "b0x.yaml" DO NOT EDIT.
22
// modified(2022-09-01 13:54:08.702131883 +0300 +03)
33
// original path: swagger-ui/swagger-ui-bundle.js
44

b0xfile_swagger-ui_swagger-ui-es-bundle-core.js.go static/b0xfile_swagger-ui_swagger-ui-es-bundle-core.js.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Code generaTed by fileb0x at "2022-09-01 14:22:46.855539 +0300 +03 m=+0.132802070" from config file "b0x.yaml" DO NOT EDIT.
1+
// Code generaTed by fileb0x at "2022-09-01 14:58:09.844446 +0300 +03 m=+0.163098273" from config file "b0x.yaml" DO NOT EDIT.
22
// modified(2022-09-01 13:54:08.729987801 +0300 +03)
33
// original path: swagger-ui/swagger-ui-es-bundle-core.js
44

b0xfile_swagger-ui_swagger-ui-es-bundle.js.go static/b0xfile_swagger-ui_swagger-ui-es-bundle.js.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Code generaTed by fileb0x at "2022-09-01 14:22:46.778693 +0300 +03 m=+0.055957482" from config file "b0x.yaml" DO NOT EDIT.
1+
// Code generaTed by fileb0x at "2022-09-01 14:58:09.77981 +0300 +03 m=+0.098463918" from config file "b0x.yaml" DO NOT EDIT.
22
// modified(2022-09-01 13:54:08.758549377 +0300 +03)
33
// original path: swagger-ui/swagger-ui-es-bundle.js
44

b0xfile_swagger-ui_swagger-ui-standalone-preset.js.go static/b0xfile_swagger-ui_swagger-ui-standalone-preset.js.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Code generaTed by fileb0x at "2022-09-01 14:22:46.760136 +0300 +03 m=+0.037400801" from config file "b0x.yaml" DO NOT EDIT.
1+
// Code generaTed by fileb0x at "2022-09-01 14:58:09.762945 +0300 +03 m=+0.081600241" from config file "b0x.yaml" DO NOT EDIT.
22
// modified(2022-09-01 13:54:08.783022703 +0300 +03)
33
// original path: swagger-ui/swagger-ui-standalone-preset.js
44

b0xfile_swagger-ui_swagger-ui.css.go static/b0xfile_swagger-ui_swagger-ui.css.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Code generaTed by fileb0x at "2022-09-01 14:22:46.752089 +0300 +03 m=+0.029353208" from config file "b0x.yaml" DO NOT EDIT.
1+
// Code generaTed by fileb0x at "2022-09-01 14:58:09.701906 +0300 +03 m=+0.020562701" from config file "b0x.yaml" DO NOT EDIT.
22
// modified(2022-09-01 13:54:08.80609813 +0300 +03)
33
// original path: swagger-ui/swagger-ui.css
44

b0xfile_swagger-ui_swagger-ui.js.go static/b0xfile_swagger-ui_swagger-ui.js.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Code generaTed by fileb0x at "2022-09-01 14:22:46.843086 +0300 +03 m=+0.120348784" from config file "b0x.yaml" DO NOT EDIT.
1+
// Code generaTed by fileb0x at "2022-09-01 14:58:09.830161 +0300 +03 m=+0.148814603" from config file "b0x.yaml" DO NOT EDIT.
22
// modified(2022-09-01 13:54:08.839279294 +0300 +03)
33
// original path: swagger-ui/swagger-ui.js
44

fileb0x.go static/fileb0x.go

File renamed without changes.

swagger-ui/favicon-16x16.png

665 Bytes
Loading

swagger-ui/favicon-32x32.png

628 Bytes
Loading

swagger-ui/index.css

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
html {
2+
box-sizing: border-box;
3+
overflow: -moz-scrollbars-vertical;
4+
overflow-y: scroll;
5+
}
6+
7+
*,
8+
*:before,
9+
*:after {
10+
box-sizing: inherit;
11+
}
12+
13+
body {
14+
margin: 0;
15+
background: #fafafa;
16+
}

swagger-ui/index.html

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<!-- HTML for static distribution bundle build -->
2+
<!DOCTYPE html>
3+
<html lang="en">
4+
<head>
5+
<meta charset="UTF-8">
6+
<title>Swagger UI</title>
7+
<link rel="stylesheet" type="text/css" href="./swagger-ui.css" />
8+
<link rel="stylesheet" type="text/css" href="index.css" />
9+
<link rel="icon" type="image/png" href="./favicon-32x32.png" sizes="32x32" />
10+
<link rel="icon" type="image/png" href="./favicon-16x16.png" sizes="16x16" />
11+
</head>
12+
13+
<body>
14+
<div id="swagger-ui"></div>
15+
<script src="./swagger-ui-bundle.js" charset="UTF-8"> </script>
16+
<script src="./swagger-ui-standalone-preset.js" charset="UTF-8"> </script>
17+
<script src="./swagger-initializer.js" charset="UTF-8"> </script>
18+
</body>
19+
</html>

swagger-ui/oauth2-redirect.html

+79
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
<!doctype html>
2+
<html lang="en-US">
3+
<head>
4+
<title>Swagger UI: OAuth2 Redirect</title>
5+
</head>
6+
<body>
7+
<script>
8+
'use strict';
9+
function run () {
10+
var oauth2 = window.opener.swaggerUIRedirectOauth2;
11+
var sentState = oauth2.state;
12+
var redirectUrl = oauth2.redirectUrl;
13+
var isValid, qp, arr;
14+
15+
if (/code|token|error/.test(window.location.hash)) {
16+
qp = window.location.hash.substring(1).replace('?', '&');
17+
} else {
18+
qp = location.search.substring(1);
19+
}
20+
21+
arr = qp.split("&");
22+
arr.forEach(function (v,i,_arr) { _arr[i] = '"' + v.replace('=', '":"') + '"';});
23+
qp = qp ? JSON.parse('{' + arr.join() + '}',
24+
function (key, value) {
25+
return key === "" ? value : decodeURIComponent(value);
26+
}
27+
) : {};
28+
29+
isValid = qp.state === sentState;
30+
31+
if ((
32+
oauth2.auth.schema.get("flow") === "accessCode" ||
33+
oauth2.auth.schema.get("flow") === "authorizationCode" ||
34+
oauth2.auth.schema.get("flow") === "authorization_code"
35+
) && !oauth2.auth.code) {
36+
if (!isValid) {
37+
oauth2.errCb({
38+
authId: oauth2.auth.name,
39+
source: "auth",
40+
level: "warning",
41+
message: "Authorization may be unsafe, passed state was changed in server. The passed state wasn't returned from auth server."
42+
});
43+
}
44+
45+
if (qp.code) {
46+
delete oauth2.state;
47+
oauth2.auth.code = qp.code;
48+
oauth2.callback({auth: oauth2.auth, redirectUrl: redirectUrl});
49+
} else {
50+
let oauthErrorMsg;
51+
if (qp.error) {
52+
oauthErrorMsg = "["+qp.error+"]: " +
53+
(qp.error_description ? qp.error_description+ ". " : "no accessCode received from the server. ") +
54+
(qp.error_uri ? "More info: "+qp.error_uri : "");
55+
}
56+
57+
oauth2.errCb({
58+
authId: oauth2.auth.name,
59+
source: "auth",
60+
level: "error",
61+
message: oauthErrorMsg || "[Authorization failed]: no accessCode received from the server."
62+
});
63+
}
64+
} else {
65+
oauth2.callback({auth: oauth2.auth, token: qp, isValid: isValid, redirectUrl: redirectUrl});
66+
}
67+
window.close();
68+
}
69+
70+
if (document.readyState !== 'loading') {
71+
run();
72+
} else {
73+
document.addEventListener('DOMContentLoaded', function () {
74+
run();
75+
});
76+
}
77+
</script>
78+
</body>
79+
</html>

swagger-ui/swagger-initializer.js

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
window.onload = function () {
2+
//<editor-fold desc="Changeable Configuration Block">
3+
4+
// the following lines will be replaced by docker/configurator, when it runs in a docker-container
5+
window.ui = SwaggerUIBundle({
6+
url: "doc.json",
7+
dom_id: "#swagger-ui",
8+
deepLinking: true,
9+
presets: [SwaggerUIBundle.presets.apis, SwaggerUIStandalonePreset],
10+
plugins: [SwaggerUIBundle.plugins.DownloadUrl],
11+
layout: "StandaloneLayout",
12+
});
13+
14+
//</editor-fold>
15+
};

swagger-ui/swagger-ui-bundle.js

+3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

swagger-ui/swagger-ui-es-bundle-core.js

+3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

swagger-ui/swagger-ui-es-bundle.js

+3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

swagger-ui/swagger-ui-standalone-preset.js

+3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

swagger-ui/swagger-ui.css

+4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

swagger-ui/swagger-ui.js

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)