mirror of
https://github.com/langbot-app/LangBot.git
synced 2025-11-25 19:37:36 +08:00
* Initial plan * Backend: Add webhook persistence model, service, API endpoints and message push functionality Co-authored-by: RockChinQ <45992437+RockChinQ@users.noreply.github.com> * Frontend: Rename API Keys to API Integration, add webhook management UI with tabs Co-authored-by: RockChinQ <45992437+RockChinQ@users.noreply.github.com> * Fix frontend linting issues and formatting Co-authored-by: RockChinQ <45992437+RockChinQ@users.noreply.github.com> * chore: perf ui in api integration dialog * perf: webhook data pack structure --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: RockChinQ <45992437+RockChinQ@users.noreply.github.com> Co-authored-by: Junyan Qin <rockchinq@gmail.com>
23 lines
842 B
Python
23 lines
842 B
Python
import sqlalchemy
|
|
|
|
from .base import Base
|
|
|
|
|
|
class Webhook(Base):
|
|
"""Webhook for pushing bot events to external systems"""
|
|
|
|
__tablename__ = 'webhooks'
|
|
|
|
id = sqlalchemy.Column(sqlalchemy.Integer, primary_key=True, autoincrement=True)
|
|
name = sqlalchemy.Column(sqlalchemy.String(255), nullable=False)
|
|
url = sqlalchemy.Column(sqlalchemy.String(1024), nullable=False)
|
|
description = sqlalchemy.Column(sqlalchemy.String(512), nullable=True, default='')
|
|
enabled = sqlalchemy.Column(sqlalchemy.Boolean, nullable=False, default=True)
|
|
created_at = sqlalchemy.Column(sqlalchemy.DateTime, nullable=False, server_default=sqlalchemy.func.now())
|
|
updated_at = sqlalchemy.Column(
|
|
sqlalchemy.DateTime,
|
|
nullable=False,
|
|
server_default=sqlalchemy.func.now(),
|
|
onupdate=sqlalchemy.func.now(),
|
|
)
|