@quintype/framework 7.18.10-webengage-update.2 → 7.18.10-webhook-data-temp.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quintype/framework",
3
- "version": "7.18.10-webengage-update.2",
3
+ "version": "7.18.10-webhook-data-temp.0",
4
4
  "description": "Libraries to help build Quintype Node.js apps",
5
5
  "main": "index.js",
6
6
  "engines": {
@@ -1,6 +1,6 @@
1
1
  const get = require("lodash/get");
2
2
  const request = require("request-promise");
3
- const userAttributes = require("../webengage-user-attributes");
3
+ const fs = require("fs");
4
4
 
5
5
  exports.triggerWebengageNotifications = async function triggerWebengageNotifications(
6
6
  req,
@@ -10,6 +10,7 @@ exports.triggerWebengageNotifications = async function triggerWebengageNotificat
10
10
  ) {
11
11
  const eventName = get(req, ["body", "v1", "event", "name"], "");
12
12
  const url = `https://api.webengage.com/v2/accounts/${licenseCode}/business/save-event`;
13
+ fs.writeFileSync("./bold-webhook-schema", req.body);
13
14
 
14
15
  try {
15
16
  await request({
@@ -19,7 +20,7 @@ exports.triggerWebengageNotifications = async function triggerWebengageNotificat
19
20
  Authorization: `Bearer ${apiKey}`,
20
21
  "content-type": "application/json",
21
22
  },
22
- body: { eventName: eventName, eventData: { ...req.body, ...userAttributes } },
23
+ body: { eventName: eventName, eventData: { ...req.body, user_type: "malibu_user" } },
23
24
  json: true,
24
25
  });
25
26
  res.status(200).send("webengage event triggered successfully");
@@ -1,3 +0,0 @@
1
- const user_type = "malibu_user";
2
-
3
- module.exports = { user_type };