(ctx context.Context, raw json.RawMessage)
| 1762 | } |
| 1763 | |
| 1764 | func (h *HostAPIHandler) handleAutomationTriggersFire(ctx context.Context, raw json.RawMessage) (any, error) { |
| 1765 | automation, err := h.automationManager() |
| 1766 | if err != nil { |
| 1767 | return nil, err |
| 1768 | } |
| 1769 | |
| 1770 | var params hostAPIAutomationTriggerFireParams |
| 1771 | if err := decodeHostAPIParams(raw, ¶ms); err != nil { |
| 1772 | return nil, err |
| 1773 | } |
| 1774 | |
| 1775 | workspaceID, err := h.resolveAutomationWorkspaceID(ctx, params.WorkspaceID) |
| 1776 | if err != nil { |
| 1777 | return nil, err |
| 1778 | } |
| 1779 | |
| 1780 | request := automationpkg.ExtensionTriggerRequest{ |
| 1781 | Event: strings.TrimSpace(params.Event), |
| 1782 | Scope: params.Scope, |
| 1783 | WorkspaceID: workspaceID, |
| 1784 | Payload: cloneJSONMap(params.Payload), |
| 1785 | } |
| 1786 | if err := request.Validate("trigger_fire"); err != nil { |
| 1787 | return nil, invalidParamsRPCError(err) |
| 1788 | } |
| 1789 | |
| 1790 | return automation.FireExtensionTrigger(ctx, request) |
| 1791 | } |
| 1792 | |
| 1793 | func (h *HostAPIHandler) handleAutomationRuns(ctx context.Context, raw json.RawMessage) (any, error) { |
| 1794 | automation, err := h.automationManager() |
nothing calls this directly
no test coverage detected