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',
'exportSession',
'handleClientUpdate',
'getApiCrenetials',
'getApiCredentials',
'getPoolSize',
'getPrimaryDcId',
'computeSrpParams',

View file

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

View file

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

View file

@ -61,7 +61,7 @@ export interface ITelegramClient {
onConnectionState: Emitter<ConnectionState>
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
// 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)

View file

@ -28,7 +28,7 @@ export async function sendCode(
): Promise<SentCode> {
const phone = normalizePhoneNumber(params.phone)
const { id, hash } = await client.getApiCrenetials()
const { id, hash } = await client.getApiCredentials()
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
*/
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({
_: 'auth.importBotAuthorization',

View file

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

View file

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