feat: introduce singleton webhook URL
This commit is contained in:
@@ -18,6 +18,7 @@ class Flow extends Base {
|
||||
active: boolean;
|
||||
status: 'paused' | 'published' | 'draft';
|
||||
steps: Step[];
|
||||
triggerStep: Step;
|
||||
published_at: string;
|
||||
remoteWebhookId: string;
|
||||
executions?: Execution[];
|
||||
@@ -51,6 +52,20 @@ class Flow extends Base {
|
||||
builder.orderBy('position', 'asc');
|
||||
},
|
||||
},
|
||||
triggerStep: {
|
||||
relation: Base.HasOneRelation,
|
||||
modelClass: Step,
|
||||
join: {
|
||||
from: 'flows.id',
|
||||
to: 'steps.flow_id',
|
||||
},
|
||||
filter(builder: ExtendedQueryBuilder<Step>) {
|
||||
builder
|
||||
.where('type', 'trigger')
|
||||
.limit(1)
|
||||
.first();
|
||||
},
|
||||
},
|
||||
executions: {
|
||||
relation: Base.HasManyRelation,
|
||||
modelClass: Execution,
|
||||
|
Reference in New Issue
Block a user