Skip to main content

Class: NoteService

Hierarchy

  • TransactionBaseServiceCopy to Clipboard

    NoteServiceCopy to Clipboard

Constructors

constructor

new NoteService(__namedParametersCopy to Clipboard)

Parameters

NameType
__namedParametersCopy to ClipboardInjectedDependenciesCopy to Clipboard

Overrides

TransactionBaseService.constructor

Defined in

packages/medusa/src/services/note.ts:29

Properties

__configModule__

ProtectedCopy to Clipboard OptionalCopy to Clipboard ReadonlyCopy to Clipboard __configModule__: RecordCopy to Clipboard<stringCopy to Clipboard, unknownCopy to Clipboard>

Inherited from

TransactionBaseService.__configModule__

Defined in

packages/medusa/src/interfaces/transaction-base-service.ts:10


__container__

ProtectedCopy to Clipboard ReadonlyCopy to Clipboard __container__: anyCopy to Clipboard

Inherited from

TransactionBaseService.__container__

Defined in

packages/medusa/src/interfaces/transaction-base-service.ts:9


__moduleDeclaration__

ProtectedCopy to Clipboard OptionalCopy to Clipboard ReadonlyCopy to Clipboard __moduleDeclaration__: RecordCopy to Clipboard<stringCopy to Clipboard, unknownCopy to Clipboard>

Inherited from

TransactionBaseService.__moduleDeclaration__

Defined in

packages/medusa/src/interfaces/transaction-base-service.ts:11


eventBus_

ProtectedCopy to Clipboard ReadonlyCopy to Clipboard eventBus_: EventBusServiceCopy to Clipboard

Defined in

packages/medusa/src/services/note.ts:27


manager_

ProtectedCopy to Clipboard manager_: EntityManagerCopy to Clipboard

Overrides

TransactionBaseService.manager_

Defined in

packages/medusa/src/services/note.ts:24


noteRepository_

ProtectedCopy to Clipboard ReadonlyCopy to Clipboard noteRepository_: typeof NoteRepositoryCopy to Clipboard

Defined in

packages/medusa/src/services/note.ts:26


transactionManager_

ProtectedCopy to Clipboard transactionManager_: undefinedCopy to Clipboard | EntityManagerCopy to Clipboard

Overrides

TransactionBaseService.transactionManager_

Defined in

packages/medusa/src/services/note.ts:25


Events

StaticCopy to Clipboard ReadonlyCopy to Clipboard Events: ObjectCopy to Clipboard

Type declaration

NameType
CREATEDCopy to ClipboardstringCopy to Clipboard
DELETEDCopy to ClipboardstringCopy to Clipboard
UPDATEDCopy to ClipboardstringCopy to Clipboard

Defined in

packages/medusa/src/services/note.ts:18

Methods

atomicPhase_

ProtectedCopy to Clipboard atomicPhase_<TResultCopy to Clipboard, TErrorCopy to Clipboard>(workCopy to Clipboard, isolationOrErrorHandler?Copy to Clipboard, maybeErrorHandlerOrDontFail?Copy to Clipboard): PromiseCopy to Clipboard<TResultCopy to Clipboard>

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.

Type parameters

Name
TResultCopy to Clipboard
TErrorCopy to Clipboard

Parameters

NameTypeDescription
workCopy to Clipboard(transactionManagerCopy to Clipboard: EntityManagerCopy to Clipboard) => PromiseCopy to Clipboard<TResultCopy to Clipboard>the transactional work to be done
isolationOrErrorHandler?Copy to ClipboardIsolationLevelCopy to Clipboard | (errorCopy to Clipboard: TErrorCopy to Clipboard) => PromiseCopy to Clipboard<voidCopy to Clipboard | TResultCopy to Clipboard>the isolation level to be used for the work.
maybeErrorHandlerOrDontFail?Copy to Clipboard(errorCopy to Clipboard: TErrorCopy to Clipboard) => PromiseCopy to Clipboard<voidCopy to Clipboard | TResultCopy to Clipboard>Potential error handler

Returns

