docs updated

This commit is contained in:
zadam
2023-01-03 13:54:27 +01:00
parent bff7434921
commit b80bf0ffb6
36 changed files with 807 additions and 799 deletions

View File

@@ -55,9 +55,9 @@ const exportService = require("./export/zip");
* @hideconstructor
*/
function BackendScriptApi(currentNote, apiParams) {
/** @property {Note} note where script started executing */
/** @property {BNote} note where script started executing */
this.startNote = apiParams.startNote;
/** @property {Note} note where script is currently executing. Don't mix this up with concept of active note */
/** @property {BNote} note where script is currently executing. Don't mix this up with concept of active note */
this.currentNote = currentNote;
/** @property {Entity} entity whose event triggered this executions */
this.originEntity = apiParams.originEntity;
@@ -89,7 +89,7 @@ function BackendScriptApi(currentNote, apiParams) {
/**
* @method
* @param {string} noteId
* @returns {Note|null}
* @returns {BNote|null}
*/
this.getNote = noteId => becca.getNote(noteId);
@@ -114,7 +114,7 @@ function BackendScriptApi(currentNote, apiParams) {
* @method
* @param {string} query
* @param {Object} [searchParams]
* @returns {Note[]}
* @returns {BNote[]}
*/
this.searchForNotes = (query, searchParams = {}) => {
if (searchParams.includeArchivedNotes === undefined) {
@@ -138,7 +138,7 @@ function BackendScriptApi(currentNote, apiParams) {
* @method
* @param {string} query
* @param {Object} [searchParams]
* @returns {Note|null}
* @returns {BNote|null}
*/
this.searchForNote = (query, searchParams = {}) => {
const notes = this.searchForNotes(query, searchParams);
@@ -152,7 +152,7 @@ function BackendScriptApi(currentNote, apiParams) {
* @method
* @param {string} name - attribute name
* @param {string} [value] - attribute value
* @returns {Note[]}
* @returns {BNote[]}
*/
this.getNotesWithLabel = attributeService.getNotesWithLabel;
@@ -162,7 +162,7 @@ function BackendScriptApi(currentNote, apiParams) {
* @method
* @param {string} name - attribute name
* @param {string} [value] - attribute value
* @returns {Note|null}
* @returns {BNote|null}
*/
this.getNoteWithLabel = attributeService.getNoteWithLabel;
@@ -212,7 +212,7 @@ function BackendScriptApi(currentNote, apiParams) {
* @param {string} parentNoteId
* @param {string} title
* @param {string} content
* @return {{note: Note, branch: Branch}} - object having "note" and "branch" keys representing respective objects
* @return {{note: BNote, branch: Branch}} - object having "note" and "branch" keys representing respective objects
*/
this.createTextNote = (parentNoteId, title, content = '') => noteService.createNewNote({
parentNoteId,
@@ -228,7 +228,7 @@ function BackendScriptApi(currentNote, apiParams) {
* @param {string} parentNoteId
* @param {string} title
* @param {object} content
* @return {{note: Note, branch: Branch}} object having "note" and "branch" keys representing respective objects
* @return {{note: BNote, branch: Branch}} object having "note" and "branch" keys representing respective objects
*/
this.createDataNote = (parentNoteId, title, content = {}) => noteService.createNewNote({
parentNoteId,
@@ -255,7 +255,7 @@ function BackendScriptApi(currentNote, apiParams) {
* @method
*
* @param {CreateNewNoteParams} [params]
* @returns {{note: Note, branch: Branch}} object contains newly created entities note and branch
* @returns {{note: BNote, branch: Branch}} object contains newly created entities note and branch
*/
this.createNewNote = noteService.createNewNote;
@@ -283,7 +283,7 @@ function BackendScriptApi(currentNote, apiParams) {
* @param {string} title
* @param {string} [content=""]
* @param {CreateNoteExtraOptions} [extraOptions={}]
* @returns {{note: Note, branch: Branch}} object contains newly created entities note and branch
* @returns {{note: BNote, branch: Branch}} object contains newly created entities note and branch
*/
this.createNote = (parentNoteId, title, content = "", extraOptions= {}) => {
extraOptions.parentNoteId = parentNoteId;
@@ -354,7 +354,7 @@ function BackendScriptApi(currentNote, apiParams) {
* Returns root note of the calendar.
*
* @method
* @returns {Note|null}
* @returns {BNote|null}
*/
this.getRootCalendarNote = dateNoteService.getRootCalendarNote;
@@ -363,8 +363,8 @@ function BackendScriptApi(currentNote, apiParams) {
*
* @method
* @param {string} date in YYYY-MM-DD format
* @param {Note} [rootNote] - specify calendar root note, normally leave empty to use default calendar
* @returns {Note|null}
* @param {BNote} [rootNote] - specify calendar root note, normally leave empty to use default calendar
* @returns {BNote|null}
* @deprecated use getDayNote instead
*/
this.getDateNote = dateNoteService.getDayNote;
@@ -374,8 +374,8 @@ function BackendScriptApi(currentNote, apiParams) {
*
* @method
* @param {string} date in YYYY-MM-DD format
* @param {Note} [rootNote] - specify calendar root note, normally leave empty to use default calendar
* @returns {Note|null}
* @param {BNote} [rootNote] - specify calendar root note, normally leave empty to use default calendar
* @returns {BNote|null}
*/
this.getDayNote = dateNoteService.getDayNote;
@@ -383,8 +383,8 @@ function BackendScriptApi(currentNote, apiParams) {
* Returns today's day note. If such note doesn't exist, it is created.
*
* @method
* @param {Note} [rootNote] - specify calendar root note, normally leave empty to use default calendar
* @returns {Note|null}
* @param {BNote} [rootNote] - specify calendar root note, normally leave empty to use default calendar
* @returns {BNote|null}
*/
this.getTodayNote = dateNoteService.getTodayNote;
@@ -394,8 +394,8 @@ function BackendScriptApi(currentNote, apiParams) {
* @method
* @param {string} date in YYYY-MM-DD format
* @param {object} [options] - "startOfTheWeek" - either "monday" (default) or "sunday"
* @param {Note} [rootNote] - specify calendar root note, normally leave empty to use default calendar
* @returns {Note|null}
* @param {BNote} [rootNote] - specify calendar root note, normally leave empty to use default calendar
* @returns {BNote|null}
*/
this.getWeekNote = dateNoteService.getWeekNote;
@@ -404,8 +404,8 @@ function BackendScriptApi(currentNote, apiParams) {
*
* @method
* @param {string} date in YYYY-MM format
* @param {Note} [rootNote] - specify calendar root note, normally leave empty to use default calendar
* @returns {Note|null}
* @param {BNote} [rootNote] - specify calendar root note, normally leave empty to use default calendar
* @returns {BNote|null}
*/
this.getMonthNote = dateNoteService.getMonthNote;
@@ -414,8 +414,8 @@ function BackendScriptApi(currentNote, apiParams) {
*
* @method
* @param {string} year in YYYY format
* @param {Note} [rootNote] - specify calendar root note, normally leave empty to use default calendar
* @returns {Note|null}
* @param {BNote} [rootNote] - specify calendar root note, normally leave empty to use default calendar
* @returns {BNote|null}
*/
this.getYearNote = dateNoteService.getYearNote;
@@ -596,8 +596,9 @@ function BackendScriptApi(currentNote, apiParams) {
* @param {string} noteId
* @param {string} format - either 'html' or 'markdown'
* @param {string} zipFilePath
* @returns {Promise}
*/
this.exportSubtreeToZipFile = (noteId, format, zipFilePath) => exportService.exportToZipFile(noteId, format, zipFilePath);
this.exportSubtreeToZipFile = async (noteId, format, zipFilePath) => await exportService.exportToZipFile(noteId, format, zipFilePath);
/**
* This object contains "at your risk" and "no BC guarantees" objects for advanced use cases.
@@ -620,7 +621,7 @@ module.exports = BackendScriptApi;
</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="AbstractEntity.html">AbstractEntity</a></li><li><a href="Attribute.html">Attribute</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li><li><a href="Branch.html">Branch</a></li><li><a href="EtapiToken.html">EtapiToken</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteRevision.html">NoteRevision</a></li><li><a href="Option.html">Option</a></li><li><a href="RecentNote.html">RecentNote</a></li></ul><h3><a href="global.html">Global</a></h3>
<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="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="BNoteRevision.html">BNoteRevision</a></li><li><a href="BOption.html">BOption</a></li><li><a href="BRecentNote.html">BRecentNote</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li></ul><h3><a href="global.html">Global</a></h3>
</nav>
<br class="clear">