-
Notifications
You must be signed in to change notification settings - Fork 0
/
client.html
34 lines (31 loc) · 12.7 KB
/
client.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="UTF-8">
<title>Aqueduct OpenAPI Client</title>
<link rel="stylesheet" type="text/css" href="https://unpkg.com/swagger-ui-dist@3.12.1/swagger-ui.css">
</head>
<body>
<div id="swagger-ui"></div>
<script src="https://unpkg.com/swagger-ui-dist@3.12.1/swagger-ui-standalone-preset.js"></script>
<script src="https://unpkg.com/swagger-ui-dist@3.12.1/swagger-ui-bundle.js"></script>
<script>
window.onload = function () {
const ui = SwaggerUIBundle({
spec: { "openapi": "3.0.0", "info": { "title": "UG Covid-19 API", "description": "An API that provides access to information and statistics regarding the Covid-19(Coronavirus) pandemic as it relates to Uganda.", "version": "0.0.1+4", "contact": { "name": "Jonathan Musiitwa", "email": "jonamusiitwa@outlook.com" } }, "servers": [{ "url": "http://localhost:8888" }], "paths": { "/summary": { "parameters": [], "get": { "tags": ["Summary"], "operationId": "getSummary", "parameters": [], "responses": { "200": { "description": "Successful response." } } }, "put": { "tags": ["Summary"], "operationId": "updateSummary", "parameters": [], "responses": { "200": { "description": "Successful response." } } } }, "/districts": { "parameters": [], "get": { "tags": ["DistrictCases"], "operationId": "getDistricts", "parameters": [], "responses": { "200": { "description": "Successful response." } } }, "post": { "tags": ["DistrictCases"], "operationId": "addDistrict", "parameters": [], "responses": { "200": { "description": "Successful response." } } } }, "/districts/{district_name}": { "parameters": [{ "name": "district_name", "in": "path", "required": true, "schema": { "type": "string" } }], "get": { "tags": ["DistrictCases"], "operationId": "getDistrictByName", "parameters": [{ "name": "district_name", "in": "path", "required": true, "schema": { "type": "string" } }], "responses": { "200": { "description": "Successful response." } } }, "put": { "tags": ["DistrictCases"], "operationId": "updateDistrictByName", "parameters": [{ "name": "district_name", "in": "path", "required": true, "schema": { "type": "string" } }], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DistrictCases" } } } }, "responses": { "200": { "description": "Successful response." } } } }, "/hospitals": { "parameters": [], "get": { "tags": ["HospitalCases"], "operationId": "getHospitalCases", "parameters": [], "responses": { "200": { "description": "Successful response." } } }, "post": { "tags": ["HospitalCases"], "operationId": "addHospital", "parameters": [], "responses": { "200": { "description": "Successful response." } } } }, "/hospitals/{hospital_name}": { "parameters": [{ "name": "hospital_name", "in": "path", "required": true, "schema": { "type": "string" } }], "get": { "tags": ["HospitalCases"], "operationId": "getHospitalByName", "parameters": [{ "name": "hospital_name", "in": "path", "required": true, "schema": { "type": "string" } }], "responses": { "200": { "description": "Successful response." } } }, "put": { "tags": ["HospitalCases"], "operationId": "updateHospital", "parameters": [{ "name": "hospital_name", "in": "path", "required": true, "schema": { "type": "string" } }], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HospitalCases" } } } }, "responses": { "200": { "description": "Successful response." } } } }, "/timeline": { "parameters": [], "get": { "tags": ["Timeline"], "operationId": "getTimeline", "parameters": [], "responses": { "200": { "description": "Successful response." } } }, "post": { "tags": ["Timeline"], "operationId": "addTimelineEntry", "parameters": [], "responses": { "200": { "description": "Successful response." } } } }, "/agegenderstats": { "parameters": [], "get": { "tags": ["AgeGender"], "operationId": "getAgeGenderStats", "parameters": [], "responses": { "200": { "description": "Successful response." } } }, "post": { "tags": ["AgeGender"], "operationId": "addAgeGenderEntry", "parameters": [], "responses": { "200": { "description": "Successful response." } } } }, "/agegenderstats/{age_group}": { "parameters": [{ "name": "age_group", "in": "path", "required": true, "schema": { "type": "string" } }], "get": { "tags": ["AgeGender"], "operationId": "getAgeGenderStatsByAgeGroup", "parameters": [{ "name": "age_group", "in": "path", "required": true, "schema": { "type": "string" } }], "responses": { "200": { "description": "Successful response." } } }, "put": { "tags": ["AgeGender"], "operationId": "updateAgeGenderStats", "parameters": [{ "name": "age_group", "in": "path", "required": true, "schema": { "type": "string" } }], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AgeGender" } } } }, "responses": { "200": { "description": "Successful response." } } } }, "/register": { "parameters": [], "post": { "tags": ["Register"], "operationId": "createAdmin", "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/User" } } } }, "responses": { "200": { "description": "Successful response." } } } }, "/auth/token": { "parameters": [], "post": { "tags": ["Auth"], "operationId": "grant", "parameters": [], "requestBody": { "required": true, "content": { "application/x-www-form-urlencoded": { "schema": { "required": ["grant_type"], "type": "object", "properties": { "username": { "type": "string" }, "password": { "type": "string", "format": "password" }, "refresh_token": { "type": "string" }, "code": { "type": "string" }, "grant_type": { "type": "string" }, "scope": { "type": "string" } } } } } }, "responses": { "200": { "description": "Successfully exchanged credentials for token", "content": { "application/json": { "schema": { "type": "object", "properties": { "access_token": { "type": "string" }, "token_type": { "type": "string" }, "expires_in": { "type": "integer" }, "refresh_token": { "type": "string" }, "scope": { "type": "string" } } } } } }, "400": { "description": "Invalid credentials or missing parameters.", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string" } } } } } } }, "security": [{ "oauth2-client-authentication": [] }] } }, "/example": { "parameters": [] }, "/": { "parameters": [] }, "/client": { "parameters": [] } }, "components": { "schemas": { "ManagedAuthClient": { "title": "ManagedAuthClient", "type": "object", "properties": { "id": { "title": "id", "type": "string", "description": "This is the primary identifier for this object.\n", "nullable": false }, "hashedSecret": { "title": "hashedSecret", "type": "string", "nullable": true }, "salt": { "title": "salt", "type": "string", "nullable": true }, "redirectURI": { "title": "redirectURI", "type": "string", "nullable": true }, "allowedScope": { "title": "allowedScope", "type": "string", "nullable": true }, "tokens": { "type": "array", "items": { "$ref": "#/components/schemas/ManagedAuthToken" }, "nullable": true, "readOnly": true } }, "description": "" }, "ManagedAuthToken": { "title": "ManagedAuthToken", "type": "object", "properties": { "id": { "title": "id", "type": "integer", "description": "This is the primary identifier for this object.\n", "nullable": false }, "code": { "title": "code", "type": "string", "description": "No two objects may have the same value for this field.\n", "nullable": true }, "accessToken": { "title": "accessToken", "type": "string", "description": "No two objects may have the same value for this field.\n", "nullable": true }, "refreshToken": { "title": "refreshToken", "type": "string", "description": "No two objects may have the same value for this field.\n", "nullable": true }, "scope": { "title": "scope", "type": "string", "nullable": true }, "issueDate": { "title": "issueDate", "type": "string", "format": "date-time", "nullable": false }, "expirationDate": { "title": "expirationDate", "type": "string", "format": "date-time", "nullable": false }, "type": { "title": "type", "type": "string", "nullable": true }, "resourceOwner": { "title": "resourceOwner", "type": "object", "properties": { "id": { "type": "integer" } } }, "client": { "title": "client", "type": "object", "properties": { "id": { "type": "string" } } } }, "description": "" }, "User": { "title": "User", "type": "object", "properties": { "password": { "title": "password", "type": "string", "nullable": false, "writeOnly": true }, "id": { "title": "id", "type": "integer", "description": "This is the primary identifier for this object.\n", "nullable": false }, "username": { "title": "username", "type": "string", "description": "No two objects may have the same value for this field.\n", "nullable": false }, "tokens": { "type": "array", "items": { "$ref": "#/components/schemas/ManagedAuthToken" }, "nullable": true, "readOnly": true } }, "description": "" }, "AgeGender": { "title": "AgeGender", "type": "object", "properties": { "id": { "title": "id", "type": "integer", "description": "This is the primary identifier for this object.\n", "nullable": false }, "ageGroup": { "title": "ageGroup", "type": "string", "nullable": false }, "male": { "title": "male", "type": "integer", "nullable": false }, "female": { "title": "female", "type": "integer", "nullable": false }, "totalAgeGroup": { "title": "totalAgeGroup", "type": "integer", "nullable": false }, "updatedDate": { "title": "updatedDate", "type": "string", "format": "date-time", "nullable": false } }, "description": "" }, "DistrictCases": { "title": "DistrictCases", "type": "object", "properties": { "districtName": { "title": "districtName", "type": "string", "description": "This is the primary identifier for this object.\n", "nullable": false }, "region": { "title": "region", "type": "string", "nullable": false }, "cases": { "title": "cases", "type": "integer", "nullable": false }, "deaths": { "title": "deaths", "type": "integer", "nullable": false }, "recoveries": { "title": "recoveries", "type": "integer", "nullable": false }, "lastUpdated": { "title": "lastUpdated", "type": "string", "format": "date-time", "nullable": false } }, "description": "" }, "HospitalCases": { "title": "HospitalCases", "type": "object", "properties": { "hospitalName": { "title": "hospitalName", "type": "string", "description": "This is the primary identifier for this object.\n", "nullable": false }, "admission": { "title": "admission", "type": "integer", "nullable": false }, "discharge": { "title": "discharge", "type": "integer", "nullable": false }, "deaths": { "title": "deaths", "type": "integer", "nullable": false }, "lastUpdated": { "title": "lastUpdated", "type": "string", "format": "date-time", "nullable": false }, "createdDate": { "title": "createdDate", "type": "string", "format": "date-time", "nullable": false } }, "description": "" }, "Timeline": { "title": "Timeline", "type": "object", "properties": { "createdAt": { "title": "createdAt", "type": "string", "description": "No two objects may have the same value for this field.\n", "format": "date-time", "nullable": false }, "cases": { "title": "cases", "type": "integer", "nullable": false }, "deaths": { "title": "deaths", "type": "integer", "nullable": false }, "recoveries": { "title": "recoveries", "type": "integer", "nullable": false } }, "description": "" }, "Summary": { "title": "Summary", "type": "object", "properties": { "cases": { "title": "cases", "type": "integer", "nullable": false }, "deaths": { "title": "deaths", "type": "integer", "nullable": false }, "recoveries": { "title": "recoveries", "type": "integer", "nullable": false }, "lastUpdated": { "title": "lastUpdated", "type": "string", "format": "date-time", "nullable": false } }, "description": "" } }, "responses": {}, "parameters": {}, "requestBodies": {}, "headers": {}, "securitySchemes": { "oauth2-client-authentication": { "type": "http", "description": "This endpoint requires an OAuth2 Client ID and Secret as the Basic Authentication username and password. If the client ID does not have a secret (public client), the password is the empty string (retain the separating colon, e.g. 'com.aqueduct.app:').", "scheme": "basic" }, "oauth2": { "type": "oauth2", "description": "Standard OAuth 2.0", "flows": { "password": { "tokenUrl": "http://localhost:8888/auth/token", "refreshUrl": "http://localhost:8888/auth/token", "scopes": {} } } } }, "callbacks": {} } },
dom_id: '#swagger-ui',
deepLinking: true,
presets: [
SwaggerUIBundle.presets.apis,
SwaggerUIStandalonePreset
],
plugins: [
SwaggerUIBundle.plugins.DownloadUrl
],
layout: "StandaloneLayout",
})
window.ui = ui
}
</script>
</body>
</html>