@zenginehq/backend-webhooks
Advanced tools
Comparing version 1.1.0 to 1.1.1
@@ -5,2 +5,7 @@ # Change Log | ||
<a name="1.1.1"></a> | ||
## 1.1.1 (2018-07-17) | ||
<a name="1.1.0"></a> | ||
@@ -26,2 +31,12 @@ # 1.1.0 (2018-06-29) | ||
<a name="1.1.0"></a> | ||
# 1.1.0 (2018-06-29) | ||
### Features | ||
* split up activity record checking into 2 functions ([7fc9fae](https://github.com/ZengineHQ/zn-backend-webhooks/commit/7fc9fae)) | ||
<a name="1.0.0"></a> | ||
@@ -34,1 +49,11 @@ # 1.0.0 (2018-06-28) | ||
* initial module with secret validation and activity folder checks ([679a949](https://github.com/ZengineHQ/zn-backend-webhooks/commit/679a949)) | ||
<a name="1.0.0"></a> | ||
# 1.0.0 (2018-06-28) | ||
### Features | ||
* initial module with secret validation and activity folder checks ([679a949](https://github.com/ZengineHQ/zn-backend-webhooks/commit/679a949)) |
@@ -36,3 +36,3 @@ 'use strict'; | ||
if (idField in settings && keyField in settings) { | ||
if (settings && idField in settings && keyField in settings) { | ||
return settings[idField] === webhookId && settings[keyField] === webhookKey; | ||
@@ -39,0 +39,0 @@ } |
{ | ||
"name": "@zenginehq/backend-webhooks", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "Helper library for working with Webhooks in Zengine backend plugins.", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1", | ||
"test": "nyc mocha --reporter spec --no-colors --require test/_bootstrap.js", | ||
"lint": "jshint --config .jshintrc index.js || true", | ||
"release": "jshint --config .jshintrc index.js && standard-version" | ||
"docs": "jsdoc index.js README.md --destination docs", | ||
"cover": "nyc --reporter=lcov npm test && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js", | ||
"release": "jshint --config .jshintrc index.js && npm test && standard-version" | ||
}, | ||
@@ -19,3 +21,3 @@ "repository": { | ||
], | ||
"author": "Alex Weber <alex.weber@wizehive.com", | ||
"author": "Alex Weber <alex.weber@wizehive.com>", | ||
"license": "MIT", | ||
@@ -28,5 +30,14 @@ "bugs": { | ||
"devDependencies": { | ||
"chai": "^4.1.2", | ||
"chai-as-promised": "^7.1.1", | ||
"coveralls": "^3.0.2", | ||
"jsdoc": "^3.5.5", | ||
"jshint": "^2.9.5", | ||
"mocha": "^5.2.0", | ||
"nyc": "^12.0.2", | ||
"standard-version": "^4.4.0" | ||
}, | ||
"engines": { | ||
"node": ">=8" | ||
} | ||
} |
@@ -5,2 +5,4 @@ # Backend Webhooks | ||
[![Coverage Status](https://coveralls.io/repos/github/ZengineHQ/zn-backend-webhooks/badge.svg?branch=master)](https://coveralls.io/github/ZengineHQ/zn-backend-webhooks?branch=master) | ||
## Installation | ||
@@ -19,2 +21,5 @@ | ||
var workspace; // from eventData | ||
var activity; // from eventData | ||
// Load settings from firebase. | ||
@@ -28,5 +33,10 @@ $firebase.load(workspaceId).then(function (settings) { | ||
return $api.getActivity(activity.id).then(function (fullActivity) { | ||
if ($webhook.activityFolders(fullActivity, settings.submittedFolder)) { | ||
if ($webhook.activityToFolder(fullActivity, settings.submittedFolder)) { | ||
// Do something. | ||
} | ||
} | ||
// You can also make sure the activity didn't come from a specific folder. | ||
if (!$webhook.activityFromFolder(fullActivity, settings.submittedFolder)) { | ||
// Do something else. | ||
} | ||
}); | ||
@@ -46,4 +56,12 @@ }); | ||
#### activityFolders(activity, toFolder, \[fromFolder\]) | ||
#### activityToFolder(activity, toFolder) | ||
Returns whether the given activity is a move to the specified folder and optionally filter by whether it came from a certain folder too. | ||
Returns whether the given activity is a move to the specified folder (ie: record moved from a folder this this one) | ||
#### activityFromFolder(activity, toFolder) | ||
Returns whether the given activity is a move from the specified folder (ie: record moved from this folder this another one) | ||
## API Docs | ||
[Full documentation](https://zenginehq.github.io/zn-backend-webhooks) |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
1105769
55
1227
0
64
8
1