@veridid/webrtc 0.0.0-stage → 1.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.
- package/LICENSE +202 -0
- package/README.md +39 -2
- package/build/_virtual/_@oxc-project_runtime@0.112.0/helpers/decorate.mjs +10 -0
- package/build/_virtual/_@oxc-project_runtime@0.112.0/helpers/decorateMetadata.mjs +7 -0
- package/build/_virtual/_@oxc-project_runtime@0.112.0/helpers/decorateParam.mjs +9 -0
- package/build/index.d.mts +11 -0
- package/build/index.mjs +12 -0
- package/build/webrtc/WebRTCApi.d.mts +114 -0
- package/build/webrtc/WebRTCApi.d.mts.map +1 -0
- package/build/webrtc/WebRTCApi.mjs +161 -0
- package/build/webrtc/WebRTCApi.mjs.map +1 -0
- package/build/webrtc/WebRTCEvents.d.mts +115 -0
- package/build/webrtc/WebRTCEvents.d.mts.map +1 -0
- package/build/webrtc/WebRTCEvents.mjs +20 -0
- package/build/webrtc/WebRTCEvents.mjs.map +1 -0
- package/build/webrtc/WebRTCModule.d.mts +62 -0
- package/build/webrtc/WebRTCModule.d.mts.map +1 -0
- package/build/webrtc/WebRTCModule.mjs +51 -0
- package/build/webrtc/WebRTCModule.mjs.map +1 -0
- package/build/webrtc/handlers/AnswerHandler.mjs +23 -0
- package/build/webrtc/handlers/AnswerHandler.mjs.map +1 -0
- package/build/webrtc/handlers/EndHandler.mjs +23 -0
- package/build/webrtc/handlers/EndHandler.mjs.map +1 -0
- package/build/webrtc/handlers/IceHandler.mjs +23 -0
- package/build/webrtc/handlers/IceHandler.mjs.map +1 -0
- package/build/webrtc/handlers/OfferHandler.mjs +23 -0
- package/build/webrtc/handlers/OfferHandler.mjs.map +1 -0
- package/build/webrtc/handlers/ProposeHandler.mjs +23 -0
- package/build/webrtc/handlers/ProposeHandler.mjs.map +1 -0
- package/build/webrtc/handlers/RenegotiateHandler.mjs +23 -0
- package/build/webrtc/handlers/RenegotiateHandler.mjs.map +1 -0
- package/build/webrtc/handlers/index.mjs +6 -0
- package/build/webrtc/messages/AnswerMessage.d.mts +29 -0
- package/build/webrtc/messages/AnswerMessage.d.mts.map +1 -0
- package/build/webrtc/messages/AnswerMessage.mjs +44 -0
- package/build/webrtc/messages/AnswerMessage.mjs.map +1 -0
- package/build/webrtc/messages/EndMessage.d.mts +19 -0
- package/build/webrtc/messages/EndMessage.d.mts.map +1 -0
- package/build/webrtc/messages/EndMessage.mjs +31 -0
- package/build/webrtc/messages/EndMessage.mjs.map +1 -0
- package/build/webrtc/messages/IceMessage.d.mts +21 -0
- package/build/webrtc/messages/IceMessage.d.mts.map +1 -0
- package/build/webrtc/messages/IceMessage.mjs +38 -0
- package/build/webrtc/messages/IceMessage.mjs.map +1 -0
- package/build/webrtc/messages/OfferMessage.d.mts +55 -0
- package/build/webrtc/messages/OfferMessage.d.mts.map +1 -0
- package/build/webrtc/messages/OfferMessage.mjs +86 -0
- package/build/webrtc/messages/OfferMessage.mjs.map +1 -0
- package/build/webrtc/messages/ProposeMessage.d.mts +69 -0
- package/build/webrtc/messages/ProposeMessage.d.mts.map +1 -0
- package/build/webrtc/messages/ProposeMessage.mjs +76 -0
- package/build/webrtc/messages/ProposeMessage.mjs.map +1 -0
- package/build/webrtc/messages/RenegotiateMessage.d.mts +58 -0
- package/build/webrtc/messages/RenegotiateMessage.d.mts.map +1 -0
- package/build/webrtc/messages/RenegotiateMessage.mjs +56 -0
- package/build/webrtc/messages/RenegotiateMessage.mjs.map +1 -0
- package/build/webrtc/messages/index.d.mts +6 -0
- package/build/webrtc/messages/index.mjs +6 -0
- package/build/webrtc/repository/WebRTCCallRecord.d.mts +32 -0
- package/build/webrtc/repository/WebRTCCallRecord.d.mts.map +1 -0
- package/build/webrtc/repository/WebRTCCallRecord.mjs +31 -0
- package/build/webrtc/repository/WebRTCCallRecord.mjs.map +1 -0
- package/build/webrtc/repository/WebRTCCallRepository.d.mts +10 -0
- package/build/webrtc/repository/WebRTCCallRepository.d.mts.map +1 -0
- package/build/webrtc/repository/WebRTCCallRepository.mjs +23 -0
- package/build/webrtc/repository/WebRTCCallRepository.mjs.map +1 -0
- package/build/webrtc/services/WebRTCService.d.mts +93 -0
- package/build/webrtc/services/WebRTCService.d.mts.map +1 -0
- package/build/webrtc/services/WebRTCService.mjs +244 -0
- package/build/webrtc/services/WebRTCService.mjs.map +1 -0
- package/package.json +38 -3
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { IcePolicy } from "./messages/OfferMessage.mjs";
|
|
2
|
+
import { MediaType } from "./messages/ProposeMessage.mjs";
|
|
3
|
+
import { RenegotiateReason } from "./messages/RenegotiateMessage.mjs";
|
|
4
|
+
import { DidCommInboundMessageContext } from "@credo-ts/didcomm";
|
|
5
|
+
|
|
6
|
+
//#region src/webrtc/WebRTCEvents.d.ts
|
|
7
|
+
declare enum WebRTCEvents {
|
|
8
|
+
/** Incoming call proposal (before offer) */
|
|
9
|
+
IncomingPropose = "WebRTCEvents.IncomingPropose",
|
|
10
|
+
/** Incoming SDP offer */
|
|
11
|
+
IncomingOffer = "WebRTCEvents.IncomingOffer",
|
|
12
|
+
/** Incoming SDP answer */
|
|
13
|
+
IncomingAnswer = "WebRTCEvents.IncomingAnswer",
|
|
14
|
+
/** Incoming ICE candidate */
|
|
15
|
+
IncomingIce = "WebRTCEvents.IncomingIce",
|
|
16
|
+
/** Renegotiation requested (track changes, ICE restart) */
|
|
17
|
+
RenegotiateRequested = "WebRTCEvents.RenegotiateRequested",
|
|
18
|
+
/** Call ended */
|
|
19
|
+
CallEnded = "WebRTCEvents.CallEnded"
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* ICE server configuration in events
|
|
23
|
+
*/
|
|
24
|
+
interface IceServerEventConfig {
|
|
25
|
+
urls: string | string[];
|
|
26
|
+
username?: string;
|
|
27
|
+
credential?: string;
|
|
28
|
+
credentialType?: 'password' | 'oauth';
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Event emitted when a call proposal is received
|
|
32
|
+
*/
|
|
33
|
+
interface IncomingProposeEvent {
|
|
34
|
+
context: DidCommInboundMessageContext;
|
|
35
|
+
thid: string;
|
|
36
|
+
pthid?: string;
|
|
37
|
+
/** Requested media types */
|
|
38
|
+
media?: MediaType[];
|
|
39
|
+
/** Whether data channel is requested */
|
|
40
|
+
data?: boolean;
|
|
41
|
+
/** Topology: 'mesh' or 'sfu' */
|
|
42
|
+
topology?: 'mesh' | 'sfu';
|
|
43
|
+
/** Whether trickle ICE is supported */
|
|
44
|
+
trickle?: boolean;
|
|
45
|
+
/** ICE policy */
|
|
46
|
+
policy?: IcePolicy;
|
|
47
|
+
/** ICE servers for NAT traversal */
|
|
48
|
+
iceServers?: IceServerEventConfig[];
|
|
49
|
+
/** Optional reason/context */
|
|
50
|
+
reason?: string;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Event emitted when an SDP offer is received
|
|
54
|
+
*/
|
|
55
|
+
interface IncomingOfferEvent {
|
|
56
|
+
context: DidCommInboundMessageContext;
|
|
57
|
+
thid: string;
|
|
58
|
+
pthid?: string;
|
|
59
|
+
sdp: string;
|
|
60
|
+
/** ICE servers for NAT traversal */
|
|
61
|
+
iceServers?: IceServerEventConfig[];
|
|
62
|
+
/** ICE policy */
|
|
63
|
+
policy?: IcePolicy;
|
|
64
|
+
/** Whether trickle ICE is enabled */
|
|
65
|
+
trickle?: boolean;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Event emitted when an SDP answer is received
|
|
69
|
+
*/
|
|
70
|
+
interface IncomingAnswerEvent {
|
|
71
|
+
context: DidCommInboundMessageContext;
|
|
72
|
+
thid: string;
|
|
73
|
+
pthid?: string;
|
|
74
|
+
sdp: string;
|
|
75
|
+
/** Optional ICE servers from callee */
|
|
76
|
+
iceServers?: IceServerEventConfig[];
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Event emitted when an ICE candidate is received
|
|
80
|
+
*/
|
|
81
|
+
interface IncomingIceEvent {
|
|
82
|
+
context: DidCommInboundMessageContext;
|
|
83
|
+
thid: string;
|
|
84
|
+
pthid?: string;
|
|
85
|
+
candidate: Record<string, unknown>;
|
|
86
|
+
endOfCandidates?: boolean;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Event emitted when renegotiation is requested
|
|
90
|
+
*/
|
|
91
|
+
interface RenegotiateRequestedEvent {
|
|
92
|
+
context: DidCommInboundMessageContext;
|
|
93
|
+
thid: string;
|
|
94
|
+
pthid?: string;
|
|
95
|
+
/** Reason for renegotiation */
|
|
96
|
+
reason: RenegotiateReason | string;
|
|
97
|
+
/** Whether ICE restart is requested */
|
|
98
|
+
iceRestart?: boolean;
|
|
99
|
+
/** New ICE servers (if changed) */
|
|
100
|
+
iceServers?: IceServerEventConfig[];
|
|
101
|
+
/** Updated ICE policy */
|
|
102
|
+
policy?: IcePolicy;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Event emitted when a call ends
|
|
106
|
+
*/
|
|
107
|
+
interface CallEndedEvent {
|
|
108
|
+
context: DidCommInboundMessageContext;
|
|
109
|
+
thid: string;
|
|
110
|
+
pthid?: string;
|
|
111
|
+
reason?: string;
|
|
112
|
+
}
|
|
113
|
+
//#endregion
|
|
114
|
+
export { CallEndedEvent, IceServerEventConfig, IncomingAnswerEvent, IncomingIceEvent, IncomingOfferEvent, IncomingProposeEvent, RenegotiateRequestedEvent, WebRTCEvents };
|
|
115
|
+
//# sourceMappingURL=WebRTCEvents.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WebRTCEvents.d.mts","names":[],"sources":["../../src/webrtc/WebRTCEvents.ts"],"mappings":";;;;;;aAKY,YAAA;;EAEV,eAAA;EAFsB;EAItB,aAAA;EAJsB;EAMtB,cAAA;EAFA;EAIA,WAAA;EAAA;EAEA,oBAAA;EAEA;EAAA,SAAA;AAAA;AAMF;;;AAAA,UAAiB,oBAAA;EACf,IAAA;EACA,QAAA;EACA,UAAA;EACA,cAAA;AAAA;;AAMF;;UAAiB,oBAAA;EACf,OAAA,EAAS,4BAAA;EACT,IAAA;EACA,KAAA;EAYa;EAVb,KAAA,GAAQ,SAAA;EAUyB;EARjC,IAAA;EANS;EAQT,QAAA;EANA;EAQA,OAAA;EANQ;EAQR,MAAA,GAAS,SAAA;EAJT;EAMA,UAAA,GAAa,oBAAA;EAFb;EAIA,MAAA;AAAA;;;;UAMe,kBAAA;EACf,OAAA,EAAS,4BAAA;EACT,IAAA;EACA,KAAA;EACA,GAAA;EAEa;EAAb,UAAA,GAAa,oBAAA;EAEK;EAAlB,MAAA,GAAS,SAAA;EAPT;EASA,OAAA;AAAA;;;;UAMe,mBAAA;EACf,OAAA,EAAS,4BAAA;EACT,IAAA;EACA,KAAA;EACA,GAAA;EAVO;EAYP,UAAA,GAAa,oBAAA;AAAA;;;;UAME,gBAAA;EACf,OAAA,EAAS,4BAAA;EACT,IAAA;EACA,KAAA;EACA,SAAA,EAAW,MAAA;EACX,eAAA;AAAA;;AALF;;UAWiB,yBAAA;EACf,OAAA,EAAS,4BAAA;EACT,IAAA;EACA,KAAA;EAZA;EAcA,MAAA,EAAQ,iBAAA;EAZR;EAcA,UAAA;EAbA;EAeA,UAAA,GAAa,oBAAA;EAfE;EAiBf,MAAA,GAAS,SAAA;AAAA;;;;UAMM,cAAA;EACf,OAAA,EAAS,4BAAA;EACT,IAAA;EACA,KAAA;EACA,MAAA;AAAA"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
//#region src/webrtc/WebRTCEvents.ts
|
|
2
|
+
let WebRTCEvents = /* @__PURE__ */ function(WebRTCEvents) {
|
|
3
|
+
/** Incoming call proposal (before offer) */
|
|
4
|
+
WebRTCEvents["IncomingPropose"] = "WebRTCEvents.IncomingPropose";
|
|
5
|
+
/** Incoming SDP offer */
|
|
6
|
+
WebRTCEvents["IncomingOffer"] = "WebRTCEvents.IncomingOffer";
|
|
7
|
+
/** Incoming SDP answer */
|
|
8
|
+
WebRTCEvents["IncomingAnswer"] = "WebRTCEvents.IncomingAnswer";
|
|
9
|
+
/** Incoming ICE candidate */
|
|
10
|
+
WebRTCEvents["IncomingIce"] = "WebRTCEvents.IncomingIce";
|
|
11
|
+
/** Renegotiation requested (track changes, ICE restart) */
|
|
12
|
+
WebRTCEvents["RenegotiateRequested"] = "WebRTCEvents.RenegotiateRequested";
|
|
13
|
+
/** Call ended */
|
|
14
|
+
WebRTCEvents["CallEnded"] = "WebRTCEvents.CallEnded";
|
|
15
|
+
return WebRTCEvents;
|
|
16
|
+
}({});
|
|
17
|
+
|
|
18
|
+
//#endregion
|
|
19
|
+
export { WebRTCEvents };
|
|
20
|
+
//# sourceMappingURL=WebRTCEvents.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WebRTCEvents.mjs","names":[],"sources":["../../src/webrtc/WebRTCEvents.ts"],"sourcesContent":["import type { DidCommInboundMessageContext } from '@credo-ts/didcomm'\nimport type { IcePolicy } from './messages/OfferMessage'\nimport type { MediaType } from './messages/ProposeMessage'\nimport type { RenegotiateReason } from './messages/RenegotiateMessage'\n\nexport enum WebRTCEvents {\n /** Incoming call proposal (before offer) */\n IncomingPropose = 'WebRTCEvents.IncomingPropose',\n /** Incoming SDP offer */\n IncomingOffer = 'WebRTCEvents.IncomingOffer',\n /** Incoming SDP answer */\n IncomingAnswer = 'WebRTCEvents.IncomingAnswer',\n /** Incoming ICE candidate */\n IncomingIce = 'WebRTCEvents.IncomingIce',\n /** Renegotiation requested (track changes, ICE restart) */\n RenegotiateRequested = 'WebRTCEvents.RenegotiateRequested',\n /** Call ended */\n CallEnded = 'WebRTCEvents.CallEnded'\n}\n\n/**\n * ICE server configuration in events\n */\nexport interface IceServerEventConfig {\n urls: string | string[]\n username?: string\n credential?: string\n credentialType?: 'password' | 'oauth'\n}\n\n/**\n * Event emitted when a call proposal is received\n */\nexport interface IncomingProposeEvent {\n context: DidCommInboundMessageContext\n thid: string\n pthid?: string\n /** Requested media types */\n media?: MediaType[]\n /** Whether data channel is requested */\n data?: boolean\n /** Topology: 'mesh' or 'sfu' */\n topology?: 'mesh' | 'sfu'\n /** Whether trickle ICE is supported */\n trickle?: boolean\n /** ICE policy */\n policy?: IcePolicy\n /** ICE servers for NAT traversal */\n iceServers?: IceServerEventConfig[]\n /** Optional reason/context */\n reason?: string\n}\n\n/**\n * Event emitted when an SDP offer is received\n */\nexport interface IncomingOfferEvent {\n context: DidCommInboundMessageContext\n thid: string\n pthid?: string\n sdp: string\n /** ICE servers for NAT traversal */\n iceServers?: IceServerEventConfig[]\n /** ICE policy */\n policy?: IcePolicy\n /** Whether trickle ICE is enabled */\n trickle?: boolean\n}\n\n/**\n * Event emitted when an SDP answer is received\n */\nexport interface IncomingAnswerEvent {\n context: DidCommInboundMessageContext\n thid: string\n pthid?: string\n sdp: string\n /** Optional ICE servers from callee */\n iceServers?: IceServerEventConfig[]\n}\n\n/**\n * Event emitted when an ICE candidate is received\n */\nexport interface IncomingIceEvent {\n context: DidCommInboundMessageContext\n thid: string\n pthid?: string\n candidate: Record<string, unknown>\n endOfCandidates?: boolean\n}\n\n/**\n * Event emitted when renegotiation is requested\n */\nexport interface RenegotiateRequestedEvent {\n context: DidCommInboundMessageContext\n thid: string\n pthid?: string\n /** Reason for renegotiation */\n reason: RenegotiateReason | string\n /** Whether ICE restart is requested */\n iceRestart?: boolean\n /** New ICE servers (if changed) */\n iceServers?: IceServerEventConfig[]\n /** Updated ICE policy */\n policy?: IcePolicy\n}\n\n/**\n * Event emitted when a call ends\n */\nexport interface CallEndedEvent {\n context: DidCommInboundMessageContext\n thid: string\n pthid?: string\n reason?: string\n}\n"],"mappings":";AAKA,IAAY,sDAAL;;AAEL;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { IcePolicy } from "./messages/OfferMessage.mjs";
|
|
2
|
+
import { WebRTCApi } from "./WebRTCApi.mjs";
|
|
3
|
+
import { AgentContext, DependencyManager, Module } from "@credo-ts/core";
|
|
4
|
+
|
|
5
|
+
//#region src/webrtc/WebRTCModule.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* ICE server configuration for module-level defaults
|
|
8
|
+
*/
|
|
9
|
+
interface WebRTCIceServerConfig {
|
|
10
|
+
/** STUN/TURN server URL(s) */
|
|
11
|
+
urls: string | string[];
|
|
12
|
+
/** Username for TURN authentication */
|
|
13
|
+
username?: string;
|
|
14
|
+
/** Credential for TURN authentication */
|
|
15
|
+
credential?: string;
|
|
16
|
+
/** Credential type */
|
|
17
|
+
credentialType?: 'password' | 'oauth';
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Configuration options for WebRTCModule
|
|
21
|
+
*/
|
|
22
|
+
interface WebRTCModuleConfig {
|
|
23
|
+
/**
|
|
24
|
+
* Default ICE servers (STUN/TURN) to use for all calls
|
|
25
|
+
* These are used when no iceServers are provided in API calls
|
|
26
|
+
*
|
|
27
|
+
* Example:
|
|
28
|
+
* ```ts
|
|
29
|
+
* iceServers: [
|
|
30
|
+
* { urls: 'stun:stun.l.google.com:19302' },
|
|
31
|
+
* { urls: 'turn:turn.example.org:3478', username: 'user', credential: 'pass' }
|
|
32
|
+
* ]
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
iceServers?: WebRTCIceServerConfig[];
|
|
36
|
+
/**
|
|
37
|
+
* Default ICE policy for NAT traversal
|
|
38
|
+
* - 'all': Use all available candidates (default)
|
|
39
|
+
* - 'relay-preferred': Prefer relay candidates but allow others
|
|
40
|
+
* - 'relay-only': Only use relay (TURN) candidates - best for strict NAT/firewall
|
|
41
|
+
*/
|
|
42
|
+
defaultPolicy?: IcePolicy;
|
|
43
|
+
/**
|
|
44
|
+
* Whether to enable trickle ICE by default
|
|
45
|
+
* @default true
|
|
46
|
+
*/
|
|
47
|
+
defaultTrickle?: boolean;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Injection token for WebRTC module configuration
|
|
51
|
+
*/
|
|
52
|
+
declare const WebRTCModuleConfigToken: unique symbol;
|
|
53
|
+
declare class WebRTCModule implements Module {
|
|
54
|
+
readonly api: typeof WebRTCApi;
|
|
55
|
+
readonly config: WebRTCModuleConfig;
|
|
56
|
+
constructor(config?: WebRTCModuleConfig);
|
|
57
|
+
register(dependencyManager: DependencyManager): void;
|
|
58
|
+
initialize(agentContext: AgentContext): Promise<void>;
|
|
59
|
+
}
|
|
60
|
+
//#endregion
|
|
61
|
+
export { WebRTCIceServerConfig, WebRTCModule, WebRTCModuleConfig, WebRTCModuleConfigToken };
|
|
62
|
+
//# sourceMappingURL=WebRTCModule.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WebRTCModule.d.mts","names":[],"sources":["../../src/webrtc/WebRTCModule.ts"],"mappings":";;;;;;;AAaA;UAAiB,qBAAA;;EAEf,IAAA;EAAA;EAEA,QAAA;EAEA;EAAA,UAAA;EAEc;EAAd,cAAA;AAAA;;;;UAMe,kBAAA;EAaF;;;;;;AAoBf;;;;;AAEA;EAtBE,UAAA,GAAa,qBAAA;;;;;;;EAQb,aAAA,GAAgB,SAAA;EAcmB;;;;EARnC,cAAA;AAAA;;;;cAMW,uBAAA;AAAA,cAEA,YAAA,YAAwB,MAAA;EAAA,SACnB,GAAA,SAAG,SAAA;EAAA,SACH,MAAA,EAAQ,kBAAA;cAEL,MAAA,GAAQ,kBAAA;EAYpB,QAAA,CAAS,iBAAA,EAAmB,iBAAA;EAStB,UAAA,CAAW,YAAA,EAAc,YAAA,GAAe,OAAA;AAAA"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { WebRTCCallRepository } from "./repository/WebRTCCallRepository.mjs";
|
|
2
|
+
import { WebRTCService } from "./services/WebRTCService.mjs";
|
|
3
|
+
import { WebRTCApi } from "./WebRTCApi.mjs";
|
|
4
|
+
import { OfferHandler } from "./handlers/OfferHandler.mjs";
|
|
5
|
+
import { AnswerHandler } from "./handlers/AnswerHandler.mjs";
|
|
6
|
+
import { IceHandler } from "./handlers/IceHandler.mjs";
|
|
7
|
+
import { RenegotiateHandler } from "./handlers/RenegotiateHandler.mjs";
|
|
8
|
+
import { EndHandler } from "./handlers/EndHandler.mjs";
|
|
9
|
+
import { ProposeHandler } from "./handlers/ProposeHandler.mjs";
|
|
10
|
+
import "./handlers/index.mjs";
|
|
11
|
+
import { DidCommFeatureRegistry, DidCommMessageHandlerRegistry, DidCommProtocol } from "@credo-ts/didcomm";
|
|
12
|
+
|
|
13
|
+
//#region src/webrtc/WebRTCModule.ts
|
|
14
|
+
/**
|
|
15
|
+
* Injection token for WebRTC module configuration
|
|
16
|
+
*/
|
|
17
|
+
const WebRTCModuleConfigToken = Symbol("WebRTCModuleConfig");
|
|
18
|
+
var WebRTCModule = class {
|
|
19
|
+
constructor(config = {}) {
|
|
20
|
+
this.api = WebRTCApi;
|
|
21
|
+
this.config = {
|
|
22
|
+
iceServers: config.iceServers ?? [{ urls: "stun:stun.l.google.com:19302" }, { urls: "stun:stun1.l.google.com:19302" }],
|
|
23
|
+
defaultPolicy: config.defaultPolicy ?? "all",
|
|
24
|
+
defaultTrickle: config.defaultTrickle ?? true
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
register(dependencyManager) {
|
|
28
|
+
dependencyManager.registerInstance(WebRTCModuleConfigToken, this.config);
|
|
29
|
+
dependencyManager.registerSingleton(WebRTCService);
|
|
30
|
+
dependencyManager.registerSingleton(WebRTCCallRepository);
|
|
31
|
+
}
|
|
32
|
+
async initialize(agentContext) {
|
|
33
|
+
const featureRegistry = agentContext.dependencyManager.resolve(DidCommFeatureRegistry);
|
|
34
|
+
const messageHandlerRegistry = agentContext.dependencyManager.resolve(DidCommMessageHandlerRegistry);
|
|
35
|
+
const webrtcService = agentContext.dependencyManager.resolve(WebRTCService);
|
|
36
|
+
messageHandlerRegistry.registerMessageHandler(new OfferHandler(webrtcService));
|
|
37
|
+
messageHandlerRegistry.registerMessageHandler(new AnswerHandler(webrtcService));
|
|
38
|
+
messageHandlerRegistry.registerMessageHandler(new IceHandler(webrtcService));
|
|
39
|
+
messageHandlerRegistry.registerMessageHandler(new RenegotiateHandler(webrtcService));
|
|
40
|
+
messageHandlerRegistry.registerMessageHandler(new EndHandler(webrtcService));
|
|
41
|
+
messageHandlerRegistry.registerMessageHandler(new ProposeHandler(webrtcService));
|
|
42
|
+
featureRegistry.register(new DidCommProtocol({
|
|
43
|
+
id: "https://didcomm.org/webrtc/1.0",
|
|
44
|
+
roles: ["caller", "callee"]
|
|
45
|
+
}));
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
//#endregion
|
|
50
|
+
export { WebRTCModule, WebRTCModuleConfigToken };
|
|
51
|
+
//# sourceMappingURL=WebRTCModule.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WebRTCModule.mjs","names":[],"sources":["../../src/webrtc/WebRTCModule.ts"],"sourcesContent":["import type { AgentContext, DependencyManager, Module } from '@credo-ts/core'\n\nimport { DidCommFeatureRegistry, DidCommMessageHandlerRegistry, DidCommProtocol } from '@credo-ts/didcomm'\n\nimport { WebRTCApi } from './WebRTCApi'\nimport { WebRTCCallRepository } from './repository/WebRTCCallRepository'\nimport { WebRTCService } from './services/WebRTCService'\nimport { AnswerHandler, EndHandler, IceHandler, OfferHandler, ProposeHandler, RenegotiateHandler } from './handlers'\nimport type { IcePolicy } from './messages/OfferMessage'\n\n/**\n * ICE server configuration for module-level defaults\n */\nexport interface WebRTCIceServerConfig {\n /** STUN/TURN server URL(s) */\n urls: string | string[]\n /** Username for TURN authentication */\n username?: string\n /** Credential for TURN authentication */\n credential?: string\n /** Credential type */\n credentialType?: 'password' | 'oauth'\n}\n\n/**\n * Configuration options for WebRTCModule\n */\nexport interface WebRTCModuleConfig {\n /**\n * Default ICE servers (STUN/TURN) to use for all calls\n * These are used when no iceServers are provided in API calls\n *\n * Example:\n * ```ts\n * iceServers: [\n * { urls: 'stun:stun.l.google.com:19302' },\n * { urls: 'turn:turn.example.org:3478', username: 'user', credential: 'pass' }\n * ]\n * ```\n */\n iceServers?: WebRTCIceServerConfig[]\n\n /**\n * Default ICE policy for NAT traversal\n * - 'all': Use all available candidates (default)\n * - 'relay-preferred': Prefer relay candidates but allow others\n * - 'relay-only': Only use relay (TURN) candidates - best for strict NAT/firewall\n */\n defaultPolicy?: IcePolicy\n\n /**\n * Whether to enable trickle ICE by default\n * @default true\n */\n defaultTrickle?: boolean\n}\n\n/**\n * Injection token for WebRTC module configuration\n */\nexport const WebRTCModuleConfigToken = Symbol('WebRTCModuleConfig')\n\nexport class WebRTCModule implements Module {\n public readonly api = WebRTCApi\n public readonly config: WebRTCModuleConfig\n\n public constructor(config: WebRTCModuleConfig = {}) {\n this.config = {\n iceServers: config.iceServers ?? [\n // Default public STUN servers\n { urls: 'stun:stun.l.google.com:19302' },\n { urls: 'stun:stun1.l.google.com:19302' },\n ],\n defaultPolicy: config.defaultPolicy ?? 'all',\n defaultTrickle: config.defaultTrickle ?? true,\n }\n }\n\n public register(dependencyManager: DependencyManager) {\n // Register config for injection\n dependencyManager.registerInstance(WebRTCModuleConfigToken, this.config)\n\n // Services & Repo\n dependencyManager.registerSingleton(WebRTCService)\n dependencyManager.registerSingleton(WebRTCCallRepository)\n }\n\n public async initialize(agentContext: AgentContext): Promise<void> {\n const featureRegistry = agentContext.dependencyManager.resolve(DidCommFeatureRegistry)\n const messageHandlerRegistry = agentContext.dependencyManager.resolve(DidCommMessageHandlerRegistry)\n const webrtcService = agentContext.dependencyManager.resolve(WebRTCService)\n\n messageHandlerRegistry.registerMessageHandler(new OfferHandler(webrtcService))\n messageHandlerRegistry.registerMessageHandler(new AnswerHandler(webrtcService))\n messageHandlerRegistry.registerMessageHandler(new IceHandler(webrtcService))\n messageHandlerRegistry.registerMessageHandler(new RenegotiateHandler(webrtcService))\n messageHandlerRegistry.registerMessageHandler(new EndHandler(webrtcService))\n messageHandlerRegistry.registerMessageHandler(new ProposeHandler(webrtcService))\n\n // Feature Registry: advertise DIDComm protocol\n featureRegistry.register(\n new DidCommProtocol({\n id: 'https://didcomm.org/webrtc/1.0',\n roles: ['caller', 'callee'],\n })\n )\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;AA4DA,MAAa,0BAA0B,OAAO,qBAAqB;AAEnE,IAAa,eAAb,MAA4C;CAI1C,AAAO,YAAY,SAA6B,EAAE,EAAE;OAHpC,MAAM;AAIpB,OAAK,SAAS;GACZ,YAAY,OAAO,cAAc,CAE/B,EAAE,MAAM,gCAAgC,EACxC,EAAE,MAAM,iCAAiC,CAC1C;GACD,eAAe,OAAO,iBAAiB;GACvC,gBAAgB,OAAO,kBAAkB;GAC1C;;CAGH,AAAO,SAAS,mBAAsC;AAEpD,oBAAkB,iBAAiB,yBAAyB,KAAK,OAAO;AAGxE,oBAAkB,kBAAkB,cAAc;AAClD,oBAAkB,kBAAkB,qBAAqB;;CAG3D,MAAa,WAAW,cAA2C;EACjE,MAAM,kBAAkB,aAAa,kBAAkB,QAAQ,uBAAuB;EACtF,MAAM,yBAAyB,aAAa,kBAAkB,QAAQ,8BAA8B;EACpG,MAAM,gBAAgB,aAAa,kBAAkB,QAAQ,cAAc;AAE3E,yBAAuB,uBAAuB,IAAI,aAAa,cAAc,CAAC;AAC9E,yBAAuB,uBAAuB,IAAI,cAAc,cAAc,CAAC;AAC/E,yBAAuB,uBAAuB,IAAI,WAAW,cAAc,CAAC;AAC5E,yBAAuB,uBAAuB,IAAI,mBAAmB,cAAc,CAAC;AACpF,yBAAuB,uBAAuB,IAAI,WAAW,cAAc,CAAC;AAC5E,yBAAuB,uBAAuB,IAAI,eAAe,cAAc,CAAC;AAGhF,kBAAgB,SACd,IAAI,gBAAgB;GAClB,IAAI;GACJ,OAAO,CAAC,UAAU,SAAS;GAC5B,CAAC,CACH"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { __decorateMetadata } from "../../_virtual/_@oxc-project_runtime@0.112.0/helpers/decorateMetadata.mjs";
|
|
2
|
+
import { __decorate } from "../../_virtual/_@oxc-project_runtime@0.112.0/helpers/decorate.mjs";
|
|
3
|
+
import { AnswerMessage } from "../messages/AnswerMessage.mjs";
|
|
4
|
+
import "../messages/index.mjs";
|
|
5
|
+
import { WebRTCService } from "../services/WebRTCService.mjs";
|
|
6
|
+
import { injectable } from "tsyringe";
|
|
7
|
+
|
|
8
|
+
//#region src/webrtc/handlers/AnswerHandler.ts
|
|
9
|
+
var _ref;
|
|
10
|
+
let AnswerHandler = class AnswerHandler {
|
|
11
|
+
constructor(service) {
|
|
12
|
+
this.supportedMessages = [AnswerMessage];
|
|
13
|
+
this.service = service;
|
|
14
|
+
}
|
|
15
|
+
async handle(inbound) {
|
|
16
|
+
await this.service.processAnswer(inbound);
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
AnswerHandler = __decorate([injectable(), __decorateMetadata("design:paramtypes", [WebRTCService])], AnswerHandler);
|
|
20
|
+
|
|
21
|
+
//#endregion
|
|
22
|
+
export { AnswerHandler };
|
|
23
|
+
//# sourceMappingURL=AnswerHandler.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AnswerHandler.mjs","names":[],"sources":["../../../src/webrtc/handlers/AnswerHandler.ts"],"sourcesContent":["import type { DidCommMessageHandlerInboundMessage } from '@credo-ts/didcomm'\nimport type { DidCommMessageHandler } from '@credo-ts/didcomm'\n\nimport { AnswerMessage } from '../messages'\nimport { injectable } from 'tsyringe'\nimport { WebRTCService } from '../services/WebRTCService'\n\n@injectable()\nexport class AnswerHandler implements DidCommMessageHandler {\n public supportedMessages = [AnswerMessage]\n private service: WebRTCService\n\n public constructor(service: WebRTCService) {\n this.service = service\n }\n\n public async handle(inbound: DidCommMessageHandlerInboundMessage<AnswerHandler>) {\n await this.service.processAnswer(inbound)\n return undefined\n }\n}\n"],"mappings":";;;;;;;;;AAQO,0BAAM,cAA+C;CAI1D,AAAO,YAAY,SAAwB;OAHpC,oBAAoB,CAAC,cAAc;AAIxC,OAAK,UAAU;;CAGjB,MAAa,OAAO,SAA6D;AAC/E,QAAM,KAAK,QAAQ,cAAc,QAAQ;;;4BAV5C,YAAY"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { __decorateMetadata } from "../../_virtual/_@oxc-project_runtime@0.112.0/helpers/decorateMetadata.mjs";
|
|
2
|
+
import { __decorate } from "../../_virtual/_@oxc-project_runtime@0.112.0/helpers/decorate.mjs";
|
|
3
|
+
import { EndMessage } from "../messages/EndMessage.mjs";
|
|
4
|
+
import "../messages/index.mjs";
|
|
5
|
+
import { WebRTCService } from "../services/WebRTCService.mjs";
|
|
6
|
+
import { injectable } from "tsyringe";
|
|
7
|
+
|
|
8
|
+
//#region src/webrtc/handlers/EndHandler.ts
|
|
9
|
+
var _ref;
|
|
10
|
+
let EndHandler = class EndHandler {
|
|
11
|
+
constructor(service) {
|
|
12
|
+
this.supportedMessages = [EndMessage];
|
|
13
|
+
this.service = service;
|
|
14
|
+
}
|
|
15
|
+
async handle(inbound) {
|
|
16
|
+
await this.service.processEnd(inbound);
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
EndHandler = __decorate([injectable(), __decorateMetadata("design:paramtypes", [WebRTCService])], EndHandler);
|
|
20
|
+
|
|
21
|
+
//#endregion
|
|
22
|
+
export { EndHandler };
|
|
23
|
+
//# sourceMappingURL=EndHandler.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EndHandler.mjs","names":[],"sources":["../../../src/webrtc/handlers/EndHandler.ts"],"sourcesContent":["import type { DidCommMessageHandlerInboundMessage } from '@credo-ts/didcomm'\nimport type { DidCommMessageHandler } from '@credo-ts/didcomm'\n\nimport { EndMessage } from '../messages'\nimport { injectable } from 'tsyringe'\nimport { WebRTCService } from '../services/WebRTCService'\n\n@injectable()\nexport class EndHandler implements DidCommMessageHandler {\n public supportedMessages = [EndMessage]\n private service: WebRTCService\n\n public constructor(service: WebRTCService) {\n this.service = service\n }\n\n public async handle(inbound: DidCommMessageHandlerInboundMessage<EndHandler>) {\n await this.service.processEnd(inbound)\n return undefined\n }\n}\n"],"mappings":";;;;;;;;;AAQO,uBAAM,WAA4C;CAIvD,AAAO,YAAY,SAAwB;OAHpC,oBAAoB,CAAC,WAAW;AAIrC,OAAK,UAAU;;CAGjB,MAAa,OAAO,SAA0D;AAC5E,QAAM,KAAK,QAAQ,WAAW,QAAQ;;;yBAVzC,YAAY"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { __decorateMetadata } from "../../_virtual/_@oxc-project_runtime@0.112.0/helpers/decorateMetadata.mjs";
|
|
2
|
+
import { __decorate } from "../../_virtual/_@oxc-project_runtime@0.112.0/helpers/decorate.mjs";
|
|
3
|
+
import { IceMessage } from "../messages/IceMessage.mjs";
|
|
4
|
+
import "../messages/index.mjs";
|
|
5
|
+
import { WebRTCService } from "../services/WebRTCService.mjs";
|
|
6
|
+
import { injectable } from "tsyringe";
|
|
7
|
+
|
|
8
|
+
//#region src/webrtc/handlers/IceHandler.ts
|
|
9
|
+
var _ref;
|
|
10
|
+
let IceHandler = class IceHandler {
|
|
11
|
+
constructor(service) {
|
|
12
|
+
this.supportedMessages = [IceMessage];
|
|
13
|
+
this.service = service;
|
|
14
|
+
}
|
|
15
|
+
async handle(inbound) {
|
|
16
|
+
await this.service.processIce(inbound);
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
IceHandler = __decorate([injectable(), __decorateMetadata("design:paramtypes", [WebRTCService])], IceHandler);
|
|
20
|
+
|
|
21
|
+
//#endregion
|
|
22
|
+
export { IceHandler };
|
|
23
|
+
//# sourceMappingURL=IceHandler.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IceHandler.mjs","names":[],"sources":["../../../src/webrtc/handlers/IceHandler.ts"],"sourcesContent":["import type { DidCommMessageHandlerInboundMessage } from '@credo-ts/didcomm'\nimport type { DidCommMessageHandler } from '@credo-ts/didcomm'\n\nimport { IceMessage } from '../messages'\nimport { injectable } from 'tsyringe'\nimport { WebRTCService } from '../services/WebRTCService'\n\n@injectable()\nexport class IceHandler implements DidCommMessageHandler {\n public supportedMessages = [IceMessage]\n private service: WebRTCService\n\n public constructor(service: WebRTCService) {\n this.service = service\n }\n\n public async handle(inbound: DidCommMessageHandlerInboundMessage<IceHandler>) {\n await this.service.processIce(inbound)\n return undefined\n }\n}\n"],"mappings":";;;;;;;;;AAQO,uBAAM,WAA4C;CAIvD,AAAO,YAAY,SAAwB;OAHpC,oBAAoB,CAAC,WAAW;AAIrC,OAAK,UAAU;;CAGjB,MAAa,OAAO,SAA0D;AAC5E,QAAM,KAAK,QAAQ,WAAW,QAAQ;;;yBAVzC,YAAY"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { __decorateMetadata } from "../../_virtual/_@oxc-project_runtime@0.112.0/helpers/decorateMetadata.mjs";
|
|
2
|
+
import { __decorate } from "../../_virtual/_@oxc-project_runtime@0.112.0/helpers/decorate.mjs";
|
|
3
|
+
import { OfferMessage } from "../messages/OfferMessage.mjs";
|
|
4
|
+
import "../messages/index.mjs";
|
|
5
|
+
import { WebRTCService } from "../services/WebRTCService.mjs";
|
|
6
|
+
import { injectable } from "tsyringe";
|
|
7
|
+
|
|
8
|
+
//#region src/webrtc/handlers/OfferHandler.ts
|
|
9
|
+
var _ref;
|
|
10
|
+
let OfferHandler = class OfferHandler {
|
|
11
|
+
constructor(service) {
|
|
12
|
+
this.supportedMessages = [OfferMessage];
|
|
13
|
+
this.service = service;
|
|
14
|
+
}
|
|
15
|
+
async handle(inbound) {
|
|
16
|
+
await this.service.processOffer(inbound);
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
OfferHandler = __decorate([injectable(), __decorateMetadata("design:paramtypes", [WebRTCService])], OfferHandler);
|
|
20
|
+
|
|
21
|
+
//#endregion
|
|
22
|
+
export { OfferHandler };
|
|
23
|
+
//# sourceMappingURL=OfferHandler.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OfferHandler.mjs","names":[],"sources":["../../../src/webrtc/handlers/OfferHandler.ts"],"sourcesContent":["import type { DidCommMessageHandlerInboundMessage } from '@credo-ts/didcomm'\nimport type { DidCommMessageHandler } from '@credo-ts/didcomm'\n\nimport { OfferMessage } from '../messages'\nimport { injectable } from 'tsyringe'\nimport { WebRTCService } from '../services/WebRTCService'\n\n@injectable()\nexport class OfferHandler implements DidCommMessageHandler {\n public supportedMessages = [OfferMessage]\n private service: WebRTCService\n\n public constructor(service: WebRTCService) {\n this.service = service\n }\n\n public async handle(inbound: DidCommMessageHandlerInboundMessage<OfferHandler>) {\n await this.service.processOffer(inbound)\n return undefined\n }\n}\n"],"mappings":";;;;;;;;;AAQO,yBAAM,aAA8C;CAIzD,AAAO,YAAY,SAAwB;OAHpC,oBAAoB,CAAC,aAAa;AAIvC,OAAK,UAAU;;CAGjB,MAAa,OAAO,SAA4D;AAC9E,QAAM,KAAK,QAAQ,aAAa,QAAQ;;;2BAV3C,YAAY"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { __decorateMetadata } from "../../_virtual/_@oxc-project_runtime@0.112.0/helpers/decorateMetadata.mjs";
|
|
2
|
+
import { __decorate } from "../../_virtual/_@oxc-project_runtime@0.112.0/helpers/decorate.mjs";
|
|
3
|
+
import { ProposeMessage } from "../messages/ProposeMessage.mjs";
|
|
4
|
+
import "../messages/index.mjs";
|
|
5
|
+
import { WebRTCService } from "../services/WebRTCService.mjs";
|
|
6
|
+
import { injectable } from "tsyringe";
|
|
7
|
+
|
|
8
|
+
//#region src/webrtc/handlers/ProposeHandler.ts
|
|
9
|
+
var _ref;
|
|
10
|
+
let ProposeHandler = class ProposeHandler {
|
|
11
|
+
constructor(service) {
|
|
12
|
+
this.supportedMessages = [ProposeMessage];
|
|
13
|
+
this.service = service;
|
|
14
|
+
}
|
|
15
|
+
async handle(inbound) {
|
|
16
|
+
await this.service.processPropose(inbound);
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
ProposeHandler = __decorate([injectable(), __decorateMetadata("design:paramtypes", [WebRTCService])], ProposeHandler);
|
|
20
|
+
|
|
21
|
+
//#endregion
|
|
22
|
+
export { ProposeHandler };
|
|
23
|
+
//# sourceMappingURL=ProposeHandler.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProposeHandler.mjs","names":[],"sources":["../../../src/webrtc/handlers/ProposeHandler.ts"],"sourcesContent":["import type { DidCommMessageHandlerInboundMessage } from '@credo-ts/didcomm'\nimport type { DidCommMessageHandler } from '@credo-ts/didcomm'\n\nimport { ProposeMessage } from '../messages'\nimport { injectable } from 'tsyringe'\nimport { WebRTCService } from '../services/WebRTCService'\n\n@injectable()\nexport class ProposeHandler implements DidCommMessageHandler {\n public supportedMessages = [ProposeMessage]\n private service: WebRTCService\n\n public constructor(service: WebRTCService) {\n this.service = service\n }\n\n public async handle(inbound: DidCommMessageHandlerInboundMessage<ProposeHandler>) {\n await this.service.processPropose(inbound)\n return undefined\n }\n}\n"],"mappings":";;;;;;;;;AAQO,2BAAM,eAAgD;CAI3D,AAAO,YAAY,SAAwB;OAHpC,oBAAoB,CAAC,eAAe;AAIzC,OAAK,UAAU;;CAGjB,MAAa,OAAO,SAA8D;AAChF,QAAM,KAAK,QAAQ,eAAe,QAAQ;;;6BAV7C,YAAY"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { __decorateMetadata } from "../../_virtual/_@oxc-project_runtime@0.112.0/helpers/decorateMetadata.mjs";
|
|
2
|
+
import { __decorate } from "../../_virtual/_@oxc-project_runtime@0.112.0/helpers/decorate.mjs";
|
|
3
|
+
import { RenegotiateMessage } from "../messages/RenegotiateMessage.mjs";
|
|
4
|
+
import "../messages/index.mjs";
|
|
5
|
+
import { WebRTCService } from "../services/WebRTCService.mjs";
|
|
6
|
+
import { injectable } from "tsyringe";
|
|
7
|
+
|
|
8
|
+
//#region src/webrtc/handlers/RenegotiateHandler.ts
|
|
9
|
+
var _ref;
|
|
10
|
+
let RenegotiateHandler = class RenegotiateHandler {
|
|
11
|
+
constructor(service) {
|
|
12
|
+
this.supportedMessages = [RenegotiateMessage];
|
|
13
|
+
this.service = service;
|
|
14
|
+
}
|
|
15
|
+
async handle(inbound) {
|
|
16
|
+
await this.service.processRenegotiate(inbound);
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
RenegotiateHandler = __decorate([injectable(), __decorateMetadata("design:paramtypes", [WebRTCService])], RenegotiateHandler);
|
|
20
|
+
|
|
21
|
+
//#endregion
|
|
22
|
+
export { RenegotiateHandler };
|
|
23
|
+
//# sourceMappingURL=RenegotiateHandler.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RenegotiateHandler.mjs","names":[],"sources":["../../../src/webrtc/handlers/RenegotiateHandler.ts"],"sourcesContent":["import type { DidCommMessageHandlerInboundMessage } from '@credo-ts/didcomm'\nimport type { DidCommMessageHandler } from '@credo-ts/didcomm'\n\nimport { RenegotiateMessage } from '../messages'\nimport { injectable } from 'tsyringe'\nimport { WebRTCService } from '../services/WebRTCService'\n\n@injectable()\nexport class RenegotiateHandler implements DidCommMessageHandler {\n public supportedMessages = [RenegotiateMessage]\n private service: WebRTCService\n\n public constructor(service: WebRTCService) {\n this.service = service\n }\n\n public async handle(inbound: DidCommMessageHandlerInboundMessage<RenegotiateHandler>) {\n await this.service.processRenegotiate(inbound)\n return undefined\n }\n}\n"],"mappings":";;;;;;;;;AAQO,+BAAM,mBAAoD;CAI/D,AAAO,YAAY,SAAwB;OAHpC,oBAAoB,CAAC,mBAAmB;AAI7C,OAAK,UAAU;;CAGjB,MAAa,OAAO,SAAkE;AACpF,QAAM,KAAK,QAAQ,mBAAmB,QAAQ;;;iCAVjD,YAAY"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { OfferHandler } from "./OfferHandler.mjs";
|
|
2
|
+
import { AnswerHandler } from "./AnswerHandler.mjs";
|
|
3
|
+
import { IceHandler } from "./IceHandler.mjs";
|
|
4
|
+
import { RenegotiateHandler } from "./RenegotiateHandler.mjs";
|
|
5
|
+
import { EndHandler } from "./EndHandler.mjs";
|
|
6
|
+
import { ProposeHandler } from "./ProposeHandler.mjs";
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { IceServerConfig } from "./OfferMessage.mjs";
|
|
2
|
+
import * as _credo_ts_didcomm0 from "@credo-ts/didcomm";
|
|
3
|
+
import { DidCommMessage } from "@credo-ts/didcomm";
|
|
4
|
+
|
|
5
|
+
//#region src/webrtc/messages/AnswerMessage.d.ts
|
|
6
|
+
interface AnswerMessageOptions {
|
|
7
|
+
id?: string;
|
|
8
|
+
threadId: string;
|
|
9
|
+
parentThreadId?: string;
|
|
10
|
+
sdp: string;
|
|
11
|
+
/** Optional ICE servers from callee (e.g., if callee has better TURN access) */
|
|
12
|
+
iceServers?: IceServerConfig[];
|
|
13
|
+
jws?: Record<string, unknown>;
|
|
14
|
+
}
|
|
15
|
+
declare class AnswerMessage extends DidCommMessage {
|
|
16
|
+
constructor(options: AnswerMessageOptions);
|
|
17
|
+
readonly type: string;
|
|
18
|
+
static readonly type: _credo_ts_didcomm0.ParsedMessageType;
|
|
19
|
+
sdp: string;
|
|
20
|
+
/**
|
|
21
|
+
* Optional ICE servers from callee
|
|
22
|
+
* Useful when callee has access to different/better TURN servers
|
|
23
|
+
*/
|
|
24
|
+
iceServers?: IceServerConfig[];
|
|
25
|
+
jws?: Record<string, unknown>;
|
|
26
|
+
}
|
|
27
|
+
//#endregion
|
|
28
|
+
export { AnswerMessage, AnswerMessageOptions };
|
|
29
|
+
//# sourceMappingURL=AnswerMessage.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AnswerMessage.d.mts","names":[],"sources":["../../../src/webrtc/messages/AnswerMessage.ts"],"mappings":";;;;;UAMiB,oBAAA;EACf,EAAA;EACA,QAAA;EACA,cAAA;EACA,GAAA;;EAEA,UAAA,GAAa,eAAA;EACb,GAAA,GAAM,MAAA;AAAA;AAAA,cAGK,aAAA,SAAsB,cAAA;cACd,OAAA,EAAS,oBAAA;EAAA,SAYZ,IAAA;EAAA,gBACO,IAAA,EAbyB,kBAAA,CAarB,iBAAA;EAGpB,GAAA;EApBD;;;AAGR;EA2BS,UAAA,GAAa,eAAA;EAIb,GAAA,GAAM,MAAA;AAAA"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { __decorateMetadata } from "../../_virtual/_@oxc-project_runtime@0.112.0/helpers/decorateMetadata.mjs";
|
|
2
|
+
import { __decorate } from "../../_virtual/_@oxc-project_runtime@0.112.0/helpers/decorate.mjs";
|
|
3
|
+
import { IceServerConfig } from "./OfferMessage.mjs";
|
|
4
|
+
import { DidCommMessage, IsValidMessageType, parseMessageType } from "@credo-ts/didcomm";
|
|
5
|
+
import { IsArray, IsObject, IsOptional, IsString, ValidateNested } from "class-validator";
|
|
6
|
+
import { Type } from "class-transformer";
|
|
7
|
+
|
|
8
|
+
//#region src/webrtc/messages/AnswerMessage.ts
|
|
9
|
+
var _ref;
|
|
10
|
+
var AnswerMessage = class AnswerMessage extends DidCommMessage {
|
|
11
|
+
constructor(options) {
|
|
12
|
+
super();
|
|
13
|
+
this.type = AnswerMessage.type.messageTypeUri;
|
|
14
|
+
if (options) {
|
|
15
|
+
this.id = options.id ?? this.generateId();
|
|
16
|
+
this.sdp = options.sdp;
|
|
17
|
+
this.iceServers = options.iceServers;
|
|
18
|
+
this.jws = options.jws;
|
|
19
|
+
this.setThread({
|
|
20
|
+
threadId: options.threadId,
|
|
21
|
+
parentThreadId: options.parentThreadId
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
AnswerMessage.type = parseMessageType("https://didcomm.org/webrtc/1.0/answer");
|
|
27
|
+
__decorate([IsValidMessageType(AnswerMessage.type), __decorateMetadata("design:type", Object)], AnswerMessage.prototype, "type", void 0);
|
|
28
|
+
__decorate([IsString(), __decorateMetadata("design:type", String)], AnswerMessage.prototype, "sdp", void 0);
|
|
29
|
+
__decorate([
|
|
30
|
+
IsOptional(),
|
|
31
|
+
ValidateNested({ each: true }),
|
|
32
|
+
Type(() => IceServerConfig),
|
|
33
|
+
IsArray(),
|
|
34
|
+
__decorateMetadata("design:type", Array)
|
|
35
|
+
], AnswerMessage.prototype, "iceServers", void 0);
|
|
36
|
+
__decorate([
|
|
37
|
+
IsOptional(),
|
|
38
|
+
IsObject(),
|
|
39
|
+
__decorateMetadata("design:type", Object)
|
|
40
|
+
], AnswerMessage.prototype, "jws", void 0);
|
|
41
|
+
|
|
42
|
+
//#endregion
|
|
43
|
+
export { AnswerMessage };
|
|
44
|
+
//# sourceMappingURL=AnswerMessage.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AnswerMessage.mjs","names":[],"sources":["../../../src/webrtc/messages/AnswerMessage.ts"],"sourcesContent":["import { DidCommMessage, IsValidMessageType, parseMessageType } from '@credo-ts/didcomm'\nimport { IsArray, IsObject, IsOptional, IsString, ValidateNested } from 'class-validator'\nimport { Type } from 'class-transformer'\n\nimport { IceServerConfig } from './OfferMessage'\n\nexport interface AnswerMessageOptions {\n id?: string\n threadId: string\n parentThreadId?: string\n sdp: string\n /** Optional ICE servers from callee (e.g., if callee has better TURN access) */\n iceServers?: IceServerConfig[]\n jws?: Record<string, unknown>\n}\n\nexport class AnswerMessage extends DidCommMessage {\n public constructor(options: AnswerMessageOptions) {\n super()\n if (options) {\n this.id = options.id ?? this.generateId()\n this.sdp = options.sdp\n this.iceServers = options.iceServers\n this.jws = options.jws\n this.setThread({ threadId: options.threadId, parentThreadId: options.parentThreadId })\n }\n }\n\n @IsValidMessageType(AnswerMessage.type)\n public readonly type = AnswerMessage.type.messageTypeUri\n public static readonly type = parseMessageType('https://didcomm.org/webrtc/1.0/answer')\n\n @IsString()\n public sdp!: string\n\n /**\n * Optional ICE servers from callee\n * Useful when callee has access to different/better TURN servers\n */\n @IsOptional()\n @ValidateNested({ each: true })\n @Type(() => IceServerConfig)\n @IsArray()\n public iceServers?: IceServerConfig[]\n\n @IsOptional()\n @IsObject()\n public jws?: Record<string, unknown>\n}\n"],"mappings":";;;;;;;;;AAgBA,IAAa,gBAAb,MAAa,sBAAsB,eAAe;CAChD,AAAO,YAAY,SAA+B;AAChD,SAAO;OAWO,OAAO,cAAc,KAAK;AAVxC,MAAI,SAAS;AACX,QAAK,KAAK,QAAQ,MAAM,KAAK,YAAY;AACzC,QAAK,MAAM,QAAQ;AACnB,QAAK,aAAa,QAAQ;AAC1B,QAAK,MAAM,QAAQ;AACnB,QAAK,UAAU;IAAE,UAAU,QAAQ;IAAU,gBAAgB,QAAQ;IAAgB,CAAC;;;;cAMnE,OAAO,iBAAiB,wCAAwC;YAFtF,mBAAmB,cAAc,KAAK;YAItC,UAAU;;CAOV,YAAY;CACZ,eAAe,EAAE,MAAM,MAAM,CAAC;CAC9B,WAAW,gBAAgB;CAC3B,SAAS;;;;CAGT,YAAY;CACZ,UAAU"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as _credo_ts_didcomm0 from "@credo-ts/didcomm";
|
|
2
|
+
import { DidCommMessage } from "@credo-ts/didcomm";
|
|
3
|
+
|
|
4
|
+
//#region src/webrtc/messages/EndMessage.d.ts
|
|
5
|
+
interface EndMessageOptions {
|
|
6
|
+
id?: string;
|
|
7
|
+
threadId: string;
|
|
8
|
+
parentThreadId?: string;
|
|
9
|
+
reason?: string;
|
|
10
|
+
}
|
|
11
|
+
declare class EndMessage extends DidCommMessage {
|
|
12
|
+
constructor(options: EndMessageOptions);
|
|
13
|
+
readonly type: string;
|
|
14
|
+
static readonly type: _credo_ts_didcomm0.ParsedMessageType;
|
|
15
|
+
reason?: string;
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
export { EndMessage, EndMessageOptions };
|
|
19
|
+
//# sourceMappingURL=EndMessage.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EndMessage.d.mts","names":[],"sources":["../../../src/webrtc/messages/EndMessage.ts"],"mappings":";;;;UAGiB,iBAAA;EACf,EAAA;EACA,QAAA;EACA,cAAA;EACA,MAAA;AAAA;AAAA,cAGW,UAAA,SAAmB,cAAA;cACX,OAAA,EAAS,iBAAA;EAAA,SAUZ,IAAA;EAAA,gBACO,IAAA,EAXsB,kBAAA,CAWlB,iBAAA;EAIpB,MAAA;AAAA"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { __decorateMetadata } from "../../_virtual/_@oxc-project_runtime@0.112.0/helpers/decorateMetadata.mjs";
|
|
2
|
+
import { __decorate } from "../../_virtual/_@oxc-project_runtime@0.112.0/helpers/decorate.mjs";
|
|
3
|
+
import { DidCommMessage, IsValidMessageType, parseMessageType } from "@credo-ts/didcomm";
|
|
4
|
+
import { IsOptional, IsString } from "class-validator";
|
|
5
|
+
|
|
6
|
+
//#region src/webrtc/messages/EndMessage.ts
|
|
7
|
+
var EndMessage = class EndMessage extends DidCommMessage {
|
|
8
|
+
constructor(options) {
|
|
9
|
+
super();
|
|
10
|
+
this.type = EndMessage.type.messageTypeUri;
|
|
11
|
+
if (options) {
|
|
12
|
+
this.id = options.id ?? this.generateId();
|
|
13
|
+
this.reason = options.reason;
|
|
14
|
+
this.setThread({
|
|
15
|
+
threadId: options.threadId,
|
|
16
|
+
parentThreadId: options.parentThreadId
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
EndMessage.type = parseMessageType("https://didcomm.org/webrtc/1.0/end");
|
|
22
|
+
__decorate([IsValidMessageType(EndMessage.type), __decorateMetadata("design:type", Object)], EndMessage.prototype, "type", void 0);
|
|
23
|
+
__decorate([
|
|
24
|
+
IsOptional(),
|
|
25
|
+
IsString(),
|
|
26
|
+
__decorateMetadata("design:type", String)
|
|
27
|
+
], EndMessage.prototype, "reason", void 0);
|
|
28
|
+
|
|
29
|
+
//#endregion
|
|
30
|
+
export { EndMessage };
|
|
31
|
+
//# sourceMappingURL=EndMessage.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EndMessage.mjs","names":[],"sources":["../../../src/webrtc/messages/EndMessage.ts"],"sourcesContent":["import { DidCommMessage, IsValidMessageType, parseMessageType } from '@credo-ts/didcomm'\nimport { IsOptional, IsString } from 'class-validator'\n\nexport interface EndMessageOptions {\n id?: string\n threadId: string\n parentThreadId?: string\n reason?: string\n}\n\nexport class EndMessage extends DidCommMessage {\n public constructor(options: EndMessageOptions) {\n super()\n if (options) {\n this.id = options.id ?? this.generateId()\n this.reason = options.reason\n this.setThread({ threadId: options.threadId, parentThreadId: options.parentThreadId })\n }\n }\n\n @IsValidMessageType(EndMessage.type)\n public readonly type = EndMessage.type.messageTypeUri\n public static readonly type = parseMessageType('https://didcomm.org/webrtc/1.0/end')\n\n @IsOptional()\n @IsString()\n public reason?: string\n}\n"],"mappings":";;;;;;AAUA,IAAa,aAAb,MAAa,mBAAmB,eAAe;CAC7C,AAAO,YAAY,SAA4B;AAC7C,SAAO;OASO,OAAO,WAAW,KAAK;AARrC,MAAI,SAAS;AACX,QAAK,KAAK,QAAQ,MAAM,KAAK,YAAY;AACzC,QAAK,SAAS,QAAQ;AACtB,QAAK,UAAU;IAAE,UAAU,QAAQ;IAAU,gBAAgB,QAAQ;IAAgB,CAAC;;;;WAMnE,OAAO,iBAAiB,qCAAqC;YAFnF,mBAAmB,WAAW,KAAK;;CAInC,YAAY;CACZ,UAAU"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as _credo_ts_didcomm0 from "@credo-ts/didcomm";
|
|
2
|
+
import { DidCommMessage } from "@credo-ts/didcomm";
|
|
3
|
+
|
|
4
|
+
//#region src/webrtc/messages/IceMessage.d.ts
|
|
5
|
+
interface IceMessageOptions {
|
|
6
|
+
id?: string;
|
|
7
|
+
threadId: string;
|
|
8
|
+
parentThreadId?: string;
|
|
9
|
+
candidate?: Record<string, unknown>;
|
|
10
|
+
endOfCandidates?: boolean;
|
|
11
|
+
}
|
|
12
|
+
declare class IceMessage extends DidCommMessage {
|
|
13
|
+
constructor(options: IceMessageOptions);
|
|
14
|
+
readonly type: string;
|
|
15
|
+
static readonly type: _credo_ts_didcomm0.ParsedMessageType;
|
|
16
|
+
candidate?: Record<string, unknown>;
|
|
17
|
+
endOfCandidates?: boolean;
|
|
18
|
+
}
|
|
19
|
+
//#endregion
|
|
20
|
+
export { IceMessage, IceMessageOptions };
|
|
21
|
+
//# sourceMappingURL=IceMessage.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IceMessage.d.mts","names":[],"sources":["../../../src/webrtc/messages/IceMessage.ts"],"mappings":";;;;UAGiB,iBAAA;EACf,EAAA;EACA,QAAA;EACA,cAAA;EACA,SAAA,GAAY,MAAA;EACZ,eAAA;AAAA;AAAA,cAGW,UAAA,SAAmB,cAAA;cACX,OAAA,EAAS,iBAAA;EAAA,SAWZ,IAAA;EAAA,gBACO,IAAA,EAZsB,kBAAA,CAYlB,iBAAA;EAIpB,SAAA,GAAY,MAAA;EAIZ,eAAA;AAAA"}
|