diff options
Diffstat (limited to 'includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous')
48 files changed, 1131 insertions, 0 deletions
diff --git a/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/MSC3906Rendezvous.d.ts b/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/MSC3906Rendezvous.d.ts new file mode 100644 index 0000000..c536bd5 --- /dev/null +++ b/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/MSC3906Rendezvous.d.ts @@ -0,0 +1,74 @@ +import { RendezvousChannel, RendezvousFailureListener, RendezvousFailureReason, RendezvousIntent } from "."; +import { MatrixClient } from "../client"; +import { CrossSigningInfo } from "../crypto/CrossSigning"; +import { DeviceInfo } from "../crypto/deviceinfo"; +declare enum PayloadType { + Start = "m.login.start", + Finish = "m.login.finish", + Progress = "m.login.progress" +} +declare enum Outcome { + Success = "success", + Failure = "failure", + Verified = "verified", + Declined = "declined", + Unsupported = "unsupported" +} +export interface MSC3906RendezvousPayload { + type: PayloadType; + intent?: RendezvousIntent; + outcome?: Outcome; + device_id?: string; + device_key?: string; + verifying_device_id?: string; + verifying_device_key?: string; + master_key?: string; + protocols?: string[]; + protocol?: string; + login_token?: string; + homeserver?: string; +} +/** + * Implements MSC3906 to allow a user to sign in on a new device using QR code. + * This implementation only supports generating a QR code on a device that is already signed in. + * Note that this is UNSTABLE and may have breaking changes without notice. + */ +export declare class MSC3906Rendezvous { + private channel; + private client; + onFailure?: RendezvousFailureListener | undefined; + private newDeviceId?; + private newDeviceKey?; + private ourIntent; + private _code?; + /** + * @param channel - The secure channel used for communication + * @param client - The Matrix client in used on the device already logged in + * @param onFailure - Callback for when the rendezvous fails + */ + constructor(channel: RendezvousChannel<MSC3906RendezvousPayload>, client: MatrixClient, onFailure?: RendezvousFailureListener | undefined); + /** + * Returns the code representing the rendezvous suitable for rendering in a QR code or undefined if not generated yet. + */ + get code(): string | undefined; + /** + * Generate the code including doing partial set up of the channel where required. + */ + generateCode(): Promise<void>; + startAfterShowingCode(): Promise<string | undefined>; + private receive; + private send; + declineLoginOnExistingDevice(): Promise<void>; + approveLoginOnExistingDevice(loginToken: string): Promise<string | undefined>; + private verifyAndCrossSignDevice; + /** + * Verify the device and cross-sign it. + * @param timeout - time in milliseconds to wait for device to come online + * @returns the new device info if the device was verified + */ + verifyNewDeviceOnExistingDevice(timeout?: number): Promise<DeviceInfo | CrossSigningInfo | undefined>; + cancel(reason: RendezvousFailureReason): Promise<void>; + close(): Promise<void>; +} +export {}; +//# sourceMappingURL=MSC3906Rendezvous.d.ts.map
\ No newline at end of file diff --git a/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/MSC3906Rendezvous.d.ts.map b/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/MSC3906Rendezvous.d.ts.map new file mode 100644 index 0000000..28c19a8 --- /dev/null +++ b/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/MSC3906Rendezvous.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"MSC3906Rendezvous.d.ts","sourceRoot":"","sources":["../../src/rendezvous/MSC3906Rendezvous.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAE,iBAAiB,EAAE,yBAAyB,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,MAAM,GAAG,CAAC;AAC5G,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAKlD,aAAK,WAAW;IACZ,KAAK,kBAAkB;IACvB,MAAM,mBAAmB;IACzB,QAAQ,qBAAqB;CAChC;AAED,aAAK,OAAO;IACR,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,QAAQ,aAAa;IACrB,QAAQ,aAAa;IACrB,WAAW,gBAAgB;CAC9B;AAED,MAAM,WAAW,wBAAwB;IACrC,IAAI,EAAE,WAAW,CAAC;IAClB,MAAM,C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AAC,MAAM,EAAE,uBAAuB,GAAG,OAAO,CAAC,IAAI,CAAC;IAKtD,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAGtC"}
\ No newline at end of file diff --git a/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/MSC3906Rendezvous.js b/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/MSC3906Rendezvous.js new file mode 100644 index 0000000..e5bd99e --- /dev/null +++ b/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/MSC3906Rendezvous.js @@ -0,0 +1,235 @@ +"use strict"; + +var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.MSC3906Rendezvous = void 0; +var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty")); +var _matrixEventsSdk = require("matrix-events-sdk"); +var _ = require("."); +var _feature = require("../feature"); +var _logger = require("../logger"); +var _utils = require("../utils"); +/* +Copyright 2022 The Matrix.org Foundation C.I.C. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +var PayloadType; +(function (PayloadType) { + PayloadType["Start"] = "m.login.start"; + PayloadType["Finish"] = "m.login.finish"; + PayloadType["Progress"] = "m.login.progress"; +})(PayloadType || (PayloadType = {})); +var Outcome; +(function (Outcome) { + Outcome["Success"] = "success"; + Outcome["Failure"] = "failure"; + Outcome["Verified"] = "verified"; + Outcome["Declined"] = "declined"; + Outcome["Unsupported"] = "unsupported"; +})(Outcome || (Outcome = {})); +const LOGIN_TOKEN_PROTOCOL = new _matrixEventsSdk.UnstableValue("login_token", "org.matrix.msc3906.login_token"); + +/** + * Implements MSC3906 to allow a user to sign in on a new device using QR code. + * This implementation only supports generating a QR code on a device that is already signed in. + * Note that this is UNSTABLE and may have breaking changes without notice. + */ +class MSC3906Rendezvous { + /** + * @param channel - The secure channel used for communication + * @param client - The Matrix client in used on the device already logged in + * @param onFailure - Callback for when the rendezvous fails + */ + constructor(channel, client, onFailure) { + this.channel = channel; + this.client = client; + this.onFailure = onFailure; + (0, _defineProperty2.default)(this, "newDeviceId", void 0); + (0, _defineProperty2.default)(this, "newDeviceKey", void 0); + (0, _defineProperty2.default)(this, "ourIntent", _.RendezvousIntent.RECIPROCATE_LOGIN_ON_EXISTING_DEVICE); + (0, _defineProperty2.default)(this, "_code", void 0); + } + + /** + * Returns the code representing the rendezvous suitable for rendering in a QR code or undefined if not generated yet. + */ + get code() { + return this._code; + } + + /** + * Generate the code including doing partial set up of the channel where required. + */ + async generateCode() { + if (this._code) { + return; + } + this._code = JSON.stringify(await this.channel.generateCode(this.ourIntent)); + } + async startAfterShowingCode() { + const checksum = await this.channel.connect(); + _logger.logger.info(`Connected to secure channel with checksum: ${checksum} our intent is ${this.ourIntent}`); + const features = await (0, _feature.buildFeatureSupportMap)(await this.client.getVersions()); + // determine available protocols + if (features.get(_feature.Feature.LoginTokenRequest) === _feature.ServerSupport.Unsupported) { + _logger.logger.info("Server doesn't support MSC3882"); + await this.send({ + type: PayloadType.Finish, + outcome: Outcome.Unsupported + }); + await this.cancel(_.RendezvousFailureReason.HomeserverLacksSupport); + return undefined; + } + await this.send({ + type: PayloadType.Progress, + protocols: [LOGIN_TOKEN_PROTOCOL.name] + }); + _logger.logger.info("Waiting for other device to chose protocol"); + const { + type, + protocol, + outcome + } = await this.receive(); + if (type === PayloadType.Finish) { + // new device decided not to complete + switch (outcome !== null && outcome !== void 0 ? outcome : "") { + case "unsupported": + await this.cancel(_.RendezvousFailureReason.UnsupportedAlgorithm); + break; + default: + await this.cancel(_.RendezvousFailureReason.Unknown); + } + return undefined; + } + if (type !== PayloadType.Progress) { + await this.cancel(_.RendezvousFailureReason.Unknown); + return undefined; + } + if (!protocol || !LOGIN_TOKEN_PROTOCOL.matches(protocol)) { + await this.cancel(_.RendezvousFailureReason.UnsupportedAlgorithm); + return undefined; + } + return checksum; + } + async receive() { + return await this.channel.receive(); + } + async send(payload) { + await this.channel.send(payload); + } + async declineLoginOnExistingDevice() { + _logger.logger.info("User declined sign in"); + await this.send({ + type: PayloadType.Finish, + outcome: Outcome.Declined + }); + } + async approveLoginOnExistingDevice(loginToken) { + // eslint-disable-next-line camelcase + await this.send({ + type: PayloadType.Progress, + login_token: loginToken, + homeserver: this.client.baseUrl + }); + _logger.logger.info("Waiting for outcome"); + const res = await this.receive(); + if (!res) { + return undefined; + } + const { + outcome, + device_id: deviceId, + device_key: deviceKey + } = res; + if (outcome !== "success") { + throw new Error("Linking failed"); + } + this.newDeviceId = deviceId; + this.newDeviceKey = deviceKey; + return deviceId; + } + async verifyAndCrossSignDevice(deviceInfo) { + if (!this.client.crypto) { + throw new Error("Crypto not available on client"); + } + if (!this.newDeviceId) { + throw new Error("No new device ID set"); + } + + // check that keys received from the server for the new device match those received from the device itself + if (deviceInfo.getFingerprint() !== this.newDeviceKey) { + throw new Error(`New device has different keys than expected: ${this.newDeviceKey} vs ${deviceInfo.getFingerprint()}`); + } + const userId = this.client.getUserId(); + if (!userId) { + throw new Error("No user ID set"); + } + // mark the device as verified locally + cross sign + _logger.logger.info(`Marking device ${this.newDeviceId} as verified`); + const info = await this.client.crypto.setDeviceVerification(userId, this.newDeviceId, true, false, true); + const masterPublicKey = this.client.crypto.crossSigningInfo.getId("master"); + await this.send({ + type: PayloadType.Finish, + outcome: Outcome.Verified, + verifying_device_id: this.client.getDeviceId(), + verifying_device_key: this.client.getDeviceEd25519Key(), + master_key: masterPublicKey + }); + return info; + } + + /** + * Verify the device and cross-sign it. + * @param timeout - time in milliseconds to wait for device to come online + * @returns the new device info if the device was verified + */ + async verifyNewDeviceOnExistingDevice(timeout = 10 * 1000) { + if (!this.newDeviceId) { + throw new Error("No new device to sign"); + } + if (!this.newDeviceKey) { + _logger.logger.info("No new device key to sign"); + return undefined; + } + if (!this.client.crypto) { + throw new Error("Crypto not available on client"); + } + const userId = this.client.getUserId(); + if (!userId) { + throw new Error("No user ID set"); + } + let deviceInfo = this.client.crypto.getStoredDevice(userId, this.newDeviceId); + if (!deviceInfo) { + _logger.logger.info("Going to wait for new device to be online"); + await (0, _utils.sleep)(timeout); + deviceInfo = this.client.crypto.getStoredDevice(userId, this.newDeviceId); + } + if (deviceInfo) { + return await this.verifyAndCrossSignDevice(deviceInfo); + } + throw new Error("Device not online within timeout"); + } + async cancel(reason) { + var _this$onFailure; + (_this$onFailure = this.onFailure) === null || _this$onFailure === void 0 ? void 0 : _this$onFailure.call(this, reason); + await this.channel.cancel(reason); + } + async close() { + await this.channel.close(); + } +} +exports.MSC3906Rendezvous = MSC3906Rendezvous; +//# sourceMappingURL=MSC3906Rendezvous.js.map
\ No newline at end of file diff --git a/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/MSC3906Rendezvous.js.map b/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/MSC3906Rendezvous.js.map new file mode 100644 index 0000000..4c0b657 --- /dev/null +++ b/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/MSC3906Rendezvous.js.map @@ -0,0 +1 @@ +{"version":3,"file":"MSC3906Rendezvous.js","names":["_matrixEventsSdk","require","_","_feature","_logger","_utils","PayloadType","Outcome","LOGIN_TOKEN_PROTOCOL","UnstableValue","MSC3906Rendezvous","constructor","channel","client","onFailure","_defineProperty2","default","RendezvousIntent","RECIPROCATE_LOGIN_ON_EXISTING_DEVICE","code","_code","generateCode","JSON","stringify","ourIntent","startAfterShowingCode","checksum","connect","logger","info","features","buildFeatureSupportMap","getVersions","get","Feature","LoginTokenRequest","ServerSupport","Unsupported","send","type","Finish","outcome","cancel","RendezvousFailureReason","HomeserverLacksSupport","undefined","Progress","protocols","name","protocol","receive","UnsupportedAlgorithm","Unknown","matches","payload","declineLoginOnExistingDevice","Declined","approveLoginOnExistingDevice","loginToken","login_token","homeserver","baseUrl","res","device_id","deviceId","device_key","deviceKey","Error","newDeviceId","newDeviceKey","verifyAndCrossSignDevice","deviceInfo","crypto","getFingerprint","userId","getUserId","setDeviceVerification","masterPublicKey","crossSigningInfo","getId","Verified","verifying_device_id","getDeviceId","verifying_device_key","getDeviceEd25519Key","master_key","verifyNewDeviceOnExistingDevice","timeout","getStoredDevice","sleep","reason","_this$onFailure","call","close","exports"],"sources":["../../src/rendezvous/MSC3906Rendezvous.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 { UnstableValue } from \"matrix-events-sdk\";\n\nimport { RendezvousChannel, RendezvousFailureListener, RendezvousFailureReason, RendezvousIntent } from \".\";\nimport { MatrixClient } from \"../client\";\nimport { CrossSigningInfo } from \"../crypto/CrossSigning\";\nimport { DeviceInfo } from \"../crypto/deviceinfo\";\nimport { buildFeatureSupportMap, Feature, ServerSupport } from \"../feature\";\nimport { logger } from \"../logger\";\nimport { sleep } from \"../utils\";\n\nenum PayloadType {\n Start = \"m.login.start\",\n Finish = \"m.login.finish\",\n Progress = \"m.login.progress\",\n}\n\nenum Outcome {\n Success = \"success\",\n Failure = \"failure\",\n Verified = \"verified\",\n Declined = \"declined\",\n Unsupported = \"unsupported\",\n}\n\nexport interface MSC3906RendezvousPayload {\n type: PayloadType;\n intent?: RendezvousIntent;\n outcome?: Outcome;\n device_id?: string;\n device_key?: string;\n verifying_device_id?: string;\n verifying_device_key?: string;\n master_key?: string;\n protocols?: string[];\n protocol?: string;\n login_token?: string;\n homeserver?: string;\n}\n\nconst LOGIN_TOKEN_PROTOCOL = new UnstableValue(\"login_token\", \"org.matrix.msc3906.login_token\");\n\n/**\n * Implements MSC3906 to allow a user to sign in on a new device using QR code.\n * This implementation only supports generating a QR code on a device that is already signed in.\n * Note that this is UNSTABLE and may have breaking changes without notice.\n */\nexport class MSC3906Rendezvous {\n private newDeviceId?: string;\n private newDeviceKey?: string;\n private ourIntent: RendezvousIntent = RendezvousIntent.RECIPROCATE_LOGIN_ON_EXISTING_DEVICE;\n private _code?: string;\n\n /**\n * @param channel - The secure channel used for communication\n * @param client - The Matrix client in used on the device already logged in\n * @param onFailure - Callback for when the rendezvous fails\n */\n public constructor(\n private channel: RendezvousChannel<MSC3906RendezvousPayload>,\n private client: MatrixClient,\n public onFailure?: RendezvousFailureListener,\n ) {}\n\n /**\n * Returns the code representing the rendezvous suitable for rendering in a QR code or undefined if not generated yet.\n */\n public get code(): string | undefined {\n return this._code;\n }\n\n /**\n * Generate the code including doing partial set up of the channel where required.\n */\n public async generateCode(): Promise<void> {\n if (this._code) {\n return;\n }\n\n this._code = JSON.stringify(await this.channel.generateCode(this.ourIntent));\n }\n\n public async startAfterShowingCode(): Promise<string | undefined> {\n const checksum = await this.channel.connect();\n\n logger.info(`Connected to secure channel with checksum: ${checksum} our intent is ${this.ourIntent}`);\n\n const features = await buildFeatureSupportMap(await this.client.getVersions());\n // determine available protocols\n if (features.get(Feature.LoginTokenRequest) === ServerSupport.Unsupported) {\n logger.info(\"Server doesn't support MSC3882\");\n await this.send({ type: PayloadType.Finish, outcome: Outcome.Unsupported });\n await this.cancel(RendezvousFailureReason.HomeserverLacksSupport);\n return undefined;\n }\n\n await this.send({ type: PayloadType.Progress, protocols: [LOGIN_TOKEN_PROTOCOL.name] });\n\n logger.info(\"Waiting for other device to chose protocol\");\n const { type, protocol, outcome } = await this.receive();\n\n if (type === PayloadType.Finish) {\n // new device decided not to complete\n switch (outcome ?? \"\") {\n case \"unsupported\":\n await this.cancel(RendezvousFailureReason.UnsupportedAlgorithm);\n break;\n default:\n await this.cancel(RendezvousFailureReason.Unknown);\n }\n return undefined;\n }\n\n if (type !== PayloadType.Progress) {\n await this.cancel(RendezvousFailureReason.Unknown);\n return undefined;\n }\n\n if (!protocol || !LOGIN_TOKEN_PROTOCOL.matches(protocol)) {\n await this.cancel(RendezvousFailureReason.UnsupportedAlgorithm);\n return undefined;\n }\n\n return checksum;\n }\n\n private async receive(): Promise<MSC3906RendezvousPayload> {\n return (await this.channel.receive()) as MSC3906RendezvousPayload;\n }\n\n private async send(payload: MSC3906RendezvousPayload): Promise<void> {\n await this.channel.send(payload);\n }\n\n public async declineLoginOnExistingDevice(): Promise<void> {\n logger.info(\"User declined sign in\");\n await this.send({ type: PayloadType.Finish, outcome: Outcome.Declined });\n }\n\n public async approveLoginOnExistingDevice(loginToken: string): Promise<string | undefined> {\n // eslint-disable-next-line camelcase\n await this.send({ type: PayloadType.Progress, login_token: loginToken, homeserver: this.client.baseUrl });\n\n logger.info(\"Waiting for outcome\");\n const res = await this.receive();\n if (!res) {\n return undefined;\n }\n const { outcome, device_id: deviceId, device_key: deviceKey } = res;\n\n if (outcome !== \"success\") {\n throw new Error(\"Linking failed\");\n }\n\n this.newDeviceId = deviceId;\n this.newDeviceKey = deviceKey;\n\n return deviceId;\n }\n\n private async verifyAndCrossSignDevice(deviceInfo: DeviceInfo): Promise<CrossSigningInfo | DeviceInfo> {\n if (!this.client.crypto) {\n throw new Error(\"Crypto not available on client\");\n }\n\n if (!this.newDeviceId) {\n throw new Error(\"No new device ID set\");\n }\n\n // check that keys received from the server for the new device match those received from the device itself\n if (deviceInfo.getFingerprint() !== this.newDeviceKey) {\n throw new Error(\n `New device has different keys than expected: ${this.newDeviceKey} vs ${deviceInfo.getFingerprint()}`,\n );\n }\n\n const userId = this.client.getUserId();\n\n if (!userId) {\n throw new Error(\"No user ID set\");\n }\n // mark the device as verified locally + cross sign\n logger.info(`Marking device ${this.newDeviceId} as verified`);\n const info = await this.client.crypto.setDeviceVerification(userId, this.newDeviceId, true, false, true);\n\n const masterPublicKey = this.client.crypto.crossSigningInfo.getId(\"master\")!;\n\n await this.send({\n type: PayloadType.Finish,\n outcome: Outcome.Verified,\n verifying_device_id: this.client.getDeviceId()!,\n verifying_device_key: this.client.getDeviceEd25519Key()!,\n master_key: masterPublicKey,\n });\n\n return info;\n }\n\n /**\n * Verify the device and cross-sign it.\n * @param timeout - time in milliseconds to wait for device to come online\n * @returns the new device info if the device was verified\n */\n public async verifyNewDeviceOnExistingDevice(\n timeout = 10 * 1000,\n ): Promise<DeviceInfo | CrossSigningInfo | undefined> {\n if (!this.newDeviceId) {\n throw new Error(\"No new device to sign\");\n }\n\n if (!this.newDeviceKey) {\n logger.info(\"No new device key to sign\");\n return undefined;\n }\n\n if (!this.client.crypto) {\n throw new Error(\"Crypto not available on client\");\n }\n\n const userId = this.client.getUserId();\n\n if (!userId) {\n throw new Error(\"No user ID set\");\n }\n\n let deviceInfo = this.client.crypto.getStoredDevice(userId, this.newDeviceId);\n\n if (!deviceInfo) {\n logger.info(\"Going to wait for new device to be online\");\n await sleep(timeout);\n deviceInfo = this.client.crypto.getStoredDevice(userId, this.newDeviceId);\n }\n\n if (deviceInfo) {\n return await this.verifyAndCrossSignDevice(deviceInfo);\n }\n\n throw new Error(\"Device not online within timeout\");\n }\n\n public async cancel(reason: RendezvousFailureReason): Promise<void> {\n this.onFailure?.(reason);\n await this.channel.cancel(reason);\n }\n\n public async close(): Promise<void> {\n await this.channel.close();\n }\n}\n"],"mappings":";;;;;;;;AAgBA,IAAAA,gBAAA,GAAAC,OAAA;AAEA,IAAAC,CAAA,GAAAD,OAAA;AAIA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AAxBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAdA,IA0BKK,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AA6E,eAAA,uBAAdA,eAAA,CAAAC,IAAA,KAAI,EAAaF,MAAM,CAAC;IACxB,MAAM,IAAI,CAAC9E,OAAO,CAAC8B,MAAM,CAACgD,MAAM,CAAC;EACrC;EAEA,MAAaG,KAAKA,CAAA,EAAkB;IAChC,MAAM,IAAI,CAACjF,OAAO,CAACiF,KAAK,EAAE;EAC9B;AACJ;AAACC,OAAA,CAAApF,iBAAA,GAAAA,iBAAA"}
\ No newline at end of file diff --git a/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/RendezvousChannel.d.ts b/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/RendezvousChannel.d.ts new file mode 100644 index 0000000..b125779 --- /dev/null +++ b/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/RendezvousChannel.d.ts @@ -0,0 +1,27 @@ +import { RendezvousCode, RendezvousIntent, RendezvousFailureReason } from "."; +export interface RendezvousChannel<T> { + /** + * @returns the checksum/confirmation digits to be shown to the user + */ + connect(): Promise<string>; + /** + * Send a payload via the channel. + * @param data - payload to send + */ + send(data: T): Promise<void>; + /** + * Receive a payload from the channel. + * @returns the received payload + */ + receive(): Promise<Partial<T> | undefined>; + /** + * Close the channel and clear up any resources. + */ + close(): Promise<void>; + /** + * @returns a representation of the channel that can be encoded in a QR or similar + */ + generateCode(intent: RendezvousIntent): Promise<RendezvousCode>; + cancel(reason: RendezvousFailureReason): Promise<void>; +} +//# sourceMappingURL=RendezvousChannel.d.ts.map
\ No newline at end of file diff --git a/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/RendezvousChannel.d.ts.map b/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/RendezvousChannel.d.ts.map new file mode 100644 index 0000000..c24d602 --- /dev/null +++ b/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/RendezvousChannel.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"RendezvousChannel.d.ts","sourceRoot":"","sources":["../../src/rendezvous/RendezvousChannel.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,MAAM,GAAG,CAAC;AAE9E,MAAM,WAAW,iBAAiB,CAAC,CAAC;IAChC;;OAEG;IACH,OAAO,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IAE3B;;;OAGG;IACH,IAAI,CAAC,IAAI,EAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE7B;;;OAGG;IACH,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC;IAE3C;;OAEG;IACH,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAEvB;;OAEG;IACH,YAAY,CAAC,MAAM,EAAE,gBAAgB,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;IAEhE,MAAM,CAAC,MAAM,EAAE,uBAAuB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC1D"}
\ No newline at end of file diff --git a/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/RendezvousChannel.js b/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/RendezvousChannel.js new file mode 100644 index 0000000..9715e7f --- /dev/null +++ b/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/RendezvousChannel.js @@ -0,0 +1,6 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +//# sourceMappingURL=RendezvousChannel.js.map
\ No newline at end of file diff --git a/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/RendezvousChannel.js.map b/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/RendezvousChannel.js.map new file mode 100644 index 0000000..f6f0112 --- /dev/null +++ b/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/RendezvousChannel.js.map @@ -0,0 +1 @@ +{"version":3,"file":"RendezvousChannel.js","names":[],"sources":["../../src/rendezvous/RendezvousChannel.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 { RendezvousCode, RendezvousIntent, RendezvousFailureReason } from \".\";\n\nexport interface RendezvousChannel<T> {\n /**\n * @returns the checksum/confirmation digits to be shown to the user\n */\n connect(): Promise<string>;\n\n /**\n * Send a payload via the channel.\n * @param data - payload to send\n */\n send(data: T): Promise<void>;\n\n /**\n * Receive a payload from the channel.\n * @returns the received payload\n */\n receive(): Promise<Partial<T> | undefined>;\n\n /**\n * Close the channel and clear up any resources.\n */\n close(): Promise<void>;\n\n /**\n * @returns a representation of the channel that can be encoded in a QR or similar\n */\n generateCode(intent: RendezvousIntent): Promise<RendezvousCode>;\n\n cancel(reason: RendezvousFailureReason): Promise<void>;\n}\n"],"mappings":""}
\ No newline at end of file diff --git a/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/RendezvousCode.d.ts b/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/RendezvousCode.d.ts new file mode 100644 index 0000000..3b3dbe2 --- /dev/null +++ b/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/RendezvousCode.d.ts @@ -0,0 +1,9 @@ +import { RendezvousTransportDetails, RendezvousIntent } from "."; +export interface RendezvousCode { + intent: RendezvousIntent; + rendezvous?: { + transport: RendezvousTransportDetails; + algorithm: string; + }; +} +//# sourceMappingURL=RendezvousCode.d.ts.map
\ No newline at end of file diff --git a/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/RendezvousCode.d.ts.map b/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/RendezvousCode.d.ts.map new file mode 100644 index 0000000..78b8eea --- /dev/null +++ b/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/RendezvousCode.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"RendezvousCode.d.ts","sourceRoot":"","sources":["../../src/rendezvous/RendezvousCode.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,0BAA0B,EAAE,gBAAgB,EAAE,MAAM,GAAG,CAAC;AAEjE,MAAM,WAAW,cAAc;IAC3B,MAAM,EAAE,gBAAgB,CAAC;IACzB,UAAU,CAAC,EAAE;QACT,SAAS,EAAE,0BAA0B,CAAC;QACtC,SAAS,EAAE,MAAM,CAAC;KACrB,CAAC;CACL"}
\ No newline at end of file diff --git a/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/RendezvousCode.js b/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/RendezvousCode.js new file mode 100644 index 0000000..1f58551 --- /dev/null +++ b/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/RendezvousCode.js @@ -0,0 +1,6 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +//# sourceMappingURL=RendezvousCode.js.map
\ No newline at end of file diff --git a/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/RendezvousCode.js.map b/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/RendezvousCode.js.map new file mode 100644 index 0000000..2bea3dc --- /dev/null +++ b/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/RendezvousCode.js.map @@ -0,0 +1 @@ +{"version":3,"file":"RendezvousCode.js","names":[],"sources":["../../src/rendezvous/RendezvousCode.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 { RendezvousTransportDetails, RendezvousIntent } from \".\";\n\nexport interface RendezvousCode {\n intent: RendezvousIntent;\n rendezvous?: {\n transport: RendezvousTransportDetails;\n algorithm: string;\n };\n}\n"],"mappings":""}
\ No newline at end of file diff --git a/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/RendezvousError.d.ts b/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/RendezvousError.d.ts new file mode 100644 index 0000000..a0d58b7 --- /dev/null +++ b/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/RendezvousError.d.ts @@ -0,0 +1,6 @@ +import { RendezvousFailureReason } from "."; +export declare class RendezvousError extends Error { + readonly code: RendezvousFailureReason; + constructor(message: string, code: RendezvousFailureReason); +} +//# sourceMappingURL=RendezvousError.d.ts.map
\ No newline at end of file diff --git a/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/RendezvousError.d.ts.map b/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/RendezvousError.d.ts.map new file mode 100644 index 0000000..74e1cbe --- /dev/null +++ b/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/RendezvousError.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"RendezvousError.d.ts","sourceRoot":"","sources":["../../src/rendezvous/RendezvousError.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,uBAAuB,EAAE,MAAM,GAAG,CAAC;AAE5C,qBAAa,eAAgB,SAAQ,KAAK;aACc,IAAI,EAAE,uBAAuB;gBAA9D,OAAO,EAAE,MAAM,EAAkB,IAAI,EAAE,uBAAuB;CAGpF"}
\ No newline at end of file diff --git a/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/RendezvousError.js b/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/RendezvousError.js new file mode 100644 index 0000000..426c882 --- /dev/null +++ b/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/RendezvousError.js @@ -0,0 +1,30 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.RendezvousError = void 0; +/* +Copyright 2022 The Matrix.org Foundation C.I.C. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +class RendezvousError extends Error { + constructor(message, code) { + super(message); + this.code = code; + } +} +exports.RendezvousError = RendezvousError; +//# sourceMappingURL=RendezvousError.js.map
\ No newline at end of file diff --git a/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/RendezvousError.js.map b/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/RendezvousError.js.map new file mode 100644 index 0000000..afb990b --- /dev/null +++ b/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/RendezvousError.js.map @@ -0,0 +1 @@ +{"version":3,"file":"RendezvousError.js","names":["RendezvousError","Error","constructor","message","code","exports"],"sources":["../../src/rendezvous/RendezvousError.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 { RendezvousFailureReason } from \".\";\n\nexport class RendezvousError extends Error {\n public constructor(message: string, public readonly code: RendezvousFailureReason) {\n super(message);\n }\n}\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIO,MAAMA,eAAe,SAASC,KAAK,CAAC;EAChCC,WAAWA,CAACC,OAAe,EAAkBC,IAA6B,EAAE;IAC/E,KAAK,CAACD,OAAO,CAAC;IAAC,KADiCC,IAA6B,GAA7BA,IAA6B;EAEjF;AACJ;AAACC,OAAA,CAAAL,eAAA,GAAAA,eAAA"}
\ No newline at end of file diff --git a/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/RendezvousFailureReason.d.ts b/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/RendezvousFailureReason.d.ts new file mode 100644 index 0000000..76aba78 --- /dev/null +++ b/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/RendezvousFailureReason.d.ts @@ -0,0 +1,15 @@ +export type RendezvousFailureListener = (reason: RendezvousFailureReason) => void; +export declare enum RendezvousFailureReason { + UserDeclined = "user_declined", + OtherDeviceNotSignedIn = "other_device_not_signed_in", + OtherDeviceAlreadySignedIn = "other_device_already_signed_in", + Unknown = "unknown", + Expired = "expired", + UserCancelled = "user_cancelled", + InvalidCode = "invalid_code", + UnsupportedAlgorithm = "unsupported_algorithm", + DataMismatch = "data_mismatch", + UnsupportedTransport = "unsupported_transport", + HomeserverLacksSupport = "homeserver_lacks_support" +} +//# sourceMappingURL=RendezvousFailureReason.d.ts.map
\ No newline at end of file diff --git a/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/RendezvousFailureReason.d.ts.map b/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/RendezvousFailureReason.d.ts.map new file mode 100644 index 0000000..5f508ea --- /dev/null +++ b/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/RendezvousFailureReason.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"RendezvousFailureReason.d.ts","sourceRoot":"","sources":["../../src/rendezvous/RendezvousFailureReason.ts"],"names":[],"mappings":"AAgBA,MAAM,MAAM,yBAAyB,GAAG,CAAC,MAAM,EAAE,uBAAuB,KAAK,IAAI,CAAC;AAElF,oBAAY,uBAAuB;IAC/B,YAAY,kBAAkB;IAC9B,sBAAsB,+BAA+B;IACrD,0BAA0B,mCAAmC;IAC7D,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,aAAa,mBAAmB;IAChC,WAAW,iBAAiB;IAC5B,oBAAoB,0BAA0B;IAC9C,YAAY,kBAAkB;IAC9B,oBAAoB,0BAA0B;IAC9C,sBAAsB,6BAA6B;CACtD"}
\ No newline at end of file diff --git a/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/RendezvousFailureReason.js b/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/RendezvousFailureReason.js new file mode 100644 index 0000000..78a23bf --- /dev/null +++ b/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/RendezvousFailureReason.js @@ -0,0 +1,37 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.RendezvousFailureReason = void 0; +/* +Copyright 2022 The Matrix.org Foundation C.I.C. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +let RendezvousFailureReason; +exports.RendezvousFailureReason = RendezvousFailureReason; +(function (RendezvousFailureReason) { + RendezvousFailureReason["UserDeclined"] = "user_declined"; + RendezvousFailureReason["OtherDeviceNotSignedIn"] = "other_device_not_signed_in"; + RendezvousFailureReason["OtherDeviceAlreadySignedIn"] = "other_device_already_signed_in"; + RendezvousFailureReason["Unknown"] = "unknown"; + RendezvousFailureReason["Expired"] = "expired"; + RendezvousFailureReason["UserCancelled"] = "user_cancelled"; + RendezvousFailureReason["InvalidCode"] = "invalid_code"; + RendezvousFailureReason["UnsupportedAlgorithm"] = "unsupported_algorithm"; + RendezvousFailureReason["DataMismatch"] = "data_mismatch"; + RendezvousFailureReason["UnsupportedTransport"] = "unsupported_transport"; + RendezvousFailureReason["HomeserverLacksSupport"] = "homeserver_lacks_support"; +})(RendezvousFailureReason || (exports.RendezvousFailureReason = RendezvousFailureReason = {})); +//# sourceMappingURL=RendezvousFailureReason.js.map
\ No newline at end of file diff --git a/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/RendezvousFailureReason.js.map b/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/RendezvousFailureReason.js.map new file mode 100644 index 0000000..5a815b7 --- /dev/null +++ b/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/RendezvousFailureReason.js.map @@ -0,0 +1 @@ +{"version":3,"file":"RendezvousFailureReason.js","names":["RendezvousFailureReason","exports"],"sources":["../../src/rendezvous/RendezvousFailureReason.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\nexport type RendezvousFailureListener = (reason: RendezvousFailureReason) => void;\n\nexport enum RendezvousFailureReason {\n UserDeclined = \"user_declined\",\n OtherDeviceNotSignedIn = \"other_device_not_signed_in\",\n OtherDeviceAlreadySignedIn = \"other_device_already_signed_in\",\n Unknown = \"unknown\",\n Expired = \"expired\",\n UserCancelled = \"user_cancelled\",\n InvalidCode = \"invalid_code\",\n UnsupportedAlgorithm = \"unsupported_algorithm\",\n DataMismatch = \"data_mismatch\",\n UnsupportedTransport = \"unsupported_transport\",\n HomeserverLacksSupport = \"homeserver_lacks_support\",\n}\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAdA,IAkBYA,uBAAuB;AAAAC,OAAA,CAAAD,uBAAA,GAAAA,uBAAA;AAAA,WAAvBA,uBAAuB;EAAvBA,uBAAuB;EAAvBA,uBAAuB;EAAvBA,uBAAuB;EAAvBA,uBAAuB;EAAvBA,uBAAuB;EAAvBA,uBAAuB;EAAvBA,uBAAuB;EAAvBA,uBAAuB;EAAvBA,uBAAuB;EAAvBA,uBAAuB;EAAvBA,uBAAuB;AAAA,GAAvBA,uBAAuB,KAAAC,OAAA,CAAAD,uBAAA,GAAvBA,uBAAuB"}
\ No newline at end of file diff --git a/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/RendezvousIntent.d.ts b/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/RendezvousIntent.d.ts new file mode 100644 index 0000000..4ac5d22 --- /dev/null +++ b/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/RendezvousIntent.d.ts @@ -0,0 +1,5 @@ +export declare enum RendezvousIntent { + LOGIN_ON_NEW_DEVICE = "login.start", + RECIPROCATE_LOGIN_ON_EXISTING_DEVICE = "login.reciprocate" +} +//# sourceMappingURL=RendezvousIntent.d.ts.map
\ No newline at end of file diff --git a/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/RendezvousIntent.d.ts.map b/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/RendezvousIntent.d.ts.map new file mode 100644 index 0000000..55f5952 --- /dev/null +++ b/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/RendezvousIntent.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"RendezvousIntent.d.ts","sourceRoot":"","sources":["../../src/rendezvous/RendezvousIntent.ts"],"names":[],"mappings":"AAgBA,oBAAY,gBAAgB;IACxB,mBAAmB,gBAAgB;IACnC,oCAAoC,sBAAsB;CAC7D"}
\ No newline at end of file diff --git a/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/RendezvousIntent.js b/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/RendezvousIntent.js new file mode 100644 index 0000000..5ea56dd --- /dev/null +++ b/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/RendezvousIntent.js @@ -0,0 +1,28 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.RendezvousIntent = void 0; +/* +Copyright 2022 The Matrix.org Foundation C.I.C. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +let RendezvousIntent; +exports.RendezvousIntent = RendezvousIntent; +(function (RendezvousIntent) { + RendezvousIntent["LOGIN_ON_NEW_DEVICE"] = "login.start"; + RendezvousIntent["RECIPROCATE_LOGIN_ON_EXISTING_DEVICE"] = "login.reciprocate"; +})(RendezvousIntent || (exports.RendezvousIntent = RendezvousIntent = {})); +//# sourceMappingURL=RendezvousIntent.js.map
\ No newline at end of file diff --git a/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/RendezvousIntent.js.map b/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/RendezvousIntent.js.map new file mode 100644 index 0000000..78cd14f --- /dev/null +++ b/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/RendezvousIntent.js.map @@ -0,0 +1 @@ +{"version":3,"file":"RendezvousIntent.js","names":["RendezvousIntent","exports"],"sources":["../../src/rendezvous/RendezvousIntent.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\nexport enum RendezvousIntent {\n LOGIN_ON_NEW_DEVICE = \"login.start\",\n RECIPROCATE_LOGIN_ON_EXISTING_DEVICE = \"login.reciprocate\",\n}\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAdA,IAgBYA,gBAAgB;AAAAC,OAAA,CAAAD,gBAAA,GAAAA,gBAAA;AAAA,WAAhBA,gBAAgB;EAAhBA,gBAAgB;EAAhBA,gBAAgB;AAAA,GAAhBA,gBAAgB,KAAAC,OAAA,CAAAD,gBAAA,GAAhBA,gBAAgB"}
\ No newline at end of file diff --git a/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/RendezvousTransport.d.ts b/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/RendezvousTransport.d.ts new file mode 100644 index 0000000..ddc2a4d --- /dev/null +++ b/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/RendezvousTransport.d.ts @@ -0,0 +1,36 @@ +import { RendezvousFailureListener, RendezvousFailureReason } from "."; +export interface RendezvousTransportDetails { + type: string; +} +/** + * Interface representing a generic rendezvous transport. + */ +export interface RendezvousTransport<T> { + /** + * Ready state of the transport. This is set to true when the transport is ready to be used. + */ + readonly ready: boolean; + /** + * Listener for cancellation events. This is called when the rendezvous is cancelled or fails. + */ + onFailure?: RendezvousFailureListener; + /** + * @returns the transport details that can be encoded in a QR or similar + */ + details(): Promise<RendezvousTransportDetails>; + /** + * Send data via the transport. + * @param data - the data itself + */ + send(data: T): Promise<void>; + /** + * Receive data from the transport. + */ + receive(): Promise<Partial<T> | undefined>; + /** + * Cancel the rendezvous. This will call `onCancelled()` if it is set. + * @param reason - the reason for the cancellation/failure + */ + cancel(reason: RendezvousFailureReason): Promise<void>; +} +//# sourceMappingURL=RendezvousTransport.d.ts.map
\ No newline at end of file diff --git a/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/RendezvousTransport.d.ts.map b/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/RendezvousTransport.d.ts.map new file mode 100644 index 0000000..21f263c --- /dev/null +++ b/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/RendezvousTransport.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"RendezvousTransport.d.ts","sourceRoot":"","sources":["../../src/rendezvous/RendezvousTransport.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,yBAAyB,EAAE,uBAAuB,EAAE,MAAM,GAAG,CAAC;AAEvE,MAAM,WAAW,0BAA0B;IACvC,IAAI,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB,CAAC,CAAC;IAClC;;OAEG;IACH,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IAExB;;OAEG;IACH,SAAS,CAAC,EAAE,yBAAyB,CAAC;IAEtC;;OAEG;IACH,OAAO,IAAI,OAAO,CAAC,0BAA0B,CAAC,CAAC;IAE/C;;;OAGG;IACH,IAAI,CAAC,IAAI,EAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE7B;;OAEG;IACH,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC;IAE3C;;;OAGG;IACH,MAAM,CAAC,MAAM,EAAE,uBAAuB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC1D"}
\ No newline at end of file diff --git a/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/RendezvousTransport.js b/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/RendezvousTransport.js new file mode 100644 index 0000000..026d012 --- /dev/null +++ b/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/RendezvousTransport.js @@ -0,0 +1,6 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +//# sourceMappingURL=RendezvousTransport.js.map
\ No newline at end of file diff --git a/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/RendezvousTransport.js.map b/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/RendezvousTransport.js.map new file mode 100644 index 0000000..4839035 --- /dev/null +++ b/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/RendezvousTransport.js.map @@ -0,0 +1 @@ +{"version":3,"file":"RendezvousTransport.js","names":[],"sources":["../../src/rendezvous/RendezvousTransport.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 { RendezvousFailureListener, RendezvousFailureReason } from \".\";\n\nexport interface RendezvousTransportDetails {\n type: string;\n}\n\n/**\n * Interface representing a generic rendezvous transport.\n */\nexport interface RendezvousTransport<T> {\n /**\n * Ready state of the transport. This is set to true when the transport is ready to be used.\n */\n readonly ready: boolean;\n\n /**\n * Listener for cancellation events. This is called when the rendezvous is cancelled or fails.\n */\n onFailure?: RendezvousFailureListener;\n\n /**\n * @returns the transport details that can be encoded in a QR or similar\n */\n details(): Promise<RendezvousTransportDetails>;\n\n /**\n * Send data via the transport.\n * @param data - the data itself\n */\n send(data: T): Promise<void>;\n\n /**\n * Receive data from the transport.\n */\n receive(): Promise<Partial<T> | undefined>;\n\n /**\n * Cancel the rendezvous. This will call `onCancelled()` if it is set.\n * @param reason - the reason for the cancellation/failure\n */\n cancel(reason: RendezvousFailureReason): Promise<void>;\n}\n"],"mappings":""}
\ No newline at end of file diff --git a/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/channels/MSC3903ECDHv2RendezvousChannel.d.ts b/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/channels/MSC3903ECDHv2RendezvousChannel.d.ts new file mode 100644 index 0000000..06a9a36 --- /dev/null +++ b/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/channels/MSC3903ECDHv2RendezvousChannel.d.ts @@ -0,0 +1,44 @@ +import { RendezvousCode, RendezvousIntent, RendezvousChannel, RendezvousTransportDetails, RendezvousTransport, RendezvousFailureReason } from ".."; +import { UnstableValue } from "../../NamespacedValue"; +declare const ECDH_V2: UnstableValue<"m.rendezvous.v2.curve25519-aes-sha256", "org.matrix.msc3903.rendezvous.v2.curve25519-aes-sha256">; +export interface ECDHv2RendezvousCode extends RendezvousCode { + rendezvous: { + transport: RendezvousTransportDetails; + algorithm: typeof ECDH_V2.name | typeof ECDH_V2.altName; + key: string; + }; +} +export type MSC3903ECDHPayload = PlainTextPayload | EncryptedPayload; +export interface PlainTextPayload { + algorithm: typeof ECDH_V2.name | typeof ECDH_V2.altName; + key?: string; +} +export interface EncryptedPayload { + iv: string; + ciphertext: string; +} +/** + * Implementation of the unstable [MSC3903](https://github.com/matrix-org/matrix-spec-proposals/pull/3903) + * X25519/ECDH key agreement based secure rendezvous channel. + * Note that this is UNSTABLE and may have breaking changes without notice. + */ +export declare class MSC3903ECDHv2RendezvousChannel<T> implements RendezvousChannel<T> { + private transport; + private theirPublicKey?; + onFailure?: ((reason: RendezvousFailureReason) => void) | undefined; + private olmSAS?; + private ourPublicKey; + private aesKey?; + private connected; + constructor(transport: RendezvousTransport<MSC3903ECDHPayload>, theirPublicKey?: Uint8Array | undefined, onFailure?: ((reason: RendezvousFailureReason) => void) | undefined); + generateCode(intent: RendezvousIntent): Promise<ECDHv2RendezvousCode>; + connect(): Promise<string>; + private encrypt; + send(payload: T): Promise<void>; + private decrypt; + receive(): Promise<Partial<T> | undefined>; + close(): Promise<void>; + cancel(reason: RendezvousFailureReason): Promise<void>; +} +export {}; +//# sourceMappingURL=MSC3903ECDHv2RendezvousChannel.d.ts.map
\ No newline at end of file diff --git a/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/channels/MSC3903ECDHv2RendezvousChannel.d.ts.map b/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/channels/MSC3903ECDHv2RendezvousChannel.d.ts.map new file mode 100644 index 0000000..f23ad42 --- /dev/null +++ b/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/channels/MSC3903ECDHv2RendezvousChannel.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"MSC3903ECDHv2RendezvousChannel.d.ts","sourceRoot":"","sources":["../../../src/rendezvous/channels/MSC3903ECDHv2RendezvousChannel.ts"],"names":[],"mappings":"AAkBA,OAAO,EAEH,cAAc,EACd,gBAAgB,EAChB,iBAAiB,EACjB,0BAA0B,EAC1B,mBAAmB,EACnB,uBAAuB,EAC1B,MAAM,IAAI,CAAC;AAIZ,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAEtD,QAAA,MAAM,OAAO,kHAGZ,CAAC;AAEF,MAAM,WAAW,oBAAqB,SAAQ,cAAc;IACxD,UAAU,EAAE;QACR,SAAS,EAAE,0BAA0B,CAAC;QACtC,SAAS,EAAE,OAAO,OAAO,CAAC,IAAI,GAAG,OAAO,OAAO,CAAC,OAAO,CAAC;QACxD,GAAG,EAAE,MAAM,CAAC;KACf,CAAC;CACL;AAED,MAAM,MAAM,kBAAkB,GAAG,gBAAgB,GAAG,gBAAgB,CAAC;AAErE,MAAM,WAAW,gBAAgB;IAC7B,SAAS,EAAE,OAAO,OAAO,CAAC,IAAI,GAAG,OAAO,OAAO,CAAC,OAAO,CAAC;IACxD,GAAG,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,gBAAgB;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;CACtB;AAYD;;;;GAIG;AACH,qBAAa,8BAA8B,CAAC,CAAC,CAAE,YAAW,iBAAiB,CAAC,CAAC,CAAC;IAOtE,OAAO,CAAC,SAAS;IACjB,OAAO,CAAC,cAAc,CAAC;IAChB,SAAS,CAAC,YAAW,uBAAuB,KAAK,IAAI;IARhE,OAAO,CAAC,MAAM,CAAC,CAAM;IACrB,OAAO,CAAC,YAAY,CAAa;IACjC,OAAO,CAAC,MAAM,CAAC,CAAY;IAC3B,OAAO,CAAC,SAAS,CAAS;gBAGd,SAAS,EAAE,mBAAmB,CAAC,kBAAkB,CAAC,EAClD,cAAc,CAAC,wBAAY,EAC5B,SAAS,CAAC,YAAW,uBAAuB,KAAK,IAAI,aAAA;IAMnD,YAAY,CAAC,MAAM,EAAE,gBAAgB,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAmBrE,OAAO,IAAI,OAAO,CAAC,MAAM,CAAC;YAwDzB,OAAO;IA0BR,IAAI,CAAC,OAAO,EAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;YAY9B,OAAO;IAwBR,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC;IAoB1C,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAOtB,MAAM,CAAC,MAAM,EAAE,uBAAuB,GAAG,OAAO,CAAC,IAAI,CAAC;CAOtE"}
\ No newline at end of file diff --git a/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/channels/MSC3903ECDHv2RendezvousChannel.js b/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/channels/MSC3903ECDHv2RendezvousChannel.js new file mode 100644 index 0000000..775257b --- /dev/null +++ b/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/channels/MSC3903ECDHv2RendezvousChannel.js @@ -0,0 +1,196 @@ +"use strict"; + +var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.MSC3903ECDHv2RendezvousChannel = void 0; +var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty")); +var _ = require(".."); +var _olmlib = require("../../crypto/olmlib"); +var _crypto = require("../../crypto/crypto"); +var _SASDecimal = require("../../crypto/verification/SASDecimal"); +var _NamespacedValue = require("../../NamespacedValue"); +/* +Copyright 2023 The Matrix.org Foundation C.I.C. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +const ECDH_V2 = new _NamespacedValue.UnstableValue("m.rendezvous.v2.curve25519-aes-sha256", "org.matrix.msc3903.rendezvous.v2.curve25519-aes-sha256"); +async function importKey(key) { + if (!_crypto.subtleCrypto) { + throw new Error("Web Crypto is not available"); + } + const imported = _crypto.subtleCrypto.importKey("raw", key, { + name: "AES-GCM" + }, false, ["encrypt", "decrypt"]); + return imported; +} + +/** + * Implementation of the unstable [MSC3903](https://github.com/matrix-org/matrix-spec-proposals/pull/3903) + * X25519/ECDH key agreement based secure rendezvous channel. + * Note that this is UNSTABLE and may have breaking changes without notice. + */ +class MSC3903ECDHv2RendezvousChannel { + constructor(transport, theirPublicKey, onFailure) { + this.transport = transport; + this.theirPublicKey = theirPublicKey; + this.onFailure = onFailure; + (0, _defineProperty2.default)(this, "olmSAS", void 0); + (0, _defineProperty2.default)(this, "ourPublicKey", void 0); + (0, _defineProperty2.default)(this, "aesKey", void 0); + (0, _defineProperty2.default)(this, "connected", false); + this.olmSAS = new global.Olm.SAS(); + this.ourPublicKey = (0, _olmlib.decodeBase64)(this.olmSAS.get_pubkey()); + } + async generateCode(intent) { + if (this.transport.ready) { + throw new Error("Code already generated"); + } + await this.transport.send({ + algorithm: ECDH_V2.name + }); + const rendezvous = { + rendezvous: { + algorithm: ECDH_V2.name, + key: (0, _olmlib.encodeUnpaddedBase64)(this.ourPublicKey), + transport: await this.transport.details() + }, + intent + }; + return rendezvous; + } + async connect() { + if (this.connected) { + throw new Error("Channel already connected"); + } + if (!this.olmSAS) { + throw new Error("Channel closed"); + } + const isInitiator = !this.theirPublicKey; + if (isInitiator) { + // wait for the other side to send us their public key + const rawRes = await this.transport.receive(); + if (!rawRes) { + throw new Error("No response from other device"); + } + const res = rawRes; + const { + key, + algorithm + } = res; + if (!algorithm || !ECDH_V2.matches(algorithm) || !key) { + throw new _.RendezvousError("Unsupported algorithm: " + algorithm, _.RendezvousFailureReason.UnsupportedAlgorithm); + } + this.theirPublicKey = (0, _olmlib.decodeBase64)(key); + } else { + // send our public key unencrypted + await this.transport.send({ + algorithm: ECDH_V2.name, + key: (0, _olmlib.encodeUnpaddedBase64)(this.ourPublicKey) + }); + } + this.connected = true; + this.olmSAS.set_their_key((0, _olmlib.encodeUnpaddedBase64)(this.theirPublicKey)); + const initiatorKey = isInitiator ? this.ourPublicKey : this.theirPublicKey; + const recipientKey = isInitiator ? this.theirPublicKey : this.ourPublicKey; + let aesInfo = ECDH_V2.name; + aesInfo += `|${(0, _olmlib.encodeUnpaddedBase64)(initiatorKey)}`; + aesInfo += `|${(0, _olmlib.encodeUnpaddedBase64)(recipientKey)}`; + const aesKeyBytes = this.olmSAS.generate_bytes(aesInfo, 32); + this.aesKey = await importKey(aesKeyBytes); + + // blank the bytes out to make sure not kept in memory + aesKeyBytes.fill(0); + const rawChecksum = this.olmSAS.generate_bytes(aesInfo, 5); + return (0, _SASDecimal.generateDecimalSas)(Array.from(rawChecksum)).join("-"); + } + async encrypt(data) { + if (!_crypto.subtleCrypto) { + throw new Error("Web Crypto is not available"); + } + const iv = new Uint8Array(32); + _crypto.crypto.getRandomValues(iv); + const encodedData = new _crypto.TextEncoder().encode(JSON.stringify(data)); + const ciphertext = await _crypto.subtleCrypto.encrypt({ + name: "AES-GCM", + iv, + tagLength: 128 + }, this.aesKey, encodedData); + return { + iv: (0, _olmlib.encodeUnpaddedBase64)(iv), + ciphertext: (0, _olmlib.encodeUnpaddedBase64)(ciphertext) + }; + } + async send(payload) { + if (!this.olmSAS) { + throw new Error("Channel closed"); + } + if (!this.aesKey) { + throw new Error("Shared secret not set up"); + } + return this.transport.send(await this.encrypt(payload)); + } + async decrypt({ + iv, + ciphertext + }) { + if (!ciphertext || !iv) { + throw new Error("Missing ciphertext and/or iv"); + } + const ciphertextBytes = (0, _olmlib.decodeBase64)(ciphertext); + if (!_crypto.subtleCrypto) { + throw new Error("Web Crypto is not available"); + } + const plaintext = await _crypto.subtleCrypto.decrypt({ + name: "AES-GCM", + iv: (0, _olmlib.decodeBase64)(iv), + tagLength: 128 + }, this.aesKey, ciphertextBytes); + return JSON.parse(new TextDecoder().decode(new Uint8Array(plaintext))); + } + async receive() { + if (!this.olmSAS) { + throw new Error("Channel closed"); + } + if (!this.aesKey) { + throw new Error("Shared secret not set up"); + } + const rawData = await this.transport.receive(); + if (!rawData) { + return undefined; + } + const data = rawData; + if (data.ciphertext && data.iv) { + return this.decrypt(data); + } + throw new Error("Data received but no ciphertext"); + } + async close() { + if (this.olmSAS) { + this.olmSAS.free(); + this.olmSAS = undefined; + } + } + async cancel(reason) { + try { + await this.transport.cancel(reason); + } finally { + await this.close(); + } + } +} +exports.MSC3903ECDHv2RendezvousChannel = MSC3903ECDHv2RendezvousChannel; +//# sourceMappingURL=MSC3903ECDHv2RendezvousChannel.js.map
\ No newline at end of file diff --git a/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/channels/MSC3903ECDHv2RendezvousChannel.js.map b/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/channels/MSC3903ECDHv2RendezvousChannel.js.map new file mode 100644 index 0000000..e1ec1d9 --- /dev/null +++ b/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/channels/MSC3903ECDHv2RendezvousChannel.js.map @@ -0,0 +1 @@ +{"version":3,"file":"MSC3903ECDHv2RendezvousChannel.js","names":["_","require","_olmlib","_crypto","_SASDecimal","_NamespacedValue","ECDH_V2","UnstableValue","importKey","key","subtleCrypto","Error","imported","name","MSC3903ECDHv2RendezvousChannel","constructor","transport","theirPublicKey","onFailure","_defineProperty2","default","olmSAS","global","Olm","SAS","ourPublicKey","decodeBase64","get_pubkey","generateCode","intent","ready","send","algorithm","rendezvous","encodeUnpaddedBase64","details","connect","connected","isInitiator","rawRes","receive","res","matches","RendezvousError","RendezvousFailureReason","UnsupportedAlgorithm","set_their_key","initiatorKey","recipientKey","aesInfo","aesKeyBytes","generate_bytes","aesKey","fill","rawChecksum","generateDecimalSas","Array","from","join","encrypt","data","iv","Uint8Array","crypto","getRandomValues","encodedData","TextEncoder","encode","JSON","stringify","ciphertext","tagLength","payload","decrypt","ciphertextBytes","plaintext","parse","TextDecoder","decode","rawData","undefined","close","free","cancel","reason","exports"],"sources":["../../../src/rendezvous/channels/MSC3903ECDHv2RendezvousChannel.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 { SAS } from \"@matrix-org/olm\";\n\nimport {\n RendezvousError,\n RendezvousCode,\n RendezvousIntent,\n RendezvousChannel,\n RendezvousTransportDetails,\n RendezvousTransport,\n RendezvousFailureReason,\n} from \"..\";\nimport { encodeUnpaddedBase64, decodeBase64 } from \"../../crypto/olmlib\";\nimport { crypto, subtleCrypto, TextEncoder } from \"../../crypto/crypto\";\nimport { generateDecimalSas } from \"../../crypto/verification/SASDecimal\";\nimport { UnstableValue } from \"../../NamespacedValue\";\n\nconst ECDH_V2 = new UnstableValue(\n \"m.rendezvous.v2.curve25519-aes-sha256\",\n \"org.matrix.msc3903.rendezvous.v2.curve25519-aes-sha256\",\n);\n\nexport interface ECDHv2RendezvousCode extends RendezvousCode {\n rendezvous: {\n transport: RendezvousTransportDetails;\n algorithm: typeof ECDH_V2.name | typeof ECDH_V2.altName;\n key: string;\n };\n}\n\nexport type MSC3903ECDHPayload = PlainTextPayload | EncryptedPayload;\n\nexport interface PlainTextPayload {\n algorithm: typeof ECDH_V2.name | typeof ECDH_V2.altName;\n key?: string;\n}\n\nexport interface EncryptedPayload {\n iv: string;\n ciphertext: string;\n}\n\nasync function importKey(key: Uint8Array): Promise<CryptoKey> {\n if (!subtleCrypto) {\n throw new Error(\"Web Crypto is not available\");\n }\n\n const imported = subtleCrypto.importKey(\"raw\", key, { name: \"AES-GCM\" }, false, [\"encrypt\", \"decrypt\"]);\n\n return imported;\n}\n\n/**\n * Implementation of the unstable [MSC3903](https://github.com/matrix-org/matrix-spec-proposals/pull/3903)\n * X25519/ECDH key agreement based secure rendezvous channel.\n * Note that this is UNSTABLE and may have breaking changes without notice.\n */\nexport class MSC3903ECDHv2RendezvousChannel<T> implements RendezvousChannel<T> {\n private olmSAS?: SAS;\n private ourPublicKey: Uint8Array;\n private aesKey?: CryptoKey;\n private connected = false;\n\n public constructor(\n private transport: RendezvousTransport<MSC3903ECDHPayload>,\n private theirPublicKey?: Uint8Array,\n public onFailure?: (reason: RendezvousFailureReason) => void,\n ) {\n this.olmSAS = new global.Olm.SAS();\n this.ourPublicKey = decodeBase64(this.olmSAS.get_pubkey());\n }\n\n public async generateCode(intent: RendezvousIntent): Promise<ECDHv2RendezvousCode> {\n if (this.transport.ready) {\n throw new Error(\"Code already generated\");\n }\n\n await this.transport.send({ algorithm: ECDH_V2.name });\n\n const rendezvous: ECDHv2RendezvousCode = {\n rendezvous: {\n algorithm: ECDH_V2.name,\n key: encodeUnpaddedBase64(this.ourPublicKey),\n transport: await this.transport.details(),\n },\n intent,\n };\n\n return rendezvous;\n }\n\n public async connect(): Promise<string> {\n if (this.connected) {\n throw new Error(\"Channel already connected\");\n }\n\n if (!this.olmSAS) {\n throw new Error(\"Channel closed\");\n }\n\n const isInitiator = !this.theirPublicKey;\n\n if (isInitiator) {\n // wait for the other side to send us their public key\n const rawRes = await this.transport.receive();\n if (!rawRes) {\n throw new Error(\"No response from other device\");\n }\n const res = rawRes as Partial<PlainTextPayload>;\n const { key, algorithm } = res;\n if (!algorithm || !ECDH_V2.matches(algorithm) || !key) {\n throw new RendezvousError(\n \"Unsupported algorithm: \" + algorithm,\n RendezvousFailureReason.UnsupportedAlgorithm,\n );\n }\n\n this.theirPublicKey = decodeBase64(key);\n } else {\n // send our public key unencrypted\n await this.transport.send({\n algorithm: ECDH_V2.name,\n key: encodeUnpaddedBase64(this.ourPublicKey),\n });\n }\n\n this.connected = true;\n\n this.olmSAS.set_their_key(encodeUnpaddedBase64(this.theirPublicKey!));\n\n const initiatorKey = isInitiator ? this.ourPublicKey : this.theirPublicKey!;\n const recipientKey = isInitiator ? this.theirPublicKey! : this.ourPublicKey;\n let aesInfo = ECDH_V2.name;\n aesInfo += `|${encodeUnpaddedBase64(initiatorKey)}`;\n aesInfo += `|${encodeUnpaddedBase64(recipientKey)}`;\n\n const aesKeyBytes = this.olmSAS.generate_bytes(aesInfo, 32);\n\n this.aesKey = await importKey(aesKeyBytes);\n\n // blank the bytes out to make sure not kept in memory\n aesKeyBytes.fill(0);\n\n const rawChecksum = this.olmSAS.generate_bytes(aesInfo, 5);\n return generateDecimalSas(Array.from(rawChecksum)).join(\"-\");\n }\n\n private async encrypt(data: T): Promise<MSC3903ECDHPayload> {\n if (!subtleCrypto) {\n throw new Error(\"Web Crypto is not available\");\n }\n\n const iv = new Uint8Array(32);\n crypto.getRandomValues(iv);\n\n const encodedData = new TextEncoder().encode(JSON.stringify(data));\n\n const ciphertext = await subtleCrypto.encrypt(\n {\n name: \"AES-GCM\",\n iv,\n tagLength: 128,\n },\n this.aesKey as CryptoKey,\n encodedData,\n );\n\n return {\n iv: encodeUnpaddedBase64(iv),\n ciphertext: encodeUnpaddedBase64(ciphertext),\n };\n }\n\n public async send(payload: T): Promise<void> {\n if (!this.olmSAS) {\n throw new Error(\"Channel closed\");\n }\n\n if (!this.aesKey) {\n throw new Error(\"Shared secret not set up\");\n }\n\n return this.transport.send(await this.encrypt(payload));\n }\n\n private async decrypt({ iv, ciphertext }: EncryptedPayload): Promise<Partial<T>> {\n if (!ciphertext || !iv) {\n throw new Error(\"Missing ciphertext and/or iv\");\n }\n\n const ciphertextBytes = decodeBase64(ciphertext);\n\n if (!subtleCrypto) {\n throw new Error(\"Web Crypto is not available\");\n }\n\n const plaintext = await subtleCrypto.decrypt(\n {\n name: \"AES-GCM\",\n iv: decodeBase64(iv),\n tagLength: 128,\n },\n this.aesKey as CryptoKey,\n ciphertextBytes,\n );\n\n return JSON.parse(new TextDecoder().decode(new Uint8Array(plaintext)));\n }\n\n public async receive(): Promise<Partial<T> | undefined> {\n if (!this.olmSAS) {\n throw new Error(\"Channel closed\");\n }\n if (!this.aesKey) {\n throw new Error(\"Shared secret not set up\");\n }\n\n const rawData = await this.transport.receive();\n if (!rawData) {\n return undefined;\n }\n const data = rawData as Partial<EncryptedPayload>;\n if (data.ciphertext && data.iv) {\n return this.decrypt(data as EncryptedPayload);\n }\n\n throw new Error(\"Data received but no ciphertext\");\n }\n\n public async close(): Promise<void> {\n if (this.olmSAS) {\n this.olmSAS.free();\n this.olmSAS = undefined;\n }\n }\n\n public async cancel(reason: RendezvousFailureReason): Promise<void> {\n try {\n await this.transport.cancel(reason);\n } finally {\n await this.close();\n }\n }\n}\n"],"mappings":";;;;;;;;AAkBA,IAAAA,CAAA,GAAAC,OAAA;AASA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AAC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U,SAAS,EAAE;IACf,CAAC,EACD,IAAI,CAACnB,MAAM,EACXsB,eAAe,CAClB;IAED,OAAON,IAAI,CAACQ,KAAK,CAAC,IAAIC,WAAW,EAAE,CAACC,MAAM,CAAC,IAAIhB,UAAU,CAACa,SAAS,CAAC,CAAC,CAAC;EAC1E;EAEA,MAAanC,OAAOA,CAAA,EAAoC;IACpD,IAAI,CAAC,IAAI,CAACnB,MAAM,EAAE;MACd,MAAM,IAAIV,KAAK,CAAC,gBAAgB,CAAC;IACrC;IACA,IAAI,CAAC,IAAI,CAACyC,MAAM,EAAE;MACd,MAAM,IAAIzC,KAAK,CAAC,0BAA0B,CAAC;IAC/C;IAEA,MAAMoE,OAAO,GAAG,MAAM,IAAI,CAAC/D,SAAS,CAACwB,OAAO,EAAE;IAC9C,IAAI,CAACuC,OAAO,EAAE;MACV,OAAOC,SAAS;IACpB;IACA,MAAMpB,IAAI,GAAGmB,OAAoC;IACjD,IAAInB,IAAI,CAACU,UAAU,IAAIV,IAAI,CAACC,EAAE,EAAE;MAC5B,OAAO,IAAI,CAACY,OAAO,CAACb,IAAI,CAAqB;IACjD;IAEA,MAAM,IAAIjD,KAAK,CAAC,iCAAiC,CAAC;EACtD;EAEA,MAAasE,KAAKA,CAAA,EAAkB;IAChC,IAAI,IAAI,CAAC5D,MAAM,EAAE;MACb,IAAI,CAACA,MAAM,CAAC6D,IAAI,EAAE;MAClB,IAAI,CAAC7D,MAAM,GAAG2D,SAAS;IAC3B;EACJ;EAEA,MAAaG,MAAMA,CAACC,MAA+B,EAAiB;IAChE,IAAI;MACA,MAAM,IAAI,CAACpE,SAAS,CAACmE,MAAM,CAACC,MAAM,CAAC;IACvC,CAAC,SAAS;MACN,MAAM,IAAI,CAACH,KAAK,EAAE;IACtB;EACJ;AACJ;AAACI,OAAA,CAAAvE,8BAAA,GAAAA,8BAAA"}
\ No newline at end of file diff --git a/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/channels/index.d.ts b/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/channels/index.d.ts new file mode 100644 index 0000000..04a448a --- /dev/null +++ b/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/channels/index.d.ts @@ -0,0 +1,2 @@ +export * from "./MSC3903ECDHv2RendezvousChannel"; +//# sourceMappingURL=index.d.ts.map
\ No newline at end of file diff --git a/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/channels/index.d.ts.map b/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/channels/index.d.ts.map new file mode 100644 index 0000000..5bbb544 --- /dev/null +++ b/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/channels/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/rendezvous/channels/index.ts"],"names":[],"mappings":"AAgBA,cAAc,kCAAkC,CAAC"}
\ No newline at end of file diff --git a/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/channels/index.js b/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/channels/index.js new file mode 100644 index 0000000..0c20fc0 --- /dev/null +++ b/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/channels/index.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +var _MSC3903ECDHv2RendezvousChannel = require("./MSC3903ECDHv2RendezvousChannel"); +Object.keys(_MSC3903ECDHv2RendezvousChannel).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _MSC3903ECDHv2RendezvousChannel[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _MSC3903ECDHv2RendezvousChannel[key]; + } + }); +}); +//# sourceMappingURL=index.js.map
\ No newline at end of file diff --git a/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/channels/index.js.map b/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/channels/index.js.map new file mode 100644 index 0000000..da2c50a --- /dev/null +++ b/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/channels/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","names":["_MSC3903ECDHv2RendezvousChannel","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get"],"sources":["../../../src/rendezvous/channels/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\nexport * from \"./MSC3903ECDHv2RendezvousChannel\";\n"],"mappings":";;;;;AAgBA,IAAAA,+BAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,+BAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,+BAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,+BAAA,CAAAK,GAAA;IAAA;EAAA;AAAA"}
\ No newline at end of file diff --git a/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/index.d.ts b/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/index.d.ts new file mode 100644 index 0000000..eb32638 --- /dev/null +++ b/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/index.d.ts @@ -0,0 +1,8 @@ +export * from "./MSC3906Rendezvous"; +export * from "./RendezvousChannel"; +export * from "./RendezvousCode"; +export * from "./RendezvousError"; +export * from "./RendezvousFailureReason"; +export * from "./RendezvousIntent"; +export * from "./RendezvousTransport"; +//# sourceMappingURL=index.d.ts.map
\ No newline at end of file diff --git a/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/index.d.ts.map b/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/index.d.ts.map new file mode 100644 index 0000000..b1efe4b --- /dev/null +++ b/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/rendezvous/index.ts"],"names":[],"mappings":"AAgBA,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC"}
\ No newline at end of file diff --git a/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/index.js b/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/index.js new file mode 100644 index 0000000..2c6212c --- /dev/null +++ b/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/index.js @@ -0,0 +1,83 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +var _MSC3906Rendezvous = require("./MSC3906Rendezvous"); +Object.keys(_MSC3906Rendezvous).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _MSC3906Rendezvous[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _MSC3906Rendezvous[key]; + } + }); +}); +var _RendezvousChannel = require("./RendezvousChannel"); +Object.keys(_RendezvousChannel).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _RendezvousChannel[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _RendezvousChannel[key]; + } + }); +}); +var _RendezvousCode = require("./RendezvousCode"); +Object.keys(_RendezvousCode).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _RendezvousCode[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _RendezvousCode[key]; + } + }); +}); +var _RendezvousError = require("./RendezvousError"); +Object.keys(_RendezvousError).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _RendezvousError[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _RendezvousError[key]; + } + }); +}); +var _RendezvousFailureReason = require("./RendezvousFailureReason"); +Object.keys(_RendezvousFailureReason).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _RendezvousFailureReason[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _RendezvousFailureReason[key]; + } + }); +}); +var _RendezvousIntent = require("./RendezvousIntent"); +Object.keys(_RendezvousIntent).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _RendezvousIntent[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _RendezvousIntent[key]; + } + }); +}); +var _RendezvousTransport = require("./RendezvousTransport"); +Object.keys(_RendezvousTransport).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _RendezvousTransport[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _RendezvousTransport[key]; + } + }); +}); +//# sourceMappingURL=index.js.map
\ No newline at end of file diff --git a/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/index.js.map b/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/index.js.map new file mode 100644 index 0000000..c51b1bb --- /dev/null +++ b/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","names":["_MSC3906Rendezvous","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_RendezvousChannel","_RendezvousCode","_RendezvousError","_RendezvousFailureReason","_RendezvousIntent","_RendezvousTransport"],"sources":["../../src/rendezvous/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\nexport * from \"./MSC3906Rendezvous\";\nexport * from \"./RendezvousChannel\";\nexport * from \"./RendezvousCode\";\nexport * from \"./RendezvousError\";\nexport * from \"./RendezvousFailureReason\";\nexport * from \"./RendezvousIntent\";\nexport * from \"./RendezvousTransport\";\n"],"mappings":";;;;;AAgBA,IAAAA,kBAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,kBAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,kBAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,kBAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,kBAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,kBAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,kBAAA,CAAAL,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAC,kBAAA,CAAAL,GAAA;IAAA;EAAA;AAAA;AACA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AAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAS,iBAAA,CAAAT,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAK,iBAAA,CAAAT,GAAA;IAAA;EAAA;AAAA;AACA,IAAAU,oBAAA,GAAAd,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAY,oBAAA,EAAAX,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAU,oBAAA,CAAAV,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAM,oBAAA,CAAAV,GAAA;IAAA;EAAA;AAAA"}
\ No newline at end of file diff --git a/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/transports/MSC3886SimpleHttpRendezvousTransport.d.ts b/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/transports/MSC3886SimpleHttpRendezvousTransport.d.ts new file mode 100644 index 0000000..4e3aee7 --- /dev/null +++ b/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/transports/MSC3886SimpleHttpRendezvousTransport.d.ts @@ -0,0 +1,35 @@ +import { RendezvousFailureListener, RendezvousFailureReason, RendezvousTransport, RendezvousTransportDetails } from ".."; +import { MatrixClient } from "../../matrix"; +export interface MSC3886SimpleHttpRendezvousTransportDetails extends RendezvousTransportDetails { + uri: string; +} +/** + * Implementation of the unstable [MSC3886](https://github.com/matrix-org/matrix-spec-proposals/pull/3886) + * simple HTTP rendezvous protocol. + * Note that this is UNSTABLE and may have breaking changes without notice. + */ +export declare class MSC3886SimpleHttpRendezvousTransport<T extends {}> implements RendezvousTransport<T> { + private uri?; + private etag?; + private expiresAt?; + private client; + private fallbackRzServer?; + private fetchFn?; + private cancelled; + private _ready; + onFailure?: RendezvousFailureListener; + constructor({ onFailure, client, fallbackRzServer, fetchFn, }: { + fetchFn?: typeof global.fetch; + onFailure?: RendezvousFailureListener; + client: MatrixClient; + fallbackRzServer?: string; + }); + get ready(): boolean; + details(): Promise<MSC3886SimpleHttpRendezvousTransportDetails>; + private fetch; + private getPostEndpoint; + send(data: T): Promise<void>; + receive(): Promise<Partial<T> | undefined>; + cancel(reason: RendezvousFailureReason): Promise<void>; +} +//# sourceMappingURL=MSC3886SimpleHttpRendezvousTransport.d.ts.map
\ No newline at end of file diff --git a/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/transports/MSC3886SimpleHttpRendezvousTransport.d.ts.map b/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/transports/MSC3886SimpleHttpRendezvousTransport.d.ts.map new file mode 100644 index 0000000..2203a15 --- /dev/null +++ b/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/transports/MSC3886SimpleHttpRendezvousTransport.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"MSC3886SimpleHttpRendezvousTransport.d.ts","sourceRoot":"","sources":["../../../src/rendezvous/transports/MSC3886SimpleHttpRendezvousTransport.ts"],"names":[],"mappings":"AAoBA,OAAO,EACH,yBAAyB,EACzB,uBAAuB,EACvB,mBAAmB,EACnB,0BAA0B,EAC7B,MAAM,IAAI,CAAC;AACZ,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAK5C,MAAM,WAAW,2CAA4C,SAAQ,0BAA0B;IAC3F,GAAG,EAAE,MAAM,CAAC;CACf;AAED;;;;GAIG;AACH,qBAAa,oCAAoC,CAAC,CAAC,SAAS,EAAE,CAAE,YAAW,mBAAmB,CAAC,CAAC,CAAC;IAC7F,OAAO,CAAC,GAAG,CAAC,CAAS;IACrB,OAAO,CAAC,IAAI,CAAC,CAAS;IACtB,OAAO,CAAC,SAAS,CAAC,CAAO;IACzB,OAAO,CAAC,MAAM,CAAe;IAC7B,OAAO,CAAC,gBAAgB,CAAC,CAAS;IAClC,OAAO,CAAC,OAAO,CAAC,CAAsB;IACtC,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,MAAM,CAAS;IAChB,SAAS,CAAC,EAAE,yBAAyB,CAAC;gBAE1B,EACf,SAAS,EACT,MAAM,EACN,gBAAgB,EAChB,OAAO,GACV,EAAE;QACC,OAAO,CAAC,EAAE,OAAO,MAAM,CAAC,KAAK,CAAC;QAC9B,SAAS,CAAC,EAAE,yBAAyB,CAAC;QACtC,MAAM,EAAE,YAAY,CAAC;QACrB,gBAAgB,CAAC,EAAE,MAAM,CAAC;KAC7B;IAOD,IAAW,KAAK,IAAI,OAAO,CAE1B;IAEY,OAAO,IAAI,OAAO,CAAC,2CAA2C,CAAC;IAW5E,OAAO,CAAC,KAAK;YAOC,eAAe;IAYhB,IAAI,CAAC,IAAI,EAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAwC5B,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC;IAiC1C,MAAM,CAAC,MAAM,EAAE,uBAAuB,GAAG,OAAO,CAAC,IAAI,CAAC;CAiBtE"}
\ No newline at end of file diff --git a/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/transports/MSC3886SimpleHttpRendezvousTransport.js b/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/transports/MSC3886SimpleHttpRendezvousTransport.js new file mode 100644 index 0000000..d9d5059 --- /dev/null +++ b/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/transports/MSC3886SimpleHttpRendezvousTransport.js @@ -0,0 +1,183 @@ +"use strict"; + +var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.MSC3886SimpleHttpRendezvousTransport = void 0; +var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty")); +var _matrixEventsSdk = require("matrix-events-sdk"); +var _logger = require("../../logger"); +var _utils = require("../../utils"); +var _ = require(".."); +var _httpApi = require("../../http-api"); +/* +Copyright 2022 The Matrix.org Foundation C.I.C. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +const TYPE = new _matrixEventsSdk.UnstableValue("http.v1", "org.matrix.msc3886.http.v1"); +/** + * Implementation of the unstable [MSC3886](https://github.com/matrix-org/matrix-spec-proposals/pull/3886) + * simple HTTP rendezvous protocol. + * Note that this is UNSTABLE and may have breaking changes without notice. + */ +class MSC3886SimpleHttpRendezvousTransport { + constructor({ + onFailure, + client, + fallbackRzServer, + fetchFn + }) { + (0, _defineProperty2.default)(this, "uri", void 0); + (0, _defineProperty2.default)(this, "etag", void 0); + (0, _defineProperty2.default)(this, "expiresAt", void 0); + (0, _defineProperty2.default)(this, "client", void 0); + (0, _defineProperty2.default)(this, "fallbackRzServer", void 0); + (0, _defineProperty2.default)(this, "fetchFn", void 0); + (0, _defineProperty2.default)(this, "cancelled", false); + (0, _defineProperty2.default)(this, "_ready", false); + (0, _defineProperty2.default)(this, "onFailure", void 0); + this.fetchFn = fetchFn; + this.onFailure = onFailure; + this.client = client; + this.fallbackRzServer = fallbackRzServer; + } + get ready() { + return this._ready; + } + async details() { + if (!this.uri) { + throw new Error("Rendezvous not set up"); + } + return { + type: TYPE.name, + uri: this.uri + }; + } + fetch(resource, options) { + if (this.fetchFn) { + return this.fetchFn(resource, options); + } + return global.fetch(resource, options); + } + async getPostEndpoint() { + try { + if (await this.client.doesServerSupportUnstableFeature("org.matrix.msc3886")) { + return `${this.client.baseUrl}${_httpApi.ClientPrefix.Unstable}/org.matrix.msc3886/rendezvous`; + } + } catch (err) { + _logger.logger.warn("Failed to get unstable features", err); + } + return this.fallbackRzServer; + } + async send(data) { + var _this$uri, _res$headers$get; + if (this.cancelled) { + return; + } + const method = this.uri ? "PUT" : "POST"; + const uri = (_this$uri = this.uri) !== null && _this$uri !== void 0 ? _this$uri : await this.getPostEndpoint(); + if (!uri) { + throw new Error("Invalid rendezvous URI"); + } + const headers = { + "content-type": "application/json" + }; + if (this.etag) { + headers["if-match"] = this.etag; + } + const res = await this.fetch(uri, { + method, + headers, + body: JSON.stringify(data) + }); + if (res.status === 404) { + return this.cancel(_.RendezvousFailureReason.Unknown); + } + this.etag = (_res$headers$get = res.headers.get("etag")) !== null && _res$headers$get !== void 0 ? _res$headers$get : undefined; + if (method === "POST") { + var _res$url; + const location = res.headers.get("location"); + if (!location) { + throw new Error("No rendezvous URI given"); + } + const expires = res.headers.get("expires"); + if (expires) { + this.expiresAt = new Date(expires); + } + // we would usually expect the final `url` to be set by a proper fetch implementation. + // however, if a polyfill based on XHR is used it won't be set, we we use existing URI as fallback + const baseUrl = (_res$url = res.url) !== null && _res$url !== void 0 ? _res$url : uri; + // resolve location header which could be relative or absolute + this.uri = new URL(location, `${baseUrl}${baseUrl.endsWith("/") ? "" : "/"}`).href; + this._ready = true; + } + } + async receive() { + if (!this.uri) { + throw new Error("Rendezvous not set up"); + } + // eslint-disable-next-line no-constant-condition + while (true) { + if (this.cancelled) { + return undefined; + } + const headers = {}; + if (this.etag) { + headers["if-none-match"] = this.etag; + } + const poll = await this.fetch(this.uri, { + method: "GET", + headers + }); + if (poll.status === 404) { + this.cancel(_.RendezvousFailureReason.Unknown); + return undefined; + } + + // rely on server expiring the channel rather than checking ourselves + + if (poll.headers.get("content-type") !== "application/json") { + var _poll$headers$get; + this.etag = (_poll$headers$get = poll.headers.get("etag")) !== null && _poll$headers$get !== void 0 ? _poll$headers$get : undefined; + } else if (poll.status === 200) { + var _poll$headers$get2; + this.etag = (_poll$headers$get2 = poll.headers.get("etag")) !== null && _poll$headers$get2 !== void 0 ? _poll$headers$get2 : undefined; + return poll.json(); + } + await (0, _utils.sleep)(1000); + } + } + async cancel(reason) { + var _this$onFailure; + if (reason === _.RendezvousFailureReason.Unknown && this.expiresAt && this.expiresAt.getTime() < Date.now()) { + reason = _.RendezvousFailureReason.Expired; + } + this.cancelled = true; + this._ready = false; + (_this$onFailure = this.onFailure) === null || _this$onFailure === void 0 ? void 0 : _this$onFailure.call(this, reason); + if (this.uri && reason === _.RendezvousFailureReason.UserDeclined) { + try { + await this.fetch(this.uri, { + method: "DELETE" + }); + } catch (e) { + _logger.logger.warn(e); + } + } + } +} +exports.MSC3886SimpleHttpRendezvousTransport = MSC3886SimpleHttpRendezvousTransport; +//# sourceMappingURL=MSC3886SimpleHttpRendezvousTransport.js.map
\ No newline at end of file diff --git a/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/transports/MSC3886SimpleHttpRendezvousTransport.js.map b/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/transports/MSC3886SimpleHttpRendezvousTransport.js.map new file mode 100644 index 0000000..62bb8ac --- /dev/null +++ b/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/transports/MSC3886SimpleHttpRendezvousTransport.js.map @@ -0,0 +1 @@ +{"version":3,"file":"MSC3886SimpleHttpRendezvousTransport.js","names":["_matrixEventsSdk","require","_logger","_utils","_","_httpApi","TYPE","UnstableValue","MSC3886SimpleHttpRendezvousTransport","constructor","onFailure","client","fallbackRzServer","fetchFn","_defineProperty2","default","ready","_ready","details","uri","Error","type","name","fetch","resource","options","global","getPostEndpoint","doesServerSupportUnstableFeature","baseUrl","ClientPrefix","Unstable","err","logger","warn","send","data","_this$uri","_res$headers$get","cancelled","method","headers","etag","res","body","JSON","stringify","status","cancel","RendezvousFailureReason","Unknown","get","undefined","_res$url","location","expires","expiresAt","Date","url","URL","endsWith","href","receive","poll","_poll$headers$get","_poll$headers$get2","json","sleep","reason","_this$onFailure","getTime","now","Expired","call","UserDeclined","e","exports"],"sources":["../../../src/rendezvous/transports/MSC3886SimpleHttpRendezvousTransport.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 { UnstableValue } from \"matrix-events-sdk\";\n\nimport { logger } from \"../../logger\";\nimport { sleep } from \"../../utils\";\nimport {\n RendezvousFailureListener,\n RendezvousFailureReason,\n RendezvousTransport,\n RendezvousTransportDetails,\n} from \"..\";\nimport { MatrixClient } from \"../../matrix\";\nimport { ClientPrefix } from \"../../http-api\";\n\nconst TYPE = new UnstableValue(\"http.v1\", \"org.matrix.msc3886.http.v1\");\n\nexport interface MSC3886SimpleHttpRendezvousTransportDetails extends RendezvousTransportDetails {\n uri: string;\n}\n\n/**\n * Implementation of the unstable [MSC3886](https://github.com/matrix-org/matrix-spec-proposals/pull/3886)\n * simple HTTP rendezvous protocol.\n * Note that this is UNSTABLE and may have breaking changes without notice.\n */\nexport class MSC3886SimpleHttpRendezvousTransport<T extends {}> implements RendezvousTransport<T> {\n private uri?: string;\n private etag?: string;\n private expiresAt?: Date;\n private client: MatrixClient;\n private fallbackRzServer?: string;\n private fetchFn?: typeof global.fetch;\n private cancelled = false;\n private _ready = false;\n public onFailure?: RendezvousFailureListener;\n\n public constructor({\n onFailure,\n client,\n fallbackRzServer,\n fetchFn,\n }: {\n fetchFn?: typeof global.fetch;\n onFailure?: RendezvousFailureListener;\n client: MatrixClient;\n fallbackRzServer?: string;\n }) {\n this.fetchFn = fetchFn;\n this.onFailure = onFailure;\n this.client = client;\n this.fallbackRzServer = fallbackRzServer;\n }\n\n public get ready(): boolean {\n return this._ready;\n }\n\n public async details(): Promise<MSC3886SimpleHttpRendezvousTransportDetails> {\n if (!this.uri) {\n throw new Error(\"Rendezvous not set up\");\n }\n\n return {\n type: TYPE.name,\n uri: this.uri,\n };\n }\n\n private fetch(resource: URL | string, options?: RequestInit): ReturnType<typeof global.fetch> {\n if (this.fetchFn) {\n return this.fetchFn(resource, options);\n }\n return global.fetch(resource, options);\n }\n\n private async getPostEndpoint(): Promise<string | undefined> {\n try {\n if (await this.client.doesServerSupportUnstableFeature(\"org.matrix.msc3886\")) {\n return `${this.client.baseUrl}${ClientPrefix.Unstable}/org.matrix.msc3886/rendezvous`;\n }\n } catch (err) {\n logger.warn(\"Failed to get unstable features\", err);\n }\n\n return this.fallbackRzServer;\n }\n\n public async send(data: T): Promise<void> {\n if (this.cancelled) {\n return;\n }\n const method = this.uri ? \"PUT\" : \"POST\";\n const uri = this.uri ?? (await this.getPostEndpoint());\n\n if (!uri) {\n throw new Error(\"Invalid rendezvous URI\");\n }\n\n const headers: Record<string, string> = { \"content-type\": \"application/json\" };\n if (this.etag) {\n headers[\"if-match\"] = this.etag;\n }\n\n const res = await this.fetch(uri, { method, headers, body: JSON.stringify(data) });\n if (res.status === 404) {\n return this.cancel(RendezvousFailureReason.Unknown);\n }\n this.etag = res.headers.get(\"etag\") ?? undefined;\n\n if (method === \"POST\") {\n const location = res.headers.get(\"location\");\n if (!location) {\n throw new Error(\"No rendezvous URI given\");\n }\n const expires = res.headers.get(\"expires\");\n if (expires) {\n this.expiresAt = new Date(expires);\n }\n // we would usually expect the final `url` to be set by a proper fetch implementation.\n // however, if a polyfill based on XHR is used it won't be set, we we use existing URI as fallback\n const baseUrl = res.url ?? uri;\n // resolve location header which could be relative or absolute\n this.uri = new URL(location, `${baseUrl}${baseUrl.endsWith(\"/\") ? \"\" : \"/\"}`).href;\n this._ready = true;\n }\n }\n\n public async receive(): Promise<Partial<T> | undefined> {\n if (!this.uri) {\n throw new Error(\"Rendezvous not set up\");\n }\n // eslint-disable-next-line no-constant-condition\n while (true) {\n if (this.cancelled) {\n return undefined;\n }\n\n const headers: Record<string, string> = {};\n if (this.etag) {\n headers[\"if-none-match\"] = this.etag;\n }\n const poll = await this.fetch(this.uri, { method: \"GET\", headers });\n\n if (poll.status === 404) {\n this.cancel(RendezvousFailureReason.Unknown);\n return undefined;\n }\n\n // rely on server expiring the channel rather than checking ourselves\n\n if (poll.headers.get(\"content-type\") !== \"application/json\") {\n this.etag = poll.headers.get(\"etag\") ?? undefined;\n } else if (poll.status === 200) {\n this.etag = poll.headers.get(\"etag\") ?? undefined;\n return poll.json();\n }\n await sleep(1000);\n }\n }\n\n public async cancel(reason: RendezvousFailureReason): Promise<void> {\n if (reason === RendezvousFailureReason.Unknown && this.expiresAt && this.expiresAt.getTime() < Date.now()) {\n reason = RendezvousFailureReason.Expired;\n }\n\n this.cancelled = true;\n this._ready = false;\n this.onFailure?.(reason);\n\n if (this.uri && reason === RendezvousFailureReason.UserDeclined) {\n try {\n await this.fetch(this.uri, { method: \"DELETE\" });\n } catch (e) {\n logger.warn(e);\n }\n }\n }\n}\n"],"mappings":";;;;;;;;AAgBA,IAAAA,gBAAA,GAAAC,OAAA;AAEA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,CAAA,GAAAH,OAAA;AAOA,IAAAI,QAAA,GAAAJ,OAAA;AA3BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAeA,MAAMK,IAAI,GAAG,IAAIC,8BAAa,CAAC,SAAS,EAAE,4BAA4B,CAAC;AAMvE;AACA;AACA;AACA;AACA;AACO,MAAMC,oCAAoC,CAAiD;EAWvFC,WAAWA,CAAC;IACfC,SAAS;IACTC,MAAM;IACNC,gBAAgB;IAChBC;EAMJ,CAAC,EAAE;IAAA,IAAAC,gBAAA,CAAAC,OAAA;IAAA,IAAAD,gBAAA,CAAAC,OAAA;IAAA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IACJ;EACJ;AACJ;AAACC,OAAA,CAAApE,oCAAA,GAAAA,oCAAA"}
\ No newline at end of file diff --git a/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/transports/index.d.ts b/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/transports/index.d.ts new file mode 100644 index 0000000..45d4836 --- /dev/null +++ b/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/transports/index.d.ts @@ -0,0 +1,2 @@ +export * from "./MSC3886SimpleHttpRendezvousTransport"; +//# sourceMappingURL=index.d.ts.map
\ No newline at end of file diff --git a/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/transports/index.d.ts.map b/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/transports/index.d.ts.map new file mode 100644 index 0000000..98e0fb5 --- /dev/null +++ b/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/transports/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/rendezvous/transports/index.ts"],"names":[],"mappings":"AAgBA,cAAc,wCAAwC,CAAC"}
\ No newline at end of file diff --git a/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/transports/index.js b/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/transports/index.js new file mode 100644 index 0000000..ab887ba --- /dev/null +++ b/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/transports/index.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +var _MSC3886SimpleHttpRendezvousTransport = require("./MSC3886SimpleHttpRendezvousTransport"); +Object.keys(_MSC3886SimpleHttpRendezvousTransport).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _MSC3886SimpleHttpRendezvousTransport[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _MSC3886SimpleHttpRendezvousTransport[key]; + } + }); +}); +//# sourceMappingURL=index.js.map
\ No newline at end of file diff --git a/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/transports/index.js.map b/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/transports/index.js.map new file mode 100644 index 0000000..fd93d4a --- /dev/null +++ b/includes/external/matrix/node_modules/matrix-js-sdk/lib/rendezvous/transports/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","names":["_MSC3886SimpleHttpRendezvousTransport","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get"],"sources":["../../../src/rendezvous/transports/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\nexport * from \"./MSC3886SimpleHttpRendezvousTransport\";\n"],"mappings":";;;;;AAgBA,IAAAA,qCAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,qCAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,qCAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,qCAAA,CAAAK,GAAA;IAAA;EAAA;AAAA"}
\ No newline at end of file |