firebase-functions 5.1.1 → 6.0.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/README.md +5 -4
- package/lib/v1/config.d.ts +2 -0
- package/lib/v1/config.js +2 -0
- package/lib/v2/index.d.ts +5 -0
- package/lib/v2/index.js +8 -1
- package/package.json +76 -4
package/README.md
CHANGED
|
@@ -23,12 +23,13 @@ _Please avoid double posting across multiple channels!_
|
|
|
23
23
|
|
|
24
24
|
```js
|
|
25
25
|
// functions/index.js
|
|
26
|
-
const
|
|
26
|
+
const { onValueCreated } = require("firebase-functions/database");
|
|
27
|
+
const logger = require("firebase-functions/logger");
|
|
27
28
|
const notifyUsers = require("./notify-users");
|
|
28
29
|
|
|
29
|
-
exports.newPost =
|
|
30
|
-
|
|
31
|
-
return notifyUsers(
|
|
30
|
+
exports.newPost = onValueCreated({ ref: "/posts/{postId}" }, (event) => {
|
|
31
|
+
logger.info("Received new post with ID:", event.params.postId);
|
|
32
|
+
return notifyUsers(event.data.val());
|
|
32
33
|
});
|
|
33
34
|
```
|
|
34
35
|
|
package/lib/v1/config.d.ts
CHANGED
|
@@ -4,5 +4,7 @@ export { firebaseConfig } from "../common/config";
|
|
|
4
4
|
* keys or other settings. You can set configuration values using the
|
|
5
5
|
* Firebase CLI as described in
|
|
6
6
|
* https://firebase.google.com/docs/functions/config-env.
|
|
7
|
+
*
|
|
8
|
+
* @deprecated Using functions.config() is discouraged. See https://firebase.google.com/docs/functions/config-env.
|
|
7
9
|
*/
|
|
8
10
|
export declare function config(): Record<string, any>;
|
package/lib/v1/config.js
CHANGED
|
@@ -36,6 +36,8 @@ exports.resetCache = resetCache;
|
|
|
36
36
|
* keys or other settings. You can set configuration values using the
|
|
37
37
|
* Firebase CLI as described in
|
|
38
38
|
* https://firebase.google.com/docs/functions/config-env.
|
|
39
|
+
*
|
|
40
|
+
* @deprecated Using functions.config() is discouraged. See https://firebase.google.com/docs/functions/config-env.
|
|
39
41
|
*/
|
|
40
42
|
function config() {
|
|
41
43
|
// K_CONFIGURATION is only set in GCFv2
|
package/lib/v2/index.d.ts
CHANGED
|
@@ -24,3 +24,8 @@ export { CloudFunction, CloudEvent, ParamsOf, onInit } from "./core";
|
|
|
24
24
|
export { Change } from "../common/change";
|
|
25
25
|
import * as params from "../params";
|
|
26
26
|
export { params };
|
|
27
|
+
export { config } from "../v1/config";
|
|
28
|
+
import { setApp as setEmulatedAdminApp } from "../common/app";
|
|
29
|
+
export declare const app: {
|
|
30
|
+
setEmulatedAdminApp: typeof setEmulatedAdminApp;
|
|
31
|
+
};
|
package/lib/v2/index.js
CHANGED
|
@@ -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.params = exports.Change = exports.onInit = exports.setGlobalOptions = exports.firestore = exports.testLab = exports.remoteConfig = exports.scheduler = exports.eventarc = exports.tasks = exports.logger = exports.pubsub = exports.identity = exports.https = exports.storage = exports.database = exports.alerts = void 0;
|
|
24
|
+
exports.app = exports.config = exports.params = exports.Change = exports.onInit = exports.setGlobalOptions = exports.firestore = exports.testLab = exports.remoteConfig = exports.scheduler = exports.eventarc = exports.tasks = exports.logger = exports.pubsub = exports.identity = exports.https = exports.storage = exports.database = exports.alerts = void 0;
|
|
25
25
|
/**
|
|
26
26
|
* The 2nd gen API for Cloud Functions for Firebase.
|
|
27
27
|
* This SDK supports deep imports. For example, the namespace
|
|
@@ -64,3 +64,10 @@ Object.defineProperty(exports, "Change", { enumerable: true, get: function () {
|
|
|
64
64
|
// NOTE: Equivalent to `export * as params from "../params"` but api-extractor doesn't support that syntax.
|
|
65
65
|
const params = require("../params");
|
|
66
66
|
exports.params = params;
|
|
67
|
+
// NOTE: Required to support the Functions Emulator which monkey patches `functions.config()`
|
|
68
|
+
// TODO(danielylee): Remove in next major release.
|
|
69
|
+
var config_1 = require("../v1/config");
|
|
70
|
+
Object.defineProperty(exports, "config", { enumerable: true, get: function () { return config_1.config; } });
|
|
71
|
+
// Required for v1 Emulator support.
|
|
72
|
+
const app_1 = require("../common/app");
|
|
73
|
+
exports.app = { setEmulatedAdminApp: app_1.setApp };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "firebase-functions",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.0.1",
|
|
4
4
|
"description": "Firebase SDK for Cloud Functions",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"firebase",
|
|
@@ -22,13 +22,12 @@
|
|
|
22
22
|
"lib",
|
|
23
23
|
"protos"
|
|
24
24
|
],
|
|
25
|
-
"main": "lib/
|
|
25
|
+
"main": "lib/v2/index.js",
|
|
26
26
|
"bin": {
|
|
27
27
|
"firebase-functions": "./lib/bin/firebase-functions.js"
|
|
28
28
|
},
|
|
29
|
-
"types": "lib/
|
|
29
|
+
"types": "lib/v2/index.d.ts",
|
|
30
30
|
"exports": {
|
|
31
|
-
".": "./lib/v1/index.js",
|
|
32
31
|
"./logger/compat": "./lib/logger/compat.js",
|
|
33
32
|
"./logger": "./lib/logger/index.js",
|
|
34
33
|
"./params": "./lib/params/index.js",
|
|
@@ -43,6 +42,25 @@
|
|
|
43
42
|
"./v1/storage": "./lib/v1/providers/storage.js",
|
|
44
43
|
"./v1/tasks": "./lib/v1/providers/tasks.js",
|
|
45
44
|
"./v1/testLab": "./lib/v1/providers/testLab.js",
|
|
45
|
+
".": "./lib/v2/index.js",
|
|
46
|
+
"./core": "./lib/v2/core.js",
|
|
47
|
+
"./options": "./lib/v2/options.js",
|
|
48
|
+
"./https": "./lib/v2/providers/https.js",
|
|
49
|
+
"./pubsub": "./lib/v2/providers/pubsub.js",
|
|
50
|
+
"./storage": "./lib/v2/providers/storage.js",
|
|
51
|
+
"./tasks": "./lib/v2/providers/tasks.js",
|
|
52
|
+
"./alerts": "./lib/v2/providers/alerts/index.js",
|
|
53
|
+
"./alerts/appDistribution": "./lib/v2/providers/alerts/appDistribution.js",
|
|
54
|
+
"./alerts/billing": "./lib/v2/providers/alerts/billing.js",
|
|
55
|
+
"./alerts/crashlytics": "./lib/v2/providers/alerts/crashlytics.js",
|
|
56
|
+
"./alerts/performance": "./lib/v2/providers/alerts/performance.js",
|
|
57
|
+
"./eventarc": "./lib/v2/providers/eventarc.js",
|
|
58
|
+
"./identity": "./lib/v2/providers/identity.js",
|
|
59
|
+
"./database": "./lib/v2/providers/database.js",
|
|
60
|
+
"./scheduler": "./lib/v2/providers/scheduler.js",
|
|
61
|
+
"./remoteConfig": "./lib/v2/providers/remoteConfig.js",
|
|
62
|
+
"./testLab": "./lib/v2/providers/testLab.js",
|
|
63
|
+
"./firestore": "./lib/v2/providers/firestore.js",
|
|
46
64
|
"./v2": "./lib/v2/index.js",
|
|
47
65
|
"./v2/core": "./lib/v2/core.js",
|
|
48
66
|
"./v2/options": "./lib/v2/options.js",
|
|
@@ -107,6 +125,60 @@
|
|
|
107
125
|
"v1/testLab": [
|
|
108
126
|
"lib/v1/providers/testLab"
|
|
109
127
|
],
|
|
128
|
+
"core": [
|
|
129
|
+
"./lib/v2/core"
|
|
130
|
+
],
|
|
131
|
+
"options": [
|
|
132
|
+
"./lib/v2/options"
|
|
133
|
+
],
|
|
134
|
+
"https": [
|
|
135
|
+
"./lib/v2/providers/https"
|
|
136
|
+
],
|
|
137
|
+
"pubsub": [
|
|
138
|
+
"./lib/v2/providers/pubsub"
|
|
139
|
+
],
|
|
140
|
+
"storage": [
|
|
141
|
+
"./lib/v2/providers/storage"
|
|
142
|
+
],
|
|
143
|
+
"tasks": [
|
|
144
|
+
"./lib/v2/providers/tasks"
|
|
145
|
+
],
|
|
146
|
+
"alerts": [
|
|
147
|
+
"./lib/v2/providers/alerts/index"
|
|
148
|
+
],
|
|
149
|
+
"alerts/appDistribution": [
|
|
150
|
+
"./lib/v2/providers/alerts/appDistribution"
|
|
151
|
+
],
|
|
152
|
+
"alerts/billing": [
|
|
153
|
+
"./lib/v2/providers/alerts/billing"
|
|
154
|
+
],
|
|
155
|
+
"alerts/crashlytics": [
|
|
156
|
+
"./lib/v2/providers/alerts/crashlytics"
|
|
157
|
+
],
|
|
158
|
+
"alerts/performance": [
|
|
159
|
+
"./lib/v2/providers/alerts/performance"
|
|
160
|
+
],
|
|
161
|
+
"eventarc": [
|
|
162
|
+
"./lib/v2/providers/eventarc"
|
|
163
|
+
],
|
|
164
|
+
"identity": [
|
|
165
|
+
"./lib/v2/providers/identity"
|
|
166
|
+
],
|
|
167
|
+
"database": [
|
|
168
|
+
"./lib/v2/providers/database"
|
|
169
|
+
],
|
|
170
|
+
"scheduler": [
|
|
171
|
+
"./lib/v2/providers/scheduler"
|
|
172
|
+
],
|
|
173
|
+
"remoteConfig": [
|
|
174
|
+
"./lib/v2/providers/remoteConfig"
|
|
175
|
+
],
|
|
176
|
+
"testLab": [
|
|
177
|
+
"./lib/v2/providers/testLab"
|
|
178
|
+
],
|
|
179
|
+
"firestore": [
|
|
180
|
+
"./lib/v2/providers/firestore"
|
|
181
|
+
],
|
|
110
182
|
"v2": [
|
|
111
183
|
"lib/v2"
|
|
112
184
|
],
|