From 0885e60b8034fa2d00751a39a103fb8403e1863d Mon Sep 17 00:00:00 2001 From: zadam Date: Thu, 14 Mar 2019 20:49:10 +0100 Subject: [PATCH] removed obsolete isoDateXXX API methods --- docs/backend_api/ApiToken.html | 6 +- docs/backend_api/Attribute.html | 8 +- docs/backend_api/BackendScriptApi.html | 10 +- docs/backend_api/Branch.html | 8 +- docs/backend_api/Link.html | 8 +- docs/backend_api/Note.html | 154 ++++++++---- docs/backend_api/NoteContent.html | 8 +- docs/backend_api/NoteRevision.html | 52 +++- docs/backend_api/Option.html | 8 +- docs/backend_api/RecentNote.html | 6 +- docs/backend_api/entities_api_token.js.html | 8 +- docs/backend_api/entities_attribute.js.html | 12 +- docs/backend_api/entities_branch.js.html | 10 +- docs/backend_api/entities_link.js.html | 12 +- docs/backend_api/entities_note.js.html | 20 +- .../backend_api/entities_note_content.js.html | 15 +- .../entities_note_revision.js.html | 4 +- docs/backend_api/entities_option.js.html | 6 +- docs/backend_api/entities_recent_note.js.html | 8 +- .../services_backend_script_api.js.html | 8 +- docs/frontend_api/NoteFull.html | 232 +++++++++--------- docs/frontend_api/entities_attribute.js.html | 8 +- docs/frontend_api/entities_note_full.js.html | 4 +- .../services_frontend_script_api.js.html | 6 +- src/services/backend_script_api.js | 6 +- 25 files changed, 369 insertions(+), 258 deletions(-) diff --git a/docs/backend_api/ApiToken.html b/docs/backend_api/ApiToken.html index b768600a5..d188973b1 100644 --- a/docs/backend_api/ApiToken.html +++ b/docs/backend_api/ApiToken.html @@ -28,7 +28,7 @@
-

ApiToken(apiTokenId, token, isDeleted, dateCreated)

+

ApiToken(apiTokenId, token, isDeleted, utcDateCreated)

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

new ApiToken(apiTokenId, token, isDeleted, dateCreated)

+

new ApiToken(apiTokenId, token, isDeleted, utcDateCreated)

@@ -154,7 +154,7 @@ - dateCreated + utcDateCreated diff --git a/docs/backend_api/Attribute.html b/docs/backend_api/Attribute.html index 85caec79a..63f30a392 100644 --- a/docs/backend_api/Attribute.html +++ b/docs/backend_api/Attribute.html @@ -28,7 +28,7 @@
-

Attribute(attributeId, noteId, type, name, value, position, isInheritable, isDeleted, dateCreated, dateModified)

+

Attribute(attributeId, noteId, type, name, value, position, isInheritable, isDeleted, utcDateCreated, utcDateModified)

Attribute is key value pair owned by a note.
@@ -45,7 +45,7 @@ -

new Attribute(attributeId, noteId, type, name, value, position, isInheritable, isDeleted, dateCreated, dateModified)

+

new Attribute(attributeId, noteId, type, name, value, position, isInheritable, isDeleted, utcDateCreated, utcDateModified)

@@ -269,7 +269,7 @@ - dateCreated + utcDateCreated @@ -292,7 +292,7 @@ - dateModified + utcDateModified diff --git a/docs/backend_api/BackendScriptApi.html b/docs/backend_api/BackendScriptApi.html index 3f28eedec..e62a00c54 100644 --- a/docs/backend_api/BackendScriptApi.html +++ b/docs/backend_api/BackendScriptApi.html @@ -81,7 +81,7 @@
Source:
@@ -182,7 +182,7 @@ - where script is currently executing + where script is currently executing. Don't mix this up with concept of active note @@ -221,7 +221,7 @@
Source:
@@ -331,7 +331,7 @@
Source:
@@ -504,7 +504,7 @@ the backend.
Source:
diff --git a/docs/backend_api/Branch.html b/docs/backend_api/Branch.html index cad699e14..f77a63a33 100644 --- a/docs/backend_api/Branch.html +++ b/docs/backend_api/Branch.html @@ -28,7 +28,7 @@
-

Branch(branchId, noteId, parentNoteId, notePosition, prefix, isExpanded, isDeleted, dateModified, dateCreated)

+

