Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Deploy to GitHub Pages

on:
push:
branches: [ main ]

jobs:
build-and-deploy:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'

- name: Enable Corepack
run: corepack enable

- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Build
run: yarn build
env:
NODE_ENV: production

- name: Deploy to GitHub Pages
if: github.ref == 'refs/heads/main'
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist
29 changes: 29 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Yarn
.pnp.cjs
.pnp.loader.mjs
.yarn

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
2 changes: 2 additions & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
22.19.0

1 change: 0 additions & 1 deletion CNAME

This file was deleted.

57 changes: 57 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# WEKA REST API Documentation

A documentation viewer for the WEKA REST API across multiple versions. This project provides an interactive Swagger UI interface to explore and understand the WEKA system's RESTful API capabilities.

All API documentation files are stored in `/public/docs/` as JSON files.

## Contributing

When adding new API documentation versions:

1. Place the new JSON file in `/public/docs/`
2. Update the `urls` array in `src/main.js` to include the new version
3. Follow the existing naming convention: `{version}.json`
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AriAttias I changed the folder structure to be able to update dependencies


## Getting Started

### Prerequisites

- Node.js (version specified in `.nvmrc`)
- Yarn package manager

### Installation

```bash
yarn install
```

### Development

```bash
yarn start
```

The application will be available at `http://localhost:5000` (or the next available port).

### Building for Production

```bash
yarn build
```

The built files will be generated in the `dist/` directory.

### Preview Production Build

```bash
yarn preview
```

### Deployment

This project is configured for automatic deployment to GitHub Pages via GitHub Actions. Simply push your changes to the `main` branch and the CI/CD pipeline will:

1. Build the application using `yarn build`
2. Deploy the built files to GitHub Pages automatically

No manual deployment commands are needed.
Binary file removed favicon-16x16.png
Binary file not shown.
69 changes: 6 additions & 63 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,70 +1,13 @@
<!-- 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="icon" type="image/png" href="./favicon-32x32.png" sizes="32x32" />
<link rel="icon" type="image/png" href="./favicon-16x16.png" sizes="16x16" />
<style>
html
{
box-sizing: border-box;
overflow: -moz-scrollbars-vertical;
overflow-y: scroll;
}

*,
*:before,
*:after
{
box-sizing: inherit;
}

body
{
margin:0;
background: #fafafa;
}
</style>
<meta charset="UTF-8" />
<link rel="icon" type="image/png" href="/favicon-32x32.png" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite App</title>
</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>
window.onload = function() {
// Begin Swagger UI call region
const ui = SwaggerUIBundle({
//url: "https://petstore.swagger.io/v2/swagger.json",
urls: [
{url: "5.0.json", name: "5.0"},
{url: "4.4.json", name: "4.4"},
{url: "4.3.json", name: "4.3"},
{url: "4.2.json", name: "4.2"},
{url: "4.1.json", name: "4.1"},
{url: "4.0.json", name: "4.0"},
{url: "3.14.json", name: "3.14"},
],
"urls.primaryName": "5.0",
dom_id: '#swagger-ui',
deepLinking: true,
presets: [
SwaggerUIBundle.presets.apis,
SwaggerUIStandalonePreset
],
plugins: [
SwaggerUIBundle.plugins.DownloadUrl
],
layout: "StandaloneLayout"
});
// End Swagger UI call region

window.ui = ui;
};
</script>
<div id="app"></div>
<script type="module" src="/src/main.js"></script>
</body>
</html>
75 changes: 0 additions & 75 deletions oauth2-redirect.html

This file was deleted.

