@unwanted/matrix-sdk-mini 34.12.0-1 → 34.12.0-2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (185) hide show
  1. package/git-revision.txt +1 -1
  2. package/lib/@types/event.d.ts +0 -19
  3. package/lib/@types/event.d.ts.map +1 -1
  4. package/lib/@types/event.js.map +1 -1
  5. package/lib/client.d.ts +2 -50
  6. package/lib/client.d.ts.map +1 -1
  7. package/lib/client.js +391 -501
  8. package/lib/client.js.map +1 -1
  9. package/lib/embedded.d.ts.map +1 -1
  10. package/lib/embedded.js +0 -1
  11. package/lib/embedded.js.map +1 -1
  12. package/lib/matrix.d.ts +0 -6
  13. package/lib/matrix.d.ts.map +1 -1
  14. package/lib/matrix.js +1 -5
  15. package/lib/matrix.js.map +1 -1
  16. package/package.json +1 -1
  17. package/src/@types/event.ts +2 -36
  18. package/src/client.ts +1 -150
  19. package/src/embedded.ts +0 -2
  20. package/src/matrix.ts +0 -13
  21. package/lib/matrixrtc/CallMembership.d.ts +0 -66
  22. package/lib/matrixrtc/CallMembership.d.ts.map +0 -1
  23. package/lib/matrixrtc/CallMembership.js +0 -197
  24. package/lib/matrixrtc/CallMembership.js.map +0 -1
  25. package/lib/matrixrtc/LivekitFocus.d.ts +0 -16
  26. package/lib/matrixrtc/LivekitFocus.d.ts.map +0 -1
  27. package/lib/matrixrtc/LivekitFocus.js +0 -20
  28. package/lib/matrixrtc/LivekitFocus.js.map +0 -1
  29. package/lib/matrixrtc/MatrixRTCSession.d.ts +0 -295
  30. package/lib/matrixrtc/MatrixRTCSession.d.ts.map +0 -1
  31. package/lib/matrixrtc/MatrixRTCSession.js +0 -1043
  32. package/lib/matrixrtc/MatrixRTCSession.js.map +0 -1
  33. package/lib/matrixrtc/MatrixRTCSessionManager.d.ts +0 -40
  34. package/lib/matrixrtc/MatrixRTCSessionManager.d.ts.map +0 -1
  35. package/lib/matrixrtc/MatrixRTCSessionManager.js +0 -146
  36. package/lib/matrixrtc/MatrixRTCSessionManager.js.map +0 -1
  37. package/lib/matrixrtc/focus.d.ts +0 -10
  38. package/lib/matrixrtc/focus.d.ts.map +0 -1
  39. package/lib/matrixrtc/focus.js +0 -1
  40. package/lib/matrixrtc/focus.js.map +0 -1
  41. package/lib/matrixrtc/index.d.ts +0 -7
  42. package/lib/matrixrtc/index.d.ts.map +0 -1
  43. package/lib/matrixrtc/index.js +0 -21
  44. package/lib/matrixrtc/index.js.map +0 -1
  45. package/lib/matrixrtc/types.d.ts +0 -19
  46. package/lib/matrixrtc/types.d.ts.map +0 -1
  47. package/lib/matrixrtc/types.js +0 -1
  48. package/lib/matrixrtc/types.js.map +0 -1
  49. package/lib/webrtc/audioContext.d.ts +0 -15
  50. package/lib/webrtc/audioContext.d.ts.map +0 -1
  51. package/lib/webrtc/audioContext.js +0 -46
  52. package/lib/webrtc/audioContext.js.map +0 -1
  53. package/lib/webrtc/call.d.ts +0 -560
  54. package/lib/webrtc/call.d.ts.map +0 -1
  55. package/lib/webrtc/call.js +0 -2541
  56. package/lib/webrtc/call.js.map +0 -1
  57. package/lib/webrtc/callEventHandler.d.ts +0 -37
  58. package/lib/webrtc/callEventHandler.d.ts.map +0 -1
  59. package/lib/webrtc/callEventHandler.js +0 -344
  60. package/lib/webrtc/callEventHandler.js.map +0 -1
  61. package/lib/webrtc/callEventTypes.d.ts +0 -73
  62. package/lib/webrtc/callEventTypes.d.ts.map +0 -1
  63. package/lib/webrtc/callEventTypes.js +0 -13
  64. package/lib/webrtc/callEventTypes.js.map +0 -1
  65. package/lib/webrtc/callFeed.d.ts +0 -128
  66. package/lib/webrtc/callFeed.d.ts.map +0 -1
  67. package/lib/webrtc/callFeed.js +0 -289
  68. package/lib/webrtc/callFeed.js.map +0 -1
  69. package/lib/webrtc/groupCall.d.ts +0 -323
  70. package/lib/webrtc/groupCall.d.ts.map +0 -1
  71. package/lib/webrtc/groupCall.js +0 -1337
  72. package/lib/webrtc/groupCall.js.map +0 -1
  73. package/lib/webrtc/groupCallEventHandler.d.ts +0 -31
  74. package/lib/webrtc/groupCallEventHandler.d.ts.map +0 -1
  75. package/lib/webrtc/groupCallEventHandler.js +0 -178
  76. package/lib/webrtc/groupCallEventHandler.js.map +0 -1
  77. package/lib/webrtc/mediaHandler.d.ts +0 -89
  78. package/lib/webrtc/mediaHandler.d.ts.map +0 -1
  79. package/lib/webrtc/mediaHandler.js +0 -437
  80. package/lib/webrtc/mediaHandler.js.map +0 -1
  81. package/lib/webrtc/stats/callFeedStatsReporter.d.ts +0 -8
  82. package/lib/webrtc/stats/callFeedStatsReporter.d.ts.map +0 -1
  83. package/lib/webrtc/stats/callFeedStatsReporter.js +0 -82
  84. package/lib/webrtc/stats/callFeedStatsReporter.js.map +0 -1
  85. package/lib/webrtc/stats/callStatsReportGatherer.d.ts +0 -25
  86. package/lib/webrtc/stats/callStatsReportGatherer.d.ts.map +0 -1
  87. package/lib/webrtc/stats/callStatsReportGatherer.js +0 -199
  88. package/lib/webrtc/stats/callStatsReportGatherer.js.map +0 -1
  89. package/lib/webrtc/stats/callStatsReportSummary.d.ts +0 -17
  90. package/lib/webrtc/stats/callStatsReportSummary.d.ts.map +0 -1
  91. package/lib/webrtc/stats/callStatsReportSummary.js +0 -1
  92. package/lib/webrtc/stats/callStatsReportSummary.js.map +0 -1
  93. package/lib/webrtc/stats/connectionStats.d.ts +0 -28
  94. package/lib/webrtc/stats/connectionStats.d.ts.map +0 -1
  95. package/lib/webrtc/stats/connectionStats.js +0 -26
  96. package/lib/webrtc/stats/connectionStats.js.map +0 -1
  97. package/lib/webrtc/stats/connectionStatsBuilder.d.ts +0 -5
  98. package/lib/webrtc/stats/connectionStatsBuilder.d.ts.map +0 -1
  99. package/lib/webrtc/stats/connectionStatsBuilder.js +0 -27
  100. package/lib/webrtc/stats/connectionStatsBuilder.js.map +0 -1
  101. package/lib/webrtc/stats/connectionStatsReportBuilder.d.ts +0 -7
  102. package/lib/webrtc/stats/connectionStatsReportBuilder.d.ts.map +0 -1
  103. package/lib/webrtc/stats/connectionStatsReportBuilder.js +0 -121
  104. package/lib/webrtc/stats/connectionStatsReportBuilder.js.map +0 -1
  105. package/lib/webrtc/stats/groupCallStats.d.ts +0 -22
  106. package/lib/webrtc/stats/groupCallStats.d.ts.map +0 -1
  107. package/lib/webrtc/stats/groupCallStats.js +0 -78
  108. package/lib/webrtc/stats/groupCallStats.js.map +0 -1
  109. package/lib/webrtc/stats/media/mediaSsrcHandler.d.ts +0 -10
  110. package/lib/webrtc/stats/media/mediaSsrcHandler.d.ts.map +0 -1
  111. package/lib/webrtc/stats/media/mediaSsrcHandler.js +0 -57
  112. package/lib/webrtc/stats/media/mediaSsrcHandler.js.map +0 -1
  113. package/lib/webrtc/stats/media/mediaTrackHandler.d.ts +0 -12
  114. package/lib/webrtc/stats/media/mediaTrackHandler.d.ts.map +0 -1
  115. package/lib/webrtc/stats/media/mediaTrackHandler.js +0 -62
  116. package/lib/webrtc/stats/media/mediaTrackHandler.js.map +0 -1
  117. package/lib/webrtc/stats/media/mediaTrackStats.d.ts +0 -86
  118. package/lib/webrtc/stats/media/mediaTrackStats.d.ts.map +0 -1
  119. package/lib/webrtc/stats/media/mediaTrackStats.js +0 -142
  120. package/lib/webrtc/stats/media/mediaTrackStats.js.map +0 -1
  121. package/lib/webrtc/stats/media/mediaTrackStatsHandler.d.ts +0 -22
  122. package/lib/webrtc/stats/media/mediaTrackStatsHandler.d.ts.map +0 -1
  123. package/lib/webrtc/stats/media/mediaTrackStatsHandler.js +0 -76
  124. package/lib/webrtc/stats/media/mediaTrackStatsHandler.js.map +0 -1
  125. package/lib/webrtc/stats/statsReport.d.ts +0 -99
  126. package/lib/webrtc/stats/statsReport.d.ts.map +0 -1
  127. package/lib/webrtc/stats/statsReport.js +0 -32
  128. package/lib/webrtc/stats/statsReport.js.map +0 -1
  129. package/lib/webrtc/stats/statsReportEmitter.d.ts +0 -15
  130. package/lib/webrtc/stats/statsReportEmitter.d.ts.map +0 -1
  131. package/lib/webrtc/stats/statsReportEmitter.js +0 -33
  132. package/lib/webrtc/stats/statsReportEmitter.js.map +0 -1
  133. package/lib/webrtc/stats/summaryStatsReportGatherer.d.ts +0 -16
  134. package/lib/webrtc/stats/summaryStatsReportGatherer.d.ts.map +0 -1
  135. package/lib/webrtc/stats/summaryStatsReportGatherer.js +0 -116
  136. package/lib/webrtc/stats/summaryStatsReportGatherer.js.map +0 -1
  137. package/lib/webrtc/stats/trackStatsBuilder.d.ts +0 -19
  138. package/lib/webrtc/stats/trackStatsBuilder.d.ts.map +0 -1
  139. package/lib/webrtc/stats/trackStatsBuilder.js +0 -168
  140. package/lib/webrtc/stats/trackStatsBuilder.js.map +0 -1
  141. package/lib/webrtc/stats/transportStats.d.ts +0 -11
  142. package/lib/webrtc/stats/transportStats.d.ts.map +0 -1
  143. package/lib/webrtc/stats/transportStats.js +0 -1
  144. package/lib/webrtc/stats/transportStats.js.map +0 -1
  145. package/lib/webrtc/stats/transportStatsBuilder.d.ts +0 -5
  146. package/lib/webrtc/stats/transportStatsBuilder.d.ts.map +0 -1
  147. package/lib/webrtc/stats/transportStatsBuilder.js +0 -34
  148. package/lib/webrtc/stats/transportStatsBuilder.js.map +0 -1
  149. package/lib/webrtc/stats/valueFormatter.d.ts +0 -4
  150. package/lib/webrtc/stats/valueFormatter.d.ts.map +0 -1
  151. package/lib/webrtc/stats/valueFormatter.js +0 -25
  152. package/lib/webrtc/stats/valueFormatter.js.map +0 -1
  153. package/src/matrixrtc/CallMembership.ts +0 -247
  154. package/src/matrixrtc/LivekitFocus.ts +0 -39
  155. package/src/matrixrtc/MatrixRTCSession.ts +0 -1319
  156. package/src/matrixrtc/MatrixRTCSessionManager.ts +0 -166
  157. package/src/matrixrtc/focus.ts +0 -25
  158. package/src/matrixrtc/index.ts +0 -22
  159. package/src/matrixrtc/types.ts +0 -36
  160. package/src/webrtc/audioContext.ts +0 -44
  161. package/src/webrtc/call.ts +0 -3074
  162. package/src/webrtc/callEventHandler.ts +0 -425
  163. package/src/webrtc/callEventTypes.ts +0 -93
  164. package/src/webrtc/callFeed.ts +0 -364
  165. package/src/webrtc/groupCall.ts +0 -1735
  166. package/src/webrtc/groupCallEventHandler.ts +0 -234
  167. package/src/webrtc/mediaHandler.ts +0 -484
  168. package/src/webrtc/stats/callFeedStatsReporter.ts +0 -94
  169. package/src/webrtc/stats/callStatsReportGatherer.ts +0 -219
  170. package/src/webrtc/stats/callStatsReportSummary.ts +0 -30
  171. package/src/webrtc/stats/connectionStats.ts +0 -47
  172. package/src/webrtc/stats/connectionStatsBuilder.ts +0 -28
  173. package/src/webrtc/stats/connectionStatsReportBuilder.ts +0 -140
  174. package/src/webrtc/stats/groupCallStats.ts +0 -93
  175. package/src/webrtc/stats/media/mediaSsrcHandler.ts +0 -57
  176. package/src/webrtc/stats/media/mediaTrackHandler.ts +0 -76
  177. package/src/webrtc/stats/media/mediaTrackStats.ts +0 -176
  178. package/src/webrtc/stats/media/mediaTrackStatsHandler.ts +0 -90
  179. package/src/webrtc/stats/statsReport.ts +0 -133
  180. package/src/webrtc/stats/statsReportEmitter.ts +0 -49
  181. package/src/webrtc/stats/summaryStatsReportGatherer.ts +0 -148
  182. package/src/webrtc/stats/trackStatsBuilder.ts +0 -207
  183. package/src/webrtc/stats/transportStats.ts +0 -26
  184. package/src/webrtc/stats/transportStatsBuilder.ts +0 -48
  185. package/src/webrtc/stats/valueFormatter.ts +0 -27
