From ac15a1e94715c604ea72f17a5a34e47e12bc999f Mon Sep 17 00:00:00 2001 From: Nato Boram Date: Tue, 1 Oct 2024 14:26:20 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=8F=B7=EF=B8=8F=20SuggestionState=20(#11)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/server/webhooks/events/index.ts | 1 + src/server/webhooks/events/pr/comment_added.ts | 3 ++- src/server/webhooks/events/suggestion_state.ts | 6 ++++++ 3 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 src/server/webhooks/events/suggestion_state.ts diff --git a/src/server/webhooks/events/index.ts b/src/server/webhooks/events/index.ts index be1f14c..5fbf626 100644 --- a/src/server/webhooks/events/index.ts +++ b/src/server/webhooks/events/index.ts @@ -2,3 +2,4 @@ export * from "./event.js" export * as pr from "./pr/index.js" export * as project from "./project/index.js" export * as repo from "./repo/index.js" +export * from "./suggestion_state.js" diff --git a/src/server/webhooks/events/pr/comment_added.ts b/src/server/webhooks/events/pr/comment_added.ts index d6940d2..39057b0 100644 --- a/src/server/webhooks/events/pr/comment_added.ts +++ b/src/server/webhooks/events/pr/comment_added.ts @@ -7,6 +7,7 @@ import type { SchemaRepository, SchemaRestMinimalRef, } from "../../../openapi/openapi-typescript.js" +import type { SuggestionState } from "../suggestion_state.js" export interface Actor { readonly active: boolean @@ -75,7 +76,7 @@ export interface Project { export interface Properties { readonly repositoryId: number - readonly suggestionState: string + readonly suggestionState?: SuggestionState } export interface PullRequest { diff --git a/src/server/webhooks/events/suggestion_state.ts b/src/server/webhooks/events/suggestion_state.ts new file mode 100644 index 0000000..cd94caf --- /dev/null +++ b/src/server/webhooks/events/suggestion_state.ts @@ -0,0 +1,6 @@ +export const suggestionState = { + UNAPPLIED: "UNAPPLIED", +} as const + +export type SuggestionState = + (typeof suggestionState)[keyof typeof suggestionState]