@@ -28,6 +28,7 @@ import { apps } from '../apps';
28
28
import { HttpsFunction , optionsToTrigger , Runnable } from '../cloud-functions' ;
29
29
import { DeploymentOptions } from '../function-configuration' ;
30
30
31
+ /** @hidden */
31
32
export interface Request extends express . Request {
32
33
rawBody : Buffer ;
33
34
}
@@ -127,6 +128,7 @@ export type FunctionsErrorCode =
127
128
| 'data-loss'
128
129
| 'unauthenticated' ;
129
130
131
+ /** @hidden */
130
132
export type CanonicalErrorCodeName =
131
133
| 'OK'
132
134
| 'CANCELLED'
@@ -146,6 +148,7 @@ export type CanonicalErrorCodeName =
146
148
| 'UNAVAILABLE'
147
149
| 'DATA_LOSS' ;
148
150
151
+ /** @hidden */
149
152
interface HttpErrorCode {
150
153
canonicalName : CanonicalErrorCodeName ;
151
154
status : number ;
@@ -180,6 +183,7 @@ const errorCodeMap: { [name in FunctionsErrorCode]: HttpErrorCode } = {
180
183
'data-loss' : { canonicalName : 'DATA_LOSS' , status : 500 } ,
181
184
} ;
182
185
186
+ /** @hidden */
183
187
interface HttpErrorWireFormat {
184
188
details ?: unknown ;
185
189
message : string ;
@@ -261,19 +265,22 @@ export interface CallableContext {
261
265
rawRequest : Request ;
262
266
}
263
267
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 */
265
270
interface HttpRequest extends Request {
266
271
body : {
267
272
data : any ;
268
273
} ;
269
274
}
270
275
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.
272
278
interface HttpResponseBody {
273
279
result ?: any ;
274
280
error ?: HttpsError ;
275
281
}
276
282
283
+ /** @hidden */
277
284
// Returns true if req is a properly formatted callable request.
278
285
function isValidRequest ( req : Request ) : req is HttpRequest {
279
286
// The body must not be empty.
@@ -317,7 +324,9 @@ function isValidRequest(req: Request): req is HttpRequest {
317
324
return true ;
318
325
}
319
326
327
+ /** @hidden */
320
328
const LONG_TYPE = 'type.googleapis.com/google.protobuf.Int64Value' ;
329
+ /** @hidden */
321
330
const UNSIGNED_LONG_TYPE = 'type.googleapis.com/google.protobuf.UInt64Value' ;
322
331
323
332
/**
@@ -400,6 +409,7 @@ export function decode(data: any): any {
400
409
return data ;
401
410
}
402
411
412
+ /** @hidden */
403
413
const corsHandler = cors ( { origin : true , methods : 'POST' } ) ;
404
414
405
415
/** @hidden */
0 commit comments