@adminide-stack/user-activity-browser 0.0.20-alpha.98 → 1.0.201-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,3 @@
1
1
  import { Subject } from 'rxjs';
2
- import { ApolloLink } from 'apollo-link';
2
+ import { ApolloLink } from '@apollo/client';
3
3
  export declare const activity: (subject: Subject<any>) => ApolloLink;
@@ -1,3 +1,2 @@
1
- import { ApolloClient } from 'apollo-client';
2
- import { NormalizedCacheObject } from 'apollo-cache-inmemory';
3
- export declare const client: ApolloClient<NormalizedCacheObject>;
1
+ import { ApolloClient } from '@apollo/client';
2
+ export declare const client: ApolloClient<import("@apollo/client").NormalizedCacheObject>;
@@ -1,5 +1,5 @@
1
1
  import * as Logger from 'bunyan';
2
- import { ApolloClient } from 'apollo-client';
2
+ import { ApolloClient } from '@apollo/client';
3
3
  declare const EventEmitter: any;
4
4
  export interface IZipkinGraphqlLoggerOptions {
5
5
  logger?: Logger;
@@ -1,6 +1,5 @@
1
1
  import * as React from 'react';
2
2
  import { Subject, Observable } from 'rxjs';
3
- import { WithApolloClient } from 'react-apollo';
4
3
  import { IActivityScheduler } from '../interfaces';
5
4
  export interface IActivityTrackerProps {
6
5
  stream: Subject<any>;
@@ -17,7 +16,7 @@ export declare const styles: {
17
16
  background: string;
18
17
  };
19
18
  };
20
- export declare class ActivityTrackerComponent extends React.Component<WithApolloClient<IActivityTrackerProps>, any> {
19
+ export declare class ActivityTrackerComponent extends React.Component<IActivityTrackerProps, any> {
21
20
  span: any;
22
21
  idle: any;
23
22
  onIdle: any;
package/lib/index.js CHANGED
@@ -1,105 +1,18 @@
1
- module.exports =
2
- /******/ (function(modules) { // webpackBootstrap
3
- /******/ // The module cache
4
- /******/ var installedModules = {};
5
- /******/
6
- /******/ // The require function
7
- /******/ function __webpack_require__(moduleId) {
8
- /******/
9
- /******/ // Check if module is in cache
10
- /******/ if(installedModules[moduleId]) {
11
- /******/ return installedModules[moduleId].exports;
12
- /******/ }
13
- /******/ // Create a new module (and put it into the cache)
14
- /******/ var module = installedModules[moduleId] = {
15
- /******/ i: moduleId,
16
- /******/ l: false,
17
- /******/ exports: {}
18
- /******/ };
19
- /******/
20
- /******/ // Execute the module function
21
- /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
22
- /******/
23
- /******/ // Flag the module as loaded
24
- /******/ module.l = true;
25
- /******/
26
- /******/ // Return the exports of the module
27
- /******/ return module.exports;
28
- /******/ }
29
- /******/
30
- /******/
31
- /******/ // expose the modules object (__webpack_modules__)
32
- /******/ __webpack_require__.m = modules;
33
- /******/
34
- /******/ // expose the module cache
35
- /******/ __webpack_require__.c = installedModules;
36
- /******/
37
- /******/ // define getter function for harmony exports
38
- /******/ __webpack_require__.d = function(exports, name, getter) {
39
- /******/ if(!__webpack_require__.o(exports, name)) {
40
- /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
41
- /******/ }
42
- /******/ };
43
- /******/
44
- /******/ // define __esModule on exports
45
- /******/ __webpack_require__.r = function(exports) {
46
- /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
47
- /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
48
- /******/ }
49
- /******/ Object.defineProperty(exports, '__esModule', { value: true });
50
- /******/ };
51
- /******/
52
- /******/ // create a fake namespace object
53
- /******/ // mode & 1: value is a module id, require it
54
- /******/ // mode & 2: merge all properties of value into the ns
55
- /******/ // mode & 4: return value when already ns object
56
- /******/ // mode & 8|1: behave like require
57
- /******/ __webpack_require__.t = function(value, mode) {
58
- /******/ if(mode & 1) value = __webpack_require__(value);
59
- /******/ if(mode & 8) return value;
60
- /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
61
- /******/ var ns = Object.create(null);
62
- /******/ __webpack_require__.r(ns);
63
- /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
64
- /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
65
- /******/ return ns;
66
- /******/ };
67
- /******/
68
- /******/ // getDefaultExport function for compatibility with non-harmony modules
69
- /******/ __webpack_require__.n = function(module) {
70
- /******/ var getter = module && module.__esModule ?
71
- /******/ function getDefault() { return module['default']; } :
72
- /******/ function getModuleExports() { return module; };
73
- /******/ __webpack_require__.d(getter, 'a', getter);
74
- /******/ return getter;
75
- /******/ };
76
- /******/
77
- /******/ // Object.prototype.hasOwnProperty.call
78
- /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
79
- /******/
80
- /******/ // __webpack_public_path__
81
- /******/ __webpack_require__.p = "";
82
- /******/
83
- /******/
84
- /******/ // Load entry module and return exports
85
- /******/ return __webpack_require__(__webpack_require__.s = "./src/index.tsx");
86
- /******/ })
87
- /************************************************************************/
88
- /******/ ({
1
+ /******/ (() => { // webpackBootstrap
2
+ /******/ "use strict";
3
+ /******/ var __webpack_modules__ = ({
89
4
 
90
5
  /***/ "./src/activity-link.ts":
91
6
  /*!******************************!*\
92
7
  !*** ./src/activity-link.ts ***!
93
8
  \******************************/
94
- /*! no static exports found */
95
- /***/ (function(module, exports, __webpack_require__) {
9
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
96
10
 
97
- "use strict";
98
11
 
99
- Object.defineProperty(exports, "__esModule", { value: true });
12
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
100
13
  exports.activity = void 0;
101
- const apollo_link_1 = __webpack_require__(/*! apollo-link */ "apollo-link");
102
- const activity = (subject) => new apollo_link_1.ApolloLink((operation, forward) => {
14
+ const client_1 = __webpack_require__(/*! @apollo/client */ "@apollo/client");
15
+ const activity = (subject) => new client_1.ApolloLink((operation, forward) => {
103
16
  subject.next(true);
104
17
  return forward(operation);
105
18
  });
@@ -112,27 +25,24 @@ exports.activity = activity;
112
25
  /*!******************************!*\
113
26
  !*** ./src/apollo-client.ts ***!
114
27
  \******************************/
115
- /*! no static exports found */
116
- /***/ (function(module, exports, __webpack_require__) {
28
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
117
29
 
118
- "use strict";
119
30
 
120
31
  var __importDefault = (this && this.__importDefault) || function (mod) {
121
32
  return (mod && mod.__esModule) ? mod : { "default": mod };
122
33
  };
123
- Object.defineProperty(exports, "__esModule", { value: true });
34
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
124
35
  exports.client = void 0;
125
- const apollo_link_1 = __webpack_require__(/*! apollo-link */ "apollo-link");
126
- const apollo_link_http_1 = __webpack_require__(/*! apollo-link-http */ "apollo-link-http");
127
- const apollo_client_1 = __webpack_require__(/*! apollo-client */ "apollo-client");
36
+ const http_1 = __webpack_require__(/*! @apollo/client/link/http */ "@apollo/client/link/http");
37
+ const client_1 = __webpack_require__(/*! @apollo/client */ "@apollo/client");
128
38
  const apollo_link_logger_1 = __importDefault(__webpack_require__(/*! apollo-link-logger */ "apollo-link-logger"));
129
- const apollo_cache_inmemory_1 = __webpack_require__(/*! apollo-cache-inmemory */ "apollo-cache-inmemory");
130
- const cache = new apollo_cache_inmemory_1.InMemoryCache();
131
- exports.client = new apollo_client_1.ApolloClient({
39
+ const cache_1 = __webpack_require__(/*! @apollo/client/cache */ "@apollo/client/cache");
40
+ const cache = new cache_1.InMemoryCache();
41
+ exports.client = new client_1.ApolloClient({
132
42
  cache,
133
- link: apollo_link_1.ApolloLink.from([
43
+ link: client_1.ApolloLink.from([
134
44
  apollo_link_logger_1.default,
135
- new apollo_link_http_1.HttpLink({ uri: `http://localhost:8081/graphql` }),
45
+ new http_1.HttpLink({ uri: `http://localhost:8081/graphql` }),
136
46
  ]),
137
47
  });
138
48
 
@@ -143,14 +53,16 @@ exports.client = new apollo_client_1.ApolloClient({
143
53
  /*!********************************************!*\
144
54
  !*** ./src/classes/ZipkinGraphqlLogger.ts ***!
145
55
  \********************************************/
146
- /*! no static exports found */
147
- /***/ (function(module, exports, __webpack_require__) {
56
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
148
57
 
149
- "use strict";
150
58
 
151
59
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
152
60
  if (k2 === undefined) k2 = k;
153
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
61
+ var desc = Object.getOwnPropertyDescriptor(m, k);
62
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
63
+ desc = { enumerable: true, get: function() { return m[k]; } };
64
+ }
65
+ Object.defineProperty(o, k2, desc);
154
66
  }) : (function(o, m, k, k2) {
155
67
  if (k2 === undefined) k2 = k;
156
68
  o[k2] = m[k];
@@ -170,13 +82,13 @@ var __importStar = (this && this.__importStar) || function (mod) {
170
82
  var __importDefault = (this && this.__importDefault) || function (mod) {
171
83
  return (mod && mod.__esModule) ? mod : { "default": mod };
172
84
  };
173
- Object.defineProperty(exports, "__esModule", { value: true });
85
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
174
86
  exports.ZipkinGraphqlLogger = void 0;
175
87
  const graphql_tag_1 = __importDefault(__webpack_require__(/*! graphql-tag */ "graphql-tag"));
176
88
  const Logger = __importStar(__webpack_require__(/*! bunyan */ "bunyan"));
177
89
  const { jsonEncoder: { JSON_V1 }, } = __webpack_require__(/*! zipkin */ "zipkin");
178
- const EventEmitter = __webpack_require__(/*! events */ "events").EventEmitter;
179
- const SEND_SPAN_MUTATION = graphql_tag_1.default `
90
+ const EventEmitter = (__webpack_require__(/*! events */ "events").EventEmitter);
91
+ const SEND_SPAN_MUTATION = (0, graphql_tag_1.default) `
180
92
  mutation batch($queue: [String]) {
181
93
  batchSpan(queue: $queue)
182
94
  }
@@ -254,14 +166,16 @@ exports.ZipkinGraphqlLogger = ZipkinGraphqlLogger;
254
166
  /*!********************************************!*\
255
167
  !*** ./src/components/ActivityTracker.tsx ***!
256
168
  \********************************************/
257
- /*! no static exports found */
258
- /***/ (function(module, exports, __webpack_require__) {
169
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
259
170
 
260
- "use strict";
261
171
 
262
172
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
263
173
  if (k2 === undefined) k2 = k;
264
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
174
+ var desc = Object.getOwnPropertyDescriptor(m, k);
175
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
176
+ desc = { enumerable: true, get: function() { return m[k]; } };
177
+ }
178
+ Object.defineProperty(o, k2, desc);
265
179
  }) : (function(o, m, k, k2) {
266
180
  if (k2 === undefined) k2 = k;
267
181
  o[k2] = m[k];
@@ -281,13 +195,11 @@ var __importStar = (this && this.__importStar) || function (mod) {
281
195
  var __importDefault = (this && this.__importDefault) || function (mod) {
282
196
  return (mod && mod.__esModule) ? mod : { "default": mod };
283
197
  };
284
- Object.defineProperty(exports, "__esModule", { value: true });
198
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
285
199
  exports.ActivityTracker = exports.ActivityTrackerComponent = exports.styles = exports.ACTIVITY_DEBOUNCE = void 0;
286
200
  const React = __importStar(__webpack_require__(/*! react */ "react"));
287
- const redux_1 = __webpack_require__(/*! redux */ "redux");
288
201
  const react_idle_timer_1 = __importDefault(__webpack_require__(/*! react-idle-timer */ "react-idle-timer"));
289
202
  const rxjs_1 = __webpack_require__(/*! rxjs */ "rxjs");
290
- const react_apollo_1 = __webpack_require__(/*! react-apollo */ "react-apollo");
291
203
  const graphql_tracer_1 = __webpack_require__(/*! ../graphql-tracer */ "./src/graphql-tracer.ts");
292
204
  const scheduler_1 = __webpack_require__(/*! ../scheduler */ "./src/scheduler.ts");
293
205
  const operators_1 = __webpack_require__(/*! rxjs/operators */ "rxjs/operators");
@@ -314,10 +226,10 @@ class ActivityTrackerComponent extends React.Component {
314
226
  this.scheduler = new scheduler_1.ActivityScheduler({});
315
227
  this.scheduler
316
228
  .tick$
317
- .pipe(operators_1.takeUntil(this.stop$), operators_1.map(() => this.scheduler.prepare('user-i', {})), operators_1.flatMap(request => this.scheduler.collect(request))).subscribe(() => { });
318
- this.mouse$ = rxjs_1.fromEvent(document, 'mousemove')
319
- .pipe(operators_1.takeUntil(this.stop$), operators_1.map(() => this.setState({ inactive: false })));
320
- rxjs_1.merge(this.mouse$, this.props.stream).pipe(operators_1.takeUntil(this.stop$), operators_1.debounceTime(exports.ACTIVITY_DEBOUNCE)).subscribe((data) => this.setState({ inactive: true }));
229
+ .pipe((0, operators_1.takeUntil)(this.stop$), (0, operators_1.map)(() => this.scheduler.prepare('user-i', {})), (0, operators_1.flatMap)(request => this.scheduler.collect(request))).subscribe(() => { });
230
+ this.mouse$ = (0, rxjs_1.fromEvent)(document, 'mousemove')
231
+ .pipe((0, operators_1.takeUntil)(this.stop$), (0, operators_1.map)(() => this.setState({ inactive: false })));
232
+ (0, rxjs_1.merge)(this.mouse$, this.props.stream).pipe((0, operators_1.takeUntil)(this.stop$), (0, operators_1.debounceTime)(exports.ACTIVITY_DEBOUNCE)).subscribe((data) => this.setState({ inactive: true }));
321
233
  }
322
234
  componentWillUnmount() {
323
235
  this.stop$.next(-1);
@@ -341,7 +253,7 @@ class ActivityTrackerComponent extends React.Component {
341
253
  }
342
254
  }
343
255
  exports.ActivityTrackerComponent = ActivityTrackerComponent;
344
- exports.ActivityTracker = redux_1.compose(react_apollo_1.withApollo)(ActivityTrackerComponent);
256
+ exports.ActivityTracker = ActivityTrackerComponent;
345
257
 
346
258
 
347
259
  /***/ }),
@@ -350,14 +262,16 @@ exports.ActivityTracker = redux_1.compose(react_apollo_1.withApollo)(ActivityTra
350
262
  /*!*******************************!*\
351
263
  !*** ./src/graphql-tracer.ts ***!
352
264
  \*******************************/
353
- /*! no static exports found */
354
- /***/ (function(module, exports, __webpack_require__) {
265
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
355
266
 
356
- "use strict";
357
267
 
358
268
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
359
269
  if (k2 === undefined) k2 = k;
360
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
270
+ var desc = Object.getOwnPropertyDescriptor(m, k);
271
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
272
+ desc = { enumerable: true, get: function() { return m[k]; } };
273
+ }
274
+ Object.defineProperty(o, k2, desc);
361
275
  }) : (function(o, m, k, k2) {
362
276
  if (k2 === undefined) k2 = k;
363
277
  o[k2] = m[k];
@@ -377,7 +291,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
377
291
  var __importDefault = (this && this.__importDefault) || function (mod) {
378
292
  return (mod && mod.__esModule) ? mod : { "default": mod };
379
293
  };
380
- Object.defineProperty(exports, "__esModule", { value: true });
294
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
381
295
  exports.tracer = void 0;
382
296
  const apollo_client_1 = __webpack_require__(/*! ./apollo-client */ "./src/apollo-client.ts");
383
297
  const ZipkinGraphqlLogger_1 = __webpack_require__(/*! ./classes/ZipkinGraphqlLogger */ "./src/classes/ZipkinGraphqlLogger.ts");
@@ -402,14 +316,16 @@ exports.tracer = new zipkin_javascript_opentracing_1.default({
402
316
  /*!***********************!*\
403
317
  !*** ./src/index.tsx ***!
404
318
  \***********************/
405
- /*! no static exports found */
406
- /***/ (function(module, exports, __webpack_require__) {
319
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
407
320
 
408
- "use strict";
409
321
 
410
322
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
411
323
  if (k2 === undefined) k2 = k;
412
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
324
+ var desc = Object.getOwnPropertyDescriptor(m, k);
325
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
326
+ desc = { enumerable: true, get: function() { return m[k]; } };
327
+ }
328
+ Object.defineProperty(o, k2, desc);
413
329
  }) : (function(o, m, k, k2) {
414
330
  if (k2 === undefined) k2 = k;
415
331
  o[k2] = m[k];
@@ -426,15 +342,15 @@ var __importStar = (this && this.__importStar) || function (mod) {
426
342
  __setModuleDefault(result, mod);
427
343
  return result;
428
344
  };
429
- Object.defineProperty(exports, "__esModule", { value: true });
345
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
430
346
  const React = __importStar(__webpack_require__(/*! react */ "react"));
431
347
  const rxjs_1 = __webpack_require__(/*! rxjs */ "rxjs");
432
348
  const client_react_1 = __webpack_require__(/*! @common-stack/client-react */ "@common-stack/client-react");
433
349
  const stream = new rxjs_1.Subject();
434
350
  const activity_link_1 = __webpack_require__(/*! ./activity-link */ "./src/activity-link.ts");
435
351
  const ActivityTracker_1 = __webpack_require__(/*! ./components/ActivityTracker */ "./src/components/ActivityTracker.tsx");
436
- exports.default = new client_react_1.Feature({
437
- link: activity_link_1.activity(stream),
352
+ exports["default"] = new client_react_1.Feature({
353
+ link: (0, activity_link_1.activity)(stream),
438
354
  rootComponentFactory: req => React.createElement(ActivityTracker_1.ActivityTracker, { stream: stream }),
439
355
  });
440
356
 
@@ -445,12 +361,10 @@ exports.default = new client_react_1.Feature({
445
361
  /*!**************************!*\
446
362
  !*** ./src/scheduler.ts ***!
447
363
  \**************************/
448
- /*! no static exports found */
449
- /***/ (function(module, exports, __webpack_require__) {
364
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
450
365
 
451
- "use strict";
452
366
 
453
- Object.defineProperty(exports, "__esModule", { value: true });
367
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
454
368
  exports.ActivityScheduler = void 0;
455
369
  const rxjs_1 = __webpack_require__(/*! rxjs */ "rxjs");
456
370
  const opentracing = __webpack_require__(/*! opentracing */ "opentracing");
@@ -459,7 +373,7 @@ class ActivityScheduler {
459
373
  this.client = opentracing.globalTracer();
460
374
  this.span = this.client.startSpan('UserActivity');
461
375
  this.interval = props.interval || 10000;
462
- this.tick$ = rxjs_1.interval(this.interval);
376
+ this.tick$ = (0, rxjs_1.interval)(this.interval);
463
377
  }
464
378
  prepare(user, payload = {}) {
465
379
  const ts = Date.now();
@@ -493,58 +407,43 @@ exports.ActivityScheduler = ActivityScheduler;
493
407
 
494
408
  /***/ }),
495
409
 
496
- /***/ "@common-stack/client-react":
497
- /*!*********************************************!*\
498
- !*** external "@common-stack/client-react" ***!
499
- \*********************************************/
500
- /*! no static exports found */
501
- /***/ (function(module, exports) {
502
-
503
- module.exports = require("@common-stack/client-react");
504
-
505
- /***/ }),
506
-
507
- /***/ "apollo-cache-inmemory":
508
- /*!****************************************!*\
509
- !*** external "apollo-cache-inmemory" ***!
510
- \****************************************/
511
- /*! no static exports found */
512
- /***/ (function(module, exports) {
410
+ /***/ "@apollo/client":
411
+ /*!*********************************!*\
412
+ !*** external "@apollo/client" ***!
413
+ \*********************************/
414
+ /***/ ((module) => {
513
415
 
514
- module.exports = require("apollo-cache-inmemory");
416
+ module.exports = require("@apollo/client");
515
417
 
516
418
  /***/ }),
517
419
 
518
- /***/ "apollo-client":
519
- /*!********************************!*\
520
- !*** external "apollo-client" ***!
521
- \********************************/
522
- /*! no static exports found */
523
- /***/ (function(module, exports) {
420
+ /***/ "@apollo/client/cache":
421
+ /*!***************************************!*\
422
+ !*** external "@apollo/client/cache" ***!
423
+ \***************************************/
424
+ /***/ ((module) => {
524
425
 
525
- module.exports = require("apollo-client");
426
+ module.exports = require("@apollo/client/cache");
526
427
 
527
428
  /***/ }),
528
429
 
529
- /***/ "apollo-link":
530
- /*!******************************!*\
531
- !*** external "apollo-link" ***!
532
- \******************************/
533
- /*! no static exports found */
534
- /***/ (function(module, exports) {
430
+ /***/ "@apollo/client/link/http":
431
+ /*!*******************************************!*\
432
+ !*** external "@apollo/client/link/http" ***!
433
+ \*******************************************/
434
+ /***/ ((module) => {
535
435
 
536
- module.exports = require("apollo-link");
436
+ module.exports = require("@apollo/client/link/http");
537
437
 
538
438
  /***/ }),
539
439
 
540
- /***/ "apollo-link-http":
541
- /*!***********************************!*\
542
- !*** external "apollo-link-http" ***!
543
- \***********************************/
544
- /*! no static exports found */
545
- /***/ (function(module, exports) {
440
+ /***/ "@common-stack/client-react":
441
+ /*!*********************************************!*\
442
+ !*** external "@common-stack/client-react" ***!
443
+ \*********************************************/
444
+ /***/ ((module) => {
546
445
 
547
- module.exports = require("apollo-link-http");
446
+ module.exports = require("@common-stack/client-react");
548
447
 
549
448
  /***/ }),
550
449
 
@@ -552,8 +451,7 @@ module.exports = require("apollo-link-http");
552
451
  /*!*************************************!*\
553
452
  !*** external "apollo-link-logger" ***!
554
453
  \*************************************/
555
- /*! no static exports found */
556
- /***/ (function(module, exports) {
454
+ /***/ ((module) => {
557
455
 
558
456
  module.exports = require("apollo-link-logger");
559
457
 
@@ -563,8 +461,7 @@ module.exports = require("apollo-link-logger");
563
461
  /*!*************************!*\
564
462
  !*** external "bunyan" ***!
565
463
  \*************************/
566
- /*! no static exports found */
567
- /***/ (function(module, exports) {
464
+ /***/ ((module) => {
568
465
 
569
466
  module.exports = require("bunyan");
570
467
 
@@ -574,8 +471,7 @@ module.exports = require("bunyan");
574
471
  /*!*************************!*\
575
472
  !*** external "events" ***!
576
473
  \*************************/
577
- /*! no static exports found */
578
- /***/ (function(module, exports) {
474
+ /***/ ((module) => {
579
475
 
580
476
  module.exports = require("events");
581
477
 
@@ -585,8 +481,7 @@ module.exports = require("events");
585
481
  /*!******************************!*\
586
482
  !*** external "graphql-tag" ***!
587
483
  \******************************/
588
- /*! no static exports found */
589
- /***/ (function(module, exports) {
484
+ /***/ ((module) => {
590
485
 
591
486
  module.exports = require("graphql-tag");
592
487
 
@@ -596,8 +491,7 @@ module.exports = require("graphql-tag");
596
491
  /*!******************************!*\
597
492
  !*** external "opentracing" ***!
598
493
  \******************************/
599
- /*! no static exports found */
600
- /***/ (function(module, exports) {
494
+ /***/ ((module) => {
601
495
 
602
496
  module.exports = require("opentracing");
603
497
 
@@ -607,52 +501,27 @@ module.exports = require("opentracing");
607
501
  /*!************************!*\
608
502
  !*** external "react" ***!
609
503
  \************************/
610
- /*! no static exports found */
611
- /***/ (function(module, exports) {
504
+ /***/ ((module) => {
612
505
 
613
506
  module.exports = require("react");
614
507
 
615
508
  /***/ }),
616
509
 
617
- /***/ "react-apollo":
618
- /*!*******************************!*\
619
- !*** external "react-apollo" ***!
620
- \*******************************/
621
- /*! no static exports found */
622
- /***/ (function(module, exports) {
623
-
624
- module.exports = require("react-apollo");
625
-
626
- /***/ }),
627
-
628
510
  /***/ "react-idle-timer":
629
511
  /*!***********************************!*\
630
512
  !*** external "react-idle-timer" ***!
631
513
  \***********************************/
632
- /*! no static exports found */
633
- /***/ (function(module, exports) {
514
+ /***/ ((module) => {
634
515
 
635
516
  module.exports = require("react-idle-timer");
636
517
 
637
518
  /***/ }),
638
519
 
639
- /***/ "redux":
640
- /*!************************!*\
641
- !*** external "redux" ***!
642
- \************************/
643
- /*! no static exports found */
644
- /***/ (function(module, exports) {
645
-
646
- module.exports = require("redux");
647
-
648
- /***/ }),
649
-
650
520
  /***/ "rxjs":
651
521
  /*!***********************!*\
652
522
  !*** external "rxjs" ***!
653
523
  \***********************/
654
- /*! no static exports found */
655
- /***/ (function(module, exports) {
524
+ /***/ ((module) => {
656
525
 
657
526
  module.exports = require("rxjs");
658
527
 
@@ -662,8 +531,7 @@ module.exports = require("rxjs");
662
531
  /*!*********************************!*\
663
532
  !*** external "rxjs/operators" ***!
664
533
  \*********************************/
665
- /*! no static exports found */
666
- /***/ (function(module, exports) {
534
+ /***/ ((module) => {
667
535
 
668
536
  module.exports = require("rxjs/operators");
669
537
 
@@ -673,8 +541,7 @@ module.exports = require("rxjs/operators");
673
541
  /*!*************************!*\
674
542
  !*** external "zipkin" ***!
675
543
  \*************************/
676
- /*! no static exports found */
677
- /***/ (function(module, exports) {
544
+ /***/ ((module) => {
678
545
 
679
546
  module.exports = require("zipkin");
680
547
 
@@ -684,12 +551,46 @@ module.exports = require("zipkin");
684
551
  /*!************************************************!*\
685
552
  !*** external "zipkin-javascript-opentracing" ***!
686
553
  \************************************************/
687
- /*! no static exports found */
688
- /***/ (function(module, exports) {
554
+ /***/ ((module) => {
689
555
 
690
556
  module.exports = require("zipkin-javascript-opentracing");
691
557
 
692
558
  /***/ })
693
559
 
694
- /******/ });
560
+ /******/ });
561
+ /************************************************************************/
562
+ /******/ // The module cache
563
+ /******/ var __webpack_module_cache__ = {};
564
+ /******/
565
+ /******/ // The require function
566
+ /******/ function __webpack_require__(moduleId) {
567
+ /******/ // Check if module is in cache
568
+ /******/ var cachedModule = __webpack_module_cache__[moduleId];
569
+ /******/ if (cachedModule !== undefined) {
570
+ /******/ return cachedModule.exports;
571
+ /******/ }
572
+ /******/ // Create a new module (and put it into the cache)
573
+ /******/ var module = __webpack_module_cache__[moduleId] = {
574
+ /******/ // no module.id needed
575
+ /******/ // no module.loaded needed
576
+ /******/ exports: {}
577
+ /******/ };
578
+ /******/
579
+ /******/ // Execute the module function
580
+ /******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
581
+ /******/
582
+ /******/ // Return the exports of the module
583
+ /******/ return module.exports;
584
+ /******/ }
585
+ /******/
586
+ /************************************************************************/
587
+ /******/
588
+ /******/ // startup
589
+ /******/ // Load entry module and return exports
590
+ /******/ // This entry module is referenced by other modules so it can't be inlined
591
+ /******/ var __webpack_exports__ = __webpack_require__("./src/index.tsx");
592
+ /******/ module.exports = __webpack_exports__;
593
+ /******/
594
+ /******/ })()
595
+ ;
695
596
  //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./src/activity-link.ts","webpack:///./src/apollo-client.ts","webpack:///./src/classes/ZipkinGraphqlLogger.ts","webpack:///./src/components/ActivityTracker.tsx","webpack:///./src/graphql-tracer.ts","webpack:///./src/index.tsx","webpack:///./src/scheduler.ts","webpack:///external \"@common-stack/client-react\"","webpack:///external \"apollo-cache-inmemory\"","webpack:///external \"apollo-client\"","webpack:///external \"apollo-link\"","webpack:///external \"apollo-link-http\"","webpack:///external \"apollo-link-logger\"","webpack:///external \"bunyan\"","webpack:///external \"events\"","webpack:///external \"graphql-tag\"","webpack:///external \"opentracing\"","webpack:///external \"react\"","webpack:///external \"react-apollo\"","webpack:///external \"react-idle-timer\"","webpack:///external \"redux\"","webpack:///external \"rxjs\"","webpack:///external \"rxjs/operators\"","webpack:///external \"zipkin\"","webpack:///external \"zipkin-javascript-opentracing\""],"names":[],"mappings":";;QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;;;;;;;;;AChFA,4EAAyC;AAElC,MAAM,QAAQ,GAAG,CAAC,OAAqB,EAAE,EAAE,CAC9C,IAAI,wBAAU,CAAC,CAAC,SAAS,EAAE,OAAO,EAAE,EAAE;IAClC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACnB,OAAO,OAAO,CAAC,SAAS,CAAC,CAAC;AAC9B,CAAC,CAAC,CAAC;AAJM,gBAAQ,YAId;;;;;;;;;;;;;;;;;;;ACRP,4EAAyC;AACzC,2FAA4C;AAC5C,kFAA6C;AAC7C,kHAA8C;AAC9C,0GAA6E;AAE7E,MAAM,KAAK,GAAG,IAAI,qCAAa,EAAE,CAAC;AAErB,cAAM,GAAG,IAAI,4BAAY,CAAC;IACnC,KAA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,IAAI,CAAC,MAAM,EAAE,CAAC;YACnB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;YAClD,OAAO,IAAI,CAAC;SACf;QAAC,OAAO,CAAC,EAAE;YACR,OAAO,CAAC,GAAG,CAAC,SAAS,EAAE,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC;YACvC,OAAO,KAAK,CAAC;SAChB;IACL,CAAC;CACJ;AAtCD,8CAsCC;;;;;;;;;;;;AC/CD,uD;;;;;;;;;;;ACAA,kD;;;;;;;;;;;ACAA,0C;;;;;;;;;;;ACAA,wC;;;;;;;;;;;ACAA,6C;;;;;;;;;;;ACAA,+C;;;;;;;;;;;ACAA,mC;;;;;;;;;;;ACAA,mC;;;;;;;;;;;ACAA,wC;;;;;;;;;;;ACAA,wC;;;;;;;;;;;ACAA,kC;;;;;;;;;;;ACAA,yC;;;;;;;;;;;ACAA,6C;;;;;;;;;;;ACAA,kC;;;;;;;;;;;ACAA,iC;;;;;;;;;;;ACAA,2C;;;;;;;;;;;ACAA,mC;;;;;;;;;;;ACAA,0D","file":"index.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./src/index.tsx\");\n","import * as _ from 'lodash';\nimport { Subject } from 'rxjs';\nimport { ApolloLink } from 'apollo-link';\n\nexport const activity = (subject: Subject<any>) =>\n new ApolloLink((operation, forward) => {\n subject.next(true);\n return forward(operation);\n });\n","import { ApolloLink } from 'apollo-link';\nimport { HttpLink } from 'apollo-link-http';\nimport { ApolloClient } from 'apollo-client';\nimport apolloLogger from 'apollo-link-logger';\nimport { InMemoryCache, NormalizedCacheObject } from 'apollo-cache-inmemory';\n\nconst cache = new InMemoryCache();\n\nexport const client = new ApolloClient({\n cache,\n link: ApolloLink.from([\n apolloLogger,\n new HttpLink({ uri: `http://localhost:8081/graphql` }),\n ]),\n});\n","import gql from 'graphql-tag';\nimport * as Logger from 'bunyan';\nimport { ApolloClient } from 'apollo-client';\n\nconst {\n jsonEncoder: { JSON_V1 },\n } = require('zipkin');\n\nconst EventEmitter = require('events').EventEmitter;\n\nexport interface IZipkinGraphqlLoggerOptions {\n logger?: Logger;\n timeout?: number;\n jsonEncoder?: any;\n httpInterval?: number;\n maxPayloadSize?: number;\n client: ApolloClient<any>;\n}\n\nconst SEND_SPAN_MUTATION = gql`\n mutation batch($queue: [String]) {\n batchSpan(queue: $queue)\n }\n`;\n\nexport class ZipkinGraphqlLogger extends EventEmitter {\n private client: ApolloClient<any>;\n private queue;\n private queueBytes;\n private errorListenerSet;\n private logger;\n private timeout;\n private maxPayloadSize;\n private httpInterval;\n private jsonEncoder;\n\n constructor({\n logger,\n client,\n timeout = 0,\n maxPayloadSize = 0,\n httpInterval = 1000,\n jsonEncoder = JSON_V1,\n }: IZipkinGraphqlLoggerOptions) {\n super();\n this.queue = [];\n this.client = client;\n this.queueBytes = 0;\n this.jsonEncoder = jsonEncoder;\n this.maxPayloadSize = maxPayloadSize;\n this.logger = logger || Logger.createLogger({ name: ZipkinGraphqlLogger.name });\n\n this.errorListenerSet = false;\n\n // req/res timeout in ms, it resets on redirect. 0 to disable (OS limit applies)\n // only supported by node-fetch; silently ignored by browser fetch clients\n // @see https://github.com/bitinn/node-fetch#fetch-options\n this.timeout = timeout;\n\n const timer = setInterval(() => {\n this.processQueue();\n }, httpInterval);\n \n // if (timer.unref) { // unref might not be available in browsers\n // timer.unref(); // Allows Node to terminate instead of blocking on timer\n // }\n }\n\n public _getPayloadSize(nextSpan) {\n // Our payload is in format '[s1,s2,s3]', so we need to add 2 brackets and\n // one comma separator for each payload, including the next span if defined\n return nextSpan\n ? this.queueBytes + 2 + this.queue.length + nextSpan.length\n : this.queueBytes + 2 + Math.min(this.queue.length - 1, 0);\n }\n\n public on(...args) {\n const eventName = args[0];\n // if the instance has an error handler set then we don't need to\n // skips error logging\n if (eventName.toLowerCase() === 'error') {\n this.errorListenerSet = true;\n }\n super.on.apply(this, args);\n }\n\n public logSpan(span) {\n const encodedSpan = this.jsonEncoder.encode(span);\n if (this.maxPayloadSize && this._getPayloadSize(encodedSpan) > this.maxPayloadSize) {\n this.processQueue();\n if (this._getPayloadSize(encodedSpan) > this.maxPayloadSize) {\n // Payload size is too large even with an empty queue, can only drop\n const err = 'Zipkin span got dropped, reason: payload too large';\n if (this.errorListenerSet) {\n this.emit('error', new Error(err));\n } else {\n this.log.error(err);\n }\n return;\n }\n }\n this.queue.push(encodedSpan);\n this.queueBytes += encodedSpan.length;\n }\n\n public processQueue() {\n if (this.queue.length > 0) {\n this.client.mutate({ mutation: SEND_SPAN_MUTATION, variables: { queue: this.queue } });\n\n this.queue.length = 0;\n this.queueBytes = 0;\n }\n }\n}\n","import * as React from 'react';\nimport { compose } from 'redux';\nimport IdleTimer from 'react-idle-timer';\nimport { Subject, Observable, fromEvent, merge } from 'rxjs';\nimport { withApollo, WithApolloClient } from 'react-apollo';\n\nimport { tracer } from '../graphql-tracer';\nimport { ActivityScheduler } from '../scheduler';\nimport { IActivityScheduler } from '../interfaces';\nimport { takeUntil, map, flatMap, debounceTime } from 'rxjs/operators';\n\nexport interface IActivityTrackerProps {\n stream: Subject<any>;\n}\n\n// export const ACTIVITY_DEBOUNCE = 10000;\nexport const ACTIVITY_DEBOUNCE = 900000;\n\nexport const styles = ({\n footer: ({\n bottom: 0,\n zIndex: '9999',\n width: '100%',\n display: 'flex',\n padding: '0 15px',\n position: 'fixed',\n background: '#fff',\n }),\n});\n\nexport class ActivityTrackerComponent extends React.Component<WithApolloClient<IActivityTrackerProps>, any> {\n public span: any;\n public idle: any;\n public onIdle: any;\n public onActive: any;\n\n public stop$ = new Subject();\n public mouse$: Observable<any>;\n public activity$: Observable<any>;\n public state = { inactive: false };\n public scheduler: IActivityScheduler;\n\n public componentDidMount() {\n this.scheduler = new ActivityScheduler({});\n\n this.scheduler\n .tick$\n .pipe(\n takeUntil(this.stop$),\n map(() => this.scheduler.prepare('user-i', {})),\n flatMap(request => this.scheduler.collect(request)),\n ).subscribe(() => { /** todos */ });\n\n this.mouse$ = fromEvent(document, 'mousemove')\n .pipe(\n takeUntil(this.stop$),\n map(() => this.setState({ inactive: false })),\n );\n\n merge(\n this.mouse$,\n this.props.stream,\n ).pipe(\n takeUntil(this.stop$),\n debounceTime(ACTIVITY_DEBOUNCE),\n\n ).subscribe((data) => this.setState({ inactive: true }));\n }\n\n public componentWillUnmount() {\n this.stop$.next(-1);\n this.stop$.complete();\n\n if (this.span) {\n this.span.finish();\n delete this.span; // Delete span objct from component\n }\n }\n\n private _onActive() {\n this.idle.finish();\n }\n\n private _onIdle() {\n alert('Idle!');\n this.idle = (tracer as any).startSpan('idle', { childOf: this.span });\n this.idle.log({ type: 'ns' });\n }\n\n public render() {\n return (\n <React.Fragment>\n <IdleTimer\n timeout={5000}\n element={document}\n onIdle={this.onIdle}\n onActive={this.onActive}\n >\n {this.props.children}\n </IdleTimer>\n </React.Fragment>\n );\n }\n}\n\nexport const ActivityTracker: any = compose(\n withApollo,\n)(ActivityTrackerComponent);\n","import * as Logger from 'bunyan';\nimport { client } from './apollo-client';\nimport { ZipkinGraphqlLogger } from './classes/ZipkinGraphqlLogger';\n\nimport * as zipkin from 'zipkin';\nimport * as opentracing from 'opentracing';\nimport { HttpLogger } from 'zipkin-transport-http';\nimport ZipkinOpentracing from 'zipkin-javascript-opentracing';\n\nexport const tracer = new ZipkinOpentracing({\n ctxImpl: new zipkin.ExplicitContext(),\n recorder: new zipkin.BatchRecorder({\n logger: new ZipkinGraphqlLogger({\n client,\n }),\n }),\n kind: 'client',\n serviceName: 'frontend',\n sampler: new zipkin.sampler.CountingSampler(100),\n});\n","import * as React from 'react';\nimport { Subject } from 'rxjs';\nimport { Feature, IRouteData, IMenuPosition } from '@common-stack/client-react';\n\nconst stream = new Subject();\n\nimport { activity } from './activity-link';\nimport { ActivityTracker } from './components/ActivityTracker';\n\nexport default new Feature({\n link: activity(stream),\n rootComponentFactory: req => <ActivityTracker stream={stream} />,\n} as any);\n\n\n","import { Observable, interval } from 'rxjs';\nconst opentracing = require('opentracing');\n\nimport { IActivityScheduler, IActivityCollectRequest } from './interfaces';\n\nexport interface ISchedulerProps {\n interval?: number;\n}\n\nexport class ActivityScheduler implements IActivityScheduler {\n public interval: number;\n public tick$: Observable<number>;\n private client = opentracing.globalTracer();\n private span = this.client.startSpan('UserActivity');\n\n constructor(props: ISchedulerProps) {\n this.interval = props.interval || 10000;\n this.tick$ = interval(this.interval);\n }\n\n public prepare(user, payload = {}): IActivityCollectRequest {\n const ts = Date.now();\n return {\n user,\n scope: 'User',\n timestamp: ts,\n duration: this.interval,\n payload: JSON.stringify(payload),\n annotations: JSON.stringify([{\n timestamp: ts,\n value: `user=${user}`,\n }]),\n };\n }\n\n public async collect(request: IActivityCollectRequest): Promise<boolean> {\n try {\n const ok = await this.span.log(request);\n\n this.span.finish();\n this.span = this.client.startSpan('UserActivity');\n return true;\n } catch (e) {\n console.log('ERROR: ', { e, request });\n return false;\n }\n }\n}\n","module.exports = require(\"@common-stack/client-react\");","module.exports = require(\"apollo-cache-inmemory\");","module.exports = require(\"apollo-client\");","module.exports = require(\"apollo-link\");","module.exports = require(\"apollo-link-http\");","module.exports = require(\"apollo-link-logger\");","module.exports = require(\"bunyan\");","module.exports = require(\"events\");","module.exports = require(\"graphql-tag\");","module.exports = require(\"opentracing\");","module.exports = require(\"react\");","module.exports = require(\"react-apollo\");","module.exports = require(\"react-idle-timer\");","module.exports = require(\"redux\");","module.exports = require(\"rxjs\");","module.exports = require(\"rxjs/operators\");","module.exports = require(\"zipkin\");","module.exports = require(\"zipkin-javascript-opentracing\");"],"sourceRoot":""}
1
+ {"version":3,"file":"index.js","mappings":";;;;;;;;;;;;;AAEA,6EAA4C;AAErC,MAAM,QAAQ,GAAG,CAAC,OAAqB,EAAE,EAAE,CAC9C,IAAI,mBAAU,CAAC,CAAC,SAAS,EAAE,OAAO,EAAE,EAAE;IAClC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACnB,OAAO,OAAO,CAAC,SAAS,CAAC,CAAC;AAC9B,CAAC,CAAC,CAAC;AAJM,gBAAQ,YAId;;;;;;;;;;;;;;;;;ACRP,+FAAoD;AACpD,6EAA0D;AAC1D,kHAA8C;AAC9C,wFAAqD;AAErD,MAAM,KAAK,GAAG,IAAI,qBAAa,EAAE,CAAC;AAErB,cAAM,GAAG,IAAI,qBAAY,CAAC;IACnC,KAAK;IACL,IAAI,EAAE,mBAAU,CAAC,IAAI,CAAC;QAClB,4BAAY;QACZ,IAAI,eAAQ,CAAC,EAAE,GAAG,EAAE,+BAA+B,EAAE,CAAC;KACzD,CAAC;CACL,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACbH,6FAA8B;AAC9B,yEAAiC;AAGjC,MAAM,EACF,WAAW,EAAE,EAAE,OAAO,EAAE,GACzB,GAAG,mBAAO,CAAC,sBAAQ,CAAC,CAAC;AAExB,MAAM,YAAY,GAAG,0DAA8B,CAAC;AAWpD,MAAM,kBAAkB,GAAG,yBAAG;;;;CAI7B,CAAC;AAEF,MAAa,mBAAoB,SAAQ,YAAY;IAWjD,YAAY,EACR,MAAM,EACN,MAAM,EACN,OAAO,GAAG,CAAC,EACX,cAAc,GAAG,CAAC,EAClB,YAAY,GAAG,IAAI,EACnB,WAAW,GAAG,OAAO,GACK;QAC1B,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;QAChB,I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ity-link.ts","webpack://@adminide-stack/user-activity-browser/./src/apollo-client.ts","webpack://@adminide-stack/user-activity-browser/./src/classes/ZipkinGraphqlLogger.ts","webpack://@adminide-stack/user-activity-browser/./src/components/ActivityTracker.tsx","webpack://@adminide-stack/user-activity-browser/./src/graphql-tracer.ts","webpack://@adminide-stack/user-activity-browser/./src/index.tsx","webpack://@adminide-stack/user-activity-browser/./src/scheduler.ts","webpack://@adminide-stack/user-activity-browser/external commonjs \"@apollo/client\"","webpack://@adminide-stack/user-activity-browser/external commonjs \"@apollo/client/cache\"","webpack://@adminide-stack/user-activity-browser/external commonjs \"@apollo/client/link/http\"","webpack://@adminide-stack/user-activity-browser/external commonjs \"@common-stack/client-react\"","webpack://@adminide-stack/user-activity-browser/external commonjs \"apollo-link-logger\"","webpack://@adminide-stack/user-activity-browser/external commonjs \"bunyan\"","webpack://@adminide-stack/user-activity-browser/external commonjs \"events\"","webpack://@adminide-stack/user-activity-browser/external commonjs \"graphql-tag\"","webpack://@adminide-stack/user-activity-browser/external commonjs \"opentracing\"","webpack://@adminide-stack/user-activity-browser/external commonjs \"react\"","webpack://@adminide-stack/user-activity-browser/external commonjs \"react-idle-timer\"","webpack://@adminide-stack/user-activity-browser/external commonjs \"rxjs\"","webpack://@adminide-stack/user-activity-browser/external commonjs \"rxjs/operators\"","webpack://@adminide-stack/user-activity-browser/external commonjs \"zipkin\"","webpack://@adminide-stack/user-activity-browser/external commonjs \"zipkin-javascript-opentracing\"","webpack://@adminide-stack/user-activity-browser/webpack/bootstrap","webpack://@adminide-stack/user-activity-browser/webpack/before-startup","webpack://@adminide-stack/user-activity-browser/webpack/startup","webpack://@adminide-stack/user-activity-browser/webpack/after-startup"],"sourcesContent":["import * as _ from 'lodash';\nimport { Subject } from 'rxjs';\nimport { ApolloLink } from '@apollo/client';\n\nexport const activity = (subject: Subject<any>) =>\n new ApolloLink((operation, forward) => {\n subject.next(true);\n return forward(operation);\n });\n","import { HttpLink } from '@apollo/client/link/http';\nimport { ApolloClient, ApolloLink } from '@apollo/client';\nimport apolloLogger from 'apollo-link-logger';\nimport { InMemoryCache } from '@apollo/client/cache';\n\nconst cache = new InMemoryCache();\n\nexport const client = new ApolloClient({\n cache,\n link: ApolloLink.from([\n apolloLogger,\n new HttpLink({ uri: `http://localhost:8081/graphql` }),\n ]),\n});\n","import gql from 'graphql-tag';\nimport * as Logger from 'bunyan';\nimport { ApolloClient } from '@apollo/client';\n\nconst {\n jsonEncoder: { JSON_V1 },\n } = require('zipkin');\n\nconst EventEmitter = require('events').EventEmitter;\n\nexport interface IZipkinGraphqlLoggerOptions {\n logger?: Logger;\n timeout?: number;\n jsonEncoder?: any;\n httpInterval?: number;\n maxPayloadSize?: number;\n client: ApolloClient<any>;\n}\n\nconst SEND_SPAN_MUTATION = gql`\n mutation batch($queue: [String]) {\n batchSpan(queue: $queue)\n }\n`;\n\nexport class ZipkinGraphqlLogger extends EventEmitter {\n private client: ApolloClient<any>;\n private queue;\n private queueBytes;\n private errorListenerSet;\n private logger;\n private timeout;\n private maxPayloadSize;\n private httpInterval;\n private jsonEncoder;\n\n constructor({\n logger,\n client,\n timeout = 0,\n maxPayloadSize = 0,\n httpInterval = 1000,\n jsonEncoder = JSON_V1,\n }: IZipkinGraphqlLoggerOptions) {\n super();\n this.queue = [];\n this.client = client;\n this.queueBytes = 0;\n this.jsonEncoder = jsonEncoder;\n this.maxPayloadSize = maxPayloadSize;\n this.logger = logger || Logger.createLogger({ name: ZipkinGraphqlLogger.name });\n\n this.errorListenerSet = false;\n\n // req/res timeout in ms, it resets on redirect. 0 to disable (OS limit applies)\n // only supported by node-fetch; silently ignored by browser fetch clients\n // @see https://github.com/bitinn/node-fetch#fetch-options\n this.timeout = timeout;\n\n const timer = setInterval(() => {\n this.processQueue();\n }, httpInterval);\n \n // if (timer.unref) { // unref might not be available in browsers\n // timer.unref(); // Allows Node to terminate instead of blocking on timer\n // }\n }\n\n public _getPayloadSize(nextSpan) {\n // Our payload is in format '[s1,s2,s3]', so we need to add 2 brackets and\n // one comma separator for each payload, including the next span if defined\n return nextSpan\n ? this.queueBytes + 2 + this.queue.length + nextSpan.length\n : this.queueBytes + 2 + Math.min(this.queue.length - 1, 0);\n }\n\n public on(...args) {\n const eventName = args[0];\n // if the instance has an error handler set then we don't need to\n // skips error logging\n if (eventName.toLowerCase() === 'error') {\n this.errorListenerSet = true;\n }\n super.on.apply(this, args);\n }\n\n public logSpan(span) {\n const encodedSpan = this.jsonEncoder.encode(span);\n if (this.maxPayloadSize && this._getPayloadSize(encodedSpan) > this.maxPayloadSize) {\n this.processQueue();\n if (this._getPayloadSize(encodedSpan) > this.maxPayloadSize) {\n // Payload size is too large even with an empty queue, can only drop\n const err = 'Zipkin span got dropped, reason: payload too large';\n if (this.errorListenerSet) {\n this.emit('error', new Error(err));\n } else {\n this.log.error(err);\n }\n return;\n }\n }\n this.queue.push(encodedSpan);\n this.queueBytes += encodedSpan.length;\n }\n\n public processQueue() {\n if (this.queue.length > 0) {\n this.client.mutate({ mutation: SEND_SPAN_MUTATION, variables: { queue: this.queue } });\n\n this.queue.length = 0;\n this.queueBytes = 0;\n }\n }\n}\n","import * as React from 'react';\nimport { compose } from 'redux';\nimport IdleTimer from 'react-idle-timer';\nimport { Subject, Observable, fromEvent, merge } from 'rxjs';\nimport { tracer } from '../graphql-tracer';\nimport { ActivityScheduler } from '../scheduler';\nimport { IActivityScheduler } from '../interfaces';\nimport { takeUntil, map, flatMap, debounceTime } from 'rxjs/operators';\n\nexport interface IActivityTrackerProps {\n stream: Subject<any>;\n}\n\n// export const ACTIVITY_DEBOUNCE = 10000;\nexport const ACTIVITY_DEBOUNCE = 900000;\n\nexport const styles = ({\n footer: ({\n bottom: 0,\n zIndex: '9999',\n width: '100%',\n display: 'flex',\n padding: '0 15px',\n position: 'fixed',\n background: '#fff',\n }),\n});\n\nexport class ActivityTrackerComponent extends React.Component<IActivityTrackerProps, any> {\n public span: any;\n public idle: any;\n public onIdle: any;\n public onActive: any;\n\n public stop$ = new Subject();\n public mouse$: Observable<any>;\n public activity$: Observable<any>;\n public state = { inactive: false };\n public scheduler: IActivityScheduler;\n\n public componentDidMount() {\n this.scheduler = new ActivityScheduler({});\n\n this.scheduler\n .tick$\n .pipe(\n takeUntil(this.stop$),\n map(() => this.scheduler.prepare('user-i', {})),\n flatMap(request => this.scheduler.collect(request)),\n ).subscribe(() => { /** todos */ });\n\n this.mouse$ = fromEvent(document, 'mousemove')\n .pipe(\n takeUntil(this.stop$),\n map(() => this.setState({ inactive: false })),\n );\n\n merge(\n this.mouse$,\n this.props.stream,\n ).pipe(\n takeUntil(this.stop$),\n debounceTime(ACTIVITY_DEBOUNCE),\n\n ).subscribe((data) => this.setState({ inactive: true }));\n }\n\n public componentWillUnmount() {\n this.stop$.next(-1);\n this.stop$.complete();\n\n if (this.span) {\n this.span.finish();\n delete this.span; // Delete span objct from component\n }\n }\n\n private _onActive() {\n this.idle.finish();\n }\n\n private _onIdle() {\n alert('Idle!');\n this.idle = (tracer as any).startSpan('idle', { childOf: this.span });\n this.idle.log({ type: 'ns' });\n }\n\n public render() {\n return (\n <React.Fragment>\n <IdleTimer\n timeout={5000}\n element={document}\n onIdle={this.onIdle}\n onActive={this.onActive}\n >\n {this.props.children}\n </IdleTimer>\n </React.Fragment>\n );\n }\n}\n\nexport const ActivityTracker: any = ActivityTrackerComponent;\n","import * as Logger from 'bunyan';\nimport { client } from './apollo-client';\nimport { ZipkinGraphqlLogger } from './classes/ZipkinGraphqlLogger';\n\nimport * as zipkin from 'zipkin';\nimport * as opentracing from 'opentracing';\nimport { HttpLogger } from 'zipkin-transport-http';\nimport ZipkinOpentracing from 'zipkin-javascript-opentracing';\n\nexport const tracer = new ZipkinOpentracing({\n ctxImpl: new zipkin.ExplicitContext(),\n recorder: new zipkin.BatchRecorder({\n logger: new ZipkinGraphqlLogger({\n client,\n }),\n }),\n kind: 'client',\n serviceName: 'frontend',\n sampler: new zipkin.sampler.CountingSampler(100),\n});\n","import * as React from 'react';\nimport { Subject } from 'rxjs';\nimport { Feature, IRouteData, IMenuPosition } from '@common-stack/client-react';\n\nconst stream = new Subject();\n\nimport { activity } from './activity-link';\nimport { ActivityTracker } from './components/ActivityTracker';\n\nexport default new Feature({\n link: activity(stream),\n rootComponentFactory: req => <ActivityTracker stream={stream} />,\n} as any);\n\n\n","import { Observable, interval } from 'rxjs';\nconst opentracing = require('opentracing');\n\nimport { IActivityScheduler, IActivityCollectRequest } from './interfaces';\n\nexport interface ISchedulerProps {\n interval?: number;\n}\n\nexport class ActivityScheduler implements IActivityScheduler {\n public interval: number;\n public tick$: Observable<number>;\n private client = opentracing.globalTracer();\n private span = this.client.startSpan('UserActivity');\n\n constructor(props: ISchedulerProps) {\n this.interval = props.interval || 10000;\n this.tick$ = interval(this.interval);\n }\n\n public prepare(user, payload = {}): IActivityCollectRequest {\n const ts = Date.now();\n return {\n user,\n scope: 'User',\n timestamp: ts,\n duration: this.interval,\n payload: JSON.stringify(payload),\n annotations: JSON.stringify([{\n timestamp: ts,\n value: `user=${user}`,\n }]),\n };\n }\n\n public async collect(request: IActivityCollectRequest): Promise<boolean> {\n try {\n const ok = await this.span.log(request);\n\n this.span.finish();\n this.span = this.client.startSpan('UserActivity');\n return true;\n } catch (e) {\n console.log('ERROR: ', { e, request });\n return false;\n }\n }\n}\n","module.exports = require(\"@apollo/client\");","module.exports = require(\"@apollo/client/cache\");","module.exports = require(\"@apollo/client/link/http\");","module.exports = require(\"@common-stack/client-react\");","module.exports = require(\"apollo-link-logger\");","module.exports = require(\"bunyan\");","module.exports = require(\"events\");","module.exports = require(\"graphql-tag\");","module.exports = require(\"opentracing\");","module.exports = require(\"react\");","module.exports = require(\"react-idle-timer\");","module.exports = require(\"rxjs\");","module.exports = require(\"rxjs/operators\");","module.exports = require(\"zipkin\");","module.exports = require(\"zipkin-javascript-opentracing\");","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","","// startup\n// Load entry module and return exports\n// This entry module is referenced by other modules so it can't be inlined\nvar __webpack_exports__ = __webpack_require__(\"./src/index.tsx\");\n",""],"names":[],"sourceRoot":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adminide-stack/user-activity-browser",
3
- "version": "0.0.20-alpha.98",
3
+ "version": "1.0.201-alpha.2",
4
4
  "description": "Sample core for higher packages to depend on",
5
5
  "license": "ISC",
6
6
  "author": "CDMBase LLC",
@@ -39,6 +39,8 @@
39
39
  },
40
40
  "dependencies": {
41
41
  "opentracing": "^0.14.3",
42
+ "react-idle-timer": "^4.0.9",
43
+ "zipkin": "^0.14.3",
42
44
  "zipkin-context-cls": "^0.14.2",
43
45
  "zipkin-javascript-opentracing": "^2.0.0",
44
46
  "zipkin-transport-http": "^0.14.3"
@@ -52,5 +54,5 @@
52
54
  "typescript": {
53
55
  "definition": "lib/index.d.ts"
54
56
  },
55
- "gitHead": "42a9a837bb3615273b3b87405a2f03061f351e92"
57
+ "gitHead": "7093502cc1c078eb5c86ce1531b891b546262e6e"
56
58
  }