⚗️ add project card api preview

This commit is contained in:
yanyongyu 2021-08-20 01:25:33 +08:00
parent 38a41c501e
commit 6ec3e7a1e3
5 changed files with 29 additions and 9 deletions

View File

@ -4,7 +4,7 @@
@Author : yanyongyu
@Date : 2021-03-11 16:57:04
@LastEditors : yanyongyu
@LastEditTime : 2021-08-20 01:10:46
@LastEditTime : 2021-08-20 01:11:35
@Description : None
@GitHub : https://github.com/yanyongyu
"""
@ -95,7 +95,8 @@ class Issue(BaseModel):
https://docs.github.com/en/rest/reference/issues#list-timeline-events-for-an-issue
"""
headers = {
"Accept": "application/vnd.github.mockingbird-preview.full+json"
"Accept": "application/vnd.github.mockingbird-preview.full+json, "
"application/vnd.github.starfox-preview+json"
}
return PaginatedList(
Union[TimelineEventCommited, TimelineEventForcePushed,

View File

@ -4,7 +4,7 @@
@Author : yanyongyu
@Date : 2021-05-14 00:57:33
@LastEditors : yanyongyu
@LastEditTime : 2021-08-20 00:46:20
@LastEditTime : 2021-08-20 01:15:57
@Description : None
@GitHub : https://github.com/yanyongyu
"""
@ -314,12 +314,22 @@ class TimelineEventClosed(TimelineEvent):
# Issue Added to Project
class TimelineEventProjectCard(_BaseModel):
id: int
url: str
project_id: int
project_url: str
column_name: str
previous_column_name: str = ""
class TimelineEventAddedToProject(TimelineEvent):
event: Literal["added_to_project"]
id: int
node_id: str
url: str
actor: Actor
project_card: TimelineEventProjectCard
commit_id: Optional[str]
commit_url: Optional[str]
created_at: datetime
@ -344,6 +354,7 @@ class TimelineEventRemovedFromProject(TimelineEvent):
node_id: str
url: str
actor: Actor
project_card: TimelineEventProjectCard
commit_id: Optional[str]
commit_url: Optional[str]
created_at: datetime

View File

@ -2,7 +2,7 @@
* @Author : yanyongyu
* @Date : 2021-05-22 14:57:58
* @LastEditors : yanyongyu
* @LastEditTime : 2021-05-25 20:56:50
* @LastEditTime : 2021-08-20 01:18:27
* @Description : None
* @GitHub : https://github.com/yanyongyu
-->
@ -33,7 +33,9 @@
/>
</a>
<a class="author Link--primary text-bold">{{ event.actor.login|escape }}</a>
added this to project
added this to
<strong>{{ event.project_card.column_name|escape }}</strong>
in project
<a class="Link--secondary">{{ event.created_at|relative_time }}</a>
</div>
</div>

View File

@ -2,7 +2,7 @@
* @Author : yanyongyu
* @Date : 2021-05-22 14:59:08
* @LastEditors : yanyongyu
* @LastEditTime : 2021-05-25 21:04:40
* @LastEditTime : 2021-08-20 01:24:27
* @Description : None
* @GitHub : https://github.com/yanyongyu
-->
@ -33,7 +33,11 @@
/>
</a>
<a class="author Link--primary text-bold">{{ event.actor.login|escape }}</a>
moved this in project
moved this from
<strong>{{ event.project_card.column_name|escape }}</strong>
to
<strong>{{ event.project_card.previous_column_name|escape }}</strong>
in project
<a class="Link--secondary">{{ event.created_at|relative_time }}</a>
</div>
</div>

View File

@ -2,7 +2,7 @@
* @Author : yanyongyu
* @Date : 2021-05-22 15:01:24
* @LastEditors : yanyongyu
* @LastEditTime : 2021-05-25 21:05:34
* @LastEditTime : 2021-08-20 01:23:51
* @Description : None
* @GitHub : https://github.com/yanyongyu
-->
@ -33,7 +33,9 @@
/>
</a>
<a class="author Link--primary text-bold">{{ event.actor.login|escape }}</a>
removed this from project
removed this from
<strong>{{ event.project_card.column_name|escape }}</strong>
in project
<a class="Link--secondary">{{ event.created_at|relative_time }}</a>
</div>
</div>