Files
Automata/packages/cli/src/databases/repositories/executionData.repository.ts

20 lines
564 B
TypeScript

import { Service } from 'typedi';
import { DataSource, In, Repository } from 'typeorm';
import { ExecutionData } from '../entities/ExecutionData';
@Service()
export class ExecutionDataRepository extends Repository<ExecutionData> {
constructor(dataSource: DataSource) {
super(ExecutionData, dataSource.manager);
}
async findByExecutionIds(executionIds: string[]) {
return this.find({
select: ['workflowData'],
where: {
executionId: In(executionIds),
},
}).then((executionData) => executionData.map(({ workflowData }) => workflowData));
}
}