@@ -698,7 +698,7 @@ export interface CallableOptions {
698698export function onCallHandler < Req = any , Res = any > (
699699 options : CallableOptions ,
700700 handler : v1CallableHandler | v2CallableHandler < Req , Res > ,
701- version : "v1 " | "v2 "
701+ version : "gcfv1 " | "gcfv2 "
702702) : ( req : Request , res : express . Response ) => Promise < void > {
703703 const wrapped = wrapOnCallHandler ( options , handler , version ) ;
704704 return ( req : Request , res : express . Response ) => {
@@ -719,7 +719,7 @@ function encodeSSE(data: unknown): string {
719719function wrapOnCallHandler < Req = any , Res = any > (
720720 options : CallableOptions ,
721721 handler : v1CallableHandler | v2CallableHandler < Req , Res > ,
722- version : "v1 " | "v2 "
722+ version : "gcfv1 " | "gcfv2 "
723723) : ( req : Request , res : express . Response ) => Promise < void > {
724724 return async ( req : Request , res : express . Response ) : Promise < void > => {
725725 try {
@@ -737,7 +737,7 @@ function wrapOnCallHandler<Req = any, Res = any>(
737737 // The original monkey-patched code lived in the functionsEmulatorRuntime
738738 // (link: https://github.com/firebase/firebase-tools/blob/accea7abda3cc9fa6bb91368e4895faf95281c60/src/emulator/functionsEmulatorRuntime.ts#L480)
739739 // and was not compatible with how monorepos separate out packages (see https://github.com/firebase/firebase-tools/issues/5210).
740- if ( isDebugFeatureEnabled ( "skipTokenVerification" ) && version === "v1 " ) {
740+ if ( isDebugFeatureEnabled ( "skipTokenVerification" ) && version === "gcfv1 " ) {
741741 const authContext = context . rawRequest . header ( CALLABLE_AUTH_HEADER ) ;
742742 if ( authContext ) {
743743 logger . debug ( "Callable functions auth override" , {
@@ -784,7 +784,7 @@ function wrapOnCallHandler<Req = any, Res = any>(
784784 const acceptsStreaming = req . header ( "accept" ) === "text/event-stream" ;
785785 const data : Req = decode ( req . body . data ) ;
786786 let result : Res ;
787- if ( version === "v1 " ) {
787+ if ( version === "gcfv1 " ) {
788788 result = await ( handler as v1CallableHandler ) ( data , context ) ;
789789 } else {
790790 const arg : CallableRequest < Req > = {
0 commit comments