assistants-api
Advanced tools
Comparing version 1.2.0 to 1.3.0
@@ -1,3 +0,1 @@ | ||
const nodeFetch = require('node-fetch'); | ||
const fetch = require('fetch-cookie')(nodeFetch); | ||
const EventEmitter = require('events'); | ||
@@ -25,2 +23,5 @@ | ||
constructor(parametr, password) { | ||
const nodeFetch = require('node-fetch'); | ||
const fetch = require('fetch-cookie')(nodeFetch); | ||
this.fetch = fetch; | ||
this.user = null; | ||
@@ -30,3 +31,3 @@ if(!parametr || !password)throw new Error("Assistants: No credentials were given or one of them is missing."); | ||
this.password = password; | ||
setInterval(async ()=>{ | ||
@@ -45,2 +46,3 @@ let session = await this.session(); | ||
async login() { | ||
let fetch = this.fetch; | ||
let data = (await methods.login(this.parametr, this.password, fetch)); | ||
@@ -59,2 +61,3 @@ if(!data.error)this.user = data.data; | ||
async register({username,email,password, tos=true}) { | ||
let fetch = this.fetch; | ||
let data = (await methods.register(username, email, password, tos, fetch)); | ||
@@ -61,0 +64,0 @@ return data; |
{ | ||
"name": "assistants-api", | ||
"version": "1.2.0", | ||
"version": "1.3.0", | ||
"description": "Assistants Center API Client", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
9979
148
6