Skip to content

Build your personal knowledge base with Trilium Notes

add missing API docs

zadam97d8b1986879
diff --git a/docs/backend_api/BAttachment.html b/docs/backend_api/BAttachment.html
new file mode 100644
index 0000000000..985ee21e9a
--- /dev/null
+++ b/docs/backend_api/BAttachment.html
@@ -0,0 +1,2876 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+ <title>JSDoc: Class: BAttachment</title>
+
+ <script src="scripts/prettify/prettify.js"> </script>
+ <script src="scripts/prettify/lang-css.js"> </script>
+ <!--[if lt IE 9]>
+ <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
+ <![endif]-->
+ <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
+ <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
+</head>
+
+<body>
+
+<div id="main">
+
+ <h1 class="page-title">Class: BAttachment</h1>
+
+
+
+
+
+
+<section>
+
+<header>
+
+ <h2><span class="attribs"><span class="type-signature"></span></span>BAttachment<span class="signature">()</span><span class="type-signature"></span></h2>
+
+ <div class="class-description">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.</div>
+
+
+</header>
+
+<article>
+ <div class="container-overview">
+
+
+
+
+ <h2>Constructor</h2>
+
+
+
+ <h4 class="name" id="BAttachment"><span class="type-signature"></span>new BAttachment<span class="signature">()</span><span class="type-signature"></span></h4>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <dt class="tag-source">Source:</dt>
+ <dd class="tag-source"><ul class="dummy"><li>
+ <a href="becca_entities_battachment.js.html">becca/entities/battachment.js</a>, <a href="becca_entities_battachment.js.html#line20">line 20</a>
+ </li></ul></dd>
+
+
+
+
+
+
+
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ </div>
+
+
+ <h3 class="subsection-title">Extends</h3>
+
+
+
+
+ <ul>
+ <li><a href="AbstractBeccaEntity.html">AbstractBeccaEntity</a></li>
+ </ul>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <h3 class="subsection-title">Members</h3>
+
+
+
+<h4 class="name" id="attachmentId"><span class="type-signature"></span>attachmentId<span class="type-signature"> :string</span></h4>
+
+
+
+
+
+
+ <h5>Type:</h5>
+ <ul>
+ <li>
+
+<span class="param-type">string</span>
+
+
+ </li>
+ </ul>
+
+
+
+
+
+<dl class="details">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <dt class="tag-source">Source:</dt>
+ <dd class="tag-source"><ul class="dummy"><li>
+ <a href="becca_entities_battachment.js.html">becca/entities/battachment.js</a>, <a href="becca_entities_battachment.js.html#line40">line 40</a>
+ </li></ul></dd>
+
+
+
+
+
+
+
+</dl>
+
+
+
+
+
+
+
+
+<h4 class="name" id="becca"><span class="type-signature">(protected) </span>becca<span class="type-signature"></span></h4>
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+
+
+
+
+
+
+
+ <dt class="tag-overrides">Overrides:</dt>
+ <dd class="tag-overrides"><ul class="dummy"><li>
+ <a href="AbstractBeccaEntity.html#becca">AbstractBeccaEntity#becca</a>
+ </li></ul></dd>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <dt class="tag-source">Source:</dt>
+ <dd class="tag-source"><ul class="dummy"><li>
+ <a href="becca_entities_abstract_becca_entity.js.html">becca/entities/abstract_becca_entity.js</a>, <a href="becca_entities_abstract_becca_entity.js.html#line55">line 55</a>
+ </li></ul></dd>
+
+
+
+
+
+
+
+</dl>
+
+
+
+
+
+
+
+
+<h4 class="name" id="blobId"><span class="type-signature"></span>blobId<span class="type-signature"> :string</span></h4>
+
+
+
+
+
+
+ <h5>Type:</h5>
+ <ul>
+ <li>
+
+<span class="param-type">string</span>
+
+
+ </li>
+ </ul>
+
+
+
+
+
+<dl class="details">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <dt class="tag-source">Source:</dt>
+ <dd class="tag-source"><ul class="dummy"><li>
+ <a href="becca_entities_battachment.js.html">becca/entities/battachment.js</a>, <a href="becca_entities_battachment.js.html#line52">line 52</a>
+ </li></ul></dd>
+
+
+
+
+
+
+
+</dl>
+
+
+
+
+
+
+
+
+<h4 class="name" id="contentLength"><span class="type-signature"></span>contentLength<span class="type-signature"> :int</span></h4>
+
+
+
+
+<div class="description">
+ optionally added to the entity
+</div>
+
+
+
+ <h5>Type:</h5>
+ <ul>
+ <li>
+
+<span class="param-type">int</span>
+
+
+ </li>
+ </ul>
+
+
+
+
+
+<dl class="details">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <dt class="tag-source">Source:</dt>
+ <dd class="tag-source"><ul class="dummy"><li>
+ <a href="becca_entities_battachment.js.html">becca/entities/battachment.js</a>, <a href="becca_entities_battachment.js.html#line63">line 63</a>
+ </li></ul></dd>
+
+
+
+
+
+
+
+</dl>
+
+
+
+
+
+
+
+
+<h4 class="name" id="dateModified"><span class="type-signature"></span>dateModified<span class="type-signature"> :string</span></h4>
+
+
+
+
+
+
+ <h5>Type:</h5>
+ <ul>
+ <li>
+
+<span class="param-type">string</span>
+
+
+ </li>
+ </ul>
+
+
+
+
+
+<dl class="details">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <dt class="tag-source">Source:</dt>
+ <dd class="tag-source"><ul class="dummy"><li>
+ <a href="becca_entities_battachment.js.html">becca/entities/battachment.js</a>, <a href="becca_entities_battachment.js.html#line56">line 56</a>
+ </li></ul></dd>
+
+
+
+
+
+
+
+</dl>
+
+
+
+
+
+
+
+
+<h4 class="name" id="isProtected"><span class="type-signature"></span>isProtected<span class="type-signature"> :boolean</span></h4>
+
+
+
+
+
+
+ <h5>Type:</h5>
+ <ul>
+ <li>
+
+<span class="param-type">boolean</span>
+
+
+ </li>
+ </ul>
+
+
+
+
+
+<dl class="details">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <dt class="tag-source">Source:</dt>
+ <dd class="tag-source"><ul class="dummy"><li>
+ <a href="becca_entities_battachment.js.html">becca/entities/battachment.js</a>, <a href="becca_entities_battachment.js.html#line54">line 54</a>
+ </li></ul></dd>
+
+
+
+
+
+
+
+</dl>
+
+
+
+
+
+
+
+
+<h4 class="name" id="mime"><span class="type-signature"></span>mime<span class="type-signature"> :string</span></h4>
+
+
+
+
+
+
+ <h5>Type:</h5>
+ <ul>
+ <li>
+
+<span class="param-type">string</span>
+
+
+ </li>
+ </ul>
+
+
+
+
+
+<dl class="details">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <dt class="tag-source">Source:</dt>
+ <dd class="tag-source"><ul class="dummy"><li>
+ <a href="becca_entities_battachment.js.html">becca/entities/battachment.js</a>, <a href="becca_entities_battachment.js.html#line46">line 46</a>
+ </li></ul></dd>
+
+
+
+
+
+
+
+</dl>
+
+
+
+
+
+
+
+
+<h4 class="name" id="ownerId"><span class="type-signature"></span>ownerId<span class="type-signature"> :string</span></h4>
+
+
+
+
+<div class="description">
+ either noteId or revisionId to which this attachment belongs
+</div>
+
+
+
+ <h5>Type:</h5>
+ <ul>
+ <li>
+
+<span class="param-type">string</span>
+
+
+ </li>
+ </ul>
+
+
+
+
+
+<dl class="details">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <dt class="tag-source">Source:</dt>
+ <dd class="tag-source"><ul class="dummy"><li>
+ <a href="becca_entities_battachment.js.html">becca/entities/battachment.js</a>, <a href="becca_entities_battachment.js.html#line42">line 42</a>
+ </li></ul></dd>
+
+
+
+
+
+
+
+</dl>
+
+
+
+
+
+
+
+
+<h4 class="name" id="position"><span class="type-signature"></span>position<span class="type-signature"> :int</span></h4>
+
+
+
+
+
+
+ <h5>Type:</h5>
+ <ul>
+ <li>
+
+<span class="param-type">int</span>
+
+
+ </li>
+ </ul>
+
+
+
+
+
+<dl class="details">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <dt class="tag-source">Source:</dt>
+ <dd class="tag-source"><ul class="dummy"><li>
+ <a href="becca_entities_battachment.js.html">becca/entities/battachment.js</a>, <a href="becca_entities_battachment.js.html#line50">line 50</a>
+ </li></ul></dd>
+
+
+
+
+
+
+
+</dl>
+
+
+
+
+
+
+
+
+<h4 class="name" id="role"><span class="type-signature"></span>role<span class="type-signature"> :string</span></h4>
+
+
+
+
+
+
+ <h5>Type:</h5>
+ <ul>
+ <li>
+
+<span class="param-type">string</span>
+
+
+ </li>
+ </ul>
+
+
+
+
+
+<dl class="details">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <dt class="tag-source">Source:</dt>
+ <dd class="tag-source"><ul class="dummy"><li>
+ <a href="becca_entities_battachment.js.html">becca/entities/battachment.js</a>, <a href="becca_entities_battachment.js.html#line44">line 44</a>
+ </li></ul></dd>
+
+
+
+
+
+
+
+</dl>
+
+
+
+
+
+
+
+
+<h4 class="name" id="title"><span class="type-signature"></span>title<span class="type-signature"> :string</span></h4>
+
+
+
+
+
+
+ <h5>Type:</h5>
+ <ul>
+ <li>
+
+<span class="param-type">string</span>
+
+
+ </li>
+ </ul>
+
+
+
+
+
+<dl class="details">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <dt class="tag-source">Source:</dt>
+ <dd class="tag-source"><ul class="dummy"><li>
+ <a href="becca_entities_battachment.js.html">becca/entities/battachment.js</a>, <a href="becca_entities_battachment.js.html#line48">line 48</a>
+ </li></ul></dd>
+
+
+
+
+
+
+
+</dl>
+
+
+
+
+
+
+
+
+<h4 class="name" id="utcDateModified"><span class="type-signature"></span>utcDateModified<span class="type-signature"> :string</span></h4>
+
+
+
+
+
+
+ <h5>Type:</h5>
+ <ul>
+ <li>
+
+<span class="param-type">string</span>
+
+
+ </li>
+ </ul>
+
+
+
+
+
+<dl class="details">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <dt class="tag-source">Source:</dt>
+ <dd class="tag-source"><ul class="dummy"><li>
+ <a href="becca_entities_battachment.js.html">becca/entities/battachment.js</a>, <a href="becca_entities_battachment.js.html#line58">line 58</a>
+ </li></ul></dd>
+
+
+
+
+
+
+
+</dl>
+
+
+
+
+
+
+
+
+<h4 class="name" id="utcDateScheduledForErasureSince"><span class="type-signature"></span>utcDateScheduledForErasureSince<span class="type-signature"> :string</span></h4>
+
+
+
+
+
+
+ <h5>Type:</h5>
+ <ul>
+ <li>
+
+<span class="param-type">string</span>
+
+
+ </li>
+ </ul>
+
+
+
+
+
+<dl class="details">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <dt class="tag-source">Source:</dt>
+ <dd class="tag-source"><ul class="dummy"><li>
+ <a href="becca_entities_battachment.js.html">becca/entities/battachment.js</a>, <a href="becca_entities_battachment.js.html#line60">line 60</a>
+ </li></ul></dd>
+
+
+
+
+
+
+
+</dl>
+
+
+
+
+
+
+
+
+
+
+ <h3 class="subsection-title">Methods</h3>
+
+
+
+
+
+
+
+ <h4 class="name" id="_getContent"><span class="type-signature">(protected) </span>_getContent<span class="signature">()</span><span class="type-signature"> &rarr; {string|Buffer}</span></h4>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+
+
+
+
+
+
+
+ <dt class="tag-overrides">Overrides:</dt>
+ <dd class="tag-overrides"><ul class="dummy"><li>
+ <a href="AbstractBeccaEntity.html#_getContent">AbstractBeccaEntity#_getContent</a>
+ </li></ul></dd>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <dt class="tag-source">Source:</dt>
+ <dd class="tag-source"><ul class="dummy"><li>
+ <a href="becca_entities_abstract_becca_entity.js.html">becca/entities/abstract_becca_entity.js</a>, <a href="becca_entities_abstract_becca_entity.js.html#line246">line 246</a>
+ </li></ul></dd>
+
+
+
+
+
+
+
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+
+
+
+<dl>
+ <dt>
+ Type
+ </dt>
+ <dd>
+
+<span class="param-type">string</span>
+|
+
+<span class="param-type">Buffer</span>
+
+
+ </dd>
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <h4 class="name" id="_setContent"><span class="type-signature">(protected) </span>_setContent<span class="signature">()</span><span class="type-signature"></span></h4>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+
+
+
+
+
+
+
+ <dt class="tag-overrides">Overrides:</dt>
+ <dd class="tag-overrides"><ul class="dummy"><li>
+ <a href="AbstractBeccaEntity.html#_setContent">AbstractBeccaEntity#_setContent</a>
+ </li></ul></dd>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <dt class="tag-source">Source:</dt>
+ <dd class="tag-source"><ul class="dummy"><li>
+ <a href="becca_entities_abstract_becca_entity.js.html">becca/entities/abstract_becca_entity.js</a>, <a href="becca_entities_abstract_becca_entity.js.html#line124">line 124</a>
+ </li></ul></dd>
+
+
+
+
+
+
+
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <h4 class="name" id="beforeSaving"><span class="type-signature">(protected) </span>beforeSaving<span class="signature">()</span><span class="type-signature"></span></h4>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+
+
+
+
+
+
+
+ <dt class="tag-overrides">Overrides:</dt>
+ <dd class="tag-overrides"><ul class="dummy"><li>
+ <a href="AbstractBeccaEntity.html#beforeSaving">AbstractBeccaEntity#beforeSaving</a>
+ </li></ul></dd>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <dt class="tag-source">Source:</dt>
+ <dd class="tag-source"><ul class="dummy"><li>
+ <a href="becca_entities_abstract_becca_entity.js.html">becca/entities/abstract_becca_entity.js</a>, <a href="becca_entities_abstract_becca_entity.js.html#line20">line 20</a>
+ </li></ul></dd>
+
+
+
+
+
+
+
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <h4 class="name" id="convertToNote"><span class="type-signature"></span>convertToNote<span class="signature">()</span><span class="type-signature"> &rarr; {Object}</span></h4>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <dt class="tag-source">Source:</dt>
+ <dd class="tag-source"><ul class="dummy"><li>
+ <a href="becca_entities_battachment.js.html">becca/entities/battachment.js</a>, <a href="becca_entities_battachment.js.html#line128">line 128</a>
+ </li></ul></dd>
+
+
+
+
+
+
+
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+
+
+
+<dl>
+ <dt>
+ Type
+ </dt>
+ <dd>
+
+<span class="param-type">Object</span>
+
+
+ </dd>
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <h4 class="name" id="copy"><span class="type-signature"></span>copy<span class="signature">()</span><span class="type-signature"> &rarr; {<a href="BAttachment.html">BAttachment</a>}</span></h4>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <dt class="tag-source">Source:</dt>
+ <dd class="tag-source"><ul class="dummy"><li>
+ <a href="becca_entities_battachment.js.html">becca/entities/battachment.js</a>, <a href="becca_entities_battachment.js.html#line69">line 69</a>
+ </li></ul></dd>
+
+
+
+
+
+
+
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+
+
+
+<dl>
+ <dt>
+ Type
+ </dt>
+ <dd>
+
+<span class="param-type"><a href="BAttachment.html">BAttachment</a></span>
+
+
+ </dd>
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <h4 class="name" id="generateHash"><span class="type-signature">(protected) </span>generateHash<span class="signature">()</span><span class="type-signature"></span></h4>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+
+
+
+
+
+
+
+ <dt class="tag-overrides">Overrides:</dt>
+ <dd class="tag-overrides"><ul class="dummy"><li>
+ <a href="AbstractBeccaEntity.html#generateHash">AbstractBeccaEntity#generateHash</a>
+ </li></ul></dd>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <dt class="tag-source">Source:</dt>
+ <dd class="tag-source"><ul class="dummy"><li>
+ <a href="becca_entities_abstract_becca_entity.js.html">becca/entities/abstract_becca_entity.js</a>, <a href="becca_entities_abstract_becca_entity.js.html#line32">line 32</a>
+ </li></ul></dd>
+
+
+
+
+
+
+
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <h4 class="name" id="generateIdIfNecessary"><span class="type-signature">(protected) </span>generateIdIfNecessary<span class="signature">()</span><span class="type-signature"></span></h4>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+
+
+
+
+
+
+
+ <dt class="tag-overrides">Overrides:</dt>
+ <dd class="tag-overrides"><ul class="dummy"><li>
+ <a href="AbstractBeccaEntity.html#generateIdIfNecessary">AbstractBeccaEntity#generateIdIfNecessary</a>
+ </li></ul></dd>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <dt class="tag-source">Source:</dt>
+ <dd class="tag-source"><ul class="dummy"><li>
+ <a href="becca_entities_abstract_becca_entity.js.html">becca/entities/abstract_becca_entity.js</a>, <a href="becca_entities_abstract_becca_entity.js.html#line25">line 25</a>
+ </li></ul></dd>
+
+
+
+
+
+
+
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <h4 class="name" id="getContent"><span class="type-signature"></span>getContent<span class="signature">()</span><span class="type-signature"> &rarr; {string|Buffer}</span></h4>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <dt class="tag-source">Source:</dt>
+ <dd class="tag-source"><ul class="dummy"><li>
+ <a href="becca_entities_battachment.js.html">becca/entities/battachment.js</a>, <a href="becca_entities_battachment.js.html#line113">line 113</a>
+ </li></ul></dd>
+
+
+
+
+
+
+
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+
+
+
+<dl>
+ <dt>
+ Type
+ </dt>
+ <dd>
+
+<span class="param-type">string</span>
+|
+
+<span class="param-type">Buffer</span>
+
+
+ </dd>
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <h4 class="name" id="getNote"><span class="type-signature"></span>getNote<span class="signature">()</span><span class="type-signature"> &rarr; {<a href="BNote.html">BNote</a>}</span></h4>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <dt class="tag-source">Source:</dt>
+ <dd class="tag-source"><ul class="dummy"><li>
+ <a href="becca_entities_battachment.js.html">becca/entities/battachment.js</a>, <a href="becca_entities_battachment.js.html#line81">line 81</a>
+ </li></ul></dd>
+
+
+
+
+
+
+
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+
+
+
+<dl>
+ <dt>
+ Type
+ </dt>
+ <dd>
+
+<span class="param-type"><a href="BNote.html">BNote</a></span>
+
+
+ </dd>
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <h4 class="name" id="getPojoToSave"><span class="type-signature">(protected) </span>getPojoToSave<span class="signature">()</span><span class="type-signature"></span></h4>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+
+
+
+
+
+
+
+ <dt class="tag-overrides">Overrides:</dt>
+ <dd class="tag-overrides"><ul class="dummy"><li>
+ <a href="AbstractBeccaEntity.html#getPojoToSave">AbstractBeccaEntity#getPojoToSave</a>
+ </li></ul></dd>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <dt class="tag-source">Source:</dt>
+ <dd class="tag-source"><ul class="dummy"><li>
+ <a href="becca_entities_abstract_becca_entity.js.html">becca/entities/abstract_becca_entity.js</a>, <a href="becca_entities_abstract_becca_entity.js.html#line76">line 76</a>
+ </li></ul></dd>
+
+
+
+
+
+
+
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <h4 class="name" id="getUtcDateChanged"><span class="type-signature">(protected) </span>getUtcDateChanged<span class="signature">()</span><span class="type-signature"></span></h4>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+
+
+
+
+
+
+
+ <dt class="tag-overrides">Overrides:</dt>
+ <dd class="tag-overrides"><ul class="dummy"><li>
+ <a href="AbstractBeccaEntity.html#getUtcDateChanged">AbstractBeccaEntity#getUtcDateChanged</a>
+ </li></ul></dd>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <dt class="tag-source">Source:</dt>
+ <dd class="tag-source"><ul class="dummy"><li>
+ <a href="becca_entities_abstract_becca_entity.js.html">becca/entities/abstract_becca_entity.js</a>, <a href="becca_entities_abstract_becca_entity.js.html#line47">line 47</a>
+ </li></ul></dd>
+
+
+
+
+
+
+
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <h4 class="name" id="hasStringContent"><span class="type-signature"></span>hasStringContent<span class="signature">()</span><span class="type-signature"> &rarr; {boolean}</span></h4>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <dt class="tag-source">Source:</dt>
+ <dd class="tag-source"><ul class="dummy"><li>
+ <a href="becca_entities_battachment.js.html">becca/entities/battachment.js</a>, <a href="becca_entities_battachment.js.html#line86">line 86</a>
+ </li></ul></dd>
+
+
+
+
+
+
+
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+
+<div class="param-desc">
+ true if the note has string content (not binary)
+</div>
+
+
+
+<dl>
+ <dt>
+ Type
+ </dt>
+ <dd>
+
+<span class="param-type">boolean</span>
+
+
+ </dd>
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <h4 class="name" id="markAsDeleted"><span class="type-signature"></span>markAsDeleted<span class="signature">(deleteId<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
+
+
+
+
+
+
+<div class="description">
+ 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.
+</div>
+
+
+
+
+
+
+
+
+
+ <h5>Parameters:</h5>
+
+
+<table class="params">
+ <thead>
+ <tr>
+
+ <th>Name</th>
+
+
+ <th>Type</th>
+
+
+ <th>Attributes</th>
+
+
+
+ <th>Default</th>
+
+
+ <th class="last">Description</th>
+ </tr>
+ </thead>
+
+ <tbody>
+
+
+ <tr>
+
+ <td class="name"><code>deleteId</code></td>
+
+
+ <td class="type">
+
+ </td>
+
+
+ <td class="attributes">
+
+ &lt;optional><br>
+
+
+
+
+
+ </td>
+
+
+
+ <td class="default">
+
+ null
+
+ </td>
+
+
+ <td class="description last"></td>
+ </tr>
+
+
+ </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+
+
+
+
+
+
+
+ <dt class="tag-overrides">Overrides:</dt>
+ <dd class="tag-overrides"><ul class="dummy"><li>
+ <a href="AbstractBeccaEntity.html#markAsDeleted">AbstractBeccaEntity#markAsDeleted</a>
+ </li></ul></dd>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <dt class="tag-source">Source:</dt>
+ <dd class="tag-source"><ul class="dummy"><li>
+ <a href="becca_entities_abstract_becca_entity.js.html">becca/entities/abstract_becca_entity.js</a>, <a href="becca_entities_abstract_becca_entity.js.html#line263">line 263</a>
+ </li></ul></dd>
+
+
+
+
+
+
+
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <h4 class="name" id="putEntityChange"><span class="type-signature">(protected) </span>putEntityChange<span class="signature">()</span><span class="type-signature"></span></h4>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+
+
+
+
+
+
+
+ <dt class="tag-overrides">Overrides:</dt>
+ <dd class="tag-overrides"><ul class="dummy"><li>
+ <a href="AbstractBeccaEntity.html#putEntityChange">AbstractBeccaEntity#putEntityChange</a>
+ </li></ul></dd>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <dt class="tag-source">Source:</dt>
+ <dd class="tag-source"><ul class="dummy"><li>
+ <a href="becca_entities_abstract_becca_entity.js.html">becca/entities/abstract_becca_entity.js</a>, <a href="becca_entities_abstract_becca_entity.js.html#line64">line 64</a>
+ </li></ul></dd>
+
+
+
+
+
+
+
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <h4 class="name" id="save"><span class="type-signature"></span>save<span class="signature">()</span><span class="type-signature"> &rarr; {this}</span></h4>
+
+
+
+
+
+
+<div class="description">
+ Saves entity - executes SQL, but doesn't commit the transaction on its own
+</div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+
+
+
+
+
+
+
+ <dt class="tag-overrides">Overrides:</dt>
+ <dd class="tag-overrides"><ul class="dummy"><li>
+ <a href="AbstractBeccaEntity.html#save">AbstractBeccaEntity#save</a>
+ </li></ul></dd>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <dt class="tag-source">Source:</dt>
+ <dd class="tag-source"><ul class="dummy"><li>
+ <a href="becca_entities_abstract_becca_entity.js.html">becca/entities/abstract_becca_entity.js</a>, <a href="becca_entities_abstract_becca_entity.js.html#line85">line 85</a>
+ </li></ul></dd>
+
+
+
+
+
+
+
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+
+
+
+<dl>
+ <dt>
+ Type
+ </dt>
+ <dd>
+
+<span class="param-type">this</span>
+
+
+ </dd>
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <h4 class="name" id="setContent"><span class="type-signature"></span>setContent<span class="signature">(content, opts<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <h5>Parameters:</h5>
+
+
+<table class="params">
+ <thead>
+ <tr>
+
+ <th>Name</th>
+
+
+ <th>Type</th>
+
+
+ <th>Attributes</th>
+
+
+
+
+ <th class="last">Description</th>
+ </tr>
+ </thead>
+
+ <tbody>
+
+
+ <tr>
+
+ <td class="name"><code>content</code></td>
+
+
+ <td class="type">
+
+ </td>
+
+
+ <td class="attributes">
+
+
+
+
+
+ </td>
+
+
+
+
+ <td class="description last"></td>
+ </tr>
+
+
+
+ <tr>
+
+ <td class="name"><code>opts</code></td>
+
+
+ <td class="type">
+
+
+<span class="param-type">object</span>
+
+
+
+ </td>
+
+
+ <td class="attributes">
+
+ &lt;optional><br>
+
+
+
+
+
+ </td>
+
+
+
+
+ <td class="description last">
+ <h6>Properties</h6>
+
+
+<table class="params">
+ <thead>
+ <tr>
+
+ <th>Name</th>
+
+
+ <th>Type</th>
+
+
+ <th>Attributes</th>
+
+
+
+ <th>Default</th>
+
+
+ <th class="last">Description</th>
+ </tr>
+ </thead>
+
+ <tbody>
+
+
+ <tr>
+
+ <td class="name"><code>forceSave</code></td>
+
+
+ <td class="type">
+
+
+<span class="param-type">object</span>
+
+
+
+ </td>
+
+
+ <td class="attributes">
+
+ &lt;optional><br>
+
+
+
+
+
+ </td>
+
+
+
+ <td class="default">
+
+ false
+
+ </td>
+
+
+ <td class="description last">will also save this BAttachment entity</td>
+ </tr>
+
+
+
+ <tr>
+
+ <td class="name"><code>forceFrontendReload</code></td>
+
+
+ <td class="type">
+
+
+<span class="param-type">object</span>
+
+
+
+ </td>
+
+
+ <td class="attributes">
+
+ &lt;optional><br>
+
+
+
+
+
+ </td>
+
+
+
+ <td class="default">
+
+ false
+
+ </td>
+
+
+ <td class="description last">override frontend heuristics on when to reload, instruct to reload</td>
+ </tr>
+
+
+ </tbody>
+</table>
+
+ </td>
+ </tr>
+
+
+ </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <dt class="tag-source">Source:</dt>
+ <dd class="tag-source"><ul class="dummy"><li>
+ <a href="becca_entities_battachment.js.html">becca/entities/battachment.js</a>, <a href="becca_entities_battachment.js.html#line123">line 123</a>
+ </li></ul></dd>
+
+
+
+
+
+
+
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+</article>
+
+</section>
+
+
+
+
+</div>
+
+<nav>
+ <h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-sql.html">sql</a></li></ul><h3>Classes</h3><ul><li><a href="AbstractBeccaEntity.html">AbstractBeccaEntity</a></li><li><a href="BAttachment.html">BAttachment</a></li><li><a href="BAttribute.html">BAttribute</a></li><li><a href="BBranch.html">BBranch</a></li><li><a href="BEtapiToken.html">BEtapiToken</a></li><li><a href="BNote.html">BNote</a></li><li><a href="BOption.html">BOption</a></li><li><a href="BRecentNote.html">BRecentNote</a></li><li><a href="BRevision.html">BRevision</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li></ul>
+</nav>
+
+<br class="clear">
+
+<footer>
+ Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.2</a>
+</footer>
+
+<script> prettyPrint(); </script>
+<script src="scripts/linenumber.js"> </script>
+</body>
+</html>
\ No newline at end of file
diff --git a/docs/backend_api/BRevision.html b/docs/backend_api/BRevision.html
new file mode 100644
index 0000000000..e97dc907cd
--- /dev/null
+++ b/docs/backend_api/BRevision.html
@@ -0,0 +1,2693 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+ <title>JSDoc: Class: BRevision</title>
+
+ <script src="scripts/prettify/prettify.js"> </script>
+ <script src="scripts/prettify/lang-css.js"> </script>
+ <!--[if lt IE 9]>
+ <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
+ <![endif]-->
+ <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
+ <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
+</head>
+
+<body>
+
+<div id="main">
+
+ <h1 class="page-title">Class: BRevision</h1>
+
+
+
+
+
+
+<section>
+
+<header>
+
+ <h2><span class="attribs"><span class="type-signature"></span></span>BRevision<span class="signature">()</span><span class="type-signature"></span></h2>
+
+ <div class="class-description">Revision represents a snapshot of note's title and content at some point in the past.
+It's used for seamless note versioning.</div>
+
+
+</header>
+
+<article>
+ <div class="container-overview">
+
+
+
+
+ <h2>Constructor</h2>
+
+
+
+ <h4 class="name" id="BRevision"><span class="type-signature"></span>new BRevision<span class="signature">()</span><span class="type-signature"></span></h4>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <dt class="tag-source">Source:</dt>
+ <dd class="tag-source"><ul class="dummy"><li>
+ <a href="becca_entities_brevision.js.html">becca/entities/brevision.js</a>, <a href="becca_entities_brevision.js.html#line17">line 17</a>
+ </li></ul></dd>
+
+
+
+
+
+
+
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ </div>
+
+
+ <h3 class="subsection-title">Extends</h3>
+
+
+
+
+ <ul>
+ <li><a href="AbstractBeccaEntity.html">AbstractBeccaEntity</a></li>
+ </ul>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <h3 class="subsection-title">Members</h3>
+
+
+
+<h4 class="name" id="becca"><span class="type-signature">(protected) </span>becca<span class="type-signature"></span></h4>
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+
+
+
+
+
+
+
+ <dt class="tag-overrides">Overrides:</dt>
+ <dd class="tag-overrides"><ul class="dummy"><li>
+ <a href="AbstractBeccaEntity.html#becca">AbstractBeccaEntity#becca</a>
+ </li></ul></dd>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <dt class="tag-source">Source:</dt>
+ <dd class="tag-source"><ul class="dummy"><li>
+ <a href="becca_entities_abstract_becca_entity.js.html">becca/entities/abstract_becca_entity.js</a>, <a href="becca_entities_abstract_becca_entity.js.html#line55">line 55</a>
+ </li></ul></dd>
+
+
+
+
+
+
+
+</dl>
+
+
+
+
+
+
+
+
+<h4 class="name" id="blobId"><span class="type-signature"></span>blobId<span class="type-signature"> :string</span></h4>
+
+
+
+
+
+
+ <h5>Type:</h5>
+ <ul>
+ <li>
+
+<span class="param-type">string</span>
+
+
+ </li>
+ </ul>
+
+
+
+
+
+<dl class="details">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <dt class="tag-source">Source:</dt>
+ <dd class="tag-source"><ul class="dummy"><li>
+ <a href="becca_entities_brevision.js.html">becca/entities/brevision.js</a>, <a href="becca_entities_brevision.js.html#line39">line 39</a>
+ </li></ul></dd>
+
+
+
+
+
+
+
+</dl>
+
+
+
+
+
+
+
+
+<h4 class="name" id="contentLength"><span class="type-signature"></span>contentLength<span class="type-signature"> :int</span></h4>
+
+
+
+
+
+
+ <h5>Type:</h5>
+ <ul>
+ <li>
+
+<span class="param-type">int</span>
+
+
+ </li>
+ </ul>
+
+
+
+
+
+<dl class="details">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <dt class="tag-source">Source:</dt>
+ <dd class="tag-source"><ul class="dummy"><li>
+ <a href="becca_entities_brevision.js.html">becca/entities/brevision.js</a>, <a href="becca_entities_brevision.js.html#line51">line 51</a>
+ </li></ul></dd>
+
+
+
+
+
+
+
+</dl>
+
+
+
+
+
+
+
+
+<h4 class="name" id="dateCreated"><span class="type-signature"></span>dateCreated<span class="type-signature"> :string</span></h4>
+
+
+
+
+
+
+ <h5>Type:</h5>
+ <ul>
+ <li>
+
+<span class="param-type">string</span>
+
+
+ </li>
+ </ul>
+
+
+
+
+
+<dl class="details">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <dt class="tag-source">Source:</dt>
+ <dd class="tag-source"><ul class="dummy"><li>
+ <a href="becca_entities_brevision.js.html">becca/entities/brevision.js</a>, <a href="becca_entities_brevision.js.html#line43">line 43</a>
+ </li></ul></dd>
+
+
+
+
+
+
+
+</dl>
+
+
+
+
+
+
+
+
+<h4 class="name" id="dateLastEdited"><span class="type-signature"></span>dateLastEdited<span class="type-signature"> :string</span></h4>
+
+
+
+
+
+
+ <h5>Type:</h5>
+ <ul>
+ <li>
+
+<span class="param-type">string</span>
+
+
+ </li>
+ </ul>
+
+
+
+
+
+<dl class="details">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <dt class="tag-source">Source:</dt>
+ <dd class="tag-source"><ul class="dummy"><li>
+ <a href="becca_entities_brevision.js.html">becca/entities/brevision.js</a>, <a href="becca_entities_brevision.js.html#line41">line 41</a>
+ </li></ul></dd>
+
+
+
+
+
+
+
+</dl>
+
+
+
+
+
+
+
+
+<h4 class="name" id="isProtected"><span class="type-signature"></span>isProtected<span class="type-signature"> :boolean</span></h4>
+
+
+
+
+
+
+ <h5>Type:</h5>
+ <ul>
+ <li>
+
+<span class="param-type">boolean</span>
+
+
+ </li>
+ </ul>
+
+
+
+
+
+<dl class="details">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <dt class="tag-source">Source:</dt>
+ <dd class="tag-source"><ul class="dummy"><li>
+ <a href="becca_entities_brevision.js.html">becca/entities/brevision.js</a>, <a href="becca_entities_brevision.js.html#line35">line 35</a>
+ </li></ul></dd>
+
+
+
+
+
+
+
+</dl>
+
+
+
+
+
+
+
+
+<h4 class="name" id="mime"><span class="type-signature"></span>mime<span class="type-signature"> :string</span></h4>
+
+
+
+
+
+
+ <h5>Type:</h5>
+ <ul>
+ <li>
+
+<span class="param-type">string</span>
+
+
+ </li>
+ </ul>
+
+
+
+
+
+<dl class="details">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <dt class="tag-source">Source:</dt>
+ <dd class="tag-source"><ul class="dummy"><li>
+ <a href="becca_entities_brevision.js.html">becca/entities/brevision.js</a>, <a href="becca_entities_brevision.js.html#line33">line 33</a>
+ </li></ul></dd>
+
+
+
+
+
+
+
+</dl>
+
+
+
+
+
+
+
+
+<h4 class="name" id="noteId"><span class="type-signature"></span>noteId<span class="type-signature"> :string</span></h4>
+
+
+
+
+
+
+ <h5>Type:</h5>
+ <ul>
+ <li>
+
+<span class="param-type">string</span>
+
+
+ </li>
+ </ul>
+
+
+
+
+
+<dl class="details">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <dt class="tag-source">Source:</dt>
+ <dd class="tag-source"><ul class="dummy"><li>
+ <a href="becca_entities_brevision.js.html">becca/entities/brevision.js</a>, <a href="becca_entities_brevision.js.html#line29">line 29</a>
+ </li></ul></dd>
+
+
+
+
+
+
+
+</dl>
+
+
+
+
+
+
+
+
+<h4 class="name" id="revisionId"><span class="type-signature"></span>revisionId<span class="type-signature"> :string</span></h4>
+
+
+
+
+
+
+ <h5>Type:</h5>
+ <ul>
+ <li>
+
+<span class="param-type">string</span>
+
+
+ </li>
+ </ul>
+
+
+
+
+
+<dl class="details">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <dt class="tag-source">Source:</dt>
+ <dd class="tag-source"><ul class="dummy"><li>
+ <a href="becca_entities_brevision.js.html">becca/entities/brevision.js</a>, <a href="becca_entities_brevision.js.html#line27">line 27</a>
+ </li></ul></dd>
+
+
+
+
+
+
+
+</dl>
+
+
+
+
+
+
+
+
+<h4 class="name" id="title"><span class="type-signature"></span>title<span class="type-signature"> :string</span></h4>
+
+
+
+
+
+
+ <h5>Type:</h5>
+ <ul>
+ <li>
+
+<span class="param-type">string</span>
+
+
+ </li>
+ </ul>
+
+
+
+
+
+<dl class="details">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <dt class="tag-source">Source:</dt>
+ <dd class="tag-source"><ul class="dummy"><li>
+ <a href="becca_entities_brevision.js.html">becca/entities/brevision.js</a>, <a href="becca_entities_brevision.js.html#line37">line 37</a>
+ </li></ul></dd>
+
+
+
+
+
+
+
+</dl>
+
+
+
+
+
+
+
+
+<h4 class="name" id="type"><span class="type-signature"></span>type<span class="type-signature"> :string</span></h4>
+
+
+
+
+
+
+ <h5>Type:</h5>
+ <ul>
+ <li>
+
+<span class="param-type">string</span>
+
+
+ </li>
+ </ul>
+
+
+
+
+
+<dl class="details">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <dt class="tag-source">Source:</dt>
+ <dd class="tag-source"><ul class="dummy"><li>
+ <a href="becca_entities_brevision.js.html">becca/entities/brevision.js</a>, <a href="becca_entities_brevision.js.html#line31">line 31</a>
+ </li></ul></dd>
+
+
+
+
+
+
+
+</dl>
+
+
+
+
+
+
+
+
+<h4 class="name" id="utcDateCreated"><span class="type-signature"></span>utcDateCreated<span class="type-signature"> :string</span></h4>
+
+
+
+
+
+
+ <h5>Type:</h5>
+ <ul>
+ <li>
+
+<span class="param-type">string</span>
+
+
+ </li>
+ </ul>
+
+
+
+
+
+<dl class="details">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <dt class="tag-source">Source:</dt>
+ <dd class="tag-source"><ul class="dummy"><li>
+ <a href="becca_entities_brevision.js.html">becca/entities/brevision.js</a>, <a href="becca_entities_brevision.js.html#line47">line 47</a>
+ </li></ul></dd>
+
+
+
+
+
+
+
+</dl>
+
+
+
+
+
+
+
+
+<h4 class="name" id="utcDateLastEdited"><span class="type-signature"></span>utcDateLastEdited<span class="type-signature"> :string</span></h4>
+
+
+
+
+
+
+ <h5>Type:</h5>
+ <ul>
+ <li>
+
+<span class="param-type">string</span>
+
+
+ </li>
+ </ul>
+
+
+
+
+
+<dl class="details">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <dt class="tag-source">Source:</dt>
+ <dd class="tag-source"><ul class="dummy"><li>
+ <a href="becca_entities_brevision.js.html">becca/entities/brevision.js</a>, <a href="becca_entities_brevision.js.html#line45">line 45</a>
+ </li></ul></dd>
+
+
+
+
+
+
+
+</dl>
+
+
+
+
+
+
+
+
+<h4 class="name" id="utcDateModified"><span class="type-signature"></span>utcDateModified<span class="type-signature"> :string</span></h4>
+
+
+
+
+
+
+ <h5>Type:</h5>
+ <ul>
+ <li>
+
+<span class="param-type">string</span>
+
+
+ </li>
+ </ul>
+
+
+
+
+
+<dl class="details">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <dt class="tag-source">Source:</dt>
+ <dd class="tag-source"><ul class="dummy"><li>
+ <a href="becca_entities_brevision.js.html">becca/entities/brevision.js</a>, <a href="becca_entities_brevision.js.html#line49">line 49</a>
+ </li></ul></dd>
+
+
+
+
+
+
+
+</dl>
+
+
+
+
+
+
+
+
+
+
+ <h3 class="subsection-title">Methods</h3>
+
+
+
+
+
+
+
+ <h4 class="name" id="_getContent"><span class="type-signature">(protected) </span>_getContent<span class="signature">()</span><span class="type-signature"> &rarr; {string|Buffer}</span></h4>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+
+
+
+
+
+
+
+ <dt class="tag-overrides">Overrides:</dt>
+ <dd class="tag-overrides"><ul class="dummy"><li>
+ <a href="AbstractBeccaEntity.html#_getContent">AbstractBeccaEntity#_getContent</a>
+ </li></ul></dd>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <dt class="tag-source">Source:</dt>
+ <dd class="tag-source"><ul class="dummy"><li>
+ <a href="becca_entities_abstract_becca_entity.js.html">becca/entities/abstract_becca_entity.js</a>, <a href="becca_entities_abstract_becca_entity.js.html#line246">line 246</a>
+ </li></ul></dd>
+
+
+
+
+
+
+
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+
+
+
+<dl>
+ <dt>
+ Type
+ </dt>
+ <dd>
+
+<span class="param-type">string</span>
+|
+
+<span class="param-type">Buffer</span>
+
+
+ </dd>
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <h4 class="name" id="_setContent"><span class="type-signature">(protected) </span>_setContent<span class="signature">()</span><span class="type-signature"></span></h4>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+
+
+
+
+
+
+
+ <dt class="tag-overrides">Overrides:</dt>
+ <dd class="tag-overrides"><ul class="dummy"><li>
+ <a href="AbstractBeccaEntity.html#_setContent">AbstractBeccaEntity#_setContent</a>
+ </li></ul></dd>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <dt class="tag-source">Source:</dt>
+ <dd class="tag-source"><ul class="dummy"><li>
+ <a href="becca_entities_abstract_becca_entity.js.html">becca/entities/abstract_becca_entity.js</a>, <a href="becca_entities_abstract_becca_entity.js.html#line124">line 124</a>
+ </li></ul></dd>
+
+
+
+
+
+
+
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <h4 class="name" id="beforeSaving"><span class="type-signature">(protected) </span>beforeSaving<span class="signature">()</span><span class="type-signature"></span></h4>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+
+
+
+
+
+
+
+ <dt class="tag-overrides">Overrides:</dt>
+ <dd class="tag-overrides"><ul class="dummy"><li>
+ <a href="AbstractBeccaEntity.html#beforeSaving">AbstractBeccaEntity#beforeSaving</a>
+ </li></ul></dd>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <dt class="tag-source">Source:</dt>
+ <dd class="tag-source"><ul class="dummy"><li>
+ <a href="becca_entities_abstract_becca_entity.js.html">becca/entities/abstract_becca_entity.js</a>, <a href="becca_entities_abstract_becca_entity.js.html#line20">line 20</a>
+ </li></ul></dd>
+
+
+
+
+
+
+
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <h4 class="name" id="generateHash"><span class="type-signature">(protected) </span>generateHash<span class="signature">()</span><span class="type-signature"></span></h4>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+
+
+
+
+
+
+
+ <dt class="tag-overrides">Overrides:</dt>
+ <dd class="tag-overrides"><ul class="dummy"><li>
+ <a href="AbstractBeccaEntity.html#generateHash">AbstractBeccaEntity#generateHash</a>
+ </li></ul></dd>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <dt class="tag-source">Source:</dt>
+ <dd class="tag-source"><ul class="dummy"><li>
+ <a href="becca_entities_abstract_becca_entity.js.html">becca/entities/abstract_becca_entity.js</a>, <a href="becca_entities_abstract_becca_entity.js.html#line32">line 32</a>
+ </li></ul></dd>
+
+
+
+
+
+
+
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <h4 class="name" id="generateIdIfNecessary"><span class="type-signature">(protected) </span>generateIdIfNecessary<span class="signature">()</span><span class="type-signature"></span></h4>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+
+
+
+
+
+
+
+ <dt class="tag-overrides">Overrides:</dt>
+ <dd class="tag-overrides"><ul class="dummy"><li>
+ <a href="AbstractBeccaEntity.html#generateIdIfNecessary">AbstractBeccaEntity#generateIdIfNecessary</a>
+ </li></ul></dd>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <dt class="tag-source">Source:</dt>
+ <dd class="tag-source"><ul class="dummy"><li>
+ <a href="becca_entities_abstract_becca_entity.js.html">becca/entities/abstract_becca_entity.js</a>, <a href="becca_entities_abstract_becca_entity.js.html#line25">line 25</a>
+ </li></ul></dd>
+
+
+
+
+
+
+
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <h4 class="name" id="getAttachments"><span class="type-signature"></span>getAttachments<span class="signature">()</span><span class="type-signature"> &rarr; {Array.&lt;<a href="BAttachment.html">BAttachment</a>>}</span></h4>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <dt class="tag-source">Source:</dt>
+ <dd class="tag-source"><ul class="dummy"><li>
+ <a href="becca_entities_brevision.js.html">becca/entities/brevision.js</a>, <a href="becca_entities_brevision.js.html#line99">line 99</a>
+ </li></ul></dd>
+
+
+
+
+
+
+
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+
+
+
+<dl>
+ <dt>
+ Type
+ </dt>
+ <dd>
+
+<span class="param-type">Array.&lt;<a href="BAttachment.html">BAttachment</a>></span>
+
+
+ </dd>
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <h4 class="name" id="getContent"><span class="type-signature"></span>getContent<span class="signature">()</span><span class="type-signature"> &rarr; {string|Buffer}</span></h4>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <dt class="tag-source">Source:</dt>
+ <dd class="tag-source"><ul class="dummy"><li>
+ <a href="becca_entities_brevision.js.html">becca/entities/brevision.js</a>, <a href="becca_entities_brevision.js.html#line85">line 85</a>
+ </li></ul></dd>
+
+
+
+
+
+
+
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+
+
+
+<dl>
+ <dt>
+ Type
+ </dt>
+ <dd>
+
+<span class="param-type">string</span>
+|
+
+<span class="param-type">Buffer</span>
+
+
+ </dd>
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <h4 class="name" id="getPojoToSave"><span class="type-signature">(protected) </span>getPojoToSave<span class="signature">()</span><span class="type-signature"></span></h4>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+
+
+
+
+
+
+
+ <dt class="tag-overrides">Overrides:</dt>
+ <dd class="tag-overrides"><ul class="dummy"><li>
+ <a href="AbstractBeccaEntity.html#getPojoToSave">AbstractBeccaEntity#getPojoToSave</a>
+ </li></ul></dd>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <dt class="tag-source">Source:</dt>
+ <dd class="tag-source"><ul class="dummy"><li>
+ <a href="becca_entities_abstract_becca_entity.js.html">becca/entities/abstract_becca_entity.js</a>, <a href="becca_entities_abstract_becca_entity.js.html#line76">line 76</a>
+ </li></ul></dd>
+
+
+
+
+
+
+
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <h4 class="name" id="getUtcDateChanged"><span class="type-signature">(protected) </span>getUtcDateChanged<span class="signature">()</span><span class="type-signature"></span></h4>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+
+
+
+
+
+
+
+ <dt class="tag-overrides">Overrides:</dt>
+ <dd class="tag-overrides"><ul class="dummy"><li>
+ <a href="AbstractBeccaEntity.html#getUtcDateChanged">AbstractBeccaEntity#getUtcDateChanged</a>
+ </li></ul></dd>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <dt class="tag-source">Source:</dt>
+ <dd class="tag-source"><ul class="dummy"><li>
+ <a href="becca_entities_abstract_becca_entity.js.html">becca/entities/abstract_becca_entity.js</a>, <a href="becca_entities_abstract_becca_entity.js.html#line47">line 47</a>
+ </li></ul></dd>
+
+
+
+
+
+
+
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <h4 class="name" id="hasStringContent"><span class="type-signature"></span>hasStringContent<span class="signature">()</span><span class="type-signature"> &rarr; {boolean}</span></h4>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <dt class="tag-source">Source:</dt>
+ <dd class="tag-source"><ul class="dummy"><li>
+ <a href="becca_entities_brevision.js.html">becca/entities/brevision.js</a>, <a href="becca_entities_brevision.js.html#line65">line 65</a>
+ </li></ul></dd>
+
+
+
+
+
+
+
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+
+<div class="param-desc">
+ true if the note has string content (not binary)
+</div>
+
+
+
+<dl>
+ <dt>
+ Type
+ </dt>
+ <dd>
+
+<span class="param-type">boolean</span>
+
+
+ </dd>
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <h4 class="name" id="markAsDeleted"><span class="type-signature"></span>markAsDeleted<span class="signature">(deleteId<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
+
+
+
+
+
+
+<div class="description">
+ 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.
+</div>
+
+
+
+
+
+
+
+
+
+ <h5>Parameters:</h5>
+
+
+<table class="params">
+ <thead>
+ <tr>
+
+ <th>Name</th>
+
+
+ <th>Type</th>
+
+
+ <th>Attributes</th>
+
+
+
+ <th>Default</th>
+
+
+ <th class="last">Description</th>
+ </tr>
+ </thead>
+
+ <tbody>
+
+
+ <tr>
+
+ <td class="name"><code>deleteId</code></td>
+
+
+ <td class="type">
+
+ </td>
+
+
+ <td class="attributes">
+
+ &lt;optional><br>
+
+
+
+
+
+ </td>
+
+
+
+ <td class="default">
+
+ null
+
+ </td>
+
+
+ <td class="description last"></td>
+ </tr>
+
+
+ </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+
+
+
+
+
+
+
+ <dt class="tag-overrides">Overrides:</dt>
+ <dd class="tag-overrides"><ul class="dummy"><li>
+ <a href="AbstractBeccaEntity.html#markAsDeleted">AbstractBeccaEntity#markAsDeleted</a>
+ </li></ul></dd>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <dt class="tag-source">Source:</dt>
+ <dd class="tag-source"><ul class="dummy"><li>
+ <a href="becca_entities_abstract_becca_entity.js.html">becca/entities/abstract_becca_entity.js</a>, <a href="becca_entities_abstract_becca_entity.js.html#line263">line 263</a>
+ </li></ul></dd>
+
+
+
+
+
+
+
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <h4 class="name" id="putEntityChange"><span class="type-signature">(protected) </span>putEntityChange<span class="signature">()</span><span class="type-signature"></span></h4>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+
+
+
+
+
+
+
+ <dt class="tag-overrides">Overrides:</dt>
+ <dd class="tag-overrides"><ul class="dummy"><li>
+ <a href="AbstractBeccaEntity.html#putEntityChange">AbstractBeccaEntity#putEntityChange</a>
+ </li></ul></dd>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <dt class="tag-source">Source:</dt>
+ <dd class="tag-source"><ul class="dummy"><li>
+ <a href="becca_entities_abstract_becca_entity.js.html">becca/entities/abstract_becca_entity.js</a>, <a href="becca_entities_abstract_becca_entity.js.html#line64">line 64</a>
+ </li></ul></dd>
+
+
+
+
+
+
+
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <h4 class="name" id="save"><span class="type-signature"></span>save<span class="signature">()</span><span class="type-signature"> &rarr; {this}</span></h4>
+
+
+
+
+
+
+<div class="description">
+ Saves entity - executes SQL, but doesn't commit the transaction on its own
+</div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+
+
+
+
+
+
+
+ <dt class="tag-overrides">Overrides:</dt>
+ <dd class="tag-overrides"><ul class="dummy"><li>
+ <a href="AbstractBeccaEntity.html#save">AbstractBeccaEntity#save</a>
+ </li></ul></dd>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <dt class="tag-source">Source:</dt>
+ <dd class="tag-source"><ul class="dummy"><li>
+ <a href="becca_entities_abstract_becca_entity.js.html">becca/entities/abstract_becca_entity.js</a>, <a href="becca_entities_abstract_becca_entity.js.html#line85">line 85</a>
+ </li></ul></dd>
+
+
+
+
+
+
+
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+
+
+
+<dl>
+ <dt>
+ Type
+ </dt>
+ <dd>
+
+<span class="param-type">this</span>
+
+
+ </dd>
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <h4 class="name" id="setContent"><span class="type-signature"></span>setContent<span class="signature">(content, opts<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <h5>Parameters:</h5>
+
+
+<table class="params">
+ <thead>
+ <tr>
+
+ <th>Name</th>
+
+
+ <th>Type</th>
+
+
+ <th>Attributes</th>
+
+
+
+
+ <th class="last">Description</th>
+ </tr>
+ </thead>
+
+ <tbody>
+
+
+ <tr>
+
+ <td class="name"><code>content</code></td>
+
+
+ <td class="type">
+
+ </td>
+
+
+ <td class="attributes">
+
+
+
+
+
+ </td>
+
+
+
+
+ <td class="description last"></td>
+ </tr>
+
+
+
+ <tr>
+
+ <td class="name"><code>opts</code></td>
+
+
+ <td class="type">
+
+
+<span class="param-type">object</span>
+
+
+
+ </td>
+
+
+ <td class="attributes">
+
+ &lt;optional><br>
+
+
+
+
+
+ </td>
+
+
+
+
+ <td class="description last">
+ <h6>Properties</h6>
+
+
+<table class="params">
+ <thead>
+ <tr>
+
+ <th>Name</th>
+
+
+ <th>Type</th>
+
+
+ <th>Attributes</th>
+
+
+
+ <th>Default</th>
+
+
+ <th class="last">Description</th>
+ </tr>
+ </thead>
+
+ <tbody>
+
+
+ <tr>
+
+ <td class="name"><code>forceSave</code></td>
+
+
+ <td class="type">
+
+
+<span class="param-type">object</span>
+
+
+
+ </td>
+
+
+ <td class="attributes">
+
+ &lt;optional><br>
+
+
+
+
+
+ </td>
+
+
+
+ <td class="default">
+
+ false
+
+ </td>
+
+
+ <td class="description last">will also save this BRevision entity</td>
+ </tr>
+
+
+ </tbody>
+</table>
+
+ </td>
+ </tr>
+
+
+ </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <dt class="tag-source">Source:</dt>
+ <dd class="tag-source"><ul class="dummy"><li>
+ <a href="becca_entities_brevision.js.html">becca/entities/brevision.js</a>, <a href="becca_entities_brevision.js.html#line94">line 94</a>
+ </li></ul></dd>
+
+
+
+
+
+
+
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+</article>
+
+</section>
+
+
+
+
+</div>
+
+<nav>
+ <h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-sql.html">sql</a></li></ul><h3>Classes</h3><ul><li><a href="AbstractBeccaEntity.html">AbstractBeccaEntity</a></li><li><a href="BAttachment.html">BAttachment</a></li><li><a href="BAttribute.html">BAttribute</a></li><li><a href="BBranch.html">BBranch</a></li><li><a href="BEtapiToken.html">BEtapiToken</a></li><li><a href="BNote.html">BNote</a></li><li><a href="BOption.html">BOption</a></li><li><a href="BRecentNote.html">BRecentNote</a></li><li><a href="BRevision.html">BRevision</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li></ul>
+</nav>
+
+<br class="clear">
+
+<footer>
+ Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.2</a>
+</footer>
+
+<script> prettyPrint(); </script>
+<script src="scripts/linenumber.js"> </script>
+</body>
+</html>
\ No newline at end of file
diff --git a/docs/backend_api/becca_entities_battachment.js.html b/docs/backend_api/becca_entities_battachment.js.html
new file mode 100644
index 0000000000..6b55ef9051
--- /dev/null
+++ b/docs/backend_api/becca_entities_battachment.js.html
@@ -0,0 +1,284 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+ <title>JSDoc: Source: becca/entities/battachment.js</title>
+
+ <script src="scripts/prettify/prettify.js"> </script>
+ <script src="scripts/prettify/lang-css.js"> </script>
+ <!--[if lt IE 9]>
+ <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
+ <![endif]-->
+ <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
+ <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
+</head>
+
+<body>
+
+<div id="main">
+
+ <h1 class="page-title">Source: becca/entities/battachment.js</h1>
+
+
+
+
+
+
+ <section>
+ <article>
+ <pre class="prettyprint source linenums"><code>"use strict";
+
+const utils = require('../../services/utils');
+const dateUtils = require('../../services/date_utils');
+const AbstractBeccaEntity = require("./abstract_becca_entity");
+const sql = require("../../services/sql");
+const protectedSessionService = require("../../services/protected_session");
+const log = require("../../services/log");
+
+const attachmentRoleToNoteTypeMapping = {
+ 'image': 'image'
+};
+
+/**
+ * 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.
+ *
+ * @extends AbstractBeccaEntity
+ */
+class BAttachment extends AbstractBeccaEntity {
+ static get entityName() { return "attachments"; }
+ static get primaryKeyName() { return "attachmentId"; }
+ static get hashedProperties() { return ["attachmentId", "ownerId", "role", "mime", "title", "blobId",
+ "utcDateScheduledForErasureSince", "utcDateModified"]; }
+
+ constructor(row) {
+ super();
+
+ if (!row.ownerId?.trim()) {
+ throw new Error("'ownerId' must be given to initialize a Attachment entity");
+ } else if (!row.role?.trim()) {
+ throw new Error("'role' must be given to initialize a Attachment entity");
+ } else if (!row.mime?.trim()) {
+ throw new Error("'mime' must be given to initialize a Attachment entity");
+ } else if (!row.title?.trim()) {
+ throw new Error("'title' must be given to initialize a Attachment entity");
+ }
+
+ /** @type {string} */
+ this.attachmentId = row.attachmentId;
+ /** @type {string} either noteId or revisionId to which this attachment belongs */
+ this.ownerId = row.ownerId;
+ /** @type {string} */
+ this.role = row.role;
+ /** @type {string} */
+ this.mime = row.mime;
+ /** @type {string} */
+ this.title = row.title;
+ /** @type {int} */
+ this.position = row.position;
+ /** @type {string} */
+ this.blobId = row.blobId;
+ /** @type {boolean} */
+ this.isProtected = !!row.isProtected;
+ /** @type {string} */
+ this.dateModified = row.dateModified;
+ /** @type {string} */
+ this.utcDateModified = row.utcDateModified;
+ /** @type {string} */
+ this.utcDateScheduledForErasureSince = row.utcDateScheduledForErasureSince;
+
+ /** @type {int} optionally added to the entity */
+ this.contentLength = row.contentLength;
+
+ this.decrypt();
+ }
+
+ /** @returns {BAttachment} */
+ copy() {
+ return new BAttachment({
+ ownerId: this.ownerId,
+ role: this.role,
+ mime: this.mime,
+ title: this.title,
+ blobId: this.blobId,
+ isProtected: this.isProtected
+ });
+ }
+
+ /** @returns {BNote} */
+ getNote() {
+ return this.becca.notes[this.ownerId];
+ }
+
+ /** @returns {boolean} true if the note has string content (not binary) */
+ hasStringContent() {
+ return utils.isStringNote(this.type, this.mime);
+ }
+
+ isContentAvailable() {
+ return !this.attachmentId // new attachment which was not encrypted yet
+ || !this.isProtected
+ || protectedSessionService.isProtectedSessionAvailable()
+ }
+
+ getTitleOrProtected() {
+ return this.isContentAvailable() ? this.title : '[protected]';
+ }
+
+ decrypt() {
+ if (this.isProtected &amp;&amp; !this.isDecrypted &amp;&amp; protectedSessionService.isProtectedSessionAvailable()) {
+ try {
+ this.title = protectedSessionService.decryptString(this.title);
+ this.isDecrypted = true;
+ }
+ catch (e) {
+ log.error(`Could not decrypt attachment ${this.attachmentId}: ${e.message} ${e.stack}`);
+ }
+ }
+ }
+
+ /** @returns {string|Buffer} */
+ getContent() {
+ return this._getContent();
+ }
+
+ /**
+ * @param content
+ * @param {object} [opts]
+ * @param {object} [opts.forceSave=false] - will also save this BAttachment entity
+ * @param {object} [opts.forceFrontendReload=false] - override frontend heuristics on when to reload, instruct to reload
+ */
+ setContent(content, opts) {
+ this._setContent(content, opts);
+ }
+
+ /** @returns {{note: BNote, branch: BBranch}} */
+ convertToNote() {
+ if (this.type === 'search') {
+ throw new Error(`Note of type search cannot have child notes`);
+ }
+
+ if (!this.getNote()) {
+ throw new Error("Cannot find note of this attachment. It is possible that this is note revision's attachment. " +
+ "Converting note revision's attachments to note is not (yet) supported.");
+ }
+
+ if (!(this.role in attachmentRoleToNoteTypeMapping)) {
+ throw new Error(`Mapping from attachment role '${this.role}' to note's type is not defined`);
+ }
+
+ if (!this.isContentAvailable()) { // isProtected is the same for attachment
+ throw new Error(`Cannot convert protected attachment outside of protected session`);
+ }
+
+ const noteService = require('../../services/notes');
+
+ const { note, branch } = noteService.createNewNote({
+ parentNoteId: this.ownerId,
+ title: this.title,
+ type: attachmentRoleToNoteTypeMapping[this.role],
+ mime: this.mime,
+ content: this.getContent(),
+ isProtected: this.isProtected
+ });
+
+ this.markAsDeleted();
+
+ const parentNote = this.getNote();
+
+ if (this.role === 'image' &amp;&amp; parentNote.type === 'text') {
+ const origContent = parentNote.getContent();
+ const oldAttachmentUrl = `api/attachments/${this.attachmentId}/image/`;
+ const newNoteUrl = `api/images/${note.noteId}/`;
+
+ const fixedContent = utils.replaceAll(origContent, oldAttachmentUrl, newNoteUrl);
+
+ if (fixedContent !== origContent) {
+ parentNote.setContent(fixedContent);
+ }
+
+ noteService.asyncPostProcessContent(note, fixedContent);
+ }
+
+ return { note, branch };
+ }
+
+ getFileName() {
+ const type = this.role === 'image' ? 'image' : 'file';
+
+ return utils.formatDownloadTitle(this.title, type, this.mime);
+ }
+
+ beforeSaving() {
+ super.beforeSaving();
+
+ if (this.position === undefined || this.position === null) {
+ this.position = 10 + sql.getValue(`SELECT COALESCE(MAX(position), 0)
+ FROM attachments
+ WHERE ownerId = ?`, [this.noteId]);
+ }
+
+ this.dateModified = dateUtils.localNowDateTime();
+ this.utcDateModified = dateUtils.utcNowDateTime();
+ }
+
+ getPojo() {
+ return {
+ attachmentId: this.attachmentId,
+ ownerId: this.ownerId,
+ role: this.role,
+ mime: this.mime,
+ title: this.title,
+ position: this.position,
+ blobId: this.blobId,
+ isProtected: !!this.isProtected,
+ isDeleted: false,
+ dateModified: this.dateModified,
+ utcDateModified: this.utcDateModified,
+ utcDateScheduledForErasureSince: this.utcDateScheduledForErasureSince,
+ contentLength: this.contentLength
+ };
+ }
+
+ getPojoToSave() {
+ const pojo = this.getPojo();
+ delete pojo.contentLength;
+
+ if (pojo.isProtected) {
+ if (this.isDecrypted) {
+ pojo.title = protectedSessionService.encrypt(pojo.title);
+ }
+ else {
+ // updating protected note outside of protected session means we will keep original ciphertexts
+ delete pojo.title;
+ }
+ }
+
+ return pojo;
+ }
+}
+
+module.exports = BAttachment;
+</code></pre>
+ </article>
+ </section>
+
+
+
+
+</div>
+
+<nav>
+ <h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-sql.html">sql</a></li></ul><h3>Classes</h3><ul><li><a href="AbstractBeccaEntity.html">AbstractBeccaEntity</a></li><li><a href="BAttachment.html">BAttachment</a></li><li><a href="BAttribute.html">BAttribute</a></li><li><a href="BBranch.html">BBranch</a></li><li><a href="BEtapiToken.html">BEtapiToken</a></li><li><a href="BNote.html">BNote</a></li><li><a href="BOption.html">BOption</a></li><li><a href="BRecentNote.html">BRecentNote</a></li><li><a href="BRevision.html">BRevision</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li></ul>
+</nav>
+
+<br class="clear">
+
+<footer>
+ Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.2</a>
+</footer>
+
+<script> prettyPrint(); </script>
+<script src="scripts/linenumber.js"> </script>
+</body>
+</html>
diff --git a/docs/backend_api/becca_entities_bblob.js.html b/docs/backend_api/becca_entities_bblob.js.html
new file mode 100644
index 0000000000..89a6fc4469
--- /dev/null
+++ b/docs/backend_api/becca_entities_bblob.js.html
@@ -0,0 +1,81 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+ <title>JSDoc: Source: becca/entities/bblob.js</title>
+
+ <script src="scripts/prettify/prettify.js"> </script>
+ <script src="scripts/prettify/lang-css.js"> </script>
+ <!--[if lt IE 9]>
+ <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
+ <![endif]-->
+ <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
+ <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
+</head>
+
+<body>
+
+<div id="main">
+
+ <h1 class="page-title">Source: becca/entities/bblob.js</h1>
+
+
+
+
+
+
+ <section>
+ <article>
+ <pre class="prettyprint source linenums"><code>class BBlob {
+ static get entityName() { return "blobs"; }
+ static get primaryKeyName() { return "blobId"; }
+ static get hashedProperties() { return ["blobId", "content"]; }
+
+ constructor(row) {
+ /** @type {string} */
+ this.blobId = row.blobId;
+ /** @type {string|Buffer} */
+ this.content = row.content;
+ /** @type {int} */
+ this.contentLength = row.contentLength;
+ /** @type {string} */
+ this.dateModified = row.dateModified;
+ /** @type {string} */
+ this.utcDateModified = row.utcDateModified;
+ }
+
+ getPojo() {
+ return {
+ blobId: this.blobId,
+ content: this.content,
+ contentLength: this.contentLength,
+ dateModified: this.dateModified,
+ utcDateModified: this.utcDateModified
+ };
+ }
+}
+
+module.exports = BBlob;
+</code></pre>
+ </article>
+ </section>
+
+
+
+
+</div>
+
+<nav>
+ <h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-sql.html">sql</a></li></ul><h3>Classes</h3><ul><li><a href="AbstractBeccaEntity.html">AbstractBeccaEntity</a></li><li><a href="BAttachment.html">BAttachment</a></li><li><a href="BAttribute.html">BAttribute</a></li><li><a href="BBranch.html">BBranch</a></li><li><a href="BEtapiToken.html">BEtapiToken</a></li><li><a href="BNote.html">BNote</a></li><li><a href="BOption.html">BOption</a></li><li><a href="BRecentNote.html">BRecentNote</a></li><li><a href="BRevision.html">BRevision</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li></ul>
+</nav>
+
+<br class="clear">
+
+<footer>
+ Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.2</a>
+</footer>
+
+<script> prettyPrint(); </script>
+<script src="scripts/linenumber.js"> </script>
+</body>
+</html>
diff --git a/docs/backend_api/becca_entities_brevision.js.html b/docs/backend_api/becca_entities_brevision.js.html
new file mode 100644
index 0000000000..331e8cd543
--- /dev/null
+++ b/docs/backend_api/becca_entities_brevision.js.html
@@ -0,0 +1,203 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+ <title>JSDoc: Source: becca/entities/brevision.js</title>
+
+ <script src="scripts/prettify/prettify.js"> </script>
+ <script src="scripts/prettify/lang-css.js"> </script>
+ <!--[if lt IE 9]>
+ <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
+ <![endif]-->
+ <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
+ <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
+</head>
+
+<body>
+
+<div id="main">
+
+ <h1 class="page-title">Source: becca/entities/brevision.js</h1>
+
+
+
+
+
+
+ <section>
+ <article>
+ <pre class="prettyprint source linenums"><code>"use strict";
+
+const protectedSessionService = require('../../services/protected_session');
+const utils = require('../../services/utils');
+const dateUtils = require('../../services/date_utils');
+const becca = require('../becca');
+const AbstractBeccaEntity = require("./abstract_becca_entity");
+const sql = require("../../services/sql");
+const BAttachment = require("./battachment");
+
+/**
+ * Revision represents a snapshot of note's title and content at some point in the past.
+ * It's used for seamless note versioning.
+ *
+ * @extends AbstractBeccaEntity
+ */
+class BRevision extends AbstractBeccaEntity {
+ static get entityName() { return "revisions"; }
+ static get primaryKeyName() { return "revisionId"; }
+ static get hashedProperties() { return ["revisionId", "noteId", "title", "isProtected", "dateLastEdited", "dateCreated",
+ "utcDateLastEdited", "utcDateCreated", "utcDateModified", "blobId"]; }
+
+ constructor(row, titleDecrypted = false) {
+ super();
+
+ /** @type {string} */
+ this.revisionId = row.revisionId;
+ /** @type {string} */
+ this.noteId = row.noteId;
+ /** @type {string} */
+ this.type = row.type;
+ /** @type {string} */
+ this.mime = row.mime;
+ /** @type {boolean} */
+ this.isProtected = !!row.isProtected;
+ /** @type {string} */
+ this.title = row.title;
+ /** @type {string} */
+ this.blobId = row.blobId;
+ /** @type {string} */
+ this.dateLastEdited = row.dateLastEdited;
+ /** @type {string} */
+ this.dateCreated = row.dateCreated;
+ /** @type {string} */
+ this.utcDateLastEdited = row.utcDateLastEdited;
+ /** @type {string} */
+ this.utcDateCreated = row.utcDateCreated;
+ /** @type {string} */
+ this.utcDateModified = row.utcDateModified;
+ /** @type {int} */
+ this.contentLength = row.contentLength;
+
+ if (this.isProtected &amp;&amp; !titleDecrypted) {
+ this.title = protectedSessionService.isProtectedSessionAvailable()
+ ? protectedSessionService.decryptString(this.title)
+ : "[protected]";
+ }
+ }
+
+ getNote() {
+ return becca.notes[this.noteId];
+ }
+
+ /** @returns {boolean} true if the note has string content (not binary) */
+ hasStringContent() {
+ return utils.isStringNote(this.type, this.mime);
+ }
+
+ isContentAvailable() {
+ return !this.revisionId // new note which was not encrypted yet
+ || !this.isProtected
+ || protectedSessionService.isProtectedSessionAvailable()
+ }
+
+ /*
+ * Note revision content has quite special handling - it's not a separate entity, but a lazily loaded
+ * part of Revision entity with its own sync. The reason behind this hybrid design is that
+ * content can be quite large, and it's not necessary to load it / fill memory for any note access even
+ * if we don't need a content, especially for bulk operations like search.
+ *
+ * This is the same approach as is used for Note's content.
+ */
+
+ /** @returns {string|Buffer} */
+ getContent() {
+ return this._getContent();
+ }
+
+ /**
+ * @param content
+ * @param {object} [opts]
+ * @param {object} [opts.forceSave=false] - will also save this BRevision entity
+ */
+ setContent(content, opts) {
+ this._setContent(content, opts);
+ }
+
+ /** @returns {BAttachment[]} */
+ getAttachments() {
+ return sql.getRows(`
+ SELECT attachments.*
+ FROM attachments
+ WHERE ownerId = ?
+ AND isDeleted = 0`, [this.revisionId])
+ .map(row => new BAttachment(row));
+ }
+
+ beforeSaving() {
+ super.beforeSaving();
+
+ this.utcDateModified = dateUtils.utcNowDateTime();
+ }
+
+ getPojo() {
+ return {
+ revisionId: this.revisionId,
+ noteId: this.noteId,
+ type: this.type,
+ mime: this.mime,
+ isProtected: this.isProtected,
+ title: this.title,
+ blobId: this.blobId,
+ dateLastEdited: this.dateLastEdited,
+ dateCreated: this.dateCreated,
+ utcDateLastEdited: this.utcDateLastEdited,
+ utcDateCreated: this.utcDateCreated,
+ utcDateModified: this.utcDateModified,
+ content: this.content, // used when retrieving full note revision to frontend
+ contentLength: this.contentLength
+ };
+ }
+
+ getPojoToSave() {
+ const pojo = this.getPojo();
+ delete pojo.content; // not getting persisted
+ delete pojo.contentLength; // not getting persisted
+
+ if (pojo.isProtected) {
+ if (protectedSessionService.isProtectedSessionAvailable()) {
+ pojo.title = protectedSessionService.encrypt(this.title);
+ }
+ else {
+ // updating protected note outside of protected session means we will keep original ciphertexts
+ delete pojo.title;
+ }
+ }
+
+ return pojo;
+ }
+}
+
+module.exports = BRevision;
+</code></pre>
+ </article>
+ </section>
+
+
+
+
+</div>
+
+<nav>
+ <h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-sql.html">sql</a></li></ul><h3>Classes</h3><ul><li><a href="AbstractBeccaEntity.html">AbstractBeccaEntity</a></li><li><a href="BAttachment.html">BAttachment</a></li><li><a href="BAttribute.html">BAttribute</a></li><li><a href="BBranch.html">BBranch</a></li><li><a href="BEtapiToken.html">BEtapiToken</a></li><li><a href="BNote.html">BNote</a></li><li><a href="BOption.html">BOption</a></li><li><a href="BRecentNote.html">BRecentNote</a></li><li><a href="BRevision.html">BRevision</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li></ul>
+</nav>
+
+<br class="clear">
+
+<footer>
+ Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.2</a>
+</footer>
+
+<script> prettyPrint(); </script>
+<script src="scripts/linenumber.js"> </script>
+</body>
+</html>
diff --git a/docs/frontend_api/entities_fattachment.js.html b/docs/frontend_api/entities_fattachment.js.html
new file mode 100644
index 0000000000..b2137c3539
--- /dev/null
+++ b/docs/frontend_api/entities_fattachment.js.html
@@ -0,0 +1,95 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+ <title>JSDoc: Source: entities/fattachment.js</title>
+
+ <script src="scripts/prettify/prettify.js"> </script>
+ <script src="scripts/prettify/lang-css.js"> </script>
+ <!--[if lt IE 9]>
+ <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
+ <![endif]-->
+ <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
+ <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
+</head>
+
+<body>
+
+<div id="main">
+
+ <h1 class="page-title">Source: entities/fattachment.js</h1>
+
+
+
+
+
+
+ <section>
+ <article>
+ <pre class="prettyprint source linenums"><code>class FAttachment {
+ constructor(froca, row) {
+ /** @type {Froca} */
+ this.froca = froca;
+
+ this.update(row);
+ }
+
+ update(row) {
+ /** @type {string} */
+ this.attachmentId = row.attachmentId;
+ /** @type {string} */
+ this.ownerId = row.ownerId;
+ /** @type {string} */
+ this.role = row.role;
+ /** @type {string} */
+ this.mime = row.mime;
+ /** @type {string} */
+ this.title = row.title;
+ /** @type {string} */
+ this.dateModified = row.dateModified;
+ /** @type {string} */
+ this.utcDateModified = row.utcDateModified;
+ /** @type {string} */
+ this.utcDateScheduledForErasureSince = row.utcDateScheduledForErasureSince;
+
+ /** @type {int} optionally added to the entity */
+ this.contentLength = row.contentLength;
+
+ this.froca.attachments[this.attachmentId] = this;
+ }
+
+ /** @returns {FNote} */
+ getNote() {
+ return this.froca.notes[this.ownerId];
+ }
+
+ /** @return {FBlob} */
+ async getBlob() {
+ return await this.froca.getBlob('attachments', this.attachmentId);
+ }
+}
+
+export default FAttachment;
+</code></pre>
+ </article>
+ </section>
+
+
+
+
+</div>
+
+<nav>
+ <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="FAttribute.html">FAttribute</a></li><li><a href="FBranch.html">FBranch</a></li><li><a href="FNote.html">FNote</a></li><li><a href="FrontendScriptApi.html">FrontendScriptApi</a></li></ul>
+</nav>
+
+<br class="clear">
+
+<footer>
+ Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.2</a>
+</footer>
+
+<script> prettyPrint(); </script>
+<script src="scripts/linenumber.js"> </script>
+</body>
+</html>
diff --git a/docs/frontend_api/entities_fblob.js.html b/docs/frontend_api/entities_fblob.js.html
new file mode 100644
index 0000000000..311c1fe777
--- /dev/null
+++ b/docs/frontend_api/entities_fblob.js.html
@@ -0,0 +1,69 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+ <title>JSDoc: Source: entities/fblob.js</title>
+
+ <script src="scripts/prettify/prettify.js"> </script>
+ <script src="scripts/prettify/lang-css.js"> </script>
+ <!--[if lt IE 9]>
+ <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
+ <![endif]-->
+ <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
+ <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
+</head>
+
+<body>
+
+<div id="main">
+
+ <h1 class="page-title">Source: entities/fblob.js</h1>
+
+
+
+
+
+
+ <section>
+ <article>
+ <pre class="prettyprint source linenums"><code>export default class FBlob {
+ constructor(row) {
+ /** @type {string} */
+ this.blobId = row.blobId;
+
+ /**
+ * can either contain the whole content (in e.g. string notes), only part (large text notes) or nothing at all (binary notes, images)
+ * @type {string}
+ */
+ this.content = row.content;
+ this.contentLength = row.contentLength;
+
+ /** @type {string} */
+ this.dateModified = row.dateModified;
+ /** @type {string} */
+ this.utcDateModified = row.utcDateModified;
+ }
+}
+</code></pre>
+ </article>
+ </section>
+
+
+
+
+</div>
+
+<nav>
+ <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="FAttribute.html">FAttribute</a></li><li><a href="FBranch.html">FBranch</a></li><li><a href="FNote.html">FNote</a></li><li><a href="FrontendScriptApi.html">FrontendScriptApi</a></li></ul>
+</nav>
+
+<br class="clear">
+
+<footer>
+ Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.2</a>
+</footer>
+
+<script> prettyPrint(); </script>
+<script src="scripts/linenumber.js"> </script>
+</body>
+</html>