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

wechat-sdks

v1.0.2

Published

WeChat SDKs

Downloads

181

Readme

wechat-sdks

服务器端接口

能在服务器端快捷的调用腾讯的服务

  • weapp: 微信小程序 - 已实现部分
  • offiaccount: 微信公众号 - 尚未实现
  • wecom: 企业微信 - 尚未实现

客户端接口

能在客户端快捷的调用腾讯微信相关SDK

  • weapp: 微信小程序 - 尚未实现
  • wecom: 企业微信 - 尚未实现

插件使用文档

# 要求: 服务器端:node >= 18.0.0

# 安装
yarn add wechat-sdks
# or
npm install wechat-sdks --save
# or
bun add wechat-sdks

已完成API

服务器端:微信小程序API(weapp)

// 登录相关API
import weappLoginApi from 'wechat-sdks/lib/server/weapp/weapp-login.api';

/** 登录 */
const result = await weappLoginApi.code2Session({
  params: {
    appid: 'wxa1234567890',
    secret: '1234567890',
    js_code: '1234567890',
  },
});

if (result.status === 'ok') {
  result.data?.openid;
  result.data?.unionid;
  result.data?.session_key;
}

/** 检查登录态 */
weappLoginApi.checkSessionKey({ ... });
/** 重置登录态 */
weappLoginApi.resetUserSessionKey({ ... });

// 获取微信小程序的 Access Token
import weappTokenApi from 'wechat-sdks/lib/server/weapp/weapp-token.api ';

/** 获取微信小程序的 Access Token */
weappTokenApi.getAccessToken({ ... });
/** 获取稳定的微信小程序的 Access Token */
weappTokenApi.getStableAccessToken({ ... });

// 用户相关API
import weappUserApi from 'wechat-sdks/lib/server/weapp/weapp-user.api';

/** 获取用户支付的UnionID */
weappUserApi.getPaidUnionid({ ... });
/** 检查加密数据 */
weappUserApi.checkEncryptedData({ ... });
/** 获取用户手机号 */
weappUserApi.getPhoneNumber({ ... });

// 开放API
import weappOpenApi from 'wechat-sdks/lib/server/weapp/weapp-open-api.api';

/** 清除API调用配额 */
weappOpenApi.clearQuota({ ... });
/** 获取API调用配额 */
weappOpenApi.getApiQuota({ ... });
/** 获取请求ID信息 */
weappOpenApi.getRidInfo({ ... });
/** 清除API调用配额 */
weappOpenApi.clearQuotaByAppSecret({ ... });

// 二维码相关API
import weappQRCodeApi from 'wechat-sdks/lib/server/weapp/weapp-qrcode.api';

/** 获取小程序码 */
weappQRCodeApi.getQRCode({ ... });
/** 获取小程序码(永久有效, 数量不限制) */
weappQRCodeApi.getUnlimitedQRCode({ ... });
/** 创建二维码 */
weappQRCodeApi.createQRCode({ ... });

// 内容安全API
import weappSafetyApi from 'wechat-sdks/lib/server/weapp/weapp-safety.api';

/** 内容安全-文本内容安全检测 */
weappSafetyApi.msgSecCheck({ ... });
/** 内容安全-图片内容安全检测 */
weappSafetyApi.mediaCheckAsync({ ... });
/** 内容安全-用户风险等级 */
weappSafetyApi.getUserRiskRank({ ... });

// 图像识别API
import weappOcrApi from 'wechat-sdks/lib/server/weapp/weapp-orc.api';

/** 通用印刷体识别 */
weappOcrApi.printedTextOCR({ ... });
/** 行驶证识别 */
weappOcrApi.vehicleLicenseOCR({ ... });
/** 驾驶证识别 */
weappOcrApi.driverLicenseOCR({ ... });
/** 身份证识别 */
weappOcrApi.idCardOCR({ ... });
/** 银行卡识别 */
weappOcrApi.bankCardOCR({ ... });
/** 营业执照识别 */
weappOcrApi.businessLicenseOCR({ ... });

待开发API

服务器端:微信小程序API(weapp)

// ...

Build Setup

$ yarn install
$ yarn run test
$ yarn run test --watch

参考文档