Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@honeypot-run/core

Package Overview
Dependencies
Maintainers
0
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@honeypot-run/core - npm Package Compare versions

Comparing version 0.2.55 to 0.2.56

5

dist/cjs/src/public/plugins/AmplitudePlugin.js

@@ -20,3 +20,3 @@ "use strict";

execute: (event) => __awaiter(void 0, void 0, void 0, function* () {
var _a;
var _a, _b;
try {

@@ -28,3 +28,4 @@ const { user_id, event_type } = event;

: event_type;
const shouldIgnore = (_a = pluginConfig === null || pluginConfig === void 0 ? void 0 : pluginConfig.ignoreEvents) === null || _a === void 0 ? void 0 : _a.includes(cleanedEventType);
const shouldIgnore = ((_a = pluginConfig === null || pluginConfig === void 0 ? void 0 : pluginConfig.excludeEvents) === null || _a === void 0 ? void 0 : _a.includes(cleanedEventType)) ||
(((_b = pluginConfig === null || pluginConfig === void 0 ? void 0 : pluginConfig.includeEvents) === null || _b === void 0 ? void 0 : _b.length) && !(pluginConfig === null || pluginConfig === void 0 ? void 0 : pluginConfig.includeEvents.includes(cleanedEventType)));
if (shouldIgnore) {

@@ -31,0 +32,0 @@ return event;

18

dist/cjs/src/public/plugins/AmplitudePlugin.test.js

@@ -23,3 +23,3 @@ "use strict";

const pluginConfig = {
ignoreEvents: ['excluded_event'],
excludeEvents: ['excluded_event'],
};

@@ -38,2 +38,18 @@ plugin = (0, AmplitudePlugin_1.createAmplitudePlugin)(track, get, pluginConfig);

}));
test('should include event if it is in includeEvents', () => __awaiter(void 0, void 0, void 0, function* () {
const pluginConfig = {
includeEvents: ['included_event'],
};
plugin = (0, AmplitudePlugin_1.createAmplitudePlugin)(track, get, pluginConfig);
const event = {
event_type: 'excluded_event',
event_properties: {},
user_id: '1234',
device_id: '5678',
};
const result = yield plugin.execute(event);
expect(track).not.toHaveBeenCalled();
expect(get).not.toHaveBeenCalled();
expect(result === null || result === void 0 ? void 0 : result.event_properties).not.toHaveProperty('honey');
}));
test('should enrich event if enrichEvents is enabled', () => __awaiter(void 0, void 0, void 0, function* () {

@@ -40,0 +56,0 @@ const pluginConfig = {

import { EnrichmentPlugin } from '@amplitude/analytics-types';
export type IdentityType = "account" | "email" | "merchant_id" | "partner_id" | "web3_wallet" | "geofence_ref";
export interface AmplitudePluginConfig {
ignoreEvents?: string[];
excludeEvents?: string[];
includeEvents?: string[];
enrichEventProperties?: boolean;

@@ -6,0 +7,0 @@ }

@@ -17,3 +17,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {

execute: (event) => __awaiter(void 0, void 0, void 0, function* () {
var _a;
var _a, _b;
try {

@@ -25,3 +25,4 @@ const { user_id, event_type } = event;

: event_type;
const shouldIgnore = (_a = pluginConfig === null || pluginConfig === void 0 ? void 0 : pluginConfig.ignoreEvents) === null || _a === void 0 ? void 0 : _a.includes(cleanedEventType);
const shouldIgnore = ((_a = pluginConfig === null || pluginConfig === void 0 ? void 0 : pluginConfig.excludeEvents) === null || _a === void 0 ? void 0 : _a.includes(cleanedEventType)) ||
(((_b = pluginConfig === null || pluginConfig === void 0 ? void 0 : pluginConfig.includeEvents) === null || _b === void 0 ? void 0 : _b.length) && !(pluginConfig === null || pluginConfig === void 0 ? void 0 : pluginConfig.includeEvents.includes(cleanedEventType)));
if (shouldIgnore) {

@@ -28,0 +29,0 @@ return event;

@@ -21,3 +21,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {

const pluginConfig = {
ignoreEvents: ['excluded_event'],
excludeEvents: ['excluded_event'],
};

@@ -36,2 +36,18 @@ plugin = createAmplitudePlugin(track, get, pluginConfig);

}));
test('should include event if it is in includeEvents', () => __awaiter(void 0, void 0, void 0, function* () {
const pluginConfig = {
includeEvents: ['included_event'],
};
plugin = createAmplitudePlugin(track, get, pluginConfig);
const event = {
event_type: 'excluded_event',
event_properties: {},
user_id: '1234',
device_id: '5678',
};
const result = yield plugin.execute(event);
expect(track).not.toHaveBeenCalled();
expect(get).not.toHaveBeenCalled();
expect(result === null || result === void 0 ? void 0 : result.event_properties).not.toHaveProperty('honey');
}));
test('should enrich event if enrichEvents is enabled', () => __awaiter(void 0, void 0, void 0, function* () {

@@ -38,0 +54,0 @@ const pluginConfig = {

import { EnrichmentPlugin } from '@amplitude/analytics-types';
export type IdentityType = "account" | "email" | "merchant_id" | "partner_id" | "web3_wallet" | "geofence_ref";
export interface AmplitudePluginConfig {
ignoreEvents?: string[];
excludeEvents?: string[];
includeEvents?: string[];
enrichEventProperties?: boolean;

@@ -6,0 +7,0 @@ }

@@ -5,3 +5,3 @@ {

"author": "https://honeypot.run",
"version": "0.2.55",
"version": "0.2.56",
"license": "BUSL-1.1",

@@ -8,0 +8,0 @@ "keywords": [

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