@rtsee/live-storage 0.0.35 → 0.0.37

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.
Files changed (33) hide show
  1. package/dist/live-storage/src/conference/index.d.ts +3 -0
  2. package/dist/live-storage/src/conference/index.d.ts.map +1 -0
  3. package/dist/live-storage/src/conference/index.js +19 -0
  4. package/dist/live-storage/src/conference/index.js.map +1 -0
  5. package/dist/live-storage/src/conference/interfaces/ConferenceStorageOptions.d.ts +5 -0
  6. package/dist/live-storage/src/conference/interfaces/ConferenceStorageOptions.d.ts.map +1 -0
  7. package/dist/live-storage/src/conference/interfaces/ConferenceStorageOptions.js +3 -0
  8. package/dist/live-storage/src/conference/interfaces/ConferenceStorageOptions.js.map +1 -0
  9. package/dist/live-storage/src/conference/interfaces/index.d.ts +2 -0
  10. package/dist/live-storage/src/conference/interfaces/index.d.ts.map +1 -0
  11. package/dist/live-storage/src/conference/interfaces/index.js +18 -0
  12. package/dist/live-storage/src/conference/interfaces/index.js.map +1 -0
  13. package/dist/live-storage/src/conference/models/ConferenceStorage.d.ts +13 -0
  14. package/dist/live-storage/src/conference/models/ConferenceStorage.d.ts.map +1 -0
  15. package/dist/live-storage/src/conference/models/ConferenceStorage.js +51 -0
  16. package/dist/live-storage/src/conference/models/ConferenceStorage.js.map +1 -0
  17. package/dist/live-storage/src/conference/models/index.d.ts +4 -0
  18. package/dist/live-storage/src/conference/models/index.d.ts.map +1 -0
  19. package/dist/live-storage/src/conference/models/index.js +20 -0
  20. package/dist/live-storage/src/conference/models/index.js.map +1 -0
  21. package/dist/live-storage/src/conference/models/local-storage/LocalStorageProcessor.d.ts +21 -0
  22. package/dist/live-storage/src/conference/models/local-storage/LocalStorageProcessor.d.ts.map +1 -0
  23. package/dist/live-storage/src/conference/models/local-storage/LocalStorageProcessor.js +113 -0
  24. package/dist/live-storage/src/conference/models/local-storage/LocalStorageProcessor.js.map +1 -0
  25. package/dist/live-storage/src/conference/models/remote-storage/RemoteStorageProcessor.d.ts +13 -0
  26. package/dist/live-storage/src/conference/models/remote-storage/RemoteStorageProcessor.d.ts.map +1 -0
  27. package/dist/live-storage/src/conference/models/remote-storage/RemoteStorageProcessor.js +25 -0
  28. package/dist/live-storage/src/conference/models/remote-storage/RemoteStorageProcessor.js.map +1 -0
  29. package/dist/live-storage/src/index.d.ts +1 -0
  30. package/dist/live-storage/src/index.d.ts.map +1 -1
  31. package/dist/live-storage/src/index.js +1 -0
  32. package/dist/live-storage/src/index.js.map +1 -1
  33. package/package.json +2 -2
