firebase-functions 4.1.0 → 4.1.1
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.
- package/lib/params/types.d.ts +2 -0
- package/lib/params/types.js +4 -0
- package/lib/v2/options.d.ts +1 -1
- package/lib/v2/providers/alerts/alerts.d.ts +1 -1
- package/lib/v2/providers/alerts/alerts.js +1 -1
- package/lib/v2/providers/alerts/appDistribution.d.ts +1 -1
- package/lib/v2/providers/alerts/appDistribution.js +2 -2
- package/lib/v2/providers/alerts/billing.js +1 -1
- package/lib/v2/providers/alerts/crashlytics.d.ts +1 -1
- package/lib/v2/providers/database.d.ts +1 -1
- package/lib/v2/providers/eventarc.d.ts +1 -1
- package/lib/v2/providers/https.d.ts +1 -1
- package/lib/v2/providers/identity.d.ts +1 -1
- package/lib/v2/providers/pubsub.d.ts +1 -1
- package/lib/v2/providers/storage.d.ts +1 -1
- package/lib/v2/providers/tasks.d.ts +1 -1
- package/lib/v2/providers/testLab.js +1 -1
- package/lib/v2/trace.js +1 -1
- package/package.json +2 -2
package/lib/params/types.d.ts
CHANGED
|
@@ -182,6 +182,8 @@ export declare class FloatParam extends Param<number> {
|
|
|
182
182
|
*/
|
|
183
183
|
export declare class BooleanParam extends Param<boolean> {
|
|
184
184
|
static type: ParamValueType;
|
|
185
|
+
/** @deprecated */
|
|
185
186
|
then<T extends string | number | boolean>(ifTrue: T | Expression<T>, ifFalse: T | Expression<T>): TernaryExpression<T>;
|
|
187
|
+
thenElse<T extends string | number | boolean>(ifTrue: T | Expression<T>, ifFalse: T | Expression<T>): TernaryExpression<T>;
|
|
186
188
|
}
|
|
187
189
|
export {};
|
package/lib/params/types.js
CHANGED
|
@@ -299,7 +299,11 @@ class BooleanParam extends Param {
|
|
|
299
299
|
runtimeValue() {
|
|
300
300
|
return !!process.env[this.name] && process.env[this.name] === "true";
|
|
301
301
|
}
|
|
302
|
+
/** @deprecated */
|
|
302
303
|
then(ifTrue, ifFalse) {
|
|
304
|
+
return this.thenElse(ifTrue, ifFalse);
|
|
305
|
+
}
|
|
306
|
+
thenElse(ifTrue, ifFalse) {
|
|
303
307
|
return new TernaryExpression(this, ifTrue, ifFalse);
|
|
304
308
|
}
|
|
305
309
|
}
|
package/lib/v2/options.d.ts
CHANGED
|
@@ -36,7 +36,7 @@ export interface GlobalOptions {
|
|
|
36
36
|
*/
|
|
37
37
|
memory?: MemoryOption | Expression<number> | ResetValue;
|
|
38
38
|
/**
|
|
39
|
-
* Timeout for the function in
|
|
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
|
|
@@ -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
|
|
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
|
|
@@ -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
|
|
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
|
|
@@ -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
|
|
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
|
|
@@ -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
|
|
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
|
|
@@ -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
|
|
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
|
|
@@ -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
|
|
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
|
|
@@ -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
|
|
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
|
|
@@ -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
|
|
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
|
|
@@ -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
|
|
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
|
|
@@ -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
|
|
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
|
|
@@ -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.
|
|
3
|
+
"version": "4.1.1",
|
|
4
4
|
"description": "Firebase SDK for Cloud Functions",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"firebase",
|
|
@@ -227,7 +227,7 @@
|
|
|
227
227
|
"mocha": "^6.1.4",
|
|
228
228
|
"mock-require": "^3.0.3",
|
|
229
229
|
"mz": "^2.7.0",
|
|
230
|
-
"nock": "^
|
|
230
|
+
"nock": "^13.2.9",
|
|
231
231
|
"node-fetch": "^2.6.7",
|
|
232
232
|
"portfinder": "^1.0.28",
|
|
233
233
|
"prettier": "^2.7.1",
|