@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.
Files changed (71) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +39 -2
  3. package/build/_virtual/_@oxc-project_runtime@0.112.0/helpers/decorate.mjs +10 -0
  4. package/build/_virtual/_@oxc-project_runtime@0.112.0/helpers/decorateMetadata.mjs +7 -0
  5. package/build/_virtual/_@oxc-project_runtime@0.112.0/helpers/decorateParam.mjs +9 -0
  6. package/build/index.d.mts +11 -0
  7. package/build/index.mjs +12 -0
  8. package/build/webrtc/WebRTCApi.d.mts +114 -0
  9. package/build/webrtc/WebRTCApi.d.mts.map +1 -0
  10. package/build/webrtc/WebRTCApi.mjs +161 -0
  11. package/build/webrtc/WebRTCApi.mjs.map +1 -0
  12. package/build/webrtc/WebRTCEvents.d.mts +115 -0
  13. package/build/webrtc/WebRTCEvents.d.mts.map +1 -0
  14. package/build/webrtc/WebRTCEvents.mjs +20 -0
  15. package/build/webrtc/WebRTCEvents.mjs.map +1 -0
  16. package/build/webrtc/WebRTCModule.d.mts +62 -0
  17. package/build/webrtc/WebRTCModule.d.mts.map +1 -0
  18. package/build/webrtc/WebRTCModule.mjs +51 -0
  19. package/build/webrtc/WebRTCModule.mjs.map +1 -0
  20. package/build/webrtc/handlers/AnswerHandler.mjs +23 -0
  21. package/build/webrtc/handlers/AnswerHandler.mjs.map +1 -0
  22. package/build/webrtc/handlers/EndHandler.mjs +23 -0
  23. package/build/webrtc/handlers/EndHandler.mjs.map +1 -0
  24. package/build/webrtc/handlers/IceHandler.mjs +23 -0
  25. package/build/webrtc/handlers/IceHandler.mjs.map +1 -0
  26. package/build/webrtc/handlers/OfferHandler.mjs +23 -0
  27. package/build/webrtc/handlers/OfferHandler.mjs.map +1 -0
  28. package/build/webrtc/handlers/ProposeHandler.mjs +23 -0
  29. package/build/webrtc/handlers/ProposeHandler.mjs.map +1 -0
  30. package/build/webrtc/handlers/RenegotiateHandler.mjs +23 -0
  31. package/build/webrtc/handlers/RenegotiateHandler.mjs.map +1 -0
  32. package/build/webrtc/handlers/index.mjs +6 -0
  33. package/build/webrtc/messages/AnswerMessage.d.mts +29 -0
  34. package/build/webrtc/messages/AnswerMessage.d.mts.map +1 -0
  35. package/build/webrtc/messages/AnswerMessage.mjs +44 -0
  36. package/build/webrtc/messages/AnswerMessage.mjs.map +1 -0
  37. package/build/webrtc/messages/EndMessage.d.mts +19 -0
  38. package/build/webrtc/messages/EndMessage.d.mts.map +1 -0
  39. package/build/webrtc/messages/EndMessage.mjs +31 -0
  40. package/build/webrtc/messages/EndMessage.mjs.map +1 -0
  41. package/build/webrtc/messages/IceMessage.d.mts +21 -0
  42. package/build/webrtc/messages/IceMessage.d.mts.map +1 -0
  43. package/build/webrtc/messages/IceMessage.mjs +38 -0
  44. package/build/webrtc/messages/IceMessage.mjs.map +1 -0
  45. package/build/webrtc/messages/OfferMessage.d.mts +55 -0
  46. package/build/webrtc/messages/OfferMessage.d.mts.map +1 -0
  47. package/build/webrtc/messages/OfferMessage.mjs +86 -0
  48. package/build/webrtc/messages/OfferMessage.mjs.map +1 -0
  49. package/build/webrtc/messages/ProposeMessage.d.mts +69 -0
  50. package/build/webrtc/messages/ProposeMessage.d.mts.map +1 -0
  51. package/build/webrtc/messages/ProposeMessage.mjs +76 -0
  52. package/build/webrtc/messages/ProposeMessage.mjs.map +1 -0
  53. package/build/webrtc/messages/RenegotiateMessage.d.mts +58 -0
  54. package/build/webrtc/messages/RenegotiateMessage.d.mts.map +1 -0
  55. package/build/webrtc/messages/RenegotiateMessage.mjs +56 -0
  56. package/build/webrtc/messages/RenegotiateMessage.mjs.map +1 -0
  57. package/build/webrtc/messages/index.d.mts +6 -0
  58. package/build/webrtc/messages/index.mjs +6 -0
  59. package/build/webrtc/repository/WebRTCCallRecord.d.mts +32 -0
  60. package/build/webrtc/repository/WebRTCCallRecord.d.mts.map +1 -0
  61. package/build/webrtc/repository/WebRTCCallRecord.mjs +31 -0
  62. package/build/webrtc/repository/WebRTCCallRecord.mjs.map +1 -0
  63. package/build/webrtc/repository/WebRTCCallRepository.d.mts +10 -0
  64. package/build/webrtc/repository/WebRTCCallRepository.d.mts.map +1 -0
  65. package/build/webrtc/repository/WebRTCCallRepository.mjs +23 -0
  66. package/build/webrtc/repository/WebRTCCallRepository.mjs.map +1 -0
  67. package/build/webrtc/services/WebRTCService.d.mts +93 -0
  68. package/build/webrtc/services/WebRTCService.d.mts.map +1 -0
  69. package/build/webrtc/services/WebRTCService.mjs +244 -0
  70. package/build/webrtc/services/WebRTCService.mjs.map +1 -0
  71. package/package.json +38 -3
