Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
frontend
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
vicotor
frontend
Commits
5609bcf3
Commit
5609bcf3
authored
Feb 16, 2023
by
isstuev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
swagger-ui
parent
0063a3fa
Changes
8
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
3929 additions
and
27 deletions
+3929
-27
values.yaml
deploy/values/review/values.yaml
+1
-0
spec.json
lib/spec.json
+3162
-0
next.config.js
next.config.js
+7
-2
package.json
package.json
+3
-0
api-docs.tsx
pages/api-docs.tsx
+24
-0
nextjs-routes.d.ts
types/nextjs-routes.d.ts
+1
-0
SwaggerUI.tsx
ui/SwaggerUI.tsx
+55
-0
yarn.lock
yarn.lock
+676
-25
No files found.
deploy/values/review/values.yaml
View file @
5609bcf3
...
@@ -327,6 +327,7 @@ frontend:
...
@@ -327,6 +327,7 @@ frontend:
-
"
/tokens"
-
"
/tokens"
-
"
/accounts"
-
"
/accounts"
-
"
/visualize"
-
"
/visualize"
-
"
/api-docs"
resources
:
resources
:
limits
:
limits
:
...
...
lib/spec.json
0 → 100644
View file @
5609bcf3
This diff is collapsed.
Click to expand it.
next.config.js
View file @
5609bcf3
const
withTM
=
require
(
'
next-transpile-modules
'
)([
'
react-syntax-highlighter
'
,
'
swagger-client
'
,
'
swagger-ui-react
'
,
]);
const
withRoutes
=
require
(
'
nextjs-routes/config
'
)({
const
withRoutes
=
require
(
'
nextjs-routes/config
'
)({
outDir
:
'
types
'
,
outDir
:
'
types
'
,
});
});
...
@@ -7,7 +12,7 @@ const headers = require('./configs/nextjs/headers');
...
@@ -7,7 +12,7 @@ const headers = require('./configs/nextjs/headers');
const
redirects
=
require
(
'
./configs/nextjs/redirects
'
);
const
redirects
=
require
(
'
./configs/nextjs/redirects
'
);
const
rewrites
=
require
(
'
./configs/nextjs/rewrites
'
);
const
rewrites
=
require
(
'
./configs/nextjs/rewrites
'
);
const
moduleExports
=
{
const
moduleExports
=
withTM
(
{
include
:
path
.
resolve
(
__dirname
,
'
icons
'
),
include
:
path
.
resolve
(
__dirname
,
'
icons
'
),
reactStrictMode
:
true
,
reactStrictMode
:
true
,
webpack
(
config
,
{
webpack
})
{
webpack
(
config
,
{
webpack
})
{
...
@@ -39,6 +44,6 @@ const moduleExports = {
...
@@ -39,6 +44,6 @@ const moduleExports = {
// otherwise it is impossible to upload large files (over 1Mb)
// otherwise it is impossible to upload large files (over 1Mb)
bodyParser
:
false
,
bodyParser
:
false
,
},
},
};
}
)
;
module
.
exports
=
withRoutes
(
moduleExports
);
module
.
exports
=
withRoutes
(
moduleExports
);
package.json
View file @
5609bcf3
...
@@ -69,6 +69,7 @@
...
@@ -69,6 +69,7 @@
"
react-identicons
"
:
"
^1.2.5
"
,
"
react-identicons
"
:
"
^1.2.5
"
,
"
react-jazzicon
"
:
"
^1.0.4
"
,
"
react-jazzicon
"
:
"
^1.0.4
"
,
"
react-scroll
"
:
"
^1.8.7
"
,
"
react-scroll
"
:
"
^1.8.7
"
,
"
swagger-ui-react
"
:
"
^4.15.5
"
,
"
use-font-face-observer
"
:
"
^1.2.1
"
,
"
use-font-face-observer
"
:
"
^1.2.1
"
,
"
wagmi
"
:
"
^0.10.6
"
"
wagmi
"
:
"
^0.10.6
"
},
},
...
@@ -85,6 +86,7 @@
...
@@ -85,6 +86,7 @@
"
@types/qrcode
"
:
"
^1.5.0
"
,
"
@types/qrcode
"
:
"
^1.5.0
"
,
"
@types/react
"
:
"
18.0.9
"
,
"
@types/react
"
:
"
18.0.9
"
,
"
@types/react-dom
"
:
"
18.0.5
"
,
"
@types/react-dom
"
:
"
18.0.5
"
,
"
@types/swagger-ui-react
"
:
"
^4.11.0
"
,
"
@types/ws
"
:
"
^8.5.3
"
,
"
@types/ws
"
:
"
^8.5.3
"
,
"
@typescript-eslint/eslint-plugin
"
:
"
^5.27.0
"
,
"
@typescript-eslint/eslint-plugin
"
:
"
^5.27.0
"
,
"
dotenv-cli
"
:
"
^6.0.0
"
,
"
dotenv-cli
"
:
"
^6.0.0
"
,
...
@@ -100,6 +102,7 @@
...
@@ -100,6 +102,7 @@
"
jest-environment-jsdom
"
:
"
^29.2.1
"
,
"
jest-environment-jsdom
"
:
"
^29.2.1
"
,
"
lint-staged
"
:
"
>=10
"
,
"
lint-staged
"
:
"
>=10
"
,
"
mockdate
"
:
"
^3.0.5
"
,
"
mockdate
"
:
"
^3.0.5
"
,
"
next-transpile-modules
"
:
"
^10.0.0
"
,
"
playwright
"
:
"
^1.28.0
"
,
"
playwright
"
:
"
^1.28.0
"
,
"
svgo
"
:
"
^2.8.0
"
,
"
svgo
"
:
"
^2.8.0
"
,
"
ts-jest
"
:
"
^29.0.3
"
,
"
ts-jest
"
:
"
^29.0.3
"
,
...
...
pages/api-docs.tsx
0 → 100644
View file @
5609bcf3
import
type
{
NextPage
}
from
'
next
'
;
import
Head
from
'
next/head
'
;
import
React
from
'
react
'
;
import
getNetworkTitle
from
'
lib/networks/getNetworkTitle
'
;
import
Page
from
'
ui/shared/Page/Page
'
;
import
PageTitle
from
'
ui/shared/Page/PageTitle
'
;
import
SwaggerUI
from
'
ui/SwaggerUI
'
;
const
AppsPage
:
NextPage
=
()
=>
{
const
networkTitle
=
getNetworkTitle
();
return
(
<
Page
>
<
PageTitle
text=
"API Documentation"
/>
<
Head
><
title
>
{
`API for the ${ networkTitle }`
}
</
title
></
Head
>
<
SwaggerUI
/>
</
Page
>
);
};
export
default
AppsPage
;
export
{
getServerSideProps
}
from
'
lib/next/getServerSideProps
'
;
types/nextjs-routes.d.ts
View file @
5609bcf3
...
@@ -16,6 +16,7 @@ declare module "nextjs-routes" {
...
@@ -16,6 +16,7 @@ declare module "nextjs-routes" {
|
DynamicRoute
<
"
/address/[hash]
"
,
{
"
hash
"
:
string
}
>
|
DynamicRoute
<
"
/address/[hash]
"
,
{
"
hash
"
:
string
}
>
|
StaticRoute
<
"
/api/csrf
"
>
|
StaticRoute
<
"
/api/csrf
"
>
|
StaticRoute
<
"
/api/proxy
"
>
|
StaticRoute
<
"
/api/proxy
"
>
|
StaticRoute
<
"
/api-docs
"
>
|
DynamicRoute
<
"
/apps/[id]
"
,
{
"
id
"
:
string
}
>
|
DynamicRoute
<
"
/apps/[id]
"
,
{
"
id
"
:
string
}
>
|
StaticRoute
<
"
/apps
"
>
|
StaticRoute
<
"
/apps
"
>
|
StaticRoute
<
"
/auth/auth0
"
>
|
StaticRoute
<
"
/auth/auth0
"
>
...
...
ui/SwaggerUI.tsx
0 → 100644
View file @
5609bcf3
/* eslint-disable @typescript-eslint/naming-convention */
const
SwaggerUIReact
=
dynamic
(()
=>
import
(
'
swagger-ui-react
'
),
{
loading
:
()
=>
<
Spinner
/>,
ssr
:
false
,
});
import
{
Box
,
Spinner
,
useColorModeValue
}
from
'
@chakra-ui/react
'
;
import
dynamic
from
'
next/dynamic
'
;
import
React
from
'
react
'
;
import
spec
from
'
../lib/spec.json
'
;
import
'
swagger-ui-react/swagger-ui.css
'
;
const
NeverShowInfoPlugin
=
()
=>
{
return
{
components
:
{
SchemesContainer
:
()
=>
null
,
ServersContainer
:
()
=>
null
,
InfoContainer
:
()
=>
null
,
},
};
};
const
SwaggerUI
=
()
=>
{
const
swaggerStyle
=
{
'
.scheme-container, .opblock-tag
'
:
{
display
:
'
none
'
,
},
'
.swagger-ui
'
:
{
color
:
useColorModeValue
(
'
blackAlpha.800
'
,
'
whiteAlpha.800
'
),
},
'
.swagger-ui .opblock-summary-control:focus
'
:
{
outline
:
'
none
'
,
},
// eslint-disable-next-line max-len
'
.swagger-ui .opblock .opblock-summary-path, .swagger-ui .opblock .opblock-summary-description, .swagger-ui div, .swagger-ui p, .swagger-ui h5, .swagger-ui .response-col_links, .swagger-ui h4, .swagger-ui table thead tr th, .swagger-ui table thead tr td, .swagger-ui .parameter__name, .swagger-ui .parameter__type, .swagger-ui .response-col_status, .swagger-ui .tab li, .swagger-ui .opblock .opblock-section-header h4
'
:
{
color
:
'
unset
'
,
},
'
.swagger-ui input
'
:
{
color
:
'
blackAlpha.800
'
,
},
'
.swagger-ui .opblock .opblock-section-header
'
:
{
background
:
useColorModeValue
(
'
whiteAlpha.800
'
,
'
blackAlpha.800
'
),
},
};
return
(
<
Box
sx=
{
swaggerStyle
}
>
<
SwaggerUIReact
spec=
{
spec
}
plugins=
{
[
NeverShowInfoPlugin
]
}
/>
</
Box
>
);
};
export
default
SwaggerUI
;
yarn.lock
View file @
5609bcf3
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment