docs/Script API/classes/Backend_Script_API.BRevision.html
Revision represents a snapshot of note's title and content at some point in the past. It's used for seamless note versioning.
blobId?content?contentLength?dateCreated?dateLastEdited?dateModified?isProtected?isSynced?mimenoteIdrevisionId?titletypeutcDateCreatedutcDateLastEdited?utcDateModified?
beccaisDeletedentityNamehashedPropertiesprimaryKeyName
_getContent_setContentbeforeSavingeraseRevisiongenerateHashgetAttachmentByIdgetAttachmentByTitlegetAttachmentsgetAttachmentsByRolegetContentgetJsonContentgetJsonContentSafelygetNotegetPojogetPojoToSavegetUtcDateChangedhasStringContentinitisContentAvailablemarkAsDeletedmarkAsDeletedSimpleputEntityChangesavesetContentupdateFromRow
new BRevision(row: RevisionRow, titleDecrypted?: boolean): BRevision
OptionalblobIdblobId?: string
Optionalcontentcontent?: string | Buffer<ArrayBufferLike>
OptionalcontentLengthcontentLength?: number
OptionaldateCreateddateCreated?: string
OptionaldateLastEditeddateLastEdited?: string
OptionaldateModifieddateModified?: string
OptionalisProtectedisProtected?: boolean
OptionalisSyncedisSynced?: boolean
mime: string
noteId: string
OptionalrevisionIdrevisionId?: string
title: string
type:
| "canvas"
| "code"
| "search"
| "image"
| "text"
| "file"
| "noteMap"
| "launcher"
| "doc"
| "contentWidget"
| "relationMap"
| "render"
| "mermaid"
| "book"
| "webView"
| "mindMap"
| "geoMap"
utcDateCreated: string
OptionalutcDateLastEditedutcDateLastEdited?: string
OptionalutcDateModifiedutcDateModified?: string
Protectedbeccaget becca(): default
get isDeleted(): boolean
StaticentityNameget entityName(): string
StatichashedPropertiesget hashedProperties(): string[]
StaticprimaryKeyNameget primaryKeyName(): string
Protected_getContent_getContent(): string | Buffer<ArrayBufferLike>
Protected_setContent_setContent(content: string | Buffer<ArrayBufferLike>, opts?: ContentOpts): void
beforeSaving(): void
eraseRevision(): void
Revisions are not soft-deletable, they are immediately hard-deleted (erased).
generateHash(isDeleted?: boolean): string
OptionalisDeleted: booleangetAttachmentById(attachmentId: String, opts?: GetByIdOpts): null | BAttachment
getAttachmentByTitle(title: string): BAttachment
getAttachments(): BAttachment[]
getAttachmentsByRole(role: string): BAttachment[]
getContent(): string | Buffer<ArrayBufferLike>
getJsonContent(): null | {}
Error in case of invalid JSON
getJsonContentSafely(): null | {}
valid object or null if the content cannot be parsed as JSON
getNote(): BNote
getPojo(): {
blobId: undefined
| string;
content: undefined | string | Buffer<ArrayBufferLike>;
contentLength: undefined | number;
dateCreated: undefined | string;
dateLastEdited: undefined | string;
isProtected: undefined | boolean;
mime: string;
noteId: string;
revisionId: undefined | string;
title: undefined | string;
type:
| "canvas"
| "code"
| "search"
| "image"
| "text"
| "file"
| "noteMap"
| "launcher"
| "doc"
| "contentWidget"
| "relationMap"
| "render"
| "mermaid"
| "book"
| "webView"
| "mindMap"
| "geoMap";
utcDateCreated: string;
utcDateLastEdited: undefined
| string;
utcDateModified: undefined | string;
}
getPojoToSave(): {
blobId: undefined
| string;
content: undefined | string | Buffer<ArrayBufferLike>;
contentLength: undefined | number;
dateCreated: undefined | string;
dateLastEdited: undefined | string;
isProtected: undefined | boolean;
mime: string;
noteId: string;
revisionId: undefined | string;
title: undefined | string;
type:
| "canvas"
| "code"
| "search"
| "image"
| "text"
| "file"
| "noteMap"
| "launcher"
| "doc"
| "contentWidget"
| "relationMap"
| "render"
| "mermaid"
| "book"
| "webView"
| "mindMap"
| "geoMap";
utcDateCreated: string;
utcDateLastEdited: undefined
| string;
utcDateModified: undefined | string;
}
getUtcDateChanged(): string
hasStringContent(): boolean
true if the note has string content (not binary)
init(): void
isContentAvailable(): boolean
markAsDeleted(deleteId?: null | string): void
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.
markAsDeletedSimple(): void
ProtectedputEntityChangeputEntityChange(isDeleted: boolean): void
save(opts?: {}): this
Saves entity - executes SQL, but doesn't commit the transaction on its own
Optionalopts: {}setContent(content: string | Buffer<ArrayBufferLike>, opts?: ContentOpts): void
updateFromRow(row: RevisionRow): void
Member Visibility
ThemeOSLightDark
Constructors constructor Properties blobIdcontentcontentLengthdateCreateddateLastEditeddateModifiedisProtectedisSyncedmimenoteIdrevisionIdtitletypeutcDateCreatedutcDateLastEditedutcDateModified Accessors beccaisDeletedentityNamehashedPropertiesprimaryKeyName Methods _getContent_setContentbeforeSavingeraseRevisiongenerateHashgetAttachmentByIdgetAttachmentByTitlegetAttachmentsgetAttachmentsByRolegetContentgetJsonContentgetJsonContentSafelygetNotegetPojogetPojoToSavegetUtcDateChangedhasStringContentinitisContentAvailablemarkAsDeletedmarkAsDeletedSimpleputEntityChangesavesetContentupdateFromRow