@@ -0,0 +1,38 @@
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 { IsBoolean, IsObject, IsOptional, IsString } from "class-validator";
5
+
6
+ //#region src/webrtc/messages/IceMessage.ts
7
+ var _ref;
8
+ var IceMessage = class IceMessage extends DidCommMessage {
9
+ constructor(options) {
10
+ super();
11
+ this.type = IceMessage.type.messageTypeUri;
12
+ if (options) {
13
+ this.id = options.id ?? this.generateId();
14
+ this.candidate = options.candidate;
15
+ this.endOfCandidates = options.endOfCandidates;
16
+ this.setThread({
17
+ threadId: options.threadId,
18
+ parentThreadId: options.parentThreadId
19
+ });
20
+ }
21
+ }
22
+ };
23
+ IceMessage.type = parseMessageType("https://didcomm.org/webrtc/1.0/ice");
24
+ __decorate([IsValidMessageType(IceMessage.type), __decorateMetadata("design:type", Object)], IceMessage.prototype, "type", void 0);
25
+ __decorate([
26
+ IsOptional(),
27
+ IsObject(),
28
+ __decorateMetadata("design:type", Object)
29
+ ], IceMessage.prototype, "candidate", void 0);
30
+ __decorate([
31
+ IsOptional(),
32
+ IsBoolean(),
33
+ __decorateMetadata("design:type", Boolean)
34
+ ], IceMessage.prototype, "endOfCandidates", void 0);
35
+
36
+ //#endregion
37
+ export { IceMessage };
38
+ //# sourceMappingURL=IceMessage.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IceMessage.mjs","names":[],"sources":["../../../src/webrtc/messages/IceMessage.ts"],"sourcesContent":["import { DidCommMessage, IsValidMessageType, parseMessageType } from '@credo-ts/didcomm'\nimport { IsBoolean, IsObject, IsOptional, IsString } from 'class-validator'\n\nexport interface IceMessageOptions {\n id?: string\n threadId: string\n parentThreadId?: string\n candidate?: Record<string, unknown>\n endOfCandidates?: boolean\n}\n\nexport class IceMessage extends DidCommMessage {\n public constructor(options: IceMessageOptions) {\n super()\n if (options) {\n this.id = options.id ?? this.generateId()\n this.candidate = options.candidate\n this.endOfCandidates = options.endOfCandidates\n this.setThread({ threadId: options.threadId, parentThreadId: options.parentThreadId })\n }\n }\n\n @IsValidMessageType(IceMessage.type)\n public readonly type = IceMessage.type.messageTypeUri\n public static readonly type = parseMessageType('https://didcomm.org/webrtc/1.0/ice')\n\n @IsOptional()\n @IsObject()\n public candidate?: Record<string, unknown>\n\n @IsOptional()\n @IsBoolean()\n public endOfCandidates?: boolean\n}\n"],"mappings":";;;;;;;AAWA,IAAa,aAAb,MAAa,mBAAmB,eAAe;CAC7C,AAAO,YAAY,SAA4B;AAC7C,SAAO;OAUO,OAAO,WAAW,KAAK;AATrC,MAAI,SAAS;AACX,QAAK,KAAK,QAAQ,MAAM,KAAK,YAAY;AACzC,QAAK,YAAY,QAAQ;AACzB,QAAK,kBAAkB,QAAQ;AAC/B,QAAK,UAAU;IAAE,UAAU,QAAQ;IAAU,gBAAgB,QAAQ;IAAgB,CAAC;;;;WAMnE,OAAO,iBAAiB,qCAAqC;YAFnF,mBAAmB,WAAW,KAAK;;CAInC,YAAY;CACZ,UAAU;;;;CAGV,YAAY;CACZ,WAAW"}
@@ -0,0 +1,55 @@
1
+ import * as _credo_ts_didcomm0 from "@credo-ts/didcomm";
2
+ import { DidCommMessage } from "@credo-ts/didcomm";
3
+
4
+ //#region src/webrtc/messages/OfferMessage.d.ts
5
+ /**
6
+ * ICE policy for NAT traversal
7
+ * - 'all': Use all available candidates (host, srflx, relay)
8
+ * - 'relay-preferred': Prefer relay candidates but allow others
9
+ * - 'relay-only': Only use relay (TURN) candidates - best for strict NAT/firewall
10
+ */
11
+ type IcePolicy = 'all' | 'relay-preferred' | 'relay-only';
12
+ declare class IceServerConfig {
13
+ /**
14
+ * STUN/TURN server URL(s). Can be a single URL or array of URLs.
15
+ * Examples: 'stun:stun.example.org:3478', ['turn:turn.example.org:3478', 'turns:turn.example.org:5349']
16
+ */
17
+ urls?: string | string[];
18
+ url?: string;
19
+ username?: string;
20
+ credential?: string;
21
+ credentialType?: 'password' | 'oauth';
22
+ /**
23
+ * Get URLs as array (handles both urls and legacy url field)
24
+ */
25
+ getUrls(): string[];
26
+ }
27
+ interface OfferMessageOptions {
28
+ id?: string;
29
+ threadId: string;
30
+ parentThreadId?: string;
31
+ sdp: string;
32
+ iceServers?: IceServerConfig[];
33
+ policy?: IcePolicy;
34
+ trickle?: boolean;
35
+ jws?: Record<string, unknown>;
36
+ }
37
+ declare class OfferMessage extends DidCommMessage {
38
+ constructor(options: OfferMessageOptions);
39
+ readonly type: string;
40
+ static readonly type: _credo_ts_didcomm0.ParsedMessageType;
41
+ sdp: string;
42
+ iceServers?: IceServerConfig[];
43
+ /**
44
+ * ICE policy for NAT traversal
45
+ */
46
+ policy?: IcePolicy;
47
+ /**
48
+ * Whether trickle ICE is supported/requested
49
+ */
50
+ trickle?: boolean;
51
+ jws?: Record<string, unknown>;
52
+ }
53
+ //#endregion
54
+ export { IcePolicy, IceServerConfig, OfferMessage, OfferMessageOptions };
55
+ //# sourceMappingURL=OfferMessage.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OfferMessage.d.mts","names":[],"sources":["../../../src/webrtc/messages/OfferMessage.ts"],"mappings":";;;;;;;AAUA;;;KAAY,SAAA;AAAA,cAEC,eAAA;EAAA;;;;EAMJ,IAAA;EAIA,GAAA;EAIA,QAAA;EAIA,UAAA;EAIA,cAAA;EAKA;;;EAAA,OAAA,CAAA;AAAA;AAAA,UAWQ,mBAAA;EACf,EAAA;EACA,QAAA;EACA,cAAA;EACA,GAAA;EACA,UAAA,GAAa,eAAA;EACb,MAAA,GAAS,SAAA;EACT,OAAA;EACA,GAAA,GAAM,MAAA;AAAA;AAAA,cAGK,YAAA,SAAqB,cAAA;cACb,OAAA,EAAS,mBAAA;EAAA,SAcZ,IAAA;EAAA,gBACO,IAAA,EAfwB,kBAAA,CAepB,iBAAA;EAGpB,GAAA;EAMA,UAAA,GAAa,eAAA;EA5Bd;;;EAmCC,MAAA,GAAS,SAAA;EAhCQ;;;EAuCjB,OAAA;EAIA,GAAA,GAAM,MAAA;AAAA"}
@@ -0,0 +1,86 @@
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 { IsArray, IsBoolean, IsObject, IsOptional, IsString, ValidateNested } from "class-validator";
5
+ import { Type } from "class-transformer";
6
+
7
+ //#region src/webrtc/messages/OfferMessage.ts
8
+ var _ref;
9
+ var IceServerConfig = class {
10
+ /**
11
+ * Get URLs as array (handles both urls and legacy url field)
12
+ */
13
+ getUrls() {
14
+ if (this.urls) return Array.isArray(this.urls) ? this.urls : [this.urls];
15
+ if (this.url) return [this.url];
16
+ return [];
17
+ }
18
+ };
19
+ __decorate([IsOptional(), __decorateMetadata("design:type", Object)], IceServerConfig.prototype, "urls", void 0);
20
+ __decorate([
21
+ IsOptional(),
22
+ IsString(),
23
+ __decorateMetadata("design:type", String)
24
+ ], IceServerConfig.prototype, "url", void 0);
25
+ __decorate([
26
+ IsOptional(),
27
+ IsString(),
28
+ __decorateMetadata("design:type", String)
29
+ ], IceServerConfig.prototype, "username", void 0);
30
+ __decorate([
31
+ IsOptional(),
32
+ IsString(),
33
+ __decorateMetadata("design:type", String)
34
+ ], IceServerConfig.prototype, "credential", void 0);
35
+ __decorate([
36
+ IsOptional(),
37
+ IsString(),
38
+ __decorateMetadata("design:type", String)
39
+ ], IceServerConfig.prototype, "credentialType", void 0);
40
+ var OfferMessage = class OfferMessage extends DidCommMessage {
41
+ constructor(options) {
42
+ super();
43
+ this.type = OfferMessage.type.messageTypeUri;
44
+ if (options) {
45
+ this.id = options.id ?? this.generateId();
46
+ this.sdp = options.sdp;
47
+ this.iceServers = options.iceServers;
48
+ this.policy = options.policy;
49
+ this.trickle = options.trickle;
50
+ this.jws = options.jws;
51
+ this.setThread({
52
+ threadId: options.threadId,
53
+ parentThreadId: options.parentThreadId
54
+ });
55
+ }
56
+ }
57
+ };
58
+ OfferMessage.type = parseMessageType("https://didcomm.org/webrtc/1.0/offer");
59
+ __decorate([IsValidMessageType(OfferMessage.type), __decorateMetadata("design:type", Object)], OfferMessage.prototype, "type", void 0);
60
+ __decorate([IsString(), __decorateMetadata("design:type", String)], OfferMessage.prototype, "sdp", void 0);
61
+ __decorate([
62
+ IsOptional(),
63
+ ValidateNested({ each: true }),
64
+ Type(() => IceServerConfig),
65
+ IsArray(),
66
+ __decorateMetadata("design:type", Array)
67
+ ], OfferMessage.prototype, "iceServers", void 0);
68
+ __decorate([
69
+ IsOptional(),
70
+ IsString(),
71
+ __decorateMetadata("design:type", Object)
72
+ ], OfferMessage.prototype, "policy", void 0);
73
+ __decorate([
74
+ IsOptional(),
75
+ IsBoolean(),
76
+ __decorateMetadata("design:type", Boolean)
77
+ ], OfferMessage.prototype, "trickle", void 0);
78
+ __decorate([
79
+ IsOptional(),
80
+ IsObject(),
81
+ __decorateMetadata("design:type", Object)
82
+ ], OfferMessage.prototype, "jws", void 0);
83
+
84
+ //#endregion
85
+ export { IceServerConfig, OfferMessage };
86
+ //# sourceMappingURL=OfferMessage.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OfferMessage.mjs","names":[],"sources":["../../../src/webrtc/messages/OfferMessage.ts"],"sourcesContent":["import { DidCommMessage, IsValidMessageType, parseMessageType } from '@credo-ts/didcomm'\nimport { IsArray, IsBoolean, IsObject, IsOptional, IsString, ValidateNested } from 'class-validator'\nimport { Type } from 'class-transformer'\n\n/**\n * ICE policy for NAT traversal\n * - 'all': Use all available candidates (host, srflx, relay)\n * - 'relay-preferred': Prefer relay candidates but allow others\n * - 'relay-only': Only use relay (TURN) candidates - best for strict NAT/firewall\n */\nexport type IcePolicy = 'all' | 'relay-preferred' | 'relay-only'\n\nexport class IceServerConfig {\n /**\n * STUN/TURN server URL(s). Can be a single URL or array of URLs.\n * Examples: 'stun:stun.example.org:3478', ['turn:turn.example.org:3478', 'turns:turn.example.org:5349']\n */\n @IsOptional()\n public urls?: string | string[]\n\n @IsOptional()\n @IsString()\n public url?: string // Legacy single URL support\n\n @IsOptional()\n @IsString()\n public username?: string\n\n @IsOptional()\n @IsString()\n public credential?: string\n\n @IsOptional()\n @IsString()\n public credentialType?: 'password' | 'oauth'\n\n /**\n * Get URLs as array (handles both urls and legacy url field)\n */\n public getUrls(): string[] {\n if (this.urls) {\n return Array.isArray(this.urls) ? this.urls : [this.urls]\n }\n if (this.url) {\n return [this.url]\n }\n return []\n }\n}\n\nexport interface OfferMessageOptions {\n id?: string\n threadId: string\n parentThreadId?: string\n sdp: string\n iceServers?: IceServerConfig[]\n policy?: IcePolicy\n trickle?: boolean\n jws?: Record<string, unknown>\n}\n\nexport class OfferMessage extends DidCommMessage {\n public constructor(options: OfferMessageOptions) {\n super()\n if (options) {\n this.id = options.id ?? this.generateId()\n this.sdp = options.sdp\n this.iceServers = options.iceServers\n this.policy = options.policy\n this.trickle = options.trickle\n this.jws = options.jws\n this.setThread({ threadId: options.threadId, parentThreadId: options.parentThreadId })\n }\n }\n\n @IsValidMessageType(OfferMessage.type)\n public readonly type = OfferMessage.type.messageTypeUri\n public static readonly type = parseMessageType('https://didcomm.org/webrtc/1.0/offer')\n\n @IsString()\n public sdp!: string\n\n @IsOptional()\n @ValidateNested({ each: true })\n @Type(() => IceServerConfig)\n @IsArray()\n public iceServers?: IceServerConfig[]\n\n /**\n * ICE policy for NAT traversal\n */\n @IsOptional()\n @IsString()\n public policy?: IcePolicy\n\n /**\n * Whether trickle ICE is supported/requested\n */\n @IsOptional()\n @IsBoolean()\n public trickle?: boolean\n\n @IsOptional()\n @IsObject()\n public jws?: Record<string, unknown>\n}\n"],"mappings":";;;;;;;;AAYA,IAAa,kBAAb,MAA6B;;;;CA2B3B,AAAO,UAAoB;AACzB,MAAI,KAAK,KACP,QAAO,MAAM,QAAQ,KAAK,KAAK,GAAG,KAAK,OAAO,CAAC,KAAK,KAAK;AAE3D,MAAI,KAAK,IACP,QAAO,CAAC,KAAK,IAAI;AAEnB,SAAO,EAAE;;;YA7BV,YAAY;;CAGZ,YAAY;CACZ,UAAU;;;;CAGV,YAAY;CACZ,UAAU;;;;CAGV,YAAY;CACZ,UAAU;;;;CAGV,YAAY;CACZ,UAAU;;;AA4Bb,IAAa,eAAb,MAAa,qBAAqB,eAAe;CAC/C,AAAO,YAAY,SAA8B;AAC/C,SAAO;OAaO,OAAO,aAAa,KAAK;AAZvC,MAAI,SAAS;AACX,QAAK,KAAK,QAAQ,MAAM,KAAK,YAAY;AACzC,QAAK,MAAM,QAAQ;AACnB,QAAK,aAAa,QAAQ;AAC1B,QAAK,SAAS,QAAQ;AACtB,QAAK,UAAU,QAAQ;AACvB,QAAK,MAAM,QAAQ;AACnB,QAAK,UAAU;IAAE,UAAU,QAAQ;IAAU,gBAAgB,QAAQ;IAAgB,CAAC;;;;aAMnE,OAAO,iBAAiB,uCAAuC;YAFrF,mBAAmB,aAAa,KAAK;YAIrC,UAAU;;CAGV,YAAY;CACZ,eAAe,EAAE,MAAM,MAAM,CAAC;CAC9B,WAAW,gBAAgB;CAC3B,SAAS;;;;CAMT,YAAY;CACZ,UAAU;;;;CAMV,YAAY;CACZ,WAAW;;;;CAGX,YAAY;CACZ,UAAU"}
@@ -0,0 +1,69 @@
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/ProposeMessage.d.ts
6
+ /**
7
+ * Media types that can be requested in a call
8
+ */
9
+ type MediaType = 'audio' | 'video';
10
+ interface ProposeMessageOptions {
11
+ id?: string;
12
+ threadId?: string;
13
+ parentThreadId?: string;
14
+ /** Requested media types */
15
+ media?: MediaType[];
16
+ /** Whether data channel is requested */
17
+ data?: boolean;
18
+ /** Topology hint: 'mesh' for P2P */
19
+ topology?: 'mesh' | 'sfu';
20
+ /** Whether trickle ICE is supported */
21
+ trickle?: boolean;
22
+ /** ICE policy for NAT traversal */
23
+ policy?: IcePolicy;
24
+ /** ICE servers (STUN/TURN) for NAT traversal */
25
+ iceServers?: IceServerConfig[];
26
+ /** Optional reason/context for the call */
27
+ reason?: string;
28
+ }
29
+ /**
30
+ * ProposeMessage - Caller initiates a WebRTC session request
31
+ * This message is sent before the offer to negotiate capabilities and share ICE servers
32
+ */
33
+ declare class ProposeMessage extends DidCommMessage {
34
+ constructor(options: ProposeMessageOptions);
35
+ readonly type: string;
36
+ static readonly type: _credo_ts_didcomm0.ParsedMessageType;
37
+ /**
38
+ * Requested media types: ['audio'], ['video'], or ['audio', 'video']
39
+ */
40
+ media?: MediaType[];
41
+ /**
42
+ * Whether a data channel is requested
43
+ */
44
+ data?: boolean;
45
+ /**
46
+ * Topology: 'mesh' for P2P, 'sfu' for server-mediated
47
+ */
48
+ topology?: 'mesh' | 'sfu';
49
+ /**
50
+ * Whether trickle ICE is supported
51
+ */
52
+ trickle?: boolean;
53
+ /**
54
+ * ICE policy for NAT traversal
55
+ */
56
+ policy?: IcePolicy;
57
+ /**
58
+ * ICE servers (STUN/TURN) for NAT traversal
59
+ * Shared early so callee can configure RTCPeerConnection before receiving offer
60
+ */
61
+ iceServers?: IceServerConfig[];
62
+ /**
63
+ * Optional reason/context for the call
64
+ */
65
+ reason?: string;
66
+ }
67
+ //#endregion
68
+ export { MediaType, ProposeMessage, ProposeMessageOptions };
69
+ //# sourceMappingURL=ProposeMessage.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ProposeMessage.d.mts","names":[],"sources":["../../../src/webrtc/messages/ProposeMessage.ts"],"mappings":";;;;;;;AAUA;KAAY,SAAA;AAAA,UAEK,qBAAA;EACf,EAAA;EACA,QAAA;EACA,cAAA;EAHoC;EAKpC,KAAA,GAAQ,SAAA;EAAA;EAER,IAAA;EAQa;EANb,QAAA;EAM4B;EAJ5B,OAAA;EATA;EAWA,MAAA,GAAS,SAAA;EART;EAUA,UAAA,GAAa,eAAA;EARb;EAUA,MAAA;AAAA;;;;;cAOW,cAAA,SAAuB,cAAA;cACf,OAAA,EAAS,qBAAA;EAAA,SAkBZ,IAAA;EAAA,gBACO,IAAA,EAnB0B,kBAAA,CAmBtB,iBAAA;EApBD;;;EA4BnB,KAAA,GAAQ,SAAA;EAAA;;;EAOR,IAAA;EAnCyC;;;EA0CzC,QAAA;EAzCqB;;;EAgDrB,OAAA;EA7BoB;;;EAoCpB,MAAA,GAAS,SAAA;EAdT;;;;EAwBA,UAAA,GAAa,eAAA;EAAA;;;EAOb,MAAA;AAAA"}
@@ -0,0 +1,76 @@
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, 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,58 @@
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
+ * Reasons for renegotiation
8
+ */
9
+ type RenegotiateReason = 'add-track' | 'remove-track' | 'add-screenshare' | 'remove-screenshare' | 'ice-restart' | 'codec-change' | 'bandwidth-change' | 'other';
10
+ interface RenegotiateMessageOptions {
11
+ id?: string;
12
+ threadId: string;
13
+ parentThreadId?: string;
14
+ /** Reason for renegotiation */
15
+ reason: RenegotiateReason | string;
16
+ /** Whether to perform an ICE restart (required for recovering failed connections) */
17
+ iceRestart?: boolean;
18
+ /** New ICE servers to use (useful when switching networks) */
19
+ iceServers?: IceServerConfig[];
20
+ /** Updated ICE policy */
21
+ policy?: IcePolicy;
22
+ }
23
+ /**
24
+ * RenegotiateMessage - Request to renegotiate the WebRTC session
25
+ * Used for:
26
+ * - Adding/removing media tracks (screenshare, camera switch)
27
+ * - ICE restart when connection fails (critical for NAT/firewall recovery)
28
+ * - Changing codecs or bandwidth constraints
29
+ */
30
+ declare class RenegotiateMessage extends DidCommMessage {
31
+ constructor(options: RenegotiateMessageOptions);
32
+ readonly type: string;
33
+ static readonly type: _credo_ts_didcomm0.ParsedMessageType;
34
+ /**
35
+ * Reason for renegotiation
36
+ */
37
+ reason: RenegotiateReason | string;
38
+ /**
39
+ * Whether to perform an ICE restart
40
+ * Set to true when:
41
+ * - ICE connection state is 'failed' or 'disconnected'
42
+ * - Network change detected (WiFi to cellular, etc.)
43
+ * - NAT binding expired
44
+ */
45
+ iceRestart?: boolean;
46
+ /**
47
+ * New ICE servers to use
48
+ * Useful when switching networks or when original servers are unreachable
49
+ */
50
+ iceServers?: IceServerConfig[];
51
+ /**
52
+ * Updated ICE policy
53
+ */
54
+ policy?: IcePolicy;
55
+ }
56
+ //#endregion
57
+ export { RenegotiateMessage, RenegotiateMessageOptions, RenegotiateReason };
58
+ //# sourceMappingURL=RenegotiateMessage.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RenegotiateMessage.d.mts","names":[],"sources":["../../../src/webrtc/messages/RenegotiateMessage.ts"],"mappings":";;;;;;;AAUA;KAAY,iBAAA;AAAA,UAUK,yBAAA;EACf,EAAA;EACA,QAAA;EACA,cAAA;EAHwC;EAKxC,MAAA,EAAQ,iBAAA;EAAA;EAER,UAAA;EAIS;EAFT,UAAA,GAAa,eAAA;EAEK;EAAlB,MAAA,GAAS,SAAA;AAAA;;;;;;;;cAUE,kBAAA,SAA2B,cAAA;cACnB,OAAA,EAAS,yBAAA;EAAA,SAaZ,IAAA;EAAA,gBACO,IAAA,EAd8B,kBAAA,CAc1B,iBAAA;EAfG;;;EAqBvB,MAAA,EAAS,iBAAA;EAAA;;;;;;;EAWT,UAAA;EA/BqB;;;;EAyCrB,UAAA,GAAa,eAAA;EArBb;;;EA4BA,MAAA,GAAS,SAAA;AAAA"}
@@ -0,0 +1,56 @@
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, 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"],"mappings":";;;KAGY,eAAA;AAAA,UAEK,qBAAA;EACf,EAAA;EACA,YAAA;EACA,QAAA;EACA,KAAA,EAAO,eAAA;EACP,IAAA;EACA,SAAA,GAAY,IAAA;EACZ,SAAA,GAAY,IAAA;AAAA;AAAA,KAGT,UAAA;EAAe,YAAA;EAAsB,QAAA;EAAkB,KAAA,EAAO,eAAA;EAAiB,IAAA;AAAA;AAAA,cAEvE,gBAAA,SAAyB,UAAA,CAAW,UAAA,EAAY,QAAA;EAAA,gBACpC,IAAA;EAAA,SACP,IAAA;EAET,YAAA;EACA,QAAA;EACA,KAAA,EAAQ,eAAA;EACR,IAAA;cAEY,KAAA,EAAO,qBAAA;EAanB,OAAA,CAAA,GAAW,UAAA,GAAa,QAAA;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"],"mappings":";;;;cAMa,oBAAA,SAA6B,UAAA,CAAW,gBAAA;cAER,cAAA,EAAgB,cAAA,CAAe,gBAAA,GACxE,YAAA,EAAc,YAAA;AAAA"}
@@ -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 { WebRTCCallRecord } from "./WebRTCCallRecord.mjs";
4
+ import { __decorateParam } from "../../_virtual/_@oxc-project_runtime@0.112.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 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, EventEmitter])
19
+ ], WebRTCCallRepository);
20
+
21
+ //#endregion
22
+ export { WebRTCCallRepository };
23
+ //# sourceMappingURL=WebRTCCallRepository.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WebRTCCallRepository.mjs","names":[],"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,iCAAM,6BAA6B,WAA6B;CACrE,AAAO,YACL,AAAyC,gBACzC,cACA;AACA,QAAM,kBAAkB,gBAAgB,aAAa;;;;CANxD,YAAY;oBAGR,OAAO,iBAAiB,eAAe"}