feat(client): support http method in req middleware (#87)
* feat(client): support http method in req middleware * fix(client): fix required property
This commit is contained in:
parent
4da11f3060
commit
39089b2462
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@fal-ai/serverless-client",
|
||||
"description": "The fal serverless JS/TS client",
|
||||
"version": "0.14.2",
|
||||
"version": "0.14.3",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
||||
@ -3,12 +3,13 @@
|
||||
*
|
||||
* **Note:** This is a simplified version of the `RequestConfig` type from the
|
||||
* `fetch` API. It contains only the properties that are relevant for the
|
||||
* `fal-serverless` client. It also works around the fact that the `fetch` API
|
||||
* `Request` does not support mutability, its clone method has critical limitations
|
||||
* fal client. It also works around the fact that the `fetch` API `Request`
|
||||
* does not support mutability, its clone method has critical limitations
|
||||
* to our use case.
|
||||
*/
|
||||
export type RequestConfig = {
|
||||
url: string;
|
||||
method: string;
|
||||
headers?: Record<string, string | string[]>;
|
||||
};
|
||||
|
||||
|
||||
@ -30,6 +30,7 @@ export async function dispatchRequest<Input, Output>(
|
||||
|
||||
const { url, headers } = await requestMiddleware({
|
||||
url: targetUrl,
|
||||
method: method.toUpperCase(),
|
||||
});
|
||||
const authHeader = credentials ? { Authorization: `Key ${credentials}` } : {};
|
||||
const requestHeaders = {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user