mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-06-02 19:55:18 +02:00
add get document request / response zod schema
This commit is contained in:
parent
557e736a53
commit
0fa969925a
1 changed files with 10 additions and 1 deletions
|
|
@ -65,11 +65,18 @@ export const getDocumentsRequest = z.object({
|
|||
.nullish(),
|
||||
});
|
||||
|
||||
export const getDocumentResponse = z.object({
|
||||
export const getDocumentsResponse = z.object({
|
||||
items: z.array(document),
|
||||
total: z.number(),
|
||||
});
|
||||
|
||||
/**
|
||||
* Get document
|
||||
*/
|
||||
export const getDocumentRequest = document.pick({ id: true });
|
||||
|
||||
export const getDocumentResponse = document;
|
||||
|
||||
/**
|
||||
* Create documents
|
||||
*/
|
||||
|
|
@ -136,6 +143,8 @@ export const getDocumentByChunkRequest = z.object({
|
|||
export const getDocumentByChunkResponse = documentWithChunks;
|
||||
|
||||
export type GetDocumentsRequest = z.infer<typeof getDocumentsRequest>;
|
||||
export type GetDocumentsResponse = z.infer<typeof getDocumentsResponse>;
|
||||
export type GetDocumentRequest = z.infer<typeof getDocumentRequest>;
|
||||
export type GetDocumentResponse = z.infer<typeof getDocumentResponse>;
|
||||
export type CreateDocumentRequest = z.infer<typeof createDocumentRequest>;
|
||||
export type CreateDocumentResponse = z.infer<typeof createDocumentResponse>;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue