contact-filter

仓库创建 2024年12月9日最近提交 6 小时前SkillHot 收录 5 小时前
▸ 精选理由

覆盖前端配置与后端查询,便于修改筛选逻辑与操作符。

这个 Skill 做什么

管理联系人过滤器模型及其前端配置与后端 SQL 查询生成。

帮你管理联系人那套可复用的过滤器模型和前后端配置,把 UI 上的筛选条件翻译成后端 SQL 查询。会在新增筛选字段或操作符、改过滤器界面、调整 SQL 构建器或需要强制受众约束时用到。特别支持 EXISTS 子查询、NULL/否定的三值逻辑和 excludeFields 机制,并且关注前后端两套定义必须保持同步。

▸ 展开 SKILL.md 英文原文

Work with the ChatbotX contact filter system — the shared filter model behind the contacts list, conversations, and broadcast audiences. Use when adding a filter field or operator, changing the filter UI, editing the SQL query builder, or enforcing an audience constraint. Covers the definitions single-source, the two operator-rule sources that must stay in sync, NULL / negation three-valued logic, relation EXISTS subqueries, and the excludeFields mechanism.

开发编程过滤器查询生成前后端Zod通用
524
Stars
116
Forks
21
仓库内 Skill
积累中
7 日增星
安装 / 使用
给你的 Agent 一句话(通用)
帮我安装这个 skill:https://raw.githubusercontent.com/ChatbotXIO/ChatbotX/main/.agents/skills/contact-filter/SKILL.md
或 curl 直取 SKILL.md
curl -fsSL "https://raw.githubusercontent.com/ChatbotXIO/ChatbotX/main/.agents/skills/contact-filter/SKILL.md"
SKILL.MD 节选查看完整文件 ↗
# Contact Filter

A reusable, structured filter (`{ operator, conditions[] }`) applied to contacts.
Lives in two packages:

- **Frontend feature** — `apps/builder/src/features/contact-filter/` (Zod schemas,
  UI config, React components). Barrel: `index.ts`.
- **Backend query builder** — `packages/database/src/queries/contact-filter.ts`
  (`@chatbotx.io/database/queries`). Shared by the builder app **and** the worker
  so both resolve the same contacts.

## Architecture

```
contactFilterFields enum (partials/contact.ts)     ← the field "universe" (~90)
        │
CONTACT_FILTER_FIELD_DEFINITIONS (schemas/definitions.ts)  ← 22 ACTIVE fields = single source of truth
        │  (each: { field, 
via SKILL·HOT · 数据来自 GitHub 公开信息 · 原文版权归作者所有