mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-25 04:34:06 -08:00
feat(core): add 'tags' execution query filter
This commit is contained in:
parent
fbcb4bc8d9
commit
a7b968081c
|
@ -38,6 +38,7 @@ import { Container } from 'typedi';
|
|||
import { getStatusUsingPreviousExecutionStatusMethod } from './executionHelpers';
|
||||
import { ExecutionMetadata } from '@/databases/entities/ExecutionMetadata';
|
||||
import { DateUtils } from 'typeorm/util/DateUtils';
|
||||
import type { TagEntity } from '@db/entities/TagEntity';
|
||||
|
||||
interface IGetExecutionsQueryFilter {
|
||||
id?: FindOperator<string> | string;
|
||||
|
@ -52,6 +53,7 @@ interface IGetExecutionsQueryFilter {
|
|||
metadata?: Array<{ key: string; value: string }>;
|
||||
startedAfter?: string;
|
||||
startedBefore?: string;
|
||||
tags?: Array<TagEntity['id']>;
|
||||
}
|
||||
|
||||
const schemaGetExecutionsQueryFilter = {
|
||||
|
@ -72,6 +74,7 @@ const schemaGetExecutionsQueryFilter = {
|
|||
metadata: { type: 'array', items: { $ref: '#/$defs/metadata' } },
|
||||
startedAfter: { type: 'date-time' },
|
||||
startedBefore: { type: 'date-time' },
|
||||
tags: { type: 'array', items: { type: 'string' } },
|
||||
},
|
||||
$defs: {
|
||||
metadata: {
|
||||
|
@ -194,6 +197,10 @@ export class ExecutionsService {
|
|||
if ('startedBefore' in filter) {
|
||||
delete filter.startedBefore;
|
||||
}
|
||||
|
||||
if ('tags' in filter) {
|
||||
delete filter.tags;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue