mirror of
				https://github.com/zadam/trilium.git
				synced 2025-11-04 05:28:59 +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";
 | 
			
		||||
 | 
			
		||||
const Expression = require('./expression');
 | 
			
		||||
const NoteSet = require('../note_set');
 | 
			
		||||
const becca = require('../../../becca/becca');
 | 
			
		||||
import Expression = require('./expression');
 | 
			
		||||
import NoteSet = require('../note_set');
 | 
			
		||||
import becca = require('../../../becca/becca');
 | 
			
		||||
import SearchContext = require('../search_context');
 | 
			
		||||
 | 
			
		||||
class RelationWhereExp extends Expression {
 | 
			
		||||
    constructor(relationName, subExpression) {
 | 
			
		||||
    private relationName: string;
 | 
			
		||||
    private subExpression: Expression;
 | 
			
		||||
 | 
			
		||||
    constructor(relationName: string, subExpression: Expression) {
 | 
			
		||||
        super();
 | 
			
		||||
 | 
			
		||||
        this.relationName = relationName;
 | 
			
		||||
        this.subExpression = subExpression;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    execute(inputNoteSet, executionContext, searchContext) {
 | 
			
		||||
    execute(inputNoteSet: NoteSet, executionContext: {}, searchContext: SearchContext) {
 | 
			
		||||
        const candidateNoteSet = new NoteSet();
 | 
			
		||||
 | 
			
		||||
        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 DescendantOfExp = require('../expressions/descendant_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 AttributeExistsExp = require('../expressions/attribute_exists');
 | 
			
		||||
const LabelComparisonExp = require('../expressions/label_comparison');
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user