Commit Graph

183 Commits

Author SHA1 Message Date
gnuxie
88bf45b404 Update to MPS 1.5.0 for PersistentConfigData features. 2024-10-02 11:32:04 +01:00
gnuxie
b9c05fbb6b Update interface-manager for better infrence on arbritrary renderers. 2024-09-30 12:14:00 +01:00
Gnuxie
6a6e24a7b6 Verify that commands have renderers and renderers have commands (#571)
* Upgrade to interface-manager@2.4.0.

* Verify that commands have renderers and renderers have commands.

https://github.com/the-draupnir-project/Draupnir/issues/566

* Fix appservice bot's missing renderers.
2024-09-20 12:55:16 +01:00
gnuxie
fd7114fd7d Skip calling /join for rooms we arleady know we are joined to.
https://github.com/Gnuxie/matrix-protection-suite/issues/61
https://github.com/the-draupnir-project/Draupnir/issues/561
2024-09-17 12:16:17 +01:00
gnuxie
d3fe508db3 v2.0.0-beta.6 2024-09-11 18:08:23 +01:00
gnuxie
6c23c747de ThrottlingQueue was supressing errors in unit tests. 2024-09-11 17:08:00 +01:00
Gnuxie
56e0c56eeb Use @gnuxie/typescript-result's expect where applicable instead of throwing garbage. (#552)
Part of https://github.com/the-draupnir-project/Draupnir/issues/547

* Update for MPS v1.3.0.

* Use @gnuxie/typescript-result's `expect` method where applicable.

* Update to @the-draupnir-project/interface-manager@2.3.0.
2024-09-11 14:57:37 +01:00
Gnuxie
a5afdbe9ad Unit tests for the ban and unban commands. (#542)
* Unit test Ban and UnbanCommands.

Fixes https://github.com/the-draupnir-project/Draupnir/issues/441
will follow up with https://github.com/the-draupnir-project/interface-manager/issues/7.

Part of https://github.com/the-draupnir-project/planning/issues/22.

* Update to @the-draupnir-project/interface-manager@2.1.0.

* Rest parameters can only give one argument from prompts.

* Update to @the-draupnir-project/interface-manager@2.2.0.
2024-09-11 10:24:01 +01:00
Gnuxie
982f9c23c8 Give MatrixInterfaceAdaptor all of its required callbacks. (#540)
* Update to @the-draupnir-project/interface-manager@2.0.0.

The interface has been changed in `interface-manager` so that we can't forget them. 

Means that our little error renderer works again.
2024-09-09 18:08:14 +01:00
Gnuxie
8d1af843d3 Unit test the DraupnirKickCommand. (#539)
* Update to MPS v1.2.1.

This will allow us to use `describeProtectedRoomsSet` in unit tests.

* Update to @the-draupnir-project/interface-manager@1.1.1.

This allows for better type inference from the command and also for
partial keywords to be provided to commands as arguments.

* Unit test the DraupnirKickCommand.
2024-09-09 17:20:09 +01:00
gnuxie
dce8b289e3 Remove ts-mocha since we can just use ts-node (unmaintained package). 2024-09-09 13:28:16 +01:00
gnuxie
804bad5e37 Update to @the-draupnir-project/interface-manager@1.1.0
This includes a utility to help us unit test commands.
2024-09-09 13:28:16 +01:00
gnuxie
701f5da47f Add ts-auto-mock and ts-node and transformer for better mocks. 2024-09-09 13:27:41 +01:00
gnuxie
4613e88517 Update to interface-manager 1.0.0. 2024-09-06 17:18:53 +01:00
gnuxie
79a0320044 Add the result library directly so that we don't have to type out ActionResult. 2024-09-06 13:23:14 +01:00
gnuxie
a4d836bf91 Update to MPS 1.1.0. so we can get RoomMessageSender capability. 2024-09-06 13:23:14 +01:00
gnuxie
9654ba6ca9 Add @the-draupnir-project/interface-manager to begin integration. 2024-09-06 13:23:14 +01:00
gnuxie
272d1094ec v2.0.0-beta.5 2024-08-26 12:10:33 +01:00
Gnuxie
cc9d4cb9d5 Move to @the-draupnir-project/basic-matrix-types. (#508)
We split out some utility types from the matrix-protection-suite into a library https://github.com/the-draupnir-project/matrix-basic-types



I can't believe that like the extra lines from 

```
import {
} from ...
```

are adding up so much but whatever. 

* Move to @the-draupnir-project/basic-matrix-types.

* Whoopsie missed a test.
2024-08-16 19:12:21 +01:00
Gnuxie
631274e1cb Update to MPS 0.23.4. (#493)
We updated the StringMatrixTypes, since the regexes were incorrect.
2024-07-27 14:11:10 +01:00
gnuxie
0faa91e750 Install and configure prettier. 2024-07-22 18:36:43 +01:00
dependabot[bot]
7bed134f48 Bump express from 4.18.2 to 4.19.2 (#309)
Bumps [express](https://github.com/expressjs/express) from 4.18.2 to 4.19.2.
- [Release notes](https://github.com/expressjs/express/releases)
- [Changelog](https://github.com/expressjs/express/blob/master/History.md)
- [Commits](https://github.com/expressjs/express/compare/4.18.2...4.19.2)

---
updated-dependencies:
- dependency-name: express
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-22 18:05:45 +01:00
dependabot[bot]
eaeeba7cca Bump the development-dependencies group across 1 directory with 6 updates (#481)
Bumps the development-dependencies group with 6 updates in the / directory:

| Package | From | To |
| --- | --- | --- |
| [@eslint/js](https://github.com/eslint/eslint/tree/HEAD/packages/js) | `9.6.0` | `9.7.0` |
| [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) | `20.11.5` | `20.14.11` |
| [eslint](https://github.com/eslint/eslint) | `9.6.0` | `9.7.0` |
| [mocha](https://github.com/mochajs/mocha) | `10.2.0` | `10.7.0` |
| [@types/mocha](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/mocha) | `10.0.6` | `10.0.7` |
| [typescript-eslint](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/typescript-eslint) | `7.15.0` | `7.16.1` |



Updates `@eslint/js` from 9.6.0 to 9.7.0
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/commits/v9.7.0/packages/js)

Updates `@types/node` from 20.11.5 to 20.14.11
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Updates `eslint` from 9.6.0 to 9.7.0
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v9.6.0...v9.7.0)

Updates `mocha` from 10.2.0 to 10.7.0
- [Release notes](https://github.com/mochajs/mocha/releases)
- [Changelog](https://github.com/mochajs/mocha/blob/main/CHANGELOG.md)
- [Commits](https://github.com/mochajs/mocha/compare/v10.2.0...v10.7.0)

Updates `@types/mocha` from 10.0.6 to 10.0.7
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/mocha)

Updates `typescript-eslint` from 7.15.0 to 7.16.1
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/typescript-eslint/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v7.16.1/packages/typescript-eslint)

---
updated-dependencies:
- dependency-name: "@eslint/js"
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: development-dependencies
- dependency-name: "@types/node"
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: development-dependencies
- dependency-name: eslint
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: development-dependencies
- dependency-name: mocha
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: development-dependencies
- dependency-name: "@types/mocha"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: development-dependencies
- dependency-name: typescript-eslint
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: development-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-22 16:59:44 +01:00
Gnuxie
8973db487b Migrate to eslint-9 flat config, typescript 5, typescript-eslint strictTypeChecked (#476)
* Migrate to eslint-9 strictTypeChecked & typescript 5.

* Update to MPS 0.23.0.

Required for strict type checks.

* Looks like we found a test that was complete garbage, amazing really.

* FIXUP

* Well, the command handler was bugged previously...

The command handler used to always only return the command
without the prefix due to an operator precedence bug.
This meant that when we made the order of operations explicit,
we were now including the prefix of the command in the copy.
So when we parsed arguments the code wasn't expecting the prefix
to be there.

* update to MPS 0.23.1.

MPS 0.23.0 was bugged because we didn't enable
`noUncheckedIndexedAccess` while upgrading to typescript 5.

* Make sure eslint runs on all ts files.

* eslint fixes.

* enable `noUncheckedIndexedAccess` & `exactOptionalPropertyTypes`.

* eslint ignores is clearly not understood by me.

* Update SuperCoolStream for eslint and ts5.

* stricter eslint done i thinks

* Whoops, added on .only somewhere.

* Update MPS.

* fix broken test realted things.

* Well I guess that part of getMessagesByUserIn was part of the interface.

* Fix redactionCommandTest.

* Account for escapeHTML in tests.

* Fix tests.

* stuff not matching with .editorconfig fixes.

* Fix appservice webAPI test.

* Update for MPS 0.23.3.
2024-07-22 16:54:04 +01:00
Aminda Suomalainen ⚧
8587280cdc [Yarn Classic] Enable corepack & fix pre-commit run --all-files (#472)
* Setup Yarn Classic through Corepack

* pre-commit: use corepack and silence warnings, add .eslintignore's

* .github/workflows/mjolnir.yml: use yarn through corepack

* mx-tester.yml: use corepack

* mx-tester.yml & package.json: replace references to npx and call corepack more

At least yarn build didn't break locally for me, so I think it's supported here too

* rm & gitignore .yarnrc

* mx-tester.yml & package.json: return to npx since yarn dlx doesn't exist in classic
2024-07-04 11:22:33 +01:00
gnuxie
4c2ea7f155 v2.0.0-beta.4 2024-05-29 12:35:18 +01:00
gnuxie
3b20fe1122 Update to MPS v0.22.0. 2024-05-20 16:56:46 +01:00
gnuxie
d1950fbb54 Update for new MPS handleExternalInvite handle. 2024-05-13 16:23:26 +01:00
gnuxie
771edf387e v2.0.0-beta.3 2024-05-06 17:48:16 +01:00
Gnuxie
be374755bb Update to MPS 0.20.0. (#399)
Part of https://github.com/the-draupnir-project/Draupnir/issues/380.
We've updated typebox and changed the way events are decoded.
2024-05-06 13:51:44 +01:00
gnuxie
f8cbaee973 Update to MPS 0.19.1.
This contains a workaround for this issue https://github.com/the-draupnir-project/Draupnir/issues/380
please see e57f266da8.
2024-05-04 18:09:21 +01:00
gnuxie
9ea217c8ca Update for MPS 0.19.0. 2024-05-02 15:57:44 +01:00
gnuxie
005cf6e24f Update typebox to match MPS. 2024-05-02 15:57:44 +01:00
gnuxie
6e16cd7f6d Update for MPS v0.18.2.
This fixes a bug where we use the empty schema to validate
redacted content, which is really bad.
2024-04-22 19:13:09 +01:00
gnuxie
a9effe2998 v2.0.0-beta.2 2024-04-22 15:58:50 +01:00
gnuxie
31a1cc7bc8 Update for MPS 0.18.1.
Fixes https://github.com/the-draupnir-project/Draupnir/issues/360
Fixes https://github.com/the-draupnir-project/Draupnir/issues/361
2024-04-22 15:58:09 +01:00
gnuxie
49c5ada4a8 v2.0.0-beta.1 2024-04-19 11:25:13 +01:00
Gnuxie
3d02c72401 Gnuxie/consequence renderer clarity (#356)
* Allow span attributes to be rendered.

* Update for MPS 0.18.0.

* Add some consistency to capability renderers.
2024-04-18 17:32:27 +01:00
gnuxie
20b540526e v2.0.0-beta.0 2024-04-16 13:10:51 +01:00
Gnuxie
ae86e173f5 Update for MPS 0.17.1. (#347)
* Update for MPS 0.17.1.

Part of https://github.com/the-draupnir-project/Draupnir/issues/333
And https://github.com/the-draupnir-project/Draupnir/issues/345

Fixes https://github.com/the-draupnir-project/Draupnir/issues/337

* Add loggableConfigTracker to Draupnir.

Part of https://github.com/the-draupnir-project/Draupnir/issues/217.
I don't think this is right yet.
2024-04-16 12:24:17 +01:00
Gnuxie
97482aab2f Allow config.disableServerACL to disable ServerBanSynchronisationProtection (#339)
* Update for MPS ~0.16.0.

* Update for new MPS ProtectionsManager.

Part of https://github.com/the-draupnir-project/Draupnir/issues/317.

* `config.disableServerACL` now disabled `ServerBanSynchronisationProtection`

Fixes https://github.com/the-draupnir-project/Draupnir/issues/317.
2024-04-14 14:20:50 +01:00
Gnuxie
4c775742be Post MPS Allow use of shortcodes to refer to policy rooms (#331)
* Update to MPS 0.15.0.

This adds support for mjolnir shortcodes.

* Add shortcode support back post MPS.

Fixes https://github.com/the-draupnir-project/Draupnir/issues/316.
2024-04-10 21:14:48 +01:00
gnuxie
8e9009b4bc Update to MPS 0.14.0.
Fixes https://github.com/the-draupnir-project/Draupnir/issues/324
Fixes https://github.com/the-draupnir-project/Draupnir/issues/325
2024-04-08 23:34:43 +01:00
gnuxie
ab8b3786df Update to MPS v0.13.0
This fixes a bug where we use the wrong schema for `org.matrix.mjolnir.protected_rooms`.
2024-04-06 23:22:34 +01:00
gnuxie
971b4edf38 Update for MPS v0.12.1
This fixes a race condition causing a nasty bug in the room state revision issuer
that was also causing an intermitent test failure.
2024-04-06 20:03:38 +01:00
gnuxie
4d50b1be15 Add better-sqlite3 so we can use the room state backing store. 2024-04-06 20:03:38 +01:00
gnuxie
c23b284821 Update for MPS 0.12.0 2024-04-06 20:03:38 +01:00
gnuxie
45a2429eac Update MPS dependencies to fix banpropagation bugs. 2024-04-06 20:03:37 +01:00
gnuxie
6957b3e404 Fix eslint (i don't think this was ever working :/) 2024-04-06 20:03:37 +01:00
gnuxie
7a10ec4a1d Use NPM for MPS depeendencies rather than git. 2024-04-06 20:03:36 +01:00