PromiseCopy to Clipboard<TResultCopy to Clipboard>

the result of the transactional work

Inherited from

TransactionBaseService.atomicPhase_

Defined in

packages/medusa/src/interfaces/transaction-base-service.ts:50


create

create(dataCopy to Clipboard, config?Copy to Clipboard): PromiseCopy to Clipboard<NoteCopy to Clipboard>

Creates a note associated with a given author

Parameters

NameTypeDescription
dataCopy to ClipboardCreateNoteInputCopy to Clipboardthe note to create
configCopy to ClipboardObjectCopy to Clipboardany configurations if needed, including meta data
config.metadataCopy to ClipboardRecordCopy to Clipboard<stringCopy to Clipboard, unknownCopy to Clipboard>-

Returns

PromiseCopy to Clipboard<NoteCopy to Clipboard>

resolves to the creation result

Defined in

packages/medusa/src/services/note.ts:103


delete

delete(noteIdCopy to Clipboard): PromiseCopy to Clipboard<voidCopy to Clipboard>

Deletes a given note

Parameters

NameTypeDescription
noteIdCopy to ClipboardstringCopy to Clipboardid of the note to delete

Returns

PromiseCopy to Clipboard<voidCopy to Clipboard>

Defined in

packages/medusa/src/services/note.ts:161


list

list(selectorCopy to Clipboard, config?Copy to Clipboard): PromiseCopy to Clipboard<NoteCopy to Clipboard[]>

Fetches all notes related to the given selector

Parameters

NameTypeDescription
selectorCopy to ClipboardSelectorCopy to Clipboard<NoteCopy to Clipboard>the query object for find
configCopy to ClipboardFindConfigCopy to Clipboard<NoteCopy to Clipboard>the configuration used to find the objects. contains relations, skip, and take.

Returns

PromiseCopy to Clipboard<NoteCopy to Clipboard[]>

notes related to the given search.

Defined in

packages/medusa/src/services/note.ts:82


retrieve

retrieve(noteIdCopy to Clipboard, config?Copy to Clipboard): PromiseCopy to Clipboard<NoteCopy to Clipboard>

Retrieves a specific note.

Parameters

NameTypeDescription
noteIdCopy to ClipboardstringCopy to Clipboardthe id of the note to retrieve.
configCopy to ClipboardFindConfigCopy to Clipboard<NoteCopy to Clipboard>any options needed to query for the result.

Returns

PromiseCopy to Clipboard<NoteCopy to Clipboard>

which resolves to the requested note.

Defined in

packages/medusa/src/services/note.ts:47


shouldRetryTransaction_

ProtectedCopy to Clipboard shouldRetryTransaction_(errCopy to Clipboard): booleanCopy to Clipboard

Parameters

NameType
errCopy to ClipboardRecordCopy to Clipboard<stringCopy to Clipboard, unknownCopy to Clipboard> | { codeCopy to Clipboard: stringCopy to Clipboard }

Returns

booleanCopy to Clipboard

Inherited from

TransactionBaseService.shouldRetryTransaction_

Defined in

packages/medusa/src/interfaces/transaction-base-service.ts:31


update

update(noteIdCopy to Clipboard, valueCopy to Clipboard): PromiseCopy to Clipboard<NoteCopy to Clipboard>

Updates a given note with a new value

Parameters

NameTypeDescription
noteIdCopy to ClipboardstringCopy to Clipboardthe id of the note to update
valueCopy to ClipboardstringCopy to Clipboardthe new value

Returns

PromiseCopy to Clipboard<NoteCopy to Clipboard>

resolves to the updated element

Defined in

packages/medusa/src/services/note.ts:139


withTransaction

withTransaction(transactionManager?Copy to Clipboard): NoteServiceCopy to Clipboard

Parameters

NameType
transactionManager?Copy to ClipboardEntityManagerCopy to Clipboard

Returns

NoteServiceCopy to Clipboard

Inherited from

TransactionBaseService.withTransaction

Defined in

packages/medusa/src/interfaces/transaction-base-service.ts:14