libhoney
Advanced tools
Comparing version 3.0.0 to 3.1.0
# libhoney-js changelog | ||
## [3.1.0] - 2022-04-07 | ||
### Enhancements | ||
- Add support for environments (#244) | [@kentquirk](https://github.com/kentquirk) | ||
- ci: add node 17 to test matrix (#195) | [@vreynolds](https://github.com/vreynolds) | ||
- empower apply-labels action to apply labels (#205) | [@robbkidd](https://github.com/robbkidd) | ||
### Maintenance | ||
- gh: add re-triage workflow (#215) | [@vreynolds](https://github.com/vreynolds) | ||
- Update dependabot.yml (#212) | [@vreynolds](https://github.com/vreynolds) | ||
- Bump @babel/core to 7.16.12 (#230) | ||
- Bump @babel/eslint-parser to 7.16.5 (#223) | ||
- Bump @babel/preset-env to 7.16.8 (#224) | ||
- Bump @rollup/plugin-commonjs to 21.0.1 (#197) | ||
- Bump @rollup/plugin-node-resolve to 13.1.3 (#225) | ||
- Bump @rollup/plugin-replace to 3.0.1 (#216) | ||
- Bump eslint to 8.6.0 (#227) | ||
- Bump minimist to 2.5.1 (#220) | ||
- Bump superagent from 6.1.0 to 7.0.2 (#226) | ||
- Bump vm2 to 3.9.7 (#234) | ||
## [3.0.0] - 2021-10-18 | ||
@@ -4,0 +27,0 @@ |
@@ -199,3 +199,3 @@ 'use strict'; | ||
const USER_AGENT = "libhoney-js/3.0.0"; | ||
const USER_AGENT = "libhoney-js/3.1.0"; | ||
@@ -983,3 +983,3 @@ const _global = | ||
// If this is non-empty, append it to the end of the User-Agent header. | ||
userAgentAddition: "" | ||
userAgentAddition: "", | ||
}); | ||
@@ -1046,3 +1046,3 @@ | ||
this._responseQueue, | ||
this._options.maxResponseQueueSize | ||
this._options.maxResponseQueueSize, | ||
]; | ||
@@ -1192,2 +1192,13 @@ | ||
/** | ||
* isClassic takes a writeKey and returns true if it is a "classic" writeKey, | ||
* namely, that its length is exactly 32 characters. | ||
* @returns {boolean} whether the key is classic | ||
* | ||
* @private | ||
*/ | ||
isClassic(key) { | ||
return key.length === 32; | ||
} | ||
/** | ||
* validateEvent takes an event and validates its structure and contents. | ||
@@ -1207,3 +1218,3 @@ * | ||
if (typeof event.data !== "object" || event.data === null) { | ||
console.error(".data must be an object"); | ||
console.error("data must be an object"); | ||
return null; | ||
@@ -1221,3 +1232,3 @@ } | ||
if (typeof apiHost !== "string" || apiHost === "") { | ||
console.error(".apiHost must be a non-empty string"); | ||
console.error("apiHost must be a non-empty string"); | ||
return null; | ||
@@ -1228,3 +1239,3 @@ } | ||
if (typeof writeKey !== "string" || writeKey === "") { | ||
console.error(".writeKey must be a non-empty string"); | ||
console.error("writeKey must be a non-empty string"); | ||
return null; | ||
@@ -1234,10 +1245,19 @@ } | ||
let dataset = event.dataset; | ||
if (typeof dataset !== "string" || dataset === "") { | ||
console.error(".dataset must be a non-empty string"); | ||
if (typeof dataset !== "string") { | ||
console.error("dataset must be a string"); | ||
return null; | ||
} | ||
if (dataset === "") { | ||
if (this.isClassic(writeKey)) { | ||
console.error("dataset must be a non-empty string"); | ||
return null; | ||
} else { | ||
dataset = "unknown_dataset"; | ||
} | ||
} | ||
let sampleRate = event.sampleRate; | ||
if (typeof sampleRate !== "number") { | ||
console.error(".sampleRate must be a number"); | ||
console.error("sampleRate must be a number"); | ||
return null; | ||
@@ -1254,3 +1274,3 @@ } | ||
sampleRate, | ||
metadata | ||
metadata, | ||
}); | ||
@@ -1370,3 +1390,3 @@ } | ||
const getTransmissionClass = transmissionClassName => { | ||
const getTransmissionClass = (transmissionClassName) => { | ||
switch (transmissionClassName) { | ||
@@ -1410,3 +1430,3 @@ case "base": | ||
throw new Error( | ||
".transmission must be one of 'base'/'worker'/'mock'/'writer'/'console'/'stdout'/'null' or a constructor." | ||
"transmission must be one of 'base'/'worker'/'mock'/'writer'/'console'/'stdout'/'null' or a constructor." | ||
); | ||
@@ -1413,0 +1433,0 @@ } |
@@ -217,3 +217,3 @@ 'use strict'; | ||
const USER_AGENT = "libhoney-js/3.0.0"; | ||
const USER_AGENT = "libhoney-js/3.1.0"; | ||
@@ -1006,3 +1006,3 @@ const _global = | ||
// If this is non-empty, append it to the end of the User-Agent header. | ||
userAgentAddition: "" | ||
userAgentAddition: "", | ||
}); | ||
@@ -1069,3 +1069,3 @@ | ||
this._responseQueue, | ||
this._options.maxResponseQueueSize | ||
this._options.maxResponseQueueSize, | ||
]; | ||
@@ -1215,2 +1215,13 @@ | ||
/** | ||
* isClassic takes a writeKey and returns true if it is a "classic" writeKey, | ||
* namely, that its length is exactly 32 characters. | ||
* @returns {boolean} whether the key is classic | ||
* | ||
* @private | ||
*/ | ||
isClassic(key) { | ||
return key.length === 32; | ||
} | ||
/** | ||
* validateEvent takes an event and validates its structure and contents. | ||
@@ -1230,3 +1241,3 @@ * | ||
if (typeof event.data !== "object" || event.data === null) { | ||
console.error(".data must be an object"); | ||
console.error("data must be an object"); | ||
return null; | ||
@@ -1244,3 +1255,3 @@ } | ||
if (typeof apiHost !== "string" || apiHost === "") { | ||
console.error(".apiHost must be a non-empty string"); | ||
console.error("apiHost must be a non-empty string"); | ||
return null; | ||
@@ -1251,3 +1262,3 @@ } | ||
if (typeof writeKey !== "string" || writeKey === "") { | ||
console.error(".writeKey must be a non-empty string"); | ||
console.error("writeKey must be a non-empty string"); | ||
return null; | ||
@@ -1257,10 +1268,19 @@ } | ||
let dataset = event.dataset; | ||
if (typeof dataset !== "string" || dataset === "") { | ||
console.error(".dataset must be a non-empty string"); | ||
if (typeof dataset !== "string") { | ||
console.error("dataset must be a string"); | ||
return null; | ||
} | ||
if (dataset === "") { | ||
if (this.isClassic(writeKey)) { | ||
console.error("dataset must be a non-empty string"); | ||
return null; | ||
} else { | ||
dataset = "unknown_dataset"; | ||
} | ||
} | ||
let sampleRate = event.sampleRate; | ||
if (typeof sampleRate !== "number") { | ||
console.error(".sampleRate must be a number"); | ||
console.error("sampleRate must be a number"); | ||
return null; | ||
@@ -1277,3 +1297,3 @@ } | ||
sampleRate, | ||
metadata | ||
metadata, | ||
}); | ||
@@ -1393,3 +1413,3 @@ } | ||
const getTransmissionClass = transmissionClassName => { | ||
const getTransmissionClass = (transmissionClassName) => { | ||
switch (transmissionClassName) { | ||
@@ -1433,3 +1453,3 @@ case "base": | ||
throw new Error( | ||
".transmission must be one of 'base'/'worker'/'mock'/'writer'/'console'/'stdout'/'null' or a constructor." | ||
"transmission must be one of 'base'/'worker'/'mock'/'writer'/'console'/'stdout'/'null' or a constructor." | ||
); | ||
@@ -1436,0 +1456,0 @@ } |
@@ -191,3 +191,3 @@ import superagent from 'superagent'; | ||
const USER_AGENT = "libhoney-js/3.0.0"; | ||
const USER_AGENT = "libhoney-js/3.1.0"; | ||
@@ -980,3 +980,3 @@ const _global = | ||
// If this is non-empty, append it to the end of the User-Agent header. | ||
userAgentAddition: "" | ||
userAgentAddition: "", | ||
}); | ||
@@ -1043,3 +1043,3 @@ | ||
this._responseQueue, | ||
this._options.maxResponseQueueSize | ||
this._options.maxResponseQueueSize, | ||
]; | ||
@@ -1189,2 +1189,13 @@ | ||
/** | ||
* isClassic takes a writeKey and returns true if it is a "classic" writeKey, | ||
* namely, that its length is exactly 32 characters. | ||
* @returns {boolean} whether the key is classic | ||
* | ||
* @private | ||
*/ | ||
isClassic(key) { | ||
return key.length === 32; | ||
} | ||
/** | ||
* validateEvent takes an event and validates its structure and contents. | ||
@@ -1204,3 +1215,3 @@ * | ||
if (typeof event.data !== "object" || event.data === null) { | ||
console.error(".data must be an object"); | ||
console.error("data must be an object"); | ||
return null; | ||
@@ -1218,3 +1229,3 @@ } | ||
if (typeof apiHost !== "string" || apiHost === "") { | ||
console.error(".apiHost must be a non-empty string"); | ||
console.error("apiHost must be a non-empty string"); | ||
return null; | ||
@@ -1225,3 +1236,3 @@ } | ||
if (typeof writeKey !== "string" || writeKey === "") { | ||
console.error(".writeKey must be a non-empty string"); | ||
console.error("writeKey must be a non-empty string"); | ||
return null; | ||
@@ -1231,10 +1242,19 @@ } | ||
let dataset = event.dataset; | ||
if (typeof dataset !== "string" || dataset === "") { | ||
console.error(".dataset must be a non-empty string"); | ||
if (typeof dataset !== "string") { | ||
console.error("dataset must be a string"); | ||
return null; | ||
} | ||
if (dataset === "") { | ||
if (this.isClassic(writeKey)) { | ||
console.error("dataset must be a non-empty string"); | ||
return null; | ||
} else { | ||
dataset = "unknown_dataset"; | ||
} | ||
} | ||
let sampleRate = event.sampleRate; | ||
if (typeof sampleRate !== "number") { | ||
console.error(".sampleRate must be a number"); | ||
console.error("sampleRate must be a number"); | ||
return null; | ||
@@ -1251,3 +1271,3 @@ } | ||
sampleRate, | ||
metadata | ||
metadata, | ||
}); | ||
@@ -1367,3 +1387,3 @@ } | ||
const getTransmissionClass = transmissionClassName => { | ||
const getTransmissionClass = (transmissionClassName) => { | ||
switch (transmissionClassName) { | ||
@@ -1407,3 +1427,3 @@ case "base": | ||
throw new Error( | ||
".transmission must be one of 'base'/'worker'/'mock'/'writer'/'console'/'stdout'/'null' or a constructor." | ||
"transmission must be one of 'base'/'worker'/'mock'/'writer'/'console'/'stdout'/'null' or a constructor." | ||
); | ||
@@ -1410,0 +1430,0 @@ } |
{ | ||
"name": "libhoney", | ||
"version": "3.0.0", | ||
"version": "3.1.0", | ||
"description": " Honeycomb.io Javascript library", | ||
@@ -30,4 +30,3 @@ "bugs": "https://github.com/honeycombio/libhoney-js/issues", | ||
"check-format": "prettier \"src/**/*.js\" rollup.config.js rollup.browser.config.js", | ||
"lint": "eslint \"src/**/*.js\" rollup.config.js rollup.browser.config.js", | ||
"prepare": "husky install" | ||
"lint": "eslint \"src/**/*.js\" rollup.config.js rollup.browser.config.js" | ||
}, | ||
@@ -56,2 +55,3 @@ "author": "", | ||
"@babel/core": "^7.4.0", | ||
"@babel/eslint-parser": "^7.15.8", | ||
"@babel/preset-env": "^7.4.2", | ||
@@ -62,10 +62,7 @@ "@rollup/plugin-commonjs": "^21.0.0", | ||
"@rollup/plugin-replace": "^3.0.0", | ||
"babel-eslint": "^10.0.3", | ||
"babel-jest": "^27.2.4", | ||
"babel-polyfill": "^6.26.0", | ||
"eslint": "^7.25.0", | ||
"husky": "^7.0.1", | ||
"eslint": "^8.0.1", | ||
"jest": "^27.2.4", | ||
"jest-in-case": "^1.0.2", | ||
"lint-staged": "^11.0.0", | ||
"prettier": "^2.3.1", | ||
@@ -76,3 +73,3 @@ "rollup": "^2.58.0", | ||
"dependencies": { | ||
"superagent": "^6.1.0", | ||
"superagent": "^7.0.2", | ||
"superagent-proxy": "^3.0.0", | ||
@@ -79,0 +76,0 @@ "urljoin": "^0.1.5" |
152948
15
3952
+ Addedasap@2.0.6(transitive)
+ Addeddezalgo@1.0.4(transitive)
+ Addedform-data@4.0.0(transitive)
+ Addedformidable@2.1.2(transitive)
+ Addedhexoid@1.0.0(transitive)
+ Addedonce@1.4.0(transitive)
+ Addedsuperagent@7.1.6(transitive)
+ Addedwrappy@1.0.2(transitive)
- Removedform-data@3.0.1(transitive)
- Removedformidable@1.2.6(transitive)
- Removedsuperagent@6.1.0(transitive)
Updatedsuperagent@^7.0.2