Class: BRevision

BRevision()

Revision represents a snapshot of note's title and content at some point in the past. It's used for seamless note versioning.

Constructor

new BRevision()

Source:

Extends

Members

(protected) becca

Overrides:
Source:

blobId :string

Type:
  • string
Source:

contentLength :int

Type:
Source:

dateCreated :string

Type:
  • string
Source:

dateLastEdited :string

Type:
  • string
Source:

isProtected :boolean

Type:
  • boolean
Source:

mime :string

Type:
  • string
Source:

noteId :string

Type:
  • string
Source:

revisionId :string

Type:
  • string
Source:

title :string

Type:
  • string
Source:

type :string

Type:
  • string
Source:

utcDateCreated :string

Type:
  • string
Source:

utcDateLastEdited :string

Type:
  • string
Source:

utcDateModified :string

Type:
  • string
Source:

Methods

(protected) _getContent() → {string|Buffer}

Overrides:
Source:
Returns:
Type
string | Buffer

(protected) _setContent()

Overrides:
Source:

(protected) beforeSaving()

Overrides:
Source:

(protected) generateHash() → {string}

Overrides:
Source:
Returns:
Type
string

getAttachmentById() → {BAttachment|null}

Source:
Returns:
Type
BAttachment | null

getAttachmentByTitle() → {BAttachment}

Source:
Returns:
Type
BAttachment

getAttachments() → {Array.<BAttachment>}

Source:
Returns:
Type
Array.<BAttachment>

getAttachmentsByRole() → {Array.<BAttachment>}

Source:
Returns:
Type
Array.<BAttachment>

getContent() → {string|Buffer}

Source:
Returns:
Type
string | Buffer

getJsonContent() → {*}

Source:
Throws:
Error in case of invalid JSON
Returns:
Type
*

getJsonContentSafely() → {*|null}

Source:
Returns:
valid object or null if the content cannot be parsed as JSON
Type
* | null

(abstract, protected) getPojo()

Overrides:
Source:

(protected) getPojoToSave()

Overrides:
Source:

(protected) getUtcDateChanged()

Overrides:
Source:

hasStringContent() → {boolean}

Source:
Returns:
true if the note has string content (not binary)
Type
boolean

markAsDeleted(deleteIdopt)

Mark the entity as (soft) deleted. It will be completely erased later. This is a low-level method, for notes and branches use `note.deleteNote()` and 'branch.deleteBranch()` instead.
Parameters:
Name Type Attributes Default Description
deleteId <optional>
null
Overrides:
Source:

(protected) putEntityChange()

Overrides:
Source:

save() → {this}

Saves entity - executes SQL, but doesn't commit the transaction on its own
Overrides:
Source:
Returns:
Type
this

setContent(content, optsopt)

Parameters:
Name Type Attributes Description
content
opts object <optional>
Properties
Name Type Attributes Default Description
forceSave object <optional>
false will also save this BRevision entity
Source: