Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions custom-models/plugin-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,12 +184,19 @@ export interface PluginKVStore {
): Promise<T | null>;
}

/**
* 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<string, string[]>;

/**
* Plugin context with KV always available for modern plugins.
*/
export interface PluginContext {
api: PluginAPI;
kv: PluginKVStore;
headers: PluginHeaders;
params: any;
}

Expand Down
8 changes: 7 additions & 1 deletion src/models/plugin-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,13 +184,19 @@ export interface PluginKVStore {
): Promise<T | null>;
}

/**
* 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<string, string[]>;

/**
* 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;
}

Expand Down