From db0b488611028a74d0b46366c3c1c9ae0934b8ce Mon Sep 17 00:00:00 2001 From: Dylan Kilkenny Date: Mon, 1 Dec 2025 11:57:09 +0000 Subject: [PATCH] feat: add headers to plugin context type Signed-off-by: Dylan Kilkenny --- custom-models/plugin-api.ts | 7 +++++++ src/models/plugin-api.ts | 8 +++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/custom-models/plugin-api.ts b/custom-models/plugin-api.ts index 50e9057e..a4a5c25a 100644 --- a/custom-models/plugin-api.ts +++ b/custom-models/plugin-api.ts @@ -184,12 +184,19 @@ export interface PluginKVStore { ): Promise; } +/** + * HTTP headers from the incoming request. + * Each header name maps to an array of values (since HTTP headers can have multiple values). + */ +export type PluginHeaders = Record; + /** * Plugin context with KV always available for modern plugins. */ export interface PluginContext { api: PluginAPI; kv: PluginKVStore; + headers: PluginHeaders; params: any; } diff --git a/src/models/plugin-api.ts b/src/models/plugin-api.ts index d2edfeab..bd3aaaf0 100644 --- a/src/models/plugin-api.ts +++ b/src/models/plugin-api.ts @@ -184,13 +184,19 @@ export interface PluginKVStore { ): Promise; } +/** + * HTTP headers from the incoming request. + * Each header name maps to an array of values (since HTTP headers can have multiple values). + */ +export type PluginHeaders = Record; + /** * Plugin context with KV always available for modern plugins. */ export interface PluginContext { api: PluginAPI; kv: PluginKVStore; - // eslint-disable-next-line @typescript-eslint/no-explicit-any + headers: PluginHeaders; params: any; }