npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

sms-verify

v1.2.1-b

Published

SMS Verify Service for NodeJS with using sms-activate.ru API

Downloads

6

Readme

NPM

Install

For install sms-verify package use:

$ npm i sms-verify

Note: add --save if you are using npm < 5.0.0

Usage

  1. Require Module
const SmsVerify = require('sms-verify');
const smsVerify = new SmsVerify({
    apiKey: 'APIKEY' // https://sms-activate.ru/ API Key
});
  1. Error Handling
smsVerify.on('error', (errorCode, ext) => {
    let response = 'Error Response Undefined';
    if(errorCode == "BAD_KEY") response = "Wrong API Key!";
    if(errorCode == "ERROR_SQL") response = "SQL ERROR Try Again Later.";
    if(errorCode == "NO_NUMBERS ") response = "All Numbers Unavailible.";
    if(errorCode == "NO_BALANCE ") response = "Balance is not enough.";
    if(errorCode == "BAD_ACTION ") response = "Wrong Action!";
    if(errorCode == "BAD_SERVICE ") response = "Wrong Service!";
    if(errorCode == "WRONG_SERVICE ") response = "Wrong Service!";
    if(errorCode == "BANNED") response = "This Account is Banned Since " + ext + "!";
    if(errorCode == "NOT_AVAILABLE ") response = "This Service is Not Availible for This Country!";
    if(errorCode == "BAD_STATUS") response = "Incorrect Status Given!";
    if(errorCode == "NO_ACTIVATION  ") response = "Given Activation ID Does Not Exist!";
    return console.log('Error:', errorCode, '\nResponse:', response)    
})
  1. Check Balance
smsVerify.on('balance', balance => {
    return console.log('Your Balance:', balance)    
})

smsVerify.myBalance();
  1. Country List
smsVerify.on('countryList', async list => {
    await list.forEach(country => {
        console.log(country.code, country.name);
    })
})

smsVerify.getCountryList();
  1. Check Availible Services by Country Code
smsVerify.on('availibleServices', async serviceList => {
    await serviceList.forEach(service => {
        console.log("Service Code:", service.code, "|", "Availible Number:", service.availible, "|", "Cost", service.cost, 'Rb');
    })
})

smsVerify.getAvailibleServices(54); // 54 is Country Code check from 3th Section
  1. Ordering Number
smsVerify.on('numberOrder', async details => {
    smsVerify.myBalance();
    console.log('Order Activation ID:', details.id, '|', 'Ordered Number:', details.number)
    await smsVerify.getCode(details.id); // Checking status and if API returns verify code this will shows. (Checks every 6 secs.)
})

smsVerify.orderNumber('go', 54); // 54 is Country Code check from 3th Section and "go" is Service Code check from 4th section.
// If code doesnt't comes in 20 mins cancel it and re order it.
  1. Checking Status by Order Id
smsVerify.on('statusResponse', response => {
    if(response.includes("STATUS_OK")){
        let code = response.split(':')[1];
        console.log('Activation Code is:', code)
    } else if (response == "STATUS_CANCEL") {
        console.log('Activation Cancelled')
    } else if (response == "STATUS_WAIT_RETRY") {
        console.log('Code Still Waiting.')
    }
})

smsVerify.checkStatus(396767373); // 396767373 is order (activation) id you should change this by yourself.
  1. Getting Verification Code
smsVerify.on('codeResponse', response => {
    if (response == 'STATUS_CANCEL') {
        console.log('Activation Cancelled')
        smsVerify.myBalance();
    } else {
        let code = response.split(':')[1];
        console.log('Activation Code is:', code)
        smsVerify.myBalance();
    }
})

smsVerify.getCode(396767373); // 396767373 is order (activation) id you should change this by yourself.
  1. Changing Order Status
smsVerify.on('statusChange', response => {
    if(response == "ACCESS_READY") response = 'Status Successfully Changed To: Sms Sent';
    if(response == "ACCESS_ACTIVATION") response = 'Status Successfully Changed To: Fully Activated';
    if(response == "ACCESS_CANCEL") response = 'Status Successfully Changed To: Cancelled';
    return console.log(response) 
})

smsVerify.changeStatus(6, 396790656) // 396767373 is order (activation) id you should change this by yourself.
                                     // 1: When you sent the SMS / 6: When verification code is correct and finishs order / 8: Canceling order.