From d178f8e6f481d11d89dcad4d9266323219012aac Mon Sep 17 00:00:00 2001 From: Yanay Date: Wed, 24 Jun 2026 13:28:22 +0300 Subject: [PATCH] feat(entities): add `createdAt` sortBy, deprecate `new` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Mirrors the v7 server: `createdAt` is the canonical time sort; `new` stays as a deprecated alias (removed in v8, marked @deprecated). Server behavior unchanged — `new` is treated identically and flagged via deprecation headers. Co-Authored-By: Claude Opus 4.8 --- src/modules/entities/fetchManyEntities.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/modules/entities/fetchManyEntities.ts b/src/modules/entities/fetchManyEntities.ts index b9e08f8..9e51d58 100644 --- a/src/modules/entities/fetchManyEntities.ts +++ b/src/modules/entities/fetchManyEntities.ts @@ -38,7 +38,16 @@ export interface FetchManyEntitiesProps extends SpaceReputationContextParams { // Sorting & Pagination // `metadata.` is also accepted by the server for metadata-based sorting. - sortBy?: "new" | "hot" | "top" | "controversial" | (string & {}); + sortBy?: + | "createdAt" + | "hot" + | "top" + | "controversial" + /** @deprecated Use "createdAt" instead. "new" is a directional alias removed + * in v8; the server still accepts it (identical behavior) but responds with + * deprecation headers. */ + | "new" + | (string & {}); sortDir?: "asc" | "desc"; sortType?: "auto" | "numeric" | "text" | "boolean" | "timestamp"; sortByReaction?: