# Class default

Becca is a backend cache of all notes, branches, and attributes. There's a similar frontend cache Froca, and share cache Shaca.

- Defined in src/becca/becca-interface.ts:24

##### Index

### Constructors

constructor

### Properties

allNoteSetCache
attributeIndex
attributes
branches
childParentToBranch
etapiTokens
loaded
notes
options

### Methods

addNote
decryptProtectedNotes
dirtyNoteSetCache
findAttributes
findAttributesWithPrefix
getAllNoteSet
getAttachment
getAttachmentOrThrow
getAttachments
getAttribute
getAttributeOrThrow
getBlob
getBranch
getBranchFromChildAndParent
getBranchOrThrow
getEntity
getEtapiToken
getEtapiTokens
getNote
getNoteOrThrow
getNotes
getOption
getRecentNotesFromQuery
getRevision
getRevisionOrThrow
getRevisionsFromQuery
getRoot
reset

## Constructors

### constructor

- new default(): default

  #### Returns default

  - Defined in src/becca/becca-interface.ts:38

## Properties

### allNoteSetCache

allNoteSetCache: null | NoteSet

- Defined in src/becca/becca-interface.ts:36

### attributeIndex

attributeIndex: Record <string, BAttribute []>

Points from attribute type-name to list of attributes

- Defined in src/becca/becca-interface.ts:32

### attributes

attributes: Record <string, BAttribute >

- Defined in src/becca/becca-interface.ts:30

### branches

branches: Record <string, BBranch >

- Defined in src/becca/becca-interface.ts:28

### childParentToBranch

childParentToBranch: Record <string, BBranch >

- Defined in src/becca/becca-interface.ts:29

### etapiTokens

etapiTokens: Record <string, BEtapiToken >

- Defined in src/becca/becca-interface.ts:34

### loaded

loaded: boolean

- Defined in src/becca/becca-interface.ts:25

### notes

notes: Record <string, BNote >

- Defined in src/becca/becca-interface.ts:27

### options

options: Record <string, BOption >

- Defined in src/becca/becca-interface.ts:33

## Methods

### addNote

- addNote(noteId: string, note: BNote ): void

  #### Parameters

  - noteId: string
  - note: BNote

  #### Returns void

  - Defined in src/becca/becca-interface.ts:90

### decryptProtectedNotes

- decryptProtectedNotes(): void

  #### Returns void

  - Defined in src/becca/becca-interface.ts:84

### dirtyNoteSetCache

- dirtyNoteSetCache(): void

  Should be called when the set of all non-skeleton notes changes (added/removed)

  #### Returns void

  - Defined in src/becca/becca-interface.ts:247

### findAttributes

- findAttributes(type: string, name: string): BAttribute []

  #### Parameters

  - type: string
  - name: string

  #### Returns BAttribute []

  - Defined in src/becca/becca-interface.ts:61

### findAttributesWithPrefix

- findAttributesWithPrefix(type: string, name: string): BAttribute []

  #### Parameters

  - type: string
  - name: string

  #### Returns BAttribute []

  - Defined in src/becca/becca-interface.ts:71

### getAllNoteSet

- getAllNoteSet(): NoteSet

  #### Returns NoteSet

  - Defined in src/becca/becca-interface.ts:251

### getAttachment

- getAttachment(attachmentId: string, opts?: AttachmentOpts): null | BAttachment

  #### Parameters

  - attachmentId: string
  - opts: AttachmentOpts = {}

  #### Returns null | BAttachment

  - Defined in src/becca/becca-interface.ts:170

### getAttachmentOrThrow

- getAttachmentOrThrow(attachmentId: string, opts?: AttachmentOpts): BAttachment

  #### Parameters

  - attachmentId: string
  - opts: AttachmentOpts = {}

  #### Returns BAttachment

  - Defined in src/becca/becca-interface.ts:183

### getAttachments

- getAttachments(attachmentIds: string[]): BAttachment []

  #### Parameters

  - attachmentIds: string[]

  #### Returns BAttachment []

  - Defined in src/becca/becca-interface.ts:191

### getAttribute

