Skip to content

Commit d287ec2

Browse files
authored
Merge pull request #42 from bugout-dev/journal-content-with-tags
Journal content with tags
2 parents 6395a48 + 0a200b6 commit d287ec2

File tree

5 files changed

+17
-3
lines changed

5 files changed

+17
-3
lines changed

bugout/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
__email__ = "engineering@bugout.dev"
99
__license__ = "MIT"
10-
__version__ = "0.2.2"
10+
__version__ = "0.2.3"
1111

1212
__all__ = (
1313
"__author__",

bugout/app.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def get_user_by_id(
9191
def find_user(
9292
self,
9393
username: str,
94-
token: Union[str, uuid.UUID] = None,
94+
token: Optional[Union[str, uuid.UUID]] = None,
9595
timeout: float = REQUESTS_TIMEOUT,
9696
**kwargs: Dict[str, Any],
9797
) -> data.BugoutUser:
@@ -670,6 +670,9 @@ def update_entry_content(
670670
timeout: float = REQUESTS_TIMEOUT,
671671
tags: Optional[List[str]] = None,
672672
tags_action: TagsAction = TagsAction.merge,
673+
context_url: Optional[str] = None,
674+
context_id: Optional[str] = None,
675+
context_type: Optional[str] = None,
673676
auth_type: str = data.AuthType.bearer.name,
674677
**kwargs: Dict[str, Any],
675678
) -> data.BugoutJournalEntryContent:
@@ -682,6 +685,9 @@ def update_entry_content(
682685
content=content,
683686
tags=tags,
684687
tags_action=tags_action,
688+
context_url=context_url,
689+
context_id=context_id,
690+
context_type=context_type,
685691
auth_type=data.AuthType[auth_type],
686692
**kwargs,
687693
)

bugout/data.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,8 @@ class BugoutJournalEntriesRequest(BaseModel):
205205
class BugoutJournalEntryContent(BaseModel):
206206
title: str
207207
content: str
208+
tags: List[str] = Field(default_factory=list)
209+
locked_by: Optional[str] = None
208210

209211

210212
class BugoutJournalEntryTags(BaseModel):

bugout/journal.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,9 @@ def update_entry_content(
371371
content: str,
372372
tags: Optional[List[str]] = None,
373373
tags_action: TagsAction = TagsAction.merge,
374+
context_url: Optional[str] = None,
375+
context_id: Optional[str] = None,
376+
context_type: Optional[str] = None,
374377
auth_type: AuthType = AuthType.bearer,
375378
**kwargs: Dict[str, Any],
376379
) -> BugoutJournalEntryContent:
@@ -379,6 +382,9 @@ def update_entry_content(
379382
json: Dict[str, Any] = {
380383
"title": title,
381384
"content": content,
385+
"context_url": context_url,
386+
"context_id": context_id,
387+
"context_type": context_type,
382388
}
383389
if tags is not None:
384390
json["tags"] = tags

bugout/user.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def get_user_by_id(
8787
def find_user(
8888
self,
8989
username: str,
90-
token: Union[str, uuid.UUID] = None,
90+
token: Optional[Union[str, uuid.UUID]] = None,
9191
**kwargs: Dict[str, Any],
9292
) -> BugoutUser:
9393
find_user_path = f"user/find?username={username}"

0 commit comments

Comments
 (0)