mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2025-12-07 03:57:06 +03:00
update packages, use native redis typings
This commit is contained in:
4169
package-lock.json
generated
4169
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
44
package.json
44
package.json
@@ -18,38 +18,38 @@
|
|||||||
"author": "Ajay Ramachandran",
|
"author": "Ajay Ramachandran",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"axios": "^0.24.0",
|
"axios": "^0.27.2",
|
||||||
"better-sqlite3": "^7.4.5",
|
"better-sqlite3": "^7.6.0",
|
||||||
"cron": "^1.8.2",
|
"cron": "^2.0.0",
|
||||||
"express": "^4.17.1",
|
"express": "^4.18.1",
|
||||||
"express-promise-router": "^4.1.1",
|
"express-promise-router": "^4.1.1",
|
||||||
"express-rate-limit": "^6.3.0",
|
"express-rate-limit": "^6.4.0",
|
||||||
"lodash": "^4.17.21",
|
"lodash": "^4.17.21",
|
||||||
"pg": "^8.7.1",
|
"pg": "^8.7.3",
|
||||||
"rate-limit-redis": "^3.0.1",
|
"rate-limit-redis": "^3.0.1",
|
||||||
"redis": "^4.0.6",
|
"redis": "^4.2.0",
|
||||||
"sync-mysql": "^3.0.1"
|
"sync-mysql": "^3.0.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/better-sqlite3": "^7.4.1",
|
"@types/better-sqlite3": "^7.5.0",
|
||||||
"@types/cron": "^1.7.3",
|
"@types/cron": "^2.0.0",
|
||||||
"@types/express": "^4.17.13",
|
"@types/express": "^4.17.13",
|
||||||
"@types/lodash": "^4.14.178",
|
"@types/lodash": "^4.14.182",
|
||||||
"@types/mocha": "^9.0.0",
|
"@types/mocha": "^9.1.1",
|
||||||
"@types/node": "^16.11.11",
|
"@types/node": "^18.0.3",
|
||||||
"@types/pg": "^8.6.1",
|
"@types/pg": "^8.6.5",
|
||||||
"@typescript-eslint/eslint-plugin": "^5.5.0",
|
"@typescript-eslint/eslint-plugin": "^5.30.6",
|
||||||
"@typescript-eslint/parser": "^5.5.0",
|
"@typescript-eslint/parser": "^5.30.6",
|
||||||
"eslint": "^8.3.0",
|
"eslint": "^8.19.0",
|
||||||
"mocha": "^9.1.3",
|
"mocha": "^10.0.0",
|
||||||
"nodemon": "^2.0.15",
|
"nodemon": "^2.0.19",
|
||||||
"nyc": "^15.1.0",
|
"nyc": "^15.1.0",
|
||||||
"sinon": "^12.0.1",
|
"sinon": "^14.0.0",
|
||||||
"ts-mock-imports": "^1.3.8",
|
"ts-mock-imports": "^1.3.8",
|
||||||
"ts-node": "^10.4.0",
|
"ts-node": "^10.8.2",
|
||||||
"typescript": "^4.5.2"
|
"typescript": "^4.7.4"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=10"
|
"node": ">=16"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import { config } from "../config";
|
import { config } from "../config";
|
||||||
import { Logger } from "./logger";
|
import { Logger } from "./logger";
|
||||||
import { createClient } from "redis";
|
import { createClient } from "redis";
|
||||||
import { RedisCommandArgument, RedisCommandArguments, RedisCommandRawReply } from "@node-redis/client/dist/lib/commands";
|
import { RedisCommandArgument, RedisCommandArguments, RedisCommandRawReply } from "@redis/client/dist/lib/commands";
|
||||||
import { ClientCommandOptions } from "@node-redis/client/dist/lib/client";
|
import { RedisClientOptions } from "@redis/client/dist/lib/client";
|
||||||
import { RedisReply } from "rate-limit-redis";
|
import { RedisReply } from "rate-limit-redis";
|
||||||
|
|
||||||
interface RedisSB {
|
interface RedisSB {
|
||||||
@@ -11,7 +11,7 @@ interface RedisSB {
|
|||||||
setEx(key: RedisCommandArgument, seconds: number, value: RedisCommandArgument): Promise<string>;
|
setEx(key: RedisCommandArgument, seconds: number, value: RedisCommandArgument): Promise<string>;
|
||||||
del(...keys: [RedisCommandArgument]): Promise<number>;
|
del(...keys: [RedisCommandArgument]): Promise<number>;
|
||||||
increment?(key: RedisCommandArgument): Promise<RedisCommandRawReply[]>;
|
increment?(key: RedisCommandArgument): Promise<RedisCommandRawReply[]>;
|
||||||
sendCommand(args: RedisCommandArguments, options?: ClientCommandOptions): Promise<RedisReply>;
|
sendCommand(args: RedisCommandArguments, options?: RedisClientOptions): Promise<RedisReply>;
|
||||||
quit(): Promise<void>;
|
quit(): Promise<void>;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -29,7 +29,7 @@ if (config.redis?.enabled) {
|
|||||||
Logger.info("Connected to redis");
|
Logger.info("Connected to redis");
|
||||||
const client = createClient(config.redis);
|
const client = createClient(config.redis);
|
||||||
client.connect();
|
client.connect();
|
||||||
exportClient = client;
|
exportClient = client as RedisSB;
|
||||||
|
|
||||||
const timeoutDuration = 40;
|
const timeoutDuration = 40;
|
||||||
const get = client.get.bind(client);
|
const get = client.get.bind(client);
|
||||||
|
|||||||
Reference in New Issue
Block a user