@@ -33,14 +33,16 @@ import {
3333} from '../../common/providers/https' ;
3434import { ManifestEndpoint } from '../../runtime/manifest' ;
3535import * as options from '../options' ;
36+ import { GlobalOptions , SupportedRegion } from '../options' ;
3637
3738export { Request , CallableRequest , FunctionsErrorCode , HttpsError } ;
3839
39- export interface HttpsOptions extends Omit < options . GlobalOptions , 'region' > {
40- region ?:
41- | options . SupportedRegion
42- | string
43- | Array < options . SupportedRegion | string > ;
40+ /**
41+ * Options that can be set on an individual HTTPS Cloud Function.
42+ */
43+ export interface HttpsOptions extends Omit < GlobalOptions , 'region' > {
44+ /* HTTP functions can override and specify more than one regions. */
45+ region ?: SupportedRegion | string | Array < SupportedRegion | string > ;
4446 cors ?: string | boolean | RegExp | Array < string | RegExp > ;
4547}
4648
@@ -54,7 +56,6 @@ export type HttpsFunction = ((
5456export interface CallableFunction < T , Return > extends HttpsFunction {
5557 run ( data : CallableRequest < T > ) : Return ;
5658}
57-
5859export function onRequest (
5960 opts : HttpsOptions ,
6061 handler : (
@@ -195,9 +196,7 @@ export function onCall<T = any, Return = any | Promise<any>>(
195196 ) ;
196197 // global options calls region a scalar and https allows it to be an array,
197198 // but optionsToTriggerAnnotations handles both cases.
198- const specificOpts = options . optionsToTriggerAnnotations (
199- opts as options . GlobalOptions
200- ) ;
199+ const specificOpts = options . optionsToTriggerAnnotations ( opts ) ;
201200 return {
202201 platform : 'gcfv2' ,
203202 ...baseOpts ,
@@ -216,8 +215,8 @@ export function onCall<T = any, Return = any | Promise<any>>(
216215
217216 const baseOpts = options . optionsToEndpoint ( options . getGlobalOptions ( ) ) ;
218217 // global options calls region a scalar and https allows it to be an array,
219- // but optionsToManifestEndpoint handles both cases.
220- const specificOpts = options . optionsToEndpoint ( opts as options . GlobalOptions ) ;
218+ // but optionsToEndpoint handles both cases.
219+ const specificOpts = options . optionsToEndpoint ( opts ) ;
221220 func . __endpoint = {
222221 platform : 'gcfv2' ,
223222 ...baseOpts ,
0 commit comments