RepositoryService
Defined in: repository-service.ts:44
A concrete Service<T> over any Repository<T> — the framework-owned bridge from
ServiceParams.query (raw strings from HTTP) to QueryParams.
Query conventions (see the Phase 4 TDD, section 14):
- Reserved keys inside
query:$limit,$skip,$sort,$select; everything else iswhere. find()ALWAYS returnsPaginated<T>—totalviarepository.count({ where }).- With
options.fields, unknown where/sort/select fields throwBadRequest. - With
options.schema, string where-values are coerced to the field’s declared type; without one they pass through unchanged. update/patch/removepropagate the repository’sNotFounduntouched.
For a service backed by more than one repository (e.g. writing an activity-log entry
alongside the primary record), compose them directly behind a hand-written Service<T>
instead — see “Services with multiple repositories” in the root README.
Extended by
Section titled “Extended by”Type Parameters
Section titled “Type Parameters”T
D = Partial<T>
Implements
Section titled “Implements”Service<T,D>
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new RepositoryService<
T,D>(repository,options?):RepositoryService<T,D>
Defined in: repository-service.ts:45
Parameters
Section titled “Parameters”repository
Section titled “repository”Repository<T, D>
options?
Section titled “options?”Returns
Section titled “Returns”RepositoryService<T, D>
Properties
Section titled “Properties”options
Section titled “options”
protectedreadonlyoptions:RepositoryServiceOptions={}
Defined in: repository-service.ts:47
repository
Section titled “repository”
protectedreadonlyrepository:Repository<T,D>
Defined in: repository-service.ts:46
Methods
Section titled “Methods”assertFields()
Section titled “assertFields()”
protectedassertFields(where):void
Defined in: repository-service.ts:179
Parameters
Section titled “Parameters”Record<string, unknown>
Returns
Section titled “Returns”void
create()
Section titled “create()”Call Signature
Section titled “Call Signature”create(
data,_params?):Promise<T>
Defined in: repository-service.ts:83
Parameters
Section titled “Parameters”D
_params?
Section titled “_params?”Returns
Section titled “Returns”Promise<T>
Implementation of
Section titled “Implementation of”Call Signature
Section titled “Call Signature”create(
data,_params?):Promise<T[]>
Defined in: repository-service.ts:84
Parameters
Section titled “Parameters”D[]
_params?
Section titled “_params?”Returns
Section titled “Returns”Promise<T[]>
Implementation of
Section titled “Implementation of”Service.create
describe()
Section titled “describe()”describe():
RepositoryCapabilities|undefined
Defined in: repository-service.ts:105
Surface the underlying repository’s capabilities so ServiceHandle.describe() can include them.
Returns
Section titled “Returns”RepositoryCapabilities | undefined
find()
Section titled “find()”find(
params?):Promise<Paginated<T>>
Defined in: repository-service.ts:50
Parameters
Section titled “Parameters”params?
Section titled “params?”Returns
Section titled “Returns”Promise<Paginated<T>>
Implementation of
Section titled “Implementation of”get(
id,_params?):Promise<T>
Defined in: repository-service.ts:75
Parameters
Section titled “Parameters”_params?
Section titled “_params?”Returns
Section titled “Returns”Promise<T>
Implementation of
Section titled “Implementation of”parseQuery()
Section titled “parseQuery()”
protectedparseQuery(query):ParsedQuery
Defined in: repository-service.ts:111
Parameters
Section titled “Parameters”Record<string, unknown>
Returns
Section titled “Returns”ParsedQuery
patch()
Section titled “patch()”patch(
id,data,_params?):Promise<T>
Defined in: repository-service.ts:96
Parameters
Section titled “Parameters”D
_params?
Section titled “_params?”Returns
Section titled “Returns”Promise<T>
Implementation of
Section titled “Implementation of”remove()
Section titled “remove()”remove(
id,_params?):Promise<T>
Defined in: repository-service.ts:100
Parameters
Section titled “Parameters”_params?
Section titled “_params?”Returns
Section titled “Returns”Promise<T>
Implementation of
Section titled “Implementation of”update()
Section titled “update()”update(
id,data,_params?):Promise<T>
Defined in: repository-service.ts:92
Parameters
Section titled “Parameters”D
_params?
Section titled “_params?”Returns
Section titled “Returns”Promise<T>