firebase-functions 4.2.0 → 4.3.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/common/change.js +4 -4
- package/lib/common/encoding.d.ts +3 -2
- package/lib/common/encoding.js +4 -0
- package/lib/common/params.d.ts +4 -4
- package/lib/common/providers/database.js +1 -6
- package/lib/common/providers/firestore.d.ts +1 -0
- package/lib/common/providers/firestore.js +106 -0
- package/lib/common/providers/https.d.ts +3 -3
- package/lib/common/providers/https.js +28 -1
- package/lib/common/providers/identity.d.ts +3 -3
- package/lib/common/providers/tasks.d.ts +1 -1
- package/lib/common/timezone.d.ts +1 -1
- package/lib/common/utilities/path-pattern.js +5 -5
- package/lib/logger/index.d.ts +1 -1
- package/lib/params/index.d.ts +1 -1
- package/lib/params/types.d.ts +5 -5
- package/lib/v1/function-builder.d.ts +4 -2
- package/lib/v1/function-builder.js +7 -5
- package/lib/v1/function-configuration.d.ts +5 -5
- package/lib/v1/providers/auth.js +3 -3
- package/lib/v1/providers/firestore.d.ts +2 -2
- package/lib/v1/providers/firestore.js +4 -39
- package/lib/v1/providers/testLab.d.ts +4 -4
- package/lib/v2/index.d.ts +2 -1
- package/lib/v2/index.js +3 -1
- package/lib/v2/options.d.ts +8 -8
- package/lib/v2/providers/alerts/alerts.d.ts +3 -3
- package/lib/v2/providers/alerts/appDistribution.d.ts +2 -2
- package/lib/v2/providers/alerts/crashlytics.d.ts +2 -2
- package/lib/v2/providers/database.d.ts +3 -3
- package/lib/v2/providers/database.js +8 -2
- package/lib/v2/providers/eventarc.d.ts +2 -2
- package/lib/v2/providers/firestore.d.ts +91 -0
- package/lib/v2/providers/firestore.js +243 -0
- package/lib/v2/providers/https.d.ts +3 -3
- package/lib/v2/providers/identity.d.ts +2 -2
- package/lib/v2/providers/pubsub.d.ts +2 -2
- package/lib/v2/providers/remoteConfig.d.ts +2 -2
- package/lib/v2/providers/storage.d.ts +2 -2
- package/lib/v2/providers/tasks.d.ts +3 -3
- package/lib/v2/providers/testLab.d.ts +2 -2
- package/lib/v2/trace.d.ts +1 -1
- package/package.json +13 -6
- package/protos/README.md +15 -0
- package/protos/compiledFirestore.d.ts +1342 -0
- package/protos/compiledFirestore.js +3514 -0
- package/protos/update.sh +75 -0
|
@@ -91,7 +91,7 @@ export interface PubSubOptions extends options.EventHandlerOptions {
|
|
|
91
91
|
/**
|
|
92
92
|
* Region where functions should be deployed.
|
|
93
93
|
*/
|
|
94
|
-
region?: options.SupportedRegion | string;
|
|
94
|
+
region?: options.SupportedRegion | string | Expression<string> | ResetValue;
|
|
95
95
|
/**
|
|
96
96
|
* Amount of memory to allocate to a function.
|
|
97
97
|
*/
|
|
@@ -152,7 +152,7 @@ export interface PubSubOptions extends options.EventHandlerOptions {
|
|
|
152
152
|
/**
|
|
153
153
|
* Specific service account for the function to run as.
|
|
154
154
|
*/
|
|
155
|
-
serviceAccount?: string | ResetValue;
|
|
155
|
+
serviceAccount?: string | Expression<string> | ResetValue;
|
|
156
156
|
/**
|
|
157
157
|
* Ingress settings which control where this function can be called from.
|
|
158
158
|
*/
|
|
@@ -10,7 +10,7 @@ export interface ConfigUser {
|
|
|
10
10
|
imageUrl: string;
|
|
11
11
|
}
|
|
12
12
|
/** What type of update was associated with the Remote Config template version. */
|
|
13
|
-
export
|
|
13
|
+
export type ConfigUpdateOrigin =
|
|
14
14
|
/** Catch-all for unrecognized values. */
|
|
15
15
|
"REMOTE_CONFIG_UPDATE_ORIGIN_UNSPECIFIED"
|
|
16
16
|
/** The update came from the Firebase UI. */
|
|
@@ -20,7 +20,7 @@ export declare type ConfigUpdateOrigin =
|
|
|
20
20
|
/** The update came from the Firebase Admin Node SDK. */
|
|
21
21
|
| "ADMIN_SDK_NODE";
|
|
22
22
|
/** Where the Remote Config update action originated. */
|
|
23
|
-
export
|
|
23
|
+
export type ConfigUpdateType =
|
|
24
24
|
/** Catch-all for unrecognized enum values */
|
|
25
25
|
"REMOTE_CONFIG_UPDATE_TYPE_UNSPECIFIED"
|
|
26
26
|
/** A regular incremental update */
|
|
@@ -167,7 +167,7 @@ export interface StorageOptions extends options.EventHandlerOptions {
|
|
|
167
167
|
/**
|
|
168
168
|
* Region where functions should be deployed.
|
|
169
169
|
*/
|
|
170
|
-
region?: options.SupportedRegion | string;
|
|
170
|
+
region?: options.SupportedRegion | string | Expression<string> | ResetValue;
|
|
171
171
|
/**
|
|
172
172
|
* Amount of memory to allocate to a function.
|
|
173
173
|
*/
|
|
@@ -228,7 +228,7 @@ export interface StorageOptions extends options.EventHandlerOptions {
|
|
|
228
228
|
/**
|
|
229
229
|
* Specific service account for the function to run as.
|
|
230
230
|
*/
|
|
231
|
-
serviceAccount?: string | ResetValue;
|
|
231
|
+
serviceAccount?: string | Expression<string> | ResetValue;
|
|
232
232
|
/**
|
|
233
233
|
* Ingress settings which control where this function can be called from.
|
|
234
234
|
*/
|
|
@@ -4,7 +4,7 @@ import * as options from "../options";
|
|
|
4
4
|
import { HttpsFunction } from "./https";
|
|
5
5
|
import { Expression } from "../../params";
|
|
6
6
|
import { SecretParam } from "../../params/types";
|
|
7
|
-
export { AuthData, Request };
|
|
7
|
+
export { AuthData, Request, RateLimits, RetryConfig };
|
|
8
8
|
export interface TaskQueueOptions extends options.EventHandlerOptions {
|
|
9
9
|
/** How a task should be retried in the event of a non-2xx return. */
|
|
10
10
|
retryConfig?: RetryConfig;
|
|
@@ -26,7 +26,7 @@ export interface TaskQueueOptions extends options.EventHandlerOptions {
|
|
|
26
26
|
/**
|
|
27
27
|
* Region where functions should be deployed.
|
|
28
28
|
*/
|
|
29
|
-
region?: options.SupportedRegion | string;
|
|
29
|
+
region?: options.SupportedRegion | string | Expression<string> | ResetValue;
|
|
30
30
|
/**
|
|
31
31
|
* Amount of memory to allocate to a function.
|
|
32
32
|
*/
|
|
@@ -87,7 +87,7 @@ export interface TaskQueueOptions extends options.EventHandlerOptions {
|
|
|
87
87
|
/**
|
|
88
88
|
* Specific service account for the function to run as.
|
|
89
89
|
*/
|
|
90
|
-
serviceAccount?: string | ResetValue;
|
|
90
|
+
serviceAccount?: string | Expression<string> | ResetValue;
|
|
91
91
|
/**
|
|
92
92
|
* Ingress settings which control where this function can be called from.
|
|
93
93
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CloudEvent, CloudFunction } from "../core";
|
|
2
2
|
import { EventHandlerOptions } from "../options";
|
|
3
3
|
/** Possible test states for a test matrix. */
|
|
4
|
-
export
|
|
4
|
+
export type TestState =
|
|
5
5
|
/** The default value. This value is used if the state is omitted. */
|
|
6
6
|
"TEST_STATE_UNSPECIFIED"
|
|
7
7
|
/** The test matrix is being validated. */
|
|
@@ -15,7 +15,7 @@ export declare type TestState =
|
|
|
15
15
|
/** The test matrix was not run because the provided inputs are not valid. */
|
|
16
16
|
| "INVALID";
|
|
17
17
|
/** Outcome summary for a finished test matrix. */
|
|
18
|
-
export
|
|
18
|
+
export type OutcomeSummary =
|
|
19
19
|
/** The default value. This value is used if the state is omitted. */
|
|
20
20
|
"OUTCOME_SUMMARY_UNSPECIFIED"
|
|
21
21
|
/**
|
package/lib/v2/trace.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { CloudEvent } from "./core";
|
|
2
|
-
|
|
2
|
+
type CloudEventFunction<T> = (raw: CloudEvent<T>) => any | Promise<any>;
|
|
3
3
|
export declare function wrapTraceContext<T>(handler: CloudEventFunction<T>): CloudEventFunction<T>;
|
|
4
4
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "firebase-functions",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.3.0",
|
|
4
4
|
"description": "Firebase SDK for Cloud Functions",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"firebase",
|
|
@@ -19,7 +19,8 @@
|
|
|
19
19
|
"license": "MIT",
|
|
20
20
|
"author": "Firebase Team",
|
|
21
21
|
"files": [
|
|
22
|
-
"lib"
|
|
22
|
+
"lib",
|
|
23
|
+
"protos"
|
|
23
24
|
],
|
|
24
25
|
"main": "lib/v1/index.js",
|
|
25
26
|
"bin": {
|
|
@@ -59,7 +60,8 @@
|
|
|
59
60
|
"./v2/database": "./lib/v2/providers/database.js",
|
|
60
61
|
"./v2/scheduler": "./lib/v2/providers/scheduler.js",
|
|
61
62
|
"./v2/remoteConfig": "./lib/v2/providers/remoteConfig.js",
|
|
62
|
-
"./v2/testLab": "./lib/v2/providers/testLab.js"
|
|
63
|
+
"./v2/testLab": "./lib/v2/providers/testLab.js",
|
|
64
|
+
"./v2/firestore": "./lib/v2/providers/firestore.js"
|
|
63
65
|
},
|
|
64
66
|
"typesVersions": {
|
|
65
67
|
"*": {
|
|
@@ -158,6 +160,9 @@
|
|
|
158
160
|
],
|
|
159
161
|
"v2/testLab": [
|
|
160
162
|
"lib/v2/providers/testLab"
|
|
163
|
+
],
|
|
164
|
+
"v2/firestore": [
|
|
165
|
+
"lib/v2/providers/firestore"
|
|
161
166
|
]
|
|
162
167
|
}
|
|
163
168
|
},
|
|
@@ -170,7 +175,7 @@
|
|
|
170
175
|
"docgen:v1:gen": "api-documenter-fire markdown -i docgen/v1 -o docgen/v1/markdown --project functions && npm run docgen:v1:toc",
|
|
171
176
|
"docgen:v1": "npm run build && npm run docgen:v1:extract && npm run docgen:v1:gen",
|
|
172
177
|
"docgen:v2:extract": "api-extractor run -c docgen/api-extractor.v2.json --local",
|
|
173
|
-
"docgen:v2:toc": "ts-node docgen/toc.ts --input docgen/v2 --output docgen/v2/markdown/toc --path /docs/functions/
|
|
178
|
+
"docgen:v2:toc": "ts-node docgen/toc.ts --input docgen/v2 --output docgen/v2/markdown/toc --path /docs/reference/functions/2nd-gen/node",
|
|
174
179
|
"docgen:v2:gen": "api-documenter-fire markdown -i docgen/v2 -o docgen/v2/markdown --project functions && npm run docgen:v2:toc",
|
|
175
180
|
"docgen:v2": "npm run build && npm run docgen:v2:extract && npm run docgen:v2:gen",
|
|
176
181
|
"build:pack": "rm -rf lib && npm install && tsc -p tsconfig.release.json && npm pack",
|
|
@@ -193,7 +198,8 @@
|
|
|
193
198
|
"@types/express": "4.17.3",
|
|
194
199
|
"cors": "^2.8.5",
|
|
195
200
|
"express": "^4.17.1",
|
|
196
|
-
"node-fetch": "^2.6.7"
|
|
201
|
+
"node-fetch": "^2.6.7",
|
|
202
|
+
"protobufjs": "^7.2.2"
|
|
197
203
|
},
|
|
198
204
|
"devDependencies": {
|
|
199
205
|
"@firebase/api-documenter": "^0.2.0",
|
|
@@ -224,13 +230,14 @@
|
|
|
224
230
|
"jsdom": "^16.2.1",
|
|
225
231
|
"jsonwebtoken": "^9.0.0",
|
|
226
232
|
"jwk-to-pem": "^2.0.5",
|
|
227
|
-
"mocha": "^
|
|
233
|
+
"mocha": "^10.2.0",
|
|
228
234
|
"mock-require": "^3.0.3",
|
|
229
235
|
"mz": "^2.7.0",
|
|
230
236
|
"nock": "^13.2.9",
|
|
231
237
|
"node-fetch": "^2.6.7",
|
|
232
238
|
"portfinder": "^1.0.28",
|
|
233
239
|
"prettier": "^2.7.1",
|
|
240
|
+
"protobufjs-cli": "^1.1.1",
|
|
234
241
|
"semver": "^7.3.5",
|
|
235
242
|
"sinon": "^7.3.2",
|
|
236
243
|
"ts-node": "^10.4.0",
|
package/protos/README.md
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Generate compiled ProtoBuf
|
|
2
|
+
|
|
3
|
+
Running the script will generate statically-compiled protobufs for decoding `application/protobuf` events. Generate them by running:
|
|
4
|
+
|
|
5
|
+
```
|
|
6
|
+
./update.sh
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
In order to build, the following repos are cloned
|
|
10
|
+
|
|
11
|
+
- https://github.com/googleapis/google-cloudevents
|
|
12
|
+
- https://github.com/googleapis/googleapis
|
|
13
|
+
- https://github.com/google/protobuf
|
|
14
|
+
|
|
15
|
+
The script relies on the [protobufjs-cli](https://github.com/protobufjs/protobuf.js/tree/master/cli#pbts-for-typescript) package to create the compiled js/ts files.
|