File tree Expand file tree Collapse file tree 2 files changed +18
-16
lines changed Expand file tree Collapse file tree 2 files changed +18
-16
lines changed Original file line number Diff line number Diff line change 2323import * as express from 'express' ;
2424
2525import { HttpsFunction , optionsToTrigger , Runnable } from '../cloud-functions' ;
26- import * as common from '../common/providers/https' ;
26+ import {
27+ CallableContext ,
28+ FunctionsErrorCode ,
29+ HttpsError ,
30+ onCallHandler ,
31+ Request ,
32+ } from '../common/providers/https' ;
2733import { DeploymentOptions } from '../function-configuration' ;
2834
29- export type Request = common . Request ;
30- export type CallableContext = common . CallableContext ;
31- export type FunctionsErrorCode = common . FunctionsErrorCode ;
32- export type HttpsError = common . HttpsError ;
35+ export { Request , CallableContext , FunctionsErrorCode , HttpsError } ;
3336
3437/**
3538 * Handle HTTP requests.
@@ -74,10 +77,7 @@ export function _onCallWithOptions(
7477 handler : ( data : any , context : CallableContext ) => any | Promise < any > ,
7578 options : DeploymentOptions
7679) : HttpsFunction & Runnable < any > {
77- const func : any = common . onCallHandler (
78- { origin : true , methods : 'POST' } ,
79- handler
80- ) ;
80+ const func : any = onCallHandler ( { origin : true , methods : 'POST' } , handler ) ;
8181
8282 func . __trigger = {
8383 labels : { } ,
Original file line number Diff line number Diff line change 2323import * as cors from 'cors' ;
2424import * as express from 'express' ;
2525
26- import * as common from '../../common/providers/https' ;
26+ import {
27+ CallableRequest ,
28+ FunctionsErrorCode ,
29+ HttpsError ,
30+ onCallHandler ,
31+ Request ,
32+ } from '../../common/providers/https' ;
2733import * as options from '../options' ;
2834
29- export type Request = common . Request ;
30-
31- export type CallableRequest < T = any > = common . CallableRequest < T > ;
32- export type FunctionsErrorCode = common . FunctionsErrorCode ;
33- export type HttpsError = common . HttpsError ;
35+ export { Request , CallableRequest , FunctionsErrorCode , HttpsError } ;
3436
3537export interface HttpsOptions extends Omit < options . GlobalOptions , 'region' > {
3638 region ?:
@@ -142,7 +144,7 @@ export function onCall<T = any, Return = any | Promise<any>>(
142144 }
143145
144146 const origin = 'cors' in opts ? opts . cors : true ;
145- const func : any = common . onCallHandler ( { origin, methods : 'POST' } , handler ) ;
147+ const func : any = onCallHandler ( { origin, methods : 'POST' } , handler ) ;
146148
147149 Object . defineProperty ( func , '__trigger' , {
148150 get : ( ) => {
You can’t perform that action at this time.
0 commit comments