@@ -0,0 +1,3 @@
1
+ export * from './models';
2
+ export * from './interfaces';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/conference/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/conference/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,+CAA6B"}
@@ -0,0 +1,5 @@
1
+ import { IRTSeeConferenceStorageProcessor } from "@rtsee/common";
2
+ export interface IRTSeeConferenceStorageOptions {
3
+ handlers?: IRTSeeConferenceStorageProcessor;
4
+ }
5
+ //# sourceMappingURL=ConferenceStorageOptions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConferenceStorageOptions.d.ts","sourceRoot":"","sources":["../../../../../src/conference/interfaces/ConferenceStorageOptions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gCAAgC,EAAE,MAAM,eAAe,CAAC;AAEjE,MAAM,WAAW,8BAA8B;IAC7C,QAAQ,CAAC,EAAE,gCAAgC,CAAC;CAC7C"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=ConferenceStorageOptions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConferenceStorageOptions.js","sourceRoot":"","sources":["../../../../../src/conference/interfaces/ConferenceStorageOptions.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export * from './ConferenceStorageOptions';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/conference/interfaces/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,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("./ConferenceStorageOptions"), exports);
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/conference/interfaces/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6DAA2C"}
@@ -0,0 +1,13 @@
1
+ import { IRTSeeConferenceStorageProcessor } from "@rtsee/common";
2
+ import { IRTSeeConferenceStorageOptions } from "../interfaces";
3
+ import { IPeer, IRTSeeConferenceRoom, IRTSeeCall } from "@rtsee/core";
4
+ export declare class RTSeeConferenceStorage implements IRTSeeConferenceStorageProcessor {
5
+ processor: IRTSeeConferenceStorageProcessor;
6
+ constructor(options?: IRTSeeConferenceStorageOptions);
7
+ createRoom(roomData: IRTSeeConferenceRoom): Promise<IRTSeeConferenceRoom>;
8
+ createCall(peer: IPeer, call: Omit<IRTSeeCall, 'members' | 'id'>): Promise<IRTSeeCall | null>;
9
+ joinCall(peer: IPeer, call: IRTSeeCall): Promise<IRTSeeCall | null>;
10
+ leaveCall(peer: IPeer, call: IRTSeeCall): Promise<IRTSeeCall | null>;
11
+ endCall(peer: IPeer, call: IRTSeeCall): Promise<IRTSeeCall | null>;
12
+ }
13
+ //# sourceMappingURL=ConferenceStorage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConferenceStorage.d.ts","sourceRoot":"","sources":["../../../../../src/conference/models/ConferenceStorage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gCAAgC,EAAE,MAAM,eAAe,CAAC;AACjE,OAAO,EAAE,8BAA8B,EAAE,MAAM,eAAe,CAAC;AAC/D,OAAO,EAAE,KAAK,EAAE,oBAAoB,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAItE,qBAAa,sBAAuB,YAAW,gCAAgC;IAC7E,SAAS,EAAE,gCAAgC,CAAC;gBAEhC,OAAO,CAAC,EAAE,8BAA8B;IAQ9C,UAAU,CAAC,QAAQ,EAAE,oBAAoB,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAIzE,UAAU,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC,UAAU,EAAE,SAAS,GAAG,IAAI,CAAC,GAAG,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC;IAI7F,QAAQ,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC;IAInE,SAAS,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC;IAIpE,OAAO,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC;CAGzE"}
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.RTSeeConferenceStorage = void 0;
13
+ const RemoteStorageProcessor_1 = require("./remote-storage/RemoteStorageProcessor");
14
+ const LocalStorageProcessor_1 = require("./local-storage/LocalStorageProcessor");
15
+ class RTSeeConferenceStorage {
16
+ constructor(options) {
17
+ if (options && options.handlers) {
18
+ this.processor = new RemoteStorageProcessor_1.RTSeeConferenceRemoteStorageProcessor(options);
19
+ }
20
+ else {
21
+ this.processor = new LocalStorageProcessor_1.RTSeeConferenceLocalStorageProcessor();
22
+ }
23
+ }
24
+ createRoom(roomData) {
25
+ return __awaiter(this, void 0, void 0, function* () {
26
+ return this.processor.createRoom(roomData);
27
+ });
28
+ }
29
+ createCall(peer, call) {
30
+ return __awaiter(this, void 0, void 0, function* () {
31
+ return this.processor.createCall(peer, call);
32
+ });
33
+ }
34
+ joinCall(peer, call) {
35
+ return __awaiter(this, void 0, void 0, function* () {
36
+ return this.processor.joinCall(peer, call);
37
+ });
38
+ }
39
+ leaveCall(peer, call) {
40
+ return __awaiter(this, void 0, void 0, function* () {
41
+ return this.processor.leaveCall(peer, call);
42
+ });
43
+ }
44
+ endCall(peer, call) {
45
+ return __awaiter(this, void 0, void 0, function* () {
46
+ return this.processor.endCall(peer, call);
47
+ });
48
+ }
49
+ }
50
+ exports.RTSeeConferenceStorage = RTSeeConferenceStorage;
51
+ //# sourceMappingURL=ConferenceStorage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConferenceStorage.js","sourceRoot":"","sources":["../../../../../src/conference/models/ConferenceStorage.ts"],"names":[],"mappings":";;;;;;;;;;;;AAGA,oFAAgG;AAChG,iFAA6F;AAE7F,MAAa,sBAAsB;IAGjC,YAAY,OAAwC;QAClD,IAAI,OAAO,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC;YAChC,IAAI,CAAC,SAAS,GAAG,IAAI,8DAAqC,CAAC,OAAO,CAAC,CAAC;QACtE,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,SAAS,GAAG,IAAI,4DAAoC,EAAE,CAAC;QAC9D,CAAC;IACH,CAAC;IAEK,UAAU,CAAC,QAA8B;;YAC7C,OAAO,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;QAC7C,CAAC;KAAA;IAEK,UAAU,CAAC,IAAW,EAAE,IAAwC;;YACpE,OAAO,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAC/C,CAAC;KAAA;IAEK,QAAQ,CAAC,IAAW,EAAE,IAAgB;;YAC1C,OAAO,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAC7C,CAAC;KAAA;IAEK,SAAS,CAAC,IAAW,EAAE,IAAgB;;YAC3C,OAAO,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,CAAC,CAAA;QAC7C,CAAC;KAAA;IAEK,OAAO,CAAC,IAAW,EAAE,IAAgB;;YACzC,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,CAAA;QAC3C,CAAC;KAAA;CACF;AA9BD,wDA8BC"}
@@ -0,0 +1,4 @@
1
+ export * from './ConferenceStorage';
2
+ export * from './local-storage/LocalStorageProcessor';
3
+ export * from './remote-storage/RemoteStorageProcessor';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/conference/models/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,uCAAuC,CAAC;AACtD,cAAc,yCAAyC,CAAC"}
@@ -0,0 +1,20 @@
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("./ConferenceStorage"), exports);
18
+ __exportStar(require("./local-storage/LocalStorageProcessor"), exports);
19
+ __exportStar(require("./remote-storage/RemoteStorageProcessor"), exports);
20
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/conference/models/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,sDAAoC;AACpC,wEAAsD;AACtD,0EAAwD"}
@@ -0,0 +1,21 @@
1
+ import { IRTSeeConferenceStorageProcessor, IRTSeeCallMember } from "@rtsee/common";
2
+ import { IPeer, IRTSeeConferenceRoom, IRTSeeCall } from "@rtsee/core";
3
+ export declare class RTSeeConferenceLocalStorageProcessor implements IRTSeeConferenceStorageProcessor {
4
+ peers: IPeer[];
5
+ rooms: IRTSeeConferenceRoom[];
6
+ calls: IRTSeeCall[];
7
+ callMembers: IRTSeeCallMember[];
8
+ createRoom(roomData: Omit<IRTSeeConferenceRoom, 'id'>): Promise<IRTSeeConferenceRoom | null>;
9
+ createCall(peer: IPeer, call: Omit<IRTSeeCall, "id" | "members">): Promise<IRTSeeCall | null>;
10
+ joinCall(peer: IPeer, call: IRTSeeCall): Promise<IRTSeeCall | null>;
11
+ leaveCall(peer: IPeer, call: IRTSeeCall): Promise<IRTSeeCall | null>;
12
+ endCall(peer: IPeer, call: IRTSeeCall): Promise<IRTSeeCall | null>;
13
+ private addCallMemberIfMissing;
14
+ private addPeerIfMissing;
15
+ private addRoomIfMissing;
16
+ private getCallMembers;
17
+ private getPopulatedCall;
18
+ private markMemberJoined;
19
+ private markMemberLeft;
20
+ }
21
+ //# sourceMappingURL=LocalStorageProcessor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LocalStorageProcessor.d.ts","sourceRoot":"","sources":["../../../../../../src/conference/models/local-storage/LocalStorageProcessor.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gCAAgC,EAChC,gBAAgB,EACjB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAC,KAAK,EAAE,oBAAoB,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAGrE,qBAAa,oCAAqC,YAAW,gCAAgC;IAC3F,KAAK,EAAE,KAAK,EAAE,CAAM;IACpB,KAAK,EAAE,oBAAoB,EAAE,CAAM;IACnC,KAAK,EAAE,UAAU,EAAE,CAAM;IACzB,WAAW,EAAE,gBAAgB,EAAE,CAAM;IAErC,UAAU,CAAC,QAAQ,EAAE,IAAI,CAAC,oBAAoB,EAAE,IAAI,CAAC,GAAI,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC;IAK7F,UAAU,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC,UAAU,EAAE,IAAI,GAAG,SAAS,CAAC,GAAG,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC;IAY7F,QAAQ,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC;IAQnE,SAAS,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC;IAQpE,OAAO,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC;IAelE,OAAO,CAAC,sBAAsB;IAc9B,OAAO,CAAC,gBAAgB;IAMxB,OAAO,CAAC,gBAAgB;IAoBxB,OAAO,CAAC,cAAc;IAOtB,OAAO,CAAC,gBAAgB;IAOxB,OAAO,CAAC,gBAAgB;IAOxB,OAAO,CAAC,cAAc;CAMvB"}
@@ -0,0 +1,113 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RTSeeConferenceLocalStorageProcessor = void 0;
4
+ const uuid_1 = require("uuid");
5
+ class RTSeeConferenceLocalStorageProcessor {
6
+ constructor() {
7
+ this.peers = [];
8
+ this.rooms = [];
9
+ this.calls = [];
10
+ this.callMembers = [];
11
+ }
12
+ createRoom(roomData) {
13
+ console.log('create a room', roomData);
14
+ return Promise.resolve(this.addRoomIfMissing(roomData));
15
+ }
16
+ createCall(peer, call) {
17
+ this.addPeerIfMissing(peer);
18
+ const createdCall = {
19
+ id: (0, uuid_1.v4)(),
20
+ roomId: call.roomId,
21
+ members: []
22
+ };
23
+ const callMember = this.addCallMemberIfMissing(createdCall.id, peer);
24
+ this.markMemberJoined(callMember);
25
+ return Promise.resolve(this.getPopulatedCall(createdCall.id));
26
+ }
27
+ joinCall(peer, call) {
28
+ this.addPeerIfMissing(peer);
29
+ const callMember = this.addCallMemberIfMissing(call.id, peer);
30
+ this.markMemberJoined(callMember);
31
+ console.log('added a call member', callMember);
32
+ return Promise.resolve(this.getPopulatedCall(call.id));
33
+ }
34
+ leaveCall(peer, call) {
35
+ this.addPeerIfMissing(peer);
36
+ const callMember = this.addCallMemberIfMissing(call.id, peer);
37
+ this.markMemberLeft(callMember);
38
+ console.log('added a call member left', callMember);
39
+ return Promise.resolve(this.getPopulatedCall(call.id));
40
+ }
41
+ endCall(peer, call) {
42
+ this.addPeerIfMissing(peer);
43
+ const callMember = this.addCallMemberIfMissing(call.id, peer);
44
+ const callMembers = this.getCallMembers(call.id);
45
+ callMembers.forEach((member) => {
46
+ this.markMemberLeft(member);
47
+ });
48
+ console.log('ending a call, members', callMembers);
49
+ this.markMemberLeft(callMember);
50
+ return Promise.resolve(this.getPopulatedCall(call.id));
51
+ }
52
+ addCallMemberIfMissing(callId, peer) {
53
+ const existingMember = this.callMembers
54
+ .find((cm) => (cm.clientId === peer.clientId) && (cm.callId === callId)) || null;
55
+ if (existingMember) {
56
+ return existingMember;
57
+ }
58
+ const member = {
59
+ callId,
60
+ clientId: peer.clientId
61
+ };
62
+ this.callMembers.push(member);
63
+ return member;
64
+ }
65
+ addPeerIfMissing(peer) {
66
+ const existing = this.peers.find((p) => p.clientId === peer.clientId);
67
+ if (!existing) {
68
+ this.peers.push(peer);
69
+ }
70
+ return peer;
71
+ }
72
+ addRoomIfMissing(room) {
73
+ const existing = this
74
+ .rooms.find((r) => r.chatId === room.chatId);
75
+ if (existing) {
76
+ console.log('Returning existing room', existing);
77
+ return existing;
78
+ }
79
+ const newRoom = {
80
+ id: (0, uuid_1.v4)(),
81
+ chatId: room.chatId,
82
+ };
83
+ console.log('Adding a room', existing);
84
+ this.rooms.push(newRoom);
85
+ return newRoom;
86
+ }
87
+ getCallMembers(callId) {
88
+ const callMembersIds = this
89
+ .callMembers.filter((cm) => cm.callId === callId)
90
+ .map((cm) => cm.clientId);
91
+ return this.peers.filter((p) => callMembersIds.indexOf(p.clientId) !== -1);
92
+ }
93
+ getPopulatedCall(callId) {
94
+ const call = this.calls.find((c) => c.id === callId) || null;
95
+ if (!call) {
96
+ throw new Error(`Cannot get call with id ${callId}`);
97
+ }
98
+ call.members = this.getCallMembers(callId);
99
+ return call;
100
+ }
101
+ markMemberJoined(callMember) {
102
+ callMember.isPresent = true;
103
+ callMember.joinedAt = new Date();
104
+ return callMember;
105
+ }
106
+ markMemberLeft(callMember) {
107
+ callMember.isPresent = false;
108
+ callMember.leftAt = new Date();
109
+ return callMember;
110
+ }
111
+ }
112
+ exports.RTSeeConferenceLocalStorageProcessor = RTSeeConferenceLocalStorageProcessor;
113
+ //# sourceMappingURL=LocalStorageProcessor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LocalStorageProcessor.js","sourceRoot":"","sources":["../../../../../../src/conference/models/local-storage/LocalStorageProcessor.ts"],"names":[],"mappings":";;;AAKA,+BAAoC;AAEpC,MAAa,oCAAoC;IAAjD;QACE,UAAK,GAAY,EAAE,CAAC;QACpB,UAAK,GAA2B,EAAE,CAAC;QACnC,UAAK,GAAiB,EAAE,CAAC;QACzB,gBAAW,GAAuB,EAAE,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E,EAAE,EAAE,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC;QAC5B,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAM,CAAC,CAAC,CAAC,CAAC;IAC9E,CAAC;IAEO,gBAAgB,CAAC,MAAc;QACrC,MAAM,IAAI,GAAsB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,MAAM,CAAC,IAAI,IAAI,CAAC;QAChF,IAAI,CAAC,IAAI,EAAE,CAAC;YAAC,MAAM,IAAI,KAAK,CAAC,2BAA2B,MAAM,EAAE,CAAC,CAAC;QAAC,CAAC;QACpE,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;QAC3C,OAAO,IAAI,CAAC;IACd,CAAC;IAEO,gBAAgB,CAAC,UAA4B;QACnD,UAAU,CAAC,SAAS,GAAG,IAAI,CAAC;QAC5B,UAAU,CAAC,QAAQ,GAAG,IAAI,IAAI,EAAE,CAAC;QAEjC,OAAO,UAAU,CAAC;IACpB,CAAC;IAEO,cAAc,CAAC,UAA4B;QACjD,UAAU,CAAC,SAAS,GAAG,KAAK,CAAC;QAC7B,UAAU,CAAC,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QAE/B,OAAO,UAAU,CAAC;IACpB,CAAC;CACF;AAzHD,oFAyHC"}
@@ -0,0 +1,13 @@
1
+ import { IRTSeeConferenceStorageProcessor } from "@rtsee/common";
2
+ import { IRTSeeConferenceStorageOptions } from "../../interfaces";
3
+ import { IPeer, IRTSeeConferenceRoom, IRTSeeCall } from "@rtsee/core";
4
+ export declare class RTSeeConferenceRemoteStorageProcessor implements IRTSeeConferenceStorageProcessor {
5
+ handlers: IRTSeeConferenceStorageProcessor;
6
+ constructor(options: IRTSeeConferenceStorageOptions);
7
+ createRoom(roomData: IRTSeeConferenceRoom): Promise<IRTSeeConferenceRoom>;
8
+ createCall(peer: IPeer, call: IRTSeeCall): Promise<IRTSeeCall | null>;
9
+ joinCall(peer: IPeer, call: IRTSeeCall): Promise<IRTSeeCall | null>;
10
+ leaveCall(peer: IPeer, call: IRTSeeCall): Promise<IRTSeeCall | null>;
11
+ endCall(peer: IPeer, call: IRTSeeCall): Promise<IRTSeeCall | null>;
12
+ }
13
+ //# sourceMappingURL=RemoteStorageProcessor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RemoteStorageProcessor.d.ts","sourceRoot":"","sources":["../../../../../../src/conference/models/remote-storage/RemoteStorageProcessor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gCAAgC,EAAE,MAAM,eAAe,CAAC;AACjE,OAAO,EAAE,8BAA8B,EAAE,MAAM,kBAAkB,CAAC;AAClE,OAAO,EAAE,KAAK,EAAE,oBAAoB,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEtE,qBAAa,qCAAsC,YAAW,gCAAgC;IAC5F,QAAQ,EAAE,gCAAgC,CAAC;gBAE/B,OAAO,EAAE,8BAA8B;IAInD,UAAU,CAAC,QAAQ,EAAE,oBAAoB,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAIzE,UAAU,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC;IAIrE,QAAQ,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC;IAInE,SAAS,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC;IAIpE,OAAO,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC;CAGnE"}
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RTSeeConferenceRemoteStorageProcessor = void 0;
4
+ class RTSeeConferenceRemoteStorageProcessor {
5
+ constructor(options) {
6
+ this.handlers = options.handlers;
7
+ }
8
+ createRoom(roomData) {
9
+ return this.handlers.createRoom(roomData);
10
+ }
11
+ createCall(peer, call) {
12
+ return this.handlers.createCall(peer, call);
13
+ }
14
+ joinCall(peer, call) {
15
+ return this.handlers.joinCall(peer, call);
16
+ }
17
+ leaveCall(peer, call) {
18
+ return this.handlers.leaveCall(peer, call);
19
+ }
20
+ endCall(peer, call) {
21
+ return this.handlers.endCall(peer, call);
22
+ }
23
+ }
24
+ exports.RTSeeConferenceRemoteStorageProcessor = RTSeeConferenceRemoteStorageProcessor;
25
+ //# sourceMappingURL=RemoteStorageProcessor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RemoteStorageProcessor.js","sourceRoot":"","sources":["../../../../../../src/conference/models/remote-storage/RemoteStorageProcessor.ts"],"names":[],"mappings":";;;AAIA,MAAa,qCAAqC;IAGhD,YAAY,OAAuC;QACjD,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;IACnC,CAAC;IAED,UAAU,CAAC,QAA8B;QACvC,OAAO,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;IAC5C,CAAC;IAED,UAAU,CAAC,IAAW,EAAE,IAAgB;QACtC,OAAO,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAC9C,CAAC;IAED,QAAQ,CAAC,IAAW,EAAE,IAAgB;QACpC,OAAO,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAC5C,CAAC;IAED,SAAS,CAAC,IAAW,EAAE,IAAgB;QACrC,OAAO,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAC7C,CAAC;IAED,OAAO,CAAC,IAAW,EAAE,IAAgB;QACnC,OAAO,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAC3C,CAAC;CACF;AA1BD,sFA0BC"}
@@ -3,4 +3,5 @@ export * from "./interfaces";
3
3
  export * from "./messenger";
