fix(core): typo in method name

This commit is contained in:
alina 🌸 2025-01-01 06:41:49 +03:00
parent fe722fbb61
commit 70b5a423c6
Signed by: teidesu
SSH key fingerprint: SHA256:uNeCpw6aTSU4aIObXLvHfLkDa82HWH9EiOj9AXOIRpI
8 changed files with 10 additions and 10 deletions

View file

@ -726,7 +726,7 @@ withParams(params: RpcCallOptions): this\n`)
'importSession', 'importSession',
'exportSession', 'exportSession',
'handleClientUpdate', 'handleClientUpdate',
'getApiCrenetials', 'getApiCredentials',
'getPoolSize', 'getPoolSize',
'getPrimaryDcId', 'getPrimaryDcId',
'computeSrpParams', 'computeSrpParams',

View file

@ -301,7 +301,7 @@ export class BaseTelegramClient implements ITelegramClient {
this.updates?.handleClientUpdate(updates, noDispatch) this.updates?.handleClientUpdate(updates, noDispatch)
} }
async getApiCrenetials(): Promise<{ async getApiCredentials(): Promise<{
id: number id: number
hash: string hash: string
}> { }> {

View file

@ -6949,8 +6949,8 @@ TelegramClient.prototype.exportSession = function (...args) {
TelegramClient.prototype.handleClientUpdate = function (...args) { TelegramClient.prototype.handleClientUpdate = function (...args) {
return this._client.handleClientUpdate(...args) return this._client.handleClientUpdate(...args)
} }
TelegramClient.prototype.getApiCrenetials = function (...args) { TelegramClient.prototype.getApiCredentials = function (...args) {
return this._client.getApiCrenetials(...args) return this._client.getApiCredentials(...args)
} }
TelegramClient.prototype.getPoolSize = function (...args) { TelegramClient.prototype.getPoolSize = function (...args) {
return this._client.getPoolSize(...args) return this._client.getPoolSize(...args)

View file

@ -61,7 +61,7 @@ export interface ITelegramClient {
onConnectionState: Emitter<ConnectionState> onConnectionState: Emitter<ConnectionState>
onError: Emitter<Error> onError: Emitter<Error>
getApiCrenetials(): Promise<{ id: number, hash: string }> getApiCredentials(): Promise<{ id: number, hash: string }>
// todo - this is only used for file dl/ul, which should probably be moved // todo - this is only used for file dl/ul, which should probably be moved
// to the client to allow moving the thing to worker // to the client to allow moving the thing to worker
// or at least load this once at startup (and then these methods can be made sync) // or at least load this once at startup (and then these methods can be made sync)

View file

@ -28,7 +28,7 @@ export async function sendCode(
): Promise<SentCode> { ): Promise<SentCode> {
const phone = normalizePhoneNumber(params.phone) const phone = normalizePhoneNumber(params.phone)
const { id, hash } = await client.getApiCrenetials() const { id, hash } = await client.getApiCredentials()
const res = await client.call( const res = await client.call(
{ {

View file

@ -11,7 +11,7 @@ import { _onAuthorization } from './utils.js'
* @throws BadRequestError In case the bot token is invalid * @throws BadRequestError In case the bot token is invalid
*/ */
export async function signInBot(client: ITelegramClient, token: string): Promise<User> { export async function signInBot(client: ITelegramClient, token: string): Promise<User> {
const { id, hash } = await client.getApiCrenetials() const { id, hash } = await client.getApiCredentials()
const res = await client.call({ const res = await client.call({
_: 'auth.importBotAuthorization', _: 'auth.importBotAuthorization',

View file

@ -99,7 +99,7 @@ export async function signInQr(
} }
try { try {
const { id, hash } = await client.getApiCrenetials() const { id, hash } = await client.getApiCredentials()
loop: while (true) { loop: while (true) {
let res: tl.auth.TypeLoginToken let res: tl.auth.TypeLoginToken

View file

@ -47,7 +47,7 @@ export abstract class TelegramWorkerPort<Custom extends WorkerCustomMethods> imp
readonly importSession: ITelegramClient['importSession'] readonly importSession: ITelegramClient['importSession']
readonly exportSession: ITelegramClient['exportSession'] readonly exportSession: ITelegramClient['exportSession']
readonly handleClientUpdate: ITelegramClient['handleClientUpdate'] readonly handleClientUpdate: ITelegramClient['handleClientUpdate']
readonly getApiCrenetials: ITelegramClient['getApiCrenetials'] readonly getApiCredentials: ITelegramClient['getApiCredentials']
readonly getPoolSize: ITelegramClient['getPoolSize'] readonly getPoolSize: ITelegramClient['getPoolSize']
readonly getPrimaryDcId: ITelegramClient['getPrimaryDcId'] readonly getPrimaryDcId: ITelegramClient['getPrimaryDcId']
readonly changePrimaryDc: ITelegramClient['changePrimaryDc'] readonly changePrimaryDc: ITelegramClient['changePrimaryDc']
@ -84,7 +84,7 @@ export abstract class TelegramWorkerPort<Custom extends WorkerCustomMethods> imp
this.importSession = bind('importSession') this.importSession = bind('importSession')
this.exportSession = bind('exportSession') this.exportSession = bind('exportSession')
this.handleClientUpdate = bind('handleClientUpdate', true) this.handleClientUpdate = bind('handleClientUpdate', true)
this.getApiCrenetials = bind('getApiCrenetials') this.getApiCredentials = bind('getApiCredentials')
this.getPoolSize = bind('getPoolSize') this.getPoolSize = bind('getPoolSize')
this.getPrimaryDcId = bind('getPrimaryDcId') this.getPrimaryDcId = bind('getPrimaryDcId')
this.changePrimaryDc = bind('changePrimaryDc') this.changePrimaryDc = bind('changePrimaryDc')