Socket
Socket
Sign inDemoInstall

@zenginehq/backend-webhooks

Package Overview
Dependencies
0
Maintainers
3
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.1.0 to 1.1.1

.coveralls.yml

25

CHANGELOG.md

@@ -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))

2

index.js

@@ -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

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc