Files
Agent-n8n/n8n-n8n-1.109.2/packages/@n8n/db/src/repositories/webhook.repository.ts
2025-09-08 04:48:28 +08:00

20 lines
598 B
TypeScript
Executable File

import { Service } from '@n8n/di';
import { DataSource, IsNull, Repository } from '@n8n/typeorm';
import { WebhookEntity } from '../entities';
@Service()
export class WebhookRepository extends Repository<WebhookEntity> {
constructor(dataSource: DataSource) {
super(WebhookEntity, dataSource.manager);
}
/**
* Retrieve all webhooks whose paths only have static segments, e.g. `{uuid}` or `user/profile`.
* This excludes webhooks having paths with dynamic segments, e.g. `{uuid}/user/:id/posts`.
*/
async getStaticWebhooks() {
return await this.findBy({ webhookId: IsNull() });
}
}