firebase-functions 4.1.0 → 4.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,7 +2,7 @@
2
2
  * @hidden
3
3
  * @alpha
4
4
  */
5
- import { BooleanParam, Expression, FloatParam, IntParam, Param, ParamOptions, SecretParam, StringParam } from "./types";
5
+ import { BooleanParam, Expression, IntParam, Param, ParamOptions, SecretParam, StringParam, ListParam } from "./types";
6
6
  export { ParamOptions, Expression };
7
7
  declare type SecretOrExpr = Param<any> | SecretParam;
8
8
  export declare const declaredParams: SecretOrExpr[];
@@ -62,10 +62,10 @@ export declare function defineBoolean(name: string, options?: ParamOptions<boole
62
62
  */
63
63
  export declare function defineInt(name: string, options?: ParamOptions<number>): IntParam;
64
64
  /**
65
- * Declare a float param.
65
+ * Declare a list param.
66
66
  *
67
67
  * @param name The name of the environment variable to use to load the param.
68
68
  * @param options Configuration options for the param.
69
- * @returns A Param with a `number` return type for `.value`.
69
+ * @returns A Param with a `string[]` return type for `.value`.
70
70
  */
71
- export declare function defineFloat(name: string, options?: ParamOptions<number>): FloatParam;
71
+ export declare function defineList(name: string, options?: ParamOptions<string[]>): ListParam;
@@ -21,7 +21,7 @@
21
21
  // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
22
  // SOFTWARE.
23
23
  Object.defineProperty(exports, "__esModule", { value: true });
24
- exports.defineFloat = exports.defineInt = exports.defineBoolean = exports.defineString = exports.defineSecret = exports.storageBucket = exports.gcloudProject = exports.projectID = exports.databaseURL = exports.clearParams = exports.declaredParams = exports.Expression = void 0;
24
+ exports.defineList = exports.defineFloat = exports.defineInt = exports.defineBoolean = exports.defineString = exports.defineSecret = exports.storageBucket = exports.gcloudProject = exports.projectID = exports.databaseURL = exports.clearParams = exports.declaredParams = exports.Expression = void 0;
25
25
  /**
26
26
  * @hidden
27
27
  * @alpha
@@ -131,6 +131,8 @@ exports.defineInt = defineInt;
131
131
  * @param name The name of the environment variable to use to load the param.
132
132
  * @param options Configuration options for the param.
133
133
  * @returns A Param with a `number` return type for `.value`.
134
+ *
135
+ * @internal
134
136
  */
135
137
  function defineFloat(name, options = {}) {
136
138
  const param = new types_1.FloatParam(name, options);
@@ -138,3 +140,16 @@ function defineFloat(name, options = {}) {
138
140
  return param;
139
141
  }
140
142
  exports.defineFloat = defineFloat;
143
+ /**
144
+ * Declare a list param.
145
+ *
146
+ * @param name The name of the environment variable to use to load the param.
147
+ * @param options Configuration options for the param.
148
+ * @returns A Param with a `string[]` return type for `.value`.
149
+ */
150
+ function defineList(name, options = {}) {
151
+ const param = new types_1.ListParam(name, options);
152
+ registerParam(param);
153
+ return param;
154
+ }
155
+ exports.defineList = defineList;
@@ -34,6 +34,8 @@ declare type ParamInput<T> = {
34
34
  text: TextInput<T>;
35
35
  } | {
36
36
  select: SelectInput<T>;
37
+ } | {
38
+ multiSelect: MultiSelectInput;
37
39
  } | {
38
40
  resource: ResourceInput;
39
41
  };
@@ -73,6 +75,14 @@ export interface ResourceInput {
73
75
  export interface SelectInput<T = unknown> {
74
76
  options: Array<SelectOptions<T>>;
75
77
  }
78
+ /**
79
+ * Specifies that a Param's value should be determined by having the user select
80
+ * a subset from a list of pre-canned options interactively at deploy-time.
81
+ * Will result in errors if used on Params of type other than string[].
82
+ */
83
+ export interface MultiSelectInput {
84
+ options: Array<SelectOptions<string>>;
85
+ }
76
86
  /**
77
87
  * One of the options provided to a SelectInput, containing a value and
78
88
  * optionally a human-readable label to display in the selection interface.
@@ -182,6 +192,23 @@ export declare class FloatParam extends Param<number> {
182
192
  */
183
193
  export declare class BooleanParam extends Param<boolean> {
184
194
  static type: ParamValueType;
195
+ /** @deprecated */
185
196
  then<T extends string | number | boolean>(ifTrue: T | Expression<T>, ifFalse: T | Expression<T>): TernaryExpression<T>;
197
+ thenElse<T extends string | number | boolean>(ifTrue: T | Expression<T>, ifFalse: T | Expression<T>): TernaryExpression<T>;
198
+ }
199
+ /**
200
+ * A parametrized value of String[] type that will be read from .env files
201
+ * if present, or prompted for by the CLI if missing.
202
+ */
203
+ export declare class ListParam extends Param<string[]> {
204
+ static type: ParamValueType;
205
+ /** @hidden */
206
+ greaterThan(rhs: string[] | Expression<string[]>): CompareExpression<string[]>;
207
+ /** @hidden */
208
+ greaterThanOrEqualTo(rhs: string[] | Expression<string[]>): CompareExpression<string[]>;
209
+ /** @hidden */
210
+ lessThan(rhs: string[] | Expression<string[]>): CompareExpression<string[]>;
211
+ /** @hidden */
212
+ lessThanorEqualTo(rhs: string[] | Expression<string[]>): CompareExpression<string[]>;
186
213
  }
187
214
  export {};
@@ -21,7 +21,7 @@
21
21
  // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
22
  // SOFTWARE.
23
23
  Object.defineProperty(exports, "__esModule", { value: true });
24
- exports.BooleanParam = exports.FloatParam = exports.IntParam = exports.InternalExpression = exports.StringParam = exports.SecretParam = exports.Param = exports.CompareExpression = exports.TernaryExpression = exports.Expression = void 0;
24
+ exports.ListParam = exports.BooleanParam = exports.FloatParam = exports.IntParam = exports.InternalExpression = exports.StringParam = exports.SecretParam = exports.Param = exports.CompareExpression = exports.TernaryExpression = exports.Expression = void 0;
25
25
  const logger = require("../logger");
26
26
  /*
27
27
  * A CEL expression which can be evaluated during function deployment, and
@@ -51,15 +51,29 @@ class Expression {
51
51
  }
52
52
  }
53
53
  exports.Expression = Expression;
54
- function quoteIfString(literal) {
55
- // TODO(vsfan@): CEL's string escape semantics are slightly different than Javascript's, what do we do here?
56
- return typeof literal === "string" ? `"${literal}"` : literal;
57
- }
58
54
  function valueOf(arg) {
59
55
  return arg instanceof Expression ? arg.runtimeValue() : arg;
60
56
  }
57
+ /**
58
+ * Returns how an entity (either an Expression or a literal value) should be represented in CEL.
59
+ * - Expressions delegate to the .toString() method, which is used by the WireManifest
60
+ * - Strings have to be quoted explicitly
61
+ * - Arrays are represented as []-delimited, parsable JSON
62
+ * - Numbers and booleans are not quoted explicitly
63
+ */
61
64
  function refOf(arg) {
62
- return arg instanceof Expression ? arg.toString() : quoteIfString(arg).toString();
65
+ if (arg instanceof Expression) {
66
+ return arg.toString();
67
+ }
68
+ else if (typeof arg === "string") {
69
+ return `"${arg}"`;
70
+ }
71
+ else if (Array.isArray(arg)) {
72
+ return JSON.stringify(arg);
73
+ }
74
+ else {
75
+ return arg.toString();
76
+ }
63
77
  }
64
78
  /**
65
79
  * A CEL expression corresponding to a ternary operator, e.g {{ cond ? ifTrue : ifFalse }}
@@ -99,9 +113,9 @@ class CompareExpression extends Expression {
99
113
  const right = valueOf(this.rhs);
100
114
  switch (this.cmp) {
101
115
  case "==":
102
- return left === right;
116
+ return Array.isArray(left) ? this.arrayEquals(left, right) : left === right;
103
117
  case "!=":
104
- return left !== right;
118
+ return Array.isArray(left) ? !this.arrayEquals(left, right) : left !== right;
105
119
  case ">":
106
120
  return left > right;
107
121
  case ">=":
@@ -114,6 +128,10 @@ class CompareExpression extends Expression {
114
128
  throw new Error(`Unknown comparator ${this.cmp}`);
115
129
  }
116
130
  }
131
+ /** @internal */
132
+ arrayEquals(a, b) {
133
+ return a.every((item) => b.includes(item)) && b.every((item) => a.includes(item));
134
+ }
117
135
  toString() {
118
136
  const rhsStr = refOf(this.rhs);
119
137
  return `${this.lhs} ${this.cmp} ${rhsStr}`;
@@ -299,9 +317,49 @@ class BooleanParam extends Param {
299
317
  runtimeValue() {
300
318
  return !!process.env[this.name] && process.env[this.name] === "true";
301
319
  }
320
+ /** @deprecated */
302
321
  then(ifTrue, ifFalse) {
322
+ return this.thenElse(ifTrue, ifFalse);
323
+ }
324
+ thenElse(ifTrue, ifFalse) {
303
325
  return new TernaryExpression(this, ifTrue, ifFalse);
304
326
  }
305
327
  }
306
328
  exports.BooleanParam = BooleanParam;
307
329
  BooleanParam.type = "boolean";
330
+ /**
331
+ * A parametrized value of String[] type that will be read from .env files
332
+ * if present, or prompted for by the CLI if missing.
333
+ */
334
+ class ListParam extends Param {
335
+ /** @internal */
336
+ runtimeValue() {
337
+ const val = JSON.parse(process.env[this.name]);
338
+ if (!Array.isArray(val) || !val.every((v) => typeof v === "string")) {
339
+ return [];
340
+ }
341
+ return val;
342
+ }
343
+ /** @hidden */
344
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
345
+ greaterThan(rhs) {
346
+ throw new Error(">/< comparison operators not supported on params of type List");
347
+ }
348
+ /** @hidden */
349
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
350
+ greaterThanOrEqualTo(rhs) {
351
+ throw new Error(">/< comparison operators not supported on params of type List");
352
+ }
353
+ /** @hidden */
354
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
355
+ lessThan(rhs) {
356
+ throw new Error(">/< comparison operators not supported on params of type List");
357
+ }
358
+ /** @hidden */
359
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
360
+ lessThanorEqualTo(rhs) {
361
+ throw new Error(">/< comparison operators not supported on params of type List");
362
+ }
363
+ }
364
+ exports.ListParam = ListParam;
365
+ ListParam.type = "list";
@@ -141,7 +141,7 @@ export interface RuntimeOptions {
141
141
  /**
142
142
  * Connect cloud function to specified VPC connector.
143
143
  */
144
- vpcConnector?: string | ResetValue;
144
+ vpcConnector?: string | Expression<string> | ResetValue;
145
145
  /**
146
146
  * Egress settings for VPC connector.
147
147
  */
@@ -36,7 +36,7 @@ export interface GlobalOptions {
36
36
  */
37
37
  memory?: MemoryOption | Expression<number> | ResetValue;
38
38
  /**
39
- * Timeout for the function in sections, possible values are 0 to 540.
39
+ * Timeout for the function in seconds, possible values are 0 to 540.
40
40
  * HTTPS functions can specify a higher timeout.
41
41
  *
42
42
  * @remarks
@@ -83,7 +83,7 @@ export interface GlobalOptions {
83
83
  /**
84
84
  * Connect cloud function to specified VPC connector.
85
85
  */
86
- vpcConnector?: string | ResetValue;
86
+ vpcConnector?: string | Expression<string> | ResetValue;
87
87
  /**
88
88
  * Egress settings for VPC connector.
89
89
  */
@@ -54,7 +54,7 @@ export interface FirebaseAlertOptions extends options.EventHandlerOptions {
54
54
  */
55
55
  memory?: options.MemoryOption | Expression<number> | ResetValue;
56
56
  /**
57
- * Timeout for the function in sections, possible values are 0 to 540.
57
+ * Timeout for the function in seconds, possible values are 0 to 540.
58
58
  * HTTPS functions can specify a higher timeout.
59
59
  * A value of null restores the default of 60s
60
60
  * The minimum timeout for a gen 2 function is 1s. The maximum timeout for a
@@ -97,7 +97,7 @@ export interface FirebaseAlertOptions extends options.EventHandlerOptions {
97
97
  * Connect cloud function to specified VPC connector.
98
98
  * A value of null removes the VPC connector
99
99
  */
100
- vpcConnector?: string | ResetValue;
100
+ vpcConnector?: string | Expression<string> | ResetValue;
101
101
  /**
102
102
  * Egress settings for VPC connector.
103
103
  * A value of null turns off VPC connector egress settings
@@ -30,7 +30,7 @@ exports.eventType = "google.firebase.firebasealerts.alerts.v1.published";
30
30
  function onAlertPublished(alertTypeOrOpts, handler) {
31
31
  const [opts, alertType, appId] = getOptsAndAlertTypeAndApp(alertTypeOrOpts);
32
32
  const func = (raw) => {
33
- return (0, trace_1.wrapTraceContext)(handler(convertAlertAndApp(raw)));
33
+ return (0, trace_1.wrapTraceContext)(handler)(convertAlertAndApp(raw));
34
34
  };
35
35
  func.run = handler;
36
36
  func.__endpoint = getEndpointAnnotation(opts, alertType, appId);
@@ -76,7 +76,7 @@ export interface AppDistributionOptions extends options.EventHandlerOptions {
76
76
  */
77
77
  memory?: options.MemoryOption | Expression<number> | ResetValue;
78
78
  /**
79
- * Timeout for the function in sections, possible values are 0 to 540.
79
+ * Timeout for the function in seconds, possible values are 0 to 540.
80
80
  * HTTPS functions can specify a higher timeout.
81
81
  *
82
82
  * @remarks
@@ -123,7 +123,7 @@ export interface AppDistributionOptions extends options.EventHandlerOptions {
123
123
  /**
124
124
  * Connect cloud function to specified VPC connector.
125
125
  */
126
- vpcConnector?: string | ResetValue;
126
+ vpcConnector?: string | Expression<string> | ResetValue;
127
127
  /**
128
128
  * Egress settings for VPC connector.
129
129
  */
@@ -41,7 +41,7 @@ function onNewTesterIosDevicePublished(appIdOrOptsOrHandler, handler) {
41
41
  }
42
42
  const [opts, appId] = getOptsAndApp(appIdOrOptsOrHandler);
43
43
  const func = (raw) => {
44
- return (0, trace_1.wrapTraceContext)(handler((0, alerts_1.convertAlertAndApp)(raw)));
44
+ return (0, trace_1.wrapTraceContext)(handler)((0, alerts_1.convertAlertAndApp)(raw));
45
45
  };
46
46
  func.run = handler;
47
47
  func.__endpoint = (0, alerts_1.getEndpointAnnotation)(opts, exports.newTesterIosDeviceAlert, appId);
@@ -61,7 +61,7 @@ function onInAppFeedbackPublished(appIdOrOptsOrHandler, handler) {
61
61
  }
62
62
  const [opts, appId] = getOptsAndApp(appIdOrOptsOrHandler);
63
63
  const func = (raw) => {
64
- return (0, trace_1.wrapTraceContext)(handler((0, alerts_1.convertAlertAndApp)(raw)));
64
+ return (0, trace_1.wrapTraceContext)(handler)((0, alerts_1.convertAlertAndApp)(raw));
65
65
  };
66
66
  func.run = handler;
67
67
  func.__endpoint = (0, alerts_1.getEndpointAnnotation)(opts, exports.inAppFeedbackAlert, appId);
@@ -55,7 +55,7 @@ function onOperation(alertType, optsOrHandler, handler) {
55
55
  optsOrHandler = {};
56
56
  }
57
57
  const func = (raw) => {
58
- return (0, trace_1.wrapTraceContext)(handler((0, alerts_1.convertAlertAndApp)(raw)));
58
+ return (0, trace_1.wrapTraceContext)(handler)((0, alerts_1.convertAlertAndApp)(raw));
59
59
  };
60
60
  func.run = handler;
61
61
  func.__endpoint = (0, alerts_1.getEndpointAnnotation)(optsOrHandler, alertType);
@@ -142,7 +142,7 @@ export interface CrashlyticsOptions extends options.EventHandlerOptions {
142
142
  */
143
143
  memory?: options.MemoryOption | Expression<number> | ResetValue;
144
144
  /**
145
- * Timeout for the function in sections, possible values are 0 to 540.
145
+ * Timeout for the function in seconds, possible values are 0 to 540.
146
146
  * HTTPS functions can specify a higher timeout.
147
147
  *
148
148
  * @remarks
@@ -189,7 +189,7 @@ export interface CrashlyticsOptions extends options.EventHandlerOptions {
189
189
  /**
190
190
  * Connect cloud function to specified VPC connector.
191
191
  */
192
- vpcConnector?: string | ResetValue;
192
+ vpcConnector?: string | Expression<string> | ResetValue;
193
193
  /**
194
194
  * Egress settings for VPC connector.
195
195
  */
@@ -64,7 +64,7 @@ export interface ReferenceOptions<Ref extends string = string> extends options.E
64
64
  */
65
65
  memory?: options.MemoryOption | Expression<number> | ResetValue;
66
66
  /**
67
- * Timeout for the function in sections, possible values are 0 to 540.
67
+ * Timeout for the function in seconds, possible values are 0 to 540.
68
68
  * HTTPS functions can specify a higher timeout.
69
69
  *
70
70
  * @remarks
@@ -111,7 +111,7 @@ export interface ReferenceOptions<Ref extends string = string> extends options.E
111
111
  /**
112
112
  * Connect cloud function to specified VPC connector.
113
113
  */
114
- vpcConnector?: string | ResetValue;
114
+ vpcConnector?: string | Expression<string> | ResetValue;
115
115
  /**
116
116
  * Egress settings for VPC connector.
117
117
  */
@@ -41,7 +41,7 @@ export interface EventarcTriggerOptions extends options.EventHandlerOptions {
41
41
  */
42
42
  memory?: options.MemoryOption | Expression<number> | ResetValue;
43
43
  /**
44
- * Timeout for the function in sections, possible values are 0 to 540.
44
+ * Timeout for the function in seconds, possible values are 0 to 540.
45
45
  * HTTPS functions can specify a higher timeout.
46
46
  *
47
47
  * @remarks
@@ -88,7 +88,7 @@ export interface EventarcTriggerOptions extends options.EventHandlerOptions {
88
88
  /**
89
89
  * Connect cloud function to specified VPC connector.
90
90
  */
91
- vpcConnector?: string | ResetValue;
91
+ vpcConnector?: string | Expression<string> | ResetValue;
92
92
  /**
93
93
  * Egress settings for VPC connector.
94
94
  */
@@ -67,6 +67,12 @@ function onCustomEventPublished(eventTypeOrOpts, handler) {
67
67
  (0, encoding_1.convertIfPresent)(endpoint.eventTrigger, opts, "eventFilters", "filters");
68
68
  (0, encoding_1.copyIfPresent)(endpoint.eventTrigger, opts, "retry");
69
69
  func.__endpoint = endpoint;
70
+ func.__requiredAPIs = [
71
+ {
72
+ api: "eventarcpublishing.googleapis.com",
73
+ reason: "Needed for custom event functions",
74
+ },
75
+ ];
70
76
  return func;
71
77
  }
72
78
  exports.onCustomEventPublished = onCustomEventPublished;
@@ -28,7 +28,7 @@ export interface HttpsOptions extends Omit<GlobalOptions, "region"> {
28
28
  */
29
29
  memory?: options.MemoryOption | Expression<number> | ResetValue;
30
30
  /**
31
- * Timeout for the function in sections, possible values are 0 to 540.
31
+ * Timeout for the function in seconds, possible values are 0 to 540.
32
32
  * HTTPS functions can specify a higher timeout.
33
33
  *
34
34
  * @remarks
@@ -75,7 +75,7 @@ export interface HttpsOptions extends Omit<GlobalOptions, "region"> {
75
75
  /**
76
76
  * Connect cloud function to specified VPC connector.
77
77
  */
78
- vpcConnector?: string | ResetValue;
78
+ vpcConnector?: string | Expression<string> | ResetValue;
79
79
  /**
80
80
  * Egress settings for VPC connector.
81
81
  */
@@ -44,7 +44,11 @@ function onRequest(optsOrHandler, handler) {
44
44
  opts = optsOrHandler;
45
45
  }
46
46
  if ((0, debug_1.isDebugFeatureEnabled)("enableCors") || "cors" in opts) {
47
- const origin = (0, debug_1.isDebugFeatureEnabled)("enableCors") ? true : opts.cors;
47
+ let origin = opts.cors;
48
+ if ((0, debug_1.isDebugFeatureEnabled)("enableCors")) {
49
+ // Respect `cors: false` to turn off cors even if debug feature is enabled.
50
+ origin = opts.cors === false ? false : true;
51
+ }
48
52
  const userProvidedHandler = handler;
49
53
  handler = (req, res) => {
50
54
  return new Promise((resolve) => {
@@ -39,7 +39,7 @@ export interface BlockingOptions {
39
39
  */
40
40
  memory?: options.MemoryOption | Expression<number> | ResetValue;
41
41
  /**
42
- * Timeout for the function in sections, possible values are 0 to 540.
42
+ * Timeout for the function in seconds, possible values are 0 to 540.
43
43
  * HTTPS functions can specify a higher timeout.
44
44
  *
45
45
  * @remarks
@@ -86,7 +86,7 @@ export interface BlockingOptions {
86
86
  /**
87
87
  * Connect cloud function to specified VPC connector.
88
88
  */
89
- vpcConnector?: string | ResetValue;
89
+ vpcConnector?: string | Expression<string> | ResetValue;
90
90
  /**
91
91
  * Egress settings for VPC connector.
92
92
  */
@@ -97,7 +97,7 @@ export interface PubSubOptions extends options.EventHandlerOptions {
97
97
  */
98
98
  memory?: options.MemoryOption | Expression<number> | ResetValue;
99
99
  /**
100
- * Timeout for the function in sections, possible values are 0 to 540.
100
+ * Timeout for the function in seconds, possible values are 0 to 540.
101
101
  * HTTPS functions can specify a higher timeout.
102
102
  *
103
103
  * @remarks
@@ -144,7 +144,7 @@ export interface PubSubOptions extends options.EventHandlerOptions {
144
144
  /**
145
145
  * Connect cloud function to specified VPC connector.
146
146
  */
147
- vpcConnector?: string | ResetValue;
147
+ vpcConnector?: string | Expression<string> | ResetValue;
148
148
  /**
149
149
  * Egress settings for VPC connector.
150
150
  */
@@ -173,7 +173,7 @@ export interface StorageOptions extends options.EventHandlerOptions {
173
173
  */
174
174
  memory?: options.MemoryOption | Expression<number> | ResetValue;
175
175
  /**
176
- * Timeout for the function in sections, possible values are 0 to 540.
176
+ * Timeout for the function in seconds, possible values are 0 to 540.
177
177
  * HTTPS functions can specify a higher timeout.
178
178
  *
179
179
  * @remarks
@@ -220,7 +220,7 @@ export interface StorageOptions extends options.EventHandlerOptions {
220
220
  /**
221
221
  * Connect cloud function to specified VPC connector.
222
222
  */
223
- vpcConnector?: string | ResetValue;
223
+ vpcConnector?: string | Expression<string> | ResetValue;
224
224
  /**
225
225
  * Egress settings for VPC connector.
226
226
  */
@@ -32,7 +32,7 @@ export interface TaskQueueOptions extends options.EventHandlerOptions {
32
32
  */
33
33
  memory?: options.MemoryOption | Expression<number> | ResetValue;
34
34
  /**
35
- * Timeout for the function in sections, possible values are 0 to 540.
35
+ * Timeout for the function in seconds, possible values are 0 to 540.
36
36
  * HTTPS functions can specify a higher timeout.
37
37
  *
38
38
  * @remarks
@@ -79,7 +79,7 @@ export interface TaskQueueOptions extends options.EventHandlerOptions {
79
79
  /**
80
80
  * Connect cloud function to specified VPC connector.
81
81
  */
82
- vpcConnector?: string | ResetValue;
82
+ vpcConnector?: string | Expression<string> | ResetValue;
83
83
  /**
84
84
  * Egress settings for VPC connector.
85
85
  */
@@ -43,7 +43,7 @@ function onTestMatrixCompleted(optsOrHandler, handler) {
43
43
  const baseOpts = (0, options_1.optionsToEndpoint)((0, options_1.getGlobalOptions)());
44
44
  const specificOpts = (0, options_1.optionsToEndpoint)(optsOrHandler);
45
45
  const func = (raw) => {
46
- return (0, trace_1.wrapTraceContext)(handler(raw));
46
+ return (0, trace_1.wrapTraceContext)(handler)(raw);
47
47
  };
48
48
  func.run = handler;
49
49
  const ep = {
package/lib/v2/trace.js CHANGED
@@ -15,7 +15,7 @@ function wrapTraceContext(handler) {
15
15
  // eslint-disable-next-line prefer-spread
16
16
  return handler.apply(null, args);
17
17
  }
18
- trace_1.traceContext.run(traceParent, handler, ...args);
18
+ return trace_1.traceContext.run(traceParent, handler, ...args);
19
19
  };
20
20
  }
21
21
  exports.wrapTraceContext = wrapTraceContext;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "firebase-functions",
3
- "version": "4.1.0",
3
+ "version": "4.2.0",
4
4
  "description": "Firebase SDK for Cloud Functions",
5
5
  "keywords": [
6
6
  "firebase",
@@ -201,7 +201,7 @@
201
201
  "@microsoft/api-extractor": "^7.18.7",
202
202
  "@types/chai": "^4.1.7",
203
203
  "@types/chai-as-promised": "^7.1.0",
204
- "@types/jsonwebtoken": "^8.3.2",
204
+ "@types/jsonwebtoken": "^9.0.0",
205
205
  "@types/mocha": "^5.2.7",
206
206
  "@types/mock-require": "^2.0.0",
207
207
  "@types/nock": "^10.0.3",
@@ -222,12 +222,12 @@
222
222
  "firebase-admin": "^10.3.0",
223
223
  "js-yaml": "^3.13.1",
224
224
  "jsdom": "^16.2.1",
225
- "jsonwebtoken": "^8.5.1",
225
+ "jsonwebtoken": "^9.0.0",
226
226
  "jwk-to-pem": "^2.0.5",
227
227
  "mocha": "^6.1.4",
228
228
  "mock-require": "^3.0.3",
229
229
  "mz": "^2.7.0",
230
- "nock": "^10.0.6",
230
+ "nock": "^13.2.9",
231
231
  "node-fetch": "^2.6.7",
232
232
  "portfinder": "^1.0.28",
233
233
  "prettier": "^2.7.1",