From 7119d08022c3438606cb670991f2f5e0e9f5b89c Mon Sep 17 00:00:00 2001 From: zadam Date: Mon, 10 Jan 2022 19:54:38 +0100 Subject: [PATCH] updated API docs --- docs/backend_api/ApiToken.html | 380 ------------------ docs/backend_api/Attribute.html | 2 +- docs/backend_api/BackendScriptApi.html | 196 ++++++++- docs/backend_api/Branch.html | 2 +- docs/backend_api/Note.html | 122 +++--- docs/backend_api/NoteRevision.html | 2 +- docs/backend_api/Option.html | 2 +- docs/backend_api/RecentNote.html | 2 +- .../becca_entities_api_token.js.html | 87 ---- .../becca_entities_attribute.js.html | 10 +- .../backend_api/becca_entities_branch.js.html | 10 +- docs/backend_api/becca_entities_note.js.html | 14 +- .../becca_entities_note_revision.js.html | 6 +- .../backend_api/becca_entities_option.js.html | 6 +- .../becca_entities_recent_note.js.html | 6 +- docs/backend_api/global.html | 2 +- docs/backend_api/index.html | 2 +- .../services_backend_script_api.js.html | 20 +- docs/backend_api/services_sql.js.html | 25 +- docs/frontend_api/FrontendScriptApi.html | 179 ++++++++- .../services_frontend_script_api.js.html | 16 +- package.json | 2 +- 22 files changed, 490 insertions(+), 603 deletions(-) delete mode 100644 docs/backend_api/ApiToken.html delete mode 100644 docs/backend_api/becca_entities_api_token.js.html diff --git a/docs/backend_api/ApiToken.html b/docs/backend_api/ApiToken.html deleted file mode 100644 index d9539104c..000000000 --- a/docs/backend_api/ApiToken.html +++ /dev/null @@ -1,380 +0,0 @@ - - - - - JSDoc: Class: ApiToken - - - - - - - - - - -
- -

Class: ApiToken

- - - - - - -
- -
- -

ApiToken()

- -
ApiToken is an entity representing token used to authenticate against Trilium API from client applications. Currently used only by Trilium Sender.
- - -
- -
-
- - - - -

Constructor

- - - -

new ApiToken()

- - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - -

Members

- - - -

apiTokenId :string

- - - - - - -
Type:
-
    -
  • - -string - - -
  • -
- - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - -

token :string

- - - - - - -
Type:
-
    -
  • - -string - - -
  • -
- - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - -

utcDateCreated :string

- - - - - - -
Type:
-
    -
  • - -string - - -
  • -
- - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - -
- -
- - - - -
- - - -
- - - - - - - \ No newline at end of file diff --git a/docs/backend_api/Attribute.html b/docs/backend_api/Attribute.html index 5da2f4475..3075fa69c 100644 --- a/docs/backend_api/Attribute.html +++ b/docs/backend_api/Attribute.html @@ -1022,7 +1022,7 @@ and relation (representing named relationship between source and target note)

Home

Modules

Classes

Global

+TODO: some methods (like getValue()) could use raw rows

Classes

Global


diff --git a/docs/backend_api/BackendScriptApi.html b/docs/backend_api/BackendScriptApi.html index ac1229dcf..98244b299 100644 --- a/docs/backend_api/BackendScriptApi.html +++ b/docs/backend_api/BackendScriptApi.html @@ -663,7 +663,7 @@
Source:
@@ -1783,7 +1783,7 @@ JSON MIME type. See also createNewNote() for more options.
- If there's a branch between note and parent note, remove it. Otherwise do nothing. + If there's a branch between note and parent note, remove it. Otherwise, do nothing.
@@ -1961,7 +1961,7 @@ JSON MIME type. See also createNewNote() for more options.
- If there's no branch between note and parent note, create one. Otherwise do nothing. + If there's no branch between note and parent note, create one. Otherwise, do nothing.
@@ -2059,7 +2059,7 @@ JSON MIME type. See also createNewNote() for more options. - if branch will be create between note and parent note, set this prefix + if branch will be created between note and parent note, set this prefix @@ -2251,7 +2251,7 @@ JSON MIME type. See also createNewNote() for more options.
Source:
@@ -2357,7 +2357,7 @@ JSON MIME type. See also createNewNote() for more options.
Source:
@@ -2815,6 +2815,8 @@ JSON MIME type. See also createNewNote() for more options. +
Deprecated:
+ @@ -2827,7 +2829,165 @@ JSON MIME type. See also createNewNote() for more options.
Source:
+ + + + + + + + + + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Note +| + +null + + +
+
+ + + + + + + + + + + + + +

