docs/Script API/classes/Backend_Script_API.BAttachment.html
Attachment represent data related/attached to the note. Conceptually similar to attributes, but intended for larger amounts of data and generally not accessible to the user.
attachmentId?blobId?contentLength?dateCreated?dateModified?isDecrypted?isProtected?isSynced?mimenoteId?ownerIdposition?roletitletype?utcDateCreatedutcDateModified?utcDateScheduledForErasureSince?
beccaisDeletedentityNamehashedPropertiesprimaryKeyName
_getContent_setContentbeforeSavingconvertToNotecopydecryptgenerateHashgetContentgetFileNamegetNotegetPojogetPojoToSavegetTitleOrProtectedgetUtcDateChangedhasStringContentinitisContentAvailablemarkAsDeletedmarkAsDeletedSimpleputEntityChangesavesetContentupdateFromRow
new BAttachment(row: AttachmentRow): BAttachment
OptionalattachmentIdattachmentId?: string
OptionalblobIdblobId?: string
OptionalcontentLengthcontentLength?: number
optionally added to the entity
OptionaldateCreateddateCreated?: string
OptionaldateModifieddateModified?: string
OptionalisDecryptedisDecrypted?: boolean
OptionalisProtectedisProtected?: boolean
OptionalisSyncedisSynced?: boolean
mime: string
OptionalnoteIdnoteId?: number
ownerId: string
either noteId or revisionId to which this attachment belongs
Optionalpositionposition?: number
role: string
title: string
Optionaltypetype?: "image" | "file"
utcDateCreated: string
OptionalutcDateModifiedutcDateModified?: string
OptionalutcDateScheduledForErasureSinceutcDateScheduledForErasureSince?: null | 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
convertToNote(): { branch: BBranch; note: BNote }
copy(): BAttachment
decrypt(): void
generateHash(isDeleted?: boolean): string
OptionalisDeleted: booleangetContent(): Buffer
getFileName(): string
getNote(): BNote
getPojo(): {
attachmentId: undefined
| string;
blobId: undefined | string;
contentLength: undefined | number;
dateModified: undefined | string;
isDeleted: boolean;
isProtected: boolean;
mime: string;
ownerId: string;
position: undefined | number;
role: string;
title: undefined | string;
utcDateModified: undefined | string;
utcDateScheduledForErasureSince: undefined | null | string;
}
getPojoToSave(): {
attachmentId: undefined
| string;
blobId: undefined | string;
contentLength: undefined | number;
dateModified: undefined | string;
isDeleted: boolean;
isProtected: boolean;
mime: string;
ownerId: string;
position: undefined | number;
role: string;
title: undefined | string;
utcDateModified: undefined | string;
utcDateScheduledForErasureSince: undefined | null | string;
}
getTitleOrProtected(): 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
Optionalopts: ContentOptsupdateFromRow(row: AttachmentRow): void
Member Visibility
ThemeOSLightDark
Constructors constructor Properties attachmentIdblobIdcontentLengthdateCreateddateModifiedisDecryptedisProtectedisSyncedmimenoteIdownerIdpositionroletitletypeutcDateCreatedutcDateModifiedutcDateScheduledForErasureSince Accessors beccaisDeletedentityNamehashedPropertiesprimaryKeyName Methods _getContent_setContentbeforeSavingconvertToNotecopydecryptgenerateHashgetContentgetFileNamegetNotegetPojogetPojoToSavegetTitleOrProtectedgetUtcDateChangedhasStringContentinitisContentAvailablemarkAsDeletedmarkAsDeletedSimpleputEntityChangesavesetContentupdateFromRow