mirror of
https://github.com/matrix-org/mjolnir.git
synced 2024-10-01 01:36:06 -04:00
Update references to bot-sdk
This commit is contained in:
parent
167597fbb9
commit
c501f3d290
@ -15,7 +15,7 @@ limitations under the License.
|
||||
*/
|
||||
|
||||
import * as Sentry from "@sentry/node";
|
||||
import { extractRequestError, LogLevel, LogService, MessageType, Permalinks, TextualMessageEventContent, UserID } from "matrix-bot-sdk";
|
||||
import { extractRequestError, LogLevel, LogService, MessageType, Permalinks, TextualMessageEventContent, UserID } from "@vector-im/matrix-bot-sdk";
|
||||
import { IConfig } from "./config";
|
||||
import { MatrixSendClient } from "./MatrixEmitter";
|
||||
import { htmlEscape } from "./utils";
|
||||
|
@ -15,7 +15,7 @@ limitations under the License.
|
||||
*/
|
||||
|
||||
import EventEmitter from "events";
|
||||
import { MatrixClient } from "matrix-bot-sdk";
|
||||
import { MatrixClient } from "@vector-im/matrix-bot-sdk";
|
||||
|
||||
/**
|
||||
* This is an interface created in order to keep the event listener
|
||||
|
@ -19,7 +19,7 @@ import {
|
||||
LogLevel,
|
||||
LogService,
|
||||
MembershipEvent,
|
||||
} from "matrix-bot-sdk";
|
||||
} from "@vector-im/matrix-bot-sdk";
|
||||
|
||||
import { ALL_RULE_TYPES as ALL_BAN_LIST_RULE_TYPES } from "./models/ListRule";
|
||||
import { COMMAND_PREFIX, handleCommand } from "./commands/CommandHandler";
|
||||
|
@ -15,7 +15,7 @@ limitations under the License.
|
||||
*/
|
||||
|
||||
import AwaitLock from 'await-lock';
|
||||
import { extractRequestError, LogService, Permalinks } from "matrix-bot-sdk";
|
||||
import { extractRequestError, LogService, Permalinks } from "@vector-im/matrix-bot-sdk";
|
||||
import { IConfig } from "./config";
|
||||
import { MatrixSendClient } from './MatrixEmitter';
|
||||
const PROTECTED_ROOMS_EVENT_TYPE = "org.matrix.mjolnir.protected_rooms";
|
||||
|
@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
import { LogLevel, LogService, MatrixGlob, Permalinks, UserID } from "matrix-bot-sdk";
|
||||
import { LogLevel, LogService, MatrixGlob, Permalinks, UserID } from "@vector-im/matrix-bot-sdk";
|
||||
import { IConfig } from "./config";
|
||||
import ErrorCache, { ERROR_KIND_FATAL, ERROR_KIND_PERMISSION } from "./ErrorCache";
|
||||
import ManagementRoomOutput from "./ManagementRoomOutput";
|
||||
|
@ -17,7 +17,7 @@ limitations under the License.
|
||||
import { Bridge } from "matrix-appservice-bridge";
|
||||
import AccessControlUnit, { EntityAccess } from "../models/AccessControlUnit";
|
||||
import PolicyList from "../models/PolicyList";
|
||||
import { Permalinks } from "matrix-bot-sdk";
|
||||
import { Permalinks } from "@vector-im/matrix-bot-sdk";
|
||||
|
||||
/**
|
||||
* Utility to manage which users have access to the application service,
|
||||
|
@ -3,7 +3,7 @@ import { Request, WeakEvent, BridgeContext, Bridge, Intent, Logger } from "matri
|
||||
import { getProvisionedMjolnirConfig } from "../config";
|
||||
import { IConfig as IAppserviceConfig } from "./config/config";
|
||||
import PolicyList from "../models/PolicyList";
|
||||
import { Permalinks, MatrixClient } from "matrix-bot-sdk";
|
||||
import { Permalinks, MatrixClient } from "@vector-im/matrix-bot-sdk";
|
||||
import { DataStore } from "./datastore";
|
||||
import { AccessControl } from "./AccessControl";
|
||||
import { Access } from "../models/AccessControlUnit";
|
||||
|
@ -15,7 +15,7 @@ limitations under the License.
|
||||
*/
|
||||
|
||||
import { Mjolnir } from "../Mjolnir";
|
||||
import { extractRequestError, LogLevel, LogService } from "matrix-bot-sdk";
|
||||
import { extractRequestError, LogLevel, LogService } from "@vector-im/matrix-bot-sdk";
|
||||
|
||||
// !mjolnir rooms add <room alias/ID>
|
||||
export async function execAddProtectedRoom(roomId: string, event: any, mjolnir: Mjolnir, parts: string[]) {
|
||||
|
@ -15,7 +15,7 @@ limitations under the License.
|
||||
*/
|
||||
|
||||
import { Mjolnir } from "../Mjolnir";
|
||||
import { RichReply } from "matrix-bot-sdk";
|
||||
import { RichReply } from "@vector-im/matrix-bot-sdk";
|
||||
|
||||
async function addRemoveFromDirectory(inRoomId: string, event: any, mjolnir: Mjolnir, roomRef: string, visibility: "public" | "private") {
|
||||
const isAdmin = await mjolnir.isSynapseAdmin();
|
||||
|
@ -15,7 +15,7 @@ limitations under the License.
|
||||
*/
|
||||
|
||||
import { Mjolnir } from "../Mjolnir";
|
||||
import { RichReply } from "matrix-bot-sdk";
|
||||
import { RichReply } from "@vector-im/matrix-bot-sdk";
|
||||
import { htmlEscape } from "../utils";
|
||||
|
||||
// !mjolnir move <alias> <new room ID>
|
||||
|
@ -18,7 +18,7 @@ import { Mjolnir } from "../Mjolnir";
|
||||
import { execStatusCommand } from "./StatusCommand";
|
||||
import { execBanCommand, execUnbanCommand } from "./UnbanBanCommand";
|
||||
import { execDumpRulesCommand, execRulesMatchingCommand } from "./DumpRulesCommand";
|
||||
import { extractRequestError, LogService, RichReply } from "matrix-bot-sdk";
|
||||
import { extractRequestError, LogService, RichReply } from "@vector-im/matrix-bot-sdk";
|
||||
import { htmlEscape } from "../utils";
|
||||
import { execSyncCommand } from "./SyncCommand";
|
||||
import { execPermissionCheckCommand } from "./PermissionCheckCommand";
|
||||
|
@ -16,7 +16,7 @@ limitations under the License.
|
||||
|
||||
import { Mjolnir } from "../Mjolnir";
|
||||
import PolicyList from "../models/PolicyList";
|
||||
import { Permalinks, RichReply } from "matrix-bot-sdk";
|
||||
import { Permalinks, RichReply } from "@vector-im/matrix-bot-sdk";
|
||||
|
||||
// !mjolnir list create <shortcode> <alias localpart>
|
||||
export async function execCreateListCommand(roomId: string, event: any, mjolnir: Mjolnir, parts: string[]) {
|
||||
|
@ -15,7 +15,7 @@ limitations under the License.
|
||||
*/
|
||||
|
||||
import { Mjolnir } from "../Mjolnir";
|
||||
import { RichReply } from "matrix-bot-sdk";
|
||||
import { RichReply } from "@vector-im/matrix-bot-sdk";
|
||||
|
||||
// !mjolnir deactivate <user ID>
|
||||
export async function execDeactivateCommand(roomId: string, event: any, mjolnir: Mjolnir, parts: string[]) {
|
||||
|
@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
import { RichReply } from "matrix-bot-sdk";
|
||||
import { RichReply } from "@vector-im/matrix-bot-sdk";
|
||||
import { Mjolnir } from "../Mjolnir";
|
||||
import { EntityType } from "../models/ListRule";
|
||||
import { htmlEscape } from "../utils";
|
||||
|
@ -15,7 +15,7 @@ limitations under the License.
|
||||
*/
|
||||
|
||||
import { Mjolnir } from "../Mjolnir";
|
||||
import { RichReply } from "matrix-bot-sdk";
|
||||
import { RichReply } from "@vector-im/matrix-bot-sdk";
|
||||
import { EntityType } from "../models/ListRule";
|
||||
import PolicyList from "../models/PolicyList";
|
||||
|
||||
|
@ -15,7 +15,7 @@ limitations under the License.
|
||||
*/
|
||||
|
||||
import { Mjolnir } from "../Mjolnir";
|
||||
import { LogLevel, MatrixGlob, RichReply } from "matrix-bot-sdk";
|
||||
import { LogLevel, MatrixGlob, RichReply } from "@vector-im/matrix-bot-sdk";
|
||||
|
||||
// !mjolnir kick <user|filter> [room] [reason]
|
||||
export async function execKickCommand(roomId: string, event: any, mjolnir: Mjolnir, parts: string[]) {
|
||||
|
@ -15,7 +15,7 @@ limitations under the License.
|
||||
*/
|
||||
|
||||
import { Mjolnir } from "../Mjolnir";
|
||||
import { Permalinks, RichReply } from "matrix-bot-sdk";
|
||||
import { Permalinks, RichReply } from "@vector-im/matrix-bot-sdk";
|
||||
|
||||
// !mjolnir rooms
|
||||
export async function execListProtectedRooms(roomId: string, event: any, mjolnir: Mjolnir) {
|
||||
|
@ -15,7 +15,7 @@ limitations under the License.
|
||||
*/
|
||||
|
||||
import { Mjolnir } from "../Mjolnir";
|
||||
import { RichReply } from "matrix-bot-sdk";
|
||||
import { RichReply } from "@vector-im/matrix-bot-sdk";
|
||||
|
||||
// !mjolnir make admin <room> [<user ID>]
|
||||
export async function execMakeRoomAdminCommand(roomId: string, event: any, mjolnir: Mjolnir, parts: string[]) {
|
||||
|
@ -16,7 +16,7 @@ limitations under the License.
|
||||
|
||||
import { htmlEscape } from "../utils";
|
||||
import { Mjolnir } from "../Mjolnir";
|
||||
import { extractRequestError, LogService, RichReply } from "matrix-bot-sdk";
|
||||
import { extractRequestError, LogService, RichReply } from "@vector-im/matrix-bot-sdk";
|
||||
import { isListSetting } from "../protections/ProtectionSettings";
|
||||
|
||||
// !mjolnir enable <protection>
|
||||
|
@ -16,7 +16,7 @@ limitations under the License.
|
||||
|
||||
import { Mjolnir } from "../Mjolnir";
|
||||
import { redactUserMessagesIn } from "../utils";
|
||||
import { Permalinks } from "matrix-bot-sdk";
|
||||
import { Permalinks } from "@vector-im/matrix-bot-sdk";
|
||||
|
||||
// !mjolnir redact <user ID> [room alias] [limit]
|
||||
export async function execRedactCommand(roomId: string, event: any, mjolnir: Mjolnir, parts: string[]) {
|
||||
|
@ -15,7 +15,7 @@ limitations under the License.
|
||||
*/
|
||||
|
||||
import { Mjolnir } from "../Mjolnir";
|
||||
import { RichReply } from "matrix-bot-sdk";
|
||||
import { RichReply } from "@vector-im/matrix-bot-sdk";
|
||||
|
||||
export const DEFAULT_LIST_EVENT_TYPE = "org.matrix.mjolnir.default_list";
|
||||
|
||||
|
@ -15,7 +15,7 @@ limitations under the License.
|
||||
*/
|
||||
|
||||
import { Mjolnir } from "../Mjolnir";
|
||||
import { extractRequestError, LogLevel, LogService } from "matrix-bot-sdk";
|
||||
import { extractRequestError, LogLevel, LogService } from "@vector-im/matrix-bot-sdk";
|
||||
|
||||
// !mjolnir powerlevel <user ID> <level> [room]
|
||||
export async function execSetPowerLevelCommand(roomId: string, event: any, mjolnir: Mjolnir, parts: string[]) {
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { Mjolnir } from "../Mjolnir";
|
||||
import { LogLevel } from "matrix-bot-sdk";
|
||||
import { LogLevel } from "@vector-im/matrix-bot-sdk";
|
||||
|
||||
const EVENT_MODERATED_BY = "org.matrix.msc3215.room.moderation.moderated_by";
|
||||
const EVENT_MODERATOR_OF = "org.matrix.msc3215.room.moderation.moderator_of";
|
||||
|
@ -15,7 +15,7 @@ limitations under the License.
|
||||
*/
|
||||
|
||||
import { Mjolnir } from "../Mjolnir";
|
||||
import { RichReply } from "matrix-bot-sdk";
|
||||
import { RichReply } from "@vector-im/matrix-bot-sdk";
|
||||
|
||||
// !mjolnir shutdown room <room> [<message>]
|
||||
export async function execShutdownRoomCommand(roomId: string, event: any, mjolnir: Mjolnir, parts: string[]) {
|
||||
|
@ -15,7 +15,7 @@ limitations under the License.
|
||||
*/
|
||||
|
||||
import { Mjolnir } from "../Mjolnir";
|
||||
import { LogLevel, LogService, RichReply } from "matrix-bot-sdk";
|
||||
import { LogLevel, LogService, RichReply } from "@vector-im/matrix-bot-sdk";
|
||||
import { htmlEscape, parseDuration } from "../utils";
|
||||
import { ParseEntry } from "shell-quote";
|
||||
import { HumanizeDurationLanguage, HumanizeDuration } from "humanize-duration-ts";
|
||||
|
@ -15,7 +15,7 @@ limitations under the License.
|
||||
*/
|
||||
|
||||
import { Mjolnir, STATE_CHECKING_PERMISSIONS, STATE_NOT_STARTED, STATE_RUNNING, STATE_SYNCING } from "../Mjolnir";
|
||||
import { RichReply } from "matrix-bot-sdk";
|
||||
import { RichReply } from "@vector-im/matrix-bot-sdk";
|
||||
import { htmlEscape, parseDuration } from "../utils";
|
||||
import { HumanizeDurationLanguage, HumanizeDuration } from "humanize-duration-ts";
|
||||
import PolicyList from "../models/PolicyList";
|
||||
|
@ -15,7 +15,7 @@ limitations under the License.
|
||||
*/
|
||||
|
||||
import {Mjolnir} from "../Mjolnir";
|
||||
import {RichReply} from "matrix-bot-sdk";
|
||||
import {RichReply} from "@vector-im/matrix-bot-sdk";
|
||||
|
||||
export async function execSuspendCommand(roomId: string, event: any, mjolnir: Mjolnir, parts: string[]) {
|
||||
const target = parts[2];
|
||||
|
@ -16,7 +16,7 @@ limitations under the License.
|
||||
|
||||
import { Mjolnir } from "../Mjolnir";
|
||||
import PolicyList from "../models/PolicyList";
|
||||
import { extractRequestError, LogLevel, LogService, MatrixGlob, RichReply } from "matrix-bot-sdk";
|
||||
import { extractRequestError, LogLevel, LogService, MatrixGlob, RichReply } from "@vector-im/matrix-bot-sdk";
|
||||
import { RULE_ROOM, RULE_SERVER, RULE_USER, USER_RULE_TYPES } from "../models/ListRule";
|
||||
import { DEFAULT_LIST_EVENT_TYPE } from "./SetDefaultBanListCommand";
|
||||
|
||||
|
@ -15,7 +15,7 @@ limitations under the License.
|
||||
*/
|
||||
|
||||
import {Mjolnir} from "../Mjolnir";
|
||||
import {RichReply} from "matrix-bot-sdk";
|
||||
import {RichReply} from "@vector-im/matrix-bot-sdk";
|
||||
|
||||
export async function execUnsuspendCommand(roomId: string, event: any, mjolnir: Mjolnir, parts: string[]) {
|
||||
const target = parts[2];
|
||||
|
@ -15,7 +15,7 @@ limitations under the License.
|
||||
*/
|
||||
|
||||
import { Mjolnir } from "../Mjolnir";
|
||||
import { Permalinks, RichReply } from "matrix-bot-sdk";
|
||||
import { Permalinks, RichReply } from "@vector-im/matrix-bot-sdk";
|
||||
|
||||
// !mjolnir watch <room alias or ID>
|
||||
export async function execWatchCommand(roomId: string, event: any, mjolnir: Mjolnir, parts: string[]) {
|
||||
|
@ -16,7 +16,7 @@ limitations under the License.
|
||||
|
||||
import * as fs from "fs";
|
||||
import { load } from "js-yaml";
|
||||
import { MatrixClient, LogService } from "matrix-bot-sdk";
|
||||
import { MatrixClient, LogService } from "@vector-im/matrix-bot-sdk";
|
||||
import Config from "config";
|
||||
|
||||
export interface IHealthConfig {
|
||||
|
@ -15,7 +15,7 @@ limitations under the License.
|
||||
*/
|
||||
|
||||
import * as http from "http";
|
||||
import { LogService } from "matrix-bot-sdk";
|
||||
import { LogService } from "@vector-im/matrix-bot-sdk";
|
||||
import { IConfig } from "../config";
|
||||
// allowed to use the global configuration since this is only intended to be used by `src/index.ts`.
|
||||
|
||||
|
@ -25,7 +25,7 @@ import {
|
||||
PantalaimonClient,
|
||||
RichConsoleLogger,
|
||||
SimpleFsStorageProvider
|
||||
} from "matrix-bot-sdk";
|
||||
} from "@vector-im/matrix-bot-sdk";
|
||||
|
||||
import { read as configRead } from "./config";
|
||||
import { Mjolnir } from "./Mjolnir";
|
||||
|
@ -16,7 +16,7 @@ limitations under the License.
|
||||
|
||||
import PolicyList, { ChangeType, ListRuleChange } from "./PolicyList";
|
||||
import { EntityType, ListRule, Recommendation, RULE_SERVER, RULE_USER } from "./ListRule";
|
||||
import { LogService, UserID } from "matrix-bot-sdk";
|
||||
import { LogService, UserID } from "@vector-im/matrix-bot-sdk";
|
||||
import { ServerAcl } from "./ServerAcl";
|
||||
|
||||
/**
|
||||
|
@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
import { MatrixGlob } from "matrix-bot-sdk";
|
||||
import { MatrixGlob } from "@vector-im/matrix-bot-sdk";
|
||||
|
||||
export enum EntityType {
|
||||
/// `entity` is to be parsed as a glob of users IDs
|
||||
|
@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
import { extractRequestError, LogLevel, LogService, Permalinks, RoomCreateOptions, UserID } from "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";
|
||||
|
@ -15,7 +15,7 @@ limitations under the License.
|
||||
*/
|
||||
import BanList, { ChangeType, ListRuleChange } from "./PolicyList"
|
||||
import * as crypto from "crypto";
|
||||
import { LogService } from "matrix-bot-sdk";
|
||||
import { LogService } from "@vector-im/matrix-bot-sdk";
|
||||
import { EntityType, ListRule } from "./ListRule";
|
||||
import PolicyList from "./PolicyList";
|
||||
|
||||
|
@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
import { MatrixGlob } from "matrix-bot-sdk";
|
||||
import { MatrixGlob } from "@vector-im/matrix-bot-sdk";
|
||||
import { setToArray } from "../utils";
|
||||
|
||||
export interface ServerAclContent {
|
||||
|
@ -17,7 +17,7 @@ limitations under the License.
|
||||
import { Protection } from "./IProtection";
|
||||
import { NumberProtectionSetting } from "./ProtectionSettings";
|
||||
import { Mjolnir } from "../Mjolnir";
|
||||
import { LogLevel, LogService } from "matrix-bot-sdk";
|
||||
import { LogLevel, LogService } from "@vector-im/matrix-bot-sdk";
|
||||
|
||||
// if this is exceeded, we'll ban the user for spam and redact their messages
|
||||
export const DEFAULT_MAX_PER_MINUTE = 10;
|
||||
|
@ -17,7 +17,7 @@ limitations under the License.
|
||||
import { Protection } from "./IProtection";
|
||||
import { DurationMSProtectionSetting, NumberProtectionSetting, StringSetProtectionSetting } from "./ProtectionSettings";
|
||||
import { Mjolnir } from "../Mjolnir";
|
||||
import { LogLevel, UserID } from "matrix-bot-sdk";
|
||||
import { LogLevel, UserID } from "@vector-im/matrix-bot-sdk";
|
||||
|
||||
const DEFAULT_BUCKET_DURATION_MS = 10_000;
|
||||
const DEFAULT_BUCKET_NUMBER = 6;
|
||||
|
@ -16,7 +16,7 @@ limitations under the License.
|
||||
|
||||
import { Protection } from "./IProtection";
|
||||
import { Mjolnir } from "../Mjolnir";
|
||||
import { LogLevel, LogService } from "matrix-bot-sdk";
|
||||
import { LogLevel, LogService } from "@vector-im/matrix-bot-sdk";
|
||||
import { isTrueJoinEvent } from "../utils";
|
||||
|
||||
export class FirstMessageIsImage extends Protection {
|
||||
|
@ -17,7 +17,7 @@ limitations under the License.
|
||||
import {Protection} from "./IProtection";
|
||||
import {Mjolnir} from "../Mjolnir";
|
||||
import {NumberProtectionSetting} from "./ProtectionSettings";
|
||||
import {LogLevel} from "matrix-bot-sdk";
|
||||
import {LogLevel} from "@vector-im/matrix-bot-sdk";
|
||||
|
||||
const DEFAULT_MAX_PER_TIMESCALE = 50;
|
||||
const DEFAULT_TIMESCALE_MINUTES = 60;
|
||||
|
@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
import { LogLevel } from "matrix-bot-sdk";
|
||||
import { LogLevel } from "@vector-im/matrix-bot-sdk";
|
||||
import { Mjolnir } from "../Mjolnir";
|
||||
import { Protection } from "./IProtection";
|
||||
|
||||
|
@ -16,7 +16,7 @@ limitations under the License.
|
||||
|
||||
import { Protection } from "./IProtection";
|
||||
import { Mjolnir } from "../Mjolnir";
|
||||
import { LogLevel, Permalinks, UserID } from "matrix-bot-sdk";
|
||||
import { LogLevel, Permalinks, UserID } from "@vector-im/matrix-bot-sdk";
|
||||
|
||||
export class MessageIsMedia extends Protection {
|
||||
|
||||
|
@ -16,7 +16,7 @@ limitations under the License.
|
||||
|
||||
import { Protection } from "./IProtection";
|
||||
import { Mjolnir } from "../Mjolnir";
|
||||
import { LogLevel, Permalinks, UserID } from "matrix-bot-sdk";
|
||||
import { LogLevel, Permalinks, UserID } from "@vector-im/matrix-bot-sdk";
|
||||
|
||||
export class MessageIsVoice extends Protection {
|
||||
|
||||
|
@ -17,7 +17,7 @@ limitations under the License.
|
||||
import { Protection } from "./IProtection";
|
||||
import { Mjolnir } from "../Mjolnir";
|
||||
import * as nsfw from 'nsfwjs';
|
||||
import {LogLevel} from "matrix-bot-sdk";
|
||||
import {LogLevel} from "@vector-im/matrix-bot-sdk";
|
||||
import { node } from '@tensorflow/tfjs-node';
|
||||
|
||||
|
||||
|
@ -24,7 +24,7 @@ import { MessageIsMedia } from "./MessageIsMedia";
|
||||
import { TrustedReporters } from "./TrustedReporters";
|
||||
import { JoinWaveShortCircuit } from "./JoinWaveShortCircuit";
|
||||
import { Mjolnir } from "../Mjolnir";
|
||||
import { extractRequestError, LogLevel, LogService, Permalinks } from "matrix-bot-sdk";
|
||||
import { extractRequestError, LogLevel, LogService, Permalinks } from "@vector-im/matrix-bot-sdk";
|
||||
import { ProtectionSettingValidationError } from "./ProtectionSettings";
|
||||
import { Consequence } from "./consequence";
|
||||
import { htmlEscape } from "../utils";
|
||||
|
@ -17,7 +17,7 @@ limitations under the License.
|
||||
import { Protection } from "./IProtection";
|
||||
import { ConsequenceBan, ConsequenceRedact } from "./consequence";
|
||||
import { Mjolnir } from "../Mjolnir";
|
||||
import { LogLevel, LogService } from "matrix-bot-sdk";
|
||||
import { LogLevel, LogService } from "@vector-im/matrix-bot-sdk";
|
||||
import { isTrueJoinEvent } from "../utils";
|
||||
|
||||
export class WordList extends Protection {
|
||||
|
@ -13,7 +13,7 @@ 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.
|
||||
*/
|
||||
import { LogLevel, MatrixClient } from "matrix-bot-sdk"
|
||||
import { LogLevel, MatrixClient } from "@vector-im/matrix-bot-sdk"
|
||||
import { ERROR_KIND_FATAL } from "../ErrorCache";
|
||||
import { RoomUpdateError } from "../models/RoomUpdateError";
|
||||
import { redactUserMessagesIn } from "../utils";
|
||||
|
@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
import { extractRequestError, LogLevel } from "matrix-bot-sdk";
|
||||
import { extractRequestError, LogLevel } from "@vector-im/matrix-bot-sdk";
|
||||
import { Mjolnir } from "../Mjolnir";
|
||||
|
||||
export type Task<T> = (queue: ThrottlingQueue) => Promise<T>;
|
||||
|
@ -13,7 +13,7 @@ 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.
|
||||
*/
|
||||
import { extractRequestError, LogLevel, LogService, Permalinks } from "matrix-bot-sdk";
|
||||
import { extractRequestError, LogLevel, LogService, Permalinks } from "@vector-im/matrix-bot-sdk";
|
||||
import { Mjolnir } from "../Mjolnir";
|
||||
|
||||
/**
|
||||
|
@ -14,8 +14,8 @@ See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
import { PowerLevelAction } from "matrix-bot-sdk/lib/models/PowerLevelAction";
|
||||
import { LogService, UserID } from "matrix-bot-sdk";
|
||||
import { PowerLevelAction } from "@vector-im/matrix-bot-sdk/lib/models/PowerLevelAction";
|
||||
import { LogService, UserID } from "@vector-im/matrix-bot-sdk";
|
||||
import { htmlToText } from "html-to-text";
|
||||
import { htmlEscape } from "../utils";
|
||||
import { JSDOM } from 'jsdom';
|
||||
|
@ -16,7 +16,7 @@ limitations under the License.
|
||||
|
||||
import { Mjolnir, REPORT_POLL_EVENT_TYPE } from "../Mjolnir";
|
||||
import { ReportManager } from './ReportManager';
|
||||
import { LogLevel } from "matrix-bot-sdk";
|
||||
import { LogLevel } from "@vector-im/matrix-bot-sdk";
|
||||
|
||||
class InvalidStateError extends Error { }
|
||||
|
||||
|
@ -20,7 +20,7 @@ import {
|
||||
MatrixGlob,
|
||||
getRequestFn,
|
||||
setRequestFn,
|
||||
} from "matrix-bot-sdk";
|
||||
} from "@vector-im/matrix-bot-sdk";
|
||||
import { ClientRequest, IncomingMessage } from "http";
|
||||
import { default as parseDuration } from "parse-duration";
|
||||
import * as Sentry from '@sentry/node';
|
||||
|
@ -16,7 +16,7 @@ limitations under the License.
|
||||
|
||||
import { Server } from "http";
|
||||
import express from "express";
|
||||
import { LogService } from "matrix-bot-sdk";
|
||||
import { LogService } from "@vector-im/matrix-bot-sdk";
|
||||
import { IHealthConfig } from "../config";
|
||||
import { collectDefaultMetrics, register } from "prom-client";
|
||||
|
||||
|
@ -16,7 +16,7 @@ limitations under the License.
|
||||
|
||||
import { Server } from "http";
|
||||
import express from "express";
|
||||
import { LogService, MatrixClient } from "matrix-bot-sdk";
|
||||
import { LogService, MatrixClient } from "@vector-im/matrix-bot-sdk";
|
||||
import RuleServer from "../models/RuleServer";
|
||||
import { ReportManager } from "../report/ReportManager";
|
||||
import { IConfig } from "../config";
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { isPolicyRoom, readTestConfig, setupHarness } from "../utils/harness";
|
||||
import { newTestUser } from "../../integration/clientHelper";
|
||||
import { getFirstReply } from "../../integration/commands/commandUtils";
|
||||
import { MatrixClient } from "matrix-bot-sdk";
|
||||
import { MatrixClient } from "@vector-im/matrix-bot-sdk";
|
||||
import { MjolnirAppService } from "../../../src/appservice/AppService";
|
||||
import dns from 'node:dns';
|
||||
|
||||
|
@ -2,7 +2,7 @@ import { MjolnirAppService } from "../../../src/appservice/AppService";
|
||||
import { newTestUser } from "../../integration/clientHelper";
|
||||
import { isPolicyRoom, readTestConfig, setupHarness } from "../utils/harness";
|
||||
import { CreateMjolnirResponse, MjolnirWebAPIClient } from "../utils/webAPIClient";
|
||||
import { MatrixClient } from "matrix-bot-sdk";
|
||||
import { MatrixClient } from "@vector-im/matrix-bot-sdk";
|
||||
import { getFirstReply } from "../../integration/commands/commandUtils";
|
||||
import expect from "expect";
|
||||
import dns from 'node:dns';
|
||||
|
@ -4,7 +4,7 @@ import { ensureAliasedRoomExists } from "../../integration/mjolnirSetupUtils";
|
||||
import { read as configRead, IConfig } from "../../../src/appservice/config/config";
|
||||
import { newTestUser } from "../../integration/clientHelper";
|
||||
import PolicyList from "../../../src/models/PolicyList";
|
||||
import { CreateEvent, MatrixClient } from "matrix-bot-sdk";
|
||||
import { CreateEvent, MatrixClient } from "@vector-im/matrix-bot-sdk";
|
||||
|
||||
export function readTestConfig(): IConfig {
|
||||
return configRead(path.join(__dirname, "../../../src/appservice/config/config.harness.yaml"));
|
||||
|
@ -1,5 +1,5 @@
|
||||
import * as request from "request";
|
||||
import { MatrixClient } from "matrix-bot-sdk";
|
||||
import { MatrixClient } from "@vector-im/matrix-bot-sdk";
|
||||
|
||||
interface OpenIDTokenInfo {
|
||||
access_token: string,
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { MatrixClient } from "matrix-bot-sdk";
|
||||
import { MatrixClient } from "@vector-im/matrix-bot-sdk";
|
||||
import { Mjolnir } from "../../src/Mjolnir"
|
||||
import { newTestUser } from "./clientHelper";
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { strict as assert } from "assert";
|
||||
import { newTestUser } from "./clientHelper";
|
||||
import { LogService, MatrixClient, Permalinks, UserID } from "matrix-bot-sdk";
|
||||
import { LogService, MatrixClient, Permalinks, UserID } from "@vector-im/matrix-bot-sdk";
|
||||
import PolicyList, { ChangeType } from "../../src/models/PolicyList";
|
||||
import { ServerAcl } from "../../src/models/ServerAcl";
|
||||
import { getFirstReaction } from "./commands/commandUtils";
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { HmacSHA1 } from "crypto-js";
|
||||
import { getRequestFn, LogService, MatrixClient, MemoryStorageProvider, PantalaimonClient } from "matrix-bot-sdk";
|
||||
import { getRequestFn, LogService, MatrixClient, MemoryStorageProvider, PantalaimonClient } from "@vector-im/matrix-bot-sdk";
|
||||
|
||||
const REGISTRATION_ATTEMPTS = 10;
|
||||
const REGISTRATION_RETRY_BASE_DELAY_MS = 100;
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { MatrixClient } from "matrix-bot-sdk";
|
||||
import { MatrixClient } from "@vector-im/matrix-bot-sdk";
|
||||
import { strict as assert } from "assert";
|
||||
import * as crypto from "crypto";
|
||||
import { MatrixEmitter } from "../../../src/MatrixEmitter";
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
import { newTestUser } from "../clientHelper";
|
||||
import { PowerLevelAction } from "matrix-bot-sdk/lib/models/PowerLevelAction";
|
||||
import { LogService } from "matrix-bot-sdk";
|
||||
import { LogService } from "@vector-im/matrix-bot-sdk";
|
||||
import { getFirstReaction } from "./commandUtils";
|
||||
|
||||
describe("Test: The make admin command", function () {
|
||||
|
@ -2,7 +2,7 @@ import { strict as assert } from "assert";
|
||||
|
||||
import { newTestUser } from "../clientHelper";
|
||||
import { getMessagesByUserIn } from "../../../src/utils";
|
||||
import { LogService } from "matrix-bot-sdk";
|
||||
import { LogService } from "@vector-im/matrix-bot-sdk";
|
||||
import { getFirstReaction } from "./commandUtils";
|
||||
|
||||
describe("Test: The redaction command", function () {
|
||||
|
@ -16,7 +16,7 @@ limitations under the License.
|
||||
|
||||
import {newTestUser} from "../clientHelper";
|
||||
import {strict as assert} from "assert";
|
||||
import { MatrixClient, RoomCreateOptions } from "matrix-bot-sdk";
|
||||
import { MatrixClient, RoomCreateOptions } from "@vector-im/matrix-bot-sdk";
|
||||
import { read as configRead } from "../../../src/config";
|
||||
|
||||
describe("Test: suspend/unsuspend command", function () {
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { strict as assert } from "assert";
|
||||
|
||||
import { UserID } from "matrix-bot-sdk";
|
||||
import { UserID } from "@vector-im/matrix-bot-sdk";
|
||||
import { Suite } from "mocha";
|
||||
import { Mjolnir } from "../../src/Mjolnir";
|
||||
import { DetectFederationLag, LAG_STATE_EVENT } from "../../src/protections/DetectFederationLag";
|
||||
|
@ -20,7 +20,7 @@ import {
|
||||
LogService,
|
||||
LogLevel,
|
||||
RichConsoleLogger
|
||||
} from "matrix-bot-sdk";
|
||||
} from "@vector-im/matrix-bot-sdk";
|
||||
|
||||
import { Mjolnir} from '../../src/Mjolnir';
|
||||
import { overrideRatelimitForUser, registerUser } from "./clientHelper";
|
||||
|
@ -1,6 +1,6 @@
|
||||
import {newTestUser} from "./clientHelper";
|
||||
|
||||
import {MatrixClient} from "matrix-bot-sdk";
|
||||
import {MatrixClient} from "@vector-im/matrix-bot-sdk";
|
||||
import {getFirstReaction} from "./commands/commandUtils";
|
||||
import {strict as assert} from "assert";
|
||||
import { readFileSync } from 'fs';
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { strict as assert } from "assert";
|
||||
import { getRequestFn } from "matrix-bot-sdk";
|
||||
import { getRequestFn } from "@vector-im/matrix-bot-sdk";
|
||||
|
||||
import { IConfig } from "../../src/config";
|
||||
|
||||
|
@ -3,7 +3,7 @@ import { strict as assert } from "assert";
|
||||
import { newTestUser } from "./clientHelper";
|
||||
import { Mjolnir } from "../../src/Mjolnir";
|
||||
import { read as configRead } from "../../src/config";
|
||||
import { getRequestFn, LogService } from "matrix-bot-sdk";
|
||||
import { getRequestFn, LogService } from "@vector-im/matrix-bot-sdk";
|
||||
import { createBanList, getFirstReaction } from "./commands/commandUtils";
|
||||
|
||||
/**
|
||||
|
@ -1,6 +1,6 @@
|
||||
|
||||
import { strict as assert } from "assert";
|
||||
import { MatrixClient, Permalinks, UserID } from "matrix-bot-sdk";
|
||||
import { MatrixClient, Permalinks, UserID } from "@vector-im/matrix-bot-sdk";
|
||||
import { MatrixSendClient } from "../../src/MatrixEmitter";
|
||||
import { Mjolnir } from "../../src/Mjolnir";
|
||||
import PolicyList from "../../src/models/PolicyList";
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { strict as assert } from "assert";
|
||||
|
||||
import { UserID } from "matrix-bot-sdk";
|
||||
import { UserID } from "@vector-im/matrix-bot-sdk";
|
||||
import { ThrottlingQueue } from "../../src/queues/ThrottlingQueue";
|
||||
|
||||
describe("Test: ThrottlingQueue", function() {
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { strict as assert } from "assert";
|
||||
import { LogLevel } from "matrix-bot-sdk";
|
||||
import { LogLevel } from "@vector-im/matrix-bot-sdk";
|
||||
import ManagementRoomOutput from "../../src/ManagementRoomOutput";
|
||||
|
||||
describe("Test: utils", function() {
|
||||
|
Loading…
Reference in New Issue
Block a user