Branch(branchId, noteId, parentNoteId, notePosition, prefix, isExpanded, isDeleted, utcDateModified, utcDateCreated)

Branch represents note's placement in the tree - it's essentially pair of noteId and parentNoteId. Each note can have multiple (at least one) branches, meaning it can be placed into multiple places in the tree.
@@ -46,7 +46,7 @@ Each note can have multiple (at least one) branches, meaning it can be placed in -

new Branch(branchId, noteId, parentNoteId, notePosition, prefix, isExpanded, isDeleted, dateModified, dateCreated)

+

new Branch(branchId, noteId, parentNoteId, notePosition, prefix, isExpanded, isDeleted, utcDateModified, utcDateCreated)

@@ -247,7 +247,7 @@ Each note can have multiple (at least one) branches, meaning it can be placed in - dateModified + utcDateModified @@ -270,7 +270,7 @@ Each note can have multiple (at least one) branches, meaning it can be placed in - dateCreated + utcDateCreated diff --git a/docs/backend_api/Link.html b/docs/backend_api/Link.html index e9abe5627..4dc31a2a3 100644 --- a/docs/backend_api/Link.html +++ b/docs/backend_api/Link.html @@ -28,7 +28,7 @@
-

Link(linkId, noteId, targetNoteId, type, isDeleted, dateModified, dateCreated)

+

Link(linkId, noteId, targetNoteId, type, isDeleted, utcDateModified, utcDateCreated)

This class represents link from one note to another in the form of hyperlink or image reference. Note that this is different concept than attribute/relation.
@@ -46,7 +46,7 @@ this is different concept than attribute/relation. - + @@ -201,7 +201,7 @@ this is different concept than attribute/relation. - dateModified + utcDateModified @@ -224,7 +224,7 @@ this is different concept than attribute/relation. - dateCreated + utcDateCreated diff --git a/docs/backend_api/Note.html b/docs/backend_api/Note.html index 0588994f7..1a05d7ceb 100644 --- a/docs/backend_api/Note.html +++ b/docs/backend_api/Note.html @@ -288,7 +288,7 @@ - + local date time (with offset) @@ -311,6 +311,52 @@ + local date time (with offset) + + + + + + + utcDateCreated + + + + + +string + + + + + + + + + + + + + + + + + utcDateModified + + + + + +string + + + + + + + + + @@ -350,7 +396,7 @@
Source:
@@ -535,7 +581,7 @@
Source:
@@ -700,7 +746,7 @@
Source:
@@ -876,7 +922,7 @@
Source:
@@ -980,7 +1026,7 @@
Source:
@@ -1080,7 +1126,7 @@
Source:
@@ -1184,7 +1230,7 @@
Source:
@@ -1288,7 +1334,7 @@
Source:
@@ -1388,7 +1434,7 @@
Source:
@@ -1619,7 +1665,7 @@
Source:
@@ -1815,7 +1861,7 @@
Source:
@@ -2011,7 +2057,7 @@
Source:
@@ -2111,7 +2157,7 @@
Source:
@@ -2260,7 +2306,7 @@
Source:
@@ -2425,7 +2471,7 @@
Source:
@@ -2590,7 +2636,7 @@
Source:
@@ -2743,7 +2789,7 @@
Source:
@@ -2851,7 +2897,7 @@
Source:
@@ -2955,7 +3001,7 @@
Source:
@@ -3055,7 +3101,7 @@
Source:
@@ -3155,7 +3201,7 @@
Source:
@@ -3259,7 +3305,7 @@
Source:
@@ -3412,7 +3458,7 @@
Source:
@@ -3577,7 +3623,7 @@
Source:
@@ -3742,7 +3788,7 @@
Source:
@@ -3895,7 +3941,7 @@
Source:
@@ -4051,7 +4097,7 @@
Source:
@@ -4159,7 +4205,7 @@
Source:
@@ -4259,7 +4305,7 @@
Source:
@@ -4367,7 +4413,7 @@
Source:
@@ -4467,7 +4513,7 @@
Source:
@@ -4643,7 +4689,7 @@
Source:
@@ -4747,7 +4793,7 @@
Source:
@@ -4900,7 +4946,7 @@
Source:
@@ -5053,7 +5099,7 @@
Source:
@@ -5162,7 +5208,7 @@ Cache is note instance scoped.
Source:
@@ -5244,7 +5290,7 @@ Cache is note instance scoped.
Source:
@@ -5348,7 +5394,7 @@ Cache is note instance scoped.
Source:
@@ -5452,7 +5498,7 @@ Cache is note instance scoped.
Source:
@@ -5556,7 +5602,7 @@ Cache is note instance scoped.
Source:
@@ -5660,7 +5706,7 @@ Cache is note instance scoped.
Source:
@@ -5764,7 +5810,7 @@ Cache is note instance scoped.
Source:
@@ -5991,7 +6037,7 @@ Cache is note instance scoped.
Source:
@@ -6187,7 +6233,7 @@ Cache is note instance scoped.
Source:
@@ -6383,7 +6429,7 @@ Cache is note instance scoped.
Source:
@@ -6610,7 +6656,7 @@ Cache is note instance scoped.
Source:
@@ -6710,7 +6756,7 @@ Cache is note instance scoped.
Source:
@@ -6810,7 +6856,7 @@ Cache is note instance scoped.
Source:
@@ -7006,7 +7052,7 @@ Cache is note instance scoped.
Source:
@@ -7202,7 +7248,7 @@ Cache is note instance scoped.
Source:
@@ -7460,7 +7506,7 @@ Cache is note instance scoped.
Source:
@@ -7687,7 +7733,7 @@ Cache is note instance scoped.
Source:
@@ -7914,7 +7960,7 @@ Cache is note instance scoped.
Source:
diff --git a/docs/backend_api/NoteContent.html b/docs/backend_api/NoteContent.html index 96ccf9d4a..092f9575a 100644 --- a/docs/backend_api/NoteContent.html +++ b/docs/backend_api/NoteContent.html @@ -226,7 +226,7 @@ - dateCreated + utcDateCreated @@ -249,7 +249,7 @@ - dateModified + utcDateModified @@ -304,7 +304,7 @@
Source:
@@ -417,7 +417,7 @@
Source:
diff --git a/docs/backend_api/NoteRevision.html b/docs/backend_api/NoteRevision.html index 6de063504..0777854ad 100644 --- a/docs/backend_api/NoteRevision.html +++ b/docs/backend_api/NoteRevision.html @@ -28,7 +28,7 @@
-

