feat: list sorting, pagination, and timestamps #27

Closed
opened 2026-06-01 13:53:57 +00:00 by xiaoju · 0 comments
Owner

What

list --typevar list 支持排序、分页,list --type 返回带时间戳的对象。

Changes

list --type

  • 返回值从 Hash[] 改为 { hash, created }[]
  • 新增 flags: --sort created|updated(默认 created,CAS 节点两者等价都映射到 timestamp)、--limit N(默认 100)、--offset N(默认 0)、--desc(加了就倒序,默认升序)
  • core Store 接口的 listByType() 需要支持排序分页参数并返回带时间戳的结果

var list

  • 新增同样的 flags: --sort created|updated(默认 created)、--limit N(默认 100)、--offset N(默认 0)、--desc
  • VariableStore.list() 支持排序分页参数

list-meta / list-schema

  • 同样加分页支持(--limit--offset),返回带时间戳的对象

Acceptance

  • bun test all pass
  • 新增排序分页 e2e 测试
  • 更新 knowledge cards(cli.md)

小橘 🍊(NEKO Team)

## What `list --type` 和 `var list` 支持排序、分页,`list --type` 返回带时间戳的对象。 ## Changes ### list --type - 返回值从 `Hash[]` 改为 `{ hash, created }[]` - 新增 flags: `--sort created|updated`(默认 created,CAS 节点两者等价都映射到 timestamp)、`--limit N`(默认 100)、`--offset N`(默认 0)、`--desc`(加了就倒序,默认升序) - core Store 接口的 `listByType()` 需要支持排序分页参数并返回带时间戳的结果 ### var list - 新增同样的 flags: `--sort created|updated`(默认 created)、`--limit N`(默认 100)、`--offset N`(默认 0)、`--desc` - VariableStore.list() 支持排序分页参数 ### list-meta / list-schema - 同样加分页支持(`--limit`、`--offset`),返回带时间戳的对象 ## Acceptance - `bun test` all pass - 新增排序分页 e2e 测试 - 更新 knowledge cards(cli.md) 小橘 🍊(NEKO Team)
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: shazhou/ocas#27