getDayNote(date) → {Note|null}

+ + + + + + +
+ Returns day note for given date. If such note doesn't exist, it is created. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
date + + +string + + + + in YYYY-MM-DD format
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
@@ -3095,7 +3255,7 @@ if some action needs to happen on only one specific instance.
Source:
@@ -3866,7 +4026,7 @@ if some action needs to happen on only one specific instance.
Source:
@@ -4047,7 +4207,7 @@ if some action needs to happen on only one specific instance.
Source:
@@ -4205,7 +4365,7 @@ if some action needs to happen on only one specific instance.
Source:
@@ -4495,7 +4655,7 @@ if some action needs to happen on only one specific instance.
Source:
@@ -4603,7 +4763,7 @@ if some action needs to happen on only one specific instance.
Source:
@@ -5195,7 +5355,7 @@ This method looks similar to toggleNoteInParent() but differs because we're look
Source:
@@ -5328,7 +5488,7 @@ This method looks similar to toggleNoteInParent() but differs because we're look
Source:
@@ -5690,7 +5850,7 @@ exists, then we'll use that transaction.
Source:
@@ -5845,7 +6005,7 @@ exists, then we'll use that transaction.
Source:
@@ -5915,7 +6075,7 @@ exists, then we'll use that transaction.
diff --git a/docs/backend_api/Branch.html b/docs/backend_api/Branch.html index b1de020b2..8750faf57 100644 --- a/docs/backend_api/Branch.html +++ b/docs/backend_api/Branch.html @@ -754,7 +754,7 @@ parents.
diff --git a/docs/backend_api/Note.html b/docs/backend_api/Note.html index 06bbc8a9d..4ccf84131 100644 --- a/docs/backend_api/Note.html +++ b/docs/backend_api/Note.html @@ -1517,7 +1517,7 @@
Source:
@@ -1619,7 +1619,7 @@
Source:
@@ -1721,7 +1721,7 @@
Source:
@@ -1827,7 +1827,7 @@
Source:
@@ -2001,7 +2001,7 @@
Source:
@@ -2201,7 +2201,7 @@
Source:
@@ -2379,7 +2379,7 @@
Source:
@@ -2490,7 +2490,7 @@
Source:
@@ -2592,7 +2592,7 @@
Source:
@@ -2694,7 +2694,7 @@
Source:
@@ -2796,7 +2796,7 @@
Source:
@@ -2898,7 +2898,7 @@
Source:
@@ -3006,7 +3006,7 @@
Source:
@@ -3112,7 +3112,7 @@
Source:
@@ -3263,7 +3263,7 @@
Source:
@@ -3433,7 +3433,7 @@
Source:
@@ -3588,7 +3588,7 @@
Source:
@@ -3758,7 +3758,7 @@
Source:
@@ -3864,7 +3864,7 @@
Source:
@@ -4066,7 +4066,7 @@ This method can be significantly faster than the getAttribute()
Source:
@@ -4244,7 +4244,7 @@ This method can be significantly faster than the getAttribute()
Source:
@@ -4402,7 +4402,7 @@ This method can be significantly faster than the getAttribute()
Source:
@@ -4572,7 +4572,7 @@ This method can be significantly faster than the getAttribute()
Source:
@@ -4727,7 +4727,7 @@ This method can be significantly faster than the getAttribute()
Source:
@@ -4897,7 +4897,7 @@ This method can be significantly faster than the getAttribute()
Source:
@@ -5052,7 +5052,7 @@ This method can be significantly faster than the getAttribute()
Source:
@@ -5222,7 +5222,7 @@ This method can be significantly faster than the getAttribute()
Source:
@@ -5377,7 +5377,7 @@ This method can be significantly faster than the getAttribute()
Source:
@@ -5486,7 +5486,7 @@ This method can be significantly faster than the getAttribute()
Source:
@@ -5588,7 +5588,7 @@ This method can be significantly faster than the getAttribute()
Source:
@@ -5739,7 +5739,7 @@ This method can be significantly faster than the getAttribute()
Source:
@@ -5909,7 +5909,7 @@ This method can be significantly faster than the getAttribute()
Source:
@@ -6064,7 +6064,7 @@ This method can be significantly faster than the getAttribute()
Source:
@@ -6173,7 +6173,7 @@ This method can be significantly faster than the getAttribute()
Source:
@@ -6282,7 +6282,7 @@ This method can be significantly faster than the getAttribute()
Source:
@@ -6384,7 +6384,7 @@ This method can be significantly faster than the getAttribute()
Source:
@@ -6486,7 +6486,7 @@ This method can be significantly faster than the getAttribute()
Source:
@@ -6588,7 +6588,7 @@ This method can be significantly faster than the getAttribute()
Source:
@@ -6695,7 +6695,7 @@ This method can be significantly faster than the getAttribute()
Source:
@@ -6797,7 +6797,7 @@ This method can be significantly faster than the getAttribute()
Source:
@@ -6948,7 +6948,7 @@ This method can be significantly faster than the getAttribute()
Source:
@@ -7126,7 +7126,7 @@ This method can be significantly faster than the getAttribute()
Source:
@@ -7281,7 +7281,7 @@ This method can be significantly faster than the getAttribute()
Source:
@@ -7436,7 +7436,7 @@ This method can be significantly faster than the getAttribute()
Source:
@@ -7591,7 +7591,7 @@ This method can be significantly faster than the getAttribute()
Source:
@@ -7741,7 +7741,7 @@ This method can be significantly faster than the getAttribute()
Source:
@@ -7847,7 +7847,7 @@ This method can be significantly faster than the getAttribute()
Source:
@@ -7953,7 +7953,7 @@ This method can be significantly faster than the getAttribute()
Source:
@@ -8059,7 +8059,7 @@ This method can be significantly faster than the getAttribute()
Source:
@@ -8165,7 +8165,7 @@ This method can be significantly faster than the getAttribute()
Source:
@@ -8271,7 +8271,7 @@ This method can be significantly faster than the getAttribute()
Source:
@@ -8504,7 +8504,7 @@ This method can be significantly faster than the getAttribute()
Source:
@@ -8684,7 +8684,7 @@ This method can be significantly faster than the getAttribute()
Source:
@@ -8864,7 +8864,7 @@ This method can be significantly faster than the getAttribute()
Source:
@@ -9075,7 +9075,7 @@ This method can be significantly faster than the getAttribute()
Source:
@@ -9255,7 +9255,7 @@ This method can be significantly faster than the getAttribute()
Source:
@@ -9415,7 +9415,7 @@ This method can be significantly faster than the getAttribute()
Source:
@@ -9657,7 +9657,7 @@ This method can be significantly faster than the getAttribute()
Source:
@@ -9868,7 +9868,7 @@ This method can be significantly faster than the getAttribute()
Source:
@@ -10079,7 +10079,7 @@ This method can be significantly faster than the getAttribute()
Source:
@@ -10127,7 +10127,7 @@ This method can be significantly faster than the getAttribute()
diff --git a/docs/backend_api/NoteRevision.html b/docs/backend_api/NoteRevision.html index 800f9985c..61ca07da2 100644 --- a/docs/backend_api/NoteRevision.html +++ b/docs/backend_api/NoteRevision.html @@ -1292,7 +1292,7 @@ It's used for seamless note versioning.
diff --git a/docs/backend_api/Option.html b/docs/backend_api/Option.html index d90875d9f..9d0ba77e1 100644 --- a/docs/backend_api/Option.html +++ b/docs/backend_api/Option.html @@ -433,7 +433,7 @@
diff --git a/docs/backend_api/RecentNote.html b/docs/backend_api/RecentNote.html index 31106a6b5..ace80a7dd 100644 --- a/docs/backend_api/RecentNote.html +++ b/docs/backend_api/RecentNote.html @@ -365,7 +365,7 @@
diff --git a/docs/backend_api/becca_entities_api_token.js.html b/docs/backend_api/becca_entities_api_token.js.html deleted file mode 100644 index a6436cbca..000000000 --- a/docs/backend_api/becca_entities_api_token.js.html +++ /dev/null @@ -1,87 +0,0 @@ - - - - - JSDoc: Source: becca/entities/api_token.js - - - - - - - - - - -
- -

