import { Knex } from 'knex' ; import { SchemaOverview } from '../types' ; import { Accountability } from '@directus/shared/types' ; import { Item , PrimaryKey } from './items' ; import { Query } from '@directus/shared/types' ; export type AbstractServiceOptions = { knex ? : Knex ; accountability ? : Accountability | null ; schema : SchemaOverview ; } ; export interface AbstractService { knex : Knex ; accountability : Accountability | null ; createOne ( data ) : Promise < PrimaryKey > ; createMany ( data ) : Promise < PrimaryKey [ ] > ; readOne ( key , query ? ) : Promise < Item > ; readMany ( keys , query ? ) : Promise < Item [ ] > ; readByQuery ( query ) : Promise < Item [ ] > ; updateOne ( key , data ) : Promise < PrimaryKey > ; updateMany ( keys , data ) : Promise < PrimaryKey [ ] > ; deleteOne ( key ) : Promise < PrimaryKey > ; deleteMany ( keys ) : Promise < PrimaryKey [ ] > ; }