firebase-functions
Advanced tools
Comparing version 0.5.6 to 0.5.7
@@ -1,4 +0,1 @@ | ||
important - Update firebase-admin peer dependency to v4.2.1. Developer needs to run “npm install --save firebase-admin” inside the functions directory. | ||
fixed - event.data.val() no longer returns array of nulls when the database node has a “length” key. | ||
fixed - Fixed bug where event.data.forEach(snapshot => {}) caused snapshot.key to be a concatenation of the parent and child keys. | ||
fixed - Fixed bug where nested storage objects had literal slashes in mediaLink property, instead of URL-escaped slashes. | ||
feature - Add support for locally emulating functions.config().firebase via Firebase CLI. |
@@ -37,20 +37,21 @@ "use strict"; | ||
function init(credential) { | ||
var loaded; | ||
var loadedFromFile = {}; | ||
var firebaseEnv = {}; | ||
if (process.env.FIREBASE_PROJECT) { | ||
firebaseEnv = { firebase: JSON.parse(process.env.FIREBASE_PROJECT) }; | ||
} | ||
try { | ||
loaded = require('../../../.runtimeconfig.json'); | ||
var path = process.env.CLOUD_RUNTIME_CONFIG || '../../../.runtimeconfig.json'; | ||
loadedFromFile = require(path); | ||
} | ||
catch (e) { | ||
try { | ||
loaded = require('../../../config.json'); | ||
} | ||
catch (e) { | ||
throw new Error('functions.config() is not available. ' + | ||
'Please use the latest version of the Firebase CLI to deploy this function.'); | ||
} | ||
// Do nothing | ||
} | ||
if (!_.has(loaded, 'firebase')) { | ||
throw new Error('Firebase config variables are missing.'); | ||
var merged = _.merge({}, loadedFromFile, firebaseEnv); | ||
if (!_.has(merged, 'firebase')) { | ||
throw new Error('Firebase config variables are not available. ' + | ||
'Please use the latest version of the Firebase CLI to deploy this function.'); | ||
} | ||
_.set(loaded, 'firebase.credential', credential); | ||
config.singleton = loaded; | ||
_.set(merged, 'firebase.credential', credential); | ||
config.singleton = merged; | ||
} |
@@ -60,3 +60,4 @@ "use strict"; | ||
if (!databaseURL) { | ||
throw new Error('Missing expected config value firebase.databaseURL'); | ||
throw new Error('Missing expected config value firebase.databaseURL, ' + | ||
'config is actually' + JSON.stringify(index_1.config())); | ||
} | ||
@@ -63,0 +64,0 @@ var match = databaseURL.match(databaseURLRegex); |
{ | ||
"name": "firebase-functions", | ||
"version": "0.5.6", | ||
"version": "0.5.7", | ||
"description": "Firebase SDK for Cloud Functions", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1738
78503
8