apis

package
v1.3.21 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 31, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateFlowPayload

type CreateFlowPayload struct {
	Name        string                 `json:"name" example:"My Workflow"`
	TriggerType spider.FlowTriggerType `json:"trigger_type" example:"event"`
	Meta        map[string]string      `json:"meta,omitempty"`
	Actions     []WorkflowAction       `json:"actions"`
	Peers       []Peer                 `json:"peers"`
}

CreateFlowPayload represents the request body for creating a flow

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

func NewHandler

func NewHandler(usecase *usecase.Usecase) *Handler

func (*Handler) CreateFlow

func (h *Handler) CreateFlow(c *fiber.Ctx) error

CreateFlow godoc @Summary Create a new flow @Description Create a new workflow flow for a tenant @Tags flows @Accept json @Produce json @Param tenant_id path string true "Tenant ID" @Param payload body CreateFlowPayload true "Flow creation payload" @Success 200 {object} usecase.FlowResponse @Failure 400 {object} map[string]string @Failure 500 {object} map[string]string @Router /tenants/{tenant_id}/flows [post]

func (*Handler) DeleteFlow

func (h *Handler) DeleteFlow(c *fiber.Ctx) error

DeleteFlow godoc @Summary Delete a flow @Description Delete an existing flow @Tags flows @Param tenant_id path string true "Tenant ID" @Param flow_id path string true "Flow ID" @Success 204 @Failure 400 {object} map[string]string @Failure 500 {object} map[string]string @Router /tenants/{tenant_id}/flows/{flow_id} [delete]

func (*Handler) DisableAction

func (h *Handler) DisableAction(c *fiber.Ctx) error

DisableAction godoc @Summary Disable a workflow action @Description Disable a specific workflow action @Tags actions @Param tenant_id path string true "Tenant ID" @Param workflow_id path string true "Workflow ID" @Param key path string true "Action Key" @Success 200 @Failure 400 {object} map[string]string @Failure 500 {object} map[string]string @Router /tenants/{tenant_id}/workflows/{workflow_id}/actions/{key}/disable [post]

func (*Handler) GetFlow

func (h *Handler) GetFlow(c *fiber.Ctx) error

GetFlow godoc @Summary Get flow details @Description Get detailed information about a specific flow @Tags flows @Produce json @Param tenant_id path string true "Tenant ID" @Param id path string true "Flow ID" @Success 200 {object} usecase.FlowDetailResponse @Failure 400 {object} map[string]string @Failure 404 {object} map[string]string @Router /tenants/{tenant_id}/flows/{id} [get]

func (*Handler) ListFlows

func (h *Handler) ListFlows(c *fiber.Ctx) error

ListFlows godoc @Summary List flows @Description Get a paginated list of flows for a tenant @Tags flows @Produce json @Param tenant_id path string true "Tenant ID" @Param page query int false "Page number" default(1) @Param page_size query int false "Page size" default(20) @Success 200 {object} spider.FlowListResponse @Failure 400 {object} map[string]string @Failure 500 {object} map[string]string @Router /tenants/{tenant_id}/flows [get]

func (*Handler) UpdateFlow

func (h *Handler) UpdateFlow(c *fiber.Ctx) error

UpdateFlow godoc @Summary Update a flow @Description Update an existing flow's properties @Tags flows @Accept json @Produce json @Param tenant_id path string true "Tenant ID" @Param flow_id path string true "Flow ID" @Param payload body UpdateFlowPayload true "Flow update payload" @Success 200 {object} spider.Flow @Failure 400 {object} map[string]string @Failure 500 {object} map[string]string @Router /tenants/{tenant_id}/flows/{flow_id} [put]

type Peer

type Peer struct {
	ParentKey  string `json:"parent_key"`
	MetaOutput string `json:"meta_output"`
	ChildKey   string `json:"child_key"`
}

type UpdateActionPayload

type UpdateActionPayload struct {
	Config map[string]interface{}   `json:"config"`
	Mapper map[string]spider.Mapper `json:"mapper"`
	Meta   map[string]string        `json:"meta,omitempty"`
}

UpdateActionPayload represents the request body for updating an action

type UpdateFlowPayload

type UpdateFlowPayload struct {
	Name        string                 `json:"name" example:"Updated Workflow"`
	TriggerType spider.FlowTriggerType `json:"trigger_type" example:"schedule"`
	Meta        map[string]string      `json:"meta,omitempty"`
	Status      spider.FlowStatus      `json:"status" example:"active"`
}

UpdateFlowPayload represents the request body for updating a flow

type WorkflowAction

type WorkflowAction struct {
	Key      string                   `json:"key" example:"a1"`
	ActionID string                   `json:"action_id" example:"slack-action"`
	Config   map[string]interface{}   `json:"config"`
	Mapper   map[string]spider.Mapper `json:"mapper"`
	Meta     map[string]string        `json:"meta,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL