fix(core): typo in method name
This commit is contained in:
parent
fe722fbb61
commit
70b5a423c6
8 changed files with 10 additions and 10 deletions
|
@ -726,7 +726,7 @@ withParams(params: RpcCallOptions): this\n`)
|
||||||
'importSession',
|
'importSession',
|
||||||
'exportSession',
|
'exportSession',
|
||||||
'handleClientUpdate',
|
'handleClientUpdate',
|
||||||
'getApiCrenetials',
|
'getApiCredentials',
|
||||||
'getPoolSize',
|
'getPoolSize',
|
||||||
'getPrimaryDcId',
|
'getPrimaryDcId',
|
||||||
'computeSrpParams',
|
'computeSrpParams',
|
||||||
|
|
|
@ -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
|
||||||
}> {
|
}> {
|
||||||
|
|
|
@ -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)
|
||||||
|
|
|
@ -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)
|
||||||
|
|
|
@ -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(
|
||||||
{
|
{
|
||||||
|
|
|
@ -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',
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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')
|
||||||
|
|
Loading…
Reference in a new issue