Docs - add 'fr' translation + fixes
This commit is contained in:
@ -110,11 +110,11 @@ def get_records(auth_user: User) -> Dict:
|
||||
|
||||
:reqheader Authorization: OAuth 2.0 Bearer Token
|
||||
|
||||
:statuscode 200: success
|
||||
:statuscode 200: ``success``
|
||||
:statuscode 401:
|
||||
- provide a valid auth token
|
||||
- signature expired, please log in again
|
||||
- invalid token, please log in again
|
||||
- ``provide a valid auth token``
|
||||
- ``signature expired, please log in again``
|
||||
- ``invalid token, please log in again``
|
||||
|
||||
"""
|
||||
records = (
|
||||
|
@ -35,7 +35,7 @@ def get_sports(auth_user: User) -> Dict:
|
||||
|
||||
**Example response**:
|
||||
|
||||
- for non admin user :
|
||||
- for non admin user:
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
@ -98,7 +98,7 @@ def get_sports(auth_user: User) -> Dict:
|
||||
"status": "success"
|
||||
}
|
||||
|
||||
- for admin user :
|
||||
- for admin user:
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
@ -169,11 +169,11 @@ def get_sports(auth_user: User) -> Dict:
|
||||
|
||||
:reqheader Authorization: OAuth 2.0 Bearer Token
|
||||
|
||||
:statuscode 200: success
|
||||
:statuscode 200: ``success``
|
||||
:statuscode 401:
|
||||
- provide a valid auth token
|
||||
- signature expired, please log in again
|
||||
- invalid token, please log in again
|
||||
- ``provide a valid auth token``
|
||||
- ``signature expired, please log in again``
|
||||
- ``invalid token, please log in again``
|
||||
|
||||
"""
|
||||
sports = Sport.query.order_by(Sport.id).all()
|
||||
@ -213,7 +213,7 @@ def get_sport(auth_user: User, sport_id: int) -> Union[Dict, HttpResponse]:
|
||||
|
||||
**Example response**:
|
||||
|
||||
- success for non admin user :
|
||||
- success for non admin user:
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
@ -236,7 +236,7 @@ def get_sport(auth_user: User, sport_id: int) -> Union[Dict, HttpResponse]:
|
||||
"status": "success"
|
||||
}
|
||||
|
||||
- success for admin user :
|
||||
- success for admin user:
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
@ -260,7 +260,7 @@ def get_sport(auth_user: User, sport_id: int) -> Union[Dict, HttpResponse]:
|
||||
"status": "success"
|
||||
}
|
||||
|
||||
- sport not found
|
||||
- sport not found:
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
@ -278,12 +278,12 @@ def get_sport(auth_user: User, sport_id: int) -> Union[Dict, HttpResponse]:
|
||||
|
||||
:reqheader Authorization: OAuth 2.0 Bearer Token
|
||||
|
||||
:statuscode 200: success
|
||||
:statuscode 200: ``success``
|
||||
:statuscode 401:
|
||||
- provide a valid auth token
|
||||
- signature expired, please log in again
|
||||
- invalid token, please log in again
|
||||
:statuscode 404: sport not found
|
||||
- ``provide a valid auth token``
|
||||
- ``signature expired, please log in again``
|
||||
- ``invalid token, please log in again``
|
||||
:statuscode 404: ``sport not found``
|
||||
|
||||
"""
|
||||
sport = Sport.query.filter_by(id=sport_id).first()
|
||||
@ -326,7 +326,7 @@ def update_sport(auth_user: User, sport_id: int) -> Union[Dict, HttpResponse]:
|
||||
|
||||
**Example responses**:
|
||||
|
||||
- success
|
||||
- success:
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
@ -350,7 +350,7 @@ def update_sport(auth_user: User, sport_id: int) -> Union[Dict, HttpResponse]:
|
||||
"status": "success"
|
||||
}
|
||||
|
||||
- sport not found
|
||||
- sport not found:
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
@ -371,14 +371,14 @@ def update_sport(auth_user: User, sport_id: int) -> Union[Dict, HttpResponse]:
|
||||
:reqheader Authorization: OAuth 2.0 Bearer Token
|
||||
|
||||
:statuscode 200: sport updated
|
||||
:statuscode 400: invalid payload
|
||||
:statuscode 400: ``invalid payload``
|
||||
:statuscode 401:
|
||||
- provide a valid auth token
|
||||
- signature expired, please log in again
|
||||
- invalid token, please log in again
|
||||
:statuscode 403: you do not have permissions
|
||||
:statuscode 404: sport not found
|
||||
:statuscode 500:
|
||||
- ``provide a valid auth token``
|
||||
- ``signature expired, please log in again``
|
||||
- ``invalid token, please log in again``
|
||||
:statuscode 403: ``you do not have permissions``
|
||||
:statuscode 404: ``sport not found``
|
||||
:statuscode 500: ``error, please try again or contact the administrator``
|
||||
|
||||
"""
|
||||
sport_data = request.get_json()
|
||||
|
@ -185,13 +185,13 @@ def get_workouts_by_time(
|
||||
|
||||
**Example requests**:
|
||||
|
||||
- without parameters
|
||||
- without parameters:
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
GET /api/stats/admin/by_time HTTP/1.1
|
||||
|
||||
- with parameters
|
||||
- with parameters:
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
@ -200,7 +200,7 @@ def get_workouts_by_time(
|
||||
|
||||
**Example responses**:
|
||||
|
||||
- success
|
||||
- success:
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
@ -243,7 +243,7 @@ def get_workouts_by_time(
|
||||
"status": "success"
|
||||
}
|
||||
|
||||
- no workouts
|
||||
- no workouts:
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
@ -270,13 +270,12 @@ def get_workouts_by_time(
|
||||
|
||||
:reqheader Authorization: OAuth 2.0 Bearer Token
|
||||
|
||||
:statuscode 200: success
|
||||
:statuscode 200: ``success``
|
||||
:statuscode 401:
|
||||
- provide a valid auth token
|
||||
- signature expired, please log in again
|
||||
- invalid token, please log in again
|
||||
:statuscode 404:
|
||||
- user does not exist
|
||||
- ``provide a valid auth token``
|
||||
- ``signature expired, please log in again``
|
||||
- ``invalid token, please log in again``
|
||||
:statuscode 404: ``user does not exist``
|
||||
|
||||
"""
|
||||
return get_workouts(user_name, 'by_time')
|
||||
@ -294,13 +293,13 @@ def get_workouts_by_sport(
|
||||
|
||||
**Example requests**:
|
||||
|
||||
- without parameters (get stats for all sports with workouts)
|
||||
- without parameters (get stats for all sports with workouts):
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
GET /api/stats/admin/by_sport HTTP/1.1
|
||||
|
||||
- with sport id
|
||||
- with sport id:
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
@ -308,7 +307,7 @@ def get_workouts_by_sport(
|
||||
|
||||
**Example responses**:
|
||||
|
||||
- success
|
||||
- success:
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
@ -347,7 +346,7 @@ def get_workouts_by_sport(
|
||||
"status": "success"
|
||||
}
|
||||
|
||||
- no workouts
|
||||
- no workouts:
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
@ -367,14 +366,14 @@ def get_workouts_by_sport(
|
||||
|
||||
:reqheader Authorization: OAuth 2.0 Bearer Token
|
||||
|
||||
:statuscode 200: success
|
||||
:statuscode 200: ``success``
|
||||
:statuscode 401:
|
||||
- provide a valid auth token
|
||||
- signature expired, please log in again
|
||||
- invalid token, please log in again
|
||||
- ``provide a valid auth token``
|
||||
- ``signature expired, please log in again``
|
||||
- ``invalid token, please log in again``
|
||||
:statuscode 404:
|
||||
- user does not exist
|
||||
- sport does not exist
|
||||
- ``user does not exist``
|
||||
- ``sport does not exist``
|
||||
|
||||
"""
|
||||
return get_workouts(user_name, 'by_sport')
|
||||
@ -414,12 +413,12 @@ def get_application_stats(auth_user: User) -> Dict:
|
||||
|
||||
:reqheader Authorization: OAuth 2.0 Bearer Token
|
||||
|
||||
:statuscode 200: success
|
||||
:statuscode 200: ``success``
|
||||
:statuscode 401:
|
||||
- provide a valid auth token
|
||||
- signature expired, please log in again
|
||||
- invalid token, please log in again
|
||||
:statuscode 403: you do not have permissions
|
||||
- ``provide a valid auth token``
|
||||
- ``signature expired, please log in again``
|
||||
- ``invalid token, please log in again``
|
||||
:statuscode 403: ``you do not have permissions``
|
||||
"""
|
||||
|
||||
nb_workouts = Workout.query.filter().count()
|
||||
|
@ -65,13 +65,13 @@ def get_workouts(auth_user: User) -> Union[Dict, HttpResponse]:
|
||||
|
||||
**Example requests**:
|
||||
|
||||
- without parameters
|
||||
- without parameters:
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
GET /api/workouts/ HTTP/1.1
|
||||
|
||||
- with some query parameters
|
||||
- with some query parameters:
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
@ -79,7 +79,7 @@ def get_workouts(auth_user: User) -> Union[Dict, HttpResponse]:
|
||||
|
||||
**Example responses**:
|
||||
|
||||
- returning at least one workout
|
||||
- returning at least one workout:
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
@ -187,7 +187,7 @@ def get_workouts(auth_user: User) -> Union[Dict, HttpResponse]:
|
||||
:query integer per_page: number of workouts per page
|
||||
(default: 5, max: 100)
|
||||
:query integer sport_id: sport id
|
||||
:quert string title: any part (or all) of the workout title;
|
||||
:query string title: any part (or all) of the workout title;
|
||||
title matching is case-insensitive
|
||||
:query string from: start date (format: ``%Y-%m-%d``)
|
||||
:query string to: end date (format: ``%Y-%m-%d``)
|
||||
@ -206,12 +206,12 @@ def get_workouts(auth_user: User) -> Union[Dict, HttpResponse]:
|
||||
|
||||
:reqheader Authorization: OAuth 2.0 Bearer Token
|
||||
|
||||
:statuscode 200: success
|
||||
:statuscode 200: ``success``
|
||||
:statuscode 401:
|
||||
- provide a valid auth token
|
||||
- signature expired, please log in again
|
||||
- invalid token, please log in again
|
||||
:statuscode 500:
|
||||
- ``provide a valid auth token``
|
||||
- ``signature expired, please log in again``
|
||||
- ``invalid token, please log in again``
|
||||
:statuscode 500: ``error, please try again or contact the administrator``
|
||||
|
||||
"""
|
||||
try:
|
||||
@ -315,7 +315,7 @@ def get_workout(
|
||||
|
||||
**Example responses**:
|
||||
|
||||
- success
|
||||
- success:
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
@ -377,13 +377,13 @@ def get_workout(
|
||||
|
||||
:reqheader Authorization: OAuth 2.0 Bearer Token
|
||||
|
||||
:statuscode 200: success
|
||||
:statuscode 200: ``success``
|
||||
:statuscode 401:
|
||||
- provide a valid auth token
|
||||
- signature expired, please log in again
|
||||
- invalid token, please log in again
|
||||
:statuscode 403: you do not have permissions
|
||||
:statuscode 404: workout not found
|
||||
- ``provide a valid auth token``
|
||||
- ``signature expired, please log in again``
|
||||
- ``invalid token, please log in again``
|
||||
:statuscode 403: ``you do not have permissions``
|
||||
:statuscode 404: ``workout not found``
|
||||
|
||||
"""
|
||||
workout_uuid = decode_short_id(workout_short_id)
|
||||
@ -499,15 +499,15 @@ def get_workout_gpx(
|
||||
|
||||
:reqheader Authorization: OAuth 2.0 Bearer Token
|
||||
|
||||
:statuscode 200: success
|
||||
:statuscode 200: ``success``
|
||||
:statuscode 401:
|
||||
- provide a valid auth token
|
||||
- signature expired, please log in again
|
||||
- invalid token, please log in again
|
||||
- ``provide a valid auth token``
|
||||
- ``signature expired, please log in again``
|
||||
- ``invalid token, please log in again``
|
||||
:statuscode 404:
|
||||
- workout not found
|
||||
- no gpx file for this workout
|
||||
:statuscode 500:
|
||||
- ``workout not found``
|
||||
- ``no gpx file for this workout``
|
||||
:statuscode 500: ``error, please try again or contact the administrator``
|
||||
|
||||
"""
|
||||
return get_workout_data(auth_user, workout_short_id, 'gpx')
|
||||
@ -570,15 +570,15 @@ def get_workout_chart_data(
|
||||
|
||||
:reqheader Authorization: OAuth 2.0 Bearer Token
|
||||
|
||||
:statuscode 200: success
|
||||
:statuscode 200: ``success``
|
||||
:statuscode 401:
|
||||
- provide a valid auth token
|
||||
- signature expired, please log in again
|
||||
- invalid token, please log in again
|
||||
- ``provide a valid auth token``
|
||||
- ``signature expired, please log in again``
|
||||
- ``invalid token, please log in again``
|
||||
:statuscode 404:
|
||||
- workout not found
|
||||
- no gpx file for this workout
|
||||
:statuscode 500:
|
||||
- ``workout not found``
|
||||
- ``no gpx file for this workout``
|
||||
:statuscode 500: ``error, please try again or contact the administrator``
|
||||
|
||||
"""
|
||||
return get_workout_data(auth_user, workout_short_id, 'chart_data')
|
||||
@ -624,14 +624,14 @@ def get_segment_gpx(
|
||||
|
||||
:reqheader Authorization: OAuth 2.0 Bearer Token
|
||||
|
||||
:statuscode 200: success
|
||||
:statuscode 400: no gpx file for this workout
|
||||
:statuscode 200: ``success``
|
||||
:statuscode 400: ``no gpx file for this workout``
|
||||
:statuscode 401:
|
||||
- provide a valid auth token
|
||||
- signature expired, please log in again
|
||||
- invalid token, please log in again
|
||||
:statuscode 404: workout not found
|
||||
:statuscode 500:
|
||||
- ``provide a valid auth token``
|
||||
- ``signature expired, please log in again``
|
||||
- ``invalid token, please log in again``
|
||||
:statuscode 404: ``workout not found``
|
||||
:statuscode 500: ``error, please try again or contact the administrator``
|
||||
|
||||
"""
|
||||
return get_workout_data(auth_user, workout_short_id, 'gpx', segment_id)
|
||||
@ -647,7 +647,7 @@ def get_segment_chart_data(
|
||||
auth_user: User, workout_short_id: str, segment_id: int
|
||||
) -> Union[Dict, HttpResponse]:
|
||||
"""
|
||||
Get chart data from a workout gpx file, to display it with Recharts
|
||||
Get chart data from a workout gpx file, to display it with Chart.js.
|
||||
|
||||
**Scope**: ``workouts:read``
|
||||
|
||||
@ -697,14 +697,14 @@ def get_segment_chart_data(
|
||||
|
||||
:reqheader Authorization: OAuth 2.0 Bearer Token
|
||||
|
||||
:statuscode 200: success
|
||||
:statuscode 400: no gpx file for this workout
|
||||
:statuscode 200: ``success``
|
||||
:statuscode 400: ``no gpx file for this workout``
|
||||
:statuscode 401:
|
||||
- provide a valid auth token
|
||||
- signature expired, please log in again
|
||||
- invalid token, please log in again
|
||||
:statuscode 404: workout not found
|
||||
:statuscode 500:
|
||||
- ``provide a valid auth token``
|
||||
- ``signature expired, please log in again``
|
||||
- ``invalid token, please log in again``
|
||||
:statuscode 404: ``workout not found``
|
||||
:statuscode 500: ``error, please try again or contact the administrator``
|
||||
|
||||
"""
|
||||
return get_workout_data(
|
||||
@ -739,14 +739,14 @@ def download_workout_gpx(
|
||||
|
||||
:param string workout_short_id: workout short id
|
||||
|
||||
:statuscode 200: success
|
||||
:statuscode 200: ``success``
|
||||
:statuscode 401:
|
||||
- provide a valid auth token
|
||||
- signature expired, please log in again
|
||||
- invalid token, please log in again
|
||||
- ``provide a valid auth token``
|
||||
- ``signature expired, please log in again``
|
||||
- ``invalid token, please log in again``
|
||||
:statuscode 404:
|
||||
- workout not found
|
||||
- no gpx file for workout
|
||||
- ``workout not found``
|
||||
- ``no gpx file for workout``
|
||||
"""
|
||||
workout_uuid = decode_short_id(workout_short_id)
|
||||
workout = Workout.query.filter_by(
|
||||
@ -794,13 +794,13 @@ def get_map(map_id: int) -> Union[HttpResponse, Response]:
|
||||
|
||||
:param string map_id: workout map id
|
||||
|
||||
:statuscode 200: success
|
||||
:statuscode 200: ``success``
|
||||
:statuscode 401:
|
||||
- provide a valid auth token
|
||||
- signature expired, please log in again
|
||||
- invalid token, please log in again
|
||||
:statuscode 404: map does not exist
|
||||
:statuscode 500:
|
||||
- ``provide a valid auth token``
|
||||
- ``signature expired, please log in again``
|
||||
- ``invalid token, please log in again``
|
||||
:statuscode 404: ``map does not exist``
|
||||
:statuscode 500: ``error, please try again or contact the administrator``
|
||||
|
||||
"""
|
||||
try:
|
||||
@ -967,16 +967,16 @@ def post_workout(auth_user: User) -> Union[Tuple[Dict, int], HttpResponse]:
|
||||
|
||||
:statuscode 201: workout created
|
||||
:statuscode 400:
|
||||
- invalid payload
|
||||
- no file part
|
||||
- no selected file
|
||||
- file extension not allowed
|
||||
- ``invalid payload``
|
||||
- ``no file part``
|
||||
- ``no selected file``
|
||||
- ``file extension not allowed``
|
||||
:statuscode 401:
|
||||
- provide a valid auth token
|
||||
- signature expired, please log in again
|
||||
- invalid token, please log in again
|
||||
:statuscode 413: error during picture update: file size exceeds 1.0MB
|
||||
:statuscode 500:
|
||||
- ``provide a valid auth token``
|
||||
- ``signature expired, please log in again``
|
||||
- ``invalid token, please log in again``
|
||||
:statuscode 413: ``error during picture update: file size exceeds 1.0MB``
|
||||
:statuscode 500: ``error, please try again or contact the administrator``
|
||||
|
||||
"""
|
||||
try:
|
||||
@ -1151,12 +1151,12 @@ def post_workout_no_gpx(
|
||||
:reqheader Authorization: OAuth 2.0 Bearer Token
|
||||
|
||||
:statuscode 201: workout created
|
||||
:statuscode 400: invalid payload
|
||||
:statuscode 400: ``invalid payload``
|
||||
:statuscode 401:
|
||||
- provide a valid auth token
|
||||
- signature expired, please log in again
|
||||
- invalid token, please log in again
|
||||
:statuscode 500:
|
||||
- ``provide a valid auth token``
|
||||
- ``signature expired, please log in again``
|
||||
- ``invalid token, please log in again``
|
||||
:statuscode 500: ``error, please try again or contact the administrator``
|
||||
|
||||
"""
|
||||
workout_data = request.get_json()
|
||||
@ -1325,13 +1325,13 @@ def update_workout(
|
||||
:reqheader Authorization: OAuth 2.0 Bearer Token
|
||||
|
||||
:statuscode 200: workout updated
|
||||
:statuscode 400: invalid payload
|
||||
:statuscode 400: ``invalid payload``
|
||||
:statuscode 401:
|
||||
- provide a valid auth token
|
||||
- signature expired, please log in again
|
||||
- invalid token, please log in again
|
||||
:statuscode 404: workout not found
|
||||
:statuscode 500:
|
||||
- ``provide a valid auth token``
|
||||
- ``signature expired, please log in again``
|
||||
- ``invalid token, please log in again``
|
||||
:statuscode 404: ``workout not found``
|
||||
:statuscode 500: ``error, please try again or contact the administrator``
|
||||
|
||||
"""
|
||||
workout_data = request.get_json()
|
||||
@ -1418,11 +1418,11 @@ def delete_workout(
|
||||
|
||||
:statuscode 204: workout deleted
|
||||
:statuscode 401:
|
||||
- provide a valid auth token
|
||||
- signature expired, please log in again
|
||||
- invalid token, please log in again
|
||||
:statuscode 404: workout not found
|
||||
:statuscode 500: error, please try again or contact the administrator
|
||||
- ``provide a valid auth token``
|
||||
- ``signature expired, please log in again``
|
||||
- ``invalid token, please log in again``
|
||||
:statuscode 404: ``workout not found``
|
||||
:statuscode 500: ``error, please try again or contact the administrator``
|
||||
|
||||
"""
|
||||
|
||||
|
Reference in New Issue
Block a user