Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

type: fix Azure Function v4 Adapter HttpRequest and InvocationContext Type #742

Merged
merged 2 commits into from
Jan 16, 2025
Merged
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
24 changes: 17 additions & 7 deletions src/convenience/frameworks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,23 @@ export type AzureAdapter = (context: {
[key: string]: any;
};
}, request: { body?: unknown }) => ReqResHandler;
export type AzureAdapterV4 = (request: Request, context: {
res?: {
status: number;
body: string;
headers?: Record<string, string>;
};
}) => ReqResHandler<{ status: number; body?: string } | { jsonBody: string }>;
type AzureV4HttpRequest = {
method: string;
url: string;
headers: any;
query: URLSearchParams;
body: any;
}
type AzureV4InvocationContext = {
invocationId: string;
functionName: string;
}
export type AzureAdapterV4 = (request: AzureV4HttpRequest, context: AzureV4InvocationContext) => ReqResHandler<{
status: number;
body?: string;
} | {
jsonBody: string;
}>;

export type BunAdapter = (request: {
headers: Headers;
Expand Down