@sawport/peers-caller 0.0.0

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 (62) hide show
  1. package/README.md +782 -0
  2. package/dist/core/BaseStore.d.ts +13 -0
  3. package/dist/core/BaseStore.d.ts.map +1 -0
  4. package/dist/core/CallMediaStream.d.ts +101 -0
  5. package/dist/core/CallMediaStream.d.ts.map +1 -0
  6. package/dist/core/CallParticipant.d.ts +122 -0
  7. package/dist/core/CallParticipant.d.ts.map +1 -0
  8. package/dist/core/CallPeerConnection.d.ts +92 -0
  9. package/dist/core/CallPeerConnection.d.ts.map +1 -0
  10. package/dist/core/CallRecorder.d.ts +72 -0
  11. package/dist/core/CallRecorder.d.ts.map +1 -0
  12. package/dist/core/CallSocket.d.ts +131 -0
  13. package/dist/core/CallSocket.d.ts.map +1 -0
  14. package/dist/core/PeersCaller.d.ts +155 -0
  15. package/dist/core/PeersCaller.d.ts.map +1 -0
  16. package/dist/events/CallEventEmitter.d.ts +2 -0
  17. package/dist/events/CallEventEmitter.d.ts.map +1 -0
  18. package/dist/events/index.d.ts +2 -0
  19. package/dist/events/index.d.ts.map +1 -0
  20. package/dist/events/types.d.ts +2 -0
  21. package/dist/events/types.d.ts.map +1 -0
  22. package/dist/hooks/index.d.ts +90 -0
  23. package/dist/hooks/index.d.ts.map +1 -0
  24. package/dist/index.d.ts +19 -0
  25. package/dist/index.d.ts.map +1 -0
  26. package/dist/peers-caller.es.js +7983 -0
  27. package/dist/peers-caller.es.js.map +1 -0
  28. package/dist/peers-caller.umd.js +22 -0
  29. package/dist/peers-caller.umd.js.map +1 -0
  30. package/dist/polyfills.d.ts +5 -0
  31. package/dist/polyfills.d.ts.map +1 -0
  32. package/dist/store/index.d.ts +57 -0
  33. package/dist/store/index.d.ts.map +1 -0
  34. package/dist/test-polyfills.d.ts +2 -0
  35. package/dist/test-polyfills.d.ts.map +1 -0
  36. package/dist/test-setup.d.ts +2 -0
  37. package/dist/test-setup.d.ts.map +1 -0
  38. package/dist/test-utils.d.ts +2 -0
  39. package/dist/test-utils.d.ts.map +1 -0
  40. package/dist/tester/App.d.ts +3 -0
  41. package/dist/tester/App.d.ts.map +1 -0
  42. package/dist/tester/components/ConfigPanel.d.ts +17 -0
  43. package/dist/tester/components/ConfigPanel.d.ts.map +1 -0
  44. package/dist/tester/components/ConnectionStatus.d.ts +21 -0
  45. package/dist/tester/components/ConnectionStatus.d.ts.map +1 -0
  46. package/dist/tester/components/ControlPanel.d.ts +23 -0
  47. package/dist/tester/components/ControlPanel.d.ts.map +1 -0
  48. package/dist/tester/components/DebugConsole.d.ts +27 -0
  49. package/dist/tester/components/DebugConsole.d.ts.map +1 -0
  50. package/dist/tester/components/ParticipantList.d.ts +10 -0
  51. package/dist/tester/components/ParticipantList.d.ts.map +1 -0
  52. package/dist/tester/components/VideoGrid.d.ts +10 -0
  53. package/dist/tester/components/VideoGrid.d.ts.map +1 -0
  54. package/dist/tester/hooks/useTester.d.ts +54 -0
  55. package/dist/tester/hooks/useTester.d.ts.map +1 -0
  56. package/dist/tester/main.d.ts +3 -0
  57. package/dist/tester/main.d.ts.map +1 -0
  58. package/dist/types/index.d.ts +262 -0
  59. package/dist/types/index.d.ts.map +1 -0
  60. package/dist/utils/index.d.ts +50 -0
  61. package/dist/utils/index.d.ts.map +1 -0
  62. package/package.json +78 -0
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Browser polyfills for Node.js APIs required by simple-peer
3
+ */
4
+ export {};
5
+ //# sourceMappingURL=polyfills.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"polyfills.d.ts","sourceRoot":"","sources":["../src/polyfills.ts"],"names":[],"mappings":"AAAA;;GAEG;AAuBH,OAAO,EAAE,CAAC"}
@@ -0,0 +1,57 @@
1
+ /**
2
+ * Zustand store for managing call state across the PeersCaller library
3
+ */
4
+ import type { CallState, CallParticipant, PeersCallerError, CallStatusResponse } from "../types";
5
+ interface CallStoreActions {
6
+ setConversationId: (conversationId: string) => void;
7
+ setLocalParticipant: (participant: CallParticipant) => void;
8
+ addParticipant: (participant: CallParticipant) => void;
9
+ removeParticipant: (userId: string) => void;
10
+ updateParticipant: (userId: string, updates: Partial<CallParticipant>) => void;
11
+ clearParticipants: () => void;
12
+ setCallStatus: (status: CallState["callStatus"]) => void;
13
+ setIsCalling: (isCalling: boolean) => void;
14
+ setIsRecording: (isRecording: boolean) => void;
15
+ setRecordLoading: (loading: boolean) => void;
16
+ setError: (error: PeersCallerError | null, message?: string) => void;
17
+ clearError: () => void;
18
+ setCallStatusInfo: (statusInfo: CallStatusResponse | null) => void;
19
+ setCallStatusLoading: (loading: boolean) => void;
20
+ setCallStatusError: (error: string | null) => void;
21
+ resetCall: () => void;
22
+ }
23
+ export type CallStore = CallState & CallStoreActions;
24
+ export declare const useCallStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<CallStore>, "setState" | "devtools"> & {
25
+ setState(partial: CallStore | Partial<CallStore> | ((state: CallStore) => CallStore | Partial<CallStore>), replace?: false | undefined, action?: (string | {
26
+ [x: string]: unknown;
27
+ [x: number]: unknown;
28
+ [x: symbol]: unknown;
29
+ type: string;
30
+ }) | undefined): void;
31
+ setState(state: CallStore | ((state: CallStore) => CallStore), replace: true, action?: (string | {
32
+ [x: string]: unknown;
33
+ [x: number]: unknown;
34
+ [x: symbol]: unknown;
35
+ type: string;
36
+ }) | undefined): void;
37
+ devtools: {
38
+ cleanup: () => void;
39
+ };
40
+ }>;
41
+ export declare const selectParticipants: (state: CallStore) => Record<string, CallParticipant>;
42
+ export declare const selectParticipantCount: (state: CallStore) => number;
43
+ export declare const selectLocalParticipant: (state: CallStore) => CallParticipant | null;
44
+ export declare const selectCallStatus: (state: CallStore) => "idle" | "connecting" | "connected" | "disconnecting" | "failed";
45
+ export declare const selectIsConnected: (state: CallStore) => boolean;
46
+ export declare const selectError: (state: CallStore) => string | null;
47
+ export declare const selectCallStatusInfo: (state: CallStore) => CallStatusResponse | null;
48
+ export declare const selectCallStatusLoading: (state: CallStore) => boolean;
49
+ export declare const selectCallStatusError: (state: CallStore) => string | null;
50
+ export declare const selectCanJoinCall: (state: CallStore) => boolean;
51
+ export declare const selectIsCallActive: (state: CallStore) => boolean;
52
+ export declare const getParticipant: (userId: string) => CallParticipant;
53
+ export declare const isParticipantConnected: (userId: string) => boolean;
54
+ export declare const getParticipantList: () => CallParticipant[];
55
+ export declare const canAcceptMoreParticipants: (maxParticipants?: number) => boolean;
56
+ export {};
57
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/store/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,KAAK,EACV,SAAS,EACT,eAAe,EACf,gBAAgB,EAChB,kBAAkB,EACnB,MAAM,UAAU,CAAC;AAElB,UAAU,gBAAgB;IAExB,iBAAiB,EAAE,CAAC,cAAc,EAAE,MAAM,KAAK,IAAI,CAAC;IAGpD,mBAAmB,EAAE,CAAC,WAAW,EAAE,eAAe,KAAK,IAAI,CAAC;IAC5D,cAAc,EAAE,CAAC,WAAW,EAAE,eAAe,KAAK,IAAI,CAAC;IACvD,iBAAiB,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5C,iBAAiB,EAAE,CACjB,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,OAAO,CAAC,eAAe,CAAC,KAC9B,IAAI,CAAC;IACV,iBAAiB,EAAE,MAAM,IAAI,CAAC;IAG9B,aAAa,EAAE,CAAC,MAAM,EAAE,SAAS,CAAC,YAAY,CAAC,KAAK,IAAI,CAAC;IACzD,YAAY,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAC;IAG3C,cAAc,EAAE,CAAC,WAAW,EAAE,OAAO,KAAK,IAAI,CAAC;IAC/C,gBAAgB,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAG7C,QAAQ,EAAE,CAAC,K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GpD,CAAC;AAEF,eAAO,MAAM,kBAAkB,yBAG9B,CAAC;AAEF,eAAO,MAAM,yBAAyB,GAAI,wBAAmB,YAG5D,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=test-polyfills.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test-polyfills.d.ts","sourceRoot":"","sources":["../src/test-polyfills.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=test-setup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test-setup.d.ts","sourceRoot":"","sources":["../src/test-setup.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export declare const createMockMediaStream: () => MediaStream;
2
+ //# sourceMappingURL=test-utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test-utils.d.ts","sourceRoot":"","sources":["../src/test-utils.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,qBAAqB,QAAO,WAiBxC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import React from "react";
2
+ export declare const App: React.FC;
3
+ //# sourceMappingURL=App.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"App.d.ts","sourceRoot":"","sources":["../../src/tester/App.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AASxC,eAAO,MAAM,GAAG,EAAE,KAAK,CAAC,EAsNvB,CAAC"}
@@ -0,0 +1,17 @@
1
+ import React from "react";
2
+ interface TesterConfig {
3
+ socketUrl: string;
4
+ conversationId: string;
5
+ userId: string;
6
+ token: string;
7
+ iceServers?: RTCIceServer[];
8
+ }
9
+ interface ConfigPanelProps {
10
+ config: TesterConfig;
11
+ onConfigUpdate: (config: Partial<TesterConfig>) => void;
12
+ isConnected: boolean;
13
+ className?: string;
14
+ }
15
+ export declare const ConfigPanel: React.FC<ConfigPanelProps>;
16
+ export {};
17
+ //# sourceMappingURL=ConfigPanel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConfigPanel.d.ts","sourceRoot":"","sources":["../../../src/tester/components/ConfigPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAExC,UAAU,YAAY;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,YAAY,EAAE,CAAC;CAC7B;AAED,UAAU,gBAAgB;IACxB,MAAM,EAAE,YAAY,CAAC;IACrB,cAAc,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,YAAY,CAAC,KAAK,IAAI,CAAC;IACxD,WAAW,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CA2OlD,CAAC"}
@@ -0,0 +1,21 @@
1
+ import React from "react";
2
+ interface TesterMetrics {
3
+ connectionCount: number;
4
+ activeStreams: number;
5
+ recordingSize: number;
6
+ transcriptCount: number;
7
+ bandwidthUsage: number;
8
+ signalStrength: "strong" | "medium" | "weak" | "disconnected";
9
+ connectTime?: number;
10
+ lastPingTime?: number;
11
+ }
12
+ interface ConnectionStatusProps {
13
+ isConnected: boolean;
14
+ isRecording: boolean;
15
+ error: string | null;
16
+ metrics: TesterMetrics;
17
+ className?: string;
18
+ }
19
+ export declare const ConnectionStatus: React.FC<ConnectionStatusProps>;
20
+ export {};
21
+ //# sourceMappingURL=ConnectionStatus.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConnectionStatus.d.ts","sourceRoot":"","sources":["../../../src/tester/components/ConnectionStatus.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,UAAU,aAAa;IACrB,eAAe,EAAE,MAAM,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,EAAE,MAAM,CAAC;IACxB,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,QAAQ,GAAG,QAAQ,GAAG,MAAM,GAAG,cAAc,CAAC;IAC9D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,UAAU,qBAAqB;IAC7B,WAAW,EAAE,OAAO,CAAC;IACrB,WAAW,EAAE,OAAO,CAAC;IACrB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,OAAO,EAAE,aAAa,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CAuO5D,CAAC"}
@@ -0,0 +1,23 @@
1
+ import React from "react";
2
+ import type { CallParticipant, MediaStreamConfig } from "../../types";
3
+ interface ControlPanelProps {
4
+ localParticipant: CallParticipant | null;
5
+ isConnected: boolean;
6
+ isRecording: boolean;
7
+ isCallActive?: boolean;
8
+ canJoinCall?: boolean;
9
+ onStartCall: (config?: MediaStreamConfig) => void;
10
+ onJoinCall: (config?: MediaStreamConfig) => void;
11
+ onJoinOrStartCall?: (config?: MediaStreamConfig) => void;
12
+ onEndCall: () => void;
13
+ onToggleAudio: (enabled: boolean) => void;
14
+ onToggleVideo: (enabled: boolean) => void;
15
+ onStartScreenShare: () => void;
16
+ onStopScreenShare: () => void;
17
+ onStartRecording: () => void;
18
+ onStopRecording: () => void;
19
+ className?: string;
20
+ }
21
+ export declare const ControlPanel: React.FC<ControlPanelProps>;
22
+ export {};
23
+ //# sourceMappingURL=ControlPanel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ControlPanel.d.ts","sourceRoot":"","sources":["../../../src/tester/components/ControlPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEtE,UAAU,iBAAiB;IACzB,gBAAgB,EAAE,eAAe,GAAG,IAAI,CAAC;IACzC,WAAW,EAAE,OAAO,CAAC;IACrB,WAAW,EAAE,OAAO,CAAC;IACrB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,WAAW,EAAE,CAAC,MAAM,CAAC,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAClD,UAAU,EAAE,CAAC,MAAM,CAAC,EAAE,iBAAiB,KAAK,IAAI,CAAC;IACjD,iBAAiB,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE,iBAAiB,KAAK,IAAI,CAAC;IACzD,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,aAAa,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAC1C,aAAa,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAC1C,kBAAkB,EAAE,MAAM,IAAI,CAAC;IAC/B,iBAAiB,EAAE,MAAM,IAAI,CAAC;IAC9B,gBAAgB,EAAE,MAAM,IAAI,CAAC;IAC7B,eAAe,EAAE,MAAM,IAAI,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAgOpD,CAAC"}
@@ -0,0 +1,27 @@
1
+ import React from "react";
2
+ interface LogEntry {
3
+ id: string;
4
+ timestamp: number;
5
+ level: "info" | "warn" | "error" | "debug";
6
+ message: string;
7
+ data?: any;
8
+ }
9
+ interface TesterMetrics {
10
+ connectionCount: number;
11
+ activeStreams: number;
12
+ recordingSize: number;
13
+ transcriptCount: number;
14
+ bandwidthUsage: number;
15
+ signalStrength: "strong" | "medium" | "weak" | "disconnected";
16
+ connectTime?: number;
17
+ lastPingTime?: number;
18
+ }
19
+ interface DebugConsoleProps {
20
+ logs: LogEntry[];
21
+ metrics: TesterMetrics;
22
+ onClearLogs: () => void;
23
+ className?: string;
24
+ }
25
+ export declare const DebugConsole: React.FC<DebugConsoleProps>;
26
+ export {};
27
+ //# sourceMappingURL=DebugConsole.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DebugConsole.d.ts","sourceRoot":"","sources":["../../../src/tester/components/DebugConsole.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAE3D,UAAU,QAAQ;IAChB,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,CAAC;IAC3C,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,GAAG,CAAC;CACZ;AAED,UAAU,aAAa;IACrB,eAAe,EAAE,MAAM,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,EAAE,MAAM,CAAC;IACxB,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,QAAQ,GAAG,QAAQ,GAAG,MAAM,GAAG,cAAc,CAAC;IAC9D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,UAAU,iBAAiB;IACzB,IAAI,EAAE,QAAQ,EAAE,CAAC;IACjB,OAAO,EAAE,aAAa,CAAC;IACvB,WAAW,EAAE,MAAM,IAAI,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAqSpD,CAAC"}
@@ -0,0 +1,10 @@
1
+ import React from "react";
2
+ import type { CallParticipant } from "../../types";
3
+ interface ParticipantListProps {
4
+ participants: CallParticipant[];
5
+ localParticipant: CallParticipant | null;
6
+ className?: string;
7
+ }
8
+ export declare const ParticipantList: React.FC<ParticipantListProps>;
9
+ export {};
10
+ //# sourceMappingURL=ParticipantList.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ParticipantList.d.ts","sourceRoot":"","sources":["../../../src/tester/components/ParticipantList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnD,UAAU,oBAAoB;IAC5B,YAAY,EAAE,eAAe,EAAE,CAAC;IAChC,gBAAgB,EAAE,eAAe,GAAG,IAAI,CAAC;IACzC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAoHD,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CA4G1D,CAAC"}
@@ -0,0 +1,10 @@
1
+ import React from "react";
2
+ import type { CallParticipant } from "../../types";
3
+ interface VideoGridProps {
4
+ participants: CallParticipant[];
5
+ localParticipant: CallParticipant | null;
6
+ className?: string;
7
+ }
8
+ export declare const VideoGrid: React.FC<VideoGridProps>;
9
+ export {};
10
+ //# sourceMappingURL=VideoGrid.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VideoGrid.d.ts","sourceRoot":"","sources":["../../../src/tester/components/VideoGrid.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4B,MAAM,OAAO,CAAC;AACjD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnD,UAAU,cAAc;IACtB,YAAY,EAAE,eAAe,EAAE,CAAC;IAChC,gBAAgB,EAAE,eAAe,GAAG,IAAI,CAAC;IACzC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AA8FD,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CA0D9C,CAAC"}
@@ -0,0 +1,54 @@
1
+ import { PeersCaller } from "../../core/PeersCaller";
2
+ import type { MediaStreamConfig, CallMetrics, CallStatusResponse, CallParticipant, CallState } from "../../types";
3
+ interface TesterConfig {
4
+ socketUrl: string;
5
+ conversationId: string;
6
+ userId: string;
7
+ token: string;
8
+ iceServers?: RTCIceServer[];
9
+ }
10
+ interface LogEntry {
11
+ id: string;
12
+ timestamp: number;
13
+ level: "info" | "warn" | "error" | "debug";
14
+ message: string;
15
+ data?: any;
16
+ }
17
+ interface TesterMetrics extends CallMetrics {
18
+ connectTime?: number;
19
+ lastPingTime?: number;
20
+ signalStrength: "strong" | "medium" | "weak" | "disconnected";
21
+ }
22
+ interface UseTesterReturn {
23
+ peersCaller: PeersCaller | null;
24
+ callState: CallState;
25
+ participants: CallParticipant[];
26
+ localParticipant: CallParticipant | null;
27
+ isConnected: boolean;
28
+ isRecording: boolean;
29
+ error: string | null;
30
+ logs: LogEntry[];
31
+ metrics: TesterMetrics;
32
+ config: TesterConfig;
33
+ callStatusInfo: CallStatusResponse | null;
34
+ isCallActive: boolean;
35
+ canJoinCall: boolean;
36
+ initialize: () => Promise<PeersCaller | undefined>;
37
+ checkCallStatus: (instance?: PeersCaller) => Promise<CallStatusResponse | null>;
38
+ startCall: (mediaConfig?: MediaStreamConfig) => Promise<void>;
39
+ joinCall: (mediaConfig?: MediaStreamConfig) => Promise<void>;
40
+ joinOrStartCall: (mediaConfig?: MediaStreamConfig) => Promise<void>;
41
+ endCall: () => void;
42
+ toggleAudio: (enabled: boolean) => void;
43
+ toggleVideo: (enabled: boolean) => void;
44
+ startScreenShare: () => void;
45
+ stopScreenShare: () => void;
46
+ startRecording: () => void;
47
+ stopRecording: () => void;
48
+ updateConfig: (updates: Partial<TesterConfig>) => void;
49
+ clearLogs: () => void;
50
+ cleanup: () => void;
51
+ }
52
+ export declare const useTester: () => UseTesterReturn;
53
+ export {};
54
+ //# sourceMappingURL=useTester.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useTester.d.ts","sourceRoot":"","sources":["../../../src/tester/hooks/useTester.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EA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G,SAAS,CAAC,CAAC;IACnD,eAAe,EAAE,CACf,QAAQ,CAAC,EAAE,WAAW,KACnB,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC,CAAC;IACxC,SAAS,EAAE,CAAC,WAAW,CAAC,EAAE,iBAAiB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9D,QAAQ,EAAE,CAAC,WAAW,CAAC,EAAE,iBAAiB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7D,eAAe,EAAE,CAAC,WAAW,CAAC,EAAE,iBAAiB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACpE,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,WAAW,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IACxC,WAAW,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IACxC,gBAAgB,EAAE,MAAM,IAAI,CAAC;IAC7B,eAAe,EAAE,MAAM,IAAI,CAAC;IAC5B,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,YAAY,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,YAAY,CAAC,KAAK,IAAI,CAAC;IACvD,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,eAAO,MAAM,SAAS,QAAO,eAqd5B,CAAC"}
@@ -0,0 +1,3 @@
1
+ import "../polyfills";
2
+ import "./styles.css";
3
+ //# sourceMappingURL=main.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/tester/main.tsx"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAC;AAGtB,OAAO,cAAc,CAAC"}
@@ -0,0 +1,262 @@
1
+ /**
2
+ * Core type definitions for PeersCaller library
3
+ */
4
+ import type { Socket } from "socket.io-client";
5
+ import type SimplePeer from "simple-peer";
6
+ export interface CallParticipant {
7
+ peer?: SimplePeer.Instance | null;
8
+ userId: string;
9
+ videoOn: boolean;
10
+ audioOn: boolean;
11
+ screenSharing: boolean;
12
+ stream?: MediaStream;
13
+ videoElement?: HTMLVideoElement;
14
+ }
15
+ export interface CallState {
16
+ conversationId: string;
17
+ participants: Record<string, CallParticipant>;
18
+ localParticipant: CallParticipant | null;
19
+ isCalling: boolean;
20
+ isRecording: boolean;
21
+ recordLoading: boolean;
22
+ callStatus: "idle" | "connecting" | "connected" | "disconnecting" | "failed";
23
+ error: string | null;
24
+ callStatusInfo: CallStatusResponse | null;
25
+ callStatusLoading: boolean;
26
+ callStatusError: string | null;
27
+ }
28
+ export interface MediaStreamConfig {
29
+ video: boolean | MediaTrackConstraints;
30
+ audio: boolean | MediaTrackConstraints;
31
+ }
32
+ export interface ScreenShareConfig {
33
+ video: boolean | MediaTrackConstraints;
34
+ audio: boolean;
35
+ }
36
+ export interface PeerConnectionConfig {
37
+ iceServers: RTCIceServer[];
38
+ maxBitrate?: number;
39
+ initiator?: boolean;
40
+ }
41
+ export interface RecordingConfig {
42
+ mimeType?: string;
43
+ videoBitsPerSecond?: number;
44
+ audioBitsPerSecond?: number;
45
+ interval?: number;
46
+ recordingData?: RecordingData;
47
+ }
48
+ export interface TranscriptionConfig {
49
+ language?: string;
50
+ continuous?: boolean;
51
+ interimResults?: boolean;
52
+ sendInterval?: number;
53
+ }
54
+ export interface CallStatusResponse {
55
+ conversationId: string;
56
+ hasActiveCall: boolean;
57
+ participantCount: number;
58
+ maxParticipants: number;
59
+ participants: string[];
60
+ startedAt: Date | null;
61
+ canJoin: boolean;
62
+ status: "no_call" | "active" | "full" | "ending";
63
+ }
64
+ export interface SignalingEvents {
65
+ "call.start": (data: {
66
+ conversationId: string;
67
+ userId: string;
68
+ }) => void;
69
+ "call.join": (data: {
70
+ conversationId: string;
71
+ userId: string;
72
+ }) => void;
73
+ "call.leave": (data: {
74
+ conversationId: string;
75
+ userId: string;
76
+ }) => void;
77
+ "call.offer": (data: {
78
+ to: string;
79
+ from: string;
80
+ offer: RTCSessionDescriptionInit;
81
+ conversationId: string;
82
+ }) => void;
83
+ "call.answer": (data: {
84
+ to: string;
85
+ from: string;
86
+ answer: RTCSessionDescriptionInit;
87
+ conversationId: string;
88
+ }) => void;
89
+ "call.candidate": (data: {
90
+ to: string;
91
+ from: string;
92
+ candidate: RTCIceCandidateInit;
93
+ conversationId: string;
94
+ }) => void;
95
+ "call.state": (data: {
96
+ to?: string;
97
+ from: string;
98
+ state: Partial<CallParticipant>;
99
+ conversationId: string;
100
+ }) => void;
101
+ "call.end": (data: {
102
+ conversationId: string;
103
+ targetUserId?: string;
104
+ }) => void;
105
+ "call.status": (data: {
106
+ conversationId: string;
107
+ userId: string;
108
+ }) => void;
109
+ "call.recording.start": (data: {
110
+ conversationId: string;
111
+ recordingId: string;
112
+ }) => void;
113
+ "call.recording.chunk": (data: {
114
+ conversationId: string;
115
+ recordingId: string;
116
+ chunk: Blob;
117
+ }) => void;
118
+ "call.recording.end": (data: {
119
+ conversationId: string;
120
+ recordingId: string;
121
+ }) => void;
122
+ "call.transcript": (data: {
123
+ conversationId: string;
124
+ userId: string;
125
+ transcript: string;
126
+ timestamp: number;
127
+ }) => void;
128
+ }
129
+ export interface SignalingIncomingEvents {
130
+ "call.started": (data: {
131
+ conversationId: string;
132
+ userId: string;
133
+ success: boolean;
134
+ participants: string[];
135
+ }) => void;
136
+ "call.participant.joined": (data: {
137
+ userId: string;
138
+ participants: string[];
139
+ conversationId: string;
140
+ }) => void;
141
+ "call.participant.left": (data: {
142
+ userId: string;
143
+ participants: string[];
144
+ conversationId: string;
145
+ }) => void;
146
+ "call.participants": (data: {
147
+ participants: string[];
148
+ conversationId: string;
149
+ }) => void;
150
+ "call.left": (data: {
151
+ conversationId: string;
152
+ success: boolean;
153
+ }) => void;
154
+ "call.error": (data: {
155
+ error: string;
156
+ message: string;
157
+ }) => void;
158
+ "call.offer": (data: {
159
+ from: string;
160
+ offer: RTCSessionDescriptionInit;
161
+ conversationId: string;
162
+ }) => void;
163
+ "call.answer": (data: {
164
+ from: string;
165
+ answer: RTCSessionDescriptionInit;
166
+ conversationId: string;
167
+ }) => void;
168
+ "call.candidate": (data: {
169
+ from: string;
170
+ candidate: RTCIceCandidateInit;
171
+ conversationId: string;
172
+ }) => void;
173
+ "call.state": (data: {
174
+ from: string;
175
+ state: Partial<CallParticipant>;
176
+ conversationId: string;
177
+ }) => void;
178
+ "call.ended": (data: {
179
+ conversationId: string;
180
+ endedBy: string;
181
+ reason: string;
182
+ }) => void;
183
+ "call.status.changed": (data: CallStatusResponse) => void;
184
+ "call.recording.start": (data: {
185
+ recordingId: string;
186
+ conversationId: string;
187
+ }) => void;
188
+ "call.recording.chunk.received": (data: {
189
+ recordingId: string;
190
+ conversationId: string;
191
+ chunkSize: number;
192
+ timestamp: number;
193
+ }) => void;
194
+ "call.recording.end": (data: {
195
+ recordingId: string;
196
+ conversationId: string;
197
+ }) => void;
198
+ "call.transcript": (data: {
199
+ userId: string;
200
+ transcript: string;
201
+ timestamp: number;
202
+ conversationId: string;
203
+ }) => void;
204
+ }
205
+ export type PeersCallerError = "MEDIA_ACCESS_DENIED" | "PEER_CONNECTION_FAILED" | "SIGNALING_ERROR" | "RECORDING_FAILED" | "TRANSCRIPTION_FAILED" | "CALL_LIMIT_EXCEEDED" | "INVALID_CONVERSATION_ID" | "NETWORK_ERROR" | "UNKNOWN_ERROR";
206
+ export interface PeersCallerConfig {
207
+ conversationId: string;
208
+ userId: string;
209
+ token: string;
210
+ socketUrl: string;
211
+ socketPath?: string;
212
+ iceServers?: RTCIceServer[];
213
+ mediaConfig?: MediaStreamConfig;
214
+ recordingConfig?: RecordingConfig;
215
+ transcriptionConfig?: TranscriptionConfig;
216
+ maxParticipants?: number;
217
+ debug?: boolean;
218
+ }
219
+ export interface PeersCallerCallbacks {
220
+ onCallStarted?: (data: {
221
+ conversationId: string;
222
+ userId: string;
223
+ success: boolean;
224
+ participants: string[];
225
+ }) => void;
226
+ onCallEnded?: (data: {
227
+ conversationId: string;
228
+ endedBy: string;
229
+ reason: string;
230
+ }) => void;
231
+ onParticipantJoined?: (participant: CallParticipant) => void;
232
+ onParticipantLeft?: (userId: string) => void;
233
+ onParticipantStateChanged?: (userId: string, state: Partial<CallParticipant>) => void;
234
+ onStreamReceived?: (userId: string, stream: MediaStream) => void;
235
+ onCallStateChanged?: (state: CallState["callStatus"]) => void;
236
+ onCallStatusChanged?: (statusInfo: CallStatusResponse) => void;
237
+ onRecordingStateChanged?: (isRecording: boolean) => void;
238
+ onError?: (error: PeersCallerError, message: string) => void;
239
+ }
240
+ export type PeerConnection = SimplePeer.Instance;
241
+ export type SocketClient = Socket;
242
+ export type AllSignalingEvents = SignalingEvents & SignalingIncomingEvents;
243
+ export interface RecordingData {
244
+ id: string;
245
+ filename: string;
246
+ conversationId: string;
247
+ startTime: number;
248
+ }
249
+ export interface TranscriptData {
250
+ userId: string;
251
+ text: string;
252
+ timestamp: number;
253
+ isFinal: boolean;
254
+ }
255
+ export interface CallMetrics {
256
+ connectionCount: number;
257
+ activeStreams: number;
258
+ recordingSize: number;
259
+ transcriptCount: number;
260
+ bandwidthUsage: number;
261
+ }
262
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,KAAK,UAAU,MAAM,aAAa,CAAC;AAG1C,MAAM,WAAW,eAAe;IAC9B,IAAI,CAAC,EAAE,UAAU,CAAC,QAAQ,GAAG,IAAI,CAAC;IAClC,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,aAAa,EAAE,OAAO,CAAC;IACvB,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,YAAY,CAAC,EA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C/D,uBAAuB,CAAC,EAAE,CAAC,WAAW,EAAE,OAAO,KAAK,IAAI,CAAC;IACzD,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CAC9D;AAGD,MAAM,MAAM,cAAc,GAAG,UAAU,CAAC,QAAQ,CAAC;AACjD,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC;AAGlC,MAAM,MAAM,kBAAkB,GAAG,eAAe,GAAG,uBAAuB,CAAC;AAG3E,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;CACnB;AAGD,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,WAAW;IAC1B,eAAe,EAAE,MAAM,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,EAAE,MAAM,CAAC;IACxB,cAAc,EAAE,MAAM,CAAC;CACxB"}
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Utility functions for PeersCaller library
3
+ */
4
+ import type { PeersCallerError } from "../types";
5
+ /**
6
+ * Generate a unique ID for various purposes
7
+ */
8
+ export declare function generateId(prefix?: string): string;
9
+ /**
10
+ * Generates a unique peer ID
11
+ */
12
+ export declare const generatePeerId: () => string;
13
+ /**
14
+ * Validates a peer ID format
15
+ */
16
+ export declare const isValidPeerId: (peerId: string) => boolean;
17
+ /**
18
+ * Formats media constraints for getUserMedia
19
+ */
20
+ export declare const formatMediaConstraints: (options: {
21
+ video?: boolean | MediaTrackConstraints;
22
+ audio?: boolean | MediaTrackConstraints;
23
+ }) => MediaStreamConstraints;
24
+ /**
25
+ * Format error messages consistently
26
+ */
27
+ export declare function formatError(type: PeersCallerError, message: string, details?: any): Error;
28
+ /**
29
+ * Check if browser supports required WebRTC features
30
+ */
31
+ export declare function checkWebRTCSupport(): {
32
+ supported: boolean;
33
+ features: {
34
+ getUserMedia: boolean;
35
+ getDisplayMedia: boolean;
36
+ RTCPeerConnection: boolean;
37
+ MediaRecorder: boolean;
38
+ WebSocket: boolean;
39
+ };
40
+ missingFeatures: string[];
41
+ };
42
+ /**
43
+ * Checks if WebRTC is supported in the current browser
44
+ */
45
+ export declare const isWebRTCSupported: () => boolean;
46
+ /**
47
+ * Get optimal ICE servers configuration
48
+ */
49
+ export declare function getDefaultIceServers(): RTCIceServer[];
50
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAEjD;;GAEG;AACH,wBAAgB,UAAU,CAAC,MAAM,SAAK,GAAG,MAAM,CAI9C;AAED;;GAEG;AACH,eAAO,MAAM,cAAc,QAAO,MAEjC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,aAAa,GAAI,QAAQ,MAAM,KAAG,OAQ9C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,sBAAsB,GAAI,SAAS;IAC9C,KAAK,CAAC,EAAE,OAAO,GAAG,qBAAqB,CAAC;IACxC,KAAK,CAAC,EAAE,OAAO,GAAG,qBAAqB,CAAC;CACzC,KAAG,sBAKH,CAAC;AAEF;;GAEG;AACH,wBAAgB,WAAW,CACzB,IAAI,EAAE,gBAAgB,EACtB,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,GAAG,GACZ,KAAK,CASP;AAED;;GAEG;AACH,wBAAgB,kBAAkB,IAAI;IACpC,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE;QACR,YAAY,EAAE,OAAO,CAAC;QACtB,eAAe,EAAE,OAAO,CAAC;QACzB,iBAAiB,EAAE,OAAO,CAAC;QAC3B,aAAa,EAAE,OAAO,CAAC;QACvB,SAAS,EAAE,OAAO,CAAC;KACpB,CAAC;IACF,eAAe,EAAE,MAAM,EAAE,CAAC;CAC3B,CAsBA;AAED;;GAEG;AACH,eAAO,MAAM,iBAAiB,QAAO,OAYpC,CAAC;AAEF;;GAEG;AACH,wBAAgB,oBAAoB,IAAI,YAAY,EAAE,CAOrD"}