@rtsee/events-dashboard 0.0.48
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/dist/events-dashboard/src/index.d.ts +3 -0
- package/dist/events-dashboard/src/index.d.ts.map +1 -0
- package/dist/events-dashboard/src/index.js +19 -0
- package/dist/events-dashboard/src/index.js.map +1 -0
- package/dist/events-dashboard/src/interfaces/EventsCollectorOptions.d.ts +3 -0
- package/dist/events-dashboard/src/interfaces/EventsCollectorOptions.d.ts.map +1 -0
- package/dist/events-dashboard/src/interfaces/EventsCollectorOptions.js +3 -0
- package/dist/events-dashboard/src/interfaces/EventsCollectorOptions.js.map +1 -0
- package/dist/events-dashboard/src/interfaces/index.d.ts +2 -0
- package/dist/events-dashboard/src/interfaces/index.d.ts.map +1 -0
- package/dist/events-dashboard/src/interfaces/index.js +18 -0
- package/dist/events-dashboard/src/interfaces/index.js.map +1 -0
- package/dist/events-dashboard/src/models/DashboardClient.d.ts +23 -0
- package/dist/events-dashboard/src/models/DashboardClient.d.ts.map +1 -0
- package/dist/events-dashboard/src/models/DashboardClient.js +70 -0
- package/dist/events-dashboard/src/models/DashboardClient.js.map +1 -0
- package/dist/events-dashboard/src/models/DashboardClientSession.d.ts +23 -0
- package/dist/events-dashboard/src/models/DashboardClientSession.d.ts.map +1 -0
- package/dist/events-dashboard/src/models/DashboardClientSession.js +59 -0
- package/dist/events-dashboard/src/models/DashboardClientSession.js.map +1 -0
- package/dist/events-dashboard/src/models/DashboardEvent.d.ts +11 -0
- package/dist/events-dashboard/src/models/DashboardEvent.d.ts.map +1 -0
- package/dist/events-dashboard/src/models/DashboardEvent.js +19 -0
- package/dist/events-dashboard/src/models/DashboardEvent.js.map +1 -0
- package/dist/events-dashboard/src/models/EventsCollector.d.ts +12 -0
- package/dist/events-dashboard/src/models/EventsCollector.d.ts.map +1 -0
- package/dist/events-dashboard/src/models/EventsCollector.js +50 -0
- package/dist/events-dashboard/src/models/EventsCollector.js.map +1 -0
- package/dist/events-dashboard/src/models/EventsDashboard.d.ts +27 -0
- package/dist/events-dashboard/src/models/EventsDashboard.d.ts.map +1 -0
- package/dist/events-dashboard/src/models/EventsDashboard.js +167 -0
- package/dist/events-dashboard/src/models/EventsDashboard.js.map +1 -0
- package/dist/events-dashboard/src/models/SessionAgent.d.ts +26 -0
- package/dist/events-dashboard/src/models/SessionAgent.d.ts.map +1 -0
- package/dist/events-dashboard/src/models/SessionAgent.js +118 -0
- package/dist/events-dashboard/src/models/SessionAgent.js.map +1 -0
- package/dist/events-dashboard/src/models/index.d.ts +7 -0
- package/dist/events-dashboard/src/models/index.d.ts.map +1 -0
- package/dist/events-dashboard/src/models/index.js +23 -0
- package/dist/events-dashboard/src/models/index.js.map +1 -0
- package/package.json +52 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./models"), exports);
|
|
18
|
+
__exportStar(require("./interfaces"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,+CAA6B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EventsCollectorOptions.d.ts","sourceRoot":"","sources":["../../../../src/interfaces/EventsCollectorOptions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEhD,MAAM,MAAM,4BAA4B,GAAG,iBAAiB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EventsCollectorOptions.js","sourceRoot":"","sources":["../../../../src/interfaces/EventsCollectorOptions.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/interfaces/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./EventsCollectorOptions"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/interfaces/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2DAAyC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { IRTSeeDashboardClient, IRTSeeDashboardClientSessionOptions, IRTSeeDashboardEvent } from "@rtsee/common";
|
|
2
|
+
import { RTSeeDashboardClientSession } from "@rtsee/events-dashboard";
|
|
3
|
+
export declare class RTSeeDashboardClient {
|
|
4
|
+
id: string;
|
|
5
|
+
name?: string;
|
|
6
|
+
imageUrl?: string;
|
|
7
|
+
url?: string;
|
|
8
|
+
isAnonymous: boolean;
|
|
9
|
+
sessions: RTSeeDashboardClientSession[];
|
|
10
|
+
connectedAt: Date;
|
|
11
|
+
isConnected: boolean;
|
|
12
|
+
constructor(clientData: IRTSeeDashboardClient);
|
|
13
|
+
init(clientData: IRTSeeDashboardClient): void;
|
|
14
|
+
addEvent(eventData: IRTSeeDashboardEvent): void;
|
|
15
|
+
populateSessions(sessions: IRTSeeDashboardClientSessionOptions[]): void;
|
|
16
|
+
addSession(sessionData: IRTSeeDashboardClientSessionOptions): void;
|
|
17
|
+
removeSessionById(id: string): void;
|
|
18
|
+
getSessionById(id: string): RTSeeDashboardClientSession | null;
|
|
19
|
+
onDisconnected(): void;
|
|
20
|
+
merge(clientData: IRTSeeDashboardClient): void;
|
|
21
|
+
sortClients(): void;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=DashboardClient.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DashboardClient.d.ts","sourceRoot":"","sources":["../../../../src/models/DashboardClient.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,mCAAmC,EACnC,oBAAoB,EACrB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,2BAA2B,EAAE,MAAM,yBAAyB,CAAC;AAEtE,qBAAa,oBAAoB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,WAAW,UAAS;IACpB,QAAQ,EAAE,2BAA2B,EAAE,CAAM;IAC7C,WAAW,EAAE,IAAI,CAAC;IAClB,WAAW,EAAE,OAAO,CAAC;gBAET,UAAU,EAAE,qBAAqB;IAK7C,IAAI,CAAC,UAAU,EAAE,qBAAqB;IAkBtC,QAAQ,CAAC,SAAS,EAAE,oBAAoB;IAQxC,gBAAgB,CAAC,QAAQ,EAAE,mCAAmC,EAAE;IAIhE,UAAU,CAAC,WAAW,EAAE,mCAAmC;IAK3D,iBAAiB,CAAC,EAAE,EAAE,MAAM;IAS5B,cAAc,CAAC,EAAE,EAAE,MAAM,GAAG,2BAA2B,GAAG,IAAI;IAI9D,cAAc;IAId,KAAK,CAAC,UAAU,EAAE,qBAAqB;IAKvC,WAAW;CAKZ"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RTSeeDashboardClient = void 0;
|
|
4
|
+
var events_dashboard_1 = require("@rtsee/events-dashboard");
|
|
5
|
+
var RTSeeDashboardClient = /** @class */ (function () {
|
|
6
|
+
function RTSeeDashboardClient(clientData) {
|
|
7
|
+
this.isAnonymous = false;
|
|
8
|
+
this.sessions = [];
|
|
9
|
+
this.id = clientData.id;
|
|
10
|
+
this.init(clientData);
|
|
11
|
+
}
|
|
12
|
+
RTSeeDashboardClient.prototype.init = function (clientData) {
|
|
13
|
+
if (clientData.name) {
|
|
14
|
+
this.name = clientData.name;
|
|
15
|
+
}
|
|
16
|
+
if (clientData.imageUrl) {
|
|
17
|
+
this.imageUrl = clientData.imageUrl;
|
|
18
|
+
}
|
|
19
|
+
if (clientData.url) {
|
|
20
|
+
this.url = clientData.url;
|
|
21
|
+
}
|
|
22
|
+
if (clientData.isAnonymous) {
|
|
23
|
+
this.isAnonymous = clientData.isAnonymous;
|
|
24
|
+
}
|
|
25
|
+
this.connectedAt = clientData.connectedAt;
|
|
26
|
+
this.populateSessions(clientData.sessions);
|
|
27
|
+
this.isConnected = true;
|
|
28
|
+
};
|
|
29
|
+
RTSeeDashboardClient.prototype.addEvent = function (eventData) {
|
|
30
|
+
var session = this.getSessionById(eventData.sessionId);
|
|
31
|
+
if (!session) {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
session.addEvent(eventData);
|
|
35
|
+
};
|
|
36
|
+
RTSeeDashboardClient.prototype.populateSessions = function (sessions) {
|
|
37
|
+
var _this = this;
|
|
38
|
+
sessions.forEach(function (elem) { return _this.addSession(elem); });
|
|
39
|
+
};
|
|
40
|
+
RTSeeDashboardClient.prototype.addSession = function (sessionData) {
|
|
41
|
+
var session = new events_dashboard_1.RTSeeDashboardClientSession(sessionData);
|
|
42
|
+
this.sessions.unshift(session);
|
|
43
|
+
};
|
|
44
|
+
RTSeeDashboardClient.prototype.removeSessionById = function (id) {
|
|
45
|
+
var session = this.getSessionById(id);
|
|
46
|
+
if (!session) {
|
|
47
|
+
console.log("No session with id: ", id);
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
session.onDisconnected();
|
|
51
|
+
};
|
|
52
|
+
RTSeeDashboardClient.prototype.getSessionById = function (id) {
|
|
53
|
+
return this.sessions.find(function (e) { return e.id === id; });
|
|
54
|
+
};
|
|
55
|
+
RTSeeDashboardClient.prototype.onDisconnected = function () {
|
|
56
|
+
this.isConnected = false;
|
|
57
|
+
};
|
|
58
|
+
RTSeeDashboardClient.prototype.merge = function (clientData) {
|
|
59
|
+
this.init(clientData);
|
|
60
|
+
this.sortClients();
|
|
61
|
+
};
|
|
62
|
+
RTSeeDashboardClient.prototype.sortClients = function () {
|
|
63
|
+
this.sessions.sort(function (a, b) {
|
|
64
|
+
return a.connectedAt > b.connectedAt ? -1 : 1;
|
|
65
|
+
});
|
|
66
|
+
};
|
|
67
|
+
return RTSeeDashboardClient;
|
|
68
|
+
}());
|
|
69
|
+
exports.RTSeeDashboardClient = RTSeeDashboardClient;
|
|
70
|
+
//# sourceMappingURL=DashboardClient.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DashboardClient.js","sourceRoot":"","sources":["../../../../src/models/DashboardClient.ts"],"names":[],"mappings":";;;AAKA,4DAAsE;AAEtE;IAUE,8BAAY,UAAiC;QAL7C,gBAAW,GAAG,KAAK,CAAC;QACpB,aAAQ,GAAkC,EAAE,CAAC;QAK3C,IAAI,CAAC,EAAE,GAAG,UAAU,CAAC,EAAE,CAAC;QACxB,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IACxB,CAAC;IAED,mCAAI,GAAJ,UAAK,UAAiC;QACpC,IAAI,UAAU,CAAC,IAAI,EAAE;YACnB,IAAI,CAAC,IAAI,GAAG,UAAU,CAAC,IAAI,CAAC;SAC7B;QACD,IAAI,UAAU,CAAC,QAAQ,EAAE;YACvB,IAAI,CAAC,QAAQ,GAAG,UAAU,CAAC,QAAQ,CAAC;SACrC;QACD,IAAI,UAAU,CAAC,GAAG,EAAE;YAClB,IAAI,CAAC,GAAG,GAAG,UAAU,CAAC,GAAG,CAAC;SAC3B;QACD,IAAI,UAAU,CAAC,WAAW,EAAE;YAC1B,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC,WAAW,CAAC;SAC3C;QACD,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC,WAAW,CAAC;QAC1C,IAAI,CAAC,gBAAgB,CAAC,UAAU,CAAC,QAAQ,CAAC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EAAE,CAAC;IACrB,CAAC;IAED,0CAAW,GAAX;QACE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,UAAC,CAAC,EAAE,CAAC;YACtB,OAAO,CAAC,CAAC,WAAW,GAAG,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAChD,CAAC,CAAC,CAAC;IACL,CAAC;IACH,2BAAC;AAAD,CAAC,AA7ED,IA6EC;AA7EY,oDAAoB"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { RTSeeDashboardEvent } from "./DashboardEvent";
|
|
2
|
+
import { IDeviceDetectionResult, IRTSeeDashboardClientSessionOptions, IRTSeeDashboardEvent } from "@rtsee/common";
|
|
3
|
+
import { IRTSeeSessionInfo, RTSeeSessionAgent } from "@rtsee/events-dashboard";
|
|
4
|
+
export declare class RTSeeDashboardClientSession {
|
|
5
|
+
id: string;
|
|
6
|
+
events: RTSeeDashboardEvent[];
|
|
7
|
+
connectedAt: Date;
|
|
8
|
+
isConnected: boolean;
|
|
9
|
+
agent?: RTSeeSessionAgent;
|
|
10
|
+
isActive?: boolean;
|
|
11
|
+
clientId: string;
|
|
12
|
+
info?: IRTSeeSessionInfo;
|
|
13
|
+
constructor(clientData: IRTSeeDashboardClientSessionOptions);
|
|
14
|
+
init(clientData: IRTSeeDashboardClientSessionOptions): void;
|
|
15
|
+
populateData(options: IRTSeeDashboardClientSessionOptions): void;
|
|
16
|
+
populateEvents(events: IRTSeeDashboardEvent[]): void;
|
|
17
|
+
addEvent<T>(event: IRTSeeDashboardEvent<T>): RTSeeDashboardEvent<T>;
|
|
18
|
+
merge(sessionData: IRTSeeDashboardClientSessionOptions): void;
|
|
19
|
+
onDisconnected(): void;
|
|
20
|
+
setAgent(agent: IDeviceDetectionResult): void;
|
|
21
|
+
private sortEvents;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=DashboardClientSession.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DashboardClientSession.d.ts","sourceRoot":"","sources":["../../../../src/models/DashboardClientSession.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EACL,sBAAsB,EACtB,mCAAmC,EACnC,oBAAoB,EACrB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAE/E,qBAAa,2BAA2B;IACtC,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,mBAAmB,EAAE,CAAM;IACnC,WAAW,EAAE,IAAI,CAAC;IAClB,WAAW,EAAE,OAAO,CAAC;IACrB,KAAK,CAAC,EAAE,iBAAiB,CAAC;IAC1B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,iBAAiB,CAAC;gBAEb,UAAU,EAAE,mCAAmC;IAK3D,IAAI,CAAC,UAAU,EAAE,mCAAmC;IAQpD,YAAY,CAAC,OAAO,EAAE,mCAAmC;IASzD,cAAc,CAAC,MAAM,EAAE,oBAAoB,EAAE;IAI7C,QAAQ,CAAC,CAAC,EAAE,KAAK,EAAE,oBAAoB,CAAC,CAAC,CAAC;IAU1C,KAAK,CAAC,WAAW,EAAE,mCAAmC;IAKtD,cAAc;IAId,QAAQ,CAAC,KAAK,EAAE,sBAAsB;IAKtC,OAAO,CAAC,UAAU;CAKnB"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RTSeeDashboardClientSession = void 0;
|
|
4
|
+
var DashboardEvent_1 = require("./DashboardEvent");
|
|
5
|
+
var events_dashboard_1 = require("@rtsee/events-dashboard");
|
|
6
|
+
var RTSeeDashboardClientSession = /** @class */ (function () {
|
|
7
|
+
function RTSeeDashboardClientSession(clientData) {
|
|
8
|
+
this.events = [];
|
|
9
|
+
this.id = clientData.id;
|
|
10
|
+
this.init(clientData);
|
|
11
|
+
}
|
|
12
|
+
RTSeeDashboardClientSession.prototype.init = function (clientData) {
|
|
13
|
+
this.clientId = clientData.clientId;
|
|
14
|
+
this.populateData(clientData);
|
|
15
|
+
this.connectedAt = clientData.connectedAt;
|
|
16
|
+
this.populateEvents(clientData.events);
|
|
17
|
+
this.isConnected = true;
|
|
18
|
+
};
|
|
19
|
+
RTSeeDashboardClientSession.prototype.populateData = function (options) {
|
|
20
|
+
if (options.agent) {
|
|
21
|
+
this.setAgent(options.agent);
|
|
22
|
+
}
|
|
23
|
+
if (options.isActive) {
|
|
24
|
+
this.isActive = options.isActive;
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
RTSeeDashboardClientSession.prototype.populateEvents = function (events) {
|
|
28
|
+
var _this = this;
|
|
29
|
+
events.forEach(function (elem) { return _this.addEvent(elem); });
|
|
30
|
+
};
|
|
31
|
+
RTSeeDashboardClientSession.prototype.addEvent = function (event) {
|
|
32
|
+
var existingEvent = this.events.find(function (e) { return e.id === event.id; });
|
|
33
|
+
if (existingEvent) {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
var newEvent = new DashboardEvent_1.RTSeeDashboardEvent(event);
|
|
37
|
+
this.events.unshift(newEvent);
|
|
38
|
+
return newEvent;
|
|
39
|
+
};
|
|
40
|
+
RTSeeDashboardClientSession.prototype.merge = function (sessionData) {
|
|
41
|
+
this.init(sessionData);
|
|
42
|
+
this.sortEvents();
|
|
43
|
+
};
|
|
44
|
+
RTSeeDashboardClientSession.prototype.onDisconnected = function () {
|
|
45
|
+
this.isConnected = false;
|
|
46
|
+
};
|
|
47
|
+
RTSeeDashboardClientSession.prototype.setAgent = function (agent) {
|
|
48
|
+
this.agent = new events_dashboard_1.RTSeeSessionAgent(agent);
|
|
49
|
+
this.info = this.agent.getSessionInfo();
|
|
50
|
+
};
|
|
51
|
+
RTSeeDashboardClientSession.prototype.sortEvents = function () {
|
|
52
|
+
this.events.sort(function (a, b) {
|
|
53
|
+
return a.createdAt > b.createdAt ? -1 : 1;
|
|
54
|
+
});
|
|
55
|
+
};
|
|
56
|
+
return RTSeeDashboardClientSession;
|
|
57
|
+
}());
|
|
58
|
+
exports.RTSeeDashboardClientSession = RTSeeDashboardClientSession;
|
|
59
|
+
//# sourceMappingURL=DashboardClientSession.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DashboardClientSession.js","sourceRoot":"","sources":["../../../../src/models/DashboardClientSession.ts"],"names":[],"mappings":";;;AAAA,mDAAuD;AAMvD,4DAA+E;AAE/E;IAUE,qCAAY,UAA+C;QAR3D,WAAM,GAA0B,EAAE,CAAC;QASjC,IAAI,CAAC,EAAE,GAAG,UAAU,CAAC,EAAE,CAAC;QACxB,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IACxB,CAAC;IAED,0CAAI,GAAJ,UAAK,UAA+C;QAClD,IAAI,CAAC,QAAQ,GAAG,UAAU,CAAC,QAAQ,CAAC;QACpC,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;QAC9B,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC,WAAW,CAAC;QAC1C,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;QACvC,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;IAC1B,CAAC;IAED,kDAAY,GAAZ,UAAa,OAA4C;QACvD,IAAI,OAAO,CAAC,KAAK,EAAE;YACjB,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;SAC9B;QACD,IAAI,OAAO,CAAC,QAAQ,EAAE;YACpB,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;SAClC;IACH,CAAC;IAED,oDAAc,GAAd,UAAe,MAA8B;QAA7C,iBAEC;QADC,MAAM,CAAC,OAAO,CAAC,UAAC,IAAI,I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|
+
export declare class RTSeeDashboardEvent<T = any> {
|
|
3
|
+
id: string;
|
|
4
|
+
sessionId: string;
|
|
5
|
+
name: string;
|
|
6
|
+
widget?: string;
|
|
7
|
+
data?: T;
|
|
8
|
+
createdAt: Date;
|
|
9
|
+
constructor(options: IRTSeeDashboardEvent<T>);
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=DashboardEvent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DashboardEvent.d.ts","sourceRoot":"","sources":["../../../../src/models/DashboardEvent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAErD,qBAAa,mBAAmB,CAAC,CAAC,GAAG,GAAG;IACtC,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,CAAC,CAAC;IACT,SAAS,EAAE,IAAI,CAAC;gBAEJ,OAAO,EAAE,oBAAoB,CAAC,CAAC,CAAC;CAY7C"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RTSeeDashboardEvent = void 0;
|
|
4
|
+
var RTSeeDashboardEvent = /** @class */ (function () {
|
|
5
|
+
function RTSeeDashboardEvent(options) {
|
|
6
|
+
this.name = options.name;
|
|
7
|
+
this.createdAt = options.createdAt;
|
|
8
|
+
this.sessionId = options.sessionId;
|
|
9
|
+
if (options.id) {
|
|
10
|
+
this.id = options.id;
|
|
11
|
+
}
|
|
12
|
+
if (options.data) {
|
|
13
|
+
this.data = options.data;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
return RTSeeDashboardEvent;
|
|
17
|
+
}());
|
|
18
|
+
exports.RTSeeDashboardEvent = RTSeeDashboardEvent;
|
|
19
|
+
//# sourceMappingURL=DashboardEvent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DashboardEvent.js","sourceRoot":"","sources":["../../../../src/models/DashboardEvent.ts"],"names":[],"mappings":";;;AAEA;IAQE,6BAAY,OAAgC;QAC1C,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;QACzB,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC;QACnC,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC;QAEnC,IAAI,OAAO,CAAC,EAAE,EAAE;YACd,IAAI,CAAC,EAAE,GAAG,OAAO,CAAC,EAAE,CAAC;SACtB;QACD,IAAI,OAAO,CAAC,IAAI,EAAE;YAChB,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;SAC1B;IACH,CAAC;IACH,0BAAC;AAAD,CAAC,AApBD,IAoBC;AApBY,kDAAmB"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { RTSeeCore } from "@rtsee/core";
|
|
2
|
+
import { IRTSeeEventsManagerSignalingClient, IRTSeeDashboardEvent } from "@rtsee/common";
|
|
3
|
+
import { IRTSeeEventsCollectorOptions } from "@rtsee/events-dashboard";
|
|
4
|
+
export declare class EventsCollector extends RTSeeCore {
|
|
5
|
+
signalingClient: IRTSeeEventsManagerSignalingClient;
|
|
6
|
+
sessionId?: string;
|
|
7
|
+
constructor(options: IRTSeeEventsCollectorOptions);
|
|
8
|
+
onReady(): void;
|
|
9
|
+
ownSessionStarted(sessionId: string): void;
|
|
10
|
+
send(event: Omit<IRTSeeDashboardEvent, "sessionId">): void;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=EventsCollector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EventsCollector.d.ts","sourceRoot":"","sources":["../../../../src/models/EventsCollector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EACL,kCAAkC,EAClC,oBAAoB,EAErB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,4BAA4B,EAAE,MAAM,yBAAyB,CAAC;AAEvE,qBAAa,eAAgB,SAAQ,SAAS;IAC5C,eAAe,EAAE,kCAAkC,CAAC;IACpD,SAAS,CAAC,EAAE,MAAM,CAAC;gBAEP,OAAO,EAAE,4BAA4B;IAQjD,OAAO;IAEP,iBAAiB,CAAC,SAAS,EAAE,MAAM;IAanC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,oBAAoB,EAAE,WAAW,CAAC;CAGpD"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.EventsCollector = void 0;
|
|
19
|
+
var core_1 = require("@rtsee/core");
|
|
20
|
+
var common_1 = require("@rtsee/common");
|
|
21
|
+
var EventsCollector = /** @class */ (function (_super) {
|
|
22
|
+
__extends(EventsCollector, _super);
|
|
23
|
+
function EventsCollector(options) {
|
|
24
|
+
var _this = _super.call(this, options) || this;
|
|
25
|
+
_this.signalingClient.connect({
|
|
26
|
+
eventsCollector: _this,
|
|
27
|
+
});
|
|
28
|
+
return _this;
|
|
29
|
+
}
|
|
30
|
+
EventsCollector.prototype.onReady = function () { };
|
|
31
|
+
EventsCollector.prototype.ownSessionStarted = function (sessionId) {
|
|
32
|
+
var _a;
|
|
33
|
+
this.sessionId = sessionId;
|
|
34
|
+
if ((_a = window === null || window === void 0 ? void 0 : window.navigator) === null || _a === void 0 ? void 0 : _a.userAgent) {
|
|
35
|
+
this.send({
|
|
36
|
+
name: common_1.RTSeeEventsManagerMessages.USER_AGENT,
|
|
37
|
+
data: {
|
|
38
|
+
agent: window.navigator.userAgent,
|
|
39
|
+
},
|
|
40
|
+
createdAt: new Date(),
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
EventsCollector.prototype.send = function (event) {
|
|
45
|
+
this.signalingClient.sendMessage(event);
|
|
46
|
+
};
|
|
47
|
+
return EventsCollector;
|
|
48
|
+
}(core_1.RTSeeCore));
|
|
49
|
+
exports.EventsCollector = EventsCollector;
|
|
50
|
+
//# sourceMappingURL=EventsCollector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EventsCollector.js","sourceRoot":"","sources":["../../../../src/models/EventsCollector.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,oCAAwC;AACxC,wCAIuB;AAGvB;IAAqC,mCAAS;IAI5C,yBAAY,OAAqC;QAAjD,YACE,kBAAM,OAAO,CAAC,SAKf;QAHC,KAAI,CAAC,eAAe,CAAC,OAAO,CAAC;YAC3B,eAAe,EAAE,KAAI;SACtB,CAAC,CAAC;;IACL,CAAC;IAED,iCAAO,GAAP,cAAW,CAAC;IAEZ,2CAAiB,GAAjB,UAAkB,SAAiB;;QACjC,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,SAAS,0CAAE,SAAS,EAAE;YAChC,IAAI,CAAC,IAAI,CAAC;gBACR,IAAI,EAAE,mCAA0B,CAAC,UAAU;gBAC3C,IAAI,EAAE;oBACJ,KAAK,EAAE,MAAM,CAAC,SAAS,CAAC,SAAS;iBAClC;gBACD,SAAS,EAAE,IAAI,IAAI,EAAE;aACtB,CAAC,CAAC;SACJ;IACH,CAAC;IAED,8BAAI,GAAJ,UAAK,KAA8C;QACjD,IAAI,CAAC,eAAe,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;IAC1C,CAAC;IACH,sBAAC;AAAD,CAAC,AA9BD,CAAqC,gBAAS,GA8B7C;AA9BY,0CAAe"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { RTSeeCore, IRTSeeMessenger, IRTSeeConference } from "@rtsee/core";
|
|
2
|
+
import { IRTSeeDashboardClient, IRTSeeDashboardClientSessionOptions, IRTSeeDashboardEvent, IRTSeeEventsDashboardOptions, IRTSeeEventsManagerSignalingClient } from "@rtsee/common";
|
|
3
|
+
import { RTSeeDashboardClientSession, RTSeeDashboardClient } from "@rtsee/events-dashboard";
|
|
4
|
+
export declare class RTSeeEventsDashboard extends RTSeeCore {
|
|
5
|
+
token: string;
|
|
6
|
+
clients: RTSeeDashboardClient[];
|
|
7
|
+
signalingClient: IRTSeeEventsManagerSignalingClient;
|
|
8
|
+
rtSee?: IRTSeeConference;
|
|
9
|
+
messenger?: IRTSeeMessenger;
|
|
10
|
+
isReady: boolean;
|
|
11
|
+
constructor(options: IRTSeeEventsDashboardOptions);
|
|
12
|
+
onReady(): void;
|
|
13
|
+
connectSignalingClient(): void;
|
|
14
|
+
populate(clients: IRTSeeDashboardClient[]): void;
|
|
15
|
+
addClient(clientData: IRTSeeDashboardClient): void;
|
|
16
|
+
removeClient(clientData: RTSeeDashboardClient): void;
|
|
17
|
+
addSession(sessionData: IRTSeeDashboardClientSessionOptions): void;
|
|
18
|
+
removeSessionById(clientId: string, sessionId: string): void;
|
|
19
|
+
getSession(clientId: string, sessionId: string): RTSeeDashboardClientSession | null;
|
|
20
|
+
removeClientById(id: string): void;
|
|
21
|
+
getClientById(id: string): RTSeeDashboardClient | null;
|
|
22
|
+
processIncomingEvent<T>(clientId: string, event: IRTSeeDashboardEvent<T>): void;
|
|
23
|
+
setSessionsData(sessionData: IRTSeeDashboardClientSessionOptions): void;
|
|
24
|
+
openChat(client: RTSeeDashboardClient): void;
|
|
25
|
+
private sortClients;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=EventsDashboard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EventsDashboard.d.ts","sourceRoot":"","sources":["../../../../src/models/EventsDashboard.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC3E,OAAO,EACL,qBAAqB,EACrB,mCAAmC,EACnC,oBAAoB,EACpB,4BAA4B,EAC5B,kCAAkC,EAEnC,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,2BAA2B,EAC3B,oBAAoB,EACrB,MAAM,yBAAyB,CAAC;AAEjC,qBAAa,oBAAqB,SAAQ,SAAS;IACjD,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,oBAAoB,EAAE,CAAM;IACrC,eAAe,EAAE,kCAAkC,CAAC;IACpD,KAAK,CAAC,EAAE,gBAAgB,CAAC;IACzB,SAAS,CAAC,EAAE,eAAe,CAAC;IAC5B,OAAO,UAAS;gBAEJ,OAAO,EAAE,4BAA4B;IAgBjD,OAAO;IAUP,sBAAsB;IAItB,QAAQ,CAAC,OAAO,EAAE,qBAAqB,EAAE;IAIzC,SAAS,CAAC,UAAU,EAAE,qBAAqB;IAe3C,YAAY,CAAC,UAAU,EAAE,oBAAoB;IAY7C,UAAU,CAAC,WAAW,EAAE,mCAAmC;IAc3D,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM;IASrD,UAAU,CACR,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,GAChB,2BAA2B,GAAG,IAAI;IASrC,gBAAgB,CAAC,EAAE,EAAE,MAAM;IAK3B,aAAa,CAAC,EAAE,EAAE,MAAM,GAAG,oBAAoB,GAAG,IAAI;IAItD,oBAAoB,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,oBAAoB,CAAC,CAAC,CAAC;IAYxE,eAAe,CAAC,WAAW,EAAE,mCAAmC;IAShE,QAAQ,CAAC,MAAM,EAAE,oBAAoB;IAQrC,OAAO,CAAC,WAAW;CASpB"}
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
var __assign = (this && this.__assign) || function () {
|
|
18
|
+
__assign = Object.assign || function(t) {
|
|
19
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
20
|
+
s = arguments[i];
|
|
21
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
22
|
+
t[p] = s[p];
|
|
23
|
+
}
|
|
24
|
+
return t;
|
|
25
|
+
};
|
|
26
|
+
return __assign.apply(this, arguments);
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.RTSeeEventsDashboard = void 0;
|
|
30
|
+
var core_1 = require("@rtsee/core");
|
|
31
|
+
var common_1 = require("@rtsee/common");
|
|
32
|
+
var events_dashboard_1 = require("@rtsee/events-dashboard");
|
|
33
|
+
var RTSeeEventsDashboard = /** @class */ (function (_super) {
|
|
34
|
+
__extends(RTSeeEventsDashboard, _super);
|
|
35
|
+
function RTSeeEventsDashboard(options) {
|
|
36
|
+
var _this = _super.call(this, options) || this;
|
|
37
|
+
_this.clients = [];
|
|
38
|
+
_this.isReady = false;
|
|
39
|
+
_this.token = options.token;
|
|
40
|
+
_this.connectSignalingClient();
|
|
41
|
+
if (options.messenger) {
|
|
42
|
+
_this.messenger = options.messenger;
|
|
43
|
+
}
|
|
44
|
+
if (options.rtSee) {
|
|
45
|
+
_this.rtSee = options.rtSee;
|
|
46
|
+
}
|
|
47
|
+
_this.signalingClient.connect({
|
|
48
|
+
eventsDashboard: _this,
|
|
49
|
+
});
|
|
50
|
+
return _this;
|
|
51
|
+
}
|
|
52
|
+
RTSeeEventsDashboard.prototype.onReady = function () {
|
|
53
|
+
this.isReady = true;
|
|
54
|
+
this.signalingClient.sendMessage({
|
|
55
|
+
name: common_1.RTSeeEventsManagerMessages.DASHBOARD_CONNECT,
|
|
56
|
+
data: {
|
|
57
|
+
token: "admin",
|
|
58
|
+
},
|
|
59
|
+
});
|
|
60
|
+
};
|
|
61
|
+
RTSeeEventsDashboard.prototype.connectSignalingClient = function () {
|
|
62
|
+
this.signalingClient.attachEventsDashboard(this);
|
|
63
|
+
};
|
|
64
|
+
RTSeeEventsDashboard.prototype.populate = function (clients) {
|
|
65
|
+
var _this = this;
|
|
66
|
+
clients.forEach(function (client) { return _this.addClient(client); });
|
|
67
|
+
};
|
|
68
|
+
RTSeeEventsDashboard.prototype.addClient = function (clientData) {
|
|
69
|
+
if (clientData.id === this.clientId) {
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
var existingClient = this.getClientById(clientData.id);
|
|
73
|
+
if (existingClient) {
|
|
74
|
+
existingClient.merge(clientData);
|
|
75
|
+
this.sortClients();
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
this.clients.unshift(new events_dashboard_1.RTSeeDashboardClient(clientData));
|
|
79
|
+
}
|
|
80
|
+
this.sortClients();
|
|
81
|
+
};
|
|
82
|
+
RTSeeEventsDashboard.prototype.removeClient = function (clientData) {
|
|
83
|
+
if (clientData.id === this.clientId) {
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
var client = this.getClientById(clientData.id);
|
|
87
|
+
if (!client) {
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
clientData.onDisconnected();
|
|
91
|
+
this.sortClients();
|
|
92
|
+
};
|
|
93
|
+
RTSeeEventsDashboard.prototype.addSession = function (sessionData) {
|
|
94
|
+
var client = this.getClientById(sessionData.clientId);
|
|
95
|
+
if (!client) {
|
|
96
|
+
console.log("No client with id: ", sessionData.clientId);
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
var existingSession = client.getSessionById(sessionData.id);
|
|
100
|
+
if (existingSession) {
|
|
101
|
+
console.log("Session with such id exists: ", sessionData.id);
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
client.addSession(sessionData);
|
|
105
|
+
};
|
|
106
|
+
RTSeeEventsDashboard.prototype.removeSessionById = function (clientId, sessionId) {
|
|
107
|
+
var client = this.getClientById(clientId);
|
|
108
|
+
if (!client) {
|
|
109
|
+
console.log("No Client Found");
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
client.removeSessionById(sessionId);
|
|
113
|
+
};
|
|
114
|
+
RTSeeEventsDashboard.prototype.getSession = function (clientId, sessionId) {
|
|
115
|
+
var client = this.getClientById(clientId);
|
|
116
|
+
if (!client) {
|
|
117
|
+
console.log("No Client Found");
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
return client.getSessionById(sessionId);
|
|
121
|
+
};
|
|
122
|
+
RTSeeEventsDashboard.prototype.removeClientById = function (id) {
|
|
123
|
+
var client = this.getClientById(id);
|
|
124
|
+
this.removeClient(client);
|
|
125
|
+
};
|
|
126
|
+
RTSeeEventsDashboard.prototype.getClientById = function (id) {
|
|
127
|
+
return this.clients.find(function (e) { return e.id === id; });
|
|
128
|
+
};
|
|
129
|
+
RTSeeEventsDashboard.prototype.processIncomingEvent = function (clientId, event) {
|
|
130
|
+
if (clientId === this.clientId) {
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
var client = this.getClientById(clientId);
|
|
134
|
+
if (!client) {
|
|
135
|
+
console.log("ERROR. No client found.");
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
client.addEvent(event);
|
|
139
|
+
};
|
|
140
|
+
RTSeeEventsDashboard.prototype.setSessionsData = function (sessionData) {
|
|
141
|
+
var session = this.getSession(sessionData.clientId, sessionData.id);
|
|
142
|
+
if (!session) {
|
|
143
|
+
console.log("Session not found: ", sessionData.id);
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
session.populateData(sessionData);
|
|
147
|
+
};
|
|
148
|
+
RTSeeEventsDashboard.prototype.openChat = function (client) {
|
|
149
|
+
if (!this.messenger) {
|
|
150
|
+
throw new Error("RTSeeMessenger is not initialized.");
|
|
151
|
+
}
|
|
152
|
+
this.messenger.openChatByPeer(__assign(__assign({}, client), { clientId: client.id }));
|
|
153
|
+
};
|
|
154
|
+
RTSeeEventsDashboard.prototype.sortClients = function () {
|
|
155
|
+
this.clients.sort(function (a, b) {
|
|
156
|
+
if (a.isConnected && !b.isConnected) {
|
|
157
|
+
return -1;
|
|
158
|
+
}
|
|
159
|
+
else {
|
|
160
|
+
return a.connectedAt > b.connectedAt ? -1 : 1;
|
|
161
|
+
}
|
|
162
|
+
});
|
|
163
|
+
};
|
|
164
|
+
return RTSeeEventsDashboard;
|
|
165
|
+
}(core_1.RTSeeCore));
|
|
166
|
+
exports.RTSeeEventsDashboard = RTSeeEventsDashboard;
|
|
167
|
+
//# sourceMappingURL=EventsDashboard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EventsDashboard.js","sourceRoot":"","sources":["../../../../src/models/EventsDashboard.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oCAA2E;AAC3E,wCAOuB;AACvB,4DAGiC;AAEjC;IAA0C,wCAAS;IAQjD,8BAAY,OAAqC;QAAjD,YACE,kBAAM,OAAO,CAAC,SAaf;QApBD,aAAO,GAA2B,EAAE,CAAC;QAIrC,aAAO,GAAG,KAAK,CAAC;QAId,KAAI,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;QAC3B,KAAI,CAAC,sBAAsB,EAAE,CAAC;QAC9B,IAAI,OAAO,CAAC,SAAS,EAAE;YACrB,KAAI,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC;SACpC;QACD,IAAI,OAAO,CAAC,KAAK,EAAE;YACjB,KAAI,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;SAC5B;QAED,KAAI,CAAC,eAAe,CAAC,OAAO,CAAC;YAC3B,eAAe,EAAE,KAAI;SACtB,CAAC,CAAC;;IACL,CAAC;IAED,sCAAO,GAAP;QACE,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;QACpB,IAAI,CAAC,eAAe,CAAC,WAAW,CAAC;YAC/B,IAAI,EAAE,mCAA0B,CAAC,iBAAiB;YAClD,IAAI,EAAE;gBACJ,KAAK,EAAE,OAAO;aACf;SACF,CAAC,CAAC;IACL,CAAC;IAED,qDAAsB,GAAtB;QACE,IAAI,CAAC,eAAe,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAC;IACnD,CAAC;IAED,uCAAQ,GAAR,UAAS,OAAgC;QAAzC,iBAEC;QADC,OAAO,CAAC,OAAO,CAAC,UAAC,MAAM,IAAK,OAAA,KAAI,CAAC,SAAS,CAAC,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;QACD,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IACzB,CAAC;IAED,8CAAe,GAAf,UAAgB,WAAgD;QAC9D,IAAM,OAAO,GAAG,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,QAAQ,EAAE,WAAW,CAAC,EAAE,CAAC,CAAC;QACtE,IAAI,CAAC,OAAO,EAAE;YACZ,OAAO,CAAC,GAAG,CAAC,qBAAqB,EAAE,WAAW,CAAC,EAAE,CAAC,CAAC;YACnD,OAAO;SACR;QACD,OAAO,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC;IACpC,CAAC;IAED,uCAAQ,GAAR,UAAS,MAA4B;QACnC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;YACnB,MAAM,IAAI,KAAK,CAAC,oCAAoC,CAAC,CAAC;SACvD;QAED,IAAI,CAAC,SAAS,CAAC,cAAc,uBAAM,MAAM,KAAE,QAAQ,EAAE,MAAM,CAAC,EAAE,IAAG,CAAC;IACpE,CAAC;IAEO,0CAAW,GAAnB;QACE,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,UAAC,CAAC,EAAE,CAAC;YACrB,IAAI,CAAC,CAAC,WAAW,IAAI,CAAC,CAAC,CAAC,WAAW,EAAE;gBACnC,OAAO,CAAC,CAAC,CAAC;aACX;iBAAM;gBACL,OAAO,CAAC,CAAC,WAAW,GAAG,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;aAC/C;QACH,CAAC,CAAC,CAAC;IACL,CAAC;IACH,2BAAC;AAAD,CAAC,AAvJD,CAA0C,gBAAS,GAuJlD;AAvJY,oDAAoB"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { IBot, IClient, IDevice, IDeviceDetectionResult, IOS } from "@rtsee/common";
|
|
2
|
+
export interface IRTSeeSessionInfo {
|
|
3
|
+
clientName?: string;
|
|
4
|
+
clientVersion?: string;
|
|
5
|
+
deviceBrand?: string;
|
|
6
|
+
deviceType?: string;
|
|
7
|
+
deviceModel?: string;
|
|
8
|
+
osName?: string;
|
|
9
|
+
osVersion?: string;
|
|
10
|
+
botName?: string;
|
|
11
|
+
clientThumbnail?: string;
|
|
12
|
+
osThumbnail?: string;
|
|
13
|
+
deviceThumbnail?: string;
|
|
14
|
+
}
|
|
15
|
+
export declare class RTSeeSessionAgent implements IDeviceDetectionResult {
|
|
16
|
+
client: IClient | null;
|
|
17
|
+
device: IDevice | null;
|
|
18
|
+
os: IOS | null;
|
|
19
|
+
bot: IBot | null;
|
|
20
|
+
constructor(options: IDeviceDetectionResult);
|
|
21
|
+
getSessionInfo(): IRTSeeSessionInfo;
|
|
22
|
+
getClientThumbnail(): string;
|
|
23
|
+
getOsThumbnail(): string;
|
|
24
|
+
getDeviceThumbnail(): string;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=SessionAgent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SessionAgent.d.ts","sourceRoot":"","sources":["../../../../src/models/SessionAgent.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EACJ,OAAO,EACP,OAAO,EACP,sBAAsB,EACtB,GAAG,EACJ,MAAM,eAAe,CAAC;AAEvB,MAAM,WAAW,iBAAiB;IAChC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,qBAAa,iBAAkB,YAAW,sBAAsB;IAC9D,MAAM,EAAE,OAAO,GAAG,IAAI,CAAC;IACvB,MAAM,EAAE,OAAO,GAAG,IAAI,CAAC;IACvB,EAAE,EAAE,GAAG,GAAG,IAAI,CAAC;IACf,GAAG,EAAE,IAAI,GAAG,IAAI,CAAC;gBAEL,OAAO,EAAE,sBAAsB;IAe3C,cAAc,IAAI,iBAAiB;IAsCnC,kBAAkB,IAAI,MAAM;IAgB5B,cAAc,IAAI,MAAM;IAgBxB,kBAAkB,IAAI,MAAM;CAsC7B"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RTSeeSessionAgent = void 0;
|
|
4
|
+
var RTSeeSessionAgent = /** @class */ (function () {
|
|
5
|
+
function RTSeeSessionAgent(options) {
|
|
6
|
+
if (options.client) {
|
|
7
|
+
this.client = options.client;
|
|
8
|
+
}
|
|
9
|
+
if (options.device) {
|
|
10
|
+
this.device = options.device;
|
|
11
|
+
}
|
|
12
|
+
if (options.os) {
|
|
13
|
+
this.os = options.os;
|
|
14
|
+
}
|
|
15
|
+
if (options.bot) {
|
|
16
|
+
this.bot = options.bot;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
RTSeeSessionAgent.prototype.getSessionInfo = function () {
|
|
20
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
21
|
+
var sessionInfo = {};
|
|
22
|
+
if ((_a = this.client) === null || _a === void 0 ? void 0 : _a.name) {
|
|
23
|
+
sessionInfo.clientName = this.client.name;
|
|
24
|
+
}
|
|
25
|
+
if ((_b = this.client) === null || _b === void 0 ? void 0 : _b.version) {
|
|
26
|
+
sessionInfo.clientVersion = this.client.version;
|
|
27
|
+
}
|
|
28
|
+
if ((_c = this.device) === null || _c === void 0 ? void 0 : _c.brand) {
|
|
29
|
+
sessionInfo.deviceType = this.device.type;
|
|
30
|
+
}
|
|
31
|
+
if ((_d = this.device) === null || _d === void 0 ? void 0 : _d.brand) {
|
|
32
|
+
sessionInfo.deviceBrand = this.device.brand;
|
|
33
|
+
}
|
|
34
|
+
if ((_e = this.device) === null || _e === void 0 ? void 0 : _e.model) {
|
|
35
|
+
sessionInfo.deviceModel = this.device.model;
|
|
36
|
+
}
|
|
37
|
+
if ((_f = this.os) === null || _f === void 0 ? void 0 : _f.name) {
|
|
38
|
+
sessionInfo.osName = this.os.name;
|
|
39
|
+
}
|
|
40
|
+
if ((_g = this.os) === null || _g === void 0 ? void 0 : _g.version) {
|
|
41
|
+
sessionInfo.osVersion = this.os.version;
|
|
42
|
+
}
|
|
43
|
+
if ((_h = this.bot) === null || _h === void 0 ? void 0 : _h.name) {
|
|
44
|
+
sessionInfo.botName = this.bot.name;
|
|
45
|
+
}
|
|
46
|
+
if (this.client) {
|
|
47
|
+
sessionInfo.clientThumbnail = this.getClientThumbnail();
|
|
48
|
+
}
|
|
49
|
+
if (this.os) {
|
|
50
|
+
sessionInfo.osThumbnail = this.getOsThumbnail();
|
|
51
|
+
}
|
|
52
|
+
if (this.device) {
|
|
53
|
+
sessionInfo.deviceThumbnail = this.getDeviceThumbnail();
|
|
54
|
+
}
|
|
55
|
+
return sessionInfo;
|
|
56
|
+
};
|
|
57
|
+
RTSeeSessionAgent.prototype.getClientThumbnail = function () {
|
|
58
|
+
var thumbnail = "";
|
|
59
|
+
if (this.client.name) {
|
|
60
|
+
thumbnail += this.client.name;
|
|
61
|
+
}
|
|
62
|
+
if (this.client.version) {
|
|
63
|
+
if (thumbnail) {
|
|
64
|
+
thumbnail += " ";
|
|
65
|
+
}
|
|
66
|
+
thumbnail += this.client.version;
|
|
67
|
+
}
|
|
68
|
+
return thumbnail;
|
|
69
|
+
};
|
|
70
|
+
RTSeeSessionAgent.prototype.getOsThumbnail = function () {
|
|
71
|
+
var thumbnail = "";
|
|
72
|
+
if (this.os.name) {
|
|
73
|
+
thumbnail += this.os.name;
|
|
74
|
+
}
|
|
75
|
+
if (this.os.version) {
|
|
76
|
+
if (thumbnail) {
|
|
77
|
+
thumbnail += " ";
|
|
78
|
+
}
|
|
79
|
+
thumbnail += this.os.version;
|
|
80
|
+
}
|
|
81
|
+
return thumbnail;
|
|
82
|
+
};
|
|
83
|
+
RTSeeSessionAgent.prototype.getDeviceThumbnail = function () {
|
|
84
|
+
var thumbnail = "";
|
|
85
|
+
if (this.bot) {
|
|
86
|
+
return "Bot: " + this.bot.name;
|
|
87
|
+
}
|
|
88
|
+
if (this.device.brand) {
|
|
89
|
+
thumbnail += this.device.brand;
|
|
90
|
+
}
|
|
91
|
+
if (this.device.model) {
|
|
92
|
+
if (thumbnail) {
|
|
93
|
+
thumbnail += " ";
|
|
94
|
+
}
|
|
95
|
+
thumbnail += this.device.model;
|
|
96
|
+
}
|
|
97
|
+
if (this.device.model) {
|
|
98
|
+
if (thumbnail) {
|
|
99
|
+
thumbnail += " ";
|
|
100
|
+
}
|
|
101
|
+
thumbnail += this.device.model;
|
|
102
|
+
}
|
|
103
|
+
if (this.device.type) {
|
|
104
|
+
var hasBrandOrModel = !!thumbnail;
|
|
105
|
+
if (hasBrandOrModel) {
|
|
106
|
+
thumbnail += " (";
|
|
107
|
+
}
|
|
108
|
+
thumbnail += this.device.type;
|
|
109
|
+
if (hasBrandOrModel) {
|
|
110
|
+
thumbnail += ")";
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
return thumbnail;
|
|
114
|
+
};
|
|
115
|
+
return RTSeeSessionAgent;
|
|
116
|
+
}());
|
|
117
|
+
exports.RTSeeSessionAgent = RTSeeSessionAgent;
|
|
118
|
+
//# sourceMappingURL=SessionAgent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SessionAgent.js","sourceRoot":"","sources":["../../../../src/models/SessionAgent.ts"],"names":[],"mappings":";;;AAsBA;IAME,2BAAY,OAA+B;QACzC,IAAI,OAAO,CAAC,MAAM,EAAE;YAClB,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,C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23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./EventsDashboard"), exports);
|
|
18
|
+
__exportStar(require("./DashboardClient"), exports);
|
|
19
|
+
__exportStar(require("./DashboardClientSession"), exports);
|
|
20
|
+
__exportStar(require("./DashboardEvent"), exports);
|
|
21
|
+
__exportStar(require("./EventsCollector"), exports);
|
|
22
|
+
__exportStar(require("./SessionAgent"), exports);
|
|
23
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/models/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oDAAkC;AAClC,oDAAkC;AAClC,2DAAyC;AACzC,mDAAiC;AACjC,oDAAkC;AAClC,iDAA+B"}
|
package/package.json
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@rtsee/events-dashboard",
|
|
3
|
+
"version": "0.0.48",
|
|
4
|
+
"license": "ISC",
|
|
5
|
+
"private": false,
|
|
6
|
+
"main": "dist/events-dashboard/src/index",
|
|
7
|
+
"types": "dist/events-dashboard/src/index",
|
|
8
|
+
"files": [
|
|
9
|
+
"dist/events-dashboard/src"
|
|
10
|
+
],
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "git@github.com:thewerf/rtsee.git",
|
|
14
|
+
"directory": "packages/@rtsee/events-dashboard"
|
|
15
|
+
},
|
|
16
|
+
"scripts": {
|
|
17
|
+
"prepublishOnly": "yarn build",
|
|
18
|
+
"clean": "rm -rf ./dist",
|
|
19
|
+
"build": "yarn clean && yarn compile",
|
|
20
|
+
"compile": "tsc -p tsconfig.json",
|
|
21
|
+
"watch": "tsc -p tsconfig.json --watch",
|
|
22
|
+
"lint-file:eslint": "yarn eslint",
|
|
23
|
+
"lint-file:prettier": "yarn prettier --check",
|
|
24
|
+
"lint:eslint": "yarn lint-file:eslint 'src/**/*.ts'",
|
|
25
|
+
"lint:prettier": "yarn lint-file:prettier './**/*.{ts,js,json,css,md}' --ignore-path ../../.prettierignore"
|
|
26
|
+
},
|
|
27
|
+
"devDependencies": {
|
|
28
|
+
"@types/jest": "^26.0.24",
|
|
29
|
+
"@types/node": "~20.5.1",
|
|
30
|
+
"@types/uuid": "^8.3.4",
|
|
31
|
+
"@typescript-eslint/eslint-plugin": "^4.33.0",
|
|
32
|
+
"@typescript-eslint/parser": "^4.33.0",
|
|
33
|
+
"eslint": "^7.32.0",
|
|
34
|
+
"eslint-config-prettier": "^8.3.0",
|
|
35
|
+
"eslint-plugin-jest": "^23.1.1",
|
|
36
|
+
"jest": "^27.0.6",
|
|
37
|
+
"jest-watch-yarn-workspaces": "^1.1.0",
|
|
38
|
+
"prettier": "^2.3.2",
|
|
39
|
+
"ts-jest": "^27.0.3",
|
|
40
|
+
"typescript": "5.2.2"
|
|
41
|
+
},
|
|
42
|
+
"peerDependencies": {
|
|
43
|
+
"uuid": "^8.3.2"
|
|
44
|
+
},
|
|
45
|
+
"dependencies": {
|
|
46
|
+
"uuid": "^8.3.2"
|
|
47
|
+
},
|
|
48
|
+
"publishConfig": {
|
|
49
|
+
"access": "public"
|
|
50
|
+
},
|
|
51
|
+
"gitHead": "d01a715eca40e33e454964292e4b9ac7e9899581"
|
|
52
|
+
}
|