4
4
  export * from "./events-manager";
5
5
  export * from "./presentation";
6
+ export * from "./conference";
6
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC"}
@@ -19,4 +19,5 @@ __exportStar(require("./interfaces"), exports);
19
19
  __exportStar(require("./messenger"), exports);
20
20
  __exportStar(require("./events-manager"), exports);
21
21
  __exportStar(require("./presentation"), exports);
22
+ __exportStar(require("./conference"), exports);
22
23
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,+CAA6B;AAC7B,8CAA4B;AAC5B,mDAAiC;AACjC,iDAA+B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,+CAA6B;AAC7B,8CAA4B;AAC5B,mDAAiC;AACjC,iDAA+B;AAC/B,+CAA6B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rtsee/live-storage",
3
- "version": "0.0.35",
3
+ "version": "0.0.37",
4
4
  "license": "ISC",
5
5
  "private": false,
6
6
  "main": "dist/live-storage/src/index",
@@ -46,5 +46,5 @@
46
46
  "redis": "^4.3.1",
47
47
  "redis-om": "^0.3.6"
48
48
  },
49
- "gitHead": "47400b8569141cd4d3521900ca6d45b6e89f3b1d"
49
+ "gitHead": "af2aac90a2382bfc482e449e19f69a3ac81e081a"
50
50
  }