From ab85b0344a21d46b7e685c3206905d1e3250be11 Mon Sep 17 00:00:00 2001 From: Painor Date: Sat, 21 Sep 2024 11:46:09 +0100 Subject: [PATCH] Update version --- gramjs/Version.ts | 2 +- gramjs/client/telegramBaseClient.ts | 2 +- gramjs/extensions/PromisedNetSockets.ts | 7 +++++-- gramjs/network/connection/TCPMTProxy.ts | 6 +++--- package-lock.json | 4 ++-- package.json | 2 +- 6 files changed, 13 insertions(+), 10 deletions(-) diff --git a/gramjs/Version.ts b/gramjs/Version.ts index b5dadaff..a45cfb3a 100644 --- a/gramjs/Version.ts +++ b/gramjs/Version.ts @@ -1 +1 @@ -export const version = "2.25.7"; +export const version = "2.25.8"; diff --git a/gramjs/client/telegramBaseClient.ts b/gramjs/client/telegramBaseClient.ts index fb5c893c..d26228ae 100644 --- a/gramjs/client/telegramBaseClient.ts +++ b/gramjs/client/telegramBaseClient.ts @@ -284,7 +284,7 @@ export abstract class TelegramBaseClient { } this._connection = clientParams.connection; let initProxy; - if (this._proxy && 'MTProxy' in this._proxy) { + if (this._proxy && "MTProxy" in this._proxy) { this._connection = ConnectionTCPMTProxyAbridged; initProxy = new Api.InputClientProxy({ address: this._proxy.ip, diff --git a/gramjs/extensions/PromisedNetSockets.ts b/gramjs/extensions/PromisedNetSockets.ts index 35d92783..8ecba7b8 100644 --- a/gramjs/extensions/PromisedNetSockets.ts +++ b/gramjs/extensions/PromisedNetSockets.ts @@ -2,7 +2,10 @@ import * as net from "./net"; import { SocksClient } from "./socks"; import { Mutex } from "async-mutex"; -import { ProxyInterface, SocksProxyType } from "../network/connection/TCPMTProxy"; +import { + ProxyInterface, + SocksProxyType, +} from "../network/connection/TCPMTProxy"; const mutex = new Mutex(); @@ -22,7 +25,7 @@ export class PromisedNetSockets { this.stream = Buffer.alloc(0); if (proxy) { // we only want to use this when it's not an MTProto proxy. - if (!('MTProxy' in proxy)) { + if (!("MTProxy" in proxy)) { if (!proxy.ip || !proxy.port || !proxy.socksType) { throw new Error( `Invalid sockets params: ip=${proxy.ip}, port=${proxy.port}, socksType=${proxy.socksType}` diff --git a/gramjs/network/connection/TCPMTProxy.ts b/gramjs/network/connection/TCPMTProxy.ts index f5584784..55c021dd 100644 --- a/gramjs/network/connection/TCPMTProxy.ts +++ b/gramjs/network/connection/TCPMTProxy.ts @@ -18,10 +18,10 @@ interface BasicProxyInterface { export type MTProxyType = BasicProxyInterface & { secret: string; MTProxy: true; -} +}; export type SocksProxyType = BasicProxyInterface & { socksType: 4 | 5; -} +}; export type ProxyInterface = MTProxyType | SocksProxyType; @@ -160,7 +160,7 @@ export class TCPMTProxy extends ObfuscatedConnection { proxy: proxy, testServers: testServers, }); - if (!('MTProxy' in proxy)) { + if (!("MTProxy" in proxy)) { throw new Error("This connection only supports MPTProxies"); } if (!proxy.secret) { diff --git a/package-lock.json b/package-lock.json index 901ba5c4..34595ba5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "telegram", - "version": "2.25.4", + "version": "2.25.9", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "telegram", - "version": "2.25.4", + "version": "2.25.9", "license": "MIT", "dependencies": { "@cryptography/aes": "^0.1.1", diff --git a/package.json b/package.json index 764a1f65..4a9b02dc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "telegram", - "version": "2.25.7", + "version": "2.25.9", "description": "NodeJS/Browser MTProto API Telegram client library,", "main": "index.js", "types": "index.d.ts",