-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: increase max duration to 5 minutes for rest endpoints (#1177)
- Loading branch information
1 parent
8553162
commit 4d65b9c
Showing
6 changed files
with
127 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,42 @@ | ||
export interface SerializableFile { | ||
readonly name: string; | ||
readonly lastModified: number; | ||
readonly size: number; | ||
readonly type: string; | ||
readonly dataUrl: string; // base64-encoded | ||
} | ||
import { z } from "zod"; | ||
|
||
export declare namespace SerializableFormDataEntryValue { | ||
interface SingleFile { | ||
type: "file"; | ||
value: SerializableFile | undefined; | ||
} | ||
export const SerializableFileSchema = z | ||
.object({ | ||
name: z.string(), | ||
lastModified: z.number(), | ||
size: z.number(), | ||
type: z.string(), | ||
dataUrl: z.string({ description: "base64-encoded" }), | ||
}) | ||
.readonly(); | ||
|
||
interface MultipleFiles { | ||
type: "fileArray"; | ||
value: SerializableFile[]; | ||
} | ||
export type SerializableFile = z.infer<typeof SerializableFileSchema>; | ||
|
||
interface Json { | ||
type: "json"; | ||
value: unknown; | ||
export const SerializableSingleFileSchema = z.object({ | ||
type: z.literal("file"), | ||
value: SerializableFileSchema.optional(), | ||
}); | ||
|
||
// if contentType is not provided, assume stringified JSON. Otherwise, use the provided contentType as a Blob type | ||
contentType: string | undefined; | ||
} | ||
} | ||
export const SerializableMultipleFilesSchema = z.object({ | ||
type: z.literal("fileArray"), | ||
value: z.array(SerializableFileSchema), | ||
}); | ||
|
||
export type SerializableFormDataEntryValue = | ||
| SerializableFormDataEntryValue.Json | ||
| SerializableFormDataEntryValue.SingleFile | ||
| SerializableFormDataEntryValue.MultipleFiles; | ||
export const SerializableJsonSchema = z.object({ | ||
type: z.literal("json"), | ||
value: z.unknown(), | ||
contentType: z | ||
.string({ | ||
description: | ||
"if contentType is not provided, assume stringified JSON. Otherwise, use the provided contentType as a Blob type", | ||
}) | ||
.optional(), | ||
}); | ||
|
||
export const SerializableFormDataEntryValueSchema = z.union([ | ||
SerializableSingleFileSchema, | ||
SerializableMultipleFilesSchema, | ||
SerializableJsonSchema, | ||
]); | ||
|
||
export type SerializableFormDataEntryValue = z.infer<typeof SerializableFormDataEntryValueSchema>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters