@@ -698,7 +698,7 @@ export interface CallableOptions {
698
698
export function onCallHandler < Req = any , Res = any > (
699
699
options : CallableOptions ,
700
700
handler : v1CallableHandler | v2CallableHandler < Req , Res > ,
701
- version : "v1 " | "v2 "
701
+ version : "gcfv1 " | "gcfv2 "
702
702
) : ( req : Request , res : express . Response ) => Promise < void > {
703
703
const wrapped = wrapOnCallHandler ( options , handler , version ) ;
704
704
return ( req : Request , res : express . Response ) => {
@@ -719,7 +719,7 @@ function encodeSSE(data: unknown): string {
719
719
function wrapOnCallHandler < Req = any , Res = any > (
720
720
options : CallableOptions ,
721
721
handler : v1CallableHandler | v2CallableHandler < Req , Res > ,
722
- version : "v1 " | "v2 "
722
+ version : "gcfv1 " | "gcfv2 "
723
723
) : ( req : Request , res : express . Response ) => Promise < void > {
724
724
return async ( req : Request , res : express . Response ) : Promise < void > => {
725
725
try {
@@ -737,7 +737,7 @@ function wrapOnCallHandler<Req = any, Res = any>(
737
737
// The original monkey-patched code lived in the functionsEmulatorRuntime
738
738
// (link: https://github.com/firebase/firebase-tools/blob/accea7abda3cc9fa6bb91368e4895faf95281c60/src/emulator/functionsEmulatorRuntime.ts#L480)
739
739
// 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 " ) {
741
741
const authContext = context . rawRequest . header ( CALLABLE_AUTH_HEADER ) ;
742
742
if ( authContext ) {
743
743
logger . debug ( "Callable functions auth override" , {
@@ -784,7 +784,7 @@ function wrapOnCallHandler<Req = any, Res = any>(
784
784
const acceptsStreaming = req . header ( "accept" ) === "text/event-stream" ;
785
785
const data : Req = decode ( req . body . data ) ;
786
786
let result : Res ;
787
- if ( version === "v1 " ) {
787
+ if ( version === "gcfv1 " ) {
788
788
result = await ( handler as v1CallableHandler ) ( data , context ) ;
789
789
} else {
790
790
const arg : CallableRequest < Req > = {
0 commit comments