@buildinternet/releases-api-types 0.53.0 → 0.55.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/package.json +2 -2
- package/src/api-types.ts +4 -1
- package/src/schemas/collections.ts +32 -2
- package/src/schemas/search.ts +11 -0
- package/src/schemas/shared.ts +3 -2
- package/src/schemas/taxonomy.ts +1 -1
package/README.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# @buildinternet/releases-api-types
|
|
2
2
|
|
|
3
|
+
**Scope:** request/response wire types for the public API worker — types only, zero runtime dependencies. No request logic, no client code, no server handlers.
|
|
4
|
+
|
|
3
5
|
Wire protocol types for the [Releases](https://releases.sh) registry API.
|
|
4
6
|
|
|
5
7
|
Pure TypeScript types — zero runtime dependencies — describing request/response
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@buildinternet/releases-api-types",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.55.0",
|
|
4
4
|
"description": "Wire protocol — request/response types for the Releases registry API. Shared by web, workers, and clients.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"README.md"
|
|
18
18
|
],
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@buildinternet/releases-core": "^0.31.
|
|
20
|
+
"@buildinternet/releases-core": "^0.31.1",
|
|
21
21
|
"zod": "^4.4.3"
|
|
22
22
|
},
|
|
23
23
|
"publishConfig": {
|
package/src/api-types.ts
CHANGED
|
@@ -275,6 +275,7 @@ import type {
|
|
|
275
275
|
CollectionWeeklyDigestListItemSchema,
|
|
276
276
|
CollectionWeeklyDigestsResponseSchema,
|
|
277
277
|
DigestCoveredReleaseSchema,
|
|
278
|
+
DigestSectionSchema,
|
|
278
279
|
CollectionWeeklyDigestDetailSchema,
|
|
279
280
|
} from "./schemas/collections.js";
|
|
280
281
|
import type {
|
|
@@ -625,6 +626,7 @@ export {
|
|
|
625
626
|
CollectionWeeklyDigestListItemSchema,
|
|
626
627
|
CollectionWeeklyDigestsResponseSchema,
|
|
627
628
|
DigestCoveredReleaseSchema,
|
|
629
|
+
DigestSectionSchema,
|
|
628
630
|
CollectionWeeklyDigestDetailSchema,
|
|
629
631
|
} from "./schemas/collections.js";
|
|
630
632
|
export {
|
|
@@ -1768,7 +1770,7 @@ export type TagDetail = z.infer<typeof TagDetailSchema>;
|
|
|
1768
1770
|
/**
|
|
1769
1771
|
* Aggregated release feed row for a category rollup — same wire shape as
|
|
1770
1772
|
* `CollectionReleaseItem` (both surfaces use `formatAggregateReleaseRow` in
|
|
1771
|
-
* `
|
|
1773
|
+
* `apps/api/src/utils.ts`). Aliased rather than duplicated so renderers
|
|
1772
1774
|
* can treat them as one.
|
|
1773
1775
|
*/
|
|
1774
1776
|
export type CategoryReleaseItem = CollectionReleaseItem;
|
|
@@ -1806,6 +1808,7 @@ export type CollectionDailySummariesResponse = z.infer<
|
|
|
1806
1808
|
export type CollectionWeeklyDigestListItem = z.infer<typeof CollectionWeeklyDigestListItemSchema>;
|
|
1807
1809
|
export type CollectionWeeklyDigestsResponse = z.infer<typeof CollectionWeeklyDigestsResponseSchema>;
|
|
1808
1810
|
export type DigestCoveredRelease = z.infer<typeof DigestCoveredReleaseSchema>;
|
|
1811
|
+
export type DigestSection = z.infer<typeof DigestSectionSchema>;
|
|
1809
1812
|
export type CollectionWeeklyDigestDetail = z.infer<typeof CollectionWeeklyDigestDetailSchema>;
|
|
1810
1813
|
|
|
1811
1814
|
// ── Releases (enriched) ──
|
|
@@ -273,8 +273,18 @@ export const CollectionWeeklyDigestsResponseSchema = z.object({
|
|
|
273
273
|
export const DigestCoveredReleaseSchema = z.object({
|
|
274
274
|
id: z.string(),
|
|
275
275
|
title: z.string(),
|
|
276
|
+
/** Internal `/release/*` path — fallback link only (see `url`). */
|
|
276
277
|
path: z.string(),
|
|
277
|
-
|
|
278
|
+
/** Upstream source URL. Primary link target when http(s); optional for older servers. */
|
|
279
|
+
url: z.string().nullable().optional(),
|
|
280
|
+
org: z.object({
|
|
281
|
+
slug: z.string(),
|
|
282
|
+
name: z.string(),
|
|
283
|
+
avatarUrl: z.string().nullable().optional(),
|
|
284
|
+
githubHandle: z.string().nullable().optional(),
|
|
285
|
+
}),
|
|
286
|
+
/** Product the release's source belongs to, when it has one. */
|
|
287
|
+
product: z.object({ slug: z.string(), name: z.string() }).nullable().optional(),
|
|
278
288
|
/**
|
|
279
289
|
* AI-scored importance 1–5. Null when unscored; optional for older
|
|
280
290
|
* servers. Cheap to project on the existing hydrate — powers the flame
|
|
@@ -283,7 +293,25 @@ export const DigestCoveredReleaseSchema = z.object({
|
|
|
283
293
|
importance: ImportanceScoreSchema,
|
|
284
294
|
});
|
|
285
295
|
|
|
286
|
-
/**
|
|
296
|
+
/** One `###` section of a digest body, parsed server-side. */
|
|
297
|
+
export const DigestSectionSchema = z.object({
|
|
298
|
+
heading: z.string(),
|
|
299
|
+
/** Slug the digest page renders as the heading's `id` — link target `#anchor`. */
|
|
300
|
+
anchor: z.string(),
|
|
301
|
+
/** First sentence of the section, plain text. */
|
|
302
|
+
lede: z.string(),
|
|
303
|
+
/** Cited release ids in first-seen order; resolve against the detail's `releases`. */
|
|
304
|
+
releaseIds: z.array(z.string()),
|
|
305
|
+
/**
|
|
306
|
+
* The section's cited releases, resolved server-side in `releaseIds` order.
|
|
307
|
+
* Ids that no longer resolve are dropped, so `releases.length` can be less
|
|
308
|
+
* than `releaseIds.length`. Optional for older servers.
|
|
309
|
+
*/
|
|
310
|
+
releases: z.array(DigestCoveredReleaseSchema).optional(),
|
|
311
|
+
});
|
|
312
|
+
|
|
313
|
+
/** Full row returned by `GET /v1/collections/:slug/digests/:weekStart` and
|
|
314
|
+
* `GET /v1/collections/:slug/digests/latest`. */
|
|
287
315
|
export const CollectionWeeklyDigestDetailSchema = z.object({
|
|
288
316
|
id: z.string(),
|
|
289
317
|
weekStart: z.string(),
|
|
@@ -297,4 +325,6 @@ export const CollectionWeeklyDigestDetailSchema = z.object({
|
|
|
297
325
|
* still resolves — a release deleted/suppressed after generation is
|
|
298
326
|
* dropped rather than surfaced as a dead link. */
|
|
299
327
|
releases: z.array(DigestCoveredReleaseSchema),
|
|
328
|
+
/** Parsed `###` sections. Optional for older servers. */
|
|
329
|
+
sections: z.array(DigestSectionSchema).optional(),
|
|
300
330
|
});
|
package/src/schemas/search.ts
CHANGED
|
@@ -110,6 +110,14 @@ export const SearchReleaseHitSchema = z.object({
|
|
|
110
110
|
summary: z.string(),
|
|
111
111
|
titleGenerated: z.string().nullable().optional(),
|
|
112
112
|
titleShort: z.string().nullable().optional(),
|
|
113
|
+
/**
|
|
114
|
+
* The release's upstream source URL, when it has one. Lets the web link
|
|
115
|
+
* search/lookup hits straight to the original page instead of the
|
|
116
|
+
* noindexed `/release/<id>` stub — see `releaseLinkProps()` in
|
|
117
|
+
* `apps/web/src/lib/release-link.ts`. Optional for older servers / mid-deploy
|
|
118
|
+
* pin tolerance.
|
|
119
|
+
*/
|
|
120
|
+
url: z.string().nullable().optional(),
|
|
113
121
|
/**
|
|
114
122
|
* AI-scored importance 1–5 (5=landmark, 1=housekeeping). Null when
|
|
115
123
|
* unscored; optional for older servers / mid-deploy pin tolerance.
|
|
@@ -213,6 +221,9 @@ export const LookupResultPayloadSchema = z.object({
|
|
|
213
221
|
publishedAt: z.string().nullable(),
|
|
214
222
|
/** First image/gif thumbnail; null when the release has none. */
|
|
215
223
|
thumbnail: ReleaseThumbnailSchema.nullable().optional(),
|
|
224
|
+
/** The release's upstream source URL, when it has one. See
|
|
225
|
+
* `SearchReleaseHitSchema.url`. */
|
|
226
|
+
url: z.string().nullable().optional(),
|
|
216
227
|
}),
|
|
217
228
|
)
|
|
218
229
|
.optional(),
|
package/src/schemas/shared.ts
CHANGED
|
@@ -206,8 +206,9 @@ export const OverviewCitationSchema = z.object({
|
|
|
206
206
|
releaseId: z.string().nullable().optional(),
|
|
207
207
|
/**
|
|
208
208
|
* Canonical web URL of the on-registry release page for this source, when
|
|
209
|
-
* `releaseId` resolved (#1934).
|
|
210
|
-
*
|
|
209
|
+
* `releaseId` resolved (#1934). Kept for machine consumers; the web Sources
|
|
210
|
+
* footer links `sourceUrl` (the #2218 link policy — `/release/*` pages are
|
|
211
|
+
* noindexed).
|
|
211
212
|
*/
|
|
212
213
|
releaseWebUrl: z.string().nullable().optional(),
|
|
213
214
|
/**
|
package/src/schemas/taxonomy.ts
CHANGED
|
@@ -95,7 +95,7 @@ export const UpdateCategoryResponseSchema = z.object({
|
|
|
95
95
|
/**
|
|
96
96
|
* Aggregated release row on `GET /v1/categories/:slug/releases`. Same wire
|
|
97
97
|
* shape as `CollectionReleaseItem` — both surfaces aggregate across orgs and
|
|
98
|
-
* use `formatAggregateReleaseRow` in `
|
|
98
|
+
* use `formatAggregateReleaseRow` in `apps/api/src/utils.ts` for the
|
|
99
99
|
* formatting. Re-exported here so the two endpoints describe one schema
|
|
100
100
|
* instead of two drifting copies.
|
|
101
101
|
*/
|