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

stream-analytics

Package Overview
Dependencies
Maintainers
13
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

stream-analytics - npm Package Compare versions

Comparing version 3.4.3 to 3.4.4

305

dist/js/stream-analytics.js

@@ -97,285 +97,74 @@ (function webpackUniversalModuleDefinition(root, factory) {

/************************************************************************/
/******/ ([
/* 0 */
/***/ (function(module, exports, __webpack_require__) {
/******/ ({
module.exports = __webpack_require__(1);
/***/ "./package.json":
/*!**********************!*\
!*** ./package.json ***!
\**********************/
/*! exports provided: name, version, description, main, module, types, scripts, repository, keywords, author, license, bugs, homepage, engines, browser, dependencies, devDependencies, files, default */
/***/ (function(module) {
eval("module.exports = JSON.parse(\"{\\\"name\\\":\\\"stream-analytics\\\",\\\"version\\\":\\\"3.4.4\\\",\\\"description\\\":\\\"Analytics JS client for GetStream.io.\\\",\\\"main\\\":\\\"./lib/stream-analytics.js\\\",\\\"module\\\":\\\"./lib/stream-analytics.js\\\",\\\"types\\\":\\\"./lib/stream-analytics.d.ts\\\",\\\"scripts\\\":{\\\"test\\\":\\\"yarn test-node && yarn test-browser\\\",\\\"test-node\\\":\\\"mocha tests --exit\\\",\\\"test-browser\\\":\\\"karma start karma.config.js\\\",\\\"lint\\\":\\\"yarn run prettier && yarn run eslint\\\",\\\"eslint\\\":\\\"eslint '**/*.{js,ts}' --max-warnings 0\\\",\\\"prettier\\\":\\\"prettier --config ./.prettierrc --list-different \\\\\\\"**/*.{js,ts,md,html,json}\\\\\\\"\\\",\\\"prettier-fix\\\":\\\"prettier --config ./.prettierrc --write \\\\\\\"**/*.{js,ts,md,html,json}\\\\\\\"\\\",\\\"build\\\":\\\"tsc && webpack && webpack --env production\\\",\\\"preversion\\\":\\\"yarn run build && yarn test\\\",\\\"version\\\":\\\"git add -A dist\\\",\\\"postversion\\\":\\\"git push && git push --tags\\\"},\\\"repository\\\":{\\\"type\\\":\\\"git\\\",\\\"url\\\":\\\"git://github.com/GetStream/stream-analytics-js.git\\\"},\\\"keywords\\\":[\\\"npm\\\",\\\"stream-analytics\\\",\\\"getstream.io\\\",\\\"stream.io\\\"],\\\"author\\\":\\\"Tommaso Barbugli <tommaso@getstream.io>\\\",\\\"license\\\":\\\"MIT\\\",\\\"bugs\\\":{\\\"url\\\":\\\"https://github.com/GetStream/stream-analytics-js/issues\\\"},\\\"homepage\\\":\\\"https://github.com/GetStream/stream-analytics-js\\\",\\\"engines\\\":{\\\"node\\\":\\\"10 || 12 || >=14\\\"},\\\"browser\\\":{\\\"cross-fetch\\\":false},\\\"dependencies\\\":{\\\"cross-fetch\\\":\\\"^3.1.5\\\"},\\\"devDependencies\\\":{\\\"@types/node\\\":\\\"^14.11.2\\\",\\\"@typescript-eslint/eslint-plugin\\\":\\\"^4.3.0\\\",\\\"@typescript-eslint/parser\\\":\\\"^4.3.0\\\",\\\"chai\\\":\\\"^4.2.0\\\",\\\"dotenv\\\":\\\"^8.2.0\\\",\\\"eslint\\\":\\\"^7.10.0\\\",\\\"eslint-config-airbnb-base\\\":\\\"^14.2.0\\\",\\\"eslint-config-prettier\\\":\\\"^6.12.0\\\",\\\"eslint-plugin-import\\\":\\\"^2.22.1\\\",\\\"eslint-plugin-prettier\\\":\\\"^3.1.4\\\",\\\"eslint-plugin-typescript-sort-keys\\\":\\\"^1.5.0\\\",\\\"karma\\\":\\\"^6.3.16\\\",\\\"karma-chrome-launcher\\\":\\\"^3.1.0\\\",\\\"karma-mocha\\\":\\\"^2.0.1\\\",\\\"karma-mocha-reporter\\\":\\\"~2.2.5\\\",\\\"karma-sauce-launcher\\\":\\\"^4.1.5\\\",\\\"karma-sourcemap-loader\\\":\\\"~0.3.8\\\",\\\"karma-webpack\\\":\\\"^4.0.2\\\",\\\"mocha\\\":\\\"^8.1.3\\\",\\\"prettier\\\":\\\"^2.1.2\\\",\\\"ts-loader\\\":\\\"^8.0.4\\\",\\\"typescript\\\":\\\"^4.0.3\\\",\\\"webpack\\\":\\\"^4.46.0\\\",\\\"webpack-cli\\\":\\\"^4.10.0\\\"},\\\"files\\\":[\\\"src\\\",\\\"dist\\\",\\\"lib\\\"]}\");\n\n//# sourceURL=webpack://StreamAnalytics/./package.json?");
/***/ }),
/* 1 */
/***/ "./src/errors.ts":
/*!***********************!*\
!*** ./src/errors.ts ***!
\***********************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
eval("\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.InvalidInputData = exports.APIError = exports.MisconfiguredClient = exports.MissingUserId = void 0;\nvar canCapture = typeof Error.captureStackTrace === 'function';\nvar canStack = !!new Error().stack;\n// workaround for ES5 compilation to preserve the Error class\nvar ErrorAbstract = function (message) {\n Error.call(this, message);\n this.message = message;\n this.name = this.constructor.name;\n if (canCapture)\n Error.captureStackTrace(this);\n else if (canStack)\n this.stack = new Error().stack;\n else\n this.stack = '';\n};\nErrorAbstract.prototype = Object.create(Error.prototype);\nvar MissingUserId = /** @class */ (function (_super) {\n __extends(MissingUserId, _super);\n function MissingUserId() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n return MissingUserId;\n}(ErrorAbstract));\nexports.MissingUserId = MissingUserId;\nvar MisconfiguredClient = /** @class */ (function (_super) {\n __extends(MisconfiguredClient, _super);\n function MisconfiguredClient() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n return MisconfiguredClient;\n}(ErrorAbstract));\nexports.MisconfiguredClient = MisconfiguredClient;\nvar APIError = /** @class */ (function (_super) {\n __extends(APIError, _super);\n function APIError(msg, response) {\n var _this = _super.call(this, msg) || this;\n _this.response = response;\n return _this;\n }\n return APIError;\n}(ErrorAbstract));\nexports.APIError = APIError;\nvar InvalidInputData = /** @class */ (function (_super) {\n __extends(InvalidInputData, _super);\n function InvalidInputData(msg, errorInfo) {\n return _super.call(this, msg + \": \\n\\t\" + errorInfo.join('\\n\\t')) || this;\n }\n return InvalidInputData;\n}(ErrorAbstract));\nexports.InvalidInputData = InvalidInputData;\n\n\n//# sourceURL=webpack://StreamAnalytics/./src/errors.ts?");
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
var cross_fetch_1 = __importDefault(__webpack_require__(2));
var errors = __importStar(__webpack_require__(3));
var specs_1 = __webpack_require__(4);
// use native fetch in browser mode to reduce bundle size
// webpack skip bundling the cross-fetch
var request = typeof cross_fetch_1.default === 'function' ? cross_fetch_1.default : window.fetch;
var pkg = __webpack_require__(5); // eslint-disable-line @typescript-eslint/no-var-requires
var StreamAnalytics = /** @class */ (function () {
function StreamAnalytics(config) {
if (!config || !config.apiKey || !config.token) {
throw new errors.MisconfiguredClient('the client must be initialized with apiKey and token');
}
this.userData = null;
this.apiKey = config.apiKey;
this.token = config.token;
this.baseUrl = config.baseUrl || 'https://analytics.stream-io-api.com/analytics/v1.0/';
this.node = typeof window === 'undefined';
}
StreamAnalytics.prototype.setUser = function (data) {
this.userData = data;
};
StreamAnalytics.prototype.userAgent = function () {
return "stream-javascript-analytics-client-" + (this.node ? 'node' : 'browser') + "-" + (pkg.version || 'unknown');
};
StreamAnalytics.prototype._throwMissingUserData = function (event) {
if (this.userData || event.user_data)
return;
throw new errors.MissingUserId('user_data should be in each event or set the default with StreamAnalytics.setUser()');
};
StreamAnalytics.prototype._validateAndNormalizeUserData = function (resource, eventList) {
var _this = this;
return eventList.map(function (event, i) {
var err = resource === 'impression'
? specs_1.validateImpression(event)
: specs_1.validateEngagement(event);
if (err)
throw new errors.InvalidInputData('invalid event data', i ? err.map(function (e) { return i + ": " + e; }) : err);
_this._throwMissingUserData(event);
return __assign(__assign({}, event), { user_data: event.user_data || _this.userData });
});
};
StreamAnalytics.prototype._sendEvent = function (resource, eventList) {
var events = this._validateAndNormalizeUserData(resource, eventList);
return request(this.baseUrl + resource + "/?api_key=" + this.apiKey, {
method: 'POST',
body: JSON.stringify(resource === 'impression' ? events : { content_list: events }),
headers: {
'Content-Type': 'application/json',
'X-Stream-Client': this.userAgent(),
'stream-auth-type': 'jwt',
Authorization: this.token,
},
}).then(function (response) {
if (response.ok)
return response.json();
return response.json().then(function (data) {
if (data.detail)
throw new errors.APIError(response.statusText + ": " + data.detail, response);
throw new errors.APIError(response.statusText, response);
});
});
};
StreamAnalytics.prototype.trackImpression = function (eventData) {
return this.trackImpressions([eventData]);
};
StreamAnalytics.prototype.trackImpressions = function (eventDataList) {
return this._sendEvent('impression', eventDataList);
};
StreamAnalytics.prototype.trackEngagement = function (eventData) {
return this.trackEngagements([eventData]);
};
StreamAnalytics.prototype.trackEngagements = function (eventDataList) {
return this._sendEvent('engagement', eventDataList);
};
return StreamAnalytics;
}());
StreamAnalytics.errors = errors;
module.exports = StreamAnalytics;
/***/ }),
/* 2 */
/***/ (function(module, exports) {
/* (ignored) */
/***/ }),
/* 3 */
/***/ "./src/specs.ts":
/*!**********************!*\
!*** ./src/specs.ts ***!
\**********************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.validateImpression = exports.validateEngagement = void 0;\nfunction isForeginIdType(content) {\n return typeof content === 'object';\n}\nvar validateFeatures = function (features) {\n if (!features)\n return '';\n if (!Array.isArray(features))\n return 'features should be array';\n for (var i = 0; i < features.length; i += 1) {\n if (!features[i].group || typeof features[i].group !== 'string')\n return 'feature.group should be string';\n if (!features[i].value || typeof features[i].value !== 'string')\n return 'feature.value should be string';\n }\n return '';\n};\nexports.validateEngagement = function (engagement) {\n if (!engagement)\n return ['engagement should be an object'];\n var errors = [];\n if (!engagement.label && typeof engagement.label !== 'string')\n errors.push('label should be string');\n if (!engagement.content || (typeof engagement.content !== 'string' && typeof engagement.content !== 'object'))\n errors.push('content should be string or object');\n if (isForeginIdType(engagement.content) && !engagement.content.foreign_id)\n errors.push('content.foreign_id should be string');\n if (engagement.position !== undefined && typeof engagement.position !== 'number')\n errors.push('position should be number');\n if (engagement.score !== undefined && typeof engagement.score !== 'number')\n errors.push('score should be number');\n if (engagement.boost !== undefined && typeof engagement.boost !== 'number')\n errors.push('boost should be number');\n if (engagement.feed_id !== undefined && typeof engagement.feed_id !== 'string')\n errors.push('feed_id should be string)');\n if (engagement.location !== undefined && typeof engagement.location !== 'string')\n errors.push('location should be string');\n var featureErr = validateFeatures(engagement.features);\n if (featureErr)\n errors.push(featureErr);\n return errors.length ? errors : false;\n};\nexports.validateImpression = function (impression) {\n if (!impression)\n return ['impression should be an object'];\n var errors = [];\n if (!Array.isArray(impression.content_list) || !impression.content_list.length)\n errors.push('content should be array of strings or objects');\n if (Array.isArray(impression.content_list))\n impression.content_list.forEach(function (content, i) {\n if (isForeginIdType(content) && !content.foreign_id)\n errors.push(\"content_list[\" + i + \"].foreign_id should be string\");\n });\n if (impression.feed_id !== undefined && typeof impression.feed_id !== 'string')\n errors.push('feed_id should be string');\n if (impression.location !== undefined && typeof impression.location !== 'string')\n errors.push('location should be string');\n var featureErr = validateFeatures(impression.features);\n if (featureErr)\n errors.push(featureErr);\n return errors.length ? errors : false;\n};\n\n\n//# sourceURL=webpack://StreamAnalytics/./src/specs.ts?");
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.InvalidInputData = exports.APIError = exports.MisconfiguredClient = exports.MissingUserId = void 0;
var canCapture = typeof Error.captureStackTrace === 'function';
var canStack = !!new Error().stack;
// workaround for ES5 compilation to preserve the Error class
var ErrorAbstract = function (message) {
Error.call(this, message);
this.message = message;
this.name = this.constructor.name;
if (canCapture)
Error.captureStackTrace(this);
else if (canStack)
this.stack = new Error().stack;
else
this.stack = '';
};
ErrorAbstract.prototype = Object.create(Error.prototype);
var MissingUserId = /** @class */ (function (_super) {
__extends(MissingUserId, _super);
function MissingUserId() {
return _super !== null && _super.apply(this, arguments) || this;
}
return MissingUserId;
}(ErrorAbstract));
exports.MissingUserId = MissingUserId;
var MisconfiguredClient = /** @class */ (function (_super) {
__extends(MisconfiguredClient, _super);
function MisconfiguredClient() {
return _super !== null && _super.apply(this, arguments) || this;
}
return MisconfiguredClient;
}(ErrorAbstract));
exports.MisconfiguredClient = MisconfiguredClient;
var APIError = /** @class */ (function (_super) {
__extends(APIError, _super);
function APIError(msg, response) {
var _this = _super.call(this, msg) || this;
_this.response = response;
return _this;
}
return APIError;
}(ErrorAbstract));
exports.APIError = APIError;
var InvalidInputData = /** @class */ (function (_super) {
__extends(InvalidInputData, _super);
function InvalidInputData(msg, errorInfo) {
return _super.call(this, msg + ": \n\t" + errorInfo.join('\n\t')) || this;
}
return InvalidInputData;
}(ErrorAbstract));
exports.InvalidInputData = InvalidInputData;
/***/ }),
/***/ }),
/* 4 */
/***/ "./src/stream-analytics.ts":
/*!*********************************!*\
!*** ./src/stream-analytics.ts ***!
\*********************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
eval("\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nvar cross_fetch_1 = __importDefault(__webpack_require__(/*! cross-fetch */ 1));\nvar errors = __importStar(__webpack_require__(/*! ./errors */ \"./src/errors.ts\"));\nvar specs_1 = __webpack_require__(/*! ./specs */ \"./src/specs.ts\");\n// use native fetch in browser mode to reduce bundle size\n// webpack skip bundling the cross-fetch\nvar request = typeof cross_fetch_1.default === 'function' ? cross_fetch_1.default : window.fetch;\nvar pkg = __webpack_require__(/*! ../package.json */ \"./package.json\"); // eslint-disable-line @typescript-eslint/no-var-requires\nvar StreamAnalytics = /** @class */ (function () {\n function StreamAnalytics(config) {\n if (!config || !config.apiKey || !config.token) {\n throw new errors.MisconfiguredClient('the client must be initialized with apiKey and token');\n }\n this.userData = null;\n this.apiKey = config.apiKey;\n this.token = config.token;\n this.baseUrl = config.baseUrl || 'https://analytics.stream-io-api.com/analytics/v1.0/';\n this.node = typeof window === 'undefined';\n }\n StreamAnalytics.prototype.setUser = function (data) {\n this.userData = data;\n };\n StreamAnalytics.prototype.userAgent = function () {\n return \"stream-javascript-analytics-client-\" + (this.node ? 'node' : 'browser') + \"-\" + (pkg.version || 'unknown');\n };\n StreamAnalytics.prototype._throwMissingUserData = function (event) {\n if (this.userData || event.user_data)\n return;\n throw new errors.MissingUserId('user_data should be in each event or set the default with StreamAnalytics.setUser()');\n };\n StreamAnalytics.prototype._validateAndNormalizeUserData = function (resource, eventList) {\n var _this = this;\n return eventList.map(function (event, i) {\n var err = resource === 'impression'\n ? specs_1.validateImpression(event)\n : specs_1.validateEngagement(event);\n if (err)\n throw new errors.InvalidInputData('invalid event data', i ? err.map(function (e) { return i + \": \" + e; }) : err);\n _this._throwMissingUserData(event);\n return __assign(__assign({}, event), { user_data: event.user_data || _this.userData });\n });\n };\n StreamAnalytics.prototype._sendEvent = function (resource, eventList) {\n var events = this._validateAndNormalizeUserData(resource, eventList);\n return request(this.baseUrl + resource + \"/?api_key=\" + this.apiKey, {\n method: 'POST',\n body: JSON.stringify(resource === 'impression' ? events : { content_list: events }),\n headers: {\n 'Content-Type': 'application/json',\n 'X-Stream-Client': this.userAgent(),\n 'stream-auth-type': 'jwt',\n Authorization: this.token,\n },\n }).then(function (response) {\n if (response.ok)\n return response.json();\n return response.json().then(function (data) {\n if (data.detail)\n throw new errors.APIError(response.statusText + \": \" + data.detail, response);\n throw new errors.APIError(response.statusText, response);\n });\n });\n };\n StreamAnalytics.prototype.trackImpression = function (eventData) {\n return this.trackImpressions([eventData]);\n };\n StreamAnalytics.prototype.trackImpressions = function (eventDataList) {\n return this._sendEvent('impression', eventDataList);\n };\n StreamAnalytics.prototype.trackEngagement = function (eventData) {\n return this.trackEngagements([eventData]);\n };\n StreamAnalytics.prototype.trackEngagements = function (eventDataList) {\n return this._sendEvent('engagement', eventDataList);\n };\n return StreamAnalytics;\n}());\nStreamAnalytics.errors = errors;\nmodule.exports = StreamAnalytics;\n\n\n//# sourceURL=webpack://StreamAnalytics/./src/stream-analytics.ts?");
Object.defineProperty(exports, "__esModule", { value: true });
exports.validateImpression = exports.validateEngagement = void 0;
function isForeginIdType(content) {
return typeof content === 'object';
}
var validateFeatures = function (features) {
if (!features)
return '';
if (!Array.isArray(features))
return 'features should be array';
for (var i = 0; i < features.length; i += 1) {
if (!features[i].group || typeof features[i].group !== 'string')
return 'feature.group should be string';
if (!features[i].value || typeof features[i].value !== 'string')
return 'feature.value should be string';
}
return '';
};
exports.validateEngagement = function (engagement) {
if (!engagement)
return ['engagement should be an object'];
var errors = [];
if (!engagement.label && typeof engagement.label !== 'string')
errors.push('label should be string');
if (!engagement.content || (typeof engagement.content !== 'string' && typeof engagement.content !== 'object'))
errors.push('content should be string or object');
if (isForeginIdType(engagement.content) && !engagement.content.foreign_id)
errors.push('content.foreign_id should be string');
if (engagement.position !== undefined && typeof engagement.position !== 'number')
errors.push('position should be number');
if (engagement.score !== undefined && typeof engagement.score !== 'number')
errors.push('score should be number');
if (engagement.boost !== undefined && typeof engagement.boost !== 'number')
errors.push('boost should be number');
if (engagement.feed_id !== undefined && typeof engagement.feed_id !== 'string')
errors.push('feed_id should be string)');
if (engagement.location !== undefined && typeof engagement.location !== 'string')
errors.push('location should be string');
var featureErr = validateFeatures(engagement.features);
if (featureErr)
errors.push(featureErr);
return errors.length ? errors : false;
};
exports.validateImpression = function (impression) {
if (!impression)
return ['impression should be an object'];
var errors = [];
if (!Array.isArray(impression.content_list) || !impression.content_list.length)
errors.push('content should be array of strings or objects');
if (Array.isArray(impression.content_list))
impression.content_list.forEach(function (content, i) {
if (isForeginIdType(content) && !content.foreign_id)
errors.push("content_list[" + i + "].foreign_id should be string");
});
if (impression.feed_id !== undefined && typeof impression.feed_id !== 'string')
errors.push('feed_id should be string');
if (impression.location !== undefined && typeof impression.location !== 'string')
errors.push('location should be string');
var featureErr = validateFeatures(impression.features);
if (featureErr)
errors.push(featureErr);
return errors.length ? errors : false;
};
/***/ }),
/***/ 0:
/*!***************************************!*\
!*** multi ./src/stream-analytics.ts ***!
\***************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("module.exports = __webpack_require__(/*! ./src/stream-analytics.ts */\"./src/stream-analytics.ts\");\n\n\n//# sourceURL=webpack://StreamAnalytics/multi_./src/stream-analytics.ts?");
/***/ }),
/* 5 */
/***/ (function(module) {
module.exports = JSON.parse("{\"name\":\"stream-analytics\",\"version\":\"3.4.2\",\"description\":\"Analytics JS client for GetStream.io.\",\"main\":\"./lib/stream-analytics.js\",\"module\":\"./lib/stream-analytics.js\",\"types\":\"./lib/stream-analytics.d.ts\",\"scripts\":{\"test\":\"yarn test-node && yarn test-browser\",\"test-node\":\"mocha tests --exit\",\"test-browser\":\"karma start karma.config.js\",\"lint\":\"yarn run prettier && yarn run eslint\",\"eslint\":\"eslint '**/*.{js,ts}' --max-warnings 0\",\"prettier\":\"prettier --config ./.prettierrc --list-different \\\"**/*.{js,ts,md,html,json}\\\"\",\"prettier-fix\":\"prettier --config ./.prettierrc --write \\\"**/*.{js,ts,md,html,json}\\\"\",\"build\":\"tsc && webpack && webpack --minify\",\"preversion\":\"yarn run build && yarn test\",\"version\":\"git add -A dist\",\"postversion\":\"git push && git push --tags\"},\"repository\":{\"type\":\"git\",\"url\":\"git://github.com/GetStream/stream-analytics-js.git\"},\"keywords\":[\"npm\",\"stream-analytics\",\"getstream.io\",\"stream.io\"],\"author\":\"Tommaso Barbugli <tommaso@getstream.io>\",\"license\":\"MIT\",\"bugs\":{\"url\":\"https://github.com/GetStream/stream-analytics-js/issues\"},\"homepage\":\"https://github.com/GetStream/stream-analytics-js\",\"engines\":{\"node\":\"10 || 12 || >=14\"},\"browser\":{\"cross-fetch\":false},\"dependencies\":{\"cross-fetch\":\"^3.0.6\"},\"devDependencies\":{\"@types/node\":\"^14.11.2\",\"@typescript-eslint/eslint-plugin\":\"^4.3.0\",\"@typescript-eslint/parser\":\"^4.3.0\",\"chai\":\"^4.2.0\",\"dotenv\":\"^8.2.0\",\"eslint\":\"^7.10.0\",\"eslint-config-airbnb-base\":\"^14.2.0\",\"eslint-config-prettier\":\"^6.12.0\",\"eslint-plugin-import\":\"^2.22.1\",\"eslint-plugin-prettier\":\"^3.1.4\",\"eslint-plugin-typescript-sort-keys\":\"^1.5.0\",\"karma\":\"^5.2.3\",\"karma-chrome-launcher\":\"^3.1.0\",\"karma-mocha\":\"^2.0.1\",\"karma-mocha-reporter\":\"~2.2.5\",\"karma-sauce-launcher\":\"^4.1.5\",\"karma-sourcemap-loader\":\"~0.3.8\",\"karma-webpack\":\"^4.0.2\",\"mocha\":\"^8.1.3\",\"prettier\":\"^2.1.2\",\"ts-loader\":\"^8.0.4\",\"typescript\":\"^4.0.3\",\"webpack\":\"^4.44.2\",\"webpack-cli\":\"^3.3.12\"},\"files\":[\"src\",\"dist\",\"lib\"]}");
/***/ 1:
/*!*****************************!*\
!*** cross-fetch (ignored) ***!
\*****************************/
/*! no static exports found */
/***/ (function(module, exports) {
eval("/* (ignored) */\n\n//# sourceURL=webpack://StreamAnalytics/cross-fetch_(ignored)?");
/***/ })
/******/ ]);
/******/ });
});

2

dist/js/stream-analytics.min.js

@@ -1,1 +0,1 @@

!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.StreamAnalytics=e():t.StreamAnalytics=e()}(window,(function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="dist/",r(r.s=0)}([function(t,e,r){t.exports=r(1)},function(t,e,r){"use strict";var n=this&&this.__assign||function(){return(n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)},i=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),o=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),s=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&i(e,t,r);return o(e,t),e},a=(this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}})(r(2)),u=s(r(3)),c=r(4),l="function"==typeof a.default?a.default:window.fetch,p=r(5),f=function(){function t(t){if(!t||!t.apiKey||!t.token)throw new u.MisconfiguredClient("the client must be initialized with apiKey and token");this.userData=null,this.apiKey=t.apiKey,this.token=t.token,this.baseUrl=t.baseUrl||"https://analytics.stream-io-api.com/analytics/v1.0/",this.node="undefined"==typeof window}return t.prototype.setUser=function(t){this.userData=t},t.prototype.userAgent=function(){return"stream-javascript-analytics-client-"+(this.node?"node":"browser")+"-"+(p.version||"unknown")},t.prototype._throwMissingUserData=function(t){if(!this.userData&&!t.user_data)throw new u.MissingUserId("user_data should be in each event or set the default with StreamAnalytics.setUser()")},t.prototype._validateAndNormalizeUserData=function(t,e){var r=this;return e.map((function(e,i){var o="impression"===t?c.validateImpression(e):c.validateEngagement(e);if(o)throw new u.InvalidInputData("invalid event data",i?o.map((function(t){return i+": "+t})):o);return r._throwMissingUserData(e),n(n({},e),{user_data:e.user_data||r.userData})}))},t.prototype._sendEvent=function(t,e){var r=this._validateAndNormalizeUserData(t,e);return l(this.baseUrl+t+"/?api_key="+this.apiKey,{method:"POST",body:JSON.stringify("impression"===t?r:{content_list:r}),headers:{"Content-Type":"application/json","X-Stream-Client":this.userAgent(),"stream-auth-type":"jwt",Authorization:this.token}}).then((function(t){return t.ok?t.json():t.json().then((function(e){if(e.detail)throw new u.APIError(t.statusText+": "+e.detail,t);throw new u.APIError(t.statusText,t)}))}))},t.prototype.trackImpression=function(t){return this.trackImpressions([t])},t.prototype.trackImpressions=function(t){return this._sendEvent("impression",t)},t.prototype.trackEngagement=function(t){return this.trackEngagements([t])},t.prototype.trackEngagements=function(t){return this._sendEvent("engagement",t)},t}();f.errors=u,t.exports=f},function(t,e){},function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.InvalidInputData=e.APIError=e.MisconfiguredClient=e.MissingUserId=void 0;var o="function"==typeof Error.captureStackTrace,s=!!(new Error).stack,a=function(t){Error.call(this,t),this.message=t,this.name=this.constructor.name,o?Error.captureStackTrace(this):this.stack=s?(new Error).stack:""};a.prototype=Object.create(Error.prototype);var u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e}(a);e.MissingUserId=u;var c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e}(a);e.MisconfiguredClient=c;var l=function(t){function e(e,r){var n=t.call(this,e)||this;return n.response=r,n}return i(e,t),e}(a);e.APIError=l;var p=function(t){function e(e,r){return t.call(this,e+": \n\t"+r.join("\n\t"))||this}return i(e,t),e}(a);e.InvalidInputData=p},function(t,e,r){"use strict";function n(t){return"object"==typeof t}Object.defineProperty(e,"__esModule",{value:!0}),e.validateImpression=e.validateEngagement=void 0;var i=function(t){if(!t)return"";if(!Array.isArray(t))return"features should be array";for(var e=0;e<t.length;e+=1){if(!t[e].group||"string"!=typeof t[e].group)return"feature.group should be string";if(!t[e].value||"string"!=typeof t[e].value)return"feature.value should be string"}return""};e.validateEngagement=function(t){if(!t)return["engagement should be an object"];var e=[];t.label||"string"==typeof t.label||e.push("label should be string"),(!t.content||"string"!=typeof t.content&&"object"!=typeof t.content)&&e.push("content should be string or object"),n(t.content)&&!t.content.foreign_id&&e.push("content.foreign_id should be string"),void 0!==t.position&&"number"!=typeof t.position&&e.push("position should be number"),void 0!==t.score&&"number"!=typeof t.score&&e.push("score should be number"),void 0!==t.boost&&"number"!=typeof t.boost&&e.push("boost should be number"),void 0!==t.feed_id&&"string"!=typeof t.feed_id&&e.push("feed_id should be string)"),void 0!==t.location&&"string"!=typeof t.location&&e.push("location should be string");var r=i(t.features);return r&&e.push(r),!!e.length&&e},e.validateImpression=function(t){if(!t)return["impression should be an object"];var e=[];Array.isArray(t.content_list)&&t.content_list.length||e.push("content should be array of strings or objects"),Array.isArray(t.content_list)&&t.content_list.forEach((function(t,r){n(t)&&!t.foreign_id&&e.push("content_list["+r+"].foreign_id should be string")})),void 0!==t.feed_id&&"string"!=typeof t.feed_id&&e.push("feed_id should be string"),void 0!==t.location&&"string"!=typeof t.location&&e.push("location should be string");var r=i(t.features);return r&&e.push(r),!!e.length&&e}},function(t){t.exports=JSON.parse('{"name":"stream-analytics","version":"3.4.2","description":"Analytics JS client for GetStream.io.","main":"./lib/stream-analytics.js","module":"./lib/stream-analytics.js","types":"./lib/stream-analytics.d.ts","scripts":{"test":"yarn test-node && yarn test-browser","test-node":"mocha tests --exit","test-browser":"karma start karma.config.js","lint":"yarn run prettier && yarn run eslint","eslint":"eslint \'**/*.{js,ts}\' --max-warnings 0","prettier":"prettier --config ./.prettierrc --list-different \\"**/*.{js,ts,md,html,json}\\"","prettier-fix":"prettier --config ./.prettierrc --write \\"**/*.{js,ts,md,html,json}\\"","build":"tsc && webpack && webpack --minify","preversion":"yarn run build && yarn test","version":"git add -A dist","postversion":"git push && git push --tags"},"repository":{"type":"git","url":"git://github.com/GetStream/stream-analytics-js.git"},"keywords":["npm","stream-analytics","getstream.io","stream.io"],"author":"Tommaso Barbugli <tommaso@getstream.io>","license":"MIT","bugs":{"url":"https://github.com/GetStream/stream-analytics-js/issues"},"homepage":"https://github.com/GetStream/stream-analytics-js","engines":{"node":"10 || 12 || >=14"},"browser":{"cross-fetch":false},"dependencies":{"cross-fetch":"^3.0.6"},"devDependencies":{"@types/node":"^14.11.2","@typescript-eslint/eslint-plugin":"^4.3.0","@typescript-eslint/parser":"^4.3.0","chai":"^4.2.0","dotenv":"^8.2.0","eslint":"^7.10.0","eslint-config-airbnb-base":"^14.2.0","eslint-config-prettier":"^6.12.0","eslint-plugin-import":"^2.22.1","eslint-plugin-prettier":"^3.1.4","eslint-plugin-typescript-sort-keys":"^1.5.0","karma":"^5.2.3","karma-chrome-launcher":"^3.1.0","karma-mocha":"^2.0.1","karma-mocha-reporter":"~2.2.5","karma-sauce-launcher":"^4.1.5","karma-sourcemap-loader":"~0.3.8","karma-webpack":"^4.0.2","mocha":"^8.1.3","prettier":"^2.1.2","ts-loader":"^8.0.4","typescript":"^4.0.3","webpack":"^4.44.2","webpack-cli":"^3.3.12"},"files":["src","dist","lib"]}')}])}));
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.StreamAnalytics=e():t.StreamAnalytics=e()}(window,(function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="dist/",r(r.s=0)}([function(t,e,r){t.exports=r(1)},function(t,e,r){"use strict";var n=this&&this.__assign||function(){return(n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)},i=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),o=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),s=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&i(e,t,r);return o(e,t),e},a=(this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}})(r(2)),u=s(r(3)),c=r(4),l="function"==typeof a.default?a.default:window.fetch,p=r(5),f=function(){function t(t){if(!t||!t.apiKey||!t.token)throw new u.MisconfiguredClient("the client must be initialized with apiKey and token");this.userData=null,this.apiKey=t.apiKey,this.token=t.token,this.baseUrl=t.baseUrl||"https://analytics.stream-io-api.com/analytics/v1.0/",this.node="undefined"==typeof window}return t.prototype.setUser=function(t){this.userData=t},t.prototype.userAgent=function(){return"stream-javascript-analytics-client-"+(this.node?"node":"browser")+"-"+(p.version||"unknown")},t.prototype._throwMissingUserData=function(t){if(!this.userData&&!t.user_data)throw new u.MissingUserId("user_data should be in each event or set the default with StreamAnalytics.setUser()")},t.prototype._validateAndNormalizeUserData=function(t,e){var r=this;return e.map((function(e,i){var o="impression"===t?c.validateImpression(e):c.validateEngagement(e);if(o)throw new u.InvalidInputData("invalid event data",i?o.map((function(t){return i+": "+t})):o);return r._throwMissingUserData(e),n(n({},e),{user_data:e.user_data||r.userData})}))},t.prototype._sendEvent=function(t,e){var r=this._validateAndNormalizeUserData(t,e);return l(this.baseUrl+t+"/?api_key="+this.apiKey,{method:"POST",body:JSON.stringify("impression"===t?r:{content_list:r}),headers:{"Content-Type":"application/json","X-Stream-Client":this.userAgent(),"stream-auth-type":"jwt",Authorization:this.token}}).then((function(t){return t.ok?t.json():t.json().then((function(e){if(e.detail)throw new u.APIError(t.statusText+": "+e.detail,t);throw new u.APIError(t.statusText,t)}))}))},t.prototype.trackImpression=function(t){return this.trackImpressions([t])},t.prototype.trackImpressions=function(t){return this._sendEvent("impression",t)},t.prototype.trackEngagement=function(t){return this.trackEngagements([t])},t.prototype.trackEngagements=function(t){return this._sendEvent("engagement",t)},t}();f.errors=u,t.exports=f},function(t,e){},function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.InvalidInputData=e.APIError=e.MisconfiguredClient=e.MissingUserId=void 0;var o="function"==typeof Error.captureStackTrace,s=!!(new Error).stack,a=function(t){Error.call(this,t),this.message=t,this.name=this.constructor.name,o?Error.captureStackTrace(this):this.stack=s?(new Error).stack:""};a.prototype=Object.create(Error.prototype);var u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e}(a);e.MissingUserId=u;var c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e}(a);e.MisconfiguredClient=c;var l=function(t){function e(e,r){var n=t.call(this,e)||this;return n.response=r,n}return i(e,t),e}(a);e.APIError=l;var p=function(t){function e(e,r){return t.call(this,e+": \n\t"+r.join("\n\t"))||this}return i(e,t),e}(a);e.InvalidInputData=p},function(t,e,r){"use strict";function n(t){return"object"==typeof t}Object.defineProperty(e,"__esModule",{value:!0}),e.validateImpression=e.validateEngagement=void 0;var i=function(t){if(!t)return"";if(!Array.isArray(t))return"features should be array";for(var e=0;e<t.length;e+=1){if(!t[e].group||"string"!=typeof t[e].group)return"feature.group should be string";if(!t[e].value||"string"!=typeof t[e].value)return"feature.value should be string"}return""};e.validateEngagement=function(t){if(!t)return["engagement should be an object"];var e=[];t.label||"string"==typeof t.label||e.push("label should be string"),(!t.content||"string"!=typeof t.content&&"object"!=typeof t.content)&&e.push("content should be string or object"),n(t.content)&&!t.content.foreign_id&&e.push("content.foreign_id should be string"),void 0!==t.position&&"number"!=typeof t.position&&e.push("position should be number"),void 0!==t.score&&"number"!=typeof t.score&&e.push("score should be number"),void 0!==t.boost&&"number"!=typeof t.boost&&e.push("boost should be number"),void 0!==t.feed_id&&"string"!=typeof t.feed_id&&e.push("feed_id should be string)"),void 0!==t.location&&"string"!=typeof t.location&&e.push("location should be string");var r=i(t.features);return r&&e.push(r),!!e.length&&e},e.validateImpression=function(t){if(!t)return["impression should be an object"];var e=[];Array.isArray(t.content_list)&&t.content_list.length||e.push("content should be array of strings or objects"),Array.isArray(t.content_list)&&t.content_list.forEach((function(t,r){n(t)&&!t.foreign_id&&e.push("content_list["+r+"].foreign_id should be string")})),void 0!==t.feed_id&&"string"!=typeof t.feed_id&&e.push("feed_id should be string"),void 0!==t.location&&"string"!=typeof t.location&&e.push("location should be string");var r=i(t.features);return r&&e.push(r),!!e.length&&e}},function(t){t.exports=JSON.parse('{"name":"stream-analytics","version":"3.4.4","description":"Analytics JS client for GetStream.io.","main":"./lib/stream-analytics.js","module":"./lib/stream-analytics.js","types":"./lib/stream-analytics.d.ts","scripts":{"test":"yarn test-node && yarn test-browser","test-node":"mocha tests --exit","test-browser":"karma start karma.config.js","lint":"yarn run prettier && yarn run eslint","eslint":"eslint \'**/*.{js,ts}\' --max-warnings 0","prettier":"prettier --config ./.prettierrc --list-different \\"**/*.{js,ts,md,html,json}\\"","prettier-fix":"prettier --config ./.prettierrc --write \\"**/*.{js,ts,md,html,json}\\"","build":"tsc && webpack && webpack --env production","preversion":"yarn run build && yarn test","version":"git add -A dist","postversion":"git push && git push --tags"},"repository":{"type":"git","url":"git://github.com/GetStream/stream-analytics-js.git"},"keywords":["npm","stream-analytics","getstream.io","stream.io"],"author":"Tommaso Barbugli <tommaso@getstream.io>","license":"MIT","bugs":{"url":"https://github.com/GetStream/stream-analytics-js/issues"},"homepage":"https://github.com/GetStream/stream-analytics-js","engines":{"node":"10 || 12 || >=14"},"browser":{"cross-fetch":false},"dependencies":{"cross-fetch":"^3.1.5"},"devDependencies":{"@types/node":"^14.11.2","@typescript-eslint/eslint-plugin":"^4.3.0","@typescript-eslint/parser":"^4.3.0","chai":"^4.2.0","dotenv":"^8.2.0","eslint":"^7.10.0","eslint-config-airbnb-base":"^14.2.0","eslint-config-prettier":"^6.12.0","eslint-plugin-import":"^2.22.1","eslint-plugin-prettier":"^3.1.4","eslint-plugin-typescript-sort-keys":"^1.5.0","karma":"^6.3.16","karma-chrome-launcher":"^3.1.0","karma-mocha":"^2.0.1","karma-mocha-reporter":"~2.2.5","karma-sauce-launcher":"^4.1.5","karma-sourcemap-loader":"~0.3.8","karma-webpack":"^4.0.2","mocha":"^8.1.3","prettier":"^2.1.2","ts-loader":"^8.0.4","typescript":"^4.0.3","webpack":"^4.46.0","webpack-cli":"^4.10.0"},"files":["src","dist","lib"]}')}])}));
{
"name": "stream-analytics",
"version": "3.4.3",
"version": "3.4.4",
"description": "Analytics JS client for GetStream.io.",

@@ -16,3 +16,3 @@ "main": "./lib/stream-analytics.js",

"prettier-fix": "prettier --config ./.prettierrc --write \"**/*.{js,ts,md,html,json}\"",
"build": "tsc && webpack && webpack --minify",
"build": "tsc && webpack && webpack --env production",
"preversion": "yarn run build && yarn test",

@@ -45,3 +45,3 @@ "version": "git add -A dist",

"dependencies": {
"cross-fetch": "^3.0.6"
"cross-fetch": "^3.1.5"
},

@@ -60,3 +60,3 @@ "devDependencies": {

"eslint-plugin-typescript-sort-keys": "^1.5.0",
"karma": "^5.2.3",
"karma": "^6.3.16",
"karma-chrome-launcher": "^3.1.0",

@@ -72,4 +72,4 @@ "karma-mocha": "^2.0.1",

"typescript": "^4.0.3",
"webpack": "^4.44.2",
"webpack-cli": "^3.3.12"
"webpack": "^4.46.0",
"webpack-cli": "^4.10.0"
},

@@ -76,0 +76,0 @@ "files": [

@@ -13,3 +13,3 @@ const canCapture = typeof Error.captureStackTrace === 'function';

// workaround for ES5 compilation to preserve the Error class
const ErrorAbstract = (function (this: ErrorAbstract, message: string) {
const ErrorAbstract = function (this: ErrorAbstract, message: string) {
Error.call(this, message);

@@ -23,3 +23,3 @@

else this.stack = '';
} as unknown) as ErrorAbstractConstructor;
} as unknown as ErrorAbstractConstructor;

@@ -26,0 +26,0 @@ ErrorAbstract.prototype = Object.create(Error.prototype);

Sorry, the diff of this file is not supported yet

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