Source: becca/entities/api_token.js

- - - - - - -
-
-
"use strict";
-
-const dateUtils = require('../../services/date_utils.js');
-const AbstractEntity = require("./abstract_entity.js");
-
-/**
- * ApiToken is an entity representing token used to authenticate against Trilium API from client applications. Currently used only by Trilium Sender.
- */
-class ApiToken extends AbstractEntity {
-    static get entityName() { return "api_tokens"; }
-    static get primaryKeyName() { return "apiTokenId"; }
-    static get hashedProperties() { return ["apiTokenId", "token", "utcDateCreated"]; }
-
-    constructor(row) {
-        super();
-
-        /** @type {string} */
-        this.apiTokenId = row.apiTokenId;
-        /** @type {string} */
-        this.token = row.token;
-        /** @type {string} */
-        this.utcDateCreated = row.utcDateCreated || dateUtils.utcNowDateTime();
-    }
-
-    getPojo() {
-        return {
-            apiTokenId: this.apiTokenId,
-            token: this.token,
-            utcDateCreated: this.utcDateCreated
-        }
-    }
-}
-
-module.exports = ApiToken;
-
-
-
- - - - -
- - - -
- - - - - - - diff --git a/docs/backend_api/becca_entities_attribute.js.html b/docs/backend_api/becca_entities_attribute.js.html index 569206094..baf4e20c9 100644 --- a/docs/backend_api/becca_entities_attribute.js.html +++ b/docs/backend_api/becca_entities_attribute.js.html @@ -28,10 +28,10 @@
"use strict";
 
