firebase-functions 3.22.0 → 3.23.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.
- package/lib/bin/firebase-functions.js +2 -1
- package/lib/common/providers/identity.js +0 -3
- package/lib/common/providers/tasks.d.ts +8 -7
- package/lib/common/timezone.d.ts +2 -0
- package/lib/common/timezone.js +543 -0
- package/lib/function-configuration.d.ts +6 -5
- package/lib/runtime/loader.js +6 -1
- package/lib/runtime/manifest.d.ts +19 -16
- package/lib/runtime/manifest.js +24 -0
- package/lib/v2/index.d.ts +2 -1
- package/lib/v2/index.js +3 -1
- package/lib/v2/options.d.ts +16 -6
- package/lib/v2/options.js +2 -2
- package/lib/v2/params/index.d.ts +14 -12
- package/lib/v2/params/index.js +25 -15
- package/lib/v2/params/types.d.ts +97 -24
- package/lib/v2/params/types.js +127 -67
- package/lib/v2/providers/alerts/alerts.d.ts +7 -6
- package/lib/v2/providers/alerts/appDistribution.d.ts +50 -5
- package/lib/v2/providers/alerts/appDistribution.js +23 -1
- package/lib/v2/providers/alerts/crashlytics.d.ts +6 -5
- package/lib/v2/providers/database.d.ts +7 -6
- package/lib/v2/providers/eventarc.d.ts +6 -5
- package/lib/v2/providers/https.d.ts +6 -5
- package/lib/v2/providers/identity.d.ts +8 -7
- package/lib/v2/providers/pubsub.d.ts +6 -5
- package/lib/v2/providers/scheduler.d.ts +63 -0
- package/lib/v2/providers/scheduler.js +98 -0
- package/lib/v2/providers/storage.d.ts +6 -5
- package/lib/v2/providers/tasks.d.ts +7 -6
- package/package.json +13 -7
|
@@ -3,9 +3,10 @@
|
|
|
3
3
|
* @packageDocumentation
|
|
4
4
|
*/
|
|
5
5
|
import { BlockingFunction } from '../../cloud-functions';
|
|
6
|
-
import { AuthBlockingEvent, AuthBlockingEventType, BeforeCreateResponse, BeforeSignInResponse, HttpsError } from '../../common/providers/identity';
|
|
6
|
+
import { AuthBlockingEvent, AuthBlockingEventType, AuthUserRecord, BeforeCreateResponse, BeforeSignInResponse, HttpsError } from '../../common/providers/identity';
|
|
7
7
|
import * as options from '../options';
|
|
8
|
-
|
|
8
|
+
import { Expression } from '../params';
|
|
9
|
+
export { AuthUserRecord, AuthBlockingEvent, HttpsError };
|
|
9
10
|
/** @hidden Internally used when parsing the options. */
|
|
10
11
|
interface InternalOptions {
|
|
11
12
|
opts: options.GlobalOptions;
|
|
@@ -31,7 +32,7 @@ export interface BlockingOptions {
|
|
|
31
32
|
* Amount of memory to allocate to a function.
|
|
32
33
|
* A value of null restores the defaults of 256MB.
|
|
33
34
|
*/
|
|
34
|
-
memory?: options.MemoryOption | null;
|
|
35
|
+
memory?: options.MemoryOption | Expression<number> | null;
|
|
35
36
|
/**
|
|
36
37
|
* Timeout for the function in sections, possible values are 0 to 540.
|
|
37
38
|
* HTTPS functions can specify a higher timeout.
|
|
@@ -42,19 +43,19 @@ export interface BlockingOptions {
|
|
|
42
43
|
* maximum timeout of 36,00s (1 hour). Task queue functions have a maximum
|
|
43
44
|
* timeout of 1,800s (30 minutes)
|
|
44
45
|
*/
|
|
45
|
-
timeoutSeconds?: number | null;
|
|
46
|
+
timeoutSeconds?: number | Expression<number> | null;
|
|
46
47
|
/**
|
|
47
48
|
* Min number of actual instances to be running at a given time.
|
|
48
49
|
* Instances will be billed for memory allocation and 10% of CPU allocation
|
|
49
50
|
* while idle.
|
|
50
51
|
* A value of null restores the default min instances.
|
|
51
52
|
*/
|
|
52
|
-
minInstances?: number | null;
|
|
53
|
+
minInstances?: number | Expression<number> | null;
|
|
53
54
|
/**
|
|
54
55
|
* Max number of instances to be running in parallel.
|
|
55
56
|
* A value of null restores the default max instances.
|
|
56
57
|
*/
|
|
57
|
-
maxInstances?: number | null;
|
|
58
|
+
maxInstances?: number | Expression<number> | null;
|
|
58
59
|
/**
|
|
59
60
|
* Number of requests a function can serve at once.
|
|
60
61
|
* Can only be applied to functions running on Cloud Functions v2.
|
|
@@ -62,7 +63,7 @@ export interface BlockingOptions {
|
|
|
62
63
|
* Concurrency cannot be set to any value other than 1 if `cpu` is less than 1.
|
|
63
64
|
* The maximum value for concurrency is 1,000.
|
|
64
65
|
*/
|
|
65
|
-
concurrency?: number | null;
|
|
66
|
+
concurrency?: number | Expression<number> | null;
|
|
66
67
|
/**
|
|
67
68
|
* Fractional number of CPUs to allocate to a function.
|
|
68
69
|
* Defaults to 1 for functions with <= 2GB RAM and increases for larger memory sizes.
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { CloudEvent, CloudFunction } from '../core';
|
|
2
2
|
import * as options from '../options';
|
|
3
|
+
import { Expression } from '../params';
|
|
3
4
|
/**
|
|
4
5
|
* Google Cloud Pub/Sub is a globally distributed message bus that automatically scales as you need it.
|
|
5
6
|
* You can create a function ({@link onMessagePublished}) that handles pub/sub events by using functions.pubsub.
|
|
@@ -89,7 +90,7 @@ export interface PubSubOptions extends options.EventHandlerOptions {
|
|
|
89
90
|
* Amount of memory to allocate to a function.
|
|
90
91
|
* A value of null restores the defaults of 256MB.
|
|
91
92
|
*/
|
|
92
|
-
memory?: options.MemoryOption | null;
|
|
93
|
+
memory?: options.MemoryOption | Expression<number> | null;
|
|
93
94
|
/**
|
|
94
95
|
* Timeout for the function in sections, possible values are 0 to 540.
|
|
95
96
|
* HTTPS functions can specify a higher timeout.
|
|
@@ -100,19 +101,19 @@ export interface PubSubOptions extends options.EventHandlerOptions {
|
|
|
100
101
|
* maximum timeout of 36,00s (1 hour). Task queue functions have a maximum
|
|
101
102
|
* timeout of 1,800s (30 minutes)
|
|
102
103
|
*/
|
|
103
|
-
timeoutSeconds?: number | null;
|
|
104
|
+
timeoutSeconds?: number | Expression<number> | null;
|
|
104
105
|
/**
|
|
105
106
|
* Min number of actual instances to be running at a given time.
|
|
106
107
|
* Instances will be billed for memory allocation and 10% of CPU allocation
|
|
107
108
|
* while idle.
|
|
108
109
|
* A value of null restores the default min instances.
|
|
109
110
|
*/
|
|
110
|
-
minInstances?: number | null;
|
|
111
|
+
minInstances?: number | Expression<number> | null;
|
|
111
112
|
/**
|
|
112
113
|
* Max number of instances to be running in parallel.
|
|
113
114
|
* A value of null restores the default max instances.
|
|
114
115
|
*/
|
|
115
|
-
maxInstances?: number | null;
|
|
116
|
+
maxInstances?: number | Expression<number> | null;
|
|
116
117
|
/**
|
|
117
118
|
* Number of requests a function can serve at once.
|
|
118
119
|
* Can only be applied to functions running on Cloud Functions v2.
|
|
@@ -120,7 +121,7 @@ export interface PubSubOptions extends options.EventHandlerOptions {
|
|
|
120
121
|
* Concurrency cannot be set to any value other than 1 if `cpu` is less than 1.
|
|
121
122
|
* The maximum value for concurrency is 1,000.
|
|
122
123
|
*/
|
|
123
|
-
concurrency?: number | null;
|
|
124
|
+
concurrency?: number | Expression<number> | null;
|
|
124
125
|
/**
|
|
125
126
|
* Fractional number of CPUs to allocate to a function.
|
|
126
127
|
* Defaults to 1 for functions with <= 2GB RAM and increases for larger memory sizes.
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { timezone } from '../../common/timezone';
|
|
2
|
+
import { ManifestRequiredAPI } from '../../runtime/manifest';
|
|
3
|
+
import * as options from '../options';
|
|
4
|
+
import { HttpsFunction } from './https';
|
|
5
|
+
/**
|
|
6
|
+
* Interface representing a ScheduleEvent that is passed to the function handler.
|
|
7
|
+
*/
|
|
8
|
+
export interface ScheduledEvent {
|
|
9
|
+
/**
|
|
10
|
+
* The Cloud Scheduler job name.
|
|
11
|
+
* Populated via the X-CloudScheduler-JobName header.
|
|
12
|
+
*
|
|
13
|
+
* If invoked manually, this field is undefined.
|
|
14
|
+
*/
|
|
15
|
+
jobName?: string;
|
|
16
|
+
/**
|
|
17
|
+
* For Cloud Scheduler jobs specified in the unix-cron format,
|
|
18
|
+
* this is the job schedule time in RFC3339 UTC "Zulu" format.
|
|
19
|
+
* Populated via the X-CloudScheduler-ScheduleTime header.
|
|
20
|
+
*
|
|
21
|
+
* If the schedule is manually triggered, this field will be
|
|
22
|
+
* the function execution time.
|
|
23
|
+
*/
|
|
24
|
+
scheduleTime: string;
|
|
25
|
+
}
|
|
26
|
+
/** The Cloud Function type for Schedule triggers. */
|
|
27
|
+
export interface ScheduleFunction extends HttpsFunction {
|
|
28
|
+
__requiredAPIs?: ManifestRequiredAPI[];
|
|
29
|
+
run(data: ScheduledEvent): void | Promise<void>;
|
|
30
|
+
}
|
|
31
|
+
/** Options that can be set on a Schedule trigger. */
|
|
32
|
+
export interface ScheduleOptions extends options.GlobalOptions {
|
|
33
|
+
/** The schedule, in Unix Crontab or AppEngine syntax. */
|
|
34
|
+
schedule: string;
|
|
35
|
+
/** The timezone that the schedule executes in. */
|
|
36
|
+
timeZone?: timezone;
|
|
37
|
+
/** The number of retry attempts for a failed run. */
|
|
38
|
+
retryCount?: number;
|
|
39
|
+
/** The time limit for retrying. */
|
|
40
|
+
maxRetrySeconds?: number;
|
|
41
|
+
/** The minimum time to wait before retying. */
|
|
42
|
+
minBackoffSeconds?: number;
|
|
43
|
+
/** The maximum time to wait before retrying. */
|
|
44
|
+
maxBackoffSeconds?: number;
|
|
45
|
+
/** The time between will double max doublings times. */
|
|
46
|
+
maxDoublings?: number;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Handler for scheduled functions. Triggered whenever the associated
|
|
50
|
+
* scheduler job sends a http request.
|
|
51
|
+
* @param schedule - The schedule, in Unix Crontab or AppEngine syntax.
|
|
52
|
+
* @param handler - A function to execute when triggered.
|
|
53
|
+
* @returns A function that you can export and deploy.
|
|
54
|
+
*/
|
|
55
|
+
export declare function onSchedule(schedule: string, handler: (req: ScheduledEvent) => void | Promise<void>): ScheduleFunction;
|
|
56
|
+
/**
|
|
57
|
+
* Handler for scheduled functions. Triggered whenever the associated
|
|
58
|
+
* scheduler job sends a http request.
|
|
59
|
+
* @param options - Options to set on scheduled functions.
|
|
60
|
+
* @param handler - A function to execute when triggered.
|
|
61
|
+
* @returns A function that you can export and deploy.
|
|
62
|
+
*/
|
|
63
|
+
export declare function onSchedule(options: ScheduleOptions, handler: (req: ScheduledEvent) => void | Promise<void>): ScheduleFunction;
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// The MIT License (MIT)
|
|
3
|
+
//
|
|
4
|
+
// Copyright (c) 2022 Firebase
|
|
5
|
+
//
|
|
6
|
+
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
// of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
// in the Software without restriction, including without limitation the rights
|
|
9
|
+
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
// copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
// furnished to do so, subject to the following conditions:
|
|
12
|
+
//
|
|
13
|
+
// The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
// copies or substantial portions of the Software.
|
|
15
|
+
//
|
|
16
|
+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
// SOFTWARE.
|
|
23
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
+
exports.onSchedule = exports.getOpts = void 0;
|
|
25
|
+
const encoding_1 = require("../../common/encoding");
|
|
26
|
+
const logger = require("../../logger");
|
|
27
|
+
const options = require("../options");
|
|
28
|
+
/** @internal */
|
|
29
|
+
function getOpts(args) {
|
|
30
|
+
if (typeof args === 'string') {
|
|
31
|
+
return {
|
|
32
|
+
schedule: args,
|
|
33
|
+
opts: {},
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
return {
|
|
37
|
+
schedule: args.schedule,
|
|
38
|
+
timeZone: args.timeZone,
|
|
39
|
+
retryCount: args.retryCount,
|
|
40
|
+
maxRetrySeconds: args.maxRetrySeconds,
|
|
41
|
+
minBackoffSeconds: args.minBackoffSeconds,
|
|
42
|
+
maxBackoffSeconds: args.maxBackoffSeconds,
|
|
43
|
+
maxDoublings: args.maxDoublings,
|
|
44
|
+
opts: args,
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
exports.getOpts = getOpts;
|
|
48
|
+
/**
|
|
49
|
+
* Handler for scheduled functions. Triggered whenever the associated
|
|
50
|
+
* scheduler job sends a http request.
|
|
51
|
+
* @param args - Either a schedule or an object containing function options.
|
|
52
|
+
* @param handler - A function to execute when triggered.
|
|
53
|
+
* @returns A function that you can export and deploy.
|
|
54
|
+
*/
|
|
55
|
+
function onSchedule(args, handler) {
|
|
56
|
+
const separatedOpts = getOpts(args);
|
|
57
|
+
const func = async (req, res) => {
|
|
58
|
+
const event = {
|
|
59
|
+
jobName: req.header('X-CloudScheduler-JobName') || undefined,
|
|
60
|
+
scheduleTime: req.header('X-CloudScheduler-ScheduleTime') || new Date().toISOString(),
|
|
61
|
+
};
|
|
62
|
+
try {
|
|
63
|
+
await handler(event);
|
|
64
|
+
res.status(200).send();
|
|
65
|
+
}
|
|
66
|
+
catch (err) {
|
|
67
|
+
logger.error(err.message);
|
|
68
|
+
res.status(500).send();
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
func.run = handler;
|
|
72
|
+
const baseOptsEndpoint = options.optionsToEndpoint(options.getGlobalOptions());
|
|
73
|
+
const specificOptsEndpoint = options.optionsToEndpoint(separatedOpts.opts);
|
|
74
|
+
const ep = {
|
|
75
|
+
platform: 'gcfv2',
|
|
76
|
+
...baseOptsEndpoint,
|
|
77
|
+
...specificOptsEndpoint,
|
|
78
|
+
labels: {
|
|
79
|
+
...baseOptsEndpoint === null || baseOptsEndpoint === void 0 ? void 0 : baseOptsEndpoint.labels,
|
|
80
|
+
...specificOptsEndpoint === null || specificOptsEndpoint === void 0 ? void 0 : specificOptsEndpoint.labels,
|
|
81
|
+
},
|
|
82
|
+
scheduleTrigger: {
|
|
83
|
+
schedule: separatedOpts.schedule,
|
|
84
|
+
retryConfig: {},
|
|
85
|
+
},
|
|
86
|
+
};
|
|
87
|
+
(0, encoding_1.copyIfPresent)(ep.scheduleTrigger, separatedOpts, 'timeZone');
|
|
88
|
+
(0, encoding_1.copyIfPresent)(ep.scheduleTrigger.retryConfig, separatedOpts, 'retryCount', 'maxRetrySeconds', 'minBackoffSeconds', 'maxBackoffSeconds', 'maxDoublings');
|
|
89
|
+
func.__endpoint = ep;
|
|
90
|
+
func.__requiredAPIs = [
|
|
91
|
+
{
|
|
92
|
+
api: 'cloudscheduler.googleapis.com',
|
|
93
|
+
reason: 'Needed for scheduled functions.',
|
|
94
|
+
},
|
|
95
|
+
];
|
|
96
|
+
return func;
|
|
97
|
+
}
|
|
98
|
+
exports.onSchedule = onSchedule;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { CloudEvent, CloudFunction } from '../core';
|
|
2
2
|
import * as options from '../options';
|
|
3
|
+
import { Expression } from '../params';
|
|
3
4
|
/**
|
|
4
5
|
* An object within Google Cloud Storage.
|
|
5
6
|
* Ref: https://github.com/googleapis/google-cloudevents-nodejs/blob/main/cloud/storage/v1/StorageObjectData.ts
|
|
@@ -165,7 +166,7 @@ export interface StorageOptions extends options.EventHandlerOptions {
|
|
|
165
166
|
* Amount of memory to allocate to a function.
|
|
166
167
|
* A value of null restores the defaults of 256MB.
|
|
167
168
|
*/
|
|
168
|
-
memory?: options.MemoryOption | null;
|
|
169
|
+
memory?: options.MemoryOption | Expression<number> | null;
|
|
169
170
|
/**
|
|
170
171
|
* Timeout for the function in sections, possible values are 0 to 540.
|
|
171
172
|
* HTTPS functions can specify a higher timeout.
|
|
@@ -176,19 +177,19 @@ export interface StorageOptions extends options.EventHandlerOptions {
|
|
|
176
177
|
* maximum timeout of 36,00s (1 hour). Task queue functions have a maximum
|
|
177
178
|
* timeout of 1,800s (30 minutes)
|
|
178
179
|
*/
|
|
179
|
-
timeoutSeconds?: number | null;
|
|
180
|
+
timeoutSeconds?: number | Expression<number> | null;
|
|
180
181
|
/**
|
|
181
182
|
* Min number of actual instances to be running at a given time.
|
|
182
183
|
* Instances will be billed for memory allocation and 10% of CPU allocation
|
|
183
184
|
* while idle.
|
|
184
185
|
* A value of null restores the default min instances.
|
|
185
186
|
*/
|
|
186
|
-
minInstances?: number | null;
|
|
187
|
+
minInstances?: number | Expression<number> | null;
|
|
187
188
|
/**
|
|
188
189
|
* Max number of instances to be running in parallel.
|
|
189
190
|
* A value of null restores the default max instances.
|
|
190
191
|
*/
|
|
191
|
-
maxInstances?: number | null;
|
|
192
|
+
maxInstances?: number | Expression<number> | null;
|
|
192
193
|
/**
|
|
193
194
|
* Number of requests a function can serve at once.
|
|
194
195
|
* Can only be applied to functions running on Cloud Functions v2.
|
|
@@ -196,7 +197,7 @@ export interface StorageOptions extends options.EventHandlerOptions {
|
|
|
196
197
|
* Concurrency cannot be set to any value other than 1 if `cpu` is less than 1.
|
|
197
198
|
* The maximum value for concurrency is 1,000.
|
|
198
199
|
*/
|
|
199
|
-
concurrency?: number | null;
|
|
200
|
+
concurrency?: number | Expression<number> | null;
|
|
200
201
|
/**
|
|
201
202
|
* Fractional number of CPUs to allocate to a function.
|
|
202
203
|
* Defaults to 1 for functions with <= 2GB RAM and increases for larger memory sizes.
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { AuthData, RateLimits, Request, RetryConfig } from '../../common/providers/tasks';
|
|
2
2
|
import * as options from '../options';
|
|
3
3
|
import { HttpsFunction } from './https';
|
|
4
|
-
|
|
4
|
+
import { Expression } from '../params';
|
|
5
|
+
export { AuthData, Request };
|
|
5
6
|
export interface TaskQueueOptions extends options.EventHandlerOptions {
|
|
6
7
|
/** How a task should be retried in the event of a non-2xx return. */
|
|
7
8
|
retryConfig?: RetryConfig;
|
|
@@ -22,7 +23,7 @@ export interface TaskQueueOptions extends options.EventHandlerOptions {
|
|
|
22
23
|
* Amount of memory to allocate to a function.
|
|
23
24
|
* A value of null restores the defaults of 256MB.
|
|
24
25
|
*/
|
|
25
|
-
memory?: options.MemoryOption | null;
|
|
26
|
+
memory?: options.MemoryOption | Expression<number> | null;
|
|
26
27
|
/**
|
|
27
28
|
* Timeout for the function in sections, possible values are 0 to 540.
|
|
28
29
|
* HTTPS functions can specify a higher timeout.
|
|
@@ -33,19 +34,19 @@ export interface TaskQueueOptions extends options.EventHandlerOptions {
|
|
|
33
34
|
* maximum timeout of 36,00s (1 hour). Task queue functions have a maximum
|
|
34
35
|
* timeout of 1,800s (30 minutes)
|
|
35
36
|
*/
|
|
36
|
-
timeoutSeconds?: number | null;
|
|
37
|
+
timeoutSeconds?: number | Expression<number> | null;
|
|
37
38
|
/**
|
|
38
39
|
* Min number of actual instances to be running at a given time.
|
|
39
40
|
* Instances will be billed for memory allocation and 10% of CPU allocation
|
|
40
41
|
* while idle.
|
|
41
42
|
* A value of null restores the default min instances.
|
|
42
43
|
*/
|
|
43
|
-
minInstances?: number | null;
|
|
44
|
+
minInstances?: number | Expression<number> | null;
|
|
44
45
|
/**
|
|
45
46
|
* Max number of instances to be running in parallel.
|
|
46
47
|
* A value of null restores the default max instances.
|
|
47
48
|
*/
|
|
48
|
-
maxInstances?: number | null;
|
|
49
|
+
maxInstances?: number | Expression<number> | null;
|
|
49
50
|
/**
|
|
50
51
|
* Number of requests a function can serve at once.
|
|
51
52
|
* Can only be applied to functions running on Cloud Functions v2.
|
|
@@ -53,7 +54,7 @@ export interface TaskQueueOptions extends options.EventHandlerOptions {
|
|
|
53
54
|
* Concurrency cannot be set to any value other than 1 if `cpu` is less than 1.
|
|
54
55
|
* The maximum value for concurrency is 1,000.
|
|
55
56
|
*/
|
|
56
|
-
concurrency?: number | null;
|
|
57
|
+
concurrency?: number | Expression<number> | null;
|
|
57
58
|
/**
|
|
58
59
|
* Fractional number of CPUs to allocate to a function.
|
|
59
60
|
* Defaults to 1 for functions with <= 2GB RAM and increases for larger memory sizes.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "firebase-functions",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.23.0",
|
|
4
4
|
"description": "Firebase SDK for Cloud Functions",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"firebase",
|
|
@@ -66,7 +66,8 @@
|
|
|
66
66
|
"./v2/alerts/crashlytics": "./lib/v2/providers/alerts/crashlytics.js",
|
|
67
67
|
"./v2/eventarc": "./lib/v2/providers/eventarc.js",
|
|
68
68
|
"./v2/identity": "./lib/v2/providers/identity.js",
|
|
69
|
-
"./v2/database": "./lib/v2/providers/database.js"
|
|
69
|
+
"./v2/database": "./lib/v2/providers/database.js",
|
|
70
|
+
"./v2/scheduler": "./lib/v2/providers/scheduler.js"
|
|
70
71
|
},
|
|
71
72
|
"typesVersions": {
|
|
72
73
|
"*": {
|
|
@@ -153,6 +154,9 @@
|
|
|
153
154
|
],
|
|
154
155
|
"v2/tasks": [
|
|
155
156
|
"lib/v2/providers/tasks"
|
|
157
|
+
],
|
|
158
|
+
"v2/scheduler": [
|
|
159
|
+
"lib/v2/providers/scheduler"
|
|
156
160
|
]
|
|
157
161
|
}
|
|
158
162
|
},
|
|
@@ -162,7 +166,8 @@
|
|
|
162
166
|
"scripts": {
|
|
163
167
|
"apidocs": "node docgen/generate-docs.js",
|
|
164
168
|
"docgen:v1:extract": "api-extractor run -c docgen/api-extractor.v1.json --local",
|
|
165
|
-
"docgen:v1:
|
|
169
|
+
"docgen:v1:toc": "ts-node docgen/toc.ts --input docgen/v1/markdown --output docgen/v1/markdown/toc --path /docs/reference/functions",
|
|
170
|
+
"docgen:v1:gen": "api-documenter-fire markdown -i docgen/v1 -o docgen/v1/markdown --project functions && npm run docgen:v1:toc",
|
|
166
171
|
"docgen:v1": "npm run build && npm run docgen:v1:extract && npm run docgen:v1:gen",
|
|
167
172
|
"docgen:v2:extract": "api-extractor run -c docgen/api-extractor.v2.json --local",
|
|
168
173
|
"docgen:v2:toc": "ts-node docgen/toc.ts --input docgen/v2/markdown --output docgen/v2/markdown/toc --path /docs/functions/beta/reference",
|
|
@@ -177,7 +182,8 @@
|
|
|
177
182
|
"lint": "tslint --config tslint.json --project tsconfig.json ",
|
|
178
183
|
"lint:fix": "tslint --config tslint.json --fix --project tsconfig.json",
|
|
179
184
|
"test": "mocha --file ./mocha/setup.ts \"spec/**/*.spec.ts\"",
|
|
180
|
-
"test:bin": "./scripts/bin-test/run.sh"
|
|
185
|
+
"test:bin": "./scripts/bin-test/run.sh",
|
|
186
|
+
"test:postmerge": "./integration_test/run_tests.sh"
|
|
181
187
|
},
|
|
182
188
|
"dependencies": {
|
|
183
189
|
"@types/cors": "^2.8.5",
|
|
@@ -188,7 +194,7 @@
|
|
|
188
194
|
"node-fetch": "^2.6.7"
|
|
189
195
|
},
|
|
190
196
|
"devDependencies": {
|
|
191
|
-
"@firebase/api-documenter": "^0.
|
|
197
|
+
"@firebase/api-documenter": "^0.2.0",
|
|
192
198
|
"@microsoft/api-documenter": "^7.13.45",
|
|
193
199
|
"@microsoft/api-extractor": "^7.18.7",
|
|
194
200
|
"@types/chai": "^4.1.7",
|
|
@@ -205,7 +211,7 @@
|
|
|
205
211
|
"chai": "^4.2.0",
|
|
206
212
|
"chai-as-promised": "^7.1.1",
|
|
207
213
|
"child-process-promise": "^2.2.1",
|
|
208
|
-
"firebase-admin": "^10.
|
|
214
|
+
"firebase-admin": "^10.3.0",
|
|
209
215
|
"js-yaml": "^3.13.1",
|
|
210
216
|
"jsdom": "^16.2.1",
|
|
211
217
|
"jsonwebtoken": "^8.5.1",
|
|
@@ -224,7 +230,7 @@
|
|
|
224
230
|
"tslint-config-prettier": "^1.18.0",
|
|
225
231
|
"tslint-no-unused-expression-chai": "^0.1.4",
|
|
226
232
|
"tslint-plugin-prettier": "^2.0.1",
|
|
227
|
-
"typedoc": "0.
|
|
233
|
+
"typedoc": "0.23.7",
|
|
228
234
|
"typescript": "^4.3.5",
|
|
229
235
|
"yargs": "^15.3.1"
|
|
230
236
|
},
|