+
-
-
+
+
+
+
+
+
+
-
-
+
+
\ No newline at end of file
diff --git a/code/backend/docs/_build/html/searchindex.js b/code/backend/docs/_build/html/searchindex.js
index 6feaf68..55a909a 100644
--- a/code/backend/docs/_build/html/searchindex.js
+++ b/code/backend/docs/_build/html/searchindex.js
@@ -1 +1 @@
-Search.setIndex({docnames:["index","modules","nest_backend","nest_backend.database","nest_backend.database.tables","nest_backend.routes","nest_backend.routes.repository","nest_backend.routes.users"],envversion:{"sphinx.domains.c":2,"sphinx.domains.changeset":1,"sphinx.domains.citation":1,"sphinx.domains.cpp":3,"sphinx.domains.index":1,"sphinx.domains.javascript":2,"sphinx.domains.math":2,"sphinx.domains.python":2,"sphinx.domains.rst":2,"sphinx.domains.std":2,sphinx:56},filenames:["index.rst","modules.rst","nest_backend.rst","nest_backend.database.rst","nest_backend.database.tables.rst","nest_backend.routes.rst","nest_backend.routes.repository.rst","nest_backend.routes.users.rst"],objects:{"":{nest_backend:[2,0,0,"-"]},"nest_backend.database":{base:[3,0,0,"-"],tables:[4,0,0,"-"]},"nest_backend.database.tables":{Alert:[4,0,0,"-"],Authorization:[4,0,0,"-"],BoolOperation:[4,0,0,"-"],Composed:[4,0,0,"-"],Condition:[4,0,0,"-"],Contains:[4,0,0,"-"],Enums:[4,0,0,"-"],Notification:[4,0,0,"-"],Repository:[4,0,0,"-"],Tweet:[4,0,0,"-"],User:[4,0,0,"-"],Uses:[4,0,0,"-"]},"nest_backend.database.tables.Alert":{Alert:[4,1,1,""]},"nest_backend.database.tables.Alert.Alert":{id:[4,2,1,""],limit:[4,2,1,""],name:[4,2,1,""],notifications:[4,2,1,""],operations:[4,2,1,""],repository:[4,2,1,""],repository_id:[4,2,1,""],window_size:[4,2,1,""]},"nest_backend.database.tables.Authorization":{Authorization:[4,1,1,""]},"nest_backend.database.tables.Authorization.Authorization":{email:[4,2,1,""],repository:[4,2,1,""],rid:[4,2,1,""],user:[4,2,1,""]},"nest_backend.database.tables.BoolOperation":{BoolOperation:[4,1,1,""]},"nest_backend.database.tables.BoolOperation.BoolOperation":{alert:[4,2,1,""],alert_id:[4,2,1,""],condition:[4,2,1,""],condition_id:[4,2,1,""],father_1:[4,2,1,""],father_2:[4,2,1,""],id:[4,2,1,""],isRoot:[4,2,1,""],node_1:[4,2,1,""],node_1_id:[4,2,1,""],node_2:[4,2,1,""],node_2_id:[4,2,1,""],operation:[4,2,1,""]},"nest_backend.database.tables.Composed":{Composed:[4,1,1,""]},"nest_backend.database.tables.Composed.Composed":{repository:[4,2,1,""],rid:[4,2,1,""],snowflake:[4,2,1,""],tweet:[4,2,1,""]},"nest_backend.database.tables.Condition":{Condition:[4,1,1,""]},"nest_backend.database.tables.Condition.Condition":{content:[4,2,1,""],id:[4,2,1,""],operations:[4,2,1,""],tweets:[4,2,1,""],type:[4,2,1,""],used:[4,2,1,""]},"nest_backend.database.tables.Contains":{Contains:[4,1,1,""]},"nest_backend.database.tables.Contains.Contains":{cid:[4,2,1,""],condition:[4,2,1,""],snowflake:[4,2,1,""],tweet:[4,2,1,""]},"nest_backend.database.tables.Enums":{ConditionType:[4,1,1,""],OperationType:[4,1,1,""]},"nest_backend.database.tables.Enums.ConditionType":{hashtag:[4,2,1,""],location:[4,2,1,""],time:[4,2,1,""]},"nest_backend.database.tables.Enums.OperationType":{assign:[4,2,1,""]},"nest_backend.database.tables.Notification":{Notification:[4,1,1,""]},"nest_backend.database.tables.Notification.Notification":{alert:[4,2,1,""],alert_id:[4,2,1,""],id:[4,2,1,""],ora:[4,2,1,""]},"nest_backend.database.tables.Repository":{Repository:[4,1,1,""]},"nest_backend.database.tables.Repository.Repository":{alerts:[4,2,1,""],authorizations:[4,2,1,""],end:[4,2,1,""],id:[4,2,1,""],isActive:[4,2,1,""],name:[4,2,1,""],owner:[4,2,1,""],owner_id:[4,2,1,""],start:[4,2,1,""],to_json:[4,3,1,""],tweets:[4,2,1,""],uses:[4,2,1,""]},"nest_backend.database.tables.Tweet":{Tweet:[4,1,1,""]},"nest_backend.database.tables.Tweet.Tweet":{conditions:[4,2,1,""],content:[4,2,1,""],location:[4,2,1,""],poster:[4,2,1,""],repositories:[4,2,1,""],snowflake:[4,2,1,""]},"nest_backend.database.tables.User":{User:[4,1,1,""]},"nest_backend.database.tables.User.User":{authorizations:[4,2,1,""],email:[4,2,1,""],isAdmin:[4,2,1,""],owner_of:[4,2,1,""],password:[4,2,1,""],to_json:[4,3,1,""],username:[4,2,1,""]},"nest_backend.database.tables.Uses":{Uses:[4,1,1,""]},"nest_backend.database.tables.Uses.Uses":{cid:[4,2,1,""],condition:[4,2,1,""],repository:[4,2,1,""],rid:[4,2,1,""]},"nest_backend.gestione":{admin_or_403:[2,4,1,""],authenticate:[2,4,1,""],find_user:[2,4,1,""],gen_password:[2,4,1,""],identity:[2,4,1,""],json_error:[2,4,1,""],json_success:[2,4,1,""],repository_auth:[2,4,1,""]},"nest_backend.routes":{doa:[5,0,0,"-"],repository:[6,0,0,"-"],users:[7,0,0,"-"]},"nest_backend.routes.doa":{page_doa:[5,4,1,""]},"nest_backend.routes.repository":{repository_add_condition:[6,0,0,"-"],repository_create:[6,0,0,"-"],repository_edit:[6,0,0,"-"],repository_list:[6,0,0,"-"]},"nest_backend.routes.repository.repository_add_condition":{page_repository_add_condition:[6,4,1,""]},"nest_backend.routes.repository.repository_create":{page_repository_create:[6,4,1,""]},"nest_backend.routes.repository.repository_edit":{page_repository_edit:[6,4,1,""]},"nest_backend.routes.repository.repository_list":{page_repository_list:[6,4,1,""]},"nest_backend.routes.users":{login:[7,0,0,"-"],user_create:[7,0,0,"-"],user_delete:[7,0,0,"-"]},"nest_backend.routes.users.login":{page_login:[7,4,1,""]},"nest_backend.routes.users.user_create":{page_user_create:[7,4,1,""]},"nest_backend.routes.users.user_delete":{page_user_delete:[7,4,1,""]},nest_backend:{database:[3,0,0,"-"],gestione:[2,0,0,"-"],routes:[5,0,0,"-"]}},objnames:{"0":["py","module","Python module"],"1":["py","class","Python class"],"2":["py","attribute","Python attribute"],"3":["py","method","Python method"],"4":["py","function","Python function"]},objtypes:{"0":"py:module","1":"py:class","2":"py:attribute","3":"py:method","4":"py:function"},terms:{"class":4,"enum":[2,3],"function":2,"import":[3,5],"new":[6,7],"return":[2,5,6,7],Its:2,The:[6,7],Uses:[2,3],access_token:7,actual:2,add:[2,6],admin_or_403:2,alert:[2,3],alert_id:4,aliv:5,all:[3,4,5],allow:[6,7],alon:2,api:[6,7],applic:2,assign:4,authent:2,author:[2,3,7],base:[1,2,4],bearer:7,becaus:2,belong:6,blew:7,booloper:[2,3],call:[6,7],calm:5,can:6,chang:6,check:2,cid:4,client:5,close:6,combin:2,compos:[2,3],condit:[2,3,6],condition_id:4,conditiontyp:4,contain:[2,3,6,7],content:1,correct:2,creat:[3,6,7],credenti:2,current:7,data:[2,7],databas:[1,2],dead:5,decl_api:4,declar:3,defin:4,definit:4,delet:7,depend:2,differ:7,displai:5,doa:[1,2],edit:6,either:6,els:[2,7],email:[2,4,7],end:4,enumer:4,error:[2,6],exist:7,fact:2,failur:7,fanci:2,father_1:4,father_2:4,field:[6,7],find_us:2,fine:5,fire:5,flask:2,format:[2,6,7],friendli:5,from:7,frontend:5,gen_password:2,gener:2,gestion:1,get:7,goe:7,happi:[2,5],has:[6,7],hash:2,hashtag:[4,6],header:7,ident:2,includ:7,index:0,isact:4,isadmin:4,isroot:4,json:[2,6,7],json_error:2,json_success:2,jwt:2,kwarg:4,limit:4,list:6,littl:2,locat:[4,6],log:[6,7],login:[2,5],main:4,make:5,mani:2,match:2,messag:[2,5],method:2,model:4,modul:[0,1],msg:2,must:7,name:[4,6],need:[2,7],nest:7,nest_backend:[0,1],newus:7,node_1:4,node_1_id:4,node_2:4,node_2_id:4,none:2,notif:[2,3],oper:[2,4,6],operationtyp:4,ora:4,orm:4,owner:[4,6],owner_id:4,owner_of:4,packag:[0,1],page:[0,5],page_doa:5,page_login:7,page_repository_add_condit:6,page_repository_cr:6,page_repository_edit:6,page_repository_list:6,page_user_cr:7,page_user_delet:7,param:2,paramet:[6,7],password:[2,4,7],payload:2,pds2021:6,platform:2,poster:4,present:6,privileg:7,probabl:5,procedur:6,provid:6,python:1,regist:2,remov:7,repositori:[2,3,5],repository_add_condit:[2,5],repository_auth:2,repository_cr:[2,5],repository_edit:[2,5],repository_id:4,repository_list:[2,5],represent:6,reqest:2,requir:[2,7],result:7,rid:4,roma:6,rout:[1,2],search:0,see:5,server:[2,5],shouldnt:2,snowflak:4,someth:[5,7],spectat:6,sqlalchemi:4,start:4,statu:6,string:[2,6],submodul:1,subpackag:1,success:[2,6,7],system:2,tabl:[2,3],target:7,tell:6,thi:[3,4,5,6],thing:2,thingamajig:2,time:[4,6],to_json:[4,7],token:7,tweet:[2,3],type:[4,6],under:6,updat:6,used:[2,4],user:[2,3,5,6],user_cr:[2,5],user_delet:[2,5],usernam:[2,4,7],uses:4,using:7,util:1,valid:2,valu:4,verif:2,want:2,whether:[2,6],window_s:4,wrong:7,you:[2,5]},titles:["Welcome to N.E.S.T. Backend\u2019s documentation!","backend","nest_backend package","nest_backend.database package","nest_backend.database.tables package","nest_backend.routes package","nest_backend.routes.repository package","nest_backend.routes.users package"],titleterms:{"enum":4,Uses:4,alert:4,author:4,backend:[0,1],base:3,booloper:4,compos:4,condit:4,contain:4,content:[0,2,3,4,5,6,7],databas:[3,4],doa:5,document:0,gestion:2,indic:0,login:7,modul:[2,3,4,5,6,7],nest_backend:[2,3,4,5,6,7],notif:4,packag:[2,3,4,5,6,7],python:2,repositori:[4,6],repository_add_condit:6,repository_cr:6,repository_edit:6,repository_list:6,rout:[5,6,7],submodul:[2,3,4,5,6,7],subpackag:[2,3,5],tabl:[0,4],tweet:4,user:[4,7],user_cr:7,user_delet:7,util:2,welcom:0}})
\ No newline at end of file
+Search.setIndex({docnames:["index","python_api/index","python_api/nest_backend"],envversion:{"sphinx.domains.c":2,"sphinx.domains.changeset":1,"sphinx.domains.citation":1,"sphinx.domains.cpp":3,"sphinx.domains.index":1,"sphinx.domains.javascript":2,"sphinx.domains.math":2,"sphinx.domains.python":2,"sphinx.domains.rst":2,"sphinx.domains.std":2,"sphinx.ext.intersphinx":1,"sphinx.ext.todo":2,sphinx:56},filenames:["index.rst","python_api/index.rst","python_api/nest_backend.rst"],objects:{"":{nest_backend:[2,0,0,"-"]},"nest_backend.database":{base:[2,0,0,"-"],tables:[2,0,0,"-"]},"nest_backend.database.tables":{Alert:[2,1,1,""],Authorization:[2,1,1,""],BoolOperation:[2,1,1,""],Composed:[2,1,1,""],Condition:[2,1,1,""],ConditionType:[2,1,1,""],Contains:[2,1,1,""],Notification:[2,1,1,""],OperationType:[2,1,1,""],Repository:[2,1,1,""],Tweet:[2,1,1,""],User:[2,1,1,""]},"nest_backend.database.tables.Alert":{__init__:[2,2,1,""],id:[2,3,1,""],limit:[2,3,1,""],name:[2,3,1,""],notifications:[2,3,1,""],operations:[2,3,1,""],repository:[2,3,1,""],repository_id:[2,3,1,""],to_json:[2,2,1,""],window_size:[2,3,1,""]},"nest_backend.database.tables.Authorization":{__init__:[2,2,1,""],email:[2,3,1,""],repository:[2,3,1,""],rid:[2,3,1,""],user:[2,3,1,""]},"nest_backend.database.tables.BoolOperation":{__init__:[2,2,1,""],alert:[2,3,1,""],alert_id:[2,3,1,""],condition:[2,3,1,""],condition_id:[2,3,1,""],father_1:[2,3,1,""],father_2:[2,3,1,""],get_chain_ids:[2,2,1,""],id:[2,3,1,""],isRoot:[2,3,1,""],node_1:[2,3,1,""],node_1_id:[2,3,1,""],node_2:[2,3,1,""],node_2_id:[2,3,1,""],operation:[2,3,1,""],to_json:[2,2,1,""]},"nest_backend.database.tables.Composed":{__init__:[2,2,1,""],repository:[2,3,1,""],rid:[2,3,1,""],snowflake:[2,3,1,""],tweet:[2,3,1,""]},"nest_backend.database.tables.Condition":{__init__:[2,2,1,""],content:[2,3,1,""],id:[2,3,1,""],operations:[2,3,1,""],repository:[2,3,1,""],repository_id:[2,3,1,""],to_json:[2,2,1,""],tweets:[2,3,1,""],type:[2,3,1,""]},"nest_backend.database.tables.ConditionType":{coordinates:[2,3,1,""],hashtag:[2,3,1,""],location:[2,3,1,""],place:[2,3,1,""],time:[2,3,1,""],user:[2,3,1,""]},"nest_backend.database.tables.Contains":{__init__:[2,2,1,""],cid:[2,3,1,""],condition:[2,3,1,""],snowflake:[2,3,1,""],tweet:[2,3,1,""]},"nest_backend.database.tables.Notification":{__init__:[2,2,1,""],alert:[2,3,1,""],alert_id:[2,3,1,""],id:[2,3,1,""],ora:[2,3,1,""],to_json:[2,2,1,""]},"nest_backend.database.tables.OperationType":{assign:[2,3,1,""]},"nest_backend.database.tables.Repository":{__init__:[2,2,1,""],alerts:[2,3,1,""],authorizations:[2,3,1,""],conditions:[2,3,1,""],end:[2,3,1,""],evaluation_mode:[2,3,1,""],id:[2,3,1,""],is_active:[2,3,1,""],name:[2,3,1,""],owner:[2,3,1,""],owner_id:[2,3,1,""],start:[2,3,1,""],to_json:[2,2,1,""],tweets:[2,3,1,""]},"nest_backend.database.tables.Tweet":{__init__:[2,2,1,""],conditions:[2,3,1,""],content:[2,3,1,""],location:[2,3,1,""],poster:[2,3,1,""],repositories:[2,3,1,""],snowflake:[2,3,1,""]},"nest_backend.database.tables.User":{__init__:[2,2,1,""],authorizations:[2,3,1,""],email:[2,3,1,""],isAdmin:[2,3,1,""],owner_of:[2,3,1,""],password:[2,3,1,""],to_json:[2,2,1,""],username:[2,3,1,""]},"nest_backend.gestione":{admin_or_403:[2,4,1,""],authenticate:[2,4,1,""],error_handler:[2,4,1,""],find_user:[2,4,1,""],gen_password:[2,4,1,""],identity:[2,4,1,""],json_error:[2,4,1,""],json_request_authorizer:[2,4,1,""],json_success:[2,4,1,""],repository_auth:[2,4,1,""]},nest_backend:{database:[2,0,0,"-"],gestione:[2,0,0,"-"]}},objnames:{"0":["py","module","Python module"],"1":["py","class","Python class"],"2":["py","method","Python method"],"3":["py","attribute","Python attribute"],"4":["py","function","Python function"]},objtypes:{"0":"py:module","1":"py:class","2":"py:method","3":"py:attribute","4":"py:function"},terms:{"class":2,"enum":2,"function":2,"import":2,"return":2,Its:2,These:2,__init__:2,actual:2,add:2,admin_or_403:2,alert:2,alert_id:2,all:2,allow:2,alon:2,ani:2,api:0,applic:2,assign:2,attribut:2,authent:2,author:2,autogener:0,base:[0,1],becaus:2,booloper:2,check:2,cid:2,column:2,combin:2,compos:2,condit:2,condition_id:2,conditiontyp:2,construct:2,constructor:2,contain:2,content:2,coordin:2,core:[0,1],correct:2,could:2,credenti:2,data:2,databas:[0,1],decl_api:2,declar:2,dell:2,depend:2,els:2,email:2,end:2,enumer:2,error:2,error_handl:2,evaluation_mod:2,exampl:2,extens:[0,1],fact:2,fanci:2,father_1:2,father_2:2,find_us:2,flask:[0,1],format:2,from:2,gen_password:2,gener:2,gestion:[0,1],get_chain_id:2,gitlab:2,happi:2,hash:2,hashtag:2,ident:2,index:0,initi:2,instanc:2,is_act:2,isadmin:2,isroot:2,json:2,json_error:2,json_request_author:2,json_success:2,jwt:2,kei:2,kwarg:2,limit:2,littl:2,locat:2,login:2,mani:2,map:2,match:2,messag:2,method:[0,1],model:2,modul:[0,1],msg:2,name:2,need:2,nest_backend:[0,1],node_1:2,node_1_id:2,node_2:2,node_2_id:2,none:2,notif:2,onli:2,oper:2,operationtyp:2,ora:2,orm:2,owner:2,owner_id:2,owner_of:2,page:0,param:2,password:2,payload:2,place:2,platform:2,poster:2,present:2,python:0,refer:0,regist:2,relationship:2,repositori:2,repository_auth:2,repository_id:2,reqest:2,requir:2,rid:2,rout:[0,1],search:0,serializ:2,server:2,set:2,shouldnt:2,simpl:2,snowflak:2,specifica:2,sqlalchemi:2,start:2,string:2,success:2,system:2,tabl:1,thi:2,thing:2,thingamajig:2,time:2,to_json:2,tweet:2,type:2,used:2,user:2,usernam:2,using:2,util:[0,1],valid:2,valu:2,vedi:2,verif:2,want:2,whether:2,window_s:2,you:2},titles:["Welcome to N.E.S.T. Backend\u2019s documentation!","Autogenerated Python API reference","
nest_backend
- Core module"],titleterms:{api:[1,2],autogener:1,backend:0,base:2,core:2,databas:2,document:0,extens:2,flask:2,gestion:2,indic:0,method:2,modul:2,nest_backend:2,python:1,refer:1,rout:2,tabl:[0,2],util:2,welcom:0}})
\ No newline at end of file
diff --git a/code/backend/docs/conf.py b/code/backend/docs/conf.py
index 7a3d503..e9069fb 100644
--- a/code/backend/docs/conf.py
+++ b/code/backend/docs/conf.py
@@ -12,6 +12,7 @@
#
import os
import sys
+import pkg_resources
sys.path.insert(0, os.path.abspath('..'))
@@ -20,6 +21,7 @@ sys.path.insert(0, os.path.abspath('..'))
project = 'N.E.S.T. Backend'
copyright = '2021, Gruppo 2'
author = 'Gruppo 2'
+release = pkg_resources.get_distribution("nest_backend").version
# -- General configuration ---------------------------------------------------
@@ -28,7 +30,9 @@ author = 'Gruppo 2'
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
- 'sphinx.ext.autodoc',
+ "sphinx.ext.autodoc",
+ "sphinx.ext.intersphinx",
+ 'sphinx.ext.todo',
]
# Add any paths that contain templates here, relative to this directory.
@@ -39,13 +43,19 @@ templates_path = ['_templates']
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
+# Print warnings on the page
+keep_warnings = True
+
+# Display more warnings than usual
+nitpicky = True
+
# -- Options for HTML output -------------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
-html_theme = 'alabaster'
+html_theme = 'sphinx_rtd_theme'
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
@@ -53,4 +63,31 @@ html_theme = 'alabaster'
html_static_path = ['_static']
-# -- Extension configuration -------------------------------------------------
\ No newline at end of file
+# -- Intersphinx options -----------------------------------------------------
+
+intersphinx_mapping = {
+ "python": ("https://docs.python.org/3.8", None),
+ "sqlalchemy": ("https://docs.sqlalchemy.org/en/14/", None),
+ "flask": ("https://flask.palletsprojects.com/en/1.1.x/", None),
+ "flask_sqlalchemy": ("https://flask-sqlalchemy.palletsprojects.com/en/2.x/", None),
+ "flask_jwt_extended": ("https://flask-jwt-extended.readthedocs.io/en/stable/", None),
+ "flask_cors": ("https://flask-cors.readthedocs.io/en/latest/", None),
+ "requests": ("https://docs.python-requests.org/en/master/", None),
+ "apispec": ("https://apispec.readthedocs.io/en/latest/", None),
+ "marshmallow": ("https://marshmallow.readthedocs.io/en/stable/", None),
+ "tweepy": ("https://docs.tweepy.org/en/latest/", None),
+ "nltk": ("https://www.nltk.org/", None),
+}
+
+
+# -- Extension configuration -------------------------------------------------
+
+# -- Automodule settings -----------------------------------------------------
+
+autodoc_default_options = {
+ 'members': True,
+ 'member-order': 'bysource',
+ 'special-members': '__init__',
+ 'undoc-members': True,
+ 'show-inheritance': True,
+}
diff --git a/code/backend/docs/index.rst b/code/backend/docs/index.rst
index e7bd449..8d78751 100644
--- a/code/backend/docs/index.rst
+++ b/code/backend/docs/index.rst
@@ -7,10 +7,9 @@ Welcome to N.E.S.T. Backend's documentation!
============================================
.. toctree::
- :maxdepth: 2
- :caption: Contents:
+ :maxdepth: 4
- modules
+ python_api/index
diff --git a/code/backend/docs/modules.rst b/code/backend/docs/modules.rst
deleted file mode 100644
index 33b15f7..0000000
--- a/code/backend/docs/modules.rst
+++ /dev/null
@@ -1,7 +0,0 @@
-backend
-=======
-
-.. toctree::
- :maxdepth: 4
-
- nest_backend
diff --git a/code/backend/docs/nest_backend.database.rst b/code/backend/docs/nest_backend.database.rst
deleted file mode 100644
index 388a200..0000000
--- a/code/backend/docs/nest_backend.database.rst
+++ /dev/null
@@ -1,29 +0,0 @@
-nest\_backend.database package
-==============================
-
-Subpackages
------------
-
-.. toctree::
- :maxdepth: 4
-
- nest_backend.database.tables
-
-Submodules
-----------
-
-nest\_backend.database.base module
-----------------------------------
-
-.. automodule:: nest_backend.database.base
- :members:
- :undoc-members:
- :show-inheritance:
-
-Module contents
----------------
-
-.. automodule:: nest_backend.database
- :members:
- :undoc-members:
- :show-inheritance:
diff --git a/code/backend/docs/nest_backend.database.tables.rst b/code/backend/docs/nest_backend.database.tables.rst
deleted file mode 100644
index fc36d40..0000000
--- a/code/backend/docs/nest_backend.database.tables.rst
+++ /dev/null
@@ -1,109 +0,0 @@
-nest\_backend.database.tables package
-=====================================
-
-Submodules
-----------
-
-nest\_backend.database.tables.Alert module
-------------------------------------------
-
-.. automodule:: nest_backend.database.tables.Alert
- :members:
- :undoc-members:
- :show-inheritance:
-
-nest\_backend.database.tables.Authorization module
---------------------------------------------------
-
-.. automodule:: nest_backend.database.tables.Authorization
- :members:
- :undoc-members:
- :show-inheritance:
-
-nest\_backend.database.tables.BoolOperation module
---------------------------------------------------
-
-.. automodule:: nest_backend.database.tables.BoolOperation
- :members:
- :undoc-members:
- :show-inheritance:
-
-nest\_backend.database.tables.Composed module
----------------------------------------------
-
-.. automodule:: nest_backend.database.tables.Composed
- :members:
- :undoc-members:
- :show-inheritance:
-
-nest\_backend.database.tables.Condition module
-----------------------------------------------
-
-.. automodule:: nest_backend.database.tables.Condition
- :members:
- :undoc-members:
- :show-inheritance:
-
-nest\_backend.database.tables.Contains module
----------------------------------------------
-
-.. automodule:: nest_backend.database.tables.Contains
- :members:
- :undoc-members:
- :show-inheritance:
-
-nest\_backend.database.tables.Enums module
-------------------------------------------
-
-.. automodule:: nest_backend.database.tables.Enums
- :members:
- :undoc-members:
- :show-inheritance:
-
-nest\_backend.database.tables.Notification module
--------------------------------------------------
-
-.. automodule:: nest_backend.database.tables.Notification
- :members:
- :undoc-members:
- :show-inheritance:
-
-nest\_backend.database.tables.Repository module
------------------------------------------------
-
-.. automodule:: nest_backend.database.tables.Repository
- :members:
- :undoc-members:
- :show-inheritance:
-
-nest\_backend.database.tables.Tweet module
-------------------------------------------
-
-.. automodule:: nest_backend.database.tables.Tweet
- :members:
- :undoc-members:
- :show-inheritance:
-
-nest\_backend.database.tables.User module
------------------------------------------
-
-.. automodule:: nest_backend.database.tables.User
- :members:
- :undoc-members:
- :show-inheritance:
-
-nest\_backend.database.tables.Uses module
------------------------------------------
-
-.. automodule:: nest_backend.database.tables.Uses
- :members:
- :undoc-members:
- :show-inheritance:
-
-Module contents
----------------
-
-.. automodule:: nest_backend.database.tables
- :members:
- :undoc-members:
- :show-inheritance:
diff --git a/code/backend/docs/nest_backend.routes.repository.rst b/code/backend/docs/nest_backend.routes.repository.rst
deleted file mode 100644
index 0a1e100..0000000
--- a/code/backend/docs/nest_backend.routes.repository.rst
+++ /dev/null
@@ -1,45 +0,0 @@
-nest\_backend.routes.repository package
-=======================================
-
-Submodules
-----------
-
-nest\_backend.routes.repository.repository\_add\_condition module
------------------------------------------------------------------
-
-.. automodule:: nest_backend.routes.repository.repository_add_condition
- :members:
- :undoc-members:
- :show-inheritance:
-
-nest\_backend.routes.repository.repository\_create module
----------------------------------------------------------
-
-.. automodule:: nest_backend.routes.repository.repository_create
- :members:
- :undoc-members:
- :show-inheritance:
-
-nest\_backend.routes.repository.repository\_edit module
--------------------------------------------------------
-
-.. automodule:: nest_backend.routes.repository.repository_edit
- :members:
- :undoc-members:
- :show-inheritance:
-
-nest\_backend.routes.repository.repository\_list module
--------------------------------------------------------
-
-.. automodule:: nest_backend.routes.repository.repository_list
- :members:
- :undoc-members:
- :show-inheritance:
-
-Module contents
----------------
-
-.. automodule:: nest_backend.routes.repository
- :members:
- :undoc-members:
- :show-inheritance:
diff --git a/code/backend/docs/nest_backend.routes.rst b/code/backend/docs/nest_backend.routes.rst
deleted file mode 100644
index bd2789a..0000000
--- a/code/backend/docs/nest_backend.routes.rst
+++ /dev/null
@@ -1,30 +0,0 @@
-nest\_backend.routes package
-============================
-
-Subpackages
------------
-
-.. toctree::
- :maxdepth: 4
-
- nest_backend.routes.repository
- nest_backend.routes.users
-
-Submodules
-----------
-
-nest\_backend.routes.doa module
--------------------------------
-
-.. automodule:: nest_backend.routes.doa
- :members:
- :undoc-members:
- :show-inheritance:
-
-Module contents
----------------
-
-.. automodule:: nest_backend.routes
- :members:
- :undoc-members:
- :show-inheritance:
diff --git a/code/backend/docs/nest_backend.routes.users.rst b/code/backend/docs/nest_backend.routes.users.rst
deleted file mode 100644
index 2ce0ae4..0000000
--- a/code/backend/docs/nest_backend.routes.users.rst
+++ /dev/null
@@ -1,37 +0,0 @@
-nest\_backend.routes.users package
-==================================
-
-Submodules
-----------
-
-nest\_backend.routes.users.login module
----------------------------------------
-
-.. automodule:: nest_backend.routes.users.login
- :members:
- :undoc-members:
- :show-inheritance:
-
-nest\_backend.routes.users.user\_create module
-----------------------------------------------
-
-.. automodule:: nest_backend.routes.users.user_create
- :members:
- :undoc-members:
- :show-inheritance:
-
-nest\_backend.routes.users.user\_delete module
-----------------------------------------------
-
-.. automodule:: nest_backend.routes.users.user_delete
- :members:
- :undoc-members:
- :show-inheritance:
-
-Module contents
----------------
-
-.. automodule:: nest_backend.routes.users
- :members:
- :undoc-members:
- :show-inheritance:
diff --git a/code/backend/docs/nest_backend.rst b/code/backend/docs/nest_backend.rst
deleted file mode 100644
index 23aa860..0000000
--- a/code/backend/docs/nest_backend.rst
+++ /dev/null
@@ -1,30 +0,0 @@
-nest\_backend package
-=====================
-
-Subpackages
------------
-
-.. toctree::
- :maxdepth: 4
-
- nest_backend.database
- nest_backend.routes
-
-Submodules
-----------
-
-nest\_backend.gestione module
------------------------------
-
-.. automodule:: nest_backend.gestione
- :members:
- :undoc-members:
- :show-inheritance:
-
-Module contents
----------------
-
-.. automodule:: nest_backend
- :members:
- :undoc-members:
- :show-inheritance:
diff --git a/code/backend/docs/python_api/index.rst b/code/backend/docs/python_api/index.rst
new file mode 100644
index 0000000..eac9195
--- /dev/null
+++ b/code/backend/docs/python_api/index.rst
@@ -0,0 +1,7 @@
+Autogenerated Python API reference
+==================================
+
+.. toctree::
+ :maxdepth: 4
+
+ nest_backend
diff --git a/code/backend/docs/python_api/nest_backend.rst b/code/backend/docs/python_api/nest_backend.rst
new file mode 100644
index 0000000..d70d348
--- /dev/null
+++ b/code/backend/docs/python_api/nest_backend.rst
@@ -0,0 +1,37 @@
+``nest_backend`` - Core module
+==============================
+
+.. automodule:: nest_backend
+
+
+``.gestione`` - Utility methods
+-------------------------------
+
+.. automodule:: nest_backend.gestione
+
+
+``.database`` - Database
+------------------------
+
+.. automodule:: nest_backend.database
+
+
+``.base`` - Flask extension
+~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+.. automodule:: nest_backend.database.base
+
+
+``.tables`` - Database tables
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+.. automodule:: nest_backend.database.tables
+ :imported-members:
+
+
+``.routes`` - API routes
+------------------------
+
+.. automodule:: nest_backend.database.routes
+ :imported-members:
+
diff --git a/code/backend/nest_backend/gestione.py b/code/backend/nest_backend/gestione.py
index 4e38949..6b1f60e 100644
--- a/code/backend/nest_backend/gestione.py
+++ b/code/backend/nest_backend/gestione.py
@@ -1,7 +1,4 @@
"""
-A utilities Python Module.
---------------------------
-
Gestione adds many fancy thingamajigs to the flask application, such as a login system and such.
"""
diff --git a/code/backend/nest_backend/test/conftest.py b/code/backend/nest_backend/test/conftest.py
index 1a6dcc4..8d964cd 100644
--- a/code/backend/nest_backend/test/conftest.py
+++ b/code/backend/nest_backend/test/conftest.py
@@ -4,6 +4,4 @@ Pytest configuration file.
Import global fixtures here.
"""
-from fixtures.flask_client import flask_client, admin_access_token, admin_headers, user_access_token, user_headers, user_create
-
-
+from fixtures.flask_client import flask_client, admin_access_token, admin_headers, user_access_token, user_headers, user_exists
diff --git a/code/backend/nest_backend/test/fixtures/flask_client.py b/code/backend/nest_backend/test/fixtures/flask_client.py
index 9d1edfd..27bfd1e 100644
--- a/code/backend/nest_backend/test/fixtures/flask_client.py
+++ b/code/backend/nest_backend/test/fixtures/flask_client.py
@@ -40,7 +40,7 @@ def flask_client():
ext.engine.execute(f"""DROP SCHEMA "{uniq_schema}" CASCADE;""")
-@pytest.fixture()
+@pytest.fixture(scope="package")
def admin_access_token(flask_client):
response = flask_client.post("/api/v1/login", json={
"email": "admin@admin.com",
@@ -55,8 +55,17 @@ def admin_access_token(flask_client):
return data["access_token"]
-@pytest.fixture()
-def user_access_token(flask_client):
+@pytest.fixture(scope="package")
+def user_exists(admin_headers, flask_client):
+ flask_client.post(f'/api/v1/users/', headers=admin_headers, json={
+ 'email': 'utente_test@nest.com',
+ 'password': 'password',
+ 'username': 'utente_test'
+ })
+
+
+@pytest.fixture(scope="package")
+def user_access_token(flask_client, user_exists):
response = flask_client.post("/api/v1/login", json={
"email": "utente_test@nest.com",
"password": "password"
@@ -70,23 +79,13 @@ def user_access_token(flask_client):
return data["access_token"]
-@pytest.fixture()
+@pytest.fixture(scope="package")
def admin_headers(admin_access_token):
admin_headers = {'Authorization': f"Bearer {admin_access_token}"}
return admin_headers
-@pytest.fixture()
+@pytest.fixture(scope="package")
def user_headers(user_access_token):
user_headers = {'Authorization': f"Bearer {user_access_token}"}
return user_headers
-
-
-@pytest.fixture()
-def user_create(admin_headers, flask_client):
- r = flask_client.post(f'/api/v1/users/', headers=admin_headers, json={
- 'email': 'utente_test@nest.com',
- 'password': 'password',
- 'username': 'utente_test'
- })
-
diff --git a/code/backend/nest_backend/test/test_user.py b/code/backend/nest_backend/test/test_user.py
index 4d4a81f..db8572e 100644
--- a/code/backend/nest_backend/test/test_user.py
+++ b/code/backend/nest_backend/test/test_user.py
@@ -4,20 +4,25 @@ from flask.testing import Client
class TestUserGet:
- def test_for_success(self, flask_client: Client, admin_headers):
+ def test_admin_user(self, flask_client: Client, admin_headers):
r = flask_client.get(f'/api/v1/users/admin@admin.com', headers=admin_headers)
- assert b'success' in r.data
+ assert r.json["result"] == "success"
+ assert r.json["data"]["email"] == "admin@admin.com"
+ assert r.json["data"]["isAdmin"] is True
+ assert r.json["data"]["username"] == "admin"
+ def test_non_existing_user(self, flask_client: Client, admin_headers):
+ r = flask_client.get(f'/api/v1/users/ciccio@dev.com', headers=admin_headers)
+ assert r.json["result"] == "failure"
+ assert r.json["msg"] == "Could not locate the user."
# ritorna i dati di tutti gli utenti registrati
class TestUserGetAll:
- def test_for_success(self, flask_client: Client, admin_headers, user_create):
+ def test_for_success(self, flask_client: Client, admin_headers):
r = flask_client.get(f'/api/v1/users/', headers=admin_headers)
assert b'success' in r.data
- # FIXME AssertionError in flask_client at line 63. Il test non riesce ad andare a buon fine
def test_for_failure(self, flask_client: Client, user_headers):
-
r = flask_client.get(f'/api/v1/users/', headers=user_headers)
assert b'failure' in r.data
@@ -47,14 +52,12 @@ class TestUserDelete:
# the admin tries to commit suicide
def test_for_failure(self, flask_client: Client, admin_headers):
-
r = flask_client.delete(f'/api/v1/users/admin@admin.com', headers=admin_headers)
assert b'failure' in r.data
class TestUserPatch:
- def test_for_success(self, flask_client: Client, admin_headers, user_create):
-
+ def test_for_success(self, flask_client: Client, admin_headers):
r = flask_client.patch(f'/api/v1/users/admin@admin.com', headers=admin_headers, json={
'username': 'admin_patched'
})
@@ -66,5 +69,3 @@ class TestUserPatch:
'username': 'admin_patched'
})
assert b'failure' in r.data
-
-
diff --git a/code/backend/poetry.lock b/code/backend/poetry.lock
index 8aaf7de..131cdf3 100644
--- a/code/backend/poetry.lock
+++ b/code/backend/poetry.lock
@@ -279,6 +279,14 @@ MarkupSafe = ">=0.23"
[package.extras]
i18n = ["Babel (>=0.8)"]
+[[package]]
+name = "joblib"
+version = "1.0.1"
+description = "Lightweight pipelining with Python functions"
+category = "main"
+optional = false
+python-versions = ">=3.6"
+
[[package]]
name = "jsonschema"
version = "3.2.0"
@@ -296,14 +304,6 @@ six = ">=1.11.0"
format = ["idna", "jsonpointer (>1.13)", "rfc3987", "strict-rfc3339", "webcolors"]
format_nongpl = ["idna", "jsonpointer (>1.13)", "webcolors", "rfc3986-validator (>0.1.0)", "rfc3339-validator"]
-[[package]]
-name = "joblib"
-version = "1.0.1"
-description = "Lightweight pipelining with Python functions"
-category = "main"
-optional = false
-python-versions = ">=3.6"
-
[[package]]
name = "markupsafe"
version = "1.1.1"
@@ -326,6 +326,41 @@ docs = ["sphinx (==3.4.3)", "sphinx-issues (==1.2.0)", "alabaster (==0.7.12)", "
lint = ["mypy (==0.812)", "flake8 (==3.9.0)", "flake8-bugbear (==21.3.2)", "pre-commit (>=2.4,<3.0)"]
tests = ["pytest", "pytz", "simplejson"]
+[[package]]
+name = "nltk"
+version = "3.6.2"
+description = "Natural Language Toolkit"
+category = "main"
+optional = false
+python-versions = ">=3.5.*"
+
+[package.dependencies]
+click = "*"
+joblib = "*"
+regex = "*"
+tqdm = "*"
+
+[package.extras]
+all = ["matplotlib", "twython", "scipy", "numpy", "gensim (<4.0.0)", "python-crfsuite", "pyparsing", "scikit-learn", "requests"]
+corenlp = ["requests"]
+machine_learning = ["gensim (<4.0.0)", "numpy", "python-crfsuite", "scikit-learn", "scipy"]
+plot = ["matplotlib"]
+tgrep = ["pyparsing"]
+twitter = ["twython"]
+
+[[package]]
+name = "oauthlib"
+version = "3.1.0"
+description = "A generic, spec-compliant, thorough implementation of the OAuth request-signing logic"
+category = "main"
+optional = false
+python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*"
+
+[package.extras]
+rsa = ["cryptography"]
+signals = ["blinker"]
+signedtoken = ["cryptography", "pyjwt (>=1.0.0)"]
+
[[package]]
name = "openapi-schema-validator"
version = "0.1.5"
@@ -362,41 +397,6 @@ six = "*"
dev = ["pre-commit"]
requests = ["requests"]
-[[package]]
-name = "nltk"
-version = "3.6.2"
-description = "Natural Language Toolkit"
-category = "main"
-optional = false
-python-versions = ">=3.5.*"
-
-[package.dependencies]
-click = "*"
-joblib = "*"
-regex = "*"
-tqdm = "*"
-
-[package.extras]
-all = ["matplotlib", "twython", "scipy", "numpy", "gensim (<4.0.0)", "python-crfsuite", "pyparsing", "scikit-learn", "requests"]
-corenlp = ["requests"]
-machine_learning = ["gensim (<4.0.0)", "numpy", "python-crfsuite", "scikit-learn", "scipy"]
-plot = ["matplotlib"]
-tgrep = ["pyparsing"]
-twitter = ["twython"]
-
-[[package]]
-name = "oauthlib"
-version = "3.1.0"
-description = "A generic, spec-compliant, thorough implementation of the OAuth request-signing logic"
-category = "main"
-optional = false
-python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*"
-
-[package.extras]
-rsa = ["cryptography"]
-signals = ["blinker"]
-signedtoken = ["cryptography", "pyjwt (>=1.0.0)"]
-
[[package]]
name = "packaging"
version = "20.9"
@@ -615,6 +615,21 @@ docs = ["sphinxcontrib-websupport"]
lint = ["flake8 (>=3.5.0)", "isort", "mypy (>=0.800)", "docutils-stubs"]
test = ["pytest", "pytest-cov", "html5lib", "cython", "typed-ast"]
+[[package]]
+name = "sphinx-rtd-theme"
+version = "0.5.2"
+description = "Read the Docs theme for Sphinx"
+category = "dev"
+optional = false
+python-versions = "*"
+
+[package.dependencies]
+docutils = "<0.17"
+sphinx = "*"
+
+[package.extras]
+dev = ["transifex-client", "sphinxcontrib-httpdomain", "bump2version"]
+
[[package]]
name = "sphinxcontrib-applehelp"
version = "1.0.2"
@@ -783,7 +798,7 @@ watchdog = ["watchdog"]
[metadata]
lock-version = "1.1"
python-versions = "^3.8.5"
-content-hash = "aff9d3d076a3c5fed551f6a1a1502e6d34ee1e2c2e385695cf4c55015dceda8a"
+content-hash = "9c4f3517887f1d12fc4196119a7d3398fa61a5214809fcfd1a324d87ca8baeaf"
[metadata.files]
alabaster = [
@@ -972,14 +987,14 @@ jinja2 = [
{file = "Jinja2-2.11.3-py2.py3-none-any.whl", hash = "sha256:03e47ad063331dd6a3f04a43eddca8a966a26ba0c5b7207a9a9e4e08f1b29419"},
{file = "Jinja2-2.11.3.tar.gz", hash = "sha256:a6d58433de0ae800347cab1fa3043cebbabe8baa9d29e668f1c768cb87a333c6"},
]
-jsonschema = [
- {file = "jsonschema-3.2.0-py2.py3-none-any.whl", hash = "sha256:4e5b3cf8216f577bee9ce139cbe72eca3ea4f292ec60928ff24758ce626cd163"},
- {file = "jsonschema-3.2.0.tar.gz", hash = "sha256:c8a85b28d377cc7737e46e2d9f2b4f44ee3c0e1deac6bf46ddefc7187d30797a"},
-]
joblib = [
{file = "joblib-1.0.1-py3-none-any.whl", hash = "sha256:feeb1ec69c4d45129954f1b7034954241eedfd6ba39b5e9e4b6883be3332d5e5"},
{file = "joblib-1.0.1.tar.gz", hash = "sha256:9c17567692206d2f3fb9ecf5e991084254fe631665c450b443761c4186a613f7"},
]
+jsonschema = [
+ {file = "jsonschema-3.2.0-py2.py3-none-any.whl", hash = "sha256:4e5b3cf8216f577bee9ce139cbe72eca3ea4f292ec60928ff24758ce626cd163"},
+ {file = "jsonschema-3.2.0.tar.gz", hash = "sha256:c8a85b28d377cc7737e46e2d9f2b4f44ee3c0e1deac6bf46ddefc7187d30797a"},
+]
markupsafe = [
{file = "MarkupSafe-1.1.1-cp27-cp27m-macosx_10_6_intel.whl", hash = "sha256:09027a7803a62ca78792ad89403b1b7a73a01c8cb65909cd876f7fcebd79b161"},
{file = "MarkupSafe-1.1.1-cp27-cp27m-manylinux1_i686.whl", hash = "sha256:e249096428b3ae81b08327a63a485ad0878de3fb939049038579ac0ef61e17e7"},
@@ -1034,6 +1049,10 @@ markupsafe = [
{file = "MarkupSafe-1.1.1-cp39-cp39-win_amd64.whl", hash = "sha256:b7d644ddb4dbd407d31ffb699f1d140bc35478da613b441c582aeb7c43838dd8"},
{file = "MarkupSafe-1.1.1.tar.gz", hash = "sha256:29872e92839765e546828bb7754a68c418d927cd064fd4708fab9fe9c8bb116b"},
]
+marshmallow = [
+ {file = "marshmallow-3.11.1-py2.py3-none-any.whl", hash = "sha256:0dd42891a5ef288217ed6410917f3c6048f585f8692075a0052c24f9bfff9dfd"},
+ {file = "marshmallow-3.11.1.tar.gz", hash = "sha256:16e99cb7f630c0ef4d7d364ed0109ac194268dde123966076ab3dafb9ae3906b"},
+]
nltk = [
{file = "nltk-3.6.2-py3-none-any.whl", hash = "sha256:240e23ab1ab159ef9940777d30c7c72d7e76d91877099218a7585370c11f6b9e"},
{file = "nltk-3.6.2.zip", hash = "sha256:57d556abed621ab9be225cc6d2df1edce17572efb67a3d754630c9f8381503eb"},
@@ -1042,10 +1061,6 @@ oauthlib = [
{file = "oauthlib-3.1.0-py2.py3-none-any.whl", hash = "sha256:df884cd6cbe20e32633f1db1072e9356f53638e4361bef4e8b03c9127c9328ea"},
{file = "oauthlib-3.1.0.tar.gz", hash = "sha256:bee41cc35fcca6e988463cacc3bcb8a96224f470ca547e697b604cc697b2f889"},
]
-marshmallow = [
- {file = "marshmallow-3.11.1-py2.py3-none-any.whl", hash = "sha256:0dd42891a5ef288217ed6410917f3c6048f585f8692075a0052c24f9bfff9dfd"},
- {file = "marshmallow-3.11.1.tar.gz", hash = "sha256:16e99cb7f630c0ef4d7d364ed0109ac194268dde123966076ab3dafb9ae3906b"},
-]
openapi-schema-validator = [
{file = "openapi-schema-validator-0.1.5.tar.gz", hash = "sha256:a4b2712020284cee880b4c55faa513fbc2f8f07f365deda6098f8ab943c9f0df"},
{file = "openapi_schema_validator-0.1.5-py2-none-any.whl", hash = "sha256:215b516d0942f4e8e2446cf3f7d4ff2ed71d102ebddcc30526d8a3f706ab1df6"},
@@ -1232,6 +1247,10 @@ sphinx = [
{file = "Sphinx-3.5.4-py3-none-any.whl", hash = "sha256:2320d4e994a191f4b4be27da514e46b3d6b420f2ff895d064f52415d342461e8"},
{file = "Sphinx-3.5.4.tar.gz", hash = "sha256:19010b7b9fa0dc7756a6e105b2aacd3a80f798af3c25c273be64d7beeb482cb1"},
]
+sphinx-rtd-theme = [
+ {file = "sphinx_rtd_theme-0.5.2-py2.py3-none-any.whl", hash = "sha256:4a05bdbe8b1446d77a01e20a23ebc6777c74f43237035e76be89699308987d6f"},
+ {file = "sphinx_rtd_theme-0.5.2.tar.gz", hash = "sha256:32bd3b5d13dc8186d7a42fc816a23d32e83a4827d7d9882948e7b837c232da5a"},
+]
sphinxcontrib-applehelp = [
{file = "sphinxcontrib-applehelp-1.0.2.tar.gz", hash = "sha256:a072735ec80e7675e3f432fcae8610ecf509c5f1869d17e2eecff44389cdbc58"},
{file = "sphinxcontrib_applehelp-1.0.2-py2.py3-none-any.whl", hash = "sha256:806111e5e962be97c29ec4c1e7fe277bfd19e9652fb1a4392105b43e01af885a"},
diff --git a/code/backend/pyproject.toml b/code/backend/pyproject.toml
index 88d4099..3f66410 100644
--- a/code/backend/pyproject.toml
+++ b/code/backend/pyproject.toml
@@ -26,13 +26,13 @@ apispec-webframeworks = "^0.5.2"
marshmallow = "^3.11.1"
openapi-spec-validator = "^0.3.0"
flask-swagger-ui = "^3.36.0"
-Sphinx = "^3.5.4"
tweepy = "^3.10.0"
nltk = "^3.6.2"
[tool.poetry.dev-dependencies]
pytest = "^6.2.3"
Sphinx = "^3.5.4"
+sphinx-rtd-theme = "^0.5.2"
[build-system]
requires = ["poetry-core>=1.0.0"]
diff --git a/code/frontend/src/PageSwitcher.js b/code/frontend/src/PageSwitcher.js
index 309da02..bb070b0 100644
--- a/code/frontend/src/PageSwitcher.js
+++ b/code/frontend/src/PageSwitcher.js
@@ -1,4 +1,4 @@
-import React from "react"
+import React from "react"
import { Route, Switch } from "react-router"
import PageLogin from "./routes/PageLogin"
import PageRepositories from "./routes/PageRepositories"
diff --git a/code/frontend/src/components/base/BoxFull.module.css b/code/frontend/src/components/base/BoxFull.module.css
index bacfd78..8958ff6 100644
--- a/code/frontend/src/components/base/BoxFull.module.css
+++ b/code/frontend/src/components/base/BoxFull.module.css
@@ -12,8 +12,8 @@
font-size: x-large;
font-family: var(--font-title);
- flex-shrink: 0;
- flex-grow: 0;
+ white-space: nowrap;
+ overflow-x: hidden;
}
.BoxBody {
@@ -26,6 +26,5 @@
font-size: medium;
font-family: var(--font-regular);
- flex-shrink: 0;
flex-grow: 1;
}
\ No newline at end of file
diff --git a/code/frontend/src/components/base/Button.js b/code/frontend/src/components/base/Button.js
index 1e4079e..1c0dc3f 100644
--- a/code/frontend/src/components/base/Button.js
+++ b/code/frontend/src/components/base/Button.js
@@ -1,4 +1,4 @@
-import React from "react"
+import React from "react"
import Style from "./Button.module.css"
import classNames from "classnames"
import make_icon from "../../utils/make_icon"
diff --git a/code/frontend/src/components/base/ButtonSidebar.js b/code/frontend/src/components/base/ButtonSidebar.js
index 1f65a37..d0d3ef8 100644
--- a/code/frontend/src/components/base/ButtonSidebar.js
+++ b/code/frontend/src/components/base/ButtonSidebar.js
@@ -22,7 +22,7 @@ export default function ButtonSidebar({ icon, children, to, className, ...props
path: to,
strict: true,
exact: true,
- });
+ })
if(match) {
className = classNames(Style.Active, className)
diff --git a/code/frontend/src/components/base/ButtonSmallX.js b/code/frontend/src/components/base/ButtonSmallX.js
index ab55e25..7208596 100644
--- a/code/frontend/src/components/base/ButtonSmallX.js
+++ b/code/frontend/src/components/base/ButtonSmallX.js
@@ -1,7 +1,7 @@
import React from "react"
import Style from "./ButtonSmallX.module.css"
import classNames from "classnames"
-import {FontAwesomeIcon} from "@fortawesome/react-fontawesome"
+import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"
import { faTimes } from "@fortawesome/free-solid-svg-icons"
diff --git a/code/frontend/src/components/base/InputWithIcon.js b/code/frontend/src/components/base/InputWithIcon.js
index da72870..bc84e3b 100644
--- a/code/frontend/src/components/base/InputWithIcon.js
+++ b/code/frontend/src/components/base/InputWithIcon.js
@@ -1,4 +1,4 @@
-import React, {useState} from "react"
+import React, { useState } from "react"
import Style from "./InputWithIcon.module.css"
import classNames from "classnames"
import make_icon from "../../utils/make_icon"
@@ -17,7 +17,7 @@ import make_icon from "../../utils/make_icon"
* @constructor
*/
export default function InputWithIcon({ icon, className, ...props }) {
- const [isFocused, setFocused] = useState(false);
+ const [isFocused, setFocused] = useState(false)
return (
diff --git a/code/frontend/src/components/base/InputWithIcon.module.css b/code/frontend/src/components/base/InputWithIcon.module.css
index aa869b9..aa8f813 100644
--- a/code/frontend/src/components/base/InputWithIcon.module.css
+++ b/code/frontend/src/components/base/InputWithIcon.module.css
@@ -36,6 +36,8 @@
/* Repeat properties overridden by
*/
font-family: var(--font-regular);
color: var(--fg-field-off);
+
+ width: 100%;
}
diff --git a/code/frontend/src/components/base/Loading.js b/code/frontend/src/components/base/Loading.js
index 02ad294..6307996 100644
--- a/code/frontend/src/components/base/Loading.js
+++ b/code/frontend/src/components/base/Loading.js
@@ -1,6 +1,6 @@
import React from "react"
import { faSpinner } from "@fortawesome/free-solid-svg-icons"
-import {FontAwesomeIcon} from "@fortawesome/react-fontawesome"
+import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"
/**
diff --git a/code/frontend/src/components/base/Radio.js b/code/frontend/src/components/base/Radio.js
index 3cc3058..e861487 100644
--- a/code/frontend/src/components/base/Radio.js
+++ b/code/frontend/src/components/base/Radio.js
@@ -2,6 +2,7 @@ import React from "react"
import Style from "./Radio.module.css"
import classNames from "classnames"
+
/**
* A radio button.
*
diff --git a/code/frontend/src/components/base/Starting.js b/code/frontend/src/components/base/Starting.js
new file mode 100644
index 0000000..6a6a814
--- /dev/null
+++ b/code/frontend/src/components/base/Starting.js
@@ -0,0 +1,18 @@
+import React from "react"
+import { faSpinner } from "@fortawesome/free-solid-svg-icons"
+import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"
+
+
+/**
+ * A div with a static dots icon and a "Starting..." text.
+ *
+ * @returns {JSX.Element}
+ * @constructor
+ */
+export default function Starting() {
+ return (
+
+ Starting...
+
+ )
+}
diff --git a/code/frontend/src/components/base/Summary.js b/code/frontend/src/components/base/Summary.js
new file mode 100644
index 0000000..03445a3
--- /dev/null
+++ b/code/frontend/src/components/base/Summary.js
@@ -0,0 +1,58 @@
+import React from "react"
+import Style from "./Summary.module.css"
+import classNames from "classnames"
+import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"
+
+
+/**
+ * A long line displaying the summary of a certain entity, such as a repository or an user.
+ *
+ * @param icon - The icon of the summary.
+ * @param title - The title of the summary.
+ * @param subtitle - The subtitle of the summary.
+ * @param upperLabel - The label for the upper value.
+ * @param upperValue - The upper value.
+ * @param lowerLabel - The label for the lower value.
+ * @param lowerValue - The lower value.
+ * @param buttons - Buttons to add to the right of the summary.
+ * @param className - Additional class(es) to add to the summary.
+ * @param props - Additional props to pass to the summary.
+ * @returns {JSX.Element}
+ * @constructor
+ */
+export default function Summary(
+ { icon, title, subtitle, upperLabel, upperValue, lowerLabel, lowerValue, buttons, className, ...props },
+) {
+ return (
+
+
+
+
+
+
+ {title}
+
+
+ {subtitle}
+
+
+
+
+ {upperLabel}
+
+
+ {upperValue}
+
+
+ {lowerLabel}
+
+
+ {lowerValue}
+
+
+
+ {buttons}
+
+
+ )
+}
diff --git a/code/frontend/src/components/base/Summary.module.css b/code/frontend/src/components/base/Summary.module.css
new file mode 100644
index 0000000..25eb708
--- /dev/null
+++ b/code/frontend/src/components/base/Summary.module.css
@@ -0,0 +1,103 @@
+.Summary {
+ width: 100%;
+ height: 60px;
+
+ margin: 10px 0;
+
+ display: flex;
+}
+
+
+.Left {
+ width: 250px;
+ height: 60px;
+
+ display: grid;
+ grid-template-areas:
+ "a b"
+ "a c"
+ "a d"
+ "a e";
+ grid-template-columns: auto 1fr;
+ grid-template-rows: 5px 1fr 1fr 5px;
+
+ background-color: var(--bg-accent);
+ border-radius: 30px 0 0 30px;
+}
+
+.IconContainer {
+ margin: 5px 15px 5px 5px;
+ width: 50px;
+ height: 50px;
+ border-radius: 50px;
+
+ display: flex;
+ justify-content: center;
+ align-items: center;
+
+ background-color: var(--bg-light);
+ color: var(--fg-primary);
+
+ font-size: x-large;
+
+ grid-area: a;
+}
+
+.Title {
+ grid-area: c;
+ align-self: flex-end;
+}
+
+.Subtitle {
+ grid-area: d;
+ font-size: small;
+ align-self: flex-start;
+}
+
+.Middle {
+ flex-grow: 1;
+ height: 60px;
+ padding: 5px 20px;
+
+ background-color: var(--bg-light);
+
+ display: grid;
+ grid-template-columns: auto 1fr;
+ grid-template-rows: 1fr 1fr;
+ grid-column-gap: 10px;
+ align-items: center;
+
+ font-size: small;
+
+}
+
+.Middle .Label {
+ grid-column: 1;
+ text-align: right;
+ font-weight: bold;
+}
+
+.Middle .Value {
+ grid-column: 2;
+}
+
+.Middle .Upper {
+ grid-row: 1;
+}
+
+.Middle .Lower {
+ grid-row: 2;
+}
+
+.Right {
+ width: 250px;
+ height: 60px;
+ padding: 5px;
+
+ background-color: var(--bg-accent);
+ border-radius: 0 30px 30px 0;
+
+ display: flex;
+ justify-content: flex-end;
+ align-items: center;
+}
diff --git a/code/frontend/src/components/base/TextArea.js b/code/frontend/src/components/base/TextArea.js
index 75508be..1e19601 100644
--- a/code/frontend/src/components/base/TextArea.js
+++ b/code/frontend/src/components/base/TextArea.js
@@ -15,7 +15,10 @@ import classNames from "classnames"
*/
export default function TextArea({ resize, children, className, ...props }) {
return (
-
diff --git a/code/frontend/src/components/interactive/BoxLogin.js b/code/frontend/src/components/interactive/BoxLogin.js
index 18e6286..13a6802 100644
--- a/code/frontend/src/components/interactive/BoxLogin.js
+++ b/code/frontend/src/components/interactive/BoxLogin.js
@@ -22,12 +22,12 @@ export default function BoxLogin({ ...props }) {
const [password, setPassword] = useState("password")
const [working, setWorking] = useState(false)
const [error, setError] = useState(null)
- const {login} = useContext(ContextUser)
+ const { login } = useContext(ContextUser)
const history = useHistory()
const doLogin = async () => {
if(working) {
- return;
+ return
}
setWorking(true)
@@ -67,10 +67,10 @@ export default function BoxLogin({ ...props }) {
/>
{error ?
-
- {error.toString()}
-
- : null}
+
+ {error.toString()}
+
+ : null}
{error.toString()}
- }
- else if(data) {
- let repositories = [...data["owner"], ...data["spectator"]]
- if(repositories.length > 0) {
- contents = repositories.map(repo => (
-
- ))
- }
- else {
- contents = There's nothing here.
- }
+ let contents
+ if(repositories.length > 0) {
+ contents = repositories.map(repo => (
+
+ ))
}
else {
- contents =
+ contents = There's nothing here.
}
return (
diff --git a/code/frontend/src/components/interactive/BoxRepositoriesArchived.js b/code/frontend/src/components/interactive/BoxRepositoriesArchived.js
index 4668cb2..af504c5 100644
--- a/code/frontend/src/components/interactive/BoxRepositoriesArchived.js
+++ b/code/frontend/src/components/interactive/BoxRepositoriesArchived.js
@@ -1,49 +1,38 @@
import React, { useContext } from "react"
import BoxFull from "../base/BoxFull"
import ContextUser from "../../contexts/ContextUser"
-import RepositorySummaryBase from "./RepositorySummaryBase"
-import Loading from "../base/Loading"
-import BoxAlert from "../base/BoxAlert"
+import SummaryRepository from "./SummaryRepository"
import { faSearch } from "@fortawesome/free-solid-svg-icons"
-import useDataImmediately from "../../hooks/useDataImmediately"
/**
* A {@link BoxFull} listing all the user's archived repositories.
*
+ * @param repositories - Array of repositories to display in the box.
+ * @param refresh - Function that can be called to refresh the repositories list.
* @param props - Additional props to pass to the box.
* @returns {JSX.Element}
* @constructor
*/
-export default function BoxRepositoriesArchived({ ...props }) {
- const {user, fetchDataAuth} = useContext(ContextUser)
- const {data, error} = useDataImmediately(fetchDataAuth, "GET", "/api/v1/repositories/", {
- "onlyDead": true,
- })
+export default function BoxRepositoriesArchived({ repositories, refresh, ...props }) {
+ const { user } = useContext(ContextUser)
- let contents;
- if(error) {
- contents = {error.toString()}
- }
- else if(data) {
- let repositories = [...data["owner"], ...data["spectator"]]
- if(repositories.length > 0) {
- contents = repositories.map(repo => (
-
- ))
- }
- else {
- contents = There's nothing here.
- }
+ let contents
+ if(repositories.length > 0) {
+ contents = repositories.map(repo => (
+
+ ))
}
else {
- contents =
+ contents = There's nothing here.
}
return (
diff --git a/code/frontend/src/components/interactive/BoxRepositoryCreate.js b/code/frontend/src/components/interactive/BoxRepositoryCreate.js
index 088784d..d85ec05 100644
--- a/code/frontend/src/components/interactive/BoxRepositoryCreate.js
+++ b/code/frontend/src/components/interactive/BoxRepositoryCreate.js
@@ -3,11 +3,13 @@ import BoxFull from "../base/BoxFull"
import FormLabelled from "../base/FormLabelled"
import FormLabel from "../base/formparts/FormLabel"
import InputWithIcon from "../base/InputWithIcon"
-import { faFolder, faPencilAlt, faPlus } from "@fortawesome/free-solid-svg-icons"
+import { faBackward, faFolder, faPencilAlt, faPlus } from "@fortawesome/free-solid-svg-icons"
import Radio from "../base/Radio"
import Button from "../base/Button"
import useRepositoryEditor from "../../hooks/useRepositoryEditor"
import FormAlert from "../base/formparts/FormAlert"
+import goToOnSuccess from "../../utils/goToOnSuccess"
+import { useHistory } from "react-router"
/**
@@ -25,12 +27,20 @@ export default function BoxRepositoryCreate({ ...props }) {
name,
setName,
save,
+ revert,
error,
} = useRepositoryEditor()
+ const history = useHistory()
+
return (
- {e.preventDefault(); save()}}>
+ {
+ e.preventDefault()
+ save()
+ }}
+ >
setEvaluationMode(0)}
checked={evaluationMode === 0}
/>
- At least one filter
+ One filter
@@ -59,30 +69,38 @@ export default function BoxRepositoryCreate({ ...props }) {
{error ?
-
- {error.toString()}
-
- : null}
+
+ {error.toString()}
+
+ : null}
{id ?
+ <>
revert()}
+ >
+ Rollback edits
+
+ save()}
+ onClick={_ => goToOnSuccess(save, history, "/repositories")()}
>
- Edit repository
+ Save changes
- :
- save()}
- >
- Create repository
-
+ >
+ :
+ goToOnSuccess(save, history, "/repositories")()}
+ >
+ Create repository
+
}
diff --git a/code/frontend/src/components/interactive/BoxSetServer.js b/code/frontend/src/components/interactive/BoxSetServer.js
index ada5c92..70006c3 100644
--- a/code/frontend/src/components/interactive/BoxSetServer.js
+++ b/code/frontend/src/components/interactive/BoxSetServer.js
@@ -15,7 +15,7 @@ import ContextServer from "../../contexts/ContextServer"
* @constructor
*/
export default function BoxSetServer({ ...props }) {
- const {server, setServer} = useContext(ContextServer);
+ const { server, setServer } = useContext(ContextServer)
return (
diff --git a/code/frontend/src/components/interactive/ConditionBadge.js b/code/frontend/src/components/interactive/ConditionBadge.js
index 896b705..973cede 100644
--- a/code/frontend/src/components/interactive/ConditionBadge.js
+++ b/code/frontend/src/components/interactive/ConditionBadge.js
@@ -1,7 +1,7 @@
import React, { useContext } from "react"
import Style from "./ConditionBadge.module.css"
import classNames from "classnames"
-import {FontAwesomeIcon} from "@fortawesome/react-fontawesome"
+import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"
import ButtonSmallX from "../base/ButtonSmallX"
import { faAt, faClock, faGlobe, faHashtag, faMapPin } from "@fortawesome/free-solid-svg-icons"
import ContextRepositoryEditor from "../../contexts/ContextRepositoryEditor"
@@ -36,12 +36,11 @@ export default function ConditionBadge({ ...condition }) {
const { id, type, content } = condition
const color = CONDITION_COLORS[type]
const icon = CONDITION_ICONS[type]
- const {removeRawCondition} = useContext(ContextRepositoryEditor)
+ const { removeRawCondition } = useContext(ContextRepositoryEditor)
let displayedContent = content
if(type === 3) {
let split = displayedContent.split(" ")
- let type = split[0]
let radius = Number.parseFloat(split[1]).toFixed(0)
let radiusType = "m"
if(radius >= 2000) {
@@ -65,10 +64,12 @@ export default function ConditionBadge({ ...condition }) {
{displayedContent}