mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-31 19:45:15 +02:00
feat(automations): add event trigger params
This commit is contained in:
parent
6fa2e52361
commit
f09e302d4f
4 changed files with 63 additions and 0 deletions
|
|
@ -0,0 +1,23 @@
|
|||
"""``EventTriggerParams`` — params for the ``event`` trigger type."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field
|
||||
|
||||
|
||||
class EventTriggerParams(BaseModel):
|
||||
model_config = ConfigDict(extra="forbid")
|
||||
|
||||
event_type: str = Field(
|
||||
...,
|
||||
min_length=1,
|
||||
description="Event type to listen for.",
|
||||
examples=["document.indexed"],
|
||||
)
|
||||
filter: dict[str, Any] = Field(
|
||||
default_factory=dict,
|
||||
description="JSON filter matched against the event payload.",
|
||||
examples=[{"document_type": "FILE"}],
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue