New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

ingrow-js-sdk

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ingrow-js-sdk - npm Package Compare versions

Comparing version 1.0.6 to 1.0.7

.babelrc

151

dist/index.js

@@ -1,47 +0,73 @@

class cookieHandler {
static getRandomString() {
var randomChars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
var result = '';
for (var i = 0; i < 32; i++) {
result += randomChars.charAt(Math.floor(Math.random() * randomChars.length));
}
return result;
}
'use strict';
static setCookie(cname) {
const cookie = cookieHandler.getRandomString();
document.cookie = cname + "=" + cookie;
return cookie;
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var cookieHandler = function () {
function cookieHandler() {
_classCallCheck(this, cookieHandler);
}
static getCookie(cname) {
var name = cname + "=";
var ca = document.cookie.split(';');
for (var i = 0; i < ca.length; i++) {
var c = ca[i];
while (c.charAt(0) == ' ') {
c = c.substring(1);
_createClass(cookieHandler, null, [{
key: 'getRandomString',
value: function getRandomString() {
var randomChars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
var result = '';
for (var i = 0; i < 32; i++) {
result += randomChars.charAt(Math.floor(Math.random() * randomChars.length));
}
if (c.indexOf(name) == 0) {
return c.substring(name.length, c.length);
return result;
}
}, {
key: 'setCookie',
value: function setCookie(cname) {
var cookie = cookieHandler.getRandomString();
document.cookie = cname + "=" + cookie;
return cookie;
}
}, {
key: 'getCookie',
value: function getCookie(cname) {
var name = cname + "=";
var ca = document.cookie.split(';');
for (var i = 0; i < ca.length; i++) {
var c = ca[i];
while (c.charAt(0) == ' ') {
c = c.substring(1);
}
if (c.indexOf(name) == 0) {
return c.substring(name.length, c.length);
}
}
return "";
}
return "";
}
static checkCookie(cname) {
var id = cookieHandler.getCookie(cname);
if (id != "") {
return true;
} else {
return false;
}, {
key: 'checkCookie',
value: function checkCookie(cname) {
var id = cookieHandler.getCookie(cname);
if (id != "") {
return true;
} else {
return false;
}
}
}
}
}]);
export default class lungo {
constructor(apiKey, projectID) {
return cookieHandler;
}();
var ingrow = function () {
function ingrow(apiKey, projectID) {
_classCallCheck(this, ingrow);
this.apiKey = apiKey;
this.projectID = projectID;
this.apiEndpoint = "https://event.st.ingrow.co";
this.apiEndpoint = "https://event.ingrow.co";
this.anonymousId = cookieHandler.checkCookie("ingrow_events_anonymous_id") ? cookieHandler.getCookie("ingrow_events_anonymous_id") : cookieHandler.setCookie("ingrow_events_anonymous_id");

@@ -51,24 +77,33 @@ this.ip = { IP: "autofill" };

sendEvent(stream, data, userId = "") {
return fetch(`${this.apiEndpoint}/v1`, {
method: "POST",
headers: {
"api-key": this.apiKey
},
body: JSON.stringify({
ingrow: {
stream,
project: this.projectID
_createClass(ingrow, [{
key: 'sendEvent',
value: function sendEvent(stream, data) {
var userId = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "";
return fetch(this.apiEndpoint + '/v1', {
method: "POST",
headers: {
"api-key": this.apiKey
},
enrichment: [{
name: "session",
input: {
anonymous_id: this.anonymousId,
user_id: userId
}
}],
event: data
})
});
}
}
body: JSON.stringify({
ingrow: {
stream: stream,
project: this.projectID
},
enrichment: [{
name: "session",
input: {
anonymous_id: this.anonymousId,
user_id: userId
}
}],
event: _extends({}, this.IP, data)
})
});
}
}]);
return ingrow;
}();
exports.default = ingrow;
{
"name": "ingrow-js-sdk",
"version": "1.0.6",
"version": "1.0.7",
"description": "javascript SDK to using the Ingrow event streaming platform",

@@ -28,4 +28,5 @@ "main": "index.js",

"babel-cli": "^6.26.0",
"babel-plugin-transform-object-rest-spread": "^6.26.0",
"babel-preset-es2015": "^6.24.1"
}
}

@@ -42,7 +42,7 @@ class cookieHandler {

export default class lungo {
export default class ingrow {
constructor(apiKey, projectID) {
this.apiKey = apiKey
this.projectID = projectID
this.apiEndpoint = "https://event.st.ingrow.co"
this.apiEndpoint = "https://event.ingrow.co"
this.anonymousId = cookieHandler.checkCookie("ingrow_events_anonymous_id")

@@ -72,3 +72,3 @@ ? cookieHandler.getCookie("ingrow_events_anonymous_id")

}],
event: data,
event: { ...this.IP, ...data },
}),

@@ -75,0 +75,0 @@ })

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