From 77db65d6692bbdb2687d4fc188998f2981294e9f Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Sun, 15 Feb 2026 16:10:17 +0000 Subject: [PATCH] refactor(hooks): dedupe gmail option types --- src/hooks/gmail-ops.ts | 26 +++++++------------------- 1 file changed, 7 insertions(+), 19 deletions(-) diff --git a/src/hooks/gmail-ops.ts b/src/hooks/gmail-ops.ts index e7fe4be262..a7ff69e351 100644 --- a/src/hooks/gmail-ops.ts +++ b/src/hooks/gmail-ops.ts @@ -44,9 +44,7 @@ import { resolveGmailHookRuntimeConfig, } from "./gmail.js"; -export type GmailSetupOptions = { - account: string; - project?: string; +type GmailCommonOptions = { topic?: string; subscription?: string; label?: string; @@ -62,27 +60,17 @@ export type GmailSetupOptions = { tailscale?: "off" | "serve" | "funnel"; tailscalePath?: string; tailscaleTarget?: string; +}; + +export type GmailSetupOptions = GmailCommonOptions & { + account: string; + project?: string; pushEndpoint?: string; json?: boolean; }; -export type GmailRunOptions = { +export type GmailRunOptions = GmailCommonOptions & { account?: string; - topic?: string; - subscription?: string; - label?: string; - hookToken?: string; - pushToken?: string; - hookUrl?: string; - bind?: string; - port?: number; - path?: string; - includeBody?: boolean; - maxBytes?: number; - renewEveryMinutes?: number; - tailscale?: "off" | "serve" | "funnel"; - tailscalePath?: string; - tailscaleTarget?: string; }; const DEFAULT_GMAIL_TOPIC_IAM_MEMBER = "serviceAccount:gmail-api-push@system.gserviceaccount.com";