mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-12-06 08:04:37 +00:00
feat(collection): support source folder and selector in collections
This commit is contained in:
+10
-3
@@ -2,10 +2,17 @@ import { z } from 'zod'
|
||||
import { searchFilterSchema } from './search'
|
||||
import { paginationParamsSchema } from './pagination'
|
||||
|
||||
export const collectionFilterSchema = z.object({
|
||||
sourceFolderId: z.string(),
|
||||
searchFilter: searchFilterSchema,
|
||||
})
|
||||
|
||||
export type CollectionFilter = z.infer<typeof collectionFilterSchema>
|
||||
|
||||
export const collectionSchema = z.object({
|
||||
id: z.string(),
|
||||
name: z.string(),
|
||||
filter: searchFilterSchema,
|
||||
filter: collectionFilterSchema,
|
||||
projectId: z.string(),
|
||||
createdAt: z.string(),
|
||||
updatedAt: z.string(),
|
||||
@@ -15,14 +22,14 @@ export type CollectionInfo = z.infer<typeof collectionSchema>
|
||||
|
||||
export const createCollectionRequestSchema = z.object({
|
||||
name: z.string(),
|
||||
filter: searchFilterSchema,
|
||||
filter: collectionFilterSchema,
|
||||
})
|
||||
|
||||
export type CreateCollectionRequest = z.infer<typeof createCollectionRequestSchema>
|
||||
|
||||
export const updateCollectionRequestSchema = z.object({
|
||||
name: z.string().optional(),
|
||||
filter: searchFilterSchema.optional(),
|
||||
filter: collectionFilterSchema.optional(),
|
||||
})
|
||||
|
||||
export type UpdateCollectionRequest = z.infer<typeof updateCollectionRequestSchema>
|
||||
|
||||
Reference in New Issue
Block a user