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

@steedos-labs/yunzhijia

v1.0.5

Published

<!-- * @Author: [email protected] * @Date: 2024-03-01 09:49:05 * @LastEditors: [email protected] * @LastEditTime: 2024-03-01 09:49:22 * @Description: -->

Downloads

107

Readme

云之家SSO登录和发送公共号消息sendIM

SSO登录 Rest

/api/yunzhijia/login

  • ticket 由云之家跳转的时候传递

送公共号消息sendIM

yunzhijia.sendIM

sendIM方法的参数说明

sendIM 方法用于发送消息,其参数对象ctx.params包含以下属性:

  • innerTos: IInnerTo[]

    • 描述: 接收消息的目标列表。
    • 类型: 数组,每个元素是一个 IInnerTo 对象。
    • 结构:
      • user?: string[] - 接收消息的用户openid列表。
      • code?: "all" - 群发所有用户。
  • type: MsgType

    • 描述: 消息类型。
    • 类型: 枚举值,定义在 MsgType 中。
    • 可能的值:
      • 2 - 纯文本信息。
      • 5 - 文本链接信息。
      • 6 - 图文混排信息。
  • msgs: IInnerMsg[]

    • 描述: 消息内容列表。
    • 类型: 数组,每个元素是一个 IInnerMsg 对象。
    • 结构:
      • date?: string - 消息日期。
      • title?: string - 消息标题。
      • text: string - 消息文本。
      • url?: string - 消息链接。
      • name?: string - 消息名称。
      • pic?: string - 消息图片。
  • model?: MsgModel

    • 描述: 消息模型(仅在 typeMIXED 时使用)。
    • 类型: 枚举值,定义在 MsgModel 中。
    • 可能的值:
      • 1 - 单条文本编排模板。
      • 2 - 单条图文混排模板。
      • 3 - 多条图文混排模板。

sendMessage 方法的返回结果

{
  code: 200,
  data: {
    pubId: 'XT-45ad439f-ce77-488a-91c2-6b0bc63dc4b6',
    sourceMsgId: 'XT-6762dc1cd5dec4c2bce2d435'
  },
  message: '发送成功',
  success: true
}

请求示例

ctx.params = {
  innerTos: [
    { user: ['667aaa5dd5de8eb92bbc7cdc', '337aaa5dd5de8eb92bbc7cdd'] }
  ],
  type: 2,
  msgs: [
    { text: 'Hello, world!' }
  ]
};

sendIM(ctx);

注意事项

  • innerTosmsgs 是必填项。
  • type 必须是 MsgType 枚举中的一个值。
  • typeMIXED 时,model 是可选项,但建议提供以确保消息格式正确。