Comparing version 0.1.1 to 0.1.2
@@ -26,3 +26,3 @@ import { HTTPMethod } from 'h3'; | ||
type MaybePromise<T> = Promise<T> | T; | ||
interface Driver { | ||
interface MinimalDriver { | ||
putMany: <T extends Record<string, any>>(item: T[]) => MaybePromise<void>; | ||
@@ -34,2 +34,5 @@ getMany: (args: GetManyArgs) => MaybePromise<{ | ||
} | ||
interface Driver extends MinimalDriver { | ||
getAll: (args: GetManyArgs) => MaybePromise<Record<string, any>[]>; | ||
} | ||
interface FieldDefinition { | ||
@@ -41,5 +44,5 @@ name: string; | ||
comment?: string; | ||
decorators?: Record<string, Record<string, any>>; | ||
} | ||
interface GetManyArgs { | ||
where?: Record<string, any>; | ||
interface GetManyArgs extends GetArgs { | ||
orderBy?: string; | ||
@@ -51,2 +54,3 @@ maxItemCount?: number; | ||
where?: Record<string, any>; | ||
include?: Record<string, any>; | ||
} | ||
@@ -59,2 +63,3 @@ interface EntityMethods<T = Record<string, any>> { | ||
}>; | ||
getAll: (args: GetManyArgs) => Promise<T[]>; | ||
put: (data: T) => Promise<T>; | ||
@@ -88,2 +93,2 @@ putMany: (data: T[]) => Promise<T[]>; | ||
export { CreateRadsArgs, Driver, DriverOptions, EntityDecoratorArgs, EntityMethods, FieldDecoratorArgs, FieldDefinition, GetArgs, GetManyArgs, MemoryDriverOptions, RadsDb, RestDriverOptions, Schema, SchemaValidators, TypeDefinition, createRads, entity, field, getRestRoutes, radsDb }; | ||
export { CreateRadsArgs, Driver, DriverOptions, EntityDecoratorArgs, EntityMethods, FieldDecoratorArgs, FieldDefinition, GetArgs, GetManyArgs, MemoryDriverOptions, MinimalDriver, RadsDb, RestDriverOptions, Schema, SchemaValidators, TypeDefinition, createRads, entity, field, getRestRoutes, radsDb }; |
@@ -28,3 +28,3 @@ { | ||
}, | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "Say goodbye to boilerplate code and hello to efficient and elegant syntax.", | ||
@@ -31,0 +31,0 @@ "keywords": [], |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
80340
2216