mirror of
https://github.com/Dvorinka/Primora.git
synced 2026-10-29 08:04:50 +00:00
feat: PostgREST-style document filtering and ordering
GET /collections/:id/documents accepts filter (field.op.value terms; eq neq gt gte lt lte like in is; dotted paths index into document data) and order (field.asc|desc). Whitelisted field/operator parsing with parameterized values; plain lists keep the sqlc path. CLI gains `documents list --collection --filter --order`; OpenAPI + generated client updated. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
1 parent
f9e7002048
commit
8892c6dc43
11 files changed
+489
-8
No files matched your search
@@ -2,6 +2,7 @@ import { cac } from "cac";
|
||||
|
||||
import { cmdLogin, cmdLogout, cmdWhoami } from "./commands/auth.js";
|
||||
import { cmdAuditList } from "./commands/audit.js";
|
||||
import { cmdDocumentsList } from "./commands/documents.js";
|
||||
import { cmdBucketsCreate, cmdBucketsList } from "./commands/buckets.js";
|
||||
import { cmdContext, cmdUse } from "./commands/context.js";
|
||||
import { cmdInject } from "./commands/inject.js";
|
||||
@@ -156,6 +157,16 @@ cli
|
||||
.option("--yes", "Skip the confirmation prompt")
|
||||
.action(cmdJobsRemove);
|
||||
|
||||
cli
|
||||
.command("documents:list", "List documents in a collection (PostgREST-style --filter/--order)")
|
||||
.option("--collection <slug|id>", "Collection slug or id (required)")
|
||||
.option("--project <id>", "Project override")
|
||||
.option("--filter <expr>", "field.op.value terms, comma-separated (eq neq gt gte lt lte like in is)")
|
||||
.option("--order <expr>", "field.asc|field.desc list")
|
||||
.option("--limit <n>", "Page size (default 50)")
|
||||
.option("--offset <n>", "Page offset")
|
||||
.action(cmdDocumentsList);
|
||||
|
||||
cli
|
||||
.command("audit:list", "List audit events for the current project")
|
||||
.option("--project <id>", "Project override")
|
||||
@@ -289,6 +300,7 @@ const GROUPS = new Set([
|
||||
"projects",
|
||||
"buckets",
|
||||
"objects",
|
||||
"documents",
|
||||
"keys",
|
||||
"jobs",
|
||||
"audit",
|
||||
|
||||
Reference in new issue
Block a user