Skip to content

Class: InMemoryDocumentService ​

Defined in: testing/in-memory-services.ts:59

In-memory document service for testing

Implements ​

Constructors ​

Constructor ​

ts
new InMemoryDocumentService(): InMemoryDocumentService;

Returns ​

InMemoryDocumentService

Methods ​

createDocument() ​

ts
createDocument(params): Promise<DocumentInstance<string>>;

Defined in: testing/in-memory-services.ts:64

Creates a document with a generated id and default QA, audit and version fields, and stores it in memory.

Parameters ​

ParameterType
params{ data?: any; profileId: string; }
params.data?any
params.profileIdstring

Returns ​

Promise<DocumentInstance<string>>

Implementation of ​

DocumentService.createDocument


deleteDocument() ​

ts
deleteDocument(params): Promise<void>;

Defined in: testing/in-memory-services.ts:125

Removes the document from memory.

Parameters ​

ParameterType
params{ documentId: string; }
params.documentIdstring

Returns ​

Promise<void>

Implementation of ​

DocumentService.deleteDocument


duplicateDocument() ​

ts
duplicateDocument(_params): Promise<DocumentInstance<string>>;

Defined in: testing/in-memory-services.ts:135

Not supported; throws.

Parameters ​

ParameterType
_params{ documentId: string; }
_params.documentIdstring

Returns ​

Promise<DocumentInstance<string>>

Implementation of ​

DocumentService.duplicateDocument


getDocument() ​

ts
getDocument(documentId): Promise<DocumentInstance<string>>;

Defined in: testing/in-memory-services.ts:96

Returns the stored document, or null (despite the return type) when the id is unknown.

Parameters ​

ParameterType
documentIdstring

Returns ​

Promise<DocumentInstance<string>>

Implementation of ​

DocumentService.getDocument


moveDocument() ​

ts
moveDocument(_params): Promise<void>;

Defined in: testing/in-memory-services.ts:130

No-op.

Parameters ​

ParameterType
_params{ documentId: string; targetFolderId: string; }
_params.documentIdstring
_params.targetFolderIdstring

Returns ​

Promise<void>

Implementation of ​

DocumentService.moveDocument


updateDocument() ​

ts
updateDocument(params): Promise<DocumentInstance<string>>;

Defined in: testing/in-memory-services.ts:105

Replaces the document data when data is given and updates audit.updatedAt. Throws if the document does not exist.

Parameters ​

ParameterType
params{ data?: any; documentId: string; }
params.data?any
params.documentIdstring

Returns ​

Promise<DocumentInstance<string>>

Implementation of ​

DocumentService.updateDocument