@@ -28,6 +28,7 @@ import { apps } from '../apps';
2828import { HttpsFunction , optionsToTrigger , Runnable } from '../cloud-functions' ;
2929import { DeploymentOptions } from '../function-configuration' ;
3030
31+ /** @hidden */
3132export interface Request extends express . Request {
3233 rawBody : Buffer ;
3334}
@@ -127,6 +128,7 @@ export type FunctionsErrorCode =
127128 | 'data-loss'
128129 | 'unauthenticated' ;
129130
131+ /** @hidden */
130132export type CanonicalErrorCodeName =
131133 | 'OK'
132134 | 'CANCELLED'
@@ -146,6 +148,7 @@ export type CanonicalErrorCodeName =
146148 | 'UNAVAILABLE'
147149 | 'DATA_LOSS' ;
148150
151+ /** @hidden */
149152interface HttpErrorCode {
150153 canonicalName : CanonicalErrorCodeName ;
151154 status : number ;
@@ -180,6 +183,7 @@ const errorCodeMap: { [name in FunctionsErrorCode]: HttpErrorCode } = {
180183 'data-loss' : { canonicalName : 'DATA_LOSS' , status : 500 } ,
181184} ;
182185
186+ /** @hidden */
183187interface HttpErrorWireFormat {
184188 details ?: unknown ;
185189 message : string ;
@@ -261,19 +265,22 @@ export interface CallableContext {
261265 rawRequest : Request ;
262266}
263267
264- // The allowed interface for an http request for a callable function.
268+ // The allowed interface for an HTTP request to a Callable function.
269+ /** @hidden */
265270interface HttpRequest extends Request {
266271 body : {
267272 data : any ;
268273 } ;
269274}
270275
271- // The format for the http body response to a callable function.
276+ /** @hidden */
277+ // The format for an HTTP body response from a Callable function.
272278interface HttpResponseBody {
273279 result ?: any ;
274280 error ?: HttpsError ;
275281}
276282
283+ /** @hidden */
277284// Returns true if req is a properly formatted callable request.
278285function isValidRequest ( req : Request ) : req is HttpRequest {
279286 // The body must not be empty.
@@ -317,7 +324,9 @@ function isValidRequest(req: Request): req is HttpRequest {
317324 return true ;
318325}
319326
327+ /** @hidden */
320328const LONG_TYPE = 'type.googleapis.com/google.protobuf.Int64Value' ;
329+ /** @hidden */
321330const UNSIGNED_LONG_TYPE = 'type.googleapis.com/google.protobuf.UInt64Value' ;
322331
323332/**
@@ -400,6 +409,7 @@ export function decode(data: any): any {
400409 return data ;
401410}
402411
412+ /** @hidden */
403413const corsHandler = cors ( { origin : true , methods : 'POST' } ) ;
404414
405415/** @hidden */
0 commit comments