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 🙏

© 2026 – Pkg Stats / Ryan Hefner

telegram-seller-sdk

v1.0.14

Published

JavaScript SDK for Telegram Seller Merchant API

Readme

Telegram Seller SDK

JavaScript SDK for Telegram Seller Merchant API

安装

npm install telegram-seller-sdk
# 或
yarn add telegram-seller-sdk

文件上传

  • client.file.upload(file, object)

Auth模块

-ahth.login(object)

  • auth.lougout()

Merchant模块

  • merchant.getMe()
  • merchant.getConfigs(object)
  • merchant.getConfig(id)
  • merchant.getLanguages()

User模块

  • user.getUsers(object)
  • user.getUser(id)
  • user.getRecharges(object)
  • user.getRecharge(id)
  • user.getRecharges(object)
  • user.getRecharge(id)
  • user.getWalletLogTypes()
  • user.getWalletLogs(object)
  • user.getWalletLog(id)

Product模块

分组

  • client.product.getTypes()
  • client.product.createGroup(name, object)
  • client.product.getGroups(object)
  • client.product.getGroup(id)
client.product.createGroup({
      type: "telegram_account",
      name:"TEST GROUP",
      bot_data: {
          type: "text",
          'en': {'text': '🌏 测试分组123', 'file_id': ''},
          'zh-hans': {'text': '🌏 TEST GROUP123', 'file_id': ''},
      }
  })

client.product.create({
    type: "telegram_account",
    name:"TEST Product",
    group_id: 38,
    price: 1.01,
    bot_data: {
        type: "text",
        'en': {'text': '🌏 测试商品123', 'file_id': ''},
        'zh-hans': {'text': '🌏 TEST product123', 'file_id': ''},
    }
})

商品

  • client.product.createGroup(name, object)
  • client.product.getProducts(object)
  • client.product.getProduct(id)

商品资源

  • client.product.getResources(object)
  • client.product.getResource(id)
  • client.product.createTelegramAccountResouce(object)
  • client.product.downloadTelegramAccountResouce(object)

后台任务

  • client.task.getTasks(object)
  • client.task.getTask(id)

订单

  • client.order.getOrders(object)
  • client.order.getOrder(id)

使用示例

const TelegramSellerSDK = require('telegram-seller-sdk');

 初始化SDK
const sdk = new TelegramSellerSDK({
  baseURL: 'http:66.42.55.5:8000/telegram-seller/merchant-api/'
});

 登录
async function login() {
  try {
    const result = await sdk.auth.login({
      username: 'admin',
      password: "O8UX/awQKxmYTPx2on58sA=="
    });
  } catch (error) {
    console.error('Login failed:', error.message);
  }
}

 获取商品列表
async function getProducts() {
  try {
    const { data } = await sdk.product.list({
      page: 1,
      size: 10,
      status: 'active'
    });
    
    console.log('Products:', data);
  } catch (error) {
    console.error('Failed to get products:', error.message);
  }
}

//  上传账户
async function createTelegramAccountResouce() {
  try {
    const { data } = await sdk.product.createTelegramAccountResouce({
      product_id: 1,
      file: "./file.zip" // 上传返回的路径
    });
    
    console.log('Products:', data);
  } catch (error) {
    console.error('Failed to createTelegramAccountResouce:', error.message);
  }
}

// 下载账户
async function downloadTelegramAccountResouce() {
  try {
    const { data } = await sdk.product.downloadTelegramAccountResouce({
      ids: [1,2,3]
    });
    
    console.log('Products:', data);
  } catch (error) {
    console.error('Failed to downloadTelegramAccountResouce:', error.message);
  }
}