Compare commits

..

No commits in common. "fdf1c4f62847ffa44038cad742565688655af2c0" and "5931e51f84e51779ac1d87861b528e2e97dc3fd9" have entirely different histories.

3 changed files with 3 additions and 23 deletions

View File

@ -1,6 +1,6 @@
{
"name": "sati",
"version": "0.2.4",
"version": "0.2.3",
"description": "next generation anti-captcha",
"license": "MIT",
"repository": {

View File

@ -22,7 +22,6 @@ import { events, methods, tasks, Task } from './types'
*/
export class Sati extends EventEmitter<events> {
private socket: SatiSocket
private shortLogging: boolean
private awaitedTasks: {
[ index: number ]: {
resolve(data: any): void,
@ -31,9 +30,8 @@ export class Sati extends EventEmitter<events> {
} = Object.create(null)
/** @param token your api token. get it at https://sati.ac/dashboard */
constructor({ token, shortLogging = false }: { token: string, shortLogging?: boolean }) {
constructor({ token }: { token: string }) {
super()
this.shortLogging = shortLogging
this.socket = new SatiSocket(token)
this.socket.on('event', ({ type, data }) => {
this.emit(type as keyof events, data)
@ -65,11 +63,7 @@ export class Sati extends EventEmitter<events> {
const awaited = this.awaitedTasks[task.id]
if(task.state === 'error') {
let message = `unable to solve ${task.type} task`
if(!this.shortLogging) {
message += ` #${task.id}`
}
awaited.reject(new SatiError(message))
awaited.reject(new SatiError(`unable to solve ${task.type} task #${task.id}`))
} else if(task.state === 'success') {
awaited.resolve(task)
}

View File

@ -32,20 +32,6 @@ export type tasks = {
result: {
token: string
}
},
GeeTest3: {
params: {
siteKey: string,
pageUrl: string,
challenge: string,
apiServer?: string,
proxy?: string
},
result: {
challenge: string,
validate: string,
seccode: string
}
}
}