0.0.7 • Published 2 years ago

hivpn-representatives v0.0.7

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

alt HiVPN Representatives Package NPM

سایت نمایندگان

سایت اصلی

درباره بسته نمایندگان HiVPN

به جای استفاده مستقیم از api های سایت نمایندگان می توانید از این پکیچ با قابلیت های بیشتر استفاده کنید.

قابلیت های بسته نمایندگان HiVPN

1- گرفتن موجودی حساب.

2- گرفتن تمامی محصولات قابل خرید در پنل نمایندگان.

3- گرفتن محصولات بر حسب id مشخص شده (فیلتر کردن).

4- گرفتن محصولات بر حسب قیمت مشخص شده (فیلتر کردن − به عنوان مثال از 0 تومان تا 100 تومان).

5- گرفتن اطلاعات یک اکانت مشخص شده با استفاده از username که در پنل نمایندگان ثبت شده است.

6- گرفتن اطلاعات مجموعه ای از کاربران با استفاده از نام کاربری که در پنل نمایندگان ثبت شده است.

7- خرید اشتراک برای مشتریان

8- تمدید اشتراک برای مشتریان

9- حذف یک حساب مشتری

10- ویرایش حساب یک مشتری

install And Usage

$ npm install hivpn-representatives

or

$ yarn add hivpn-representatives

import package
//import the package es6 and typescript
import HiVPN from "hivpn-representatives";

//import the package es5
const HiVPN = require("hivpn-representatives");

Then create an instance:

/**
    showStatus?: boolean|undefined,
    if showStatus is true then return {{
        status: "success",
        balance: {
           ...
        }
    }}
    else return {
        balance: {
           ...
        }
    }
 */

/**
    ctArray?: boolean|undefined,
    if ctArray is true then return {
         "3": {
        "id": "3",
        ...
         }}
         else return [
        {
            "id": "3",
            ...
            }
         ]
 */

//yor api key token example: qf2wec9ec5da418abee7ae22

const hivpn = new HiVPN("your-api-key");

// get balance:
const getBalance = await hivpn.getBalance(); //showStatus?: boolean

//get products:
const getProducts = await hivpn.getProducts(); //ctArray?: boolean

//get product by id:
const getProductById = await hivpn.getProduct([1, 3, 6] /*or ["1","3","6"]*/); //ctArray?: boolean

//get product by price:
const getProductByPrice = await hivpn.getProductByPrice(0, 100); //ctArray?: boolean

// get a account:
const getAccount = await hivpn.getAccount("username");

// get a list of accounts:
const getAccounts = await hivpn.getAccounts([
  "username1",
  "username2",
  "username3",
]); // showErrors?: boolean,
//  ctArray?: boolean

// buy a account:

/** params:
    idProduct: number | 1 | 2 | 3 | 4 | 6,
    discount?: string,
    email?: string,
    mobile?: string,
    comment?: string,
    username?: string,
    password?: string
 */
const buyAccount = await hivpn.buyAccount(
  2,
  "discount",
  "example@example.com",
  "09121234567",
  "comment",
  "username",
  "password"
);

// account renewal:

/** params:
    idProduct: number | 1 | 2 | 3 | 4 | 6,
    discount?: string,
    username?: string
 */

const renewalAccount = await hivpn.accountRenewal(3, "discount", "username");

//edit account:

/** params:
    username: string,
    password?: string,
    status?: boolean
 */
const editAccount = await hivpn.editAccount("username", "password", true);

//delete account
const deleteAccount = await hivpn.deleteAccount("username");

دوستان عزیز شما میتوانید نظرات خود را در مورد بسته نمایندگان HiVPN برای ما بفرستید.

email: hejazi00831@gmail.com

نکته: این بسته زیر نظر شرکت HiVPN ساخته و انتشار داده نشده است و صرفا فقط برای راحتی کار دوستان برنامه نویس بنده منتشر کرده ام.

امیدوارم که این بسته مفید واقع باشد.🌹

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago