matrix-js-sdk 41.9.0 → 42.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (240) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/lib/@types/auth.d.ts +0 -5
  3. package/lib/@types/auth.d.ts.map +1 -1
  4. package/lib/@types/auth.js +0 -6
  5. package/lib/@types/auth.js.map +1 -1
  6. package/lib/@types/type-guards.d.ts +43 -0
  7. package/lib/@types/type-guards.d.ts.map +1 -0
  8. package/lib/@types/type-guards.js +104 -0
  9. package/lib/@types/type-guards.js.map +1 -0
  10. package/lib/NamespacedValue.d.ts.map +1 -1
  11. package/lib/ReEmitter.d.ts.map +1 -1
  12. package/lib/ToDeviceMessageQueue.d.ts.map +1 -1
  13. package/lib/autodiscovery.d.ts.map +1 -1
  14. package/lib/capabilityPoller.d.ts.map +1 -1
  15. package/lib/client.d.ts +4 -7
  16. package/lib/client.d.ts.map +1 -1
  17. package/lib/client.js +10 -22
  18. package/lib/client.js.map +1 -1
  19. package/lib/common-crypto/CryptoBackend.d.ts.map +1 -1
  20. package/lib/content-helpers.d.ts.map +1 -1
  21. package/lib/crypto/store/indexeddb-crypto-store-backend.d.ts.map +1 -1
  22. package/lib/crypto/store/indexeddb-crypto-store.d.ts.map +1 -1
  23. package/lib/crypto/store/localStorage-crypto-store.d.ts.map +1 -1
  24. package/lib/crypto/store/memory-crypto-store.d.ts.map +1 -1
  25. package/lib/crypto-api/index.d.ts +1 -1
  26. package/lib/crypto-api/index.d.ts.map +1 -1
  27. package/lib/crypto-api/index.js.map +1 -1
  28. package/lib/crypto-api/verification.d.ts +23 -5
  29. package/lib/crypto-api/verification.d.ts.map +1 -1
  30. package/lib/crypto-api/verification.js.map +1 -1
  31. package/lib/embedded.d.ts.map +1 -1
  32. package/lib/errors.d.ts.map +1 -1
  33. package/lib/extensible_events_v1/ExtensibleEvent.d.ts.map +1 -1
  34. package/lib/extensible_events_v1/InvalidEventError.d.ts.map +1 -1
  35. package/lib/extensible_events_v1/MessageEvent.d.ts.map +1 -1
  36. package/lib/extensible_events_v1/PollEndEvent.d.ts.map +1 -1
  37. package/lib/extensible_events_v1/PollResponseEvent.d.ts.map +1 -1
  38. package/lib/extensible_events_v1/PollStartEvent.d.ts.map +1 -1
  39. package/lib/filter-component.d.ts.map +1 -1
  40. package/lib/filter.d.ts.map +1 -1
  41. package/lib/http-api/errors.d.ts.map +1 -1
  42. package/lib/http-api/fetch.d.ts +1 -1
  43. package/lib/http-api/fetch.d.ts.map +1 -1
  44. package/lib/http-api/fetch.js.map +1 -1
  45. package/lib/http-api/index.d.ts +1 -7
  46. package/lib/http-api/index.d.ts.map +1 -1
  47. package/lib/http-api/index.js +0 -15
  48. package/lib/http-api/index.js.map +1 -1
  49. package/lib/http-api/interface.d.ts +0 -9
  50. package/lib/http-api/interface.d.ts.map +1 -1
  51. package/lib/http-api/interface.js +0 -2
  52. package/lib/http-api/interface.js.map +1 -1
  53. package/lib/http-api/refresh.d.ts.map +1 -1
  54. package/lib/index.d.ts.map +1 -1
  55. package/lib/interactive-auth.d.ts.map +1 -1
  56. package/lib/logger.d.ts.map +1 -1
  57. package/lib/matrix.d.ts +1 -1
  58. package/lib/matrix.d.ts.map +1 -1
  59. package/lib/matrix.js +1 -1
  60. package/lib/matrix.js.map +1 -1
  61. package/lib/matrixrtc/CallMembership.d.ts.map +1 -1
  62. package/lib/matrixrtc/LivekitTransport.d.ts.map +1 -1
  63. package/lib/matrixrtc/MatrixRTCSession.d.ts.map +1 -1
  64. package/lib/matrixrtc/MatrixRTCSessionManager.d.ts.map +1 -1
  65. package/lib/matrixrtc/MembershipManager.d.ts.map +1 -1
  66. package/lib/matrixrtc/MembershipManagerActionScheduler.d.ts.map +1 -1
  67. package/lib/matrixrtc/RTCEncryptionManager.d.ts.map +1 -1
  68. package/lib/matrixrtc/ToDeviceKeyTransport.d.ts.map +1 -1
  69. package/lib/matrixrtc/membershipData/common.d.ts.map +1 -1
  70. package/lib/matrixrtc/membershipData/rtc.d.ts.map +1 -1
  71. package/lib/matrixrtc/membershipData/session.d.ts.map +1 -1
  72. package/lib/matrixrtc/types.d.ts.map +1 -1
  73. package/lib/matrixrtc/utils.d.ts.map +1 -1
  74. package/lib/models/MSC3089Branch.d.ts.map +1 -1
  75. package/lib/models/MSC3089TreeSpace.d.ts.map +1 -1
  76. package/lib/models/beacon.d.ts.map +1 -1
  77. package/lib/models/device.d.ts.map +1 -1
  78. package/lib/models/event-context.d.ts.map +1 -1
  79. package/lib/models/event-timeline-set.d.ts.map +1 -1
  80. package/lib/models/event-timeline.d.ts.map +1 -1
  81. package/lib/models/event.d.ts.map +1 -1
  82. package/lib/models/invites-ignorer.d.ts.map +1 -1
  83. package/lib/models/poll.d.ts.map +1 -1
  84. package/lib/models/read-receipt.d.ts.map +1 -1
  85. package/lib/models/related-relations.d.ts.map +1 -1
  86. package/lib/models/relations-container.d.ts.map +1 -1
  87. package/lib/models/relations.d.ts.map +1 -1
  88. package/lib/models/room-member.d.ts.map +1 -1
  89. package/lib/models/room-receipts.d.ts.map +1 -1
  90. package/lib/models/room-retention.d.ts.map +1 -1
  91. package/lib/models/room-state.d.ts.map +1 -1
  92. package/lib/models/room-sticky-events.d.ts.map +1 -1
  93. package/lib/models/room-summary.d.ts.map +1 -1
  94. package/lib/models/room.d.ts.map +1 -1
  95. package/lib/models/search-result.d.ts.map +1 -1
  96. package/lib/models/thread.d.ts.map +1 -1
  97. package/lib/models/typed-event-emitter.d.ts.map +1 -1
  98. package/lib/models/user.d.ts.map +1 -1
  99. package/lib/oauth/authorize.d.ts +133 -0
  100. package/lib/oauth/authorize.d.ts.map +1 -0
  101. package/lib/oauth/authorize.js +193 -0
  102. package/lib/oauth/authorize.js.map +1 -0
  103. package/lib/oauth/discover.d.ts +58 -0
  104. package/lib/oauth/discover.d.ts.map +1 -0
  105. package/lib/oauth/discover.js +35 -0
  106. package/lib/oauth/discover.js.map +1 -0
  107. package/lib/oauth/error.d.ts +19 -0
  108. package/lib/oauth/error.d.ts.map +1 -0
  109. package/lib/oauth/error.js +36 -0
  110. package/lib/oauth/error.js.map +1 -0
  111. package/lib/oauth/index.d.ts +87 -0
  112. package/lib/oauth/index.d.ts.map +1 -0
  113. package/lib/oauth/index.js +234 -0
  114. package/lib/oauth/index.js.map +1 -0
  115. package/lib/oauth/register.d.ts +136 -0
  116. package/lib/oauth/register.d.ts.map +1 -0
  117. package/lib/oauth/register.js +73 -0
  118. package/lib/oauth/register.js.map +1 -0
  119. package/lib/oauth/tokenRefresher.d.ts +21 -0
  120. package/lib/oauth/tokenRefresher.d.ts.map +1 -0
  121. package/lib/oauth/tokenRefresher.js +68 -0
  122. package/lib/oauth/tokenRefresher.js.map +1 -0
  123. package/lib/pushprocessor.d.ts.map +1 -1
  124. package/lib/receipt-accumulator.d.ts.map +1 -1
  125. package/lib/rendezvous/MSC4108SignInWithQR.d.ts +7 -7
  126. package/lib/rendezvous/MSC4108SignInWithQR.d.ts.map +1 -1
  127. package/lib/rendezvous/MSC4108SignInWithQR.js +11 -11
  128. package/lib/rendezvous/MSC4108SignInWithQR.js.map +1 -1
  129. package/lib/rendezvous/RendezvousError.d.ts.map +1 -1
  130. package/lib/rendezvous/channels/MSC4108SecureChannel.d.ts.map +1 -1
  131. package/lib/rendezvous/index.d.ts.map +1 -1
  132. package/lib/rendezvous/index.js.map +1 -1
  133. package/lib/rendezvous/transports/MSC4108RendezvousSession.d.ts.map +1 -1
  134. package/lib/retentionPolicy.d.ts.map +1 -1
  135. package/lib/room-hierarchy.d.ts.map +1 -1
  136. package/lib/rust-crypto/CrossSigningIdentity.d.ts.map +1 -1
  137. package/lib/rust-crypto/DehydratedDeviceManager.d.ts.map +1 -1
  138. package/lib/rust-crypto/DehydratedDeviceManager.js +11 -13
  139. package/lib/rust-crypto/DehydratedDeviceManager.js.map +1 -1
  140. package/lib/rust-crypto/KeyClaimManager.d.ts.map +1 -1
  141. package/lib/rust-crypto/OutgoingRequestProcessor.d.ts.map +1 -1
  142. package/lib/rust-crypto/OutgoingRequestsManager.d.ts.map +1 -1
  143. package/lib/rust-crypto/PerSessionKeyBackupDownloader.d.ts.map +1 -1
  144. package/lib/rust-crypto/RoomEncryptor.d.ts.map +1 -1
  145. package/lib/rust-crypto/backup.d.ts.map +1 -1
  146. package/lib/rust-crypto/rust-crypto.d.ts.map +1 -1
  147. package/lib/rust-crypto/verification.d.ts.map +1 -1
  148. package/lib/scheduler.d.ts.map +1 -1
  149. package/lib/secret-storage.d.ts.map +1 -1
  150. package/lib/serverCapabilities.d.ts.map +1 -1
  151. package/lib/sliding-sync-sdk.d.ts.map +1 -1
  152. package/lib/sliding-sync.d.ts.map +1 -1
  153. package/lib/store/indexeddb-local-backend.d.ts.map +1 -1
  154. package/lib/store/indexeddb-remote-backend.d.ts.map +1 -1
  155. package/lib/store/indexeddb-store-worker.d.ts.map +1 -1
  156. package/lib/store/indexeddb.d.ts.map +1 -1
  157. package/lib/store/memory.d.ts.map +1 -1
  158. package/lib/store/stub.d.ts.map +1 -1
  159. package/lib/sync-accumulator.d.ts.map +1 -1
  160. package/lib/sync.d.ts.map +1 -1
  161. package/lib/testing.d.ts +2 -10
  162. package/lib/testing.d.ts.map +1 -1
  163. package/lib/testing.js +4 -19
  164. package/lib/testing.js.map +1 -1
  165. package/lib/timeline-window.d.ts.map +1 -1
  166. package/lib/utils.d.ts.map +1 -1
  167. package/lib/webrtc/call.d.ts.map +1 -1
  168. package/lib/webrtc/callEventHandler.d.ts.map +1 -1
  169. package/lib/webrtc/callFeed.d.ts.map +1 -1
  170. package/lib/webrtc/groupCall.d.ts.map +1 -1
  171. package/lib/webrtc/groupCallEventHandler.d.ts.map +1 -1
  172. package/lib/webrtc/mediaHandler.d.ts.map +1 -1
  173. package/lib/webrtc/stats/callFeedStatsReporter.d.ts.map +1 -1
  174. package/lib/webrtc/stats/callStatsReportGatherer.d.ts.map +1 -1
  175. package/lib/webrtc/stats/connectionStatsBuilder.d.ts.map +1 -1
  176. package/lib/webrtc/stats/connectionStatsReportBuilder.d.ts.map +1 -1
  177. package/lib/webrtc/stats/groupCallStats.d.ts.map +1 -1
  178. package/lib/webrtc/stats/media/mediaSsrcHandler.d.ts.map +1 -1
  179. package/lib/webrtc/stats/media/mediaTrackHandler.d.ts.map +1 -1
  180. package/lib/webrtc/stats/media/mediaTrackStats.d.ts.map +1 -1
  181. package/lib/webrtc/stats/media/mediaTrackStatsHandler.d.ts.map +1 -1
  182. package/lib/webrtc/stats/statsReportEmitter.d.ts.map +1 -1
  183. package/lib/webrtc/stats/summaryStatsReportGatherer.d.ts.map +1 -1
  184. package/lib/webrtc/stats/trackStatsBuilder.d.ts.map +1 -1
  185. package/lib/webrtc/stats/transportStatsBuilder.d.ts.map +1 -1
  186. package/lib/webrtc/stats/valueFormatter.d.ts.map +1 -1
  187. package/package.json +7 -9
  188. package/src/@types/auth.ts +0 -6
  189. package/src/@types/type-guards.ts +126 -0
  190. package/src/client.ts +13 -29
  191. package/src/crypto-api/index.ts +1 -1
  192. package/src/crypto-api/verification.ts +23 -5
  193. package/src/http-api/fetch.ts +1 -1
  194. package/src/http-api/index.ts +1 -23
  195. package/src/http-api/interface.ts +0 -11
  196. package/src/matrix.ts +1 -1
  197. package/src/oauth/authorize.ts +274 -0
  198. package/src/oauth/discover.ts +102 -0
  199. package/src/{oidc → oauth}/error.ts +8 -7
  200. package/src/oauth/index.ts +297 -0
  201. package/src/oauth/register.ts +166 -0
  202. package/src/oauth/tokenRefresher.ts +77 -0
  203. package/src/rendezvous/MSC4108SignInWithQR.ts +11 -12
  204. package/src/rendezvous/index.ts +2 -2
  205. package/src/rust-crypto/DehydratedDeviceManager.ts +14 -13
  206. package/src/testing.ts +3 -22
  207. package/lib/oidc/authorize.d.ts +0 -157
  208. package/lib/oidc/authorize.d.ts.map +0 -1
  209. package/lib/oidc/authorize.js +0 -365
  210. package/lib/oidc/authorize.js.map +0 -1
  211. package/lib/oidc/discovery.d.ts +0 -22
  212. package/lib/oidc/discovery.d.ts.map +0 -1
  213. package/lib/oidc/discovery.js +0 -65
  214. package/lib/oidc/discovery.js.map +0 -1
  215. package/lib/oidc/error.d.ts +0 -18
  216. package/lib/oidc/error.d.ts.map +0 -1
  217. package/lib/oidc/error.js +0 -35
  218. package/lib/oidc/error.js.map +0 -1
  219. package/lib/oidc/index.d.ts +0 -16
  220. package/lib/oidc/index.d.ts.map +0 -1
  221. package/lib/oidc/index.js +0 -30
  222. package/lib/oidc/index.js.map +0 -1
  223. package/lib/oidc/register.d.ts +0 -70
  224. package/lib/oidc/register.d.ts.map +0 -1
  225. package/lib/oidc/register.js +0 -134
  226. package/lib/oidc/register.js.map +0 -1
  227. package/lib/oidc/tokenRefresher.d.ts +0 -91
  228. package/lib/oidc/tokenRefresher.d.ts.map +0 -1
  229. package/lib/oidc/tokenRefresher.js +0 -173
  230. package/lib/oidc/tokenRefresher.js.map +0 -1
  231. package/lib/oidc/validate.d.ts +0 -78
  232. package/lib/oidc/validate.d.ts.map +0 -1
  233. package/lib/oidc/validate.js +0 -181
  234. package/lib/oidc/validate.js.map +0 -1
  235. package/src/oidc/authorize.ts +0 -431
  236. package/src/oidc/discovery.ts +0 -67
  237. package/src/oidc/index.ts +0 -33
  238. package/src/oidc/register.ts +0 -168
  239. package/src/oidc/tokenRefresher.ts +0 -184
  240. package/src/oidc/validate.ts +0 -265