NoteRevision(noteRevisionId, noteId, type, mime, title, content, isProtected, dateModifiedFrom, dateModifiedTo)

+

NoteRevision(noteRevisionId, noteId, type, mime, title, content, isProtected, dateModifiedFrom, dateModifiedTo, utcDateModifiedFrom, utcDateModifiedTo)

NoteRevision represents snapshot of note's title and content at some point in the past. It's used for seamless note versioning.
@@ -45,7 +45,7 @@ -

new NoteRevision(noteRevisionId, noteId, type, mime, title, content, isProtected, dateModifiedFrom, dateModifiedTo)

+

new NoteRevision(noteRevisionId, noteId, type, mime, title, content, isProtected, dateModifiedFrom, dateModifiedTo, utcDateModifiedFrom, utcDateModifiedTo)

@@ -285,6 +285,52 @@ + + + + + + + + utcDateModifiedFrom + + + + + +string + + + + + + + + + + + + + + + + + utcDateModifiedTo + + + + + +string + + + + + + + + + @@ -326,7 +372,7 @@
Source:
diff --git a/docs/backend_api/Option.html b/docs/backend_api/Option.html index ed172ed86..dd1f67aa6 100644 --- a/docs/backend_api/Option.html +++ b/docs/backend_api/Option.html @@ -28,7 +28,7 @@
-

Option(name, value, isSynced, dateModified, dateCreated)

+

Option(name, value, isSynced, utcDateModified, utcDateCreated)

Option represents name-value pair, either directly configurable by the user or some system property.
@@ -45,7 +45,7 @@ -

new Option(name, value, isSynced, dateModified, dateCreated)

+

new Option(name, value, isSynced, utcDateModified, utcDateCreated)

@@ -154,7 +154,7 @@ - dateModified + utcDateModified @@ -177,7 +177,7 @@ - dateCreated + utcDateCreated diff --git a/docs/backend_api/RecentNote.html b/docs/backend_api/RecentNote.html index 000826df3..c79ee40ef 100644 --- a/docs/backend_api/RecentNote.html +++ b/docs/backend_api/RecentNote.html @@ -28,7 +28,7 @@
-

RecentNote(branchId, notePath, isDeleted, dateModified)

