NoteService
Properties
__configModule__
Record<string, unknown>__container__
anyRequired__moduleDeclaration__
Record<string, unknown>manager_
EntityManagerRequiredtransactionManager_
undefined | EntityManagerRequiredEvents
objectRequiredEvents.CREATED
stringRequiredEvents.DELETED
stringRequiredEvents.UPDATED
stringRequiredAccessors
activeManager_
Protected
get
activeManager_(): EntityManager
Returns
EntityManager
EntityManager
EntityManagerRequiredInherited from
TransactionBaseService.activeManager_
Methods
atomicPhase_
Protected
atomicPhase_<TResult
, TError
>(work
, isolationOrErrorHandler?
, maybeErrorHandlerOrDontFail?
): Promise
<TResult
>
Wraps some work within a transactional block. If the service already has a transaction manager attached this will be reused, otherwise a new transaction manager is created.
TResult
objectRequiredTError
objectRequiredParameters
work
(transactionManager: EntityManager) => Promise<TResult>RequiredisolationOrErrorHandler
IsolationLevel | (error: TError) => Promise<void | TResult>maybeErrorHandlerOrDontFail
(error: TError) => Promise<void | TResult>Returns
Promise
<TResult
>
Promise
Promise<TResult>RequiredInherited from
TransactionBaseService.atomicPhase_
create
create(data
, config?
): Promise
<Note
>
Creates a note associated with a given author
Parameters
config
objectconfig.metadata
Record<string, unknown>RequiredReturns
Promise
<Note
>
resolves to the creation result
delete
delete(noteId
): Promise
<void
>
Deletes a given note
Parameters
noteId
stringRequiredReturns
Promise
<void
>
Promise
Promise<void>Requiredlist
list(selector
, config?
): Promise
<Note
[]>
Fetches all notes related to the given selector
Parameters
config
FindConfig<Note>Returns
Promise
<Note
[]>
notes related to the given search.
listAndCount
listAndCount(selector
, config?
): Promise
<[Note
[], number
]>
Fetches all notes related to the given selector
Parameters
config
FindConfig<Note>Returns
Promise
<[Note
[], number
]>
notes related to the given search.
retrieve
retrieve(noteId
, config?
): Promise
<Note
>
Retrieves a specific note.
Parameters
noteId
stringRequiredconfig
FindConfig<Note>Returns
Promise
<Note
>
which resolves to the requested note.
shouldRetryTransaction_
Protected
shouldRetryTransaction_(err
): boolean
Parameters
err
Record<string, unknown> | { code: string }RequiredReturns
boolean
boolean
booleanInherited from
TransactionBaseService.shouldRetryTransaction_
update
update(noteId
, value
): Promise
<Note
>
Updates a given note with a new value
Parameters
noteId
stringRequiredvalue
stringRequiredReturns
Promise
<Note
>
resolves to the updated element
withTransaction
withTransaction(transactionManager?
): NoteService
Parameters
transactionManager
EntityManager