@@ -1 +1 @@
1
- {"version":3,"file":"embedded.d.ts","sourceRoot":"","sources":["../src/embedded.ts"],"names":[],"mappings":"AAgBA,OAAO,EACH,SAAS,EAaZ,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,WAAW,EAAiC,MAAM,mBAAmB,CAAC;AAC/E,OAAO,EACH,kBAAkB,EAClB,2BAA2B,EAC3B,wBAAwB,EACxB,wBAAwB,EAC3B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAa,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAE3D,OAAO,EACH,YAAY,EAEZ,uBAAuB,EACvB,gBAAgB,EAChB,sBAAsB,E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CAAC,CAAC,CAAC,EACvB,QAAQ,SAAK,GACd,OAAO,CAAC,wBAAwB,CAAC;IAgBpC,OAAO,CAAC,gCAAgC;IAOxC;;OAEG;IAEU,4BAA4B,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,wBAAwB,GAAG,OAAO,CAAC,EAAE,CAAC;IAQ5F,YAAY,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,sBAAsB,GAAG,OAAO,CAAC,EAAE,CAAC;IAKhF,cAAc,IAAI,OAAO,CAAC,YAAY,CAAC;IAYvC,aAAa,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC;IAUjE,uBAAuB,CAAC,iBAAiB,EAAE,UAAU,CAAC,UAAU,CAAC,EAAE,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAajH;;;;;;;;;;;;OAYG;IACU,wBAAwB,CACjC,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,OAAO,EAClB,UAAU,EAAE,sBAAsB,GACnC,OAAO,CAAC,IAAI,CAAC;IAMH,gBAAgB,IAAI,OAAO,CAAC,OAAO,CAAC;IAK1C,YAAY,IAAI,SAAS,GAAG,IAAI;IAIvC,OAAO,CAAC,YAAY;YAMN,GAAG;IAIjB,OAAO,CAAC,UAAU,CAwChB;IAEF,OAAO,CAAC,OAAO,CAoBb;IAEF,OAAO,CAAC,UAAU,CAchB;YAEY,gBAAgB;CAyBjC"}
package/lib/embedded.js CHANGED
@@ -294,7 +294,6 @@ export class RoomWidgetClient extends MatrixClient {
294
294
  }
295
295
  _this2.setSyncState(SyncState.Syncing);
296
296
  logger.info("Finished backfilling events");
297
- _this2.matrixRTC.start();
298
297
 
299
298
  // Watch for TURN servers, if requested
300
299
  if (_this2.capabilities.turnServers) _this2.watchTurnServers();
