Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove npm alias for matrix-bot-sdk, and update it #480

Merged
merged 3 commits into from
Jan 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class for more information on how to use each component.
```

The bridge relies on [`matrix-appservice`](https://github.com/matrix-org/matrix-appservice-node)
and [`matrix-bot-sdk`](https://github.com/turt2live/matrix-bot-sdk) for their of the [Application
and [`matrix-bot-sdk`](https://github.com/vector-im/matrix-bot-sdk) for their of the [Application
Service API](https://spec.matrix.org/latest/application-service-api/) (AS API) and [Client-Server
API](https://spec.matrix.org/latest/client-server-api/) (CS API) respectively. The bridge manages
state for virtual users and provides many useful helper functions bridges may desire.
Expand Down
1 change: 1 addition & 0 deletions changelog.d/480.removal
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Don't use a package alias for @vector-im/matrix-bot-sdk.
58 changes: 29 additions & 29 deletions examples/encryption/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
enabled "2.0.x"
kuler "^2.0.0"

"@matrix-org/[email protected].4":
version "0.1.0-beta.4"
resolved "https://registry.yarnpkg.com/@matrix-org/matrix-sdk-crypto-nodejs/-/matrix-sdk-crypto-nodejs-0.1.0-beta.4.tgz#80456b2e2cc731982f0d3c6aece80cefa1ebb797"
integrity sha512-XjCp/tG3LRMxMj/MMZfypD5BtW3J1B6oXY2Og8Ed0SyU4uWdglalMwrBUKlDotJr0/Q/2OTspGjD+ytAzCspyw==
"@matrix-org/[email protected].11":
version "0.1.0-beta.11"
resolved "https://registry.yarnpkg.com/@matrix-org/matrix-sdk-crypto-nodejs/-/matrix-sdk-crypto-nodejs-0.1.0-beta.11.tgz#537cd7a7bbce1d9745b812a5a7ffa9a5944e146c"
integrity sha512-z5adcQo4o0UAry4zs6JHGxbTDlYTUMKUfpOpigmso65ETBDumbeTSQCWRw8UeUV7aCAyVoHARqDTol9SrauEFA==
dependencies:
https-proxy-agent "^5.0.1"
node-downloader-helper "^2.1.5"
Expand Down Expand Up @@ -104,6 +104,29 @@
resolved "https://registry.yarnpkg.com/@types/triple-beam/-/triple-beam-1.3.2.tgz#38ecb64f01aa0d02b7c8f4222d7c38af6316fef8"
integrity sha512-txGIh+0eDFzKGC25zORnswy+br1Ha7hj5cMVwKIU7+s0U2AxxJru/jZSMU6OC9MJWP6+pc/hc6ZjyZShpsyY2g==

"@vector-im/matrix-bot-sdk@^0.6.7-element.1":
version "0.6.7-element.1"
resolved "https://registry.yarnpkg.com/@vector-im/matrix-bot-sdk/-/matrix-bot-sdk-0.6.7-element.1.tgz#f33721ca33f05b181b52287672b09dbbb2f3f852"
integrity sha512-SFaCorDIibhMcJq3AfdacecKALWBEL+sDZVCUDkdA/pgqoWyJiC5c5TcMJT+Gs/vCxCYZzD1qmYssXJ6w7wEYQ==
dependencies:
"@matrix-org/matrix-sdk-crypto-nodejs" "0.1.0-beta.11"
"@types/express" "^4.17.13"
another-json "^0.2.0"
async-lock "^1.3.2"
chalk "^4"
express "^4.18.1"
glob-to-regexp "^0.4.1"
hash.js "^1.1.7"
html-to-text "^8.2.0"
htmlencode "^0.0.4"
lowdb "^1"
lru-cache "^7.10.1"
mkdirp "^1.0.4"
morgan "^1.10.0"
request "^2.88.2"
request-promise "^4.2.6"
sanitize-html "^2.8.0"

abbrev@1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8"
Expand Down Expand Up @@ -1017,9 +1040,10 @@ lru-cache@^7.10.1:
integrity sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==

"matrix-appservice-bridge@file:../..":
version "8.1.1"
version "9.0.1"
dependencies:
"@alloc/quick-lru" "^5.2.0"
"@vector-im/matrix-bot-sdk" "^0.6.7-element.1"
axios "^0.27.2"
chalk "^4.1.0"
express "^4.18.1"
Expand All @@ -1029,7 +1053,6 @@ lru-cache@^7.10.1:
is-my-json-valid "^2.20.5"
js-yaml "^4.0.0"
matrix-appservice "^2.0.0"
matrix-bot-sdk "npm:@vector-im/matrix-bot-sdk@^0.6.6-element.0"
nedb "^1.8.0"
nopt "^5.0.0"
p-queue "^6.6.2"
Expand All @@ -1050,29 +1073,6 @@ matrix-appservice@^2.0.0:
js-yaml "^4.1.0"
morgan "^1.10.0"

"matrix-bot-sdk@npm:@vector-im/matrix-bot-sdk@^0.6.6-element.0":
version "0.6.6-element.0"
resolved "https://registry.yarnpkg.com/@vector-im/matrix-bot-sdk/-/matrix-bot-sdk-0.6.6-element.0.tgz#96e08bb434939fcbf7f771a47aa4a7d17632f601"
integrity sha512-Mx5SAv1zFXpkG+jbtbkadNMLjaxftnWBGCjKlNFlUDjcJPUIYxKd49jUGst/vdp/ysZYa0Dgk+V+E1qmKUa8bw==
dependencies:
"@matrix-org/matrix-sdk-crypto-nodejs" "0.1.0-beta.4"
"@types/express" "^4.17.13"
another-json "^0.2.0"
async-lock "^1.3.2"
chalk "^4"
express "^4.18.1"
glob-to-regexp "^0.4.1"
hash.js "^1.1.7"
html-to-text "^8.2.0"
htmlencode "^0.0.4"
lowdb "^1"
lru-cache "^7.10.1"
mkdirp "^1.0.4"
morgan "^1.10.0"
request "^2.88.2"
request-promise "^4.2.6"
sanitize-html "^2.8.0"

[email protected]:
version "0.3.0"
resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748"
Expand Down
58 changes: 29 additions & 29 deletions examples/slack-starter/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
enabled "2.0.x"
kuler "^2.0.0"

"@matrix-org/[email protected].4":
version "0.1.0-beta.4"
resolved "https://registry.yarnpkg.com/@matrix-org/matrix-sdk-crypto-nodejs/-/matrix-sdk-crypto-nodejs-0.1.0-beta.4.tgz#80456b2e2cc731982f0d3c6aece80cefa1ebb797"
integrity sha512-XjCp/tG3LRMxMj/MMZfypD5BtW3J1B6oXY2Og8Ed0SyU4uWdglalMwrBUKlDotJr0/Q/2OTspGjD+ytAzCspyw==
"@matrix-org/[email protected].11":
version "0.1.0-beta.11"
resolved "https://registry.yarnpkg.com/@matrix-org/matrix-sdk-crypto-nodejs/-/matrix-sdk-crypto-nodejs-0.1.0-beta.11.tgz#537cd7a7bbce1d9745b812a5a7ffa9a5944e146c"
integrity sha512-z5adcQo4o0UAry4zs6JHGxbTDlYTUMKUfpOpigmso65ETBDumbeTSQCWRw8UeUV7aCAyVoHARqDTol9SrauEFA==
dependencies:
https-proxy-agent "^5.0.1"
node-downloader-helper "^2.1.5"
Expand Down Expand Up @@ -124,6 +124,29 @@
resolved "https://registry.yarnpkg.com/@types/triple-beam/-/triple-beam-1.3.2.tgz#38ecb64f01aa0d02b7c8f4222d7c38af6316fef8"
integrity sha512-txGIh+0eDFzKGC25zORnswy+br1Ha7hj5cMVwKIU7+s0U2AxxJru/jZSMU6OC9MJWP6+pc/hc6ZjyZShpsyY2g==

"@vector-im/matrix-bot-sdk@^0.6.7-element.1":
version "0.6.7-element.1"
resolved "https://registry.yarnpkg.com/@vector-im/matrix-bot-sdk/-/matrix-bot-sdk-0.6.7-element.1.tgz#f33721ca33f05b181b52287672b09dbbb2f3f852"
integrity sha512-SFaCorDIibhMcJq3AfdacecKALWBEL+sDZVCUDkdA/pgqoWyJiC5c5TcMJT+Gs/vCxCYZzD1qmYssXJ6w7wEYQ==
dependencies:
"@matrix-org/matrix-sdk-crypto-nodejs" "0.1.0-beta.11"
"@types/express" "^4.17.13"
another-json "^0.2.0"
async-lock "^1.3.2"
chalk "^4"
express "^4.18.1"
glob-to-regexp "^0.4.1"
hash.js "^1.1.7"
html-to-text "^8.2.0"
htmlencode "^0.0.4"
lowdb "^1"
lru-cache "^7.10.1"
mkdirp "^1.0.4"
morgan "^1.10.0"
request "^2.88.2"
request-promise "^4.2.6"
sanitize-html "^2.8.0"

abbrev@1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8"
Expand Down Expand Up @@ -1046,9 +1069,10 @@ lru-cache@^7.10.1:
integrity sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==

"matrix-appservice-bridge@file:../..":
version "8.1.1"
version "9.0.1"
dependencies:
"@alloc/quick-lru" "^5.2.0"
"@vector-im/matrix-bot-sdk" "^0.6.7-element.1"
axios "^0.27.2"
chalk "^4.1.0"
express "^4.18.1"
Expand All @@ -1058,7 +1082,6 @@ lru-cache@^7.10.1:
is-my-json-valid "^2.20.5"
js-yaml "^4.0.0"
matrix-appservice "^2.0.0"
matrix-bot-sdk "npm:@vector-im/matrix-bot-sdk@^0.6.6-element.0"
nedb "^1.8.0"
nopt "^5.0.0"
p-queue "^6.6.2"
Expand All @@ -1079,29 +1102,6 @@ matrix-appservice@^2.0.0:
js-yaml "^4.1.0"
morgan "^1.10.0"

"matrix-bot-sdk@npm:@vector-im/matrix-bot-sdk@^0.6.6-element.0":
version "0.6.6-element.0"
resolved "https://registry.yarnpkg.com/@vector-im/matrix-bot-sdk/-/matrix-bot-sdk-0.6.6-element.0.tgz#96e08bb434939fcbf7f771a47aa4a7d17632f601"
integrity sha512-Mx5SAv1zFXpkG+jbtbkadNMLjaxftnWBGCjKlNFlUDjcJPUIYxKd49jUGst/vdp/ysZYa0Dgk+V+E1qmKUa8bw==
dependencies:
"@matrix-org/matrix-sdk-crypto-nodejs" "0.1.0-beta.4"
"@types/express" "^4.17.13"
another-json "^0.2.0"
async-lock "^1.3.2"
chalk "^4"
express "^4.18.1"
glob-to-regexp "^0.4.1"
hash.js "^1.1.7"
html-to-text "^8.2.0"
htmlencode "^0.0.4"
lowdb "^1"
lru-cache "^7.10.1"
mkdirp "^1.0.4"
morgan "^1.10.0"
request "^2.88.2"
request-promise "^4.2.6"
sanitize-html "^2.8.0"

[email protected]:
version "0.3.0"
resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"homepage": "https://github.com/matrix-org/matrix-appservice-bridge#readme",
"dependencies": {
"@alloc/quick-lru": "^5.2.0",
"@vector-im/matrix-bot-sdk": "^0.6.7-element.1",
"chalk": "^4.1.0",
"express": "^4.18.2",
"express-rate-limit": "^7.1.5",
Expand All @@ -39,7 +40,6 @@
"is-my-json-valid": "^2.20.5",
"js-yaml": "^4.0.0",
"matrix-appservice": "^2.0.0",
"matrix-bot-sdk": "npm:@vector-im/matrix-bot-sdk@^0.6.6-element.1",
"nopt": "^5.0.0",
"p-queue": "^6.6.2",
"pkginfo": "^0.4.1",
Expand Down
2 changes: 1 addition & 1 deletion spec/integ/bridge.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const HS_URL = "http://example.com";
const HS_DOMAIN = "example.com";
const BOT_LOCALPART = "the_bridge";
const BOT_USER_ID = `@${BOT_LOCALPART}:${HS_DOMAIN}`;
const { MatrixError } = require("matrix-bot-sdk");
const { MatrixError } = require("@vector-im/matrix-bot-sdk");

const TEST_USER_DB_PATH = __dirname + "/test-users.db";
const TEST_ROOM_DB_PATH = __dirname + "/test-rooms.db";
Expand Down
2 changes: 1 addition & 1 deletion spec/unit/activity-tracker.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import "jasmine";
import { ActivityTracker } from "../../src/index";
import { WhoisInfo, PresenceEventContent, MatrixClient, MatrixError } from "matrix-bot-sdk";
import { WhoisInfo, PresenceEventContent, MatrixClient, MatrixError } from "@vector-im/matrix-bot-sdk";

function throwMatrixError(statusCode: number) {
throw new MatrixError({errcode: "M_UNKNOWN", error: ""}, statusCode);
Expand Down
2 changes: 1 addition & 1 deletion spec/unit/intent.spec.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const { Intent } = require("../..");
const { MatrixError } = require('matrix-bot-sdk');
const { MatrixError } = require('@vector-im/matrix-bot-sdk');
const matrixError = async (errcode, error) => { throw new MatrixError({errcode, error}, 500)};

describe("Intent", function() {
Expand Down
2 changes: 1 addition & 1 deletion spec/unit/room-upgrade-handler.spec.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { MatrixError } = require("matrix-bot-sdk/lib/models/MatrixError");
const { MatrixError } = require("@vector-im/matrix-bot-sdk");
const { RoomUpgradeHandler } = require("../../lib/components/room-upgrade-handler")

describe("RoomUpgradeHandler", () => {
Expand Down
2 changes: 1 addition & 1 deletion src/bridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ import { RemoteRoom } from "./models/rooms/remote";
import { Registry } from "prom-client";
import { ClientEncryptionStore, EncryptedEventBroker } from "./components/encryption";
import { EphemeralEvent, PresenceEvent, ReadReceiptEvent, TypingEvent, WeakEvent } from "./components/event-types";
import * as BotSDK from "matrix-bot-sdk";
import * as BotSDK from "@vector-im/matrix-bot-sdk";
import { ActivityTracker, ActivityTrackerOpts } from "./components/activity-tracker";
import { EncryptedIntent, EncryptedIntentOpts } from "./components/encrypted-intent";

Expand Down
2 changes: 1 addition & 1 deletion src/components/activity-tracker.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { MatrixClient, MatrixError } from "matrix-bot-sdk";
import { MatrixClient, MatrixError } from "@vector-im/matrix-bot-sdk";
import { Logger } from ".."
const log = new Logger("ActivityTracker");

Expand Down
2 changes: 1 addition & 1 deletion src/components/app-service-bot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ limitations under the License.
import { AppServiceRegistration } from "matrix-appservice";
import { MembershipCache, UserProfile } from "./membership-cache";
import { StateLookupEvent } from "..";
import { MatrixClient } from "matrix-bot-sdk";
import { MatrixClient } from "@vector-im/matrix-bot-sdk";

export interface RoomInfo {
id: string;
Expand Down
2 changes: 1 addition & 1 deletion src/components/encrypted-intent.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { APPSERVICE_LOGIN_TYPE, ClientEncryptionSession } from "./encryption";
import { Logger } from "..";
import BotSdk, { MatrixClient, MatrixError } from "matrix-bot-sdk";
import BotSdk, { MatrixClient, MatrixError } from "@vector-im/matrix-bot-sdk";
import { FileUploadOpts, Intent, IntentOpts } from "./intent";
import { WeakStateEvent } from "./event-types";

Expand Down
2 changes: 1 addition & 1 deletion src/components/encryption.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { AppServiceBot } from "./app-service-bot";
import { WeakEvent } from "./event-types";
import { Intent } from "./intent";
import { Logger } from "..";
import { MatrixClient } from "matrix-bot-sdk";
import { MatrixClient } from "@vector-im/matrix-bot-sdk";
import LRU from "@alloc/quick-lru"

export const APPSERVICE_LOGIN_TYPE = "m.login.application_service";
Expand Down
2 changes: 1 addition & 1 deletion src/components/intent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { defer } from "../utils/promiseutil";
import { UserMembership } from "./membership-cache";
import { unstable } from "../errors";
import BridgeErrorReason = unstable.BridgeErrorReason;
import BotSdk, { MatrixClient, MatrixProfileInfo, PresenceState, MatrixError } from "matrix-bot-sdk";
import BotSdk, { MatrixClient, MatrixProfileInfo, PresenceState, MatrixError } from "@vector-im/matrix-bot-sdk";
import { WeakStateEvent } from "./event-types";
import { Logger } from '..';

Expand Down
2 changes: 1 addition & 1 deletion src/components/logging.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
/* eslint-disable @typescript-eslint/no-explicit-any */
import { ILogger, LogLevel as BotSdkLogLevel, LogService } from "matrix-bot-sdk";
import { ILogger, LogLevel as BotSdkLogLevel, LogService } from "@vector-im/matrix-bot-sdk";
import util from "util";
import winston, { format } from "winston";

Expand Down
2 changes: 1 addition & 1 deletion src/components/membership-queue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Bridge } from "../bridge";
import { Logger } from ".."
import PQueue from "p-queue";
import { Counter, Gauge } from "prom-client";
import { MatrixError } from "matrix-bot-sdk";
import { MatrixError } from "@vector-im/matrix-bot-sdk";

const log = new Logger("MembershipQueue");

Expand Down
2 changes: 1 addition & 1 deletion src/components/prometheusmetrics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { AgeCounters } from "./agecounters";
import { Request, Response } from "express";
import { Bridge, Logger } from "..";
import { Appservice as BotSdkAppservice, FunctionCallContext, METRIC_MATRIX_CLIENT_FAILED_FUNCTION_CALL,
METRIC_MATRIX_CLIENT_SUCCESSFUL_FUNCTION_CALL } from "matrix-bot-sdk";
METRIC_MATRIX_CLIENT_SUCCESSFUL_FUNCTION_CALL } from "@vector-im/matrix-bot-sdk";
import { getBridgeVersion } from "../utils/package-info";
type CollectorFunction = () => Promise<void>|void;

Expand Down
2 changes: 1 addition & 1 deletion src/components/room-upgrade-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { MatrixRoom } from "../models/rooms/matrix";
import { MatrixUser } from "../models/users/matrix";
import { RoomBridgeStoreEntry } from "./room-bridge-store";
import { Bridge } from "..";
import { MatrixError } from "matrix-bot-sdk";
import { MatrixError } from "@vector-im/matrix-bot-sdk";

const log = new Logger("RoomUpgradeHandler");

Expand Down
2 changes: 1 addition & 1 deletion src/contentRepo.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { MatrixClient } from "matrix-bot-sdk";
import { MatrixClient } from "@vector-im/matrix-bot-sdk";

/**
* Get the HTTP URL for an MXC URI.
Expand Down
Loading
Loading