27 changes: 27 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"name": "weka-rest-api-docs",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"start": "vite",
"build": "vite build",
"preview": "vite preview"
},
"dependencies": {
"@swagger-api/apidom-core": "^1.0.0-beta.48",
"buffer": "^6.0.3",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"swagger-ui": "^5.29.0",
"to-buffer": "^1.2.1"
},
"devDependencies": {
"vite": "^7.1.2"
},
"resolutions": {
"react": "^18.3.1",
"react-dom": "^18.3.1"
},
"packageManager": "yarn@4.9.3+sha512.8295ee814f6b253e16f516416481b481a215ed03ef1ae38524d108084872560a9ed75aeb23b91ab64222062ac4149a594150ae538c2a9536fdbcefd4e49b11cc"
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
9 changes: 9 additions & 0 deletions src/counter.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export function setupCounter(element) {
let counter = 0
const setCounter = (count) => {
counter = count
element.innerHTML = `count is ${counter}`
}
element.addEventListener('click', () => setCounter(counter + 1))
setCounter(0)
}
1 change: 1 addition & 0 deletions src/javascript.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 22 additions & 0 deletions src/main.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
body {
margin: 0 !important;
}

/* Hide authorization elements in SwaggerUI */
.auth-wrapper,
.authorize,
.btn.authorize,
.auth-btn-wrapper,
.authorization__btn,
.scheme-container,
.auth-container {
display: none !important;
}

/* Hide try it out elements */
.try-out,
.try-out__btn,
.execute-wrapper,
.btn.execute {
display: none !important;
}
35 changes: 35 additions & 0 deletions src/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import SwaggerUI from "swagger-ui";
import SwaggerUIStandalonePreset from "swagger-ui/dist/swagger-ui-standalone-preset";

import "swagger-ui/dist/swagger-ui.css";
import "./main.css";

SwaggerUI({
dom_id: "#app",
urls: [
{ url: "/docs/5.0.json", name: "5.0" },
{ url: "/docs/4.4.json", name: "4.4" },
{ url: "/docs/4.3.json", name: "4.3" },
{ url: "/docs/4.2.json", name: "4.2" },
{ url: "/docs/4.1.json", name: "4.1" },
{ url: "/docs/4.0.json", name: "4.0" },
{ url: "/docs/3.14.json", name: "3.14" },
{ url: "/docs/3.13.json", name: "3.13" },
{ url: "/docs/3.12.json", name: "3.12" },
{ url: "/docs/3.11.json", name: "3.11" },
],
"urls.primaryName": "5.0",
deepLinking: true,
presets: [SwaggerUI.presets.apis, SwaggerUIStandalonePreset],
plugins: [SwaggerUI.plugins.DownloadUrl].filter(
(plugin) => plugin !== SwaggerUI.plugins.Auth
),
layout: "StandaloneLayout",
supportedSubmitMethods: [],
showCommonExtensions: true,
showExtensions: true,
filter: true,
tryItOutEnabled: false,
persistAuthorization: false,
withCredentials: false,
});
3 changes: 0 additions & 3 deletions swagger-ui-bundle.js

This file was deleted.

1 change: 0 additions & 1 deletion swagger-ui-bundle.js.map

This file was deleted.

3 changes: 0 additions & 3 deletions swagger-ui-es-bundle-core.js

This file was deleted.

1 change: 0 additions & 1 deletion swagger-ui-es-bundle-core.js.map

This file was deleted.

3 changes: 0 additions & 3 deletions swagger-ui-es-bundle.js

This file was deleted.

1 change: 0 additions & 1 deletion swagger-ui-es-bundle.js.map

This file was deleted.

3 changes: 0 additions & 3 deletions swagger-ui-standalone-preset.js

This file was deleted.

1 change: 0 additions & 1 deletion swagger-ui-standalone-preset.js.map

This file was deleted.

4 changes: 0 additions & 4 deletions swagger-ui.css

This file was deleted.

1 change: 0 additions & 1 deletion swagger-ui.css.map

This file was deleted.

3 changes: 0 additions & 3 deletions swagger-ui.js

This file was deleted.

1 change: 0 additions & 1 deletion swagger-ui.js.map

This file was deleted.

Loading