From 6c475d9b54c724946a0b31b2a93da96a6bb4fbfe Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Mon, 31 Oct 2022 16:50:15 +0000 Subject: [PATCH 01/11] Fix JSDoc (#2825) --- src/client.ts | 9 --------- src/http-api/index.ts | 9 --------- 2 files changed, 18 deletions(-) diff --git a/src/client.ts b/src/client.ts index 67d56f7b9..7652845d9 100644 --- a/src/client.ts +++ b/src/client.ts @@ -7915,15 +7915,6 @@ export class MatrixClient extends TypedEventEmitterfile.type, or applicaton/octet-stream. * - * @param {boolean=} opts.rawResponse Return the raw body, rather than - * parsing the JSON. Defaults to false (except on node.js, where it - * defaults to true for backwards compatibility). - * - * @param {boolean=} opts.onlyContentUri Just return the content URI, - * rather than the whole body. Defaults to false (except on browsers, - * where it defaults to true for backwards compatibility). Ignored if - * opts.rawResponse is true. - * * @param {Function=} opts.progressHandler Optional. Called when a chunk of * data has been uploaded, with an object containing the fields `loaded` * (number of bytes transferred) and `total` (total size, if known). diff --git a/src/http-api/index.ts b/src/http-api/index.ts index 1656c04ae..0c9b0b623 100644 --- a/src/http-api/index.ts +++ b/src/http-api/index.ts @@ -51,15 +51,6 @@ export class MatrixHttpApi extends FetchHttpApi { * @param {string=} opts.type Content-type for the upload. Defaults to * file.type, or application/octet-stream. * - * @param {boolean=} opts.rawResponse Return the raw body, rather than - * parsing the JSON. Defaults to false (except on node.js, where it - * defaults to true for backwards compatibility). - * - * @param {boolean=} opts.onlyContentUri Just return the content URI, - * rather than the whole body. Defaults to false (except on browsers, - * where it defaults to true for backwards compatibility). Ignored if - * opts.rawResponse is true. - * * @param {Function=} opts.progressHandler Optional. Called when a chunk of * data has been uploaded, with an object containing the fields `loaded` * (number of bytes transferred) and `total` (total size, if known). From db33f396b84e3019068a363a35c85b1b9d111439 Mon Sep 17 00:00:00 2001 From: ElementRobot Date: Mon, 31 Oct 2022 17:00:45 +0000 Subject: [PATCH 02/11] [Backport staging] Fix JSDoc (#2827) Co-authored-by: Michael Telatynski <7t3chguy@gmail.com> --- src/client.ts | 9 --------- src/http-api/index.ts | 9 --------- 2 files changed, 18 deletions(-) diff --git a/src/client.ts b/src/client.ts index e501f7d20..256d49e3c 100644 --- a/src/client.ts +++ b/src/client.ts @@ -7703,15 +7703,6 @@ export class MatrixClient extends TypedEventEmitterfile.type, or applicaton/octet-stream. * - * @param {boolean=} opts.rawResponse Return the raw body, rather than - * parsing the JSON. Defaults to false (except on node.js, where it - * defaults to true for backwards compatibility). - * - * @param {boolean=} opts.onlyContentUri Just return the content URI, - * rather than the whole body. Defaults to false (except on browsers, - * where it defaults to true for backwards compatibility). Ignored if - * opts.rawResponse is true. - * * @param {Function=} opts.progressHandler Optional. Called when a chunk of * data has been uploaded, with an object containing the fields `loaded` * (number of bytes transferred) and `total` (total size, if known). diff --git a/src/http-api/index.ts b/src/http-api/index.ts index 1656c04ae..0c9b0b623 100644 --- a/src/http-api/index.ts +++ b/src/http-api/index.ts @@ -51,15 +51,6 @@ export class MatrixHttpApi extends FetchHttpApi { * @param {string=} opts.type Content-type for the upload. Defaults to * file.type, or application/octet-stream. * - * @param {boolean=} opts.rawResponse Return the raw body, rather than - * parsing the JSON. Defaults to false (except on node.js, where it - * defaults to true for backwards compatibility). - * - * @param {boolean=} opts.onlyContentUri Just return the content URI, - * rather than the whole body. Defaults to false (except on browsers, - * where it defaults to true for backwards compatibility). Ignored if - * opts.rawResponse is true. - * * @param {Function=} opts.progressHandler Optional. Called when a chunk of * data has been uploaded, with an object containing the fields `loaded` * (number of bytes transferred) and `total` (total size, if known). From 646b3a69fe24564ca736da45730c96c04488f371 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Mon, 31 Oct 2022 17:08:35 +0000 Subject: [PATCH 03/11] Fix authedRequest including `Authorization: Bearer undefined` for password resets (#2822) --- spec/unit/http-api/fetch.spec.ts | 10 ++++++++++ src/client.ts | 2 +- src/http-api/fetch.ts | 24 +++++++++++++----------- 3 files changed, 24 insertions(+), 12 deletions(-) diff --git a/spec/unit/http-api/fetch.spec.ts b/spec/unit/http-api/fetch.spec.ts index e100f2d93..1af230211 100644 --- a/spec/unit/http-api/fetch.spec.ts +++ b/spec/unit/http-api/fetch.spec.ts @@ -220,4 +220,14 @@ describe("FetchHttpApi", () => { expect(api.authedRequest(Method.Get, "/path")).rejects.toThrow("Ye shall ask for consent"), ]); }); + + describe("authedRequest", () => { + it("should not include token if unset", () => { + const fetchFn = jest.fn(); + const emitter = new TypedEventEmitter(); + const api = new FetchHttpApi(emitter, { baseUrl, prefix, fetchFn }); + api.authedRequest(Method.Post, "/account/password"); + expect(fetchFn.mock.calls[0][1].headers.Authorization).toBeUndefined(); + }); + }); }); diff --git a/src/client.ts b/src/client.ts index 7652845d9..753b0a6f6 100644 --- a/src/client.ts +++ b/src/client.ts @@ -8087,7 +8087,7 @@ export class MatrixClient extends TypedEventEmitter { diff --git a/src/http-api/fetch.ts b/src/http-api/fetch.ts index bce1fbd96..35698bb62 100644 --- a/src/http-api/fetch.ts +++ b/src/http-api/fetch.ts @@ -143,18 +143,20 @@ export class FetchHttpApi { ): Promise> { if (!queryParams) queryParams = {}; - if (this.opts.useAuthorizationHeader) { - if (!opts.headers) { - opts.headers = {}; + if (this.opts.accessToken) { + if (this.opts.useAuthorizationHeader) { + if (!opts.headers) { + opts.headers = {}; + } + if (!opts.headers.Authorization) { + opts.headers.Authorization = "Bearer " + this.opts.accessToken; + } + if (queryParams.access_token) { + delete queryParams.access_token; + } + } else if (!queryParams.access_token) { + queryParams.access_token = this.opts.accessToken; } - if (!opts.headers.Authorization) { - opts.headers.Authorization = "Bearer " + this.opts.accessToken; - } - if (queryParams.access_token) { - delete queryParams.access_token; - } - } else if (!queryParams.access_token) { - queryParams.access_token = this.opts.accessToken; } const requestPromise = this.request(method, path, queryParams, body, opts); From 545a74364d39e7a2bcfd1e63a7f9cc80bbbc917f Mon Sep 17 00:00:00 2001 From: ElementRobot Date: Mon, 31 Oct 2022 17:14:06 +0000 Subject: [PATCH 04/11] [Backport staging] Fix authedRequest including `Authorization: Bearer undefined` for password resets (#2829) Co-authored-by: Michael Telatynski <7t3chguy@gmail.com> --- spec/unit/http-api/fetch.spec.ts | 10 ++++++++++ src/client.ts | 2 +- src/http-api/fetch.ts | 24 +++++++++++++----------- 3 files changed, 24 insertions(+), 12 deletions(-) diff --git a/spec/unit/http-api/fetch.spec.ts b/spec/unit/http-api/fetch.spec.ts index e100f2d93..1af230211 100644 --- a/spec/unit/http-api/fetch.spec.ts +++ b/spec/unit/http-api/fetch.spec.ts @@ -220,4 +220,14 @@ describe("FetchHttpApi", () => { expect(api.authedRequest(Method.Get, "/path")).rejects.toThrow("Ye shall ask for consent"), ]); }); + + describe("authedRequest", () => { + it("should not include token if unset", () => { + const fetchFn = jest.fn(); + const emitter = new TypedEventEmitter(); + const api = new FetchHttpApi(emitter, { baseUrl, prefix, fetchFn }); + api.authedRequest(Method.Post, "/account/password"); + expect(fetchFn.mock.calls[0][1].headers.Authorization).toBeUndefined(); + }); + }); }); diff --git a/src/client.ts b/src/client.ts index 256d49e3c..fdf39deff 100644 --- a/src/client.ts +++ b/src/client.ts @@ -7875,7 +7875,7 @@ export class MatrixClient extends TypedEventEmitter { diff --git a/src/http-api/fetch.ts b/src/http-api/fetch.ts index 4fecaaecf..290e99d69 100644 --- a/src/http-api/fetch.ts +++ b/src/http-api/fetch.ts @@ -143,18 +143,20 @@ export class FetchHttpApi { ): Promise> { if (!queryParams) queryParams = {}; - if (this.opts.useAuthorizationHeader) { - if (!opts.headers) { - opts.headers = {}; + if (this.opts.accessToken) { + if (this.opts.useAuthorizationHeader) { + if (!opts.headers) { + opts.headers = {}; + } + if (!opts.headers.Authorization) { + opts.headers.Authorization = "Bearer " + this.opts.accessToken; + } + if (queryParams.access_token) { + delete queryParams.access_token; + } + } else if (!queryParams.access_token) { + queryParams.access_token = this.opts.accessToken; } - if (!opts.headers.Authorization) { - opts.headers.Authorization = "Bearer " + this.opts.accessToken; - } - if (queryParams.access_token) { - delete queryParams.access_token; - } - } else if (!queryParams.access_token) { - queryParams.access_token = this.opts.accessToken; } const requestPromise = this.request(method, path, queryParams, body, opts); From 1f3ae4bde2955f31361f733b20375221383963b0 Mon Sep 17 00:00:00 2001 From: Germain Date: Mon, 31 Oct 2022 17:44:52 +0000 Subject: [PATCH 05/11] Catch server versions API call exception when starting the client (#2828) --- spec/integ/matrix-client-syncing.spec.ts | 10 ++++++++ src/client.ts | 31 +++++++++++++++--------- 2 files changed, 30 insertions(+), 11 deletions(-) diff --git a/spec/integ/matrix-client-syncing.spec.ts b/spec/integ/matrix-client-syncing.spec.ts index 3609e8a0f..418e2d16a 100644 --- a/spec/integ/matrix-client-syncing.spec.ts +++ b/spec/integ/matrix-client-syncing.spec.ts @@ -274,6 +274,16 @@ describe("MatrixClient syncing", () => { expect(fires).toBe(1); }); + + it("should work when all network calls fail", async () => { + httpBackend!.expectedRequests = []; + httpBackend!.when("GET", "").fail(0, new Error("CORS or something")); + const prom = client!.startClient(); + await Promise.all([ + expect(prom).resolves.toBeUndefined(), + httpBackend!.flushAllExpected(), + ]); + }); }); describe("initial sync", () => { diff --git a/src/client.ts b/src/client.ts index 753b0a6f6..7e37c22af 100644 --- a/src/client.ts +++ b/src/client.ts @@ -1193,16 +1193,18 @@ export class MatrixClient extends TypedEventEmitter} The server /versions response */ - public getVersions(): Promise { + public async getVersions(): Promise { if (this.serverVersionsPromise) { return this.serverVersionsPromise; } @@ -6724,13 +6726,20 @@ export class MatrixClient extends TypedEventEmitter { + ).catch(e => { // Need to unset this if it fails, otherwise we'll never retry this.serverVersionsPromise = undefined; // but rethrow the exception to anything that was waiting throw e; }); + const serverVersions = await this.serverVersionsPromise; + this.canSupport = await buildFeatureSupportMap(serverVersions); + + // We can set flag values to use their stable or unstable version + const support = this.canSupport.get(Feature.ThreadUnreadNotifications); + UNREAD_THREAD_NOTIFICATIONS.setPreferUnstable(support === ServerSupport.Unstable); + return this.serverVersionsPromise; } From 9fa6616052324c3b04ab8d8f709a24633b510123 Mon Sep 17 00:00:00 2001 From: Faye Duxovni Date: Mon, 31 Oct 2022 14:21:27 -0400 Subject: [PATCH 06/11] Fix default behavior of Room.getBlacklistUnverifiedDevices (#2830) --- spec/unit/room.spec.ts | 11 +++++++++++ src/crypto/algorithms/megolm.ts | 5 +++-- src/models/room.ts | 5 +++-- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/spec/unit/room.spec.ts b/spec/unit/room.spec.ts index ed15b61fe..d9a30e10c 100644 --- a/spec/unit/room.spec.ts +++ b/spec/unit/room.spec.ts @@ -2926,4 +2926,15 @@ describe("Room", function() { expect(room.getPendingEvent(ev.getId()!)).toBe(ev); } }); + + describe("getBlacklistUnverifiedDevices", () => { + it("defaults to null", () => { + expect(room.getBlacklistUnverifiedDevices()).toBeNull(); + }); + + it("is updated by setBlacklistUnverifiedDevices", () => { + room.setBlacklistUnverifiedDevices(false); + expect(room.getBlacklistUnverifiedDevices()).toBe(false); + }); + }); }); diff --git a/src/crypto/algorithms/megolm.ts b/src/crypto/algorithms/megolm.ts index 170172a34..7fcbae582 100644 --- a/src/crypto/algorithms/megolm.ts +++ b/src/crypto/algorithms/megolm.ts @@ -1170,8 +1170,9 @@ class MegolmEncryption extends EncryptionAlgorithm { // The global value is treated as a default for when rooms don't specify a value. let isBlacklisting = this.crypto.getGlobalBlacklistUnverifiedDevices(); - if (typeof room.getBlacklistUnverifiedDevices() === 'boolean') { - isBlacklisting = room.getBlacklistUnverifiedDevices(); + const isRoomBlacklisting = room.getBlacklistUnverifiedDevices(); + if (typeof isRoomBlacklisting === 'boolean') { + isBlacklisting = isRoomBlacklisting; } // We are happy to use a cached version here: we assume that if we already diff --git a/src/models/room.ts b/src/models/room.ts index a2a1e7140..132908e33 100644 --- a/src/models/room.ts +++ b/src/models/room.ts @@ -1325,8 +1325,9 @@ export class Room extends ReadReceipt { * @return {Boolean} true if blacklisting unverified devices, null * if the global value should be used for this room. */ - public getBlacklistUnverifiedDevices(): boolean { - return !!this.blacklistUnverifiedDevices; + public getBlacklistUnverifiedDevices(): boolean | null { + if (this.blacklistUnverifiedDevices === undefined) return null; + return this.blacklistUnverifiedDevices; } /** From 7d7803380cbb22c7e3637ea5cc384a49b1bf3f91 Mon Sep 17 00:00:00 2001 From: ElementRobot Date: Tue, 1 Nov 2022 08:47:47 +0000 Subject: [PATCH 07/11] [Backport staging] Fix default behavior of Room.getBlacklistUnverifiedDevices (#2831) Co-authored-by: Faye Duxovni --- spec/unit/room.spec.ts | 11 +++++++++++ src/crypto/algorithms/megolm.ts | 5 +++-- src/models/room.ts | 5 +++-- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/spec/unit/room.spec.ts b/spec/unit/room.spec.ts index 5ddda62d7..5a3fb9c24 100644 --- a/spec/unit/room.spec.ts +++ b/spec/unit/room.spec.ts @@ -2737,4 +2737,15 @@ describe("Room", function() { expect(room.getPendingEvent(ev.getId())).toBe(ev); } }); + + describe("getBlacklistUnverifiedDevices", () => { + it("defaults to null", () => { + expect(room.getBlacklistUnverifiedDevices()).toBeNull(); + }); + + it("is updated by setBlacklistUnverifiedDevices", () => { + room.setBlacklistUnverifiedDevices(false); + expect(room.getBlacklistUnverifiedDevices()).toBe(false); + }); + }); }); diff --git a/src/crypto/algorithms/megolm.ts b/src/crypto/algorithms/megolm.ts index a831c5650..3431ec971 100644 --- a/src/crypto/algorithms/megolm.ts +++ b/src/crypto/algorithms/megolm.ts @@ -1134,8 +1134,9 @@ class MegolmEncryption extends EncryptionAlgorithm { // The global value is treated as a default for when rooms don't specify a value. let isBlacklisting = this.crypto.getGlobalBlacklistUnverifiedDevices(); - if (typeof room.getBlacklistUnverifiedDevices() === 'boolean') { - isBlacklisting = room.getBlacklistUnverifiedDevices(); + const isRoomBlacklisting = room.getBlacklistUnverifiedDevices(); + if (typeof isRoomBlacklisting === 'boolean') { + isBlacklisting = isRoomBlacklisting; } // We are happy to use a cached version here: we assume that if we already diff --git a/src/models/room.ts b/src/models/room.ts index e4a1566c3..8b2ef78e3 100644 --- a/src/models/room.ts +++ b/src/models/room.ts @@ -1325,8 +1325,9 @@ export class Room extends ReadReceipt { * @return {Boolean} true if blacklisting unverified devices, null * if the global value should be used for this room. */ - public getBlacklistUnverifiedDevices(): boolean { - return !!this.blacklistUnverifiedDevices; + public getBlacklistUnverifiedDevices(): boolean | null { + if (this.blacklistUnverifiedDevices === undefined) return null; + return this.blacklistUnverifiedDevices; } /** From fcdd8c93f4d77aeb17cdf541e01eb4e09be8a058 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Tue, 1 Nov 2022 09:01:52 +0000 Subject: [PATCH 08/11] [Backport staging] Catch server versions API call exception when starting the client (#2832) Co-authored-by: Germain --- spec/integ/matrix-client-syncing.spec.ts | 10 ++++++++ src/client.ts | 29 ++++++++++++++++-------- 2 files changed, 29 insertions(+), 10 deletions(-) diff --git a/spec/integ/matrix-client-syncing.spec.ts b/spec/integ/matrix-client-syncing.spec.ts index 9eab95077..a75af86ae 100644 --- a/spec/integ/matrix-client-syncing.spec.ts +++ b/spec/integ/matrix-client-syncing.spec.ts @@ -274,6 +274,16 @@ describe("MatrixClient syncing", () => { expect(fires).toBe(1); }); + + it("should work when all network calls fail", async () => { + httpBackend!.expectedRequests = []; + httpBackend!.when("GET", "").fail(0, new Error("CORS or something")); + const prom = client!.startClient(); + await Promise.all([ + expect(prom).resolves.toBeUndefined(), + httpBackend!.flushAllExpected(), + ]); + }); }); describe("initial sync", () => { diff --git a/src/client.ts b/src/client.ts index fdf39deff..1193978c2 100644 --- a/src/client.ts +++ b/src/client.ts @@ -1192,15 +1192,17 @@ export class MatrixClient extends TypedEventEmitter} The server /versions response */ - public getVersions(): Promise { + public async getVersions(): Promise { if (this.serverVersionsPromise) { return this.serverVersionsPromise; } @@ -6530,13 +6532,20 @@ export class MatrixClient extends TypedEventEmitter { + ).catch(e => { // Need to unset this if it fails, otherwise we'll never retry this.serverVersionsPromise = null; // but rethrow the exception to anything that was waiting throw e; }); + const serverVersions = await this.serverVersionsPromise; + this.canSupport = await buildFeatureSupportMap(serverVersions); + + // We can set flag values to use their stable or unstable version + const support = this.canSupport.get(Feature.ThreadUnreadNotifications); + UNREAD_THREAD_NOTIFICATIONS.setPreferUnstable(support === ServerSupport.Unstable); + return this.serverVersionsPromise; } From 8f40dc6304fe99c452212a55175ce097d32528b5 Mon Sep 17 00:00:00 2001 From: RiotRobot Date: Tue, 1 Nov 2022 09:16:11 +0000 Subject: [PATCH 09/11] Prepare changelog for v21.0.1 --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d109edd19..14e8f4f85 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,11 @@ +Changes in [21.0.1](https://github.com/matrix-org/matrix-js-sdk/releases/tag/v21.0.1) (2022-11-01) +================================================================================================== + +## 🐛 Bug Fixes + * Fix default behavior of Room.getBlacklistUnverifiedDevices ([\#2830](https://github.com/matrix-org/matrix-js-sdk/pull/2830)). Contributed by @duxovni. + * Catch server versions API call exception when starting the client ([\#2828](https://github.com/matrix-org/matrix-js-sdk/pull/2828)). Fixes vector-im/element-web#23634. + * Fix authedRequest including `Authorization: Bearer undefined` for password resets ([\#2822](https://github.com/matrix-org/matrix-js-sdk/pull/2822)). Fixes vector-im/element-web#23655. + Changes in [21.0.0](https://github.com/matrix-org/matrix-js-sdk/releases/tag/v21.0.0) (2022-10-25) ================================================================================================== From 81c3668cb61388625518acb6153d28a48aced7b9 Mon Sep 17 00:00:00 2001 From: RiotRobot Date: Tue, 1 Nov 2022 09:16:11 +0000 Subject: [PATCH 10/11] v21.0.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b269d7b14..56e74de8e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "matrix-js-sdk", - "version": "21.0.0", + "version": "21.0.1", "description": "Matrix Client-Server SDK for Javascript", "engines": { "node": ">=16.0.0" From 76377c7cc407049f8d4a164823ce0f98d71f31c4 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Tue, 1 Nov 2022 14:24:47 +0000 Subject: [PATCH 11/11] Add eslint rule unicorn/no-instanceof-array (#2833) --- package.json | 3 +- yarn.lock | 163 +++++++++++++++++++++++++++++++++++++++++++++++---- 2 files changed, 155 insertions(+), 11 deletions(-) diff --git a/package.json b/package.json index 5e7fbe21f..4b6d5d4b2 100644 --- a/package.json +++ b/package.json @@ -95,7 +95,8 @@ "eslint-config-google": "^0.14.0", "eslint-import-resolver-typescript": "^3.5.1", "eslint-plugin-import": "^2.26.0", - "eslint-plugin-matrix-org": "^0.6.0", + "eslint-plugin-matrix-org": "^0.7.0", + "eslint-plugin-unicorn": "^44.0.2", "exorcist": "^2.0.0", "fake-indexeddb": "^4.0.0", "jest": "^29.0.0", diff --git a/yarn.lock b/yarn.lock index d62ad0734..11a08ac5e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1349,7 +1349,6 @@ "@matrix-org/olm@https://gitlab.matrix.org/api/v4/projects/27/packages/npm/@matrix-org/olm/-/@matrix-org/olm-3.2.13.tgz": version "3.2.13" - uid "0109fde93bcc61def851f79826c9384c073b5175" resolved "https://gitlab.matrix.org/api/v4/projects/27/packages/npm/@matrix-org/olm/-/@matrix-org/olm-3.2.13.tgz#0109fde93bcc61def851f79826c9384c073b5175" "@nicolo-ribaudo/chokidar-2@2.1.8-no-fsevents.3": @@ -1653,6 +1652,11 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-16.18.0.tgz#34982c6d5b5734c900f4ee69e1b87d212db6c60f" integrity sha512-LqYqYzYvnbCaQfLAwRt0zboqnsViwhZm+vjaMSqcfN36vulAg7Pt0T83q4WZO2YOBw3XdyHi8cQ88H22zmULOA== +"@types/normalize-package-data@^2.4.0": + version "2.4.1" + resolved "https://registry.yarnpkg.com/@types/normalize-package-data/-/normalize-package-data-2.4.1.tgz#d3357479a0fdfdd5907fe67e17e0a85c906e1301" + integrity sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw== + "@types/prettier@^2.1.5": version "2.7.1" resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.7.1.tgz#dfd20e2dc35f027cdd6c1908e80a5ddc7499670e" @@ -2370,6 +2374,11 @@ buffer@~5.2.1: base64-js "^1.0.2" ieee754 "^1.1.4" +builtin-modules@^3.3.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-3.3.0.tgz#cae62812b89801e9656336e46223e030386be7b6" + integrity sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw== + builtin-status-codes@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz#85982878e21b98e1c66425e03d0174788f569ee8" @@ -2490,7 +2499,7 @@ chokidar@^3.4.0: optionalDependencies: fsevents "~2.3.2" -ci-info@^3.2.0: +ci-info@^3.2.0, ci-info@^3.4.0: version "3.5.0" resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-3.5.0.tgz#bfac2a29263de4c829d806b1ab478e35091e171f" integrity sha512-yH4RezKOGlOhxkmhbeNuC4eYZKAUsEaGtBuBzDDP1eFUKiccDWzBABxBfOx31IDwDIXMTxWuwAxUGModvkbuVw== @@ -2515,6 +2524,13 @@ clean-css@^4.1.11: dependencies: source-map "~0.6.0" +clean-regexp@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/clean-regexp/-/clean-regexp-1.0.0.tgz#8df7c7aae51fd36874e8f8d05b9180bc11a3fed7" + integrity sha512-GfisEZEJvzKrmGWkvfhgzcz/BllN1USeqD2V6tg14OAOgaCD2Z/PUEuxnAZ/nPvmaHRG7a8y77p1T/IRQ4D1Hw== + dependencies: + escape-string-regexp "^1.0.5" + cli-color@^2.0.0: version "2.0.3" resolved "https://registry.yarnpkg.com/cli-color/-/cli-color-2.0.3.tgz#73769ba969080629670f3f2ef69a4bf4e7cc1879" @@ -3142,10 +3158,30 @@ eslint-plugin-import@^2.26.0: resolve "^1.22.0" tsconfig-paths "^3.14.1" -eslint-plugin-matrix-org@^0.6.0: - version "0.6.1" - resolved "https://registry.yarnpkg.com/eslint-plugin-matrix-org/-/eslint-plugin-matrix-org-0.6.1.tgz#deab0636a1fe999d9c2a42929c2b486334ec8ead" - integrity sha512-kq7fCbOdj6OvPF50gJtTVSgg6TbQCOxwwZktyIGQJfZyGNWhew77ptTnmaxgxq+RIQ+rzNcWrcMGO5eQC9fZAg== +eslint-plugin-matrix-org@^0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-matrix-org/-/eslint-plugin-matrix-org-0.7.0.tgz#4b7456b31e30e7575b62c2aada91915478829f88" + integrity sha512-FLmwE4/cRalB7J+J1BBuTccaXvKtRgAoHlbqSCbdsRqhh27xpxEWXe08KlNiET7drEnnz+xMHXdmvW469gch7g== + +eslint-plugin-unicorn@^44.0.2: + version "44.0.2" + resolved "https://registry.yarnpkg.com/eslint-plugin-unicorn/-/eslint-plugin-unicorn-44.0.2.tgz#6324a001c0a5e2ac00fb51b30db27d14c6c36ab3" + integrity sha512-GLIDX1wmeEqpGaKcnMcqRvMVsoabeF0Ton0EX4Th5u6Kmf7RM9WBl705AXFEsns56ESkEs0uyelLuUTvz9Tr0w== + dependencies: + "@babel/helper-validator-identifier" "^7.19.1" + ci-info "^3.4.0" + clean-regexp "^1.0.0" + eslint-utils "^3.0.0" + esquery "^1.4.0" + indent-string "^4.0.0" + is-builtin-module "^3.2.0" + lodash "^4.17.21" + pluralize "^8.0.0" + read-pkg-up "^7.0.1" + regexp-tree "^0.1.24" + safe-regex "^2.1.1" + semver "^7.3.7" + strip-indent "^3.0.0" eslint-rule-composer@^0.3.0: version "0.3.0" @@ -3727,6 +3763,11 @@ hmac-drbg@^1.0.1: minimalistic-assert "^1.0.0" minimalistic-crypto-utils "^1.0.1" +hosted-git-info@^2.1.4: + version "2.8.9" + resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.8.9.tgz#dffc0bf9a21c02209090f2aa69429e1414daf3f9" + integrity sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw== + html-escaper@^2.0.0: version "2.0.2" resolved "https://registry.yarnpkg.com/html-escaper/-/html-escaper-2.0.2.tgz#dfd60027da36a36dfcbe236262c00a5822681453" @@ -3778,6 +3819,11 @@ imurmurhash@^0.1.4: resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" integrity sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA== +indent-string@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/indent-string/-/indent-string-4.0.0.tgz#624f8f4497d619b2d9768531d58f4122854d7251" + integrity sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg== + inflight@^1.0.4: version "1.0.6" resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" @@ -3868,6 +3914,13 @@ is-buffer@^1.1.0, is-buffer@^1.1.5: resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w== +is-builtin-module@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/is-builtin-module/-/is-builtin-module-3.2.0.tgz#bb0310dfe881f144ca83f30100ceb10cf58835e0" + integrity sha512-phDA4oSGt7vl1n5tJvTWooWWAsXLY+2xCnxNqvKhGEzujg+A43wPlPOyDg3C8XQHN+6k/JTQWJ/j0dQh/qr+Hw== + dependencies: + builtin-modules "^3.3.0" + is-callable@^1.1.3, is-callable@^1.1.4, is-callable@^1.2.7: version "1.2.7" resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.7.tgz#3bc2a85ea742d9e36205dcacdd72ca1fdc51b055" @@ -4726,7 +4779,7 @@ lodash.merge@^4.6.2: resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a" integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ== -lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.4, lodash@^4.7.0: +lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.21, lodash@^4.17.4, lodash@^4.7.0: version "4.17.21" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== @@ -5004,6 +5057,16 @@ node-releases@^2.0.6: resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.6.tgz#8a7088c63a55e493845683ebf3c828d8c51c5503" integrity sha512-PiVXnNuFm5+iYkLBNeq5211hvO38y63T0i2KKh2KnUs3RpzJ+JtODFjkD8yjLwnDkTYF1eKXheUwdssR+NRZdg== +normalize-package-data@^2.5.0: + version "2.5.0" + resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.5.0.tgz#e66db1838b200c1dfc233225d12cb36520e234a8" + integrity sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA== + dependencies: + hosted-git-info "^2.1.4" + resolve "^1.10.0" + semver "2 || 3 || 4 || 5" + validate-npm-package-license "^3.0.1" + normalize-path@^3.0.0, normalize-path@~3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" @@ -5175,7 +5238,7 @@ parse-json@^2.2.0: dependencies: error-ex "^1.2.0" -parse-json@^5.2.0: +parse-json@^5.0.0, parse-json@^5.2.0: version "5.2.0" resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-5.2.0.tgz#c76fc66dee54231c962b22bcc8a72cf2f99753cd" integrity sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg== @@ -5270,6 +5333,11 @@ pkg-dir@^4.2.0: dependencies: find-up "^4.0.0" +pluralize@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-8.0.0.tgz#1a6fa16a38d12a1901e0320fa017051c539ce3b1" + integrity sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA== + prelude-ls@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396" @@ -5556,6 +5624,25 @@ read-only-stream@^2.0.0: dependencies: readable-stream "^2.0.2" +read-pkg-up@^7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-7.0.1.tgz#f3a6135758459733ae2b95638056e1854e7ef507" + integrity sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg== + dependencies: + find-up "^4.1.0" + read-pkg "^5.2.0" + type-fest "^0.8.1" + +read-pkg@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-5.2.0.tgz#7bf295438ca5a33e56cd30e053b34ee7250c93cc" + integrity sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg== + dependencies: + "@types/normalize-package-data" "^2.4.0" + normalize-package-data "^2.5.0" + parse-json "^5.0.0" + type-fest "^0.6.0" + readable-stream@^2.0.2, readable-stream@^2.2.2, readable-stream@~2.3.6: version "2.3.7" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.7.tgz#1eca1cf711aef814c04f62252a36a62f6cb23b57" @@ -5633,6 +5720,11 @@ regenerator-transform@^0.15.0: dependencies: "@babel/runtime" "^7.8.4" +regexp-tree@^0.1.24, regexp-tree@~0.1.1: + version "0.1.24" + resolved "https://registry.yarnpkg.com/regexp-tree/-/regexp-tree-0.1.24.tgz#3d6fa238450a4d66e5bc9c4c14bb720e2196829d" + integrity sha512-s2aEVuLhvnVJW6s/iPgEGK6R+/xngd2jNQ+xy4bXNDKxZKJH6jpPHY6kVeVv1IeLCHgswRj+Kl3ELaDjG6V1iw== + regexp.prototype.flags@^1.4.3: version "1.4.3" resolved "https://registry.yarnpkg.com/regexp.prototype.flags/-/regexp.prototype.flags-1.4.3.tgz#87cab30f80f66660181a3bb7bf5981a872b367ac" @@ -5710,7 +5802,7 @@ resolve.exports@^1.1.0: resolved "https://registry.yarnpkg.com/resolve.exports/-/resolve.exports-1.1.0.tgz#5ce842b94b05146c0e03076985d1d0e7e48c90c9" integrity sha512-J1l+Zxxp4XK3LUDZ9m60LRJF/mAe4z6a4xyabPHk7pvK5t35dACV32iIjJDFeWZFfZlO29w6SZ67knR0tHzJtQ== -resolve@^1.1.4, resolve@^1.1.6, resolve@^1.14.2, resolve@^1.17.0, resolve@^1.20.0, resolve@^1.22.0, resolve@^1.4.0: +resolve@^1.1.4, resolve@^1.1.6, resolve@^1.10.0, resolve@^1.14.2, resolve@^1.17.0, resolve@^1.20.0, resolve@^1.22.0, resolve@^1.4.0: version "1.22.1" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.1.tgz#27cb2ebb53f91abb49470a928bba7558066ac177" integrity sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw== @@ -5777,12 +5869,19 @@ safe-regex-test@^1.0.0: get-intrinsic "^1.1.3" is-regex "^1.1.4" +safe-regex@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/safe-regex/-/safe-regex-2.1.1.tgz#f7128f00d056e2fe5c11e81a1324dd974aadced2" + integrity sha512-rx+x8AMzKb5Q5lQ95Zoi6ZbJqwCLkqi3XuJXp5P3rT8OEc6sZCJG5AE5dU3lsgRr/F4Bs31jSlVN+j5KrsGu9A== + dependencies: + regexp-tree "~0.1.1" + safer-buffer@^2.1.0: version "2.1.2" resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== -semver@^5.6.0: +"semver@2 || 3 || 4 || 5", semver@^5.6.0: version "5.7.1" resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== @@ -5903,6 +6002,32 @@ source-map@~0.5.1, source-map@~0.5.3: resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" integrity sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ== +spdx-correct@^3.0.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-3.1.1.tgz#dece81ac9c1e6713e5f7d1b6f17d468fa53d89a9" + integrity sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w== + dependencies: + spdx-expression-parse "^3.0.0" + spdx-license-ids "^3.0.0" + +spdx-exceptions@^2.1.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz#3f28ce1a77a00372683eade4a433183527a2163d" + integrity sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A== + +spdx-expression-parse@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz#cf70f50482eefdc98e3ce0a6833e4a53ceeba679" + integrity sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q== + dependencies: + spdx-exceptions "^2.1.0" + spdx-license-ids "^3.0.0" + +spdx-license-ids@^3.0.0: + version "3.0.12" + resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.12.tgz#69077835abe2710b65f03969898b6637b505a779" + integrity sha512-rr+VVSXtRhO4OHbXUiAF7xW3Bo9DuuF6C5jH+q/x15j2jniycgKbxU09Hr0WqlSLUs4i4ltHGXqTe7VHclYWyA== + sprintf-js@~1.0.2: version "1.0.3" resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" @@ -6292,6 +6417,16 @@ type-fest@^0.21.3: resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.21.3.tgz#d260a24b0198436e133fa26a524a6d65fa3b2e37" integrity sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w== +type-fest@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.6.0.tgz#8d2a2370d3df886eb5c90ada1c5bf6188acf838b" + integrity sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg== + +type-fest@^0.8.1: + version "0.8.1" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.8.1.tgz#09e249ebde851d3b1e48d27c105444667f17b83d" + integrity sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA== + type@^1.0.1: version "1.2.0" resolved "https://registry.yarnpkg.com/type/-/type-1.2.0.tgz#848dd7698dafa3e54a6c479e759c4bc3f18847a0" @@ -6475,6 +6610,14 @@ v8-to-istanbul@^9.0.0, v8-to-istanbul@^9.0.1: "@types/istanbul-lib-coverage" "^2.0.1" convert-source-map "^1.6.0" +validate-npm-package-license@^3.0.1: + version "3.0.4" + resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz#fc91f6b9c7ba15c857f4cb2c5defeec39d4f410a" + integrity sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew== + dependencies: + spdx-correct "^3.0.0" + spdx-expression-parse "^3.0.0" + vm-browserify@^1.0.0: version "1.1.2" resolved "https://registry.yarnpkg.com/vm-browserify/-/vm-browserify-1.1.2.tgz#78641c488b8e6ca91a75f511e7a3b32a86e5dda0"