mirror of
https://github.com/zadam/trilium.git
synced 2025-11-06 21:36:05 +01:00
custom HTTP handler which triggers associated script notes WIP, #356
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
const utils = require('./utils');
|
||||
const BackendScriptApi = require('./backend_script_api');
|
||||
|
||||
function ScriptContext(startNote, allNotes, originEntity = null) {
|
||||
function ScriptContext(allNotes, apiParams = {}) {
|
||||
this.modules = {};
|
||||
this.notes = utils.toObject(allNotes, note => [note.noteId, note]);
|
||||
this.apis = utils.toObject(allNotes, note => [note.noteId, new BackendScriptApi(startNote, note, originEntity)]);
|
||||
this.apis = utils.toObject(allNotes, note => [note.noteId, new BackendScriptApi(note, apiParams)]);
|
||||
this.require = moduleNoteIds => {
|
||||
return moduleName => {
|
||||
const candidates = allNotes.filter(note => moduleNoteIds.includes(note.noteId));
|
||||
|
||||
Reference in New Issue
Block a user