From 715da8fc64df4cc1fdd2727137949ae97b0c0633 Mon Sep 17 00:00:00 2001 From: Sam Date: Fri, 19 Jul 2019 12:02:49 +0200 Subject: [PATCH] update docs and api endpoints --- docs/_sources/api/auth.rst.txt | 2 + docs/_sources/api/records.rst.txt | 2 + docs/_sources/api/sports.rst.txt | 2 + docs/_sources/api/stats.rst.txt | 2 + docs/_sources/api/users.rst.txt | 2 + docs/api/auth.html | 43 +++++++++++++++ docs/api/records.html | 1 + docs/api/sports.html | 1 + docs/api/stats.html | 9 +++- docs/api/users.html | 13 +++++ docs/http-routingtable.html | 50 ++++++++++++++++++ docs/objects.inv | Bin 661 -> 774 bytes docs/searchindex.js | 2 +- docsrc/source/api/auth.rst | 2 + docsrc/source/api/records.rst | 2 + docsrc/source/api/sports.rst | 2 + docsrc/source/api/stats.rst | 2 + docsrc/source/api/users.rst | 2 + .../fittrackee_api/activities/stats.py | 3 +- fittrackee_api/fittrackee_api/users/auth.py | 7 +++ fittrackee_api/fittrackee_api/users/users.py | 2 + 21 files changed, 148 insertions(+), 3 deletions(-) diff --git a/docs/_sources/api/auth.rst.txt b/docs/_sources/api/auth.rst.txt index c5c7dc6e..265416ca 100644 --- a/docs/_sources/api/auth.rst.txt +++ b/docs/_sources/api/auth.rst.txt @@ -1,6 +1,8 @@ Authentication ############## +work in progress + .. autoflask:: fittrackee_api:create_app() :endpoints: auth.register_user, diff --git a/docs/_sources/api/records.rst.txt b/docs/_sources/api/records.rst.txt index c78be7c4..fe42bf73 100644 --- a/docs/_sources/api/records.rst.txt +++ b/docs/_sources/api/records.rst.txt @@ -1,6 +1,8 @@ Records ####### +work in progress + .. autoflask:: fittrackee_api:create_app() :endpoints: records.get_records diff --git a/docs/_sources/api/sports.rst.txt b/docs/_sources/api/sports.rst.txt index 84a0b86c..3147efa7 100644 --- a/docs/_sources/api/sports.rst.txt +++ b/docs/_sources/api/sports.rst.txt @@ -1,6 +1,8 @@ Sports ###### +work in progress + .. autoflask:: fittrackee_api:create_app() :endpoints: sports.get_sports, diff --git a/docs/_sources/api/stats.rst.txt b/docs/_sources/api/stats.rst.txt index 0621d298..d802fa3b 100644 --- a/docs/_sources/api/stats.rst.txt +++ b/docs/_sources/api/stats.rst.txt @@ -1,6 +1,8 @@ Statistics ########## +work in progress + .. autoflask:: fittrackee_api:create_app() :endpoints: stats.get_activities_by_sport, diff --git a/docs/_sources/api/users.rst.txt b/docs/_sources/api/users.rst.txt index 09785889..3fc1be80 100644 --- a/docs/_sources/api/users.rst.txt +++ b/docs/_sources/api/users.rst.txt @@ -1,6 +1,8 @@ Users ##### +work in progress + .. autoflask:: fittrackee_api:create_app() :endpoints: users.get_users, diff --git a/docs/api/auth.html b/docs/api/auth.html index cdbcf0ba..452f1e93 100644 --- a/docs/api/auth.html +++ b/docs/api/auth.html @@ -121,6 +121,49 @@

Authentication

+

work in progress

+
+
+POST /api/auth/register
+

register a user

+
+ +
+
+POST /api/auth/login
+

user login

+
+ +
+
+GET /api/auth/logout
+

user logout

+
+ +
+
+GET /api/auth/profile
+

get authenticated user info

+
+ +
+
+POST /api/auth/profile/edit
+

edit authenticated user

+
+ +
+
+POST /api/auth/picture
+

update authenticated user picture

+
+ +
+
+DELETE /api/auth/picture
+

delete authenticated user picture