- getAttribute(attributeId: string): null | BAttribute

  #### Parameters

  - attributeId: string

  #### Returns null | BAttribute

  - Defined in src/becca/becca-interface.ts:140

### getAttributeOrThrow

- getAttributeOrThrow(attributeId: string): BAttribute

  #### Parameters

  - attributeId: string

  #### Returns BAttribute

  - Defined in src/becca/becca-interface.ts:144

### getBlob

- getBlob(entity: { blobId?: string }): null | BBlob

  #### Parameters

  - entity: { blobId?: string }

  #### Returns null | BBlob

  - Defined in src/becca/becca-interface.ts:195

### getBranch

- getBranch(branchId: string): null | BBranch

  #### Parameters

  - branchId: string

  #### Returns null | BBranch

  - Defined in src/becca/becca-interface.ts:128

### getBranchFromChildAndParent

- getBranchFromChildAndParent(
  childNoteId: string,
  parentNoteId: string,
  ): null | BBranch

  #### Parameters

  - childNoteId: string
  - parentNoteId: string

  #### Returns null | BBranch

  - Defined in src/becca/becca-interface.ts:153

### getBranchOrThrow

- getBranchOrThrow(branchId: string): BBranch

  #### Parameters

  - branchId: string

  #### Returns BBranch

  - Defined in src/becca/becca-interface.ts:132

### getEntity

- getEntity< T extends AbstractBeccaEntity < T >>(
  entityName: string,
  entityId: string,
  ): null | AbstractBeccaEntity < T >

  #### Type Parameters

  - T extends AbstractBeccaEntity < T >

  #### Parameters

  - entityName: string
  - entityId: string

  #### Returns null | AbstractBeccaEntity < T >

  - Defined in src/becca/becca-interface.ts:216

### getEtapiToken

- getEtapiToken(etapiTokenId: string): null | BEtapiToken

  #### Parameters

  - etapiTokenId: string

  #### Returns null | BEtapiToken

  - Defined in src/becca/becca-interface.ts:212

### getEtapiTokens

- getEtapiTokens(): BEtapiToken []

  #### Returns BEtapiToken []

  - Defined in src/becca/becca-interface.ts:208

### getNote

- getNote(noteId: string): null | BNote

  #### Parameters

  - noteId: string

  #### Returns null | BNote

  - Defined in src/becca/becca-interface.ts:95

### getNoteOrThrow

- getNoteOrThrow(noteId: string): BNote

  #### Parameters

  - noteId: string

  #### Returns BNote

  - Defined in src/becca/becca-interface.ts:99

### getNotes

- getNotes(noteIds: string[], ignoreMissing?: boolean): BNote []

  #### Parameters

  - noteIds: string[]
  - ignoreMissing: boolean = false

  #### Returns BNote []

  - Defined in src/becca/becca-interface.ts:108

### getOption

- getOption(name: string): null | BOption

  #### Parameters

  - name: string

  #### Returns null | BOption

  - Defined in src/becca/becca-interface.ts:204

### getRecentNotesFromQuery

- getRecentNotesFromQuery(query: string, params?: string[]): BRecentNote []

  #### Parameters

  - query: string
  - params: string[] = []

  #### Returns BRecentNote []

  - Defined in src/becca/becca-interface.ts:236

### getRevision

- getRevision(revisionId: string): null | BRevision

  #### Parameters

  - revisionId: string

  #### Returns null | BRevision

  - Defined in src/becca/becca-interface.ts:157

### getRevisionOrThrow

- getRevisionOrThrow(revisionId: string): BRevision

  #### Parameters

  - revisionId: string

  #### Returns BRevision

  - Defined in src/becca/becca-interface.ts:162

### getRevisionsFromQuery

- getRevisionsFromQuery(query: string, params?: string[]): BRevision []

  #### Parameters

  - query: string
  - params: string[] = []

  #### Returns BRevision []

  - Defined in src/becca/becca-interface.ts:241

### getRoot

- getRoot(): null | BNote

  #### Returns null | BNote

  - Defined in src/becca/becca-interface.ts:57

### reset

- reset(): void

  #### Returns void

  - Defined in src/becca/becca-interface.ts:43