catalyst-functions
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseHow It Works
工作原理
-
Verify local scaffold — bothand
catalyst initsupport non-interactive mode (CLI v1.27.0+). Check whetherfunctions:addand.catalystrcexist. If missing, use MCP tools to get the org ID and project ID, then run:catalyst.jsonbashcatalyst init --org <orgId> -p <projectId> -niNever ask the user to runinteractively. NI mode can only link an existing project — if none exists, tell the user to create one in the console first. Once initialized, add functions non-interactively:catalyst initbashcatalyst functions:add --name <name> --type <type> --stack <stack> -ni # e.g. catalyst functions:add --name api --type aio --stack node20 -ni -
Identify the function type — Basic I/O for simple request/response, Advanced I/O for raw HTTP control, Event for trigger-based, Cron/Job for scheduled, Integration for Zoho service events, Browser Logic for Puppeteer.
-
Load— for the matching handler signature,
references/functions-basics.mdkeys, SDK init pattern, and CORS setup.catalyst-config.json -
Load— for file uploads (busboy), streaming responses, error handling, or chaining functions.
references/functions-advanced.md -
Load— for routing rules, rate limiting, or gateway-level CORS.
references/api-gateway.md -
Validate config — Confirmuses
catalyst-config.json+deploymentkeys only. Never useexecutionorfunction.entry_point
-
验证本地脚手架——和
catalyst init均支持非交互模式(CLI v1.27.0+)。 检查functions:add和.catalystrc是否存在。若缺失,请使用MCP工具获取组织ID和项目ID,然后运行:catalyst.jsonbashcatalyst init --org <orgId> -p <projectId> -ni切勿要求用户以交互模式运行。非交互模式仅能关联现有项目——若没有现有项目,请告知用户先在控制台创建一个。初始化完成后,以非交互模式添加函数:catalyst initbashcatalyst functions:add --name <name> --type <type> --stack <stack> -ni # 示例:catalyst functions:add --name api --type aio --stack node20 -ni -
识别函数类型——Basic I/O用于简单请求/响应,Advanced I/O用于原始HTTP控制,Event用于基于触发器的场景,Cron/Job用于定时任务,Integration用于Zoho服务事件,Browser Logic用于Puppeteer。
-
加载——获取匹配的处理程序签名、
references/functions-basics.md键、SDK初始化模式及CORS设置。catalyst-config.json -
加载——获取文件上传(busboy)、流式响应、错误处理或函数链式调用相关内容。
references/functions-advanced.md -
加载——获取路由规则、速率限制或网关级CORS相关内容。
references/api-gateway.md -
验证配置——确认仅使用
catalyst-config.json和deployment键。切勿使用execution或function。entry_point
Security Checklist
安全检查清单
- Functions are publicly accessible by default. Security Rules sets to
authenticationwhen a function is created — its URL is globally accessible to everyone with no restrictions. Setoptionalin the Security Rules JSON for any function that reads or writes user data or sensitive resources."authentication": "required" - API Gateway replaces Security Rules — do not use both. Enabling API Gateway automatically disables Security Rules. Pick one auth/routing layer per function.
- 函数默认公开可访问。创建函数时,Security Rules会将设置为
authentication——其URL对所有人全局开放,无任何限制。对于任何读取或写入用户数据或敏感资源的函数,请在Security Rules JSON中设置optional。"authentication": "required" - API网关会替代Security Rules——请勿同时使用两者。启用API网关会自动禁用Security Rules。每个函数仅选择一个认证/路由层。
Triggers
触发场景
Use this skill for: "write a function", "catalyst function", "Basic I/O", "Advanced I/O", "Event function", "Cron function", "Browser Logic", , "function handler", "API Gateway", "rate limiting", "busboy", "file upload in function", , , "function CORS", or any function type or function configuration question.
catalyst-config.jsoncatalyst deploy --only functions:<function-name>catalyst functions:addDeployment command note:
- Use to deploy one function (where
catalyst deploy --only functions:<function-name>targets the function by its folder name).functions:<name> - Use to deploy all functions at once.
catalyst deploy --only functions
当查询内容为以下情况时使用本技能:"write a function"、"catalyst function"、"Basic I/O"、"Advanced I/O"、"Event function"、"Cron function"、"Browser Logic"、、"function handler"、"API Gateway"、"rate limiting"、"busboy"、"file upload in function"、、、"function CORS"或任何函数类型或函数配置相关问题。
catalyst-config.jsoncatalyst deploy --only functions:<function-name>catalyst functions:add部署命令说明:
- 使用部署单个函数(其中
catalyst deploy --only functions:<function-name>通过文件夹名称定位目标函数)。functions:<name> - 使用一次性部署所有函数。
catalyst deploy --only functions
References
参考文档
| Reference | Load when the query is about… |
|---|---|
| Start here for any function question. Function type selection, Basic I/O and Advanced I/O handler signatures, |
| Advanced I/O patterns only. Express vs raw-http template differences, file uploads (busboy), streaming files from Stratus, error handling patterns, CORS for local dev, local testing, function chaining, ZCQL result unwrapping, HTTP payload limits |
| Event, Cron, Job, or Integration functions. Handler templates for all background/scheduled types, SDK component reference, retry behavior, cold start data, and the full common errors table |
| API Gateway config only. Enable/disable gateway, routing rules, rate limiting, CORS via gateway |
| 参考文档 | 适用查询场景… |
|---|---|
| 任何函数相关问题均从这里开始。函数类型选择、Basic I/O和Advanced I/O处理程序签名、 |
| 仅适用于Advanced I/O模式。Express与raw-http模板差异、文件上传(busboy)、从Stratus流式传输文件、错误处理模式、本地开发CORS、本地测试、函数链式调用、ZCQL结果解析、HTTP负载限制 |
| Event、Cron、Job或Integration函数。所有后台/定时类型的处理程序模板、SDK组件参考、重试机制、冷启动数据及完整的常见错误表 |
| 仅适用于API网关配置。启用/禁用网关、路由规则、速率限制、通过网关配置CORS |