diff --git a/src/manifest.ts b/src/manifest.ts index 06cddc406..1549170ef 100644 --- a/src/manifest.ts +++ b/src/manifest.ts @@ -7,6 +7,7 @@ import type { FunctionResult } from './utils/format_result.js' import type { Route } from './utils/routes.js' interface ManifestFunction { + buildData?: Record invocationMode?: InvocationMode mainFile: string name: string @@ -55,6 +56,7 @@ const formatFunctionForManifest = ({ routes, runtime, runtimeVersion, + runtimeAPIVersion, schedule, }: FunctionResult): ManifestFunction => { const manifestFunction: ManifestFunction = { @@ -62,6 +64,7 @@ const formatFunctionForManifest = ({ displayName, generator, invocationMode, + buildData: { runtimeAPIVersion }, mainFile, name, runtimeVersion, diff --git a/tests/v2api.test.ts b/tests/v2api.test.ts index 237527e88..274ed8bf9 100644 --- a/tests/v2api.test.ts +++ b/tests/v2api.test.ts @@ -217,7 +217,7 @@ describe.runIf(semver.gte(nodeVersion, '18.13.0'))('V2 functions API', () => { }, }) - expect.assertions(files.length + 1) + expect.assertions(files.length + 2) for (const file of files) { switch (file.name) { @@ -256,6 +256,7 @@ describe.runIf(semver.gte(nodeVersion, '18.13.0'))('V2 functions API', () => { const manifestString = await readFile(manifestPath, { encoding: 'utf8' }) const manifest = JSON.parse(manifestString) expect(manifest.functions[0].routes[0].methods).toEqual(['GET', 'POST']) + expect(manifest.functions[0].buildData.runtimeAPIVersion).toEqual(2) }) test('Flags invalid values of the `path` in-source configuration property as user errors', async () => {