feat: Implement telemetry for created and updated flows
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
import { ValidationError } from 'objection';
|
||||
import type { ModelOptions } from 'objection';
|
||||
import type { ModelOptions, QueryContext } from 'objection';
|
||||
import Base from './base';
|
||||
import Step from './step';
|
||||
import Execution from './execution';
|
||||
import Telemetry from '../helpers/telemetry';
|
||||
|
||||
class Flow extends Base {
|
||||
id!: string;
|
||||
@@ -71,6 +72,16 @@ class Flow extends Base {
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
async $afterInsert(queryContext: QueryContext) {
|
||||
await super.$afterInsert(queryContext);
|
||||
Telemetry.flowCreated(this);
|
||||
}
|
||||
|
||||
async $afterUpdate(opt: ModelOptions, queryContext: QueryContext) {
|
||||
await super.$afterUpdate(opt, queryContext);
|
||||
Telemetry.flowUpdated(this);
|
||||
}
|
||||
}
|
||||
|
||||
export default Flow;
|
||||
|
Reference in New Issue
Block a user