mirror of
https://github.com/the-draupnir-project/Draupnir.git
synced 2026-06-01 05:14:02 +00:00
Upgrade matrix-apservice-bridge base stack to node24. (#1052)
https://github.com/the-draupnir-project/planning/issues/104 I don't know what the fuck they are doing with the typings in the vector bot-sdk repository but whatever. https://github.com/the-draupnir-project/Draupnir/issues/1053
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"draupnir": major
|
||||
---
|
||||
|
||||
Updated minimum engine version to node 24.
|
||||
@@ -21,10 +21,10 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
|
||||
- name: Specifically use node 20 like in the readme.
|
||||
- name: Specifically use node 24 like in the readme.
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: "20"
|
||||
node-version: "24"
|
||||
- run: corepack enable
|
||||
- run: corepack npm install
|
||||
- run: corepack npm run build:all
|
||||
@@ -34,10 +34,10 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- name: Specifically use node 20 like in the readme.
|
||||
- name: Specifically use node 24 like in the readme.
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: "20"
|
||||
node-version: "24"
|
||||
- run: corepack npm install
|
||||
- run: corepack npm run build:all
|
||||
- run: corepack npm run test
|
||||
@@ -49,7 +49,7 @@ jobs:
|
||||
- uses: actions/checkout@v6
|
||||
- uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: "20"
|
||||
node-version: "24"
|
||||
- name: Fetch and build mx-tester (cached across runs)
|
||||
uses: baptiste0928/cargo-install@v3
|
||||
with:
|
||||
@@ -71,7 +71,7 @@ jobs:
|
||||
- uses: actions/setup-node@v6
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
node-version: "20"
|
||||
node-version: "24"
|
||||
- name: Fetch and build mx-tester (cached across runs)
|
||||
uses: baptiste0928/cargo-install@v3
|
||||
with:
|
||||
|
||||
@@ -34,3 +34,9 @@ reproducibly on any branch of PR.
|
||||
Developer tooling related `devDependencies` should be kept in the root package
|
||||
unless it is not common to most packages. This is to make sure the versioning
|
||||
remains consistent without relying on npm to do that.
|
||||
|
||||
## Node
|
||||
|
||||
We try to follow the active LTS release to keep us more inline with the
|
||||
[matrix-appservice-bridge](https://github.com/matrix-org/matrix-appservice-bridge/blob/develop/docs/platforms.md)
|
||||
stack of libraries.
|
||||
|
||||
+2
-2
@@ -3,7 +3,7 @@
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0 AND AFL-3.0
|
||||
|
||||
FROM node:20-slim as build-stage
|
||||
FROM node:24-slim as build-stage
|
||||
RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*
|
||||
COPY . /tmp/src
|
||||
# describe the version.
|
||||
@@ -14,7 +14,7 @@ RUN cd /tmp/src \
|
||||
&& npm run build \
|
||||
&& npm prune --production
|
||||
|
||||
FROM node:20-slim as final-stage
|
||||
FROM node:24-slim as final-stage
|
||||
COPY --from=build-stage /tmp/src/apps/draupnir /apps/draupnir
|
||||
COPY --from=build-stage /tmp/src/packages /packages
|
||||
COPY --from=build-stage /tmp/src/node_modules /node_modules
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
"@types/jsdom": "21.1.7",
|
||||
"@types/mocha": "^10.0.7",
|
||||
"@types/nedb": "^1.8.16",
|
||||
"@types/node": "^20.14.11",
|
||||
"@types/node": "^24.12.0",
|
||||
"@types/pg": "^8.6.5",
|
||||
"@types/request": "^2.48.12",
|
||||
"crypto-js": "^4.2.0",
|
||||
@@ -46,27 +46,26 @@
|
||||
"@the-draupnir-project/interface-manager": "4.2.6",
|
||||
"@the-draupnir-project/matrix-basic-types": "1.5.0",
|
||||
"@the-draupnir-project/mps-interface-adaptor": "file:../../packages/mps-interface-adaptor",
|
||||
"@vector-im/matrix-bot-sdk": "0.7.1-element.6",
|
||||
"better-sqlite3": "^9.4.3",
|
||||
"@vector-im/matrix-bot-sdk": "^0.8.0-element.3",
|
||||
"better-sqlite3": "^12.8.0",
|
||||
"body-parser": "^1.20.2",
|
||||
"config": "^3.3.9",
|
||||
"express": "^4.19",
|
||||
"html-to-text": "^8.0.0",
|
||||
"js-yaml": "^4.1.0",
|
||||
"jsdom": "^24.0.0",
|
||||
"matrix-appservice-bridge": "10.3.1",
|
||||
"matrix-appservice-bridge": "^11.2.0",
|
||||
"matrix-protection-suite": "file:../../packages/matrix-protection-suite",
|
||||
"matrix-protection-suite-for-matrix-bot-sdk": "file:../../packages/matrix-protection-suite-for-matrix-bot-sdk",
|
||||
"pg": "^8.8.0",
|
||||
"yaml": "^2.3.2"
|
||||
},
|
||||
"overrides": {
|
||||
"@vector-im/matrix-bot-sdk": "0.7.1-element.6",
|
||||
"@the-draupnir-project/matrix-basic-types": "$the-draupnir-project/matrix-basic-types",
|
||||
"@the-draupnir-project/interface-manager": "$the-draupnir-project/interface-manager",
|
||||
"matrix-protection-suite": "$matrix-protection-suite"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=20.0.0"
|
||||
"node": ">=24.0.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,9 +8,10 @@
|
||||
// https://github.com/matrix-org/mjolnir
|
||||
// </text>
|
||||
|
||||
import { PowerLevelAction } from "@vector-im/matrix-bot-sdk/lib/models/PowerLevelAction";
|
||||
import { PowerLevelAction } from "@vector-im/matrix-bot-sdk";
|
||||
import { LogService, UserID } from "@vector-im/matrix-bot-sdk";
|
||||
import { htmlToText } from "html-to-text";
|
||||
import { extractRawRoomEvent } from "matrix-protection-suite-for-matrix-bot-sdk";
|
||||
import { htmlEscape } from "../utils";
|
||||
import { JSDOM } from "jsdom";
|
||||
import { Draupnir } from "../Draupnir";
|
||||
@@ -226,10 +227,9 @@ export class StandardReportManager {
|
||||
let initialNoticeReport: IReport | undefined,
|
||||
confirmationReport: IReportWithAction | undefined;
|
||||
try {
|
||||
const originalEvent = (await this.draupnir.client.getEvent(
|
||||
roomID,
|
||||
relation.event_id
|
||||
)) as RoomEvent;
|
||||
const originalEvent = extractRawRoomEvent(
|
||||
await this.draupnir.client.getEvent(roomID, relation.event_id)
|
||||
) as RoomEvent;
|
||||
if (originalEvent.sender !== this.draupnir.clientUserID) {
|
||||
// Let's not handle reactions to events we didn't send as
|
||||
// some setups have two or more Draupnir's in the same management room.
|
||||
@@ -978,10 +978,9 @@ class EscalateToServerModerationRoom implements IUIAction {
|
||||
_moderationroomID: string,
|
||||
displayManager: DisplayManager
|
||||
): Promise<string | undefined> {
|
||||
const event = (await manager.draupnir.client.getEvent(
|
||||
report.room_id,
|
||||
report.event_id
|
||||
)) as RoomEvent;
|
||||
const event = extractRawRoomEvent(
|
||||
await manager.draupnir.client.getEvent(report.room_id, report.event_id)
|
||||
) as RoomEvent;
|
||||
|
||||
// Display the report and UI directly in the management room, as if it had been
|
||||
// received from /report.
|
||||
|
||||
@@ -20,6 +20,7 @@ import {
|
||||
isStringEventID,
|
||||
} from "@the-draupnir-project/matrix-basic-types";
|
||||
import { Logger, RoomEvent, Task } from "matrix-protection-suite";
|
||||
import { extractRawRoomEvent } from "matrix-protection-suite-for-matrix-bot-sdk";
|
||||
import { SynapseHttpAntispam } from "./SynapseHTTPAntispam/SynapseHttpAntispam";
|
||||
import { jsonReviver } from "../utils";
|
||||
|
||||
@@ -260,7 +261,9 @@ export class WebAPIs {
|
||||
//
|
||||
// By doing this with the reporterClient, we ensure that this feature of Draupnir can work
|
||||
// with all Matrix homeservers, rather than just Synapse.
|
||||
event = (await reporterClient.getEvent(roomID, eventID)) as RoomEvent;
|
||||
event = extractRawRoomEvent(
|
||||
await reporterClient.getEvent(roomID, eventID)
|
||||
) as RoomEvent;
|
||||
}
|
||||
const reason = (request.body as Record<string, unknown>)[
|
||||
"reason"
|
||||
|
||||
@@ -22,7 +22,10 @@ import {
|
||||
Value,
|
||||
} from "matrix-protection-suite";
|
||||
import { StringEventID } from "@the-draupnir-project/matrix-basic-types";
|
||||
import { resultifyBotSDKRequestError } from "matrix-protection-suite-for-matrix-bot-sdk";
|
||||
import {
|
||||
extractRawRoomEvent,
|
||||
resultifyBotSDKRequestError,
|
||||
} from "matrix-protection-suite-for-matrix-bot-sdk";
|
||||
|
||||
/**
|
||||
* Test the ability to turn abuse reports into room messages.
|
||||
@@ -533,10 +536,9 @@ describe("Test: Reporting abuse", () => {
|
||||
await new Promise((resolve) => setTimeout(resolve, 1000));
|
||||
|
||||
// This should have redacted the message.
|
||||
const newBadEvent = (await draupnir.client.getEvent(
|
||||
roomId,
|
||||
badEventId
|
||||
)) as RoomEvent;
|
||||
const newBadEvent = extractRawRoomEvent(
|
||||
await draupnir.client.getEvent(roomId, badEventId)
|
||||
) as RoomEvent;
|
||||
assert.deepEqual(
|
||||
Object.keys(newBadEvent.content),
|
||||
[],
|
||||
|
||||
@@ -47,7 +47,7 @@ export async function registerUser(
|
||||
): Promise<void> {
|
||||
const registerUrl = `${homeserver}/_synapse/admin/v1/register`;
|
||||
const nonce: string = await new Promise((resolve, reject) => {
|
||||
(getRequestFn() as RequestFunction)(
|
||||
(getRequestFn() as unknown as RequestFunction)(
|
||||
{ uri: registerUrl, method: "GET", timeout: 60000 },
|
||||
(error: unknown, _response: unknown, resBody: unknown) => {
|
||||
if (error) {
|
||||
@@ -94,15 +94,18 @@ export async function registerUser(
|
||||
timeout: 60000,
|
||||
};
|
||||
await new Promise((resolve, reject) => {
|
||||
(getRequestFn() as RequestFunction)(params, (error: unknown) => {
|
||||
if (error === undefined || error === null) {
|
||||
resolve(undefined);
|
||||
} else if (error instanceof Error) {
|
||||
reject(error);
|
||||
} else {
|
||||
reject(new TypeError(`something is throwing garbage`));
|
||||
(getRequestFn() as unknown as RequestFunction)(
|
||||
params,
|
||||
(error: unknown) => {
|
||||
if (error === undefined || error === null) {
|
||||
resolve(undefined);
|
||||
} else if (error instanceof Error) {
|
||||
reject(error);
|
||||
} else {
|
||||
reject(new TypeError(`something is throwing garbage`));
|
||||
}
|
||||
}
|
||||
});
|
||||
);
|
||||
});
|
||||
return;
|
||||
} catch (e) {
|
||||
|
||||
@@ -20,6 +20,7 @@ import {
|
||||
} from "../mjolnirSetupUtils";
|
||||
import { MatrixClient } from "@vector-im/matrix-bot-sdk";
|
||||
import { RoomEvent } from "matrix-protection-suite";
|
||||
import { extractRawRoomEvent } from "matrix-protection-suite-for-matrix-bot-sdk";
|
||||
|
||||
interface RedactionTestContext extends DraupnirTestContext {
|
||||
moderator?: MatrixClient;
|
||||
@@ -286,10 +287,9 @@ describe("Test: The redaction command", function () {
|
||||
}
|
||||
);
|
||||
|
||||
const redactedEvent = (await moderator.getEvent(
|
||||
targetRoom,
|
||||
eventToRedact
|
||||
)) as RoomEvent;
|
||||
const redactedEvent = extractRawRoomEvent(
|
||||
await moderator.getEvent(targetRoom, eventToRedact)
|
||||
) as RoomEvent;
|
||||
assert.equal(
|
||||
Object.keys(redactedEvent.content).length,
|
||||
0,
|
||||
|
||||
+15
-1
@@ -95,6 +95,15 @@ export default tseslint.config(
|
||||
"error",
|
||||
{ allowInterfaces: "with-single-extends" },
|
||||
],
|
||||
"@typescript-eslint/no-deprecated": [
|
||||
"error",
|
||||
{
|
||||
allow: [
|
||||
// Idk why they did this but whatever https://github.com/element-hq/matrix-bot-sdk/pull/66/changes#r2965217095
|
||||
{ from: "package", name: "getRoomStateEvent", package: "@vector-im/matrix-bot-sdk" },
|
||||
],
|
||||
},
|
||||
],
|
||||
// We intentionally use enums to compare against non enum values, but no doubt this one will bite us in the ass later
|
||||
},
|
||||
ignores,
|
||||
@@ -113,7 +122,12 @@ export default tseslint.config(
|
||||
"@typescript-eslint/no-deprecated": [
|
||||
"error",
|
||||
{
|
||||
allow: [{ from: "file", name: "logMessage" }, { from: "file", name: "allocateProtection"}],
|
||||
allow: [
|
||||
{ from: "file", name: "logMessage" },
|
||||
{ from: "file", name: "allocateProtection" },
|
||||
// Idk why they did this but whatever https://github.com/element-hq/matrix-bot-sdk/pull/66/changes#r2965217095
|
||||
{ from: "package", name: "getRoomStateEvent", package: "@vector-im/matrix-bot-sdk" },
|
||||
],
|
||||
},
|
||||
],
|
||||
// We intentionally compare enums to non enum values but no doubt it will bite us in the ass later
|
||||
|
||||
Generated
+114
-141
@@ -22,6 +22,9 @@
|
||||
"ts-jest": "^29.4.6",
|
||||
"typescript": "^5.9.3",
|
||||
"typescript-eslint": "^8.56.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=24.0.0"
|
||||
}
|
||||
},
|
||||
"apps/draupnir": {
|
||||
@@ -34,15 +37,15 @@
|
||||
"@the-draupnir-project/interface-manager": "4.2.6",
|
||||
"@the-draupnir-project/matrix-basic-types": "1.5.0",
|
||||
"@the-draupnir-project/mps-interface-adaptor": "file:../../packages/mps-interface-adaptor",
|
||||
"@vector-im/matrix-bot-sdk": "0.7.1-element.6",
|
||||
"better-sqlite3": "^9.4.3",
|
||||
"@vector-im/matrix-bot-sdk": "^0.8.0-element.3",
|
||||
"better-sqlite3": "^12.8.0",
|
||||
"body-parser": "^1.20.2",
|
||||
"config": "^3.3.9",
|
||||
"express": "^4.19",
|
||||
"html-to-text": "^8.0.0",
|
||||
"js-yaml": "^4.1.0",
|
||||
"jsdom": "^24.0.0",
|
||||
"matrix-appservice-bridge": "10.3.1",
|
||||
"matrix-appservice-bridge": "^11.2.0",
|
||||
"matrix-protection-suite": "file:../../packages/matrix-protection-suite",
|
||||
"matrix-protection-suite-for-matrix-bot-sdk": "file:../../packages/matrix-protection-suite-for-matrix-bot-sdk",
|
||||
"pg": "^8.8.0",
|
||||
@@ -58,7 +61,7 @@
|
||||
"@types/jsdom": "21.1.7",
|
||||
"@types/mocha": "^10.0.7",
|
||||
"@types/nedb": "^1.8.16",
|
||||
"@types/node": "^20.14.11",
|
||||
"@types/node": "^24.12.0",
|
||||
"@types/pg": "^8.6.5",
|
||||
"@types/request": "^2.48.12",
|
||||
"crypto-js": "^4.2.0",
|
||||
@@ -68,7 +71,7 @@
|
||||
"ts-node": "^10.9.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=20.0.0"
|
||||
"node": ">=24.0.0"
|
||||
}
|
||||
},
|
||||
"apps/draupnir/node_modules/@selderee/plugin-htmlparser2": {
|
||||
@@ -85,13 +88,13 @@
|
||||
}
|
||||
},
|
||||
"apps/draupnir/node_modules/@types/node": {
|
||||
"version": "20.19.35",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.19.35.tgz",
|
||||
"integrity": "sha512-Uarfe6J91b9HAUXxjvSOdiO2UPOKLm07Q1oh0JHxoZ1y8HoqxDAu3gVrsrOHeiio0kSsoVBt4wFrKOm0dKxVPQ==",
|
||||
"version": "24.12.0",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-24.12.0.tgz",
|
||||
"integrity": "sha512-GYDxsZi3ChgmckRT9HPU0WEhKLP08ev/Yfcq2AstjrDASOYCSXeyjDsHg4v5t4jOj7cyDX3vmprafKlWIG9MXQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"undici-types": "~6.21.0"
|
||||
"undici-types": "~7.16.0"
|
||||
}
|
||||
},
|
||||
"apps/draupnir/node_modules/dom-serializer": {
|
||||
@@ -185,38 +188,6 @@
|
||||
"entities": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"apps/draupnir/node_modules/matrix-appservice-bridge": {
|
||||
"version": "10.3.1",
|
||||
"resolved": "https://registry.npmjs.org/matrix-appservice-bridge/-/matrix-appservice-bridge-10.3.1.tgz",
|
||||
"integrity": "sha512-umBLAqLUdm6TefEdQuHUE0QfSmbtJf+LnHDYRM5XwpMjScIXQ/5pI6559gVQrxVVT5T58jbNuoJCz2+8+XLr3Q==",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@alloc/quick-lru": "^5.2.0",
|
||||
"@types/nedb": "^1.8.16",
|
||||
"@vector-im/matrix-bot-sdk": "^0.7.1-element.6",
|
||||
"chalk": "^4.1.0",
|
||||
"express": "^4.18.2",
|
||||
"express-rate-limit": "^7.1.5",
|
||||
"extend": "^3.0.2",
|
||||
"ip-cidr": "^3.0.0",
|
||||
"is-my-json-valid": "^2.20.5",
|
||||
"js-yaml": "^4.0.0",
|
||||
"matrix-appservice": "^2.0.0",
|
||||
"nopt": "^5.0.0",
|
||||
"p-queue": "^6.6.2",
|
||||
"pkginfo": "^0.4.1",
|
||||
"postgres": "^3.4.3",
|
||||
"prom-client": "^15.1.0",
|
||||
"winston": "^3.11.0",
|
||||
"winston-daily-rotate-file": "^4.5.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=20"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"nedb": "^1.8.0"
|
||||
}
|
||||
},
|
||||
"apps/draupnir/node_modules/parseley": {
|
||||
"version": "0.7.0",
|
||||
"resolved": "https://registry.npmjs.org/parseley/-/parseley-0.7.0.tgz",
|
||||
@@ -243,9 +214,9 @@
|
||||
}
|
||||
},
|
||||
"apps/draupnir/node_modules/undici-types": {
|
||||
"version": "6.21.0",
|
||||
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz",
|
||||
"integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==",
|
||||
"version": "7.16.0",
|
||||
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.16.0.tgz",
|
||||
"integrity": "sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
@@ -3146,17 +3117,17 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@matrix-org/matrix-sdk-crypto-nodejs": {
|
||||
"version": "0.2.0-beta.1",
|
||||
"resolved": "https://registry.npmjs.org/@matrix-org/matrix-sdk-crypto-nodejs/-/matrix-sdk-crypto-nodejs-0.2.0-beta.1.tgz",
|
||||
"integrity": "sha512-CgbOKORfD6dvYgQTPhfN73H1RbQknrFkMnRRwCIJMt15iL2AF1gEowgbrlGhkbG6gNng4CgPnKs1iHKCRrhvmA==",
|
||||
"version": "0.4.0",
|
||||
"resolved": "https://registry.npmjs.org/@matrix-org/matrix-sdk-crypto-nodejs/-/matrix-sdk-crypto-nodejs-0.4.0.tgz",
|
||||
"integrity": "sha512-+qqgpn39XFSbsD0dFjssGO9vHEP7sTyfs8yTpt8vuqWpUpF20QMwpCZi0jpYw7GxjErNTsMshopuo8677DfGEA==",
|
||||
"hasInstallScript": true,
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"https-proxy-agent": "^5.0.1",
|
||||
"node-downloader-helper": "^2.1.5"
|
||||
"https-proxy-agent": "^7.0.5",
|
||||
"node-downloader-helper": "^2.1.9"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 18"
|
||||
"node": ">= 22"
|
||||
}
|
||||
},
|
||||
"node_modules/@napi-rs/wasm-runtime": {
|
||||
@@ -3612,7 +3583,6 @@
|
||||
"version": "0.12.5",
|
||||
"resolved": "https://registry.npmjs.org/@types/caseless/-/caseless-0.12.5.tgz",
|
||||
"integrity": "sha512-hWtVTC2q7hc7xZ/RLbxapMvDMgUnDvKvMOpKal4DrMyfGBUfB1oKaZlIRr6mJL+If3bAP6sV/QneGzF6tJjZDg==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@types/config": {
|
||||
@@ -4020,7 +3990,6 @@
|
||||
"version": "2.48.13",
|
||||
"resolved": "https://registry.npmjs.org/@types/request/-/request-2.48.13.tgz",
|
||||
"integrity": "sha512-FGJ6udDNUCjd19pp0Q3iTiDkwhYup7J8hpMW9c4k53NrccQFFWKRho6hvtPPEhnXWKvukfwAlB6DbDz4yhH5Gg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@types/caseless": "*",
|
||||
@@ -4033,7 +4002,6 @@
|
||||
"version": "2.5.5",
|
||||
"resolved": "https://registry.npmjs.org/form-data/-/form-data-2.5.5.tgz",
|
||||
"integrity": "sha512-jqdObeR2rxZZbPSGL+3VckHMYtu+f9//KXBsVny6JSX/pa38Fy+bGjuG8eW/H6USNQWhLi8Num++cU2yOCNz4A==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"asynckit": "^0.4.0",
|
||||
@@ -4088,7 +4056,6 @@
|
||||
"version": "4.0.5",
|
||||
"resolved": "https://registry.npmjs.org/@types/tough-cookie/-/tough-cookie-4.0.5.tgz",
|
||||
"integrity": "sha512-/Ad8+nIOV7Rl++6f1BdKxFSMgmoqEoYbHRpPcx3JEfv8VRsQe9Z4mCXeJBzxs7mbHY/XOZZuXlRNfhpVPbs6ZA==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@types/triple-beam": {
|
||||
@@ -4680,17 +4647,18 @@
|
||||
]
|
||||
},
|
||||
"node_modules/@vector-im/matrix-bot-sdk": {
|
||||
"version": "0.7.1-element.6",
|
||||
"resolved": "https://registry.npmjs.org/@vector-im/matrix-bot-sdk/-/matrix-bot-sdk-0.7.1-element.6.tgz",
|
||||
"integrity": "sha512-0KfyTpQV5eyY4vPUZW89t7EZf1YF0UyFkyYqpsxL/6S7XIlbTMC4onod7vx/QpKC0lSREmwIiXx2JSjExP6CIw==",
|
||||
"version": "0.8.0-element.2",
|
||||
"resolved": "https://registry.npmjs.org/@vector-im/matrix-bot-sdk/-/matrix-bot-sdk-0.8.0-element.2.tgz",
|
||||
"integrity": "sha512-Qasxj5w2a5jkEOz7fPcO+6nQkO7/TE3/XNZPxVnAo5rNrqAIsItXAwJU8vmrW2QRKWsCcDhT4ONgWOWz5e20MA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@matrix-org/matrix-sdk-crypto-nodejs": "0.2.0-beta.1",
|
||||
"@matrix-org/matrix-sdk-crypto-nodejs": "0.4.0",
|
||||
"@types/express": "^4.17.21",
|
||||
"@types/request": "^2.48.13",
|
||||
"another-json": "^0.2.0",
|
||||
"async-lock": "^1.4.0",
|
||||
"chalk": "4",
|
||||
"express": "^4.18.2",
|
||||
"express": "^4.21.2",
|
||||
"glob-to-regexp": "^0.4.1",
|
||||
"hash.js": "^1.1.7",
|
||||
"html-to-text": "^9.0.5",
|
||||
@@ -4705,7 +4673,7 @@
|
||||
"sanitize-html": "^2.11.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18.0.0"
|
||||
"node": ">=22.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@vector-im/matrix-bot-sdk/node_modules/lru-cache": {
|
||||
@@ -4770,15 +4738,12 @@
|
||||
}
|
||||
},
|
||||
"node_modules/agent-base": {
|
||||
"version": "6.0.2",
|
||||
"resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz",
|
||||
"integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==",
|
||||
"version": "7.1.4",
|
||||
"resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.4.tgz",
|
||||
"integrity": "sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"debug": "4"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 6.0.0"
|
||||
"node": ">= 14"
|
||||
}
|
||||
},
|
||||
"node_modules/ajv": {
|
||||
@@ -5147,14 +5112,17 @@
|
||||
}
|
||||
},
|
||||
"node_modules/better-sqlite3": {
|
||||
"version": "9.6.0",
|
||||
"resolved": "https://registry.npmjs.org/better-sqlite3/-/better-sqlite3-9.6.0.tgz",
|
||||
"integrity": "sha512-yR5HATnqeYNVnkaUTf4bOP2dJSnyhP4puJN/QPRyx4YkBEEUxib422n2XzPqDEHjQQqazoYoADdAm5vE15+dAQ==",
|
||||
"version": "12.8.0",
|
||||
"resolved": "https://registry.npmjs.org/better-sqlite3/-/better-sqlite3-12.8.0.tgz",
|
||||
"integrity": "sha512-RxD2Vd96sQDjQr20kdP+F+dK/1OUNiVOl200vKBZY8u0vTwysfolF6Hq+3ZK2+h8My9YvZhHsF+RSGZW2VYrPQ==",
|
||||
"hasInstallScript": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"bindings": "^1.5.0",
|
||||
"prebuild-install": "^7.1.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": "20.x || 22.x || 23.x || 24.x || 25.x"
|
||||
}
|
||||
},
|
||||
"node_modules/binary-extensions": {
|
||||
@@ -7491,15 +7459,6 @@
|
||||
"node": ">= 14"
|
||||
}
|
||||
},
|
||||
"node_modules/http-proxy-agent/node_modules/agent-base": {
|
||||
"version": "7.1.4",
|
||||
"resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.4.tgz",
|
||||
"integrity": "sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 14"
|
||||
}
|
||||
},
|
||||
"node_modules/http-signature": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz",
|
||||
@@ -7516,16 +7475,16 @@
|
||||
}
|
||||
},
|
||||
"node_modules/https-proxy-agent": {
|
||||
"version": "5.0.1",
|
||||
"resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz",
|
||||
"integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==",
|
||||
"version": "7.0.6",
|
||||
"resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz",
|
||||
"integrity": "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"agent-base": "6",
|
||||
"agent-base": "^7.1.2",
|
||||
"debug": "4"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 6"
|
||||
"node": ">= 14"
|
||||
}
|
||||
},
|
||||
"node_modules/human-id": {
|
||||
@@ -10206,15 +10165,6 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/jsdom/node_modules/agent-base": {
|
||||
"version": "7.1.4",
|
||||
"resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.4.tgz",
|
||||
"integrity": "sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 14"
|
||||
}
|
||||
},
|
||||
"node_modules/jsdom/node_modules/form-data": {
|
||||
"version": "4.0.5",
|
||||
"resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.5.tgz",
|
||||
@@ -10231,19 +10181,6 @@
|
||||
"node": ">= 6"
|
||||
}
|
||||
},
|
||||
"node_modules/jsdom/node_modules/https-proxy-agent": {
|
||||
"version": "7.0.6",
|
||||
"resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz",
|
||||
"integrity": "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"agent-base": "^7.1.2",
|
||||
"debug": "4"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 14"
|
||||
}
|
||||
},
|
||||
"node_modules/jsdom/node_modules/tough-cookie": {
|
||||
"version": "4.1.4",
|
||||
"resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.4.tgz",
|
||||
@@ -10625,18 +10562,50 @@
|
||||
}
|
||||
},
|
||||
"node_modules/matrix-appservice": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/matrix-appservice/-/matrix-appservice-2.0.0.tgz",
|
||||
"integrity": "sha512-HCIuJ5i0YuO8b0dMyGe5dqlsE4f3RzHU0MuMg/2gGAZ4HL3r7aSWOFbyIWStSSUrk1qCa9Eml0i4EnEi0pOtdA==",
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/matrix-appservice/-/matrix-appservice-3.0.0.tgz",
|
||||
"integrity": "sha512-E5NMb4jtDnuXtPIHnLZ9RciLPPROzt94yPzuDsCXPKCRHhKpUQh6Ik6mPYM3fOMIGZ4sHxUtKdyJwP3Y+HVCVg==",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"body-parser": "^1.19.0",
|
||||
"express": "^4.18.1",
|
||||
"express": "^4.18.2",
|
||||
"js-yaml": "^4.1.0",
|
||||
"morgan": "^1.10.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
"node": ">=22"
|
||||
}
|
||||
},
|
||||
"node_modules/matrix-appservice-bridge": {
|
||||
"version": "11.2.0",
|
||||
"resolved": "https://registry.npmjs.org/matrix-appservice-bridge/-/matrix-appservice-bridge-11.2.0.tgz",
|
||||
"integrity": "sha512-lZ8gj1/qoIFtYqIZeK6BS0Xy7+gvX51HELMAoTXcQLeQIeSaBMnIYUZ+5IvnTW5YcVRL9pjJ0daCeGtan8gI6Q==",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@alloc/quick-lru": "^5.2.0",
|
||||
"@types/nedb": "^1.8.16",
|
||||
"@vector-im/matrix-bot-sdk": "0.8.0-element.2",
|
||||
"chalk": "^4.1.0",
|
||||
"express": "^4.18.2",
|
||||
"express-rate-limit": "^7.1.5",
|
||||
"extend": "^3.0.2",
|
||||
"ip-cidr": "^3.0.0",
|
||||
"is-my-json-valid": "^2.20.5",
|
||||
"js-yaml": "^4.1.0",
|
||||
"matrix-appservice": "^3.0.0",
|
||||
"nopt": "^5.0.0",
|
||||
"p-queue": "^6.6.2",
|
||||
"pkginfo": "^0.4.1",
|
||||
"postgres": "^3.4.3",
|
||||
"prom-client": "^15.1.0",
|
||||
"winston": "^3.11.0",
|
||||
"winston-daily-rotate-file": "^4.5.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=22"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"nedb": "^1.8.0"
|
||||
}
|
||||
},
|
||||
"node_modules/matrix-protection-suite": {
|
||||
@@ -14637,19 +14606,23 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/glob-to-regexp": "^0.4.4",
|
||||
"@types/node": "^22.0.0"
|
||||
"@types/node": "^24.12.0"
|
||||
}
|
||||
},
|
||||
"packages/matrix-basic-types/node_modules/@types/node": {
|
||||
"version": "22.19.11",
|
||||
"version": "24.12.0",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-24.12.0.tgz",
|
||||
"integrity": "sha512-GYDxsZi3ChgmckRT9HPU0WEhKLP08ev/Yfcq2AstjrDASOYCSXeyjDsHg4v5t4jOj7cyDX3vmprafKlWIG9MXQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"undici-types": "~6.21.0"
|
||||
"undici-types": "~7.16.0"
|
||||
}
|
||||
},
|
||||
"packages/matrix-basic-types/node_modules/undici-types": {
|
||||
"version": "6.21.0",
|
||||
"version": "7.16.0",
|
||||
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.16.0.tgz",
|
||||
"integrity": "sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
@@ -14668,7 +14641,7 @@
|
||||
"devDependencies": {
|
||||
"@types/crypto-js": "^4.2.2",
|
||||
"@types/glob-to-regexp": "^0.4.4",
|
||||
"@types/node": "^20.14.9",
|
||||
"@types/node": "^24.12.0",
|
||||
"typedoc": "^0.28.16",
|
||||
"wait-for-expect": "^3.0.2"
|
||||
},
|
||||
@@ -14688,26 +14661,26 @@
|
||||
"devDependencies": {
|
||||
"@types/crypto-js": "^4.1.2",
|
||||
"@types/glob-to-regexp": "^0.4.1",
|
||||
"@types/node": "^20.14.9",
|
||||
"@vector-im/matrix-bot-sdk": "0.7.1-element.6",
|
||||
"@types/node": "^24.12.0",
|
||||
"@vector-im/matrix-bot-sdk": "0.8.0-element.3",
|
||||
"matrix-protection-suite": "file:../matrix-protection-suite",
|
||||
"typedoc": "^0.26.3"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@sinclair/typebox": "0.34.13",
|
||||
"@the-draupnir-project/matrix-basic-types": "1.5.0",
|
||||
"@vector-im/matrix-bot-sdk": "0.7.1-element.6",
|
||||
"@vector-im/matrix-bot-sdk": "^0.8.0-element.3",
|
||||
"matrix-protection-suite": "file:../matrix-protection-suite"
|
||||
}
|
||||
},
|
||||
"packages/matrix-protection-suite-for-matrix-bot-sdk/node_modules/@types/node": {
|
||||
"version": "20.19.33",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.19.33.tgz",
|
||||
"integrity": "sha512-Rs1bVAIdBs5gbTIKza/tgpMuG1k3U/UMJLWecIMxNdJFDMzcM5LOiLVRYh3PilWEYDIeUDv7bpiHPLPsbydGcw==",
|
||||
"version": "24.12.0",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-24.12.0.tgz",
|
||||
"integrity": "sha512-GYDxsZi3ChgmckRT9HPU0WEhKLP08ev/Yfcq2AstjrDASOYCSXeyjDsHg4v5t4jOj7cyDX3vmprafKlWIG9MXQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"undici-types": "~6.21.0"
|
||||
"undici-types": "~7.16.0"
|
||||
}
|
||||
},
|
||||
"packages/matrix-protection-suite-for-matrix-bot-sdk/node_modules/balanced-match": {
|
||||
@@ -14788,26 +14761,26 @@
|
||||
}
|
||||
},
|
||||
"packages/matrix-protection-suite-for-matrix-bot-sdk/node_modules/undici-types": {
|
||||
"version": "6.21.0",
|
||||
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz",
|
||||
"integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==",
|
||||
"version": "7.16.0",
|
||||
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.16.0.tgz",
|
||||
"integrity": "sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"packages/matrix-protection-suite/node_modules/@types/node": {
|
||||
"version": "20.19.33",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.19.33.tgz",
|
||||
"integrity": "sha512-Rs1bVAIdBs5gbTIKza/tgpMuG1k3U/UMJLWecIMxNdJFDMzcM5LOiLVRYh3PilWEYDIeUDv7bpiHPLPsbydGcw==",
|
||||
"version": "24.12.0",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-24.12.0.tgz",
|
||||
"integrity": "sha512-GYDxsZi3ChgmckRT9HPU0WEhKLP08ev/Yfcq2AstjrDASOYCSXeyjDsHg4v5t4jOj7cyDX3vmprafKlWIG9MXQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"undici-types": "~6.21.0"
|
||||
"undici-types": "~7.16.0"
|
||||
}
|
||||
},
|
||||
"packages/matrix-protection-suite/node_modules/undici-types": {
|
||||
"version": "6.21.0",
|
||||
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz",
|
||||
"integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==",
|
||||
"version": "7.16.0",
|
||||
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.16.0.tgz",
|
||||
"integrity": "sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
@@ -14816,7 +14789,7 @@
|
||||
"version": "0.5.3",
|
||||
"license": "Apache-2.0",
|
||||
"devDependencies": {
|
||||
"@types/node": "^20.17.57",
|
||||
"@types/node": "^24.12.0",
|
||||
"matrix-protection-suite": "file:../matrix-protection-suite"
|
||||
},
|
||||
"peerDependencies": {
|
||||
@@ -14827,19 +14800,19 @@
|
||||
}
|
||||
},
|
||||
"packages/mps-interface-adaptor/node_modules/@types/node": {
|
||||
"version": "20.19.33",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.19.33.tgz",
|
||||
"integrity": "sha512-Rs1bVAIdBs5gbTIKza/tgpMuG1k3U/UMJLWecIMxNdJFDMzcM5LOiLVRYh3PilWEYDIeUDv7bpiHPLPsbydGcw==",
|
||||
"version": "24.12.0",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-24.12.0.tgz",
|
||||
"integrity": "sha512-GYDxsZi3ChgmckRT9HPU0WEhKLP08ev/Yfcq2AstjrDASOYCSXeyjDsHg4v5t4jOj7cyDX3vmprafKlWIG9MXQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"undici-types": "~6.21.0"
|
||||
"undici-types": "~7.16.0"
|
||||
}
|
||||
},
|
||||
"packages/mps-interface-adaptor/node_modules/undici-types": {
|
||||
"version": "6.21.0",
|
||||
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz",
|
||||
"integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==",
|
||||
"version": "7.16.0",
|
||||
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.16.0.tgz",
|
||||
"integrity": "sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
|
||||
+4
-1
@@ -35,7 +35,10 @@
|
||||
"typescript-eslint": "^8.56.1"
|
||||
},
|
||||
"overrides": {
|
||||
"@vector-im/matrix-bot-sdk": "0.7.1-element.6",
|
||||
"@vector-im/matrix-bot-sdk": "0.8.0-element.3",
|
||||
"postgres": "3.4.7"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=24.0.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,12 +19,11 @@
|
||||
"scripts": {
|
||||
"build": "tsc -b",
|
||||
"lint": "eslint src && prettier src --check",
|
||||
"prepare": "npm run build",
|
||||
"test": "jest"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/glob-to-regexp": "^0.4.4",
|
||||
"@types/node": "^22.0.0"
|
||||
"@types/node": "^24.12.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@gnuxie/typescript-result": "^1.0.0",
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
"devDependencies": {
|
||||
"@types/crypto-js": "^4.1.2",
|
||||
"@types/glob-to-regexp": "^0.4.1",
|
||||
"@types/node": "^20.14.9",
|
||||
"@vector-im/matrix-bot-sdk": "0.7.1-element.6",
|
||||
"@types/node": "^24.12.0",
|
||||
"@vector-im/matrix-bot-sdk": "0.8.0-element.3",
|
||||
"matrix-protection-suite": "file:../matrix-protection-suite",
|
||||
"typedoc": "^0.26.3"
|
||||
},
|
||||
@@ -36,7 +36,7 @@
|
||||
"peerDependencies": {
|
||||
"@sinclair/typebox": "0.34.13",
|
||||
"@the-draupnir-project/matrix-basic-types": "1.5.0",
|
||||
"@vector-im/matrix-bot-sdk": "0.7.1-element.6",
|
||||
"@vector-im/matrix-bot-sdk": "^0.8.0-element.3",
|
||||
"matrix-protection-suite": "file:../matrix-protection-suite"
|
||||
},
|
||||
"publishConfig": {
|
||||
|
||||
@@ -113,6 +113,28 @@ function unknownError(error: unknown): never {
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* This is a utility to extract the raw matrix event from a wrapper type
|
||||
* that vector bot-sdk decided to use inappropriately.
|
||||
* https://github.com/element-hq/matrix-bot-sdk/pull/68/changes#r2966217186
|
||||
*/
|
||||
export function extractRawRoomEvent(event: unknown): Record<string, unknown> {
|
||||
if (
|
||||
typeof event === "object" &&
|
||||
event !== null &&
|
||||
"event" in event &&
|
||||
typeof event.event === "object" &&
|
||||
event.event !== null
|
||||
) {
|
||||
return event.event as Record<string, unknown>;
|
||||
}
|
||||
// vector bot-sdk decided to be really silly and wrap the events in some
|
||||
// bad utility type, breaking compatibility with the turt2live upstream,
|
||||
// and generally making a terrible change.
|
||||
// https://github.com/element-hq/matrix-bot-sdk/pull/68/changes#r2966217186
|
||||
throw new TypeError("Something has changed upstream in vector bot sdk");
|
||||
}
|
||||
|
||||
export function is404(error: unknown): boolean {
|
||||
return (
|
||||
typeof error === "object" &&
|
||||
@@ -213,7 +235,9 @@ export class BotSDKBaseClient
|
||||
.getEvent(roomID, eventID)
|
||||
.then(
|
||||
(event) =>
|
||||
this.eventDecoder.decodeEvent(event) as ActionResult<TRoomEvent>,
|
||||
this.eventDecoder.decodeEvent(
|
||||
extractRawRoomEvent(event)
|
||||
) as ActionResult<TRoomEvent>,
|
||||
resultifyBotSDKRequestError
|
||||
);
|
||||
}
|
||||
@@ -225,7 +249,7 @@ export class BotSDKBaseClient
|
||||
return await this.client
|
||||
.getEvent(roomID, eventID)
|
||||
.then(
|
||||
(event) => Ok(event as Record<string, unknown>),
|
||||
(event) => Ok(extractRawRoomEvent(event)),
|
||||
resultifyBotSDKRequestError
|
||||
);
|
||||
}
|
||||
|
||||
+9
-1
@@ -30,6 +30,7 @@ import {
|
||||
StandardPolicyRoomEditor,
|
||||
ClientPlatform,
|
||||
RoomVersionMirror,
|
||||
RoomEvent,
|
||||
} from "matrix-protection-suite";
|
||||
import { MatrixSendClient } from "../MatrixEmitter";
|
||||
import { RoomStateManagerFactory } from "../ClientManagement/RoomStateManagerFactory";
|
||||
@@ -180,7 +181,14 @@ export class BotSDKPolicyRoomManager implements PolicyRoomManager {
|
||||
getPolicyRuleEvents(
|
||||
room: MatrixRoomReference
|
||||
): Promise<ActionResult<PolicyRuleEvent[]>> {
|
||||
return this.client.getRoomState(room.toRoomIDOrAlias()).then(
|
||||
return (
|
||||
this.client.getRoomState(room.toRoomIDOrAlias()) as unknown as Promise<
|
||||
RoomEvent[]
|
||||
>
|
||||
).then(
|
||||
// FIXME: I'm pretty sure this filter isn't doing anything, and also
|
||||
// it's really bad that we're not using the event coder on the ingress here.
|
||||
// And that this API exists at all in abscence of the rooms state manager.
|
||||
(events) => Ok(events.filter(isPolicyRuleEvent)),
|
||||
(exception: unknown) =>
|
||||
ActionError.Result(
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
"devDependencies": {
|
||||
"@types/crypto-js": "^4.2.2",
|
||||
"@types/glob-to-regexp": "^0.4.4",
|
||||
"@types/node": "^20.14.9",
|
||||
"@types/node": "^24.12.0",
|
||||
"typedoc": "^0.28.16",
|
||||
"wait-for-expect": "^3.0.2"
|
||||
},
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
},
|
||||
"private": false,
|
||||
"devDependencies": {
|
||||
"@types/node": "^20.17.57",
|
||||
"@types/node": "^24.12.0",
|
||||
"matrix-protection-suite": "file:../matrix-protection-suite"
|
||||
},
|
||||
"peerDependencies": {
|
||||
|
||||
Reference in New Issue
Block a user