From e3b1fab18178c78934aa3df990ad79f342163eef Mon Sep 17 00:00:00 2001 From: Phil Kunz Date: Sun, 28 Oct 2018 23:47:45 +0100 Subject: [PATCH] fix(core): update --- dist/index.d.ts | 1 - dist/index.js | 5 -- dist/smartanalytics.classes.analytics.d.ts | 13 ----- dist/smartanalytics.classes.analytics.js | 43 --------------- dist/smartanalytics.plugins.d.ts | 4 -- dist/smartanalytics.plugins.js | 8 --- docs/index.md | 64 ---------------------- package.json | 2 +- 8 files changed, 1 insertion(+), 139 deletions(-) delete mode 100644 dist/index.d.ts delete mode 100644 dist/index.js delete mode 100644 dist/smartanalytics.classes.analytics.d.ts delete mode 100644 dist/smartanalytics.classes.analytics.js delete mode 100644 dist/smartanalytics.plugins.d.ts delete mode 100644 dist/smartanalytics.plugins.js delete mode 100644 docs/index.md diff --git a/dist/index.d.ts b/dist/index.d.ts deleted file mode 100644 index 4089765..0000000 --- a/dist/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export { Analytics } from './smartanalytics.classes.analytics'; diff --git a/dist/index.js b/dist/index.js deleted file mode 100644 index c3f68d1..0000000 --- a/dist/index.js +++ /dev/null @@ -1,5 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var smartanalytics_classes_analytics_1 = require("./smartanalytics.classes.analytics"); -exports.Analytics = smartanalytics_classes_analytics_1.Analytics; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUFBLHVGQUE4RDtBQUFyRCx1REFBQSxTQUFTLENBQUEifQ== \ No newline at end of file diff --git a/dist/smartanalytics.classes.analytics.d.ts b/dist/smartanalytics.classes.analytics.d.ts deleted file mode 100644 index 3e6052a..0000000 --- a/dist/smartanalytics.classes.analytics.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -export declare class Analytics { - projectId: string; - appName: string; - apiEndPoint: string; - secretKey: string; - constructor(optionsArg: { - projectId: string; - appName: string; - apiEndPoint: string; - secretKey?: string; - }); - recordEvent(eventIdArg: string, analyticsDataArg: any): Promise; -} diff --git a/dist/smartanalytics.classes.analytics.js b/dist/smartanalytics.classes.analytics.js deleted file mode 100644 index 42f3e05..0000000 --- a/dist/smartanalytics.classes.analytics.js +++ /dev/null @@ -1,43 +0,0 @@ -"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("./smartanalytics.plugins"); -class Analytics { - constructor(optionsArg) { - this.secretKey = ''; - this.projectId = optionsArg.projectId; - this.appName = optionsArg.appName; - this.apiEndPoint = optionsArg.apiEndPoint; - if (optionsArg.secretKey) { - this.secretKey = optionsArg.secretKey; - } - } - recordEvent(eventIdArg, analyticsDataArg) { - return __awaiter(this, void 0, void 0, function* () { - let dataToSend = { - projectId: this.projectId, - appName: this.appName, - eventId: eventIdArg, - analyticsData: analyticsDataArg - }; - yield plugins.smartrequest.post(this.apiEndPoint, { - headers: { - 'authenticate': this.secretKey, - 'Content-Type': 'application/json' - }, - requestBody: dataToSend - }).catch(err => { - console.log(err); - }); - }); - } -} -exports.Analytics = Analytics; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRhbmFseXRpY3MuY2xhc3Nlcy5hbmFseXRpY3MuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9zbWFydGFuYWx5dGljcy5jbGFzc2VzLmFuYW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RQUNKLENBQUM7S0FBQTtDQUNGO0FBcENELDhCQW9DQyJ9 \ No newline at end of file diff --git a/dist/smartanalytics.plugins.d.ts b/dist/smartanalytics.plugins.d.ts deleted file mode 100644 index b3f3c9b..0000000 --- a/dist/smartanalytics.plugins.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import 'typings-global'; -import * as smartrequest from 'smartrequest'; -import * as smartq from 'smartq'; -export { smartrequest, smartq }; diff --git a/dist/smartanalytics.plugins.js b/dist/smartanalytics.plugins.js deleted file mode 100644 index 4f6041a..0000000 --- a/dist/smartanalytics.plugins.js +++ /dev/null @@ -1,8 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -require("typings-global"); -const smartrequest = require("smartrequest"); -exports.smartrequest = smartrequest; -const smartq = require("smartq"); -exports.smartq = smartq; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRhbmFseXRpY3MucGx1Z2lucy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL3NtYXJ0YW5hbHl0aWNzLnBsdWdpbnMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBQSwwQkFBdUI7QUFDdkIsNkNBQTRDO0FBSXhDLG9DQUFZO0FBSGhCLGlDQUFnQztBQUk1Qix3QkFBTSJ9 \ No newline at end of file diff --git a/docs/index.md b/docs/index.md deleted file mode 100644 index 2926bd2..0000000 --- a/docs/index.md +++ /dev/null @@ -1,64 +0,0 @@ -# smartanalytics - -Google Analytics everywhere - -## Availabililty - -[![npm](https://pushrocks.gitlab.io/assets/repo-button-npm.svg)](https://www.npmjs.com/package/smartanalytics) -[![git](https://pushrocks.gitlab.io/assets/repo-button-git.svg)](https://GitLab.com/pushrocks/smartanalytics) -[![git](https://pushrocks.gitlab.io/assets/repo-button-mirror.svg)](https://github.com/pushrocks/smartanalytics) -[![docs](https://pushrocks.gitlab.io/assets/repo-button-docs.svg)](https://pushrocks.gitlab.io/smartanalytics/) - -## Status for master - -[![build status](https://GitLab.com/pushrocks/smartanalytics/badges/master/build.svg)](https://GitLab.com/pushrocks/smartanalytics/commits/master) -[![coverage report](https://GitLab.com/pushrocks/smartanalytics/badges/master/coverage.svg)](https://GitLab.com/pushrocks/smartanalytics/commits/master) -[![npm downloads per month](https://img.shields.io/npm/dm/smartanalytics.svg)](https://www.npmjs.com/package/smartanalytics) -[![Dependency Status](https://david-dm.org/pushrocks/smartanalytics.svg)](https://david-dm.org/pushrocks/smartanalytics) -[![bitHound Dependencies](https://www.bithound.io/github/pushrocks/smartanalytics/badges/dependencies.svg)](https://www.bithound.io/github/pushrocks/smartanalytics/master/dependencies/npm) -[![bitHound Code](https://www.bithound.io/github/pushrocks/smartanalytics/badges/code.svg)](https://www.bithound.io/github/pushrocks/smartanalytics) -[![TypeScript](https://img.shields.io/badge/TypeScript-2.x-blue.svg)](https://nodejs.org/dist/latest-v6.x/docs/api/) -[![node](https://img.shields.io/badge/node->=%206.x.x-blue.svg)](https://nodejs.org/dist/latest-v6.x/docs/api/) -[![JavaScript Style Guide](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com/) - -## Usage - -Use TypeScript for best in class instellisense. - -### Why does this package exist? - -Tracking users in webapps is common, often to gain insight in who is using what and where to spend dev resources for best efficiency. - -Doing the same stuff in apps can be a bit of a hassle. -Unnecessary dependencies used by many existing analytics tools make the whole app slow -just to gain a little usage info. - -**Say hello to smartanalytics. :)** -It features a very slim dependency tree using the native node request module to send posts to a tracking API of your choice. - -### How do I use this package? - -```javascript -import { Analytics } from 'smartanalytics'; -let myAnalytics = new plugins.smartanalytics.Analytics({ - apiEndPoint: 'https://somepubapi.endpoint.com', - projectId: 'gitzone', - appName: 'npmts' -}); - -myAnalytics - .recordEvent('someEvent', { - myKey1: 'myValue1', - myKey2: 'myValue2', - myDataKey3: 3 - }) - .catch(err => { - console.log(err); - }); -``` - -For further information read the linked docs at the top of this README. - -> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh) - -[![repo-footer](https://pushrocks.gitlab.io/assets/repo-footer.svg)](https://push.rocks) diff --git a/package.json b/package.json index 44e740b..b791974 100755 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "typings": "dist/index.d.ts", "scripts": { "test": "(tstest test/)", - "build": "echo \"Not needed for now\"" + "build": "(tsbuild)" }, "author": "Lossless GmbH", "license": "MIT",