@honeypot-run/core
Advanced tools
Comparing version 0.2.61 to 0.2.62
@@ -15,3 +15,12 @@ "use strict"; | ||
let pageViews = 0; | ||
let forceDebug = new URLSearchParams(window.location.search).has('hpdebug'); | ||
const debug = (message) => { | ||
try { | ||
let forceDebug = new URLSearchParams(window.location.search).has('hpdebug'); | ||
if ((pluginConfig === null || pluginConfig === void 0 ? void 0 : pluginConfig.debug) === true || forceDebug) { | ||
console.log(`[hp] ${message}`); | ||
} | ||
} | ||
catch (error) { | ||
} | ||
}; | ||
return { | ||
@@ -21,11 +30,7 @@ name: 'honeypot-enrichment', | ||
setup: (config) => __awaiter(void 0, void 0, void 0, function* () { | ||
yield get(); | ||
let honey = yield get(); | ||
debug(`initialized plugin. honey=${JSON.stringify(honey)}`); | ||
}), | ||
execute: (event) => __awaiter(void 0, void 0, void 0, function* () { | ||
var _a, _b; | ||
const debug = (message) => { | ||
if ((pluginConfig === null || pluginConfig === void 0 ? void 0 : pluginConfig.debug) === true || forceDebug) { | ||
console.log(`[hp] ${message}`); | ||
} | ||
}; | ||
try { | ||
@@ -32,0 +37,0 @@ const { user_id, event_type } = event; |
@@ -12,3 +12,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
let pageViews = 0; | ||
let forceDebug = new URLSearchParams(window.location.search).has('hpdebug'); | ||
const debug = (message) => { | ||
try { | ||
let forceDebug = new URLSearchParams(window.location.search).has('hpdebug'); | ||
if ((pluginConfig === null || pluginConfig === void 0 ? void 0 : pluginConfig.debug) === true || forceDebug) { | ||
console.log(`[hp] ${message}`); | ||
} | ||
} | ||
catch (error) { | ||
} | ||
}; | ||
return { | ||
@@ -18,11 +27,7 @@ name: 'honeypot-enrichment', | ||
setup: (config) => __awaiter(void 0, void 0, void 0, function* () { | ||
yield get(); | ||
let honey = yield get(); | ||
debug(`initialized plugin. honey=${JSON.stringify(honey)}`); | ||
}), | ||
execute: (event) => __awaiter(void 0, void 0, void 0, function* () { | ||
var _a, _b; | ||
const debug = (message) => { | ||
if ((pluginConfig === null || pluginConfig === void 0 ? void 0 : pluginConfig.debug) === true || forceDebug) { | ||
console.log(`[hp] ${message}`); | ||
} | ||
}; | ||
try { | ||
@@ -29,0 +34,0 @@ const { user_id, event_type } = event; |
@@ -5,3 +5,3 @@ { | ||
"author": "https://honeypot.run", | ||
"version": "0.2.61", | ||
"version": "0.2.62", | ||
"license": "BUSL-1.1", | ||
@@ -8,0 +8,0 @@ "keywords": [ |
47795
1093