requested changes

This commit is contained in:
H. Shay 2024-09-18 09:09:07 -07:00
parent 63510e96bd
commit 829c95700a
8 changed files with 1048 additions and 1107 deletions

View File

@ -47,6 +47,7 @@
"@sentry/node": "^7.17.2",
"@sentry/tracing": "^7.17.2",
"@tensorflow/tfjs-node": "^4.21.0",
"@vector-im/matrix-bot-sdk": "^0.7.1-element.0",
"await-lock": "^2.2.2",
"body-parser": "^1.20.1",
"config": "^3.3.8",
@ -63,8 +64,7 @@
"prom-client": "^14.1.0",
"shell-quote": "^1.7.3",
"ulidx": "^0.3.0",
"yaml": "^2.2.2",
"@vector-im/matrix-bot-sdk": "^0.7.1-element.0"
"yaml": "^2.2.2"
},
"engines": {
"node": ">=18.0.0"

View File

@ -47,7 +47,8 @@ export class AccessControl {
const accessControlList = new PolicyList(
accessControlListId,
Permalinks.forRoom(accessControlListId),
// @ts-ignore
// @ts-ignore - mismatch between client using @vector-im/matrix-bot-sdk and matrix-appservice-bridge using
// matrix-bot-sdk
bridge.getBot().getClient()
);
const accessControlUnit = new AccessControlUnit([accessControlList]);

View File

@ -140,7 +140,8 @@ export class MjolnirManager {
invite: [requestingUserId],
name: `${requestingUserId}'s mjolnir`
});
// @ts-ignore
// @ts-ignore - mismatch between client using @vector-im/matrix-bot-sdk and matrix-appservice-bridge using
// matrix-bot-sdk
const mjolnir = await this.makeInstance(requestingUserId, managementRoomId, mjIntent.matrixClient);
await mjolnir.createFirstList(requestingUserId, "list");
@ -183,7 +184,8 @@ export class MjolnirManager {
await this.makeInstance(
mjolnirRecord.owner,
mjolnirRecord.management_room,
// @ts-ignore
// @ts-ignore - mismatch between client using @vector-im/matrix-bot-sdk and matrix-appservice-bridge using
// matrix-bot-sdk
mjIntent.matrixClient,
).catch((e: any) => {
log.error(`Could not start mjolnir ${mjolnirRecord.local_part} for ${mjolnirRecord.owner}:`, e);

View File

@ -139,6 +139,7 @@ async function execSinceCommandAux(destinationRoomId: string, event: any, mjolni
}
//...or as a duration
// @ts-ignore
maybeMaxAgeMS = parseDuration(source);
if (maybeMaxAgeMS && !Number.isNaN(maybeMaxAgeMS)) {
maybeMaxAgeMS = Math.abs(maybeMaxAgeMS);

View File

@ -14,7 +14,14 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import { extractRequestError, LogLevel, LogService, Permalinks, RoomCreateOptions, UserID } from "@vector-im/matrix-bot-sdk";
import {
extractRequestError,
LogLevel,
LogService,
Permalinks,
RoomCreateOptions,
UserID
} from "@vector-im/matrix-bot-sdk";
import { EventEmitter } from "events";
import { ALL_RULE_TYPES, EntityType, ListRule, Recommendation, ROOM_RULE_TYPES, RULE_ROOM, RULE_SERVER, RULE_USER, SERVER_RULE_TYPES, USER_RULE_TYPES } from "./ListRule";
import { MatrixSendClient } from "../MatrixEmitter";

View File

@ -176,6 +176,7 @@ export class DurationMSProtectionSetting extends AbstractProtectionSetting<numbe
fromString(data: string) {
let number = parseDuration(data);
// @ts-ignore
return isNaN(number) ? undefined : number;
}
validate(data: number) {

View File

@ -63,6 +63,7 @@ export async function registerUser(homeserver: string, username: string, display
} catch (ex) {
let err;
if (ex instanceof Error) {
// @ts-ignore - objectively this works, a temp hack anyway
err = ex.body.errcode
} else {
err = ex.errcode

2130
yarn.lock

File diff suppressed because it is too large Load Diff