Update function deploy handler contract text to fetch-style#81
Conversation
The Functions tag and createFunction operation descriptions said the handler exports a default async function receiving the email.received event. The actual runtime contract is a Workers-style fetch handler: the default export is an object with an async fetch(request, env) method, the gateway HMAC-verifies the POST against the org's webhook secret, and the request body parses to an email.received event. Update the OpenAPI source to match and regenerate the codegen artifacts.
Greptile SummaryThis PR corrects stale documentation in the OpenAPI spec and all generated downstream artifacts — no runtime behaviour changes. The Functions tag description and
Confidence Score: 5/5Safe to merge — every changed line is documentation text with no effect on runtime behaviour. All ten files are either the OpenAPI source or auto-generated artifacts. The only substantive edit is correcting two description strings in No files require special attention. Important Files Changed
Reviews (2): Last reviewed commit: "Merge branch 'main' into update-function..." | Re-trigger Greptile |
Summary
The Functions tag description and the createFunction operation description in the OpenAPI spec said the handler "exports a default async function receiving the `email.received` event." That described a different runtime contract than the one Functions actually run, and that mismatch surfaced as ambiguity for anyone reading the manifest while writing a handler.
The real contract is a Workers-style fetch handler:
This is what the scaffolder writes (`cli-node/src/oclif/commands/functions-init.ts`), what the `CreateFunctionInput.code` schema description already says (`Must export a default { async fetch(req, env, ctx) { ... } } object.`), and what the public docs describe. The Functions tag and createFunction `description` blocks were the stale outliers.
This PR updates the OpenAPI source (`openapi/primitive-api.yaml`) in two places and regenerates the downstream artifacts (`openapi/primitive-api.codegen.json`, Node SDK generated openapi + operations + sdk.gen, Python generated client, Go generated client/handlers/server).
No code paths change; this is documentation/manifest text only.
Test plan