@@ -1 +1 @@
1
- {"version":3,"file":"embedded.js","names":["WidgetApiToWidgetAction","WidgetApiResponseError","MatrixCapabilities","MatrixEvent","EventStatus","EventType","logger","MatrixClient","ClientEvent","UNSTABLE_MSC4140_DELAYED_EVENTS","SyncApi","SyncState","SlidingSyncSdk","MatrixError","User","MapWithDefault","recursiveMapToObject","TypedEventEmitter","RoomWidgetClientEvent","RoomWidgetClient","constructor","widgetApi","capabilities","roomId","opts","sendContentLoaded","_this","_capabilities$sendEve","_capabilities$receive","_capabilities$sendSta","_capabilities$receive2","_capabilities$sendEve2","_capabilities$receive3","_capabilities$sendSta2","_capabilities$receive4","_capabilities$sendToD","_capabilities$receive5","_capabilities$sendEve3","_capabilities$sendSta3","this","_defineProperty","_ref","_asyncToGenerator","event","getSender","getUserId","pendingSendingEventsTxId","some","p","getType","type","_this$pendingSendingE","matchingTxId","find","id","getId","txId","length","_this$pendingSendingE2","Promise","resolve","eventEmitter","once","PendingEventsChanged","setTxnId","setUnsigned","_objectSpread","getUnsigned","transaction_id","filter","emit","_x","apply","arguments","_ref2","ev","preventDefault","detail","data","room_id","updateTxId","syncApi","injectRoomEvents","room","Event","setSyncState","Syncing","info","concat","getStateKey","event_id","eventId","ack","_x2","_ref3","sender","content","encrypted","makeEncrypted","RoomMessageEncrypted","ToDeviceEvent","_x3","transportSend","transport","send","bind","_ref4","action","error","processAndThrow","_x4","_x5","transportSendComplete","sendComplete","_ref5","_x6","_x7","widgetApiReady","sendEvent","receiveEvent","sendMessage","Array","isArray","receiveMessage","sendState","receiveState","requestCapabilityForRoomTimeline","forEach","eventType","requestCapabilityToSendEvent","requestCapabilityToReceiveEvent","requestCapabilityToSendMessage","msgType","requestCapabilityToReceiveMessage","_ref6","stateKey","requestCapabilityToSendState","_ref7","requestCapabilityToReceiveState","sendToDevice","requestCapabilityToSendToDevice","receiveToDevice","requestCapabilityToReceiveToDevice","sendDelayedEvents","requestCapability","MSC4157SendDelayedEvent","updateDelayedEvents","MSC4157UpdateDelayedEvent","turnServers","MSC3846TurnServers","on","SendEvent","onEvent","SendToDevice","onToDevice","start","startClient","_arguments","_this2","_this2$capabilities$r","_this2$capabilities$r2","undefined","lifecycle","AbortController","userId","store","storeUser","slidingSync","buildSyncApiOptions","createRoom","storeRoom","all","map","_ref9","_ref8","rawEvents","readStateEvents","events","rawEvent","_x8","clientWellKnownPollPeriod","clientWellKnownIntervalID","setInterval","fetchClientWellKnown","matrixRTC","watchTurnServers","stopClient","off","abort","joinRoom","roomIdOrAlias","_this3","Error","encryptAndSendEvent","delayOpts","_this4","redacts","getContent","response","sendRoomEvent","delay","parent_delay_id","validateSendDelayedEventResponse","getTxnId","push","e","updatePendingEventStatus","NOT_SENT","updatePendingEvent","SENT","sendStateEvent","_arguments2","_this5","_unstable_sendDelayedStateEvent","_arguments3","_this6","doesServerSupportUnstableFeature","delay_id","_unstable_updateDelayedEvent","delayId","_this7","updateDelayedEvent","contentMap","_this8","getOpenIdToken","_this9","token","requestOpenIDConnectToken","access_token","expires_in","matrix_server_name","token_type","queueToDevice","_ref10","_this10","batch","Map","deviceId","payload","getOrCreate","set","encryptAndSendToDevices","userDeviceInfoArr","_this11","deviceInfo","sendToDeviceViaWidgetApi","_this12","checkTurnServers","_this13","getSyncState","syncState","state","oldState","Sync","_this14","reply","_this15","servers","getTurnServers","onClientStopped","return","signal","addEventListener","_iteratorAbruptCompletion","_didIteratorError","_iteratorError","_iterator","_asyncIterator","_step","next","done","server","value","urls","uris","username","credential","password","TurnServers","log","err","warn","removeEventListener","matrix_api_error","fromWidgetApiErrorData"],"sources":["../src/embedded.ts"],"sourcesContent":["/*\nCopyright 2022 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\nimport {\n WidgetApi,\n WidgetApiToWidgetAction,\n WidgetApiResponseError,\n MatrixCapabilities,\n IWidgetApiRequest,\n IWidgetApiAcknowledgeResponseData,\n ISendEventToWidgetActionRequest,\n ISendToDeviceToWidgetActionRequest,\n ISendEventFromWidgetResponseData,\n IWidgetApiRequestData,\n WidgetApiAction,\n IWidgetApiResponse,\n IWidgetApiResponseData,\n} from \"matrix-widget-api\";\n\nimport { MatrixEvent, IEvent, IContent, EventStatus } from \"./models/event.ts\";\nimport {\n ISendEventResponse,\n SendDelayedEventRequestOpts,\n SendDelayedEventResponse,\n UpdateDelayedEventAction,\n} from \"./@types/requests.ts\";\nimport { EventType, StateEvents } from \"./@types/event.ts\";\nimport { logger } from \"./logger.ts\";\nimport {\n MatrixClient,\n ClientEvent,\n IMatrixClientCreateOpts,\n IStartClientOpts,\n SendToDeviceContentMap,\n IOpenIDToken,\n UNSTABLE_MSC4140_DELAYED_EVENTS,\n} from \"./client.ts\";\nimport { SyncApi, SyncState } from \"./sync.ts\";\nimport { SlidingSyncSdk } from \"./sliding-sync-sdk.ts\";\nimport { MatrixError } from \"./http-api/errors.ts\";\nimport { User } from \"./models/user.ts\";\nimport { Room } from \"./models/room.ts\";\nimport { ToDeviceBatch, ToDevicePayload } from \"./models/ToDeviceMessage.ts\";\nimport { DeviceInfo } from \"./crypto/deviceinfo.ts\";\nimport { IOlmDevice } from \"./crypto/algorithms/megolm.ts\";\nimport { MapWithDefault, recursiveMapToObject } from \"./utils.ts\";\nimport { TypedEventEmitter } from \"./matrix.ts\";\n\ninterface IStateEventRequest {\n eventType: string;\n stateKey?: string;\n}\n\nexport interface ICapabilities {\n /**\n * Event types that this client expects to send.\n */\n sendEvent?: string[];\n /**\n * Event types that this client expects to receive.\n */\n receiveEvent?: string[];\n\n /**\n * Message types that this client expects to send, or true for all message\n * types.\n */\n sendMessage?: string[] | true;\n /**\n * Message types that this client expects to receive, or true for all\n * message types.\n */\n receiveMessage?: string[] | true;\n\n /**\n * Types of state events that this client expects to send.\n */\n sendState?: IStateEventRequest[];\n /**\n * Types of state events that this client expects to receive.\n */\n receiveState?: IStateEventRequest[];\n\n /**\n * To-device event types that this client expects to send.\n */\n sendToDevice?: string[];\n /**\n * To-device event types that this client expects to receive.\n */\n receiveToDevice?: string[];\n\n /**\n * Whether this client needs access to TURN servers.\n * @defaultValue false\n */\n turnServers?: boolean;\n\n /**\n * Whether this client needs to be able to send delayed events.\n * @experimental Part of MSC4140 & MSC4157\n * @defaultValue false\n */\n sendDelayedEvents?: boolean;\n\n /**\n * Whether this client needs to be able to update delayed events.\n * @experimental Part of MSC4140 & MSC4157\n * @defaultValue false\n */\n updateDelayedEvents?: boolean;\n}\n\nexport enum RoomWidgetClientEvent {\n PendingEventsChanged = \"PendingEvent.pendingEventsChanged\",\n}\nexport type EventHandlerMap = { [RoomWidgetClientEvent.PendingEventsChanged]: () => void };\n/**\n * A MatrixClient that routes its requests through the widget API instead of the\n * real CS API.\n * @experimental This class is considered unstable!\n */\nexport class RoomWidgetClient extends MatrixClient {\n private room?: Room;\n private readonly widgetApiReady: Promise<void>;\n private lifecycle?: AbortController;\n private syncState: SyncState | null = null;\n\n private pendingSendingEventsTxId: { type: string; id: string | undefined; txId: string }[] = [];\n private eventEmitter = new TypedEventEmitter<keyof EventHandlerMap, EventHandlerMap>();\n\n /**\n *\n * @param widgetApi - The widget api to use for communication.\n * @param capabilities - The capabilities the widget client will request.\n * @param roomId - The room id the widget is associated with.\n * @param opts - The configuration options for this client.\n * @param sendContentLoaded - Whether to send a content loaded widget action immediately after initial setup.\n * Set to `false` if the widget uses `waitForIFrameLoad=true` (in this case the client does not expect a content loaded action at all),\n * or if the the widget wants to send the `ContentLoaded` action at a later point in time after the initial setup.\n */\n public constructor(\n private readonly widgetApi: WidgetApi,\n private readonly capabilities: ICapabilities,\n private readonly roomId: string,\n opts: IMatrixClientCreateOpts,\n sendContentLoaded: boolean,\n ) {\n super(opts);\n\n const transportSend = this.widgetApi.transport.send.bind(this.widgetApi.transport);\n this.widgetApi.transport.send = async <\n T extends IWidgetApiRequestData,\n R extends IWidgetApiResponseData = IWidgetApiAcknowledgeResponseData,\n >(\n action: WidgetApiAction,\n data: T,\n ): Promise<R> => {\n try {\n return await transportSend(action, data);\n } catch (error) {\n processAndThrow(error);\n }\n };\n\n const transportSendComplete = this.widgetApi.transport.sendComplete.bind(this.widgetApi.transport);\n this.widgetApi.transport.sendComplete = async <T extends IWidgetApiRequestData, R extends IWidgetApiResponse>(\n action: WidgetApiAction,\n data: T,\n ): Promise<R> => {\n try {\n return await transportSendComplete(action, data);\n } catch (error) {\n processAndThrow(error);\n }\n };\n\n this.widgetApiReady = new Promise<void>((resolve) => this.widgetApi.once(\"ready\", resolve));\n\n // Request capabilities for the functionality this client needs to support\n if (\n capabilities.sendEvent?.length ||\n capabilities.receiveEvent?.length ||\n capabilities.sendMessage === true ||\n (Array.isArray(capabilities.sendMessage) && capabilities.sendMessage.length) ||\n capabilities.receiveMessage === true ||\n (Array.isArray(capabilities.receiveMessage) && capabilities.receiveMessage.length) ||\n capabilities.sendState?.length ||\n capabilities.receiveState?.length\n ) {\n widgetApi.requestCapabilityForRoomTimeline(roomId);\n }\n capabilities.sendEvent?.forEach((eventType) => widgetApi.requestCapabilityToSendEvent(eventType));\n capabilities.receiveEvent?.forEach((eventType) => widgetApi.requestCapabilityToReceiveEvent(eventType));\n if (capabilities.sendMessage === true) {\n widgetApi.requestCapabilityToSendMessage();\n } else if (Array.isArray(capabilities.sendMessage)) {\n capabilities.sendMessage.forEach((msgType) => widgetApi.requestCapabilityToSendMessage(msgType));\n }\n if (capabilities.receiveMessage === true) {\n widgetApi.requestCapabilityToReceiveMessage();\n } else if (Array.isArray(capabilities.receiveMessage)) {\n capabilities.receiveMessage.forEach((msgType) => widgetApi.requestCapabilityToReceiveMessage(msgType));\n }\n capabilities.sendState?.forEach(({ eventType, stateKey }) =>\n widgetApi.requestCapabilityToSendState(eventType, stateKey),\n );\n capabilities.receiveState?.forEach(({ eventType, stateKey }) =>\n widgetApi.requestCapabilityToReceiveState(eventType, stateKey),\n );\n capabilities.sendToDevice?.forEach((eventType) => widgetApi.requestCapabilityToSendToDevice(eventType));\n capabilities.receiveToDevice?.forEach((eventType) => widgetApi.requestCapabilityToReceiveToDevice(eventType));\n if (\n capabilities.sendDelayedEvents &&\n (capabilities.sendEvent?.length ||\n capabilities.sendMessage === true ||\n (Array.isArray(capabilities.sendMessage) && capabilities.sendMessage.length) ||\n capabilities.sendState?.length)\n ) {\n widgetApi.requestCapability(MatrixCapabilities.MSC4157SendDelayedEvent);\n }\n if (capabilities.updateDelayedEvents) {\n widgetApi.requestCapability(MatrixCapabilities.MSC4157UpdateDelayedEvent);\n }\n if (capabilities.turnServers) {\n widgetApi.requestCapability(MatrixCapabilities.MSC3846TurnServers);\n }\n\n widgetApi.on(`action:${WidgetApiToWidgetAction.SendEvent}`, this.onEvent);\n widgetApi.on(`action:${WidgetApiToWidgetAction.SendToDevice}`, this.onToDevice);\n\n // Open communication with the host\n widgetApi.start();\n // Send a content loaded event now we've started the widget API\n // Note that element-web currently does not use waitForIFrameLoad=false and so\n // does *not* (yes, that is the right way around) wait for this event. Let's\n // start sending this, then once this has rolled out, we can change element-web to\n // use waitForIFrameLoad=false and have a widget API that's less racy.\n if (sendContentLoaded) widgetApi.sendContentLoaded();\n }\n\n public async startClient(opts: IStartClientOpts = {}): Promise<void> {\n this.lifecycle = new AbortController();\n\n // Create our own user object artificially (instead of waiting for sync)\n // so it's always available, even if the user is not in any rooms etc.\n const userId = this.getUserId();\n if (userId) {\n this.store.storeUser(new User(userId));\n }\n\n // Even though we have no access token and cannot sync, the sync class\n // still has some valuable helper methods that we make use of, so we\n // instantiate it anyways\n if (opts.slidingSync) {\n this.syncApi = new SlidingSyncSdk(opts.slidingSync, this, opts, this.buildSyncApiOptions());\n } else {\n this.syncApi = new SyncApi(this, opts, this.buildSyncApiOptions());\n }\n\n this.room = this.syncApi.createRoom(this.roomId);\n this.store.storeRoom(this.room);\n\n await this.widgetApiReady;\n\n // Backfill the requested events\n // We only get the most recent event for every type + state key combo,\n // so it doesn't really matter what order we inject them in\n await Promise.all(\n this.capabilities.receiveState?.map(async ({ eventType, stateKey }) => {\n const rawEvents = await this.widgetApi.readStateEvents(eventType, undefined, stateKey, [this.roomId]);\n const events = rawEvents.map((rawEvent) => new MatrixEvent(rawEvent as Partial<IEvent>));\n\n await this.syncApi!.injectRoomEvents(this.room!, [], events);\n events.forEach((event) => {\n this.emit(ClientEvent.Event, event);\n logger.info(`Backfilled event ${event.getId()} ${event.getType()} ${event.getStateKey()}`);\n });\n }) ?? [],\n );\n\n if (opts.clientWellKnownPollPeriod !== undefined) {\n this.clientWellKnownIntervalID = setInterval(() => {\n this.fetchClientWellKnown();\n }, 1000 * opts.clientWellKnownPollPeriod);\n this.fetchClientWellKnown();\n }\n\n this.setSyncState(SyncState.Syncing);\n logger.info(\"Finished backfilling events\");\n\n this.matrixRTC.start();\n\n // Watch for TURN servers, if requested\n if (this.capabilities.turnServers) this.watchTurnServers();\n }\n\n public stopClient(): void {\n this.widgetApi.off(`action:${WidgetApiToWidgetAction.SendEvent}`, this.onEvent);\n this.widgetApi.off(`action:${WidgetApiToWidgetAction.SendToDevice}`, this.onToDevice);\n\n super.stopClient();\n this.lifecycle!.abort(); // Signal to other async tasks that the client has stopped\n }\n\n public async joinRoom(roomIdOrAlias: string): Promise<Room> {\n if (roomIdOrAlias === this.roomId) return this.room!;\n throw new Error(`Unknown room: ${roomIdOrAlias}`);\n }\n\n protected async encryptAndSendEvent(room: Room, event: MatrixEvent): Promise<ISendEventResponse>;\n protected async encryptAndSendEvent(\n room: Room,\n event: MatrixEvent,\n delayOpts: SendDelayedEventRequestOpts,\n ): Promise<SendDelayedEventResponse>;\n protected async encryptAndSendEvent(\n room: Room,\n event: MatrixEvent,\n delayOpts?: SendDelayedEventRequestOpts,\n ): Promise<ISendEventResponse | SendDelayedEventResponse> {\n // We need to extend the content with the redacts parameter\n // The js sdk uses event.redacts but the widget api uses event.content.redacts\n // This will be converted back to event.redacts in the widget driver.\n const content = event.event.redacts\n ? { ...event.getContent(), redacts: event.event.redacts }\n : event.getContent();\n\n // Delayed event special case.\n if (delayOpts) {\n // TODO: updatePendingEvent for delayed events?\n const response = await this.widgetApi.sendRoomEvent(\n event.getType(),\n content,\n room.roomId,\n \"delay\" in delayOpts ? delayOpts.delay : undefined,\n \"parent_delay_id\" in delayOpts ? delayOpts.parent_delay_id : undefined,\n );\n return this.validateSendDelayedEventResponse(response);\n }\n\n const txId = event.getTxnId();\n // Add the txnId to the pending list (still with unknown evID)\n if (txId) this.pendingSendingEventsTxId.push({ type: event.getType(), id: undefined, txId });\n\n let response: ISendEventFromWidgetResponseData;\n try {\n response = await this.widgetApi.sendRoomEvent(event.getType(), content, room.roomId);\n } catch (e) {\n this.updatePendingEventStatus(room, event, EventStatus.NOT_SENT);\n throw e;\n }\n // This also checks for an event id on the response\n room.updatePendingEvent(event, EventStatus.SENT, response.event_id);\n\n // Update the pending events list with the eventId\n this.pendingSendingEventsTxId.forEach((p) => {\n if (p.txId === txId) p.id = response.event_id;\n });\n this.eventEmitter.emit(RoomWidgetClientEvent.PendingEventsChanged);\n\n return { event_id: response.event_id! };\n }\n\n public async sendStateEvent(\n roomId: string,\n eventType: string,\n content: any,\n stateKey = \"\",\n ): Promise<ISendEventResponse> {\n const response = await this.widgetApi.sendStateEvent(eventType, stateKey, content, roomId);\n if (response.event_id === undefined) {\n throw new Error(\"'event_id' absent from response to an event request\");\n }\n return { event_id: response.event_id };\n }\n\n /**\n * @experimental This currently relies on an unstable MSC (MSC4140).\n */\n // eslint-disable-next-line\n public async _unstable_sendDelayedStateEvent<K extends keyof StateEvents>(\n roomId: string,\n delayOpts: SendDelayedEventRequestOpts,\n eventType: K,\n content: StateEvents[K],\n stateKey = \"\",\n ): Promise<SendDelayedEventResponse> {\n if (!(await this.doesServerSupportUnstableFeature(UNSTABLE_MSC4140_DELAYED_EVENTS))) {\n throw Error(\"Server does not support the delayed events API\");\n }\n\n const response = await this.widgetApi.sendStateEvent(\n eventType,\n stateKey,\n content,\n roomId,\n \"delay\" in delayOpts ? delayOpts.delay : undefined,\n \"parent_delay_id\" in delayOpts ? delayOpts.parent_delay_id : undefined,\n );\n return this.validateSendDelayedEventResponse(response);\n }\n\n private validateSendDelayedEventResponse(response: ISendEventFromWidgetResponseData): SendDelayedEventResponse {\n if (response.delay_id === undefined) {\n throw new Error(\"'delay_id' absent from response to a delayed event request\");\n }\n return { delay_id: response.delay_id };\n }\n\n /**\n * @experimental This currently relies on an unstable MSC (MSC4140).\n */\n // eslint-disable-next-line\n public async _unstable_updateDelayedEvent(delayId: string, action: UpdateDelayedEventAction): Promise<{}> {\n if (!(await this.doesServerSupportUnstableFeature(UNSTABLE_MSC4140_DELAYED_EVENTS))) {\n throw Error(\"Server does not support the delayed events API\");\n }\n\n return await this.widgetApi.updateDelayedEvent(delayId, action);\n }\n\n public async sendToDevice(eventType: string, contentMap: SendToDeviceContentMap): Promise<{}> {\n await this.widgetApi.sendToDevice(eventType, false, recursiveMapToObject(contentMap));\n return {};\n }\n\n public async getOpenIdToken(): Promise<IOpenIDToken> {\n const token = await this.widgetApi.requestOpenIDConnectToken();\n // the IOpenIDCredentials from the widget-api and IOpenIDToken form the matrix-js-sdk are compatible.\n // we still recreate the token to make this transparent and catch'able by the linter in case the types change in the future.\n return <IOpenIDToken>{\n access_token: token.access_token,\n expires_in: token.expires_in,\n matrix_server_name: token.matrix_server_name,\n token_type: token.token_type,\n };\n }\n\n public async queueToDevice({ eventType, batch }: ToDeviceBatch): Promise<void> {\n // map: user Id → device Id → payload\n const contentMap: MapWithDefault<string, Map<string, ToDevicePayload>> = new MapWithDefault(() => new Map());\n for (const { userId, deviceId, payload } of batch) {\n contentMap.getOrCreate(userId).set(deviceId, payload);\n }\n\n await this.widgetApi.sendToDevice(eventType, false, recursiveMapToObject(contentMap));\n }\n\n public async encryptAndSendToDevices(userDeviceInfoArr: IOlmDevice<DeviceInfo>[], payload: object): Promise<void> {\n // map: user Id → device Id → payload\n const contentMap: MapWithDefault<string, Map<string, object>> = new MapWithDefault(() => new Map());\n for (const {\n userId,\n deviceInfo: { deviceId },\n } of userDeviceInfoArr) {\n contentMap.getOrCreate(userId).set(deviceId, payload);\n }\n\n await this.widgetApi.sendToDevice((payload as { type: string }).type, true, recursiveMapToObject(contentMap));\n }\n\n /**\n * Send an event to a specific list of devices via the widget API. Optionally encrypts the event.\n *\n * If you are using a full MatrixClient you would be calling {@link MatrixClient.getCrypto().encryptToDeviceMessages()} followed\n * by {@link MatrixClient.queueToDevice}.\n *\n * However, this is combined into a single step when running as an embedded widget client. So, we expose this method for those\n * that need it.\n *\n * @param eventType - Type of the event to send.\n * @param encrypted - Whether the event should be encrypted.\n * @param contentMap - The content to send. Map from user_id to device_id to content object.\n */\n public async sendToDeviceViaWidgetApi(\n eventType: string,\n encrypted: boolean,\n contentMap: SendToDeviceContentMap,\n ): Promise<void> {\n await this.widgetApi.sendToDevice(eventType, encrypted, recursiveMapToObject(contentMap));\n }\n\n // Overridden since we get TURN servers automatically over the widget API,\n // and this method would otherwise complain about missing an access token\n public async checkTurnServers(): Promise<boolean> {\n return this.turnServers.length > 0;\n }\n\n // Overridden since we 'sync' manually without the sync API\n public getSyncState(): SyncState | null {\n return this.syncState;\n }\n\n private setSyncState(state: SyncState): void {\n const oldState = this.syncState;\n this.syncState = state;\n this.emit(ClientEvent.Sync, state, oldState);\n }\n\n private async ack(ev: CustomEvent<IWidgetApiRequest>): Promise<void> {\n await this.widgetApi.transport.reply<IWidgetApiAcknowledgeResponseData>(ev.detail, {});\n }\n\n private updateTxId = async (event: MatrixEvent): Promise<void> => {\n // We update the txId for remote echos that originate from this client.\n // This happens with the help of `pendingSendingEventsTxId` where we store all events that are currently sending\n // with their widget txId and once ready the final evId.\n if (\n // This could theoretically be an event send by this device\n // In that case we need to update the txId of the event because the embedded client/widget\n // knows this event with a different transaction Id than what was used by the host client.\n event.getSender() === this.getUserId() &&\n // We optimize by not blocking events from types that we have not send\n // with this client.\n this.pendingSendingEventsTxId.some((p) => event.getType() === p.type)\n ) {\n // Compare by event Id if we have a matching pending event where we know the txId.\n let matchingTxId = this.pendingSendingEventsTxId.find((p) => p.id === event.getId())?.txId;\n // Block any further processing of this event until we have received the sending response.\n // -> until we know the event id.\n // -> until we have not pending events anymore.\n while (!matchingTxId && this.pendingSendingEventsTxId.length > 0) {\n // Recheck whenever the PendingEventsChanged\n await new Promise<void>((resolve) =>\n this.eventEmitter.once(RoomWidgetClientEvent.PendingEventsChanged, () => resolve()),\n );\n matchingTxId = this.pendingSendingEventsTxId.find((p) => p.id === event.getId())?.txId;\n }\n\n // We found the correct txId: we update the event and delete the entry of the pending events.\n if (matchingTxId) {\n event.setTxnId(matchingTxId);\n event.setUnsigned({ ...event.getUnsigned(), transaction_id: matchingTxId });\n }\n this.pendingSendingEventsTxId = this.pendingSendingEventsTxId.filter((p) => p.id !== event.getId());\n\n // Emit once there are no pending events anymore to release all other events that got\n // awaited in the `while (!matchingTxId && this.pendingSendingEventsTxId.length > 0)` loop\n // but are not send by this client.\n if (this.pendingSendingEventsTxId.length === 0) {\n this.eventEmitter.emit(RoomWidgetClientEvent.PendingEventsChanged);\n }\n }\n };\n\n private onEvent = async (ev: CustomEvent<ISendEventToWidgetActionRequest>): Promise<void> => {\n ev.preventDefault();\n\n // Verify the room ID matches, since it's possible for the client to\n // send us events from other rooms if this widget is always on screen\n if (ev.detail.data.room_id === this.roomId) {\n const event = new MatrixEvent(ev.detail.data as Partial<IEvent>);\n\n // Only inject once we have update the txId\n await this.updateTxId(event);\n await this.syncApi!.injectRoomEvents(this.room!, [], [event]);\n this.emit(ClientEvent.Event, event);\n this.setSyncState(SyncState.Syncing);\n logger.info(`Received event ${event.getId()} ${event.getType()} ${event.getStateKey()}`);\n } else {\n const { event_id: eventId, room_id: roomId } = ev.detail.data;\n logger.info(`Received event ${eventId} for a different room ${roomId}; discarding`);\n }\n\n await this.ack(ev);\n };\n\n private onToDevice = async (ev: CustomEvent<ISendToDeviceToWidgetActionRequest>): Promise<void> => {\n ev.preventDefault();\n\n const event = new MatrixEvent({\n type: ev.detail.data.type,\n sender: ev.detail.data.sender,\n content: ev.detail.data.content as IContent,\n });\n // Mark the event as encrypted if it was, using fake contents and keys since those are unknown to us\n if (ev.detail.data.encrypted) event.makeEncrypted(EventType.RoomMessageEncrypted, {}, \"\", \"\");\n\n this.emit(ClientEvent.ToDeviceEvent, event);\n this.setSyncState(SyncState.Syncing);\n await this.ack(ev);\n };\n\n private async watchTurnServers(): Promise<void> {\n const servers = this.widgetApi.getTurnServers();\n const onClientStopped = (): void => {\n servers.return(undefined);\n };\n this.lifecycle!.signal.addEventListener(\"abort\", onClientStopped);\n\n try {\n for await (const server of servers) {\n this.turnServers = [\n {\n urls: server.uris,\n username: server.username,\n credential: server.password,\n },\n ];\n this.emit(ClientEvent.TurnServers, this.turnServers);\n logger.log(`Received TURN server: ${server.uris}`);\n }\n } catch (e) {\n logger.warn(\"Error watching TURN servers\", e);\n } finally {\n this.lifecycle!.signal.removeEventListener(\"abort\", onClientStopped);\n }\n }\n}\n\nfunction processAndThrow(error: unknown): never {\n if (error instanceof WidgetApiResponseError && error.data.matrix_api_error) {\n throw MatrixError.fromWidgetApiErrorData(error.data.matrix_api_error);\n } else {\n throw error;\n }\n}\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAEIA,uBAAuB,EACvBC,sBAAsB,EACtBC,kBAAkB,QAUf,mBAAmB;AAE1B,SAASC,WAAW,EAAoBC,WAAW,QAAQ,mBAAmB;AAO9E,SAASC,SAAS,QAAqB,mBAAmB;AAC1D,SAASC,MAAM,QAAQ,aAAa;AACpC,SACIC,YAAY,EACZC,WAAW,EAKXC,+BAA+B,QAC5B,aAAa;AACpB,SAASC,OAAO,EAAEC,SAAS,QAAQ,WAAW;AAC9C,SAASC,cAAc,QAAQ,uBAAuB;AAC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AC5G,WAAW,CAAC;cACpD9I,MAAM,CAACiR,GAAG,0BAAA/L,MAAA,CAA0BuL,MAAM,CAACG,IAAI,CAAE,CAAC;YAAC;UACvD;QAAC,SAAAM,GAAA;UAAAhB,iBAAA;UAAAC,cAAA,GAAAe,GAAA;QAAA;UAAA;YAAA,IAAAjB,yBAAA,IAAAG,SAAA,CAAAN,MAAA;cAAA,MAAAM,SAAA,CAAAN,MAAA;YAAA;UAAA;YAAA,IAAAI,iBAAA;cAAA,MAAAC,cAAA;YAAA;UAAA;QAAA;MACL,CAAC,CAAC,OAAO5D,CAAC,EAAE;QACRvM,MAAM,CAACmR,IAAI,CAAC,6BAA6B,EAAE5E,CAAC,CAAC;MACjD,CAAC,SAAS;QACNmD,OAAI,CAAC9F,SAAS,CAAEmG,MAAM,CAACqB,mBAAmB,CAAC,OAAO,EAAEvB,eAAe,CAAC;MACxE;IAAC;EACL;AACJ;AAEA,SAAStJ,eAAeA,CAACD,KAAc,EAAS;EAC5C,IAAIA,KAAK,YAAY3G,sBAAsB,IAAI2G,KAAK,CAAC9B,IAAI,CAAC6M,gBAAgB,EAAE;IACxE,MAAM9Q,WAAW,CAAC+Q,sBAAsB,CAAChL,KAAK,CAAC9B,IAAI,CAAC6M,gBAAgB,CAAC;EACzE,CAAC,MAAM;IACH,MAAM/K,KAAK;EACf;AACJ","ignoreList":[]}
1
+ {"version":3,"file":"embedded.js","names":["WidgetApiToWidgetAction","WidgetApiResponseError","MatrixCapabilities","MatrixEvent","EventStatus","EventType","logger","MatrixClient","ClientEvent","UNSTABLE_MSC4140_DELAYED_EVENTS","SyncApi","SyncState","SlidingSyncSdk","MatrixError","User","MapWithDefault","recursiveMapToObject","TypedEventEmitter","RoomWidgetClientEvent","RoomWidgetClient","constructor","widgetApi","capabilities","roomId","opts","sendContentLoaded","_this","_capabilities$sendEve","_capabilities$receive","_capabilities$sendSta","_capabilities$receive2","_capabilities$sendEve2","_capabilities$receive3","_capabilities$sendSta2","_capabilities$receive4","_capabilities$sendToD","_capabilities$receive5","_capabilities$sendEve3","_capabilities$sendSta3","this","_defineProperty","_ref","_asyncToGenerator","event","getSender","getUserId","pendingSendingEventsTxId","some","p","getType","type","_this$pendingSendingE","matchingTxId","find","id","getId","txId","length","_this$pendingSendingE2","Promise","resolve","eventEmitter","once","PendingEventsChanged","setTxnId","setUnsigned","_objectSpread","getUnsigned","transaction_id","filter","emit","_x","apply","arguments","_ref2","ev","preventDefault","detail","data","room_id","updateTxId","syncApi","injectRoomEvents","room","Event","setSyncState","Syncing","info","concat","getStateKey","event_id","eventId","ack","_x2","_ref3","sender","content","encrypted","makeEncrypted","RoomMessageEncrypted","ToDeviceEvent","_x3","transportSend","transport","send","bind","_ref4","action","error","processAndThrow","_x4","_x5","transportSendComplete","sendComplete","_ref5","_x6","_x7","widgetApiReady","sendEvent","receiveEvent","sendMessage","Array","isArray","receiveMessage","sendState","receiveState","requestCapabilityForRoomTimeline","forEach","eventType","requestCapabilityToSendEvent","requestCapabilityToReceiveEvent","requestCapabilityToSendMessage","msgType","requestCapabilityToReceiveMessage","_ref6","stateKey","requestCapabilityToSendState","_ref7","requestCapabilityToReceiveState","sendToDevice","requestCapabilityToSendToDevice","receiveToDevice","requestCapabilityToReceiveToDevice","sendDelayedEvents","requestCapability","MSC4157SendDelayedEvent","updateDelayedEvents","MSC4157UpdateDelayedEvent","turnServers","MSC3846TurnServers","on","SendEvent","onEvent","SendToDevice","onToDevice","start","startClient","_arguments","_this2","_this2$capabilities$r","_this2$capabilities$r2","undefined","lifecycle","AbortController","userId","store","storeUser","slidingSync","buildSyncApiOptions","createRoom","storeRoom","all","map","_ref9","_ref8","rawEvents","readStateEvents","events","rawEvent","_x8","clientWellKnownPollPeriod","clientWellKnownIntervalID","setInterval","fetchClientWellKnown","watchTurnServers","stopClient","off","abort","joinRoom","roomIdOrAlias","_this3","Error","encryptAndSendEvent","delayOpts","_this4","redacts","getContent","response","sendRoomEvent","delay","parent_delay_id","validateSendDelayedEventResponse","getTxnId","push","e","updatePendingEventStatus","NOT_SENT","updatePendingEvent","SENT","sendStateEvent","_arguments2","_this5","_unstable_sendDelayedStateEvent","_arguments3","_this6","doesServerSupportUnstableFeature","delay_id","_unstable_updateDelayedEvent","delayId","_this7","updateDelayedEvent","contentMap","_this8","getOpenIdToken","_this9","token","requestOpenIDConnectToken","access_token","expires_in","matrix_server_name","token_type","queueToDevice","_ref10","_this10","batch","Map","deviceId","payload","getOrCreate","set","encryptAndSendToDevices","userDeviceInfoArr","_this11","deviceInfo","sendToDeviceViaWidgetApi","_this12","checkTurnServers","_this13","getSyncState","syncState","state","oldState","Sync","_this14","reply","_this15","servers","getTurnServers","onClientStopped","return","signal","addEventListener","_iteratorAbruptCompletion","_didIteratorError","_iteratorError","_iterator","_asyncIterator","_step","next","done","server","value","urls","uris","username","credential","password","TurnServers","log","err","warn","removeEventListener","matrix_api_error","fromWidgetApiErrorData"],"sources":["../src/embedded.ts"],"sourcesContent":["/*\nCopyright 2022 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\nimport {\n WidgetApi,\n WidgetApiToWidgetAction,\n WidgetApiResponseError,\n MatrixCapabilities,\n IWidgetApiRequest,\n IWidgetApiAcknowledgeResponseData,\n ISendEventToWidgetActionRequest,\n ISendToDeviceToWidgetActionRequest,\n ISendEventFromWidgetResponseData,\n IWidgetApiRequestData,\n WidgetApiAction,\n IWidgetApiResponse,\n IWidgetApiResponseData,\n} from \"matrix-widget-api\";\n\nimport { MatrixEvent, IEvent, IContent, EventStatus } from \"./models/event.ts\";\nimport {\n ISendEventResponse,\n SendDelayedEventRequestOpts,\n SendDelayedEventResponse,\n UpdateDelayedEventAction,\n} from \"./@types/requests.ts\";\nimport { EventType, StateEvents } from \"./@types/event.ts\";\nimport { logger } from \"./logger.ts\";\nimport {\n MatrixClient,\n ClientEvent,\n IMatrixClientCreateOpts,\n IStartClientOpts,\n SendToDeviceContentMap,\n IOpenIDToken,\n UNSTABLE_MSC4140_DELAYED_EVENTS,\n} from \"./client.ts\";\nimport { SyncApi, SyncState } from \"./sync.ts\";\nimport { SlidingSyncSdk } from \"./sliding-sync-sdk.ts\";\nimport { MatrixError } from \"./http-api/errors.ts\";\nimport { User } from \"./models/user.ts\";\nimport { Room } from \"./models/room.ts\";\nimport { ToDeviceBatch, ToDevicePayload } from \"./models/ToDeviceMessage.ts\";\nimport { DeviceInfo } from \"./crypto/deviceinfo.ts\";\nimport { IOlmDevice } from \"./crypto/algorithms/megolm.ts\";\nimport { MapWithDefault, recursiveMapToObject } from \"./utils.ts\";\nimport { TypedEventEmitter } from \"./matrix.ts\";\n\ninterface IStateEventRequest {\n eventType: string;\n stateKey?: string;\n}\n\nexport interface ICapabilities {\n /**\n * Event types that this client expects to send.\n */\n sendEvent?: string[];\n /**\n * Event types that this client expects to receive.\n */\n receiveEvent?: string[];\n\n /**\n * Message types that this client expects to send, or true for all message\n * types.\n */\n sendMessage?: string[] | true;\n /**\n * Message types that this client expects to receive, or true for all\n * message types.\n */\n receiveMessage?: string[] | true;\n\n /**\n * Types of state events that this client expects to send.\n */\n sendState?: IStateEventRequest[];\n /**\n * Types of state events that this client expects to receive.\n */\n receiveState?: IStateEventRequest[];\n\n /**\n * To-device event types that this client expects to send.\n */\n sendToDevice?: string[];\n /**\n * To-device event types that this client expects to receive.\n */\n receiveToDevice?: string[];\n\n /**\n * Whether this client needs access to TURN servers.\n * @defaultValue false\n */\n turnServers?: boolean;\n\n /**\n * Whether this client needs to be able to send delayed events.\n * @experimental Part of MSC4140 & MSC4157\n * @defaultValue false\n */\n sendDelayedEvents?: boolean;\n\n /**\n * Whether this client needs to be able to update delayed events.\n * @experimental Part of MSC4140 & MSC4157\n * @defaultValue false\n */\n updateDelayedEvents?: boolean;\n}\n\nexport enum RoomWidgetClientEvent {\n PendingEventsChanged = \"PendingEvent.pendingEventsChanged\",\n}\nexport type EventHandlerMap = { [RoomWidgetClientEvent.PendingEventsChanged]: () => void };\n/**\n * A MatrixClient that routes its requests through the widget API instead of the\n * real CS API.\n * @experimental This class is considered unstable!\n */\nexport class RoomWidgetClient extends MatrixClient {\n private room?: Room;\n private readonly widgetApiReady: Promise<void>;\n private lifecycle?: AbortController;\n private syncState: SyncState | null = null;\n\n private pendingSendingEventsTxId: { type: string; id: string | undefined; txId: string }[] = [];\n private eventEmitter = new TypedEventEmitter<keyof EventHandlerMap, EventHandlerMap>();\n\n /**\n *\n * @param widgetApi - The widget api to use for communication.\n * @param capabilities - The capabilities the widget client will request.\n * @param roomId - The room id the widget is associated with.\n * @param opts - The configuration options for this client.\n * @param sendContentLoaded - Whether to send a content loaded widget action immediately after initial setup.\n * Set to `false` if the widget uses `waitForIFrameLoad=true` (in this case the client does not expect a content loaded action at all),\n * or if the the widget wants to send the `ContentLoaded` action at a later point in time after the initial setup.\n */\n public constructor(\n private readonly widgetApi: WidgetApi,\n private readonly capabilities: ICapabilities,\n private readonly roomId: string,\n opts: IMatrixClientCreateOpts,\n sendContentLoaded: boolean,\n ) {\n super(opts);\n\n const transportSend = this.widgetApi.transport.send.bind(this.widgetApi.transport);\n this.widgetApi.transport.send = async <\n T extends IWidgetApiRequestData,\n R extends IWidgetApiResponseData = IWidgetApiAcknowledgeResponseData,\n >(\n action: WidgetApiAction,\n data: T,\n ): Promise<R> => {\n try {\n return await transportSend(action, data);\n } catch (error) {\n processAndThrow(error);\n }\n };\n\n const transportSendComplete = this.widgetApi.transport.sendComplete.bind(this.widgetApi.transport);\n this.widgetApi.transport.sendComplete = async <T extends IWidgetApiRequestData, R extends IWidgetApiResponse>(\n action: WidgetApiAction,\n data: T,\n ): Promise<R> => {\n try {\n return await transportSendComplete(action, data);\n } catch (error) {\n processAndThrow(error);\n }\n };\n\n this.widgetApiReady = new Promise<void>((resolve) => this.widgetApi.once(\"ready\", resolve));\n\n // Request capabilities for the functionality this client needs to support\n if (\n capabilities.sendEvent?.length ||\n capabilities.receiveEvent?.length ||\n capabilities.sendMessage === true ||\n (Array.isArray(capabilities.sendMessage) && capabilities.sendMessage.length) ||\n capabilities.receiveMessage === true ||\n (Array.isArray(capabilities.receiveMessage) && capabilities.receiveMessage.length) ||\n capabilities.sendState?.length ||\n capabilities.receiveState?.length\n ) {\n widgetApi.requestCapabilityForRoomTimeline(roomId);\n }\n capabilities.sendEvent?.forEach((eventType) => widgetApi.requestCapabilityToSendEvent(eventType));\n capabilities.receiveEvent?.forEach((eventType) => widgetApi.requestCapabilityToReceiveEvent(eventType));\n if (capabilities.sendMessage === true) {\n widgetApi.requestCapabilityToSendMessage();\n } else if (Array.isArray(capabilities.sendMessage)) {\n capabilities.sendMessage.forEach((msgType) => widgetApi.requestCapabilityToSendMessage(msgType));\n }\n if (capabilities.receiveMessage === true) {\n widgetApi.requestCapabilityToReceiveMessage();\n } else if (Array.isArray(capabilities.receiveMessage)) {\n capabilities.receiveMessage.forEach((msgType) => widgetApi.requestCapabilityToReceiveMessage(msgType));\n }\n capabilities.sendState?.forEach(({ eventType, stateKey }) =>\n widgetApi.requestCapabilityToSendState(eventType, stateKey),\n );\n capabilities.receiveState?.forEach(({ eventType, stateKey }) =>\n widgetApi.requestCapabilityToReceiveState(eventType, stateKey),\n );\n capabilities.sendToDevice?.forEach((eventType) => widgetApi.requestCapabilityToSendToDevice(eventType));\n capabilities.receiveToDevice?.forEach((eventType) => widgetApi.requestCapabilityToReceiveToDevice(eventType));\n if (\n capabilities.sendDelayedEvents &&\n (capabilities.sendEvent?.length ||\n capabilities.sendMessage === true ||\n (Array.isArray(capabilities.sendMessage) && capabilities.sendMessage.length) ||\n capabilities.sendState?.length)\n ) {\n widgetApi.requestCapability(MatrixCapabilities.MSC4157SendDelayedEvent);\n }\n if (capabilities.updateDelayedEvents) {\n widgetApi.requestCapability(MatrixCapabilities.MSC4157UpdateDelayedEvent);\n }\n if (capabilities.turnServers) {\n widgetApi.requestCapability(MatrixCapabilities.MSC3846TurnServers);\n }\n\n widgetApi.on(`action:${WidgetApiToWidgetAction.SendEvent}`, this.onEvent);\n widgetApi.on(`action:${WidgetApiToWidgetAction.SendToDevice}`, this.onToDevice);\n\n // Open communication with the host\n widgetApi.start();\n // Send a content loaded event now we've started the widget API\n // Note that element-web currently does not use waitForIFrameLoad=false and so\n // does *not* (yes, that is the right way around) wait for this event. Let's\n // start sending this, then once this has rolled out, we can change element-web to\n // use waitForIFrameLoad=false and have a widget API that's less racy.\n if (sendContentLoaded) widgetApi.sendContentLoaded();\n }\n\n public async startClient(opts: IStartClientOpts = {}): Promise<void> {\n this.lifecycle = new AbortController();\n\n // Create our own user object artificially (instead of waiting for sync)\n // so it's always available, even if the user is not in any rooms etc.\n const userId = this.getUserId();\n if (userId) {\n this.store.storeUser(new User(userId));\n }\n\n // Even though we have no access token and cannot sync, the sync class\n // still has some valuable helper methods that we make use of, so we\n // instantiate it anyways\n if (opts.slidingSync) {\n this.syncApi = new SlidingSyncSdk(opts.slidingSync, this, opts, this.buildSyncApiOptions());\n } else {\n this.syncApi = new SyncApi(this, opts, this.buildSyncApiOptions());\n }\n\n this.room = this.syncApi.createRoom(this.roomId);\n this.store.storeRoom(this.room);\n\n await this.widgetApiReady;\n\n // Backfill the requested events\n // We only get the most recent event for every type + state key combo,\n // so it doesn't really matter what order we inject them in\n await Promise.all(\n this.capabilities.receiveState?.map(async ({ eventType, stateKey }) => {\n const rawEvents = await this.widgetApi.readStateEvents(eventType, undefined, stateKey, [this.roomId]);\n const events = rawEvents.map((rawEvent) => new MatrixEvent(rawEvent as Partial<IEvent>));\n\n await this.syncApi!.injectRoomEvents(this.room!, [], events);\n events.forEach((event) => {\n this.emit(ClientEvent.Event, event);\n logger.info(`Backfilled event ${event.getId()} ${event.getType()} ${event.getStateKey()}`);\n });\n }) ?? [],\n );\n\n if (opts.clientWellKnownPollPeriod !== undefined) {\n this.clientWellKnownIntervalID = setInterval(() => {\n this.fetchClientWellKnown();\n }, 1000 * opts.clientWellKnownPollPeriod);\n this.fetchClientWellKnown();\n }\n\n this.setSyncState(SyncState.Syncing);\n logger.info(\"Finished backfilling events\");\n\n // Watch for TURN servers, if requested\n if (this.capabilities.turnServers) this.watchTurnServers();\n }\n\n public stopClient(): void {\n this.widgetApi.off(`action:${WidgetApiToWidgetAction.SendEvent}`, this.onEvent);\n this.widgetApi.off(`action:${WidgetApiToWidgetAction.SendToDevice}`, this.onToDevice);\n\n super.stopClient();\n this.lifecycle!.abort(); // Signal to other async tasks that the client has stopped\n }\n\n public async joinRoom(roomIdOrAlias: string): Promise<Room> {\n if (roomIdOrAlias === this.roomId) return this.room!;\n throw new Error(`Unknown room: ${roomIdOrAlias}`);\n }\n\n protected async encryptAndSendEvent(room: Room, event: MatrixEvent): Promise<ISendEventResponse>;\n protected async encryptAndSendEvent(\n room: Room,\n event: MatrixEvent,\n delayOpts: SendDelayedEventRequestOpts,\n ): Promise<SendDelayedEventResponse>;\n protected async encryptAndSendEvent(\n room: Room,\n event: MatrixEvent,\n delayOpts?: SendDelayedEventRequestOpts,\n ): Promise<ISendEventResponse | SendDelayedEventResponse> {\n // We need to extend the content with the redacts parameter\n // The js sdk uses event.redacts but the widget api uses event.content.redacts\n // This will be converted back to event.redacts in the widget driver.\n const content = event.event.redacts\n ? { ...event.getContent(), redacts: event.event.redacts }\n : event.getContent();\n\n // Delayed event special case.\n if (delayOpts) {\n // TODO: updatePendingEvent for delayed events?\n const response = await this.widgetApi.sendRoomEvent(\n event.getType(),\n content,\n room.roomId,\n \"delay\" in delayOpts ? delayOpts.delay : undefined,\n \"parent_delay_id\" in delayOpts ? delayOpts.parent_delay_id : undefined,\n );\n return this.validateSendDelayedEventResponse(response);\n }\n\n const txId = event.getTxnId();\n // Add the txnId to the pending list (still with unknown evID)\n if (txId) this.pendingSendingEventsTxId.push({ type: event.getType(), id: undefined, txId });\n\n let response: ISendEventFromWidgetResponseData;\n try {\n response = await this.widgetApi.sendRoomEvent(event.getType(), content, room.roomId);\n } catch (e) {\n this.updatePendingEventStatus(room, event, EventStatus.NOT_SENT);\n throw e;\n }\n // This also checks for an event id on the response\n room.updatePendingEvent(event, EventStatus.SENT, response.event_id);\n\n // Update the pending events list with the eventId\n this.pendingSendingEventsTxId.forEach((p) => {\n if (p.txId === txId) p.id = response.event_id;\n });\n this.eventEmitter.emit(RoomWidgetClientEvent.PendingEventsChanged);\n\n return { event_id: response.event_id! };\n }\n\n public async sendStateEvent(\n roomId: string,\n eventType: string,\n content: any,\n stateKey = \"\",\n ): Promise<ISendEventResponse> {\n const response = await this.widgetApi.sendStateEvent(eventType, stateKey, content, roomId);\n if (response.event_id === undefined) {\n throw new Error(\"'event_id' absent from response to an event request\");\n }\n return { event_id: response.event_id };\n }\n\n /**\n * @experimental This currently relies on an unstable MSC (MSC4140).\n */\n // eslint-disable-next-line\n public async _unstable_sendDelayedStateEvent<K extends keyof StateEvents>(\n roomId: string,\n delayOpts: SendDelayedEventRequestOpts,\n eventType: K,\n content: StateEvents[K],\n stateKey = \"\",\n ): Promise<SendDelayedEventResponse> {\n if (!(await this.doesServerSupportUnstableFeature(UNSTABLE_MSC4140_DELAYED_EVENTS))) {\n throw Error(\"Server does not support the delayed events API\");\n }\n\n const response = await this.widgetApi.sendStateEvent(\n eventType,\n stateKey,\n content,\n roomId,\n \"delay\" in delayOpts ? delayOpts.delay : undefined,\n \"parent_delay_id\" in delayOpts ? delayOpts.parent_delay_id : undefined,\n );\n return this.validateSendDelayedEventResponse(response);\n }\n\n private validateSendDelayedEventResponse(response: ISendEventFromWidgetResponseData): SendDelayedEventResponse {\n if (response.delay_id === undefined) {\n throw new Error(\"'delay_id' absent from response to a delayed event request\");\n }\n return { delay_id: response.delay_id };\n }\n\n /**\n * @experimental This currently relies on an unstable MSC (MSC4140).\n */\n // eslint-disable-next-line\n public async _unstable_updateDelayedEvent(delayId: string, action: UpdateDelayedEventAction): Promise<{}> {\n if (!(await this.doesServerSupportUnstableFeature(UNSTABLE_MSC4140_DELAYED_EVENTS))) {\n throw Error(\"Server does not support the delayed events API\");\n }\n\n return await this.widgetApi.updateDelayedEvent(delayId, action);\n }\n\n public async sendToDevice(eventType: string, contentMap: SendToDeviceContentMap): Promise<{}> {\n await this.widgetApi.sendToDevice(eventType, false, recursiveMapToObject(contentMap));\n return {};\n }\n\n public async getOpenIdToken(): Promise<IOpenIDToken> {\n const token = await this.widgetApi.requestOpenIDConnectToken();\n // the IOpenIDCredentials from the widget-api and IOpenIDToken form the matrix-js-sdk are compatible.\n // we still recreate the token to make this transparent and catch'able by the linter in case the types change in the future.\n return <IOpenIDToken>{\n access_token: token.access_token,\n expires_in: token.expires_in,\n matrix_server_name: token.matrix_server_name,\n token_type: token.token_type,\n };\n }\n\n public async queueToDevice({ eventType, batch }: ToDeviceBatch): Promise<void> {\n // map: user Id → device Id → payload\n const contentMap: MapWithDefault<string, Map<string, ToDevicePayload>> = new MapWithDefault(() => new Map());\n for (const { userId, deviceId, payload } of batch) {\n contentMap.getOrCreate(userId).set(deviceId, payload);\n }\n\n await this.widgetApi.sendToDevice(eventType, false, recursiveMapToObject(contentMap));\n }\n\n public async encryptAndSendToDevices(userDeviceInfoArr: IOlmDevice<DeviceInfo>[], payload: object): Promise<void> {\n // map: user Id → device Id → payload\n const contentMap: MapWithDefault<string, Map<string, object>> = new MapWithDefault(() => new Map());\n for (const {\n userId,\n deviceInfo: { deviceId },\n } of userDeviceInfoArr) {\n contentMap.getOrCreate(userId).set(deviceId, payload);\n }\n\n await this.widgetApi.sendToDevice((payload as { type: string }).type, true, recursiveMapToObject(contentMap));\n }\n\n /**\n * Send an event to a specific list of devices via the widget API. Optionally encrypts the event.\n *\n * If you are using a full MatrixClient you would be calling {@link MatrixClient.getCrypto().encryptToDeviceMessages()} followed\n * by {@link MatrixClient.queueToDevice}.\n *\n * However, this is combined into a single step when running as an embedded widget client. So, we expose this method for those\n * that need it.\n *\n * @param eventType - Type of the event to send.\n * @param encrypted - Whether the event should be encrypted.\n * @param contentMap - The content to send. Map from user_id to device_id to content object.\n */\n public async sendToDeviceViaWidgetApi(\n eventType: string,\n encrypted: boolean,\n contentMap: SendToDeviceContentMap,\n ): Promise<void> {\n await this.widgetApi.sendToDevice(eventType, encrypted, recursiveMapToObject(contentMap));\n }\n\n // Overridden since we get TURN servers automatically over the widget API,\n // and this method would otherwise complain about missing an access token\n public async checkTurnServers(): Promise<boolean> {\n return this.turnServers.length > 0;\n }\n\n // Overridden since we 'sync' manually without the sync API\n public getSyncState(): SyncState | null {\n return this.syncState;\n }\n\n private setSyncState(state: SyncState): void {\n const oldState = this.syncState;\n this.syncState = state;\n this.emit(ClientEvent.Sync, state, oldState);\n }\n\n private async ack(ev: CustomEvent<IWidgetApiRequest>): Promise<void> {\n await this.widgetApi.transport.reply<IWidgetApiAcknowledgeResponseData>(ev.detail, {});\n }\n\n private updateTxId = async (event: MatrixEvent): Promise<void> => {\n // We update the txId for remote echos that originate from this client.\n // This happens with the help of `pendingSendingEventsTxId` where we store all events that are currently sending\n // with their widget txId and once ready the final evId.\n if (\n // This could theoretically be an event send by this device\n // In that case we need to update the txId of the event because the embedded client/widget\n // knows this event with a different transaction Id than what was used by the host client.\n event.getSender() === this.getUserId() &&\n // We optimize by not blocking events from types that we have not send\n // with this client.\n this.pendingSendingEventsTxId.some((p) => event.getType() === p.type)\n ) {\n // Compare by event Id if we have a matching pending event where we know the txId.\n let matchingTxId = this.pendingSendingEventsTxId.find((p) => p.id === event.getId())?.txId;\n // Block any further processing of this event until we have received the sending response.\n // -> until we know the event id.\n // -> until we have not pending events anymore.\n while (!matchingTxId && this.pendingSendingEventsTxId.length > 0) {\n // Recheck whenever the PendingEventsChanged\n await new Promise<void>((resolve) =>\n this.eventEmitter.once(RoomWidgetClientEvent.PendingEventsChanged, () => resolve()),\n );\n matchingTxId = this.pendingSendingEventsTxId.find((p) => p.id === event.getId())?.txId;\n }\n\n // We found the correct txId: we update the event and delete the entry of the pending events.\n if (matchingTxId) {\n event.setTxnId(matchingTxId);\n event.setUnsigned({ ...event.getUnsigned(), transaction_id: matchingTxId });\n }\n this.pendingSendingEventsTxId = this.pendingSendingEventsTxId.filter((p) => p.id !== event.getId());\n\n // Emit once there are no pending events anymore to release all other events that got\n // awaited in the `while (!matchingTxId && this.pendingSendingEventsTxId.length > 0)` loop\n // but are not send by this client.\n if (this.pendingSendingEventsTxId.length === 0) {\n this.eventEmitter.emit(RoomWidgetClientEvent.PendingEventsChanged);\n }\n }\n };\n\n private onEvent = async (ev: CustomEvent<ISendEventToWidgetActionRequest>): Promise<void> => {\n ev.preventDefault();\n\n // Verify the room ID matches, since it's possible for the client to\n // send us events from other rooms if this widget is always on screen\n if (ev.detail.data.room_id === this.roomId) {\n const event = new MatrixEvent(ev.detail.data as Partial<IEvent>);\n\n // Only inject once we have update the txId\n await this.updateTxId(event);\n await this.syncApi!.injectRoomEvents(this.room!, [], [event]);\n this.emit(ClientEvent.Event, event);\n this.setSyncState(SyncState.Syncing);\n logger.info(`Received event ${event.getId()} ${event.getType()} ${event.getStateKey()}`);\n } else {\n const { event_id: eventId, room_id: roomId } = ev.detail.data;\n logger.info(`Received event ${eventId} for a different room ${roomId}; discarding`);\n }\n\n await this.ack(ev);\n };\n\n private onToDevice = async (ev: CustomEvent<ISendToDeviceToWidgetActionRequest>): Promise<void> => {\n ev.preventDefault();\n\n const event = new MatrixEvent({\n type: ev.detail.data.type,\n sender: ev.detail.data.sender,\n content: ev.detail.data.content as IContent,\n });\n // Mark the event as encrypted if it was, using fake contents and keys since those are unknown to us\n if (ev.detail.data.encrypted) event.makeEncrypted(EventType.RoomMessageEncrypted, {}, \"\", \"\");\n\n this.emit(ClientEvent.ToDeviceEvent, event);\n this.setSyncState(SyncState.Syncing);\n await this.ack(ev);\n };\n\n private async watchTurnServers(): Promise<void> {\n const servers = this.widgetApi.getTurnServers();\n const onClientStopped = (): void => {\n servers.return(undefined);\n };\n this.lifecycle!.signal.addEventListener(\"abort\", onClientStopped);\n\n try {\n for await (const server of servers) {\n this.turnServers = [\n {\n urls: server.uris,\n username: server.username,\n credential: server.password,\n },\n ];\n this.emit(ClientEvent.TurnServers, this.turnServers);\n logger.log(`Received TURN server: ${server.uris}`);\n }\n } catch (e) {\n logger.warn(\"Error watching TURN servers\", e);\n } finally {\n this.lifecycle!.signal.removeEventListener(\"abort\", onClientStopped);\n }\n }\n}\n\nfunction processAndThrow(error: unknown): never {\n if (error instanceof WidgetApiResponseError && error.data.matrix_api_error) {\n throw MatrixError.fromWidgetApiErrorData(error.data.matrix_api_error);\n } else {\n throw error;\n }\n}\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAEIA,uBAAuB,EACvBC,sBAAsB,EACtBC,kBAAkB,QAUf,mBAAmB;AAE1B,SAASC,WAAW,EAAoBC,WAAW,QAAQ,mBAAmB;AAO9E,SAASC,SAAS,QAAqB,mBAAmB;AAC1D,SAASC,MAAM,QAAQ,aAAa;AACpC,SACIC,YAAY,EACZC,WAAW,EAKXC,+BAA+B,QAC5B,aAAa;AACpB,SAASC,OAAO,EAAEC,SAAS,QAAQ,WAAW;AAC9C,SAASC,cAAc,QAAQ,uBAAuB;AACtD,SAASC,WAAW,QAAQ,sBAAsB;AAClD,SAASC,IAAI,QAAQ,kBAAkB;AAKvC,SAASC,cAAc,EAAEC,oBAAoB,QAAQ,YAAY;AACjE,SAASC,iBAAiB,QAAQ,aAAa;AAmE/C,WAAYC,qBAAqB,0BAArBA,qBAAqB;EAArBA,qBAAqB;EAAA,OAArBA,qBAAqB;AAAA;AAIjC;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,gBAAgB,SAASZ,YAAY,CAAC;EAS/C;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC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C,6BAA6B,EAAE5E,CAAC,CAAC;MACjD,CAAC,SAAS;QACNmD,OAAI,CAAC7F,SAAS,CAAEkG,MAAM,CAACqB,mBAAmB,CAAC,OAAO,EAAEvB,eAAe,CAAC;MACxE;IAAC;EACL;AACJ;AAEA,SAASrJ,eAAeA,CAACD,KAAc,EAAS;EAC5C,IAAIA,KAAK,YAAY3G,sBAAsB,IAAI2G,KAAK,CAAC9B,IAAI,CAAC4M,gBAAgB,EAAE;IACxE,MAAM7Q,WAAW,CAAC8Q,sBAAsB,CAAC/K,KAAK,CAAC9B,IAAI,CAAC4M,gBAAgB,CAAC;EACzE,CAAC,MAAM;IACH,MAAM9K,KAAK;EACf;AACJ","ignoreList":[]}
package/lib/matrix.d.ts CHANGED
@@ -62,18 +62,12 @@ export type { RoomSummary } from "./client.ts";
62
62
  export * as ContentHelpers from "./content-helpers.ts";
63
63
  export * as SecretStorage from "./secret-storage.ts";
64
64
  export type { ICryptoCallbacks } from "./crypto/index.ts";
65
- export { createNewMatrixCall, CallEvent } from "./webrtc/call.ts";
66
- export type { MatrixCall } from "./webrtc/call.ts";
67
- export { GroupCall, GroupCallEvent, GroupCallIntent, GroupCallState, GroupCallType, GroupCallStatsReportEvent, } from "./webrtc/groupCall.ts";
68
65
  export {
69
66
  /** @deprecated Use {@link Crypto.CryptoEvent} instead */
70
67
  CryptoEvent, } from "./crypto/index.ts";
71
68
  export { SyncState, SetPresence } from "./sync.ts";
72
69
  export type { ISyncStateData as SyncStateData } from "./sync.ts";
73
70
  export { SlidingSyncEvent } from "./sliding-sync.ts";
74
- export { MediaHandlerEvent } from "./webrtc/mediaHandler.ts";
75
- export { CallFeedEvent } from "./webrtc/callFeed.ts";
76
- export { StatsReport } from "./webrtc/stats/statsReport.ts";
77
71
  export { Relations, RelationsEvent } from "./models/relations.ts";
78
72
  export { TypedEventEmitter } from "./models/typed-event-emitter.ts";
79
73
  export { LocalStorageErrors } from "./store/local-storage-events-emitter.ts";
@@ -1 +1 @@
1
- {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EAAE,MAAM,sBAAsB,CAAC;AAEzD,wFAAwF;AACxF,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAIhD;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,WAAW,GAAG,IAAI,CAElE;AAcD;;;;;;;;;GASG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,iBAAiB,GAAG,YAAY,CAElE;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,sBAAsB,CAClC,SAAS,EAAE,SAAS,EACpB,YAAY,EAAE,aAAa,EAC3B,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,iBAAiB,EACvB,iBAAiB,UAAO,GACzB,YAAY,CAEd"}
package/lib/matrix.js CHANGED
@@ -73,15 +73,11 @@ export { _ContentHelpers as ContentHelpers };
73
73
  import * as _SecretStorage from "./secret-storage.js";
74
74
  export { _SecretStorage as SecretStorage };
75
75
  // used to be located here
76
- export { createNewMatrixCall, CallEvent } from "./webrtc/call.js";
77
- export { GroupCall, GroupCallEvent, GroupCallIntent, GroupCallState, GroupCallType, GroupCallStatsReportEvent } from "./webrtc/groupCall.js";
76
+
78
77
  export { /** @deprecated Use {@link Crypto.CryptoEvent} instead */
79
78
  CryptoEvent } from "./crypto/index.js";
80
79
  export { SyncState, SetPresence } from "./sync.js";
81
80
  export { SlidingSyncEvent } from "./sliding-sync.js";
82
- export { MediaHandlerEvent } from "./webrtc/mediaHandler.js";
83
- export { CallFeedEvent } from "./webrtc/callFeed.js";
84
- export { StatsReport } from "./webrtc/stats/statsReport.js";
85
81
  export { Relations, RelationsEvent } from "./models/relations.js";
86
82
  export { TypedEventEmitter } from "./models/typed-event-emitter.js";
87
83
  export { LocalStorageErrors } from "./store/local-storage-events-emitter.js";
package/lib/matrix.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"matrix.js","names":["MemoryCryptoStore","MemoryStore","MatrixScheduler","MatrixClient","RoomWidgetClient","_ContentHelpers","ContentHelpers","_SecretStorage","SecretStorage","createNewMatrixCall","CallEvent","GroupCall","GroupCallEvent","GroupCallIntent","GroupCallState","GroupCallType","GroupCallStatsReportEvent","CryptoEvent","SyncState","SetPresence","SlidingSyncEvent","MediaHandlerEvent","CallFeedEvent","StatsReport","Relations","RelationsEvent","TypedEventEmitter","LocalStorageErrors","IdentityProviderBrand","SSOAction","LocationAssetType","_Crypto","Crypto","cryptoStoreFactory","setCryptoStoreFactory","fac","amendClientOpts","opts","_opts$store","_opts$scheduler","_opts$cryptoStore","store","localStorage","globalThis","scheduler","cryptoStore","createClient","createRoomWidgetClient","widgetApi","capabilities","roomId","sendContentLoaded","arguments","length","undefined"],"sources":["../src/matrix.ts"],"sourcesContent":["/*\nCopyright 2015-2022 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\nimport { WidgetApi } from \"matrix-widget-api\";\n\nimport { MemoryCryptoStore } from \"./crypto/store/memory-crypto-store.ts\";\nimport { MemoryStore } from \"./store/memory.ts\";\nimport { MatrixScheduler } from \"./scheduler.ts\";\nimport { MatrixClient, ICreateClientOpts } from \"./client.ts\";\nimport { RoomWidgetClient, ICapabilities } from \"./embedded.ts\";\nimport { CryptoStore } from \"./crypto/store/base.ts\";\n\nexport * from \"./client.ts\";\nexport * from \"./serverCapabilities.ts\";\nexport * from \"./embedded.ts\";\nexport * from \"./http-api/index.ts\";\nexport * from \"./autodiscovery.ts\";\nexport * from \"./sync-accumulator.ts\";\nexport * from \"./errors.ts\";\nexport * from \"./base64.ts\";\nexport * from \"./models/beacon.ts\";\nexport * from \"./models/event.ts\";\nexport * from \"./models/room.ts\";\nexport * from \"./models/event-timeline.ts\";\nexport * from \"./models/event-timeline-set.ts\";\nexport * from \"./models/poll.ts\";\nexport * from \"./models/room-member.ts\";\nexport * from \"./models/room-state.ts\";\nexport * from \"./models/thread.ts\";\nexport * from \"./models/typed-event-emitter.ts\";\nexport * from \"./models/user.ts\";\nexport * from \"./models/device.ts\";\nexport * from \"./models/search-result.ts\";\nexport * from \"./oidc/index.ts\";\nexport * from \"./scheduler.ts\";\nexport * from \"./filter.ts\";\nexport * from \"./timeline-window.ts\";\nexport * from \"./interactive-auth.ts\";\nexport * from \"./service-types.ts\";\nexport * from \"./store/memory.ts\";\nexport * from \"./store/indexeddb.ts\";\nexport * from \"./crypto/store/memory-crypto-store.ts\";\nexport * from \"./crypto/store/localStorage-crypto-store.ts\";\nexport * from \"./crypto/store/indexeddb-crypto-store.ts\";\nexport type { OutgoingRoomKeyRequest } from \"./crypto/store/base.ts\";\nexport * from \"./content-repo.ts\";\nexport type * from \"./@types/common.ts\";\nexport type * from \"./@types/uia.ts\";\nexport * from \"./@types/event.ts\";\nexport * from \"./@types/PushRules.ts\";\nexport * from \"./@types/partials.ts\";\nexport * from \"./@types/requests.ts\";\nexport * from \"./@types/search.ts\";\nexport * from \"./@types/beacon.ts\";\nexport * from \"./@types/topic.ts\";\nexport * from \"./@types/location.ts\";\nexport * from \"./@types/threepids.ts\";\nexport * from \"./@types/auth.ts\";\nexport * from \"./@types/polls.ts\";\nexport type * from \"./@types/local_notifications.ts\";\nexport type * from \"./@types/registration.ts\";\nexport * from \"./@types/read_receipts.ts\";\nexport type * from \"./@types/crypto.ts\";\nexport * from \"./@types/extensible_events.ts\";\nexport type * from \"./@types/IIdentityServerProvider.ts\";\nexport * from \"./@types/membership.ts\";\nexport * from \"./models/room-summary.ts\";\nexport * from \"./models/event-status.ts\";\nexport type { RoomSummary } from \"./client.ts\";\nexport * as ContentHelpers from \"./content-helpers.ts\";\nexport * as SecretStorage from \"./secret-storage.ts\";\nexport type { ICryptoCallbacks } from \"./crypto/index.ts\"; // used to be located here\nexport { createNewMatrixCall, CallEvent } from \"./webrtc/call.ts\";\nexport type { MatrixCall } from \"./webrtc/call.ts\";\nexport {\n GroupCall,\n GroupCallEvent,\n GroupCallIntent,\n GroupCallState,\n GroupCallType,\n GroupCallStatsReportEvent,\n} from \"./webrtc/groupCall.ts\";\n\nexport {\n /** @deprecated Use {@link Crypto.CryptoEvent} instead */\n CryptoEvent,\n} from \"./crypto/index.ts\";\nexport { SyncState, SetPresence } from \"./sync.ts\";\nexport type { ISyncStateData as SyncStateData } from \"./sync.ts\";\nexport { SlidingSyncEvent } from \"./sliding-sync.ts\";\nexport { MediaHandlerEvent } from \"./webrtc/mediaHandler.ts\";\nexport { CallFeedEvent } from \"./webrtc/callFeed.ts\";\nexport { StatsReport } from \"./webrtc/stats/statsReport.ts\";\nexport { Relations, RelationsEvent } from \"./models/relations.ts\";\nexport { TypedEventEmitter } from \"./models/typed-event-emitter.ts\";\nexport { LocalStorageErrors } from \"./store/local-storage-events-emitter.ts\";\nexport { IdentityProviderBrand, SSOAction } from \"./@types/auth.ts\";\nexport type { ISSOFlow as SSOFlow, LoginFlow } from \"./@types/auth.ts\";\nexport type { IHierarchyRelation as HierarchyRelation, IHierarchyRoom as HierarchyRoom } from \"./@types/spaces.ts\";\nexport { LocationAssetType } from \"./@types/location.ts\";\n\n/** @deprecated Backwards-compatibility re-export. Import from `crypto-api` directly. */\nexport * as Crypto from \"./crypto-api/index.ts\";\n\nlet cryptoStoreFactory = (): CryptoStore => new MemoryCryptoStore();\n\n/**\n * Configure a different factory to be used for creating crypto stores\n *\n * @param fac - a function which will return a new `CryptoStore`\n */\nexport function setCryptoStoreFactory(fac: () => CryptoStore): void {\n cryptoStoreFactory = fac;\n}\n\nfunction amendClientOpts(opts: ICreateClientOpts): ICreateClientOpts {\n opts.store =\n opts.store ??\n new MemoryStore({\n localStorage: globalThis.localStorage,\n });\n opts.scheduler = opts.scheduler ?? new MatrixScheduler();\n opts.cryptoStore = opts.cryptoStore ?? cryptoStoreFactory();\n\n return opts;\n}\n\n/**\n * Construct a Matrix Client. Similar to {@link MatrixClient}\n * except that the 'request', 'store' and 'scheduler' dependencies are satisfied.\n * @param opts - The configuration options for this client. These configuration\n * options will be passed directly to {@link MatrixClient}.\n *\n * @returns A new matrix client.\n * @see {@link MatrixClient} for the full list of options for\n * `opts`.\n */\nexport function createClient(opts: ICreateClientOpts): MatrixClient {\n return new MatrixClient(amendClientOpts(opts));\n}\n\n/**\n * Construct a Matrix Client that works in a widget.\n * This client has a subset of features compared to a full client.\n * It uses the widget-api to communicate with matrix. (widget \\<-\\> client \\<-\\> homeserver)\n * @returns A new matrix client with a subset of features.\n * @param opts - The configuration options for this client. These configuration\n * options will be passed directly to {@link MatrixClient}.\n * @param widgetApi - The widget api to use for communication.\n * @param capabilities - The capabilities the widget client will request.\n * @param roomId - The room id the widget is associated with.\n * @param sendContentLoaded - Whether to send a content loaded widget action immediately after initial setup.\n * Set to `false` if the widget uses `waitForIFrameLoad=true` (in this case the client does not expect a content loaded action at all),\n * or if the the widget wants to send the `ContentLoaded` action at a later point in time after the initial setup.\n */\nexport function createRoomWidgetClient(\n widgetApi: WidgetApi,\n capabilities: ICapabilities,\n roomId: string,\n opts: ICreateClientOpts,\n sendContentLoaded = true,\n): MatrixClient {\n return new RoomWidgetClient(widgetApi, capabilities, roomId, amendClientOpts(opts), sendContentLoaded);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,SAASA,iBAAiB,QAAQ,uCAAuC;AACzE,SAASC,WAAW,QAAQ,mBAAmB;AAC/C,SAASC,eAAe,QAAQ,gBAAgB;AAChD,SAASC,YAAY,QAA2B,aAAa;AAC7D,SAASC,gBAAgB,QAAuB,eAAe;AAG/D,cAAc,aAAa;AAC3B,cAAc,yBAAyB;AACvC,cAAc,eAAe;AAC7B,cAAc,qBAAqB;AACnC,cAAc,oBAAoB;AAClC,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ASS,YAAYA,CAACT,IAAuB,EAAgB;EAChE,OAAO,IAAIlC,YAAY,CAACiC,eAAe,CAACC,IAAI,CAAC,CAAC;AAClD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASU,sBAAsBA,CAClCC,SAAoB,EACpBC,YAA2B,EAC3BC,MAAc,EACdb,IAAuB,EAEX;EAAA,IADZc,iBAAiB,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,IAAI;EAExB,OAAO,IAAIhD,gBAAgB,CAAC4C,SAAS,EAAEC,YAAY,EAAEC,MAAM,EAAEd,eAAe,CAACC,IAAI,CAAC,EAAEc,iBAAiB,CAAC;AAC1G","ignoreList":[]}
1
+ {"version":3,"file":"matrix.js","names":["MemoryCryptoStore","MemoryStore","MatrixScheduler","MatrixClient","RoomWidgetClient","_ContentHelpers","ContentHelpers","_SecretStorage","SecretStorage","CryptoEvent","SyncState","SetPresence","SlidingSyncEvent","Relations","RelationsEvent","TypedEventEmitter","LocalStorageErrors","IdentityProviderBrand","SSOAction","LocationAssetType","_Crypto","Crypto","cryptoStoreFactory","setCryptoStoreFactory","fac","amendClientOpts","opts","_opts$store","_opts$scheduler","_opts$cryptoStore","store","localStorage","globalThis","scheduler","cryptoStore","createClient","createRoomWidgetClient","widgetApi","capabilities","roomId","sendContentLoaded","arguments","length","undefined"],"sources":["../src/matrix.ts"],"sourcesContent":["/*\nCopyright 2015-2022 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\nimport { WidgetApi } from \"matrix-widget-api\";\n\nimport { MemoryCryptoStore } from \"./crypto/store/memory-crypto-store.ts\";\nimport { MemoryStore } from \"./store/memory.ts\";\nimport { MatrixScheduler } from \"./scheduler.ts\";\nimport { MatrixClient, ICreateClientOpts } from \"./client.ts\";\nimport { RoomWidgetClient, ICapabilities } from \"./embedded.ts\";\nimport { CryptoStore } from \"./crypto/store/base.ts\";\n\nexport * from \"./client.ts\";\nexport * from \"./serverCapabilities.ts\";\nexport * from \"./embedded.ts\";\nexport * from \"./http-api/index.ts\";\nexport * from \"./autodiscovery.ts\";\nexport * from \"./sync-accumulator.ts\";\nexport * from \"./errors.ts\";\nexport * from \"./base64.ts\";\nexport * from \"./models/beacon.ts\";\nexport * from \"./models/event.ts\";\nexport * from \"./models/room.ts\";\nexport * from \"./models/event-timeline.ts\";\nexport * from \"./models/event-timeline-set.ts\";\nexport * from \"./models/poll.ts\";\nexport * from \"./models/room-member.ts\";\nexport * from \"./models/room-state.ts\";\nexport * from \"./models/thread.ts\";\nexport * from \"./models/typed-event-emitter.ts\";\nexport * from \"./models/user.ts\";\nexport * from \"./models/device.ts\";\nexport * from \"./models/search-result.ts\";\nexport * from \"./oidc/index.ts\";\nexport * from \"./scheduler.ts\";\nexport * from \"./filter.ts\";\nexport * from \"./timeline-window.ts\";\nexport * from \"./interactive-auth.ts\";\nexport * from \"./service-types.ts\";\nexport * from \"./store/memory.ts\";\nexport * from \"./store/indexeddb.ts\";\nexport * from \"./crypto/store/memory-crypto-store.ts\";\nexport * from \"./crypto/store/localStorage-crypto-store.ts\";\nexport * from \"./crypto/store/indexeddb-crypto-store.ts\";\nexport type { OutgoingRoomKeyRequest } from \"./crypto/store/base.ts\";\nexport * from \"./content-repo.ts\";\nexport type * from \"./@types/common.ts\";\nexport type * from \"./@types/uia.ts\";\nexport * from \"./@types/event.ts\";\nexport * from \"./@types/PushRules.ts\";\nexport * from \"./@types/partials.ts\";\nexport * from \"./@types/requests.ts\";\nexport * from \"./@types/search.ts\";\nexport * from \"./@types/beacon.ts\";\nexport * from \"./@types/topic.ts\";\nexport * from \"./@types/location.ts\";\nexport * from \"./@types/threepids.ts\";\nexport * from \"./@types/auth.ts\";\nexport * from \"./@types/polls.ts\";\nexport type * from \"./@types/local_notifications.ts\";\nexport type * from \"./@types/registration.ts\";\nexport * from \"./@types/read_receipts.ts\";\nexport type * from \"./@types/crypto.ts\";\nexport * from \"./@types/extensible_events.ts\";\nexport type * from \"./@types/IIdentityServerProvider.ts\";\nexport * from \"./@types/membership.ts\";\nexport * from \"./models/room-summary.ts\";\nexport * from \"./models/event-status.ts\";\nexport type { RoomSummary } from \"./client.ts\";\nexport * as ContentHelpers from \"./content-helpers.ts\";\nexport * as SecretStorage from \"./secret-storage.ts\";\nexport type { ICryptoCallbacks } from \"./crypto/index.ts\"; // used to be located here\n\nexport {\n /** @deprecated Use {@link Crypto.CryptoEvent} instead */\n CryptoEvent,\n} from \"./crypto/index.ts\";\nexport { SyncState, SetPresence } from \"./sync.ts\";\nexport type { ISyncStateData as SyncStateData } from \"./sync.ts\";\nexport { SlidingSyncEvent } from \"./sliding-sync.ts\";\nexport { Relations, RelationsEvent } from \"./models/relations.ts\";\nexport { TypedEventEmitter } from \"./models/typed-event-emitter.ts\";\nexport { LocalStorageErrors } from \"./store/local-storage-events-emitter.ts\";\nexport { IdentityProviderBrand, SSOAction } from \"./@types/auth.ts\";\nexport type { ISSOFlow as SSOFlow, LoginFlow } from \"./@types/auth.ts\";\nexport type { IHierarchyRelation as HierarchyRelation, IHierarchyRoom as HierarchyRoom } from \"./@types/spaces.ts\";\nexport { LocationAssetType } from \"./@types/location.ts\";\n\n/** @deprecated Backwards-compatibility re-export. Import from `crypto-api` directly. */\nexport * as Crypto from \"./crypto-api/index.ts\";\n\nlet cryptoStoreFactory = (): CryptoStore => new MemoryCryptoStore();\n\n/**\n * Configure a different factory to be used for creating crypto stores\n *\n * @param fac - a function which will return a new `CryptoStore`\n */\nexport function setCryptoStoreFactory(fac: () => CryptoStore): void {\n cryptoStoreFactory = fac;\n}\n\nfunction amendClientOpts(opts: ICreateClientOpts): ICreateClientOpts {\n opts.store =\n opts.store ??\n new MemoryStore({\n localStorage: globalThis.localStorage,\n });\n opts.scheduler = opts.scheduler ?? new MatrixScheduler();\n opts.cryptoStore = opts.cryptoStore ?? cryptoStoreFactory();\n\n return opts;\n}\n\n/**\n * Construct a Matrix Client. Similar to {@link MatrixClient}\n * except that the 'request', 'store' and 'scheduler' dependencies are satisfied.\n * @param opts - The configuration options for this client. These configuration\n * options will be passed directly to {@link MatrixClient}.\n *\n * @returns A new matrix client.\n * @see {@link MatrixClient} for the full list of options for\n * `opts`.\n */\nexport function createClient(opts: ICreateClientOpts): MatrixClient {\n return new MatrixClient(amendClientOpts(opts));\n}\n\n/**\n * Construct a Matrix Client that works in a widget.\n * This client has a subset of features compared to a full client.\n * It uses the widget-api to communicate with matrix. (widget \\<-\\> client \\<-\\> homeserver)\n * @returns A new matrix client with a subset of features.\n * @param opts - The configuration options for this client. These configuration\n * options will be passed directly to {@link MatrixClient}.\n * @param widgetApi - The widget api to use for communication.\n * @param capabilities - The capabilities the widget client will request.\n * @param roomId - The room id the widget is associated with.\n * @param sendContentLoaded - Whether to send a content loaded widget action immediately after initial setup.\n * Set to `false` if the widget uses `waitForIFrameLoad=true` (in this case the client does not expect a content loaded action at all),\n * or if the the widget wants to send the `ContentLoaded` action at a later point in time after the initial setup.\n */\nexport function createRoomWidgetClient(\n widgetApi: WidgetApi,\n capabilities: ICapabilities,\n roomId: string,\n opts: ICreateClientOpts,\n sendContentLoaded = true,\n): MatrixClient {\n return new RoomWidgetClient(widgetApi, capabilities, roomId, amendClientOpts(opts), sendContentLoaded);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,SAASA,iBAAiB,QAAQ,uCAAuC;AACzE,SAASC,WAAW,QAAQ,mBAAmB;AAC/C,SAASC,eAAe,Q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,eAAe,CAACC,IAAI,CAAC,CAAC;AAClD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASU,sBAAsBA,CAClCC,SAAoB,EACpBC,YAA2B,EAC3BC,MAAc,EACdb,IAAuB,EAEX;EAAA,IADZc,iBAAiB,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,IAAI;EAExB,OAAO,IAAIrC,gBAAgB,CAACiC,SAAS,EAAEC,YAAY,EAAEC,MAAM,EAAEd,eAAe,CAACC,IAAI,CAAC,EAAEc,iBAAiB,CAAC;AAC1G","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unwanted/matrix-sdk-mini",
3
- "version": "34.12.0-1",
3
+ "version": "34.12.0-2",
4
4
  "description": "Matrix Client-Server mini SDK for Javascript",
5
5
  "engines": {
6
6
  "node": ">=20.0.0"
@@ -35,29 +35,13 @@ import {
35
35
  SpaceChildEventContent,
36
36
  SpaceParentEventContent,
37
37
  } from "./state_events.ts";
38
- import {
39
- ExperimentalGroupCallRoomMemberState,
40
- IGroupCallRoomMemberState,
41
- IGroupCallRoomState,
42
- } from "../webrtc/groupCall.ts";
38
+
43
39
  import { MSC3089EventContent } from "../models/MSC3089Branch.ts";
44
40
  import { M_BEACON, M_BEACON_INFO, MBeaconEventContent, MBeaconInfoEventContent } from "./beacon.ts";
45
41
  import { XOR } from "./common.ts";
46
42
  import { ReactionEventContent, RoomMessageEventContent, StickerEventContent } from "./events.ts";
47
- import {
48
- MCallAnswer,
49
- MCallBase,
50
- MCallCandidates,
51
- MCallHangupReject,
52
- MCallInviteNegotiate,
53
- MCallReplacesEvent,
54
- MCallSelectAnswer,
55
- SDPStreamMetadata,
56
- SDPStreamMetadataKey,
57
- } from "../webrtc/callEventTypes.ts";
58
- import { EncryptionKeysEventContent, ICallNotifyContent } from "../matrixrtc/types.ts";
43
+
59
44
  import { M_POLL_END, M_POLL_START, PollEndEventContent, PollStartEventContent } from "./polls.ts";
60
- import { SessionMembershipData } from "../matrixrtc/CallMembership.ts";
61
45
 
62
46
  export enum EventType {
63
47
  // Room state events
@@ -312,17 +296,6 @@ export interface TimelineEvents {
312
296
  [EventType.RoomMessage]: RoomMessageEventContent;
313
297
  [EventType.Sticker]: StickerEventContent;
314
298
  [EventType.Reaction]: ReactionEventContent;
315
- [EventType.CallReplaces]: MCallReplacesEvent;
316
- [EventType.CallAnswer]: MCallAnswer;
317
- [EventType.CallSelectAnswer]: MCallSelectAnswer;
318
- [EventType.CallNegotiate]: Omit<MCallInviteNegotiate, "offer">;
319
- [EventType.CallInvite]: MCallInviteNegotiate;
320
- [EventType.CallCandidates]: MCallCandidates;
321
- [EventType.CallHangup]: MCallHangupReject;
322
- [EventType.CallReject]: MCallHangupReject;
323
- [EventType.CallSDPStreamMetadataChangedPrefix]: MCallBase & { [SDPStreamMetadataKey]: SDPStreamMetadata };
324
- [EventType.CallEncryptionKeysPrefix]: EncryptionKeysEventContent;
325
- [EventType.CallNotify]: ICallNotifyContent;
326
299
  [M_BEACON.name]: MBeaconEventContent;
327
300
  [M_POLL_START.name]: PollStartEventContent;
328
301
  [M_POLL_END.name]: PollEndEventContent;
@@ -355,13 +328,6 @@ export interface StateEvents {
355
328
  [EventType.PolicyRuleRoom]: XOR<PolicyRuleEventContent, {}>;
356
329
  [EventType.PolicyRuleServer]: XOR<PolicyRuleEventContent, {}>;
357
330
 
358
- // MSC3401
359
- [EventType.GroupCallPrefix]: IGroupCallRoomState;
360
- [EventType.GroupCallMemberPrefix]: XOR<
361
- XOR<IGroupCallRoomMemberState, ExperimentalGroupCallRoomMemberState>,
362
- XOR<SessionMembershipData, {}>
363
- >;
364
-
365
331
  // MSC3089
366
332
  [UNSTABLE_MSC3089_BRANCH.name]: MSC3089EventContent;
367
333