@adminide-stack/user-activity-browser 0.0.20-alpha.95 → 1.0.201-alpha.1
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.
package/lib/activity-link.d.ts
CHANGED
package/lib/apollo-client.d.ts
CHANGED
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import { ApolloClient } from 'apollo
|
|
2
|
-
|
|
3
|
-
export declare const client: ApolloClient<NormalizedCacheObject>;
|
|
1
|
+
import { ApolloClient } from '@apollo/client';
|
|
2
|
+
export declare const client: ApolloClient<import("@apollo/client").NormalizedCacheObject>;
|
|
@@ -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<
|
|
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
|
@@ -98,8 +98,8 @@ module.exports =
|
|
|
98
98
|
|
|
99
99
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
100
100
|
exports.activity = void 0;
|
|
101
|
-
const
|
|
102
|
-
const activity = (subject) => new
|
|
101
|
+
const client_1 = __webpack_require__(/*! @apollo/client */ "@apollo/client");
|
|
102
|
+
const activity = (subject) => new client_1.ApolloLink((operation, forward) => {
|
|
103
103
|
subject.next(true);
|
|
104
104
|
return forward(operation);
|
|
105
105
|
});
|
|
@@ -122,17 +122,16 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
122
122
|
};
|
|
123
123
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
124
124
|
exports.client = void 0;
|
|
125
|
-
const
|
|
126
|
-
const
|
|
127
|
-
const apollo_client_1 = __webpack_require__(/*! apollo-client */ "apollo-client");
|
|
125
|
+
const http_1 = __webpack_require__(/*! @apollo/client/link/http */ "@apollo/client/link/http");
|
|
126
|
+
const client_1 = __webpack_require__(/*! @apollo/client */ "@apollo/client");
|
|
128
127
|
const apollo_link_logger_1 = __importDefault(__webpack_require__(/*! apollo-link-logger */ "apollo-link-logger"));
|
|
129
|
-
const
|
|
130
|
-
const cache = new
|
|
131
|
-
exports.client = new
|
|
128
|
+
const cache_1 = __webpack_require__(/*! @apollo/client/cache */ "@apollo/client/cache");
|
|
129
|
+
const cache = new cache_1.InMemoryCache();
|
|
130
|
+
exports.client = new client_1.ApolloClient({
|
|
132
131
|
cache,
|
|
133
|
-
link:
|
|
132
|
+
link: client_1.ApolloLink.from([
|
|
134
133
|
apollo_link_logger_1.default,
|
|
135
|
-
new
|
|
134
|
+
new http_1.HttpLink({ uri: `http://localhost:8081/graphql` }),
|
|
136
135
|
]),
|
|
137
136
|
});
|
|
138
137
|
|
|
@@ -284,10 +283,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
284
283
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
285
284
|
exports.ActivityTracker = exports.ActivityTrackerComponent = exports.styles = exports.ACTIVITY_DEBOUNCE = void 0;
|
|
286
285
|
const React = __importStar(__webpack_require__(/*! react */ "react"));
|
|
287
|
-
const redux_1 = __webpack_require__(/*! redux */ "redux");
|
|
288
286
|
const react_idle_timer_1 = __importDefault(__webpack_require__(/*! react-idle-timer */ "react-idle-timer"));
|
|
289
287
|
const rxjs_1 = __webpack_require__(/*! rxjs */ "rxjs");
|
|
290
|
-
const react_apollo_1 = __webpack_require__(/*! react-apollo */ "react-apollo");
|
|
291
288
|
const graphql_tracer_1 = __webpack_require__(/*! ../graphql-tracer */ "./src/graphql-tracer.ts");
|
|
292
289
|
const scheduler_1 = __webpack_require__(/*! ../scheduler */ "./src/scheduler.ts");
|
|
293
290
|
const operators_1 = __webpack_require__(/*! rxjs/operators */ "rxjs/operators");
|
|
@@ -341,7 +338,7 @@ class ActivityTrackerComponent extends React.Component {
|
|
|
341
338
|
}
|
|
342
339
|
}
|
|
343
340
|
exports.ActivityTrackerComponent = ActivityTrackerComponent;
|
|
344
|
-
exports.ActivityTracker =
|
|
341
|
+
exports.ActivityTracker = ActivityTrackerComponent;
|
|
345
342
|
|
|
346
343
|
|
|
347
344
|
/***/ }),
|
|
@@ -493,58 +490,47 @@ exports.ActivityScheduler = ActivityScheduler;
|
|
|
493
490
|
|
|
494
491
|
/***/ }),
|
|
495
492
|
|
|
496
|
-
/***/ "@
|
|
497
|
-
|
|
498
|
-
!*** external "@
|
|
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
|
-
\****************************************/
|
|
493
|
+
/***/ "@apollo/client":
|
|
494
|
+
/*!*********************************!*\
|
|
495
|
+
!*** external "@apollo/client" ***!
|
|
496
|
+
\*********************************/
|
|
511
497
|
/*! no static exports found */
|
|
512
498
|
/***/ (function(module, exports) {
|
|
513
499
|
|
|
514
|
-
module.exports = require("apollo
|
|
500
|
+
module.exports = require("@apollo/client");
|
|
515
501
|
|
|
516
502
|
/***/ }),
|
|
517
503
|
|
|
518
|
-
/***/ "apollo
|
|
519
|
-
|
|
520
|
-
!*** external "apollo
|
|
521
|
-
|
|
504
|
+
/***/ "@apollo/client/cache":
|
|
505
|
+
/*!***************************************!*\
|
|
506
|
+
!*** external "@apollo/client/cache" ***!
|
|
507
|
+
\***************************************/
|
|
522
508
|
/*! no static exports found */
|
|
523
509
|
/***/ (function(module, exports) {
|
|
524
510
|
|
|
525
|
-
module.exports = require("apollo
|
|
511
|
+
module.exports = require("@apollo/client/cache");
|
|
526
512
|
|
|
527
513
|
/***/ }),
|
|
528
514
|
|
|
529
|
-
/***/ "apollo
|
|
530
|
-
|
|
531
|
-
!*** external "apollo
|
|
532
|
-
|
|
515
|
+
/***/ "@apollo/client/link/http":
|
|
516
|
+
/*!*******************************************!*\
|
|
517
|
+
!*** external "@apollo/client/link/http" ***!
|
|
518
|
+
\*******************************************/
|
|
533
519
|
/*! no static exports found */
|
|
534
520
|
/***/ (function(module, exports) {
|
|
535
521
|
|
|
536
|
-
module.exports = require("apollo
|
|
522
|
+
module.exports = require("@apollo/client/link/http");
|
|
537
523
|
|
|
538
524
|
/***/ }),
|
|
539
525
|
|
|
540
|
-
/***/ "
|
|
541
|
-
|
|
542
|
-
!*** external "
|
|
543
|
-
|
|
526
|
+
/***/ "@common-stack/client-react":
|
|
527
|
+
/*!*********************************************!*\
|
|
528
|
+
!*** external "@common-stack/client-react" ***!
|
|
529
|
+
\*********************************************/
|
|
544
530
|
/*! no static exports found */
|
|
545
531
|
/***/ (function(module, exports) {
|
|
546
532
|
|
|
547
|
-
module.exports = require("
|
|
533
|
+
module.exports = require("@common-stack/client-react");
|
|
548
534
|
|
|
549
535
|
/***/ }),
|
|
550
536
|
|
|
@@ -614,17 +600,6 @@ module.exports = require("react");
|
|
|
614
600
|
|
|
615
601
|
/***/ }),
|
|
616
602
|
|
|
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
603
|
/***/ "react-idle-timer":
|
|
629
604
|
/*!***********************************!*\
|
|
630
605
|
!*** external "react-idle-timer" ***!
|
|
@@ -636,17 +611,6 @@ module.exports = require("react-idle-timer");
|
|
|
636
611
|
|
|
637
612
|
/***/ }),
|
|
638
613
|
|
|
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
614
|
/***/ "rxjs":
|
|
651
615
|
/*!***********************!*\
|
|
652
616
|
!*** external "rxjs" ***!
|
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,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;;;;;;;;;;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,"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 \"@apollo/client\"","webpack:///external \"@apollo/client/cache\"","webpack:///external \"@apollo/client/link/http\"","webpack:///external \"@common-stack/client-react\"","webpack:///external \"apollo-link-logger\"","webpack:///external \"bunyan\"","webpack:///external \"events\"","webpack:///external \"graphql-tag\"","webpack:///external \"opentracing\"","webpack:///external \"react\"","webpack:///external \"react-idle-timer\"","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,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,IA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,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,2C;;;;;;;;;;;ACAA,iD;;;;;;;;;;;ACAA,qD;;;;;;;;;;;ACAA,uD;;;;;;;;;;;ACAA,+C;;;;;;;;;;;ACAA,mC;;;;;;;;;;;ACAA,mC;;;;;;;;;;;ACAA,wC;;;;;;;;;;;ACAA,wC;;;;;;;;;;;ACAA,kC;;;;;;;;;;;ACAA,6C;;;;;;;;;;;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/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\");"],"sourceRoot":""}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adminide-stack/user-activity-browser",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "1.0.201-alpha.1",
|
|
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": "
|
|
57
|
+
"gitHead": "4b11109d693f136ade37adf10cd4f69d0b76c35d"
|
|
56
58
|
}
|