feat: Add REST API for Functions CRUD operations #2091
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR implements a comprehensive REST API for Functions with full CRUD operations, following the same patterns as existing controllers (SinkConsumer, HttpEndpoint).
Changes
Backend Implementation
from_external_function/1for input parsingupdate_function/3/api/functionsroutesAPI Endpoints
Function Types Supported
Features
Tests
Documentation
Code Quality
mix formatmix compile --warnings-as-errorspassesTesting
All tests pass:
Test the API manually:
Example Usage
Create a filter function:
List all functions:
Files Changed
New Files (8):
lib/sequin_web/controllers/function_controller.exlib/sequin_web/controllers/function_json.extest/sequin_web/controllers/function_controller_test.exsdocs/management-api/functions/create.mdxdocs/management-api/functions/list.mdxdocs/management-api/functions/get.mdxdocs/management-api/functions/update.mdxdocs/management-api/functions/delete.mdxModified Files (5):
lib/sequin/transforms/transforms.exlib/sequin/consumers/consumers.exlib/sequin/consumers/function.exlib/sequin_web/router.exdocs/docs.jsonChecklist
🤖 Generated with Claude Code
Co-Authored-By: Claude noreply@anthropic.com