@ajna-inc/webrtc 0.2.1 → 0.6.1
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/.npmvc/attestations.jsonld +32 -0
- package/build/_virtual/_@oxc-project_runtime@0.99.0/helpers/decorate.mjs +10 -0
- package/build/_virtual/_@oxc-project_runtime@0.99.0/helpers/decorateMetadata.mjs +7 -0
- package/build/_virtual/_@oxc-project_runtime@0.99.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 +131 -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 +63 -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 +56 -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 +70 -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 +59 -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 +19 -15
- package/README.md +0 -222
- package/build/index.d.ts +0 -8
- package/build/index.js +0 -29
- package/build/index.js.map +0 -1
- package/build/webrtc/WebRTCApi.d.ts +0 -125
- package/build/webrtc/WebRTCApi.js +0 -186
- package/build/webrtc/WebRTCApi.js.map +0 -1
- package/build/webrtc/WebRTCEvents.d.ts +0 -110
- package/build/webrtc/WebRTCEvents.js +0 -19
- package/build/webrtc/WebRTCEvents.js.map +0 -1
- package/build/webrtc/WebRTCModule.d.ts +0 -56
- package/build/webrtc/WebRTCModule.js +0 -40
- package/build/webrtc/WebRTCModule.js.map +0 -1
- package/build/webrtc/handlers/AnswerHandler.d.ts +0 -9
- package/build/webrtc/handlers/AnswerHandler.js +0 -31
- package/build/webrtc/handlers/AnswerHandler.js.map +0 -1
- package/build/webrtc/handlers/EndHandler.d.ts +0 -9
- package/build/webrtc/handlers/EndHandler.js +0 -31
- package/build/webrtc/handlers/EndHandler.js.map +0 -1
- package/build/webrtc/handlers/IceHandler.d.ts +0 -9
- package/build/webrtc/handlers/IceHandler.js +0 -31
- package/build/webrtc/handlers/IceHandler.js.map +0 -1
- package/build/webrtc/handlers/OfferHandler.d.ts +0 -9
- package/build/webrtc/handlers/OfferHandler.js +0 -31
- package/build/webrtc/handlers/OfferHandler.js.map +0 -1
- package/build/webrtc/handlers/ProposeHandler.d.ts +0 -9
- package/build/webrtc/handlers/ProposeHandler.js +0 -31
- package/build/webrtc/handlers/ProposeHandler.js.map +0 -1
- package/build/webrtc/handlers/RenegotiateHandler.d.ts +0 -9
- package/build/webrtc/handlers/RenegotiateHandler.js +0 -31
- package/build/webrtc/handlers/RenegotiateHandler.js.map +0 -1
- package/build/webrtc/handlers/index.d.ts +0 -6
- package/build/webrtc/handlers/index.js +0 -23
- package/build/webrtc/handlers/index.js.map +0 -1
- package/build/webrtc/messages/AnswerMessage.d.ts +0 -23
- package/build/webrtc/messages/AnswerMessage.js +0 -52
- package/build/webrtc/messages/AnswerMessage.js.map +0 -1
- package/build/webrtc/messages/EndMessage.d.ts +0 -13
- package/build/webrtc/messages/EndMessage.js +0 -37
- package/build/webrtc/messages/EndMessage.js.map +0 -1
- package/build/webrtc/messages/IceMessage.d.ts +0 -15
- package/build/webrtc/messages/IceMessage.js +0 -43
- package/build/webrtc/messages/IceMessage.js.map +0 -1
- package/build/webrtc/messages/OfferMessage.d.ts +0 -49
- package/build/webrtc/messages/OfferMessage.js +0 -102
- package/build/webrtc/messages/OfferMessage.js.map +0 -1
- package/build/webrtc/messages/ProposeMessage.d.ts +0 -63
- package/build/webrtc/messages/ProposeMessage.js +0 -84
- package/build/webrtc/messages/ProposeMessage.js.map +0 -1
- package/build/webrtc/messages/RenegotiateMessage.d.ts +0 -52
- package/build/webrtc/messages/RenegotiateMessage.js +0 -65
- package/build/webrtc/messages/RenegotiateMessage.js.map +0 -1
- package/build/webrtc/messages/index.d.ts +0 -6
- package/build/webrtc/messages/index.js +0 -23
- package/build/webrtc/messages/index.js.map +0 -1
- package/build/webrtc/repository/WebRTCCallRecord.d.ts +0 -29
- package/build/webrtc/repository/WebRTCCallRecord.js +0 -30
- package/build/webrtc/repository/WebRTCCallRecord.js.map +0 -1
- package/build/webrtc/repository/WebRTCCallRepository.d.ts +0 -5
- package/build/webrtc/repository/WebRTCCallRepository.js +0 -30
- package/build/webrtc/repository/WebRTCCallRepository.js.map +0 -1
- package/build/webrtc/services/WebRTCService.d.ts +0 -86
- package/build/webrtc/services/WebRTCService.js +0 -229
- package/build/webrtc/services/WebRTCService.js.map +0 -1
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { IcePolicy, IceServerConfig } from "./OfferMessage.mjs";
|
|
2
|
+
import * as _credo_ts_didcomm1 from "@credo-ts/didcomm";
|
|
3
|
+
import { DidCommMessage } from "@credo-ts/didcomm";
|
|
4
|
+
|
|
5
|
+
//#region src/webrtc/messages/ProposeMessage.d.ts
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Media types that can be requested in a call
|
|
9
|
+
*/
|
|
10
|
+
type MediaType = 'audio' | 'video';
|
|
11
|
+
interface ProposeMessageOptions {
|
|
12
|
+
id?: string;
|
|
13
|
+
threadId?: string;
|
|
14
|
+
parentThreadId?: string;
|
|
15
|
+
/** Requested media types */
|
|
16
|
+
media?: MediaType[];
|
|
17
|
+
/** Whether data channel is requested */
|
|
18
|
+
data?: boolean;
|
|
19
|
+
/** Topology hint: 'mesh' for P2P */
|
|
20
|
+
topology?: 'mesh' | 'sfu';
|
|
21
|
+
/** Whether trickle ICE is supported */
|
|
22
|
+
trickle?: boolean;
|
|
23
|
+
/** ICE policy for NAT traversal */
|
|
24
|
+
policy?: IcePolicy;
|
|
25
|
+
/** ICE servers (STUN/TURN) for NAT traversal */
|
|
26
|
+
iceServers?: IceServerConfig[];
|
|
27
|
+
/** Optional reason/context for the call */
|
|
28
|
+
reason?: string;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* ProposeMessage - Caller initiates a WebRTC session request
|
|
32
|
+
* This message is sent before the offer to negotiate capabilities and share ICE servers
|
|
33
|
+
*/
|
|
34
|
+
declare class ProposeMessage extends DidCommMessage {
|
|
35
|
+
constructor(options: ProposeMessageOptions);
|
|
36
|
+
readonly type: string;
|
|
37
|
+
static readonly type: _credo_ts_didcomm1.ParsedMessageType;
|
|
38
|
+
/**
|
|
39
|
+
* Requested media types: ['audio'], ['video'], or ['audio', 'video']
|
|
40
|
+
*/
|
|
41
|
+
media?: MediaType[];
|
|
42
|
+
/**
|
|
43
|
+
* Whether a data channel is requested
|
|
44
|
+
*/
|
|
45
|
+
data?: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Topology: 'mesh' for P2P, 'sfu' for server-mediated
|
|
48
|
+
*/
|
|
49
|
+
topology?: 'mesh' | 'sfu';
|
|
50
|
+
/**
|
|
51
|
+
* Whether trickle ICE is supported
|
|
52
|
+
*/
|
|
53
|
+
trickle?: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* ICE policy for NAT traversal
|
|
56
|
+
*/
|
|
57
|
+
policy?: IcePolicy;
|
|
58
|
+
/**
|
|
59
|
+
* ICE servers (STUN/TURN) for NAT traversal
|
|
60
|
+
* Shared early so callee can configure RTCPeerConnection before receiving offer
|
|
61
|
+
*/
|
|
62
|
+
iceServers?: IceServerConfig[];
|
|
63
|
+
/**
|
|
64
|
+
* Optional reason/context for the call
|
|
65
|
+
*/
|
|
66
|
+
reason?: string;
|
|
67
|
+
}
|
|
68
|
+
//#endregion
|
|
69
|
+
export { MediaType, ProposeMessage, ProposeMessageOptions };
|
|
70
|
+
//# sourceMappingURL=ProposeMessage.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProposeMessage.d.mts","names":[],"sources":["../../../src/webrtc/messages/ProposeMessage.ts"],"sourcesContent":[],"mappings":";;;;;;;;AAUA;AAEiB,KAFL,SAAA,GAEK,OAAqB,GAAA,OAAA;AAK5B,UALO,qBAAA,CAKP;EAQC,EAAA,CAAA,EAAA,MAAA;EAEI,QAAA,CAAA,EAAA,MAAA;EAAe,cAAA,CAAA,EAAA,MAAA;EASjB;EACiB,KAAA,CAAA,EApBpB,SAoBoB,EAAA;EAAqB;EA2BlC,IAAA,CAAA,EAAA,OAAA;EA4BC;EAUI,QAAA,CAAA,EAAA,MAAA,GAAA,KAAA;EAlEc;EAAc,OAAA,CAAA,EAAA,OAAA;;WAXvC;;eAEI;;;;;;;;cASF,cAAA,SAAuB,cAAA;uBACN;;wBAAqB,kBAAA,CAmBtB;;;;UAQZ;;;;;;;;;;;;;;;;WA4BC;;;;;eAUI"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { __decorateMetadata } from "../../_virtual/_@oxc-project_runtime@0.99.0/helpers/decorateMetadata.mjs";
|
|
2
|
+
import { __decorate } from "../../_virtual/_@oxc-project_runtime@0.99.0/helpers/decorate.mjs";
|
|
3
|
+
import { IceServerConfig } from "./OfferMessage.mjs";
|
|
4
|
+
import { DidCommMessage, IsValidMessageType, parseMessageType } from "@credo-ts/didcomm";
|
|
5
|
+
import { IsArray, IsBoolean, IsOptional, IsString, ValidateNested } from "class-validator";
|
|
6
|
+
import { Type } from "class-transformer";
|
|
7
|
+
|
|
8
|
+
//#region src/webrtc/messages/ProposeMessage.ts
|
|
9
|
+
/**
|
|
10
|
+
* ProposeMessage - Caller initiates a WebRTC session request
|
|
11
|
+
* This message is sent before the offer to negotiate capabilities and share ICE servers
|
|
12
|
+
*/
|
|
13
|
+
var ProposeMessage = class ProposeMessage extends DidCommMessage {
|
|
14
|
+
constructor(options) {
|
|
15
|
+
super();
|
|
16
|
+
this.type = ProposeMessage.type.messageTypeUri;
|
|
17
|
+
if (options) {
|
|
18
|
+
this.id = options.id ?? this.generateId();
|
|
19
|
+
this.media = options.media;
|
|
20
|
+
this.data = options.data;
|
|
21
|
+
this.topology = options.topology ?? "mesh";
|
|
22
|
+
this.trickle = options.trickle ?? true;
|
|
23
|
+
this.policy = options.policy;
|
|
24
|
+
this.iceServers = options.iceServers;
|
|
25
|
+
this.reason = options.reason;
|
|
26
|
+
if (options.threadId) this.setThread({
|
|
27
|
+
threadId: options.threadId,
|
|
28
|
+
parentThreadId: options.parentThreadId
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
ProposeMessage.type = parseMessageType("https://didcomm.org/webrtc/1.0/propose");
|
|
34
|
+
__decorate([IsValidMessageType(ProposeMessage.type), __decorateMetadata("design:type", Object)], ProposeMessage.prototype, "type", void 0);
|
|
35
|
+
__decorate([
|
|
36
|
+
IsOptional(),
|
|
37
|
+
IsArray(),
|
|
38
|
+
IsString({ each: true }),
|
|
39
|
+
__decorateMetadata("design:type", Array)
|
|
40
|
+
], ProposeMessage.prototype, "media", void 0);
|
|
41
|
+
__decorate([
|
|
42
|
+
IsOptional(),
|
|
43
|
+
IsBoolean(),
|
|
44
|
+
__decorateMetadata("design:type", Boolean)
|
|
45
|
+
], ProposeMessage.prototype, "data", void 0);
|
|
46
|
+
__decorate([
|
|
47
|
+
IsOptional(),
|
|
48
|
+
IsString(),
|
|
49
|
+
__decorateMetadata("design:type", String)
|
|
50
|
+
], ProposeMessage.prototype, "topology", void 0);
|
|
51
|
+
__decorate([
|
|
52
|
+
IsOptional(),
|
|
53
|
+
IsBoolean(),
|
|
54
|
+
__decorateMetadata("design:type", Boolean)
|
|
55
|
+
], ProposeMessage.prototype, "trickle", void 0);
|
|
56
|
+
__decorate([
|
|
57
|
+
IsOptional(),
|
|
58
|
+
IsString(),
|
|
59
|
+
__decorateMetadata("design:type", Object)
|
|
60
|
+
], ProposeMessage.prototype, "policy", void 0);
|
|
61
|
+
__decorate([
|
|
62
|
+
IsOptional(),
|
|
63
|
+
ValidateNested({ each: true }),
|
|
64
|
+
Type(() => IceServerConfig),
|
|
65
|
+
IsArray(),
|
|
66
|
+
__decorateMetadata("design:type", Array)
|
|
67
|
+
], ProposeMessage.prototype, "iceServers", void 0);
|
|
68
|
+
__decorate([
|
|
69
|
+
IsOptional(),
|
|
70
|
+
IsString(),
|
|
71
|
+
__decorateMetadata("design:type", String)
|
|
72
|
+
], ProposeMessage.prototype, "reason", void 0);
|
|
73
|
+
|
|
74
|
+
//#endregion
|
|
75
|
+
export { ProposeMessage };
|
|
76
|
+
//# sourceMappingURL=ProposeMessage.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProposeMessage.mjs","names":[],"sources":["../../../src/webrtc/messages/ProposeMessage.ts"],"sourcesContent":["import { DidCommMessage, IsValidMessageType, parseMessageType } from '@credo-ts/didcomm'\nimport { IsArray, IsBoolean, IsOptional, IsString, ValidateNested } from 'class-validator'\nimport { Type } from 'class-transformer'\n\nimport type { IcePolicy } from './OfferMessage'\nimport { IceServerConfig } from './OfferMessage'\n\n/**\n * Media types that can be requested in a call\n */\nexport type MediaType = 'audio' | 'video'\n\nexport interface ProposeMessageOptions {\n id?: string\n threadId?: string\n parentThreadId?: string\n /** Requested media types */\n media?: MediaType[]\n /** Whether data channel is requested */\n data?: boolean\n /** Topology hint: 'mesh' for P2P */\n topology?: 'mesh' | 'sfu'\n /** Whether trickle ICE is supported */\n trickle?: boolean\n /** ICE policy for NAT traversal */\n policy?: IcePolicy\n /** ICE servers (STUN/TURN) for NAT traversal */\n iceServers?: IceServerConfig[]\n /** Optional reason/context for the call */\n reason?: string\n}\n\n/**\n * ProposeMessage - Caller initiates a WebRTC session request\n * This message is sent before the offer to negotiate capabilities and share ICE servers\n */\nexport class ProposeMessage extends DidCommMessage {\n public constructor(options: ProposeMessageOptions) {\n super()\n if (options) {\n this.id = options.id ?? this.generateId()\n this.media = options.media\n this.data = options.data\n this.topology = options.topology ?? 'mesh'\n this.trickle = options.trickle ?? true\n this.policy = options.policy\n this.iceServers = options.iceServers\n this.reason = options.reason\n if (options.threadId) {\n this.setThread({ threadId: options.threadId, parentThreadId: options.parentThreadId })\n }\n }\n }\n\n @IsValidMessageType(ProposeMessage.type)\n public readonly type = ProposeMessage.type.messageTypeUri\n public static readonly type = parseMessageType('https://didcomm.org/webrtc/1.0/propose')\n\n /**\n * Requested media types: ['audio'], ['video'], or ['audio', 'video']\n */\n @IsOptional()\n @IsArray()\n @IsString({ each: true })\n public media?: MediaType[]\n\n /**\n * Whether a data channel is requested\n */\n @IsOptional()\n @IsBoolean()\n public data?: boolean\n\n /**\n * Topology: 'mesh' for P2P, 'sfu' for server-mediated\n */\n @IsOptional()\n @IsString()\n public topology?: 'mesh' | 'sfu'\n\n /**\n * Whether trickle ICE is supported\n */\n @IsOptional()\n @IsBoolean()\n public trickle?: boolean\n\n /**\n * ICE policy for NAT traversal\n */\n @IsOptional()\n @IsString()\n public policy?: IcePolicy\n\n /**\n * ICE servers (STUN/TURN) for NAT traversal\n * Shared early so callee can configure RTCPeerConnection before receiving offer\n */\n @IsOptional()\n @ValidateNested({ each: true })\n @Type(() => IceServerConfig)\n @IsArray()\n public iceServers?: IceServerConfig[]\n\n /**\n * Optional reason/context for the call\n */\n @IsOptional()\n @IsString()\n public reason?: string\n}\n\n"],"mappings":";;;;;;;;;;;;AAoCA,IAAa,iBAAb,MAAa,uBAAuB,eAAe;CACjD,AAAO,YAAY,SAAgC;AACjD,SAAO;OAiBO,OAAO,eAAe,KAAK;AAhBzC,MAAI,SAAS;AACX,QAAK,KAAK,QAAQ,MAAM,KAAK,YAAY;AACzC,QAAK,QAAQ,QAAQ;AACrB,QAAK,OAAO,QAAQ;AACpB,QAAK,WAAW,QAAQ,YAAY;AACpC,QAAK,UAAU,QAAQ,WAAW;AAClC,QAAK,SAAS,QAAQ;AACtB,QAAK,aAAa,QAAQ;AAC1B,QAAK,SAAS,QAAQ;AACtB,OAAI,QAAQ,SACV,MAAK,UAAU;IAAE,UAAU,QAAQ;IAAU,gBAAgB,QAAQ;IAAgB,CAAC;;;;eAOrE,OAAO,iBAAiB,yCAAyC;YAFvF,mBAAmB,eAAe,KAAK;;CAOvC,YAAY;CACZ,SAAS;CACT,SAAS,EAAE,MAAM,MAAM,CAAC;;;;CAMxB,YAAY;CACZ,WAAW;;;;CAMX,YAAY;CACZ,UAAU;;;;CAMV,YAAY;CACZ,WAAW;;;;CAMX,YAAY;CACZ,UAAU;;;;CAOV,YAAY;CACZ,eAAe,EAAE,MAAM,MAAM,CAAC;CAC9B,WAAW,gBAAgB;CAC3B,SAAS;;;;CAMT,YAAY;CACZ,UAAU"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { IcePolicy, 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/RenegotiateMessage.d.ts
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Reasons for renegotiation
|
|
9
|
+
*/
|
|
10
|
+
type RenegotiateReason = 'add-track' | 'remove-track' | 'add-screenshare' | 'remove-screenshare' | 'ice-restart' | 'codec-change' | 'bandwidth-change' | 'other';
|
|
11
|
+
interface RenegotiateMessageOptions {
|
|
12
|
+
id?: string;
|
|
13
|
+
threadId: string;
|
|
14
|
+
parentThreadId?: string;
|
|
15
|
+
/** Reason for renegotiation */
|
|
16
|
+
reason: RenegotiateReason | string;
|
|
17
|
+
/** Whether to perform an ICE restart (required for recovering failed connections) */
|
|
18
|
+
iceRestart?: boolean;
|
|
19
|
+
/** New ICE servers to use (useful when switching networks) */
|
|
20
|
+
iceServers?: IceServerConfig[];
|
|
21
|
+
/** Updated ICE policy */
|
|
22
|
+
policy?: IcePolicy;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* RenegotiateMessage - Request to renegotiate the WebRTC session
|
|
26
|
+
* Used for:
|
|
27
|
+
* - Adding/removing media tracks (screenshare, camera switch)
|
|
28
|
+
* - ICE restart when connection fails (critical for NAT/firewall recovery)
|
|
29
|
+
* - Changing codecs or bandwidth constraints
|
|
30
|
+
*/
|
|
31
|
+
declare class RenegotiateMessage extends DidCommMessage {
|
|
32
|
+
constructor(options: RenegotiateMessageOptions);
|
|
33
|
+
readonly type: string;
|
|
34
|
+
static readonly type: _credo_ts_didcomm0.ParsedMessageType;
|
|
35
|
+
/**
|
|
36
|
+
* Reason for renegotiation
|
|
37
|
+
*/
|
|
38
|
+
reason: RenegotiateReason | string;
|
|
39
|
+
/**
|
|
40
|
+
* Whether to perform an ICE restart
|
|
41
|
+
* Set to true when:
|
|
42
|
+
* - ICE connection state is 'failed' or 'disconnected'
|
|
43
|
+
* - Network change detected (WiFi to cellular, etc.)
|
|
44
|
+
* - NAT binding expired
|
|
45
|
+
*/
|
|
46
|
+
iceRestart?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* New ICE servers to use
|
|
49
|
+
* Useful when switching networks or when original servers are unreachable
|
|
50
|
+
*/
|
|
51
|
+
iceServers?: IceServerConfig[];
|
|
52
|
+
/**
|
|
53
|
+
* Updated ICE policy
|
|
54
|
+
*/
|
|
55
|
+
policy?: IcePolicy;
|
|
56
|
+
}
|
|
57
|
+
//#endregion
|
|
58
|
+
export { RenegotiateMessage, RenegotiateMessageOptions, RenegotiateReason };
|
|
59
|
+
//# sourceMappingURL=RenegotiateMessage.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RenegotiateMessage.d.mts","names":[],"sources":["../../../src/webrtc/messages/RenegotiateMessage.ts"],"sourcesContent":[],"mappings":";;;;;;;;AAUA;AAUiB,KAVL,iBAAA,GAU8B,WAAA,GAAA,cAAA,GAAA,iBAAA,GAAA,oBAAA,GAAA,aAAA,GAAA,cAAA,GAAA,kBAAA,GAAA,OAAA;AAKhC,UALO,yBAAA,CAKP;EAIK,EAAA,CAAA,EAAA,MAAA;EAEJ,QAAA,EAAA,MAAA;EAAS,cAAA,CAAA,EAAA,MAAA;EAUP;EACiB,MAAA,EAjBpB,iBAiBoB,GAAA,MAAA;EAAyB;EAoBrC,UAAA,CAAA,EAAA,OAAA;EAqBI;EAOJ,UAAA,CAAA,EA7DH,eA6DG,EAAA;EAjDsB;EAAc,MAAA,CAAA,EAV3C,SAU2C;;;;;;;;;cAAzC,kBAAA,SAA2B,cAAA;uBACV;;wBAAyB,kBAAA,CAc1B;;;;UAMX;;;;;;;;;;;;;eAqBI;;;;WAOJ"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { __decorateMetadata } from "../../_virtual/_@oxc-project_runtime@0.99.0/helpers/decorateMetadata.mjs";
|
|
2
|
+
import { __decorate } from "../../_virtual/_@oxc-project_runtime@0.99.0/helpers/decorate.mjs";
|
|
3
|
+
import { IceServerConfig } from "./OfferMessage.mjs";
|
|
4
|
+
import { DidCommMessage, IsValidMessageType, parseMessageType } from "@credo-ts/didcomm";
|
|
5
|
+
import { IsArray, IsBoolean, IsOptional, IsString, ValidateNested } from "class-validator";
|
|
6
|
+
import { Type } from "class-transformer";
|
|
7
|
+
|
|
8
|
+
//#region src/webrtc/messages/RenegotiateMessage.ts
|
|
9
|
+
/**
|
|
10
|
+
* RenegotiateMessage - Request to renegotiate the WebRTC session
|
|
11
|
+
* Used for:
|
|
12
|
+
* - Adding/removing media tracks (screenshare, camera switch)
|
|
13
|
+
* - ICE restart when connection fails (critical for NAT/firewall recovery)
|
|
14
|
+
* - Changing codecs or bandwidth constraints
|
|
15
|
+
*/
|
|
16
|
+
var RenegotiateMessage = class RenegotiateMessage extends DidCommMessage {
|
|
17
|
+
constructor(options) {
|
|
18
|
+
super();
|
|
19
|
+
this.type = RenegotiateMessage.type.messageTypeUri;
|
|
20
|
+
if (options) {
|
|
21
|
+
this.id = options.id ?? this.generateId();
|
|
22
|
+
this.reason = options.reason;
|
|
23
|
+
this.iceRestart = options.iceRestart ?? false;
|
|
24
|
+
this.iceServers = options.iceServers;
|
|
25
|
+
this.policy = options.policy;
|
|
26
|
+
this.setThread({
|
|
27
|
+
threadId: options.threadId,
|
|
28
|
+
parentThreadId: options.parentThreadId
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
RenegotiateMessage.type = parseMessageType("https://didcomm.org/webrtc/1.0/renegotiate");
|
|
34
|
+
__decorate([IsValidMessageType(RenegotiateMessage.type), __decorateMetadata("design:type", Object)], RenegotiateMessage.prototype, "type", void 0);
|
|
35
|
+
__decorate([IsString(), __decorateMetadata("design:type", Object)], RenegotiateMessage.prototype, "reason", void 0);
|
|
36
|
+
__decorate([
|
|
37
|
+
IsOptional(),
|
|
38
|
+
IsBoolean(),
|
|
39
|
+
__decorateMetadata("design:type", Boolean)
|
|
40
|
+
], RenegotiateMessage.prototype, "iceRestart", void 0);
|
|
41
|
+
__decorate([
|
|
42
|
+
IsOptional(),
|
|
43
|
+
ValidateNested({ each: true }),
|
|
44
|
+
Type(() => IceServerConfig),
|
|
45
|
+
IsArray(),
|
|
46
|
+
__decorateMetadata("design:type", Array)
|
|
47
|
+
], RenegotiateMessage.prototype, "iceServers", void 0);
|
|
48
|
+
__decorate([
|
|
49
|
+
IsOptional(),
|
|
50
|
+
IsString(),
|
|
51
|
+
__decorateMetadata("design:type", Object)
|
|
52
|
+
], RenegotiateMessage.prototype, "policy", void 0);
|
|
53
|
+
|
|
54
|
+
//#endregion
|
|
55
|
+
export { RenegotiateMessage };
|
|
56
|
+
//# sourceMappingURL=RenegotiateMessage.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RenegotiateMessage.mjs","names":[],"sources":["../../../src/webrtc/messages/RenegotiateMessage.ts"],"sourcesContent":["import { DidCommMessage, IsValidMessageType, parseMessageType } from '@credo-ts/didcomm'\nimport { IsArray, IsBoolean, IsOptional, IsString, ValidateNested } from 'class-validator'\nimport { Type } from 'class-transformer'\n\nimport type { IcePolicy } from './OfferMessage'\nimport { IceServerConfig } from './OfferMessage'\n\n/**\n * Reasons for renegotiation\n */\nexport type RenegotiateReason =\n | 'add-track'\n | 'remove-track'\n | 'add-screenshare'\n | 'remove-screenshare'\n | 'ice-restart'\n | 'codec-change'\n | 'bandwidth-change'\n | 'other'\n\nexport interface RenegotiateMessageOptions {\n id?: string\n threadId: string\n parentThreadId?: string\n /** Reason for renegotiation */\n reason: RenegotiateReason | string\n /** Whether to perform an ICE restart (required for recovering failed connections) */\n iceRestart?: boolean\n /** New ICE servers to use (useful when switching networks) */\n iceServers?: IceServerConfig[]\n /** Updated ICE policy */\n policy?: IcePolicy\n}\n\n/**\n * RenegotiateMessage - Request to renegotiate the WebRTC session\n * Used for:\n * - Adding/removing media tracks (screenshare, camera switch)\n * - ICE restart when connection fails (critical for NAT/firewall recovery)\n * - Changing codecs or bandwidth constraints\n */\nexport class RenegotiateMessage extends DidCommMessage {\n public constructor(options: RenegotiateMessageOptions) {\n super()\n if (options) {\n this.id = options.id ?? this.generateId()\n this.reason = options.reason\n this.iceRestart = options.iceRestart ?? false\n this.iceServers = options.iceServers\n this.policy = options.policy\n this.setThread({ threadId: options.threadId, parentThreadId: options.parentThreadId })\n }\n }\n\n @IsValidMessageType(RenegotiateMessage.type)\n public readonly type = RenegotiateMessage.type.messageTypeUri\n public static readonly type = parseMessageType('https://didcomm.org/webrtc/1.0/renegotiate')\n\n /**\n * Reason for renegotiation\n */\n @IsString()\n public reason!: RenegotiateReason | string\n\n /**\n * Whether to perform an ICE restart\n * Set to true when:\n * - ICE connection state is 'failed' or 'disconnected'\n * - Network change detected (WiFi to cellular, etc.)\n * - NAT binding expired\n */\n @IsOptional()\n @IsBoolean()\n public iceRestart?: boolean\n\n /**\n * New ICE servers to use\n * Useful when switching networks or when original servers are unreachable\n */\n @IsOptional()\n @ValidateNested({ each: true })\n @Type(() => IceServerConfig)\n @IsArray()\n public iceServers?: IceServerConfig[]\n\n /**\n * Updated ICE policy\n */\n @IsOptional()\n @IsString()\n public policy?: IcePolicy\n}\n"],"mappings":";;;;;;;;;;;;;;;AAyCA,IAAa,qBAAb,MAAa,2BAA2B,eAAe;CACrD,AAAO,YAAY,SAAoC;AACrD,SAAO;OAYO,OAAO,mBAAmB,KAAK;AAX7C,MAAI,SAAS;AACX,QAAK,KAAK,QAAQ,MAAM,KAAK,YAAY;AACzC,QAAK,SAAS,QAAQ;AACtB,QAAK,aAAa,QAAQ,cAAc;AACxC,QAAK,aAAa,QAAQ;AAC1B,QAAK,SAAS,QAAQ;AACtB,QAAK,UAAU;IAAE,UAAU,QAAQ;IAAU,gBAAgB,QAAQ;IAAgB,CAAC;;;;mBAMnE,OAAO,iBAAiB,6CAA6C;YAF3F,mBAAmB,mBAAmB,KAAK;YAO3C,UAAU;;CAUV,YAAY;CACZ,WAAW;;;;CAOX,YAAY;CACZ,eAAe,EAAE,MAAM,MAAM,CAAC;CAC9B,WAAW,gBAAgB;CAC3B,SAAS;;;;CAMT,YAAY;CACZ,UAAU"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { IcePolicy, IceServerConfig, OfferMessage, OfferMessageOptions } from "./OfferMessage.mjs";
|
|
2
|
+
import { MediaType, ProposeMessage, ProposeMessageOptions } from "./ProposeMessage.mjs";
|
|
3
|
+
import { AnswerMessage, AnswerMessageOptions } from "./AnswerMessage.mjs";
|
|
4
|
+
import { IceMessage, IceMessageOptions } from "./IceMessage.mjs";
|
|
5
|
+
import { RenegotiateMessage, RenegotiateMessageOptions, RenegotiateReason } from "./RenegotiateMessage.mjs";
|
|
6
|
+
import { EndMessage, EndMessageOptions } from "./EndMessage.mjs";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { IceServerConfig, OfferMessage } from "./OfferMessage.mjs";
|
|
2
|
+
import { ProposeMessage } from "./ProposeMessage.mjs";
|
|
3
|
+
import { AnswerMessage } from "./AnswerMessage.mjs";
|
|
4
|
+
import { IceMessage } from "./IceMessage.mjs";
|
|
5
|
+
import { RenegotiateMessage } from "./RenegotiateMessage.mjs";
|
|
6
|
+
import { EndMessage } from "./EndMessage.mjs";
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { BaseRecord, TagsBase } from "@credo-ts/core";
|
|
2
|
+
|
|
3
|
+
//#region src/webrtc/repository/WebRTCCallRecord.d.ts
|
|
4
|
+
type WebRTCCallState = 'proposed' | 'offered' | 'answered' | 'connected' | 'ended';
|
|
5
|
+
interface WebRTCCallRecordProps {
|
|
6
|
+
id?: string;
|
|
7
|
+
connectionId: string;
|
|
8
|
+
threadId: string;
|
|
9
|
+
state: WebRTCCallState;
|
|
10
|
+
role: 'caller' | 'callee';
|
|
11
|
+
createdAt?: Date;
|
|
12
|
+
updatedAt?: Date;
|
|
13
|
+
}
|
|
14
|
+
type WebRTCTags = {
|
|
15
|
+
connectionId: string;
|
|
16
|
+
threadId: string;
|
|
17
|
+
state: WebRTCCallState;
|
|
18
|
+
role: 'caller' | 'callee';
|
|
19
|
+
};
|
|
20
|
+
declare class WebRTCCallRecord extends BaseRecord<WebRTCTags, TagsBase> {
|
|
21
|
+
static readonly type = "WebRTCCallRecord";
|
|
22
|
+
readonly type = "WebRTCCallRecord";
|
|
23
|
+
connectionId: string;
|
|
24
|
+
threadId: string;
|
|
25
|
+
state: WebRTCCallState;
|
|
26
|
+
role: 'caller' | 'callee';
|
|
27
|
+
constructor(props: WebRTCCallRecordProps);
|
|
28
|
+
getTags(): WebRTCTags & TagsBase;
|
|
29
|
+
}
|
|
30
|
+
//#endregion
|
|
31
|
+
export { WebRTCCallRecord };
|
|
32
|
+
//# sourceMappingURL=WebRTCCallRecord.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WebRTCCallRecord.d.mts","names":[],"sources":["../../../src/webrtc/repository/WebRTCCallRecord.ts"],"sourcesContent":[],"mappings":";;;KAGY,eAAA;AAAA,UAEK,qBAAA,CAFU;EAEV,EAAA,CAAA,EAAA,MAAA;EAIR,YAAA,EAAA,MAAA;EAEK,QAAA,EAAA,MAAA;EACA,KAAA,EAHL,eAGK;EAAI,IAAA,EAAA,QAAA,GAAA,QAAA;EAGb,SAAA,CAAA,EAJS,IAIC;EAEF,SAAA,CAAA,EALC,IAKD;;KAFR,UAAA,GAEwD;EAM5C,YAAA,EAAA,MAAA;EAGW,QAAA,EAAA,MAAA;EAaR,KAAA,EAxB+C,eAwB/C;EAAa,IAAA,EAAA,QAAA,GAAA,QAAA;CAtBK;AAAU,cAAnC,gBAAA,SAAyB,UAAU,CAAC,UAAD,EAAa,QAAb,CAAA,CAAA;;;;;SAM/B;;qBAGW;aAaR,aAAa"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { BaseRecord, utils } from "@credo-ts/core";
|
|
2
|
+
|
|
3
|
+
//#region src/webrtc/repository/WebRTCCallRecord.ts
|
|
4
|
+
var WebRTCCallRecord = class WebRTCCallRecord extends BaseRecord {
|
|
5
|
+
constructor(props) {
|
|
6
|
+
super();
|
|
7
|
+
this.type = WebRTCCallRecord.type;
|
|
8
|
+
if (props) {
|
|
9
|
+
this.id = props.id ?? utils.uuid();
|
|
10
|
+
this.connectionId = props.connectionId;
|
|
11
|
+
this.threadId = props.threadId;
|
|
12
|
+
this.state = props.state;
|
|
13
|
+
this.role = props.role;
|
|
14
|
+
this.createdAt = props.createdAt ?? /* @__PURE__ */ new Date();
|
|
15
|
+
this.updatedAt = props.updatedAt ?? /* @__PURE__ */ new Date();
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
getTags() {
|
|
19
|
+
return {
|
|
20
|
+
connectionId: this.connectionId,
|
|
21
|
+
threadId: this.threadId,
|
|
22
|
+
state: this.state,
|
|
23
|
+
role: this.role
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
WebRTCCallRecord.type = "WebRTCCallRecord";
|
|
28
|
+
|
|
29
|
+
//#endregion
|
|
30
|
+
export { WebRTCCallRecord };
|
|
31
|
+
//# sourceMappingURL=WebRTCCallRecord.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WebRTCCallRecord.mjs","names":[],"sources":["../../../src/webrtc/repository/WebRTCCallRecord.ts"],"sourcesContent":["import { BaseRecord, utils } from '@credo-ts/core'\nimport type { TagsBase } from '@credo-ts/core'\n\nexport type WebRTCCallState = 'proposed' | 'offered' | 'answered' | 'connected' | 'ended'\n\nexport interface WebRTCCallRecordProps {\n id?: string\n connectionId: string\n threadId: string\n state: WebRTCCallState\n role: 'caller' | 'callee'\n createdAt?: Date\n updatedAt?: Date\n}\n\ntype WebRTCTags = { connectionId: string; threadId: string; state: WebRTCCallState; role: 'caller' | 'callee' }\n\nexport class WebRTCCallRecord extends BaseRecord<WebRTCTags, TagsBase> {\n public static readonly type = 'WebRTCCallRecord'\n public readonly type = WebRTCCallRecord.type\n\n public connectionId!: string\n public threadId!: string\n public state!: WebRTCCallState\n public role!: 'caller' | 'callee'\n\n public constructor(props: WebRTCCallRecordProps) {\n super()\n if (props) {\n this.id = props.id ?? utils.uuid()\n this.connectionId = props.connectionId\n this.threadId = props.threadId\n this.state = props.state\n this.role = props.role\n this.createdAt = props.createdAt ?? new Date()\n this.updatedAt = props.updatedAt ?? new Date()\n }\n }\n\n public getTags(): WebRTCTags & TagsBase {\n return {\n connectionId: this.connectionId,\n threadId: this.threadId,\n state: this.state,\n role: this.role,\n }\n }\n}\n"],"mappings":";;;AAiBA,IAAa,mBAAb,MAAa,yBAAyB,WAAiC;CASrE,AAAO,YAAY,OAA8B;AAC/C,SAAO;OARO,OAAO,iBAAiB;AAStC,MAAI,OAAO;AACT,QAAK,KAAK,MAAM,MAAM,MAAM,MAAM;AAClC,QAAK,eAAe,MAAM;AAC1B,QAAK,WAAW,MAAM;AACtB,QAAK,QAAQ,MAAM;AACnB,QAAK,OAAO,MAAM;AAClB,QAAK,YAAY,MAAM,6BAAa,IAAI,MAAM;AAC9C,QAAK,YAAY,MAAM,6BAAa,IAAI,MAAM;;;CAIlD,AAAO,UAAiC;AACtC,SAAO;GACL,cAAc,KAAK;GACnB,UAAU,KAAK;GACf,OAAO,KAAK;GACZ,MAAM,KAAK;GACZ;;;iBA3BoB,OAAO"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { WebRTCCallRecord } from "./WebRTCCallRecord.mjs";
|
|
2
|
+
import { EventEmitter, Repository, StorageService } from "@credo-ts/core";
|
|
3
|
+
|
|
4
|
+
//#region src/webrtc/repository/WebRTCCallRepository.d.ts
|
|
5
|
+
declare class WebRTCCallRepository extends Repository<WebRTCCallRecord> {
|
|
6
|
+
constructor(storageService: StorageService<WebRTCCallRecord>, eventEmitter: EventEmitter);
|
|
7
|
+
}
|
|
8
|
+
//#endregion
|
|
9
|
+
export { WebRTCCallRepository };
|
|
10
|
+
//# sourceMappingURL=WebRTCCallRepository.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WebRTCCallRepository.d.mts","names":[],"sources":["../../../src/webrtc/repository/WebRTCCallRepository.ts"],"sourcesContent":[],"mappings":";;;;cAMa,oBAAA,SAA6B,WAAW;EAAxC,WAAA,CAAA,cAAqB,EAE2B,cAF3B,CAE0C,gBAF1C,CAAA,EAAA,YAAA,EAGhB,YAHgB"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { __decorateMetadata } from "../../_virtual/_@oxc-project_runtime@0.99.0/helpers/decorateMetadata.mjs";
|
|
2
|
+
import { __decorate } from "../../_virtual/_@oxc-project_runtime@0.99.0/helpers/decorate.mjs";
|
|
3
|
+
import { WebRTCCallRecord } from "./WebRTCCallRecord.mjs";
|
|
4
|
+
import { __decorateParam } from "../../_virtual/_@oxc-project_runtime@0.99.0/helpers/decorateParam.mjs";
|
|
5
|
+
import { EventEmitter, InjectionSymbols, Repository } from "@credo-ts/core";
|
|
6
|
+
import { inject, injectable } from "tsyringe";
|
|
7
|
+
|
|
8
|
+
//#region src/webrtc/repository/WebRTCCallRepository.ts
|
|
9
|
+
var _ref;
|
|
10
|
+
let WebRTCCallRepository = class WebRTCCallRepository$1 extends Repository {
|
|
11
|
+
constructor(storageService, eventEmitter) {
|
|
12
|
+
super(WebRTCCallRecord, storageService, eventEmitter);
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
WebRTCCallRepository = __decorate([
|
|
16
|
+
injectable(),
|
|
17
|
+
__decorateParam(0, inject(InjectionSymbols.StorageService)),
|
|
18
|
+
__decorateMetadata("design:paramtypes", [Object, typeof (_ref = typeof EventEmitter !== "undefined" && EventEmitter) === "function" ? _ref : Object])
|
|
19
|
+
], WebRTCCallRepository);
|
|
20
|
+
|
|
21
|
+
//#endregion
|
|
22
|
+
export { WebRTCCallRepository };
|
|
23
|
+
//# sourceMappingURL=WebRTCCallRepository.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WebRTCCallRepository.mjs","names":["WebRTCCallRepository","storageService: StorageService<WebRTCCallRecord>"],"sources":["../../../src/webrtc/repository/WebRTCCallRepository.ts"],"sourcesContent":["import type { StorageService } from '@credo-ts/core'\nimport { Repository, InjectionSymbols, EventEmitter } from '@credo-ts/core'\nimport { injectable, inject } from 'tsyringe'\nimport { WebRTCCallRecord } from './WebRTCCallRecord'\n\n@injectable()\nexport class WebRTCCallRepository extends Repository<WebRTCCallRecord> {\n public constructor(\n @inject(InjectionSymbols.StorageService) storageService: StorageService<WebRTCCallRecord>,\n eventEmitter: EventEmitter\n ) {\n super(WebRTCCallRecord, storageService, eventEmitter)\n }\n}\n"],"mappings":";;;;;;;;;AAMO,iCAAMA,+BAA6B,WAA6B;CACrE,AAAO,YACL,AAAyCC,gBACzC,cACA;AACA,QAAM,kBAAkB,gBAAgB,aAAa;;;;CANxD,YAAY;oBAGR,OAAO,iBAAiB,eAAe"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { WebRTCCallRecord } from "../repository/WebRTCCallRecord.mjs";
|
|
2
|
+
import { IcePolicy, IceServerConfig, OfferMessage } from "../messages/OfferMessage.mjs";
|
|
3
|
+
import { MediaType, ProposeMessage } from "../messages/ProposeMessage.mjs";
|
|
4
|
+
import { AnswerMessage } from "../messages/AnswerMessage.mjs";
|
|
5
|
+
import { IceMessage } from "../messages/IceMessage.mjs";
|
|
6
|
+
import { RenegotiateMessage, RenegotiateReason } from "../messages/RenegotiateMessage.mjs";
|
|
7
|
+
import { EndMessage } from "../messages/EndMessage.mjs";
|
|
8
|
+
import "../messages/index.mjs";
|
|
9
|
+
import { WebRTCCallRepository } from "../repository/WebRTCCallRepository.mjs";
|
|
10
|
+
import { DidCommConnectionRecord, DidCommInboundMessageContext } from "@credo-ts/didcomm";
|
|
11
|
+
import { AgentContext, EventEmitter } from "@credo-ts/core";
|
|
12
|
+
|
|
13
|
+
//#region src/webrtc/services/WebRTCService.d.ts
|
|
14
|
+
declare class WebRTCService {
|
|
15
|
+
private repo;
|
|
16
|
+
private events;
|
|
17
|
+
constructor(repo: WebRTCCallRepository, events: EventEmitter);
|
|
18
|
+
/**
|
|
19
|
+
* Create a propose message to initiate a call
|
|
20
|
+
*/
|
|
21
|
+
createPropose(options: {
|
|
22
|
+
threadId?: string;
|
|
23
|
+
parentThreadId?: string;
|
|
24
|
+
media?: MediaType[];
|
|
25
|
+
data?: boolean;
|
|
26
|
+
topology?: 'mesh' | 'sfu';
|
|
27
|
+
trickle?: boolean;
|
|
28
|
+
policy?: IcePolicy;
|
|
29
|
+
iceServers?: IceServerConfig[];
|
|
30
|
+
reason?: string;
|
|
31
|
+
}): {
|
|
32
|
+
message: ProposeMessage;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Create an offer message with SDP
|
|
36
|
+
*/
|
|
37
|
+
createOffer(agentContext: AgentContext, connection: DidCommConnectionRecord, threadId: string, parentThreadId: string | undefined, sdp: string, iceServers?: IceServerConfig[], policy?: IcePolicy, trickle?: boolean): {
|
|
38
|
+
message: OfferMessage;
|
|
39
|
+
record: WebRTCCallRecord;
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* Create an answer message with SDP
|
|
43
|
+
*/
|
|
44
|
+
createAnswer(agentContext: AgentContext, connection: DidCommConnectionRecord, threadId: string, parentThreadId: string | undefined, sdp: string, iceServers?: IceServerConfig[]): {
|
|
45
|
+
message: AnswerMessage;
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* Create an ICE candidate message
|
|
49
|
+
*/
|
|
50
|
+
createIce(threadId: string, parentThreadId: string | undefined, candidate: Record<string, unknown> | undefined, endOfCandidates?: boolean): IceMessage;
|
|
51
|
+
/**
|
|
52
|
+
* Create a renegotiate message (for ICE restart, track changes, etc.)
|
|
53
|
+
*/
|
|
54
|
+
createRenegotiate(options: {
|
|
55
|
+
threadId: string;
|
|
56
|
+
parentThreadId?: string;
|
|
57
|
+
reason: RenegotiateReason | string;
|
|
58
|
+
iceRestart?: boolean;
|
|
59
|
+
iceServers?: IceServerConfig[];
|
|
60
|
+
policy?: IcePolicy;
|
|
61
|
+
}): RenegotiateMessage;
|
|
62
|
+
/**
|
|
63
|
+
* Create an end call message
|
|
64
|
+
*/
|
|
65
|
+
createEnd(threadId: string, parentThreadId: string | undefined, reason?: string): EndMessage;
|
|
66
|
+
/**
|
|
67
|
+
* Process incoming propose message
|
|
68
|
+
*/
|
|
69
|
+
processPropose(messageContext: DidCommInboundMessageContext<ProposeMessage>): Promise<void>;
|
|
70
|
+
/**
|
|
71
|
+
* Process incoming offer message
|
|
72
|
+
*/
|
|
73
|
+
processOffer(messageContext: DidCommInboundMessageContext<OfferMessage>): Promise<void>;
|
|
74
|
+
/**
|
|
75
|
+
* Process incoming answer message
|
|
76
|
+
*/
|
|
77
|
+
processAnswer(messageContext: DidCommInboundMessageContext<AnswerMessage>): Promise<void>;
|
|
78
|
+
/**
|
|
79
|
+
* Process incoming ICE candidate message
|
|
80
|
+
*/
|
|
81
|
+
processIce(messageContext: DidCommInboundMessageContext<IceMessage>): Promise<void>;
|
|
82
|
+
/**
|
|
83
|
+
* Process incoming renegotiate message
|
|
84
|
+
*/
|
|
85
|
+
processRenegotiate(messageContext: DidCommInboundMessageContext<RenegotiateMessage>): Promise<void>;
|
|
86
|
+
/**
|
|
87
|
+
* Process incoming end call message
|
|
88
|
+
*/
|
|
89
|
+
processEnd(messageContext: DidCommInboundMessageContext<EndMessage>): Promise<void>;
|
|
90
|
+
}
|
|
91
|
+
//#endregion
|
|
92
|
+
export { WebRTCService };
|
|
93
|
+
//# sourceMappingURL=WebRTCService.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WebRTCService.d.mts","names":[],"sources":["../../../src/webrtc/services/WebRTCService.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;cAgBa,aAAA;;;EAAA,WAAA,CAAA,IAAa,EACS,oBADT,EAAA,MAAA,EAC+C,YAD/C;EACS;;;EActB,aAAA,CAAA,OAAA,EAAA;IACI,QAAA,CAAA,EAAA,MAAA;;IAqBC,KAAA,CAAA,EA1BN,SA0BM,EAAA;IACF,IAAA,CAAA,EAAA,OAAA;IAIC,QAAA,CAAA,EAAA,MAAA,GAAA,KAAA;IACJ,OAAA,CAAA,EAAA,OAAA;aA5BA;iBACI;IAuCC,MAAA,CAAA,EAAA,MAAA;EACF,CAAA,CAAA,EAAA;IAIC,OAAA,gBAAA;;EAYF;;;EAcE,WAAA,CAAA,YAAA,EAjDC,YAiDD,EAAA,UAAA,EAhDD,uBAgDC,EAAA,QAAA,EAAA,MAAA,EAAA,cAAA,EAAA,MAAA,GAAA,SAAA,EAAA,GAAA,EAAA,MAAA,EAAA,UAAA,CAAA,EA5CA,eA4CA,EAAA,EAAA,MAAA,CAAA,EA3CJ,SA2CI,EAAA,OAAA,CAAA,EAAA,OAAA,CAAA,EAAA;IACJ,OAAA,cAAA;IACV,MAAA,kBAAA;EAcqF,CAAA;EASb;;;EAyBF,YAAA,CAAA,YAAA,EAjFvD,YAiFuD,EAAA,UAAA,EAhFzD,uBAgFyD,EAAA,QAAA,EAAA,MAAA,EAAA,cAAA,EAAA,MAAA,GAAA,SAAA,EAAA,GAAA,EAAA,MAAA,EAAA,UAAA,CAAA,EA5ExD,eA4EwD,EAAA,CAAA,EAAA;IAA7B,OAAA,eAAA;EAA6C,CAAA;EA+Bf;;;EA8BH,SAAA,CAAA,QAAA,EAAA,MAAA,EAAA,cAAA,EAAA,MAAA,GAAA,SAAA,EAAA,SAAA,EA7HxD,MA6HwD,CAAA,MAAA,EAAA,OAAA,CAAA,GAAA,SAAA,EAAA,eAAA,CAAA,EAAA,OAAA,CAAA,EA5H1C,UA4H0C;EAA7B;;;EAkBQ,iBAAA,CAAA,OAAA,EAAA;IAAmD,QAAA,EAAA,MAAA;IAsB9B,cAAA,CAAA,EAAA,MAAA;IAA7B,MAAA,EAzJ9B,iBAyJ8B,GAAA,MAAA;IAA2C,UAAA,CAAA,EAAA,OAAA;IAAO,UAAA,CAAA,EAvJ3E,eAuJ2E,EAAA;aAtJ/E;MACV;;;;oFAcqF;;;;iCAS1C,6BAA6B,kBAAkB;;;;+BAyBjD,6BAA6B,gBAAgB;;;;gCA+B5C,6BAA6B,iBAAiB;;;;6BA8BjD,6BAA6B,cAAc;;;;qCAkBnC,6BAA6B,sBAAsB;;;;6BAsB3D,6BAA6B,cAAc"}
|