@@ -16,8 +16,8 @@ def get_note_by_id(self, note_id: str) -> dict:
1616
1717 Returns
1818 -------
19- requests.Response
20- The response from the Trilium API .
19+ dict
20+ The JSON response from Trilium, as a dictionary .
2121 """
2222 return self .make_request (f"/notes/{ note_id } " ).json ()
2323
@@ -36,7 +36,7 @@ def get_note_content_by_id(self, note_id: str) -> str:
3636 """
3737 return self .make_request (f"/notes/{ note_id } /content" ).text
3838
39- def put_note_content_by_id (self , note_id : str , data : str ) -> requests . Response :
39+ def put_note_content_by_id (self , note_id : str , data : str ) -> dict :
4040 """Given the Note's ID, this will update the Note's content.
4141
4242 Parameters
@@ -48,12 +48,12 @@ def put_note_content_by_id(self, note_id: str, data: str) -> requests.Response:
4848
4949 Returns
5050 -------
51- requests.Response
52- The response from the Trilium API .
51+ dict
52+ The JSON response from Trilium, as a dictionary .
5353 """
54- return self .make_request (f"/notes/{ note_id } /content" , method = "PUT" , data = data )
54+ return self .make_request (f"/notes/{ note_id } /content" , method = "PUT" , data = data ). json ()
5555
56- def patch_note_by_id (self , note_id : str , data : str ) -> requests . Response :
56+ def patch_note_by_id (self , note_id : str , data : str ) -> dict :
5757 """Given the Note's ID, this will update the Note's content.
5858
5959 Parameters
@@ -65,12 +65,12 @@ def patch_note_by_id(self, note_id: str, data: str) -> requests.Response:
6565
6666 Returns
6767 -------
68- requests.Response
69- The response from the Trilium API .
68+ dict
69+ The JSON response from Trilium, as a dictionary .
7070 """
71- return self .make_request (f"/notes/{ note_id } " , method = "PATCH" , data = data )
71+ return self .make_request (f"/notes/{ note_id } " , method = "PATCH" , data = data ). json ()
7272
73- def delete_note_by_id (self , note_id : str ) -> requests . Response :
73+ def delete_note_by_id (self , note_id : str ) -> dict :
7474 """Given the Note's ID, this will delete the Note.
7575
7676 Parameters
@@ -80,10 +80,10 @@ def delete_note_by_id(self, note_id: str) -> requests.Response:
8080
8181 Returns
8282 -------
83- requests.Response
84- The response from the Trilium API .
83+ dict
84+ The JSON response from Trilium, as a dictionary .
8585 """
86- return self .make_request (f"/notes/{ note_id } " , method = "DELETE" )
86+ return self .make_request (f"/notes/{ note_id } " , method = "DELETE" ). json ()
8787
8888 def export_note_by_id (self , note_id : str , filepath_to_save_export_zip : str , format = "html" ) -> bool :
8989 """Given the Note's ID, export itself and all child notes into a singular .zip archive.
@@ -123,7 +123,7 @@ def export_note_by_id(self, note_id: str, filepath_to_save_export_zip: str, form
123123 return False
124124 return True
125125
126- def create_note_revision (self , note_id : str , data : str , format : str = "html" ) -> requests . Response :
126+ def create_note_revision (self , note_id : str , data : str , format : str = "html" ) -> dict :
127127 """Given the Note's ID, create a new revision of the Note.
128128
129129 Parameters
@@ -137,14 +137,14 @@ def create_note_revision(self, note_id: str, data: str, format: str = "html") ->
137137
138138 Returns
139139 -------
140- requests.Response
141- The response from the Trilium API .
140+ dict
141+ The JSON response from Trilium, as a dictionary .
142142 """
143143
144144 params = {"format" : format }
145- return self .make_request (f"/notes/{ note_id } /note-revision" , method = "POST" , data = data , params = params )
145+ return self .make_request (f"/notes/{ note_id } /note-revision" , method = "POST" , data = data , params = params ). json ()
146146
147- def refresh_note_ordering (self , parent_note_id : str ) -> requests . Response :
147+ def refresh_note_ordering (self , parent_note_id : str ) -> dict :
148148 """Given the Note's ID, refresh the node ordering of the Note.
149149
150150 Parameters
@@ -154,12 +154,12 @@ def refresh_note_ordering(self, parent_note_id: str) -> requests.Response:
154154
155155 Returns
156156 -------
157- requests.Response
158- The response from the Trilium API .
157+ dict
158+ The JSON response from Trilium, as a dictionary .
159159 """
160160 return self .make_request (f"/refresh-note-ordering/{ parent_note_id } " , method = "POST" )
161161
162- def create_note (self , data : str ) -> requests . Response :
162+ def create_note (self , data : str ) -> dict :
163163 """Create a new Note.
164164
165165 Parameters
@@ -169,7 +169,7 @@ def create_note(self, data: str) -> requests.Response:
169169
170170 Returns
171171 -------
172- requests.Response
173- The response from the Trilium API .
172+ dict
173+ The JSON response from Trilium, as a dictionary .
174174 """
175- return self .make_request ("/create-note" , method = "POST" , data = data )
175+ return self .make_request ("/create-note" , method = "POST" , data = data ). json ()
0 commit comments