@@ -1 +1 @@
1
- {"version":3,"file":"verification.js","names":[],"sources":["../../src/crypto-api/verification.ts"],"sourcesContent":["/*\nCopyright 2023 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 { type MatrixEvent } from \"../models/event.ts\";\nimport { type TypedEventEmitter } from \"../models/typed-event-emitter.ts\";\n\n/**\n * An incoming, or outgoing, request to verify a user or a device via cross-signing.\n */\nexport interface VerificationRequest extends TypedEventEmitter<\n VerificationRequestEvent,\n VerificationRequestEventHandlerMap\n> {\n /**\n * Unique ID for this verification request.\n *\n * An ID isn't assigned until the first message is sent, so this may be `undefined` in the early phases.\n */\n get transactionId(): string | undefined;\n\n /**\n * For an in-room verification, the ID of the room.\n *\n * For to-device verifictions, `undefined`.\n */\n get roomId(): string | undefined;\n\n /**\n * True if this request was initiated by the local client.\n *\n * For in-room verifications, the initiator is who sent the `m.key.verification.request` event.\n * For to-device verifications, the initiator is who sent the `m.key.verification.start` event.\n */\n get initiatedByMe(): boolean;\n\n /** The user id of the other party in this request */\n get otherUserId(): string;\n\n /** For verifications via to-device messages: the ID of the other device. Otherwise, undefined. */\n get otherDeviceId(): string | undefined;\n\n /** True if the other party in this request is one of this user's own devices. */\n get isSelfVerification(): boolean;\n\n /** current phase of the request. */\n get phase(): VerificationPhase;\n\n /** True if the request has sent its initial event and needs more events to complete\n * (ie it is in phase `Requested`, `Ready` or `Started`).\n */\n get pending(): boolean;\n\n /**\n * True if we have started the process of sending an `m.key.verification.ready` (but have not necessarily received\n * the remote echo which causes a transition to {@link VerificationPhase.Ready}.\n */\n get accepting(): boolean;\n\n /**\n * True if we have started the process of sending an `m.key.verification.cancel` (but have not necessarily received\n * the remote echo which causes a transition to {@link VerificationPhase.Cancelled}).\n */\n get declining(): boolean;\n\n /**\n * The remaining number of ms before the request will be automatically cancelled.\n *\n * `null` indicates that there is no timeout\n */\n get timeout(): number | null;\n\n /** once the phase is Started (and !initiatedByMe) or Ready: common methods supported by both sides */\n get methods(): string[];\n\n /** the method picked in the .start event */\n get chosenMethod(): string | null;\n\n /**\n * Checks whether the other party supports a given verification method.\n * This is useful when setting up the QR code UI, as it is somewhat asymmetrical:\n * if the other party supports SCAN_QR, we should show a QR code in the UI, and vice versa.\n * For methods that need to be supported by both ends, use the `methods` property.\n *\n * @param method - the method to check\n * @returns true if the other party said they supported the method\n */\n otherPartySupportsMethod(method: string): boolean;\n\n /**\n * Accepts the request, sending a .ready event to the other party\n *\n * @returns Promise which resolves when the event has been sent.\n */\n accept(): Promise<void>;\n\n /**\n * Cancels the request, sending a cancellation to the other party\n *\n * @param params - Details for the cancellation, including `reason` (defaults to \"User declined\"), and `code`\n * (defaults to `m.user`). **Deprecated**: this parameter is ignored by the Rust cryptography implementation.\n *\n * @returns Promise which resolves when the event has been sent.\n */\n cancel(params?: { reason?: string; code?: string }): Promise<void>;\n\n /**\n * Send an `m.key.verification.start` event to start verification via a particular method.\n *\n * This is normally used when starting a verification via emojis (ie, `method` is set to `m.sas.v1`).\n *\n * @param method - the name of the verification method to use.\n *\n * @returns The verifier which will do the actual verification.\n */\n startVerification(method: string): Promise<Verifier>;\n\n /**\n * Start a QR code verification by providing a scanned QR code for this verification flow.\n *\n * Validates the QR code, and if it is ok, sends an `m.key.verification.start` event with `method` set to\n * `m.reciprocate.v1`, to tell the other side the scan was successful.\n *\n * See also {@link VerificationRequest#startVerification} which can be used to start other verification methods.\n *\n * @param qrCodeData - the decoded QR code.\n * @returns A verifier; call `.verify()` on it to wait for the other side to complete the verification flow.\n */\n scanQRCode(qrCodeData: Uint8ClampedArray): Promise<Verifier>;\n\n /**\n * The verifier which is doing the actual verification, once the method has been established.\n * Only defined when the `phase` is Started.\n */\n get verifier(): Verifier | undefined;\n\n /**\n * Generate the data for a QR code allowing the other device to verify this one, if it supports it.\n *\n * Only returns data once `phase` is {@link VerificationPhase.Ready} and the other party can scan a QR code;\n * otherwise returns `undefined`.\n */\n generateQRCode(): Promise<Uint8ClampedArray | undefined>;\n\n /**\n * If this request has been cancelled, the cancellation code (e.g `m.user`) which is responsible for cancelling\n * this verification.\n */\n get cancellationCode(): string | null;\n\n /**\n * The id of the user that cancelled the request.\n *\n * Only defined when phase is Cancelled\n */\n get cancellingUserId(): string | undefined;\n}\n\n/** Events emitted by {@link VerificationRequest}. */\nexport enum VerificationRequestEvent {\n /**\n * Fires whenever the state of the request object has changed.\n *\n * There is no payload to the event.\n */\n Change = \"change\",\n}\n\n/**\n * Listener type map for {@link VerificationRequestEvent}s.\n *\n * @internal\n */\nexport type VerificationRequestEventHandlerMap = {\n [VerificationRequestEvent.Change]: () => void;\n};\n\n/** The current phase of a verification request. */\nexport enum VerificationPhase {\n /** Initial state: no event yet exchanged */\n Unsent = 1,\n\n /** An `m.key.verification.request` event has been sent or received */\n Requested,\n\n /** An `m.key.verification.ready` event has been sent or received, indicating the verification request is accepted. */\n Ready,\n\n /**\n * The verification is in flight.\n *\n * This means that an `m.key.verification.start` event has been sent or received, choosing a verification method;\n * however the verification has not yet completed or been cancelled.\n */\n Started,\n\n /**\n * An `m.key.verification.cancel` event has been sent or received at any time before the `done` event, cancelling\n * the verification request\n */\n Cancelled,\n\n /**\n * The verification request is complete.\n *\n * Normally this means that `m.key.verification.done` events have been sent and received.\n */\n Done,\n}\n\n/**\n * A `Verifier` is responsible for performing the verification using a particular method, such as via QR code or SAS\n * (emojis).\n *\n * A verifier object can be created by calling `VerificationRequest.beginVerification`; one is also created\n * automatically when a `m.key.verification.start` event is received for an existing VerificationRequest.\n *\n * Once a verifier object is created, the verification can be started by calling the {@link Verifier#verify} method.\n */\nexport interface Verifier extends TypedEventEmitter<VerifierEvent, VerifierEventHandlerMap> {\n /**\n * Returns true if the verification has been cancelled, either by us or the other side.\n */\n get hasBeenCancelled(): boolean;\n\n /**\n * The ID of the other user in the verification process.\n */\n get userId(): string;\n\n /**\n * Start the key verification, if it has not already been started.\n *\n * This means sending a `m.key.verification.start` if we are the first responder, or a `m.key.verification.accept`\n * if the other side has already sent a start event.\n *\n * @returns Promise which resolves when the verification has completed, or rejects if the verification is cancelled\n * or times out.\n */\n verify(): Promise<void>;\n\n /**\n * Cancel a verification.\n *\n * We will send an `m.key.verification.cancel` if the verification is still in flight. The verification promise\n * will reject, and a {@link crypto-api.VerifierEvent.Cancel | VerifierEvent.Cancel} will be emitted.\n *\n * @param e - the reason for the cancellation.\n */\n cancel(e: Error): void;\n\n /**\n * Get the details for an SAS verification, if one is in progress\n *\n * Returns `null`, unless this verifier is for a SAS-based verification and we are waiting for the user to confirm\n * the SAS matches.\n */\n getShowSasCallbacks(): ShowSasCallbacks | null;\n\n /**\n * Get the details for reciprocating QR code verification, if one is in progress\n *\n * Returns `null`, unless this verifier is for reciprocating a QR-code-based verification (ie, the other user has\n * already scanned our QR code), and we are waiting for the user to confirm.\n */\n getReciprocateQrCodeCallbacks(): ShowQrCodeCallbacks | null;\n}\n\n/** Events emitted by {@link Verifier} */\nexport enum VerifierEvent {\n /**\n * The verification has been cancelled, by us or the other side.\n *\n * The payload is either an {@link Error}, or an (incoming or outgoing) {@link MatrixEvent}, depending on\n * unspecified reasons.\n */\n Cancel = \"cancel\",\n\n /**\n * SAS data has been exchanged and should be displayed to the user.\n *\n * The payload is the {@link ShowSasCallbacks} object.\n */\n ShowSas = \"show_sas\",\n\n /**\n * The user should confirm if the other side has scanned our QR code.\n *\n * The payload is the {@link ShowQrCodeCallbacks} object.\n */\n ShowReciprocateQr = \"show_reciprocate_qr\",\n}\n\n/** Listener type map for {@link VerifierEvent}s. */\nexport type VerifierEventHandlerMap = {\n [VerifierEvent.Cancel]: (e: Error | MatrixEvent) => void;\n [VerifierEvent.ShowSas]: (sas: ShowSasCallbacks) => void;\n [VerifierEvent.ShowReciprocateQr]: (qr: ShowQrCodeCallbacks) => void;\n};\n\n/**\n * Callbacks for user actions to confirm that the other side has scanned our QR code.\n *\n * This is exposed as the payload of a `VerifierEvent.ShowReciprocateQr` event, or can be retrieved directly from the\n * verifier as `reciprocateQREvent`.\n */\nexport interface ShowQrCodeCallbacks {\n /** The user confirms that the verification data matches */\n confirm(): void;\n\n /** Cancel the verification flow */\n cancel(): void;\n}\n\n/**\n * Callbacks for user actions while a SAS is displayed.\n *\n * This is exposed as the payload of a `VerifierEvent.ShowSas` event, or directly from the verifier as `sasEvent`.\n */\nexport interface ShowSasCallbacks {\n /** The generated SAS to be shown to the user */\n sas: GeneratedSas;\n\n /** Function to call if the user confirms that the SAS matches.\n *\n * @returns A Promise that completes once the m.key.verification.mac is queued.\n */\n confirm(): Promise<void>;\n\n /**\n * Function to call if the user finds the SAS does not match.\n *\n * Sends an `m.key.verification.cancel` event with a `m.mismatched_sas` error code.\n */\n mismatch(): void;\n\n /** Cancel the verification flow */\n cancel(): void;\n}\n\n/** A generated SAS to be shown to the user, in alternative formats */\nexport interface GeneratedSas {\n /**\n * The SAS as three numbers between 0 and 8191.\n *\n * Only populated if the `decimal` SAS method was negotiated.\n */\n decimal?: [number, number, number];\n\n /**\n * The SAS as seven emojis.\n *\n * Only populated if the `emoji` SAS method was negotiated.\n */\n emoji?: EmojiMapping[];\n}\n\n/**\n * An emoji for the generated SAS. A tuple `[emoji, name]` where `emoji` is the emoji itself and `name` is the\n * English name.\n */\nexport type EmojiMapping = [emoji: string, name: string];\n\n/**\n * True if the request is in a state where it can be accepted (ie, that we're in phases {@link VerificationPhase.Unsent}\n * or {@link VerificationPhase.Requested}, and that we're not in the process of sending a `ready` or `cancel`).\n */\nexport function canAcceptVerificationRequest(req: VerificationRequest): boolean {\n return req.phase < VerificationPhase.Ready && !req.accepting && !req.declining;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAKA;AACA;AACA;;AAqJA;AACA,WAAY,wBAAwB,0BAAxB,wBAAwB;EAChC;AACJ;AACA;AACA;AACA;EALY,wBAAwB;EAAA,OAAxB,wBAAwB;AAAA;;AASpC;AACA;AACA;AACA;AACA;;AAKA;AACA,WAAY,iBAAiB,0BAAjB,iBAAiB;EACzB;EADQ,iBAAiB,CAAjB,iBAAiB;EAIzB;EAJQ,iBAAiB,CAAjB,iBAAiB;EAOzB;EAPQ,iBAAiB,CAAjB,iBAAiB;EAUzB;AACJ;AACA;AACA;AACA;AACA;EAfY,iBAAiB,CAAjB,iBAAiB;EAkBzB;AACJ;AACA;AACA;EArBY,iBAAiB,CAAjB,iBAAiB;EAwBzB;AACJ;AACA;AACA;AACA;EA5BY,iBAAiB,CAAjB,iBAAiB;EAAA,OAAjB,iBAAiB;AAAA;;AAgC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAkDA;AACA,WAAY,aAAa,0BAAb,aAAa;EACrB;AACJ;AACA;AACA;AACA;AACA;EANY,aAAa;EASrB;AACJ;AACA;AACA;AACA;EAbY,aAAa;EAgBrB;AACJ;AACA;AACA;AACA;EApBY,aAAa;EAAA,OAAb,aAAa;AAAA;;AAwBzB;;AAOA;AACA;AACA;AACA;AACA;AACA;;AASA;AACA;AACA;AACA;AACA;;AAsBA;;AAiBA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA,OAAO,SAAS,4BAA4B,CAAC,GAAwB,EAAW;EAC5E,OAAO,GAAG,CAAC,KAAK,GAAG,iBAAiB,CAAC,KAAK,IAAI,CAAC,GAAG,CAAC,SAAS,IAAI,CAAC,GAAG,CAAC,SAAS;AAClF","ignoreList":[]}
1
+ {"version":3,"file":"verification.js","names":[],"sources":["../../src/crypto-api/verification.ts"],"sourcesContent":["/*\nCopyright 2023 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 { type MatrixEvent } from \"../models/event.ts\";\nimport { type TypedEventEmitter } from \"../models/typed-event-emitter.ts\";\n\n/**\n * An incoming, or outgoing, request to verify a user or a device via cross-signing.\n */\nexport interface VerificationRequest extends TypedEventEmitter<\n VerificationRequestEvent,\n VerificationRequestEventHandlerMap\n> {\n /**\n * Unique ID for this verification request.\n *\n * An ID isn't assigned until the first message is sent, so this may be `undefined` in the early phases.\n */\n get transactionId(): string | undefined;\n\n /**\n * For an in-room verification, the ID of the room.\n *\n * For to-device verifictions, `undefined`.\n */\n get roomId(): string | undefined;\n\n /**\n * True if this request was initiated by the local client.\n *\n * For in-room verifications, the initiator is who sent the `m.key.verification.request` event.\n * For to-device verifications, the initiator is who sent the `m.key.verification.start` event.\n */\n get initiatedByMe(): boolean;\n\n /** The user id of the other party in this request */\n get otherUserId(): string;\n\n /** For verifications via to-device messages: the ID of the other device. Otherwise, undefined. */\n get otherDeviceId(): string | undefined;\n\n /** True if the other party in this request is one of this user's own devices. */\n get isSelfVerification(): boolean;\n\n /** current phase of the request. */\n get phase(): VerificationPhase;\n\n /** True if the request has sent its initial event and needs more events to complete\n * (ie it is in phase `Requested`, `Ready` or `Started`).\n */\n get pending(): boolean;\n\n /**\n * True if we have started the process of sending an `m.key.verification.ready` (but have not necessarily received\n * the remote echo which causes a transition to {@link VerificationPhase.Ready}.\n */\n get accepting(): boolean;\n\n /**\n * True if we have started the process of sending an `m.key.verification.cancel` (but have not necessarily received\n * the remote echo which causes a transition to {@link VerificationPhase.Cancelled}).\n */\n get declining(): boolean;\n\n /**\n * The remaining number of ms before the request will be automatically cancelled.\n *\n * `null` indicates that there is no timeout\n */\n get timeout(): number | null;\n\n /** once the phase is Started (and !initiatedByMe) or Ready: common methods supported by both sides */\n get methods(): string[];\n\n /** the method picked in the .start event */\n get chosenMethod(): string | null;\n\n /**\n * Checks whether the other party supports a given verification method.\n * This is useful when setting up the QR code UI, as it is somewhat asymmetrical:\n * if the other party supports SCAN_QR, we should show a QR code in the UI, and vice versa.\n * For methods that need to be supported by both ends, use the `methods` property.\n *\n * @param method - the method to check\n * @returns true if the other party said they supported the method\n */\n otherPartySupportsMethod(method: string): boolean;\n\n /**\n * Accepts the request, sending a .ready event to the other party\n *\n * @returns Promise which resolves when the event has been sent.\n */\n accept(): Promise<void>;\n\n /**\n * Cancels the request, sending a cancellation to the other party\n *\n * @param params - Details for the cancellation, including `reason` (defaults to \"User declined\"), and `code`\n * (defaults to `m.user`). **Deprecated**: this parameter is ignored by the Rust cryptography implementation.\n *\n * @returns Promise which resolves when the event has been sent.\n */\n cancel(params?: { reason?: string; code?: string }): Promise<void>;\n\n /**\n * Send an `m.key.verification.start` event to start verification via a particular method.\n *\n * This is used for SAS (emoji) verification: `method` should be set to `m.sas.v1`. It does not start\n * QR-code verification, and passing a QR-code method (such as `m.reciprocate.v1`, `m.qr_code.scan.v1`,\n * or `m.qr_code.show.v1`) will be rejected with an \"Unsupported verification method\" error.\n *\n * For QR-code verification, use {@link VerificationRequest#generateQRCode} to display a QR code to the\n * other device, or {@link VerificationRequest#scanQRCode} to consume a QR code scanned from it. This is\n * only possible once the `phase` is {@link VerificationPhase.Ready}; when it is, a client can typically\n * offer the user any of three options: show a QR code, scan the other party's QR code, or fall back to\n * emoji (SAS) verification via this method.\n *\n * @param method - the name of the verification method to use.\n *\n * @returns The verifier which will do the actual verification.\n */\n startVerification(method: string): Promise<Verifier>;\n\n /**\n * Start a QR code verification by providing a scanned QR code for this verification flow.\n *\n * Call this once the user has scanned the QR code displayed by the other device (for example, the bytes\n * produced by that device's {@link VerificationRequest#generateQRCode}). Validates the QR code, and if it\n * is ok, sends an `m.key.verification.start` event with `method` set to `m.reciprocate.v1`, to tell the\n * other side the scan was successful.\n *\n * See also {@link VerificationRequest#startVerification} which can be used to start other verification methods.\n *\n * @param qrCodeData - the decoded QR code.\n * @returns A verifier; call `.verify()` on it to wait for the other side to complete the verification flow.\n */\n scanQRCode(qrCodeData: Uint8ClampedArray): Promise<Verifier>;\n\n /**\n * The verifier which is doing the actual verification, once the method has been established.\n * Only defined when the `phase` is Started.\n */\n get verifier(): Verifier | undefined;\n\n /**\n * Generate the data for a QR code allowing the other device to verify this one, if it supports it.\n *\n * Returns the QR code data only when all of the following hold; otherwise it returns `undefined`:\n * - `phase` is {@link VerificationPhase.Ready};\n * - the other party advertises support for scanning a QR code (ie, `otherPartySupportsMethod(\"m.qr_code.scan.v1\")`\n * is true); and\n * - this device has its cross-signing keys available locally. A frequent cause of an unexpected `undefined`\n * is that cross-signing has not been set up or the keys have not yet been fetched, so the QR code cannot be\n * constructed even though the phase and method checks pass.\n *\n * On success, display the returned bytes as a QR code for the other device to scan; if the other side scans it\n * and confirms, there is nothing further to do on this side.\n */\n generateQRCode(): Promise<Uint8ClampedArray | undefined>;\n\n /**\n * If this request has been cancelled, the cancellation code (e.g `m.user`) which is responsible for cancelling\n * this verification.\n */\n get cancellationCode(): string | null;\n\n /**\n * The id of the user that cancelled the request.\n *\n * Only defined when phase is Cancelled\n */\n get cancellingUserId(): string | undefined;\n}\n\n/** Events emitted by {@link VerificationRequest}. */\nexport enum VerificationRequestEvent {\n /**\n * Fires whenever the state of the request object has changed.\n *\n * There is no payload to the event.\n */\n Change = \"change\",\n}\n\n/**\n * Listener type map for {@link VerificationRequestEvent}s.\n *\n * @internal\n */\nexport type VerificationRequestEventHandlerMap = {\n [VerificationRequestEvent.Change]: () => void;\n};\n\n/** The current phase of a verification request. */\nexport enum VerificationPhase {\n /** Initial state: no event yet exchanged */\n Unsent = 1,\n\n /** An `m.key.verification.request` event has been sent or received */\n Requested,\n\n /** An `m.key.verification.ready` event has been sent or received, indicating the verification request is accepted. */\n Ready,\n\n /**\n * The verification is in flight.\n *\n * This means that an `m.key.verification.start` event has been sent or received, choosing a verification method;\n * however the verification has not yet completed or been cancelled.\n */\n Started,\n\n /**\n * An `m.key.verification.cancel` event has been sent or received at any time before the `done` event, cancelling\n * the verification request\n */\n Cancelled,\n\n /**\n * The verification request is complete.\n *\n * Normally this means that `m.key.verification.done` events have been sent and received.\n */\n Done,\n}\n\n/**\n * A `Verifier` is responsible for performing the verification using a particular method, such as via QR code or SAS\n * (emojis).\n *\n * A verifier object can be created by calling `VerificationRequest.beginVerification`; one is also created\n * automatically when a `m.key.verification.start` event is received for an existing VerificationRequest.\n *\n * Once a verifier object is created, the verification can be started by calling the {@link Verifier#verify} method.\n */\nexport interface Verifier extends TypedEventEmitter<VerifierEvent, VerifierEventHandlerMap> {\n /**\n * Returns true if the verification has been cancelled, either by us or the other side.\n */\n get hasBeenCancelled(): boolean;\n\n /**\n * The ID of the other user in the verification process.\n */\n get userId(): string;\n\n /**\n * Start the key verification, if it has not already been started.\n *\n * This means sending a `m.key.verification.start` if we are the first responder, or a `m.key.verification.accept`\n * if the other side has already sent a start event.\n *\n * @returns Promise which resolves when the verification has completed, or rejects if the verification is cancelled\n * or times out.\n */\n verify(): Promise<void>;\n\n /**\n * Cancel a verification.\n *\n * We will send an `m.key.verification.cancel` if the verification is still in flight. The verification promise\n * will reject, and a {@link crypto-api.VerifierEvent.Cancel | VerifierEvent.Cancel} will be emitted.\n *\n * @param e - the reason for the cancellation.\n */\n cancel(e: Error): void;\n\n /**\n * Get the details for an SAS verification, if one is in progress\n *\n * Returns `null`, unless this verifier is for a SAS-based verification and we are waiting for the user to confirm\n * the SAS matches.\n */\n getShowSasCallbacks(): ShowSasCallbacks | null;\n\n /**\n * Get the details for reciprocating QR code verification, if one is in progress\n *\n * Returns `null`, unless this verifier is for reciprocating a QR-code-based verification (ie, the other user has\n * already scanned our QR code), and we are waiting for the user to confirm.\n */\n getReciprocateQrCodeCallbacks(): ShowQrCodeCallbacks | null;\n}\n\n/** Events emitted by {@link Verifier} */\nexport enum VerifierEvent {\n /**\n * The verification has been cancelled, by us or the other side.\n *\n * The payload is either an {@link Error}, or an (incoming or outgoing) {@link MatrixEvent}, depending on\n * unspecified reasons.\n */\n Cancel = \"cancel\",\n\n /**\n * SAS data has been exchanged and should be displayed to the user.\n *\n * The payload is the {@link ShowSasCallbacks} object.\n */\n ShowSas = \"show_sas\",\n\n /**\n * The user should confirm if the other side has scanned our QR code.\n *\n * The payload is the {@link ShowQrCodeCallbacks} object.\n */\n ShowReciprocateQr = \"show_reciprocate_qr\",\n}\n\n/** Listener type map for {@link VerifierEvent}s. */\nexport type VerifierEventHandlerMap = {\n [VerifierEvent.Cancel]: (e: Error | MatrixEvent) => void;\n [VerifierEvent.ShowSas]: (sas: ShowSasCallbacks) => void;\n [VerifierEvent.ShowReciprocateQr]: (qr: ShowQrCodeCallbacks) => void;\n};\n\n/**\n * Callbacks for user actions to confirm that the other side has scanned our QR code.\n *\n * This is exposed as the payload of a `VerifierEvent.ShowReciprocateQr` event, or can be retrieved directly from the\n * verifier as `reciprocateQREvent`.\n */\nexport interface ShowQrCodeCallbacks {\n /** The user confirms that the verification data matches */\n confirm(): void;\n\n /** Cancel the verification flow */\n cancel(): void;\n}\n\n/**\n * Callbacks for user actions while a SAS is displayed.\n *\n * This is exposed as the payload of a `VerifierEvent.ShowSas` event, or directly from the verifier as `sasEvent`.\n */\nexport interface ShowSasCallbacks {\n /** The generated SAS to be shown to the user */\n sas: GeneratedSas;\n\n /** Function to call if the user confirms that the SAS matches.\n *\n * @returns A Promise that completes once the m.key.verification.mac is queued.\n */\n confirm(): Promise<void>;\n\n /**\n * Function to call if the user finds the SAS does not match.\n *\n * Sends an `m.key.verification.cancel` event with a `m.mismatched_sas` error code.\n */\n mismatch(): void;\n\n /** Cancel the verification flow */\n cancel(): void;\n}\n\n/** A generated SAS to be shown to the user, in alternative formats */\nexport interface GeneratedSas {\n /**\n * The SAS as three numbers between 0 and 8191.\n *\n * Only populated if the `decimal` SAS method was negotiated.\n */\n decimal?: [number, number, number];\n\n /**\n * The SAS as seven emojis.\n *\n * Only populated if the `emoji` SAS method was negotiated.\n */\n emoji?: EmojiMapping[];\n}\n\n/**\n * An emoji for the generated SAS. A tuple `[emoji, name]` where `emoji` is the emoji itself and `name` is the\n * English name.\n */\nexport type EmojiMapping = [emoji: string, name: string];\n\n/**\n * True if the request is in a state where it can be accepted (ie, that we're in phases {@link VerificationPhase.Unsent}\n * or {@link VerificationPhase.Requested}, and that we're not in the process of sending a `ready` or `cancel`).\n */\nexport function canAcceptVerificationRequest(req: VerificationRequest): boolean {\n return req.phase < VerificationPhase.Ready && !req.accepting && !req.declining;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAKA;AACA;AACA;;AAuKA;AACA,WAAY,wBAAwB,0BAAxB,wBAAwB;EAChC;AACJ;AACA;AACA;AACA;EALY,wBAAwB;EAAA,OAAxB,wBAAwB;AAAA;;AASpC;AACA;AACA;AACA;AACA;;AAKA;AACA,WAAY,iBAAiB,0BAAjB,iBAAiB;EACzB;EADQ,iBAAiB,CAAjB,iBAAiB;EAIzB;EAJQ,iBAAiB,CAAjB,iBAAiB;EAOzB;EAPQ,iBAAiB,CAAjB,iBAAiB;EAUzB;AACJ;AACA;AACA;AACA;AACA;EAfY,iBAAiB,CAAjB,iBAAiB;EAkBzB;AACJ;AACA;AACA;EArBY,iBAAiB,CAAjB,iBAAiB;EAwBzB;AACJ;AACA;AACA;AACA;EA5BY,iBAAiB,CAAjB,iBAAiB;EAAA,OAAjB,iBAAiB;AAAA;;AAgC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAkDA;AACA,WAAY,aAAa,0BAAb,aAAa;EACrB;AACJ;AACA;AACA;AACA;AACA;EANY,aAAa;EASrB;AACJ;AACA;AACA;AACA;EAbY,aAAa;EAgBrB;AACJ;AACA;AACA;AACA;EApBY,aAAa;EAAA,OAAb,aAAa;AAAA;;AAwBzB;;AAOA;AACA;AACA;AACA;AACA;AACA;;AASA;AACA;AACA;AACA;AACA;;AAsBA;;AAiBA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA,OAAO,SAAS,4BAA4B,CAAC,GAAwB,EAAW;EAC5E,OAAO,GAAG,CAAC,KAAK,GAAG,iBAAiB,CAAC,KAAK,IAAI,CAAC,GAAG,CAAC,SAAS,IAAI,CAAC,GAAG,CAAC,SAAS;AAClF","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"embedded.d.ts","sourceRoot":"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3B,uBAAuB,GACvB,kBAAkB;CAK/B;AAED;;GAEG;AACH,qBAAa,oCAAqC,SAAQ,KAAK;IAGhD,cAAc,EAAE,iBAAiB,GAAG,sBAAsB;gBADjE,OAAO,EAAE,MAAM,EACR,cAAc,EAAE,iBAAiB,GAAG,sBAAsB;CAKxE"}
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAgBA,oBAAY,uBAAuB;IAC/B,MAAM,YAAY;CACrB;AAED,qBAAa,uBAAwB,SAAQ,KAAK;aAGX,MAAM,EAAE,uBAAuB;IAFlE,OAAc,OAAO,0BAAkC;IAEvD,YAAmC,MAAM,EAAE,uBAAuB,EAMjE;CACJ;AAED,qBAAa,uBAAwB,SAAQ,KAAK;aAG1B,KAAK,EAAE,GAAG;IAF9B,YACI,OAAO,EAAE,MAAM,EACC,KAAK,EAAE,GAAG,EAG7B;CACJ;AAED;;;;;;;GAOG;AACH,qBAAa,kBAAmB,SAAQ,KAAK;IACzC,cAEC;CACJ;AAED;;GAEG;AACH,qBAAa,qCAAsC,SAAQ,KAAK;IAGjD,cAAc,EACf,kBAAkB,GAClB,oBAAoB,GACpB,6BAA6B,GAC7B,8BAA8B,GAC9B,2BAA2B,GAC3B,uBAAuB,GACvB,kBAAkB;IAT5B,YACI,OAAO,EAAE,MAAM,EACR,cAAc,EACf,kBAAkB,GAClB,oBAAoB,GACpB,6BAA6B,GAC7B,8BAA8B,GAC9B,2BAA2B,GAC3B,uBAAuB,GACvB,kBAAkB,EAI3B;CACJ;AAED;;GAEG;AACH,qBAAa,oCAAqC,SAAQ,KAAK;IAGhD,cAAc,EAAE,iBAAiB,GAAG,sBAAsB;IAFrE,YACI,OAAO,EAAE,MAAM,EACR,cAAc,EAAE,iBAAiB,GAAG,sBAAsB,EAIpE;CACJ"}
@@ -1 +1 @@
1
- {"version":3,"file":"ExtensibleEvent.d.ts","sourceRoot":"","sources":["../../src/extensible_events_v1/ExtensibleEvent.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,KAAK,mBAAmB,EAAE,KAAK,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAE9F;;GAEG;AACH,8BAAsB,eAAe,CAAC,QAAQ,SAAS,MAAM,GAAG,MAAM;aAC5B,UAAU,EAAE,aAAa,CAAC,QAAQ,CAAC;IAAzE,SAAS,aAA6B,UAAU,EAAE,aAAa,CAAC,QAAQ,CAAC;IAEzE;;OAEG;IACH,IAAW,WAAW,IAAI,QAAQ,CAEjC;IAED;;;;OAIG;aACa,SAAS,IAAI,aAAa,CAAC,MAAM,CAAC;IAElD;;;;;;;;;;;;;;;;;OAiBG;aACa,cAAc,CAAC,gBAAgB,EAAE,mBAAmB,GAAG,OAAO;CACjF"}
1
+ {"version":3,"file":"ExtensibleEvent.d.ts","sourceRoot":"","sources":["../../src/extensible_events_v1/ExtensibleEvent.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,KAAK,mBAAmB,EAAE,KAAK,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAE9F;;GAEG;AACH,8BAAsB,eAAe,CAAC,QAAQ,SAAS,MAAM,GAAG,MAAM;aAC5B,UAAU,EAAE,aAAa,CAAC,QAAQ,CAAC;IAAzE,SAAS,aAA6B,UAAU,EAAE,aAAa,CAAC,QAAQ,CAAC,EAAI;IAE7E;;OAEG;IACH,IAAW,WAAW,IAAI,QAAQ,CAEjC;IAED;;;;OAIG;IACH,SAAgB,SAAS,IAAI,aAAa,CAAC,MAAM,CAAC,CAAC;IAEnD;;;;;;;;;;;;;;;;;OAiBG;IACH,SAAgB,cAAc,CAAC,gBAAgB,EAAE,mBAAmB,GAAG,OAAO,CAAC;CAClF"}
@@ -1 +1 @@
1
- {"version":3,"file":"InvalidEventError.d.ts","sourceRoot":"","sources":["../../src/extensible_events_v1/InvalidEventError.ts"],"names":[],"mappings":"AAgBA;;GAEG;AACH,qBAAa,iBAAkB,SAAQ,KAAK;gBACrB,OAAO,EAAE,MAAM;CAGrC"}
1
+ {"version":3,"file":"InvalidEventError.d.ts","sourceRoot":"","sources":["../../src/extensible_events_v1/InvalidEventError.ts"],"names":[],"mappings":"AAgBA;;GAEG;AACH,qBAAa,iBAAkB,SAAQ,KAAK;IACxC,YAAmB,OAAO,EAAE,MAAM,EAEjC;CACJ"}
@@ -1 +1 @@
1
- {"version":3,"file":"MessageEvent.d.ts","sourceRoot":"","sources":["../../src/extensible_events_v1/MessageEvent.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EACH,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAIlB,KAAK,gCAAgC,EAExC,MAAM,gCAAgC,CAAC;AAIxC;;;;;;GAMG;AACH,qBAAa,YAAa,SAAQ,eAAe,CAAC,gCAAgC,CAAC;IAC/E;;OAEG;IACH,SAAgB,IAAI,EAAE,MAAM,CAAC;IAE7B;;OAEG;IACH,SAAgB,IAAI,CAAC,EAAE,MAAM,CAAC;IAE9B;;;;;OAKG;IACH,SAAgB,UAAU,EAAE,iBAAiB,EAAE,CAAC;IAEhD;;;;;OAKG;gBACgB,UAAU,EAAE,aAAa,CAAC,gCAAgC,CAAC;IA8BvE,cAAc,CAAC,gBAAgB,EAAE,mBAAmB,GAAG,OAAO;IAIrE,SAAS,CAAC,qBAAqB,IAAI,gCAAgC;IAkB5D,SAAS,IAAI,aAAa,CAAC,MAAM,CAAC;IAazC;;;;;OAKG;WACW,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,YAAY;CAShE"}
1
+ {"version":3,"file":"MessageEvent.d.ts","sourceRoot":"","sources":["../../src/extensible_events_v1/MessageEvent.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EACH,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAIlB,KAAK,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,mBAAmB,GAAG,OAAO;IAI9D,SAAS,IAAI,aAAa,CAAC,MAAM,CAAC;IAczC;;;;;OAKG;WACW,IAAI,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,YAAY;CAazE"}
1
+ {"version":3,"file":"PollEndEvent.d.ts","sourceRoot":"","sources":["../../src/extensible_events_v1/PollEndEvent.ts"],"names":[],"mappings":"AAgBA,OAAO,EACH,KAAK,mBAAmB,EACxB,KAAK,aAAa,EAIrB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAc,KAAK,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAC1E,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD;;GAEG;AACH,qBAAa,YAAa,SAAQ,eAAe,CAAC,mBAAmB,CAAC;IAClE;;OAEG;IACH,SAAgB,WAAW,EAAE,MAAM,CAAC;IAEpC;;OAEG;IACH,SAAgB,cAAc,EAAE,YAAY,CAAC;IAE7C;;;;OAIG;IACH,YAAmB,UAAU,EAAE,aAAa,CAAC,mBAAmB,CAAC,EAUhE;IAEM,cAAc,CAAC,gBAAgB,EAAE,mBAAmB,GAAG,OAAO,CAEpE;IAEM,SAAS,IAAI,aAAa,CAAC,MAAM,CAAC,CAYxC;IAED;;;;;OAKG;IACH,OAAc,IAAI,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,YAAY,CAYrE;CACJ"}
@@ -1 +1 @@
1
- {"version":3,"file":"PollResponseEvent.d.ts","sourceRoot":"","sources":["../../src/extensible_events_v1/PollResponseEvent.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAmB,KAAK,wBAAwB,EAA4B,MAAM,oBAAoB,CAAC;AAC9G,OAAO,EACH,KAAK,mBAAmB,EACxB,KAAK,aAAa,EAGrB,MA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AK,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAS7E;AAED;;;;;GAKG;AACH,qBAAa,eAAgB,SAAQ,KAAK;IACtC,YAAmB,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,KAAK,EAEhD;IAED,IAAW,IAAI,IAAI,MAAM,CAExB;CACJ;AAED;;;;GAIG;AACH,qBAAa,iBAAkB,SAAQ,KAAK;IACxC,YAAmB,KAAK,CAAC,EAAE,KAAK,EAE/B;IAED,IAAW,IAAI,IAAI,MAAM,CAExB;CACJ;AAED;;;GAGG;AACH,qBAAa,uBAAwB,SAAQ,KAAK;IAC9C,YAAmB,KAAK,CAAC,EAAE,KAAK,EAE/B;IAED,IAAW,IAAI,IAAI,MAAM,CAExB;CACJ;AAED,eAAO,MAAM,qBAAqB,sDAAyD,CAAC;AAE5F;;;;GAIG;AACH,qBAAa,iBAAkB,SAAQ,WAAW;IAC9C;;;OAGG;IACH,SAAgB,KAAK,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACnC;;OAEG;IACH,SAAgB,MAAM,CAAC,EAAE,IAAI,CAAC;IAC9B,YAAmB,GAAG,KAAK,EAAE,qBAAqB,CAAC,OAAO,WAAW,CAAC,EASrE;CACJ"}
@@ -52,7 +52,7 @@ export declare class FetchHttpApi<O extends IHttpOpts> {
52
52
  * @returns The parsed response.
53
53
  * @throws Error if a problem occurred. This includes network problems and Matrix-specific error JSON.
54
54
  */
55
- request<T>(method: Method, path: string, queryParams?: QueryDict, body?: Body, opts?: IRequestOpts): Promise<T>;
55
+ request<T = unknown>(method: Method, path: string, queryParams?: QueryDict, body?: Body, opts?: IRequestOpts): Promise<T>;
56
56
  /**
57
57
  * Perform a request to an arbitrary URL.
58
58
  * @param method - The HTTP method e.g. "GET".
@@ -1 +1 @@
1
- {"version":3,"file":"fetch.d.ts","sourceRoot":"","sources":["../../src/http-api/fetch.ts"],"names":[],"mappings":"AAqBA,OAAO,EAAE,KAAK,iBAAiB,E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eAAoB,GAC3B,OAAO,CAAC,CAAC,CAAC,CA4FZ;IAED,OAAO,CAAC,kBAAkB;IAsB1B;;;;;;;OAOG;IACI,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,SAAS,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,GAAG,CAa3F;CACJ"}
@@ -1 +1 @@
1
- {"version":3,"file":"fetch.js","names":[],"sources":["../../src/http-api/fetch.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\n/**\n * This is an internal module. See {@link MatrixHttpApi} for the public class.\n */\n\nimport { checkObjectHasKeys, deepCopy, encodeParams } from \"../utils.ts\";\nimport { type TypedEventEmitter } from \"../models/typed-event-emitter.ts\";\nimport { Method } from \"./method.ts\";\nimport { ConnectionError, MatrixError, TokenRefreshError } from \"./errors.ts\";\nimport {\n type BaseRequestOpts,\n HttpApiEvent,\n type HttpApiEventHandlerMap,\n type IHttpOpts,\n type IRequestOpts,\n type Body,\n} from \"./interface.ts\";\nimport { anySignal, parseErrorResponse, timeoutSignal } from \"./utils.ts\";\nimport { type QueryDict } from \"../utils.ts\";\nimport { TokenRefresher, TokenRefreshOutcome } from \"./refresh.ts\";\n\nexport class FetchHttpApi<O extends IHttpOpts> {\n private abortController = new AbortController();\n private readonly tokenRefresher: TokenRefresher;\n\n public constructor(\n private eventEmitter: TypedEventEmitter<HttpApiEvent, HttpApiEventHandlerMap>,\n public readonly opts: O,\n ) {\n checkObjectHasKeys(opts, [\"baseUrl\", \"prefix\"]);\n if (!opts.onlyData) {\n throw new Error(\"Constructing FetchHttpApi without `onlyData=true` is no longer supported.\");\n }\n opts.useAuthorizationHeader = opts.useAuthorizationHeader ?? true;\n\n this.tokenRefresher = new TokenRefresher(opts);\n }\n\n public abort(): void {\n this.abortController.abort();\n this.abortController = new AbortController();\n }\n\n public fetch(resource: URL | string, options?: RequestInit): ReturnType<typeof globalThis.fetch> {\n if (this.opts.fetchFn) {\n return this.opts.fetchFn(resource, options);\n }\n return globalThis.fetch(resource, options);\n }\n\n /**\n * Sets the base URL for the identity server\n * @param url - The new base url\n */\n public setIdBaseUrl(url?: string): void {\n this.opts.idBaseUrl = url;\n }\n\n public idServerRequest<T extends object = Record<string, unknown>>(\n method: Method,\n path: string,\n params: Record<string, string | string[]> | undefined,\n prefix: string,\n accessToken?: string,\n ): Promise<T> {\n if (!this.opts.idBaseUrl) {\n throw new Error(\"No identity server base URL set\");\n }\n\n let queryParams: QueryDict | undefined = undefined;\n let body: Record<string, string | string[]> | undefined = undefined;\n if (method === Method.Get) {\n queryParams = params;\n } else {\n body = params;\n }\n\n const fullUri = this.getUrl(path, queryParams, prefix, this.opts.idBaseUrl);\n\n const opts: IRequestOpts = {\n json: true,\n headers: {},\n };\n if (accessToken) {\n opts.headers!.Authorization = `Bearer ${accessToken}`;\n }\n\n return this.requestOtherUrl(method, fullUri, body, opts);\n }\n\n /**\n * Perform an authorised request to the homeserver.\n * @param method - The HTTP method e.g. \"GET\".\n * @param path - The HTTP path <b>after</b> the supplied prefix e.g.\n * \"/createRoom\".\n *\n * @param queryParams - A dict of query params (these will NOT be\n * urlencoded). If unspecified, there will be no query params.\n *\n * @param body - The HTTP JSON body.\n *\n * @param paramOpts - additional options.\n * When `paramOpts.doNotAttemptTokenRefresh` is true, token refresh will not be attempted\n * when an expired token is encountered. Used to only attempt token refresh once.\n *\n * @returns The parsed response.\n * @throws Error if a problem occurred. This includes network problems and Matrix-specific error JSON.\n */\n public authedRequest<T>(\n method: Method,\n path: string,\n queryParams: QueryDict = {},\n body?: Body,\n paramOpts: IRequestOpts = {},\n ): Promise<T> {\n return this.doAuthedRequest<T>(1, method, path, queryParams, body, paramOpts);\n }\n\n // Wrapper around public method authedRequest to allow for tracking retry attempt counts\n private async doAuthedRequest<T>(\n attempt: number,\n method: Method,\n path: string,\n queryParams: QueryDict,\n body?: Body,\n paramOpts: IRequestOpts = {},\n ): Promise<T> {\n // avoid mutating paramOpts so they can be used on retry\n const opts = deepCopy(paramOpts);\n // we have to manually copy the abortSignal over as it is not a plain object\n opts.abortSignal = paramOpts.abortSignal;\n\n // Take a snapshot of the current token state before we start the request so we can reference it if we error\n const requestSnapshot = await this.tokenRefresher.prepareForRequest();\n if (requestSnapshot.accessToken) {\n if (this.opts.useAuthorizationHeader) {\n if (!opts.headers) {\n opts.headers = {};\n }\n if (!opts.headers.Authorization) {\n opts.headers.Authorization = `Bearer ${requestSnapshot.accessToken}`;\n }\n if (queryParams.access_token) {\n delete queryParams.access_token;\n }\n } else if (!queryParams.access_token) {\n queryParams.access_token = requestSnapshot.accessToken;\n }\n }\n\n try {\n const response = await this.request<T>(method, path, queryParams, body, opts);\n return response;\n } catch (error) {\n if (!(error instanceof MatrixError)) {\n throw error;\n }\n\n if (error.errcode === \"M_UNKNOWN_TOKEN\") {\n const outcome = await this.tokenRefresher.handleUnknownToken(requestSnapshot, attempt);\n if (outcome === TokenRefreshOutcome.Success) {\n // if we got a new token retry the request\n return this.doAuthedRequest(attempt + 1, method, path, queryParams, body, paramOpts);\n }\n if (outcome === TokenRefreshOutcome.Failure) {\n throw new TokenRefreshError(error);\n }\n\n if (!opts?.inhibitLogoutEmit) {\n this.eventEmitter.emit(HttpApiEvent.SessionLoggedOut, error);\n }\n } else if (error.errcode == \"M_CONSENT_NOT_GIVEN\") {\n this.eventEmitter.emit(HttpApiEvent.NoConsent, error.message, error.data.consent_uri);\n }\n\n throw error;\n }\n }\n\n /**\n * Perform a request to the homeserver without any credentials.\n * @param method - The HTTP method e.g. \"GET\".\n * @param path - The HTTP path <b>after</b> the supplied prefix e.g.\n * \"/createRoom\".\n *\n * @param queryParams - A dict of query params (these will NOT be\n * urlencoded). If unspecified, there will be no query params.\n *\n * @param body - The HTTP JSON body.\n *\n * @param opts - additional options\n *\n * @returns The parsed response.\n * @throws Error if a problem occurred. This includes network problems and Matrix-specific error JSON.\n */\n public request<T>(\n method: Method,\n path: string,\n queryParams?: QueryDict,\n body?: Body,\n opts?: IRequestOpts,\n ): Promise<T> {\n const fullUri = this.getUrl(path, queryParams, opts?.prefix, opts?.baseUrl);\n return this.requestOtherUrl<T>(method, fullUri, body, opts);\n }\n\n /**\n * Perform a request to an arbitrary URL.\n * @param method - The HTTP method e.g. \"GET\".\n * @param url - The HTTP URL object.\n *\n * @param body - The HTTP JSON body.\n *\n * @param opts - additional options\n *\n * @returns The parsed response.\n * @throws Error if a problem occurred. This includes network problems and Matrix-specific error JSON.\n */\n public async requestOtherUrl<T>(\n method: Method,\n url: URL | string,\n body?: Body,\n opts: BaseRequestOpts = {},\n ): Promise<T> {\n if (opts.json !== undefined && opts.rawResponseBody !== undefined) {\n throw new Error(\"Invalid call to `FetchHttpApi` sets both `opts.json` and `opts.rawResponseBody`\");\n }\n\n const urlForLogs = this.sanitizeUrlForLogs(url);\n\n this.opts.logger?.debug(`FetchHttpApi: --> ${method} ${urlForLogs}`);\n\n const headers = Object.assign({}, opts.headers || {});\n\n const jsonResponse = !opts.rawResponseBody && opts.json !== false;\n if (jsonResponse) {\n if (!headers[\"Accept\"]) {\n headers[\"Accept\"] = \"application/json\";\n }\n }\n\n const timeout = opts.localTimeoutMs ?? this.opts.localTimeoutMs;\n const keepAlive = opts.keepAlive ?? false;\n const signals = [this.abortController.signal];\n if (timeout !== undefined) {\n signals.push(timeoutSignal(timeout));\n }\n if (opts.abortSignal) {\n signals.push(opts.abortSignal);\n }\n\n // If the body is an object, encode it as JSON and set the `Content-Type` header,\n // unless that has been explicitly inhibited by setting `opts.json: false`.\n // We can't use getPrototypeOf here as objects made in other contexts e.g. over postMessage won't have same ref\n let data: BodyInit;\n if (opts.json !== false && body?.constructor?.name === Object.name) {\n data = JSON.stringify(body);\n if (!headers[\"Content-Type\"]) {\n headers[\"Content-Type\"] = \"application/json\";\n }\n } else {\n data = body as BodyInit;\n }\n\n const { signal, cleanup } = anySignal(signals);\n\n // Set cache mode based on presence of Authorization header.\n // Browsers/proxies do not cache responses to requests with Authorization headers.\n // So specifying \"no-cache\" is redundant, and actually prevents caching\n // of preflight requests in CORS scenarios. As such, we only set \"no-cache\"\n // when there is no Authorization header.\n const cacheMode = \"Authorization\" in headers ? undefined : \"no-cache\";\n\n let res: Response;\n const start = Date.now();\n try {\n res = await this.fetch(url, {\n signal,\n method,\n body: data,\n headers,\n mode: \"cors\",\n redirect: \"follow\",\n referrer: \"\",\n referrerPolicy: \"no-referrer\",\n cache: cacheMode,\n credentials: \"omit\", // we send credentials via headers\n keepalive: keepAlive,\n priority: opts.priority,\n });\n\n this.opts.logger?.debug(\n `FetchHttpApi: <-- ${method} ${urlForLogs} [${Date.now() - start}ms ${res.status}]`,\n );\n } catch (e) {\n this.opts.logger?.debug(`FetchHttpApi: <-- ${method} ${urlForLogs} [${Date.now() - start}ms ${e}]`);\n if ((<Error>e).name === \"AbortError\") {\n throw e;\n }\n throw new ConnectionError(\"fetch failed\", <Error>e);\n } finally {\n cleanup();\n }\n\n if (!res.ok) {\n throw parseErrorResponse(res, await res.text());\n }\n\n if (opts.rawResponseBody) {\n return (await res.blob()) as T;\n } else if (jsonResponse) {\n return await res.json();\n } else {\n return (await res.text()) as T;\n }\n }\n\n private sanitizeUrlForLogs(url: URL | string): string {\n try {\n let asUrl: URL;\n if (typeof url === \"string\") {\n asUrl = new URL(url);\n } else {\n asUrl = url;\n }\n // Remove the values of any URL params that could contain potential secrets\n const sanitizedQs = new URLSearchParams();\n for (const key of asUrl.searchParams.keys()) {\n sanitizedQs.append(key, \"xxx\");\n }\n const sanitizedQsString = sanitizedQs.toString();\n const sanitizedQsUrlPiece = sanitizedQsString ? `?${sanitizedQsString}` : \"\";\n\n return asUrl.origin + asUrl.pathname + sanitizedQsUrlPiece;\n } catch {\n // defensive coding for malformed url\n return \"??\";\n }\n }\n /**\n * Form and return a homeserver request URL based on the given path params and prefix.\n * @param path - The HTTP path <b>after</b> the supplied prefix e.g. \"/createRoom\".\n * @param queryParams - A dict of query params (these will NOT be urlencoded).\n * @param prefix - The full prefix to use e.g. \"/_matrix/client/v2_alpha\", defaulting to this.opts.prefix.\n * @param baseUrl - The baseUrl to use e.g. \"https://matrix.org\", defaulting to this.opts.baseUrl.\n * @returns URL\n */\n public getUrl(path: string, queryParams?: QueryDict, prefix?: string, baseUrl?: string): URL {\n const baseUrlWithFallback = baseUrl ?? this.opts.baseUrl;\n const baseUrlWithoutTrailingSlash = baseUrlWithFallback.endsWith(\"/\")\n ? baseUrlWithFallback.slice(0, -1)\n : baseUrlWithFallback;\n const url = new URL(baseUrlWithoutTrailingSlash + (prefix ?? this.opts.prefix) + path);\n // If there are any params, encode and append them to the URL.\n if (this.opts.extraParams || queryParams) {\n const mergedParams = { ...this.opts.extraParams, ...queryParams };\n encodeParams(mergedParams, url.searchParams);\n }\n\n return url;\n }\n}\n"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,SAAS,kBAAkB,EAAE,QAAQ,EAAE,YAAY,QAAQ,aAAa;AAExE,SAAS,MAAM,QAAQ,aAAa;AACpC,SAAS,eAAe,EAAE,WAAW,EAAE,iBAAiB,QAAQ,aAAa;AAC7E,SAEI,YAAY,QAKT,gBAAgB;AACvB,SAAS,SAAS,EAAE,kBAAkB,EAAE,aAAa,QAAQ,YAAY;AAEzE,SAAS,cAAc,EAAE,mBAAmB,QAAQ,cAAc;AAElE,OAAO,MAAM,YAAY,CAAsB;EAIpC,WAAW,CACN,YAAqE,EAC7D,IAAO,EACzB;IAAA,yCANwB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AC;MACzC,KAAK,MAAM,GAAG,IAAI,KAAK,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,EAAE;QACzC,WAAW,CAAC,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC;MAClC;MACA,MAAM,iBAAiB,GAAG,WAAW,CAAC,QAAQ,CAAC,CAAC;MAChD,MAAM,mBAAmB,GAAG,iBAAiB,GAAG,IAAI,iBAAiB,EAAE,GAAG,EAAE;MAE5E,OAAO,KAAK,CAAC,MAAM,GAAG,KAAK,CAAC,QAAQ,GAAG,mBAAmB;IAC9D,CAAC,CAAC,MAAM;MACJ;MACA,OAAO,IAAI;IACf;EACJ;EACA;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;EACW,MAAM,CAAC,IAAY,EAAE,WAAuB,EAAE,MAAe,EAAE,OAAgB,EAAO;IACzF,MAAM,mBAAmB,GAAG,OAAO,IAAI,IAAI,CAAC,IAAI,CAAC,OAAO;IACxD,MAAM,2BAA2B,GAAG,mBAAmB,CAAC,QAAQ,CAAC,GAAG,CAAC,GAC/D,mBAAmB,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAChC,mBAAmB;IACzB,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,2BAA2B,IAAI,MAAM,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;IACtF;IACA,IAAI,IAAI,CAAC,IAAI,CAAC,WAAW,IAAI,WAAW,EAAE;MACtC,MAAM,YAAY,mCAAQ,IAAI,CAAC,IAAI,CAAC,WAAW,GAAK,WAAW,CAAE;MACjE,YAAY,CAAC,YAAY,EAAE,GAAG,CAAC,YAAY,CAAC;IAChD;IAEA,OAAO,GAAG;EACd;AACJ","ignoreList":[]}
1
+ {"version":3,"file":"fetch.js","names":[],"sources":["../../src/http-api/fetch.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\n/**\n * This is an internal module. See {@link MatrixHttpApi} for the public class.\n */\n\nimport { checkObjectHasKeys, deepCopy, encodeParams } from \"../utils.ts\";\nimport { type TypedEventEmitter } from \"../models/typed-event-emitter.ts\";\nimport { Method } from \"./method.ts\";\nimport { ConnectionError, MatrixError, TokenRefreshError } from \"./errors.ts\";\nimport {\n type BaseRequestOpts,\n HttpApiEvent,\n type HttpApiEventHandlerMap,\n type IHttpOpts,\n type IRequestOpts,\n type Body,\n} from \"./interface.ts\";\nimport { anySignal, parseErrorResponse, timeoutSignal } from \"./utils.ts\";\nimport { type QueryDict } from \"../utils.ts\";\nimport { TokenRefresher, TokenRefreshOutcome } from \"./refresh.ts\";\n\nexport class FetchHttpApi<O extends IHttpOpts> {\n private abortController = new AbortController();\n private readonly tokenRefresher: TokenRefresher;\n\n public constructor(\n private eventEmitter: TypedEventEmitter<HttpApiEvent, HttpApiEventHandlerMap>,\n public readonly opts: O,\n ) {\n checkObjectHasKeys(opts, [\"baseUrl\", \"prefix\"]);\n if (!opts.onlyData) {\n throw new Error(\"Constructing FetchHttpApi without `onlyData=true` is no longer supported.\");\n }\n opts.useAuthorizationHeader = opts.useAuthorizationHeader ?? true;\n\n this.tokenRefresher = new TokenRefresher(opts);\n }\n\n public abort(): void {\n this.abortController.abort();\n this.abortController = new AbortController();\n }\n\n public fetch(resource: URL | string, options?: RequestInit): ReturnType<typeof globalThis.fetch> {\n if (this.opts.fetchFn) {\n return this.opts.fetchFn(resource, options);\n }\n return globalThis.fetch(resource, options);\n }\n\n /**\n * Sets the base URL for the identity server\n * @param url - The new base url\n */\n public setIdBaseUrl(url?: string): void {\n this.opts.idBaseUrl = url;\n }\n\n public idServerRequest<T extends object = Record<string, unknown>>(\n method: Method,\n path: string,\n params: Record<string, string | string[]> | undefined,\n prefix: string,\n accessToken?: string,\n ): Promise<T> {\n if (!this.opts.idBaseUrl) {\n throw new Error(\"No identity server base URL set\");\n }\n\n let queryParams: QueryDict | undefined = undefined;\n let body: Record<string, string | string[]> | undefined = undefined;\n if (method === Method.Get) {\n queryParams = params;\n } else {\n body = params;\n }\n\n const fullUri = this.getUrl(path, queryParams, prefix, this.opts.idBaseUrl);\n\n const opts: IRequestOpts = {\n json: true,\n headers: {},\n };\n if (accessToken) {\n opts.headers!.Authorization = `Bearer ${accessToken}`;\n }\n\n return this.requestOtherUrl(method, fullUri, body, opts);\n }\n\n /**\n * Perform an authorised request to the homeserver.\n * @param method - The HTTP method e.g. \"GET\".\n * @param path - The HTTP path <b>after</b> the supplied prefix e.g.\n * \"/createRoom\".\n *\n * @param queryParams - A dict of query params (these will NOT be\n * urlencoded). If unspecified, there will be no query params.\n *\n * @param body - The HTTP JSON body.\n *\n * @param paramOpts - additional options.\n * When `paramOpts.doNotAttemptTokenRefresh` is true, token refresh will not be attempted\n * when an expired token is encountered. Used to only attempt token refresh once.\n *\n * @returns The parsed response.\n * @throws Error if a problem occurred. This includes network problems and Matrix-specific error JSON.\n */\n public authedRequest<T>(\n method: Method,\n path: string,\n queryParams: QueryDict = {},\n body?: Body,\n paramOpts: IRequestOpts = {},\n ): Promise<T> {\n return this.doAuthedRequest<T>(1, method, path, queryParams, body, paramOpts);\n }\n\n // Wrapper around public method authedRequest to allow for tracking retry attempt counts\n private async doAuthedRequest<T>(\n attempt: number,\n method: Method,\n path: string,\n queryParams: QueryDict,\n body?: Body,\n paramOpts: IRequestOpts = {},\n ): Promise<T> {\n // avoid mutating paramOpts so they can be used on retry\n const opts = deepCopy(paramOpts);\n // we have to manually copy the abortSignal over as it is not a plain object\n opts.abortSignal = paramOpts.abortSignal;\n\n // Take a snapshot of the current token state before we start the request so we can reference it if we error\n const requestSnapshot = await this.tokenRefresher.prepareForRequest();\n if (requestSnapshot.accessToken) {\n if (this.opts.useAuthorizationHeader) {\n if (!opts.headers) {\n opts.headers = {};\n }\n if (!opts.headers.Authorization) {\n opts.headers.Authorization = `Bearer ${requestSnapshot.accessToken}`;\n }\n if (queryParams.access_token) {\n delete queryParams.access_token;\n }\n } else if (!queryParams.access_token) {\n queryParams.access_token = requestSnapshot.accessToken;\n }\n }\n\n try {\n const response = await this.request<T>(method, path, queryParams, body, opts);\n return response;\n } catch (error) {\n if (!(error instanceof MatrixError)) {\n throw error;\n }\n\n if (error.errcode === \"M_UNKNOWN_TOKEN\") {\n const outcome = await this.tokenRefresher.handleUnknownToken(requestSnapshot, attempt);\n if (outcome === TokenRefreshOutcome.Success) {\n // if we got a new token retry the request\n return this.doAuthedRequest(attempt + 1, method, path, queryParams, body, paramOpts);\n }\n if (outcome === TokenRefreshOutcome.Failure) {\n throw new TokenRefreshError(error);\n }\n\n if (!opts?.inhibitLogoutEmit) {\n this.eventEmitter.emit(HttpApiEvent.SessionLoggedOut, error);\n }\n } else if (error.errcode == \"M_CONSENT_NOT_GIVEN\") {\n this.eventEmitter.emit(HttpApiEvent.NoConsent, error.message, error.data.consent_uri);\n }\n\n throw error;\n }\n }\n\n /**\n * Perform a request to the homeserver without any credentials.\n * @param method - The HTTP method e.g. \"GET\".\n * @param path - The HTTP path <b>after</b> the supplied prefix e.g.\n * \"/createRoom\".\n *\n * @param queryParams - A dict of query params (these will NOT be\n * urlencoded). If unspecified, there will be no query params.\n *\n * @param body - The HTTP JSON body.\n *\n * @param opts - additional options\n *\n * @returns The parsed response.\n * @throws Error if a problem occurred. This includes network problems and Matrix-specific error JSON.\n */\n public request<T = unknown>(\n method: Method,\n path: string,\n queryParams?: QueryDict,\n body?: Body,\n opts?: IRequestOpts,\n ): Promise<T> {\n const fullUri = this.getUrl(path, queryParams, opts?.prefix, opts?.baseUrl);\n return this.requestOtherUrl<T>(method, fullUri, body, opts);\n }\n\n /**\n * Perform a request to an arbitrary URL.\n * @param method - The HTTP method e.g. \"GET\".\n * @param url - The HTTP URL object.\n *\n * @param body - The HTTP JSON body.\n *\n * @param opts - additional options\n *\n * @returns The parsed response.\n * @throws Error if a problem occurred. This includes network problems and Matrix-specific error JSON.\n */\n public async requestOtherUrl<T>(\n method: Method,\n url: URL | string,\n body?: Body,\n opts: BaseRequestOpts = {},\n ): Promise<T> {\n if (opts.json !== undefined && opts.rawResponseBody !== undefined) {\n throw new Error(\"Invalid call to `FetchHttpApi` sets both `opts.json` and `opts.rawResponseBody`\");\n }\n\n const urlForLogs = this.sanitizeUrlForLogs(url);\n\n this.opts.logger?.debug(`FetchHttpApi: --> ${method} ${urlForLogs}`);\n\n const headers = Object.assign({}, opts.headers || {});\n\n const jsonResponse = !opts.rawResponseBody && opts.json !== false;\n if (jsonResponse) {\n if (!headers[\"Accept\"]) {\n headers[\"Accept\"] = \"application/json\";\n }\n }\n\n const timeout = opts.localTimeoutMs ?? this.opts.localTimeoutMs;\n const keepAlive = opts.keepAlive ?? false;\n const signals = [this.abortController.signal];\n if (timeout !== undefined) {\n signals.push(timeoutSignal(timeout));\n }\n if (opts.abortSignal) {\n signals.push(opts.abortSignal);\n }\n\n // If the body is an object, encode it as JSON and set the `Content-Type` header,\n // unless that has been explicitly inhibited by setting `opts.json: false`.\n // We can't use getPrototypeOf here as objects made in other contexts e.g. over postMessage won't have same ref\n let data: BodyInit;\n if (opts.json !== false && body?.constructor?.name === Object.name) {\n data = JSON.stringify(body);\n if (!headers[\"Content-Type\"]) {\n headers[\"Content-Type\"] = \"application/json\";\n }\n } else {\n data = body as BodyInit;\n }\n\n const { signal, cleanup } = anySignal(signals);\n\n // Set cache mode based on presence of Authorization header.\n // Browsers/proxies do not cache responses to requests with Authorization headers.\n // So specifying \"no-cache\" is redundant, and actually prevents caching\n // of preflight requests in CORS scenarios. As such, we only set \"no-cache\"\n // when there is no Authorization header.\n const cacheMode = \"Authorization\" in headers ? undefined : \"no-cache\";\n\n let res: Response;\n const start = Date.now();\n try {\n res = await this.fetch(url, {\n signal,\n method,\n body: data,\n headers,\n mode: \"cors\",\n redirect: \"follow\",\n referrer: \"\",\n referrerPolicy: \"no-referrer\",\n cache: cacheMode,\n credentials: \"omit\", // we send credentials via headers\n keepalive: keepAlive,\n priority: opts.priority,\n });\n\n this.opts.logger?.debug(\n `FetchHttpApi: <-- ${method} ${urlForLogs} [${Date.now() - start}ms ${res.status}]`,\n );\n } catch (e) {\n this.opts.logger?.debug(`FetchHttpApi: <-- ${method} ${urlForLogs} [${Date.now() - start}ms ${e}]`);\n if ((<Error>e).name === \"AbortError\") {\n throw e;\n }\n throw new ConnectionError(\"fetch failed\", <Error>e);\n } finally {\n cleanup();\n }\n\n if (!res.ok) {\n throw parseErrorResponse(res, await res.text());\n }\n\n if (opts.rawResponseBody) {\n return (await res.blob()) as T;\n } else if (jsonResponse) {\n return await res.json();\n } else {\n return (await res.text()) as T;\n }\n }\n\n private sanitizeUrlForLogs(url: URL | string): string {\n try {\n let asUrl: URL;\n if (typeof url === \"string\") {\n asUrl = new URL(url);\n } else {\n asUrl = url;\n }\n // Remove the values of any URL params that could contain potential secrets\n const sanitizedQs = new URLSearchParams();\n for (const key of asUrl.searchParams.keys()) {\n sanitizedQs.append(key, \"xxx\");\n }\n const sanitizedQsString = sanitizedQs.toString();\n const sanitizedQsUrlPiece = sanitizedQsString ? `?${sanitizedQsString}` : \"\";\n\n return asUrl.origin + asUrl.pathname + sanitizedQsUrlPiece;\n } catch {\n // defensive coding for malformed url\n return \"??\";\n }\n }\n /**\n * Form and return a homeserver request URL based on the given path params and prefix.\n * @param path - The HTTP path <b>after</b> the supplied prefix e.g. \"/createRoom\".\n * @param queryParams - A dict of query params (these will NOT be urlencoded).\n * @param prefix - The full prefix to use e.g. \"/_matrix/client/v2_alpha\", defaulting to this.opts.prefix.\n * @param baseUrl - The baseUrl to use e.g. \"https://matrix.org\", defaulting to this.opts.baseUrl.\n * @returns URL\n */\n public getUrl(path: string, queryParams?: QueryDict, prefix?: string, baseUrl?: string): URL {\n const baseUrlWithFallback = baseUrl ?? this.opts.baseUrl;\n const baseUrlWithoutTrailingSlash = baseUrlWithFallback.endsWith(\"/\")\n ? baseUrlWithFallback.slice(0, -1)\n : baseUrlWithFallback;\n const url = new URL(baseUrlWithoutTrailingSlash + (prefix ?? this.opts.prefix) + path);\n // If there are any params, encode and append them to the URL.\n if (this.opts.extraParams || queryParams) {\n const mergedParams = { ...this.opts.extraParams, ...queryParams };\n encodeParams(mergedParams, url.searchParams);\n }\n\n return url;\n }\n}\n"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,SAAS,kBAAkB,EAAE,QAAQ,EAAE,YAAY,QAAQ,aAAa;AAExE,SAAS,MAAM,QAAQ,aAAa;AACpC,SAAS,eAAe,EAAE,WAAW,EAAE,iBAAiB,QAAQ,aAAa;AAC7E,SAEI,YAAY,QAKT,gBAAgB;AACvB,SAAS,SAAS,EAAE,kBAAkB,EAAE,aAAa,QAAQ,YAAY;AAEzE,SAAS,cAAc,EAAE,mBAAmB,QAAQ,cAAc;AAElE,OAAO,MAAM,YAAY,CAAsB;EAIpC,WAAW,CACN,YAAqE,EAC7D,IAAO,EACzB;IAAA,yCANwB,IAAI,eAAe,CAAC,CAAC;IAAA;IAAA,KAInC,YAAqE,GAArE,YAAqE;IAAA,KAC7D,IAAO,GAAP,IAAO;IAEvB,kBAAkB,CAAC,IAAI,EAAE,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;IAC/C,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;MAChB,MAAM,IAAI,KAAK,CAAC,2EAA2E,CAAC;IAChG;IACA,IAAI,CAAC,sBAAsB,GAAG,IAAI,CAAC,sBAAsB,IAAI,IAAI;IAEjE,IAAI,CAAC,cAAc,GAAG,IAAI,cAAc,CAAC,IAAI,CAAC;EAClD;EAEO,KAA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EACA;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;EACW,MAAM,CAAC,IAAY,EAAE,WAAuB,EAAE,MAAe,EAAE,OAAgB,EAAO;IACzF,MAAM,mBAAmB,GAAG,OAAO,IAAI,IAAI,CAAC,IAAI,CAAC,OAAO;IACxD,MAAM,2BAA2B,GAAG,mBAAmB,CAAC,QAAQ,CAAC,GAAG,CAAC,GAC/D,mBAAmB,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAChC,mBAAmB;IACzB,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,2BAA2B,IAAI,MAAM,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;IACtF;IACA,IAAI,IAAI,CAAC,IAAI,CAAC,WAAW,IAAI,WAAW,EAAE;MACtC,MAAM,YAAY,mCAAQ,IAAI,CAAC,IAAI,CAAC,WAAW,GAAK,WAAW,CAAE;MACjE,YAAY,CAAC,YAAY,EAAE,GAAG,CAAC,YAAY,CAAC;IAChD;IAEA,OAAO,GAAG;EACd;AACJ","ignoreList":[]}
@@ -1,5 +1,5 @@
1
1
  import { FetchHttpApi } from "./fetch.ts";
2
- import { type FileType, type IContentUri, type IHttpOpts, type Upload, type UploadOpts, type UploadResponse } from "./interface.ts";
2
+ import { type FileType, type IHttpOpts, type Upload, type UploadOpts, type UploadResponse } from "./interface.ts";
3
3
  export * from "./interface.ts";
4
4
  export * from "./prefix.ts";
5
5
  export * from "./errors.ts";
@@ -23,11 +23,5 @@ export declare class MatrixHttpApi<O extends IHttpOpts> extends FetchHttpApi<O>
23
23
  uploadContent(file: FileType, opts?: UploadOpts): Promise<UploadResponse>;
24
24
  cancelUpload(promise: Promise<UploadResponse>): boolean;
25
25
  getCurrentUploads(): Upload[];
26
- /**
27
- * Get the content repository url with query parameters.
28
- * @returns An object with a 'base', 'path' and 'params' for base URL,
29
- * path and query parameters respectively.
30
- */
31
- getContentUri(): IContentUri;
32
26
  }
33
27
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/http-api/index.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EACH,KAAK,QAAQ,EACb,KAAK,WAAW,EAChB,KAAK,SAAS,EACd,KAAK,MAAM,EACX,KAAK,UAAU,EACf,KAAK,cAAc,EACtB,MAAM,gBAAgB,CAAC;AAQxB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAE3B,qBAAa,aAAa,CAAC,CAAC,SAAS,SAAS,CAAE,SAAQ,YAAY,CAAC,CAAC,CAAC;IACnE,OAAO,CAAC,OAAO,CAAgB;IAE/B;;;;;;;;;;;;OAYG;IACI,aAAa,CAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,GAAE,UAAe,GAAG,OAAO,CAAC,cAAc,CAAC;IAgH7E,YAAY,CAAC,OAAO,EAAE,OAAO,CAAC,cAAc,CAAC,GAAG,OAAO;IASvD,iBAAiB,IAAI,MAAM,EAAE;IAIpC;;;;OAIG;IACI,aAAa,IAAI,WAAW;CAStC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/http-api/index.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,SAAS,EAAE,KAAK,MAAM,EAAE,KAAK,UAAU,EAAE,KAAK,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAQlH,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAE3B,qBAAa,aAAa,CAAC,CAAC,SAAS,SAAS,CAAE,SAAQ,YAAY,CAAC,CAAC,CAAC;IACnE,OAAO,CAAC,OAAO,CAAgB;IAE/B;;;;;;;;;;;;OAYG;IACI,aAAa,CAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,GAAE,UAAe,GAAG,OAAO,CAAC,cAAc,CAAC,CA8GnF;IAEM,YAAY,CAAC,OAAO,EAAE,OAAO,CAAC,cAAc,CAAC,GAAG,OAAO,CAO7D;IAEM,iBAAiB,IAAI,MAAM,EAAE,CAEnC;CACJ"}
@@ -156,20 +156,5 @@ export class MatrixHttpApi extends FetchHttpApi {
156
156
  getCurrentUploads() {
157
157
  return this.uploads;
158
158
  }
159
-
160
- /**
161
- * Get the content repository url with query parameters.
162
- * @returns An object with a 'base', 'path' and 'params' for base URL,
163
- * path and query parameters respectively.
164
- */
165
- getContentUri() {
166
- return {
167
- base: this.opts.baseUrl,
168
- path: MediaPrefix.V3 + "/upload",
169
- params: {
170
- access_token: this.opts.accessToken
171
- }
172
- };
173
- }
174
159
  }
175
160
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../src/http-api/index.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 { FetchHttpApi } from \"./fetch.ts\";\nimport {\n type FileType,\n type IContentUri,\n type IHttpOpts,\n type Upload,\n type UploadOpts,\n type UploadResponse,\n} from \"./interface.ts\";\nimport { MediaPrefix } from \"./prefix.ts\";\nimport { type QueryDict, removeElement } from \"../utils.ts\";\nimport * as callbacks from \"../realtime-callbacks.ts\";\nimport { Method } from \"./method.ts\";\nimport { ConnectionError } from \"./errors.ts\";\nimport { parseErrorResponse } from \"./utils.ts\";\n\nexport * from \"./interface.ts\";\nexport * from \"./prefix.ts\";\nexport * from \"./errors.ts\";\nexport * from \"./method.ts\";\nexport * from \"./utils.ts\";\n\nexport class MatrixHttpApi<O extends IHttpOpts> extends FetchHttpApi<O> {\n private uploads: Upload[] = [];\n\n /**\n * Upload content to the homeserver\n *\n * @param file - The object to upload. On a browser, something that\n * can be sent to XMLHttpRequest.send (typically a File). Under node.js,\n * a Buffer, String or ReadStream.\n *\n * @param opts - options object\n *\n * @returns Promise which resolves to response object, or rejects with an error (usually a MatrixError).\n * @throws May throw a `MatrixSafetyError` if content is deemed unsafe.\n * @see MatrixSafetyError\n */\n public uploadContent(file: FileType, opts: UploadOpts = {}): Promise<UploadResponse> {\n const includeFilename = opts.includeFilename ?? true;\n const abortController = opts.abortController ?? new AbortController();\n\n // If the file doesn't have a mime type, use a default since the HS errors if we don't supply one.\n const contentType = (opts.type ?? (file as File).type) || \"application/octet-stream\";\n const fileName = opts.name ?? (file as File).name;\n\n const upload = {\n loaded: 0,\n total: 0,\n abortController,\n } as Upload;\n const uploadResolvers = Promise.withResolvers<UploadResponse>();\n\n if (globalThis.XMLHttpRequest) {\n const xhr = new globalThis.XMLHttpRequest();\n\n const timeoutFn = function (): void {\n xhr.abort();\n uploadResolvers.reject(new Error(\"Timeout\"));\n };\n\n // set an initial timeout of 30s; we'll advance it each time we get a progress notification\n let timeoutTimer = callbacks.setTimeout(timeoutFn, 30000);\n\n xhr.onreadystatechange = function (): void {\n switch (xhr.readyState) {\n case globalThis.XMLHttpRequest.DONE:\n callbacks.clearTimeout(timeoutTimer);\n try {\n if (xhr.status === 0) {\n throw new DOMException(xhr.statusText, \"AbortError\"); // mimic fetch API\n }\n if (!xhr.responseText) {\n throw new Error(\"No response body.\");\n }\n\n if (xhr.status >= 400) {\n uploadResolvers.reject(parseErrorResponse(xhr, xhr.responseText));\n } else {\n uploadResolvers.resolve(JSON.parse(xhr.responseText));\n }\n } catch (err) {\n if ((<Error>err).name === \"AbortError\") {\n uploadResolvers.reject(err);\n return;\n }\n uploadResolvers.reject(new ConnectionError(\"request failed\", <Error>err));\n }\n break;\n }\n };\n\n xhr.upload.onprogress = (ev: ProgressEvent): void => {\n callbacks.clearTimeout(timeoutTimer);\n upload.loaded = ev.loaded;\n upload.total = ev.total;\n timeoutTimer = callbacks.setTimeout(timeoutFn, 30000);\n opts.progressHandler?.({\n loaded: ev.loaded,\n total: ev.total,\n });\n };\n\n const url = this.getUrl(\"/upload\", undefined, MediaPrefix.V3);\n\n if (includeFilename && fileName) {\n url.searchParams.set(\"filename\", encodeURIComponent(fileName));\n }\n\n if (!this.opts.useAuthorizationHeader && this.opts.accessToken) {\n url.searchParams.set(\"access_token\", encodeURIComponent(this.opts.accessToken));\n }\n\n xhr.open(Method.Post, url.href);\n if (this.opts.useAuthorizationHeader && this.opts.accessToken) {\n xhr.setRequestHeader(\"Authorization\", \"Bearer \" + this.opts.accessToken);\n }\n xhr.setRequestHeader(\"Content-Type\", contentType);\n xhr.send(file);\n\n abortController.signal.addEventListener(\"abort\", () => {\n xhr.abort();\n });\n } else {\n const queryParams: QueryDict = {};\n if (includeFilename && fileName) {\n queryParams.filename = fileName;\n }\n\n const headers: Record<string, string> = { \"Content-Type\": contentType };\n\n this.authedRequest<UploadResponse>(Method.Post, \"/upload\", queryParams, file, {\n prefix: MediaPrefix.V3,\n headers,\n abortSignal: abortController.signal,\n }).then(uploadResolvers.resolve, uploadResolvers.reject);\n }\n\n // remove the upload from the list on completion\n upload.promise = uploadResolvers.promise.finally(() => {\n removeElement(this.uploads, (elem) => elem === upload);\n });\n abortController.signal.addEventListener(\"abort\", () => {\n removeElement(this.uploads, (elem) => elem === upload);\n uploadResolvers.reject(new DOMException(\"Aborted\", \"AbortError\"));\n });\n this.uploads.push(upload);\n return upload.promise;\n }\n\n public cancelUpload(promise: Promise<UploadResponse>): boolean {\n const upload = this.uploads.find((u) => u.promise === promise);\n if (upload) {\n upload.abortController.abort();\n return true;\n }\n return false;\n }\n\n public getCurrentUploads(): Upload[] {\n return this.uploads;\n }\n\n /**\n * Get the content repository url with query parameters.\n * @returns An object with a 'base', 'path' and 'params' for base URL,\n * path and query parameters respectively.\n */\n public getContentUri(): IContentUri {\n return {\n base: this.opts.baseUrl,\n path: MediaPrefix.V3 + \"/upload\",\n params: {\n access_token: this.opts.accessToken!,\n },\n };\n }\n}\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAAS,YAAY,QAAQ,YAAY;AASzC,SAAS,WAAW,QAAQ,aAAa;AACzC,SAAyB,aAAa,QAAQ,aAAa;AAC3D,OAAO,KAAK,SAAS,MAAM,0BAA0B;AACrD,SAAS,MAAM,QAAQ,aAAa;AACpC,SAAS,eAAe,QAAQ,aAAa;AAC7C,SAAS,kBAAkB,QAAQ,YAAY;AAE/C,cAAc,gBAAgB;AAC9B,cAAc,aAAa;AAC3B,cAAc,aAAa;AAC3B,cAAc,aAAa;AAC3B,cAAc,YAAY;AAE1B,OAAO,MAAM,aAAa,SAA8B,YAAY,CAAI;EAAA;IAAA;IAAA,iCACxC,EAAE;EAAA;EAE9B;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACW,aAAa,CAAC,IAAc,EAAE,IAAgB,GAAG,CAAC,CAAC,EAA2B;IACjF,MAAM,eAAe,GAAG,IAAI,CAAC,eAAe,IAAI,IAAI;IACpD,MAAM,eAAe,GAAG,IAAI,CAAC,eAAe,IAAI,IAAI,eAAe,CAAC,CAAC;;IAErE;IACA,MAAM,WAAW,GAAG,CAAC,IAAI,CAAC,IAAI,IAAK,IAAI,CAAU,IAAI,KAAK,0BAA0B;IACpF,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,IAAK,IAAI,CAAU,IAAI;IAEjD,MAAM,MAAM,GAAG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AAC,OAAO,KAAK,OAAO,CAAC;IAC9D,IAAI,MAAM,EAAE;MACR,MAAM,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;MAC9B,OAAO,IAAI;IACf;IACA,OAAO,KAAK;EAChB;EAEO,iBAAiB,GAAa;IACjC,OAAO,IAAI,CAAC,OAAO;EACvB;;EAEA;AACJ;AACA;AACA;AACA;EACW,aAAa,GAAgB;IAChC,OAAO;MACH,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,OAAO;MACvB,IAAI,EAAE,WAAW,CAAC,EAAE,GAAG,SAAS;MAChC,MAAM,EAAE;QACJ,YAAY,EAAE,IAAI,CAAC,IAAI,CAAC;MAC5B;IACJ,CAAC;EACL;AACJ","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../src/http-api/index.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 { FetchHttpApi } from \"./fetch.ts\";\nimport { type FileType, type IHttpOpts, type Upload, type UploadOpts, type UploadResponse } from \"./interface.ts\";\nimport { MediaPrefix } from \"./prefix.ts\";\nimport { type QueryDict, removeElement } from \"../utils.ts\";\nimport * as callbacks from \"../realtime-callbacks.ts\";\nimport { Method } from \"./method.ts\";\nimport { ConnectionError } from \"./errors.ts\";\nimport { parseErrorResponse } from \"./utils.ts\";\n\nexport * from \"./interface.ts\";\nexport * from \"./prefix.ts\";\nexport * from \"./errors.ts\";\nexport * from \"./method.ts\";\nexport * from \"./utils.ts\";\n\nexport class MatrixHttpApi<O extends IHttpOpts> extends FetchHttpApi<O> {\n private uploads: Upload[] = [];\n\n /**\n * Upload content to the homeserver\n *\n * @param file - The object to upload. On a browser, something that\n * can be sent to XMLHttpRequest.send (typically a File). Under node.js,\n * a Buffer, String or ReadStream.\n *\n * @param opts - options object\n *\n * @returns Promise which resolves to response object, or rejects with an error (usually a MatrixError).\n * @throws May throw a `MatrixSafetyError` if content is deemed unsafe.\n * @see MatrixSafetyError\n */\n public uploadContent(file: FileType, opts: UploadOpts = {}): Promise<UploadResponse> {\n const includeFilename = opts.includeFilename ?? true;\n const abortController = opts.abortController ?? new AbortController();\n\n // If the file doesn't have a mime type, use a default since the HS errors if we don't supply one.\n const contentType = (opts.type ?? (file as File).type) || \"application/octet-stream\";\n const fileName = opts.name ?? (file as File).name;\n\n const upload = {\n loaded: 0,\n total: 0,\n abortController,\n } as Upload;\n const uploadResolvers = Promise.withResolvers<UploadResponse>();\n\n if (globalThis.XMLHttpRequest) {\n const xhr = new globalThis.XMLHttpRequest();\n\n const timeoutFn = function (): void {\n xhr.abort();\n uploadResolvers.reject(new Error(\"Timeout\"));\n };\n\n // set an initial timeout of 30s; we'll advance it each time we get a progress notification\n let timeoutTimer = callbacks.setTimeout(timeoutFn, 30000);\n\n xhr.onreadystatechange = function (): void {\n switch (xhr.readyState) {\n case globalThis.XMLHttpRequest.DONE:\n callbacks.clearTimeout(timeoutTimer);\n try {\n if (xhr.status === 0) {\n throw new DOMException(xhr.statusText, \"AbortError\"); // mimic fetch API\n }\n if (!xhr.responseText) {\n throw new Error(\"No response body.\");\n }\n\n if (xhr.status >= 400) {\n uploadResolvers.reject(parseErrorResponse(xhr, xhr.responseText));\n } else {\n uploadResolvers.resolve(JSON.parse(xhr.responseText));\n }\n } catch (err) {\n if ((<Error>err).name === \"AbortError\") {\n uploadResolvers.reject(err);\n return;\n }\n uploadResolvers.reject(new ConnectionError(\"request failed\", <Error>err));\n }\n break;\n }\n };\n\n xhr.upload.onprogress = (ev: ProgressEvent): void => {\n callbacks.clearTimeout(timeoutTimer);\n upload.loaded = ev.loaded;\n upload.total = ev.total;\n timeoutTimer = callbacks.setTimeout(timeoutFn, 30000);\n opts.progressHandler?.({\n loaded: ev.loaded,\n total: ev.total,\n });\n };\n\n const url = this.getUrl(\"/upload\", undefined, MediaPrefix.V3);\n\n if (includeFilename && fileName) {\n url.searchParams.set(\"filename\", encodeURIComponent(fileName));\n }\n\n if (!this.opts.useAuthorizationHeader && this.opts.accessToken) {\n url.searchParams.set(\"access_token\", encodeURIComponent(this.opts.accessToken));\n }\n\n xhr.open(Method.Post, url.href);\n if (this.opts.useAuthorizationHeader && this.opts.accessToken) {\n xhr.setRequestHeader(\"Authorization\", \"Bearer \" + this.opts.accessToken);\n }\n xhr.setRequestHeader(\"Content-Type\", contentType);\n xhr.send(file);\n\n abortController.signal.addEventListener(\"abort\", () => {\n xhr.abort();\n });\n } else {\n const queryParams: QueryDict = {};\n if (includeFilename && fileName) {\n queryParams.filename = fileName;\n }\n\n const headers: Record<string, string> = { \"Content-Type\": contentType };\n\n this.authedRequest<UploadResponse>(Method.Post, \"/upload\", queryParams, file, {\n prefix: MediaPrefix.V3,\n headers,\n abortSignal: abortController.signal,\n }).then(uploadResolvers.resolve, uploadResolvers.reject);\n }\n\n // remove the upload from the list on completion\n upload.promise = uploadResolvers.promise.finally(() => {\n removeElement(this.uploads, (elem) => elem === upload);\n });\n abortController.signal.addEventListener(\"abort\", () => {\n removeElement(this.uploads, (elem) => elem === upload);\n uploadResolvers.reject(new DOMException(\"Aborted\", \"AbortError\"));\n });\n this.uploads.push(upload);\n return upload.promise;\n }\n\n public cancelUpload(promise: Promise<UploadResponse>): boolean {\n const upload = this.uploads.find((u) => u.promise === promise);\n if (upload) {\n upload.abortController.abort();\n return true;\n }\n return false;\n }\n\n public getCurrentUploads(): Upload[] {\n return this.uploads;\n }\n}\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAAS,YAAY,QAAQ,YAAY;AAE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AAS,EAAE,WAAW,EAAE,IAAI,EAAE;QAC1E,MAAM,EAAE,WAAW,CAAC,EAAE;QACtB,OAAO;QACP,WAAW,EAAE,eAAe,CAAC;MACjC,CAAC,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,OAAO,EAAE,eAAe,CAAC,MAAM,CAAC;IAC5D;;IAEA;IACA,MAAM,CAAC,OAAO,GAAG,eAAe,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM;MACnD,aAAa,CAAC,IAAI,CAAC,OAAO,EAAG,IAAI,IAAK,IAAI,KAAK,MAAM,CAAC;IAC1D,CAAC,CAAC;IACF,eAAe,CAAC,MAAM,CAAC,gBAAgB,CAAC,OAAO,EAAE,MAAM;MACnD,aAAa,CAAC,IAAI,CAAC,OAAO,EAAG,IAAI,IAAK,IAAI,KAAK,MAAM,CAAC;MACtD,eAAe,CAAC,MAAM,CAAC,IAAI,YAAY,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC;IACrE,CAAC,CAAC;IACF,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC;IACzB,OAAO,MAAM,CAAC,OAAO;EACzB;EAEO,YAAY,CAAC,OAAgC,EAAW;IAC3D,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAE,CAAC,IAAK,CAAC,CAAC,OAAO,KAAK,OAAO,CAAC;IAC9D,IAAI,MAAM,EAAE;MACR,MAAM,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;MAC9B,OAAO,IAAI;IACf;IACA,OAAO,KAAK;EAChB;EAEO,iBAAiB,GAAa;IACjC,OAAO,IAAI,CAAC,OAAO;EACvB;AACJ","ignoreList":[]}
@@ -3,7 +3,6 @@ import { type Logger } from "../logger.ts";
3
3
  import { type QueryDict } from "../utils.ts";
4
4
  export type Body = Record<string, any> | BodyInit;
5
5
  /**
6
- * @experimental
7
6
  * Unencrypted access and (optional) refresh token
8
7
  */
9
8
  export type AccessTokens = {
@@ -21,7 +20,6 @@ export type AccessTokens = {
21
20
  expiry?: Date;
22
21
  };
23
22
  /**
24
- * @experimental
25
23
  * Function that performs token refresh using the given refreshToken.
26
24
  * Returns a promise that resolves to the refreshed access and (optional) refresh tokens.
27
25
  *
@@ -108,13 +106,6 @@ export interface IRequestOpts extends BaseRequestOpts {
108
106
  prefix?: string;
109
107
  inhibitLogoutEmit?: boolean;
110
108
  }
111
- export interface IContentUri {
112
- base: string;
113
- path: string;
114
- params: {
115
- access_token: string;
116
- };
117
- }
118
109
  export declare enum HttpApiEvent {
119
110
  SessionLoggedOut = "Session.logged_out",
120
111
  NoConsent = "no_consent"
@@ -1 +1 @@
1
- {"version":3,"file":"interface.d.ts","sourceRoot":"","sources":["../../src/http-api/interface.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C,MAAM,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,QAAQ,CAAC;AAElD;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG;IACvB;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,MAAM,CAAC,EAAE,IAAI,CAAC;CACjB,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,YAAY,EAAE,MAAM,KAAK,OAAO,CAAC,YAAY,CAAC,CAAC;AAEnF,mEAAmE;AACnE,MAAM,WAAW,SAAS;IACtB,OAAO,CAAC,EAAE,OAAO,UAAU,CAAC,KAAK,CAAC;IAElC,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,CAAC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* @experimental
19
18
  * Unencrypted access and (optional) refresh token
20
19
  */
21
20
 
22
21
  /**
23
- * @experimental
24
22
  * Function that performs token refresh using the given refreshToken.
25
23
  * Returns a promise that resolves to the refreshed access and (optional) refresh tokens.
26
24
  *
@@ -1 +1 @@
1
- {"version":3,"file":"interface.js","names":[],"sources":["../../src/http-api/interface.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 { type MatrixError } from \"./errors.ts\";\nimport { type Logger } from \"../logger.ts\";\nimport { type QueryDict } from \"../utils.ts\";\n\nexport type Body = Record<string, any> | BodyInit;\n\n/**\n * @experimental\n * Unencrypted access and (optional) refresh token\n */\nexport type AccessTokens = {\n /**\n * The new access token to use for authenticated requests\n */\n accessToken: string;\n /**\n * The new refresh token to use for refreshing tokens, optional\n */\n refreshToken?: string;\n /**\n * Approximate date when the access token will expire, optional\n */\n expiry?: Date;\n};\n\n/**\n * @experimental\n * Function that performs token refresh using the given refreshToken.\n * Returns a promise that resolves to the refreshed access and (optional) refresh tokens.\n *\n * Can be passed to HttpApi instance as {@link IHttpOpts.tokenRefreshFunction} during client creation {@link ICreateClientOpts}\n */\nexport type TokenRefreshFunction = (refreshToken: string) => Promise<AccessTokens>;\n\n/** Options object for `FetchHttpApi` and {@link MatrixHttpApi}. */\nexport interface IHttpOpts {\n fetchFn?: typeof globalThis.fetch;\n\n baseUrl: string;\n idBaseUrl?: string;\n prefix: string;\n extraParams?: QueryDict;\n\n accessToken?: string;\n /**\n * Used in conjunction with tokenRefreshFunction to attempt token refresh\n */\n refreshToken?: string;\n /**\n * Function to attempt token refresh when a possibly expired token is encountered\n * Optional, only called when a refreshToken is present\n */\n tokenRefreshFunction?: TokenRefreshFunction;\n\n /**\n * Whether to use the HTTP Authorization header over the `access_token` query parameter\n * @deprecated as of v1.11 in https://spec.matrix.org/v1.17/client-server-api/#using-access-tokens\n */\n useAuthorizationHeader?: boolean; // defaults to true\n\n /** For historical reasons, must be set to `true`. Will eventually be removed. */\n onlyData?: boolean;\n\n localTimeoutMs?: number;\n\n /** Optional logger instance. If provided, requests and responses will be logged. */\n logger?: Logger;\n}\n\n/** Options object for `FetchHttpApi.requestOtherUrl`. */\nexport interface BaseRequestOpts extends Pick<RequestInit, \"priority\"> {\n /**\n * map of additional request headers\n */\n headers?: Record<string, string>;\n abortSignal?: AbortSignal;\n /**\n * The maximum amount of time to wait before\n * timing out the request. If not specified, there is no timeout.\n */\n localTimeoutMs?: number;\n keepAlive?: boolean; // defaults to false\n\n /**\n * By default, we will:\n *\n * * If the `body` is an object, JSON-encode it and set `Content-Type: application/json` in the\n * request headers (unless overridden by {@link headers}).\n *\n * * Set `Accept: application/json` in the request headers (again, unless overridden by {@link headers}).\n *\n * * Parse the response as JSON and return the parsed response.\n *\n * Setting this to `false` inhibits all three behaviors, and the response is instead parsed as a UTF-8 string. It\n * defaults to `true`, unless {@link rawResponseBody} is set.\n *\n * @deprecated Instead of setting this to `false`, set {@link rawResponseBody} to `true`.\n */\n json?: boolean;\n\n /**\n * Setting this to `true` does two things:\n *\n * * Inhibits the automatic addition of `Accept: application/json` in the request headers.\n *\n * * Causes the raw response to be returned as a {@link https://developer.mozilla.org/en-US/docs/Web/API/Blob|Blob}\n * instead of parsing it as JSON.\n */\n rawResponseBody?: boolean;\n}\n\nexport interface IRequestOpts extends BaseRequestOpts {\n /**\n * The alternative base url to use.\n * If not specified, uses this.opts.baseUrl\n */\n baseUrl?: string;\n /**\n * The full prefix to use e.g.\n * \"/_matrix/client/v2_alpha\". If not specified, uses this.opts.prefix.\n */\n prefix?: string;\n\n // Set to true to prevent the request function from emitting a Session.logged_out event.\n // This is intended for use on endpoints where M_UNKNOWN_TOKEN is a valid/notable error response,\n // such as with token refreshes.\n inhibitLogoutEmit?: boolean;\n}\n\nexport interface IContentUri {\n base: string;\n path: string;\n params: {\n // eslint-disable-next-line camelcase\n access_token: string;\n };\n}\n\nexport enum HttpApiEvent {\n SessionLoggedOut = \"Session.logged_out\",\n NoConsent = \"no_consent\",\n}\n\nexport type HttpApiEventHandlerMap = {\n /**\n * Fires whenever the login session the JS SDK is using is no\n * longer valid and the user must log in again.\n * NB. This only fires when action is required from the user, not\n * when then login session can be renewed by using a refresh token.\n * @example\n * ```\n * matrixClient.on(\"Session.logged_out\", function(errorObj){\n * // show the login screen\n * });\n * ```\n */\n [HttpApiEvent.SessionLoggedOut]: (err: MatrixError) => void;\n /**\n * Fires when the JS SDK receives a M_CONSENT_NOT_GIVEN error in response\n * to a HTTP request.\n * @example\n * ```\n * matrixClient.on(\"no_consent\", function(message, contentUri) {\n * console.info(message + ' Go to ' + contentUri);\n * });\n * ```\n */\n [HttpApiEvent.NoConsent]: (message: string, consentUri: string) => void;\n};\n\nexport interface UploadProgress {\n loaded: number;\n total: number;\n}\n\nexport interface UploadOpts {\n /**\n * Name to give the file on the server. Defaults to <tt>file.name</tt>.\n */\n name?: string;\n /**\n * Content-type for the upload. Defaults to\n * <tt>file.type</tt>, or <tt>applicaton/octet-stream</tt>.\n */\n type?: string;\n /**\n * if false will not send the filename,\n * e.g for encrypted file uploads where filename leaks are undesirable.\n * Defaults to true.\n */\n includeFilename?: boolean;\n /**\n * Optional. Called when a chunk of\n * data has been uploaded, with an object containing the fields `loaded`\n * (number of bytes transferred) and `total` (total size, if known).\n */\n progressHandler?(progress: UploadProgress): void;\n abortController?: AbortController;\n}\n\nexport interface Upload {\n loaded: number;\n total: number;\n promise: Promise<UploadResponse>;\n abortController: AbortController;\n}\n\nexport interface UploadResponse {\n // eslint-disable-next-line camelcase\n content_uri: string;\n}\n\nexport type FileType = XMLHttpRequestBodyInit;\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAQA;AACA;AACA;AACA;;AAgBA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;;AAmCA;;AAqEA,WAAY,YAAY,0BAAZ,YAAY;EAAZ,YAAY;EAAZ,YAAY;EAAA,OAAZ,YAAY;AAAA","ignoreList":[]}
1
+ {"version":3,"file":"interface.js","names":[],"sources":["../../src/http-api/interface.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 { type MatrixError } from \"./errors.ts\";\nimport { type Logger } from \"../logger.ts\";\nimport { type QueryDict } from \"../utils.ts\";\n\nexport type Body = Record<string, any> | BodyInit;\n\n/**\n * Unencrypted access and (optional) refresh token\n */\nexport type AccessTokens = {\n /**\n * The new access token to use for authenticated requests\n */\n accessToken: string;\n /**\n * The new refresh token to use for refreshing tokens, optional\n */\n refreshToken?: string;\n /**\n * Approximate date when the access token will expire, optional\n */\n expiry?: Date;\n};\n\n/**\n * Function that performs token refresh using the given refreshToken.\n * Returns a promise that resolves to the refreshed access and (optional) refresh tokens.\n *\n * Can be passed to HttpApi instance as {@link IHttpOpts.tokenRefreshFunction} during client creation {@link ICreateClientOpts}\n */\nexport type TokenRefreshFunction = (refreshToken: string) => Promise<AccessTokens>;\n\n/** Options object for `FetchHttpApi` and {@link MatrixHttpApi}. */\nexport interface IHttpOpts {\n fetchFn?: typeof globalThis.fetch;\n\n baseUrl: string;\n idBaseUrl?: string;\n prefix: string;\n extraParams?: QueryDict;\n\n accessToken?: string;\n /**\n * Used in conjunction with tokenRefreshFunction to attempt token refresh\n */\n refreshToken?: string;\n /**\n * Function to attempt token refresh when a possibly expired token is encountered\n * Optional, only called when a refreshToken is present\n */\n tokenRefreshFunction?: TokenRefreshFunction;\n\n /**\n * Whether to use the HTTP Authorization header over the `access_token` query parameter\n * @deprecated as of v1.11 in https://spec.matrix.org/v1.17/client-server-api/#using-access-tokens\n */\n useAuthorizationHeader?: boolean; // defaults to true\n\n /** For historical reasons, must be set to `true`. Will eventually be removed. */\n onlyData?: boolean;\n\n localTimeoutMs?: number;\n\n /** Optional logger instance. If provided, requests and responses will be logged. */\n logger?: Logger;\n}\n\n/** Options object for `FetchHttpApi.requestOtherUrl`. */\nexport interface BaseRequestOpts extends Pick<RequestInit, \"priority\"> {\n /**\n * map of additional request headers\n */\n headers?: Record<string, string>;\n abortSignal?: AbortSignal;\n /**\n * The maximum amount of time to wait before\n * timing out the request. If not specified, there is no timeout.\n */\n localTimeoutMs?: number;\n keepAlive?: boolean; // defaults to false\n\n /**\n * By default, we will:\n *\n * * If the `body` is an object, JSON-encode it and set `Content-Type: application/json` in the\n * request headers (unless overridden by {@link headers}).\n *\n * * Set `Accept: application/json` in the request headers (again, unless overridden by {@link headers}).\n *\n * * Parse the response as JSON and return the parsed response.\n *\n * Setting this to `false` inhibits all three behaviors, and the response is instead parsed as a UTF-8 string. It\n * defaults to `true`, unless {@link rawResponseBody} is set.\n *\n * @deprecated Instead of setting this to `false`, set {@link rawResponseBody} to `true`.\n */\n json?: boolean;\n\n /**\n * Setting this to `true` does two things:\n *\n * * Inhibits the automatic addition of `Accept: application/json` in the request headers.\n *\n * * Causes the raw response to be returned as a {@link https://developer.mozilla.org/en-US/docs/Web/API/Blob|Blob}\n * instead of parsing it as JSON.\n */\n rawResponseBody?: boolean;\n}\n\nexport interface IRequestOpts extends BaseRequestOpts {\n /**\n * The alternative base url to use.\n * If not specified, uses this.opts.baseUrl\n */\n baseUrl?: string;\n /**\n * The full prefix to use e.g.\n * \"/_matrix/client/v2_alpha\". If not specified, uses this.opts.prefix.\n */\n prefix?: string;\n\n // Set to true to prevent the request function from emitting a Session.logged_out event.\n // This is intended for use on endpoints where M_UNKNOWN_TOKEN is a valid/notable error response,\n // such as with token refreshes.\n inhibitLogoutEmit?: boolean;\n}\n\nexport enum HttpApiEvent {\n SessionLoggedOut = \"Session.logged_out\",\n NoConsent = \"no_consent\",\n}\n\nexport type HttpApiEventHandlerMap = {\n /**\n * Fires whenever the login session the JS SDK is using is no\n * longer valid and the user must log in again.\n * NB. This only fires when action is required from the user, not\n * when then login session can be renewed by using a refresh token.\n * @example\n * ```\n * matrixClient.on(\"Session.logged_out\", function(errorObj){\n * // show the login screen\n * });\n * ```\n */\n [HttpApiEvent.SessionLoggedOut]: (err: MatrixError) => void;\n /**\n * Fires when the JS SDK receives a M_CONSENT_NOT_GIVEN error in response\n * to a HTTP request.\n * @example\n * ```\n * matrixClient.on(\"no_consent\", function(message, contentUri) {\n * console.info(message + ' Go to ' + contentUri);\n * });\n * ```\n */\n [HttpApiEvent.NoConsent]: (message: string, consentUri: string) => void;\n};\n\nexport interface UploadProgress {\n loaded: number;\n total: number;\n}\n\nexport interface UploadOpts {\n /**\n * Name to give the file on the server. Defaults to <tt>file.name</tt>.\n */\n name?: string;\n /**\n * Content-type for the upload. Defaults to\n * <tt>file.type</tt>, or <tt>applicaton/octet-stream</tt>.\n */\n type?: string;\n /**\n * if false will not send the filename,\n * e.g for encrypted file uploads where filename leaks are undesirable.\n * Defaults to true.\n */\n includeFilename?: boolean;\n /**\n * Optional. Called when a chunk of\n * data has been uploaded, with an object containing the fields `loaded`\n * (number of bytes transferred) and `total` (total size, if known).\n */\n progressHandler?(progress: UploadProgress): void;\n abortController?: AbortController;\n}\n\nexport interface Upload {\n loaded: number;\n total: number;\n promise: Promise<UploadResponse>;\n abortController: AbortController;\n}\n\nexport interface UploadResponse {\n // eslint-disable-next-line camelcase\n content_uri: string;\n}\n\nexport type FileType = XMLHttpRequestBodyInit;\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAQA;AACA;AACA;;AAgBA;AACA;AACA;AACA;AACA;AACA;;AAGA;;AAmCA;;AA4DA,WAAY,YAAY,0BAAZ,YAAY;EAAZ,YAAY;EAAZ,YAAY;EAAA,OAAZ,YAAY;AAAA","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"refresh.d.ts","sourceRoot":"","sources":["../../src/http-api/refresh.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAGhD;;GAEG;AAEH,0BAAkB,mBAAmB;IACjC,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,MAAM,WAAW;CACpB;AAED,UAAU,QAAQ;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,CAAC,EAAE,IAAI,CAAC;CACjB;AAQD,KAAK,IAAI,GAAG,IAAI,CAAC,SAAS,EAAE,sBAAsB,GAAG,QAAQ,GAAG,cAAc,GAAG,aAAa,CAAC,CAAC;AAEhG;;;GAGG;AACH,qBAAa,cAAc;IACJ,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAJ,IAAI,EAAE,IAAI;IAE9C;;;OAGG;IACH,OAAO,CAAC,mBAAmB,CAAC,CAA+B;IAE3D,OAAO,CAAC,wBAAwB,CAAC,CAAO;IAExC;;;;OAIG;IACU,iBAAiB,IAAI,OAAO,CAAC,QAAQ,CAAC;YAWrC,eAAe;IAa7B;;;;;;OAMG;IACU,kBAAkB,CAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC;YAKpF,mBAAmB;IA6BjC;;;;OAIG;YACW,cAAc;CAgC/B"}
1
+ {"version":3,"file":"refresh.d.ts","sourceRoot":"","sources":["../../src/http-api/refresh.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAGhD;;GAEG;AAEH,0BAAkB,mBAAmB;IACjC,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,MAAM,WAAW;CACpB;AAED,UAAU,QAAQ;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,CAAC,EAAE,IAAI,CAAC;CACjB;AAQD,KAAK,IAAI,GAAG,IAAI,CAAC,SAAS,EAAE,sBAAsB,GAAG,QAAQ,GAAG,cAAc,GAAG,aAAa,CAAC,CAAC;AAEhG;;;GAGG;AACH,qBAAa,cAAc;IACJ,OAAO,CAAC,QAAQ,CAAC,IAAI;IAAxC,YAAoC,IAAI,EAAE,IAAI,EAAI;IAElD;;;OAGG;IACH,OAAO,CAAC,mBAAmB,CAAC,CAA+B;IAE3D,OAAO,CAAC,wBAAwB,CAAC,CAAO;IAExC;;;;OAIG;IACU,iBAAiB,IAAI,OAAO,CAAC,QAAQ,CAAC,CASlD;YAEa,eAAe;IAa7B;;;;;;OAMG;IACU,kBAAkB,CAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAEjG;YAGa,mBAAmB;IA6BjC;;;;OAIG;YACW,cAAc;CAgC/B"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,QAAQ,MAAM,aAAa,CAAC;AAOxC,cAAc,aAAa,CAAC;AAC5B,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,QAAQ,MAAM,aAAa,CAAC;AAOxC,cAAc,aAAa,CAAC;eACb,QAAQ"}
@@ -1 +1 @@
1
- {"version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