Skip to content

Commit 852db31

Browse files
chore: use package type instead of creating it manually
1 parent 3ccd755 commit 852db31

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

src/lib/server/github-cache.ts

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
import { GITHUB_TOKEN, KV_REST_API_TOKEN, KV_REST_API_URL } from "$env/static/private";
2-
import type { Repository as GQLRepository } from "@octokit/graphql-schema";
2+
import type {
3+
CommentAuthorAssociation,
4+
Repository as GQLRepository
5+
} from "@octokit/graphql-schema";
36
import { Redis } from "@upstash/redis";
47
import { Octokit } from "octokit";
58
import parseChangelog from "$lib/changelog-parser";
@@ -57,15 +60,6 @@ export type DiscussionDetails = {
5760
comments: DiscussionComment[];
5861
};
5962

60-
type AuthorAssociation =
61-
| "OWNER"
62-
| "MEMBER"
63-
| "COLLABORATOR"
64-
| "CONTRIBUTOR"
65-
| "FIRST_TIMER"
66-
| "FIRST_TIME_CONTRIBUTOR"
67-
| "MANNEQUIN"
68-
| "NONE";
6963
type TeamDiscussion = Awaited<
7064
ReturnType<InstanceType<typeof Octokit>["rest"]["teams"]["listDiscussionsInOrg"]>
7165
>["data"][number];
@@ -93,7 +87,7 @@ export type Discussion = {
9387
state_reason: "resolved" | null;
9488
locked: boolean;
9589
comments: TeamDiscussion["comments_count"];
96-
author_association: AuthorAssociation;
90+
author_association: CommentAuthorAssociation;
9791
active_lock_reason: null;
9892
timeline_url: string;
9993
} & Pick<
@@ -109,7 +103,7 @@ export type DiscussionComment = {
109103
child_comment_count: number;
110104
repository_url: `${string}/${string}`;
111105
discussion_id: number;
112-
author_association: AuthorAssociation;
106+
author_association: CommentAuthorAssociation;
113107
user: TeamDiscussion["author"];
114108
} & Pick<
115109
TeamDiscussionComment,

0 commit comments

Comments
 (0)