FunctionFile

A single source file belonging to a function version. A function version captures the full file set at the moment it was saved; the run worker materialises these into a Worker Loader bundle on demand and compiles TS/JS sources in-isolate via `@cloudflare/worker-bundler`. Files reference only `versionId`; reach the function via `functionVersion.functionId`.

Definition

TypeScript
interface FunctionFile {
  id: string;
  versionId: string;
  name: string;
  source: string;
  createdAt: string;
}

Fields

FieldTypeNotes
idstringreadonly required
versionIdstringrequired — Function version this file belongs to.
namestringrequired — Logical file name within the function's source tree (e.g. index.ts, package.json, lib/util.ts).
sourcestringrequired — Raw file contents.
createdAtstringreadonly required — ISO-8601 timestamp of creation.