-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: brand new multiregion API doc client-side renderer with tryit e…
…ditor code examples and merge of all microservice manifests into a single searchable+filterable page
- Loading branch information
1 parent
2d01430
commit 04ba971
Showing
34 changed files
with
8,398 additions
and
168 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Sekoia.io OpenAPI Viewer library | ||
|
||
This viewer library is a Sekoia.io custom instrumentation of [Redoc](https://github.com/Redocly/redoc), providing | ||
* easier navigation in a large API doc using OpenAPI 3.1 tags and tagGroups | ||
* client-side merging of several OpenAPI/Swagger manifests | ||
* hosting region selector | ||
* plans and permissions handling | ||
* in-browser try-it editor | ||
|
||
Any update to this library's code should be **compiled before commit**. | ||
The compiled library [../openapi-viewer.js](../openapi-viewer.js) is versioned and pushed to this repo to keep our Documentation repo dependency-free. | ||
|
||
If you need to modify the library's code please run | ||
```bash | ||
yarn | ||
yarn build | ||
``` | ||
to compile [../openapi-viewer.js](../openapi-viewer.js) | ||
|
||
For best DX, you may use the webpack devserver via | ||
```bash | ||
yarn | ||
yarn start | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
module.exports = { | ||
presets: ["@vue/cli-plugin-babel/preset"], | ||
plugins: ["@vue/babel-plugin-jsx"], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ | ||
"name": "openapi-viewer", | ||
"version": "1.0.0", | ||
"license": "MIT", | ||
"scripts": { | ||
"start": "vue-cli-service serve --host 127.0.0.1", | ||
"build": "vue-cli-service build && cp -f dist/openapi-viewer.min.js ../../docs/javascript/openapi-viewer.min.js", | ||
"lint": "vue-cli-service lint" | ||
}, | ||
"dependencies": { | ||
"@babel/core": "^7.19.3", | ||
"@highlightjs/vue-plugin": "^2.1.0", | ||
"@vue/babel-plugin-jsx": "^1.1.1", | ||
"chartjs-adapter-moment": "^1.0.1", | ||
"codemirror": "^5.49.2", | ||
"dompurify": "^3.2.1", | ||
"marked": "^15.0.2", | ||
"moment": "^2.30.1", | ||
"vue": "^3.2.41", | ||
"vue-router": "^4.1.5", | ||
"vue-tippy": "^6.5.0" | ||
}, | ||
"devDependencies": { | ||
"@vue/cli-plugin-babel": "^5.0.8", | ||
"@vue/cli-service": "^5.0.8", | ||
"@vue/compiler-sfc": "^3.2.41", | ||
"sass": "^1.55.0", | ||
"sass-loader": "^13.1.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/** A Vue component using highlightjs for syntax highlighting of code blocks */ | ||
export const Code = ({ src, lang }) => <highlightjs language={lang} code={src} /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { ref } from "vue"; | ||
import { useTippy } from "vue-tippy"; | ||
import 'tippy.js/animations/shift-away.css'; | ||
import "./Dropdown.scss" | ||
|
||
/** A Dropdown Vue component */ | ||
export const Dropdown = { | ||
props: ["button", "class", "content"], | ||
setup(props, { slots }) { | ||
const target = ref(null) | ||
const { show } = useTippy(target, { | ||
trigger: "manual", | ||
interactive: true, | ||
placement: "bottom-start", | ||
offset: [0, 4], | ||
animation: "shift-away", | ||
maxWidth: 'none', | ||
content: { | ||
setup() { | ||
return () => <div class={props.class}> | ||
{props.content} | ||
</div> | ||
} | ||
}, | ||
}); | ||
|
||
return () => { | ||
return <button ref={target} class='dropdown-button' class={props.class} onClick={() => show()}> | ||
{props.button} | ||
</button> | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.dropdown-button { | ||
cursor: pointer; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
/** Vue component to render documentation for an error code */ | ||
export const Error = ({ code, response }) => <div class="response error"> | ||
<span class='status-code'>{code}</span> | ||
<div>{response?.description}</div> | ||
</div> |
Oops, something went wrong.