removed deprecated API methods

This commit is contained in:
zadam
2023-02-15 23:45:25 +01:00
parent 4ffe36e4d0
commit 127486fdf5
4 changed files with 21 additions and 131 deletions

View File

@@ -38,18 +38,16 @@ function BackendScriptApi(currentNote, apiParams) {
this[key] = apiParams[key];
}
/** @property {axios} Axios library for HTTP requests. See {@link https://axios-http.com} for documentation */
/**
* @property {axios} Axios library for HTTP requests. See {@link https://axios-http.com} for documentation
* @deprecated use native (browser compatible) fetch() instead
*/
this.axios = axios;
/** @property {dayjs} day.js library for date manipulation. See {@link https://day.js.org} for documentation */
this.dayjs = dayjs;
/** @property {axios} xml2js library for XML parsing. See {@link https://github.com/Leonidas-from-XIV/node-xml2js} for documentation */
this.xml2js = xml2js;
// DEPRECATED - use direct api.unescapeHtml
this.utils = {
unescapeHtml: utils.unescapeHtml
};
/**
* Instance name identifies particular Trilium instance. It can be useful for scripts
* if some action needs to happen on only one specific instance.
@@ -315,17 +313,6 @@ function BackendScriptApi(currentNote, apiParams) {
*/
this.getRootCalendarNote = dateNoteService.getRootCalendarNote;
/**
* Returns day note for given date. If such note doesn't exist, it is created.
*
* @method
* @param {string} date in YYYY-MM-DD format
* @param {BNote} [rootNote] - specify calendar root note, normally leave empty to use the default calendar
* @returns {BNote|null}
* @deprecated use getDayNote instead
*/
this.getDateNote = dateNoteService.getDayNote;
/**
* Returns day note for given date. If such note doesn't exist, it is created.
*
@@ -377,14 +364,6 @@ function BackendScriptApi(currentNote, apiParams) {
*/
this.getYearNote = dateNoteService.getYearNote;
/**
* @method
* @deprecated use sortNotes instead
* @param {string} parentNoteId - this note's child notes will be sorted
* @returns {void}
*/
this.sortNotesByTitle = parentNoteId => treeService.sortNotes(parentNoteId);
/**
* Sort child notes of a given note.
*
@@ -457,15 +436,6 @@ function BackendScriptApi(currentNote, apiParams) {
*/
this.sql = sql;
/**
* @method
* @deprecated this is now no-op since all the changes should be gracefully handled per widget
* @returns {void}
*/
this.refreshTree = () => {
console.warn("api.refreshTree() is a NO-OP and can be removed from your script.")
};
/**
* @method
* @returns {{syncVersion, appVersion, buildRevision, dbVersion, dataDirectory, buildDate}|*} - object representing basic info about running Trilium version