Socket
Socket
Sign inDemoInstall

firebase-functions

Package Overview
Dependencies
Maintainers
1
Versions
114
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

firebase-functions - npm Package Compare versions

Comparing version 0.5.5 to 0.5.6

5

changelog.txt

@@ -1,1 +0,4 @@

fixed - Fixes bug where database connections were being closed more frequently than necessary causing DNS quota issues.
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.

2

lib/apps.js

@@ -0,1 +1,2 @@

"use strict";
// The MIT License (MIT)

@@ -22,3 +23,2 @@ //

// SOFTWARE.
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

@@ -25,0 +25,0 @@ var _ = require("lodash");

@@ -0,1 +1,2 @@

"use strict";
// The MIT License (MIT)

@@ -22,3 +23,2 @@ //

// SOFTWARE.
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

@@ -25,0 +25,0 @@ var _ = require("lodash");

@@ -0,1 +1,2 @@

"use strict";
// The MIT License (MIT)

@@ -22,3 +23,2 @@ //

// SOFTWARE.
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

@@ -25,0 +25,0 @@ var _ = require("lodash");

@@ -0,1 +1,2 @@

"use strict";
// The MIT License (MIT)

@@ -22,3 +23,2 @@ //

// SOFTWARE.
"use strict";
function __export(m) {

@@ -25,0 +25,0 @@ for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];

@@ -0,1 +1,2 @@

"use strict";
// The MIT License (MIT)

@@ -22,3 +23,2 @@ //

// SOFTWARE.
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

@@ -25,0 +25,0 @@ var cloud_functions_1 = require("../cloud-functions");

@@ -0,1 +1,2 @@

"use strict";
// The MIT License (MIT)

@@ -22,3 +23,2 @@ //

// SOFTWARE.
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

@@ -25,0 +25,0 @@ var cloud_functions_1 = require("../cloud-functions");

@@ -0,1 +1,2 @@

"use strict";
// The MIT License (MIT)

@@ -22,3 +23,2 @@ //

// SOFTWARE.
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

@@ -228,3 +228,2 @@ var _ = require("lodash");

DeltaSnapshot.prototype._checkAndConvertToArray = function (node) {
var _this = this;
if (node === null || typeof node === 'undefined') {

@@ -240,4 +239,8 @@ return null;

var allIntegerKeys = true;
_.forEach(node, function (childNode, key) {
obj[key] = _this._checkAndConvertToArray(childNode);
for (var key in node) {
if (!node.hasOwnProperty(key)) {
continue;
}
var childNode = node[key];
obj[key] = this._checkAndConvertToArray(childNode);
numKeys++;

@@ -251,3 +254,3 @@ var integerRegExp = /^(0|[1-9]\d*)$/;

}
});
}
if (allIntegerKeys && maxKey < 2 * numKeys) {

@@ -276,6 +279,3 @@ // convert to array.

DeltaSnapshot.prototype._fullPath = function () {
var out = (this._path || '') + (this._childPath || '');
if (out === '') {
out = '/';
}
var out = (this._path || '') + '/' + (this._childPath || '');
return out;

@@ -282,0 +282,0 @@ };

@@ -0,1 +1,2 @@

"use strict";
// The MIT License (MIT)

@@ -22,3 +23,2 @@ //

// SOFTWARE.
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

@@ -25,0 +25,0 @@ var cloud_functions_1 = require("../cloud-functions");

@@ -0,1 +1,2 @@

"use strict";
// The MIT License (MIT)

@@ -22,3 +23,2 @@ //

// SOFTWARE.
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

@@ -25,0 +25,0 @@ function onRequest(handler) {

@@ -0,1 +1,2 @@

"use strict";
// The MIT License (MIT)

@@ -22,3 +23,2 @@ //

// SOFTWARE.
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

@@ -25,0 +25,0 @@ var cloud_functions_1 = require("../cloud-functions");

@@ -0,1 +1,2 @@

"use strict";
// The MIT License (MIT)

@@ -22,3 +23,2 @@ //

// SOFTWARE.
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

@@ -57,2 +57,4 @@ var cloud_functions_1 = require("../cloud-functions");

exports.BucketBuilder = BucketBuilder;
// A RegExp that matches on a GCS media link that points at a _nested_ object (one that uses a path/with/slashes).
var nestedMediaLinkRE = new RegExp('https://www.googleapis.com/storage/v1/b/([^/]+)/o/(.*)');
var ObjectBuilder = (function () {

@@ -67,13 +69,16 @@ /** @internal */

ObjectBuilder.prototype.onChange = function (handler) {
// This is a temporary shim to filter out spurious events due to Functions deployments.
// BUG(34123812): clean this up when backend fix for bug is deployed.
var filterDeployEvents = function (event) {
if (event.data.timeCreated === '1970-01-01T00:00:00.000Z' && event.data.crc32c === 'AAAAAA==') {
console.log('Function triggered unneccessarily by Cloud Function deployment; function execution elided. ' +
'This is a spurious event that will go away soon, sorry for the spam!');
return null;
// This is a temporary shim to fix the 'mediaLink' for nested objects.
// BUG(37962789): clean this up when backend fix for bug is deployed.
var correctMediaLink = function (event) {
var deconstructedNestedLink = event.data.mediaLink.match(nestedMediaLinkRE);
if (deconstructedNestedLink != null) {
// The media link for a nested object uses an illegal URL (using literal slashes instead of "%2F".
// Fix up the URL.
var bucketName = deconstructedNestedLink[1];
var fixedTail = deconstructedNestedLink[2].replace(/\//g, '%2F'); // "/\//g" means "all forward slashes".
event.data.mediaLink = 'https://www.googleapis.com/storage/v1/b/' + bucketName + '/o/' + fixedTail;
}
return handler(event);
};
return cloud_functions_1.makeCloudFunction({ provider: exports.provider, handler: filterDeployEvents, resource: this.resource, eventType: 'object.change' });
return cloud_functions_1.makeCloudFunction({ provider: exports.provider, handler: correctMediaLink, resource: this.resource, eventType: 'object.change' });
};

@@ -80,0 +85,0 @@ return ObjectBuilder;

@@ -0,1 +1,2 @@

"use strict";
// The MIT License (MIT)

@@ -22,3 +23,2 @@ //

// SOFTWARE.
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

@@ -25,0 +25,0 @@ var _ = require("lodash");

{
"name": "firebase-functions",
"version": "0.5.5",
"version": "0.5.6",
"description": "Firebase SDK for Cloud Functions",

@@ -41,3 +41,3 @@ "main": "lib/index.js",

"chai-as-promised": "^5.2.0",
"firebase-admin": "^4.1.2",
"firebase-admin": "^4.2.1",
"istanbul": "^0.4.2",

@@ -52,3 +52,3 @@ "mocha": "^2.4.5",

"peerDependencies": {
"firebase-admin": "~4.1.2"
"firebase-admin": "~4.2.1"
},

@@ -55,0 +55,0 @@ "dependencies": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc