Update dependencies

This commit is contained in:
Will Hunt 2021-11-22 17:33:13 +00:00
parent becba83765
commit b77916f425
7 changed files with 773 additions and 966 deletions

View File

@ -29,54 +29,53 @@
"generate-default-config": "node lib/Config/Defaults.js --config > config.sample.yml"
},
"dependencies": {
"@node-rs/helper": "^1.2.1",
"@octokit/auth-app": "^3.3.0",
"@octokit/auth-token": "^2.4.5",
"@octokit/rest": "^18.10.0",
"@octokit/webhooks": "^9.1.2",
"axios": "^0.21.2",
"axios": "^0.24.0",
"cors": "^2.8.5",
"express": "^4.17.1",
"ioredis": "^4.26.0",
"markdown-it": "^12.0.4",
"ioredis": "^4.28.0",
"markdown-it": "^12.2.0",
"matrix-bot-sdk": "^0.5.19",
"matrix-widget-api": "^0.1.0-beta.13",
"matrix-widget-api": "^0.1.0-beta.17",
"micromatch": "^4.0.4",
"mime": "^2.5.2",
"mocha": "^8.2.1",
"node-emoji": "^1.10.0",
"mime": "^3.0.0",
"node-emoji": "^1.11.0",
"reflect-metadata": "^0.1.13",
"source-map-support": "^0.5.19",
"source-map-support": "^0.5.21",
"string-argv": "^0.3.1",
"uuid": "^8.3.2",
"winston": "^3.3.3",
"yaml": "^1.10.0"
"yaml": "^1.10.2"
},
"devDependencies": {
"@fontsource/open-sans": "^4.2.2",
"@napi-rs/cli": "^1.3.5",
"@prefresh/snowpack": "^3.1.2",
"@snowpack/plugin-typescript": "^1.2.1",
"@types/chai": "^4.2.16",
"@types/cors": "^2.8.10",
"@types/express": "^4.17.11",
"@types/ioredis": "^4.22.3",
"@types/markdown-it": "^12.0.1",
"@types/chai": "^4.2.22",
"@types/cors": "^2.8.12",
"@types/express": "^4.17.13",
"@types/ioredis": "^4.28.1",
"@types/markdown-it": "^12.2.3",
"@types/micromatch": "^4.0.1",
"@types/mime": "^2.0.3",
"@types/mocha": "^8.2.2",
"@types/node-emoji": "^1.8.1",
"@types/mocha": "^9.0.0",
"@types/node": "^12",
"@types/uuid": "^8.3.0",
"@typescript-eslint/eslint-plugin": "^4.21.0",
"@typescript-eslint/parser": "^4.21.0",
"@types/node-emoji": "^1.8.1",
"@types/uuid": "^8.3.3",
"@typescript-eslint/eslint-plugin": "^5.4.0",
"@typescript-eslint/parser": "^5.4.0",
"chai": "^4.3.4",
"eslint-plugin-mocha": "^8.1.0",
"eslint": "^7.24.0",
"eslint": "^8.3.0",
"eslint-plugin-mocha": "^9.0.0",
"mini.css": "^3.0.1",
"preact": "^10.5.13",
"mocha": "^8.2.1",
"preact": "^10.5.15",
"snowpack": "^3.8.8",
"ts-node": "^9.1.1",
"typescript": "^4.2.4"
"ts-node": "^10.4.0",
"typescript": "^4.5.2"
}
}

View File

@ -1,5 +1,6 @@
import markdown from "markdown-it";
import stringArgv from "string-argv";
import { CommandError } from "./errors";
import { MatrixMessageContent } from "./MatrixEvent";
const md = new markdown();
@ -77,7 +78,8 @@ export async function handleCommand(userId: string, command: string, botCommands
await botCommands[prefix].fn.apply(obj, args);
return {handled: true};
} catch (ex) {
return {handled: true, error: ex.message, humanError: ex.humanError};
const commandError = ex as CommandError;
return {handled: true, error: commandError.message, humanError: commandError.humanError};
}
}
}

View File

@ -60,7 +60,8 @@ export class GithubGraphQLClient {
private async query(request: string, variables: Record<string, string|number>) {
log.debug(`GraphQL Query: ${request}`);
return this.octokit.graphql(`${request}`, {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
return this.octokit.graphql<Record<string, any>>(`${request}`, {
headers: GithubGraphQLClient.headers,
...variables,
});
@ -74,7 +75,7 @@ query($name: String!, $owner: String!, $number: Int!) {
${DiscussionQL}
}
}
}`, {name, owner, number}) as any;
}`, {name, owner, number});
return result.repository.discussion as DiscussionQLResponse;
}
@ -86,7 +87,7 @@ mutation addDiscussionComment($discussionId: ID!, $body: String!) {
id
}
}
}`, {discussionId, body}) as any;
}`, {discussionId, body});
return result.addDiscussionComment.comment.id as string;
}

View File

@ -85,7 +85,7 @@ export class GitHubWatcher extends EventEmitter implements NotificationWatcherTa
// To avoid a bouncing issue, gradually reduce the failure count.
GitHubWatcher.apiFailureCount = Math.max(0, GitHubWatcher.apiFailureCount - 2);
} catch (ex) {
await this.handleGitHubFailure(ex);
await this.handleGitHubFailure(ex as RequestError);
return;
}
this.lastReadTs = Date.now();

View File

@ -7,7 +7,7 @@ import markdown from "markdown-it";
import { FormatUtil } from "./FormatUtil";
import { PullGetResponseData, IssuesGetResponseData, PullsListRequestedReviewersResponseData, PullsListReviewsResponseData, IssuesGetCommentResponseData } from "./Github/Types";
import { GitHubUserNotification } from "./Github/Types";
import { components } from "@octokit/openapi-types/dist-types/generated/types";
import { components } from "@octokit/openapi-types/types";
import { NotifFilter } from "./NotificationFilters";
@ -16,7 +16,7 @@ const md = new markdown();
export interface IssueDiff {
state: null|string;
assignee: null|(components["schemas"]["simple-user"][]);
assignee: null|(components["schemas"]["nullable-simple-user"][]);
title: null|string;
merged: boolean;
mergedBy: null|{

View File

@ -24,6 +24,8 @@
"inlineSources": true,
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
// TODO: Type errors
"useUnknownInCatchVariables": false,
},
"include": [
"src/**/*"

1671
yarn.lock

File diff suppressed because it is too large Load Diff