Merge branch 'main' into issue-553

This commit is contained in:
Ömer Faruk Aydın
2022-10-14 22:36:45 +02:00
committed by GitHub
41 changed files with 889 additions and 587 deletions

View File

@@ -13,6 +13,7 @@ class Flow extends Base {
active: boolean;
steps: Step[];
published_at: string;
executions?: Execution[];
static tableName = 'flows';
@@ -58,6 +59,15 @@ class Flow extends Base {
return lastExecution ? (lastExecution as Execution).internalId : null;
}
async lastInternalIds(itemCount = 50) {
const lastExecutions = await this.$relatedQuery('executions')
.select('internal_id')
.orderBy('created_at', 'desc')
.limit(itemCount);
return lastExecutions.map((execution) => execution.internalId);
}
async $beforeUpdate(
opt: ModelOptions,
queryContext: QueryContext