@rtsee/live-storage 0.0.35 → 0.0.36

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 +106 -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 { IRTSeeCall, IRTSeeConferenceRoom, IRTSeeConferenceStorageProcessor } from "@rtsee/common";
2
+ import { IRTSeeConferenceStorageOptions } from "../interfaces";
3
+ import { IPeer } 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, 'callId'>): 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,EACL,UAAU,EAAE,oBAAoB,EAChC,gCAAgC,EACjC,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,8BAA8B,EAAE,MAAM,eAAe,CAAC;AAC/D,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAIpC,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,QAAQ,CAAC,GAAG,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC;IAIrF,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":";;;;;;;;;;;;AAMA,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,IAAgC;;YAC5D,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 { IRTSeeCall, IRTSeeConferenceRoom, IRTSeeConferenceStorageProcessor, IRTSeeCallMember } from "@rtsee/common";
2
+ import { IPeer } 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,UAAU,EACV,oBAAoB,EACpB,gCAAgC,EAChC,gBAAgB,EACjB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAGpC,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;IAI7F,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;IAOnE,SAAS,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC;IAOpE,OAAO,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC;IAalE,OAAO,CAAC,sBAAsB;IAc9B,OAAO,CAAC,gBAAgB;IAMxB,OAAO,CAAC,gBAAgB;IAcxB,OAAO,CAAC,cAAc;IAOtB,OAAO,CAAC,gBAAgB;IAOxB,OAAO,CAAC,gBAAgB;IAOxB,OAAO,CAAC,cAAc;CAMvB"}
@@ -0,0 +1,106 @@
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
+ return Promise.resolve(this.addRoomIfMissing(roomData));
14
+ }
15
+ createCall(peer, call) {
16
+ this.addPeerIfMissing(peer);
17
+ const createdCall = {
18
+ id: (0, uuid_1.v4)(),
19
+ roomId: call.roomId,
20
+ members: []
21
+ };
22
+ const callMember = this.addCallMemberIfMissing(createdCall.id, peer);
23
+ this.markMemberJoined(callMember);
24
+ return Promise.resolve(this.getPopulatedCall(createdCall.id));
25
+ }
26
+ joinCall(peer, call) {
27
+ this.addPeerIfMissing(peer);
28
+ const callMember = this.addCallMemberIfMissing(call.id, peer);
29
+ this.markMemberJoined(callMember);
30
+ return Promise.resolve(this.getPopulatedCall(call.id));
31
+ }
32
+ leaveCall(peer, call) {
33
+ this.addPeerIfMissing(peer);
34
+ const callMember = this.addCallMemberIfMissing(call.id, peer);
35
+ this.markMemberLeft(callMember);
36
+ return Promise.resolve(this.getPopulatedCall(call.id));
37
+ }
38
+ endCall(peer, call) {
39
+ this.addPeerIfMissing(peer);
40
+ const callMember = this.addCallMemberIfMissing(call.id, peer);
41
+ const callMembers = this.getCallMembers(call.id);
42
+ callMembers.forEach((member) => {
43
+ this.markMemberLeft(member);
44
+ });
45
+ this.markMemberLeft(callMember);
46
+ return Promise.resolve(this.getPopulatedCall(call.id));
47
+ }
48
+ addCallMemberIfMissing(callId, peer) {
49
+ const existingMember = this.callMembers
50
+ .find((cm) => (cm.clientId === peer.clientId) && (cm.callId === callId)) || null;
51
+ if (existingMember) {
52
+ return existingMember;
53
+ }
54
+ const member = {
55
+ callId,
56
+ clientId: peer.clientId
57
+ };
58
+ this.callMembers.push(member);
59
+ return member;
60
+ }
61
+ addPeerIfMissing(peer) {
62
+ const existing = this.peers.find((p) => p.clientId === peer.clientId);
63
+ if (!existing) {
64
+ this.peers.push(peer);
65
+ }
66
+ return peer;
67
+ }
68
+ addRoomIfMissing(room) {
69
+ const existing = this.rooms.find((room) => room.id === room.id);
70
+ if (existing) {
71
+ return existing;
72
+ }
73
+ const newRoom = {
74
+ id: (0, uuid_1.v4)(),
75
+ chatId: room.chatId,
76
+ };
77
+ this.rooms.push(newRoom);
78
+ return newRoom;
79
+ }
80
+ getCallMembers(callId) {
81
+ const callMembersIds = this
82
+ .callMembers.filter((cm) => cm.callId === callId)
83
+ .map((cm) => cm.clientId);
84
+ return this.peers.filter((p) => callMembersIds.indexOf(p.clientId) !== -1);
85
+ }
86
+ getPopulatedCall(callId) {
87
+ const call = this.calls.find((c) => c.id === callId) || null;
88
+ if (!call) {
89
+ throw new Error(`Cannot get call with id ${callId}`);
90
+ }
91
+ call.members = this.getCallMembers(callId);
92
+ return call;
93
+ }
94
+ markMemberJoined(callMember) {
95
+ callMember.isPresent = true;
96
+ callMember.joinedAt = new Date();
97
+ return callMember;
98
+ }
99
+ markMemberLeft(callMember) {
100
+ callMember.isPresent = false;
101
+ callMember.leftAt = new Date();
102
+ return callMember;
103
+ }
104
+ }
105
+ exports.RTSeeConferenceLocalStorageProcessor = RTSeeConferenceLocalStorageProcessor;
106
+ //# sourceMappingURL=LocalStorageProcessor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LocalStorageProcessor.js","sourceRoot":"","sources":["../../../../../../src/conference/models/local-storage/LocalStorageProcessor.ts"],"names":[],"mappings":";;;AAOA,+BAAoC;AAEpC,MAAa,oCAAoC;IAAjD;QACE,UAAK,GAAY,EAAE,CAAC;QACpB,UAAK,GAA2B,EAAE,CAAC;QACnC,UAAK,GAAiB,EAAE,CAAC;QACzB,gBAAW,GAAuB,EAAE,CAAC;IA0GvC,CAAC;IAxGC,UAAU,CAAC,QAA0C;QACnD,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC,CAAC;IAC1D,CAAC;IAED,UAAU,CAA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,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;AA9GD,oFA8GC"}
@@ -0,0 +1,13 @@
1
+ import { IRTSeeCall, IRTSeeConferenceRoom, IRTSeeConferenceStorageProcessor } from "@rtsee/common";
2
+ import { IRTSeeConferenceStorageOptions } from "../../interfaces";
3
+ import { IPeer } 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,EAAC,UAAU,EAAE,oBAAoB,EAAE,gCAAgC,EAAC,MAAM,eAAe,CAAC;AACjG,OAAO,EAAE,8BAA8B,EAAE,MAAM,kBAAkB,CAAC;AAClE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEpC,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.36",
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": "2feaa4064bb068d2b23448ec28e277159401855e"
50
50
  }