feat: experimental generate resource
This commit is contained in:
@ -1,18 +1,32 @@
|
||||
export interface ServerFunctions {
|
||||
// collections
|
||||
// Database - collections
|
||||
createCollection(name: string): Promise<any>
|
||||
listCollections(): Promise<any>
|
||||
getCollection(name: string): Promise<any>
|
||||
dropCollection(name: string): Promise<any>
|
||||
|
||||
// documents
|
||||
// Database - documents
|
||||
createDocument(collection: string, data: any): Promise<any>
|
||||
listDocuments(collection: string): Promise<any>
|
||||
getDocument(collection: string, id: string): Promise<any>
|
||||
updateDocument(collection: string, data: any): Promise<any>
|
||||
deleteDocument(collection: string, id: string): Promise<any>
|
||||
|
||||
// Resource - api-routes & models
|
||||
generateResource(collection: Collection, resources: Resource[]): Promise<any>
|
||||
resourceSchema(collection: string): Promise<any>
|
||||
}
|
||||
|
||||
export interface ClientFunctions {
|
||||
refresh(type: string): void
|
||||
}
|
||||
|
||||
export interface Collection {
|
||||
name: string
|
||||
fields?: {}[]
|
||||
}
|
||||
|
||||
export interface Resource {
|
||||
type: string
|
||||
by?: string
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user