+
+
diff --git a/docs/api/records.html b/docs/api/records.html index 0cbaf00b..a954dc90 100644 --- a/docs/api/records.html +++ b/docs/api/records.html @@ -121,6 +121,7 @@

Records

+

work in progress

GET /api/records
diff --git a/docs/api/sports.html b/docs/api/sports.html index d5f53b9d..15dbb551 100644 --- a/docs/api/sports.html +++ b/docs/api/sports.html @@ -121,6 +121,7 @@

Sports

+

work in progress

GET /api/sports
diff --git a/docs/api/stats.html b/docs/api/stats.html index 8cbe1bab..f2da2fb5 100644 --- a/docs/api/stats.html +++ b/docs/api/stats.html @@ -121,10 +121,17 @@

Statistics

+

work in progress

+
+
+GET /api/stats/(int: user_id)/by_sport
+

Get activities statistics for a user by sport

+
+
GET /api/stats/(int: user_id)/by_time
-

Get activities statistics for a user

+

Get activities statistics for a user by time

diff --git a/docs/api/users.html b/docs/api/users.html index 5c30926a..224d5aa4 100644 --- a/docs/api/users.html +++ b/docs/api/users.html @@ -121,6 +121,7 @@

Users

+

work in progress

GET /api/users
@@ -133,6 +134,18 @@

Get single user details

+
+
+GET /api/users/(user_id)/picture
+

get user picture

+
+ +
+
+GET /api/ping
+

health check endpoint

