swdc-tracker
Advanced tools
Comparing version 1.4.8 to 1.4.9
@@ -61,3 +61,3 @@ "use strict"; | ||
_b = {}; | ||
return [4 /*yield*/, hash_1.hashValue(this.file_name)]; | ||
return [4 /*yield*/, (0, hash_1.hashValue)(this.file_name)]; | ||
case 1: return [2 /*return*/, (_a.data = ( | ||
@@ -64,0 +64,0 @@ // Only hash the value here. If the user works on this |
@@ -58,4 +58,4 @@ "use strict"; | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, hash_1.hashAndEncryptValues([ | ||
{ value: common_helper_1.convertWinPathToUnix(this.file_name), dataType: "file_name" }, | ||
case 0: return [4 /*yield*/, (0, hash_1.hashAndEncryptValues)([ | ||
{ value: (0, common_helper_1.convertWinPathToUnix)(this.file_name), dataType: "file_name" }, | ||
{ value: this.file_path, dataType: "file_path" }, | ||
@@ -62,0 +62,0 @@ ], jwt)]; |
@@ -54,3 +54,3 @@ "use strict"; | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, hash_1.hashAndEncryptValues([ | ||
case 0: return [4 /*yield*/, (0, hash_1.hashAndEncryptValues)([ | ||
{ value: this.project_name, dataType: "project_name" }, | ||
@@ -57,0 +57,0 @@ { value: this.project_directory, dataType: "project_directory" } |
@@ -57,3 +57,3 @@ "use strict"; | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, hash_1.hashAndEncryptValues([ | ||
case 0: return [4 /*yield*/, (0, hash_1.hashAndEncryptValues)([ | ||
{ value: this.repo_name, dataType: "repo_name" }, | ||
@@ -60,0 +60,0 @@ { value: this.repo_identifier, dataType: "repo_identifier" }, |
@@ -10,3 +10,3 @@ "use strict"; | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); | ||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); | ||
}; | ||
@@ -73,4 +73,4 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
// fetch tracker_api from plugin config | ||
http_1.setBaseUrl(swdcApiHost); | ||
return [4 /*yield*/, http_1.get("/plugins/config")]; | ||
(0, http_1.setBaseUrl)(swdcApiHost); | ||
return [4 /*yield*/, (0, http_1.get)("/plugins/config")]; | ||
case 1: | ||
@@ -80,13 +80,13 @@ result = _a.sent(); | ||
tracker_url_scheme = result.data.tracker_url_scheme || "https"; | ||
e = node_tracker_1.gotEmitter(tracker_api_host, tracker_url_scheme, 443, node_tracker_1.HttpMethod.POST, 0, 2); | ||
swdcTracker.spTracker = node_tracker_1.tracker([e], namespace, appId, false); | ||
e = (0, node_tracker_1.gotEmitter)(tracker_api_host, tracker_url_scheme, 443, node_tracker_1.HttpMethod.POST, 0, 2); | ||
swdcTracker.spTracker = (0, node_tracker_1.tracker)([e], namespace, appId, false); | ||
swdcTracker.spTracker.setPlatform('iot'); | ||
swdcTracker.spTracker.setTimezone(Intl.DateTimeFormat().resolvedOptions().timeZone); | ||
if (!env_helper_1.isTestMode()) { | ||
if (!(0, env_helper_1.isTestMode)()) { | ||
console.log("swdc-tracker initialized and ready to send events to " + tracker_api_host); | ||
} | ||
return [2 /*return*/, response_1.success()]; | ||
return [2 /*return*/, (0, response_1.success)()]; | ||
case 2: | ||
e_1 = _a.sent(); | ||
return [2 /*return*/, response_1.error(500, e_1, "Failed to initialize. " + e_1.message)]; | ||
return [2 /*return*/, (0, response_1.error)(500, e_1, "Failed to initialize. " + e_1.message)]; | ||
case 3: return [2 /*return*/]; | ||
@@ -108,3 +108,3 @@ } | ||
codetimePayload = new codetime_1.CodeTime(params).buildPayload(); | ||
return [4 /*yield*/, context_helper_1.buildContexts(params)]; | ||
return [4 /*yield*/, (0, context_helper_1.buildContexts)(params)]; | ||
case 1: | ||
@@ -130,3 +130,3 @@ contexts = _a.sent(); | ||
editorActionPayload = new editor_action_1.EditorAction(params).buildPayload(); | ||
return [4 /*yield*/, context_helper_1.buildContexts(params)]; | ||
return [4 /*yield*/, (0, context_helper_1.buildContexts)(params)]; | ||
case 1: | ||
@@ -151,3 +151,3 @@ contexts = _a.sent(); | ||
gitEventPayload = new git_event_1.GitEvent(params).buildPayload(); | ||
return [4 /*yield*/, context_helper_1.buildContexts(params)]; | ||
return [4 /*yield*/, (0, context_helper_1.buildContexts)(params)]; | ||
case 1: | ||
@@ -173,3 +173,3 @@ contexts = _a.sent(); | ||
uiInteractionPayload = new ui_interaction_1.UIInteraction(params).buildPayload(); | ||
return [4 /*yield*/, context_helper_1.buildContexts(params)]; | ||
return [4 /*yield*/, (0, context_helper_1.buildContexts)(params)]; | ||
case 1: | ||
@@ -186,3 +186,3 @@ contexts = _a.sent(); | ||
return __generator(this, function (_a) { | ||
if (env_helper_1.isTestMode()) { | ||
if ((0, env_helper_1.isTestMode)()) { | ||
// test mode - console log the event | ||
@@ -192,3 +192,3 @@ return [2 /*return*/, testEvent(event_payload, contexts)]; | ||
try { | ||
swdcTracker.spTracker.track(node_tracker_1.buildSelfDescribingEvent({ event: event_payload }), contexts); | ||
swdcTracker.spTracker.track((0, node_tracker_1.buildSelfDescribingEvent)({ event: event_payload }), contexts); | ||
} | ||
@@ -199,3 +199,3 @@ catch (e) { | ||
} | ||
return [2 /*return*/, response_1.success()]; | ||
return [2 /*return*/, (0, response_1.success)()]; | ||
}); | ||
@@ -220,3 +220,3 @@ }); | ||
lastProcessedTestEvent = event; | ||
return response_1.success(); | ||
return (0, response_1.success)(); | ||
} | ||
@@ -223,0 +223,0 @@ swdcTracker.getLastProcessedTestEvent = function () { |
@@ -79,3 +79,3 @@ "use strict"; | ||
} | ||
if (env_helper_1.isTestMode()) { | ||
if ((0, env_helper_1.isTestMode)()) { | ||
softwareDataDir = softwareDataDir + "-test"; | ||
@@ -82,0 +82,0 @@ } |
@@ -123,3 +123,3 @@ "use strict"; | ||
return __generator(this, function (_a) { | ||
userHashedValues = file_1.getStoredHashedValues(); | ||
userHashedValues = (0, file_1.getStoredHashedValues)(); | ||
// add dataType to userHashedValues cache if it doesn't already exist | ||
@@ -133,3 +133,3 @@ if (!userHashedValues[dataType]) { | ||
userHashedValues[dataType].push(hashedValue); | ||
file_1.storeHashedValues(userHashedValues); | ||
(0, file_1.storeHashedValues)(userHashedValues); | ||
} | ||
@@ -153,3 +153,3 @@ // return the result of hasValue | ||
}; | ||
return [4 /*yield*/, http_1.post("/user_encrypted_data", params, jwt)]; | ||
return [4 /*yield*/, (0, http_1.post)("/user_encrypted_data", params, jwt)]; | ||
case 1: | ||
@@ -167,7 +167,7 @@ _a.sent(); | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, http_1.get("/hashed_values", jwt)]; | ||
case 0: return [4 /*yield*/, (0, http_1.get)("/hashed_values", jwt)]; | ||
case 1: | ||
response = _a.sent(); | ||
hashed_values = response.data; | ||
return [4 /*yield*/, file_1.storeHashedValues(hashed_values)]; | ||
return [4 /*yield*/, (0, file_1.storeHashedValues)(hashed_values)]; | ||
case 2: | ||
@@ -174,0 +174,0 @@ _a.sent(); |
@@ -50,6 +50,6 @@ "use strict"; | ||
baseURL: url, | ||
timeout: 15000 // timeout so we're not getting ECONNRESET | ||
timeout: 30000 // timeout so we're not getting ECONNRESET | ||
}); | ||
// set the tracker version and ID | ||
var _a = env_helper_1.getPackageJson(), name = _a.name, version = _a.version; | ||
var _a = (0, env_helper_1.getPackageJson)(), name = _a.name, version = _a.version; | ||
axiosClient.defaults.headers.common["X-SWDC-Tracker-Version"] = version; | ||
@@ -56,0 +56,0 @@ axiosClient.defaults.headers.common["X-SWDC-Tracker-Id"] = name; |
@@ -8,3 +8,3 @@ "use strict"; | ||
this.status = 200; | ||
this.mode = env_helper_1.getTrackerMode(); | ||
this.mode = (0, env_helper_1.getTrackerMode)(); | ||
this.message = ""; | ||
@@ -33,3 +33,3 @@ this.error = {}; | ||
resp.status = status; | ||
resp.mode = env_helper_1.getTrackerMode(); | ||
resp.mode = (0, env_helper_1.getTrackerMode)(); | ||
resp.message = message; | ||
@@ -36,0 +36,0 @@ resp.error = error; |
{ | ||
"name": "swdc-tracker", | ||
"version": "1.4.8", | ||
"version": "1.4.9", | ||
"description": "swdc event tracker", | ||
@@ -24,9 +24,9 @@ "main": "dist", | ||
"sinon-chai": "^3.5.0", | ||
"ts-node": "^8.10.2", | ||
"typescript": "^3.9.5" | ||
"ts-node": "^10.2.1", | ||
"typescript": "^4.4.3" | ||
}, | ||
"dependencies": { | ||
"@snowplow/node-tracker": "^3.1.3", | ||
"@types/node": "^16.7.1", | ||
"axios": "^0.21.1", | ||
"@snowplow/node-tracker": "^3.1.5", | ||
"@types/node": "^16.10.3", | ||
"axios": "^ 0.22.0", | ||
"file-it": "^1.1.2", | ||
@@ -33,0 +33,0 @@ "libsodium": "^0.7.9", |
@@ -40,3 +40,3 @@ import { setBaseUrl, get } from "./utils/http"; | ||
return success(); | ||
} catch (e) { | ||
} catch (e: any) { | ||
return error(500, e, `Failed to initialize. ${e.message}`); | ||
@@ -43,0 +43,0 @@ } |
@@ -10,3 +10,3 @@ import axios from "axios"; | ||
baseURL: url, | ||
timeout: 15000 // timeout so we're not getting ECONNRESET | ||
timeout: 30000 // timeout so we're not getting ECONNRESET | ||
}); | ||
@@ -13,0 +13,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
144487
+ Addedaxios@0.22.0(transitive)
- Removedaxios@0.21.4(transitive)
Updated@types/node@^16.10.3
Updatedaxios@^ 0.22.0