(query: unknown)
| 1167 | } |
| 1168 | |
| 1169 | private async explainRuntimeQuery(query: unknown): Promise<TaskNotesRuntimeQueryExplainResult> { |
| 1170 | const execution = this.normalizeRuntimeQueryForExecution(query); |
| 1171 | if (!execution.validation.valid) { |
| 1172 | return { |
| 1173 | valid: false, |
| 1174 | issues: execution.validation.issues, |
| 1175 | warnings: execution.validation.warnings, |
| 1176 | notes: ["Query validation failed before execution."], |
| 1177 | }; |
| 1178 | } |
| 1179 | |
| 1180 | const result = await this.queryTasks(query as TaskNotesRuntimeTaskQuery); |
| 1181 | const notes: string[] = []; |
| 1182 | if (execution.normalized.sort.length > 1) { |
| 1183 | notes.push("Only the first sort is currently applied by the TaskNotes filter engine."); |
| 1184 | } |
| 1185 | if (execution.normalized.group.length > 1) { |
| 1186 | notes.push("Only the first group is currently applied by the TaskNotes filter engine."); |
| 1187 | } |
| 1188 | |
| 1189 | return { |
| 1190 | valid: true, |
| 1191 | query: result.query, |
| 1192 | issues: [], |
| 1193 | warnings: result.warnings ?? [], |
| 1194 | total: result.total, |
| 1195 | matched: result.matched, |
| 1196 | returned: result.returned, |
| 1197 | groups: result.groups, |
| 1198 | appliedSort: result.query.sort.slice(0, 1), |
| 1199 | appliedLimit: result.query.limit, |
| 1200 | appliedOffset: result.query.offset, |
| 1201 | notes, |
| 1202 | }; |
| 1203 | } |
| 1204 | |
| 1205 | private async getFilterOptions() { |
| 1206 | return this.plugin.filterService.getFilterOptions(); |
no test coverage detected