-
Notifications
You must be signed in to change notification settings - Fork 1
/
dddlabapi_v2_spec.html
65 lines (56 loc) · 15.5 KB
/
dddlabapi_v2_spec.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Swagger UI</title>
<link href="https://fonts.googleapis.com/css?family=Open+Sans:400,700|Source+Code+Pro:300,600|Titillium+Web:400,600,700" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/swagger-ui/3.24.2/swagger-ui.css" >
<style>
html
{
box-sizing: border-box;
overflow: -moz-scrollbars-vertical;
overflow-y: scroll;
}
*,
*:before,
*:after
{
box-sizing: inherit;
}
body {
margin:0;
background: #fafafa;
}
</style>
</head>
<body>
<div id="swagger-ui"></div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/swagger-ui/3.24.2/swagger-ui-bundle.js"> </script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/swagger-ui/3.24.2/swagger-ui-standalone-preset.js"> </script>
<script>
window.onload = function() {
var spec = {"openapi": "3.0.0", "info": {"version": "2", "title": "DDDLAB API", "contact": {"name": "DDDLAB API Support", "email": "koupy@canlab.cz", "url": "https://canlab.cz/en/DDDLAB_API"}}, "servers": [{"url": "https://tachograph.online"}], "paths": {"/api/v2/upload_files": {"post": {"summary": "To upload files", "requestBody": {"content": {"multipart/form-data": {"schema": {"type": "object", "properties": {"file": {"type": "string", "format": "binary"}}}}}}, "responses": {"200": {"description": "Simple text response -- name of uploaded file"}}}}, "/api/v2/preview": {"post": {"summary": "To get preview", "parameters": [{"name": "file", "in": "query", "description": "File to preview", "required": true, "schema": {"type": "string"}}], "responses": {"200": {"description": "Preview of file send as parametr", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Preview"}}}}, "default": {"description": "Unexpected error"}}}}, "/api/v2/analysis": {"post": {"summary": "Infringement analysis", "parameters": [{"name": "cardid", "in": "query", "description": "ID of evalueted card -- from preview", "required": true, "schema": {"type": "string"}}, {"name": "pbegin", "in": "query", "description": "Period begin", "required": true, "schema": {"type": "string", "format": "date"}}, {"name": "pend", "in": "query", "description": "Period end", "required": true, "schema": {"type": "string", "format": "date"}}, {"name": "sumdaily", "in": "query", "description": "get summary export daily", "required": true, "schema": {"type": "boolean"}}, {"name": "sumweekly", "in": "query", "description": "get summary export weekly", "required": true, "schema": {"type": "boolean"}}, {"name": "summonthly", "in": "query", "description": "get summary export monthly", "required": true, "schema": {"type": "boolean"}}, {"name": "workshifts", "in": "query", "description": "get workshifts export", "required": true, "schema": {"type": "boolean"}}, {"name": "rests", "in": "query", "description": "get rests export", "required": true, "schema": {"type": "boolean"}}, {"name": "activities", "in": "query", "description": "get activities export", "required": true, "schema": {"type": "boolean"}}, {"name": "file", "in": "query", "description": "Uploaded file", "required": true, "schema": {"type": "string"}}], "responses": {"200": {"description": "Based on preview you can analyze uploaded files and get infringement , rest, workshift analysis", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Analysis"}}}}, "default": {"description": "Unexpected error"}}}}, "/api/v2/ddd2html": {"post": {"summary": "Convert DDD to HTML", "parameters": [{"name": "file", "in": "query", "description": "Uploaded file for conversion", "required": true, "schema": {"type": "string"}}, {"name": "local", "in": "query", "description": "HTML localization (cs/en)", "required": true, "schema": {"type": "string"}}], "responses": {"200": {"description": "Converted DDD to HTML with graphics and pretty formatting .html", "content": {"html": {"schema": {"$ref": "#/components/schemas/convertedHtml"}}}}, "default": {"description": "Unexpected error"}}}}, "/api/v2/ddd2xml": {"post": {"summary": "Convert DDD file to XML or JSON", "parameters": [{"name": "file", "in": "query", "description": "Uploaded file for conversion", "required": true, "schema": {"type": "string"}}, {"name": "format", "in": "query", "description": "format of response (json/xml)", "required": true, "schema": {"type": "string"}}], "responses": {"200": {"description": "return json or xml based query parametrs", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/convertedJSON"}}, "application/xml": {}}}, "default": {"description": "Unexpected error"}}}}}, "components": {"schemas": {"Preview": {"type": "object", "properties": {"status": {"type": "string", "example": 200}, "timestamp_utc": {"type": "string", "example": "2022-03-26 10:42:09.887228"}, "version": {"type": "string", "example": "DEVELOP f501a80"}, "data": {"type": "object", "properties": {"code": {"type": "string", "example": 0}, "equipment_type": {"type": "string", "example": 1}, "cards": {"type": "array", "items": {"type": "object", "properties": {"id": {"type": "string", "example": "00000000044I70"}, "firstnames": {"type": "string", "example": "Bohumil"}, "surname": {"type": "string", "example": "Novak"}, "birthday": {"type": "string", "format": "date", "example": null}, "prefered_language": {"type": "string", "example": "cs"}, "driving_licence": {"type": "object", "properties": {"number": {"type": "string", "example": null}, "authority": {"type": "string", "example": null}, "nation": {"type": "string", "example": 0}}}, "last_download": {"type": "string", "example": "not-a-date-time"}, "issuing_authority_name": {"type": "string", "example": "Ministerstvo dopravy Ceske republiky"}, "issue_date": {"type": "string", "format": "date", "example": null}, "validity_begin": {"type": "string", "format": "date", "example": null}, "expiry_date": {"type": "string", "format": "date", "example": null}, "periods": {"type": "array", "items": {"type": "object", "properties": {"begin": {"type": "string", "example": "2016-08-04 00:00:00"}, "end": {"type": "string", "example": "2017-02-24 10:53:00"}}}}}}}, "files": {"type": "array", "items": {"type": "object", "properties": {"filename": {"type": "string", "example": "C_20170224_1053_B_Novak_00000000044I70.ddd"}, "blocks": {"type": "array", "items": {"type": "object", "properties": {"fid": {"type": "string", "example": 2}, "signature": {"type": "string", "example": 0}}}}}}}}}}}, "Analysis": {"type": "object", "properties": {"status": {"type": "string", "example": 200}, "timestamp_utc": {"type": "string", "example": "2022-03-29 11:42:44.399736"}, "version": {"type": "string", "example": "DEVELOP f501a80"}, "data": {"type": "object", "properties": {"code": {"type": "string", "example": 0}, "equipment_type": {"type": "string", "example": 1}, "card": {"type": "object", "properties": {"id": {"type": "string", "example": "00000000044I70"}, "firstnames": {"type": "string", "example": "Pavel"}, "surname": {"type": "string", "example": "Novak"}, "birthday": {"type": "string", "format": "date", "example": null}, "prefered_language": {"type": "string", "example": "cs"}, "driving_licence": {"type": "object", "properties": {"number": {"type": "string", "example": null}, "authority": {"type": "string", "example": null}, "nation": {"type": "string", "example": 0}}}, "last_download": {"type": "string", "example": "not-a-date-time"}, "issuing_authority_name": {"type": "string", "example": "Ministerstvo dopravy Ceske republik"}, "issue_date": {"type": "string", "format": "date", "example": null}, "validity_begin": {"type": "string", "format": "date", "example": null}, "expiry_date": {"type": "string", "format": "date", "example": null}}}, "rule_sets": {"type": "array", "items": {"type": "object", "properties": {"id": {"type": "string", "example": "Analysis by Directive (EC) 15/2002 Analysis by Regulation (EC) 561/2006"}, "infringements": {"type": "array", "items": {"type": "object", "properties": {"date": {"type": "string", "format": "date-time", "example": "2016-06-06 06:42:00+02:00"}, "type": {"type": "string", "example": 1005}, "severity": {"type": "string", "example": 1}, "rule_id": {"type": "string", "example": "Rule_561_2006_8_2_Shortage"}, "begin": {"type": "string", "format": "date-time", "example": "2016-06-05 18:34:00+02:00"}, "end": {"type": "string", "format": "date-time", "example": "2016-06-06 14:40:00+02:00"}, "allowed": {"type": "object", "properties": {"semantic": {"type": "string", "example": 1}, "type": {"type": "string", "example": 2}, "value": {"type": "string", "example": "09:00:00"}}}, "measured": {"type": "object", "properties": {"semantic": {"type": "string", "example": 1}, "type": {"type": "string", "example": 2}, "value": {"type": "string", "example": "07:58:00"}}}}}}, "workshifts": {"type": "array", "items": {"type": "object", "properties": {"begin": {"type": "string", "format": "date-time", "example": "2016-06-05 18:34:00+02:00"}, "end": {"type": "string", "format": "date-time", "example": "2016-06-06 06:42:00+02:00"}, "duration": {"type": "string", "example": 43680}, "times": {"type": "object", "properties": {"driving": {"type": "string", "example": "04:49:00"}, "work": {"type": "string", "example": "00:01:00"}, "standby": {"type": "string", "example": "00:00:00"}, "break": {"type": "string", "example": "07:18:00"}, "unknown": {"type": "string", "example": "00:00:00"}, "workshift_total": {"type": "string", "example": "09:57:00"}, "workshift_night": {"type": "string", "example": "07:19:00"}, "workshift_safety_breaks": {"type": "string", "example": "04:34:00"}, "workshift_short_breaks": {"type": "string", "example": "00:33:00"}, "workshift_excluded": {"type": "string", "example": "02:11:00"}, "worked_total": {"type": "string", "example": "05:35:00"}, "worked_night": {"type": "string", "example": "03:20:00"}, "worked_safety_breaks": {"type": "string", "example": "00:45:00"}, "rest": {"type": "object", "properties": {"rest_time": {"type": "string", "example": "07:58:00"}, "daily_rest_time": {"type": "string", "example": "07:58:00"}, "daily_type": {"type": "string", "example": 13}, "weekly_type": {"type": "string", "example": 0}}}}}, "infringements": {"type": "array", "items": {"type": "object", "properties": {"date": {"type": "string", "format": "date-time", "example": "2016-06-06 06:42:00+02:00"}, "type": {"type": "string", "example": 1005}, "severity": {"type": "string", "example": 1}, "rule_id": {"type": "string", "example": "Rule_561_2006_8_2_Shortage"}, "begin": {"type": "string", "format": "date-time", "example": "2016-06-05 18:34:00+02:00"}, "end": {"type": "string", "format": "date-time", "example": "2016-06-06 14:40:00+02:00"}, "allowed": {"type": "object", "properties": {"semantic": {"type": "string", "example": 1}, "type": {"type": "string", "example": 2}, "value": {"type": "string", "example": "09:00:00"}}}, "measured": {"type": "object", "properties": {"semantic": {"type": "string", "example": 1}, "type": {"type": "string", "example": 2}, "value": {"type": "string", "example": "07:58:00"}}}}}}}}}, "rests": {"type": "array", "items": {"type": "object", "properties": {"begin": {"type": "string", "format": "date-time", "example": "2016-06-06 06:42:00+02:00"}, "end": {"type": "string", "format": "date-time", "example": "2016-06-06 14:39:59+02:00"}, "rest_time": {"type": "string", "example": "07:58:00"}}}}, "activities": {"type": "array", "items": {"type": "object", "properties": {"row_type": {"type": "string", "example": "dayline"}, "begin": {"type": "string", "format": "date-time", "example": "2016-06-05 00:00:00+02:00"}}}}, "summary_daily": {"type": "array", "items": {"type": "object", "properties": {"date": {"type": "string", "example": "2016-Jun-06"}, "driving": {"type": "string", "example": "04:49:00"}, "work": {"type": "string", "example": "00:01:00"}, "standby": {"type": "string", "example": "00:00:00"}, "break": {"type": "string", "example": "07:18:00"}, "unknown": {"type": "string", "example": "00:00:00"}, "working_time": {"type": "string", "example": "05:35:00"}, "night_working_time": {"type": "string", "example": "07:19:00"}, "duration": {"type": "string", "example": 43680}}}}, "summary_weekly": {"type": "array", "items": {"type": "object", "properties": {"date": {"type": "string", "example": "2016-Jun-06"}, "driving": {"type": "string", "example": 109200}, "work": {"type": "string", "example": "00:56:00"}, "standby": {"type": "string", "example": "00:00:00"}, "break": {"type": "string", "example": 147420}, "unknown": {"type": "string", "example": "00:00:00"}, "working_time": {"type": "string", "example": 123360}, "night_working_time": {"type": "string", "example": 69240}, "duration": {"type": "string", "example": 259980}}}}, "summary_monthly": {"type": "array", "items": {"type": "object", "properties": {"date": {"type": "string", "example": "2016-Jun-01"}, "driving": {"type": "string", "example": 373980}, "work": {"type": "string", "example": "03:34:00"}, "standby": {"type": "string", "example": "00:00:00"}, "break": {"type": "string", "example": 437340}, "unknown": {"type": "string", "example": "00:00:00"}, "working_time": {"type": "string", "example": 421920}, "night_working_time": {"type": "string", "example": 169020}, "duration": {"type": "string", "example": 824160}}}}}}}}}}}, "convertedHtml": {"type": "string", "example": "<html xmlns:xs=\"http://www.w3.org/2001/XMLSchema\"> <head> <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"> </head> <body> <h3 id=\"ddd_title\">Obsah \"Karta \u0159idi\u010de\" (Generace 1)</h3> <ul id=\"ddd_main\"> </body> </html>"}, "convertedJSON": {"type": "object", "properties": {"Type": {"type": "string", "example": "MainFile"}, "Filename": {"type": "string", "example": "C_20170303_1649_P_Patava_0000000001MZR0.ddd"}, "EquipmentType": {"type": "string", "example": 1}, "Format": {"type": "string", "example": 0}, "LibraryVersion": {"type": "string", "example": "0.0.0 [dddlab_api] (DEVELOP )"}, "Status": {"type": "string", "example": 0}, "Blocks": {"type": "array", "items": {"type": "object", "properties": {"Type": {"type": "string", "example": "CardIccIdentification"}, "FID": {"type": "string", "example": 2}, "Signature": {"type": "string", "example": 0}, "ClockStop": {"type": "string", "example": 0}, "CardExtendedSerialNumber": {"type": "object", "properties": {"SerialNumber": {"type": "string", "example": 5169}, "MonthYear": {"type": "string", "example": 139}, "Type": {"type": "string", "example": 1}, "ManufacturerCode": {"type": "string", "example": 136}}}, "CardApprovalNumber": {"type": "string", "example": null}, "CardPersonaliserID": {"type": "string", "example": 136}, "EmbedderIcAssemblerId": {"type": "object", "properties": {"CountryCode": {"type": "string", "example": null}, "ModuleEmbedder": {"type": "string", "example": 0}, "ManufacturerInformation": {"type": "string", "example": 0}}}, "IcIdentifier": {"type": "string", "example": 1537}}}}}}, "Error": {"type": "object", "required": ["code", "message"], "properties": {"code": {"type": "integer", "format": "int32"}, "message": {"type": "string"}}}}, "securitySchemes": {"bearerAuth": {"type": "http", "scheme": "bearer", "bearerFormat": "JWT"}}}, "security": [{"bearerAuth": []}]};
// Build a system
const ui = SwaggerUIBundle({
spec: spec,
dom_id: '#swagger-ui',
deepLinking: true,
presets: [
SwaggerUIBundle.presets.apis,
SwaggerUIStandalonePreset
],
plugins: [
SwaggerUIBundle.plugins.DownloadUrl
],
layout: "StandaloneLayout"
})
window.ui = ui
var elements = document.getElementsByClassName("topbar");
while(elements.length > 0){
elements[0].parentNode.removeChild(elements[0]);
}
}
</script>
</body>
</html>