+
+
diff --git a/docs/http-routingtable.html b/docs/http-routingtable.html index 3114db7b..58e411a7 100644 --- a/docs/http-routingtable.html +++ b/docs/http-routingtable.html @@ -145,6 +145,21 @@ GET /api/activities/map/(map_id) + + + + GET /api/auth/logout + + + + + GET /api/auth/profile + + + + + GET /api/ping + @@ -160,6 +175,11 @@ GET /api/sports/(int:sport_id) + + + + GET /api/stats/(int:user_id)/by_sport + @@ -175,6 +195,11 @@ GET /api/users/(user_id) + + + + GET /api/users/(user_id)/picture + @@ -185,6 +210,26 @@ POST /api/activities/no_gpx + + + + POST /api/auth/login + + + + + POST /api/auth/picture + + + + + POST /api/auth/profile/edit + + + + + POST /api/auth/register + @@ -195,6 +240,11 @@ DELETE /api/activities/(int:activity_id) + + + + DELETE /api/auth/picture + diff --git a/docs/objects.inv b/docs/objects.inv index 406ab8ee47cf75c72ed303c48abd747574162da1..ab45d0656ba42d2dcccf7f0aba246f772bd11169 100644 GIT binary patch delta 665 zcmV;K0%rY{1%?KYd4HBoZ=5g?hVT3eOTBClF6wn}QKd*ZREnDPyz;^XtO7=6sIvdQ z{sd#Q8)){j!ZYvt*ki_KbJp{m70CZ`vLu|HOTEuuGoj6Se?CfyrydFAYoj0Q5 zT}o4_grj2A$|HanF)4Hc%q2R%R)>I|7dT2-J6aQDai}!Mo34Vk6tfDE;*B@3wH_~D zLF7?#|#hkW*b4Bu4Wer$LZFUp^<;oE3ro~+-r zx%bYOlhGv$*V=g9I%e74PbdHFIgq#Ti7AZT&0v~zOMmBDVd%;a9=h32XUjTidBf}? z26s*LS7pHRSc-zs)q9*gOykU-`NZPy0rH@pphI3TIqtD@Bx^;vvX1^jeZqQvigHvRB)g&km@Mk0!^YfJ+x#=DAVVp}a|1&y z1gZ}~&dQc|>ODw?LWb+SDRf;Gh7xkJPpbk;dJT6K5N5iwI6)ixF$uQq>Q zFkrB8vPm}=3*NlzC<)fo$D0O5?a3$D$XwPFjatJB@ojDOE0>N%G6xsKV`eUcSr z%{3kbM}C(Bvc&J2^i}_UpS;#6PuTLl*qP7&4$w&1tk3N`b(jxu;|*tC>rFM3N{j5p zd3aS|Abai5D~*}dp(~}QZU~d|Q)MiDOX>zXt1$gY zKfbif*2shNIDdeiuJ-YCK-of8x23MjwwSXHau(!1gT=EMPvFYS5mQyM3#M1=S(Grc z`kxOd_Cl4EZC-ZzW8ORAh;=40m?xVRbSO)XQgxF+b^_kliV5_Rr$=fcV{3F#6`sUO zm%bnR+igg4^;h&{^z?aJlX+wrcb+4CwuKDl6prpDuz#Y*R?}CzB<4riRnVv^WzL{u z{+zbd?8zVCIO=8l1LnvNen%?kViOyFgvOEs>d23FNwQuij0cG?nwNh849y(2X{K&3 z*%1%65h1M-8+G(276MN5ONp@oU(o=A89uli-|QmZ8kcUW7|lHXiQ@`3Hu3bU*R~6BGad diff --git a/docs/searchindex.js b/docs/searchindex.js index 44b23638..3cda31bd 100644 --- a/docs/searchindex.js +++ b/docs/searchindex.js @@ -1 +1 @@ -Search.setIndex({docnames:["api/activities","api/auth","api/index","api/records","api/sports","api/stats","api/users","changelog","features","index","installation","troubleshooting/administrator","troubleshooting/index","troubleshooting/user"],envversion:{"sphinx.domains.c":1,"sphinx.domains.changeset":1,"sphinx.domains.citation":1,"sphinx.domains.cpp":1,"sphinx.domains.javascript":1,"sphinx.domains.math":2,"sphinx.domains.python":1,"sphinx.domains.rst":1,"sphinx.domains.std":1,sphinx:56},filenames:["api/activities.rst","api/auth.rst","api/index.rst","api/records.rst","api/sports.rst","api/stats.rst","api/users.rst","changelog.md","features.rst","index.rst","installation.rst","troubleshooting/administrator.rst","troubleshooting/index.rst","troubleshooting/user.rst"],objects:{"":{"/api/activities":[0,1,1,"post--api-activities"],"/api/activities/(int:activity_id)":[0,3,1,"patch--api-activities-(int-activity_id)"],"/api/activities/(int:activity_id)/chart_data":[0,0,1,"get--api-activities-(int-activity_id)-chart_data"],"/api/activities/(int:activity_id)/gpx":[0,0,1,"get--api-activities-(int-activity_id)-gpx"],"/api/activities/map/(map_id)":[0,0,1,"get--api-activities-map-(map_id)"],"/api/activities/no_gpx":[0,1,1,"post--api-activities-no_gpx"],"/api/records":[3,0,1,"get--api-records"],"/api/sports":[4,1,1,"post--api-sports"],"/api/sports/(int:sport_id)":[4,3,1,"patch--api-sports-(int-sport_id)"],"/api/stats/(int:user_id)/by_time":[5,0,1,"get--api-stats-(int-user_id)-by_time"],"/api/users":[6,0,1,"get--api-users"],"/api/users/(user_id)":[6,0,1,"get--api-users-(user_id)"]}},objnames:{"0":["http","get","HTTP get"],"1":["http","post","HTTP post"],"2":["http","delete","HTTP delete"],"3":["http","patch","HTTP patch"]},objtypes:{"0":"http:get","1":"http:post","2":"http:delete","3":"http:patch"},terms:{"default":0,"export":9,"float":0,"int":[0,4,5],"null":0,"return":0,"static":10,NOT:0,Not:0,The:10,Use:7,accord:9,account:8,acit:0,activ:[2,5,7,9],activity_d:0,activity_id:0,adapt:10,add:[7,8,9],admin:[8,10],administr:[8,9,12],all:[3,4,6,10],allow:9,alpinequest:9,also:9,android:9,api:[0,3,4,5,6,8,9,10,11],app:9,applic:[0,9,10],arch:10,archiv:10,ascent:0,auth:0,auth_user_id:0,authent:[0,2,3,9],author:0,ave_spe:0,ave_speed_from:0,ave_speed_to:0,averag:[0,8],bad:0,bearer:0,beta:10,bike:[0,8],bound:0,build:10,by_tim:5,calcul:7,calendar:[7,8],can:[8,9,10],chang:[9,10],charact:12,chart:[0,8,10],chart_data:0,check:11,client:[10,11],clone:10,code:0,column:12,com:10,config:[10,11],content:0,coordin:10,copi:10,correctli:[7,11],creat:[0,8],creation:8,creation_d:0,current:7,custom:[10,11],cycl:8,dark:10,darkski:8,dashboard:[7,9],data:[0,9,10,12],databas:10,date:[0,8],debian:10,delet:[0,4,8],depend:7,desc:0,descent:0,describ:10,detail:[6,7,9],develop:9,displai:[0,7,8,9,10],distanc:[0,7,8],distance_from:0,distance_to:0,document:9,doe:0,download:10,durat:[0,7,8],duration_from:0,duration_to:0,edit:8,elev:[0,8,10],email:10,encount:10,end:0,endpoint:[2,12],enter:8,environn:11,error:[0,7],even:8,exampl:[0,9,10,11],exist:[0,9,11],exodu:9,fa33f4d996844a5c73ecd1ae24456ab8:0,fals:0,farest:8,featur:9,fetch:10,file:[0,7,8,9,10,11],filter:[7,8],fittracke:10,fix:9,flask:10,flaticon:10,follow:10,forbidden:0,forecast:10,form:0,format:0,former:10,forrunn:9,found:0,freepik:10,fri:0,from:[0,9,10],gener:10,get:[0,3,4,5,6],git:10,github:10,gmt:0,gpl:9,gpx:[0,7,8,9,10],gpxpy:10,have:0,header:0,hike:8,his:8,http:[0,10,11],icon:10,imag:[0,10],improv:9,incorrect:7,inform:9,initi:[10,11],instal:9,integ:0,intern:0,invalid:0,issu:[9,10],jan:0,javascript:10,json:[0,12],jul:0,keep:9,kei:[8,10],last:10,leaflet:[0,10],least:0,line:12,linux:10,list:9,local:9,localhost:[10,11],log:[9,10],login:10,longest:8,made:[10,11],mai:10,make:10,makefil:[10,11],mandatori:[0,10],map:[0,8,9,10],map_id:0,max:0,max_alt:0,max_spe:0,max_speed_from:0,max_speed_to:0,maxim:0,maximum:8,mean:11,messag:0,min_alt:0,minim:[0,9],mobil:9,modification_d:0,mon:0,montain:8,month:[7,8],more:9,morn:0,move:[0,7],mpwoadmin:10,multipart:0,must:8,necessari:10,need:10,network:11,next_act:0,no_gpx:0,note:[0,7,8],now:[8,10],number:0,oauth:0,object:0,one:0,onli:[0,8],open:[9,10],order:0,other:10,outdoor:9,own:9,owner:8,packag:10,page:0,pagin:0,paramet:0,pars:[10,12],password:10,past:10,patch:[0,4],paus:[0,7],payload:0,per:0,per_pag:0,permiss:0,png:0,possibl:9,post:[0,4],postgresql:10,prerequisit:9,previous_act:0,privai:9,product:9,proprietari:9,provid:[0,8],python:10,queri:0,react:10,react_app_api_url:11,readi:9,rebuild:11,rechart:[0,10],record:[0,2,7,8,9],record_typ:0,redux:10,regist:10,relat:10,releas:[7,10],repo:10,report:9,request:[0,11],respons:0,run:[8,10],runner:9,samr1:10,search:7,second:0,see:[8,9,10,11],segment:[0,7],serv:10,server:[0,9,10],sever:9,singl:6,sky:10,some:[0,7,10],sort:0,speed:[0,8,10],sport:[0,2,8,9,10],sport_id:[0,4],standard:8,start:[0,10],stat:[5,7],staticmap:10,statist:[2,9],statu:0,step:10,still:9,store:9,street:9,string:0,success:0,sun:0,sundai:0,support:[7,8],system:10,tab:11,tar:10,test:10,them:9,thi:[0,7,9,10],thunderforest:10,time:[0,8],timezon:7,titl:0,todo:[10,13],token:0,tooltip:7,total:7,track:9,tracker:9,transport:8,troubleshoot:9,type:0,unauthor:0,undefin:11,under:9,unexpect:12,updat:[0,4,7,10],upgrad:9,upload:[7,8],user:[0,2,3,5,7,8,9,12],user_id:[0,5,6],using:[0,9],valid:0,valu:[0,10],variabl:11,version:9,view:7,virtualenv:10,walk:8,weather:[7,8,10],weather_end:0,weather_start:0,web:9,were:7,wget:10,when:7,with_gpx:0,without:[0,8,9],workout:9,written:10,www:10,xzf:10,yarn:10,yet:9,you:[0,9],your:9},titles:["Activities","Authentication","API documentation","Records","Sports","Statistics","Users","Change log","Features","FitTrackee","Installation","Administrator","Troubleshooting","User"],titleterms:{"new":7,activ:[0,8],administr:11,api:2,authent:1,bug:7,chang:7,charact:11,close:7,column:11,content:9,dashboard:8,data:11,detail:8,dev:10,document:2,environ:10,featur:[7,8],fittracke:9,fix:7,improv:7,instal:10,issu:7,json:11,line:11,list:8,log:7,minim:7,misc:7,pars:11,prerequisit:10,prod:10,record:3,sport:4,statist:[5,7,8],tabl:9,troubleshoot:12,unexpect:11,upgrad:10,user:[6,13],version:7,workout:8}}) \ No newline at end of file +Search.setIndex({docnames:["api/activities","api/auth","api/index","api/records","api/sports","api/stats","api/users","changelog","features","index","installation","troubleshooting/administrator","troubleshooting/index","troubleshooting/user"],envversion:{"sphinx.domains.c":1,"sphinx.domains.changeset":1,"sphinx.domains.citation":1,"sphinx.domains.cpp":1,"sphinx.domains.javascript":1,"sphinx.domains.math":2,"sphinx.domains.python":1,"sphinx.domains.rst":1,"sphinx.domains.std":1,sphinx:56},filenames:["api/activities.rst","api/auth.rst","api/index.rst","api/records.rst","api/sports.rst","api/stats.rst","api/users.rst","changelog.md","features.rst","index.rst","installation.rst","troubleshooting/administrator.rst","troubleshooting/index.rst","troubleshooting/user.rst"],objects:{"":{"/api/activities":[0,1,1,"post--api-activities"],"/api/activities/(int:activity_id)":[0,3,1,"patch--api-activities-(int-activity_id)"],"/api/activities/(int:activity_id)/chart_data":[0,0,1,"get--api-activities-(int-activity_id)-chart_data"],"/api/activities/(int:activity_id)/gpx":[0,0,1,"get--api-activities-(int-activity_id)-gpx"],"/api/activities/map/(map_id)":[0,0,1,"get--api-activities-map-(map_id)"],"/api/activities/no_gpx":[0,1,1,"post--api-activities-no_gpx"],"/api/auth/login":[1,1,1,"post--api-auth-login"],"/api/auth/logout":[1,0,1,"get--api-auth-logout"],"/api/auth/picture":[1,1,1,"post--api-auth-picture"],"/api/auth/profile":[1,0,1,"get--api-auth-profile"],"/api/auth/profile/edit":[1,1,1,"post--api-auth-profile-edit"],"/api/auth/register":[1,1,1,"post--api-auth-register"],"/api/ping":[6,0,1,"get--api-ping"],"/api/records":[3,0,1,"get--api-records"],"/api/sports":[4,1,1,"post--api-sports"],"/api/sports/(int:sport_id)":[4,3,1,"patch--api-sports-(int-sport_id)"],"/api/stats/(int:user_id)/by_sport":[5,0,1,"get--api-stats-(int-user_id)-by_sport"],"/api/stats/(int:user_id)/by_time":[5,0,1,"get--api-stats-(int-user_id)-by_time"],"/api/users":[6,0,1,"get--api-users"],"/api/users/(user_id)":[6,0,1,"get--api-users-(user_id)"],"/api/users/(user_id)/picture":[6,0,1,"get--api-users-(user_id)-picture"]}},objnames:{"0":["http","get","HTTP get"],"1":["http","post","HTTP post"],"2":["http","delete","HTTP delete"],"3":["http","patch","HTTP patch"]},objtypes:{"0":"http:get","1":"http:post","2":"http:delete","3":"http:patch"},terms:{"default":0,"export":9,"float":0,"int":[0,4,5],"null":0,"return":0,"static":10,NOT:0,Not:0,The:10,Use:7,accord:9,account:8,acit:0,activ:[2,5,7,9],activity_d:0,activity_id:0,adapt:10,add:[7,8,9],admin:[8,10],administr:[8,9,12],all:[3,4,6,10],allow:9,alpinequest:9,also:9,android:9,api:[0,1,3,4,5,6,8,9,10,11],app:9,applic:[0,9,10],arch:10,archiv:10,ascent:0,auth:[0,1],auth_user_id:0,authent:[0,2,3,9],author:0,ave_spe:0,ave_speed_from:0,ave_speed_to:0,averag:[0,8],bad:0,bearer:0,beta:10,bike:[0,8],bound:0,build:10,by_sport:5,by_tim:5,calcul:7,calendar:[7,8],can:[8,9,10],chang:[9,10],charact:12,chart:[0,8,10],chart_data:0,check:[6,11],client:[10,11],clone:10,code:0,column:12,com:10,config:[10,11],content:0,coordin:10,copi:10,correctli:[7,11],creat:[0,8],creation:8,creation_d:0,current:7,custom:[10,11],cycl:8,dark:10,darkski:8,dashboard:[7,9],data:[0,9,10,12],databas:10,date:[0,8],debian:10,delet:[0,1,4,8],depend:7,desc:0,descent:0,describ:10,detail:[6,7,9],develop:9,displai:[0,7,8,9,10],distanc:[0,7,8],distance_from:0,distance_to:0,document:9,doe:0,download:10,durat:[0,7,8],duration_from:0,duration_to:0,edit:[1,8],elev:[0,8,10],email:10,encount:10,end:0,endpoint:[2,6,12],enter:8,environn:11,error:[0,7],even:8,exampl:[0,9,10,11],exist:[0,9,11],exodu:9,fa33f4d996844a5c73ecd1ae24456ab8:0,fals:0,farest:8,featur:9,fetch:10,file:[0,7,8,9,10,11],filter:[7,8],fittracke:10,fix:9,flask:10,flaticon:10,follow:10,forbidden:0,forecast:10,form:0,format:0,former:10,forrunn:9,found:0,freepik:10,fri:0,from:[0,9,10],gener:10,get:[0,1,3,4,5,6],git:10,github:10,gmt:0,gpl:9,gpx:[0,7,8,9,10],gpxpy:10,have:0,header:0,health:6,hike:8,his:8,http:[0,10,11],icon:10,imag:[0,10],improv:9,incorrect:7,info:1,inform:9,initi:[10,11],instal:9,integ:0,intern:0,invalid:0,issu:[9,10],jan:0,javascript:10,json:[0,12],jul:0,keep:9,kei:[8,10],last:10,leaflet:[0,10],least:0,line:12,linux:10,list:9,local:9,localhost:[10,11],log:[9,10],login:[1,10],logout:1,longest:8,made:[10,11],mai:10,make:10,makefil:[10,11],mandatori:[0,10],map:[0,8,9,10],map_id:0,max:0,max_alt:0,max_spe:0,max_speed_from:0,max_speed_to:0,maxim:0,maximum:8,mean:11,messag:0,min_alt:0,minim:[0,9],mobil:9,modification_d:0,mon:0,montain:8,month:[7,8],more:9,morn:0,move:[0,7],mpwoadmin:10,multipart:0,must:8,necessari:10,need:10,network:11,next_act:0,no_gpx:0,note:[0,7,8],now:[8,10],number:0,oauth:0,object:0,one:0,onli:[0,8],open:[9,10],order:0,other:10,outdoor:9,own:9,owner:8,packag:10,page:0,pagin:0,paramet:0,pars:[10,12],password:10,past:10,patch:[0,4],paus:[0,7],payload:0,per:0,per_pag:0,permiss:0,pictur:[1,6],ping:6,png:0,possibl:9,post:[0,1,4],postgresql:10,prerequisit:9,previous_act:0,privai:9,product:9,profil:1,progress:[1,3,4,5,6],proprietari:9,provid:[0,8],python:10,queri:0,react:10,react_app_api_url:11,readi:9,rebuild:11,rechart:[0,10],record:[0,2,7,8,9],record_typ:0,redux:10,regist:[1,10],relat:10,releas:[7,10],repo:10,report:9,request:[0,11],respons:0,run:[8,10],runner:9,samr1:10,search:7,second:0,see:[8,9,10,11],segment:[0,7],serv:10,server:[0,9,10],sever:9,singl:6,sky:10,some:[0,7,10],sort:0,speed:[0,8,10],sport:[0,2,5,8,9,10],sport_id:[0,4],standard:8,start:[0,10],stat:[5,7],staticmap:10,statist:[2,9],statu:0,step:10,still:9,store:9,street:9,string:0,success:0,sun:0,sundai:0,support:[7,8],system:10,tab:11,tar:10,test:10,them:9,thi:[0,7,9,10],thunderforest:10,time:[0,5,8],timezon:7,titl:0,todo:[10,13],token:0,tooltip:7,total:7,track:9,tracker:9,transport:8,troubleshoot:9,type:0,unauthor:0,undefin:11,under:9,unexpect:12,updat:[0,1,4,7,10],upgrad:9,upload:[7,8],user:[0,1,2,3,5,7,8,9,12],user_id:[0,5,6],using:[0,9],valid:0,valu:[0,10],variabl:11,version:9,view:7,virtualenv:10,walk:8,weather:[7,8,10],weather_end:0,weather_start:0,web:9,were:7,wget:10,when:7,with_gpx:0,without:[0,8,9],work:[1,3,4,5,6],workout:9,written:10,www:10,xzf:10,yarn:10,yet:9,you:[0,9],your:9},titles:["Activities","Authentication","API documentation","Records","Sports","Statistics","Users","Change log","Features","FitTrackee","Installation","Administrator","Troubleshooting","User"],titleterms:{"new":7,activ:[0,8],administr:11,api:2,authent:1,bug:7,chang:7,charact:11,close:7,column:11,content:9,dashboard:8,data:11,detail:8,dev:10,document:2,environ:10,featur:[7,8],fittracke:9,fix:7,improv:7,instal:10,issu:7,json:11,line:11,list:8,log:7,minim:7,misc:7,pars:11,prerequisit:10,prod:10,record:3,sport:4,statist:[5,7,8],tabl:9,troubleshoot:12,unexpect:11,upgrad:10,user:[6,13],version:7,workout:8}}) \ No newline at end of file diff --git a/docsrc/source/api/auth.rst b/docsrc/source/api/auth.rst index c5c7dc6e..265416ca 100644 --- a/docsrc/source/api/auth.rst +++ b/docsrc/source/api/auth.rst @@ -1,6 +1,8 @@ Authentication ############## +work in progress + .. autoflask:: fittrackee_api:create_app() :endpoints: auth.register_user, diff --git a/docsrc/source/api/records.rst b/docsrc/source/api/records.rst index c78be7c4..fe42bf73 100644 --- a/docsrc/source/api/records.rst +++ b/docsrc/source/api/records.rst @@ -1,6 +1,8 @@ Records ####### +work in progress + .. autoflask:: fittrackee_api:create_app() :endpoints: records.get_records diff --git a/docsrc/source/api/sports.rst b/docsrc/source/api/sports.rst index 84a0b86c..3147efa7 100644 --- a/docsrc/source/api/sports.rst +++ b/docsrc/source/api/sports.rst @@ -1,6 +1,8 @@ Sports ###### +work in progress + .. autoflask:: fittrackee_api:create_app() :endpoints: sports.get_sports, diff --git a/docsrc/source/api/stats.rst b/docsrc/source/api/stats.rst index 0621d298..d802fa3b 100644 --- a/docsrc/source/api/stats.rst +++ b/docsrc/source/api/stats.rst @@ -1,6 +1,8 @@ Statistics ########## +work in progress + .. autoflask:: fittrackee_api:create_app() :endpoints: stats.get_activities_by_sport, diff --git a/docsrc/source/api/users.rst b/docsrc/source/api/users.rst index 09785889..3fc1be80 100644 --- a/docsrc/source/api/users.rst +++ b/docsrc/source/api/users.rst @@ -1,6 +1,8 @@ Users ##### +work in progress + .. autoflask:: fittrackee_api:create_app() :endpoints: users.get_users, diff --git a/fittrackee_api/fittrackee_api/activities/stats.py b/fittrackee_api/fittrackee_api/activities/stats.py index 97da785f..2555a1cd 100644 --- a/fittrackee_api/fittrackee_api/activities/stats.py +++ b/fittrackee_api/fittrackee_api/activities/stats.py @@ -130,11 +130,12 @@ def get_activities(user_id, filter_type): @stats_blueprint.route('/stats//by_time', methods=['GET']) @authenticate def get_activities_by_time(auth_user_id, user_id): - """Get activities statistics for a user""" + """Get activities statistics for a user by time""" return get_activities(user_id, 'by_time') @stats_blueprint.route('/stats//by_sport', methods=['GET']) @authenticate def get_activities_by_sport(auth_user_id, user_id): + """Get activities statistics for a user by sport""" return get_activities(user_id, 'by_sport') diff --git a/fittrackee_api/fittrackee_api/users/auth.py b/fittrackee_api/fittrackee_api/users/auth.py index 4618b757..92b5d1e4 100644 --- a/fittrackee_api/fittrackee_api/users/auth.py +++ b/fittrackee_api/fittrackee_api/users/auth.py @@ -15,6 +15,7 @@ auth_blueprint = Blueprint('auth', __name__) @auth_blueprint.route('/auth/register', methods=['POST']) def register_user(): + """ register a user """ # get post data post_data = request.get_json() if not post_data or post_data.get('username') is None \ @@ -91,6 +92,7 @@ def register_user(): @auth_blueprint.route('/auth/login', methods=['POST']) def login_user(): + """ user login """ # get post data post_data = request.get_json() if not post_data: @@ -133,6 +135,7 @@ def login_user(): @auth_blueprint.route('/auth/logout', methods=['GET']) @authenticate def logout_user(user_id): + """ user logout """ # get auth token auth_header = request.headers.get('Authorization') if auth_header: @@ -161,6 +164,7 @@ def logout_user(user_id): @auth_blueprint.route('/auth/profile', methods=['GET']) @authenticate def get_user_status(user_id): + """ get authenticated user info """ user = User.query.filter_by(id=user_id).first() response_object = { 'status': 'success', @@ -172,6 +176,7 @@ def get_user_status(user_id): @auth_blueprint.route('/auth/profile/edit', methods=['POST']) @authenticate def edit_user(user_id): + """ edit authenticated user """ # get post data post_data = request.get_json() if not post_data: @@ -237,6 +242,7 @@ def edit_user(user_id): @auth_blueprint.route('/auth/picture', methods=['POST']) @authenticate def edit_picture(user_id): + """ update authenticated user picture """ code = 400 response_object = verify_extension('picture', request) if response_object['status'] != 'success': @@ -287,6 +293,7 @@ def edit_picture(user_id): @auth_blueprint.route('/auth/picture', methods=['DELETE']) @authenticate def del_picture(user_id): + """ delete authenticated user picture """ try: user = User.query.filter_by(id=user_id).first() picture_path = get_absolute_file_path(user.picture) diff --git a/fittrackee_api/fittrackee_api/users/users.py b/fittrackee_api/fittrackee_api/users/users.py index 6d0a7f59..45b5365e 100644 --- a/fittrackee_api/fittrackee_api/users/users.py +++ b/fittrackee_api/fittrackee_api/users/users.py @@ -42,6 +42,7 @@ def get_single_user(user_id): @users_blueprint.route('/users//picture', methods=['GET']) def get_picture(user_id): + """ get user picture """ response_object = { 'status': 'fail', 'message': 'User does not exist' @@ -59,6 +60,7 @@ def get_picture(user_id): @users_blueprint.route('/ping', methods=['GET']) def ping_pong(): + """ health check endpoint """ return jsonify({ 'status': 'success', 'message': 'pong!'