npmci/dist/npmci.monitor.js
2017-09-08 23:16:09 +02:00

28 lines
2.1 KiB
JavaScript

"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
const plugins = require("./npmci.plugins");
const env = require("./npmci.env");
const smartanalytics_1 = require("smartanalytics");
exports.npmciAnalytics = new smartanalytics_1.Analytics({
apiEndPoint: 'https://pubapi.lossless.one/analytics',
projectId: 'gitzone',
appName: 'npmci'
});
exports.run = () => __awaiter(this, void 0, void 0, function* () {
exports.npmciAnalytics.recordEvent('npmToolExecution', {
host: env.repo.host,
user: env.repo.user,
repo: env.repo.repo
}).catch(err => {
plugins.beautylog.warn('Lossless Analytics API not available...');
});
});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibnBtY2kubW9uaXRvci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL25wbWNpLm1vbml0b3IudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7OztBQUFBLDJDQUEwQztBQUMxQyxtQ0FBa0M7QUFFbEMsbURBQTBDO0FBRS9CLFFBQUEsY0FBYyxHQUFHLElBQUksMEJBQVMsQ0FBQztJQUN4QyxXQUFXLEVBQUUsdUNBQXVDO0lBQ3BELFNBQVMsRUFBRSxTQUFTO0lBQ3BCLE9BQU8sRUFBRSxPQUFPO0NBQ2pCLENBQUMsQ0FBQTtBQUVTLFFBQUEsR0FBRyxHQUFHO0lBQ2Ysc0JBQWMsQ0FBQyxXQUFXLENBQUMsa0JBQWtCLEVBQUU7UUFDN0MsSUFBSSxFQUFFLEdBQUcsQ0FBQyxJQUFJLENBQUMsSUFBSTtRQUNuQixJQUFJLEVBQUUsR0FBRyxDQUFDLElBQUksQ0FBQyxJQUFJO1FBQ25CLElBQUksRUFBRSxHQUFHLENBQUMsSUFBSSxDQUFDLElBQUk7S0FDcEIsQ0FBQyxDQUFDLEtBQUssQ0FBQyxHQUFHO1FBQ1YsT0FBTyxDQUFDLFNBQVMsQ0FBQyxJQUFJLENBQUMseUNBQXlDLENBQUMsQ0FBQTtJQUNuRSxDQUFDLENBQUMsQ0FBQTtBQUNKLENBQUMsQ0FBQSxDQUFBIn0=