feat: add Planka service provider with full notification and command support
Webhook-based provider for Planka (self-hosted Kanban board) with: - 15 event types (cards, boards, lists, comments, tasks, attachments, labels) - Bearer token webhook authentication - Async API client for boards/cards/lists - 30 notification templates (en/ru) + 26 command templates (en/ru) - Bot commands: /status, /boards, /cards, /lists - Default tracking config, template config, command config seeded on startup - DB migration for 15 new tracking_config columns - Frontend: provider config UI with auto-name, Planka-specific hints - Frontend: tracking config event toggles for all 15 Planka events
This commit is contained in:
@@ -159,6 +159,32 @@ async def migrate_schema(engine: AsyncEngine) -> None:
|
||||
)
|
||||
logger.info("Added %s column to tracking_config table", col_name)
|
||||
|
||||
# Add Planka tracking flags to tracking_config if missing
|
||||
if await _has_table(conn, "tracking_config"):
|
||||
planka_flags = [
|
||||
("track_card_created", "INTEGER DEFAULT 1"),
|
||||
("track_card_updated", "INTEGER DEFAULT 0"),
|
||||
("track_card_moved", "INTEGER DEFAULT 1"),
|
||||
("track_card_deleted", "INTEGER DEFAULT 0"),
|
||||
("track_card_commented", "INTEGER DEFAULT 1"),
|
||||
("track_comment_updated", "INTEGER DEFAULT 0"),
|
||||
("track_board_created", "INTEGER DEFAULT 1"),
|
||||
("track_board_updated", "INTEGER DEFAULT 0"),
|
||||
("track_board_deleted", "INTEGER DEFAULT 1"),
|
||||
("track_list_created", "INTEGER DEFAULT 0"),
|
||||
("track_list_updated", "INTEGER DEFAULT 0"),
|
||||
("track_list_deleted", "INTEGER DEFAULT 0"),
|
||||
("track_attachment_created", "INTEGER DEFAULT 1"),
|
||||
("track_card_label_added", "INTEGER DEFAULT 0"),
|
||||
("track_task_completed", "INTEGER DEFAULT 1"),
|
||||
]
|
||||
for col_name, col_type in planka_flags:
|
||||
if not await _has_column(conn, "tracking_config", col_name):
|
||||
await conn.execute(
|
||||
text(f"ALTER TABLE tracking_config ADD COLUMN {col_name} {col_type}")
|
||||
)
|
||||
logger.info("Added %s column to tracking_config table", col_name)
|
||||
|
||||
# Add collection_name and shared to tracker_state if missing
|
||||
state_table = "notification_tracker_state" if await _has_table(conn, "notification_tracker_state") else "tracker_state"
|
||||
if await _has_table(conn, state_table):
|
||||
|
||||
Reference in New Issue
Block a user