+

RecentNote(branchId, notePath, isDeleted, utcDateModified)

RecentNote represents recently visited note.
@@ -45,7 +45,7 @@ -

new RecentNote(branchId, notePath, isDeleted, dateModified)

+

new RecentNote(branchId, notePath, isDeleted, utcDateModified)

@@ -154,7 +154,7 @@ - dateModified + utcDateModified diff --git a/docs/backend_api/entities_api_token.js.html b/docs/backend_api/entities_api_token.js.html index 20ce1ff98..a86dcfd95 100644 --- a/docs/backend_api/entities_api_token.js.html +++ b/docs/backend_api/entities_api_token.js.html @@ -37,22 +37,22 @@ const dateUtils = require('../services/date_utils'); * @param {string} apiTokenId - primary key * @param {string} token * @param {boolean} isDeleted - true if API token is deleted - * @param {string} dateCreated + * @param {string} utcDateCreated * * @extends Entity */ class ApiToken extends Entity { static get entityName() { return "api_tokens"; } static get primaryKeyName() { return "apiTokenId"; } - static get hashedProperties() { return ["apiTokenId", "token", "dateCreated", "isDeleted"]; } + static get hashedProperties() { return ["apiTokenId", "token", "utcDateCreated", "isDeleted"]; } beforeSaving() { if (!this.isDeleted) { this.isDeleted = false; } - if (!this.dateCreated) { - this.dateCreated = dateUtils.nowDate(); + if (!this.utcDateCreated) { + this.utcDateCreated = dateUtils.utcNowDateTime(); } super.beforeSaving(); diff --git a/docs/backend_api/entities_attribute.js.html b/docs/backend_api/entities_attribute.js.html index b65bf2f81..c330d76cf 100644 --- a/docs/backend_api/entities_attribute.js.html +++ b/docs/backend_api/entities_attribute.js.html @@ -44,15 +44,15 @@ const sql = require('../services/sql'); * @param {int} position * @param {boolean} isInheritable * @param {boolean} isDeleted - * @param {string} dateCreated - * @param {string} dateModified + * @param {string} utcDateCreated + * @param {string} utcDateModified * * @extends Entity */ class Attribute extends Entity { static get entityName() { return "attributes"; } static get primaryKeyName() { return "attributeId"; } - static get hashedProperties() { return ["attributeId", "noteId", "type", "name", "value", "isInheritable", "isDeleted", "dateCreated"]; } + static get hashedProperties() { return ["attributeId", "noteId", "type", "name", "value", "isInheritable", "isDeleted", "utcDateCreated"]; } constructor(row) { super(row); @@ -123,14 +123,14 @@ class Attribute extends Entity { this.isDeleted = false; } - if (!this.dateCreated) { - this.dateCreated = dateUtils.nowDate(); + if (!this.utcDateCreated) { + this.utcDateCreated = dateUtils.utcNowDateTime(); } super.beforeSaving(); if (this.isChanged) { - this.dateModified = dateUtils.nowDate(); + this.utcDateModified = dateUtils.utcNowDateTime(); } } diff --git a/docs/backend_api/entities_branch.js.html b/docs/backend_api/entities_branch.js.html index e0bcf59dc..983dfe370 100644 --- a/docs/backend_api/entities_branch.js.html +++ b/docs/backend_api/entities_branch.js.html @@ -44,8 +44,8 @@ const sql = require('../services/sql'); * @param {string} prefix * @param {boolean} isExpanded * @param {boolean} isDeleted - * @param {string} dateModified - * @param {string} dateCreated + * @param {string} utcDateModified + * @param {string} utcDateCreated * * @extends Entity */ @@ -77,14 +77,14 @@ class Branch extends Entity { this.isDeleted = false; } - if (!this.dateCreated) { - this.dateCreated = dateUtils.nowDate(); + if (!this.utcDateCreated) { + this.utcDateCreated = dateUtils.utcNowDateTime(); } super.beforeSaving(); if (this.isChanged) { - this.dateModified = dateUtils.nowDate(); + this.utcDateModified = dateUtils.utcNowDateTime(); } } diff --git a/docs/backend_api/entities_link.js.html b/docs/backend_api/entities_link.js.html index 3a3a3d089..e9a2aa3c6 100644 --- a/docs/backend_api/entities_link.js.html +++ b/docs/backend_api/entities_link.js.html @@ -41,15 +41,15 @@ const dateUtils = require('../services/date_utils'); * @param {string} targetNoteId * @param {string} type * @param {boolean} isDeleted - * @param {string} dateModified - * @param {string} dateCreated + * @param {string} utcDateModified + * @param {string} utcDateCreated * * @extends Entity */ class Link extends Entity { static get entityName() { return "links"; } static get primaryKeyName() { return "linkId"; } - static get hashedProperties() { return ["linkId", "noteId", "targetNoteId", "type", "isDeleted", "dateCreated", "dateModified"]; } + static get hashedProperties() { return ["linkId", "noteId", "targetNoteId", "type", "isDeleted", "utcDateCreated", "utcDateModified"]; } async getNote() { return await repository.getEntity("SELECT * FROM notes WHERE noteId = ?", [this.noteId]); @@ -64,14 +64,14 @@ class Link extends Entity { this.isDeleted = false; } - if (!this.dateCreated) { - this.dateCreated = dateUtils.nowDate(); + if (!this.utcDateCreated) { + this.utcDateCreated = dateUtils.utcNowDateTime(); } super.beforeSaving(); if (this.isChanged) { - this.dateModified = dateUtils.nowDate(); + this.utcDateModified = dateUtils.utcNowDateTime(); } } } diff --git a/docs/backend_api/entities_note.js.html b/docs/backend_api/entities_note.js.html index 507c6fe89..4cf885d3a 100644 --- a/docs/backend_api/entities_note.js.html +++ b/docs/backend_api/entities_note.js.html @@ -35,6 +35,7 @@ const protectedSessionService = require('../services/protected_session'); const repository = require('../services/repository'); const sql = require('../services/sql'); const dateUtils = require('../services/date_utils'); +const noteFulltextService = require('../services/note_fulltext'); const LABEL = 'label'; const LABEL_DEFINITION = 'label-definition'; @@ -52,8 +53,10 @@ const STRING_MIME_TYPES = ["application/x-javascript"]; * @property {string} title - note title * @property {boolean} isProtected - true if note is protected * @property {boolean} isDeleted - true if note is deleted - * @property {string} dateCreated - * @property {string} dateModified + * @property {string} dateCreated - local date time (with offset) + * @property {string} dateModified - local date time (with offset) + * @property {string} utcDateCreated + * @property {string} utcDateModified * * @extends Entity */ @@ -688,13 +691,18 @@ class Note extends Entity { } if (!this.dateCreated) { - this.dateCreated = dateUtils.nowDate(); + this.dateCreated = dateUtils.localNowDateTime(); + } + + if (!this.utcDateCreated) { + this.utcDateCreated = dateUtils.utcNowDateTime(); } super.beforeSaving(); if (this.isChanged) { - this.dateModified = dateUtils.nowDate(); + this.dateModified = dateUtils.localNowDateTime(); + this.utcDateModified = dateUtils.utcNowDateTime(); } } @@ -715,6 +723,10 @@ class Note extends Entity { delete pojo.titleCipherText; delete pojo.noteContent; } + + async afterSaving() { + noteFulltextService.triggerNoteFulltextUpdate(this.noteId); + } } module.exports = Note; diff --git a/docs/backend_api/entities_note_content.js.html b/docs/backend_api/entities_note_content.js.html index 4aa2ac78d..1a170261f 100644 --- a/docs/backend_api/entities_note_content.js.html +++ b/docs/backend_api/entities_note_content.js.html @@ -32,6 +32,7 @@ const Entity = require('./entity'); const protectedSessionService = require('../services/protected_session'); const repository = require('../services/repository'); const dateUtils = require('../services/date_utils'); +const noteFulltextService = require('../services/note_fulltext'); /** * This represents a Note which is a central object in the Trilium Notes project. @@ -40,8 +41,8 @@ const dateUtils = require('../services/date_utils'); * @property {string} noteId - reference to owning note * @property {boolean} isProtected - true if note content is protected * @property {blob} content - note content - e.g. HTML text for text notes, file payload for files - * @property {string} dateCreated - * @property {string} dateModified + * @property {string} utcDateCreated + * @property {string} utcDateModified * * @extends Entity */ @@ -93,14 +94,14 @@ class NoteContent extends Entity { } beforeSaving() { - if (!this.dateCreated) { - this.dateCreated = dateUtils.nowDate(); + if (!this.utcDateCreated) { + this.utcDateCreated = dateUtils.utcNowDateTime(); } super.beforeSaving(); if (this.isChanged) { - this.dateModified = dateUtils.nowDate(); + this.utcDateModified = dateUtils.utcNowDateTime(); } } @@ -119,6 +120,10 @@ class NoteContent extends Entity { delete pojo.isContentAvailable; delete pojo.contentCipherText; } + + async afterSaving() { + noteFulltextService.triggerNoteFulltextUpdate(this.noteId); + } } module.exports = NoteContent; diff --git a/docs/backend_api/entities_note_revision.js.html b/docs/backend_api/entities_note_revision.js.html index 70c4f281c..4403ed921 100644 --- a/docs/backend_api/entities_note_revision.js.html +++ b/docs/backend_api/entities_note_revision.js.html @@ -44,13 +44,15 @@ const repository = require('../services/repository'); * @param {string} isProtected * @param {string} dateModifiedFrom * @param {string} dateModifiedTo + * @param {string} utcDateModifiedFrom + * @param {string} utcDateModifiedTo * * @extends Entity */ class NoteRevision extends Entity { static get entityName() { return "note_revisions"; } static get primaryKeyName() { return "noteRevisionId"; } - static get hashedProperties() { return ["noteRevisionId", "noteId", "title", "content", "isProtected", "dateModifiedFrom", "dateModifiedTo"]; } + static get hashedProperties() { return ["noteRevisionId", "noteId", "title", "content", "isProtected", "dateModifiedFrom", "dateModifiedTo", "utcDateModifiedFrom", "utcDateModifiedTo"]; } constructor(row) { super(row); diff --git a/docs/backend_api/entities_option.js.html b/docs/backend_api/entities_option.js.html index 2fa04309b..3437b7dbd 100644 --- a/docs/backend_api/entities_option.js.html +++ b/docs/backend_api/entities_option.js.html @@ -37,8 +37,8 @@ const dateUtils = require('../services/date_utils'); * @param {string} name * @param {string} value * @param {boolean} isSynced - * @param {string} dateModified - * @param {string} dateCreated + * @param {string} utcDateModified + * @param {string} utcDateCreated * * @extends Entity */ @@ -57,7 +57,7 @@ class Option extends Entity { super.beforeSaving(); if (this.isChanged) { - this.dateModified = dateUtils.nowDate(); + this.utcDateModified = dateUtils.utcNowDateTime(); } } } diff --git a/docs/backend_api/entities_recent_note.js.html b/docs/backend_api/entities_recent_note.js.html index f32e3233b..f71776f20 100644 --- a/docs/backend_api/entities_recent_note.js.html +++ b/docs/backend_api/entities_recent_note.js.html @@ -37,22 +37,22 @@ const dateUtils = require('../services/date_utils'); * @param {string} branchId * @param {string} notePath * @param {boolean} isDeleted - * @param {string} dateModified + * @param {string} utcDateModified * * @extends Entity */ class RecentNote extends Entity { static get entityName() { return "recent_notes"; } static get primaryKeyName() { return "branchId"; } - static get hashedProperties() { return ["branchId", "notePath", "dateCreated", "isDeleted"]; } + static get hashedProperties() { return ["branchId", "notePath", "utcDateCreated", "isDeleted"]; } beforeSaving() { if (!this.isDeleted) { this.isDeleted = false; } - if (!this.dateCreated) { - this.dateCreated = dateUtils.nowDate(); + if (!this.utcDateCreated) { + this.utcDateCreated = dateUtils.utcNowDateTime(); } super.beforeSaving(); diff --git a/docs/backend_api/services_backend_script_api.js.html b/docs/backend_api/services_backend_script_api.js.html index 3f03e361f..5432ef685 100644 --- a/docs/backend_api/services_backend_script_api.js.html +++ b/docs/backend_api/services_backend_script_api.js.html @@ -37,6 +37,7 @@ const treeService = require('./tree'); const config = require('./config'); const repository = require('./repository'); const axios = require('axios'); +const dayjs = require('dayjs'); const cloningService = require('./cloning'); const messagingService = require('./messaging'); const appInfo = require('./app_info'); @@ -50,7 +51,7 @@ const appInfo = require('./app_info'); function BackendScriptApi(currentNote, apiParams) { /** @property {Note} note where script started executing */ this.startNote = apiParams.startNote; - /** @property {Note} note where script is currently executing */ + /** @property {Note} 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; @@ -60,11 +61,10 @@ function BackendScriptApi(currentNote, apiParams) { } this.axios = axios; + this.dayjs = dayjs; this.utils = { - unescapeHtml: utils.unescapeHtml, - isoDateTimeStr: dateUtils.dateStr, - isoDateStr: date => dateUtils.dateStr(date).substr(0, 10) + unescapeHtml: utils.unescapeHtml }; /** diff --git a/docs/frontend_api/NoteFull.html b/docs/frontend_api/NoteFull.html index a347542f1..e745fc962 100644 --- a/docs/frontend_api/NoteFull.html +++ b/docs/frontend_api/NoteFull.html @@ -141,122 +141,6 @@ -

dateCreated

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

dateModified

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

noteContent

@@ -314,6 +198,122 @@ + +

utcDateCreated

+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

utcDateModified

+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + diff --git a/docs/frontend_api/entities_attribute.js.html b/docs/frontend_api/entities_attribute.js.html index 1a6ed291d..6dfec708d 100644 --- a/docs/frontend_api/entities_attribute.js.html +++ b/docs/frontend_api/entities_attribute.js.html @@ -45,10 +45,10 @@ this.isInheritable = row.isInheritable; /** @param {boolean} isDeleted */ this.isDeleted = row.isDeleted; - /** @param {string} dateCreated */ - this.dateCreated = row.dateCreated; - /** @param {string} dateModified */ - this.dateModified = row.dateModified; + /** @param {string} utcDateCreated */ + this.utcDateCreated = row.utcDateCreated; + /** @param {string} utcDateModified */ + this.utcDateModified = row.utcDateModified; } /** @returns {NoteShort} */ diff --git a/docs/frontend_api/entities_note_full.js.html b/docs/frontend_api/entities_note_full.js.html index deeeab5f2..0019ba967 100644 --- a/docs/frontend_api/entities_note_full.js.html +++ b/docs/frontend_api/entities_note_full.js.html @@ -39,10 +39,10 @@ class NoteFull extends NoteShort { this.noteContent = row.noteContent; /** @param {string} */ - this.dateCreated = row.dateCreated; + this.utcDateCreated = row.utcDateCreated; /** @param {string} */ - this.dateModified = row.dateModified; + this.utcDateModified = row.utcDateModified; } } diff --git a/docs/frontend_api/services_frontend_script_api.js.html b/docs/frontend_api/services_frontend_script_api.js.html index 7d8adbce9..860717d74 100644 --- a/docs/frontend_api/services_frontend_script_api.js.html +++ b/docs/frontend_api/services_frontend_script_api.js.html @@ -230,13 +230,13 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null) { * @method * @returns {string} content of active note (loaded into right pane) */ - this.getActiveNoteContent = noteDetailService.getCurrentNoteContent; + this.getActiveNoteContent = noteDetailService.getActiveNoteContent; /** * @method * @returns {NoteFull} active note (loaded into right pane) */ - this.getActiveNote = noteDetailService.getCurrentNote; + this.getActiveNote = noteDetailService.getActiveNote; /** * This method checks whether user navigated away from the note from which the scripts has been started. @@ -248,7 +248,7 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null) { * @return {boolean} returns true if the original note is still loaded, false if user switched to another */ this.isNoteStillActive = () => { - return this.originEntity.noteId === noteDetailService.getCurrentNoteId(); + return this.originEntity.noteId === noteDetailService.getActiveNoteId(); }; /** diff --git a/src/services/backend_script_api.js b/src/services/backend_script_api.js index a172980b8..54c64d5c6 100644 --- a/src/services/backend_script_api.js +++ b/src/services/backend_script_api.js @@ -9,6 +9,7 @@ const treeService = require('./tree'); const config = require('./config'); const repository = require('./repository'); const axios = require('axios'); +const dayjs = require('dayjs'); const cloningService = require('./cloning'); const messagingService = require('./messaging'); const appInfo = require('./app_info'); @@ -32,11 +33,10 @@ function BackendScriptApi(currentNote, apiParams) { } this.axios = axios; + this.dayjs = dayjs; this.utils = { - unescapeHtml: utils.unescapeHtml, - isoDateTimeStr: dateUtils.utcDateStr, - isoDateStr: date => dateUtils.utcDateStr(date).substr(0, 10) + unescapeHtml: utils.unescapeHtml }; /**