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

@simmir/koishi-plugin-ouline-subscriber

v0.0.5

Published

Outline subscribe plugin to dingtalk

Downloads

179

Readme

Koishi Plugin: Outline Subscriber

一个用于连接聊天平台与Outline文档系统的Koishi插件。在群聊中订阅Outline文档变动,当文档发生变化时自动发送通知到群组。支持钉钉、QQ、微信等多种聊天平台。

功能特色

  • 实时通知: 通过Webhook机制实时接收文档变动通知
  • 轮询备选: 当Webhook不可用时,提供轮询机制作为备选方案
  • 多平台支持: 支持钉钉、QQ、微信等多种聊天平台
  • 安全验证: 支持Webhook签名验证,确保数据安全
  • 智能存储: 自动保存和恢复订阅数据
  • 易用命令: 简单的命令管理订阅

安装

  1. 将此插件放入你的Koishi项目的 external 目录
  2. 无需安装额外依赖(使用Koishi内置HTTP客户端)
  3. koishi.yml 中启用此插件:
plugins:
  group:custom:
    ouline-subscriber:
      outlineApiUrl: https://app.getoutline.com/api
      outlineApiToken: your_outline_api_token
      webhookPath: /webhook/outline
      enablePolling: false
      pollingInterval: 5

配置说明

必需配置

  • outlineApiToken: Outline API访问令牌
    • 获取方式:在Outline设置中创建API密钥

可选配置

  • outlineApiUrl: Outline API地址 (默认: https://app.getoutline.com/api)
  • outlineWebhookSecret: Webhook签名密钥,用于验证请求安全性
  • webhookPath: Webhook接收路径 (默认: /webhook/outline)
  • enablePolling: 是否启用轮询模式 (默认: false)
  • pollingInterval: 轮询间隔,单位分钟 (默认: 5)

使用方法

1. 在Outline中设置Webhook(推荐)

  1. 登录Outline管理界面
  2. 进入 Settings → Webhooks
  3. 添加新的Webhook:
    • Name: 钉钉通知
    • URL: http://your-koishi-server:port/webhook/outline
    • Events: 选择 documents.publish, documents.update, documents.delete
    • Secret: 设置签名密钥(可选,但推荐)

2. 在聊天群中使用命令

订阅文档

outline.subscribe https://your-outline.com/doc/document-id

取消订阅

outline.unsubscribe https://your-outline.com/doc/document-id

查看订阅列表

outline.list

支持的事件类型

  • 📝 documents.publish - 文档发布
  • 📝 documents.update - 文档更新
  • 🗑️ documents.delete - 文档删除

故障排除

Webhook不工作?

  1. 检查HTTP插件: 确保Koishi启用了HTTP插件
  2. 检查端口: 确认Koishi服务器可以从外网访问
  3. 检查路径: 验证Webhook URL路径是否正确
  4. 查看日志: 检查Koishi日志中的错误信息

备用方案:启用轮询

如果Webhook无法正常工作,可以启用轮询模式:

ouline-subscriber:
  enablePolling: true
  pollingInterval: 5  # 每5分钟检查一次

权限问题

确保Outline API Token有足够的权限:

  • 读取文档信息
  • 访问工作区设置

开发说明

文件结构

external/ouline-subscriber/
├── src/
│   └── index.ts          # 主要插件代码
├── data/
│   └── subscriptions.json # 订阅数据存储
├── package.json
└── README.md

开发模式

  1. 克隆项目
  2. 安装依赖:npm install
  3. 启动Koishi开发模式:npm run dev

贡献

欢迎提交Issue和Pull Request!

许可证

MIT License

更新日志

v0.0.1

  • 初始版本发布
  • 支持基本的文档订阅功能
  • 实现Webhook和轮询两种模式
  • 添加钉钉命令支持

注意: 确保你的Koishi实例启用了HTTP插件和相应的聊天平台适配器。