Custom message routing

未关闭
#23 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
30/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
停滞
技术栈
openapi, typescript

调研方向

该 issue 未指定任何文件、测试或入口点。首先检查仓库的 TypeScript typings 和 OpenAPI v3 generator,然后明确自定义路由及其权限、不可变性和删除规则如何与 API 适配。完成的标准是:路由模型和生命周期行为已完成规范定义,并通过验证和测试覆盖实现。

由索引模型根据 Issue 内容生成。

描述

enhancement
What do you want to see?

This could be useful for cross-posting and IoT-related use cases. Custom route management should be permissions-gated to prevent spamming by randomly creating message routes.

The semantics should be as follows: server-wide permissions allow you to create, alter and drop a message route targeting any channel, while per-guild permission only allows you to do so while requiring you to have either:

  • Posting, storage, view all within that guild
  • Posting channel is null (meaning that route is read-only) and view channel is within that guild, no constraints on storage channel

Routing rule

A routing rule shall consist of eight elements:

  • Timestamp of the registration (stored as snowflake)
  • Source channel
  • Storage channel
  • Sink channel
  • Source users (user, group or role ID)
  • Target users (user, group or role ID)
  • Valid since timestamp
  • Valid until timestamp

Invariants

  • Valid since cannot be earlier than time of registration
  • Valid until cannot be earlier than valid since
  • Source user set has to have message posting permission in the source channel at the time of use
  • Event type validity checks are done based on the storage channel
  • Target user set has to have read messages permission in the source channel at the time of use
  • Each routing rule is considered immutable once created, except for valid until timestamp, which can be set to any future time while the routing rule is still in effect

A routing rule can only be deleted in either of the following cases:

  • none of the source channels are present
  • none of the storage channels are present
  • none of the sink channels are present
  • the routing rule is not in effect AND no messages are affected by deletion of the routing rule
主要语言
TypeScript
星标
42
派生
34
PR 合并指标
30 天内没有已合并 PR

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

stoatchat/javascript-client-api 的其他 Issue

查看 stoatchat/javascript-client-api 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。