mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-06-02 19:55:18 +02:00
refactor(automations): vertical-slice actions and triggers by domain
This commit is contained in:
parent
ce45e11009
commit
8c32455818
24 changed files with 86 additions and 108 deletions
|
|
@ -0,0 +1,10 @@
|
|||
"""``manual`` trigger: fired by a user clicking ``Run now``."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from .params import ManualTriggerParams
|
||||
|
||||
__all__ = ["ManualTriggerParams"]
|
||||
|
||||
# Side-effect: register on the triggers store.
|
||||
from . import definition # noqa: E402, F401
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
"""``manual`` ``TriggerDefinition`` registration."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from ..store import register_trigger
|
||||
from ..types import TriggerDefinition
|
||||
from .params import ManualTriggerParams
|
||||
|
||||
MANUAL_TRIGGER = TriggerDefinition(
|
||||
type="manual",
|
||||
description="Fire on a user-initiated 'Run now' invocation.",
|
||||
params_schema=ManualTriggerParams.model_json_schema(),
|
||||
payload_schema={"type": "object"},
|
||||
)
|
||||
|
||||
register_trigger(MANUAL_TRIGGER)
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
"""``ManualTriggerParams`` — params for the ``manual`` trigger (empty in v1)."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
|
||||
|
||||
class ManualTriggerParams(BaseModel):
|
||||
model_config = ConfigDict(extra="forbid")
|
||||
Loading…
Add table
Add a link
Reference in a new issue