-const Note = require('./note.js');
-const AbstractEntity = require("./abstract_entity.js");
-const sql = require("../../services/sql.js");
-const dateUtils = require("../../services/date_utils.js");
+const Note = require('./note');
+const AbstractEntity = require("./abstract_entity");
+const sql = require("../../services/sql");
+const dateUtils = require("../../services/date_utils");
 const promotedAttributeDefinitionParser = require("../../services/promoted_attribute_definition_parser");
 
 /**
@@ -247,7 +247,7 @@ module.exports = Attribute;
 
 
 
diff --git a/docs/backend_api/becca_entities_branch.js.html b/docs/backend_api/becca_entities_branch.js.html index 474c07967..daf68f4ed 100644 --- a/docs/backend_api/becca_entities_branch.js.html +++ b/docs/backend_api/becca_entities_branch.js.html @@ -28,10 +28,10 @@
"use strict";
 
-const Note = require('./note.js');
-const AbstractEntity = require("./abstract_entity.js");
-const sql = require("../../services/sql.js");
-const dateUtils = require("../../services/date_utils.js");
+const Note = require('./note');
+const AbstractEntity = require("./abstract_entity");
+const sql = require("../../services/sql");
+const dateUtils = require("../../services/date_utils");
 
 /**
  * Branch represents a relationship between a child note and its parent note. Trilium allows a note to have multiple
@@ -195,7 +195,7 @@ module.exports = Branch;
 
 
 
diff --git a/docs/backend_api/becca_entities_note.js.html b/docs/backend_api/becca_entities_note.js.html index 64d0a4539..54f2851ea 100644 --- a/docs/backend_api/becca_entities_note.js.html +++ b/docs/backend_api/becca_entities_note.js.html @@ -34,8 +34,8 @@ const sql = require('../../services/sql'); const utils = require('../../services/utils'); const dateUtils = require('../../services/date_utils'); const entityChangesService = require('../../services/entity_changes'); -const AbstractEntity = require("./abstract_entity.js"); -const NoteRevision = require("./note_revision.js"); +const AbstractEntity = require("./abstract_entity"); +const NoteRevision = require("./note_revision"); const LABEL = 'label'; const RELATION = 'relation'; @@ -159,6 +159,10 @@ class Note extends AbstractEntity { || protectedSessionService.isProtectedSessionAvailable() } + getTitleOrProtected() { + return this.isContentAvailable() ? this.title : '[protected]'; + } + /** @returns {Branch[]} */ getParentBranches() { return this.parentBranches; @@ -1008,7 +1012,7 @@ class Note extends AbstractEntity { } } else { - const Attribute = require("./attribute.js"); + const Attribute = require("./attribute"); new Attribute({ noteId: this.noteId, @@ -1040,7 +1044,7 @@ class Note extends AbstractEntity { * @return {Attribute} */ addAttribute(type, name, value = "", isInheritable = false, position = 1000) { - const Attribute = require("./attribute.js"); + const Attribute = require("./attribute"); return new Attribute({ noteId: this.noteId, @@ -1216,7 +1220,7 @@ module.exports = Note;
diff --git a/docs/backend_api/becca_entities_note_revision.js.html b/docs/backend_api/becca_entities_note_revision.js.html index 6bea60bb8..ae8c931e4 100644 --- a/docs/backend_api/becca_entities_note_revision.js.html +++ b/docs/backend_api/becca_entities_note_revision.js.html @@ -32,9 +32,9 @@ const protectedSessionService = require('../../services/protected_session'); const utils = require('../../services/utils'); const sql = require('../../services/sql'); const dateUtils = require('../../services/date_utils'); -const becca = require('../becca.js'); +const becca = require('../becca'); const entityChangesService = require('../../services/entity_changes'); -const AbstractEntity = require("./abstract_entity.js"); +const AbstractEntity = require("./abstract_entity"); /** * NoteRevision represents snapshot of note's title and content at some point in the past. @@ -232,7 +232,7 @@ module.exports = NoteRevision;
diff --git a/docs/backend_api/becca_entities_option.js.html b/docs/backend_api/becca_entities_option.js.html index 5c315cf47..dad91f487 100644 --- a/docs/backend_api/becca_entities_option.js.html +++ b/docs/backend_api/becca_entities_option.js.html @@ -28,8 +28,8 @@
"use strict";
 
-const dateUtils = require('../../services/date_utils.js');
-const AbstractEntity = require("./abstract_entity.js");
+const dateUtils = require('../../services/date_utils');
+const AbstractEntity = require("./abstract_entity");
 
 /**
  * Option represents name-value pair, either directly configurable by the user or some system property.
@@ -83,7 +83,7 @@ module.exports = Option;
 
 
 
diff --git a/docs/backend_api/becca_entities_recent_note.js.html b/docs/backend_api/becca_entities_recent_note.js.html index fdf0f598c..09e1b0df6 100644 --- a/docs/backend_api/becca_entities_recent_note.js.html +++ b/docs/backend_api/becca_entities_recent_note.js.html @@ -28,8 +28,8 @@
"use strict";
 
-const dateUtils = require('../../services/date_utils.js');
-const AbstractEntity = require("./abstract_entity.js");
+const dateUtils = require('../../services/date_utils');
+const AbstractEntity = require("./abstract_entity");
 
 /**
  * RecentNote represents recently visited note.
@@ -71,7 +71,7 @@ module.exports = RecentNote;
 
 
 
diff --git a/docs/backend_api/global.html b/docs/backend_api/global.html index f38d479fe..3ad688eae 100644 --- a/docs/backend_api/global.html +++ b/docs/backend_api/global.html @@ -1085,7 +1085,7 @@
diff --git a/docs/backend_api/index.html b/docs/backend_api/index.html index 6da54a46a..01c6d411c 100644 --- a/docs/backend_api/index.html +++ b/docs/backend_api/index.html @@ -52,7 +52,7 @@
diff --git a/docs/backend_api/services_backend_script_api.js.html b/docs/backend_api/services_backend_script_api.js.html index 59e64a6b0..36f6b53d1 100644 --- a/docs/backend_api/services_backend_script_api.js.html +++ b/docs/backend_api/services_backend_script_api.js.html @@ -162,18 +162,18 @@ function BackendScriptApi(currentNote, apiParams) { this.getNoteWithLabel = attributeService.getNoteWithLabel; /** - * If there's no branch between note and parent note, create one. Otherwise do nothing. + * If there's no branch between note and parent note, create one. Otherwise, do nothing. * * @method * @param {string} noteId * @param {string} parentNoteId - * @param {string} prefix - if branch will be create between note and parent note, set this prefix + * @param {string} prefix - if branch will be created between note and parent note, set this prefix * @returns {void} */ this.ensureNoteIsPresentInParent = cloningService.ensureNoteIsPresentInParent; /** - * If there's a branch between note and parent note, remove it. Otherwise do nothing. + * If there's a branch between note and parent note, remove it. Otherwise, do nothing. * * @method * @param {string} noteId @@ -337,8 +337,18 @@ function BackendScriptApi(currentNote, apiParams) { * @method * @param {string} date in YYYY-MM-DD format * @returns {Note|null} + * @deprecated use getDayNote instead */ - this.getDateNote = dateNoteService.getDateNote; + this.getDateNote = dateNoteService.getDayNote; + + /** + * Returns day note for given date. If such note doesn't exist, it is created. + * + * @method + * @param {string} date in YYYY-MM-DD format + * @returns {Note|null} + */ + this.getDayNote = dateNoteService.getDayNote; /** * Returns today's day note. If such note doesn't exist, it is created. @@ -459,7 +469,7 @@ module.exports = BackendScriptApi;
diff --git a/docs/backend_api/services_sql.js.html b/docs/backend_api/services_sql.js.html index b17d24343..63f10fdd7 100644 --- a/docs/backend_api/services_sql.js.html +++ b/docs/backend_api/services_sql.js.html @@ -42,6 +42,8 @@ const cls = require('./cls'); const dbConnection = new Database(dataDir.DOCUMENT_PATH); dbConnection.pragma('journal_mode = WAL'); +const LOG_ALL_QUERIES = false; + [`exit`, `SIGINT`, `SIGUSR1`, `SIGUSR2`, `SIGTERM`].forEach(eventType => { process.on(eventType, () => { if (dbConnection) { @@ -163,6 +165,10 @@ function getRawRows(query, params = []) { } function iterateRows(query, params = []) { + if (LOG_ALL_QUERIES) { + console.log(query); + } + return stmt(query).iterate(params); } @@ -185,11 +191,11 @@ function execute(query, params = []) { return wrap(query, s => s.run(params)); } -function executeWithoutTransaction(query, params = []) { - dbConnection.run(query, params); -} - function executeMany(query, params) { + if (LOG_ALL_QUERIES) { + console.log(query); + } + while (params.length > 0) { const curParams = params.slice(0, Math.min(params.length, PARAM_LIMIT)); params = params.slice(curParams.length); @@ -210,6 +216,10 @@ function executeMany(query, params) { } function executeScript(query) { + if (LOG_ALL_QUERIES) { + console.log(query); + } + return dbConnection.exec(query); } @@ -217,6 +227,10 @@ function wrap(query, func) { const startTimestamp = Date.now(); let result; + if (LOG_ALL_QUERIES) { + console.log(query); + } + try { result = func(stmt(query)); } @@ -359,7 +373,6 @@ module.exports = { * @param {object[]} [params] - array of params if needed */ execute, - executeWithoutTransaction, executeMany, executeScript, transactional, @@ -378,7 +391,7 @@ module.exports = {
diff --git a/docs/frontend_api/FrontendScriptApi.html b/docs/frontend_api/FrontendScriptApi.html index f4e98b4ac..d925e268c 100644 --- a/docs/frontend_api/FrontendScriptApi.html +++ b/docs/frontend_api/FrontendScriptApi.html @@ -1928,7 +1928,7 @@
Source:
@@ -2831,7 +2831,164 @@
- Returns date-note. If it doesn't exist, it is automatically created. + Returns day note for a given date. If it doesn't exist, it is automatically created. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
date + + +string + + + + e.g. "2019-04-29"
+ + + + + + +
+ + + + + + + + + + + + + + + + +
Deprecated:
  • use getDayNote instead
+ + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Promise.<NoteShort> + + +
+
+ + + + + + + + + + + + + +

getDayNote(date) → {Promise.<NoteShort>}

+ + + + + + +
+ Returns day note for a given date. If it doesn't exist, it is automatically created.
@@ -2924,7 +3081,7 @@
Source:
@@ -3186,7 +3343,7 @@ if some action needs to happen on only one specific instance.
Source:
@@ -3711,7 +3868,7 @@ otherwise (by e.g. createNoteLink())
- Returns date-note for the first date of the week of the given date. If it doesn't exist, it is automatically created. + Returns day note for the first date of the week of the given date. If it doesn't exist, it is automatically created.
@@ -3804,7 +3961,7 @@ otherwise (by e.g. createNoteLink())
Source:
@@ -3959,7 +4116,7 @@ otherwise (by e.g. createNoteLink())
Source:
@@ -4845,7 +5002,7 @@ otherwise (by e.g. createNoteLink())
Source:
@@ -4999,7 +5156,7 @@ otherwise (by e.g. createNoteLink())
Source:
@@ -5940,7 +6097,7 @@ Internally this serializes the anonymous function into string and sends it to ba
Source:
@@ -6457,7 +6614,7 @@ Typical use case is when new note has been created, we should wait until it is s
Source:
diff --git a/docs/frontend_api/services_frontend_script_api.js.html b/docs/frontend_api/services_frontend_script_api.js.html index 04d0bea25..ba3bad2bd 100644 --- a/docs/frontend_api/services_frontend_script_api.js.html +++ b/docs/frontend_api/services_frontend_script_api.js.html @@ -417,16 +417,26 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain this.getTodayNote = dateNotesService.getTodayNote; /** - * Returns date-note. If it doesn't exist, it is automatically created. + * Returns day note for a given date. If it doesn't exist, it is automatically created. + * + * @method + * @param {string} date - e.g. "2019-04-29" + * @return {Promise<NoteShort>} + * @deprecated use getDayNote instead + */ + this.getDateNote = dateNotesService.getDayNote; + + /** + * Returns day note for a given date. If it doesn't exist, it is automatically created. * * @method * @param {string} date - e.g. "2019-04-29" * @return {Promise<NoteShort>} */ - this.getDateNote = dateNotesService.getDateNote; + this.getDayNote = dateNotesService.getDayNote; /** - * Returns date-note for the first date of the week of the given date. If it doesn't exist, it is automatically created. + * Returns day note for the first date of the week of the given date. If it doesn't exist, it is automatically created. * * @method * @param {string} date - e.g. "2019-04-29" diff --git a/package.json b/package.json index 8a80fb3d6..3391ad2b9 100644 --- a/package.json +++ b/package.json @@ -86,7 +86,7 @@ "electron": "16.0.6", "electron-builder": "22.14.5", "electron-packager": "15.4.0", - "electron-rebuild": "3.2.5", + "electron-rebuild": "3.2.6", "esm": "3.2.25", "jasmine": "4.0.1", "jsdoc": "3.6.7",