rename API .createNote() to .createNewNote() to allow future backwards compatibility

This commit is contained in:
zadam
2019-11-28 22:35:55 +01:00
parent 2953f1bdb8
commit 6c561b5764
5 changed files with 204 additions and 203 deletions

View File

@@ -178,7 +178,7 @@ function BackendScriptApi(currentNote, apiParams) {
*/
/**
* Create text note. See also createNote() for more options.
* Create text note. See also createNewNote() for more options.
*
* @param {string} parentNoteId
* @param {string} title
@@ -194,7 +194,7 @@ function BackendScriptApi(currentNote, apiParams) {
/**
* Create data note - data in this context means object serializable to JSON. Created note will be of type 'code' and
* JSON MIME type. See also createNote() for more options.
* JSON MIME type. See also createNewNote() for more options.
*
* @param {string} parentNoteId
* @param {string} title
@@ -210,7 +210,7 @@ function BackendScriptApi(currentNote, apiParams) {
});
/**
* @typedef {object} CreateNoteParams
* @typedef {object} CreateNewNoteParams
* @property {string} parentNoteId - MANDATORY
* @property {string} title - MANDATORY
* @property {string|buffer} content - MANDATORY
@@ -225,10 +225,10 @@ function BackendScriptApi(currentNote, apiParams) {
/**
* @method
*
* @param {CreateNoteParams} [params]
* @param {CreateNewNoteParams} [params]
* @returns {Promise<{note: Note, branch: Branch}>} object contains newly created entities note and branch
*/
this.createNote = noteService.createNewNote;
this.createNewNote = noteService.createNewNote;
/**
* Log given message to trilium logs.