@@ -153,8 +153,157 @@ def update_group(
153153 def delete_group (self , token : uuid .UUID , group_id : uuid .UUID ) -> data .BugoutGroup :
154154 return self .group .delete_group (token , group_id )
155155
156+ # Journal scopes handlers
157+ def list_scopes (self , token : uuid .UUID , api : str ) -> data .BugoutScopes :
158+ return self .journal .list_scopes (token , api )
159+
160+ def get_journal_scopes (
161+ self , token : uuid .UUID , journal_id : uuid .UUID
162+ ) -> data .BugoutJournalScopeSpecs :
163+ return self .journal .get_journal_scopes (token , journal_id )
164+
165+ def update_journal_scopes (
166+ self ,
167+ token : uuid .UUID ,
168+ journal_id : uuid .UUID ,
169+ holder_type : data .HolderType ,
170+ holder_id : uuid .UUID ,
171+ permission_list : List [str ],
172+ ) -> data .BugoutJournalScopeSpecs :
173+ return self .journal .update_journal_scopes (
174+ token , journal_id , holder_type , holder_id , permission_list
175+ )
176+
177+ def delete_journal_scopes (
178+ self ,
179+ token : uuid .UUID ,
180+ journal_id : uuid .UUID ,
181+ holder_type : data .HolderType ,
182+ holder_id : uuid .UUID ,
183+ permission_list : List [str ],
184+ ) -> data .BugoutJournalScopeSpecs :
185+ return self .journal .delete_journal_scopes (
186+ token , journal_id , holder_type , holder_id , permission_list
187+ )
188+
156189 # Journal handlers
190+ def create_journal (self , token : uuid .UUID , name : str ) -> data .BugoutJournal :
191+ return self .journal .create_journal (token , name )
192+
193+ def list_journals (self , token : uuid .UUID ) -> data .BugoutJournals :
194+ return self .journal .list_journals (token )
195+
157196 def get_journal (
158- self , journal_id : uuid .UUID , token : uuid .UUID
197+ self , token : uuid .UUID , journal_id : uuid .UUID
198+ ) -> data .BugoutJournal :
199+ return self .journal .get_journal (token , journal_id )
200+
201+ def update_journal (
202+ self , token : uuid .UUID , journal_id : uuid .UUID , name : str
203+ ) -> data .BugoutJournal :
204+ return self .journal .update_journal (token , journal_id , name )
205+
206+ def delete_journal (
207+ self , token : uuid .UUID , journal_id : uuid .UUID
159208 ) -> data .BugoutJournal :
160- return self .journal .get_journal (journal_id , token )
209+ return self .journal .delete_journal (token , journal_id )
210+
211+ # Journal entries
212+ def create_entry (
213+ self ,
214+ token : uuid .UUID ,
215+ journal_id : uuid .UUID ,
216+ title : str ,
217+ content : str ,
218+ tags : List [str ] = [],
219+ context_url : Optional [str ] = None ,
220+ context_id : Optional [str ] = None ,
221+ context_type : Optional [str ] = None ,
222+ ) -> data .BugoutJournalEntry :
223+ return self .journal .create_entry (
224+ token ,
225+ journal_id ,
226+ title ,
227+ content ,
228+ tags ,
229+ context_url ,
230+ context_id ,
231+ context_type ,
232+ )
233+
234+ def get_entry (
235+ self , token : uuid .UUID , journal_id : uuid .UUID , entry_id : uuid .UUID
236+ ) -> data .BugoutJournalEntry :
237+ return self .journal .get_entry (token , journal_id , entry_id )
238+
239+ def get_entries (
240+ self , token : uuid .UUID , journal_id : uuid .UUID
241+ ) -> data .BugoutJournalEntries :
242+ return self .journal .get_entries (token , journal_id )
243+
244+ def get_entry_content (
245+ self , token : uuid .UUID , journal_id : uuid .UUID , entry_id : uuid .UUID
246+ ) -> data .BugoutJournalEntryContent :
247+ return self .journal .get_entry_content (token , journal_id , entry_id )
248+
249+ def update_entry_content (
250+ self ,
251+ token : uuid .UUID ,
252+ journal_id : uuid .UUID ,
253+ entry_id : uuid .UUID ,
254+ title : str ,
255+ content : str ,
256+ ) -> data .BugoutJournalEntryContent :
257+ return self .journal .update_entry_content (
258+ token , journal_id , entry_id , title , content
259+ )
260+
261+ def delete_entry (
262+ self ,
263+ token : uuid .UUID ,
264+ journal_id : uuid .UUID ,
265+ entry_id : uuid .UUID ,
266+ ) -> data .BugoutJournalEntry :
267+ return self .journal .delete_entry (token , journal_id , entry_id )
268+
269+ # Tags
270+ def get_most_used_tags (self , token : uuid .UUID , journal_id : uuid .UUID ) -> List [Any ]:
271+ return self .journal .get_most_used_tags (token , journal_id )
272+
273+ def create_tags (
274+ self ,
275+ token : uuid .UUID ,
276+ journal_id : uuid .UUID ,
277+ entry_id : uuid .UUID ,
278+ tags : List [str ],
279+ ) -> List [Any ]:
280+ return self .journal .create_tags (token , journal_id , entry_id , tags )
281+
282+ def get_tags (
283+ self , token : uuid .UUID , journal_id : uuid .UUID , entry_id : uuid .UUID
284+ ) -> data .BugoutJournalEntryTags :
285+ return self .journal .get_tags (token , journal_id , entry_id )
286+
287+ def update_tags (
288+ self ,
289+ token : uuid .UUID ,
290+ journal_id : uuid .UUID ,
291+ entry_id : uuid .UUID ,
292+ tags : List [str ],
293+ ) -> List [Any ]:
294+ return self .journal .update_tags (token , journal_id , entry_id , tags )
295+
296+ def delete_tag (
297+ self ,
298+ token : uuid .UUID ,
299+ journal_id : uuid .UUID ,
300+ entry_id : uuid .UUID ,
301+ tag : str ,
302+ ) -> data .BugoutJournalEntryTags :
303+ return self .journal .delete_tag (token , journal_id , entry_id , tag )
304+
305+ # Search
306+ def search (
307+ self , token : uuid .UUID , journal_id : uuid .UUID , ** queries : Dict [str , Any ]
308+ ) -> data .BugoutSearchResults :
309+ return self .journal .search (token , journal_id , ** queries )
0 commit comments