Fix for api (#1676)
To change the apidoc, you need to: * change one file controllers/api/api.go * then run the command `apidoc -i controllers/api/ -o apidoc/`
Cette révision appartient à :
Parent
353c69cf08
révision
2dc84d03ca
|
@ -1,5 +1,5 @@
|
|||
define({
|
||||
"api": [{
|
||||
define({ "api": [
|
||||
{
|
||||
"type": "get",
|
||||
"url": "/search/",
|
||||
"title": "Search Torrents",
|
||||
|
@ -8,7 +8,8 @@ define({
|
|||
"group": "Torrents",
|
||||
"parameter": {
|
||||
"fields": {
|
||||
"Parameter": [{
|
||||
"Parameter": [
|
||||
{
|
||||
"group": "Parameter",
|
||||
"type": "String[]",
|
||||
"optional": false,
|
||||
|
@ -132,37 +133,45 @@ define({
|
|||
},
|
||||
"success": {
|
||||
"fields": {
|
||||
"Success 200": [{
|
||||
"Success 200": [
|
||||
{
|
||||
"group": "Success 200",
|
||||
"type": "Object[]",
|
||||
"optional": false,
|
||||
"field": "torrents",
|
||||
"description": "<p>List of torrent object (see view for the properties).</p>"
|
||||
}]
|
||||
}
|
||||
]
|
||||
},
|
||||
"examples": [{
|
||||
"examples": [
|
||||
{
|
||||
"title": "Success-Response:",
|
||||
"content": " HTTP/1.1 200 OK\n {\n\t\t\t\"torrents\": [...],\n\t\t\t\"queryRecordCount\": 50,\n\t\t\t\"totalRecordCount\": 798414\n\t\t}",
|
||||
"type": "json"
|
||||
}]
|
||||
}
|
||||
]
|
||||
},
|
||||
"filename": "controllers/api/api.go",
|
||||
"groupTitle": "Torrents",
|
||||
"error": {
|
||||
"fields": {
|
||||
"Error 4xx": [{
|
||||
"Error 4xx": [
|
||||
{
|
||||
"group": "Error 4xx",
|
||||
"type": "String[]",
|
||||
"optional": false,
|
||||
"field": "errors",
|
||||
"description": "<p>List of errors messages with a 404 error message in it.</p>"
|
||||
}]
|
||||
}
|
||||
]
|
||||
},
|
||||
"examples": [{
|
||||
"examples": [
|
||||
{
|
||||
"title": "Error-Response:",
|
||||
"content": "HTTP/1.1 404 Not Found\n{\n \"errors\": [ \"404_not_found\", ... ]\n}",
|
||||
"type": "json"
|
||||
}]
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -174,7 +183,8 @@ define({
|
|||
"group": "Torrents",
|
||||
"parameter": {
|
||||
"fields": {
|
||||
"Parameter": [{
|
||||
"Parameter": [
|
||||
{
|
||||
"group": "Parameter",
|
||||
"type": "String[]",
|
||||
"optional": false,
|
||||
|
@ -298,37 +308,45 @@ define({
|
|||
},
|
||||
"success": {
|
||||
"fields": {
|
||||
"Success 200": [{
|
||||
"Success 200": [
|
||||
{
|
||||
"group": "Success 200",
|
||||
"type": "Object[]",
|
||||
"optional": false,
|
||||
"field": "torrents",
|
||||
"description": "<p>List of torrent object (see view for the properties).</p>"
|
||||
}]
|
||||
}
|
||||
]
|
||||
},
|
||||
"examples": [{
|
||||
"examples": [
|
||||
{
|
||||
"title": "Success-Response:",
|
||||
"content": " HTTP/1.1 200 OK\n {\n\t\t\t[...]\n\t\t}",
|
||||
"type": "json"
|
||||
}]
|
||||
}
|
||||
]
|
||||
},
|
||||
"filename": "controllers/api/_apidoc.js",
|
||||
"groupTitle": "Torrents",
|
||||
"error": {
|
||||
"fields": {
|
||||
"Error 4xx": [{
|
||||
"Error 4xx": [
|
||||
{
|
||||
"group": "Error 4xx",
|
||||
"type": "String[]",
|
||||
"optional": false,
|
||||
"field": "errors",
|
||||
"description": "<p>List of errors messages with a 404 error message in it.</p>"
|
||||
}]
|
||||
}
|
||||
]
|
||||
},
|
||||
"examples": [{
|
||||
"examples": [
|
||||
{
|
||||
"title": "Error-Response:",
|
||||
"content": "HTTP/1.1 404 Not Found\n{\n \"errors\": [ \"404_not_found\", ... ]\n}",
|
||||
"type": "json"
|
||||
}]
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -340,18 +358,21 @@ define({
|
|||
"group": "Torrents",
|
||||
"parameter": {
|
||||
"fields": {
|
||||
"Parameter": [{
|
||||
"Parameter": [
|
||||
{
|
||||
"group": "Parameter",
|
||||
"type": "Number",
|
||||
"optional": false,
|
||||
"field": "id",
|
||||
"description": "<p>Torrent unique ID.</p>"
|
||||
}]
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"success": {
|
||||
"fields": {
|
||||
"Success 200": [{
|
||||
"Success 200": [
|
||||
{
|
||||
"group": "Success 200",
|
||||
"type": "Number",
|
||||
"optional": false,
|
||||
|
@ -514,29 +535,35 @@ define({
|
|||
}
|
||||
]
|
||||
},
|
||||
"examples": [{
|
||||
"examples": [
|
||||
{
|
||||
"title": "Success-Response:",
|
||||
"content": " HTTP/1.1 200 OK\n\t{\n\t\"id\": 952801,\n\t\"name\": \"[HorribleSubs] Uchouten Kazoku S2 [720p]\",\n\t\"status\": 1,\n\t\"hash\": \"6E4D96F7A0B0456672E80B150CCB7C15868CD47D\",\n\t\"date\": \"2017-07-05T11:01:39Z\",\n\t\"filesize\": 4056160259,\n\t\"description\": \"<p>Unofficial batch</p>\\n\",\n\t\"comments\": [],\n\t\"sub_category\": \"5\",\n\t\"category\": \"3\",\n\t\"anidb_id\": \"\",\n\t\"downloads\": 0,\n\t\"uploader_id\": 7177,\n\t\"uploader_name\": \"DarAR92\",\n\t\"uploader_old\": \"\",\n\t\"website_link\": \"http://horriblesubs.info/\",\n\t\"languages\": [\n\t\"en-us\"\n\t],\n\t\"magnet\": \"magnet:?xt=urn:btih:6E4D96F7A0B0456672E80B150CCB7C15868CD47D&dn=%5BHorribleSubs%5D+Uchouten+Kazoku+S2+%5B720p%5D&tr=http://nyaa.tracker.wf:7777/announce&tr=http://nyaa.tracker.wf:7777/announce&tr=udp://tracker.doko.moe:6969&tr=http://tracker.anirena.com:80/announce&tr=http://anidex.moe:6969/announce&tr=udp://tracker.opentrackr.org:1337&tr=udp://tracker.coppersurfer.tk:6969&tr=udp://tracker.leechers-paradise.org:6969&tr=udp://zer0day.ch:1337&tr=udp://9.rarbg.com:2710/announce&tr=udp://tracker2.christianbro.pw:6969/announce&tr=udp://tracker.coppersurfer.tk:6969&tr=udp://tracker.leechers-paradise.org:6969&tr=udp://eddie4.nl:6969/announce&tr=udp://tracker.doko.moe:6969/announce\",\n\t\"torrent\": \"https://nyaa.pantsu.cat/download/6E4D96F7A0B0456672E80B150CCB7C15868CD47D\",\n\t\"seeders\": 4,\n\t\"leechers\": 2,\n\t\"completed\": 28,\n\t\"last_scrape\": \"2017-07-07T07:48:32.509635Z\",\n\t\"file_list\": [\n\t{\n\t\"path\": \"[HorribleSubs] Uchouten Kazoku S2 - 01[720p].mkv\",\n\t\"filesize\": 338250895\n\t},\n\t{\n\t\"path\": \"[HorribleSubs] Uchouten Kazoku S2 - 12 [720p].mkv\",\n\t\"filesize\": 338556275\n\t}\n\t]\n\t}",
|
||||
"type": "json"
|
||||
}]
|
||||
}
|
||||
]
|
||||
},
|
||||
"filename": "controllers/api/api.go",
|
||||
"groupTitle": "Torrents",
|
||||
"error": {
|
||||
"fields": {
|
||||
"Error 4xx": [{
|
||||
"Error 4xx": [
|
||||
{
|
||||
"group": "Error 4xx",
|
||||
"type": "String[]",
|
||||
"optional": false,
|
||||
"field": "errors",
|
||||
"description": "<p>List of errors messages with a 404 error message in it.</p>"
|
||||
}]
|
||||
}
|
||||
]
|
||||
},
|
||||
"examples": [{
|
||||
"examples": [
|
||||
{
|
||||
"title": "Error-Response:",
|
||||
"content": "HTTP/1.1 404 Not Found\n{\n \"errors\": [ \"404_not_found\", ... ]\n}",
|
||||
"type": "json"
|
||||
}]
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -548,39 +575,47 @@ define({
|
|||
"group": "Torrents",
|
||||
"parameter": {
|
||||
"fields": {
|
||||
"Parameter": [{
|
||||
"Parameter": [
|
||||
{
|
||||
"group": "Parameter",
|
||||
"type": "Number",
|
||||
"optional": false,
|
||||
"field": "id",
|
||||
"description": "<p>Torrent unique ID.</p>"
|
||||
}]
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"success": {
|
||||
"examples": [{
|
||||
"examples": [
|
||||
{
|
||||
"title": "Success-Response:",
|
||||
"content": "HTTP/1.1 200 OK",
|
||||
"type": "json"
|
||||
}]
|
||||
}
|
||||
]
|
||||
},
|
||||
"filename": "controllers/api/api.go",
|
||||
"groupTitle": "Torrents",
|
||||
"error": {
|
||||
"fields": {
|
||||
"Error 4xx": [{
|
||||
"Error 4xx": [
|
||||
{
|
||||
"group": "Error 4xx",
|
||||
"type": "String[]",
|
||||
"optional": false,
|
||||
"field": "errors",
|
||||
"description": "<p>List of errors messages with a 404 error message in it.</p>"
|
||||
}]
|
||||
}
|
||||
]
|
||||
},
|
||||
"examples": [{
|
||||
"examples": [
|
||||
{
|
||||
"title": "Error-Response:",
|
||||
"content": "HTTP/1.1 404 Not Found\n{\n \"errors\": [ \"404_not_found\", ... ]\n}",
|
||||
"type": "json"
|
||||
}]
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -592,18 +627,21 @@ define({
|
|||
"group": "Torrents",
|
||||
"parameter": {
|
||||
"fields": {
|
||||
"Parameter": [{
|
||||
"Parameter": [
|
||||
{
|
||||
"group": "Parameter",
|
||||
"type": "Number",
|
||||
"optional": false,
|
||||
"field": "id",
|
||||
"description": "<p>Torrent unique ID.</p>"
|
||||
}]
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"success": {
|
||||
"fields": {
|
||||
"Success 200": [{
|
||||
"Success 200": [
|
||||
{
|
||||
"group": "Success 200",
|
||||
"type": "Object[]",
|
||||
"optional": false,
|
||||
|
@ -626,29 +664,35 @@ define({
|
|||
}
|
||||
]
|
||||
},
|
||||
"examples": [{
|
||||
"examples": [
|
||||
{
|
||||
"title": "Success-Response:",
|
||||
"content": " HTTP/1.1 200 OK\n {\n\t\t\t\"torrents\": [...],\n\t\t\t\"queryRecordCount\": 50,\n\t\t\t\"totalRecordCount\": 798414\n\t\t}",
|
||||
"type": "json"
|
||||
}]
|
||||
}
|
||||
]
|
||||
},
|
||||
"filename": "controllers/api/api.go",
|
||||
"groupTitle": "Torrents",
|
||||
"error": {
|
||||
"fields": {
|
||||
"Error 4xx": [{
|
||||
"Error 4xx": [
|
||||
{
|
||||
"group": "Error 4xx",
|
||||
"type": "String[]",
|
||||
"optional": false,
|
||||
"field": "errors",
|
||||
"description": "<p>List of errors messages with a 404 error message in it.</p>"
|
||||
}]
|
||||
}
|
||||
]
|
||||
},
|
||||
"examples": [{
|
||||
"examples": [
|
||||
{
|
||||
"title": "Error-Response:",
|
||||
"content": "HTTP/1.1 404 Not Found\n{\n \"errors\": [ \"404_not_found\", ... ]\n}",
|
||||
"type": "json"
|
||||
}]
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -660,7 +704,8 @@ define({
|
|||
"group": "Torrents",
|
||||
"parameter": {
|
||||
"fields": {
|
||||
"Parameter": [{
|
||||
"Parameter": [
|
||||
{
|
||||
"group": "Parameter",
|
||||
"type": "String",
|
||||
"optional": false,
|
||||
|
@ -735,7 +780,8 @@ define({
|
|||
},
|
||||
"success": {
|
||||
"fields": {
|
||||
"Success 200": [{
|
||||
"Success 200": [
|
||||
{
|
||||
"group": "Success 200",
|
||||
"type": "Boolean",
|
||||
"optional": false,
|
||||
|
@ -758,17 +804,20 @@ define({
|
|||
}
|
||||
]
|
||||
},
|
||||
"examples": [{
|
||||
"examples": [
|
||||
{
|
||||
"title": "Success-Response:",
|
||||
"content": "HTTP/1.1 200 OK",
|
||||
"type": "json"
|
||||
}]
|
||||
}
|
||||
]
|
||||
},
|
||||
"filename": "controllers/api/api.go",
|
||||
"groupTitle": "Torrents",
|
||||
"error": {
|
||||
"fields": {
|
||||
"Error 4xx": [{
|
||||
"Error 4xx": [
|
||||
{
|
||||
"group": "Error 4xx",
|
||||
"type": "Boolean",
|
||||
"optional": false,
|
||||
|
@ -791,11 +840,13 @@ define({
|
|||
}
|
||||
]
|
||||
},
|
||||
"examples": [{
|
||||
"examples": [
|
||||
{
|
||||
"title": "Error-Response:",
|
||||
"content": " HTTP/1.1 200 OK\n {\n \"ok\": false,\n \"errors\": [ ... ]\n \"all_errors\": {\n\t\t \t\"username\": [ ... ],\n }\n }",
|
||||
"type": "json"
|
||||
}]
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -807,7 +858,8 @@ define({
|
|||
"group": "Torrents",
|
||||
"parameter": {
|
||||
"fields": {
|
||||
"Parameter": [{
|
||||
"Parameter": [
|
||||
{
|
||||
"group": "Parameter",
|
||||
"type": "String",
|
||||
"optional": false,
|
||||
|
@ -889,7 +941,8 @@ define({
|
|||
},
|
||||
"success": {
|
||||
"fields": {
|
||||
"Success 200": [{
|
||||
"Success 200": [
|
||||
{
|
||||
"group": "Success 200",
|
||||
"type": "Boolean",
|
||||
"optional": false,
|
||||
|
@ -912,17 +965,20 @@ define({
|
|||
}
|
||||
]
|
||||
},
|
||||
"examples": [{
|
||||
"examples": [
|
||||
{
|
||||
"title": "Success-Response:",
|
||||
"content": "HTTP/1.1 200 OK",
|
||||
"type": "json"
|
||||
}]
|
||||
}
|
||||
]
|
||||
},
|
||||
"filename": "controllers/api/api.go",
|
||||
"groupTitle": "Torrents",
|
||||
"error": {
|
||||
"fields": {
|
||||
"Error 4xx": [{
|
||||
"Error 4xx": [
|
||||
{
|
||||
"group": "Error 4xx",
|
||||
"type": "Boolean",
|
||||
"optional": false,
|
||||
|
@ -945,11 +1001,13 @@ define({
|
|||
}
|
||||
]
|
||||
},
|
||||
"examples": [{
|
||||
"examples": [
|
||||
{
|
||||
"title": "Error-Response:",
|
||||
"content": " HTTP/1.1 200 OK\n {\n \"ok\": false,\n \"errors\": [ ... ]\n \"all_errors\": {\n\t\t \t\"username\": [ ... ],\n }\n }",
|
||||
"type": "json"
|
||||
}]
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -961,7 +1019,8 @@ define({
|
|||
"group": "Users",
|
||||
"parameter": {
|
||||
"fields": {
|
||||
"Parameter": [{
|
||||
"Parameter": [
|
||||
{
|
||||
"group": "Parameter",
|
||||
"type": "String",
|
||||
"optional": false,
|
||||
|
@ -980,7 +1039,8 @@ define({
|
|||
},
|
||||
"success": {
|
||||
"fields": {
|
||||
"Success 200": [{
|
||||
"Success 200": [
|
||||
{
|
||||
"group": "Success 200",
|
||||
"type": "Boolean",
|
||||
"optional": false,
|
||||
|
@ -1003,17 +1063,20 @@ define({
|
|||
}
|
||||
]
|
||||
},
|
||||
"examples": [{
|
||||
"examples": [
|
||||
{
|
||||
"title": "Success-Response:",
|
||||
"content": " HTTP/1.1 200 OK\n\t\t{\n\t\t\tdata:\n \t\t[{\n\t\t\t\t\tuser_id:1,\n\t\t\t\t\tusername:\"username\",\n\t\t\t\t\tstatus:1,\n\t\t\t\t\ttoken:\"token\",\n\t\t\t\t\tmd5:\"\",\n\t\t\t\t\tcreated_at:\"date\",\n\t\t\t\t\tliking_count:0,\n\t\t\t\t\tliked_count:0\n\t\t\t\t}],\n\t\t\tinfos: [\"Logged\", ... ],\n\t\t\tok:true\n\t\t}",
|
||||
"type": "json"
|
||||
}]
|
||||
}
|
||||
]
|
||||
},
|
||||
"filename": "controllers/api/api.go",
|
||||
"groupTitle": "Users",
|
||||
"error": {
|
||||
"fields": {
|
||||
"Error 4xx": [{
|
||||
"Error 4xx": [
|
||||
{
|
||||
"group": "Error 4xx",
|
||||
"type": "Boolean",
|
||||
"optional": false,
|
||||
|
@ -1036,11 +1099,104 @@ define({
|
|||
}
|
||||
]
|
||||
},
|
||||
"examples": [{
|
||||
"examples": [
|
||||
{
|
||||
"title": "Error-Response:",
|
||||
"content": " HTTP/1.1 200 OK\n {\n \"ok\": false,\n \"errors\": [ ... ]\n \"all_errors\": {\n\t\t \t\"username\": [ ... ],\n }\n }",
|
||||
"type": "json"
|
||||
}]
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "post",
|
||||
"url": "/user/",
|
||||
"title": "Get a private user profile",
|
||||
"version": "1.1.1",
|
||||
"name": "Private_Profile",
|
||||
"group": "Users",
|
||||
"parameter": {
|
||||
"fields": {
|
||||
"Parameter": [
|
||||
{
|
||||
"group": "Parameter",
|
||||
"type": "String",
|
||||
"optional": false,
|
||||
"field": "access_token",
|
||||
"description": "<p>Token sent by the OAuth API</p>"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"success": {
|
||||
"fields": {
|
||||
"Success 200": [
|
||||
{
|
||||
"group": "Success 200",
|
||||
"type": "Boolean",
|
||||
"optional": false,
|
||||
"field": "ok",
|
||||
"description": "<p>The request is done without failing</p>"
|
||||
},
|
||||
{
|
||||
"group": "Success 200",
|
||||
"type": "String[]",
|
||||
"optional": false,
|
||||
"field": "infos",
|
||||
"description": "<p>Messages information relative to the request</p>"
|
||||
},
|
||||
{
|
||||
"group": "Success 200",
|
||||
"type": "Object",
|
||||
"optional": false,
|
||||
"field": "data",
|
||||
"description": "<p>The connected user object</p>"
|
||||
}
|
||||
]
|
||||
},
|
||||
"examples": [
|
||||
{
|
||||
"title": "Success-Response:",
|
||||
"content": " HTTP/1.1 200 OK\n\t\t{\n\t\t\tdata:\n \t\t[{\n\t\t\t\t\tuser_id:1,\n\t\t\t\t\tusername:\"username\",\n\t\t\t\t\tstatus:1,\n\t\t\t\t\ttoken:\"token\",\n\t\t\t\t\tmd5:\"\",\n\t\t\t\t\tcreated_at:\"date\",\n\t\t\t\t\tliking_count:0,\n\t\t\t\t\tliked_count:0\n\t\t\t\t}],\n\t\t\tinfos: [\"Logged\", ... ],\n\t\t\tok:true\n\t\t}",
|
||||
"type": "json"
|
||||
}
|
||||
]
|
||||
},
|
||||
"filename": "controllers/api/api.go",
|
||||
"groupTitle": "Users",
|
||||
"error": {
|
||||
"fields": {
|
||||
"Error 4xx": [
|
||||
{
|
||||
"group": "Error 4xx",
|
||||
"type": "Boolean",
|
||||
"optional": false,
|
||||
"field": "ok",
|
||||
"description": "<p>The request couldn't be done due to some errors.</p>"
|
||||
},
|
||||
{
|
||||
"group": "Error 4xx",
|
||||
"type": "String[]",
|
||||
"optional": false,
|
||||
"field": "errors",
|
||||
"description": "<p>List of errors messages.</p>"
|
||||
},
|
||||
{
|
||||
"group": "Error 4xx",
|
||||
"type": "Object[]",
|
||||
"optional": false,
|
||||
"field": "all_errors",
|
||||
"description": "<p>List of errors object messages for each wrong field</p>"
|
||||
}
|
||||
]
|
||||
},
|
||||
"examples": [
|
||||
{
|
||||
"title": "Error-Response:",
|
||||
"content": " HTTP/1.1 200 OK\n {\n \"ok\": false,\n \"errors\": [ ... ]\n \"all_errors\": {\n\t\t \t\"username\": [ ... ],\n }\n }",
|
||||
"type": "json"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -1052,18 +1208,21 @@ define({
|
|||
"group": "Users",
|
||||
"parameter": {
|
||||
"fields": {
|
||||
"Parameter": [{
|
||||
"Parameter": [
|
||||
{
|
||||
"group": "Parameter",
|
||||
"type": "Number",
|
||||
"optional": false,
|
||||
"field": "id",
|
||||
"description": "<p>User ID.</p>"
|
||||
}]
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"success": {
|
||||
"fields": {
|
||||
"Success 200": [{
|
||||
"Success 200": [
|
||||
{
|
||||
"group": "Success 200",
|
||||
"type": "Boolean",
|
||||
"optional": false,
|
||||
|
@ -1086,17 +1245,20 @@ define({
|
|||
}
|
||||
]
|
||||
},
|
||||
"examples": [{
|
||||
"examples": [
|
||||
{
|
||||
"title": "Success-Response:",
|
||||
"content": " HTTP/1.1 200 OK\n\t\t{\n\t\t\tdata:\n \t\t[{\n\t\t\t\t\tuser_id:1,\n\t\t\t\t\tusername:\"username\",\n\t\t\t\t\tstatus:1,\n\t\t\t\t\tmd5:\"\",\n\t\t\t\t\tcreated_at:\"date\",\n\t\t\t\t\tliking_count:0,\n\t\t\t\t\tliked_count:0\n\t\t\t\t}],\n\t\t\tinfos: [\"Logged\", ... ],\n\t\t\tok:true\n\t\t}",
|
||||
"type": "json"
|
||||
}]
|
||||
}
|
||||
]
|
||||
},
|
||||
"filename": "controllers/api/api.go",
|
||||
"groupTitle": "Users",
|
||||
"error": {
|
||||
"fields": {
|
||||
"Error 4xx": [{
|
||||
"Error 4xx": [
|
||||
{
|
||||
"group": "Error 4xx",
|
||||
"type": "Boolean",
|
||||
"optional": false,
|
||||
|
@ -1119,12 +1281,13 @@ define({
|
|||
}
|
||||
]
|
||||
},
|
||||
"examples": [{
|
||||
"examples": [
|
||||
{
|
||||
"title": "Error-Response:",
|
||||
"content": " HTTP/1.1 200 OK\n {\n \"ok\": false,\n \"errors\": [ ... ]\n \"all_errors\": {\n\t\t \t\"username\": [ ... ],\n }\n }",
|
||||
"type": "json"
|
||||
}]
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
}
|
||||
] });
|
||||
|
|
|
@ -1108,6 +1108,97 @@
|
|||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "post",
|
||||
"url": "/user/",
|
||||
"title": "Get a private user profile",
|
||||
"version": "1.1.1",
|
||||
"name": "Private_Profile",
|
||||
"group": "Users",
|
||||
"parameter": {
|
||||
"fields": {
|
||||
"Parameter": [
|
||||
{
|
||||
"group": "Parameter",
|
||||
"type": "String",
|
||||
"optional": false,
|
||||
"field": "access_token",
|
||||
"description": "<p>Token sent by the OAuth API</p>"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"success": {
|
||||
"fields": {
|
||||
"Success 200": [
|
||||
{
|
||||
"group": "Success 200",
|
||||
"type": "Boolean",
|
||||
"optional": false,
|
||||
"field": "ok",
|
||||
"description": "<p>The request is done without failing</p>"
|
||||
},
|
||||
{
|
||||
"group": "Success 200",
|
||||
"type": "String[]",
|
||||
"optional": false,
|
||||
"field": "infos",
|
||||
"description": "<p>Messages information relative to the request</p>"
|
||||
},
|
||||
{
|
||||
"group": "Success 200",
|
||||
"type": "Object",
|
||||
"optional": false,
|
||||
"field": "data",
|
||||
"description": "<p>The connected user object</p>"
|
||||
}
|
||||
]
|
||||
},
|
||||
"examples": [
|
||||
{
|
||||
"title": "Success-Response:",
|
||||
"content": " HTTP/1.1 200 OK\n\t\t{\n\t\t\tdata:\n \t\t[{\n\t\t\t\t\tuser_id:1,\n\t\t\t\t\tusername:\"username\",\n\t\t\t\t\tstatus:1,\n\t\t\t\t\ttoken:\"token\",\n\t\t\t\t\tmd5:\"\",\n\t\t\t\t\tcreated_at:\"date\",\n\t\t\t\t\tliking_count:0,\n\t\t\t\t\tliked_count:0\n\t\t\t\t}],\n\t\t\tinfos: [\"Logged\", ... ],\n\t\t\tok:true\n\t\t}",
|
||||
"type": "json"
|
||||
}
|
||||
]
|
||||
},
|
||||
"filename": "controllers/api/api.go",
|
||||
"groupTitle": "Users",
|
||||
"error": {
|
||||
"fields": {
|
||||
"Error 4xx": [
|
||||
{
|
||||
"group": "Error 4xx",
|
||||
"type": "Boolean",
|
||||
"optional": false,
|
||||
"field": "ok",
|
||||
"description": "<p>The request couldn't be done due to some errors.</p>"
|
||||
},
|
||||
{
|
||||
"group": "Error 4xx",
|
||||
"type": "String[]",
|
||||
"optional": false,
|
||||
"field": "errors",
|
||||
"description": "<p>List of errors messages.</p>"
|
||||
},
|
||||
{
|
||||
"group": "Error 4xx",
|
||||
"type": "Object[]",
|
||||
"optional": false,
|
||||
"field": "all_errors",
|
||||
"description": "<p>List of errors object messages for each wrong field</p>"
|
||||
}
|
||||
]
|
||||
},
|
||||
"examples": [
|
||||
{
|
||||
"title": "Error-Response:",
|
||||
"content": " HTTP/1.1 200 OK\n {\n \"ok\": false,\n \"errors\": [ ... ]\n \"all_errors\": {\n\t\t \t\"username\": [ ... ],\n }\n }",
|
||||
"type": "json"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "get",
|
||||
"url": "/profile/",
|
||||
|
|
|
@ -6,7 +6,7 @@ define({
|
|||
"url": "https://nyaa.pantsu.cat/api",
|
||||
"header": {
|
||||
"title": "Information",
|
||||
"content": "<h1>Information</h1>\n<p>You can use this API without being logged or any token API</p>\n<h2>Except for Upload</h2>\n<p>When you upload, you have to provide your username and api token!</p>\n"
|
||||
"content": "<h1>Information</h1>\n<p>You can use this API without being logged or any token API</p>\n<h2>Except for Upload</h2>\n<p>When you upload, you have to provide your username and API token!</p>\n"
|
||||
},
|
||||
"order": [
|
||||
"GetTorrents",
|
||||
|
@ -26,7 +26,7 @@ define({
|
|||
"apidoc": "0.3.0",
|
||||
"generator": {
|
||||
"name": "apidoc",
|
||||
"time": "2017-07-22T15:20:08.679Z",
|
||||
"time": "2017-10-16T09:11:10.675Z",
|
||||
"url": "http://apidocjs.com",
|
||||
"version": "0.17.6"
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
"url": "https://nyaa.pantsu.cat/api",
|
||||
"header": {
|
||||
"title": "Information",
|
||||
"content": "<h1>Information</h1>\n<p>You can use this API without being logged or any token API</p>\n<h2>Except for Upload</h2>\n<p>When you upload, you have to provide your username and api token!</p>\n"
|
||||
"content": "<h1>Information</h1>\n<p>You can use this API without being logged or any token API</p>\n<h2>Except for Upload</h2>\n<p>When you upload, you have to provide your username and API token!</p>\n"
|
||||
},
|
||||
"order": [
|
||||
"GetTorrents",
|
||||
|
@ -26,7 +26,7 @@
|
|||
"apidoc": "0.3.0",
|
||||
"generator": {
|
||||
"name": "apidoc",
|
||||
"time": "2017-07-22T15:20:08.679Z",
|
||||
"time": "2017-10-16T09:11:10.675Z",
|
||||
"url": "http://apidocjs.com",
|
||||
"version": "0.17.6"
|
||||
}
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||
<title>Loading...</title>
|
||||
|
@ -12,7 +11,6 @@
|
|||
<link href="img/favicon.ico" rel="icon" type="image/x-icon">
|
||||
<script src="vendor/polyfill.js"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<script id="template-sidenav" type="text/x-handlebars-template">
|
||||
|
@ -22,23 +20,29 @@
|
|||
<span class="search-reset">x</span>
|
||||
</div>
|
||||
<ul class="sidenav nav nav-list list">
|
||||
{{#each nav}} {{#if title}} {{#if isHeader}} {{#if isFixed}}
|
||||
{{#each nav}}
|
||||
{{#if title}}
|
||||
{{#if isHeader}}
|
||||
{{#if isFixed}}
|
||||
<li class="nav-fixed nav-header navbar-btn nav-list-item" data-group="{{group}}"><a href="#api-{{group}}">{{underscoreToSpace title}}</a></li>
|
||||
{{else}}
|
||||
<li class="nav-header nav-list-item" data-group="{{group}}"><a href="#api-{{group}}">{{underscoreToSpace title}}</a></li>
|
||||
{{/if}} {{else}}
|
||||
{{/if}}
|
||||
{{else}}
|
||||
<li class="{{#if hidden}}hide {{/if}}" data-group="{{group}}" data-name="{{name}}" data-version="{{version}}">
|
||||
<a href="#api-{{group}}-{{name}}" class="nav-list-item">{{title}}</a>
|
||||
</li>
|
||||
{{/if}} {{/if}} {{/each}}
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
{{/each}}
|
||||
</ul>
|
||||
</nav>
|
||||
</script>
|
||||
|
||||
<script id="template-project" type="text/x-handlebars-template">
|
||||
<div class="pull-left">
|
||||
<h1>{{name}}</h1> {{#if description}}
|
||||
<h2>{{{nl2br description}}}</h2>{{/if}}
|
||||
<h1>{{name}}</h1>
|
||||
{{#if description}}<h2>{{{nl2br description}}}</h2>{{/if}}
|
||||
</div>
|
||||
{{#if template.withCompare}}
|
||||
<div class="pull-right">
|
||||
|
@ -73,18 +77,22 @@
|
|||
</script>
|
||||
|
||||
<script id="template-generator" type="text/x-handlebars-template">
|
||||
{{#if template.withGenerator}} {{#if generator}}
|
||||
{{#if template.withGenerator}}
|
||||
{{#if generator}}
|
||||
<div class="content">
|
||||
{{__ "Generated with"}} <a href="{{{generator.url}}}">{{{generator.name}}}</a> {{{generator.version}}} - {{{generator.time}}}
|
||||
</div>
|
||||
{{/if}} {{/if}}
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
</script>
|
||||
|
||||
<script id="template-sections" type="text/x-handlebars-template">
|
||||
<section id="api-{{group}}">
|
||||
<h1>{{underscoreToSpace title}}</h1> {{#if description}}
|
||||
<h1>{{underscoreToSpace title}}</h1>
|
||||
{{#if description}}
|
||||
<p>{{{nl2br description}}}</p>
|
||||
{{/if}} {{#each articles}}
|
||||
{{/if}}
|
||||
{{#each articles}}
|
||||
<div id="api-{{group}}-{{name}}">
|
||||
{{{article}}}
|
||||
</div>
|
||||
|
@ -115,20 +123,32 @@
|
|||
<div class="clearfix"></div>
|
||||
|
||||
{{#if article.deprecated}}
|
||||
<p class="deprecated"><span>{{__ "DEPRECATED"}}</span> {{{markdown article.deprecated.content}}}
|
||||
<p class="deprecated"><span>{{__ "DEPRECATED"}}</span>
|
||||
{{{markdown article.deprecated.content}}}
|
||||
</p>
|
||||
{{/if}} {{#if article.description}}
|
||||
{{/if}}
|
||||
|
||||
{{#if article.description}}
|
||||
<p>{{{nl2br article.description}}}</p>
|
||||
{{/if}}
|
||||
<span class="type type__{{toLowerCase article.type}}">{{toLowerCase article.type}}</span>
|
||||
<pre class="prettyprint language-html" data-type="{{toLowerCase article.type}}"><code>{{article.url}}</code></pre> {{#if article.permission}}
|
||||
<pre class="prettyprint language-html" data-type="{{toLowerCase article.type}}"><code>{{article.url}}</code></pre>
|
||||
|
||||
{{#if article.permission}}
|
||||
<p>
|
||||
{{__ "Permission:"}} {{#each article.permission}} {{name}} {{#if title}}
|
||||
{{__ "Permission:"}}
|
||||
{{#each article.permission}}
|
||||
{{name}}
|
||||
{{#if title}}
|
||||
<button type="button" class="btn btn-info btn-xs" data-title="{{title}}" data-content="{{nl2br description}}" data-html="true" data-toggle="popover" data-placement="right" data-trigger="hover">
|
||||
<span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span>
|
||||
</button> {{/if}} {{/each}}
|
||||
</button>
|
||||
{{/if}}
|
||||
{{/each}}
|
||||
</p>
|
||||
{{/if}} {{#if_gt article.examples.length compare=0}}
|
||||
{{/if}}
|
||||
|
||||
{{#if_gt article.examples.length compare=0}}
|
||||
<ul class="nav nav-tabs nav-tabs-examples">
|
||||
{{#each article.examples}}
|
||||
<li{{#if_eq @index compare=0}} class="active"{{/if_eq}}>
|
||||
|
@ -144,21 +164,26 @@
|
|||
</div>
|
||||
{{/each}}
|
||||
</div>
|
||||
{{/if_gt}} {{subTemplate "article-param-block" params=article.header _hasType=_hasTypeInHeaderFields section="header"}} {{subTemplate "article-param-block" params=article.parameter _hasType=_hasTypeInParameterFields section="parameter"}} {{subTemplate
|
||||
"article-param-block" params=article.success _hasType=_hasTypeInSuccessFields section="success"}} {{subTemplate "article-param-block" params=article.error _col1="Name" _hasType=_hasTypeInErrorFields section="error"}} {{subTemplate "article-sample-request"
|
||||
article=article id=id}}
|
||||
{{/if_gt}}
|
||||
|
||||
{{subTemplate "article-param-block" params=article.header _hasType=_hasTypeInHeaderFields section="header"}}
|
||||
{{subTemplate "article-param-block" params=article.parameter _hasType=_hasTypeInParameterFields section="parameter"}}
|
||||
{{subTemplate "article-param-block" params=article.success _hasType=_hasTypeInSuccessFields section="success"}}
|
||||
{{subTemplate "article-param-block" params=article.error _col1="Name" _hasType=_hasTypeInErrorFields section="error"}}
|
||||
|
||||
{{subTemplate "article-sample-request" article=article id=id}}
|
||||
</article>
|
||||
</script>
|
||||
|
||||
<script id="template-article-param-block" type="text/x-handlebars-template">
|
||||
{{#if params}} {{#each params.fields}}
|
||||
{{#if params}}
|
||||
{{#each params.fields}}
|
||||
<h2>{{__ @key}}</h2>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 30%">{{#if ../_col1}}{{__ ../_col1}}{{else}}{{__ "Field"}}{{/if}}</th>
|
||||
{{#if ../_hasType}}
|
||||
<th style="width: 10%">{{__ "Type"}}</th>{{/if}}
|
||||
{{#if ../_hasType}}<th style="width: 10%">{{__ "Type"}}</th>{{/if}}
|
||||
<th style="width: {{#if ../_hasType}}60%{{else}}70%{{/if}}">{{__ "Description"}}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
@ -172,11 +197,13 @@
|
|||
</td>
|
||||
{{/if}}
|
||||
<td>
|
||||
{{{nl2br description}}} {{#if defaultValue}}
|
||||
<p class="default-value">{{__ "Default value:"}} <code>{{{defaultValue}}}</code></p>{{/if}} {{#if size}}
|
||||
<p class="type-size">{{__ "Size range:"}} <code>{{{size}}}</code></p>{{/if}} {{#if allowedValues}}
|
||||
<p class="type-size">{{__ "Allowed values:"}} {{#each allowedValues}}
|
||||
<code>{{{this}}}</code>{{#unless @last}}, {{/unless}} {{/each}}
|
||||
{{{nl2br description}}}
|
||||
{{#if defaultValue}}<p class="default-value">{{__ "Default value:"}} <code>{{{defaultValue}}}</code></p>{{/if}}
|
||||
{{#if size}}<p class="type-size">{{__ "Size range:"}} <code>{{{size}}}</code></p>{{/if}}
|
||||
{{#if allowedValues}}<p class="type-size">{{__ "Allowed values:"}}
|
||||
{{#each allowedValues}}
|
||||
<code>{{{this}}}</code>{{#unless @last}}, {{/unless}}
|
||||
{{/each}}
|
||||
</p>
|
||||
{{/if}}
|
||||
</td>
|
||||
|
@ -184,7 +211,8 @@
|
|||
{{/each}}
|
||||
</tbody>
|
||||
</table>
|
||||
{{/each}} {{#if_gt params.examples.length compare=0}}
|
||||
{{/each}}
|
||||
{{#if_gt params.examples.length compare=0}}
|
||||
<ul class="nav nav-tabs nav-tabs-examples">
|
||||
{{#each params.examples}}
|
||||
<li{{#if_eq @index compare=0}} class="active"{{/if_eq}}>
|
||||
|
@ -200,7 +228,8 @@
|
|||
</div>
|
||||
{{/each}}
|
||||
</div>
|
||||
{{/if_gt}} {{/if}}
|
||||
{{/if_gt}}
|
||||
{{/if}}
|
||||
</script>
|
||||
|
||||
<script id="template-article-sample-request" type="text/x-handlebars-template">
|
||||
|
@ -216,8 +245,10 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
{{#if article.header}} {{#if article.header.fields}}
|
||||
<h3>{{__ "Headers"}}</h3> {{#each article.header.fields}}
|
||||
{{#if article.header}}
|
||||
{{#if article.header.fields}}
|
||||
<h3>{{__ "Headers"}}</h3>
|
||||
{{#each article.header.fields}}
|
||||
<h4><input type="radio" data-sample-request-header-group-id="sample-request-header-{{@index}}" name="{{../id}}-sample-request-header" value="{{@index}}" class="sample-request-header sample-request-switch" {{#if_eq @index compare=0}} checked{{/if_eq}} />{{@key}}</h4>
|
||||
<div class="{{../id}}-sample-request-header-fields{{#if_gt @index compare=0}} hide{{/if_gt}}">
|
||||
{{#each this}}
|
||||
|
@ -230,20 +261,27 @@
|
|||
</div>
|
||||
{{/each}}
|
||||
</div>
|
||||
{{/each}} {{/if}} {{/if}} {{#if article.parameter}} {{#if article.parameter.fields}}
|
||||
<h3>{{__ "Parameters"}}</h3> {{#each article.parameter.fields}}
|
||||
{{/each}}
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
|
||||
{{#if article.parameter}}
|
||||
{{#if article.parameter.fields}}
|
||||
<h3>{{__ "Parameters"}}</h3>
|
||||
{{#each article.parameter.fields}}
|
||||
<h4><input type="radio" data-sample-request-param-group-id="sample-request-param-{{@index}}" name="{{../id}}-sample-request-param" value="{{@index}}" class="sample-request-param sample-request-switch" {{#if_eq @index compare=0}} checked{{/if_eq}} />{{@key}}</h4>
|
||||
<div class="form-group {{../id}}-sample-request-param-fields{{#if_gt @index compare=0}} hide{{/if_gt}}">
|
||||
{{#each this}}
|
||||
<label class="col-md-3 control-label" for="sample-request-param-field-{{field}}">{{field}}</label>
|
||||
<div class="input-group">
|
||||
<input id="sample-request-param-field-{{field}}" type="text" placeholder="{{field}}" class="form-control sample-request-param" data-sample-request-param-name="{{field}}" data-sample-request-param-group="sample-request-param-{{@../index}}" {{#if optional}}data-sample-request-param-optional="true"
|
||||
{{/if}}>
|
||||
<input id="sample-request-param-field-{{field}}" type="text" placeholder="{{field}}" class="form-control sample-request-param" data-sample-request-param-name="{{field}}" data-sample-request-param-group="sample-request-param-{{@../index}}" {{#if optional}}data-sample-request-param-optional="true"{{/if}}>
|
||||
<div class="input-group-addon">{{{type}}}</div>
|
||||
</div>
|
||||
{{/each}}
|
||||
</div>
|
||||
{{/each}} {{/if}} {{/if}}
|
||||
{{/each}}
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
|
||||
<div class="form-group">
|
||||
<div class="controls pull-right">
|
||||
|
@ -289,209 +327,312 @@
|
|||
|
||||
{{#if article.description}}
|
||||
<p>{{{showDiff article.description compare.description "nl2br"}}}</p>
|
||||
{{else}} {{#if compare.description}}
|
||||
{{else}}
|
||||
{{#if compare.description}}
|
||||
<p>{{{showDiff "" compare.description "nl2br"}}}</p>
|
||||
{{/if}} {{/if}}
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
|
||||
<pre class="prettyprint language-html" data-type="{{toLowerCase article.type}}"><code>{{{showDiff article.url compare.url}}}</code></pre> {{subTemplate "article-compare-permission" article=article compare=compare}}
|
||||
<pre class="prettyprint language-html" data-type="{{toLowerCase article.type}}"><code>{{{showDiff article.url compare.url}}}</code></pre>
|
||||
|
||||
{{subTemplate "article-compare-permission" article=article compare=compare}}
|
||||
|
||||
<ul class="nav nav-tabs nav-tabs-examples">
|
||||
{{#each_compare_title article.examples compare.examples}} {{#if typeSame}}
|
||||
{{#each_compare_title article.examples compare.examples}}
|
||||
{{#if typeSame}}
|
||||
<li{{#if_eq index compare=0}} class="active"{{/if_eq}}>
|
||||
<a href="#compare-examples-{{../../article.id}}-{{index}}">{{{showDiff source.title compare.title}}}</a>
|
||||
</li>
|
||||
{{/if}} {{#if typeIns}}
|
||||
{{/if}}
|
||||
|
||||
{{#if typeIns}}
|
||||
<li{{#if_eq index compare=0}} class="active"{{/if_eq}}>
|
||||
<a href="#compare-examples-{{../../article.id}}-{{index}}"><ins>{{{source.title}}}</ins></a>
|
||||
</li>
|
||||
{{/if}} {{#if typeDel}}
|
||||
{{/if}}
|
||||
|
||||
{{#if typeDel}}
|
||||
<li{{#if_eq index compare=0}} class="active"{{/if_eq}}>
|
||||
<a href="#compare-examples-{{../../article.id}}-{{index}}"><del>{{{compare.title}}}</del></a>
|
||||
</li>
|
||||
{{/if}} {{/each_compare_title}}
|
||||
{{/if}}
|
||||
{{/each_compare_title}}
|
||||
</ul>
|
||||
|
||||
<div class="tab-content">
|
||||
{{#each_compare_title article.examples compare.examples}} {{#if typeSame}}
|
||||
{{#each_compare_title article.examples compare.examples}}
|
||||
|
||||
{{#if typeSame}}
|
||||
<div class="tab-pane{{#if_eq index compare=0}} active{{/if_eq}}" id="compare-examples-{{../../article.id}}-{{index}}">
|
||||
<pre class="prettyprint language-{{source.type}}" data-type="{{source.type}}"><code>{{{showDiff source.content compare.content}}}</code></pre>
|
||||
</div>
|
||||
{{/if}} {{#if typeIns}}
|
||||
{{/if}}
|
||||
|
||||
{{#if typeIns}}
|
||||
<div class="tab-pane{{#if_eq index compare=0}} active{{/if_eq}}" id="compare-examples-{{../../article.id}}-{{index}}">
|
||||
<pre class="prettyprint language-{{source.type}}" data-type="{{source.type}}"><code>{{{source.content}}}</code></pre>
|
||||
</div>
|
||||
{{/if}} {{#if typeDel}}
|
||||
{{/if}}
|
||||
|
||||
{{#if typeDel}}
|
||||
<div class="tab-pane{{#if_eq index compare=0}} active{{/if_eq}}" id="compare-examples-{{../../article.id}}-{{index}}">
|
||||
<pre class="prettyprint language-{{source.type}}" data-type="{{compare.type}}"><code>{{{compare.content}}}</code></pre>
|
||||
</div>
|
||||
{{/if}} {{/each_compare_title}}
|
||||
{{/if}}
|
||||
|
||||
{{/each_compare_title}}
|
||||
</div>
|
||||
|
||||
{{subTemplate "article-compare-param-block" source=article.parameter compare=compare.parameter _hasType=_hasTypeInParameterFields section="parameter"}} {{subTemplate "article-compare-param-block" source=article.success compare=compare.success _hasType=_hasTypeInSuccessFields
|
||||
section="success"}} {{subTemplate "article-compare-param-block" source=article.error compare=compare.error _col1="Name" _hasType=_hasTypeInErrorFields section="error"}} {{subTemplate "article-sample-request" article=article id=id}}
|
||||
{{subTemplate "article-compare-param-block" source=article.parameter compare=compare.parameter _hasType=_hasTypeInParameterFields section="parameter"}}
|
||||
{{subTemplate "article-compare-param-block" source=article.success compare=compare.success _hasType=_hasTypeInSuccessFields section="success"}}
|
||||
{{subTemplate "article-compare-param-block" source=article.error compare=compare.error _col1="Name" _hasType=_hasTypeInErrorFields section="error"}}
|
||||
|
||||
{{subTemplate "article-sample-request" article=article id=id}}
|
||||
|
||||
</article>
|
||||
</script>
|
||||
|
||||
<script id="template-article-compare-permission" type="text/x-handlebars-template">
|
||||
<p>
|
||||
{{__ "Permission:"}} {{#each_compare_list_field article.permission compare.permission field="name"}} {{#if source}} {{#if typeSame}} {{source.name}} {{#if source.title}}
|
||||
{{__ "Permission:"}}
|
||||
{{#each_compare_list_field article.permission compare.permission field="name"}}
|
||||
{{#if source}}
|
||||
{{#if typeSame}}
|
||||
{{source.name}}
|
||||
{{#if source.title}}
|
||||
<button type="button" class="btn btn-info btn-xs" data-title="{{source.title}}" data-content="{{nl2br source.description}}" data-html="true" data-toggle="popover" data-placement="right" data-trigger="hover">
|
||||
<span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span>
|
||||
</button> {{#unless _last}}, {{/unless}} {{/if}} {{/if}} {{#if typeIns}}
|
||||
<ins>{{source.name}}</ins> {{#if source.title}}
|
||||
</button>
|
||||
{{#unless _last}}, {{/unless}}
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
|
||||
{{#if typeIns}}
|
||||
<ins>{{source.name}}</ins>
|
||||
{{#if source.title}}
|
||||
<button type="button" class="btn btn-info btn-xs" data-title="{{source.title}}" data-content="{{nl2br source.description}}" data-html="true" data-toggle="popover" data-placement="right" data-trigger="hover">
|
||||
<span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span>
|
||||
</button> {{#unless _last}}, {{/unless}} {{/if}} {{/if}} {{#if typeDel}}
|
||||
<del>{{source.name}}</del> {{#if source.title}}
|
||||
</button>
|
||||
{{#unless _last}}, {{/unless}}
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
|
||||
{{#if typeDel}}
|
||||
<del>{{source.name}}</del>
|
||||
{{#if source.title}}
|
||||
<button type="button" class="btn btn-info btn-xs" data-title="{{source.title}}" data-content="{{nl2br source.description}}" data-html="true" data-toggle="popover" data-placement="right" data-trigger="hover">
|
||||
<span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span>
|
||||
</button> {{#unless _last}}, {{/unless}} {{/if}} {{/if}} {{else}} {{#if typeSame}} {{compare.name}} {{#if compare.title}}
|
||||
</button>
|
||||
{{#unless _last}}, {{/unless}}
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
{{else}}
|
||||
{{#if typeSame}}
|
||||
{{compare.name}}
|
||||
{{#if compare.title}}
|
||||
<button type="button" class="btn btn-info btn-xs" data-title="{{compare.title}}" data-content="{{nl2br compare.description}}" data-html="true" data-toggle="popover" data-placement="right" data-trigger="hover">
|
||||
<span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span>
|
||||
</button> {{#unless _last}}, {{/unless}} {{/if}} {{/if}} {{#if typeIns}}
|
||||
<ins>{{compare.name}}</ins> {{#if compare.title}}
|
||||
</button>
|
||||
{{#unless _last}}, {{/unless}}
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
|
||||
{{#if typeIns}}
|
||||
<ins>{{compare.name}}</ins>
|
||||
{{#if compare.title}}
|
||||
<button type="button" class="btn btn-info btn-xs" data-title="{{compare.title}}" data-content="{{nl2br compare.description}}" data-html="true" data-toggle="popover" data-placement="right" data-trigger="hover">
|
||||
<span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span>
|
||||
</button> {{#unless _last}}, {{/unless}} {{/if}} {{/if}} {{#if typeDel}}
|
||||
<del>{{compare.name}}</del> {{#if compare.title}}
|
||||
</button>
|
||||
{{#unless _last}}, {{/unless}}
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
|
||||
{{#if typeDel}}
|
||||
<del>{{compare.name}}</del>
|
||||
{{#if compare.title}}
|
||||
<button type="button" class="btn btn-info btn-xs" data-title="{{compare.title}}" data-content="{{nl2br compare.description}}" data-html="true" data-toggle="popover" data-placement="right" data-trigger="hover">
|
||||
<span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span>
|
||||
</button> {{#unless _last}}, {{/unless}} {{/if}} {{/if}} {{/if}} {{/each_compare_list_field}}
|
||||
</button>
|
||||
{{#unless _last}}, {{/unless}}
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
{{/each_compare_list_field}}
|
||||
</p>
|
||||
</script>
|
||||
|
||||
<script id="template-article-compare-param-block" type="text/x-handlebars-template">
|
||||
{{#if source}} {{#each_compare_keys source.fields compare.fields}} {{#if typeSame}}
|
||||
{{#if source}}
|
||||
{{#each_compare_keys source.fields compare.fields}}
|
||||
{{#if typeSame}}
|
||||
<h2>{{__ source.key}}</h2>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 30%">{{#if ../_col1}}{{__ ../_col1}}{{else}}{{__ "Field"}}{{/if}}</th>
|
||||
{{#if ../_hasType}}
|
||||
<th style="width: 10%">{{__ "Type"}}</th>{{/if}}
|
||||
{{#if ../_hasType}}<th style="width: 10%">{{__ "Type"}}</th>{{/if}}
|
||||
<th style="width: {{#if ../_hasType}}60%{{else}}70%{{/if}}">{{__ "Description"}}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
{{subTemplate "article-compare-param-block-body" source=source.value compare=compare.value _hasType=../_hasType}}
|
||||
</table>
|
||||
{{/if}} {{#if typeIns}}
|
||||
{{/if}}
|
||||
|
||||
{{#if typeIns}}
|
||||
<h2><ins>{{__ source.key}}</ins></h2>
|
||||
<table class="ins">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 30%">{{#if ../_col1}}{{__ ../_col1}}{{else}}{{__ "Field"}}{{/if}}</th>
|
||||
{{#if ../_hasType}}
|
||||
<th style="width: 10%">{{__ "Type"}}</th>{{/if}}
|
||||
{{#if ../_hasType}}<th style="width: 10%">{{__ "Type"}}</th>{{/if}}
|
||||
<th style="width: {{#if ../_hasType}}60%{{else}}70%{{/if}}">{{__ "Description"}}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
{{subTemplate "article-compare-param-block-body" source=source.value compare=source.value _hasType=../_hasType}}
|
||||
</table>
|
||||
{{/if}} {{#if typeDel}}
|
||||
{{/if}}
|
||||
|
||||
{{#if typeDel}}
|
||||
<h2><del>{{__ compare.key}}</del></h2>
|
||||
<table class="del">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 30%">{{#if ../_col1}}{{__ ../_col1}}{{else}}{{__ "Field"}}{{/if}}</th>
|
||||
{{#if ../_hasType}}
|
||||
<th style="width: 10%">{{__ "Type"}}</th>{{/if}}
|
||||
{{#if ../_hasType}}<th style="width: 10%">{{__ "Type"}}</th>{{/if}}
|
||||
<th style="width: {{#if ../_hasType}}60%{{else}}70%{{/if}}">{{__ "Description"}}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
{{subTemplate "article-compare-param-block-body" source=compare.value compare=compare.value _hasType=../_hasType}}
|
||||
</table>
|
||||
{{/if}} {{/each_compare_keys}} {{#if source.examples}}
|
||||
{{/if}}
|
||||
{{/each_compare_keys}}
|
||||
|
||||
{{#if source.examples}}
|
||||
<ul class="nav nav-tabs nav-tabs-examples">
|
||||
{{#each_compare_title source.examples compare.examples}} {{#if typeSame}}
|
||||
{{#each_compare_title source.examples compare.examples}}
|
||||
{{#if typeSame}}
|
||||
<li{{#if_eq index compare=0}} class="active"{{/if_eq}}>
|
||||
<a href="#{{../../section}}-compare-examples-{{../../article.id}}-{{index}}">{{{showDiff source.title compare.title}}}</a>
|
||||
</li>
|
||||
{{/if}} {{#if typeIns}}
|
||||
{{/if}}
|
||||
|
||||
{{#if typeIns}}
|
||||
<li{{#if_eq index compare=0}} class="active"{{/if_eq}}>
|
||||
<a href="#{{../../section}}-compare-examples-{{../../article.id}}-{{index}}"><ins>{{{source.title}}}</ins></a>
|
||||
</li>
|
||||
{{/if}} {{#if typeDel}}
|
||||
{{/if}}
|
||||
|
||||
{{#if typeDel}}
|
||||
<li{{#if_eq index compare=0}} class="active"{{/if_eq}}>
|
||||
<a href="#{{../../section}}-compare-examples-{{../../article.id}}-{{index}}"><del>{{{compare.title}}}</del></a>
|
||||
</li>
|
||||
{{/if}} {{/each_compare_title}}
|
||||
{{/if}}
|
||||
{{/each_compare_title}}
|
||||
</ul>
|
||||
|
||||
<div class="tab-content">
|
||||
{{#each_compare_title source.examples compare.examples}} {{#if typeSame}}
|
||||
{{#each_compare_title source.examples compare.examples}}
|
||||
|
||||
{{#if typeSame}}
|
||||
<div class="tab-pane{{#if_eq index compare=0}} active{{/if_eq}}" id="{{../../section}}-compare-examples-{{../../article.id}}-{{index}}">
|
||||
<pre class="prettyprint language-{{source.type}}" data-type="{{source.type}}"><code>{{{showDiff source.content compare.content}}}</code></pre>
|
||||
</div>
|
||||
{{/if}} {{#if typeIns}}
|
||||
{{/if}}
|
||||
|
||||
{{#if typeIns}}
|
||||
<div class="tab-pane{{#if_eq index compare=0}} active{{/if_eq}}" id="{{../../section}}-compare-examples-{{../../article.id}}-{{index}}">
|
||||
<pre class="prettyprint language-{{source.type}}" data-type="{{source.type}}"><code>{{{source.content}}}</code></pre>
|
||||
</div>
|
||||
{{/if}} {{#if typeDel}}
|
||||
{{/if}}
|
||||
|
||||
{{#if typeDel}}
|
||||
<div class="tab-pane{{#if_eq index compare=0}} active{{/if_eq}}" id="{{../../section}}-compare-examples-{{../../article.id}}-{{index}}">
|
||||
<pre class="prettyprint language-{{source.type}}" data-type="{{compare.type}}"><code>{{{compare.content}}}</code></pre>
|
||||
</div>
|
||||
{{/if}} {{/each_compare_title}}
|
||||
{{/if}}
|
||||
{{/each_compare_title}}
|
||||
</div>
|
||||
{{/if}} {{/if}}
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
</script>
|
||||
|
||||
<script id="template-article-compare-param-block-body" type="text/x-handlebars-template">
|
||||
<tbody>
|
||||
{{#each_compare_field source compare}} {{#if typeSame}}
|
||||
{{#each_compare_field source compare}}
|
||||
{{#if typeSame}}
|
||||
<tr>
|
||||
<td class="code">
|
||||
{{{splitFill source.field "." " "}}} {{#if source.optional}} {{#if compare.optional}} <span class="label label-optional">{{__ "optional"}}</span> {{else}} <span class="label label-optional label-ins">{{__ "optional"}}</span> {{/if}}
|
||||
{{else}} {{#if compare.optional}} <span class="label label-optional label-del">{{__ "optional"}}</span>{{/if}} {{/if}}
|
||||
{{{splitFill source.field "." " "}}}
|
||||
{{#if source.optional}}
|
||||
{{#if compare.optional}} <span class="label label-optional">{{__ "optional"}}</span>
|
||||
{{else}} <span class="label label-optional label-ins">{{__ "optional"}}</span>
|
||||
{{/if}}
|
||||
{{else}}
|
||||
{{#if compare.optional}} <span class="label label-optional label-del">{{__ "optional"}}</span>{{/if}}
|
||||
{{/if}}
|
||||
</td>
|
||||
|
||||
{{#if source.type}} {{#if compare.type}}
|
||||
{{#if source.type}}
|
||||
{{#if compare.type}}
|
||||
<td>{{{showDiff source.type compare.type}}}</td>
|
||||
{{else}}
|
||||
<td>{{{source.type}}}</td>
|
||||
{{/if}} {{else}} {{#if compare.type}}
|
||||
{{/if}}
|
||||
{{else}}
|
||||
{{#if compare.type}}
|
||||
<td>{{{compare.type}}}</td>
|
||||
{{else}} {{#if ../../../../_hasType}}
|
||||
<td></td>{{/if}} {{/if}} {{/if}}
|
||||
{{else}}
|
||||
{{#if ../../../../_hasType}}<td></td>{{/if}}
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
<td>
|
||||
{{{showDiff source.description compare.description "nl2br"}}} {{#if source.defaultValue}}
|
||||
<p class="default-value">{{__ "Default value:"}} <code>{{{showDiff source.defaultValue compare.defaultValue}}}</code>
|
||||
<p>{{/if}}
|
||||
{{{showDiff source.description compare.description "nl2br"}}}
|
||||
{{#if source.defaultValue}}<p class="default-value">{{__ "Default value:"}} <code>{{{showDiff source.defaultValue compare.defaultValue}}}</code><p>{{/if}}
|
||||
</td>
|
||||
</tr>
|
||||
{{/if}} {{#if typeIns}}
|
||||
{{/if}}
|
||||
|
||||
{{#if typeIns}}
|
||||
<tr class="ins">
|
||||
<td class="code">
|
||||
{{{splitFill source.field "." " "}}} {{#if source.optional}} <span class="label label-optional label-ins">{{__ "optional"}}</span>{{/if}}
|
||||
{{{splitFill source.field "." " "}}}
|
||||
{{#if source.optional}} <span class="label label-optional label-ins">{{__ "optional"}}</span>{{/if}}
|
||||
</td>
|
||||
|
||||
{{#if source.type}}
|
||||
<td>{{{source.type}}}</td>
|
||||
{{else}} {{{typRowTd}}} {{/if}}
|
||||
{{else}}
|
||||
{{{typRowTd}}}
|
||||
{{/if}}
|
||||
|
||||
<td>
|
||||
{{{nl2br source.description}}} {{#if source.defaultValue}}
|
||||
<p class="default-value">{{__ "Default value:"}} <code>{{{source.defaultValue}}}</code>
|
||||
<p>{{/if}}
|
||||
{{{nl2br source.description}}}
|
||||
{{#if source.defaultValue}}<p class="default-value">{{__ "Default value:"}} <code>{{{source.defaultValue}}}</code><p>{{/if}}
|
||||
</td>
|
||||
</tr>
|
||||
{{/if}} {{#if typeDel}}
|
||||
{{/if}}
|
||||
|
||||
{{#if typeDel}}
|
||||
<tr class="del">
|
||||
<td class="code">
|
||||
{{{splitFill compare.field "." " "}}} {{#if compare.optional}} <span class="label label-optional label-del">{{__ "optional"}}</span>{{/if}}
|
||||
{{{splitFill compare.field "." " "}}}
|
||||
{{#if compare.optional}} <span class="label label-optional label-del">{{__ "optional"}}</span>{{/if}}
|
||||
</td>
|
||||
|
||||
{{#if compare.type}}
|
||||
<td>{{{compare.type}}}</td>
|
||||
{{else}} {{{typRowTd}}} {{/if}}
|
||||
{{else}}
|
||||
{{{typRowTd}}}
|
||||
{{/if}}
|
||||
|
||||
<td>
|
||||
{{{nl2br compare.description}}} {{#if compare.defaultValue}}
|
||||
<p class="default-value">{{__ "Default value:"}} <code>{{{compare.defaultValue}}}</code>
|
||||
<p>{{/if}}
|
||||
{{{nl2br compare.description}}}
|
||||
{{#if compare.defaultValue}}<p class="default-value">{{__ "Default value:"}} <code>{{{compare.defaultValue}}}</code><p>{{/if}}
|
||||
</td>
|
||||
</tr>
|
||||
{{/if}} {{/each_compare_field}}
|
||||
{{/if}}
|
||||
|
||||
{{/each_compare_field}}
|
||||
</tbody>
|
||||
</script>
|
||||
|
||||
|
@ -511,22 +652,13 @@
|
|||
<div id="loader">
|
||||
<div class="spinner">
|
||||
<div class="spinner-container container1">
|
||||
<div class="circle1"></div>
|
||||
<div class="circle2"></div>
|
||||
<div class="circle3"></div>
|
||||
<div class="circle4"></div>
|
||||
<div class="circle1"></div><div class="circle2"></div><div class="circle3"></div><div class="circle4"></div>
|
||||
</div>
|
||||
<div class="spinner-container container2">
|
||||
<div class="circle1"></div>
|
||||
<div class="circle2"></div>
|
||||
<div class="circle3"></div>
|
||||
<div class="circle4"></div>
|
||||
<div class="circle1"></div><div class="circle2"></div><div class="circle3"></div><div class="circle4"></div>
|
||||
</div>
|
||||
<div class="spinner-container container3">
|
||||
<div class="circle1"></div>
|
||||
<div class="circle2"></div>
|
||||
<div class="circle3"></div>
|
||||
<div class="circle4"></div>
|
||||
<div class="circle1"></div><div class="circle2"></div><div class="circle3"></div><div class="circle4"></div>
|
||||
</div>
|
||||
<p>Loading...</p>
|
||||
</div>
|
||||
|
@ -534,5 +666,4 @@
|
|||
|
||||
<script data-main="main.js" src="vendor/require.min.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
|
|
@ -107,21 +107,14 @@ require([
|
|||
// sort api within a group by title ASC and custom order
|
||||
//
|
||||
var newList = [];
|
||||
var umlauts = {
|
||||
'ä': 'ae',
|
||||
'ü': 'ue',
|
||||
'ö': 'oe',
|
||||
'ß': 'ss'
|
||||
}; // TODO: remove in version 1.0
|
||||
var umlauts = { 'ä': 'ae', 'ü': 'ue', 'ö': 'oe', 'ß': 'ss' }; // TODO: remove in version 1.0
|
||||
$.each (apiByGroupAndName, function(index, groupEntries) {
|
||||
// get titles from the first entry of group[].name[] (name has versioning)
|
||||
var titles = [];
|
||||
$.each (groupEntries, function(titleName, entries) {
|
||||
var title = entries[0].title;
|
||||
if(title !== undefined) {
|
||||
title.toLowerCase().replace(/[äöüß]/g, function ($0) {
|
||||
return umlauts[$0];
|
||||
});
|
||||
title.toLowerCase().replace(/[äöüß]/g, function($0) { return umlauts[$0]; });
|
||||
titles.push(title + '#~#' + titleName); // '#~#' keep reference to titleName after sorting
|
||||
}
|
||||
});
|
||||
|
@ -300,9 +293,7 @@ require([
|
|||
$('#generator').append( templateGenerator(apiProject) );
|
||||
|
||||
// render Project
|
||||
_.extend(apiProject, {
|
||||
versions: apiVersions
|
||||
});
|
||||
_.extend(apiProject, { versions: apiVersions});
|
||||
$('#project').append( templateProject(apiProject) );
|
||||
|
||||
// render apiDoc, header/footer documentation
|
||||
|
@ -384,19 +375,14 @@ require([
|
|||
$('#sections').append( content );
|
||||
|
||||
// Bootstrap Scrollspy
|
||||
$(this).scrollspy({
|
||||
target: '#scrollingNav',
|
||||
offset: 18
|
||||
});
|
||||
$(this).scrollspy({ target: '#scrollingNav', offset: 18 });
|
||||
|
||||
// Content-Scroll on Navigation click.
|
||||
$('.sidenav').find('a').on('click', function(e) {
|
||||
e.preventDefault();
|
||||
var id = $(this).attr('href');
|
||||
if ($(id).length > 0)
|
||||
$('html,body').animate({
|
||||
scrollTop: parseInt($(id).offset().top)
|
||||
}, 400);
|
||||
$('html,body').animate({ scrollTop: parseInt($(id).offset().top) }, 400);
|
||||
window.location.hash = $(this).attr('href');
|
||||
});
|
||||
|
||||
|
@ -404,9 +390,7 @@ require([
|
|||
if(window.location.hash) {
|
||||
var id = window.location.hash;
|
||||
if ($(id).length > 0)
|
||||
$('html,body').animate({
|
||||
scrollTop: parseInt($(id).offset().top)
|
||||
}, 0);
|
||||
$('html,body').animate({ scrollTop: parseInt($(id).offset().top) }, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -419,9 +403,7 @@ require([
|
|||
function _hasTypeInFields(fields) {
|
||||
var result = false;
|
||||
$.each(fields, function(name) {
|
||||
result = result || _.some(fields[name], function (item) {
|
||||
return item.type;
|
||||
});
|
||||
result = result || _.some(fields[name], function(item) { return item.type; });
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
@ -537,9 +519,7 @@ require([
|
|||
|
||||
if (window.location.hash) {
|
||||
var id = window.location.hash;
|
||||
$('html,body').animate({
|
||||
scrollTop: parseInt($(id).offset().top) - 18
|
||||
}, 0);
|
||||
$('html,body').animate({ scrollTop: parseInt($(id).offset().top) - 18 }, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -569,7 +549,8 @@ require([
|
|||
$('span.search-reset').on('click', function() {
|
||||
$('#scrollingNav .sidenav-search input.search')
|
||||
.val("")
|
||||
.focus();
|
||||
.focus()
|
||||
;
|
||||
endpointsList.search();
|
||||
});
|
||||
|
||||
|
@ -706,9 +687,7 @@ require([
|
|||
reversed.forEach(function (item, index) {
|
||||
var parts = item.field.split(".");
|
||||
if (parts.length - 1 == dot_count) {
|
||||
var fields_names = fields.map(function (item) {
|
||||
return item.field;
|
||||
});
|
||||
var fields_names = fields.map(function (item) { return item.field; });
|
||||
if (parts.slice(1).length >= 1) {
|
||||
var prefix = parts.slice(0, parts.length - 1).join(".");
|
||||
var prefix_index = fields_names.indexOf(prefix);
|
||||
|
|
|
@ -515,7 +515,7 @@ func APILoginHandler(c *gin.Context) {
|
|||
}
|
||||
|
||||
/**
|
||||
* @api {post} /profile/ Get a user profile
|
||||
* @api {get} /profile/ Get a user profile
|
||||
* @apiVersion 1.1.1
|
||||
* @apiName Profile
|
||||
* @apiGroup Users
|
||||
|
|
Référencer dans un nouveau ticket