mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -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 { getStatusUsingPreviousExecutionStatusMethod } from './executionHelpers';
|
||||||
import { ExecutionMetadata } from '@/databases/entities/ExecutionMetadata';
|
import { ExecutionMetadata } from '@/databases/entities/ExecutionMetadata';
|
||||||
import { DateUtils } from 'typeorm/util/DateUtils';
|
import { DateUtils } from 'typeorm/util/DateUtils';
|
||||||
|
import type { TagEntity } from '@db/entities/TagEntity';
|
||||||
|
|
||||||
interface IGetExecutionsQueryFilter {
|
interface IGetExecutionsQueryFilter {
|
||||||
id?: FindOperator<string> | string;
|
id?: FindOperator<string> | string;
|
||||||
|
@ -52,6 +53,7 @@ interface IGetExecutionsQueryFilter {
|
||||||
metadata?: Array<{ key: string; value: string }>;
|
metadata?: Array<{ key: string; value: string }>;
|
||||||
startedAfter?: string;
|
startedAfter?: string;
|
||||||
startedBefore?: string;
|
startedBefore?: string;
|
||||||
|
tags?: Array<TagEntity['id']>;
|
||||||
}
|
}
|
||||||
|
|
||||||
const schemaGetExecutionsQueryFilter = {
|
const schemaGetExecutionsQueryFilter = {
|
||||||
|
@ -72,6 +74,7 @@ const schemaGetExecutionsQueryFilter = {
|
||||||
metadata: { type: 'array', items: { $ref: '#/$defs/metadata' } },
|
metadata: { type: 'array', items: { $ref: '#/$defs/metadata' } },
|
||||||
startedAfter: { type: 'date-time' },
|
startedAfter: { type: 'date-time' },
|
||||||
startedBefore: { type: 'date-time' },
|
startedBefore: { type: 'date-time' },
|
||||||
|
tags: { type: 'array', items: { type: 'string' } },
|
||||||
},
|
},
|
||||||
$defs: {
|
$defs: {
|
||||||
metadata: {
|
metadata: {
|
||||||
|
@ -194,6 +197,10 @@ export class ExecutionsService {
|
||||||
if ('startedBefore' in filter) {
|
if ('startedBefore' in filter) {
|
||||||
delete filter.startedBefore;
|
delete filter.startedBefore;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ('tags' in filter) {
|
||||||
|
delete filter.tags;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue