mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
server-ts: Port services/search/expressions/relation_where
This commit is contained in:
parent
0f7f0ceedc
commit
f5b690d088
@ -1,18 +1,22 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
const Expression = require('./expression');
|
import Expression = require('./expression');
|
||||||
const NoteSet = require('../note_set');
|
import NoteSet = require('../note_set');
|
||||||
const becca = require('../../../becca/becca');
|
import becca = require('../../../becca/becca');
|
||||||
|
import SearchContext = require('../search_context');
|
||||||
|
|
||||||
class RelationWhereExp extends Expression {
|
class RelationWhereExp extends Expression {
|
||||||
constructor(relationName, subExpression) {
|
private relationName: string;
|
||||||
|
private subExpression: Expression;
|
||||||
|
|
||||||
|
constructor(relationName: string, subExpression: Expression) {
|
||||||
super();
|
super();
|
||||||
|
|
||||||
this.relationName = relationName;
|
this.relationName = relationName;
|
||||||
this.subExpression = subExpression;
|
this.subExpression = subExpression;
|
||||||
}
|
}
|
||||||
|
|
||||||
execute(inputNoteSet, executionContext, searchContext) {
|
execute(inputNoteSet: NoteSet, executionContext: {}, searchContext: SearchContext) {
|
||||||
const candidateNoteSet = new NoteSet();
|
const candidateNoteSet = new NoteSet();
|
||||||
|
|
||||||
for (const attr of becca.findAttributes('relation', this.relationName)) {
|
for (const attr of becca.findAttributes('relation', this.relationName)) {
|
||||||
@ -38,4 +42,4 @@ class RelationWhereExp extends Expression {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = RelationWhereExp;
|
export = RelationWhereExp;
|
@ -7,7 +7,7 @@ const NotExp = require('../expressions/not');
|
|||||||
const ChildOfExp = require('../expressions/child_of');
|
const ChildOfExp = require('../expressions/child_of');
|
||||||
const DescendantOfExp = require('../expressions/descendant_of');
|
const DescendantOfExp = require('../expressions/descendant_of');
|
||||||
const ParentOfExp = require('../expressions/parent_of');
|
const ParentOfExp = require('../expressions/parent_of');
|
||||||
const RelationWhereExp = require('../expressions/relation_where.js');
|
const RelationWhereExp = require('../expressions/relation_where');
|
||||||
const PropertyComparisonExp = require('../expressions/property_comparison.js');
|
const PropertyComparisonExp = require('../expressions/property_comparison.js');
|
||||||
const AttributeExistsExp = require('../expressions/attribute_exists');
|
const AttributeExistsExp = require('../expressions/attribute_exists');
|
||||||
const LabelComparisonExp = require('../expressions/label_comparison');
|
const LabelComparisonExp = require('../expressions/label_comparison');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user