Security News
The Push to Ban Ransom Payments Is Gaining Momentum
Ransomware costs victims an estimated $30 billion per year and has gotten so out of control that global support for banning payments is gaining momentum.
assistants-api
Advanced tools
Readme
Below we present the documentation of the assistants-api module used to communicate with the API Assistants Center (assistants.ga).
npm i assistants-api
If an error occurred while executing an action, the function returned the following value:
{error: true, message: "error text"}
If all is successful, the following value will be returned:
{error: false, data: returnedData_ifThereIs}
const Assistants = require('assistants-api');
const client = new Assistants.Client(parametr, password);
where parametr
is user username or e-mail adress and password
is user password
const user = await client.login();
success:
{
error: false,
data: { username: '', email: '' }
}
error:
As in Errors Handling above
const session = await client.session();
success:
{
cookie: {
originalMaxAge: Number,
expires: DateString,
httpOnly: Boolean,
path: String
},
user: { sid: String, username: String },
__lastAccess: Number,
apples: Number
}
error:
As in Errors Handling above
const newAccount = await client.register({username: String, email: String, password: String, tos: Boolean})
success:
{
error: false,
data: { username: String, email: String }
}
error:
As in Errors Handling above
You can connect to API Assistants to listen for the latest updates. For example, you can know when the daily store is updated, in what language, and get a ready-made store image buff.
const events = await client.events();
As in Errors Handling above
const shopEmitter = events.shop;
shopEmitter.on('shop::new', ({buff,lang}) => {
console.log(`NEW SHOP! IMAGE buff: ${buff}, lang: ${lang}`);
});
const sectionsEmitter = events.sections;
sectionsEmitter.on('sections::new', ({buff,lang}) => {
console.log(`NEW SECTIONS! IMAGE buff: ${buff}, lang: ${lang}`);
});
const Assistants = require('assistants-api');
const client = new Assistants.Client("assistants_api", "public123");
client.login().then(async (res)=>{
if(res.error)return console.log(res);
console.log(res);
const userSession = await client.session();
console.log(userSession);
const newAccount = await client.register({username: "", email: "", password: "", tos: true});
console.log(newAccount);
const events = await client.events();
const shopEmitter = events.shop;
shopEmitter.on('shop::new', ({buff,lang}) => {
console.log(`NEW SHOP! IMAGE buff: ${buff}, lang: ${lang}`);
});
const sectionsEmitter = events.sections;
sectionsEmitter.on('sections::new', ({buff,lang}) => {
console.log(`NEW SECTIONS! IMAGE buff: ${buff}, lang: ${lang}`);
});
});
FAQs
Assistants Center API Client
We found that assistants-api demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Ransomware costs victims an estimated $30 billion per year and has gotten so out of control that global support for banning payments is gaining momentum.
Application Security
New SEC disclosure rules aim to enforce timely cyber incident reporting, but fear of job loss and inadequate resources lead to significant underreporting.
Security News
The Python Software Foundation has secured a 5-year sponsorship from Fastly that supports PSF's activities and events, most notably the security and reliability of the Python Package Index (PyPI).