Skip to content

apollo-code


apollo-code / storage/src / IndexingMemoryService

Class: IndexingMemoryService

Serializes fact mutations with dirty-marker-first index updates.

Implements

Constructors

Constructor

new IndexingMemoryService(facts, source, index): IndexingMemoryService

Parameters

facts

MemoryService

source

MemoryRepository

index

MemoryIndex & MemoryIndexMaintenance

Returns

IndexingMemoryService

Properties

facts

readonly facts: MemoryService


index

readonly index: MemoryIndex & MemoryIndexMaintenance


source

readonly source: MemoryRepository

Methods

create()

create(input): Promise<MemoryRecord>

Parameters

input

NewMemoryRecord

Returns

Promise<MemoryRecord>

Implementation of

MemoryService.create


delete()

delete(scope, id, options?): Promise<MemoryRecord>

Parameters

scope

MemoryRecordScope

id

string

options?

MemoryMutationOptions

Returns

Promise<MemoryRecord>

Implementation of

MemoryService.delete


deleteAttachment()

deleteAttachment(scope, id, attachmentId, options?): Promise<MemoryRecord>

Parameters

scope

MemoryRecordScope

id

string

attachmentId

string

options?

MemoryMutationOptions

Returns

Promise<MemoryRecord>

Implementation of

MemoryService.deleteAttachment


flush()

flush(): Promise<void>

Returns

Promise<void>

Implementation of

MemoryService.flush


get()

get(scope, id): Promise<MemoryRecord | undefined>

Parameters

scope

MemoryRecordScope

id

string

Returns

Promise<MemoryRecord | undefined>

Implementation of

MemoryService.get


invalidateAttachment()

invalidateAttachment(scope, id, attachmentId, options?): Promise<MemoryRecord>

Parameters

scope

MemoryRecordScope

id

string

attachmentId

string

options?

MemoryMutationOptions

Returns

Promise<MemoryRecord>

Implementation of

MemoryService.invalidateAttachment


list()

list(scope, options?): Promise<MemoryRecord[]>

Parameters

scope

MemoryRecordScope

options?

Omit<MemoryListOptions, "cursor">

Returns

Promise<MemoryRecord[]>

Implementation of

MemoryService.list


listPage()

listPage(scope, options?): Promise<MemoryPage>

Parameters

scope

MemoryRecordScope

options?

MemoryListOptions

Returns

Promise<MemoryPage>

Implementation of

MemoryService.listPage


onDidChange()

onDidChange(listener): object

Parameters

listener

() => void

Returns

object

dispose()

dispose(): void

Returns

void

Implementation of

MemoryService.onDidChange


pin()

pin(scope, id, options?): Promise<MemoryRecord>

Parameters

scope

MemoryRecordScope

id

string

options?

MemoryMutationOptions

Returns

Promise<MemoryRecord>

Implementation of

MemoryService.pin


start()

start(): Promise<void>

Returns

Promise<void>

Implementation of

MemoryService.start


unpin()

unpin(scope, id, options?): Promise<MemoryRecord>

Parameters

scope

MemoryRecordScope

id

string

options?

MemoryMutationOptions

Returns

Promise<MemoryRecord>

Implementation of

MemoryService.unpin


update()

update(scope, id, patch, options?): Promise<MemoryRecord>

Parameters

scope

MemoryRecordScope

id

string

patch

Partial<Pick<MemoryRecord, "content" | "tags" | "pinned" | "provenance" | "attachments">>

options?

MemoryMutationOptions

Returns

Promise<MemoryRecord>

Implementation of

MemoryService.update


validateWrite()

validateWrite(input, operation?): Promise<void>

Parameters

input

NewMemoryRecord

operation?

"create" | "update"

Returns

Promise<void>

Implementation of

MemoryService.validateWrite